diff --git a/build.ts b/build.ts index d02da45..62752da 100644 --- a/build.ts +++ b/build.ts @@ -119,6 +119,17 @@ const result = await Bun.build({ '@opentelemetry/exporter-metrics-otlp-grpc', '@opentelemetry/exporter-metrics-otlp-http', '@opentelemetry/exporter-metrics-otlp-proto', '@opentelemetry/exporter-prometheus', '@opentelemetry/exporter-trace-otlp-grpc', '@opentelemetry/exporter-trace-otlp-proto', + // Internal Anthropic packages (not publicly available) + '@ant/claude-for-chrome-mcp', + '@anthropic-ai/sandbox-runtime', + '@anthropic-ai/mcpb', + // Cloud provider SDKs (optional, only needed for Bedrock/Vertex/Foundry) + '@anthropic-ai/bedrock-sdk', + '@anthropic-ai/foundry-sdk', + '@anthropic-ai/vertex-sdk', + '@aws-sdk/client-sts', + '@aws-sdk/client-bedrock', + '@aws-sdk/client-bedrock-runtime', ]; build.onResolve({ filter: /.*/ }, (args: any) => { if (args.namespace.startsWith('stub-')) return; @@ -129,17 +140,58 @@ const result = await Bun.build({ } }); build.onLoad({ filter: /.*/, namespace: 'stub-npm' }, (args: any) => { - // Return a Proxy-based stub that handles any named import + // Scan source files to find all named imports from this package + const importNames: Set = new Set(); + const srcDir = path.resolve(projectRoot, 'src'); + + function scanDir(dir: string) { + try { + const entries = fs.readdirSync(dir, { withFileTypes: true }); + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory() && entry.name !== 'node_modules') { + scanDir(fullPath); + } else if (/\.(ts|tsx|js|jsx)$/.test(entry.name)) { + try { + const src = fs.readFileSync(fullPath, 'utf8'); + // Match: import { X, Y as Z } from 'package' + const pkgEscaped = args.path.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const importRegex = new RegExp( + `import\\s*\\{([^}]+)\\}\\s*from\\s*['"]${pkgEscaped}['"]`, + 'g' + ); + let match; + while ((match = importRegex.exec(src)) !== null) { + const names = match[1].split(',').map((n: string) => { + const parts = n.trim().split(/\s+as\s+/); + return parts[0].trim(); // Use the original export name + }); + for (const name of names) { + if (name && name !== 'default' && !name.startsWith('type ')) { + // Strip leading 'type ' for type-only imports + const cleanName = name.replace(/^type\s+/, ''); + if (cleanName) importNames.add(cleanName); + } + } + } + } catch {} + } + } + } catch {} + } + scanDir(srcDir); + + const namedExports = [...importNames] + .map(name => `export const ${name} = new Proxy(function(){}, { get: (t, p) => typeof p === 'string' ? (() => {}) : t[p], apply: () => ({}) });`) + .join('\n'); + return { contents: ` const handler = { get: (t, p) => p === '__esModule' ? true : () => {} }; const stub = new Proxy({}, handler); export default stub; export const __stub__ = true; - export const confirm = () => {}; - export const input = () => {}; - export const select = () => {}; - export const DestroyerOfModules = class {}; + ${namedExports} `, loader: 'js', }; @@ -231,7 +283,7 @@ const result = await Bun.build({ } const namedExports = [...new Set(exportNames)] - .map(name => `export const ${name} = undefined;`) + .map(name => `export const ${name} = new Proxy(function(){}, { get: (t, p) => typeof p === 'string' ? (() => {}) : t[p], apply: () => ({}) });`) .join('\n'); return { diff --git a/dist/cli.js b/dist/cli.js index 4627744..73de38e 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -90478,7 +90478,7 @@ var require_fromBase64 = __commonJS((exports) => { exports.fromBase64 = undefined; var util_buffer_from_1 = require_dist_cjs15(); var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; - var fromBase642 = (input) => { + var fromBase64 = (input) => { if (input.length * 3 % 4 !== 0) { throw new TypeError(`Incorrect padding on base64 string.`); } @@ -90488,7 +90488,7 @@ var require_fromBase64 = __commonJS((exports) => { const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); }; - exports.fromBase64 = fromBase642; + exports.fromBase64 = fromBase64; }); // node_modules/@smithy/util-utf8/dist-cjs/index.js @@ -90527,7 +90527,7 @@ var require_toBase64 = __commonJS((exports) => { exports.toBase64 = undefined; var util_buffer_from_1 = require_dist_cjs15(); var util_utf8_1 = require_dist_cjs16(); - var toBase642 = (_input) => { + var toBase64 = (_input) => { let input; if (typeof _input === "string") { input = (0, util_utf8_1.fromUtf8)(_input); @@ -90539,28 +90539,28 @@ var require_toBase64 = __commonJS((exports) => { } return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); }; - exports.toBase64 = toBase642; + exports.toBase64 = toBase64; }); // node_modules/@smithy/util-base64/dist-cjs/index.js var require_dist_cjs17 = __commonJS((exports) => { - var fromBase642 = require_fromBase64(); - var toBase642 = require_toBase64(); - Object.prototype.hasOwnProperty.call(fromBase642, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { + var fromBase64 = require_fromBase64(); + var toBase64 = require_toBase64(); + Object.prototype.hasOwnProperty.call(fromBase64, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { enumerable: true, - value: fromBase642["__proto__"] + value: fromBase64["__proto__"] }); - Object.keys(fromBase642).forEach(function(k) { + Object.keys(fromBase64).forEach(function(k) { if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - exports[k] = fromBase642[k]; + exports[k] = fromBase64[k]; }); - Object.prototype.hasOwnProperty.call(toBase642, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { + Object.prototype.hasOwnProperty.call(toBase64, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { enumerable: true, - value: toBase642["__proto__"] + value: toBase64["__proto__"] }); - Object.keys(toBase642).forEach(function(k) { + Object.keys(toBase64).forEach(function(k) { if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - exports[k] = toBase642[k]; + exports[k] = toBase64[k]; }); }); @@ -90915,7 +90915,7 @@ var require_createBufferedReadable = __commonJS((exports) => { var require_getAwsChunkedEncodingStream_browser = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getAwsChunkedEncodingStream = undefined; - var getAwsChunkedEncodingStream2 = (readableStream, options) => { + var getAwsChunkedEncodingStream = (readableStream, options) => { const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; const checksumRequired = base64Encoder !== undefined && bodyLengthChecker !== undefined && checksumAlgorithmFn !== undefined && checksumLocationName !== undefined && streamHasher !== undefined; const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined; @@ -90942,17 +90942,17 @@ ${value}\r } }); }; - exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream2; + exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; }); // node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js var require_getAwsChunkedEncodingStream = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream2; + exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; var node_stream_1 = __require("node:stream"); var getAwsChunkedEncodingStream_browser_1 = require_getAwsChunkedEncodingStream_browser(); var stream_type_check_1 = require_stream_type_check(); - function getAwsChunkedEncodingStream2(stream4, options) { + function getAwsChunkedEncodingStream(stream4, options) { const readable2 = stream4; const readableStream = stream4; if ((0, stream_type_check_1.isReadableStream)(readableStream)) { @@ -91347,7 +91347,7 @@ var require_sdk_stream_mixin_browser = __commonJS((exports) => { var util_utf8_1 = require_dist_cjs16(); var stream_type_check_1 = require_stream_type_check(); var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; - var sdkStreamMixin2 = (stream4) => { + var sdkStreamMixin = (stream4) => { if (!isBlobInstance(stream4) && !(0, stream_type_check_1.isReadableStream)(stream4)) { const name = stream4?.__proto__?.constructor?.name || stream4; throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`); @@ -91398,7 +91398,7 @@ var require_sdk_stream_mixin_browser = __commonJS((exports) => { } }); }; - exports.sdkStreamMixin = sdkStreamMixin2; + exports.sdkStreamMixin = sdkStreamMixin; var isBlobInstance = (stream4) => typeof Blob === "function" && stream4 instanceof Blob; }); @@ -91411,7 +91411,7 @@ var require_sdk_stream_mixin = __commonJS((exports) => { var stream_1 = __require("stream"); var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser(); var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; - var sdkStreamMixin2 = (stream4) => { + var sdkStreamMixin = (stream4) => { if (!(stream4 instanceof stream_1.Readable)) { try { return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream4); @@ -91454,7 +91454,7 @@ var require_sdk_stream_mixin = __commonJS((exports) => { } }); }; - exports.sdkStreamMixin = sdkStreamMixin2; + exports.sdkStreamMixin = sdkStreamMixin; }); // node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js @@ -91496,9 +91496,9 @@ var require_dist_cjs20 = __commonJS((exports) => { var ChecksumStream = require_ChecksumStream(); var createChecksumStream = require_createChecksumStream(); var createBufferedReadable = require_createBufferedReadable(); - var getAwsChunkedEncodingStream2 = require_getAwsChunkedEncodingStream(); + var getAwsChunkedEncodingStream = require_getAwsChunkedEncodingStream(); var headStream = require_headStream(); - var sdkStreamMixin2 = require_sdk_stream_mixin(); + var sdkStreamMixin = require_sdk_stream_mixin(); var splitStream = require_splitStream(); var streamTypeCheck = require_stream_type_check(); @@ -91550,13 +91550,13 @@ var require_dist_cjs20 = __commonJS((exports) => { if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = createBufferedReadable[k]; }); - Object.prototype.hasOwnProperty.call(getAwsChunkedEncodingStream2, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { + Object.prototype.hasOwnProperty.call(getAwsChunkedEncodingStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { enumerable: true, - value: getAwsChunkedEncodingStream2["__proto__"] + value: getAwsChunkedEncodingStream["__proto__"] }); - Object.keys(getAwsChunkedEncodingStream2).forEach(function(k) { + Object.keys(getAwsChunkedEncodingStream).forEach(function(k) { if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - exports[k] = getAwsChunkedEncodingStream2[k]; + exports[k] = getAwsChunkedEncodingStream[k]; }); Object.prototype.hasOwnProperty.call(headStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { enumerable: true, @@ -91566,13 +91566,13 @@ var require_dist_cjs20 = __commonJS((exports) => { if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = headStream[k]; }); - Object.prototype.hasOwnProperty.call(sdkStreamMixin2, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { + Object.prototype.hasOwnProperty.call(sdkStreamMixin, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { enumerable: true, - value: sdkStreamMixin2["__proto__"] + value: sdkStreamMixin["__proto__"] }); - Object.keys(sdkStreamMixin2).forEach(function(k) { + Object.keys(sdkStreamMixin).forEach(function(k) { if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - exports[k] = sdkStreamMixin2[k]; + exports[k] = sdkStreamMixin[k]; }); Object.prototype.hasOwnProperty.call(splitStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", { enumerable: true, @@ -108216,33499 +108216,30 @@ var init_proxy = __esm(() => { }); }); -// ../node_modules/@smithy/types/dist-cjs/index.js -var require_dist_cjs55 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - AlgorithmId: () => AlgorithmId, - EndpointURLScheme: () => EndpointURLScheme, - FieldPosition: () => FieldPosition, - HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation, - HttpAuthLocation: () => HttpAuthLocation, - IniSectionType: () => IniSectionType, - RequestHandlerProtocol: () => RequestHandlerProtocol, - SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY, - getDefaultClientConfiguration: () => getDefaultClientConfiguration, - resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig - }); - module.exports = __toCommonJS2(src_exports); - var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => { - HttpAuthLocation2["HEADER"] = "header"; - HttpAuthLocation2["QUERY"] = "query"; - return HttpAuthLocation2; - })(HttpAuthLocation || {}); - var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => { - HttpApiKeyAuthLocation2["HEADER"] = "header"; - HttpApiKeyAuthLocation2["QUERY"] = "query"; - return HttpApiKeyAuthLocation2; - })(HttpApiKeyAuthLocation || {}); - var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => { - EndpointURLScheme2["HTTP"] = "http"; - EndpointURLScheme2["HTTPS"] = "https"; - return EndpointURLScheme2; - })(EndpointURLScheme || {}); - var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => { - AlgorithmId2["MD5"] = "md5"; - AlgorithmId2["CRC32"] = "crc32"; - AlgorithmId2["CRC32C"] = "crc32c"; - AlgorithmId2["SHA1"] = "sha1"; - AlgorithmId2["SHA256"] = "sha256"; - return AlgorithmId2; - })(AlgorithmId || {}); - var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => "sha256", - checksumConstructor: () => runtimeConfig.sha256 - }); - } - if (runtimeConfig.md5 != null) { - checksumAlgorithms.push({ - algorithmId: () => "md5", - checksumConstructor: () => runtimeConfig.md5 - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - } - }; - }, "getChecksumConfiguration"); - var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; - }, "resolveChecksumRuntimeConfig"); - var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - return { - ...getChecksumConfiguration(runtimeConfig) - }; - }, "getDefaultClientConfiguration"); - var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config2) => { - return { - ...resolveChecksumRuntimeConfig(config2) - }; - }, "resolveDefaultRuntimeConfig"); - var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => { - FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; - FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; - return FieldPosition2; - })(FieldPosition || {}); - var SMITHY_CONTEXT_KEY = "__smithy_context"; - var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => { - IniSectionType2["PROFILE"] = "profile"; - IniSectionType2["SSO_SESSION"] = "sso-session"; - IniSectionType2["SERVICES"] = "services"; - return IniSectionType2; - })(IniSectionType || {}); - var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => { - RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; - return RequestHandlerProtocol2; - })(RequestHandlerProtocol || {}); -}); - -// ../node_modules/@smithy/protocol-http/dist-cjs/index.js -var require_dist_cjs56 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - Field: () => Field, - Fields: () => Fields, - HttpRequest: () => HttpRequest, - HttpResponse: () => HttpResponse, - getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration, - isValidHostname: () => isValidHostname, - resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig - }); - module.exports = __toCommonJS2(src_exports); - var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - } - }; - }, "getHttpHandlerExtensionConfiguration"); - var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler() - }; - }, "resolveHttpHandlerRuntimeConfig"); - var import_types6 = require_dist_cjs55(); - var _Field = class _Field2 { - constructor({ name, kind = import_types6.FieldPosition.HEADER, values: values2 = [] }) { - this.name = name; - this.kind = kind; - this.values = values2; - } - add(value) { - this.values.push(value); - } - set(values2) { - this.values = values2; - } - remove(value) { - this.values = this.values.filter((v) => v !== value); - } - toString() { - return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); - } - get() { - return this.values; - } - }; - __name(_Field, "Field"); - var Field = _Field; - var _Fields = class _Fields2 { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - fields.forEach(this.setField.bind(this)); - this.encoding = encoding; - } - setField(field) { - this.entries[field.name.toLowerCase()] = field; - } - getField(name) { - return this.entries[name.toLowerCase()]; - } - removeField(name) { - delete this.entries[name.toLowerCase()]; - } - getByType(kind) { - return Object.values(this.entries).filter((field) => field.kind === kind); - } - }; - __name(_Fields, "Fields"); - var Fields = _Fields; - var _HttpRequest = class _HttpRequest2 { - 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 isInstance(request) { - if (!request) - return false; - const req = request; - return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; - } - clone() { - const cloned = new _HttpRequest2({ - ...this, - headers: { ...this.headers } - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } - }; - __name(_HttpRequest, "HttpRequest"); - var HttpRequest = _HttpRequest; - function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param - }; - }, {}); - } - __name(cloneQuery, "cloneQuery"); - var _HttpResponse = class _HttpResponse2 { - 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"; - } - }; - __name(_HttpResponse, "HttpResponse"); - var HttpResponse = _HttpResponse; - function isValidHostname(hostname2) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname2); - } - __name(isValidHostname, "isValidHostname"); -}); - -// ../node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js -var require_dist_cjs57 = __commonJS((exports) => { - var protocolHttp = require_dist_cjs56(); - function resolveHostHeaderConfig(input) { - return input; - } - var hostHeaderMiddleware = (options) => (next) => async (args) => { - if (!protocolHttp.HttpRequest.isInstance(args.request)) - return next(args); - const { request } = args; - const { handlerProtocol = "" } = options.requestHandler.metadata || {}; - if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { - delete request.headers["host"]; - request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : ""); - } else if (!request.headers["host"]) { - let host = request.hostname; - if (request.port != null) - host += `:${request.port}`; - request.headers["host"] = host; - } - return next(args); - }; - var hostHeaderMiddlewareOptions = { - name: "hostHeaderMiddleware", - step: "build", - priority: "low", - tags: ["HOST"], - override: true - }; - var getHostHeaderPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); - } - }); - exports.getHostHeaderPlugin = getHostHeaderPlugin; - exports.hostHeaderMiddleware = hostHeaderMiddleware; - exports.hostHeaderMiddlewareOptions = hostHeaderMiddlewareOptions; - exports.resolveHostHeaderConfig = resolveHostHeaderConfig; -}); - -// ../node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js -var require_dist_cjs58 = __commonJS((exports) => { - var loggerMiddleware = () => (next, context) => async (args) => { - try { - const response = await next(args); - const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; - const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; - const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog; - const { $metadata, ...outputWithoutMetadata } = response.output; - logger?.info?.({ - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - output: outputFilterSensitiveLog(outputWithoutMetadata), - metadata: $metadata - }); - return response; - } catch (error41) { - const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; - const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; - logger?.error?.({ - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - error: error41, - metadata: error41.$metadata - }); - throw error41; - } - }; - var loggerMiddlewareOptions = { - name: "loggerMiddleware", - tags: ["LOGGER"], - step: "initialize", - override: true - }; - var getLoggerPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); - } - }); - exports.getLoggerPlugin = getLoggerPlugin; - exports.loggerMiddleware = loggerMiddleware; - exports.loggerMiddlewareOptions = loggerMiddlewareOptions; -}); - -// ../node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js -var require_invoke_store2 = __commonJS((exports) => { - var PROTECTED_KEYS = { - REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"), - X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"), - TENANT_ID: Symbol.for("_AWS_LAMBDA_TENANT_ID") - }; - var NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? ""); - if (!NO_GLOBAL_AWS_LAMBDA) { - globalThis.awslambda = globalThis.awslambda || {}; - } - - class InvokeStoreBase { - 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); - } - } - - class InvokeStoreSingle extends InvokeStoreBase { - currentContext; - getContext() { - return this.currentContext; - } - hasContext() { - return this.currentContext !== undefined; - } - get(key) { - return this.currentContext?.[key]; - } - set(key, value) { - if (this.isProtectedKey(key)) { - throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); - } - this.currentContext = this.currentContext || {}; - this.currentContext[key] = value; - } - run(context, fn) { - this.currentContext = context; - return fn(); - } - } - - class InvokeStoreMulti extends InvokeStoreBase { - als; - static async create() { - const instance = new InvokeStoreMulti; - const asyncHooks = await import("node:async_hooks"); - instance.als = new asyncHooks.AsyncLocalStorage; - return instance; - } - getContext() { - return this.als.getStore(); - } - hasContext() { - return this.als.getStore() !== undefined; - } - get(key) { - return this.als.getStore()?.[key]; - } - set(key, value) { - if (this.isProtectedKey(key)) { - throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); - } - const store = this.als.getStore(); - if (!store) { - throw new Error("No context available"); - } - store[key] = value; - } - run(context, fn) { - return this.als.run(context, fn); - } - } - exports.InvokeStore = undefined; - (function(InvokeStore) { - 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; - } - InvokeStore.getInstanceAsync = getInstanceAsync; - InvokeStore._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? { - reset: () => { - instance = null; - if (globalThis.awslambda?.InvokeStore) { - delete globalThis.awslambda.InvokeStore; - } - globalThis.awslambda = { InvokeStore: undefined }; - } - } : undefined; - })(exports.InvokeStore || (exports.InvokeStore = {})); - exports.InvokeStoreBase = InvokeStoreBase; -}); - -// ../node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js -var require_recursionDetectionMiddleware2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.recursionDetectionMiddleware = undefined; - var lambda_invoke_store_1 = require_invoke_store2(); - var protocol_http_1 = require_dist_cjs56(); - var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; - var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; - var ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; - var recursionDetectionMiddleware = () => (next) => async (args) => { - const { request } = args; - if (!protocol_http_1.HttpRequest.isInstance(request)) { - return next(args); - } - const traceIdHeader = Object.keys(request.headers ?? {}).find((h2) => h2.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME; - if (request.headers.hasOwnProperty(traceIdHeader)) { - return next(args); - } - const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; - const traceIdFromEnv = process.env[ENV_TRACE_ID]; - const invokeStore = await lambda_invoke_store_1.InvokeStore.getInstanceAsync(); - const traceIdFromInvokeStore = invokeStore?.getXRayTraceId(); - const traceId = traceIdFromInvokeStore ?? traceIdFromEnv; - const nonEmptyString2 = (str) => typeof str === "string" && str.length > 0; - if (nonEmptyString2(functionName) && nonEmptyString2(traceId)) { - request.headers[TRACE_ID_HEADER_NAME] = traceId; - } - return next({ - ...args, - request - }); - }; - exports.recursionDetectionMiddleware = recursionDetectionMiddleware; -}); - -// ../node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js -var require_dist_cjs59 = __commonJS((exports) => { - var recursionDetectionMiddleware = require_recursionDetectionMiddleware2(); - var recursionDetectionMiddlewareOptions = { - step: "build", - tags: ["RECURSION_DETECTION"], - name: "recursionDetectionMiddleware", - override: true, - priority: "low" - }; - var getRecursionDetectionPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(recursionDetectionMiddleware.recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions); - } - }); - exports.getRecursionDetectionPlugin = getRecursionDetectionPlugin; - Object.keys(recursionDetectionMiddleware).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - Object.defineProperty(exports, k, { - enumerable: true, - get: function() { - return recursionDetectionMiddleware[k]; - } - }); - }); -}); - -// ../node_modules/@smithy/util-middleware/dist-cjs/index.js -var require_dist_cjs60 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - getSmithyContext: () => getSmithyContext, - normalizeProvider: () => normalizeProvider - }); - module.exports = __toCommonJS2(src_exports); - var import_types6 = require_dist_cjs55(); - var getSmithyContext = /* @__PURE__ */ __name((context) => context[import_types6.SMITHY_CONTEXT_KEY] || (context[import_types6.SMITHY_CONTEXT_KEY] = {}), "getSmithyContext"); - var normalizeProvider = /* @__PURE__ */ __name((input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; - }, "normalizeProvider"); -}); - -// ../node_modules/@smithy/middleware-serde/dist-cjs/index.js -var require_dist_cjs61 = __commonJS((exports) => { - var protocolHttp = require_dist_cjs56(); - var deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => { - const { response } = await next(args); - try { - const parsed = await deserializer(response, options); - return { - response, - output: parsed - }; - } catch (error41) { - Object.defineProperty(error41, "$response", { - value: response, - enumerable: false, - writable: false, - configurable: false - }); - if (!("$metadata" in error41)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - try { - error41.message += ` - ` + hint; - } catch (e) { - if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { - console.warn(hint); - } else { - context.logger?.warn?.(hint); - } - } - if (typeof error41.$responseBodyText !== "undefined") { - if (error41.$response) { - error41.$response.body = error41.$responseBodyText; - } - } - try { - if (protocolHttp.HttpResponse.isInstance(response)) { - const { headers = {} } = response; - const headerEntries = Object.entries(headers); - error41.$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 (e) {} - } - throw error41; - } - }; - var findHeader = (pattern, headers) => { - return (headers.find(([k]) => { - return k.match(pattern); - }) || [undefined, undefined])[1]; - }; - var serializerMiddleware = (options, serializer) => (next, context) => async (args) => { - const endpointConfig = options; - const endpoint = context.endpointV2?.url && endpointConfig.urlParser ? async () => endpointConfig.urlParser(context.endpointV2.url) : endpointConfig.endpoint; - if (!endpoint) { - throw new Error("No valid endpoint provider available."); - } - const request = await serializer(args.input, { ...options, endpoint }); - return next({ - ...args, - request - }); - }; - var deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true - }; - var serializerMiddlewareOption = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true - }; - function getSerdePlugin(config2, serializer, deserializer) { - return { - applyToStack: (commandStack) => { - commandStack.add(deserializerMiddleware(config2, deserializer), deserializerMiddlewareOption); - commandStack.add(serializerMiddleware(config2, serializer), serializerMiddlewareOption); - } - }; - } - exports.deserializerMiddleware = deserializerMiddleware; - exports.deserializerMiddlewareOption = deserializerMiddlewareOption; - exports.getSerdePlugin = getSerdePlugin; - exports.serializerMiddleware = serializerMiddleware; - exports.serializerMiddlewareOption = serializerMiddlewareOption; -}); - -// ../node_modules/@smithy/is-array-buffer/dist-cjs/index.js -var require_dist_cjs62 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - isArrayBuffer: () => isArrayBuffer4 - }); - module.exports = __toCommonJS2(src_exports); - var isArrayBuffer4 = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer"); -}); - -// ../node_modules/@smithy/util-buffer-from/dist-cjs/index.js -var require_dist_cjs63 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - fromArrayBuffer: () => fromArrayBuffer, - fromString: () => fromString - }); - module.exports = __toCommonJS2(src_exports); - var import_is_array_buffer = require_dist_cjs62(); - var import_buffer2 = __require("buffer"); - var fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => { - if (!(0, import_is_array_buffer.isArrayBuffer)(input)) { - throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); - } - return import_buffer2.Buffer.from(input, offset, length); - }, "fromArrayBuffer"); - var fromString = /* @__PURE__ */ __name((input, encoding) => { - if (typeof input !== "string") { - throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); - } - return encoding ? import_buffer2.Buffer.from(input, encoding) : import_buffer2.Buffer.from(input); - }, "fromString"); -}); - -// ../node_modules/@smithy/util-base64/dist-cjs/fromBase64.js -var require_fromBase642 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromBase64 = undefined; - var util_buffer_from_1 = require_dist_cjs63(); - var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; - var fromBase642 = (input) => { - if (input.length * 3 % 4 !== 0) { - throw new TypeError(`Incorrect padding on base64 string.`); - } - if (!BASE64_REGEX.exec(input)) { - throw new TypeError(`Invalid base64 string.`); - } - const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - }; - exports.fromBase64 = fromBase642; -}); - -// ../node_modules/@smithy/util-utf8/dist-cjs/index.js -var require_dist_cjs64 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - fromUtf8: () => fromUtf8, - toUint8Array: () => toUint8Array, - toUtf8: () => toUtf8 - }); - module.exports = __toCommonJS2(src_exports); - var import_util_buffer_from = require_dist_cjs63(); - var fromUtf8 = /* @__PURE__ */ __name((input) => { - const buf = (0, import_util_buffer_from.fromString)(input, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); - }, "fromUtf8"); - var toUint8Array = /* @__PURE__ */ __name((data) => { - if (typeof data === "string") { - return fromUtf8(data); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); - } - return new Uint8Array(data); - }, "toUint8Array"); - var toUtf8 = /* @__PURE__ */ __name((input) => { - if (typeof input === "string") { - return input; - } - if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { - throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array."); - } - return (0, import_util_buffer_from.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); - }, "toUtf8"); -}); - -// ../node_modules/@smithy/util-base64/dist-cjs/toBase64.js -var require_toBase642 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toBase64 = undefined; - var util_buffer_from_1 = require_dist_cjs63(); - var util_utf8_1 = require_dist_cjs64(); - var toBase642 = (_input) => { - let input; - if (typeof _input === "string") { - input = (0, util_utf8_1.fromUtf8)(_input); - } else { - input = _input; - } - if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { - throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); - } - return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); - }; - exports.toBase64 = toBase642; -}); - -// ../node_modules/@smithy/util-base64/dist-cjs/index.js -var require_dist_cjs65 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __reExport = (target, mod2, secondTarget) => (__copyProps(target, mod2, "default"), secondTarget && __copyProps(secondTarget, mod2, "default")); - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - module.exports = __toCommonJS2(src_exports); - __reExport(src_exports, require_fromBase642(), module.exports); - __reExport(src_exports, require_toBase642(), module.exports); -}); - -// ../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js -var require_getAwsChunkedEncodingStream2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getAwsChunkedEncodingStream = undefined; - var stream_1 = __require("stream"); - var getAwsChunkedEncodingStream2 = (readableStream, options) => { - const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; - const checksumRequired = base64Encoder !== undefined && checksumAlgorithmFn !== undefined && checksumLocationName !== undefined && streamHasher !== undefined; - const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined; - const awsChunkedEncodingStream = new stream_1.Readable({ read: () => {} }); - readableStream.on("data", (data) => { - const length = bodyLengthChecker(data) || 0; - awsChunkedEncodingStream.push(`${length.toString(16)}\r -`); - awsChunkedEncodingStream.push(data); - awsChunkedEncodingStream.push(`\r -`); - }); - readableStream.on("end", async () => { - awsChunkedEncodingStream.push(`0\r -`); - if (checksumRequired) { - const checksum = base64Encoder(await digest); - awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r -`); - awsChunkedEncodingStream.push(`\r -`); - } - awsChunkedEncodingStream.push(null); - }); - return awsChunkedEncodingStream; - }; - exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream2; -}); - -// ../node_modules/@smithy/util-uri-escape/dist-cjs/index.js -var require_dist_cjs66 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - escapeUri: () => escapeUri, - escapeUriPath: () => escapeUriPath - }); - module.exports = __toCommonJS2(src_exports); - var escapeUri = /* @__PURE__ */ __name((uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode), "escapeUri"); - var hexEncode = /* @__PURE__ */ __name((c5) => `%${c5.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); - var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath"); -}); - -// ../node_modules/@smithy/querystring-builder/dist-cjs/index.js -var require_dist_cjs67 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - buildQueryString: () => buildQueryString - }); - module.exports = __toCommonJS2(src_exports); - var import_util_uri_escape = require_dist_cjs66(); - function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, import_util_uri_escape.escapeUri)(key); - if (Array.isArray(value)) { - for (let i2 = 0, iLen = value.length;i2 < iLen; i2++) { - parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i2])}`); - } - } else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); - } - __name(buildQueryString, "buildQueryString"); -}); - -// ../node_modules/@smithy/node-http-handler/dist-cjs/index.js -var require_dist_cjs68 = __commonJS((exports, module) => { - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM2 = (mod2, isNodeMode, target) => (target = mod2 != null ? __create2(__getProtoOf2(mod2)) : {}, __copyProps(isNodeMode || !mod2 || !mod2.__esModule ? __defProp2(target, "default", { value: mod2, enumerable: true }) : target, mod2)); - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT, - NodeHttp2Handler: () => NodeHttp2Handler, - NodeHttpHandler: () => NodeHttpHandler, - streamCollector: () => streamCollector - }); - module.exports = __toCommonJS2(src_exports); - var import_protocol_http = require_dist_cjs56(); - var import_querystring_builder = require_dist_cjs67(); - var import_http4 = __require("http"); - var import_https3 = __require("https"); - var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - var getTransformedHeaders = /* @__PURE__ */ __name((headers) => { - const transformedHeaders = {}; - for (const name of Object.keys(headers)) { - const headerValues = headers[name]; - transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; - } - return transformedHeaders; - }, "getTransformedHeaders"); - var setConnectionTimeout = /* @__PURE__ */ __name((request, reject2, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; - } - const timeoutId = setTimeout(() => { - request.destroy(); - reject2(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError" - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } else { - clearTimeout(timeoutId); - } - }); - }, "setConnectionTimeout"); - var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; - } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); - }, "setSocketKeepAlive"); - var setSocketTimeout = /* @__PURE__ */ __name((request, reject2, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject2(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); - }, "setSocketTimeout"); - var import_stream7 = __require("stream"); - var MIN_WAIT_TIME = 1000; - async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - const headers = request.headers ?? {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve8) => { - timeoutId = Number(setTimeout(resolve8, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve8) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve8(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve8(); - }); - }) - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } - } - __name(writeRequestBody, "writeRequestBody"); - function writeBody(httpRequest, body) { - if (body instanceof import_stream7.Readable) { - body.pipe(httpRequest); - return; - } - if (body) { - if (Buffer.isBuffer(body) || typeof body === "string") { - httpRequest.end(body); - return; - } - const uint8 = body; - if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { - httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); - return; - } - httpRequest.end(Buffer.from(body)); - return; - } - httpRequest.end(); - } - __name(writeBody, "writeBody"); - var DEFAULT_REQUEST_TIMEOUT = 0; - var _NodeHttpHandler = class _NodeHttpHandler2 { - constructor(options) { - this.socketWarningTimestamp = 0; - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve8, reject2) => { - if (typeof options === "function") { - options().then((_options) => { - resolve8(this.resolveDefaultConfig(_options)); - }).catch(reject2); - } else { - resolve8(this.resolveDefaultConfig(options)); - } - }); - } - static create(instanceOrOptions) { - if (typeof (instanceOrOptions == null ? undefined : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new _NodeHttpHandler2(instanceOrOptions); - } - static checkSocketUsage(agent, socketWarningTimestamp) { - var _a2, _b; - const { sockets, requests, maxSockets } = agent; - if (typeof maxSockets !== "number" || maxSockets === Infinity) { - return socketWarningTimestamp; - } - const interval = 15000; - if (Date.now() - interval < socketWarningTimestamp) { - return socketWarningTimestamp; - } - if (sockets && requests) { - for (const origin2 in sockets) { - const socketsInUse = ((_a2 = sockets[origin2]) == null ? undefined : _a2.length) ?? 0; - const requestsEnqueued = ((_b = requests[origin2]) == null ? undefined : _b.length) ?? 0; - if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { - console.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; - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout ?? socketTimeout, - httpAgent: (() => { - if (httpAgent instanceof import_http4.Agent || typeof (httpAgent == null ? undefined : httpAgent.destroy) === "function") { - return httpAgent; - } - return new import_http4.Agent({ keepAlive, maxSockets, ...httpAgent }); - })(), - httpsAgent: (() => { - if (httpsAgent instanceof import_https3.Agent || typeof (httpsAgent == null ? undefined : httpsAgent.destroy) === "function") { - return httpsAgent; - } - return new import_https3.Agent({ keepAlive, maxSockets, ...httpsAgent }); - })() - }; - } - destroy() { - var _a2, _b, _c, _d; - (_b = (_a2 = this.config) == null ? undefined : _a2.httpAgent) == null || _b.destroy(); - (_d = (_c = this.config) == null ? undefined : _c.httpsAgent) == null || _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - let socketCheckTimeoutId; - return new Promise((_resolve, _reject) => { - let writeRequestBodyPromise = undefined; - const resolve8 = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - clearTimeout(socketCheckTimeoutId); - _resolve(arg); - }, "resolve"); - const reject2 = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }, "reject"); - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal == null ? undefined : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject2(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; - socketCheckTimeoutId = setTimeout(() => { - this.socketWarningTimestamp = _NodeHttpHandler2.checkSocketUsage(agent, this.socketWarningTimestamp); - }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2000) + (this.config.connectionTimeout ?? 1000)); - const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = request.username ?? ""; - const password = request.password ?? ""; - auth = `${username}:${password}`; - } - let path9 = request.path; - if (queryString) { - path9 += `?${queryString}`; - } - if (request.fragment) { - path9 += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path: path9, - port: request.port, - agent, - auth - }; - const requestFunc = isSSL ? import_https3.request : import_http4.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new import_protocol_http.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_CODES.includes(err.code)) { - reject2(Object.assign(err, { name: "TimeoutError" })); - } else { - reject2(err); - } - }); - setConnectionTimeout(req, reject2, this.config.connectionTimeout); - setSocketTimeout(req, reject2, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject2(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - setSocketKeepAlive(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs - }); - } - writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config2) => { - return { - ...config2, - [key]: value - }; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - }; - __name(_NodeHttpHandler, "NodeHttpHandler"); - var NodeHttpHandler = _NodeHttpHandler; - var import_http22 = __require("http2"); - var import_http23 = __toESM2(__require("http2")); - var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool2 { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions ?? []; - } - poll() { - if (this.sessions.length > 0) { - return this.sessions.shift(); - } - } - offerLast(session) { - this.sessions.push(session); - } - contains(session) { - return this.sessions.includes(session); - } - remove(session) { - this.sessions = this.sessions.filter((s) => s !== session); - } - [Symbol.iterator]() { - return this.sessions[Symbol.iterator](); - } - destroy(connection) { - for (const session of this.sessions) { - if (session === connection) { - if (!session.destroyed) { - session.destroy(); - } - } - } - } - }; - __name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); - var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool; - var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager2 { - constructor(config2) { - this.sessionCache = /* @__PURE__ */ new Map; - this.config = config2; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const url3 = this.getUrlString(requestContext); - const existingPool = this.sessionCache.get(url3); - if (existingPool) { - const existingSession = existingPool.poll(); - if (existingSession && !this.config.disableConcurrency) { - return existingSession; - } - } - const session = import_http23.default.connect(url3); - 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 = /* @__PURE__ */ __name(() => { - session.destroy(); - this.deleteSession(url3, session); - }, "destroySessionCb"); - session.on("goaway", destroySessionCb); - session.on("error", destroySessionCb); - session.on("frameError", destroySessionCb); - session.on("close", () => this.deleteSession(url3, session)); - if (connectionConfiguration.requestTimeout) { - session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); - } - const connectionPool = this.sessionCache.get(url3) || new NodeHttp2ConnectionPool; - connectionPool.offerLast(session); - this.sessionCache.set(url3, connectionPool); - return session; - } - deleteSession(authority, session) { - const existingConnectionPool = this.sessionCache.get(authority); - if (!existingConnectionPool) { - return; - } - if (!existingConnectionPool.contains(session)) { - return; - } - existingConnectionPool.remove(session); - this.sessionCache.set(authority, existingConnectionPool); - } - release(requestContext, session) { - var _a2; - const cacheKey = this.getUrlString(requestContext); - (_a2 = this.sessionCache.get(cacheKey)) == null || _a2.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 (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); - } - }; - __name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager"); - var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager; - var _NodeHttp2Handler = class _NodeHttp2Handler2 { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new NodeHttp2ConnectionManager({}); - this.configProvider = new Promise((resolve8, reject2) => { - if (typeof options === "function") { - options().then((opts) => { - resolve8(opts || {}); - }).catch(reject2); - } else { - resolve8(options || {}); - } - }); - } - static create(instanceOrOptions) { - if (typeof (instanceOrOptions == null ? undefined : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new _NodeHttp2Handler2(instanceOrOptions); - } - destroy() { - this.connectionManager.destroy(); - } - async handle(request, { abortSignal } = {}) { - 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); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a2; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve8 = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }, "resolve"); - const reject2 = /* @__PURE__ */ __name(async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }, "reject"); - if (abortSignal == null ? undefined : abortSignal.aborted) { - fulfilled = true; - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject2(abortError); - return; - } - const { hostname: hostname2, method: method2, port, protocol, query } = request; - let auth = ""; - if (request.username != null || request.password != null) { - const username = request.username ?? ""; - const password = request.password ?? ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname2}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_a2 = this.config) == null ? undefined : _a2.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false - }); - const rejectWithDestroy = /* @__PURE__ */ __name((err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject2(err); - }, "rejectWithDestroy"); - const queryString = (0, import_querystring_builder.buildQueryString)(query || {}); - let path9 = request.path; - if (queryString) { - path9 += `?${queryString}`; - } - if (request.fragment) { - path9 += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [import_http22.constants.HTTP2_HEADER_PATH]: path9, - [import_http22.constants.HTTP2_HEADER_METHOD]: method2 - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new import_protocol_http.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: getTransformedHeaders(headers), - body: req - }); - fulfilled = true; - resolve8({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - 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(); - } - if (!fulfilled) { - rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); - } - }); - writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config2) => { - return { - ...config2, - [key]: value - }; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } - }; - __name(_NodeHttp2Handler, "NodeHttp2Handler"); - var NodeHttp2Handler = _NodeHttp2Handler; - var _Collector = class _Collector2 extends import_stream7.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk2, encoding, callback) { - this.bufferedBytes.push(chunk2); - callback(); - } - }; - __name(_Collector, "Collector"); - var Collector = _Collector; - var streamCollector = /* @__PURE__ */ __name((stream4) => new Promise((resolve8, reject2) => { - const collector = new Collector; - stream4.pipe(collector); - stream4.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); - }); - }), "streamCollector"); -}); - -// ../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js -var require_sdk_stream_mixin2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.sdkStreamMixin = undefined; - var node_http_handler_1 = require_dist_cjs68(); - var util_buffer_from_1 = require_dist_cjs63(); - var stream_1 = __require("stream"); - var util_1 = __require("util"); - var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; - var sdkStreamMixin2 = (stream4) => { - var _a2, _b; - if (!(stream4 instanceof stream_1.Readable)) { - const name = ((_b = (_a2 = stream4 === null || stream4 === undefined ? undefined : stream4.__proto__) === null || _a2 === undefined ? undefined : _a2.constructor) === null || _b === undefined ? undefined : _b.name) || stream4; - throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); - } - let transformed = false; - const transformToByteArray = async () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - return await (0, node_http_handler_1.streamCollector)(stream4); - }; - return Object.assign(stream4, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === undefined || Buffer.isEncoding(encoding)) { - return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); - } else { - const decoder = new util_1.TextDecoder(encoding); - return decoder.decode(buf); - } - }, - transformToWebStream: () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - if (stream4.readableFlowing !== null) { - throw new Error("The stream has been consumed by other callbacks."); - } - if (typeof stream_1.Readable.toWeb !== "function") { - throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available."); - } - transformed = true; - return stream_1.Readable.toWeb(stream4); - } - }); - }; - exports.sdkStreamMixin = sdkStreamMixin2; -}); - -// ../node_modules/@smithy/util-stream/dist-cjs/index.js -var require_dist_cjs69 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __reExport = (target, mod2, secondTarget) => (__copyProps(target, mod2, "default"), secondTarget && __copyProps(secondTarget, mod2, "default")); - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - Uint8ArrayBlobAdapter: () => Uint8ArrayBlobAdapter - }); - module.exports = __toCommonJS2(src_exports); - var import_util_base64 = require_dist_cjs65(); - var import_util_utf8 = require_dist_cjs64(); - function transformToString(payload, encoding = "utf-8") { - if (encoding === "base64") { - return (0, import_util_base64.toBase64)(payload); - } - return (0, import_util_utf8.toUtf8)(payload); - } - __name(transformToString, "transformToString"); - function transformFromString(str, encoding) { - if (encoding === "base64") { - return Uint8ArrayBlobAdapter.mutate((0, import_util_base64.fromBase64)(str)); - } - return Uint8ArrayBlobAdapter.mutate((0, import_util_utf8.fromUtf8)(str)); - } - __name(transformFromString, "transformFromString"); - var _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter2 extends Uint8Array { - static fromString(source, encoding = "utf-8") { - switch (typeof source) { - case "string": - return transformFromString(source, encoding); - default: - throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); - } - } - static mutate(source) { - Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter2.prototype); - return source; - } - transformToString(encoding = "utf-8") { - return transformToString(this, encoding); - } - }; - __name(_Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter"); - var Uint8ArrayBlobAdapter = _Uint8ArrayBlobAdapter; - __reExport(src_exports, require_getAwsChunkedEncodingStream2(), module.exports); - __reExport(src_exports, require_sdk_stream_mixin2(), module.exports); -}); - -// ../node_modules/@smithy/core/dist-cjs/submodules/schema/index.js -var require_schema2 = __commonJS((exports) => { - var protocolHttp = require_dist_cjs56(); - var utilMiddleware = require_dist_cjs60(); - var deref = (schemaRef) => { - if (typeof schemaRef === "function") { - return schemaRef(); - } - return schemaRef; - }; - var operation = (namespace, name, traits, input, output) => ({ - name, - namespace, - traits, - input, - output - }); - var schemaDeserializationMiddleware = (config2) => (next, context) => async (args) => { - const { response } = await next(args); - const { operationSchema } = utilMiddleware.getSmithyContext(context); - const [, ns, n2, t, i2, o2] = operationSchema ?? []; - try { - const parsed = await config2.protocol.deserializeResponse(operation(ns, n2, t, i2, o2), { - ...config2, - ...context - }, response); - return { - response, - output: parsed - }; - } catch (error42) { - Object.defineProperty(error42, "$response", { - value: response, - enumerable: false, - writable: false, - configurable: false - }); - if (!("$metadata" in error42)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - try { - error42.message += ` - ` + hint; - } catch (e) { - if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { - console.warn(hint); - } else { - context.logger?.warn?.(hint); - } - } - if (typeof error42.$responseBodyText !== "undefined") { - if (error42.$response) { - error42.$response.body = error42.$responseBodyText; - } - } - try { - if (protocolHttp.HttpResponse.isInstance(response)) { - const { headers = {} } = response; - const headerEntries = Object.entries(headers); - error42.$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 (e) {} - } - throw error42; - } - }; - var findHeader = (pattern, headers) => { - return (headers.find(([k]) => { - return k.match(pattern); - }) || [undefined, undefined])[1]; - }; - var schemaSerializationMiddleware = (config2) => (next, context) => async (args) => { - const { operationSchema } = utilMiddleware.getSmithyContext(context); - const [, ns, n2, t, i2, o2] = operationSchema ?? []; - const endpoint = context.endpointV2?.url && config2.urlParser ? async () => config2.urlParser(context.endpointV2.url) : config2.endpoint; - const request = await config2.protocol.serializeRequest(operation(ns, n2, t, i2, o2), args.input, { - ...config2, - ...context, - endpoint - }); - return next({ - ...args, - request - }); - }; - var deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true - }; - var serializerMiddlewareOption = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true - }; - function getSchemaSerdePlugin(config2) { - return { - applyToStack: (commandStack) => { - commandStack.add(schemaSerializationMiddleware(config2), serializerMiddlewareOption); - commandStack.add(schemaDeserializationMiddleware(config2), deserializerMiddlewareOption); - config2.protocol.setSerdeContext(config2); - } - }; - } - - class Schema { - name; - namespace; - traits; - static assign(instance, values2) { - const schema = Object.assign(instance, values2); - return schema; - } - static [Symbol.hasInstance](lhs) { - const isPrototype2 = this.prototype.isPrototypeOf(lhs); - if (!isPrototype2 && typeof lhs === "object" && lhs !== null) { - const list2 = lhs; - return list2.symbol === this.symbol; - } - return isPrototype2; - } - getName() { - return this.namespace + "#" + this.name; - } - } - - class ListSchema extends Schema { - static symbol = Symbol.for("@smithy/lis"); - name; - traits; - valueSchema; - symbol = ListSchema.symbol; - } - var list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema, { - name, - namespace, - traits, - valueSchema - }); - - class MapSchema extends Schema { - static symbol = Symbol.for("@smithy/map"); - name; - traits; - keySchema; - valueSchema; - symbol = MapSchema.symbol; - } - var map3 = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema, { - name, - namespace, - traits, - keySchema, - valueSchema - }); - - class OperationSchema extends Schema { - static symbol = Symbol.for("@smithy/ope"); - name; - traits; - input; - output; - symbol = OperationSchema.symbol; - } - var op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema, { - name, - namespace, - traits, - input, - output - }); - - class StructureSchema extends Schema { - static symbol = Symbol.for("@smithy/str"); - name; - traits; - memberNames; - memberList; - symbol = StructureSchema.symbol; - } - var struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema, { - name, - namespace, - traits, - memberNames, - memberList - }); - - class ErrorSchema extends StructureSchema { - static symbol = Symbol.for("@smithy/err"); - ctor; - symbol = ErrorSchema.symbol; - } - var error41 = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema, { - name, - namespace, - traits, - memberNames, - memberList, - ctor: null - }); - function translateTraits(indicator) { - if (typeof indicator === "object") { - return indicator; - } - indicator = indicator | 0; - const traits = {}; - let i2 = 0; - for (const trait of [ - "httpLabel", - "idempotent", - "idempotencyToken", - "sensitive", - "httpPayload", - "httpResponseCode", - "httpQueryParams" - ]) { - if ((indicator >> i2++ & 1) === 1) { - traits[trait] = 1; - } - } - return traits; - } - - class NormalizedSchema { - ref; - memberName; - static symbol = 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 i2 = traitStack.length - 1;i2 >= 0; --i2) { - const traitSet = traitStack[i2]; - 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 = undefined; - 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 isPrototype2 = this.prototype.isPrototypeOf(lhs); - if (!isPrototype2 && typeof lhs === "object" && lhs !== null) { - const ns = lhs; - return ns.symbol === this.symbol; - } - return isPrototype2; - } - static of(ref) { - const sc = deref(ref); - if (sc instanceof NormalizedSchema) { - return sc; - } - if (isMemberSchema(sc)) { - const [ns, traits] = sc; - if (ns instanceof NormalizedSchema) { - Object.assign(ns.getMergedTraits(), translateTraits(traits)); - return ns; - } - throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`); - } - return new NormalizedSchema(sc); - } - getSchema() { - const sc = this.schema; - if (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 || undefined; - } - 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(); - return sc[0] === 3 || sc[0] === -3; - } - 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: streaming2 } = this.getMergedTraits(); - return !!streaming2 || this.getSchema() === 42; - } - isIdempotencyToken() { - const match = (traits2) => (traits2 & 4) === 4 || !!traits2?.idempotencyToken; - const { normalizedTraits, traits, memberTraits } = this; - return match(normalizedTraits) || match(traits) || match(memberTraits); - } - getMergedTraits() { - return this.normalizedTraits ?? (this.normalizedTraits = { - ...this.getOwnTraits(), - ...this.getMemberTraits() - }); - } - getMemberTraits() { - return translateTraits(this.memberTraits); - } - getOwnTraits() { - return translateTraits(this.traits); - } - getKeySchema() { - const [isDoc, isMap2] = [this.isDocumentSchema(), this.isMapSchema()]; - if (!isDoc && !isMap2) { - 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, isMap2, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()]; - const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap2 || isList) ? sc[3 + sc[0]] : isDoc ? 15 : undefined; - if (memberSchema != null) { - return member([memberSchema, 0], isMap2 ? "value" : "member"); - } - throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`); - } - getMemberSchema(memberName) { - const struct2 = this.getSchema(); - if (this.isStructSchema() && struct2[4].includes(memberName)) { - const i2 = struct2[4].indexOf(memberName); - const memberSchema = struct2[5][i2]; - 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 no member=${memberName}.`); - } - getMemberSchemas() { - const buffer = {}; - try { - for (const [k, v] of this.structIterator()) { - buffer[k] = v; - } - } catch (ignored) {} - return buffer; - } - getEventStreamMember() { - if (this.isStructSchema()) { - for (const [memberName, memberSchema] of this.structIterator()) { - if (memberSchema.isStreaming() && memberSchema.isStructSchema()) { - return memberName; - } - } - } - return ""; - } - *structIterator() { - if (this.isUnitSchema()) { - return; - } - if (!this.isStructSchema()) { - throw new Error("@smithy/core/schema - cannot iterate non-struct schema."); - } - const struct2 = this.getSchema(); - for (let i2 = 0;i2 < struct2[4].length; ++i2) { - yield [struct2[4][i2], member([struct2[5][i2], 0], struct2[4][i2])]; - } - } - } - function member(memberSchema, memberName) { - if (memberSchema instanceof NormalizedSchema) { - return Object.assign(memberSchema, { - memberName, - _isMemberSchema: true - }); - } - const internalCtorAccess = NormalizedSchema; - return new internalCtorAccess(memberSchema, memberName); - } - var isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2; - var isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5; - - class SimpleSchema extends Schema { - static symbol = Symbol.for("@smithy/sim"); - name; - schemaRef; - traits; - symbol = SimpleSchema.symbol; - } - var sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema, { - name, - namespace, - traits, - schemaRef - }); - var simAdapter = (namespace, name, traits, schemaRef) => Schema.assign(new SimpleSchema, { - name, - namespace, - traits, - schemaRef - }); - var SCHEMA = { - BLOB: 21, - STREAMING_BLOB: 42, - BOOLEAN: 2, - STRING: 0, - NUMERIC: 1, - BIG_INTEGER: 17, - BIG_DECIMAL: 19, - DOCUMENT: 15, - TIMESTAMP_DEFAULT: 4, - TIMESTAMP_DATE_TIME: 5, - TIMESTAMP_HTTP_DATE: 6, - TIMESTAMP_EPOCH_SECONDS: 7, - LIST_MODIFIER: 64, - MAP_MODIFIER: 128 - }; - - class TypeRegistry { - namespace; - schemas; - exceptions; - static registries = new Map; - constructor(namespace, schemas3 = new Map, exceptions = new Map) { - this.namespace = namespace; - this.schemas = schemas3; - this.exceptions = exceptions; - } - static for(namespace) { - if (!TypeRegistry.registries.has(namespace)) { - TypeRegistry.registries.set(namespace, new TypeRegistry(namespace)); - } - return TypeRegistry.registries.get(namespace); - } - register(shapeId, schema) { - const qualifiedName = this.normalizeShapeId(shapeId); - const registry2 = TypeRegistry.for(qualifiedName.split("#")[0]); - registry2.schemas.set(qualifiedName, schema); - } - getSchema(shapeId) { - const id = this.normalizeShapeId(shapeId); - if (!this.schemas.has(id)) { - throw new Error(`@smithy/core/schema - schema not found for ${id}`); - } - return this.schemas.get(id); - } - registerError(es, ctor) { - const $error2 = es; - const registry2 = TypeRegistry.for($error2[1]); - registry2.schemas.set($error2[1] + "#" + $error2[2], $error2); - registry2.exceptions.set($error2, ctor); - } - getErrorCtor(es) { - const $error2 = es; - const registry2 = TypeRegistry.for($error2[1]); - return registry2.exceptions.get($error2); - } - getBaseException() { - for (const exceptionKey of this.exceptions.keys()) { - if (Array.isArray(exceptionKey)) { - const [, ns, name] = exceptionKey; - const id = ns + "#" + name; - if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) { - return exceptionKey; - } - } - } - return; - } - 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; - } - } - exports.ErrorSchema = ErrorSchema; - exports.ListSchema = ListSchema; - exports.MapSchema = MapSchema; - exports.NormalizedSchema = NormalizedSchema; - exports.OperationSchema = OperationSchema; - exports.SCHEMA = SCHEMA; - exports.Schema = Schema; - exports.SimpleSchema = SimpleSchema; - exports.StructureSchema = StructureSchema; - exports.TypeRegistry = TypeRegistry; - exports.deref = deref; - exports.deserializerMiddlewareOption = deserializerMiddlewareOption; - exports.error = error41; - exports.getSchemaSerdePlugin = getSchemaSerdePlugin; - exports.isStaticSchema = isStaticSchema; - exports.list = list; - exports.map = map3; - exports.op = op; - exports.operation = operation; - exports.serializerMiddlewareOption = serializerMiddlewareOption; - exports.sim = sim; - exports.simAdapter = simAdapter; - exports.struct = struct; - exports.translateTraits = translateTraits; -}); - -// ../node_modules/tslib/tslib.js -var require_tslib2 = __commonJS((exports, module) => { - var __extends; - var __assign; - var __rest; - var __decorate; - var __param; - var __esDecorate; - var __runInitializers; - var __propKey; - var __setFunctionName; - var __metadata; - var __awaiter; - var __generator; - var __exportStar; - var __values; - var __read; - var __spread; - var __spreadArrays; - var __spreadArray; - var __await; - var __asyncGenerator; - var __asyncDelegator; - var __asyncValues; - var __makeTemplateObject; - var __importStar; - var __importDefault; - var __classPrivateFieldGet2; - var __classPrivateFieldSet2; - var __classPrivateFieldIn; - var __createBinding; - var __addDisposableResource; - var __disposeResources; - var __rewriteRelativeImportExtension; - (function(factory2) { - var root2 = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function(exports2) { - factory2(createExporter(root2, createExporter(exports2))); - }); - } else if (typeof module === "object" && typeof exports === "object") { - factory2(createExporter(root2, createExporter(exports))); - } else { - factory2(createExporter(root2)); - } - function createExporter(exports2, previous) { - if (exports2 !== root2) { - if (typeof Object.create === "function") { - Object.defineProperty(exports2, "__esModule", { value: true }); - } else { - exports2.__esModule = true; - } - } - return function(id, v) { - return exports2[id] = previous ? previous(id, v) : v; - }; - } - })(function(exporter) { - var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { - d.__proto__ = b; - } || function(d, b) { - for (var p in b) - if (Object.prototype.hasOwnProperty.call(b, p)) - d[p] = b[p]; - }; - __extends = function(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __); - }; - __assign = Object.assign || function(t) { - for (var s, i2 = 1, n2 = arguments.length;i2 < n2; i2++) { - s = arguments[i2]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - __rest = function(s, e) { - var t = {}; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i2 = 0, p = Object.getOwnPropertySymbols(s);i2 < p.length; i2++) { - if (e.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i2])) - t[p[i2]] = s[p[i2]]; - } - return t; - }; - __decorate = function(decorators, target, key, desc) { - var c5 = arguments.length, r = c5 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i2 = decorators.length - 1;i2 >= 0; i2--) - if (d = decorators[i2]) - r = (c5 < 3 ? d(r) : c5 > 3 ? d(target, key, r) : d(target, key)) || r; - return c5 > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { - if (f !== undefined && typeof f !== "function") - throw new TypeError("Function expected"); - return f; - } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i2 = decorators.length - 1;i2 >= 0; i2--) { - var context = {}; - for (var p in contextIn) - context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) - context.access[p] = contextIn.access[p]; - context.addInitializer = function(f) { - if (done) - throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); - }; - var result2 = (0, decorators[i2])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result2 === undefined) - continue; - if (result2 === null || typeof result2 !== "object") - throw new TypeError("Object expected"); - if (_ = accept(result2.get)) - descriptor.get = _; - if (_ = accept(result2.set)) - descriptor.set = _; - if (_ = accept(result2.init)) - initializers.unshift(_); - } else if (_ = accept(result2)) { - if (kind === "field") - initializers.unshift(_); - else - descriptor[key] = _; - } - } - if (target) - Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - __runInitializers = function(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i2 = 0;i2 < initializers.length; i2++) { - value = useValue ? initializers[i2].call(thisArg, value) : initializers[i2].call(thisArg); - } - return useValue ? value : undefined; - }; - __propKey = function(x2) { - return typeof x2 === "symbol" ? x2 : "".concat(x2); - }; - __setFunctionName = function(f, name, prefix) { - if (typeof name === "symbol") - name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - __metadata = function(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(metadataKey, metadataValue); - }; - __awaiter = function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, reject2) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject2(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject2(e); - } - } - function step(result2) { - result2.done ? resolve8(result2.value) : adopt(result2.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - __generator = function(thisArg, body) { - var _ = { label: 0, sent: function() { - if (t[0] & 1) - throw t[1]; - return t[1]; - }, trys: [], ops: [] }, f, y2, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { - return this; - }), g; - function verb(n2) { - return function(v) { - return step([n2, v]); - }; - } - function step(op) { - if (f) - throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) - try { - if (f = 1, y2 && (t = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t = y2["return"]) && t.call(y2), 0) : y2.next) && !(t = t.call(y2, op[1])).done) - return t; - if (y2 = 0, t) - op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y2 = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) - _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } catch (e) { - op = [6, e]; - y2 = 0; - } finally { - f = t = 0; - } - if (op[0] & 5) - throw op[1]; - return { value: op[0] ? op[1] : undefined, done: true }; - } - }; - __exportStar = function(m, o2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(o2, p)) - __createBinding(o2, m, p); - }; - __createBinding = Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }; - __values = function(o2) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o2[s], i2 = 0; - if (m) - return m.call(o2); - if (o2 && typeof o2.length === "number") - return { - next: function() { - if (o2 && i2 >= o2.length) - o2 = undefined; - return { value: o2 && o2[i2++], done: !o2 }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function(o2, n2) { - var m = typeof Symbol === "function" && o2[Symbol.iterator]; - if (!m) - return o2; - var i2 = m.call(o2), r, ar = [], e; - try { - while ((n2 === undefined || n2-- > 0) && !(r = i2.next()).done) - ar.push(r.value); - } catch (error41) { - e = { error: error41 }; - } finally { - try { - if (r && !r.done && (m = i2["return"])) - m.call(i2); - } finally { - if (e) - throw e.error; - } - } - return ar; - }; - __spread = function() { - for (var ar = [], i2 = 0;i2 < arguments.length; i2++) - ar = ar.concat(__read(arguments[i2])); - return ar; - }; - __spreadArrays = function() { - for (var s = 0, i2 = 0, il = arguments.length;i2 < il; i2++) - s += arguments[i2].length; - for (var r = Array(s), k = 0, i2 = 0;i2 < il; i2++) - for (var a2 = arguments[i2], j = 0, jl = a2.length;j < jl; j++, k++) - r[k] = a2[j]; - return r; - }; - __spreadArray = function(to, from, pack) { - if (pack || arguments.length === 2) - for (var i2 = 0, l = from.length, ar;i2 < l; i2++) { - if (ar || !(i2 in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i2); - ar[i2] = from[i2]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await = function(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i2, q = []; - return i2 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i2[Symbol.asyncIterator] = function() { - return this; - }, i2; - function awaitReturn(f) { - return function(v) { - return Promise.resolve(v).then(f, reject2); - }; - } - function verb(n2, f) { - if (g[n2]) { - i2[n2] = function(v) { - return new Promise(function(a2, b) { - q.push([n2, v, a2, b]) > 1 || resume(n2, v); - }); - }; - if (f) - i2[n2] = f(i2[n2]); - } - } - function resume(n2, v) { - try { - step(g[n2](v)); - } catch (e) { - settle2(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject2) : settle2(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject2(value) { - resume("throw", value); - } - function settle2(f, v) { - if (f(v), q.shift(), q.length) - resume(q[0][0], q[0][1]); - } - }; - __asyncDelegator = function(o2) { - var i2, p; - return i2 = {}, verb("next"), verb("throw", function(e) { - throw e; - }), verb("return"), i2[Symbol.iterator] = function() { - return this; - }, i2; - function verb(n2, f) { - i2[n2] = o2[n2] ? function(v) { - return (p = !p) ? { value: __await(o2[n2](v)), done: false } : f ? f(v) : v; - } : f; - } - }; - __asyncValues = function(o2) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o2[Symbol.asyncIterator], i2; - return m ? m.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { - return this; - }, i2); - function verb(n2) { - i2[n2] = o2[n2] && function(v) { - return new Promise(function(resolve8, reject2) { - v = o2[n2](v), settle2(resolve8, reject2, v.done, v.value); - }); - }; - } - function settle2(resolve8, reject2, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject2); - } - }; - __makeTemplateObject = function(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; - }; - var __setModuleDefault = Object.create ? function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - } : function(o2, v) { - o2["default"] = v; - }; - var ownKeys = function(o2) { - ownKeys = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k in o3) - if (Object.prototype.hasOwnProperty.call(o3, k)) - ar[ar.length] = k; - return ar; - }; - return ownKeys(o2); - }; - __importStar = function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result2 = {}; - if (mod2 != null) { - for (var k = ownKeys(mod2), i2 = 0;i2 < k.length; i2++) - if (k[i2] !== "default") - __createBinding(result2, mod2, k[i2]); - } - __setModuleDefault(result2, mod2); - return result2; - }; - __importDefault = function(mod2) { - return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; - }; - __classPrivateFieldGet2 = function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet2 = function(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; - }; - __classPrivateFieldIn = function(state, receiver) { - if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") - throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - __addDisposableResource = function(env4, value, async) { - if (value !== null && value !== undefined) { - if (typeof value !== "object" && typeof value !== "function") - throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) - throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === undefined) { - if (!Symbol.dispose) - throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) - inner = dispose; - } - if (typeof dispose !== "function") - throw new TypeError("Object not disposable."); - if (inner) - dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); - } - }; - env4.stack.push({ value, dispose, async }); - } else if (async) { - env4.stack.push({ async: true }); - } - return value; - }; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error41, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error41, e.suppressed = suppressed, e; - }; - __disposeResources = function(env4) { - function fail(e) { - env4.error = env4.hasError ? new _SuppressedError(e, env4.error, "An error was suppressed during disposal.") : e; - env4.hasError = true; - } - var r, s = 0; - function next() { - while (r = env4.stack.pop()) { - try { - if (!r.async && s === 1) - return s = 0, env4.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result2 = r.dispose.call(r.value); - if (r.async) - return s |= 2, Promise.resolve(result2).then(next, function(e) { - fail(e); - return next(); - }); - } else - s |= 1; - } catch (e) { - fail(e); - } - } - if (s === 1) - return env4.hasError ? Promise.reject(env4.error) : Promise.resolve(); - if (env4.hasError) - throw env4.error; - } - return next(); - }; - __rewriteRelativeImportExtension = function(path9, preserveJsx) { - if (typeof path9 === "string" && /^\.\.?\//.test(path9)) { - return path9.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; - }); - } - return path9; - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet2); - exporter("__classPrivateFieldSet", __classPrivateFieldSet2); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); - exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension); - }); -}); - -// ../node_modules/@smithy/uuid/dist-cjs/randomUUID.js -var require_randomUUID2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.randomUUID = undefined; - var tslib_1 = require_tslib2(); - var crypto_1 = tslib_1.__importDefault(__require("crypto")); - exports.randomUUID = crypto_1.default.randomUUID.bind(crypto_1.default); -}); - -// ../node_modules/@smithy/uuid/dist-cjs/index.js -var require_dist_cjs70 = __commonJS((exports) => { - var randomUUID2 = require_randomUUID2(); - var decimalToHex = Array.from({ length: 256 }, (_, i2) => i2.toString(16).padStart(2, "0")); - var v4 = () => { - if (randomUUID2.randomUUID) { - return randomUUID2.randomUUID(); - } - const rnds = new Uint8Array(16); - crypto.getRandomValues(rnds); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]]; - }; - exports.v4 = v4; -}); - -// ../node_modules/@smithy/core/dist-cjs/submodules/serde/index.js -var require_serde2 = __commonJS((exports) => { - var uuid3 = require_dist_cjs70(); - var copyDocumentWithTransform = (source, schemaRef, transform3 = (_) => _) => source; - var parseBoolean = (value) => { - switch (value) { - case "true": - return true; - case "false": - return false; - default: - throw new Error(`Unable to parse boolean value "${value}"`); - } - }; - var expectBoolean = (value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value === "number") { - if (value === 0 || value === 1) { - logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (value === 0) { - return false; - } - if (value === 1) { - return true; - } - } - if (typeof value === "string") { - const lower = value.toLowerCase(); - if (lower === "false" || lower === "true") { - logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (lower === "false") { - return false; - } - if (lower === "true") { - return true; - } - } - if (typeof value === "boolean") { - return value; - } - throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); - }; - var expectNumber = (value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value === "string") { - const parsed = parseFloat(value); - if (!Number.isNaN(parsed)) { - if (String(parsed) !== String(value)) { - logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); - } - return parsed; - } - } - if (typeof value === "number") { - return value; - } - throw new TypeError(`Expected number, got ${typeof value}: ${value}`); - }; - var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); - var expectFloat32 = (value) => { - const expected = expectNumber(value); - if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { - if (Math.abs(expected) > MAX_FLOAT) { - throw new TypeError(`Expected 32-bit float, got ${value}`); - } - } - return expected; - }; - var expectLong = (value) => { - if (value === null || value === undefined) { - return; - } - if (Number.isInteger(value) && !Number.isNaN(value)) { - return value; - } - throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); - }; - var expectInt = expectLong; - var expectInt32 = (value) => expectSizedInt(value, 32); - var expectShort = (value) => expectSizedInt(value, 16); - var expectByte = (value) => expectSizedInt(value, 8); - var expectSizedInt = (value, size2) => { - const expected = expectLong(value); - if (expected !== undefined && castInt(expected, size2) !== expected) { - throw new TypeError(`Expected ${size2}-bit integer, got ${value}`); - } - return expected; - }; - var castInt = (value, size2) => { - switch (size2) { - case 32: - return Int32Array.of(value)[0]; - case 16: - return Int16Array.of(value)[0]; - case 8: - return Int8Array.of(value)[0]; - } - }; - var expectNonNull = (value, location) => { - if (value === null || value === undefined) { - if (location) { - throw new TypeError(`Expected a non-null value for ${location}`); - } - throw new TypeError("Expected a non-null value"); - } - return value; - }; - var expectObject = (value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value === "object" && !Array.isArray(value)) { - return value; - } - const receivedType = Array.isArray(value) ? "array" : typeof value; - throw new TypeError(`Expected object, got ${receivedType}: ${value}`); - }; - var expectString = (value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value === "string") { - return value; - } - if (["boolean", "number", "bigint"].includes(typeof value)) { - logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); - return String(value); - } - throw new TypeError(`Expected string, got ${typeof value}: ${value}`); - }; - var expectUnion = (value) => { - if (value === null || value === undefined) { - return; - } - const asObject = expectObject(value); - const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k); - if (setKeys.length === 0) { - throw new TypeError(`Unions must have exactly one non-null member. None were found.`); - } - if (setKeys.length > 1) { - throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); - } - return asObject; - }; - var strictParseDouble = (value) => { - if (typeof value == "string") { - return expectNumber(parseNumber2(value)); - } - return expectNumber(value); - }; - var strictParseFloat = strictParseDouble; - var strictParseFloat32 = (value) => { - if (typeof value == "string") { - return expectFloat32(parseNumber2(value)); - } - return expectFloat32(value); - }; - var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; - var parseNumber2 = (value) => { - const matches2 = value.match(NUMBER_REGEX); - if (matches2 === null || matches2[0].length !== value.length) { - throw new TypeError(`Expected real number, got implicit NaN`); - } - return parseFloat(value); - }; - var limitedParseDouble = (value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return expectNumber(value); - }; - var handleFloat = limitedParseDouble; - var limitedParseFloat = limitedParseDouble; - var limitedParseFloat32 = (value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return expectFloat32(value); - }; - var parseFloatString = (value) => { - switch (value) { - case "NaN": - return NaN; - case "Infinity": - return Infinity; - case "-Infinity": - return -Infinity; - default: - throw new Error(`Unable to parse float value: ${value}`); - } - }; - var strictParseLong = (value) => { - if (typeof value === "string") { - return expectLong(parseNumber2(value)); - } - return expectLong(value); - }; - var strictParseInt = strictParseLong; - var strictParseInt32 = (value) => { - if (typeof value === "string") { - return expectInt32(parseNumber2(value)); - } - return expectInt32(value); - }; - var strictParseShort = (value) => { - if (typeof value === "string") { - return expectShort(parseNumber2(value)); - } - return expectShort(value); - }; - var strictParseByte = (value) => { - if (typeof value === "string") { - return expectByte(parseNumber2(value)); - } - return expectByte(value); - }; - var stackTraceWarning = (message) => { - return String(new TypeError(message).stack || message).split(` -`).slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join(` -`); - }; - var logger = { - warn: console.warn - }; - var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; - var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; - function dateToUtcString(date6) { - const year2 = date6.getUTCFullYear(); - const month = date6.getUTCMonth(); - const dayOfWeek = date6.getUTCDay(); - const dayOfMonthInt = date6.getUTCDate(); - const hoursInt = date6.getUTCHours(); - const minutesInt = date6.getUTCMinutes(); - const secondsInt = date6.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 RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); - var parseRfc3339DateTime = (value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; - const year2 = strictParseShort(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - return buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds }); - }; - var RFC3339_WITH_OFFSET$1 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); - var parseRfc3339DateTimeWithOffset = (value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339_WITH_OFFSET$1.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; - const year2 = strictParseShort(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - const date6 = buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds }); - if (offsetStr.toUpperCase() != "Z") { - date6.setTime(date6.getTime() - parseOffsetToMilliseconds(offsetStr)); - } - return date6; - }; - var IMF_FIXDATE$1 = 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$/); - var RFC_850_DATE$1 = 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$/); - var ASC_TIME$1 = 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})$/); - var parseRfc7231DateTime = (value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value !== "string") { - throw new TypeError("RFC-7231 date-times must be expressed as strings"); - } - let match = IMF_FIXDATE$1.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - match = RFC_850_DATE$1.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { - hours, - minutes, - seconds, - fractionalMilliseconds - })); - } - match = ASC_TIME$1.exec(value); - if (match) { - const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; - return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - throw new TypeError("Invalid RFC-7231 date-time value"); - }; - var parseEpochTimestamp = (value) => { - if (value === null || value === undefined) { - return; - } - 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 * 1000)); - }; - var buildDate = (year2, month, day, time4) => { - const adjustedMonth = month - 1; - validateDayOfMonth(year2, adjustedMonth, day); - return new Date(Date.UTC(year2, adjustedMonth, day, parseDateValue(time4.hours, "hour", 0, 23), parseDateValue(time4.minutes, "minute", 0, 59), parseDateValue(time4.seconds, "seconds", 0, 60), parseMilliseconds2(time4.fractionalMilliseconds))); - }; - var parseTwoDigitYear = (value) => { - const thisYear = new Date().getUTCFullYear(); - const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); - if (valueInThisCentury < thisYear) { - return valueInThisCentury + 100; - } - return valueInThisCentury; - }; - var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000; - var adjustRfc850Year = (input) => { - if (input.getTime() - 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; - }; - var parseMonthByShortName = (value) => { - const monthIdx = MONTHS.indexOf(value); - if (monthIdx < 0) { - throw new TypeError(`Invalid month: ${value}`); - } - return monthIdx + 1; - }; - var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - var 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}`); - } - }; - var isLeapYear = (year2) => { - return year2 % 4 === 0 && (year2 % 100 !== 0 || year2 % 400 === 0); - }; - var 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; - }; - var parseMilliseconds2 = (value) => { - if (value === null || value === undefined) { - return 0; - } - return strictParseFloat32("0." + value) * 1000; - }; - var 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 * 1000; - }; - var stripLeadingZeroes = (value) => { - let idx = 0; - while (idx < value.length - 1 && value.charAt(idx) === "0") { - idx++; - } - if (idx === 0) { - return value; - } - return value.slice(idx); - }; - var LazyJsonString = function LazyJsonString(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 = (object2) => { - if (object2 && typeof object2 === "object" && (object2 instanceof LazyJsonString || ("deserializeJSON" in object2))) { - return object2; - } else if (typeof object2 === "string" || Object.getPrototypeOf(object2) === String.prototype) { - return LazyJsonString(String(object2)); - } - return LazyJsonString(JSON.stringify(object2)); - }; - LazyJsonString.fromObject = LazyJsonString.from; - function quoteHeader(part) { - if (part.includes(",") || part.includes('"')) { - part = `"${part.replace(/"/g, "\\\"")}"`; - } - return part; - } - var ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`; - var mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`; - var time3 = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`; - var date5 = `(\\d?\\d)`; - var year = `(\\d{4})`; - var RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/); - var IMF_FIXDATE = new RegExp(`^${ddd}, ${date5} ${mmm} ${year} ${time3} GMT$`); - var RFC_850_DATE = new RegExp(`^${ddd}, ${date5}-${mmm}-(\\d\\d) ${time3} GMT$`); - var ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time3} ${year}$`); - var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; - var _parseEpochTimestamp = (value) => { - if (value == null) { - return; - } - 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 * 1000)); - }; - var _parseRfc3339DateTimeWithOffset = (value) => { - if (value == null) { - return; - } - if (typeof value !== "string") { - throw new TypeError("RFC3339 timestamps must be strings"); - } - const matches2 = RFC3339_WITH_OFFSET.exec(value); - if (!matches2) { - throw new TypeError(`Invalid RFC3339 timestamp format ${value}`); - } - const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches2; - range2(monthStr, 1, 12); - range2(dayStr, 1, 31); - range2(hours, 0, 23); - range2(minutes, 0, 59); - range2(seconds, 0, 60); - const date6 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1000) : 0)); - date6.setUTCFullYear(Number(yearStr)); - if (offsetStr.toUpperCase() != "Z") { - const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [undefined, "+", 0, 0]; - const scalar = sign === "-" ? 1 : -1; - date6.setTime(date6.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1000 + Number(offsetM) * 60 * 1000)); - } - return date6; - }; - var _parseRfc7231DateTime = (value) => { - if (value == null) { - return; - } - 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 matches2; - if (matches2 = IMF_FIXDATE.exec(value)) { - [, day, month, year2, hour, minute, second, fraction] = matches2; - } else if (matches2 = RFC_850_DATE.exec(value)) { - [, day, month, year2, hour, minute, second, fraction] = matches2; - year2 = (Number(year2) + 1900).toString(); - } else if (matches2 = ASC_TIME.exec(value)) { - [, month, day, hour, minute, second, fraction, year2] = matches2; - } - 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}`) * 1000) : 0); - range2(day, 1, 31); - range2(hour, 0, 23); - range2(minute, 0, 59); - range2(second, 0, 60); - const date6 = new Date(timestamp); - date6.setUTCFullYear(Number(year2)); - return date6; - } - throw new TypeError(`Invalid RFC7231 date-time value ${value}.`); - }; - function range2(v, min2, max2) { - const _v = Number(v); - if (_v < min2 || _v > max2) { - throw new Error(`Value ${_v} out of range [${min2}, ${max2}]`); - } - } - function splitEvery(value, delimiter, numDelimiters) { - if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { - throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); - } - const segments = value.split(delimiter); - if (numDelimiters === 1) { - return segments; - } - const compoundSegments = []; - let currentSegment = ""; - for (let i2 = 0;i2 < segments.length; i2++) { - if (currentSegment === "") { - currentSegment = segments[i2]; - } else { - currentSegment += delimiter + segments[i2]; - } - if ((i2 + 1) % numDelimiters === 0) { - compoundSegments.push(currentSegment); - currentSegment = ""; - } - } - if (currentSegment !== "") { - compoundSegments.push(currentSegment); - } - return compoundSegments; - } - var splitHeader = (value) => { - const z2 = value.length; - const values2 = []; - let withinQuotes = false; - let prevChar = undefined; - let anchor = 0; - for (let i2 = 0;i2 < z2; ++i2) { - const char = value[i2]; - switch (char) { - case `"`: - if (prevChar !== "\\") { - withinQuotes = !withinQuotes; - } - break; - case ",": - if (!withinQuotes) { - values2.push(value.slice(anchor, i2)); - anchor = i2 + 1; - } - break; - } - prevChar = char; - } - values2.push(value.slice(anchor)); - return values2.map((v) => { - v = v.trim(); - const z3 = v.length; - if (z3 < 2) { - return v; - } - if (v[0] === `"` && v[z3 - 1] === `"`) { - v = v.slice(1, z3 - 1); - } - return v.replace(/\\"/g, '"'); - }); - }; - var format3 = /^-?\d*(\.\d+)?$/; - - class NumericValue { - string; - type; - constructor(string4, type) { - this.string = string4; - this.type = type; - if (!format3.test(string4)) { - 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](object2) { - if (!object2 || typeof object2 !== "object") { - return false; - } - const _nv = object2; - return NumericValue.prototype.isPrototypeOf(object2) || _nv.type === "bigDecimal" && format3.test(_nv.string); - } - } - function nv(input) { - return new NumericValue(String(input), "bigDecimal"); - } - Object.defineProperty(exports, "generateIdempotencyToken", { - enumerable: true, - get: function() { - return uuid3.v4; - } - }); - exports.LazyJsonString = LazyJsonString; - exports.NumericValue = NumericValue; - exports._parseEpochTimestamp = _parseEpochTimestamp; - exports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset; - exports._parseRfc7231DateTime = _parseRfc7231DateTime; - exports.copyDocumentWithTransform = copyDocumentWithTransform; - exports.dateToUtcString = dateToUtcString; - exports.expectBoolean = expectBoolean; - exports.expectByte = expectByte; - exports.expectFloat32 = expectFloat32; - exports.expectInt = expectInt; - exports.expectInt32 = expectInt32; - exports.expectLong = expectLong; - exports.expectNonNull = expectNonNull; - exports.expectNumber = expectNumber; - exports.expectObject = expectObject; - exports.expectShort = expectShort; - exports.expectString = expectString; - exports.expectUnion = expectUnion; - exports.handleFloat = handleFloat; - exports.limitedParseDouble = limitedParseDouble; - exports.limitedParseFloat = limitedParseFloat; - exports.limitedParseFloat32 = limitedParseFloat32; - exports.logger = logger; - exports.nv = nv; - exports.parseBoolean = parseBoolean; - exports.parseEpochTimestamp = parseEpochTimestamp; - exports.parseRfc3339DateTime = parseRfc3339DateTime; - exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset; - exports.parseRfc7231DateTime = parseRfc7231DateTime; - exports.quoteHeader = quoteHeader; - exports.splitEvery = splitEvery; - exports.splitHeader = splitHeader; - exports.strictParseByte = strictParseByte; - exports.strictParseDouble = strictParseDouble; - exports.strictParseFloat = strictParseFloat; - exports.strictParseFloat32 = strictParseFloat32; - exports.strictParseInt = strictParseInt; - exports.strictParseInt32 = strictParseInt32; - exports.strictParseLong = strictParseLong; - exports.strictParseShort = strictParseShort; -}); - -// ../node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js -var require_event_streams2 = __commonJS((exports) => { - var utilUtf8 = require_dist_cjs64(); - - class EventStreamSerde { - 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 = Symbol("initialRequestMarker"); - const eventStreamIterable = { - async* [Symbol.asyncIterator]() { - if (initialRequest) { - const headers = { - ":event-type": { type: "string", value: "initial-request" }, - ":message-type": { type: "string", value: "event" }, - ":content-type": { type: "string", value: defaultContentType } - }; - serializer.write(requestSchema, initialRequest); - const body = serializer.flush(); - yield { - [initialRequestMarker]: true, - headers, - body - }; - } - for await (const page of eventStream) { - yield page; - } - } - }; - return marshaller.serialize(eventStreamIterable, (event) => { - if (event[initialRequestMarker]) { - return { - headers: event.headers, - body: event.body - }; - } - const unionMember = Object.keys(event).find((key) => { - return key !== "__type"; - }) ?? ""; - const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event); - const headers = { - ":event-type": { type: "string", value: eventType }, - ":message-type": { type: "string", value: "event" }, - ":content-type": { type: "string", value: explicitPayloadContentType ?? defaultContentType }, - ...additionalHeaders - }; - return { - headers, - body - }; - }); - } - async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { - const marshaller = this.marshaller; - const eventStreamMember = responseSchema.getEventStreamMember(); - const unionSchema = responseSchema.getMemberSchema(eventStreamMember); - const memberSchemas = unionSchema.getMemberSchemas(); - const initialResponseMarker = Symbol("initialResponseMarker"); - const asyncIterable = marshaller.deserialize(response.body, async (event) => { - const unionMember = Object.keys(event).find((key) => { - return key !== "__type"; - }) ?? ""; - const body = event[unionMember].body; - if (unionMember === "initial-response") { - const dataObject = await this.deserializer.read(responseSchema, body); - delete dataObject[eventStreamMember]; - return { - [initialResponseMarker]: true, - ...dataObject - }; - } else if (unionMember in memberSchemas) { - const eventStreamSchema = memberSchemas[unionMember]; - if (eventStreamSchema.isStructSchema()) { - const out = {}; - let hasBindings = false; - for (const [name, member] of eventStreamSchema.structIterator()) { - const { eventHeader, eventPayload } = member.getMergedTraits(); - hasBindings = hasBindings || Boolean(eventHeader || eventPayload); - if (eventPayload) { - if (member.isBlobSchema()) { - out[name] = body; - } else if (member.isStringSchema()) { - out[name] = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(body); - } else if (member.isStructSchema()) { - out[name] = await this.deserializer.read(member, body); - } - } else if (eventHeader) { - const value = event[unionMember].headers[name]?.value; - if (value != null) { - if (member.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 - }; - } - } - return { - [unionMember]: await this.deserializer.read(eventStreamSchema, body) - }; - } else { - return { - $unknown: event - }; - } - }); - const asyncIterator2 = asyncIterable[Symbol.asyncIterator](); - const firstEvent = await asyncIterator2.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; - } - } - return { - async* [Symbol.asyncIterator]() { - if (!firstEvent?.value?.[initialResponseMarker]) { - yield firstEvent.value; - } - while (true) { - const { done, value } = await asyncIterator2.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; - break; - } 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 { - throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union."); - } - } - const messageSerialization = serializer.flush(); - const body = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8)(messageSerialization) : messageSerialization; - return { - body, - eventType, - explicitPayloadContentType, - additionalHeaders - }; - } - } - exports.EventStreamSerde = EventStreamSerde; -}); - -// ../node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js -var require_protocols3 = __commonJS((exports) => { - var utilStream = require_dist_cjs69(); - var schema = require_schema2(); - var serde = require_serde2(); - var protocolHttp = require_dist_cjs56(); - var utilBase64 = require_dist_cjs65(); - var utilUtf8 = require_dist_cjs64(); - var collectBody = async (streamBody = new Uint8Array, context) => { - if (streamBody instanceof Uint8Array) { - return utilStream.Uint8ArrayBlobAdapter.mutate(streamBody); - } - if (!streamBody) { - return utilStream.Uint8ArrayBlobAdapter.mutate(new Uint8Array); - } - const fromContext = context.streamCollector(streamBody); - return utilStream.Uint8ArrayBlobAdapter.mutate(await fromContext); - }; - function extendedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function(c5) { - return "%" + c5.charCodeAt(0).toString(16).toUpperCase(); - }); - } - - class SerdeContext { - serdeContext; - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - } - } - - class HttpProtocol extends SerdeContext { - options; - constructor(options) { - super(); - this.options = options; - } - getRequestType() { - return protocolHttp.HttpRequest; - } - getResponseType() { - return protocolHttp.HttpResponse; - } - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - this.serializer.setSerdeContext(serdeContext); - this.deserializer.setSerdeContext(serdeContext); - if (this.getPayloadCodec()) { - this.getPayloadCodec().setSerdeContext(serdeContext); - } - } - updateServiceEndpoint(request, endpoint) { - if ("url" in endpoint) { - request.protocol = endpoint.url.protocol; - request.hostname = endpoint.url.hostname; - request.port = endpoint.url.port ? Number(endpoint.url.port) : undefined; - request.path = endpoint.url.pathname; - request.fragment = endpoint.url.hash || undefined; - request.username = endpoint.url.username || undefined; - request.password = endpoint.url.password || undefined; - if (!request.query) { - request.query = {}; - } - for (const [k, v] of endpoint.url.searchParams.entries()) { - request.query[k] = v; - } - return request; - } else { - request.protocol = endpoint.protocol; - request.hostname = endpoint.hostname; - request.port = endpoint.port ? Number(endpoint.port) : undefined; - request.path = endpoint.path; - request.query = { - ...endpoint.query - }; - return request; - } - } - setHostPrefix(request, operationSchema, input) { - const inputNs = schema.NormalizedSchema.of(operationSchema.input); - const opTraits = schema.translateTraits(operationSchema.traits ?? {}); - if (opTraits.endpoint) { - let hostPrefix = opTraits.endpoint?.[0]; - if (typeof hostPrefix === "string") { - const hostLabelInputs = [...inputNs.structIterator()].filter(([, member]) => member.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); - } - request.hostname = hostPrefix + request.hostname; - } - } - } - deserializeMetadata(output) { - return { - httpStatusCode: output.statusCode, - requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], - extendedRequestId: output.headers["x-amz-id-2"], - cfId: output.headers["x-amz-cf-id"] - }; - } - async serializeEventStream({ eventStream, requestSchema, initialRequest }) { - const eventStreamSerde = await this.loadEventStreamCapability(); - return eventStreamSerde.serializeEventStream({ - eventStream, - requestSchema, - initialRequest - }); - } - async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { - const eventStreamSerde = await this.loadEventStreamCapability(); - return eventStreamSerde.deserializeEventStream({ - response, - responseSchema, - initialResponseContainer - }); - } - async loadEventStreamCapability() { - const { EventStreamSerde } = await Promise.resolve().then(() => __toESM(require_event_streams2(), 1)); - return new EventStreamSerde({ - 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(schema2, context, response, arg4, arg5) { - return []; - } - getEventStreamMarshaller() { - const context = this.serdeContext; - if (!context.eventStreamMarshaller) { - throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext."); - } - return context.eventStreamMarshaller; - } - } - - class HttpBindingProtocol extends HttpProtocol { - async serializeRequest(operationSchema, _input, context) { - const input = { - ..._input ?? {} - }; - const serializer = this.serializer; - const query = {}; - const headers = {}; - const endpoint = await context.endpoint(); - const ns = schema.NormalizedSchema.of(operationSchema?.input); - const schema$1 = ns.getSchema(); - let hasNonHttpBindingMember = false; - let payload; - const request = new protocolHttp.HttpRequest({ - protocol: "", - hostname: "", - port: undefined, - path: "", - fragment: undefined, - query, - headers, - body: undefined - }); - if (endpoint) { - this.updateServiceEndpoint(request, endpoint); - this.setHostPrefix(request, operationSchema, input); - const opTraits = schema.translateTraits(operationSchema.traits); - if (opTraits.http) { - request.method = opTraits.http[0]; - const [path9, search] = opTraits.http[1].split("?"); - if (request.path == "/") { - request.path = path9; - } else { - request.path += path9; - } - const traitSearchParams = new URLSearchParams(search ?? ""); - Object.assign(query, Object.fromEntries(traitSearchParams)); - } - } - for (const [memberName, memberNs] of ns.structIterator()) { - const memberTraits = memberNs.getMergedTraits() ?? {}; - const inputMemberValue = input[memberName]; - if (inputMemberValue == null && !memberNs.isIdempotencyToken()) { - 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: ns - }); - } - } 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 (request.path.includes(`{${memberName}+}`)) { - request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/")); - } else if (request.path.includes(`{${memberName}}`)) { - request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement)); - } - 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; - } - } - if (hasNonHttpBindingMember && input) { - serializer.write(schema$1, input); - payload = serializer.flush(); - } - request.headers = headers; - request.query = query; - request.body = payload; - return request; - } - serializeQuery(ns, data, query) { - const serializer = this.serializer; - const traits = ns.getMergedTraits(); - if (traits.httpQueryParams) { - for (const [key, val] of Object.entries(data)) { - if (!(key in query)) { - const valueSchema = ns.getValueSchema(); - Object.assign(valueSchema.getMergedTraits(), { - ...traits, - httpQuery: key, - httpQueryParams: undefined - }); - this.serializeQuery(valueSchema, val, query); - } - } - return; - } - if (ns.isListSchema()) { - const sparse = !!ns.getMergedTraits().sparse; - const buffer = []; - for (const item of data) { - serializer.write([ns.getValueSchema(), traits], item); - const serializable = serializer.flush(); - if (sparse || serializable !== undefined) { - buffer.push(serializable); - } - } - query[traits.httpQuery] = buffer; - } else { - serializer.write([ns, traits], data); - query[traits.httpQuery] = serializer.flush(); - } - } - async deserializeResponse(operationSchema, context, response) { - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes)); - } - await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); - throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw."); - } - for (const header in response.headers) { - const value = response.headers[header]; - delete response.headers[header]; - response.headers[header.toLowerCase()] = value; - } - const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject); - if (nonHttpBindingMembers.length) { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - const dataFromBody = await deserializer.read(ns, bytes); - for (const member of nonHttpBindingMembers) { - dataObject[member] = dataFromBody[member]; - } - } - } else if (nonHttpBindingMembers.discardResponseBody) { - await collectBody(response.body, context); - } - dataObject.$metadata = this.deserializeMetadata(response); - return dataObject; - } - async deserializeHttpMessage(schema$1, context, response, arg4, arg5) { - let dataObject; - if (arg4 instanceof Set) { - dataObject = arg5; - } else { - dataObject = arg4; - } - let discardResponseBody = true; - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(schema$1); - const nonHttpBindingMembers = []; - for (const [memberName, memberSchema] of ns.structIterator()) { - const memberTraits = memberSchema.getMemberTraits(); - if (memberTraits.httpPayload) { - discardResponseBody = false; - const isStreaming = memberSchema.isStreaming(); - if (isStreaming) { - const isEventStream = memberSchema.isStructSchema(); - if (isEventStream) { - dataObject[memberName] = await this.deserializeEventStream({ - response, - responseSchema: ns - }); - } else { - dataObject[memberName] = utilStream.sdkStreamMixin(response.body); - } - } else if (response.body) { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - dataObject[memberName] = await deserializer.read(memberSchema, bytes); - } - } - } else if (memberTraits.httpHeader) { - const key = String(memberTraits.httpHeader).toLowerCase(); - const value = response.headers[key]; - if (value != null) { - if (memberSchema.isListSchema()) { - const headerListValueSchema = memberSchema.getValueSchema(); - headerListValueSchema.getMergedTraits().httpHeader = key; - let sections; - if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) { - sections = serde.splitEvery(value, ",", 2); - } else { - sections = serde.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 !== undefined) { - 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; - } - } - - class RpcProtocol extends HttpProtocol { - async serializeRequest(operationSchema, input, context) { - const serializer = this.serializer; - const query = {}; - const headers = {}; - const endpoint = await context.endpoint(); - const ns = schema.NormalizedSchema.of(operationSchema?.input); - const schema$1 = ns.getSchema(); - let payload; - const request = new protocolHttp.HttpRequest({ - protocol: "", - hostname: "", - port: undefined, - path: "/", - fragment: undefined, - query, - headers, - body: undefined - }); - if (endpoint) { - this.updateServiceEndpoint(request, endpoint); - this.setHostPrefix(request, operationSchema, input); - } - const _input = { - ...input - }; - if (input) { - const eventStreamMember = ns.getEventStreamMember(); - if (eventStreamMember) { - if (_input[eventStreamMember]) { - const initialRequest = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - if (memberName !== eventStreamMember && _input[memberName]) { - serializer.write(memberSchema, _input[memberName]); - initialRequest[memberName] = serializer.flush(); - } - } - payload = await this.serializeEventStream({ - eventStream: _input[eventStreamMember], - requestSchema: ns, - initialRequest - }); - } - } else { - serializer.write(schema$1, _input); - payload = serializer.flush(); - } - } - request.headers = headers; - request.query = query; - request.body = payload; - request.method = "POST"; - return request; - } - async deserializeResponse(operationSchema, context, response) { - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes)); - } - await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); - throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw."); - } - for (const header in response.headers) { - const value = response.headers[header]; - delete response.headers[header]; - response.headers[header.toLowerCase()] = value; - } - const eventStreamMember = ns.getEventStreamMember(); - if (eventStreamMember) { - dataObject[eventStreamMember] = await this.deserializeEventStream({ - response, - responseSchema: ns, - initialResponseContainer: dataObject - }); - } else { - const bytes = await collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(ns, bytes)); - } - } - dataObject.$metadata = this.deserializeMetadata(response); - return dataObject; - } - } - var resolvedPath = (resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { - if (input != null && input[memberName] !== undefined) { - const labelValue = labelValueProvider(); - if (labelValue.length <= 0) { - throw new Error("Empty value provided for input HTTP label: " + memberName + "."); - } - resolvedPath2 = resolvedPath2.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue)); - } else { - throw new Error("No value provided for input HTTP label: " + memberName + "."); - } - return resolvedPath2; - }; - function requestBuilder(input, context) { - return new RequestBuilder(input, context); - } - - class RequestBuilder { - input; - context; - query = {}; - method = ""; - headers = {}; - path = ""; - body = null; - hostname = ""; - resolvePathStack = []; - constructor(input, context) { - this.input = input; - this.context = context; - } - async build() { - const { hostname: hostname2, protocol = "https", port, path: basePath } = await this.context.endpoint(); - this.path = basePath; - for (const resolvePath of this.resolvePathStack) { - resolvePath(this.path); - } - return new protocolHttp.HttpRequest({ - protocol, - hostname: this.hostname || hostname2, - port, - method: this.method, - path: this.path, - query: this.query, - body: this.body, - headers: this.headers - }); - } - hn(hostname2) { - this.hostname = hostname2; - return this; - } - bp(uriLabel) { - this.resolvePathStack.push((basePath) => { - this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel; - }); - return this; - } - p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { - this.resolvePathStack.push((path9) => { - this.path = resolvedPath(path9, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel); - }); - return this; - } - h(headers) { - this.headers = headers; - return this; - } - q(query) { - this.query = query; - return this; - } - b(body) { - this.body = body; - return this; - } - m(method2) { - this.method = method2; - return this; - } - } - function determineTimestampFormat(ns, settings) { - if (settings.timestampFormat.useTrait) { - if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) { - return ns.getSchema(); - } - } - const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits(); - const bindingFormat = settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : undefined : undefined; - return bindingFormat ?? settings.timestampFormat.default; - } - - class FromStringShapeDeserializer extends SerdeContext { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - read(_schema, data) { - const ns = schema.NormalizedSchema.of(_schema); - if (ns.isListSchema()) { - return serde.splitHeader(data).map((item) => this.read(ns.getValueSchema(), item)); - } - if (ns.isBlobSchema()) { - return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(data); - } - if (ns.isTimestampSchema()) { - const format3 = determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - return serde._parseRfc3339DateTimeWithOffset(data); - case 6: - return serde._parseRfc7231DateTime(data); - case 7: - return serde._parseEpochTimestamp(data); - default: - console.warn("Missing timestamp format, parsing value with Date constructor:", data); - return new Date(data); - } - } - if (ns.isStringSchema()) { - const mediaType = ns.getMergedTraits().mediaType; - let intermediateValue = data; - if (mediaType) { - if (ns.getMergedTraits().httpHeader) { - intermediateValue = this.base64ToUtf8(intermediateValue); - } - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - intermediateValue = serde.LazyJsonString.from(intermediateValue); - } - return intermediateValue; - } - } - if (ns.isNumericSchema()) { - return Number(data); - } - if (ns.isBigIntegerSchema()) { - return BigInt(data); - } - if (ns.isBigDecimalSchema()) { - return new serde.NumericValue(data, "bigDecimal"); - } - if (ns.isBooleanSchema()) { - return String(data).toLowerCase() === "true"; - } - return data; - } - base64ToUtf8(base64String) { - return (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)((this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(base64String)); - } - } - - class HttpInterceptingShapeDeserializer 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$1, data) { - const ns = schema.NormalizedSchema.of(schema$1); - const traits = ns.getMergedTraits(); - const toString6 = this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8; - if (traits.httpHeader || traits.httpResponseCode) { - return this.stringDeserializer.read(ns, toString6(data)); - } - if (traits.httpPayload) { - if (ns.isBlobSchema()) { - const toBytes = this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8; - if (typeof data === "string") { - return toBytes(data); - } - return data; - } else if (ns.isStringSchema()) { - if ("byteLength" in data) { - return toString6(data); - } - return data; - } - } - return this.codecDeserializer.read(ns, data); - } - } - - class ToStringShapeSerializer extends SerdeContext { - settings; - stringBuffer = ""; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema$1, value) { - const ns = schema.NormalizedSchema.of(schema$1); - switch (typeof value) { - case "object": - if (value === null) { - this.stringBuffer = "null"; - return; - } - if (ns.isTimestampSchema()) { - if (!(value instanceof Date)) { - throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`); - } - const format3 = determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - this.stringBuffer = value.toISOString().replace(".000Z", "Z"); - break; - case 6: - this.stringBuffer = serde.dateToUtcString(value); - break; - case 7: - this.stringBuffer = String(value.getTime() / 1000); - break; - default: - console.warn("Missing timestamp format, using epoch seconds", value); - this.stringBuffer = String(value.getTime() / 1000); - } - return; - } - if (ns.isBlobSchema() && "byteLength" in value) { - this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - return; - } - if (ns.isListSchema() && Array.isArray(value)) { - let buffer = ""; - for (const item of value) { - this.write([ns.getValueSchema(), ns.getMergedTraits()], item); - const headerItem = this.flush(); - const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : serde.quoteHeader(headerItem); - if (buffer !== "") { - buffer += ", "; - } - buffer += serialized; - } - this.stringBuffer = buffer; - return; - } - this.stringBuffer = JSON.stringify(value, null, 2); - break; - case "string": - const mediaType = ns.getMergedTraits().mediaType; - let intermediateValue = value; - if (mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - intermediateValue = serde.LazyJsonString.from(intermediateValue); - } - if (ns.getMergedTraits().httpHeader) { - this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(intermediateValue.toString()); - return; - } - } - this.stringBuffer = value; - break; - default: - if (ns.isIdempotencyToken()) { - this.stringBuffer = serde.generateIdempotencyToken(); - } else { - this.stringBuffer = String(value); - } - } - } - flush() { - const buffer = this.stringBuffer; - this.stringBuffer = ""; - return buffer; - } - } - - class HttpInterceptingShapeSerializer { - 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$1, value) { - const ns = schema.NormalizedSchema.of(schema$1); - const traits = ns.getMergedTraits(); - if (traits.httpHeader || traits.httpLabel || traits.httpQuery) { - this.stringSerializer.write(ns, value); - this.buffer = this.stringSerializer.flush(); - return; - } - return this.codecSerializer.write(ns, value); - } - flush() { - if (this.buffer !== undefined) { - const buffer = this.buffer; - this.buffer = undefined; - return buffer; - } - return this.codecSerializer.flush(); - } - } - exports.FromStringShapeDeserializer = FromStringShapeDeserializer; - exports.HttpBindingProtocol = HttpBindingProtocol; - exports.HttpInterceptingShapeDeserializer = HttpInterceptingShapeDeserializer; - exports.HttpInterceptingShapeSerializer = HttpInterceptingShapeSerializer; - exports.HttpProtocol = HttpProtocol; - exports.RequestBuilder = RequestBuilder; - exports.RpcProtocol = RpcProtocol; - exports.SerdeContext = SerdeContext; - exports.ToStringShapeSerializer = ToStringShapeSerializer; - exports.collectBody = collectBody; - exports.determineTimestampFormat = determineTimestampFormat; - exports.extendedEncodeURIComponent = extendedEncodeURIComponent; - exports.requestBuilder = requestBuilder; - exports.resolvedPath = resolvedPath; -}); - -// ../node_modules/@smithy/core/dist-cjs/index.js -var require_dist_cjs71 = __commonJS((exports) => { - var types = require_dist_cjs55(); - var utilMiddleware = require_dist_cjs60(); - var middlewareSerde = require_dist_cjs61(); - var protocolHttp = require_dist_cjs56(); - var protocols = require_protocols3(); - var getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {}); - var resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => { - if (!authSchemePreference || authSchemePreference.length === 0) { - return candidateAuthOptions; - } - const preferredAuthOptions = []; - for (const preferredSchemeName of authSchemePreference) { - for (const candidateAuthOption of candidateAuthOptions) { - const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; - if (candidateAuthSchemeName === preferredSchemeName) { - preferredAuthOptions.push(candidateAuthOption); - } - } - } - for (const candidateAuthOption of candidateAuthOptions) { - if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { - preferredAuthOptions.push(candidateAuthOption); - } - } - return preferredAuthOptions; - }; - function convertHttpAuthSchemesToMap(httpAuthSchemes) { - const map3 = new Map; - for (const scheme of httpAuthSchemes) { - map3.set(scheme.schemeId, scheme); - } - return map3; - } - var httpAuthSchemeMiddleware = (config2, mwOptions) => (next, context) => async (args) => { - const options = config2.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config2, context, args.input)); - const authSchemePreference = config2.authSchemePreference ? await config2.authSchemePreference() : []; - const resolvedOptions = resolveAuthOptions(options, authSchemePreference); - const authSchemes = convertHttpAuthSchemesToMap(config2.httpAuthSchemes); - const smithyContext = utilMiddleware.getSmithyContext(context); - const failureReasons = []; - for (const option of resolvedOptions) { - const scheme = authSchemes.get(option.schemeId); - if (!scheme) { - failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); - continue; - } - const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config2)); - if (!identityProvider) { - failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); - continue; - } - const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config2, context) || {}; - option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties); - option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties); - smithyContext.selectedHttpAuthScheme = { - httpAuthOption: option, - identity: await identityProvider(option.identityProperties), - signer: scheme.signer - }; - break; - } - if (!smithyContext.selectedHttpAuthScheme) { - throw new Error(failureReasons.join(` -`)); - } - return next(args); - }; - var httpAuthSchemeEndpointRuleSetMiddlewareOptions = { - step: "serialize", - tags: ["HTTP_AUTH_SCHEME"], - name: "httpAuthSchemeMiddleware", - override: true, - relation: "before", - toMiddleware: "endpointV2Middleware" - }; - var getHttpAuthSchemeEndpointRuleSetPlugin = (config2, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpAuthSchemeMiddleware(config2, { - httpAuthSchemeParametersProvider, - identityProviderConfigProvider - }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); - } - }); - var httpAuthSchemeMiddlewareOptions = { - step: "serialize", - tags: ["HTTP_AUTH_SCHEME"], - name: "httpAuthSchemeMiddleware", - override: true, - relation: "before", - toMiddleware: middlewareSerde.serializerMiddlewareOption.name - }; - var getHttpAuthSchemePlugin = (config2, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpAuthSchemeMiddleware(config2, { - httpAuthSchemeParametersProvider, - identityProviderConfigProvider - }), httpAuthSchemeMiddlewareOptions); - } - }); - var defaultErrorHandler = (signingProperties) => (error41) => { - throw error41; - }; - var defaultSuccessHandler = (httpResponse, signingProperties) => {}; - var httpSigningMiddleware = (config2) => (next, context) => async (args) => { - if (!protocolHttp.HttpRequest.isInstance(args.request)) { - return next(args); - } - const smithyContext = utilMiddleware.getSmithyContext(context); - const scheme = smithyContext.selectedHttpAuthScheme; - if (!scheme) { - throw new Error(`No HttpAuthScheme was selected: unable to sign request`); - } - const { httpAuthOption: { signingProperties = {} }, identity: identity4, signer } = scheme; - const output = await next({ - ...args, - request: await signer.sign(args.request, identity4, signingProperties) - }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); - (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); - return output; - }; - var httpSigningMiddlewareOptions = { - step: "finalizeRequest", - tags: ["HTTP_SIGNING"], - name: "httpSigningMiddleware", - aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], - override: true, - relation: "after", - toMiddleware: "retryMiddleware" - }; - var getHttpSigningPlugin = (config2) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(httpSigningMiddleware(), httpSigningMiddlewareOptions); - } - }); - var normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; - }; - var makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => { - let command = new CommandCtor(input); - command = withCommand(command) ?? command; - return await client.send(command, ...args); - }; - function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { - return async function* paginateOperation(config2, input, ...additionalArguments) { - const _input = input; - let token = config2.startingToken ?? _input[inputTokenName]; - let hasNext = true; - let page; - while (hasNext) { - _input[inputTokenName] = token; - if (pageSizeTokenName) { - _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config2.pageSize; - } - if (config2.client instanceof ClientCtor) { - page = await makePagedClientRequest(CommandCtor, config2.client, input, config2.withCommand, ...additionalArguments); - } else { - throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); - } - yield page; - const prevToken = token; - token = get2(page, outputTokenName); - hasNext = !!(token && (!config2.stopOnSameToken || token !== prevToken)); - } - return; - }; - } - var get2 = (fromObject, path9) => { - let cursor = fromObject; - const pathComponents = path9.split("."); - for (const step of pathComponents) { - if (!cursor || typeof cursor !== "object") { - return; - } - cursor = cursor[step]; - } - return cursor; - }; - function setFeature(context, feature2, value) { - if (!context.__smithy_context) { - context.__smithy_context = { - features: {} - }; - } else if (!context.__smithy_context.features) { - context.__smithy_context.features = {}; - } - context.__smithy_context.features[feature2] = value; - } - - class DefaultIdentityProviderConfig { - authSchemes = new Map; - constructor(config2) { - for (const [key, value] of Object.entries(config2)) { - if (value !== undefined) { - this.authSchemes.set(key, value); - } - } - } - getIdentityProvider(schemeId) { - return this.authSchemes.get(schemeId); - } - } - - class HttpApiKeyAuthSigner { - async sign(httpRequest, identity4, signingProperties) { - if (!signingProperties) { - throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"); - } - if (!signingProperties.name) { - throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing"); - } - if (!signingProperties.in) { - throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing"); - } - if (!identity4.apiKey) { - throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined"); - } - const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest); - if (signingProperties.in === types.HttpApiKeyAuthLocation.QUERY) { - clonedRequest.query[signingProperties.name] = identity4.apiKey; - } else if (signingProperties.in === types.HttpApiKeyAuthLocation.HEADER) { - clonedRequest.headers[signingProperties.name] = signingProperties.scheme ? `${signingProperties.scheme} ${identity4.apiKey}` : identity4.apiKey; - } else { - throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " + "but found: `" + signingProperties.in + "`"); - } - return clonedRequest; - } - } - - class HttpBearerAuthSigner { - async sign(httpRequest, identity4, signingProperties) { - const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest); - if (!identity4.token) { - throw new Error("request could not be signed with `token` since the `token` is not defined"); - } - clonedRequest.headers["Authorization"] = `Bearer ${identity4.token}`; - return clonedRequest; - } - } - - class NoAuthSigner { - async sign(httpRequest, identity4, signingProperties) { - return httpRequest; - } - } - var createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired(identity4) { - return doesIdentityRequireRefresh(identity4) && identity4.expiration.getTime() - Date.now() < expirationMs; - }; - var EXPIRATION_MS = 300000; - var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); - var doesIdentityRequireRefresh = (identity4) => identity4.expiration !== undefined; - var memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => { - if (provider === undefined) { - return; - } - 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 = undefined; - } - return resolved; - }; - if (isExpired === undefined) { - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(options); - } - return resolved; - }; - } - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(options); - } - if (isConstant) { - return resolved; - } - if (!requiresRefresh(resolved)) { - isConstant = true; - return resolved; - } - if (isExpired(resolved)) { - await coalesceProvider(options); - return resolved; - } - return resolved; - }; - }; - Object.defineProperty(exports, "requestBuilder", { - enumerable: true, - get: function() { - return protocols.requestBuilder; - } - }); - exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig; - exports.EXPIRATION_MS = EXPIRATION_MS; - exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner; - exports.HttpBearerAuthSigner = HttpBearerAuthSigner; - exports.NoAuthSigner = NoAuthSigner; - exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction; - exports.createPaginator = createPaginator; - exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh; - exports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin; - exports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin; - exports.getHttpSigningPlugin = getHttpSigningPlugin; - exports.getSmithyContext = getSmithyContext; - exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = httpAuthSchemeEndpointRuleSetMiddlewareOptions; - exports.httpAuthSchemeMiddleware = httpAuthSchemeMiddleware; - exports.httpAuthSchemeMiddlewareOptions = httpAuthSchemeMiddlewareOptions; - exports.httpSigningMiddleware = httpSigningMiddleware; - exports.httpSigningMiddlewareOptions = httpSigningMiddlewareOptions; - exports.isIdentityExpired = isIdentityExpired; - exports.memoizeIdentityProvider = memoizeIdentityProvider; - exports.normalizeProvider = normalizeProvider; - exports.setFeature = setFeature; -}); - -// ../node_modules/@smithy/util-endpoints/dist-cjs/index.js -var require_dist_cjs72 = __commonJS((exports) => { - var types = require_dist_cjs55(); - - class EndpointCache { - capacity; - data = new Map; - parameters = []; - constructor({ size: size2, params }) { - this.capacity = size2 ?? 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 keys2 = this.data.keys(); - let i2 = 0; - while (true) { - const { value, done } = keys2.next(); - this.data.delete(value); - if (done || ++i2 > 10) { - break; - } - } - } - this.data.set(key, resolver()); - } - return this.data.get(key); - } - size() { - return this.data.size; - } - hash(endpointParams) { - let buffer = ""; - const { parameters } = this; - if (parameters.length === 0) { - return false; - } - for (const param of parameters) { - const val = String(endpointParams[param] ?? ""); - if (val.includes("|;")) { - return false; - } - buffer += val + "|;"; - } - return buffer; - } - } - var IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); - var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"); - var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); - var isValidHostLabel = (value, allowSubDomains = false) => { - if (!allowSubDomains) { - return VALID_HOST_LABEL_REGEX.test(value); - } - const labels = value.split("."); - for (const label of labels) { - if (!isValidHostLabel(label)) { - return false; - } - } - return true; - }; - var customEndpointFunctions = {}; - var debugId = "endpoints"; - function toDebugString(input) { - if (typeof input !== "object" || input == null) { - return input; - } - if ("ref" in input) { - return `$${toDebugString(input.ref)}`; - } - if ("fn" in input) { - return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; - } - return JSON.stringify(input, null, 2); - } - - class EndpointError extends Error { - constructor(message) { - super(message); - this.name = "EndpointError"; - } - } - var booleanEquals = (value1, value2) => value1 === value2; - var getAttrPathList = (path9) => { - const parts = path9.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: '${path9}' 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: '${path9}'`); - } - if (squareBracketIndex !== 0) { - pathList.push(part.slice(0, squareBracketIndex)); - } - pathList.push(arrayIndex); - } else { - pathList.push(part); - } - } - return pathList; - }; - var getAttr = (value, path9) => getAttrPathList(path9).reduce((acc, index) => { - if (typeof acc !== "object") { - throw new EndpointError(`Index '${index}' in '${path9}' not found in '${JSON.stringify(value)}'`); - } else if (Array.isArray(acc)) { - return acc[parseInt(index)]; - } - return acc[index]; - }, value); - var isSet2 = (value) => value != null; - var not = (value) => !value; - var DEFAULT_PORTS2 = { - [types.EndpointURLScheme.HTTP]: 80, - [types.EndpointURLScheme.HTTPS]: 443 - }; - var parseURL = (value) => { - const whatwgURL = (() => { - try { - if (value instanceof URL) { - return value; - } - if (typeof value === "object" && "hostname" in value) { - const { hostname: hostname3, port, protocol: protocol2 = "", path: path9 = "", query = {} } = value; - const url3 = new URL(`${protocol2}//${hostname3}${port ? `:${port}` : ""}${path9}`); - url3.search = Object.entries(query).map(([k, v]) => `${k}=${v}`).join("&"); - return url3; - } - return new URL(value); - } catch (error41) { - return null; - } - })(); - if (!whatwgURL) { - console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); - return null; - } - const urlString = whatwgURL.href; - const { host, hostname: hostname2, pathname, protocol, search } = whatwgURL; - if (search) { - return null; - } - const scheme = protocol.slice(0, -1); - if (!Object.values(types.EndpointURLScheme).includes(scheme)) { - return null; - } - const isIp = isIpAddress(hostname2); - const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS2[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS2[scheme]}`); - const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS2[scheme]}` : ``}`; - return { - scheme, - authority, - path: pathname, - normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, - isIp - }; - }; - var stringEquals = (value1, value2) => value1 === value2; - var substring = (input, start, stop, reverse2) => { - if (start >= stop || input.length < stop) { - return null; - } - if (!reverse2) { - return input.substring(start, stop); - } - return input.substring(input.length - stop, input.length - start); - }; - var uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c5) => `%${c5.charCodeAt(0).toString(16).toUpperCase()}`); - var endpointFunctions = { - booleanEquals, - getAttr, - isSet: isSet2, - isValidHostLabel, - not, - parseURL, - stringEquals, - substring, - uriEncode - }; - var evaluateTemplate = (template2, options) => { - const evaluatedTemplateArr = []; - const templateContext = { - ...options.endpointParams, - ...options.referenceRecord - }; - let currentIndex = 0; - while (currentIndex < template2.length) { - const openingBraceIndex = template2.indexOf("{", currentIndex); - if (openingBraceIndex === -1) { - evaluatedTemplateArr.push(template2.slice(currentIndex)); - break; - } - evaluatedTemplateArr.push(template2.slice(currentIndex, openingBraceIndex)); - const closingBraceIndex = template2.indexOf("}", openingBraceIndex); - if (closingBraceIndex === -1) { - evaluatedTemplateArr.push(template2.slice(openingBraceIndex)); - break; - } - if (template2[openingBraceIndex + 1] === "{" && template2[closingBraceIndex + 1] === "}") { - evaluatedTemplateArr.push(template2.slice(openingBraceIndex + 1, closingBraceIndex)); - currentIndex = closingBraceIndex + 2; - } - const parameterName = template2.substring(openingBraceIndex + 1, closingBraceIndex); - if (parameterName.includes("#")) { - const [refName, attrName] = parameterName.split("#"); - evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName)); - } else { - evaluatedTemplateArr.push(templateContext[parameterName]); - } - currentIndex = closingBraceIndex + 1; - } - return evaluatedTemplateArr.join(""); - }; - var getReferenceValue = ({ ref }, options) => { - const referenceRecord = { - ...options.endpointParams, - ...options.referenceRecord - }; - return referenceRecord[ref]; - }; - var evaluateExpression = (obj, keyName, options) => { - if (typeof obj === "string") { - return evaluateTemplate(obj, options); - } else if (obj["fn"]) { - return group$2.callFunction(obj, options); - } else if (obj["ref"]) { - return getReferenceValue(obj, options); - } - throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); - }; - var callFunction = ({ fn, argv }, options) => { - const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : group$2.evaluateExpression(arg, "arg", options)); - const fnSegments = fn.split("."); - if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) { - return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs); - } - return endpointFunctions[fn](...evaluatedArgs); - }; - var group$2 = { - evaluateExpression, - callFunction - }; - var evaluateCondition = ({ assign: assign2, ...fnArgs }, options) => { - if (assign2 && assign2 in options.referenceRecord) { - throw new EndpointError(`'${assign2}' 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, - ...assign2 != null && { toAssign: { name: assign2, value } } - }; - }; - var evaluateConditions = (conditions = [], options) => { - const conditionsReferenceRecord = {}; - for (const condition of conditions) { - const { result: result2, toAssign } = evaluateCondition(condition, { - ...options, - referenceRecord: { - ...options.referenceRecord, - ...conditionsReferenceRecord - } - }); - if (!result2) { - return { result: result2 }; - } - if (toAssign) { - conditionsReferenceRecord[toAssign.name] = toAssign.value; - options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); - } - } - return { result: true, referenceRecord: conditionsReferenceRecord }; - }; - var getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ - ...acc, - [headerKey]: headerVal.map((headerValEntry) => { - const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options); - if (typeof processedExpr !== "string") { - throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); - } - return processedExpr; - }) - }), {}); - var getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ - ...acc, - [propertyKey]: group$1.getEndpointProperty(propertyVal, options) - }), {}); - var getEndpointProperty = (property2, options) => { - if (Array.isArray(property2)) { - return property2.map((propertyEntry) => getEndpointProperty(propertyEntry, options)); - } - switch (typeof property2) { - case "string": - return evaluateTemplate(property2, options); - case "object": - if (property2 === null) { - throw new EndpointError(`Unexpected endpoint property: ${property2}`); - } - return group$1.getEndpointProperties(property2, options); - case "boolean": - return property2; - default: - throw new EndpointError(`Unexpected endpoint property type: ${typeof property2}`); - } - }; - var group$1 = { - getEndpointProperty, - getEndpointProperties - }; - var getEndpointUrl = (endpointUrl, options) => { - const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); - if (typeof expression === "string") { - try { - return new URL(expression); - } catch (error41) { - console.error(`Failed to construct URL with ${expression}`, error41); - throw error41; - } - } - throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); - }; - var evaluateEndpointRule = (endpointRule, options) => { - const { conditions, endpoint } = endpointRule; - const { result: result2, referenceRecord } = evaluateConditions(conditions, options); - if (!result2) { - return; - } - const endpointRuleOptions = { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord } - }; - const { url: url3, properties, headers } = endpoint; - options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); - return { - ...headers != null && { - headers: getEndpointHeaders(headers, endpointRuleOptions) - }, - ...properties != null && { - properties: getEndpointProperties(properties, endpointRuleOptions) - }, - url: getEndpointUrl(url3, endpointRuleOptions) - }; - }; - var evaluateErrorRule = (errorRule, options) => { - const { conditions, error: error41 } = errorRule; - const { result: result2, referenceRecord } = evaluateConditions(conditions, options); - if (!result2) { - return; - } - throw new EndpointError(evaluateExpression(error41, "Error", { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord } - })); - }; - var evaluateRules = (rules, options) => { - for (const rule of rules) { - if (rule.type === "endpoint") { - const endpointOrUndefined = evaluateEndpointRule(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } - } else if (rule.type === "error") { - evaluateErrorRule(rule, options); - } else if (rule.type === "tree") { - const endpointOrUndefined = group.evaluateTreeRule(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } - } else { - throw new EndpointError(`Unknown endpoint rule: ${rule}`); - } - } - throw new EndpointError(`Rules evaluation failed`); - }; - var evaluateTreeRule = (treeRule, options) => { - const { conditions, rules } = treeRule; - const { result: result2, referenceRecord } = evaluateConditions(conditions, options); - if (!result2) { - return; - } - return group.evaluateRules(rules, { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord } - }); - }; - var group = { - evaluateRules, - evaluateTreeRule - }; - var resolveEndpoint = (ruleSetObject, options) => { - const { endpointParams, logger } = options; - const { parameters, rules } = ruleSetObject; - options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); - const paramsWithDefault = Object.entries(parameters).filter(([, v]) => v.default != null).map(([k, v]) => [k, v.default]); - if (paramsWithDefault.length > 0) { - for (const [paramKey, paramDefaultValue] of paramsWithDefault) { - endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue; - } - } - const requiredParams = Object.entries(parameters).filter(([, v]) => v.required).map(([k]) => k); - for (const requiredParam of requiredParams) { - if (endpointParams[requiredParam] == null) { - throw new EndpointError(`Missing required parameter: '${requiredParam}'`); - } - } - const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} }); - options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); - return endpoint; - }; - exports.EndpointCache = EndpointCache; - exports.EndpointError = EndpointError; - exports.customEndpointFunctions = customEndpointFunctions; - exports.isIpAddress = isIpAddress; - exports.isValidHostLabel = isValidHostLabel; - exports.resolveEndpoint = resolveEndpoint; -}); - -// ../node_modules/@smithy/querystring-parser/dist-cjs/index.js -var require_dist_cjs73 = __commonJS((exports) => { - function parseQueryString(querystring) { - const query = {}; - querystring = querystring.replace(/^\?/, ""); - if (querystring) { - for (const pair of querystring.split("&")) { - let [key, value = null] = pair.split("="); - key = decodeURIComponent(key); - if (value) { - value = decodeURIComponent(value); - } - if (!(key in query)) { - query[key] = value; - } else if (Array.isArray(query[key])) { - query[key].push(value); - } else { - query[key] = [query[key], value]; - } - } - } - return query; - } - exports.parseQueryString = parseQueryString; -}); - -// ../node_modules/@smithy/url-parser/dist-cjs/index.js -var require_dist_cjs74 = __commonJS((exports) => { - var querystringParser = require_dist_cjs73(); - var parseUrl2 = (url3) => { - if (typeof url3 === "string") { - return parseUrl2(new URL(url3)); - } - const { hostname: hostname2, pathname, port, protocol, search } = url3; - let query; - if (search) { - query = querystringParser.parseQueryString(search); - } - return { - hostname: hostname2, - port: port ? parseInt(port) : undefined, - protocol, - path: pathname, - query - }; - }; - exports.parseUrl = parseUrl2; -}); - -// ../node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js -var require_dist_cjs75 = __commonJS((exports) => { - var utilEndpoints = require_dist_cjs72(); - var urlParser = require_dist_cjs74(); - var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { - if (allowSubDomains) { - for (const label of value.split(".")) { - if (!isVirtualHostableS3Bucket(label)) { - return false; - } - } - return true; - } - if (!utilEndpoints.isValidHostLabel(value)) { - return false; - } - if (value.length < 3 || value.length > 63) { - return false; - } - if (value !== value.toLowerCase()) { - return false; - } - if (utilEndpoints.isIpAddress(value)) { - return false; - } - return true; - }; - var ARN_DELIMITER = ":"; - var RESOURCE_DELIMITER = "/"; - var parseArn = (value) => { - const segments = value.split(ARN_DELIMITER); - if (segments.length < 6) - return null; - const [arn, partition4, service, region, accountId, ...resourcePath] = segments; - if (arn !== "arn" || partition4 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") - return null; - const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); - return { - partition: partition4, - service, - region, - accountId, - resourceId - }; - }; - var partitions = [ - { - id: "aws", - outputs: { - dnsSuffix: "amazonaws.com", - dualStackDnsSuffix: "api.aws", - implicitGlobalRegion: "us-east-1", - name: "aws", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", - regions: { - "af-south-1": { - description: "Africa (Cape Town)" - }, - "ap-east-1": { - description: "Asia Pacific (Hong Kong)" - }, - "ap-east-2": { - description: "Asia Pacific (Taipei)" - }, - "ap-northeast-1": { - description: "Asia Pacific (Tokyo)" - }, - "ap-northeast-2": { - description: "Asia Pacific (Seoul)" - }, - "ap-northeast-3": { - description: "Asia Pacific (Osaka)" - }, - "ap-south-1": { - description: "Asia Pacific (Mumbai)" - }, - "ap-south-2": { - description: "Asia Pacific (Hyderabad)" - }, - "ap-southeast-1": { - description: "Asia Pacific (Singapore)" - }, - "ap-southeast-2": { - description: "Asia Pacific (Sydney)" - }, - "ap-southeast-3": { - description: "Asia Pacific (Jakarta)" - }, - "ap-southeast-4": { - description: "Asia Pacific (Melbourne)" - }, - "ap-southeast-5": { - description: "Asia Pacific (Malaysia)" - }, - "ap-southeast-6": { - description: "Asia Pacific (New Zealand)" - }, - "ap-southeast-7": { - description: "Asia Pacific (Thailand)" - }, - "aws-global": { - description: "aws global region" - }, - "ca-central-1": { - description: "Canada (Central)" - }, - "ca-west-1": { - description: "Canada West (Calgary)" - }, - "eu-central-1": { - description: "Europe (Frankfurt)" - }, - "eu-central-2": { - description: "Europe (Zurich)" - }, - "eu-north-1": { - description: "Europe (Stockholm)" - }, - "eu-south-1": { - description: "Europe (Milan)" - }, - "eu-south-2": { - description: "Europe (Spain)" - }, - "eu-west-1": { - description: "Europe (Ireland)" - }, - "eu-west-2": { - description: "Europe (London)" - }, - "eu-west-3": { - description: "Europe (Paris)" - }, - "il-central-1": { - description: "Israel (Tel Aviv)" - }, - "me-central-1": { - description: "Middle East (UAE)" - }, - "me-south-1": { - description: "Middle East (Bahrain)" - }, - "mx-central-1": { - description: "Mexico (Central)" - }, - "sa-east-1": { - description: "South America (Sao Paulo)" - }, - "us-east-1": { - description: "US East (N. Virginia)" - }, - "us-east-2": { - description: "US East (Ohio)" - }, - "us-west-1": { - description: "US West (N. California)" - }, - "us-west-2": { - description: "US West (Oregon)" - } - } - }, - { - id: "aws-cn", - outputs: { - dnsSuffix: "amazonaws.com.cn", - dualStackDnsSuffix: "api.amazonwebservices.com.cn", - implicitGlobalRegion: "cn-northwest-1", - name: "aws-cn", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^cn\\-\\w+\\-\\d+$", - regions: { - "aws-cn-global": { - description: "aws-cn global region" - }, - "cn-north-1": { - description: "China (Beijing)" - }, - "cn-northwest-1": { - description: "China (Ningxia)" - } - } - }, - { - id: "aws-eusc", - outputs: { - dnsSuffix: "amazonaws.eu", - dualStackDnsSuffix: "api.amazonwebservices.eu", - implicitGlobalRegion: "eusc-de-east-1", - name: "aws-eusc", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", - regions: { - "eusc-de-east-1": { - description: "EU (Germany)" - } - } - }, - { - id: "aws-iso", - outputs: { - dnsSuffix: "c2s.ic.gov", - dualStackDnsSuffix: "api.aws.ic.gov", - implicitGlobalRegion: "us-iso-east-1", - name: "aws-iso", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", - regions: { - "aws-iso-global": { - description: "aws-iso global region" - }, - "us-iso-east-1": { - description: "US ISO East" - }, - "us-iso-west-1": { - description: "US ISO WEST" - } - } - }, - { - id: "aws-iso-b", - outputs: { - dnsSuffix: "sc2s.sgov.gov", - dualStackDnsSuffix: "api.aws.scloud", - implicitGlobalRegion: "us-isob-east-1", - name: "aws-iso-b", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", - regions: { - "aws-iso-b-global": { - description: "aws-iso-b global region" - }, - "us-isob-east-1": { - description: "US ISOB East (Ohio)" - }, - "us-isob-west-1": { - description: "US ISOB West" - } - } - }, - { - id: "aws-iso-e", - outputs: { - dnsSuffix: "cloud.adc-e.uk", - dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", - implicitGlobalRegion: "eu-isoe-west-1", - name: "aws-iso-e", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", - regions: { - "aws-iso-e-global": { - description: "aws-iso-e global region" - }, - "eu-isoe-west-1": { - description: "EU ISOE West" - } - } - }, - { - id: "aws-iso-f", - outputs: { - dnsSuffix: "csp.hci.ic.gov", - dualStackDnsSuffix: "api.aws.hci.ic.gov", - implicitGlobalRegion: "us-isof-south-1", - name: "aws-iso-f", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", - regions: { - "aws-iso-f-global": { - description: "aws-iso-f global region" - }, - "us-isof-east-1": { - description: "US ISOF EAST" - }, - "us-isof-south-1": { - description: "US ISOF SOUTH" - } - } - }, - { - id: "aws-us-gov", - outputs: { - dnsSuffix: "amazonaws.com", - dualStackDnsSuffix: "api.aws", - implicitGlobalRegion: "us-gov-west-1", - name: "aws-us-gov", - supportsDualStack: true, - supportsFIPS: true - }, - regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", - regions: { - "aws-us-gov-global": { - description: "aws-us-gov global region" - }, - "us-gov-east-1": { - description: "AWS GovCloud (US-East)" - }, - "us-gov-west-1": { - description: "AWS GovCloud (US-West)" - } - } - } - ]; - var version2 = "1.1"; - var partitionsInfo = { - partitions, - version: version2 - }; - var selectedPartitionsInfo = partitionsInfo; - var selectedUserAgentPrefix = ""; - var partition3 = (value) => { - const { partitions: partitions2 } = selectedPartitionsInfo; - for (const partition4 of partitions2) { - const { regions, outputs } = partition4; - for (const [region, regionData] of Object.entries(regions)) { - if (region === value) { - return { - ...outputs, - ...regionData - }; - } - } - } - for (const partition4 of partitions2) { - const { regionRegex, outputs } = partition4; - if (new RegExp(regionRegex).test(value)) { - return { - ...outputs - }; - } - } - const DEFAULT_PARTITION = partitions2.find((partition4) => partition4.id === "aws"); - if (!DEFAULT_PARTITION) { - throw new Error("Provided region was not found in the partition array or regex," + " and default partition with id 'aws' doesn't exist."); - } - return { - ...DEFAULT_PARTITION.outputs - }; - }; - var setPartitionInfo = (partitionsInfo2, userAgentPrefix = "") => { - selectedPartitionsInfo = partitionsInfo2; - selectedUserAgentPrefix = userAgentPrefix; - }; - var useDefaultPartitionInfo = () => { - setPartitionInfo(partitionsInfo, ""); - }; - var getUserAgentPrefix = () => selectedUserAgentPrefix; - var awsEndpointFunctions = { - isVirtualHostableS3Bucket, - parseArn, - partition: partition3 - }; - utilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions; - var resolveDefaultAwsRegionalEndpointsConfig = (input) => { - if (typeof input.endpointProvider !== "function") { - throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client."); - } - const { endpoint } = input; - if (endpoint === undefined) { - input.endpoint = async () => { - return toEndpointV1(input.endpointProvider({ - Region: typeof input.region === "function" ? await input.region() : input.region, - UseDualStack: typeof input.useDualstackEndpoint === "function" ? await input.useDualstackEndpoint() : input.useDualstackEndpoint, - UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint, - Endpoint: undefined - }, { logger: input.logger })); - }; - } - return input; - }; - var toEndpointV1 = (endpoint) => urlParser.parseUrl(endpoint.url); - Object.defineProperty(exports, "EndpointError", { - enumerable: true, - get: function() { - return utilEndpoints.EndpointError; - } - }); - Object.defineProperty(exports, "isIpAddress", { - enumerable: true, - get: function() { - return utilEndpoints.isIpAddress; - } - }); - Object.defineProperty(exports, "resolveEndpoint", { - enumerable: true, - get: function() { - return utilEndpoints.resolveEndpoint; - } - }); - exports.awsEndpointFunctions = awsEndpointFunctions; - exports.getUserAgentPrefix = getUserAgentPrefix; - exports.partition = partition3; - exports.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig; - exports.setPartitionInfo = setPartitionInfo; - exports.toEndpointV1 = toEndpointV1; - exports.useDefaultPartitionInfo = useDefaultPartitionInfo; -}); - -// ../node_modules/@smithy/property-provider/dist-cjs/index.js -var require_dist_cjs76 = __commonJS((exports) => { - class ProviderError extends Error { - name = "ProviderError"; - tryNextLink; - constructor(message, options = true) { - let logger; - let tryNextLink = true; - if (typeof options === "boolean") { - logger = undefined; - tryNextLink = options; - } else if (options != null && typeof options === "object") { - logger = options.logger; - tryNextLink = options.tryNextLink ?? true; - } - super(message); - this.tryNextLink = tryNextLink; - Object.setPrototypeOf(this, ProviderError.prototype); - logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); - } - static from(error41, options = true) { - return Object.assign(new this(error41.message, options), error41); - } - } - - class CredentialsProviderError extends ProviderError { - name = "CredentialsProviderError"; - constructor(message, options = true) { - super(message, options); - Object.setPrototypeOf(this, CredentialsProviderError.prototype); - } - } - - class TokenProviderError extends ProviderError { - name = "TokenProviderError"; - constructor(message, options = true) { - super(message, options); - Object.setPrototypeOf(this, TokenProviderError.prototype); - } - } - var chain2 = (...providers) => async () => { - if (providers.length === 0) { - throw new ProviderError("No providers in chain"); - } - let lastProviderError; - for (const provider of providers) { - try { - const credentials = await provider(); - return credentials; - } catch (err) { - lastProviderError = err; - if (err?.tryNextLink) { - continue; - } - throw err; - } - } - throw lastProviderError; - }; - var fromStatic = (staticValue) => () => Promise.resolve(staticValue); - var 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 = undefined; - } - return resolved; - }; - if (isExpired === undefined) { - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(); - } - return resolved; - }; - } - return async (options) => { - if (!hasResult || options?.forceRefresh) { - resolved = await coalesceProvider(); - } - if (isConstant) { - return resolved; - } - if (requiresRefresh && !requiresRefresh(resolved)) { - isConstant = true; - return resolved; - } - if (isExpired(resolved)) { - await coalesceProvider(); - return resolved; - } - return resolved; - }; - }; - exports.CredentialsProviderError = CredentialsProviderError; - exports.ProviderError = ProviderError; - exports.TokenProviderError = TokenProviderError; - exports.chain = chain2; - exports.fromStatic = fromStatic; - exports.memoize = memoize2; -}); - -// ../node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js -var require_client3 = __commonJS((exports) => { - var state = { - warningEmitted: false - }; - var emitWarningIfUnsupportedVersion = (version2) => { - if (version2 && !state.warningEmitted && parseInt(version2.substring(1, version2.indexOf("."))) < 18) { - state.warningEmitted = true; - process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will -no longer support Node.js 16.x on January 6, 2025. - -To continue receiving updates to AWS services, bug fixes, and security -updates please upgrade to a supported Node.js LTS version. - -More information can be found at: https://a.co/74kJMmI`); - } - }; - function setCredentialFeature(credentials, feature2, value) { - if (!credentials.$source) { - credentials.$source = {}; - } - credentials.$source[feature2] = value; - return credentials; - } - function setFeature(context, feature2, value) { - if (!context.__aws_sdk_context) { - context.__aws_sdk_context = { - features: {} - }; - } else if (!context.__aws_sdk_context.features) { - context.__aws_sdk_context.features = {}; - } - context.__aws_sdk_context.features[feature2] = value; - } - function setTokenFeature(token, feature2, value) { - if (!token.$source) { - token.$source = {}; - } - token.$source[feature2] = value; - return token; - } - exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; - exports.setCredentialFeature = setCredentialFeature; - exports.setFeature = setFeature; - exports.setTokenFeature = setTokenFeature; - exports.state = state; -}); - -// ../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js -var require_dist_cjs77 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - fromHex: () => fromHex, - toHex: () => toHex - }); - module.exports = __toCommonJS2(src_exports); - var SHORT_TO_HEX = {}; - var HEX_TO_SHORT = {}; - for (let i2 = 0;i2 < 256; i2++) { - let encodedByte = i2.toString(16).toLowerCase(); - if (encodedByte.length === 1) { - encodedByte = `0${encodedByte}`; - } - SHORT_TO_HEX[i2] = encodedByte; - HEX_TO_SHORT[encodedByte] = i2; - } - 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 i2 = 0;i2 < encoded.length; i2 += 2) { - const encodedByte = encoded.slice(i2, i2 + 2).toLowerCase(); - if (encodedByte in HEX_TO_SHORT) { - out[i2 / 2] = HEX_TO_SHORT[encodedByte]; - } else { - throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); - } - } - return out; - } - __name(fromHex, "fromHex"); - function toHex(bytes) { - let out = ""; - for (let i2 = 0;i2 < bytes.byteLength; i2++) { - out += SHORT_TO_HEX[bytes[i2]]; - } - return out; - } - __name(toHex, "toHex"); -}); - -// ../node_modules/@smithy/signature-v4/dist-cjs/index.js -var require_dist_cjs78 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - SignatureV4: () => SignatureV4, - clearCredentialCache: () => clearCredentialCache, - createScope: () => createScope, - getCanonicalHeaders: () => getCanonicalHeaders, - getCanonicalQuery: () => getCanonicalQuery, - getPayloadHash: () => getPayloadHash, - getSigningKey: () => getSigningKey, - moveHeadersToQuery: () => moveHeadersToQuery, - prepareRequest: () => prepareRequest - }); - module.exports = __toCommonJS2(src_exports); - var import_util_middleware = require_dist_cjs60(); - var import_util_utf84 = require_dist_cjs64(); - var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; - var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; - var AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; - var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; - var EXPIRES_QUERY_PARAM = "X-Amz-Expires"; - var SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; - var TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; - var AUTH_HEADER = "authorization"; - var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); - var DATE_HEADER = "date"; - var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; - var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); - var SHA256_HEADER = "x-amz-content-sha256"; - var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); - var ALWAYS_UNSIGNABLE_HEADERS = { - authorization: true, - "cache-control": true, - connection: true, - expect: true, - from: true, - "keep-alive": true, - "max-forwards": true, - pragma: true, - referer: true, - te: true, - trailer: true, - "transfer-encoding": true, - upgrade: true, - "user-agent": true, - "x-amzn-trace-id": true - }; - var PROXY_HEADER_PATTERN = /^proxy-/; - var SEC_HEADER_PATTERN = /^sec-/; - var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; - var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; - var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; - var MAX_CACHE_SIZE = 50; - var KEY_TYPE_IDENTIFIER = "aws4_request"; - var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; - var import_util_hex_encoding = require_dist_cjs77(); - var import_util_utf8 = require_dist_cjs64(); - var signingKeyCache = {}; - var cacheQueue = []; - var createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope"); - var getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => { - const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); - const cacheKey = `${shortDate}:${region}:${service}:${(0, import_util_hex_encoding.toHex)(credsHash)}:${credentials.sessionToken}`; - if (cacheKey in signingKeyCache) { - return signingKeyCache[cacheKey]; - } - cacheQueue.push(cacheKey); - while (cacheQueue.length > MAX_CACHE_SIZE) { - delete signingKeyCache[cacheQueue.shift()]; - } - let key = `AWS4${credentials.secretAccessKey}`; - for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { - key = await hmac(sha256Constructor, key, signable); - } - return signingKeyCache[cacheKey] = key; - }, "getSigningKey"); - var clearCredentialCache = /* @__PURE__ */ __name(() => { - cacheQueue.length = 0; - Object.keys(signingKeyCache).forEach((cacheKey) => { - delete signingKeyCache[cacheKey]; - }); - }, "clearCredentialCache"); - var hmac = /* @__PURE__ */ __name((ctor, secret, data) => { - const hash2 = new ctor(secret); - hash2.update((0, import_util_utf8.toUint8Array)(data)); - return hash2.digest(); - }, "hmac"); - var getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => { - const canonical = {}; - for (const headerName of Object.keys(headers).sort()) { - if (headers[headerName] == undefined) { - continue; - } - const canonicalHeaderName = headerName.toLowerCase(); - if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || (unsignableHeaders == null ? undefined : unsignableHeaders.has(canonicalHeaderName)) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) { - if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) { - continue; - } - } - canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); - } - return canonical; - }, "getCanonicalHeaders"); - var import_util_uri_escape = require_dist_cjs66(); - var getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => { - const keys2 = []; - const serialized = {}; - for (const key of Object.keys(query).sort()) { - if (key.toLowerCase() === SIGNATURE_HEADER) { - continue; - } - keys2.push(key); - const value = query[key]; - if (typeof value === "string") { - serialized[key] = `${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value)}`; - } else if (Array.isArray(value)) { - serialized[key] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value2)}`]), []).sort().join("&"); - } - } - return keys2.map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); - }, "getCanonicalQuery"); - var import_is_array_buffer = require_dist_cjs62(); - var import_util_utf82 = require_dist_cjs64(); - var getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => { - for (const headerName of Object.keys(headers)) { - if (headerName.toLowerCase() === SHA256_HEADER) { - return headers[headerName]; - } - } - if (body == undefined) { - return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; - } else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, import_is_array_buffer.isArrayBuffer)(body)) { - const hashCtor = new hashConstructor; - hashCtor.update((0, import_util_utf82.toUint8Array)(body)); - return (0, import_util_hex_encoding.toHex)(await hashCtor.digest()); - } - return UNSIGNED_PAYLOAD; - }, "getPayloadHash"); - var import_util_utf83 = require_dist_cjs64(); - var _HeaderFormatter = class _HeaderFormatter2 { - format(headers) { - const chunks = []; - for (const headerName of Object.keys(headers)) { - const bytes = (0, import_util_utf83.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 chunk2 of chunks) { - out.set(chunk2, position); - position += chunk2.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 = (0, import_util_utf83.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((0, import_util_hex_encoding.fromHex)(header.value.replace(/\-/g, "")), 1); - return uuidBytes; - } - } - }; - __name(_HeaderFormatter, "HeaderFormatter"); - var HeaderFormatter = _HeaderFormatter; - var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; - var _Int64 = class _Int642 { - constructor(bytes) { - this.bytes = bytes; - if (bytes.byteLength !== 8) { - throw new Error("Int64 buffers must be exactly 8 bytes"); - } - } - static fromNumber(number4) { - if (number4 > 9223372036854776000 || number4 < -9223372036854776000) { - throw new Error(`${number4} is too large (or, if negative, too small) to represent as an Int64`); - } - const bytes = new Uint8Array(8); - for (let i2 = 7, remaining = Math.abs(Math.round(number4));i2 > -1 && remaining > 0; i2--, remaining /= 256) { - bytes[i2] = remaining; - } - if (number4 < 0) { - negate2(bytes); - } - return new _Int642(bytes); - } - valueOf() { - const bytes = this.bytes.slice(0); - const negative = bytes[0] & 128; - if (negative) { - negate2(bytes); - } - return parseInt((0, import_util_hex_encoding.toHex)(bytes), 16) * (negative ? -1 : 1); - } - toString() { - return String(this.valueOf()); - } - }; - __name(_Int64, "Int64"); - var Int64 = _Int64; - function negate2(bytes) { - for (let i2 = 0;i2 < 8; i2++) { - bytes[i2] ^= 255; - } - for (let i2 = 7;i2 > -1; i2--) { - bytes[i2]++; - if (bytes[i2] !== 0) - break; - } - } - __name(negate2, "negate"); - var hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return true; - } - } - return false; - }, "hasHeader"); - var cloneRequest = /* @__PURE__ */ __name(({ headers, query, ...rest2 }) => ({ - ...rest2, - headers: { ...headers }, - query: query ? cloneQuery(query) : undefined - }), "cloneRequest"); - var cloneQuery = /* @__PURE__ */ __name((query) => Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param - }; - }, {}), "cloneQuery"); - var moveHeadersToQuery = /* @__PURE__ */ __name((request, options = {}) => { - var _a2; - const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : cloneRequest(request); - for (const name of Object.keys(headers)) { - const lname = name.toLowerCase(); - if (lname.slice(0, 6) === "x-amz-" && !((_a2 = options.unhoistableHeaders) == null ? undefined : _a2.has(lname))) { - query[name] = headers[name]; - delete headers[name]; - } - } - return { - ...request, - headers, - query - }; - }, "moveHeadersToQuery"); - var prepareRequest = /* @__PURE__ */ __name((request) => { - request = typeof request.clone === "function" ? request.clone() : cloneRequest(request); - for (const headerName of Object.keys(request.headers)) { - if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { - delete request.headers[headerName]; - } - } - return request; - }, "prepareRequest"); - var iso8601 = /* @__PURE__ */ __name((time3) => toDate(time3).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601"); - var toDate = /* @__PURE__ */ __name((time3) => { - if (typeof time3 === "number") { - return new Date(time3 * 1000); - } - if (typeof time3 === "string") { - if (Number(time3)) { - return new Date(Number(time3) * 1000); - } - return new Date(time3); - } - return time3; - }, "toDate"); - var _SignatureV4 = class _SignatureV42 { - constructor({ - applyChecksum, - credentials, - region, - service, - sha256, - uriEscapePath = true - }) { - this.headerFormatter = new HeaderFormatter; - this.service = service; - this.sha256 = sha256; - this.uriEscapePath = uriEscapePath; - this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; - this.regionProvider = (0, import_util_middleware.normalizeProvider)(region); - this.credentialProvider = (0, import_util_middleware.normalizeProvider)(credentials); - } - async presign(originalRequest, options = {}) { - const { - signingDate = /* @__PURE__ */ new Date, - expiresIn = 3600, - unsignableHeaders, - unhoistableHeaders, - signableHeaders, - signingRegion, - signingService - } = options; - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? await this.regionProvider(); - const { longDate, shortDate } = formatDate(signingDate); - if (expiresIn > MAX_PRESIGNED_TTL) { - return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future"); - } - const scope = createScope(shortDate, region, signingService ?? this.service); - const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders }); - if (credentials.sessionToken) { - request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; - } - request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; - request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; - request.query[AMZ_DATE_QUERY_PARAM] = longDate; - request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); - const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); - request.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); - request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); - return request; - } - async sign(toSign, options) { - if (typeof toSign === "string") { - return this.signString(toSign, options); - } else if (toSign.headers && toSign.payload) { - return this.signEvent(toSign, options); - } else if (toSign.message) { - return this.signMessage(toSign, options); - } else { - return this.signRequest(toSign, options); - } - } - async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date, priorSignature, signingRegion, signingService }) { - const region = signingRegion ?? await this.regionProvider(); - const { shortDate, longDate } = formatDate(signingDate); - const scope = createScope(shortDate, region, signingService ?? this.service); - const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256); - const hash2 = new this.sha256; - hash2.update(headers); - const hashedHeaders = (0, import_util_hex_encoding.toHex)(await hash2.digest()); - const stringToSign = [ - EVENT_ALGORITHM_IDENTIFIER, - longDate, - scope, - priorSignature, - hashedHeaders, - hashedPayload - ].join(` -`); - return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); - } - async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date, signingRegion, signingService }) { - const promise2 = this.signEvent({ - headers: this.headerFormatter.format(signableMessage.message.headers), - payload: signableMessage.message.body - }, { - signingDate, - signingRegion, - signingService, - priorSignature: signableMessage.priorSignature - }); - return promise2.then((signature) => { - return { message: signableMessage.message, signature }; - }); - } - async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date, signingRegion, signingService } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? await this.regionProvider(); - const { shortDate } = formatDate(signingDate); - const hash2 = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); - hash2.update((0, import_util_utf84.toUint8Array)(stringToSign)); - return (0, import_util_hex_encoding.toHex)(await hash2.digest()); - } - async signRequest(requestToSign, { - signingDate = /* @__PURE__ */ new Date, - signableHeaders, - unsignableHeaders, - signingRegion, - signingService - } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion ?? await this.regionProvider(); - const request = prepareRequest(requestToSign); - const { longDate, shortDate } = formatDate(signingDate); - const scope = createScope(shortDate, region, signingService ?? this.service); - request.headers[AMZ_DATE_HEADER] = longDate; - if (credentials.sessionToken) { - request.headers[TOKEN_HEADER] = credentials.sessionToken; - } - const payloadHash = await getPayloadHash(request, this.sha256); - if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) { - request.headers[SHA256_HEADER] = payloadHash; - } - const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); - const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); - request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; - return request; - } - createCanonicalRequest(request, canonicalHeaders, payloadHash) { - const sortedHeaders = Object.keys(canonicalHeaders).sort(); - return `${request.method} -${this.getCanonicalPath(request)} -${getCanonicalQuery(request)} -${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join(` -`)} - -${sortedHeaders.join(";")} -${payloadHash}`; - } - async createStringToSign(longDate, credentialScope, canonicalRequest) { - const hash2 = new this.sha256; - hash2.update((0, import_util_utf84.toUint8Array)(canonicalRequest)); - const hashedRequest = await hash2.digest(); - return `${ALGORITHM_IDENTIFIER} -${longDate} -${credentialScope} -${(0, import_util_hex_encoding.toHex)(hashedRequest)}`; - } - getCanonicalPath({ path: path9 }) { - if (this.uriEscapePath) { - const normalizedPathSegments = []; - for (const pathSegment of path9.split("/")) { - if ((pathSegment == null ? undefined : pathSegment.length) === 0) - continue; - if (pathSegment === ".") - continue; - if (pathSegment === "..") { - normalizedPathSegments.pop(); - } else { - normalizedPathSegments.push(pathSegment); - } - } - const normalizedPath = `${(path9 == null ? undefined : path9.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path9 == null ? undefined : path9.endsWith("/")) ? "/" : ""}`; - const doubleEncoded = (0, import_util_uri_escape.escapeUri)(normalizedPath); - return doubleEncoded.replace(/%2F/g, "/"); - } - return path9; - } - async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { - const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); - const hash2 = new this.sha256(await keyPromise); - hash2.update((0, import_util_utf84.toUint8Array)(stringToSign)); - return (0, import_util_hex_encoding.toHex)(await hash2.digest()); - } - getSigningKey(credentials, region, shortDate, service) { - return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); - } - validateResolvedCredentials(credentials) { - if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") { - throw new Error("Resolved credential object is not valid"); - } - } - }; - __name(_SignatureV4, "SignatureV4"); - var SignatureV4 = _SignatureV4; - var formatDate = /* @__PURE__ */ __name((now2) => { - const longDate = iso8601(now2).replace(/[\-:]/g, ""); - return { - longDate, - shortDate: longDate.slice(0, 8) - }; - }, "formatDate"); - var getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(headers).sort().join(";"), "getCanonicalHeaderList"); -}); - -// ../node_modules/@smithy/util-body-length-browser/dist-cjs/index.js -var require_dist_cjs79 = __commonJS((exports) => { - var TEXT_ENCODER = typeof TextEncoder == "function" ? new TextEncoder : null; - var calculateBodyLength = (body) => { - if (typeof body === "string") { - if (TEXT_ENCODER) { - return TEXT_ENCODER.encode(body).byteLength; - } - let len = body.length; - for (let i2 = len - 1;i2 >= 0; i2--) { - const code = body.charCodeAt(i2); - if (code > 127 && code <= 2047) - len++; - else if (code > 2047 && code <= 65535) - len += 2; - if (code >= 56320 && code <= 57343) - i2--; - } - return len; - } else if (typeof body.byteLength === "number") { - return body.byteLength; - } else if (typeof body.size === "number") { - return body.size; - } - throw new Error(`Body Length computation failed for ${body}`); - }; - exports.calculateBodyLength = calculateBodyLength; -}); - -// ../node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js -var require_cbor2 = __commonJS((exports) => { - var serde = require_serde2(); - var utilUtf8 = require_dist_cjs64(); - var protocols = require_protocols3(); - var protocolHttp = require_dist_cjs56(); - var utilBodyLengthBrowser = require_dist_cjs79(); - var schema = require_schema2(); - var utilMiddleware = require_dist_cjs60(); - var utilBase64 = require_dist_cjs65(); - var majorUint64 = 0; - var majorNegativeInt64 = 1; - var majorUnstructuredByteString = 2; - var majorUtf8String = 3; - var majorList = 4; - var majorMap = 5; - var majorTag = 6; - var majorSpecial = 7; - var specialFalse = 20; - var specialTrue = 21; - var specialNull = 22; - var specialUndefined = 23; - var extendedOneByte = 24; - var extendedFloat16 = 25; - var extendedFloat32 = 26; - var extendedFloat64 = 27; - var minorIndefinite = 31; - function alloc(size2) { - return typeof Buffer !== "undefined" ? Buffer.alloc(size2) : new Uint8Array(size2); - } - var tagSymbol = Symbol("@smithy/core/cbor::tagSymbol"); - function tag(data2) { - data2[tagSymbol] = true; - return data2; - } - var USE_TEXT_DECODER = typeof TextDecoder !== "undefined"; - var USE_BUFFER$1 = typeof Buffer !== "undefined"; - var payload = alloc(0); - var dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); - var textDecoder2 = USE_TEXT_DECODER ? new TextDecoder : null; - var _offset = 0; - function setPayload(bytes) { - payload = bytes; - dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); - } - function decode(at2, to) { - if (at2 >= to) { - throw new Error("unexpected end of (decode) payload."); - } - const major = (payload[at2] & 224) >> 5; - const minor = payload[at2] & 31; - switch (major) { - case majorUint64: - case majorNegativeInt64: - case majorTag: - let unsignedInt; - let offset; - if (minor < 24) { - unsignedInt = minor; - offset = 1; - } else { - switch (minor) { - case extendedOneByte: - case extendedFloat16: - case extendedFloat32: - case extendedFloat64: - const countLength = minorValueToArgumentLength[minor]; - const countOffset = countLength + 1; - offset = countOffset; - if (to - at2 < countOffset) { - throw new Error(`countLength ${countLength} greater than remaining buf len.`); - } - const countIndex = at2 + 1; - if (countLength === 1) { - unsignedInt = payload[countIndex]; - } else if (countLength === 2) { - unsignedInt = dataView$1.getUint16(countIndex); - } else if (countLength === 4) { - unsignedInt = dataView$1.getUint32(countIndex); - } else { - unsignedInt = dataView$1.getBigUint64(countIndex); - } - break; - default: - throw new Error(`unexpected minor value ${minor}.`); - } - } - if (major === majorUint64) { - _offset = offset; - return castBigInt(unsignedInt); - } else if (major === majorNegativeInt64) { - let negativeInt; - if (typeof unsignedInt === "bigint") { - negativeInt = BigInt(-1) - unsignedInt; - } else { - negativeInt = -1 - unsignedInt; - } - _offset = offset; - return castBigInt(negativeInt); - } else { - if (minor === 2 || minor === 3) { - const length = decodeCount(at2 + offset, to); - let b = BigInt(0); - const start = at2 + offset + _offset; - for (let i2 = start;i2 < start + length; ++i2) { - b = b << BigInt(8) | BigInt(payload[i2]); - } - _offset = offset + _offset + length; - return minor === 3 ? -b - BigInt(1) : b; - } else if (minor === 4) { - const decimalFraction = decode(at2 + offset, to); - const [exponent, mantissa] = decimalFraction; - const normalizer = mantissa < 0 ? -1 : 1; - const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa)); - let numericString; - const sign = mantissa < 0 ? "-" : ""; - numericString = exponent === 0 ? mantissaStr : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent); - numericString = numericString.replace(/^0+/g, ""); - if (numericString === "") { - numericString = "0"; - } - if (numericString[0] === ".") { - numericString = "0" + numericString; - } - numericString = sign + numericString; - _offset = offset + _offset; - return serde.nv(numericString); - } else { - const value = decode(at2 + offset, to); - const valueOffset = _offset; - _offset = offset + valueOffset; - return tag({ tag: castBigInt(unsignedInt), value }); - } - } - case majorUtf8String: - case majorMap: - case majorList: - case majorUnstructuredByteString: - if (minor === minorIndefinite) { - switch (major) { - case majorUtf8String: - return decodeUtf8StringIndefinite(at2, to); - case majorMap: - return decodeMapIndefinite(at2, to); - case majorList: - return decodeListIndefinite(at2, to); - case majorUnstructuredByteString: - return decodeUnstructuredByteStringIndefinite(at2, to); - } - } else { - switch (major) { - case majorUtf8String: - return decodeUtf8String(at2, to); - case majorMap: - return decodeMap(at2, to); - case majorList: - return decodeList(at2, to); - case majorUnstructuredByteString: - return decodeUnstructuredByteString(at2, to); - } - } - default: - return decodeSpecial(at2, to); - } - } - function bytesToUtf8(bytes, at2, to) { - if (USE_BUFFER$1 && bytes.constructor?.name === "Buffer") { - return bytes.toString("utf-8", at2, to); - } - if (textDecoder2) { - return textDecoder2.decode(bytes.subarray(at2, to)); - } - return utilUtf8.toUtf8(bytes.subarray(at2, to)); - } - function demote(bigInteger) { - const num = Number(bigInteger); - if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) { - console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`)); - } - return num; - } - var minorValueToArgumentLength = { - [extendedOneByte]: 1, - [extendedFloat16]: 2, - [extendedFloat32]: 4, - [extendedFloat64]: 8 - }; - function bytesToFloat16(a2, b) { - const sign = a2 >> 7; - const exponent = (a2 & 124) >> 2; - const fraction = (a2 & 3) << 8 | b; - const scalar = sign === 0 ? 1 : -1; - let exponentComponent; - let summation; - if (exponent === 0) { - if (fraction === 0) { - return 0; - } else { - exponentComponent = Math.pow(2, 1 - 15); - summation = 0; - } - } else if (exponent === 31) { - if (fraction === 0) { - return scalar * Infinity; - } else { - return NaN; - } - } else { - exponentComponent = Math.pow(2, exponent - 15); - summation = 1; - } - summation += fraction / 1024; - return scalar * (exponentComponent * summation); - } - function decodeCount(at2, to) { - const minor = payload[at2] & 31; - if (minor < 24) { - _offset = 1; - return minor; - } - if (minor === extendedOneByte || minor === extendedFloat16 || minor === extendedFloat32 || minor === extendedFloat64) { - const countLength = minorValueToArgumentLength[minor]; - _offset = countLength + 1; - if (to - at2 < _offset) { - throw new Error(`countLength ${countLength} greater than remaining buf len.`); - } - const countIndex = at2 + 1; - if (countLength === 1) { - return payload[countIndex]; - } else if (countLength === 2) { - return dataView$1.getUint16(countIndex); - } else if (countLength === 4) { - return dataView$1.getUint32(countIndex); - } - return demote(dataView$1.getBigUint64(countIndex)); - } - throw new Error(`unexpected minor value ${minor}.`); - } - function decodeUtf8String(at2, to) { - const length = decodeCount(at2, to); - const offset = _offset; - at2 += offset; - if (to - at2 < length) { - throw new Error(`string len ${length} greater than remaining buf len.`); - } - const value = bytesToUtf8(payload, at2, at2 + length); - _offset = offset + length; - return value; - } - function decodeUtf8StringIndefinite(at2, to) { - at2 += 1; - const vector = []; - for (const base2 = at2;at2 < to; ) { - if (payload[at2] === 255) { - const data2 = alloc(vector.length); - data2.set(vector, 0); - _offset = at2 - base2 + 2; - return bytesToUtf8(data2, 0, data2.length); - } - const major = (payload[at2] & 224) >> 5; - const minor = payload[at2] & 31; - if (major !== majorUtf8String) { - throw new Error(`unexpected major type ${major} in indefinite string.`); - } - if (minor === minorIndefinite) { - throw new Error("nested indefinite string."); - } - const bytes = decodeUnstructuredByteString(at2, to); - const length = _offset; - at2 += length; - for (let i2 = 0;i2 < bytes.length; ++i2) { - vector.push(bytes[i2]); - } - } - throw new Error("expected break marker."); - } - function decodeUnstructuredByteString(at2, to) { - const length = decodeCount(at2, to); - const offset = _offset; - at2 += offset; - if (to - at2 < length) { - throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`); - } - const value = payload.subarray(at2, at2 + length); - _offset = offset + length; - return value; - } - function decodeUnstructuredByteStringIndefinite(at2, to) { - at2 += 1; - const vector = []; - for (const base2 = at2;at2 < to; ) { - if (payload[at2] === 255) { - const data2 = alloc(vector.length); - data2.set(vector, 0); - _offset = at2 - base2 + 2; - return data2; - } - const major = (payload[at2] & 224) >> 5; - const minor = payload[at2] & 31; - if (major !== majorUnstructuredByteString) { - throw new Error(`unexpected major type ${major} in indefinite string.`); - } - if (minor === minorIndefinite) { - throw new Error("nested indefinite string."); - } - const bytes = decodeUnstructuredByteString(at2, to); - const length = _offset; - at2 += length; - for (let i2 = 0;i2 < bytes.length; ++i2) { - vector.push(bytes[i2]); - } - } - throw new Error("expected break marker."); - } - function decodeList(at2, to) { - const listDataLength = decodeCount(at2, to); - const offset = _offset; - at2 += offset; - const base2 = at2; - const list = Array(listDataLength); - for (let i2 = 0;i2 < listDataLength; ++i2) { - const item = decode(at2, to); - const itemOffset = _offset; - list[i2] = item; - at2 += itemOffset; - } - _offset = offset + (at2 - base2); - return list; - } - function decodeListIndefinite(at2, to) { - at2 += 1; - const list = []; - for (const base2 = at2;at2 < to; ) { - if (payload[at2] === 255) { - _offset = at2 - base2 + 2; - return list; - } - const item = decode(at2, to); - const n2 = _offset; - at2 += n2; - list.push(item); - } - throw new Error("expected break marker."); - } - function decodeMap(at2, to) { - const mapDataLength = decodeCount(at2, to); - const offset = _offset; - at2 += offset; - const base2 = at2; - const map3 = {}; - for (let i2 = 0;i2 < mapDataLength; ++i2) { - if (at2 >= to) { - throw new Error("unexpected end of map payload."); - } - const major = (payload[at2] & 224) >> 5; - if (major !== majorUtf8String) { - throw new Error(`unexpected major type ${major} for map key at index ${at2}.`); - } - const key = decode(at2, to); - at2 += _offset; - const value = decode(at2, to); - at2 += _offset; - map3[key] = value; - } - _offset = offset + (at2 - base2); - return map3; - } - function decodeMapIndefinite(at2, to) { - at2 += 1; - const base2 = at2; - const map3 = {}; - for (;at2 < to; ) { - if (at2 >= to) { - throw new Error("unexpected end of map payload."); - } - if (payload[at2] === 255) { - _offset = at2 - base2 + 2; - return map3; - } - const major = (payload[at2] & 224) >> 5; - if (major !== majorUtf8String) { - throw new Error(`unexpected major type ${major} for map key.`); - } - const key = decode(at2, to); - at2 += _offset; - const value = decode(at2, to); - at2 += _offset; - map3[key] = value; - } - throw new Error("expected break marker."); - } - function decodeSpecial(at2, to) { - const minor = payload[at2] & 31; - switch (minor) { - case specialTrue: - case specialFalse: - _offset = 1; - return minor === specialTrue; - case specialNull: - _offset = 1; - return null; - case specialUndefined: - _offset = 1; - return null; - case extendedFloat16: - if (to - at2 < 3) { - throw new Error("incomplete float16 at end of buf."); - } - _offset = 3; - return bytesToFloat16(payload[at2 + 1], payload[at2 + 2]); - case extendedFloat32: - if (to - at2 < 5) { - throw new Error("incomplete float32 at end of buf."); - } - _offset = 5; - return dataView$1.getFloat32(at2 + 1); - case extendedFloat64: - if (to - at2 < 9) { - throw new Error("incomplete float64 at end of buf."); - } - _offset = 9; - return dataView$1.getFloat64(at2 + 1); - default: - throw new Error(`unexpected minor value ${minor}.`); - } - } - function castBigInt(bigInt) { - if (typeof bigInt === "number") { - return bigInt; - } - const num = Number(bigInt); - if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) { - return num; - } - return bigInt; - } - var USE_BUFFER = typeof Buffer !== "undefined"; - var initialSize = 2048; - var data = alloc(initialSize); - var dataView = new DataView(data.buffer, data.byteOffset, data.byteLength); - var cursor = 0; - function ensureSpace(bytes) { - const remaining = data.byteLength - cursor; - if (remaining < bytes) { - if (cursor < 16000000) { - resize(Math.max(data.byteLength * 4, data.byteLength + bytes)); - } else { - resize(data.byteLength + bytes + 16000000); - } - } - } - function toUint8Array() { - const out = alloc(cursor); - out.set(data.subarray(0, cursor), 0); - cursor = 0; - return out; - } - function resize(size2) { - const old = data; - data = alloc(size2); - if (old) { - if (old.copy) { - old.copy(data, 0, 0, old.byteLength); - } else { - data.set(old, 0); - } - } - dataView = new DataView(data.buffer, data.byteOffset, data.byteLength); - } - function encodeHeader(major, value) { - if (value < 24) { - data[cursor++] = major << 5 | value; - } else if (value < 1 << 8) { - data[cursor++] = major << 5 | 24; - data[cursor++] = value; - } else if (value < 1 << 16) { - data[cursor++] = major << 5 | extendedFloat16; - dataView.setUint16(cursor, value); - cursor += 2; - } else if (value < 2 ** 32) { - data[cursor++] = major << 5 | extendedFloat32; - dataView.setUint32(cursor, value); - cursor += 4; - } else { - data[cursor++] = major << 5 | extendedFloat64; - dataView.setBigUint64(cursor, typeof value === "bigint" ? value : BigInt(value)); - cursor += 8; - } - } - function encode3(_input) { - const encodeStack = [_input]; - while (encodeStack.length) { - const input = encodeStack.pop(); - ensureSpace(typeof input === "string" ? input.length * 4 : 64); - if (typeof input === "string") { - if (USE_BUFFER) { - encodeHeader(majorUtf8String, Buffer.byteLength(input)); - cursor += data.write(input, cursor); - } else { - const bytes = utilUtf8.fromUtf8(input); - encodeHeader(majorUtf8String, bytes.byteLength); - data.set(bytes, cursor); - cursor += bytes.byteLength; - } - continue; - } else if (typeof input === "number") { - if (Number.isInteger(input)) { - const nonNegative = input >= 0; - const major = nonNegative ? majorUint64 : majorNegativeInt64; - const value = nonNegative ? input : -input - 1; - if (value < 24) { - data[cursor++] = major << 5 | value; - } else if (value < 256) { - data[cursor++] = major << 5 | 24; - data[cursor++] = value; - } else if (value < 65536) { - data[cursor++] = major << 5 | extendedFloat16; - data[cursor++] = value >> 8; - data[cursor++] = value; - } else if (value < 4294967296) { - data[cursor++] = major << 5 | extendedFloat32; - dataView.setUint32(cursor, value); - cursor += 4; - } else { - data[cursor++] = major << 5 | extendedFloat64; - dataView.setBigUint64(cursor, BigInt(value)); - cursor += 8; - } - continue; - } - data[cursor++] = majorSpecial << 5 | extendedFloat64; - dataView.setFloat64(cursor, input); - cursor += 8; - continue; - } else if (typeof input === "bigint") { - const nonNegative = input >= 0; - const major = nonNegative ? majorUint64 : majorNegativeInt64; - const value = nonNegative ? input : -input - BigInt(1); - const n2 = Number(value); - if (n2 < 24) { - data[cursor++] = major << 5 | n2; - } else if (n2 < 256) { - data[cursor++] = major << 5 | 24; - data[cursor++] = n2; - } else if (n2 < 65536) { - data[cursor++] = major << 5 | extendedFloat16; - data[cursor++] = n2 >> 8; - data[cursor++] = n2 & 255; - } else if (n2 < 4294967296) { - data[cursor++] = major << 5 | extendedFloat32; - dataView.setUint32(cursor, n2); - cursor += 4; - } else if (value < BigInt("18446744073709551616")) { - data[cursor++] = major << 5 | extendedFloat64; - dataView.setBigUint64(cursor, value); - cursor += 8; - } else { - const binaryBigInt = value.toString(2); - const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8)); - let b = value; - let i2 = 0; - while (bigIntBytes.byteLength - ++i2 >= 0) { - bigIntBytes[bigIntBytes.byteLength - i2] = Number(b & BigInt(255)); - b >>= BigInt(8); - } - ensureSpace(bigIntBytes.byteLength * 2); - data[cursor++] = nonNegative ? 194 : 195; - if (USE_BUFFER) { - encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes)); - } else { - encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength); - } - data.set(bigIntBytes, cursor); - cursor += bigIntBytes.byteLength; - } - continue; - } else if (input === null) { - data[cursor++] = majorSpecial << 5 | specialNull; - continue; - } else if (typeof input === "boolean") { - data[cursor++] = majorSpecial << 5 | (input ? specialTrue : specialFalse); - continue; - } else if (typeof input === "undefined") { - throw new Error("@smithy/core/cbor: client may not serialize undefined value."); - } else if (Array.isArray(input)) { - for (let i2 = input.length - 1;i2 >= 0; --i2) { - encodeStack.push(input[i2]); - } - encodeHeader(majorList, input.length); - continue; - } else if (typeof input.byteLength === "number") { - ensureSpace(input.length * 2); - encodeHeader(majorUnstructuredByteString, input.length); - data.set(input, cursor); - cursor += input.byteLength; - continue; - } else if (typeof input === "object") { - if (input instanceof serde.NumericValue) { - const decimalIndex = input.string.indexOf("."); - const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1; - const mantissa = BigInt(input.string.replace(".", "")); - data[cursor++] = 196; - encodeStack.push(mantissa); - encodeStack.push(exponent); - encodeHeader(majorList, 2); - continue; - } - if (input[tagSymbol]) { - if ("tag" in input && "value" in input) { - encodeStack.push(input.value); - encodeHeader(majorTag, input.tag); - continue; - } else { - throw new Error("tag encountered with missing fields, need 'tag' and 'value', found: " + JSON.stringify(input)); - } - } - const keys2 = Object.keys(input); - for (let i2 = keys2.length - 1;i2 >= 0; --i2) { - const key = keys2[i2]; - encodeStack.push(input[key]); - encodeStack.push(key); - } - encodeHeader(majorMap, keys2.length); - continue; - } - throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`); - } - } - var cbor = { - deserialize(payload2) { - setPayload(payload2); - return decode(0, payload2.length); - }, - serialize(input) { - try { - encode3(input); - return toUint8Array(); - } catch (e) { - toUint8Array(); - throw e; - } - }, - resizeEncodingBuffer(size2) { - resize(size2); - } - }; - var parseCborBody = (streamBody, context) => { - return protocols.collectBody(streamBody, context).then(async (bytes) => { - if (bytes.length) { - try { - return cbor.deserialize(bytes); - } catch (e) { - Object.defineProperty(e, "$responseBodyText", { - value: context.utf8Encoder(bytes) - }); - throw e; - } - } - return {}; - }); - }; - var dateToTag = (date5) => { - return tag({ - tag: 1, - value: date5.getTime() / 1000 - }); - }; - var parseCborErrorBody = async (errorBody, context) => { - const value = await parseCborBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; - }; - var loadSmithyRpcV2CborErrorCode = (output, data2) => { - 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]; - } - return cleanValue; - }; - if (data2["__type"] !== undefined) { - return sanitizeErrorCode(data2["__type"]); - } - const codeKey = Object.keys(data2).find((key) => key.toLowerCase() === "code"); - if (codeKey && data2[codeKey] !== undefined) { - return sanitizeErrorCode(data2[codeKey]); - } - }; - var checkCborResponse = (response) => { - if (String(response.headers["smithy-protocol"]).toLowerCase() !== "rpc-v2-cbor") { - throw new Error("Malformed RPCv2 CBOR response, status: " + response.statusCode); - } - }; - var buildHttpRpcRequest = async (context, headers, path9, resolvedHostname, body) => { - const { hostname: hostname2, protocol = "https", port, path: basePath } = await context.endpoint(); - const contents = { - protocol, - hostname: hostname2, - port, - method: "POST", - path: basePath.endsWith("/") ? basePath.slice(0, -1) + path9 : basePath + path9, - headers: { - ...headers - } - }; - if (resolvedHostname !== undefined) { - contents.hostname = resolvedHostname; - } - if (body !== undefined) { - contents.body = body; - try { - contents.headers["content-length"] = String(utilBodyLengthBrowser.calculateBodyLength(body)); - } catch (e) {} - } - return new protocolHttp.HttpRequest(contents); - }; - - class CborCodec extends protocols.SerdeContext { - createSerializer() { - const serializer = new CborShapeSerializer; - serializer.setSerdeContext(this.serdeContext); - return serializer; - } - createDeserializer() { - const deserializer = new CborShapeDeserializer; - deserializer.setSerdeContext(this.serdeContext); - return deserializer; - } - } - - class CborShapeSerializer extends protocols.SerdeContext { - value; - write(schema2, value) { - this.value = this.serialize(schema2, value); - } - serialize(schema$1, source) { - const ns = schema.NormalizedSchema.of(schema$1); - if (source == null) { - if (ns.isIdempotencyToken()) { - return serde.generateIdempotencyToken(); - } - return source; - } - if (ns.isBlobSchema()) { - if (typeof source === "string") { - return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(source); - } - return source; - } - if (ns.isTimestampSchema()) { - if (typeof source === "number" || typeof source === "bigint") { - return dateToTag(new Date(Number(source) / 1000 | 0)); - } - return dateToTag(source); - } - if (typeof source === "function" || typeof source === "object") { - const sourceObject = source; - if (ns.isListSchema() && Array.isArray(sourceObject)) { - const sparse = !!ns.getMergedTraits().sparse; - const newArray = []; - let i2 = 0; - for (const item of sourceObject) { - const value = this.serialize(ns.getValueSchema(), item); - if (value != null || sparse) { - newArray[i2++] = value; - } - } - return newArray; - } - if (sourceObject instanceof Date) { - return dateToTag(sourceObject); - } - const newObject = {}; - if (ns.isMapSchema()) { - const sparse = !!ns.getMergedTraits().sparse; - for (const key of Object.keys(sourceObject)) { - const value = this.serialize(ns.getValueSchema(), sourceObject[key]); - if (value != null || sparse) { - newObject[key] = value; - } - } - } else if (ns.isStructSchema()) { - for (const [key, memberSchema] of ns.structIterator()) { - const value = this.serialize(memberSchema, sourceObject[key]); - if (value != null) { - newObject[key] = value; - } - } - } else if (ns.isDocumentSchema()) { - for (const key of Object.keys(sourceObject)) { - newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]); - } - } - return newObject; - } - return source; - } - flush() { - const buffer = cbor.serialize(this.value); - this.value = undefined; - return buffer; - } - } - - class CborShapeDeserializer extends protocols.SerdeContext { - read(schema2, bytes) { - const data2 = cbor.deserialize(bytes); - return this.readValue(schema2, data2); - } - readValue(_schema, value) { - const ns = schema.NormalizedSchema.of(_schema); - if (ns.isTimestampSchema() && typeof value === "number") { - return serde._parseEpochTimestamp(value); - } - if (ns.isBlobSchema()) { - if (typeof value === "string") { - return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value); - } - return value; - } - if (typeof value === "undefined" || typeof value === "boolean" || typeof value === "number" || typeof value === "string" || typeof value === "bigint" || typeof value === "symbol") { - return value; - } else if (typeof value === "function" || typeof value === "object") { - if (value === null) { - return null; - } - if ("byteLength" in value) { - return value; - } - if (value instanceof Date) { - return value; - } - if (ns.isDocumentSchema()) { - return value; - } - if (ns.isListSchema()) { - const newArray = []; - const memberSchema = ns.getValueSchema(); - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - const itemValue = this.readValue(memberSchema, item); - if (itemValue != null || sparse) { - newArray.push(itemValue); - } - } - return newArray; - } - const newObject = {}; - if (ns.isMapSchema()) { - const sparse = !!ns.getMergedTraits().sparse; - const targetSchema = ns.getValueSchema(); - for (const key of Object.keys(value)) { - const itemValue = this.readValue(targetSchema, value[key]); - if (itemValue != null || sparse) { - newObject[key] = itemValue; - } - } - } else if (ns.isStructSchema()) { - for (const [key, memberSchema] of ns.structIterator()) { - const v = this.readValue(memberSchema, value[key]); - if (v != null) { - newObject[key] = v; - } - } - } - return newObject; - } else { - return value; - } - } - } - - class SmithyRpcV2CborProtocol extends protocols.RpcProtocol { - codec = new CborCodec; - serializer = this.codec.createSerializer(); - deserializer = this.codec.createDeserializer(); - constructor({ defaultNamespace }) { - super({ defaultNamespace }); - } - getShapeId() { - return "smithy.protocols#rpcv2Cbor"; - } - getPayloadCodec() { - return this.codec; - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - Object.assign(request.headers, { - "content-type": this.getDefaultContentType(), - "smithy-protocol": "rpc-v2-cbor", - accept: this.getDefaultContentType() - }); - if (schema.deref(operationSchema.input) === "unit") { - delete request.body; - delete request.headers["content-type"]; - } else { - if (!request.body) { - this.serializer.write(15, {}); - request.body = this.serializer.flush(); - } - try { - request.headers["content-length"] = String(request.body.byteLength); - } catch (e) {} - } - const { service, operation } = utilMiddleware.getSmithyContext(context); - const path9 = `/service/${service}/operation/${operation}`; - if (request.path.endsWith("/")) { - request.path += path9.slice(1); - } else { - request.path += path9; - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - return super.deserializeResponse(operationSchema, context, response); - } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; - let namespace = this.options.defaultNamespace; - if (errorName.includes("#")) { - [namespace] = errorName.split("#"); - } - const errorMetadata = { - $metadata: metadata, - $fault: response.statusCode <= 500 ? "client" : "server" - }; - const registry2 = schema.TypeRegistry.for(namespace); - let errorSchema; - try { - errorSchema = registry2.getSchema(errorName); - } catch (e) { - if (dataObject.Message) { - dataObject.message = dataObject.Message; - } - const synthetic = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); - const baseExceptionSchema = synthetic.getBaseException(); - if (baseExceptionSchema) { - const ErrorCtor2 = synthetic.getErrorCtor(baseExceptionSchema); - throw Object.assign(new ErrorCtor2({ name: errorName }), errorMetadata, dataObject); - } - throw Object.assign(new Error(errorName), errorMetadata, dataObject); - } - const ns = schema.NormalizedSchema.of(errorSchema); - const ErrorCtor = registry2.getErrorCtor(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const exception = new ErrorCtor(message); - const output = {}; - for (const [name, member] of ns.structIterator()) { - output[name] = this.deserializer.readValue(member, dataObject[name]); - } - throw Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output); - } - getDefaultContentType() { - return "application/cbor"; - } - } - exports.CborCodec = CborCodec; - exports.CborShapeDeserializer = CborShapeDeserializer; - exports.CborShapeSerializer = CborShapeSerializer; - exports.SmithyRpcV2CborProtocol = SmithyRpcV2CborProtocol; - exports.buildHttpRpcRequest = buildHttpRpcRequest; - exports.cbor = cbor; - exports.checkCborResponse = checkCborResponse; - exports.dateToTag = dateToTag; - exports.loadSmithyRpcV2CborErrorCode = loadSmithyRpcV2CborErrorCode; - exports.parseCborBody = parseCborBody; - exports.parseCborErrorBody = parseCborErrorBody; - exports.tag = tag; - exports.tagSymbol = tagSymbol; -}); - -// ../node_modules/@smithy/middleware-stack/dist-cjs/index.js -var require_dist_cjs80 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - constructStack: () => constructStack - }); - module.exports = __toCommonJS2(src_exports); - var getAllAliases = /* @__PURE__ */ __name((name, aliases) => { - const _aliases = []; - if (name) { - _aliases.push(name); - } - if (aliases) { - for (const alias of aliases) { - _aliases.push(alias); - } - } - return _aliases; - }, "getAllAliases"); - var getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name, aliases) => { - return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; - }, "getMiddlewareNameWithAliases"); - var constructStack = /* @__PURE__ */ __name(() => { - let absoluteEntries = []; - let relativeEntries = []; - let identifyOnResolve = false; - const entriesNameSet = /* @__PURE__ */ new Set; - const sort = /* @__PURE__ */ __name((entries) => entries.sort((a2, b) => stepWeights[b.step] - stepWeights[a2.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a2.priority || "normal"]), "sort"); - const removeByName = /* @__PURE__ */ __name((toRemove) => { - let isRemoved = false; - const filterCb = /* @__PURE__ */ __name((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; - }, "filterCb"); - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, "removeByName"); - const removeByReference = /* @__PURE__ */ __name((toRemove) => { - let isRemoved = false; - const filterCb = /* @__PURE__ */ __name((entry) => { - if (entry.middleware === toRemove) { - isRemoved = true; - for (const alias of getAllAliases(entry.name, entry.aliases)) { - entriesNameSet.delete(alias); - } - return false; - } - return true; - }, "filterCb"); - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, "removeByReference"); - const cloneTo = /* @__PURE__ */ __name((toStack) => { - var _a2; - absoluteEntries.forEach((entry) => { - toStack.add(entry.middleware, { ...entry }); - }); - relativeEntries.forEach((entry) => { - toStack.addRelativeTo(entry.middleware, { ...entry }); - }); - (_a2 = toStack.identifyOnResolve) == null || _a2.call(toStack, stack.identifyOnResolve()); - return toStack; - }, "cloneTo"); - const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => { - const expandedMiddlewareList = []; - from.before.forEach((entry) => { - if (entry.before.length === 0 && entry.after.length === 0) { - expandedMiddlewareList.push(entry); - } else { - expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); - } - }); - expandedMiddlewareList.push(from); - from.after.reverse().forEach((entry) => { - if (entry.before.length === 0 && entry.after.length === 0) { - expandedMiddlewareList.push(entry); - } else { - expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); - } - }); - return expandedMiddlewareList; - }, "expandRelativeMiddlewareList"); - const getMiddlewareList = /* @__PURE__ */ __name((debug = false) => { - const normalizedAbsoluteEntries = []; - const normalizedRelativeEntries = []; - const normalizedEntriesNameMap = {}; - absoluteEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [] - }; - for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { - normalizedEntriesNameMap[alias] = normalizedEntry; - } - normalizedAbsoluteEntries.push(normalizedEntry); - }); - relativeEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [] - }; - for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { - normalizedEntriesNameMap[alias] = normalizedEntry; - } - normalizedRelativeEntries.push(normalizedEntry); - }); - normalizedRelativeEntries.forEach((entry) => { - if (entry.toMiddleware) { - const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; - if (toMiddleware === undefined) { - if (debug) { - return; - } - throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`); - } - if (entry.relation === "after") { - toMiddleware.after.push(entry); - } - if (entry.relation === "before") { - toMiddleware.before.push(entry); - } - } - }); - const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => { - wholeList.push(...expandedMiddlewareList); - return wholeList; - }, []); - return mainChain; - }, "getMiddlewareList"); - const stack = { - add: (middleware, 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) => { - var _a2; - return entry2.name === alias || ((_a2 = entry2.aliases) == null ? undefined : _a2.some((a2) => a2 === 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) => { - var _a2; - return entry2.name === alias || ((_a2 = entry2.aliases) == null ? undefined : _a2.some((a2) => a2 === 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 = /* @__PURE__ */ __name((entry) => { - const { tags, name, aliases: _aliases } = entry; - if (tags && tags.includes(toRemove)) { - const aliases = getAllAliases(name, _aliases); - for (const alias of aliases) { - entriesNameSet.delete(alias); - } - isRemoved = true; - return false; - } - return true; - }, "filterCb"); - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, - concat: (from) => { - var _a2; - const cloned = cloneTo(constructStack()); - cloned.use(from); - cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (((_a2 = from.identifyOnResolve) == null ? undefined : _a2.call(from)) ?? false)); - return cloned; - }, - applyToStack: cloneTo, - identify: () => { - return getMiddlewareList(true).map((mw) => { - const step = mw.step ?? mw.relation + " " + mw.toMiddleware; - return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; - }); - }, - identifyOnResolve(toggle) { - if (typeof toggle === "boolean") - identifyOnResolve = toggle; - return identifyOnResolve; - }, - resolve: (handler, context) => { - for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) { - handler = middleware(handler, context); - } - if (identifyOnResolve) { - console.log(stack.identify()); - } - return handler; - } - }; - return stack; - }, "constructStack"); - var stepWeights = { - initialize: 5, - serialize: 4, - build: 3, - finalizeRequest: 2, - deserialize: 1 - }; - var priorityWeights = { - high: 3, - normal: 2, - low: 1 - }; -}); - -// ../node_modules/@smithy/smithy-client/dist-cjs/index.js -var require_dist_cjs81 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - Client: () => Client, - Command: () => Command, - LazyJsonString: () => LazyJsonString, - NoOpLogger: () => NoOpLogger, - SENSITIVE_STRING: () => SENSITIVE_STRING, - ServiceException: () => ServiceException, - StringWrapper: () => StringWrapper, - _json: () => _json, - collectBody: () => collectBody, - convertMap: () => convertMap, - createAggregatedClient: () => createAggregatedClient, - dateToUtcString: () => dateToUtcString, - decorateServiceException: () => decorateServiceException, - emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion, - expectBoolean: () => expectBoolean, - expectByte: () => expectByte, - expectFloat32: () => expectFloat32, - expectInt: () => expectInt, - expectInt32: () => expectInt32, - expectLong: () => expectLong, - expectNonNull: () => expectNonNull, - expectNumber: () => expectNumber, - expectObject: () => expectObject, - expectShort: () => expectShort, - expectString: () => expectString, - expectUnion: () => expectUnion, - extendedEncodeURIComponent: () => extendedEncodeURIComponent, - getArrayIfSingleItem: () => getArrayIfSingleItem, - getDefaultClientConfiguration: () => getDefaultClientConfiguration, - getDefaultExtensionConfiguration: () => getDefaultExtensionConfiguration, - getValueFromTextNode: () => getValueFromTextNode, - handleFloat: () => handleFloat, - limitedParseDouble: () => limitedParseDouble, - limitedParseFloat: () => limitedParseFloat, - limitedParseFloat32: () => limitedParseFloat32, - loadConfigsForDefaultMode: () => loadConfigsForDefaultMode, - logger: () => logger, - map: () => map3, - parseBoolean: () => parseBoolean, - parseEpochTimestamp: () => parseEpochTimestamp, - parseRfc3339DateTime: () => parseRfc3339DateTime, - parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset, - parseRfc7231DateTime: () => parseRfc7231DateTime, - resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig, - resolvedPath: () => resolvedPath, - serializeFloat: () => serializeFloat, - splitEvery: () => splitEvery, - strictParseByte: () => strictParseByte, - strictParseDouble: () => strictParseDouble, - strictParseFloat: () => strictParseFloat, - strictParseFloat32: () => strictParseFloat32, - strictParseInt: () => strictParseInt, - strictParseInt32: () => strictParseInt32, - strictParseLong: () => strictParseLong, - strictParseShort: () => strictParseShort, - take: () => take2, - throwDefaultError: () => throwDefaultError, - withBaseException: () => withBaseException - }); - module.exports = __toCommonJS2(src_exports); - var _NoOpLogger = class _NoOpLogger2 { - trace() {} - debug() {} - info() {} - warn() {} - error() {} - }; - __name(_NoOpLogger, "NoOpLogger"); - var NoOpLogger = _NoOpLogger; - var import_middleware_stack = require_dist_cjs80(); - var _Client = class _Client2 { - constructor(config2) { - this.middlewareStack = (0, import_middleware_stack.constructStack)(); - this.config = config2; - } - send(command, optionsOrCb, cb) { - const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; - const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; - const handler = command.resolveMiddleware(this.middlewareStack, this.config, options); - if (callback) { - handler(command).then((result2) => callback(null, result2.output), (err) => callback(err)).catch(() => {}); - } else { - return handler(command).then((result2) => result2.output); - } - } - destroy() { - if (this.config.requestHandler.destroy) - this.config.requestHandler.destroy(); - } - }; - __name(_Client, "Client"); - var Client = _Client; - var import_util_stream = require_dist_cjs69(); - var collectBody = /* @__PURE__ */ __name(async (streamBody = new Uint8Array, context) => { - if (streamBody instanceof Uint8Array) { - return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody); - } - if (!streamBody) { - return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array); - } - const fromContext = context.streamCollector(streamBody); - return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext); - }, "collectBody"); - var import_types6 = require_dist_cjs55(); - var _Command = class _Command2 { - constructor() { - this.middlewareStack = (0, import_middleware_stack.constructStack)(); - } - static classBuilder() { - return new ClassBuilder; - } - resolveMiddlewareWithContext(clientStack, configuration, options, { - middlewareFn, - clientName, - commandName, - inputFilterSensitiveLog, - outputFilterSensitiveLog, - smithyContext, - additionalContext, - CommandCtor - }) { - for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { - this.middlewareStack.use(mw); - } - const stack = clientStack.concat(this.middlewareStack); - const { logger: logger2 } = configuration; - const handlerExecutionContext = { - logger: logger2, - clientName, - commandName, - inputFilterSensitiveLog, - outputFilterSensitiveLog, - [import_types6.SMITHY_CONTEXT_KEY]: { - ...smithyContext - }, - ...additionalContext - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - }; - __name(_Command, "Command"); - var Command = _Command; - var _ClassBuilder = class _ClassBuilder2 { - constructor() { - this._init = () => {}; - this._ep = {}; - this._middlewareFn = () => []; - this._commandName = ""; - this._clientName = ""; - this._additionalContext = {}; - this._smithyContext = {}; - this._inputFilterSensitiveLog = (_) => _; - this._outputFilterSensitiveLog = (_) => _; - this._serializer = null; - this._deserializer = null; - } - init(cb) { - this._init = cb; - } - ep(endpointParameterInstructions) { - this._ep = endpointParameterInstructions; - return this; - } - m(middlewareSupplier) { - this._middlewareFn = middlewareSupplier; - return this; - } - s(service, operation, smithyContext = {}) { - this._smithyContext = { - service, - operation, - ...smithyContext - }; - return this; - } - c(additionalContext = {}) { - this._additionalContext = additionalContext; - return this; - } - n(clientName, commandName) { - this._clientName = clientName; - this._commandName = commandName; - return this; - } - f(inputFilter = (_) => _, outputFilter = (_) => _) { - this._inputFilterSensitiveLog = inputFilter; - this._outputFilterSensitiveLog = outputFilter; - return this; - } - ser(serializer) { - this._serializer = serializer; - return this; - } - de(deserializer) { - this._deserializer = deserializer; - return this; - } - build() { - var _a2; - const closure = this; - let CommandRef; - return CommandRef = (_a2 = class extends Command { - constructor(...[input]) { - super(); - this.serialize = closure._serializer; - this.deserialize = closure._deserializer; - this.input = input ?? {}; - closure._init(this); - } - static getEndpointParameterInstructions() { - return closure._ep; - } - resolveMiddleware(stack, configuration, options) { - return this.resolveMiddlewareWithContext(stack, configuration, options, { - CommandCtor: CommandRef, - middlewareFn: closure._middlewareFn, - clientName: closure._clientName, - commandName: closure._commandName, - inputFilterSensitiveLog: closure._inputFilterSensitiveLog, - outputFilterSensitiveLog: closure._outputFilterSensitiveLog, - smithyContext: closure._smithyContext, - additionalContext: closure._additionalContext - }); - } - }, __name(_a2, "CommandRef"), _a2); - } - }; - __name(_ClassBuilder, "ClassBuilder"); - var ClassBuilder = _ClassBuilder; - var SENSITIVE_STRING = "***SensitiveInformation***"; - var createAggregatedClient = /* @__PURE__ */ __name((commands, Client2) => { - for (const command of Object.keys(commands)) { - const CommandCtor = commands[command]; - const methodImpl = /* @__PURE__ */ __name(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); - } - }, "methodImpl"); - const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); - Client2.prototype[methodName] = methodImpl; - } - }, "createAggregatedClient"); - var parseBoolean = /* @__PURE__ */ __name((value) => { - switch (value) { - case "true": - return true; - case "false": - return false; - default: - throw new Error(`Unable to parse boolean value "${value}"`); - } - }, "parseBoolean"); - var expectBoolean = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value === "number") { - if (value === 0 || value === 1) { - logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (value === 0) { - return false; - } - if (value === 1) { - return true; - } - } - if (typeof value === "string") { - const lower = value.toLowerCase(); - if (lower === "false" || lower === "true") { - logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (lower === "false") { - return false; - } - if (lower === "true") { - return true; - } - } - if (typeof value === "boolean") { - return value; - } - throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); - }, "expectBoolean"); - var expectNumber = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value === "string") { - const parsed = parseFloat(value); - if (!Number.isNaN(parsed)) { - if (String(parsed) !== String(value)) { - logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); - } - return parsed; - } - } - if (typeof value === "number") { - return value; - } - throw new TypeError(`Expected number, got ${typeof value}: ${value}`); - }, "expectNumber"); - var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); - var expectFloat32 = /* @__PURE__ */ __name((value) => { - const expected = expectNumber(value); - if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { - if (Math.abs(expected) > MAX_FLOAT) { - throw new TypeError(`Expected 32-bit float, got ${value}`); - } - } - return expected; - }, "expectFloat32"); - var expectLong = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - if (Number.isInteger(value) && !Number.isNaN(value)) { - return value; - } - throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); - }, "expectLong"); - var expectInt = expectLong; - var expectInt32 = /* @__PURE__ */ __name((value) => expectSizedInt(value, 32), "expectInt32"); - var expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), "expectShort"); - var expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), "expectByte"); - var expectSizedInt = /* @__PURE__ */ __name((value, size2) => { - const expected = expectLong(value); - if (expected !== undefined && castInt(expected, size2) !== expected) { - throw new TypeError(`Expected ${size2}-bit integer, got ${value}`); - } - return expected; - }, "expectSizedInt"); - var castInt = /* @__PURE__ */ __name((value, size2) => { - switch (size2) { - case 32: - return Int32Array.of(value)[0]; - case 16: - return Int16Array.of(value)[0]; - case 8: - return Int8Array.of(value)[0]; - } - }, "castInt"); - var expectNonNull = /* @__PURE__ */ __name((value, location) => { - if (value === null || value === undefined) { - if (location) { - throw new TypeError(`Expected a non-null value for ${location}`); - } - throw new TypeError("Expected a non-null value"); - } - return value; - }, "expectNonNull"); - var expectObject = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value === "object" && !Array.isArray(value)) { - return value; - } - const receivedType = Array.isArray(value) ? "array" : typeof value; - throw new TypeError(`Expected object, got ${receivedType}: ${value}`); - }, "expectObject"); - var expectString = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value === "string") { - return value; - } - if (["boolean", "number", "bigint"].includes(typeof value)) { - logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); - return String(value); - } - throw new TypeError(`Expected string, got ${typeof value}: ${value}`); - }, "expectString"); - var expectUnion = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - const asObject = expectObject(value); - const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k); - if (setKeys.length === 0) { - throw new TypeError(`Unions must have exactly one non-null member. None were found.`); - } - if (setKeys.length > 1) { - throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); - } - return asObject; - }, "expectUnion"); - var strictParseDouble = /* @__PURE__ */ __name((value) => { - if (typeof value == "string") { - return expectNumber(parseNumber2(value)); - } - return expectNumber(value); - }, "strictParseDouble"); - var strictParseFloat = strictParseDouble; - var strictParseFloat32 = /* @__PURE__ */ __name((value) => { - if (typeof value == "string") { - return expectFloat32(parseNumber2(value)); - } - return expectFloat32(value); - }, "strictParseFloat32"); - var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; - var parseNumber2 = /* @__PURE__ */ __name((value) => { - const matches2 = value.match(NUMBER_REGEX); - if (matches2 === null || matches2[0].length !== value.length) { - throw new TypeError(`Expected real number, got implicit NaN`); - } - return parseFloat(value); - }, "parseNumber"); - var limitedParseDouble = /* @__PURE__ */ __name((value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return expectNumber(value); - }, "limitedParseDouble"); - var handleFloat = limitedParseDouble; - var limitedParseFloat = limitedParseDouble; - var limitedParseFloat32 = /* @__PURE__ */ __name((value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return expectFloat32(value); - }, "limitedParseFloat32"); - var parseFloatString = /* @__PURE__ */ __name((value) => { - switch (value) { - case "NaN": - return NaN; - case "Infinity": - return Infinity; - case "-Infinity": - return -Infinity; - default: - throw new Error(`Unable to parse float value: ${value}`); - } - }, "parseFloatString"); - var strictParseLong = /* @__PURE__ */ __name((value) => { - if (typeof value === "string") { - return expectLong(parseNumber2(value)); - } - return expectLong(value); - }, "strictParseLong"); - var strictParseInt = strictParseLong; - var strictParseInt32 = /* @__PURE__ */ __name((value) => { - if (typeof value === "string") { - return expectInt32(parseNumber2(value)); - } - return expectInt32(value); - }, "strictParseInt32"); - var strictParseShort = /* @__PURE__ */ __name((value) => { - if (typeof value === "string") { - return expectShort(parseNumber2(value)); - } - return expectShort(value); - }, "strictParseShort"); - var strictParseByte = /* @__PURE__ */ __name((value) => { - if (typeof value === "string") { - return expectByte(parseNumber2(value)); - } - return expectByte(value); - }, "strictParseByte"); - var stackTraceWarning = /* @__PURE__ */ __name((message) => { - return String(new TypeError(message).stack || message).split(` -`).slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join(` -`); - }, "stackTraceWarning"); - var logger = { - warn: console.warn - }; - var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; - var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; - function dateToUtcString(date5) { - const year = date5.getUTCFullYear(); - const month = date5.getUTCMonth(); - const dayOfWeek = date5.getUTCDay(); - const dayOfMonthInt = date5.getUTCDate(); - const hoursInt = date5.getUTCHours(); - const minutesInt = date5.getUTCMinutes(); - const secondsInt = date5.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]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; - } - __name(dateToUtcString, "dateToUtcString"); - var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); - var parseRfc3339DateTime = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; - const year = strictParseShort(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); - }, "parseRfc3339DateTime"); - var RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); - var parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339_WITH_OFFSET.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; - const year = strictParseShort(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - const date5 = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); - if (offsetStr.toUpperCase() != "Z") { - date5.setTime(date5.getTime() - parseOffsetToMilliseconds(offsetStr)); - } - return date5; - }, "parseRfc3339DateTimeWithOffset"); - var 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$/); - var 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$/); - var 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})$/); - var parseRfc7231DateTime = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - if (typeof value !== "string") { - throw new TypeError("RFC-7231 date-times must be expressed as strings"); - } - let match = IMF_FIXDATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - match = RFC_850_DATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { - hours, - minutes, - seconds, - fractionalMilliseconds - })); - } - match = ASC_TIME.exec(value); - if (match) { - const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; - return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - throw new TypeError("Invalid RFC-7231 date-time value"); - }, "parseRfc7231DateTime"); - var parseEpochTimestamp = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return; - } - let valueAsDouble; - if (typeof value === "number") { - valueAsDouble = value; - } else if (typeof value === "string") { - valueAsDouble = strictParseDouble(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 * 1000)); - }, "parseEpochTimestamp"); - var buildDate = /* @__PURE__ */ __name((year, month, day, time3) => { - const adjustedMonth = month - 1; - validateDayOfMonth(year, adjustedMonth, day); - return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time3.hours, "hour", 0, 23), parseDateValue(time3.minutes, "minute", 0, 59), parseDateValue(time3.seconds, "seconds", 0, 60), parseMilliseconds2(time3.fractionalMilliseconds))); - }, "buildDate"); - var parseTwoDigitYear = /* @__PURE__ */ __name((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; - }, "parseTwoDigitYear"); - var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000; - var adjustRfc850Year = /* @__PURE__ */ __name((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; - }, "adjustRfc850Year"); - var parseMonthByShortName = /* @__PURE__ */ __name((value) => { - const monthIdx = MONTHS.indexOf(value); - if (monthIdx < 0) { - throw new TypeError(`Invalid month: ${value}`); - } - return monthIdx + 1; - }, "parseMonthByShortName"); - var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - var validateDayOfMonth = /* @__PURE__ */ __name((year, month, day) => { - let maxDays = DAYS_IN_MONTH[month]; - if (month === 1 && isLeapYear(year)) { - maxDays = 29; - } - if (day > maxDays) { - throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); - } - }, "validateDayOfMonth"); - var isLeapYear = /* @__PURE__ */ __name((year) => { - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); - }, "isLeapYear"); - var parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => { - const dateVal = strictParseByte(stripLeadingZeroes(value)); - if (dateVal < lower || dateVal > upper) { - throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); - } - return dateVal; - }, "parseDateValue"); - var parseMilliseconds2 = /* @__PURE__ */ __name((value) => { - if (value === null || value === undefined) { - return 0; - } - return strictParseFloat32("0." + value) * 1000; - }, "parseMilliseconds"); - var parseOffsetToMilliseconds = /* @__PURE__ */ __name((value) => { - const directionStr = value[0]; - let direction = 1; - if (directionStr == "+") { - direction = 1; - } else if (directionStr == "-") { - direction = -1; - } else { - throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); - } - const hour = Number(value.substring(1, 3)); - const minute = Number(value.substring(4, 6)); - return direction * (hour * 60 + minute) * 60 * 1000; - }, "parseOffsetToMilliseconds"); - var stripLeadingZeroes = /* @__PURE__ */ __name((value) => { - let idx = 0; - while (idx < value.length - 1 && value.charAt(idx) === "0") { - idx++; - } - if (idx === 0) { - return value; - } - return value.slice(idx); - }, "stripLeadingZeroes"); - var _ServiceException = class _ServiceException2 extends Error { - constructor(options) { - super(options.message); - Object.setPrototypeOf(this, _ServiceException2.prototype); - this.name = options.name; - this.$fault = options.$fault; - this.$metadata = options.$metadata; - } - }; - __name(_ServiceException, "ServiceException"); - var ServiceException = _ServiceException; - var decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => { - Object.entries(additions).filter(([, v]) => v !== undefined).forEach(([k, v]) => { - if (exception[k] == undefined || exception[k] === "") { - exception[k] = v; - } - }); - const message = exception.message || exception.Message || "UnknownError"; - exception.message = message; - delete exception.Message; - return exception; - }, "decorateServiceException"); - var throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => { - const $metadata = deserializeMetadata(output); - const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; - const response = new exceptionCtor({ - name: (parsedBody == null ? undefined : parsedBody.code) || (parsedBody == null ? undefined : parsedBody.Code) || errorCode || statusCode || "UnknownError", - $fault: "client", - $metadata - }); - throw decorateServiceException(response, parsedBody); - }, "throwDefaultError"); - var withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => { - return ({ output, parsedBody, errorCode }) => { - throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); - }; - }, "withBaseException"); - var deserializeMetadata = /* @__PURE__ */ __name((output) => ({ - httpStatusCode: output.statusCode, - requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], - extendedRequestId: output.headers["x-amz-id-2"], - cfId: output.headers["x-amz-cf-id"] - }), "deserializeMetadata"); - var loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => { - switch (mode) { - case "standard": - return { - retryMode: "standard", - connectionTimeout: 3100 - }; - case "in-region": - return { - retryMode: "standard", - connectionTimeout: 1100 - }; - case "cross-region": - return { - retryMode: "standard", - connectionTimeout: 3100 - }; - case "mobile": - return { - retryMode: "standard", - connectionTimeout: 30000 - }; - default: - return {}; - } - }, "loadConfigsForDefaultMode"); - var warningEmitted = false; - var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version2) => { - if (version2 && !warningEmitted && parseInt(version2.substring(1, version2.indexOf("."))) < 14) { - warningEmitted = true; - } - }, "emitWarningIfUnsupportedVersion"); - var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - const checksumAlgorithms = []; - for (const id in import_types6.AlgorithmId) { - const algorithmId = import_types6.AlgorithmId[id]; - if (runtimeConfig[algorithmId] === undefined) { - continue; - } - checksumAlgorithms.push({ - algorithmId: () => algorithmId, - checksumConstructor: () => runtimeConfig[algorithmId] - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - } - }; - }, "getChecksumConfiguration"); - var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; - }, "resolveChecksumRuntimeConfig"); - var getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - let _retryStrategy = runtimeConfig.retryStrategy; - return { - setRetryStrategy(retryStrategy) { - _retryStrategy = retryStrategy; - }, - retryStrategy() { - return _retryStrategy; - } - }; - }, "getRetryConfiguration"); - var resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => { - const runtimeConfig = {}; - runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); - return runtimeConfig; - }, "resolveRetryRuntimeConfig"); - var getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { - return { - ...getChecksumConfiguration(runtimeConfig), - ...getRetryConfiguration(runtimeConfig) - }; - }, "getDefaultExtensionConfiguration"); - var getDefaultClientConfiguration = getDefaultExtensionConfiguration; - var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config2) => { - return { - ...resolveChecksumRuntimeConfig(config2), - ...resolveRetryRuntimeConfig(config2) - }; - }, "resolveDefaultRuntimeConfig"); - function extendedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function(c5) { - return "%" + c5.charCodeAt(0).toString(16).toUpperCase(); - }); - } - __name(extendedEncodeURIComponent, "extendedEncodeURIComponent"); - var getArrayIfSingleItem = /* @__PURE__ */ __name((mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray], "getArrayIfSingleItem"); - var getValueFromTextNode = /* @__PURE__ */ __name((obj) => { - const textNodeName = "#text"; - for (const key in obj) { - if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { - obj[key] = obj[key][textNodeName]; - } else if (typeof obj[key] === "object" && obj[key] !== null) { - obj[key] = getValueFromTextNode(obj[key]); - } - } - return obj; - }, "getValueFromTextNode"); - var StringWrapper = /* @__PURE__ */ __name(function() { - const Class2 = Object.getPrototypeOf(this).constructor; - const Constructor = Function.bind.apply(String, [null, ...arguments]); - const instance = new Constructor; - Object.setPrototypeOf(instance, Class2.prototype); - return instance; - }, "StringWrapper"); - StringWrapper.prototype = Object.create(String.prototype, { - constructor: { - value: StringWrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - Object.setPrototypeOf(StringWrapper, String); - var _LazyJsonString = class _LazyJsonString2 extends StringWrapper { - deserializeJSON() { - return JSON.parse(super.toString()); - } - toJSON() { - return super.toString(); - } - static fromObject(object2) { - if (object2 instanceof _LazyJsonString2) { - return object2; - } else if (object2 instanceof String || typeof object2 === "string") { - return new _LazyJsonString2(object2); - } - return new _LazyJsonString2(JSON.stringify(object2)); - } - }; - __name(_LazyJsonString, "LazyJsonString"); - var LazyJsonString = _LazyJsonString; - function map3(arg0, arg1, arg2) { - let target; - let filter3; - let instructions; - if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { - target = {}; - instructions = arg0; - } else { - target = arg0; - if (typeof arg1 === "function") { - filter3 = arg1; - instructions = arg2; - return mapWithFilter(target, filter3, instructions); - } else { - instructions = arg1; - } - } - for (const key of Object.keys(instructions)) { - if (!Array.isArray(instructions[key])) { - target[key] = instructions[key]; - continue; - } - applyInstruction(target, null, instructions, key); - } - return target; - } - __name(map3, "map"); - var convertMap = /* @__PURE__ */ __name((target) => { - const output = {}; - for (const [k, v] of Object.entries(target || {})) { - output[k] = [, v]; - } - return output; - }, "convertMap"); - var take2 = /* @__PURE__ */ __name((source, instructions) => { - const out = {}; - for (const key in instructions) { - applyInstruction(out, source, instructions, key); - } - return out; - }, "take"); - var mapWithFilter = /* @__PURE__ */ __name((target, filter3, instructions) => { - return map3(target, Object.entries(instructions).reduce((_instructions, [key, value]) => { - if (Array.isArray(value)) { - _instructions[key] = value; - } else { - if (typeof value === "function") { - _instructions[key] = [filter3, value()]; - } else { - _instructions[key] = [filter3, value]; - } - } - return _instructions; - }, {})); - }, "mapWithFilter"); - var applyInstruction = /* @__PURE__ */ __name((target, source, instructions, targetKey) => { - if (source !== null) { - let instruction = instructions[targetKey]; - if (typeof instruction === "function") { - instruction = [, instruction]; - } - const [filter22 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; - if (typeof filter22 === "function" && filter22(source[sourceKey]) || typeof filter22 !== "function" && !!filter22) { - target[targetKey] = valueFn(source[sourceKey]); - } - return; - } - let [filter3, value] = instructions[targetKey]; - if (typeof value === "function") { - let _value; - const defaultFilterPassed = filter3 === undefined && (_value = value()) != null; - const customFilterPassed = typeof filter3 === "function" && !!filter3(undefined) || typeof filter3 !== "function" && !!filter3; - if (defaultFilterPassed) { - target[targetKey] = _value; - } else if (customFilterPassed) { - target[targetKey] = value(); - } - } else { - const defaultFilterPassed = filter3 === undefined && value != null; - const customFilterPassed = typeof filter3 === "function" && !!filter3(value) || typeof filter3 !== "function" && !!filter3; - if (defaultFilterPassed || customFilterPassed) { - target[targetKey] = value; - } - } - }, "applyInstruction"); - var nonNullish = /* @__PURE__ */ __name((_) => _ != null, "nonNullish"); - var pass = /* @__PURE__ */ __name((_) => _, "pass"); - var resolvedPath = /* @__PURE__ */ __name((resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { - if (input != null && input[memberName] !== undefined) { - const labelValue = labelValueProvider(); - if (labelValue.length <= 0) { - throw new Error("Empty value provided for input HTTP label: " + memberName + "."); - } - resolvedPath2 = resolvedPath2.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue)); - } else { - throw new Error("No value provided for input HTTP label: " + memberName + "."); - } - return resolvedPath2; - }, "resolvedPath"); - var serializeFloat = /* @__PURE__ */ __name((value) => { - if (value !== value) { - return "NaN"; - } - switch (value) { - case Infinity: - return "Infinity"; - case -Infinity: - return "-Infinity"; - default: - return value; - } - }, "serializeFloat"); - var _json = /* @__PURE__ */ __name((obj) => { - if (obj == null) { - return {}; - } - if (Array.isArray(obj)) { - return obj.filter((_) => _ != null).map(_json); - } - if (typeof obj === "object") { - const target = {}; - for (const key of Object.keys(obj)) { - if (obj[key] == null) { - continue; - } - target[key] = _json(obj[key]); - } - return target; - } - return obj; - }, "_json"); - function splitEvery(value, delimiter, numDelimiters) { - if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { - throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); - } - const segments = value.split(delimiter); - if (numDelimiters === 1) { - return segments; - } - const compoundSegments = []; - let currentSegment = ""; - for (let i2 = 0;i2 < segments.length; i2++) { - if (currentSegment === "") { - currentSegment = segments[i2]; - } else { - currentSegment += delimiter + segments[i2]; - } - if ((i2 + 1) % numDelimiters === 0) { - compoundSegments.push(currentSegment); - currentSegment = ""; - } - } - if (currentSegment !== "") { - compoundSegments.push(currentSegment); - } - return compoundSegments; - } - __name(splitEvery, "splitEvery"); -}); - -// ../node_modules/fast-xml-parser/lib/fxp.cjs -var require_fxp2 = __commonJS((exports, module) => { - (() => { - var t = { d: (e2, i3) => { - for (var n3 in i3) - t.o(i3, n3) && !t.o(e2, n3) && Object.defineProperty(e2, n3, { enumerable: true, get: i3[n3] }); - }, o: (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), r: (t2) => { - typeof Symbol != "undefined" && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true }); - } }, e = {}; - t.r(e), t.d(e, { XMLBuilder: () => $t, XMLParser: () => gt2, XMLValidator: () => It }); - const i2 = ":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", n2 = new RegExp("^[" + i2 + "][" + i2 + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); - function s(t2, e2) { - const i3 = []; - let n3 = e2.exec(t2); - for (;n3; ) { - const s2 = []; - s2.startIndex = e2.lastIndex - n3[0].length; - const r2 = n3.length; - for (let t3 = 0;t3 < r2; t3++) - s2.push(n3[t3]); - i3.push(s2), n3 = e2.exec(t2); - } - return i3; - } - const r = function(t2) { - return !(n2.exec(t2) == null); - }, o2 = ["hasOwnProperty", "toString", "valueOf", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"], a2 = ["__proto__", "constructor", "prototype"], h2 = { allowBooleanAttributes: false, unpairedTags: [] }; - function l(t2, e2) { - e2 = Object.assign({}, h2, e2); - const i3 = []; - let n3 = false, s2 = false; - t2[0] === "\uFEFF" && (t2 = t2.substr(1)); - for (let r2 = 0;r2 < t2.length; r2++) - if (t2[r2] === "<" && t2[r2 + 1] === "?") { - if (r2 += 2, r2 = u2(t2, r2), r2.err) - return r2; - } else { - if (t2[r2] !== "<") { - if (p(t2[r2])) - continue; - return b("InvalidChar", "char '" + t2[r2] + "' is not expected.", w(t2, r2)); - } - { - let o3 = r2; - if (r2++, t2[r2] === "!") { - r2 = c5(t2, r2); - continue; - } - { - let a3 = false; - t2[r2] === "/" && (a3 = true, r2++); - let h3 = ""; - for (;r2 < t2.length && t2[r2] !== ">" && t2[r2] !== " " && t2[r2] !== "\t" && t2[r2] !== ` -` && t2[r2] !== "\r"; r2++) - h3 += t2[r2]; - if (h3 = h3.trim(), h3[h3.length - 1] === "/" && (h3 = h3.substring(0, h3.length - 1), r2--), !y2(h3)) { - let e3; - return e3 = h3.trim().length === 0 ? "Invalid space after '<'." : "Tag '" + h3 + "' is an invalid name.", b("InvalidTag", e3, w(t2, r2)); - } - const l2 = g(t2, r2); - if (l2 === false) - return b("InvalidAttr", "Attributes for '" + h3 + "' have open quote.", w(t2, r2)); - let d2 = l2.value; - if (r2 = l2.index, d2[d2.length - 1] === "/") { - const i4 = r2 - d2.length; - d2 = d2.substring(0, d2.length - 1); - const s3 = x2(d2, e2); - if (s3 !== true) - return b(s3.err.code, s3.err.msg, w(t2, i4 + s3.err.line)); - n3 = true; - } else if (a3) { - if (!l2.tagClosed) - return b("InvalidTag", "Closing tag '" + h3 + "' doesn't have proper closing.", w(t2, r2)); - if (d2.trim().length > 0) - return b("InvalidTag", "Closing tag '" + h3 + "' can't have attributes or invalid starting.", w(t2, o3)); - if (i3.length === 0) - return b("InvalidTag", "Closing tag '" + h3 + "' has not been opened.", w(t2, o3)); - { - const e3 = i3.pop(); - if (h3 !== e3.tagName) { - let i4 = w(t2, e3.tagStartPos); - return b("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i4.line + ", col " + i4.col + ") instead of closing tag '" + h3 + "'.", w(t2, o3)); - } - i3.length == 0 && (s2 = true); - } - } else { - const a4 = x2(d2, e2); - if (a4 !== true) - return b(a4.err.code, a4.err.msg, w(t2, r2 - d2.length + a4.err.line)); - if (s2 === true) - return b("InvalidXml", "Multiple possible root nodes found.", w(t2, r2)); - e2.unpairedTags.indexOf(h3) !== -1 || i3.push({ tagName: h3, tagStartPos: o3 }), n3 = true; - } - for (r2++;r2 < t2.length; r2++) - if (t2[r2] === "<") { - if (t2[r2 + 1] === "!") { - r2++, r2 = c5(t2, r2); - continue; - } - if (t2[r2 + 1] !== "?") - break; - if (r2 = u2(t2, ++r2), r2.err) - return r2; - } else if (t2[r2] === "&") { - const e3 = N(t2, r2); - if (e3 == -1) - return b("InvalidChar", "char '&' is not expected.", w(t2, r2)); - r2 = e3; - } else if (s2 === true && !p(t2[r2])) - return b("InvalidXml", "Extra text at the end", w(t2, r2)); - t2[r2] === "<" && r2--; - } - } - } - return n3 ? i3.length == 1 ? b("InvalidTag", "Unclosed tag '" + i3[0].tagName + "'.", w(t2, i3[0].tagStartPos)) : !(i3.length > 0) || b("InvalidXml", "Invalid '" + JSON.stringify(i3.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : b("InvalidXml", "Start tag expected.", 1); - } - function p(t2) { - return t2 === " " || t2 === "\t" || t2 === ` -` || t2 === "\r"; - } - function u2(t2, e2) { - const i3 = e2; - for (;e2 < t2.length; e2++) - if (t2[e2] == "?" || t2[e2] == " ") { - const n3 = t2.substr(i3, e2 - i3); - if (e2 > 5 && n3 === "xml") - return b("InvalidXml", "XML declaration allowed only at the start of the document.", w(t2, e2)); - if (t2[e2] == "?" && t2[e2 + 1] == ">") { - e2++; - break; - } - continue; - } - return e2; - } - function c5(t2, e2) { - if (t2.length > e2 + 5 && t2[e2 + 1] === "-" && t2[e2 + 2] === "-") { - for (e2 += 3;e2 < t2.length; e2++) - if (t2[e2] === "-" && t2[e2 + 1] === "-" && t2[e2 + 2] === ">") { - e2 += 2; - break; - } - } else if (t2.length > e2 + 8 && t2[e2 + 1] === "D" && t2[e2 + 2] === "O" && t2[e2 + 3] === "C" && t2[e2 + 4] === "T" && t2[e2 + 5] === "Y" && t2[e2 + 6] === "P" && t2[e2 + 7] === "E") { - let i3 = 1; - for (e2 += 8;e2 < t2.length; e2++) - if (t2[e2] === "<") - i3++; - else if (t2[e2] === ">" && (i3--, i3 === 0)) - break; - } else if (t2.length > e2 + 9 && t2[e2 + 1] === "[" && t2[e2 + 2] === "C" && t2[e2 + 3] === "D" && t2[e2 + 4] === "A" && t2[e2 + 5] === "T" && t2[e2 + 6] === "A" && t2[e2 + 7] === "[") { - for (e2 += 8;e2 < t2.length; e2++) - if (t2[e2] === "]" && t2[e2 + 1] === "]" && t2[e2 + 2] === ">") { - e2 += 2; - break; - } - } - return e2; - } - const d = '"', f = "'"; - function g(t2, e2) { - let i3 = "", n3 = "", s2 = false; - for (;e2 < t2.length; e2++) { - if (t2[e2] === d || t2[e2] === f) - n3 === "" ? n3 = t2[e2] : n3 !== t2[e2] || (n3 = ""); - else if (t2[e2] === ">" && n3 === "") { - s2 = true; - break; - } - i3 += t2[e2]; - } - return n3 === "" && { value: i3, index: e2, tagClosed: s2 }; - } - const m = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function x2(t2, e2) { - const i3 = s(t2, m), n3 = {}; - for (let t3 = 0;t3 < i3.length; t3++) { - if (i3[t3][1].length === 0) - return b("InvalidAttr", "Attribute '" + i3[t3][2] + "' has no space in starting.", v(i3[t3])); - if (i3[t3][3] !== undefined && i3[t3][4] === undefined) - return b("InvalidAttr", "Attribute '" + i3[t3][2] + "' is without value.", v(i3[t3])); - if (i3[t3][3] === undefined && !e2.allowBooleanAttributes) - return b("InvalidAttr", "boolean attribute '" + i3[t3][2] + "' is not allowed.", v(i3[t3])); - const s2 = i3[t3][2]; - if (!E(s2)) - return b("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", v(i3[t3])); - if (Object.prototype.hasOwnProperty.call(n3, s2)) - return b("InvalidAttr", "Attribute '" + s2 + "' is repeated.", v(i3[t3])); - n3[s2] = 1; - } - return true; - } - function N(t2, e2) { - if (t2[++e2] === ";") - return -1; - if (t2[e2] === "#") - return function(t3, e3) { - let i4 = /\d/; - for (t3[e3] === "x" && (e3++, i4 = /[\da-fA-F]/);e3 < t3.length; e3++) { - if (t3[e3] === ";") - return e3; - if (!t3[e3].match(i4)) - break; - } - return -1; - }(t2, ++e2); - let i3 = 0; - for (;e2 < t2.length; e2++, i3++) - if (!(t2[e2].match(/\w/) && i3 < 20)) { - if (t2[e2] === ";") - break; - return -1; - } - return e2; - } - function b(t2, e2, i3) { - return { err: { code: t2, msg: e2, line: i3.line || i3, col: i3.col } }; - } - function E(t2) { - return r(t2); - } - function y2(t2) { - return r(t2); - } - function w(t2, e2) { - const i3 = t2.substring(0, e2).split(/\r?\n/); - return { line: i3.length, col: i3[i3.length - 1].length + 1 }; - } - function v(t2) { - return t2.startIndex + t2[1].length; - } - const T = (t2) => o2.includes(t2) ? "__" + t2 : t2, P = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(t2, e2) { - return e2; - }, attributeValueProcessor: function(t2, e2) { - return e2; - }, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i3) { - return t2; - }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true, jPath: true, onDangerousProperty: T }; - function S(t2, e2) { - if (typeof t2 != "string") - return; - const i3 = t2.toLowerCase(); - if (o2.some((t3) => i3 === t3.toLowerCase())) - throw new Error(`[SECURITY] Invalid ${e2}: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); - if (a2.some((t3) => i3 === t3.toLowerCase())) - throw new Error(`[SECURITY] Invalid ${e2}: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); - } - function A(t2) { - return typeof t2 == "boolean" ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 10, maxTotalExpansions: 1000, maxExpandedLength: 1e5, maxEntityCount: 100, allowedTags: null, tagFilter: null } : typeof t2 == "object" && t2 !== null ? { enabled: t2.enabled !== false, maxEntitySize: Math.max(1, t2.maxEntitySize ?? 1e4), maxExpansionDepth: Math.max(1, t2.maxExpansionDepth ?? 10), maxTotalExpansions: Math.max(1, t2.maxTotalExpansions ?? 1000), maxExpandedLength: Math.max(1, t2.maxExpandedLength ?? 1e5), maxEntityCount: Math.max(1, t2.maxEntityCount ?? 100), allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null } : A(true); - } - const O = function(t2) { - const e2 = Object.assign({}, P, t2), i3 = [{ value: e2.attributeNamePrefix, name: "attributeNamePrefix" }, { value: e2.attributesGroupName, name: "attributesGroupName" }, { value: e2.textNodeName, name: "textNodeName" }, { value: e2.cdataPropName, name: "cdataPropName" }, { value: e2.commentPropName, name: "commentPropName" }]; - for (const { value: t3, name: e3 } of i3) - t3 && S(t3, e3); - return e2.onDangerousProperty === null && (e2.onDangerousProperty = T), e2.processEntities = A(e2.processEntities), e2.stopNodes && Array.isArray(e2.stopNodes) && (e2.stopNodes = e2.stopNodes.map((t3) => typeof t3 == "string" && t3.startsWith("*.") ? ".." + t3.substring(2) : t3)), e2; - }; - let C2; - C2 = typeof Symbol != "function" ? "@@xmlMetadata" : Symbol("XML Node Metadata"); - - class $2 { - constructor(t2) { - this.tagname = t2, this.child = [], this[":@"] = Object.create(null); - } - add(t2, e2) { - t2 === "__proto__" && (t2 = "#__proto__"), this.child.push({ [t2]: e2 }); - } - addChild(t2, e2) { - t2.tagname === "__proto__" && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), e2 !== undefined && (this.child[this.child.length - 1][C2] = { startIndex: e2 }); - } - static getMetaDataSymbol() { - return C2; - } - } - - class I2 { - constructor(t2) { - this.suppressValidationErr = !t2, this.options = t2; - } - readDocType(t2, e2) { - const i3 = Object.create(null); - let n3 = 0; - if (t2[e2 + 3] !== "O" || t2[e2 + 4] !== "C" || t2[e2 + 5] !== "T" || t2[e2 + 6] !== "Y" || t2[e2 + 7] !== "P" || t2[e2 + 8] !== "E") - throw new Error("Invalid Tag instead of DOCTYPE"); - { - e2 += 9; - let s2 = 1, r2 = false, o3 = false, a3 = ""; - for (;e2 < t2.length; e2++) - if (t2[e2] !== "<" || o3) - if (t2[e2] === ">") { - if (o3 ? t2[e2 - 1] === "-" && t2[e2 - 2] === "-" && (o3 = false, s2--) : s2--, s2 === 0) - break; - } else - t2[e2] === "[" ? r2 = true : a3 += t2[e2]; - else { - if (r2 && M2(t2, "!ENTITY", e2)) { - let s3, r3; - if (e2 += 7, [s3, r3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), r3.indexOf("&") === -1) { - if (this.options.enabled !== false && this.options.maxEntityCount != null && n3 >= this.options.maxEntityCount) - throw new Error(`Entity count (${n3 + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`); - const t3 = s3.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - i3[s3] = { regx: RegExp(`&${t3};`, "g"), val: r3 }, n3++; - } - } else if (r2 && M2(t2, "!ELEMENT", e2)) { - e2 += 8; - const { index: i4 } = this.readElementExp(t2, e2 + 1); - e2 = i4; - } else if (r2 && M2(t2, "!ATTLIST", e2)) - e2 += 8; - else if (r2 && M2(t2, "!NOTATION", e2)) { - e2 += 9; - const { index: i4 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); - e2 = i4; - } else { - if (!M2(t2, "!--", e2)) - throw new Error("Invalid DOCTYPE"); - o3 = true; - } - s2++, a3 = ""; - } - if (s2 !== 0) - throw new Error("Unclosed DOCTYPE"); - } - return { entities: i3, i: e2 }; - } - readEntityExp(t2, e2) { - const i3 = e2 = j(t2, e2); - for (;e2 < t2.length && !/\s/.test(t2[e2]) && t2[e2] !== '"' && t2[e2] !== "'"; ) - e2++; - let n3 = t2.substring(i3, e2); - if (_(n3), e2 = j(t2, e2), !this.suppressValidationErr) { - if (t2.substring(e2, e2 + 6).toUpperCase() === "SYSTEM") - throw new Error("External entities are not supported"); - if (t2[e2] === "%") - throw new Error("Parameter entities are not supported"); - } - let s2 = ""; - if ([e2, s2] = this.readIdentifierVal(t2, e2, "entity"), this.options.enabled !== false && this.options.maxEntitySize != null && s2.length > this.options.maxEntitySize) - throw new Error(`Entity "${n3}" size (${s2.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`); - return [n3, s2, --e2]; - } - readNotationExp(t2, e2) { - const i3 = e2 = j(t2, e2); - for (;e2 < t2.length && !/\s/.test(t2[e2]); ) - e2++; - let n3 = t2.substring(i3, e2); - !this.suppressValidationErr && _(n3), e2 = j(t2, e2); - const s2 = t2.substring(e2, e2 + 6).toUpperCase(); - if (!this.suppressValidationErr && s2 !== "SYSTEM" && s2 !== "PUBLIC") - throw new Error(`Expected SYSTEM or PUBLIC, found "${s2}"`); - e2 += s2.length, e2 = j(t2, e2); - let r2 = null, o3 = null; - if (s2 === "PUBLIC") - [e2, r2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), t2[e2 = j(t2, e2)] !== '"' && t2[e2] !== "'" || ([e2, o3] = this.readIdentifierVal(t2, e2, "systemIdentifier")); - else if (s2 === "SYSTEM" && ([e2, o3] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !o3)) - throw new Error("Missing mandatory system identifier for SYSTEM notation"); - return { notationName: n3, publicIdentifier: r2, systemIdentifier: o3, index: --e2 }; - } - readIdentifierVal(t2, e2, i3) { - let n3 = ""; - const s2 = t2[e2]; - if (s2 !== '"' && s2 !== "'") - throw new Error(`Expected quoted string, found "${s2}"`); - const r2 = ++e2; - for (;e2 < t2.length && t2[e2] !== s2; ) - e2++; - if (n3 = t2.substring(r2, e2), t2[e2] !== s2) - throw new Error(`Unterminated ${i3} value`); - return [++e2, n3]; - } - readElementExp(t2, e2) { - const i3 = e2 = j(t2, e2); - for (;e2 < t2.length && !/\s/.test(t2[e2]); ) - e2++; - let n3 = t2.substring(i3, e2); - if (!this.suppressValidationErr && !r(n3)) - throw new Error(`Invalid element name: "${n3}"`); - let s2 = ""; - if (t2[e2 = j(t2, e2)] === "E" && M2(t2, "MPTY", e2)) - e2 += 4; - else if (t2[e2] === "A" && M2(t2, "NY", e2)) - e2 += 2; - else if (t2[e2] === "(") { - const i4 = ++e2; - for (;e2 < t2.length && t2[e2] !== ")"; ) - e2++; - if (s2 = t2.substring(i4, e2), t2[e2] !== ")") - throw new Error("Unterminated content model"); - } else if (!this.suppressValidationErr) - throw new Error(`Invalid Element Expression, found "${t2[e2]}"`); - return { elementName: n3, contentModel: s2.trim(), index: e2 }; - } - readAttlistExp(t2, e2) { - let i3 = e2 = j(t2, e2); - for (;e2 < t2.length && !/\s/.test(t2[e2]); ) - e2++; - let n3 = t2.substring(i3, e2); - for (_(n3), i3 = e2 = j(t2, e2);e2 < t2.length && !/\s/.test(t2[e2]); ) - e2++; - let s2 = t2.substring(i3, e2); - if (!_(s2)) - throw new Error(`Invalid attribute name: "${s2}"`); - e2 = j(t2, e2); - let r2 = ""; - if (t2.substring(e2, e2 + 8).toUpperCase() === "NOTATION") { - if (r2 = "NOTATION", t2[e2 = j(t2, e2 += 8)] !== "(") - throw new Error(`Expected '(', found "${t2[e2]}"`); - e2++; - let i4 = []; - for (;e2 < t2.length && t2[e2] !== ")"; ) { - const n4 = e2; - for (;e2 < t2.length && t2[e2] !== "|" && t2[e2] !== ")"; ) - e2++; - let s3 = t2.substring(n4, e2); - if (s3 = s3.trim(), !_(s3)) - throw new Error(`Invalid notation name: "${s3}"`); - i4.push(s3), t2[e2] === "|" && (e2++, e2 = j(t2, e2)); - } - if (t2[e2] !== ")") - throw new Error("Unterminated list of notations"); - e2++, r2 += " (" + i4.join("|") + ")"; - } else { - const i4 = e2; - for (;e2 < t2.length && !/\s/.test(t2[e2]); ) - e2++; - r2 += t2.substring(i4, e2); - const n4 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; - if (!this.suppressValidationErr && !n4.includes(r2.toUpperCase())) - throw new Error(`Invalid attribute type: "${r2}"`); - } - e2 = j(t2, e2); - let o3 = ""; - return t2.substring(e2, e2 + 8).toUpperCase() === "#REQUIRED" ? (o3 = "#REQUIRED", e2 += 8) : t2.substring(e2, e2 + 7).toUpperCase() === "#IMPLIED" ? (o3 = "#IMPLIED", e2 += 7) : [e2, o3] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: n3, attributeName: s2, attributeType: r2, defaultValue: o3, index: e2 }; - } - } - const j = (t2, e2) => { - for (;e2 < t2.length && /\s/.test(t2[e2]); ) - e2++; - return e2; - }; - function M2(t2, e2, i3) { - for (let n3 = 0;n3 < e2.length; n3++) - if (e2[n3] !== t2[i3 + n3 + 1]) - return false; - return true; - } - function _(t2) { - if (r(t2)) - return t2; - throw new Error(`Invalid entity name ${t2}`); - } - const D2 = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, k = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true, infinity: "original" }; - const F = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/, L2 = new Set(["push", "pop", "reset", "updateCurrent", "restore"]); - - class G3 { - constructor(t2 = {}) { - this.separator = t2.separator || ".", this.path = [], this.siblingStacks = []; - } - push(t2, e2 = null, i3 = null) { - this.path.length > 0 && (this.path[this.path.length - 1].values = undefined); - const n3 = this.path.length; - this.siblingStacks[n3] || (this.siblingStacks[n3] = new Map); - const s2 = this.siblingStacks[n3], r2 = i3 ? `${i3}:${t2}` : t2, o3 = s2.get(r2) || 0; - let a3 = 0; - for (const t3 of s2.values()) - a3 += t3; - s2.set(r2, o3 + 1); - const h3 = { tag: t2, position: a3, counter: o3 }; - i3 != null && (h3.namespace = i3), e2 != null && (h3.values = e2), this.path.push(h3); - } - pop() { - if (this.path.length === 0) - return; - const t2 = this.path.pop(); - return this.siblingStacks.length > this.path.length + 1 && (this.siblingStacks.length = this.path.length + 1), t2; - } - updateCurrent(t2) { - if (this.path.length > 0) { - const e2 = this.path[this.path.length - 1]; - t2 != null && (e2.values = t2); - } - } - getCurrentTag() { - return this.path.length > 0 ? this.path[this.path.length - 1].tag : undefined; - } - getCurrentNamespace() { - return this.path.length > 0 ? this.path[this.path.length - 1].namespace : undefined; - } - getAttrValue(t2) { - if (this.path.length === 0) - return; - const e2 = this.path[this.path.length - 1]; - return e2.values?.[t2]; - } - hasAttr(t2) { - if (this.path.length === 0) - return false; - const e2 = this.path[this.path.length - 1]; - return e2.values !== undefined && t2 in e2.values; - } - getPosition() { - return this.path.length === 0 ? -1 : this.path[this.path.length - 1].position ?? 0; - } - getCounter() { - return this.path.length === 0 ? -1 : this.path[this.path.length - 1].counter ?? 0; - } - getIndex() { - return this.getPosition(); - } - getDepth() { - return this.path.length; - } - toString(t2, e2 = true) { - const i3 = t2 || this.separator; - return this.path.map((t3) => e2 && t3.namespace ? `${t3.namespace}:${t3.tag}` : t3.tag).join(i3); - } - toArray() { - return this.path.map((t2) => t2.tag); - } - reset() { - this.path = [], this.siblingStacks = []; - } - matches(t2) { - const e2 = t2.segments; - return e2.length !== 0 && (t2.hasDeepWildcard() ? this._matchWithDeepWildcard(e2) : this._matchSimple(e2)); - } - _matchSimple(t2) { - if (this.path.length !== t2.length) - return false; - for (let e2 = 0;e2 < t2.length; e2++) { - const i3 = t2[e2], n3 = this.path[e2], s2 = e2 === this.path.length - 1; - if (!this._matchSegment(i3, n3, s2)) - return false; - } - return true; - } - _matchWithDeepWildcard(t2) { - let e2 = this.path.length - 1, i3 = t2.length - 1; - for (;i3 >= 0 && e2 >= 0; ) { - const n3 = t2[i3]; - if (n3.type === "deep-wildcard") { - if (i3--, i3 < 0) - return true; - const n4 = t2[i3]; - let s2 = false; - for (let t3 = e2;t3 >= 0; t3--) { - const r2 = t3 === this.path.length - 1; - if (this._matchSegment(n4, this.path[t3], r2)) { - e2 = t3 - 1, i3--, s2 = true; - break; - } - } - if (!s2) - return false; - } else { - const t3 = e2 === this.path.length - 1; - if (!this._matchSegment(n3, this.path[e2], t3)) - return false; - e2--, i3--; - } - } - return i3 < 0; - } - _matchSegment(t2, e2, i3) { - if (t2.tag !== "*" && t2.tag !== e2.tag) - return false; - if (t2.namespace !== undefined && t2.namespace !== "*" && t2.namespace !== e2.namespace) - return false; - if (t2.attrName !== undefined) { - if (!i3) - return false; - if (!e2.values || !(t2.attrName in e2.values)) - return false; - if (t2.attrValue !== undefined) { - const i4 = e2.values[t2.attrName]; - if (String(i4) !== String(t2.attrValue)) - return false; - } - } - if (t2.position !== undefined) { - if (!i3) - return false; - const n3 = e2.counter ?? 0; - if (t2.position === "first" && n3 !== 0) - return false; - if (t2.position === "odd" && n3 % 2 != 1) - return false; - if (t2.position === "even" && n3 % 2 != 0) - return false; - if (t2.position === "nth" && n3 !== t2.positionValue) - return false; - } - return true; - } - snapshot() { - return { path: this.path.map((t2) => ({ ...t2 })), siblingStacks: this.siblingStacks.map((t2) => new Map(t2)) }; - } - restore(t2) { - this.path = t2.path.map((t3) => ({ ...t3 })), this.siblingStacks = t2.siblingStacks.map((t3) => new Map(t3)); - } - readOnly() { - return new Proxy(this, { get(t2, e2, i3) { - if (L2.has(e2)) - return () => { - throw new TypeError(`Cannot call '${e2}' on a read-only Matcher. Obtain a writable instance to mutate state.`); - }; - const n3 = Reflect.get(t2, e2, i3); - return e2 === "path" || e2 === "siblingStacks" ? Object.freeze(Array.isArray(n3) ? n3.map((t3) => t3 instanceof Map ? Object.freeze(new Map(t3)) : Object.freeze({ ...t3 })) : n3) : typeof n3 == "function" ? n3.bind(t2) : n3; - }, set(t2, e2) { - throw new TypeError(`Cannot set property '${String(e2)}' on a read-only Matcher.`); - }, deleteProperty(t2, e2) { - throw new TypeError(`Cannot delete property '${String(e2)}' from a read-only Matcher.`); - } }); - } - } - - class R2 { - constructor(t2, e2 = {}) { - this.pattern = t2, this.separator = e2.separator || ".", this.segments = this._parse(t2), this._hasDeepWildcard = this.segments.some((t3) => t3.type === "deep-wildcard"), this._hasAttributeCondition = this.segments.some((t3) => t3.attrName !== undefined), this._hasPositionSelector = this.segments.some((t3) => t3.position !== undefined); - } - _parse(t2) { - const e2 = []; - let i3 = 0, n3 = ""; - for (;i3 < t2.length; ) - t2[i3] === this.separator ? i3 + 1 < t2.length && t2[i3 + 1] === this.separator ? (n3.trim() && (e2.push(this._parseSegment(n3.trim())), n3 = ""), e2.push({ type: "deep-wildcard" }), i3 += 2) : (n3.trim() && e2.push(this._parseSegment(n3.trim())), n3 = "", i3++) : (n3 += t2[i3], i3++); - return n3.trim() && e2.push(this._parseSegment(n3.trim())), e2; - } - _parseSegment(t2) { - const e2 = { type: "tag" }; - let i3 = null, n3 = t2; - const s2 = t2.match(/^([^\[]+)(\[[^\]]*\])(.*)$/); - if (s2 && (n3 = s2[1] + s2[3], s2[2])) { - const t3 = s2[2].slice(1, -1); - t3 && (i3 = t3); - } - let r2, o3, a3 = n3; - if (n3.includes("::")) { - const e3 = n3.indexOf("::"); - if (r2 = n3.substring(0, e3).trim(), a3 = n3.substring(e3 + 2).trim(), !r2) - throw new Error(`Invalid namespace in pattern: ${t2}`); - } - let h3 = null; - if (a3.includes(":")) { - const t3 = a3.lastIndexOf(":"), e3 = a3.substring(0, t3).trim(), i4 = a3.substring(t3 + 1).trim(); - ["first", "last", "odd", "even"].includes(i4) || /^nth\(\d+\)$/.test(i4) ? (o3 = e3, h3 = i4) : o3 = a3; - } else - o3 = a3; - if (!o3) - throw new Error(`Invalid segment pattern: ${t2}`); - if (e2.tag = o3, r2 && (e2.namespace = r2), i3) - if (i3.includes("=")) { - const t3 = i3.indexOf("="); - e2.attrName = i3.substring(0, t3).trim(), e2.attrValue = i3.substring(t3 + 1).trim(); - } else - e2.attrName = i3.trim(); - if (h3) { - const t3 = h3.match(/^nth\((\d+)\)$/); - t3 ? (e2.position = "nth", e2.positionValue = parseInt(t3[1], 10)) : e2.position = h3; - } - return e2; - } - get length() { - return this.segments.length; - } - hasDeepWildcard() { - return this._hasDeepWildcard; - } - hasAttributeCondition() { - return this._hasAttributeCondition; - } - hasPositionSelector() { - return this._hasPositionSelector; - } - toString() { - return this.pattern; - } - } - function U2(t2, e2) { - if (!t2) - return {}; - const i3 = e2.attributesGroupName ? t2[e2.attributesGroupName] : t2; - if (!i3) - return {}; - const n3 = {}; - for (const t3 in i3) - t3.startsWith(e2.attributeNamePrefix) ? n3[t3.substring(e2.attributeNamePrefix.length)] = i3[t3] : n3[t3] = i3[t3]; - return n3; - } - function B(t2) { - if (!t2 || typeof t2 != "string") - return; - const e2 = t2.indexOf(":"); - if (e2 !== -1 && e2 > 0) { - const i3 = t2.substring(0, e2); - if (i3 !== "xmlns") - return i3; - } - } - - class W2 { - constructor(t2) { - var e2; - if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "¢" }, pound: { regex: /&(pound|#163);/g, val: "£" }, yen: { regex: /&(yen|#165);/g, val: "¥" }, euro: { regex: /&(euro|#8364);/g, val: "€" }, copyright: { regex: /&(copy|#169);/g, val: "©" }, reg: { regex: /&(reg|#174);/g, val: "®" }, inr: { regex: /&(inr|#8377);/g, val: "₹" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e3) => rt(e3, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e3) => rt(e3, 16, "&#x") } }, this.addExternalEntities = Y, this.parseXml = J, this.parseTextData = z2, this.resolveNameSpace = X, this.buildAttributesMap = Z, this.isItStopNode = tt, this.replaceEntitiesValue = Q, this.readStopNodeData = nt, this.saveTextToParentTag = H2, this.addChild = K, this.ignoreAttributesFn = typeof (e2 = this.options.ignoreAttributes) == "function" ? e2 : Array.isArray(e2) ? (t3) => { - for (const i3 of e2) { - if (typeof i3 == "string" && t3 === i3) - return true; - if (i3 instanceof RegExp && i3.test(t3)) - return true; - } - } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.matcher = new G3, this.readonlyMatcher = this.matcher.readOnly(), this.isCurrentNodeStopNode = false, this.options.stopNodes && this.options.stopNodes.length > 0) { - this.stopNodeExpressions = []; - for (let t3 = 0;t3 < this.options.stopNodes.length; t3++) { - const e3 = this.options.stopNodes[t3]; - typeof e3 == "string" ? this.stopNodeExpressions.push(new R2(e3)) : e3 instanceof R2 && this.stopNodeExpressions.push(e3); - } - } - } - } - function Y(t2) { - const e2 = Object.keys(t2); - for (let i3 = 0;i3 < e2.length; i3++) { - const n3 = e2[i3], s2 = n3.replace(/[.\-+*:]/g, "\\."); - this.lastEntities[n3] = { regex: new RegExp("&" + s2 + ";", "g"), val: t2[n3] }; - } - } - function z2(t2, e2, i3, n3, s2, r2, o3) { - if (t2 !== undefined && (this.options.trimValues && !n3 && (t2 = t2.trim()), t2.length > 0)) { - o3 || (t2 = this.replaceEntitiesValue(t2, e2, i3)); - const n4 = this.options.jPath ? i3.toString() : i3, a3 = this.options.tagValueProcessor(e2, t2, n4, s2, r2); - return a3 == null ? t2 : typeof a3 != typeof t2 || a3 !== t2 ? a3 : this.options.trimValues || t2.trim() === t2 ? st(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; - } - } - function X(t2) { - if (this.options.removeNSPrefix) { - const e2 = t2.split(":"), i3 = t2.charAt(0) === "/" ? "/" : ""; - if (e2[0] === "xmlns") - return ""; - e2.length === 2 && (t2 = i3 + e2[1]); - } - return t2; - } - const q = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function Z(t2, e2, i3) { - if (this.options.ignoreAttributes !== true && typeof t2 == "string") { - const n3 = s(t2, q), r2 = n3.length, o3 = {}, a3 = {}; - for (let t3 = 0;t3 < r2; t3++) { - const e3 = this.resolveNameSpace(n3[t3][1]), s2 = n3[t3][4]; - if (e3.length && s2 !== undefined) { - let t4 = s2; - this.options.trimValues && (t4 = t4.trim()), t4 = this.replaceEntitiesValue(t4, i3, this.readonlyMatcher), a3[e3] = t4; - } - } - Object.keys(a3).length > 0 && typeof e2 == "object" && e2.updateCurrent && e2.updateCurrent(a3); - for (let t3 = 0;t3 < r2; t3++) { - const s2 = this.resolveNameSpace(n3[t3][1]), r3 = this.options.jPath ? e2.toString() : this.readonlyMatcher; - if (this.ignoreAttributesFn(s2, r3)) - continue; - let a4 = n3[t3][4], h3 = this.options.attributeNamePrefix + s2; - if (s2.length) - if (this.options.transformAttributeName && (h3 = this.options.transformAttributeName(h3)), h3 = at2(h3, this.options), a4 !== undefined) { - this.options.trimValues && (a4 = a4.trim()), a4 = this.replaceEntitiesValue(a4, i3, this.readonlyMatcher); - const t4 = this.options.jPath ? e2.toString() : this.readonlyMatcher, n4 = this.options.attributeValueProcessor(s2, a4, t4); - o3[h3] = n4 == null ? a4 : typeof n4 != typeof a4 || n4 !== a4 ? n4 : st(a4, this.options.parseAttributeValue, this.options.numberParseOptions); - } else - this.options.allowBooleanAttributes && (o3[h3] = true); - } - if (!Object.keys(o3).length) - return; - if (this.options.attributesGroupName) { - const t3 = {}; - return t3[this.options.attributesGroupName] = o3, t3; - } - return o3; - } - } - const J = function(t2) { - t2 = t2.replace(/\r\n?/g, ` -`); - const e2 = new $2("!xml"); - let i3 = e2, n3 = ""; - this.matcher.reset(), this.entityExpansionCount = 0, this.currentExpandedLength = 0; - const s2 = new I2(this.options.processEntities); - for (let r2 = 0;r2 < t2.length; r2++) - if (t2[r2] === "<") - if (t2[r2 + 1] === "/") { - const e3 = et(t2, ">", r2, "Closing Tag is not closed."); - let s3 = t2.substring(r2 + 2, e3).trim(); - if (this.options.removeNSPrefix) { - const t3 = s3.indexOf(":"); - t3 !== -1 && (s3 = s3.substr(t3 + 1)); - } - s3 = ot(this.options.transformTagName, s3, "", this.options).tagName, i3 && (n3 = this.saveTextToParentTag(n3, i3, this.readonlyMatcher)); - const o3 = this.matcher.getCurrentTag(); - if (s3 && this.options.unpairedTags.indexOf(s3) !== -1) - throw new Error(`Unpaired tag can not be used as closing tag: `); - o3 && this.options.unpairedTags.indexOf(o3) !== -1 && (this.matcher.pop(), this.tagsNodeStack.pop()), this.matcher.pop(), this.isCurrentNodeStopNode = false, i3 = this.tagsNodeStack.pop(), n3 = "", r2 = e3; - } else if (t2[r2 + 1] === "?") { - let e3 = it(t2, r2, false, "?>"); - if (!e3) - throw new Error("Pi Tag is not closed."); - if (n3 = this.saveTextToParentTag(n3, i3, this.readonlyMatcher), this.options.ignoreDeclaration && e3.tagName === "?xml" || this.options.ignorePiTags) - ; - else { - const t3 = new $2(e3.tagName); - t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, this.matcher, e3.tagName)), this.addChild(i3, t3, this.readonlyMatcher, r2); - } - r2 = e3.closeIndex + 1; - } else if (t2.substr(r2 + 1, 3) === "!--") { - const e3 = et(t2, "-->", r2 + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const s3 = t2.substring(r2 + 4, e3 - 2); - n3 = this.saveTextToParentTag(n3, i3, this.readonlyMatcher), i3.add(this.options.commentPropName, [{ [this.options.textNodeName]: s3 }]); - } - r2 = e3; - } else if (t2.substr(r2 + 1, 2) === "!D") { - const e3 = s2.readDocType(t2, r2); - this.docTypeEntities = e3.entities, r2 = e3.i; - } else if (t2.substr(r2 + 1, 2) === "![") { - const e3 = et(t2, "]]>", r2, "CDATA is not closed.") - 2, s3 = t2.substring(r2 + 9, e3); - n3 = this.saveTextToParentTag(n3, i3, this.readonlyMatcher); - let o3 = this.parseTextData(s3, i3.tagname, this.readonlyMatcher, true, false, true, true); - o3 == null && (o3 = ""), this.options.cdataPropName ? i3.add(this.options.cdataPropName, [{ [this.options.textNodeName]: s3 }]) : i3.add(this.options.textNodeName, o3), r2 = e3 + 2; - } else { - let s3 = it(t2, r2, this.options.removeNSPrefix); - if (!s3) { - const e3 = t2.substring(Math.max(0, r2 - 50), Math.min(t2.length, r2 + 50)); - throw new Error(`readTagExp returned undefined at position ${r2}. Context: "${e3}"`); - } - let o3 = s3.tagName; - const a3 = s3.rawTagName; - let { tagExp: h3, attrExpPresent: l2, closeIndex: p2 } = s3; - if ({ tagName: o3, tagExp: h3 } = ot(this.options.transformTagName, o3, h3, this.options), this.options.strictReservedNames && (o3 === this.options.commentPropName || o3 === this.options.cdataPropName || o3 === this.options.textNodeName || o3 === this.options.attributesGroupName)) - throw new Error(`Invalid tag name: ${o3}`); - i3 && n3 && i3.tagname !== "!xml" && (n3 = this.saveTextToParentTag(n3, i3, this.readonlyMatcher, false)); - const u3 = i3; - u3 && this.options.unpairedTags.indexOf(u3.tagname) !== -1 && (i3 = this.tagsNodeStack.pop(), this.matcher.pop()); - let c6 = false; - h3.length > 0 && h3.lastIndexOf("/") === h3.length - 1 && (c6 = true, o3[o3.length - 1] === "/" ? (o3 = o3.substr(0, o3.length - 1), h3 = o3) : h3 = h3.substr(0, h3.length - 1), l2 = o3 !== h3); - let d2, f2 = null, g2 = {}; - d2 = B(a3), o3 !== e2.tagname && this.matcher.push(o3, {}, d2), o3 !== h3 && l2 && (f2 = this.buildAttributesMap(h3, this.matcher, o3), f2 && (g2 = U2(f2, this.options))), o3 !== e2.tagname && (this.isCurrentNodeStopNode = this.isItStopNode(this.stopNodeExpressions, this.matcher)); - const m2 = r2; - if (this.isCurrentNodeStopNode) { - let e3 = ""; - if (c6) - r2 = s3.closeIndex; - else if (this.options.unpairedTags.indexOf(o3) !== -1) - r2 = s3.closeIndex; - else { - const i4 = this.readStopNodeData(t2, a3, p2 + 1); - if (!i4) - throw new Error(`Unexpected end of ${a3}`); - r2 = i4.i, e3 = i4.tagContent; - } - const n4 = new $2(o3); - f2 && (n4[":@"] = f2), n4.add(this.options.textNodeName, e3), this.matcher.pop(), this.isCurrentNodeStopNode = false, this.addChild(i3, n4, this.readonlyMatcher, m2); - } else { - if (c6) { - ({ tagName: o3, tagExp: h3 } = ot(this.options.transformTagName, o3, h3, this.options)); - const t3 = new $2(o3); - f2 && (t3[":@"] = f2), this.addChild(i3, t3, this.readonlyMatcher, m2), this.matcher.pop(), this.isCurrentNodeStopNode = false; - } else { - if (this.options.unpairedTags.indexOf(o3) !== -1) { - const t3 = new $2(o3); - f2 && (t3[":@"] = f2), this.addChild(i3, t3, this.readonlyMatcher, m2), this.matcher.pop(), this.isCurrentNodeStopNode = false, r2 = s3.closeIndex; - continue; - } - { - const t3 = new $2(o3); - if (this.tagsNodeStack.length > this.options.maxNestedTags) - throw new Error("Maximum nested tags exceeded"); - this.tagsNodeStack.push(i3), f2 && (t3[":@"] = f2), this.addChild(i3, t3, this.readonlyMatcher, m2), i3 = t3; - } - } - n3 = "", r2 = p2; - } - } - else - n3 += t2[r2]; - return e2.child; - }; - function K(t2, e2, i3, n3) { - this.options.captureMetaData || (n3 = undefined); - const s2 = this.options.jPath ? i3.toString() : i3, r2 = this.options.updateTag(e2.tagname, s2, e2[":@"]); - r2 === false || (typeof r2 == "string" ? (e2.tagname = r2, t2.addChild(e2, n3)) : t2.addChild(e2, n3)); - } - function Q(t2, e2, i3) { - const n3 = this.options.processEntities; - if (!n3 || !n3.enabled) - return t2; - if (n3.allowedTags) { - const s2 = this.options.jPath ? i3.toString() : i3; - if (!(Array.isArray(n3.allowedTags) ? n3.allowedTags.includes(e2) : n3.allowedTags(e2, s2))) - return t2; - } - if (n3.tagFilter) { - const s2 = this.options.jPath ? i3.toString() : i3; - if (!n3.tagFilter(e2, s2)) - return t2; - } - for (const e3 of Object.keys(this.docTypeEntities)) { - const i4 = this.docTypeEntities[e3], s2 = t2.match(i4.regx); - if (s2) { - if (this.entityExpansionCount += s2.length, n3.maxTotalExpansions && this.entityExpansionCount > n3.maxTotalExpansions) - throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n3.maxTotalExpansions}`); - const e4 = t2.length; - if (t2 = t2.replace(i4.regx, i4.val), n3.maxExpandedLength && (this.currentExpandedLength += t2.length - e4, this.currentExpandedLength > n3.maxExpandedLength)) - throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${n3.maxExpandedLength}`); - } - } - for (const e3 of Object.keys(this.lastEntities)) { - const i4 = this.lastEntities[e3], s2 = t2.match(i4.regex); - if (s2 && (this.entityExpansionCount += s2.length, n3.maxTotalExpansions && this.entityExpansionCount > n3.maxTotalExpansions)) - throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n3.maxTotalExpansions}`); - t2 = t2.replace(i4.regex, i4.val); - } - if (t2.indexOf("&") === -1) - return t2; - if (this.options.htmlEntities) - for (const e3 of Object.keys(this.htmlEntities)) { - const i4 = this.htmlEntities[e3], s2 = t2.match(i4.regex); - if (s2 && (this.entityExpansionCount += s2.length, n3.maxTotalExpansions && this.entityExpansionCount > n3.maxTotalExpansions)) - throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n3.maxTotalExpansions}`); - t2 = t2.replace(i4.regex, i4.val); - } - return t2.replace(this.ampEntity.regex, this.ampEntity.val); - } - function H2(t2, e2, i3, n3) { - return t2 && (n3 === undefined && (n3 = e2.child.length === 0), (t2 = this.parseTextData(t2, e2.tagname, i3, false, !!e2[":@"] && Object.keys(e2[":@"]).length !== 0, n3)) !== undefined && t2 !== "" && e2.add(this.options.textNodeName, t2), t2 = ""), t2; - } - function tt(t2, e2) { - if (!t2 || t2.length === 0) - return false; - for (let i3 = 0;i3 < t2.length; i3++) - if (e2.matches(t2[i3])) - return true; - return false; - } - function et(t2, e2, i3, n3) { - const s2 = t2.indexOf(e2, i3); - if (s2 === -1) - throw new Error(n3); - return s2 + e2.length - 1; - } - function it(t2, e2, i3, n3 = ">") { - const s2 = function(t3, e3, i4 = ">") { - let n4, s3 = ""; - for (let r3 = e3;r3 < t3.length; r3++) { - let e4 = t3[r3]; - if (n4) - e4 === n4 && (n4 = ""); - else if (e4 === '"' || e4 === "'") - n4 = e4; - else if (e4 === i4[0]) { - if (!i4[1]) - return { data: s3, index: r3 }; - if (t3[r3 + 1] === i4[1]) - return { data: s3, index: r3 }; - } else - e4 === "\t" && (e4 = " "); - s3 += e4; - } - }(t2, e2 + 1, n3); - if (!s2) - return; - let r2 = s2.data; - const o3 = s2.index, a3 = r2.search(/\s/); - let h3 = r2, l2 = true; - a3 !== -1 && (h3 = r2.substring(0, a3), r2 = r2.substring(a3 + 1).trimStart()); - const p2 = h3; - if (i3) { - const t3 = h3.indexOf(":"); - t3 !== -1 && (h3 = h3.substr(t3 + 1), l2 = h3 !== s2.data.substr(t3 + 1)); - } - return { tagName: h3, tagExp: r2, closeIndex: o3, attrExpPresent: l2, rawTagName: p2 }; - } - function nt(t2, e2, i3) { - const n3 = i3; - let s2 = 1; - for (;i3 < t2.length; i3++) - if (t2[i3] === "<") - if (t2[i3 + 1] === "/") { - const r2 = et(t2, ">", i3, `${e2} is not closed`); - if (t2.substring(i3 + 2, r2).trim() === e2 && (s2--, s2 === 0)) - return { tagContent: t2.substring(n3, i3), i: r2 }; - i3 = r2; - } else if (t2[i3 + 1] === "?") - i3 = et(t2, "?>", i3 + 1, "StopNode is not closed."); - else if (t2.substr(i3 + 1, 3) === "!--") - i3 = et(t2, "-->", i3 + 3, "StopNode is not closed."); - else if (t2.substr(i3 + 1, 2) === "![") - i3 = et(t2, "]]>", i3, "StopNode is not closed.") - 2; - else { - const n4 = it(t2, i3, ">"); - n4 && ((n4 && n4.tagName) === e2 && n4.tagExp[n4.tagExp.length - 1] !== "/" && s2++, i3 = n4.closeIndex); - } - } - function st(t2, e2, i3) { - if (e2 && typeof t2 == "string") { - const e3 = t2.trim(); - return e3 === "true" || e3 !== "false" && function(t3, e4 = {}) { - if (e4 = Object.assign({}, k, e4), !t3 || typeof t3 != "string") - return t3; - let i4 = t3.trim(); - if (e4.skipLike !== undefined && e4.skipLike.test(i4)) - return t3; - if (t3 === "0") - return 0; - if (e4.hex && D2.test(i4)) - return function(t4) { - if (parseInt) - return parseInt(t4, 16); - if (Number.parseInt) - return Number.parseInt(t4, 16); - if (window && window.parseInt) - return window.parseInt(t4, 16); - throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); - }(i4); - if (isFinite(i4)) { - if (i4.includes("e") || i4.includes("E")) - return function(t4, e5, i5) { - if (!i5.eNotation) - return t4; - const n4 = e5.match(F); - if (n4) { - let s2 = n4[1] || ""; - const r2 = n4[3].indexOf("e") === -1 ? "E" : "e", o3 = n4[2], a3 = s2 ? t4[o3.length + 1] === r2 : t4[o3.length] === r2; - return o3.length > 1 && a3 ? t4 : (o3.length !== 1 || !n4[3].startsWith(`.${r2}`) && n4[3][0] !== r2) && o3.length > 0 ? i5.leadingZeros && !a3 ? (e5 = (n4[1] || "") + n4[3], Number(e5)) : t4 : Number(e5); - } - return t4; - }(t3, i4, e4); - { - const s2 = V.exec(i4); - if (s2) { - const r2 = s2[1] || "", o3 = s2[2]; - let a3 = (n3 = s2[3]) && n3.indexOf(".") !== -1 ? ((n3 = n3.replace(/0+$/, "")) === "." ? n3 = "0" : n3[0] === "." ? n3 = "0" + n3 : n3[n3.length - 1] === "." && (n3 = n3.substring(0, n3.length - 1)), n3) : n3; - const h3 = r2 ? t3[o3.length + 1] === "." : t3[o3.length] === "."; - if (!e4.leadingZeros && (o3.length > 1 || o3.length === 1 && !h3)) - return t3; - { - const n4 = Number(i4), s3 = String(n4); - if (n4 === 0) - return n4; - if (s3.search(/[eE]/) !== -1) - return e4.eNotation ? n4 : t3; - if (i4.indexOf(".") !== -1) - return s3 === "0" || s3 === a3 || s3 === `${r2}${a3}` ? n4 : t3; - let h4 = o3 ? a3 : i4; - return o3 ? h4 === s3 || r2 + h4 === s3 ? n4 : t3 : h4 === s3 || h4 === r2 + s3 ? n4 : t3; - } - } - return t3; - } - } - var n3; - return function(t4, e5, i5) { - const n4 = e5 === 1 / 0; - switch (i5.infinity.toLowerCase()) { - case "null": - return null; - case "infinity": - return e5; - case "string": - return n4 ? "Infinity" : "-Infinity"; - default: - return t4; - } - }(t3, Number(i4), e4); - }(t2, i3); - } - return t2 !== undefined ? t2 : ""; - } - function rt(t2, e2, i3) { - const n3 = Number.parseInt(t2, e2); - return n3 >= 0 && n3 <= 1114111 ? String.fromCodePoint(n3) : i3 + t2 + ";"; - } - function ot(t2, e2, i3, n3) { - if (t2) { - const n4 = t2(e2); - i3 === e2 && (i3 = n4), e2 = n4; - } - return { tagName: e2 = at2(e2, n3), tagExp: i3 }; - } - function at2(t2, e2) { - if (a2.includes(t2)) - throw new Error(`[SECURITY] Invalid name: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); - return o2.includes(t2) ? e2.onDangerousProperty(t2) : t2; - } - const ht = $2.getMetaDataSymbol(); - function lt2(t2, e2) { - if (!t2 || typeof t2 != "object") - return {}; - if (!e2) - return t2; - const i3 = {}; - for (const n3 in t2) - n3.startsWith(e2) ? i3[n3.substring(e2.length)] = t2[n3] : i3[n3] = t2[n3]; - return i3; - } - function pt(t2, e2, i3, n3) { - return ut(t2, e2, i3, n3); - } - function ut(t2, e2, i3, n3) { - let s2; - const r2 = {}; - for (let o3 = 0;o3 < t2.length; o3++) { - const a3 = t2[o3], h3 = ct(a3); - if (h3 !== undefined && h3 !== e2.textNodeName) { - const t3 = lt2(a3[":@"] || {}, e2.attributeNamePrefix); - i3.push(h3, t3); - } - if (h3 === e2.textNodeName) - s2 === undefined ? s2 = a3[h3] : s2 += "" + a3[h3]; - else { - if (h3 === undefined) - continue; - if (a3[h3]) { - let t3 = ut(a3[h3], e2, i3, n3); - const s3 = ft(t3, e2); - if (a3[":@"] ? dt(t3, a3[":@"], n3, e2) : Object.keys(t3).length !== 1 || t3[e2.textNodeName] === undefined || e2.alwaysCreateTextNode ? Object.keys(t3).length === 0 && (e2.alwaysCreateTextNode ? t3[e2.textNodeName] = "" : t3 = "") : t3 = t3[e2.textNodeName], a3[ht] !== undefined && typeof t3 == "object" && t3 !== null && (t3[ht] = a3[ht]), r2[h3] !== undefined && Object.prototype.hasOwnProperty.call(r2, h3)) - Array.isArray(r2[h3]) || (r2[h3] = [r2[h3]]), r2[h3].push(t3); - else { - const i4 = e2.jPath ? n3.toString() : n3; - e2.isArray(h3, i4, s3) ? r2[h3] = [t3] : r2[h3] = t3; - } - h3 !== undefined && h3 !== e2.textNodeName && i3.pop(); - } - } - } - return typeof s2 == "string" ? s2.length > 0 && (r2[e2.textNodeName] = s2) : s2 !== undefined && (r2[e2.textNodeName] = s2), r2; - } - function ct(t2) { - const e2 = Object.keys(t2); - for (let t3 = 0;t3 < e2.length; t3++) { - const i3 = e2[t3]; - if (i3 !== ":@") - return i3; - } - } - function dt(t2, e2, i3, n3) { - if (e2) { - const s2 = Object.keys(e2), r2 = s2.length; - for (let o3 = 0;o3 < r2; o3++) { - const r3 = s2[o3], a3 = r3.startsWith(n3.attributeNamePrefix) ? r3.substring(n3.attributeNamePrefix.length) : r3, h3 = n3.jPath ? i3.toString() + "." + a3 : i3; - n3.isArray(r3, h3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; - } - } - } - function ft(t2, e2) { - const { textNodeName: i3 } = e2, n3 = Object.keys(t2).length; - return n3 === 0 || !(n3 !== 1 || !t2[i3] && typeof t2[i3] != "boolean" && t2[i3] !== 0); - } - - class gt2 { - constructor(t2) { - this.externalEntities = {}, this.options = O(t2); - } - parse(t2, e2) { - if (typeof t2 != "string" && t2.toString) - t2 = t2.toString(); - else if (typeof t2 != "string") - throw new Error("XML data is accepted in String or Bytes[] form."); - if (e2) { - e2 === true && (e2 = {}); - const i4 = l(t2, e2); - if (i4 !== true) - throw Error(`${i4.err.msg}:${i4.err.line}:${i4.err.col}`); - } - const i3 = new W2(this.options); - i3.addExternalEntities(this.externalEntities); - const n3 = i3.parseXml(t2); - return this.options.preserveOrder || n3 === undefined ? n3 : pt(n3, this.options, i3.matcher, i3.readonlyMatcher); - } - addEntity(t2, e2) { - if (e2.indexOf("&") !== -1) - throw new Error("Entity value can't have '&'"); - if (t2.indexOf("&") !== -1 || t2.indexOf(";") !== -1) - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - if (e2 === "&") - throw new Error("An entity with value '&' is not permitted"); - this.externalEntities[t2] = e2; - } - static getMetaDataSymbol() { - return $2.getMetaDataSymbol(); - } - } - function mt(t2, e2) { - let i3 = ""; - e2.format && e2.indentBy.length > 0 && (i3 = ` -`); - const n3 = []; - if (e2.stopNodes && Array.isArray(e2.stopNodes)) - for (let t3 = 0;t3 < e2.stopNodes.length; t3++) { - const i4 = e2.stopNodes[t3]; - typeof i4 == "string" ? n3.push(new R2(i4)) : i4 instanceof R2 && n3.push(i4); - } - return xt(t2, e2, i3, new G3, n3); - } - function xt(t2, e2, i3, n3, s2) { - let r2 = "", o3 = false; - if (e2.maxNestedTags && n3.getDepth() > e2.maxNestedTags) - throw new Error("Maximum nested tags exceeded"); - if (!Array.isArray(t2)) { - if (t2 != null) { - let i4 = t2.toString(); - return i4 = Tt(i4, e2), i4; - } - return ""; - } - for (let a3 = 0;a3 < t2.length; a3++) { - const h3 = t2[a3], l2 = yt(h3); - if (l2 === undefined) - continue; - const p2 = Nt(h3[":@"], e2); - n3.push(l2, p2); - const u3 = vt(n3, s2); - if (l2 === e2.textNodeName) { - let t3 = h3[l2]; - u3 || (t3 = e2.tagValueProcessor(l2, t3), t3 = Tt(t3, e2)), o3 && (r2 += i3), r2 += t3, o3 = false, n3.pop(); - continue; - } - if (l2 === e2.cdataPropName) { - o3 && (r2 += i3), r2 += ``, o3 = false, n3.pop(); - continue; - } - if (l2 === e2.commentPropName) { - r2 += i3 + ``, o3 = true, n3.pop(); - continue; - } - if (l2[0] === "?") { - const t3 = wt(h3[":@"], e2, u3), s3 = l2 === "?xml" ? "" : i3; - let a4 = h3[l2][0][e2.textNodeName]; - a4 = a4.length !== 0 ? " " + a4 : "", r2 += s3 + `<${l2}${a4}${t3}?>`, o3 = true, n3.pop(); - continue; - } - let c6 = i3; - c6 !== "" && (c6 += e2.indentBy); - const d2 = i3 + `<${l2}${wt(h3[":@"], e2, u3)}`; - let f2; - f2 = u3 ? bt(h3[l2], e2) : xt(h3[l2], e2, c6, n3, s2), e2.unpairedTags.indexOf(l2) !== -1 ? e2.suppressUnpairedNode ? r2 += d2 + ">" : r2 += d2 + "/>" : f2 && f2.length !== 0 || !e2.suppressEmptyNode ? f2 && f2.endsWith(">") ? r2 += d2 + `>${f2}${i3}` : (r2 += d2 + ">", f2 && i3 !== "" && (f2.includes("/>") || f2.includes("`) : r2 += d2 + "/>", o3 = true, n3.pop(); - } - return r2; - } - function Nt(t2, e2) { - if (!t2 || e2.ignoreAttributes) - return null; - const i3 = {}; - let n3 = false; - for (let s2 in t2) - Object.prototype.hasOwnProperty.call(t2, s2) && (i3[s2.startsWith(e2.attributeNamePrefix) ? s2.substr(e2.attributeNamePrefix.length) : s2] = t2[s2], n3 = true); - return n3 ? i3 : null; - } - function bt(t2, e2) { - if (!Array.isArray(t2)) - return t2 != null ? t2.toString() : ""; - let i3 = ""; - for (let n3 = 0;n3 < t2.length; n3++) { - const s2 = t2[n3], r2 = yt(s2); - if (r2 === e2.textNodeName) - i3 += s2[r2]; - else if (r2 === e2.cdataPropName) - i3 += s2[r2][0][e2.textNodeName]; - else if (r2 === e2.commentPropName) - i3 += s2[r2][0][e2.textNodeName]; - else { - if (r2 && r2[0] === "?") - continue; - if (r2) { - const t3 = Et(s2[":@"], e2), n4 = bt(s2[r2], e2); - n4 && n4.length !== 0 ? i3 += `<${r2}${t3}>${n4}` : i3 += `<${r2}${t3}/>`; - } - } - } - return i3; - } - function Et(t2, e2) { - let i3 = ""; - if (t2 && !e2.ignoreAttributes) - for (let n3 in t2) { - if (!Object.prototype.hasOwnProperty.call(t2, n3)) - continue; - let s2 = t2[n3]; - s2 === true && e2.suppressBooleanAttributes ? i3 += ` ${n3.substr(e2.attributeNamePrefix.length)}` : i3 += ` ${n3.substr(e2.attributeNamePrefix.length)}="${s2}"`; - } - return i3; - } - function yt(t2) { - const e2 = Object.keys(t2); - for (let i3 = 0;i3 < e2.length; i3++) { - const n3 = e2[i3]; - if (Object.prototype.hasOwnProperty.call(t2, n3) && n3 !== ":@") - return n3; - } - } - function wt(t2, e2, i3) { - let n3 = ""; - if (t2 && !e2.ignoreAttributes) - for (let s2 in t2) { - if (!Object.prototype.hasOwnProperty.call(t2, s2)) - continue; - let r2; - i3 ? r2 = t2[s2] : (r2 = e2.attributeValueProcessor(s2, t2[s2]), r2 = Tt(r2, e2)), r2 === true && e2.suppressBooleanAttributes ? n3 += ` ${s2.substr(e2.attributeNamePrefix.length)}` : n3 += ` ${s2.substr(e2.attributeNamePrefix.length)}="${r2}"`; - } - return n3; - } - function vt(t2, e2) { - if (!e2 || e2.length === 0) - return false; - for (let i3 = 0;i3 < e2.length; i3++) - if (t2.matches(e2[i3])) - return true; - return false; - } - function Tt(t2, e2) { - if (t2 && t2.length > 0 && e2.processEntities) - for (let i3 = 0;i3 < e2.entities.length; i3++) { - const n3 = e2.entities[i3]; - t2 = t2.replace(n3.regex, n3.val); - } - return t2; - } - const Pt = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e2) { - return e2; - }, attributeValueProcessor: function(t2, e2) { - return e2; - }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: true, stopNodes: [], oneListGroup: false, maxNestedTags: 100, jPath: true }; - function St(t2) { - if (this.options = Object.assign({}, Pt, t2), this.options.stopNodes && Array.isArray(this.options.stopNodes) && (this.options.stopNodes = this.options.stopNodes.map((t3) => typeof t3 == "string" && t3.startsWith("*.") ? ".." + t3.substring(2) : t3)), this.stopNodeExpressions = [], this.options.stopNodes && Array.isArray(this.options.stopNodes)) - for (let t3 = 0;t3 < this.options.stopNodes.length; t3++) { - const e3 = this.options.stopNodes[t3]; - typeof e3 == "string" ? this.stopNodeExpressions.push(new R2(e3)) : e3 instanceof R2 && this.stopNodeExpressions.push(e3); - } - var e2; - this.options.ignoreAttributes === true || this.options.attributesGroupName ? this.isAttribute = function() { - return false; - } : (this.ignoreAttributesFn = typeof (e2 = this.options.ignoreAttributes) == "function" ? e2 : Array.isArray(e2) ? (t3) => { - for (const i3 of e2) { - if (typeof i3 == "string" && t3 === i3) - return true; - if (i3 instanceof RegExp && i3.test(t3)) - return true; - } - } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Ct), this.processTextOrObjNode = At, this.options.format ? (this.indentate = Ot, this.tagEndChar = `> -`, this.newLine = ` -`) : (this.indentate = function() { - return ""; - }, this.tagEndChar = ">", this.newLine = ""); - } - function At(t2, e2, i3, n3) { - const s2 = this.extractAttributes(t2); - if (n3.push(e2, s2), this.checkStopNode(n3)) { - const s3 = this.buildRawContent(t2), r3 = this.buildAttributesForStopNode(t2); - return n3.pop(), this.buildObjectNode(s3, e2, r3, i3); - } - const r2 = this.j2x(t2, i3 + 1, n3); - return n3.pop(), t2[this.options.textNodeName] !== undefined && Object.keys(t2).length === 1 ? this.buildTextValNode(t2[this.options.textNodeName], e2, r2.attrStr, i3, n3) : this.buildObjectNode(r2.val, e2, r2.attrStr, i3); - } - function Ot(t2) { - return this.options.indentBy.repeat(t2); - } - function Ct(t2) { - return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); - } - St.prototype.build = function(t2) { - if (this.options.preserveOrder) - return mt(t2, this.options); - { - Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }); - const e2 = new G3; - return this.j2x(t2, 0, e2).val; - } - }, St.prototype.j2x = function(t2, e2, i3) { - let n3 = "", s2 = ""; - if (this.options.maxNestedTags && i3.getDepth() >= this.options.maxNestedTags) - throw new Error("Maximum nested tags exceeded"); - const r2 = this.options.jPath ? i3.toString() : i3, o3 = this.checkStopNode(i3); - for (let a3 in t2) - if (Object.prototype.hasOwnProperty.call(t2, a3)) - if (t2[a3] === undefined) - this.isAttribute(a3) && (s2 += ""); - else if (t2[a3] === null) - this.isAttribute(a3) || a3 === this.options.cdataPropName ? s2 += "" : a3[0] === "?" ? s2 += this.indentate(e2) + "<" + a3 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + a3 + "/" + this.tagEndChar; - else if (t2[a3] instanceof Date) - s2 += this.buildTextValNode(t2[a3], a3, "", e2, i3); - else if (typeof t2[a3] != "object") { - const h3 = this.isAttribute(a3); - if (h3 && !this.ignoreAttributesFn(h3, r2)) - n3 += this.buildAttrPairStr(h3, "" + t2[a3], o3); - else if (!h3) - if (a3 === this.options.textNodeName) { - let e3 = this.options.tagValueProcessor(a3, "" + t2[a3]); - s2 += this.replaceEntitiesValue(e3); - } else { - i3.push(a3); - const n4 = this.checkStopNode(i3); - if (i3.pop(), n4) { - const i4 = "" + t2[a3]; - s2 += i4 === "" ? this.indentate(e2) + "<" + a3 + this.closeTag(a3) + this.tagEndChar : this.indentate(e2) + "<" + a3 + ">" + i4 + "" + t4 + "${t3}`; - else if (typeof t3 == "object" && t3 !== null) { - const n4 = this.buildRawContent(t3), s2 = this.buildAttributesForStopNode(t3); - e2 += n4 === "" ? `<${i3}${s2}/>` : `<${i3}${s2}>${n4}`; - } - } else if (typeof n3 == "object" && n3 !== null) { - const t3 = this.buildRawContent(n3), s2 = this.buildAttributesForStopNode(n3); - e2 += t3 === "" ? `<${i3}${s2}/>` : `<${i3}${s2}>${t3}`; - } else - e2 += `<${i3}>${n3}`; - } - return e2; - }, St.prototype.buildAttributesForStopNode = function(t2) { - if (!t2 || typeof t2 != "object") - return ""; - let e2 = ""; - if (this.options.attributesGroupName && t2[this.options.attributesGroupName]) { - const i3 = t2[this.options.attributesGroupName]; - for (let t3 in i3) { - if (!Object.prototype.hasOwnProperty.call(i3, t3)) - continue; - const n3 = t3.startsWith(this.options.attributeNamePrefix) ? t3.substring(this.options.attributeNamePrefix.length) : t3, s2 = i3[t3]; - s2 === true && this.options.suppressBooleanAttributes ? e2 += " " + n3 : e2 += " " + n3 + '="' + s2 + '"'; - } - } else - for (let i3 in t2) { - if (!Object.prototype.hasOwnProperty.call(t2, i3)) - continue; - const n3 = this.isAttribute(i3); - if (n3) { - const s2 = t2[i3]; - s2 === true && this.options.suppressBooleanAttributes ? e2 += " " + n3 : e2 += " " + n3 + '="' + s2 + '"'; - } - } - return e2; - }, St.prototype.buildObjectNode = function(t2, e2, i3, n3) { - if (t2 === "") - return e2[0] === "?" ? this.indentate(n3) + "<" + e2 + i3 + "?" + this.tagEndChar : this.indentate(n3) + "<" + e2 + i3 + this.closeTag(e2) + this.tagEndChar; - { - let s2 = "` + this.newLine : this.indentate(n3) + "<" + e2 + i3 + r2 + this.tagEndChar + t2 + this.indentate(n3) + s2 : this.indentate(n3) + "<" + e2 + i3 + r2 + ">" + t2 + s2; - } - }, St.prototype.closeTag = function(t2) { - let e2 = ""; - return this.options.unpairedTags.indexOf(t2) !== -1 ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; - if (this.options.commentPropName !== false && e2 === this.options.commentPropName) - return this.indentate(n3) + `` + this.newLine; - if (e2[0] === "?") - return this.indentate(n3) + "<" + e2 + i3 + "?" + this.tagEndChar; - { - let s3 = this.options.tagValueProcessor(e2, t2); - return s3 = this.replaceEntitiesValue(s3), s3 === "" ? this.indentate(n3) + "<" + e2 + i3 + this.closeTag(e2) + this.tagEndChar : this.indentate(n3) + "<" + e2 + i3 + ">" + s3 + " 0 && this.options.processEntities) - for (let e2 = 0;e2 < this.options.entities.length; e2++) { - const i3 = this.options.entities[e2]; - t2 = t2.replace(i3.regex, i3.val); - } - return t2; - }; - const $t = St, It = { validate: l }; - module.exports = e; - })(); -}); - -// ../node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js -var require_xml_parser2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp2(); - var parser = new fast_xml_parser_1.XMLParser({ - attributeNamePrefix: "", - htmlEntities: true, - ignoreAttributes: false, - ignoreDeclaration: true, - parseTagValue: false, - trimValues: false, - tagValueProcessor: (_, val) => val.trim() === "" && val.includes(` -`) ? "" : undefined - }); - parser.addEntity("#xD", "\r"); - parser.addEntity("#10", ` -`); - function parseXML(xmlString) { - return parser.parse(xmlString, true); - } -}); - -// ../node_modules/@aws-sdk/xml-builder/dist-cjs/index.js -var require_dist_cjs82 = __commonJS((exports) => { - var xmlParser = require_xml_parser2(); - function escapeAttribute(value) { - return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); - } - function escapeElement(value) { - return value.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(//g, ">").replace(/\r/g, " ").replace(/\n/g, " ").replace(/\u0085/g, "…").replace(/\u2028/, "
"); - } - - class XmlText { - value; - constructor(value) { - this.value = value; - } - toString() { - return escapeElement("" + this.value); - } - } - - class XmlNode { - name; - children; - attributes = {}; - static of(name, childText, withName) { - const node = new XmlNode(name); - if (childText !== undefined) { - node.addChildNode(new XmlText(childText)); - } - if (withName !== undefined) { - node.withName(withName); - } - return node; - } - constructor(name, children2 = []) { - this.name = name; - this.children = children2; - } - withName(name) { - this.name = name; - return this; - } - addAttribute(name, value) { - this.attributes[name] = value; - return this; - } - addChildNode(child) { - this.children.push(child); - return this; - } - removeAttribute(name) { - delete this.attributes[name]; - return this; - } - n(name) { - this.name = name; - return this; - } - c(child) { - this.children.push(child); - return this; - } - a(name, value) { - if (value != null) { - this.attributes[name] = value; - } - return this; - } - cc(input, field, withName = field) { - if (input[field] != null) { - const node = XmlNode.of(field, input[field]).withName(withName); - this.c(node); - } - } - l(input, listName, memberName, valueProvider) { - if (input[listName] != null) { - const nodes = valueProvider(); - nodes.map((node) => { - node.withName(memberName); - this.c(node); - }); - } - } - lc(input, listName, memberName, valueProvider) { - if (input[listName] != null) { - const nodes = valueProvider(); - const containerNode = new XmlNode(memberName); - nodes.map((node) => { - containerNode.c(node); - }); - this.c(containerNode); - } - } - toString() { - const hasChildren = Boolean(this.children.length); - let xmlText = `<${this.name}`; - const attributes = this.attributes; - for (const attributeName of Object.keys(attributes)) { - const attribute = attributes[attributeName]; - if (attribute != null) { - xmlText += ` ${attributeName}="${escapeAttribute("" + attribute)}"`; - } - } - return xmlText += !hasChildren ? "/>" : `>${this.children.map((c5) => c5.toString()).join("")}`; - } - } - Object.defineProperty(exports, "parseXML", { - enumerable: true, - get: function() { - return xmlParser.parseXML; - } - }); - exports.XmlNode = XmlNode; - exports.XmlText = XmlText; -}); - -// ../node_modules/@aws-sdk/core/dist-cjs/index.js -var require_dist_cjs83 = __commonJS((exports) => { - var protocolHttp = require_dist_cjs56(); - var core2 = require_dist_cjs71(); - var propertyProvider = require_dist_cjs76(); - var client = require_client3(); - var signatureV4 = require_dist_cjs78(); - var cbor = require_cbor2(); - var schema = require_schema2(); - var smithyClient = require_dist_cjs81(); - var protocols = require_protocols3(); - var serde = require_serde2(); - var utilBase64 = require_dist_cjs65(); - var utilUtf8 = require_dist_cjs64(); - var xmlBuilder = require_dist_cjs82(); - var state = { - warningEmitted: false - }; - var emitWarningIfUnsupportedVersion = (version2) => { - if (version2 && !state.warningEmitted && parseInt(version2.substring(1, version2.indexOf("."))) < 18) { - state.warningEmitted = true; - process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will -no longer support Node.js 16.x on January 6, 2025. - -To continue receiving updates to AWS services, bug fixes, and security -updates please upgrade to a supported Node.js LTS version. - -More information can be found at: https://a.co/74kJMmI`); - } - }; - function setCredentialFeature(credentials, feature2, value) { - if (!credentials.$source) { - credentials.$source = {}; - } - credentials.$source[feature2] = value; - return credentials; - } - function setFeature(context, feature2, value) { - if (!context.__aws_sdk_context) { - context.__aws_sdk_context = { - features: {} - }; - } else if (!context.__aws_sdk_context.features) { - context.__aws_sdk_context.features = {}; - } - context.__aws_sdk_context.features[feature2] = value; - } - function setTokenFeature(token, feature2, value) { - if (!token.$source) { - token.$source = {}; - } - token.$source[feature2] = value; - return token; - } - var getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined; - var getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); - var isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000; - var getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { - const clockTimeInMs = Date.parse(clockTime); - if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { - return clockTimeInMs - Date.now(); - } - return currentSystemClockOffset; - }; - var throwSigningPropertyError = (name, property2) => { - if (!property2) { - throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); - } - return property2; - }; - var validateSigningProperties = async (signingProperties) => { - const context = throwSigningPropertyError("context", signingProperties.context); - const config2 = throwSigningPropertyError("config", signingProperties.config); - const authScheme = context.endpointV2?.properties?.authSchemes?.[0]; - const signerFunction = throwSigningPropertyError("signer", config2.signer); - const signer = await signerFunction(authScheme); - const signingRegion = signingProperties?.signingRegion; - const signingRegionSet = signingProperties?.signingRegionSet; - const signingName = signingProperties?.signingName; - return { - config: config2, - signer, - signingRegion, - signingRegionSet, - signingName - }; - }; - - class AwsSdkSigV4Signer { - async sign(httpRequest, identity4, signingProperties) { - if (!protocolHttp.HttpRequest.isInstance(httpRequest)) { - throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); - } - const validatedProps = await validateSigningProperties(signingProperties); - const { config: config2, signer } = validatedProps; - let { signingRegion, signingName } = validatedProps; - const handlerExecutionContext = signingProperties.context; - if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) { - const [first, second] = handlerExecutionContext.authSchemes; - if (first?.name === "sigv4a" && second?.name === "sigv4") { - signingRegion = second?.signingRegion ?? signingRegion; - signingName = second?.signingName ?? signingName; - } - } - const signedRequest = await signer.sign(httpRequest, { - signingDate: getSkewCorrectedDate(config2.systemClockOffset), - signingRegion, - signingService: signingName - }); - return signedRequest; - } - errorHandler(signingProperties) { - return (error41) => { - const serverTime = error41.ServerTime ?? getDateHeader(error41.$response); - if (serverTime) { - const config2 = throwSigningPropertyError("config", signingProperties.config); - const initialSystemClockOffset = config2.systemClockOffset; - config2.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config2.systemClockOffset); - const clockSkewCorrected = config2.systemClockOffset !== initialSystemClockOffset; - if (clockSkewCorrected && error41.$metadata) { - error41.$metadata.clockSkewCorrected = true; - } - } - throw error41; - }; - } - successHandler(httpResponse, signingProperties) { - const dateHeader = getDateHeader(httpResponse); - if (dateHeader) { - const config2 = throwSigningPropertyError("config", signingProperties.config); - config2.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config2.systemClockOffset); - } - } - } - var AWSSDKSigV4Signer = AwsSdkSigV4Signer; - - class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer { - async sign(httpRequest, identity4, signingProperties) { - if (!protocolHttp.HttpRequest.isInstance(httpRequest)) { - throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); - } - const { config: config2, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties); - const configResolvedSigningRegionSet = await config2.sigv4aSigningRegionSet?.(); - const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(","); - const signedRequest = await signer.sign(httpRequest, { - signingDate: getSkewCorrectedDate(config2.systemClockOffset), - signingRegion: multiRegionOverride, - signingService: signingName - }); - return signedRequest; - } - } - var getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; - var getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; - var NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; - var NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; - var NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { - environmentVariableSelector: (env4, options) => { - if (options?.signingName) { - const bearerTokenKey = getBearerTokenEnvKey(options.signingName); - if (bearerTokenKey in env4) - return ["httpBearerAuth"]; - } - if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env4)) - return; - return getArrayForCommaSeparatedString(env4[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); - }, - configFileSelector: (profile) => { - if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) - return; - return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); - }, - default: [] - }; - var resolveAwsSdkSigV4AConfig = (config2) => { - config2.sigv4aSigningRegionSet = core2.normalizeProvider(config2.sigv4aSigningRegionSet); - return config2; - }; - var NODE_SIGV4A_CONFIG_OPTIONS = { - environmentVariableSelector(env4) { - if (env4.AWS_SIGV4A_SIGNING_REGION_SET) { - return env4.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim()); - } - throw new propertyProvider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", { - tryNextLink: true - }); - }, - configFileSelector(profile) { - if (profile.sigv4a_signing_region_set) { - return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim()); - } - throw new propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", { - tryNextLink: true - }); - }, - default: undefined - }; - var resolveAwsSdkSigV4Config = (config2) => { - let inputCredentials = config2.credentials; - let isUserSupplied = !!config2.credentials; - let resolvedCredentials = undefined; - Object.defineProperty(config2, "credentials", { - set(credentials) { - if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { - isUserSupplied = true; - } - inputCredentials = credentials; - const memoizedProvider = normalizeCredentialProvider(config2, { - credentials: inputCredentials, - credentialDefaultProvider: config2.credentialDefaultProvider - }); - const boundProvider = bindCallerConfig(config2, memoizedProvider); - if (isUserSupplied && !boundProvider.attributed) { - resolvedCredentials = async (options) => boundProvider(options).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_CODE", "e")); - resolvedCredentials.memoized = boundProvider.memoized; - resolvedCredentials.configBound = boundProvider.configBound; - resolvedCredentials.attributed = true; - } else { - resolvedCredentials = boundProvider; - } - }, - get() { - return resolvedCredentials; - }, - enumerable: true, - configurable: true - }); - config2.credentials = inputCredentials; - const { signingEscapePath = true, systemClockOffset = config2.systemClockOffset || 0, sha256 } = config2; - let signer; - if (config2.signer) { - signer = core2.normalizeProvider(config2.signer); - } else if (config2.regionInfoProvider) { - signer = () => core2.normalizeProvider(config2.region)().then(async (region) => [ - await config2.regionInfoProvider(region, { - useFipsEndpoint: await config2.useFipsEndpoint(), - useDualstackEndpoint: await config2.useDualstackEndpoint() - }) || {}, - region - ]).then(([regionInfo, region]) => { - const { signingRegion, signingService } = regionInfo; - config2.signingRegion = config2.signingRegion || signingRegion || region; - config2.signingName = config2.signingName || signingService || config2.serviceId; - const params = { - ...config2, - credentials: config2.credentials, - region: config2.signingRegion, - service: config2.signingName, - sha256, - uriEscapePath: signingEscapePath - }; - const SignerCtor = config2.signerConstructor || signatureV4.SignatureV4; - return new SignerCtor(params); - }); - } else { - signer = async (authScheme) => { - authScheme = Object.assign({}, { - name: "sigv4", - signingName: config2.signingName || config2.defaultSigningName, - signingRegion: await core2.normalizeProvider(config2.region)(), - properties: {} - }, authScheme); - const signingRegion = authScheme.signingRegion; - const signingService = authScheme.signingName; - config2.signingRegion = config2.signingRegion || signingRegion; - config2.signingName = config2.signingName || signingService || config2.serviceId; - const params = { - ...config2, - credentials: config2.credentials, - region: config2.signingRegion, - service: config2.signingName, - sha256, - uriEscapePath: signingEscapePath - }; - const SignerCtor = config2.signerConstructor || signatureV4.SignatureV4; - return new SignerCtor(params); - }; - } - const resolvedConfig = Object.assign(config2, { - systemClockOffset, - signingEscapePath, - signer - }); - return resolvedConfig; - }; - var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; - function normalizeCredentialProvider(config2, { credentials, credentialDefaultProvider }) { - let credentialsProvider; - if (credentials) { - if (!credentials?.memoized) { - credentialsProvider = core2.memoizeIdentityProvider(credentials, core2.isIdentityExpired, core2.doesIdentityRequireRefresh); - } else { - credentialsProvider = credentials; - } - } else { - if (credentialDefaultProvider) { - credentialsProvider = core2.normalizeProvider(credentialDefaultProvider(Object.assign({}, config2, { - parentClientConfig: config2 - }))); - } 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(config2, credentialsProvider) { - if (credentialsProvider.configBound) { - return credentialsProvider; - } - const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config2 }); - fn.memoized = credentialsProvider.memoized; - fn.configBound = true; - return fn; - } - - class ProtocolLib { - queryCompat; - constructor(queryCompat = false) { - this.queryCompat = queryCompat; - } - resolveRestContentType(defaultContentType, inputSchema) { - const members = inputSchema.getMemberSchemas(); - const httpPayloadMember = Object.values(members).find((m) => { - return !!m.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((m) => { - const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m.getMergedTraits(); - const noPrefixHeaders = httpPrefixHeaders === undefined; - return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders; - }); - if (hasBody) { - return defaultContentType; - } - } - } - async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) { - let namespace = defaultNamespace; - let errorName = errorIdentifier; - if (errorIdentifier.includes("#")) { - [namespace, errorName] = errorIdentifier.split("#"); - } - const errorMetadata = { - $metadata: metadata, - $fault: response.statusCode < 500 ? "client" : "server" - }; - const registry2 = schema.TypeRegistry.for(namespace); - try { - const errorSchema = getErrorSchema?.(registry2, errorName) ?? registry2.getSchema(errorIdentifier); - return { errorSchema, errorMetadata }; - } catch (e) { - dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError"; - const synthetic = schema.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 error41 = smithyClient.decorateServiceException(exception, additions); - if (msg) { - error41.Message = msg; - error41.message = msg; - } - return error41; - } - return smithyClient.decorateServiceException(exception, additions); - } - setQueryCompatError(output, response) { - const queryErrorHeader = response.headers?.["x-amzn-query-error"]; - if (output !== undefined && queryErrorHeader != null) { - const [Code, Type] = queryErrorHeader.split(";"); - const entries = Object.entries(output); - const Error2 = { - Code, - Type - }; - Object.assign(output, Error2); - for (const [k, v] of entries) { - Error2[k] = v; - } - 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; - } - } - } - - class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol { - awsQueryCompatible; - mixin; - constructor({ defaultNamespace, awsQueryCompatible }) { - super({ defaultNamespace }); - this.awsQueryCompatible = !!awsQueryCompatible; - this.mixin = new ProtocolLib(this.awsQueryCompatible); - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - if (this.awsQueryCompatible) { - request.headers["x-amzn-query-mode"] = "true"; - } - return request; - } - async handleError(operationSchema, context, response, dataObject, metadata) { - if (this.awsQueryCompatible) { - this.mixin.setQueryCompatError(dataObject, response); - } - const errorName = cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - const output = {}; - for (const [name, member] of ns.structIterator()) { - output[name] = this.deserializer.readValue(member, dataObject[name]); - } - if (this.awsQueryCompatible) { - this.mixin.queryCompatOutput(dataObject, output); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - } - var _toStr = (val) => { - if (val == null) { - return val; - } - if (typeof val === "number" || typeof val === "bigint") { - const warning = new Error(`Received number ${val} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); - return String(val); - } - if (typeof val === "boolean") { - const warning = new Error(`Received boolean ${val} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); - return String(val); - } - return val; - }; - var _toBool = (val) => { - if (val == null) { - return val; - } - if (typeof val === "string") { - const lowercase2 = val.toLowerCase(); - if (val !== "" && lowercase2 !== "false" && lowercase2 !== "true") { - const warning = new Error(`Received string "${val}" where a boolean was expected.`); - warning.name = "Warning"; - console.warn(warning); - } - return val !== "" && lowercase2 !== "false"; - } - return val; - }; - var _toNum = (val) => { - if (val == null) { - return val; - } - if (typeof val === "string") { - const num = Number(val); - if (num.toString() !== val) { - const warning = new Error(`Received string "${val}" where a number was expected.`); - warning.name = "Warning"; - console.warn(warning); - return val; - } - return num; - } - return val; - }; - - class SerdeContextConfig { - serdeContext; - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - } - } - function jsonReviver(key, value, context) { - if (context?.source) { - const numericString = context.source; - if (typeof value === "number") { - if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) { - const isFractional = numericString.includes("."); - if (isFractional) { - return new serde.NumericValue(numericString, "bigDecimal"); - } else { - return BigInt(numericString); - } - } - } - } - return value; - } - var collectBodyString = (streamBody, context) => smithyClient.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? utilUtf8.toUtf8)(body)); - var parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - try { - return JSON.parse(encoded); - } catch (e) { - if (e?.name === "SyntaxError") { - Object.defineProperty(e, "$responseBodyText", { - value: encoded - }); - } - throw e; - } - } - return {}; - }); - var parseJsonErrorBody = async (errorBody, context) => { - const value = await parseJsonBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; - }; - var loadRestJsonErrorCode = (output, data) => { - const findKey3 = (object2, key) => Object.keys(object2).find((k) => k.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]; - } - return cleanValue; - }; - const headerKey = findKey3(output.headers, "x-amzn-errortype"); - if (headerKey !== undefined) { - return sanitizeErrorCode(output.headers[headerKey]); - } - if (data && typeof data === "object") { - const codeKey = findKey3(data, "code"); - if (codeKey && data[codeKey] !== undefined) { - return sanitizeErrorCode(data[codeKey]); - } - if (data["__type"] !== undefined) { - return sanitizeErrorCode(data["__type"]); - } - } - }; - - class JsonShapeDeserializer extends SerdeContextConfig { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - async read(schema2, data) { - return this._read(schema2, typeof data === "string" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext)); - } - readObject(schema2, data) { - return this._read(schema2, data); - } - _read(schema$1, value) { - const isObject5 = value !== null && typeof value === "object"; - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isListSchema() && Array.isArray(value)) { - const listMember = ns.getValueSchema(); - const out = []; - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._read(listMember, item)); - } - } - return out; - } else if (ns.isMapSchema() && isObject5) { - const mapMember = ns.getValueSchema(); - const out = {}; - const sparse = !!ns.getMergedTraits().sparse; - for (const [_k, _v] of Object.entries(value)) { - if (sparse || _v != null) { - out[_k] = this._read(mapMember, _v); - } - } - return out; - } else if (ns.isStructSchema() && isObject5) { - const out = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - const fromKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName; - const deserializedValue = this._read(memberSchema, value[fromKey]); - if (deserializedValue != null) { - out[memberName] = deserializedValue; - } - } - return out; - } - if (ns.isBlobSchema() && typeof value === "string") { - return utilBase64.fromBase64(value); - } - const mediaType = ns.getMergedTraits().mediaType; - if (ns.isStringSchema() && typeof value === "string" && mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - return serde.LazyJsonString.from(value); - } - } - if (ns.isTimestampSchema() && value != null) { - const format3 = protocols.determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - return serde.parseRfc3339DateTimeWithOffset(value); - case 6: - return serde.parseRfc7231DateTime(value); - case 7: - return serde.parseEpochTimestamp(value); - default: - console.warn("Missing timestamp format, parsing value with Date constructor:", value); - return new Date(value); - } - } - if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) { - return BigInt(value); - } - if (ns.isBigDecimalSchema() && value != null) { - if (value instanceof serde.NumericValue) { - return value; - } - const untyped = value; - if (untyped.type === "bigDecimal" && "string" in untyped) { - return new serde.NumericValue(untyped.string, untyped.type); - } - return new serde.NumericValue(String(value), "bigDecimal"); - } - if (ns.isNumericSchema() && typeof value === "string") { - switch (value) { - case "Infinity": - return Infinity; - case "-Infinity": - return -Infinity; - case "NaN": - return NaN; - } - } - if (ns.isDocumentSchema()) { - if (isObject5) { - const out = Array.isArray(value) ? [] : {}; - for (const [k, v] of Object.entries(value)) { - if (v instanceof serde.NumericValue) { - out[k] = v; - } else { - out[k] = this._read(ns, v); - } - } - return out; - } else { - return structuredClone(value); - } - } - return value; - } - } - var NUMERIC_CONTROL_CHAR = String.fromCharCode(925); - - class JsonReplacer { - values = 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 serde.NumericValue) { - const v = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string; - this.values.set(`"${v}"`, value.string); - return v; - } - if (typeof value === "bigint") { - const s = value.toString(); - const v = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s; - this.values.set(`"${v}"`, s); - return v; - } - return value; - }; - } - replaceInJson(json2) { - 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 json2; - } - for (const [key, value] of this.values) { - json2 = json2.replace(key, value); - } - return json2; - } - } - - class JsonShapeSerializer extends SerdeContextConfig { - settings; - buffer; - rootSchema; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema$1, value) { - this.rootSchema = schema.NormalizedSchema.of(schema$1); - this.buffer = this._write(this.rootSchema, value); - } - writeDiscriminatedDocument(schema$1, value) { - this.write(schema$1, value); - if (typeof this.buffer === "object") { - this.buffer.__type = schema.NormalizedSchema.of(schema$1).getName(true); - } - } - flush() { - const { rootSchema } = this; - this.rootSchema = undefined; - if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) { - const replacer = new JsonReplacer; - return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0)); - } - return this.buffer; - } - _write(schema$1, value, container) { - const isObject5 = value !== null && typeof value === "object"; - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isListSchema() && Array.isArray(value)) { - const listMember = ns.getValueSchema(); - const out = []; - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._write(listMember, item)); - } - } - return out; - } else if (ns.isMapSchema() && isObject5) { - const mapMember = ns.getValueSchema(); - const out = {}; - const sparse = !!ns.getMergedTraits().sparse; - for (const [_k, _v] of Object.entries(value)) { - if (sparse || _v != null) { - out[_k] = this._write(mapMember, _v); - } - } - return out; - } else if (ns.isStructSchema() && isObject5) { - const out = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName; - const serializableValue = this._write(memberSchema, value[memberName], ns); - if (serializableValue !== undefined) { - out[targetKey] = serializableValue; - } - } - return out; - } - if (value === null && container?.isStructSchema()) { - return; - } - if (ns.isBlobSchema() && (value instanceof Uint8Array || typeof value === "string") || ns.isDocumentSchema() && value instanceof Uint8Array) { - if (ns === this.rootSchema) { - return value; - } - return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - } - if ((ns.isTimestampSchema() || ns.isDocumentSchema()) && value instanceof Date) { - const format3 = protocols.determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - return value.toISOString().replace(".000Z", "Z"); - case 6: - return serde.dateToUtcString(value); - case 7: - return value.getTime() / 1000; - default: - console.warn("Missing timestamp format, using epoch seconds", value); - return value.getTime() / 1000; - } - } - if (ns.isNumericSchema() && typeof value === "number") { - if (Math.abs(value) === Infinity || isNaN(value)) { - return String(value); - } - } - if (ns.isStringSchema()) { - if (typeof value === "undefined" && ns.isIdempotencyToken()) { - return serde.generateIdempotencyToken(); - } - const mediaType = ns.getMergedTraits().mediaType; - if (value != null && mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - return serde.LazyJsonString.from(value); - } - } - } - if (ns.isDocumentSchema()) { - if (isObject5) { - const out = Array.isArray(value) ? [] : {}; - for (const [k, v] of Object.entries(value)) { - if (v instanceof serde.NumericValue) { - out[k] = v; - } else { - out[k] = this._write(ns, v); - } - } - return out; - } else { - return structuredClone(value); - } - } - return value; - } - } - - class JsonCodec 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; - } - } - - class AwsJsonRpcProtocol extends protocols.RpcProtocol { - serializer; - deserializer; - serviceTarget; - codec; - mixin; - awsQueryCompatible; - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible }) { - super({ - defaultNamespace - }); - this.serviceTarget = serviceTarget; - this.codec = new JsonCodec({ - timestampFormat: { - useTrait: true, - default: 7 - }, - jsonName: false - }); - this.serializer = this.codec.createSerializer(); - this.deserializer = this.codec.createDeserializer(); - this.awsQueryCompatible = !!awsQueryCompatible; - this.mixin = new ProtocolLib(this.awsQueryCompatible); - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - if (!request.path.endsWith("/")) { - request.path += "/"; - } - Object.assign(request.headers, { - "content-type": `application/x-amz-json-${this.getJsonRpcVersion()}`, - "x-amz-target": `${this.serviceTarget}.${operationSchema.name}` - }); - if (this.awsQueryCompatible) { - request.headers["x-amzn-query-mode"] = "true"; - } - if (schema.deref(operationSchema.input) === "unit" || !request.body) { - request.body = "{}"; - } - return request; - } - getPayloadCodec() { - return this.codec; - } - async handleError(operationSchema, context, response, dataObject, metadata) { - if (this.awsQueryCompatible) { - this.mixin.setQueryCompatError(dataObject, response); - } - const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().jsonName ?? name; - output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]); - } - if (this.awsQueryCompatible) { - this.mixin.queryCompatOutput(dataObject, output); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - } - - class AwsJson1_0Protocol extends AwsJsonRpcProtocol { - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible }) { - super({ - defaultNamespace, - serviceTarget, - awsQueryCompatible - }); - } - getShapeId() { - return "aws.protocols#awsJson1_0"; - } - getJsonRpcVersion() { - return "1.0"; - } - getDefaultContentType() { - return "application/x-amz-json-1.0"; - } - } - - class AwsJson1_1Protocol extends AwsJsonRpcProtocol { - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible }) { - super({ - defaultNamespace, - serviceTarget, - awsQueryCompatible - }); - } - getShapeId() { - return "aws.protocols#awsJson1_1"; - } - getJsonRpcVersion() { - return "1.1"; - } - getDefaultContentType() { - return "application/x-amz-json-1.1"; - } - } - - class AwsRestJsonProtocol extends protocols.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 protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); - this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); - } - getShapeId() { - return "aws.protocols#restJson1"; - } - getPayloadCodec() { - return this.codec; - } - setSerdeContext(serdeContext) { - this.codec.setSerdeContext(serdeContext); - super.setSerdeContext(serdeContext); - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - const inputSchema = schema.NormalizedSchema.of(operationSchema.input); - if (!request.headers["content-type"]) { - const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); - if (contentType) { - request.headers["content-type"] = contentType; - } - } - if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) { - request.body = "{}"; - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - const output = await super.deserializeResponse(operationSchema, context, response); - const outputSchema = schema.NormalizedSchema.of(operationSchema.output); - for (const [name, member] of outputSchema.structIterator()) { - if (member.getMemberTraits().httpPayload && !(name in output)) { - output[name] = null; - } - } - return output; - } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - await this.deserializeHttpMessage(errorSchema, context, response, dataObject); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().jsonName ?? name; - output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - getDefaultContentType() { - return "application/json"; - } - } - var awsExpectUnion = (value) => { - if (value == null) { - return; - } - if (typeof value === "object" && "__type" in value) { - delete value.__type; - } - return smithyClient.expectUnion(value); - }; - - class XmlShapeDeserializer extends SerdeContextConfig { - settings; - stringDeserializer; - constructor(settings) { - super(); - this.settings = settings; - this.stringDeserializer = new protocols.FromStringShapeDeserializer(settings); - } - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - this.stringDeserializer.setSerdeContext(serdeContext); - } - read(schema$1, bytes, key) { - const ns = schema.NormalizedSchema.of(schema$1); - const memberSchemas = ns.getMemberSchemas(); - const isEventPayload = ns.isStructSchema() && ns.isMemberSchema() && !!Object.values(memberSchemas).find((memberNs) => { - return !!memberNs.getMemberTraits().eventPayload; - }); - if (isEventPayload) { - const output = {}; - const memberName = Object.keys(memberSchemas)[0]; - const eventMemberSchema = memberSchemas[memberName]; - if (eventMemberSchema.isBlobSchema()) { - output[memberName] = bytes; - } else { - output[memberName] = this.read(memberSchemas[memberName], bytes); - } - return output; - } - const xmlString = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(bytes); - const parsedObject = this.parseXml(xmlString); - return this.readSchema(schema$1, key ? parsedObject[key] : parsedObject); - } - readSchema(_schema, value) { - const ns = schema.NormalizedSchema.of(_schema); - if (ns.isUnitSchema()) { - return; - } - const traits = ns.getMergedTraits(); - if (ns.isListSchema() && !Array.isArray(value)) { - return this.readSchema(ns, [value]); - } - if (value == null) { - return value; - } - if (typeof value === "object") { - const sparse = !!traits.sparse; - const flat = !!traits.xmlFlattened; - if (ns.isListSchema()) { - const listValue = ns.getValueSchema(); - const buffer2 = []; - const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; - const source = flat ? value : (value[0] ?? value)[sourceKey]; - const sourceArray = Array.isArray(source) ? source : [source]; - for (const v of sourceArray) { - if (v != null || sparse) { - buffer2.push(this.readSchema(listValue, v)); - } - } - return buffer2; - } - const buffer = {}; - if (ns.isMapSchema()) { - const keyNs = ns.getKeySchema(); - const memberNs = ns.getValueSchema(); - let entries; - if (flat) { - entries = Array.isArray(value) ? value : [value]; - } else { - entries = Array.isArray(value.entry) ? value.entry : [value.entry]; - } - const keyProperty = keyNs.getMergedTraits().xmlName ?? "key"; - const valueProperty = memberNs.getMergedTraits().xmlName ?? "value"; - for (const entry of entries) { - const key = entry[keyProperty]; - const value2 = entry[valueProperty]; - if (value2 != null || sparse) { - buffer[key] = this.readSchema(memberNs, value2); - } - } - return buffer; - } - if (ns.isStructSchema()) { - for (const [memberName, memberSchema] of ns.structIterator()) { - const memberTraits = memberSchema.getMergedTraits(); - const xmlObjectKey = !memberTraits.httpPayload ? memberSchema.getMemberTraits().xmlName ?? memberName : memberTraits.xmlName ?? memberSchema.getName(); - if (value[xmlObjectKey] != null) { - buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); - } - } - return buffer; - } - if (ns.isDocumentSchema()) { - return value; - } - throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`); - } - if (ns.isListSchema()) { - return []; - } - if (ns.isMapSchema() || ns.isStructSchema()) { - return {}; - } - return this.stringDeserializer.read(ns, value); - } - parseXml(xml) { - if (xml.length) { - let parsedObj; - try { - parsedObj = xmlBuilder.parseXML(xml); - } catch (e) { - if (e && typeof e === "object") { - Object.defineProperty(e, "$responseBodyText", { - value: xml - }); - } - throw e; - } - const textNodeName = "#text"; - const key = Object.keys(parsedObj)[0]; - const parsedObjToReturn = parsedObj[key]; - if (parsedObjToReturn[textNodeName]) { - parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; - delete parsedObjToReturn[textNodeName]; - } - return smithyClient.getValueFromTextNode(parsedObjToReturn); - } - return {}; - } - } - - class QueryShapeSerializer extends SerdeContextConfig { - settings; - buffer; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema$1, value, prefix = "") { - if (this.buffer === undefined) { - this.buffer = ""; - } - const ns = schema.NormalizedSchema.of(schema$1); - if (prefix && !prefix.endsWith(".")) { - prefix += "."; - } - if (ns.isBlobSchema()) { - if (typeof value === "string" || value instanceof Uint8Array) { - this.writeKey(prefix); - this.writeValue((this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value)); - } - } else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(String(value)); - } else if (ns.isIdempotencyToken()) { - this.writeKey(prefix); - this.writeValue(serde.generateIdempotencyToken()); - } - } else if (ns.isBigIntegerSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(String(value)); - } - } else if (ns.isBigDecimalSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(value instanceof serde.NumericValue ? value.string : String(value)); - } - } else if (ns.isTimestampSchema()) { - if (value instanceof Date) { - this.writeKey(prefix); - const format3 = protocols.determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - this.writeValue(value.toISOString().replace(".000Z", "Z")); - break; - case 6: - this.writeValue(smithyClient.dateToUtcString(value)); - break; - case 7: - this.writeValue(String(value.getTime() / 1000)); - break; - } - } - } else if (ns.isDocumentSchema()) { - throw new Error(`@aws-sdk/core/protocols - QuerySerializer unsupported document type ${ns.getName(true)}`); - } else if (ns.isListSchema()) { - if (Array.isArray(value)) { - if (value.length === 0) { - if (this.settings.serializeEmptyLists) { - this.writeKey(prefix); - this.writeValue(""); - } - } else { - const member = ns.getValueSchema(); - const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened; - let i2 = 1; - for (const item of value) { - if (item == null) { - continue; - } - const suffix = this.getKey("member", member.getMergedTraits().xmlName); - const key = flat ? `${prefix}${i2}` : `${prefix}${suffix}.${i2}`; - this.write(member, item, key); - ++i2; - } - } - } - } else if (ns.isMapSchema()) { - if (value && typeof value === "object") { - const keySchema = ns.getKeySchema(); - const memberSchema = ns.getValueSchema(); - const flat = ns.getMergedTraits().xmlFlattened; - let i2 = 1; - for (const [k, v] of Object.entries(value)) { - if (v == null) { - continue; - } - const keySuffix = this.getKey("key", keySchema.getMergedTraits().xmlName); - const key = flat ? `${prefix}${i2}.${keySuffix}` : `${prefix}entry.${i2}.${keySuffix}`; - const valueSuffix = this.getKey("value", memberSchema.getMergedTraits().xmlName); - const valueKey = flat ? `${prefix}${i2}.${valueSuffix}` : `${prefix}entry.${i2}.${valueSuffix}`; - this.write(keySchema, k, key); - this.write(memberSchema, v, valueKey); - ++i2; - } - } - } else if (ns.isStructSchema()) { - if (value && typeof value === "object") { - for (const [memberName, member] of ns.structIterator()) { - if (value[memberName] == null && !member.isIdempotencyToken()) { - continue; - } - const suffix = this.getKey(memberName, member.getMergedTraits().xmlName); - const key = `${prefix}${suffix}`; - this.write(member, value[memberName], key); - } - } - } else if (ns.isUnitSchema()) - ; - else { - throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`); - } - } - flush() { - if (this.buffer === undefined) { - throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer."); - } - const str = this.buffer; - delete this.buffer; - return str; - } - getKey(memberName, xmlName) { - const key = xmlName ?? memberName; - if (this.settings.capitalizeKeys) { - return key[0].toUpperCase() + key.slice(1); - } - return key; - } - writeKey(key) { - if (key.endsWith(".")) { - key = key.slice(0, key.length - 1); - } - this.buffer += `&${protocols.extendedEncodeURIComponent(key)}=`; - } - writeValue(value) { - this.buffer += protocols.extendedEncodeURIComponent(value); - } - } - - class AwsQueryProtocol extends protocols.RpcProtocol { - 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, context) { - const request = await super.serializeRequest(operationSchema, input, context); - if (!request.path.endsWith("/")) { - request.path += "/"; - } - Object.assign(request.headers, { - "content-type": `application/x-www-form-urlencoded` - }); - if (schema.deref(operationSchema.input) === "unit" || !request.body) { - request.body = ""; - } - const action = operationSchema.name.split("#")[1] ?? operationSchema.name; - request.body = `Action=${action}&Version=${this.options.version}` + request.body; - if (request.body.endsWith("&")) { - request.body = request.body.slice(-1); - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes2 = await protocols.collectBody(response.body, context); - if (bytes2.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes2)); - } - await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); - } - for (const header in response.headers) { - const value = response.headers[header]; - delete response.headers[header]; - response.headers[header.toLowerCase()] = value; - } - const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name; - const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : undefined; - const bytes = await protocols.collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey)); - } - const output = { - $metadata: this.deserializeMetadata(response), - ...dataObject - }; - return output; - } - useNestedResult() { - return true; - } - async handleError(operationSchema, context, response, dataObject, metadata) { - 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, metadata, (registry2, errorName) => { - try { - return registry2.getSchema(errorName); - } catch (e) { - return registry2.find((schema$1) => schema.NormalizedSchema.of(schema$1).getMergedTraits().awsQueryError?.[0] === errorName); - } - }); - const ns = schema.NormalizedSchema.of(errorSchema); - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - const output = { - Error: errorData.Error - }; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().xmlName ?? name; - const value = errorData[target] ?? dataObject[target]; - output[name] = this.deserializer.readSchema(member, value); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - loadQueryErrorCode(output, data) { - const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code; - if (code !== undefined) { - 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"; - } - } - - class AwsEc2QueryProtocol extends AwsQueryProtocol { - options; - constructor(options) { - super(options); - this.options = options; - const ec2Settings = { - capitalizeKeys: true, - flattenLists: true, - serializeEmptyLists: false - }; - Object.assign(this.serializer.settings, ec2Settings); - } - useNestedResult() { - return false; - } - } - var parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - let parsedObj; - try { - parsedObj = xmlBuilder.parseXML(encoded); - } catch (e) { - if (e && typeof e === "object") { - Object.defineProperty(e, "$responseBodyText", { - value: encoded - }); - } - throw e; - } - const textNodeName = "#text"; - const key = Object.keys(parsedObj)[0]; - const parsedObjToReturn = parsedObj[key]; - if (parsedObjToReturn[textNodeName]) { - parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; - delete parsedObjToReturn[textNodeName]; - } - return smithyClient.getValueFromTextNode(parsedObjToReturn); - } - return {}; - }); - var parseXmlErrorBody = async (errorBody, context) => { - const value = await parseXmlBody(errorBody, context); - if (value.Error) { - value.Error.message = value.Error.message ?? value.Error.Message; - } - return value; - }; - var loadRestXmlErrorCode = (output, data) => { - if (data?.Error?.Code !== undefined) { - return data.Error.Code; - } - if (data?.Code !== undefined) { - return data.Code; - } - if (output.statusCode == 404) { - return "NotFound"; - } - }; - - class XmlShapeSerializer extends SerdeContextConfig { - settings; - stringBuffer; - byteBuffer; - buffer; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema$1, value) { - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isStringSchema() && typeof value === "string") { - this.stringBuffer = value; - } else if (ns.isBlobSchema()) { - this.byteBuffer = "byteLength" in value ? value : (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value); - } else { - this.buffer = this.writeStruct(ns, value, undefined); - const traits = ns.getMergedTraits(); - if (traits.httpPayload && !traits.xmlName) { - this.buffer.withName(ns.getName()); - } - } - } - flush() { - if (this.byteBuffer !== undefined) { - const bytes = this.byteBuffer; - delete this.byteBuffer; - return bytes; - } - if (this.stringBuffer !== undefined) { - const str = this.stringBuffer; - delete this.stringBuffer; - return str; - } - const buffer = this.buffer; - if (this.settings.xmlNamespace) { - if (!buffer?.attributes?.["xmlns"]) { - buffer.addAttribute("xmlns", this.settings.xmlNamespace); - } - } - delete this.buffer; - return buffer.toString(); - } - writeStruct(ns, value, parentXmlns) { - const traits = ns.getMergedTraits(); - const name = ns.isMemberSchema() && !traits.httpPayload ? ns.getMemberTraits().xmlName ?? ns.getMemberName() : traits.xmlName ?? ns.getName(); - if (!name || !ns.isStructSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`); - } - const structXmlNode = xmlBuilder.XmlNode.of(name); - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); - for (const [memberName, memberSchema] of ns.structIterator()) { - const val = value[memberName]; - if (val != null || memberSchema.isIdempotencyToken()) { - if (memberSchema.getMergedTraits().xmlAttribute) { - structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val)); - continue; - } - if (memberSchema.isListSchema()) { - this.writeList(memberSchema, val, structXmlNode, xmlns); - } else if (memberSchema.isMapSchema()) { - this.writeMap(memberSchema, val, structXmlNode, xmlns); - } else if (memberSchema.isStructSchema()) { - structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns)); - } else { - const memberNode = xmlBuilder.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName()); - this.writeSimpleInto(memberSchema, val, memberNode, xmlns); - structXmlNode.addChildNode(memberNode); - } - } - } - if (xmlns) { - structXmlNode.addAttribute(xmlnsAttr, xmlns); - } - return structXmlNode; - } - writeList(listMember, array2, container, parentXmlns) { - if (!listMember.isMemberSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`); - } - const listTraits = listMember.getMergedTraits(); - const listValueSchema = listMember.getValueSchema(); - const listValueTraits = listValueSchema.getMergedTraits(); - const sparse = !!listValueTraits.sparse; - const flat = !!listTraits.xmlFlattened; - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns); - const writeItem = (container2, value) => { - if (listValueSchema.isListSchema()) { - this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container2, xmlns); - } else if (listValueSchema.isMapSchema()) { - this.writeMap(listValueSchema, value, container2, xmlns); - } else if (listValueSchema.isStructSchema()) { - const struct = this.writeStruct(listValueSchema, value, xmlns); - container2.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member")); - } else { - const listItemNode = xmlBuilder.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"); - this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns); - container2.addChildNode(listItemNode); - } - }; - if (flat) { - for (const value of array2) { - if (sparse || value != null) { - writeItem(container, value); - } - } - } else { - const listNode = xmlBuilder.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName()); - if (xmlns) { - listNode.addAttribute(xmlnsAttr, xmlns); - } - for (const value of array2) { - if (sparse || value != null) { - writeItem(listNode, value); - } - } - container.addChildNode(listNode); - } - } - writeMap(mapMember, map3, container, parentXmlns, containerIsMap = false) { - if (!mapMember.isMemberSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`); - } - const mapTraits = mapMember.getMergedTraits(); - const mapKeySchema = mapMember.getKeySchema(); - const mapKeyTraits = mapKeySchema.getMergedTraits(); - const keyTag = mapKeyTraits.xmlName ?? "key"; - const mapValueSchema = mapMember.getValueSchema(); - const mapValueTraits = mapValueSchema.getMergedTraits(); - const valueTag = mapValueTraits.xmlName ?? "value"; - const sparse = !!mapValueTraits.sparse; - const flat = !!mapTraits.xmlFlattened; - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns); - const addKeyValue = (entry, key, val) => { - const keyNode = xmlBuilder.XmlNode.of(keyTag, key); - const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns); - if (keyXmlns) { - keyNode.addAttribute(keyXmlnsAttr, keyXmlns); - } - entry.addChildNode(keyNode); - let valueNode = xmlBuilder.XmlNode.of(valueTag); - if (mapValueSchema.isListSchema()) { - this.writeList(mapValueSchema, val, valueNode, xmlns); - } else if (mapValueSchema.isMapSchema()) { - this.writeMap(mapValueSchema, val, valueNode, xmlns, true); - } else if (mapValueSchema.isStructSchema()) { - valueNode = this.writeStruct(mapValueSchema, val, xmlns); - } else { - this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns); - } - entry.addChildNode(valueNode); - }; - if (flat) { - for (const [key, val] of Object.entries(map3)) { - if (sparse || val != null) { - const entry = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); - addKeyValue(entry, key, val); - container.addChildNode(entry); - } - } - } else { - let mapNode2; - if (!containerIsMap) { - mapNode2 = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); - if (xmlns) { - mapNode2.addAttribute(xmlnsAttr, xmlns); - } - container.addChildNode(mapNode2); - } - for (const [key, val] of Object.entries(map3)) { - if (sparse || val != null) { - const entry = xmlBuilder.XmlNode.of("entry"); - addKeyValue(entry, key, val); - (containerIsMap ? container : mapNode2).addChildNode(entry); - } - } - } - } - writeSimple(_schema, value) { - if (value === null) { - throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value."); - } - const ns = schema.NormalizedSchema.of(_schema); - let nodeContents = null; - if (value && typeof value === "object") { - if (ns.isBlobSchema()) { - nodeContents = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - } else if (ns.isTimestampSchema() && value instanceof Date) { - const format3 = protocols.determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - nodeContents = value.toISOString().replace(".000Z", "Z"); - break; - case 6: - nodeContents = smithyClient.dateToUtcString(value); - break; - case 7: - nodeContents = String(value.getTime() / 1000); - break; - default: - console.warn("Missing timestamp format, using http date", value); - nodeContents = smithyClient.dateToUtcString(value); - break; - } - } else if (ns.isBigDecimalSchema() && value) { - if (value instanceof serde.NumericValue) { - return value.string; - } - return String(value); - } else if (ns.isMapSchema() || ns.isListSchema()) { - throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."); - } else { - throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`); - } - } - if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) { - nodeContents = String(value); - } - if (ns.isStringSchema()) { - if (value === undefined && ns.isIdempotencyToken()) { - nodeContents = serde.generateIdempotencyToken(); - } else { - nodeContents = String(value); - } - } - if (nodeContents === null) { - throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`); - } - return nodeContents; - } - writeSimpleInto(_schema, value, into, parentXmlns) { - const nodeContents = this.writeSimple(_schema, value); - const ns = schema.NormalizedSchema.of(_schema); - const content = new xmlBuilder.XmlText(nodeContents); - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); - if (xmlns) { - into.addAttribute(xmlnsAttr, xmlns); - } - into.addChildNode(content); - } - getXmlnsAttribute(ns, parentXmlns) { - const traits = ns.getMergedTraits(); - const [prefix, xmlns] = traits.xmlNamespace ?? []; - if (xmlns && xmlns !== parentXmlns) { - return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns]; - } - return [undefined, undefined]; - } - } - - class XmlCodec extends SerdeContextConfig { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - createSerializer() { - const serializer = new XmlShapeSerializer(this.settings); - serializer.setSerdeContext(this.serdeContext); - return serializer; - } - createDeserializer() { - const deserializer = new XmlShapeDeserializer(this.settings); - deserializer.setSerdeContext(this.serdeContext); - return deserializer; - } - } - - class AwsRestXmlProtocol extends protocols.HttpBindingProtocol { - codec; - serializer; - deserializer; - mixin = new ProtocolLib; - constructor(options) { - super(options); - const settings = { - timestampFormat: { - useTrait: true, - default: 5 - }, - httpBindings: true, - xmlNamespace: options.xmlNamespace, - serviceNamespace: options.defaultNamespace - }; - this.codec = new XmlCodec(settings); - this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); - this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); - } - getPayloadCodec() { - return this.codec; - } - getShapeId() { - return "aws.protocols#restXml"; - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - const inputSchema = schema.NormalizedSchema.of(operationSchema.input); - if (!request.headers["content-type"]) { - const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); - if (contentType) { - request.headers["content-type"] = contentType; - } - } - if (request.headers["content-type"] === this.getDefaultContentType()) { - if (typeof request.body === "string") { - request.body = '' + request.body; - } - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - return super.deserializeResponse(operationSchema, context, response); - } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - await this.deserializeHttpMessage(errorSchema, context, response, dataObject); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().xmlName ?? name; - const value = dataObject.Error?.[target] ?? dataObject[target]; - output[name] = this.codec.createDeserializer().readSchema(member, value); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - getDefaultContentType() { - return "application/xml"; - } - } - exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer; - exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol; - exports.AwsJson1_0Protocol = AwsJson1_0Protocol; - exports.AwsJson1_1Protocol = AwsJson1_1Protocol; - exports.AwsJsonRpcProtocol = AwsJsonRpcProtocol; - exports.AwsQueryProtocol = AwsQueryProtocol; - exports.AwsRestJsonProtocol = AwsRestJsonProtocol; - exports.AwsRestXmlProtocol = AwsRestXmlProtocol; - exports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner; - exports.AwsSdkSigV4Signer = AwsSdkSigV4Signer; - exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol; - exports.JsonCodec = JsonCodec; - exports.JsonShapeDeserializer = JsonShapeDeserializer; - exports.JsonShapeSerializer = JsonShapeSerializer; - exports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS; - exports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS; - exports.XmlCodec = XmlCodec; - exports.XmlShapeDeserializer = XmlShapeDeserializer; - exports.XmlShapeSerializer = XmlShapeSerializer; - exports._toBool = _toBool; - exports._toNum = _toNum; - exports._toStr = _toStr; - exports.awsExpectUnion = awsExpectUnion; - exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; - exports.getBearerTokenEnvKey = getBearerTokenEnvKey; - exports.loadRestJsonErrorCode = loadRestJsonErrorCode; - exports.loadRestXmlErrorCode = loadRestXmlErrorCode; - exports.parseJsonBody = parseJsonBody; - exports.parseJsonErrorBody = parseJsonErrorBody; - exports.parseXmlBody = parseXmlBody; - exports.parseXmlErrorBody = parseXmlErrorBody; - exports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config; - exports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig; - exports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config; - exports.setCredentialFeature = setCredentialFeature; - exports.setFeature = setFeature; - exports.setTokenFeature = setTokenFeature; - exports.state = state; - exports.validateSigningProperties = validateSigningProperties; -}); - -// ../node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js -var require_dist_cjs84 = __commonJS((exports) => { - var core2 = require_dist_cjs71(); - var utilEndpoints = require_dist_cjs75(); - var protocolHttp = require_dist_cjs56(); - var core$1 = require_dist_cjs83(); - var DEFAULT_UA_APP_ID = undefined; - function isValidUserAgentAppId(appId) { - if (appId === undefined) { - return true; - } - return typeof appId === "string" && appId.length <= 50; - } - function resolveUserAgentConfig(input) { - const normalizedAppIdProvider = core2.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID); - const { customUserAgent } = input; - return Object.assign(input, { - customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, - userAgentAppId: async () => { - const appId = await normalizedAppIdProvider(); - if (!isValidUserAgentAppId(appId)) { - const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; - if (typeof appId !== "string") { - logger?.warn("userAgentAppId must be a string or undefined."); - } else if (appId.length > 50) { - logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); - } - } - return appId; - } - }); - } - var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; - async function checkFeatures(context, config2, args) { - const request = args.request; - if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { - core$1.setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M"); - } - if (typeof config2.retryStrategy === "function") { - const retryStrategy = await config2.retryStrategy(); - if (typeof retryStrategy.acquireInitialRetryToken === "function") { - if (retryStrategy.constructor?.name?.includes("Adaptive")) { - core$1.setFeature(context, "RETRY_MODE_ADAPTIVE", "F"); - } else { - core$1.setFeature(context, "RETRY_MODE_STANDARD", "E"); - } - } else { - core$1.setFeature(context, "RETRY_MODE_LEGACY", "D"); - } - } - if (typeof config2.accountIdEndpointMode === "function") { - const endpointV2 = context.endpointV2; - if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { - core$1.setFeature(context, "ACCOUNT_ID_ENDPOINT", "O"); - } - switch (await config2.accountIdEndpointMode?.()) { - case "disabled": - core$1.setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q"); - break; - case "preferred": - core$1.setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P"); - break; - case "required": - core$1.setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R"); - break; - } - } - const identity4 = context.__smithy_context?.selectedHttpAuthScheme?.identity; - if (identity4?.$source) { - const credentials = identity4; - if (credentials.accountId) { - core$1.setFeature(context, "RESOLVED_ACCOUNT_ID", "T"); - } - for (const [key, value] of Object.entries(credentials.$source ?? {})) { - core$1.setFeature(context, key, value); - } - } - } - var USER_AGENT = "user-agent"; - var X_AMZ_USER_AGENT = "x-amz-user-agent"; - var SPACE = " "; - var UA_NAME_SEPARATOR = "/"; - var UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g; - var UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g; - var UA_ESCAPE_CHAR = "-"; - var BYTE_LIMIT = 1024; - function encodeFeatures(features) { - let buffer = ""; - for (const key in features) { - const val = features[key]; - if (buffer.length + val.length + 1 <= BYTE_LIMIT) { - if (buffer.length) { - buffer += "," + val; - } else { - buffer += val; - } - continue; - } - break; - } - return buffer; - } - var userAgentMiddleware = (options) => (next, context) => async (args) => { - const { request } = args; - if (!protocolHttp.HttpRequest.isInstance(request)) { - return next(args); - } - const { headers } = request; - const userAgent = context?.userAgent?.map(escapeUserAgent) || []; - const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); - await checkFeatures(context, options, args); - const awsContext = context; - defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`); - const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; - const appId = await options.userAgentAppId(); - if (appId) { - defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`])); - } - const prefix = utilEndpoints.getUserAgentPrefix(); - const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE); - const normalUAValue = [ - ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), - ...customUserAgent - ].join(SPACE); - if (options.runtime !== "browser") { - if (normalUAValue) { - headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue; - } - headers[USER_AGENT] = sdkUserAgentValue; - } else { - headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; - } - return next({ - ...args, - request - }); - }; - var escapeUserAgent = (userAgentPair) => { - const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR); - const version2 = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); - const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR); - const prefix = name.substring(0, prefixSeparatorIndex); - let uaName = name.substring(prefixSeparatorIndex + 1); - if (prefix === "api") { - uaName = uaName.toLowerCase(); - } - return [prefix, uaName, version2].filter((item) => item && item.length > 0).reduce((acc, item, index) => { - switch (index) { - case 0: - return item; - case 1: - return `${acc}/${item}`; - default: - return `${acc}#${item}`; - } - }, ""); - }; - var getUserAgentMiddlewareOptions = { - name: "getUserAgentMiddleware", - step: "build", - priority: "low", - tags: ["SET_USER_AGENT", "USER_AGENT"], - override: true - }; - var getUserAgentPlugin = (config2) => ({ - applyToStack: (clientStack) => { - clientStack.add(userAgentMiddleware(config2), getUserAgentMiddlewareOptions); - } - }); - exports.DEFAULT_UA_APP_ID = DEFAULT_UA_APP_ID; - exports.getUserAgentMiddlewareOptions = getUserAgentMiddlewareOptions; - exports.getUserAgentPlugin = getUserAgentPlugin; - exports.resolveUserAgentConfig = resolveUserAgentConfig; - exports.userAgentMiddleware = userAgentMiddleware; -}); - -// ../node_modules/@smithy/util-config-provider/dist-cjs/index.js -var require_dist_cjs85 = __commonJS((exports) => { - var booleanSelector = (obj, key, type) => { - if (!(key in obj)) - return; - if (obj[key] === "true") - return true; - if (obj[key] === "false") - return false; - throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); - }; - var numberSelector = (obj, key, type) => { - if (!(key in obj)) - return; - const numberValue = parseInt(obj[key], 10); - if (Number.isNaN(numberValue)) { - throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); - } - return numberValue; - }; - exports.SelectorType = undefined; - (function(SelectorType) { - SelectorType["ENV"] = "env"; - SelectorType["CONFIG"] = "shared config entry"; - })(exports.SelectorType || (exports.SelectorType = {})); - exports.booleanSelector = booleanSelector; - exports.numberSelector = numberSelector; -}); - -// ../node_modules/@smithy/config-resolver/dist-cjs/index.js -var require_dist_cjs86 = __commonJS((exports) => { - var utilConfigProvider = require_dist_cjs85(); - var utilMiddleware = require_dist_cjs60(); - var utilEndpoints = require_dist_cjs72(); - var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; - var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; - var DEFAULT_USE_DUALSTACK_ENDPOINT = false; - var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => utilConfigProvider.booleanSelector(env4, ENV_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.ENV), - configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), - default: false - }; - var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; - var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; - var DEFAULT_USE_FIPS_ENDPOINT = false; - var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => utilConfigProvider.booleanSelector(env4, ENV_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.ENV), - configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), - default: false - }; - var resolveCustomEndpointsConfig = (input) => { - const { tls, endpoint, urlParser, useDualstackEndpoint } = input; - return Object.assign(input, { - tls: tls ?? true, - endpoint: utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), - isCustomEndpoint: true, - useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false) - }); - }; - var getEndpointFromRegion = async (input) => { - const { tls = true } = input; - const region = await input.region(); - const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); - if (!dnsHostRegex.test(region)) { - throw new Error("Invalid region in client config"); - } - const useDualstackEndpoint = await input.useDualstackEndpoint(); - const useFipsEndpoint = await input.useFipsEndpoint(); - const { hostname: hostname2 } = await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }) ?? {}; - if (!hostname2) { - throw new Error("Cannot resolve hostname from client config"); - } - return input.urlParser(`${tls ? "https:" : "http:"}//${hostname2}`); - }; - var resolveEndpointsConfig = (input) => { - const useDualstackEndpoint = utilMiddleware.normalizeProvider(input.useDualstackEndpoint ?? false); - const { endpoint, useFipsEndpoint, urlParser, tls } = input; - return Object.assign(input, { - tls: tls ?? true, - endpoint: endpoint ? utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }), - isCustomEndpoint: !!endpoint, - useDualstackEndpoint - }); - }; - var REGION_ENV_NAME = "AWS_REGION"; - var REGION_INI_NAME = "region"; - var NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => env4[REGION_ENV_NAME], - configFileSelector: (profile) => profile[REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); - } - }; - var NODE_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials" - }; - var validRegions = new Set; - var checkRegion = (region, check2 = utilEndpoints.isValidHostLabel) => { - if (!validRegions.has(region) && !check2(region)) { - if (region === "*") { - console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`); - } else { - throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`); - } - } else { - validRegions.add(region); - } - }; - var isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); - var getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region; - var resolveRegionConfig = (input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); - } - return Object.assign(input, { - region: async () => { - const providedRegion = typeof region === "function" ? await region() : region; - const realRegion = getRealRegion(providedRegion); - checkRegion(realRegion); - return realRegion; - }, - useFipsEndpoint: async () => { - const providedRegion = typeof region === "string" ? region : await region(); - if (isFipsRegion(providedRegion)) { - return true; - } - return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); - } - }); - }; - var getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))?.hostname; - var getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname ? regionHostname : partitionHostname ? partitionHostname.replace("{region}", resolvedRegion) : undefined; - var getResolvedPartition = (region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws"; - var getResolvedSigningRegion = (hostname2, { signingRegion, regionRegex, useFipsEndpoint }) => { - if (signingRegion) { - return signingRegion; - } else if (useFipsEndpoint) { - const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); - const regionRegexmatchArray = hostname2.match(regionRegexJs); - if (regionRegexmatchArray) { - return regionRegexmatchArray[0].slice(1, -1); - } - } - }; - var getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash }) => { - const partition3 = getResolvedPartition(region, { partitionHash }); - const resolvedRegion = region in regionHash ? region : partitionHash[partition3]?.endpoint ?? region; - const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; - const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions); - const partitionHostname = getHostnameFromVariants(partitionHash[partition3]?.variants, hostnameOptions); - const hostname2 = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname }); - if (hostname2 === undefined) { - throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); - } - const signingRegion = getResolvedSigningRegion(hostname2, { - signingRegion: regionHash[resolvedRegion]?.signingRegion, - regionRegex: partitionHash[partition3].regionRegex, - useFipsEndpoint - }); - return { - partition: partition3, - signingService, - hostname: hostname2, - ...signingRegion && { signingRegion }, - ...regionHash[resolvedRegion]?.signingService && { - signingService: regionHash[resolvedRegion].signingService - } - }; - }; - exports.CONFIG_USE_DUALSTACK_ENDPOINT = CONFIG_USE_DUALSTACK_ENDPOINT; - exports.CONFIG_USE_FIPS_ENDPOINT = CONFIG_USE_FIPS_ENDPOINT; - exports.DEFAULT_USE_DUALSTACK_ENDPOINT = DEFAULT_USE_DUALSTACK_ENDPOINT; - exports.DEFAULT_USE_FIPS_ENDPOINT = DEFAULT_USE_FIPS_ENDPOINT; - exports.ENV_USE_DUALSTACK_ENDPOINT = ENV_USE_DUALSTACK_ENDPOINT; - exports.ENV_USE_FIPS_ENDPOINT = ENV_USE_FIPS_ENDPOINT; - exports.NODE_REGION_CONFIG_FILE_OPTIONS = NODE_REGION_CONFIG_FILE_OPTIONS; - exports.NODE_REGION_CONFIG_OPTIONS = NODE_REGION_CONFIG_OPTIONS; - exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS; - exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS; - exports.REGION_ENV_NAME = REGION_ENV_NAME; - exports.REGION_INI_NAME = REGION_INI_NAME; - exports.getRegionInfo = getRegionInfo; - exports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; - exports.resolveEndpointsConfig = resolveEndpointsConfig; - exports.resolveRegionConfig = resolveRegionConfig; -}); - -// ../node_modules/@smithy/middleware-content-length/dist-cjs/index.js -var require_dist_cjs87 = __commonJS((exports) => { - var protocolHttp = require_dist_cjs56(); - var CONTENT_LENGTH_HEADER = "content-length"; - function contentLengthMiddleware(bodyLengthChecker) { - return (next) => async (args) => { - const request = args.request; - if (protocolHttp.HttpRequest.isInstance(request)) { - const { body, headers } = request; - if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { - try { - const length = bodyLengthChecker(body); - request.headers = { - ...request.headers, - [CONTENT_LENGTH_HEADER]: String(length) - }; - } catch (error41) {} - } - } - return next({ - ...args, - request - }); - }; - } - var contentLengthMiddlewareOptions = { - step: "build", - tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], - name: "contentLengthMiddleware", - override: true - }; - var getContentLengthPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); - } - }); - exports.contentLengthMiddleware = contentLengthMiddleware; - exports.contentLengthMiddlewareOptions = contentLengthMiddlewareOptions; - exports.getContentLengthPlugin = getContentLengthPlugin; -}); - -// ../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js -var require_getHomeDir2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getHomeDir = undefined; - var os_1 = __require("os"); - var path_1 = __require("path"); - var homeDirCache = {}; - var getHomeDirCacheKey = () => { - if (process && process.geteuid) { - return `${process.geteuid()}`; - } - return "DEFAULT"; - }; - var getHomeDir = () => { - const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; - if (HOME) - return HOME; - if (USERPROFILE) - return USERPROFILE; - if (HOMEPATH) - return `${HOMEDRIVE}${HOMEPATH}`; - const homeDirCacheKey = getHomeDirCacheKey(); - if (!homeDirCache[homeDirCacheKey]) - homeDirCache[homeDirCacheKey] = (0, os_1.homedir)(); - return homeDirCache[homeDirCacheKey]; - }; - exports.getHomeDir = getHomeDir; -}); - -// ../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js -var require_getSSOTokenFilepath2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSSOTokenFilepath = undefined; - var crypto_1 = __require("crypto"); - var path_1 = __require("path"); - var getHomeDir_1 = require_getHomeDir2(); - var getSSOTokenFilepath = (id) => { - const hasher = (0, crypto_1.createHash)("sha1"); - const cacheName = hasher.update(id).digest("hex"); - return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); - }; - exports.getSSOTokenFilepath = getSSOTokenFilepath; -}); - -// ../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js -var require_getSSOTokenFromFile2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSSOTokenFromFile = exports.tokenIntercept = undefined; - var promises_1 = __require("fs/promises"); - var getSSOTokenFilepath_1 = require_getSSOTokenFilepath2(); - exports.tokenIntercept = {}; - var getSSOTokenFromFile = async (id) => { - if (exports.tokenIntercept[id]) { - return exports.tokenIntercept[id]; - } - const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); - const ssoTokenText = await (0, promises_1.readFile)(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); - }; - exports.getSSOTokenFromFile = getSSOTokenFromFile; -}); - -// ../node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js -var require_readFile2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readFile = exports.fileIntercept = exports.filePromises = undefined; - var promises_1 = __require("node:fs/promises"); - exports.filePromises = {}; - exports.fileIntercept = {}; - var readFile8 = (path9, options) => { - if (exports.fileIntercept[path9] !== undefined) { - return exports.fileIntercept[path9]; - } - if (!exports.filePromises[path9] || options?.ignoreCache) { - exports.filePromises[path9] = (0, promises_1.readFile)(path9, "utf8"); - } - return exports.filePromises[path9]; - }; - exports.readFile = readFile8; -}); - -// ../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js -var require_dist_cjs88 = __commonJS((exports) => { - var getHomeDir = require_getHomeDir2(); - var getSSOTokenFilepath = require_getSSOTokenFilepath2(); - var getSSOTokenFromFile = require_getSSOTokenFromFile2(); - var path9 = __require("path"); - var types = require_dist_cjs55(); - var readFile8 = require_readFile2(); - var ENV_PROFILE = "AWS_PROFILE"; - var DEFAULT_PROFILE = "default"; - var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; - var CONFIG_PREFIX_SEPARATOR = "."; - var getConfigData = (data) => Object.entries(data).filter(([key]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - if (indexOfSeparator === -1) { - return false; - } - return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator)); - }).reduce((acc, [key, value]) => { - const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); - const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; - acc[updatedKey] = value; - return acc; - }, { - ...data.default && { default: data.default } - }); - var ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; - var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path9.join(getHomeDir.getHomeDir(), ".aws", "config"); - var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; - var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path9.join(getHomeDir.getHomeDir(), ".aws", "credentials"); - var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; - var profileNameBlockList = ["__proto__", "profile __proto__"]; - var parseIni = (iniData) => { - const map3 = {}; - 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 = undefined; - currentSubSection = undefined; - const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); - const matches2 = prefixKeyRegex.exec(sectionName); - if (matches2) { - const [, prefix, , name] = matches2; - if (Object.values(types.IniSectionType).includes(prefix)) { - currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR); - } - } else { - currentSection = sectionName; - } - if (profileNameBlockList.includes(sectionName)) { - throw new Error(`Found invalid profile name "${sectionName}"`); - } - } else if (currentSection) { - const indexOfEqualsSign = trimmedLine.indexOf("="); - if (![0, -1].includes(indexOfEqualsSign)) { - const [name, value] = [ - trimmedLine.substring(0, indexOfEqualsSign).trim(), - trimmedLine.substring(indexOfEqualsSign + 1).trim() - ]; - if (value === "") { - currentSubSection = name; - } else { - if (currentSubSection && iniLine.trimStart() === iniLine) { - currentSubSection = undefined; - } - map3[currentSection] = map3[currentSection] || {}; - const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; - map3[currentSection][key] = value; - } - } - } - } - return map3; - }; - var swallowError$1 = () => ({}); - var loadSharedConfigFiles = async (init = {}) => { - const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; - const homeDir = getHomeDir.getHomeDir(); - const relativeHomeDirPrefix = "~/"; - let resolvedFilepath = filepath; - if (filepath.startsWith(relativeHomeDirPrefix)) { - resolvedFilepath = path9.join(homeDir, filepath.slice(2)); - } - let resolvedConfigFilepath = configFilepath; - if (configFilepath.startsWith(relativeHomeDirPrefix)) { - resolvedConfigFilepath = path9.join(homeDir, configFilepath.slice(2)); - } - const parsedFiles = await Promise.all([ - readFile8.readFile(resolvedConfigFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).then(getConfigData).catch(swallowError$1), - readFile8.readFile(resolvedFilepath, { - ignoreCache: init.ignoreCache - }).then(parseIni).catch(swallowError$1) - ]); - return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1] - }; - }; - var getSsoSessionData = (data) => Object.entries(data).filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}); - var swallowError = () => ({}); - var loadSsoSessionData = async (init = {}) => readFile8.readFile(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError); - var mergeConfigFiles = (...files) => { - const merged = {}; - for (const file2 of files) { - for (const [key, values2] of Object.entries(file2)) { - if (merged[key] !== undefined) { - Object.assign(merged[key], values2); - } else { - merged[key] = values2; - } - } - } - return merged; - }; - var parseKnownFiles = async (init) => { - const parsedFiles = await loadSharedConfigFiles(init); - return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); - }; - var externalDataInterceptor = { - getFileRecord() { - return readFile8.fileIntercept; - }, - interceptFile(path10, contents) { - readFile8.fileIntercept[path10] = Promise.resolve(contents); - }, - getTokenRecord() { - return getSSOTokenFromFile.tokenIntercept; - }, - interceptToken(id, contents) { - getSSOTokenFromFile.tokenIntercept[id] = contents; - } - }; - Object.defineProperty(exports, "getSSOTokenFromFile", { - enumerable: true, - get: function() { - return getSSOTokenFromFile.getSSOTokenFromFile; - } - }); - Object.defineProperty(exports, "readFile", { - enumerable: true, - get: function() { - return readFile8.readFile; - } - }); - exports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR; - exports.DEFAULT_PROFILE = DEFAULT_PROFILE; - exports.ENV_PROFILE = ENV_PROFILE; - exports.externalDataInterceptor = externalDataInterceptor; - exports.getProfileName = getProfileName; - exports.loadSharedConfigFiles = loadSharedConfigFiles; - exports.loadSsoSessionData = loadSsoSessionData; - exports.parseKnownFiles = parseKnownFiles; - Object.keys(getHomeDir).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - Object.defineProperty(exports, k, { - enumerable: true, - get: function() { - return getHomeDir[k]; - } - }); - }); - Object.keys(getSSOTokenFilepath).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - Object.defineProperty(exports, k, { - enumerable: true, - get: function() { - return getSSOTokenFilepath[k]; - } - }); - }); -}); - -// ../node_modules/@smithy/node-config-provider/dist-cjs/index.js -var require_dist_cjs89 = __commonJS((exports) => { - var propertyProvider = require_dist_cjs76(); - var sharedIniFileLoader = require_dist_cjs88(); - 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 (e) { - return functionString; - } - } - var fromEnv = (envVarSelector, options) => async () => { - try { - const config2 = envVarSelector(process.env, options); - if (config2 === undefined) { - throw new Error; - } - return config2; - } catch (e) { - throw new propertyProvider.CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger }); - } - }; - var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = sharedIniFileLoader.getProfileName(init); - const { configFile, credentialsFile } = await sharedIniFileLoader.loadSharedConfigFiles(init); - const profileFromCredentials = credentialsFile[profile] || {}; - const profileFromConfig = configFile[profile] || {}; - const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials }; - try { - const cfgFile = preferredFile === "config" ? configFile : credentialsFile; - const configValue = configSelector(mergedProfile, cfgFile); - if (configValue === undefined) { - throw new Error; - } - return configValue; - } catch (e) { - throw new propertyProvider.CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger }); - } - }; - var isFunction4 = (func) => typeof func === "function"; - var fromStatic = (defaultValue) => isFunction4(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue); - var loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => { - const { signingName, logger } = configuration; - const envOptions = { signingName, logger }; - return propertyProvider.memoize(propertyProvider.chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue))); - }; - exports.loadConfig = loadConfig; -}); - -// ../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js -var require_getEndpointUrlConfig2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getEndpointUrlConfig = undefined; - var shared_ini_file_loader_1 = require_dist_cjs88(); - var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; - var CONFIG_ENDPOINT_URL = "endpoint_url"; - var getEndpointUrlConfig = (serviceId) => ({ - environmentVariableSelector: (env4) => { - const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); - const serviceEndpointUrl = env4[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; - if (serviceEndpointUrl) - return serviceEndpointUrl; - const endpointUrl = env4[ENV_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return; - }, - configFileSelector: (profile, config2) => { - if (config2 && profile.services) { - const servicesSection = config2[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (servicesSection) { - const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); - const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (endpointUrl2) - return endpointUrl2; - } - } - const endpointUrl = profile[CONFIG_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return; - }, - default: undefined - }); - exports.getEndpointUrlConfig = getEndpointUrlConfig; -}); - -// ../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js -var require_getEndpointFromConfig2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getEndpointFromConfig = undefined; - var node_config_provider_1 = require_dist_cjs89(); - var getEndpointUrlConfig_1 = require_getEndpointUrlConfig2(); - var getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId ?? ""))(); - exports.getEndpointFromConfig = getEndpointFromConfig; -}); - -// ../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js -var require_dist_cjs90 = __commonJS((exports) => { - var getEndpointFromConfig = require_getEndpointFromConfig2(); - var urlParser = require_dist_cjs74(); - var core2 = require_dist_cjs71(); - var utilMiddleware = require_dist_cjs60(); - var middlewareSerde = require_dist_cjs61(); - var resolveParamsForS3 = async (endpointParams) => { - const bucket = endpointParams?.Bucket || ""; - if (typeof endpointParams.Bucket === "string") { - endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); - } - if (isArnBucketName(bucket)) { - if (endpointParams.ForcePathStyle === true) { - throw new Error("Path-style addressing cannot be used with ARN buckets"); - } - } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) { - endpointParams.ForcePathStyle = true; - } - if (endpointParams.DisableMultiRegionAccessPoints) { - endpointParams.disableMultiRegionAccessPoints = true; - endpointParams.DisableMRAP = true; - } - return endpointParams; - }; - var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; - var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; - var DOTS_PATTERN = /\.\./; - var isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); - var isArnBucketName = (bucketName) => { - const [arn, partition3, service, , , bucket] = bucketName.split(":"); - const isArn = arn === "arn" && bucketName.split(":").length >= 6; - const isValidArn = Boolean(isArn && partition3 && service && bucket); - if (isArn && !isValidArn) { - throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); - } - return isValidArn; - }; - var createConfigValueProvider = (configKey, canonicalEndpointParamKey, config2) => { - const configProvider = async () => { - const configValue = config2[configKey] ?? config2[canonicalEndpointParamKey]; - if (typeof configValue === "function") { - return configValue(); - } - return configValue; - }; - if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { - return async () => { - const credentials = typeof config2.credentials === "function" ? await config2.credentials() : config2.credentials; - const configValue = credentials?.credentialScope ?? credentials?.CredentialScope; - return configValue; - }; - } - if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { - return async () => { - const credentials = typeof config2.credentials === "function" ? await config2.credentials() : config2.credentials; - const configValue = credentials?.accountId ?? credentials?.AccountId; - return configValue; - }; - } - if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { - return async () => { - if (config2.isCustomEndpoint === false) { - return; - } - const endpoint = await configProvider(); - if (endpoint && typeof endpoint === "object") { - if ("url" in endpoint) { - return endpoint.url.href; - } - if ("hostname" in endpoint) { - const { protocol, hostname: hostname2, port, path: path9 } = endpoint; - return `${protocol}//${hostname2}${port ? ":" + port : ""}${path9}`; - } - } - return endpoint; - }; - } - return configProvider; - }; - var toEndpointV1 = (endpoint) => { - if (typeof endpoint === "object") { - if ("url" in endpoint) { - return urlParser.parseUrl(endpoint.url); - } - return endpoint; - } - return urlParser.parseUrl(endpoint); - }; - var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { - if (!clientConfig.isCustomEndpoint) { - let endpointFromConfig; - if (clientConfig.serviceConfiguredEndpoint) { - endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); - } else { - endpointFromConfig = await getEndpointFromConfig.getEndpointFromConfig(clientConfig.serviceId); - } - if (endpointFromConfig) { - clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); - clientConfig.isCustomEndpoint = true; - } - } - const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); - if (typeof clientConfig.endpointProvider !== "function") { - throw new Error("config.endpointProvider is not set."); - } - const endpoint = clientConfig.endpointProvider(endpointParams, context); - return endpoint; - }; - var 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)(); - break; - case "operationContextParams": - endpointParams[name] = instruction.get(commandInput); - break; - default: - throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); - } - } - if (Object.keys(instructions).length === 0) { - Object.assign(endpointParams, clientConfig); - } - if (String(clientConfig.serviceId).toLowerCase() === "s3") { - await resolveParamsForS3(endpointParams); - } - return endpointParams; - }; - var endpointMiddleware = ({ config: config2, instructions }) => { - return (next, context) => async (args) => { - if (config2.isCustomEndpoint) { - core2.setFeature(context, "ENDPOINT_OVERRIDE", "N"); - } - const endpoint = await getEndpointFromInstructions(args.input, { - getEndpointParameterInstructions() { - return instructions; - } - }, { ...config2 }, context); - context.endpointV2 = endpoint; - context.authSchemes = endpoint.properties?.authSchemes; - const authScheme = context.authSchemes?.[0]; - if (authScheme) { - context["signing_region"] = authScheme.signingRegion; - context["signing_service"] = authScheme.signingName; - const smithyContext = utilMiddleware.getSmithyContext(context); - const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption; - if (httpAuthOption) { - httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, { - signing_region: authScheme.signingRegion, - signingRegion: authScheme.signingRegion, - signing_service: authScheme.signingName, - signingName: authScheme.signingName, - signingRegionSet: authScheme.signingRegionSet - }, authScheme.properties); - } - } - return next({ - ...args - }); - }; - }; - var endpointMiddlewareOptions = { - step: "serialize", - tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], - name: "endpointV2Middleware", - override: true, - relation: "before", - toMiddleware: middlewareSerde.serializerMiddlewareOption.name - }; - var getEndpointPlugin = (config2, instructions) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(endpointMiddleware({ - config: config2, - instructions - }), endpointMiddlewareOptions); - } - }); - var resolveEndpointConfig = (input) => { - const tls = input.tls ?? true; - const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input; - const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await utilMiddleware.normalizeProvider(endpoint)()) : undefined; - const isCustomEndpoint = !!endpoint; - const resolvedConfig = Object.assign(input, { - endpoint: customEndpointProvider, - tls, - isCustomEndpoint, - useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false), - useFipsEndpoint: utilMiddleware.normalizeProvider(useFipsEndpoint ?? false) - }); - let configuredEndpointPromise = undefined; - resolvedConfig.serviceConfiguredEndpoint = async () => { - if (input.serviceId && !configuredEndpointPromise) { - configuredEndpointPromise = getEndpointFromConfig.getEndpointFromConfig(input.serviceId); - } - return configuredEndpointPromise; - }; - return resolvedConfig; - }; - var resolveEndpointRequiredConfig = (input) => { - const { endpoint } = input; - if (endpoint === undefined) { - input.endpoint = async () => { - throw new Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint."); - }; - } - return input; - }; - exports.endpointMiddleware = endpointMiddleware; - exports.endpointMiddlewareOptions = endpointMiddlewareOptions; - exports.getEndpointFromInstructions = getEndpointFromInstructions; - exports.getEndpointPlugin = getEndpointPlugin; - exports.resolveEndpointConfig = resolveEndpointConfig; - exports.resolveEndpointRequiredConfig = resolveEndpointRequiredConfig; - exports.resolveParams = resolveParams; - exports.toEndpointV1 = toEndpointV1; -}); - -// ../node_modules/@smithy/service-error-classification/dist-cjs/index.js -var require_dist_cjs91 = __commonJS((exports) => { - var CLOCK_SKEW_ERROR_CODES = [ - "AuthFailure", - "InvalidSignatureException", - "RequestExpired", - "RequestInTheFuture", - "RequestTimeTooSkewed", - "SignatureDoesNotMatch" - ]; - var THROTTLING_ERROR_CODES = [ - "BandwidthLimitExceeded", - "EC2ThrottledException", - "LimitExceededException", - "PriorRequestNotComplete", - "ProvisionedThroughputExceededException", - "RequestLimitExceeded", - "RequestThrottled", - "RequestThrottledException", - "SlowDown", - "ThrottledException", - "Throttling", - "ThrottlingException", - "TooManyRequestsException", - "TransactionInProgressException" - ]; - var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; - var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; - var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; - var NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"]; - var isRetryableByTrait = (error41) => error41?.$retryable !== undefined; - var isClockSkewError = (error41) => CLOCK_SKEW_ERROR_CODES.includes(error41.name); - var isClockSkewCorrectedError = (error41) => error41.$metadata?.clockSkewCorrected; - var isBrowserNetworkError = (error41) => { - const errorMessages = 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 = error41 && error41 instanceof TypeError; - if (!isValid) { - return false; - } - return errorMessages.has(error41.message); - }; - var isThrottlingError = (error41) => error41.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error41.name) || error41.$retryable?.throttling == true; - var isTransientError = (error41, depth = 0) => isRetryableByTrait(error41) || isClockSkewCorrectedError(error41) || TRANSIENT_ERROR_CODES.includes(error41.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error41?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error41?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error41.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error41) || error41.cause !== undefined && depth <= 10 && isTransientError(error41.cause, depth + 1); - var isServerError = (error41) => { - if (error41.$metadata?.httpStatusCode !== undefined) { - const statusCode = error41.$metadata.httpStatusCode; - if (500 <= statusCode && statusCode <= 599 && !isTransientError(error41)) { - return true; - } - return false; - } - return false; - }; - exports.isBrowserNetworkError = isBrowserNetworkError; - exports.isClockSkewCorrectedError = isClockSkewCorrectedError; - exports.isClockSkewError = isClockSkewError; - exports.isRetryableByTrait = isRetryableByTrait; - exports.isServerError = isServerError; - exports.isThrottlingError = isThrottlingError; - exports.isTransientError = isTransientError; -}); - -// ../node_modules/@smithy/util-retry/dist-cjs/index.js -var require_dist_cjs92 = __commonJS((exports) => { - var serviceErrorClassification = require_dist_cjs91(); - exports.RETRY_MODES = undefined; - (function(RETRY_MODES) { - RETRY_MODES["STANDARD"] = "standard"; - RETRY_MODES["ADAPTIVE"] = "adaptive"; - })(exports.RETRY_MODES || (exports.RETRY_MODES = {})); - var DEFAULT_MAX_ATTEMPTS = 3; - var DEFAULT_RETRY_MODE = exports.RETRY_MODES.STANDARD; - - 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; - 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; - } - getCurrentTimeInSeconds() { - return Date.now() / 1000; - } - async getSendToken() { - return this.acquireTokenBucket(1); - } - async acquireTokenBucket(amount) { - if (!this.enabled) { - return; - } - this.refillTokenBucket(); - if (amount > this.currentCapacity) { - const delay2 = (amount - this.currentCapacity) / this.fillRate * 1000; - await new Promise((resolve8) => DefaultRateLimiter.setTimeoutFn(resolve8, delay2)); - } - this.currentCapacity = this.currentCapacity - amount; - } - refillTokenBucket() { - const timestamp = this.getCurrentTimeInSeconds(); - if (!this.lastTimestamp) { - this.lastTimestamp = timestamp; - return; - } - const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; - this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); - this.lastTimestamp = timestamp; - } - updateClientSendingRate(response) { - let calculatedRate; - this.updateMeasuredRate(); - if (serviceErrorClassification.isThrottlingError(response)) { - const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); - this.lastMaxRate = rateToUse; - this.calculateTimeWindow(); - this.lastThrottleTime = this.getCurrentTimeInSeconds(); - calculatedRate = this.cubicThrottle(rateToUse); - this.enableTokenBucket(); - } else { - this.calculateTimeWindow(); - calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); - } - const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); - this.updateTokenBucketRate(newRate); - } - calculateTimeWindow() { - this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); - } - cubicThrottle(rateToUse) { - return this.getPrecise(rateToUse * this.beta); - } - cubicSuccess(timestamp) { - return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); - } - enableTokenBucket() { - this.enabled = true; - } - updateTokenBucketRate(newRate) { - this.refillTokenBucket(); - this.fillRate = Math.max(newRate, this.minFillRate); - this.maxCapacity = Math.max(newRate, this.minCapacity); - this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); - } - updateMeasuredRate() { - const t = this.getCurrentTimeInSeconds(); - const timeBucket = Math.floor(t * 2) / 2; - this.requestCount++; - if (timeBucket > this.lastTxRateBucket) { - const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); - this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); - this.requestCount = 0; - this.lastTxRateBucket = timeBucket; - } - } - getPrecise(num) { - return parseFloat(num.toFixed(8)); - } - } - var DEFAULT_RETRY_DELAY_BASE = 100; - var MAXIMUM_RETRY_DELAY = 20 * 1000; - var THROTTLING_RETRY_DELAY_BASE = 500; - var INITIAL_RETRY_TOKENS = 500; - var RETRY_COST = 5; - var TIMEOUT_RETRY_COST = 10; - var NO_RETRY_INCREMENT = 1; - var INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; - var REQUEST_HEADER = "amz-sdk-request"; - var 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 = (delay2) => { - delayBase = delay2; - }; - return { - computeNextBackoffDelay, - setDelayBase - }; - }; - var createDefaultRetryToken = ({ retryDelay, retryCount, retryCost }) => { - const getRetryCount = () => retryCount; - const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay); - const getRetryCost = () => retryCost; - return { - getRetryCount, - getRetryDelay, - getRetryCost - }; - }; - - class StandardRetryStrategy { - maxAttempts; - mode = exports.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 - }); - } - async refreshRetryTokenForRetry(token, errorInfo) { - const maxAttempts = await this.getMaxAttempts(); - if (this.shouldRetry(token, errorInfo, maxAttempts)) { - const errorType = errorInfo.errorType; - this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE); - const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); - const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; - const capacityCost = this.getCapacityCost(errorType); - this.capacity -= capacityCost; - return createDefaultRetryToken({ - retryDelay, - retryCount: token.getRetryCount() + 1, - retryCost: capacityCost - }); - } - throw new Error("No retry token available"); - } - recordSuccess(token) { - this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); - } - getCapacity() { - return this.capacity; - } - async getMaxAttempts() { - try { - return await this.maxAttemptsProvider(); - } catch (error41) { - console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); - return DEFAULT_MAX_ATTEMPTS; - } - } - shouldRetry(tokenToRenew, errorInfo, maxAttempts) { - const attempts = tokenToRenew.getRetryCount() + 1; - return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); - } - getCapacityCost(errorType) { - return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; - } - isRetryableError(errorType) { - return errorType === "THROTTLING" || errorType === "TRANSIENT"; - } - } - - class AdaptiveRetryStrategy { - maxAttemptsProvider; - rateLimiter; - standardRetryStrategy; - mode = exports.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); - } - recordSuccess(token) { - this.rateLimiter.updateClientSendingRate({}); - this.standardRetryStrategy.recordSuccess(token); - } - } - - class ConfiguredRetryStrategy extends StandardRetryStrategy { - computeNextBackoffDelay; - constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) { - super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); - if (typeof computeNextBackoffDelay === "number") { - this.computeNextBackoffDelay = () => computeNextBackoffDelay; - } else { - this.computeNextBackoffDelay = computeNextBackoffDelay; - } - } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); - return token; - } - } - exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; - exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy; - exports.DEFAULT_MAX_ATTEMPTS = DEFAULT_MAX_ATTEMPTS; - exports.DEFAULT_RETRY_DELAY_BASE = DEFAULT_RETRY_DELAY_BASE; - exports.DEFAULT_RETRY_MODE = DEFAULT_RETRY_MODE; - exports.DefaultRateLimiter = DefaultRateLimiter; - exports.INITIAL_RETRY_TOKENS = INITIAL_RETRY_TOKENS; - exports.INVOCATION_ID_HEADER = INVOCATION_ID_HEADER; - exports.MAXIMUM_RETRY_DELAY = MAXIMUM_RETRY_DELAY; - exports.NO_RETRY_INCREMENT = NO_RETRY_INCREMENT; - exports.REQUEST_HEADER = REQUEST_HEADER; - exports.RETRY_COST = RETRY_COST; - exports.StandardRetryStrategy = StandardRetryStrategy; - exports.THROTTLING_RETRY_DELAY_BASE = THROTTLING_RETRY_DELAY_BASE; - exports.TIMEOUT_RETRY_COST = TIMEOUT_RETRY_COST; -}); - -// ../node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js -var require_isStreamingPayload2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isStreamingPayload = undefined; - var stream_1 = __require("stream"); - var isStreamingPayload = (request) => request?.body instanceof stream_1.Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream; - exports.isStreamingPayload = isStreamingPayload; -}); - -// ../node_modules/@smithy/middleware-retry/dist-cjs/index.js -var require_dist_cjs93 = __commonJS((exports) => { - var utilRetry = require_dist_cjs92(); - var protocolHttp = require_dist_cjs56(); - var serviceErrorClassification = require_dist_cjs91(); - var uuid3 = require_dist_cjs70(); - var utilMiddleware = require_dist_cjs60(); - var smithyClient = require_dist_cjs81(); - var isStreamingPayload = require_isStreamingPayload2(); - var getDefaultRetryQuota = (initialRetryTokens, options) => { - const MAX_CAPACITY = initialRetryTokens; - const noRetryIncrement = utilRetry.NO_RETRY_INCREMENT; - const retryCost = utilRetry.RETRY_COST; - const timeoutRetryCost = utilRetry.TIMEOUT_RETRY_COST; - let availableCapacity = initialRetryTokens; - const getCapacityAmount = (error41) => error41.name === "TimeoutError" ? timeoutRetryCost : retryCost; - const hasRetryTokens = (error41) => getCapacityAmount(error41) <= availableCapacity; - const retrieveRetryTokens = (error41) => { - if (!hasRetryTokens(error41)) { - throw new Error("No retry token available"); - } - const capacityAmount = getCapacityAmount(error41); - availableCapacity -= capacityAmount; - return capacityAmount; - }; - const releaseRetryTokens = (capacityReleaseAmount) => { - availableCapacity += capacityReleaseAmount ?? noRetryIncrement; - availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); - }; - return Object.freeze({ - hasRetryTokens, - retrieveRetryTokens, - releaseRetryTokens - }); - }; - var defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(utilRetry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); - var defaultRetryDecider = (error41) => { - if (!error41) { - return false; - } - return serviceErrorClassification.isRetryableByTrait(error41) || serviceErrorClassification.isClockSkewError(error41) || serviceErrorClassification.isThrottlingError(error41) || serviceErrorClassification.isTransientError(error41); - }; - var asSdkError = (error41) => { - if (error41 instanceof Error) - return error41; - if (error41 instanceof Object) - return Object.assign(new Error, error41); - if (typeof error41 === "string") - return new Error(error41); - return new Error(`AWS SDK error wrapper for ${error41}`); - }; - - class StandardRetryStrategy { - maxAttemptsProvider; - retryDecider; - delayDecider; - retryQuota; - mode = utilRetry.RETRY_MODES.STANDARD; - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - this.retryDecider = options?.retryDecider ?? defaultRetryDecider; - this.delayDecider = options?.delayDecider ?? defaultDelayDecider; - this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(utilRetry.INITIAL_RETRY_TOKENS); - } - shouldRetry(error41, attempts, maxAttempts) { - return attempts < maxAttempts && this.retryDecider(error41) && this.retryQuota.hasRetryTokens(error41); - } - async getMaxAttempts() { - let maxAttempts; - try { - maxAttempts = await this.maxAttemptsProvider(); - } catch (error41) { - maxAttempts = utilRetry.DEFAULT_MAX_ATTEMPTS; - } - return maxAttempts; - } - async retry(next, args, options) { - let retryTokenAmount; - let attempts = 0; - let totalDelay = 0; - const maxAttempts = await this.getMaxAttempts(); - const { request } = args; - if (protocolHttp.HttpRequest.isInstance(request)) { - request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid3.v4(); - } - while (true) { - try { - if (protocolHttp.HttpRequest.isInstance(request)) { - request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - if (options?.beforeRequest) { - await options.beforeRequest(); - } - const { response, output } = await next(args); - if (options?.afterRequest) { - options.afterRequest(response); - } - this.retryQuota.releaseRetryTokens(retryTokenAmount); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalDelay; - return { response, output }; - } catch (e) { - const err = asSdkError(e); - attempts++; - if (this.shouldRetry(err, attempts, maxAttempts)) { - retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); - const delayFromDecider = this.delayDecider(serviceErrorClassification.isThrottlingError(err) ? utilRetry.THROTTLING_RETRY_DELAY_BASE : utilRetry.DEFAULT_RETRY_DELAY_BASE, attempts); - const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); - const delay2 = Math.max(delayFromResponse || 0, delayFromDecider); - totalDelay += delay2; - await new Promise((resolve8) => setTimeout(resolve8, delay2)); - continue; - } - if (!err.$metadata) { - err.$metadata = {}; - } - err.$metadata.attempts = attempts; - err.$metadata.totalRetryDelay = totalDelay; - throw err; - } - } - } - } - var getDelayFromRetryAfterHeader = (response) => { - if (!protocolHttp.HttpResponse.isInstance(response)) - return; - const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); - if (!retryAfterHeaderName) - return; - const retryAfter = response.headers[retryAfterHeaderName]; - const retryAfterSeconds = Number(retryAfter); - if (!Number.isNaN(retryAfterSeconds)) - return retryAfterSeconds * 1000; - const retryAfterDate = new Date(retryAfter); - return retryAfterDate.getTime() - Date.now(); - }; - - class AdaptiveRetryStrategy extends StandardRetryStrategy { - rateLimiter; - constructor(maxAttemptsProvider, options) { - const { rateLimiter, ...superOptions } = options ?? {}; - super(maxAttemptsProvider, superOptions); - this.rateLimiter = rateLimiter ?? new utilRetry.DefaultRateLimiter; - this.mode = utilRetry.RETRY_MODES.ADAPTIVE; - } - async retry(next, args) { - return super.retry(next, args, { - beforeRequest: async () => { - return this.rateLimiter.getSendToken(); - }, - afterRequest: (response) => { - this.rateLimiter.updateClientSendingRate(response); - } - }); - } - } - var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; - var CONFIG_MAX_ATTEMPTS = "max_attempts"; - var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => { - const value = env4[ENV_MAX_ATTEMPTS]; - if (!value) - return; - 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; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); - } - return maxAttempt; - }, - default: utilRetry.DEFAULT_MAX_ATTEMPTS - }; - var resolveRetryConfig = (input) => { - const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input; - const maxAttempts = utilMiddleware.normalizeProvider(_maxAttempts ?? utilRetry.DEFAULT_MAX_ATTEMPTS); - return Object.assign(input, { - maxAttempts, - retryStrategy: async () => { - if (retryStrategy) { - return retryStrategy; - } - const retryMode = await utilMiddleware.normalizeProvider(_retryMode)(); - if (retryMode === utilRetry.RETRY_MODES.ADAPTIVE) { - return new utilRetry.AdaptiveRetryStrategy(maxAttempts); - } - return new utilRetry.StandardRetryStrategy(maxAttempts); - } - }); - }; - var ENV_RETRY_MODE = "AWS_RETRY_MODE"; - var CONFIG_RETRY_MODE = "retry_mode"; - var NODE_RETRY_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => env4[ENV_RETRY_MODE], - configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], - default: utilRetry.DEFAULT_RETRY_MODE - }; - var omitRetryHeadersMiddleware = () => (next) => async (args) => { - const { request } = args; - if (protocolHttp.HttpRequest.isInstance(request)) { - delete request.headers[utilRetry.INVOCATION_ID_HEADER]; - delete request.headers[utilRetry.REQUEST_HEADER]; - } - return next(args); - }; - var omitRetryHeadersMiddlewareOptions = { - name: "omitRetryHeadersMiddleware", - tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], - relation: "before", - toMiddleware: "awsAuthMiddleware", - override: true - }; - var getOmitRetryHeadersPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); - } - }); - var retryMiddleware = (options) => (next, context) => async (args) => { - let retryStrategy = await options.retryStrategy(); - const maxAttempts = await options.maxAttempts(); - if (isRetryStrategyV2(retryStrategy)) { - retryStrategy = retryStrategy; - let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); - let lastError = new Error; - let attempts = 0; - let totalRetryDelay = 0; - const { request } = args; - const isRequest2 = protocolHttp.HttpRequest.isInstance(request); - if (isRequest2) { - request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid3.v4(); - } - while (true) { - try { - if (isRequest2) { - request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - const { response, output } = await next(args); - retryStrategy.recordSuccess(retryToken); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalRetryDelay; - return { response, output }; - } catch (e) { - const retryErrorInfo = getRetryErrorInfo(e); - lastError = asSdkError(e); - if (isRequest2 && isStreamingPayload.isStreamingPayload(request)) { - (context.logger instanceof smithyClient.NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request."); - throw lastError; - } - try { - retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); - } catch (refreshError) { - if (!lastError.$metadata) { - lastError.$metadata = {}; - } - lastError.$metadata.attempts = attempts + 1; - lastError.$metadata.totalRetryDelay = totalRetryDelay; - throw lastError; - } - attempts = retryToken.getRetryCount(); - const delay2 = retryToken.getRetryDelay(); - totalRetryDelay += delay2; - await new Promise((resolve8) => setTimeout(resolve8, delay2)); - } - } - } else { - retryStrategy = retryStrategy; - if (retryStrategy?.mode) - context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; - return retryStrategy.retry(next, args); - } - }; - var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined"; - var getRetryErrorInfo = (error41) => { - const errorInfo = { - error: error41, - errorType: getRetryErrorType(error41) - }; - const retryAfterHint = getRetryAfterHint(error41.$response); - if (retryAfterHint) { - errorInfo.retryAfterHint = retryAfterHint; - } - return errorInfo; - }; - var getRetryErrorType = (error41) => { - if (serviceErrorClassification.isThrottlingError(error41)) - return "THROTTLING"; - if (serviceErrorClassification.isTransientError(error41)) - return "TRANSIENT"; - if (serviceErrorClassification.isServerError(error41)) - return "SERVER_ERROR"; - return "CLIENT_ERROR"; - }; - var retryMiddlewareOptions = { - name: "retryMiddleware", - tags: ["RETRY"], - step: "finalizeRequest", - priority: "high", - override: true - }; - var getRetryPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(retryMiddleware(options), retryMiddlewareOptions); - } - }); - var getRetryAfterHint = (response) => { - if (!protocolHttp.HttpResponse.isInstance(response)) - return; - const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); - if (!retryAfterHeaderName) - return; - const retryAfter = response.headers[retryAfterHeaderName]; - const retryAfterSeconds = Number(retryAfter); - if (!Number.isNaN(retryAfterSeconds)) - return new Date(retryAfterSeconds * 1000); - const retryAfterDate = new Date(retryAfter); - return retryAfterDate; - }; - exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; - exports.CONFIG_MAX_ATTEMPTS = CONFIG_MAX_ATTEMPTS; - exports.CONFIG_RETRY_MODE = CONFIG_RETRY_MODE; - exports.ENV_MAX_ATTEMPTS = ENV_MAX_ATTEMPTS; - exports.ENV_RETRY_MODE = ENV_RETRY_MODE; - exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = NODE_MAX_ATTEMPT_CONFIG_OPTIONS; - exports.NODE_RETRY_MODE_CONFIG_OPTIONS = NODE_RETRY_MODE_CONFIG_OPTIONS; - exports.StandardRetryStrategy = StandardRetryStrategy; - exports.defaultDelayDecider = defaultDelayDecider; - exports.defaultRetryDecider = defaultRetryDecider; - exports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; - exports.getRetryAfterHint = getRetryAfterHint; - exports.getRetryPlugin = getRetryPlugin; - exports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; - exports.omitRetryHeadersMiddlewareOptions = omitRetryHeadersMiddlewareOptions; - exports.resolveRetryConfig = resolveRetryConfig; - exports.retryMiddleware = retryMiddleware; - exports.retryMiddlewareOptions = retryMiddlewareOptions; -}); - -// ../node_modules/@aws-sdk/client-bedrock/dist-cjs/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider5 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthSchemeConfig = exports.defaultBedrockHttpAuthSchemeProvider = exports.defaultBedrockHttpAuthSchemeParametersProvider = undefined; - var core_1 = require_dist_cjs83(); - var core_2 = require_dist_cjs71(); - var util_middleware_1 = require_dist_cjs60(); - var defaultBedrockHttpAuthSchemeParametersProvider = async (config2, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config2.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports.defaultBedrockHttpAuthSchemeParametersProvider = defaultBedrockHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "bedrock", - region: authParameters.region - }, - propertiesExtractor: (config2, context) => ({ - signingProperties: { - config: config2, - context - } - }) - }; - } - function createSmithyApiHttpBearerAuthHttpAuthOption(authParameters) { - return { - schemeId: "smithy.api#httpBearerAuth", - propertiesExtractor: ({ profile, filepath, configFilepath, ignoreCache }, context) => ({ - identityProperties: { - profile, - filepath, - configFilepath, - ignoreCache - } - }) - }; - } - var defaultBedrockHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); - options.push(createSmithyApiHttpBearerAuthHttpAuthOption(authParameters)); - } - } - return options; - }; - exports.defaultBedrockHttpAuthSchemeProvider = defaultBedrockHttpAuthSchemeProvider; - var resolveHttpAuthSchemeConfig = (config2) => { - const token = (0, core_2.memoizeIdentityProvider)(config2.token, core_2.isIdentityExpired, core_2.doesIdentityRequireRefresh); - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config2); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config2.authSchemePreference ?? []), - token - }); - }; - exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; -}); - -// ../node_modules/@aws-sdk/client-bedrock/package.json -var require_package2 = __commonJS((exports, module) => { - module.exports = { name: "@aws-sdk/client-bedrock", main: "dist-cjs/index.js" }; -}); - -// ../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js -var require_dist_cjs94 = __commonJS((exports) => { - var client = require_client3(); - var propertyProvider = require_dist_cjs76(); - var ENV_KEY = "AWS_ACCESS_KEY_ID"; - var ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; - var ENV_SESSION = "AWS_SESSION_TOKEN"; - var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; - var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; - var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID"; - var fromEnv = (init) => async () => { - init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv"); - const accessKeyId = process.env[ENV_KEY]; - const secretAccessKey = process.env[ENV_SECRET]; - const sessionToken = process.env[ENV_SESSION]; - const expiry = process.env[ENV_EXPIRATION]; - const credentialScope = process.env[ENV_CREDENTIAL_SCOPE]; - const accountId = process.env[ENV_ACCOUNT_ID]; - if (accessKeyId && secretAccessKey) { - const credentials = { - accessKeyId, - secretAccessKey, - ...sessionToken && { sessionToken }, - ...expiry && { expiration: new Date(expiry) }, - ...credentialScope && { credentialScope }, - ...accountId && { accountId } - }; - client.setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g"); - return credentials; - } - throw new propertyProvider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger }); - }; - exports.ENV_ACCOUNT_ID = ENV_ACCOUNT_ID; - exports.ENV_CREDENTIAL_SCOPE = ENV_CREDENTIAL_SCOPE; - exports.ENV_EXPIRATION = ENV_EXPIRATION; - exports.ENV_KEY = ENV_KEY; - exports.ENV_SECRET = ENV_SECRET; - exports.ENV_SESSION = ENV_SESSION; - exports.fromEnv = fromEnv; -}); - -// ../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js -var require_dist_cjs95 = __commonJS((exports) => { - var propertyProvider = require_dist_cjs76(); - var url3 = __require("url"); - var buffer = __require("buffer"); - var http3 = __require("http"); - var nodeConfigProvider = require_dist_cjs89(); - var urlParser = require_dist_cjs74(); - function httpRequest(options) { - return new Promise((resolve8, reject2) => { - const req = http3.request({ - method: "GET", - ...options, - hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1") - }); - req.on("error", (err) => { - reject2(Object.assign(new propertyProvider.ProviderError("Unable to connect to instance metadata service"), err)); - req.destroy(); - }); - req.on("timeout", () => { - reject2(new propertyProvider.ProviderError("TimeoutError from instance metadata service")); - req.destroy(); - }); - req.on("response", (res) => { - const { statusCode = 400 } = res; - if (statusCode < 200 || 300 <= statusCode) { - reject2(Object.assign(new propertyProvider.ProviderError("Error response received from instance metadata service"), { statusCode })); - req.destroy(); - } - const chunks = []; - res.on("data", (chunk2) => { - chunks.push(chunk2); - }); - res.on("end", () => { - resolve8(buffer.Buffer.concat(chunks)); - req.destroy(); - }); - }); - req.end(); - }); - } - var isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string"; - var fromImdsCredentials = (creds) => ({ - accessKeyId: creds.AccessKeyId, - secretAccessKey: creds.SecretAccessKey, - sessionToken: creds.Token, - expiration: new Date(creds.Expiration), - ...creds.AccountId && { accountId: creds.AccountId } - }); - var DEFAULT_TIMEOUT = 1000; - var DEFAULT_MAX_RETRIES = 0; - var providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout }); - var retry = (toRetry, maxRetries) => { - let promise2 = toRetry(); - for (let i2 = 0;i2 < maxRetries; i2++) { - promise2 = promise2.catch(toRetry); - } - return promise2; - }; - var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; - var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; - var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; - var fromContainerMetadata = (init = {}) => { - const { timeout, maxRetries } = providerConfigFromInit(init); - return () => retry(async () => { - const requestOptions = await getCmdsUri({ logger: init.logger }); - const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); - if (!isImdsCredentials(credsResponse)) { - throw new propertyProvider.CredentialsProviderError("Invalid response received from instance metadata service.", { - logger: init.logger - }); - } - return fromImdsCredentials(credsResponse); - }, maxRetries); - }; - var requestFromEcsImds = async (timeout, options) => { - if (process.env[ENV_CMDS_AUTH_TOKEN]) { - options.headers = { - ...options.headers, - Authorization: process.env[ENV_CMDS_AUTH_TOKEN] - }; - } - const buffer2 = await httpRequest({ - ...options, - timeout - }); - return buffer2.toString(); - }; - var CMDS_IP = "169.254.170.2"; - var GREENGRASS_HOSTS = { - localhost: true, - "127.0.0.1": true - }; - var GREENGRASS_PROTOCOLS = { - "http:": true, - "https:": true - }; - var getCmdsUri = async ({ logger }) => { - if (process.env[ENV_CMDS_RELATIVE_URI]) { - return { - hostname: CMDS_IP, - path: process.env[ENV_CMDS_RELATIVE_URI] - }; - } - if (process.env[ENV_CMDS_FULL_URI]) { - const parsed = url3.parse(process.env[ENV_CMDS_FULL_URI]); - if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { - throw new propertyProvider.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, { - tryNextLink: false, - logger - }); - } - if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { - throw new propertyProvider.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, { - tryNextLink: false, - logger - }); - } - return { - ...parsed, - port: parsed.port ? parseInt(parsed.port, 10) : undefined - }; - } - throw new propertyProvider.CredentialsProviderError("The container metadata credential provider cannot be used unless" + ` the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment` + " variable is set", { - tryNextLink: false, - logger - }); - }; - - class InstanceMetadataV1FallbackError extends propertyProvider.CredentialsProviderError { - tryNextLink; - name = "InstanceMetadataV1FallbackError"; - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - Object.setPrototypeOf(this, InstanceMetadataV1FallbackError.prototype); - } - } - exports.Endpoint = undefined; - (function(Endpoint) { - Endpoint["IPv4"] = "http://169.254.169.254"; - Endpoint["IPv6"] = "http://[fd00:ec2::254]"; - })(exports.Endpoint || (exports.Endpoint = {})); - var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; - var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; - var ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => env4[ENV_ENDPOINT_NAME], - configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], - default: undefined - }; - var EndpointMode; - (function(EndpointMode2) { - EndpointMode2["IPv4"] = "IPv4"; - EndpointMode2["IPv6"] = "IPv6"; - })(EndpointMode || (EndpointMode = {})); - var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; - var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; - var ENDPOINT_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => env4[ENV_ENDPOINT_MODE_NAME], - configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], - default: EndpointMode.IPv4 - }; - var getInstanceMetadataEndpoint = async () => urlParser.parseUrl(await getFromEndpointConfig() || await getFromEndpointModeConfig()); - var getFromEndpointConfig = async () => nodeConfigProvider.loadConfig(ENDPOINT_CONFIG_OPTIONS)(); - var getFromEndpointModeConfig = async () => { - const endpointMode = await nodeConfigProvider.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)(); - switch (endpointMode) { - case EndpointMode.IPv4: - return exports.Endpoint.IPv4; - case EndpointMode.IPv6: - return exports.Endpoint.IPv6; - default: - throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode)}`); - } - }; - var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; - var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; - var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; - var getExtendedInstanceMetadataCredentials = (credentials, logger) => { - const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); - const newExpiration = new Date(Date.now() + refreshInterval * 1000); - logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these " + `credentials will be attempted after ${new Date(newExpiration)}. -For more information, please visit: ` + STATIC_STABILITY_DOC_URL); - const originalExpiration = credentials.originalExpiration ?? credentials.expiration; - return { - ...credentials, - ...originalExpiration ? { originalExpiration } : {}, - expiration: newExpiration - }; - }; - var staticStabilityProvider = (provider, options = {}) => { - const logger = options?.logger || console; - let pastCredentials; - return async () => { - let credentials; - try { - credentials = await provider(); - if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { - credentials = getExtendedInstanceMetadataCredentials(credentials, logger); - } - } catch (e) { - if (pastCredentials) { - logger.warn("Credential renew failed: ", e); - credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger); - } else { - throw e; - } - } - pastCredentials = credentials; - return credentials; - }; - }; - var IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; - var IMDS_TOKEN_PATH = "/latest/api/token"; - var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; - var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; - var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; - var fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }); - var getInstanceMetadataProvider = (init = {}) => { - let disableFetchToken = false; - const { logger, profile } = init; - const { timeout, maxRetries } = providerConfigFromInit(init); - const getCredentials = async (maxRetries2, options) => { - const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null; - if (isImdsV1Fallback) { - let fallbackBlockedFromProfile = false; - let fallbackBlockedFromProcessEnv = false; - const configValue = await nodeConfigProvider.loadConfig({ - environmentVariableSelector: (env4) => { - const envValue = env4[AWS_EC2_METADATA_V1_DISABLED]; - fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; - if (envValue === undefined) { - throw new propertyProvider.CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger }); - } - return fallbackBlockedFromProcessEnv; - }, - configFileSelector: (profile2) => { - const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; - fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; - return fallbackBlockedFromProfile; - }, - default: false - }, { - profile - })(); - if (init.ec2MetadataV1Disabled || configValue) { - const causes = []; - if (init.ec2MetadataV1Disabled) - causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); - if (fallbackBlockedFromProfile) - causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); - if (fallbackBlockedFromProcessEnv) - causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); - throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`); - } - } - const imdsProfile = (await retry(async () => { - let profile2; - try { - profile2 = await getProfile(options); - } catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return profile2; - }, maxRetries2)).trim(); - return retry(async () => { - let creds; - try { - creds = await getCredentialsFromProfile(imdsProfile, options, init); - } catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return creds; - }, maxRetries2); - }; - return async () => { - const endpoint = await getInstanceMetadataEndpoint(); - if (disableFetchToken) { - logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); - return getCredentials(maxRetries, { ...endpoint, timeout }); - } else { - let token; - try { - token = (await getMetadataToken({ ...endpoint, timeout })).toString(); - } catch (error41) { - if (error41?.statusCode === 400) { - throw Object.assign(error41, { - message: "EC2 Metadata token request returned error" - }); - } else if (error41.message === "TimeoutError" || [403, 404, 405].includes(error41.statusCode)) { - disableFetchToken = true; - } - logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); - return getCredentials(maxRetries, { ...endpoint, timeout }); - } - return getCredentials(maxRetries, { - ...endpoint, - headers: { - [X_AWS_EC2_METADATA_TOKEN]: token - }, - timeout - }); - } - }; - }; - var getMetadataToken = async (options) => httpRequest({ - ...options, - path: IMDS_TOKEN_PATH, - method: "PUT", - headers: { - "x-aws-ec2-metadata-token-ttl-seconds": "21600" - } - }); - var getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(); - var getCredentialsFromProfile = async (profile, options, init) => { - const credentialsResponse = JSON.parse((await httpRequest({ - ...options, - path: IMDS_PATH + profile - })).toString()); - if (!isImdsCredentials(credentialsResponse)) { - throw new propertyProvider.CredentialsProviderError("Invalid response received from instance metadata service.", { - logger: init.logger - }); - } - return fromImdsCredentials(credentialsResponse); - }; - exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; - exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; - exports.ENV_CMDS_AUTH_TOKEN = ENV_CMDS_AUTH_TOKEN; - exports.ENV_CMDS_FULL_URI = ENV_CMDS_FULL_URI; - exports.ENV_CMDS_RELATIVE_URI = ENV_CMDS_RELATIVE_URI; - exports.fromContainerMetadata = fromContainerMetadata; - exports.fromInstanceMetadata = fromInstanceMetadata; - exports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint; - exports.httpRequest = httpRequest; - exports.providerConfigFromInit = providerConfigFromInit; -}); - -// ../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js -var require_checkUrl2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.checkUrl = undefined; - var property_provider_1 = require_dist_cjs76(); - var ECS_CONTAINER_HOST = "169.254.170.2"; - var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23"; - var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]"; - var checkUrl = (url3, logger) => { - if (url3.protocol === "https:") { - return; - } - if (url3.hostname === ECS_CONTAINER_HOST || url3.hostname === EKS_CONTAINER_HOST_IPv4 || url3.hostname === EKS_CONTAINER_HOST_IPv6) { - return; - } - if (url3.hostname.includes("[")) { - if (url3.hostname === "[::1]" || url3.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") { - return; - } - } else { - if (url3.hostname === "localhost") { - return; - } - const ipComponents = url3.hostname.split("."); - const inRange3 = (component) => { - const num = parseInt(component, 10); - return 0 <= num && num <= 255; - }; - if (ipComponents[0] === "127" && inRange3(ipComponents[1]) && inRange3(ipComponents[2]) && inRange3(ipComponents[3]) && ipComponents.length === 4) { - return; - } - } - throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following: - - loopback CIDR 127.0.0.0/8 or [::1/128] - - ECS container host 169.254.170.2 - - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger }); - }; - exports.checkUrl = checkUrl; -}); - -// ../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js -var require_requestHelpers2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createGetRequest = createGetRequest; - exports.getCredentials = getCredentials; - var property_provider_1 = require_dist_cjs76(); - var protocol_http_1 = require_dist_cjs56(); - var smithy_client_1 = require_dist_cjs81(); - var util_stream_1 = require_dist_cjs69(); - function createGetRequest(url3) { - return new protocol_http_1.HttpRequest({ - protocol: url3.protocol, - hostname: url3.hostname, - port: Number(url3.port), - path: url3.pathname, - query: Array.from(url3.searchParams.entries()).reduce((acc, [k, v]) => { - acc[k] = v; - return acc; - }, {}), - fragment: url3.hash - }); - } - async function getCredentials(response, logger) { - const stream4 = (0, util_stream_1.sdkStreamMixin)(response.body); - const str = await stream4.transformToString(); - if (response.statusCode === 200) { - const parsed = JSON.parse(str); - if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") { - throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: " + "{ AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger }); - } - return { - accessKeyId: parsed.AccessKeyId, - secretAccessKey: parsed.SecretAccessKey, - sessionToken: parsed.Token, - expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration) - }; - } - if (response.statusCode >= 400 && response.statusCode < 500) { - let parsedBody = {}; - try { - parsedBody = JSON.parse(str); - } catch (e) {} - throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }), { - Code: parsedBody.Code, - Message: parsedBody.Message - }); - } - throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }); - } -}); - -// ../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js -var require_retry_wrapper2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.retryWrapper = undefined; - var retryWrapper = (toRetry, maxRetries, delayMs) => { - return async () => { - for (let i2 = 0;i2 < maxRetries; ++i2) { - try { - return await toRetry(); - } catch (e) { - await new Promise((resolve8) => setTimeout(resolve8, delayMs)); - } - } - return await toRetry(); - }; - }; - exports.retryWrapper = retryWrapper; -}); - -// ../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js -var require_fromHttp2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromHttp = undefined; - var tslib_1 = require_tslib2(); - var client_1 = require_client3(); - var node_http_handler_1 = require_dist_cjs68(); - var property_provider_1 = require_dist_cjs76(); - var promises_1 = tslib_1.__importDefault(__require("fs/promises")); - var checkUrl_1 = require_checkUrl2(); - var requestHelpers_1 = require_requestHelpers2(); - var retry_wrapper_1 = require_retry_wrapper2(); - var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; - var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2"; - var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; - var AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"; - var AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; - var fromHttp = (options = {}) => { - options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp"); - let host; - const 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 (relative3 && full) { - warn("@aws-sdk/credential-provider-http: " + "you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."); - warn("awsContainerCredentialsFullUri will take precedence."); - } - if (token && tokenFile) { - warn("@aws-sdk/credential-provider-http: " + "you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."); - warn("awsContainerAuthorizationToken will take precedence."); - } - if (full) { - host = full; - } else if (relative3) { - host = `${DEFAULT_LINK_LOCAL_HOST}${relative3}`; - } else { - throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided. -Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger }); - } - const url3 = new URL(host); - (0, checkUrl_1.checkUrl)(url3, options.logger); - const requestHandler = node_http_handler_1.NodeHttpHandler.create({ - requestTimeout: options.timeout ?? 1000, - connectionTimeout: options.timeout ?? 1000 - }); - return (0, retry_wrapper_1.retryWrapper)(async () => { - const request = (0, requestHelpers_1.createGetRequest)(url3); - if (token) { - request.headers.Authorization = token; - } else if (tokenFile) { - request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString(); - } - try { - const result2 = await requestHandler.handle(request); - return (0, requestHelpers_1.getCredentials)(result2.response).then((creds) => (0, client_1.setCredentialFeature)(creds, "CREDENTIALS_HTTP", "z")); - } catch (e) { - throw new property_provider_1.CredentialsProviderError(String(e), { logger: options.logger }); - } - }, options.maxRetries ?? 3, options.timeout ?? 1000); - }; - exports.fromHttp = fromHttp; -}); - -// ../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js -var require_dist_cjs96 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromHttp = undefined; - var fromHttp_1 = require_fromHttp2(); - Object.defineProperty(exports, "fromHttp", { enumerable: true, get: function() { - return fromHttp_1.fromHttp; - } }); -}); - -// ../node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js -var require_httpAuthSchemes2 = __commonJS((exports) => { - var protocolHttp = require_dist_cjs56(); - var core2 = require_dist_cjs71(); - var propertyProvider = require_dist_cjs76(); - var client = require_client3(); - var signatureV4 = require_dist_cjs78(); - var getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined; - var getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); - var isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000; - var getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { - const clockTimeInMs = Date.parse(clockTime); - if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { - return clockTimeInMs - Date.now(); - } - return currentSystemClockOffset; - }; - var throwSigningPropertyError = (name, property2) => { - if (!property2) { - throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); - } - return property2; - }; - var validateSigningProperties = async (signingProperties) => { - const context = throwSigningPropertyError("context", signingProperties.context); - const config2 = throwSigningPropertyError("config", signingProperties.config); - const authScheme = context.endpointV2?.properties?.authSchemes?.[0]; - const signerFunction = throwSigningPropertyError("signer", config2.signer); - const signer = await signerFunction(authScheme); - const signingRegion = signingProperties?.signingRegion; - const signingRegionSet = signingProperties?.signingRegionSet; - const signingName = signingProperties?.signingName; - return { - config: config2, - signer, - signingRegion, - signingRegionSet, - signingName - }; - }; - - class AwsSdkSigV4Signer { - async sign(httpRequest, identity4, signingProperties) { - if (!protocolHttp.HttpRequest.isInstance(httpRequest)) { - throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); - } - const validatedProps = await validateSigningProperties(signingProperties); - const { config: config2, signer } = validatedProps; - let { signingRegion, signingName } = validatedProps; - const handlerExecutionContext = signingProperties.context; - if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) { - const [first, second] = handlerExecutionContext.authSchemes; - if (first?.name === "sigv4a" && second?.name === "sigv4") { - signingRegion = second?.signingRegion ?? signingRegion; - signingName = second?.signingName ?? signingName; - } - } - const signedRequest = await signer.sign(httpRequest, { - signingDate: getSkewCorrectedDate(config2.systemClockOffset), - signingRegion, - signingService: signingName - }); - return signedRequest; - } - errorHandler(signingProperties) { - return (error41) => { - const serverTime = error41.ServerTime ?? getDateHeader(error41.$response); - if (serverTime) { - const config2 = throwSigningPropertyError("config", signingProperties.config); - const initialSystemClockOffset = config2.systemClockOffset; - config2.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config2.systemClockOffset); - const clockSkewCorrected = config2.systemClockOffset !== initialSystemClockOffset; - if (clockSkewCorrected && error41.$metadata) { - error41.$metadata.clockSkewCorrected = true; - } - } - throw error41; - }; - } - successHandler(httpResponse, signingProperties) { - const dateHeader = getDateHeader(httpResponse); - if (dateHeader) { - const config2 = throwSigningPropertyError("config", signingProperties.config); - config2.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config2.systemClockOffset); - } - } - } - var AWSSDKSigV4Signer = AwsSdkSigV4Signer; - - class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer { - async sign(httpRequest, identity4, signingProperties) { - if (!protocolHttp.HttpRequest.isInstance(httpRequest)) { - throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); - } - const { config: config2, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties); - const configResolvedSigningRegionSet = await config2.sigv4aSigningRegionSet?.(); - const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(","); - const signedRequest = await signer.sign(httpRequest, { - signingDate: getSkewCorrectedDate(config2.systemClockOffset), - signingRegion: multiRegionOverride, - signingService: signingName - }); - return signedRequest; - } - } - var getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; - var getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; - var NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; - var NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; - var NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { - environmentVariableSelector: (env4, options) => { - if (options?.signingName) { - const bearerTokenKey = getBearerTokenEnvKey(options.signingName); - if (bearerTokenKey in env4) - return ["httpBearerAuth"]; - } - if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env4)) - return; - return getArrayForCommaSeparatedString(env4[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); - }, - configFileSelector: (profile) => { - if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) - return; - return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); - }, - default: [] - }; - var resolveAwsSdkSigV4AConfig = (config2) => { - config2.sigv4aSigningRegionSet = core2.normalizeProvider(config2.sigv4aSigningRegionSet); - return config2; - }; - var NODE_SIGV4A_CONFIG_OPTIONS = { - environmentVariableSelector(env4) { - if (env4.AWS_SIGV4A_SIGNING_REGION_SET) { - return env4.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim()); - } - throw new propertyProvider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", { - tryNextLink: true - }); - }, - configFileSelector(profile) { - if (profile.sigv4a_signing_region_set) { - return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim()); - } - throw new propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", { - tryNextLink: true - }); - }, - default: undefined - }; - var resolveAwsSdkSigV4Config = (config2) => { - let inputCredentials = config2.credentials; - let isUserSupplied = !!config2.credentials; - let resolvedCredentials = undefined; - Object.defineProperty(config2, "credentials", { - set(credentials) { - if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { - isUserSupplied = true; - } - inputCredentials = credentials; - const memoizedProvider = normalizeCredentialProvider(config2, { - credentials: inputCredentials, - credentialDefaultProvider: config2.credentialDefaultProvider - }); - const boundProvider = bindCallerConfig(config2, memoizedProvider); - if (isUserSupplied && !boundProvider.attributed) { - resolvedCredentials = async (options) => boundProvider(options).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_CODE", "e")); - resolvedCredentials.memoized = boundProvider.memoized; - resolvedCredentials.configBound = boundProvider.configBound; - resolvedCredentials.attributed = true; - } else { - resolvedCredentials = boundProvider; - } - }, - get() { - return resolvedCredentials; - }, - enumerable: true, - configurable: true - }); - config2.credentials = inputCredentials; - const { signingEscapePath = true, systemClockOffset = config2.systemClockOffset || 0, sha256 } = config2; - let signer; - if (config2.signer) { - signer = core2.normalizeProvider(config2.signer); - } else if (config2.regionInfoProvider) { - signer = () => core2.normalizeProvider(config2.region)().then(async (region) => [ - await config2.regionInfoProvider(region, { - useFipsEndpoint: await config2.useFipsEndpoint(), - useDualstackEndpoint: await config2.useDualstackEndpoint() - }) || {}, - region - ]).then(([regionInfo, region]) => { - const { signingRegion, signingService } = regionInfo; - config2.signingRegion = config2.signingRegion || signingRegion || region; - config2.signingName = config2.signingName || signingService || config2.serviceId; - const params = { - ...config2, - credentials: config2.credentials, - region: config2.signingRegion, - service: config2.signingName, - sha256, - uriEscapePath: signingEscapePath - }; - const SignerCtor = config2.signerConstructor || signatureV4.SignatureV4; - return new SignerCtor(params); - }); - } else { - signer = async (authScheme) => { - authScheme = Object.assign({}, { - name: "sigv4", - signingName: config2.signingName || config2.defaultSigningName, - signingRegion: await core2.normalizeProvider(config2.region)(), - properties: {} - }, authScheme); - const signingRegion = authScheme.signingRegion; - const signingService = authScheme.signingName; - config2.signingRegion = config2.signingRegion || signingRegion; - config2.signingName = config2.signingName || signingService || config2.serviceId; - const params = { - ...config2, - credentials: config2.credentials, - region: config2.signingRegion, - service: config2.signingName, - sha256, - uriEscapePath: signingEscapePath - }; - const SignerCtor = config2.signerConstructor || signatureV4.SignatureV4; - return new SignerCtor(params); - }; - } - const resolvedConfig = Object.assign(config2, { - systemClockOffset, - signingEscapePath, - signer - }); - return resolvedConfig; - }; - var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; - function normalizeCredentialProvider(config2, { credentials, credentialDefaultProvider }) { - let credentialsProvider; - if (credentials) { - if (!credentials?.memoized) { - credentialsProvider = core2.memoizeIdentityProvider(credentials, core2.isIdentityExpired, core2.doesIdentityRequireRefresh); - } else { - credentialsProvider = credentials; - } - } else { - if (credentialDefaultProvider) { - credentialsProvider = core2.normalizeProvider(credentialDefaultProvider(Object.assign({}, config2, { - parentClientConfig: config2 - }))); - } 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(config2, credentialsProvider) { - if (credentialsProvider.configBound) { - return credentialsProvider; - } - const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config2 }); - fn.memoized = credentialsProvider.memoized; - fn.configBound = true; - return fn; - } - exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer; - exports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner; - exports.AwsSdkSigV4Signer = AwsSdkSigV4Signer; - exports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS; - exports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS; - exports.getBearerTokenEnvKey = getBearerTokenEnvKey; - exports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config; - exports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig; - exports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config; - exports.validateSigningProperties = validateSigningProperties; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider6 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthSchemeConfig = exports.defaultSSOOIDCHttpAuthSchemeProvider = exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = undefined; - var core_1 = require_dist_cjs83(); - var util_middleware_1 = require_dist_cjs60(); - var defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config2, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config2.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = defaultSSOOIDCHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "sso-oauth", - region: authParameters.region - }, - propertiesExtractor: (config2, context) => ({ - signingProperties: { - config: config2, - context - } - }) - }; - } - function createSmithyApiNoAuthHttpAuthOption(authParameters) { - return { - schemeId: "smithy.api#noAuth" - }; - } - var defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - case "CreateToken": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); - } - } - return options; - }; - exports.defaultSSOOIDCHttpAuthSchemeProvider = defaultSSOOIDCHttpAuthSchemeProvider; - var resolveHttpAuthSchemeConfig = (config2) => { - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config2); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config2.authSchemePreference ?? []) - }); - }; - exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/package.json -var require_package3 = __commonJS((exports, module) => { - module.exports = { name: "@aws-sdk/nested-clients", main: "dist-cjs/index.js" }; -}); - -// ../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js -var require_dist_cjs97 = __commonJS((exports) => { - var os3 = __require("os"); - var process12 = __require("process"); - var middlewareUserAgent = require_dist_cjs84(); - var crtAvailability = { - isCrtAvailable: false - }; - var isCrtAvailable = () => { - if (crtAvailability.isCrtAvailable) { - return ["md/crt-avail"]; - } - return null; - }; - var createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => { - return async (config2) => { - const sections = [ - ["aws-sdk-js", clientVersion], - ["ua", "2.1"], - [`os/${os3.platform()}`, os3.release()], - ["lang/js"], - ["md/nodejs", `${process12.versions.node}`] - ]; - const crtAvailable = isCrtAvailable(); - if (crtAvailable) { - sections.push(crtAvailable); - } - if (serviceId) { - sections.push([`api/${serviceId}`, clientVersion]); - } - if (process12.env.AWS_EXECUTION_ENV) { - sections.push([`exec-env/${process12.env.AWS_EXECUTION_ENV}`]); - } - const appId = await config2?.userAgentAppId?.(); - const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; - return resolvedUserAgent; - }; - }; - var defaultUserAgent = createDefaultUserAgentProvider; - var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; - var UA_APP_ID_INI_NAME = "sdk_ua_app_id"; - var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id"; - var NODE_APP_ID_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => env4[UA_APP_ID_ENV_NAME], - configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], - default: middlewareUserAgent.DEFAULT_UA_APP_ID - }; - exports.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS; - exports.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME; - exports.UA_APP_ID_INI_NAME = UA_APP_ID_INI_NAME; - exports.createDefaultUserAgentProvider = createDefaultUserAgentProvider; - exports.crtAvailability = crtAvailability; - exports.defaultUserAgent = defaultUserAgent; -}); - -// ../node_modules/@smithy/hash-node/dist-cjs/index.js -var require_dist_cjs98 = __commonJS((exports) => { - var utilBufferFrom = require_dist_cjs63(); - var utilUtf8 = require_dist_cjs64(); - var buffer = __require("buffer"); - var crypto3 = __require("crypto"); - - class Hash2 { - algorithmIdentifier; - secret; - hash; - constructor(algorithmIdentifier, secret) { - this.algorithmIdentifier = algorithmIdentifier; - this.secret = secret; - this.reset(); - } - update(toHash, encoding) { - this.hash.update(utilUtf8.toUint8Array(castSourceData(toHash, encoding))); - } - digest() { - return Promise.resolve(this.hash.digest()); - } - reset() { - this.hash = this.secret ? crypto3.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : crypto3.createHash(this.algorithmIdentifier); - } - } - function castSourceData(toCast, encoding) { - if (buffer.Buffer.isBuffer(toCast)) { - return toCast; - } - if (typeof toCast === "string") { - return utilBufferFrom.fromString(toCast, encoding); - } - if (ArrayBuffer.isView(toCast)) { - return utilBufferFrom.fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); - } - return utilBufferFrom.fromArrayBuffer(toCast); - } - exports.Hash = Hash2; -}); - -// ../node_modules/@smithy/util-body-length-node/dist-cjs/index.js -var require_dist_cjs99 = __commonJS((exports) => { - var node_fs = __require("node:fs"); - var calculateBodyLength = (body) => { - if (!body) { - return 0; - } - if (typeof body === "string") { - return Buffer.byteLength(body); - } else if (typeof body.byteLength === "number") { - return body.byteLength; - } else if (typeof body.size === "number") { - return body.size; - } else if (typeof body.start === "number" && typeof body.end === "number") { - return body.end + 1 - body.start; - } else if (body instanceof node_fs.ReadStream) { - if (body.path != null) { - return node_fs.lstatSync(body.path).size; - } else if (typeof body.fd === "number") { - return node_fs.fstatSync(body.fd).size; - } - } - throw new Error(`Body Length computation failed for ${body}`); - }; - exports.calculateBodyLength = calculateBodyLength; -}); - -// ../node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js -var require_protocols4 = __commonJS((exports) => { - var cbor = require_cbor2(); - var schema = require_schema2(); - var smithyClient = require_dist_cjs81(); - var protocols = require_protocols3(); - var serde = require_serde2(); - var utilBase64 = require_dist_cjs65(); - var utilUtf8 = require_dist_cjs64(); - var xmlBuilder = require_dist_cjs82(); - - class ProtocolLib { - queryCompat; - constructor(queryCompat = false) { - this.queryCompat = queryCompat; - } - resolveRestContentType(defaultContentType, inputSchema) { - const members = inputSchema.getMemberSchemas(); - const httpPayloadMember = Object.values(members).find((m) => { - return !!m.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((m) => { - const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m.getMergedTraits(); - const noPrefixHeaders = httpPrefixHeaders === undefined; - return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders; - }); - if (hasBody) { - return defaultContentType; - } - } - } - async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) { - let namespace = defaultNamespace; - let errorName = errorIdentifier; - if (errorIdentifier.includes("#")) { - [namespace, errorName] = errorIdentifier.split("#"); - } - const errorMetadata = { - $metadata: metadata, - $fault: response.statusCode < 500 ? "client" : "server" - }; - const registry2 = schema.TypeRegistry.for(namespace); - try { - const errorSchema = getErrorSchema?.(registry2, errorName) ?? registry2.getSchema(errorIdentifier); - return { errorSchema, errorMetadata }; - } catch (e) { - dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError"; - const synthetic = schema.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 error41 = smithyClient.decorateServiceException(exception, additions); - if (msg) { - error41.Message = msg; - error41.message = msg; - } - return error41; - } - return smithyClient.decorateServiceException(exception, additions); - } - setQueryCompatError(output, response) { - const queryErrorHeader = response.headers?.["x-amzn-query-error"]; - if (output !== undefined && queryErrorHeader != null) { - const [Code, Type] = queryErrorHeader.split(";"); - const entries = Object.entries(output); - const Error2 = { - Code, - Type - }; - Object.assign(output, Error2); - for (const [k, v] of entries) { - Error2[k] = v; - } - 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; - } - } - } - - class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol { - awsQueryCompatible; - mixin; - constructor({ defaultNamespace, awsQueryCompatible }) { - super({ defaultNamespace }); - this.awsQueryCompatible = !!awsQueryCompatible; - this.mixin = new ProtocolLib(this.awsQueryCompatible); - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - if (this.awsQueryCompatible) { - request.headers["x-amzn-query-mode"] = "true"; - } - return request; - } - async handleError(operationSchema, context, response, dataObject, metadata) { - if (this.awsQueryCompatible) { - this.mixin.setQueryCompatError(dataObject, response); - } - const errorName = cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - const output = {}; - for (const [name, member] of ns.structIterator()) { - output[name] = this.deserializer.readValue(member, dataObject[name]); - } - if (this.awsQueryCompatible) { - this.mixin.queryCompatOutput(dataObject, output); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - } - var _toStr = (val) => { - if (val == null) { - return val; - } - if (typeof val === "number" || typeof val === "bigint") { - const warning = new Error(`Received number ${val} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); - return String(val); - } - if (typeof val === "boolean") { - const warning = new Error(`Received boolean ${val} where a string was expected.`); - warning.name = "Warning"; - console.warn(warning); - return String(val); - } - return val; - }; - var _toBool = (val) => { - if (val == null) { - return val; - } - if (typeof val === "string") { - const lowercase2 = val.toLowerCase(); - if (val !== "" && lowercase2 !== "false" && lowercase2 !== "true") { - const warning = new Error(`Received string "${val}" where a boolean was expected.`); - warning.name = "Warning"; - console.warn(warning); - } - return val !== "" && lowercase2 !== "false"; - } - return val; - }; - var _toNum = (val) => { - if (val == null) { - return val; - } - if (typeof val === "string") { - const num = Number(val); - if (num.toString() !== val) { - const warning = new Error(`Received string "${val}" where a number was expected.`); - warning.name = "Warning"; - console.warn(warning); - return val; - } - return num; - } - return val; - }; - - class SerdeContextConfig { - serdeContext; - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - } - } - function jsonReviver(key, value, context) { - if (context?.source) { - const numericString = context.source; - if (typeof value === "number") { - if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) { - const isFractional = numericString.includes("."); - if (isFractional) { - return new serde.NumericValue(numericString, "bigDecimal"); - } else { - return BigInt(numericString); - } - } - } - } - return value; - } - var collectBodyString = (streamBody, context) => smithyClient.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? utilUtf8.toUtf8)(body)); - var parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - try { - return JSON.parse(encoded); - } catch (e) { - if (e?.name === "SyntaxError") { - Object.defineProperty(e, "$responseBodyText", { - value: encoded - }); - } - throw e; - } - } - return {}; - }); - var parseJsonErrorBody = async (errorBody, context) => { - const value = await parseJsonBody(errorBody, context); - value.message = value.message ?? value.Message; - return value; - }; - var loadRestJsonErrorCode = (output, data) => { - const findKey3 = (object2, key) => Object.keys(object2).find((k) => k.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]; - } - return cleanValue; - }; - const headerKey = findKey3(output.headers, "x-amzn-errortype"); - if (headerKey !== undefined) { - return sanitizeErrorCode(output.headers[headerKey]); - } - if (data && typeof data === "object") { - const codeKey = findKey3(data, "code"); - if (codeKey && data[codeKey] !== undefined) { - return sanitizeErrorCode(data[codeKey]); - } - if (data["__type"] !== undefined) { - return sanitizeErrorCode(data["__type"]); - } - } - }; - - class JsonShapeDeserializer extends SerdeContextConfig { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - async read(schema2, data) { - return this._read(schema2, typeof data === "string" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext)); - } - readObject(schema2, data) { - return this._read(schema2, data); - } - _read(schema$1, value) { - const isObject5 = value !== null && typeof value === "object"; - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isListSchema() && Array.isArray(value)) { - const listMember = ns.getValueSchema(); - const out = []; - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._read(listMember, item)); - } - } - return out; - } else if (ns.isMapSchema() && isObject5) { - const mapMember = ns.getValueSchema(); - const out = {}; - const sparse = !!ns.getMergedTraits().sparse; - for (const [_k, _v] of Object.entries(value)) { - if (sparse || _v != null) { - out[_k] = this._read(mapMember, _v); - } - } - return out; - } else if (ns.isStructSchema() && isObject5) { - const out = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - const fromKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName; - const deserializedValue = this._read(memberSchema, value[fromKey]); - if (deserializedValue != null) { - out[memberName] = deserializedValue; - } - } - return out; - } - if (ns.isBlobSchema() && typeof value === "string") { - return utilBase64.fromBase64(value); - } - const mediaType = ns.getMergedTraits().mediaType; - if (ns.isStringSchema() && typeof value === "string" && mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - return serde.LazyJsonString.from(value); - } - } - if (ns.isTimestampSchema() && value != null) { - const format3 = protocols.determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - return serde.parseRfc3339DateTimeWithOffset(value); - case 6: - return serde.parseRfc7231DateTime(value); - case 7: - return serde.parseEpochTimestamp(value); - default: - console.warn("Missing timestamp format, parsing value with Date constructor:", value); - return new Date(value); - } - } - if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) { - return BigInt(value); - } - if (ns.isBigDecimalSchema() && value != null) { - if (value instanceof serde.NumericValue) { - return value; - } - const untyped = value; - if (untyped.type === "bigDecimal" && "string" in untyped) { - return new serde.NumericValue(untyped.string, untyped.type); - } - return new serde.NumericValue(String(value), "bigDecimal"); - } - if (ns.isNumericSchema() && typeof value === "string") { - switch (value) { - case "Infinity": - return Infinity; - case "-Infinity": - return -Infinity; - case "NaN": - return NaN; - } - } - if (ns.isDocumentSchema()) { - if (isObject5) { - const out = Array.isArray(value) ? [] : {}; - for (const [k, v] of Object.entries(value)) { - if (v instanceof serde.NumericValue) { - out[k] = v; - } else { - out[k] = this._read(ns, v); - } - } - return out; - } else { - return structuredClone(value); - } - } - return value; - } - } - var NUMERIC_CONTROL_CHAR = String.fromCharCode(925); - - class JsonReplacer { - values = 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 serde.NumericValue) { - const v = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string; - this.values.set(`"${v}"`, value.string); - return v; - } - if (typeof value === "bigint") { - const s = value.toString(); - const v = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s; - this.values.set(`"${v}"`, s); - return v; - } - return value; - }; - } - replaceInJson(json2) { - 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 json2; - } - for (const [key, value] of this.values) { - json2 = json2.replace(key, value); - } - return json2; - } - } - - class JsonShapeSerializer extends SerdeContextConfig { - settings; - buffer; - rootSchema; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema$1, value) { - this.rootSchema = schema.NormalizedSchema.of(schema$1); - this.buffer = this._write(this.rootSchema, value); - } - writeDiscriminatedDocument(schema$1, value) { - this.write(schema$1, value); - if (typeof this.buffer === "object") { - this.buffer.__type = schema.NormalizedSchema.of(schema$1).getName(true); - } - } - flush() { - const { rootSchema } = this; - this.rootSchema = undefined; - if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) { - const replacer = new JsonReplacer; - return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0)); - } - return this.buffer; - } - _write(schema$1, value, container) { - const isObject5 = value !== null && typeof value === "object"; - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isListSchema() && Array.isArray(value)) { - const listMember = ns.getValueSchema(); - const out = []; - const sparse = !!ns.getMergedTraits().sparse; - for (const item of value) { - if (sparse || item != null) { - out.push(this._write(listMember, item)); - } - } - return out; - } else if (ns.isMapSchema() && isObject5) { - const mapMember = ns.getValueSchema(); - const out = {}; - const sparse = !!ns.getMergedTraits().sparse; - for (const [_k, _v] of Object.entries(value)) { - if (sparse || _v != null) { - out[_k] = this._write(mapMember, _v); - } - } - return out; - } else if (ns.isStructSchema() && isObject5) { - const out = {}; - for (const [memberName, memberSchema] of ns.structIterator()) { - const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName; - const serializableValue = this._write(memberSchema, value[memberName], ns); - if (serializableValue !== undefined) { - out[targetKey] = serializableValue; - } - } - return out; - } - if (value === null && container?.isStructSchema()) { - return; - } - if (ns.isBlobSchema() && (value instanceof Uint8Array || typeof value === "string") || ns.isDocumentSchema() && value instanceof Uint8Array) { - if (ns === this.rootSchema) { - return value; - } - return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - } - if ((ns.isTimestampSchema() || ns.isDocumentSchema()) && value instanceof Date) { - const format3 = protocols.determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - return value.toISOString().replace(".000Z", "Z"); - case 6: - return serde.dateToUtcString(value); - case 7: - return value.getTime() / 1000; - default: - console.warn("Missing timestamp format, using epoch seconds", value); - return value.getTime() / 1000; - } - } - if (ns.isNumericSchema() && typeof value === "number") { - if (Math.abs(value) === Infinity || isNaN(value)) { - return String(value); - } - } - if (ns.isStringSchema()) { - if (typeof value === "undefined" && ns.isIdempotencyToken()) { - return serde.generateIdempotencyToken(); - } - const mediaType = ns.getMergedTraits().mediaType; - if (value != null && mediaType) { - const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); - if (isJson) { - return serde.LazyJsonString.from(value); - } - } - } - if (ns.isDocumentSchema()) { - if (isObject5) { - const out = Array.isArray(value) ? [] : {}; - for (const [k, v] of Object.entries(value)) { - if (v instanceof serde.NumericValue) { - out[k] = v; - } else { - out[k] = this._write(ns, v); - } - } - return out; - } else { - return structuredClone(value); - } - } - return value; - } - } - - class JsonCodec 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; - } - } - - class AwsJsonRpcProtocol extends protocols.RpcProtocol { - serializer; - deserializer; - serviceTarget; - codec; - mixin; - awsQueryCompatible; - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible }) { - super({ - defaultNamespace - }); - this.serviceTarget = serviceTarget; - this.codec = new JsonCodec({ - timestampFormat: { - useTrait: true, - default: 7 - }, - jsonName: false - }); - this.serializer = this.codec.createSerializer(); - this.deserializer = this.codec.createDeserializer(); - this.awsQueryCompatible = !!awsQueryCompatible; - this.mixin = new ProtocolLib(this.awsQueryCompatible); - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - if (!request.path.endsWith("/")) { - request.path += "/"; - } - Object.assign(request.headers, { - "content-type": `application/x-amz-json-${this.getJsonRpcVersion()}`, - "x-amz-target": `${this.serviceTarget}.${operationSchema.name}` - }); - if (this.awsQueryCompatible) { - request.headers["x-amzn-query-mode"] = "true"; - } - if (schema.deref(operationSchema.input) === "unit" || !request.body) { - request.body = "{}"; - } - return request; - } - getPayloadCodec() { - return this.codec; - } - async handleError(operationSchema, context, response, dataObject, metadata) { - if (this.awsQueryCompatible) { - this.mixin.setQueryCompatError(dataObject, response); - } - const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().jsonName ?? name; - output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]); - } - if (this.awsQueryCompatible) { - this.mixin.queryCompatOutput(dataObject, output); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - } - - class AwsJson1_0Protocol extends AwsJsonRpcProtocol { - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible }) { - super({ - defaultNamespace, - serviceTarget, - awsQueryCompatible - }); - } - getShapeId() { - return "aws.protocols#awsJson1_0"; - } - getJsonRpcVersion() { - return "1.0"; - } - getDefaultContentType() { - return "application/x-amz-json-1.0"; - } - } - - class AwsJson1_1Protocol extends AwsJsonRpcProtocol { - constructor({ defaultNamespace, serviceTarget, awsQueryCompatible }) { - super({ - defaultNamespace, - serviceTarget, - awsQueryCompatible - }); - } - getShapeId() { - return "aws.protocols#awsJson1_1"; - } - getJsonRpcVersion() { - return "1.1"; - } - getDefaultContentType() { - return "application/x-amz-json-1.1"; - } - } - - class AwsRestJsonProtocol extends protocols.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 protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); - this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); - } - getShapeId() { - return "aws.protocols#restJson1"; - } - getPayloadCodec() { - return this.codec; - } - setSerdeContext(serdeContext) { - this.codec.setSerdeContext(serdeContext); - super.setSerdeContext(serdeContext); - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - const inputSchema = schema.NormalizedSchema.of(operationSchema.input); - if (!request.headers["content-type"]) { - const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); - if (contentType) { - request.headers["content-type"] = contentType; - } - } - if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) { - request.body = "{}"; - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - const output = await super.deserializeResponse(operationSchema, context, response); - const outputSchema = schema.NormalizedSchema.of(operationSchema.output); - for (const [name, member] of outputSchema.structIterator()) { - if (member.getMemberTraits().httpPayload && !(name in output)) { - output[name] = null; - } - } - return output; - } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - await this.deserializeHttpMessage(errorSchema, context, response, dataObject); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().jsonName ?? name; - output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - getDefaultContentType() { - return "application/json"; - } - } - var awsExpectUnion = (value) => { - if (value == null) { - return; - } - if (typeof value === "object" && "__type" in value) { - delete value.__type; - } - return smithyClient.expectUnion(value); - }; - - class XmlShapeDeserializer extends SerdeContextConfig { - settings; - stringDeserializer; - constructor(settings) { - super(); - this.settings = settings; - this.stringDeserializer = new protocols.FromStringShapeDeserializer(settings); - } - setSerdeContext(serdeContext) { - this.serdeContext = serdeContext; - this.stringDeserializer.setSerdeContext(serdeContext); - } - read(schema$1, bytes, key) { - const ns = schema.NormalizedSchema.of(schema$1); - const memberSchemas = ns.getMemberSchemas(); - const isEventPayload = ns.isStructSchema() && ns.isMemberSchema() && !!Object.values(memberSchemas).find((memberNs) => { - return !!memberNs.getMemberTraits().eventPayload; - }); - if (isEventPayload) { - const output = {}; - const memberName = Object.keys(memberSchemas)[0]; - const eventMemberSchema = memberSchemas[memberName]; - if (eventMemberSchema.isBlobSchema()) { - output[memberName] = bytes; - } else { - output[memberName] = this.read(memberSchemas[memberName], bytes); - } - return output; - } - const xmlString = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(bytes); - const parsedObject = this.parseXml(xmlString); - return this.readSchema(schema$1, key ? parsedObject[key] : parsedObject); - } - readSchema(_schema, value) { - const ns = schema.NormalizedSchema.of(_schema); - if (ns.isUnitSchema()) { - return; - } - const traits = ns.getMergedTraits(); - if (ns.isListSchema() && !Array.isArray(value)) { - return this.readSchema(ns, [value]); - } - if (value == null) { - return value; - } - if (typeof value === "object") { - const sparse = !!traits.sparse; - const flat = !!traits.xmlFlattened; - if (ns.isListSchema()) { - const listValue = ns.getValueSchema(); - const buffer2 = []; - const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; - const source = flat ? value : (value[0] ?? value)[sourceKey]; - const sourceArray = Array.isArray(source) ? source : [source]; - for (const v of sourceArray) { - if (v != null || sparse) { - buffer2.push(this.readSchema(listValue, v)); - } - } - return buffer2; - } - const buffer = {}; - if (ns.isMapSchema()) { - const keyNs = ns.getKeySchema(); - const memberNs = ns.getValueSchema(); - let entries; - if (flat) { - entries = Array.isArray(value) ? value : [value]; - } else { - entries = Array.isArray(value.entry) ? value.entry : [value.entry]; - } - const keyProperty = keyNs.getMergedTraits().xmlName ?? "key"; - const valueProperty = memberNs.getMergedTraits().xmlName ?? "value"; - for (const entry of entries) { - const key = entry[keyProperty]; - const value2 = entry[valueProperty]; - if (value2 != null || sparse) { - buffer[key] = this.readSchema(memberNs, value2); - } - } - return buffer; - } - if (ns.isStructSchema()) { - for (const [memberName, memberSchema] of ns.structIterator()) { - const memberTraits = memberSchema.getMergedTraits(); - const xmlObjectKey = !memberTraits.httpPayload ? memberSchema.getMemberTraits().xmlName ?? memberName : memberTraits.xmlName ?? memberSchema.getName(); - if (value[xmlObjectKey] != null) { - buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); - } - } - return buffer; - } - if (ns.isDocumentSchema()) { - return value; - } - throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`); - } - if (ns.isListSchema()) { - return []; - } - if (ns.isMapSchema() || ns.isStructSchema()) { - return {}; - } - return this.stringDeserializer.read(ns, value); - } - parseXml(xml) { - if (xml.length) { - let parsedObj; - try { - parsedObj = xmlBuilder.parseXML(xml); - } catch (e) { - if (e && typeof e === "object") { - Object.defineProperty(e, "$responseBodyText", { - value: xml - }); - } - throw e; - } - const textNodeName = "#text"; - const key = Object.keys(parsedObj)[0]; - const parsedObjToReturn = parsedObj[key]; - if (parsedObjToReturn[textNodeName]) { - parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; - delete parsedObjToReturn[textNodeName]; - } - return smithyClient.getValueFromTextNode(parsedObjToReturn); - } - return {}; - } - } - - class QueryShapeSerializer extends SerdeContextConfig { - settings; - buffer; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema$1, value, prefix = "") { - if (this.buffer === undefined) { - this.buffer = ""; - } - const ns = schema.NormalizedSchema.of(schema$1); - if (prefix && !prefix.endsWith(".")) { - prefix += "."; - } - if (ns.isBlobSchema()) { - if (typeof value === "string" || value instanceof Uint8Array) { - this.writeKey(prefix); - this.writeValue((this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value)); - } - } else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(String(value)); - } else if (ns.isIdempotencyToken()) { - this.writeKey(prefix); - this.writeValue(serde.generateIdempotencyToken()); - } - } else if (ns.isBigIntegerSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(String(value)); - } - } else if (ns.isBigDecimalSchema()) { - if (value != null) { - this.writeKey(prefix); - this.writeValue(value instanceof serde.NumericValue ? value.string : String(value)); - } - } else if (ns.isTimestampSchema()) { - if (value instanceof Date) { - this.writeKey(prefix); - const format3 = protocols.determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - this.writeValue(value.toISOString().replace(".000Z", "Z")); - break; - case 6: - this.writeValue(smithyClient.dateToUtcString(value)); - break; - case 7: - this.writeValue(String(value.getTime() / 1000)); - break; - } - } - } else if (ns.isDocumentSchema()) { - throw new Error(`@aws-sdk/core/protocols - QuerySerializer unsupported document type ${ns.getName(true)}`); - } else if (ns.isListSchema()) { - if (Array.isArray(value)) { - if (value.length === 0) { - if (this.settings.serializeEmptyLists) { - this.writeKey(prefix); - this.writeValue(""); - } - } else { - const member = ns.getValueSchema(); - const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened; - let i2 = 1; - for (const item of value) { - if (item == null) { - continue; - } - const suffix = this.getKey("member", member.getMergedTraits().xmlName); - const key = flat ? `${prefix}${i2}` : `${prefix}${suffix}.${i2}`; - this.write(member, item, key); - ++i2; - } - } - } - } else if (ns.isMapSchema()) { - if (value && typeof value === "object") { - const keySchema = ns.getKeySchema(); - const memberSchema = ns.getValueSchema(); - const flat = ns.getMergedTraits().xmlFlattened; - let i2 = 1; - for (const [k, v] of Object.entries(value)) { - if (v == null) { - continue; - } - const keySuffix = this.getKey("key", keySchema.getMergedTraits().xmlName); - const key = flat ? `${prefix}${i2}.${keySuffix}` : `${prefix}entry.${i2}.${keySuffix}`; - const valueSuffix = this.getKey("value", memberSchema.getMergedTraits().xmlName); - const valueKey = flat ? `${prefix}${i2}.${valueSuffix}` : `${prefix}entry.${i2}.${valueSuffix}`; - this.write(keySchema, k, key); - this.write(memberSchema, v, valueKey); - ++i2; - } - } - } else if (ns.isStructSchema()) { - if (value && typeof value === "object") { - for (const [memberName, member] of ns.structIterator()) { - if (value[memberName] == null && !member.isIdempotencyToken()) { - continue; - } - const suffix = this.getKey(memberName, member.getMergedTraits().xmlName); - const key = `${prefix}${suffix}`; - this.write(member, value[memberName], key); - } - } - } else if (ns.isUnitSchema()) - ; - else { - throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`); - } - } - flush() { - if (this.buffer === undefined) { - throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer."); - } - const str = this.buffer; - delete this.buffer; - return str; - } - getKey(memberName, xmlName) { - const key = xmlName ?? memberName; - if (this.settings.capitalizeKeys) { - return key[0].toUpperCase() + key.slice(1); - } - return key; - } - writeKey(key) { - if (key.endsWith(".")) { - key = key.slice(0, key.length - 1); - } - this.buffer += `&${protocols.extendedEncodeURIComponent(key)}=`; - } - writeValue(value) { - this.buffer += protocols.extendedEncodeURIComponent(value); - } - } - - class AwsQueryProtocol extends protocols.RpcProtocol { - 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, context) { - const request = await super.serializeRequest(operationSchema, input, context); - if (!request.path.endsWith("/")) { - request.path += "/"; - } - Object.assign(request.headers, { - "content-type": `application/x-www-form-urlencoded` - }); - if (schema.deref(operationSchema.input) === "unit" || !request.body) { - request.body = ""; - } - const action = operationSchema.name.split("#")[1] ?? operationSchema.name; - request.body = `Action=${action}&Version=${this.options.version}` + request.body; - if (request.body.endsWith("&")) { - request.body = request.body.slice(-1); - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - const deserializer = this.deserializer; - const ns = schema.NormalizedSchema.of(operationSchema.output); - const dataObject = {}; - if (response.statusCode >= 300) { - const bytes2 = await protocols.collectBody(response.body, context); - if (bytes2.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(15, bytes2)); - } - await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); - } - for (const header in response.headers) { - const value = response.headers[header]; - delete response.headers[header]; - response.headers[header.toLowerCase()] = value; - } - const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name; - const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : undefined; - const bytes = await protocols.collectBody(response.body, context); - if (bytes.byteLength > 0) { - Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey)); - } - const output = { - $metadata: this.deserializeMetadata(response), - ...dataObject - }; - return output; - } - useNestedResult() { - return true; - } - async handleError(operationSchema, context, response, dataObject, metadata) { - 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, metadata, (registry2, errorName) => { - try { - return registry2.getSchema(errorName); - } catch (e) { - return registry2.find((schema$1) => schema.NormalizedSchema.of(schema$1).getMergedTraits().awsQueryError?.[0] === errorName); - } - }); - const ns = schema.NormalizedSchema.of(errorSchema); - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - const output = { - Error: errorData.Error - }; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().xmlName ?? name; - const value = errorData[target] ?? dataObject[target]; - output[name] = this.deserializer.readSchema(member, value); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - loadQueryErrorCode(output, data) { - const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code; - if (code !== undefined) { - 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"; - } - } - - class AwsEc2QueryProtocol extends AwsQueryProtocol { - options; - constructor(options) { - super(options); - this.options = options; - const ec2Settings = { - capitalizeKeys: true, - flattenLists: true, - serializeEmptyLists: false - }; - Object.assign(this.serializer.settings, ec2Settings); - } - useNestedResult() { - return false; - } - } - var parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - let parsedObj; - try { - parsedObj = xmlBuilder.parseXML(encoded); - } catch (e) { - if (e && typeof e === "object") { - Object.defineProperty(e, "$responseBodyText", { - value: encoded - }); - } - throw e; - } - const textNodeName = "#text"; - const key = Object.keys(parsedObj)[0]; - const parsedObjToReturn = parsedObj[key]; - if (parsedObjToReturn[textNodeName]) { - parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; - delete parsedObjToReturn[textNodeName]; - } - return smithyClient.getValueFromTextNode(parsedObjToReturn); - } - return {}; - }); - var parseXmlErrorBody = async (errorBody, context) => { - const value = await parseXmlBody(errorBody, context); - if (value.Error) { - value.Error.message = value.Error.message ?? value.Error.Message; - } - return value; - }; - var loadRestXmlErrorCode = (output, data) => { - if (data?.Error?.Code !== undefined) { - return data.Error.Code; - } - if (data?.Code !== undefined) { - return data.Code; - } - if (output.statusCode == 404) { - return "NotFound"; - } - }; - - class XmlShapeSerializer extends SerdeContextConfig { - settings; - stringBuffer; - byteBuffer; - buffer; - constructor(settings) { - super(); - this.settings = settings; - } - write(schema$1, value) { - const ns = schema.NormalizedSchema.of(schema$1); - if (ns.isStringSchema() && typeof value === "string") { - this.stringBuffer = value; - } else if (ns.isBlobSchema()) { - this.byteBuffer = "byteLength" in value ? value : (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value); - } else { - this.buffer = this.writeStruct(ns, value, undefined); - const traits = ns.getMergedTraits(); - if (traits.httpPayload && !traits.xmlName) { - this.buffer.withName(ns.getName()); - } - } - } - flush() { - if (this.byteBuffer !== undefined) { - const bytes = this.byteBuffer; - delete this.byteBuffer; - return bytes; - } - if (this.stringBuffer !== undefined) { - const str = this.stringBuffer; - delete this.stringBuffer; - return str; - } - const buffer = this.buffer; - if (this.settings.xmlNamespace) { - if (!buffer?.attributes?.["xmlns"]) { - buffer.addAttribute("xmlns", this.settings.xmlNamespace); - } - } - delete this.buffer; - return buffer.toString(); - } - writeStruct(ns, value, parentXmlns) { - const traits = ns.getMergedTraits(); - const name = ns.isMemberSchema() && !traits.httpPayload ? ns.getMemberTraits().xmlName ?? ns.getMemberName() : traits.xmlName ?? ns.getName(); - if (!name || !ns.isStructSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`); - } - const structXmlNode = xmlBuilder.XmlNode.of(name); - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); - for (const [memberName, memberSchema] of ns.structIterator()) { - const val = value[memberName]; - if (val != null || memberSchema.isIdempotencyToken()) { - if (memberSchema.getMergedTraits().xmlAttribute) { - structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val)); - continue; - } - if (memberSchema.isListSchema()) { - this.writeList(memberSchema, val, structXmlNode, xmlns); - } else if (memberSchema.isMapSchema()) { - this.writeMap(memberSchema, val, structXmlNode, xmlns); - } else if (memberSchema.isStructSchema()) { - structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns)); - } else { - const memberNode = xmlBuilder.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName()); - this.writeSimpleInto(memberSchema, val, memberNode, xmlns); - structXmlNode.addChildNode(memberNode); - } - } - } - if (xmlns) { - structXmlNode.addAttribute(xmlnsAttr, xmlns); - } - return structXmlNode; - } - writeList(listMember, array2, container, parentXmlns) { - if (!listMember.isMemberSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`); - } - const listTraits = listMember.getMergedTraits(); - const listValueSchema = listMember.getValueSchema(); - const listValueTraits = listValueSchema.getMergedTraits(); - const sparse = !!listValueTraits.sparse; - const flat = !!listTraits.xmlFlattened; - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns); - const writeItem = (container2, value) => { - if (listValueSchema.isListSchema()) { - this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container2, xmlns); - } else if (listValueSchema.isMapSchema()) { - this.writeMap(listValueSchema, value, container2, xmlns); - } else if (listValueSchema.isStructSchema()) { - const struct = this.writeStruct(listValueSchema, value, xmlns); - container2.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member")); - } else { - const listItemNode = xmlBuilder.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"); - this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns); - container2.addChildNode(listItemNode); - } - }; - if (flat) { - for (const value of array2) { - if (sparse || value != null) { - writeItem(container, value); - } - } - } else { - const listNode = xmlBuilder.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName()); - if (xmlns) { - listNode.addAttribute(xmlnsAttr, xmlns); - } - for (const value of array2) { - if (sparse || value != null) { - writeItem(listNode, value); - } - } - container.addChildNode(listNode); - } - } - writeMap(mapMember, map3, container, parentXmlns, containerIsMap = false) { - if (!mapMember.isMemberSchema()) { - throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`); - } - const mapTraits = mapMember.getMergedTraits(); - const mapKeySchema = mapMember.getKeySchema(); - const mapKeyTraits = mapKeySchema.getMergedTraits(); - const keyTag = mapKeyTraits.xmlName ?? "key"; - const mapValueSchema = mapMember.getValueSchema(); - const mapValueTraits = mapValueSchema.getMergedTraits(); - const valueTag = mapValueTraits.xmlName ?? "value"; - const sparse = !!mapValueTraits.sparse; - const flat = !!mapTraits.xmlFlattened; - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns); - const addKeyValue = (entry, key, val) => { - const keyNode = xmlBuilder.XmlNode.of(keyTag, key); - const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns); - if (keyXmlns) { - keyNode.addAttribute(keyXmlnsAttr, keyXmlns); - } - entry.addChildNode(keyNode); - let valueNode = xmlBuilder.XmlNode.of(valueTag); - if (mapValueSchema.isListSchema()) { - this.writeList(mapValueSchema, val, valueNode, xmlns); - } else if (mapValueSchema.isMapSchema()) { - this.writeMap(mapValueSchema, val, valueNode, xmlns, true); - } else if (mapValueSchema.isStructSchema()) { - valueNode = this.writeStruct(mapValueSchema, val, xmlns); - } else { - this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns); - } - entry.addChildNode(valueNode); - }; - if (flat) { - for (const [key, val] of Object.entries(map3)) { - if (sparse || val != null) { - const entry = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); - addKeyValue(entry, key, val); - container.addChildNode(entry); - } - } - } else { - let mapNode2; - if (!containerIsMap) { - mapNode2 = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); - if (xmlns) { - mapNode2.addAttribute(xmlnsAttr, xmlns); - } - container.addChildNode(mapNode2); - } - for (const [key, val] of Object.entries(map3)) { - if (sparse || val != null) { - const entry = xmlBuilder.XmlNode.of("entry"); - addKeyValue(entry, key, val); - (containerIsMap ? container : mapNode2).addChildNode(entry); - } - } - } - } - writeSimple(_schema, value) { - if (value === null) { - throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value."); - } - const ns = schema.NormalizedSchema.of(_schema); - let nodeContents = null; - if (value && typeof value === "object") { - if (ns.isBlobSchema()) { - nodeContents = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value); - } else if (ns.isTimestampSchema() && value instanceof Date) { - const format3 = protocols.determineTimestampFormat(ns, this.settings); - switch (format3) { - case 5: - nodeContents = value.toISOString().replace(".000Z", "Z"); - break; - case 6: - nodeContents = smithyClient.dateToUtcString(value); - break; - case 7: - nodeContents = String(value.getTime() / 1000); - break; - default: - console.warn("Missing timestamp format, using http date", value); - nodeContents = smithyClient.dateToUtcString(value); - break; - } - } else if (ns.isBigDecimalSchema() && value) { - if (value instanceof serde.NumericValue) { - return value.string; - } - return String(value); - } else if (ns.isMapSchema() || ns.isListSchema()) { - throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."); - } else { - throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`); - } - } - if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) { - nodeContents = String(value); - } - if (ns.isStringSchema()) { - if (value === undefined && ns.isIdempotencyToken()) { - nodeContents = serde.generateIdempotencyToken(); - } else { - nodeContents = String(value); - } - } - if (nodeContents === null) { - throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`); - } - return nodeContents; - } - writeSimpleInto(_schema, value, into, parentXmlns) { - const nodeContents = this.writeSimple(_schema, value); - const ns = schema.NormalizedSchema.of(_schema); - const content = new xmlBuilder.XmlText(nodeContents); - const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); - if (xmlns) { - into.addAttribute(xmlnsAttr, xmlns); - } - into.addChildNode(content); - } - getXmlnsAttribute(ns, parentXmlns) { - const traits = ns.getMergedTraits(); - const [prefix, xmlns] = traits.xmlNamespace ?? []; - if (xmlns && xmlns !== parentXmlns) { - return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns]; - } - return [undefined, undefined]; - } - } - - class XmlCodec extends SerdeContextConfig { - settings; - constructor(settings) { - super(); - this.settings = settings; - } - createSerializer() { - const serializer = new XmlShapeSerializer(this.settings); - serializer.setSerdeContext(this.serdeContext); - return serializer; - } - createDeserializer() { - const deserializer = new XmlShapeDeserializer(this.settings); - deserializer.setSerdeContext(this.serdeContext); - return deserializer; - } - } - - class AwsRestXmlProtocol extends protocols.HttpBindingProtocol { - codec; - serializer; - deserializer; - mixin = new ProtocolLib; - constructor(options) { - super(options); - const settings = { - timestampFormat: { - useTrait: true, - default: 5 - }, - httpBindings: true, - xmlNamespace: options.xmlNamespace, - serviceNamespace: options.defaultNamespace - }; - this.codec = new XmlCodec(settings); - this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); - this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); - } - getPayloadCodec() { - return this.codec; - } - getShapeId() { - return "aws.protocols#restXml"; - } - async serializeRequest(operationSchema, input, context) { - const request = await super.serializeRequest(operationSchema, input, context); - const inputSchema = schema.NormalizedSchema.of(operationSchema.input); - if (!request.headers["content-type"]) { - const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); - if (contentType) { - request.headers["content-type"] = contentType; - } - } - if (request.headers["content-type"] === this.getDefaultContentType()) { - if (typeof request.body === "string") { - request.body = '' + request.body; - } - } - return request; - } - async deserializeResponse(operationSchema, context, response) { - return super.deserializeResponse(operationSchema, context, response); - } - async handleError(operationSchema, context, response, dataObject, metadata) { - const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; - const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); - const ns = schema.NormalizedSchema.of(errorSchema); - const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; - const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; - const exception = new ErrorCtor(message); - await this.deserializeHttpMessage(errorSchema, context, response, dataObject); - const output = {}; - for (const [name, member] of ns.structIterator()) { - const target = member.getMergedTraits().xmlName ?? name; - const value = dataObject.Error?.[target] ?? dataObject[target]; - output[name] = this.codec.createDeserializer().readSchema(member, value); - } - throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { - $fault: ns.getMergedTraits().error, - message - }, output), dataObject); - } - getDefaultContentType() { - return "application/xml"; - } - } - exports.AwsEc2QueryProtocol = AwsEc2QueryProtocol; - exports.AwsJson1_0Protocol = AwsJson1_0Protocol; - exports.AwsJson1_1Protocol = AwsJson1_1Protocol; - exports.AwsJsonRpcProtocol = AwsJsonRpcProtocol; - exports.AwsQueryProtocol = AwsQueryProtocol; - exports.AwsRestJsonProtocol = AwsRestJsonProtocol; - exports.AwsRestXmlProtocol = AwsRestXmlProtocol; - exports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol; - exports.JsonCodec = JsonCodec; - exports.JsonShapeDeserializer = JsonShapeDeserializer; - exports.JsonShapeSerializer = JsonShapeSerializer; - exports.XmlCodec = XmlCodec; - exports.XmlShapeDeserializer = XmlShapeDeserializer; - exports.XmlShapeSerializer = XmlShapeSerializer; - exports._toBool = _toBool; - exports._toNum = _toNum; - exports._toStr = _toStr; - exports.awsExpectUnion = awsExpectUnion; - exports.loadRestJsonErrorCode = loadRestJsonErrorCode; - exports.loadRestXmlErrorCode = loadRestXmlErrorCode; - exports.parseJsonBody = parseJsonBody; - exports.parseJsonErrorBody = parseJsonErrorBody; - exports.parseXmlBody = parseXmlBody; - exports.parseXmlErrorBody = parseXmlErrorBody; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/ruleset.js -var require_ruleset5 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ruleSet = undefined; - var u2 = "required"; - var v = "fn"; - var w = "argv"; - var x2 = "ref"; - var a2 = true; - var b = "isSet"; - var c5 = "booleanEquals"; - var d = "error"; - var e = "endpoint"; - var f = "tree"; - var g = "PartitionResult"; - var h2 = "getAttr"; - var i2 = { [u2]: false, type: "string" }; - var j = { [u2]: true, default: false, type: "boolean" }; - var k = { [x2]: "Endpoint" }; - var l = { [v]: c5, [w]: [{ [x2]: "UseFIPS" }, true] }; - var m = { [v]: c5, [w]: [{ [x2]: "UseDualStack" }, true] }; - var n2 = {}; - var o2 = { [v]: h2, [w]: [{ [x2]: g }, "supportsFIPS"] }; - var p = { [x2]: g }; - var q = { [v]: c5, [w]: [true, { [v]: h2, [w]: [p, "supportsDualStack"] }] }; - var r = [l]; - var s = [m]; - var t = [{ [x2]: "Region" }]; - var _data = { version: "1.0", parameters: { Region: i2, UseDualStack: j, UseFIPS: j, Endpoint: i2 }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], 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: k, properties: n2, headers: n2 }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c5, [w]: [a2, o2] }, q], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, 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: [{ [v]: c5, [w]: [o2, a2] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h2, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n2, headers: n2 }, type: e }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, 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: n2, headers: n2 }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; - exports.ruleSet = _data; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/endpointResolver.js -var require_endpointResolver5 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultEndpointResolver = undefined; - var util_endpoints_1 = require_dist_cjs75(); - var util_endpoints_2 = require_dist_cjs72(); - var ruleset_1 = require_ruleset5(); - var cache2 = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] - }); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return cache2.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - })); - }; - exports.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.shared.js -var require_runtimeConfig_shared5 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var core_1 = require_dist_cjs83(); - var protocols_1 = require_protocols4(); - var core_2 = require_dist_cjs71(); - var smithy_client_1 = require_dist_cjs81(); - var url_parser_1 = require_dist_cjs74(); - var util_base64_1 = require_dist_cjs65(); - var util_utf8_1 = require_dist_cjs64(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider6(); - var endpointResolver_1 = require_endpointResolver5(); - var getRuntimeConfig = (config2) => { - return { - apiVersion: "2019-06-10", - base64Decoder: config2?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config2?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config2?.disableHostPrefix ?? false, - endpointProvider: config2?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config2?.extensions ?? [], - httpAuthSchemeProvider: config2?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOOIDCHttpAuthSchemeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner - } - ], - logger: config2?.logger ?? new smithy_client_1.NoOpLogger, - protocol: config2?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.ssooidc" }), - serviceId: config2?.serviceId ?? "SSO OIDC", - urlParser: config2?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config2?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config2?.utf8Encoder ?? util_utf8_1.toUtf8 - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js -var require_dist_cjs100 = __commonJS((exports) => { - var configResolver = require_dist_cjs86(); - var nodeConfigProvider = require_dist_cjs89(); - var propertyProvider = require_dist_cjs76(); - var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; - var AWS_REGION_ENV = "AWS_REGION"; - var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; - var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; - var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; - var IMDS_REGION_PATH = "/latest/meta-data/placement/region"; - var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; - var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; - var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env4) => { - return env4[AWS_DEFAULTS_MODE_ENV]; - }, - configFileSelector: (profile) => { - return profile[AWS_DEFAULTS_MODE_CONFIG]; - }, - default: "legacy" - }; - var resolveDefaultsModeConfig = ({ region = nodeConfigProvider.loadConfig(configResolver.NODE_REGION_CONFIG_OPTIONS), defaultsMode = nodeConfigProvider.loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => propertyProvider.memoize(async () => { - const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; - switch (mode?.toLowerCase()) { - case "auto": - return resolveNodeDefaultsModeAuto(region); - case "in-region": - case "cross-region": - case "mobile": - case "standard": - case "legacy": - return Promise.resolve(mode?.toLocaleLowerCase()); - case undefined: - return Promise.resolve("legacy"); - default: - throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); - } - }); - var resolveNodeDefaultsModeAuto = async (clientRegion) => { - if (clientRegion) { - const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; - const inferredRegion = await inferPhysicalRegion(); - if (!inferredRegion) { - return "standard"; - } - if (resolvedRegion === inferredRegion) { - return "in-region"; - } else { - return "cross-region"; - } - } - return "standard"; - }; - var inferPhysicalRegion = async () => { - if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) { - return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV]; - } - if (!process.env[ENV_IMDS_DISABLED]) { - try { - const { getInstanceMetadataEndpoint, httpRequest } = await Promise.resolve().then(() => __toESM(require_dist_cjs95(), 1)); - const endpoint = await getInstanceMetadataEndpoint(); - return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString(); - } catch (e) {} - } - }; - exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.js -var require_runtimeConfig5 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var tslib_1 = require_tslib2(); - var package_json_1 = tslib_1.__importDefault(require_package3()); - var core_1 = require_dist_cjs83(); - var util_user_agent_node_1 = require_dist_cjs97(); - var config_resolver_1 = require_dist_cjs86(); - var hash_node_1 = require_dist_cjs98(); - var middleware_retry_1 = require_dist_cjs93(); - var node_config_provider_1 = require_dist_cjs89(); - var node_http_handler_1 = require_dist_cjs68(); - var util_body_length_node_1 = require_dist_cjs99(); - var util_retry_1 = require_dist_cjs92(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared5(); - var smithy_client_1 = require_dist_cjs81(); - var util_defaults_mode_node_1 = require_dist_cjs100(); - var smithy_client_2 = require_dist_cjs81(); - var getRuntimeConfig = (config2) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config2); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config2?.profile, - logger: clientSharedValues.logger - }; - return { - ...clientSharedValues, - ...config2, - runtime: "node", - defaultsMode, - authSchemePreference: config2?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config2?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - defaultUserAgentProvider: config2?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - maxAttempts: config2?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config2), - region: config2?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config2?.requestHandler ?? defaultConfigProvider), - retryMode: config2?.retryMode ?? (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }, config2), - sha256: config2?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config2?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config2?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config2?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config2?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js -var require_stsRegionDefaultResolver2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.warning = undefined; - exports.stsRegionDefaultResolver = stsRegionDefaultResolver; - var config_resolver_1 = require_dist_cjs86(); - var node_config_provider_1 = require_dist_cjs89(); - function stsRegionDefaultResolver(loaderConfig = {}) { - return (0, node_config_provider_1.loadConfig)({ - ...config_resolver_1.NODE_REGION_CONFIG_OPTIONS, - async default() { - if (!exports.warning.silence) { - console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."); - } - return "us-east-1"; - } - }, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }); - } - exports.warning = { - silence: false - }; -}); - -// ../node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js -var require_dist_cjs101 = __commonJS((exports) => { - var configResolver = require_dist_cjs86(); - var stsRegionDefaultResolver = require_stsRegionDefaultResolver2(); - var getAwsRegionExtensionConfiguration = (runtimeConfig) => { - return { - setRegion(region) { - runtimeConfig.region = region; - }, - region() { - return runtimeConfig.region; - } - }; - }; - var resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => { - return { - region: awsRegionExtensionConfiguration.region() - }; - }; - Object.defineProperty(exports, "NODE_REGION_CONFIG_FILE_OPTIONS", { - enumerable: true, - get: function() { - return configResolver.NODE_REGION_CONFIG_FILE_OPTIONS; - } - }); - Object.defineProperty(exports, "NODE_REGION_CONFIG_OPTIONS", { - enumerable: true, - get: function() { - return configResolver.NODE_REGION_CONFIG_OPTIONS; - } - }); - Object.defineProperty(exports, "REGION_ENV_NAME", { - enumerable: true, - get: function() { - return configResolver.REGION_ENV_NAME; - } - }); - Object.defineProperty(exports, "REGION_INI_NAME", { - enumerable: true, - get: function() { - return configResolver.REGION_INI_NAME; - } - }); - Object.defineProperty(exports, "resolveRegionConfig", { - enumerable: true, - get: function() { - return configResolver.resolveRegionConfig; - } - }); - exports.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration; - exports.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration; - Object.keys(stsRegionDefaultResolver).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - Object.defineProperty(exports, k, { - enumerable: true, - get: function() { - return stsRegionDefaultResolver[k]; - } - }); - }); -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js -var require_sso_oidc2 = __commonJS((exports) => { - var middlewareHostHeader = require_dist_cjs57(); - var middlewareLogger = require_dist_cjs58(); - var middlewareRecursionDetection = require_dist_cjs59(); - var middlewareUserAgent = require_dist_cjs84(); - var configResolver = require_dist_cjs86(); - var core2 = require_dist_cjs71(); - var schema = require_schema2(); - var middlewareContentLength = require_dist_cjs87(); - var middlewareEndpoint = require_dist_cjs90(); - var middlewareRetry = require_dist_cjs93(); - var smithyClient = require_dist_cjs81(); - var httpAuthSchemeProvider = require_httpAuthSchemeProvider6(); - var runtimeConfig = require_runtimeConfig5(); - var regionConfigResolver = require_dist_cjs101(); - var protocolHttp = require_dist_cjs56(); - var resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "sso-oauth" - }); - }; - var commonParams = { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - var getHttpAuthExtensionConfiguration = (runtimeConfig2) => { - const _httpAuthSchemes = runtimeConfig2.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig2.httpAuthSchemeProvider; - let _credentials = runtimeConfig2.credentials; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); - } - }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider2) { - _httpAuthSchemeProvider = httpAuthSchemeProvider2; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; - } - }; - }; - var resolveHttpAuthRuntimeConfig = (config2) => { - return { - httpAuthSchemes: config2.httpAuthSchemes(), - httpAuthSchemeProvider: config2.httpAuthSchemeProvider(), - credentials: config2.credentials() - }; - }; - var resolveRuntimeExtensions = (runtimeConfig2, extensions) => { - const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig2), smithyClient.getDefaultExtensionConfiguration(runtimeConfig2), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig2), getHttpAuthExtensionConfiguration(runtimeConfig2)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig2, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); - }; - - class SSOOIDCClient extends smithyClient.Client { - config; - constructor(...[configuration]) { - const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); - const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); - const _config_4 = configResolver.resolveRegionConfig(_config_3); - const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); - const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); - const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); - const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); - this.config = _config_8; - this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); - this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); - this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); - this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); - this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); - this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); - this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); - this.middlewareStack.use(core2.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOOIDCHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config2) => new core2.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config2.credentials - }) - })); - this.middlewareStack.use(core2.getHttpSigningPlugin(this.config)); - } - destroy() { - super.destroy(); - } - } - var SSOOIDCServiceException$1 = class SSOOIDCServiceException2 extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, SSOOIDCServiceException2.prototype); - } - }; - var AccessDeniedException$1 = class AccessDeniedException2 extends SSOOIDCServiceException$1 { - name = "AccessDeniedException"; - $fault = "client"; - error; - reason; - error_description; - constructor(opts) { - super({ - name: "AccessDeniedException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, AccessDeniedException2.prototype); - this.error = opts.error; - this.reason = opts.reason; - this.error_description = opts.error_description; - } - }; - var AuthorizationPendingException$1 = class AuthorizationPendingException2 extends SSOOIDCServiceException$1 { - name = "AuthorizationPendingException"; - $fault = "client"; - error; - error_description; - constructor(opts) { - super({ - name: "AuthorizationPendingException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, AuthorizationPendingException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var ExpiredTokenException$1 = class ExpiredTokenException2 extends SSOOIDCServiceException$1 { - name = "ExpiredTokenException"; - $fault = "client"; - error; - error_description; - constructor(opts) { - super({ - name: "ExpiredTokenException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ExpiredTokenException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var InternalServerException$1 = class InternalServerException2 extends SSOOIDCServiceException$1 { - name = "InternalServerException"; - $fault = "server"; - error; - error_description; - constructor(opts) { - super({ - name: "InternalServerException", - $fault: "server", - ...opts - }); - Object.setPrototypeOf(this, InternalServerException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var InvalidClientException$1 = class InvalidClientException2 extends SSOOIDCServiceException$1 { - name = "InvalidClientException"; - $fault = "client"; - error; - error_description; - constructor(opts) { - super({ - name: "InvalidClientException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidClientException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var InvalidGrantException$1 = class InvalidGrantException2 extends SSOOIDCServiceException$1 { - name = "InvalidGrantException"; - $fault = "client"; - error; - error_description; - constructor(opts) { - super({ - name: "InvalidGrantException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidGrantException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var InvalidRequestException$1 = class InvalidRequestException2 extends SSOOIDCServiceException$1 { - name = "InvalidRequestException"; - $fault = "client"; - error; - reason; - error_description; - constructor(opts) { - super({ - name: "InvalidRequestException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidRequestException2.prototype); - this.error = opts.error; - this.reason = opts.reason; - this.error_description = opts.error_description; - } - }; - var InvalidScopeException$1 = class InvalidScopeException2 extends SSOOIDCServiceException$1 { - name = "InvalidScopeException"; - $fault = "client"; - error; - error_description; - constructor(opts) { - super({ - name: "InvalidScopeException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidScopeException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var SlowDownException$1 = class SlowDownException2 extends SSOOIDCServiceException$1 { - name = "SlowDownException"; - $fault = "client"; - error; - error_description; - constructor(opts) { - super({ - name: "SlowDownException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, SlowDownException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var UnauthorizedClientException$1 = class UnauthorizedClientException2 extends SSOOIDCServiceException$1 { - name = "UnauthorizedClientException"; - $fault = "client"; - error; - error_description; - constructor(opts) { - super({ - name: "UnauthorizedClientException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, UnauthorizedClientException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var UnsupportedGrantTypeException$1 = class UnsupportedGrantTypeException2 extends SSOOIDCServiceException$1 { - name = "UnsupportedGrantTypeException"; - $fault = "client"; - error; - error_description; - constructor(opts) { - super({ - name: "UnsupportedGrantTypeException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, UnsupportedGrantTypeException2.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } - }; - var _ADE = "AccessDeniedException"; - var _APE = "AuthorizationPendingException"; - var _AT = "AccessToken"; - var _CS = "ClientSecret"; - var _CT = "CreateToken"; - var _CTR = "CreateTokenRequest"; - var _CTRr = "CreateTokenResponse"; - var _CV = "CodeVerifier"; - var _ETE = "ExpiredTokenException"; - var _ICE = "InvalidClientException"; - var _IGE = "InvalidGrantException"; - var _IRE = "InvalidRequestException"; - var _ISE = "InternalServerException"; - var _ISEn = "InvalidScopeException"; - var _IT = "IdToken"; - var _RT = "RefreshToken"; - var _SDE = "SlowDownException"; - var _UCE = "UnauthorizedClientException"; - var _UGTE = "UnsupportedGrantTypeException"; - var _aT = "accessToken"; - var _c = "client"; - var _cI = "clientId"; - var _cS = "clientSecret"; - var _cV = "codeVerifier"; - var _co = "code"; - var _dC = "deviceCode"; - var _e = "error"; - var _eI = "expiresIn"; - var _ed = "error_description"; - var _gT = "grantType"; - var _h = "http"; - var _hE = "httpError"; - var _iT = "idToken"; - var _r = "reason"; - var _rT = "refreshToken"; - var _rU = "redirectUri"; - var _s = "scope"; - var _se = "server"; - var _sm = "smithy.ts.sdk.synthetic.com.amazonaws.ssooidc"; - var _tT = "tokenType"; - var n0 = "com.amazonaws.ssooidc"; - var AccessToken = [0, n0, _AT, 8, 0]; - var ClientSecret = [0, n0, _CS, 8, 0]; - var CodeVerifier = [0, n0, _CV, 8, 0]; - var IdToken = [0, n0, _IT, 8, 0]; - var RefreshToken = [0, n0, _RT, 8, 0]; - var AccessDeniedException = [ - -3, - n0, - _ADE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _r, _ed], - [0, 0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1); - var AuthorizationPendingException = [ - -3, - n0, - _APE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(AuthorizationPendingException, AuthorizationPendingException$1); - var CreateTokenRequest = [ - 3, - n0, - _CTR, - 0, - [_cI, _cS, _gT, _dC, _co, _rT, _s, _rU, _cV], - [0, [() => ClientSecret, 0], 0, 0, 0, [() => RefreshToken, 0], 64 | 0, 0, [() => CodeVerifier, 0]] - ]; - var CreateTokenResponse = [ - 3, - n0, - _CTRr, - 0, - [_aT, _tT, _eI, _rT, _iT], - [[() => AccessToken, 0], 0, 1, [() => RefreshToken, 0], [() => IdToken, 0]] - ]; - var ExpiredTokenException = [ - -3, - n0, - _ETE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1); - var InternalServerException = [ - -3, - n0, - _ISE, - { - [_e]: _se, - [_hE]: 500 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1); - var InvalidClientException = [ - -3, - n0, - _ICE, - { - [_e]: _c, - [_hE]: 401 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidClientException, InvalidClientException$1); - var InvalidGrantException = [ - -3, - n0, - _IGE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidGrantException, InvalidGrantException$1); - var InvalidRequestException = [ - -3, - n0, - _IRE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _r, _ed], - [0, 0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidRequestException, InvalidRequestException$1); - var InvalidScopeException = [ - -3, - n0, - _ISEn, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidScopeException, InvalidScopeException$1); - var SlowDownException = [ - -3, - n0, - _SDE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(SlowDownException, SlowDownException$1); - var UnauthorizedClientException = [ - -3, - n0, - _UCE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(UnauthorizedClientException, UnauthorizedClientException$1); - var UnsupportedGrantTypeException = [ - -3, - n0, - _UGTE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _ed], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(UnsupportedGrantTypeException, UnsupportedGrantTypeException$1); - var SSOOIDCServiceException = [-3, _sm, "SSOOIDCServiceException", 0, [], []]; - schema.TypeRegistry.for(_sm).registerError(SSOOIDCServiceException, SSOOIDCServiceException$1); - var CreateToken = [ - 9, - n0, - _CT, - { - [_h]: ["POST", "/token", 200] - }, - () => CreateTokenRequest, - () => CreateTokenResponse - ]; - - class CreateTokenCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").sc(CreateToken).build() { - } - var commands = { - CreateTokenCommand - }; - - class SSOOIDC extends SSOOIDCClient { - } - smithyClient.createAggregatedClient(commands, SSOOIDC); - var AccessDeniedExceptionReason = { - KMS_ACCESS_DENIED: "KMS_AccessDeniedException" - }; - var InvalidRequestExceptionReason = { - KMS_DISABLED_KEY: "KMS_DisabledException", - KMS_INVALID_KEY_USAGE: "KMS_InvalidKeyUsageException", - KMS_INVALID_STATE: "KMS_InvalidStateException", - KMS_KEY_NOT_FOUND: "KMS_NotFoundException" - }; - Object.defineProperty(exports, "$Command", { - enumerable: true, - get: function() { - return smithyClient.Command; - } - }); - Object.defineProperty(exports, "__Client", { - enumerable: true, - get: function() { - return smithyClient.Client; - } - }); - exports.AccessDeniedException = AccessDeniedException$1; - exports.AccessDeniedExceptionReason = AccessDeniedExceptionReason; - exports.AuthorizationPendingException = AuthorizationPendingException$1; - exports.CreateTokenCommand = CreateTokenCommand; - exports.ExpiredTokenException = ExpiredTokenException$1; - exports.InternalServerException = InternalServerException$1; - exports.InvalidClientException = InvalidClientException$1; - exports.InvalidGrantException = InvalidGrantException$1; - exports.InvalidRequestException = InvalidRequestException$1; - exports.InvalidRequestExceptionReason = InvalidRequestExceptionReason; - exports.InvalidScopeException = InvalidScopeException$1; - exports.SSOOIDC = SSOOIDC; - exports.SSOOIDCClient = SSOOIDCClient; - exports.SSOOIDCServiceException = SSOOIDCServiceException$1; - exports.SlowDownException = SlowDownException$1; - exports.UnauthorizedClientException = UnauthorizedClientException$1; - exports.UnsupportedGrantTypeException = UnsupportedGrantTypeException$1; -}); - -// ../node_modules/@aws-sdk/token-providers/dist-cjs/index.js -var require_dist_cjs102 = __commonJS((exports) => { - var client = require_client3(); - var httpAuthSchemes = require_httpAuthSchemes2(); - var propertyProvider = require_dist_cjs76(); - var sharedIniFileLoader = require_dist_cjs88(); - var fs2 = __require("fs"); - var fromEnvSigningName = ({ logger, signingName } = {}) => async () => { - logger?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"); - if (!signingName) { - throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger }); - } - const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName); - if (!(bearerTokenKey in process.env)) { - throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger }); - } - const token = { token: process.env[bearerTokenKey] }; - client.setTokenFeature(token, "BEARER_SERVICE_ENV_VARS", "3"); - return token; - }; - var EXPIRE_WINDOW_MS = 5 * 60 * 1000; - var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; - var getSsoOidcClient = async (ssoRegion, init = {}) => { - const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM(require_sso_oidc2(), 1)); - const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop]; - const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, { - region: ssoRegion ?? init.clientConfig?.region, - logger: coalesce("logger"), - userAgentAppId: coalesce("userAgentAppId") - })); - return ssoOidcClient; - }; - var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}) => { - const { CreateTokenCommand } = await Promise.resolve().then(() => __toESM(require_sso_oidc2(), 1)); - const ssoOidcClient = await getSsoOidcClient(ssoRegion, init); - return ssoOidcClient.send(new CreateTokenCommand({ - clientId: ssoToken.clientId, - clientSecret: ssoToken.clientSecret, - refreshToken: ssoToken.refreshToken, - grantType: "refresh_token" - })); - }; - var validateTokenExpiry = (token) => { - if (token.expiration && token.expiration.getTime() < Date.now()) { - throw new propertyProvider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false); - } - }; - var validateTokenKey = (key, value, forRefresh = false) => { - if (typeof value === "undefined") { - throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false); - } - }; - var { writeFile: writeFile2 } = fs2.promises; - var writeSSOTokenToFile = (id, ssoToken) => { - const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id); - const tokenString = JSON.stringify(ssoToken, null, 2); - return writeFile2(tokenFilepath, tokenString); - }; - var lastRefreshAttemptTime = new Date(0); - var fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => { - const init = { - ..._init, - parentClientConfig: { - ...callerClientConfig, - ..._init.parentClientConfig - } - }; - init.logger?.debug("@aws-sdk/token-providers - fromSso"); - const profiles = await sharedIniFileLoader.parseKnownFiles(init); - const profileName = sharedIniFileLoader.getProfileName({ - profile: init.profile ?? callerClientConfig?.profile - }); - const profile = profiles[profileName]; - if (!profile) { - throw new propertyProvider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); - } else if (!profile["sso_session"]) { - throw new propertyProvider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); - } - const ssoSessionName = profile["sso_session"]; - const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init); - const ssoSession = ssoSessions[ssoSessionName]; - if (!ssoSession) { - throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false); - } - for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { - if (!ssoSession[ssoSessionRequiredKey]) { - throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); - } - } - ssoSession["sso_start_url"]; - const ssoRegion = ssoSession["sso_region"]; - let ssoToken; - try { - ssoToken = await sharedIniFileLoader.getSSOTokenFromFile(ssoSessionName); - } catch (e) { - throw new propertyProvider.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false); - } - validateTokenKey("accessToken", ssoToken.accessToken); - validateTokenKey("expiresAt", ssoToken.expiresAt); - const { accessToken, expiresAt } = ssoToken; - const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; - if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) { - return existingToken; - } - if (Date.now() - lastRefreshAttemptTime.getTime() < 30000) { - validateTokenExpiry(existingToken); - return existingToken; - } - validateTokenKey("clientId", ssoToken.clientId, true); - validateTokenKey("clientSecret", ssoToken.clientSecret, true); - validateTokenKey("refreshToken", ssoToken.refreshToken, true); - try { - lastRefreshAttemptTime.setTime(Date.now()); - const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init); - validateTokenKey("accessToken", newSsoOidcToken.accessToken); - validateTokenKey("expiresIn", newSsoOidcToken.expiresIn); - const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000); - try { - await writeSSOTokenToFile(ssoSessionName, { - ...ssoToken, - accessToken: newSsoOidcToken.accessToken, - expiresAt: newTokenExpiration.toISOString(), - refreshToken: newSsoOidcToken.refreshToken - }); - } catch (error41) {} - return { - token: newSsoOidcToken.accessToken, - expiration: newTokenExpiration - }; - } catch (error41) { - validateTokenExpiry(existingToken); - return existingToken; - } - }; - var fromStatic = ({ token, logger }) => async () => { - logger?.debug("@aws-sdk/token-providers - fromStatic"); - if (!token || !token.token) { - throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false); - } - return token; - }; - var nodeProvider = (init = {}) => propertyProvider.memoize(propertyProvider.chain(fromSso(init), async () => { - throw new propertyProvider.TokenProviderError("Could not load token from any providers", false); - }), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined); - exports.fromEnvSigningName = fromEnvSigningName; - exports.fromSso = fromSso; - exports.fromStatic = fromStatic; - exports.nodeProvider = nodeProvider; -}); - -// ../node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider7 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = undefined; - var core_1 = require_dist_cjs83(); - var util_middleware_1 = require_dist_cjs60(); - var defaultSSOHttpAuthSchemeParametersProvider = async (config2, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config2.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "awsssoportal", - region: authParameters.region - }, - propertiesExtractor: (config2, context) => ({ - signingProperties: { - config: config2, - context - } - }) - }; - } - function createSmithyApiNoAuthHttpAuthOption(authParameters) { - return { - schemeId: "smithy.api#noAuth" - }; - } - var defaultSSOHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - case "GetRoleCredentials": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "ListAccountRoles": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "ListAccounts": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "Logout": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); - } - } - return options; - }; - exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider; - var resolveHttpAuthSchemeConfig = (config2) => { - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config2); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config2.authSchemePreference ?? []) - }); - }; - exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; -}); - -// ../node_modules/@aws-sdk/client-sso/package.json -var require_package4 = __commonJS((exports, module) => { - module.exports = { name: "@aws-sdk/client-sso", main: "dist-cjs/index.js" }; -}); - -// ../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js -var require_ruleset6 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ruleSet = undefined; - var u2 = "required"; - var v = "fn"; - var w = "argv"; - var x2 = "ref"; - var a2 = true; - var b = "isSet"; - var c5 = "booleanEquals"; - var d = "error"; - var e = "endpoint"; - var f = "tree"; - var g = "PartitionResult"; - var h2 = "getAttr"; - var i2 = { [u2]: false, type: "string" }; - var j = { [u2]: true, default: false, type: "boolean" }; - var k = { [x2]: "Endpoint" }; - var l = { [v]: c5, [w]: [{ [x2]: "UseFIPS" }, true] }; - var m = { [v]: c5, [w]: [{ [x2]: "UseDualStack" }, true] }; - var n2 = {}; - var o2 = { [v]: h2, [w]: [{ [x2]: g }, "supportsFIPS"] }; - var p = { [x2]: g }; - var q = { [v]: c5, [w]: [true, { [v]: h2, [w]: [p, "supportsDualStack"] }] }; - var r = [l]; - var s = [m]; - var t = [{ [x2]: "Region" }]; - var _data = { version: "1.0", parameters: { Region: i2, UseDualStack: j, UseFIPS: j, Endpoint: i2 }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], 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: k, properties: n2, headers: n2 }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c5, [w]: [a2, o2] }, q], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, 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: [{ [v]: c5, [w]: [o2, a2] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h2, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n2, headers: n2 }, type: e }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; - exports.ruleSet = _data; -}); - -// ../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js -var require_endpointResolver6 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultEndpointResolver = undefined; - var util_endpoints_1 = require_dist_cjs75(); - var util_endpoints_2 = require_dist_cjs72(); - var ruleset_1 = require_ruleset6(); - var cache2 = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] - }); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return cache2.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - })); - }; - exports.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -}); - -// ../node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js -var require_runtimeConfig_shared6 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var core_1 = require_dist_cjs83(); - var protocols_1 = require_protocols4(); - var core_2 = require_dist_cjs71(); - var smithy_client_1 = require_dist_cjs81(); - var url_parser_1 = require_dist_cjs74(); - var util_base64_1 = require_dist_cjs65(); - var util_utf8_1 = require_dist_cjs64(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider7(); - var endpointResolver_1 = require_endpointResolver6(); - var getRuntimeConfig = (config2) => { - return { - apiVersion: "2019-06-10", - base64Decoder: config2?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config2?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config2?.disableHostPrefix ?? false, - endpointProvider: config2?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config2?.extensions ?? [], - httpAuthSchemeProvider: config2?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner - } - ], - logger: config2?.logger ?? new smithy_client_1.NoOpLogger, - protocol: config2?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.sso" }), - serviceId: config2?.serviceId ?? "SSO", - urlParser: config2?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config2?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config2?.utf8Encoder ?? util_utf8_1.toUtf8 - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js -var require_runtimeConfig6 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var tslib_1 = require_tslib2(); - var package_json_1 = tslib_1.__importDefault(require_package4()); - var core_1 = require_dist_cjs83(); - var util_user_agent_node_1 = require_dist_cjs97(); - var config_resolver_1 = require_dist_cjs86(); - var hash_node_1 = require_dist_cjs98(); - var middleware_retry_1 = require_dist_cjs93(); - var node_config_provider_1 = require_dist_cjs89(); - var node_http_handler_1 = require_dist_cjs68(); - var util_body_length_node_1 = require_dist_cjs99(); - var util_retry_1 = require_dist_cjs92(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared6(); - var smithy_client_1 = require_dist_cjs81(); - var util_defaults_mode_node_1 = require_dist_cjs100(); - var smithy_client_2 = require_dist_cjs81(); - var getRuntimeConfig = (config2) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config2); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config2?.profile, - logger: clientSharedValues.logger - }; - return { - ...clientSharedValues, - ...config2, - runtime: "node", - defaultsMode, - authSchemePreference: config2?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config2?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - defaultUserAgentProvider: config2?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - maxAttempts: config2?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config2), - region: config2?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config2?.requestHandler ?? defaultConfigProvider), - retryMode: config2?.retryMode ?? (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }, config2), - sha256: config2?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config2?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config2?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config2?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config2?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-sso/dist-cjs/index.js -var require_dist_cjs103 = __commonJS((exports) => { - var middlewareHostHeader = require_dist_cjs57(); - var middlewareLogger = require_dist_cjs58(); - var middlewareRecursionDetection = require_dist_cjs59(); - var middlewareUserAgent = require_dist_cjs84(); - var configResolver = require_dist_cjs86(); - var core2 = require_dist_cjs71(); - var schema = require_schema2(); - var middlewareContentLength = require_dist_cjs87(); - var middlewareEndpoint = require_dist_cjs90(); - var middlewareRetry = require_dist_cjs93(); - var smithyClient = require_dist_cjs81(); - var httpAuthSchemeProvider = require_httpAuthSchemeProvider7(); - var runtimeConfig = require_runtimeConfig6(); - var regionConfigResolver = require_dist_cjs101(); - var protocolHttp = require_dist_cjs56(); - var resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "awsssoportal" - }); - }; - var commonParams = { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - var getHttpAuthExtensionConfiguration = (runtimeConfig2) => { - const _httpAuthSchemes = runtimeConfig2.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig2.httpAuthSchemeProvider; - let _credentials = runtimeConfig2.credentials; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); - } - }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider2) { - _httpAuthSchemeProvider = httpAuthSchemeProvider2; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; - } - }; - }; - var resolveHttpAuthRuntimeConfig = (config2) => { - return { - httpAuthSchemes: config2.httpAuthSchemes(), - httpAuthSchemeProvider: config2.httpAuthSchemeProvider(), - credentials: config2.credentials() - }; - }; - var resolveRuntimeExtensions = (runtimeConfig2, extensions) => { - const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig2), smithyClient.getDefaultExtensionConfiguration(runtimeConfig2), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig2), getHttpAuthExtensionConfiguration(runtimeConfig2)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig2, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); - }; - - class SSOClient extends smithyClient.Client { - config; - constructor(...[configuration]) { - const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); - const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); - const _config_4 = configResolver.resolveRegionConfig(_config_3); - const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); - const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); - const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); - const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); - this.config = _config_8; - this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); - this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); - this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); - this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); - this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); - this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); - this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); - this.middlewareStack.use(core2.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config2) => new core2.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config2.credentials - }) - })); - this.middlewareStack.use(core2.getHttpSigningPlugin(this.config)); - } - destroy() { - super.destroy(); - } - } - var SSOServiceException$1 = class SSOServiceException2 extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, SSOServiceException2.prototype); - } - }; - var InvalidRequestException$1 = class InvalidRequestException2 extends SSOServiceException$1 { - name = "InvalidRequestException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidRequestException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidRequestException2.prototype); - } - }; - var ResourceNotFoundException$1 = class ResourceNotFoundException2 extends SSOServiceException$1 { - name = "ResourceNotFoundException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ResourceNotFoundException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ResourceNotFoundException2.prototype); - } - }; - var TooManyRequestsException$1 = class TooManyRequestsException2 extends SSOServiceException$1 { - name = "TooManyRequestsException"; - $fault = "client"; - constructor(opts) { - super({ - name: "TooManyRequestsException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, TooManyRequestsException2.prototype); - } - }; - var UnauthorizedException$1 = class UnauthorizedException2 extends SSOServiceException$1 { - name = "UnauthorizedException"; - $fault = "client"; - constructor(opts) { - super({ - name: "UnauthorizedException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, UnauthorizedException2.prototype); - } - }; - var _AI = "AccountInfo"; - var _ALT = "AccountListType"; - var _ATT = "AccessTokenType"; - var _GRC = "GetRoleCredentials"; - var _GRCR = "GetRoleCredentialsRequest"; - var _GRCRe = "GetRoleCredentialsResponse"; - var _IRE = "InvalidRequestException"; - var _L = "Logout"; - var _LA = "ListAccounts"; - var _LAR = "ListAccountsRequest"; - var _LARR = "ListAccountRolesRequest"; - var _LARRi = "ListAccountRolesResponse"; - var _LARi = "ListAccountsResponse"; - var _LARis = "ListAccountRoles"; - var _LR = "LogoutRequest"; - var _RC = "RoleCredentials"; - var _RI = "RoleInfo"; - var _RLT = "RoleListType"; - var _RNFE = "ResourceNotFoundException"; - var _SAKT = "SecretAccessKeyType"; - var _STT = "SessionTokenType"; - var _TMRE = "TooManyRequestsException"; - var _UE = "UnauthorizedException"; - var _aI = "accountId"; - var _aKI = "accessKeyId"; - var _aL = "accountList"; - var _aN = "accountName"; - var _aT = "accessToken"; - var _ai = "account_id"; - var _c = "client"; - var _e = "error"; - var _eA = "emailAddress"; - var _ex = "expiration"; - var _h = "http"; - var _hE = "httpError"; - var _hH = "httpHeader"; - var _hQ = "httpQuery"; - var _m = "message"; - var _mR = "maxResults"; - var _mr = "max_result"; - var _nT = "nextToken"; - var _nt = "next_token"; - var _rC = "roleCredentials"; - var _rL = "roleList"; - var _rN = "roleName"; - var _rn = "role_name"; - var _s = "smithy.ts.sdk.synthetic.com.amazonaws.sso"; - var _sAK = "secretAccessKey"; - var _sT = "sessionToken"; - var _xasbt = "x-amz-sso_bearer_token"; - var n0 = "com.amazonaws.sso"; - var AccessTokenType = [0, n0, _ATT, 8, 0]; - var SecretAccessKeyType = [0, n0, _SAKT, 8, 0]; - var SessionTokenType = [0, n0, _STT, 8, 0]; - var AccountInfo = [3, n0, _AI, 0, [_aI, _aN, _eA], [0, 0, 0]]; - var GetRoleCredentialsRequest = [ - 3, - n0, - _GRCR, - 0, - [_rN, _aI, _aT], - [ - [ - 0, - { - [_hQ]: _rn - } - ], - [ - 0, - { - [_hQ]: _ai - } - ], - [ - () => AccessTokenType, - { - [_hH]: _xasbt - } - ] - ] - ]; - var GetRoleCredentialsResponse = [3, n0, _GRCRe, 0, [_rC], [[() => RoleCredentials, 0]]]; - var InvalidRequestException = [ - -3, - n0, - _IRE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidRequestException, InvalidRequestException$1); - var ListAccountRolesRequest = [ - 3, - n0, - _LARR, - 0, - [_nT, _mR, _aT, _aI], - [ - [ - 0, - { - [_hQ]: _nt - } - ], - [ - 1, - { - [_hQ]: _mr - } - ], - [ - () => AccessTokenType, - { - [_hH]: _xasbt - } - ], - [ - 0, - { - [_hQ]: _ai - } - ] - ] - ]; - var ListAccountRolesResponse = [3, n0, _LARRi, 0, [_nT, _rL], [0, () => RoleListType]]; - var ListAccountsRequest = [ - 3, - n0, - _LAR, - 0, - [_nT, _mR, _aT], - [ - [ - 0, - { - [_hQ]: _nt - } - ], - [ - 1, - { - [_hQ]: _mr - } - ], - [ - () => AccessTokenType, - { - [_hH]: _xasbt - } - ] - ] - ]; - var ListAccountsResponse = [3, n0, _LARi, 0, [_nT, _aL], [0, () => AccountListType]]; - var LogoutRequest = [ - 3, - n0, - _LR, - 0, - [_aT], - [ - [ - () => AccessTokenType, - { - [_hH]: _xasbt - } - ] - ] - ]; - var ResourceNotFoundException = [ - -3, - n0, - _RNFE, - { - [_e]: _c, - [_hE]: 404 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1); - var RoleCredentials = [ - 3, - n0, - _RC, - 0, - [_aKI, _sAK, _sT, _ex], - [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1] - ]; - var RoleInfo = [3, n0, _RI, 0, [_rN, _aI], [0, 0]]; - var TooManyRequestsException = [ - -3, - n0, - _TMRE, - { - [_e]: _c, - [_hE]: 429 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(TooManyRequestsException, TooManyRequestsException$1); - var UnauthorizedException = [ - -3, - n0, - _UE, - { - [_e]: _c, - [_hE]: 401 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(UnauthorizedException, UnauthorizedException$1); - var __Unit = "unit"; - var SSOServiceException = [-3, _s, "SSOServiceException", 0, [], []]; - schema.TypeRegistry.for(_s).registerError(SSOServiceException, SSOServiceException$1); - var AccountListType = [1, n0, _ALT, 0, () => AccountInfo]; - var RoleListType = [1, n0, _RLT, 0, () => RoleInfo]; - var GetRoleCredentials = [ - 9, - n0, - _GRC, - { - [_h]: ["GET", "/federation/credentials", 200] - }, - () => GetRoleCredentialsRequest, - () => GetRoleCredentialsResponse - ]; - var ListAccountRoles = [ - 9, - n0, - _LARis, - { - [_h]: ["GET", "/assignment/roles", 200] - }, - () => ListAccountRolesRequest, - () => ListAccountRolesResponse - ]; - var ListAccounts = [ - 9, - n0, - _LA, - { - [_h]: ["GET", "/assignment/accounts", 200] - }, - () => ListAccountsRequest, - () => ListAccountsResponse - ]; - var Logout = [ - 9, - n0, - _L, - { - [_h]: ["POST", "/logout", 200] - }, - () => LogoutRequest, - () => __Unit - ]; - - class GetRoleCredentialsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").sc(GetRoleCredentials).build() { - } - - class ListAccountRolesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").sc(ListAccountRoles).build() { - } - - class ListAccountsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").sc(ListAccounts).build() { - } - - class LogoutCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").sc(Logout).build() { - } - var commands = { - GetRoleCredentialsCommand, - ListAccountRolesCommand, - ListAccountsCommand, - LogoutCommand - }; - - class SSO extends SSOClient { - } - smithyClient.createAggregatedClient(commands, SSO); - var paginateListAccountRoles = core2.createPaginator(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults"); - var paginateListAccounts = core2.createPaginator(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults"); - Object.defineProperty(exports, "$Command", { - enumerable: true, - get: function() { - return smithyClient.Command; - } - }); - Object.defineProperty(exports, "__Client", { - enumerable: true, - get: function() { - return smithyClient.Client; - } - }); - exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand; - exports.InvalidRequestException = InvalidRequestException$1; - exports.ListAccountRolesCommand = ListAccountRolesCommand; - exports.ListAccountsCommand = ListAccountsCommand; - exports.LogoutCommand = LogoutCommand; - exports.ResourceNotFoundException = ResourceNotFoundException$1; - exports.SSO = SSO; - exports.SSOClient = SSOClient; - exports.SSOServiceException = SSOServiceException$1; - exports.TooManyRequestsException = TooManyRequestsException$1; - exports.UnauthorizedException = UnauthorizedException$1; - exports.paginateListAccountRoles = paginateListAccountRoles; - exports.paginateListAccounts = paginateListAccounts; -}); - -// ../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js -var require_loadSso_CVy8iqsZ = __commonJS((exports) => { - var clientSso = require_dist_cjs103(); - Object.defineProperty(exports, "GetRoleCredentialsCommand", { - enumerable: true, - get: function() { - return clientSso.GetRoleCredentialsCommand; - } - }); - Object.defineProperty(exports, "SSOClient", { - enumerable: true, - get: function() { - return clientSso.SSOClient; - } - }); -}); - -// ../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js -var require_dist_cjs104 = __commonJS((exports) => { - var propertyProvider = require_dist_cjs76(); - var sharedIniFileLoader = require_dist_cjs88(); - var client = require_client3(); - var tokenProviders = require_dist_cjs102(); - var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"); - var SHOULD_FAIL_CREDENTIAL_CHAIN = false; - var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger }) => { - let token; - const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; - if (ssoSession) { - try { - const _token = await tokenProviders.fromSso({ - profile, - filepath, - configFilepath, - ignoreCache - })(); - token = { - accessToken: _token.token, - expiresAt: new Date(_token.expiration).toISOString() - }; - } catch (e) { - throw new propertyProvider.CredentialsProviderError(e.message, { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger - }); - } - } else { - try { - token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl); - } catch (e) { - throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger - }); - } - } - if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { - throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger - }); - } - const { accessToken } = token; - const { SSOClient, GetRoleCredentialsCommand } = await Promise.resolve().then(function() { - return require_loadSso_CVy8iqsZ(); - }); - const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig ?? {}, { - logger: clientConfig?.logger ?? parentClientConfig?.logger, - region: clientConfig?.region ?? ssoRegion, - userAgentAppId: clientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId - })); - let ssoResp; - try { - ssoResp = await sso.send(new GetRoleCredentialsCommand({ - accountId: ssoAccountId, - roleName: ssoRoleName, - accessToken - })); - } catch (e) { - throw new propertyProvider.CredentialsProviderError(e, { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger - }); - } - const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp; - if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { - throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", { - tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, - logger - }); - } - const credentials = { - accessKeyId, - secretAccessKey, - sessionToken, - expiration: new Date(expiration), - ...credentialScope && { credentialScope }, - ...accountId && { accountId } - }; - if (ssoSession) { - client.setCredentialFeature(credentials, "CREDENTIALS_SSO", "s"); - } else { - client.setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u"); - } - return credentials; - }; - var validateSsoProfile = (profile, logger) => { - const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; - if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { - throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` + `"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")} -Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger }); - } - return profile; - }; - var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => { - init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO"); - const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; - const { ssoClient } = init; - const profileName = sharedIniFileLoader.getProfileName({ - profile: init.profile ?? callerClientConfig?.profile - }); - if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { - const profiles = await sharedIniFileLoader.parseKnownFiles(init); - const profile = profiles[profileName]; - if (!profile) { - throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger }); - } - if (!isSsoProfile(profile)) { - throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, { - logger: init.logger - }); - } - if (profile?.sso_session) { - const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init); - const session = ssoSessions[profile.sso_session]; - const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; - if (ssoRegion && ssoRegion !== session.sso_region) { - throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, { - tryNextLink: false, - logger: init.logger - }); - } - if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { - throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, { - tryNextLink: false, - logger: init.logger - }); - } - profile.sso_region = session.sso_region; - profile.sso_start_url = session.sso_start_url; - } - const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger); - return resolveSSOCredentials({ - ssoStartUrl: sso_start_url, - ssoSession: sso_session, - ssoAccountId: sso_account_id, - ssoRegion: sso_region, - ssoRoleName: sso_role_name, - ssoClient, - clientConfig: init.clientConfig, - parentClientConfig: init.parentClientConfig, - profile: profileName, - filepath: init.filepath, - configFilepath: init.configFilepath, - ignoreCache: init.ignoreCache, - logger: init.logger - }); - } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { - throw new propertyProvider.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger }); - } else { - return resolveSSOCredentials({ - ssoStartUrl, - ssoSession, - ssoAccountId, - ssoRegion, - ssoRoleName, - ssoClient, - clientConfig: init.clientConfig, - parentClientConfig: init.parentClientConfig, - profile: profileName, - filepath: init.filepath, - configFilepath: init.configFilepath, - ignoreCache: init.ignoreCache, - logger: init.logger - }); - } - }; - exports.fromSSO = fromSSO; - exports.isSsoProfile = isSsoProfile; - exports.validateSsoProfile = validateSsoProfile; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider8 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthSchemeConfig = exports.defaultSigninHttpAuthSchemeProvider = exports.defaultSigninHttpAuthSchemeParametersProvider = undefined; - var core_1 = require_dist_cjs83(); - var util_middleware_1 = require_dist_cjs60(); - var defaultSigninHttpAuthSchemeParametersProvider = async (config2, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config2.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports.defaultSigninHttpAuthSchemeParametersProvider = defaultSigninHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "signin", - region: authParameters.region - }, - propertiesExtractor: (config2, context) => ({ - signingProperties: { - config: config2, - context - } - }) - }; - } - function createSmithyApiNoAuthHttpAuthOption(authParameters) { - return { - schemeId: "smithy.api#noAuth" - }; - } - var defaultSigninHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - case "CreateOAuth2Token": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); - } - } - return options; - }; - exports.defaultSigninHttpAuthSchemeProvider = defaultSigninHttpAuthSchemeProvider; - var resolveHttpAuthSchemeConfig = (config2) => { - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config2); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config2.authSchemePreference ?? []) - }); - }; - exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/ruleset.js -var require_ruleset7 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ruleSet = undefined; - var u2 = "required"; - var v = "fn"; - var w = "argv"; - var x2 = "ref"; - var a2 = true; - var b = "isSet"; - var c5 = "booleanEquals"; - var d = "error"; - var e = "endpoint"; - var f = "tree"; - var g = "PartitionResult"; - var h2 = "stringEquals"; - var i2 = { [u2]: true, default: false, type: "boolean" }; - var j = { [u2]: false, type: "string" }; - var k = { [x2]: "Endpoint" }; - var l = { [v]: c5, [w]: [{ [x2]: "UseFIPS" }, true] }; - var m = { [v]: c5, [w]: [{ [x2]: "UseDualStack" }, true] }; - var n2 = {}; - var o2 = { [v]: "getAttr", [w]: [{ [x2]: g }, "name"] }; - var p = { [v]: c5, [w]: [{ [x2]: "UseFIPS" }, false] }; - var q = { [v]: c5, [w]: [{ [x2]: "UseDualStack" }, false] }; - var r = { [v]: "getAttr", [w]: [{ [x2]: g }, "supportsFIPS"] }; - var s = { [v]: c5, [w]: [true, { [v]: "getAttr", [w]: [{ [x2]: g }, "supportsDualStack"] }] }; - var t = [{ [x2]: "Region" }]; - var _data = { version: "1.0", parameters: { UseDualStack: i2, UseFIPS: i2, Endpoint: j, Region: j }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: [l], error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { rules: [{ conditions: [m], error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n2, headers: n2 }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [{ [v]: h2, [w]: [o2, "aws"] }, p, q], endpoint: { url: "https://{Region}.signin.aws.amazon.com", properties: n2, headers: n2 }, type: e }, { conditions: [{ [v]: h2, [w]: [o2, "aws-cn"] }, p, q], endpoint: { url: "https://{Region}.signin.amazonaws.cn", properties: n2, headers: n2 }, type: e }, { conditions: [{ [v]: h2, [w]: [o2, "aws-us-gov"] }, p, q], endpoint: { url: "https://{Region}.signin.amazonaws-us-gov.com", properties: n2, headers: n2 }, type: e }, { conditions: [l, m], rules: [{ conditions: [{ [v]: c5, [w]: [a2, r] }, s], rules: [{ endpoint: { url: "https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: [l, q], rules: [{ conditions: [{ [v]: c5, [w]: [r, a2] }], rules: [{ endpoint: { url: "https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: [p, m], rules: [{ conditions: [s], rules: [{ endpoint: { url: "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://signin.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }], type: f }] }; - exports.ruleSet = _data; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/endpointResolver.js -var require_endpointResolver7 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultEndpointResolver = undefined; - var util_endpoints_1 = require_dist_cjs75(); - var util_endpoints_2 = require_dist_cjs72(); - var ruleset_1 = require_ruleset7(); - var cache2 = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] - }); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return cache2.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - })); - }; - exports.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.shared.js -var require_runtimeConfig_shared7 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var core_1 = require_dist_cjs83(); - var protocols_1 = require_protocols4(); - var core_2 = require_dist_cjs71(); - var smithy_client_1 = require_dist_cjs81(); - var url_parser_1 = require_dist_cjs74(); - var util_base64_1 = require_dist_cjs65(); - var util_utf8_1 = require_dist_cjs64(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider8(); - var endpointResolver_1 = require_endpointResolver7(); - var getRuntimeConfig = (config2) => { - return { - apiVersion: "2023-01-01", - base64Decoder: config2?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config2?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config2?.disableHostPrefix ?? false, - endpointProvider: config2?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config2?.extensions ?? [], - httpAuthSchemeProvider: config2?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSigninHttpAuthSchemeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner - } - ], - logger: config2?.logger ?? new smithy_client_1.NoOpLogger, - protocol: config2?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.signin" }), - serviceId: config2?.serviceId ?? "Signin", - urlParser: config2?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config2?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config2?.utf8Encoder ?? util_utf8_1.toUtf8 - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.js -var require_runtimeConfig7 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var tslib_1 = require_tslib2(); - var package_json_1 = tslib_1.__importDefault(require_package3()); - var core_1 = require_dist_cjs83(); - var util_user_agent_node_1 = require_dist_cjs97(); - var config_resolver_1 = require_dist_cjs86(); - var hash_node_1 = require_dist_cjs98(); - var middleware_retry_1 = require_dist_cjs93(); - var node_config_provider_1 = require_dist_cjs89(); - var node_http_handler_1 = require_dist_cjs68(); - var util_body_length_node_1 = require_dist_cjs99(); - var util_retry_1 = require_dist_cjs92(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared7(); - var smithy_client_1 = require_dist_cjs81(); - var util_defaults_mode_node_1 = require_dist_cjs100(); - var smithy_client_2 = require_dist_cjs81(); - var getRuntimeConfig = (config2) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config2); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config2?.profile, - logger: clientSharedValues.logger - }; - return { - ...clientSharedValues, - ...config2, - runtime: "node", - defaultsMode, - authSchemePreference: config2?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config2?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - defaultUserAgentProvider: config2?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - maxAttempts: config2?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config2), - region: config2?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config2?.requestHandler ?? defaultConfigProvider), - retryMode: config2?.retryMode ?? (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }, config2), - sha256: config2?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config2?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config2?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config2?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config2?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js -var require_signin2 = __commonJS((exports) => { - var middlewareHostHeader = require_dist_cjs57(); - var middlewareLogger = require_dist_cjs58(); - var middlewareRecursionDetection = require_dist_cjs59(); - var middlewareUserAgent = require_dist_cjs84(); - var configResolver = require_dist_cjs86(); - var core2 = require_dist_cjs71(); - var schema = require_schema2(); - var middlewareContentLength = require_dist_cjs87(); - var middlewareEndpoint = require_dist_cjs90(); - var middlewareRetry = require_dist_cjs93(); - var smithyClient = require_dist_cjs81(); - var httpAuthSchemeProvider = require_httpAuthSchemeProvider8(); - var runtimeConfig = require_runtimeConfig7(); - var regionConfigResolver = require_dist_cjs101(); - var protocolHttp = require_dist_cjs56(); - var resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "signin" - }); - }; - var commonParams = { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - var getHttpAuthExtensionConfiguration = (runtimeConfig2) => { - const _httpAuthSchemes = runtimeConfig2.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig2.httpAuthSchemeProvider; - let _credentials = runtimeConfig2.credentials; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); - } - }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider2) { - _httpAuthSchemeProvider = httpAuthSchemeProvider2; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; - } - }; - }; - var resolveHttpAuthRuntimeConfig = (config2) => { - return { - httpAuthSchemes: config2.httpAuthSchemes(), - httpAuthSchemeProvider: config2.httpAuthSchemeProvider(), - credentials: config2.credentials() - }; - }; - var resolveRuntimeExtensions = (runtimeConfig2, extensions) => { - const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig2), smithyClient.getDefaultExtensionConfiguration(runtimeConfig2), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig2), getHttpAuthExtensionConfiguration(runtimeConfig2)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig2, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); - }; - - class SigninClient extends smithyClient.Client { - config; - constructor(...[configuration]) { - const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); - const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); - const _config_4 = configResolver.resolveRegionConfig(_config_3); - const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); - const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); - const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); - const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); - this.config = _config_8; - this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); - this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); - this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); - this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); - this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); - this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); - this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); - this.middlewareStack.use(core2.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSigninHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config2) => new core2.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config2.credentials - }) - })); - this.middlewareStack.use(core2.getHttpSigningPlugin(this.config)); - } - destroy() { - super.destroy(); - } - } - var SigninServiceException$1 = class SigninServiceException2 extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, SigninServiceException2.prototype); - } - }; - var AccessDeniedException$1 = class AccessDeniedException2 extends SigninServiceException$1 { - name = "AccessDeniedException"; - $fault = "client"; - error; - constructor(opts) { - super({ - name: "AccessDeniedException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, AccessDeniedException2.prototype); - this.error = opts.error; - } - }; - var InternalServerException$1 = class InternalServerException2 extends SigninServiceException$1 { - name = "InternalServerException"; - $fault = "server"; - error; - constructor(opts) { - super({ - name: "InternalServerException", - $fault: "server", - ...opts - }); - Object.setPrototypeOf(this, InternalServerException2.prototype); - this.error = opts.error; - } - }; - var TooManyRequestsError$1 = class TooManyRequestsError2 extends SigninServiceException$1 { - name = "TooManyRequestsError"; - $fault = "client"; - error; - constructor(opts) { - super({ - name: "TooManyRequestsError", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, TooManyRequestsError2.prototype); - this.error = opts.error; - } - }; - var ValidationException$1 = class ValidationException2 extends SigninServiceException$1 { - name = "ValidationException"; - $fault = "client"; - error; - constructor(opts) { - super({ - name: "ValidationException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ValidationException2.prototype); - this.error = opts.error; - } - }; - var _ADE = "AccessDeniedException"; - var _AT = "AccessToken"; - var _COAT = "CreateOAuth2Token"; - var _COATR = "CreateOAuth2TokenRequest"; - var _COATRB = "CreateOAuth2TokenRequestBody"; - var _COATRBr = "CreateOAuth2TokenResponseBody"; - var _COATRr = "CreateOAuth2TokenResponse"; - var _ISE = "InternalServerException"; - var _RT = "RefreshToken"; - var _TMRE = "TooManyRequestsError"; - var _VE = "ValidationException"; - var _aKI = "accessKeyId"; - var _aT = "accessToken"; - var _c = "client"; - var _cI = "clientId"; - var _cV = "codeVerifier"; - var _co = "code"; - var _e = "error"; - var _eI = "expiresIn"; - var _gT = "grantType"; - var _h = "http"; - var _hE = "httpError"; - var _iT = "idToken"; - var _jN = "jsonName"; - var _m = "message"; - var _rT = "refreshToken"; - var _rU = "redirectUri"; - var _s = "server"; - var _sAK = "secretAccessKey"; - var _sT = "sessionToken"; - var _sm = "smithy.ts.sdk.synthetic.com.amazonaws.signin"; - var _tI = "tokenInput"; - var _tO = "tokenOutput"; - var _tT = "tokenType"; - var n0 = "com.amazonaws.signin"; - var RefreshToken = [0, n0, _RT, 8, 0]; - var AccessDeniedException = [ - -3, - n0, - _ADE, - { - [_e]: _c - }, - [_e, _m], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1); - var AccessToken = [ - 3, - n0, - _AT, - 8, - [_aKI, _sAK, _sT], - [ - [ - 0, - { - [_jN]: _aKI - } - ], - [ - 0, - { - [_jN]: _sAK - } - ], - [ - 0, - { - [_jN]: _sT - } - ] - ] - ]; - var CreateOAuth2TokenRequest = [ - 3, - n0, - _COATR, - 0, - [_tI], - [[() => CreateOAuth2TokenRequestBody, 16]] - ]; - var CreateOAuth2TokenRequestBody = [ - 3, - n0, - _COATRB, - 0, - [_cI, _gT, _co, _rU, _cV, _rT], - [ - [ - 0, - { - [_jN]: _cI - } - ], - [ - 0, - { - [_jN]: _gT - } - ], - 0, - [ - 0, - { - [_jN]: _rU - } - ], - [ - 0, - { - [_jN]: _cV - } - ], - [ - () => RefreshToken, - { - [_jN]: _rT - } - ] - ] - ]; - var CreateOAuth2TokenResponse = [ - 3, - n0, - _COATRr, - 0, - [_tO], - [[() => CreateOAuth2TokenResponseBody, 16]] - ]; - var CreateOAuth2TokenResponseBody = [ - 3, - n0, - _COATRBr, - 0, - [_aT, _tT, _eI, _rT, _iT], - [ - [ - () => AccessToken, - { - [_jN]: _aT - } - ], - [ - 0, - { - [_jN]: _tT - } - ], - [ - 1, - { - [_jN]: _eI - } - ], - [ - () => RefreshToken, - { - [_jN]: _rT - } - ], - [ - 0, - { - [_jN]: _iT - } - ] - ] - ]; - var InternalServerException = [ - -3, - n0, - _ISE, - { - [_e]: _s, - [_hE]: 500 - }, - [_e, _m], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1); - var TooManyRequestsError = [ - -3, - n0, - _TMRE, - { - [_e]: _c, - [_hE]: 429 - }, - [_e, _m], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(TooManyRequestsError, TooManyRequestsError$1); - var ValidationException = [ - -3, - n0, - _VE, - { - [_e]: _c, - [_hE]: 400 - }, - [_e, _m], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1); - var SigninServiceException = [-3, _sm, "SigninServiceException", 0, [], []]; - schema.TypeRegistry.for(_sm).registerError(SigninServiceException, SigninServiceException$1); - var CreateOAuth2Token = [ - 9, - n0, - _COAT, - { - [_h]: ["POST", "/v1/token", 200] - }, - () => CreateOAuth2TokenRequest, - () => CreateOAuth2TokenResponse - ]; - - class CreateOAuth2TokenCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("Signin", "CreateOAuth2Token", {}).n("SigninClient", "CreateOAuth2TokenCommand").sc(CreateOAuth2Token).build() { - } - var commands = { - CreateOAuth2TokenCommand - }; - - class Signin extends SigninClient { - } - smithyClient.createAggregatedClient(commands, Signin); - var OAuth2ErrorCode = { - AUTHCODE_EXPIRED: "AUTHCODE_EXPIRED", - INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS", - INVALID_REQUEST: "INVALID_REQUEST", - SERVER_ERROR: "server_error", - TOKEN_EXPIRED: "TOKEN_EXPIRED", - USER_CREDENTIALS_CHANGED: "USER_CREDENTIALS_CHANGED" - }; - Object.defineProperty(exports, "$Command", { - enumerable: true, - get: function() { - return smithyClient.Command; - } - }); - Object.defineProperty(exports, "__Client", { - enumerable: true, - get: function() { - return smithyClient.Client; - } - }); - exports.AccessDeniedException = AccessDeniedException$1; - exports.CreateOAuth2TokenCommand = CreateOAuth2TokenCommand; - exports.InternalServerException = InternalServerException$1; - exports.OAuth2ErrorCode = OAuth2ErrorCode; - exports.Signin = Signin; - exports.SigninClient = SigninClient; - exports.SigninServiceException = SigninServiceException$1; - exports.TooManyRequestsError = TooManyRequestsError$1; - exports.ValidationException = ValidationException$1; -}); - -// ../node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js -var require_dist_cjs105 = __commonJS((exports) => { - var client = require_client3(); - var propertyProvider = require_dist_cjs76(); - var sharedIniFileLoader = require_dist_cjs88(); - var protocolHttp = require_dist_cjs56(); - var node_crypto = __require("node:crypto"); - var node_fs = __require("node:fs"); - var node_os = __require("node:os"); - var node_path = __require("node:path"); - - class LoginCredentialsFetcher { - profileData; - init; - callerClientConfig; - static REFRESH_THRESHOLD = 5 * 60 * 1000; - constructor(profileData, init, callerClientConfig) { - this.profileData = profileData; - this.init = init; - this.callerClientConfig = callerClientConfig; - } - async loadCredentials() { - const token = await this.loadToken(); - if (!token) { - throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger }); - } - const accessToken = token.accessToken; - const now2 = Date.now(); - const expiryTime = new Date(accessToken.expiresAt).getTime(); - const timeUntilExpiry = expiryTime - now2; - if (timeUntilExpiry <= LoginCredentialsFetcher.REFRESH_THRESHOLD) { - return this.refresh(token); - } - return { - accessKeyId: accessToken.accessKeyId, - secretAccessKey: accessToken.secretAccessKey, - sessionToken: accessToken.sessionToken, - accountId: accessToken.accountId, - expiration: new Date(accessToken.expiresAt) - }; - } - get logger() { - return this.init?.logger; - } - get loginSession() { - return this.profileData.login_session; - } - async refresh(token) { - const { SigninClient, CreateOAuth2TokenCommand } = await Promise.resolve().then(() => __toESM(require_signin2(), 1)); - const { logger, userAgentAppId } = this.callerClientConfig ?? {}; - const isH2 = (requestHandler2) => { - return requestHandler2?.metadata?.handlerProtocol === "h2"; - }; - const requestHandler = isH2(this.callerClientConfig?.requestHandler) ? undefined : this.callerClientConfig?.requestHandler; - const region = this.profileData.region ?? await this.callerClientConfig?.region?.() ?? process.env.AWS_REGION; - const client2 = new SigninClient({ - credentials: { - accessKeyId: "", - secretAccessKey: "" - }, - region, - requestHandler, - logger, - userAgentAppId, - ...this.init?.clientConfig - }); - this.createDPoPInterceptor(client2.middlewareStack); - const commandInput = { - tokenInput: { - clientId: token.clientId, - refreshToken: token.refreshToken, - grantType: "refresh_token" - } - }; - try { - const response = await client2.send(new CreateOAuth2TokenCommand(commandInput)); - const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {}; - const { refreshToken, expiresIn } = response.tokenOutput ?? {}; - if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) { - throw new propertyProvider.CredentialsProviderError("Token refresh response missing required fields", { - logger: this.logger, - tryNextLink: false - }); - } - const expiresInMs = (expiresIn ?? 900) * 1000; - const expiration = new Date(Date.now() + expiresInMs); - const updatedToken = { - ...token, - accessToken: { - ...token.accessToken, - accessKeyId, - secretAccessKey, - sessionToken, - expiresAt: expiration.toISOString() - }, - refreshToken - }; - await this.saveToken(updatedToken); - const newAccessToken = updatedToken.accessToken; - return { - accessKeyId: newAccessToken.accessKeyId, - secretAccessKey: newAccessToken.secretAccessKey, - sessionToken: newAccessToken.sessionToken, - accountId: newAccessToken.accountId, - expiration - }; - } catch (error41) { - if (error41.name === "AccessDeniedException") { - const errorType = error41.error; - let message; - switch (errorType) { - case "TOKEN_EXPIRED": - message = "Your session has expired. Please reauthenticate."; - break; - case "USER_CREDENTIALS_CHANGED": - message = "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password."; - break; - case "INSUFFICIENT_PERMISSIONS": - message = "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action."; - break; - default: - message = `Failed to refresh token: ${String(error41)}. Please re-authenticate using \`aws login\``; - } - throw new propertyProvider.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false }); - } - throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error41)}. Please re-authenticate using aws login`, { logger: this.logger }); - } - } - async loadToken() { - const tokenFilePath = this.getTokenFilePath(); - try { - let tokenData; - try { - tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache }); - } catch { - tokenData = await node_fs.promises.readFile(tokenFilePath, "utf8"); - } - const token = JSON.parse(tokenData); - const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k) => !token[k]); - if (!token.accessToken?.accountId) { - missingFields.push("accountId"); - } - if (missingFields.length > 0) { - throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, { - logger: this.logger, - tryNextLink: false - }); - } - return token; - } catch (error41) { - throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error41)}`, { - logger: this.logger, - tryNextLink: false - }); - } - } - async saveToken(token) { - const tokenFilePath = this.getTokenFilePath(); - const directory = node_path.dirname(tokenFilePath); - try { - await node_fs.promises.mkdir(directory, { recursive: true }); - } catch (error41) {} - await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8"); - } - getTokenFilePath() { - const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), ".aws", "login", "cache"); - const loginSessionBytes = Buffer.from(this.loginSession, "utf8"); - const loginSessionSha256 = node_crypto.createHash("sha256").update(loginSessionBytes).digest("hex"); - return node_path.join(directory, `${loginSessionSha256}.json`); - } - derToRawSignature(derSignature) { - let offset = 2; - if (derSignature[offset] !== 2) { - throw new Error("Invalid DER signature"); - } - offset++; - const rLength = derSignature[offset++]; - let r = derSignature.subarray(offset, offset + rLength); - offset += rLength; - if (derSignature[offset] !== 2) { - throw new Error("Invalid DER signature"); - } - offset++; - const sLength = derSignature[offset++]; - let s = derSignature.subarray(offset, offset + sLength); - r = r[0] === 0 ? r.subarray(1) : r; - s = s[0] === 0 ? s.subarray(1) : s; - const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]); - const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]); - return Buffer.concat([rPadded, sPadded]); - } - createDPoPInterceptor(middlewareStack) { - middlewareStack.add((next) => async (args) => { - if (protocolHttp.HttpRequest.isInstance(args.request)) { - const request = args.request; - const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`; - const dpop = await this.generateDpop(request.method, actualEndpoint); - request.headers = { - ...request.headers, - DPoP: dpop - }; - } - return next(args); - }, { - step: "finalizeRequest", - name: "dpopInterceptor", - override: true - }); - } - async generateDpop(method2 = "POST", endpoint) { - const token = await this.loadToken(); - try { - const privateKey = node_crypto.createPrivateKey({ - key: token.dpopKey, - format: "pem", - type: "sec1" - }); - const publicKey = node_crypto.createPublicKey(privateKey); - const publicDer = publicKey.export({ format: "der", type: "spki" }); - let pointStart = -1; - for (let i2 = 0;i2 < publicDer.length; i2++) { - if (publicDer[i2] === 4) { - pointStart = i2; - break; - } - } - const x2 = publicDer.slice(pointStart + 1, pointStart + 33); - const y2 = publicDer.slice(pointStart + 33, pointStart + 65); - const header = { - alg: "ES256", - typ: "dpop+jwt", - jwk: { - kty: "EC", - crv: "P-256", - x: x2.toString("base64url"), - y: y2.toString("base64url") - } - }; - const payload = { - jti: crypto.randomUUID(), - htm: method2, - htu: endpoint, - iat: Math.floor(Date.now() / 1000) - }; - const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url"); - const payloadB64 = Buffer.from(JSON.stringify(payload)).toString("base64url"); - const message = `${headerB64}.${payloadB64}`; - const asn1Signature = node_crypto.sign("sha256", Buffer.from(message), privateKey); - const rawSignature = this.derToRawSignature(asn1Signature); - const signatureB64 = rawSignature.toString("base64url"); - return `${message}.${signatureB64}`; - } catch (error41) { - throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error41 instanceof Error ? error41.message : String(error41)}`, { logger: this.logger, tryNextLink: false }); - } - } - } - var fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => { - init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials"); - const profiles = await sharedIniFileLoader.parseKnownFiles(init || {}); - const profileName = sharedIniFileLoader.getProfileName({ - profile: init?.profile ?? callerClientConfig?.profile - }); - const profile = profiles[profileName]; - if (!profile?.login_session) { - throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, { - tryNextLink: true, - logger: init?.logger - }); - } - const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig); - const credentials = await fetcher.loadCredentials(); - return client.setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD"); - }; - exports.fromLoginCredentials = fromLoginCredentials; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider9 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = undefined; - var core_1 = require_dist_cjs83(); - var util_middleware_1 = require_dist_cjs60(); - var STSClient_1 = require_STSClient2(); - var defaultSTSHttpAuthSchemeParametersProvider = async (config2, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config2.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "sts", - region: authParameters.region - }, - propertiesExtractor: (config2, context) => ({ - signingProperties: { - config: config2, - context - } - }) - }; - } - function createSmithyApiNoAuthHttpAuthOption(authParameters) { - return { - schemeId: "smithy.api#noAuth" - }; - } - var defaultSTSHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - case "AssumeRoleWithWebIdentity": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); - } - } - return options; - }; - exports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider; - var resolveStsAuthConfig = (input) => Object.assign(input, { - stsClientCtor: STSClient_1.STSClient - }); - exports.resolveStsAuthConfig = resolveStsAuthConfig; - var resolveHttpAuthSchemeConfig = (config2) => { - const config_0 = (0, exports.resolveStsAuthConfig)(config2); - const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0); - return Object.assign(config_1, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config2.authSchemePreference ?? []) - }); - }; - exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/EndpointParameters.js -var require_EndpointParameters2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.commonParams = exports.resolveClientEndpointParameters = undefined; - var resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - useGlobalEndpoint: options.useGlobalEndpoint ?? false, - defaultSigningName: "sts" - }); - }; - exports.resolveClientEndpointParameters = resolveClientEndpointParameters; - exports.commonParams = { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/ruleset.js -var require_ruleset8 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ruleSet = undefined; - var F = "required"; - var G3 = "type"; - var H2 = "fn"; - var I2 = "argv"; - var J = "ref"; - var a2 = false; - var b = true; - var c5 = "booleanEquals"; - var d = "stringEquals"; - var e = "sigv4"; - var f = "sts"; - var g = "us-east-1"; - var h2 = "endpoint"; - var i2 = "https://sts.{Region}.{PartitionResult#dnsSuffix}"; - var j = "tree"; - var k = "error"; - var l = "getAttr"; - var m = { [F]: false, [G3]: "string" }; - var n2 = { [F]: true, default: false, [G3]: "boolean" }; - var o2 = { [J]: "Endpoint" }; - var p = { [H2]: "isSet", [I2]: [{ [J]: "Region" }] }; - var q = { [J]: "Region" }; - var r = { [H2]: "aws.partition", [I2]: [q], assign: "PartitionResult" }; - var s = { [J]: "UseFIPS" }; - var t = { [J]: "UseDualStack" }; - var u2 = { url: "https://sts.amazonaws.com", properties: { authSchemes: [{ name: e, signingName: f, signingRegion: g }] }, headers: {} }; - var v = {}; - var w = { conditions: [{ [H2]: d, [I2]: [q, "aws-global"] }], [h2]: u2, [G3]: h2 }; - var x2 = { [H2]: c5, [I2]: [s, true] }; - var y2 = { [H2]: c5, [I2]: [t, true] }; - var z2 = { [H2]: l, [I2]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }; - var A = { [J]: "PartitionResult" }; - var B = { [H2]: c5, [I2]: [true, { [H2]: l, [I2]: [A, "supportsDualStack"] }] }; - var C2 = [{ [H2]: "isSet", [I2]: [o2] }]; - var D2 = [x2]; - var E = [y2]; - var _data = { version: "1.0", parameters: { Region: m, UseDualStack: n2, UseFIPS: n2, Endpoint: m, UseGlobalEndpoint: n2 }, rules: [{ conditions: [{ [H2]: c5, [I2]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H2]: "not", [I2]: C2 }, p, r, { [H2]: c5, [I2]: [s, a2] }, { [H2]: c5, [I2]: [t, a2] }], rules: [{ conditions: [{ [H2]: d, [I2]: [q, "ap-northeast-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "ap-south-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "ap-southeast-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "ap-southeast-2"] }], endpoint: u2, [G3]: h2 }, w, { conditions: [{ [H2]: d, [I2]: [q, "ca-central-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-central-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-north-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-west-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-west-2"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-west-3"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "sa-east-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, g] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "us-east-2"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "us-west-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "us-west-2"] }], endpoint: u2, [G3]: h2 }, { endpoint: { url: i2, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G3]: h2 }], [G3]: j }, { conditions: C2, rules: [{ conditions: D2, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G3]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G3]: k }, { endpoint: { url: o2, properties: v, headers: v }, [G3]: h2 }], [G3]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x2, y2], rules: [{ conditions: [{ [H2]: c5, [I2]: [b, z2] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G3]: h2 }], [G3]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G3]: k }], [G3]: j }, { conditions: D2, rules: [{ conditions: [{ [H2]: c5, [I2]: [z2, b] }], rules: [{ conditions: [{ [H2]: d, [I2]: [{ [H2]: l, [I2]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G3]: h2 }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G3]: h2 }], [G3]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G3]: k }], [G3]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G3]: h2 }], [G3]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G3]: k }], [G3]: j }, w, { endpoint: { url: i2, properties: v, headers: v }, [G3]: h2 }], [G3]: j }], [G3]: j }, { error: "Invalid Configuration: Missing Region", [G3]: k }] }; - exports.ruleSet = _data; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/endpointResolver.js -var require_endpointResolver8 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultEndpointResolver = undefined; - var util_endpoints_1 = require_dist_cjs75(); - var util_endpoints_2 = require_dist_cjs72(); - var ruleset_1 = require_ruleset8(); - var cache2 = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"] - }); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return cache2.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - })); - }; - exports.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.shared.js -var require_runtimeConfig_shared8 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var core_1 = require_dist_cjs83(); - var protocols_1 = require_protocols4(); - var core_2 = require_dist_cjs71(); - var smithy_client_1 = require_dist_cjs81(); - var url_parser_1 = require_dist_cjs74(); - var util_base64_1 = require_dist_cjs65(); - var util_utf8_1 = require_dist_cjs64(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider9(); - var endpointResolver_1 = require_endpointResolver8(); - var getRuntimeConfig = (config2) => { - return { - apiVersion: "2011-06-15", - base64Decoder: config2?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config2?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config2?.disableHostPrefix ?? false, - endpointProvider: config2?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config2?.extensions ?? [], - httpAuthSchemeProvider: config2?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner - } - ], - logger: config2?.logger ?? new smithy_client_1.NoOpLogger, - protocol: config2?.protocol ?? new protocols_1.AwsQueryProtocol({ - defaultNamespace: "com.amazonaws.sts", - xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", - version: "2011-06-15" - }), - serviceId: config2?.serviceId ?? "STS", - urlParser: config2?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config2?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config2?.utf8Encoder ?? util_utf8_1.toUtf8 - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.js -var require_runtimeConfig8 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var tslib_1 = require_tslib2(); - var package_json_1 = tslib_1.__importDefault(require_package3()); - var core_1 = require_dist_cjs83(); - var util_user_agent_node_1 = require_dist_cjs97(); - var config_resolver_1 = require_dist_cjs86(); - var core_2 = require_dist_cjs71(); - var hash_node_1 = require_dist_cjs98(); - var middleware_retry_1 = require_dist_cjs93(); - var node_config_provider_1 = require_dist_cjs89(); - var node_http_handler_1 = require_dist_cjs68(); - var util_body_length_node_1 = require_dist_cjs99(); - var util_retry_1 = require_dist_cjs92(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared8(); - var smithy_client_1 = require_dist_cjs81(); - var util_defaults_mode_node_1 = require_dist_cjs100(); - var smithy_client_2 = require_dist_cjs81(); - var getRuntimeConfig = (config2) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config2); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config2?.profile, - logger: clientSharedValues.logger - }; - return { - ...clientSharedValues, - ...config2, - runtime: "node", - defaultsMode, - authSchemePreference: config2?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config2?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - defaultUserAgentProvider: config2?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await config2.credentialDefaultProvider(idProps?.__config || {})()), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner - } - ], - maxAttempts: config2?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config2), - region: config2?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config2?.requestHandler ?? defaultConfigProvider), - retryMode: config2?.retryMode ?? (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }, config2), - sha256: config2?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config2?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config2?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config2?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config2?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthExtensionConfiguration.js -var require_httpAuthExtensionConfiguration2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = undefined; - var getHttpAuthExtensionConfiguration = (runtimeConfig) => { - const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; - let _credentials = runtimeConfig.credentials; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); - } - }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider) { - _httpAuthSchemeProvider = httpAuthSchemeProvider; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; - } - }; - }; - exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration; - var resolveHttpAuthRuntimeConfig = (config2) => { - return { - httpAuthSchemes: config2.httpAuthSchemes(), - httpAuthSchemeProvider: config2.httpAuthSchemeProvider(), - credentials: config2.credentials() - }; - }; - exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeExtensions.js -var require_runtimeExtensions2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveRuntimeExtensions = undefined; - var region_config_resolver_1 = require_dist_cjs101(); - var protocol_http_1 = require_dist_cjs56(); - var smithy_client_1 = require_dist_cjs81(); - var httpAuthExtensionConfiguration_1 = require_httpAuthExtensionConfiguration2(); - var resolveRuntimeExtensions = (runtimeConfig, extensions) => { - const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration)); - }; - exports.resolveRuntimeExtensions = resolveRuntimeExtensions; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/STSClient.js -var require_STSClient2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.STSClient = exports.__Client = undefined; - var middleware_host_header_1 = require_dist_cjs57(); - var middleware_logger_1 = require_dist_cjs58(); - var middleware_recursion_detection_1 = require_dist_cjs59(); - var middleware_user_agent_1 = require_dist_cjs84(); - var config_resolver_1 = require_dist_cjs86(); - var core_1 = require_dist_cjs71(); - var schema_1 = require_schema2(); - var middleware_content_length_1 = require_dist_cjs87(); - var middleware_endpoint_1 = require_dist_cjs90(); - var middleware_retry_1 = require_dist_cjs93(); - var smithy_client_1 = require_dist_cjs81(); - Object.defineProperty(exports, "__Client", { enumerable: true, get: function() { - return smithy_client_1.Client; - } }); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider9(); - var EndpointParameters_1 = require_EndpointParameters2(); - var runtimeConfig_1 = require_runtimeConfig8(); - var runtimeExtensions_1 = require_runtimeExtensions2(); - - class STSClient extends smithy_client_1.Client { - config; - constructor(...[configuration]) { - const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); - const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1); - const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2); - const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3); - const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5); - const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6); - const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []); - this.config = _config_8; - this.middlewareStack.use((0, schema_1.getSchemaSerdePlugin)(this.config)); - this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); - this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); - this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); - this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); - this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); - this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config2) => new core_1.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config2.credentials - }) - })); - this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config)); - } - destroy() { - super.destroy(); - } - } - exports.STSClient = STSClient; -}); - -// ../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js -var require_sts2 = __commonJS((exports) => { - var STSClient = require_STSClient2(); - var smithyClient = require_dist_cjs81(); - var middlewareEndpoint = require_dist_cjs90(); - var EndpointParameters = require_EndpointParameters2(); - var schema = require_schema2(); - var client = require_client3(); - var regionConfigResolver = require_dist_cjs101(); - var STSServiceException$1 = class STSServiceException2 extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, STSServiceException2.prototype); - } - }; - var ExpiredTokenException$1 = class ExpiredTokenException2 extends STSServiceException$1 { - name = "ExpiredTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ExpiredTokenException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ExpiredTokenException2.prototype); - } - }; - var MalformedPolicyDocumentException$1 = class MalformedPolicyDocumentException2 extends STSServiceException$1 { - name = "MalformedPolicyDocumentException"; - $fault = "client"; - constructor(opts) { - super({ - name: "MalformedPolicyDocumentException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, MalformedPolicyDocumentException2.prototype); - } - }; - var PackedPolicyTooLargeException$1 = class PackedPolicyTooLargeException2 extends STSServiceException$1 { - name = "PackedPolicyTooLargeException"; - $fault = "client"; - constructor(opts) { - super({ - name: "PackedPolicyTooLargeException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, PackedPolicyTooLargeException2.prototype); - } - }; - var RegionDisabledException$1 = class RegionDisabledException2 extends STSServiceException$1 { - name = "RegionDisabledException"; - $fault = "client"; - constructor(opts) { - super({ - name: "RegionDisabledException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, RegionDisabledException2.prototype); - } - }; - var IDPRejectedClaimException$1 = class IDPRejectedClaimException2 extends STSServiceException$1 { - name = "IDPRejectedClaimException"; - $fault = "client"; - constructor(opts) { - super({ - name: "IDPRejectedClaimException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, IDPRejectedClaimException2.prototype); - } - }; - var InvalidIdentityTokenException$1 = class InvalidIdentityTokenException2 extends STSServiceException$1 { - name = "InvalidIdentityTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidIdentityTokenException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidIdentityTokenException2.prototype); - } - }; - var IDPCommunicationErrorException$1 = class IDPCommunicationErrorException2 extends STSServiceException$1 { - name = "IDPCommunicationErrorException"; - $fault = "client"; - constructor(opts) { - super({ - name: "IDPCommunicationErrorException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, IDPCommunicationErrorException2.prototype); - } - }; - var _A = "Arn"; - var _AKI = "AccessKeyId"; - var _AR = "AssumeRole"; - var _ARI = "AssumedRoleId"; - var _ARR = "AssumeRoleRequest"; - var _ARRs = "AssumeRoleResponse"; - var _ARU = "AssumedRoleUser"; - var _ARWWI = "AssumeRoleWithWebIdentity"; - var _ARWWIR = "AssumeRoleWithWebIdentityRequest"; - var _ARWWIRs = "AssumeRoleWithWebIdentityResponse"; - var _Au = "Audience"; - var _C = "Credentials"; - var _CA = "ContextAssertion"; - var _DS = "DurationSeconds"; - var _E = "Expiration"; - var _EI = "ExternalId"; - var _ETE = "ExpiredTokenException"; - var _IDPCEE = "IDPCommunicationErrorException"; - var _IDPRCE = "IDPRejectedClaimException"; - var _IITE = "InvalidIdentityTokenException"; - var _K = "Key"; - var _MPDE = "MalformedPolicyDocumentException"; - var _P = "Policy"; - var _PA = "PolicyArns"; - var _PAr = "ProviderArn"; - var _PC = "ProvidedContexts"; - var _PCLT = "ProvidedContextsListType"; - var _PCr = "ProvidedContext"; - var _PDT = "PolicyDescriptorType"; - var _PI = "ProviderId"; - var _PPS = "PackedPolicySize"; - var _PPTLE = "PackedPolicyTooLargeException"; - var _Pr = "Provider"; - var _RA = "RoleArn"; - var _RDE = "RegionDisabledException"; - var _RSN = "RoleSessionName"; - var _SAK = "SecretAccessKey"; - var _SFWIT = "SubjectFromWebIdentityToken"; - var _SI = "SourceIdentity"; - var _SN = "SerialNumber"; - var _ST = "SessionToken"; - var _T = "Tags"; - var _TC = "TokenCode"; - var _TTK = "TransitiveTagKeys"; - var _Ta = "Tag"; - var _V = "Value"; - var _WIT = "WebIdentityToken"; - var _a2 = "arn"; - var _aKST = "accessKeySecretType"; - var _aQE = "awsQueryError"; - var _c = "client"; - var _cTT = "clientTokenType"; - var _e = "error"; - var _hE = "httpError"; - var _m = "message"; - var _pDLT = "policyDescriptorListType"; - var _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; - var _tLT = "tagListType"; - var n0 = "com.amazonaws.sts"; - var accessKeySecretType = [0, n0, _aKST, 8, 0]; - var clientTokenType = [0, n0, _cTT, 8, 0]; - var AssumedRoleUser = [3, n0, _ARU, 0, [_ARI, _A], [0, 0]]; - var AssumeRoleRequest = [ - 3, - n0, - _ARR, - 0, - [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC], - [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType] - ]; - var AssumeRoleResponse = [ - 3, - n0, - _ARRs, - 0, - [_C, _ARU, _PPS, _SI], - [[() => Credentials, 0], () => AssumedRoleUser, 1, 0] - ]; - var AssumeRoleWithWebIdentityRequest = [ - 3, - n0, - _ARWWIR, - 0, - [_RA, _RSN, _WIT, _PI, _PA, _P, _DS], - [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1] - ]; - var AssumeRoleWithWebIdentityResponse = [ - 3, - n0, - _ARWWIRs, - 0, - [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI], - [[() => Credentials, 0], 0, () => AssumedRoleUser, 1, 0, 0, 0] - ]; - var Credentials = [ - 3, - n0, - _C, - 0, - [_AKI, _SAK, _ST, _E], - [0, [() => accessKeySecretType, 0], 0, 4] - ]; - var ExpiredTokenException = [ - -3, - n0, - _ETE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ExpiredTokenException`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1); - var IDPCommunicationErrorException = [ - -3, - n0, - _IDPCEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`IDPCommunicationError`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(IDPCommunicationErrorException, IDPCommunicationErrorException$1); - var IDPRejectedClaimException = [ - -3, - n0, - _IDPRCE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`IDPRejectedClaim`, 403] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(IDPRejectedClaimException, IDPRejectedClaimException$1); - var InvalidIdentityTokenException = [ - -3, - n0, - _IITE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InvalidIdentityToken`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidIdentityTokenException, InvalidIdentityTokenException$1); - var MalformedPolicyDocumentException = [ - -3, - n0, - _MPDE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`MalformedPolicyDocument`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(MalformedPolicyDocumentException, MalformedPolicyDocumentException$1); - var PackedPolicyTooLargeException = [ - -3, - n0, - _PPTLE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`PackedPolicyTooLarge`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(PackedPolicyTooLargeException, PackedPolicyTooLargeException$1); - var PolicyDescriptorType = [3, n0, _PDT, 0, [_a2], [0]]; - var ProvidedContext = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]]; - var RegionDisabledException = [ - -3, - n0, - _RDE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`RegionDisabledException`, 403] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(RegionDisabledException, RegionDisabledException$1); - var Tag = [3, n0, _Ta, 0, [_K, _V], [0, 0]]; - var STSServiceException = [-3, _s, "STSServiceException", 0, [], []]; - schema.TypeRegistry.for(_s).registerError(STSServiceException, STSServiceException$1); - var policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType]; - var ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext]; - var tagListType = [1, n0, _tLT, 0, () => Tag]; - var AssumeRole = [9, n0, _AR, 0, () => AssumeRoleRequest, () => AssumeRoleResponse]; - var AssumeRoleWithWebIdentity = [ - 9, - n0, - _ARWWI, - 0, - () => AssumeRoleWithWebIdentityRequest, - () => AssumeRoleWithWebIdentityResponse - ]; - - class AssumeRoleCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole).build() { - } - - class AssumeRoleWithWebIdentityCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity).build() { - } - var commands = { - AssumeRoleCommand, - AssumeRoleWithWebIdentityCommand - }; - - class STS extends STSClient.STSClient { - } - smithyClient.createAggregatedClient(commands, STS); - var getAccountIdFromAssumedRoleUser = (assumedRoleUser) => { - if (typeof assumedRoleUser?.Arn === "string") { - const arnComponents = assumedRoleUser.Arn.split(":"); - if (arnComponents.length > 4 && arnComponents[4] !== "") { - return arnComponents[4]; - } - } - return; - }; - var resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => { - const region = typeof _region === "function" ? await _region() : _region; - const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; - const stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)(); - credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`); - return region ?? parentRegion ?? stsDefaultRegion; - }; - var getDefaultRoleAssumer$1 = (stsOptions, STSClient2) => { - let stsClient; - let closureSourceCreds; - return async (sourceCreds, params) => { - closureSourceCreds = sourceCreds; - if (!stsClient) { - const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; - const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { - logger, - profile - }); - const isCompatibleRequestHandler = !isH2(requestHandler); - stsClient = new STSClient2({ - ...stsOptions, - userAgentAppId, - profile, - credentialDefaultProvider: () => async () => closureSourceCreds, - region: resolvedRegion, - requestHandler: isCompatibleRequestHandler ? requestHandler : undefined, - logger - }); - } - const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params)); - if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) { - throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); - } - const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2); - const credentials = { - accessKeyId: Credentials2.AccessKeyId, - secretAccessKey: Credentials2.SecretAccessKey, - sessionToken: Credentials2.SessionToken, - expiration: Credentials2.Expiration, - ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope }, - ...accountId && { accountId } - }; - client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i"); - return credentials; - }; - }; - var getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient2) => { - let stsClient; - return async (params) => { - if (!stsClient) { - const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; - const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { - logger, - profile - }); - const isCompatibleRequestHandler = !isH2(requestHandler); - stsClient = new STSClient2({ - ...stsOptions, - userAgentAppId, - profile, - region: resolvedRegion, - requestHandler: isCompatibleRequestHandler ? requestHandler : undefined, - logger - }); - } - const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params)); - if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) { - throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); - } - const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2); - const credentials = { - accessKeyId: Credentials2.AccessKeyId, - secretAccessKey: Credentials2.SecretAccessKey, - sessionToken: Credentials2.SessionToken, - expiration: Credentials2.Expiration, - ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope }, - ...accountId && { accountId } - }; - if (accountId) { - client.setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T"); - } - client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k"); - return credentials; - }; - }; - var isH2 = (requestHandler) => { - return requestHandler?.metadata?.handlerProtocol === "h2"; - }; - var getCustomizableStsClientCtor = (baseCtor, customizations) => { - if (!customizations) - return baseCtor; - else - return class CustomizableSTSClient extends baseCtor { - constructor(config2) { - super(config2); - for (const customization of customizations) { - this.middlewareStack.use(customization); - } - } - }; - }; - var getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins)); - var getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins)); - var decorateDefaultCredentialProvider = (provider) => (input) => provider({ - roleAssumer: getDefaultRoleAssumer(input), - roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input), - ...input - }); - Object.defineProperty(exports, "$Command", { - enumerable: true, - get: function() { - return smithyClient.Command; - } - }); - exports.AssumeRoleCommand = AssumeRoleCommand; - exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand; - exports.ExpiredTokenException = ExpiredTokenException$1; - exports.IDPCommunicationErrorException = IDPCommunicationErrorException$1; - exports.IDPRejectedClaimException = IDPRejectedClaimException$1; - exports.InvalidIdentityTokenException = InvalidIdentityTokenException$1; - exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException$1; - exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException$1; - exports.RegionDisabledException = RegionDisabledException$1; - exports.STS = STS; - exports.STSServiceException = STSServiceException$1; - exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; - exports.getDefaultRoleAssumer = getDefaultRoleAssumer; - exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; - Object.keys(STSClient).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - Object.defineProperty(exports, k, { - enumerable: true, - get: function() { - return STSClient[k]; - } - }); - }); -}); - -// ../node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js -var require_dist_cjs106 = __commonJS((exports) => { - var sharedIniFileLoader = require_dist_cjs88(); - var propertyProvider = require_dist_cjs76(); - var child_process = __require("child_process"); - var util3 = __require("util"); - var client = require_client3(); - var getValidatedProcessCredentials = (profileName, data, profiles) => { - if (data.Version !== 1) { - throw Error(`Profile ${profileName} credential_process did not return Version 1.`); - } - if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) { - throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); - } - if (data.Expiration) { - const currentTime = new Date; - const expireTime = new Date(data.Expiration); - if (expireTime < currentTime) { - throw Error(`Profile ${profileName} credential_process returned expired credentials.`); - } - } - let accountId = data.AccountId; - if (!accountId && profiles?.[profileName]?.aws_account_id) { - accountId = profiles[profileName].aws_account_id; - } - const credentials = { - accessKeyId: data.AccessKeyId, - secretAccessKey: data.SecretAccessKey, - ...data.SessionToken && { sessionToken: data.SessionToken }, - ...data.Expiration && { expiration: new Date(data.Expiration) }, - ...data.CredentialScope && { credentialScope: data.CredentialScope }, - ...accountId && { accountId } - }; - client.setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w"); - return credentials; - }; - var resolveProcessCredentials = async (profileName, profiles, logger) => { - const profile = profiles[profileName]; - if (profiles[profileName]) { - const credentialProcess = profile["credential_process"]; - if (credentialProcess !== undefined) { - const execPromise = util3.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? child_process.exec); - try { - const { stdout } = await execPromise(credentialProcess); - let data; - try { - data = JSON.parse(stdout.trim()); - } catch { - throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); - } - return getValidatedProcessCredentials(profileName, data, profiles); - } catch (error41) { - throw new propertyProvider.CredentialsProviderError(error41.message, { logger }); - } - } else { - throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger }); - } - } else { - throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, { - logger - }); - } - }; - var fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => { - init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess"); - const profiles = await sharedIniFileLoader.parseKnownFiles(init); - return resolveProcessCredentials(sharedIniFileLoader.getProfileName({ - profile: init.profile ?? callerClientConfig?.profile - }), profiles, init.logger); - }; - exports.fromProcess = fromProcess; -}); - -// ../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js -var require_fromWebToken2 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - } : function(o2, v) { - o2["default"] = v; - }); - var __importStar = exports && exports.__importStar || function() { - var ownKeys = function(o2) { - ownKeys = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k in o3) - if (Object.prototype.hasOwnProperty.call(o3, k)) - ar[ar.length] = k; - return ar; - }; - return ownKeys(o2); - }; - return function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result2 = {}; - if (mod2 != null) { - for (var k = ownKeys(mod2), i2 = 0;i2 < k.length; i2++) - if (k[i2] !== "default") - __createBinding(result2, mod2, k[i2]); - } - __setModuleDefault(result2, mod2); - return result2; - }; - }(); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromWebToken = undefined; - var fromWebToken = (init) => async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken"); - const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init; - let { roleAssumerWithWebIdentity } = init; - if (!roleAssumerWithWebIdentity) { - const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() => __importStar(require_sts2())); - roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({ - ...init.clientConfig, - credentialProviderLogger: init.logger, - parentClientConfig: { - ...awsIdentityProperties?.callerClientConfig, - ...init.parentClientConfig - } - }, init.clientPlugins); - } - return roleAssumerWithWebIdentity({ - RoleArn: roleArn, - RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`, - WebIdentityToken: webIdentityToken, - ProviderId: providerId, - PolicyArns: policyArns, - Policy: policy, - DurationSeconds: durationSeconds - }); - }; - exports.fromWebToken = fromWebToken; -}); - -// ../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js -var require_fromTokenFile2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromTokenFile = undefined; - var client_1 = require_client3(); - var property_provider_1 = require_dist_cjs76(); - var shared_ini_file_loader_1 = require_dist_cjs88(); - var fs_1 = __require("fs"); - var fromWebToken_1 = require_fromWebToken2(); - var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; - var ENV_ROLE_ARN = "AWS_ROLE_ARN"; - var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; - var fromTokenFile = (init = {}) => async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile"); - const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE]; - const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN]; - const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME]; - if (!webIdentityTokenFile || !roleArn) { - throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified", { - logger: init.logger - }); - } - const credentials = await (0, fromWebToken_1.fromWebToken)({ - ...init, - webIdentityToken: shared_ini_file_loader_1.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), - roleArn, - roleSessionName - })(awsIdentityProperties); - if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) { - (0, client_1.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h"); - } - return credentials; - }; - exports.fromTokenFile = fromTokenFile; -}); - -// ../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js -var require_dist_cjs107 = __commonJS((exports) => { - var fromTokenFile = require_fromTokenFile2(); - var fromWebToken = require_fromWebToken2(); - Object.keys(fromTokenFile).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - Object.defineProperty(exports, k, { - enumerable: true, - get: function() { - return fromTokenFile[k]; - } - }); - }); - Object.keys(fromWebToken).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - Object.defineProperty(exports, k, { - enumerable: true, - get: function() { - return fromWebToken[k]; - } - }); - }); -}); - -// ../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js -var require_dist_cjs108 = __commonJS((exports) => { - var sharedIniFileLoader = require_dist_cjs88(); - var propertyProvider = require_dist_cjs76(); - var client = require_client3(); - var credentialProviderLogin = require_dist_cjs105(); - var resolveCredentialSource = (credentialSource, profileName, logger) => { - const sourceProvidersMap = { - EcsContainer: async (options) => { - const { fromHttp } = await Promise.resolve().then(() => __toESM(require_dist_cjs96(), 1)); - const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs95(), 1)); - logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"); - return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider); - }, - Ec2InstanceMetadata: async (options) => { - logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata"); - const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs95(), 1)); - return async () => fromInstanceMetadata(options)().then(setNamedProvider); - }, - Environment: async (options) => { - logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment"); - const { fromEnv } = await Promise.resolve().then(() => __toESM(require_dist_cjs94(), 1)); - return async () => fromEnv(options)().then(setNamedProvider); - } - }; - if (credentialSource in sourceProvidersMap) { - return sourceProvidersMap[credentialSource]; - } else { - throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger }); - } - }; - var setNamedProvider = (creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"); - var isAssumeRoleProfile = (arg, { profile = "default", logger } = {}) => { - 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 }) || isCredentialSourceProfile(arg, { profile, logger })); - }; - var isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => { - const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; - if (withSourceProfile) { - logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`); - } - return withSourceProfile; - }; - var isCredentialSourceProfile = (arg, { profile, logger }) => { - const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; - if (withProviderProfile) { - logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`); - } - return withProviderProfile; - }; - var resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}, resolveProfileData2) => { - options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)"); - const profileData = profiles[profileName]; - const { source_profile, region } = profileData; - if (!options.roleAssumer) { - const { getDefaultRoleAssumer } = await Promise.resolve().then(() => __toESM(require_sts2(), 1)); - options.roleAssumer = getDefaultRoleAssumer({ - ...options.clientConfig, - credentialProviderLogger: options.logger, - parentClientConfig: { - ...options?.parentClientConfig, - region: region ?? options?.parentClientConfig?.region - } - }, options.clientPlugins); - } - if (source_profile && source_profile in visitedProfiles) { - throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger }); - } - options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`); - const sourceCredsProvider = source_profile ? resolveProfileData2(source_profile, profiles, options, { - ...visitedProfiles, - [source_profile]: true - }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))(); - if (isCredentialSourceWithoutRoleArn(profileData)) { - return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")); - } else { - const params = { - RoleArn: profileData.role_arn, - RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`, - ExternalId: profileData.external_id, - DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10) - }; - const { mfa_serial } = profileData; - if (mfa_serial) { - if (!options.mfaCodeProvider) { - throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false }); - } - params.SerialNumber = mfa_serial; - params.TokenCode = await options.mfaCodeProvider(mfa_serial); - } - const sourceCreds = await sourceCredsProvider; - return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")); - } - }; - var isCredentialSourceWithoutRoleArn = (section) => { - return !section.role_arn && !!section.credential_source; - }; - var isLoginProfile = (data) => { - return Boolean(data && data.login_session); - }; - var resolveLoginCredentials = async (profileName, options) => { - const credentials = await credentialProviderLogin.fromLoginCredentials({ - ...options, - profile: profileName - })(); - return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE_LOGIN", "AC"); - }; - var isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; - var resolveProcessCredentials = async (options, profile) => Promise.resolve().then(() => __toESM(require_dist_cjs106(), 1)).then(({ fromProcess }) => fromProcess({ - ...options, - profile - })().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))); - var resolveSsoCredentials = async (profile, profileData, options = {}) => { - const { fromSSO } = await Promise.resolve().then(() => __toESM(require_dist_cjs104(), 1)); - return fromSSO({ - profile, - logger: options.logger, - parentClientConfig: options.parentClientConfig, - clientConfig: options.clientConfig - })().then((creds) => { - if (profileData.sso_session) { - return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r"); - } else { - return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t"); - } - }); - }; - var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"); - var isStaticCredsProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1; - var resolveStaticCredentials = async (profile, options) => { - options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"); - const credentials = { - accessKeyId: profile.aws_access_key_id, - secretAccessKey: profile.aws_secret_access_key, - sessionToken: profile.aws_session_token, - ...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope }, - ...profile.aws_account_id && { accountId: profile.aws_account_id } - }; - return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n"); - }; - var isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; - var resolveWebIdentityCredentials = async (profile, options) => Promise.resolve().then(() => __toESM(require_dist_cjs107(), 1)).then(({ fromTokenFile }) => fromTokenFile({ - webIdentityTokenFile: profile.web_identity_token_file, - roleArn: profile.role_arn, - roleSessionName: profile.role_session_name, - roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, - logger: options.logger, - parentClientConfig: options.parentClientConfig - })().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))); - var resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => { - const data = profiles[profileName]; - if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) { - return resolveStaticCredentials(data, options); - } - if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) { - return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles, resolveProfileData); - } - if (isStaticCredsProfile(data)) { - return resolveStaticCredentials(data, options); - } - if (isWebIdentityProfile(data)) { - return resolveWebIdentityCredentials(data, options); - } - if (isProcessProfile(data)) { - return resolveProcessCredentials(options, profileName); - } - if (isSsoProfile(data)) { - return await resolveSsoCredentials(profileName, data, options); - } - if (isLoginProfile(data)) { - return resolveLoginCredentials(profileName, options); - } - throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger }); - }; - var fromIni = (_init = {}) => async ({ callerClientConfig } = {}) => { - const init = { - ..._init, - parentClientConfig: { - ...callerClientConfig, - ..._init.parentClientConfig - } - }; - init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni"); - const profiles = await sharedIniFileLoader.parseKnownFiles(init); - return resolveProfileData(sharedIniFileLoader.getProfileName({ - profile: _init.profile ?? callerClientConfig?.profile - }), profiles, init); - }; - exports.fromIni = fromIni; -}); - -// ../node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js -var require_dist_cjs109 = __commonJS((exports) => { - var credentialProviderEnv = require_dist_cjs94(); - var propertyProvider = require_dist_cjs76(); - var sharedIniFileLoader = require_dist_cjs88(); - var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; - var remoteProvider = async (init) => { - const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs95(), 1)); - if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) { - init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata"); - const { fromHttp } = await Promise.resolve().then(() => __toESM(require_dist_cjs96(), 1)); - return propertyProvider.chain(fromHttp(init), fromContainerMetadata(init)); - } - if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") { - return async () => { - throw new propertyProvider.CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger }); - }; - } - init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"); - return fromInstanceMetadata(init); - }; - function memoizeChain(providers, treatAsExpired) { - const chain2 = internalCreateChain(providers); - let activeLock; - let passiveLock; - let credentials; - const provider = async (options) => { - if (options?.forceRefresh) { - return await chain2(options); - } - if (credentials?.expiration) { - if (credentials?.expiration?.getTime() < Date.now()) { - credentials = undefined; - } - } - if (activeLock) { - await activeLock; - } else if (!credentials || treatAsExpired?.(credentials)) { - if (credentials) { - if (!passiveLock) { - passiveLock = chain2(options).then((c5) => { - credentials = c5; - passiveLock = undefined; - }); - } - } else { - activeLock = chain2(options).then((c5) => { - credentials = c5; - activeLock = undefined; - }); - return provider(options); - } - } - return credentials; - }; - return provider; - } - var internalCreateChain = (providers) => async (awsIdentityProperties) => { - let lastProviderError; - for (const provider of providers) { - try { - return await provider(awsIdentityProperties); - } catch (err) { - lastProviderError = err; - if (err?.tryNextLink) { - continue; - } - throw err; - } - } - throw lastProviderError; - }; - var multipleCredentialSourceWarningEmitted = false; - var defaultProvider = (init = {}) => memoizeChain([ - async () => { - const profile = init.profile ?? process.env[sharedIniFileLoader.ENV_PROFILE]; - if (profile) { - const envStaticCredentialsAreSet = process.env[credentialProviderEnv.ENV_KEY] && process.env[credentialProviderEnv.ENV_SECRET]; - if (envStaticCredentialsAreSet) { - if (!multipleCredentialSourceWarningEmitted) { - const warnFn = init.logger?.warn && init.logger?.constructor?.name !== "NoOpLogger" ? init.logger.warn.bind(init.logger) : console.warn; - warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING: - Multiple credential sources detected: - Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set. - This SDK will proceed with the AWS_PROFILE value. - - However, a future version may change this behavior to prefer the ENV static credentials. - Please ensure that your environment only sets either the AWS_PROFILE or the - AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair. -`); - multipleCredentialSourceWarningEmitted = true; - } - } - throw new propertyProvider.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", { - logger: init.logger, - tryNextLink: true - }); - } - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"); - return credentialProviderEnv.fromEnv(init)(); - }, - async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO"); - const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; - if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { - throw new propertyProvider.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger }); - } - const { fromSSO } = await Promise.resolve().then(() => __toESM(require_dist_cjs104(), 1)); - return fromSSO(init)(awsIdentityProperties); - }, - async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni"); - const { fromIni } = await Promise.resolve().then(() => __toESM(require_dist_cjs108(), 1)); - return fromIni(init)(awsIdentityProperties); - }, - async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess"); - const { fromProcess } = await Promise.resolve().then(() => __toESM(require_dist_cjs106(), 1)); - return fromProcess(init)(awsIdentityProperties); - }, - async (awsIdentityProperties) => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile"); - const { fromTokenFile } = await Promise.resolve().then(() => __toESM(require_dist_cjs107(), 1)); - return fromTokenFile(init)(awsIdentityProperties); - }, - async () => { - init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"); - return (await remoteProvider(init))(); - }, - async () => { - throw new propertyProvider.CredentialsProviderError("Could not load credentials from any providers", { - tryNextLink: false, - logger: init.logger - }); - } - ], credentialsTreatedAsExpired); - var credentialsWillNeedRefresh = (credentials) => credentials?.expiration !== undefined; - var credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000; - exports.credentialsTreatedAsExpired = credentialsTreatedAsExpired; - exports.credentialsWillNeedRefresh = credentialsWillNeedRefresh; - exports.defaultProvider = defaultProvider; -}); - -// ../node_modules/@aws-sdk/client-bedrock/dist-cjs/endpoint/ruleset.js -var require_ruleset9 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ruleSet = undefined; - var s = "required"; - var t = "fn"; - var u2 = "argv"; - var v = "ref"; - var a2 = true; - var b = "isSet"; - var c5 = "booleanEquals"; - var d = "error"; - var e = "endpoint"; - var f = "tree"; - var g = "PartitionResult"; - var h2 = { [s]: false, type: "string" }; - var i2 = { [s]: true, default: false, type: "boolean" }; - var j = { [v]: "Endpoint" }; - var k = { [t]: c5, [u2]: [{ [v]: "UseFIPS" }, true] }; - var l = { [t]: c5, [u2]: [{ [v]: "UseDualStack" }, true] }; - var m = {}; - var n2 = { [t]: "getAttr", [u2]: [{ [v]: g }, "supportsFIPS"] }; - var o2 = { [t]: c5, [u2]: [true, { [t]: "getAttr", [u2]: [{ [v]: g }, "supportsDualStack"] }] }; - var p = [k]; - var q = [l]; - var r = [{ [v]: "Region" }]; - var _data = { version: "1.0", parameters: { Region: h2, UseDualStack: i2, UseFIPS: i2, Endpoint: h2 }, rules: [{ conditions: [{ [t]: b, [u2]: [j] }], rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { rules: [{ conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: j, properties: m, headers: m }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [t]: b, [u2]: r }], rules: [{ conditions: [{ [t]: "aws.partition", [u2]: r, assign: g }], rules: [{ conditions: [k, l], rules: [{ conditions: [{ [t]: c5, [u2]: [a2, n2] }, o2], rules: [{ rules: [{ endpoint: { url: "https://bedrock-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: p, rules: [{ conditions: [{ [t]: c5, [u2]: [n2, a2] }], rules: [{ rules: [{ endpoint: { url: "https://bedrock-fips.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: q, rules: [{ conditions: [o2], rules: [{ rules: [{ endpoint: { url: "https://bedrock.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { rules: [{ endpoint: { url: "https://bedrock.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }], type: f }] }; - exports.ruleSet = _data; -}); - -// ../node_modules/@aws-sdk/client-bedrock/dist-cjs/endpoint/endpointResolver.js -var require_endpointResolver9 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultEndpointResolver = undefined; - var util_endpoints_1 = require_dist_cjs75(); - var util_endpoints_2 = require_dist_cjs72(); - var ruleset_1 = require_ruleset9(); - var cache2 = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] - }); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return cache2.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - })); - }; - exports.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -}); - -// ../node_modules/@aws-sdk/client-bedrock/dist-cjs/runtimeConfig.shared.js -var require_runtimeConfig_shared9 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var core_1 = require_dist_cjs83(); - var protocols_1 = require_protocols4(); - var core_2 = require_dist_cjs71(); - var smithy_client_1 = require_dist_cjs81(); - var url_parser_1 = require_dist_cjs74(); - var util_base64_1 = require_dist_cjs65(); - var util_utf8_1 = require_dist_cjs64(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider5(); - var endpointResolver_1 = require_endpointResolver9(); - var getRuntimeConfig = (config2) => { - return { - apiVersion: "2023-04-20", - base64Decoder: config2?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config2?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config2?.disableHostPrefix ?? false, - endpointProvider: config2?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config2?.extensions ?? [], - httpAuthSchemeProvider: config2?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultBedrockHttpAuthSchemeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#httpBearerAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth"), - signer: new core_2.HttpBearerAuthSigner - } - ], - logger: config2?.logger ?? new smithy_client_1.NoOpLogger, - protocol: config2?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.bedrock" }), - serviceId: config2?.serviceId ?? "Bedrock", - urlParser: config2?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config2?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config2?.utf8Encoder ?? util_utf8_1.toUtf8 - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-bedrock/dist-cjs/runtimeConfig.js -var require_runtimeConfig9 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var tslib_1 = require_tslib2(); - var package_json_1 = tslib_1.__importDefault(require_package2()); - var core_1 = require_dist_cjs83(); - var credential_provider_node_1 = require_dist_cjs109(); - var token_providers_1 = require_dist_cjs102(); - var util_user_agent_node_1 = require_dist_cjs97(); - var config_resolver_1 = require_dist_cjs86(); - var core_2 = require_dist_cjs71(); - var hash_node_1 = require_dist_cjs98(); - var middleware_retry_1 = require_dist_cjs93(); - var node_config_provider_1 = require_dist_cjs89(); - var node_http_handler_1 = require_dist_cjs68(); - var util_body_length_node_1 = require_dist_cjs99(); - var util_retry_1 = require_dist_cjs92(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared9(); - var smithy_client_1 = require_dist_cjs81(); - var util_defaults_mode_node_1 = require_dist_cjs100(); - var smithy_client_2 = require_dist_cjs81(); - var getRuntimeConfig = (config2) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config2); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config2?.profile, - logger: clientSharedValues.logger, - signingName: "bedrock" - }; - return { - ...clientSharedValues, - ...config2, - runtime: "node", - defaultsMode, - authSchemePreference: config2?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config2?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - credentialDefaultProvider: config2?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, - defaultUserAgentProvider: config2?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#httpBearerAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth") || (async (idProps) => { - try { - return await (0, token_providers_1.fromEnvSigningName)({ signingName: "bedrock" })(); - } catch (error41) { - return await (0, token_providers_1.nodeProvider)(idProps)(idProps); - } - }), - signer: new core_2.HttpBearerAuthSigner - } - ], - maxAttempts: config2?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config2), - region: config2?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config2?.requestHandler ?? defaultConfigProvider), - retryMode: config2?.retryMode ?? (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }, config2), - sha256: config2?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config2?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config2?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config2?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config2?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-bedrock/dist-cjs/index.js -var require_dist_cjs110 = __commonJS((exports) => { - var middlewareHostHeader = require_dist_cjs57(); - var middlewareLogger = require_dist_cjs58(); - var middlewareRecursionDetection = require_dist_cjs59(); - var middlewareUserAgent = require_dist_cjs84(); - var configResolver = require_dist_cjs86(); - var core2 = require_dist_cjs71(); - var schema = require_schema2(); - var middlewareContentLength = require_dist_cjs87(); - var middlewareEndpoint = require_dist_cjs90(); - var middlewareRetry = require_dist_cjs93(); - var smithyClient = require_dist_cjs81(); - var httpAuthSchemeProvider = require_httpAuthSchemeProvider5(); - var runtimeConfig = require_runtimeConfig9(); - var regionConfigResolver = require_dist_cjs101(); - var protocolHttp = require_dist_cjs56(); - var resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "bedrock" - }); - }; - var commonParams = { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - var getHttpAuthExtensionConfiguration = (runtimeConfig2) => { - const _httpAuthSchemes = runtimeConfig2.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig2.httpAuthSchemeProvider; - let _credentials = runtimeConfig2.credentials; - let _token = runtimeConfig2.token; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); - } - }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider2) { - _httpAuthSchemeProvider = httpAuthSchemeProvider2; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; - }, - setToken(token) { - _token = token; - }, - token() { - return _token; - } - }; - }; - var resolveHttpAuthRuntimeConfig = (config2) => { - return { - httpAuthSchemes: config2.httpAuthSchemes(), - httpAuthSchemeProvider: config2.httpAuthSchemeProvider(), - credentials: config2.credentials(), - token: config2.token() - }; - }; - var resolveRuntimeExtensions = (runtimeConfig2, extensions) => { - const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig2), smithyClient.getDefaultExtensionConfiguration(runtimeConfig2), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig2), getHttpAuthExtensionConfiguration(runtimeConfig2)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig2, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); - }; - - class BedrockClient extends smithyClient.Client { - config; - constructor(...[configuration]) { - const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); - const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); - const _config_4 = configResolver.resolveRegionConfig(_config_3); - const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); - const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); - const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); - const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); - this.config = _config_8; - this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); - this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); - this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); - this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); - this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); - this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); - this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); - this.middlewareStack.use(core2.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultBedrockHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config2) => new core2.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config2.credentials, - "smithy.api#httpBearerAuth": config2.token - }) - })); - this.middlewareStack.use(core2.getHttpSigningPlugin(this.config)); - } - destroy() { - super.destroy(); - } - } - var BedrockServiceException$1 = class BedrockServiceException2 extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, BedrockServiceException2.prototype); - } - }; - var AccessDeniedException$1 = class AccessDeniedException2 extends BedrockServiceException$1 { - name = "AccessDeniedException"; - $fault = "client"; - constructor(opts) { - super({ - name: "AccessDeniedException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, AccessDeniedException2.prototype); - } - }; - var InternalServerException$1 = class InternalServerException2 extends BedrockServiceException$1 { - name = "InternalServerException"; - $fault = "server"; - constructor(opts) { - super({ - name: "InternalServerException", - $fault: "server", - ...opts - }); - Object.setPrototypeOf(this, InternalServerException2.prototype); - } - }; - var ResourceNotFoundException$1 = class ResourceNotFoundException2 extends BedrockServiceException$1 { - name = "ResourceNotFoundException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ResourceNotFoundException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ResourceNotFoundException2.prototype); - } - }; - var ThrottlingException$1 = class ThrottlingException2 extends BedrockServiceException$1 { - name = "ThrottlingException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ThrottlingException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ThrottlingException2.prototype); - } - }; - var ValidationException$1 = class ValidationException2 extends BedrockServiceException$1 { - name = "ValidationException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ValidationException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ValidationException2.prototype); - } - }; - var ConflictException$1 = class ConflictException2 extends BedrockServiceException$1 { - name = "ConflictException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ConflictException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ConflictException2.prototype); - } - }; - var ServiceQuotaExceededException$1 = class ServiceQuotaExceededException2 extends BedrockServiceException$1 { - name = "ServiceQuotaExceededException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ServiceQuotaExceededException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ServiceQuotaExceededException2.prototype); - } - }; - var TooManyTagsException$1 = class TooManyTagsException2 extends BedrockServiceException$1 { - name = "TooManyTagsException"; - $fault = "client"; - resourceName; - constructor(opts) { - super({ - name: "TooManyTagsException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, TooManyTagsException2.prototype); - this.resourceName = opts.resourceName; - } - }; - var ResourceInUseException$1 = class ResourceInUseException2 extends BedrockServiceException$1 { - name = "ResourceInUseException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ResourceInUseException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ResourceInUseException2.prototype); - } - }; - var ServiceUnavailableException$1 = class ServiceUnavailableException2 extends BedrockServiceException$1 { - name = "ServiceUnavailableException"; - $fault = "server"; - constructor(opts) { - super({ - name: "ServiceUnavailableException", - $fault: "server", - ...opts - }); - Object.setPrototypeOf(this, ServiceUnavailableException2.prototype); - } - }; - var _AA = "AgreementAvailability"; - var _ADE = "AccessDeniedException"; - var _AEC = "AutomatedEvaluationConfig"; - var _AECM = "AutomatedEvaluationCustomMetrics"; - var _AECMC = "AutomatedEvaluationCustomMetricConfig"; - var _AECMS = "AutomatedEvaluationCustomMetricSource"; - var _ARCDSL = "AutomatedReasoningCheckDifferenceScenarioList"; - var _ARCF = "AutomatedReasoningCheckFinding"; - var _ARCFL = "AutomatedReasoningCheckFindingList"; - var _ARCIF = "AutomatedReasoningCheckImpossibleFinding"; - var _ARCIFu = "AutomatedReasoningCheckInvalidFinding"; - var _ARCITR = "AutomatedReasoningCheckInputTextReference"; - var _ARCITRL = "AutomatedReasoningCheckInputTextReferenceList"; - var _ARCLW = "AutomatedReasoningCheckLogicWarning"; - var _ARCNTF = "AutomatedReasoningCheckNoTranslationsFinding"; - var _ARCR = "AutomatedReasoningCheckRule"; - var _ARCRL = "AutomatedReasoningCheckRuleList"; - var _ARCS = "AutomatedReasoningCheckScenario"; - var _ARCSF = "AutomatedReasoningCheckSatisfiableFinding"; - var _ARCT = "AutomatedReasoningCheckTranslation"; - var _ARCTAF = "AutomatedReasoningCheckTranslationAmbiguousFinding"; - var _ARCTCF = "AutomatedReasoningCheckTooComplexFinding"; - var _ARCTL = "AutomatedReasoningCheckTranslationList"; - var _ARCTO = "AutomatedReasoningCheckTranslationOption"; - var _ARCTOL = "AutomatedReasoningCheckTranslationOptionList"; - var _ARCVF = "AutomatedReasoningCheckValidFinding"; - var _ARLS = "AutomatedReasoningLogicStatement"; - var _ARLSC = "AutomatedReasoningLogicStatementContent"; - var _ARLSL = "AutomatedReasoningLogicStatementList"; - var _ARNLSC = "AutomatedReasoningNaturalLanguageStatementContent"; - var _ARPA = "AutomatedReasoningPolicyAnnotation"; - var _ARPAFNL = "AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage"; - var _ARPAIC = "AutomatedReasoningPolicyAnnotationIngestContent"; - var _ARPAL = "AutomatedReasoningPolicyAnnotationList"; - var _ARPARA = "AutomatedReasoningPolicyAddRuleAnnotation"; - var _ARPARFNLA = "AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation"; - var _ARPARM = "AutomatedReasoningPolicyAddRuleMutation"; - var _ARPARNL = "AutomatedReasoningPolicyAnnotationRuleNaturalLanguage"; - var _ARPATA = "AutomatedReasoningPolicyAddTypeAnnotation"; - var _ARPATM = "AutomatedReasoningPolicyAddTypeMutation"; - var _ARPATV = "AutomatedReasoningPolicyAddTypeValue"; - var _ARPAVA = "AutomatedReasoningPolicyAddVariableAnnotation"; - var _ARPAVM = "AutomatedReasoningPolicyAddVariableMutation"; - var _ARPBDB = "AutomatedReasoningPolicyBuildDocumentBlob"; - var _ARPBDD = "AutomatedReasoningPolicyBuildDocumentDescription"; - var _ARPBDN = "AutomatedReasoningPolicyBuildDocumentName"; - var _ARPBL = "AutomatedReasoningPolicyBuildLog"; - var _ARPBLE = "AutomatedReasoningPolicyBuildLogEntry"; - var _ARPBLEL = "AutomatedReasoningPolicyBuildLogEntryList"; - var _ARPBRA = "AutomatedReasoningPolicyBuildResultAssets"; - var _ARPBS = "AutomatedReasoningPolicyBuildStep"; - var _ARPBSC = "AutomatedReasoningPolicyBuildStepContext"; - var _ARPBSL = "AutomatedReasoningPolicyBuildStepList"; - var _ARPBSM = "AutomatedReasoningPolicyBuildStepMessage"; - var _ARPBSML = "AutomatedReasoningPolicyBuildStepMessageList"; - var _ARPBWD = "AutomatedReasoningPolicyBuildWorkflowDocument"; - var _ARPBWDL = "AutomatedReasoningPolicyBuildWorkflowDocumentList"; - var _ARPBWRC = "AutomatedReasoningPolicyBuildWorkflowRepairContent"; - var _ARPBWS = "AutomatedReasoningPolicyBuildWorkflowSource"; - var _ARPBWSu = "AutomatedReasoningPolicyBuildWorkflowSummary"; - var _ARPBWSut = "AutomatedReasoningPolicyBuildWorkflowSummaries"; - var _ARPD = "AutomatedReasoningPolicyDescription"; - var _ARPDE = "AutomatedReasoningPolicyDefinitionElement"; - var _ARPDQR = "AutomatedReasoningPolicyDefinitionQualityReport"; - var _ARPDR = "AutomatedReasoningPolicyDefinitionRule"; - var _ARPDRA = "AutomatedReasoningPolicyDeleteRuleAnnotation"; - var _ARPDRAE = "AutomatedReasoningPolicyDefinitionRuleAlternateExpression"; - var _ARPDRE = "AutomatedReasoningPolicyDefinitionRuleExpression"; - var _ARPDRL = "AutomatedReasoningPolicyDefinitionRuleList"; - var _ARPDRM = "AutomatedReasoningPolicyDeleteRuleMutation"; - var _ARPDRS = "AutomatedReasoningPolicyDisjointRuleSet"; - var _ARPDRSL = "AutomatedReasoningPolicyDisjointRuleSetList"; - var _ARPDT = "AutomatedReasoningPolicyDefinitionType"; - var _ARPDTA = "AutomatedReasoningPolicyDeleteTypeAnnotation"; - var _ARPDTD = "AutomatedReasoningPolicyDefinitionTypeDescription"; - var _ARPDTL = "AutomatedReasoningPolicyDefinitionTypeList"; - var _ARPDTM = "AutomatedReasoningPolicyDeleteTypeMutation"; - var _ARPDTN = "AutomatedReasoningPolicyDefinitionTypeName"; - var _ARPDTNL = "AutomatedReasoningPolicyDefinitionTypeNameList"; - var _ARPDTV = "AutomatedReasoningPolicyDefinitionTypeValue"; - var _ARPDTVD = "AutomatedReasoningPolicyDefinitionTypeValueDescription"; - var _ARPDTVL = "AutomatedReasoningPolicyDefinitionTypeValueList"; - var _ARPDTVP = "AutomatedReasoningPolicyDefinitionTypeValuePair"; - var _ARPDTVPL = "AutomatedReasoningPolicyDefinitionTypeValuePairList"; - var _ARPDTVu = "AutomatedReasoningPolicyDeleteTypeValue"; - var _ARPDV = "AutomatedReasoningPolicyDefinitionVariable"; - var _ARPDVA = "AutomatedReasoningPolicyDeleteVariableAnnotation"; - var _ARPDVD = "AutomatedReasoningPolicyDefinitionVariableDescription"; - var _ARPDVL = "AutomatedReasoningPolicyDefinitionVariableList"; - var _ARPDVM = "AutomatedReasoningPolicyDeleteVariableMutation"; - var _ARPDVN = "AutomatedReasoningPolicyDefinitionVariableName"; - var _ARPDVNL = "AutomatedReasoningPolicyDefinitionVariableNameList"; - var _ARPDu = "AutomatedReasoningPolicyDefinition"; - var _ARPGTC = "AutomatedReasoningPolicyGeneratedTestCase"; - var _ARPGTCL = "AutomatedReasoningPolicyGeneratedTestCaseList"; - var _ARPGTCu = "AutomatedReasoningPolicyGeneratedTestCases"; - var _ARPICA = "AutomatedReasoningPolicyIngestContentAnnotation"; - var _ARPM = "AutomatedReasoningPolicyMutation"; - var _ARPN = "AutomatedReasoningPolicyName"; - var _ARPP = "AutomatedReasoningPolicyPlanning"; - var _ARPS = "AutomatedReasoningPolicyScenario"; - var _ARPSAE = "AutomatedReasoningPolicyScenarioAlternateExpression"; - var _ARPSE = "AutomatedReasoningPolicyScenarioExpression"; - var _ARPSu = "AutomatedReasoningPolicySummary"; - var _ARPSut = "AutomatedReasoningPolicySummaries"; - var _ARPTC = "AutomatedReasoningPolicyTestCase"; - var _ARPTCL = "AutomatedReasoningPolicyTestCaseList"; - var _ARPTGC = "AutomatedReasoningPolicyTestGuardContent"; - var _ARPTL = "AutomatedReasoningPolicyTestList"; - var _ARPTQC = "AutomatedReasoningPolicyTestQueryContent"; - var _ARPTR = "AutomatedReasoningPolicyTestResult"; - var _ARPTVA = "AutomatedReasoningPolicyTypeValueAnnotation"; - var _ARPTVAL = "AutomatedReasoningPolicyTypeValueAnnotationList"; - var _ARPUFRFA = "AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation"; - var _ARPUFSFA = "AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation"; - var _ARPURA = "AutomatedReasoningPolicyUpdateRuleAnnotation"; - var _ARPURM = "AutomatedReasoningPolicyUpdateRuleMutation"; - var _ARPUTA = "AutomatedReasoningPolicyUpdateTypeAnnotation"; - var _ARPUTM = "AutomatedReasoningPolicyUpdateTypeMutation"; - var _ARPUTV = "AutomatedReasoningPolicyUpdateTypeValue"; - var _ARPUVA = "AutomatedReasoningPolicyUpdateVariableAnnotation"; - var _ARPUVM = "AutomatedReasoningPolicyUpdateVariableMutation"; - var _ARPWTC = "AutomatedReasoningPolicyWorkflowTypeContent"; - var _BCB = "ByteContentBlob"; - var _BCD = "ByteContentDoc"; - var _BDEJ = "BatchDeleteEvaluationJob"; - var _BDEJE = "BatchDeleteEvaluationJobError"; - var _BDEJEa = "BatchDeleteEvaluationJobErrors"; - var _BDEJI = "BatchDeleteEvaluationJobItem"; - var _BDEJIa = "BatchDeleteEvaluationJobItems"; - var _BDEJR = "BatchDeleteEvaluationJobRequest"; - var _BDEJRa = "BatchDeleteEvaluationJobResponse"; - var _BEM = "BedrockEvaluatorModel"; - var _BEMe = "BedrockEvaluatorModels"; - var _CARP = "CreateAutomatedReasoningPolicy"; - var _CARPBW = "CancelAutomatedReasoningPolicyBuildWorkflow"; - var _CARPBWR = "CancelAutomatedReasoningPolicyBuildWorkflowRequest"; - var _CARPBWRa = "CancelAutomatedReasoningPolicyBuildWorkflowResponse"; - var _CARPR = "CreateAutomatedReasoningPolicyRequest"; - var _CARPRr = "CreateAutomatedReasoningPolicyResponse"; - var _CARPTC = "CreateAutomatedReasoningPolicyTestCase"; - var _CARPTCR = "CreateAutomatedReasoningPolicyTestCaseRequest"; - var _CARPTCRr = "CreateAutomatedReasoningPolicyTestCaseResponse"; - var _CARPV = "CreateAutomatedReasoningPolicyVersion"; - var _CARPVR = "CreateAutomatedReasoningPolicyVersionRequest"; - var _CARPVRr = "CreateAutomatedReasoningPolicyVersionResponse"; - var _CC = "CustomizationConfig"; - var _CCM = "CreateCustomModel"; - var _CCMD = "CreateCustomModelDeployment"; - var _CCMDR = "CreateCustomModelDeploymentRequest"; - var _CCMDRr = "CreateCustomModelDeploymentResponse"; - var _CCMR = "CreateCustomModelRequest"; - var _CCMRr = "CreateCustomModelResponse"; - var _CE = "ConflictException"; - var _CEJ = "CreateEvaluationJob"; - var _CEJR = "CreateEvaluationJobRequest"; - var _CEJRr = "CreateEvaluationJobResponse"; - var _CFMA = "CreateFoundationModelAgreement"; - var _CFMAR = "CreateFoundationModelAgreementRequest"; - var _CFMARr = "CreateFoundationModelAgreementResponse"; - var _CG = "CreateGuardrail"; - var _CGR = "CreateGuardrailRequest"; - var _CGRr = "CreateGuardrailResponse"; - var _CGV = "CreateGuardrailVersion"; - var _CGVR = "CreateGuardrailVersionRequest"; - var _CGVRr = "CreateGuardrailVersionResponse"; - var _CIP = "CreateInferenceProfile"; - var _CIPR = "CreateInferenceProfileRequest"; - var _CIPRr = "CreateInferenceProfileResponse"; - var _CMBEM = "CustomMetricBedrockEvaluatorModel"; - var _CMBEMu = "CustomMetricBedrockEvaluatorModels"; - var _CMCJ = "CreateModelCopyJob"; - var _CMCJR = "CreateModelCopyJobRequest"; - var _CMCJRr = "CreateModelCopyJobResponse"; - var _CMCJRre = "CreateModelCustomizationJobRequest"; - var _CMCJRrea = "CreateModelCustomizationJobResponse"; - var _CMCJr = "CreateModelCustomizationJob"; - var _CMD = "CustomMetricDefinition"; - var _CMDS = "CustomModelDeploymentSummary"; - var _CMDSL = "CustomModelDeploymentSummaryList"; - var _CMEMC = "CustomMetricEvaluatorModelConfig"; - var _CMIJ = "CreateModelImportJob"; - var _CMIJR = "CreateModelImportJobRequest"; - var _CMIJRr = "CreateModelImportJobResponse"; - var _CMIJRre = "CreateModelInvocationJobRequest"; - var _CMIJRrea = "CreateModelInvocationJobResponse"; - var _CMIJr = "CreateModelInvocationJob"; - var _CMME = "CreateMarketplaceModelEndpoint"; - var _CMMER = "CreateMarketplaceModelEndpointRequest"; - var _CMMERr = "CreateMarketplaceModelEndpointResponse"; - var _CMS = "CustomModelSummary"; - var _CMSL = "CustomModelSummaryList"; - var _CMU = "CustomModelUnits"; - var _CPMT = "CreateProvisionedModelThroughput"; - var _CPMTR = "CreateProvisionedModelThroughputRequest"; - var _CPMTRr = "CreateProvisionedModelThroughputResponse"; - var _CPR = "CreatePromptRouter"; - var _CPRR = "CreatePromptRouterRequest"; - var _CPRRr = "CreatePromptRouterResponse"; - var _CWC = "CloudWatchConfig"; - var _DARP = "DeleteAutomatedReasoningPolicy"; - var _DARPBW = "DeleteAutomatedReasoningPolicyBuildWorkflow"; - var _DARPBWR = "DeleteAutomatedReasoningPolicyBuildWorkflowRequest"; - var _DARPBWRe = "DeleteAutomatedReasoningPolicyBuildWorkflowResponse"; - var _DARPR = "DeleteAutomatedReasoningPolicyRequest"; - var _DARPRe = "DeleteAutomatedReasoningPolicyResponse"; - var _DARPTC = "DeleteAutomatedReasoningPolicyTestCase"; - var _DARPTCR = "DeleteAutomatedReasoningPolicyTestCaseRequest"; - var _DARPTCRe = "DeleteAutomatedReasoningPolicyTestCaseResponse"; - var _DC = "DistillationConfig"; - var _DCM = "DeleteCustomModel"; - var _DCMD = "DeleteCustomModelDeployment"; - var _DCMDR = "DeleteCustomModelDeploymentRequest"; - var _DCMDRe = "DeleteCustomModelDeploymentResponse"; - var _DCMR = "DeleteCustomModelRequest"; - var _DCMRe = "DeleteCustomModelResponse"; - var _DFMA = "DeleteFoundationModelAgreement"; - var _DFMAR = "DeleteFoundationModelAgreementRequest"; - var _DFMARe = "DeleteFoundationModelAgreementResponse"; - var _DG = "DeleteGuardrail"; - var _DGR = "DeleteGuardrailRequest"; - var _DGRe = "DeleteGuardrailResponse"; - var _DIM = "DeleteImportedModel"; - var _DIMR = "DeleteImportedModelRequest"; - var _DIMRe = "DeleteImportedModelResponse"; - var _DIP = "DeleteInferenceProfile"; - var _DIPR = "DeleteInferenceProfileRequest"; - var _DIPRe = "DeleteInferenceProfileResponse"; - var _DMILC = "DeleteModelInvocationLoggingConfiguration"; - var _DMILCR = "DeleteModelInvocationLoggingConfigurationRequest"; - var _DMILCRe = "DeleteModelInvocationLoggingConfigurationResponse"; - var _DMME = "DeleteMarketplaceModelEndpoint"; - var _DMMER = "DeleteMarketplaceModelEndpointRequest"; - var _DMMERe = "DeleteMarketplaceModelEndpointResponse"; - var _DMMERer = "DeregisterMarketplaceModelEndpointRequest"; - var _DMMERere = "DeregisterMarketplaceModelEndpointResponse"; - var _DMMEe = "DeregisterMarketplaceModelEndpoint"; - var _DPD = "DataProcessingDetails"; - var _DPMT = "DeleteProvisionedModelThroughput"; - var _DPMTR = "DeleteProvisionedModelThroughputRequest"; - var _DPMTRe = "DeleteProvisionedModelThroughputResponse"; - var _DPR = "DimensionalPriceRate"; - var _DPRR = "DeletePromptRouterRequest"; - var _DPRRe = "DeletePromptRouterResponse"; - var _DPRe = "DeletePromptRouter"; - var _EARPV = "ExportAutomatedReasoningPolicyVersion"; - var _EARPVR = "ExportAutomatedReasoningPolicyVersionRequest"; - var _EARPVRx = "ExportAutomatedReasoningPolicyVersionResponse"; - var _EBM = "EvaluationBedrockModel"; - var _EC = "EndpointConfig"; - var _ECv = "EvaluationConfig"; - var _ED = "EvaluationDataset"; - var _EDL = "EvaluationDatasetLocation"; - var _EDMC = "EvaluationDatasetMetricConfig"; - var _EDMCv = "EvaluationDatasetMetricConfigs"; - var _EDN = "EvaluationDatasetName"; - var _EIC = "EvaluationInferenceConfig"; - var _EICS = "EvaluationInferenceConfigSummary"; - var _EJD = "EvaluationJobDescription"; - var _EJI = "EvaluationJobIdentifier"; - var _EJIv = "EvaluationJobIdentifiers"; - var _EMC = "EvaluationModelConfigs"; - var _EMCS = "EvaluationModelConfigSummary"; - var _EMCv = "EvaluationModelConfig"; - var _EMCva = "EvaluatorModelConfig"; - var _EMD = "EvaluationMetricDescription"; - var _EMIP = "EvaluationModelInferenceParams"; - var _EMN = "EvaluationMetricName"; - var _EMNv = "EvaluationMetricNames"; - var _EODC = "EvaluationOutputDataConfig"; - var _EPIS = "EvaluationPrecomputedInferenceSource"; - var _EPRAGSC = "EvaluationPrecomputedRetrieveAndGenerateSourceConfig"; - var _EPRSC = "EvaluationPrecomputedRetrieveSourceConfig"; - var _EPRSCv = "EvaluationPrecomputedRagSourceConfig"; - var _ERCS = "EvaluationRagConfigSummary"; - var _ES = "EvaluationSummary"; - var _ESGC = "ExternalSourcesGenerationConfiguration"; - var _ESRAGC = "ExternalSourcesRetrieveAndGenerateConfiguration"; - var _ESv = "EvaluationSummaries"; - var _ESx = "ExternalSource"; - var _ESxt = "ExternalSources"; - var _FA = "FilterAttribute"; - var _FFR = "FieldForReranking"; - var _FFRi = "FieldsForReranking"; - var _FMD = "FoundationModelDetails"; - var _FML = "FoundationModelLifecycle"; - var _FMS = "FoundationModelSummary"; - var _FMSL = "FoundationModelSummaryList"; - var _GARP = "GuardrailAutomatedReasoningPolicy"; - var _GARPA = "GetAutomatedReasoningPolicyAnnotations"; - var _GARPAR = "GetAutomatedReasoningPolicyAnnotationsRequest"; - var _GARPARe = "GetAutomatedReasoningPolicyAnnotationsResponse"; - var _GARPBW = "GetAutomatedReasoningPolicyBuildWorkflow"; - var _GARPBWR = "GetAutomatedReasoningPolicyBuildWorkflowRequest"; - var _GARPBWRA = "GetAutomatedReasoningPolicyBuildWorkflowResultAssets"; - var _GARPBWRAR = "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest"; - var _GARPBWRARe = "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsResponse"; - var _GARPBWRe = "GetAutomatedReasoningPolicyBuildWorkflowResponse"; - var _GARPC = "GuardrailAutomatedReasoningPolicyConfig"; - var _GARPNS = "GetAutomatedReasoningPolicyNextScenario"; - var _GARPNSR = "GetAutomatedReasoningPolicyNextScenarioRequest"; - var _GARPNSRe = "GetAutomatedReasoningPolicyNextScenarioResponse"; - var _GARPR = "GetAutomatedReasoningPolicyRequest"; - var _GARPRe = "GetAutomatedReasoningPolicyResponse"; - var _GARPTC = "GetAutomatedReasoningPolicyTestCase"; - var _GARPTCR = "GetAutomatedReasoningPolicyTestCaseRequest"; - var _GARPTCRe = "GetAutomatedReasoningPolicyTestCaseResponse"; - var _GARPTR = "GetAutomatedReasoningPolicyTestResult"; - var _GARPTRR = "GetAutomatedReasoningPolicyTestResultRequest"; - var _GARPTRRe = "GetAutomatedReasoningPolicyTestResultResponse"; - var _GARPe = "GetAutomatedReasoningPolicy"; - var _GBM = "GuardrailBlockedMessaging"; - var _GC = "GenerationConfiguration"; - var _GCF = "GuardrailContentFilter"; - var _GCFA = "GuardrailContentFilterAction"; - var _GCFC = "GuardrailContentFilterConfig"; - var _GCFCu = "GuardrailContentFiltersConfig"; - var _GCFT = "GuardrailContentFiltersTier"; - var _GCFTC = "GuardrailContentFiltersTierConfig"; - var _GCFTN = "GuardrailContentFiltersTierName"; - var _GCFu = "GuardrailContentFilters"; - var _GCGA = "GuardrailContextualGroundingAction"; - var _GCGF = "GuardrailContextualGroundingFilter"; - var _GCGFC = "GuardrailContextualGroundingFilterConfig"; - var _GCGFCu = "GuardrailContextualGroundingFiltersConfig"; - var _GCGFu = "GuardrailContextualGroundingFilters"; - var _GCGP = "GuardrailContextualGroundingPolicy"; - var _GCGPC = "GuardrailContextualGroundingPolicyConfig"; - var _GCM = "GetCustomModel"; - var _GCMD = "GetCustomModelDeployment"; - var _GCMDR = "GetCustomModelDeploymentRequest"; - var _GCMDRe = "GetCustomModelDeploymentResponse"; - var _GCMR = "GetCustomModelRequest"; - var _GCMRe = "GetCustomModelResponse"; - var _GCP = "GuardrailContentPolicy"; - var _GCPC = "GuardrailContentPolicyConfig"; - var _GCRC = "GuardrailCrossRegionConfig"; - var _GCRD = "GuardrailCrossRegionDetails"; - var _GCu = "GuardrailConfiguration"; - var _GD = "GuardrailDescription"; - var _GEJ = "GetEvaluationJob"; - var _GEJR = "GetEvaluationJobRequest"; - var _GEJRe = "GetEvaluationJobResponse"; - var _GFM = "GetFoundationModel"; - var _GFMA = "GetFoundationModelAvailability"; - var _GFMAR = "GetFoundationModelAvailabilityRequest"; - var _GFMARe = "GetFoundationModelAvailabilityResponse"; - var _GFMR = "GetFoundationModelRequest"; - var _GFMRe = "GetFoundationModelResponse"; - var _GFR = "GuardrailFailureRecommendation"; - var _GFRu = "GuardrailFailureRecommendations"; - var _GG = "GetGuardrail"; - var _GGR = "GetGuardrailRequest"; - var _GGRe = "GetGuardrailResponse"; - var _GIM = "GetImportedModel"; - var _GIMR = "GetImportedModelRequest"; - var _GIMRe = "GetImportedModelResponse"; - var _GIP = "GetInferenceProfile"; - var _GIPR = "GetInferenceProfileRequest"; - var _GIPRe = "GetInferenceProfileResponse"; - var _GM = "GuardrailModality"; - var _GMCJ = "GetModelCopyJob"; - var _GMCJR = "GetModelCopyJobRequest"; - var _GMCJRe = "GetModelCopyJobResponse"; - var _GMCJRet = "GetModelCustomizationJobRequest"; - var _GMCJReto = "GetModelCustomizationJobResponse"; - var _GMCJe = "GetModelCustomizationJob"; - var _GMIJ = "GetModelImportJob"; - var _GMIJR = "GetModelImportJobRequest"; - var _GMIJRe = "GetModelImportJobResponse"; - var _GMIJRet = "GetModelInvocationJobRequest"; - var _GMIJReto = "GetModelInvocationJobResponse"; - var _GMIJe = "GetModelInvocationJob"; - var _GMILC = "GetModelInvocationLoggingConfiguration"; - var _GMILCR = "GetModelInvocationLoggingConfigurationRequest"; - var _GMILCRe = "GetModelInvocationLoggingConfigurationResponse"; - var _GMME = "GetMarketplaceModelEndpoint"; - var _GMMER = "GetMarketplaceModelEndpointRequest"; - var _GMMERe = "GetMarketplaceModelEndpointResponse"; - var _GMW = "GuardrailManagedWords"; - var _GMWC = "GuardrailManagedWordsConfig"; - var _GMWL = "GuardrailManagedWordLists"; - var _GMWLC = "GuardrailManagedWordListsConfig"; - var _GMu = "GuardrailModalities"; - var _GN = "GuardrailName"; - var _GPE = "GuardrailPiiEntity"; - var _GPEC = "GuardrailPiiEntityConfig"; - var _GPECu = "GuardrailPiiEntitiesConfig"; - var _GPEu = "GuardrailPiiEntities"; - var _GPMT = "GetProvisionedModelThroughput"; - var _GPMTR = "GetProvisionedModelThroughputRequest"; - var _GPMTRe = "GetProvisionedModelThroughputResponse"; - var _GPR = "GetPromptRouter"; - var _GPRR = "GetPromptRouterRequest"; - var _GPRRe = "GetPromptRouterResponse"; - var _GR = "GuardrailRegex"; - var _GRC = "GuardrailRegexConfig"; - var _GRCu = "GuardrailRegexesConfig"; - var _GRu = "GuardrailRegexes"; - var _GS = "GuardrailSummary"; - var _GSIP = "GuardrailSensitiveInformationPolicy"; - var _GSIPC = "GuardrailSensitiveInformationPolicyConfig"; - var _GSR = "GuardrailStatusReason"; - var _GSRu = "GuardrailStatusReasons"; - var _GSu = "GuardrailSummaries"; - var _GT = "GuardrailTopic"; - var _GTA = "GuardrailTopicAction"; - var _GTC = "GuardrailTopicConfig"; - var _GTCu = "GuardrailTopicsConfig"; - var _GTD = "GuardrailTopicDefinition"; - var _GTE = "GuardrailTopicExample"; - var _GTEu = "GuardrailTopicExamples"; - var _GTN = "GuardrailTopicName"; - var _GTP = "GuardrailTopicPolicy"; - var _GTPC = "GuardrailTopicPolicyConfig"; - var _GTT = "GuardrailTopicsTier"; - var _GTTC = "GuardrailTopicsTierConfig"; - var _GTTN = "GuardrailTopicsTierName"; - var _GTu = "GuardrailTopics"; - var _GUCFMA = "GetUseCaseForModelAccess"; - var _GUCFMAR = "GetUseCaseForModelAccessRequest"; - var _GUCFMARe = "GetUseCaseForModelAccessResponse"; - var _GW = "GuardrailWord"; - var _GWA = "GuardrailWordAction"; - var _GWC = "GuardrailWordConfig"; - var _GWCu = "GuardrailWordsConfig"; - var _GWP = "GuardrailWordPolicy"; - var _GWPC = "GuardrailWordPolicyConfig"; - var _GWu = "GuardrailWords"; - var _HEC = "HumanEvaluationConfig"; - var _HECM = "HumanEvaluationCustomMetric"; - var _HECMu = "HumanEvaluationCustomMetrics"; - var _HTI = "HumanTaskInstructions"; - var _HWC = "HumanWorkflowConfig"; - var _I = "Identifier"; - var _IFC = "ImplicitFilterConfiguration"; - var _ILC = "InvocationLogsConfig"; - var _ILS = "InvocationLogSource"; - var _IMS = "ImportedModelSummary"; - var _IMSL = "ImportedModelSummaryList"; - var _IPD = "InferenceProfileDescription"; - var _IPM = "InferenceProfileModel"; - var _IPMS = "InferenceProfileModelSource"; - var _IPMn = "InferenceProfileModels"; - var _IPS = "InferenceProfileSummary"; - var _IPSn = "InferenceProfileSummaries"; - var _ISE = "InternalServerException"; - var _KBC = "KnowledgeBaseConfig"; - var _KBRAGC = "KnowledgeBaseRetrieveAndGenerateConfiguration"; - var _KBRC = "KnowledgeBaseRetrievalConfiguration"; - var _KBVSC = "KnowledgeBaseVectorSearchConfiguration"; - var _KIC = "KbInferenceConfig"; - var _LARP = "ListAutomatedReasoningPolicies"; - var _LARPBW = "ListAutomatedReasoningPolicyBuildWorkflows"; - var _LARPBWR = "ListAutomatedReasoningPolicyBuildWorkflowsRequest"; - var _LARPBWRi = "ListAutomatedReasoningPolicyBuildWorkflowsResponse"; - var _LARPR = "ListAutomatedReasoningPoliciesRequest"; - var _LARPRi = "ListAutomatedReasoningPoliciesResponse"; - var _LARPTC = "ListAutomatedReasoningPolicyTestCases"; - var _LARPTCR = "ListAutomatedReasoningPolicyTestCasesRequest"; - var _LARPTCRi = "ListAutomatedReasoningPolicyTestCasesResponse"; - var _LARPTR = "ListAutomatedReasoningPolicyTestResults"; - var _LARPTRR = "ListAutomatedReasoningPolicyTestResultsRequest"; - var _LARPTRRi = "ListAutomatedReasoningPolicyTestResultsResponse"; - var _LC = "LoggingConfig"; - var _LCM = "ListCustomModels"; - var _LCMD = "ListCustomModelDeployments"; - var _LCMDR = "ListCustomModelDeploymentsRequest"; - var _LCMDRi = "ListCustomModelDeploymentsResponse"; - var _LCMR = "ListCustomModelsRequest"; - var _LCMRi = "ListCustomModelsResponse"; - var _LEJ = "ListEvaluationJobs"; - var _LEJR = "ListEvaluationJobsRequest"; - var _LEJRi = "ListEvaluationJobsResponse"; - var _LFM = "ListFoundationModels"; - var _LFMAO = "ListFoundationModelAgreementOffers"; - var _LFMAOR = "ListFoundationModelAgreementOffersRequest"; - var _LFMAORi = "ListFoundationModelAgreementOffersResponse"; - var _LFMR = "ListFoundationModelsRequest"; - var _LFMRi = "ListFoundationModelsResponse"; - var _LG = "ListGuardrails"; - var _LGR = "ListGuardrailsRequest"; - var _LGRi = "ListGuardrailsResponse"; - var _LIM = "ListImportedModels"; - var _LIMR = "ListImportedModelsRequest"; - var _LIMRi = "ListImportedModelsResponse"; - var _LIP = "ListInferenceProfiles"; - var _LIPR = "ListInferenceProfilesRequest"; - var _LIPRi = "ListInferenceProfilesResponse"; - var _LMCJ = "ListModelCopyJobs"; - var _LMCJR = "ListModelCopyJobsRequest"; - var _LMCJRi = "ListModelCopyJobsResponse"; - var _LMCJRis = "ListModelCustomizationJobsRequest"; - var _LMCJRist = "ListModelCustomizationJobsResponse"; - var _LMCJi = "ListModelCustomizationJobs"; - var _LMIJ = "ListModelImportJobs"; - var _LMIJR = "ListModelImportJobsRequest"; - var _LMIJRi = "ListModelImportJobsResponse"; - var _LMIJRis = "ListModelInvocationJobsRequest"; - var _LMIJRist = "ListModelInvocationJobsResponse"; - var _LMIJi = "ListModelInvocationJobs"; - var _LMME = "ListMarketplaceModelEndpoints"; - var _LMMER = "ListMarketplaceModelEndpointsRequest"; - var _LMMERi = "ListMarketplaceModelEndpointsResponse"; - var _LPMT = "ListProvisionedModelThroughputs"; - var _LPMTR = "ListProvisionedModelThroughputsRequest"; - var _LPMTRi = "ListProvisionedModelThroughputsResponse"; - var _LPR = "ListPromptRouters"; - var _LPRR = "ListPromptRoutersRequest"; - var _LPRRi = "ListPromptRoutersResponse"; - var _LT = "LegalTerm"; - var _LTFR = "ListTagsForResource"; - var _LTFRR = "ListTagsForResourceRequest"; - var _LTFRRi = "ListTagsForResourceResponse"; - var _M = "Message"; - var _MAS = "MetadataAttributeSchema"; - var _MASL = "MetadataAttributeSchemaList"; - var _MCFR = "MetadataConfigurationForReranking"; - var _MCJS = "ModelCopyJobSummary"; - var _MCJSo = "ModelCustomizationJobSummary"; - var _MCJSod = "ModelCopyJobSummaries"; - var _MCJSode = "ModelCustomizationJobSummaries"; - var _MDS = "ModelDataSource"; - var _MIJIDC = "ModelInvocationJobInputDataConfig"; - var _MIJODC = "ModelInvocationJobOutputDataConfig"; - var _MIJS = "ModelImportJobSummary"; - var _MIJSIDC = "ModelInvocationJobS3InputDataConfig"; - var _MIJSODC = "ModelInvocationJobS3OutputDataConfig"; - var _MIJSo = "ModelInvocationJobSummary"; - var _MIJSod = "ModelImportJobSummaries"; - var _MIJSode = "ModelInvocationJobSummaries"; - var _MME = "MarketplaceModelEndpoint"; - var _MMES = "MarketplaceModelEndpointSummary"; - var _MMESa = "MarketplaceModelEndpointSummaries"; - var _MN = "MetricName"; - var _O = "Offer"; - var _OC = "OrchestrationConfiguration"; - var _ODC = "OutputDataConfig"; - var _Of = "Offers"; - var _PC = "PerformanceConfiguration"; - var _PMILC = "PutModelInvocationLoggingConfiguration"; - var _PMILCR = "PutModelInvocationLoggingConfigurationRequest"; - var _PMILCRu = "PutModelInvocationLoggingConfigurationResponse"; - var _PMS = "ProvisionedModelSummary"; - var _PMSr = "ProvisionedModelSummaries"; - var _PRD = "PromptRouterDescription"; - var _PRS = "PromptRouterSummary"; - var _PRSr = "PromptRouterSummaries"; - var _PRTM = "PromptRouterTargetModel"; - var _PRTMr = "PromptRouterTargetModels"; - var _PT = "PricingTerm"; - var _PTr = "PromptTemplate"; - var _PUCFMA = "PutUseCaseForModelAccess"; - var _PUCFMAR = "PutUseCaseForModelAccessRequest"; - var _PUCFMARu = "PutUseCaseForModelAccessResponse"; - var _QTC = "QueryTransformationConfiguration"; - var _RAGC = "RetrieveAndGenerateConfiguration"; - var _RAGCo = "RAGConfig"; - var _RC = "RetrieveConfig"; - var _RCa = "RagConfigs"; - var _RCat = "RateCard"; - var _RCo = "RoutingCriteria"; - var _RF = "RetrievalFilter"; - var _RFL = "RetrievalFilterList"; - var _RIUE = "ResourceInUseException"; - var _RMBF = "RequestMetadataBaseFilters"; - var _RMF = "RequestMetadataFilters"; - var _RMFL = "RequestMetadataFiltersList"; - var _RMM = "RequestMetadataMap"; - var _RMME = "RegisterMarketplaceModelEndpoint"; - var _RMMER = "RegisterMarketplaceModelEndpointRequest"; - var _RMMERe = "RegisterMarketplaceModelEndpointResponse"; - var _RMSMC = "RerankingMetadataSelectiveModeConfiguration"; - var _RNFE = "ResourceNotFoundException"; - var _RS = "RatingScale"; - var _RSI = "RatingScaleItem"; - var _RSIV = "RatingScaleItemValue"; - var _SARPBW = "StartAutomatedReasoningPolicyBuildWorkflow"; - var _SARPBWR = "StartAutomatedReasoningPolicyBuildWorkflowRequest"; - var _SARPBWRt = "StartAutomatedReasoningPolicyBuildWorkflowResponse"; - var _SARPTW = "StartAutomatedReasoningPolicyTestWorkflow"; - var _SARPTWR = "StartAutomatedReasoningPolicyTestWorkflowRequest"; - var _SARPTWRt = "StartAutomatedReasoningPolicyTestWorkflowResponse"; - var _SC = "S3Config"; - var _SD = "StatusDetails"; - var _SDS = "S3DataSource"; - var _SEJ = "StopEvaluationJob"; - var _SEJR = "StopEvaluationJobRequest"; - var _SEJRt = "StopEvaluationJobResponse"; - var _SMCJ = "StopModelCustomizationJob"; - var _SMCJR = "StopModelCustomizationJobRequest"; - var _SMCJRt = "StopModelCustomizationJobResponse"; - var _SME = "SageMakerEndpoint"; - var _SMIJ = "StopModelInvocationJob"; - var _SMIJR = "StopModelInvocationJobRequest"; - var _SMIJRt = "StopModelInvocationJobResponse"; - var _SOD = "S3ObjectDoc"; - var _SQEE = "ServiceQuotaExceededException"; - var _ST = "SupportTerm"; - var _SUE = "ServiceUnavailableException"; - var _T = "Tag"; - var _TD = "TermDetails"; - var _TDC = "TrainingDataConfig"; - var _TDr = "TrainingDetails"; - var _TE = "ThrottlingException"; - var _TIC = "TextInferenceConfig"; - var _TL = "TagList"; - var _TM = "TrainingMetrics"; - var _TMC = "TeacherModelConfig"; - var _TMTE = "TooManyTagsException"; - var _TPT = "TextPromptTemplate"; - var _TR = "TagResource"; - var _TRR = "TagResourceRequest"; - var _TRRa = "TagResourceResponse"; - var _UARP = "UpdateAutomatedReasoningPolicy"; - var _UARPA = "UpdateAutomatedReasoningPolicyAnnotations"; - var _UARPAR = "UpdateAutomatedReasoningPolicyAnnotationsRequest"; - var _UARPARp = "UpdateAutomatedReasoningPolicyAnnotationsResponse"; - var _UARPR = "UpdateAutomatedReasoningPolicyRequest"; - var _UARPRp = "UpdateAutomatedReasoningPolicyResponse"; - var _UARPTC = "UpdateAutomatedReasoningPolicyTestCase"; - var _UARPTCR = "UpdateAutomatedReasoningPolicyTestCaseRequest"; - var _UARPTCRp = "UpdateAutomatedReasoningPolicyTestCaseResponse"; - var _UG = "UpdateGuardrail"; - var _UGR = "UpdateGuardrailRequest"; - var _UGRp = "UpdateGuardrailResponse"; - var _UMME = "UpdateMarketplaceModelEndpoint"; - var _UMMER = "UpdateMarketplaceModelEndpointRequest"; - var _UMMERp = "UpdateMarketplaceModelEndpointResponse"; - var _UPMT = "UpdateProvisionedModelThroughput"; - var _UPMTR = "UpdateProvisionedModelThroughputRequest"; - var _UPMTRp = "UpdateProvisionedModelThroughputResponse"; - var _UR = "UntagResource"; - var _URR = "UntagResourceRequest"; - var _URRn = "UntagResourceResponse"; - var _V = "Validator"; - var _VC = "VpcConfig"; - var _VD = "ValidationDetails"; - var _VDC = "ValidationDataConfig"; - var _VE = "ValidationException"; - var _VM = "ValidatorMetric"; - var _VMa = "ValidationMetrics"; - var _VSBRC = "VectorSearchBedrockRerankingConfiguration"; - var _VSBRMC = "VectorSearchBedrockRerankingModelConfiguration"; - var _VSRC = "VectorSearchRerankingConfiguration"; - var _VT = "ValidityTerm"; - var _Va = "Validators"; - var _a2 = "annotation"; - var _aA = "agreementAvailability"; - var _aAn = "andAll"; - var _aD = "agreementDuration"; - var _aE = "alternateExpression"; - var _aEc = "acceptEula"; - var _aMRF = "additionalModelRequestFields"; - var _aR = "addRule"; - var _aRFNL = "addRuleFromNaturalLanguage"; - var _aRP = "automatedReasoningPolicy"; - var _aRPBWS = "automatedReasoningPolicyBuildWorkflowSummaries"; - var _aRPC = "automatedReasoningPolicyConfig"; - var _aRPS = "automatedReasoningPolicySummaries"; - var _aS = "authorizationStatus"; - var _aSH = "annotationSetHash"; - var _aT = "applicationType"; - var _aTE = "applicationTypeEquals"; - var _aTFR = "aggregatedTestFindingsResult"; - var _aTV = "addTypeValue"; - var _aTd = "addType"; - var _aTs = "assetType"; - var _aV = "addVariable"; - var _ac = "action"; - var _an = "annotations"; - var _ar = "arn"; - var _au = "automated"; - var _bC = "byteContent"; - var _bCT = "byCustomizationType"; - var _bEM = "bedrockEvaluatorModels"; - var _bIM = "blockedInputMessaging"; - var _bIT = "byInferenceType"; - var _bKBI = "bedrockKnowledgeBaseIdentifiers"; - var _bL = "buildLog"; - var _bM = "bedrockModel"; - var _bMA = "baseModelArn"; - var _bMAE = "baseModelArnEquals"; - var _bMI = "baseModelIdentifier"; - var _bMIe = "bedrockModelIdentifiers"; - var _bMN = "baseModelName"; - var _bN = "bucketName"; - var _bOM = "blockedOutputsMessaging"; - var _bOMy = "byOutputModality"; - var _bP = "byProvider"; - var _bRC = "bedrockRerankingConfiguration"; - var _bS = "buildSteps"; - var _bWA = "buildWorkflowAssets"; - var _bWI = "buildWorkflowId"; - var _bWT = "buildWorkflowType"; - var _c = "client"; - var _cA = "createdAt"; - var _cAr = "createdAfter"; - var _cB = "createdBefore"; - var _cC = "customizationConfig"; - var _cD = "commitmentDuration"; - var _cEKI = "customerEncryptionKeyId"; - var _cET = "commitmentExpirationTime"; - var _cF = "copyFrom"; - var _cFS = "claimsFalseScenario"; - var _cGP = "contextualGroundingPolicy"; - var _cGPC = "contextualGroundingPolicyConfig"; - var _cM = "customMetrics"; - var _cMA = "customModelArn"; - var _cMC = "customMetricConfig"; - var _cMD = "customMetricDefinition"; - var _cMDA = "customModelDeploymentArn"; - var _cMDI = "customModelDeploymentIdentifier"; - var _cMDN = "customModelDeploymentName"; - var _cMEMI = "customMetricsEvaluatorModelIdentifiers"; - var _cMKKI = "customModelKmsKeyId"; - var _cMN = "customModelName"; - var _cMT = "customModelTags"; - var _cMU = "customModelUnits"; - var _cMUPMC = "customModelUnitsPerModelCopy"; - var _cMUV = "customModelUnitsVersion"; - var _cP = "contentPolicy"; - var _cPC = "contentPolicyConfig"; - var _cR = "contradictingRules"; - var _cRC = "crossRegionConfig"; - var _cRD = "crossRegionDetails"; - var _cRT = "clientRequestToken"; - var _cRo = "conflictingRules"; - var _cS = "customizationsSupported"; - var _cT = "confidenceThreshold"; - var _cTA = "creationTimeAfter"; - var _cTB = "creationTimeBefore"; - var _cTS = "claimsTrueScenario"; - var _cTo = "contentType"; - var _cTr = "creationTime"; - var _cTu = "customizationType"; - var _cWC = "cloudWatchConfig"; - var _cl = "claims"; - var _co = "confidence"; - var _cod = "code"; - var _con = "context"; - var _cont = "content"; - var _d = "description"; - var _dC = "distillationConfig"; - var _dCT = "documentContentType"; - var _dD = "documentDescription"; - var _dH = "definitionHash"; - var _dL = "datasetLocation"; - var _dMA = "desiredModelArn"; - var _dMC = "datasetMetricConfigs"; - var _dMI = "desiredModelId"; - var _dMU = "desiredModelUnits"; - var _dN = "documentName"; - var _dPD = "dataProcessingDetails"; - var _dPMN = "desiredProvisionedModelName"; - var _dR = "deleteRule"; - var _dRS = "disjointRuleSets"; - var _dS = "differenceScenarios"; - var _dT = "deleteType"; - var _dTV = "deleteTypeValue"; - var _dV = "deleteVariable"; - var _da = "data"; - var _dat = "dataset"; - var _de = "definition"; - var _di = "dimension"; - var _do = "document"; - var _doc = "documents"; - var _e = "error"; - var _eA = "endpointArn"; - var _eAFR = "expectedAggregatedFindingsResult"; - var _eAn = "entitlementAvailability"; - var _eC = "evaluationConfig"; - var _eCn = "endpointConfig"; - var _eDDE = "embeddingDataDeliveryEnabled"; - var _eI = "endpointIdentifier"; - var _eJ = "evaluationJobs"; - var _eM = "errorMessage"; - var _eMC = "evaluatorModelConfig"; - var _eMI = "evaluatorModelIdentifiers"; - var _eN = "endpointName"; - var _eR = "expectedResult"; - var _eRx = "executionRole"; - var _eS = "endpointStatus"; - var _eSC = "externalSourcesConfiguration"; - var _eSM = "endpointStatusMessage"; - var _eT = "endTime"; - var _eTT = "evaluationTaskTypes"; - var _en = "entries"; - var _ena = "enabled"; - var _eq = "equals"; - var _er = "errors"; - var _ex = "expression"; - var _exa = "examples"; - var _f = "feedback"; - var _fC = "filtersConfig"; - var _fD = "formData"; - var _fDA = "flowDefinitionArn"; - var _fM = "fallbackModel"; - var _fMA = "foundationModelArn"; - var _fMAE = "foundationModelArnEquals"; - var _fMa = "failureMessage"; - var _fMai = "failureMessages"; - var _fN = "fieldName"; - var _fR = "failureRecommendations"; - var _fTE = "fieldsToExclude"; - var _fTI = "fieldsToInclude"; - var _fV = "floatValue"; - var _fi = "filters"; - var _fil = "filter"; - var _fo = "force"; - var _g = "guardrails"; - var _gA = "guardrailArn"; - var _gC = "guardContent"; - var _gCe = "generationConfiguration"; - var _gCu = "guardrailConfiguration"; - var _gI = "guardrailId"; - var _gIu = "guardrailIdentifier"; - var _gPA = "guardrailProfileArn"; - var _gPI = "guardrailProfileIdentifier"; - var _gPIu = "guardrailProfileId"; - var _gT = "greaterThan"; - var _gTC = "generatedTestCases"; - var _gTOE = "greaterThanOrEquals"; - var _gV = "guardrailVersion"; - var _h = "human"; - var _hE = "httpError"; - var _hH = "httpHeader"; - var _hP = "hyperParameters"; - var _hQ = "httpQuery"; - var _hWC = "humanWorkflowConfig"; - var _ht = "http"; - var _i = "id"; - var _iA = "inputAction"; - var _iC = "inferenceConfig"; - var _iCS = "inferenceConfigSummary"; - var _iCn = "ingestContent"; - var _iDC = "inputDataConfig"; - var _iDDE = "imageDataDeliveryEnabled"; - var _iE = "inputEnabled"; - var _iFC = "implicitFilterConfiguration"; - var _iIC = "initialInstanceCount"; - var _iJS = "invocationJobSummaries"; - var _iLC = "invocationLogsConfig"; - var _iLS = "invocationLogSource"; - var _iM = "inputModalities"; - var _iMA = "importedModelArn"; - var _iMKKA = "importedModelKmsKeyArn"; - var _iMKKI = "importedModelKmsKeyId"; - var _iMN = "importedModelName"; - var _iMT = "importedModelTags"; - var _iO = "isOwned"; - var _iP = "inferenceParams"; - var _iPA = "inferenceProfileArn"; - var _iPI = "inferenceProfileIdentifier"; - var _iPIn = "inferenceProfileId"; - var _iPN = "inferenceProfileName"; - var _iPS = "inferenceProfileSummaries"; - var _iS = "instructSupported"; - var _iSI = "inferenceSourceIdentifier"; - var _iSn = "inputStrength"; - var _iT = "instanceType"; - var _iTS = "inferenceTypesSupported"; - var _iTd = "idempotencyToken"; - var _id = "identifier"; - var _im = "impossible"; - var _in = "instructions"; - var _in_ = "in"; - var _inv = "invalid"; - var _jA = "jobArn"; - var _jD = "jobDescription"; - var _jET = "jobExpirationTime"; - var _jI = "jobIdentifier"; - var _jIo = "jobIdentifiers"; - var _jN = "jobName"; - var _jS = "jobStatus"; - var _jSo = "jobSummaries"; - var _jT = "jobTags"; - var _jTo = "jobType"; - var _k = "key"; - var _kBC = "knowledgeBaseConfiguration"; - var _kBCn = "knowledgeBaseConfig"; - var _kBI = "knowledgeBaseId"; - var _kBRC = "knowledgeBaseRetrievalConfiguration"; - var _kEK = "kmsEncryptionKey"; - var _kIC = "kbInferenceConfig"; - var _kKA = "kmsKeyArn"; - var _kKI = "kmsKeyId"; - var _kP = "keyPrefix"; - var _l = "logic"; - var _lC = "loggingConfig"; - var _lCi = "listContains"; - var _lDDSC = "largeDataDeliveryS3Config"; - var _lGN = "logGroupName"; - var _lMT = "lastModifiedTime"; - var _lT = "legalTerm"; - var _lTOE = "lessThanOrEquals"; - var _lTe = "lessThan"; - var _lUA = "lastUpdatedAt"; - var _lUASH = "lastUpdatedAnnotationSetHash"; - var _lUDH = "lastUpdatedDefinitionHash"; - var _lW = "logicWarning"; - var _la = "latency"; - var _m = "message"; - var _mA = "modelArn"; - var _mAE = "modelArnEquals"; - var _mAe = "metadataAttributes"; - var _mAo = "modelArchitecture"; - var _mC = "modelConfiguration"; - var _mCJS = "modelCopyJobSummaries"; - var _mCJSo = "modelCustomizationJobSummaries"; - var _mCS = "modelConfigSummary"; - var _mCe = "metadataConfiguration"; - var _mD = "modelDetails"; - var _mDN = "modelDeploymentName"; - var _mDS = "modelDataSource"; - var _mDSo = "modelDeploymentSummaries"; - var _mI = "modelIdentifier"; - var _mIJS = "modelImportJobSummaries"; - var _mIo = "modelId"; - var _mIod = "modelIdentifiers"; - var _mKKA = "modelKmsKeyArn"; - var _mKKI = "modelKmsKeyId"; - var _mL = "modelLifecycle"; - var _mME = "marketplaceModelEndpoint"; - var _mMEa = "marketplaceModelEndpoints"; - var _mN = "modelName"; - var _mNe = "metricNames"; - var _mR = "maxResults"; - var _mRLFI = "maxResponseLengthForInference"; - var _mS = "modelSource"; - var _mSC = "modelSourceConfig"; - var _mSE = "modelSourceEquals"; - var _mSI = "modelSourceIdentifier"; - var _mSo = "modelStatus"; - var _mSod = "modelSummaries"; - var _mT = "messageType"; - var _mTa = "maxTokens"; - var _mTo = "modelTags"; - var _mU = "modelUnits"; - var _mWL = "managedWordLists"; - var _mWLC = "managedWordListsConfig"; - var _me = "messages"; - var _mo = "models"; - var _mu = "mutation"; - var _n = "name"; - var _nC = "nameContains"; - var _nE = "notEquals"; - var _nI = "notIn"; - var _nL = "naturalLanguage"; - var _nN = "newName"; - var _nOR = "numberOfResults"; - var _nORR = "numberOfRerankedResults"; - var _nT = "nextToken"; - var _nTo = "noTranslations"; - var _nV = "newValue"; - var _o = "options"; - var _oA = "outputAction"; - var _oAI = "ownerAccountId"; - var _oAr = "orAll"; - var _oC = "orchestrationConfiguration"; - var _oDC = "outputDataConfig"; - var _oE = "outputEnabled"; - var _oI = "offerId"; - var _oM = "outputModalities"; - var _oMA = "outputModelArn"; - var _oMKKA = "outputModelKmsKeyArn"; - var _oMN = "outputModelName"; - var _oMNC = "outputModelNameContains"; - var _oS = "outputStrength"; - var _oST = "overrideSearchType"; - var _oT = "offerToken"; - var _oTf = "offerType"; - var _of = "offers"; - var _p = "premises"; - var _pA = "policyArn"; - var _pC = "performanceConfig"; - var _pD = "policyDefinition"; - var _pDR = "policyDefinitionRule"; - var _pDT = "policyDefinitionType"; - var _pDV = "policyDefinitionVariable"; - var _pE = "priorElement"; - var _pEC = "piiEntitiesConfig"; - var _pEi = "piiEntities"; - var _pI = "policyId"; - var _pIS = "precomputedInferenceSource"; - var _pISI = "precomputedInferenceSourceIdentifiers"; - var _pMA = "provisionedModelArn"; - var _pMI = "provisionedModelId"; - var _pMN = "provisionedModelName"; - var _pMS = "provisionedModelSummaries"; - var _pN = "providerName"; - var _pRA = "promptRouterArn"; - var _pRAo = "policyRepairAssets"; - var _pRN = "promptRouterName"; - var _pRS = "promptRouterSummaries"; - var _pRSC = "precomputedRagSourceConfig"; - var _pRSI = "precomputedRagSourceIdentifiers"; - var _pT = "promptTemplate"; - var _pVA = "policyVersionArn"; - var _pa = "pattern"; - var _pl = "planning"; - var _po = "policies"; - var _pr = "price"; - var _qC = "queryContent"; - var _qR = "qualityReport"; - var _qTC = "queryTransformationConfiguration"; - var _r = "rule"; - var _rA = "roleArn"; - var _rAGC = "retrieveAndGenerateConfig"; - var _rAGSC = "retrieveAndGenerateSourceConfig"; - var _rARN = "resourceARN"; - var _rAe = "regionAvailability"; - var _rC = "ruleCount"; - var _rCS = "ragConfigSummary"; - var _rCa = "rateCard"; - var _rCag = "ragConfigs"; - var _rCe = "regexesConfig"; - var _rCer = "rerankingConfiguration"; - var _rCet = "retrievalConfiguration"; - var _rCetr = "retrieveConfig"; - var _rCo = "routingCriteria"; - var _rI = "ruleId"; - var _rIa = "ragIdentifiers"; - var _rIu = "ruleIds"; - var _rM = "ratingMethod"; - var _rMF = "requestMetadataFilters"; - var _rN = "resourceName"; - var _rPD = "refundPolicyDescription"; - var _rQD = "responseQualityDifference"; - var _rS = "ratingScale"; - var _rSC = "retrieveSourceConfig"; - var _rSI = "ragSourceIdentifier"; - var _rSS = "responseStreamingSupported"; - var _re = "regexes"; - var _ru = "rules"; - var _s = "status"; - var _sAE = "sourceAccountEquals"; - var _sAI = "sourceAccountId"; - var _sB = "sortBy"; - var _sBO = "s3BucketOwner"; - var _sC = "s3Config"; - var _sCo = "sourceContent"; - var _sCt = "stringContains"; - var _sD = "statusDetails"; - var _sDS = "s3DataSource"; - var _sE = "scenarioExpression"; - var _sEKI = "s3EncryptionKeyId"; - var _sEt = "statusEquals"; - var _sGI = "securityGroupIds"; - var _sI = "subnetIds"; - var _sIDC = "s3InputDataConfig"; - var _sIF = "s3InputFormat"; - var _sIP = "sensitiveInformationPolicy"; - var _sIPC = "sensitiveInformationPolicyConfig"; - var _sL = "s3Location"; - var _sM = "statusMessage"; - var _sMA = "sourceModelArn"; - var _sMAE = "sourceModelArnEquals"; - var _sMC = "selectiveModeConfiguration"; - var _sMN = "sourceModelName"; - var _sMa = "sageMaker"; - var _sMe = "selectionMode"; - var _sO = "sortOrder"; - var _sODC = "s3OutputDataConfig"; - var _sR = "supportingRules"; - var _sRt = "statusReasons"; - var _sS = "stopSequences"; - var _sT = "sourceType"; - var _sTA = "submitTimeAfter"; - var _sTB = "submitTimeBefore"; - var _sTu = "submitTime"; - var _sTup = "supportTerm"; - var _sU = "s3Uri"; - var _sV = "stringValue"; - var _sW = "startsWith"; - var _sa = "satisfiable"; - var _sc = "scenario"; - var _se = "server"; - var _sm = "smithy.ts.sdk.synthetic.com.amazonaws.bedrock"; - var _so = "sources"; - var _st = "statements"; - var _t = "translation"; - var _tA = "translationAmbiguous"; - var _tC = "typeCount"; - var _tCI = "testCaseId"; - var _tCIe = "testCaseIds"; - var _tCe = "testCase"; - var _tCes = "testCases"; - var _tCi = "tierConfig"; - var _tCo = "topicsConfig"; - var _tCoo = "tooComplex"; - var _tD = "termDetails"; - var _tDC = "trainingDataConfig"; - var _tDDE = "textDataDeliveryEnabled"; - var _tDIH = "timeoutDurationInHours"; - var _tDr = "trainingDetails"; - var _tE = "typeEquals"; - var _tF = "testFindings"; - var _tIC = "textInferenceConfig"; - var _tK = "tagKeys"; - var _tL = "trainingLoss"; - var _tM = "trainingMetrics"; - var _tMA = "targetModelArn"; - var _tMC = "teacherModelConfig"; - var _tMI = "teacherModelIdentifier"; - var _tMKKA = "targetModelKmsKeyArn"; - var _tMN = "targetModelName"; - var _tMNC = "targetModelNameContains"; - var _tMT = "targetModelTags"; - var _tN = "typeName"; - var _tNi = "tierName"; - var _tP = "topicPolicy"; - var _tPC = "topicPolicyConfig"; - var _tPT = "textPromptTemplate"; - var _tPo = "topP"; - var _tR = "testResult"; - var _tRR = "testRunResult"; - var _tRS = "testRunStatus"; - var _tRe = "testResults"; - var _tT = "taskType"; - var _ta = "tags"; - var _te = "text"; - var _tem = "temperature"; - var _th = "threshold"; - var _ti = "tier"; - var _to = "topics"; - var _tr = "translations"; - var _ty = "type"; - var _typ = "types"; - var _u = "unit"; - var _uA = "updatedAt"; - var _uBPT = "usageBasedPricingTerm"; - var _uC = "untranslatedClaims"; - var _uFRF = "updateFromRulesFeedback"; - var _uFSF = "updateFromScenarioFeedback"; - var _uP = "untranslatedPremises"; - var _uPR = "usePromptResponse"; - var _uR = "updateRule"; - var _uT = "unusedTypes"; - var _uTV = "unusedTypeValues"; - var _uTVp = "updateTypeValue"; - var _uTp = "updateType"; - var _uV = "unusedVariables"; - var _uVp = "updateVariable"; - var _ur = "url"; - var _uri = "uri"; - var _v = "values"; - var _vC = "variableCount"; - var _vCp = "vpcConfig"; - var _vD = "validationDetails"; - var _vDC = "validationDataConfig"; - var _vDDE = "videoDataDeliveryEnabled"; - var _vL = "validationLoss"; - var _vM = "validationMetrics"; - var _vN = "valueName"; - var _vSC = "vectorSearchConfiguration"; - var _vT = "validityTerm"; - var _va = "value"; - var _val = "validators"; - var _vali = "valid"; - var _var = "variable"; - var _vari = "variables"; - var _ve = "version"; - var _vp = "vpc"; - var _w = "words"; - var _wC = "workflowContent"; - var _wCo = "wordsConfig"; - var _wP = "wordPolicy"; - var _wPC = "wordPolicyConfig"; - var _xact = "x-amz-client-token"; - var n0 = "com.amazonaws.bedrock"; - var AutomatedReasoningLogicStatementContent = [0, n0, _ARLSC, 8, 0]; - var AutomatedReasoningNaturalLanguageStatementContent = [0, n0, _ARNLSC, 8, 0]; - var AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage = [0, n0, _ARPAFNL, 8, 0]; - var AutomatedReasoningPolicyAnnotationIngestContent = [0, n0, _ARPAIC, 8, 0]; - var AutomatedReasoningPolicyAnnotationRuleNaturalLanguage = [0, n0, _ARPARNL, 8, 0]; - var AutomatedReasoningPolicyBuildDocumentBlob = [0, n0, _ARPBDB, 8, 21]; - var AutomatedReasoningPolicyBuildDocumentDescription = [0, n0, _ARPBDD, 8, 0]; - var AutomatedReasoningPolicyBuildDocumentName = [0, n0, _ARPBDN, 8, 0]; - var AutomatedReasoningPolicyDefinitionRuleAlternateExpression = [0, n0, _ARPDRAE, 8, 0]; - var AutomatedReasoningPolicyDefinitionRuleExpression = [0, n0, _ARPDRE, 8, 0]; - var AutomatedReasoningPolicyDefinitionTypeDescription = [0, n0, _ARPDTD, 8, 0]; - var AutomatedReasoningPolicyDefinitionTypeName = [0, n0, _ARPDTN, 8, 0]; - var AutomatedReasoningPolicyDefinitionTypeValueDescription = [0, n0, _ARPDTVD, 8, 0]; - var AutomatedReasoningPolicyDefinitionVariableDescription = [0, n0, _ARPDVD, 8, 0]; - var AutomatedReasoningPolicyDefinitionVariableName = [0, n0, _ARPDVN, 8, 0]; - var AutomatedReasoningPolicyDescription = [0, n0, _ARPD, 8, 0]; - var AutomatedReasoningPolicyName = [0, n0, _ARPN, 8, 0]; - var AutomatedReasoningPolicyScenarioAlternateExpression = [0, n0, _ARPSAE, 8, 0]; - var AutomatedReasoningPolicyScenarioExpression = [0, n0, _ARPSE, 8, 0]; - var AutomatedReasoningPolicyTestGuardContent = [0, n0, _ARPTGC, 8, 0]; - var AutomatedReasoningPolicyTestQueryContent = [0, n0, _ARPTQC, 8, 0]; - var ByteContentBlob = [0, n0, _BCB, 8, 21]; - var EvaluationDatasetName = [0, n0, _EDN, 8, 0]; - var EvaluationJobDescription = [0, n0, _EJD, 8, 0]; - var EvaluationJobIdentifier = [0, n0, _EJI, 8, 0]; - var EvaluationMetricDescription = [0, n0, _EMD, 8, 0]; - var EvaluationMetricName = [0, n0, _EMN, 8, 0]; - var EvaluationModelInferenceParams = [0, n0, _EMIP, 8, 0]; - var GuardrailBlockedMessaging = [0, n0, _GBM, 8, 0]; - var GuardrailContentFilterAction$1 = [0, n0, _GCFA, 8, 0]; - var GuardrailContentFiltersTierName$1 = [0, n0, _GCFTN, 8, 0]; - var GuardrailContextualGroundingAction$1 = [0, n0, _GCGA, 8, 0]; - var GuardrailDescription = [0, n0, _GD, 8, 0]; - var GuardrailFailureRecommendation = [0, n0, _GFR, 8, 0]; - var GuardrailModality$1 = [0, n0, _GM, 8, 0]; - var GuardrailName = [0, n0, _GN, 8, 0]; - var GuardrailStatusReason = [0, n0, _GSR, 8, 0]; - var GuardrailTopicAction$1 = [0, n0, _GTA, 8, 0]; - var GuardrailTopicDefinition = [0, n0, _GTD, 8, 0]; - var GuardrailTopicExample = [0, n0, _GTE, 8, 0]; - var GuardrailTopicName = [0, n0, _GTN, 8, 0]; - var GuardrailTopicsTierName$1 = [0, n0, _GTTN, 8, 0]; - var GuardrailWordAction$1 = [0, n0, _GWA, 8, 0]; - var HumanTaskInstructions = [0, n0, _HTI, 8, 0]; - var Identifier = [0, n0, _I, 8, 0]; - var InferenceProfileDescription = [0, n0, _IPD, 8, 0]; - var Message = [0, n0, _M, 8, 0]; - var MetricName = [0, n0, _MN, 8, 0]; - var PromptRouterDescription = [0, n0, _PRD, 8, 0]; - var TextPromptTemplate = [0, n0, _TPT, 8, 0]; - var AccessDeniedException = [ - -3, - n0, - _ADE, - { - [_e]: _c, - [_hE]: 403 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1); - var AgreementAvailability = [3, n0, _AA, 0, [_s, _eM], [0, 0]]; - var AutomatedEvaluationConfig = [ - 3, - n0, - _AEC, - 0, - [_dMC, _eMC, _cMC], - [ - [() => EvaluationDatasetMetricConfigs, 0], - () => EvaluatorModelConfig, - [() => AutomatedEvaluationCustomMetricConfig, 0] - ] - ]; - var AutomatedEvaluationCustomMetricConfig = [ - 3, - n0, - _AECMC, - 0, - [_cM, _eMC], - [[() => AutomatedEvaluationCustomMetrics, 0], () => CustomMetricEvaluatorModelConfig] - ]; - var AutomatedReasoningCheckImpossibleFinding = [ - 3, - n0, - _ARCIF, - 0, - [_t, _cR, _lW], - [ - [() => AutomatedReasoningCheckTranslation, 0], - () => AutomatedReasoningCheckRuleList, - [() => AutomatedReasoningCheckLogicWarning, 0] - ] - ]; - var AutomatedReasoningCheckInputTextReference = [ - 3, - n0, - _ARCITR, - 0, - [_te], - [[() => AutomatedReasoningNaturalLanguageStatementContent, 0]] - ]; - var AutomatedReasoningCheckInvalidFinding = [ - 3, - n0, - _ARCIFu, - 0, - [_t, _cR, _lW], - [ - [() => AutomatedReasoningCheckTranslation, 0], - () => AutomatedReasoningCheckRuleList, - [() => AutomatedReasoningCheckLogicWarning, 0] - ] - ]; - var AutomatedReasoningCheckLogicWarning = [ - 3, - n0, - _ARCLW, - 0, - [_ty, _p, _cl], - [0, [() => AutomatedReasoningLogicStatementList, 0], [() => AutomatedReasoningLogicStatementList, 0]] - ]; - var AutomatedReasoningCheckNoTranslationsFinding = [3, n0, _ARCNTF, 0, [], []]; - var AutomatedReasoningCheckRule = [3, n0, _ARCR, 0, [_i, _pVA], [0, 0]]; - var AutomatedReasoningCheckSatisfiableFinding = [ - 3, - n0, - _ARCSF, - 0, - [_t, _cTS, _cFS, _lW], - [ - [() => AutomatedReasoningCheckTranslation, 0], - [() => AutomatedReasoningCheckScenario, 0], - [() => AutomatedReasoningCheckScenario, 0], - [() => AutomatedReasoningCheckLogicWarning, 0] - ] - ]; - var AutomatedReasoningCheckScenario = [ - 3, - n0, - _ARCS, - 0, - [_st], - [[() => AutomatedReasoningLogicStatementList, 0]] - ]; - var AutomatedReasoningCheckTooComplexFinding = [3, n0, _ARCTCF, 0, [], []]; - var AutomatedReasoningCheckTranslation = [ - 3, - n0, - _ARCT, - 0, - [_p, _cl, _uP, _uC, _co], - [ - [() => AutomatedReasoningLogicStatementList, 0], - [() => AutomatedReasoningLogicStatementList, 0], - [() => AutomatedReasoningCheckInputTextReferenceList, 0], - [() => AutomatedReasoningCheckInputTextReferenceList, 0], - 1 - ] - ]; - var AutomatedReasoningCheckTranslationAmbiguousFinding = [ - 3, - n0, - _ARCTAF, - 0, - [_o, _dS], - [ - [() => AutomatedReasoningCheckTranslationOptionList, 0], - [() => AutomatedReasoningCheckDifferenceScenarioList, 0] - ] - ]; - var AutomatedReasoningCheckTranslationOption = [ - 3, - n0, - _ARCTO, - 0, - [_tr], - [[() => AutomatedReasoningCheckTranslationList, 0]] - ]; - var AutomatedReasoningCheckValidFinding = [ - 3, - n0, - _ARCVF, - 0, - [_t, _cTS, _sR, _lW], - [ - [() => AutomatedReasoningCheckTranslation, 0], - [() => AutomatedReasoningCheckScenario, 0], - () => AutomatedReasoningCheckRuleList, - [() => AutomatedReasoningCheckLogicWarning, 0] - ] - ]; - var AutomatedReasoningLogicStatement = [ - 3, - n0, - _ARLS, - 0, - [_l, _nL], - [ - [() => AutomatedReasoningLogicStatementContent, 0], - [() => AutomatedReasoningNaturalLanguageStatementContent, 0] - ] - ]; - var AutomatedReasoningPolicyAddRuleAnnotation = [ - 3, - n0, - _ARPARA, - 0, - [_ex], - [[() => AutomatedReasoningPolicyDefinitionRuleExpression, 0]] - ]; - var AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation = [ - 3, - n0, - _ARPARFNLA, - 0, - [_nL], - [[() => AutomatedReasoningPolicyAnnotationRuleNaturalLanguage, 0]] - ]; - var AutomatedReasoningPolicyAddRuleMutation = [ - 3, - n0, - _ARPARM, - 0, - [_r], - [[() => AutomatedReasoningPolicyDefinitionRule, 0]] - ]; - var AutomatedReasoningPolicyAddTypeAnnotation = [ - 3, - n0, - _ARPATA, - 0, - [_n, _d, _v], - [ - [() => AutomatedReasoningPolicyDefinitionTypeName, 0], - [() => AutomatedReasoningPolicyDefinitionTypeDescription, 0], - [() => AutomatedReasoningPolicyDefinitionTypeValueList, 0] - ] - ]; - var AutomatedReasoningPolicyAddTypeMutation = [ - 3, - n0, - _ARPATM, - 0, - [_ty], - [[() => AutomatedReasoningPolicyDefinitionType, 0]] - ]; - var AutomatedReasoningPolicyAddTypeValue = [ - 3, - n0, - _ARPATV, - 0, - [_va, _d], - [0, [() => AutomatedReasoningPolicyDefinitionTypeValueDescription, 0]] - ]; - var AutomatedReasoningPolicyAddVariableAnnotation = [ - 3, - n0, - _ARPAVA, - 0, - [_n, _ty, _d], - [ - [() => AutomatedReasoningPolicyDefinitionVariableName, 0], - [() => AutomatedReasoningPolicyDefinitionTypeName, 0], - [() => AutomatedReasoningPolicyDefinitionVariableDescription, 0] - ] - ]; - var AutomatedReasoningPolicyAddVariableMutation = [ - 3, - n0, - _ARPAVM, - 0, - [_var], - [[() => AutomatedReasoningPolicyDefinitionVariable, 0]] - ]; - var AutomatedReasoningPolicyBuildLog = [ - 3, - n0, - _ARPBL, - 0, - [_en], - [[() => AutomatedReasoningPolicyBuildLogEntryList, 0]] - ]; - var AutomatedReasoningPolicyBuildLogEntry = [ - 3, - n0, - _ARPBLE, - 0, - [_a2, _s, _bS], - [[() => AutomatedReasoningPolicyAnnotation, 0], 0, [() => AutomatedReasoningPolicyBuildStepList, 0]] - ]; - var AutomatedReasoningPolicyBuildStep = [ - 3, - n0, - _ARPBS, - 0, - [_con, _pE, _me], - [ - [() => AutomatedReasoningPolicyBuildStepContext, 0], - [() => AutomatedReasoningPolicyDefinitionElement, 0], - () => AutomatedReasoningPolicyBuildStepMessageList - ] - ]; - var AutomatedReasoningPolicyBuildStepMessage = [3, n0, _ARPBSM, 0, [_m, _mT], [0, 0]]; - var AutomatedReasoningPolicyBuildWorkflowDocument = [ - 3, - n0, - _ARPBWD, - 0, - [_do, _dCT, _dN, _dD], - [ - [() => AutomatedReasoningPolicyBuildDocumentBlob, 0], - 0, - [() => AutomatedReasoningPolicyBuildDocumentName, 0], - [() => AutomatedReasoningPolicyBuildDocumentDescription, 0] - ] - ]; - var AutomatedReasoningPolicyBuildWorkflowRepairContent = [ - 3, - n0, - _ARPBWRC, - 0, - [_an], - [[() => AutomatedReasoningPolicyAnnotationList, 0]] - ]; - var AutomatedReasoningPolicyBuildWorkflowSource = [ - 3, - n0, - _ARPBWS, - 0, - [_pD, _wC], - [ - [() => AutomatedReasoningPolicyDefinition, 0], - [() => AutomatedReasoningPolicyWorkflowTypeContent, 0] - ] - ]; - var AutomatedReasoningPolicyBuildWorkflowSummary = [ - 3, - n0, - _ARPBWSu, - 0, - [_pA, _bWI, _s, _bWT, _cA, _uA], - [0, 0, 0, 0, 5, 5] - ]; - var AutomatedReasoningPolicyDefinition = [ - 3, - n0, - _ARPDu, - 0, - [_ve, _typ, _ru, _vari], - [ - 0, - [() => AutomatedReasoningPolicyDefinitionTypeList, 0], - [() => AutomatedReasoningPolicyDefinitionRuleList, 0], - [() => AutomatedReasoningPolicyDefinitionVariableList, 0] - ] - ]; - var AutomatedReasoningPolicyDefinitionQualityReport = [ - 3, - n0, - _ARPDQR, - 0, - [_tC, _vC, _rC, _uT, _uTV, _uV, _cRo, _dRS], - [ - 1, - 1, - 1, - [() => AutomatedReasoningPolicyDefinitionTypeNameList, 0], - [() => AutomatedReasoningPolicyDefinitionTypeValuePairList, 0], - [() => AutomatedReasoningPolicyDefinitionVariableNameList, 0], - 64 | 0, - [() => AutomatedReasoningPolicyDisjointRuleSetList, 0] - ] - ]; - var AutomatedReasoningPolicyDefinitionRule = [ - 3, - n0, - _ARPDR, - 0, - [_i, _ex, _aE], - [ - 0, - [() => AutomatedReasoningPolicyDefinitionRuleExpression, 0], - [() => AutomatedReasoningPolicyDefinitionRuleAlternateExpression, 0] - ] - ]; - var AutomatedReasoningPolicyDefinitionType = [ - 3, - n0, - _ARPDT, - 0, - [_n, _d, _v], - [ - [() => AutomatedReasoningPolicyDefinitionTypeName, 0], - [() => AutomatedReasoningPolicyDefinitionTypeDescription, 0], - [() => AutomatedReasoningPolicyDefinitionTypeValueList, 0] - ] - ]; - var AutomatedReasoningPolicyDefinitionTypeValue = [ - 3, - n0, - _ARPDTV, - 0, - [_va, _d], - [0, [() => AutomatedReasoningPolicyDefinitionTypeValueDescription, 0]] - ]; - var AutomatedReasoningPolicyDefinitionTypeValuePair = [ - 3, - n0, - _ARPDTVP, - 0, - [_tN, _vN], - [[() => AutomatedReasoningPolicyDefinitionTypeName, 0], 0] - ]; - var AutomatedReasoningPolicyDefinitionVariable = [ - 3, - n0, - _ARPDV, - 0, - [_n, _ty, _d], - [ - [() => AutomatedReasoningPolicyDefinitionVariableName, 0], - [() => AutomatedReasoningPolicyDefinitionTypeName, 0], - [() => AutomatedReasoningPolicyDefinitionVariableDescription, 0] - ] - ]; - var AutomatedReasoningPolicyDeleteRuleAnnotation = [3, n0, _ARPDRA, 0, [_rI], [0]]; - var AutomatedReasoningPolicyDeleteRuleMutation = [3, n0, _ARPDRM, 0, [_i], [0]]; - var AutomatedReasoningPolicyDeleteTypeAnnotation = [ - 3, - n0, - _ARPDTA, - 0, - [_n], - [[() => AutomatedReasoningPolicyDefinitionTypeName, 0]] - ]; - var AutomatedReasoningPolicyDeleteTypeMutation = [ - 3, - n0, - _ARPDTM, - 0, - [_n], - [[() => AutomatedReasoningPolicyDefinitionTypeName, 0]] - ]; - var AutomatedReasoningPolicyDeleteTypeValue = [3, n0, _ARPDTVu, 0, [_va], [0]]; - var AutomatedReasoningPolicyDeleteVariableAnnotation = [ - 3, - n0, - _ARPDVA, - 0, - [_n], - [[() => AutomatedReasoningPolicyDefinitionVariableName, 0]] - ]; - var AutomatedReasoningPolicyDeleteVariableMutation = [ - 3, - n0, - _ARPDVM, - 0, - [_n], - [[() => AutomatedReasoningPolicyDefinitionVariableName, 0]] - ]; - var AutomatedReasoningPolicyDisjointRuleSet = [ - 3, - n0, - _ARPDRS, - 0, - [_vari, _ru], - [[() => AutomatedReasoningPolicyDefinitionVariableNameList, 0], 64 | 0] - ]; - var AutomatedReasoningPolicyGeneratedTestCase = [ - 3, - n0, - _ARPGTC, - 0, - [_qC, _gC, _eAFR], - [[() => AutomatedReasoningPolicyTestQueryContent, 0], [() => AutomatedReasoningPolicyTestGuardContent, 0], 0] - ]; - var AutomatedReasoningPolicyGeneratedTestCases = [ - 3, - n0, - _ARPGTCu, - 0, - [_gTC], - [[() => AutomatedReasoningPolicyGeneratedTestCaseList, 0]] - ]; - var AutomatedReasoningPolicyIngestContentAnnotation = [ - 3, - n0, - _ARPICA, - 0, - [_cont], - [[() => AutomatedReasoningPolicyAnnotationIngestContent, 0]] - ]; - var AutomatedReasoningPolicyPlanning = [3, n0, _ARPP, 0, [], []]; - var AutomatedReasoningPolicyScenario = [ - 3, - n0, - _ARPS, - 0, - [_ex, _aE, _rIu, _eR], - [ - [() => AutomatedReasoningPolicyScenarioExpression, 0], - [() => AutomatedReasoningPolicyScenarioAlternateExpression, 0], - 64 | 0, - 0 - ] - ]; - var AutomatedReasoningPolicySummary = [ - 3, - n0, - _ARPSu, - 0, - [_pA, _n, _d, _ve, _pI, _cA, _uA], - [0, [() => AutomatedReasoningPolicyName, 0], [() => AutomatedReasoningPolicyDescription, 0], 0, 0, 5, 5] - ]; - var AutomatedReasoningPolicyTestCase = [ - 3, - n0, - _ARPTC, - 0, - [_tCI, _gC, _qC, _eAFR, _cA, _uA, _cT], - [ - 0, - [() => AutomatedReasoningPolicyTestGuardContent, 0], - [() => AutomatedReasoningPolicyTestQueryContent, 0], - 0, - 5, - 5, - 1 - ] - ]; - var AutomatedReasoningPolicyTestResult = [ - 3, - n0, - _ARPTR, - 0, - [_tCe, _pA, _tRS, _tF, _tRR, _aTFR, _uA], - [[() => AutomatedReasoningPolicyTestCase, 0], 0, 0, [() => AutomatedReasoningCheckFindingList, 0], 0, 0, 5] - ]; - var AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation = [ - 3, - n0, - _ARPUFRFA, - 0, - [_rIu, _f], - [64 | 0, [() => AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage, 0]] - ]; - var AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation = [ - 3, - n0, - _ARPUFSFA, - 0, - [_rIu, _sE, _f], - [ - 64 | 0, - [() => AutomatedReasoningPolicyScenarioExpression, 0], - [() => AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage, 0] - ] - ]; - var AutomatedReasoningPolicyUpdateRuleAnnotation = [ - 3, - n0, - _ARPURA, - 0, - [_rI, _ex], - [0, [() => AutomatedReasoningPolicyDefinitionRuleExpression, 0]] - ]; - var AutomatedReasoningPolicyUpdateRuleMutation = [ - 3, - n0, - _ARPURM, - 0, - [_r], - [[() => AutomatedReasoningPolicyDefinitionRule, 0]] - ]; - var AutomatedReasoningPolicyUpdateTypeAnnotation = [ - 3, - n0, - _ARPUTA, - 0, - [_n, _nN, _d, _v], - [ - [() => AutomatedReasoningPolicyDefinitionTypeName, 0], - [() => AutomatedReasoningPolicyDefinitionTypeName, 0], - [() => AutomatedReasoningPolicyDefinitionTypeDescription, 0], - [() => AutomatedReasoningPolicyTypeValueAnnotationList, 0] - ] - ]; - var AutomatedReasoningPolicyUpdateTypeMutation = [ - 3, - n0, - _ARPUTM, - 0, - [_ty], - [[() => AutomatedReasoningPolicyDefinitionType, 0]] - ]; - var AutomatedReasoningPolicyUpdateTypeValue = [ - 3, - n0, - _ARPUTV, - 0, - [_va, _nV, _d], - [0, 0, [() => AutomatedReasoningPolicyDefinitionTypeValueDescription, 0]] - ]; - var AutomatedReasoningPolicyUpdateVariableAnnotation = [ - 3, - n0, - _ARPUVA, - 0, - [_n, _nN, _d], - [ - [() => AutomatedReasoningPolicyDefinitionVariableName, 0], - [() => AutomatedReasoningPolicyDefinitionVariableName, 0], - [() => AutomatedReasoningPolicyDefinitionVariableDescription, 0] - ] - ]; - var AutomatedReasoningPolicyUpdateVariableMutation = [ - 3, - n0, - _ARPUVM, - 0, - [_var], - [[() => AutomatedReasoningPolicyDefinitionVariable, 0]] - ]; - var BatchDeleteEvaluationJobError = [ - 3, - n0, - _BDEJE, - 0, - [_jI, _cod, _m], - [[() => EvaluationJobIdentifier, 0], 0, 0] - ]; - var BatchDeleteEvaluationJobItem = [ - 3, - n0, - _BDEJI, - 0, - [_jI, _jS], - [[() => EvaluationJobIdentifier, 0], 0] - ]; - var BatchDeleteEvaluationJobRequest = [ - 3, - n0, - _BDEJR, - 0, - [_jIo], - [[() => EvaluationJobIdentifiers, 0]] - ]; - var BatchDeleteEvaluationJobResponse = [ - 3, - n0, - _BDEJRa, - 0, - [_er, _eJ], - [ - [() => BatchDeleteEvaluationJobErrors, 0], - [() => BatchDeleteEvaluationJobItems, 0] - ] - ]; - var BedrockEvaluatorModel = [3, n0, _BEM, 0, [_mI], [0]]; - var ByteContentDoc = [ - 3, - n0, - _BCD, - 0, - [_id, _cTo, _da], - [[() => Identifier, 0], 0, [() => ByteContentBlob, 0]] - ]; - var CancelAutomatedReasoningPolicyBuildWorkflowRequest = [ - 3, - n0, - _CARPBWR, - 0, - [_pA, _bWI], - [ - [0, 1], - [0, 1] - ] - ]; - var CancelAutomatedReasoningPolicyBuildWorkflowResponse = [3, n0, _CARPBWRa, 0, [], []]; - var CloudWatchConfig = [3, n0, _CWC, 0, [_lGN, _rA, _lDDSC], [0, 0, () => S3Config]]; - var ConflictException = [ - -3, - n0, - _CE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ConflictException, ConflictException$1); - var CreateAutomatedReasoningPolicyRequest = [ - 3, - n0, - _CARPR, - 0, - [_n, _d, _cRT, _pD, _kKI, _ta], - [ - [() => AutomatedReasoningPolicyName, 0], - [() => AutomatedReasoningPolicyDescription, 0], - [0, 4], - [() => AutomatedReasoningPolicyDefinition, 0], - 0, - () => TagList - ] - ]; - var CreateAutomatedReasoningPolicyResponse = [ - 3, - n0, - _CARPRr, - 0, - [_pA, _ve, _n, _d, _dH, _cA, _uA], - [0, 0, [() => AutomatedReasoningPolicyName, 0], [() => AutomatedReasoningPolicyDescription, 0], 0, 5, 5] - ]; - var CreateAutomatedReasoningPolicyTestCaseRequest = [ - 3, - n0, - _CARPTCR, - 0, - [_pA, _gC, _qC, _eAFR, _cRT, _cT], - [ - [0, 1], - [() => AutomatedReasoningPolicyTestGuardContent, 0], - [() => AutomatedReasoningPolicyTestQueryContent, 0], - 0, - [0, 4], - 1 - ] - ]; - var CreateAutomatedReasoningPolicyTestCaseResponse = [ - 3, - n0, - _CARPTCRr, - 0, - [_pA, _tCI], - [0, 0] - ]; - var CreateAutomatedReasoningPolicyVersionRequest = [ - 3, - n0, - _CARPVR, - 0, - [_pA, _cRT, _lUDH, _ta], - [[0, 1], [0, 4], 0, () => TagList] - ]; - var CreateAutomatedReasoningPolicyVersionResponse = [ - 3, - n0, - _CARPVRr, - 0, - [_pA, _ve, _n, _d, _dH, _cA], - [0, 0, [() => AutomatedReasoningPolicyName, 0], [() => AutomatedReasoningPolicyDescription, 0], 0, 5] - ]; - var CreateCustomModelDeploymentRequest = [ - 3, - n0, - _CCMDR, - 0, - [_mDN, _mA, _d, _ta, _cRT], - [0, 0, 0, () => TagList, [0, 4]] - ]; - var CreateCustomModelDeploymentResponse = [3, n0, _CCMDRr, 0, [_cMDA], [0]]; - var CreateCustomModelRequest = [ - 3, - n0, - _CCMR, - 0, - [_mN, _mSC, _mKKA, _rA, _mTo, _cRT], - [0, () => ModelDataSource, 0, 0, () => TagList, [0, 4]] - ]; - var CreateCustomModelResponse = [3, n0, _CCMRr, 0, [_mA], [0]]; - var CreateEvaluationJobRequest = [ - 3, - n0, - _CEJR, - 0, - [_jN, _jD, _cRT, _rA, _cEKI, _jT, _aT, _eC, _iC, _oDC], - [ - 0, - [() => EvaluationJobDescription, 0], - [0, 4], - 0, - 0, - () => TagList, - 0, - [() => EvaluationConfig, 0], - [() => EvaluationInferenceConfig, 0], - () => EvaluationOutputDataConfig - ] - ]; - var CreateEvaluationJobResponse = [3, n0, _CEJRr, 0, [_jA], [0]]; - var CreateFoundationModelAgreementRequest = [3, n0, _CFMAR, 0, [_oT, _mIo], [0, 0]]; - var CreateFoundationModelAgreementResponse = [3, n0, _CFMARr, 0, [_mIo], [0]]; - var CreateGuardrailRequest = [ - 3, - n0, - _CGR, - 0, - [_n, _d, _tPC, _cPC, _wPC, _sIPC, _cGPC, _aRPC, _cRC, _bIM, _bOM, _kKI, _ta, _cRT], - [ - [() => GuardrailName, 0], - [() => GuardrailDescription, 0], - [() => GuardrailTopicPolicyConfig, 0], - [() => GuardrailContentPolicyConfig, 0], - [() => GuardrailWordPolicyConfig, 0], - () => GuardrailSensitiveInformationPolicyConfig, - [() => GuardrailContextualGroundingPolicyConfig, 0], - () => GuardrailAutomatedReasoningPolicyConfig, - () => GuardrailCrossRegionConfig, - [() => GuardrailBlockedMessaging, 0], - [() => GuardrailBlockedMessaging, 0], - 0, - () => TagList, - [0, 4] - ] - ]; - var CreateGuardrailResponse = [3, n0, _CGRr, 0, [_gI, _gA, _ve, _cA], [0, 0, 0, 5]]; - var CreateGuardrailVersionRequest = [ - 3, - n0, - _CGVR, - 0, - [_gIu, _d, _cRT], - [ - [0, 1], - [() => GuardrailDescription, 0], - [0, 4] - ] - ]; - var CreateGuardrailVersionResponse = [3, n0, _CGVRr, 0, [_gI, _ve], [0, 0]]; - var CreateInferenceProfileRequest = [ - 3, - n0, - _CIPR, - 0, - [_iPN, _d, _cRT, _mS, _ta], - [0, [() => InferenceProfileDescription, 0], [0, 4], () => InferenceProfileModelSource, () => TagList] - ]; - var CreateInferenceProfileResponse = [3, n0, _CIPRr, 0, [_iPA, _s], [0, 0]]; - var CreateMarketplaceModelEndpointRequest = [ - 3, - n0, - _CMMER, - 0, - [_mSI, _eCn, _aEc, _eN, _cRT, _ta], - [0, () => EndpointConfig, 2, 0, [0, 4], () => TagList] - ]; - var CreateMarketplaceModelEndpointResponse = [ - 3, - n0, - _CMMERr, - 0, - [_mME], - [() => MarketplaceModelEndpoint] - ]; - var CreateModelCopyJobRequest = [ - 3, - n0, - _CMCJR, - 0, - [_sMA, _tMN, _mKKI, _tMT, _cRT], - [0, 0, 0, () => TagList, [0, 4]] - ]; - var CreateModelCopyJobResponse = [3, n0, _CMCJRr, 0, [_jA], [0]]; - var CreateModelCustomizationJobRequest = [ - 3, - n0, - _CMCJRre, - 0, - [_jN, _cMN, _rA, _cRT, _bMI, _cTu, _cMKKI, _jT, _cMT, _tDC, _vDC, _oDC, _hP, _vCp, _cC], - [ - 0, - 0, - 0, - [0, 4], - 0, - 0, - 0, - () => TagList, - () => TagList, - [() => TrainingDataConfig, 0], - () => ValidationDataConfig, - () => OutputDataConfig, - 128 | 0, - () => VpcConfig, - () => CustomizationConfig - ] - ]; - var CreateModelCustomizationJobResponse = [3, n0, _CMCJRrea, 0, [_jA], [0]]; - var CreateModelImportJobRequest = [ - 3, - n0, - _CMIJR, - 0, - [_jN, _iMN, _rA, _mDS, _jT, _iMT, _cRT, _vCp, _iMKKI], - [0, 0, 0, () => ModelDataSource, () => TagList, () => TagList, 0, () => VpcConfig, 0] - ]; - var CreateModelImportJobResponse = [3, n0, _CMIJRr, 0, [_jA], [0]]; - var CreateModelInvocationJobRequest = [ - 3, - n0, - _CMIJRre, - 0, - [_jN, _rA, _cRT, _mIo, _iDC, _oDC, _vCp, _tDIH, _ta], - [ - 0, - 0, - [0, 4], - 0, - () => ModelInvocationJobInputDataConfig, - () => ModelInvocationJobOutputDataConfig, - () => VpcConfig, - 1, - () => TagList - ] - ]; - var CreateModelInvocationJobResponse = [3, n0, _CMIJRrea, 0, [_jA], [0]]; - var CreatePromptRouterRequest = [ - 3, - n0, - _CPRR, - 0, - [_cRT, _pRN, _mo, _d, _rCo, _fM, _ta], - [ - [0, 4], - 0, - () => PromptRouterTargetModels, - [() => PromptRouterDescription, 0], - () => RoutingCriteria, - () => PromptRouterTargetModel, - () => TagList - ] - ]; - var CreatePromptRouterResponse = [3, n0, _CPRRr, 0, [_pRA], [0]]; - var CreateProvisionedModelThroughputRequest = [ - 3, - n0, - _CPMTR, - 0, - [_cRT, _mU, _pMN, _mIo, _cD, _ta], - [[0, 4], 1, 0, 0, 0, () => TagList] - ]; - var CreateProvisionedModelThroughputResponse = [3, n0, _CPMTRr, 0, [_pMA], [0]]; - var CustomMetricBedrockEvaluatorModel = [3, n0, _CMBEM, 0, [_mI], [0]]; - var CustomMetricDefinition = [ - 3, - n0, - _CMD, - 8, - [_n, _in, _rS], - [[() => MetricName, 0], 0, () => RatingScale] - ]; - var CustomMetricEvaluatorModelConfig = [ - 3, - n0, - _CMEMC, - 0, - [_bEM], - [() => CustomMetricBedrockEvaluatorModels] - ]; - var CustomModelDeploymentSummary = [ - 3, - n0, - _CMDS, - 0, - [_cMDA, _cMDN, _mA, _cA, _s, _lUA, _fMa], - [0, 0, 0, 5, 0, 5, 0] - ]; - var CustomModelSummary = [ - 3, - n0, - _CMS, - 0, - [_mA, _mN, _cTr, _bMA, _bMN, _cTu, _oAI, _mSo], - [0, 0, 5, 0, 0, 0, 0, 0] - ]; - var CustomModelUnits = [3, n0, _CMU, 0, [_cMUPMC, _cMUV], [1, 0]]; - var DataProcessingDetails = [3, n0, _DPD, 0, [_s, _cTr, _lMT], [0, 5, 5]]; - var DeleteAutomatedReasoningPolicyBuildWorkflowRequest = [ - 3, - n0, - _DARPBWR, - 0, - [_pA, _bWI, _lUA], - [ - [0, 1], - [0, 1], - [ - 5, - { - [_hQ]: _uA - } - ] - ] - ]; - var DeleteAutomatedReasoningPolicyBuildWorkflowResponse = [3, n0, _DARPBWRe, 0, [], []]; - var DeleteAutomatedReasoningPolicyRequest = [ - 3, - n0, - _DARPR, - 0, - [_pA, _fo], - [ - [0, 1], - [ - 2, - { - [_hQ]: _fo - } - ] - ] - ]; - var DeleteAutomatedReasoningPolicyResponse = [3, n0, _DARPRe, 0, [], []]; - var DeleteAutomatedReasoningPolicyTestCaseRequest = [ - 3, - n0, - _DARPTCR, - 0, - [_pA, _tCI, _lUA], - [ - [0, 1], - [0, 1], - [ - 5, - { - [_hQ]: _uA - } - ] - ] - ]; - var DeleteAutomatedReasoningPolicyTestCaseResponse = [3, n0, _DARPTCRe, 0, [], []]; - var DeleteCustomModelDeploymentRequest = [3, n0, _DCMDR, 0, [_cMDI], [[0, 1]]]; - var DeleteCustomModelDeploymentResponse = [3, n0, _DCMDRe, 0, [], []]; - var DeleteCustomModelRequest = [3, n0, _DCMR, 0, [_mI], [[0, 1]]]; - var DeleteCustomModelResponse = [3, n0, _DCMRe, 0, [], []]; - var DeleteFoundationModelAgreementRequest = [3, n0, _DFMAR, 0, [_mIo], [0]]; - var DeleteFoundationModelAgreementResponse = [3, n0, _DFMARe, 0, [], []]; - var DeleteGuardrailRequest = [ - 3, - n0, - _DGR, - 0, - [_gIu, _gV], - [ - [0, 1], - [ - 0, - { - [_hQ]: _gV - } - ] - ] - ]; - var DeleteGuardrailResponse = [3, n0, _DGRe, 0, [], []]; - var DeleteImportedModelRequest = [3, n0, _DIMR, 0, [_mI], [[0, 1]]]; - var DeleteImportedModelResponse = [3, n0, _DIMRe, 0, [], []]; - var DeleteInferenceProfileRequest = [3, n0, _DIPR, 0, [_iPI], [[0, 1]]]; - var DeleteInferenceProfileResponse = [3, n0, _DIPRe, 0, [], []]; - var DeleteMarketplaceModelEndpointRequest = [3, n0, _DMMER, 0, [_eA], [[0, 1]]]; - var DeleteMarketplaceModelEndpointResponse = [3, n0, _DMMERe, 0, [], []]; - var DeleteModelInvocationLoggingConfigurationRequest = [3, n0, _DMILCR, 0, [], []]; - var DeleteModelInvocationLoggingConfigurationResponse = [3, n0, _DMILCRe, 0, [], []]; - var DeletePromptRouterRequest = [3, n0, _DPRR, 0, [_pRA], [[0, 1]]]; - var DeletePromptRouterResponse = [3, n0, _DPRRe, 0, [], []]; - var DeleteProvisionedModelThroughputRequest = [3, n0, _DPMTR, 0, [_pMI], [[0, 1]]]; - var DeleteProvisionedModelThroughputResponse = [3, n0, _DPMTRe, 0, [], []]; - var DeregisterMarketplaceModelEndpointRequest = [3, n0, _DMMERer, 0, [_eA], [[0, 1]]]; - var DeregisterMarketplaceModelEndpointResponse = [3, n0, _DMMERere, 0, [], []]; - var DimensionalPriceRate = [3, n0, _DPR, 0, [_di, _pr, _d, _u], [0, 0, 0, 0]]; - var DistillationConfig = [3, n0, _DC, 0, [_tMC], [() => TeacherModelConfig]]; - var EvaluationBedrockModel = [ - 3, - n0, - _EBM, - 0, - [_mI, _iP, _pC], - [0, [() => EvaluationModelInferenceParams, 0], () => PerformanceConfiguration] - ]; - var EvaluationDataset = [ - 3, - n0, - _ED, - 0, - [_n, _dL], - [[() => EvaluationDatasetName, 0], () => EvaluationDatasetLocation] - ]; - var EvaluationDatasetMetricConfig = [ - 3, - n0, - _EDMC, - 0, - [_tT, _dat, _mNe], - [0, [() => EvaluationDataset, 0], [() => EvaluationMetricNames, 0]] - ]; - var EvaluationInferenceConfigSummary = [ - 3, - n0, - _EICS, - 0, - [_mCS, _rCS], - [() => EvaluationModelConfigSummary, () => EvaluationRagConfigSummary] - ]; - var EvaluationModelConfigSummary = [3, n0, _EMCS, 0, [_bMIe, _pISI], [64 | 0, 64 | 0]]; - var EvaluationOutputDataConfig = [3, n0, _EODC, 0, [_sU], [0]]; - var EvaluationPrecomputedInferenceSource = [3, n0, _EPIS, 0, [_iSI], [0]]; - var EvaluationPrecomputedRetrieveAndGenerateSourceConfig = [ - 3, - n0, - _EPRAGSC, - 0, - [_rSI], - [0] - ]; - var EvaluationPrecomputedRetrieveSourceConfig = [3, n0, _EPRSC, 0, [_rSI], [0]]; - var EvaluationRagConfigSummary = [3, n0, _ERCS, 0, [_bKBI, _pRSI], [64 | 0, 64 | 0]]; - var EvaluationSummary = [ - 3, - n0, - _ES, - 0, - [_jA, _jN, _s, _cTr, _jTo, _eTT, _mIod, _rIa, _eMI, _cMEMI, _iCS, _aT], - [0, 0, 0, 5, 0, 64 | 0, 64 | 0, 64 | 0, 64 | 0, 64 | 0, () => EvaluationInferenceConfigSummary, 0] - ]; - var ExportAutomatedReasoningPolicyVersionRequest = [3, n0, _EARPVR, 0, [_pA], [[0, 1]]]; - var ExportAutomatedReasoningPolicyVersionResponse = [ - 3, - n0, - _EARPVRx, - 0, - [_pD], - [[() => AutomatedReasoningPolicyDefinition, 16]] - ]; - var ExternalSource = [ - 3, - n0, - _ESx, - 0, - [_sT, _sL, _bC], - [0, () => S3ObjectDoc, [() => ByteContentDoc, 0]] - ]; - var ExternalSourcesGenerationConfiguration = [ - 3, - n0, - _ESGC, - 0, - [_pT, _gCu, _kIC, _aMRF], - [[() => PromptTemplate, 0], () => GuardrailConfiguration, () => KbInferenceConfig, 128 | 15] - ]; - var ExternalSourcesRetrieveAndGenerateConfiguration = [ - 3, - n0, - _ESRAGC, - 0, - [_mA, _so, _gCe], - [0, [() => ExternalSources, 0], [() => ExternalSourcesGenerationConfiguration, 0]] - ]; - var FieldForReranking = [3, n0, _FFR, 0, [_fN], [0]]; - var FilterAttribute = [3, n0, _FA, 0, [_k, _va], [0, 15]]; - var FoundationModelDetails = [ - 3, - n0, - _FMD, - 0, - [_mA, _mIo, _mN, _pN, _iM, _oM, _rSS, _cS, _iTS, _mL], - [0, 0, 0, 0, 64 | 0, 64 | 0, 2, 64 | 0, 64 | 0, () => FoundationModelLifecycle] - ]; - var FoundationModelLifecycle = [3, n0, _FML, 0, [_s], [0]]; - var FoundationModelSummary = [ - 3, - n0, - _FMS, - 0, - [_mA, _mIo, _mN, _pN, _iM, _oM, _rSS, _cS, _iTS, _mL], - [0, 0, 0, 0, 64 | 0, 64 | 0, 2, 64 | 0, 64 | 0, () => FoundationModelLifecycle] - ]; - var GenerationConfiguration = [ - 3, - n0, - _GC, - 0, - [_pT, _gCu, _kIC, _aMRF], - [[() => PromptTemplate, 0], () => GuardrailConfiguration, () => KbInferenceConfig, 128 | 15] - ]; - var GetAutomatedReasoningPolicyAnnotationsRequest = [ - 3, - n0, - _GARPAR, - 0, - [_pA, _bWI], - [ - [0, 1], - [0, 1] - ] - ]; - var GetAutomatedReasoningPolicyAnnotationsResponse = [ - 3, - n0, - _GARPARe, - 0, - [_pA, _n, _bWI, _an, _aSH, _uA], - [0, [() => AutomatedReasoningPolicyName, 0], 0, [() => AutomatedReasoningPolicyAnnotationList, 0], 0, 5] - ]; - var GetAutomatedReasoningPolicyBuildWorkflowRequest = [ - 3, - n0, - _GARPBWR, - 0, - [_pA, _bWI], - [ - [0, 1], - [0, 1] - ] - ]; - var GetAutomatedReasoningPolicyBuildWorkflowResponse = [ - 3, - n0, - _GARPBWRe, - 0, - [_pA, _bWI, _s, _bWT, _dN, _dCT, _dD, _cA, _uA], - [ - 0, - 0, - 0, - 0, - [() => AutomatedReasoningPolicyBuildDocumentName, 0], - 0, - [() => AutomatedReasoningPolicyBuildDocumentDescription, 0], - 5, - 5 - ] - ]; - var GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest = [ - 3, - n0, - _GARPBWRAR, - 0, - [_pA, _bWI, _aTs], - [ - [0, 1], - [0, 1], - [ - 0, - { - [_hQ]: _aTs - } - ] - ] - ]; - var GetAutomatedReasoningPolicyBuildWorkflowResultAssetsResponse = [ - 3, - n0, - _GARPBWRARe, - 0, - [_pA, _bWI, _bWA], - [0, 0, [() => AutomatedReasoningPolicyBuildResultAssets, 0]] - ]; - var GetAutomatedReasoningPolicyNextScenarioRequest = [ - 3, - n0, - _GARPNSR, - 0, - [_pA, _bWI], - [ - [0, 1], - [0, 1] - ] - ]; - var GetAutomatedReasoningPolicyNextScenarioResponse = [ - 3, - n0, - _GARPNSRe, - 0, - [_pA, _sc], - [0, [() => AutomatedReasoningPolicyScenario, 0]] - ]; - var GetAutomatedReasoningPolicyRequest = [3, n0, _GARPR, 0, [_pA], [[0, 1]]]; - var GetAutomatedReasoningPolicyResponse = [ - 3, - n0, - _GARPRe, - 0, - [_pA, _n, _ve, _pI, _d, _dH, _kKA, _cA, _uA], - [0, [() => AutomatedReasoningPolicyName, 0], 0, 0, [() => AutomatedReasoningPolicyDescription, 0], 0, 0, 5, 5] - ]; - var GetAutomatedReasoningPolicyTestCaseRequest = [ - 3, - n0, - _GARPTCR, - 0, - [_pA, _tCI], - [ - [0, 1], - [0, 1] - ] - ]; - var GetAutomatedReasoningPolicyTestCaseResponse = [ - 3, - n0, - _GARPTCRe, - 0, - [_pA, _tCe], - [0, [() => AutomatedReasoningPolicyTestCase, 0]] - ]; - var GetAutomatedReasoningPolicyTestResultRequest = [ - 3, - n0, - _GARPTRR, - 0, - [_pA, _bWI, _tCI], - [ - [0, 1], - [0, 1], - [0, 1] - ] - ]; - var GetAutomatedReasoningPolicyTestResultResponse = [ - 3, - n0, - _GARPTRRe, - 0, - [_tR], - [[() => AutomatedReasoningPolicyTestResult, 0]] - ]; - var GetCustomModelDeploymentRequest = [3, n0, _GCMDR, 0, [_cMDI], [[0, 1]]]; - var GetCustomModelDeploymentResponse = [ - 3, - n0, - _GCMDRe, - 0, - [_cMDA, _mDN, _mA, _cA, _s, _d, _fMa, _lUA], - [0, 0, 0, 5, 0, 0, 0, 5] - ]; - var GetCustomModelRequest = [3, n0, _GCMR, 0, [_mI], [[0, 1]]]; - var GetCustomModelResponse = [ - 3, - n0, - _GCMRe, - 0, - [_mA, _mN, _jN, _jA, _bMA, _cTu, _mKKA, _hP, _tDC, _vDC, _oDC, _tM, _vM, _cTr, _cC, _mSo, _fMa], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 128 | 0, - [() => TrainingDataConfig, 0], - () => ValidationDataConfig, - () => OutputDataConfig, - () => TrainingMetrics, - () => ValidationMetrics, - 5, - () => CustomizationConfig, - 0, - 0 - ] - ]; - var GetEvaluationJobRequest = [ - 3, - n0, - _GEJR, - 0, - [_jI], - [[() => EvaluationJobIdentifier, 1]] - ]; - var GetEvaluationJobResponse = [ - 3, - n0, - _GEJRe, - 0, - [_jN, _s, _jA, _jD, _rA, _cEKI, _jTo, _aT, _eC, _iC, _oDC, _cTr, _lMT, _fMai], - [ - 0, - 0, - 0, - [() => EvaluationJobDescription, 0], - 0, - 0, - 0, - 0, - [() => EvaluationConfig, 0], - [() => EvaluationInferenceConfig, 0], - () => EvaluationOutputDataConfig, - 5, - 5, - 64 | 0 - ] - ]; - var GetFoundationModelAvailabilityRequest = [3, n0, _GFMAR, 0, [_mIo], [[0, 1]]]; - var GetFoundationModelAvailabilityResponse = [ - 3, - n0, - _GFMARe, - 0, - [_mIo, _aA, _aS, _eAn, _rAe], - [0, () => AgreementAvailability, 0, 0, 0] - ]; - var GetFoundationModelRequest = [3, n0, _GFMR, 0, [_mI], [[0, 1]]]; - var GetFoundationModelResponse = [ - 3, - n0, - _GFMRe, - 0, - [_mD], - [() => FoundationModelDetails] - ]; - var GetGuardrailRequest = [ - 3, - n0, - _GGR, - 0, - [_gIu, _gV], - [ - [0, 1], - [ - 0, - { - [_hQ]: _gV - } - ] - ] - ]; - var GetGuardrailResponse = [ - 3, - n0, - _GGRe, - 0, - [_n, _d, _gI, _gA, _ve, _s, _tP, _cP, _wP, _sIP, _cGP, _aRP, _cRD, _cA, _uA, _sRt, _fR, _bIM, _bOM, _kKA], - [ - [() => GuardrailName, 0], - [() => GuardrailDescription, 0], - 0, - 0, - 0, - 0, - [() => GuardrailTopicPolicy, 0], - [() => GuardrailContentPolicy, 0], - [() => GuardrailWordPolicy, 0], - () => GuardrailSensitiveInformationPolicy, - [() => GuardrailContextualGroundingPolicy, 0], - () => GuardrailAutomatedReasoningPolicy, - () => GuardrailCrossRegionDetails, - 5, - 5, - [() => GuardrailStatusReasons, 0], - [() => GuardrailFailureRecommendations, 0], - [() => GuardrailBlockedMessaging, 0], - [() => GuardrailBlockedMessaging, 0], - 0 - ] - ]; - var GetImportedModelRequest = [3, n0, _GIMR, 0, [_mI], [[0, 1]]]; - var GetImportedModelResponse = [ - 3, - n0, - _GIMRe, - 0, - [_mA, _mN, _jN, _jA, _mDS, _cTr, _mAo, _mKKA, _iS, _cMU], - [0, 0, 0, 0, () => ModelDataSource, 5, 0, 0, 2, () => CustomModelUnits] - ]; - var GetInferenceProfileRequest = [3, n0, _GIPR, 0, [_iPI], [[0, 1]]]; - var GetInferenceProfileResponse = [ - 3, - n0, - _GIPRe, - 0, - [_iPN, _d, _cA, _uA, _iPA, _mo, _iPIn, _s, _ty], - [0, [() => InferenceProfileDescription, 0], 5, 5, 0, () => InferenceProfileModels, 0, 0, 0] - ]; - var GetMarketplaceModelEndpointRequest = [3, n0, _GMMER, 0, [_eA], [[0, 1]]]; - var GetMarketplaceModelEndpointResponse = [ - 3, - n0, - _GMMERe, - 0, - [_mME], - [() => MarketplaceModelEndpoint] - ]; - var GetModelCopyJobRequest = [3, n0, _GMCJR, 0, [_jA], [[0, 1]]]; - var GetModelCopyJobResponse = [ - 3, - n0, - _GMCJRe, - 0, - [_jA, _s, _cTr, _tMA, _tMN, _sAI, _sMA, _tMKKA, _tMT, _fMa, _sMN], - [0, 0, 5, 0, 0, 0, 0, 0, () => TagList, 0, 0] - ]; - var GetModelCustomizationJobRequest = [3, n0, _GMCJRet, 0, [_jI], [[0, 1]]]; - var GetModelCustomizationJobResponse = [ - 3, - n0, - _GMCJReto, - 0, - [ - _jA, - _jN, - _oMN, - _oMA, - _cRT, - _rA, - _s, - _sD, - _fMa, - _cTr, - _lMT, - _eT, - _bMA, - _hP, - _tDC, - _vDC, - _oDC, - _cTu, - _oMKKA, - _tM, - _vM, - _vCp, - _cC - ], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - () => StatusDetails, - 0, - 5, - 5, - 5, - 0, - 128 | 0, - [() => TrainingDataConfig, 0], - () => ValidationDataConfig, - () => OutputDataConfig, - 0, - 0, - () => TrainingMetrics, - () => ValidationMetrics, - () => VpcConfig, - () => CustomizationConfig - ] - ]; - var GetModelImportJobRequest = [3, n0, _GMIJR, 0, [_jI], [[0, 1]]]; - var GetModelImportJobResponse = [ - 3, - n0, - _GMIJRe, - 0, - [_jA, _jN, _iMN, _iMA, _rA, _mDS, _s, _fMa, _cTr, _lMT, _eT, _vCp, _iMKKA], - [0, 0, 0, 0, 0, () => ModelDataSource, 0, 0, 5, 5, 5, () => VpcConfig, 0] - ]; - var GetModelInvocationJobRequest = [3, n0, _GMIJRet, 0, [_jI], [[0, 1]]]; - var GetModelInvocationJobResponse = [ - 3, - n0, - _GMIJReto, - 0, - [_jA, _jN, _mIo, _cRT, _rA, _s, _m, _sTu, _lMT, _eT, _iDC, _oDC, _vCp, _tDIH, _jET], - [ - 0, - 0, - 0, - 0, - 0, - 0, - [() => Message, 0], - 5, - 5, - 5, - () => ModelInvocationJobInputDataConfig, - () => ModelInvocationJobOutputDataConfig, - () => VpcConfig, - 1, - 5 - ] - ]; - var GetModelInvocationLoggingConfigurationRequest = [3, n0, _GMILCR, 0, [], []]; - var GetModelInvocationLoggingConfigurationResponse = [ - 3, - n0, - _GMILCRe, - 0, - [_lC], - [() => LoggingConfig] - ]; - var GetPromptRouterRequest = [3, n0, _GPRR, 0, [_pRA], [[0, 1]]]; - var GetPromptRouterResponse = [ - 3, - n0, - _GPRRe, - 0, - [_pRN, _rCo, _d, _cA, _uA, _pRA, _mo, _fM, _s, _ty], - [ - 0, - () => RoutingCriteria, - [() => PromptRouterDescription, 0], - 5, - 5, - 0, - () => PromptRouterTargetModels, - () => PromptRouterTargetModel, - 0, - 0 - ] - ]; - var GetProvisionedModelThroughputRequest = [3, n0, _GPMTR, 0, [_pMI], [[0, 1]]]; - var GetProvisionedModelThroughputResponse = [ - 3, - n0, - _GPMTRe, - 0, - [_mU, _dMU, _pMN, _pMA, _mA, _dMA, _fMA, _s, _cTr, _lMT, _fMa, _cD, _cET], - [1, 1, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 5] - ]; - var GetUseCaseForModelAccessRequest = [3, n0, _GUCFMAR, 0, [], []]; - var GetUseCaseForModelAccessResponse = [3, n0, _GUCFMARe, 0, [_fD], [21]]; - var GuardrailAutomatedReasoningPolicy = [3, n0, _GARP, 0, [_po, _cT], [64 | 0, 1]]; - var GuardrailAutomatedReasoningPolicyConfig = [3, n0, _GARPC, 0, [_po, _cT], [64 | 0, 1]]; - var GuardrailConfiguration = [3, n0, _GCu, 0, [_gI, _gV], [0, 0]]; - var GuardrailContentFilter = [ - 3, - n0, - _GCF, - 0, - [_ty, _iSn, _oS, _iM, _oM, _iA, _oA, _iE, _oE], - [ - 0, - 0, - 0, - [() => GuardrailModalities, 0], - [() => GuardrailModalities, 0], - [() => GuardrailContentFilterAction$1, 0], - [() => GuardrailContentFilterAction$1, 0], - 2, - 2 - ] - ]; - var GuardrailContentFilterConfig = [ - 3, - n0, - _GCFC, - 0, - [_ty, _iSn, _oS, _iM, _oM, _iA, _oA, _iE, _oE], - [ - 0, - 0, - 0, - [() => GuardrailModalities, 0], - [() => GuardrailModalities, 0], - [() => GuardrailContentFilterAction$1, 0], - [() => GuardrailContentFilterAction$1, 0], - 2, - 2 - ] - ]; - var GuardrailContentFiltersTier = [ - 3, - n0, - _GCFT, - 0, - [_tNi], - [[() => GuardrailContentFiltersTierName$1, 0]] - ]; - var GuardrailContentFiltersTierConfig = [ - 3, - n0, - _GCFTC, - 0, - [_tNi], - [[() => GuardrailContentFiltersTierName$1, 0]] - ]; - var GuardrailContentPolicy = [ - 3, - n0, - _GCP, - 0, - [_fi, _ti], - [ - [() => GuardrailContentFilters, 0], - [() => GuardrailContentFiltersTier, 0] - ] - ]; - var GuardrailContentPolicyConfig = [ - 3, - n0, - _GCPC, - 0, - [_fC, _tCi], - [ - [() => GuardrailContentFiltersConfig, 0], - [() => GuardrailContentFiltersTierConfig, 0] - ] - ]; - var GuardrailContextualGroundingFilter = [ - 3, - n0, - _GCGF, - 0, - [_ty, _th, _ac, _ena], - [0, 1, [() => GuardrailContextualGroundingAction$1, 0], 2] - ]; - var GuardrailContextualGroundingFilterConfig = [ - 3, - n0, - _GCGFC, - 0, - [_ty, _th, _ac, _ena], - [0, 1, [() => GuardrailContextualGroundingAction$1, 0], 2] - ]; - var GuardrailContextualGroundingPolicy = [ - 3, - n0, - _GCGP, - 0, - [_fi], - [[() => GuardrailContextualGroundingFilters, 0]] - ]; - var GuardrailContextualGroundingPolicyConfig = [ - 3, - n0, - _GCGPC, - 0, - [_fC], - [[() => GuardrailContextualGroundingFiltersConfig, 0]] - ]; - var GuardrailCrossRegionConfig = [3, n0, _GCRC, 0, [_gPI], [0]]; - var GuardrailCrossRegionDetails = [3, n0, _GCRD, 0, [_gPIu, _gPA], [0, 0]]; - var GuardrailManagedWords = [ - 3, - n0, - _GMW, - 0, - [_ty, _iA, _oA, _iE, _oE], - [0, [() => GuardrailWordAction$1, 0], [() => GuardrailWordAction$1, 0], 2, 2] - ]; - var GuardrailManagedWordsConfig = [ - 3, - n0, - _GMWC, - 0, - [_ty, _iA, _oA, _iE, _oE], - [0, [() => GuardrailWordAction$1, 0], [() => GuardrailWordAction$1, 0], 2, 2] - ]; - var GuardrailPiiEntity = [ - 3, - n0, - _GPE, - 0, - [_ty, _ac, _iA, _oA, _iE, _oE], - [0, 0, 0, 0, 2, 2] - ]; - var GuardrailPiiEntityConfig = [ - 3, - n0, - _GPEC, - 0, - [_ty, _ac, _iA, _oA, _iE, _oE], - [0, 0, 0, 0, 2, 2] - ]; - var GuardrailRegex = [ - 3, - n0, - _GR, - 0, - [_n, _d, _pa, _ac, _iA, _oA, _iE, _oE], - [0, 0, 0, 0, 0, 0, 2, 2] - ]; - var GuardrailRegexConfig = [ - 3, - n0, - _GRC, - 0, - [_n, _d, _pa, _ac, _iA, _oA, _iE, _oE], - [0, 0, 0, 0, 0, 0, 2, 2] - ]; - var GuardrailSensitiveInformationPolicy = [ - 3, - n0, - _GSIP, - 0, - [_pEi, _re], - [() => GuardrailPiiEntities, () => GuardrailRegexes] - ]; - var GuardrailSensitiveInformationPolicyConfig = [ - 3, - n0, - _GSIPC, - 0, - [_pEC, _rCe], - [() => GuardrailPiiEntitiesConfig, () => GuardrailRegexesConfig] - ]; - var GuardrailSummary = [ - 3, - n0, - _GS, - 0, - [_i, _ar, _s, _n, _d, _ve, _cA, _uA, _cRD], - [0, 0, 0, [() => GuardrailName, 0], [() => GuardrailDescription, 0], 0, 5, 5, () => GuardrailCrossRegionDetails] - ]; - var GuardrailTopic = [ - 3, - n0, - _GT, - 0, - [_n, _de, _exa, _ty, _iA, _oA, _iE, _oE], - [ - [() => GuardrailTopicName, 0], - [() => GuardrailTopicDefinition, 0], - [() => GuardrailTopicExamples, 0], - 0, - [() => GuardrailTopicAction$1, 0], - [() => GuardrailTopicAction$1, 0], - 2, - 2 - ] - ]; - var GuardrailTopicConfig = [ - 3, - n0, - _GTC, - 0, - [_n, _de, _exa, _ty, _iA, _oA, _iE, _oE], - [ - [() => GuardrailTopicName, 0], - [() => GuardrailTopicDefinition, 0], - [() => GuardrailTopicExamples, 0], - 0, - [() => GuardrailTopicAction$1, 0], - [() => GuardrailTopicAction$1, 0], - 2, - 2 - ] - ]; - var GuardrailTopicPolicy = [ - 3, - n0, - _GTP, - 0, - [_to, _ti], - [ - [() => GuardrailTopics, 0], - [() => GuardrailTopicsTier, 0] - ] - ]; - var GuardrailTopicPolicyConfig = [ - 3, - n0, - _GTPC, - 0, - [_tCo, _tCi], - [ - [() => GuardrailTopicsConfig, 0], - [() => GuardrailTopicsTierConfig, 0] - ] - ]; - var GuardrailTopicsTier = [3, n0, _GTT, 0, [_tNi], [[() => GuardrailTopicsTierName$1, 0]]]; - var GuardrailTopicsTierConfig = [ - 3, - n0, - _GTTC, - 0, - [_tNi], - [[() => GuardrailTopicsTierName$1, 0]] - ]; - var GuardrailWord = [ - 3, - n0, - _GW, - 0, - [_te, _iA, _oA, _iE, _oE], - [0, [() => GuardrailWordAction$1, 0], [() => GuardrailWordAction$1, 0], 2, 2] - ]; - var GuardrailWordConfig = [ - 3, - n0, - _GWC, - 0, - [_te, _iA, _oA, _iE, _oE], - [0, [() => GuardrailWordAction$1, 0], [() => GuardrailWordAction$1, 0], 2, 2] - ]; - var GuardrailWordPolicy = [ - 3, - n0, - _GWP, - 0, - [_w, _mWL], - [ - [() => GuardrailWords, 0], - [() => GuardrailManagedWordLists, 0] - ] - ]; - var GuardrailWordPolicyConfig = [ - 3, - n0, - _GWPC, - 0, - [_wCo, _mWLC], - [ - [() => GuardrailWordsConfig, 0], - [() => GuardrailManagedWordListsConfig, 0] - ] - ]; - var HumanEvaluationConfig = [ - 3, - n0, - _HEC, - 0, - [_hWC, _cM, _dMC], - [ - [() => HumanWorkflowConfig, 0], - [() => HumanEvaluationCustomMetrics, 0], - [() => EvaluationDatasetMetricConfigs, 0] - ] - ]; - var HumanEvaluationCustomMetric = [ - 3, - n0, - _HECM, - 0, - [_n, _d, _rM], - [[() => EvaluationMetricName, 0], [() => EvaluationMetricDescription, 0], 0] - ]; - var HumanWorkflowConfig = [ - 3, - n0, - _HWC, - 0, - [_fDA, _in], - [0, [() => HumanTaskInstructions, 0]] - ]; - var ImplicitFilterConfiguration = [ - 3, - n0, - _IFC, - 0, - [_mAe, _mA], - [[() => MetadataAttributeSchemaList, 0], 0] - ]; - var ImportedModelSummary = [3, n0, _IMS, 0, [_mA, _mN, _cTr, _iS, _mAo], [0, 0, 5, 2, 0]]; - var InferenceProfileModel = [3, n0, _IPM, 0, [_mA], [0]]; - var InferenceProfileSummary = [ - 3, - n0, - _IPS, - 0, - [_iPN, _d, _cA, _uA, _iPA, _mo, _iPIn, _s, _ty], - [0, [() => InferenceProfileDescription, 0], 5, 5, 0, () => InferenceProfileModels, 0, 0, 0] - ]; - var InternalServerException = [ - -3, - n0, - _ISE, - { - [_e]: _se, - [_hE]: 500 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1); - var InvocationLogsConfig = [ - 3, - n0, - _ILC, - 0, - [_uPR, _iLS, _rMF], - [2, () => InvocationLogSource, [() => RequestMetadataFilters, 0]] - ]; - var KbInferenceConfig = [3, n0, _KIC, 0, [_tIC], [() => TextInferenceConfig]]; - var KnowledgeBaseRetrievalConfiguration = [ - 3, - n0, - _KBRC, - 0, - [_vSC], - [[() => KnowledgeBaseVectorSearchConfiguration, 0]] - ]; - var KnowledgeBaseRetrieveAndGenerateConfiguration = [ - 3, - n0, - _KBRAGC, - 0, - [_kBI, _mA, _rCet, _gCe, _oC], - [ - 0, - 0, - [() => KnowledgeBaseRetrievalConfiguration, 0], - [() => GenerationConfiguration, 0], - () => OrchestrationConfiguration - ] - ]; - var KnowledgeBaseVectorSearchConfiguration = [ - 3, - n0, - _KBVSC, - 0, - [_nOR, _oST, _fil, _iFC, _rCer], - [ - 1, - 0, - [() => RetrievalFilter, 0], - [() => ImplicitFilterConfiguration, 0], - [() => VectorSearchRerankingConfiguration, 0] - ] - ]; - var LegalTerm = [3, n0, _LT, 0, [_ur], [0]]; - var ListAutomatedReasoningPoliciesRequest = [ - 3, - n0, - _LARPR, - 0, - [_pA, _nT, _mR], - [ - [ - 0, - { - [_hQ]: _pA - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 1, - { - [_hQ]: _mR - } - ] - ] - ]; - var ListAutomatedReasoningPoliciesResponse = [ - 3, - n0, - _LARPRi, - 0, - [_aRPS, _nT], - [[() => AutomatedReasoningPolicySummaries, 0], 0] - ]; - var ListAutomatedReasoningPolicyBuildWorkflowsRequest = [ - 3, - n0, - _LARPBWR, - 0, - [_pA, _nT, _mR], - [ - [0, 1], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 1, - { - [_hQ]: _mR - } - ] - ] - ]; - var ListAutomatedReasoningPolicyBuildWorkflowsResponse = [ - 3, - n0, - _LARPBWRi, - 0, - [_aRPBWS, _nT], - [() => AutomatedReasoningPolicyBuildWorkflowSummaries, 0] - ]; - var ListAutomatedReasoningPolicyTestCasesRequest = [ - 3, - n0, - _LARPTCR, - 0, - [_pA, _nT, _mR], - [ - [0, 1], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 1, - { - [_hQ]: _mR - } - ] - ] - ]; - var ListAutomatedReasoningPolicyTestCasesResponse = [ - 3, - n0, - _LARPTCRi, - 0, - [_tCes, _nT], - [[() => AutomatedReasoningPolicyTestCaseList, 0], 0] - ]; - var ListAutomatedReasoningPolicyTestResultsRequest = [ - 3, - n0, - _LARPTRR, - 0, - [_pA, _bWI, _nT, _mR], - [ - [0, 1], - [0, 1], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 1, - { - [_hQ]: _mR - } - ] - ] - ]; - var ListAutomatedReasoningPolicyTestResultsResponse = [ - 3, - n0, - _LARPTRRi, - 0, - [_tRe, _nT], - [[() => AutomatedReasoningPolicyTestList, 0], 0] - ]; - var ListCustomModelDeploymentsRequest = [ - 3, - n0, - _LCMDR, - 0, - [_cB, _cAr, _nC, _mR, _nT, _sB, _sO, _sEt, _mAE], - [ - [ - 5, - { - [_hQ]: _cB - } - ], - [ - 5, - { - [_hQ]: _cAr - } - ], - [ - 0, - { - [_hQ]: _nC - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ], - [ - 0, - { - [_hQ]: _sEt - } - ], - [ - 0, - { - [_hQ]: _mAE - } - ] - ] - ]; - var ListCustomModelDeploymentsResponse = [ - 3, - n0, - _LCMDRi, - 0, - [_nT, _mDSo], - [0, () => CustomModelDeploymentSummaryList] - ]; - var ListCustomModelsRequest = [ - 3, - n0, - _LCMR, - 0, - [_cTB, _cTA, _nC, _bMAE, _fMAE, _mR, _nT, _sB, _sO, _iO, _mSo], - [ - [ - 5, - { - [_hQ]: _cTB - } - ], - [ - 5, - { - [_hQ]: _cTA - } - ], - [ - 0, - { - [_hQ]: _nC - } - ], - [ - 0, - { - [_hQ]: _bMAE - } - ], - [ - 0, - { - [_hQ]: _fMAE - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ], - [ - 2, - { - [_hQ]: _iO - } - ], - [ - 0, - { - [_hQ]: _mSo - } - ] - ] - ]; - var ListCustomModelsResponse = [ - 3, - n0, - _LCMRi, - 0, - [_nT, _mSod], - [0, () => CustomModelSummaryList] - ]; - var ListEvaluationJobsRequest = [ - 3, - n0, - _LEJR, - 0, - [_cTA, _cTB, _sEt, _aTE, _nC, _mR, _nT, _sB, _sO], - [ - [ - 5, - { - [_hQ]: _cTA - } - ], - [ - 5, - { - [_hQ]: _cTB - } - ], - [ - 0, - { - [_hQ]: _sEt - } - ], - [ - 0, - { - [_hQ]: _aTE - } - ], - [ - 0, - { - [_hQ]: _nC - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ] - ] - ]; - var ListEvaluationJobsResponse = [ - 3, - n0, - _LEJRi, - 0, - [_nT, _jSo], - [0, () => EvaluationSummaries] - ]; - var ListFoundationModelAgreementOffersRequest = [ - 3, - n0, - _LFMAOR, - 0, - [_mIo, _oTf], - [ - [0, 1], - [ - 0, - { - [_hQ]: _oTf - } - ] - ] - ]; - var ListFoundationModelAgreementOffersResponse = [ - 3, - n0, - _LFMAORi, - 0, - [_mIo, _of], - [0, () => Offers] - ]; - var ListFoundationModelsRequest = [ - 3, - n0, - _LFMR, - 0, - [_bP, _bCT, _bOMy, _bIT], - [ - [ - 0, - { - [_hQ]: _bP - } - ], - [ - 0, - { - [_hQ]: _bCT - } - ], - [ - 0, - { - [_hQ]: _bOMy - } - ], - [ - 0, - { - [_hQ]: _bIT - } - ] - ] - ]; - var ListFoundationModelsResponse = [ - 3, - n0, - _LFMRi, - 0, - [_mSod], - [() => FoundationModelSummaryList] - ]; - var ListGuardrailsRequest = [ - 3, - n0, - _LGR, - 0, - [_gIu, _mR, _nT], - [ - [ - 0, - { - [_hQ]: _gIu - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ] - ] - ]; - var ListGuardrailsResponse = [ - 3, - n0, - _LGRi, - 0, - [_g, _nT], - [[() => GuardrailSummaries, 0], 0] - ]; - var ListImportedModelsRequest = [ - 3, - n0, - _LIMR, - 0, - [_cTB, _cTA, _nC, _mR, _nT, _sB, _sO], - [ - [ - 5, - { - [_hQ]: _cTB - } - ], - [ - 5, - { - [_hQ]: _cTA - } - ], - [ - 0, - { - [_hQ]: _nC - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ] - ] - ]; - var ListImportedModelsResponse = [ - 3, - n0, - _LIMRi, - 0, - [_nT, _mSod], - [0, () => ImportedModelSummaryList] - ]; - var ListInferenceProfilesRequest = [ - 3, - n0, - _LIPR, - 0, - [_mR, _nT, _tE], - [ - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _ty - } - ] - ] - ]; - var ListInferenceProfilesResponse = [ - 3, - n0, - _LIPRi, - 0, - [_iPS, _nT], - [[() => InferenceProfileSummaries, 0], 0] - ]; - var ListMarketplaceModelEndpointsRequest = [ - 3, - n0, - _LMMER, - 0, - [_mR, _nT, _mSE], - [ - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _mSI - } - ] - ] - ]; - var ListMarketplaceModelEndpointsResponse = [ - 3, - n0, - _LMMERi, - 0, - [_mMEa, _nT], - [() => MarketplaceModelEndpointSummaries, 0] - ]; - var ListModelCopyJobsRequest = [ - 3, - n0, - _LMCJR, - 0, - [_cTA, _cTB, _sEt, _sAE, _sMAE, _tMNC, _mR, _nT, _sB, _sO], - [ - [ - 5, - { - [_hQ]: _cTA - } - ], - [ - 5, - { - [_hQ]: _cTB - } - ], - [ - 0, - { - [_hQ]: _sEt - } - ], - [ - 0, - { - [_hQ]: _sAE - } - ], - [ - 0, - { - [_hQ]: _sMAE - } - ], - [ - 0, - { - [_hQ]: _oMNC - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ] - ] - ]; - var ListModelCopyJobsResponse = [ - 3, - n0, - _LMCJRi, - 0, - [_nT, _mCJS], - [0, () => ModelCopyJobSummaries] - ]; - var ListModelCustomizationJobsRequest = [ - 3, - n0, - _LMCJRis, - 0, - [_cTA, _cTB, _sEt, _nC, _mR, _nT, _sB, _sO], - [ - [ - 5, - { - [_hQ]: _cTA - } - ], - [ - 5, - { - [_hQ]: _cTB - } - ], - [ - 0, - { - [_hQ]: _sEt - } - ], - [ - 0, - { - [_hQ]: _nC - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ] - ] - ]; - var ListModelCustomizationJobsResponse = [ - 3, - n0, - _LMCJRist, - 0, - [_nT, _mCJSo], - [0, () => ModelCustomizationJobSummaries] - ]; - var ListModelImportJobsRequest = [ - 3, - n0, - _LMIJR, - 0, - [_cTA, _cTB, _sEt, _nC, _mR, _nT, _sB, _sO], - [ - [ - 5, - { - [_hQ]: _cTA - } - ], - [ - 5, - { - [_hQ]: _cTB - } - ], - [ - 0, - { - [_hQ]: _sEt - } - ], - [ - 0, - { - [_hQ]: _nC - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ] - ] - ]; - var ListModelImportJobsResponse = [ - 3, - n0, - _LMIJRi, - 0, - [_nT, _mIJS], - [0, () => ModelImportJobSummaries] - ]; - var ListModelInvocationJobsRequest = [ - 3, - n0, - _LMIJRis, - 0, - [_sTA, _sTB, _sEt, _nC, _mR, _nT, _sB, _sO], - [ - [ - 5, - { - [_hQ]: _sTA - } - ], - [ - 5, - { - [_hQ]: _sTB - } - ], - [ - 0, - { - [_hQ]: _sEt - } - ], - [ - 0, - { - [_hQ]: _nC - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ] - ] - ]; - var ListModelInvocationJobsResponse = [ - 3, - n0, - _LMIJRist, - 0, - [_nT, _iJS], - [0, [() => ModelInvocationJobSummaries, 0]] - ]; - var ListPromptRoutersRequest = [ - 3, - n0, - _LPRR, - 0, - [_mR, _nT, _ty], - [ - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _ty - } - ] - ] - ]; - var ListPromptRoutersResponse = [ - 3, - n0, - _LPRRi, - 0, - [_pRS, _nT], - [[() => PromptRouterSummaries, 0], 0] - ]; - var ListProvisionedModelThroughputsRequest = [ - 3, - n0, - _LPMTR, - 0, - [_cTA, _cTB, _sEt, _mAE, _nC, _mR, _nT, _sB, _sO], - [ - [ - 5, - { - [_hQ]: _cTA - } - ], - [ - 5, - { - [_hQ]: _cTB - } - ], - [ - 0, - { - [_hQ]: _sEt - } - ], - [ - 0, - { - [_hQ]: _mAE - } - ], - [ - 0, - { - [_hQ]: _nC - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ] - ] - ]; - var ListProvisionedModelThroughputsResponse = [ - 3, - n0, - _LPMTRi, - 0, - [_nT, _pMS], - [0, () => ProvisionedModelSummaries] - ]; - var ListTagsForResourceRequest = [3, n0, _LTFRR, 0, [_rARN], [0]]; - var ListTagsForResourceResponse = [3, n0, _LTFRRi, 0, [_ta], [() => TagList]]; - var LoggingConfig = [ - 3, - n0, - _LC, - 0, - [_cWC, _sC, _tDDE, _iDDE, _eDDE, _vDDE], - [() => CloudWatchConfig, () => S3Config, 2, 2, 2, 2] - ]; - var MarketplaceModelEndpoint = [ - 3, - n0, - _MME, - 0, - [_eA, _mSI, _s, _sM, _cA, _uA, _eCn, _eS, _eSM], - [0, 0, 0, 0, 5, 5, () => EndpointConfig, 0, 0] - ]; - var MarketplaceModelEndpointSummary = [ - 3, - n0, - _MMES, - 0, - [_eA, _mSI, _s, _sM, _cA, _uA], - [0, 0, 0, 0, 5, 5] - ]; - var MetadataAttributeSchema = [3, n0, _MAS, 8, [_k, _ty, _d], [0, 0, 0]]; - var MetadataConfigurationForReranking = [ - 3, - n0, - _MCFR, - 0, - [_sMe, _sMC], - [0, [() => RerankingMetadataSelectiveModeConfiguration, 0]] - ]; - var ModelCopyJobSummary = [ - 3, - n0, - _MCJS, - 0, - [_jA, _s, _cTr, _tMA, _tMN, _sAI, _sMA, _tMKKA, _tMT, _fMa, _sMN], - [0, 0, 5, 0, 0, 0, 0, 0, () => TagList, 0, 0] - ]; - var ModelCustomizationJobSummary = [ - 3, - n0, - _MCJSo, - 0, - [_jA, _bMA, _jN, _s, _sD, _lMT, _cTr, _eT, _cMA, _cMN, _cTu], - [0, 0, 0, 0, () => StatusDetails, 5, 5, 5, 0, 0, 0] - ]; - var ModelImportJobSummary = [ - 3, - n0, - _MIJS, - 0, - [_jA, _jN, _s, _lMT, _cTr, _eT, _iMA, _iMN], - [0, 0, 0, 5, 5, 5, 0, 0] - ]; - var ModelInvocationJobS3InputDataConfig = [ - 3, - n0, - _MIJSIDC, - 0, - [_sIF, _sU, _sBO], - [0, 0, 0] - ]; - var ModelInvocationJobS3OutputDataConfig = [ - 3, - n0, - _MIJSODC, - 0, - [_sU, _sEKI, _sBO], - [0, 0, 0] - ]; - var ModelInvocationJobSummary = [ - 3, - n0, - _MIJSo, - 0, - [_jA, _jN, _mIo, _cRT, _rA, _s, _m, _sTu, _lMT, _eT, _iDC, _oDC, _vCp, _tDIH, _jET], - [ - 0, - 0, - 0, - 0, - 0, - 0, - [() => Message, 0], - 5, - 5, - 5, - () => ModelInvocationJobInputDataConfig, - () => ModelInvocationJobOutputDataConfig, - () => VpcConfig, - 1, - 5 - ] - ]; - var Offer = [3, n0, _O, 0, [_oI, _oT, _tD], [0, 0, () => TermDetails]]; - var OrchestrationConfiguration = [ - 3, - n0, - _OC, - 0, - [_qTC], - [() => QueryTransformationConfiguration] - ]; - var OutputDataConfig = [3, n0, _ODC, 0, [_sU], [0]]; - var PerformanceConfiguration = [3, n0, _PC, 0, [_la], [0]]; - var PricingTerm = [3, n0, _PT, 0, [_rCa], [() => RateCard]]; - var PromptRouterSummary = [ - 3, - n0, - _PRS, - 0, - [_pRN, _rCo, _d, _cA, _uA, _pRA, _mo, _fM, _s, _ty], - [ - 0, - () => RoutingCriteria, - [() => PromptRouterDescription, 0], - 5, - 5, - 0, - () => PromptRouterTargetModels, - () => PromptRouterTargetModel, - 0, - 0 - ] - ]; - var PromptRouterTargetModel = [3, n0, _PRTM, 0, [_mA], [0]]; - var PromptTemplate = [3, n0, _PTr, 0, [_tPT], [[() => TextPromptTemplate, 0]]]; - var ProvisionedModelSummary = [ - 3, - n0, - _PMS, - 0, - [_pMN, _pMA, _mA, _dMA, _fMA, _mU, _dMU, _s, _cD, _cET, _cTr, _lMT], - [0, 0, 0, 0, 0, 1, 1, 0, 0, 5, 5, 5] - ]; - var PutModelInvocationLoggingConfigurationRequest = [ - 3, - n0, - _PMILCR, - 0, - [_lC], - [() => LoggingConfig] - ]; - var PutModelInvocationLoggingConfigurationResponse = [3, n0, _PMILCRu, 0, [], []]; - var PutUseCaseForModelAccessRequest = [3, n0, _PUCFMAR, 0, [_fD], [21]]; - var PutUseCaseForModelAccessResponse = [3, n0, _PUCFMARu, 0, [], []]; - var QueryTransformationConfiguration = [3, n0, _QTC, 0, [_ty], [0]]; - var RatingScaleItem = [3, n0, _RSI, 0, [_de, _va], [0, () => RatingScaleItemValue]]; - var RegisterMarketplaceModelEndpointRequest = [ - 3, - n0, - _RMMER, - 0, - [_eI, _mSI], - [[0, 1], 0] - ]; - var RegisterMarketplaceModelEndpointResponse = [ - 3, - n0, - _RMMERe, - 0, - [_mME], - [() => MarketplaceModelEndpoint] - ]; - var RequestMetadataBaseFilters = [ - 3, - n0, - _RMBF, - 0, - [_eq, _nE], - [ - [() => RequestMetadataMap, 0], - [() => RequestMetadataMap, 0] - ] - ]; - var ResourceInUseException = [ - -3, - n0, - _RIUE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ResourceInUseException, ResourceInUseException$1); - var ResourceNotFoundException = [ - -3, - n0, - _RNFE, - { - [_e]: _c, - [_hE]: 404 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1); - var RetrieveAndGenerateConfiguration = [ - 3, - n0, - _RAGC, - 0, - [_ty, _kBC, _eSC], - [ - 0, - [() => KnowledgeBaseRetrieveAndGenerateConfiguration, 0], - [() => ExternalSourcesRetrieveAndGenerateConfiguration, 0] - ] - ]; - var RetrieveConfig = [ - 3, - n0, - _RC, - 0, - [_kBI, _kBRC], - [0, [() => KnowledgeBaseRetrievalConfiguration, 0]] - ]; - var RoutingCriteria = [3, n0, _RCo, 0, [_rQD], [1]]; - var S3Config = [3, n0, _SC, 0, [_bN, _kP], [0, 0]]; - var S3DataSource = [3, n0, _SDS, 0, [_sU], [0]]; - var S3ObjectDoc = [3, n0, _SOD, 0, [_uri], [0]]; - var SageMakerEndpoint = [ - 3, - n0, - _SME, - 0, - [_iIC, _iT, _eRx, _kEK, _vp], - [1, 0, 0, 0, () => VpcConfig] - ]; - var ServiceQuotaExceededException = [ - -3, - n0, - _SQEE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ServiceQuotaExceededException, ServiceQuotaExceededException$1); - var ServiceUnavailableException = [ - -3, - n0, - _SUE, - { - [_e]: _se, - [_hE]: 503 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ServiceUnavailableException, ServiceUnavailableException$1); - var StartAutomatedReasoningPolicyBuildWorkflowRequest = [ - 3, - n0, - _SARPBWR, - 0, - [_pA, _bWT, _cRT, _sCo], - [ - [0, 1], - [0, 1], - [ - 0, - { - [_hH]: _xact, - [_iTd]: 1 - } - ], - [() => AutomatedReasoningPolicyBuildWorkflowSource, 16] - ] - ]; - var StartAutomatedReasoningPolicyBuildWorkflowResponse = [ - 3, - n0, - _SARPBWRt, - 0, - [_pA, _bWI], - [0, 0] - ]; - var StartAutomatedReasoningPolicyTestWorkflowRequest = [ - 3, - n0, - _SARPTWR, - 0, - [_pA, _bWI, _tCIe, _cRT], - [[0, 1], [0, 1], 64 | 0, [0, 4]] - ]; - var StartAutomatedReasoningPolicyTestWorkflowResponse = [3, n0, _SARPTWRt, 0, [_pA], [0]]; - var StatusDetails = [ - 3, - n0, - _SD, - 0, - [_vD, _dPD, _tDr], - [() => ValidationDetails, () => DataProcessingDetails, () => TrainingDetails] - ]; - var StopEvaluationJobRequest = [ - 3, - n0, - _SEJR, - 0, - [_jI], - [[() => EvaluationJobIdentifier, 1]] - ]; - var StopEvaluationJobResponse = [3, n0, _SEJRt, 0, [], []]; - var StopModelCustomizationJobRequest = [3, n0, _SMCJR, 0, [_jI], [[0, 1]]]; - var StopModelCustomizationJobResponse = [3, n0, _SMCJRt, 0, [], []]; - var StopModelInvocationJobRequest = [3, n0, _SMIJR, 0, [_jI], [[0, 1]]]; - var StopModelInvocationJobResponse = [3, n0, _SMIJRt, 0, [], []]; - var SupportTerm = [3, n0, _ST, 0, [_rPD], [0]]; - var Tag = [3, n0, _T, 0, [_k, _va], [0, 0]]; - var TagResourceRequest = [3, n0, _TRR, 0, [_rARN, _ta], [0, () => TagList]]; - var TagResourceResponse = [3, n0, _TRRa, 0, [], []]; - var TeacherModelConfig = [3, n0, _TMC, 0, [_tMI, _mRLFI], [0, 1]]; - var TermDetails = [ - 3, - n0, - _TD, - 0, - [_uBPT, _lT, _sTup, _vT], - [() => PricingTerm, () => LegalTerm, () => SupportTerm, () => ValidityTerm] - ]; - var TextInferenceConfig = [3, n0, _TIC, 0, [_tem, _tPo, _mTa, _sS], [1, 1, 1, 64 | 0]]; - var ThrottlingException = [ - -3, - n0, - _TE, - { - [_e]: _c, - [_hE]: 429 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ThrottlingException, ThrottlingException$1); - var TooManyTagsException = [ - -3, - n0, - _TMTE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m, _rN], - [0, 0] - ]; - schema.TypeRegistry.for(n0).registerError(TooManyTagsException, TooManyTagsException$1); - var TrainingDataConfig = [ - 3, - n0, - _TDC, - 0, - [_sU, _iLC], - [0, [() => InvocationLogsConfig, 0]] - ]; - var TrainingDetails = [3, n0, _TDr, 0, [_s, _cTr, _lMT], [0, 5, 5]]; - var TrainingMetrics = [3, n0, _TM, 0, [_tL], [1]]; - var UntagResourceRequest = [3, n0, _URR, 0, [_rARN, _tK], [0, 64 | 0]]; - var UntagResourceResponse = [3, n0, _URRn, 0, [], []]; - var UpdateAutomatedReasoningPolicyAnnotationsRequest = [ - 3, - n0, - _UARPAR, - 0, - [_pA, _bWI, _an, _lUASH], - [[0, 1], [0, 1], [() => AutomatedReasoningPolicyAnnotationList, 0], 0] - ]; - var UpdateAutomatedReasoningPolicyAnnotationsResponse = [ - 3, - n0, - _UARPARp, - 0, - [_pA, _bWI, _aSH, _uA], - [0, 0, 0, 5] - ]; - var UpdateAutomatedReasoningPolicyRequest = [ - 3, - n0, - _UARPR, - 0, - [_pA, _pD, _n, _d], - [ - [0, 1], - [() => AutomatedReasoningPolicyDefinition, 0], - [() => AutomatedReasoningPolicyName, 0], - [() => AutomatedReasoningPolicyDescription, 0] - ] - ]; - var UpdateAutomatedReasoningPolicyResponse = [ - 3, - n0, - _UARPRp, - 0, - [_pA, _n, _dH, _uA], - [0, [() => AutomatedReasoningPolicyName, 0], 0, 5] - ]; - var UpdateAutomatedReasoningPolicyTestCaseRequest = [ - 3, - n0, - _UARPTCR, - 0, - [_pA, _tCI, _gC, _qC, _lUA, _eAFR, _cT, _cRT], - [ - [0, 1], - [0, 1], - [() => AutomatedReasoningPolicyTestGuardContent, 0], - [() => AutomatedReasoningPolicyTestQueryContent, 0], - 5, - 0, - 1, - [0, 4] - ] - ]; - var UpdateAutomatedReasoningPolicyTestCaseResponse = [ - 3, - n0, - _UARPTCRp, - 0, - [_pA, _tCI], - [0, 0] - ]; - var UpdateGuardrailRequest = [ - 3, - n0, - _UGR, - 0, - [_gIu, _n, _d, _tPC, _cPC, _wPC, _sIPC, _cGPC, _aRPC, _cRC, _bIM, _bOM, _kKI], - [ - [0, 1], - [() => GuardrailName, 0], - [() => GuardrailDescription, 0], - [() => GuardrailTopicPolicyConfig, 0], - [() => GuardrailContentPolicyConfig, 0], - [() => GuardrailWordPolicyConfig, 0], - () => GuardrailSensitiveInformationPolicyConfig, - [() => GuardrailContextualGroundingPolicyConfig, 0], - () => GuardrailAutomatedReasoningPolicyConfig, - () => GuardrailCrossRegionConfig, - [() => GuardrailBlockedMessaging, 0], - [() => GuardrailBlockedMessaging, 0], - 0 - ] - ]; - var UpdateGuardrailResponse = [3, n0, _UGRp, 0, [_gI, _gA, _ve, _uA], [0, 0, 0, 5]]; - var UpdateMarketplaceModelEndpointRequest = [ - 3, - n0, - _UMMER, - 0, - [_eA, _eCn, _cRT], - [[0, 1], () => EndpointConfig, [0, 4]] - ]; - var UpdateMarketplaceModelEndpointResponse = [ - 3, - n0, - _UMMERp, - 0, - [_mME], - [() => MarketplaceModelEndpoint] - ]; - var UpdateProvisionedModelThroughputRequest = [ - 3, - n0, - _UPMTR, - 0, - [_pMI, _dPMN, _dMI], - [[0, 1], 0, 0] - ]; - var UpdateProvisionedModelThroughputResponse = [3, n0, _UPMTRp, 0, [], []]; - var ValidationDataConfig = [3, n0, _VDC, 0, [_val], [() => Validators]]; - var ValidationDetails = [3, n0, _VD, 0, [_s, _cTr, _lMT], [0, 5, 5]]; - var ValidationException = [ - -3, - n0, - _VE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1); - var Validator = [3, n0, _V, 0, [_sU], [0]]; - var ValidatorMetric = [3, n0, _VM, 0, [_vL], [1]]; - var ValidityTerm = [3, n0, _VT, 0, [_aD], [0]]; - var VectorSearchBedrockRerankingConfiguration = [ - 3, - n0, - _VSBRC, - 0, - [_mC, _nORR, _mCe], - [() => VectorSearchBedrockRerankingModelConfiguration, 1, [() => MetadataConfigurationForReranking, 0]] - ]; - var VectorSearchBedrockRerankingModelConfiguration = [ - 3, - n0, - _VSBRMC, - 0, - [_mA, _aMRF], - [0, 128 | 15] - ]; - var VectorSearchRerankingConfiguration = [ - 3, - n0, - _VSRC, - 0, - [_ty, _bRC], - [0, [() => VectorSearchBedrockRerankingConfiguration, 0]] - ]; - var VpcConfig = [3, n0, _VC, 0, [_sI, _sGI], [64 | 0, 64 | 0]]; - var BedrockServiceException = [-3, _sm, "BedrockServiceException", 0, [], []]; - schema.TypeRegistry.for(_sm).registerError(BedrockServiceException, BedrockServiceException$1); - var AutomatedEvaluationCustomMetrics = [ - 1, - n0, - _AECM, - 0, - [() => AutomatedEvaluationCustomMetricSource, 0] - ]; - var AutomatedReasoningCheckDifferenceScenarioList = [ - 1, - n0, - _ARCDSL, - 0, - [() => AutomatedReasoningCheckScenario, 0] - ]; - var AutomatedReasoningCheckFindingList = [ - 1, - n0, - _ARCFL, - 0, - [() => AutomatedReasoningCheckFinding, 0] - ]; - var AutomatedReasoningCheckInputTextReferenceList = [ - 1, - n0, - _ARCITRL, - 0, - [() => AutomatedReasoningCheckInputTextReference, 0] - ]; - var AutomatedReasoningCheckRuleList = [1, n0, _ARCRL, 0, () => AutomatedReasoningCheckRule]; - var AutomatedReasoningCheckTranslationList = [ - 1, - n0, - _ARCTL, - 0, - [() => AutomatedReasoningCheckTranslation, 0] - ]; - var AutomatedReasoningCheckTranslationOptionList = [ - 1, - n0, - _ARCTOL, - 0, - [() => AutomatedReasoningCheckTranslationOption, 0] - ]; - var AutomatedReasoningLogicStatementList = [ - 1, - n0, - _ARLSL, - 0, - [() => AutomatedReasoningLogicStatement, 0] - ]; - var AutomatedReasoningPolicyAnnotationList = [ - 1, - n0, - _ARPAL, - 0, - [() => AutomatedReasoningPolicyAnnotation, 0] - ]; - var AutomatedReasoningPolicyBuildLogEntryList = [ - 1, - n0, - _ARPBLEL, - 0, - [() => AutomatedReasoningPolicyBuildLogEntry, 0] - ]; - var AutomatedReasoningPolicyBuildStepList = [ - 1, - n0, - _ARPBSL, - 0, - [() => AutomatedReasoningPolicyBuildStep, 0] - ]; - var AutomatedReasoningPolicyBuildStepMessageList = [ - 1, - n0, - _ARPBSML, - 0, - () => AutomatedReasoningPolicyBuildStepMessage - ]; - var AutomatedReasoningPolicyBuildWorkflowDocumentList = [ - 1, - n0, - _ARPBWDL, - 0, - [() => AutomatedReasoningPolicyBuildWorkflowDocument, 0] - ]; - var AutomatedReasoningPolicyBuildWorkflowSummaries = [ - 1, - n0, - _ARPBWSut, - 0, - () => AutomatedReasoningPolicyBuildWorkflowSummary - ]; - var AutomatedReasoningPolicyDefinitionRuleList = [ - 1, - n0, - _ARPDRL, - 0, - [() => AutomatedReasoningPolicyDefinitionRule, 0] - ]; - var AutomatedReasoningPolicyDefinitionTypeList = [ - 1, - n0, - _ARPDTL, - 0, - [() => AutomatedReasoningPolicyDefinitionType, 0] - ]; - var AutomatedReasoningPolicyDefinitionTypeNameList = [ - 1, - n0, - _ARPDTNL, - 0, - [() => AutomatedReasoningPolicyDefinitionTypeName, 0] - ]; - var AutomatedReasoningPolicyDefinitionTypeValueList = [ - 1, - n0, - _ARPDTVL, - 0, - [() => AutomatedReasoningPolicyDefinitionTypeValue, 0] - ]; - var AutomatedReasoningPolicyDefinitionTypeValuePairList = [ - 1, - n0, - _ARPDTVPL, - 0, - [() => AutomatedReasoningPolicyDefinitionTypeValuePair, 0] - ]; - var AutomatedReasoningPolicyDefinitionVariableList = [ - 1, - n0, - _ARPDVL, - 0, - [() => AutomatedReasoningPolicyDefinitionVariable, 0] - ]; - var AutomatedReasoningPolicyDefinitionVariableNameList = [ - 1, - n0, - _ARPDVNL, - 0, - [() => AutomatedReasoningPolicyDefinitionVariableName, 0] - ]; - var AutomatedReasoningPolicyDisjointRuleSetList = [ - 1, - n0, - _ARPDRSL, - 0, - [() => AutomatedReasoningPolicyDisjointRuleSet, 0] - ]; - var AutomatedReasoningPolicyGeneratedTestCaseList = [ - 1, - n0, - _ARPGTCL, - 0, - [() => AutomatedReasoningPolicyGeneratedTestCase, 0] - ]; - var AutomatedReasoningPolicySummaries = [ - 1, - n0, - _ARPSut, - 0, - [() => AutomatedReasoningPolicySummary, 0] - ]; - var AutomatedReasoningPolicyTestCaseList = [ - 1, - n0, - _ARPTCL, - 0, - [() => AutomatedReasoningPolicyTestCase, 0] - ]; - var AutomatedReasoningPolicyTestList = [ - 1, - n0, - _ARPTL, - 0, - [() => AutomatedReasoningPolicyTestResult, 0] - ]; - var AutomatedReasoningPolicyTypeValueAnnotationList = [ - 1, - n0, - _ARPTVAL, - 0, - [() => AutomatedReasoningPolicyTypeValueAnnotation, 0] - ]; - var BatchDeleteEvaluationJobErrors = [ - 1, - n0, - _BDEJEa, - 0, - [() => BatchDeleteEvaluationJobError, 0] - ]; - var BatchDeleteEvaluationJobItems = [ - 1, - n0, - _BDEJIa, - 0, - [() => BatchDeleteEvaluationJobItem, 0] - ]; - var BedrockEvaluatorModels = [1, n0, _BEMe, 0, () => BedrockEvaluatorModel]; - var CustomMetricBedrockEvaluatorModels = [ - 1, - n0, - _CMBEMu, - 0, - () => CustomMetricBedrockEvaluatorModel - ]; - var CustomModelDeploymentSummaryList = [1, n0, _CMDSL, 0, () => CustomModelDeploymentSummary]; - var CustomModelSummaryList = [1, n0, _CMSL, 0, () => CustomModelSummary]; - var EvaluationDatasetMetricConfigs = [ - 1, - n0, - _EDMCv, - 0, - [() => EvaluationDatasetMetricConfig, 0] - ]; - var EvaluationJobIdentifiers = [1, n0, _EJIv, 0, [() => EvaluationJobIdentifier, 0]]; - var EvaluationMetricNames = [1, n0, _EMNv, 0, [() => EvaluationMetricName, 0]]; - var EvaluationModelConfigs = [1, n0, _EMC, 0, [() => EvaluationModelConfig, 0]]; - var EvaluationSummaries = [1, n0, _ESv, 0, () => EvaluationSummary]; - var ExternalSources = [1, n0, _ESxt, 0, [() => ExternalSource, 0]]; - var FieldsForReranking = [1, n0, _FFRi, 8, () => FieldForReranking]; - var FoundationModelSummaryList = [1, n0, _FMSL, 0, () => FoundationModelSummary]; - var GuardrailContentFilters = [1, n0, _GCFu, 0, [() => GuardrailContentFilter, 0]]; - var GuardrailContentFiltersConfig = [ - 1, - n0, - _GCFCu, - 0, - [() => GuardrailContentFilterConfig, 0] - ]; - var GuardrailContextualGroundingFilters = [ - 1, - n0, - _GCGFu, - 0, - [() => GuardrailContextualGroundingFilter, 0] - ]; - var GuardrailContextualGroundingFiltersConfig = [ - 1, - n0, - _GCGFCu, - 0, - [() => GuardrailContextualGroundingFilterConfig, 0] - ]; - var GuardrailFailureRecommendations = [ - 1, - n0, - _GFRu, - 0, - [() => GuardrailFailureRecommendation, 0] - ]; - var GuardrailManagedWordLists = [1, n0, _GMWL, 0, [() => GuardrailManagedWords, 0]]; - var GuardrailManagedWordListsConfig = [ - 1, - n0, - _GMWLC, - 0, - [() => GuardrailManagedWordsConfig, 0] - ]; - var GuardrailModalities = [1, n0, _GMu, 0, [() => GuardrailModality$1, 0]]; - var GuardrailPiiEntities = [1, n0, _GPEu, 0, () => GuardrailPiiEntity]; - var GuardrailPiiEntitiesConfig = [1, n0, _GPECu, 0, () => GuardrailPiiEntityConfig]; - var GuardrailRegexes = [1, n0, _GRu, 0, () => GuardrailRegex]; - var GuardrailRegexesConfig = [1, n0, _GRCu, 0, () => GuardrailRegexConfig]; - var GuardrailStatusReasons = [1, n0, _GSRu, 0, [() => GuardrailStatusReason, 0]]; - var GuardrailSummaries = [1, n0, _GSu, 0, [() => GuardrailSummary, 0]]; - var GuardrailTopicExamples = [1, n0, _GTEu, 0, [() => GuardrailTopicExample, 0]]; - var GuardrailTopics = [1, n0, _GTu, 0, [() => GuardrailTopic, 0]]; - var GuardrailTopicsConfig = [1, n0, _GTCu, 0, [() => GuardrailTopicConfig, 0]]; - var GuardrailWords = [1, n0, _GWu, 0, [() => GuardrailWord, 0]]; - var GuardrailWordsConfig = [1, n0, _GWCu, 0, [() => GuardrailWordConfig, 0]]; - var HumanEvaluationCustomMetrics = [1, n0, _HECMu, 0, [() => HumanEvaluationCustomMetric, 0]]; - var ImportedModelSummaryList = [1, n0, _IMSL, 0, () => ImportedModelSummary]; - var InferenceProfileModels = [1, n0, _IPMn, 0, () => InferenceProfileModel]; - var InferenceProfileSummaries = [1, n0, _IPSn, 0, [() => InferenceProfileSummary, 0]]; - var MarketplaceModelEndpointSummaries = [ - 1, - n0, - _MMESa, - 0, - () => MarketplaceModelEndpointSummary - ]; - var MetadataAttributeSchemaList = [1, n0, _MASL, 0, [() => MetadataAttributeSchema, 0]]; - var ModelCopyJobSummaries = [1, n0, _MCJSod, 0, () => ModelCopyJobSummary]; - var ModelCustomizationJobSummaries = [1, n0, _MCJSode, 0, () => ModelCustomizationJobSummary]; - var ModelImportJobSummaries = [1, n0, _MIJSod, 0, () => ModelImportJobSummary]; - var ModelInvocationJobSummaries = [1, n0, _MIJSode, 0, [() => ModelInvocationJobSummary, 0]]; - var Offers = [1, n0, _Of, 0, () => Offer]; - var PromptRouterSummaries = [1, n0, _PRSr, 0, [() => PromptRouterSummary, 0]]; - var PromptRouterTargetModels = [1, n0, _PRTMr, 0, () => PromptRouterTargetModel]; - var ProvisionedModelSummaries = [1, n0, _PMSr, 0, () => ProvisionedModelSummary]; - var RagConfigs = [1, n0, _RCa, 0, [() => RAGConfig, 0]]; - var RateCard = [1, n0, _RCat, 0, () => DimensionalPriceRate]; - var RatingScale = [1, n0, _RS, 0, () => RatingScaleItem]; - var RequestMetadataFiltersList = [1, n0, _RMFL, 0, [() => RequestMetadataBaseFilters, 0]]; - var RetrievalFilterList = [1, n0, _RFL, 0, [() => RetrievalFilter, 0]]; - var TagList = [1, n0, _TL, 0, () => Tag]; - var ValidationMetrics = [1, n0, _VMa, 0, () => ValidatorMetric]; - var Validators = [1, n0, _Va, 0, () => Validator]; - var RequestMetadataMap = [2, n0, _RMM, 8, 0, 0]; - var AutomatedEvaluationCustomMetricSource = [ - 3, - n0, - _AECMS, - 0, - [_cMD], - [[() => CustomMetricDefinition, 0]] - ]; - var AutomatedReasoningCheckFinding = [ - 3, - n0, - _ARCF, - 0, - [_vali, _inv, _sa, _im, _tA, _tCoo, _nTo], - [ - [() => AutomatedReasoningCheckValidFinding, 0], - [() => AutomatedReasoningCheckInvalidFinding, 0], - [() => AutomatedReasoningCheckSatisfiableFinding, 0], - [() => AutomatedReasoningCheckImpossibleFinding, 0], - [() => AutomatedReasoningCheckTranslationAmbiguousFinding, 0], - () => AutomatedReasoningCheckTooComplexFinding, - () => AutomatedReasoningCheckNoTranslationsFinding - ] - ]; - var AutomatedReasoningPolicyAnnotation = [ - 3, - n0, - _ARPA, - 0, - [_aTd, _uTp, _dT, _aV, _uVp, _dV, _aR, _uR, _dR, _aRFNL, _uFRF, _uFSF, _iCn], - [ - [() => AutomatedReasoningPolicyAddTypeAnnotation, 0], - [() => AutomatedReasoningPolicyUpdateTypeAnnotation, 0], - [() => AutomatedReasoningPolicyDeleteTypeAnnotation, 0], - [() => AutomatedReasoningPolicyAddVariableAnnotation, 0], - [() => AutomatedReasoningPolicyUpdateVariableAnnotation, 0], - [() => AutomatedReasoningPolicyDeleteVariableAnnotation, 0], - [() => AutomatedReasoningPolicyAddRuleAnnotation, 0], - [() => AutomatedReasoningPolicyUpdateRuleAnnotation, 0], - () => AutomatedReasoningPolicyDeleteRuleAnnotation, - [() => AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation, 0], - [() => AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation, 0], - [() => AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation, 0], - [() => AutomatedReasoningPolicyIngestContentAnnotation, 0] - ] - ]; - var AutomatedReasoningPolicyBuildResultAssets = [ - 3, - n0, - _ARPBRA, - 0, - [_pD, _qR, _bL, _gTC], - [ - [() => AutomatedReasoningPolicyDefinition, 0], - [() => AutomatedReasoningPolicyDefinitionQualityReport, 0], - [() => AutomatedReasoningPolicyBuildLog, 0], - [() => AutomatedReasoningPolicyGeneratedTestCases, 0] - ] - ]; - var AutomatedReasoningPolicyBuildStepContext = [ - 3, - n0, - _ARPBSC, - 0, - [_pl, _mu], - [() => AutomatedReasoningPolicyPlanning, [() => AutomatedReasoningPolicyMutation, 0]] - ]; - var AutomatedReasoningPolicyDefinitionElement = [ - 3, - n0, - _ARPDE, - 0, - [_pDV, _pDT, _pDR], - [ - [() => AutomatedReasoningPolicyDefinitionVariable, 0], - [() => AutomatedReasoningPolicyDefinitionType, 0], - [() => AutomatedReasoningPolicyDefinitionRule, 0] - ] - ]; - var AutomatedReasoningPolicyMutation = [ - 3, - n0, - _ARPM, - 0, - [_aTd, _uTp, _dT, _aV, _uVp, _dV, _aR, _uR, _dR], - [ - [() => AutomatedReasoningPolicyAddTypeMutation, 0], - [() => AutomatedReasoningPolicyUpdateTypeMutation, 0], - [() => AutomatedReasoningPolicyDeleteTypeMutation, 0], - [() => AutomatedReasoningPolicyAddVariableMutation, 0], - [() => AutomatedReasoningPolicyUpdateVariableMutation, 0], - [() => AutomatedReasoningPolicyDeleteVariableMutation, 0], - [() => AutomatedReasoningPolicyAddRuleMutation, 0], - [() => AutomatedReasoningPolicyUpdateRuleMutation, 0], - () => AutomatedReasoningPolicyDeleteRuleMutation - ] - ]; - var AutomatedReasoningPolicyTypeValueAnnotation = [ - 3, - n0, - _ARPTVA, - 0, - [_aTV, _uTVp, _dTV], - [ - [() => AutomatedReasoningPolicyAddTypeValue, 0], - [() => AutomatedReasoningPolicyUpdateTypeValue, 0], - () => AutomatedReasoningPolicyDeleteTypeValue - ] - ]; - var AutomatedReasoningPolicyWorkflowTypeContent = [ - 3, - n0, - _ARPWTC, - 0, - [_doc, _pRAo], - [ - [() => AutomatedReasoningPolicyBuildWorkflowDocumentList, 0], - [() => AutomatedReasoningPolicyBuildWorkflowRepairContent, 0] - ] - ]; - var CustomizationConfig = [3, n0, _CC, 0, [_dC], [() => DistillationConfig]]; - var EndpointConfig = [3, n0, _EC, 0, [_sMa], [() => SageMakerEndpoint]]; - var EvaluationConfig = [ - 3, - n0, - _ECv, - 0, - [_au, _h], - [ - [() => AutomatedEvaluationConfig, 0], - [() => HumanEvaluationConfig, 0] - ] - ]; - var EvaluationDatasetLocation = [3, n0, _EDL, 0, [_sU], [0]]; - var EvaluationInferenceConfig = [ - 3, - n0, - _EIC, - 0, - [_mo, _rCag], - [ - [() => EvaluationModelConfigs, 0], - [() => RagConfigs, 0] - ] - ]; - var EvaluationModelConfig = [ - 3, - n0, - _EMCv, - 0, - [_bM, _pIS], - [[() => EvaluationBedrockModel, 0], () => EvaluationPrecomputedInferenceSource] - ]; - var EvaluationPrecomputedRagSourceConfig = [ - 3, - n0, - _EPRSCv, - 0, - [_rSC, _rAGSC], - [() => EvaluationPrecomputedRetrieveSourceConfig, () => EvaluationPrecomputedRetrieveAndGenerateSourceConfig] - ]; - var EvaluatorModelConfig = [3, n0, _EMCva, 0, [_bEM], [() => BedrockEvaluatorModels]]; - var InferenceProfileModelSource = [3, n0, _IPMS, 0, [_cF], [0]]; - var InvocationLogSource = [3, n0, _ILS, 0, [_sU], [0]]; - var KnowledgeBaseConfig = [ - 3, - n0, - _KBC, - 0, - [_rCetr, _rAGC], - [ - [() => RetrieveConfig, 0], - [() => RetrieveAndGenerateConfiguration, 0] - ] - ]; - var ModelDataSource = [3, n0, _MDS, 0, [_sDS], [() => S3DataSource]]; - var ModelInvocationJobInputDataConfig = [ - 3, - n0, - _MIJIDC, - 0, - [_sIDC], - [() => ModelInvocationJobS3InputDataConfig] - ]; - var ModelInvocationJobOutputDataConfig = [ - 3, - n0, - _MIJODC, - 0, - [_sODC], - [() => ModelInvocationJobS3OutputDataConfig] - ]; - var RAGConfig = [ - 3, - n0, - _RAGCo, - 0, - [_kBCn, _pRSC], - [[() => KnowledgeBaseConfig, 0], () => EvaluationPrecomputedRagSourceConfig] - ]; - var RatingScaleItemValue = [3, n0, _RSIV, 0, [_sV, _fV], [0, 1]]; - var RequestMetadataFilters = [ - 3, - n0, - _RMF, - 0, - [_eq, _nE, _aAn, _oAr], - [ - [() => RequestMetadataMap, 0], - [() => RequestMetadataMap, 0], - [() => RequestMetadataFiltersList, 0], - [() => RequestMetadataFiltersList, 0] - ] - ]; - var RerankingMetadataSelectiveModeConfiguration = [ - 3, - n0, - _RMSMC, - 0, - [_fTI, _fTE], - [ - [() => FieldsForReranking, 0], - [() => FieldsForReranking, 0] - ] - ]; - var RetrievalFilter = [ - 3, - n0, - _RF, - 8, - [_eq, _nE, _gT, _gTOE, _lTe, _lTOE, _in_, _nI, _sW, _lCi, _sCt, _aAn, _oAr], - [ - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - () => FilterAttribute, - [() => RetrievalFilterList, 0], - [() => RetrievalFilterList, 0] - ] - ]; - var BatchDeleteEvaluationJob = [ - 9, - n0, - _BDEJ, - { - [_ht]: ["POST", "/evaluation-jobs/batch-delete", 202] - }, - () => BatchDeleteEvaluationJobRequest, - () => BatchDeleteEvaluationJobResponse - ]; - var CancelAutomatedReasoningPolicyBuildWorkflow = [ - 9, - n0, - _CARPBW, - { - [_ht]: ["POST", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/cancel", 202] - }, - () => CancelAutomatedReasoningPolicyBuildWorkflowRequest, - () => CancelAutomatedReasoningPolicyBuildWorkflowResponse - ]; - var CreateAutomatedReasoningPolicy = [ - 9, - n0, - _CARP, - { - [_ht]: ["POST", "/automated-reasoning-policies", 200] - }, - () => CreateAutomatedReasoningPolicyRequest, - () => CreateAutomatedReasoningPolicyResponse - ]; - var CreateAutomatedReasoningPolicyTestCase = [ - 9, - n0, - _CARPTC, - { - [_ht]: ["POST", "/automated-reasoning-policies/{policyArn}/test-cases", 200] - }, - () => CreateAutomatedReasoningPolicyTestCaseRequest, - () => CreateAutomatedReasoningPolicyTestCaseResponse - ]; - var CreateAutomatedReasoningPolicyVersion = [ - 9, - n0, - _CARPV, - { - [_ht]: ["POST", "/automated-reasoning-policies/{policyArn}/versions", 200] - }, - () => CreateAutomatedReasoningPolicyVersionRequest, - () => CreateAutomatedReasoningPolicyVersionResponse - ]; - var CreateCustomModel = [ - 9, - n0, - _CCM, - { - [_ht]: ["POST", "/custom-models/create-custom-model", 202] - }, - () => CreateCustomModelRequest, - () => CreateCustomModelResponse - ]; - var CreateCustomModelDeployment = [ - 9, - n0, - _CCMD, - { - [_ht]: ["POST", "/model-customization/custom-model-deployments", 202] - }, - () => CreateCustomModelDeploymentRequest, - () => CreateCustomModelDeploymentResponse - ]; - var CreateEvaluationJob = [ - 9, - n0, - _CEJ, - { - [_ht]: ["POST", "/evaluation-jobs", 202] - }, - () => CreateEvaluationJobRequest, - () => CreateEvaluationJobResponse - ]; - var CreateFoundationModelAgreement = [ - 9, - n0, - _CFMA, - { - [_ht]: ["POST", "/create-foundation-model-agreement", 202] - }, - () => CreateFoundationModelAgreementRequest, - () => CreateFoundationModelAgreementResponse - ]; - var CreateGuardrail = [ - 9, - n0, - _CG, - { - [_ht]: ["POST", "/guardrails", 202] - }, - () => CreateGuardrailRequest, - () => CreateGuardrailResponse - ]; - var CreateGuardrailVersion = [ - 9, - n0, - _CGV, - { - [_ht]: ["POST", "/guardrails/{guardrailIdentifier}", 202] - }, - () => CreateGuardrailVersionRequest, - () => CreateGuardrailVersionResponse - ]; - var CreateInferenceProfile = [ - 9, - n0, - _CIP, - { - [_ht]: ["POST", "/inference-profiles", 201] - }, - () => CreateInferenceProfileRequest, - () => CreateInferenceProfileResponse - ]; - var CreateMarketplaceModelEndpoint = [ - 9, - n0, - _CMME, - { - [_ht]: ["POST", "/marketplace-model/endpoints", 200] - }, - () => CreateMarketplaceModelEndpointRequest, - () => CreateMarketplaceModelEndpointResponse - ]; - var CreateModelCopyJob = [ - 9, - n0, - _CMCJ, - { - [_ht]: ["POST", "/model-copy-jobs", 201] - }, - () => CreateModelCopyJobRequest, - () => CreateModelCopyJobResponse - ]; - var CreateModelCustomizationJob = [ - 9, - n0, - _CMCJr, - { - [_ht]: ["POST", "/model-customization-jobs", 201] - }, - () => CreateModelCustomizationJobRequest, - () => CreateModelCustomizationJobResponse - ]; - var CreateModelImportJob = [ - 9, - n0, - _CMIJ, - { - [_ht]: ["POST", "/model-import-jobs", 201] - }, - () => CreateModelImportJobRequest, - () => CreateModelImportJobResponse - ]; - var CreateModelInvocationJob = [ - 9, - n0, - _CMIJr, - { - [_ht]: ["POST", "/model-invocation-job", 200] - }, - () => CreateModelInvocationJobRequest, - () => CreateModelInvocationJobResponse - ]; - var CreatePromptRouter = [ - 9, - n0, - _CPR, - { - [_ht]: ["POST", "/prompt-routers", 200] - }, - () => CreatePromptRouterRequest, - () => CreatePromptRouterResponse - ]; - var CreateProvisionedModelThroughput = [ - 9, - n0, - _CPMT, - { - [_ht]: ["POST", "/provisioned-model-throughput", 201] - }, - () => CreateProvisionedModelThroughputRequest, - () => CreateProvisionedModelThroughputResponse - ]; - var DeleteAutomatedReasoningPolicy = [ - 9, - n0, - _DARP, - { - [_ht]: ["DELETE", "/automated-reasoning-policies/{policyArn}", 202] - }, - () => DeleteAutomatedReasoningPolicyRequest, - () => DeleteAutomatedReasoningPolicyResponse - ]; - var DeleteAutomatedReasoningPolicyBuildWorkflow = [ - 9, - n0, - _DARPBW, - { - [_ht]: ["DELETE", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}", 202] - }, - () => DeleteAutomatedReasoningPolicyBuildWorkflowRequest, - () => DeleteAutomatedReasoningPolicyBuildWorkflowResponse - ]; - var DeleteAutomatedReasoningPolicyTestCase = [ - 9, - n0, - _DARPTC, - { - [_ht]: ["DELETE", "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", 202] - }, - () => DeleteAutomatedReasoningPolicyTestCaseRequest, - () => DeleteAutomatedReasoningPolicyTestCaseResponse - ]; - var DeleteCustomModel = [ - 9, - n0, - _DCM, - { - [_ht]: ["DELETE", "/custom-models/{modelIdentifier}", 200] - }, - () => DeleteCustomModelRequest, - () => DeleteCustomModelResponse - ]; - var DeleteCustomModelDeployment = [ - 9, - n0, - _DCMD, - { - [_ht]: ["DELETE", "/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}", 200] - }, - () => DeleteCustomModelDeploymentRequest, - () => DeleteCustomModelDeploymentResponse - ]; - var DeleteFoundationModelAgreement = [ - 9, - n0, - _DFMA, - { - [_ht]: ["POST", "/delete-foundation-model-agreement", 202] - }, - () => DeleteFoundationModelAgreementRequest, - () => DeleteFoundationModelAgreementResponse - ]; - var DeleteGuardrail = [ - 9, - n0, - _DG, - { - [_ht]: ["DELETE", "/guardrails/{guardrailIdentifier}", 202] - }, - () => DeleteGuardrailRequest, - () => DeleteGuardrailResponse - ]; - var DeleteImportedModel = [ - 9, - n0, - _DIM, - { - [_ht]: ["DELETE", "/imported-models/{modelIdentifier}", 200] - }, - () => DeleteImportedModelRequest, - () => DeleteImportedModelResponse - ]; - var DeleteInferenceProfile = [ - 9, - n0, - _DIP, - { - [_ht]: ["DELETE", "/inference-profiles/{inferenceProfileIdentifier}", 200] - }, - () => DeleteInferenceProfileRequest, - () => DeleteInferenceProfileResponse - ]; - var DeleteMarketplaceModelEndpoint = [ - 9, - n0, - _DMME, - { - [_ht]: ["DELETE", "/marketplace-model/endpoints/{endpointArn}", 200] - }, - () => DeleteMarketplaceModelEndpointRequest, - () => DeleteMarketplaceModelEndpointResponse - ]; - var DeleteModelInvocationLoggingConfiguration = [ - 9, - n0, - _DMILC, - { - [_ht]: ["DELETE", "/logging/modelinvocations", 200] - }, - () => DeleteModelInvocationLoggingConfigurationRequest, - () => DeleteModelInvocationLoggingConfigurationResponse - ]; - var DeletePromptRouter = [ - 9, - n0, - _DPRe, - { - [_ht]: ["DELETE", "/prompt-routers/{promptRouterArn}", 200] - }, - () => DeletePromptRouterRequest, - () => DeletePromptRouterResponse - ]; - var DeleteProvisionedModelThroughput = [ - 9, - n0, - _DPMT, - { - [_ht]: ["DELETE", "/provisioned-model-throughput/{provisionedModelId}", 200] - }, - () => DeleteProvisionedModelThroughputRequest, - () => DeleteProvisionedModelThroughputResponse - ]; - var DeregisterMarketplaceModelEndpoint = [ - 9, - n0, - _DMMEe, - { - [_ht]: ["DELETE", "/marketplace-model/endpoints/{endpointArn}/registration", 200] - }, - () => DeregisterMarketplaceModelEndpointRequest, - () => DeregisterMarketplaceModelEndpointResponse - ]; - var ExportAutomatedReasoningPolicyVersion = [ - 9, - n0, - _EARPV, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/export", 200] - }, - () => ExportAutomatedReasoningPolicyVersionRequest, - () => ExportAutomatedReasoningPolicyVersionResponse - ]; - var GetAutomatedReasoningPolicy = [ - 9, - n0, - _GARPe, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}", 200] - }, - () => GetAutomatedReasoningPolicyRequest, - () => GetAutomatedReasoningPolicyResponse - ]; - var GetAutomatedReasoningPolicyAnnotations = [ - 9, - n0, - _GARPA, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations", 200] - }, - () => GetAutomatedReasoningPolicyAnnotationsRequest, - () => GetAutomatedReasoningPolicyAnnotationsResponse - ]; - var GetAutomatedReasoningPolicyBuildWorkflow = [ - 9, - n0, - _GARPBW, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}", 200] - }, - () => GetAutomatedReasoningPolicyBuildWorkflowRequest, - () => GetAutomatedReasoningPolicyBuildWorkflowResponse - ]; - var GetAutomatedReasoningPolicyBuildWorkflowResultAssets = [ - 9, - n0, - _GARPBWRA, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/result-assets", 200] - }, - () => GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest, - () => GetAutomatedReasoningPolicyBuildWorkflowResultAssetsResponse - ]; - var GetAutomatedReasoningPolicyNextScenario = [ - 9, - n0, - _GARPNS, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/scenarios", 200] - }, - () => GetAutomatedReasoningPolicyNextScenarioRequest, - () => GetAutomatedReasoningPolicyNextScenarioResponse - ]; - var GetAutomatedReasoningPolicyTestCase = [ - 9, - n0, - _GARPTC, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", 200] - }, - () => GetAutomatedReasoningPolicyTestCaseRequest, - () => GetAutomatedReasoningPolicyTestCaseResponse - ]; - var GetAutomatedReasoningPolicyTestResult = [ - 9, - n0, - _GARPTR, - { - [_ht]: [ - "GET", - "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-cases/{testCaseId}/test-results", - 200 - ] - }, - () => GetAutomatedReasoningPolicyTestResultRequest, - () => GetAutomatedReasoningPolicyTestResultResponse - ]; - var GetCustomModel = [ - 9, - n0, - _GCM, - { - [_ht]: ["GET", "/custom-models/{modelIdentifier}", 200] - }, - () => GetCustomModelRequest, - () => GetCustomModelResponse - ]; - var GetCustomModelDeployment = [ - 9, - n0, - _GCMD, - { - [_ht]: ["GET", "/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}", 200] - }, - () => GetCustomModelDeploymentRequest, - () => GetCustomModelDeploymentResponse - ]; - var GetEvaluationJob = [ - 9, - n0, - _GEJ, - { - [_ht]: ["GET", "/evaluation-jobs/{jobIdentifier}", 200] - }, - () => GetEvaluationJobRequest, - () => GetEvaluationJobResponse - ]; - var GetFoundationModel = [ - 9, - n0, - _GFM, - { - [_ht]: ["GET", "/foundation-models/{modelIdentifier}", 200] - }, - () => GetFoundationModelRequest, - () => GetFoundationModelResponse - ]; - var GetFoundationModelAvailability = [ - 9, - n0, - _GFMA, - { - [_ht]: ["GET", "/foundation-model-availability/{modelId}", 200] - }, - () => GetFoundationModelAvailabilityRequest, - () => GetFoundationModelAvailabilityResponse - ]; - var GetGuardrail = [ - 9, - n0, - _GG, - { - [_ht]: ["GET", "/guardrails/{guardrailIdentifier}", 200] - }, - () => GetGuardrailRequest, - () => GetGuardrailResponse - ]; - var GetImportedModel = [ - 9, - n0, - _GIM, - { - [_ht]: ["GET", "/imported-models/{modelIdentifier}", 200] - }, - () => GetImportedModelRequest, - () => GetImportedModelResponse - ]; - var GetInferenceProfile = [ - 9, - n0, - _GIP, - { - [_ht]: ["GET", "/inference-profiles/{inferenceProfileIdentifier}", 200] - }, - () => GetInferenceProfileRequest, - () => GetInferenceProfileResponse - ]; - var GetMarketplaceModelEndpoint = [ - 9, - n0, - _GMME, - { - [_ht]: ["GET", "/marketplace-model/endpoints/{endpointArn}", 200] - }, - () => GetMarketplaceModelEndpointRequest, - () => GetMarketplaceModelEndpointResponse - ]; - var GetModelCopyJob = [ - 9, - n0, - _GMCJ, - { - [_ht]: ["GET", "/model-copy-jobs/{jobArn}", 200] - }, - () => GetModelCopyJobRequest, - () => GetModelCopyJobResponse - ]; - var GetModelCustomizationJob = [ - 9, - n0, - _GMCJe, - { - [_ht]: ["GET", "/model-customization-jobs/{jobIdentifier}", 200] - }, - () => GetModelCustomizationJobRequest, - () => GetModelCustomizationJobResponse - ]; - var GetModelImportJob = [ - 9, - n0, - _GMIJ, - { - [_ht]: ["GET", "/model-import-jobs/{jobIdentifier}", 200] - }, - () => GetModelImportJobRequest, - () => GetModelImportJobResponse - ]; - var GetModelInvocationJob = [ - 9, - n0, - _GMIJe, - { - [_ht]: ["GET", "/model-invocation-job/{jobIdentifier}", 200] - }, - () => GetModelInvocationJobRequest, - () => GetModelInvocationJobResponse - ]; - var GetModelInvocationLoggingConfiguration = [ - 9, - n0, - _GMILC, - { - [_ht]: ["GET", "/logging/modelinvocations", 200] - }, - () => GetModelInvocationLoggingConfigurationRequest, - () => GetModelInvocationLoggingConfigurationResponse - ]; - var GetPromptRouter = [ - 9, - n0, - _GPR, - { - [_ht]: ["GET", "/prompt-routers/{promptRouterArn}", 200] - }, - () => GetPromptRouterRequest, - () => GetPromptRouterResponse - ]; - var GetProvisionedModelThroughput = [ - 9, - n0, - _GPMT, - { - [_ht]: ["GET", "/provisioned-model-throughput/{provisionedModelId}", 200] - }, - () => GetProvisionedModelThroughputRequest, - () => GetProvisionedModelThroughputResponse - ]; - var GetUseCaseForModelAccess = [ - 9, - n0, - _GUCFMA, - { - [_ht]: ["GET", "/use-case-for-model-access", 200] - }, - () => GetUseCaseForModelAccessRequest, - () => GetUseCaseForModelAccessResponse - ]; - var ListAutomatedReasoningPolicies = [ - 9, - n0, - _LARP, - { - [_ht]: ["GET", "/automated-reasoning-policies", 200] - }, - () => ListAutomatedReasoningPoliciesRequest, - () => ListAutomatedReasoningPoliciesResponse - ]; - var ListAutomatedReasoningPolicyBuildWorkflows = [ - 9, - n0, - _LARPBW, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/build-workflows", 200] - }, - () => ListAutomatedReasoningPolicyBuildWorkflowsRequest, - () => ListAutomatedReasoningPolicyBuildWorkflowsResponse - ]; - var ListAutomatedReasoningPolicyTestCases = [ - 9, - n0, - _LARPTC, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/test-cases", 200] - }, - () => ListAutomatedReasoningPolicyTestCasesRequest, - () => ListAutomatedReasoningPolicyTestCasesResponse - ]; - var ListAutomatedReasoningPolicyTestResults = [ - 9, - n0, - _LARPTR, - { - [_ht]: ["GET", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-results", 200] - }, - () => ListAutomatedReasoningPolicyTestResultsRequest, - () => ListAutomatedReasoningPolicyTestResultsResponse - ]; - var ListCustomModelDeployments = [ - 9, - n0, - _LCMD, - { - [_ht]: ["GET", "/model-customization/custom-model-deployments", 200] - }, - () => ListCustomModelDeploymentsRequest, - () => ListCustomModelDeploymentsResponse - ]; - var ListCustomModels = [ - 9, - n0, - _LCM, - { - [_ht]: ["GET", "/custom-models", 200] - }, - () => ListCustomModelsRequest, - () => ListCustomModelsResponse - ]; - var ListEvaluationJobs = [ - 9, - n0, - _LEJ, - { - [_ht]: ["GET", "/evaluation-jobs", 200] - }, - () => ListEvaluationJobsRequest, - () => ListEvaluationJobsResponse - ]; - var ListFoundationModelAgreementOffers = [ - 9, - n0, - _LFMAO, - { - [_ht]: ["GET", "/list-foundation-model-agreement-offers/{modelId}", 200] - }, - () => ListFoundationModelAgreementOffersRequest, - () => ListFoundationModelAgreementOffersResponse - ]; - var ListFoundationModels = [ - 9, - n0, - _LFM, - { - [_ht]: ["GET", "/foundation-models", 200] - }, - () => ListFoundationModelsRequest, - () => ListFoundationModelsResponse - ]; - var ListGuardrails = [ - 9, - n0, - _LG, - { - [_ht]: ["GET", "/guardrails", 200] - }, - () => ListGuardrailsRequest, - () => ListGuardrailsResponse - ]; - var ListImportedModels = [ - 9, - n0, - _LIM, - { - [_ht]: ["GET", "/imported-models", 200] - }, - () => ListImportedModelsRequest, - () => ListImportedModelsResponse - ]; - var ListInferenceProfiles = [ - 9, - n0, - _LIP, - { - [_ht]: ["GET", "/inference-profiles", 200] - }, - () => ListInferenceProfilesRequest, - () => ListInferenceProfilesResponse - ]; - var ListMarketplaceModelEndpoints = [ - 9, - n0, - _LMME, - { - [_ht]: ["GET", "/marketplace-model/endpoints", 200] - }, - () => ListMarketplaceModelEndpointsRequest, - () => ListMarketplaceModelEndpointsResponse - ]; - var ListModelCopyJobs = [ - 9, - n0, - _LMCJ, - { - [_ht]: ["GET", "/model-copy-jobs", 200] - }, - () => ListModelCopyJobsRequest, - () => ListModelCopyJobsResponse - ]; - var ListModelCustomizationJobs = [ - 9, - n0, - _LMCJi, - { - [_ht]: ["GET", "/model-customization-jobs", 200] - }, - () => ListModelCustomizationJobsRequest, - () => ListModelCustomizationJobsResponse - ]; - var ListModelImportJobs = [ - 9, - n0, - _LMIJ, - { - [_ht]: ["GET", "/model-import-jobs", 200] - }, - () => ListModelImportJobsRequest, - () => ListModelImportJobsResponse - ]; - var ListModelInvocationJobs = [ - 9, - n0, - _LMIJi, - { - [_ht]: ["GET", "/model-invocation-jobs", 200] - }, - () => ListModelInvocationJobsRequest, - () => ListModelInvocationJobsResponse - ]; - var ListPromptRouters = [ - 9, - n0, - _LPR, - { - [_ht]: ["GET", "/prompt-routers", 200] - }, - () => ListPromptRoutersRequest, - () => ListPromptRoutersResponse - ]; - var ListProvisionedModelThroughputs = [ - 9, - n0, - _LPMT, - { - [_ht]: ["GET", "/provisioned-model-throughputs", 200] - }, - () => ListProvisionedModelThroughputsRequest, - () => ListProvisionedModelThroughputsResponse - ]; - var ListTagsForResource = [ - 9, - n0, - _LTFR, - { - [_ht]: ["POST", "/listTagsForResource", 200] - }, - () => ListTagsForResourceRequest, - () => ListTagsForResourceResponse - ]; - var PutModelInvocationLoggingConfiguration = [ - 9, - n0, - _PMILC, - { - [_ht]: ["PUT", "/logging/modelinvocations", 200] - }, - () => PutModelInvocationLoggingConfigurationRequest, - () => PutModelInvocationLoggingConfigurationResponse - ]; - var PutUseCaseForModelAccess = [ - 9, - n0, - _PUCFMA, - { - [_ht]: ["POST", "/use-case-for-model-access", 201] - }, - () => PutUseCaseForModelAccessRequest, - () => PutUseCaseForModelAccessResponse - ]; - var RegisterMarketplaceModelEndpoint = [ - 9, - n0, - _RMME, - { - [_ht]: ["POST", "/marketplace-model/endpoints/{endpointIdentifier}/registration", 200] - }, - () => RegisterMarketplaceModelEndpointRequest, - () => RegisterMarketplaceModelEndpointResponse - ]; - var StartAutomatedReasoningPolicyBuildWorkflow = [ - 9, - n0, - _SARPBW, - { - [_ht]: ["POST", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowType}/start", 200] - }, - () => StartAutomatedReasoningPolicyBuildWorkflowRequest, - () => StartAutomatedReasoningPolicyBuildWorkflowResponse - ]; - var StartAutomatedReasoningPolicyTestWorkflow = [ - 9, - n0, - _SARPTW, - { - [_ht]: ["POST", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-workflows", 200] - }, - () => StartAutomatedReasoningPolicyTestWorkflowRequest, - () => StartAutomatedReasoningPolicyTestWorkflowResponse - ]; - var StopEvaluationJob = [ - 9, - n0, - _SEJ, - { - [_ht]: ["POST", "/evaluation-job/{jobIdentifier}/stop", 200] - }, - () => StopEvaluationJobRequest, - () => StopEvaluationJobResponse - ]; - var StopModelCustomizationJob = [ - 9, - n0, - _SMCJ, - { - [_ht]: ["POST", "/model-customization-jobs/{jobIdentifier}/stop", 200] - }, - () => StopModelCustomizationJobRequest, - () => StopModelCustomizationJobResponse - ]; - var StopModelInvocationJob = [ - 9, - n0, - _SMIJ, - { - [_ht]: ["POST", "/model-invocation-job/{jobIdentifier}/stop", 200] - }, - () => StopModelInvocationJobRequest, - () => StopModelInvocationJobResponse - ]; - var TagResource = [ - 9, - n0, - _TR, - { - [_ht]: ["POST", "/tagResource", 200] - }, - () => TagResourceRequest, - () => TagResourceResponse - ]; - var UntagResource = [ - 9, - n0, - _UR, - { - [_ht]: ["POST", "/untagResource", 200] - }, - () => UntagResourceRequest, - () => UntagResourceResponse - ]; - var UpdateAutomatedReasoningPolicy = [ - 9, - n0, - _UARP, - { - [_ht]: ["PATCH", "/automated-reasoning-policies/{policyArn}", 200] - }, - () => UpdateAutomatedReasoningPolicyRequest, - () => UpdateAutomatedReasoningPolicyResponse - ]; - var UpdateAutomatedReasoningPolicyAnnotations = [ - 9, - n0, - _UARPA, - { - [_ht]: ["PATCH", "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations", 200] - }, - () => UpdateAutomatedReasoningPolicyAnnotationsRequest, - () => UpdateAutomatedReasoningPolicyAnnotationsResponse - ]; - var UpdateAutomatedReasoningPolicyTestCase = [ - 9, - n0, - _UARPTC, - { - [_ht]: ["PATCH", "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", 200] - }, - () => UpdateAutomatedReasoningPolicyTestCaseRequest, - () => UpdateAutomatedReasoningPolicyTestCaseResponse - ]; - var UpdateGuardrail = [ - 9, - n0, - _UG, - { - [_ht]: ["PUT", "/guardrails/{guardrailIdentifier}", 202] - }, - () => UpdateGuardrailRequest, - () => UpdateGuardrailResponse - ]; - var UpdateMarketplaceModelEndpoint = [ - 9, - n0, - _UMME, - { - [_ht]: ["PATCH", "/marketplace-model/endpoints/{endpointArn}", 200] - }, - () => UpdateMarketplaceModelEndpointRequest, - () => UpdateMarketplaceModelEndpointResponse - ]; - var UpdateProvisionedModelThroughput = [ - 9, - n0, - _UPMT, - { - [_ht]: ["PATCH", "/provisioned-model-throughput/{provisionedModelId}", 200] - }, - () => UpdateProvisionedModelThroughputRequest, - () => UpdateProvisionedModelThroughputResponse - ]; - - class BatchDeleteEvaluationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "BatchDeleteEvaluationJob", {}).n("BedrockClient", "BatchDeleteEvaluationJobCommand").sc(BatchDeleteEvaluationJob).build() { - } - - class CancelAutomatedReasoningPolicyBuildWorkflowCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CancelAutomatedReasoningPolicyBuildWorkflow", {}).n("BedrockClient", "CancelAutomatedReasoningPolicyBuildWorkflowCommand").sc(CancelAutomatedReasoningPolicyBuildWorkflow).build() { - } - - class CreateAutomatedReasoningPolicyCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateAutomatedReasoningPolicy", {}).n("BedrockClient", "CreateAutomatedReasoningPolicyCommand").sc(CreateAutomatedReasoningPolicy).build() { - } - - class CreateAutomatedReasoningPolicyTestCaseCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateAutomatedReasoningPolicyTestCase", {}).n("BedrockClient", "CreateAutomatedReasoningPolicyTestCaseCommand").sc(CreateAutomatedReasoningPolicyTestCase).build() { - } - - class CreateAutomatedReasoningPolicyVersionCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateAutomatedReasoningPolicyVersion", {}).n("BedrockClient", "CreateAutomatedReasoningPolicyVersionCommand").sc(CreateAutomatedReasoningPolicyVersion).build() { - } - - class CreateCustomModelCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateCustomModel", {}).n("BedrockClient", "CreateCustomModelCommand").sc(CreateCustomModel).build() { - } - - class CreateCustomModelDeploymentCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateCustomModelDeployment", {}).n("BedrockClient", "CreateCustomModelDeploymentCommand").sc(CreateCustomModelDeployment).build() { - } - - class CreateEvaluationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateEvaluationJob", {}).n("BedrockClient", "CreateEvaluationJobCommand").sc(CreateEvaluationJob).build() { - } - - class CreateFoundationModelAgreementCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateFoundationModelAgreement", {}).n("BedrockClient", "CreateFoundationModelAgreementCommand").sc(CreateFoundationModelAgreement).build() { - } - - class CreateGuardrailCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateGuardrail", {}).n("BedrockClient", "CreateGuardrailCommand").sc(CreateGuardrail).build() { - } - - class CreateGuardrailVersionCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateGuardrailVersion", {}).n("BedrockClient", "CreateGuardrailVersionCommand").sc(CreateGuardrailVersion).build() { - } - - class CreateInferenceProfileCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateInferenceProfile", {}).n("BedrockClient", "CreateInferenceProfileCommand").sc(CreateInferenceProfile).build() { - } - - class CreateMarketplaceModelEndpointCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateMarketplaceModelEndpoint", {}).n("BedrockClient", "CreateMarketplaceModelEndpointCommand").sc(CreateMarketplaceModelEndpoint).build() { - } - - class CreateModelCopyJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateModelCopyJob", {}).n("BedrockClient", "CreateModelCopyJobCommand").sc(CreateModelCopyJob).build() { - } - - class CreateModelCustomizationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateModelCustomizationJob", {}).n("BedrockClient", "CreateModelCustomizationJobCommand").sc(CreateModelCustomizationJob).build() { - } - - class CreateModelImportJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateModelImportJob", {}).n("BedrockClient", "CreateModelImportJobCommand").sc(CreateModelImportJob).build() { - } - - class CreateModelInvocationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateModelInvocationJob", {}).n("BedrockClient", "CreateModelInvocationJobCommand").sc(CreateModelInvocationJob).build() { - } - - class CreatePromptRouterCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreatePromptRouter", {}).n("BedrockClient", "CreatePromptRouterCommand").sc(CreatePromptRouter).build() { - } - - class CreateProvisionedModelThroughputCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "CreateProvisionedModelThroughput", {}).n("BedrockClient", "CreateProvisionedModelThroughputCommand").sc(CreateProvisionedModelThroughput).build() { - } - - class DeleteAutomatedReasoningPolicyBuildWorkflowCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteAutomatedReasoningPolicyBuildWorkflow", {}).n("BedrockClient", "DeleteAutomatedReasoningPolicyBuildWorkflowCommand").sc(DeleteAutomatedReasoningPolicyBuildWorkflow).build() { - } - - class DeleteAutomatedReasoningPolicyCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteAutomatedReasoningPolicy", {}).n("BedrockClient", "DeleteAutomatedReasoningPolicyCommand").sc(DeleteAutomatedReasoningPolicy).build() { - } - - class DeleteAutomatedReasoningPolicyTestCaseCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteAutomatedReasoningPolicyTestCase", {}).n("BedrockClient", "DeleteAutomatedReasoningPolicyTestCaseCommand").sc(DeleteAutomatedReasoningPolicyTestCase).build() { - } - - class DeleteCustomModelCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteCustomModel", {}).n("BedrockClient", "DeleteCustomModelCommand").sc(DeleteCustomModel).build() { - } - - class DeleteCustomModelDeploymentCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteCustomModelDeployment", {}).n("BedrockClient", "DeleteCustomModelDeploymentCommand").sc(DeleteCustomModelDeployment).build() { - } - - class DeleteFoundationModelAgreementCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteFoundationModelAgreement", {}).n("BedrockClient", "DeleteFoundationModelAgreementCommand").sc(DeleteFoundationModelAgreement).build() { - } - - class DeleteGuardrailCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteGuardrail", {}).n("BedrockClient", "DeleteGuardrailCommand").sc(DeleteGuardrail).build() { - } - - class DeleteImportedModelCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteImportedModel", {}).n("BedrockClient", "DeleteImportedModelCommand").sc(DeleteImportedModel).build() { - } - - class DeleteInferenceProfileCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteInferenceProfile", {}).n("BedrockClient", "DeleteInferenceProfileCommand").sc(DeleteInferenceProfile).build() { - } - - class DeleteMarketplaceModelEndpointCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteMarketplaceModelEndpoint", {}).n("BedrockClient", "DeleteMarketplaceModelEndpointCommand").sc(DeleteMarketplaceModelEndpoint).build() { - } - - class DeleteModelInvocationLoggingConfigurationCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteModelInvocationLoggingConfiguration", {}).n("BedrockClient", "DeleteModelInvocationLoggingConfigurationCommand").sc(DeleteModelInvocationLoggingConfiguration).build() { - } - - class DeletePromptRouterCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeletePromptRouter", {}).n("BedrockClient", "DeletePromptRouterCommand").sc(DeletePromptRouter).build() { - } - - class DeleteProvisionedModelThroughputCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeleteProvisionedModelThroughput", {}).n("BedrockClient", "DeleteProvisionedModelThroughputCommand").sc(DeleteProvisionedModelThroughput).build() { - } - - class DeregisterMarketplaceModelEndpointCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "DeregisterMarketplaceModelEndpoint", {}).n("BedrockClient", "DeregisterMarketplaceModelEndpointCommand").sc(DeregisterMarketplaceModelEndpoint).build() { - } - - class ExportAutomatedReasoningPolicyVersionCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ExportAutomatedReasoningPolicyVersion", {}).n("BedrockClient", "ExportAutomatedReasoningPolicyVersionCommand").sc(ExportAutomatedReasoningPolicyVersion).build() { - } - - class GetAutomatedReasoningPolicyAnnotationsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetAutomatedReasoningPolicyAnnotations", {}).n("BedrockClient", "GetAutomatedReasoningPolicyAnnotationsCommand").sc(GetAutomatedReasoningPolicyAnnotations).build() { - } - - class GetAutomatedReasoningPolicyBuildWorkflowCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetAutomatedReasoningPolicyBuildWorkflow", {}).n("BedrockClient", "GetAutomatedReasoningPolicyBuildWorkflowCommand").sc(GetAutomatedReasoningPolicyBuildWorkflow).build() { - } - - class GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetAutomatedReasoningPolicyBuildWorkflowResultAssets", {}).n("BedrockClient", "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand").sc(GetAutomatedReasoningPolicyBuildWorkflowResultAssets).build() { - } - - class GetAutomatedReasoningPolicyCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetAutomatedReasoningPolicy", {}).n("BedrockClient", "GetAutomatedReasoningPolicyCommand").sc(GetAutomatedReasoningPolicy).build() { - } - - class GetAutomatedReasoningPolicyNextScenarioCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetAutomatedReasoningPolicyNextScenario", {}).n("BedrockClient", "GetAutomatedReasoningPolicyNextScenarioCommand").sc(GetAutomatedReasoningPolicyNextScenario).build() { - } - - class GetAutomatedReasoningPolicyTestCaseCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetAutomatedReasoningPolicyTestCase", {}).n("BedrockClient", "GetAutomatedReasoningPolicyTestCaseCommand").sc(GetAutomatedReasoningPolicyTestCase).build() { - } - - class GetAutomatedReasoningPolicyTestResultCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetAutomatedReasoningPolicyTestResult", {}).n("BedrockClient", "GetAutomatedReasoningPolicyTestResultCommand").sc(GetAutomatedReasoningPolicyTestResult).build() { - } - - class GetCustomModelCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetCustomModel", {}).n("BedrockClient", "GetCustomModelCommand").sc(GetCustomModel).build() { - } - - class GetCustomModelDeploymentCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetCustomModelDeployment", {}).n("BedrockClient", "GetCustomModelDeploymentCommand").sc(GetCustomModelDeployment).build() { - } - - class GetEvaluationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetEvaluationJob", {}).n("BedrockClient", "GetEvaluationJobCommand").sc(GetEvaluationJob).build() { - } - - class GetFoundationModelAvailabilityCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetFoundationModelAvailability", {}).n("BedrockClient", "GetFoundationModelAvailabilityCommand").sc(GetFoundationModelAvailability).build() { - } - - class GetFoundationModelCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetFoundationModel", {}).n("BedrockClient", "GetFoundationModelCommand").sc(GetFoundationModel).build() { - } - - class GetGuardrailCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetGuardrail", {}).n("BedrockClient", "GetGuardrailCommand").sc(GetGuardrail).build() { - } - - class GetImportedModelCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetImportedModel", {}).n("BedrockClient", "GetImportedModelCommand").sc(GetImportedModel).build() { - } - - class GetInferenceProfileCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetInferenceProfile", {}).n("BedrockClient", "GetInferenceProfileCommand").sc(GetInferenceProfile).build() { - } - - class GetMarketplaceModelEndpointCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetMarketplaceModelEndpoint", {}).n("BedrockClient", "GetMarketplaceModelEndpointCommand").sc(GetMarketplaceModelEndpoint).build() { - } - - class GetModelCopyJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetModelCopyJob", {}).n("BedrockClient", "GetModelCopyJobCommand").sc(GetModelCopyJob).build() { - } - - class GetModelCustomizationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetModelCustomizationJob", {}).n("BedrockClient", "GetModelCustomizationJobCommand").sc(GetModelCustomizationJob).build() { - } - - class GetModelImportJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetModelImportJob", {}).n("BedrockClient", "GetModelImportJobCommand").sc(GetModelImportJob).build() { - } - - class GetModelInvocationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetModelInvocationJob", {}).n("BedrockClient", "GetModelInvocationJobCommand").sc(GetModelInvocationJob).build() { - } - - class GetModelInvocationLoggingConfigurationCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetModelInvocationLoggingConfiguration", {}).n("BedrockClient", "GetModelInvocationLoggingConfigurationCommand").sc(GetModelInvocationLoggingConfiguration).build() { - } - - class GetPromptRouterCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetPromptRouter", {}).n("BedrockClient", "GetPromptRouterCommand").sc(GetPromptRouter).build() { - } - - class GetProvisionedModelThroughputCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetProvisionedModelThroughput", {}).n("BedrockClient", "GetProvisionedModelThroughputCommand").sc(GetProvisionedModelThroughput).build() { - } - - class GetUseCaseForModelAccessCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "GetUseCaseForModelAccess", {}).n("BedrockClient", "GetUseCaseForModelAccessCommand").sc(GetUseCaseForModelAccess).build() { - } - - class ListAutomatedReasoningPoliciesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListAutomatedReasoningPolicies", {}).n("BedrockClient", "ListAutomatedReasoningPoliciesCommand").sc(ListAutomatedReasoningPolicies).build() { - } - - class ListAutomatedReasoningPolicyBuildWorkflowsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListAutomatedReasoningPolicyBuildWorkflows", {}).n("BedrockClient", "ListAutomatedReasoningPolicyBuildWorkflowsCommand").sc(ListAutomatedReasoningPolicyBuildWorkflows).build() { - } - - class ListAutomatedReasoningPolicyTestCasesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListAutomatedReasoningPolicyTestCases", {}).n("BedrockClient", "ListAutomatedReasoningPolicyTestCasesCommand").sc(ListAutomatedReasoningPolicyTestCases).build() { - } - - class ListAutomatedReasoningPolicyTestResultsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListAutomatedReasoningPolicyTestResults", {}).n("BedrockClient", "ListAutomatedReasoningPolicyTestResultsCommand").sc(ListAutomatedReasoningPolicyTestResults).build() { - } - - class ListCustomModelDeploymentsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListCustomModelDeployments", {}).n("BedrockClient", "ListCustomModelDeploymentsCommand").sc(ListCustomModelDeployments).build() { - } - - class ListCustomModelsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListCustomModels", {}).n("BedrockClient", "ListCustomModelsCommand").sc(ListCustomModels).build() { - } - - class ListEvaluationJobsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListEvaluationJobs", {}).n("BedrockClient", "ListEvaluationJobsCommand").sc(ListEvaluationJobs).build() { - } - - class ListFoundationModelAgreementOffersCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListFoundationModelAgreementOffers", {}).n("BedrockClient", "ListFoundationModelAgreementOffersCommand").sc(ListFoundationModelAgreementOffers).build() { - } - - class ListFoundationModelsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListFoundationModels", {}).n("BedrockClient", "ListFoundationModelsCommand").sc(ListFoundationModels).build() { - } - - class ListGuardrailsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListGuardrails", {}).n("BedrockClient", "ListGuardrailsCommand").sc(ListGuardrails).build() { - } - - class ListImportedModelsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListImportedModels", {}).n("BedrockClient", "ListImportedModelsCommand").sc(ListImportedModels).build() { - } - - class ListInferenceProfilesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListInferenceProfiles", {}).n("BedrockClient", "ListInferenceProfilesCommand").sc(ListInferenceProfiles).build() { - } - - class ListMarketplaceModelEndpointsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListMarketplaceModelEndpoints", {}).n("BedrockClient", "ListMarketplaceModelEndpointsCommand").sc(ListMarketplaceModelEndpoints).build() { - } - - class ListModelCopyJobsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListModelCopyJobs", {}).n("BedrockClient", "ListModelCopyJobsCommand").sc(ListModelCopyJobs).build() { - } - - class ListModelCustomizationJobsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListModelCustomizationJobs", {}).n("BedrockClient", "ListModelCustomizationJobsCommand").sc(ListModelCustomizationJobs).build() { - } - - class ListModelImportJobsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListModelImportJobs", {}).n("BedrockClient", "ListModelImportJobsCommand").sc(ListModelImportJobs).build() { - } - - class ListModelInvocationJobsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListModelInvocationJobs", {}).n("BedrockClient", "ListModelInvocationJobsCommand").sc(ListModelInvocationJobs).build() { - } - - class ListPromptRoutersCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListPromptRouters", {}).n("BedrockClient", "ListPromptRoutersCommand").sc(ListPromptRouters).build() { - } - - class ListProvisionedModelThroughputsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListProvisionedModelThroughputs", {}).n("BedrockClient", "ListProvisionedModelThroughputsCommand").sc(ListProvisionedModelThroughputs).build() { - } - - class ListTagsForResourceCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "ListTagsForResource", {}).n("BedrockClient", "ListTagsForResourceCommand").sc(ListTagsForResource).build() { - } - - class PutModelInvocationLoggingConfigurationCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "PutModelInvocationLoggingConfiguration", {}).n("BedrockClient", "PutModelInvocationLoggingConfigurationCommand").sc(PutModelInvocationLoggingConfiguration).build() { - } - - class PutUseCaseForModelAccessCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "PutUseCaseForModelAccess", {}).n("BedrockClient", "PutUseCaseForModelAccessCommand").sc(PutUseCaseForModelAccess).build() { - } - - class RegisterMarketplaceModelEndpointCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "RegisterMarketplaceModelEndpoint", {}).n("BedrockClient", "RegisterMarketplaceModelEndpointCommand").sc(RegisterMarketplaceModelEndpoint).build() { - } - - class StartAutomatedReasoningPolicyBuildWorkflowCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "StartAutomatedReasoningPolicyBuildWorkflow", {}).n("BedrockClient", "StartAutomatedReasoningPolicyBuildWorkflowCommand").sc(StartAutomatedReasoningPolicyBuildWorkflow).build() { - } - - class StartAutomatedReasoningPolicyTestWorkflowCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "StartAutomatedReasoningPolicyTestWorkflow", {}).n("BedrockClient", "StartAutomatedReasoningPolicyTestWorkflowCommand").sc(StartAutomatedReasoningPolicyTestWorkflow).build() { - } - - class StopEvaluationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "StopEvaluationJob", {}).n("BedrockClient", "StopEvaluationJobCommand").sc(StopEvaluationJob).build() { - } - - class StopModelCustomizationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "StopModelCustomizationJob", {}).n("BedrockClient", "StopModelCustomizationJobCommand").sc(StopModelCustomizationJob).build() { - } - - class StopModelInvocationJobCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "StopModelInvocationJob", {}).n("BedrockClient", "StopModelInvocationJobCommand").sc(StopModelInvocationJob).build() { - } - - class TagResourceCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "TagResource", {}).n("BedrockClient", "TagResourceCommand").sc(TagResource).build() { - } - - class UntagResourceCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "UntagResource", {}).n("BedrockClient", "UntagResourceCommand").sc(UntagResource).build() { - } - - class UpdateAutomatedReasoningPolicyAnnotationsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "UpdateAutomatedReasoningPolicyAnnotations", {}).n("BedrockClient", "UpdateAutomatedReasoningPolicyAnnotationsCommand").sc(UpdateAutomatedReasoningPolicyAnnotations).build() { - } - - class UpdateAutomatedReasoningPolicyCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "UpdateAutomatedReasoningPolicy", {}).n("BedrockClient", "UpdateAutomatedReasoningPolicyCommand").sc(UpdateAutomatedReasoningPolicy).build() { - } - - class UpdateAutomatedReasoningPolicyTestCaseCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "UpdateAutomatedReasoningPolicyTestCase", {}).n("BedrockClient", "UpdateAutomatedReasoningPolicyTestCaseCommand").sc(UpdateAutomatedReasoningPolicyTestCase).build() { - } - - class UpdateGuardrailCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "UpdateGuardrail", {}).n("BedrockClient", "UpdateGuardrailCommand").sc(UpdateGuardrail).build() { - } - - class UpdateMarketplaceModelEndpointCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "UpdateMarketplaceModelEndpoint", {}).n("BedrockClient", "UpdateMarketplaceModelEndpointCommand").sc(UpdateMarketplaceModelEndpoint).build() { - } - - class UpdateProvisionedModelThroughputCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockControlPlaneService", "UpdateProvisionedModelThroughput", {}).n("BedrockClient", "UpdateProvisionedModelThroughputCommand").sc(UpdateProvisionedModelThroughput).build() { - } - var commands = { - BatchDeleteEvaluationJobCommand, - CancelAutomatedReasoningPolicyBuildWorkflowCommand, - CreateAutomatedReasoningPolicyCommand, - CreateAutomatedReasoningPolicyTestCaseCommand, - CreateAutomatedReasoningPolicyVersionCommand, - CreateCustomModelCommand, - CreateCustomModelDeploymentCommand, - CreateEvaluationJobCommand, - CreateFoundationModelAgreementCommand, - CreateGuardrailCommand, - CreateGuardrailVersionCommand, - CreateInferenceProfileCommand, - CreateMarketplaceModelEndpointCommand, - CreateModelCopyJobCommand, - CreateModelCustomizationJobCommand, - CreateModelImportJobCommand, - CreateModelInvocationJobCommand, - CreatePromptRouterCommand, - CreateProvisionedModelThroughputCommand, - DeleteAutomatedReasoningPolicyCommand, - DeleteAutomatedReasoningPolicyBuildWorkflowCommand, - DeleteAutomatedReasoningPolicyTestCaseCommand, - DeleteCustomModelCommand, - DeleteCustomModelDeploymentCommand, - DeleteFoundationModelAgreementCommand, - DeleteGuardrailCommand, - DeleteImportedModelCommand, - DeleteInferenceProfileCommand, - DeleteMarketplaceModelEndpointCommand, - DeleteModelInvocationLoggingConfigurationCommand, - DeletePromptRouterCommand, - DeleteProvisionedModelThroughputCommand, - DeregisterMarketplaceModelEndpointCommand, - ExportAutomatedReasoningPolicyVersionCommand, - GetAutomatedReasoningPolicyCommand, - GetAutomatedReasoningPolicyAnnotationsCommand, - GetAutomatedReasoningPolicyBuildWorkflowCommand, - GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand, - GetAutomatedReasoningPolicyNextScenarioCommand, - GetAutomatedReasoningPolicyTestCaseCommand, - GetAutomatedReasoningPolicyTestResultCommand, - GetCustomModelCommand, - GetCustomModelDeploymentCommand, - GetEvaluationJobCommand, - GetFoundationModelCommand, - GetFoundationModelAvailabilityCommand, - GetGuardrailCommand, - GetImportedModelCommand, - GetInferenceProfileCommand, - GetMarketplaceModelEndpointCommand, - GetModelCopyJobCommand, - GetModelCustomizationJobCommand, - GetModelImportJobCommand, - GetModelInvocationJobCommand, - GetModelInvocationLoggingConfigurationCommand, - GetPromptRouterCommand, - GetProvisionedModelThroughputCommand, - GetUseCaseForModelAccessCommand, - ListAutomatedReasoningPoliciesCommand, - ListAutomatedReasoningPolicyBuildWorkflowsCommand, - ListAutomatedReasoningPolicyTestCasesCommand, - ListAutomatedReasoningPolicyTestResultsCommand, - ListCustomModelDeploymentsCommand, - ListCustomModelsCommand, - ListEvaluationJobsCommand, - ListFoundationModelAgreementOffersCommand, - ListFoundationModelsCommand, - ListGuardrailsCommand, - ListImportedModelsCommand, - ListInferenceProfilesCommand, - ListMarketplaceModelEndpointsCommand, - ListModelCopyJobsCommand, - ListModelCustomizationJobsCommand, - ListModelImportJobsCommand, - ListModelInvocationJobsCommand, - ListPromptRoutersCommand, - ListProvisionedModelThroughputsCommand, - ListTagsForResourceCommand, - PutModelInvocationLoggingConfigurationCommand, - PutUseCaseForModelAccessCommand, - RegisterMarketplaceModelEndpointCommand, - StartAutomatedReasoningPolicyBuildWorkflowCommand, - StartAutomatedReasoningPolicyTestWorkflowCommand, - StopEvaluationJobCommand, - StopModelCustomizationJobCommand, - StopModelInvocationJobCommand, - TagResourceCommand, - UntagResourceCommand, - UpdateAutomatedReasoningPolicyCommand, - UpdateAutomatedReasoningPolicyAnnotationsCommand, - UpdateAutomatedReasoningPolicyTestCaseCommand, - UpdateGuardrailCommand, - UpdateMarketplaceModelEndpointCommand, - UpdateProvisionedModelThroughputCommand - }; - - class Bedrock extends BedrockClient { - } - smithyClient.createAggregatedClient(commands, Bedrock); - var paginateListAutomatedReasoningPolicies = core2.createPaginator(BedrockClient, ListAutomatedReasoningPoliciesCommand, "nextToken", "nextToken", "maxResults"); - var paginateListAutomatedReasoningPolicyBuildWorkflows = core2.createPaginator(BedrockClient, ListAutomatedReasoningPolicyBuildWorkflowsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListAutomatedReasoningPolicyTestCases = core2.createPaginator(BedrockClient, ListAutomatedReasoningPolicyTestCasesCommand, "nextToken", "nextToken", "maxResults"); - var paginateListAutomatedReasoningPolicyTestResults = core2.createPaginator(BedrockClient, ListAutomatedReasoningPolicyTestResultsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListCustomModelDeployments = core2.createPaginator(BedrockClient, ListCustomModelDeploymentsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListCustomModels = core2.createPaginator(BedrockClient, ListCustomModelsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListEvaluationJobs = core2.createPaginator(BedrockClient, ListEvaluationJobsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListGuardrails = core2.createPaginator(BedrockClient, ListGuardrailsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListImportedModels = core2.createPaginator(BedrockClient, ListImportedModelsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListInferenceProfiles = core2.createPaginator(BedrockClient, ListInferenceProfilesCommand, "nextToken", "nextToken", "maxResults"); - var paginateListMarketplaceModelEndpoints = core2.createPaginator(BedrockClient, ListMarketplaceModelEndpointsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListModelCopyJobs = core2.createPaginator(BedrockClient, ListModelCopyJobsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListModelCustomizationJobs = core2.createPaginator(BedrockClient, ListModelCustomizationJobsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListModelImportJobs = core2.createPaginator(BedrockClient, ListModelImportJobsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListModelInvocationJobs = core2.createPaginator(BedrockClient, ListModelInvocationJobsCommand, "nextToken", "nextToken", "maxResults"); - var paginateListPromptRouters = core2.createPaginator(BedrockClient, ListPromptRoutersCommand, "nextToken", "nextToken", "maxResults"); - var paginateListProvisionedModelThroughputs = core2.createPaginator(BedrockClient, ListProvisionedModelThroughputsCommand, "nextToken", "nextToken", "maxResults"); - var AgreementStatus = { - AVAILABLE: "AVAILABLE", - ERROR: "ERROR", - NOT_AVAILABLE: "NOT_AVAILABLE", - PENDING: "PENDING" - }; - var AutomatedReasoningCheckResult = { - IMPOSSIBLE: "IMPOSSIBLE", - INVALID: "INVALID", - NO_TRANSLATION: "NO_TRANSLATION", - SATISFIABLE: "SATISFIABLE", - TOO_COMPLEX: "TOO_COMPLEX", - TRANSLATION_AMBIGUOUS: "TRANSLATION_AMBIGUOUS", - VALID: "VALID" - }; - var AutomatedReasoningPolicyBuildWorkflowType = { - IMPORT_POLICY: "IMPORT_POLICY", - INGEST_CONTENT: "INGEST_CONTENT", - REFINE_POLICY: "REFINE_POLICY" - }; - var AutomatedReasoningPolicyBuildDocumentContentType = { - PDF: "pdf", - TEXT: "txt" - }; - var AutomatedReasoningPolicyBuildWorkflowStatus = { - BUILDING: "BUILDING", - CANCELLED: "CANCELLED", - CANCEL_REQUESTED: "CANCEL_REQUESTED", - COMPLETED: "COMPLETED", - FAILED: "FAILED", - PREPROCESSING: "PREPROCESSING", - SCHEDULED: "SCHEDULED", - TESTING: "TESTING" - }; - var AutomatedReasoningPolicyBuildResultAssetType = { - BUILD_LOG: "BUILD_LOG", - GENERATED_TEST_CASES: "GENERATED_TEST_CASES", - POLICY_DEFINITION: "POLICY_DEFINITION", - QUALITY_REPORT: "QUALITY_REPORT" - }; - var AutomatedReasoningPolicyBuildMessageType = { - ERROR: "ERROR", - INFO: "INFO", - WARNING: "WARNING" - }; - var AutomatedReasoningPolicyAnnotationStatus = { - APPLIED: "APPLIED", - FAILED: "FAILED" - }; - var AutomatedReasoningCheckLogicWarningType = { - ALWAYS_FALSE: "ALWAYS_FALSE", - ALWAYS_TRUE: "ALWAYS_TRUE" - }; - var AutomatedReasoningPolicyTestRunResult = { - FAILED: "FAILED", - PASSED: "PASSED" - }; - var AutomatedReasoningPolicyTestRunStatus = { - COMPLETED: "COMPLETED", - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", - NOT_STARTED: "NOT_STARTED", - SCHEDULED: "SCHEDULED" - }; - var Status = { - INCOMPATIBLE_ENDPOINT: "INCOMPATIBLE_ENDPOINT", - REGISTERED: "REGISTERED" - }; - var CustomModelDeploymentStatus = { - ACTIVE: "Active", - CREATING: "Creating", - FAILED: "Failed" - }; - var SortModelsBy = { - CREATION_TIME: "CreationTime" - }; - var SortOrder = { - ASCENDING: "Ascending", - DESCENDING: "Descending" - }; - var CustomizationType = { - CONTINUED_PRE_TRAINING: "CONTINUED_PRE_TRAINING", - DISTILLATION: "DISTILLATION", - FINE_TUNING: "FINE_TUNING", - IMPORTED: "IMPORTED" - }; - var ModelStatus = { - ACTIVE: "Active", - CREATING: "Creating", - FAILED: "Failed" - }; - var EvaluationJobStatus = { - COMPLETED: "Completed", - DELETING: "Deleting", - FAILED: "Failed", - IN_PROGRESS: "InProgress", - STOPPED: "Stopped", - STOPPING: "Stopping" - }; - var ApplicationType = { - MODEL_EVALUATION: "ModelEvaluation", - RAG_EVALUATION: "RagEvaluation" - }; - var EvaluationTaskType = { - CLASSIFICATION: "Classification", - CUSTOM: "Custom", - GENERATION: "Generation", - QUESTION_AND_ANSWER: "QuestionAndAnswer", - SUMMARIZATION: "Summarization" - }; - var PerformanceConfigLatency = { - OPTIMIZED: "optimized", - STANDARD: "standard" - }; - var ExternalSourceType = { - BYTE_CONTENT: "BYTE_CONTENT", - S3: "S3" - }; - var QueryTransformationType = { - QUERY_DECOMPOSITION: "QUERY_DECOMPOSITION" - }; - var AttributeType = { - BOOLEAN: "BOOLEAN", - NUMBER: "NUMBER", - STRING: "STRING", - STRING_LIST: "STRING_LIST" - }; - var SearchType = { - HYBRID: "HYBRID", - SEMANTIC: "SEMANTIC" - }; - var RerankingMetadataSelectionMode = { - ALL: "ALL", - SELECTIVE: "SELECTIVE" - }; - var VectorSearchRerankingConfigurationType = { - BEDROCK_RERANKING_MODEL: "BEDROCK_RERANKING_MODEL" - }; - var RetrieveAndGenerateType = { - EXTERNAL_SOURCES: "EXTERNAL_SOURCES", - KNOWLEDGE_BASE: "KNOWLEDGE_BASE" - }; - var EvaluationJobType = { - AUTOMATED: "Automated", - HUMAN: "Human" - }; - var SortJobsBy = { - CREATION_TIME: "CreationTime" - }; - var GuardrailContentFilterAction = { - BLOCK: "BLOCK", - NONE: "NONE" - }; - var GuardrailModality = { - IMAGE: "IMAGE", - TEXT: "TEXT" - }; - var GuardrailFilterStrength = { - HIGH: "HIGH", - LOW: "LOW", - MEDIUM: "MEDIUM", - NONE: "NONE" - }; - var GuardrailContentFilterType = { - HATE: "HATE", - INSULTS: "INSULTS", - MISCONDUCT: "MISCONDUCT", - PROMPT_ATTACK: "PROMPT_ATTACK", - SEXUAL: "SEXUAL", - VIOLENCE: "VIOLENCE" - }; - var GuardrailContentFiltersTierName = { - CLASSIC: "CLASSIC", - STANDARD: "STANDARD" - }; - var GuardrailContextualGroundingAction = { - BLOCK: "BLOCK", - NONE: "NONE" - }; - var GuardrailContextualGroundingFilterType = { - GROUNDING: "GROUNDING", - RELEVANCE: "RELEVANCE" - }; - var GuardrailSensitiveInformationAction = { - ANONYMIZE: "ANONYMIZE", - BLOCK: "BLOCK", - NONE: "NONE" - }; - var GuardrailPiiEntityType = { - ADDRESS: "ADDRESS", - AGE: "AGE", - AWS_ACCESS_KEY: "AWS_ACCESS_KEY", - AWS_SECRET_KEY: "AWS_SECRET_KEY", - CA_HEALTH_NUMBER: "CA_HEALTH_NUMBER", - CA_SOCIAL_INSURANCE_NUMBER: "CA_SOCIAL_INSURANCE_NUMBER", - CREDIT_DEBIT_CARD_CVV: "CREDIT_DEBIT_CARD_CVV", - CREDIT_DEBIT_CARD_EXPIRY: "CREDIT_DEBIT_CARD_EXPIRY", - CREDIT_DEBIT_CARD_NUMBER: "CREDIT_DEBIT_CARD_NUMBER", - DRIVER_ID: "DRIVER_ID", - EMAIL: "EMAIL", - INTERNATIONAL_BANK_ACCOUNT_NUMBER: "INTERNATIONAL_BANK_ACCOUNT_NUMBER", - IP_ADDRESS: "IP_ADDRESS", - LICENSE_PLATE: "LICENSE_PLATE", - MAC_ADDRESS: "MAC_ADDRESS", - NAME: "NAME", - PASSWORD: "PASSWORD", - PHONE: "PHONE", - PIN: "PIN", - SWIFT_CODE: "SWIFT_CODE", - UK_NATIONAL_HEALTH_SERVICE_NUMBER: "UK_NATIONAL_HEALTH_SERVICE_NUMBER", - UK_NATIONAL_INSURANCE_NUMBER: "UK_NATIONAL_INSURANCE_NUMBER", - UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER: "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER", - URL: "URL", - USERNAME: "USERNAME", - US_BANK_ACCOUNT_NUMBER: "US_BANK_ACCOUNT_NUMBER", - US_BANK_ROUTING_NUMBER: "US_BANK_ROUTING_NUMBER", - US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER", - US_PASSPORT_NUMBER: "US_PASSPORT_NUMBER", - US_SOCIAL_SECURITY_NUMBER: "US_SOCIAL_SECURITY_NUMBER", - VEHICLE_IDENTIFICATION_NUMBER: "VEHICLE_IDENTIFICATION_NUMBER" - }; - var GuardrailTopicsTierName = { - CLASSIC: "CLASSIC", - STANDARD: "STANDARD" - }; - var GuardrailTopicAction = { - BLOCK: "BLOCK", - NONE: "NONE" - }; - var GuardrailTopicType = { - DENY: "DENY" - }; - var GuardrailWordAction = { - BLOCK: "BLOCK", - NONE: "NONE" - }; - var GuardrailManagedWordsType = { - PROFANITY: "PROFANITY" - }; - var GuardrailStatus = { - CREATING: "CREATING", - DELETING: "DELETING", - FAILED: "FAILED", - READY: "READY", - UPDATING: "UPDATING", - VERSIONING: "VERSIONING" - }; - var InferenceProfileStatus = { - ACTIVE: "ACTIVE" - }; - var InferenceProfileType = { - APPLICATION: "APPLICATION", - SYSTEM_DEFINED: "SYSTEM_DEFINED" - }; - var ModelCopyJobStatus = { - COMPLETED: "Completed", - FAILED: "Failed", - IN_PROGRESS: "InProgress" - }; - var ModelImportJobStatus = { - COMPLETED: "Completed", - FAILED: "Failed", - IN_PROGRESS: "InProgress" - }; - var S3InputFormat = { - JSONL: "JSONL" - }; - var ModelInvocationJobStatus = { - COMPLETED: "Completed", - EXPIRED: "Expired", - FAILED: "Failed", - IN_PROGRESS: "InProgress", - PARTIALLY_COMPLETED: "PartiallyCompleted", - SCHEDULED: "Scheduled", - STOPPED: "Stopped", - STOPPING: "Stopping", - SUBMITTED: "Submitted", - VALIDATING: "Validating" - }; - var ModelCustomization = { - CONTINUED_PRE_TRAINING: "CONTINUED_PRE_TRAINING", - DISTILLATION: "DISTILLATION", - FINE_TUNING: "FINE_TUNING" - }; - var InferenceType = { - ON_DEMAND: "ON_DEMAND", - PROVISIONED: "PROVISIONED" - }; - var ModelModality = { - EMBEDDING: "EMBEDDING", - IMAGE: "IMAGE", - TEXT: "TEXT" - }; - var FoundationModelLifecycleStatus = { - ACTIVE: "ACTIVE", - LEGACY: "LEGACY" - }; - var PromptRouterStatus = { - AVAILABLE: "AVAILABLE" - }; - var PromptRouterType = { - CUSTOM: "custom", - DEFAULT: "default" - }; - var CommitmentDuration = { - ONE_MONTH: "OneMonth", - SIX_MONTHS: "SixMonths" - }; - var ProvisionedModelStatus = { - CREATING: "Creating", - FAILED: "Failed", - IN_SERVICE: "InService", - UPDATING: "Updating" - }; - var SortByProvisionedModels = { - CREATION_TIME: "CreationTime" - }; - var AuthorizationStatus = { - AUTHORIZED: "AUTHORIZED", - NOT_AUTHORIZED: "NOT_AUTHORIZED" - }; - var EntitlementAvailability = { - AVAILABLE: "AVAILABLE", - NOT_AVAILABLE: "NOT_AVAILABLE" - }; - var RegionAvailability = { - AVAILABLE: "AVAILABLE", - NOT_AVAILABLE: "NOT_AVAILABLE" - }; - var OfferType = { - ALL: "ALL", - PUBLIC: "PUBLIC" - }; - var ModelCustomizationJobStatus = { - COMPLETED: "Completed", - FAILED: "Failed", - IN_PROGRESS: "InProgress", - STOPPED: "Stopped", - STOPPING: "Stopping" - }; - var JobStatusDetails = { - COMPLETED: "Completed", - FAILED: "Failed", - IN_PROGRESS: "InProgress", - NOT_STARTED: "NotStarted", - STOPPED: "Stopped", - STOPPING: "Stopping" - }; - var FineTuningJobStatus = { - COMPLETED: "Completed", - FAILED: "Failed", - IN_PROGRESS: "InProgress", - STOPPED: "Stopped", - STOPPING: "Stopping" - }; - Object.defineProperty(exports, "$Command", { - enumerable: true, - get: function() { - return smithyClient.Command; - } - }); - Object.defineProperty(exports, "__Client", { - enumerable: true, - get: function() { - return smithyClient.Client; - } - }); - exports.AccessDeniedException = AccessDeniedException$1; - exports.AgreementStatus = AgreementStatus; - exports.ApplicationType = ApplicationType; - exports.AttributeType = AttributeType; - exports.AuthorizationStatus = AuthorizationStatus; - exports.AutomatedReasoningCheckLogicWarningType = AutomatedReasoningCheckLogicWarningType; - exports.AutomatedReasoningCheckResult = AutomatedReasoningCheckResult; - exports.AutomatedReasoningPolicyAnnotationStatus = AutomatedReasoningPolicyAnnotationStatus; - exports.AutomatedReasoningPolicyBuildDocumentContentType = AutomatedReasoningPolicyBuildDocumentContentType; - exports.AutomatedReasoningPolicyBuildMessageType = AutomatedReasoningPolicyBuildMessageType; - exports.AutomatedReasoningPolicyBuildResultAssetType = AutomatedReasoningPolicyBuildResultAssetType; - exports.AutomatedReasoningPolicyBuildWorkflowStatus = AutomatedReasoningPolicyBuildWorkflowStatus; - exports.AutomatedReasoningPolicyBuildWorkflowType = AutomatedReasoningPolicyBuildWorkflowType; - exports.AutomatedReasoningPolicyTestRunResult = AutomatedReasoningPolicyTestRunResult; - exports.AutomatedReasoningPolicyTestRunStatus = AutomatedReasoningPolicyTestRunStatus; - exports.BatchDeleteEvaluationJobCommand = BatchDeleteEvaluationJobCommand; - exports.Bedrock = Bedrock; - exports.BedrockClient = BedrockClient; - exports.BedrockServiceException = BedrockServiceException$1; - exports.CancelAutomatedReasoningPolicyBuildWorkflowCommand = CancelAutomatedReasoningPolicyBuildWorkflowCommand; - exports.CommitmentDuration = CommitmentDuration; - exports.ConflictException = ConflictException$1; - exports.CreateAutomatedReasoningPolicyCommand = CreateAutomatedReasoningPolicyCommand; - exports.CreateAutomatedReasoningPolicyTestCaseCommand = CreateAutomatedReasoningPolicyTestCaseCommand; - exports.CreateAutomatedReasoningPolicyVersionCommand = CreateAutomatedReasoningPolicyVersionCommand; - exports.CreateCustomModelCommand = CreateCustomModelCommand; - exports.CreateCustomModelDeploymentCommand = CreateCustomModelDeploymentCommand; - exports.CreateEvaluationJobCommand = CreateEvaluationJobCommand; - exports.CreateFoundationModelAgreementCommand = CreateFoundationModelAgreementCommand; - exports.CreateGuardrailCommand = CreateGuardrailCommand; - exports.CreateGuardrailVersionCommand = CreateGuardrailVersionCommand; - exports.CreateInferenceProfileCommand = CreateInferenceProfileCommand; - exports.CreateMarketplaceModelEndpointCommand = CreateMarketplaceModelEndpointCommand; - exports.CreateModelCopyJobCommand = CreateModelCopyJobCommand; - exports.CreateModelCustomizationJobCommand = CreateModelCustomizationJobCommand; - exports.CreateModelImportJobCommand = CreateModelImportJobCommand; - exports.CreateModelInvocationJobCommand = CreateModelInvocationJobCommand; - exports.CreatePromptRouterCommand = CreatePromptRouterCommand; - exports.CreateProvisionedModelThroughputCommand = CreateProvisionedModelThroughputCommand; - exports.CustomModelDeploymentStatus = CustomModelDeploymentStatus; - exports.CustomizationType = CustomizationType; - exports.DeleteAutomatedReasoningPolicyBuildWorkflowCommand = DeleteAutomatedReasoningPolicyBuildWorkflowCommand; - exports.DeleteAutomatedReasoningPolicyCommand = DeleteAutomatedReasoningPolicyCommand; - exports.DeleteAutomatedReasoningPolicyTestCaseCommand = DeleteAutomatedReasoningPolicyTestCaseCommand; - exports.DeleteCustomModelCommand = DeleteCustomModelCommand; - exports.DeleteCustomModelDeploymentCommand = DeleteCustomModelDeploymentCommand; - exports.DeleteFoundationModelAgreementCommand = DeleteFoundationModelAgreementCommand; - exports.DeleteGuardrailCommand = DeleteGuardrailCommand; - exports.DeleteImportedModelCommand = DeleteImportedModelCommand; - exports.DeleteInferenceProfileCommand = DeleteInferenceProfileCommand; - exports.DeleteMarketplaceModelEndpointCommand = DeleteMarketplaceModelEndpointCommand; - exports.DeleteModelInvocationLoggingConfigurationCommand = DeleteModelInvocationLoggingConfigurationCommand; - exports.DeletePromptRouterCommand = DeletePromptRouterCommand; - exports.DeleteProvisionedModelThroughputCommand = DeleteProvisionedModelThroughputCommand; - exports.DeregisterMarketplaceModelEndpointCommand = DeregisterMarketplaceModelEndpointCommand; - exports.EntitlementAvailability = EntitlementAvailability; - exports.EvaluationJobStatus = EvaluationJobStatus; - exports.EvaluationJobType = EvaluationJobType; - exports.EvaluationTaskType = EvaluationTaskType; - exports.ExportAutomatedReasoningPolicyVersionCommand = ExportAutomatedReasoningPolicyVersionCommand; - exports.ExternalSourceType = ExternalSourceType; - exports.FineTuningJobStatus = FineTuningJobStatus; - exports.FoundationModelLifecycleStatus = FoundationModelLifecycleStatus; - exports.GetAutomatedReasoningPolicyAnnotationsCommand = GetAutomatedReasoningPolicyAnnotationsCommand; - exports.GetAutomatedReasoningPolicyBuildWorkflowCommand = GetAutomatedReasoningPolicyBuildWorkflowCommand; - exports.GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand = GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand; - exports.GetAutomatedReasoningPolicyCommand = GetAutomatedReasoningPolicyCommand; - exports.GetAutomatedReasoningPolicyNextScenarioCommand = GetAutomatedReasoningPolicyNextScenarioCommand; - exports.GetAutomatedReasoningPolicyTestCaseCommand = GetAutomatedReasoningPolicyTestCaseCommand; - exports.GetAutomatedReasoningPolicyTestResultCommand = GetAutomatedReasoningPolicyTestResultCommand; - exports.GetCustomModelCommand = GetCustomModelCommand; - exports.GetCustomModelDeploymentCommand = GetCustomModelDeploymentCommand; - exports.GetEvaluationJobCommand = GetEvaluationJobCommand; - exports.GetFoundationModelAvailabilityCommand = GetFoundationModelAvailabilityCommand; - exports.GetFoundationModelCommand = GetFoundationModelCommand; - exports.GetGuardrailCommand = GetGuardrailCommand; - exports.GetImportedModelCommand = GetImportedModelCommand; - exports.GetInferenceProfileCommand = GetInferenceProfileCommand; - exports.GetMarketplaceModelEndpointCommand = GetMarketplaceModelEndpointCommand; - exports.GetModelCopyJobCommand = GetModelCopyJobCommand; - exports.GetModelCustomizationJobCommand = GetModelCustomizationJobCommand; - exports.GetModelImportJobCommand = GetModelImportJobCommand; - exports.GetModelInvocationJobCommand = GetModelInvocationJobCommand; - exports.GetModelInvocationLoggingConfigurationCommand = GetModelInvocationLoggingConfigurationCommand; - exports.GetPromptRouterCommand = GetPromptRouterCommand; - exports.GetProvisionedModelThroughputCommand = GetProvisionedModelThroughputCommand; - exports.GetUseCaseForModelAccessCommand = GetUseCaseForModelAccessCommand; - exports.GuardrailContentFilterAction = GuardrailContentFilterAction; - exports.GuardrailContentFilterType = GuardrailContentFilterType; - exports.GuardrailContentFiltersTierName = GuardrailContentFiltersTierName; - exports.GuardrailContextualGroundingAction = GuardrailContextualGroundingAction; - exports.GuardrailContextualGroundingFilterType = GuardrailContextualGroundingFilterType; - exports.GuardrailFilterStrength = GuardrailFilterStrength; - exports.GuardrailManagedWordsType = GuardrailManagedWordsType; - exports.GuardrailModality = GuardrailModality; - exports.GuardrailPiiEntityType = GuardrailPiiEntityType; - exports.GuardrailSensitiveInformationAction = GuardrailSensitiveInformationAction; - exports.GuardrailStatus = GuardrailStatus; - exports.GuardrailTopicAction = GuardrailTopicAction; - exports.GuardrailTopicType = GuardrailTopicType; - exports.GuardrailTopicsTierName = GuardrailTopicsTierName; - exports.GuardrailWordAction = GuardrailWordAction; - exports.InferenceProfileStatus = InferenceProfileStatus; - exports.InferenceProfileType = InferenceProfileType; - exports.InferenceType = InferenceType; - exports.InternalServerException = InternalServerException$1; - exports.JobStatusDetails = JobStatusDetails; - exports.ListAutomatedReasoningPoliciesCommand = ListAutomatedReasoningPoliciesCommand; - exports.ListAutomatedReasoningPolicyBuildWorkflowsCommand = ListAutomatedReasoningPolicyBuildWorkflowsCommand; - exports.ListAutomatedReasoningPolicyTestCasesCommand = ListAutomatedReasoningPolicyTestCasesCommand; - exports.ListAutomatedReasoningPolicyTestResultsCommand = ListAutomatedReasoningPolicyTestResultsCommand; - exports.ListCustomModelDeploymentsCommand = ListCustomModelDeploymentsCommand; - exports.ListCustomModelsCommand = ListCustomModelsCommand; - exports.ListEvaluationJobsCommand = ListEvaluationJobsCommand; - exports.ListFoundationModelAgreementOffersCommand = ListFoundationModelAgreementOffersCommand; - exports.ListFoundationModelsCommand = ListFoundationModelsCommand; - exports.ListGuardrailsCommand = ListGuardrailsCommand; - exports.ListImportedModelsCommand = ListImportedModelsCommand; - exports.ListInferenceProfilesCommand = ListInferenceProfilesCommand; - exports.ListMarketplaceModelEndpointsCommand = ListMarketplaceModelEndpointsCommand; - exports.ListModelCopyJobsCommand = ListModelCopyJobsCommand; - exports.ListModelCustomizationJobsCommand = ListModelCustomizationJobsCommand; - exports.ListModelImportJobsCommand = ListModelImportJobsCommand; - exports.ListModelInvocationJobsCommand = ListModelInvocationJobsCommand; - exports.ListPromptRoutersCommand = ListPromptRoutersCommand; - exports.ListProvisionedModelThroughputsCommand = ListProvisionedModelThroughputsCommand; - exports.ListTagsForResourceCommand = ListTagsForResourceCommand; - exports.ModelCopyJobStatus = ModelCopyJobStatus; - exports.ModelCustomization = ModelCustomization; - exports.ModelCustomizationJobStatus = ModelCustomizationJobStatus; - exports.ModelImportJobStatus = ModelImportJobStatus; - exports.ModelInvocationJobStatus = ModelInvocationJobStatus; - exports.ModelModality = ModelModality; - exports.ModelStatus = ModelStatus; - exports.OfferType = OfferType; - exports.PerformanceConfigLatency = PerformanceConfigLatency; - exports.PromptRouterStatus = PromptRouterStatus; - exports.PromptRouterType = PromptRouterType; - exports.ProvisionedModelStatus = ProvisionedModelStatus; - exports.PutModelInvocationLoggingConfigurationCommand = PutModelInvocationLoggingConfigurationCommand; - exports.PutUseCaseForModelAccessCommand = PutUseCaseForModelAccessCommand; - exports.QueryTransformationType = QueryTransformationType; - exports.RegionAvailability = RegionAvailability; - exports.RegisterMarketplaceModelEndpointCommand = RegisterMarketplaceModelEndpointCommand; - exports.RerankingMetadataSelectionMode = RerankingMetadataSelectionMode; - exports.ResourceInUseException = ResourceInUseException$1; - exports.ResourceNotFoundException = ResourceNotFoundException$1; - exports.RetrieveAndGenerateType = RetrieveAndGenerateType; - exports.S3InputFormat = S3InputFormat; - exports.SearchType = SearchType; - exports.ServiceQuotaExceededException = ServiceQuotaExceededException$1; - exports.ServiceUnavailableException = ServiceUnavailableException$1; - exports.SortByProvisionedModels = SortByProvisionedModels; - exports.SortJobsBy = SortJobsBy; - exports.SortModelsBy = SortModelsBy; - exports.SortOrder = SortOrder; - exports.StartAutomatedReasoningPolicyBuildWorkflowCommand = StartAutomatedReasoningPolicyBuildWorkflowCommand; - exports.StartAutomatedReasoningPolicyTestWorkflowCommand = StartAutomatedReasoningPolicyTestWorkflowCommand; - exports.Status = Status; - exports.StopEvaluationJobCommand = StopEvaluationJobCommand; - exports.StopModelCustomizationJobCommand = StopModelCustomizationJobCommand; - exports.StopModelInvocationJobCommand = StopModelInvocationJobCommand; - exports.TagResourceCommand = TagResourceCommand; - exports.ThrottlingException = ThrottlingException$1; - exports.TooManyTagsException = TooManyTagsException$1; - exports.UntagResourceCommand = UntagResourceCommand; - exports.UpdateAutomatedReasoningPolicyAnnotationsCommand = UpdateAutomatedReasoningPolicyAnnotationsCommand; - exports.UpdateAutomatedReasoningPolicyCommand = UpdateAutomatedReasoningPolicyCommand; - exports.UpdateAutomatedReasoningPolicyTestCaseCommand = UpdateAutomatedReasoningPolicyTestCaseCommand; - exports.UpdateGuardrailCommand = UpdateGuardrailCommand; - exports.UpdateMarketplaceModelEndpointCommand = UpdateMarketplaceModelEndpointCommand; - exports.UpdateProvisionedModelThroughputCommand = UpdateProvisionedModelThroughputCommand; - exports.ValidationException = ValidationException$1; - exports.VectorSearchRerankingConfigurationType = VectorSearchRerankingConfigurationType; - exports.paginateListAutomatedReasoningPolicies = paginateListAutomatedReasoningPolicies; - exports.paginateListAutomatedReasoningPolicyBuildWorkflows = paginateListAutomatedReasoningPolicyBuildWorkflows; - exports.paginateListAutomatedReasoningPolicyTestCases = paginateListAutomatedReasoningPolicyTestCases; - exports.paginateListAutomatedReasoningPolicyTestResults = paginateListAutomatedReasoningPolicyTestResults; - exports.paginateListCustomModelDeployments = paginateListCustomModelDeployments; - exports.paginateListCustomModels = paginateListCustomModels; - exports.paginateListEvaluationJobs = paginateListEvaluationJobs; - exports.paginateListGuardrails = paginateListGuardrails; - exports.paginateListImportedModels = paginateListImportedModels; - exports.paginateListInferenceProfiles = paginateListInferenceProfiles; - exports.paginateListMarketplaceModelEndpoints = paginateListMarketplaceModelEndpoints; - exports.paginateListModelCopyJobs = paginateListModelCopyJobs; - exports.paginateListModelCustomizationJobs = paginateListModelCustomizationJobs; - exports.paginateListModelImportJobs = paginateListModelImportJobs; - exports.paginateListModelInvocationJobs = paginateListModelInvocationJobs; - exports.paginateListPromptRouters = paginateListPromptRouters; - exports.paginateListProvisionedModelThroughputs = paginateListProvisionedModelThroughputs; -}); - -// ../node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js -var require_dist_cjs111 = __commonJS((exports) => { - var protocolHttp = require_dist_cjs56(); - 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 eventStreamHandlingMiddleware = (options) => (next, context) => async (args) => { - const { request } = args; - if (!protocolHttp.HttpRequest.isInstance(request)) - return next(args); - return options.eventStreamPayloadHandler.handle(next, args, context); - }; - var eventStreamHandlingMiddlewareOptions = { - tags: ["EVENT_STREAM", "SIGNATURE", "HANDLE"], - name: "eventStreamHandlingMiddleware", - relation: "after", - toMiddleware: "awsAuthMiddleware", - override: true - }; - var eventStreamHeaderMiddleware = (next) => async (args) => { - const { request } = args; - if (!protocolHttp.HttpRequest.isInstance(request)) - return next(args); - request.headers = { - ...request.headers, - "content-type": "application/vnd.amazon.eventstream", - "x-amz-content-sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS" - }; - return next({ - ...args, - request - }); - }; - var eventStreamHeaderMiddlewareOptions = { - step: "build", - tags: ["EVENT_STREAM", "HEADER", "CONTENT_TYPE", "CONTENT_SHA256"], - name: "eventStreamHeaderMiddleware", - override: true - }; - var getEventStreamPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(eventStreamHandlingMiddleware(options), eventStreamHandlingMiddlewareOptions); - clientStack.add(eventStreamHeaderMiddleware, eventStreamHeaderMiddlewareOptions); - } - }); - exports.eventStreamHandlingMiddleware = eventStreamHandlingMiddleware; - exports.eventStreamHandlingMiddlewareOptions = eventStreamHandlingMiddlewareOptions; - exports.eventStreamHeaderMiddleware = eventStreamHeaderMiddleware; - exports.eventStreamHeaderMiddlewareOptions = eventStreamHeaderMiddlewareOptions; - exports.getEventStreamPlugin = getEventStreamPlugin; - exports.resolveEventStreamConfig = resolveEventStreamConfig; -}); - -// ../node_modules/@aws-sdk/util-utf8-browser/dist-cjs/pureJs.js -var require_pureJs = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toUtf8 = exports.fromUtf8 = undefined; - var fromUtf8 = (input) => { - const bytes = []; - for (let i2 = 0, len = input.length;i2 < len; i2++) { - const value = input.charCodeAt(i2); - if (value < 128) { - bytes.push(value); - } else if (value < 2048) { - bytes.push(value >> 6 | 192, value & 63 | 128); - } else if (i2 + 1 < input.length && (value & 64512) === 55296 && (input.charCodeAt(i2 + 1) & 64512) === 56320) { - const surrogatePair = 65536 + ((value & 1023) << 10) + (input.charCodeAt(++i2) & 1023); - bytes.push(surrogatePair >> 18 | 240, surrogatePair >> 12 & 63 | 128, surrogatePair >> 6 & 63 | 128, surrogatePair & 63 | 128); - } else { - bytes.push(value >> 12 | 224, value >> 6 & 63 | 128, value & 63 | 128); - } - } - return Uint8Array.from(bytes); - }; - exports.fromUtf8 = fromUtf8; - var toUtf8 = (input) => { - let decoded = ""; - for (let i2 = 0, len = input.length;i2 < len; i2++) { - const byte = input[i2]; - if (byte < 128) { - decoded += String.fromCharCode(byte); - } else if (192 <= byte && byte < 224) { - const nextByte = input[++i2]; - decoded += String.fromCharCode((byte & 31) << 6 | nextByte & 63); - } else if (240 <= byte && byte < 365) { - const surrogatePair = [byte, input[++i2], input[++i2], input[++i2]]; - const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%"); - decoded += decodeURIComponent(encoded); - } else { - decoded += String.fromCharCode((byte & 15) << 12 | (input[++i2] & 63) << 6 | input[++i2] & 63); - } - } - return decoded; - }; - exports.toUtf8 = toUtf8; -}); - -// ../node_modules/@aws-sdk/util-utf8-browser/dist-cjs/whatwgEncodingApi.js -var require_whatwgEncodingApi = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toUtf8 = exports.fromUtf8 = undefined; - function fromUtf8(input) { - return new TextEncoder().encode(input); - } - exports.fromUtf8 = fromUtf8; - function toUtf8(input) { - return new TextDecoder("utf-8").decode(input); - } - exports.toUtf8 = toUtf8; -}); - -// ../node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js -var require_dist_cjs112 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toUtf8 = exports.fromUtf8 = undefined; - var pureJs_1 = require_pureJs(); - var whatwgEncodingApi_1 = require_whatwgEncodingApi(); - var fromUtf8 = (input) => typeof TextEncoder === "function" ? (0, whatwgEncodingApi_1.fromUtf8)(input) : (0, pureJs_1.fromUtf8)(input); - exports.fromUtf8 = fromUtf8; - var toUtf8 = (input) => typeof TextDecoder === "function" ? (0, whatwgEncodingApi_1.toUtf8)(input) : (0, pureJs_1.toUtf8)(input); - exports.toUtf8 = toUtf8; -}); - -// ../node_modules/@aws-crypto/util/build/convertToBuffer.js -var require_convertToBuffer = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.convertToBuffer = undefined; - var util_utf8_browser_1 = require_dist_cjs112(); - var fromUtf8 = typeof Buffer !== "undefined" && Buffer.from ? function(input) { - return Buffer.from(input, "utf8"); - } : util_utf8_browser_1.fromUtf8; - function convertToBuffer(data) { - if (data instanceof Uint8Array) - return data; - if (typeof data === "string") { - return fromUtf8(data); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); - } - return new Uint8Array(data); - } - exports.convertToBuffer = convertToBuffer; -}); - -// ../node_modules/@aws-crypto/util/build/isEmptyData.js -var require_isEmptyData = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isEmptyData = undefined; - function isEmptyData(data) { - if (typeof data === "string") { - return data.length === 0; - } - return data.byteLength === 0; - } - exports.isEmptyData = isEmptyData; -}); - -// ../node_modules/@aws-crypto/util/build/numToUint8.js -var require_numToUint8 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.numToUint8 = undefined; - function numToUint8(num) { - return new Uint8Array([ - (num & 4278190080) >> 24, - (num & 16711680) >> 16, - (num & 65280) >> 8, - num & 255 - ]); - } - exports.numToUint8 = numToUint8; -}); - -// ../node_modules/@aws-crypto/util/build/uint32ArrayFrom.js -var require_uint32ArrayFrom = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.uint32ArrayFrom = undefined; - function uint32ArrayFrom(a_lookUpTable) { - if (!Uint32Array.from) { - var return_array = new Uint32Array(a_lookUpTable.length); - var a_index = 0; - while (a_index < a_lookUpTable.length) { - return_array[a_index] = a_lookUpTable[a_index]; - a_index += 1; - } - return return_array; - } - return Uint32Array.from(a_lookUpTable); - } - exports.uint32ArrayFrom = uint32ArrayFrom; -}); - -// ../node_modules/@aws-crypto/util/build/index.js -var require_build = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.uint32ArrayFrom = exports.numToUint8 = exports.isEmptyData = exports.convertToBuffer = undefined; - var convertToBuffer_1 = require_convertToBuffer(); - Object.defineProperty(exports, "convertToBuffer", { enumerable: true, get: function() { - return convertToBuffer_1.convertToBuffer; - } }); - var isEmptyData_1 = require_isEmptyData(); - Object.defineProperty(exports, "isEmptyData", { enumerable: true, get: function() { - return isEmptyData_1.isEmptyData; - } }); - var numToUint8_1 = require_numToUint8(); - Object.defineProperty(exports, "numToUint8", { enumerable: true, get: function() { - return numToUint8_1.numToUint8; - } }); - var uint32ArrayFrom_1 = require_uint32ArrayFrom(); - Object.defineProperty(exports, "uint32ArrayFrom", { enumerable: true, get: function() { - return uint32ArrayFrom_1.uint32ArrayFrom; - } }); -}); - -// ../node_modules/@aws-crypto/crc32/build/aws_crc32.js -var require_aws_crc32 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AwsCrc32 = undefined; - var tslib_1 = require_tslib2(); - var util_1 = require_build(); - var index_1 = require_build2(); - var AwsCrc32 = function() { - function AwsCrc322() { - this.crc32 = new index_1.Crc32; - } - AwsCrc322.prototype.update = function(toHash) { - if ((0, util_1.isEmptyData)(toHash)) - return; - this.crc32.update((0, util_1.convertToBuffer)(toHash)); - }; - AwsCrc322.prototype.digest = function() { - return tslib_1.__awaiter(this, undefined, undefined, function() { - return tslib_1.__generator(this, function(_a2) { - return [2, (0, util_1.numToUint8)(this.crc32.digest())]; - }); - }); - }; - AwsCrc322.prototype.reset = function() { - this.crc32 = new index_1.Crc32; - }; - return AwsCrc322; - }(); - exports.AwsCrc32 = AwsCrc32; -}); - -// ../node_modules/@aws-crypto/crc32/build/index.js -var require_build2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AwsCrc32 = exports.Crc32 = exports.crc32 = undefined; - var tslib_1 = require_tslib2(); - var util_1 = require_build(); - function crc32(data) { - return new Crc32().update(data).digest(); - } - exports.crc32 = crc32; - var Crc32 = function() { - function Crc322() { - this.checksum = 4294967295; - } - Crc322.prototype.update = function(data) { - var e_1, _a2; - try { - for (var data_1 = tslib_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 && (_a2 = data_1.return)) - _a2.call(data_1); - } finally { - if (e_1) - throw e_1.error; - } - } - return this; - }; - Crc322.prototype.digest = function() { - return (this.checksum ^ 4294967295) >>> 0; - }; - return Crc322; - }(); - exports.Crc32 = Crc32; - var 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, - 936918000, - 2847714899, - 3736837829, - 1202900863, - 817233897, - 3183342108, - 3401237130, - 1404277552, - 615818150, - 3134207493, - 3453421203, - 1423857449, - 601450431, - 3009837614, - 3294710456, - 1567103746, - 711928724, - 3020668471, - 3272380065, - 1510334235, - 755167117 - ]; - var lookupTable = (0, util_1.uint32ArrayFrom)(a_lookUpTable); - var aws_crc32_1 = require_aws_crc32(); - Object.defineProperty(exports, "AwsCrc32", { enumerable: true, get: function() { - return aws_crc32_1.AwsCrc32; - } }); -}); - -// ../node_modules/@smithy/eventstream-codec/dist-cjs/index.js -var require_dist_cjs113 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - EventStreamCodec: () => EventStreamCodec, - HeaderMarshaller: () => HeaderMarshaller, - Int64: () => Int64, - MessageDecoderStream: () => MessageDecoderStream, - MessageEncoderStream: () => MessageEncoderStream, - SmithyMessageDecoderStream: () => SmithyMessageDecoderStream, - SmithyMessageEncoderStream: () => SmithyMessageEncoderStream - }); - module.exports = __toCommonJS2(src_exports); - var import_crc322 = require_build2(); - var import_util_hex_encoding = require_dist_cjs77(); - var _Int64 = class _Int642 { - constructor(bytes) { - this.bytes = bytes; - if (bytes.byteLength !== 8) { - throw new Error("Int64 buffers must be exactly 8 bytes"); - } - } - static fromNumber(number4) { - if (number4 > 9223372036854776000 || number4 < -9223372036854776000) { - throw new Error(`${number4} is too large (or, if negative, too small) to represent as an Int64`); - } - const bytes = new Uint8Array(8); - for (let i2 = 7, remaining = Math.abs(Math.round(number4));i2 > -1 && remaining > 0; i2--, remaining /= 256) { - bytes[i2] = remaining; - } - if (number4 < 0) { - negate2(bytes); - } - return new _Int642(bytes); - } - valueOf() { - const bytes = this.bytes.slice(0); - const negative = bytes[0] & 128; - if (negative) { - negate2(bytes); - } - return parseInt((0, import_util_hex_encoding.toHex)(bytes), 16) * (negative ? -1 : 1); - } - toString() { - return String(this.valueOf()); - } - }; - __name(_Int64, "Int64"); - var Int64 = _Int64; - function negate2(bytes) { - for (let i2 = 0;i2 < 8; i2++) { - bytes[i2] ^= 255; - } - for (let i2 = 7;i2 > -1; i2--) { - bytes[i2]++; - if (bytes[i2] !== 0) - break; - } - } - __name(negate2, "negate"); - var _HeaderMarshaller = class _HeaderMarshaller2 { - constructor(toUtf8, fromUtf8) { - this.toUtf8 = toUtf8; - this.fromUtf8 = fromUtf8; - } - 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 chunk2 of chunks) { - out.set(chunk2, position); - position += chunk2.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(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((0, import_util_hex_encoding.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 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: `${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(0, 4))}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(4, 6))}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(6, 8))}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(8, 10))}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(10))}` - }; - break; - default: - throw new Error(`Unrecognized header type tag`); - } - } - return out; - } - }; - __name(_HeaderMarshaller, "HeaderMarshaller"); - var HeaderMarshaller = _HeaderMarshaller; - var BOOLEAN_TAG = "boolean"; - var BYTE_TAG = "byte"; - var SHORT_TAG = "short"; - var INT_TAG = "integer"; - var LONG_TAG = "long"; - var BINARY_TAG = "binary"; - var STRING_TAG = "string"; - var TIMESTAMP_TAG = "timestamp"; - var UUID_TAG = "uuid"; - var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; - var import_crc32 = require_build2(); - var PRELUDE_MEMBER_LENGTH = 4; - var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; - var CHECKSUM_LENGTH = 4; - var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; - function splitMessage({ byteLength, byteOffset, buffer }) { - if (byteLength < MINIMUM_MESSAGE_LENGTH) { - throw new Error("Provided message too short to accommodate event stream message overhead"); - } - const view = new DataView(buffer, 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 import_crc32.Crc32().update(new Uint8Array(buffer, 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(buffer, 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(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), - body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)) - }; - } - __name(splitMessage, "splitMessage"); - var _EventStreamCodec = class _EventStreamCodec2 { - constructor(toUtf8, fromUtf8) { - this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8); - 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 }) { - const headers = this.headerMarshaller.format(rawHeaders); - const length = headers.byteLength + body.byteLength + 16; - const out = new Uint8Array(length); - const view = new DataView(out.buffer, out.byteOffset, out.byteLength); - const checksum = new import_crc322.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(body, headers.byteLength + 12); - view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); - return out; - } - decode(message) { - const { headers, body } = splitMessage(message); - return { headers: this.headerMarshaller.parse(headers), body }; - } - formatHeaders(rawHeaders) { - return this.headerMarshaller.format(rawHeaders); - } - }; - __name(_EventStreamCodec, "EventStreamCodec"); - var EventStreamCodec = _EventStreamCodec; - var _MessageDecoderStream = class _MessageDecoderStream2 { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async* asyncIterator() { - for await (const bytes of this.options.inputStream) { - const decoded = this.options.decoder.decode(bytes); - yield decoded; - } - } - }; - __name(_MessageDecoderStream, "MessageDecoderStream"); - var MessageDecoderStream = _MessageDecoderStream; - var _MessageEncoderStream = class _MessageEncoderStream2 { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async* asyncIterator() { - for await (const msg of this.options.messageStream) { - const encoded = this.options.encoder.encode(msg); - yield encoded; - } - if (this.options.includeEndFrame) { - yield new Uint8Array(0); - } - } - }; - __name(_MessageEncoderStream, "MessageEncoderStream"); - var MessageEncoderStream = _MessageEncoderStream; - var _SmithyMessageDecoderStream = class _SmithyMessageDecoderStream2 { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async* asyncIterator() { - for await (const message of this.options.messageStream) { - const deserialized = await this.options.deserializer(message); - if (deserialized === undefined) - continue; - yield deserialized; - } - } - }; - __name(_SmithyMessageDecoderStream, "SmithyMessageDecoderStream"); - var SmithyMessageDecoderStream = _SmithyMessageDecoderStream; - var _SmithyMessageEncoderStream = class _SmithyMessageEncoderStream2 { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async* asyncIterator() { - for await (const chunk2 of this.options.inputStream) { - const payloadBuf = this.options.serializer(chunk2); - yield payloadBuf; - } - } - }; - __name(_SmithyMessageEncoderStream, "SmithyMessageEncoderStream"); - var SmithyMessageEncoderStream = _SmithyMessageEncoderStream; -}); - -// ../node_modules/@aws-sdk/util-format-url/dist-cjs/index.js -var require_dist_cjs114 = __commonJS((exports) => { - var querystringBuilder = require_dist_cjs67(); - function formatUrl(request) { - const { port, query } = request; - let { protocol, path: path9, hostname: hostname2 } = request; - if (protocol && protocol.slice(-1) !== ":") { - protocol += ":"; - } - if (port) { - hostname2 += `:${port}`; - } - if (path9 && path9.charAt(0) !== "/") { - path9 = `/${path9}`; - } - let queryString = query ? querystringBuilder.buildQueryString(query) : ""; - if (queryString && queryString[0] !== "?") { - queryString = `?${queryString}`; - } - let auth = ""; - if (request.username != null || request.password != null) { - const username = request.username ?? ""; - const password = request.password ?? ""; - auth = `${username}:${password}@`; - } - let fragment = ""; - if (request.fragment) { - fragment = `#${request.fragment}`; - } - return `${protocol}//${auth}${hostname2}${path9}${queryString}${fragment}`; - } - exports.formatUrl = formatUrl; -}); - -// ../node_modules/@smithy/eventstream-serde-universal/dist-cjs/index.js -var require_dist_cjs115 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - EventStreamMarshaller: () => EventStreamMarshaller, - eventStreamSerdeProvider: () => eventStreamSerdeProvider - }); - module.exports = __toCommonJS2(src_exports); - var import_eventstream_codec = require_dist_cjs113(); - function getChunkedStream(source) { - let currentMessageTotalLength = 0; - let currentMessagePendingLength = 0; - let currentMessage = null; - let messageLengthBuffer = null; - const allocateMessage = /* @__PURE__ */ __name((size2) => { - if (typeof size2 !== "number") { - throw new Error("Attempted to allocate an event message where size was not a number: " + size2); - } - currentMessageTotalLength = size2; - currentMessagePendingLength = 4; - currentMessage = new Uint8Array(size2); - const currentMessageView = new DataView(currentMessage.buffer); - currentMessageView.setUint32(0, size2, false); - }, "allocateMessage"); - const iterator2 = /* @__PURE__ */ __name(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; - } - } - } - }, "iterator"); - return { - [Symbol.asyncIterator]: iterator2 - }; - } - __name(getChunkedStream, "getChunkedStream"); - function getMessageUnmarshaller(deserializer, toUtf8) { - 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 error41 = new Error(toUtf8(message.body)); - error41.name = code; - throw error41; - } - 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}`); - } - }; - } - __name(getMessageUnmarshaller, "getMessageUnmarshaller"); - var _EventStreamMarshaller = class _EventStreamMarshaller2 { - constructor({ utf8Encoder, utf8Decoder }) { - this.eventStreamCodec = new import_eventstream_codec.EventStreamCodec(utf8Encoder, utf8Decoder); - this.utfEncoder = utf8Encoder; - } - deserialize(body, deserializer) { - const inputStream = getChunkedStream(body); - return new import_eventstream_codec.SmithyMessageDecoderStream({ - messageStream: new import_eventstream_codec.MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }), - deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder) - }); - } - serialize(inputStream, serializer) { - return new import_eventstream_codec.MessageEncoderStream({ - messageStream: new import_eventstream_codec.SmithyMessageEncoderStream({ inputStream, serializer }), - encoder: this.eventStreamCodec, - includeEndFrame: true - }); - } - }; - __name(_EventStreamMarshaller, "EventStreamMarshaller"); - var EventStreamMarshaller = _EventStreamMarshaller; - var eventStreamSerdeProvider = /* @__PURE__ */ __name((options) => new EventStreamMarshaller(options), "eventStreamSerdeProvider"); -}); - -// ../node_modules/@smithy/eventstream-serde-browser/dist-cjs/index.js -var require_dist_cjs116 = __commonJS((exports) => { - var eventstreamSerdeUniversal = require_dist_cjs115(); - var 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(); - } - } - }); - var 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); - } - }); - }; - - class EventStreamMarshaller { - universalMarshaller; - constructor({ utf8Encoder, utf8Decoder }) { - this.universalMarshaller = new eventstreamSerdeUniversal.EventStreamMarshaller({ - utf8Decoder, - utf8Encoder - }); - } - deserialize(body, deserializer) { - const bodyIterable = isReadableStream4(body) ? readableStreamtoIterable(body) : body; - return this.universalMarshaller.deserialize(bodyIterable, deserializer); - } - serialize(input, serializer) { - const serialziedIterable = this.universalMarshaller.serialize(input, serializer); - return typeof ReadableStream === "function" ? iterableToReadableStream(serialziedIterable) : serialziedIterable; - } - } - var isReadableStream4 = (body) => typeof ReadableStream === "function" && body instanceof ReadableStream; - var eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options); - exports.EventStreamMarshaller = EventStreamMarshaller; - exports.eventStreamSerdeProvider = eventStreamSerdeProvider; - exports.iterableToReadableStream = iterableToReadableStream; - exports.readableStreamtoIterable = readableStreamtoIterable; -}); - -// ../node_modules/@smithy/fetch-http-handler/dist-cjs/index.js -var require_dist_cjs117 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - FetchHttpHandler: () => FetchHttpHandler, - keepAliveSupport: () => keepAliveSupport, - streamCollector: () => streamCollector - }); - module.exports = __toCommonJS2(src_exports); - var import_protocol_http = require_dist_cjs56(); - var import_querystring_builder = require_dist_cjs67(); - function createRequest(url3, requestOptions) { - return new Request(url3, requestOptions); - } - __name(createRequest, "createRequest"); - function requestTimeout(timeoutInMs = 0) { - return new Promise((resolve8, reject2) => { - if (timeoutInMs) { - setTimeout(() => { - const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); - timeoutError.name = "TimeoutError"; - reject2(timeoutError); - }, timeoutInMs); - } - }); - } - __name(requestTimeout, "requestTimeout"); - var keepAliveSupport = { - supported: undefined - }; - var FetchHttpHandler = class _FetchHttpHandler { - static { - __name(this, "FetchHttpHandler"); - } - static create(instanceOrOptions) { - if (typeof instanceOrOptions?.handle === "function") { - return instanceOrOptions; - } - return new _FetchHttpHandler(instanceOrOptions); - } - constructor(options) { - if (typeof options === "function") { - this.configProvider = options().then((opts) => opts || {}); - } else { - this.config = options ?? {}; - this.configProvider = Promise.resolve(this.config); - } - if (keepAliveSupport.supported === undefined) { - keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]")); - } - } - destroy() {} - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - const requestTimeoutInMs = this.config.requestTimeout; - const keepAlive = this.config.keepAlive === true; - const credentials = this.config.credentials; - if (abortSignal?.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - return Promise.reject(abortError); - } - let path9 = request.path; - const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {}); - if (queryString) { - path9 += `?${queryString}`; - } - if (request.fragment) { - path9 += `#${request.fragment}`; - } - let auth = ""; - if (request.username != null || request.password != null) { - const username = request.username ?? ""; - const password = request.password ?? ""; - auth = `${username}:${password}@`; - } - const { port, method: method2 } = request; - const url3 = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path9}`; - const body = method2 === "GET" || method2 === "HEAD" ? undefined : request.body; - const requestOptions = { - body, - headers: new Headers(request.headers), - method: method2, - credentials - }; - if (this.config?.cache) { - requestOptions.cache = this.config.cache; - } - if (body) { - requestOptions.duplex = "half"; - } - if (typeof AbortController !== "undefined") { - requestOptions.signal = abortSignal; - } - if (keepAliveSupport.supported) { - requestOptions.keepalive = keepAlive; - } - if (typeof this.config.requestInit === "function") { - Object.assign(requestOptions, this.config.requestInit(request)); - } - let removeSignalEventListener = /* @__PURE__ */ __name(() => {}, "removeSignalEventListener"); - const fetchRequest = createRequest(url3, requestOptions); - const raceOfPromises = [ - fetch(fetchRequest).then((response) => { - const fetchHeaders = response.headers; - const transformedHeaders = {}; - for (const pair of fetchHeaders.entries()) { - transformedHeaders[pair[0]] = pair[1]; - } - const hasReadableStream = response.body != null; - if (!hasReadableStream) { - return response.blob().then((body2) => ({ - response: new import_protocol_http.HttpResponse({ - headers: transformedHeaders, - reason: response.statusText, - statusCode: response.status, - body: body2 - }) - })); - } - return { - response: new import_protocol_http.HttpResponse({ - headers: transformedHeaders, - reason: response.statusText, - statusCode: response.status, - body: response.body - }) - }; - }), - requestTimeout(requestTimeoutInMs) - ]; - if (abortSignal) { - raceOfPromises.push(new Promise((resolve8, reject2) => { - const onAbort = /* @__PURE__ */ __name(() => { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject2(abortError); - }, "onAbort"); - if (typeof abortSignal.addEventListener === "function") { - const signal = abortSignal; - signal.addEventListener("abort", onAbort, { once: true }); - removeSignalEventListener = /* @__PURE__ */ __name(() => signal.removeEventListener("abort", onAbort), "removeSignalEventListener"); - } else { - abortSignal.onabort = onAbort; - } - })); - } - return Promise.race(raceOfPromises).finally(removeSignalEventListener); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config2) => { - config2[key] = value; - return config2; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - }; - var import_util_base64 = require_dist_cjs65(); - var streamCollector = /* @__PURE__ */ __name(async (stream4) => { - if (typeof Blob === "function" && stream4 instanceof Blob || stream4.constructor?.name === "Blob") { - if (Blob.prototype.arrayBuffer !== undefined) { - return new Uint8Array(await stream4.arrayBuffer()); - } - return collectBlob(stream4); - } - return collectStream(stream4); - }, "streamCollector"); - async function collectBlob(blob) { - const base643 = await readToBase64(blob); - const arrayBuffer = (0, import_util_base64.fromBase64)(base643); - return new Uint8Array(arrayBuffer); - } - __name(collectBlob, "collectBlob"); - async function collectStream(stream4) { - const chunks = []; - const reader = stream4.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 chunk2 of chunks) { - collected.set(chunk2, offset); - offset += chunk2.length; - } - return collected; - } - __name(collectStream, "collectStream"); - 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 result2 = reader.result ?? ""; - const commaIndex = result2.indexOf(","); - const dataOffset = commaIndex > -1 ? commaIndex + 1 : result2.length; - resolve8(result2.substring(dataOffset)); - }; - reader.onabort = () => reject2(new Error("Read aborted")); - reader.onerror = () => reject2(reader.error); - reader.readAsDataURL(blob); - }); - } - __name(readToBase64, "readToBase64"); -}); - -// ../node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js -var require_dist_cjs118 = __commonJS((exports) => { - var eventstreamCodec = require_dist_cjs113(); - var utilHexEncoding = require_dist_cjs77(); - var protocolHttp = require_dist_cjs56(); - var utilFormatUrl = require_dist_cjs114(); - var eventstreamSerdeBrowser = require_dist_cjs116(); - var fetchHttpHandler = require_dist_cjs117(); - var getEventSigningTransformStream = (initialSignature, messageSigner, eventStreamCodec, systemClockOffsetProvider) => { - let priorSignature = initialSignature; - const transformer = { - start() {}, - async transform(chunk2, controller) { - try { - const now2 = new Date(Date.now() + await systemClockOffsetProvider()); - const dateHeader = { - ":date": { type: "timestamp", value: now2 } - }; - const signedMessage = await messageSigner.sign({ - message: { - body: chunk2, - headers: dateHeader - }, - priorSignature - }, { - signingDate: now2 - }); - priorSignature = signedMessage.signature; - const serializedSigned = eventStreamCodec.encode({ - headers: { - ...dateHeader, - ":chunk-signature": { - type: "binary", - value: utilHexEncoding.fromHex(signedMessage.signature) - } - }, - body: chunk2 - }); - controller.enqueue(serializedSigned); - } catch (error41) { - controller.error(error41); - } - } - }; - return new TransformStream({ ...transformer }); - }; - - class EventStreamPayloadHandler { - messageSigner; - eventStreamCodec; - systemClockOffsetProvider; - constructor(options) { - this.messageSigner = options.messageSigner; - this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder); - this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0; - } - async handle(next, args, context = {}) { - const request = args.request; - const { body: payload, headers, query } = request; - if (!(payload instanceof ReadableStream)) { - throw new Error("Eventstream payload must be a ReadableStream."); - } - const placeHolderStream = new TransformStream; - request.body = placeHolderStream.readable; - let result2; - try { - result2 = await next(args); - } catch (e) { - request.body.cancel(); - throw e; - } - const match = (headers["authorization"] || "").match(/Signature=([\w]+)$/); - const priorSignature = (match || [])[1] || query && query["X-Amz-Signature"] || ""; - const signingStream = getEventSigningTransformStream(priorSignature, await this.messageSigner(), this.eventStreamCodec, this.systemClockOffsetProvider); - const signedPayload = payload.pipeThrough(signingStream); - signedPayload.pipeThrough(placeHolderStream); - return result2; - } - } - var eventStreamPayloadHandlerProvider = (options) => new EventStreamPayloadHandler(options); - var 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; - }; - var injectSessionIdMiddlewareOptions = { - step: "initialize", - name: "injectSessionIdMiddleware", - tags: ["WEBSOCKET", "EVENT_STREAM"], - override: true - }; - var websocketEndpointMiddleware = (config2, options) => (next) => (args) => { - const { request } = args; - if (protocolHttp.HttpRequest.isInstance(request) && config2.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes("websocket")) { - request.protocol = "wss:"; - request.method = "GET"; - request.path = `${request.path}-websocket`; - const { headers } = request; - 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, ""); - request.query[chunkedName] = headers[name]; - } - } - if (headers["x-amz-user-agent"]) { - request.query["user-agent"] = headers["x-amz-user-agent"]; - } - request.headers = { host: headers.host ?? request.hostname }; - } - return next(args); - }; - var websocketEndpointMiddlewareOptions = { - name: "websocketEndpointMiddleware", - tags: ["WEBSOCKET", "EVENT_STREAM"], - relation: "after", - toMiddleware: "eventStreamHeaderMiddleware", - override: true - }; - var getWebSocketPlugin = (config2, options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo(websocketEndpointMiddleware(config2, options), websocketEndpointMiddlewareOptions); - clientStack.add(injectSessionIdMiddleware(), injectSessionIdMiddlewareOptions); - } - }); - var isWebSocketRequest = (request) => request.protocol === "ws:" || request.protocol === "wss:"; - - class WebsocketSignatureV4 { - signer; - constructor(options) { - this.signer = options.signer; - } - presign(originalRequest, options = {}) { - return this.signer.presign(originalRequest, options); - } - async sign(toSign, options) { - if (protocolHttp.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); - } - } - } - var 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."); - } - }); - }; - var validateSigner = (signer) => !!signer; - var DEFAULT_WS_CONNECTION_TIMEOUT_MS = 2000; - - class WebSocketFetchHandler { - metadata = { - handlerProtocol: "websocket/h1.1" - }; - config; - configPromise; - httpHandler; - sockets = {}; - static create(instanceOrOptions, httpHandler = new fetchHttpHandler.FetchHttpHandler) { - if (typeof instanceOrOptions?.handle === "function") { - return instanceOrOptions; - } - return new WebSocketFetchHandler(instanceOrOptions, httpHandler); - } - constructor(options, httpHandler = new fetchHttpHandler.FetchHttpHandler) { - this.httpHandler = httpHandler; - if (typeof options === "function") { - this.config = {}; - this.configPromise = options().then((opts) => this.config = opts ?? {}); - } else { - this.config = options ?? {}; - this.configPromise = Promise.resolve(this.config); - } - } - destroy() { - for (const [key, sockets] of Object.entries(this.sockets)) { - for (const socket of sockets) { - socket.close(1000, `Socket closed through destroy() call`); - } - delete this.sockets[key]; - } - } - async handle(request) { - if (!isWebSocketRequest(request)) { - return this.httpHandler.handle(request); - } - const url3 = utilFormatUrl.formatUrl(request); - const socket = new WebSocket(url3); - if (!this.sockets[url3]) { - this.sockets[url3] = []; - } - this.sockets[url3].push(socket); - socket.binaryType = "arraybuffer"; - this.config = await this.configPromise; - const { connectionTimeout = DEFAULT_WS_CONNECTION_TIMEOUT_MS } = this.config; - await this.waitForReady(socket, connectionTimeout); - const { body } = request; - const bodyStream = getIterator(body); - const asyncIterable = this.connect(socket, bodyStream); - const outputPayload = toReadableStream(asyncIterable); - return { - response: new protocolHttp.HttpResponse({ - statusCode: 200, - body: outputPayload - }) - }; - } - updateHttpClientConfig(key, value) { - this.configPromise = this.configPromise.then((config2) => { - config2[key] = value; - return config2; - }); - } - httpHandlerConfigs() { - return this.config ?? {}; - } - removeNotUsableSockets(url3) { - this.sockets[url3] = (this.sockets[url3] ?? []).filter((socket) => ![WebSocket.CLOSING, WebSocket.CLOSED].includes(socket.readyState)); - } - waitForReady(socket, connectionTimeout) { - return new Promise((resolve8, reject2) => { - const timeout = setTimeout(() => { - this.removeNotUsableSockets(socket.url); - reject2({ - $metadata: { - httpStatusCode: 500 - } - }); - }, connectionTimeout); - socket.onopen = () => { - clearTimeout(timeout); - resolve8(); - }; - }); - } - connect(socket, data) { - let streamError = undefined; - let socketErrorOccurred = false; - let reject2 = () => {}; - let resolve8 = () => {}; - socket.onmessage = (event) => { - resolve8({ - done: false, - value: new Uint8Array(event.data) - }); - }; - socket.onerror = (error41) => { - socketErrorOccurred = true; - socket.close(); - reject2(error41); - }; - socket.onclose = () => { - this.removeNotUsableSockets(socket.url); - if (socketErrorOccurred) - return; - if (streamError) { - reject2(streamError); - } else { - resolve8({ - done: true, - value: undefined - }); - } - }; - const outputStream = { - [Symbol.asyncIterator]: () => ({ - next: () => { - return new Promise((_resolve, _reject) => { - resolve8 = _resolve; - reject2 = _reject; - }); - } - }) - }; - const send = async () => { - try { - for await (const inputChunk of data) { - socket.send(inputChunk); - } - } catch (err) { - streamError = err; - } finally { - socket.close(1000); - } - }; - send(); - return outputStream; - } - } - var getIterator = (stream4) => { - if (stream4[Symbol.asyncIterator]) { - return stream4; - } - if (isReadableStream4(stream4)) { - return eventstreamSerdeBrowser.readableStreamtoIterable(stream4); - } - return { - [Symbol.asyncIterator]: async function* () { - yield stream4; - } - }; - }; - var toReadableStream = (asyncIterable) => typeof ReadableStream === "function" ? eventstreamSerdeBrowser.iterableToReadableStream(asyncIterable) : asyncIterable; - var isReadableStream4 = (payload) => typeof ReadableStream === "function" && payload instanceof ReadableStream; - exports.WebSocketFetchHandler = WebSocketFetchHandler; - exports.eventStreamPayloadHandlerProvider = eventStreamPayloadHandlerProvider; - exports.getWebSocketPlugin = getWebSocketPlugin; - exports.resolveWebSocketConfig = resolveWebSocketConfig; -}); - -// ../node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/index.js -var require_dist_cjs119 = __commonJS((exports) => { - var resolveEventStreamSerdeConfig = (input) => Object.assign(input, { - eventStreamMarshaller: input.eventStreamSerdeProvider(input) - }); - exports.resolveEventStreamSerdeConfig = resolveEventStreamSerdeConfig; -}); - -// ../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider10 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthSchemeConfig = exports.defaultBedrockRuntimeHttpAuthSchemeProvider = exports.defaultBedrockRuntimeHttpAuthSchemeParametersProvider = undefined; - var core_1 = require_dist_cjs83(); - var core_2 = require_dist_cjs71(); - var util_middleware_1 = require_dist_cjs60(); - var defaultBedrockRuntimeHttpAuthSchemeParametersProvider = async (config2, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config2.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports.defaultBedrockRuntimeHttpAuthSchemeParametersProvider = defaultBedrockRuntimeHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "bedrock", - region: authParameters.region - }, - propertiesExtractor: (config2, context) => ({ - signingProperties: { - config: config2, - context - } - }) - }; - } - function createSmithyApiHttpBearerAuthHttpAuthOption(authParameters) { - return { - schemeId: "smithy.api#httpBearerAuth", - propertiesExtractor: ({ profile, filepath, configFilepath, ignoreCache }, context) => ({ - identityProperties: { - profile, - filepath, - configFilepath, - ignoreCache - } - }) - }; - } - var defaultBedrockRuntimeHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); - options.push(createSmithyApiHttpBearerAuthHttpAuthOption(authParameters)); - } - } - return options; - }; - exports.defaultBedrockRuntimeHttpAuthSchemeProvider = defaultBedrockRuntimeHttpAuthSchemeProvider; - var resolveHttpAuthSchemeConfig = (config2) => { - const token = (0, core_2.memoizeIdentityProvider)(config2.token, core_2.isIdentityExpired, core_2.doesIdentityRequireRefresh); - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config2); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config2.authSchemePreference ?? []), - token - }); - }; - exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; -}); - -// ../node_modules/@aws-sdk/client-bedrock-runtime/package.json -var require_package5 = __commonJS((exports, module) => { - module.exports = { name: "@aws-sdk/client-bedrock-runtime", main: "dist-cjs/index.js" }; -}); - -// ../node_modules/@aws-sdk/eventstream-handler-node/dist-cjs/index.js -var require_dist_cjs120 = __commonJS((exports) => { - var eventstreamCodec = require_dist_cjs113(); - var stream4 = __require("stream"); - - class EventSigningStream extends stream4.Transform { - priorSignature; - messageSigner; - eventStreamCodec; - systemClockOffsetProvider; - constructor(options) { - super({ - autoDestroy: true, - readableObjectMode: true, - writableObjectMode: true, - ...options - }); - this.priorSignature = options.priorSignature; - this.eventStreamCodec = options.eventStreamCodec; - this.messageSigner = options.messageSigner; - this.systemClockOffsetProvider = options.systemClockOffsetProvider; - } - async _transform(chunk2, encoding, callback) { - try { - const now2 = new Date(Date.now() + await this.systemClockOffsetProvider()); - const dateHeader = { - ":date": { type: "timestamp", value: now2 } - }; - const signedMessage = await this.messageSigner.sign({ - message: { - body: chunk2, - headers: dateHeader - }, - priorSignature: this.priorSignature - }, { - signingDate: now2 - }); - this.priorSignature = signedMessage.signature; - const serializedSigned = this.eventStreamCodec.encode({ - headers: { - ...dateHeader, - ":chunk-signature": { - type: "binary", - value: getSignatureBinary(signedMessage.signature) - } - }, - body: chunk2 - }); - this.push(serializedSigned); - return callback(); - } catch (err) { - callback(err); - } - } - } - function getSignatureBinary(signature) { - const buf = Buffer.from(signature, "hex"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); - } - - class EventStreamPayloadHandler { - messageSigner; - eventStreamCodec; - systemClockOffsetProvider; - constructor(options) { - this.messageSigner = options.messageSigner; - this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder); - this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0; - } - async handle(next, args, context = {}) { - const request = args.request; - const { body: payload, query } = request; - if (!(payload instanceof stream4.Readable)) { - throw new Error("Eventstream payload must be a Readable stream."); - } - const payloadStream = payload; - request.body = new stream4.PassThrough({ - objectMode: true - }); - const match = request.headers?.authorization?.match(/Signature=([\w]+)$/); - const priorSignature = match?.[1] ?? query?.["X-Amz-Signature"] ?? ""; - const signingStream = new EventSigningStream({ - priorSignature, - eventStreamCodec: this.eventStreamCodec, - messageSigner: await this.messageSigner(), - systemClockOffsetProvider: this.systemClockOffsetProvider - }); - stream4.pipeline(payloadStream, signingStream, request.body, (err) => { - if (err) { - throw err; - } - }); - let result2; - try { - result2 = await next(args); - } catch (e) { - request.body.end(); - throw e; - } - return result2; - } - } - var eventStreamPayloadHandlerProvider = (options) => new EventStreamPayloadHandler(options); - exports.eventStreamPayloadHandlerProvider = eventStreamPayloadHandlerProvider; -}); - -// ../node_modules/@smithy/eventstream-serde-node/dist-cjs/index.js -var require_dist_cjs121 = __commonJS((exports, module) => { - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - EventStreamMarshaller: () => EventStreamMarshaller, - eventStreamSerdeProvider: () => eventStreamSerdeProvider - }); - module.exports = __toCommonJS2(src_exports); - var import_eventstream_serde_universal = require_dist_cjs115(); - var import_stream7 = __require("stream"); - async function* readabletoIterable(readStream2) { - let streamEnded = false; - let generationEnded = false; - const records = new Array; - readStream2.on("error", (err) => { - if (!streamEnded) { - streamEnded = true; - } - if (err) { - throw err; - } - }); - readStream2.on("data", (data) => { - records.push(data); - }); - readStream2.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; - } - } - __name(readabletoIterable, "readabletoIterable"); - var _EventStreamMarshaller = class _EventStreamMarshaller2 { - constructor({ utf8Encoder, utf8Decoder }) { - this.universalMarshaller = new import_eventstream_serde_universal.EventStreamMarshaller({ - utf8Decoder, - utf8Encoder - }); - } - deserialize(body, deserializer) { - const bodyIterable = typeof body[Symbol.asyncIterator] === "function" ? body : readabletoIterable(body); - return this.universalMarshaller.deserialize(bodyIterable, deserializer); - } - serialize(input, serializer) { - return import_stream7.Readable.from(this.universalMarshaller.serialize(input, serializer)); - } - }; - __name(_EventStreamMarshaller, "EventStreamMarshaller"); - var EventStreamMarshaller = _EventStreamMarshaller; - var eventStreamSerdeProvider = /* @__PURE__ */ __name((options) => new EventStreamMarshaller(options), "eventStreamSerdeProvider"); -}); - -// ../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/ruleset.js -var require_ruleset10 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ruleSet = undefined; - var s = "required"; - var t = "fn"; - var u2 = "argv"; - var v = "ref"; - var a2 = true; - var b = "isSet"; - var c5 = "booleanEquals"; - var d = "error"; - var e = "endpoint"; - var f = "tree"; - var g = "PartitionResult"; - var h2 = { [s]: false, type: "string" }; - var i2 = { [s]: true, default: false, type: "boolean" }; - var j = { [v]: "Endpoint" }; - var k = { [t]: c5, [u2]: [{ [v]: "UseFIPS" }, true] }; - var l = { [t]: c5, [u2]: [{ [v]: "UseDualStack" }, true] }; - var m = {}; - var n2 = { [t]: "getAttr", [u2]: [{ [v]: g }, "supportsFIPS"] }; - var o2 = { [t]: c5, [u2]: [true, { [t]: "getAttr", [u2]: [{ [v]: g }, "supportsDualStack"] }] }; - var p = [k]; - var q = [l]; - var r = [{ [v]: "Region" }]; - var _data = { version: "1.0", parameters: { Region: h2, UseDualStack: i2, UseFIPS: i2, Endpoint: h2 }, rules: [{ conditions: [{ [t]: b, [u2]: [j] }], rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { rules: [{ conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: j, properties: m, headers: m }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [t]: b, [u2]: r }], rules: [{ conditions: [{ [t]: "aws.partition", [u2]: r, assign: g }], rules: [{ conditions: [k, l], rules: [{ conditions: [{ [t]: c5, [u2]: [a2, n2] }, o2], rules: [{ rules: [{ endpoint: { url: "https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: p, rules: [{ conditions: [{ [t]: c5, [u2]: [n2, a2] }], rules: [{ rules: [{ endpoint: { url: "https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: q, rules: [{ conditions: [o2], rules: [{ rules: [{ endpoint: { url: "https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { rules: [{ endpoint: { url: "https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }], type: f }] }; - exports.ruleSet = _data; -}); - -// ../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/endpointResolver.js -var require_endpointResolver10 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultEndpointResolver = undefined; - var util_endpoints_1 = require_dist_cjs75(); - var util_endpoints_2 = require_dist_cjs72(); - var ruleset_1 = require_ruleset10(); - var cache2 = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] - }); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return cache2.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - })); - }; - exports.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -}); - -// ../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.shared.js -var require_runtimeConfig_shared10 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var core_1 = require_dist_cjs83(); - var protocols_1 = require_protocols4(); - var core_2 = require_dist_cjs71(); - var smithy_client_1 = require_dist_cjs81(); - var url_parser_1 = require_dist_cjs74(); - var util_base64_1 = require_dist_cjs65(); - var util_utf8_1 = require_dist_cjs64(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider10(); - var endpointResolver_1 = require_endpointResolver10(); - var getRuntimeConfig = (config2) => { - return { - apiVersion: "2023-09-30", - base64Decoder: config2?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config2?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config2?.disableHostPrefix ?? false, - endpointProvider: config2?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config2?.extensions ?? [], - httpAuthSchemeProvider: config2?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultBedrockRuntimeHttpAuthSchemeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#httpBearerAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth"), - signer: new core_2.HttpBearerAuthSigner - } - ], - logger: config2?.logger ?? new smithy_client_1.NoOpLogger, - protocol: config2?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.bedrockruntime" }), - serviceId: config2?.serviceId ?? "Bedrock Runtime", - urlParser: config2?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config2?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config2?.utf8Encoder ?? util_utf8_1.toUtf8 - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.js -var require_runtimeConfig10 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var tslib_1 = require_tslib2(); - var package_json_1 = tslib_1.__importDefault(require_package5()); - var core_1 = require_dist_cjs83(); - var credential_provider_node_1 = require_dist_cjs109(); - var eventstream_handler_node_1 = require_dist_cjs120(); - var token_providers_1 = require_dist_cjs102(); - var util_user_agent_node_1 = require_dist_cjs97(); - var config_resolver_1 = require_dist_cjs86(); - var core_2 = require_dist_cjs71(); - var eventstream_serde_node_1 = require_dist_cjs121(); - var hash_node_1 = require_dist_cjs98(); - var middleware_retry_1 = require_dist_cjs93(); - var node_config_provider_1 = require_dist_cjs89(); - var node_http_handler_1 = require_dist_cjs68(); - var util_body_length_node_1 = require_dist_cjs99(); - var util_retry_1 = require_dist_cjs92(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared10(); - var smithy_client_1 = require_dist_cjs81(); - var util_defaults_mode_node_1 = require_dist_cjs100(); - var smithy_client_2 = require_dist_cjs81(); - var getRuntimeConfig = (config2) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config2); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config2?.profile, - logger: clientSharedValues.logger, - signingName: "bedrock" - }; - return { - ...clientSharedValues, - ...config2, - runtime: "node", - defaultsMode, - authSchemePreference: config2?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config2?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - credentialDefaultProvider: config2?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, - defaultUserAgentProvider: config2?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - eventStreamPayloadHandlerProvider: config2?.eventStreamPayloadHandlerProvider ?? eventstream_handler_node_1.eventStreamPayloadHandlerProvider, - eventStreamSerdeProvider: config2?.eventStreamSerdeProvider ?? eventstream_serde_node_1.eventStreamSerdeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#httpBearerAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth") || (async (idProps) => { - try { - return await (0, token_providers_1.fromEnvSigningName)({ signingName: "bedrock" })(); - } catch (error41) { - return await (0, token_providers_1.nodeProvider)(idProps)(idProps); - } - }), - signer: new core_2.HttpBearerAuthSigner - } - ], - maxAttempts: config2?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config2), - region: config2?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttp2Handler.create(config2?.requestHandler ?? (async () => ({ ...await defaultConfigProvider(), disableConcurrentStreams: true }))), - retryMode: config2?.retryMode ?? (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }, config2), - sha256: config2?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config2?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config2?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config2?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config2?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js -var require_dist_cjs122 = __commonJS((exports) => { - var middlewareEventstream = require_dist_cjs111(); - var middlewareHostHeader = require_dist_cjs57(); - var middlewareLogger = require_dist_cjs58(); - var middlewareRecursionDetection = require_dist_cjs59(); - var middlewareUserAgent = require_dist_cjs84(); - var middlewareWebsocket = require_dist_cjs118(); - var configResolver = require_dist_cjs86(); - var core2 = require_dist_cjs71(); - var schema = require_schema2(); - var eventstreamSerdeConfigResolver = require_dist_cjs119(); - var middlewareContentLength = require_dist_cjs87(); - var middlewareEndpoint = require_dist_cjs90(); - var middlewareRetry = require_dist_cjs93(); - var smithyClient = require_dist_cjs81(); - var httpAuthSchemeProvider = require_httpAuthSchemeProvider10(); - var runtimeConfig = require_runtimeConfig10(); - var regionConfigResolver = require_dist_cjs101(); - var protocolHttp = require_dist_cjs56(); - var resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "bedrock" - }); - }; - var commonParams = { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - var getHttpAuthExtensionConfiguration = (runtimeConfig2) => { - const _httpAuthSchemes = runtimeConfig2.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig2.httpAuthSchemeProvider; - let _credentials = runtimeConfig2.credentials; - let _token = runtimeConfig2.token; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); - } - }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider2) { - _httpAuthSchemeProvider = httpAuthSchemeProvider2; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; - }, - setToken(token) { - _token = token; - }, - token() { - return _token; - } - }; - }; - var resolveHttpAuthRuntimeConfig = (config2) => { - return { - httpAuthSchemes: config2.httpAuthSchemes(), - httpAuthSchemeProvider: config2.httpAuthSchemeProvider(), - credentials: config2.credentials(), - token: config2.token() - }; - }; - var resolveRuntimeExtensions = (runtimeConfig2, extensions) => { - const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig2), smithyClient.getDefaultExtensionConfiguration(runtimeConfig2), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig2), getHttpAuthExtensionConfiguration(runtimeConfig2)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig2, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); - }; - - class BedrockRuntimeClient extends smithyClient.Client { - config; - constructor(...[configuration]) { - const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); - const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); - const _config_4 = configResolver.resolveRegionConfig(_config_3); - const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); - const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); - const _config_7 = eventstreamSerdeConfigResolver.resolveEventStreamSerdeConfig(_config_6); - const _config_8 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_7); - const _config_9 = middlewareEventstream.resolveEventStreamConfig(_config_8); - const _config_10 = middlewareWebsocket.resolveWebSocketConfig(_config_9); - const _config_11 = resolveRuntimeExtensions(_config_10, configuration?.extensions || []); - this.config = _config_11; - this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); - this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); - this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); - this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); - this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); - this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); - this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); - this.middlewareStack.use(core2.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultBedrockRuntimeHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config2) => new core2.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config2.credentials, - "smithy.api#httpBearerAuth": config2.token - }) - })); - this.middlewareStack.use(core2.getHttpSigningPlugin(this.config)); - } - destroy() { - super.destroy(); - } - } - var BedrockRuntimeServiceException$1 = class BedrockRuntimeServiceException2 extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, BedrockRuntimeServiceException2.prototype); - } - }; - var AccessDeniedException$1 = class AccessDeniedException2 extends BedrockRuntimeServiceException$1 { - name = "AccessDeniedException"; - $fault = "client"; - constructor(opts) { - super({ - name: "AccessDeniedException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, AccessDeniedException2.prototype); - } - }; - var InternalServerException$1 = class InternalServerException2 extends BedrockRuntimeServiceException$1 { - name = "InternalServerException"; - $fault = "server"; - constructor(opts) { - super({ - name: "InternalServerException", - $fault: "server", - ...opts - }); - Object.setPrototypeOf(this, InternalServerException2.prototype); - } - }; - var ThrottlingException$1 = class ThrottlingException2 extends BedrockRuntimeServiceException$1 { - name = "ThrottlingException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ThrottlingException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ThrottlingException2.prototype); - } - }; - var ValidationException$1 = class ValidationException2 extends BedrockRuntimeServiceException$1 { - name = "ValidationException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ValidationException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ValidationException2.prototype); - } - }; - var ConflictException$1 = class ConflictException2 extends BedrockRuntimeServiceException$1 { - name = "ConflictException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ConflictException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ConflictException2.prototype); - } - }; - var ResourceNotFoundException$1 = class ResourceNotFoundException2 extends BedrockRuntimeServiceException$1 { - name = "ResourceNotFoundException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ResourceNotFoundException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ResourceNotFoundException2.prototype); - } - }; - var ServiceQuotaExceededException$1 = class ServiceQuotaExceededException2 extends BedrockRuntimeServiceException$1 { - name = "ServiceQuotaExceededException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ServiceQuotaExceededException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ServiceQuotaExceededException2.prototype); - } - }; - var ServiceUnavailableException$1 = class ServiceUnavailableException2 extends BedrockRuntimeServiceException$1 { - name = "ServiceUnavailableException"; - $fault = "server"; - constructor(opts) { - super({ - name: "ServiceUnavailableException", - $fault: "server", - ...opts - }); - Object.setPrototypeOf(this, ServiceUnavailableException2.prototype); - } - }; - var ModelErrorException$1 = class ModelErrorException2 extends BedrockRuntimeServiceException$1 { - name = "ModelErrorException"; - $fault = "client"; - originalStatusCode; - resourceName; - constructor(opts) { - super({ - name: "ModelErrorException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ModelErrorException2.prototype); - this.originalStatusCode = opts.originalStatusCode; - this.resourceName = opts.resourceName; - } - }; - var ModelNotReadyException$1 = class ModelNotReadyException2 extends BedrockRuntimeServiceException$1 { - name = "ModelNotReadyException"; - $fault = "client"; - $retryable = {}; - constructor(opts) { - super({ - name: "ModelNotReadyException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ModelNotReadyException2.prototype); - } - }; - var ModelTimeoutException$1 = class ModelTimeoutException2 extends BedrockRuntimeServiceException$1 { - name = "ModelTimeoutException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ModelTimeoutException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ModelTimeoutException2.prototype); - } - }; - var ModelStreamErrorException$1 = class ModelStreamErrorException2 extends BedrockRuntimeServiceException$1 { - name = "ModelStreamErrorException"; - $fault = "client"; - originalStatusCode; - originalMessage; - constructor(opts) { - super({ - name: "ModelStreamErrorException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ModelStreamErrorException2.prototype); - this.originalStatusCode = opts.originalStatusCode; - this.originalMessage = opts.originalMessage; - } - }; - var _A = "Accept"; - var _ADE = "AccessDeniedException"; - var _AG = "ApplyGuardrail"; - var _AGR = "ApplyGuardrailRequest"; - var _AGRp = "ApplyGuardrailResponse"; - var _AIM = "AsyncInvokeMessage"; - var _AIODC = "AsyncInvokeOutputDataConfig"; - var _AIS = "AsyncInvokeSummary"; - var _AISODC = "AsyncInvokeS3OutputDataConfig"; - var _AISs = "AsyncInvokeSummaries"; - var _ATC = "AnyToolChoice"; - var _ATCu = "AutoToolChoice"; - var _B = "Body"; - var _BIPP = "BidirectionalInputPayloadPart"; - var _BOPP = "BidirectionalOutputPayloadPart"; - var _C = "Citation"; - var _CB = "ContentBlocks"; - var _CBD = "ContentBlockDelta"; - var _CBDE = "ContentBlockDeltaEvent"; - var _CBS = "ContentBlockStart"; - var _CBSE = "ContentBlockStartEvent"; - var _CBSEo = "ContentBlockStopEvent"; - var _CBo = "ContentBlock"; - var _CC = "CitationsConfig"; - var _CCB = "CitationsContentBlock"; - var _CD = "CitationsDelta"; - var _CE = "ConflictException"; - var _CGC = "CitationGeneratedContent"; - var _CGCL = "CitationGeneratedContentList"; - var _CL = "CitationLocation"; - var _CM = "ConverseMetrics"; - var _CO = "ConverseOutput"; - var _CPB = "CachePointBlock"; - var _CR = "ConverseRequest"; - var _CRo = "ConverseResponse"; - var _CS = "ConverseStream"; - var _CSC = "CitationSourceContent"; - var _CSCD = "CitationSourceContentDelta"; - var _CSCL = "CitationSourceContentList"; - var _CSCLD = "CitationSourceContentListDelta"; - var _CSM = "ConverseStreamMetrics"; - var _CSME = "ConverseStreamMetadataEvent"; - var _CSO = "ConverseStreamOutput"; - var _CSR = "ConverseStreamRequest"; - var _CSRo = "ConverseStreamResponse"; - var _CST = "ConverseStreamTrace"; - var _CT = "ConverseTrace"; - var _CTI = "CountTokensInput"; - var _CTR = "ConverseTokensRequest"; - var _CTRo = "CountTokensRequest"; - var _CTRou = "CountTokensResponse"; - var _CT_ = "Content-Type"; - var _CTo = "CountTokens"; - var _Ci = "Citations"; - var _Co = "Converse"; - var _DB = "DocumentBlock"; - var _DCB = "DocumentContentBlocks"; - var _DCBo = "DocumentContentBlock"; - var _DCL = "DocumentCharLocation"; - var _DCLo = "DocumentChunkLocation"; - var _DPL = "DocumentPageLocation"; - var _DS = "DocumentSource"; - var _GA = "GuardrailAssessment"; - var _GAI = "GetAsyncInvoke"; - var _GAIR = "GetAsyncInvokeRequest"; - var _GAIRe = "GetAsyncInvokeResponse"; - var _GAL = "GuardrailAssessmentList"; - var _GALM = "GuardrailAssessmentListMap"; - var _GAM = "GuardrailAssessmentMap"; - var _GARDSL = "GuardrailAutomatedReasoningDifferenceScenarioList"; - var _GARF = "GuardrailAutomatedReasoningFinding"; - var _GARFL = "GuardrailAutomatedReasoningFindingList"; - var _GARIF = "GuardrailAutomatedReasoningImpossibleFinding"; - var _GARIFu = "GuardrailAutomatedReasoningInvalidFinding"; - var _GARITR = "GuardrailAutomatedReasoningInputTextReference"; - var _GARITRL = "GuardrailAutomatedReasoningInputTextReferenceList"; - var _GARLW = "GuardrailAutomatedReasoningLogicWarning"; - var _GARNTF = "GuardrailAutomatedReasoningNoTranslationsFinding"; - var _GARPA = "GuardrailAutomatedReasoningPolicyAssessment"; - var _GARR = "GuardrailAutomatedReasoningRule"; - var _GARRL = "GuardrailAutomatedReasoningRuleList"; - var _GARS = "GuardrailAutomatedReasoningScenario"; - var _GARSF = "GuardrailAutomatedReasoningSatisfiableFinding"; - var _GARSL = "GuardrailAutomatedReasoningStatementList"; - var _GARSLC = "GuardrailAutomatedReasoningStatementLogicContent"; - var _GARSNLC = "GuardrailAutomatedReasoningStatementNaturalLanguageContent"; - var _GARSu = "GuardrailAutomatedReasoningStatement"; - var _GART = "GuardrailAutomatedReasoningTranslation"; - var _GARTAF = "GuardrailAutomatedReasoningTranslationAmbiguousFinding"; - var _GARTCF = "GuardrailAutomatedReasoningTooComplexFinding"; - var _GARTL = "GuardrailAutomatedReasoningTranslationList"; - var _GARTO = "GuardrailAutomatedReasoningTranslationOption"; - var _GARTOL = "GuardrailAutomatedReasoningTranslationOptionList"; - var _GARVF = "GuardrailAutomatedReasoningValidFinding"; - var _GC = "GuardrailConfiguration"; - var _GCB = "GuardrailContentBlock"; - var _GCBL = "GuardrailContentBlockList"; - var _GCCB = "GuardrailConverseContentBlock"; - var _GCF = "GuardrailContentFilter"; - var _GCFL = "GuardrailContentFilterList"; - var _GCGF = "GuardrailContextualGroundingFilter"; - var _GCGFu = "GuardrailContextualGroundingFilters"; - var _GCGPA = "GuardrailContextualGroundingPolicyAssessment"; - var _GCIB = "GuardrailConverseImageBlock"; - var _GCIS = "GuardrailConverseImageSource"; - var _GCPA = "GuardrailContentPolicyAssessment"; - var _GCTB = "GuardrailConverseTextBlock"; - var _GCW = "GuardrailCustomWord"; - var _GCWL = "GuardrailCustomWordList"; - var _GCu = "GuardrailCoverage"; - var _GIB = "GuardrailImageBlock"; - var _GIC = "GuardrailImageCoverage"; - var _GIM = "GuardrailInvocationMetrics"; - var _GIS = "GuardrailImageSource"; - var _GMW = "GuardrailManagedWord"; - var _GMWL = "GuardrailManagedWordList"; - var _GOC = "GuardrailOutputContent"; - var _GOCL = "GuardrailOutputContentList"; - var _GPEF = "GuardrailPiiEntityFilter"; - var _GPEFL = "GuardrailPiiEntityFilterList"; - var _GRF = "GuardrailRegexFilter"; - var _GRFL = "GuardrailRegexFilterList"; - var _GSC = "GuardrailStreamConfiguration"; - var _GSIPA = "GuardrailSensitiveInformationPolicyAssessment"; - var _GT = "GuardrailTopic"; - var _GTA = "GuardrailTraceAssessment"; - var _GTB = "GuardrailTextBlock"; - var _GTCC = "GuardrailTextCharactersCoverage"; - var _GTL = "GuardrailTopicList"; - var _GTPA = "GuardrailTopicPolicyAssessment"; - var _GU = "GuardrailUsage"; - var _GWPA = "GuardrailWordPolicyAssessment"; - var _IB = "ImageBlock"; - var _IC = "InferenceConfiguration"; - var _IM = "InvokeModel"; - var _IMR = "InvokeModelRequest"; - var _IMRn = "InvokeModelResponse"; - var _IMTR = "InvokeModelTokensRequest"; - var _IMWBS = "InvokeModelWithBidirectionalStream"; - var _IMWBSI = "InvokeModelWithBidirectionalStreamInput"; - var _IMWBSO = "InvokeModelWithBidirectionalStreamOutput"; - var _IMWBSR = "InvokeModelWithBidirectionalStreamRequest"; - var _IMWBSRn = "InvokeModelWithBidirectionalStreamResponse"; - var _IMWRS = "InvokeModelWithResponseStream"; - var _IMWRSR = "InvokeModelWithResponseStreamRequest"; - var _IMWRSRn = "InvokeModelWithResponseStreamResponse"; - var _IS = "ImageSource"; - var _ISE = "InternalServerException"; - var _LAI = "ListAsyncInvokes"; - var _LAIR = "ListAsyncInvokesRequest"; - var _LAIRi = "ListAsyncInvokesResponse"; - var _M = "Message"; - var _MEE = "ModelErrorException"; - var _MIP = "ModelInputPayload"; - var _MNRE = "ModelNotReadyException"; - var _MSE = "MessageStartEvent"; - var _MSEE = "ModelStreamErrorException"; - var _MSEe = "MessageStopEvent"; - var _MTE = "ModelTimeoutException"; - var _Me = "Messages"; - var _PB = "PartBody"; - var _PC = "PerformanceConfiguration"; - var _PP = "PayloadPart"; - var _PRT = "PromptRouterTrace"; - var _PVM = "PromptVariableMap"; - var _PVV = "PromptVariableValues"; - var _RCB = "ReasoningContentBlock"; - var _RCBD = "ReasoningContentBlockDelta"; - var _RM = "RequestMetadata"; - var _RNFE = "ResourceNotFoundException"; - var _RS = "ResponseStream"; - var _RTB = "ReasoningTextBlock"; - var _SAI = "StartAsyncInvoke"; - var _SAIR = "StartAsyncInvokeRequest"; - var _SAIRt = "StartAsyncInvokeResponse"; - var _SCB = "SystemContentBlocks"; - var _SCBy = "SystemContentBlock"; - var _SL = "S3Location"; - var _SQEE = "ServiceQuotaExceededException"; - var _SRB = "SearchResultBlock"; - var _SRCB = "SearchResultContentBlock"; - var _SRCBe = "SearchResultContentBlocks"; - var _SRL = "SearchResultLocation"; - var _ST = "ServiceTier"; - var _STC = "SpecificToolChoice"; - var _STy = "SystemTool"; - var _SUE = "ServiceUnavailableException"; - var _T = "Tag"; - var _TC = "ToolConfiguration"; - var _TCo = "ToolChoice"; - var _TE = "ThrottlingException"; - var _TIS = "ToolInputSchema"; - var _TL = "TagList"; - var _TRB = "ToolResultBlock"; - var _TRBD = "ToolResultBlocksDelta"; - var _TRBDo = "ToolResultBlockDelta"; - var _TRBS = "ToolResultBlockStart"; - var _TRCB = "ToolResultContentBlocks"; - var _TRCBo = "ToolResultContentBlock"; - var _TS = "ToolSpecification"; - var _TU = "TokenUsage"; - var _TUB = "ToolUseBlock"; - var _TUBD = "ToolUseBlockDelta"; - var _TUBS = "ToolUseBlockStart"; - var _To = "Tools"; - var _Too = "Tool"; - var _VB = "VideoBlock"; - var _VE = "ValidationException"; - var _VS = "VideoSource"; - var _WL = "WebLocation"; - var _XABA = "X-Amzn-Bedrock-Accept"; - var _XABCT = "X-Amzn-Bedrock-Content-Type"; - var _XABG = "X-Amzn-Bedrock-GuardrailIdentifier"; - var _XABG_ = "X-Amzn-Bedrock-GuardrailVersion"; - var _XABPL = "X-Amzn-Bedrock-PerformanceConfig-Latency"; - var _XABST = "X-Amzn-Bedrock-Service-Tier"; - var _XABT = "X-Amzn-Bedrock-Trace"; - var _a2 = "action"; - var _aIS = "asyncInvokeSummaries"; - var _aMRF = "additionalModelRequestFields"; - var _aMRFP = "additionalModelResponseFieldPaths"; - var _aMRFd = "additionalModelResponseFields"; - var _aR = "actionReason"; - var _aRP = "automatedReasoningPolicy"; - var _aRPU = "automatedReasoningPolicyUnits"; - var _aRPu = "automatedReasoningPolicies"; - var _ac = "accept"; - var _an = "any"; - var _as = "assessments"; - var _au = "auto"; - var _b = "bytes"; - var _bO = "bucketOwner"; - var _bo = "body"; - var _c = "client"; - var _cBD = "contentBlockDelta"; - var _cBI = "contentBlockIndex"; - var _cBS = "contentBlockStart"; - var _cBSo = "contentBlockStop"; - var _cC = "citationsContent"; - var _cFS = "claimsFalseScenario"; - var _cGP = "contextualGroundingPolicy"; - var _cGPU = "contextualGroundingPolicyUnits"; - var _cP = "contentPolicy"; - var _cPIU = "contentPolicyImageUnits"; - var _cPU = "contentPolicyUnits"; - var _cPa = "cachePoint"; - var _cR = "contradictingRules"; - var _cRIT = "cacheReadInputTokens"; - var _cRT = "clientRequestToken"; - var _cT = "contentType"; - var _cTS = "claimsTrueScenario"; - var _cW = "customWords"; - var _cWIT = "cacheWriteInputTokens"; - var _ch = "chunk"; - var _ci = "citations"; - var _cit = "citation"; - var _cl = "claims"; - var _co = "content"; - var _con = "context"; - var _conf = "confidence"; - var _conv = "converse"; - var _d = "delta"; - var _dC = "documentChar"; - var _dCo = "documentChunk"; - var _dI = "documentIndex"; - var _dP = "documentPage"; - var _dS = "differenceScenarios"; - var _de = "detected"; - var _des = "description"; - var _do = "domain"; - var _doc = "document"; - var _e = "error"; - var _eT = "endTime"; - var _en = "enabled"; - var _end = "end"; - var _f = "format"; - var _fM = "failureMessage"; - var _fS = "filterStrength"; - var _fi = "findings"; - var _fil = "filters"; - var _g = "guardrail"; - var _gC = "guardrailCoverage"; - var _gCu = "guardrailConfig"; - var _gCua = "guardContent"; - var _gI = "guardrailIdentifier"; - var _gPL = "guardrailProcessingLatency"; - var _gV = "guardrailVersion"; - var _gu = "guarded"; - var _h = "http"; - var _hE = "httpError"; - var _hH = "httpHeader"; - var _hQ = "httpQuery"; - var _i = "input"; - var _iA = "invocationArn"; - var _iAn = "inputAssessment"; - var _iC = "inferenceConfig"; - var _iM = "invocationMetrics"; - var _iMI = "invokedModelId"; - var _iMn = "invokeModel"; - var _iS = "inputSchema"; - var _iSE = "internalServerException"; - var _iT = "inputTokens"; - var _id = "identifier"; - var _im = "images"; - var _ima = "image"; - var _imp = "impossible"; - var _in = "invalid"; - var _j = "json"; - var _k = "key"; - var _kKI = "kmsKeyId"; - var _l = "location"; - var _lM = "latencyMs"; - var _lMT = "lastModifiedTime"; - var _lW = "logicWarning"; - var _la = "latency"; - var _lo = "logic"; - var _m = "message"; - var _mA = "modelArn"; - var _mI = "modelId"; - var _mIo = "modelInput"; - var _mO = "modelOutput"; - var _mR = "maxResults"; - var _mS = "messageStart"; - var _mSEE = "modelStreamErrorException"; - var _mSe = "messageStop"; - var _mT = "maxTokens"; - var _mTE = "modelTimeoutException"; - var _mWL = "managedWordLists"; - var _ma = "match"; - var _me = "messages"; - var _met = "metrics"; - var _meta = "metadata"; - var _n = "name"; - var _nL = "naturalLanguage"; - var _nT = "nextToken"; - var _nTo = "noTranslations"; - var _o = "outputs"; - var _oA = "outputAssessments"; - var _oDC = "outputDataConfig"; - var _oM = "originalMessage"; - var _oS = "outputScope"; - var _oSC = "originalStatusCode"; - var _oT = "outputTokens"; - var _op = "options"; - var _ou = "output"; - var _p = "premises"; - var _pC = "performanceConfig"; - var _pCL = "performanceConfigLatency"; - var _pE = "piiEntities"; - var _pR = "promptRouter"; - var _pV = "promptVariables"; - var _pVA = "policyVersionArn"; - var _q = "qualifiers"; - var _r = "regex"; - var _rC = "reasoningContent"; - var _rCe = "redactedContent"; - var _rM = "requestMetadata"; - var _rN = "resourceName"; - var _rT = "reasoningText"; - var _re = "regexes"; - var _ro = "role"; - var _s = "source"; - var _sB = "sortBy"; - var _sC = "sourceContent"; - var _sE = "statusEquals"; - var _sIP = "sensitiveInformationPolicy"; - var _sIPFU = "sensitiveInformationPolicyFreeUnits"; - var _sIPU = "sensitiveInformationPolicyUnits"; - var _sL = "s3Location"; - var _sO = "sortOrder"; - var _sODC = "s3OutputDataConfig"; - var _sPM = "streamProcessingMode"; - var _sR = "stopReason"; - var _sRI = "searchResultIndex"; - var _sRL = "searchResultLocation"; - var _sRe = "searchResult"; - var _sRu = "supportingRules"; - var _sS = "stopSequences"; - var _sT = "submitTime"; - var _sTA = "submitTimeAfter"; - var _sTB = "submitTimeBefore"; - var _sTe = "serviceTier"; - var _sTy = "systemTool"; - var _sU = "s3Uri"; - var _sUE = "serviceUnavailableException"; - var _sa = "satisfiable"; - var _sc = "score"; - var _se = "server"; - var _si = "signature"; - var _sm = "smithy.ts.sdk.synthetic.com.amazonaws.bedrockruntime"; - var _st = "status"; - var _sta = "start"; - var _stat = "statements"; - var _str = "stream"; - var _stre = "streaming"; - var _sy = "system"; - var _t = "type"; - var _tA = "translationAmbiguous"; - var _tC = "toolConfig"; - var _tCe = "textCharacters"; - var _tCo = "toolChoice"; - var _tCoo = "tooComplex"; - var _tE = "throttlingException"; - var _tP = "topicPolicy"; - var _tPU = "topicPolicyUnits"; - var _tPo = "topP"; - var _tR = "toolResult"; - var _tS = "toolSpec"; - var _tT = "totalTokens"; - var _tU = "toolUse"; - var _tUI = "toolUseId"; - var _ta = "tags"; - var _te = "text"; - var _tem = "temperature"; - var _th = "threshold"; - var _ti = "title"; - var _to = "total"; - var _too = "tools"; - var _tool = "tool"; - var _top = "topics"; - var _tr = "trace"; - var _tra = "translation"; - var _tran = "translations"; - var _u = "usage"; - var _uC = "untranslatedClaims"; - var _uP = "untranslatedPremises"; - var _ur = "uri"; - var _url2 = "url"; - var _v = "value"; - var _vE = "validationException"; - var _va = "valid"; - var _vi = "video"; - var _w = "web"; - var _wP = "wordPolicy"; - var _wPU = "wordPolicyUnits"; - var n0 = "com.amazonaws.bedrockruntime"; - var AsyncInvokeMessage = [0, n0, _AIM, 8, 0]; - var Body = [0, n0, _B, 8, 21]; - var GuardrailAutomatedReasoningStatementLogicContent = [0, n0, _GARSLC, 8, 0]; - var GuardrailAutomatedReasoningStatementNaturalLanguageContent = [0, n0, _GARSNLC, 8, 0]; - var ModelInputPayload = [0, n0, _MIP, 8, 15]; - var PartBody = [0, n0, _PB, 8, 21]; - var AccessDeniedException = [ - -3, - n0, - _ADE, - { - [_e]: _c, - [_hE]: 403 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1); - var AnyToolChoice = [3, n0, _ATC, 0, [], []]; - var ApplyGuardrailRequest = [ - 3, - n0, - _AGR, - 0, - [_gI, _gV, _s, _co, _oS], - [[0, 1], [0, 1], 0, [() => GuardrailContentBlockList, 0], 0] - ]; - var ApplyGuardrailResponse = [ - 3, - n0, - _AGRp, - 0, - [_u, _a2, _aR, _o, _as, _gC], - [ - () => GuardrailUsage, - 0, - 0, - () => GuardrailOutputContentList, - [() => GuardrailAssessmentList, 0], - () => GuardrailCoverage - ] - ]; - var AsyncInvokeS3OutputDataConfig = [3, n0, _AISODC, 0, [_sU, _kKI, _bO], [0, 0, 0]]; - var AsyncInvokeSummary = [ - 3, - n0, - _AIS, - 0, - [_iA, _mA, _cRT, _st, _fM, _sT, _lMT, _eT, _oDC], - [0, 0, 0, 0, [() => AsyncInvokeMessage, 0], 5, 5, 5, () => AsyncInvokeOutputDataConfig] - ]; - var AutoToolChoice = [3, n0, _ATCu, 0, [], []]; - var BidirectionalInputPayloadPart = [3, n0, _BIPP, 8, [_b], [[() => PartBody, 0]]]; - var BidirectionalOutputPayloadPart = [3, n0, _BOPP, 8, [_b], [[() => PartBody, 0]]]; - var CachePointBlock = [3, n0, _CPB, 0, [_t], [0]]; - var Citation = [ - 3, - n0, - _C, - 0, - [_ti, _s, _sC, _l], - [0, 0, () => CitationSourceContentList, () => CitationLocation] - ]; - var CitationsConfig = [3, n0, _CC, 0, [_en], [2]]; - var CitationsContentBlock = [ - 3, - n0, - _CCB, - 0, - [_co, _ci], - [() => CitationGeneratedContentList, () => Citations] - ]; - var CitationsDelta = [ - 3, - n0, - _CD, - 0, - [_ti, _s, _sC, _l], - [0, 0, () => CitationSourceContentListDelta, () => CitationLocation] - ]; - var CitationSourceContentDelta = [3, n0, _CSCD, 0, [_te], [0]]; - var ConflictException = [ - -3, - n0, - _CE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ConflictException, ConflictException$1); - var ContentBlockDeltaEvent = [ - 3, - n0, - _CBDE, - 0, - [_d, _cBI], - [[() => ContentBlockDelta, 0], 1] - ]; - var ContentBlockStartEvent = [ - 3, - n0, - _CBSE, - 0, - [_sta, _cBI], - [() => ContentBlockStart, 1] - ]; - var ContentBlockStopEvent = [3, n0, _CBSEo, 0, [_cBI], [1]]; - var ConverseMetrics = [3, n0, _CM, 0, [_lM], [1]]; - var ConverseRequest = [ - 3, - n0, - _CR, - 0, - [_mI, _me, _sy, _iC, _tC, _gCu, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe], - [ - [0, 1], - [() => Messages3, 0], - [() => SystemContentBlocks, 0], - () => InferenceConfiguration, - () => ToolConfiguration, - () => GuardrailConfiguration, - 15, - [() => PromptVariableMap, 0], - 64 | 0, - [() => RequestMetadata, 0], - () => PerformanceConfiguration, - () => ServiceTier - ] - ]; - var ConverseResponse = [ - 3, - n0, - _CRo, - 0, - [_ou, _sR, _u, _met, _aMRFd, _tr, _pC, _sTe], - [ - [() => ConverseOutput, 0], - 0, - () => TokenUsage, - () => ConverseMetrics, - 15, - [() => ConverseTrace, 0], - () => PerformanceConfiguration, - () => ServiceTier - ] - ]; - var ConverseStreamMetadataEvent = [ - 3, - n0, - _CSME, - 0, - [_u, _met, _tr, _pC, _sTe], - [ - () => TokenUsage, - () => ConverseStreamMetrics, - [() => ConverseStreamTrace, 0], - () => PerformanceConfiguration, - () => ServiceTier - ] - ]; - var ConverseStreamMetrics = [3, n0, _CSM, 0, [_lM], [1]]; - var ConverseStreamRequest = [ - 3, - n0, - _CSR, - 0, - [_mI, _me, _sy, _iC, _tC, _gCu, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe], - [ - [0, 1], - [() => Messages3, 0], - [() => SystemContentBlocks, 0], - () => InferenceConfiguration, - () => ToolConfiguration, - () => GuardrailStreamConfiguration, - 15, - [() => PromptVariableMap, 0], - 64 | 0, - [() => RequestMetadata, 0], - () => PerformanceConfiguration, - () => ServiceTier - ] - ]; - var ConverseStreamResponse = [ - 3, - n0, - _CSRo, - 0, - [_str], - [[() => ConverseStreamOutput, 16]] - ]; - var ConverseStreamTrace = [ - 3, - n0, - _CST, - 0, - [_g, _pR], - [[() => GuardrailTraceAssessment, 0], () => PromptRouterTrace] - ]; - var ConverseTokensRequest = [ - 3, - n0, - _CTR, - 0, - [_me, _sy, _tC, _aMRF], - [[() => Messages3, 0], [() => SystemContentBlocks, 0], () => ToolConfiguration, 15] - ]; - var ConverseTrace = [ - 3, - n0, - _CT, - 0, - [_g, _pR], - [[() => GuardrailTraceAssessment, 0], () => PromptRouterTrace] - ]; - var CountTokensRequest = [ - 3, - n0, - _CTRo, - 0, - [_mI, _i], - [ - [0, 1], - [() => CountTokensInput, 0] - ] - ]; - var CountTokensResponse = [3, n0, _CTRou, 0, [_iT], [1]]; - var DocumentBlock = [ - 3, - n0, - _DB, - 0, - [_f, _n, _s, _con, _ci], - [0, 0, () => DocumentSource, 0, () => CitationsConfig] - ]; - var DocumentCharLocation = [3, n0, _DCL, 0, [_dI, _sta, _end], [1, 1, 1]]; - var DocumentChunkLocation = [3, n0, _DCLo, 0, [_dI, _sta, _end], [1, 1, 1]]; - var DocumentPageLocation = [3, n0, _DPL, 0, [_dI, _sta, _end], [1, 1, 1]]; - var GetAsyncInvokeRequest = [3, n0, _GAIR, 0, [_iA], [[0, 1]]]; - var GetAsyncInvokeResponse = [ - 3, - n0, - _GAIRe, - 0, - [_iA, _mA, _cRT, _st, _fM, _sT, _lMT, _eT, _oDC], - [0, 0, 0, 0, [() => AsyncInvokeMessage, 0], 5, 5, 5, () => AsyncInvokeOutputDataConfig] - ]; - var GuardrailAssessment = [ - 3, - n0, - _GA, - 0, - [_tP, _cP, _wP, _sIP, _cGP, _aRP, _iM], - [ - () => GuardrailTopicPolicyAssessment, - () => GuardrailContentPolicyAssessment, - () => GuardrailWordPolicyAssessment, - () => GuardrailSensitiveInformationPolicyAssessment, - () => GuardrailContextualGroundingPolicyAssessment, - [() => GuardrailAutomatedReasoningPolicyAssessment, 0], - () => GuardrailInvocationMetrics - ] - ]; - var GuardrailAutomatedReasoningImpossibleFinding = [ - 3, - n0, - _GARIF, - 0, - [_tra, _cR, _lW], - [ - [() => GuardrailAutomatedReasoningTranslation, 0], - () => GuardrailAutomatedReasoningRuleList, - [() => GuardrailAutomatedReasoningLogicWarning, 0] - ] - ]; - var GuardrailAutomatedReasoningInputTextReference = [ - 3, - n0, - _GARITR, - 0, - [_te], - [[() => GuardrailAutomatedReasoningStatementNaturalLanguageContent, 0]] - ]; - var GuardrailAutomatedReasoningInvalidFinding = [ - 3, - n0, - _GARIFu, - 0, - [_tra, _cR, _lW], - [ - [() => GuardrailAutomatedReasoningTranslation, 0], - () => GuardrailAutomatedReasoningRuleList, - [() => GuardrailAutomatedReasoningLogicWarning, 0] - ] - ]; - var GuardrailAutomatedReasoningLogicWarning = [ - 3, - n0, - _GARLW, - 0, - [_t, _p, _cl], - [0, [() => GuardrailAutomatedReasoningStatementList, 0], [() => GuardrailAutomatedReasoningStatementList, 0]] - ]; - var GuardrailAutomatedReasoningNoTranslationsFinding = [3, n0, _GARNTF, 0, [], []]; - var GuardrailAutomatedReasoningPolicyAssessment = [ - 3, - n0, - _GARPA, - 0, - [_fi], - [[() => GuardrailAutomatedReasoningFindingList, 0]] - ]; - var GuardrailAutomatedReasoningRule = [3, n0, _GARR, 0, [_id, _pVA], [0, 0]]; - var GuardrailAutomatedReasoningSatisfiableFinding = [ - 3, - n0, - _GARSF, - 0, - [_tra, _cTS, _cFS, _lW], - [ - [() => GuardrailAutomatedReasoningTranslation, 0], - [() => GuardrailAutomatedReasoningScenario, 0], - [() => GuardrailAutomatedReasoningScenario, 0], - [() => GuardrailAutomatedReasoningLogicWarning, 0] - ] - ]; - var GuardrailAutomatedReasoningScenario = [ - 3, - n0, - _GARS, - 0, - [_stat], - [[() => GuardrailAutomatedReasoningStatementList, 0]] - ]; - var GuardrailAutomatedReasoningStatement = [ - 3, - n0, - _GARSu, - 0, - [_lo, _nL], - [ - [() => GuardrailAutomatedReasoningStatementLogicContent, 0], - [() => GuardrailAutomatedReasoningStatementNaturalLanguageContent, 0] - ] - ]; - var GuardrailAutomatedReasoningTooComplexFinding = [3, n0, _GARTCF, 0, [], []]; - var GuardrailAutomatedReasoningTranslation = [ - 3, - n0, - _GART, - 0, - [_p, _cl, _uP, _uC, _conf], - [ - [() => GuardrailAutomatedReasoningStatementList, 0], - [() => GuardrailAutomatedReasoningStatementList, 0], - [() => GuardrailAutomatedReasoningInputTextReferenceList, 0], - [() => GuardrailAutomatedReasoningInputTextReferenceList, 0], - 1 - ] - ]; - var GuardrailAutomatedReasoningTranslationAmbiguousFinding = [ - 3, - n0, - _GARTAF, - 0, - [_op, _dS], - [ - [() => GuardrailAutomatedReasoningTranslationOptionList, 0], - [() => GuardrailAutomatedReasoningDifferenceScenarioList, 0] - ] - ]; - var GuardrailAutomatedReasoningTranslationOption = [ - 3, - n0, - _GARTO, - 0, - [_tran], - [[() => GuardrailAutomatedReasoningTranslationList, 0]] - ]; - var GuardrailAutomatedReasoningValidFinding = [ - 3, - n0, - _GARVF, - 0, - [_tra, _cTS, _sRu, _lW], - [ - [() => GuardrailAutomatedReasoningTranslation, 0], - [() => GuardrailAutomatedReasoningScenario, 0], - () => GuardrailAutomatedReasoningRuleList, - [() => GuardrailAutomatedReasoningLogicWarning, 0] - ] - ]; - var GuardrailConfiguration = [3, n0, _GC, 0, [_gI, _gV, _tr], [0, 0, 0]]; - var GuardrailContentFilter = [3, n0, _GCF, 0, [_t, _conf, _fS, _a2, _de], [0, 0, 0, 0, 2]]; - var GuardrailContentPolicyAssessment = [ - 3, - n0, - _GCPA, - 0, - [_fil], - [() => GuardrailContentFilterList] - ]; - var GuardrailContextualGroundingFilter = [ - 3, - n0, - _GCGF, - 0, - [_t, _th, _sc, _a2, _de], - [0, 1, 1, 0, 2] - ]; - var GuardrailContextualGroundingPolicyAssessment = [ - 3, - n0, - _GCGPA, - 0, - [_fil], - [() => GuardrailContextualGroundingFilters] - ]; - var GuardrailConverseImageBlock = [ - 3, - n0, - _GCIB, - 8, - [_f, _s], - [0, [() => GuardrailConverseImageSource, 0]] - ]; - var GuardrailConverseTextBlock = [3, n0, _GCTB, 0, [_te, _q], [0, 64 | 0]]; - var GuardrailCoverage = [ - 3, - n0, - _GCu, - 0, - [_tCe, _im], - [() => GuardrailTextCharactersCoverage, () => GuardrailImageCoverage] - ]; - var GuardrailCustomWord = [3, n0, _GCW, 0, [_ma, _a2, _de], [0, 0, 2]]; - var GuardrailImageBlock = [ - 3, - n0, - _GIB, - 8, - [_f, _s], - [0, [() => GuardrailImageSource, 0]] - ]; - var GuardrailImageCoverage = [3, n0, _GIC, 0, [_gu, _to], [1, 1]]; - var GuardrailInvocationMetrics = [ - 3, - n0, - _GIM, - 0, - [_gPL, _u, _gC], - [1, () => GuardrailUsage, () => GuardrailCoverage] - ]; - var GuardrailManagedWord = [3, n0, _GMW, 0, [_ma, _t, _a2, _de], [0, 0, 0, 2]]; - var GuardrailOutputContent = [3, n0, _GOC, 0, [_te], [0]]; - var GuardrailPiiEntityFilter = [3, n0, _GPEF, 0, [_ma, _t, _a2, _de], [0, 0, 0, 2]]; - var GuardrailRegexFilter = [3, n0, _GRF, 0, [_n, _ma, _r, _a2, _de], [0, 0, 0, 0, 2]]; - var GuardrailSensitiveInformationPolicyAssessment = [ - 3, - n0, - _GSIPA, - 0, - [_pE, _re], - [() => GuardrailPiiEntityFilterList, () => GuardrailRegexFilterList] - ]; - var GuardrailStreamConfiguration = [3, n0, _GSC, 0, [_gI, _gV, _tr, _sPM], [0, 0, 0, 0]]; - var GuardrailTextBlock = [3, n0, _GTB, 0, [_te, _q], [0, 64 | 0]]; - var GuardrailTextCharactersCoverage = [3, n0, _GTCC, 0, [_gu, _to], [1, 1]]; - var GuardrailTopic = [3, n0, _GT, 0, [_n, _t, _a2, _de], [0, 0, 0, 2]]; - var GuardrailTopicPolicyAssessment = [ - 3, - n0, - _GTPA, - 0, - [_top], - [() => GuardrailTopicList] - ]; - var GuardrailTraceAssessment = [ - 3, - n0, - _GTA, - 0, - [_mO, _iAn, _oA, _aR], - [64 | 0, [() => GuardrailAssessmentMap, 0], [() => GuardrailAssessmentListMap, 0], 0] - ]; - var GuardrailUsage = [ - 3, - n0, - _GU, - 0, - [_tPU, _cPU, _wPU, _sIPU, _sIPFU, _cGPU, _cPIU, _aRPU, _aRPu], - [1, 1, 1, 1, 1, 1, 1, 1, 1] - ]; - var GuardrailWordPolicyAssessment = [ - 3, - n0, - _GWPA, - 0, - [_cW, _mWL], - [() => GuardrailCustomWordList, () => GuardrailManagedWordList] - ]; - var ImageBlock = [3, n0, _IB, 0, [_f, _s], [0, () => ImageSource]]; - var InferenceConfiguration = [3, n0, _IC, 0, [_mT, _tem, _tPo, _sS], [1, 1, 1, 64 | 0]]; - var InternalServerException = [ - -3, - n0, - _ISE, - { - [_e]: _se, - [_hE]: 500 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1); - var InvokeModelRequest = [ - 3, - n0, - _IMR, - 0, - [_bo, _cT, _ac, _mI, _tr, _gI, _gV, _pCL, _sTe], - [ - [() => Body, 16], - [ - 0, - { - [_hH]: _CT_ - } - ], - [ - 0, - { - [_hH]: _A - } - ], - [0, 1], - [ - 0, - { - [_hH]: _XABT - } - ], - [ - 0, - { - [_hH]: _XABG - } - ], - [ - 0, - { - [_hH]: _XABG_ - } - ], - [ - 0, - { - [_hH]: _XABPL - } - ], - [ - 0, - { - [_hH]: _XABST - } - ] - ] - ]; - var InvokeModelResponse = [ - 3, - n0, - _IMRn, - 0, - [_bo, _cT, _pCL, _sTe], - [ - [() => Body, 16], - [ - 0, - { - [_hH]: _CT_ - } - ], - [ - 0, - { - [_hH]: _XABPL - } - ], - [ - 0, - { - [_hH]: _XABST - } - ] - ] - ]; - var InvokeModelTokensRequest = [3, n0, _IMTR, 0, [_bo], [[() => Body, 0]]]; - var InvokeModelWithBidirectionalStreamRequest = [ - 3, - n0, - _IMWBSR, - 0, - [_mI, _bo], - [ - [0, 1], - [() => InvokeModelWithBidirectionalStreamInput, 16] - ] - ]; - var InvokeModelWithBidirectionalStreamResponse = [ - 3, - n0, - _IMWBSRn, - 0, - [_bo], - [[() => InvokeModelWithBidirectionalStreamOutput, 16]] - ]; - var InvokeModelWithResponseStreamRequest = [ - 3, - n0, - _IMWRSR, - 0, - [_bo, _cT, _ac, _mI, _tr, _gI, _gV, _pCL, _sTe], - [ - [() => Body, 16], - [ - 0, - { - [_hH]: _CT_ - } - ], - [ - 0, - { - [_hH]: _XABA - } - ], - [0, 1], - [ - 0, - { - [_hH]: _XABT - } - ], - [ - 0, - { - [_hH]: _XABG - } - ], - [ - 0, - { - [_hH]: _XABG_ - } - ], - [ - 0, - { - [_hH]: _XABPL - } - ], - [ - 0, - { - [_hH]: _XABST - } - ] - ] - ]; - var InvokeModelWithResponseStreamResponse = [ - 3, - n0, - _IMWRSRn, - 0, - [_bo, _cT, _pCL, _sTe], - [ - [() => ResponseStream, 16], - [ - 0, - { - [_hH]: _XABCT - } - ], - [ - 0, - { - [_hH]: _XABPL - } - ], - [ - 0, - { - [_hH]: _XABST - } - ] - ] - ]; - var ListAsyncInvokesRequest = [ - 3, - n0, - _LAIR, - 0, - [_sTA, _sTB, _sE, _mR, _nT, _sB, _sO], - [ - [ - 5, - { - [_hQ]: _sTA - } - ], - [ - 5, - { - [_hQ]: _sTB - } - ], - [ - 0, - { - [_hQ]: _sE - } - ], - [ - 1, - { - [_hQ]: _mR - } - ], - [ - 0, - { - [_hQ]: _nT - } - ], - [ - 0, - { - [_hQ]: _sB - } - ], - [ - 0, - { - [_hQ]: _sO - } - ] - ] - ]; - var ListAsyncInvokesResponse = [ - 3, - n0, - _LAIRi, - 0, - [_nT, _aIS], - [0, [() => AsyncInvokeSummaries, 0]] - ]; - var Message = [3, n0, _M, 0, [_ro, _co], [0, [() => ContentBlocks, 0]]]; - var MessageStartEvent = [3, n0, _MSE, 0, [_ro], [0]]; - var MessageStopEvent = [3, n0, _MSEe, 0, [_sR, _aMRFd], [0, 15]]; - var ModelErrorException = [ - -3, - n0, - _MEE, - { - [_e]: _c, - [_hE]: 424 - }, - [_m, _oSC, _rN], - [0, 1, 0] - ]; - schema.TypeRegistry.for(n0).registerError(ModelErrorException, ModelErrorException$1); - var ModelNotReadyException = [ - -3, - n0, - _MNRE, - { - [_e]: _c, - [_hE]: 429 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ModelNotReadyException, ModelNotReadyException$1); - var ModelStreamErrorException = [ - -3, - n0, - _MSEE, - { - [_e]: _c, - [_hE]: 424 - }, - [_m, _oSC, _oM], - [0, 1, 0] - ]; - schema.TypeRegistry.for(n0).registerError(ModelStreamErrorException, ModelStreamErrorException$1); - var ModelTimeoutException = [ - -3, - n0, - _MTE, - { - [_e]: _c, - [_hE]: 408 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ModelTimeoutException, ModelTimeoutException$1); - var PayloadPart = [3, n0, _PP, 8, [_b], [[() => PartBody, 0]]]; - var PerformanceConfiguration = [3, n0, _PC, 0, [_la], [0]]; - var PromptRouterTrace = [3, n0, _PRT, 0, [_iMI], [0]]; - var ReasoningTextBlock = [3, n0, _RTB, 8, [_te, _si], [0, 0]]; - var ResourceNotFoundException = [ - -3, - n0, - _RNFE, - { - [_e]: _c, - [_hE]: 404 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1); - var S3Location = [3, n0, _SL, 0, [_ur, _bO], [0, 0]]; - var SearchResultBlock = [ - 3, - n0, - _SRB, - 0, - [_s, _ti, _co, _ci], - [0, 0, () => SearchResultContentBlocks, () => CitationsConfig] - ]; - var SearchResultContentBlock = [3, n0, _SRCB, 0, [_te], [0]]; - var SearchResultLocation = [3, n0, _SRL, 0, [_sRI, _sta, _end], [1, 1, 1]]; - var ServiceQuotaExceededException = [ - -3, - n0, - _SQEE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ServiceQuotaExceededException, ServiceQuotaExceededException$1); - var ServiceTier = [3, n0, _ST, 0, [_t], [0]]; - var ServiceUnavailableException = [ - -3, - n0, - _SUE, - { - [_e]: _se, - [_hE]: 503 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ServiceUnavailableException, ServiceUnavailableException$1); - var SpecificToolChoice = [3, n0, _STC, 0, [_n], [0]]; - var StartAsyncInvokeRequest = [ - 3, - n0, - _SAIR, - 0, - [_cRT, _mI, _mIo, _oDC, _ta], - [[0, 4], 0, [() => ModelInputPayload, 0], () => AsyncInvokeOutputDataConfig, () => TagList] - ]; - var StartAsyncInvokeResponse = [3, n0, _SAIRt, 0, [_iA], [0]]; - var SystemTool = [3, n0, _STy, 0, [_n], [0]]; - var Tag = [3, n0, _T, 0, [_k, _v], [0, 0]]; - var ThrottlingException = [ - -3, - n0, - _TE, - { - [_e]: _c, - [_hE]: 429 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ThrottlingException, ThrottlingException$1); - var TokenUsage = [3, n0, _TU, 0, [_iT, _oT, _tT, _cRIT, _cWIT], [1, 1, 1, 1, 1]]; - var ToolConfiguration = [3, n0, _TC, 0, [_too, _tCo], [() => Tools, () => ToolChoice]]; - var ToolResultBlock = [ - 3, - n0, - _TRB, - 0, - [_tUI, _co, _st, _t], - [0, () => ToolResultContentBlocks, 0, 0] - ]; - var ToolResultBlockStart = [3, n0, _TRBS, 0, [_tUI, _t, _st], [0, 0, 0]]; - var ToolSpecification = [3, n0, _TS, 0, [_n, _des, _iS], [0, 0, () => ToolInputSchema]]; - var ToolUseBlock = [3, n0, _TUB, 0, [_tUI, _n, _i, _t], [0, 0, 15, 0]]; - var ToolUseBlockDelta = [3, n0, _TUBD, 0, [_i], [0]]; - var ToolUseBlockStart = [3, n0, _TUBS, 0, [_tUI, _n, _t], [0, 0, 0]]; - var ValidationException = [ - -3, - n0, - _VE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1); - var VideoBlock = [3, n0, _VB, 0, [_f, _s], [0, () => VideoSource]]; - var WebLocation = [3, n0, _WL, 0, [_url2, _do], [0, 0]]; - var BedrockRuntimeServiceException = [-3, _sm, "BedrockRuntimeServiceException", 0, [], []]; - schema.TypeRegistry.for(_sm).registerError(BedrockRuntimeServiceException, BedrockRuntimeServiceException$1); - var AsyncInvokeSummaries = [1, n0, _AISs, 0, [() => AsyncInvokeSummary, 0]]; - var CitationGeneratedContentList = [1, n0, _CGCL, 0, () => CitationGeneratedContent]; - var Citations = [1, n0, _Ci, 0, () => Citation]; - var CitationSourceContentList = [1, n0, _CSCL, 0, () => CitationSourceContent]; - var CitationSourceContentListDelta = [1, n0, _CSCLD, 0, () => CitationSourceContentDelta]; - var ContentBlocks = [1, n0, _CB, 0, [() => ContentBlock, 0]]; - var DocumentContentBlocks = [1, n0, _DCB, 0, () => DocumentContentBlock]; - var GuardrailAssessmentList = [1, n0, _GAL, 0, [() => GuardrailAssessment, 0]]; - var GuardrailAutomatedReasoningDifferenceScenarioList = [ - 1, - n0, - _GARDSL, - 0, - [() => GuardrailAutomatedReasoningScenario, 0] - ]; - var GuardrailAutomatedReasoningFindingList = [ - 1, - n0, - _GARFL, - 0, - [() => GuardrailAutomatedReasoningFinding, 0] - ]; - var GuardrailAutomatedReasoningInputTextReferenceList = [ - 1, - n0, - _GARITRL, - 0, - [() => GuardrailAutomatedReasoningInputTextReference, 0] - ]; - var GuardrailAutomatedReasoningRuleList = [ - 1, - n0, - _GARRL, - 0, - () => GuardrailAutomatedReasoningRule - ]; - var GuardrailAutomatedReasoningStatementList = [ - 1, - n0, - _GARSL, - 0, - [() => GuardrailAutomatedReasoningStatement, 0] - ]; - var GuardrailAutomatedReasoningTranslationList = [ - 1, - n0, - _GARTL, - 0, - [() => GuardrailAutomatedReasoningTranslation, 0] - ]; - var GuardrailAutomatedReasoningTranslationOptionList = [ - 1, - n0, - _GARTOL, - 0, - [() => GuardrailAutomatedReasoningTranslationOption, 0] - ]; - var GuardrailContentBlockList = [1, n0, _GCBL, 0, [() => GuardrailContentBlock, 0]]; - var GuardrailContentFilterList = [1, n0, _GCFL, 0, () => GuardrailContentFilter]; - var GuardrailContextualGroundingFilters = [ - 1, - n0, - _GCGFu, - 0, - () => GuardrailContextualGroundingFilter - ]; - var GuardrailCustomWordList = [1, n0, _GCWL, 0, () => GuardrailCustomWord]; - var GuardrailManagedWordList = [1, n0, _GMWL, 0, () => GuardrailManagedWord]; - var GuardrailOutputContentList = [1, n0, _GOCL, 0, () => GuardrailOutputContent]; - var GuardrailPiiEntityFilterList = [1, n0, _GPEFL, 0, () => GuardrailPiiEntityFilter]; - var GuardrailRegexFilterList = [1, n0, _GRFL, 0, () => GuardrailRegexFilter]; - var GuardrailTopicList = [1, n0, _GTL, 0, () => GuardrailTopic]; - var Messages3 = [1, n0, _Me, 0, [() => Message, 0]]; - var SearchResultContentBlocks = [1, n0, _SRCBe, 0, () => SearchResultContentBlock]; - var SystemContentBlocks = [1, n0, _SCB, 0, [() => SystemContentBlock, 0]]; - var TagList = [1, n0, _TL, 0, () => Tag]; - var ToolResultBlocksDelta = [1, n0, _TRBD, 0, () => ToolResultBlockDelta]; - var ToolResultContentBlocks = [1, n0, _TRCB, 0, () => ToolResultContentBlock]; - var Tools = [1, n0, _To, 0, () => Tool]; - var GuardrailAssessmentListMap = [2, n0, _GALM, 0, [0, 0], [() => GuardrailAssessmentList, 0]]; - var GuardrailAssessmentMap = [2, n0, _GAM, 0, [0, 0], [() => GuardrailAssessment, 0]]; - var PromptVariableMap = [2, n0, _PVM, 8, 0, () => PromptVariableValues]; - var RequestMetadata = [2, n0, _RM, 8, 0, 0]; - var AsyncInvokeOutputDataConfig = [ - 3, - n0, - _AIODC, - 0, - [_sODC], - [() => AsyncInvokeS3OutputDataConfig] - ]; - var CitationGeneratedContent = [3, n0, _CGC, 0, [_te], [0]]; - var CitationLocation = [ - 3, - n0, - _CL, - 0, - [_w, _dC, _dP, _dCo, _sRL], - [ - () => WebLocation, - () => DocumentCharLocation, - () => DocumentPageLocation, - () => DocumentChunkLocation, - () => SearchResultLocation - ] - ]; - var CitationSourceContent = [3, n0, _CSC, 0, [_te], [0]]; - var ContentBlock = [ - 3, - n0, - _CBo, - 0, - [_te, _ima, _doc, _vi, _tU, _tR, _gCua, _cPa, _rC, _cC, _sRe], - [ - 0, - () => ImageBlock, - () => DocumentBlock, - () => VideoBlock, - () => ToolUseBlock, - () => ToolResultBlock, - [() => GuardrailConverseContentBlock, 0], - () => CachePointBlock, - [() => ReasoningContentBlock, 0], - () => CitationsContentBlock, - () => SearchResultBlock - ] - ]; - var ContentBlockDelta = [ - 3, - n0, - _CBD, - 0, - [_te, _tU, _tR, _rC, _cit], - [ - 0, - () => ToolUseBlockDelta, - () => ToolResultBlocksDelta, - [() => ReasoningContentBlockDelta, 0], - () => CitationsDelta - ] - ]; - var ContentBlockStart = [ - 3, - n0, - _CBS, - 0, - [_tU, _tR], - [() => ToolUseBlockStart, () => ToolResultBlockStart] - ]; - var ConverseOutput = [3, n0, _CO, 0, [_m], [[() => Message, 0]]]; - var ConverseStreamOutput = [ - 3, - n0, - _CSO, - { - [_stre]: 1 - }, - [_mS, _cBS, _cBD, _cBSo, _mSe, _meta, _iSE, _mSEE, _vE, _tE, _sUE], - [ - () => MessageStartEvent, - () => ContentBlockStartEvent, - [() => ContentBlockDeltaEvent, 0], - () => ContentBlockStopEvent, - () => MessageStopEvent, - [() => ConverseStreamMetadataEvent, 0], - [() => InternalServerException, 0], - [() => ModelStreamErrorException, 0], - [() => ValidationException, 0], - [() => ThrottlingException, 0], - [() => ServiceUnavailableException, 0] - ] - ]; - var CountTokensInput = [ - 3, - n0, - _CTI, - 0, - [_iMn, _conv], - [ - [() => InvokeModelTokensRequest, 0], - [() => ConverseTokensRequest, 0] - ] - ]; - var DocumentContentBlock = [3, n0, _DCBo, 0, [_te], [0]]; - var DocumentSource = [ - 3, - n0, - _DS, - 0, - [_b, _sL, _te, _co], - [21, () => S3Location, 0, () => DocumentContentBlocks] - ]; - var GuardrailAutomatedReasoningFinding = [ - 3, - n0, - _GARF, - 0, - [_va, _in, _sa, _imp, _tA, _tCoo, _nTo], - [ - [() => GuardrailAutomatedReasoningValidFinding, 0], - [() => GuardrailAutomatedReasoningInvalidFinding, 0], - [() => GuardrailAutomatedReasoningSatisfiableFinding, 0], - [() => GuardrailAutomatedReasoningImpossibleFinding, 0], - [() => GuardrailAutomatedReasoningTranslationAmbiguousFinding, 0], - () => GuardrailAutomatedReasoningTooComplexFinding, - () => GuardrailAutomatedReasoningNoTranslationsFinding - ] - ]; - var GuardrailContentBlock = [ - 3, - n0, - _GCB, - 0, - [_te, _ima], - [() => GuardrailTextBlock, [() => GuardrailImageBlock, 0]] - ]; - var GuardrailConverseContentBlock = [ - 3, - n0, - _GCCB, - 0, - [_te, _ima], - [() => GuardrailConverseTextBlock, [() => GuardrailConverseImageBlock, 0]] - ]; - var GuardrailConverseImageSource = [3, n0, _GCIS, 8, [_b], [21]]; - var GuardrailImageSource = [3, n0, _GIS, 8, [_b], [21]]; - var ImageSource = [3, n0, _IS, 0, [_b, _sL], [21, () => S3Location]]; - var InvokeModelWithBidirectionalStreamInput = [ - 3, - n0, - _IMWBSI, - { - [_stre]: 1 - }, - [_ch], - [[() => BidirectionalInputPayloadPart, 0]] - ]; - var InvokeModelWithBidirectionalStreamOutput = [ - 3, - n0, - _IMWBSO, - { - [_stre]: 1 - }, - [_ch, _iSE, _mSEE, _vE, _tE, _mTE, _sUE], - [ - [() => BidirectionalOutputPayloadPart, 0], - [() => InternalServerException, 0], - [() => ModelStreamErrorException, 0], - [() => ValidationException, 0], - [() => ThrottlingException, 0], - [() => ModelTimeoutException, 0], - [() => ServiceUnavailableException, 0] - ] - ]; - var PromptVariableValues = [3, n0, _PVV, 0, [_te], [0]]; - var ReasoningContentBlock = [ - 3, - n0, - _RCB, - 8, - [_rT, _rCe], - [[() => ReasoningTextBlock, 0], 21] - ]; - var ReasoningContentBlockDelta = [3, n0, _RCBD, 8, [_te, _rCe, _si], [0, 21, 0]]; - var ResponseStream = [ - 3, - n0, - _RS, - { - [_stre]: 1 - }, - [_ch, _iSE, _mSEE, _vE, _tE, _mTE, _sUE], - [ - [() => PayloadPart, 0], - [() => InternalServerException, 0], - [() => ModelStreamErrorException, 0], - [() => ValidationException, 0], - [() => ThrottlingException, 0], - [() => ModelTimeoutException, 0], - [() => ServiceUnavailableException, 0] - ] - ]; - var SystemContentBlock = [ - 3, - n0, - _SCBy, - 0, - [_te, _gCua, _cPa], - [0, [() => GuardrailConverseContentBlock, 0], () => CachePointBlock] - ]; - var Tool = [ - 3, - n0, - _Too, - 0, - [_tS, _sTy, _cPa], - [() => ToolSpecification, () => SystemTool, () => CachePointBlock] - ]; - var ToolChoice = [ - 3, - n0, - _TCo, - 0, - [_au, _an, _tool], - [() => AutoToolChoice, () => AnyToolChoice, () => SpecificToolChoice] - ]; - var ToolInputSchema = [3, n0, _TIS, 0, [_j], [15]]; - var ToolResultBlockDelta = [3, n0, _TRBDo, 0, [_te], [0]]; - var ToolResultContentBlock = [ - 3, - n0, - _TRCBo, - 0, - [_j, _te, _ima, _doc, _vi, _sRe], - [15, 0, () => ImageBlock, () => DocumentBlock, () => VideoBlock, () => SearchResultBlock] - ]; - var VideoSource = [3, n0, _VS, 0, [_b, _sL], [21, () => S3Location]]; - var ApplyGuardrail = [ - 9, - n0, - _AG, - { - [_h]: ["POST", "/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply", 200] - }, - () => ApplyGuardrailRequest, - () => ApplyGuardrailResponse - ]; - var Converse = [ - 9, - n0, - _Co, - { - [_h]: ["POST", "/model/{modelId}/converse", 200] - }, - () => ConverseRequest, - () => ConverseResponse - ]; - var ConverseStream = [ - 9, - n0, - _CS, - { - [_h]: ["POST", "/model/{modelId}/converse-stream", 200] - }, - () => ConverseStreamRequest, - () => ConverseStreamResponse - ]; - var CountTokens = [ - 9, - n0, - _CTo, - { - [_h]: ["POST", "/model/{modelId}/count-tokens", 200] - }, - () => CountTokensRequest, - () => CountTokensResponse - ]; - var GetAsyncInvoke = [ - 9, - n0, - _GAI, - { - [_h]: ["GET", "/async-invoke/{invocationArn}", 200] - }, - () => GetAsyncInvokeRequest, - () => GetAsyncInvokeResponse - ]; - var InvokeModel = [ - 9, - n0, - _IM, - { - [_h]: ["POST", "/model/{modelId}/invoke", 200] - }, - () => InvokeModelRequest, - () => InvokeModelResponse - ]; - var InvokeModelWithBidirectionalStream = [ - 9, - n0, - _IMWBS, - { - [_h]: ["POST", "/model/{modelId}/invoke-with-bidirectional-stream", 200] - }, - () => InvokeModelWithBidirectionalStreamRequest, - () => InvokeModelWithBidirectionalStreamResponse - ]; - var InvokeModelWithResponseStream = [ - 9, - n0, - _IMWRS, - { - [_h]: ["POST", "/model/{modelId}/invoke-with-response-stream", 200] - }, - () => InvokeModelWithResponseStreamRequest, - () => InvokeModelWithResponseStreamResponse - ]; - var ListAsyncInvokes = [ - 9, - n0, - _LAI, - { - [_h]: ["GET", "/async-invoke", 200] - }, - () => ListAsyncInvokesRequest, - () => ListAsyncInvokesResponse - ]; - var StartAsyncInvoke = [ - 9, - n0, - _SAI, - { - [_h]: ["POST", "/async-invoke", 200] - }, - () => StartAsyncInvokeRequest, - () => StartAsyncInvokeResponse - ]; - - class ApplyGuardrailCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "ApplyGuardrail", {}).n("BedrockRuntimeClient", "ApplyGuardrailCommand").sc(ApplyGuardrail).build() { - } - - class ConverseCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "Converse", {}).n("BedrockRuntimeClient", "ConverseCommand").sc(Converse).build() { - } - - class ConverseStreamCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "ConverseStream", { - eventStream: { - output: true - } - }).n("BedrockRuntimeClient", "ConverseStreamCommand").sc(ConverseStream).build() { - } - - class CountTokensCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "CountTokens", {}).n("BedrockRuntimeClient", "CountTokensCommand").sc(CountTokens).build() { - } - - class GetAsyncInvokeCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "GetAsyncInvoke", {}).n("BedrockRuntimeClient", "GetAsyncInvokeCommand").sc(GetAsyncInvoke).build() { - } - - class InvokeModelCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "InvokeModel", {}).n("BedrockRuntimeClient", "InvokeModelCommand").sc(InvokeModel).build() { - } - - class InvokeModelWithBidirectionalStreamCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [ - middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions()), - middlewareEventstream.getEventStreamPlugin(config2), - middlewareWebsocket.getWebSocketPlugin(config2, { - headerPrefix: "x-amz-bedrock-" - }) - ]; - }).s("AmazonBedrockFrontendService", "InvokeModelWithBidirectionalStream", { - eventStream: { - input: true, - output: true - } - }).n("BedrockRuntimeClient", "InvokeModelWithBidirectionalStreamCommand").sc(InvokeModelWithBidirectionalStream).build() { - } - - class InvokeModelWithResponseStreamCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "InvokeModelWithResponseStream", { - eventStream: { - output: true - } - }).n("BedrockRuntimeClient", "InvokeModelWithResponseStreamCommand").sc(InvokeModelWithResponseStream).build() { - } - - class ListAsyncInvokesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "ListAsyncInvokes", {}).n("BedrockRuntimeClient", "ListAsyncInvokesCommand").sc(ListAsyncInvokes).build() { - } - - class StartAsyncInvokeCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AmazonBedrockFrontendService", "StartAsyncInvoke", {}).n("BedrockRuntimeClient", "StartAsyncInvokeCommand").sc(StartAsyncInvoke).build() { - } - var commands = { - ApplyGuardrailCommand, - ConverseCommand, - ConverseStreamCommand, - CountTokensCommand, - GetAsyncInvokeCommand, - InvokeModelCommand, - InvokeModelWithBidirectionalStreamCommand, - InvokeModelWithResponseStreamCommand, - ListAsyncInvokesCommand, - StartAsyncInvokeCommand - }; - - class BedrockRuntime extends BedrockRuntimeClient { - } - smithyClient.createAggregatedClient(commands, BedrockRuntime); - var paginateListAsyncInvokes = core2.createPaginator(BedrockRuntimeClient, ListAsyncInvokesCommand, "nextToken", "nextToken", "maxResults"); - var AsyncInvokeStatus = { - COMPLETED: "Completed", - FAILED: "Failed", - IN_PROGRESS: "InProgress" - }; - var SortAsyncInvocationBy = { - SUBMISSION_TIME: "SubmissionTime" - }; - var SortOrder = { - ASCENDING: "Ascending", - DESCENDING: "Descending" - }; - var GuardrailImageFormat = { - JPEG: "jpeg", - PNG: "png" - }; - var GuardrailContentQualifier = { - GROUNDING_SOURCE: "grounding_source", - GUARD_CONTENT: "guard_content", - QUERY: "query" - }; - var GuardrailOutputScope = { - FULL: "FULL", - INTERVENTIONS: "INTERVENTIONS" - }; - var GuardrailContentSource = { - INPUT: "INPUT", - OUTPUT: "OUTPUT" - }; - var GuardrailAction = { - GUARDRAIL_INTERVENED: "GUARDRAIL_INTERVENED", - NONE: "NONE" - }; - var GuardrailAutomatedReasoningLogicWarningType = { - ALWAYS_FALSE: "ALWAYS_FALSE", - ALWAYS_TRUE: "ALWAYS_TRUE" - }; - var GuardrailContentPolicyAction = { - BLOCKED: "BLOCKED", - NONE: "NONE" - }; - var GuardrailContentFilterConfidence = { - HIGH: "HIGH", - LOW: "LOW", - MEDIUM: "MEDIUM", - NONE: "NONE" - }; - var GuardrailContentFilterStrength = { - HIGH: "HIGH", - LOW: "LOW", - MEDIUM: "MEDIUM", - NONE: "NONE" - }; - var GuardrailContentFilterType = { - HATE: "HATE", - INSULTS: "INSULTS", - MISCONDUCT: "MISCONDUCT", - PROMPT_ATTACK: "PROMPT_ATTACK", - SEXUAL: "SEXUAL", - VIOLENCE: "VIOLENCE" - }; - var GuardrailContextualGroundingPolicyAction = { - BLOCKED: "BLOCKED", - NONE: "NONE" - }; - var GuardrailContextualGroundingFilterType = { - GROUNDING: "GROUNDING", - RELEVANCE: "RELEVANCE" - }; - var GuardrailSensitiveInformationPolicyAction = { - ANONYMIZED: "ANONYMIZED", - BLOCKED: "BLOCKED", - NONE: "NONE" - }; - var GuardrailPiiEntityType = { - ADDRESS: "ADDRESS", - AGE: "AGE", - AWS_ACCESS_KEY: "AWS_ACCESS_KEY", - AWS_SECRET_KEY: "AWS_SECRET_KEY", - CA_HEALTH_NUMBER: "CA_HEALTH_NUMBER", - CA_SOCIAL_INSURANCE_NUMBER: "CA_SOCIAL_INSURANCE_NUMBER", - CREDIT_DEBIT_CARD_CVV: "CREDIT_DEBIT_CARD_CVV", - CREDIT_DEBIT_CARD_EXPIRY: "CREDIT_DEBIT_CARD_EXPIRY", - CREDIT_DEBIT_CARD_NUMBER: "CREDIT_DEBIT_CARD_NUMBER", - DRIVER_ID: "DRIVER_ID", - EMAIL: "EMAIL", - INTERNATIONAL_BANK_ACCOUNT_NUMBER: "INTERNATIONAL_BANK_ACCOUNT_NUMBER", - IP_ADDRESS: "IP_ADDRESS", - LICENSE_PLATE: "LICENSE_PLATE", - MAC_ADDRESS: "MAC_ADDRESS", - NAME: "NAME", - PASSWORD: "PASSWORD", - PHONE: "PHONE", - PIN: "PIN", - SWIFT_CODE: "SWIFT_CODE", - UK_NATIONAL_HEALTH_SERVICE_NUMBER: "UK_NATIONAL_HEALTH_SERVICE_NUMBER", - UK_NATIONAL_INSURANCE_NUMBER: "UK_NATIONAL_INSURANCE_NUMBER", - UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER: "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER", - URL: "URL", - USERNAME: "USERNAME", - US_BANK_ACCOUNT_NUMBER: "US_BANK_ACCOUNT_NUMBER", - US_BANK_ROUTING_NUMBER: "US_BANK_ROUTING_NUMBER", - US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER", - US_PASSPORT_NUMBER: "US_PASSPORT_NUMBER", - US_SOCIAL_SECURITY_NUMBER: "US_SOCIAL_SECURITY_NUMBER", - VEHICLE_IDENTIFICATION_NUMBER: "VEHICLE_IDENTIFICATION_NUMBER" - }; - var GuardrailTopicPolicyAction = { - BLOCKED: "BLOCKED", - NONE: "NONE" - }; - var GuardrailTopicType = { - DENY: "DENY" - }; - var GuardrailWordPolicyAction = { - BLOCKED: "BLOCKED", - NONE: "NONE" - }; - var GuardrailManagedWordType = { - PROFANITY: "PROFANITY" - }; - var GuardrailTrace = { - DISABLED: "disabled", - ENABLED: "enabled", - ENABLED_FULL: "enabled_full" - }; - var CachePointType = { - DEFAULT: "default" - }; - var DocumentFormat = { - CSV: "csv", - DOC: "doc", - DOCX: "docx", - HTML: "html", - MD: "md", - PDF: "pdf", - TXT: "txt", - XLS: "xls", - XLSX: "xlsx" - }; - var GuardrailConverseImageFormat = { - JPEG: "jpeg", - PNG: "png" - }; - var GuardrailConverseContentQualifier = { - GROUNDING_SOURCE: "grounding_source", - GUARD_CONTENT: "guard_content", - QUERY: "query" - }; - var ImageFormat = { - GIF: "gif", - JPEG: "jpeg", - PNG: "png", - WEBP: "webp" - }; - var VideoFormat = { - FLV: "flv", - MKV: "mkv", - MOV: "mov", - MP4: "mp4", - MPEG: "mpeg", - MPG: "mpg", - THREE_GP: "three_gp", - WEBM: "webm", - WMV: "wmv" - }; - var ToolResultStatus = { - ERROR: "error", - SUCCESS: "success" - }; - var ToolUseType = { - SERVER_TOOL_USE: "server_tool_use" - }; - var ConversationRole = { - ASSISTANT: "assistant", - USER: "user" - }; - var PerformanceConfigLatency = { - OPTIMIZED: "optimized", - STANDARD: "standard" - }; - var ServiceTierType = { - DEFAULT: "default", - FLEX: "flex", - PRIORITY: "priority" - }; - var StopReason = { - CONTENT_FILTERED: "content_filtered", - END_TURN: "end_turn", - GUARDRAIL_INTERVENED: "guardrail_intervened", - MAX_TOKENS: "max_tokens", - MODEL_CONTEXT_WINDOW_EXCEEDED: "model_context_window_exceeded", - STOP_SEQUENCE: "stop_sequence", - TOOL_USE: "tool_use" - }; - var GuardrailStreamProcessingMode = { - ASYNC: "async", - SYNC: "sync" - }; - var Trace = { - DISABLED: "DISABLED", - ENABLED: "ENABLED", - ENABLED_FULL: "ENABLED_FULL" - }; - Object.defineProperty(exports, "$Command", { - enumerable: true, - get: function() { - return smithyClient.Command; - } - }); - Object.defineProperty(exports, "__Client", { - enumerable: true, - get: function() { - return smithyClient.Client; - } - }); - exports.AccessDeniedException = AccessDeniedException$1; - exports.ApplyGuardrailCommand = ApplyGuardrailCommand; - exports.AsyncInvokeStatus = AsyncInvokeStatus; - exports.BedrockRuntime = BedrockRuntime; - exports.BedrockRuntimeClient = BedrockRuntimeClient; - exports.BedrockRuntimeServiceException = BedrockRuntimeServiceException$1; - exports.CachePointType = CachePointType; - exports.ConflictException = ConflictException$1; - exports.ConversationRole = ConversationRole; - exports.ConverseCommand = ConverseCommand; - exports.ConverseStreamCommand = ConverseStreamCommand; - exports.CountTokensCommand = CountTokensCommand; - exports.DocumentFormat = DocumentFormat; - exports.GetAsyncInvokeCommand = GetAsyncInvokeCommand; - exports.GuardrailAction = GuardrailAction; - exports.GuardrailAutomatedReasoningLogicWarningType = GuardrailAutomatedReasoningLogicWarningType; - exports.GuardrailContentFilterConfidence = GuardrailContentFilterConfidence; - exports.GuardrailContentFilterStrength = GuardrailContentFilterStrength; - exports.GuardrailContentFilterType = GuardrailContentFilterType; - exports.GuardrailContentPolicyAction = GuardrailContentPolicyAction; - exports.GuardrailContentQualifier = GuardrailContentQualifier; - exports.GuardrailContentSource = GuardrailContentSource; - exports.GuardrailContextualGroundingFilterType = GuardrailContextualGroundingFilterType; - exports.GuardrailContextualGroundingPolicyAction = GuardrailContextualGroundingPolicyAction; - exports.GuardrailConverseContentQualifier = GuardrailConverseContentQualifier; - exports.GuardrailConverseImageFormat = GuardrailConverseImageFormat; - exports.GuardrailImageFormat = GuardrailImageFormat; - exports.GuardrailManagedWordType = GuardrailManagedWordType; - exports.GuardrailOutputScope = GuardrailOutputScope; - exports.GuardrailPiiEntityType = GuardrailPiiEntityType; - exports.GuardrailSensitiveInformationPolicyAction = GuardrailSensitiveInformationPolicyAction; - exports.GuardrailStreamProcessingMode = GuardrailStreamProcessingMode; - exports.GuardrailTopicPolicyAction = GuardrailTopicPolicyAction; - exports.GuardrailTopicType = GuardrailTopicType; - exports.GuardrailTrace = GuardrailTrace; - exports.GuardrailWordPolicyAction = GuardrailWordPolicyAction; - exports.ImageFormat = ImageFormat; - exports.InternalServerException = InternalServerException$1; - exports.InvokeModelCommand = InvokeModelCommand; - exports.InvokeModelWithBidirectionalStreamCommand = InvokeModelWithBidirectionalStreamCommand; - exports.InvokeModelWithResponseStreamCommand = InvokeModelWithResponseStreamCommand; - exports.ListAsyncInvokesCommand = ListAsyncInvokesCommand; - exports.ModelErrorException = ModelErrorException$1; - exports.ModelNotReadyException = ModelNotReadyException$1; - exports.ModelStreamErrorException = ModelStreamErrorException$1; - exports.ModelTimeoutException = ModelTimeoutException$1; - exports.PerformanceConfigLatency = PerformanceConfigLatency; - exports.ResourceNotFoundException = ResourceNotFoundException$1; - exports.ServiceQuotaExceededException = ServiceQuotaExceededException$1; - exports.ServiceTierType = ServiceTierType; - exports.ServiceUnavailableException = ServiceUnavailableException$1; - exports.SortAsyncInvocationBy = SortAsyncInvocationBy; - exports.SortOrder = SortOrder; - exports.StartAsyncInvokeCommand = StartAsyncInvokeCommand; - exports.StopReason = StopReason; - exports.ThrottlingException = ThrottlingException$1; - exports.ToolResultStatus = ToolResultStatus; - exports.ToolUseType = ToolUseType; - exports.Trace = Trace; - exports.ValidationException = ValidationException$1; - exports.VideoFormat = VideoFormat; - exports.paginateListAsyncInvokes = paginateListAsyncInvokes; +// stub-npm:@aws-sdk/client-bedrock +var exports_client_bedrock = {}; +__export(exports_client_bedrock, { + default: () => client_bedrock_default, + __stub__: () => __stub__ +}); +var handler, stub, client_bedrock_default, __stub__ = true; +var init_client_bedrock = __esm(() => { + handler = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub = new Proxy({}, handler); + client_bedrock_default = stub; +}); + +// stub-npm:@aws-sdk/client-bedrock-runtime +var exports_client_bedrock_runtime = {}; +__export(exports_client_bedrock_runtime, { + default: () => client_bedrock_runtime_default, + __stub__: () => __stub__2 +}); +var handler2, stub2, client_bedrock_runtime_default, __stub__2 = true; +var init_client_bedrock_runtime = __esm(() => { + handler2 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub2 = new Proxy({}, handler2); + client_bedrock_runtime_default = stub2; }); // src/utils/model/bedrock.ts @@ -141716,7 +108247,7 @@ function findFirstMatch(profiles, substring) { return profiles.find((p) => p.includes(substring)) ?? null; } async function createBedrockClient() { - const { BedrockClient } = await Promise.resolve().then(() => __toESM(require_dist_cjs110(), 1)); + const { BedrockClient } = await Promise.resolve().then(() => (init_client_bedrock(), exports_client_bedrock)); const region = getAWSRegion(); const skipAuth = isEnvTruthy(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH); const clientConfig = { @@ -141750,7 +108281,7 @@ async function createBedrockClient() { return new BedrockClient(clientConfig); } async function createBedrockRuntimeClient() { - const { BedrockRuntimeClient } = await Promise.resolve().then(() => __toESM(require_dist_cjs122(), 1)); + const { BedrockRuntimeClient } = await Promise.resolve().then(() => (init_client_bedrock_runtime(), exports_client_bedrock_runtime)); const region = getAWSRegion(); const skipAuth = isEnvTruthy(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH); const clientConfig = { @@ -141818,14 +108349,14 @@ function applyBedrockRegionPrefix(modelId, prefix) { var getBedrockInferenceProfiles, getInferenceProfileBackingModel, BEDROCK_REGION_PREFIXES; var init_bedrock = __esm(() => { init_memoize(); - init_auth2(); + init_auth(); init_envUtils(); init_log3(); init_proxy(); getBedrockInferenceProfiles = memoize_default(async function() { const [client, { ListInferenceProfilesCommand }] = await Promise.all([ createBedrockClient(), - Promise.resolve().then(() => __toESM(require_dist_cjs110(), 1)) + Promise.resolve().then(() => (init_client_bedrock(), exports_client_bedrock)) ]); const allProfiles = []; let nextToken; @@ -141851,7 +108382,7 @@ var init_bedrock = __esm(() => { try { const [client, { GetInferenceProfileCommand }] = await Promise.all([ createBedrockClient(), - Promise.resolve().then(() => __toESM(require_dist_cjs110(), 1)) + Promise.resolve().then(() => (init_client_bedrock(), exports_client_bedrock)) ]); const command = new GetInferenceProfileCommand({ inferenceProfileIdentifier: profileId @@ -142138,7 +108669,7 @@ function hasClaudeAiBillingAccess() { } var mockBillingAccessOverride = null; var init_billing = __esm(() => { - init_auth2(); + init_auth(); init_config2(); init_envUtils(); }); @@ -142272,7 +108803,7 @@ async function getOauthProfileFromOauthToken(accessToken) { var init_getOauthProfile = __esm(() => { init_axios2(); init_oauth(); - init_auth2(); + init_auth(); init_config2(); init_log3(); }); @@ -142618,7 +109149,7 @@ var init_client2 = __esm(() => { init_axios2(); init_analytics(); init_oauth(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_getOauthProfile(); @@ -142792,1274 +109323,17 @@ var init_authPortable = __esm(() => { init_macOsKeychainHelpers(); }); -// ../node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider11 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = undefined; - var core_1 = require_dist_cjs83(); - var util_middleware_1 = require_dist_cjs60(); - var STSClient_1 = require_STSClient3(); - var defaultSTSHttpAuthSchemeParametersProvider = async (config2, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config2.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "sts", - region: authParameters.region - }, - propertiesExtractor: (config2, context) => ({ - signingProperties: { - config: config2, - context - } - }) - }; - } - function createSmithyApiNoAuthHttpAuthOption(authParameters) { - return { - schemeId: "smithy.api#noAuth" - }; - } - var defaultSTSHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - case "AssumeRoleWithSAML": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "AssumeRoleWithWebIdentity": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); - } - } - return options; - }; - exports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider; - var resolveStsAuthConfig = (input) => Object.assign(input, { - stsClientCtor: STSClient_1.STSClient - }); - exports.resolveStsAuthConfig = resolveStsAuthConfig; - var resolveHttpAuthSchemeConfig = (config2) => { - const config_0 = (0, exports.resolveStsAuthConfig)(config2); - const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0); - return Object.assign(config_1, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config2.authSchemePreference ?? []) - }); - }; - exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; +// stub-npm:@aws-sdk/client-sts +var exports_client_sts = {}; +__export(exports_client_sts, { + default: () => client_sts_default, + __stub__: () => __stub__3 }); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js -var require_EndpointParameters3 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.commonParams = exports.resolveClientEndpointParameters = undefined; - var resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - useGlobalEndpoint: options.useGlobalEndpoint ?? false, - defaultSigningName: "sts" - }); - }; - exports.resolveClientEndpointParameters = resolveClientEndpointParameters; - exports.commonParams = { - UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; -}); - -// ../node_modules/@aws-sdk/client-sts/package.json -var require_package6 = __commonJS((exports, module) => { - module.exports = { name: "@aws-sdk/client-sts", main: "dist-cjs/index.js" }; -}); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js -var require_ruleset11 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ruleSet = undefined; - var F = "required"; - var G3 = "type"; - var H2 = "fn"; - var I2 = "argv"; - var J = "ref"; - var a2 = false; - var b = true; - var c5 = "booleanEquals"; - var d = "stringEquals"; - var e = "sigv4"; - var f = "sts"; - var g = "us-east-1"; - var h2 = "endpoint"; - var i2 = "https://sts.{Region}.{PartitionResult#dnsSuffix}"; - var j = "tree"; - var k = "error"; - var l = "getAttr"; - var m = { [F]: false, [G3]: "string" }; - var n2 = { [F]: true, default: false, [G3]: "boolean" }; - var o2 = { [J]: "Endpoint" }; - var p = { [H2]: "isSet", [I2]: [{ [J]: "Region" }] }; - var q = { [J]: "Region" }; - var r = { [H2]: "aws.partition", [I2]: [q], assign: "PartitionResult" }; - var s = { [J]: "UseFIPS" }; - var t = { [J]: "UseDualStack" }; - var u2 = { url: "https://sts.amazonaws.com", properties: { authSchemes: [{ name: e, signingName: f, signingRegion: g }] }, headers: {} }; - var v = {}; - var w = { conditions: [{ [H2]: d, [I2]: [q, "aws-global"] }], [h2]: u2, [G3]: h2 }; - var x2 = { [H2]: c5, [I2]: [s, true] }; - var y2 = { [H2]: c5, [I2]: [t, true] }; - var z2 = { [H2]: l, [I2]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }; - var A = { [J]: "PartitionResult" }; - var B = { [H2]: c5, [I2]: [true, { [H2]: l, [I2]: [A, "supportsDualStack"] }] }; - var C2 = [{ [H2]: "isSet", [I2]: [o2] }]; - var D2 = [x2]; - var E = [y2]; - var _data = { version: "1.0", parameters: { Region: m, UseDualStack: n2, UseFIPS: n2, Endpoint: m, UseGlobalEndpoint: n2 }, rules: [{ conditions: [{ [H2]: c5, [I2]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H2]: "not", [I2]: C2 }, p, r, { [H2]: c5, [I2]: [s, a2] }, { [H2]: c5, [I2]: [t, a2] }], rules: [{ conditions: [{ [H2]: d, [I2]: [q, "ap-northeast-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "ap-south-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "ap-southeast-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "ap-southeast-2"] }], endpoint: u2, [G3]: h2 }, w, { conditions: [{ [H2]: d, [I2]: [q, "ca-central-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-central-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-north-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-west-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-west-2"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "eu-west-3"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "sa-east-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, g] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "us-east-2"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "us-west-1"] }], endpoint: u2, [G3]: h2 }, { conditions: [{ [H2]: d, [I2]: [q, "us-west-2"] }], endpoint: u2, [G3]: h2 }, { endpoint: { url: i2, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G3]: h2 }], [G3]: j }, { conditions: C2, rules: [{ conditions: D2, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G3]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G3]: k }, { endpoint: { url: o2, properties: v, headers: v }, [G3]: h2 }], [G3]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x2, y2], rules: [{ conditions: [{ [H2]: c5, [I2]: [b, z2] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G3]: h2 }], [G3]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G3]: k }], [G3]: j }, { conditions: D2, rules: [{ conditions: [{ [H2]: c5, [I2]: [z2, b] }], rules: [{ conditions: [{ [H2]: d, [I2]: [{ [H2]: l, [I2]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G3]: h2 }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G3]: h2 }], [G3]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G3]: k }], [G3]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G3]: h2 }], [G3]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G3]: k }], [G3]: j }, w, { endpoint: { url: i2, properties: v, headers: v }, [G3]: h2 }], [G3]: j }], [G3]: j }, { error: "Invalid Configuration: Missing Region", [G3]: k }] }; - exports.ruleSet = _data; -}); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js -var require_endpointResolver11 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultEndpointResolver = undefined; - var util_endpoints_1 = require_dist_cjs75(); - var util_endpoints_2 = require_dist_cjs72(); - var ruleset_1 = require_ruleset11(); - var cache2 = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"] - }); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return cache2.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - })); - }; - exports.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -}); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js -var require_runtimeConfig_shared11 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var core_1 = require_dist_cjs83(); - var protocols_1 = require_protocols4(); - var core_2 = require_dist_cjs71(); - var smithy_client_1 = require_dist_cjs81(); - var url_parser_1 = require_dist_cjs74(); - var util_base64_1 = require_dist_cjs65(); - var util_utf8_1 = require_dist_cjs64(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider11(); - var endpointResolver_1 = require_endpointResolver11(); - var getRuntimeConfig = (config2) => { - return { - apiVersion: "2011-06-15", - base64Decoder: config2?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config2?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config2?.disableHostPrefix ?? false, - endpointProvider: config2?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config2?.extensions ?? [], - httpAuthSchemeProvider: config2?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner - } - ], - logger: config2?.logger ?? new smithy_client_1.NoOpLogger, - protocol: config2?.protocol ?? new protocols_1.AwsQueryProtocol({ - defaultNamespace: "com.amazonaws.sts", - xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", - version: "2011-06-15" - }), - serviceId: config2?.serviceId ?? "STS", - urlParser: config2?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config2?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config2?.utf8Encoder ?? util_utf8_1.toUtf8 - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js -var require_runtimeConfig11 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var tslib_1 = require_tslib2(); - var package_json_1 = tslib_1.__importDefault(require_package6()); - var core_1 = require_dist_cjs83(); - var credential_provider_node_1 = require_dist_cjs109(); - var util_user_agent_node_1 = require_dist_cjs97(); - var config_resolver_1 = require_dist_cjs86(); - var core_2 = require_dist_cjs71(); - var hash_node_1 = require_dist_cjs98(); - var middleware_retry_1 = require_dist_cjs93(); - var node_config_provider_1 = require_dist_cjs89(); - var node_http_handler_1 = require_dist_cjs68(); - var util_body_length_node_1 = require_dist_cjs99(); - var util_retry_1 = require_dist_cjs92(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared11(); - var smithy_client_1 = require_dist_cjs81(); - var util_defaults_mode_node_1 = require_dist_cjs100(); - var smithy_client_2 = require_dist_cjs81(); - var getRuntimeConfig = (config2) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config2); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config2?.profile, - logger: clientSharedValues.logger - }; - return { - ...clientSharedValues, - ...config2, - runtime: "node", - defaultsMode, - authSchemePreference: config2?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config2?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - credentialDefaultProvider: config2?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, - defaultUserAgentProvider: config2?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await (0, credential_provider_node_1.defaultProvider)(idProps?.__config || {})()), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner - } - ], - maxAttempts: config2?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config2), - region: config2?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config2?.requestHandler ?? defaultConfigProvider), - retryMode: config2?.retryMode ?? (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }, config2), - sha256: config2?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config2?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config2?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config2?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config2?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js -var require_httpAuthExtensionConfiguration3 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = undefined; - var getHttpAuthExtensionConfiguration = (runtimeConfig) => { - const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; - let _credentials = runtimeConfig.credentials; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); - } - }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider) { - _httpAuthSchemeProvider = httpAuthSchemeProvider; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; - } - }; - }; - exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration; - var resolveHttpAuthRuntimeConfig = (config2) => { - return { - httpAuthSchemes: config2.httpAuthSchemes(), - httpAuthSchemeProvider: config2.httpAuthSchemeProvider(), - credentials: config2.credentials() - }; - }; - exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js -var require_runtimeExtensions3 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveRuntimeExtensions = undefined; - var region_config_resolver_1 = require_dist_cjs101(); - var protocol_http_1 = require_dist_cjs56(); - var smithy_client_1 = require_dist_cjs81(); - var httpAuthExtensionConfiguration_1 = require_httpAuthExtensionConfiguration3(); - var resolveRuntimeExtensions = (runtimeConfig, extensions) => { - const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration)); - }; - exports.resolveRuntimeExtensions = resolveRuntimeExtensions; -}); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js -var require_STSClient3 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.STSClient = exports.__Client = undefined; - var middleware_host_header_1 = require_dist_cjs57(); - var middleware_logger_1 = require_dist_cjs58(); - var middleware_recursion_detection_1 = require_dist_cjs59(); - var middleware_user_agent_1 = require_dist_cjs84(); - var config_resolver_1 = require_dist_cjs86(); - var core_1 = require_dist_cjs71(); - var schema_1 = require_schema2(); - var middleware_content_length_1 = require_dist_cjs87(); - var middleware_endpoint_1 = require_dist_cjs90(); - var middleware_retry_1 = require_dist_cjs93(); - var smithy_client_1 = require_dist_cjs81(); - Object.defineProperty(exports, "__Client", { enumerable: true, get: function() { - return smithy_client_1.Client; - } }); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider11(); - var EndpointParameters_1 = require_EndpointParameters3(); - var runtimeConfig_1 = require_runtimeConfig11(); - var runtimeExtensions_1 = require_runtimeExtensions3(); - - class STSClient extends smithy_client_1.Client { - config; - constructor(...[configuration]) { - const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); - const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1); - const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2); - const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3); - const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5); - const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6); - const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []); - this.config = _config_8; - this.middlewareStack.use((0, schema_1.getSchemaSerdePlugin)(this.config)); - this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); - this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); - this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); - this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); - this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); - this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config2) => new core_1.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config2.credentials - }) - })); - this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config)); - } - destroy() { - super.destroy(); - } - } - exports.STSClient = STSClient; -}); - -// ../node_modules/@aws-sdk/client-sts/dist-cjs/index.js -var require_dist_cjs123 = __commonJS((exports) => { - var STSClient = require_STSClient3(); - var smithyClient = require_dist_cjs81(); - var middlewareEndpoint = require_dist_cjs90(); - var EndpointParameters = require_EndpointParameters3(); - var schema = require_schema2(); - var client = require_client3(); - var regionConfigResolver = require_dist_cjs101(); - var STSServiceException$1 = class STSServiceException2 extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, STSServiceException2.prototype); - } - }; - var ExpiredTokenException$1 = class ExpiredTokenException2 extends STSServiceException$1 { - name = "ExpiredTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ExpiredTokenException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ExpiredTokenException2.prototype); - } - }; - var MalformedPolicyDocumentException$1 = class MalformedPolicyDocumentException2 extends STSServiceException$1 { - name = "MalformedPolicyDocumentException"; - $fault = "client"; - constructor(opts) { - super({ - name: "MalformedPolicyDocumentException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, MalformedPolicyDocumentException2.prototype); - } - }; - var PackedPolicyTooLargeException$1 = class PackedPolicyTooLargeException2 extends STSServiceException$1 { - name = "PackedPolicyTooLargeException"; - $fault = "client"; - constructor(opts) { - super({ - name: "PackedPolicyTooLargeException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, PackedPolicyTooLargeException2.prototype); - } - }; - var RegionDisabledException$1 = class RegionDisabledException2 extends STSServiceException$1 { - name = "RegionDisabledException"; - $fault = "client"; - constructor(opts) { - super({ - name: "RegionDisabledException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, RegionDisabledException2.prototype); - } - }; - var IDPRejectedClaimException$1 = class IDPRejectedClaimException2 extends STSServiceException$1 { - name = "IDPRejectedClaimException"; - $fault = "client"; - constructor(opts) { - super({ - name: "IDPRejectedClaimException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, IDPRejectedClaimException2.prototype); - } - }; - var InvalidIdentityTokenException$1 = class InvalidIdentityTokenException2 extends STSServiceException$1 { - name = "InvalidIdentityTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidIdentityTokenException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidIdentityTokenException2.prototype); - } - }; - var IDPCommunicationErrorException$1 = class IDPCommunicationErrorException2 extends STSServiceException$1 { - name = "IDPCommunicationErrorException"; - $fault = "client"; - constructor(opts) { - super({ - name: "IDPCommunicationErrorException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, IDPCommunicationErrorException2.prototype); - } - }; - var InvalidAuthorizationMessageException$1 = class InvalidAuthorizationMessageException2 extends STSServiceException$1 { - name = "InvalidAuthorizationMessageException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidAuthorizationMessageException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidAuthorizationMessageException2.prototype); - } - }; - var ExpiredTradeInTokenException$1 = class ExpiredTradeInTokenException2 extends STSServiceException$1 { - name = "ExpiredTradeInTokenException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ExpiredTradeInTokenException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ExpiredTradeInTokenException2.prototype); - } - }; - var JWTPayloadSizeExceededException$1 = class JWTPayloadSizeExceededException2 extends STSServiceException$1 { - name = "JWTPayloadSizeExceededException"; - $fault = "client"; - constructor(opts) { - super({ - name: "JWTPayloadSizeExceededException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, JWTPayloadSizeExceededException2.prototype); - } - }; - var OutboundWebIdentityFederationDisabledException$1 = class OutboundWebIdentityFederationDisabledException2 extends STSServiceException$1 { - name = "OutboundWebIdentityFederationDisabledException"; - $fault = "client"; - constructor(opts) { - super({ - name: "OutboundWebIdentityFederationDisabledException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, OutboundWebIdentityFederationDisabledException2.prototype); - } - }; - var SessionDurationEscalationException$1 = class SessionDurationEscalationException2 extends STSServiceException$1 { - name = "SessionDurationEscalationException"; - $fault = "client"; - constructor(opts) { - super({ - name: "SessionDurationEscalationException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, SessionDurationEscalationException2.prototype); - } - }; - var _A = "Arn"; - var _AKI = "AccessKeyId"; - var _AP = "AssumedPrincipal"; - var _AR = "AssumeRole"; - var _ARI = "AssumedRoleId"; - var _ARR = "AssumeRoleRequest"; - var _ARRs = "AssumeRoleResponse"; - var _ARRss = "AssumeRootRequest"; - var _ARRssu = "AssumeRootResponse"; - var _ARU = "AssumedRoleUser"; - var _ARWSAML = "AssumeRoleWithSAML"; - var _ARWSAMLR = "AssumeRoleWithSAMLRequest"; - var _ARWSAMLRs = "AssumeRoleWithSAMLResponse"; - var _ARWWI = "AssumeRoleWithWebIdentity"; - var _ARWWIR = "AssumeRoleWithWebIdentityRequest"; - var _ARWWIRs = "AssumeRoleWithWebIdentityResponse"; - var _ARs = "AssumeRoot"; - var _Ac = "Account"; - var _Au = "Audience"; - var _C = "Credentials"; - var _CA = "ContextAssertion"; - var _DAM = "DecodeAuthorizationMessage"; - var _DAMR = "DecodeAuthorizationMessageRequest"; - var _DAMRe = "DecodeAuthorizationMessageResponse"; - var _DM = "DecodedMessage"; - var _DS = "DurationSeconds"; - var _E = "Expiration"; - var _EI = "ExternalId"; - var _EM = "EncodedMessage"; - var _ETE = "ExpiredTokenException"; - var _ETITE = "ExpiredTradeInTokenException"; - var _FU = "FederatedUser"; - var _FUI = "FederatedUserId"; - var _GAKI = "GetAccessKeyInfo"; - var _GAKIR = "GetAccessKeyInfoRequest"; - var _GAKIRe = "GetAccessKeyInfoResponse"; - var _GCI = "GetCallerIdentity"; - var _GCIR = "GetCallerIdentityRequest"; - var _GCIRe = "GetCallerIdentityResponse"; - var _GDAT = "GetDelegatedAccessToken"; - var _GDATR = "GetDelegatedAccessTokenRequest"; - var _GDATRe = "GetDelegatedAccessTokenResponse"; - var _GFT = "GetFederationToken"; - var _GFTR = "GetFederationTokenRequest"; - var _GFTRe = "GetFederationTokenResponse"; - var _GST = "GetSessionToken"; - var _GSTR = "GetSessionTokenRequest"; - var _GSTRe = "GetSessionTokenResponse"; - var _GWIT = "GetWebIdentityToken"; - var _GWITR = "GetWebIdentityTokenRequest"; - var _GWITRe = "GetWebIdentityTokenResponse"; - var _I = "Issuer"; - var _IAME = "InvalidAuthorizationMessageException"; - var _IDPCEE = "IDPCommunicationErrorException"; - var _IDPRCE = "IDPRejectedClaimException"; - var _IITE = "InvalidIdentityTokenException"; - var _JWTPSEE = "JWTPayloadSizeExceededException"; - var _K = "Key"; - var _MPDE = "MalformedPolicyDocumentException"; - var _N = "Name"; - var _NQ = "NameQualifier"; - var _OWIFDE = "OutboundWebIdentityFederationDisabledException"; - var _P = "Policy"; - var _PA = "PolicyArns"; - var _PAr = "PrincipalArn"; - var _PAro = "ProviderArn"; - var _PC = "ProvidedContexts"; - var _PCLT = "ProvidedContextsListType"; - var _PCr = "ProvidedContext"; - var _PDT = "PolicyDescriptorType"; - var _PI = "ProviderId"; - var _PPS = "PackedPolicySize"; - var _PPTLE = "PackedPolicyTooLargeException"; - var _Pr = "Provider"; - var _RA = "RoleArn"; - var _RDE = "RegionDisabledException"; - var _RSN = "RoleSessionName"; - var _S = "Subject"; - var _SA = "SigningAlgorithm"; - var _SAK = "SecretAccessKey"; - var _SAMLA = "SAMLAssertion"; - var _SAMLAT = "SAMLAssertionType"; - var _SDEE = "SessionDurationEscalationException"; - var _SFWIT = "SubjectFromWebIdentityToken"; - var _SI = "SourceIdentity"; - var _SN = "SerialNumber"; - var _ST = "SubjectType"; - var _STe = "SessionToken"; - var _T = "Tags"; - var _TC = "TokenCode"; - var _TIT = "TradeInToken"; - var _TP = "TargetPrincipal"; - var _TPA = "TaskPolicyArn"; - var _TTK = "TransitiveTagKeys"; - var _Ta = "Tag"; - var _UI = "UserId"; - var _V = "Value"; - var _WIT = "WebIdentityToken"; - var _a2 = "arn"; - var _aKST = "accessKeySecretType"; - var _aQE = "awsQueryError"; - var _c = "client"; - var _cTT = "clientTokenType"; - var _e = "error"; - var _hE = "httpError"; - var _m = "message"; - var _pDLT = "policyDescriptorListType"; - var _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; - var _tITT = "tradeInTokenType"; - var _tLT = "tagListType"; - var _wITT = "webIdentityTokenType"; - var n0 = "com.amazonaws.sts"; - var accessKeySecretType = [0, n0, _aKST, 8, 0]; - var clientTokenType = [0, n0, _cTT, 8, 0]; - var SAMLAssertionType = [0, n0, _SAMLAT, 8, 0]; - var tradeInTokenType = [0, n0, _tITT, 8, 0]; - var webIdentityTokenType = [0, n0, _wITT, 8, 0]; - var AssumedRoleUser = [3, n0, _ARU, 0, [_ARI, _A], [0, 0]]; - var AssumeRoleRequest = [ - 3, - n0, - _ARR, - 0, - [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC], - [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType] - ]; - var AssumeRoleResponse = [ - 3, - n0, - _ARRs, - 0, - [_C, _ARU, _PPS, _SI], - [[() => Credentials, 0], () => AssumedRoleUser, 1, 0] - ]; - var AssumeRoleWithSAMLRequest = [ - 3, - n0, - _ARWSAMLR, - 0, - [_RA, _PAr, _SAMLA, _PA, _P, _DS], - [0, 0, [() => SAMLAssertionType, 0], () => policyDescriptorListType, 0, 1] - ]; - var AssumeRoleWithSAMLResponse = [ - 3, - n0, - _ARWSAMLRs, - 0, - [_C, _ARU, _PPS, _S, _ST, _I, _Au, _NQ, _SI], - [[() => Credentials, 0], () => AssumedRoleUser, 1, 0, 0, 0, 0, 0, 0] - ]; - var AssumeRoleWithWebIdentityRequest = [ - 3, - n0, - _ARWWIR, - 0, - [_RA, _RSN, _WIT, _PI, _PA, _P, _DS], - [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1] - ]; - var AssumeRoleWithWebIdentityResponse = [ - 3, - n0, - _ARWWIRs, - 0, - [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI], - [[() => Credentials, 0], 0, () => AssumedRoleUser, 1, 0, 0, 0] - ]; - var AssumeRootRequest = [ - 3, - n0, - _ARRss, - 0, - [_TP, _TPA, _DS], - [0, () => PolicyDescriptorType, 1] - ]; - var AssumeRootResponse = [3, n0, _ARRssu, 0, [_C, _SI], [[() => Credentials, 0], 0]]; - var Credentials = [ - 3, - n0, - _C, - 0, - [_AKI, _SAK, _STe, _E], - [0, [() => accessKeySecretType, 0], 0, 4] - ]; - var DecodeAuthorizationMessageRequest = [3, n0, _DAMR, 0, [_EM], [0]]; - var DecodeAuthorizationMessageResponse = [3, n0, _DAMRe, 0, [_DM], [0]]; - var ExpiredTokenException = [ - -3, - n0, - _ETE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ExpiredTokenException`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1); - var ExpiredTradeInTokenException = [ - -3, - n0, - _ETITE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`ExpiredTradeInTokenException`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ExpiredTradeInTokenException, ExpiredTradeInTokenException$1); - var FederatedUser = [3, n0, _FU, 0, [_FUI, _A], [0, 0]]; - var GetAccessKeyInfoRequest = [3, n0, _GAKIR, 0, [_AKI], [0]]; - var GetAccessKeyInfoResponse = [3, n0, _GAKIRe, 0, [_Ac], [0]]; - var GetCallerIdentityRequest = [3, n0, _GCIR, 0, [], []]; - var GetCallerIdentityResponse = [3, n0, _GCIRe, 0, [_UI, _Ac, _A], [0, 0, 0]]; - var GetDelegatedAccessTokenRequest = [ - 3, - n0, - _GDATR, - 0, - [_TIT], - [[() => tradeInTokenType, 0]] - ]; - var GetDelegatedAccessTokenResponse = [ - 3, - n0, - _GDATRe, - 0, - [_C, _PPS, _AP], - [[() => Credentials, 0], 1, 0] - ]; - var GetFederationTokenRequest = [ - 3, - n0, - _GFTR, - 0, - [_N, _P, _PA, _DS, _T], - [0, 0, () => policyDescriptorListType, 1, () => tagListType] - ]; - var GetFederationTokenResponse = [ - 3, - n0, - _GFTRe, - 0, - [_C, _FU, _PPS], - [[() => Credentials, 0], () => FederatedUser, 1] - ]; - var GetSessionTokenRequest = [3, n0, _GSTR, 0, [_DS, _SN, _TC], [1, 0, 0]]; - var GetSessionTokenResponse = [3, n0, _GSTRe, 0, [_C], [[() => Credentials, 0]]]; - var GetWebIdentityTokenRequest = [ - 3, - n0, - _GWITR, - 0, - [_Au, _DS, _SA, _T], - [64 | 0, 1, 0, () => tagListType] - ]; - var GetWebIdentityTokenResponse = [ - 3, - n0, - _GWITRe, - 0, - [_WIT, _E], - [[() => webIdentityTokenType, 0], 4] - ]; - var IDPCommunicationErrorException = [ - -3, - n0, - _IDPCEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`IDPCommunicationError`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(IDPCommunicationErrorException, IDPCommunicationErrorException$1); - var IDPRejectedClaimException = [ - -3, - n0, - _IDPRCE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`IDPRejectedClaim`, 403] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(IDPRejectedClaimException, IDPRejectedClaimException$1); - var InvalidAuthorizationMessageException = [ - -3, - n0, - _IAME, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InvalidAuthorizationMessageException`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidAuthorizationMessageException, InvalidAuthorizationMessageException$1); - var InvalidIdentityTokenException = [ - -3, - n0, - _IITE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`InvalidIdentityToken`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidIdentityTokenException, InvalidIdentityTokenException$1); - var JWTPayloadSizeExceededException = [ - -3, - n0, - _JWTPSEE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`JWTPayloadSizeExceededException`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(JWTPayloadSizeExceededException, JWTPayloadSizeExceededException$1); - var MalformedPolicyDocumentException = [ - -3, - n0, - _MPDE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`MalformedPolicyDocument`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(MalformedPolicyDocumentException, MalformedPolicyDocumentException$1); - var OutboundWebIdentityFederationDisabledException = [ - -3, - n0, - _OWIFDE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`OutboundWebIdentityFederationDisabledException`, 403] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(OutboundWebIdentityFederationDisabledException, OutboundWebIdentityFederationDisabledException$1); - var PackedPolicyTooLargeException = [ - -3, - n0, - _PPTLE, - { - [_e]: _c, - [_hE]: 400, - [_aQE]: [`PackedPolicyTooLarge`, 400] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(PackedPolicyTooLargeException, PackedPolicyTooLargeException$1); - var PolicyDescriptorType = [3, n0, _PDT, 0, [_a2], [0]]; - var ProvidedContext = [3, n0, _PCr, 0, [_PAro, _CA], [0, 0]]; - var RegionDisabledException = [ - -3, - n0, - _RDE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`RegionDisabledException`, 403] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(RegionDisabledException, RegionDisabledException$1); - var SessionDurationEscalationException = [ - -3, - n0, - _SDEE, - { - [_e]: _c, - [_hE]: 403, - [_aQE]: [`SessionDurationEscalationException`, 403] - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(SessionDurationEscalationException, SessionDurationEscalationException$1); - var Tag = [3, n0, _Ta, 0, [_K, _V], [0, 0]]; - var STSServiceException = [-3, _s, "STSServiceException", 0, [], []]; - schema.TypeRegistry.for(_s).registerError(STSServiceException, STSServiceException$1); - var policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType]; - var ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext]; - var tagListType = [1, n0, _tLT, 0, () => Tag]; - var AssumeRole = [9, n0, _AR, 0, () => AssumeRoleRequest, () => AssumeRoleResponse]; - var AssumeRoleWithSAML = [ - 9, - n0, - _ARWSAML, - 0, - () => AssumeRoleWithSAMLRequest, - () => AssumeRoleWithSAMLResponse - ]; - var AssumeRoleWithWebIdentity = [ - 9, - n0, - _ARWWI, - 0, - () => AssumeRoleWithWebIdentityRequest, - () => AssumeRoleWithWebIdentityResponse - ]; - var AssumeRoot = [9, n0, _ARs, 0, () => AssumeRootRequest, () => AssumeRootResponse]; - var DecodeAuthorizationMessage = [ - 9, - n0, - _DAM, - 0, - () => DecodeAuthorizationMessageRequest, - () => DecodeAuthorizationMessageResponse - ]; - var GetAccessKeyInfo = [ - 9, - n0, - _GAKI, - 0, - () => GetAccessKeyInfoRequest, - () => GetAccessKeyInfoResponse - ]; - var GetCallerIdentity = [ - 9, - n0, - _GCI, - 0, - () => GetCallerIdentityRequest, - () => GetCallerIdentityResponse - ]; - var GetDelegatedAccessToken = [ - 9, - n0, - _GDAT, - 0, - () => GetDelegatedAccessTokenRequest, - () => GetDelegatedAccessTokenResponse - ]; - var GetFederationToken = [ - 9, - n0, - _GFT, - 0, - () => GetFederationTokenRequest, - () => GetFederationTokenResponse - ]; - var GetSessionToken = [ - 9, - n0, - _GST, - 0, - () => GetSessionTokenRequest, - () => GetSessionTokenResponse - ]; - var GetWebIdentityToken = [ - 9, - n0, - _GWIT, - 0, - () => GetWebIdentityTokenRequest, - () => GetWebIdentityTokenResponse - ]; - - class AssumeRoleCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole).build() { - } - - class AssumeRoleWithSAMLCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").sc(AssumeRoleWithSAML).build() { - } - - class AssumeRoleWithWebIdentityCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity).build() { - } - - class AssumeRootCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "AssumeRoot", {}).n("STSClient", "AssumeRootCommand").sc(AssumeRoot).build() { - } - - class DecodeAuthorizationMessageCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").sc(DecodeAuthorizationMessage).build() { - } - - class GetAccessKeyInfoCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").sc(GetAccessKeyInfo).build() { - } - - class GetCallerIdentityCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").sc(GetCallerIdentity).build() { - } - - class GetDelegatedAccessTokenCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "GetDelegatedAccessToken", {}).n("STSClient", "GetDelegatedAccessTokenCommand").sc(GetDelegatedAccessToken).build() { - } - - class GetFederationTokenCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").sc(GetFederationToken).build() { - } - - class GetSessionTokenCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").sc(GetSessionToken).build() { - } - - class GetWebIdentityTokenCommand extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSSecurityTokenServiceV20110615", "GetWebIdentityToken", {}).n("STSClient", "GetWebIdentityTokenCommand").sc(GetWebIdentityToken).build() { - } - var commands = { - AssumeRoleCommand, - AssumeRoleWithSAMLCommand, - AssumeRoleWithWebIdentityCommand, - AssumeRootCommand, - DecodeAuthorizationMessageCommand, - GetAccessKeyInfoCommand, - GetCallerIdentityCommand, - GetDelegatedAccessTokenCommand, - GetFederationTokenCommand, - GetSessionTokenCommand, - GetWebIdentityTokenCommand - }; - - class STS extends STSClient.STSClient { - } - smithyClient.createAggregatedClient(commands, STS); - var getAccountIdFromAssumedRoleUser = (assumedRoleUser) => { - if (typeof assumedRoleUser?.Arn === "string") { - const arnComponents = assumedRoleUser.Arn.split(":"); - if (arnComponents.length > 4 && arnComponents[4] !== "") { - return arnComponents[4]; - } - } - return; - }; - var resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => { - const region = typeof _region === "function" ? await _region() : _region; - const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; - const stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)(); - credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`); - return region ?? parentRegion ?? stsDefaultRegion; - }; - var getDefaultRoleAssumer$1 = (stsOptions, STSClient2) => { - let stsClient; - let closureSourceCreds; - return async (sourceCreds, params) => { - closureSourceCreds = sourceCreds; - if (!stsClient) { - const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; - const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { - logger, - profile - }); - const isCompatibleRequestHandler = !isH2(requestHandler); - stsClient = new STSClient2({ - ...stsOptions, - userAgentAppId, - profile, - credentialDefaultProvider: () => async () => closureSourceCreds, - region: resolvedRegion, - requestHandler: isCompatibleRequestHandler ? requestHandler : undefined, - logger - }); - } - const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params)); - if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) { - throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); - } - const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2); - const credentials = { - accessKeyId: Credentials2.AccessKeyId, - secretAccessKey: Credentials2.SecretAccessKey, - sessionToken: Credentials2.SessionToken, - expiration: Credentials2.Expiration, - ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope }, - ...accountId && { accountId } - }; - client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i"); - return credentials; - }; - }; - var getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient2) => { - let stsClient; - return async (params) => { - if (!stsClient) { - const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; - const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { - logger, - profile - }); - const isCompatibleRequestHandler = !isH2(requestHandler); - stsClient = new STSClient2({ - ...stsOptions, - userAgentAppId, - profile, - region: resolvedRegion, - requestHandler: isCompatibleRequestHandler ? requestHandler : undefined, - logger - }); - } - const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params)); - if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) { - throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); - } - const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2); - const credentials = { - accessKeyId: Credentials2.AccessKeyId, - secretAccessKey: Credentials2.SecretAccessKey, - sessionToken: Credentials2.SessionToken, - expiration: Credentials2.Expiration, - ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope }, - ...accountId && { accountId } - }; - if (accountId) { - client.setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T"); - } - client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k"); - return credentials; - }; - }; - var isH2 = (requestHandler) => { - return requestHandler?.metadata?.handlerProtocol === "h2"; - }; - var getCustomizableStsClientCtor = (baseCtor, customizations) => { - if (!customizations) - return baseCtor; - else - return class CustomizableSTSClient extends baseCtor { - constructor(config2) { - super(config2); - for (const customization of customizations) { - this.middlewareStack.use(customization); - } - } - }; - }; - var getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins)); - var getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins)); - var decorateDefaultCredentialProvider = (provider) => (input) => provider({ - roleAssumer: getDefaultRoleAssumer(input), - roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input), - ...input - }); - Object.defineProperty(exports, "$Command", { - enumerable: true, - get: function() { - return smithyClient.Command; - } - }); - exports.AssumeRoleCommand = AssumeRoleCommand; - exports.AssumeRoleWithSAMLCommand = AssumeRoleWithSAMLCommand; - exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand; - exports.AssumeRootCommand = AssumeRootCommand; - exports.DecodeAuthorizationMessageCommand = DecodeAuthorizationMessageCommand; - exports.ExpiredTokenException = ExpiredTokenException$1; - exports.ExpiredTradeInTokenException = ExpiredTradeInTokenException$1; - exports.GetAccessKeyInfoCommand = GetAccessKeyInfoCommand; - exports.GetCallerIdentityCommand = GetCallerIdentityCommand; - exports.GetDelegatedAccessTokenCommand = GetDelegatedAccessTokenCommand; - exports.GetFederationTokenCommand = GetFederationTokenCommand; - exports.GetSessionTokenCommand = GetSessionTokenCommand; - exports.GetWebIdentityTokenCommand = GetWebIdentityTokenCommand; - exports.IDPCommunicationErrorException = IDPCommunicationErrorException$1; - exports.IDPRejectedClaimException = IDPRejectedClaimException$1; - exports.InvalidAuthorizationMessageException = InvalidAuthorizationMessageException$1; - exports.InvalidIdentityTokenException = InvalidIdentityTokenException$1; - exports.JWTPayloadSizeExceededException = JWTPayloadSizeExceededException$1; - exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException$1; - exports.OutboundWebIdentityFederationDisabledException = OutboundWebIdentityFederationDisabledException$1; - exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException$1; - exports.RegionDisabledException = RegionDisabledException$1; - exports.STS = STS; - exports.STSServiceException = STSServiceException$1; - exports.SessionDurationEscalationException = SessionDurationEscalationException$1; - exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; - exports.getDefaultRoleAssumer = getDefaultRoleAssumer; - exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; - Object.keys(STSClient).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) - Object.defineProperty(exports, k, { - enumerable: true, - get: function() { - return STSClient[k]; - } - }); - }); +var handler3, stub3, client_sts_default, __stub__3 = true; +var init_client_sts = __esm(() => { + handler3 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub3 = new Proxy({}, handler3); + client_sts_default = stub3; }); // node_modules/@aws-sdk/credential-providers/dist-cjs/createCredentialChain.js @@ -144110,7 +109384,7 @@ var require_createCredentialChain = __commonJS((exports) => { }); // node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider12 = __commonJS((exports) => { +var require_httpAuthSchemeProvider5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveHttpAuthSchemeConfig = exports.defaultCognitoIdentityHttpAuthSchemeProvider = exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = undefined; var httpAuthSchemes_1 = require_httpAuthSchemes(); @@ -144172,7 +109446,7 @@ var require_httpAuthSchemeProvider12 = __commonJS((exports) => { }); // node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/endpoint/ruleset.js -var require_ruleset12 = __commonJS((exports) => { +var require_ruleset5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ruleSet = undefined; var w = "required"; @@ -144345,12 +109619,12 @@ var require_ruleset12 = __commonJS((exports) => { }); // node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/endpoint/endpointResolver.js -var require_endpointResolver12 = __commonJS((exports) => { +var require_endpointResolver5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultEndpointResolver = undefined; var util_endpoints_1 = require_dist_cjs31(); var util_endpoints_2 = require_dist_cjs30(); - var ruleset_1 = require_ruleset12(); + var ruleset_1 = require_ruleset5(); var cache2 = new util_endpoints_2.EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] @@ -144630,7 +109904,7 @@ var require_schemas_05 = __commonJS((exports) => { }); // node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.shared.js -var require_runtimeConfig_shared12 = __commonJS((exports) => { +var require_runtimeConfig_shared5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getRuntimeConfig = undefined; var httpAuthSchemes_1 = require_httpAuthSchemes(); @@ -144640,8 +109914,8 @@ var require_runtimeConfig_shared12 = __commonJS((exports) => { var url_parser_1 = require_dist_cjs11(); var util_base64_1 = require_dist_cjs17(); var util_utf8_1 = require_dist_cjs16(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider12(); - var endpointResolver_1 = require_endpointResolver12(); + var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider5(); + var endpointResolver_1 = require_endpointResolver5(); var schemas_0_1 = require_schemas_05(); var getRuntimeConfig = (config2) => { return { @@ -144683,7 +109957,7 @@ var require_runtimeConfig_shared12 = __commonJS((exports) => { }); // node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.js -var require_runtimeConfig12 = __commonJS((exports) => { +var require_runtimeConfig5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getRuntimeConfig = undefined; var tslib_1 = require_tslib(); @@ -144700,7 +109974,7 @@ var require_runtimeConfig12 = __commonJS((exports) => { var util_body_length_node_1 = require_dist_cjs43(); var util_defaults_mode_node_1 = require_dist_cjs44(); var util_retry_1 = require_dist_cjs33(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared12(); + var runtimeConfig_shared_1 = require_runtimeConfig_shared5(); var getRuntimeConfig = (config2) => { (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); @@ -144749,8 +110023,8 @@ var require_cognito_identity = __commonJS((exports) => { var middlewareEndpoint = require_dist_cjs39(); var middlewareRetry = require_dist_cjs40(); var smithyClient = require_dist_cjs23(); - var httpAuthSchemeProvider = require_httpAuthSchemeProvider12(); - var runtimeConfig = require_runtimeConfig12(); + var httpAuthSchemeProvider = require_httpAuthSchemeProvider5(); + var runtimeConfig = require_runtimeConfig5(); var regionConfigResolver = require_dist_cjs47(); var protocolHttp = require_dist_cjs2(); var schemas_0 = require_schemas_05(); @@ -144898,7 +110172,7 @@ var require_loadCognitoIdentity_C_kPrLZ4 = __commonJS((exports) => { }); // node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js -var require_dist_cjs124 = __commonJS((exports) => { +var require_dist_cjs55 = __commonJS((exports) => { var propertyProvider = require_dist_cjs6(); function resolveLogins(logins) { return Promise.all(Object.keys(logins).reduce((arr, name) => { @@ -145097,7 +110371,7 @@ var require_dist_cjs124 = __commonJS((exports) => { var require_fromCognitoIdentity = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.fromCognitoIdentity = undefined; - var credential_provider_cognito_identity_1 = require_dist_cjs124(); + var credential_provider_cognito_identity_1 = require_dist_cjs55(); var fromCognitoIdentity = (options) => (0, credential_provider_cognito_identity_1.fromCognitoIdentity)({ ...options }); @@ -145108,7 +110382,7 @@ var require_fromCognitoIdentity = __commonJS((exports) => { var require_fromCognitoIdentityPool = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.fromCognitoIdentityPool = undefined; - var credential_provider_cognito_identity_1 = require_dist_cjs124(); + var credential_provider_cognito_identity_1 = require_dist_cjs55(); var fromCognitoIdentityPool = (options) => (0, credential_provider_cognito_identity_1.fromCognitoIdentityPool)({ ...options }); @@ -145399,7 +110673,7 @@ var require_fromTemporaryCredentials = __commonJS((exports) => { }); // node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js -var require_fromTokenFile3 = __commonJS((exports) => { +var require_fromTokenFile2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.fromTokenFile = undefined; var credential_provider_web_identity_1 = require_dist_cjs52(); @@ -145410,7 +110684,7 @@ var require_fromTokenFile3 = __commonJS((exports) => { }); // node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js -var require_fromWebToken3 = __commonJS((exports) => { +var require_fromWebToken2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.fromWebToken = undefined; var credential_provider_web_identity_1 = require_dist_cjs52(); @@ -145421,7 +110695,7 @@ var require_fromWebToken3 = __commonJS((exports) => { }); // node_modules/@aws-sdk/credential-providers/dist-cjs/index.js -var require_dist_cjs125 = __commonJS((exports) => { +var require_dist_cjs56 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.fromHttp = undefined; var tslib_1 = require_tslib(); @@ -145441,8 +110715,8 @@ var require_dist_cjs125 = __commonJS((exports) => { tslib_1.__exportStar(require_fromProcess(), exports); tslib_1.__exportStar(require_fromSSO(), exports); tslib_1.__exportStar(require_fromTemporaryCredentials(), exports); - tslib_1.__exportStar(require_fromTokenFile3(), exports); - tslib_1.__exportStar(require_fromWebToken3(), exports); + tslib_1.__exportStar(require_fromTokenFile2(), exports); + tslib_1.__exportStar(require_fromWebToken2(), exports); }); // src/utils/aws.ts @@ -145461,13 +110735,13 @@ function isValidAwsStsOutput(obj) { return typeof credentials.AccessKeyId === "string" && typeof credentials.SecretAccessKey === "string" && typeof credentials.SessionToken === "string" && credentials.AccessKeyId.length > 0 && credentials.SecretAccessKey.length > 0 && credentials.SessionToken.length > 0; } async function checkStsCallerIdentity() { - const { STSClient, GetCallerIdentityCommand } = await Promise.resolve().then(() => __toESM(require_dist_cjs123(), 1)); + const { STSClient, GetCallerIdentityCommand } = await Promise.resolve().then(() => (init_client_sts(), exports_client_sts)); await new STSClient().send(new GetCallerIdentityCommand({})); } async function clearAwsIniCache() { try { logForDebugging("Clearing AWS credential provider cache"); - const { fromIni } = await Promise.resolve().then(() => __toESM(require_dist_cjs125(), 1)); + const { fromIni } = await Promise.resolve().then(() => __toESM(require_dist_cjs56(), 1)); const iniProvider = fromIni({ ignoreCache: true }); await iniProvider(); logForDebugging("AWS credential provider cache refreshed"); @@ -145867,7 +111141,7 @@ var init_fastMode = __esm(() => { init_growthbook(); init_state(); init_analytics(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_envUtils(); @@ -146502,7 +111776,7 @@ function normalizeModelStringForAPI(model) { var LEGACY_OPUS_FIRSTPARTY; var init_model = __esm(() => { init_state(); - init_auth2(); + init_auth(); init_context(); init_envUtils(); init_modelStrings(); @@ -146521,6451 +111795,65 @@ var init_model = __esm(() => { ]; }); -// ../node_modules/@anthropic-ai/sdk/internal/tslib.mjs -function __classPrivateFieldSet2(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; -} -function __classPrivateFieldGet2(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} -var init_tslib2 = () => {}; - -// ../node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs -var uuid43 = function() { - const { crypto: crypto3 } = globalThis; - if (crypto3?.randomUUID) { - uuid43 = crypto3.randomUUID.bind(crypto3); - return crypto3.randomUUID(); - } - const u8 = new Uint8Array(1); - const randomByte = crypto3 ? () => crypto3.getRandomValues(u8)[0] : () => Math.random() * 255 & 255; - return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c5) => (+c5 ^ randomByte() & 15 >> +c5 / 4).toString(16)); -}; - -// ../node_modules/@anthropic-ai/sdk/internal/errors.mjs -function isAbortError4(err) { - return typeof err === "object" && err !== null && (("name" in err) && err.name === "AbortError" || ("message" in err) && String(err.message).includes("FetchRequestCanceledException")); -} -var castToError2 = (err) => { - if (err instanceof Error) - return err; - if (typeof err === "object" && err !== null) { - try { - if (Object.prototype.toString.call(err) === "[object Error]") { - const error41 = new Error(err.message, err.cause ? { cause: err.cause } : {}); - if (err.stack) - error41.stack = err.stack; - if (err.cause && !error41.cause) - error41.cause = err.cause; - if (err.name) - error41.name = err.name; - return error41; - } - } catch {} - try { - return new Error(JSON.stringify(err)); - } catch {} - } - return new Error(err); -}; - -// ../node_modules/@anthropic-ai/sdk/core/error.mjs -var AnthropicError2, APIError2, APIUserAbortError2, APIConnectionError2, APIConnectionTimeoutError2, BadRequestError2, AuthenticationError2, PermissionDeniedError2, NotFoundError2, ConflictError2, UnprocessableEntityError2, RateLimitError2, InternalServerError2; -var init_error4 = __esm(() => { - AnthropicError2 = class AnthropicError2 extends Error { - }; - APIError2 = class APIError2 extends AnthropicError2 { - constructor(status, error41, message, headers) { - super(`${APIError2.makeMessage(status, error41, message)}`); - this.status = status; - this.headers = headers; - this.requestID = headers?.get("request-id"); - this.error = error41; - } - static makeMessage(status, error41, message) { - const msg = error41?.message ? typeof error41.message === "string" ? error41.message : JSON.stringify(error41.message) : error41 ? JSON.stringify(error41) : 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 APIConnectionError2({ message, cause: castToError2(errorResponse) }); - } - const error41 = errorResponse; - if (status === 400) { - return new BadRequestError2(status, error41, message, headers); - } - if (status === 401) { - return new AuthenticationError2(status, error41, message, headers); - } - if (status === 403) { - return new PermissionDeniedError2(status, error41, message, headers); - } - if (status === 404) { - return new NotFoundError2(status, error41, message, headers); - } - if (status === 409) { - return new ConflictError2(status, error41, message, headers); - } - if (status === 422) { - return new UnprocessableEntityError2(status, error41, message, headers); - } - if (status === 429) { - return new RateLimitError2(status, error41, message, headers); - } - if (status >= 500) { - return new InternalServerError2(status, error41, message, headers); - } - return new APIError2(status, error41, message, headers); - } - }; - APIUserAbortError2 = class APIUserAbortError2 extends APIError2 { - constructor({ message } = {}) { - super(undefined, undefined, message || "Request was aborted.", undefined); - } - }; - APIConnectionError2 = class APIConnectionError2 extends APIError2 { - constructor({ message, cause }) { - super(undefined, undefined, message || "Connection error.", undefined); - if (cause) - this.cause = cause; - } - }; - APIConnectionTimeoutError2 = class APIConnectionTimeoutError2 extends APIConnectionError2 { - constructor({ message } = {}) { - super({ message: message ?? "Request timed out." }); - } - }; - BadRequestError2 = class BadRequestError2 extends APIError2 { - }; - AuthenticationError2 = class AuthenticationError2 extends APIError2 { - }; - PermissionDeniedError2 = class PermissionDeniedError2 extends APIError2 { - }; - NotFoundError2 = class NotFoundError2 extends APIError2 { - }; - ConflictError2 = class ConflictError2 extends APIError2 { - }; - UnprocessableEntityError2 = class UnprocessableEntityError2 extends APIError2 { - }; - RateLimitError2 = class RateLimitError2 extends APIError2 { - }; - InternalServerError2 = class InternalServerError2 extends APIError2 { - }; -}); - -// ../node_modules/@anthropic-ai/sdk/internal/utils/values.mjs -function maybeObj2(x2) { - if (typeof x2 !== "object") { - return {}; - } - return x2 ?? {}; -} -function isEmptyObj2(obj) { - if (!obj) - return true; - for (const _k in obj) - return false; - return true; -} -function hasOwn2(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} -var startsWithSchemeRegexp2, isAbsoluteURL3 = (url3) => { - return startsWithSchemeRegexp2.test(url3); -}, validatePositiveInteger2 = (name, n2) => { - if (typeof n2 !== "number" || !Number.isInteger(n2)) { - throw new AnthropicError2(`${name} must be an integer`); - } - if (n2 < 0) { - throw new AnthropicError2(`${name} must be a positive integer`); - } - return n2; -}, safeJSON2 = (text) => { - try { - return JSON.parse(text); - } catch (err) { - return; - } -}; -var init_values4 = __esm(() => { - init_error4(); - startsWithSchemeRegexp2 = /^[a-z][a-z0-9+.-]*:/i; -}); - -// ../node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs -var sleep2 = (ms) => new Promise((resolve8) => setTimeout(resolve8, ms)); - -// ../node_modules/@anthropic-ai/sdk/internal/utils/log.mjs -function noop7() {} -function makeLogFn2(fnLevel, logger, logLevel) { - if (!logger || levelNumbers2[fnLevel] > levelNumbers2[logLevel]) { - return noop7; - } else { - return logger[fnLevel].bind(logger); - } -} -function loggerFor2(client) { - const logger = client.logger; - const logLevel = client.logLevel ?? "off"; - if (!logger) { - return noopLogger2; - } - const cachedLogger = cachedLoggers2.get(logger); - if (cachedLogger && cachedLogger[0] === logLevel) { - return cachedLogger[1]; - } - const levelLogger = { - error: makeLogFn2("error", logger, logLevel), - warn: makeLogFn2("warn", logger, logLevel), - info: makeLogFn2("info", logger, logLevel), - debug: makeLogFn2("debug", logger, logLevel) - }; - cachedLoggers2.set(logger, [logLevel, levelLogger]); - return levelLogger; -} -var levelNumbers2, parseLogLevel2 = (maybeLevel, sourceName, client) => { - if (!maybeLevel) { - return; - } - if (hasOwn2(levelNumbers2, maybeLevel)) { - return maybeLevel; - } - loggerFor2(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers2))}`); - return; -}, noopLogger2, cachedLoggers2, formatRequestDetails2 = (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() === "x-api-key" || name.toLowerCase() === "authorization" || name.toLowerCase() === "cookie" || name.toLowerCase() === "set-cookie" ? "***" : value - ])); - } - if ("retryOfRequestLogID" in details) { - if (details.retryOfRequestLogID) { - details.retryOf = details.retryOfRequestLogID; - } - delete details.retryOfRequestLogID; - } - return details; -}; -var init_log4 = __esm(() => { - init_values4(); - levelNumbers2 = { - off: 0, - error: 200, - warn: 300, - info: 400, - debug: 500 - }; - noopLogger2 = { - error: noop7, - warn: noop7, - info: noop7, - debug: noop7 - }; - cachedLoggers2 = new WeakMap; -}); - -// ../node_modules/@anthropic-ai/sdk/version.mjs -var VERSION5 = "0.52.0"; - -// ../node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs -function getDetectedPlatform2() { - 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"; -} -function getBrowserInfo2() { - 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 match = pattern.exec(navigator.userAgent); - if (match) { - const major = match[1] || 0; - const minor = match[2] || 0; - const patch = match[3] || 0; - return { browser: key, version: `${major}.${minor}.${patch}` }; - } - } - return null; -} -var isRunningInBrowser2 = () => { - return typeof window !== "undefined" && typeof window.document !== "undefined" && typeof navigator !== "undefined"; -}, getPlatformProperties2 = () => { - const detectedPlatform = getDetectedPlatform2(); - if (detectedPlatform === "deno") { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION5, - "X-Stainless-OS": normalizePlatform2(Deno.build.os), - "X-Stainless-Arch": normalizeArch2(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": VERSION5, - "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": VERSION5, - "X-Stainless-OS": normalizePlatform2(globalThis.process.platform), - "X-Stainless-Arch": normalizeArch2(globalThis.process.arch), - "X-Stainless-Runtime": "node", - "X-Stainless-Runtime-Version": globalThis.process.version - }; - } - const browserInfo = getBrowserInfo2(); - if (browserInfo) { - return { - "X-Stainless-Lang": "js", - "X-Stainless-Package-Version": VERSION5, - "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": VERSION5, - "X-Stainless-OS": "Unknown", - "X-Stainless-Arch": "unknown", - "X-Stainless-Runtime": "unknown", - "X-Stainless-Runtime-Version": "unknown" - }; -}, normalizeArch2 = (arch) => { - if (arch === "x32") - return "x32"; - if (arch === "x86_64" || arch === "x64") - return "x64"; - if (arch === "arm") - return "arm"; - if (arch === "aarch64" || arch === "arm64") - return "arm64"; - if (arch) - return `other:${arch}`; - return "unknown"; -}, normalizePlatform2 = (platform2) => { - platform2 = platform2.toLowerCase(); - if (platform2.includes("ios")) - return "iOS"; - if (platform2 === "android") - return "Android"; - if (platform2 === "darwin") - return "MacOS"; - if (platform2 === "win32") - return "Windows"; - if (platform2 === "freebsd") - return "FreeBSD"; - if (platform2 === "openbsd") - return "OpenBSD"; - if (platform2 === "linux") - return "Linux"; - if (platform2) - return `Other:${platform2}`; - return "Unknown"; -}, _platformHeaders2, getPlatformHeaders2 = () => { - return _platformHeaders2 ?? (_platformHeaders2 = getPlatformProperties2()); -}; -var init_detect_platform2 = () => {}; - -// ../node_modules/@anthropic-ai/sdk/internal/shims.mjs -function getDefaultFetch2() { - if (typeof fetch !== "undefined") { - return fetch; - } - throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`"); -} -function makeReadableStream2(...args) { - const ReadableStream3 = globalThis.ReadableStream; - if (typeof ReadableStream3 === "undefined") { - throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`"); - } - return new ReadableStream3(...args); -} -function ReadableStreamFrom2(iterable) { - let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); - return makeReadableStream2({ - start() {}, - async pull(controller) { - const { done, value } = await iter.next(); - if (done) { - controller.close(); - } else { - controller.enqueue(value); - } - }, - async cancel() { - await iter.return?.(); - } - }); -} -function ReadableStreamToAsyncIterable2(stream4) { - if (stream4[Symbol.asyncIterator]) - return stream4; - const reader = stream4.getReader(); - return { - async next() { - try { - const result2 = await reader.read(); - if (result2?.done) - reader.releaseLock(); - return result2; - } catch (e) { - reader.releaseLock(); - throw e; - } - }, - async return() { - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; - return { done: true, value: undefined }; - }, - [Symbol.asyncIterator]() { - return this; - } - }; -} -async function CancelReadableStream2(stream4) { - if (stream4 === null || typeof stream4 !== "object") - return; - if (stream4[Symbol.asyncIterator]) { - await stream4[Symbol.asyncIterator]().return?.(); - return; - } - const reader = stream4.getReader(); - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; -} - -// ../node_modules/@anthropic-ai/sdk/internal/request-options.mjs -var FallbackEncoder2 = ({ headers, body }) => { - return { - bodyHeaders: { - "content-type": "application/json" - }, - body: JSON.stringify(body) - }; -}; - -// ../node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs -function concatBytes2(buffers) { - let length = 0; - for (const buffer of buffers) { - length += buffer.length; - } - const output = new Uint8Array(length); - let index = 0; - for (const buffer of buffers) { - output.set(buffer, index); - index += buffer.length; - } - return output; -} -function encodeUTF82(str) { - let encoder; - return (encodeUTF8_2 ?? (encoder = new globalThis.TextEncoder, encodeUTF8_2 = encoder.encode.bind(encoder)))(str); -} -function decodeUTF82(bytes) { - let decoder; - return (decodeUTF8_2 ?? (decoder = new globalThis.TextDecoder, decodeUTF8_2 = decoder.decode.bind(decoder)))(bytes); -} -var encodeUTF8_2, decodeUTF8_2; - -// ../node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs -class LineDecoder2 { - constructor() { - _LineDecoder_buffer2.set(this, undefined); - _LineDecoder_carriageReturnIndex2.set(this, undefined); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, new Uint8Array, "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex2, null, "f"); - } - decode(chunk2) { - if (chunk2 == null) { - return []; - } - const binaryChunk = chunk2 instanceof ArrayBuffer ? new Uint8Array(chunk2) : typeof chunk2 === "string" ? encodeUTF82(chunk2) : chunk2; - __classPrivateFieldSet2(this, _LineDecoder_buffer2, concatBytes2([__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f"), binaryChunk]), "f"); - const lines = []; - let patternIndex; - while ((patternIndex = findNewlineIndex2(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f"), __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex2, "f"))) != null) { - if (patternIndex.carriage && __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex2, "f") == null) { - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex2, patternIndex.index, "f"); - continue; - } - if (__classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex2, "f") != null && (patternIndex.index !== __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex2, "f") + 1 || patternIndex.carriage)) { - lines.push(decodeUTF82(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(0, __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex2, "f") - 1))); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex2, "f")), "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex2, null, "f"); - continue; - } - const endIndex = __classPrivateFieldGet2(this, _LineDecoder_carriageReturnIndex2, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding; - const line = decodeUTF82(__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(0, endIndex)); - lines.push(line); - __classPrivateFieldSet2(this, _LineDecoder_buffer2, __classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").subarray(patternIndex.index), "f"); - __classPrivateFieldSet2(this, _LineDecoder_carriageReturnIndex2, null, "f"); - } - return lines; - } - flush() { - if (!__classPrivateFieldGet2(this, _LineDecoder_buffer2, "f").length) { - return []; - } - return this.decode(` -`); - } -} -function findNewlineIndex2(buffer, startIndex) { - const newline = 10; - const carriage = 13; - for (let i2 = startIndex ?? 0;i2 < buffer.length; i2++) { - if (buffer[i2] === newline) { - return { preceding: i2, index: i2 + 1, carriage: false }; - } - if (buffer[i2] === carriage) { - return { preceding: i2, index: i2 + 1, carriage: true }; - } - } - return null; -} -function findDoubleNewlineIndex2(buffer) { - const newline = 10; - const carriage = 13; - for (let i2 = 0;i2 < buffer.length - 1; i2++) { - if (buffer[i2] === newline && buffer[i2 + 1] === newline) { - return i2 + 2; - } - if (buffer[i2] === carriage && buffer[i2 + 1] === carriage) { - return i2 + 2; - } - if (buffer[i2] === carriage && buffer[i2 + 1] === newline && i2 + 3 < buffer.length && buffer[i2 + 2] === carriage && buffer[i2 + 3] === newline) { - return i2 + 4; - } - } - return -1; -} -var _LineDecoder_buffer2, _LineDecoder_carriageReturnIndex2; -var init_line2 = __esm(() => { - init_tslib2(); - _LineDecoder_buffer2 = new WeakMap, _LineDecoder_carriageReturnIndex2 = new WeakMap; - LineDecoder2.NEWLINE_CHARS = new Set([` -`, "\r"]); - LineDecoder2.NEWLINE_REGEXP = /\r\n|[\n\r]/g; -}); - -// ../node_modules/@anthropic-ai/sdk/core/streaming.mjs -async function* _iterSSEMessages2(response, controller) { - if (!response.body) { - controller.abort(); - if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { - throw new AnthropicError2(`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 AnthropicError2(`Attempted to iterate over a response with no body`); - } - const sseDecoder = new SSEDecoder2; - const lineDecoder = new LineDecoder2; - const iter = ReadableStreamToAsyncIterable2(response.body); - for await (const sseChunk of iterSSEChunks2(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; - } -} -async function* iterSSEChunks2(iterator2) { - let data = new Uint8Array; - for await (const chunk2 of iterator2) { - if (chunk2 == null) { - continue; - } - const binaryChunk = chunk2 instanceof ArrayBuffer ? new Uint8Array(chunk2) : typeof chunk2 === "string" ? encodeUTF82(chunk2) : chunk2; - let newData = new Uint8Array(data.length + binaryChunk.length); - newData.set(data); - newData.set(binaryChunk, data.length); - data = newData; - let patternIndex; - while ((patternIndex = findDoubleNewlineIndex2(data)) !== -1) { - yield data.slice(0, patternIndex); - data = data.slice(patternIndex); - } - } - if (data.length > 0) { - yield data; - } -} - -class SSEDecoder2 { - 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(` -`), - raw: this.chunks - }; - this.event = null; - this.data = []; - this.chunks = []; - return sse; - } - this.chunks.push(line); - if (line.startsWith(":")) { - return null; - } - let [fieldname, _, value] = partition3(line, ":"); - if (value.startsWith(" ")) { - value = value.substring(1); - } - if (fieldname === "event") { - this.event = value; - } else if (fieldname === "data") { - this.data.push(value); - } - return null; - } -} -function partition3(str, delimiter) { - const index = str.indexOf(delimiter); - if (index !== -1) { - return [str.substring(0, index), delimiter, str.substring(index + delimiter.length)]; - } - return [str, "", ""]; -} -var Stream2; -var init_streaming4 = __esm(() => { - init_error4(); - init_line2(); - init_values4(); - init_error4(); - Stream2 = class Stream2 { - constructor(iterator2, controller) { - this.iterator = iterator2; - this.controller = controller; - } - static fromSSEResponse(response, controller) { - let consumed = false; - async function* iterator2() { - if (consumed) { - throw new AnthropicError2("Cannot iterate over a consumed stream, use `.tee()` to split the stream."); - } - consumed = true; - let done = false; - try { - for await (const sse of _iterSSEMessages2(response, controller)) { - if (sse.event === "completion") { - try { - yield JSON.parse(sse.data); - } catch (e) { - console.error(`Could not parse message into JSON:`, sse.data); - console.error(`From chunk:`, sse.raw); - throw e; - } - } - if (sse.event === "message_start" || sse.event === "message_delta" || sse.event === "message_stop" || sse.event === "content_block_start" || sse.event === "content_block_delta" || sse.event === "content_block_stop") { - try { - yield JSON.parse(sse.data); - } catch (e) { - console.error(`Could not parse message into JSON:`, sse.data); - console.error(`From chunk:`, sse.raw); - throw e; - } - } - if (sse.event === "ping") { - continue; - } - if (sse.event === "error") { - throw new APIError2(undefined, safeJSON2(sse.data) ?? sse.data, undefined, response.headers); - } - } - done = true; - } catch (e) { - if (isAbortError4(e)) - return; - throw e; - } finally { - if (!done) - controller.abort(); - } - } - return new Stream2(iterator2, controller); - } - static fromReadableStream(readableStream, controller) { - let consumed = false; - async function* iterLines() { - const lineDecoder = new LineDecoder2; - const iter = ReadableStreamToAsyncIterable2(readableStream); - for await (const chunk2 of iter) { - for (const line of lineDecoder.decode(chunk2)) { - yield line; - } - } - for (const line of lineDecoder.flush()) { - yield line; - } - } - async function* iterator2() { - if (consumed) { - throw new AnthropicError2("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 (e) { - if (isAbortError4(e)) - return; - throw e; - } finally { - if (!done) - controller.abort(); - } - } - return new Stream2(iterator2, controller); - } - [Symbol.asyncIterator]() { - return this.iterator(); - } - tee() { - const left = []; - const right = []; - const iterator2 = this.iterator(); - const teeIterator = (queue) => { - return { - next: () => { - if (queue.length === 0) { - const result2 = iterator2.next(); - left.push(result2); - right.push(result2); - } - return queue.shift(); - } - }; - }; - return [ - new Stream2(() => teeIterator(left), this.controller), - new Stream2(() => teeIterator(right), this.controller) - ]; - } - toReadableStream() { - const self2 = this; - let iter; - return makeReadableStream2({ - async start() { - iter = self2[Symbol.asyncIterator](); - }, - async pull(ctrl) { - try { - const { value, done } = await iter.next(); - if (done) - return ctrl.close(); - const bytes = encodeUTF82(JSON.stringify(value) + ` -`); - ctrl.enqueue(bytes); - } catch (err) { - ctrl.error(err); - } - }, - async cancel() { - await iter.return?.(); - } - }); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/internal/parse.mjs -async function defaultParseResponse2(client, props) { - const { response, requestLogID, retryOfRequestLogID, startTime } = props; - const body = await (async () => { - if (props.options.stream) { - loggerFor2(client).debug("response", response.status, response.url, response.headers, response.body); - if (props.options.__streamClass) { - return props.options.__streamClass.fromSSEResponse(response, props.controller); - } - return Stream2.fromSSEResponse(response, props.controller); - } - if (response.status === 204) { - return null; - } - if (props.options.__binaryResponse) { - return response; - } - const contentType = response.headers.get("content-type"); - const mediaType = contentType?.split(";")[0]?.trim(); - const isJSON = mediaType?.includes("application/json") || mediaType?.endsWith("+json"); - if (isJSON) { - const json2 = await response.json(); - return addRequestID2(json2, response); - } - const text = await response.text(); - return text; - })(); - loggerFor2(client).debug(`[${requestLogID}] response parsed`, formatRequestDetails2({ - retryOfRequestLogID, - url: response.url, - status: response.status, - body, - durationMs: Date.now() - startTime - })); - return body; -} -function addRequestID2(value, response) { - if (!value || typeof value !== "object" || Array.isArray(value)) { - return value; - } - return Object.defineProperty(value, "_request_id", { - value: response.headers.get("request-id"), - enumerable: false - }); -} -var init_parse4 = __esm(() => { - init_streaming4(); - init_log4(); -}); - -// ../node_modules/@anthropic-ai/sdk/core/api-promise.mjs -var _APIPromise_client2, APIPromise2; -var init_api_promise2 = __esm(() => { - init_tslib2(); - init_parse4(); - APIPromise2 = class APIPromise2 extends Promise { - constructor(client, responsePromise, parseResponse = defaultParseResponse2) { - super((resolve8) => { - resolve8(null); - }); - this.responsePromise = responsePromise; - this.parseResponse = parseResponse; - _APIPromise_client2.set(this, undefined); - __classPrivateFieldSet2(this, _APIPromise_client2, client, "f"); - } - _thenUnwrap(transform3) { - return new APIPromise2(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), this.responsePromise, async (client, props) => addRequestID2(transform3(await this.parseResponse(client, props), props), props.response)); - } - asResponse() { - return this.responsePromise.then((p) => p.response); - } - async withResponse() { - const [data, response] = await Promise.all([this.parse(), this.asResponse()]); - return { data, response, request_id: response.headers.get("request-id") }; - } - parse() { - if (!this.parsedPromise) { - this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet2(this, _APIPromise_client2, "f"), data)); - } - return this.parsedPromise; - } - then(onfulfilled, onrejected) { - return this.parse().then(onfulfilled, onrejected); - } - catch(onrejected) { - return this.parse().catch(onrejected); - } - finally(onfinally) { - return this.parse().finally(onfinally); - } - }; - _APIPromise_client2 = new WeakMap; -}); - -// ../node_modules/@anthropic-ai/sdk/core/pagination.mjs -var _AbstractPage_client2, AbstractPage2, PagePromise2, Page2; -var init_pagination2 = __esm(() => { - init_tslib2(); - init_error4(); - init_parse4(); - init_api_promise2(); - init_values4(); - AbstractPage2 = class AbstractPage2 { - constructor(client, response, body, options) { - _AbstractPage_client2.set(this, undefined); - __classPrivateFieldSet2(this, _AbstractPage_client2, client, "f"); - this.options = options; - this.response = response; - this.body = body; - } - hasNextPage() { - const items = this.getPaginatedItems(); - if (!items.length) - return false; - return this.nextPageRequestOptions() != null; - } - async getNextPage() { - const nextOptions = this.nextPageRequestOptions(); - if (!nextOptions) { - throw new AnthropicError2("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`."); - } - return await __classPrivateFieldGet2(this, _AbstractPage_client2, "f").requestAPIList(this.constructor, nextOptions); - } - async* iterPages() { - let page = this; - yield page; - while (page.hasNextPage()) { - page = await page.getNextPage(); - yield page; - } - } - async* [(_AbstractPage_client2 = new WeakMap, Symbol.asyncIterator)]() { - for await (const page of this.iterPages()) { - for (const item of page.getPaginatedItems()) { - yield item; - } - } - } - }; - PagePromise2 = class PagePromise2 extends APIPromise2 { - constructor(client, request, Page2) { - super(client, request, async (client2, props) => new Page2(client2, props.response, await defaultParseResponse2(client2, props), props.options)); - } - async* [Symbol.asyncIterator]() { - const page = await this; - for await (const item of page) { - yield item; - } - } - }; - Page2 = class Page2 extends AbstractPage2 { - constructor(client, response, body, options) { - super(client, response, body, options); - this.data = body.data || []; - this.has_more = body.has_more || false; - this.first_id = body.first_id || null; - this.last_id = body.last_id || null; - } - getPaginatedItems() { - return this.data ?? []; - } - hasNextPage() { - if (this.has_more === false) { - return false; - } - return super.hasNextPage(); - } - nextPageRequestOptions() { - if (this.options.query?.["before_id"]) { - const first_id = this.first_id; - if (!first_id) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - before_id: first_id - } - }; - } - const cursor = this.last_id; - if (!cursor) { - return null; - } - return { - ...this.options, - query: { - ...maybeObj2(this.options.query), - after_id: cursor - } - }; - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/internal/uploads.mjs -function makeFile2(fileBits, fileName, options) { - checkFileSupport2(); - return new File(fileBits, fileName ?? "unknown_file", options); -} -function getName2(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() || undefined; -} -function supportsFormData2(fetchObject) { - const fetch2 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch; - const cached2 = supportsFormDataMap2.get(fetch2); - if (cached2) - return cached2; - const promise2 = (async () => { - try { - const FetchResponse = "Response" in fetch2 ? fetch2.Response : (await fetch2("data:,")).constructor; - const data = new FormData; - if (data.toString() === await new FetchResponse(data).text()) { - return false; - } - return true; - } catch { - return true; - } - })(); - supportsFormDataMap2.set(fetch2, promise2); - return promise2; -} -var checkFileSupport2 = () => { - if (typeof File === "undefined") { - const { process: process12 } = globalThis; - const isOldNode = typeof process12?.versions?.node === "string" && parseInt(process12.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`." : "")); - } -}, isAsyncIterable2 = (value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function", multipartFormRequestOptions2 = async (opts, fetch2) => { - return { ...opts, body: await createForm2(opts.body, fetch2) }; -}, supportsFormDataMap2, createForm2 = async (body, fetch2) => { - if (!await supportsFormData2(fetch2)) { - throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class."); - } - const form = new FormData; - await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue2(form, key, value))); - return form; -}, isNamedBlob2 = (value) => value instanceof Blob && ("name" in value), addFormValue2 = async (form, key, value) => { - if (value === undefined) - return; - if (value == null) { - throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`); - } - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - form.append(key, String(value)); - } else if (value instanceof Response) { - let options = {}; - const contentType = value.headers.get("Content-Type"); - if (contentType) { - options = { type: contentType }; - } - form.append(key, makeFile2([await value.blob()], getName2(value), options)); - } else if (isAsyncIterable2(value)) { - form.append(key, makeFile2([await new Response(ReadableStreamFrom2(value)).blob()], getName2(value))); - } else if (isNamedBlob2(value)) { - form.append(key, makeFile2([value], getName2(value), { type: value.type })); - } else if (Array.isArray(value)) { - await Promise.all(value.map((entry) => addFormValue2(form, key + "[]", entry))); - } else if (typeof value === "object") { - await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue2(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`); - } -}; -var init_uploads3 = __esm(() => { - supportsFormDataMap2 = new WeakMap; -}); - -// ../node_modules/@anthropic-ai/sdk/internal/to-file.mjs -async function toFile2(value, name, options) { - checkFileSupport2(); - value = await value; - name || (name = getName2(value)); - if (isFileLike2(value)) { - if (value instanceof File && name == null && options == null) { - return value; - } - return makeFile2([await value.arrayBuffer()], name ?? value.name, { - type: value.type, - lastModified: value.lastModified, - ...options - }); - } - if (isResponseLike2(value)) { - const blob = await value.blob(); - name || (name = new URL(value.url).pathname.split(/[\\/]/).pop()); - return makeFile2(await getBytes2(blob), name, options); - } - const parts = await getBytes2(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 makeFile2(parts, name, options); -} -async function getBytes2(value) { - let parts = []; - if (typeof value === "string" || ArrayBuffer.isView(value) || value instanceof ArrayBuffer) { - parts.push(value); - } else if (isBlobLike2(value)) { - parts.push(value instanceof Blob ? value : await value.arrayBuffer()); - } else if (isAsyncIterable2(value)) { - for await (const chunk2 of value) { - parts.push(...await getBytes2(chunk2)); - } - } else { - const constructor = value?.constructor?.name; - throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ""}${propsForError2(value)}`); - } - return parts; -} -function propsForError2(value) { - if (typeof value !== "object" || value === null) - return ""; - const props = Object.getOwnPropertyNames(value); - return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`; -} -var isBlobLike2 = (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", isFileLike2 = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike2(value), isResponseLike2 = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function"; -var init_to_file2 = __esm(() => { - init_uploads3(); - init_uploads3(); -}); - -// ../node_modules/@anthropic-ai/sdk/core/uploads.mjs -var init_uploads4 = __esm(() => { - init_to_file2(); -}); - -// ../node_modules/@anthropic-ai/sdk/resources/shared.mjs -var init_shared3 = () => {}; - -// ../node_modules/@anthropic-ai/sdk/core/resource.mjs -class APIResource2 { - constructor(client) { - this._client = client; - } -} - -// ../node_modules/@anthropic-ai/sdk/internal/headers.mjs -function* iterateHeaders2(headers) { - if (!headers) - return; - if (brand_privateNullableHeaders2 in headers) { - const { values: values2, nulls } = headers; - yield* values2.entries(); - for (const name of nulls) { - yield [name, null]; - } - return; - } - let shouldClear = false; - let iter; - if (headers instanceof Headers) { - iter = headers.entries(); - } else if (isArray4(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 values2 = isArray4(row[1]) ? row[1] : [row[1]]; - let didClear = false; - for (const value of values2) { - if (value === undefined) - continue; - if (shouldClear && !didClear) { - didClear = true; - yield [name, null]; - } - yield [name, value]; - } - } -} -var brand_privateNullableHeaders2, isArray4, buildHeaders2 = (newHeaders) => { - const targetHeaders = new Headers; - const nullHeaders = new Set; - for (const headers of newHeaders) { - const seenHeaders = new Set; - for (const [name, value] of iterateHeaders2(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); - } - } - } - return { [brand_privateNullableHeaders2]: true, values: targetHeaders, nulls: nullHeaders }; -}; -var init_headers2 = __esm(() => { - brand_privateNullableHeaders2 = Symbol.for("brand.privateNullableHeaders"); - isArray4 = Array.isArray; -}); - -// ../node_modules/@anthropic-ai/sdk/internal/utils/path.mjs -function encodeURIPath2(str) { - return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); -} -var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path(statics, ...params) { - if (statics.length === 1) - return statics[0]; - let postPath = false; - const path9 = statics.reduce((previousValue, currentValue, index) => { - if (/[?#]/.test(currentValue)) { - postPath = true; - } - return previousValue + currentValue + (index === params.length ? "" : (postPath ? encodeURIComponent : pathEncoder)(String(params[index]))); - }, ""); - const pathOnly = path9.split(/[?#]/, 1)[0]; - const invalidSegments = []; - const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; - let match; - while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) { - invalidSegments.push({ - start: match.index, - length: match[0].length - }); - } - if (invalidSegments.length > 0) { - let lastEnd = 0; - const underline2 = 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 AnthropicError2(`Path parameters result in path with invalid segments: -${path9} -${underline2}`); - } - return path9; -}, path9; -var init_path3 = __esm(() => { - init_error4(); - path9 = createPathTagFunction2(encodeURIPath2); -}); - -// ../node_modules/@anthropic-ai/sdk/resources/beta/files.mjs -var Files2; -var init_files3 = __esm(() => { - init_pagination2(); - init_headers2(); - init_uploads3(); - init_path3(); - Files2 = class Files2 extends APIResource2 { - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/files", Page2, { - query, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() }, - options?.headers - ]) - }); - } - delete(fileID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.delete(path9`/v1/files/${fileID}`, { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() }, - options?.headers - ]) - }); - } - download(fileID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path9`/v1/files/${fileID}/content`, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString(), - Accept: "application/binary" - }, - options?.headers - ]), - __binaryResponse: true - }); - } - retrieveMetadata(fileID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path9`/v1/files/${fileID}`, { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() }, - options?.headers - ]) - }); - } - upload(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/files", multipartFormRequestOptions2({ - body, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() }, - options?.headers - ]) - }, this._client)); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/resources/beta/models.mjs -var Models3; -var init_models3 = __esm(() => { - init_pagination2(); - init_headers2(); - init_path3(); - Models3 = class Models3 extends APIResource2 { - retrieve(modelID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path9`/v1/models/${modelID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : undefined }, - options?.headers - ]) - }); - } - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/models?beta=true", Page2, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : undefined }, - options?.headers - ]) - }); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs -var JSONLDecoder2; -var init_jsonl2 = __esm(() => { - init_error4(); - init_line2(); - JSONLDecoder2 = class JSONLDecoder2 { - constructor(iterator2, controller) { - this.iterator = iterator2; - this.controller = controller; - } - async* decoder() { - const lineDecoder = new LineDecoder2; - for await (const chunk2 of this.iterator) { - for (const line of lineDecoder.decode(chunk2)) { - yield JSON.parse(line); - } - } - for (const line of lineDecoder.flush()) { - yield JSON.parse(line); - } - } - [Symbol.asyncIterator]() { - return this.decoder(); - } - static fromResponse(response, controller) { - if (!response.body) { - controller.abort(); - if (typeof globalThis.navigator !== "undefined" && globalThis.navigator.product === "ReactNative") { - throw new AnthropicError2(`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 AnthropicError2(`Attempted to iterate over a response with no body`); - } - return new JSONLDecoder2(ReadableStreamToAsyncIterable2(response.body), controller); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/error.mjs -var init_error5 = __esm(() => { - init_error4(); -}); - -// ../node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs -var Batches3; -var init_batches3 = __esm(() => { - init_pagination2(); - init_headers2(); - init_jsonl2(); - init_error5(); - init_path3(); - Batches3 = class Batches3 extends APIResource2 { - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/messages/batches?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() }, - options?.headers - ]) - }); - } - retrieve(messageBatchID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path9`/v1/messages/batches/${messageBatchID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() }, - options?.headers - ]) - }); - } - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/messages/batches?beta=true", Page2, { - query, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() }, - options?.headers - ]) - }); - } - delete(messageBatchID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.delete(path9`/v1/messages/batches/${messageBatchID}?beta=true`, { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() }, - options?.headers - ]) - }); - } - cancel(messageBatchID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.post(path9`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, { - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() }, - options?.headers - ]) - }); - } - async results(messageBatchID, params = {}, options) { - const batch = await this.retrieve(messageBatchID); - if (!batch.results_url) { - throw new AnthropicError2(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); - } - const { betas } = params ?? {}; - return this._client.get(batch.results_url, { - ...options, - headers: buildHeaders2([ - { - "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString(), - Accept: "application/binary" - }, - options?.headers - ]), - stream: true, - __binaryResponse: true - })._thenUnwrap((_, props) => JSONLDecoder2.fromResponse(props.response, props.controller)); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/streaming.mjs -var init_streaming5 = __esm(() => { - init_streaming4(); -}); - -// ../node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs -var tokenize2 = (input) => { - let current = 0; - let tokens = []; - while (current < input.length) { - let char = input[current]; - if (char === "\\") { - current++; - continue; - } - if (char === "{") { - tokens.push({ - type: "brace", - value: "{" - }); - current++; - continue; - } - if (char === "}") { - tokens.push({ - type: "brace", - value: "}" - }); - current++; - continue; - } - if (char === "[") { - tokens.push({ - type: "paren", - value: "[" - }); - current++; - continue; - } - if (char === "]") { - tokens.push({ - type: "paren", - value: "]" - }); - current++; - continue; - } - if (char === ":") { - tokens.push({ - type: "separator", - value: ":" - }); - current++; - continue; - } - if (char === ",") { - tokens.push({ - type: "delimiter", - value: "," - }); - current++; - continue; - } - if (char === '"') { - let value = ""; - let danglingQuote = false; - char = input[++current]; - while (char !== '"') { - if (current === input.length) { - danglingQuote = true; - break; - } - if (char === "\\") { - current++; - if (current === input.length) { - danglingQuote = true; - break; - } - value += char + input[current]; - char = input[++current]; - } else { - value += char; - char = input[++current]; - } - } - char = input[++current]; - if (!danglingQuote) { - tokens.push({ - type: "string", - value - }); - } - continue; - } - let WHITESPACE = /\s/; - if (char && WHITESPACE.test(char)) { - current++; - continue; - } - let NUMBERS = /[0-9]/; - if (char && NUMBERS.test(char) || char === "-" || char === ".") { - let value = ""; - if (char === "-") { - value += char; - char = input[++current]; - } - while (char && NUMBERS.test(char) || char === ".") { - value += char; - char = input[++current]; - } - tokens.push({ - type: "number", - value - }); - continue; - } - let LETTERS = /[a-z]/i; - if (char && LETTERS.test(char)) { - let value = ""; - while (char && LETTERS.test(char)) { - if (current === input.length) { - break; - } - value += char; - char = input[++current]; - } - if (value == "true" || value == "false" || value === "null") { - tokens.push({ - type: "name", - value - }); - } else { - current++; - continue; - } - continue; - } - current++; - } - return tokens; -}, strip2 = (tokens) => { - if (tokens.length === 0) { - return tokens; - } - let lastToken = tokens[tokens.length - 1]; - switch (lastToken.type) { - case "separator": - tokens = tokens.slice(0, tokens.length - 1); - return strip2(tokens); - break; - case "number": - let lastCharacterOfLastToken = lastToken.value[lastToken.value.length - 1]; - if (lastCharacterOfLastToken === "." || lastCharacterOfLastToken === "-") { - tokens = tokens.slice(0, tokens.length - 1); - return strip2(tokens); - } - case "string": - let tokenBeforeTheLastToken = tokens[tokens.length - 2]; - if (tokenBeforeTheLastToken?.type === "delimiter") { - tokens = tokens.slice(0, tokens.length - 1); - return strip2(tokens); - } else if (tokenBeforeTheLastToken?.type === "brace" && tokenBeforeTheLastToken.value === "{") { - tokens = tokens.slice(0, tokens.length - 1); - return strip2(tokens); - } - break; - case "delimiter": - tokens = tokens.slice(0, tokens.length - 1); - return strip2(tokens); - break; - } - return tokens; -}, unstrip2 = (tokens) => { - let tail2 = []; - tokens.map((token) => { - if (token.type === "brace") { - if (token.value === "{") { - tail2.push("}"); - } else { - tail2.splice(tail2.lastIndexOf("}"), 1); - } - } - if (token.type === "paren") { - if (token.value === "[") { - tail2.push("]"); - } else { - tail2.splice(tail2.lastIndexOf("]"), 1); - } - } - }); - if (tail2.length > 0) { - tail2.reverse().map((item) => { - if (item === "}") { - tokens.push({ - type: "brace", - value: "}" - }); - } else if (item === "]") { - tokens.push({ - type: "paren", - value: "]" - }); - } - }); - } - return tokens; -}, generate2 = (tokens) => { - let output = ""; - tokens.map((token) => { - switch (token.type) { - case "string": - output += '"' + token.value + '"'; - break; - default: - output += token.value; - break; - } - }); - return output; -}, partialParse2 = (input) => JSON.parse(generate2(unstrip2(strip2(tokenize2(input))))); -var init_parser3 = () => {}; - -// ../node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs -function checkNever3(x2) {} -var _BetaMessageStream_instances2, _BetaMessageStream_currentMessageSnapshot2, _BetaMessageStream_connectedPromise2, _BetaMessageStream_resolveConnectedPromise2, _BetaMessageStream_rejectConnectedPromise2, _BetaMessageStream_endPromise2, _BetaMessageStream_resolveEndPromise2, _BetaMessageStream_rejectEndPromise2, _BetaMessageStream_listeners2, _BetaMessageStream_ended2, _BetaMessageStream_errored2, _BetaMessageStream_aborted2, _BetaMessageStream_catchingPromiseCreated2, _BetaMessageStream_response2, _BetaMessageStream_request_id2, _BetaMessageStream_getFinalMessage2, _BetaMessageStream_getFinalText2, _BetaMessageStream_handleError2, _BetaMessageStream_beginRequest2, _BetaMessageStream_addStreamEvent2, _BetaMessageStream_endRequest2, _BetaMessageStream_accumulateMessage2, JSON_BUF_PROPERTY3 = "__json_buf", BetaMessageStream2; -var init_BetaMessageStream2 = __esm(() => { - init_tslib2(); - init_error5(); - init_streaming5(); - init_parser3(); - BetaMessageStream2 = class BetaMessageStream2 { - constructor() { - _BetaMessageStream_instances2.add(this); - this.messages = []; - this.receivedMessages = []; - _BetaMessageStream_currentMessageSnapshot2.set(this, undefined); - this.controller = new AbortController; - _BetaMessageStream_connectedPromise2.set(this, undefined); - _BetaMessageStream_resolveConnectedPromise2.set(this, () => {}); - _BetaMessageStream_rejectConnectedPromise2.set(this, () => {}); - _BetaMessageStream_endPromise2.set(this, undefined); - _BetaMessageStream_resolveEndPromise2.set(this, () => {}); - _BetaMessageStream_rejectEndPromise2.set(this, () => {}); - _BetaMessageStream_listeners2.set(this, {}); - _BetaMessageStream_ended2.set(this, false); - _BetaMessageStream_errored2.set(this, false); - _BetaMessageStream_aborted2.set(this, false); - _BetaMessageStream_catchingPromiseCreated2.set(this, false); - _BetaMessageStream_response2.set(this, undefined); - _BetaMessageStream_request_id2.set(this, undefined); - _BetaMessageStream_handleError2.set(this, (error42) => { - __classPrivateFieldSet2(this, _BetaMessageStream_errored2, true, "f"); - if (isAbortError4(error42)) { - error42 = new APIUserAbortError2; - } - if (error42 instanceof APIUserAbortError2) { - __classPrivateFieldSet2(this, _BetaMessageStream_aborted2, true, "f"); - return this._emit("abort", error42); - } - if (error42 instanceof AnthropicError2) { - return this._emit("error", error42); - } - if (error42 instanceof Error) { - const anthropicError = new AnthropicError2(error42.message); - anthropicError.cause = error42; - return this._emit("error", anthropicError); - } - return this._emit("error", new AnthropicError2(String(error42))); - }); - __classPrivateFieldSet2(this, _BetaMessageStream_connectedPromise2, new Promise((resolve8, reject2) => { - __classPrivateFieldSet2(this, _BetaMessageStream_resolveConnectedPromise2, resolve8, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_rejectConnectedPromise2, reject2, "f"); - }), "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_endPromise2, new Promise((resolve8, reject2) => { - __classPrivateFieldSet2(this, _BetaMessageStream_resolveEndPromise2, resolve8, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_rejectEndPromise2, reject2, "f"); - }), "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_connectedPromise2, "f").catch(() => {}); - __classPrivateFieldGet2(this, _BetaMessageStream_endPromise2, "f").catch(() => {}); - } - get response() { - return __classPrivateFieldGet2(this, _BetaMessageStream_response2, "f"); - } - get request_id() { - return __classPrivateFieldGet2(this, _BetaMessageStream_request_id2, "f"); - } - async withResponse() { - const response = await __classPrivateFieldGet2(this, _BetaMessageStream_connectedPromise2, "f"); - if (!response) { - throw new Error("Could not resolve a `Response` object"); - } - return { - data: this, - response, - request_id: response.headers.get("request-id") - }; - } - static fromReadableStream(stream4) { - const runner = new BetaMessageStream2; - runner._run(() => runner._fromReadableStream(stream4)); - return runner; - } - static createMessage(messages, params, options) { - const runner = new BetaMessageStream2; - for (const message of params.messages) { - runner._addMessageParam(message); - } - runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } })); - return runner; - } - _run(executor) { - executor().then(() => { - this._emitFinal(); - this._emit("end"); - }, __classPrivateFieldGet2(this, _BetaMessageStream_handleError2, "f")); - } - _addMessageParam(message) { - this.messages.push(message); - } - _addMessage(message, emit = true) { - this.receivedMessages.push(message); - if (emit) { - this._emit("message", message); - } - } - async _createMessage(messages, params, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); - } - __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_beginRequest2).call(this); - const { response, data: stream4 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); - this._connected(response); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_addStreamEvent2).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2; - } - __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_endRequest2).call(this); - } - _connected(response) { - if (this.ended) - return; - __classPrivateFieldSet2(this, _BetaMessageStream_response2, response, "f"); - __classPrivateFieldSet2(this, _BetaMessageStream_request_id2, response?.headers.get("request-id"), "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_resolveConnectedPromise2, "f").call(this, response); - this._emit("connect"); - } - get ended() { - return __classPrivateFieldGet2(this, _BetaMessageStream_ended2, "f"); - } - get errored() { - return __classPrivateFieldGet2(this, _BetaMessageStream_errored2, "f"); - } - get aborted() { - return __classPrivateFieldGet2(this, _BetaMessageStream_aborted2, "f"); - } - abort() { - this.controller.abort(); - } - on(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners2, "f")[event] || (__classPrivateFieldGet2(this, _BetaMessageStream_listeners2, "f")[event] = []); - listeners.push({ listener }); - return this; - } - off(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners2, "f")[event]; - if (!listeners) - return this; - const index = listeners.findIndex((l) => l.listener === listener); - if (index >= 0) - listeners.splice(index, 1); - return this; - } - once(event, listener) { - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners2, "f")[event] || (__classPrivateFieldGet2(this, _BetaMessageStream_listeners2, "f")[event] = []); - listeners.push({ listener, once: true }); - return this; - } - emitted(event) { - return new Promise((resolve8, reject2) => { - __classPrivateFieldSet2(this, _BetaMessageStream_catchingPromiseCreated2, true, "f"); - if (event !== "error") - this.once("error", reject2); - this.once(event, resolve8); - }); - } - async done() { - __classPrivateFieldSet2(this, _BetaMessageStream_catchingPromiseCreated2, true, "f"); - await __classPrivateFieldGet2(this, _BetaMessageStream_endPromise2, "f"); - } - get currentMessage() { - return __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot2, "f"); - } - async finalMessage() { - await this.done(); - return __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_getFinalMessage2).call(this); - } - async finalText() { - await this.done(); - return __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_getFinalText2).call(this); - } - _emit(event, ...args) { - if (__classPrivateFieldGet2(this, _BetaMessageStream_ended2, "f")) - return; - if (event === "end") { - __classPrivateFieldSet2(this, _BetaMessageStream_ended2, true, "f"); - __classPrivateFieldGet2(this, _BetaMessageStream_resolveEndPromise2, "f").call(this); - } - const listeners = __classPrivateFieldGet2(this, _BetaMessageStream_listeners2, "f")[event]; - if (listeners) { - __classPrivateFieldGet2(this, _BetaMessageStream_listeners2, "f")[event] = listeners.filter((l) => !l.once); - listeners.forEach(({ listener }) => listener(...args)); - } - if (event === "abort") { - const error42 = args[0]; - if (!__classPrivateFieldGet2(this, _BetaMessageStream_catchingPromiseCreated2, "f") && !listeners?.length) { - Promise.reject(error42); - } - __classPrivateFieldGet2(this, _BetaMessageStream_rejectConnectedPromise2, "f").call(this, error42); - __classPrivateFieldGet2(this, _BetaMessageStream_rejectEndPromise2, "f").call(this, error42); - this._emit("end"); - return; - } - if (event === "error") { - const error42 = args[0]; - if (!__classPrivateFieldGet2(this, _BetaMessageStream_catchingPromiseCreated2, "f") && !listeners?.length) { - Promise.reject(error42); - } - __classPrivateFieldGet2(this, _BetaMessageStream_rejectConnectedPromise2, "f").call(this, error42); - __classPrivateFieldGet2(this, _BetaMessageStream_rejectEndPromise2, "f").call(this, error42); - this._emit("end"); - } - } - _emitFinal() { - const finalMessage = this.receivedMessages.at(-1); - if (finalMessage) { - this._emit("finalMessage", __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_getFinalMessage2).call(this)); - } - } - async _fromReadableStream(readableStream, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); - } - __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_beginRequest2).call(this); - this._connected(null); - const stream4 = Stream2.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_addStreamEvent2).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2; - } - __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_endRequest2).call(this); - } - [(_BetaMessageStream_currentMessageSnapshot2 = new WeakMap, _BetaMessageStream_connectedPromise2 = new WeakMap, _BetaMessageStream_resolveConnectedPromise2 = new WeakMap, _BetaMessageStream_rejectConnectedPromise2 = new WeakMap, _BetaMessageStream_endPromise2 = new WeakMap, _BetaMessageStream_resolveEndPromise2 = new WeakMap, _BetaMessageStream_rejectEndPromise2 = new WeakMap, _BetaMessageStream_listeners2 = new WeakMap, _BetaMessageStream_ended2 = new WeakMap, _BetaMessageStream_errored2 = new WeakMap, _BetaMessageStream_aborted2 = new WeakMap, _BetaMessageStream_catchingPromiseCreated2 = new WeakMap, _BetaMessageStream_response2 = new WeakMap, _BetaMessageStream_request_id2 = new WeakMap, _BetaMessageStream_handleError2 = new WeakMap, _BetaMessageStream_instances2 = new WeakSet, _BetaMessageStream_getFinalMessage2 = function _BetaMessageStream_getFinalMessage() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError2("stream ended without producing a Message with role=assistant"); - } - return this.receivedMessages.at(-1); - }, _BetaMessageStream_getFinalText2 = function _BetaMessageStream_getFinalText() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError2("stream ended without producing a Message with role=assistant"); - } - const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); - if (textBlocks.length === 0) { - throw new AnthropicError2("stream ended without producing a content block with type=text"); - } - return textBlocks.join(" "); - }, _BetaMessageStream_beginRequest2 = function _BetaMessageStream_beginRequest() { - if (this.ended) - return; - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot2, undefined, "f"); - }, _BetaMessageStream_addStreamEvent2 = function _BetaMessageStream_addStreamEvent(event) { - if (this.ended) - return; - const messageSnapshot = __classPrivateFieldGet2(this, _BetaMessageStream_instances2, "m", _BetaMessageStream_accumulateMessage2).call(this, event); - this._emit("streamEvent", event, messageSnapshot); - switch (event.type) { - case "content_block_delta": { - const content = messageSnapshot.content.at(-1); - switch (event.delta.type) { - case "text_delta": { - if (content.type === "text") { - this._emit("text", event.delta.text, content.text || ""); - } - break; - } - case "citations_delta": { - if (content.type === "text") { - this._emit("citation", event.delta.citation, content.citations ?? []); - } - break; - } - case "input_json_delta": { - if ((content.type === "tool_use" || content.type === "mcp_tool_use") && content.input) { - this._emit("inputJson", event.delta.partial_json, content.input); - } - break; - } - case "thinking_delta": { - if (content.type === "thinking") { - this._emit("thinking", event.delta.thinking, content.thinking); - } - break; - } - case "signature_delta": { - if (content.type === "thinking") { - this._emit("signature", content.signature); - } - break; - } - default: - checkNever3(event.delta); - } - break; - } - case "message_stop": { - this._addMessageParam(messageSnapshot); - this._addMessage(messageSnapshot, true); - break; - } - case "content_block_stop": { - this._emit("contentBlock", messageSnapshot.content.at(-1)); - break; - } - case "message_start": { - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot2, messageSnapshot, "f"); - break; - } - case "content_block_start": - case "message_delta": - break; - } - }, _BetaMessageStream_endRequest2 = function _BetaMessageStream_endRequest() { - if (this.ended) { - throw new AnthropicError2(`stream has ended, this shouldn't happen`); - } - const snapshot = __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot2, "f"); - if (!snapshot) { - throw new AnthropicError2(`request ended without sending any chunks`); - } - __classPrivateFieldSet2(this, _BetaMessageStream_currentMessageSnapshot2, undefined, "f"); - return snapshot; - }, _BetaMessageStream_accumulateMessage2 = function _BetaMessageStream_accumulateMessage(event) { - let snapshot = __classPrivateFieldGet2(this, _BetaMessageStream_currentMessageSnapshot2, "f"); - if (event.type === "message_start") { - if (snapshot) { - throw new AnthropicError2(`Unexpected event order, got ${event.type} before receiving "message_stop"`); - } - return event.message; - } - if (!snapshot) { - throw new AnthropicError2(`Unexpected event order, got ${event.type} before "message_start"`); - } - switch (event.type) { - case "message_stop": - return snapshot; - case "message_delta": - snapshot.container = event.delta.container; - snapshot.stop_reason = event.delta.stop_reason; - snapshot.stop_sequence = event.delta.stop_sequence; - snapshot.usage.output_tokens = event.usage.output_tokens; - if (event.usage.input_tokens != null) { - snapshot.usage.input_tokens = event.usage.input_tokens; - } - if (event.usage.cache_creation_input_tokens != null) { - snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; - } - if (event.usage.cache_read_input_tokens != null) { - snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; - } - if (event.usage.server_tool_use != null) { - snapshot.usage.server_tool_use = event.usage.server_tool_use; - } - return snapshot; - case "content_block_start": - snapshot.content.push(event.content_block); - return snapshot; - case "content_block_delta": { - const snapshotContent = snapshot.content.at(event.index); - switch (event.delta.type) { - case "text_delta": { - if (snapshotContent?.type === "text") { - snapshotContent.text += event.delta.text; - } - break; - } - case "citations_delta": { - if (snapshotContent?.type === "text") { - snapshotContent.citations ?? (snapshotContent.citations = []); - snapshotContent.citations.push(event.delta.citation); - } - break; - } - case "input_json_delta": { - if (snapshotContent?.type === "tool_use" || snapshotContent?.type === "mcp_tool_use") { - let jsonBuf = snapshotContent[JSON_BUF_PROPERTY3] || ""; - jsonBuf += event.delta.partial_json; - Object.defineProperty(snapshotContent, JSON_BUF_PROPERTY3, { - value: jsonBuf, - enumerable: false, - writable: true - }); - if (jsonBuf) { - snapshotContent.input = partialParse2(jsonBuf); - } - } - break; - } - case "thinking_delta": { - if (snapshotContent?.type === "thinking") { - snapshotContent.thinking += event.delta.thinking; - } - break; - } - case "signature_delta": { - if (snapshotContent?.type === "thinking") { - snapshotContent.signature = event.delta.signature; - } - break; - } - default: - checkNever3(event.delta); - } - return snapshot; - } - case "content_block_stop": - return snapshot; - } - }, Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("streamEvent", (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(undefined); - } - 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: undefined, done: true }; - } - return new Promise((resolve8, reject2) => readQueue.push({ resolve: resolve8, reject: reject2 })).then((chunk3) => chunk3 ? { value: chunk3, done: false } : { value: undefined, done: true }); - } - const chunk2 = pushQueue.shift(); - return { value: chunk2, done: false }; - }, - return: async () => { - this.abort(); - return { value: undefined, done: true }; - } - }; - } - toReadableStream() { - const stream4 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/internal/constants.mjs -var MODEL_NONSTREAMING_TOKENS2; -var init_constants5 = __esm(() => { - MODEL_NONSTREAMING_TOKENS2 = { - "claude-opus-4-20250514": 8192, - "claude-opus-4-0": 8192, - "claude-4-opus-20250514": 8192, - "anthropic.claude-opus-4-20250514-v1:0": 8192, - "claude-opus-4@20250514": 8192 - }; -}); - -// ../node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs -var DEPRECATED_MODELS3, Messages3; -var init_messages3 = __esm(() => { - init_batches3(); - init_batches3(); - init_headers2(); - init_BetaMessageStream2(); - init_constants5(); - DEPRECATED_MODELS3 = { - "claude-1.3": "November 6th, 2024", - "claude-1.3-100k": "November 6th, 2024", - "claude-instant-1.1": "November 6th, 2024", - "claude-instant-1.1-100k": "November 6th, 2024", - "claude-instant-1.2": "November 6th, 2024", - "claude-3-sonnet-20240229": "July 21st, 2025", - "claude-2.1": "July 21st, 2025", - "claude-2.0": "July 21st, 2025" - }; - Messages3 = class Messages3 extends APIResource2 { - constructor() { - super(...arguments); - this.batches = new Batches3(this._client); - } - create(params, options) { - const { betas, ...body } = params; - if (body.model in DEPRECATED_MODELS3) { - console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS3[body.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); - } - let timeout = this._client._options.timeout; - if (!body.stream && timeout == null) { - const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS2[body.model] ?? undefined; - timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); - } - return this._client.post("/v1/messages?beta=true", { - body, - timeout: timeout ?? 600000, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : undefined }, - options?.headers - ]), - stream: params.stream ?? false - }); - } - stream(body, options) { - return BetaMessageStream2.createMessage(this, body, options); - } - countTokens(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/messages/count_tokens?beta=true", { - body, - ...options, - headers: buildHeaders2([ - { "anthropic-beta": [...betas ?? [], "token-counting-2024-11-01"].toString() }, - options?.headers - ]) - }); - } - }; - Messages3.Batches = Batches3; -}); - -// ../node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs -var Beta2; -var init_beta2 = __esm(() => { - init_files3(); - init_files3(); - init_models3(); - init_models3(); - init_messages3(); - init_messages3(); - Beta2 = class Beta2 extends APIResource2 { - constructor() { - super(...arguments); - this.models = new Models3(this._client); - this.messages = new Messages3(this._client); - this.files = new Files2(this._client); - } - }; - Beta2.Models = Models3; - Beta2.Messages = Messages3; - Beta2.Files = Files2; -}); - -// ../node_modules/@anthropic-ai/sdk/resources/completions.mjs -var Completions2; -var init_completions2 = __esm(() => { - init_headers2(); - Completions2 = class Completions2 extends APIResource2 { - create(params, options) { - const { betas, ...body } = params; - return this._client.post("/v1/complete", { - body, - timeout: this._client._options.timeout ?? 600000, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : undefined }, - options?.headers - ]), - stream: params.stream ?? false - }); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs -function checkNever4(x2) {} -var _MessageStream_instances2, _MessageStream_currentMessageSnapshot2, _MessageStream_connectedPromise2, _MessageStream_resolveConnectedPromise2, _MessageStream_rejectConnectedPromise2, _MessageStream_endPromise2, _MessageStream_resolveEndPromise2, _MessageStream_rejectEndPromise2, _MessageStream_listeners2, _MessageStream_ended2, _MessageStream_errored2, _MessageStream_aborted2, _MessageStream_catchingPromiseCreated2, _MessageStream_response2, _MessageStream_request_id2, _MessageStream_getFinalMessage2, _MessageStream_getFinalText2, _MessageStream_handleError2, _MessageStream_beginRequest2, _MessageStream_addStreamEvent2, _MessageStream_endRequest2, _MessageStream_accumulateMessage2, JSON_BUF_PROPERTY4 = "__json_buf", MessageStream2; -var init_MessageStream2 = __esm(() => { - init_tslib2(); - init_error5(); - init_streaming5(); - init_parser3(); - MessageStream2 = class MessageStream2 { - constructor() { - _MessageStream_instances2.add(this); - this.messages = []; - this.receivedMessages = []; - _MessageStream_currentMessageSnapshot2.set(this, undefined); - this.controller = new AbortController; - _MessageStream_connectedPromise2.set(this, undefined); - _MessageStream_resolveConnectedPromise2.set(this, () => {}); - _MessageStream_rejectConnectedPromise2.set(this, () => {}); - _MessageStream_endPromise2.set(this, undefined); - _MessageStream_resolveEndPromise2.set(this, () => {}); - _MessageStream_rejectEndPromise2.set(this, () => {}); - _MessageStream_listeners2.set(this, {}); - _MessageStream_ended2.set(this, false); - _MessageStream_errored2.set(this, false); - _MessageStream_aborted2.set(this, false); - _MessageStream_catchingPromiseCreated2.set(this, false); - _MessageStream_response2.set(this, undefined); - _MessageStream_request_id2.set(this, undefined); - _MessageStream_handleError2.set(this, (error42) => { - __classPrivateFieldSet2(this, _MessageStream_errored2, true, "f"); - if (isAbortError4(error42)) { - error42 = new APIUserAbortError2; - } - if (error42 instanceof APIUserAbortError2) { - __classPrivateFieldSet2(this, _MessageStream_aborted2, true, "f"); - return this._emit("abort", error42); - } - if (error42 instanceof AnthropicError2) { - return this._emit("error", error42); - } - if (error42 instanceof Error) { - const anthropicError = new AnthropicError2(error42.message); - anthropicError.cause = error42; - return this._emit("error", anthropicError); - } - return this._emit("error", new AnthropicError2(String(error42))); - }); - __classPrivateFieldSet2(this, _MessageStream_connectedPromise2, new Promise((resolve8, reject2) => { - __classPrivateFieldSet2(this, _MessageStream_resolveConnectedPromise2, resolve8, "f"); - __classPrivateFieldSet2(this, _MessageStream_rejectConnectedPromise2, reject2, "f"); - }), "f"); - __classPrivateFieldSet2(this, _MessageStream_endPromise2, new Promise((resolve8, reject2) => { - __classPrivateFieldSet2(this, _MessageStream_resolveEndPromise2, resolve8, "f"); - __classPrivateFieldSet2(this, _MessageStream_rejectEndPromise2, reject2, "f"); - }), "f"); - __classPrivateFieldGet2(this, _MessageStream_connectedPromise2, "f").catch(() => {}); - __classPrivateFieldGet2(this, _MessageStream_endPromise2, "f").catch(() => {}); - } - get response() { - return __classPrivateFieldGet2(this, _MessageStream_response2, "f"); - } - get request_id() { - return __classPrivateFieldGet2(this, _MessageStream_request_id2, "f"); - } - async withResponse() { - const response = await __classPrivateFieldGet2(this, _MessageStream_connectedPromise2, "f"); - if (!response) { - throw new Error("Could not resolve a `Response` object"); - } - return { - data: this, - response, - request_id: response.headers.get("request-id") - }; - } - static fromReadableStream(stream4) { - const runner = new MessageStream2; - runner._run(() => runner._fromReadableStream(stream4)); - return runner; - } - static createMessage(messages, params, options) { - const runner = new MessageStream2; - for (const message of params.messages) { - runner._addMessageParam(message); - } - runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } })); - return runner; - } - _run(executor) { - executor().then(() => { - this._emitFinal(); - this._emit("end"); - }, __classPrivateFieldGet2(this, _MessageStream_handleError2, "f")); - } - _addMessageParam(message) { - this.messages.push(message); - } - _addMessage(message, emit = true) { - this.receivedMessages.push(message); - if (emit) { - this._emit("message", message); - } - } - async _createMessage(messages, params, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); - } - __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_beginRequest2).call(this); - const { response, data: stream4 } = await messages.create({ ...params, stream: true }, { ...options, signal: this.controller.signal }).withResponse(); - this._connected(response); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_addStreamEvent2).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2; - } - __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_endRequest2).call(this); - } - _connected(response) { - if (this.ended) - return; - __classPrivateFieldSet2(this, _MessageStream_response2, response, "f"); - __classPrivateFieldSet2(this, _MessageStream_request_id2, response?.headers.get("request-id"), "f"); - __classPrivateFieldGet2(this, _MessageStream_resolveConnectedPromise2, "f").call(this, response); - this._emit("connect"); - } - get ended() { - return __classPrivateFieldGet2(this, _MessageStream_ended2, "f"); - } - get errored() { - return __classPrivateFieldGet2(this, _MessageStream_errored2, "f"); - } - get aborted() { - return __classPrivateFieldGet2(this, _MessageStream_aborted2, "f"); - } - abort() { - this.controller.abort(); - } - on(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners2, "f")[event] || (__classPrivateFieldGet2(this, _MessageStream_listeners2, "f")[event] = []); - listeners.push({ listener }); - return this; - } - off(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners2, "f")[event]; - if (!listeners) - return this; - const index = listeners.findIndex((l) => l.listener === listener); - if (index >= 0) - listeners.splice(index, 1); - return this; - } - once(event, listener) { - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners2, "f")[event] || (__classPrivateFieldGet2(this, _MessageStream_listeners2, "f")[event] = []); - listeners.push({ listener, once: true }); - return this; - } - emitted(event) { - return new Promise((resolve8, reject2) => { - __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated2, true, "f"); - if (event !== "error") - this.once("error", reject2); - this.once(event, resolve8); - }); - } - async done() { - __classPrivateFieldSet2(this, _MessageStream_catchingPromiseCreated2, true, "f"); - await __classPrivateFieldGet2(this, _MessageStream_endPromise2, "f"); - } - get currentMessage() { - return __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot2, "f"); - } - async finalMessage() { - await this.done(); - return __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_getFinalMessage2).call(this); - } - async finalText() { - await this.done(); - return __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_getFinalText2).call(this); - } - _emit(event, ...args) { - if (__classPrivateFieldGet2(this, _MessageStream_ended2, "f")) - return; - if (event === "end") { - __classPrivateFieldSet2(this, _MessageStream_ended2, true, "f"); - __classPrivateFieldGet2(this, _MessageStream_resolveEndPromise2, "f").call(this); - } - const listeners = __classPrivateFieldGet2(this, _MessageStream_listeners2, "f")[event]; - if (listeners) { - __classPrivateFieldGet2(this, _MessageStream_listeners2, "f")[event] = listeners.filter((l) => !l.once); - listeners.forEach(({ listener }) => listener(...args)); - } - if (event === "abort") { - const error42 = args[0]; - if (!__classPrivateFieldGet2(this, _MessageStream_catchingPromiseCreated2, "f") && !listeners?.length) { - Promise.reject(error42); - } - __classPrivateFieldGet2(this, _MessageStream_rejectConnectedPromise2, "f").call(this, error42); - __classPrivateFieldGet2(this, _MessageStream_rejectEndPromise2, "f").call(this, error42); - this._emit("end"); - return; - } - if (event === "error") { - const error42 = args[0]; - if (!__classPrivateFieldGet2(this, _MessageStream_catchingPromiseCreated2, "f") && !listeners?.length) { - Promise.reject(error42); - } - __classPrivateFieldGet2(this, _MessageStream_rejectConnectedPromise2, "f").call(this, error42); - __classPrivateFieldGet2(this, _MessageStream_rejectEndPromise2, "f").call(this, error42); - this._emit("end"); - } - } - _emitFinal() { - const finalMessage = this.receivedMessages.at(-1); - if (finalMessage) { - this._emit("finalMessage", __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_getFinalMessage2).call(this)); - } - } - async _fromReadableStream(readableStream, options) { - const signal = options?.signal; - if (signal) { - if (signal.aborted) - this.controller.abort(); - signal.addEventListener("abort", () => this.controller.abort()); - } - __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_beginRequest2).call(this); - this._connected(null); - const stream4 = Stream2.fromReadableStream(readableStream, this.controller); - for await (const event of stream4) { - __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_addStreamEvent2).call(this, event); - } - if (stream4.controller.signal?.aborted) { - throw new APIUserAbortError2; - } - __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_endRequest2).call(this); - } - [(_MessageStream_currentMessageSnapshot2 = new WeakMap, _MessageStream_connectedPromise2 = new WeakMap, _MessageStream_resolveConnectedPromise2 = new WeakMap, _MessageStream_rejectConnectedPromise2 = new WeakMap, _MessageStream_endPromise2 = new WeakMap, _MessageStream_resolveEndPromise2 = new WeakMap, _MessageStream_rejectEndPromise2 = new WeakMap, _MessageStream_listeners2 = new WeakMap, _MessageStream_ended2 = new WeakMap, _MessageStream_errored2 = new WeakMap, _MessageStream_aborted2 = new WeakMap, _MessageStream_catchingPromiseCreated2 = new WeakMap, _MessageStream_response2 = new WeakMap, _MessageStream_request_id2 = new WeakMap, _MessageStream_handleError2 = new WeakMap, _MessageStream_instances2 = new WeakSet, _MessageStream_getFinalMessage2 = function _MessageStream_getFinalMessage() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError2("stream ended without producing a Message with role=assistant"); - } - return this.receivedMessages.at(-1); - }, _MessageStream_getFinalText2 = function _MessageStream_getFinalText() { - if (this.receivedMessages.length === 0) { - throw new AnthropicError2("stream ended without producing a Message with role=assistant"); - } - const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); - if (textBlocks.length === 0) { - throw new AnthropicError2("stream ended without producing a content block with type=text"); - } - return textBlocks.join(" "); - }, _MessageStream_beginRequest2 = function _MessageStream_beginRequest() { - if (this.ended) - return; - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot2, undefined, "f"); - }, _MessageStream_addStreamEvent2 = function _MessageStream_addStreamEvent(event) { - if (this.ended) - return; - const messageSnapshot = __classPrivateFieldGet2(this, _MessageStream_instances2, "m", _MessageStream_accumulateMessage2).call(this, event); - this._emit("streamEvent", event, messageSnapshot); - switch (event.type) { - case "content_block_delta": { - const content = messageSnapshot.content.at(-1); - switch (event.delta.type) { - case "text_delta": { - if (content.type === "text") { - this._emit("text", event.delta.text, content.text || ""); - } - break; - } - case "citations_delta": { - if (content.type === "text") { - this._emit("citation", event.delta.citation, content.citations ?? []); - } - break; - } - case "input_json_delta": { - if (content.type === "tool_use" && content.input) { - this._emit("inputJson", event.delta.partial_json, content.input); - } - break; - } - case "thinking_delta": { - if (content.type === "thinking") { - this._emit("thinking", event.delta.thinking, content.thinking); - } - break; - } - case "signature_delta": { - if (content.type === "thinking") { - this._emit("signature", content.signature); - } - break; - } - default: - checkNever4(event.delta); - } - break; - } - case "message_stop": { - this._addMessageParam(messageSnapshot); - this._addMessage(messageSnapshot, true); - break; - } - case "content_block_stop": { - this._emit("contentBlock", messageSnapshot.content.at(-1)); - break; - } - case "message_start": { - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot2, messageSnapshot, "f"); - break; - } - case "content_block_start": - case "message_delta": - break; - } - }, _MessageStream_endRequest2 = function _MessageStream_endRequest() { - if (this.ended) { - throw new AnthropicError2(`stream has ended, this shouldn't happen`); - } - const snapshot = __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot2, "f"); - if (!snapshot) { - throw new AnthropicError2(`request ended without sending any chunks`); - } - __classPrivateFieldSet2(this, _MessageStream_currentMessageSnapshot2, undefined, "f"); - return snapshot; - }, _MessageStream_accumulateMessage2 = function _MessageStream_accumulateMessage(event) { - let snapshot = __classPrivateFieldGet2(this, _MessageStream_currentMessageSnapshot2, "f"); - if (event.type === "message_start") { - if (snapshot) { - throw new AnthropicError2(`Unexpected event order, got ${event.type} before receiving "message_stop"`); - } - return event.message; - } - if (!snapshot) { - throw new AnthropicError2(`Unexpected event order, got ${event.type} before "message_start"`); - } - switch (event.type) { - case "message_stop": - return snapshot; - case "message_delta": - snapshot.stop_reason = event.delta.stop_reason; - snapshot.stop_sequence = event.delta.stop_sequence; - snapshot.usage.output_tokens = event.usage.output_tokens; - if (event.usage.input_tokens != null) { - snapshot.usage.input_tokens = event.usage.input_tokens; - } - if (event.usage.cache_creation_input_tokens != null) { - snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens; - } - if (event.usage.cache_read_input_tokens != null) { - snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens; - } - if (event.usage.server_tool_use != null) { - snapshot.usage.server_tool_use = event.usage.server_tool_use; - } - return snapshot; - case "content_block_start": - snapshot.content.push(event.content_block); - return snapshot; - case "content_block_delta": { - const snapshotContent = snapshot.content.at(event.index); - switch (event.delta.type) { - case "text_delta": { - if (snapshotContent?.type === "text") { - snapshotContent.text += event.delta.text; - } - break; - } - case "citations_delta": { - if (snapshotContent?.type === "text") { - snapshotContent.citations ?? (snapshotContent.citations = []); - snapshotContent.citations.push(event.delta.citation); - } - break; - } - case "input_json_delta": { - if (snapshotContent?.type === "tool_use") { - let jsonBuf = snapshotContent[JSON_BUF_PROPERTY4] || ""; - jsonBuf += event.delta.partial_json; - Object.defineProperty(snapshotContent, JSON_BUF_PROPERTY4, { - value: jsonBuf, - enumerable: false, - writable: true - }); - if (jsonBuf) { - snapshotContent.input = partialParse2(jsonBuf); - } - } - break; - } - case "thinking_delta": { - if (snapshotContent?.type === "thinking") { - snapshotContent.thinking += event.delta.thinking; - } - break; - } - case "signature_delta": { - if (snapshotContent?.type === "thinking") { - snapshotContent.signature = event.delta.signature; - } - break; - } - default: - checkNever4(event.delta); - } - return snapshot; - } - case "content_block_stop": - return snapshot; - } - }, Symbol.asyncIterator)]() { - const pushQueue = []; - const readQueue = []; - let done = false; - this.on("streamEvent", (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(undefined); - } - 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: undefined, done: true }; - } - return new Promise((resolve8, reject2) => readQueue.push({ resolve: resolve8, reject: reject2 })).then((chunk3) => chunk3 ? { value: chunk3, done: false } : { value: undefined, done: true }); - } - const chunk2 = pushQueue.shift(); - return { value: chunk2, done: false }; - }, - return: async () => { - this.abort(); - return { value: undefined, done: true }; - } - }; - } - toReadableStream() { - const stream4 = new Stream2(this[Symbol.asyncIterator].bind(this), this.controller); - return stream4.toReadableStream(); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs -var Batches4; -var init_batches4 = __esm(() => { - init_pagination2(); - init_headers2(); - init_jsonl2(); - init_error5(); - init_path3(); - Batches4 = class Batches4 extends APIResource2 { - create(body, options) { - return this._client.post("/v1/messages/batches", { body, ...options }); - } - retrieve(messageBatchID, options) { - return this._client.get(path9`/v1/messages/batches/${messageBatchID}`, options); - } - list(query = {}, options) { - return this._client.getAPIList("/v1/messages/batches", Page2, { query, ...options }); - } - delete(messageBatchID, options) { - return this._client.delete(path9`/v1/messages/batches/${messageBatchID}`, options); - } - cancel(messageBatchID, options) { - return this._client.post(path9`/v1/messages/batches/${messageBatchID}/cancel`, options); - } - async results(messageBatchID, options) { - const batch = await this.retrieve(messageBatchID); - if (!batch.results_url) { - throw new AnthropicError2(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`); - } - return this._client.get(batch.results_url, { - ...options, - headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]), - stream: true, - __binaryResponse: true - })._thenUnwrap((_, props) => JSONLDecoder2.fromResponse(props.response, props.controller)); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs -var Messages4, DEPRECATED_MODELS4; -var init_messages4 = __esm(() => { - init_MessageStream2(); - init_batches4(); - init_batches4(); - init_constants5(); - Messages4 = class Messages4 extends APIResource2 { - constructor() { - super(...arguments); - this.batches = new Batches4(this._client); - } - create(body, options) { - if (body.model in DEPRECATED_MODELS4) { - console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS4[body.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`); - } - let timeout = this._client._options.timeout; - if (!body.stream && timeout == null) { - const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS2[body.model] ?? undefined; - timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens); - } - return this._client.post("/v1/messages", { - body, - timeout: timeout ?? 600000, - ...options, - stream: body.stream ?? false - }); - } - stream(body, options) { - return MessageStream2.createMessage(this, body, options); - } - countTokens(body, options) { - return this._client.post("/v1/messages/count_tokens", { body, ...options }); - } - }; - DEPRECATED_MODELS4 = { - "claude-1.3": "November 6th, 2024", - "claude-1.3-100k": "November 6th, 2024", - "claude-instant-1.1": "November 6th, 2024", - "claude-instant-1.1-100k": "November 6th, 2024", - "claude-instant-1.2": "November 6th, 2024", - "claude-3-sonnet-20240229": "July 21st, 2025", - "claude-2.1": "July 21st, 2025", - "claude-2.0": "July 21st, 2025" - }; - Messages4.Batches = Batches4; -}); - -// ../node_modules/@anthropic-ai/sdk/resources/models.mjs -var Models4; -var init_models4 = __esm(() => { - init_pagination2(); - init_headers2(); - init_path3(); - Models4 = class Models4 extends APIResource2 { - retrieve(modelID, params = {}, options) { - const { betas } = params ?? {}; - return this._client.get(path9`/v1/models/${modelID}`, { - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : undefined }, - options?.headers - ]) - }); - } - list(params = {}, options) { - const { betas, ...query } = params ?? {}; - return this._client.getAPIList("/v1/models", Page2, { - query, - ...options, - headers: buildHeaders2([ - { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : undefined }, - options?.headers - ]) - }); - } - }; -}); - -// ../node_modules/@anthropic-ai/sdk/resources/index.mjs -var init_resources2 = __esm(() => { - init_shared3(); - init_beta2(); - init_completions2(); - init_messages4(); - init_models4(); -}); - -// ../node_modules/@anthropic-ai/sdk/internal/utils/env.mjs -var readEnv2 = (env4) => { - if (typeof globalThis.process !== "undefined") { - return globalThis.process.env?.[env4]?.trim() ?? undefined; - } - if (typeof globalThis.Deno !== "undefined") { - return globalThis.Deno.env?.get?.(env4)?.trim(); - } - return; -}; - -// ../node_modules/@anthropic-ai/sdk/client.mjs -class BaseAnthropic2 { - constructor({ baseURL = readEnv2("ANTHROPIC_BASE_URL"), apiKey = readEnv2("ANTHROPIC_API_KEY") ?? null, authToken = readEnv2("ANTHROPIC_AUTH_TOKEN") ?? null, ...opts } = {}) { - _BaseAnthropic_encoder2.set(this, undefined); - const options = { - apiKey, - authToken, - ...opts, - baseURL: baseURL || `https://api.anthropic.com` - }; - if (!options.dangerouslyAllowBrowser && isRunningInBrowser2()) { - throw new AnthropicError2(`It looks like you're running in a browser-like environment. - -This is disabled by default, as it risks exposing your secret API credentials to attackers. -If you understand the risks and have appropriate mitigations in place, -you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., - -new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`); - } - this.baseURL = options.baseURL; - this.timeout = options.timeout ?? Anthropic2.DEFAULT_TIMEOUT; - this.logger = options.logger ?? console; - const defaultLogLevel = "warn"; - this.logLevel = defaultLogLevel; - this.logLevel = parseLogLevel2(options.logLevel, "ClientOptions.logLevel", this) ?? parseLogLevel2(readEnv2("ANTHROPIC_LOG"), "process.env['ANTHROPIC_LOG']", this) ?? defaultLogLevel; - this.fetchOptions = options.fetchOptions; - this.maxRetries = options.maxRetries ?? 2; - this.fetch = options.fetch ?? getDefaultFetch2(); - __classPrivateFieldSet2(this, _BaseAnthropic_encoder2, FallbackEncoder2, "f"); - this._options = options; - this.apiKey = apiKey; - this.authToken = authToken; - } - withOptions(options) { - return new this.constructor({ - ...this._options, - baseURL: this.baseURL, - maxRetries: this.maxRetries, - timeout: this.timeout, - logger: this.logger, - logLevel: this.logLevel, - fetchOptions: this.fetchOptions, - apiKey: this.apiKey, - authToken: this.authToken, - ...options - }); - } - defaultQuery() { - return this._options.defaultQuery; - } - validateHeaders({ values: values2, nulls }) { - if (this.apiKey && values2.get("x-api-key")) { - return; - } - if (nulls.has("x-api-key")) { - return; - } - if (this.authToken && values2.get("authorization")) { - return; - } - if (nulls.has("authorization")) { - 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) { - return buildHeaders2([this.apiKeyAuth(opts), this.bearerAuth(opts)]); - } - apiKeyAuth(opts) { - if (this.apiKey == null) { - return; - } - return buildHeaders2([{ "X-Api-Key": this.apiKey }]); - } - bearerAuth(opts) { - if (this.authToken == null) { - return; - } - return buildHeaders2([{ Authorization: `Bearer ${this.authToken}` }]); - } - stringifyQuery(query) { - return Object.entries(query).filter(([_, value]) => typeof value !== "undefined").map(([key, value]) => { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; - } - if (value === null) { - return `${encodeURIComponent(key)}=`; - } - throw new AnthropicError2(`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("&"); - } - getUserAgent() { - return `${this.constructor.name}/JS ${VERSION5}`; - } - defaultIdempotencyKey() { - return `stainless-node-retry-${uuid43()}`; - } - makeStatusError(status, error42, message, headers) { - return APIError2.generate(status, error42, message, headers); - } - buildURL(path10, query) { - const url3 = isAbsoluteURL3(path10) ? new URL(path10) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path10.startsWith("/") ? path10.slice(1) : path10)); - const defaultQuery = this.defaultQuery(); - if (!isEmptyObj2(defaultQuery)) { - query = { ...defaultQuery, ...query }; - } - if (typeof query === "object" && query && !Array.isArray(query)) { - url3.search = this.stringifyQuery(query); - } - return url3.toString(); - } - _calculateNonstreamingTimeout(maxTokens) { - const defaultTimeout = 10 * 60; - const expectedTimeout = 60 * 60 * maxTokens / 128000; - if (expectedTimeout > defaultTimeout) { - throw new AnthropicError2("Streaming is strongly recommended for operations that may take longer than 10 minutes. " + "See https://github.com/anthropics/anthropic-sdk-python#streaming-responses for more details"); - } - return defaultTimeout * 1000; - } - async prepareOptions(options) {} - async prepareRequest(request, { url: url3, 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(method2, path10, opts) { - return this.request(Promise.resolve(opts).then((opts2) => { - return { method: method2, path: path10, ...opts2 }; - })); - } - request(options, remainingRetries = null) { - return new APIPromise2(this, this.makeRequest(options, remainingRetries, undefined)); - } - 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: url3, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining }); - await this.prepareRequest(req, { url: url3, options }); - const requestLogID = "log_" + (Math.random() * (1 << 24) | 0).toString(16).padStart(6, "0"); - const retryLogStr = retryOfRequestLogID === undefined ? "" : `, retryOf: ${retryOfRequestLogID}`; - const startTime = Date.now(); - loggerFor2(this).debug(`[${requestLogID}] sending request`, formatRequestDetails2({ - retryOfRequestLogID, - method: options.method, - url: url3, - options, - headers: req.headers - })); - if (options.signal?.aborted) { - throw new APIUserAbortError2; - } - const controller = new AbortController; - const response = await this.fetchWithTimeout(url3, req, timeout, controller).catch(castToError2); - const headersTime = Date.now(); - if (response instanceof Error) { - const retryMessage = `retrying, ${retriesRemaining} attempts remaining`; - if (options.signal?.aborted) { - throw new APIUserAbortError2; - } - const isTimeout = isAbortError4(response) || /timed? ?out/i.test(String(response) + ("cause" in response ? String(response.cause) : "")); - if (retriesRemaining) { - loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - ${retryMessage}`); - loggerFor2(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (${retryMessage})`, formatRequestDetails2({ - retryOfRequestLogID, - url: url3, - durationMs: headersTime - startTime, - message: response.message - })); - return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID); - } - loggerFor2(this).info(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} - error; no more retries left`); - loggerFor2(this).debug(`[${requestLogID}] connection ${isTimeout ? "timed out" : "failed"} (error; no more retries left)`, formatRequestDetails2({ - retryOfRequestLogID, - url: url3, - durationMs: headersTime - startTime, - message: response.message - })); - if (isTimeout) { - throw new APIConnectionTimeoutError2; - } - throw new APIConnectionError2({ cause: response }); - } - const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "request-id").map(([name, value]) => ", " + name + ": " + JSON.stringify(value)).join(""); - const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url3} ${response.ok ? "succeeded" : "failed"} with status ${response.status} in ${headersTime - startTime}ms`; - if (!response.ok) { - const shouldRetry = this.shouldRetry(response); - if (retriesRemaining && shouldRetry) { - const retryMessage2 = `retrying, ${retriesRemaining} attempts remaining`; - await CancelReadableStream2(response.body); - loggerFor2(this).info(`${responseInfo} - ${retryMessage2}`); - loggerFor2(this).debug(`[${requestLogID}] response error (${retryMessage2})`, formatRequestDetails2({ - 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`; - loggerFor2(this).info(`${responseInfo} - ${retryMessage}`); - const errText = await response.text().catch((err2) => castToError2(err2).message); - const errJSON = safeJSON2(errText); - const errMessage = errJSON ? undefined : errText; - loggerFor2(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails2({ - 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; - } - loggerFor2(this).info(responseInfo); - loggerFor2(this).debug(`[${requestLogID}] response start`, formatRequestDetails2({ - retryOfRequestLogID, - url: response.url, - status: response.status, - headers: response.headers, - durationMs: headersTime - startTime - })); - return { response, options, controller, requestLogID, retryOfRequestLogID, startTime }; - } - getAPIList(path10, Page3, opts) { - return this.requestAPIList(Page3, { method: "get", path: path10, ...opts }); - } - requestAPIList(Page3, options) { - const request = this.makeRequest(options, null, undefined); - return new PagePromise2(this, request, Page3); - } - async fetchWithTimeout(url3, init, ms, controller) { - const { signal, method: method2, ...options } = init || {}; - if (signal) - signal.addEventListener("abort", () => controller.abort()); - const timeout = setTimeout(() => controller.abort(), ms); - 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 (method2) { - fetchOptions.method = method2.toUpperCase(); - } - try { - return await this.fetch.call(undefined, url3, fetchOptions); - } finally { - clearTimeout(timeout); - } - } - shouldRetry(response) { - const shouldRetryHeader = response.headers.get("x-should-retry"); - if (shouldRetryHeader === "true") - return true; - if (shouldRetryHeader === "false") - return false; - if (response.status === 408) - return true; - if (response.status === 409) - return true; - if (response.status === 429) - return true; - if (response.status >= 500) - return true; - return false; - } - async retryRequest(options, retriesRemaining, requestLogID, responseHeaders) { - let timeoutMillis; - const retryAfterMillisHeader = responseHeaders?.get("retry-after-ms"); - if (retryAfterMillisHeader) { - const timeoutMs = parseFloat(retryAfterMillisHeader); - if (!Number.isNaN(timeoutMs)) { - timeoutMillis = timeoutMs; - } - } - const retryAfterHeader = responseHeaders?.get("retry-after"); - if (retryAfterHeader && !timeoutMillis) { - const timeoutSeconds = parseFloat(retryAfterHeader); - if (!Number.isNaN(timeoutSeconds)) { - timeoutMillis = timeoutSeconds * 1000; - } else { - timeoutMillis = Date.parse(retryAfterHeader) - Date.now(); - } - } - if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) { - const maxRetries = options.maxRetries ?? this.maxRetries; - timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); - } - await sleep2(timeoutMillis); - return this.makeRequest(options, retriesRemaining - 1, requestLogID); - } - calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) { - const initialRetryDelay = 0.5; - const maxRetryDelay = 8; - const numRetries = maxRetries - retriesRemaining; - const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay); - const jitter = 1 - Math.random() * 0.25; - return sleepSeconds * jitter * 1000; - } - calculateNonstreamingTimeout(maxTokens, maxNonstreamingTokens) { - const maxTime = 60 * 60 * 1000; - const defaultTime = 60 * 10 * 1000; - const expectedTime = maxTime * maxTokens / 128000; - if (expectedTime > defaultTime || maxNonstreamingTokens != null && maxTokens > maxNonstreamingTokens) { - throw new AnthropicError2("Streaming is strongly recommended for operations that may token longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details"); - } - return defaultTime; - } - buildRequest(inputOptions, { retryCount = 0 } = {}) { - const options = { ...inputOptions }; - const { method: method2, path: path10, query } = options; - const url3 = this.buildURL(path10, query); - if ("timeout" in options) - validatePositiveInteger2("timeout", options.timeout); - options.timeout = options.timeout ?? this.timeout; - const { bodyHeaders, body } = this.buildBody({ options }); - const reqHeaders = this.buildHeaders({ options: inputOptions, method: method2, bodyHeaders, retryCount }); - const req = { - method: method2, - headers: reqHeaders, - ...options.signal && { signal: options.signal }, - ...globalThis.ReadableStream && body instanceof globalThis.ReadableStream && { duplex: "half" }, - ...body && { body }, - ...this.fetchOptions ?? {}, - ...options.fetchOptions ?? {} - }; - return { req, url: url3, timeout: options.timeout }; - } - buildHeaders({ options, method: method2, bodyHeaders, retryCount }) { - let idempotencyHeaders = {}; - if (this.idempotencyHeader && method2 !== "get") { - if (!options.idempotencyKey) - options.idempotencyKey = this.defaultIdempotencyKey(); - idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey; - } - const headers = buildHeaders2([ - idempotencyHeaders, - { - Accept: "application/json", - "User-Agent": this.getUserAgent(), - "X-Stainless-Retry-Count": String(retryCount), - ...options.timeout ? { "X-Stainless-Timeout": String(Math.trunc(options.timeout / 1000)) } : {}, - ...getPlatformHeaders2(), - ...this._options.dangerouslyAllowBrowser ? { "anthropic-dangerous-direct-browser-access": "true" } : undefined, - "anthropic-version": "2023-06-01" - }, - this.authHeaders(options), - this._options.defaultHeaders, - bodyHeaders, - options.headers - ]); - this.validateHeaders(headers); - return headers.values; - } - buildBody({ options: { body, headers: rawHeaders } }) { - if (!body) { - return { bodyHeaders: undefined, body: undefined }; - } - const headers = buildHeaders2([rawHeaders]); - if (ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && headers.values.has("content-type") || body instanceof Blob || body instanceof FormData || body instanceof URLSearchParams || globalThis.ReadableStream && body instanceof globalThis.ReadableStream) { - return { bodyHeaders: undefined, body }; - } else if (typeof body === "object" && ((Symbol.asyncIterator in body) || (Symbol.iterator in body) && ("next" in body) && typeof body.next === "function")) { - return { bodyHeaders: undefined, body: ReadableStreamFrom2(body) }; - } else { - return __classPrivateFieldGet2(this, _BaseAnthropic_encoder2, "f").call(this, { body, headers }); - } - } -} -var _a2, _BaseAnthropic_encoder2, Anthropic2; -var init_client3 = __esm(() => { - init_tslib2(); - init_values4(); - init_log4(); - init_detect_platform2(); - init_error4(); - init_pagination2(); - init_uploads4(); - init_resources2(); - init_api_promise2(); - init_detect_platform2(); - init_headers2(); - init_completions2(); - init_models4(); - init_log4(); - init_values4(); - init_beta2(); - init_messages4(); - _a2 = BaseAnthropic2, _BaseAnthropic_encoder2 = new WeakMap; - BaseAnthropic2.Anthropic = _a2; - BaseAnthropic2.HUMAN_PROMPT = ` - -Human:`; - BaseAnthropic2.AI_PROMPT = ` - -Assistant:`; - BaseAnthropic2.DEFAULT_TIMEOUT = 600000; - BaseAnthropic2.AnthropicError = AnthropicError2; - BaseAnthropic2.APIError = APIError2; - BaseAnthropic2.APIConnectionError = APIConnectionError2; - BaseAnthropic2.APIConnectionTimeoutError = APIConnectionTimeoutError2; - BaseAnthropic2.APIUserAbortError = APIUserAbortError2; - BaseAnthropic2.NotFoundError = NotFoundError2; - BaseAnthropic2.ConflictError = ConflictError2; - BaseAnthropic2.RateLimitError = RateLimitError2; - BaseAnthropic2.BadRequestError = BadRequestError2; - BaseAnthropic2.AuthenticationError = AuthenticationError2; - BaseAnthropic2.InternalServerError = InternalServerError2; - BaseAnthropic2.PermissionDeniedError = PermissionDeniedError2; - BaseAnthropic2.UnprocessableEntityError = UnprocessableEntityError2; - BaseAnthropic2.toFile = toFile2; - Anthropic2 = class Anthropic2 extends BaseAnthropic2 { - constructor() { - super(...arguments); - this.completions = new Completions2(this); - this.messages = new Messages4(this); - this.models = new Models4(this); - this.beta = new Beta2(this); - } - }; - Anthropic2.Completions = Completions2; - Anthropic2.Messages = Messages4; - Anthropic2.Models = Models4; - Anthropic2.Beta = Beta2; -}); - -// ../node_modules/@aws-crypto/sha256-js/build/constants.js -var require_constants6 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MAX_HASHABLE_LENGTH = exports.INIT = exports.KEY = exports.DIGEST_LENGTH = exports.BLOCK_SIZE = undefined; - exports.BLOCK_SIZE = 64; - exports.DIGEST_LENGTH = 32; - exports.KEY = new Uint32Array([ - 1116352408, - 1899447441, - 3049323471, - 3921009573, - 961987163, - 1508970993, - 2453635748, - 2870763221, - 3624381080, - 310598401, - 607225278, - 1426881987, - 1925078388, - 2162078206, - 2614888103, - 3248222580, - 3835390401, - 4022224774, - 264347078, - 604807628, - 770255983, - 1249150122, - 1555081692, - 1996064986, - 2554220882, - 2821834349, - 2952996808, - 3210313671, - 3336571891, - 3584528711, - 113926993, - 338241895, - 666307205, - 773529912, - 1294757372, - 1396182291, - 1695183700, - 1986661051, - 2177026350, - 2456956037, - 2730485921, - 2820302411, - 3259730800, - 3345764771, - 3516065817, - 3600352804, - 4094571909, - 275423344, - 430227734, - 506948616, - 659060556, - 883997877, - 958139571, - 1322822218, - 1537002063, - 1747873779, - 1955562222, - 2024104815, - 2227730452, - 2361852424, - 2428436474, - 2756734187, - 3204031479, - 3329325298 - ]); - exports.INIT = [ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 - ]; - exports.MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1; -}); - -// ../node_modules/@aws-crypto/sha256-js/build/RawSha256.js -var require_RawSha256 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RawSha256 = undefined; - var constants_1 = require_constants6(); - var RawSha256 = function() { - function RawSha2562() { - this.state = Int32Array.from(constants_1.INIT); - this.temp = new Int32Array(64); - this.buffer = new Uint8Array(64); - this.bufferLength = 0; - this.bytesHashed = 0; - this.finished = false; - } - RawSha2562.prototype.update = function(data) { - if (this.finished) { - throw new Error("Attempted to update an already finished hash."); - } - var position = 0; - var byteLength = data.byteLength; - this.bytesHashed += byteLength; - if (this.bytesHashed * 8 > constants_1.MAX_HASHABLE_LENGTH) { - throw new Error("Cannot hash more than 2^53 - 1 bits"); - } - while (byteLength > 0) { - this.buffer[this.bufferLength++] = data[position++]; - byteLength--; - if (this.bufferLength === constants_1.BLOCK_SIZE) { - this.hashBuffer(); - this.bufferLength = 0; - } - } - }; - RawSha2562.prototype.digest = function() { - if (!this.finished) { - var bitsHashed = this.bytesHashed * 8; - var bufferView = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength); - var undecoratedLength = this.bufferLength; - bufferView.setUint8(this.bufferLength++, 128); - if (undecoratedLength % constants_1.BLOCK_SIZE >= constants_1.BLOCK_SIZE - 8) { - for (var i2 = this.bufferLength;i2 < constants_1.BLOCK_SIZE; i2++) { - bufferView.setUint8(i2, 0); - } - this.hashBuffer(); - this.bufferLength = 0; - } - for (var i2 = this.bufferLength;i2 < constants_1.BLOCK_SIZE - 8; i2++) { - bufferView.setUint8(i2, 0); - } - bufferView.setUint32(constants_1.BLOCK_SIZE - 8, Math.floor(bitsHashed / 4294967296), true); - bufferView.setUint32(constants_1.BLOCK_SIZE - 4, bitsHashed); - this.hashBuffer(); - this.finished = true; - } - var out = new Uint8Array(constants_1.DIGEST_LENGTH); - for (var i2 = 0;i2 < 8; i2++) { - out[i2 * 4] = this.state[i2] >>> 24 & 255; - out[i2 * 4 + 1] = this.state[i2] >>> 16 & 255; - out[i2 * 4 + 2] = this.state[i2] >>> 8 & 255; - out[i2 * 4 + 3] = this.state[i2] >>> 0 & 255; - } - return out; - }; - RawSha2562.prototype.hashBuffer = function() { - var _a3 = this, buffer = _a3.buffer, state = _a3.state; - var state0 = state[0], state1 = state[1], state2 = state[2], state3 = state[3], state4 = state[4], state5 = state[5], state6 = state[6], state7 = state[7]; - for (var i2 = 0;i2 < constants_1.BLOCK_SIZE; i2++) { - if (i2 < 16) { - this.temp[i2] = (buffer[i2 * 4] & 255) << 24 | (buffer[i2 * 4 + 1] & 255) << 16 | (buffer[i2 * 4 + 2] & 255) << 8 | buffer[i2 * 4 + 3] & 255; - } else { - var u2 = this.temp[i2 - 2]; - var t1_1 = (u2 >>> 17 | u2 << 15) ^ (u2 >>> 19 | u2 << 13) ^ u2 >>> 10; - u2 = this.temp[i2 - 15]; - var t2_1 = (u2 >>> 7 | u2 << 25) ^ (u2 >>> 18 | u2 << 14) ^ u2 >>> 3; - this.temp[i2] = (t1_1 + this.temp[i2 - 7] | 0) + (t2_1 + this.temp[i2 - 16] | 0); - } - var t1 = (((state4 >>> 6 | state4 << 26) ^ (state4 >>> 11 | state4 << 21) ^ (state4 >>> 25 | state4 << 7)) + (state4 & state5 ^ ~state4 & state6) | 0) + (state7 + (constants_1.KEY[i2] + this.temp[i2] | 0) | 0) | 0; - var t2 = ((state0 >>> 2 | state0 << 30) ^ (state0 >>> 13 | state0 << 19) ^ (state0 >>> 22 | state0 << 10)) + (state0 & state1 ^ state0 & state2 ^ state1 & state2) | 0; - state7 = state6; - state6 = state5; - state5 = state4; - state4 = state3 + t1 | 0; - state3 = state2; - state2 = state1; - state1 = state0; - state0 = t1 + t2 | 0; - } - state[0] += state0; - state[1] += state1; - state[2] += state2; - state[3] += state3; - state[4] += state4; - state[5] += state5; - state[6] += state6; - state[7] += state7; - }; - return RawSha2562; - }(); - exports.RawSha256 = RawSha256; -}); - -// ../node_modules/@aws-crypto/sha256-js/build/jsSha256.js -var require_jsSha256 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Sha256 = undefined; - var tslib_1 = require_tslib2(); - var constants_1 = require_constants6(); - var RawSha256_1 = require_RawSha256(); - var util_1 = require_build(); - var Sha256 = function() { - function Sha2562(secret) { - this.secret = secret; - this.hash = new RawSha256_1.RawSha256; - this.reset(); - } - Sha2562.prototype.update = function(toHash) { - if ((0, util_1.isEmptyData)(toHash) || this.error) { - return; - } - try { - this.hash.update((0, util_1.convertToBuffer)(toHash)); - } catch (e) { - this.error = e; - } - }; - Sha2562.prototype.digestSync = function() { - if (this.error) { - throw this.error; - } - if (this.outer) { - if (!this.outer.finished) { - this.outer.update(this.hash.digest()); - } - return this.outer.digest(); - } - return this.hash.digest(); - }; - Sha2562.prototype.digest = function() { - return tslib_1.__awaiter(this, undefined, undefined, function() { - return tslib_1.__generator(this, function(_a3) { - return [2, this.digestSync()]; - }); - }); - }; - Sha2562.prototype.reset = function() { - this.hash = new RawSha256_1.RawSha256; - if (this.secret) { - this.outer = new RawSha256_1.RawSha256; - var inner = bufferFromSecret(this.secret); - var outer = new Uint8Array(constants_1.BLOCK_SIZE); - outer.set(inner); - for (var i2 = 0;i2 < constants_1.BLOCK_SIZE; i2++) { - inner[i2] ^= 54; - outer[i2] ^= 92; - } - this.hash.update(inner); - this.outer.update(outer); - for (var i2 = 0;i2 < inner.byteLength; i2++) { - inner[i2] = 0; - } - } - }; - return Sha2562; - }(); - exports.Sha256 = Sha256; - function bufferFromSecret(secret) { - var input = (0, util_1.convertToBuffer)(secret); - if (input.byteLength > constants_1.BLOCK_SIZE) { - var bufferHash = new RawSha256_1.RawSha256; - bufferHash.update(input); - input = bufferHash.digest(); - } - var buffer = new Uint8Array(constants_1.BLOCK_SIZE); - buffer.set(input); - return buffer; - } -}); - -// ../node_modules/@aws-crypto/sha256-js/build/index.js -var require_build3 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require_tslib2(); - tslib_1.__exportStar(require_jsSha256(), exports); -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/createCredentialChain.js -var require_createCredentialChain2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.propertyProviderChain = exports.createCredentialChain = undefined; - var property_provider_1 = require_dist_cjs76(); - var createCredentialChain = (...credentialProviders) => { - let expireAfter = -1; - const baseFunction = async (awsIdentityProperties) => { - const credentials = await (0, exports.propertyProviderChain)(...credentialProviders)(awsIdentityProperties); - if (!credentials.expiration && expireAfter !== -1) { - credentials.expiration = new Date(Date.now() + expireAfter); - } - return credentials; - }; - const withOptions = Object.assign(baseFunction, { - expireAfter(milliseconds) { - if (milliseconds < 5 * 60000) { - throw new Error("@aws-sdk/credential-providers - createCredentialChain(...).expireAfter(ms) may not be called with a duration lower than five minutes."); - } - expireAfter = milliseconds; - return withOptions; - } - }); - return withOptions; - }; - exports.createCredentialChain = createCredentialChain; - var propertyProviderChain = (...providers) => async (awsIdentityProperties) => { - if (providers.length === 0) { - throw new property_provider_1.ProviderError("No providers in chain", { tryNextLink: false }); - } - let lastProviderError; - for (const provider of providers) { - try { - return await provider(awsIdentityProperties); - } catch (err) { - lastProviderError = err; - if (err?.tryNextLink) { - continue; - } - throw err; - } - } - throw lastProviderError; - }; - exports.propertyProviderChain = propertyProviderChain; -}); - -// ../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/auth/httpAuthSchemeProvider.js -var require_httpAuthSchemeProvider13 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveHttpAuthSchemeConfig = exports.defaultCognitoIdentityHttpAuthSchemeProvider = exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = undefined; - var core_1 = require_dist_cjs83(); - var util_middleware_1 = require_dist_cjs60(); - var defaultCognitoIdentityHttpAuthSchemeParametersProvider = async (config2, context, input) => { - return { - operation: (0, util_middleware_1.getSmithyContext)(context).operation, - region: await (0, util_middleware_1.normalizeProvider)(config2.region)() || (() => { - throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); - })() - }; - }; - exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = defaultCognitoIdentityHttpAuthSchemeParametersProvider; - function createAwsAuthSigv4HttpAuthOption(authParameters) { - return { - schemeId: "aws.auth#sigv4", - signingProperties: { - name: "cognito-identity", - region: authParameters.region - }, - propertiesExtractor: (config2, context) => ({ - signingProperties: { - config: config2, - context - } - }) - }; - } - function createSmithyApiNoAuthHttpAuthOption(authParameters) { - return { - schemeId: "smithy.api#noAuth" - }; - } - var defaultCognitoIdentityHttpAuthSchemeProvider = (authParameters) => { - const options = []; - switch (authParameters.operation) { - case "GetCredentialsForIdentity": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "GetId": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "GetOpenIdToken": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - case "UnlinkIdentity": { - options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); - break; - } - default: { - options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); - } - } - return options; - }; - exports.defaultCognitoIdentityHttpAuthSchemeProvider = defaultCognitoIdentityHttpAuthSchemeProvider; - var resolveHttpAuthSchemeConfig = (config2) => { - const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config2); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config2.authSchemePreference ?? []) - }); - }; - exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; -}); - -// ../node_modules/@aws-sdk/client-cognito-identity/package.json -var require_package7 = __commonJS((exports, module) => { - module.exports = { name: "@aws-sdk/client-cognito-identity", main: "dist-cjs/index.js" }; -}); - -// ../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/ruleset.js -var require_ruleset13 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ruleSet = undefined; - var w = "required"; - var x2 = "fn"; - var y2 = "argv"; - var z2 = "ref"; - var a2 = true; - var b = "isSet"; - var c5 = "booleanEquals"; - var d = "error"; - var e = "endpoint"; - var f = "tree"; - var g = "PartitionResult"; - var h2 = "getAttr"; - var i2 = "stringEquals"; - var j = { [w]: false, type: "string" }; - var k = { [w]: true, default: false, type: "boolean" }; - var l = { [z2]: "Endpoint" }; - var m = { [x2]: c5, [y2]: [{ [z2]: "UseFIPS" }, true] }; - var n2 = { [x2]: c5, [y2]: [{ [z2]: "UseDualStack" }, true] }; - var o2 = {}; - var p = { [z2]: "Region" }; - var q = { [x2]: h2, [y2]: [{ [z2]: g }, "supportsFIPS"] }; - var r = { [z2]: g }; - var s = { [x2]: c5, [y2]: [true, { [x2]: h2, [y2]: [r, "supportsDualStack"] }] }; - var t = [m]; - var u2 = [n2]; - var v = [p]; - var _data = { version: "1.0", parameters: { Region: j, UseDualStack: k, UseFIPS: k, Endpoint: j }, rules: [{ conditions: [{ [x2]: b, [y2]: [l] }], rules: [{ conditions: t, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: u2, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: l, properties: o2, headers: o2 }, type: e }], type: f }, { conditions: [{ [x2]: b, [y2]: v }], rules: [{ conditions: [{ [x2]: "aws.partition", [y2]: v, assign: g }], rules: [{ conditions: [m, n2], rules: [{ conditions: [{ [x2]: c5, [y2]: [a2, q] }, s], rules: [{ conditions: [{ [x2]: i2, [y2]: [p, "us-east-1"] }], endpoint: { url: "https://cognito-identity-fips.us-east-1.amazonaws.com", properties: o2, headers: o2 }, type: e }, { conditions: [{ [x2]: i2, [y2]: [p, "us-east-2"] }], endpoint: { url: "https://cognito-identity-fips.us-east-2.amazonaws.com", properties: o2, headers: o2 }, type: e }, { conditions: [{ [x2]: i2, [y2]: [p, "us-west-1"] }], endpoint: { url: "https://cognito-identity-fips.us-west-1.amazonaws.com", properties: o2, headers: o2 }, type: e }, { conditions: [{ [x2]: i2, [y2]: [p, "us-west-2"] }], endpoint: { url: "https://cognito-identity-fips.us-west-2.amazonaws.com", properties: o2, headers: o2 }, type: e }, { endpoint: { url: "https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: o2, headers: o2 }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: t, rules: [{ conditions: [{ [x2]: c5, [y2]: [q, a2] }], rules: [{ endpoint: { url: "https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}", properties: o2, headers: o2 }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: u2, rules: [{ conditions: [s], rules: [{ conditions: [{ [x2]: i2, [y2]: ["aws", { [x2]: h2, [y2]: [r, "name"] }] }], endpoint: { url: "https://cognito-identity.{Region}.amazonaws.com", properties: o2, headers: o2 }, type: e }, { endpoint: { url: "https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: o2, headers: o2 }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}", properties: o2, headers: o2 }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; - exports.ruleSet = _data; -}); - -// ../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/endpointResolver.js -var require_endpointResolver13 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultEndpointResolver = undefined; - var util_endpoints_1 = require_dist_cjs75(); - var util_endpoints_2 = require_dist_cjs72(); - var ruleset_1 = require_ruleset13(); - var cache2 = new util_endpoints_2.EndpointCache({ - size: 50, - params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] - }); - var defaultEndpointResolver = (endpointParams, context = {}) => { - return cache2.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { - endpointParams, - logger: context.logger - })); - }; - exports.defaultEndpointResolver = defaultEndpointResolver; - util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; -}); - -// ../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.shared.js -var require_runtimeConfig_shared13 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var core_1 = require_dist_cjs83(); - var protocols_1 = require_protocols4(); - var core_2 = require_dist_cjs71(); - var smithy_client_1 = require_dist_cjs81(); - var url_parser_1 = require_dist_cjs74(); - var util_base64_1 = require_dist_cjs65(); - var util_utf8_1 = require_dist_cjs64(); - var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider13(); - var endpointResolver_1 = require_endpointResolver13(); - var getRuntimeConfig = (config2) => { - return { - apiVersion: "2014-06-30", - base64Decoder: config2?.base64Decoder ?? util_base64_1.fromBase64, - base64Encoder: config2?.base64Encoder ?? util_base64_1.toBase64, - disableHostPrefix: config2?.disableHostPrefix ?? false, - endpointProvider: config2?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, - extensions: config2?.extensions ?? [], - httpAuthSchemeProvider: config2?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultCognitoIdentityHttpAuthSchemeProvider, - httpAuthSchemes: config2?.httpAuthSchemes ?? [ - { - schemeId: "aws.auth#sigv4", - identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), - signer: new core_1.AwsSdkSigV4Signer - }, - { - schemeId: "smithy.api#noAuth", - identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), - signer: new core_2.NoAuthSigner - } - ], - logger: config2?.logger ?? new smithy_client_1.NoOpLogger, - protocol: config2?.protocol ?? new protocols_1.AwsJson1_1Protocol({ - defaultNamespace: "com.amazonaws.cognitoidentity", - serviceTarget: "AWSCognitoIdentityService", - awsQueryCompatible: false - }), - serviceId: config2?.serviceId ?? "Cognito Identity", - urlParser: config2?.urlParser ?? url_parser_1.parseUrl, - utf8Decoder: config2?.utf8Decoder ?? util_utf8_1.fromUtf8, - utf8Encoder: config2?.utf8Encoder ?? util_utf8_1.toUtf8 - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.js -var require_runtimeConfig13 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRuntimeConfig = undefined; - var tslib_1 = require_tslib2(); - var package_json_1 = tslib_1.__importDefault(require_package7()); - var core_1 = require_dist_cjs83(); - var credential_provider_node_1 = require_dist_cjs109(); - var util_user_agent_node_1 = require_dist_cjs97(); - var config_resolver_1 = require_dist_cjs86(); - var hash_node_1 = require_dist_cjs98(); - var middleware_retry_1 = require_dist_cjs93(); - var node_config_provider_1 = require_dist_cjs89(); - var node_http_handler_1 = require_dist_cjs68(); - var util_body_length_node_1 = require_dist_cjs99(); - var util_retry_1 = require_dist_cjs92(); - var runtimeConfig_shared_1 = require_runtimeConfig_shared13(); - var smithy_client_1 = require_dist_cjs81(); - var util_defaults_mode_node_1 = require_dist_cjs100(); - var smithy_client_2 = require_dist_cjs81(); - var getRuntimeConfig = (config2) => { - (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config2); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); - const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config2); - (0, core_1.emitWarningIfUnsupportedVersion)(process.version); - const loaderConfig = { - profile: config2?.profile, - logger: clientSharedValues.logger - }; - return { - ...clientSharedValues, - ...config2, - runtime: "node", - defaultsMode, - authSchemePreference: config2?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), - bodyLengthChecker: config2?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, - credentialDefaultProvider: config2?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, - defaultUserAgentProvider: config2?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), - maxAttempts: config2?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config2), - region: config2?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), - requestHandler: node_http_handler_1.NodeHttpHandler.create(config2?.requestHandler ?? defaultConfigProvider), - retryMode: config2?.retryMode ?? (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE - }, config2), - sha256: config2?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), - streamCollector: config2?.streamCollector ?? node_http_handler_1.streamCollector, - useDualstackEndpoint: config2?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - useFipsEndpoint: config2?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), - userAgentAppId: config2?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) - }; - }; - exports.getRuntimeConfig = getRuntimeConfig; -}); - -// ../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js -var require_dist_cjs126 = __commonJS((exports) => { - var middlewareHostHeader = require_dist_cjs57(); - var middlewareLogger = require_dist_cjs58(); - var middlewareRecursionDetection = require_dist_cjs59(); - var middlewareUserAgent = require_dist_cjs84(); - var configResolver = require_dist_cjs86(); - var core2 = require_dist_cjs71(); - var schema = require_schema2(); - var middlewareContentLength = require_dist_cjs87(); - var middlewareEndpoint = require_dist_cjs90(); - var middlewareRetry = require_dist_cjs93(); - var smithyClient = require_dist_cjs81(); - var httpAuthSchemeProvider = require_httpAuthSchemeProvider13(); - var runtimeConfig = require_runtimeConfig13(); - var regionConfigResolver = require_dist_cjs101(); - var protocolHttp = require_dist_cjs56(); - var resolveClientEndpointParameters = (options) => { - return Object.assign(options, { - useDualstackEndpoint: options.useDualstackEndpoint ?? false, - useFipsEndpoint: options.useFipsEndpoint ?? false, - defaultSigningName: "cognito-identity" - }); - }; - var commonParams = { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } - }; - var getHttpAuthExtensionConfiguration = (runtimeConfig2) => { - const _httpAuthSchemes = runtimeConfig2.httpAuthSchemes; - let _httpAuthSchemeProvider = runtimeConfig2.httpAuthSchemeProvider; - let _credentials = runtimeConfig2.credentials; - return { - setHttpAuthScheme(httpAuthScheme) { - const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); - if (index === -1) { - _httpAuthSchemes.push(httpAuthScheme); - } else { - _httpAuthSchemes.splice(index, 1, httpAuthScheme); - } - }, - httpAuthSchemes() { - return _httpAuthSchemes; - }, - setHttpAuthSchemeProvider(httpAuthSchemeProvider2) { - _httpAuthSchemeProvider = httpAuthSchemeProvider2; - }, - httpAuthSchemeProvider() { - return _httpAuthSchemeProvider; - }, - setCredentials(credentials) { - _credentials = credentials; - }, - credentials() { - return _credentials; - } - }; - }; - var resolveHttpAuthRuntimeConfig = (config2) => { - return { - httpAuthSchemes: config2.httpAuthSchemes(), - httpAuthSchemeProvider: config2.httpAuthSchemeProvider(), - credentials: config2.credentials() - }; - }; - var resolveRuntimeExtensions = (runtimeConfig2, extensions) => { - const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig2), smithyClient.getDefaultExtensionConfiguration(runtimeConfig2), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig2), getHttpAuthExtensionConfiguration(runtimeConfig2)); - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return Object.assign(runtimeConfig2, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); - }; - - class CognitoIdentityClient extends smithyClient.Client { - config; - constructor(...[configuration]) { - const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); - super(_config_0); - this.initConfig = _config_0; - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); - const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); - const _config_4 = configResolver.resolveRegionConfig(_config_3); - const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); - const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); - const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); - const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); - this.config = _config_8; - this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); - this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); - this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); - this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); - this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); - this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); - this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); - this.middlewareStack.use(core2.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { - httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultCognitoIdentityHttpAuthSchemeParametersProvider, - identityProviderConfigProvider: async (config2) => new core2.DefaultIdentityProviderConfig({ - "aws.auth#sigv4": config2.credentials - }) - })); - this.middlewareStack.use(core2.getHttpSigningPlugin(this.config)); - } - destroy() { - super.destroy(); - } - } - var CognitoIdentityServiceException$1 = class CognitoIdentityServiceException2 extends smithyClient.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, CognitoIdentityServiceException2.prototype); - } - }; - var InternalErrorException$1 = class InternalErrorException2 extends CognitoIdentityServiceException$1 { - name = "InternalErrorException"; - $fault = "server"; - constructor(opts) { - super({ - name: "InternalErrorException", - $fault: "server", - ...opts - }); - Object.setPrototypeOf(this, InternalErrorException2.prototype); - } - }; - var InvalidParameterException$1 = class InvalidParameterException2 extends CognitoIdentityServiceException$1 { - name = "InvalidParameterException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidParameterException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidParameterException2.prototype); - } - }; - var LimitExceededException$1 = class LimitExceededException2 extends CognitoIdentityServiceException$1 { - name = "LimitExceededException"; - $fault = "client"; - constructor(opts) { - super({ - name: "LimitExceededException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, LimitExceededException2.prototype); - } - }; - var NotAuthorizedException$1 = class NotAuthorizedException2 extends CognitoIdentityServiceException$1 { - name = "NotAuthorizedException"; - $fault = "client"; - constructor(opts) { - super({ - name: "NotAuthorizedException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, NotAuthorizedException2.prototype); - } - }; - var ResourceConflictException$1 = class ResourceConflictException2 extends CognitoIdentityServiceException$1 { - name = "ResourceConflictException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ResourceConflictException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ResourceConflictException2.prototype); - } - }; - var TooManyRequestsException$1 = class TooManyRequestsException2 extends CognitoIdentityServiceException$1 { - name = "TooManyRequestsException"; - $fault = "client"; - constructor(opts) { - super({ - name: "TooManyRequestsException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, TooManyRequestsException2.prototype); - } - }; - var ResourceNotFoundException$1 = class ResourceNotFoundException2 extends CognitoIdentityServiceException$1 { - name = "ResourceNotFoundException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ResourceNotFoundException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ResourceNotFoundException2.prototype); - } - }; - var ExternalServiceException$1 = class ExternalServiceException2 extends CognitoIdentityServiceException$1 { - name = "ExternalServiceException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ExternalServiceException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ExternalServiceException2.prototype); - } - }; - var InvalidIdentityPoolConfigurationException$1 = class InvalidIdentityPoolConfigurationException2 extends CognitoIdentityServiceException$1 { - name = "InvalidIdentityPoolConfigurationException"; - $fault = "client"; - constructor(opts) { - super({ - name: "InvalidIdentityPoolConfigurationException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, InvalidIdentityPoolConfigurationException2.prototype); - } - }; - var DeveloperUserAlreadyRegisteredException$1 = class DeveloperUserAlreadyRegisteredException2 extends CognitoIdentityServiceException$1 { - name = "DeveloperUserAlreadyRegisteredException"; - $fault = "client"; - constructor(opts) { - super({ - name: "DeveloperUserAlreadyRegisteredException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, DeveloperUserAlreadyRegisteredException2.prototype); - } - }; - var ConcurrentModificationException$1 = class ConcurrentModificationException2 extends CognitoIdentityServiceException$1 { - name = "ConcurrentModificationException"; - $fault = "client"; - constructor(opts) { - super({ - name: "ConcurrentModificationException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, ConcurrentModificationException2.prototype); - } - }; - var _ACF = "AllowClassicFlow"; - var _AI = "AccountId"; - var _AKI = "AccessKeyId"; - var _ARR = "AmbiguousRoleResolution"; - var _AUI = "AllowUnauthenticatedIdentities"; - var _C = "Credentials"; - var _CD = "CreationDate"; - var _CI = "ClientId"; - var _CIP = "CognitoIdentityProvider"; - var _CIPI = "CreateIdentityPoolInput"; - var _CIPL = "CognitoIdentityProviderList"; - var _CIPo = "CognitoIdentityProviders"; - var _CIPr = "CreateIdentityPool"; - var _CME = "ConcurrentModificationException"; - var _CRA = "CustomRoleArn"; - var _Cl = "Claim"; - var _DI = "DeleteIdentities"; - var _DII = "DeleteIdentitiesInput"; - var _DIIe = "DescribeIdentityInput"; - var _DIP = "DeleteIdentityPool"; - var _DIPI = "DeleteIdentityPoolInput"; - var _DIPIe = "DescribeIdentityPoolInput"; - var _DIPe = "DescribeIdentityPool"; - var _DIR = "DeleteIdentitiesResponse"; - var _DIe = "DescribeIdentity"; - var _DPN = "DeveloperProviderName"; - var _DUARE = "DeveloperUserAlreadyRegisteredException"; - var _DUI = "DeveloperUserIdentifier"; - var _DUIL = "DeveloperUserIdentifierList"; - var _DUIe = "DestinationUserIdentifier"; - var _E = "Expiration"; - var _EC = "ErrorCode"; - var _ESE = "ExternalServiceException"; - var _GCFI = "GetCredentialsForIdentity"; - var _GCFII = "GetCredentialsForIdentityInput"; - var _GCFIR = "GetCredentialsForIdentityResponse"; - var _GI = "GetId"; - var _GII = "GetIdInput"; - var _GIPR = "GetIdentityPoolRoles"; - var _GIPRI = "GetIdentityPoolRolesInput"; - var _GIPRR = "GetIdentityPoolRolesResponse"; - var _GIR = "GetIdResponse"; - var _GOIT = "GetOpenIdToken"; - var _GOITFDI = "GetOpenIdTokenForDeveloperIdentity"; - var _GOITFDII = "GetOpenIdTokenForDeveloperIdentityInput"; - var _GOITFDIR = "GetOpenIdTokenForDeveloperIdentityResponse"; - var _GOITI = "GetOpenIdTokenInput"; - var _GOITR = "GetOpenIdTokenResponse"; - var _GPTAM = "GetPrincipalTagAttributeMap"; - var _GPTAMI = "GetPrincipalTagAttributeMapInput"; - var _GPTAMR = "GetPrincipalTagAttributeMapResponse"; - var _HD = "HideDisabled"; - var _I = "Identities"; - var _ID = "IdentityDescription"; - var _IEE = "InternalErrorException"; - var _II = "IdentityId"; - var _IIPCE = "InvalidIdentityPoolConfigurationException"; - var _IITD = "IdentityIdsToDelete"; - var _IL = "IdentitiesList"; - var _IP = "IdentityPool"; - var _IPE = "InvalidParameterException"; - var _IPI = "IdentityPoolId"; - var _IPL = "IdentityPoolsList"; - var _IPN = "IdentityPoolName"; - var _IPNd = "IdentityProviderName"; - var _IPSD = "IdentityPoolShortDescription"; - var _IPT = "IdentityProviderToken"; - var _IPTd = "IdentityPoolTags"; - var _IPd = "IdentityPools"; - var _L = "Logins"; - var _LDI = "LookupDeveloperIdentity"; - var _LDII = "LookupDeveloperIdentityInput"; - var _LDIR = "LookupDeveloperIdentityResponse"; - var _LEE = "LimitExceededException"; - var _LI = "ListIdentities"; - var _LII = "ListIdentitiesInput"; - var _LIP = "ListIdentityPools"; - var _LIPI = "ListIdentityPoolsInput"; - var _LIPR = "ListIdentityPoolsResponse"; - var _LIR = "ListIdentitiesResponse"; - var _LM = "LoginsMap"; - var _LMD = "LastModifiedDate"; - var _LTFR = "ListTagsForResource"; - var _LTFRI = "ListTagsForResourceInput"; - var _LTFRR = "ListTagsForResourceResponse"; - var _LTR = "LoginsToRemove"; - var _MDI = "MergeDeveloperIdentities"; - var _MDII = "MergeDeveloperIdentitiesInput"; - var _MDIR = "MergeDeveloperIdentitiesResponse"; - var _MR = "MaxResults"; - var _MRL = "MappingRulesList"; - var _MRa = "MappingRule"; - var _MT = "MatchType"; - var _NAE = "NotAuthorizedException"; - var _NT = "NextToken"; - var _OICPARN = "OpenIdConnectProviderARNs"; - var _OIDCT = "OIDCToken"; - var _PN = "ProviderName"; - var _PT = "PrincipalTags"; - var _R = "Roles"; - var _RA = "ResourceArn"; - var _RARN = "RoleARN"; - var _RC = "RulesConfiguration"; - var _RCE = "ResourceConflictException"; - var _RCT = "RulesConfigurationType"; - var _RM = "RoleMappings"; - var _RMM = "RoleMappingMap"; - var _RMo = "RoleMapping"; - var _RNFE = "ResourceNotFoundException"; - var _Ru = "Rules"; - var _SIPR = "SetIdentityPoolRoles"; - var _SIPRI = "SetIdentityPoolRolesInput"; - var _SK = "SecretKey"; - var _SKS = "SecretKeyString"; - var _SLP = "SupportedLoginProviders"; - var _SPARN = "SamlProviderARNs"; - var _SPTAM = "SetPrincipalTagAttributeMap"; - var _SPTAMI = "SetPrincipalTagAttributeMapInput"; - var _SPTAMR = "SetPrincipalTagAttributeMapResponse"; - var _SSTC = "ServerSideTokenCheck"; - var _ST = "SessionToken"; - var _SUI = "SourceUserIdentifier"; - var _T = "Token"; - var _TD = "TokenDuration"; - var _TK = "TagKeys"; - var _TMRE = "TooManyRequestsException"; - var _TR = "TagResource"; - var _TRI = "TagResourceInput"; - var _TRR = "TagResourceResponse"; - var _Ta = "Tags"; - var _Ty = "Type"; - var _UD = "UseDefaults"; - var _UDI = "UnlinkDeveloperIdentity"; - var _UDII = "UnlinkDeveloperIdentityInput"; - var _UI = "UnlinkIdentity"; - var _UII = "UnprocessedIdentityIds"; - var _UIIL = "UnprocessedIdentityIdList"; - var _UIIn = "UnlinkIdentityInput"; - var _UIInp = "UnprocessedIdentityId"; - var _UIP = "UpdateIdentityPool"; - var _UR = "UntagResource"; - var _URI = "UntagResourceInput"; - var _URR = "UntagResourceResponse"; - var _V = "Value"; - var _c = "client"; - var _e = "error"; - var _hE = "httpError"; - var _m = "message"; - var _s = "server"; - var _sm = "smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity"; - var n0 = "com.amazonaws.cognitoidentity"; - var IdentityProviderToken = [0, n0, _IPT, 8, 0]; - var OIDCToken = [0, n0, _OIDCT, 8, 0]; - var SecretKeyString = [0, n0, _SKS, 8, 0]; - var CognitoIdentityProvider = [3, n0, _CIP, 0, [_PN, _CI, _SSTC], [0, 0, 2]]; - var ConcurrentModificationException = [ - -3, - n0, - _CME, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ConcurrentModificationException, ConcurrentModificationException$1); - var CreateIdentityPoolInput = [ - 3, - n0, - _CIPI, - 0, - [_IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPTd], - [0, 2, 2, 128 | 0, 0, 64 | 0, () => CognitoIdentityProviderList, 64 | 0, 128 | 0] - ]; - var Credentials = [ - 3, - n0, - _C, - 0, - [_AKI, _SK, _ST, _E], - [0, [() => SecretKeyString, 0], 0, 4] - ]; - var DeleteIdentitiesInput = [3, n0, _DII, 0, [_IITD], [64 | 0]]; - var DeleteIdentitiesResponse = [ - 3, - n0, - _DIR, - 0, - [_UII], - [() => UnprocessedIdentityIdList] - ]; - var DeleteIdentityPoolInput = [3, n0, _DIPI, 0, [_IPI], [0]]; - var DescribeIdentityInput = [3, n0, _DIIe, 0, [_II], [0]]; - var DescribeIdentityPoolInput = [3, n0, _DIPIe, 0, [_IPI], [0]]; - var DeveloperUserAlreadyRegisteredException = [ - -3, - n0, - _DUARE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(DeveloperUserAlreadyRegisteredException, DeveloperUserAlreadyRegisteredException$1); - var ExternalServiceException = [ - -3, - n0, - _ESE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ExternalServiceException, ExternalServiceException$1); - var GetCredentialsForIdentityInput = [ - 3, - n0, - _GCFII, - 0, - [_II, _L, _CRA], - [0, [() => LoginsMap, 0], 0] - ]; - var GetCredentialsForIdentityResponse = [ - 3, - n0, - _GCFIR, - 0, - [_II, _C], - [0, [() => Credentials, 0]] - ]; - var GetIdentityPoolRolesInput = [3, n0, _GIPRI, 0, [_IPI], [0]]; - var GetIdentityPoolRolesResponse = [ - 3, - n0, - _GIPRR, - 0, - [_IPI, _R, _RM], - [0, 128 | 0, () => RoleMappingMap] - ]; - var GetIdInput = [3, n0, _GII, 0, [_AI, _IPI, _L], [0, 0, [() => LoginsMap, 0]]]; - var GetIdResponse = [3, n0, _GIR, 0, [_II], [0]]; - var GetOpenIdTokenForDeveloperIdentityInput = [ - 3, - n0, - _GOITFDII, - 0, - [_IPI, _II, _L, _PT, _TD], - [0, 0, [() => LoginsMap, 0], 128 | 0, 1] - ]; - var GetOpenIdTokenForDeveloperIdentityResponse = [ - 3, - n0, - _GOITFDIR, - 0, - [_II, _T], - [0, [() => OIDCToken, 0]] - ]; - var GetOpenIdTokenInput = [3, n0, _GOITI, 0, [_II, _L], [0, [() => LoginsMap, 0]]]; - var GetOpenIdTokenResponse = [3, n0, _GOITR, 0, [_II, _T], [0, [() => OIDCToken, 0]]]; - var GetPrincipalTagAttributeMapInput = [3, n0, _GPTAMI, 0, [_IPI, _IPNd], [0, 0]]; - var GetPrincipalTagAttributeMapResponse = [ - 3, - n0, - _GPTAMR, - 0, - [_IPI, _IPNd, _UD, _PT], - [0, 0, 2, 128 | 0] - ]; - var IdentityDescription = [3, n0, _ID, 0, [_II, _L, _CD, _LMD], [0, 64 | 0, 4, 4]]; - var IdentityPool = [ - 3, - n0, - _IP, - 0, - [_IPI, _IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPTd], - [0, 0, 2, 2, 128 | 0, 0, 64 | 0, () => CognitoIdentityProviderList, 64 | 0, 128 | 0] - ]; - var IdentityPoolShortDescription = [3, n0, _IPSD, 0, [_IPI, _IPN], [0, 0]]; - var InternalErrorException = [ - -3, - n0, - _IEE, - { - [_e]: _s - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InternalErrorException, InternalErrorException$1); - var InvalidIdentityPoolConfigurationException = [ - -3, - n0, - _IIPCE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidIdentityPoolConfigurationException, InvalidIdentityPoolConfigurationException$1); - var InvalidParameterException = [ - -3, - n0, - _IPE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(InvalidParameterException, InvalidParameterException$1); - var LimitExceededException = [ - -3, - n0, - _LEE, - { - [_e]: _c, - [_hE]: 400 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(LimitExceededException, LimitExceededException$1); - var ListIdentitiesInput = [3, n0, _LII, 0, [_IPI, _MR, _NT, _HD], [0, 1, 0, 2]]; - var ListIdentitiesResponse = [ - 3, - n0, - _LIR, - 0, - [_IPI, _I, _NT], - [0, () => IdentitiesList, 0] - ]; - var ListIdentityPoolsInput = [3, n0, _LIPI, 0, [_MR, _NT], [1, 0]]; - var ListIdentityPoolsResponse = [ - 3, - n0, - _LIPR, - 0, - [_IPd, _NT], - [() => IdentityPoolsList, 0] - ]; - var ListTagsForResourceInput = [3, n0, _LTFRI, 0, [_RA], [0]]; - var ListTagsForResourceResponse = [3, n0, _LTFRR, 0, [_Ta], [128 | 0]]; - var LookupDeveloperIdentityInput = [ - 3, - n0, - _LDII, - 0, - [_IPI, _II, _DUI, _MR, _NT], - [0, 0, 0, 1, 0] - ]; - var LookupDeveloperIdentityResponse = [ - 3, - n0, - _LDIR, - 0, - [_II, _DUIL, _NT], - [0, 64 | 0, 0] - ]; - var MappingRule = [3, n0, _MRa, 0, [_Cl, _MT, _V, _RARN], [0, 0, 0, 0]]; - var MergeDeveloperIdentitiesInput = [ - 3, - n0, - _MDII, - 0, - [_SUI, _DUIe, _DPN, _IPI], - [0, 0, 0, 0] - ]; - var MergeDeveloperIdentitiesResponse = [3, n0, _MDIR, 0, [_II], [0]]; - var NotAuthorizedException = [ - -3, - n0, - _NAE, - { - [_e]: _c, - [_hE]: 403 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(NotAuthorizedException, NotAuthorizedException$1); - var ResourceConflictException = [ - -3, - n0, - _RCE, - { - [_e]: _c, - [_hE]: 409 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ResourceConflictException, ResourceConflictException$1); - var ResourceNotFoundException = [ - -3, - n0, - _RNFE, - { - [_e]: _c, - [_hE]: 404 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1); - var RoleMapping = [ - 3, - n0, - _RMo, - 0, - [_Ty, _ARR, _RC], - [0, 0, () => RulesConfigurationType] - ]; - var RulesConfigurationType = [3, n0, _RCT, 0, [_Ru], [() => MappingRulesList]]; - var SetIdentityPoolRolesInput = [ - 3, - n0, - _SIPRI, - 0, - [_IPI, _R, _RM], - [0, 128 | 0, () => RoleMappingMap] - ]; - var SetPrincipalTagAttributeMapInput = [ - 3, - n0, - _SPTAMI, - 0, - [_IPI, _IPNd, _UD, _PT], - [0, 0, 2, 128 | 0] - ]; - var SetPrincipalTagAttributeMapResponse = [ - 3, - n0, - _SPTAMR, - 0, - [_IPI, _IPNd, _UD, _PT], - [0, 0, 2, 128 | 0] - ]; - var TagResourceInput = [3, n0, _TRI, 0, [_RA, _Ta], [0, 128 | 0]]; - var TagResourceResponse = [3, n0, _TRR, 0, [], []]; - var TooManyRequestsException = [ - -3, - n0, - _TMRE, - { - [_e]: _c, - [_hE]: 429 - }, - [_m], - [0] - ]; - schema.TypeRegistry.for(n0).registerError(TooManyRequestsException, TooManyRequestsException$1); - var UnlinkDeveloperIdentityInput = [ - 3, - n0, - _UDII, - 0, - [_II, _IPI, _DPN, _DUI], - [0, 0, 0, 0] - ]; - var UnlinkIdentityInput = [ - 3, - n0, - _UIIn, - 0, - [_II, _L, _LTR], - [0, [() => LoginsMap, 0], 64 | 0] - ]; - var UnprocessedIdentityId = [3, n0, _UIInp, 0, [_II, _EC], [0, 0]]; - var UntagResourceInput = [3, n0, _URI, 0, [_RA, _TK], [0, 64 | 0]]; - var UntagResourceResponse = [3, n0, _URR, 0, [], []]; - var __Unit = "unit"; - var CognitoIdentityServiceException = [-3, _sm, "CognitoIdentityServiceException", 0, [], []]; - schema.TypeRegistry.for(_sm).registerError(CognitoIdentityServiceException, CognitoIdentityServiceException$1); - var CognitoIdentityProviderList = [1, n0, _CIPL, 0, () => CognitoIdentityProvider]; - var IdentitiesList = [1, n0, _IL, 0, () => IdentityDescription]; - var IdentityPoolsList = [1, n0, _IPL, 0, () => IdentityPoolShortDescription]; - var MappingRulesList = [1, n0, _MRL, 0, () => MappingRule]; - var UnprocessedIdentityIdList = [1, n0, _UIIL, 0, () => UnprocessedIdentityId]; - var LoginsMap = [2, n0, _LM, 0, [0, 0], [() => IdentityProviderToken, 0]]; - var RoleMappingMap = [2, n0, _RMM, 0, 0, () => RoleMapping]; - var CreateIdentityPool = [ - 9, - n0, - _CIPr, - 0, - () => CreateIdentityPoolInput, - () => IdentityPool - ]; - var DeleteIdentities = [ - 9, - n0, - _DI, - 0, - () => DeleteIdentitiesInput, - () => DeleteIdentitiesResponse - ]; - var DeleteIdentityPool = [9, n0, _DIP, 0, () => DeleteIdentityPoolInput, () => __Unit]; - var DescribeIdentity = [ - 9, - n0, - _DIe, - 0, - () => DescribeIdentityInput, - () => IdentityDescription - ]; - var DescribeIdentityPool = [ - 9, - n0, - _DIPe, - 0, - () => DescribeIdentityPoolInput, - () => IdentityPool - ]; - var GetCredentialsForIdentity = [ - 9, - n0, - _GCFI, - 0, - () => GetCredentialsForIdentityInput, - () => GetCredentialsForIdentityResponse - ]; - var GetId = [9, n0, _GI, 0, () => GetIdInput, () => GetIdResponse]; - var GetIdentityPoolRoles = [ - 9, - n0, - _GIPR, - 0, - () => GetIdentityPoolRolesInput, - () => GetIdentityPoolRolesResponse - ]; - var GetOpenIdToken = [ - 9, - n0, - _GOIT, - 0, - () => GetOpenIdTokenInput, - () => GetOpenIdTokenResponse - ]; - var GetOpenIdTokenForDeveloperIdentity = [ - 9, - n0, - _GOITFDI, - 0, - () => GetOpenIdTokenForDeveloperIdentityInput, - () => GetOpenIdTokenForDeveloperIdentityResponse - ]; - var GetPrincipalTagAttributeMap = [ - 9, - n0, - _GPTAM, - 0, - () => GetPrincipalTagAttributeMapInput, - () => GetPrincipalTagAttributeMapResponse - ]; - var ListIdentities = [ - 9, - n0, - _LI, - 0, - () => ListIdentitiesInput, - () => ListIdentitiesResponse - ]; - var ListIdentityPools = [ - 9, - n0, - _LIP, - 0, - () => ListIdentityPoolsInput, - () => ListIdentityPoolsResponse - ]; - var ListTagsForResource = [ - 9, - n0, - _LTFR, - 0, - () => ListTagsForResourceInput, - () => ListTagsForResourceResponse - ]; - var LookupDeveloperIdentity = [ - 9, - n0, - _LDI, - 0, - () => LookupDeveloperIdentityInput, - () => LookupDeveloperIdentityResponse - ]; - var MergeDeveloperIdentities = [ - 9, - n0, - _MDI, - 0, - () => MergeDeveloperIdentitiesInput, - () => MergeDeveloperIdentitiesResponse - ]; - var SetIdentityPoolRoles = [ - 9, - n0, - _SIPR, - 0, - () => SetIdentityPoolRolesInput, - () => __Unit - ]; - var SetPrincipalTagAttributeMap = [ - 9, - n0, - _SPTAM, - 0, - () => SetPrincipalTagAttributeMapInput, - () => SetPrincipalTagAttributeMapResponse - ]; - var TagResource = [9, n0, _TR, 0, () => TagResourceInput, () => TagResourceResponse]; - var UnlinkDeveloperIdentity = [ - 9, - n0, - _UDI, - 0, - () => UnlinkDeveloperIdentityInput, - () => __Unit - ]; - var UnlinkIdentity = [9, n0, _UI, 0, () => UnlinkIdentityInput, () => __Unit]; - var UntagResource = [ - 9, - n0, - _UR, - 0, - () => UntagResourceInput, - () => UntagResourceResponse - ]; - var UpdateIdentityPool = [9, n0, _UIP, 0, () => IdentityPool, () => IdentityPool]; - - class CreateIdentityPoolCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "CreateIdentityPool", {}).n("CognitoIdentityClient", "CreateIdentityPoolCommand").sc(CreateIdentityPool).build() { - } - - class DeleteIdentitiesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "DeleteIdentities", {}).n("CognitoIdentityClient", "DeleteIdentitiesCommand").sc(DeleteIdentities).build() { - } - - class DeleteIdentityPoolCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "DeleteIdentityPool", {}).n("CognitoIdentityClient", "DeleteIdentityPoolCommand").sc(DeleteIdentityPool).build() { - } - - class DescribeIdentityCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "DescribeIdentity", {}).n("CognitoIdentityClient", "DescribeIdentityCommand").sc(DescribeIdentity).build() { - } - - class DescribeIdentityPoolCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "DescribeIdentityPool", {}).n("CognitoIdentityClient", "DescribeIdentityPoolCommand").sc(DescribeIdentityPool).build() { - } - - class GetCredentialsForIdentityCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "GetCredentialsForIdentity", {}).n("CognitoIdentityClient", "GetCredentialsForIdentityCommand").sc(GetCredentialsForIdentity).build() { - } - - class GetIdCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "GetId", {}).n("CognitoIdentityClient", "GetIdCommand").sc(GetId).build() { - } - - class GetIdentityPoolRolesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "GetIdentityPoolRoles", {}).n("CognitoIdentityClient", "GetIdentityPoolRolesCommand").sc(GetIdentityPoolRoles).build() { - } - - class GetOpenIdTokenCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "GetOpenIdToken", {}).n("CognitoIdentityClient", "GetOpenIdTokenCommand").sc(GetOpenIdToken).build() { - } - - class GetOpenIdTokenForDeveloperIdentityCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "GetOpenIdTokenForDeveloperIdentity", {}).n("CognitoIdentityClient", "GetOpenIdTokenForDeveloperIdentityCommand").sc(GetOpenIdTokenForDeveloperIdentity).build() { - } - - class GetPrincipalTagAttributeMapCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "GetPrincipalTagAttributeMap", {}).n("CognitoIdentityClient", "GetPrincipalTagAttributeMapCommand").sc(GetPrincipalTagAttributeMap).build() { - } - - class ListIdentitiesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "ListIdentities", {}).n("CognitoIdentityClient", "ListIdentitiesCommand").sc(ListIdentities).build() { - } - - class ListIdentityPoolsCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "ListIdentityPools", {}).n("CognitoIdentityClient", "ListIdentityPoolsCommand").sc(ListIdentityPools).build() { - } - - class ListTagsForResourceCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "ListTagsForResource", {}).n("CognitoIdentityClient", "ListTagsForResourceCommand").sc(ListTagsForResource).build() { - } - - class LookupDeveloperIdentityCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "LookupDeveloperIdentity", {}).n("CognitoIdentityClient", "LookupDeveloperIdentityCommand").sc(LookupDeveloperIdentity).build() { - } - - class MergeDeveloperIdentitiesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "MergeDeveloperIdentities", {}).n("CognitoIdentityClient", "MergeDeveloperIdentitiesCommand").sc(MergeDeveloperIdentities).build() { - } - - class SetIdentityPoolRolesCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "SetIdentityPoolRoles", {}).n("CognitoIdentityClient", "SetIdentityPoolRolesCommand").sc(SetIdentityPoolRoles).build() { - } - - class SetPrincipalTagAttributeMapCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "SetPrincipalTagAttributeMap", {}).n("CognitoIdentityClient", "SetPrincipalTagAttributeMapCommand").sc(SetPrincipalTagAttributeMap).build() { - } - - class TagResourceCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "TagResource", {}).n("CognitoIdentityClient", "TagResourceCommand").sc(TagResource).build() { - } - - class UnlinkDeveloperIdentityCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "UnlinkDeveloperIdentity", {}).n("CognitoIdentityClient", "UnlinkDeveloperIdentityCommand").sc(UnlinkDeveloperIdentity).build() { - } - - class UnlinkIdentityCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "UnlinkIdentity", {}).n("CognitoIdentityClient", "UnlinkIdentityCommand").sc(UnlinkIdentity).build() { - } - - class UntagResourceCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "UntagResource", {}).n("CognitoIdentityClient", "UntagResourceCommand").sc(UntagResource).build() { - } - - class UpdateIdentityPoolCommand extends smithyClient.Command.classBuilder().ep(commonParams).m(function(Command, cs, config2, o2) { - return [middlewareEndpoint.getEndpointPlugin(config2, Command.getEndpointParameterInstructions())]; - }).s("AWSCognitoIdentityService", "UpdateIdentityPool", {}).n("CognitoIdentityClient", "UpdateIdentityPoolCommand").sc(UpdateIdentityPool).build() { - } - var commands = { - CreateIdentityPoolCommand, - DeleteIdentitiesCommand, - DeleteIdentityPoolCommand, - DescribeIdentityCommand, - DescribeIdentityPoolCommand, - GetCredentialsForIdentityCommand, - GetIdCommand, - GetIdentityPoolRolesCommand, - GetOpenIdTokenCommand, - GetOpenIdTokenForDeveloperIdentityCommand, - GetPrincipalTagAttributeMapCommand, - ListIdentitiesCommand, - ListIdentityPoolsCommand, - ListTagsForResourceCommand, - LookupDeveloperIdentityCommand, - MergeDeveloperIdentitiesCommand, - SetIdentityPoolRolesCommand, - SetPrincipalTagAttributeMapCommand, - TagResourceCommand, - UnlinkDeveloperIdentityCommand, - UnlinkIdentityCommand, - UntagResourceCommand, - UpdateIdentityPoolCommand - }; - - class CognitoIdentity extends CognitoIdentityClient { - } - smithyClient.createAggregatedClient(commands, CognitoIdentity); - var paginateListIdentityPools = core2.createPaginator(CognitoIdentityClient, ListIdentityPoolsCommand, "NextToken", "NextToken", "MaxResults"); - var AmbiguousRoleResolutionType = { - AUTHENTICATED_ROLE: "AuthenticatedRole", - DENY: "Deny" - }; - var ErrorCode = { - ACCESS_DENIED: "AccessDenied", - INTERNAL_SERVER_ERROR: "InternalServerError" - }; - var MappingRuleMatchType = { - CONTAINS: "Contains", - EQUALS: "Equals", - NOT_EQUAL: "NotEqual", - STARTS_WITH: "StartsWith" - }; - var RoleMappingType = { - RULES: "Rules", - TOKEN: "Token" - }; - Object.defineProperty(exports, "$Command", { - enumerable: true, - get: function() { - return smithyClient.Command; - } - }); - Object.defineProperty(exports, "__Client", { - enumerable: true, - get: function() { - return smithyClient.Client; - } - }); - exports.AmbiguousRoleResolutionType = AmbiguousRoleResolutionType; - exports.CognitoIdentity = CognitoIdentity; - exports.CognitoIdentityClient = CognitoIdentityClient; - exports.CognitoIdentityServiceException = CognitoIdentityServiceException$1; - exports.ConcurrentModificationException = ConcurrentModificationException$1; - exports.CreateIdentityPoolCommand = CreateIdentityPoolCommand; - exports.DeleteIdentitiesCommand = DeleteIdentitiesCommand; - exports.DeleteIdentityPoolCommand = DeleteIdentityPoolCommand; - exports.DescribeIdentityCommand = DescribeIdentityCommand; - exports.DescribeIdentityPoolCommand = DescribeIdentityPoolCommand; - exports.DeveloperUserAlreadyRegisteredException = DeveloperUserAlreadyRegisteredException$1; - exports.ErrorCode = ErrorCode; - exports.ExternalServiceException = ExternalServiceException$1; - exports.GetCredentialsForIdentityCommand = GetCredentialsForIdentityCommand; - exports.GetIdCommand = GetIdCommand; - exports.GetIdentityPoolRolesCommand = GetIdentityPoolRolesCommand; - exports.GetOpenIdTokenCommand = GetOpenIdTokenCommand; - exports.GetOpenIdTokenForDeveloperIdentityCommand = GetOpenIdTokenForDeveloperIdentityCommand; - exports.GetPrincipalTagAttributeMapCommand = GetPrincipalTagAttributeMapCommand; - exports.InternalErrorException = InternalErrorException$1; - exports.InvalidIdentityPoolConfigurationException = InvalidIdentityPoolConfigurationException$1; - exports.InvalidParameterException = InvalidParameterException$1; - exports.LimitExceededException = LimitExceededException$1; - exports.ListIdentitiesCommand = ListIdentitiesCommand; - exports.ListIdentityPoolsCommand = ListIdentityPoolsCommand; - exports.ListTagsForResourceCommand = ListTagsForResourceCommand; - exports.LookupDeveloperIdentityCommand = LookupDeveloperIdentityCommand; - exports.MappingRuleMatchType = MappingRuleMatchType; - exports.MergeDeveloperIdentitiesCommand = MergeDeveloperIdentitiesCommand; - exports.NotAuthorizedException = NotAuthorizedException$1; - exports.ResourceConflictException = ResourceConflictException$1; - exports.ResourceNotFoundException = ResourceNotFoundException$1; - exports.RoleMappingType = RoleMappingType; - exports.SetIdentityPoolRolesCommand = SetIdentityPoolRolesCommand; - exports.SetPrincipalTagAttributeMapCommand = SetPrincipalTagAttributeMapCommand; - exports.TagResourceCommand = TagResourceCommand; - exports.TooManyRequestsException = TooManyRequestsException$1; - exports.UnlinkDeveloperIdentityCommand = UnlinkDeveloperIdentityCommand; - exports.UnlinkIdentityCommand = UnlinkIdentityCommand; - exports.UntagResourceCommand = UntagResourceCommand; - exports.UpdateIdentityPoolCommand = UpdateIdentityPoolCommand; - exports.paginateListIdentityPools = paginateListIdentityPools; -}); - -// ../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/loadCognitoIdentity-BPNvueUJ.js -var require_loadCognitoIdentity_BPNvueUJ = __commonJS((exports) => { - var clientCognitoIdentity = require_dist_cjs126(); - Object.defineProperty(exports, "CognitoIdentityClient", { - enumerable: true, - get: function() { - return clientCognitoIdentity.CognitoIdentityClient; - } - }); - Object.defineProperty(exports, "GetCredentialsForIdentityCommand", { - enumerable: true, - get: function() { - return clientCognitoIdentity.GetCredentialsForIdentityCommand; - } - }); - Object.defineProperty(exports, "GetIdCommand", { - enumerable: true, - get: function() { - return clientCognitoIdentity.GetIdCommand; - } - }); -}); - -// ../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js -var require_dist_cjs127 = __commonJS((exports) => { - var propertyProvider = require_dist_cjs76(); - function resolveLogins(logins) { - return Promise.all(Object.keys(logins).reduce((arr, name) => { - const tokenOrProvider = logins[name]; - if (typeof tokenOrProvider === "string") { - arr.push([name, tokenOrProvider]); - } else { - arr.push(tokenOrProvider().then((token) => [name, token])); - } - return arr; - }, [])).then((resolvedPairs) => resolvedPairs.reduce((logins2, [key, value]) => { - logins2[key] = value; - return logins2; - }, {})); - } - function fromCognitoIdentity(parameters) { - return async (awsIdentityProperties) => { - parameters.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity"); - const { GetCredentialsForIdentityCommand, CognitoIdentityClient } = await Promise.resolve().then(function() { - return require_loadCognitoIdentity_BPNvueUJ(); - }); - const fromConfigs = (property2) => parameters.clientConfig?.[property2] ?? parameters.parentClientConfig?.[property2] ?? awsIdentityProperties?.callerClientConfig?.[property2]; - const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters.logger), SessionToken } = throwOnMissingCredentials(parameters.logger) } = await (parameters.client ?? new CognitoIdentityClient(Object.assign({}, parameters.clientConfig ?? {}, { - region: fromConfigs("region"), - profile: fromConfigs("profile"), - userAgentAppId: fromConfigs("userAgentAppId") - }))).send(new GetCredentialsForIdentityCommand({ - CustomRoleArn: parameters.customRoleArn, - IdentityId: parameters.identityId, - Logins: parameters.logins ? await resolveLogins(parameters.logins) : undefined - })); - return { - identityId: parameters.identityId, - accessKeyId: AccessKeyId, - secretAccessKey: SecretKey, - sessionToken: SessionToken, - expiration: Expiration - }; - }; - } - function throwOnMissingAccessKeyId(logger) { - throw new propertyProvider.CredentialsProviderError("Response from Amazon Cognito contained no access key ID", { logger }); - } - function throwOnMissingCredentials(logger) { - throw new propertyProvider.CredentialsProviderError("Response from Amazon Cognito contained no credentials", { logger }); - } - function throwOnMissingSecretKey(logger) { - throw new propertyProvider.CredentialsProviderError("Response from Amazon Cognito contained no secret key", { logger }); - } - var STORE_NAME = "IdentityIds"; - - class IndexedDbStorage { - dbName; - constructor(dbName = "aws:cognito-identity-ids") { - this.dbName = dbName; - } - getItem(key) { - return this.withObjectStore("readonly", (store) => { - const req = store.get(key); - return new Promise((resolve8) => { - req.onerror = () => resolve8(null); - req.onsuccess = () => resolve8(req.result ? req.result.value : null); - }); - }).catch(() => null); - } - removeItem(key) { - return this.withObjectStore("readwrite", (store) => { - const req = store.delete(key); - return new Promise((resolve8, reject2) => { - req.onerror = () => reject2(req.error); - req.onsuccess = () => resolve8(); - }); - }); - } - setItem(id, value) { - return this.withObjectStore("readwrite", (store) => { - const req = store.put({ id, value }); - return new Promise((resolve8, reject2) => { - req.onerror = () => reject2(req.error); - req.onsuccess = () => resolve8(); - }); - }); - } - getDb() { - const openDbRequest = self.indexedDB.open(this.dbName, 1); - return new Promise((resolve8, reject2) => { - openDbRequest.onsuccess = () => { - resolve8(openDbRequest.result); - }; - openDbRequest.onerror = () => { - reject2(openDbRequest.error); - }; - openDbRequest.onblocked = () => { - reject2(new Error("Unable to access DB")); - }; - openDbRequest.onupgradeneeded = () => { - const db = openDbRequest.result; - db.onerror = () => { - reject2(new Error("Failed to create object store")); - }; - db.createObjectStore(STORE_NAME, { keyPath: "id" }); - }; - }); - } - withObjectStore(mode, action) { - return this.getDb().then((db) => { - const tx = db.transaction(STORE_NAME, mode); - tx.oncomplete = () => db.close(); - return new Promise((resolve8, reject2) => { - tx.onerror = () => reject2(tx.error); - resolve8(action(tx.objectStore(STORE_NAME))); - }).catch((err) => { - db.close(); - throw err; - }); - }); - } - } - - class InMemoryStorage { - store; - constructor(store = {}) { - this.store = store; - } - getItem(key) { - if (key in this.store) { - return this.store[key]; - } - return null; - } - removeItem(key) { - delete this.store[key]; - } - setItem(key, value) { - this.store[key] = value; - } - } - var inMemoryStorage = new InMemoryStorage; - function localStorage2() { - if (typeof self === "object" && self.indexedDB) { - return new IndexedDbStorage; - } - if (typeof window === "object" && window.localStorage) { - return window.localStorage; - } - return inMemoryStorage; - } - function fromCognitoIdentityPool({ accountId, cache: cache2 = localStorage2(), client, clientConfig, customRoleArn, identityPoolId, logins, userIdentifier = !logins || Object.keys(logins).length === 0 ? "ANONYMOUS" : undefined, logger, parentClientConfig }) { - logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity"); - const cacheKey = userIdentifier ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}` : undefined; - let provider = async (awsIdentityProperties) => { - const { GetIdCommand, CognitoIdentityClient } = await Promise.resolve().then(function() { - return require_loadCognitoIdentity_BPNvueUJ(); - }); - const fromConfigs = (property2) => clientConfig?.[property2] ?? parentClientConfig?.[property2] ?? awsIdentityProperties?.callerClientConfig?.[property2]; - const _client = client ?? new CognitoIdentityClient(Object.assign({}, clientConfig ?? {}, { - region: fromConfigs("region"), - profile: fromConfigs("profile"), - userAgentAppId: fromConfigs("userAgentAppId") - })); - let identityId = cacheKey && await cache2.getItem(cacheKey); - if (!identityId) { - const { IdentityId = throwOnMissingId(logger) } = await _client.send(new GetIdCommand({ - AccountId: accountId, - IdentityPoolId: identityPoolId, - Logins: logins ? await resolveLogins(logins) : undefined - })); - identityId = IdentityId; - if (cacheKey) { - Promise.resolve(cache2.setItem(cacheKey, identityId)).catch(() => {}); - } - } - provider = fromCognitoIdentity({ - client: _client, - customRoleArn, - logins, - identityId - }); - return provider(awsIdentityProperties); - }; - return (awsIdentityProperties) => provider(awsIdentityProperties).catch(async (err) => { - if (cacheKey) { - Promise.resolve(cache2.removeItem(cacheKey)).catch(() => {}); - } - throw err; - }); - } - function throwOnMissingId(logger) { - throw new propertyProvider.CredentialsProviderError("Response from Amazon Cognito contained no identity ID", { logger }); - } - exports.fromCognitoIdentity = fromCognitoIdentity; - exports.fromCognitoIdentityPool = fromCognitoIdentityPool; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js -var require_fromCognitoIdentity2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromCognitoIdentity = undefined; - var credential_provider_cognito_identity_1 = require_dist_cjs127(); - var fromCognitoIdentity = (options) => (0, credential_provider_cognito_identity_1.fromCognitoIdentity)({ - ...options - }); - exports.fromCognitoIdentity = fromCognitoIdentity; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js -var require_fromCognitoIdentityPool2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromCognitoIdentityPool = undefined; - var credential_provider_cognito_identity_1 = require_dist_cjs127(); - var fromCognitoIdentityPool = (options) => (0, credential_provider_cognito_identity_1.fromCognitoIdentityPool)({ - ...options - }); - exports.fromCognitoIdentityPool = fromCognitoIdentityPool; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js -var require_fromContainerMetadata2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromContainerMetadata = undefined; - var credential_provider_imds_1 = require_dist_cjs95(); - var fromContainerMetadata = (init) => { - init?.logger?.debug("@smithy/credential-provider-imds", "fromContainerMetadata"); - return (0, credential_provider_imds_1.fromContainerMetadata)(init); - }; - exports.fromContainerMetadata = fromContainerMetadata; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js -var require_fromEnv2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromEnv = undefined; - var credential_provider_env_1 = require_dist_cjs94(); - var fromEnv = (init) => (0, credential_provider_env_1.fromEnv)(init); - exports.fromEnv = fromEnv; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js -var require_fromIni2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromIni = undefined; - var credential_provider_ini_1 = require_dist_cjs108(); - var fromIni = (init = {}) => (0, credential_provider_ini_1.fromIni)({ - ...init - }); - exports.fromIni = fromIni; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js -var require_fromInstanceMetadata2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromInstanceMetadata = undefined; - var client_1 = require_client3(); - var credential_provider_imds_1 = require_dist_cjs95(); - var fromInstanceMetadata = (init) => { - init?.logger?.debug("@smithy/credential-provider-imds", "fromInstanceMetadata"); - return async () => (0, credential_provider_imds_1.fromInstanceMetadata)(init)().then((creds) => (0, client_1.setCredentialFeature)(creds, "CREDENTIALS_IMDS", "0")); - }; - exports.fromInstanceMetadata = fromInstanceMetadata; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromLoginCredentials.js -var require_fromLoginCredentials2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromLoginCredentials = undefined; - var credential_provider_login_1 = require_dist_cjs105(); - var fromLoginCredentials = (init) => (0, credential_provider_login_1.fromLoginCredentials)({ - ...init - }); - exports.fromLoginCredentials = fromLoginCredentials; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js -var require_fromNodeProviderChain2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromNodeProviderChain = undefined; - var credential_provider_node_1 = require_dist_cjs109(); - var fromNodeProviderChain = (init = {}) => (0, credential_provider_node_1.defaultProvider)({ - ...init - }); - exports.fromNodeProviderChain = fromNodeProviderChain; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js -var require_fromProcess2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromProcess = undefined; - var credential_provider_process_1 = require_dist_cjs106(); - var fromProcess = (init) => (0, credential_provider_process_1.fromProcess)(init); - exports.fromProcess = fromProcess; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js -var require_fromSSO2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromSSO = undefined; - var credential_provider_sso_1 = require_dist_cjs104(); - var fromSSO = (init = {}) => { - return (0, credential_provider_sso_1.fromSSO)({ ...init }); - }; - exports.fromSSO = fromSSO; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/loadSts.js -var require_loadSts2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.STSClient = exports.AssumeRoleCommand = undefined; - var sts_1 = require_sts2(); - Object.defineProperty(exports, "AssumeRoleCommand", { enumerable: true, get: function() { - return sts_1.AssumeRoleCommand; - } }); - Object.defineProperty(exports, "STSClient", { enumerable: true, get: function() { - return sts_1.STSClient; - } }); -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.base.js -var require_fromTemporaryCredentials_base2 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - } : function(o2, v) { - o2["default"] = v; - }); - var __importStar = exports && exports.__importStar || function() { - var ownKeys = function(o2) { - ownKeys = Object.getOwnPropertyNames || function(o3) { - var ar = []; - for (var k in o3) - if (Object.prototype.hasOwnProperty.call(o3, k)) - ar[ar.length] = k; - return ar; - }; - return ownKeys(o2); - }; - return function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result2 = {}; - if (mod2 != null) { - for (var k = ownKeys(mod2), i2 = 0;i2 < k.length; i2++) - if (k[i2] !== "default") - __createBinding(result2, mod2, k[i2]); - } - __setModuleDefault(result2, mod2); - return result2; - }; - }(); - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromTemporaryCredentials = undefined; - var core_1 = require_dist_cjs71(); - var property_provider_1 = require_dist_cjs76(); - var ASSUME_ROLE_DEFAULT_REGION = "us-east-1"; - var fromTemporaryCredentials = (options, credentialDefaultProvider, regionProvider) => { - let stsClient; - return async (awsIdentityProperties = {}) => { - const { callerClientConfig } = awsIdentityProperties; - const profile = options.clientConfig?.profile ?? callerClientConfig?.profile; - const logger = options.logger ?? callerClientConfig?.logger; - logger?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)"); - const params = { ...options.params, RoleSessionName: options.params.RoleSessionName ?? "aws-sdk-js-" + Date.now() }; - if (params?.SerialNumber) { - if (!options.mfaCodeProvider) { - throw new property_provider_1.CredentialsProviderError(`Temporary credential requires multi-factor authentication, but no MFA code callback was provided.`, { - tryNextLink: false, - logger - }); - } - params.TokenCode = await options.mfaCodeProvider(params?.SerialNumber); - } - const { AssumeRoleCommand, STSClient } = await Promise.resolve().then(() => __importStar(require_loadSts2())); - if (!stsClient) { - const defaultCredentialsOrError = typeof credentialDefaultProvider === "function" ? credentialDefaultProvider() : undefined; - const credentialSources = [ - options.masterCredentials, - options.clientConfig?.credentials, - void callerClientConfig?.credentials, - callerClientConfig?.credentialDefaultProvider?.(), - defaultCredentialsOrError - ]; - let credentialSource = "STS client default credentials"; - if (credentialSources[0]) { - credentialSource = "options.masterCredentials"; - } else if (credentialSources[1]) { - credentialSource = "options.clientConfig.credentials"; - } else if (credentialSources[2]) { - credentialSource = "caller client's credentials"; - throw new Error("fromTemporaryCredentials recursion in callerClientConfig.credentials"); - } else if (credentialSources[3]) { - credentialSource = "caller client's credentialDefaultProvider"; - } else if (credentialSources[4]) { - credentialSource = "AWS SDK default credentials"; - } - const regionSources = [ - options.clientConfig?.region, - callerClientConfig?.region, - await regionProvider?.({ - profile - }), - ASSUME_ROLE_DEFAULT_REGION - ]; - let regionSource = "default partition's default region"; - if (regionSources[0]) { - regionSource = "options.clientConfig.region"; - } else if (regionSources[1]) { - regionSource = "caller client's region"; - } else if (regionSources[2]) { - regionSource = "file or env region"; - } - const requestHandlerSources = [ - filterRequestHandler(options.clientConfig?.requestHandler), - filterRequestHandler(callerClientConfig?.requestHandler) - ]; - let requestHandlerSource = "STS default requestHandler"; - if (requestHandlerSources[0]) { - requestHandlerSource = "options.clientConfig.requestHandler"; - } else if (requestHandlerSources[1]) { - requestHandlerSource = "caller client's requestHandler"; - } - logger?.debug?.(`@aws-sdk/credential-providers - fromTemporaryCredentials STS client init with ` + `${regionSource}=${await (0, core_1.normalizeProvider)(coalesce(regionSources))()}, ${credentialSource}, ${requestHandlerSource}.`); - stsClient = new STSClient({ - userAgentAppId: callerClientConfig?.userAgentAppId, - ...options.clientConfig, - credentials: coalesce(credentialSources), - logger, - profile, - region: coalesce(regionSources), - requestHandler: coalesce(requestHandlerSources) - }); - } - if (options.clientPlugins) { - for (const plugin of options.clientPlugins) { - stsClient.middlewareStack.use(plugin); - } - } - const { Credentials } = await stsClient.send(new AssumeRoleCommand(params)); - if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { - throw new property_provider_1.CredentialsProviderError(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`, { - logger - }); - } - return { - accessKeyId: Credentials.AccessKeyId, - secretAccessKey: Credentials.SecretAccessKey, - sessionToken: Credentials.SessionToken, - expiration: Credentials.Expiration, - credentialScope: Credentials.CredentialScope - }; - }; - }; - exports.fromTemporaryCredentials = fromTemporaryCredentials; - var filterRequestHandler = (requestHandler) => { - return requestHandler?.metadata?.handlerProtocol === "h2" ? undefined : requestHandler; - }; - var coalesce = (args) => { - for (const item of args) { - if (item !== undefined) { - return item; - } - } - }; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js -var require_fromTemporaryCredentials2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromTemporaryCredentials = undefined; - var config_resolver_1 = require_dist_cjs86(); - var node_config_provider_1 = require_dist_cjs89(); - var fromNodeProviderChain_1 = require_fromNodeProviderChain2(); - var fromTemporaryCredentials_base_1 = require_fromTemporaryCredentials_base2(); - var fromTemporaryCredentials = (options) => { - return (0, fromTemporaryCredentials_base_1.fromTemporaryCredentials)(options, fromNodeProviderChain_1.fromNodeProviderChain, async ({ profile = process.env.AWS_PROFILE }) => (0, node_config_provider_1.loadConfig)({ - environmentVariableSelector: (env4) => env4.AWS_REGION, - configFileSelector: (profileData) => { - return profileData.region; - }, - default: () => { - return; - } - }, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, profile })()); - }; - exports.fromTemporaryCredentials = fromTemporaryCredentials; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js -var require_fromTokenFile4 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromTokenFile = undefined; - var credential_provider_web_identity_1 = require_dist_cjs107(); - var fromTokenFile = (init = {}) => (0, credential_provider_web_identity_1.fromTokenFile)({ - ...init - }); - exports.fromTokenFile = fromTokenFile; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js -var require_fromWebToken4 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromWebToken = undefined; - var credential_provider_web_identity_1 = require_dist_cjs107(); - var fromWebToken = (init) => (0, credential_provider_web_identity_1.fromWebToken)({ - ...init - }); - exports.fromWebToken = fromWebToken; -}); - -// ../node_modules/@aws-sdk/credential-providers/dist-cjs/index.js -var require_dist_cjs128 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fromHttp = undefined; - var tslib_1 = require_tslib2(); - tslib_1.__exportStar(require_createCredentialChain2(), exports); - tslib_1.__exportStar(require_fromCognitoIdentity2(), exports); - tslib_1.__exportStar(require_fromCognitoIdentityPool2(), exports); - tslib_1.__exportStar(require_fromContainerMetadata2(), exports); - tslib_1.__exportStar(require_fromEnv2(), exports); - var credential_provider_http_1 = require_dist_cjs96(); - Object.defineProperty(exports, "fromHttp", { enumerable: true, get: function() { - return credential_provider_http_1.fromHttp; - } }); - tslib_1.__exportStar(require_fromIni2(), exports); - tslib_1.__exportStar(require_fromInstanceMetadata2(), exports); - tslib_1.__exportStar(require_fromLoginCredentials2(), exports); - tslib_1.__exportStar(require_fromNodeProviderChain2(), exports); - tslib_1.__exportStar(require_fromProcess2(), exports); - tslib_1.__exportStar(require_fromSSO2(), exports); - tslib_1.__exportStar(require_fromTemporaryCredentials2(), exports); - tslib_1.__exportStar(require_fromTokenFile4(), exports); - tslib_1.__exportStar(require_fromWebToken4(), exports); -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/core/auth.mjs -import assert2 from "assert"; -var import_sha256_js, import_fetch_http_handler, import_protocol_http, import_signature_v4, DEFAULT_PROVIDER_CHAIN_RESOLVER = () => Promise.resolve().then(() => __toESM(require_dist_cjs128(), 1)).then(({ fromNodeProviderChain }) => fromNodeProviderChain({ - clientConfig: { - requestHandler: new import_fetch_http_handler.FetchHttpHandler({ - requestInit: (httpRequest) => { - return { - ...httpRequest - }; - } - }) - } -})).catch((error42) => { - throw new Error(`Failed to import '@aws-sdk/credential-providers'.You can provide a custom \`providerChainResolver\` in the client options if your runtime does not have access to '@aws-sdk/credential-providers': \`new AnthropicBedrock({ providerChainResolver })\` Original error: ${error42.message}`); -}), getAuthHeaders = async (req, props) => { - assert2(req.method, "Expected request method property to be set"); - const providerChain = await (props.providerChainResolver ? props.providerChainResolver() : DEFAULT_PROVIDER_CHAIN_RESOLVER()); - const credentials = await withTempEnv(() => { - if (props.awsAccessKey) { - process.env["AWS_ACCESS_KEY_ID"] = props.awsAccessKey; - } - if (props.awsSecretKey) { - process.env["AWS_SECRET_ACCESS_KEY"] = props.awsSecretKey; - } - if (props.awsSessionToken) { - process.env["AWS_SESSION_TOKEN"] = props.awsSessionToken; - } - }, () => providerChain()); - const signer = new import_signature_v4.SignatureV4({ - service: "bedrock", - region: props.regionName, - credentials, - sha256: import_sha256_js.Sha256 - }); - const url3 = new URL(props.url); - const headers = !req.headers ? {} : (Symbol.iterator in req.headers) ? Object.fromEntries(Array.from(req.headers).map((header) => [...header])) : { ...req.headers }; - delete headers["connection"]; - headers["host"] = url3.hostname; - const request = new import_protocol_http.HttpRequest({ - method: req.method.toUpperCase(), - protocol: url3.protocol, - path: url3.pathname, - headers, - body: req.body - }); - const signed = await signer.sign(request); - return signed.headers; -}, withTempEnv = async (updateEnv, fn) => { - const previousEnv = { ...process.env }; - try { - updateEnv(); - return await fn(); - } finally { - process.env = previousEnv; - } -}; -var init_auth = __esm(() => { - import_sha256_js = __toESM(require_build3(), 1); - import_fetch_http_handler = __toESM(require_dist_cjs117(), 1); - import_protocol_http = __toESM(require_dist_cjs56(), 1); - import_signature_v4 = __toESM(require_dist_cjs78(), 1); -}); - -// ../node_modules/@anthropic-ai/sdk/index.mjs -var init_sdk2 = __esm(() => { - init_client3(); - init_uploads4(); - init_api_promise2(); - init_client3(); - init_pagination2(); - init_error4(); -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/AWS_restJson1.mjs -var import_smithy_client, import_client_bedrock_runtime, de_InternalServerExceptionRes = async (parsedOutput, context) => { - const contents = import_smithy_client.map({}); - const data = parsedOutput.body; - const doc2 = import_smithy_client.take(data, { - message: import_smithy_client.expectString - }); - Object.assign(contents, doc2); - const exception = new import_client_bedrock_runtime.InternalServerException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return import_smithy_client.decorateServiceException(exception, parsedOutput.body); -}, de_ModelStreamErrorExceptionRes = async (parsedOutput, context) => { - const contents = import_smithy_client.map({}); - const data = parsedOutput.body; - const doc2 = import_smithy_client.take(data, { - message: import_smithy_client.expectString, - originalMessage: import_smithy_client.expectString, - originalStatusCode: import_smithy_client.expectInt32 - }); - Object.assign(contents, doc2); - const exception = new import_client_bedrock_runtime.ModelStreamErrorException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return import_smithy_client.decorateServiceException(exception, parsedOutput.body); -}, de_ThrottlingExceptionRes = async (parsedOutput, context) => { - const contents = import_smithy_client.map({}); - const data = parsedOutput.body; - const doc2 = import_smithy_client.take(data, { - message: import_smithy_client.expectString - }); - Object.assign(contents, doc2); - const exception = new import_client_bedrock_runtime.ThrottlingException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return import_smithy_client.decorateServiceException(exception, parsedOutput.body); -}, de_ValidationExceptionRes = async (parsedOutput, context) => { - const contents = import_smithy_client.map({}); - const data = parsedOutput.body; - const doc2 = import_smithy_client.take(data, { - message: import_smithy_client.expectString - }); - Object.assign(contents, doc2); - const exception = new import_client_bedrock_runtime.ValidationException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents - }); - return import_smithy_client.decorateServiceException(exception, parsedOutput.body); -}, de_ResponseStream = (output, context) => { - return context.eventStreamMarshaller.deserialize(output, async (event) => { - if (event["chunk"] != null) { - return { - chunk: await de_PayloadPart_event(event["chunk"], context) - }; - } - if (event["internalServerException"] != null) { - return { - internalServerException: await de_InternalServerException_event(event["internalServerException"], context) - }; - } - if (event["modelStreamErrorException"] != null) { - return { - modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context) - }; - } - if (event["validationException"] != null) { - return { - validationException: await de_ValidationException_event(event["validationException"], context) - }; - } - if (event["throttlingException"] != null) { - return { - throttlingException: await de_ThrottlingException_event(event["throttlingException"], context) - }; - } - return { $unknown: output }; - }); -}, de_InternalServerException_event = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseBody(output.body, context) - }; - return de_InternalServerExceptionRes(parsedOutput, context); -}, de_ModelStreamErrorException_event = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseBody(output.body, context) - }; - return de_ModelStreamErrorExceptionRes(parsedOutput, context); -}, de_PayloadPart_event = async (output, context) => { - const contents = {}; - const data = await parseBody(output.body, context); - Object.assign(contents, de_PayloadPart(data, context)); - return contents; -}, de_ThrottlingException_event = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseBody(output.body, context) - }; - return de_ThrottlingExceptionRes(parsedOutput, context); -}, de_ValidationException_event = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseBody(output.body, context) - }; - return de_ValidationExceptionRes(parsedOutput, context); -}, de_PayloadPart = (output, context) => { - return import_smithy_client.take(output, { - bytes: context.base64Decoder - }); -}, deserializeMetadata = (output) => ({ - httpStatusCode: output.statusCode, - requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"] ?? "", - extendedRequestId: output.headers["x-amz-id-2"] ?? "", - cfId: output.headers["x-amz-cf-id"] ?? "" -}), collectBodyString = (streamBody, context) => import_smithy_client.collectBody(streamBody, context).then((body) => context.utf8Encoder(body)), parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - return JSON.parse(encoded); - } - return {}; -}); -var init_AWS_restJson1 = __esm(() => { - import_smithy_client = __toESM(require_dist_cjs81(), 1); - import_client_bedrock_runtime = __toESM(require_dist_cjs122(), 1); -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/internal/shims.mjs -function ReadableStreamToAsyncIterable3(stream4) { - if (stream4[Symbol.asyncIterator]) - return stream4; - const reader = stream4.getReader(); - return { - async next() { - try { - const result2 = await reader.read(); - if (result2?.done) - reader.releaseLock(); - return result2; - } catch (e) { - reader.releaseLock(); - throw e; - } - }, - async return() { - const cancelPromise = reader.cancel(); - reader.releaseLock(); - await cancelPromise; - return { done: true, value: undefined }; - }, - [Symbol.asyncIterator]() { - return this; - } - }; -} - -// ../node_modules/@anthropic-ai/bedrock-sdk/core/error.mjs -var init_error6 = __esm(() => { - init_error4(); -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/internal/utils/values.mjs -function isObj2(obj) { - return obj != null && typeof obj === "object" && !Array.isArray(obj); -} -var isArray5 = (val) => (isArray5 = Array.isArray, isArray5(val)), isReadonlyArray, safeJSON3 = (text) => { - try { - return JSON.parse(text); - } catch (err) { - return; - } -}; -var init_values5 = __esm(() => { - init_error6(); - isReadonlyArray = isArray5; -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/internal/utils/log.mjs -function noop8() {} -function makeLogFn3(fnLevel, logger, logLevel) { - if (!logger || levelNumbers3[fnLevel] > levelNumbers3[logLevel]) { - return noop8; - } else { - return logger[fnLevel].bind(logger); - } -} -function loggerFor3(client) { - const logger = client.logger; - const logLevel = client.logLevel ?? "off"; - if (!logger) { - return noopLogger3; - } - const cachedLogger = cachedLoggers3.get(logger); - if (cachedLogger && cachedLogger[0] === logLevel) { - return cachedLogger[1]; - } - const levelLogger = { - error: makeLogFn3("error", logger, logLevel), - warn: makeLogFn3("warn", logger, logLevel), - info: makeLogFn3("info", logger, logLevel), - debug: makeLogFn3("debug", logger, logLevel) - }; - cachedLoggers3.set(logger, [logLevel, levelLogger]); - return levelLogger; -} -var levelNumbers3, noopLogger3, cachedLoggers3; -var init_log5 = __esm(() => { - init_values5(); - levelNumbers3 = { - off: 0, - error: 200, - warn: 300, - info: 400, - debug: 500 - }; - noopLogger3 = { - error: noop8, - warn: noop8, - info: noop8, - debug: noop8 - }; - cachedLoggers3 = /* @__PURE__ */ new WeakMap; -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/core/streaming.mjs -function isAbortError5(err) { - return typeof err === "object" && err !== null && (("name" in err) && err.name === "AbortError" || ("message" in err) && String(err.message).includes("FetchRequestCanceledException")); -} -var import_eventstream_serde_node, import_util_base64, import_fetch_http_handler2, toUtf8 = (input) => new TextDecoder("utf-8").decode(input), fromUtf8 = (input) => new TextEncoder().encode(input), getMinimalSerdeContext = () => { - const marshaller = new import_eventstream_serde_node.EventStreamMarshaller({ utf8Encoder: toUtf8, utf8Decoder: fromUtf8 }); - return { - base64Decoder: import_util_base64.fromBase64, - base64Encoder: import_util_base64.toBase64, - utf8Decoder: fromUtf8, - utf8Encoder: toUtf8, - eventStreamMarshaller: marshaller, - streamCollector: import_fetch_http_handler2.streamCollector - }; -}, Stream3; -var init_streaming6 = __esm(() => { - import_eventstream_serde_node = __toESM(require_dist_cjs121(), 1); - import_util_base64 = __toESM(require_dist_cjs65(), 1); - import_fetch_http_handler2 = __toESM(require_dist_cjs117(), 1); - init_streaming5(); - init_error5(); - init_sdk2(); - init_AWS_restJson1(); - init_values5(); - init_log5(); - Stream3 = class Stream3 extends Stream2 { - static fromSSEResponse(response, controller, client) { - let consumed = false; - const logger = client ? loggerFor3(client) : console; - async function* iterMessages() { - if (!response.body) { - controller.abort(); - throw new AnthropicError2(`Attempted to iterate over a response with no body`); - } - const responseBodyIter = ReadableStreamToAsyncIterable3(response.body); - const eventStream = de_ResponseStream(responseBodyIter, getMinimalSerdeContext()); - for await (const event of eventStream) { - if (event.chunk && event.chunk.bytes) { - const s = toUtf8(event.chunk.bytes); - yield { event: "chunk", data: s, raw: [] }; - } else if (event.internalServerException) { - yield { event: "error", data: "InternalServerException", raw: [] }; - } else if (event.modelStreamErrorException) { - yield { event: "error", data: "ModelStreamErrorException", raw: [] }; - } else if (event.validationException) { - yield { event: "error", data: "ValidationException", raw: [] }; - } else if (event.throttlingException) { - yield { event: "error", data: "ThrottlingException", raw: [] }; - } - } - } - 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 iterMessages()) { - if (sse.event === "chunk") { - try { - yield JSON.parse(sse.data); - } catch (e) { - logger.error(`Could not parse message into JSON:`, sse.data); - logger.error(`From chunk:`, sse.raw); - throw e; - } - } - if (sse.event === "error") { - const errText = sse.data; - const errJSON = safeJSON3(errText); - const errMessage = errJSON ? undefined : errText; - throw APIError2.generate(undefined, errJSON, errMessage, response.headers); - } - } - done = true; - } catch (e) { - if (isAbortError5(e)) - return; - throw e; - } finally { - if (!done) - controller.abort(); - } - } - return new Stream3(iterator2, controller); - } - }; -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/internal/utils/env.mjs -var readEnv3 = (env4) => { - if (typeof globalThis.process !== "undefined") { - return globalThis.process.env?.[env4]?.trim() ?? undefined; - } - if (typeof globalThis.Deno !== "undefined") { - return globalThis.Deno.env?.get?.(env4)?.trim(); - } - return; -}; - -// ../node_modules/@anthropic-ai/bedrock-sdk/internal/headers.mjs -function* iterateHeaders3(headers) { - if (!headers) - return; - if (brand_privateNullableHeaders3 in headers) { - const { values: values2, nulls } = headers; - yield* values2.entries(); - for (const name of nulls) { - yield [name, null]; - } - return; - } - let shouldClear = false; - let iter; - if (headers instanceof Headers) { - iter = headers.entries(); - } else if (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 values2 = isReadonlyArray(row[1]) ? row[1] : [row[1]]; - let didClear = false; - for (const value of values2) { - if (value === undefined) - continue; - if (shouldClear && !didClear) { - didClear = true; - yield [name, null]; - } - yield [name, value]; - } - } -} -var brand_privateNullableHeaders3, buildHeaders3 = (newHeaders) => { - const targetHeaders = new Headers; - const nullHeaders = new Set; - for (const headers of newHeaders) { - const seenHeaders = new Set; - for (const [name, value] of iterateHeaders3(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); - } - } - } - return { [brand_privateNullableHeaders3]: true, values: targetHeaders, nulls: nullHeaders }; -}; -var init_headers3 = __esm(() => { - init_values5(); - brand_privateNullableHeaders3 = Symbol.for("brand.privateNullableHeaders"); -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/internal/utils/path.mjs -function encodeURIPath3(str) { - return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent); -} -var EMPTY, createPathTagFunction3 = (pathEncoder = encodeURIPath3) => function path(statics, ...params) { - if (statics.length === 1) - return statics[0]; - let postPath = false; - const invalidSegments = []; - const path10 = statics.reduce((previousValue, currentValue, index) => { - if (/[?#]/.test(currentValue)) { - postPath = true; - } - const value = params[index]; - let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value); - if (index !== params.length && (value == null || typeof value === "object" && 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 + (index === params.length ? "" : encoded); - }, ""); - const pathOnly = path10.split(/[?#]/, 1)[0]; - const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi; - let match; - while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) { - invalidSegments.push({ - start: match.index, - length: match[0].length, - error: `Value "${match[0]}" can't be safely passed as a path parameter` - }); - } - invalidSegments.sort((a2, b) => a2.start - b.start); - if (invalidSegments.length > 0) { - let lastEnd = 0; - const underline2 = 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 AnthropicError2(`Path parameters result in path with invalid segments: -${invalidSegments.map((e) => e.error).join(` -`)} -${path10} -${underline2}`); - } - return path10; -}, path10; -var init_path4 = __esm(() => { - init_error6(); - EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null)); - path10 = /* @__PURE__ */ createPathTagFunction3(encodeURIPath3); -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/client.mjs -function makeMessagesResource(client) { - const resource = new Messages4(client); - delete resource.batches; - delete resource.countTokens; - return resource; -} -function makeBetaResource(client) { - const resource = new Beta2(client); - delete resource.promptCaching; - delete resource.messages.batches; - delete resource.messages.countTokens; - return resource; -} -var DEFAULT_VERSION = "bedrock-2023-05-31", MODEL_ENDPOINTS, AnthropicBedrock; -var init_client4 = __esm(() => { - init_client3(); - init_resources2(); - init_auth(); - init_streaming6(); - init_values5(); - init_headers3(); - init_path4(); - init_client3(); - MODEL_ENDPOINTS = new Set(["/v1/complete", "/v1/messages", "/v1/messages?beta=true"]); - AnthropicBedrock = class AnthropicBedrock extends BaseAnthropic2 { - constructor({ awsRegion = readEnv3("AWS_REGION") ?? "us-east-1", baseURL = readEnv3("ANTHROPIC_BEDROCK_BASE_URL") ?? `https://bedrock-runtime.${awsRegion}.amazonaws.com`, awsSecretKey = null, awsAccessKey = null, awsSessionToken = null, providerChainResolver = null, ...opts } = {}) { - super({ - baseURL, - ...opts - }); - this.skipAuth = false; - this.messages = makeMessagesResource(this); - this.completions = new Completions2(this); - this.beta = makeBetaResource(this); - this.awsSecretKey = awsSecretKey; - this.awsAccessKey = awsAccessKey; - this.awsRegion = awsRegion; - this.awsSessionToken = awsSessionToken; - this.skipAuth = opts.skipAuth ?? false; - this.providerChainResolver = providerChainResolver; - } - validateHeaders() {} - async prepareRequest(request, { url: url3, options }) { - if (this.skipAuth) { - return; - } - const regionName = this.awsRegion; - if (!regionName) { - throw new Error("Expected `awsRegion` option to be passed to the client or the `AWS_REGION` environment variable to be present"); - } - const headers = await getAuthHeaders(request, { - url: url3, - regionName, - awsAccessKey: this.awsAccessKey, - awsSecretKey: this.awsSecretKey, - awsSessionToken: this.awsSessionToken, - fetchOptions: this.fetchOptions, - providerChainResolver: this.providerChainResolver - }); - request.headers = buildHeaders3([headers, request.headers]).values; - } - async buildRequest(options) { - options.__streamClass = Stream3; - if (isObj2(options.body)) { - options.body = { ...options.body }; - } - if (isObj2(options.body)) { - if (!options.body["anthropic_version"]) { - options.body["anthropic_version"] = DEFAULT_VERSION; - } - if (options.headers && !options.body["anthropic_beta"]) { - const betas = buildHeaders3([options.headers]).values.get("anthropic-beta"); - if (betas != null) { - options.body["anthropic_beta"] = betas.split(","); - } - } - } - if (MODEL_ENDPOINTS.has(options.path) && options.method === "post") { - if (!isObj2(options.body)) { - throw new Error("Expected request body to be an object for post /v1/messages"); - } - const model = options.body["model"]; - options.body["model"] = undefined; - const stream4 = options.body["stream"]; - options.body["stream"] = undefined; - if (stream4) { - options.path = path10`/model/${model}/invoke-with-response-stream`; - } else { - options.path = path10`/model/${model}/invoke`; - } - } - return super.buildRequest(options); - } - }; -}); - -// ../node_modules/@anthropic-ai/bedrock-sdk/index.mjs +// stub-npm:@anthropic-ai/bedrock-sdk var exports_bedrock_sdk = {}; __export(exports_bedrock_sdk, { - default: () => AnthropicBedrock, - BaseAnthropic: () => BaseAnthropic2, - AnthropicBedrock: () => AnthropicBedrock + default: () => bedrock_sdk_default, + __stub__: () => __stub__4 }); +var handler4, stub4, bedrock_sdk_default, __stub__4 = true; var init_bedrock_sdk = __esm(() => { - init_client4(); - init_client4(); + handler4 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub4 = new Proxy({}, handler4); + bedrock_sdk_default = stub4; }); -// ../node_modules/@anthropic-ai/foundry-sdk/core/error.mjs -var init_error7 = __esm(() => { - init_error4(); -}); - -// ../node_modules/@anthropic-ai/foundry-sdk/internal/utils/values.mjs -var isArray6 = (val) => (isArray6 = Array.isArray, isArray6(val)), isReadonlyArray2; -var init_values6 = __esm(() => { - init_error7(); - isReadonlyArray2 = isArray6; -}); - -// ../node_modules/@anthropic-ai/foundry-sdk/internal/headers.mjs -function* iterateHeaders4(headers) { - if (!headers) - return; - if (brand_privateNullableHeaders4 in headers) { - const { values: values2, nulls } = headers; - yield* values2.entries(); - for (const name of nulls) { - yield [name, null]; - } - return; - } - let shouldClear = false; - let iter; - if (headers instanceof Headers) { - iter = headers.entries(); - } else if (isReadonlyArray2(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 values2 = isReadonlyArray2(row[1]) ? row[1] : [row[1]]; - let didClear = false; - for (const value of values2) { - if (value === undefined) - continue; - if (shouldClear && !didClear) { - didClear = true; - yield [name, null]; - } - yield [name, value]; - } - } -} -var brand_privateNullableHeaders4, buildHeaders4 = (newHeaders) => { - const targetHeaders = new Headers; - const nullHeaders = new Set; - for (const headers of newHeaders) { - const seenHeaders = new Set; - for (const [name, value] of iterateHeaders4(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); - } - } - } - return { [brand_privateNullableHeaders4]: true, values: targetHeaders, nulls: nullHeaders }; -}; -var init_headers4 = __esm(() => { - init_values6(); - brand_privateNullableHeaders4 = Symbol.for("brand.privateNullableHeaders"); -}); -// ../node_modules/@anthropic-ai/foundry-sdk/internal/utils/base64.mjs -var init_base64 = __esm(() => { - init_error7(); -}); - -// ../node_modules/@anthropic-ai/foundry-sdk/internal/utils/env.mjs -var readEnv4 = (env4) => { - if (typeof globalThis.process !== "undefined") { - return globalThis.process.env?.[env4]?.trim() ?? undefined; - } - if (typeof globalThis.Deno !== "undefined") { - return globalThis.Deno.env?.get?.(env4)?.trim(); - } - return; -}; - -// ../node_modules/@anthropic-ai/foundry-sdk/internal/utils/log.mjs -var init_log6 = __esm(() => { - init_values6(); -}); - -// stub-missing:/Users/chenqg/Downloads/node_modules/@anthropic-ai/foundry-sdk/internal/utils/uuid.mjs -var init_uuid = () => {}; - -// stub-missing:/Users/chenqg/Downloads/node_modules/@anthropic-ai/foundry-sdk/internal/utils/sleep.mjs -var init_sleep = () => {}; - -// ../node_modules/@anthropic-ai/foundry-sdk/internal/utils.mjs -var init_utils3 = __esm(() => { - init_values6(); - init_base64(); - init_log6(); - init_uuid(); - init_sleep(); -}); - -// ../node_modules/@anthropic-ai/foundry-sdk/client.mjs -function makeMessagesResource2(client2) { - const resource = new Messages4(client2); - delete resource.batches; - return resource; -} -function makeBetaResource2(client2) { - const resource = new Beta2(client2); - delete resource.messages.batches; - return resource; -} -var AnthropicFoundry; -var init_client5 = __esm(() => { - init_headers4(); - init_error7(); - init_utils3(); - init_client3(); - init_client3(); - init_resources2(); - AnthropicFoundry = class AnthropicFoundry extends Anthropic2 { - constructor({ baseURL = readEnv4("ANTHROPIC_FOUNDRY_BASE_URL"), apiKey = readEnv4("ANTHROPIC_FOUNDRY_API_KEY"), resource = readEnv4("ANTHROPIC_FOUNDRY_RESOURCE"), azureADTokenProvider, dangerouslyAllowBrowser, ...opts } = {}) { - if (typeof azureADTokenProvider === "function") { - dangerouslyAllowBrowser = true; - } - if (!azureADTokenProvider && !apiKey) { - throw new AnthropicError2("Missing credentials. Please pass one of `apiKey` and `azureTokenProvider`, or set the `ANTHROPIC_FOUNDRY_API_KEY` environment variable."); - } - if (azureADTokenProvider && apiKey) { - throw new AnthropicError2("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time."); - } - if (!baseURL) { - if (!resource) { - throw new AnthropicError2("Must provide one of the `baseURL` or `resource` arguments, or the `ANTHROPIC_FOUNDRY_RESOURCE` environment variable"); - } - baseURL = `https://${resource}.services.ai.azure.com/anthropic/`; - } else { - if (resource) { - throw new AnthropicError2("baseURL and resource are mutually exclusive"); - } - } - super({ - apiKey: azureADTokenProvider ?? apiKey, - baseURL, - ...opts, - ...dangerouslyAllowBrowser !== undefined ? { dangerouslyAllowBrowser } : {} - }); - this.resource = null; - this.messages = makeMessagesResource2(this); - this.beta = makeBetaResource2(this); - this.models = undefined; - } - async authHeaders() { - if (typeof this._options.apiKey === "function") { - let token; - try { - token = await this._options.apiKey(); - } catch (err) { - if (err instanceof AnthropicError2) - throw err; - throw new AnthropicError2(`Failed to get token from azureADTokenProvider: ${err.message}`, { cause: err }); - } - if (typeof token !== "string" || !token) { - throw new AnthropicError2(`Expected azureADTokenProvider function argument to return a string but it returned ${token}`); - } - return buildHeaders4([{ Authorization: `Bearer ${token}` }]); - } - if (typeof this._options.apiKey === "string") { - return buildHeaders4([{ "x-api-key": this.apiKey }]); - } - return; - } - validateHeaders() { - return; - } - }; -}); - -// ../node_modules/@anthropic-ai/foundry-sdk/index.mjs +// stub-npm:@anthropic-ai/foundry-sdk var exports_foundry_sdk = {}; __export(exports_foundry_sdk, { - default: () => AnthropicFoundry, - BaseAnthropic: () => BaseAnthropic2, - AnthropicFoundry: () => AnthropicFoundry + default: () => foundry_sdk_default, + __stub__: () => __stub__5 }); +var handler5, stub5, foundry_sdk_default, __stub__5 = true; var init_foundry_sdk = __esm(() => { - init_client5(); - init_client5(); + handler5 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub5 = new Proxy({}, handler5); + foundry_sdk_default = stub5; }); // stub-npm:@azure/identity var exports_identity = {}; __export(exports_identity, { - select: () => select, - input: () => input, default: () => identity_default2, - confirm: () => confirm, - __stub__: () => __stub__, - DestroyerOfModules: () => DestroyerOfModules + __stub__: () => __stub__6 }); -var handler, stub, identity_default2, __stub__ = true, confirm = () => {}, input = () => {}, select = () => {}, DestroyerOfModules = class { -}; +var handler6, stub6, identity_default2, __stub__6 = true; var init_identity2 = __esm(() => { - handler = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub = new Proxy({}, handler); - identity_default2 = stub; + handler6 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub6 = new Proxy({}, handler6); + identity_default2 = stub6; }); -// ../node_modules/extend/index.js +// stub-npm:@anthropic-ai/vertex-sdk +var exports_vertex_sdk = {}; +__export(exports_vertex_sdk, { + default: () => vertex_sdk_default, + __stub__: () => __stub__7 +}); +var handler7, stub7, vertex_sdk_default, __stub__7 = true; +var init_vertex_sdk = __esm(() => { + handler7 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub7 = new Proxy({}, handler7); + vertex_sdk_default = stub7; +}); + +// node_modules/extend/index.js var require_extend = __commonJS((exports, module) => { - var hasOwn5 = Object.prototype.hasOwnProperty; + var hasOwn2 = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var defineProperty2 = Object.defineProperty; var gOPD = Object.getOwnPropertyDescriptor; - var isArray7 = function isArray(arr) { + var isArray4 = function isArray(arr) { if (typeof Array.isArray === "function") { return Array.isArray(arr); } @@ -152975,14 +111863,14 @@ var require_extend = __commonJS((exports, module) => { if (!obj || toStr.call(obj) !== "[object Object]") { return false; } - var hasOwnConstructor = hasOwn5.call(obj, "constructor"); - var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn5.call(obj.constructor.prototype, "isPrototypeOf"); + var hasOwnConstructor = hasOwn2.call(obj, "constructor"); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn2.call(obj.constructor.prototype, "isPrototypeOf"); if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { return false; } var key; for (key in obj) {} - return typeof key === "undefined" || hasOwn5.call(obj, key); + return typeof key === "undefined" || hasOwn2.call(obj, key); }; var setProperty2 = function setProperty(target, options) { if (defineProperty2 && options.name === "__proto__") { @@ -152998,7 +111886,7 @@ var require_extend = __commonJS((exports, module) => { }; var getProperty = function getProperty(obj, name) { if (name === "__proto__") { - if (!hasOwn5.call(obj, name)) { + if (!hasOwn2.call(obj, name)) { return; } else if (gOPD) { return gOPD(obj, name).value; @@ -153027,10 +111915,10 @@ var require_extend = __commonJS((exports, module) => { src = getProperty(target, name); copy = getProperty(options, name); if (target !== copy) { - if (deep && copy && (isPlainObject5(copy) || (copyIsArray = isArray7(copy)))) { + if (deep && copy && (isPlainObject5(copy) || (copyIsArray = isArray4(copy)))) { if (copyIsArray) { copyIsArray = false; - clone4 = src && isArray7(src) ? src : []; + clone4 = src && isArray4(src) ? src : []; } else { clone4 = src && isPlainObject5(src) ? src : {}; } @@ -153046,7 +111934,7 @@ var require_extend = __commonJS((exports, module) => { }; }); -// ../node_modules/webidl-conversions/lib/index.js +// node_modules/webidl-conversions/lib/index.js var require_lib = __commonJS((exports, module) => { var conversions = {}; module.exports = conversions; @@ -153200,7 +112088,7 @@ var require_lib = __commonJS((exports, module) => { }; }); -// ../node_modules/whatwg-url/lib/utils.js +// node_modules/whatwg-url/lib/utils.js var require_utils2 = __commonJS((exports, module) => { exports.mixin = function mixin(target, source) { const keys2 = Object.getOwnPropertyNames(source); @@ -153218,12 +112106,12 @@ var require_utils2 = __commonJS((exports, module) => { }; }); -// ../node_modules/tr46/lib/mappingTable.json +// node_modules/tr46/lib/mappingTable.json var require_mappingTable = __commonJS((exports, 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"], [[1000, 1000], "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, 6000], "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]], [[8000, 8005], "valid"], [[8006, 8007], "disallowed"], [[8008, 8008], "mapped", [8000]], [[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, 9000], "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", [30000]], [[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]], [[13000, 13000], "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"], [[43000, 43000], "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]], [[64000, 64000], "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"], [[66000, 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]], [[120000, 120000], "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"], [[128000, 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", [23000]], [[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", [149000]], [[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", [32000]], [[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]], [[195000, 195000], "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", [40000]], [[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"], [[918000, 983037], "disallowed"], [[983038, 983039], "disallowed"], [[983040, 1048573], "disallowed"], [[1048574, 1048575], "disallowed"], [[1048576, 1114109], "disallowed"], [[1114110, 1114111], "disallowed"]]; }); -// ../node_modules/tr46/index.js +// node_modules/tr46/index.js var require_tr46 = __commonJS((exports, module) => { var punycode = __require("punycode"); var mappingTable = require_mappingTable(); @@ -153310,21 +112198,21 @@ var require_tr46 = __commonJS((exports, module) => { label = punycode.toUnicode(label); processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; } - var error44 = false; + var error41 = false; if (normalize3(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { - error44 = true; + error41 = true; } var len = countSymbols(label); for (var i2 = 0;i2 < len; ++i2) { var status = findStatus(label.codePointAt(i2)); if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") { - error44 = true; + error41 = true; break; } } return { label, - error: error44 + error: error41 }; } function processing(domain_name, useSTD3, processing_option) { @@ -153382,7 +112270,7 @@ var require_tr46 = __commonJS((exports, module) => { exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; }); -// ../node_modules/whatwg-url/lib/url-state-machine.js +// node_modules/whatwg-url/lib/url-state-machine.js var require_url_state_machine = __commonJS((exports, module) => { var punycode = __require("punycode"); var tr46 = require_tr46(); @@ -153399,8 +112287,8 @@ var require_url_state_machine = __commonJS((exports, module) => { function countSymbols(str) { return punycode.ucs2.decode(str).length; } - function at2(input2, idx) { - const c5 = input2[idx]; + function at2(input, idx) { + const c5 = input[idx]; return isNaN(c5) ? undefined : String.fromCodePoint(c5); } function isASCIIDigit(c5) { @@ -153462,16 +112350,16 @@ var require_url_state_machine = __commonJS((exports, module) => { return str; } function utf8PercentDecode(str) { - const input2 = new Buffer(str); + const input = new Buffer(str); const output = []; - for (let i2 = 0;i2 < input2.length; ++i2) { - if (input2[i2] !== 37) { - output.push(input2[i2]); - } else if (input2[i2] === 37 && isASCIIHex(input2[i2 + 1]) && isASCIIHex(input2[i2 + 2])) { - output.push(parseInt(input2.slice(i2 + 1, i2 + 3).toString(), 16)); + for (let i2 = 0;i2 < input.length; ++i2) { + if (input[i2] !== 37) { + output.push(input[i2]); + } else if (input[i2] === 37 && isASCIIHex(input[i2 + 1]) && isASCIIHex(input[i2 + 2])) { + output.push(parseInt(input.slice(i2 + 1, i2 + 3).toString(), 16)); i2 += 2; } else { - output.push(input2[i2]); + output.push(input[i2]); } } return new Buffer(output).toString(); @@ -153494,42 +112382,42 @@ var require_url_state_machine = __commonJS((exports, module) => { } return cStr; } - function parseIPv4Number(input2) { + function parseIPv4Number(input) { let R2 = 10; - if (input2.length >= 2 && input2.charAt(0) === "0" && input2.charAt(1).toLowerCase() === "x") { - input2 = input2.substring(2); + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); R2 = 16; - } else if (input2.length >= 2 && input2.charAt(0) === "0") { - input2 = input2.substring(1); + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); R2 = 8; } - if (input2 === "") { + if (input === "") { return 0; } const regex2 = R2 === 10 ? /[^0-9]/ : R2 === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/; - if (regex2.test(input2)) { + if (regex2.test(input)) { return failure; } - return parseInt(input2, R2); + return parseInt(input, R2); } - function parseIPv4(input2) { - const parts = input2.split("."); + function parseIPv4(input) { + const parts = input.split("."); if (parts[parts.length - 1] === "") { if (parts.length > 1) { parts.pop(); } } if (parts.length > 4) { - return input2; + return input; } const numbers = []; for (const part of parts) { if (part === "") { - return input2; + return input; } const n2 = parseIPv4Number(part); if (n2 === failure) { - return input2; + return input; } numbers.push(n2); } @@ -153561,25 +112449,25 @@ var require_url_state_machine = __commonJS((exports, module) => { } return output; } - function parseIPv6(input2) { + function parseIPv6(input) { const address = [0, 0, 0, 0, 0, 0, 0, 0]; let pieceIndex = 0; let compress = null; let pointer = 0; - input2 = punycode.ucs2.decode(input2); - if (input2[pointer] === 58) { - if (input2[pointer + 1] !== 58) { + input = punycode.ucs2.decode(input); + if (input[pointer] === 58) { + if (input[pointer + 1] !== 58) { return failure; } pointer += 2; ++pieceIndex; compress = pieceIndex; } - while (pointer < input2.length) { + while (pointer < input.length) { if (pieceIndex === 8) { return failure; } - if (input2[pointer] === 58) { + if (input[pointer] === 58) { if (compress !== null) { return failure; } @@ -153590,12 +112478,12 @@ var require_url_state_machine = __commonJS((exports, module) => { } let value = 0; let length = 0; - while (length < 4 && isASCIIHex(input2[pointer])) { - value = value * 16 + parseInt(at2(input2, pointer), 16); + while (length < 4 && isASCIIHex(input[pointer])) { + value = value * 16 + parseInt(at2(input, pointer), 16); ++pointer; ++length; } - if (input2[pointer] === 46) { + if (input[pointer] === 46) { if (length === 0) { return failure; } @@ -153604,20 +112492,20 @@ var require_url_state_machine = __commonJS((exports, module) => { return failure; } let numbersSeen = 0; - while (input2[pointer] !== undefined) { + while (input[pointer] !== undefined) { let ipv4Piece = null; if (numbersSeen > 0) { - if (input2[pointer] === 46 && numbersSeen < 4) { + if (input[pointer] === 46 && numbersSeen < 4) { ++pointer; } else { return failure; } } - if (!isASCIIDigit(input2[pointer])) { + if (!isASCIIDigit(input[pointer])) { return failure; } - while (isASCIIDigit(input2[pointer])) { - const number4 = parseInt(at2(input2, pointer)); + while (isASCIIDigit(input[pointer])) { + const number4 = parseInt(at2(input, pointer)); if (ipv4Piece === null) { ipv4Piece = number4; } else if (ipv4Piece === 0) { @@ -153640,12 +112528,12 @@ var require_url_state_machine = __commonJS((exports, module) => { return failure; } break; - } else if (input2[pointer] === 58) { + } else if (input[pointer] === 58) { ++pointer; - if (input2[pointer] === undefined) { + if (input[pointer] === undefined) { return failure; } - } else if (input2[pointer] !== undefined) { + } else if (input[pointer] !== undefined) { return failure; } address[pieceIndex] = value; @@ -153690,17 +112578,17 @@ var require_url_state_machine = __commonJS((exports, module) => { } return output; } - function parseHost(input2, isSpecialArg) { - if (input2[0] === "[") { - if (input2[input2.length - 1] !== "]") { + function parseHost(input, isSpecialArg) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { return failure; } - return parseIPv6(input2.substring(1, input2.length - 1)); + return parseIPv6(input.substring(1, input.length - 1)); } if (!isSpecialArg) { - return parseOpaqueHost(input2); + return parseOpaqueHost(input); } - const domain2 = utf8PercentDecode(input2); + const domain2 = utf8PercentDecode(input); const asciiDomain = tr46.toASCII(domain2, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); if (asciiDomain === null) { return failure; @@ -153714,12 +112602,12 @@ var require_url_state_machine = __commonJS((exports, module) => { } return asciiDomain; } - function parseOpaqueHost(input2) { - if (containsForbiddenHostCodePointExcludingPercent(input2)) { + function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { return failure; } let output = ""; - const decoded = punycode.ucs2.decode(input2); + const decoded = punycode.ucs2.decode(input); for (let i2 = 0;i2 < decoded.length; ++i2) { output += percentEncodeChar(decoded[i2], isC0ControlPercentEncode); } @@ -153770,14 +112658,14 @@ var require_url_state_machine = __commonJS((exports, module) => { return url3.replace(/\u0009|\u000A|\u000D/g, ""); } function shortenPath(url3) { - const path11 = url3.path; - if (path11.length === 0) { + const path9 = url3.path; + if (path9.length === 0) { return; } - if (url3.scheme === "file" && path11.length === 1 && isNormalizedWindowsDriveLetter(path11[0])) { + if (url3.scheme === "file" && path9.length === 1 && isNormalizedWindowsDriveLetter(path9[0])) { return; } - path11.pop(); + path9.pop(); } function includesCredentials(url3) { return url3.username !== "" || url3.password !== ""; @@ -153788,9 +112676,9 @@ var require_url_state_machine = __commonJS((exports, module) => { function isNormalizedWindowsDriveLetter(string4) { return /^[A-Za-z]:$/.test(string4); } - function URLStateMachine(input2, base2, encodingOverride, url3, stateOverride) { + function URLStateMachine(input, base2, encodingOverride, url3, stateOverride) { this.pointer = 0; - this.input = input2; + this.input = input; this.base = base2 || null; this.encodingOverride = encodingOverride || "utf-8"; this.stateOverride = stateOverride; @@ -154411,11 +113299,11 @@ var require_url_state_machine = __commonJS((exports, module) => { return "null"; } }; - exports.basicURLParse = function(input2, options) { + exports.basicURLParse = function(input, options) { if (options === undefined) { options = {}; } - const usm = new URLStateMachine(input2, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); if (usm.failure) { return "failure"; } @@ -154440,15 +113328,15 @@ var require_url_state_machine = __commonJS((exports, module) => { exports.serializeInteger = function(integer2) { return String(integer2); }; - exports.parseURL = function(input2, options) { + exports.parseURL = function(input, options) { if (options === undefined) { options = {}; } - return exports.basicURLParse(input2, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); + return exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); }; }); -// ../node_modules/whatwg-url/lib/URL-impl.js +// node_modules/whatwg-url/lib/URL-impl.js var require_URL_impl = __commonJS((exports) => { var usm = require_url_state_machine(); exports.implementation = class URLImpl { @@ -154577,9 +113465,9 @@ var require_URL_impl = __commonJS((exports) => { url3.query = null; return; } - const input2 = v[0] === "?" ? v.substring(1) : v; + const input = v[0] === "?" ? v.substring(1) : v; url3.query = ""; - usm.basicURLParse(input2, { url: url3, stateOverride: "query" }); + usm.basicURLParse(input, { url: url3, stateOverride: "query" }); } get hash() { if (this._url.fragment === null || this._url.fragment === "") { @@ -154592,9 +113480,9 @@ var require_URL_impl = __commonJS((exports) => { this._url.fragment = null; return; } - const input2 = v[0] === "#" ? v.substring(1) : v; + const input = v[0] === "#" ? v.substring(1) : v; this._url.fragment = ""; - usm.basicURLParse(input2, { url: this._url, stateOverride: "fragment" }); + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); } toJSON() { return this.href; @@ -154602,7 +113490,7 @@ var require_URL_impl = __commonJS((exports) => { }; }); -// ../node_modules/whatwg-url/lib/URL.js +// node_modules/whatwg-url/lib/URL.js var require_URL = __commonJS((exports, module) => { var conversions = require_lib(); var utils = require_utils2(); @@ -154782,7 +113670,7 @@ var require_URL = __commonJS((exports, module) => { }; }); -// ../node_modules/whatwg-url/lib/public-api.js +// node_modules/whatwg-url/lib/public-api.js var require_public_api = __commonJS((exports) => { exports.URL = require_URL().interface; exports.serializeURL = require_url_state_machine().serializeURL; @@ -154795,19 +113683,19 @@ var require_public_api = __commonJS((exports) => { exports.parseURL = require_url_state_machine().parseURL; }); -// ../node_modules/node-fetch/lib/index.js +// node_modules/node-fetch/lib/index.js var require_lib2 = __commonJS((exports, module) => { Object.defineProperty(exports, "__esModule", { value: true }); function _interopDefault(ex) { return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; } - var Stream4 = _interopDefault(__require("stream")); + var Stream2 = _interopDefault(__require("stream")); var http3 = _interopDefault(__require("http")); var Url = _interopDefault(__require("url")); var whatwgUrl = _interopDefault(require_public_api()); var https2 = _interopDefault(__require("https")); var zlib2 = _interopDefault(__require("zlib")); - var Readable5 = Stream4.Readable; + var Readable5 = Stream2.Readable; var BUFFER = Symbol("buffer"); var TYPE = Symbol("type"); @@ -154924,7 +113812,7 @@ var require_lib2 = __commonJS((exports, module) => { convert = (()=>{throw new Error("Cannot require module "+"encoding");})().convert; } catch (e) {} var INTERNALS = Symbol("Body internals"); - var PassThrough2 = Stream4.PassThrough; + var PassThrough2 = Stream2.PassThrough; function Body(body) { var _this = this; var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$size = _ref.size; @@ -154943,7 +113831,7 @@ var require_lib2 = __commonJS((exports, module) => { body = Buffer.from(body); } else if (ArrayBuffer.isView(body)) { body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream4) + } else if (body instanceof Stream2) ; else { body = Buffer.from(String(body)); @@ -154955,10 +113843,10 @@ var require_lib2 = __commonJS((exports, module) => { }; this.size = size2; this.timeout = timeout; - if (body instanceof Stream4) { + if (body instanceof Stream2) { body.on("error", function(err) { - const error44 = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); - _this[INTERNALS].error = error44; + const error41 = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); + _this[INTERNALS].error = error41; }); } } @@ -155044,7 +113932,7 @@ var require_lib2 = __commonJS((exports, module) => { if (Buffer.isBuffer(body)) { return Body.Promise.resolve(body); } - if (!(body instanceof Stream4)) { + if (!(body instanceof Stream2)) { return Body.Promise.resolve(Buffer.alloc(0)); } let accum = []; @@ -155143,7 +114031,7 @@ var require_lib2 = __commonJS((exports, module) => { if (instance.bodyUsed) { throw new Error("cannot clone body after it is used"); } - if (body instanceof Stream4 && typeof body.getBoundary !== "function") { + if (body instanceof Stream2 && typeof body.getBoundary !== "function") { p1 = new PassThrough2; p2 = new PassThrough2; body.pipe(p1); @@ -155170,7 +114058,7 @@ var require_lib2 = __commonJS((exports, module) => { return null; } else if (typeof body.getBoundary === "function") { return `multipart/form-data;boundary=${body.getBoundary()}`; - } else if (body instanceof Stream4) { + } else if (body instanceof Stream2) { return null; } else { return "text/plain;charset=UTF-8"; @@ -155221,9 +114109,9 @@ var require_lib2 = __commonJS((exports, module) => { throw new TypeError(`${value} is not a legal HTTP header value`); } } - function find2(map4, name) { + function find2(map3, name) { name = name.toLowerCase(); - for (const key in map4) { + for (const key in map3) { if (key.toLowerCase() === name) { return key; } @@ -155390,8 +114278,8 @@ var require_lib2 = __commonJS((exports, module) => { } var _INTERNAL = this[INTERNAL]; const { target, kind, index } = _INTERNAL; - const values3 = getHeaders(target, kind); - const len = values3.length; + const values2 = getHeaders(target, kind); + const len = values2.length; if (index >= len) { return { value: undefined, @@ -155400,7 +114288,7 @@ var require_lib2 = __commonJS((exports, module) => { } this[INTERNAL].index = index + 1; return { - value: values3[index], + value: values2[index], done: false }; } @@ -155521,9 +114409,9 @@ var require_lib2 = __commonJS((exports, module) => { } return parse_url(urlStr); } - var streamDestructionSupported = "destroy" in Stream4.Readable.prototype; - function isRequest2(input2) { - return typeof input2 === "object" && typeof input2[INTERNALS$2] === "object"; + var streamDestructionSupported = "destroy" in Stream2.Readable.prototype; + function isRequest2(input) { + return typeof input === "object" && typeof input[INTERNALS$2] === "object"; } function isAbortSignal(signal) { const proto2 = signal && typeof signal === "object" && Object.getPrototypeOf(signal); @@ -155531,37 +114419,37 @@ var require_lib2 = __commonJS((exports, module) => { } class Request2 { - constructor(input2) { + constructor(input) { let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; let parsedURL; - if (!isRequest2(input2)) { - if (input2 && input2.href) { - parsedURL = parseURL(input2.href); + if (!isRequest2(input)) { + if (input && input.href) { + parsedURL = parseURL(input.href); } else { - parsedURL = parseURL(`${input2}`); + parsedURL = parseURL(`${input}`); } - input2 = {}; + input = {}; } else { - parsedURL = parseURL(input2.url); + parsedURL = parseURL(input.url); } - let method2 = init.method || input2.method || "GET"; + let method2 = init.method || input.method || "GET"; method2 = method2.toUpperCase(); - if ((init.body != null || isRequest2(input2) && input2.body !== null) && (method2 === "GET" || method2 === "HEAD")) { + if ((init.body != null || isRequest2(input) && input.body !== null) && (method2 === "GET" || method2 === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body"); } - let inputBody = init.body != null ? init.body : isRequest2(input2) && input2.body !== null ? clone4(input2) : null; + let inputBody = init.body != null ? init.body : isRequest2(input) && input.body !== null ? clone4(input) : null; Body.call(this, inputBody, { - timeout: init.timeout || input2.timeout || 0, - size: init.size || input2.size || 0 + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 }); - const headers = new Headers2(init.headers || input2.headers || {}); + const headers = new Headers2(init.headers || input.headers || {}); if (inputBody != null && !headers.has("Content-Type")) { const contentType = extractContentType(inputBody); if (contentType) { headers.append("Content-Type", contentType); } } - let signal = isRequest2(input2) ? input2.signal : null; + let signal = isRequest2(input) ? input.signal : null; if ("signal" in init) signal = init.signal; if (signal != null && !isAbortSignal(signal)) { @@ -155569,15 +114457,15 @@ var require_lib2 = __commonJS((exports, module) => { } this[INTERNALS$2] = { method: method2, - redirect: init.redirect || input2.redirect || "follow", + redirect: init.redirect || input.redirect || "follow", headers, parsedURL, signal }; - this.follow = init.follow !== undefined ? init.follow : input2.follow !== undefined ? input2.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input2.compress !== undefined ? input2.compress : true; - this.counter = init.counter || input2.counter || 0; - this.agent = init.agent || input2.agent; + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; } get method() { return this[INTERNALS$2].method; @@ -155625,7 +114513,7 @@ var require_lib2 = __commonJS((exports, module) => { if (!/^https?:$/.test(parsedURL.protocol)) { throw new TypeError("Only HTTP(S) protocols are supported"); } - if (request.signal && request.body instanceof Stream4.Readable && !streamDestructionSupported) { + if (request.signal && request.body instanceof Stream2.Readable && !streamDestructionSupported) { throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); } let contentLengthValue = null; @@ -155667,7 +114555,7 @@ var require_lib2 = __commonJS((exports, module) => { AbortError2.prototype.constructor = AbortError2; AbortError2.prototype.name = "AbortError"; var URL$1 = Url.URL || whatwgUrl.URL; - var PassThrough$1 = Stream4.PassThrough; + var PassThrough$1 = Stream2.PassThrough; var isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { const orig = new URL$1(original).hostname; const dest = new URL$1(destination).hostname; @@ -155690,14 +114578,14 @@ var require_lib2 = __commonJS((exports, module) => { const signal = request.signal; let response = null; const abort = function abort() { - let error44 = new AbortError2("The user aborted a request."); - reject2(error44); - if (request.body && request.body instanceof Stream4.Readable) { - destroyStream(request.body, error44); + let error41 = new AbortError2("The user aborted a request."); + reject2(error41); + if (request.body && request.body instanceof Stream2.Readable) { + destroyStream(request.body, error41); } if (!response || !response.body) return; - response.body.emit("error", error44); + response.body.emit("error", error41); }; if (signal && signal.aborted) { abort(); @@ -155925,7 +114813,7 @@ var require_lib2 = __commonJS((exports, module) => { exports.AbortError = AbortError2; }); -// ../node_modules/gaxios/node_modules/is-stream/index.js +// node_modules/gaxios/node_modules/is-stream/index.js var require_is_stream = __commonJS((exports, module) => { var isStream3 = (stream4) => stream4 !== null && typeof stream4 === "object" && typeof stream4.pipe === "function"; isStream3.writable = (stream4) => isStream3(stream4) && stream4.writable !== false && typeof stream4._write === "function" && typeof stream4._writableState === "object"; @@ -155935,8 +114823,8 @@ var require_is_stream = __commonJS((exports, module) => { module.exports = isStream3; }); -// ../node_modules/gaxios/package.json -var require_package8 = __commonJS((exports, module) => { +// node_modules/gaxios/package.json +var require_package2 = __commonJS((exports, module) => { module.exports = { name: "gaxios", version: "6.7.1", @@ -156035,19 +114923,19 @@ var require_package8 = __commonJS((exports, module) => { }; }); -// ../node_modules/gaxios/build/src/util.js +// node_modules/gaxios/build/src/util.js var require_util7 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.pkg = undefined; - exports.pkg = require_package8(); + exports.pkg = require_package2(); }); -// ../node_modules/gaxios/build/src/common.js +// node_modules/gaxios/build/src/common.js var require_common2 = __commonJS((exports) => { var __importDefault = exports && exports.__importDefault || function(mod2) { return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; }; - var _a3; + var _a2; Object.defineProperty(exports, "__esModule", { value: true }); exports.GaxiosError = exports.GAXIOS_ERROR_SYMBOL = undefined; exports.defaultErrorRedactor = defaultErrorRedactor; @@ -156057,19 +114945,19 @@ var require_common2 = __commonJS((exports) => { exports.GAXIOS_ERROR_SYMBOL = Symbol.for(`${util_1.pkg.name}-gaxios-error`); class GaxiosError extends Error { - static [(_a3 = exports.GAXIOS_ERROR_SYMBOL, Symbol.hasInstance)](instance) { + static [(_a2 = exports.GAXIOS_ERROR_SYMBOL, Symbol.hasInstance)](instance) { if (instance && typeof instance === "object" && exports.GAXIOS_ERROR_SYMBOL in instance && instance[exports.GAXIOS_ERROR_SYMBOL] === util_1.pkg.version) { return true; } return Function.prototype[Symbol.hasInstance].call(GaxiosError, instance); } - constructor(message, config2, response, error44) { + constructor(message, config2, response, error41) { var _b; super(message); this.config = config2; this.response = response; - this.error = error44; - this[_a3] = util_1.pkg.version; + this.error = error41; + this[_a2] = util_1.pkg.version; this.config = (0, extend_1.default)(true, {}, config2); if (this.response) { this.response.config = (0, extend_1.default)(true, {}, this.response.config); @@ -156080,8 +114968,8 @@ var require_common2 = __commonJS((exports) => { } catch (_c) {} this.status = this.response.status; } - if (error44 && "code" in error44 && error44.code) { - this.code = error44.code; + if (error41 && "code" in error41 && error41.code) { + this.code = error41.code; } if (config2.errorRedactor) { config2.errorRedactor({ @@ -156171,7 +115059,7 @@ var require_common2 = __commonJS((exports) => { } }); -// ../node_modules/gaxios/build/src/retry.js +// node_modules/gaxios/build/src/retry.js var require_retry2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getRetryConfig = getRetryConfig; @@ -156219,9 +115107,9 @@ var require_retry2 = __commonJS((exports) => { return { shouldRetry: true, config: err.config }; } function shouldRetryRequest(err) { - var _a3; + var _a2; const config2 = getConfig(err); - if (err.name === "AbortError" || ((_a3 = err.error) === null || _a3 === undefined ? undefined : _a3.name) === "AbortError") { + if (err.name === "AbortError" || ((_a2 = err.error) === null || _a2 === undefined ? undefined : _a2.name) === "AbortError") { return false; } if (!config2 || config2.retry === 0) { @@ -156259,15 +115147,15 @@ var require_retry2 = __commonJS((exports) => { return; } function getNextRetryDelay(config2) { - var _a3; - const retryDelay = config2.currentRetryAttempt ? 0 : (_a3 = config2.retryDelay) !== null && _a3 !== undefined ? _a3 : 100; + var _a2; + const retryDelay = config2.currentRetryAttempt ? 0 : (_a2 = config2.retryDelay) !== null && _a2 !== undefined ? _a2 : 100; const calculatedDelay = retryDelay + (Math.pow(config2.retryDelayMultiplier, config2.currentRetryAttempt) - 1) / 2 * 1000; const maxAllowableDelay = config2.totalTimeout - (Date.now() - config2.timeOfFirstRequest); return Math.min(calculatedDelay, maxAllowableDelay, config2.maxRetryDelay); } }); -// ../node_modules/gaxios/node_modules/uuid/dist/rng.js +// node_modules/gaxios/node_modules/uuid/dist/rng.js var require_rng = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156288,7 +115176,7 @@ var require_rng = __commonJS((exports) => { } }); -// ../node_modules/gaxios/node_modules/uuid/dist/regex.js +// node_modules/gaxios/node_modules/uuid/dist/regex.js var require_regex = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156298,7 +115186,7 @@ var require_regex = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/validate.js +// node_modules/gaxios/node_modules/uuid/dist/validate.js var require_validate = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156308,14 +115196,14 @@ var require_validate = __commonJS((exports) => { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function validate2(uuid5) { - return typeof uuid5 === "string" && _regex2.default.test(uuid5); + function validate2(uuid3) { + return typeof uuid3 === "string" && _regex2.default.test(uuid3); } var _default3 = validate2; exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/stringify.js +// node_modules/gaxios/node_modules/uuid/dist/stringify.js var require_stringify = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156334,17 +115222,17 @@ var require_stringify = __commonJS((exports) => { return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } function stringify(arr, offset = 0) { - const uuid5 = unsafeStringify(arr, offset); - if (!(0, _validate.default)(uuid5)) { + const uuid3 = unsafeStringify(arr, offset); + if (!(0, _validate.default)(uuid3)) { throw TypeError("Stringified UUID is invalid"); } - return uuid5; + return uuid3; } var _default3 = stringify; exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/v1.js +// node_modules/gaxios/node_modules/uuid/dist/v1.js var require_v1 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156411,7 +115299,7 @@ var require_v1 = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/parse.js +// node_modules/gaxios/node_modules/uuid/dist/parse.js var require_parse3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156421,23 +115309,23 @@ var require_parse3 = __commonJS((exports) => { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function parse7(uuid5) { - if (!(0, _validate.default)(uuid5)) { + function parse7(uuid3) { + if (!(0, _validate.default)(uuid3)) { throw TypeError("Invalid UUID"); } let v; const arr = new Uint8Array(16); - arr[0] = (v = parseInt(uuid5.slice(0, 8), 16)) >>> 24; + arr[0] = (v = parseInt(uuid3.slice(0, 8), 16)) >>> 24; arr[1] = v >>> 16 & 255; arr[2] = v >>> 8 & 255; arr[3] = v & 255; - arr[4] = (v = parseInt(uuid5.slice(9, 13), 16)) >>> 8; + arr[4] = (v = parseInt(uuid3.slice(9, 13), 16)) >>> 8; arr[5] = v & 255; - arr[6] = (v = parseInt(uuid5.slice(14, 18), 16)) >>> 8; + arr[6] = (v = parseInt(uuid3.slice(14, 18), 16)) >>> 8; arr[7] = v & 255; - arr[8] = (v = parseInt(uuid5.slice(19, 23), 16)) >>> 8; + arr[8] = (v = parseInt(uuid3.slice(19, 23), 16)) >>> 8; arr[9] = v & 255; - arr[10] = (v = parseInt(uuid5.slice(24, 36), 16)) / 1099511627776 & 255; + arr[10] = (v = parseInt(uuid3.slice(24, 36), 16)) / 1099511627776 & 255; arr[11] = v / 4294967296 & 255; arr[12] = v >>> 24 & 255; arr[13] = v >>> 16 & 255; @@ -156449,7 +115337,7 @@ var require_parse3 = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/v35.js +// node_modules/gaxios/node_modules/uuid/dist/v35.js var require_v35 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156509,7 +115397,7 @@ var require_v35 = __commonJS((exports) => { } }); -// ../node_modules/gaxios/node_modules/uuid/dist/md5.js +// node_modules/gaxios/node_modules/uuid/dist/md5.js var require_md5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156531,7 +115419,7 @@ var require_md5 = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/v3.js +// node_modules/gaxios/node_modules/uuid/dist/v3.js var require_v3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156547,7 +115435,7 @@ var require_v3 = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/native.js +// node_modules/gaxios/node_modules/uuid/dist/native.js var require_native = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156563,7 +115451,7 @@ var require_native = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/v4.js +// node_modules/gaxios/node_modules/uuid/dist/v4.js var require_v4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156596,7 +115484,7 @@ var require_v4 = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/sha1.js +// node_modules/gaxios/node_modules/uuid/dist/sha1.js var require_sha1 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156618,7 +115506,7 @@ var require_sha1 = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/v5.js +// node_modules/gaxios/node_modules/uuid/dist/v5.js var require_v5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156634,7 +115522,7 @@ var require_v5 = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/nil.js +// node_modules/gaxios/node_modules/uuid/dist/nil.js var require_nil = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156644,7 +115532,7 @@ var require_nil = __commonJS((exports) => { exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/version.js +// node_modules/gaxios/node_modules/uuid/dist/version.js var require_version = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156654,17 +115542,17 @@ var require_version = __commonJS((exports) => { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function version2(uuid5) { - if (!(0, _validate.default)(uuid5)) { + function version2(uuid3) { + if (!(0, _validate.default)(uuid3)) { throw TypeError("Invalid UUID"); } - return parseInt(uuid5.slice(14, 15), 16); + return parseInt(uuid3.slice(14, 15), 16); } var _default3 = version2; exports.default = _default3; }); -// ../node_modules/gaxios/node_modules/uuid/dist/index.js +// node_modules/gaxios/node_modules/uuid/dist/index.js var require_dist4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true @@ -156737,7 +115625,7 @@ var require_dist4 = __commonJS((exports) => { } }); -// ../node_modules/gaxios/build/src/interceptor.js +// node_modules/gaxios/build/src/interceptor.js var require_interceptor = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.GaxiosInterceptorManager = undefined; @@ -156747,1208 +115635,7 @@ var require_interceptor = __commonJS((exports) => { exports.GaxiosInterceptorManager = GaxiosInterceptorManager; }); -// ../node_modules/ms/index.js -var require_ms2 = __commonJS((exports, module) => { - var s = 1000; - var m = s * 60; - var h2 = m * 60; - var d = h2 * 24; - var w = d * 7; - var y2 = d * 365.25; - module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse7(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val)); - }; - function parse7(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - if (!match) { - return; - } - var n2 = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n2 * y2; - case "weeks": - case "week": - case "w": - return n2 * w; - case "days": - case "day": - case "d": - return n2 * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n2 * h2; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n2 * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n2 * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n2; - default: - return; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h2) { - return Math.round(ms / h2) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural2(ms, msAbs, d, "day"); - } - if (msAbs >= h2) { - return plural2(ms, msAbs, h2, "hour"); - } - if (msAbs >= m) { - return plural2(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural2(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural2(ms, msAbs, n2, name) { - var isPlural = msAbs >= n2 * 1.5; - return Math.round(ms / n2) + " " + name + (isPlural ? "s" : ""); - } -}); - -// ../node_modules/debug/src/common.js -var require_common3 = __commonJS((exports, module) => { - function setup(env5) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms2(); - createDebug.destroy = destroy; - Object.keys(env5).forEach((key) => { - createDebug[key] = env5[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash2 = 0; - for (let i2 = 0;i2 < namespace.length; i2++) { - hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i2); - hash2 |= 0; - } - return createDebug.colors[Math.abs(hash2) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug(...args) { - if (!debug.enabled) { - return; - } - const self2 = debug; - const curr = Number(new Date); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format3) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format3]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self2, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend3; - debug.destroy = createDebug.destroy; - Object.defineProperty(debug, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug); - } - return debug; - } - function extend3(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - const split2 = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); - for (const ns of split2) { - if (ns[0] === "-") { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - function matchesTemplate(search, template2) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - while (searchIndex < search.length) { - if (templateIndex < template2.length && (template2[templateIndex] === search[searchIndex] || template2[templateIndex] === "*")) { - if (template2[templateIndex] === "*") { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; - } - } - while (templateIndex < template2.length && template2[templateIndex] === "*") { - templateIndex++; - } - return templateIndex === template2.length; - } - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - return false; - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module.exports = setup; -}); - -// ../node_modules/debug/src/browser.js -var require_browser2 = __commonJS((exports, module) => { - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load2; - exports.useColors = useColors; - exports.storage = localstorage(); - exports.destroy = (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - let m; - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c5 = "color: " + this.color; - args.splice(1, 0, c5, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c5); - } - exports.log = console.debug || console.log || (() => {}); - function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem("debug", namespaces); - } else { - exports.storage.removeItem("debug"); - } - } catch (error44) {} - } - function load2() { - let r; - try { - r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG"); - } catch (error44) {} - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error44) {} - } - module.exports = require_common3()(exports); - var { formatters } = module.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error44) { - return "[UnexpectedJSONParseError]: " + error44.message; - } - }; -}); - -// ../node_modules/has-flag/index.js -var require_has_flag2 = __commonJS((exports, module) => { - module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; -}); - -// ../node_modules/supports-color/index.js -var require_supports_color2 = __commonJS((exports, module) => { - var os3 = __require("os"); - var tty4 = __require("tty"); - var hasFlag2 = require_has_flag2(); - var { env: env5 } = process; - var forceColor; - if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) { - forceColor = 0; - } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env5) { - if (env5.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env5.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env5.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env5.FORCE_COLOR, 10), 3); - } - } - function translateLevel2(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor2(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) { - return 3; - } - if (hasFlag2("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === undefined) { - return 0; - } - const min2 = forceColor || 0; - if (env5.TERM === "dumb") { - return min2; - } - if (process.platform === "win32") { - const osRelease2 = os3.release().split("."); - if (Number(osRelease2[0]) >= 10 && Number(osRelease2[2]) >= 10586) { - return Number(osRelease2[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env5) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env5)) || env5.CI_NAME === "codeship") { - return 1; - } - return min2; - } - if ("TEAMCITY_VERSION" in env5) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env5.TEAMCITY_VERSION) ? 1 : 0; - } - if (env5.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env5) { - const version2 = parseInt((env5.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env5.TERM_PROGRAM) { - case "iTerm.app": - return version2 >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env5.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env5.TERM)) { - return 1; - } - if ("COLORTERM" in env5) { - return 1; - } - return min2; - } - function getSupportLevel(stream4) { - const level = supportsColor2(stream4, stream4 && stream4.isTTY); - return translateLevel2(level); - } - module.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel2(supportsColor2(true, tty4.isatty(1))), - stderr: translateLevel2(supportsColor2(true, tty4.isatty(2))) - }; -}); - -// ../node_modules/debug/src/node.js -var require_node2 = __commonJS((exports, module) => { - var tty4 = __require("tty"); - var util3 = __require("util"); - exports.init = init; - exports.log = log2; - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load2; - exports.useColors = useColors; - exports.destroy = util3.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - exports.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor2 = require_supports_color2(); - if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error44) {} - exports.inspectOpts = Object.keys(process.env).filter((key) => { - return /^debug_/i.test(key); - }).reduce((obj, key) => { - const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty4.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c5 = this.color; - const colorCode = "\x1B[3" + (c5 < 8 ? c5 : "8;5;" + c5); - const prefix = ` ${colorCode};1m${name} \x1B[0m`; - args[0] = prefix + args[0].split(` -`).join(` -` + prefix); - args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports.inspectOpts.hideDate) { - return ""; - } - return new Date().toISOString() + " "; - } - function log2(...args) { - return process.stderr.write(util3.formatWithOptions(exports.inspectOpts, ...args) + ` -`); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load2() { - return process.env.DEBUG; - } - function init(debug) { - debug.inspectOpts = {}; - const keys2 = Object.keys(exports.inspectOpts); - for (let i2 = 0;i2 < keys2.length; i2++) { - debug.inspectOpts[keys2[i2]] = exports.inspectOpts[keys2[i2]]; - } - } - module.exports = require_common3()(exports); - var { formatters } = module.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util3.inspect(v, this.inspectOpts).split(` -`).map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util3.inspect(v, this.inspectOpts); - }; -}); - -// ../node_modules/debug/src/index.js -var require_src2 = __commonJS((exports, module) => { - if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) { - module.exports = require_browser2(); - } else { - module.exports = require_node2(); - } -}); - -// ../node_modules/agent-base/dist/helpers.js -var require_helpers2 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - } : function(o2, v) { - o2["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result2 = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result2, mod2, k); - } - __setModuleDefault(result2, mod2); - return result2; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.req = exports.json = exports.toBuffer = undefined; - var http3 = __importStar(__require("http")); - var https2 = __importStar(__require("https")); - async function toBuffer(stream4) { - let length = 0; - const chunks = []; - for await (const chunk2 of stream4) { - length += chunk2.length; - chunks.push(chunk2); - } - return Buffer.concat(chunks, length); - } - exports.toBuffer = toBuffer; - async function json2(stream4) { - const buf = await toBuffer(stream4); - const str = buf.toString("utf8"); - try { - return JSON.parse(str); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str})`; - throw err; - } - } - exports.json = json2; - function req(url3, opts = {}) { - const href = typeof url3 === "string" ? url3 : url3.href; - const req2 = (href.startsWith("https:") ? https2 : http3).request(url3, opts); - const promise2 = new Promise((resolve8, reject2) => { - req2.once("response", resolve8).once("error", reject2).end(); - }); - req2.then = promise2.then.bind(promise2); - return req2; - } - exports.req = req; -}); - -// ../node_modules/agent-base/dist/index.js -var require_dist5 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - } : function(o2, v) { - o2["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result2 = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result2, mod2, k); - } - __setModuleDefault(result2, mod2); - return result2; - }; - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Agent = undefined; - var net = __importStar(__require("net")); - var http3 = __importStar(__require("http")); - var https_1 = __require("https"); - __exportStar(require_helpers2(), exports); - var INTERNAL = Symbol("AgentBaseInternalState"); - - class Agent extends http3.Agent { - constructor(opts) { - super(opts); - this[INTERNAL] = {}; - } - isSecureEndpoint(options) { - if (options) { - if (typeof options.secureEndpoint === "boolean") { - return options.secureEndpoint; - } - if (typeof options.protocol === "string") { - return options.protocol === "https:"; - } - } - const { stack } = new Error; - if (typeof stack !== "string") - return false; - return stack.split(` -`).some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1); - } - incrementSockets(name) { - if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { - return null; - } - if (!this.sockets[name]) { - this.sockets[name] = []; - } - const fakeSocket = new net.Socket({ writable: false }); - this.sockets[name].push(fakeSocket); - this.totalSocketCount++; - return fakeSocket; - } - decrementSockets(name, socket) { - if (!this.sockets[name] || socket === null) { - return; - } - const sockets = this.sockets[name]; - const index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } - } - } - getName(options) { - const secureEndpoint = this.isSecureEndpoint(options); - if (secureEndpoint) { - return https_1.Agent.prototype.getName.call(this, options); - } - return super.getName(options); - } - createSocket(req, options, cb) { - const connectOpts = { - ...options, - secureEndpoint: this.isSecureEndpoint(options) - }; - const name = this.getName(connectOpts); - const fakeSocket = this.incrementSockets(name); - Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => { - this.decrementSockets(name, fakeSocket); - if (socket instanceof http3.Agent) { - try { - return socket.addRequest(req, connectOpts); - } catch (err) { - return cb(err); - } - } - this[INTERNAL].currentSocket = socket; - super.createSocket(req, options, cb); - }, (err) => { - this.decrementSockets(name, fakeSocket); - cb(err); - }); - } - createConnection() { - const socket = this[INTERNAL].currentSocket; - this[INTERNAL].currentSocket = undefined; - if (!socket) { - throw new Error("No socket was returned in the `connect()` function"); - } - return socket; - } - get defaultPort() { - return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); - } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; - } - } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); - } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; - } - } - } - exports.Agent = Agent; -}); - -// ../node_modules/https-proxy-agent/dist/parse-proxy-response.js -var require_parse_proxy_response2 = __commonJS((exports) => { - var __importDefault = exports && exports.__importDefault || function(mod2) { - return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseProxyResponse = undefined; - var debug_1 = __importDefault(require_src2()); - var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve8, reject2) => { - let buffersLength = 0; - const buffers = []; - function read() { - const b = socket.read(); - if (b) - ondata(b); - else - socket.once("readable", read); - } - function cleanup() { - socket.removeListener("end", onend); - socket.removeListener("error", onerror); - socket.removeListener("readable", read); - } - function onend() { - cleanup(); - debug("onend"); - reject2(new Error("Proxy connection ended before receiving CONNECT response")); - } - function onerror(err) { - cleanup(); - debug("onerror %o", err); - reject2(err); - } - function ondata(b) { - buffers.push(b); - buffersLength += b.length; - const buffered = Buffer.concat(buffers, buffersLength); - const endOfHeaders = buffered.indexOf(`\r -\r -`); - if (endOfHeaders === -1) { - debug("have not received end of HTTP headers yet..."); - read(); - return; - } - const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split(`\r -`); - const firstLine = headerParts.shift(); - if (!firstLine) { - socket.destroy(); - return reject2(new Error("No header received from proxy CONNECT response")); - } - const firstLineParts = firstLine.split(" "); - const statusCode = +firstLineParts[1]; - const statusText = firstLineParts.slice(2).join(" "); - const headers = {}; - for (const header of headerParts) { - if (!header) - continue; - const firstColon = header.indexOf(":"); - if (firstColon === -1) { - socket.destroy(); - return reject2(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); - } - const key = header.slice(0, firstColon).toLowerCase(); - const value = header.slice(firstColon + 1).trimStart(); - const current = headers[key]; - if (typeof current === "string") { - headers[key] = [current, value]; - } else if (Array.isArray(current)) { - current.push(value); - } else { - headers[key] = value; - } - } - debug("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve8({ - connect: { - statusCode, - statusText, - headers - }, - buffered - }); - } - socket.on("error", onerror); - socket.on("end", onend); - read(); - }); - } - exports.parseProxyResponse = parseProxyResponse; -}); - -// ../node_modules/https-proxy-agent/dist/index.js -var require_dist6 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - } : function(o2, v) { - o2["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result2 = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result2, mod2, k); - } - __setModuleDefault(result2, mod2); - return result2; - }; - var __importDefault = exports && exports.__importDefault || function(mod2) { - return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.HttpsProxyAgent = undefined; - var net = __importStar(__require("net")); - var tls = __importStar(__require("tls")); - var assert_1 = __importDefault(__require("assert")); - var debug_1 = __importDefault(require_src2()); - var agent_base_1 = require_dist5(); - var url_1 = __require("url"); - var parse_proxy_response_1 = require_parse_proxy_response2(); - var debug = (0, debug_1.default)("https-proxy-agent"); - var setServernameFromNonIpHost = (options) => { - if (options.servername === undefined && options.host && !net.isIP(options.host)) { - return { - ...options, - servername: options.host - }; - } - return options; - }; - - class HttpsProxyAgent2 extends agent_base_1.Agent { - constructor(proxy, opts) { - super(opts); - this.options = { path: undefined }; - this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy; - this.proxyHeaders = opts?.headers ?? {}; - debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href); - const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); - const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; - this.connectOpts = { - ALPNProtocols: ["http/1.1"], - ...opts ? omit3(opts, "headers") : null, - host, - port - }; - } - async connect(req, opts) { - const { proxy } = this; - if (!opts.host) { - throw new TypeError('No "host" provided'); - } - let socket; - if (proxy.protocol === "https:") { - debug("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); - } else { - debug("Creating `net.Socket`: %o", this.connectOpts); - socket = net.connect(this.connectOpts); - } - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; - let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r -`; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; - } - headers.Host = `${host}:${opts.port}`; - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; - } - for (const name of Object.keys(headers)) { - payload += `${name}: ${headers[name]}\r -`; - } - const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket); - socket.write(`${payload}\r -`); - const { connect, buffered } = await proxyResponsePromise; - req.emit("proxyConnect", connect); - this.emit("proxyConnect", connect, req); - if (connect.statusCode === 200) { - req.once("socket", resume); - if (opts.secureEndpoint) { - debug("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit3(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); - } - return socket; - } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; - } - } - HttpsProxyAgent2.protocols = ["http", "https"]; - exports.HttpsProxyAgent = HttpsProxyAgent2; - function resume(socket) { - socket.resume(); - } - function omit3(obj, ...keys2) { - const ret = {}; - let key; - for (key in obj) { - if (!keys2.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; - } -}); - -// ../node_modules/gaxios/build/src/gaxios.js +// node_modules/gaxios/build/src/gaxios.js var require_gaxios = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) @@ -157982,14 +115669,14 @@ var require_gaxios = __commonJS((exports) => { __setModuleDefault(result2, mod2); return result2; }; - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { + var __classPrivateFieldGet2 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; - var __classPrivateFieldSet3 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { + var __classPrivateFieldSet2 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) @@ -158002,7 +115689,7 @@ var require_gaxios = __commonJS((exports) => { return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; }; var _Gaxios_instances; - var _a3; + var _a2; var _Gaxios_urlMayUseProxy; var _Gaxios_applyRequestInterceptors; var _Gaxios_applyResponseInterceptors; @@ -158056,9 +115743,9 @@ var require_gaxios = __commonJS((exports) => { }; } async request(opts = {}) { - opts = await __classPrivateFieldGet3(this, _Gaxios_instances, "m", _Gaxios_prepareRequest).call(this, opts); - opts = await __classPrivateFieldGet3(this, _Gaxios_instances, "m", _Gaxios_applyRequestInterceptors).call(this, opts); - return __classPrivateFieldGet3(this, _Gaxios_instances, "m", _Gaxios_applyResponseInterceptors).call(this, this._request(opts)); + opts = await __classPrivateFieldGet2(this, _Gaxios_instances, "m", _Gaxios_prepareRequest).call(this, opts); + opts = await __classPrivateFieldGet2(this, _Gaxios_instances, "m", _Gaxios_applyRequestInterceptors).call(this, opts); + return __classPrivateFieldGet2(this, _Gaxios_instances, "m", _Gaxios_applyResponseInterceptors).call(this, this._request(opts)); } async _defaultAdapter(opts) { const fetchImpl = opts.fetchImplementation || fetch2; @@ -158182,7 +115869,7 @@ Content-Type: ${partContentType}\r } } exports.Gaxios = Gaxios; - _a3 = Gaxios, _Gaxios_instances = new WeakSet, _Gaxios_urlMayUseProxy = function _Gaxios_urlMayUseProxy(url3, noProxy = []) { + _a2 = Gaxios, _Gaxios_instances = new WeakSet, _Gaxios_urlMayUseProxy = function _Gaxios_urlMayUseProxy(url3, noProxy = []) { var _b, _c; const candidate = new url_1.URL(url3); const noProxyList = [...noProxy]; @@ -158288,9 +115975,9 @@ Content-Type: ${partContentType}\r } opts.method = opts.method || "GET"; const proxy = opts.proxy || ((_b = process === null || process === undefined ? undefined : process.env) === null || _b === undefined ? undefined : _b.HTTPS_PROXY) || ((_c = process === null || process === undefined ? undefined : process.env) === null || _c === undefined ? undefined : _c.https_proxy) || ((_d = process === null || process === undefined ? undefined : process.env) === null || _d === undefined ? undefined : _d.HTTP_PROXY) || ((_e = process === null || process === undefined ? undefined : process.env) === null || _e === undefined ? undefined : _e.http_proxy); - const urlMayUseProxy = __classPrivateFieldGet3(this, _Gaxios_instances, "m", _Gaxios_urlMayUseProxy).call(this, opts.url, opts.noProxy); + const urlMayUseProxy = __classPrivateFieldGet2(this, _Gaxios_instances, "m", _Gaxios_urlMayUseProxy).call(this, opts.url, opts.noProxy); if (opts.agent) {} else if (proxy && urlMayUseProxy) { - const HttpsProxyAgent2 = await __classPrivateFieldGet3(_a3, _a3, "m", _Gaxios_getProxyAgent).call(_a3); + const HttpsProxyAgent2 = await __classPrivateFieldGet2(_a2, _a2, "m", _Gaxios_getProxyAgent).call(_a2); if (this.agentCache.has(proxy)) { opts.agent = this.agentCache.get(proxy); } else { @@ -158316,14 +116003,14 @@ Content-Type: ${partContentType}\r } return opts; }, _Gaxios_getProxyAgent = async function _Gaxios_getProxyAgent() { - __classPrivateFieldSet3(this, _a3, __classPrivateFieldGet3(this, _a3, "f", _Gaxios_proxyAgent) || (await Promise.resolve().then(() => __importStar(require_dist6()))).HttpsProxyAgent, "f", _Gaxios_proxyAgent); - return __classPrivateFieldGet3(this, _a3, "f", _Gaxios_proxyAgent); + __classPrivateFieldSet2(this, _a2, __classPrivateFieldGet2(this, _a2, "f", _Gaxios_proxyAgent) || (await Promise.resolve().then(() => __importStar(require_dist3()))).HttpsProxyAgent, "f", _Gaxios_proxyAgent); + return __classPrivateFieldGet2(this, _a2, "f", _Gaxios_proxyAgent); }; _Gaxios_proxyAgent = { value: undefined }; }); -// ../node_modules/gaxios/build/src/index.js -var require_src3 = __commonJS((exports) => { +// node_modules/gaxios/build/src/index.js +var require_src2 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -158362,7 +116049,7 @@ var require_src3 = __commonJS((exports) => { } }); -// ../node_modules/bignumber.js/bignumber.js +// node_modules/bignumber.js/bignumber.js var require_bignumber = __commonJS((exports, module) => { (function(globalObject) { var BigNumber, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 100000000000000, LOG_BASE = 14, MAX_SAFE_INTEGER7 = 9007199254740991, POWS_TEN = [1, 10, 100, 1000, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 10000000000, 100000000000, 1000000000000, 10000000000000], SQRT_BASE = 1e7, MAX = 1e9; @@ -159816,7 +117503,7 @@ var require_bignumber = __commonJS((exports, module) => { })(exports); }); -// ../node_modules/json-bigint/lib/stringify.js +// node_modules/json-bigint/lib/stringify.js var require_stringify2 = __commonJS((exports, module) => { var BigNumber = require_bignumber(); var JSON2 = exports; @@ -159928,7 +117615,7 @@ var require_stringify2 = __commonJS((exports, module) => { })(); }); -// ../node_modules/json-bigint/lib/parse.js +// node_modules/json-bigint/lib/parse.js var require_parse4 = __commonJS((exports, module) => { var BigNumber = null; var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/; @@ -159976,7 +117663,7 @@ var require_parse4 = __commonJS((exports, module) => { `, r: "\r", t: "\t" - }, text, error44 = function(m) { + }, text, error41 = function(m) { throw { name: "SyntaxError", message: m, @@ -159985,7 +117672,7 @@ var require_parse4 = __commonJS((exports, module) => { }; }, next = function(c5) { if (c5 && c5 !== ch) { - error44("Expected '" + c5 + "' instead of '" + ch + "'"); + error41("Expected '" + c5 + "' instead of '" + ch + "'"); } ch = text.charAt(at2); at2 += 1; @@ -160020,7 +117707,7 @@ var require_parse4 = __commonJS((exports, module) => { } number5 = +string5; if (!isFinite(number5)) { - error44("Bad number"); + error41("Bad number"); } else { if (BigNumber == null) BigNumber = require_bignumber(); @@ -160063,7 +117750,7 @@ var require_parse4 = __commonJS((exports, module) => { } } } - error44("Bad string"); + error41("Bad string"); }, white2 = function() { while (ch && ch <= " ") { next(); @@ -160090,7 +117777,7 @@ var require_parse4 = __commonJS((exports, module) => { next("l"); return null; } - error44("Unexpected '" + ch + "'"); + error41("Unexpected '" + ch + "'"); }, value, array2 = function() { var array3 = []; if (ch === "[") { @@ -160111,7 +117798,7 @@ var require_parse4 = __commonJS((exports, module) => { white2(); } } - error44("Bad array"); + error41("Bad array"); }, object2 = function() { var key, object3 = Object.create(null); if (ch === "{") { @@ -160126,11 +117813,11 @@ var require_parse4 = __commonJS((exports, module) => { white2(); next(":"); if (_options.strict === true && Object.hasOwnProperty.call(object3, key)) { - error44('Duplicate key "' + key + '"'); + error41('Duplicate key "' + key + '"'); } if (suspectProtoRx.test(key) === true) { if (_options.protoAction === "error") { - error44("Object contains forbidden prototype property"); + error41("Object contains forbidden prototype property"); } else if (_options.protoAction === "ignore") { value(); } else { @@ -160138,7 +117825,7 @@ var require_parse4 = __commonJS((exports, module) => { } } else if (suspectConstructorRx.test(key) === true) { if (_options.constructorAction === "error") { - error44("Object contains forbidden constructor property"); + error41("Object contains forbidden constructor property"); } else if (_options.constructorAction === "ignore") { value(); } else { @@ -160156,7 +117843,7 @@ var require_parse4 = __commonJS((exports, module) => { white2(); } } - error44("Bad object"); + error41("Bad object"); }; value = function() { white2(); @@ -160181,7 +117868,7 @@ var require_parse4 = __commonJS((exports, module) => { result2 = value(); white2(); if (ch) { - error44("Syntax error"); + error41("Syntax error"); } return typeof reviver === "function" ? function walk(holder, key) { var k, v, value2 = holder[key]; @@ -160202,7 +117889,7 @@ var require_parse4 = __commonJS((exports, module) => { module.exports = json_parse; }); -// ../node_modules/json-bigint/index.js +// node_modules/json-bigint/index.js var require_json_bigint = __commonJS((exports, module) => { var json_stringify = require_stringify2().stringify; var json_parse = require_parse4(); @@ -160216,7 +117903,7 @@ var require_json_bigint = __commonJS((exports, module) => { module.exports.stringify = json_stringify; }); -// ../node_modules/gcp-metadata/build/src/gcp-residency.js +// node_modules/gcp-metadata/build/src/gcp-residency.js var require_gcp_residency = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.GCE_LINUX_BIOS_PATHS = undefined; @@ -160243,7 +117930,7 @@ var require_gcp_residency = __commonJS((exports) => { (0, fs_1.statSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_DATE); const biosVendor = (0, fs_1.readFileSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR, "utf8"); return /Google/.test(biosVendor); - } catch (_a3) { + } catch (_a2) { return false; } } @@ -160268,7 +117955,7 @@ var require_gcp_residency = __commonJS((exports) => { } }); -// ../node_modules/google-logging-utils/build/src/colours.js +// node_modules/google-logging-utils/build/src/colours.js var require_colours = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Colours = undefined; @@ -160322,7 +118009,7 @@ var require_colours = __commonJS((exports) => { Colours.refresh(); }); -// ../node_modules/google-logging-utils/build/src/logging-utils.js +// node_modules/google-logging-utils/build/src/logging-utils.js var require_logging_utils = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) @@ -160362,7 +118049,7 @@ var require_logging_utils = __commonJS((exports) => { exports.getDebugBackend = getDebugBackend; exports.getStructuredBackend = getStructuredBackend; exports.setBackend = setBackend; - exports.log = log2; + exports.log = log; var node_events_1 = __require("node:events"); var process12 = __importStar(__require("node:process")); var util3 = __importStar(__require("node:util")); @@ -160389,7 +118076,7 @@ var require_logging_utils = __commonJS((exports) => { this.func.info = (...args) => this.invokeSeverity(LogSeverity.INFO, ...args); this.func.warn = (...args) => this.invokeSeverity(LogSeverity.WARNING, ...args); this.func.error = (...args) => this.invokeSeverity(LogSeverity.ERROR, ...args); - this.func.sublog = (namespace2) => log2(namespace2, this.func); + this.func.sublog = (namespace2) => log(namespace2, this.func); } invoke(fields, ...args) { if (this.upstream) { @@ -160406,11 +118093,11 @@ var require_logging_utils = __commonJS((exports) => { class DebugLogBackendBase { constructor() { - var _a3; + var _a2; this.cached = new Map; this.filters = []; this.filtersSet = false; - let nodeFlag = (_a3 = process12.env[exports.env.nodeEnables]) !== null && _a3 !== undefined ? _a3 : "*"; + let nodeFlag = (_a2 = process12.env[exports.env.nodeEnables]) !== null && _a2 !== undefined ? _a2 : "*"; if (nodeFlag === "all") { nodeFlag = "*"; } @@ -160448,7 +118135,7 @@ var require_logging_utils = __commonJS((exports) => { return () => {}; } return (fields, ...args) => { - var _a3; + var _a2; const nscolour = `${colours_1.Colours.green}${namespace}${colours_1.Colours.reset}`; const pid = `${colours_1.Colours.yellow}${process12.pid}${colours_1.Colours.reset}`; let level; @@ -160463,7 +118150,7 @@ var require_logging_utils = __commonJS((exports) => { level = `${colours_1.Colours.yellow}${fields.severity}${colours_1.Colours.reset}`; break; default: - level = (_a3 = fields.severity) !== null && _a3 !== undefined ? _a3 : LogSeverity.DEFAULT; + level = (_a2 = fields.severity) !== null && _a2 !== undefined ? _a2 : LogSeverity.DEFAULT; break; } const msg = util3.formatWithOptions({ colors: colours_1.Colours.enabled }, ...args); @@ -160496,8 +118183,8 @@ var require_logging_utils = __commonJS((exports) => { }; } setFilters() { - var _a3; - const existingFilters = (_a3 = process12.env["NODE_DEBUG"]) !== null && _a3 !== undefined ? _a3 : ""; + var _a2; + const existingFilters = (_a2 = process12.env["NODE_DEBUG"]) !== null && _a2 !== undefined ? _a2 : ""; process12.env["NODE_DEBUG"] = `${existingFilters}${existingFilters ? "," : ""}${this.filters.join(",")}`; } } @@ -160507,15 +118194,15 @@ var require_logging_utils = __commonJS((exports) => { class StructuredBackend extends DebugLogBackendBase { constructor(upstream) { - var _a3; + var _a2; super(); - this.upstream = (_a3 = upstream) !== null && _a3 !== undefined ? _a3 : new NodeBackend; + this.upstream = (_a2 = upstream) !== null && _a2 !== undefined ? _a2 : new NodeBackend; } makeLogger(namespace) { const debugLogger = this.upstream.makeLogger(namespace); return (fields, ...args) => { - var _a3; - const severity = (_a3 = fields.severity) !== null && _a3 !== undefined ? _a3 : LogSeverity.INFO; + var _a2; + const severity = (_a2 = fields.severity) !== null && _a2 !== undefined ? _a2 : LogSeverity.INFO; const json2 = Object.assign({ severity, message: util3.format(...args) @@ -160540,7 +118227,7 @@ var require_logging_utils = __commonJS((exports) => { cachedBackend = backend; loggerCache.clear(); } - function log2(namespace, parent2) { + function log(namespace, parent2) { const enablesFlag = process12.env[exports.env.nodeEnables]; if (!enablesFlag) { return exports.placeholder; @@ -160580,8 +118267,8 @@ var require_logging_utils = __commonJS((exports) => { } }); -// ../node_modules/google-logging-utils/build/src/index.js -var require_src4 = __commonJS((exports) => { +// node_modules/google-logging-utils/build/src/index.js +var require_src3 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -160606,8 +118293,8 @@ var require_src4 = __commonJS((exports) => { __exportStar(require_logging_utils(), exports); }); -// ../node_modules/gcp-metadata/build/src/index.js -var require_src5 = __commonJS((exports) => { +// node_modules/gcp-metadata/build/src/index.js +var require_src4 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -160639,17 +118326,17 @@ var require_src5 = __commonJS((exports) => { exports.getGCPResidency = getGCPResidency; exports.setGCPResidency = setGCPResidency; exports.requestTimeout = requestTimeout; - var gaxios_1 = require_src3(); + var gaxios_1 = require_src2(); var jsonBigint = require_json_bigint(); var gcp_residency_1 = require_gcp_residency(); - var logger = require_src4(); + var logger = require_src3(); exports.BASE_PATH = "/computeMetadata/v1"; exports.HOST_ADDRESS = "http://169.254.169.254"; exports.SECONDARY_HOST_ADDRESS = "http://metadata.google.internal."; exports.HEADER_NAME = "Metadata-Flavor"; exports.HEADER_VALUE = "Google"; exports.HEADERS = Object.freeze({ [exports.HEADER_NAME]: exports.HEADER_VALUE }); - var log2 = logger.log("gcp metadata"); + var log = logger.log("gcp metadata"); exports.METADATA_SERVER_DETECTION = Object.freeze({ "assume-present": "don't try to ping the metadata server, but assume it's present", none: "don't try to ping the metadata server, but don't try to use it either", @@ -160712,24 +118399,24 @@ var require_src5 = __commonJS((exports) => { responseType: "text", timeout: requestTimeout() }; - log2.info("instance request %j", req); + log.info("instance request %j", req); const res = await requestMethod(req); - log2.info("instance metadata is %s", res.data); + log.info("instance metadata is %s", res.data); if (res.headers[exports.HEADER_NAME.toLowerCase()] !== exports.HEADER_VALUE) { throw new Error(`Invalid response from metadata service: incorrect ${exports.HEADER_NAME} header. Expected '${exports.HEADER_VALUE}', got ${res.headers[exports.HEADER_NAME.toLowerCase()] ? `'${res.headers[exports.HEADER_NAME.toLowerCase()]}'` : "no header"}`); } if (typeof res.data === "string") { try { return jsonBigint.parse(res.data); - } catch (_a3) {} + } catch (_a2) {} } return res.data; } async function fastFailMetadataRequest(options) { - var _a3; + var _a2; const secondaryOptions = { ...options, - url: (_a3 = options.url) === null || _a3 === undefined ? undefined : _a3.toString().replace(getBaseUrl(), getBaseUrl(exports.SECONDARY_HOST_ADDRESS)) + url: (_a2 = options.url) === null || _a2 === undefined ? undefined : _a2.toString().replace(getBaseUrl(), getBaseUrl(exports.SECONDARY_HOST_ADDRESS)) }; let responded = false; const r1 = (0, gaxios_1.request)(options).then((res) => { @@ -160849,7 +118536,7 @@ var require_src5 = __commonJS((exports) => { __exportStar(require_gcp_residency(), exports); }); -// ../node_modules/base64-js/index.js +// node_modules/base64-js/index.js var require_base64_js = __commonJS((exports) => { exports.byteLength = byteLength; exports.toByteArray = toByteArray; @@ -160944,7 +118631,7 @@ var require_base64_js = __commonJS((exports) => { } }); -// ../node_modules/google-auth-library/build/src/crypto/browser/crypto.js +// node_modules/google-auth-library/build/src/crypto/browser/crypto.js var require_crypto = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BrowserCrypto = undefined; @@ -160967,11 +118654,11 @@ var require_crypto = __commonJS((exports) => { window.crypto.getRandomValues(array2); return base64js.fromByteArray(array2); } - static padBase64(base644) { - while (base644.length % 4 !== 0) { - base644 += "="; + static padBase64(base643) { + while (base643.length % 4 !== 0) { + base643 += "="; } - return base644; + return base643; } async verify(pubkey, data, signature) { const algo = { @@ -160994,12008 +118681,8 @@ var require_crypto = __commonJS((exports) => { const result2 = await window.crypto.subtle.sign(algo, cryptoKey, dataArray); return base64js.fromByteArray(new Uint8Array(result2)); } - decodeBase64StringUtf8(base644) { - const uint8array = base64js.toByteArray(BrowserCrypto.padBase64(base644)); - const result2 = new TextDecoder().decode(uint8array); - return result2; - } - encodeBase64StringUtf8(text) { - const uint8array = new TextEncoder().encode(text); - const result2 = base64js.fromByteArray(uint8array); - return result2; - } - async sha256DigestHex(str) { - const inputBuffer = new TextEncoder().encode(str); - const outputBuffer = await window.crypto.subtle.digest("SHA-256", inputBuffer); - return (0, crypto_1.fromArrayBufferToHex)(outputBuffer); - } - async signWithHmacSha256(key, msg) { - const rawKey = typeof key === "string" ? key : String.fromCharCode(...new Uint16Array(key)); - const enc = new TextEncoder; - const cryptoKey = await window.crypto.subtle.importKey("raw", enc.encode(rawKey), { - name: "HMAC", - hash: { - name: "SHA-256" - } - }, false, ["sign"]); - return window.crypto.subtle.sign("HMAC", cryptoKey, enc.encode(msg)); - } - } - exports.BrowserCrypto = BrowserCrypto; -}); - -// ../node_modules/google-auth-library/build/src/crypto/node/crypto.js -var require_crypto2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.NodeCrypto = undefined; - var crypto3 = __require("crypto"); - - class NodeCrypto { - async sha256DigestBase64(str) { - return crypto3.createHash("sha256").update(str).digest("base64"); - } - randomBytesBase64(count3) { - return crypto3.randomBytes(count3).toString("base64"); - } - async verify(pubkey, data, signature) { - const verifier = crypto3.createVerify("RSA-SHA256"); - verifier.update(data); - verifier.end(); - return verifier.verify(pubkey, signature, "base64"); - } - async sign(privateKey, data) { - const signer = crypto3.createSign("RSA-SHA256"); - signer.update(data); - signer.end(); - return signer.sign(privateKey, "base64"); - } - decodeBase64StringUtf8(base644) { - return Buffer.from(base644, "base64").toString("utf-8"); - } - encodeBase64StringUtf8(text) { - return Buffer.from(text, "utf-8").toString("base64"); - } - async sha256DigestHex(str) { - return crypto3.createHash("sha256").update(str).digest("hex"); - } - async signWithHmacSha256(key, msg) { - const cryptoKey = typeof key === "string" ? key : toBuffer(key); - return toArrayBuffer(crypto3.createHmac("sha256", cryptoKey).update(msg).digest()); - } - } - exports.NodeCrypto = NodeCrypto; - function toArrayBuffer(buffer) { - return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength); - } - function toBuffer(arrayBuffer) { - return Buffer.from(arrayBuffer); - } -}); - -// ../node_modules/google-auth-library/build/src/crypto/crypto.js -var require_crypto3 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createCrypto = createCrypto; - exports.hasBrowserCrypto = hasBrowserCrypto; - exports.fromArrayBufferToHex = fromArrayBufferToHex; - var crypto_1 = require_crypto(); - var crypto_2 = require_crypto2(); - function createCrypto() { - if (hasBrowserCrypto()) { - return new crypto_1.BrowserCrypto; - } - return new crypto_2.NodeCrypto; - } - function hasBrowserCrypto() { - return typeof window !== "undefined" && typeof window.crypto !== "undefined" && typeof window.crypto.subtle !== "undefined"; - } - function fromArrayBufferToHex(arrayBuffer) { - const byteArray = Array.from(new Uint8Array(arrayBuffer)); - return byteArray.map((byte) => { - return byte.toString(16).padStart(2, "0"); - }).join(""); - } -}); - -// ../node_modules/google-auth-library/build/src/options.js -var require_options = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validate = validate2; - function validate2(options) { - const vpairs = [ - { invalid: "uri", expected: "url" }, - { invalid: "json", expected: "data" }, - { invalid: "qs", expected: "params" } - ]; - for (const pair of vpairs) { - if (options[pair.invalid]) { - const e = `'${pair.invalid}' is not a valid configuration option. Please use '${pair.expected}' instead. This library is using Axios for requests. Please see https://github.com/axios/axios to learn more about the valid request options.`; - throw new Error(e); - } - } - } -}); - -// ../node_modules/google-auth-library/package.json -var require_package9 = __commonJS((exports, module) => { - module.exports = { - name: "google-auth-library", - version: "9.15.1", - author: "Google Inc.", - description: "Google APIs Authentication Client Library for Node.js", - engines: { - node: ">=14" - }, - main: "./build/src/index.js", - types: "./build/src/index.d.ts", - repository: "googleapis/google-auth-library-nodejs.git", - keywords: [ - "google", - "api", - "google apis", - "client", - "client library" - ], - dependencies: { - "base64-js": "^1.3.0", - "ecdsa-sig-formatter": "^1.0.11", - gaxios: "^6.1.1", - "gcp-metadata": "^6.1.0", - gtoken: "^7.0.0", - jws: "^4.0.0" - }, - devDependencies: { - "@types/base64-js": "^1.2.5", - "@types/chai": "^4.1.7", - "@types/jws": "^3.1.0", - "@types/mocha": "^9.0.0", - "@types/mv": "^2.1.0", - "@types/ncp": "^2.0.1", - "@types/node": "^20.4.2", - "@types/sinon": "^17.0.0", - "assert-rejects": "^1.0.0", - c8: "^8.0.0", - chai: "^4.2.0", - cheerio: "1.0.0-rc.12", - codecov: "^3.0.2", - "engine.io": "6.6.2", - gts: "^5.0.0", - "is-docker": "^2.0.0", - jsdoc: "^4.0.0", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - karma: "^6.0.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-firefox-launcher": "^2.0.0", - "karma-mocha": "^2.0.0", - "karma-sourcemap-loader": "^0.4.0", - "karma-webpack": "5.0.0", - keypair: "^1.0.4", - linkinator: "^4.0.0", - mocha: "^9.2.2", - mv: "^2.1.1", - ncp: "^2.0.0", - nock: "^13.0.0", - "null-loader": "^4.0.0", - pdfmake: "0.2.12", - puppeteer: "^21.0.0", - sinon: "^18.0.0", - "ts-loader": "^8.0.0", - typescript: "^5.1.6", - webpack: "^5.21.2", - "webpack-cli": "^4.0.0" - }, - files: [ - "build/src", - "!build/src/**/*.map" - ], - scripts: { - test: "c8 mocha build/test", - clean: "gts clean", - prepare: "npm run compile", - lint: "gts check", - compile: "tsc -p .", - fix: "gts fix", - pretest: "npm run compile -- --sourceMap", - docs: "jsdoc -c .jsdoc.json", - "samples-setup": "cd samples/ && npm link ../ && npm run setup && cd ../", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha build/system-test --timeout 60000", - "presystem-test": "npm run compile -- --sourceMap", - webpack: "webpack", - "browser-test": "karma start", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs", - prelint: "cd samples; npm link ../; npm install", - precompile: "gts clean" - }, - license: "Apache-2.0" - }; -}); - -// ../node_modules/google-auth-library/build/src/transporters.js -var require_transporters = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DefaultTransporter = undefined; - var gaxios_1 = require_src3(); - var options_1 = require_options(); - var pkg = require_package9(); - var PRODUCT_NAME = "google-api-nodejs-client"; - - class DefaultTransporter { - constructor() { - this.instance = new gaxios_1.Gaxios; - } - configure(opts = {}) { - opts.headers = opts.headers || {}; - if (typeof window === "undefined") { - const uaValue = opts.headers["User-Agent"]; - if (!uaValue) { - opts.headers["User-Agent"] = DefaultTransporter.USER_AGENT; - } else if (!uaValue.includes(`${PRODUCT_NAME}/`)) { - opts.headers["User-Agent"] = `${uaValue} ${DefaultTransporter.USER_AGENT}`; - } - if (!opts.headers["x-goog-api-client"]) { - const nodeVersion = process.version.replace(/^v/, ""); - opts.headers["x-goog-api-client"] = `gl-node/${nodeVersion}`; - } - } - return opts; - } - request(opts) { - opts = this.configure(opts); - (0, options_1.validate)(opts); - return this.instance.request(opts).catch((e) => { - throw this.processError(e); - }); - } - get defaults() { - return this.instance.defaults; - } - set defaults(opts) { - this.instance.defaults = opts; - } - processError(e) { - const res = e.response; - const err = e; - const body = res ? res.data : null; - if (res && body && body.error && res.status !== 200) { - if (typeof body.error === "string") { - err.message = body.error; - err.status = res.status; - } else if (Array.isArray(body.error.errors)) { - err.message = body.error.errors.map((err2) => err2.message).join(` -`); - err.code = body.error.code; - err.errors = body.error.errors; - } else { - err.message = body.error.message; - err.code = body.error.code; - } - } else if (res && res.status >= 400) { - err.message = body; - err.status = res.status; - } - return err; - } - } - exports.DefaultTransporter = DefaultTransporter; - DefaultTransporter.USER_AGENT = `${PRODUCT_NAME}/${pkg.version}`; -}); - -// ../node_modules/safe-buffer/index.js -var require_safe_buffer = __commonJS((exports, module) => { - /*! safe-buffer. MIT License. Feross Aboukhadijeh */ - var buffer = __require("buffer"); - var Buffer7 = buffer.Buffer; - function copyProps(src, dst) { - for (var key in src) { - dst[key] = src[key]; - } - } - if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) { - module.exports = buffer; - } else { - copyProps(buffer, exports); - exports.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer7(arg, encodingOrOffset, length); - } - SafeBuffer.prototype = Object.create(Buffer7.prototype); - copyProps(Buffer7, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); - } - return Buffer7(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function(size2, fill2, encoding) { - if (typeof size2 !== "number") { - throw new TypeError("Argument must be a number"); - } - var buf = Buffer7(size2); - if (fill2 !== undefined) { - if (typeof encoding === "string") { - buf.fill(fill2, encoding); - } else { - buf.fill(fill2); - } - } else { - buf.fill(0); - } - return buf; - }; - SafeBuffer.allocUnsafe = function(size2) { - if (typeof size2 !== "number") { - throw new TypeError("Argument must be a number"); - } - return Buffer7(size2); - }; - SafeBuffer.allocUnsafeSlow = function(size2) { - if (typeof size2 !== "number") { - throw new TypeError("Argument must be a number"); - } - return buffer.SlowBuffer(size2); - }; -}); - -// ../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js -var require_param_bytes_for_alg = __commonJS((exports, module) => { - function getParamSize(keySize) { - var result2 = (keySize / 8 | 0) + (keySize % 8 === 0 ? 0 : 1); - return result2; - } - var paramBytesForAlg = { - ES256: getParamSize(256), - ES384: getParamSize(384), - ES512: getParamSize(521) - }; - function getParamBytesForAlg(alg) { - var paramBytes = paramBytesForAlg[alg]; - if (paramBytes) { - return paramBytes; - } - throw new Error('Unknown algorithm "' + alg + '"'); - } - module.exports = getParamBytesForAlg; -}); - -// ../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js -var require_ecdsa_sig_formatter = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer().Buffer; - var getParamBytesForAlg = require_param_bytes_for_alg(); - var MAX_OCTET = 128; - var CLASS_UNIVERSAL = 0; - var PRIMITIVE_BIT = 32; - var TAG_SEQ = 16; - var TAG_INT = 2; - var ENCODED_TAG_SEQ = TAG_SEQ | PRIMITIVE_BIT | CLASS_UNIVERSAL << 6; - var ENCODED_TAG_INT = TAG_INT | CLASS_UNIVERSAL << 6; - function base64Url(base644) { - return base644.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); - } - function signatureAsBuffer(signature) { - if (Buffer7.isBuffer(signature)) { - return signature; - } else if (typeof signature === "string") { - return Buffer7.from(signature, "base64"); - } - throw new TypeError("ECDSA signature must be a Base64 string or a Buffer"); - } - function derToJose(signature, alg) { - signature = signatureAsBuffer(signature); - var paramBytes = getParamBytesForAlg(alg); - var maxEncodedParamLength = paramBytes + 1; - var inputLength = signature.length; - var offset = 0; - if (signature[offset++] !== ENCODED_TAG_SEQ) { - throw new Error('Could not find expected "seq"'); - } - var seqLength = signature[offset++]; - if (seqLength === (MAX_OCTET | 1)) { - seqLength = signature[offset++]; - } - if (inputLength - offset < seqLength) { - throw new Error('"seq" specified length of "' + seqLength + '", only "' + (inputLength - offset) + '" remaining'); - } - if (signature[offset++] !== ENCODED_TAG_INT) { - throw new Error('Could not find expected "int" for "r"'); - } - var rLength = signature[offset++]; - if (inputLength - offset - 2 < rLength) { - throw new Error('"r" specified length of "' + rLength + '", only "' + (inputLength - offset - 2) + '" available'); - } - if (maxEncodedParamLength < rLength) { - throw new Error('"r" specified length of "' + rLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); - } - var rOffset = offset; - offset += rLength; - if (signature[offset++] !== ENCODED_TAG_INT) { - throw new Error('Could not find expected "int" for "s"'); - } - var sLength = signature[offset++]; - if (inputLength - offset !== sLength) { - throw new Error('"s" specified length of "' + sLength + '", expected "' + (inputLength - offset) + '"'); - } - if (maxEncodedParamLength < sLength) { - throw new Error('"s" specified length of "' + sLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); - } - var sOffset = offset; - offset += sLength; - if (offset !== inputLength) { - throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain'); - } - var rPadding = paramBytes - rLength, sPadding = paramBytes - sLength; - var dst = Buffer7.allocUnsafe(rPadding + rLength + sPadding + sLength); - for (offset = 0;offset < rPadding; ++offset) { - dst[offset] = 0; - } - signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength); - offset = paramBytes; - for (var o2 = offset;offset < o2 + sPadding; ++offset) { - dst[offset] = 0; - } - signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength); - dst = dst.toString("base64"); - dst = base64Url(dst); - return dst; - } - function countPadding(buf, start, stop) { - var padding = 0; - while (start + padding < stop && buf[start + padding] === 0) { - ++padding; - } - var needsSign = buf[start + padding] >= MAX_OCTET; - if (needsSign) { - --padding; - } - return padding; - } - function joseToDer(signature, alg) { - signature = signatureAsBuffer(signature); - var paramBytes = getParamBytesForAlg(alg); - var signatureBytes = signature.length; - if (signatureBytes !== paramBytes * 2) { - throw new TypeError('"' + alg + '" signatures must be "' + paramBytes * 2 + '" bytes, saw "' + signatureBytes + '"'); - } - var rPadding = countPadding(signature, 0, paramBytes); - var sPadding = countPadding(signature, paramBytes, signature.length); - var rLength = paramBytes - rPadding; - var sLength = paramBytes - sPadding; - var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength; - var shortLength = rsBytes < MAX_OCTET; - var dst = Buffer7.allocUnsafe((shortLength ? 2 : 3) + rsBytes); - var offset = 0; - dst[offset++] = ENCODED_TAG_SEQ; - if (shortLength) { - dst[offset++] = rsBytes; - } else { - dst[offset++] = MAX_OCTET | 1; - dst[offset++] = rsBytes & 255; - } - dst[offset++] = ENCODED_TAG_INT; - dst[offset++] = rLength; - if (rPadding < 0) { - dst[offset++] = 0; - offset += signature.copy(dst, offset, 0, paramBytes); - } else { - offset += signature.copy(dst, offset, rPadding, paramBytes); - } - dst[offset++] = ENCODED_TAG_INT; - dst[offset++] = sLength; - if (sPadding < 0) { - dst[offset++] = 0; - signature.copy(dst, offset, paramBytes); - } else { - signature.copy(dst, offset, paramBytes + sPadding); - } - return dst; - } - module.exports = { - derToJose, - joseToDer - }; -}); - -// ../node_modules/google-auth-library/build/src/util.js -var require_util8 = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var _LRUCache_instances; - var _LRUCache_cache; - var _LRUCache_moveToEnd; - var _LRUCache_evict; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.LRUCache = undefined; - exports.snakeToCamel = snakeToCamel; - exports.originalOrCamelOptions = originalOrCamelOptions; - function snakeToCamel(str) { - return str.replace(/([_][^_])/g, (match) => match.slice(1).toUpperCase()); - } - function originalOrCamelOptions(obj) { - function get2(key) { - var _a3; - const o2 = obj || {}; - return (_a3 = o2[key]) !== null && _a3 !== undefined ? _a3 : o2[snakeToCamel(key)]; - } - return { get: get2 }; - } - - class LRUCache { - constructor(options) { - _LRUCache_instances.add(this); - _LRUCache_cache.set(this, new Map); - this.capacity = options.capacity; - this.maxAge = options.maxAge; - } - set(key, value) { - __classPrivateFieldGet3(this, _LRUCache_instances, "m", _LRUCache_moveToEnd).call(this, key, value); - __classPrivateFieldGet3(this, _LRUCache_instances, "m", _LRUCache_evict).call(this); - } - get(key) { - const item = __classPrivateFieldGet3(this, _LRUCache_cache, "f").get(key); - if (!item) - return; - __classPrivateFieldGet3(this, _LRUCache_instances, "m", _LRUCache_moveToEnd).call(this, key, item.value); - __classPrivateFieldGet3(this, _LRUCache_instances, "m", _LRUCache_evict).call(this); - return item.value; - } - } - exports.LRUCache = LRUCache; - _LRUCache_cache = new WeakMap, _LRUCache_instances = new WeakSet, _LRUCache_moveToEnd = function _LRUCache_moveToEnd(key, value) { - __classPrivateFieldGet3(this, _LRUCache_cache, "f").delete(key); - __classPrivateFieldGet3(this, _LRUCache_cache, "f").set(key, { - value, - lastAccessed: Date.now() - }); - }, _LRUCache_evict = function _LRUCache_evict() { - const cutoffDate = this.maxAge ? Date.now() - this.maxAge : 0; - let oldestItem = __classPrivateFieldGet3(this, _LRUCache_cache, "f").entries().next(); - while (!oldestItem.done && (__classPrivateFieldGet3(this, _LRUCache_cache, "f").size > this.capacity || oldestItem.value[1].lastAccessed < cutoffDate)) { - __classPrivateFieldGet3(this, _LRUCache_cache, "f").delete(oldestItem.value[0]); - oldestItem = __classPrivateFieldGet3(this, _LRUCache_cache, "f").entries().next(); - } - }; -}); - -// ../node_modules/google-auth-library/build/src/auth/authclient.js -var require_authclient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AuthClient = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = exports.DEFAULT_UNIVERSE = undefined; - var events_1 = __require("events"); - var gaxios_1 = require_src3(); - var transporters_1 = require_transporters(); - var util_1 = require_util8(); - exports.DEFAULT_UNIVERSE = "googleapis.com"; - exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = 5 * 60 * 1000; - - class AuthClient extends events_1.EventEmitter { - constructor(opts = {}) { - var _a3, _b, _c, _d, _e; - super(); - this.credentials = {}; - this.eagerRefreshThresholdMillis = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS; - this.forceRefreshOnFailure = false; - this.universeDomain = exports.DEFAULT_UNIVERSE; - const options = (0, util_1.originalOrCamelOptions)(opts); - this.apiKey = opts.apiKey; - this.projectId = (_a3 = options.get("project_id")) !== null && _a3 !== undefined ? _a3 : null; - this.quotaProjectId = options.get("quota_project_id"); - this.credentials = (_b = options.get("credentials")) !== null && _b !== undefined ? _b : {}; - this.universeDomain = (_c = options.get("universe_domain")) !== null && _c !== undefined ? _c : exports.DEFAULT_UNIVERSE; - this.transporter = (_d = opts.transporter) !== null && _d !== undefined ? _d : new transporters_1.DefaultTransporter; - if (opts.transporterOptions) { - this.transporter.defaults = opts.transporterOptions; - } - if (opts.eagerRefreshThresholdMillis) { - this.eagerRefreshThresholdMillis = opts.eagerRefreshThresholdMillis; - } - this.forceRefreshOnFailure = (_e = opts.forceRefreshOnFailure) !== null && _e !== undefined ? _e : false; - } - get gaxios() { - if (this.transporter instanceof gaxios_1.Gaxios) { - return this.transporter; - } else if (this.transporter instanceof transporters_1.DefaultTransporter) { - return this.transporter.instance; - } else if ("instance" in this.transporter && this.transporter.instance instanceof gaxios_1.Gaxios) { - return this.transporter.instance; - } - return null; - } - setCredentials(credentials) { - this.credentials = credentials; - } - addSharedMetadataHeaders(headers) { - if (!headers["x-goog-user-project"] && this.quotaProjectId) { - headers["x-goog-user-project"] = this.quotaProjectId; - } - return headers; - } - static get RETRY_CONFIG() { - return { - retry: true, - retryConfig: { - httpMethodsToRetry: ["GET", "PUT", "POST", "HEAD", "OPTIONS", "DELETE"] - } - }; - } - } - exports.AuthClient = AuthClient; -}); - -// ../node_modules/google-auth-library/build/src/auth/loginticket.js -var require_loginticket = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.LoginTicket = undefined; - - class LoginTicket { - constructor(env5, pay) { - this.envelope = env5; - this.payload = pay; - } - getEnvelope() { - return this.envelope; - } - getPayload() { - return this.payload; - } - getUserId() { - const payload = this.getPayload(); - if (payload && payload.sub) { - return payload.sub; - } - return null; - } - getAttributes() { - return { envelope: this.getEnvelope(), payload: this.getPayload() }; - } - } - exports.LoginTicket = LoginTicket; -}); - -// ../node_modules/google-auth-library/build/src/auth/oauth2client.js -var require_oauth2client = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OAuth2Client = exports.ClientAuthentication = exports.CertificateFormat = exports.CodeChallengeMethod = undefined; - var gaxios_1 = require_src3(); - var querystring = __require("querystring"); - var stream4 = __require("stream"); - var formatEcdsa = require_ecdsa_sig_formatter(); - var crypto_1 = require_crypto3(); - var authclient_1 = require_authclient(); - var loginticket_1 = require_loginticket(); - var CodeChallengeMethod; - (function(CodeChallengeMethod2) { - CodeChallengeMethod2["Plain"] = "plain"; - CodeChallengeMethod2["S256"] = "S256"; - })(CodeChallengeMethod || (exports.CodeChallengeMethod = CodeChallengeMethod = {})); - var CertificateFormat; - (function(CertificateFormat2) { - CertificateFormat2["PEM"] = "PEM"; - CertificateFormat2["JWK"] = "JWK"; - })(CertificateFormat || (exports.CertificateFormat = CertificateFormat = {})); - var ClientAuthentication; - (function(ClientAuthentication2) { - ClientAuthentication2["ClientSecretPost"] = "ClientSecretPost"; - ClientAuthentication2["ClientSecretBasic"] = "ClientSecretBasic"; - ClientAuthentication2["None"] = "None"; - })(ClientAuthentication || (exports.ClientAuthentication = ClientAuthentication = {})); - - class OAuth2Client extends authclient_1.AuthClient { - constructor(optionsOrClientId, clientSecret, redirectUri) { - const opts = optionsOrClientId && typeof optionsOrClientId === "object" ? optionsOrClientId : { clientId: optionsOrClientId, clientSecret, redirectUri }; - super(opts); - this.certificateCache = {}; - this.certificateExpiry = null; - this.certificateCacheFormat = CertificateFormat.PEM; - this.refreshTokenPromises = new Map; - this._clientId = opts.clientId; - this._clientSecret = opts.clientSecret; - this.redirectUri = opts.redirectUri; - this.endpoints = { - tokenInfoUrl: "https://oauth2.googleapis.com/tokeninfo", - oauth2AuthBaseUrl: "https://accounts.google.com/o/oauth2/v2/auth", - oauth2TokenUrl: "https://oauth2.googleapis.com/token", - oauth2RevokeUrl: "https://oauth2.googleapis.com/revoke", - oauth2FederatedSignonPemCertsUrl: "https://www.googleapis.com/oauth2/v1/certs", - oauth2FederatedSignonJwkCertsUrl: "https://www.googleapis.com/oauth2/v3/certs", - oauth2IapPublicKeyUrl: "https://www.gstatic.com/iap/verify/public_key", - ...opts.endpoints - }; - this.clientAuthentication = opts.clientAuthentication || ClientAuthentication.ClientSecretPost; - this.issuers = opts.issuers || [ - "accounts.google.com", - "https://accounts.google.com", - this.universeDomain - ]; - } - generateAuthUrl(opts = {}) { - if (opts.code_challenge_method && !opts.code_challenge) { - throw new Error("If a code_challenge_method is provided, code_challenge must be included."); - } - opts.response_type = opts.response_type || "code"; - opts.client_id = opts.client_id || this._clientId; - opts.redirect_uri = opts.redirect_uri || this.redirectUri; - if (Array.isArray(opts.scope)) { - opts.scope = opts.scope.join(" "); - } - const rootUrl = this.endpoints.oauth2AuthBaseUrl.toString(); - return rootUrl + "?" + querystring.stringify(opts); - } - generateCodeVerifier() { - throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead."); - } - async generateCodeVerifierAsync() { - const crypto3 = (0, crypto_1.createCrypto)(); - const randomString2 = crypto3.randomBytesBase64(96); - const codeVerifier = randomString2.replace(/\+/g, "~").replace(/=/g, "_").replace(/\//g, "-"); - const unencodedCodeChallenge = await crypto3.sha256DigestBase64(codeVerifier); - const codeChallenge = unencodedCodeChallenge.split("=")[0].replace(/\+/g, "-").replace(/\//g, "_"); - return { codeVerifier, codeChallenge }; - } - getToken(codeOrOptions, callback) { - const options = typeof codeOrOptions === "string" ? { code: codeOrOptions } : codeOrOptions; - if (callback) { - this.getTokenAsync(options).then((r) => callback(null, r.tokens, r.res), (e) => callback(e, null, e.response)); - } else { - return this.getTokenAsync(options); - } - } - async getTokenAsync(options) { - const url3 = this.endpoints.oauth2TokenUrl.toString(); - const headers = { - "Content-Type": "application/x-www-form-urlencoded" - }; - const values3 = { - client_id: options.client_id || this._clientId, - code_verifier: options.codeVerifier, - code: options.code, - grant_type: "authorization_code", - redirect_uri: options.redirect_uri || this.redirectUri - }; - if (this.clientAuthentication === ClientAuthentication.ClientSecretBasic) { - const basic = Buffer.from(`${this._clientId}:${this._clientSecret}`); - headers["Authorization"] = `Basic ${basic.toString("base64")}`; - } - if (this.clientAuthentication === ClientAuthentication.ClientSecretPost) { - values3.client_secret = this._clientSecret; - } - const res = await this.transporter.request({ - ...OAuth2Client.RETRY_CONFIG, - method: "POST", - url: url3, - data: querystring.stringify(values3), - headers - }); - const tokens = res.data; - if (res.data && res.data.expires_in) { - tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000; - delete tokens.expires_in; - } - this.emit("tokens", tokens); - return { tokens, res }; - } - async refreshToken(refreshToken) { - if (!refreshToken) { - return this.refreshTokenNoCache(refreshToken); - } - if (this.refreshTokenPromises.has(refreshToken)) { - return this.refreshTokenPromises.get(refreshToken); - } - const p = this.refreshTokenNoCache(refreshToken).then((r) => { - this.refreshTokenPromises.delete(refreshToken); - return r; - }, (e) => { - this.refreshTokenPromises.delete(refreshToken); - throw e; - }); - this.refreshTokenPromises.set(refreshToken, p); - return p; - } - async refreshTokenNoCache(refreshToken) { - var _a3; - if (!refreshToken) { - throw new Error("No refresh token is set."); - } - const url3 = this.endpoints.oauth2TokenUrl.toString(); - const data = { - refresh_token: refreshToken, - client_id: this._clientId, - client_secret: this._clientSecret, - grant_type: "refresh_token" - }; - let res; - try { - res = await this.transporter.request({ - ...OAuth2Client.RETRY_CONFIG, - method: "POST", - url: url3, - data: querystring.stringify(data), - headers: { "Content-Type": "application/x-www-form-urlencoded" } - }); - } catch (e) { - if (e instanceof gaxios_1.GaxiosError && e.message === "invalid_grant" && ((_a3 = e.response) === null || _a3 === undefined ? undefined : _a3.data) && /ReAuth/i.test(e.response.data.error_description)) { - e.message = JSON.stringify(e.response.data); - } - throw e; - } - const tokens = res.data; - if (res.data && res.data.expires_in) { - tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000; - delete tokens.expires_in; - } - this.emit("tokens", tokens); - return { tokens, res }; - } - refreshAccessToken(callback) { - if (callback) { - this.refreshAccessTokenAsync().then((r) => callback(null, r.credentials, r.res), callback); - } else { - return this.refreshAccessTokenAsync(); - } - } - async refreshAccessTokenAsync() { - const r = await this.refreshToken(this.credentials.refresh_token); - const tokens = r.tokens; - tokens.refresh_token = this.credentials.refresh_token; - this.credentials = tokens; - return { credentials: this.credentials, res: r.res }; - } - getAccessToken(callback) { - if (callback) { - this.getAccessTokenAsync().then((r) => callback(null, r.token, r.res), callback); - } else { - return this.getAccessTokenAsync(); - } - } - async getAccessTokenAsync() { - const shouldRefresh = !this.credentials.access_token || this.isTokenExpiring(); - if (shouldRefresh) { - if (!this.credentials.refresh_token) { - if (this.refreshHandler) { - const refreshedAccessToken = await this.processAndValidateRefreshHandler(); - if (refreshedAccessToken === null || refreshedAccessToken === undefined ? undefined : refreshedAccessToken.access_token) { - this.setCredentials(refreshedAccessToken); - return { token: this.credentials.access_token }; - } - } else { - throw new Error("No refresh token or refresh handler callback is set."); - } - } - const r = await this.refreshAccessTokenAsync(); - if (!r.credentials || r.credentials && !r.credentials.access_token) { - throw new Error("Could not refresh access token."); - } - return { token: r.credentials.access_token, res: r.res }; - } else { - return { token: this.credentials.access_token }; - } - } - async getRequestHeaders(url3) { - const headers = (await this.getRequestMetadataAsync(url3)).headers; - return headers; - } - async getRequestMetadataAsync(url3) { - const thisCreds = this.credentials; - if (!thisCreds.access_token && !thisCreds.refresh_token && !this.apiKey && !this.refreshHandler) { - throw new Error("No access, refresh token, API key or refresh handler callback is set."); - } - if (thisCreds.access_token && !this.isTokenExpiring()) { - thisCreds.token_type = thisCreds.token_type || "Bearer"; - const headers2 = { - Authorization: thisCreds.token_type + " " + thisCreds.access_token - }; - return { headers: this.addSharedMetadataHeaders(headers2) }; - } - if (this.refreshHandler) { - const refreshedAccessToken = await this.processAndValidateRefreshHandler(); - if (refreshedAccessToken === null || refreshedAccessToken === undefined ? undefined : refreshedAccessToken.access_token) { - this.setCredentials(refreshedAccessToken); - const headers2 = { - Authorization: "Bearer " + this.credentials.access_token - }; - return { headers: this.addSharedMetadataHeaders(headers2) }; - } - } - if (this.apiKey) { - return { headers: { "X-Goog-Api-Key": this.apiKey } }; - } - let r = null; - let tokens = null; - try { - r = await this.refreshToken(thisCreds.refresh_token); - tokens = r.tokens; - } catch (err) { - const e = err; - if (e.response && (e.response.status === 403 || e.response.status === 404)) { - e.message = `Could not refresh access token: ${e.message}`; - } - throw e; - } - const credentials = this.credentials; - credentials.token_type = credentials.token_type || "Bearer"; - tokens.refresh_token = credentials.refresh_token; - this.credentials = tokens; - const headers = { - Authorization: credentials.token_type + " " + tokens.access_token - }; - return { headers: this.addSharedMetadataHeaders(headers), res: r.res }; - } - static getRevokeTokenUrl(token) { - return new OAuth2Client().getRevokeTokenURL(token).toString(); - } - getRevokeTokenURL(token) { - const url3 = new URL(this.endpoints.oauth2RevokeUrl); - url3.searchParams.append("token", token); - return url3; - } - revokeToken(token, callback) { - const opts = { - ...OAuth2Client.RETRY_CONFIG, - url: this.getRevokeTokenURL(token).toString(), - method: "POST" - }; - if (callback) { - this.transporter.request(opts).then((r) => callback(null, r), callback); - } else { - return this.transporter.request(opts); - } - } - revokeCredentials(callback) { - if (callback) { - this.revokeCredentialsAsync().then((res) => callback(null, res), callback); - } else { - return this.revokeCredentialsAsync(); - } - } - async revokeCredentialsAsync() { - const token = this.credentials.access_token; - this.credentials = {}; - if (token) { - return this.revokeToken(token); - } else { - throw new Error("No access token to revoke."); - } - } - request(opts, callback) { - if (callback) { - this.requestAsync(opts).then((r) => callback(null, r), (e) => { - return callback(e, e.response); - }); - } else { - return this.requestAsync(opts); - } - } - async requestAsync(opts, reAuthRetried = false) { - let r2; - try { - const r = await this.getRequestMetadataAsync(opts.url); - opts.headers = opts.headers || {}; - if (r.headers && r.headers["x-goog-user-project"]) { - opts.headers["x-goog-user-project"] = r.headers["x-goog-user-project"]; - } - if (r.headers && r.headers.Authorization) { - opts.headers.Authorization = r.headers.Authorization; - } - if (this.apiKey) { - opts.headers["X-Goog-Api-Key"] = this.apiKey; - } - r2 = await this.transporter.request(opts); - } catch (e) { - const res = e.response; - if (res) { - const statusCode = res.status; - const mayRequireRefresh = this.credentials && this.credentials.access_token && this.credentials.refresh_token && (!this.credentials.expiry_date || this.forceRefreshOnFailure); - const mayRequireRefreshWithNoRefreshToken = this.credentials && this.credentials.access_token && !this.credentials.refresh_token && (!this.credentials.expiry_date || this.forceRefreshOnFailure) && this.refreshHandler; - const isReadableStream4 = res.config.data instanceof stream4.Readable; - const isAuthErr = statusCode === 401 || statusCode === 403; - if (!reAuthRetried && isAuthErr && !isReadableStream4 && mayRequireRefresh) { - await this.refreshAccessTokenAsync(); - return this.requestAsync(opts, true); - } else if (!reAuthRetried && isAuthErr && !isReadableStream4 && mayRequireRefreshWithNoRefreshToken) { - const refreshedAccessToken = await this.processAndValidateRefreshHandler(); - if (refreshedAccessToken === null || refreshedAccessToken === undefined ? undefined : refreshedAccessToken.access_token) { - this.setCredentials(refreshedAccessToken); - } - return this.requestAsync(opts, true); - } - } - throw e; - } - return r2; - } - verifyIdToken(options, callback) { - if (callback && typeof callback !== "function") { - throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry."); - } - if (callback) { - this.verifyIdTokenAsync(options).then((r) => callback(null, r), callback); - } else { - return this.verifyIdTokenAsync(options); - } - } - async verifyIdTokenAsync(options) { - if (!options.idToken) { - throw new Error("The verifyIdToken method requires an ID Token"); - } - const response = await this.getFederatedSignonCertsAsync(); - const login = await this.verifySignedJwtWithCertsAsync(options.idToken, response.certs, options.audience, this.issuers, options.maxExpiry); - return login; - } - async getTokenInfo(accessToken) { - const { data } = await this.transporter.request({ - ...OAuth2Client.RETRY_CONFIG, - method: "POST", - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Authorization: `Bearer ${accessToken}` - }, - url: this.endpoints.tokenInfoUrl.toString() - }); - const info = Object.assign({ - expiry_date: new Date().getTime() + data.expires_in * 1000, - scopes: data.scope.split(" ") - }, data); - delete info.expires_in; - delete info.scope; - return info; - } - getFederatedSignonCerts(callback) { - if (callback) { - this.getFederatedSignonCertsAsync().then((r) => callback(null, r.certs, r.res), callback); - } else { - return this.getFederatedSignonCertsAsync(); - } - } - async getFederatedSignonCertsAsync() { - const nowTime = new Date().getTime(); - const format3 = (0, crypto_1.hasBrowserCrypto)() ? CertificateFormat.JWK : CertificateFormat.PEM; - if (this.certificateExpiry && nowTime < this.certificateExpiry.getTime() && this.certificateCacheFormat === format3) { - return { certs: this.certificateCache, format: format3 }; - } - let res; - let url3; - switch (format3) { - case CertificateFormat.PEM: - url3 = this.endpoints.oauth2FederatedSignonPemCertsUrl.toString(); - break; - case CertificateFormat.JWK: - url3 = this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString(); - break; - default: - throw new Error(`Unsupported certificate format ${format3}`); - } - try { - res = await this.transporter.request({ - ...OAuth2Client.RETRY_CONFIG, - url: url3 - }); - } catch (e) { - if (e instanceof Error) { - e.message = `Failed to retrieve verification certificates: ${e.message}`; - } - throw e; - } - const cacheControl = res ? res.headers["cache-control"] : undefined; - let cacheAge = -1; - if (cacheControl) { - const pattern = new RegExp("max-age=([0-9]*)"); - const regexResult = pattern.exec(cacheControl); - if (regexResult && regexResult.length === 2) { - cacheAge = Number(regexResult[1]) * 1000; - } - } - let certificates = {}; - switch (format3) { - case CertificateFormat.PEM: - certificates = res.data; - break; - case CertificateFormat.JWK: - for (const key of res.data.keys) { - certificates[key.kid] = key; - } - break; - default: - throw new Error(`Unsupported certificate format ${format3}`); - } - const now2 = new Date; - this.certificateExpiry = cacheAge === -1 ? null : new Date(now2.getTime() + cacheAge); - this.certificateCache = certificates; - this.certificateCacheFormat = format3; - return { certs: certificates, format: format3, res }; - } - getIapPublicKeys(callback) { - if (callback) { - this.getIapPublicKeysAsync().then((r) => callback(null, r.pubkeys, r.res), callback); - } else { - return this.getIapPublicKeysAsync(); - } - } - async getIapPublicKeysAsync() { - let res; - const url3 = this.endpoints.oauth2IapPublicKeyUrl.toString(); - try { - res = await this.transporter.request({ - ...OAuth2Client.RETRY_CONFIG, - url: url3 - }); - } catch (e) { - if (e instanceof Error) { - e.message = `Failed to retrieve verification certificates: ${e.message}`; - } - throw e; - } - return { pubkeys: res.data, res }; - } - verifySignedJwtWithCerts() { - throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead."); - } - async verifySignedJwtWithCertsAsync(jwt2, certs, requiredAudience, issuers, maxExpiry) { - const crypto3 = (0, crypto_1.createCrypto)(); - if (!maxExpiry) { - maxExpiry = OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_; - } - const segments = jwt2.split("."); - if (segments.length !== 3) { - throw new Error("Wrong number of segments in token: " + jwt2); - } - const signed = segments[0] + "." + segments[1]; - let signature = segments[2]; - let envelope; - let payload; - try { - envelope = JSON.parse(crypto3.decodeBase64StringUtf8(segments[0])); - } catch (err) { - if (err instanceof Error) { - err.message = `Can't parse token envelope: ${segments[0]}': ${err.message}`; - } - throw err; - } - if (!envelope) { - throw new Error("Can't parse token envelope: " + segments[0]); - } - try { - payload = JSON.parse(crypto3.decodeBase64StringUtf8(segments[1])); - } catch (err) { - if (err instanceof Error) { - err.message = `Can't parse token payload '${segments[0]}`; - } - throw err; - } - if (!payload) { - throw new Error("Can't parse token payload: " + segments[1]); - } - if (!Object.prototype.hasOwnProperty.call(certs, envelope.kid)) { - throw new Error("No pem found for envelope: " + JSON.stringify(envelope)); - } - const cert = certs[envelope.kid]; - if (envelope.alg === "ES256") { - signature = formatEcdsa.joseToDer(signature, "ES256").toString("base64"); - } - const verified = await crypto3.verify(cert, signed, signature); - if (!verified) { - throw new Error("Invalid token signature: " + jwt2); - } - if (!payload.iat) { - throw new Error("No issue time in token: " + JSON.stringify(payload)); - } - if (!payload.exp) { - throw new Error("No expiration time in token: " + JSON.stringify(payload)); - } - const iat = Number(payload.iat); - if (isNaN(iat)) - throw new Error("iat field using invalid format"); - const exp = Number(payload.exp); - if (isNaN(exp)) - throw new Error("exp field using invalid format"); - const now2 = new Date().getTime() / 1000; - if (exp >= now2 + maxExpiry) { - throw new Error("Expiration time too far in future: " + JSON.stringify(payload)); - } - const earliest = iat - OAuth2Client.CLOCK_SKEW_SECS_; - const latest = exp + OAuth2Client.CLOCK_SKEW_SECS_; - if (now2 < earliest) { - throw new Error("Token used too early, " + now2 + " < " + earliest + ": " + JSON.stringify(payload)); - } - if (now2 > latest) { - throw new Error("Token used too late, " + now2 + " > " + latest + ": " + JSON.stringify(payload)); - } - if (issuers && issuers.indexOf(payload.iss) < 0) { - throw new Error("Invalid issuer, expected one of [" + issuers + "], but got " + payload.iss); - } - if (typeof requiredAudience !== "undefined" && requiredAudience !== null) { - const aud = payload.aud; - let audVerified = false; - if (requiredAudience.constructor === Array) { - audVerified = requiredAudience.indexOf(aud) > -1; - } else { - audVerified = aud === requiredAudience; - } - if (!audVerified) { - throw new Error("Wrong recipient, payload audience != requiredAudience"); - } - } - return new loginticket_1.LoginTicket(envelope, payload); - } - async processAndValidateRefreshHandler() { - if (this.refreshHandler) { - const accessTokenResponse = await this.refreshHandler(); - if (!accessTokenResponse.access_token) { - throw new Error("No access token is returned by the refreshHandler callback."); - } - return accessTokenResponse; - } - return; - } - isTokenExpiring() { - const expiryDate = this.credentials.expiry_date; - return expiryDate ? expiryDate <= new Date().getTime() + this.eagerRefreshThresholdMillis : false; - } - } - exports.OAuth2Client = OAuth2Client; - OAuth2Client.GOOGLE_TOKEN_INFO_URL = "https://oauth2.googleapis.com/tokeninfo"; - OAuth2Client.CLOCK_SKEW_SECS_ = 300; - OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_ = 86400; -}); - -// ../node_modules/google-auth-library/build/src/auth/computeclient.js -var require_computeclient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Compute = undefined; - var gaxios_1 = require_src3(); - var gcpMetadata = require_src5(); - var oauth2client_1 = require_oauth2client(); - - class Compute extends oauth2client_1.OAuth2Client { - constructor(options = {}) { - super(options); - this.credentials = { expiry_date: 1, refresh_token: "compute-placeholder" }; - this.serviceAccountEmail = options.serviceAccountEmail || "default"; - this.scopes = Array.isArray(options.scopes) ? options.scopes : options.scopes ? [options.scopes] : []; - } - async refreshTokenNoCache(refreshToken) { - const tokenPath = `service-accounts/${this.serviceAccountEmail}/token`; - let data; - try { - const instanceOptions = { - property: tokenPath - }; - if (this.scopes.length > 0) { - instanceOptions.params = { - scopes: this.scopes.join(",") - }; - } - data = await gcpMetadata.instance(instanceOptions); - } catch (e) { - if (e instanceof gaxios_1.GaxiosError) { - e.message = `Could not refresh access token: ${e.message}`; - this.wrapError(e); - } - throw e; - } - const tokens = data; - if (data && data.expires_in) { - tokens.expiry_date = new Date().getTime() + data.expires_in * 1000; - delete tokens.expires_in; - } - this.emit("tokens", tokens); - return { tokens, res: null }; - } - async fetchIdToken(targetAudience) { - const idTokenPath = `service-accounts/${this.serviceAccountEmail}/identity` + `?format=full&audience=${targetAudience}`; - let idToken; - try { - const instanceOptions = { - property: idTokenPath - }; - idToken = await gcpMetadata.instance(instanceOptions); - } catch (e) { - if (e instanceof Error) { - e.message = `Could not fetch ID token: ${e.message}`; - } - throw e; - } - return idToken; - } - wrapError(e) { - const res = e.response; - if (res && res.status) { - e.status = res.status; - if (res.status === 403) { - e.message = "A Forbidden error was returned while attempting to retrieve an access " + "token for the Compute Engine built-in service account. This may be because the Compute " + "Engine instance does not have the correct permission scopes specified: " + e.message; - } else if (res.status === 404) { - e.message = "A Not Found error was returned while attempting to retrieve an access" + "token for the Compute Engine built-in service account. This may be because the Compute " + "Engine instance does not have any permission scopes specified: " + e.message; - } - } - } - } - exports.Compute = Compute; -}); - -// ../node_modules/google-auth-library/build/src/auth/idtokenclient.js -var require_idtokenclient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.IdTokenClient = undefined; - var oauth2client_1 = require_oauth2client(); - - class IdTokenClient extends oauth2client_1.OAuth2Client { - constructor(options) { - super(options); - this.targetAudience = options.targetAudience; - this.idTokenProvider = options.idTokenProvider; - } - async getRequestMetadataAsync(url3) { - if (!this.credentials.id_token || !this.credentials.expiry_date || this.isTokenExpiring()) { - const idToken = await this.idTokenProvider.fetchIdToken(this.targetAudience); - this.credentials = { - id_token: idToken, - expiry_date: this.getIdTokenExpiryDate(idToken) - }; - } - const headers = { - Authorization: "Bearer " + this.credentials.id_token - }; - return { headers }; - } - getIdTokenExpiryDate(idToken) { - const payloadB64 = idToken.split(".")[1]; - if (payloadB64) { - const payload = JSON.parse(Buffer.from(payloadB64, "base64").toString("ascii")); - return payload.exp * 1000; - } - } - } - exports.IdTokenClient = IdTokenClient; -}); - -// ../node_modules/google-auth-library/build/src/auth/envDetect.js -var require_envDetect = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GCPEnv = undefined; - exports.clear = clear; - exports.getEnv = getEnv3; - var gcpMetadata = require_src5(); - var GCPEnv; - (function(GCPEnv2) { - GCPEnv2["APP_ENGINE"] = "APP_ENGINE"; - GCPEnv2["KUBERNETES_ENGINE"] = "KUBERNETES_ENGINE"; - GCPEnv2["CLOUD_FUNCTIONS"] = "CLOUD_FUNCTIONS"; - GCPEnv2["COMPUTE_ENGINE"] = "COMPUTE_ENGINE"; - GCPEnv2["CLOUD_RUN"] = "CLOUD_RUN"; - GCPEnv2["NONE"] = "NONE"; - })(GCPEnv || (exports.GCPEnv = GCPEnv = {})); - var envPromise; - function clear() { - envPromise = undefined; - } - async function getEnv3() { - if (envPromise) { - return envPromise; - } - envPromise = getEnvMemoized(); - return envPromise; - } - async function getEnvMemoized() { - let env5 = GCPEnv.NONE; - if (isAppEngine()) { - env5 = GCPEnv.APP_ENGINE; - } else if (isCloudFunction()) { - env5 = GCPEnv.CLOUD_FUNCTIONS; - } else if (await isComputeEngine()) { - if (await isKubernetesEngine()) { - env5 = GCPEnv.KUBERNETES_ENGINE; - } else if (isCloudRun()) { - env5 = GCPEnv.CLOUD_RUN; - } else { - env5 = GCPEnv.COMPUTE_ENGINE; - } - } else { - env5 = GCPEnv.NONE; - } - return env5; - } - function isAppEngine() { - return !!(process.env.GAE_SERVICE || process.env.GAE_MODULE_NAME); - } - function isCloudFunction() { - return !!(process.env.FUNCTION_NAME || process.env.FUNCTION_TARGET); - } - function isCloudRun() { - return !!process.env.K_CONFIGURATION; - } - async function isKubernetesEngine() { - try { - await gcpMetadata.instance("attributes/cluster-name"); - return true; - } catch (e) { - return false; - } - } - async function isComputeEngine() { - return gcpMetadata.isAvailable(); - } -}); - -// ../node_modules/jws/lib/data-stream.js -var require_data_stream = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer().Buffer; - var Stream4 = __require("stream"); - var util3 = __require("util"); - function DataStream(data) { - this.buffer = null; - this.writable = true; - this.readable = true; - if (!data) { - this.buffer = Buffer7.alloc(0); - return this; - } - if (typeof data.pipe === "function") { - this.buffer = Buffer7.alloc(0); - data.pipe(this); - return this; - } - if (data.length || typeof data === "object") { - this.buffer = data; - this.writable = false; - process.nextTick(function() { - this.emit("end", data); - this.readable = false; - this.emit("close"); - }.bind(this)); - return this; - } - throw new TypeError("Unexpected data type (" + typeof data + ")"); - } - util3.inherits(DataStream, Stream4); - DataStream.prototype.write = function write(data) { - this.buffer = Buffer7.concat([this.buffer, Buffer7.from(data)]); - this.emit("data", data); - }; - DataStream.prototype.end = function end(data) { - if (data) - this.write(data); - this.emit("end", data); - this.emit("close"); - this.writable = false; - this.readable = false; - }; - module.exports = DataStream; -}); - -// ../node_modules/buffer-equal-constant-time/index.js -var require_buffer_equal_constant_time = __commonJS((exports, module) => { - var Buffer7 = __require("buffer").Buffer; - var SlowBuffer = __require("buffer").SlowBuffer; - module.exports = bufferEq; - function bufferEq(a2, b) { - if (!Buffer7.isBuffer(a2) || !Buffer7.isBuffer(b)) { - return false; - } - if (a2.length !== b.length) { - return false; - } - var c5 = 0; - for (var i2 = 0;i2 < a2.length; i2++) { - c5 |= a2[i2] ^ b[i2]; - } - return c5 === 0; - } - bufferEq.install = function() { - Buffer7.prototype.equal = SlowBuffer.prototype.equal = function equal(that) { - return bufferEq(this, that); - }; - }; - var origBufEqual = Buffer7.prototype.equal; - var origSlowBufEqual = SlowBuffer.prototype.equal; - bufferEq.restore = function() { - Buffer7.prototype.equal = origBufEqual; - SlowBuffer.prototype.equal = origSlowBufEqual; - }; -}); - -// ../node_modules/jwa/index.js -var require_jwa = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer().Buffer; - var crypto3 = __require("crypto"); - var formatEcdsa = require_ecdsa_sig_formatter(); - var util3 = __require("util"); - var MSG_INVALID_ALGORITHM = `"%s" is not a valid algorithm. - Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`; - var MSG_INVALID_SECRET = "secret must be a string or buffer"; - var MSG_INVALID_VERIFIER_KEY = "key must be a string or a buffer"; - var MSG_INVALID_SIGNER_KEY = "key must be a string, a buffer or an object"; - var supportsKeyObjects = typeof crypto3.createPublicKey === "function"; - if (supportsKeyObjects) { - MSG_INVALID_VERIFIER_KEY += " or a KeyObject"; - MSG_INVALID_SECRET += "or a KeyObject"; - } - function checkIsPublicKey(key) { - if (Buffer7.isBuffer(key)) { - return; - } - if (typeof key === "string") { - return; - } - if (!supportsKeyObjects) { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - if (typeof key !== "object") { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - if (typeof key.type !== "string") { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - if (typeof key.asymmetricKeyType !== "string") { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - if (typeof key.export !== "function") { - throw typeError(MSG_INVALID_VERIFIER_KEY); - } - } - function checkIsPrivateKey(key) { - if (Buffer7.isBuffer(key)) { - return; - } - if (typeof key === "string") { - return; - } - if (typeof key === "object") { - return; - } - throw typeError(MSG_INVALID_SIGNER_KEY); - } - function checkIsSecretKey(key) { - if (Buffer7.isBuffer(key)) { - return; - } - if (typeof key === "string") { - return key; - } - if (!supportsKeyObjects) { - throw typeError(MSG_INVALID_SECRET); - } - if (typeof key !== "object") { - throw typeError(MSG_INVALID_SECRET); - } - if (key.type !== "secret") { - throw typeError(MSG_INVALID_SECRET); - } - if (typeof key.export !== "function") { - throw typeError(MSG_INVALID_SECRET); - } - } - function fromBase643(base644) { - return base644.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); - } - function toBase643(base64url3) { - base64url3 = base64url3.toString(); - var padding = 4 - base64url3.length % 4; - if (padding !== 4) { - for (var i2 = 0;i2 < padding; ++i2) { - base64url3 += "="; - } - } - return base64url3.replace(/\-/g, "+").replace(/_/g, "/"); - } - function typeError(template2) { - var args = [].slice.call(arguments, 1); - var errMsg = util3.format.bind(util3, template2).apply(null, args); - return new TypeError(errMsg); - } - function bufferOrString(obj) { - return Buffer7.isBuffer(obj) || typeof obj === "string"; - } - function normalizeInput(thing) { - if (!bufferOrString(thing)) - thing = JSON.stringify(thing); - return thing; - } - function createHmacSigner(bits) { - return function sign(thing, secret) { - checkIsSecretKey(secret); - thing = normalizeInput(thing); - var hmac = crypto3.createHmac("sha" + bits, secret); - var sig = (hmac.update(thing), hmac.digest("base64")); - return fromBase643(sig); - }; - } - var bufferEqual; - var timingSafeEqual = "timingSafeEqual" in crypto3 ? function timingSafeEqual(a2, b) { - if (a2.byteLength !== b.byteLength) { - return false; - } - return crypto3.timingSafeEqual(a2, b); - } : function timingSafeEqual(a2, b) { - if (!bufferEqual) { - bufferEqual = require_buffer_equal_constant_time(); - } - return bufferEqual(a2, b); - }; - function createHmacVerifier(bits) { - return function verify(thing, signature, secret) { - var computedSig = createHmacSigner(bits)(thing, secret); - return timingSafeEqual(Buffer7.from(signature), Buffer7.from(computedSig)); - }; - } - function createKeySigner(bits) { - return function sign(thing, privateKey) { - checkIsPrivateKey(privateKey); - thing = normalizeInput(thing); - var signer = crypto3.createSign("RSA-SHA" + bits); - var sig = (signer.update(thing), signer.sign(privateKey, "base64")); - return fromBase643(sig); - }; - } - function createKeyVerifier(bits) { - return function verify(thing, signature, publicKey) { - checkIsPublicKey(publicKey); - thing = normalizeInput(thing); - signature = toBase643(signature); - var verifier = crypto3.createVerify("RSA-SHA" + bits); - verifier.update(thing); - return verifier.verify(publicKey, signature, "base64"); - }; - } - function createPSSKeySigner(bits) { - return function sign(thing, privateKey) { - checkIsPrivateKey(privateKey); - thing = normalizeInput(thing); - var signer = crypto3.createSign("RSA-SHA" + bits); - var sig = (signer.update(thing), signer.sign({ - key: privateKey, - padding: crypto3.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto3.constants.RSA_PSS_SALTLEN_DIGEST - }, "base64")); - return fromBase643(sig); - }; - } - function createPSSKeyVerifier(bits) { - return function verify(thing, signature, publicKey) { - checkIsPublicKey(publicKey); - thing = normalizeInput(thing); - signature = toBase643(signature); - var verifier = crypto3.createVerify("RSA-SHA" + bits); - verifier.update(thing); - return verifier.verify({ - key: publicKey, - padding: crypto3.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto3.constants.RSA_PSS_SALTLEN_DIGEST - }, signature, "base64"); - }; - } - function createECDSASigner(bits) { - var inner = createKeySigner(bits); - return function sign() { - var signature = inner.apply(null, arguments); - signature = formatEcdsa.derToJose(signature, "ES" + bits); - return signature; - }; - } - function createECDSAVerifer(bits) { - var inner = createKeyVerifier(bits); - return function verify(thing, signature, publicKey) { - signature = formatEcdsa.joseToDer(signature, "ES" + bits).toString("base64"); - var result2 = inner(thing, signature, publicKey); - return result2; - }; - } - function createNoneSigner() { - return function sign() { - return ""; - }; - } - function createNoneVerifier() { - return function verify(thing, signature) { - return signature === ""; - }; - } - module.exports = function jwa(algorithm) { - var signerFactories = { - hs: createHmacSigner, - rs: createKeySigner, - ps: createPSSKeySigner, - es: createECDSASigner, - none: createNoneSigner - }; - var verifierFactories = { - hs: createHmacVerifier, - rs: createKeyVerifier, - ps: createPSSKeyVerifier, - es: createECDSAVerifer, - none: createNoneVerifier - }; - var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/); - if (!match) - throw typeError(MSG_INVALID_ALGORITHM, algorithm); - var algo = (match[1] || match[3]).toLowerCase(); - var bits = match[2]; - return { - sign: signerFactories[algo](bits), - verify: verifierFactories[algo](bits) - }; - }; -}); - -// ../node_modules/jws/lib/tostring.js -var require_tostring = __commonJS((exports, module) => { - var Buffer7 = __require("buffer").Buffer; - module.exports = function toString(obj) { - if (typeof obj === "string") - return obj; - if (typeof obj === "number" || Buffer7.isBuffer(obj)) - return obj.toString(); - return JSON.stringify(obj); - }; -}); - -// ../node_modules/jws/lib/sign-stream.js -var require_sign_stream = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer().Buffer; - var DataStream = require_data_stream(); - var jwa = require_jwa(); - var Stream4 = __require("stream"); - var toString6 = require_tostring(); - var util3 = __require("util"); - function base64url3(string4, encoding) { - return Buffer7.from(string4, encoding).toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); - } - function jwsSecuredInput(header, payload, encoding) { - encoding = encoding || "utf8"; - var encodedHeader = base64url3(toString6(header), "binary"); - var encodedPayload = base64url3(toString6(payload), encoding); - return util3.format("%s.%s", encodedHeader, encodedPayload); - } - function jwsSign(opts) { - var header = opts.header; - var payload = opts.payload; - var secretOrKey = opts.secret || opts.privateKey; - var encoding = opts.encoding; - var algo = jwa(header.alg); - var securedInput = jwsSecuredInput(header, payload, encoding); - var signature = algo.sign(securedInput, secretOrKey); - return util3.format("%s.%s", securedInput, signature); - } - function SignStream(opts) { - var secret = opts.secret; - secret = secret == null ? opts.privateKey : secret; - secret = secret == null ? opts.key : secret; - if (/^hs/i.test(opts.header.alg) === true && secret == null) { - throw new TypeError("secret must be a string or buffer or a KeyObject"); - } - var secretStream = new DataStream(secret); - this.readable = true; - this.header = opts.header; - this.encoding = opts.encoding; - this.secret = this.privateKey = this.key = secretStream; - this.payload = new DataStream(opts.payload); - this.secret.once("close", function() { - if (!this.payload.writable && this.readable) - this.sign(); - }.bind(this)); - this.payload.once("close", function() { - if (!this.secret.writable && this.readable) - this.sign(); - }.bind(this)); - } - util3.inherits(SignStream, Stream4); - SignStream.prototype.sign = function sign() { - try { - var signature = jwsSign({ - header: this.header, - payload: this.payload.buffer, - secret: this.secret.buffer, - encoding: this.encoding - }); - this.emit("done", signature); - this.emit("data", signature); - this.emit("end"); - this.readable = false; - return signature; - } catch (e) { - this.readable = false; - this.emit("error", e); - this.emit("close"); - } - }; - SignStream.sign = jwsSign; - module.exports = SignStream; -}); - -// ../node_modules/jws/lib/verify-stream.js -var require_verify_stream = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer().Buffer; - var DataStream = require_data_stream(); - var jwa = require_jwa(); - var Stream4 = __require("stream"); - var toString6 = require_tostring(); - var util3 = __require("util"); - var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; - function isObject5(thing) { - return Object.prototype.toString.call(thing) === "[object Object]"; - } - function safeJsonParse(thing) { - if (isObject5(thing)) - return thing; - try { - return JSON.parse(thing); - } catch (e) { - return; - } - } - function headerFromJWS(jwsSig) { - var encodedHeader = jwsSig.split(".", 1)[0]; - return safeJsonParse(Buffer7.from(encodedHeader, "base64").toString("binary")); - } - function securedInputFromJWS(jwsSig) { - return jwsSig.split(".", 2).join("."); - } - function signatureFromJWS(jwsSig) { - return jwsSig.split(".")[2]; - } - function payloadFromJWS(jwsSig, encoding) { - encoding = encoding || "utf8"; - var payload = jwsSig.split(".")[1]; - return Buffer7.from(payload, "base64").toString(encoding); - } - function isValidJws(string4) { - return JWS_REGEX.test(string4) && !!headerFromJWS(string4); - } - function jwsVerify(jwsSig, algorithm, secretOrKey) { - if (!algorithm) { - var err = new Error("Missing algorithm parameter for jws.verify"); - err.code = "MISSING_ALGORITHM"; - throw err; - } - jwsSig = toString6(jwsSig); - var signature = signatureFromJWS(jwsSig); - var securedInput = securedInputFromJWS(jwsSig); - var algo = jwa(algorithm); - return algo.verify(securedInput, signature, secretOrKey); - } - function jwsDecode(jwsSig, opts) { - opts = opts || {}; - jwsSig = toString6(jwsSig); - if (!isValidJws(jwsSig)) - return null; - var header = headerFromJWS(jwsSig); - if (!header) - return null; - var payload = payloadFromJWS(jwsSig); - if (header.typ === "JWT" || opts.json) - payload = JSON.parse(payload, opts.encoding); - return { - header, - payload, - signature: signatureFromJWS(jwsSig) - }; - } - function VerifyStream(opts) { - opts = opts || {}; - var secretOrKey = opts.secret; - secretOrKey = secretOrKey == null ? opts.publicKey : secretOrKey; - secretOrKey = secretOrKey == null ? opts.key : secretOrKey; - if (/^hs/i.test(opts.algorithm) === true && secretOrKey == null) { - throw new TypeError("secret must be a string or buffer or a KeyObject"); - } - var secretStream = new DataStream(secretOrKey); - this.readable = true; - this.algorithm = opts.algorithm; - this.encoding = opts.encoding; - this.secret = this.publicKey = this.key = secretStream; - this.signature = new DataStream(opts.signature); - this.secret.once("close", function() { - if (!this.signature.writable && this.readable) - this.verify(); - }.bind(this)); - this.signature.once("close", function() { - if (!this.secret.writable && this.readable) - this.verify(); - }.bind(this)); - } - util3.inherits(VerifyStream, Stream4); - VerifyStream.prototype.verify = function verify() { - try { - var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); - var obj = jwsDecode(this.signature.buffer, this.encoding); - this.emit("done", valid, obj); - this.emit("data", valid); - this.emit("end"); - this.readable = false; - return valid; - } catch (e) { - this.readable = false; - this.emit("error", e); - this.emit("close"); - } - }; - VerifyStream.decode = jwsDecode; - VerifyStream.isValid = isValidJws; - VerifyStream.verify = jwsVerify; - module.exports = VerifyStream; -}); - -// ../node_modules/jws/index.js -var require_jws = __commonJS((exports) => { - var SignStream = require_sign_stream(); - var VerifyStream = require_verify_stream(); - var ALGORITHMS = [ - "HS256", - "HS384", - "HS512", - "RS256", - "RS384", - "RS512", - "PS256", - "PS384", - "PS512", - "ES256", - "ES384", - "ES512" - ]; - exports.ALGORITHMS = ALGORITHMS; - exports.sign = SignStream.sign; - exports.verify = VerifyStream.verify; - exports.decode = VerifyStream.decode; - exports.isValid = VerifyStream.isValid; - exports.createSign = function createSign(opts) { - return new SignStream(opts); - }; - exports.createVerify = function createVerify(opts) { - return new VerifyStream(opts); - }; -}); - -// ../node_modules/gtoken/build/src/index.js -var require_src6 = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var __classPrivateFieldSet3 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; - }; - var _GoogleToken_instances; - var _GoogleToken_inFlightRequest; - var _GoogleToken_getTokenAsync; - var _GoogleToken_getTokenAsyncInner; - var _GoogleToken_ensureEmail; - var _GoogleToken_revokeTokenAsync; - var _GoogleToken_configure; - var _GoogleToken_requestToken; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GoogleToken = undefined; - var fs2 = __require("fs"); - var gaxios_1 = require_src3(); - var jws = require_jws(); - var path11 = __require("path"); - var util_1 = __require("util"); - var readFile8 = fs2.readFile ? (0, util_1.promisify)(fs2.readFile) : async () => { - throw new ErrorWithCode("use key rather than keyFile.", "MISSING_CREDENTIALS"); - }; - var GOOGLE_TOKEN_URL = "https://www.googleapis.com/oauth2/v4/token"; - var GOOGLE_REVOKE_TOKEN_URL = "https://accounts.google.com/o/oauth2/revoke?token="; - - class ErrorWithCode extends Error { - constructor(message, code) { - super(message); - this.code = code; - } - } - - class GoogleToken { - get accessToken() { - return this.rawToken ? this.rawToken.access_token : undefined; - } - get idToken() { - return this.rawToken ? this.rawToken.id_token : undefined; - } - get tokenType() { - return this.rawToken ? this.rawToken.token_type : undefined; - } - get refreshToken() { - return this.rawToken ? this.rawToken.refresh_token : undefined; - } - constructor(options) { - _GoogleToken_instances.add(this); - this.transporter = { - request: (opts) => (0, gaxios_1.request)(opts) - }; - _GoogleToken_inFlightRequest.set(this, undefined); - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_configure).call(this, options); - } - hasExpired() { - const now2 = new Date().getTime(); - if (this.rawToken && this.expiresAt) { - return now2 >= this.expiresAt; - } else { - return true; - } - } - isTokenExpiring() { - var _a3; - const now2 = new Date().getTime(); - const eagerRefreshThresholdMillis = (_a3 = this.eagerRefreshThresholdMillis) !== null && _a3 !== undefined ? _a3 : 0; - if (this.rawToken && this.expiresAt) { - return this.expiresAt <= now2 + eagerRefreshThresholdMillis; - } else { - return true; - } - } - getToken(callback, opts = {}) { - if (typeof callback === "object") { - opts = callback; - callback = undefined; - } - opts = Object.assign({ - forceRefresh: false - }, opts); - if (callback) { - const cb = callback; - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsync).call(this, opts).then((t) => cb(null, t), callback); - return; - } - return __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsync).call(this, opts); - } - async getCredentials(keyFile) { - const ext = path11.extname(keyFile); - switch (ext) { - case ".json": { - const key = await readFile8(keyFile, "utf8"); - const body = JSON.parse(key); - const privateKey = body.private_key; - const clientEmail = body.client_email; - if (!privateKey || !clientEmail) { - throw new ErrorWithCode("private_key and client_email are required.", "MISSING_CREDENTIALS"); - } - return { privateKey, clientEmail }; - } - case ".der": - case ".crt": - case ".pem": { - const privateKey = await readFile8(keyFile, "utf8"); - return { privateKey }; - } - case ".p12": - case ".pfx": { - throw new ErrorWithCode("*.p12 certificates are not supported after v6.1.2. " + "Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.", "UNKNOWN_CERTIFICATE_TYPE"); - } - default: - throw new ErrorWithCode("Unknown certificate type. Type is determined based on file extension. " + "Current supported extensions are *.json, and *.pem.", "UNKNOWN_CERTIFICATE_TYPE"); - } - } - revokeToken(callback) { - if (callback) { - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_revokeTokenAsync).call(this).then(() => callback(), callback); - return; - } - return __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_revokeTokenAsync).call(this); - } - } - exports.GoogleToken = GoogleToken; - _GoogleToken_inFlightRequest = new WeakMap, _GoogleToken_instances = new WeakSet, _GoogleToken_getTokenAsync = async function _GoogleToken_getTokenAsync(opts) { - if (__classPrivateFieldGet3(this, _GoogleToken_inFlightRequest, "f") && !opts.forceRefresh) { - return __classPrivateFieldGet3(this, _GoogleToken_inFlightRequest, "f"); - } - try { - return await __classPrivateFieldSet3(this, _GoogleToken_inFlightRequest, __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsyncInner).call(this, opts), "f"); - } finally { - __classPrivateFieldSet3(this, _GoogleToken_inFlightRequest, undefined, "f"); - } - }, _GoogleToken_getTokenAsyncInner = async function _GoogleToken_getTokenAsyncInner(opts) { - if (this.isTokenExpiring() === false && opts.forceRefresh === false) { - return Promise.resolve(this.rawToken); - } - if (!this.key && !this.keyFile) { - throw new Error("No key or keyFile set."); - } - if (!this.key && this.keyFile) { - const creds = await this.getCredentials(this.keyFile); - this.key = creds.privateKey; - this.iss = creds.clientEmail || this.iss; - if (!creds.clientEmail) { - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_ensureEmail).call(this); - } - } - return __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_requestToken).call(this); - }, _GoogleToken_ensureEmail = function _GoogleToken_ensureEmail() { - if (!this.iss) { - throw new ErrorWithCode("email is required.", "MISSING_CREDENTIALS"); - } - }, _GoogleToken_revokeTokenAsync = async function _GoogleToken_revokeTokenAsync() { - if (!this.accessToken) { - throw new Error("No token to revoke."); - } - const url3 = GOOGLE_REVOKE_TOKEN_URL + this.accessToken; - await this.transporter.request({ - url: url3, - retry: true - }); - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_configure).call(this, { - email: this.iss, - sub: this.sub, - key: this.key, - keyFile: this.keyFile, - scope: this.scope, - additionalClaims: this.additionalClaims - }); - }, _GoogleToken_configure = function _GoogleToken_configure(options = {}) { - this.keyFile = options.keyFile; - this.key = options.key; - this.rawToken = undefined; - this.iss = options.email || options.iss; - this.sub = options.sub; - this.additionalClaims = options.additionalClaims; - if (typeof options.scope === "object") { - this.scope = options.scope.join(" "); - } else { - this.scope = options.scope; - } - this.eagerRefreshThresholdMillis = options.eagerRefreshThresholdMillis; - if (options.transporter) { - this.transporter = options.transporter; - } - }, _GoogleToken_requestToken = async function _GoogleToken_requestToken() { - var _a3, _b; - const iat = Math.floor(new Date().getTime() / 1000); - const additionalClaims = this.additionalClaims || {}; - const payload = Object.assign({ - iss: this.iss, - scope: this.scope, - aud: GOOGLE_TOKEN_URL, - exp: iat + 3600, - iat, - sub: this.sub - }, additionalClaims); - const signedJWT = jws.sign({ - header: { alg: "RS256" }, - payload, - secret: this.key - }); - try { - const r = await this.transporter.request({ - method: "POST", - url: GOOGLE_TOKEN_URL, - data: { - grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer", - assertion: signedJWT - }, - headers: { "Content-Type": "application/x-www-form-urlencoded" }, - responseType: "json", - retryConfig: { - httpMethodsToRetry: ["POST"] - } - }); - this.rawToken = r.data; - this.expiresAt = r.data.expires_in === null || r.data.expires_in === undefined ? undefined : (iat + r.data.expires_in) * 1000; - return this.rawToken; - } catch (e) { - this.rawToken = undefined; - this.tokenExpires = undefined; - const body = e.response && ((_a3 = e.response) === null || _a3 === undefined ? undefined : _a3.data) ? (_b = e.response) === null || _b === undefined ? undefined : _b.data : {}; - if (body.error) { - const desc = body.error_description ? `: ${body.error_description}` : ""; - e.message = `${body.error}${desc}`; - } - throw e; - } - }; -}); - -// ../node_modules/google-auth-library/build/src/auth/jwtaccess.js -var require_jwtaccess = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JWTAccess = undefined; - var jws = require_jws(); - var util_1 = require_util8(); - var DEFAULT_HEADER = { - alg: "RS256", - typ: "JWT" - }; - - class JWTAccess { - constructor(email3, key, keyId, eagerRefreshThresholdMillis) { - this.cache = new util_1.LRUCache({ - capacity: 500, - maxAge: 60 * 60 * 1000 - }); - this.email = email3; - this.key = key; - this.keyId = keyId; - this.eagerRefreshThresholdMillis = eagerRefreshThresholdMillis !== null && eagerRefreshThresholdMillis !== undefined ? eagerRefreshThresholdMillis : 5 * 60 * 1000; - } - getCachedKey(url3, scopes) { - let cacheKey = url3; - if (scopes && Array.isArray(scopes) && scopes.length) { - cacheKey = url3 ? `${url3}_${scopes.join("_")}` : `${scopes.join("_")}`; - } else if (typeof scopes === "string") { - cacheKey = url3 ? `${url3}_${scopes}` : scopes; - } - if (!cacheKey) { - throw Error("Scopes or url must be provided"); - } - return cacheKey; - } - getRequestHeaders(url3, additionalClaims, scopes) { - const key = this.getCachedKey(url3, scopes); - const cachedToken = this.cache.get(key); - const now2 = Date.now(); - if (cachedToken && cachedToken.expiration - now2 > this.eagerRefreshThresholdMillis) { - return cachedToken.headers; - } - const iat = Math.floor(Date.now() / 1000); - const exp = JWTAccess.getExpirationTime(iat); - let defaultClaims; - if (Array.isArray(scopes)) { - scopes = scopes.join(" "); - } - if (scopes) { - defaultClaims = { - iss: this.email, - sub: this.email, - scope: scopes, - exp, - iat - }; - } else { - defaultClaims = { - iss: this.email, - sub: this.email, - aud: url3, - exp, - iat - }; - } - if (additionalClaims) { - for (const claim in defaultClaims) { - if (additionalClaims[claim]) { - throw new Error(`The '${claim}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`); - } - } - } - const header = this.keyId ? { ...DEFAULT_HEADER, kid: this.keyId } : DEFAULT_HEADER; - const payload = Object.assign(defaultClaims, additionalClaims); - const signedJWT = jws.sign({ header, payload, secret: this.key }); - const headers = { Authorization: `Bearer ${signedJWT}` }; - this.cache.set(key, { - expiration: exp * 1000, - headers - }); - return headers; - } - static getExpirationTime(iat) { - const exp = iat + 3600; - return exp; - } - fromJSON(json2) { - if (!json2) { - throw new Error("Must pass in a JSON object containing the service account auth settings."); - } - if (!json2.client_email) { - throw new Error("The incoming JSON object does not contain a client_email field"); - } - if (!json2.private_key) { - throw new Error("The incoming JSON object does not contain a private_key field"); - } - this.email = json2.client_email; - this.key = json2.private_key; - this.keyId = json2.private_key_id; - this.projectId = json2.project_id; - } - fromStream(inputStream, callback) { - if (callback) { - this.fromStreamAsync(inputStream).then(() => callback(), callback); - } else { - return this.fromStreamAsync(inputStream); - } - } - fromStreamAsync(inputStream) { - return new Promise((resolve8, reject2) => { - if (!inputStream) { - reject2(new Error("Must pass in a stream containing the service account auth settings.")); - } - let s = ""; - inputStream.setEncoding("utf8").on("data", (chunk2) => s += chunk2).on("error", reject2).on("end", () => { - try { - const data = JSON.parse(s); - this.fromJSON(data); - resolve8(); - } catch (err) { - reject2(err); - } - }); - }); - } - } - exports.JWTAccess = JWTAccess; -}); - -// ../node_modules/google-auth-library/build/src/auth/jwtclient.js -var require_jwtclient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JWT = undefined; - var gtoken_1 = require_src6(); - var jwtaccess_1 = require_jwtaccess(); - var oauth2client_1 = require_oauth2client(); - var authclient_1 = require_authclient(); - - class JWT extends oauth2client_1.OAuth2Client { - constructor(optionsOrEmail, keyFile, key, scopes, subject, keyId) { - const opts = optionsOrEmail && typeof optionsOrEmail === "object" ? optionsOrEmail : { email: optionsOrEmail, keyFile, key, keyId, scopes, subject }; - super(opts); - this.email = opts.email; - this.keyFile = opts.keyFile; - this.key = opts.key; - this.keyId = opts.keyId; - this.scopes = opts.scopes; - this.subject = opts.subject; - this.additionalClaims = opts.additionalClaims; - this.credentials = { refresh_token: "jwt-placeholder", expiry_date: 1 }; - } - createScoped(scopes) { - const jwt2 = new JWT(this); - jwt2.scopes = scopes; - return jwt2; - } - async getRequestMetadataAsync(url3) { - url3 = this.defaultServicePath ? `https://${this.defaultServicePath}/` : url3; - const useSelfSignedJWT = !this.hasUserScopes() && url3 || this.useJWTAccessWithScope && this.hasAnyScopes() || this.universeDomain !== authclient_1.DEFAULT_UNIVERSE; - if (this.subject && this.universeDomain !== authclient_1.DEFAULT_UNIVERSE) { - throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${authclient_1.DEFAULT_UNIVERSE}`); - } - if (!this.apiKey && useSelfSignedJWT) { - if (this.additionalClaims && this.additionalClaims.target_audience) { - const { tokens } = await this.refreshToken(); - return { - headers: this.addSharedMetadataHeaders({ - Authorization: `Bearer ${tokens.id_token}` - }) - }; - } else { - if (!this.access) { - this.access = new jwtaccess_1.JWTAccess(this.email, this.key, this.keyId, this.eagerRefreshThresholdMillis); - } - let scopes; - if (this.hasUserScopes()) { - scopes = this.scopes; - } else if (!url3) { - scopes = this.defaultScopes; - } - const useScopes = this.useJWTAccessWithScope || this.universeDomain !== authclient_1.DEFAULT_UNIVERSE; - const headers = await this.access.getRequestHeaders(url3 !== null && url3 !== undefined ? url3 : undefined, this.additionalClaims, useScopes ? scopes : undefined); - return { headers: this.addSharedMetadataHeaders(headers) }; - } - } else if (this.hasAnyScopes() || this.apiKey) { - return super.getRequestMetadataAsync(url3); - } else { - return { headers: {} }; - } - } - async fetchIdToken(targetAudience) { - const gtoken = new gtoken_1.GoogleToken({ - iss: this.email, - sub: this.subject, - scope: this.scopes || this.defaultScopes, - keyFile: this.keyFile, - key: this.key, - additionalClaims: { target_audience: targetAudience }, - transporter: this.transporter - }); - await gtoken.getToken({ - forceRefresh: true - }); - if (!gtoken.idToken) { - throw new Error("Unknown error: Failed to fetch ID token"); - } - return gtoken.idToken; - } - hasUserScopes() { - if (!this.scopes) { - return false; - } - return this.scopes.length > 0; - } - hasAnyScopes() { - if (this.scopes && this.scopes.length > 0) - return true; - if (this.defaultScopes && this.defaultScopes.length > 0) - return true; - return false; - } - authorize(callback) { - if (callback) { - this.authorizeAsync().then((r) => callback(null, r), callback); - } else { - return this.authorizeAsync(); - } - } - async authorizeAsync() { - const result2 = await this.refreshToken(); - if (!result2) { - throw new Error("No result returned"); - } - this.credentials = result2.tokens; - this.credentials.refresh_token = "jwt-placeholder"; - this.key = this.gtoken.key; - this.email = this.gtoken.iss; - return result2.tokens; - } - async refreshTokenNoCache(refreshToken) { - const gtoken = this.createGToken(); - const token = await gtoken.getToken({ - forceRefresh: this.isTokenExpiring() - }); - const tokens = { - access_token: token.access_token, - token_type: "Bearer", - expiry_date: gtoken.expiresAt, - id_token: gtoken.idToken - }; - this.emit("tokens", tokens); - return { res: null, tokens }; - } - createGToken() { - if (!this.gtoken) { - this.gtoken = new gtoken_1.GoogleToken({ - iss: this.email, - sub: this.subject, - scope: this.scopes || this.defaultScopes, - keyFile: this.keyFile, - key: this.key, - additionalClaims: this.additionalClaims, - transporter: this.transporter - }); - } - return this.gtoken; - } - fromJSON(json2) { - if (!json2) { - throw new Error("Must pass in a JSON object containing the service account auth settings."); - } - if (!json2.client_email) { - throw new Error("The incoming JSON object does not contain a client_email field"); - } - if (!json2.private_key) { - throw new Error("The incoming JSON object does not contain a private_key field"); - } - this.email = json2.client_email; - this.key = json2.private_key; - this.keyId = json2.private_key_id; - this.projectId = json2.project_id; - this.quotaProjectId = json2.quota_project_id; - this.universeDomain = json2.universe_domain || this.universeDomain; - } - fromStream(inputStream, callback) { - if (callback) { - this.fromStreamAsync(inputStream).then(() => callback(), callback); - } else { - return this.fromStreamAsync(inputStream); - } - } - fromStreamAsync(inputStream) { - return new Promise((resolve8, reject2) => { - if (!inputStream) { - throw new Error("Must pass in a stream containing the service account auth settings."); - } - let s = ""; - inputStream.setEncoding("utf8").on("error", reject2).on("data", (chunk2) => s += chunk2).on("end", () => { - try { - const data = JSON.parse(s); - this.fromJSON(data); - resolve8(); - } catch (e) { - reject2(e); - } - }); - }); - } - fromAPIKey(apiKey) { - if (typeof apiKey !== "string") { - throw new Error("Must provide an API Key string."); - } - this.apiKey = apiKey; - } - async getCredentials() { - if (this.key) { - return { private_key: this.key, client_email: this.email }; - } else if (this.keyFile) { - const gtoken = this.createGToken(); - const creds = await gtoken.getCredentials(this.keyFile); - return { private_key: creds.privateKey, client_email: creds.clientEmail }; - } - throw new Error("A key or a keyFile must be provided to getCredentials."); - } - } - exports.JWT = JWT; -}); - -// ../node_modules/google-auth-library/build/src/auth/refreshclient.js -var require_refreshclient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.UserRefreshClient = exports.USER_REFRESH_ACCOUNT_TYPE = undefined; - var oauth2client_1 = require_oauth2client(); - var querystring_1 = __require("querystring"); - exports.USER_REFRESH_ACCOUNT_TYPE = "authorized_user"; - - class UserRefreshClient extends oauth2client_1.OAuth2Client { - constructor(optionsOrClientId, clientSecret, refreshToken, eagerRefreshThresholdMillis, forceRefreshOnFailure) { - const opts = optionsOrClientId && typeof optionsOrClientId === "object" ? optionsOrClientId : { - clientId: optionsOrClientId, - clientSecret, - refreshToken, - eagerRefreshThresholdMillis, - forceRefreshOnFailure - }; - super(opts); - this._refreshToken = opts.refreshToken; - this.credentials.refresh_token = opts.refreshToken; - } - async refreshTokenNoCache(refreshToken) { - return super.refreshTokenNoCache(this._refreshToken); - } - async fetchIdToken(targetAudience) { - const res = await this.transporter.request({ - ...UserRefreshClient.RETRY_CONFIG, - url: this.endpoints.oauth2TokenUrl, - headers: { - "Content-Type": "application/x-www-form-urlencoded" - }, - method: "POST", - data: (0, querystring_1.stringify)({ - client_id: this._clientId, - client_secret: this._clientSecret, - grant_type: "refresh_token", - refresh_token: this._refreshToken, - target_audience: targetAudience - }) - }); - return res.data.id_token; - } - fromJSON(json2) { - if (!json2) { - throw new Error("Must pass in a JSON object containing the user refresh token"); - } - if (json2.type !== "authorized_user") { - throw new Error('The incoming JSON object does not have the "authorized_user" type'); - } - if (!json2.client_id) { - throw new Error("The incoming JSON object does not contain a client_id field"); - } - if (!json2.client_secret) { - throw new Error("The incoming JSON object does not contain a client_secret field"); - } - if (!json2.refresh_token) { - throw new Error("The incoming JSON object does not contain a refresh_token field"); - } - this._clientId = json2.client_id; - this._clientSecret = json2.client_secret; - this._refreshToken = json2.refresh_token; - this.credentials.refresh_token = json2.refresh_token; - this.quotaProjectId = json2.quota_project_id; - this.universeDomain = json2.universe_domain || this.universeDomain; - } - fromStream(inputStream, callback) { - if (callback) { - this.fromStreamAsync(inputStream).then(() => callback(), callback); - } else { - return this.fromStreamAsync(inputStream); - } - } - async fromStreamAsync(inputStream) { - return new Promise((resolve8, reject2) => { - if (!inputStream) { - return reject2(new Error("Must pass in a stream containing the user refresh token.")); - } - let s = ""; - inputStream.setEncoding("utf8").on("error", reject2).on("data", (chunk2) => s += chunk2).on("end", () => { - try { - const data = JSON.parse(s); - this.fromJSON(data); - return resolve8(); - } catch (err) { - return reject2(err); - } - }); - }); - } - static fromJSON(json2) { - const client3 = new UserRefreshClient; - client3.fromJSON(json2); - return client3; - } - } - exports.UserRefreshClient = UserRefreshClient; -}); - -// ../node_modules/google-auth-library/build/src/auth/impersonated.js -var require_impersonated = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Impersonated = exports.IMPERSONATED_ACCOUNT_TYPE = undefined; - var oauth2client_1 = require_oauth2client(); - var gaxios_1 = require_src3(); - var util_1 = require_util8(); - exports.IMPERSONATED_ACCOUNT_TYPE = "impersonated_service_account"; - - class Impersonated extends oauth2client_1.OAuth2Client { - constructor(options = {}) { - var _a3, _b, _c, _d, _e, _f; - super(options); - this.credentials = { - expiry_date: 1, - refresh_token: "impersonated-placeholder" - }; - this.sourceClient = (_a3 = options.sourceClient) !== null && _a3 !== undefined ? _a3 : new oauth2client_1.OAuth2Client; - this.targetPrincipal = (_b = options.targetPrincipal) !== null && _b !== undefined ? _b : ""; - this.delegates = (_c = options.delegates) !== null && _c !== undefined ? _c : []; - this.targetScopes = (_d = options.targetScopes) !== null && _d !== undefined ? _d : []; - this.lifetime = (_e = options.lifetime) !== null && _e !== undefined ? _e : 3600; - const usingExplicitUniverseDomain = !!(0, util_1.originalOrCamelOptions)(options).get("universe_domain"); - if (!usingExplicitUniverseDomain) { - this.universeDomain = this.sourceClient.universeDomain; - } else if (this.sourceClient.universeDomain !== this.universeDomain) { - throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`); - } - this.endpoint = (_f = options.endpoint) !== null && _f !== undefined ? _f : `https://iamcredentials.${this.universeDomain}`; - } - async sign(blobToSign) { - await this.sourceClient.getAccessToken(); - const name = `projects/-/serviceAccounts/${this.targetPrincipal}`; - const u2 = `${this.endpoint}/v1/${name}:signBlob`; - const body = { - delegates: this.delegates, - payload: Buffer.from(blobToSign).toString("base64") - }; - const res = await this.sourceClient.request({ - ...Impersonated.RETRY_CONFIG, - url: u2, - data: body, - method: "POST" - }); - return res.data; - } - getTargetPrincipal() { - return this.targetPrincipal; - } - async refreshToken() { - var _a3, _b, _c, _d, _e, _f; - try { - await this.sourceClient.getAccessToken(); - const name = "projects/-/serviceAccounts/" + this.targetPrincipal; - const u2 = `${this.endpoint}/v1/${name}:generateAccessToken`; - const body = { - delegates: this.delegates, - scope: this.targetScopes, - lifetime: this.lifetime + "s" - }; - const res = await this.sourceClient.request({ - ...Impersonated.RETRY_CONFIG, - url: u2, - data: body, - method: "POST" - }); - const tokenResponse = res.data; - this.credentials.access_token = tokenResponse.accessToken; - this.credentials.expiry_date = Date.parse(tokenResponse.expireTime); - return { - tokens: this.credentials, - res - }; - } catch (error44) { - if (!(error44 instanceof Error)) - throw error44; - let status = 0; - let message = ""; - if (error44 instanceof gaxios_1.GaxiosError) { - status = (_c = (_b = (_a3 = error44 === null || error44 === undefined ? undefined : error44.response) === null || _a3 === undefined ? undefined : _a3.data) === null || _b === undefined ? undefined : _b.error) === null || _c === undefined ? undefined : _c.status; - message = (_f = (_e = (_d = error44 === null || error44 === undefined ? undefined : error44.response) === null || _d === undefined ? undefined : _d.data) === null || _e === undefined ? undefined : _e.error) === null || _f === undefined ? undefined : _f.message; - } - if (status && message) { - error44.message = `${status}: unable to impersonate: ${message}`; - throw error44; - } else { - error44.message = `unable to impersonate: ${error44}`; - throw error44; - } - } - } - async fetchIdToken(targetAudience, options) { - var _a3, _b; - await this.sourceClient.getAccessToken(); - const name = `projects/-/serviceAccounts/${this.targetPrincipal}`; - const u2 = `${this.endpoint}/v1/${name}:generateIdToken`; - const body = { - delegates: this.delegates, - audience: targetAudience, - includeEmail: (_a3 = options === null || options === undefined ? undefined : options.includeEmail) !== null && _a3 !== undefined ? _a3 : true, - useEmailAzp: (_b = options === null || options === undefined ? undefined : options.includeEmail) !== null && _b !== undefined ? _b : true - }; - const res = await this.sourceClient.request({ - ...Impersonated.RETRY_CONFIG, - url: u2, - data: body, - method: "POST" - }); - return res.data.token; - } - } - exports.Impersonated = Impersonated; -}); - -// ../node_modules/google-auth-library/build/src/auth/oauth2common.js -var require_oauth2common = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OAuthClientAuthHandler = undefined; - exports.getErrorFromOAuthErrorResponse = getErrorFromOAuthErrorResponse; - var querystring = __require("querystring"); - var crypto_1 = require_crypto3(); - var METHODS_SUPPORTING_REQUEST_BODY = ["PUT", "POST", "PATCH"]; - - class OAuthClientAuthHandler { - constructor(clientAuthentication) { - this.clientAuthentication = clientAuthentication; - this.crypto = (0, crypto_1.createCrypto)(); - } - applyClientAuthenticationOptions(opts, bearerToken) { - this.injectAuthenticatedHeaders(opts, bearerToken); - if (!bearerToken) { - this.injectAuthenticatedRequestBody(opts); - } - } - injectAuthenticatedHeaders(opts, bearerToken) { - var _a3; - if (bearerToken) { - opts.headers = opts.headers || {}; - Object.assign(opts.headers, { - Authorization: `Bearer ${bearerToken}}` - }); - } else if (((_a3 = this.clientAuthentication) === null || _a3 === undefined ? undefined : _a3.confidentialClientType) === "basic") { - opts.headers = opts.headers || {}; - const clientId = this.clientAuthentication.clientId; - const clientSecret = this.clientAuthentication.clientSecret || ""; - const base64EncodedCreds = this.crypto.encodeBase64StringUtf8(`${clientId}:${clientSecret}`); - Object.assign(opts.headers, { - Authorization: `Basic ${base64EncodedCreds}` - }); - } - } - injectAuthenticatedRequestBody(opts) { - var _a3; - if (((_a3 = this.clientAuthentication) === null || _a3 === undefined ? undefined : _a3.confidentialClientType) === "request-body") { - const method2 = (opts.method || "GET").toUpperCase(); - if (METHODS_SUPPORTING_REQUEST_BODY.indexOf(method2) !== -1) { - let contentType; - const headers = opts.headers || {}; - for (const key in headers) { - if (key.toLowerCase() === "content-type" && headers[key]) { - contentType = headers[key].toLowerCase(); - break; - } - } - if (contentType === "application/x-www-form-urlencoded") { - opts.data = opts.data || ""; - const data = querystring.parse(opts.data); - Object.assign(data, { - client_id: this.clientAuthentication.clientId, - client_secret: this.clientAuthentication.clientSecret || "" - }); - opts.data = querystring.stringify(data); - } else if (contentType === "application/json") { - opts.data = opts.data || {}; - Object.assign(opts.data, { - client_id: this.clientAuthentication.clientId, - client_secret: this.clientAuthentication.clientSecret || "" - }); - } else { - throw new Error(`${contentType} content-types are not supported with ` + `${this.clientAuthentication.confidentialClientType} ` + "client authentication"); - } - } else { - throw new Error(`${method2} HTTP method does not support ` + `${this.clientAuthentication.confidentialClientType} ` + "client authentication"); - } - } - } - static get RETRY_CONFIG() { - return { - retry: true, - retryConfig: { - httpMethodsToRetry: ["GET", "PUT", "POST", "HEAD", "OPTIONS", "DELETE"] - } - }; - } - } - exports.OAuthClientAuthHandler = OAuthClientAuthHandler; - function getErrorFromOAuthErrorResponse(resp, err) { - const errorCode = resp.error; - const errorDescription = resp.error_description; - const errorUri = resp.error_uri; - let message = `Error code ${errorCode}`; - if (typeof errorDescription !== "undefined") { - message += `: ${errorDescription}`; - } - if (typeof errorUri !== "undefined") { - message += ` - ${errorUri}`; - } - const newError = new Error(message); - if (err) { - const keys2 = Object.keys(err); - if (err.stack) { - keys2.push("stack"); - } - keys2.forEach((key) => { - if (key !== "message") { - Object.defineProperty(newError, key, { - value: err[key], - writable: false, - enumerable: true - }); - } - }); - } - return newError; - } -}); - -// ../node_modules/google-auth-library/build/src/auth/stscredentials.js -var require_stscredentials = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.StsCredentials = undefined; - var gaxios_1 = require_src3(); - var querystring = __require("querystring"); - var transporters_1 = require_transporters(); - var oauth2common_1 = require_oauth2common(); - - class StsCredentials extends oauth2common_1.OAuthClientAuthHandler { - constructor(tokenExchangeEndpoint, clientAuthentication) { - super(clientAuthentication); - this.tokenExchangeEndpoint = tokenExchangeEndpoint; - this.transporter = new transporters_1.DefaultTransporter; - } - async exchangeToken(stsCredentialsOptions, additionalHeaders, options) { - var _a3, _b, _c; - const values3 = { - grant_type: stsCredentialsOptions.grantType, - resource: stsCredentialsOptions.resource, - audience: stsCredentialsOptions.audience, - scope: (_a3 = stsCredentialsOptions.scope) === null || _a3 === undefined ? undefined : _a3.join(" "), - requested_token_type: stsCredentialsOptions.requestedTokenType, - subject_token: stsCredentialsOptions.subjectToken, - subject_token_type: stsCredentialsOptions.subjectTokenType, - actor_token: (_b = stsCredentialsOptions.actingParty) === null || _b === undefined ? undefined : _b.actorToken, - actor_token_type: (_c = stsCredentialsOptions.actingParty) === null || _c === undefined ? undefined : _c.actorTokenType, - options: options && JSON.stringify(options) - }; - Object.keys(values3).forEach((key) => { - if (typeof values3[key] === "undefined") { - delete values3[key]; - } - }); - const headers = { - "Content-Type": "application/x-www-form-urlencoded" - }; - Object.assign(headers, additionalHeaders || {}); - const opts = { - ...StsCredentials.RETRY_CONFIG, - url: this.tokenExchangeEndpoint.toString(), - method: "POST", - headers, - data: querystring.stringify(values3), - responseType: "json" - }; - this.applyClientAuthenticationOptions(opts); - try { - const response = await this.transporter.request(opts); - const stsSuccessfulResponse = response.data; - stsSuccessfulResponse.res = response; - return stsSuccessfulResponse; - } catch (error44) { - if (error44 instanceof gaxios_1.GaxiosError && error44.response) { - throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error44.response.data, error44); - } - throw error44; - } - } - } - exports.StsCredentials = StsCredentials; -}); - -// ../node_modules/google-auth-library/build/src/auth/baseexternalclient.js -var require_baseexternalclient = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var __classPrivateFieldSet3 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; - }; - var _BaseExternalAccountClient_instances; - var _BaseExternalAccountClient_pendingAccessToken; - var _BaseExternalAccountClient_internalRefreshAccessTokenAsync; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BaseExternalAccountClient = exports.DEFAULT_UNIVERSE = exports.CLOUD_RESOURCE_MANAGER = exports.EXTERNAL_ACCOUNT_TYPE = exports.EXPIRATION_TIME_OFFSET = undefined; - var stream4 = __require("stream"); - var authclient_1 = require_authclient(); - var sts = require_stscredentials(); - var util_1 = require_util8(); - var STS_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange"; - var STS_REQUEST_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"; - var DEFAULT_OAUTH_SCOPE = "https://www.googleapis.com/auth/cloud-platform"; - var DEFAULT_TOKEN_LIFESPAN = 3600; - exports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000; - exports.EXTERNAL_ACCOUNT_TYPE = "external_account"; - exports.CLOUD_RESOURCE_MANAGER = "https://cloudresourcemanager.googleapis.com/v1/projects/"; - var WORKFORCE_AUDIENCE_PATTERN = "//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+"; - var DEFAULT_TOKEN_URL = "https://sts.{universeDomain}/v1/token"; - var pkg = require_package9(); - var authclient_2 = require_authclient(); - Object.defineProperty(exports, "DEFAULT_UNIVERSE", { enumerable: true, get: function() { - return authclient_2.DEFAULT_UNIVERSE; - } }); - - class BaseExternalAccountClient extends authclient_1.AuthClient { - constructor(options, additionalOptions) { - var _a3; - super({ ...options, ...additionalOptions }); - _BaseExternalAccountClient_instances.add(this); - _BaseExternalAccountClient_pendingAccessToken.set(this, null); - const opts = (0, util_1.originalOrCamelOptions)(options); - const type = opts.get("type"); - if (type && type !== exports.EXTERNAL_ACCOUNT_TYPE) { - throw new Error(`Expected "${exports.EXTERNAL_ACCOUNT_TYPE}" type but ` + `received "${options.type}"`); - } - const clientId = opts.get("client_id"); - const clientSecret = opts.get("client_secret"); - const tokenUrl = (_a3 = opts.get("token_url")) !== null && _a3 !== undefined ? _a3 : DEFAULT_TOKEN_URL.replace("{universeDomain}", this.universeDomain); - const subjectTokenType = opts.get("subject_token_type"); - const workforcePoolUserProject = opts.get("workforce_pool_user_project"); - const serviceAccountImpersonationUrl = opts.get("service_account_impersonation_url"); - const serviceAccountImpersonation = opts.get("service_account_impersonation"); - const serviceAccountImpersonationLifetime = (0, util_1.originalOrCamelOptions)(serviceAccountImpersonation).get("token_lifetime_seconds"); - this.cloudResourceManagerURL = new URL(opts.get("cloud_resource_manager_url") || `https://cloudresourcemanager.${this.universeDomain}/v1/projects/`); - if (clientId) { - this.clientAuth = { - confidentialClientType: "basic", - clientId, - clientSecret - }; - } - this.stsCredential = new sts.StsCredentials(tokenUrl, this.clientAuth); - this.scopes = opts.get("scopes") || [DEFAULT_OAUTH_SCOPE]; - this.cachedAccessToken = null; - this.audience = opts.get("audience"); - this.subjectTokenType = subjectTokenType; - this.workforcePoolUserProject = workforcePoolUserProject; - const workforceAudiencePattern = new RegExp(WORKFORCE_AUDIENCE_PATTERN); - if (this.workforcePoolUserProject && !this.audience.match(workforceAudiencePattern)) { - throw new Error("workforcePoolUserProject should not be set for non-workforce pool " + "credentials."); - } - this.serviceAccountImpersonationUrl = serviceAccountImpersonationUrl; - this.serviceAccountImpersonationLifetime = serviceAccountImpersonationLifetime; - if (this.serviceAccountImpersonationLifetime) { - this.configLifetimeRequested = true; - } else { - this.configLifetimeRequested = false; - this.serviceAccountImpersonationLifetime = DEFAULT_TOKEN_LIFESPAN; - } - this.projectNumber = this.getProjectNumber(this.audience); - this.supplierContext = { - audience: this.audience, - subjectTokenType: this.subjectTokenType, - transporter: this.transporter - }; - } - getServiceAccountEmail() { - var _a3; - if (this.serviceAccountImpersonationUrl) { - if (this.serviceAccountImpersonationUrl.length > 256) { - throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`); - } - const re = /serviceAccounts\/(?[^:]+):generateAccessToken$/; - const result2 = re.exec(this.serviceAccountImpersonationUrl); - return ((_a3 = result2 === null || result2 === undefined ? undefined : result2.groups) === null || _a3 === undefined ? undefined : _a3.email) || null; - } - return null; - } - setCredentials(credentials) { - super.setCredentials(credentials); - this.cachedAccessToken = credentials; - } - async getAccessToken() { - if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) { - await this.refreshAccessTokenAsync(); - } - return { - token: this.cachedAccessToken.access_token, - res: this.cachedAccessToken.res - }; - } - async getRequestHeaders() { - const accessTokenResponse = await this.getAccessToken(); - const headers = { - Authorization: `Bearer ${accessTokenResponse.token}` - }; - return this.addSharedMetadataHeaders(headers); - } - request(opts, callback) { - if (callback) { - this.requestAsync(opts).then((r) => callback(null, r), (e) => { - return callback(e, e.response); - }); - } else { - return this.requestAsync(opts); - } - } - async getProjectId() { - const projectNumber = this.projectNumber || this.workforcePoolUserProject; - if (this.projectId) { - return this.projectId; - } else if (projectNumber) { - const headers = await this.getRequestHeaders(); - const response = await this.transporter.request({ - ...BaseExternalAccountClient.RETRY_CONFIG, - headers, - url: `${this.cloudResourceManagerURL.toString()}${projectNumber}`, - responseType: "json" - }); - this.projectId = response.data.projectId; - return this.projectId; - } - return null; - } - async requestAsync(opts, reAuthRetried = false) { - let response; - try { - const requestHeaders = await this.getRequestHeaders(); - opts.headers = opts.headers || {}; - if (requestHeaders && requestHeaders["x-goog-user-project"]) { - opts.headers["x-goog-user-project"] = requestHeaders["x-goog-user-project"]; - } - if (requestHeaders && requestHeaders.Authorization) { - opts.headers.Authorization = requestHeaders.Authorization; - } - response = await this.transporter.request(opts); - } catch (e) { - const res = e.response; - if (res) { - const statusCode = res.status; - const isReadableStream4 = res.config.data instanceof stream4.Readable; - const isAuthErr = statusCode === 401 || statusCode === 403; - if (!reAuthRetried && isAuthErr && !isReadableStream4 && this.forceRefreshOnFailure) { - await this.refreshAccessTokenAsync(); - return await this.requestAsync(opts, true); - } - } - throw e; - } - return response; - } - async refreshAccessTokenAsync() { - __classPrivateFieldSet3(this, _BaseExternalAccountClient_pendingAccessToken, __classPrivateFieldGet3(this, _BaseExternalAccountClient_pendingAccessToken, "f") || __classPrivateFieldGet3(this, _BaseExternalAccountClient_instances, "m", _BaseExternalAccountClient_internalRefreshAccessTokenAsync).call(this), "f"); - try { - return await __classPrivateFieldGet3(this, _BaseExternalAccountClient_pendingAccessToken, "f"); - } finally { - __classPrivateFieldSet3(this, _BaseExternalAccountClient_pendingAccessToken, null, "f"); - } - } - getProjectNumber(audience) { - const match = audience.match(/\/projects\/([^/]+)/); - if (!match) { - return null; - } - return match[1]; - } - async getImpersonatedAccessToken(token) { - const opts = { - ...BaseExternalAccountClient.RETRY_CONFIG, - url: this.serviceAccountImpersonationUrl, - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${token}` - }, - data: { - scope: this.getScopesArray(), - lifetime: this.serviceAccountImpersonationLifetime + "s" - }, - responseType: "json" - }; - const response = await this.transporter.request(opts); - const successResponse = response.data; - return { - access_token: successResponse.accessToken, - expiry_date: new Date(successResponse.expireTime).getTime(), - res: response - }; - } - isExpired(accessToken) { - const now2 = new Date().getTime(); - return accessToken.expiry_date ? now2 >= accessToken.expiry_date - this.eagerRefreshThresholdMillis : false; - } - getScopesArray() { - if (typeof this.scopes === "string") { - return [this.scopes]; - } - return this.scopes || [DEFAULT_OAUTH_SCOPE]; - } - getMetricsHeaderValue() { - const nodeVersion = process.version.replace(/^v/, ""); - const saImpersonation = this.serviceAccountImpersonationUrl !== undefined; - const credentialSourceType = this.credentialSourceType ? this.credentialSourceType : "unknown"; - return `gl-node/${nodeVersion} auth/${pkg.version} google-byoid-sdk source/${credentialSourceType} sa-impersonation/${saImpersonation} config-lifetime/${this.configLifetimeRequested}`; - } - } - exports.BaseExternalAccountClient = BaseExternalAccountClient; - _BaseExternalAccountClient_pendingAccessToken = new WeakMap, _BaseExternalAccountClient_instances = new WeakSet, _BaseExternalAccountClient_internalRefreshAccessTokenAsync = async function _BaseExternalAccountClient_internalRefreshAccessTokenAsync() { - const subjectToken = await this.retrieveSubjectToken(); - const stsCredentialsOptions = { - grantType: STS_GRANT_TYPE, - audience: this.audience, - requestedTokenType: STS_REQUEST_TOKEN_TYPE, - subjectToken, - subjectTokenType: this.subjectTokenType, - scope: this.serviceAccountImpersonationUrl ? [DEFAULT_OAUTH_SCOPE] : this.getScopesArray() - }; - const additionalOptions = !this.clientAuth && this.workforcePoolUserProject ? { userProject: this.workforcePoolUserProject } : undefined; - const additionalHeaders = { - "x-goog-api-client": this.getMetricsHeaderValue() - }; - const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, additionalHeaders, additionalOptions); - if (this.serviceAccountImpersonationUrl) { - this.cachedAccessToken = await this.getImpersonatedAccessToken(stsResponse.access_token); - } else if (stsResponse.expires_in) { - this.cachedAccessToken = { - access_token: stsResponse.access_token, - expiry_date: new Date().getTime() + stsResponse.expires_in * 1000, - res: stsResponse.res - }; - } else { - this.cachedAccessToken = { - access_token: stsResponse.access_token, - res: stsResponse.res - }; - } - this.credentials = {}; - Object.assign(this.credentials, this.cachedAccessToken); - delete this.credentials.res; - this.emit("tokens", { - refresh_token: null, - expiry_date: this.cachedAccessToken.expiry_date, - access_token: this.cachedAccessToken.access_token, - token_type: "Bearer", - id_token: null - }); - return this.cachedAccessToken; - }; -}); - -// ../node_modules/google-auth-library/build/src/auth/filesubjecttokensupplier.js -var require_filesubjecttokensupplier = __commonJS((exports) => { - var _a3; - var _b; - var _c; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.FileSubjectTokenSupplier = undefined; - var util_1 = __require("util"); - var fs2 = __require("fs"); - var readFile8 = (0, util_1.promisify)((_a3 = fs2.readFile) !== null && _a3 !== undefined ? _a3 : () => {}); - var realpath4 = (0, util_1.promisify)((_b = fs2.realpath) !== null && _b !== undefined ? _b : () => {}); - var lstat = (0, util_1.promisify)((_c = fs2.lstat) !== null && _c !== undefined ? _c : () => {}); - - class FileSubjectTokenSupplier { - constructor(opts) { - this.filePath = opts.filePath; - this.formatType = opts.formatType; - this.subjectTokenFieldName = opts.subjectTokenFieldName; - } - async getSubjectToken(context) { - let parsedFilePath = this.filePath; - try { - parsedFilePath = await realpath4(parsedFilePath); - if (!(await lstat(parsedFilePath)).isFile()) { - throw new Error; - } - } catch (err) { - if (err instanceof Error) { - err.message = `The file at ${parsedFilePath} does not exist, or it is not a file. ${err.message}`; - } - throw err; - } - let subjectToken; - const rawText = await readFile8(parsedFilePath, { encoding: "utf8" }); - if (this.formatType === "text") { - subjectToken = rawText; - } else if (this.formatType === "json" && this.subjectTokenFieldName) { - const json2 = JSON.parse(rawText); - subjectToken = json2[this.subjectTokenFieldName]; - } - if (!subjectToken) { - throw new Error("Unable to parse the subject_token from the credential_source file"); - } - return subjectToken; - } - } - exports.FileSubjectTokenSupplier = FileSubjectTokenSupplier; -}); - -// ../node_modules/google-auth-library/build/src/auth/urlsubjecttokensupplier.js -var require_urlsubjecttokensupplier = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.UrlSubjectTokenSupplier = undefined; - - class UrlSubjectTokenSupplier { - constructor(opts) { - this.url = opts.url; - this.formatType = opts.formatType; - this.subjectTokenFieldName = opts.subjectTokenFieldName; - this.headers = opts.headers; - this.additionalGaxiosOptions = opts.additionalGaxiosOptions; - } - async getSubjectToken(context) { - const opts = { - ...this.additionalGaxiosOptions, - url: this.url, - method: "GET", - headers: this.headers, - responseType: this.formatType - }; - let subjectToken; - if (this.formatType === "text") { - const response = await context.transporter.request(opts); - subjectToken = response.data; - } else if (this.formatType === "json" && this.subjectTokenFieldName) { - const response = await context.transporter.request(opts); - subjectToken = response.data[this.subjectTokenFieldName]; - } - if (!subjectToken) { - throw new Error("Unable to parse the subject_token from the credential_source URL"); - } - return subjectToken; - } - } - exports.UrlSubjectTokenSupplier = UrlSubjectTokenSupplier; -}); - -// ../node_modules/google-auth-library/build/src/auth/identitypoolclient.js -var require_identitypoolclient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.IdentityPoolClient = undefined; - var baseexternalclient_1 = require_baseexternalclient(); - var util_1 = require_util8(); - var filesubjecttokensupplier_1 = require_filesubjecttokensupplier(); - var urlsubjecttokensupplier_1 = require_urlsubjecttokensupplier(); - - class IdentityPoolClient extends baseexternalclient_1.BaseExternalAccountClient { - constructor(options, additionalOptions) { - super(options, additionalOptions); - const opts = (0, util_1.originalOrCamelOptions)(options); - const credentialSource = opts.get("credential_source"); - const subjectTokenSupplier = opts.get("subject_token_supplier"); - if (!credentialSource && !subjectTokenSupplier) { - throw new Error("A credential source or subject token supplier must be specified."); - } - if (credentialSource && subjectTokenSupplier) { - throw new Error("Only one of credential source or subject token supplier can be specified."); - } - if (subjectTokenSupplier) { - this.subjectTokenSupplier = subjectTokenSupplier; - this.credentialSourceType = "programmatic"; - } else { - const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource); - const formatOpts = (0, util_1.originalOrCamelOptions)(credentialSourceOpts.get("format")); - const formatType = formatOpts.get("type") || "text"; - const formatSubjectTokenFieldName = formatOpts.get("subject_token_field_name"); - if (formatType !== "json" && formatType !== "text") { - throw new Error(`Invalid credential_source format "${formatType}"`); - } - if (formatType === "json" && !formatSubjectTokenFieldName) { - throw new Error("Missing subject_token_field_name for JSON credential_source format"); - } - const file2 = credentialSourceOpts.get("file"); - const url3 = credentialSourceOpts.get("url"); - const headers = credentialSourceOpts.get("headers"); - if (file2 && url3) { - throw new Error('No valid Identity Pool "credential_source" provided, must be either file or url.'); - } else if (file2 && !url3) { - this.credentialSourceType = "file"; - this.subjectTokenSupplier = new filesubjecttokensupplier_1.FileSubjectTokenSupplier({ - filePath: file2, - formatType, - subjectTokenFieldName: formatSubjectTokenFieldName - }); - } else if (!file2 && url3) { - this.credentialSourceType = "url"; - this.subjectTokenSupplier = new urlsubjecttokensupplier_1.UrlSubjectTokenSupplier({ - url: url3, - formatType, - subjectTokenFieldName: formatSubjectTokenFieldName, - headers, - additionalGaxiosOptions: IdentityPoolClient.RETRY_CONFIG - }); - } else { - throw new Error('No valid Identity Pool "credential_source" provided, must be either file or url.'); - } - } - } - async retrieveSubjectToken() { - return this.subjectTokenSupplier.getSubjectToken(this.supplierContext); - } - } - exports.IdentityPoolClient = IdentityPoolClient; -}); - -// ../node_modules/google-auth-library/build/src/auth/awsrequestsigner.js -var require_awsrequestsigner = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AwsRequestSigner = undefined; - var crypto_1 = require_crypto3(); - var AWS_ALGORITHM = "AWS4-HMAC-SHA256"; - var AWS_REQUEST_TYPE = "aws4_request"; - - class AwsRequestSigner { - constructor(getCredentials, region) { - this.getCredentials = getCredentials; - this.region = region; - this.crypto = (0, crypto_1.createCrypto)(); - } - async getRequestOptions(amzOptions) { - if (!amzOptions.url) { - throw new Error('"url" is required in "amzOptions"'); - } - const requestPayloadData = typeof amzOptions.data === "object" ? JSON.stringify(amzOptions.data) : amzOptions.data; - const url3 = amzOptions.url; - const method2 = amzOptions.method || "GET"; - const requestPayload = amzOptions.body || requestPayloadData; - const additionalAmzHeaders = amzOptions.headers; - const awsSecurityCredentials = await this.getCredentials(); - const uri = new URL(url3); - const headerMap = await generateAuthenticationHeaderMap({ - crypto: this.crypto, - host: uri.host, - canonicalUri: uri.pathname, - canonicalQuerystring: uri.search.substr(1), - method: method2, - region: this.region, - securityCredentials: awsSecurityCredentials, - requestPayload, - additionalAmzHeaders - }); - const headers = Object.assign(headerMap.amzDate ? { "x-amz-date": headerMap.amzDate } : {}, { - Authorization: headerMap.authorizationHeader, - host: uri.host - }, additionalAmzHeaders || {}); - if (awsSecurityCredentials.token) { - Object.assign(headers, { - "x-amz-security-token": awsSecurityCredentials.token - }); - } - const awsSignedReq = { - url: url3, - method: method2, - headers - }; - if (typeof requestPayload !== "undefined") { - awsSignedReq.body = requestPayload; - } - return awsSignedReq; - } - } - exports.AwsRequestSigner = AwsRequestSigner; - async function sign(crypto3, key, msg) { - return await crypto3.signWithHmacSha256(key, msg); - } - async function getSigningKey(crypto3, key, dateStamp, region, serviceName) { - const kDate = await sign(crypto3, `AWS4${key}`, dateStamp); - const kRegion = await sign(crypto3, kDate, region); - const kService = await sign(crypto3, kRegion, serviceName); - const kSigning = await sign(crypto3, kService, "aws4_request"); - return kSigning; - } - async function generateAuthenticationHeaderMap(options) { - const additionalAmzHeaders = options.additionalAmzHeaders || {}; - const requestPayload = options.requestPayload || ""; - const serviceName = options.host.split(".")[0]; - const now2 = new Date; - const amzDate = now2.toISOString().replace(/[-:]/g, "").replace(/\.[0-9]+/, ""); - const dateStamp = now2.toISOString().replace(/[-]/g, "").replace(/T.*/, ""); - const reformattedAdditionalAmzHeaders = {}; - Object.keys(additionalAmzHeaders).forEach((key) => { - reformattedAdditionalAmzHeaders[key.toLowerCase()] = additionalAmzHeaders[key]; - }); - if (options.securityCredentials.token) { - reformattedAdditionalAmzHeaders["x-amz-security-token"] = options.securityCredentials.token; - } - const amzHeaders = Object.assign({ - host: options.host - }, reformattedAdditionalAmzHeaders.date ? {} : { "x-amz-date": amzDate }, reformattedAdditionalAmzHeaders); - let canonicalHeaders = ""; - const signedHeadersList = Object.keys(amzHeaders).sort(); - signedHeadersList.forEach((key) => { - canonicalHeaders += `${key}:${amzHeaders[key]} -`; - }); - const signedHeaders = signedHeadersList.join(";"); - const payloadHash = await options.crypto.sha256DigestHex(requestPayload); - const canonicalRequest = `${options.method} -` + `${options.canonicalUri} -` + `${options.canonicalQuerystring} -` + `${canonicalHeaders} -` + `${signedHeaders} -` + `${payloadHash}`; - const credentialScope = `${dateStamp}/${options.region}/${serviceName}/${AWS_REQUEST_TYPE}`; - const stringToSign = `${AWS_ALGORITHM} -` + `${amzDate} -` + `${credentialScope} -` + await options.crypto.sha256DigestHex(canonicalRequest); - const signingKey = await getSigningKey(options.crypto, options.securityCredentials.secretAccessKey, dateStamp, options.region, serviceName); - const signature = await sign(options.crypto, signingKey, stringToSign); - const authorizationHeader = `${AWS_ALGORITHM} Credential=${options.securityCredentials.accessKeyId}/` + `${credentialScope}, SignedHeaders=${signedHeaders}, ` + `Signature=${(0, crypto_1.fromArrayBufferToHex)(signature)}`; - return { - amzDate: reformattedAdditionalAmzHeaders.date ? undefined : amzDate, - authorizationHeader, - canonicalQuerystring: options.canonicalQuerystring - }; - } -}); - -// ../node_modules/google-auth-library/build/src/auth/defaultawssecuritycredentialssupplier.js -var require_defaultawssecuritycredentialssupplier = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var _DefaultAwsSecurityCredentialsSupplier_instances; - var _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken; - var _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName; - var _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials; - var _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get; - var _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DefaultAwsSecurityCredentialsSupplier = undefined; - - class DefaultAwsSecurityCredentialsSupplier { - constructor(opts) { - _DefaultAwsSecurityCredentialsSupplier_instances.add(this); - this.regionUrl = opts.regionUrl; - this.securityCredentialsUrl = opts.securityCredentialsUrl; - this.imdsV2SessionTokenUrl = opts.imdsV2SessionTokenUrl; - this.additionalGaxiosOptions = opts.additionalGaxiosOptions; - } - async getAwsRegion(context) { - if (__classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get)) { - return __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get); - } - const metadataHeaders = {}; - if (!__classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get) && this.imdsV2SessionTokenUrl) { - metadataHeaders["x-aws-ec2-metadata-token"] = await __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken).call(this, context.transporter); - } - if (!this.regionUrl) { - throw new Error("Unable to determine AWS region due to missing " + '"options.credential_source.region_url"'); - } - const opts = { - ...this.additionalGaxiosOptions, - url: this.regionUrl, - method: "GET", - responseType: "text", - headers: metadataHeaders - }; - const response = await context.transporter.request(opts); - return response.data.substr(0, response.data.length - 1); - } - async getAwsSecurityCredentials(context) { - if (__classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get)) { - return __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get); - } - const metadataHeaders = {}; - if (this.imdsV2SessionTokenUrl) { - metadataHeaders["x-aws-ec2-metadata-token"] = await __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken).call(this, context.transporter); - } - const roleName = await __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName).call(this, metadataHeaders, context.transporter); - const awsCreds = await __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials).call(this, roleName, metadataHeaders, context.transporter); - return { - accessKeyId: awsCreds.AccessKeyId, - secretAccessKey: awsCreds.SecretAccessKey, - token: awsCreds.Token - }; - } - } - exports.DefaultAwsSecurityCredentialsSupplier = DefaultAwsSecurityCredentialsSupplier; - _DefaultAwsSecurityCredentialsSupplier_instances = new WeakSet, _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken = async function _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken(transporter) { - const opts = { - ...this.additionalGaxiosOptions, - url: this.imdsV2SessionTokenUrl, - method: "PUT", - responseType: "text", - headers: { "x-aws-ec2-metadata-token-ttl-seconds": "300" } - }; - const response = await transporter.request(opts); - return response.data; - }, _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName = async function _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName(headers, transporter) { - if (!this.securityCredentialsUrl) { - throw new Error("Unable to determine AWS role name due to missing " + '"options.credential_source.url"'); - } - const opts = { - ...this.additionalGaxiosOptions, - url: this.securityCredentialsUrl, - method: "GET", - responseType: "text", - headers - }; - const response = await transporter.request(opts); - return response.data; - }, _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials = async function _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials(roleName, headers, transporter) { - const response = await transporter.request({ - ...this.additionalGaxiosOptions, - url: `${this.securityCredentialsUrl}/${roleName}`, - responseType: "json", - headers - }); - return response.data; - }, _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get = function _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get() { - return process.env["AWS_REGION"] || process.env["AWS_DEFAULT_REGION"] || null; - }, _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get = function _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get() { - if (process.env["AWS_ACCESS_KEY_ID"] && process.env["AWS_SECRET_ACCESS_KEY"]) { - return { - accessKeyId: process.env["AWS_ACCESS_KEY_ID"], - secretAccessKey: process.env["AWS_SECRET_ACCESS_KEY"], - token: process.env["AWS_SESSION_TOKEN"] - }; - } - return null; - }; -}); - -// ../node_modules/google-auth-library/build/src/auth/awsclient.js -var require_awsclient = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var _a3; - var _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AwsClient = undefined; - var awsrequestsigner_1 = require_awsrequestsigner(); - var baseexternalclient_1 = require_baseexternalclient(); - var defaultawssecuritycredentialssupplier_1 = require_defaultawssecuritycredentialssupplier(); - var util_1 = require_util8(); - - class AwsClient extends baseexternalclient_1.BaseExternalAccountClient { - constructor(options, additionalOptions) { - super(options, additionalOptions); - const opts = (0, util_1.originalOrCamelOptions)(options); - const credentialSource = opts.get("credential_source"); - const awsSecurityCredentialsSupplier = opts.get("aws_security_credentials_supplier"); - if (!credentialSource && !awsSecurityCredentialsSupplier) { - throw new Error("A credential source or AWS security credentials supplier must be specified."); - } - if (credentialSource && awsSecurityCredentialsSupplier) { - throw new Error("Only one of credential source or AWS security credentials supplier can be specified."); - } - if (awsSecurityCredentialsSupplier) { - this.awsSecurityCredentialsSupplier = awsSecurityCredentialsSupplier; - this.regionalCredVerificationUrl = __classPrivateFieldGet3(_a3, _a3, "f", _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL); - this.credentialSourceType = "programmatic"; - } else { - const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource); - this.environmentId = credentialSourceOpts.get("environment_id"); - const regionUrl = credentialSourceOpts.get("region_url"); - const securityCredentialsUrl = credentialSourceOpts.get("url"); - const imdsV2SessionTokenUrl = credentialSourceOpts.get("imdsv2_session_token_url"); - this.awsSecurityCredentialsSupplier = new defaultawssecuritycredentialssupplier_1.DefaultAwsSecurityCredentialsSupplier({ - regionUrl, - securityCredentialsUrl, - imdsV2SessionTokenUrl - }); - this.regionalCredVerificationUrl = credentialSourceOpts.get("regional_cred_verification_url"); - this.credentialSourceType = "aws"; - this.validateEnvironmentId(); - } - this.awsRequestSigner = null; - this.region = ""; - } - validateEnvironmentId() { - var _b; - const match = (_b = this.environmentId) === null || _b === undefined ? undefined : _b.match(/^(aws)(\d+)$/); - if (!match || !this.regionalCredVerificationUrl) { - throw new Error('No valid AWS "credential_source" provided'); - } else if (parseInt(match[2], 10) !== 1) { - throw new Error(`aws version "${match[2]}" is not supported in the current build.`); - } - } - async retrieveSubjectToken() { - if (!this.awsRequestSigner) { - this.region = await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext); - this.awsRequestSigner = new awsrequestsigner_1.AwsRequestSigner(async () => { - return this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext); - }, this.region); - } - const options = await this.awsRequestSigner.getRequestOptions({ - ..._a3.RETRY_CONFIG, - url: this.regionalCredVerificationUrl.replace("{region}", this.region), - method: "POST" - }); - const reformattedHeader = []; - const extendedHeaders = Object.assign({ - "x-goog-cloud-target-resource": this.audience - }, options.headers); - for (const key in extendedHeaders) { - reformattedHeader.push({ - key, - value: extendedHeaders[key] - }); - } - return encodeURIComponent(JSON.stringify({ - url: options.url, - method: options.method, - headers: reformattedHeader - })); - } - } - exports.AwsClient = AwsClient; - _a3 = AwsClient; - _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL = { value: "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" }; - AwsClient.AWS_EC2_METADATA_IPV4_ADDRESS = "169.254.169.254"; - AwsClient.AWS_EC2_METADATA_IPV6_ADDRESS = "fd00:ec2::254"; -}); - -// ../node_modules/google-auth-library/build/src/auth/executable-response.js -var require_executable_response = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.InvalidSubjectTokenError = exports.InvalidMessageFieldError = exports.InvalidCodeFieldError = exports.InvalidTokenTypeFieldError = exports.InvalidExpirationTimeFieldError = exports.InvalidSuccessFieldError = exports.InvalidVersionFieldError = exports.ExecutableResponseError = exports.ExecutableResponse = undefined; - var SAML_SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:saml2"; - var OIDC_SUBJECT_TOKEN_TYPE1 = "urn:ietf:params:oauth:token-type:id_token"; - var OIDC_SUBJECT_TOKEN_TYPE2 = "urn:ietf:params:oauth:token-type:jwt"; - - class ExecutableResponse { - constructor(responseJson) { - if (!responseJson.version) { - throw new InvalidVersionFieldError("Executable response must contain a 'version' field."); - } - if (responseJson.success === undefined) { - throw new InvalidSuccessFieldError("Executable response must contain a 'success' field."); - } - this.version = responseJson.version; - this.success = responseJson.success; - if (this.success) { - this.expirationTime = responseJson.expiration_time; - this.tokenType = responseJson.token_type; - if (this.tokenType !== SAML_SUBJECT_TOKEN_TYPE && this.tokenType !== OIDC_SUBJECT_TOKEN_TYPE1 && this.tokenType !== OIDC_SUBJECT_TOKEN_TYPE2) { - throw new InvalidTokenTypeFieldError("Executable response must contain a 'token_type' field when successful " + `and it must be one of ${OIDC_SUBJECT_TOKEN_TYPE1}, ${OIDC_SUBJECT_TOKEN_TYPE2}, or ${SAML_SUBJECT_TOKEN_TYPE}.`); - } - if (this.tokenType === SAML_SUBJECT_TOKEN_TYPE) { - if (!responseJson.saml_response) { - throw new InvalidSubjectTokenError(`Executable response must contain a 'saml_response' field when token_type=${SAML_SUBJECT_TOKEN_TYPE}.`); - } - this.subjectToken = responseJson.saml_response; - } else { - if (!responseJson.id_token) { - throw new InvalidSubjectTokenError("Executable response must contain a 'id_token' field when " + `token_type=${OIDC_SUBJECT_TOKEN_TYPE1} or ${OIDC_SUBJECT_TOKEN_TYPE2}.`); - } - this.subjectToken = responseJson.id_token; - } - } else { - if (!responseJson.code) { - throw new InvalidCodeFieldError("Executable response must contain a 'code' field when unsuccessful."); - } - if (!responseJson.message) { - throw new InvalidMessageFieldError("Executable response must contain a 'message' field when unsuccessful."); - } - this.errorCode = responseJson.code; - this.errorMessage = responseJson.message; - } - } - isValid() { - return !this.isExpired() && this.success; - } - isExpired() { - return this.expirationTime !== undefined && this.expirationTime < Math.round(Date.now() / 1000); - } - } - exports.ExecutableResponse = ExecutableResponse; - - class ExecutableResponseError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, new.target.prototype); - } - } - exports.ExecutableResponseError = ExecutableResponseError; - - class InvalidVersionFieldError extends ExecutableResponseError { - } - exports.InvalidVersionFieldError = InvalidVersionFieldError; - - class InvalidSuccessFieldError extends ExecutableResponseError { - } - exports.InvalidSuccessFieldError = InvalidSuccessFieldError; - - class InvalidExpirationTimeFieldError extends ExecutableResponseError { - } - exports.InvalidExpirationTimeFieldError = InvalidExpirationTimeFieldError; - - class InvalidTokenTypeFieldError extends ExecutableResponseError { - } - exports.InvalidTokenTypeFieldError = InvalidTokenTypeFieldError; - - class InvalidCodeFieldError extends ExecutableResponseError { - } - exports.InvalidCodeFieldError = InvalidCodeFieldError; - - class InvalidMessageFieldError extends ExecutableResponseError { - } - exports.InvalidMessageFieldError = InvalidMessageFieldError; - - class InvalidSubjectTokenError extends ExecutableResponseError { - } - exports.InvalidSubjectTokenError = InvalidSubjectTokenError; -}); - -// ../node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js -var require_pluggable_auth_handler = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PluggableAuthHandler = undefined; - var pluggable_auth_client_1 = require_pluggable_auth_client(); - var executable_response_1 = require_executable_response(); - var childProcess = __require("child_process"); - var fs2 = __require("fs"); - - class PluggableAuthHandler { - constructor(options) { - if (!options.command) { - throw new Error("No command provided."); - } - this.commandComponents = PluggableAuthHandler.parseCommand(options.command); - this.timeoutMillis = options.timeoutMillis; - if (!this.timeoutMillis) { - throw new Error("No timeoutMillis provided."); - } - this.outputFile = options.outputFile; - } - retrieveResponseFromExecutable(envMap) { - return new Promise((resolve8, reject2) => { - const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), { - env: { ...process.env, ...Object.fromEntries(envMap) } - }); - let output = ""; - child.stdout.on("data", (data) => { - output += data; - }); - child.stderr.on("data", (err) => { - output += err; - }); - const timeout = setTimeout(() => { - child.removeAllListeners(); - child.kill(); - return reject2(new Error("The executable failed to finish within the timeout specified.")); - }, this.timeoutMillis); - child.on("close", (code) => { - clearTimeout(timeout); - if (code === 0) { - try { - const responseJson = JSON.parse(output); - const response = new executable_response_1.ExecutableResponse(responseJson); - return resolve8(response); - } catch (error44) { - if (error44 instanceof executable_response_1.ExecutableResponseError) { - return reject2(error44); - } - return reject2(new executable_response_1.ExecutableResponseError(`The executable returned an invalid response: ${output}`)); - } - } else { - return reject2(new pluggable_auth_client_1.ExecutableError(output, code.toString())); - } - }); - }); - } - async retrieveCachedResponse() { - if (!this.outputFile || this.outputFile.length === 0) { - return; - } - let filePath; - try { - filePath = await fs2.promises.realpath(this.outputFile); - } catch (_a3) { - return; - } - if (!(await fs2.promises.lstat(filePath)).isFile()) { - return; - } - const responseString = await fs2.promises.readFile(filePath, { - encoding: "utf8" - }); - if (responseString === "") { - return; - } - try { - const responseJson = JSON.parse(responseString); - const response = new executable_response_1.ExecutableResponse(responseJson); - if (response.isValid()) { - return new executable_response_1.ExecutableResponse(responseJson); - } - return; - } catch (error44) { - if (error44 instanceof executable_response_1.ExecutableResponseError) { - throw error44; - } - throw new executable_response_1.ExecutableResponseError(`The output file contained an invalid response: ${responseString}`); - } - } - static parseCommand(command) { - const components = command.match(/(?:[^\s"]+|"[^"]*")+/g); - if (!components) { - throw new Error(`Provided command: "${command}" could not be parsed.`); - } - for (let i2 = 0;i2 < components.length; i2++) { - if (components[i2][0] === '"' && components[i2].slice(-1) === '"') { - components[i2] = components[i2].slice(1, -1); - } - } - return components; - } - } - exports.PluggableAuthHandler = PluggableAuthHandler; -}); - -// ../node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js -var require_pluggable_auth_client = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PluggableAuthClient = exports.ExecutableError = undefined; - var baseexternalclient_1 = require_baseexternalclient(); - var executable_response_1 = require_executable_response(); - var pluggable_auth_handler_1 = require_pluggable_auth_handler(); - - class ExecutableError extends Error { - constructor(message, code) { - super(`The executable failed with exit code: ${code} and error message: ${message}.`); - this.code = code; - Object.setPrototypeOf(this, new.target.prototype); - } - } - exports.ExecutableError = ExecutableError; - var DEFAULT_EXECUTABLE_TIMEOUT_MILLIS = 30 * 1000; - var MINIMUM_EXECUTABLE_TIMEOUT_MILLIS = 5 * 1000; - var MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS = 120 * 1000; - var GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES = "GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES"; - var MAXIMUM_EXECUTABLE_VERSION = 1; - - class PluggableAuthClient extends baseexternalclient_1.BaseExternalAccountClient { - constructor(options, additionalOptions) { - super(options, additionalOptions); - if (!options.credential_source.executable) { - throw new Error('No valid Pluggable Auth "credential_source" provided.'); - } - this.command = options.credential_source.executable.command; - if (!this.command) { - throw new Error('No valid Pluggable Auth "credential_source" provided.'); - } - if (options.credential_source.executable.timeout_millis === undefined) { - this.timeoutMillis = DEFAULT_EXECUTABLE_TIMEOUT_MILLIS; - } else { - this.timeoutMillis = options.credential_source.executable.timeout_millis; - if (this.timeoutMillis < MINIMUM_EXECUTABLE_TIMEOUT_MILLIS || this.timeoutMillis > MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS) { - throw new Error(`Timeout must be between ${MINIMUM_EXECUTABLE_TIMEOUT_MILLIS} and ` + `${MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS} milliseconds.`); - } - } - this.outputFile = options.credential_source.executable.output_file; - this.handler = new pluggable_auth_handler_1.PluggableAuthHandler({ - command: this.command, - timeoutMillis: this.timeoutMillis, - outputFile: this.outputFile - }); - this.credentialSourceType = "executable"; - } - async retrieveSubjectToken() { - if (process.env[GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES] !== "1") { - throw new Error("Pluggable Auth executables need to be explicitly allowed to run by " + "setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment " + "Variable to 1."); - } - let executableResponse = undefined; - if (this.outputFile) { - executableResponse = await this.handler.retrieveCachedResponse(); - } - if (!executableResponse) { - const envMap = new Map; - envMap.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE", this.audience); - envMap.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE", this.subjectTokenType); - envMap.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE", "0"); - if (this.outputFile) { - envMap.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE", this.outputFile); - } - const serviceAccountEmail = this.getServiceAccountEmail(); - if (serviceAccountEmail) { - envMap.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL", serviceAccountEmail); - } - executableResponse = await this.handler.retrieveResponseFromExecutable(envMap); - } - if (executableResponse.version > MAXIMUM_EXECUTABLE_VERSION) { - throw new Error(`Version of executable is not currently supported, maximum supported version is ${MAXIMUM_EXECUTABLE_VERSION}.`); - } - if (!executableResponse.success) { - throw new ExecutableError(executableResponse.errorMessage, executableResponse.errorCode); - } - if (this.outputFile) { - if (!executableResponse.expirationTime) { - throw new executable_response_1.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration."); - } - } - if (executableResponse.isExpired()) { - throw new Error("Executable response is expired."); - } - return executableResponse.subjectToken; - } - } - exports.PluggableAuthClient = PluggableAuthClient; -}); - -// ../node_modules/google-auth-library/build/src/auth/externalclient.js -var require_externalclient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExternalAccountClient = undefined; - var baseexternalclient_1 = require_baseexternalclient(); - var identitypoolclient_1 = require_identitypoolclient(); - var awsclient_1 = require_awsclient(); - var pluggable_auth_client_1 = require_pluggable_auth_client(); - - class ExternalAccountClient { - constructor() { - throw new Error("ExternalAccountClients should be initialized via: " + "ExternalAccountClient.fromJSON(), " + "directly via explicit constructors, eg. " + "new AwsClient(options), new IdentityPoolClient(options), new" + "PluggableAuthClientOptions, or via " + "new GoogleAuth(options).getClient()"); - } - static fromJSON(options, additionalOptions) { - var _a3, _b; - if (options && options.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { - if ((_a3 = options.credential_source) === null || _a3 === undefined ? undefined : _a3.environment_id) { - return new awsclient_1.AwsClient(options, additionalOptions); - } else if ((_b = options.credential_source) === null || _b === undefined ? undefined : _b.executable) { - return new pluggable_auth_client_1.PluggableAuthClient(options, additionalOptions); - } else { - return new identitypoolclient_1.IdentityPoolClient(options, additionalOptions); - } - } else { - return null; - } - } - } - exports.ExternalAccountClient = ExternalAccountClient; -}); - -// ../node_modules/google-auth-library/build/src/auth/externalAccountAuthorizedUserClient.js -var require_externalAccountAuthorizedUserClient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExternalAccountAuthorizedUserClient = exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = undefined; - var authclient_1 = require_authclient(); - var oauth2common_1 = require_oauth2common(); - var gaxios_1 = require_src3(); - var stream4 = __require("stream"); - var baseexternalclient_1 = require_baseexternalclient(); - exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = "external_account_authorized_user"; - var DEFAULT_TOKEN_URL = "https://sts.{universeDomain}/v1/oauthtoken"; - - class ExternalAccountAuthorizedUserHandler extends oauth2common_1.OAuthClientAuthHandler { - constructor(url3, transporter, clientAuthentication) { - super(clientAuthentication); - this.url = url3; - this.transporter = transporter; - } - async refreshToken(refreshToken, additionalHeaders) { - const values3 = new URLSearchParams({ - grant_type: "refresh_token", - refresh_token: refreshToken - }); - const headers = { - "Content-Type": "application/x-www-form-urlencoded", - ...additionalHeaders - }; - const opts = { - ...ExternalAccountAuthorizedUserHandler.RETRY_CONFIG, - url: this.url, - method: "POST", - headers, - data: values3.toString(), - responseType: "json" - }; - this.applyClientAuthenticationOptions(opts); - try { - const response = await this.transporter.request(opts); - const tokenRefreshResponse = response.data; - tokenRefreshResponse.res = response; - return tokenRefreshResponse; - } catch (error44) { - if (error44 instanceof gaxios_1.GaxiosError && error44.response) { - throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error44.response.data, error44); - } - throw error44; - } - } - } - - class ExternalAccountAuthorizedUserClient extends authclient_1.AuthClient { - constructor(options, additionalOptions) { - var _a3; - super({ ...options, ...additionalOptions }); - if (options.universe_domain) { - this.universeDomain = options.universe_domain; - } - this.refreshToken = options.refresh_token; - const clientAuth = { - confidentialClientType: "basic", - clientId: options.client_id, - clientSecret: options.client_secret - }; - this.externalAccountAuthorizedUserHandler = new ExternalAccountAuthorizedUserHandler((_a3 = options.token_url) !== null && _a3 !== undefined ? _a3 : DEFAULT_TOKEN_URL.replace("{universeDomain}", this.universeDomain), this.transporter, clientAuth); - this.cachedAccessToken = null; - this.quotaProjectId = options.quota_project_id; - if (typeof (additionalOptions === null || additionalOptions === undefined ? undefined : additionalOptions.eagerRefreshThresholdMillis) !== "number") { - this.eagerRefreshThresholdMillis = baseexternalclient_1.EXPIRATION_TIME_OFFSET; - } else { - this.eagerRefreshThresholdMillis = additionalOptions.eagerRefreshThresholdMillis; - } - this.forceRefreshOnFailure = !!(additionalOptions === null || additionalOptions === undefined ? undefined : additionalOptions.forceRefreshOnFailure); - } - async getAccessToken() { - if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) { - await this.refreshAccessTokenAsync(); - } - return { - token: this.cachedAccessToken.access_token, - res: this.cachedAccessToken.res - }; - } - async getRequestHeaders() { - const accessTokenResponse = await this.getAccessToken(); - const headers = { - Authorization: `Bearer ${accessTokenResponse.token}` - }; - return this.addSharedMetadataHeaders(headers); - } - request(opts, callback) { - if (callback) { - this.requestAsync(opts).then((r) => callback(null, r), (e) => { - return callback(e, e.response); - }); - } else { - return this.requestAsync(opts); - } - } - async requestAsync(opts, reAuthRetried = false) { - let response; - try { - const requestHeaders = await this.getRequestHeaders(); - opts.headers = opts.headers || {}; - if (requestHeaders && requestHeaders["x-goog-user-project"]) { - opts.headers["x-goog-user-project"] = requestHeaders["x-goog-user-project"]; - } - if (requestHeaders && requestHeaders.Authorization) { - opts.headers.Authorization = requestHeaders.Authorization; - } - response = await this.transporter.request(opts); - } catch (e) { - const res = e.response; - if (res) { - const statusCode = res.status; - const isReadableStream4 = res.config.data instanceof stream4.Readable; - const isAuthErr = statusCode === 401 || statusCode === 403; - if (!reAuthRetried && isAuthErr && !isReadableStream4 && this.forceRefreshOnFailure) { - await this.refreshAccessTokenAsync(); - return await this.requestAsync(opts, true); - } - } - throw e; - } - return response; - } - async refreshAccessTokenAsync() { - const refreshResponse = await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken); - this.cachedAccessToken = { - access_token: refreshResponse.access_token, - expiry_date: new Date().getTime() + refreshResponse.expires_in * 1000, - res: refreshResponse.res - }; - if (refreshResponse.refresh_token !== undefined) { - this.refreshToken = refreshResponse.refresh_token; - } - return this.cachedAccessToken; - } - isExpired(credentials) { - const now2 = new Date().getTime(); - return credentials.expiry_date ? now2 >= credentials.expiry_date - this.eagerRefreshThresholdMillis : false; - } - } - exports.ExternalAccountAuthorizedUserClient = ExternalAccountAuthorizedUserClient; -}); - -// ../node_modules/google-auth-library/build/src/auth/googleauth.js -var require_googleauth = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var __classPrivateFieldSet3 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; - }; - var _GoogleAuth_instances; - var _GoogleAuth_pendingAuthClient; - var _GoogleAuth_prepareAndCacheClient; - var _GoogleAuth_determineClient; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GoogleAuth = exports.GoogleAuthExceptionMessages = exports.CLOUD_SDK_CLIENT_ID = undefined; - var child_process_1 = __require("child_process"); - var fs2 = __require("fs"); - var gcpMetadata = require_src5(); - var os3 = __require("os"); - var path11 = __require("path"); - var crypto_1 = require_crypto3(); - var transporters_1 = require_transporters(); - var computeclient_1 = require_computeclient(); - var idtokenclient_1 = require_idtokenclient(); - var envDetect_1 = require_envDetect(); - var jwtclient_1 = require_jwtclient(); - var refreshclient_1 = require_refreshclient(); - var impersonated_1 = require_impersonated(); - var externalclient_1 = require_externalclient(); - var baseexternalclient_1 = require_baseexternalclient(); - var authclient_1 = require_authclient(); - var externalAccountAuthorizedUserClient_1 = require_externalAccountAuthorizedUserClient(); - var util_1 = require_util8(); - exports.CLOUD_SDK_CLIENT_ID = "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com"; - exports.GoogleAuthExceptionMessages = { - API_KEY_WITH_CREDENTIALS: "API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.", - NO_PROJECT_ID_FOUND: `Unable to detect a Project Id in the current environment. -` + `To learn more about authentication and Google APIs, visit: -` + "https://cloud.google.com/docs/authentication/getting-started", - NO_CREDENTIALS_FOUND: `Unable to find credentials in current environment. -` + `To learn more about authentication and Google APIs, visit: -` + "https://cloud.google.com/docs/authentication/getting-started", - NO_ADC_FOUND: "Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.", - NO_UNIVERSE_DOMAIN_FOUND: `Unable to detect a Universe Domain in the current environment. -` + `To learn more about Universe Domain retrieval, visit: -` + "https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys" - }; - - class GoogleAuth { - get isGCE() { - return this.checkIsGCE; - } - constructor(opts = {}) { - _GoogleAuth_instances.add(this); - this.checkIsGCE = undefined; - this.jsonContent = null; - this.cachedCredential = null; - _GoogleAuth_pendingAuthClient.set(this, null); - this.clientOptions = {}; - this._cachedProjectId = opts.projectId || null; - this.cachedCredential = opts.authClient || null; - this.keyFilename = opts.keyFilename || opts.keyFile; - this.scopes = opts.scopes; - this.clientOptions = opts.clientOptions || {}; - this.jsonContent = opts.credentials || null; - this.apiKey = opts.apiKey || this.clientOptions.apiKey || null; - if (this.apiKey && (this.jsonContent || this.clientOptions.credentials)) { - throw new RangeError(exports.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS); - } - if (opts.universeDomain) { - this.clientOptions.universeDomain = opts.universeDomain; - } - } - setGapicJWTValues(client3) { - client3.defaultServicePath = this.defaultServicePath; - client3.useJWTAccessWithScope = this.useJWTAccessWithScope; - client3.defaultScopes = this.defaultScopes; - } - getProjectId(callback) { - if (callback) { - this.getProjectIdAsync().then((r) => callback(null, r), callback); - } else { - return this.getProjectIdAsync(); - } - } - async getProjectIdOptional() { - try { - return await this.getProjectId(); - } catch (e) { - if (e instanceof Error && e.message === exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND) { - return null; - } else { - throw e; - } - } - } - async findAndCacheProjectId() { - let projectId = null; - projectId || (projectId = await this.getProductionProjectId()); - projectId || (projectId = await this.getFileProjectId()); - projectId || (projectId = await this.getDefaultServiceProjectId()); - projectId || (projectId = await this.getGCEProjectId()); - projectId || (projectId = await this.getExternalAccountClientProjectId()); - if (projectId) { - this._cachedProjectId = projectId; - return projectId; - } else { - throw new Error(exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND); - } - } - async getProjectIdAsync() { - if (this._cachedProjectId) { - return this._cachedProjectId; - } - if (!this._findProjectIdPromise) { - this._findProjectIdPromise = this.findAndCacheProjectId(); - } - return this._findProjectIdPromise; - } - async getUniverseDomainFromMetadataServer() { - var _a3; - let universeDomain; - try { - universeDomain = await gcpMetadata.universe("universe-domain"); - universeDomain || (universeDomain = authclient_1.DEFAULT_UNIVERSE); - } catch (e) { - if (e && ((_a3 = e === null || e === undefined ? undefined : e.response) === null || _a3 === undefined ? undefined : _a3.status) === 404) { - universeDomain = authclient_1.DEFAULT_UNIVERSE; - } else { - throw e; - } - } - return universeDomain; - } - async getUniverseDomain() { - let universeDomain = (0, util_1.originalOrCamelOptions)(this.clientOptions).get("universe_domain"); - try { - universeDomain !== null && universeDomain !== undefined || (universeDomain = (await this.getClient()).universeDomain); - } catch (_a3) { - universeDomain !== null && universeDomain !== undefined || (universeDomain = authclient_1.DEFAULT_UNIVERSE); - } - return universeDomain; - } - getAnyScopes() { - return this.scopes || this.defaultScopes; - } - getApplicationDefault(optionsOrCallback = {}, callback) { - let options; - if (typeof optionsOrCallback === "function") { - callback = optionsOrCallback; - } else { - options = optionsOrCallback; - } - if (callback) { - this.getApplicationDefaultAsync(options).then((r) => callback(null, r.credential, r.projectId), callback); - } else { - return this.getApplicationDefaultAsync(options); - } - } - async getApplicationDefaultAsync(options = {}) { - if (this.cachedCredential) { - return await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, this.cachedCredential, null); - } - let credential; - credential = await this._tryGetApplicationCredentialsFromEnvironmentVariable(options); - if (credential) { - if (credential instanceof jwtclient_1.JWT) { - credential.scopes = this.scopes; - } else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) { - credential.scopes = this.getAnyScopes(); - } - return await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, credential); - } - credential = await this._tryGetApplicationCredentialsFromWellKnownFile(options); - if (credential) { - if (credential instanceof jwtclient_1.JWT) { - credential.scopes = this.scopes; - } else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) { - credential.scopes = this.getAnyScopes(); - } - return await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, credential); - } - if (await this._checkIsGCE()) { - options.scopes = this.getAnyScopes(); - return await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, new computeclient_1.Compute(options)); - } - throw new Error(exports.GoogleAuthExceptionMessages.NO_ADC_FOUND); - } - async _checkIsGCE() { - if (this.checkIsGCE === undefined) { - this.checkIsGCE = gcpMetadata.getGCPResidency() || await gcpMetadata.isAvailable(); - } - return this.checkIsGCE; - } - async _tryGetApplicationCredentialsFromEnvironmentVariable(options) { - const credentialsPath = process.env["GOOGLE_APPLICATION_CREDENTIALS"] || process.env["google_application_credentials"]; - if (!credentialsPath || credentialsPath.length === 0) { - return null; - } - try { - return this._getApplicationCredentialsFromFilePath(credentialsPath, options); - } catch (e) { - if (e instanceof Error) { - e.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`; - } - throw e; - } - } - async _tryGetApplicationCredentialsFromWellKnownFile(options) { - let location = null; - if (this._isWindows()) { - location = process.env["APPDATA"]; - } else { - const home = process.env["HOME"]; - if (home) { - location = path11.join(home, ".config"); - } - } - if (location) { - location = path11.join(location, "gcloud", "application_default_credentials.json"); - if (!fs2.existsSync(location)) { - location = null; - } - } - if (!location) { - return null; - } - const client3 = await this._getApplicationCredentialsFromFilePath(location, options); - return client3; - } - async _getApplicationCredentialsFromFilePath(filePath, options = {}) { - if (!filePath || filePath.length === 0) { - throw new Error("The file path is invalid."); - } - try { - filePath = fs2.realpathSync(filePath); - if (!fs2.lstatSync(filePath).isFile()) { - throw new Error; - } - } catch (err) { - if (err instanceof Error) { - err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`; - } - throw err; - } - const readStream2 = fs2.createReadStream(filePath); - return this.fromStream(readStream2, options); - } - fromImpersonatedJSON(json2) { - var _a3, _b, _c, _d; - if (!json2) { - throw new Error("Must pass in a JSON object containing an impersonated refresh token"); - } - if (json2.type !== impersonated_1.IMPERSONATED_ACCOUNT_TYPE) { - throw new Error(`The incoming JSON object does not have the "${impersonated_1.IMPERSONATED_ACCOUNT_TYPE}" type`); - } - if (!json2.source_credentials) { - throw new Error("The incoming JSON object does not contain a source_credentials field"); - } - if (!json2.service_account_impersonation_url) { - throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field"); - } - const sourceClient = this.fromJSON(json2.source_credentials); - if (((_a3 = json2.service_account_impersonation_url) === null || _a3 === undefined ? undefined : _a3.length) > 256) { - throw new RangeError(`Target principal is too long: ${json2.service_account_impersonation_url}`); - } - const targetPrincipal = (_c = (_b = /(?[^/]+):(generateAccessToken|generateIdToken)$/.exec(json2.service_account_impersonation_url)) === null || _b === undefined ? undefined : _b.groups) === null || _c === undefined ? undefined : _c.target; - if (!targetPrincipal) { - throw new RangeError(`Cannot extract target principal from ${json2.service_account_impersonation_url}`); - } - const targetScopes = (_d = this.getAnyScopes()) !== null && _d !== undefined ? _d : []; - return new impersonated_1.Impersonated({ - ...json2, - sourceClient, - targetPrincipal, - targetScopes: Array.isArray(targetScopes) ? targetScopes : [targetScopes] - }); - } - fromJSON(json2, options = {}) { - let client3; - const preferredUniverseDomain = (0, util_1.originalOrCamelOptions)(options).get("universe_domain"); - if (json2.type === refreshclient_1.USER_REFRESH_ACCOUNT_TYPE) { - client3 = new refreshclient_1.UserRefreshClient(options); - client3.fromJSON(json2); - } else if (json2.type === impersonated_1.IMPERSONATED_ACCOUNT_TYPE) { - client3 = this.fromImpersonatedJSON(json2); - } else if (json2.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { - client3 = externalclient_1.ExternalAccountClient.fromJSON(json2, options); - client3.scopes = this.getAnyScopes(); - } else if (json2.type === externalAccountAuthorizedUserClient_1.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE) { - client3 = new externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient(json2, options); - } else { - options.scopes = this.scopes; - client3 = new jwtclient_1.JWT(options); - this.setGapicJWTValues(client3); - client3.fromJSON(json2); - } - if (preferredUniverseDomain) { - client3.universeDomain = preferredUniverseDomain; - } - return client3; - } - _cacheClientFromJSON(json2, options) { - const client3 = this.fromJSON(json2, options); - this.jsonContent = json2; - this.cachedCredential = client3; - return client3; - } - fromStream(inputStream, optionsOrCallback = {}, callback) { - let options = {}; - if (typeof optionsOrCallback === "function") { - callback = optionsOrCallback; - } else { - options = optionsOrCallback; - } - if (callback) { - this.fromStreamAsync(inputStream, options).then((r) => callback(null, r), callback); - } else { - return this.fromStreamAsync(inputStream, options); - } - } - fromStreamAsync(inputStream, options) { - return new Promise((resolve8, reject2) => { - if (!inputStream) { - throw new Error("Must pass in a stream containing the Google auth settings."); - } - const chunks = []; - inputStream.setEncoding("utf8").on("error", reject2).on("data", (chunk2) => chunks.push(chunk2)).on("end", () => { - try { - try { - const data = JSON.parse(chunks.join("")); - const r = this._cacheClientFromJSON(data, options); - return resolve8(r); - } catch (err) { - if (!this.keyFilename) - throw err; - const client3 = new jwtclient_1.JWT({ - ...this.clientOptions, - keyFile: this.keyFilename - }); - this.cachedCredential = client3; - this.setGapicJWTValues(client3); - return resolve8(client3); - } - } catch (err) { - return reject2(err); - } - }); - }); - } - fromAPIKey(apiKey, options = {}) { - return new jwtclient_1.JWT({ ...options, apiKey }); - } - _isWindows() { - const sys = os3.platform(); - if (sys && sys.length >= 3) { - if (sys.substring(0, 3).toLowerCase() === "win") { - return true; - } - } - return false; - } - async getDefaultServiceProjectId() { - return new Promise((resolve8) => { - (0, child_process_1.exec)("gcloud config config-helper --format json", (err, stdout) => { - if (!err && stdout) { - try { - const projectId = JSON.parse(stdout).configuration.properties.core.project; - resolve8(projectId); - return; - } catch (e) {} - } - resolve8(null); - }); - }); - } - getProductionProjectId() { - return process.env["GCLOUD_PROJECT"] || process.env["GOOGLE_CLOUD_PROJECT"] || process.env["gcloud_project"] || process.env["google_cloud_project"]; - } - async getFileProjectId() { - if (this.cachedCredential) { - return this.cachedCredential.projectId; - } - if (this.keyFilename) { - const creds = await this.getClient(); - if (creds && creds.projectId) { - return creds.projectId; - } - } - const r = await this._tryGetApplicationCredentialsFromEnvironmentVariable(); - if (r) { - return r.projectId; - } else { - return null; - } - } - async getExternalAccountClientProjectId() { - if (!this.jsonContent || this.jsonContent.type !== baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { - return null; - } - const creds = await this.getClient(); - return await creds.getProjectId(); - } - async getGCEProjectId() { - try { - const r = await gcpMetadata.project("project-id"); - return r; - } catch (e) { - return null; - } - } - getCredentials(callback) { - if (callback) { - this.getCredentialsAsync().then((r) => callback(null, r), callback); - } else { - return this.getCredentialsAsync(); - } - } - async getCredentialsAsync() { - const client3 = await this.getClient(); - if (client3 instanceof impersonated_1.Impersonated) { - return { client_email: client3.getTargetPrincipal() }; - } - if (client3 instanceof baseexternalclient_1.BaseExternalAccountClient) { - const serviceAccountEmail = client3.getServiceAccountEmail(); - if (serviceAccountEmail) { - return { - client_email: serviceAccountEmail, - universe_domain: client3.universeDomain - }; - } - } - if (this.jsonContent) { - return { - client_email: this.jsonContent.client_email, - private_key: this.jsonContent.private_key, - universe_domain: this.jsonContent.universe_domain - }; - } - if (await this._checkIsGCE()) { - const [client_email, universe_domain] = await Promise.all([ - gcpMetadata.instance("service-accounts/default/email"), - this.getUniverseDomain() - ]); - return { client_email, universe_domain }; - } - throw new Error(exports.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND); - } - async getClient() { - if (this.cachedCredential) { - return this.cachedCredential; - } - __classPrivateFieldSet3(this, _GoogleAuth_pendingAuthClient, __classPrivateFieldGet3(this, _GoogleAuth_pendingAuthClient, "f") || __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_determineClient).call(this), "f"); - try { - return await __classPrivateFieldGet3(this, _GoogleAuth_pendingAuthClient, "f"); - } finally { - __classPrivateFieldSet3(this, _GoogleAuth_pendingAuthClient, null, "f"); - } - } - async getIdTokenClient(targetAudience) { - const client3 = await this.getClient(); - if (!("fetchIdToken" in client3)) { - throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file."); - } - return new idtokenclient_1.IdTokenClient({ targetAudience, idTokenProvider: client3 }); - } - async getAccessToken() { - const client3 = await this.getClient(); - return (await client3.getAccessToken()).token; - } - async getRequestHeaders(url3) { - const client3 = await this.getClient(); - return client3.getRequestHeaders(url3); - } - async authorizeRequest(opts) { - opts = opts || {}; - const url3 = opts.url || opts.uri; - const client3 = await this.getClient(); - const headers = await client3.getRequestHeaders(url3); - opts.headers = Object.assign(opts.headers || {}, headers); - return opts; - } - async request(opts) { - const client3 = await this.getClient(); - return client3.request(opts); - } - getEnv() { - return (0, envDetect_1.getEnv)(); - } - async sign(data, endpoint) { - const client3 = await this.getClient(); - const universe = await this.getUniverseDomain(); - endpoint = endpoint || `https://iamcredentials.${universe}/v1/projects/-/serviceAccounts/`; - if (client3 instanceof impersonated_1.Impersonated) { - const signed = await client3.sign(data); - return signed.signedBlob; - } - const crypto3 = (0, crypto_1.createCrypto)(); - if (client3 instanceof jwtclient_1.JWT && client3.key) { - const sign = await crypto3.sign(client3.key, data); - return sign; - } - const creds = await this.getCredentials(); - if (!creds.client_email) { - throw new Error("Cannot sign data without `client_email`."); - } - return this.signBlob(crypto3, creds.client_email, data, endpoint); - } - async signBlob(crypto3, emailOrUniqueId, data, endpoint) { - const url3 = new URL(endpoint + `${emailOrUniqueId}:signBlob`); - const res = await this.request({ - method: "POST", - url: url3.href, - data: { - payload: crypto3.encodeBase64StringUtf8(data) - }, - retry: true, - retryConfig: { - httpMethodsToRetry: ["POST"] - } - }); - return res.data.signedBlob; - } - } - exports.GoogleAuth = GoogleAuth; - _GoogleAuth_pendingAuthClient = new WeakMap, _GoogleAuth_instances = new WeakSet, _GoogleAuth_prepareAndCacheClient = async function _GoogleAuth_prepareAndCacheClient(credential, quotaProjectIdOverride = process.env["GOOGLE_CLOUD_QUOTA_PROJECT"] || null) { - const projectId = await this.getProjectIdOptional(); - if (quotaProjectIdOverride) { - credential.quotaProjectId = quotaProjectIdOverride; - } - this.cachedCredential = credential; - return { credential, projectId }; - }, _GoogleAuth_determineClient = async function _GoogleAuth_determineClient() { - if (this.jsonContent) { - return this._cacheClientFromJSON(this.jsonContent, this.clientOptions); - } else if (this.keyFilename) { - const filePath = path11.resolve(this.keyFilename); - const stream4 = fs2.createReadStream(filePath); - return await this.fromStreamAsync(stream4, this.clientOptions); - } else if (this.apiKey) { - const client3 = await this.fromAPIKey(this.apiKey, this.clientOptions); - client3.scopes = this.scopes; - const { credential } = await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, client3); - return credential; - } else { - const { credential } = await this.getApplicationDefaultAsync(this.clientOptions); - return credential; - } - }; - GoogleAuth.DefaultTransporter = transporters_1.DefaultTransporter; -}); - -// ../node_modules/google-auth-library/build/src/auth/iam.js -var require_iam = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.IAMAuth = undefined; - - class IAMAuth { - constructor(selector, token) { - this.selector = selector; - this.token = token; - this.selector = selector; - this.token = token; - } - getRequestHeaders() { - return { - "x-goog-iam-authority-selector": this.selector, - "x-goog-iam-authorization-token": this.token - }; - } - } - exports.IAMAuth = IAMAuth; -}); - -// ../node_modules/google-auth-library/build/src/auth/downscopedclient.js -var require_downscopedclient = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DownscopedClient = exports.EXPIRATION_TIME_OFFSET = exports.MAX_ACCESS_BOUNDARY_RULES_COUNT = undefined; - var stream4 = __require("stream"); - var authclient_1 = require_authclient(); - var sts = require_stscredentials(); - var STS_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange"; - var STS_REQUEST_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"; - var STS_SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"; - exports.MAX_ACCESS_BOUNDARY_RULES_COUNT = 10; - exports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000; - - class DownscopedClient extends authclient_1.AuthClient { - constructor(authClient, credentialAccessBoundary, additionalOptions, quotaProjectId) { - super({ ...additionalOptions, quotaProjectId }); - this.authClient = authClient; - this.credentialAccessBoundary = credentialAccessBoundary; - if (credentialAccessBoundary.accessBoundary.accessBoundaryRules.length === 0) { - throw new Error("At least one access boundary rule needs to be defined."); - } else if (credentialAccessBoundary.accessBoundary.accessBoundaryRules.length > exports.MAX_ACCESS_BOUNDARY_RULES_COUNT) { - throw new Error("The provided access boundary has more than " + `${exports.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`); - } - for (const rule of credentialAccessBoundary.accessBoundary.accessBoundaryRules) { - if (rule.availablePermissions.length === 0) { - throw new Error("At least one permission should be defined in access boundary rules."); - } - } - this.stsCredential = new sts.StsCredentials(`https://sts.${this.universeDomain}/v1/token`); - this.cachedDownscopedAccessToken = null; - } - setCredentials(credentials) { - if (!credentials.expiry_date) { - throw new Error("The access token expiry_date field is missing in the provided " + "credentials."); - } - super.setCredentials(credentials); - this.cachedDownscopedAccessToken = credentials; - } - async getAccessToken() { - if (!this.cachedDownscopedAccessToken || this.isExpired(this.cachedDownscopedAccessToken)) { - await this.refreshAccessTokenAsync(); - } - return { - token: this.cachedDownscopedAccessToken.access_token, - expirationTime: this.cachedDownscopedAccessToken.expiry_date, - res: this.cachedDownscopedAccessToken.res - }; - } - async getRequestHeaders() { - const accessTokenResponse = await this.getAccessToken(); - const headers = { - Authorization: `Bearer ${accessTokenResponse.token}` - }; - return this.addSharedMetadataHeaders(headers); - } - request(opts, callback) { - if (callback) { - this.requestAsync(opts).then((r) => callback(null, r), (e) => { - return callback(e, e.response); - }); - } else { - return this.requestAsync(opts); - } - } - async requestAsync(opts, reAuthRetried = false) { - let response; - try { - const requestHeaders = await this.getRequestHeaders(); - opts.headers = opts.headers || {}; - if (requestHeaders && requestHeaders["x-goog-user-project"]) { - opts.headers["x-goog-user-project"] = requestHeaders["x-goog-user-project"]; - } - if (requestHeaders && requestHeaders.Authorization) { - opts.headers.Authorization = requestHeaders.Authorization; - } - response = await this.transporter.request(opts); - } catch (e) { - const res = e.response; - if (res) { - const statusCode = res.status; - const isReadableStream4 = res.config.data instanceof stream4.Readable; - const isAuthErr = statusCode === 401 || statusCode === 403; - if (!reAuthRetried && isAuthErr && !isReadableStream4 && this.forceRefreshOnFailure) { - await this.refreshAccessTokenAsync(); - return await this.requestAsync(opts, true); - } - } - throw e; - } - return response; - } - async refreshAccessTokenAsync() { - var _a3; - const subjectToken = (await this.authClient.getAccessToken()).token; - const stsCredentialsOptions = { - grantType: STS_GRANT_TYPE, - requestedTokenType: STS_REQUEST_TOKEN_TYPE, - subjectToken, - subjectTokenType: STS_SUBJECT_TOKEN_TYPE - }; - const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, undefined, this.credentialAccessBoundary); - const sourceCredExpireDate = ((_a3 = this.authClient.credentials) === null || _a3 === undefined ? undefined : _a3.expiry_date) || null; - const expiryDate = stsResponse.expires_in ? new Date().getTime() + stsResponse.expires_in * 1000 : sourceCredExpireDate; - this.cachedDownscopedAccessToken = { - access_token: stsResponse.access_token, - expiry_date: expiryDate, - res: stsResponse.res - }; - this.credentials = {}; - Object.assign(this.credentials, this.cachedDownscopedAccessToken); - delete this.credentials.res; - this.emit("tokens", { - refresh_token: null, - expiry_date: this.cachedDownscopedAccessToken.expiry_date, - access_token: this.cachedDownscopedAccessToken.access_token, - token_type: "Bearer", - id_token: null - }); - return this.cachedDownscopedAccessToken; - } - isExpired(downscopedAccessToken) { - const now2 = new Date().getTime(); - return downscopedAccessToken.expiry_date ? now2 >= downscopedAccessToken.expiry_date - this.eagerRefreshThresholdMillis : false; - } - } - exports.DownscopedClient = DownscopedClient; -}); - -// ../node_modules/google-auth-library/build/src/auth/passthrough.js -var require_passthrough = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PassThroughClient = undefined; - var authclient_1 = require_authclient(); - - class PassThroughClient extends authclient_1.AuthClient { - async request(opts) { - return this.transporter.request(opts); - } - async getAccessToken() { - return {}; - } - async getRequestHeaders() { - return {}; - } - } - exports.PassThroughClient = PassThroughClient; - var a2 = new PassThroughClient; - a2.getAccessToken(); -}); - -// ../node_modules/google-auth-library/build/src/index.js -var require_src7 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GoogleAuth = exports.auth = exports.DefaultTransporter = exports.PassThroughClient = exports.ExecutableError = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsRequestSigner = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.ClientAuthentication = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gaxios = exports.gcpMetadata = undefined; - var googleauth_1 = require_googleauth(); - Object.defineProperty(exports, "GoogleAuth", { enumerable: true, get: function() { - return googleauth_1.GoogleAuth; - } }); - exports.gcpMetadata = require_src5(); - exports.gaxios = require_src3(); - var authclient_1 = require_authclient(); - Object.defineProperty(exports, "AuthClient", { enumerable: true, get: function() { - return authclient_1.AuthClient; - } }); - Object.defineProperty(exports, "DEFAULT_UNIVERSE", { enumerable: true, get: function() { - return authclient_1.DEFAULT_UNIVERSE; - } }); - var computeclient_1 = require_computeclient(); - Object.defineProperty(exports, "Compute", { enumerable: true, get: function() { - return computeclient_1.Compute; - } }); - var envDetect_1 = require_envDetect(); - Object.defineProperty(exports, "GCPEnv", { enumerable: true, get: function() { - return envDetect_1.GCPEnv; - } }); - var iam_1 = require_iam(); - Object.defineProperty(exports, "IAMAuth", { enumerable: true, get: function() { - return iam_1.IAMAuth; - } }); - var idtokenclient_1 = require_idtokenclient(); - Object.defineProperty(exports, "IdTokenClient", { enumerable: true, get: function() { - return idtokenclient_1.IdTokenClient; - } }); - var jwtaccess_1 = require_jwtaccess(); - Object.defineProperty(exports, "JWTAccess", { enumerable: true, get: function() { - return jwtaccess_1.JWTAccess; - } }); - var jwtclient_1 = require_jwtclient(); - Object.defineProperty(exports, "JWT", { enumerable: true, get: function() { - return jwtclient_1.JWT; - } }); - var impersonated_1 = require_impersonated(); - Object.defineProperty(exports, "Impersonated", { enumerable: true, get: function() { - return impersonated_1.Impersonated; - } }); - var oauth2client_1 = require_oauth2client(); - Object.defineProperty(exports, "CodeChallengeMethod", { enumerable: true, get: function() { - return oauth2client_1.CodeChallengeMethod; - } }); - Object.defineProperty(exports, "OAuth2Client", { enumerable: true, get: function() { - return oauth2client_1.OAuth2Client; - } }); - Object.defineProperty(exports, "ClientAuthentication", { enumerable: true, get: function() { - return oauth2client_1.ClientAuthentication; - } }); - var loginticket_1 = require_loginticket(); - Object.defineProperty(exports, "LoginTicket", { enumerable: true, get: function() { - return loginticket_1.LoginTicket; - } }); - var refreshclient_1 = require_refreshclient(); - Object.defineProperty(exports, "UserRefreshClient", { enumerable: true, get: function() { - return refreshclient_1.UserRefreshClient; - } }); - var awsclient_1 = require_awsclient(); - Object.defineProperty(exports, "AwsClient", { enumerable: true, get: function() { - return awsclient_1.AwsClient; - } }); - var awsrequestsigner_1 = require_awsrequestsigner(); - Object.defineProperty(exports, "AwsRequestSigner", { enumerable: true, get: function() { - return awsrequestsigner_1.AwsRequestSigner; - } }); - var identitypoolclient_1 = require_identitypoolclient(); - Object.defineProperty(exports, "IdentityPoolClient", { enumerable: true, get: function() { - return identitypoolclient_1.IdentityPoolClient; - } }); - var externalclient_1 = require_externalclient(); - Object.defineProperty(exports, "ExternalAccountClient", { enumerable: true, get: function() { - return externalclient_1.ExternalAccountClient; - } }); - var baseexternalclient_1 = require_baseexternalclient(); - Object.defineProperty(exports, "BaseExternalAccountClient", { enumerable: true, get: function() { - return baseexternalclient_1.BaseExternalAccountClient; - } }); - var downscopedclient_1 = require_downscopedclient(); - Object.defineProperty(exports, "DownscopedClient", { enumerable: true, get: function() { - return downscopedclient_1.DownscopedClient; - } }); - var pluggable_auth_client_1 = require_pluggable_auth_client(); - Object.defineProperty(exports, "PluggableAuthClient", { enumerable: true, get: function() { - return pluggable_auth_client_1.PluggableAuthClient; - } }); - Object.defineProperty(exports, "ExecutableError", { enumerable: true, get: function() { - return pluggable_auth_client_1.ExecutableError; - } }); - var passthrough_1 = require_passthrough(); - Object.defineProperty(exports, "PassThroughClient", { enumerable: true, get: function() { - return passthrough_1.PassThroughClient; - } }); - var transporters_1 = require_transporters(); - Object.defineProperty(exports, "DefaultTransporter", { enumerable: true, get: function() { - return transporters_1.DefaultTransporter; - } }); - var auth = new googleauth_1.GoogleAuth; - exports.auth = auth; -}); - -// ../node_modules/@anthropic-ai/vertex-sdk/internal/utils/env.mjs -var readEnv5 = (env5) => { - if (typeof globalThis.process !== "undefined") { - return globalThis.process.env?.[env5]?.trim() ?? undefined; - } - if (typeof globalThis.Deno !== "undefined") { - return globalThis.Deno.env?.get?.(env5)?.trim(); - } - return; -}; - -// ../node_modules/@anthropic-ai/vertex-sdk/core/error.mjs -var init_error8 = __esm(() => { - init_error4(); -}); - -// ../node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.mjs -function isObj3(obj) { - return obj != null && typeof obj === "object" && !Array.isArray(obj); -} -var isArray7 = (val) => (isArray7 = Array.isArray, isArray7(val)), isReadonlyArray3; -var init_values7 = __esm(() => { - init_error8(); - isReadonlyArray3 = isArray7; -}); - -// ../node_modules/@anthropic-ai/vertex-sdk/internal/headers.mjs -function* iterateHeaders5(headers) { - if (!headers) - return; - if (brand_privateNullableHeaders5 in headers) { - const { values: values3, nulls } = headers; - yield* values3.entries(); - for (const name of nulls) { - yield [name, null]; - } - return; - } - let shouldClear = false; - let iter; - if (headers instanceof Headers) { - iter = headers.entries(); - } else if (isReadonlyArray3(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 values3 = isReadonlyArray3(row[1]) ? row[1] : [row[1]]; - let didClear = false; - for (const value of values3) { - if (value === undefined) - continue; - if (shouldClear && !didClear) { - didClear = true; - yield [name, null]; - } - yield [name, value]; - } - } -} -var brand_privateNullableHeaders5, buildHeaders5 = (newHeaders) => { - const targetHeaders = new Headers; - const nullHeaders = new Set; - for (const headers of newHeaders) { - const seenHeaders = new Set; - for (const [name, value] of iterateHeaders5(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); - } - } - } - return { [brand_privateNullableHeaders5]: true, values: targetHeaders, nulls: nullHeaders }; -}; -var init_headers5 = __esm(() => { - init_values7(); - brand_privateNullableHeaders5 = Symbol.for("brand.privateNullableHeaders"); -}); - -// ../node_modules/@anthropic-ai/vertex-sdk/client.mjs -function makeMessagesResource3(client3) { - const resource = new Messages4(client3); - delete resource.batches; - return resource; -} -function makeBetaResource3(client3) { - const resource = new Beta2(client3); - delete resource.messages.batches; - return resource; -} -var import_google_auth_library, DEFAULT_VERSION2 = "vertex-2023-10-16", MODEL_ENDPOINTS2, AnthropicVertex; -var init_client6 = __esm(() => { - init_client3(); - init_resources2(); - import_google_auth_library = __toESM(require_src7(), 1); - init_values7(); - init_headers5(); - init_client3(); - MODEL_ENDPOINTS2 = new Set(["/v1/messages", "/v1/messages?beta=true"]); - AnthropicVertex = class AnthropicVertex extends BaseAnthropic2 { - constructor({ baseURL = readEnv5("ANTHROPIC_VERTEX_BASE_URL"), region = readEnv5("CLOUD_ML_REGION") ?? null, projectId = readEnv5("ANTHROPIC_VERTEX_PROJECT_ID") ?? null, ...opts } = {}) { - if (!region) { - throw new Error("No region was given. The client should be instantiated with the `region` option or the `CLOUD_ML_REGION` environment variable should be set."); - } - super({ - baseURL: baseURL || (region === "global" ? "https://aiplatform.googleapis.com/v1" : `https://${region}-aiplatform.googleapis.com/v1`), - ...opts - }); - this.messages = makeMessagesResource3(this); - this.beta = makeBetaResource3(this); - this.region = region; - this.projectId = projectId; - this.accessToken = opts.accessToken ?? null; - if (opts.authClient && opts.googleAuth) { - throw new Error("You cannot provide both `authClient` and `googleAuth`. Please provide only one of them."); - } else if (opts.authClient) { - this._authClientPromise = Promise.resolve(opts.authClient); - } else { - this._auth = opts.googleAuth ?? new import_google_auth_library.GoogleAuth({ scopes: "https://www.googleapis.com/auth/cloud-platform" }); - this._authClientPromise = this._auth.getClient(); - } - } - validateHeaders() {} - async prepareOptions(options) { - const authClient = await this._authClientPromise; - const authHeaders = await authClient.getRequestHeaders(); - const projectId = authClient.projectId ?? authHeaders["x-goog-user-project"]; - if (!this.projectId && projectId) { - this.projectId = projectId; - } - options.headers = buildHeaders5([authHeaders, options.headers]); - } - async buildRequest(options) { - if (isObj3(options.body)) { - options.body = { ...options.body }; - } - if (isObj3(options.body)) { - if (!options.body["anthropic_version"]) { - options.body["anthropic_version"] = DEFAULT_VERSION2; - } - } - if (MODEL_ENDPOINTS2.has(options.path) && options.method === "post") { - if (!this.projectId) { - throw new Error("No projectId was given and it could not be resolved from credentials. The client should be instantiated with the `projectId` option or the `ANTHROPIC_VERTEX_PROJECT_ID` environment variable should be set."); - } - if (!isObj3(options.body)) { - throw new Error("Expected request body to be an object for post /v1/messages"); - } - const model = options.body["model"]; - options.body["model"] = undefined; - const stream4 = options.body["stream"] ?? false; - const specifier = stream4 ? "streamRawPredict" : "rawPredict"; - options.path = `/projects/${this.projectId}/locations/${this.region}/publishers/anthropic/models/${model}:${specifier}`; - } - if (options.path === "/v1/messages/count_tokens" || options.path == "/v1/messages/count_tokens?beta=true" && options.method === "post") { - if (!this.projectId) { - throw new Error("No projectId was given and it could not be resolved from credentials. The client should be instantiated with the `projectId` option or the `ANTHROPIC_VERTEX_PROJECT_ID` environment variable should be set."); - } - options.path = `/projects/${this.projectId}/locations/${this.region}/publishers/anthropic/models/count-tokens:rawPredict`; - } - return super.buildRequest(options); - } - }; -}); - -// ../node_modules/@anthropic-ai/vertex-sdk/index.mjs -var exports_vertex_sdk = {}; -__export(exports_vertex_sdk, { - default: () => AnthropicVertex, - BaseAnthropic: () => BaseAnthropic2, - AnthropicVertex: () => AnthropicVertex -}); -var init_vertex_sdk = __esm(() => { - init_client6(); - init_client6(); -}); - -// node_modules/extend/index.js -var require_extend2 = __commonJS((exports, module) => { - var hasOwn5 = Object.prototype.hasOwnProperty; - var toStr = Object.prototype.toString; - var defineProperty2 = Object.defineProperty; - var gOPD = Object.getOwnPropertyDescriptor; - var isArray8 = function isArray(arr) { - if (typeof Array.isArray === "function") { - return Array.isArray(arr); - } - return toStr.call(arr) === "[object Array]"; - }; - var isPlainObject5 = function isPlainObject(obj) { - if (!obj || toStr.call(obj) !== "[object Object]") { - return false; - } - var hasOwnConstructor = hasOwn5.call(obj, "constructor"); - var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn5.call(obj.constructor.prototype, "isPrototypeOf"); - if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { - return false; - } - var key; - for (key in obj) {} - return typeof key === "undefined" || hasOwn5.call(obj, key); - }; - var setProperty2 = function setProperty(target, options) { - if (defineProperty2 && options.name === "__proto__") { - defineProperty2(target, options.name, { - enumerable: true, - configurable: true, - value: options.newValue, - writable: true - }); - } else { - target[options.name] = options.newValue; - } - }; - var getProperty = function getProperty(obj, name) { - if (name === "__proto__") { - if (!hasOwn5.call(obj, name)) { - return; - } else if (gOPD) { - return gOPD(obj, name).value; - } - } - return obj[name]; - }; - module.exports = function extend() { - var options, name, src, copy, copyIsArray, clone4; - var target = arguments[0]; - var i2 = 1; - var length = arguments.length; - var deep = false; - if (typeof target === "boolean") { - deep = target; - target = arguments[1] || {}; - i2 = 2; - } - if (target == null || typeof target !== "object" && typeof target !== "function") { - target = {}; - } - for (;i2 < length; ++i2) { - options = arguments[i2]; - if (options != null) { - for (name in options) { - src = getProperty(target, name); - copy = getProperty(options, name); - if (target !== copy) { - if (deep && copy && (isPlainObject5(copy) || (copyIsArray = isArray8(copy)))) { - if (copyIsArray) { - copyIsArray = false; - clone4 = src && isArray8(src) ? src : []; - } else { - clone4 = src && isPlainObject5(src) ? src : {}; - } - setProperty2(target, { name, newValue: extend(deep, clone4, copy) }); - } else if (typeof copy !== "undefined") { - setProperty2(target, { name, newValue: copy }); - } - } - } - } - } - return target; - }; -}); - -// node_modules/webidl-conversions/lib/index.js -var require_lib3 = __commonJS((exports, module) => { - var conversions = {}; - module.exports = conversions; - function sign(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); - } - } - function createNumberConversion(bitLength, typeOpts) { - if (!typeOpts.unsigned) { - --bitLength; - } - 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(V, opts) { - if (!opts) - opts = {}; - let x2 = +V; - if (opts.enforceRange) { - if (!Number.isFinite(x2)) { - throw new TypeError("Argument is not a finite number"); - } - x2 = sign(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 = sign(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; - }; - 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(V) { - const x2 = +V; - if (!Number.isFinite(x2)) { - throw new TypeError("Argument is not a finite floating-point value"); - } - return x2; - }; - conversions["unrestricted double"] = function(V) { - const x2 = +V; - if (isNaN(x2)) { - throw new TypeError("Argument is NaN"); - } - return x2; - }; - conversions["float"] = conversions["double"]; - conversions["unrestricted float"] = conversions["unrestricted double"]; - conversions["DOMString"] = function(V, opts) { - if (!opts) - opts = {}; - if (opts.treatNullAsEmptyString && V === null) { - return ""; - } - return String(V); - }; - conversions["ByteString"] = function(V, opts) { - const x2 = String(V); - let c5 = undefined; - for (let i2 = 0;(c5 = x2.codePointAt(i2)) !== undefined; ++i2) { - if (c5 > 255) { - throw new TypeError("Argument is not a valid bytestring"); - } - } - return x2; - }; - conversions["USVString"] = function(V) { - const S = String(V); - const n2 = S.length; - const U2 = []; - for (let i2 = 0;i2 < n2; ++i2) { - const c5 = S.charCodeAt(i2); - if (c5 < 55296 || c5 > 57343) { - U2.push(String.fromCodePoint(c5)); - } else if (56320 <= c5 && c5 <= 57343) { - U2.push(String.fromCodePoint(65533)); - } else { - if (i2 === n2 - 1) { - U2.push(String.fromCodePoint(65533)); - } else { - const d = S.charCodeAt(i2 + 1); - if (56320 <= d && d <= 57343) { - const a2 = c5 & 1023; - const b = d & 1023; - U2.push(String.fromCodePoint((2 << 15) + (2 << 9) * a2 + b)); - ++i2; - } else { - U2.push(String.fromCodePoint(65533)); - } - } - } - } - return U2.join(""); - }; - conversions["Date"] = function(V, opts) { - if (!(V instanceof Date)) { - throw new TypeError("Argument is not a Date object"); - } - if (isNaN(V)) { - return; - } - return V; - }; - conversions["RegExp"] = function(V, opts) { - if (!(V instanceof RegExp)) { - V = new RegExp(V); - } - return V; - }; -}); - -// node_modules/whatwg-url/lib/utils.js -var require_utils3 = __commonJS((exports, module) => { - exports.mixin = function mixin(target, source) { - const keys2 = Object.getOwnPropertyNames(source); - for (let i2 = 0;i2 < keys2.length; ++i2) { - Object.defineProperty(target, keys2[i2], Object.getOwnPropertyDescriptor(source, keys2[i2])); - } - }; - exports.wrapperSymbol = Symbol("wrapper"); - exports.implSymbol = Symbol("impl"); - exports.wrapperForImpl = function(impl) { - return impl[exports.wrapperSymbol]; - }; - exports.implForWrapper = function(wrapper) { - return wrapper[exports.implSymbol]; - }; -}); - -// node_modules/tr46/lib/mappingTable.json -var require_mappingTable2 = __commonJS((exports, 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"], [[1000, 1000], "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, 6000], "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]], [[8000, 8005], "valid"], [[8006, 8007], "disallowed"], [[8008, 8008], "mapped", [8000]], [[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, 9000], "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", [30000]], [[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]], [[13000, 13000], "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"], [[43000, 43000], "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]], [[64000, 64000], "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"], [[66000, 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]], [[120000, 120000], "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"], [[128000, 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", [23000]], [[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", [149000]], [[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", [32000]], [[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]], [[195000, 195000], "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", [40000]], [[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"], [[918000, 983037], "disallowed"], [[983038, 983039], "disallowed"], [[983040, 1048573], "disallowed"], [[1048574, 1048575], "disallowed"], [[1048576, 1114109], "disallowed"], [[1114110, 1114111], "disallowed"]]; -}); - -// node_modules/tr46/index.js -var require_tr462 = __commonJS((exports, module) => { - var punycode = __require("punycode"); - var mappingTable = require_mappingTable2(); - var PROCESSING_OPTIONS = { - TRANSITIONAL: 0, - NONTRANSITIONAL: 1 - }; - function normalize3(str) { - return str.split("\x00").map(function(s) { - return s.normalize("NFC"); - }).join("\x00"); - } - 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; - } - } - return null; - } - var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - function countSymbols(string4) { - return string4.replace(regexAstralSymbols, "_").length; - } - function mapChars(domain_name, useSTD3, processing_option) { - var hasError = false; - var processed = ""; - var len = countSymbols(domain_name); - for (var i2 = 0;i2 < len; ++i2) { - var codePoint = domain_name.codePointAt(i2); - 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; - } - } - 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; - } - var error45 = false; - if (normalize3(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { - error45 = true; - } - var len = countSymbols(label); - for (var i2 = 0;i2 < len; ++i2) { - var status = findStatus(label.codePointAt(i2)); - if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") { - error45 = true; - break; - } - } - return { - label, - error: error45 - }; - } - function processing(domain_name, useSTD3, processing_option) { - var result2 = mapChars(domain_name, useSTD3, processing_option); - result2.string = normalize3(result2.string); - var labels = result2.string.split("."); - for (var i2 = 0;i2 < labels.length; ++i2) { - try { - var validation = validateLabel(labels[i2]); - labels[i2] = validation.label; - result2.error = result2.error || validation.error; - } catch (e) { - result2.error = true; - } - } - return { - string: labels.join("."), - error: result2.error - }; - } - exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { - var result2 = processing(domain_name, useSTD3, processing_option); - var labels = result2.string.split("."); - labels = labels.map(function(l) { - try { - return punycode.toASCII(l); - } catch (e) { - result2.error = true; - return l; - } - }); - if (verifyDnsLength) { - var total = labels.slice(0, labels.length - 1).join(".").length; - if (total.length > 253 || total.length === 0) { - result2.error = true; - } - for (var i2 = 0;i2 < labels.length; ++i2) { - if (labels.length > 63 || labels.length === 0) { - result2.error = true; - break; - } - } - } - if (result2.error) - return null; - return labels.join("."); - }; - exports.toUnicode = function(domain_name, useSTD3) { - var result2 = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); - return { - domain: result2.string, - error: result2.error - }; - }; - exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; -}); - -// node_modules/whatwg-url/lib/url-state-machine.js -var require_url_state_machine2 = __commonJS((exports, module) => { - var punycode = __require("punycode"); - var tr46 = require_tr462(); - var specialSchemes = { - ftp: 21, - file: null, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var failure = Symbol("failure"); - function countSymbols(str) { - return punycode.ucs2.decode(str).length; - } - function at2(input2, idx) { - const c5 = input2[idx]; - return isNaN(c5) ? undefined : String.fromCodePoint(c5); - } - function isASCIIDigit(c5) { - return c5 >= 48 && c5 <= 57; - } - function isASCIIAlpha(c5) { - return c5 >= 65 && c5 <= 90 || c5 >= 97 && c5 <= 122; - } - function isASCIIAlphanumeric(c5) { - return isASCIIAlpha(c5) || isASCIIDigit(c5); - } - function isASCIIHex(c5) { - return isASCIIDigit(c5) || c5 >= 65 && c5 <= 70 || c5 >= 97 && c5 <= 102; - } - function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; - } - function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; - } - function isWindowsDriveLetterCodePoints(cp1, cp2) { - return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); - } - function isWindowsDriveLetterString(string4) { - return string4.length === 2 && isASCIIAlpha(string4.codePointAt(0)) && (string4[1] === ":" || string4[1] === "|"); - } - function isNormalizedWindowsDriveLetterString(string4) { - return string4.length === 2 && isASCIIAlpha(string4.codePointAt(0)) && string4[1] === ":"; - } - function containsForbiddenHostCodePoint(string4) { - return string4.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; - } - function containsForbiddenHostCodePointExcludingPercent(string4) { - return string4.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; - } - function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== undefined; - } - function isSpecial(url3) { - return isSpecialScheme(url3.scheme); - } - function defaultPort(scheme) { - return specialSchemes[scheme]; - } - function percentEncode(c5) { - let hex = c5.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = "0" + hex; - } - return "%" + hex; - } - function utf8PercentEncode(c5) { - const buf = new Buffer(c5); - let str = ""; - for (let i2 = 0;i2 < buf.length; ++i2) { - str += percentEncode(buf[i2]); - } - return str; - } - function utf8PercentDecode(str) { - const input2 = new Buffer(str); - const output = []; - for (let i2 = 0;i2 < input2.length; ++i2) { - if (input2[i2] !== 37) { - output.push(input2[i2]); - } else if (input2[i2] === 37 && isASCIIHex(input2[i2 + 1]) && isASCIIHex(input2[i2 + 2])) { - output.push(parseInt(input2.slice(i2 + 1, i2 + 3).toString(), 16)); - i2 += 2; - } else { - output.push(input2[i2]); - } - } - return new Buffer(output).toString(); - } - function isC0ControlPercentEncode(c5) { - return c5 <= 31 || c5 > 126; - } - var extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); - function isPathPercentEncode(c5) { - return isC0ControlPercentEncode(c5) || extraPathPercentEncodeSet.has(c5); - } - var extraUserinfoPercentEncodeSet = new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); - function isUserinfoPercentEncode(c5) { - return isPathPercentEncode(c5) || extraUserinfoPercentEncodeSet.has(c5); - } - function percentEncodeChar(c5, encodeSetPredicate) { - const cStr = String.fromCodePoint(c5); - if (encodeSetPredicate(c5)) { - return utf8PercentEncode(cStr); - } - return cStr; - } - function parseIPv4Number(input2) { - let R2 = 10; - if (input2.length >= 2 && input2.charAt(0) === "0" && input2.charAt(1).toLowerCase() === "x") { - input2 = input2.substring(2); - R2 = 16; - } else if (input2.length >= 2 && input2.charAt(0) === "0") { - input2 = input2.substring(1); - R2 = 8; - } - if (input2 === "") { - return 0; - } - const regex2 = R2 === 10 ? /[^0-9]/ : R2 === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/; - if (regex2.test(input2)) { - return failure; - } - return parseInt(input2, R2); - } - function parseIPv4(input2) { - const parts = input2.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } - if (parts.length > 4) { - return input2; - } - const numbers = []; - for (const part of parts) { - if (part === "") { - return input2; - } - const n2 = parseIPv4Number(part); - if (n2 === failure) { - return input2; - } - numbers.push(n2); - } - for (let i2 = 0;i2 < numbers.length - 1; ++i2) { - if (numbers[i2] > 255) { - return failure; - } - } - if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { - return failure; - } - let ipv43 = numbers.pop(); - let counter = 0; - for (const n2 of numbers) { - ipv43 += n2 * Math.pow(256, 3 - counter); - ++counter; - } - return ipv43; - } - function serializeIPv4(address) { - let output = ""; - let n2 = address; - for (let i2 = 1;i2 <= 4; ++i2) { - output = String(n2 % 256) + output; - if (i2 !== 4) { - output = "." + output; - } - n2 = Math.floor(n2 / 256); - } - return output; - } - function parseIPv6(input2) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - input2 = punycode.ucs2.decode(input2); - if (input2[pointer] === 58) { - if (input2[pointer + 1] !== 58) { - return failure; - } - pointer += 2; - ++pieceIndex; - compress = pieceIndex; - } - while (pointer < input2.length) { - if (pieceIndex === 8) { - return failure; - } - if (input2[pointer] === 58) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; - } - let value = 0; - let length = 0; - while (length < 4 && isASCIIHex(input2[pointer])) { - value = value * 16 + parseInt(at2(input2, pointer), 16); - ++pointer; - ++length; - } - if (input2[pointer] === 46) { - if (length === 0) { - return failure; - } - pointer -= length; - if (pieceIndex > 6) { - return failure; - } - let numbersSeen = 0; - while (input2[pointer] !== undefined) { - let ipv4Piece = null; - if (numbersSeen > 0) { - if (input2[pointer] === 46 && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - if (!isASCIIDigit(input2[pointer])) { - return failure; - } - while (isASCIIDigit(input2[pointer])) { - const number4 = parseInt(at2(input2, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number4; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number4; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } - address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; - ++numbersSeen; - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } - } - if (numbersSeen !== 4) { - return failure; - } - break; - } else if (input2[pointer] === 58) { - ++pointer; - if (input2[pointer] === undefined) { - return failure; - } - } else if (input2[pointer] !== undefined) { - return failure; - } - address[pieceIndex] = value; - ++pieceIndex; - } - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; - } - return address; - } - function serializeIPv6(address) { - let output = ""; - const seqResult = findLongestZeroSequence(address); - const compress = seqResult.idx; - let ignore0 = false; - for (let pieceIndex = 0;pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } - output += address[pieceIndex].toString(16); - if (pieceIndex !== 7) { - output += ":"; - } - } - return output; - } - function parseHost(input2, isSpecialArg) { - if (input2[0] === "[") { - if (input2[input2.length - 1] !== "]") { - return failure; - } - return parseIPv6(input2.substring(1, input2.length - 1)); - } - if (!isSpecialArg) { - return parseOpaqueHost(input2); - } - const domain2 = utf8PercentDecode(input2); - const asciiDomain = tr46.toASCII(domain2, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); - if (asciiDomain === null) { - return failure; - } - if (containsForbiddenHostCodePoint(asciiDomain)) { - return failure; - } - const ipv4Host = parseIPv4(asciiDomain); - if (typeof ipv4Host === "number" || ipv4Host === failure) { - return ipv4Host; - } - return asciiDomain; - } - function parseOpaqueHost(input2) { - if (containsForbiddenHostCodePointExcludingPercent(input2)) { - return failure; - } - let output = ""; - const decoded = punycode.ucs2.decode(input2); - for (let i2 = 0;i2 < decoded.length; ++i2) { - output += percentEncodeChar(decoded[i2], isC0ControlPercentEncode); - } - return output; - } - function findLongestZeroSequence(arr) { - let maxIdx = null; - let maxLen = 1; - let currStart = null; - let currLen = 0; - for (let i2 = 0;i2 < arr.length; ++i2) { - if (arr[i2] !== 0) { - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - currStart = null; - currLen = 0; - } else { - if (currStart === null) { - currStart = i2; - } - ++currLen; - } - } - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - return { - idx: maxIdx, - len: maxLen - }; - } - function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); - } - if (host instanceof Array) { - return "[" + serializeIPv6(host) + "]"; - } - return host; - } - function trimControlChars(url3) { - return url3.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); - } - function trimTabAndNewline(url3) { - return url3.replace(/\u0009|\u000A|\u000D/g, ""); - } - function shortenPath(url3) { - const path11 = url3.path; - if (path11.length === 0) { - return; - } - if (url3.scheme === "file" && path11.length === 1 && isNormalizedWindowsDriveLetter(path11[0])) { - return; - } - path11.pop(); - } - function includesCredentials(url3) { - return url3.username !== "" || url3.password !== ""; - } - function cannotHaveAUsernamePasswordPort(url3) { - return url3.host === null || url3.host === "" || url3.cannotBeABaseURL || url3.scheme === "file"; - } - function isNormalizedWindowsDriveLetter(string4) { - return /^[A-Za-z]:$/.test(string4); - } - function URLStateMachine(input2, base2, encodingOverride, url3, stateOverride) { - this.pointer = 0; - this.input = input2; - this.base = base2 || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url3; - 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; - } - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - 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 c5 = this.input[this.pointer]; - const cStr = isNaN(c5) ? undefined : String.fromCodePoint(c5); - const ret = this["parse " + this.state](c5, cStr); - if (!ret) { - break; - } else if (ret === failure) { - this.failure = true; - break; - } - } - } - URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c5, cStr) { - if (isASCIIAlpha(c5)) { - 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(c5, cStr) { - if (isASCIIAlphanumeric(c5) || c5 === 43 || c5 === 45 || c5 === 46) { - this.buffer += cStr.toLowerCase(); - } else if (c5 === 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; - } - } - 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; - } - return true; - }; - URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c5) { - if (this.base === null || this.base.cannotBeABaseURL && c5 !== 35) { - return failure; - } else if (this.base.cannotBeABaseURL && c5 === 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; - }; - URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c5) { - if (c5 === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c5) { - if (c5 === 47) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse relative"] = function parseRelative(c5) { - this.url.scheme = this.base.scheme; - if (isNaN(c5)) { - 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 (c5 === 47) { - this.state = "relative slash"; - } else if (c5 === 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 (c5 === 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) && c5 === 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; - } - return true; - }; - URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c5) { - if (isSpecial(this.url) && (c5 === 47 || c5 === 92)) { - if (c5 === 92) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c5 === 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; - }; - URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c5) { - if (c5 === 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; - }; - URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c5) { - if (c5 !== 47 && c5 !== 92) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; - } - return true; - }; - URLStateMachine.prototype["parse authority"] = function parseAuthority(c5, cStr) { - if (c5 === 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(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 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; - } - return true; - }; - URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c5, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c5 === 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(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 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 (c5 === 91) { - this.arrFlag = true; - } else if (c5 === 93) { - this.arrFlag = false; - } - this.buffer += cStr; - } - return true; - }; - URLStateMachine.prototype["parse port"] = function parsePort(c5, cStr) { - if (isASCIIDigit(c5)) { - this.buffer += cStr; - } else if (isNaN(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 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; - } - return true; - }; - var fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); - URLStateMachine.prototype["parse file"] = function parseFile(c5) { - this.url.scheme = "file"; - if (c5 === 47 || c5 === 92) { - if (c5 === 92) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c5)) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c5 === 63) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c5 === 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 || !isWindowsDriveLetterCodePoints(c5, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && !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; - } - return true; - }; - URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c5) { - if (c5 === 47 || c5 === 92) { - if (c5 === 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; - } - return true; - }; - URLStateMachine.prototype["parse file host"] = function parseFileHost(c5, cStr) { - if (isNaN(c5) || c5 === 47 || c5 === 92 || c5 === 63 || c5 === 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; - } - return true; - }; - URLStateMachine.prototype["parse path start"] = function parsePathStart(c5) { - if (isSpecial(this.url)) { - if (c5 === 92) { - this.parseError = true; - } - this.state = "path"; - if (c5 !== 47 && c5 !== 92) { - --this.pointer; - } - } else if (!this.stateOverride && c5 === 63) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c5 === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c5 !== undefined) { - this.state = "path"; - if (c5 !== 47) { - --this.pointer; - } - } - return true; - }; - URLStateMachine.prototype["parse path"] = function parsePath(c5) { - if (isNaN(c5) || c5 === 47 || isSpecial(this.url) && c5 === 92 || !this.stateOverride && (c5 === 63 || c5 === 35)) { - if (isSpecial(this.url) && c5 === 92) { - this.parseError = true; - } - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c5 !== 47 && !(isSpecial(this.url) && c5 === 92)) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c5 !== 47 && !(isSpecial(this.url) && c5 === 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); - } - this.buffer = ""; - if (this.url.scheme === "file" && (c5 === undefined || c5 === 63 || c5 === 35)) { - while (this.url.path.length > 1 && this.url.path[0] === "") { - this.parseError = true; - this.url.path.shift(); - } - } - if (c5 === 63) { - this.url.query = ""; - this.state = "query"; - } - if (c5 === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.buffer += percentEncodeChar(c5, isPathPercentEncode); - } - return true; - }; - URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c5) { - if (c5 === 63) { - this.url.query = ""; - this.state = "query"; - } else if (c5 === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (!isNaN(c5) && c5 !== 37) { - this.parseError = true; - } - if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - if (!isNaN(c5)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c5, isC0ControlPercentEncode); - } - } - return true; - }; - URLStateMachine.prototype["parse query"] = function parseQuery(c5, cStr) { - if (isNaN(c5) || !this.stateOverride && c5 === 35) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } - const buffer = new Buffer(this.buffer); - for (let i2 = 0;i2 < buffer.length; ++i2) { - if (buffer[i2] < 33 || buffer[i2] > 126 || buffer[i2] === 34 || buffer[i2] === 35 || buffer[i2] === 60 || buffer[i2] === 62) { - this.url.query += percentEncode(buffer[i2]); - } else { - this.url.query += String.fromCodePoint(buffer[i2]); - } - } - this.buffer = ""; - if (c5 === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.buffer += cStr; - } - return true; - }; - URLStateMachine.prototype["parse fragment"] = function parseFragment(c5) { - if (isNaN(c5)) {} else if (c5 === 0) { - this.parseError = true; - } else { - if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.url.fragment += percentEncodeChar(c5, isC0ControlPercentEncode); - } - return true; - }; - function serializeURL(url3, excludeFragment) { - let output = url3.scheme + ":"; - if (url3.host !== null) { - output += "//"; - if (url3.username !== "" || url3.password !== "") { - output += url3.username; - if (url3.password !== "") { - output += ":" + url3.password; - } - output += "@"; - } - output += serializeHost(url3.host); - if (url3.port !== null) { - output += ":" + url3.port; - } - } else if (url3.host === null && url3.scheme === "file") { - output += "//"; - } - if (url3.cannotBeABaseURL) { - output += url3.path[0]; - } else { - for (const string4 of url3.path) { - output += "/" + string4; - } - } - if (url3.query !== null) { - output += "?" + url3.query; - } - if (!excludeFragment && url3.fragment !== null) { - output += "#" + url3.fragment; - } - return output; - } - function serializeOrigin(tuple2) { - let result2 = tuple2.scheme + "://"; - result2 += serializeHost(tuple2.host); - if (tuple2.port !== null) { - result2 += ":" + tuple2.port; - } - return result2; - } - exports.serializeURL = serializeURL; - exports.serializeURLOrigin = function(url3) { - switch (url3.scheme) { - case "blob": - try { - return exports.serializeURLOrigin(exports.parseURL(url3.path[0])); - } catch (e) { - return "null"; - } - case "ftp": - case "gopher": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url3.scheme, - host: url3.host, - port: url3.port - }); - case "file": - return "file://"; - default: - return "null"; - } - }; - exports.basicURLParse = function(input2, options) { - if (options === undefined) { - options = {}; - } - const usm = new URLStateMachine(input2, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return "failure"; - } - return usm.url; - }; - exports.setTheUsername = function(url3, username) { - url3.username = ""; - const decoded = punycode.ucs2.decode(username); - for (let i2 = 0;i2 < decoded.length; ++i2) { - url3.username += percentEncodeChar(decoded[i2], isUserinfoPercentEncode); - } - }; - exports.setThePassword = function(url3, password) { - url3.password = ""; - const decoded = punycode.ucs2.decode(password); - for (let i2 = 0;i2 < decoded.length; ++i2) { - url3.password += percentEncodeChar(decoded[i2], isUserinfoPercentEncode); - } - }; - exports.serializeHost = serializeHost; - exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; - exports.serializeInteger = function(integer2) { - return String(integer2); - }; - exports.parseURL = function(input2, options) { - if (options === undefined) { - options = {}; - } - return exports.basicURLParse(input2, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); - }; -}); - -// node_modules/whatwg-url/lib/URL-impl.js -var require_URL_impl2 = __commonJS((exports) => { - var usm = require_url_state_machine2(); - exports.implementation = class URLImpl { - constructor(constructorArgs) { - const url3 = constructorArgs[0]; - const base2 = constructorArgs[1]; - let parsedBase = null; - if (base2 !== undefined) { - parsedBase = usm.basicURLParse(base2); - if (parsedBase === "failure") { - throw new TypeError("Invalid base URL"); - } - } - const parsedURL = usm.basicURLParse(url3, { baseURL: parsedBase }); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - this._url = parsedURL; - } - get href() { - return usm.serializeURL(this._url); - } - set href(v) { - const parsedURL = usm.basicURLParse(v); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - this._url = parsedURL; - } - get origin() { - return usm.serializeURLOrigin(this._url); - } - get protocol() { - return this._url.scheme + ":"; - } - set protocol(v) { - usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" }); - } - get username() { - return this._url.username; - } - set username(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - usm.setTheUsername(this._url, v); - } - get password() { - return this._url.password; - } - set password(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - usm.setThePassword(this._url, v); - } - get host() { - const url3 = this._url; - if (url3.host === null) { - return ""; - } - if (url3.port === null) { - return usm.serializeHost(url3.host); - } - return usm.serializeHost(url3.host) + ":" + usm.serializeInteger(url3.port); - } - set host(v) { - if (this._url.cannotBeABaseURL) { - return; - } - usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); - } - get hostname() { - if (this._url.host === null) { - return ""; - } - return usm.serializeHost(this._url.host); - } - set hostname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); - } - get port() { - if (this._url.port === null) { - return ""; - } - return usm.serializeInteger(this._url.port); - } - set port(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - if (v === "") { - this._url.port = null; - } else { - usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); - } - } - get pathname() { - if (this._url.cannotBeABaseURL) { - return this._url.path[0]; - } - if (this._url.path.length === 0) { - return ""; - } - return "/" + this._url.path.join("/"); - } - set pathname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - this._url.path = []; - usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); - } - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; - } - return "?" + this._url.query; - } - set search(v) { - const url3 = this._url; - if (v === "") { - url3.query = null; - return; - } - const input2 = v[0] === "?" ? v.substring(1) : v; - url3.query = ""; - usm.basicURLParse(input2, { url: url3, stateOverride: "query" }); - } - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; - } - return "#" + this._url.fragment; - } - set hash(v) { - if (v === "") { - this._url.fragment = null; - return; - } - const input2 = v[0] === "#" ? v.substring(1) : v; - this._url.fragment = ""; - usm.basicURLParse(input2, { url: this._url, stateOverride: "fragment" }); - } - toJSON() { - return this.href; - } - }; -}); - -// node_modules/whatwg-url/lib/URL.js -var require_URL2 = __commonJS((exports, module) => { - var conversions = require_lib3(); - var utils = require_utils3(); - var Impl = require_URL_impl2(); - var impl = utils.implSymbol; - function URL2(url3) { - if (!this || this[impl] || !(this instanceof URL2)) { - 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 i2 = 0;i2 < arguments.length && i2 < 2; ++i2) { - args[i2] = arguments[i2]; - } - args[0] = conversions["USVString"](args[0]); - if (args[1] !== undefined) { - args[1] = conversions["USVString"](args[1]); - } - module.exports.setup(this, args); - } - URL2.prototype.toJSON = function toJSON() { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - const args = []; - for (let i2 = 0;i2 < arguments.length && i2 < 0; ++i2) { - args[i2] = arguments[i2]; - } - return this[impl].toJSON.apply(this[impl], args); - }; - Object.defineProperty(URL2.prototype, "href", { - get() { - return this[impl].href; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].href = V; - }, - enumerable: true, - configurable: true - }); - URL2.prototype.toString = function() { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - return this.href; - }; - Object.defineProperty(URL2.prototype, "origin", { - get() { - return this[impl].origin; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "protocol", { - get() { - return this[impl].protocol; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].protocol = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "username", { - get() { - return this[impl].username; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].username = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "password", { - get() { - return this[impl].password; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].password = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "host", { - get() { - return this[impl].host; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].host = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "hostname", { - get() { - return this[impl].hostname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hostname = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "port", { - get() { - return this[impl].port; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].port = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "pathname", { - get() { - return this[impl].pathname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].pathname = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "search", { - get() { - return this[impl].search; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].search = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL2.prototype, "hash", { - get() { - return this[impl].hash; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hash = V; - }, - enumerable: true, - configurable: true - }); - module.exports = { - is(obj) { - return !!obj && obj[impl] instanceof Impl.implementation; - }, - create(constructorArgs, privateData) { - let obj = Object.create(URL2.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: URL2, - expose: { - Window: { URL: URL2 }, - Worker: { URL: URL2 } - } - }; -}); - -// node_modules/whatwg-url/lib/public-api.js -var require_public_api2 = __commonJS((exports) => { - exports.URL = require_URL2().interface; - exports.serializeURL = require_url_state_machine2().serializeURL; - exports.serializeURLOrigin = require_url_state_machine2().serializeURLOrigin; - exports.basicURLParse = require_url_state_machine2().basicURLParse; - exports.setTheUsername = require_url_state_machine2().setTheUsername; - exports.setThePassword = require_url_state_machine2().setThePassword; - exports.serializeHost = require_url_state_machine2().serializeHost; - exports.serializeInteger = require_url_state_machine2().serializeInteger; - exports.parseURL = require_url_state_machine2().parseURL; -}); - -// node_modules/node-fetch/lib/index.js -var require_lib4 = __commonJS((exports, module) => { - Object.defineProperty(exports, "__esModule", { value: true }); - function _interopDefault(ex) { - return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; - } - var Stream4 = _interopDefault(__require("stream")); - var http3 = _interopDefault(__require("http")); - var Url = _interopDefault(__require("url")); - var whatwgUrl = _interopDefault(require_public_api2()); - var https2 = _interopDefault(__require("https")); - var zlib2 = _interopDefault(__require("zlib")); - var Readable5 = Stream4.Readable; - var BUFFER = Symbol("buffer"); - var TYPE = Symbol("type"); - - class Blob2 { - constructor() { - this[TYPE] = ""; - const blobParts = arguments[0]; - const options = arguments[1]; - const buffers = []; - let size2 = 0; - if (blobParts) { - const a2 = blobParts; - const length = Number(a2.length); - for (let i2 = 0;i2 < length; i2++) { - const element = a2[i2]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob2) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === "string" ? element : String(element)); - } - size2 += buffer.length; - buffers.push(buffer); - } - } - this[BUFFER] = Buffer.concat(buffers); - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable2 = new Readable5; - readable2._read = function() {}; - readable2.push(this[BUFFER]); - readable2.push(null); - return readable2; - } - toString() { - return "[object Blob]"; - } - slice() { - const size2 = this.size; - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size2 + start, 0); - } else { - relativeStart = Math.min(start, size2); - } - if (end === undefined) { - relativeEnd = size2; - } else if (end < 0) { - relativeEnd = Math.max(size2 + end, 0); - } else { - relativeEnd = Math.min(end, size2); - } - const span = Math.max(relativeEnd - relativeStart, 0); - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob2([], { type: arguments[2] }); - blob[BUFFER] = 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 - }); - 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); - } - FetchError.prototype = Object.create(Error.prototype); - FetchError.prototype.constructor = FetchError; - FetchError.prototype.name = "FetchError"; - var convert; - try { - convert = (()=>{throw new Error("Cannot require module "+"encoding");})().convert; - } catch (e) {} - var INTERNALS = Symbol("Body internals"); - var PassThrough2 = Stream4.PassThrough; - function Body(body) { - var _this = this; - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$size = _ref.size; - let size2 = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - if (body == null) { - body = null; - } else if (isURLSearchParams2(body)) { - body = Buffer.from(body.toString()); - } else if (isBlob2(body)) - ; - else if (Buffer.isBuffer(body)) - ; - else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") { - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream4) - ; - else { - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size2; - this.timeout = timeout; - if (body instanceof Stream4) { - body.on("error", function(err) { - const error45 = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); - _this[INTERNALS].error = error45; - }); - } - } - Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - arrayBuffer() { - return consumeBody.call(this).then(function(buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - blob() { - let ct = this.headers && this.headers.get("content-type") || ""; - return consumeBody.call(this).then(function(buf) { - return Object.assign(new Blob2([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - json() { - var _this2 = this; - return consumeBody.call(this).then(function(buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); - } - }); - }, - text() { - return consumeBody.call(this).then(function(buffer) { - return buffer.toString(); - }); - }, - buffer() { - return consumeBody.call(this); - }, - textConverted() { - var _this3 = this; - return consumeBody.call(this).then(function(buffer) { - return convertBody(buffer, _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(proto2) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - if (!(name in proto2)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto2, name, desc); - } - } - }; - 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 body = this.body; - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - if (isBlob2(body)) { - body = body.stream(); - } - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - if (!(body instanceof Stream4)) { - 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); - } - body.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)); - } - }); - body.on("data", function(chunk2) { - if (abort || chunk2 === null) { - return; - } - if (_this4.size && accumBytes + chunk2.length > _this4.size) { - abort = true; - reject2(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); - return; - } - accumBytes += chunk2.length; - accum.push(chunk2); - }); - body.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(buffer, headers) { - if (typeof convert !== "function") { - throw new Error("The package `encoding` must be installed to use the textConverted() function"); - } - const ct = headers.get("content-type"); - let charset = "utf-8"; - let res, str; - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - str = buffer.slice(0, 1024).toString(); - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - this[MAP] = Object.create(null); - if (init instanceof Headers2) { - 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 method2 = init[Symbol.iterator]; - if (method2 != null) { - if (typeof method2 !== "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"); - } - } - get(name) { - name = `${name}`; - validateName(name); - const key = find2(this[MAP], name); - if (key === undefined) { - return null; - } - return this[MAP][key].join(", "); - } - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - let pairs = getHeaders(this); - let i2 = 0; - while (i2 < pairs.length) { - var _pairs$i = pairs[i2]; - const name = _pairs$i[0], value = _pairs$i[1]; - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i2++; - } - } - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find2(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find2(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - has(name) { - name = `${name}`; - validateName(name); - return find2(this[MAP], name) !== undefined; - } - delete(name) { - name = `${name}`; - validateName(name); - const key = find2(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - raw() { - return this[MAP]; - } - keys() { - return createHeadersIterator(this, "key"); - } - values() { - return createHeadersIterator(this, "value"); - } - [Symbol.iterator]() { - return createHeadersIterator(this, "key+value"); - } - } - Headers2.prototype.entries = Headers2.prototype[Symbol.iterator]; - Object.defineProperty(Headers2.prototype, Symbol.toStringTag, { - value: "Headers", - writable: false, - enumerable: false, - configurable: true - }); - Object.defineProperties(Headers2.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 } - }); - function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "key+value"; - const keys2 = Object.keys(headers[MAP]).sort(); - return keys2.map(kind === "key" ? function(k) { - return k.toLowerCase(); - } : kind === "value" ? function(k) { - return headers[MAP][k].join(", "); - } : function(k) { - return [k.toLowerCase(), headers[MAP][k].join(", ")]; - }); - } - var INTERNAL = Symbol("internal"); - function createHeadersIterator(target, kind) { - const iterator2 = Object.create(HeadersIteratorPrototype); - iterator2[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator2; - } - var 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, kind, index } = _INTERNAL; - const values3 = getHeaders(target, kind); - const len = values3.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - this[INTERNAL].index = index + 1; - return { - value: values3[index], - done: false - }; - } - }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: "HeadersIterator", - writable: false, - enumerable: false, - configurable: true - }); - function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - const hostHeaderKey = find2(headers[MAP], "Host"); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - return obj; - } - function createHeadersLenient(obj) { - const headers = new Headers2; - 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] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; - } - var INTERNALS$1 = Symbol("Response internals"); - var STATUS_CODES = http3.STATUS_CODES; - - class Response2 { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - Body.call(this, body, opts); - const status = opts.status || 200; - const headers = new Headers2(opts.headers); - if (body != null && !headers.has("Content-Type")) { - const contentType = extractContentType(body); - if (contentType) { - headers.append("Content-Type", contentType); - } - } - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - get url() { - return this[INTERNALS$1].url || ""; - } - get status() { - return this[INTERNALS$1].status; - } - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - get redirected() { - return this[INTERNALS$1].counter > 0; - } - get statusText() { - return this[INTERNALS$1].statusText; - } - get headers() { - return this[INTERNALS$1].headers; - } - clone() { - return new Response2(clone4(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 - }); - var INTERNALS$2 = Symbol("Request internals"); - var URL2 = Url.URL || whatwgUrl.URL; - var parse_url = Url.parse; - var format_url = Url.format; - function parseURL(urlStr) { - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL2(urlStr).toString(); - } - return parse_url(urlStr); - } - var streamDestructionSupported = "destroy" in Stream4.Readable.prototype; - function isRequest2(input2) { - return typeof input2 === "object" && typeof input2[INTERNALS$2] === "object"; - } - function isAbortSignal(signal) { - const proto2 = signal && typeof signal === "object" && Object.getPrototypeOf(signal); - return !!(proto2 && proto2.constructor.name === "AbortSignal"); - } - - class Request2 { - constructor(input2) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let parsedURL; - if (!isRequest2(input2)) { - if (input2 && input2.href) { - parsedURL = parseURL(input2.href); - } else { - parsedURL = parseURL(`${input2}`); - } - input2 = {}; - } else { - parsedURL = parseURL(input2.url); - } - let method2 = init.method || input2.method || "GET"; - method2 = method2.toUpperCase(); - if ((init.body != null || isRequest2(input2) && input2.body !== null) && (method2 === "GET" || method2 === "HEAD")) { - throw new TypeError("Request with GET/HEAD method cannot have body"); - } - let inputBody = init.body != null ? init.body : isRequest2(input2) && input2.body !== null ? clone4(input2) : null; - Body.call(this, inputBody, { - timeout: init.timeout || input2.timeout || 0, - size: init.size || input2.size || 0 - }); - const headers = new Headers2(init.headers || input2.headers || {}); - if (inputBody != null && !headers.has("Content-Type")) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append("Content-Type", contentType); - } - } - let signal = isRequest2(input2) ? input2.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: method2, - redirect: init.redirect || input2.redirect || "follow", - headers, - parsedURL, - signal - }; - this.follow = init.follow !== undefined ? init.follow : input2.follow !== undefined ? input2.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input2.compress !== undefined ? input2.compress : true; - this.counter = init.counter || input2.counter || 0; - this.agent = init.agent || input2.agent; - } - 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() { - return new Request2(this); - } - } - 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 } - }); - function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers2(request[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 (request.signal && request.body instanceof Stream4.Readable && !streamDestructionSupported) { - throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); - } - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = "0"; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - 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 (request.compress && !headers.has("Accept-Encoding")) { - headers.set("Accept-Encoding", "gzip,deflate"); - } - let agent = request.agent; - if (typeof agent === "function") { - agent = agent(parsedURL); - } - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); - } - function AbortError2(message) { - Error.call(this, message); - this.type = "aborted"; - this.message = message; - Error.captureStackTrace(this, this.constructor); - } - AbortError2.prototype = Object.create(Error.prototype); - AbortError2.prototype.constructor = AbortError2; - AbortError2.prototype.name = "AbortError"; - var URL$1 = Url.URL || whatwgUrl.URL; - var PassThrough$1 = Stream4.PassThrough; - var isDomainOrSubdomain = function isDomainOrSubdomain(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); - }; - var isSameProtocol = function isSameProtocol(destination, original) { - const orig = new URL$1(original).protocol; - const dest = new URL$1(destination).protocol; - return orig === dest; - }; - function fetch2(url3, opts) { - if (!fetch2.Promise) { - throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); - } - Body.Promise = fetch2.Promise; - return new fetch2.Promise(function(resolve8, reject2) { - const request = new Request2(url3, opts); - const options = getNodeRequestOptions(request); - const send = (options.protocol === "https:" ? https2 : http3).request; - const signal = request.signal; - let response = null; - const abort = function abort() { - let error45 = new AbortError2("The user aborted a request."); - reject2(error45); - if (request.body && request.body instanceof Stream4.Readable) { - destroyStream(request.body, error45); - } - if (!response || !response.body) - return; - response.body.emit("error", error45); - }; - if (signal && signal.aborted) { - abort(); - return; - } - const abortAndFinalize = function abortAndFinalize() { - 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 (request.timeout) { - req.once("socket", function(socket) { - reqTimeout = setTimeout(function() { - reject2(new FetchError(`network timeout at: ${request.url}`, "request-timeout")); - finalize(); - }, request.timeout); - }); - } - req.on("error", function(err) { - reject2(new FetchError(`request to ${request.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 (fetch2.isRedirect(res.statusCode)) { - const location = headers.get("Location"); - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - if (request.redirect !== "manual") { - reject2(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect")); - finalize(); - return; - } - } - switch (request.redirect) { - case "error": - reject2(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.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 (request.counter >= request.follow) { - reject2(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")); - finalize(); - return; - } - const requestOpts = { - headers: new Headers2(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { - for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) { - requestOpts.headers.delete(name); - } - } - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === 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) && request.method === "POST") { - requestOpts.method = "GET"; - requestOpts.body = undefined; - requestOpts.headers.delete("content-length"); - } - resolve8(fetch2(new Request2(locationURL, requestOpts))); - finalize(); - return; - } - } - res.once("end", function() { - if (signal) - signal.removeEventListener("abort", abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1); - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - const codings = headers.get("Content-Encoding"); - if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response2(body, response_options); - resolve8(response); - return; - } - const zlibOptions2 = { - flush: zlib2.Z_SYNC_FLUSH, - finishFlush: zlib2.Z_SYNC_FLUSH - }; - if (codings == "gzip" || codings == "x-gzip") { - body = body.pipe(zlib2.createGunzip(zlibOptions2)); - response = new Response2(body, response_options); - resolve8(response); - return; - } - if (codings == "deflate" || codings == "x-deflate") { - const raw = res.pipe(new PassThrough$1); - raw.once("data", function(chunk2) { - if ((chunk2[0] & 15) === 8) { - body = body.pipe(zlib2.createInflate()); - } else { - body = body.pipe(zlib2.createInflateRaw()); - } - response = new Response2(body, response_options); - resolve8(response); - }); - raw.on("end", function() { - if (!response) { - response = new Response2(body, response_options); - resolve8(response); - } - }); - return; - } - if (codings == "br" && typeof zlib2.createBrotliDecompress === "function") { - body = body.pipe(zlib2.createBrotliDecompress()); - response = new Response2(body, response_options); - resolve8(response); - return; - } - response = new Response2(body, response_options); - resolve8(response); - }); - writeToStream(req, request); - }); - } - function fixResponseChunkedTransferBadEnding(request, errorCallback) { - let socket; - request.on("socket", function(s) { - socket = s; - }); - request.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(stream4, err) { - if (stream4.destroy) { - stream4.destroy(err); - } else { - stream4.emit("error", err); - stream4.end(); - } - } - fetch2.isRedirect = function(code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; - }; - fetch2.Promise = global.Promise; - module.exports = exports = fetch2; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.default = exports; - exports.Headers = Headers2; - exports.Request = Request2; - exports.Response = Response2; - exports.FetchError = FetchError; - exports.AbortError = AbortError2; -}); - -// node_modules/gaxios/node_modules/is-stream/index.js -var require_is_stream2 = __commonJS((exports, module) => { - var isStream3 = (stream4) => stream4 !== null && typeof stream4 === "object" && typeof stream4.pipe === "function"; - isStream3.writable = (stream4) => isStream3(stream4) && stream4.writable !== false && typeof stream4._write === "function" && typeof stream4._writableState === "object"; - isStream3.readable = (stream4) => isStream3(stream4) && stream4.readable !== false && typeof stream4._read === "function" && typeof stream4._readableState === "object"; - isStream3.duplex = (stream4) => isStream3.writable(stream4) && isStream3.readable(stream4); - isStream3.transform = (stream4) => isStream3.duplex(stream4) && typeof stream4._transform === "function"; - module.exports = isStream3; -}); - -// node_modules/gaxios/package.json -var require_package10 = __commonJS((exports, module) => { - module.exports = { - name: "gaxios", - version: "6.7.1", - description: "A simple common HTTP client specifically for Google APIs and services.", - main: "build/src/index.js", - types: "build/src/index.d.ts", - files: [ - "build/src" - ], - scripts: { - lint: "gts check", - test: "c8 mocha build/test", - "presystem-test": "npm run compile", - "system-test": "mocha build/system-test --timeout 80000", - compile: "tsc -p .", - fix: "gts fix", - prepare: "npm run compile", - pretest: "npm run compile", - webpack: "webpack", - "prebrowser-test": "npm run compile", - "browser-test": "node build/browser-test/browser-test-runner.js", - docs: "compodoc src/", - "docs-test": "linkinator docs", - "predocs-test": "npm run docs", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - prelint: "cd samples; npm link ../; npm install", - clean: "gts clean", - precompile: "gts clean" - }, - repository: "googleapis/gaxios", - keywords: [ - "google" - ], - engines: { - node: ">=14" - }, - author: "Google, LLC", - license: "Apache-2.0", - devDependencies: { - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@compodoc/compodoc": "1.1.19", - "@types/cors": "^2.8.6", - "@types/express": "^4.16.1", - "@types/extend": "^3.0.1", - "@types/mocha": "^9.0.0", - "@types/multiparty": "0.0.36", - "@types/mv": "^2.1.0", - "@types/ncp": "^2.0.1", - "@types/node": "^20.0.0", - "@types/node-fetch": "^2.5.7", - "@types/sinon": "^17.0.0", - "@types/tmp": "0.2.6", - "@types/uuid": "^10.0.0", - "abort-controller": "^3.0.0", - assert: "^2.0.0", - browserify: "^17.0.0", - c8: "^8.0.0", - cheerio: "1.0.0-rc.10", - cors: "^2.8.5", - execa: "^5.0.0", - express: "^4.16.4", - "form-data": "^4.0.0", - gts: "^5.0.0", - "is-docker": "^2.0.0", - karma: "^6.0.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-firefox-launcher": "^2.0.0", - "karma-mocha": "^2.0.0", - "karma-remap-coverage": "^0.1.5", - "karma-sourcemap-loader": "^0.4.0", - "karma-webpack": "5.0.0", - linkinator: "^3.0.0", - mocha: "^8.0.0", - multiparty: "^4.2.1", - mv: "^2.1.1", - ncp: "^2.0.0", - nock: "^13.0.0", - "null-loader": "^4.0.0", - puppeteer: "^19.0.0", - sinon: "^18.0.0", - "stream-browserify": "^3.0.0", - tmp: "0.2.3", - "ts-loader": "^8.0.0", - typescript: "^5.1.6", - webpack: "^5.35.0", - "webpack-cli": "^4.0.0" - }, - dependencies: { - extend: "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9", - uuid: "^9.0.1" - } - }; -}); - -// node_modules/gaxios/build/src/util.js -var require_util9 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.pkg = undefined; - exports.pkg = require_package10(); -}); - -// node_modules/gaxios/build/src/common.js -var require_common4 = __commonJS((exports) => { - var __importDefault = exports && exports.__importDefault || function(mod2) { - return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; - }; - var _a3; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GaxiosError = exports.GAXIOS_ERROR_SYMBOL = undefined; - exports.defaultErrorRedactor = defaultErrorRedactor; - var url_1 = __require("url"); - var util_1 = require_util9(); - var extend_1 = __importDefault(require_extend2()); - exports.GAXIOS_ERROR_SYMBOL = Symbol.for(`${util_1.pkg.name}-gaxios-error`); - - class GaxiosError extends Error { - static [(_a3 = exports.GAXIOS_ERROR_SYMBOL, Symbol.hasInstance)](instance) { - if (instance && typeof instance === "object" && exports.GAXIOS_ERROR_SYMBOL in instance && instance[exports.GAXIOS_ERROR_SYMBOL] === util_1.pkg.version) { - return true; - } - return Function.prototype[Symbol.hasInstance].call(GaxiosError, instance); - } - constructor(message, config2, response, error45) { - var _b; - super(message); - this.config = config2; - this.response = response; - this.error = error45; - this[_a3] = util_1.pkg.version; - this.config = (0, extend_1.default)(true, {}, config2); - if (this.response) { - this.response.config = (0, extend_1.default)(true, {}, this.response.config); - } - if (this.response) { - try { - this.response.data = translateData(this.config.responseType, (_b = this.response) === null || _b === undefined ? undefined : _b.data); - } catch (_c) {} - this.status = this.response.status; - } - if (error45 && "code" in error45 && error45.code) { - this.code = error45.code; - } - if (config2.errorRedactor) { - config2.errorRedactor({ - config: this.config, - response: this.response - }); - } - } - } - exports.GaxiosError = GaxiosError; - function translateData(responseType, data) { - switch (responseType) { - case "stream": - return data; - case "json": - return JSON.parse(JSON.stringify(data)); - case "arraybuffer": - return JSON.parse(Buffer.from(data).toString("utf8")); - case "blob": - return JSON.parse(data.text()); - default: - return data; - } - } - function defaultErrorRedactor(data) { - const REDACT = "< - See `errorRedactor` option in `gaxios` for configuration>."; - function redactHeaders(headers) { - if (!headers) - return; - for (const key of Object.keys(headers)) { - if (/^authentication$/i.test(key)) { - headers[key] = REDACT; - } - if (/^authorization$/i.test(key)) { - headers[key] = REDACT; - } - if (/secret/i.test(key)) { - headers[key] = REDACT; - } - } - } - function redactString(obj, key) { - if (typeof obj === "object" && obj !== null && typeof obj[key] === "string") { - const text = obj[key]; - if (/grant_type=/i.test(text) || /assertion=/i.test(text) || /secret/i.test(text)) { - obj[key] = REDACT; - } - } - } - function redactObject(obj) { - if (typeof obj === "object" && obj !== null) { - if ("grant_type" in obj) { - obj["grant_type"] = REDACT; - } - if ("assertion" in obj) { - obj["assertion"] = REDACT; - } - if ("client_secret" in obj) { - obj["client_secret"] = REDACT; - } - } - } - if (data.config) { - redactHeaders(data.config.headers); - redactString(data.config, "data"); - redactObject(data.config.data); - redactString(data.config, "body"); - redactObject(data.config.body); - try { - const url3 = new url_1.URL("", data.config.url); - if (url3.searchParams.has("token")) { - url3.searchParams.set("token", REDACT); - } - if (url3.searchParams.has("client_secret")) { - url3.searchParams.set("client_secret", REDACT); - } - data.config.url = url3.toString(); - } catch (_b) {} - } - if (data.response) { - defaultErrorRedactor({ config: data.response.config }); - redactHeaders(data.response.headers); - redactString(data.response, "data"); - redactObject(data.response.data); - } - return data; - } -}); - -// node_modules/gaxios/build/src/retry.js -var require_retry3 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRetryConfig = getRetryConfig; - async function getRetryConfig(err) { - let config2 = getConfig(err); - if (!err || !err.config || !config2 && !err.config.retry) { - return { shouldRetry: false }; - } - config2 = config2 || {}; - config2.currentRetryAttempt = config2.currentRetryAttempt || 0; - config2.retry = config2.retry === undefined || config2.retry === null ? 3 : config2.retry; - config2.httpMethodsToRetry = config2.httpMethodsToRetry || [ - "GET", - "HEAD", - "PUT", - "OPTIONS", - "DELETE" - ]; - config2.noResponseRetries = config2.noResponseRetries === undefined || config2.noResponseRetries === null ? 2 : config2.noResponseRetries; - config2.retryDelayMultiplier = config2.retryDelayMultiplier ? config2.retryDelayMultiplier : 2; - config2.timeOfFirstRequest = config2.timeOfFirstRequest ? config2.timeOfFirstRequest : Date.now(); - config2.totalTimeout = config2.totalTimeout ? config2.totalTimeout : Number.MAX_SAFE_INTEGER; - config2.maxRetryDelay = config2.maxRetryDelay ? config2.maxRetryDelay : Number.MAX_SAFE_INTEGER; - const retryRanges = [ - [100, 199], - [408, 408], - [429, 429], - [500, 599] - ]; - config2.statusCodesToRetry = config2.statusCodesToRetry || retryRanges; - err.config.retryConfig = config2; - const shouldRetryFn = config2.shouldRetry || shouldRetryRequest; - if (!await shouldRetryFn(err)) { - return { shouldRetry: false, config: err.config }; - } - const delay2 = getNextRetryDelay(config2); - err.config.retryConfig.currentRetryAttempt += 1; - const backoff = config2.retryBackoff ? config2.retryBackoff(err, delay2) : new Promise((resolve8) => { - setTimeout(resolve8, delay2); - }); - if (config2.onRetryAttempt) { - config2.onRetryAttempt(err); - } - await backoff; - return { shouldRetry: true, config: err.config }; - } - function shouldRetryRequest(err) { - var _a3; - const config2 = getConfig(err); - if (err.name === "AbortError" || ((_a3 = err.error) === null || _a3 === undefined ? undefined : _a3.name) === "AbortError") { - return false; - } - if (!config2 || config2.retry === 0) { - return false; - } - if (!err.response && (config2.currentRetryAttempt || 0) >= config2.noResponseRetries) { - return false; - } - if (!err.config.method || config2.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) { - return false; - } - if (err.response && err.response.status) { - let isInRange2 = false; - for (const [min2, max2] of config2.statusCodesToRetry) { - const status = err.response.status; - if (status >= min2 && status <= max2) { - isInRange2 = true; - break; - } - } - if (!isInRange2) { - return false; - } - } - config2.currentRetryAttempt = config2.currentRetryAttempt || 0; - if (config2.currentRetryAttempt >= config2.retry) { - return false; - } - return true; - } - function getConfig(err) { - if (err && err.config && err.config.retryConfig) { - return err.config.retryConfig; - } - return; - } - function getNextRetryDelay(config2) { - var _a3; - const retryDelay = config2.currentRetryAttempt ? 0 : (_a3 = config2.retryDelay) !== null && _a3 !== undefined ? _a3 : 100; - const calculatedDelay = retryDelay + (Math.pow(config2.retryDelayMultiplier, config2.currentRetryAttempt) - 1) / 2 * 1000; - const maxAllowableDelay = config2.totalTimeout - (Date.now() - config2.timeOfFirstRequest); - return Math.min(calculatedDelay, maxAllowableDelay, config2.maxRetryDelay); - } -}); - -// node_modules/gaxios/node_modules/uuid/dist/rng.js -var require_rng2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = rng; - var _crypto = _interopRequireDefault(__require("crypto")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var rnds8Pool = new Uint8Array(256); - var poolPtr = rnds8Pool.length; - function rng() { - if (poolPtr > rnds8Pool.length - 16) { - _crypto.default.randomFillSync(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); - } -}); - -// node_modules/gaxios/node_modules/uuid/dist/regex.js -var require_regex2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _default3 = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/validate.js -var require_validate2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _regex2 = _interopRequireDefault(require_regex2()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function validate2(uuid5) { - return typeof uuid5 === "string" && _regex2.default.test(uuid5); - } - var _default3 = validate2; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/stringify.js -var require_stringify3 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - exports.unsafeStringify = unsafeStringify; - var _validate = _interopRequireDefault(require_validate2()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var byteToHex = []; - for (let i2 = 0;i2 < 256; ++i2) { - byteToHex.push((i2 + 256).toString(16).slice(1)); - } - function unsafeStringify(arr, offset = 0) { - return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; - } - function stringify(arr, offset = 0) { - const uuid5 = unsafeStringify(arr, offset); - if (!(0, _validate.default)(uuid5)) { - throw TypeError("Stringified UUID is invalid"); - } - return uuid5; - } - var _default3 = stringify; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/v1.js -var require_v12 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _rng = _interopRequireDefault(require_rng2()); - var _stringify = require_stringify3(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var _nodeId; - var _clockseq; - var _lastMSecs = 0; - var _lastNSecs = 0; - function v1(options, buf, offset) { - let i2 = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); - if (node == null) { - node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - if (clockseq == null) { - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; - } - } - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 16383; - } - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } - if (nsecs >= 1e4) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - msecs += 12219292800000; - const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; - b[i2++] = tl >>> 24 & 255; - b[i2++] = tl >>> 16 & 255; - b[i2++] = tl >>> 8 & 255; - b[i2++] = tl & 255; - const tmh = msecs / 4294967296 * 1e4 & 268435455; - b[i2++] = tmh >>> 8 & 255; - b[i2++] = tmh & 255; - b[i2++] = tmh >>> 24 & 15 | 16; - b[i2++] = tmh >>> 16 & 255; - b[i2++] = clockseq >>> 8 | 128; - b[i2++] = clockseq & 255; - for (let n2 = 0;n2 < 6; ++n2) { - b[i2 + n2] = node[n2]; - } - return buf || (0, _stringify.unsafeStringify)(b); - } - var _default3 = v1; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/parse.js -var require_parse5 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _validate = _interopRequireDefault(require_validate2()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function parse7(uuid5) { - if (!(0, _validate.default)(uuid5)) { - throw TypeError("Invalid UUID"); - } - let v; - const arr = new Uint8Array(16); - arr[0] = (v = parseInt(uuid5.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 255; - arr[2] = v >>> 8 & 255; - arr[3] = v & 255; - arr[4] = (v = parseInt(uuid5.slice(9, 13), 16)) >>> 8; - arr[5] = v & 255; - arr[6] = (v = parseInt(uuid5.slice(14, 18), 16)) >>> 8; - arr[7] = v & 255; - arr[8] = (v = parseInt(uuid5.slice(19, 23), 16)) >>> 8; - arr[9] = v & 255; - arr[10] = (v = parseInt(uuid5.slice(24, 36), 16)) / 1099511627776 & 255; - arr[11] = v / 4294967296 & 255; - arr[12] = v >>> 24 & 255; - arr[13] = v >>> 16 & 255; - arr[14] = v >>> 8 & 255; - arr[15] = v & 255; - return arr; - } - var _default3 = parse7; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/v35.js -var require_v352 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.URL = exports.DNS = undefined; - exports.default = v35; - var _stringify = require_stringify3(); - var _parse2 = _interopRequireDefault(require_parse5()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); - const bytes = []; - for (let i2 = 0;i2 < str.length; ++i2) { - bytes.push(str.charCodeAt(i2)); - } - return bytes; - } - var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; - exports.DNS = DNS; - var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - exports.URL = URL2; - function v35(name, version2, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - var _namespace; - if (typeof value === "string") { - value = stringToBytes(value); - } - if (typeof namespace === "string") { - namespace = (0, _parse2.default)(namespace); - } - if (((_namespace = namespace) === null || _namespace === undefined ? undefined : _namespace.length) !== 16) { - throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); - } - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 15 | version2; - bytes[8] = bytes[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i2 = 0;i2 < 16; ++i2) { - buf[offset + i2] = bytes[i2]; - } - return buf; - } - return (0, _stringify.unsafeStringify)(bytes); - } - try { - generateUUID.name = name; - } catch (err) {} - generateUUID.DNS = DNS; - generateUUID.URL = URL2; - return generateUUID; - } -}); - -// node_modules/gaxios/node_modules/uuid/dist/md5.js -var require_md52 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _crypto = _interopRequireDefault(__require("crypto")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return _crypto.default.createHash("md5").update(bytes).digest(); - } - var _default3 = md5; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/v3.js -var require_v32 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _v = _interopRequireDefault(require_v352()); - var _md = _interopRequireDefault(require_md52()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var v3 = (0, _v.default)("v3", 48, _md.default); - var _default3 = v3; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/native.js -var require_native2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _crypto = _interopRequireDefault(__require("crypto")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var _default3 = { - randomUUID: _crypto.default.randomUUID - }; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/v4.js -var require_v42 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _native = _interopRequireDefault(require_native2()); - var _rng = _interopRequireDefault(require_rng2()); - var _stringify = require_stringify3(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function v4(options, buf, offset) { - if (_native.default.randomUUID && !buf && !options) { - return _native.default.randomUUID(); - } - options = options || {}; - const rnds = options.random || (options.rng || _rng.default)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (let i2 = 0;i2 < 16; ++i2) { - buf[offset + i2] = rnds[i2]; - } - return buf; - } - return (0, _stringify.unsafeStringify)(rnds); - } - var _default3 = v4; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/sha1.js -var require_sha12 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _crypto = _interopRequireDefault(__require("crypto")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return _crypto.default.createHash("sha1").update(bytes).digest(); - } - var _default3 = sha1; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/v5.js -var require_v52 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _v = _interopRequireDefault(require_v352()); - var _sha = _interopRequireDefault(require_sha12()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - var v5 = (0, _v.default)("v5", 80, _sha.default); - var _default3 = v5; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/nil.js -var require_nil2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _default3 = "00000000-0000-0000-0000-000000000000"; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/version.js -var require_version2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = undefined; - var _validate = _interopRequireDefault(require_validate2()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function version2(uuid5) { - if (!(0, _validate.default)(uuid5)) { - throw TypeError("Invalid UUID"); - } - return parseInt(uuid5.slice(14, 15), 16); - } - var _default3 = version2; - exports.default = _default3; -}); - -// node_modules/gaxios/node_modules/uuid/dist/index.js -var require_dist7 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "NIL", { - enumerable: true, - get: function() { - return _nil.default; - } - }); - Object.defineProperty(exports, "parse", { - enumerable: true, - get: function() { - return _parse2.default; - } - }); - Object.defineProperty(exports, "stringify", { - enumerable: true, - get: function() { - return _stringify.default; - } - }); - Object.defineProperty(exports, "v1", { - enumerable: true, - get: function() { - return _v.default; - } - }); - Object.defineProperty(exports, "v3", { - enumerable: true, - get: function() { - return _v2.default; - } - }); - Object.defineProperty(exports, "v4", { - enumerable: true, - get: function() { - return _v3.default; - } - }); - Object.defineProperty(exports, "v5", { - enumerable: true, - get: function() { - return _v4.default; - } - }); - Object.defineProperty(exports, "validate", { - enumerable: true, - get: function() { - return _validate.default; - } - }); - Object.defineProperty(exports, "version", { - enumerable: true, - get: function() { - return _version.default; - } - }); - var _v = _interopRequireDefault(require_v12()); - var _v2 = _interopRequireDefault(require_v32()); - var _v3 = _interopRequireDefault(require_v42()); - var _v4 = _interopRequireDefault(require_v52()); - var _nil = _interopRequireDefault(require_nil2()); - var _version = _interopRequireDefault(require_version2()); - var _validate = _interopRequireDefault(require_validate2()); - var _stringify = _interopRequireDefault(require_stringify3()); - var _parse2 = _interopRequireDefault(require_parse5()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } -}); - -// node_modules/gaxios/build/src/interceptor.js -var require_interceptor2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GaxiosInterceptorManager = undefined; - - class GaxiosInterceptorManager extends Set { - } - exports.GaxiosInterceptorManager = GaxiosInterceptorManager; -}); - -// node_modules/gaxios/build/src/gaxios.js -var require_gaxios2 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - } : function(o2, v) { - o2["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result2 = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result2, mod2, k); - } - __setModuleDefault(result2, mod2); - return result2; - }; - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var __classPrivateFieldSet3 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; - }; - var __importDefault = exports && exports.__importDefault || function(mod2) { - return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; - }; - var _Gaxios_instances; - var _a3; - var _Gaxios_urlMayUseProxy; - var _Gaxios_applyRequestInterceptors; - var _Gaxios_applyResponseInterceptors; - var _Gaxios_prepareRequest; - var _Gaxios_proxyAgent; - var _Gaxios_getProxyAgent; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Gaxios = undefined; - var extend_1 = __importDefault(require_extend2()); - var https_1 = __require("https"); - var node_fetch_1 = __importDefault(require_lib4()); - var querystring_1 = __importDefault(__require("querystring")); - var is_stream_1 = __importDefault(require_is_stream2()); - var url_1 = __require("url"); - var common_1 = require_common4(); - var retry_1 = require_retry3(); - var stream_1 = __require("stream"); - var uuid_1 = require_dist7(); - var interceptor_1 = require_interceptor2(); - var fetch2 = hasFetch() ? window.fetch : node_fetch_1.default; - function hasWindow() { - return typeof window !== "undefined" && !!window; - } - function hasFetch() { - return hasWindow() && !!window.fetch; - } - function hasBuffer() { - return typeof Buffer !== "undefined"; - } - function hasHeader(options, header) { - return !!getHeader(options, header); - } - function getHeader(options, header) { - header = header.toLowerCase(); - for (const key of Object.keys((options === null || options === undefined ? undefined : options.headers) || {})) { - if (header === key.toLowerCase()) { - return options.headers[key]; - } - } - return; - } - - class Gaxios { - constructor(defaults3) { - _Gaxios_instances.add(this); - this.agentCache = new Map; - this.defaults = defaults3 || {}; - this.interceptors = { - request: new interceptor_1.GaxiosInterceptorManager, - response: new interceptor_1.GaxiosInterceptorManager - }; - } - async request(opts = {}) { - opts = await __classPrivateFieldGet3(this, _Gaxios_instances, "m", _Gaxios_prepareRequest).call(this, opts); - opts = await __classPrivateFieldGet3(this, _Gaxios_instances, "m", _Gaxios_applyRequestInterceptors).call(this, opts); - return __classPrivateFieldGet3(this, _Gaxios_instances, "m", _Gaxios_applyResponseInterceptors).call(this, this._request(opts)); - } - async _defaultAdapter(opts) { - const fetchImpl = opts.fetchImplementation || fetch2; - const res = await fetchImpl(opts.url, opts); - const data = await this.getResponseData(opts, res); - return this.translateResponse(opts, res, data); - } - async _request(opts = {}) { - var _b; - try { - let translatedResponse; - if (opts.adapter) { - translatedResponse = await opts.adapter(opts, this._defaultAdapter.bind(this)); - } else { - translatedResponse = await this._defaultAdapter(opts); - } - if (!opts.validateStatus(translatedResponse.status)) { - if (opts.responseType === "stream") { - let response = ""; - await new Promise((resolve8) => { - (translatedResponse === null || translatedResponse === undefined ? undefined : translatedResponse.data).on("data", (chunk2) => { - response += chunk2; - }); - (translatedResponse === null || translatedResponse === undefined ? undefined : translatedResponse.data).on("end", resolve8); - }); - translatedResponse.data = response; - } - throw new common_1.GaxiosError(`Request failed with status code ${translatedResponse.status}`, opts, translatedResponse); - } - return translatedResponse; - } catch (e) { - const err = e instanceof common_1.GaxiosError ? e : new common_1.GaxiosError(e.message, opts, undefined, e); - const { shouldRetry, config: config2 } = await (0, retry_1.getRetryConfig)(err); - if (shouldRetry && config2) { - err.config.retryConfig.currentRetryAttempt = config2.retryConfig.currentRetryAttempt; - opts.retryConfig = (_b = err.config) === null || _b === undefined ? undefined : _b.retryConfig; - return this._request(opts); - } - throw err; - } - } - async getResponseData(opts, res) { - switch (opts.responseType) { - case "stream": - return res.body; - case "json": { - let data = await res.text(); - try { - data = JSON.parse(data); - } catch (_b) {} - return data; - } - case "arraybuffer": - return res.arrayBuffer(); - case "blob": - return res.blob(); - case "text": - return res.text(); - default: - return this.getResponseDataFromContentType(res); - } - } - validateStatus(status) { - return status >= 200 && status < 300; - } - paramsSerializer(params) { - return querystring_1.default.stringify(params); - } - translateResponse(opts, res, data) { - const headers = {}; - res.headers.forEach((value, key) => { - headers[key] = value; - }); - return { - config: opts, - data, - headers, - status: res.status, - statusText: res.statusText, - request: { - responseURL: res.url - } - }; - } - async getResponseDataFromContentType(response) { - let contentType = response.headers.get("Content-Type"); - if (contentType === null) { - return response.text(); - } - contentType = contentType.toLowerCase(); - if (contentType.includes("application/json")) { - let data = await response.text(); - try { - data = JSON.parse(data); - } catch (_b) {} - return data; - } else if (contentType.match(/^text\//)) { - return response.text(); - } else { - return response.blob(); - } - } - async* getMultipartRequest(multipartOptions, boundary) { - const finale = `--${boundary}--`; - for (const currentPart of multipartOptions) { - const partContentType = currentPart.headers["Content-Type"] || "application/octet-stream"; - const preamble = `--${boundary}\r -Content-Type: ${partContentType}\r -\r -`; - yield preamble; - if (typeof currentPart.content === "string") { - yield currentPart.content; - } else { - yield* currentPart.content; - } - yield `\r -`; - } - yield finale; - } - } - exports.Gaxios = Gaxios; - _a3 = Gaxios, _Gaxios_instances = new WeakSet, _Gaxios_urlMayUseProxy = function _Gaxios_urlMayUseProxy(url3, noProxy = []) { - var _b, _c; - const candidate = new url_1.URL(url3); - const noProxyList = [...noProxy]; - const noProxyEnvList = ((_c = (_b = process.env.NO_PROXY) !== null && _b !== undefined ? _b : process.env.no_proxy) === null || _c === undefined ? undefined : _c.split(",")) || []; - for (const rule of noProxyEnvList) { - noProxyList.push(rule.trim()); - } - for (const rule of noProxyList) { - if (rule instanceof RegExp) { - if (rule.test(candidate.toString())) { - return false; - } - } else if (rule instanceof url_1.URL) { - if (rule.origin === candidate.origin) { - return false; - } - } else if (rule.startsWith("*.") || rule.startsWith(".")) { - const cleanedRule = rule.replace(/^\*\./, "."); - if (candidate.hostname.endsWith(cleanedRule)) { - return false; - } - } else if (rule === candidate.origin || rule === candidate.hostname || rule === candidate.href) { - return false; - } - } - return true; - }, _Gaxios_applyRequestInterceptors = async function _Gaxios_applyRequestInterceptors(options) { - let promiseChain = Promise.resolve(options); - for (const interceptor of this.interceptors.request.values()) { - if (interceptor) { - promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected); - } - } - return promiseChain; - }, _Gaxios_applyResponseInterceptors = async function _Gaxios_applyResponseInterceptors(response) { - let promiseChain = Promise.resolve(response); - for (const interceptor of this.interceptors.response.values()) { - if (interceptor) { - promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected); - } - } - return promiseChain; - }, _Gaxios_prepareRequest = async function _Gaxios_prepareRequest(options) { - var _b, _c, _d, _e; - const opts = (0, extend_1.default)(true, {}, this.defaults, options); - if (!opts.url) { - throw new Error("URL is required."); - } - const baseUrl = opts.baseUrl || opts.baseURL; - if (baseUrl) { - opts.url = baseUrl.toString() + opts.url; - } - opts.paramsSerializer = opts.paramsSerializer || this.paramsSerializer; - if (opts.params && Object.keys(opts.params).length > 0) { - let additionalQueryParams = opts.paramsSerializer(opts.params); - if (additionalQueryParams.startsWith("?")) { - additionalQueryParams = additionalQueryParams.slice(1); - } - const prefix = opts.url.toString().includes("?") ? "&" : "?"; - opts.url = opts.url + prefix + additionalQueryParams; - } - if (typeof options.maxContentLength === "number") { - opts.size = options.maxContentLength; - } - if (typeof options.maxRedirects === "number") { - opts.follow = options.maxRedirects; - } - opts.headers = opts.headers || {}; - if (opts.multipart === undefined && opts.data) { - const isFormData2 = typeof FormData === "undefined" ? false : (opts === null || opts === undefined ? undefined : opts.data) instanceof FormData; - if (is_stream_1.default.readable(opts.data)) { - opts.body = opts.data; - } else if (hasBuffer() && Buffer.isBuffer(opts.data)) { - opts.body = opts.data; - if (!hasHeader(opts, "Content-Type")) { - opts.headers["Content-Type"] = "application/json"; - } - } else if (typeof opts.data === "object") { - if (!isFormData2) { - if (getHeader(opts, "content-type") === "application/x-www-form-urlencoded") { - opts.body = opts.paramsSerializer(opts.data); - } else { - if (!hasHeader(opts, "Content-Type")) { - opts.headers["Content-Type"] = "application/json"; - } - opts.body = JSON.stringify(opts.data); - } - } - } else { - opts.body = opts.data; - } - } else if (opts.multipart && opts.multipart.length > 0) { - const boundary = (0, uuid_1.v4)(); - opts.headers["Content-Type"] = `multipart/related; boundary=${boundary}`; - const bodyStream = new stream_1.PassThrough; - opts.body = bodyStream; - (0, stream_1.pipeline)(this.getMultipartRequest(opts.multipart, boundary), bodyStream, () => {}); - } - opts.validateStatus = opts.validateStatus || this.validateStatus; - opts.responseType = opts.responseType || "unknown"; - if (!opts.headers["Accept"] && opts.responseType === "json") { - opts.headers["Accept"] = "application/json"; - } - opts.method = opts.method || "GET"; - const proxy = opts.proxy || ((_b = process === null || process === undefined ? undefined : process.env) === null || _b === undefined ? undefined : _b.HTTPS_PROXY) || ((_c = process === null || process === undefined ? undefined : process.env) === null || _c === undefined ? undefined : _c.https_proxy) || ((_d = process === null || process === undefined ? undefined : process.env) === null || _d === undefined ? undefined : _d.HTTP_PROXY) || ((_e = process === null || process === undefined ? undefined : process.env) === null || _e === undefined ? undefined : _e.http_proxy); - const urlMayUseProxy = __classPrivateFieldGet3(this, _Gaxios_instances, "m", _Gaxios_urlMayUseProxy).call(this, opts.url, opts.noProxy); - if (opts.agent) {} else if (proxy && urlMayUseProxy) { - const HttpsProxyAgent2 = await __classPrivateFieldGet3(_a3, _a3, "m", _Gaxios_getProxyAgent).call(_a3); - if (this.agentCache.has(proxy)) { - opts.agent = this.agentCache.get(proxy); - } else { - opts.agent = new HttpsProxyAgent2(proxy, { - cert: opts.cert, - key: opts.key - }); - this.agentCache.set(proxy, opts.agent); - } - } else if (opts.cert && opts.key) { - if (this.agentCache.has(opts.key)) { - opts.agent = this.agentCache.get(opts.key); - } else { - opts.agent = new https_1.Agent({ - cert: opts.cert, - key: opts.key - }); - this.agentCache.set(opts.key, opts.agent); - } - } - if (typeof opts.errorRedactor !== "function" && opts.errorRedactor !== false) { - opts.errorRedactor = common_1.defaultErrorRedactor; - } - return opts; - }, _Gaxios_getProxyAgent = async function _Gaxios_getProxyAgent() { - __classPrivateFieldSet3(this, _a3, __classPrivateFieldGet3(this, _a3, "f", _Gaxios_proxyAgent) || (await Promise.resolve().then(() => __importStar(require_dist3()))).HttpsProxyAgent, "f", _Gaxios_proxyAgent); - return __classPrivateFieldGet3(this, _a3, "f", _Gaxios_proxyAgent); - }; - _Gaxios_proxyAgent = { value: undefined }; -}); - -// node_modules/gaxios/build/src/index.js -var require_src8 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.instance = exports.Gaxios = exports.GaxiosError = undefined; - exports.request = request; - var gaxios_1 = require_gaxios2(); - Object.defineProperty(exports, "Gaxios", { enumerable: true, get: function() { - return gaxios_1.Gaxios; - } }); - var common_1 = require_common4(); - Object.defineProperty(exports, "GaxiosError", { enumerable: true, get: function() { - return common_1.GaxiosError; - } }); - __exportStar(require_interceptor2(), exports); - exports.instance = new gaxios_1.Gaxios; - async function request(opts) { - return exports.instance.request(opts); - } -}); - -// node_modules/bignumber.js/bignumber.js -var require_bignumber2 = __commonJS((exports, module) => { - (function(globalObject) { - var BigNumber, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 100000000000000, LOG_BASE = 14, MAX_SAFE_INTEGER7 = 9007199254740991, POWS_TEN = [1, 10, 100, 1000, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 10000000000, 100000000000, 1000000000000, 10000000000000], SQRT_BASE = 1e7, MAX = 1e9; - function clone4(configObject) { - var div, convertBase, parseNumeric, P = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = { - prefix: "", - groupSize: 3, - secondaryGroupSize: 0, - groupSeparator: ",", - decimalSeparator: ".", - fractionGroupSize: 0, - fractionGroupSeparator: " ", - suffix: "" - }, ALPHABET2 = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true; - function BigNumber2(v, b) { - var alphabet, c5, caseChanged, e, i2, isNum, len, str, x2 = this; - if (!(x2 instanceof BigNumber2)) - return new BigNumber2(v, b); - if (b == null) { - if (v && v._isBigNumber === true) { - x2.s = v.s; - if (!v.c || v.e > MAX_EXP) { - x2.c = x2.e = null; - } else if (v.e < MIN_EXP) { - x2.c = [x2.e = 0]; - } else { - x2.e = v.e; - x2.c = v.c.slice(); - } - return; - } - if ((isNum = typeof v == "number") && v * 0 == 0) { - x2.s = 1 / v < 0 ? (v = -v, -1) : 1; - if (v === ~~v) { - for (e = 0, i2 = v;i2 >= 10; i2 /= 10, e++) - ; - if (e > MAX_EXP) { - x2.c = x2.e = null; - } else { - x2.e = e; - x2.c = [v]; - } - return; - } - str = String(v); - } else { - if (!isNumeric.test(str = String(v))) - return parseNumeric(x2, str, isNum); - x2.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; - } - if ((e = str.indexOf(".")) > -1) - str = str.replace(".", ""); - if ((i2 = str.search(/e/i)) > 0) { - if (e < 0) - e = i2; - e += +str.slice(i2 + 1); - str = str.substring(0, i2); - } else if (e < 0) { - e = str.length; - } - } else { - intCheck(b, 2, ALPHABET2.length, "Base"); - if (b == 10 && alphabetHasNormalDecimalDigits) { - x2 = new BigNumber2(v); - return round2(x2, DECIMAL_PLACES + x2.e + 1, ROUNDING_MODE); - } - str = String(v); - if (isNum = typeof v == "number") { - if (v * 0 != 0) - return parseNumeric(x2, str, isNum, b); - x2.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1; - if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) { - throw Error(tooManyDigits + v); - } - } else { - x2.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; - } - alphabet = ALPHABET2.slice(0, b); - e = i2 = 0; - for (len = str.length;i2 < len; i2++) { - if (alphabet.indexOf(c5 = str.charAt(i2)) < 0) { - if (c5 == ".") { - if (i2 > e) { - e = len; - continue; - } - } else if (!caseChanged) { - if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) { - caseChanged = true; - i2 = -1; - e = 0; - continue; - } - } - return parseNumeric(x2, String(v), isNum, b); - } - } - isNum = false; - str = convertBase(str, b, 10, x2.s); - if ((e = str.indexOf(".")) > -1) - str = str.replace(".", ""); - else - e = str.length; - } - for (i2 = 0;str.charCodeAt(i2) === 48; i2++) - ; - for (len = str.length;str.charCodeAt(--len) === 48; ) - ; - if (str = str.slice(i2, ++len)) { - len -= i2; - if (isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER7 || v !== mathfloor(v))) { - throw Error(tooManyDigits + x2.s * v); - } - if ((e = e - i2 - 1) > MAX_EXP) { - x2.c = x2.e = null; - } else if (e < MIN_EXP) { - x2.c = [x2.e = 0]; - } else { - x2.e = e; - x2.c = []; - i2 = (e + 1) % LOG_BASE; - if (e < 0) - i2 += LOG_BASE; - if (i2 < len) { - if (i2) - x2.c.push(+str.slice(0, i2)); - for (len -= LOG_BASE;i2 < len; ) { - x2.c.push(+str.slice(i2, i2 += LOG_BASE)); - } - i2 = LOG_BASE - (str = str.slice(i2)).length; - } else { - i2 -= len; - } - for (;i2--; str += "0") - ; - x2.c.push(+str); - } - } else { - x2.c = [x2.e = 0]; - } - } - BigNumber2.clone = clone4; - BigNumber2.ROUND_UP = 0; - BigNumber2.ROUND_DOWN = 1; - BigNumber2.ROUND_CEIL = 2; - BigNumber2.ROUND_FLOOR = 3; - BigNumber2.ROUND_HALF_UP = 4; - BigNumber2.ROUND_HALF_DOWN = 5; - BigNumber2.ROUND_HALF_EVEN = 6; - BigNumber2.ROUND_HALF_CEIL = 7; - BigNumber2.ROUND_HALF_FLOOR = 8; - BigNumber2.EUCLID = 9; - BigNumber2.config = BigNumber2.set = function(obj) { - var p, v; - if (obj != null) { - if (typeof obj == "object") { - if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) { - v = obj[p]; - intCheck(v, 0, MAX, p); - DECIMAL_PLACES = v; - } - if (obj.hasOwnProperty(p = "ROUNDING_MODE")) { - v = obj[p]; - intCheck(v, 0, 8, p); - ROUNDING_MODE = v; - } - if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) { - v = obj[p]; - if (v && v.pop) { - intCheck(v[0], -MAX, 0, p); - intCheck(v[1], 0, MAX, p); - TO_EXP_NEG = v[0]; - TO_EXP_POS = v[1]; - } else { - intCheck(v, -MAX, MAX, p); - TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); - } - } - if (obj.hasOwnProperty(p = "RANGE")) { - v = obj[p]; - if (v && v.pop) { - intCheck(v[0], -MAX, -1, p); - intCheck(v[1], 1, MAX, p); - MIN_EXP = v[0]; - MAX_EXP = v[1]; - } else { - intCheck(v, -MAX, MAX, p); - if (v) { - MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); - } else { - throw Error(bignumberError + p + " cannot be zero: " + v); - } - } - } - if (obj.hasOwnProperty(p = "CRYPTO")) { - v = obj[p]; - if (v === !!v) { - if (v) { - if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) { - CRYPTO = v; - } else { - CRYPTO = !v; - throw Error(bignumberError + "crypto unavailable"); - } - } else { - CRYPTO = v; - } - } else { - throw Error(bignumberError + p + " not true or false: " + v); - } - } - if (obj.hasOwnProperty(p = "MODULO_MODE")) { - v = obj[p]; - intCheck(v, 0, 9, p); - MODULO_MODE = v; - } - if (obj.hasOwnProperty(p = "POW_PRECISION")) { - v = obj[p]; - intCheck(v, 0, MAX, p); - POW_PRECISION = v; - } - if (obj.hasOwnProperty(p = "FORMAT")) { - v = obj[p]; - if (typeof v == "object") - FORMAT = v; - else - throw Error(bignumberError + p + " not an object: " + v); - } - if (obj.hasOwnProperty(p = "ALPHABET")) { - v = obj[p]; - if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) { - alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789"; - ALPHABET2 = v; - } else { - throw Error(bignumberError + p + " invalid: " + v); - } - } - } else { - throw Error(bignumberError + "Object expected: " + obj); - } - } - return { - DECIMAL_PLACES, - ROUNDING_MODE, - EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], - RANGE: [MIN_EXP, MAX_EXP], - CRYPTO, - MODULO_MODE, - POW_PRECISION, - FORMAT, - ALPHABET: ALPHABET2 - }; - }; - BigNumber2.isBigNumber = function(v) { - if (!v || v._isBigNumber !== true) - return false; - if (!BigNumber2.DEBUG) - return true; - var i2, n2, c5 = v.c, e = v.e, s = v.s; - out: - if ({}.toString.call(c5) == "[object Array]") { - if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) { - if (c5[0] === 0) { - if (e === 0 && c5.length === 1) - return true; - break out; - } - i2 = (e + 1) % LOG_BASE; - if (i2 < 1) - i2 += LOG_BASE; - if (String(c5[0]).length == i2) { - for (i2 = 0;i2 < c5.length; i2++) { - n2 = c5[i2]; - if (n2 < 0 || n2 >= BASE || n2 !== mathfloor(n2)) - break out; - } - if (n2 !== 0) - return true; - } - } - } else if (c5 === null && e === null && (s === null || s === 1 || s === -1)) { - return true; - } - throw Error(bignumberError + "Invalid BigNumber: " + v); - }; - BigNumber2.maximum = BigNumber2.max = function() { - return maxOrMin(arguments, -1); - }; - BigNumber2.minimum = BigNumber2.min = function() { - return maxOrMin(arguments, 1); - }; - BigNumber2.random = function() { - var pow2_53 = 9007199254740992; - var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() { - return mathfloor(Math.random() * pow2_53); - } : function() { - return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0); - }; - return function(dp) { - var a2, b, e, k, v, i2 = 0, c5 = [], rand = new BigNumber2(ONE); - if (dp == null) - dp = DECIMAL_PLACES; - else - intCheck(dp, 0, MAX); - k = mathceil(dp / LOG_BASE); - if (CRYPTO) { - if (crypto.getRandomValues) { - a2 = crypto.getRandomValues(new Uint32Array(k *= 2)); - for (;i2 < k; ) { - v = a2[i2] * 131072 + (a2[i2 + 1] >>> 11); - if (v >= 9000000000000000) { - b = crypto.getRandomValues(new Uint32Array(2)); - a2[i2] = b[0]; - a2[i2 + 1] = b[1]; - } else { - c5.push(v % 100000000000000); - i2 += 2; - } - } - i2 = k / 2; - } else if (crypto.randomBytes) { - a2 = crypto.randomBytes(k *= 7); - for (;i2 < k; ) { - v = (a2[i2] & 31) * 281474976710656 + a2[i2 + 1] * 1099511627776 + a2[i2 + 2] * 4294967296 + a2[i2 + 3] * 16777216 + (a2[i2 + 4] << 16) + (a2[i2 + 5] << 8) + a2[i2 + 6]; - if (v >= 9000000000000000) { - crypto.randomBytes(7).copy(a2, i2); - } else { - c5.push(v % 100000000000000); - i2 += 7; - } - } - i2 = k / 7; - } else { - CRYPTO = false; - throw Error(bignumberError + "crypto unavailable"); - } - } - if (!CRYPTO) { - for (;i2 < k; ) { - v = random53bitInt(); - if (v < 9000000000000000) - c5[i2++] = v % 100000000000000; - } - } - k = c5[--i2]; - dp %= LOG_BASE; - if (k && dp) { - v = POWS_TEN[LOG_BASE - dp]; - c5[i2] = mathfloor(k / v) * v; - } - for (;c5[i2] === 0; c5.pop(), i2--) - ; - if (i2 < 0) { - c5 = [e = 0]; - } else { - for (e = -1;c5[0] === 0; c5.splice(0, 1), e -= LOG_BASE) - ; - for (i2 = 1, v = c5[0];v >= 10; v /= 10, i2++) - ; - if (i2 < LOG_BASE) - e -= LOG_BASE - i2; - } - rand.e = e; - rand.c = c5; - return rand; - }; - }(); - BigNumber2.sum = function() { - var i2 = 1, args = arguments, sum2 = new BigNumber2(args[0]); - for (;i2 < args.length; ) - sum2 = sum2.plus(args[i2++]); - return sum2; - }; - convertBase = function() { - var decimal = "0123456789"; - function toBaseOut(str, baseIn, baseOut, alphabet) { - var j, arr = [0], arrL, i2 = 0, len = str.length; - for (;i2 < len; ) { - for (arrL = arr.length;arrL--; arr[arrL] *= baseIn) - ; - arr[0] += alphabet.indexOf(str.charAt(i2++)); - for (j = 0;j < arr.length; j++) { - if (arr[j] > baseOut - 1) { - if (arr[j + 1] == null) - arr[j + 1] = 0; - arr[j + 1] += arr[j] / baseOut | 0; - arr[j] %= baseOut; - } - } - } - return arr.reverse(); - } - return function(str, baseIn, baseOut, sign, callerIsToString) { - var alphabet, d, e, k, r, x2, xc, y2, i2 = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE; - if (i2 >= 0) { - k = POW_PRECISION; - POW_PRECISION = 0; - str = str.replace(".", ""); - y2 = new BigNumber2(baseIn); - x2 = y2.pow(str.length - i2); - POW_PRECISION = k; - y2.c = toBaseOut(toFixedPoint(coeffToString(x2.c), x2.e, "0"), 10, baseOut, decimal); - y2.e = y2.c.length; - } - xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET2, decimal) : (alphabet = decimal, ALPHABET2)); - e = k = xc.length; - for (;xc[--k] == 0; xc.pop()) - ; - if (!xc[0]) - return alphabet.charAt(0); - if (i2 < 0) { - --e; - } else { - x2.c = xc; - x2.e = e; - x2.s = sign; - x2 = div(x2, y2, dp, rm, baseOut); - xc = x2.c; - r = x2.r; - e = x2.e; - } - d = e + dp + 1; - i2 = xc[d]; - k = baseOut / 2; - r = r || d < 0 || xc[d + 1] != null; - r = rm < 4 ? (i2 != null || r) && (rm == 0 || rm == (x2.s < 0 ? 3 : 2)) : i2 > k || i2 == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x2.s < 0 ? 8 : 7)); - if (d < 1 || !xc[0]) { - str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0); - } else { - xc.length = d; - if (r) { - for (--baseOut;++xc[--d] > baseOut; ) { - xc[d] = 0; - if (!d) { - ++e; - xc = [1].concat(xc); - } - } - } - for (k = xc.length;!xc[--k]; ) - ; - for (i2 = 0, str = "";i2 <= k; str += alphabet.charAt(xc[i2++])) - ; - str = toFixedPoint(str, e, alphabet.charAt(0)); - } - return str; - }; - }(); - div = function() { - function multiply2(x2, k, base2) { - var m, temp, xlo, xhi, carry = 0, i2 = x2.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0; - for (x2 = x2.slice();i2--; ) { - xlo = x2[i2] % SQRT_BASE; - xhi = x2[i2] / SQRT_BASE | 0; - m = khi * xlo + xhi * klo; - temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry; - carry = (temp / base2 | 0) + (m / SQRT_BASE | 0) + khi * xhi; - x2[i2] = temp % base2; - } - if (carry) - x2 = [carry].concat(x2); - return x2; - } - function compare2(a2, b, aL, bL) { - var i2, cmp; - if (aL != bL) { - cmp = aL > bL ? 1 : -1; - } else { - for (i2 = cmp = 0;i2 < aL; i2++) { - if (a2[i2] != b[i2]) { - cmp = a2[i2] > b[i2] ? 1 : -1; - break; - } - } - } - return cmp; - } - function subtract2(a2, b, aL, base2) { - var i2 = 0; - for (;aL--; ) { - a2[aL] -= i2; - i2 = a2[aL] < b[aL] ? 1 : 0; - a2[aL] = i2 * base2 + a2[aL] - b[aL]; - } - for (;!a2[0] && a2.length > 1; a2.splice(0, 1)) - ; - } - return function(x2, y2, dp, rm, base2) { - var cmp, e, i2, more, n2, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x2.s == y2.s ? 1 : -1, xc = x2.c, yc = y2.c; - if (!xc || !xc[0] || !yc || !yc[0]) { - return new BigNumber2(!x2.s || !y2.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : xc && xc[0] == 0 || !yc ? s * 0 : s / 0); - } - q = new BigNumber2(s); - qc = q.c = []; - e = x2.e - y2.e; - s = dp + e + 1; - if (!base2) { - base2 = BASE; - e = bitFloor(x2.e / LOG_BASE) - bitFloor(y2.e / LOG_BASE); - s = s / LOG_BASE | 0; - } - for (i2 = 0;yc[i2] == (xc[i2] || 0); i2++) - ; - if (yc[i2] > (xc[i2] || 0)) - e--; - if (s < 0) { - qc.push(1); - more = true; - } else { - xL = xc.length; - yL = yc.length; - i2 = 0; - s += 2; - n2 = mathfloor(base2 / (yc[0] + 1)); - if (n2 > 1) { - yc = multiply2(yc, n2, base2); - xc = multiply2(xc, n2, base2); - yL = yc.length; - xL = xc.length; - } - xi = yL; - rem = xc.slice(0, yL); - remL = rem.length; - for (;remL < yL; rem[remL++] = 0) - ; - yz = yc.slice(); - yz = [0].concat(yz); - yc0 = yc[0]; - if (yc[1] >= base2 / 2) - yc0++; - do { - n2 = 0; - cmp = compare2(yc, rem, yL, remL); - if (cmp < 0) { - rem0 = rem[0]; - if (yL != remL) - rem0 = rem0 * base2 + (rem[1] || 0); - n2 = mathfloor(rem0 / yc0); - if (n2 > 1) { - if (n2 >= base2) - n2 = base2 - 1; - prod = multiply2(yc, n2, base2); - prodL = prod.length; - remL = rem.length; - while (compare2(prod, rem, prodL, remL) == 1) { - n2--; - subtract2(prod, yL < prodL ? yz : yc, prodL, base2); - prodL = prod.length; - cmp = 1; - } - } else { - if (n2 == 0) { - cmp = n2 = 1; - } - prod = yc.slice(); - prodL = prod.length; - } - if (prodL < remL) - prod = [0].concat(prod); - subtract2(rem, prod, remL, base2); - remL = rem.length; - if (cmp == -1) { - while (compare2(yc, rem, yL, remL) < 1) { - n2++; - subtract2(rem, yL < remL ? yz : yc, remL, base2); - remL = rem.length; - } - } - } else if (cmp === 0) { - n2++; - rem = [0]; - } - qc[i2++] = n2; - if (rem[0]) { - rem[remL++] = xc[xi] || 0; - } else { - rem = [xc[xi]]; - remL = 1; - } - } while ((xi++ < xL || rem[0] != null) && s--); - more = rem[0] != null; - if (!qc[0]) - qc.splice(0, 1); - } - if (base2 == BASE) { - for (i2 = 1, s = qc[0];s >= 10; s /= 10, i2++) - ; - round2(q, dp + (q.e = i2 + e * LOG_BASE - 1) + 1, rm, more); - } else { - q.e = e; - q.r = +more; - } - return q; - }; - }(); - function format3(n2, i2, rm, id) { - var c0, e, ne, len, str; - if (rm == null) - rm = ROUNDING_MODE; - else - intCheck(rm, 0, 8); - if (!n2.c) - return n2.toString(); - c0 = n2.c[0]; - ne = n2.e; - if (i2 == null) { - str = coeffToString(n2.c); - str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0"); - } else { - n2 = round2(new BigNumber2(n2), i2, rm); - e = n2.e; - str = coeffToString(n2.c); - len = str.length; - if (id == 1 || id == 2 && (i2 <= e || e <= TO_EXP_NEG)) { - for (;len < i2; str += "0", len++) - ; - str = toExponential(str, e); - } else { - i2 -= ne + (id === 2 && e > ne); - str = toFixedPoint(str, e, "0"); - if (e + 1 > len) { - if (--i2 > 0) - for (str += ".";i2--; str += "0") - ; - } else { - i2 += e - len; - if (i2 > 0) { - if (e + 1 == len) - str += "."; - for (;i2--; str += "0") - ; - } - } - } - } - return n2.s < 0 && c0 ? "-" + str : str; - } - function maxOrMin(args, n2) { - var k, y2, i2 = 1, x2 = new BigNumber2(args[0]); - for (;i2 < args.length; i2++) { - y2 = new BigNumber2(args[i2]); - if (!y2.s || (k = compare(x2, y2)) === n2 || k === 0 && x2.s === n2) { - x2 = y2; - } - } - return x2; - } - function normalise(n2, c5, e) { - var i2 = 1, j = c5.length; - for (;!c5[--j]; c5.pop()) - ; - for (j = c5[0];j >= 10; j /= 10, i2++) - ; - if ((e = i2 + e * LOG_BASE - 1) > MAX_EXP) { - n2.c = n2.e = null; - } else if (e < MIN_EXP) { - n2.c = [n2.e = 0]; - } else { - n2.e = e; - n2.c = c5; - } - return n2; - } - parseNumeric = function() { - var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; - return function(x2, str, isNum, b) { - var base2, s = isNum ? str : str.replace(whitespaceOrPlus, ""); - if (isInfinityOrNaN.test(s)) { - x2.s = isNaN(s) ? null : s < 0 ? -1 : 1; - } else { - if (!isNum) { - s = s.replace(basePrefix, function(m, p1, p2) { - base2 = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8; - return !b || b == base2 ? p1 : m; - }); - if (b) { - base2 = b; - s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1"); - } - if (str != s) - return new BigNumber2(s, base2); - } - if (BigNumber2.DEBUG) { - throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str); - } - x2.s = null; - } - x2.c = x2.e = null; - }; - }(); - function round2(x2, sd, rm, r) { - var d, i2, j, k, n2, ni, rd, xc = x2.c, pows10 = POWS_TEN; - if (xc) { - out: { - for (d = 1, k = xc[0];k >= 10; k /= 10, d++) - ; - i2 = sd - d; - if (i2 < 0) { - i2 += LOG_BASE; - j = sd; - n2 = xc[ni = 0]; - rd = mathfloor(n2 / pows10[d - j - 1] % 10); - } else { - ni = mathceil((i2 + 1) / LOG_BASE); - if (ni >= xc.length) { - if (r) { - for (;xc.length <= ni; xc.push(0)) - ; - n2 = rd = 0; - d = 1; - i2 %= LOG_BASE; - j = i2 - LOG_BASE + 1; - } else { - break out; - } - } else { - n2 = k = xc[ni]; - for (d = 1;k >= 10; k /= 10, d++) - ; - i2 %= LOG_BASE; - j = i2 - LOG_BASE + d; - rd = j < 0 ? 0 : mathfloor(n2 / pows10[d - j - 1] % 10); - } - } - r = r || sd < 0 || xc[ni + 1] != null || (j < 0 ? n2 : n2 % pows10[d - j - 1]); - r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x2.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && (i2 > 0 ? j > 0 ? n2 / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x2.s < 0 ? 8 : 7)); - if (sd < 1 || !xc[0]) { - xc.length = 0; - if (r) { - sd -= x2.e + 1; - xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; - x2.e = -sd || 0; - } else { - xc[0] = x2.e = 0; - } - return x2; - } - if (i2 == 0) { - xc.length = ni; - k = 1; - ni--; - } else { - xc.length = ni + 1; - k = pows10[LOG_BASE - i2]; - xc[ni] = j > 0 ? mathfloor(n2 / pows10[d - j] % pows10[j]) * k : 0; - } - if (r) { - for (;; ) { - if (ni == 0) { - for (i2 = 1, j = xc[0];j >= 10; j /= 10, i2++) - ; - j = xc[0] += k; - for (k = 1;j >= 10; j /= 10, k++) - ; - if (i2 != k) { - x2.e++; - if (xc[0] == BASE) - xc[0] = 1; - } - break; - } else { - xc[ni] += k; - if (xc[ni] != BASE) - break; - xc[ni--] = 0; - k = 1; - } - } - } - for (i2 = xc.length;xc[--i2] === 0; xc.pop()) - ; - } - if (x2.e > MAX_EXP) { - x2.c = x2.e = null; - } else if (x2.e < MIN_EXP) { - x2.c = [x2.e = 0]; - } - } - return x2; - } - function valueOf(n2) { - var str, e = n2.e; - if (e === null) - return n2.toString(); - str = coeffToString(n2.c); - str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0"); - return n2.s < 0 ? "-" + str : str; - } - P.absoluteValue = P.abs = function() { - var x2 = new BigNumber2(this); - if (x2.s < 0) - x2.s = 1; - return x2; - }; - P.comparedTo = function(y2, b) { - return compare(this, new BigNumber2(y2, b)); - }; - P.decimalPlaces = P.dp = function(dp, rm) { - var c5, n2, v, x2 = this; - if (dp != null) { - intCheck(dp, 0, MAX); - if (rm == null) - rm = ROUNDING_MODE; - else - intCheck(rm, 0, 8); - return round2(new BigNumber2(x2), dp + x2.e + 1, rm); - } - if (!(c5 = x2.c)) - return null; - n2 = ((v = c5.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; - if (v = c5[v]) - for (;v % 10 == 0; v /= 10, n2--) - ; - if (n2 < 0) - n2 = 0; - return n2; - }; - P.dividedBy = P.div = function(y2, b) { - return div(this, new BigNumber2(y2, b), DECIMAL_PLACES, ROUNDING_MODE); - }; - P.dividedToIntegerBy = P.idiv = function(y2, b) { - return div(this, new BigNumber2(y2, b), 0, 1); - }; - P.exponentiatedBy = P.pow = function(n2, m) { - var half, isModExp, i2, k, more, nIsBig, nIsNeg, nIsOdd, y2, x2 = this; - n2 = new BigNumber2(n2); - if (n2.c && !n2.isInteger()) { - throw Error(bignumberError + "Exponent not an integer: " + valueOf(n2)); - } - if (m != null) - m = new BigNumber2(m); - nIsBig = n2.e > 14; - if (!x2.c || !x2.c[0] || x2.c[0] == 1 && !x2.e && x2.c.length == 1 || !n2.c || !n2.c[0]) { - y2 = new BigNumber2(Math.pow(+valueOf(x2), nIsBig ? n2.s * (2 - isOdd(n2)) : +valueOf(n2))); - return m ? y2.mod(m) : y2; - } - nIsNeg = n2.s < 0; - if (m) { - if (m.c ? !m.c[0] : !m.s) - return new BigNumber2(NaN); - isModExp = !nIsNeg && x2.isInteger() && m.isInteger(); - if (isModExp) - x2 = x2.mod(m); - } else if (n2.e > 9 && (x2.e > 0 || x2.e < -1 || (x2.e == 0 ? x2.c[0] > 1 || nIsBig && x2.c[1] >= 240000000 : x2.c[0] < 80000000000000 || nIsBig && x2.c[0] <= 99999750000000))) { - k = x2.s < 0 && isOdd(n2) ? -0 : 0; - if (x2.e > -1) - k = 1 / k; - return new BigNumber2(nIsNeg ? 1 / k : k); - } else if (POW_PRECISION) { - k = mathceil(POW_PRECISION / LOG_BASE + 2); - } - if (nIsBig) { - half = new BigNumber2(0.5); - if (nIsNeg) - n2.s = 1; - nIsOdd = isOdd(n2); - } else { - i2 = Math.abs(+valueOf(n2)); - nIsOdd = i2 % 2; - } - y2 = new BigNumber2(ONE); - for (;; ) { - if (nIsOdd) { - y2 = y2.times(x2); - if (!y2.c) - break; - if (k) { - if (y2.c.length > k) - y2.c.length = k; - } else if (isModExp) { - y2 = y2.mod(m); - } - } - if (i2) { - i2 = mathfloor(i2 / 2); - if (i2 === 0) - break; - nIsOdd = i2 % 2; - } else { - n2 = n2.times(half); - round2(n2, n2.e + 1, 1); - if (n2.e > 14) { - nIsOdd = isOdd(n2); - } else { - i2 = +valueOf(n2); - if (i2 === 0) - break; - nIsOdd = i2 % 2; - } - } - x2 = x2.times(x2); - if (k) { - if (x2.c && x2.c.length > k) - x2.c.length = k; - } else if (isModExp) { - x2 = x2.mod(m); - } - } - if (isModExp) - return y2; - if (nIsNeg) - y2 = ONE.div(y2); - return m ? y2.mod(m) : k ? round2(y2, POW_PRECISION, ROUNDING_MODE, more) : y2; - }; - P.integerValue = function(rm) { - var n2 = new BigNumber2(this); - if (rm == null) - rm = ROUNDING_MODE; - else - intCheck(rm, 0, 8); - return round2(n2, n2.e + 1, rm); - }; - P.isEqualTo = P.eq = function(y2, b) { - return compare(this, new BigNumber2(y2, b)) === 0; - }; - P.isFinite = function() { - return !!this.c; - }; - P.isGreaterThan = P.gt = function(y2, b) { - return compare(this, new BigNumber2(y2, b)) > 0; - }; - P.isGreaterThanOrEqualTo = P.gte = function(y2, b) { - return (b = compare(this, new BigNumber2(y2, b))) === 1 || b === 0; - }; - P.isInteger = function() { - return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; - }; - P.isLessThan = P.lt = function(y2, b) { - return compare(this, new BigNumber2(y2, b)) < 0; - }; - P.isLessThanOrEqualTo = P.lte = function(y2, b) { - return (b = compare(this, new BigNumber2(y2, b))) === -1 || b === 0; - }; - P.isNaN = function() { - return !this.s; - }; - P.isNegative = function() { - return this.s < 0; - }; - P.isPositive = function() { - return this.s > 0; - }; - P.isZero = function() { - return !!this.c && this.c[0] == 0; - }; - P.minus = function(y2, b) { - var i2, j, t, xLTy, x2 = this, a2 = x2.s; - y2 = new BigNumber2(y2, b); - b = y2.s; - if (!a2 || !b) - return new BigNumber2(NaN); - if (a2 != b) { - y2.s = -b; - return x2.plus(y2); - } - var xe = x2.e / LOG_BASE, ye = y2.e / LOG_BASE, xc = x2.c, yc = y2.c; - if (!xe || !ye) { - if (!xc || !yc) - return xc ? (y2.s = -b, y2) : new BigNumber2(yc ? x2 : NaN); - if (!xc[0] || !yc[0]) { - return yc[0] ? (y2.s = -b, y2) : new BigNumber2(xc[0] ? x2 : ROUNDING_MODE == 3 ? -0 : 0); - } - } - xe = bitFloor(xe); - ye = bitFloor(ye); - xc = xc.slice(); - if (a2 = xe - ye) { - if (xLTy = a2 < 0) { - a2 = -a2; - t = xc; - } else { - ye = xe; - t = yc; - } - t.reverse(); - for (b = a2;b--; t.push(0)) - ; - t.reverse(); - } else { - j = (xLTy = (a2 = xc.length) < (b = yc.length)) ? a2 : b; - for (a2 = b = 0;b < j; b++) { - if (xc[b] != yc[b]) { - xLTy = xc[b] < yc[b]; - break; - } - } - } - if (xLTy) { - t = xc; - xc = yc; - yc = t; - y2.s = -y2.s; - } - b = (j = yc.length) - (i2 = xc.length); - if (b > 0) - for (;b--; xc[i2++] = 0) - ; - b = BASE - 1; - for (;j > a2; ) { - if (xc[--j] < yc[j]) { - for (i2 = j;i2 && !xc[--i2]; xc[i2] = b) - ; - --xc[i2]; - xc[j] += BASE; - } - xc[j] -= yc[j]; - } - for (;xc[0] == 0; xc.splice(0, 1), --ye) - ; - if (!xc[0]) { - y2.s = ROUNDING_MODE == 3 ? -1 : 1; - y2.c = [y2.e = 0]; - return y2; - } - return normalise(y2, xc, ye); - }; - P.modulo = P.mod = function(y2, b) { - var q, s, x2 = this; - y2 = new BigNumber2(y2, b); - if (!x2.c || !y2.s || y2.c && !y2.c[0]) { - return new BigNumber2(NaN); - } else if (!y2.c || x2.c && !x2.c[0]) { - return new BigNumber2(x2); - } - if (MODULO_MODE == 9) { - s = y2.s; - y2.s = 1; - q = div(x2, y2, 0, 3); - y2.s = s; - q.s *= s; - } else { - q = div(x2, y2, 0, MODULO_MODE); - } - y2 = x2.minus(q.times(y2)); - if (!y2.c[0] && MODULO_MODE == 1) - y2.s = x2.s; - return y2; - }; - P.multipliedBy = P.times = function(y2, b) { - var c5, e, i2, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base2, sqrtBase, x2 = this, xc = x2.c, yc = (y2 = new BigNumber2(y2, b)).c; - if (!xc || !yc || !xc[0] || !yc[0]) { - if (!x2.s || !y2.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { - y2.c = y2.e = y2.s = null; - } else { - y2.s *= x2.s; - if (!xc || !yc) { - y2.c = y2.e = null; - } else { - y2.c = [0]; - y2.e = 0; - } - } - return y2; - } - e = bitFloor(x2.e / LOG_BASE) + bitFloor(y2.e / LOG_BASE); - y2.s *= x2.s; - xcL = xc.length; - ycL = yc.length; - if (xcL < ycL) { - zc = xc; - xc = yc; - yc = zc; - i2 = xcL; - xcL = ycL; - ycL = i2; - } - for (i2 = xcL + ycL, zc = [];i2--; zc.push(0)) - ; - base2 = BASE; - sqrtBase = SQRT_BASE; - for (i2 = ycL;--i2 >= 0; ) { - c5 = 0; - ylo = yc[i2] % sqrtBase; - yhi = yc[i2] / sqrtBase | 0; - for (k = xcL, j = i2 + k;j > i2; ) { - xlo = xc[--k] % sqrtBase; - xhi = xc[k] / sqrtBase | 0; - m = yhi * xlo + xhi * ylo; - xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c5; - c5 = (xlo / base2 | 0) + (m / sqrtBase | 0) + yhi * xhi; - zc[j--] = xlo % base2; - } - zc[j] = c5; - } - if (c5) { - ++e; - } else { - zc.splice(0, 1); - } - return normalise(y2, zc, e); - }; - P.negated = function() { - var x2 = new BigNumber2(this); - x2.s = -x2.s || null; - return x2; - }; - P.plus = function(y2, b) { - var t, x2 = this, a2 = x2.s; - y2 = new BigNumber2(y2, b); - b = y2.s; - if (!a2 || !b) - return new BigNumber2(NaN); - if (a2 != b) { - y2.s = -b; - return x2.minus(y2); - } - var xe = x2.e / LOG_BASE, ye = y2.e / LOG_BASE, xc = x2.c, yc = y2.c; - if (!xe || !ye) { - if (!xc || !yc) - return new BigNumber2(a2 / 0); - if (!xc[0] || !yc[0]) - return yc[0] ? y2 : new BigNumber2(xc[0] ? x2 : a2 * 0); - } - xe = bitFloor(xe); - ye = bitFloor(ye); - xc = xc.slice(); - if (a2 = xe - ye) { - if (a2 > 0) { - ye = xe; - t = yc; - } else { - a2 = -a2; - t = xc; - } - t.reverse(); - for (;a2--; t.push(0)) - ; - t.reverse(); - } - a2 = xc.length; - b = yc.length; - if (a2 - b < 0) { - t = yc; - yc = xc; - xc = t; - b = a2; - } - for (a2 = 0;b; ) { - a2 = (xc[--b] = xc[b] + yc[b] + a2) / BASE | 0; - xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; - } - if (a2) { - xc = [a2].concat(xc); - ++ye; - } - return normalise(y2, xc, ye); - }; - P.precision = P.sd = function(sd, rm) { - var c5, n2, v, x2 = this; - if (sd != null && sd !== !!sd) { - intCheck(sd, 1, MAX); - if (rm == null) - rm = ROUNDING_MODE; - else - intCheck(rm, 0, 8); - return round2(new BigNumber2(x2), sd, rm); - } - if (!(c5 = x2.c)) - return null; - v = c5.length - 1; - n2 = v * LOG_BASE + 1; - if (v = c5[v]) { - for (;v % 10 == 0; v /= 10, n2--) - ; - for (v = c5[0];v >= 10; v /= 10, n2++) - ; - } - if (sd && x2.e + 1 > n2) - n2 = x2.e + 1; - return n2; - }; - P.shiftedBy = function(k) { - intCheck(k, -MAX_SAFE_INTEGER7, MAX_SAFE_INTEGER7); - return this.times("1e" + k); - }; - P.squareRoot = P.sqrt = function() { - var m, n2, r, rep, t, x2 = this, c5 = x2.c, s = x2.s, e = x2.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5"); - if (s !== 1 || !c5 || !c5[0]) { - return new BigNumber2(!s || s < 0 && (!c5 || c5[0]) ? NaN : c5 ? x2 : 1 / 0); - } - s = Math.sqrt(+valueOf(x2)); - if (s == 0 || s == 1 / 0) { - n2 = coeffToString(c5); - if ((n2.length + e) % 2 == 0) - n2 += "0"; - s = Math.sqrt(+n2); - e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); - if (s == 1 / 0) { - n2 = "5e" + e; - } else { - n2 = s.toExponential(); - n2 = n2.slice(0, n2.indexOf("e") + 1) + e; - } - r = new BigNumber2(n2); - } else { - r = new BigNumber2(s + ""); - } - if (r.c[0]) { - e = r.e; - s = e + dp; - if (s < 3) - s = 0; - for (;; ) { - t = r; - r = half.times(t.plus(div(x2, t, dp, 1))); - if (coeffToString(t.c).slice(0, s) === (n2 = coeffToString(r.c)).slice(0, s)) { - if (r.e < e) - --s; - n2 = n2.slice(s - 3, s + 1); - if (n2 == "9999" || !rep && n2 == "4999") { - if (!rep) { - round2(t, t.e + DECIMAL_PLACES + 2, 0); - if (t.times(t).eq(x2)) { - r = t; - break; - } - } - dp += 4; - s += 4; - rep = 1; - } else { - if (!+n2 || !+n2.slice(1) && n2.charAt(0) == "5") { - round2(r, r.e + DECIMAL_PLACES + 2, 1); - m = !r.times(r).eq(x2); - } - break; - } - } - } - } - return round2(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); - }; - P.toExponential = function(dp, rm) { - if (dp != null) { - intCheck(dp, 0, MAX); - dp++; - } - return format3(this, dp, rm, 1); - }; - P.toFixed = function(dp, rm) { - if (dp != null) { - intCheck(dp, 0, MAX); - dp = dp + this.e + 1; - } - return format3(this, dp, rm); - }; - P.toFormat = function(dp, rm, format4) { - var str, x2 = this; - if (format4 == null) { - if (dp != null && rm && typeof rm == "object") { - format4 = rm; - rm = null; - } else if (dp && typeof dp == "object") { - format4 = dp; - dp = rm = null; - } else { - format4 = FORMAT; - } - } else if (typeof format4 != "object") { - throw Error(bignumberError + "Argument not an object: " + format4); - } - str = x2.toFixed(dp, rm); - if (x2.c) { - var i2, arr = str.split("."), g1 = +format4.groupSize, g2 = +format4.secondaryGroupSize, groupSeparator = format4.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x2.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length; - if (g2) { - i2 = g1; - g1 = g2; - g2 = i2; - len -= i2; - } - if (g1 > 0 && len > 0) { - i2 = len % g1 || g1; - intPart = intDigits.substr(0, i2); - for (;i2 < len; i2 += g1) - intPart += groupSeparator + intDigits.substr(i2, g1); - if (g2 > 0) - intPart += groupSeparator + intDigits.slice(i2); - if (isNeg) - intPart = "-" + intPart; - } - str = fractionPart ? intPart + (format4.decimalSeparator || "") + ((g2 = +format4.fractionGroupSize) ? fractionPart.replace(new RegExp("\\d{" + g2 + "}\\B", "g"), "$&" + (format4.fractionGroupSeparator || "")) : fractionPart) : intPart; - } - return (format4.prefix || "") + str + (format4.suffix || ""); - }; - P.toFraction = function(md) { - var d, d0, d1, d2, e, exp, n2, n0, n1, q, r, s, x2 = this, xc = x2.c; - if (md != null) { - n2 = new BigNumber2(md); - if (!n2.isInteger() && (n2.c || n2.s !== 1) || n2.lt(ONE)) { - throw Error(bignumberError + "Argument " + (n2.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n2)); - } - } - if (!xc) - return new BigNumber2(x2); - d = new BigNumber2(ONE); - n1 = d0 = new BigNumber2(ONE); - d1 = n0 = new BigNumber2(ONE); - s = coeffToString(xc); - e = d.e = s.length - x2.e - 1; - d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; - md = !md || n2.comparedTo(d) > 0 ? e > 0 ? d : n1 : n2; - exp = MAX_EXP; - MAX_EXP = 1 / 0; - n2 = new BigNumber2(s); - n0.c[0] = 0; - for (;; ) { - q = div(n2, d, 0, 1); - d2 = d0.plus(q.times(d1)); - if (d2.comparedTo(md) == 1) - break; - d0 = d1; - d1 = d2; - n1 = n0.plus(q.times(d2 = n1)); - n0 = d2; - d = n2.minus(q.times(d2 = d)); - n2 = d2; - } - d2 = div(md.minus(d0), d1, 0, 1); - n0 = n0.plus(d2.times(n1)); - d0 = d0.plus(d2.times(d1)); - n0.s = n1.s = x2.s; - e = e * 2; - r = div(n1, d1, e, ROUNDING_MODE).minus(x2).abs().comparedTo(div(n0, d0, e, ROUNDING_MODE).minus(x2).abs()) < 1 ? [n1, d1] : [n0, d0]; - MAX_EXP = exp; - return r; - }; - P.toNumber = function() { - return +valueOf(this); - }; - P.toPrecision = function(sd, rm) { - if (sd != null) - intCheck(sd, 1, MAX); - return format3(this, sd, rm, 2); - }; - P.toString = function(b) { - var str, n2 = this, s = n2.s, e = n2.e; - if (e === null) { - if (s) { - str = "Infinity"; - if (s < 0) - str = "-" + str; - } else { - str = "NaN"; - } - } else { - if (b == null) { - str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n2.c), e) : toFixedPoint(coeffToString(n2.c), e, "0"); - } else if (b === 10 && alphabetHasNormalDecimalDigits) { - n2 = round2(new BigNumber2(n2), DECIMAL_PLACES + e + 1, ROUNDING_MODE); - str = toFixedPoint(coeffToString(n2.c), n2.e, "0"); - } else { - intCheck(b, 2, ALPHABET2.length, "Base"); - str = convertBase(toFixedPoint(coeffToString(n2.c), e, "0"), 10, b, s, true); - } - if (s < 0 && n2.c[0]) - str = "-" + str; - } - return str; - }; - P.valueOf = P.toJSON = function() { - return valueOf(this); - }; - P._isBigNumber = true; - if (configObject != null) - BigNumber2.set(configObject); - return BigNumber2; - } - function bitFloor(n2) { - var i2 = n2 | 0; - return n2 > 0 || n2 === i2 ? i2 : i2 - 1; - } - function coeffToString(a2) { - var s, z2, i2 = 1, j = a2.length, r = a2[0] + ""; - for (;i2 < j; ) { - s = a2[i2++] + ""; - z2 = LOG_BASE - s.length; - for (;z2--; s = "0" + s) - ; - r += s; - } - for (j = r.length;r.charCodeAt(--j) === 48; ) - ; - return r.slice(0, j + 1 || 1); - } - function compare(x2, y2) { - var a2, b, xc = x2.c, yc = y2.c, i2 = x2.s, j = y2.s, k = x2.e, l = y2.e; - if (!i2 || !j) - return null; - a2 = xc && !xc[0]; - b = yc && !yc[0]; - if (a2 || b) - return a2 ? b ? 0 : -j : i2; - if (i2 != j) - return i2; - a2 = i2 < 0; - b = k == l; - if (!xc || !yc) - return b ? 0 : !xc ^ a2 ? 1 : -1; - if (!b) - return k > l ^ a2 ? 1 : -1; - j = (k = xc.length) < (l = yc.length) ? k : l; - for (i2 = 0;i2 < j; i2++) - if (xc[i2] != yc[i2]) - return xc[i2] > yc[i2] ^ a2 ? 1 : -1; - return k == l ? 0 : k > l ^ a2 ? 1 : -1; - } - function intCheck(n2, min2, max2, name) { - if (n2 < min2 || n2 > max2 || n2 !== mathfloor(n2)) { - throw Error(bignumberError + (name || "Argument") + (typeof n2 == "number" ? n2 < min2 || n2 > max2 ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n2)); - } - } - function isOdd(n2) { - var k = n2.c.length - 1; - return bitFloor(n2.e / LOG_BASE) == k && n2.c[k] % 2 != 0; - } - function toExponential(str, e) { - return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e; - } - function toFixedPoint(str, e, z2) { - var len, zs; - if (e < 0) { - for (zs = z2 + ".";++e; zs += z2) - ; - str = zs + str; - } else { - len = str.length; - if (++e > len) { - for (zs = z2, e -= len;--e; zs += z2) - ; - str += zs; - } else if (e < len) { - str = str.slice(0, e) + "." + str.slice(e); - } - } - return str; - } - BigNumber = clone4(); - BigNumber["default"] = BigNumber.BigNumber = BigNumber; - if (typeof define == "function" && define.amd) { - define(function() { - return BigNumber; - }); - } else if (typeof module != "undefined" && module.exports) { - module.exports = BigNumber; - } else { - if (!globalObject) { - globalObject = typeof self != "undefined" && self ? self : window; - } - globalObject.BigNumber = BigNumber; - } - })(exports); -}); - -// node_modules/json-bigint/lib/stringify.js -var require_stringify4 = __commonJS((exports, module) => { - var BigNumber = require_bignumber2(); - var JSON2 = exports; - (function() { - function f(n2) { - return n2 < 10 ? "0" + n2 : n2; - } - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { - "\b": "\\b", - "\t": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - '"': "\\\"", - "\\": "\\\\" - }, rep; - function quote(string4) { - escapable.lastIndex = 0; - return escapable.test(string4) ? '"' + string4.replace(escapable, function(a2) { - var c5 = meta[a2]; - return typeof c5 === "string" ? c5 : "\\u" + ("0000" + a2.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string4 + '"'; - } - function str(key, holder) { - var i2, k, v, length, mind = gap, partial3, value = holder[key], isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value)); - if (value && typeof value === "object" && typeof value.toJSON === "function") { - value = value.toJSON(key); - } - if (typeof rep === "function") { - value = rep.call(holder, key, value); - } - switch (typeof value) { - case "string": - if (isBigNumber) { - return value; - } else { - return quote(value); - } - case "number": - return isFinite(value) ? String(value) : "null"; - case "boolean": - case "null": - case "bigint": - return String(value); - case "object": - if (!value) { - return "null"; - } - gap += indent; - partial3 = []; - if (Object.prototype.toString.apply(value) === "[object Array]") { - length = value.length; - for (i2 = 0;i2 < length; i2 += 1) { - partial3[i2] = str(i2, value) || "null"; - } - v = partial3.length === 0 ? "[]" : gap ? `[ -` + gap + partial3.join(`, -` + gap) + ` -` + mind + "]" : "[" + partial3.join(",") + "]"; - gap = mind; - return v; - } - if (rep && typeof rep === "object") { - length = rep.length; - for (i2 = 0;i2 < length; i2 += 1) { - if (typeof rep[i2] === "string") { - k = rep[i2]; - v = str(k, value); - if (v) { - partial3.push(quote(k) + (gap ? ": " : ":") + v); - } - } - } - } else { - Object.keys(value).forEach(function(k2) { - var v2 = str(k2, value); - if (v2) { - partial3.push(quote(k2) + (gap ? ": " : ":") + v2); - } - }); - } - v = partial3.length === 0 ? "{}" : gap ? `{ -` + gap + partial3.join(`, -` + gap) + ` -` + mind + "}" : "{" + partial3.join(",") + "}"; - gap = mind; - return v; - } - } - if (typeof JSON2.stringify !== "function") { - JSON2.stringify = function(value, replacer, space) { - var i2; - gap = ""; - indent = ""; - if (typeof space === "number") { - for (i2 = 0;i2 < space; i2 += 1) { - indent += " "; - } - } else if (typeof space === "string") { - indent = space; - } - rep = replacer; - if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) { - throw new Error("JSON.stringify"); - } - return str("", { "": value }); - }; - } - })(); -}); - -// node_modules/json-bigint/lib/parse.js -var require_parse6 = __commonJS((exports, module) => { - var BigNumber = null; - var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/; - var suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/; - var json_parse = function(options) { - var _options = { - strict: false, - storeAsString: false, - alwaysParseAsBig: false, - useNativeBigInt: false, - protoAction: "error", - constructorAction: "error" - }; - if (options !== undefined && options !== null) { - if (options.strict === true) { - _options.strict = true; - } - if (options.storeAsString === true) { - _options.storeAsString = true; - } - _options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false; - _options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false; - if (typeof options.constructorAction !== "undefined") { - if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve") { - _options.constructorAction = options.constructorAction; - } else { - throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`); - } - } - if (typeof options.protoAction !== "undefined") { - if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve") { - _options.protoAction = options.protoAction; - } else { - throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`); - } - } - } - var at2, ch, escapee = { - '"': '"', - "\\": "\\", - "/": "/", - b: "\b", - f: "\f", - n: ` -`, - r: "\r", - t: "\t" - }, text, error45 = function(m) { - throw { - name: "SyntaxError", - message: m, - at: at2, - text - }; - }, next = function(c5) { - if (c5 && c5 !== ch) { - error45("Expected '" + c5 + "' instead of '" + ch + "'"); - } - ch = text.charAt(at2); - at2 += 1; - return ch; - }, number4 = function() { - var number5, string5 = ""; - if (ch === "-") { - string5 = "-"; - next("-"); - } - while (ch >= "0" && ch <= "9") { - string5 += ch; - next(); - } - if (ch === ".") { - string5 += "."; - while (next() && ch >= "0" && ch <= "9") { - string5 += ch; - } - } - if (ch === "e" || ch === "E") { - string5 += ch; - next(); - if (ch === "-" || ch === "+") { - string5 += ch; - next(); - } - while (ch >= "0" && ch <= "9") { - string5 += ch; - next(); - } - } - number5 = +string5; - if (!isFinite(number5)) { - error45("Bad number"); - } else { - if (BigNumber == null) - BigNumber = require_bignumber2(); - if (string5.length > 15) - return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber(string5); - else - return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber(number5); - } - }, string4 = function() { - var hex, i2, string5 = "", uffff; - if (ch === '"') { - var startAt = at2; - while (next()) { - if (ch === '"') { - if (at2 - 1 > startAt) - string5 += text.substring(startAt, at2 - 1); - next(); - return string5; - } - if (ch === "\\") { - if (at2 - 1 > startAt) - string5 += text.substring(startAt, at2 - 1); - next(); - if (ch === "u") { - uffff = 0; - for (i2 = 0;i2 < 4; i2 += 1) { - hex = parseInt(next(), 16); - if (!isFinite(hex)) { - break; - } - uffff = uffff * 16 + hex; - } - string5 += String.fromCharCode(uffff); - } else if (typeof escapee[ch] === "string") { - string5 += escapee[ch]; - } else { - break; - } - startAt = at2; - } - } - } - error45("Bad string"); - }, white2 = function() { - while (ch && ch <= " ") { - next(); - } - }, word = function() { - switch (ch) { - case "t": - next("t"); - next("r"); - next("u"); - next("e"); - return true; - case "f": - next("f"); - next("a"); - next("l"); - next("s"); - next("e"); - return false; - case "n": - next("n"); - next("u"); - next("l"); - next("l"); - return null; - } - error45("Unexpected '" + ch + "'"); - }, value, array2 = function() { - var array3 = []; - if (ch === "[") { - next("["); - white2(); - if (ch === "]") { - next("]"); - return array3; - } - while (ch) { - array3.push(value()); - white2(); - if (ch === "]") { - next("]"); - return array3; - } - next(","); - white2(); - } - } - error45("Bad array"); - }, object2 = function() { - var key, object3 = Object.create(null); - if (ch === "{") { - next("{"); - white2(); - if (ch === "}") { - next("}"); - return object3; - } - while (ch) { - key = string4(); - white2(); - next(":"); - if (_options.strict === true && Object.hasOwnProperty.call(object3, key)) { - error45('Duplicate key "' + key + '"'); - } - if (suspectProtoRx.test(key) === true) { - if (_options.protoAction === "error") { - error45("Object contains forbidden prototype property"); - } else if (_options.protoAction === "ignore") { - value(); - } else { - object3[key] = value(); - } - } else if (suspectConstructorRx.test(key) === true) { - if (_options.constructorAction === "error") { - error45("Object contains forbidden constructor property"); - } else if (_options.constructorAction === "ignore") { - value(); - } else { - object3[key] = value(); - } - } else { - object3[key] = value(); - } - white2(); - if (ch === "}") { - next("}"); - return object3; - } - next(","); - white2(); - } - } - error45("Bad object"); - }; - value = function() { - white2(); - switch (ch) { - case "{": - return object2(); - case "[": - return array2(); - case '"': - return string4(); - case "-": - return number4(); - default: - return ch >= "0" && ch <= "9" ? number4() : word(); - } - }; - return function(source, reviver) { - var result2; - text = source + ""; - at2 = 0; - ch = " "; - result2 = value(); - white2(); - if (ch) { - error45("Syntax error"); - } - return typeof reviver === "function" ? function walk(holder, key) { - var k, v, value2 = holder[key]; - if (value2 && typeof value2 === "object") { - Object.keys(value2).forEach(function(k2) { - v = walk(value2, k2); - if (v !== undefined) { - value2[k2] = v; - } else { - delete value2[k2]; - } - }); - } - return reviver.call(holder, key, value2); - }({ "": result2 }, "") : result2; - }; - }; - module.exports = json_parse; -}); - -// node_modules/json-bigint/index.js -var require_json_bigint2 = __commonJS((exports, module) => { - var json_stringify = require_stringify4().stringify; - var json_parse = require_parse6(); - module.exports = function(options) { - return { - parse: json_parse(options), - stringify: json_stringify - }; - }; - module.exports.parse = json_parse(); - module.exports.stringify = json_stringify; -}); - -// node_modules/gcp-metadata/build/src/gcp-residency.js -var require_gcp_residency2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GCE_LINUX_BIOS_PATHS = undefined; - exports.isGoogleCloudServerless = isGoogleCloudServerless; - exports.isGoogleComputeEngineLinux = isGoogleComputeEngineLinux; - exports.isGoogleComputeEngineMACAddress = isGoogleComputeEngineMACAddress; - exports.isGoogleComputeEngine = isGoogleComputeEngine; - exports.detectGCPResidency = detectGCPResidency; - var fs_1 = __require("fs"); - var os_1 = __require("os"); - exports.GCE_LINUX_BIOS_PATHS = { - BIOS_DATE: "/sys/class/dmi/id/bios_date", - BIOS_VENDOR: "/sys/class/dmi/id/bios_vendor" - }; - var GCE_MAC_ADDRESS_REGEX = /^42:01/; - function isGoogleCloudServerless() { - const isGFEnvironment = process.env.CLOUD_RUN_JOB || process.env.FUNCTION_NAME || process.env.K_SERVICE; - return !!isGFEnvironment; - } - function isGoogleComputeEngineLinux() { - if ((0, os_1.platform)() !== "linux") - return false; - try { - (0, fs_1.statSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_DATE); - const biosVendor = (0, fs_1.readFileSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR, "utf8"); - return /Google/.test(biosVendor); - } catch (_a3) { - return false; - } - } - function isGoogleComputeEngineMACAddress() { - const interfaces = (0, os_1.networkInterfaces)(); - for (const item of Object.values(interfaces)) { - if (!item) - continue; - for (const { mac } of item) { - if (GCE_MAC_ADDRESS_REGEX.test(mac)) { - return true; - } - } - } - return false; - } - function isGoogleComputeEngine() { - return isGoogleComputeEngineLinux() || isGoogleComputeEngineMACAddress(); - } - function detectGCPResidency() { - return isGoogleCloudServerless() || isGoogleComputeEngine(); - } -}); - -// node_modules/google-logging-utils/build/src/colours.js -var require_colours2 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Colours = undefined; - - class Colours { - static isEnabled(stream4) { - return stream4.isTTY && (typeof stream4.getColorDepth === "function" ? stream4.getColorDepth() > 2 : true); - } - static refresh() { - Colours.enabled = Colours.isEnabled(process.stderr); - if (!this.enabled) { - Colours.reset = ""; - Colours.bright = ""; - Colours.dim = ""; - Colours.red = ""; - Colours.green = ""; - Colours.yellow = ""; - Colours.blue = ""; - Colours.magenta = ""; - Colours.cyan = ""; - Colours.white = ""; - Colours.grey = ""; - } else { - Colours.reset = "\x1B[0m"; - Colours.bright = "\x1B[1m"; - Colours.dim = "\x1B[2m"; - Colours.red = "\x1B[31m"; - Colours.green = "\x1B[32m"; - Colours.yellow = "\x1B[33m"; - Colours.blue = "\x1B[34m"; - Colours.magenta = "\x1B[35m"; - Colours.cyan = "\x1B[36m"; - Colours.white = "\x1B[37m"; - Colours.grey = "\x1B[90m"; - } - } - } - exports.Colours = Colours; - Colours.enabled = false; - Colours.reset = ""; - Colours.bright = ""; - Colours.dim = ""; - Colours.red = ""; - Colours.green = ""; - Colours.yellow = ""; - Colours.blue = ""; - Colours.magenta = ""; - Colours.cyan = ""; - Colours.white = ""; - Colours.grey = ""; - Colours.refresh(); -}); - -// node_modules/google-logging-utils/build/src/logging-utils.js -var require_logging_utils2 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o2, v) { - Object.defineProperty(o2, "default", { enumerable: true, value: v }); - } : function(o2, v) { - o2["default"] = v; - }); - var __importStar = exports && exports.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result2 = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result2, mod2, k); - } - __setModuleDefault(result2, mod2); - return result2; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.env = exports.DebugLogBackendBase = exports.placeholder = exports.AdhocDebugLogger = exports.LogSeverity = undefined; - exports.getNodeBackend = getNodeBackend; - exports.getDebugBackend = getDebugBackend; - exports.getStructuredBackend = getStructuredBackend; - exports.setBackend = setBackend; - exports.log = log2; - var node_events_1 = __require("node:events"); - var process12 = __importStar(__require("node:process")); - var util3 = __importStar(__require("node:util")); - var colours_1 = require_colours2(); - var LogSeverity; - (function(LogSeverity2) { - LogSeverity2["DEFAULT"] = "DEFAULT"; - LogSeverity2["DEBUG"] = "DEBUG"; - LogSeverity2["INFO"] = "INFO"; - LogSeverity2["WARNING"] = "WARNING"; - LogSeverity2["ERROR"] = "ERROR"; - })(LogSeverity || (exports.LogSeverity = LogSeverity = {})); - - class AdhocDebugLogger extends node_events_1.EventEmitter { - constructor(namespace, upstream) { - super(); - this.namespace = namespace; - this.upstream = upstream; - this.func = Object.assign(this.invoke.bind(this), { - instance: this, - on: (event, listener) => this.on(event, listener) - }); - this.func.debug = (...args) => this.invokeSeverity(LogSeverity.DEBUG, ...args); - this.func.info = (...args) => this.invokeSeverity(LogSeverity.INFO, ...args); - this.func.warn = (...args) => this.invokeSeverity(LogSeverity.WARNING, ...args); - this.func.error = (...args) => this.invokeSeverity(LogSeverity.ERROR, ...args); - this.func.sublog = (namespace2) => log2(namespace2, this.func); - } - invoke(fields, ...args) { - if (this.upstream) { - this.upstream(fields, ...args); - } - this.emit("log", fields, args); - } - invokeSeverity(severity, ...args) { - this.invoke({ severity }, ...args); - } - } - exports.AdhocDebugLogger = AdhocDebugLogger; - exports.placeholder = new AdhocDebugLogger("", () => {}).func; - - class DebugLogBackendBase { - constructor() { - var _a3; - this.cached = new Map; - this.filters = []; - this.filtersSet = false; - let nodeFlag = (_a3 = process12.env[exports.env.nodeEnables]) !== null && _a3 !== undefined ? _a3 : "*"; - if (nodeFlag === "all") { - nodeFlag = "*"; - } - this.filters = nodeFlag.split(","); - } - log(namespace, fields, ...args) { - try { - if (!this.filtersSet) { - this.setFilters(); - this.filtersSet = true; - } - let logger = this.cached.get(namespace); - if (!logger) { - logger = this.makeLogger(namespace); - this.cached.set(namespace, logger); - } - logger(fields, ...args); - } catch (e) { - console.error(e); - } - } - } - exports.DebugLogBackendBase = DebugLogBackendBase; - - class NodeBackend extends DebugLogBackendBase { - constructor() { - super(...arguments); - this.enabledRegexp = /.*/g; - } - isEnabled(namespace) { - return this.enabledRegexp.test(namespace); - } - makeLogger(namespace) { - if (!this.enabledRegexp.test(namespace)) { - return () => {}; - } - return (fields, ...args) => { - var _a3; - const nscolour = `${colours_1.Colours.green}${namespace}${colours_1.Colours.reset}`; - const pid = `${colours_1.Colours.yellow}${process12.pid}${colours_1.Colours.reset}`; - let level; - switch (fields.severity) { - case LogSeverity.ERROR: - level = `${colours_1.Colours.red}${fields.severity}${colours_1.Colours.reset}`; - break; - case LogSeverity.INFO: - level = `${colours_1.Colours.magenta}${fields.severity}${colours_1.Colours.reset}`; - break; - case LogSeverity.WARNING: - level = `${colours_1.Colours.yellow}${fields.severity}${colours_1.Colours.reset}`; - break; - default: - level = (_a3 = fields.severity) !== null && _a3 !== undefined ? _a3 : LogSeverity.DEFAULT; - break; - } - const msg = util3.formatWithOptions({ colors: colours_1.Colours.enabled }, ...args); - const filteredFields = Object.assign({}, fields); - delete filteredFields.severity; - const fieldsJson = Object.getOwnPropertyNames(filteredFields).length ? JSON.stringify(filteredFields) : ""; - const fieldsColour = fieldsJson ? `${colours_1.Colours.grey}${fieldsJson}${colours_1.Colours.reset}` : ""; - console.error("%s [%s|%s] %s%s", pid, nscolour, level, msg, fieldsJson ? ` ${fieldsColour}` : ""); - }; - } - setFilters() { - const totalFilters = this.filters.join(","); - const regexp = totalFilters.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^"); - this.enabledRegexp = new RegExp(`^${regexp}$`, "i"); - } - } - function getNodeBackend() { - return new NodeBackend; - } - - class DebugBackend extends DebugLogBackendBase { - constructor(pkg) { - super(); - this.debugPkg = pkg; - } - makeLogger(namespace) { - const debugLogger = this.debugPkg(namespace); - return (fields, ...args) => { - debugLogger(args[0], ...args.slice(1)); - }; - } - setFilters() { - var _a3; - const existingFilters = (_a3 = process12.env["NODE_DEBUG"]) !== null && _a3 !== undefined ? _a3 : ""; - process12.env["NODE_DEBUG"] = `${existingFilters}${existingFilters ? "," : ""}${this.filters.join(",")}`; - } - } - function getDebugBackend(debugPkg) { - return new DebugBackend(debugPkg); - } - - class StructuredBackend extends DebugLogBackendBase { - constructor(upstream) { - var _a3; - super(); - this.upstream = (_a3 = upstream) !== null && _a3 !== undefined ? _a3 : new NodeBackend; - } - makeLogger(namespace) { - const debugLogger = this.upstream.makeLogger(namespace); - return (fields, ...args) => { - var _a3; - const severity = (_a3 = fields.severity) !== null && _a3 !== undefined ? _a3 : LogSeverity.INFO; - const json2 = Object.assign({ - severity, - message: util3.format(...args) - }, fields); - const jsonString = JSON.stringify(json2); - debugLogger(fields, jsonString); - }; - } - setFilters() { - this.upstream.setFilters(); - } - } - function getStructuredBackend(upstream) { - return new StructuredBackend(upstream); - } - exports.env = { - nodeEnables: "GOOGLE_SDK_NODE_LOGGING" - }; - var loggerCache = new Map; - var cachedBackend = undefined; - function setBackend(backend) { - cachedBackend = backend; - loggerCache.clear(); - } - function log2(namespace, parent2) { - const enablesFlag = process12.env[exports.env.nodeEnables]; - if (!enablesFlag) { - return exports.placeholder; - } - if (!namespace) { - return exports.placeholder; - } - if (parent2) { - namespace = `${parent2.instance.namespace}:${namespace}`; - } - const existing = loggerCache.get(namespace); - if (existing) { - return existing.func; - } - if (cachedBackend === null) { - return exports.placeholder; - } else if (cachedBackend === undefined) { - cachedBackend = getNodeBackend(); - } - const logger = (() => { - let previousBackend = undefined; - const newLogger = new AdhocDebugLogger(namespace, (fields, ...args) => { - if (previousBackend !== cachedBackend) { - if (cachedBackend === null) { - return; - } else if (cachedBackend === undefined) { - cachedBackend = getNodeBackend(); - } - previousBackend = cachedBackend; - } - cachedBackend === null || cachedBackend === undefined || cachedBackend.log(namespace, fields, ...args); - }); - return newLogger; - })(); - loggerCache.set(namespace, logger); - return logger.func; - } -}); - -// node_modules/google-logging-utils/build/src/index.js -var require_src9 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(require_logging_utils2(), exports); -}); - -// node_modules/gcp-metadata/build/src/index.js -var require_src10 = __commonJS((exports) => { - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o2, k2, desc); - } : function(o2, m, k, k2) { - if (k2 === undefined) - k2 = k; - o2[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.gcpResidencyCache = exports.METADATA_SERVER_DETECTION = exports.HEADERS = exports.HEADER_VALUE = exports.HEADER_NAME = exports.SECONDARY_HOST_ADDRESS = exports.HOST_ADDRESS = exports.BASE_PATH = undefined; - exports.instance = instance; - exports.project = project; - exports.universe = universe; - exports.bulk = bulk; - exports.isAvailable = isAvailable; - exports.resetIsAvailableCache = resetIsAvailableCache; - exports.getGCPResidency = getGCPResidency; - exports.setGCPResidency = setGCPResidency; - exports.requestTimeout = requestTimeout; - var gaxios_1 = require_src8(); - var jsonBigint = require_json_bigint2(); - var gcp_residency_1 = require_gcp_residency2(); - var logger = require_src9(); - exports.BASE_PATH = "/computeMetadata/v1"; - exports.HOST_ADDRESS = "http://169.254.169.254"; - exports.SECONDARY_HOST_ADDRESS = "http://metadata.google.internal."; - exports.HEADER_NAME = "Metadata-Flavor"; - exports.HEADER_VALUE = "Google"; - exports.HEADERS = Object.freeze({ [exports.HEADER_NAME]: exports.HEADER_VALUE }); - var log2 = logger.log("gcp metadata"); - exports.METADATA_SERVER_DETECTION = Object.freeze({ - "assume-present": "don't try to ping the metadata server, but assume it's present", - none: "don't try to ping the metadata server, but don't try to use it either", - "bios-only": "treat the result of a BIOS probe as canonical (don't fall back to pinging)", - "ping-only": "skip the BIOS probe, and go straight to pinging" - }); - function getBaseUrl(baseUrl) { - if (!baseUrl) { - baseUrl = process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST || exports.HOST_ADDRESS; - } - if (!/^https?:\/\//.test(baseUrl)) { - baseUrl = `http://${baseUrl}`; - } - return new URL(exports.BASE_PATH, baseUrl).href; - } - function validate2(options) { - Object.keys(options).forEach((key) => { - switch (key) { - case "params": - case "property": - case "headers": - break; - case "qs": - throw new Error("'qs' is not a valid configuration option. Please use 'params' instead."); - default: - throw new Error(`'${key}' is not a valid configuration option.`); - } - }); - } - async function metadataAccessor(type, options = {}, noResponseRetries = 3, fastFail = false) { - let metadataKey = ""; - let params = {}; - let headers = {}; - if (typeof type === "object") { - const metadataAccessor2 = type; - metadataKey = metadataAccessor2.metadataKey; - params = metadataAccessor2.params || params; - headers = metadataAccessor2.headers || headers; - noResponseRetries = metadataAccessor2.noResponseRetries || noResponseRetries; - fastFail = metadataAccessor2.fastFail || fastFail; - } else { - metadataKey = type; - } - if (typeof options === "string") { - metadataKey += `/${options}`; - } else { - validate2(options); - if (options.property) { - metadataKey += `/${options.property}`; - } - headers = options.headers || headers; - params = options.params || params; - } - const requestMethod = fastFail ? fastFailMetadataRequest : gaxios_1.request; - const req = { - url: `${getBaseUrl()}/${metadataKey}`, - headers: { ...exports.HEADERS, ...headers }, - retryConfig: { noResponseRetries }, - params, - responseType: "text", - timeout: requestTimeout() - }; - log2.info("instance request %j", req); - const res = await requestMethod(req); - log2.info("instance metadata is %s", res.data); - if (res.headers[exports.HEADER_NAME.toLowerCase()] !== exports.HEADER_VALUE) { - throw new Error(`Invalid response from metadata service: incorrect ${exports.HEADER_NAME} header. Expected '${exports.HEADER_VALUE}', got ${res.headers[exports.HEADER_NAME.toLowerCase()] ? `'${res.headers[exports.HEADER_NAME.toLowerCase()]}'` : "no header"}`); - } - if (typeof res.data === "string") { - try { - return jsonBigint.parse(res.data); - } catch (_a3) {} - } - return res.data; - } - async function fastFailMetadataRequest(options) { - var _a3; - const secondaryOptions = { - ...options, - url: (_a3 = options.url) === null || _a3 === undefined ? undefined : _a3.toString().replace(getBaseUrl(), getBaseUrl(exports.SECONDARY_HOST_ADDRESS)) - }; - let responded = false; - const r1 = (0, gaxios_1.request)(options).then((res) => { - responded = true; - return res; - }).catch((err) => { - if (responded) { - return r2; - } else { - responded = true; - throw err; - } - }); - const r2 = (0, gaxios_1.request)(secondaryOptions).then((res) => { - responded = true; - return res; - }).catch((err) => { - if (responded) { - return r1; - } else { - responded = true; - throw err; - } - }); - return Promise.race([r1, r2]); - } - function instance(options) { - return metadataAccessor("instance", options); - } - function project(options) { - return metadataAccessor("project", options); - } - function universe(options) { - return metadataAccessor("universe", options); - } - async function bulk(properties) { - const r = {}; - await Promise.all(properties.map((item) => { - return (async () => { - const res = await metadataAccessor(item); - const key = item.metadataKey; - r[key] = res; - })(); - })); - return r; - } - function detectGCPAvailableRetries() { - return process.env.DETECT_GCP_RETRIES ? Number(process.env.DETECT_GCP_RETRIES) : 0; - } - var cachedIsAvailableResponse; - async function isAvailable() { - if (process.env.METADATA_SERVER_DETECTION) { - const value = process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase(); - if (!(value in exports.METADATA_SERVER_DETECTION)) { - throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${value}\`, but it should be \`${Object.keys(exports.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`); - } - switch (value) { - case "assume-present": - return true; - case "none": - return false; - case "bios-only": - return getGCPResidency(); - case "ping-only": - } - } - try { - if (cachedIsAvailableResponse === undefined) { - cachedIsAvailableResponse = metadataAccessor("instance", undefined, detectGCPAvailableRetries(), !(process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST)); - } - await cachedIsAvailableResponse; - return true; - } catch (e) { - const err = e; - if (process.env.DEBUG_AUTH) { - console.info(err); - } - if (err.type === "request-timeout") { - return false; - } - if (err.response && err.response.status === 404) { - return false; - } else { - if (!(err.response && err.response.status === 404) && (!err.code || ![ - "EHOSTDOWN", - "EHOSTUNREACH", - "ENETUNREACH", - "ENOENT", - "ENOTFOUND", - "ECONNREFUSED" - ].includes(err.code))) { - let code = "UNKNOWN"; - if (err.code) - code = err.code; - process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, "MetadataLookupWarning"); - } - return false; - } - } - } - function resetIsAvailableCache() { - cachedIsAvailableResponse = undefined; - } - exports.gcpResidencyCache = null; - function getGCPResidency() { - if (exports.gcpResidencyCache === null) { - setGCPResidency(); - } - return exports.gcpResidencyCache; - } - function setGCPResidency(value = null) { - exports.gcpResidencyCache = value !== null ? value : (0, gcp_residency_1.detectGCPResidency)(); - } - function requestTimeout() { - return getGCPResidency() ? 0 : 3000; - } - __exportStar(require_gcp_residency2(), exports); -}); - -// node_modules/base64-js/index.js -var require_base64_js2 = __commonJS((exports) => { - exports.byteLength = byteLength; - exports.toByteArray = toByteArray; - exports.fromByteArray = fromByteArray; - var lookup = []; - var revLookup = []; - var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; - var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - for (i2 = 0, len = code.length;i2 < len; ++i2) { - lookup[i2] = code[i2]; - revLookup[code.charCodeAt(i2)] = i2; - } - var i2; - var len; - revLookup[45] = 62; - revLookup[95] = 63; - function getLens(b64) { - var len2 = b64.length; - if (len2 % 4 > 0) { - throw new Error("Invalid string. Length must be a multiple of 4"); - } - var validLen = b64.indexOf("="); - if (validLen === -1) - validLen = len2; - var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; - return [validLen, placeHoldersLen]; - } - function byteLength(b64) { - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; - } - function _byteLength(b64, validLen, placeHoldersLen) { - return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; - } - function toByteArray(b64) { - var tmp; - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); - var curByte = 0; - var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; - var i3; - for (i3 = 0;i3 < len2; i3 += 4) { - tmp = revLookup[b64.charCodeAt(i3)] << 18 | revLookup[b64.charCodeAt(i3 + 1)] << 12 | revLookup[b64.charCodeAt(i3 + 2)] << 6 | revLookup[b64.charCodeAt(i3 + 3)]; - arr[curByte++] = tmp >> 16 & 255; - arr[curByte++] = tmp >> 8 & 255; - arr[curByte++] = tmp & 255; - } - if (placeHoldersLen === 2) { - tmp = revLookup[b64.charCodeAt(i3)] << 2 | revLookup[b64.charCodeAt(i3 + 1)] >> 4; - arr[curByte++] = tmp & 255; - } - if (placeHoldersLen === 1) { - tmp = revLookup[b64.charCodeAt(i3)] << 10 | revLookup[b64.charCodeAt(i3 + 1)] << 4 | revLookup[b64.charCodeAt(i3 + 2)] >> 2; - arr[curByte++] = tmp >> 8 & 255; - arr[curByte++] = tmp & 255; - } - return arr; - } - function tripletToBase64(num) { - return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; - } - function encodeChunk(uint8, start, end) { - var tmp; - var output = []; - for (var i3 = start;i3 < end; i3 += 3) { - tmp = (uint8[i3] << 16 & 16711680) + (uint8[i3 + 1] << 8 & 65280) + (uint8[i3 + 2] & 255); - output.push(tripletToBase64(tmp)); - } - return output.join(""); - } - function fromByteArray(uint8) { - var tmp; - var len2 = uint8.length; - var extraBytes = len2 % 3; - var parts = []; - var maxChunkLength = 16383; - for (var i3 = 0, len22 = len2 - extraBytes;i3 < len22; i3 += maxChunkLength) { - parts.push(encodeChunk(uint8, i3, i3 + maxChunkLength > len22 ? len22 : i3 + maxChunkLength)); - } - if (extraBytes === 1) { - tmp = uint8[len2 - 1]; - parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); - } else if (extraBytes === 2) { - tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; - parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); - } - return parts.join(""); - } -}); - -// node_modules/google-auth-library/build/src/crypto/browser/crypto.js -var require_crypto4 = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BrowserCrypto = undefined; - var base64js = require_base64_js2(); - var crypto_1 = require_crypto6(); - - class BrowserCrypto { - constructor() { - if (typeof window === "undefined" || window.crypto === undefined || window.crypto.subtle === undefined) { - throw new Error("SubtleCrypto not found. Make sure it's an https:// website."); - } - } - async sha256DigestBase64(str) { - const inputBuffer = new TextEncoder().encode(str); - const outputBuffer = await window.crypto.subtle.digest("SHA-256", inputBuffer); - return base64js.fromByteArray(new Uint8Array(outputBuffer)); - } - randomBytesBase64(count3) { - const array2 = new Uint8Array(count3); - window.crypto.getRandomValues(array2); - return base64js.fromByteArray(array2); - } - static padBase64(base644) { - while (base644.length % 4 !== 0) { - base644 += "="; - } - return base644; - } - async verify(pubkey, data, signature) { - const algo = { - name: "RSASSA-PKCS1-v1_5", - hash: { name: "SHA-256" } - }; - const dataArray = new TextEncoder().encode(data); - const signatureArray = base64js.toByteArray(BrowserCrypto.padBase64(signature)); - const cryptoKey = await window.crypto.subtle.importKey("jwk", pubkey, algo, true, ["verify"]); - const result2 = await window.crypto.subtle.verify(algo, cryptoKey, signatureArray, dataArray); - return result2; - } - async sign(privateKey, data) { - const algo = { - name: "RSASSA-PKCS1-v1_5", - hash: { name: "SHA-256" } - }; - const dataArray = new TextEncoder().encode(data); - const cryptoKey = await window.crypto.subtle.importKey("jwk", privateKey, algo, true, ["sign"]); - const result2 = await window.crypto.subtle.sign(algo, cryptoKey, dataArray); - return base64js.fromByteArray(new Uint8Array(result2)); - } - decodeBase64StringUtf8(base644) { - const uint8array = base64js.toByteArray(BrowserCrypto.padBase64(base644)); + decodeBase64StringUtf8(base643) { + const uint8array = base64js.toByteArray(BrowserCrypto.padBase64(base643)); const result2 = new TextDecoder().decode(uint8array); return result2; } @@ -173025,7 +118712,7 @@ var require_crypto4 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/crypto/node/crypto.js -var require_crypto5 = __commonJS((exports) => { +var require_crypto2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeCrypto = undefined; var crypto3 = __require("crypto"); @@ -173049,8 +118736,8 @@ var require_crypto5 = __commonJS((exports) => { signer.end(); return signer.sign(privateKey, "base64"); } - decodeBase64StringUtf8(base644) { - return Buffer.from(base644, "base64").toString("utf-8"); + decodeBase64StringUtf8(base643) { + return Buffer.from(base643, "base64").toString("utf-8"); } encodeBase64StringUtf8(text) { return Buffer.from(text, "utf-8").toString("base64"); @@ -173073,13 +118760,13 @@ var require_crypto5 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/crypto/crypto.js -var require_crypto6 = __commonJS((exports) => { +var require_crypto3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createCrypto = createCrypto; exports.hasBrowserCrypto = hasBrowserCrypto; exports.fromArrayBufferToHex = fromArrayBufferToHex; - var crypto_1 = require_crypto4(); - var crypto_2 = require_crypto5(); + var crypto_1 = require_crypto(); + var crypto_2 = require_crypto2(); function createCrypto() { if (hasBrowserCrypto()) { return new crypto_1.BrowserCrypto; @@ -173098,7 +118785,7 @@ var require_crypto6 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/options.js -var require_options2 = __commonJS((exports) => { +var require_options = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validate = validate2; function validate2(options) { @@ -173117,7 +118804,7 @@ var require_options2 = __commonJS((exports) => { }); // node_modules/google-auth-library/package.json -var require_package11 = __commonJS((exports, module) => { +var require_package3 = __commonJS((exports, module) => { module.exports = { name: "google-auth-library", version: "9.15.1", @@ -173215,12 +118902,12 @@ var require_package11 = __commonJS((exports, module) => { }); // node_modules/google-auth-library/build/src/transporters.js -var require_transporters2 = __commonJS((exports) => { +var require_transporters = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultTransporter = undefined; - var gaxios_1 = require_src8(); - var options_1 = require_options2(); - var pkg = require_package11(); + var gaxios_1 = require_src2(); + var options_1 = require_options(); + var pkg = require_package3(); var PRODUCT_NAME = "google-api-nodejs-client"; class DefaultTransporter { @@ -173285,7 +118972,7 @@ var require_transporters2 = __commonJS((exports) => { }); // node_modules/safe-buffer/index.js -var require_safe_buffer2 = __commonJS((exports, module) => { +var require_safe_buffer = __commonJS((exports, module) => { /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var buffer = __require("buffer"); var Buffer7 = buffer.Buffer; @@ -173342,7 +119029,7 @@ var require_safe_buffer2 = __commonJS((exports, module) => { }); // node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js -var require_param_bytes_for_alg2 = __commonJS((exports, module) => { +var require_param_bytes_for_alg = __commonJS((exports, module) => { function getParamSize(keySize) { var result2 = (keySize / 8 | 0) + (keySize % 8 === 0 ? 0 : 1); return result2; @@ -173363,9 +119050,9 @@ var require_param_bytes_for_alg2 = __commonJS((exports, module) => { }); // node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js -var require_ecdsa_sig_formatter2 = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer2().Buffer; - var getParamBytesForAlg = require_param_bytes_for_alg2(); +var require_ecdsa_sig_formatter = __commonJS((exports, module) => { + var Buffer7 = require_safe_buffer().Buffer; + var getParamBytesForAlg = require_param_bytes_for_alg(); var MAX_OCTET = 128; var CLASS_UNIVERSAL = 0; var PRIMITIVE_BIT = 32; @@ -173373,8 +119060,8 @@ var require_ecdsa_sig_formatter2 = __commonJS((exports, module) => { var TAG_INT = 2; var ENCODED_TAG_SEQ = TAG_SEQ | PRIMITIVE_BIT | CLASS_UNIVERSAL << 6; var ENCODED_TAG_INT = TAG_INT | CLASS_UNIVERSAL << 6; - function base64Url(base644) { - return base644.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + function base64Url(base643) { + return base643.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); } function signatureAsBuffer(signature) { if (Buffer7.isBuffer(signature)) { @@ -173500,8 +119187,8 @@ var require_ecdsa_sig_formatter2 = __commonJS((exports, module) => { }); // node_modules/google-auth-library/build/src/util.js -var require_util10 = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { +var require_util8 = __commonJS((exports) => { + var __classPrivateFieldGet2 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) @@ -173521,9 +119208,9 @@ var require_util10 = __commonJS((exports) => { } function originalOrCamelOptions(obj) { function get2(key) { - var _a3; + var _a2; const o2 = obj || {}; - return (_a3 = o2[key]) !== null && _a3 !== undefined ? _a3 : o2[snakeToCamel(key)]; + return (_a2 = o2[key]) !== null && _a2 !== undefined ? _a2 : o2[snakeToCamel(key)]; } return { get: get2 }; } @@ -173536,49 +119223,49 @@ var require_util10 = __commonJS((exports) => { this.maxAge = options.maxAge; } set(key, value) { - __classPrivateFieldGet3(this, _LRUCache_instances, "m", _LRUCache_moveToEnd).call(this, key, value); - __classPrivateFieldGet3(this, _LRUCache_instances, "m", _LRUCache_evict).call(this); + __classPrivateFieldGet2(this, _LRUCache_instances, "m", _LRUCache_moveToEnd).call(this, key, value); + __classPrivateFieldGet2(this, _LRUCache_instances, "m", _LRUCache_evict).call(this); } get(key) { - const item = __classPrivateFieldGet3(this, _LRUCache_cache, "f").get(key); + const item = __classPrivateFieldGet2(this, _LRUCache_cache, "f").get(key); if (!item) return; - __classPrivateFieldGet3(this, _LRUCache_instances, "m", _LRUCache_moveToEnd).call(this, key, item.value); - __classPrivateFieldGet3(this, _LRUCache_instances, "m", _LRUCache_evict).call(this); + __classPrivateFieldGet2(this, _LRUCache_instances, "m", _LRUCache_moveToEnd).call(this, key, item.value); + __classPrivateFieldGet2(this, _LRUCache_instances, "m", _LRUCache_evict).call(this); return item.value; } } exports.LRUCache = LRUCache; _LRUCache_cache = new WeakMap, _LRUCache_instances = new WeakSet, _LRUCache_moveToEnd = function _LRUCache_moveToEnd(key, value) { - __classPrivateFieldGet3(this, _LRUCache_cache, "f").delete(key); - __classPrivateFieldGet3(this, _LRUCache_cache, "f").set(key, { + __classPrivateFieldGet2(this, _LRUCache_cache, "f").delete(key); + __classPrivateFieldGet2(this, _LRUCache_cache, "f").set(key, { value, lastAccessed: Date.now() }); }, _LRUCache_evict = function _LRUCache_evict() { const cutoffDate = this.maxAge ? Date.now() - this.maxAge : 0; - let oldestItem = __classPrivateFieldGet3(this, _LRUCache_cache, "f").entries().next(); - while (!oldestItem.done && (__classPrivateFieldGet3(this, _LRUCache_cache, "f").size > this.capacity || oldestItem.value[1].lastAccessed < cutoffDate)) { - __classPrivateFieldGet3(this, _LRUCache_cache, "f").delete(oldestItem.value[0]); - oldestItem = __classPrivateFieldGet3(this, _LRUCache_cache, "f").entries().next(); + let oldestItem = __classPrivateFieldGet2(this, _LRUCache_cache, "f").entries().next(); + while (!oldestItem.done && (__classPrivateFieldGet2(this, _LRUCache_cache, "f").size > this.capacity || oldestItem.value[1].lastAccessed < cutoffDate)) { + __classPrivateFieldGet2(this, _LRUCache_cache, "f").delete(oldestItem.value[0]); + oldestItem = __classPrivateFieldGet2(this, _LRUCache_cache, "f").entries().next(); } }; }); // node_modules/google-auth-library/build/src/auth/authclient.js -var require_authclient2 = __commonJS((exports) => { +var require_authclient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthClient = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = exports.DEFAULT_UNIVERSE = undefined; var events_1 = __require("events"); - var gaxios_1 = require_src8(); - var transporters_1 = require_transporters2(); - var util_1 = require_util10(); + var gaxios_1 = require_src2(); + var transporters_1 = require_transporters(); + var util_1 = require_util8(); exports.DEFAULT_UNIVERSE = "googleapis.com"; exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = 5 * 60 * 1000; class AuthClient extends events_1.EventEmitter { constructor(opts = {}) { - var _a3, _b, _c, _d, _e; + var _a2, _b, _c, _d, _e; super(); this.credentials = {}; this.eagerRefreshThresholdMillis = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS; @@ -173586,7 +119273,7 @@ var require_authclient2 = __commonJS((exports) => { this.universeDomain = exports.DEFAULT_UNIVERSE; const options = (0, util_1.originalOrCamelOptions)(opts); this.apiKey = opts.apiKey; - this.projectId = (_a3 = options.get("project_id")) !== null && _a3 !== undefined ? _a3 : null; + this.projectId = (_a2 = options.get("project_id")) !== null && _a2 !== undefined ? _a2 : null; this.quotaProjectId = options.get("quota_project_id"); this.credentials = (_b = options.get("credentials")) !== null && _b !== undefined ? _b : {}; this.universeDomain = (_c = options.get("universe_domain")) !== null && _c !== undefined ? _c : exports.DEFAULT_UNIVERSE; @@ -173631,13 +119318,13 @@ var require_authclient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/loginticket.js -var require_loginticket2 = __commonJS((exports) => { +var require_loginticket = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.LoginTicket = undefined; class LoginTicket { - constructor(env5, pay) { - this.envelope = env5; + constructor(env4, pay) { + this.envelope = env4; this.payload = pay; } getEnvelope() { @@ -173661,16 +119348,16 @@ var require_loginticket2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/oauth2client.js -var require_oauth2client2 = __commonJS((exports) => { +var require_oauth2client = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OAuth2Client = exports.ClientAuthentication = exports.CertificateFormat = exports.CodeChallengeMethod = undefined; - var gaxios_1 = require_src8(); + var gaxios_1 = require_src2(); var querystring = __require("querystring"); var stream4 = __require("stream"); - var formatEcdsa = require_ecdsa_sig_formatter2(); - var crypto_1 = require_crypto6(); - var authclient_1 = require_authclient2(); - var loginticket_1 = require_loginticket2(); + var formatEcdsa = require_ecdsa_sig_formatter(); + var crypto_1 = require_crypto3(); + var authclient_1 = require_authclient(); + var loginticket_1 = require_loginticket(); var CodeChallengeMethod; (function(CodeChallengeMethod2) { CodeChallengeMethod2["Plain"] = "plain"; @@ -173753,7 +119440,7 @@ var require_oauth2client2 = __commonJS((exports) => { const headers = { "Content-Type": "application/x-www-form-urlencoded" }; - const values3 = { + const values2 = { client_id: options.client_id || this._clientId, code_verifier: options.codeVerifier, code: options.code, @@ -173765,13 +119452,13 @@ var require_oauth2client2 = __commonJS((exports) => { headers["Authorization"] = `Basic ${basic.toString("base64")}`; } if (this.clientAuthentication === ClientAuthentication.ClientSecretPost) { - values3.client_secret = this._clientSecret; + values2.client_secret = this._clientSecret; } const res = await this.transporter.request({ ...OAuth2Client.RETRY_CONFIG, method: "POST", url: url3, - data: querystring.stringify(values3), + data: querystring.stringify(values2), headers }); const tokens = res.data; @@ -173800,7 +119487,7 @@ var require_oauth2client2 = __commonJS((exports) => { return p; } async refreshTokenNoCache(refreshToken) { - var _a3; + var _a2; if (!refreshToken) { throw new Error("No refresh token is set."); } @@ -173821,7 +119508,7 @@ var require_oauth2client2 = __commonJS((exports) => { headers: { "Content-Type": "application/x-www-form-urlencoded" } }); } catch (e) { - if (e instanceof gaxios_1.GaxiosError && e.message === "invalid_grant" && ((_a3 = e.response) === null || _a3 === undefined ? undefined : _a3.data) && /ReAuth/i.test(e.response.data.error_description)) { + if (e instanceof gaxios_1.GaxiosError && e.message === "invalid_grant" && ((_a2 = e.response) === null || _a2 === undefined ? undefined : _a2.data) && /ReAuth/i.test(e.response.data.error_description)) { e.message = JSON.stringify(e.response.data); } throw e; @@ -174246,12 +119933,12 @@ var require_oauth2client2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/computeclient.js -var require_computeclient2 = __commonJS((exports) => { +var require_computeclient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Compute = undefined; - var gaxios_1 = require_src8(); - var gcpMetadata = require_src10(); - var oauth2client_1 = require_oauth2client2(); + var gaxios_1 = require_src2(); + var gcpMetadata = require_src4(); + var oauth2client_1 = require_oauth2client(); class Compute extends oauth2client_1.OAuth2Client { constructor(options = {}) { @@ -174320,10 +120007,10 @@ var require_computeclient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/idtokenclient.js -var require_idtokenclient2 = __commonJS((exports) => { +var require_idtokenclient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.IdTokenClient = undefined; - var oauth2client_1 = require_oauth2client2(); + var oauth2client_1 = require_oauth2client(); class IdTokenClient extends oauth2client_1.OAuth2Client { constructor(options) { @@ -174356,12 +120043,12 @@ var require_idtokenclient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/envDetect.js -var require_envDetect2 = __commonJS((exports) => { +var require_envDetect = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.GCPEnv = undefined; exports.clear = clear; exports.getEnv = getEnv3; - var gcpMetadata = require_src10(); + var gcpMetadata = require_src4(); var GCPEnv; (function(GCPEnv2) { GCPEnv2["APP_ENGINE"] = "APP_ENGINE"; @@ -174383,23 +120070,23 @@ var require_envDetect2 = __commonJS((exports) => { return envPromise; } async function getEnvMemoized() { - let env5 = GCPEnv.NONE; + let env4 = GCPEnv.NONE; if (isAppEngine()) { - env5 = GCPEnv.APP_ENGINE; + env4 = GCPEnv.APP_ENGINE; } else if (isCloudFunction()) { - env5 = GCPEnv.CLOUD_FUNCTIONS; + env4 = GCPEnv.CLOUD_FUNCTIONS; } else if (await isComputeEngine()) { if (await isKubernetesEngine()) { - env5 = GCPEnv.KUBERNETES_ENGINE; + env4 = GCPEnv.KUBERNETES_ENGINE; } else if (isCloudRun()) { - env5 = GCPEnv.CLOUD_RUN; + env4 = GCPEnv.CLOUD_RUN; } else { - env5 = GCPEnv.COMPUTE_ENGINE; + env4 = GCPEnv.COMPUTE_ENGINE; } } else { - env5 = GCPEnv.NONE; + env4 = GCPEnv.NONE; } - return env5; + return env4; } function isAppEngine() { return !!(process.env.GAE_SERVICE || process.env.GAE_MODULE_NAME); @@ -174424,9 +120111,9 @@ var require_envDetect2 = __commonJS((exports) => { }); // node_modules/jws/lib/data-stream.js -var require_data_stream2 = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer2().Buffer; - var Stream4 = __require("stream"); +var require_data_stream = __commonJS((exports, module) => { + var Buffer7 = require_safe_buffer().Buffer; + var Stream2 = __require("stream"); var util3 = __require("util"); function DataStream(data) { this.buffer = null; @@ -174453,7 +120140,7 @@ var require_data_stream2 = __commonJS((exports, module) => { } throw new TypeError("Unexpected data type (" + typeof data + ")"); } - util3.inherits(DataStream, Stream4); + util3.inherits(DataStream, Stream2); DataStream.prototype.write = function write(data) { this.buffer = Buffer7.concat([this.buffer, Buffer7.from(data)]); this.emit("data", data); @@ -174470,7 +120157,7 @@ var require_data_stream2 = __commonJS((exports, module) => { }); // node_modules/buffer-equal-constant-time/index.js -var require_buffer_equal_constant_time2 = __commonJS((exports, module) => { +var require_buffer_equal_constant_time = __commonJS((exports, module) => { var Buffer7 = __require("buffer").Buffer; var SlowBuffer = __require("buffer").SlowBuffer; module.exports = bufferEq; @@ -174501,10 +120188,10 @@ var require_buffer_equal_constant_time2 = __commonJS((exports, module) => { }); // node_modules/jwa/index.js -var require_jwa2 = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer2().Buffer; +var require_jwa = __commonJS((exports, module) => { + var Buffer7 = require_safe_buffer().Buffer; var crypto3 = __require("crypto"); - var formatEcdsa = require_ecdsa_sig_formatter2(); + var formatEcdsa = require_ecdsa_sig_formatter(); var util3 = __require("util"); var MSG_INVALID_ALGORITHM = `"%s" is not a valid algorithm. Supported algorithms are: @@ -174572,10 +120259,10 @@ var require_jwa2 = __commonJS((exports, module) => { throw typeError(MSG_INVALID_SECRET); } } - function fromBase643(base644) { - return base644.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + function fromBase64(base643) { + return base643.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); } - function toBase643(base64url3) { + function toBase64(base64url3) { base64url3 = base64url3.toString(); var padding = 4 - base64url3.length % 4; if (padding !== 4) { @@ -174604,7 +120291,7 @@ var require_jwa2 = __commonJS((exports, module) => { thing = normalizeInput(thing); var hmac = crypto3.createHmac("sha" + bits, secret); var sig = (hmac.update(thing), hmac.digest("base64")); - return fromBase643(sig); + return fromBase64(sig); }; } var bufferEqual; @@ -174615,7 +120302,7 @@ var require_jwa2 = __commonJS((exports, module) => { return crypto3.timingSafeEqual(a2, b); } : function timingSafeEqual(a2, b) { if (!bufferEqual) { - bufferEqual = require_buffer_equal_constant_time2(); + bufferEqual = require_buffer_equal_constant_time(); } return bufferEqual(a2, b); }; @@ -174631,14 +120318,14 @@ var require_jwa2 = __commonJS((exports, module) => { thing = normalizeInput(thing); var signer = crypto3.createSign("RSA-SHA" + bits); var sig = (signer.update(thing), signer.sign(privateKey, "base64")); - return fromBase643(sig); + return fromBase64(sig); }; } function createKeyVerifier(bits) { return function verify(thing, signature, publicKey) { checkIsPublicKey(publicKey); thing = normalizeInput(thing); - signature = toBase643(signature); + signature = toBase64(signature); var verifier = crypto3.createVerify("RSA-SHA" + bits); verifier.update(thing); return verifier.verify(publicKey, signature, "base64"); @@ -174654,14 +120341,14 @@ var require_jwa2 = __commonJS((exports, module) => { padding: crypto3.constants.RSA_PKCS1_PSS_PADDING, saltLength: crypto3.constants.RSA_PSS_SALTLEN_DIGEST }, "base64")); - return fromBase643(sig); + return fromBase64(sig); }; } function createPSSKeyVerifier(bits) { return function verify(thing, signature, publicKey) { checkIsPublicKey(publicKey); thing = normalizeInput(thing); - signature = toBase643(signature); + signature = toBase64(signature); var verifier = crypto3.createVerify("RSA-SHA" + bits); verifier.update(thing); return verifier.verify({ @@ -174725,7 +120412,7 @@ var require_jwa2 = __commonJS((exports, module) => { }); // node_modules/jws/lib/tostring.js -var require_tostring2 = __commonJS((exports, module) => { +var require_tostring = __commonJS((exports, module) => { var Buffer7 = __require("buffer").Buffer; module.exports = function toString(obj) { if (typeof obj === "string") @@ -174737,12 +120424,12 @@ var require_tostring2 = __commonJS((exports, module) => { }); // node_modules/jws/lib/sign-stream.js -var require_sign_stream2 = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer2().Buffer; - var DataStream = require_data_stream2(); - var jwa = require_jwa2(); - var Stream4 = __require("stream"); - var toString6 = require_tostring2(); +var require_sign_stream = __commonJS((exports, module) => { + var Buffer7 = require_safe_buffer().Buffer; + var DataStream = require_data_stream(); + var jwa = require_jwa(); + var Stream2 = __require("stream"); + var toString6 = require_tostring(); var util3 = __require("util"); function base64url3(string4, encoding) { return Buffer7.from(string4, encoding).toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); @@ -174785,7 +120472,7 @@ var require_sign_stream2 = __commonJS((exports, module) => { this.sign(); }.bind(this)); } - util3.inherits(SignStream, Stream4); + util3.inherits(SignStream, Stream2); SignStream.prototype.sign = function sign() { try { var signature = jwsSign({ @@ -174810,12 +120497,12 @@ var require_sign_stream2 = __commonJS((exports, module) => { }); // node_modules/jws/lib/verify-stream.js -var require_verify_stream2 = __commonJS((exports, module) => { - var Buffer7 = require_safe_buffer2().Buffer; - var DataStream = require_data_stream2(); - var jwa = require_jwa2(); - var Stream4 = __require("stream"); - var toString6 = require_tostring2(); +var require_verify_stream = __commonJS((exports, module) => { + var Buffer7 = require_safe_buffer().Buffer; + var DataStream = require_data_stream(); + var jwa = require_jwa(); + var Stream2 = __require("stream"); + var toString6 = require_tostring(); var util3 = __require("util"); var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; function isObject5(thing) { @@ -174900,7 +120587,7 @@ var require_verify_stream2 = __commonJS((exports, module) => { this.verify(); }.bind(this)); } - util3.inherits(VerifyStream, Stream4); + util3.inherits(VerifyStream, Stream2); VerifyStream.prototype.verify = function verify() { try { var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); @@ -174923,9 +120610,9 @@ var require_verify_stream2 = __commonJS((exports, module) => { }); // node_modules/jws/index.js -var require_jws2 = __commonJS((exports) => { - var SignStream = require_sign_stream2(); - var VerifyStream = require_verify_stream2(); +var require_jws = __commonJS((exports) => { + var SignStream = require_sign_stream(); + var VerifyStream = require_verify_stream(); var ALGORITHMS = [ "HS256", "HS384", @@ -174954,15 +120641,15 @@ var require_jws2 = __commonJS((exports) => { }); // node_modules/gtoken/build/src/index.js -var require_src11 = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { +var require_src5 = __commonJS((exports) => { + var __classPrivateFieldGet2 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; - var __classPrivateFieldSet3 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { + var __classPrivateFieldSet2 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) @@ -174982,9 +120669,9 @@ var require_src11 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.GoogleToken = undefined; var fs2 = __require("fs"); - var gaxios_1 = require_src8(); - var jws = require_jws2(); - var path11 = __require("path"); + var gaxios_1 = require_src2(); + var jws = require_jws(); + var path9 = __require("path"); var util_1 = __require("util"); var readFile8 = fs2.readFile ? (0, util_1.promisify)(fs2.readFile) : async () => { throw new ErrorWithCode("use key rather than keyFile.", "MISSING_CREDENTIALS"); @@ -175018,7 +120705,7 @@ var require_src11 = __commonJS((exports) => { request: (opts) => (0, gaxios_1.request)(opts) }; _GoogleToken_inFlightRequest.set(this, undefined); - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_configure).call(this, options); + __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_configure).call(this, options); } hasExpired() { const now2 = new Date().getTime(); @@ -175029,9 +120716,9 @@ var require_src11 = __commonJS((exports) => { } } isTokenExpiring() { - var _a3; + var _a2; const now2 = new Date().getTime(); - const eagerRefreshThresholdMillis = (_a3 = this.eagerRefreshThresholdMillis) !== null && _a3 !== undefined ? _a3 : 0; + const eagerRefreshThresholdMillis = (_a2 = this.eagerRefreshThresholdMillis) !== null && _a2 !== undefined ? _a2 : 0; if (this.rawToken && this.expiresAt) { return this.expiresAt <= now2 + eagerRefreshThresholdMillis; } else { @@ -175048,13 +120735,13 @@ var require_src11 = __commonJS((exports) => { }, opts); if (callback) { const cb = callback; - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsync).call(this, opts).then((t) => cb(null, t), callback); + __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsync).call(this, opts).then((t) => cb(null, t), callback); return; } - return __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsync).call(this, opts); + return __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsync).call(this, opts); } async getCredentials(keyFile) { - const ext = path11.extname(keyFile); + const ext = path9.extname(keyFile); switch (ext) { case ".json": { const key = await readFile8(keyFile, "utf8"); @@ -175082,21 +120769,21 @@ var require_src11 = __commonJS((exports) => { } revokeToken(callback) { if (callback) { - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_revokeTokenAsync).call(this).then(() => callback(), callback); + __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_revokeTokenAsync).call(this).then(() => callback(), callback); return; } - return __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_revokeTokenAsync).call(this); + return __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_revokeTokenAsync).call(this); } } exports.GoogleToken = GoogleToken; _GoogleToken_inFlightRequest = new WeakMap, _GoogleToken_instances = new WeakSet, _GoogleToken_getTokenAsync = async function _GoogleToken_getTokenAsync(opts) { - if (__classPrivateFieldGet3(this, _GoogleToken_inFlightRequest, "f") && !opts.forceRefresh) { - return __classPrivateFieldGet3(this, _GoogleToken_inFlightRequest, "f"); + if (__classPrivateFieldGet2(this, _GoogleToken_inFlightRequest, "f") && !opts.forceRefresh) { + return __classPrivateFieldGet2(this, _GoogleToken_inFlightRequest, "f"); } try { - return await __classPrivateFieldSet3(this, _GoogleToken_inFlightRequest, __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsyncInner).call(this, opts), "f"); + return await __classPrivateFieldSet2(this, _GoogleToken_inFlightRequest, __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_getTokenAsyncInner).call(this, opts), "f"); } finally { - __classPrivateFieldSet3(this, _GoogleToken_inFlightRequest, undefined, "f"); + __classPrivateFieldSet2(this, _GoogleToken_inFlightRequest, undefined, "f"); } }, _GoogleToken_getTokenAsyncInner = async function _GoogleToken_getTokenAsyncInner(opts) { if (this.isTokenExpiring() === false && opts.forceRefresh === false) { @@ -175110,10 +120797,10 @@ var require_src11 = __commonJS((exports) => { this.key = creds.privateKey; this.iss = creds.clientEmail || this.iss; if (!creds.clientEmail) { - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_ensureEmail).call(this); + __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_ensureEmail).call(this); } } - return __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_requestToken).call(this); + return __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_requestToken).call(this); }, _GoogleToken_ensureEmail = function _GoogleToken_ensureEmail() { if (!this.iss) { throw new ErrorWithCode("email is required.", "MISSING_CREDENTIALS"); @@ -175127,7 +120814,7 @@ var require_src11 = __commonJS((exports) => { url: url3, retry: true }); - __classPrivateFieldGet3(this, _GoogleToken_instances, "m", _GoogleToken_configure).call(this, { + __classPrivateFieldGet2(this, _GoogleToken_instances, "m", _GoogleToken_configure).call(this, { email: this.iss, sub: this.sub, key: this.key, @@ -175152,7 +120839,7 @@ var require_src11 = __commonJS((exports) => { this.transporter = options.transporter; } }, _GoogleToken_requestToken = async function _GoogleToken_requestToken() { - var _a3, _b; + var _a2, _b; const iat = Math.floor(new Date().getTime() / 1000); const additionalClaims = this.additionalClaims || {}; const payload = Object.assign({ @@ -175188,7 +120875,7 @@ var require_src11 = __commonJS((exports) => { } catch (e) { this.rawToken = undefined; this.tokenExpires = undefined; - const body = e.response && ((_a3 = e.response) === null || _a3 === undefined ? undefined : _a3.data) ? (_b = e.response) === null || _b === undefined ? undefined : _b.data : {}; + const body = e.response && ((_a2 = e.response) === null || _a2 === undefined ? undefined : _a2.data) ? (_b = e.response) === null || _b === undefined ? undefined : _b.data : {}; if (body.error) { const desc = body.error_description ? `: ${body.error_description}` : ""; e.message = `${body.error}${desc}`; @@ -175199,11 +120886,11 @@ var require_src11 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/jwtaccess.js -var require_jwtaccess2 = __commonJS((exports) => { +var require_jwtaccess = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.JWTAccess = undefined; - var jws = require_jws2(); - var util_1 = require_util10(); + var jws = require_jws(); + var util_1 = require_util8(); var DEFAULT_HEADER = { alg: "RS256", typ: "JWT" @@ -175327,13 +121014,13 @@ var require_jwtaccess2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/jwtclient.js -var require_jwtclient2 = __commonJS((exports) => { +var require_jwtclient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.JWT = undefined; - var gtoken_1 = require_src11(); - var jwtaccess_1 = require_jwtaccess2(); - var oauth2client_1 = require_oauth2client2(); - var authclient_1 = require_authclient2(); + var gtoken_1 = require_src5(); + var jwtaccess_1 = require_jwtaccess(); + var oauth2client_1 = require_oauth2client(); + var authclient_1 = require_authclient(); class JWT extends oauth2client_1.OAuth2Client { constructor(optionsOrEmail, keyFile, key, scopes, subject, keyId) { @@ -175526,10 +121213,10 @@ var require_jwtclient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/refreshclient.js -var require_refreshclient2 = __commonJS((exports) => { +var require_refreshclient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.UserRefreshClient = exports.USER_REFRESH_ACCOUNT_TYPE = undefined; - var oauth2client_1 = require_oauth2client2(); + var oauth2client_1 = require_oauth2client(); var querystring_1 = __require("querystring"); exports.USER_REFRESH_ACCOUNT_TYPE = "authorized_user"; @@ -175615,32 +121302,32 @@ var require_refreshclient2 = __commonJS((exports) => { }); } static fromJSON(json2) { - const client4 = new UserRefreshClient; - client4.fromJSON(json2); - return client4; + const client = new UserRefreshClient; + client.fromJSON(json2); + return client; } } exports.UserRefreshClient = UserRefreshClient; }); // node_modules/google-auth-library/build/src/auth/impersonated.js -var require_impersonated2 = __commonJS((exports) => { +var require_impersonated = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Impersonated = exports.IMPERSONATED_ACCOUNT_TYPE = undefined; - var oauth2client_1 = require_oauth2client2(); - var gaxios_1 = require_src8(); - var util_1 = require_util10(); + var oauth2client_1 = require_oauth2client(); + var gaxios_1 = require_src2(); + var util_1 = require_util8(); exports.IMPERSONATED_ACCOUNT_TYPE = "impersonated_service_account"; class Impersonated extends oauth2client_1.OAuth2Client { constructor(options = {}) { - var _a3, _b, _c, _d, _e, _f; + var _a2, _b, _c, _d, _e, _f; super(options); this.credentials = { expiry_date: 1, refresh_token: "impersonated-placeholder" }; - this.sourceClient = (_a3 = options.sourceClient) !== null && _a3 !== undefined ? _a3 : new oauth2client_1.OAuth2Client; + this.sourceClient = (_a2 = options.sourceClient) !== null && _a2 !== undefined ? _a2 : new oauth2client_1.OAuth2Client; this.targetPrincipal = (_b = options.targetPrincipal) !== null && _b !== undefined ? _b : ""; this.delegates = (_c = options.delegates) !== null && _c !== undefined ? _c : []; this.targetScopes = (_d = options.targetScopes) !== null && _d !== undefined ? _d : []; @@ -175673,7 +121360,7 @@ var require_impersonated2 = __commonJS((exports) => { return this.targetPrincipal; } async refreshToken() { - var _a3, _b, _c, _d, _e, _f; + var _a2, _b, _c, _d, _e, _f; try { await this.sourceClient.getAccessToken(); const name = "projects/-/serviceAccounts/" + this.targetPrincipal; @@ -175696,33 +121383,33 @@ var require_impersonated2 = __commonJS((exports) => { tokens: this.credentials, res }; - } catch (error45) { - if (!(error45 instanceof Error)) - throw error45; + } catch (error41) { + if (!(error41 instanceof Error)) + throw error41; let status = 0; let message = ""; - if (error45 instanceof gaxios_1.GaxiosError) { - status = (_c = (_b = (_a3 = error45 === null || error45 === undefined ? undefined : error45.response) === null || _a3 === undefined ? undefined : _a3.data) === null || _b === undefined ? undefined : _b.error) === null || _c === undefined ? undefined : _c.status; - message = (_f = (_e = (_d = error45 === null || error45 === undefined ? undefined : error45.response) === null || _d === undefined ? undefined : _d.data) === null || _e === undefined ? undefined : _e.error) === null || _f === undefined ? undefined : _f.message; + if (error41 instanceof gaxios_1.GaxiosError) { + status = (_c = (_b = (_a2 = error41 === null || error41 === undefined ? undefined : error41.response) === null || _a2 === undefined ? undefined : _a2.data) === null || _b === undefined ? undefined : _b.error) === null || _c === undefined ? undefined : _c.status; + message = (_f = (_e = (_d = error41 === null || error41 === undefined ? undefined : error41.response) === null || _d === undefined ? undefined : _d.data) === null || _e === undefined ? undefined : _e.error) === null || _f === undefined ? undefined : _f.message; } if (status && message) { - error45.message = `${status}: unable to impersonate: ${message}`; - throw error45; + error41.message = `${status}: unable to impersonate: ${message}`; + throw error41; } else { - error45.message = `unable to impersonate: ${error45}`; - throw error45; + error41.message = `unable to impersonate: ${error41}`; + throw error41; } } } async fetchIdToken(targetAudience, options) { - var _a3, _b; + var _a2, _b; await this.sourceClient.getAccessToken(); const name = `projects/-/serviceAccounts/${this.targetPrincipal}`; const u2 = `${this.endpoint}/v1/${name}:generateIdToken`; const body = { delegates: this.delegates, audience: targetAudience, - includeEmail: (_a3 = options === null || options === undefined ? undefined : options.includeEmail) !== null && _a3 !== undefined ? _a3 : true, + includeEmail: (_a2 = options === null || options === undefined ? undefined : options.includeEmail) !== null && _a2 !== undefined ? _a2 : true, useEmailAzp: (_b = options === null || options === undefined ? undefined : options.includeEmail) !== null && _b !== undefined ? _b : true }; const res = await this.sourceClient.request({ @@ -175738,12 +121425,12 @@ var require_impersonated2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/oauth2common.js -var require_oauth2common2 = __commonJS((exports) => { +var require_oauth2common = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OAuthClientAuthHandler = undefined; exports.getErrorFromOAuthErrorResponse = getErrorFromOAuthErrorResponse; var querystring = __require("querystring"); - var crypto_1 = require_crypto6(); + var crypto_1 = require_crypto3(); var METHODS_SUPPORTING_REQUEST_BODY = ["PUT", "POST", "PATCH"]; class OAuthClientAuthHandler { @@ -175758,13 +121445,13 @@ var require_oauth2common2 = __commonJS((exports) => { } } injectAuthenticatedHeaders(opts, bearerToken) { - var _a3; + var _a2; if (bearerToken) { opts.headers = opts.headers || {}; Object.assign(opts.headers, { Authorization: `Bearer ${bearerToken}}` }); - } else if (((_a3 = this.clientAuthentication) === null || _a3 === undefined ? undefined : _a3.confidentialClientType) === "basic") { + } else if (((_a2 = this.clientAuthentication) === null || _a2 === undefined ? undefined : _a2.confidentialClientType) === "basic") { opts.headers = opts.headers || {}; const clientId = this.clientAuthentication.clientId; const clientSecret = this.clientAuthentication.clientSecret || ""; @@ -175775,8 +121462,8 @@ var require_oauth2common2 = __commonJS((exports) => { } } injectAuthenticatedRequestBody(opts) { - var _a3; - if (((_a3 = this.clientAuthentication) === null || _a3 === undefined ? undefined : _a3.confidentialClientType) === "request-body") { + var _a2; + if (((_a2 = this.clientAuthentication) === null || _a2 === undefined ? undefined : _a2.confidentialClientType) === "request-body") { const method2 = (opts.method || "GET").toUpperCase(); if (METHODS_SUPPORTING_REQUEST_BODY.indexOf(method2) !== -1) { let contentType; @@ -175851,13 +121538,13 @@ var require_oauth2common2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/stscredentials.js -var require_stscredentials2 = __commonJS((exports) => { +var require_stscredentials = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.StsCredentials = undefined; - var gaxios_1 = require_src8(); + var gaxios_1 = require_src2(); var querystring = __require("querystring"); - var transporters_1 = require_transporters2(); - var oauth2common_1 = require_oauth2common2(); + var transporters_1 = require_transporters(); + var oauth2common_1 = require_oauth2common(); class StsCredentials extends oauth2common_1.OAuthClientAuthHandler { constructor(tokenExchangeEndpoint, clientAuthentication) { @@ -175866,12 +121553,12 @@ var require_stscredentials2 = __commonJS((exports) => { this.transporter = new transporters_1.DefaultTransporter; } async exchangeToken(stsCredentialsOptions, additionalHeaders, options) { - var _a3, _b, _c; - const values3 = { + var _a2, _b, _c; + const values2 = { grant_type: stsCredentialsOptions.grantType, resource: stsCredentialsOptions.resource, audience: stsCredentialsOptions.audience, - scope: (_a3 = stsCredentialsOptions.scope) === null || _a3 === undefined ? undefined : _a3.join(" "), + scope: (_a2 = stsCredentialsOptions.scope) === null || _a2 === undefined ? undefined : _a2.join(" "), requested_token_type: stsCredentialsOptions.requestedTokenType, subject_token: stsCredentialsOptions.subjectToken, subject_token_type: stsCredentialsOptions.subjectTokenType, @@ -175879,9 +121566,9 @@ var require_stscredentials2 = __commonJS((exports) => { actor_token_type: (_c = stsCredentialsOptions.actingParty) === null || _c === undefined ? undefined : _c.actorTokenType, options: options && JSON.stringify(options) }; - Object.keys(values3).forEach((key) => { - if (typeof values3[key] === "undefined") { - delete values3[key]; + Object.keys(values2).forEach((key) => { + if (typeof values2[key] === "undefined") { + delete values2[key]; } }); const headers = { @@ -175893,7 +121580,7 @@ var require_stscredentials2 = __commonJS((exports) => { url: this.tokenExchangeEndpoint.toString(), method: "POST", headers, - data: querystring.stringify(values3), + data: querystring.stringify(values2), responseType: "json" }; this.applyClientAuthenticationOptions(opts); @@ -175902,11 +121589,11 @@ var require_stscredentials2 = __commonJS((exports) => { const stsSuccessfulResponse = response.data; stsSuccessfulResponse.res = response; return stsSuccessfulResponse; - } catch (error45) { - if (error45 instanceof gaxios_1.GaxiosError && error45.response) { - throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error45.response.data, error45); + } catch (error41) { + if (error41 instanceof gaxios_1.GaxiosError && error41.response) { + throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error41.response.data, error41); } - throw error45; + throw error41; } } } @@ -175914,15 +121601,15 @@ var require_stscredentials2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/baseexternalclient.js -var require_baseexternalclient2 = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { +var require_baseexternalclient = __commonJS((exports) => { + var __classPrivateFieldGet2 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; - var __classPrivateFieldSet3 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { + var __classPrivateFieldSet2 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) @@ -175937,9 +121624,9 @@ var require_baseexternalclient2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseExternalAccountClient = exports.DEFAULT_UNIVERSE = exports.CLOUD_RESOURCE_MANAGER = exports.EXTERNAL_ACCOUNT_TYPE = exports.EXPIRATION_TIME_OFFSET = undefined; var stream4 = __require("stream"); - var authclient_1 = require_authclient2(); - var sts = require_stscredentials2(); - var util_1 = require_util10(); + var authclient_1 = require_authclient(); + var sts = require_stscredentials(); + var util_1 = require_util8(); var STS_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange"; var STS_REQUEST_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"; var DEFAULT_OAUTH_SCOPE = "https://www.googleapis.com/auth/cloud-platform"; @@ -175949,15 +121636,15 @@ var require_baseexternalclient2 = __commonJS((exports) => { exports.CLOUD_RESOURCE_MANAGER = "https://cloudresourcemanager.googleapis.com/v1/projects/"; var WORKFORCE_AUDIENCE_PATTERN = "//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+"; var DEFAULT_TOKEN_URL = "https://sts.{universeDomain}/v1/token"; - var pkg = require_package11(); - var authclient_2 = require_authclient2(); + var pkg = require_package3(); + var authclient_2 = require_authclient(); Object.defineProperty(exports, "DEFAULT_UNIVERSE", { enumerable: true, get: function() { return authclient_2.DEFAULT_UNIVERSE; } }); class BaseExternalAccountClient extends authclient_1.AuthClient { constructor(options, additionalOptions) { - var _a3; + var _a2; super({ ...options, ...additionalOptions }); _BaseExternalAccountClient_instances.add(this); _BaseExternalAccountClient_pendingAccessToken.set(this, null); @@ -175968,7 +121655,7 @@ var require_baseexternalclient2 = __commonJS((exports) => { } const clientId = opts.get("client_id"); const clientSecret = opts.get("client_secret"); - const tokenUrl = (_a3 = opts.get("token_url")) !== null && _a3 !== undefined ? _a3 : DEFAULT_TOKEN_URL.replace("{universeDomain}", this.universeDomain); + const tokenUrl = (_a2 = opts.get("token_url")) !== null && _a2 !== undefined ? _a2 : DEFAULT_TOKEN_URL.replace("{universeDomain}", this.universeDomain); const subjectTokenType = opts.get("subject_token_type"); const workforcePoolUserProject = opts.get("workforce_pool_user_project"); const serviceAccountImpersonationUrl = opts.get("service_account_impersonation_url"); @@ -176008,14 +121695,14 @@ var require_baseexternalclient2 = __commonJS((exports) => { }; } getServiceAccountEmail() { - var _a3; + var _a2; if (this.serviceAccountImpersonationUrl) { if (this.serviceAccountImpersonationUrl.length > 256) { throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`); } const re = /serviceAccounts\/(?[^:]+):generateAccessToken$/; const result2 = re.exec(this.serviceAccountImpersonationUrl); - return ((_a3 = result2 === null || result2 === undefined ? undefined : result2.groups) === null || _a3 === undefined ? undefined : _a3.email) || null; + return ((_a2 = result2 === null || result2 === undefined ? undefined : result2.groups) === null || _a2 === undefined ? undefined : _a2.email) || null; } return null; } @@ -176093,11 +121780,11 @@ var require_baseexternalclient2 = __commonJS((exports) => { return response; } async refreshAccessTokenAsync() { - __classPrivateFieldSet3(this, _BaseExternalAccountClient_pendingAccessToken, __classPrivateFieldGet3(this, _BaseExternalAccountClient_pendingAccessToken, "f") || __classPrivateFieldGet3(this, _BaseExternalAccountClient_instances, "m", _BaseExternalAccountClient_internalRefreshAccessTokenAsync).call(this), "f"); + __classPrivateFieldSet2(this, _BaseExternalAccountClient_pendingAccessToken, __classPrivateFieldGet2(this, _BaseExternalAccountClient_pendingAccessToken, "f") || __classPrivateFieldGet2(this, _BaseExternalAccountClient_instances, "m", _BaseExternalAccountClient_internalRefreshAccessTokenAsync).call(this), "f"); try { - return await __classPrivateFieldGet3(this, _BaseExternalAccountClient_pendingAccessToken, "f"); + return await __classPrivateFieldGet2(this, _BaseExternalAccountClient_pendingAccessToken, "f"); } finally { - __classPrivateFieldSet3(this, _BaseExternalAccountClient_pendingAccessToken, null, "f"); + __classPrivateFieldSet2(this, _BaseExternalAccountClient_pendingAccessToken, null, "f"); } } getProjectNumber(audience) { @@ -176192,15 +121879,15 @@ var require_baseexternalclient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/filesubjecttokensupplier.js -var require_filesubjecttokensupplier2 = __commonJS((exports) => { - var _a3; +var require_filesubjecttokensupplier = __commonJS((exports) => { + var _a2; var _b; var _c; Object.defineProperty(exports, "__esModule", { value: true }); exports.FileSubjectTokenSupplier = undefined; var util_1 = __require("util"); var fs2 = __require("fs"); - var readFile8 = (0, util_1.promisify)((_a3 = fs2.readFile) !== null && _a3 !== undefined ? _a3 : () => {}); + var readFile8 = (0, util_1.promisify)((_a2 = fs2.readFile) !== null && _a2 !== undefined ? _a2 : () => {}); var realpath4 = (0, util_1.promisify)((_b = fs2.realpath) !== null && _b !== undefined ? _b : () => {}); var lstat = (0, util_1.promisify)((_c = fs2.lstat) !== null && _c !== undefined ? _c : () => {}); @@ -176241,7 +121928,7 @@ var require_filesubjecttokensupplier2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/urlsubjecttokensupplier.js -var require_urlsubjecttokensupplier2 = __commonJS((exports) => { +var require_urlsubjecttokensupplier = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.UrlSubjectTokenSupplier = undefined; @@ -176279,13 +121966,13 @@ var require_urlsubjecttokensupplier2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/identitypoolclient.js -var require_identitypoolclient2 = __commonJS((exports) => { +var require_identitypoolclient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.IdentityPoolClient = undefined; - var baseexternalclient_1 = require_baseexternalclient2(); - var util_1 = require_util10(); - var filesubjecttokensupplier_1 = require_filesubjecttokensupplier2(); - var urlsubjecttokensupplier_1 = require_urlsubjecttokensupplier2(); + var baseexternalclient_1 = require_baseexternalclient(); + var util_1 = require_util8(); + var filesubjecttokensupplier_1 = require_filesubjecttokensupplier(); + var urlsubjecttokensupplier_1 = require_urlsubjecttokensupplier(); class IdentityPoolClient extends baseexternalclient_1.BaseExternalAccountClient { constructor(options, additionalOptions) { @@ -176347,10 +122034,10 @@ var require_identitypoolclient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/awsrequestsigner.js -var require_awsrequestsigner2 = __commonJS((exports) => { +var require_awsrequestsigner = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AwsRequestSigner = undefined; - var crypto_1 = require_crypto6(); + var crypto_1 = require_crypto3(); var AWS_ALGORITHM = "AWS4-HMAC-SHA256"; var AWS_REQUEST_TYPE = "aws4_request"; @@ -176461,8 +122148,8 @@ var require_awsrequestsigner2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/defaultawssecuritycredentialssupplier.js -var require_defaultawssecuritycredentialssupplier2 = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { +var require_defaultawssecuritycredentialssupplier = __commonJS((exports) => { + var __classPrivateFieldGet2 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) @@ -176487,12 +122174,12 @@ var require_defaultawssecuritycredentialssupplier2 = __commonJS((exports) => { this.additionalGaxiosOptions = opts.additionalGaxiosOptions; } async getAwsRegion(context) { - if (__classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get)) { - return __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get); + if (__classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get)) { + return __classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get); } const metadataHeaders = {}; - if (!__classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get) && this.imdsV2SessionTokenUrl) { - metadataHeaders["x-aws-ec2-metadata-token"] = await __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken).call(this, context.transporter); + if (!__classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get) && this.imdsV2SessionTokenUrl) { + metadataHeaders["x-aws-ec2-metadata-token"] = await __classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken).call(this, context.transporter); } if (!this.regionUrl) { throw new Error("Unable to determine AWS region due to missing " + '"options.credential_source.region_url"'); @@ -176508,15 +122195,15 @@ var require_defaultawssecuritycredentialssupplier2 = __commonJS((exports) => { return response.data.substr(0, response.data.length - 1); } async getAwsSecurityCredentials(context) { - if (__classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get)) { - return __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get); + if (__classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get)) { + return __classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "a", _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get); } const metadataHeaders = {}; if (this.imdsV2SessionTokenUrl) { - metadataHeaders["x-aws-ec2-metadata-token"] = await __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken).call(this, context.transporter); + metadataHeaders["x-aws-ec2-metadata-token"] = await __classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken).call(this, context.transporter); } - const roleName = await __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName).call(this, metadataHeaders, context.transporter); - const awsCreds = await __classPrivateFieldGet3(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials).call(this, roleName, metadataHeaders, context.transporter); + const roleName = await __classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName).call(this, metadataHeaders, context.transporter); + const awsCreds = await __classPrivateFieldGet2(this, _DefaultAwsSecurityCredentialsSupplier_instances, "m", _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials).call(this, roleName, metadataHeaders, context.transporter); return { accessKeyId: awsCreds.AccessKeyId, secretAccessKey: awsCreds.SecretAccessKey, @@ -176571,22 +122258,22 @@ var require_defaultawssecuritycredentialssupplier2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/awsclient.js -var require_awsclient2 = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { +var require_awsclient = __commonJS((exports) => { + var __classPrivateFieldGet2 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; - var _a3; + var _a2; var _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL; Object.defineProperty(exports, "__esModule", { value: true }); exports.AwsClient = undefined; - var awsrequestsigner_1 = require_awsrequestsigner2(); - var baseexternalclient_1 = require_baseexternalclient2(); - var defaultawssecuritycredentialssupplier_1 = require_defaultawssecuritycredentialssupplier2(); - var util_1 = require_util10(); + var awsrequestsigner_1 = require_awsrequestsigner(); + var baseexternalclient_1 = require_baseexternalclient(); + var defaultawssecuritycredentialssupplier_1 = require_defaultawssecuritycredentialssupplier(); + var util_1 = require_util8(); class AwsClient extends baseexternalclient_1.BaseExternalAccountClient { constructor(options, additionalOptions) { @@ -176602,7 +122289,7 @@ var require_awsclient2 = __commonJS((exports) => { } if (awsSecurityCredentialsSupplier) { this.awsSecurityCredentialsSupplier = awsSecurityCredentialsSupplier; - this.regionalCredVerificationUrl = __classPrivateFieldGet3(_a3, _a3, "f", _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL); + this.regionalCredVerificationUrl = __classPrivateFieldGet2(_a2, _a2, "f", _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL); this.credentialSourceType = "programmatic"; } else { const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource); @@ -176639,7 +122326,7 @@ var require_awsclient2 = __commonJS((exports) => { }, this.region); } const options = await this.awsRequestSigner.getRequestOptions({ - ..._a3.RETRY_CONFIG, + ..._a2.RETRY_CONFIG, url: this.regionalCredVerificationUrl.replace("{region}", this.region), method: "POST" }); @@ -176661,14 +122348,14 @@ var require_awsclient2 = __commonJS((exports) => { } } exports.AwsClient = AwsClient; - _a3 = AwsClient; + _a2 = AwsClient; _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL = { value: "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" }; AwsClient.AWS_EC2_METADATA_IPV4_ADDRESS = "169.254.169.254"; AwsClient.AWS_EC2_METADATA_IPV6_ADDRESS = "fd00:ec2::254"; }); // node_modules/google-auth-library/build/src/auth/executable-response.js -var require_executable_response2 = __commonJS((exports) => { +var require_executable_response = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.InvalidSubjectTokenError = exports.InvalidMessageFieldError = exports.InvalidCodeFieldError = exports.InvalidTokenTypeFieldError = exports.InvalidExpirationTimeFieldError = exports.InvalidSuccessFieldError = exports.InvalidVersionFieldError = exports.ExecutableResponseError = exports.ExecutableResponse = undefined; var SAML_SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:saml2"; @@ -176760,11 +122447,11 @@ var require_executable_response2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js -var require_pluggable_auth_handler2 = __commonJS((exports) => { +var require_pluggable_auth_handler = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.PluggableAuthHandler = undefined; - var pluggable_auth_client_1 = require_pluggable_auth_client2(); - var executable_response_1 = require_executable_response2(); + var pluggable_auth_client_1 = require_pluggable_auth_client(); + var executable_response_1 = require_executable_response(); var childProcess = __require("child_process"); var fs2 = __require("fs"); @@ -176804,9 +122491,9 @@ var require_pluggable_auth_handler2 = __commonJS((exports) => { const responseJson = JSON.parse(output); const response = new executable_response_1.ExecutableResponse(responseJson); return resolve8(response); - } catch (error45) { - if (error45 instanceof executable_response_1.ExecutableResponseError) { - return reject2(error45); + } catch (error41) { + if (error41 instanceof executable_response_1.ExecutableResponseError) { + return reject2(error41); } return reject2(new executable_response_1.ExecutableResponseError(`The executable returned an invalid response: ${output}`)); } @@ -176823,7 +122510,7 @@ var require_pluggable_auth_handler2 = __commonJS((exports) => { let filePath; try { filePath = await fs2.promises.realpath(this.outputFile); - } catch (_a3) { + } catch (_a2) { return; } if (!(await fs2.promises.lstat(filePath)).isFile()) { @@ -176842,9 +122529,9 @@ var require_pluggable_auth_handler2 = __commonJS((exports) => { return new executable_response_1.ExecutableResponse(responseJson); } return; - } catch (error45) { - if (error45 instanceof executable_response_1.ExecutableResponseError) { - throw error45; + } catch (error41) { + if (error41 instanceof executable_response_1.ExecutableResponseError) { + throw error41; } throw new executable_response_1.ExecutableResponseError(`The output file contained an invalid response: ${responseString}`); } @@ -176866,12 +122553,12 @@ var require_pluggable_auth_handler2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js -var require_pluggable_auth_client2 = __commonJS((exports) => { +var require_pluggable_auth_client = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.PluggableAuthClient = exports.ExecutableError = undefined; - var baseexternalclient_1 = require_baseexternalclient2(); - var executable_response_1 = require_executable_response2(); - var pluggable_auth_handler_1 = require_pluggable_auth_handler2(); + var baseexternalclient_1 = require_baseexternalclient(); + var executable_response_1 = require_executable_response(); + var pluggable_auth_handler_1 = require_pluggable_auth_handler(); class ExecutableError extends Error { constructor(message, code) { @@ -176956,22 +122643,22 @@ var require_pluggable_auth_client2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/externalclient.js -var require_externalclient2 = __commonJS((exports) => { +var require_externalclient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ExternalAccountClient = undefined; - var baseexternalclient_1 = require_baseexternalclient2(); - var identitypoolclient_1 = require_identitypoolclient2(); - var awsclient_1 = require_awsclient2(); - var pluggable_auth_client_1 = require_pluggable_auth_client2(); + var baseexternalclient_1 = require_baseexternalclient(); + var identitypoolclient_1 = require_identitypoolclient(); + var awsclient_1 = require_awsclient(); + var pluggable_auth_client_1 = require_pluggable_auth_client(); class ExternalAccountClient { constructor() { throw new Error("ExternalAccountClients should be initialized via: " + "ExternalAccountClient.fromJSON(), " + "directly via explicit constructors, eg. " + "new AwsClient(options), new IdentityPoolClient(options), new" + "PluggableAuthClientOptions, or via " + "new GoogleAuth(options).getClient()"); } static fromJSON(options, additionalOptions) { - var _a3, _b; + var _a2, _b; if (options && options.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { - if ((_a3 = options.credential_source) === null || _a3 === undefined ? undefined : _a3.environment_id) { + if ((_a2 = options.credential_source) === null || _a2 === undefined ? undefined : _a2.environment_id) { return new awsclient_1.AwsClient(options, additionalOptions); } else if ((_b = options.credential_source) === null || _b === undefined ? undefined : _b.executable) { return new pluggable_auth_client_1.PluggableAuthClient(options, additionalOptions); @@ -176987,14 +122674,14 @@ var require_externalclient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/externalAccountAuthorizedUserClient.js -var require_externalAccountAuthorizedUserClient2 = __commonJS((exports) => { +var require_externalAccountAuthorizedUserClient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ExternalAccountAuthorizedUserClient = exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = undefined; - var authclient_1 = require_authclient2(); - var oauth2common_1 = require_oauth2common2(); - var gaxios_1 = require_src8(); + var authclient_1 = require_authclient(); + var oauth2common_1 = require_oauth2common(); + var gaxios_1 = require_src2(); var stream4 = __require("stream"); - var baseexternalclient_1 = require_baseexternalclient2(); + var baseexternalclient_1 = require_baseexternalclient(); exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = "external_account_authorized_user"; var DEFAULT_TOKEN_URL = "https://sts.{universeDomain}/v1/oauthtoken"; @@ -177005,7 +122692,7 @@ var require_externalAccountAuthorizedUserClient2 = __commonJS((exports) => { this.transporter = transporter; } async refreshToken(refreshToken, additionalHeaders) { - const values3 = new URLSearchParams({ + const values2 = new URLSearchParams({ grant_type: "refresh_token", refresh_token: refreshToken }); @@ -177018,7 +122705,7 @@ var require_externalAccountAuthorizedUserClient2 = __commonJS((exports) => { url: this.url, method: "POST", headers, - data: values3.toString(), + data: values2.toString(), responseType: "json" }; this.applyClientAuthenticationOptions(opts); @@ -177027,18 +122714,18 @@ var require_externalAccountAuthorizedUserClient2 = __commonJS((exports) => { const tokenRefreshResponse = response.data; tokenRefreshResponse.res = response; return tokenRefreshResponse; - } catch (error45) { - if (error45 instanceof gaxios_1.GaxiosError && error45.response) { - throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error45.response.data, error45); + } catch (error41) { + if (error41 instanceof gaxios_1.GaxiosError && error41.response) { + throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error41.response.data, error41); } - throw error45; + throw error41; } } } class ExternalAccountAuthorizedUserClient extends authclient_1.AuthClient { constructor(options, additionalOptions) { - var _a3; + var _a2; super({ ...options, ...additionalOptions }); if (options.universe_domain) { this.universeDomain = options.universe_domain; @@ -177049,7 +122736,7 @@ var require_externalAccountAuthorizedUserClient2 = __commonJS((exports) => { clientId: options.client_id, clientSecret: options.client_secret }; - this.externalAccountAuthorizedUserHandler = new ExternalAccountAuthorizedUserHandler((_a3 = options.token_url) !== null && _a3 !== undefined ? _a3 : DEFAULT_TOKEN_URL.replace("{universeDomain}", this.universeDomain), this.transporter, clientAuth); + this.externalAccountAuthorizedUserHandler = new ExternalAccountAuthorizedUserHandler((_a2 = options.token_url) !== null && _a2 !== undefined ? _a2 : DEFAULT_TOKEN_URL.replace("{universeDomain}", this.universeDomain), this.transporter, clientAuth); this.cachedAccessToken = null; this.quotaProjectId = options.quota_project_id; if (typeof (additionalOptions === null || additionalOptions === undefined ? undefined : additionalOptions.eagerRefreshThresholdMillis) !== "number") { @@ -177132,15 +122819,15 @@ var require_externalAccountAuthorizedUserClient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/googleauth.js -var require_googleauth2 = __commonJS((exports) => { - var __classPrivateFieldGet3 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { +var require_googleauth = __commonJS((exports) => { + var __classPrivateFieldGet2 = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; - var __classPrivateFieldSet3 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { + var __classPrivateFieldSet2 = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) @@ -177157,22 +122844,22 @@ var require_googleauth2 = __commonJS((exports) => { exports.GoogleAuth = exports.GoogleAuthExceptionMessages = exports.CLOUD_SDK_CLIENT_ID = undefined; var child_process_1 = __require("child_process"); var fs2 = __require("fs"); - var gcpMetadata = require_src10(); + var gcpMetadata = require_src4(); var os3 = __require("os"); - var path11 = __require("path"); - var crypto_1 = require_crypto6(); - var transporters_1 = require_transporters2(); - var computeclient_1 = require_computeclient2(); - var idtokenclient_1 = require_idtokenclient2(); - var envDetect_1 = require_envDetect2(); - var jwtclient_1 = require_jwtclient2(); - var refreshclient_1 = require_refreshclient2(); - var impersonated_1 = require_impersonated2(); - var externalclient_1 = require_externalclient2(); - var baseexternalclient_1 = require_baseexternalclient2(); - var authclient_1 = require_authclient2(); - var externalAccountAuthorizedUserClient_1 = require_externalAccountAuthorizedUserClient2(); - var util_1 = require_util10(); + var path9 = __require("path"); + var crypto_1 = require_crypto3(); + var transporters_1 = require_transporters(); + var computeclient_1 = require_computeclient(); + var idtokenclient_1 = require_idtokenclient(); + var envDetect_1 = require_envDetect(); + var jwtclient_1 = require_jwtclient(); + var refreshclient_1 = require_refreshclient(); + var impersonated_1 = require_impersonated(); + var externalclient_1 = require_externalclient(); + var baseexternalclient_1 = require_baseexternalclient(); + var authclient_1 = require_authclient(); + var externalAccountAuthorizedUserClient_1 = require_externalAccountAuthorizedUserClient(); + var util_1 = require_util8(); exports.CLOUD_SDK_CLIENT_ID = "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com"; exports.GoogleAuthExceptionMessages = { API_KEY_WITH_CREDENTIALS: "API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.", @@ -177188,7 +122875,7 @@ var require_googleauth2 = __commonJS((exports) => { ` + "https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys" }; - class GoogleAuth2 { + class GoogleAuth { get isGCE() { return this.checkIsGCE; } @@ -177213,10 +122900,10 @@ var require_googleauth2 = __commonJS((exports) => { this.clientOptions.universeDomain = opts.universeDomain; } } - setGapicJWTValues(client4) { - client4.defaultServicePath = this.defaultServicePath; - client4.useJWTAccessWithScope = this.useJWTAccessWithScope; - client4.defaultScopes = this.defaultScopes; + setGapicJWTValues(client) { + client.defaultServicePath = this.defaultServicePath; + client.useJWTAccessWithScope = this.useJWTAccessWithScope; + client.defaultScopes = this.defaultScopes; } getProjectId(callback) { if (callback) { @@ -177260,13 +122947,13 @@ var require_googleauth2 = __commonJS((exports) => { return this._findProjectIdPromise; } async getUniverseDomainFromMetadataServer() { - var _a3; + var _a2; let universeDomain; try { universeDomain = await gcpMetadata.universe("universe-domain"); universeDomain || (universeDomain = authclient_1.DEFAULT_UNIVERSE); } catch (e) { - if (e && ((_a3 = e === null || e === undefined ? undefined : e.response) === null || _a3 === undefined ? undefined : _a3.status) === 404) { + if (e && ((_a2 = e === null || e === undefined ? undefined : e.response) === null || _a2 === undefined ? undefined : _a2.status) === 404) { universeDomain = authclient_1.DEFAULT_UNIVERSE; } else { throw e; @@ -177278,7 +122965,7 @@ var require_googleauth2 = __commonJS((exports) => { let universeDomain = (0, util_1.originalOrCamelOptions)(this.clientOptions).get("universe_domain"); try { universeDomain !== null && universeDomain !== undefined || (universeDomain = (await this.getClient()).universeDomain); - } catch (_a3) { + } catch (_a2) { universeDomain !== null && universeDomain !== undefined || (universeDomain = authclient_1.DEFAULT_UNIVERSE); } return universeDomain; @@ -177301,7 +122988,7 @@ var require_googleauth2 = __commonJS((exports) => { } async getApplicationDefaultAsync(options = {}) { if (this.cachedCredential) { - return await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, this.cachedCredential, null); + return await __classPrivateFieldGet2(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, this.cachedCredential, null); } let credential; credential = await this._tryGetApplicationCredentialsFromEnvironmentVariable(options); @@ -177311,7 +122998,7 @@ var require_googleauth2 = __commonJS((exports) => { } else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) { credential.scopes = this.getAnyScopes(); } - return await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, credential); + return await __classPrivateFieldGet2(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, credential); } credential = await this._tryGetApplicationCredentialsFromWellKnownFile(options); if (credential) { @@ -177320,11 +123007,11 @@ var require_googleauth2 = __commonJS((exports) => { } else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) { credential.scopes = this.getAnyScopes(); } - return await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, credential); + return await __classPrivateFieldGet2(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, credential); } if (await this._checkIsGCE()) { options.scopes = this.getAnyScopes(); - return await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, new computeclient_1.Compute(options)); + return await __classPrivateFieldGet2(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, new computeclient_1.Compute(options)); } throw new Error(exports.GoogleAuthExceptionMessages.NO_ADC_FOUND); } @@ -177355,11 +123042,11 @@ var require_googleauth2 = __commonJS((exports) => { } else { const home = process.env["HOME"]; if (home) { - location = path11.join(home, ".config"); + location = path9.join(home, ".config"); } } if (location) { - location = path11.join(location, "gcloud", "application_default_credentials.json"); + location = path9.join(location, "gcloud", "application_default_credentials.json"); if (!fs2.existsSync(location)) { location = null; } @@ -177367,8 +123054,8 @@ var require_googleauth2 = __commonJS((exports) => { if (!location) { return null; } - const client4 = await this._getApplicationCredentialsFromFilePath(location, options); - return client4; + const client = await this._getApplicationCredentialsFromFilePath(location, options); + return client; } async _getApplicationCredentialsFromFilePath(filePath, options = {}) { if (!filePath || filePath.length === 0) { @@ -177389,7 +123076,7 @@ var require_googleauth2 = __commonJS((exports) => { return this.fromStream(readStream2, options); } fromImpersonatedJSON(json2) { - var _a3, _b, _c, _d; + var _a2, _b, _c, _d; if (!json2) { throw new Error("Must pass in a JSON object containing an impersonated refresh token"); } @@ -177403,7 +123090,7 @@ var require_googleauth2 = __commonJS((exports) => { throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field"); } const sourceClient = this.fromJSON(json2.source_credentials); - if (((_a3 = json2.service_account_impersonation_url) === null || _a3 === undefined ? undefined : _a3.length) > 256) { + if (((_a2 = json2.service_account_impersonation_url) === null || _a2 === undefined ? undefined : _a2.length) > 256) { throw new RangeError(`Target principal is too long: ${json2.service_account_impersonation_url}`); } const targetPrincipal = (_c = (_b = /(?[^/]+):(generateAccessToken|generateIdToken)$/.exec(json2.service_account_impersonation_url)) === null || _b === undefined ? undefined : _b.groups) === null || _c === undefined ? undefined : _c.target; @@ -177419,34 +123106,34 @@ var require_googleauth2 = __commonJS((exports) => { }); } fromJSON(json2, options = {}) { - let client4; + let client; const preferredUniverseDomain = (0, util_1.originalOrCamelOptions)(options).get("universe_domain"); if (json2.type === refreshclient_1.USER_REFRESH_ACCOUNT_TYPE) { - client4 = new refreshclient_1.UserRefreshClient(options); - client4.fromJSON(json2); + client = new refreshclient_1.UserRefreshClient(options); + client.fromJSON(json2); } else if (json2.type === impersonated_1.IMPERSONATED_ACCOUNT_TYPE) { - client4 = this.fromImpersonatedJSON(json2); + client = this.fromImpersonatedJSON(json2); } else if (json2.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { - client4 = externalclient_1.ExternalAccountClient.fromJSON(json2, options); - client4.scopes = this.getAnyScopes(); + client = externalclient_1.ExternalAccountClient.fromJSON(json2, options); + client.scopes = this.getAnyScopes(); } else if (json2.type === externalAccountAuthorizedUserClient_1.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE) { - client4 = new externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient(json2, options); + client = new externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient(json2, options); } else { options.scopes = this.scopes; - client4 = new jwtclient_1.JWT(options); - this.setGapicJWTValues(client4); - client4.fromJSON(json2); + client = new jwtclient_1.JWT(options); + this.setGapicJWTValues(client); + client.fromJSON(json2); } if (preferredUniverseDomain) { - client4.universeDomain = preferredUniverseDomain; + client.universeDomain = preferredUniverseDomain; } - return client4; + return client; } _cacheClientFromJSON(json2, options) { - const client4 = this.fromJSON(json2, options); + const client = this.fromJSON(json2, options); this.jsonContent = json2; - this.cachedCredential = client4; - return client4; + this.cachedCredential = client; + return client; } fromStream(inputStream, optionsOrCallback = {}, callback) { let options = {}; @@ -177476,13 +123163,13 @@ var require_googleauth2 = __commonJS((exports) => { } catch (err) { if (!this.keyFilename) throw err; - const client4 = new jwtclient_1.JWT({ + const client = new jwtclient_1.JWT({ ...this.clientOptions, keyFile: this.keyFilename }); - this.cachedCredential = client4; - this.setGapicJWTValues(client4); - return resolve8(client4); + this.cachedCredential = client; + this.setGapicJWTValues(client); + return resolve8(client); } } catch (err) { return reject2(err); @@ -177559,16 +123246,16 @@ var require_googleauth2 = __commonJS((exports) => { } } async getCredentialsAsync() { - const client4 = await this.getClient(); - if (client4 instanceof impersonated_1.Impersonated) { - return { client_email: client4.getTargetPrincipal() }; + const client = await this.getClient(); + if (client instanceof impersonated_1.Impersonated) { + return { client_email: client.getTargetPrincipal() }; } - if (client4 instanceof baseexternalclient_1.BaseExternalAccountClient) { - const serviceAccountEmail = client4.getServiceAccountEmail(); + if (client instanceof baseexternalclient_1.BaseExternalAccountClient) { + const serviceAccountEmail = client.getServiceAccountEmail(); if (serviceAccountEmail) { return { client_email: serviceAccountEmail, - universe_domain: client4.universeDomain + universe_domain: client.universeDomain }; } } @@ -177592,54 +123279,54 @@ var require_googleauth2 = __commonJS((exports) => { if (this.cachedCredential) { return this.cachedCredential; } - __classPrivateFieldSet3(this, _GoogleAuth_pendingAuthClient, __classPrivateFieldGet3(this, _GoogleAuth_pendingAuthClient, "f") || __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_determineClient).call(this), "f"); + __classPrivateFieldSet2(this, _GoogleAuth_pendingAuthClient, __classPrivateFieldGet2(this, _GoogleAuth_pendingAuthClient, "f") || __classPrivateFieldGet2(this, _GoogleAuth_instances, "m", _GoogleAuth_determineClient).call(this), "f"); try { - return await __classPrivateFieldGet3(this, _GoogleAuth_pendingAuthClient, "f"); + return await __classPrivateFieldGet2(this, _GoogleAuth_pendingAuthClient, "f"); } finally { - __classPrivateFieldSet3(this, _GoogleAuth_pendingAuthClient, null, "f"); + __classPrivateFieldSet2(this, _GoogleAuth_pendingAuthClient, null, "f"); } } async getIdTokenClient(targetAudience) { - const client4 = await this.getClient(); - if (!("fetchIdToken" in client4)) { + const client = await this.getClient(); + if (!("fetchIdToken" in client)) { throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file."); } - return new idtokenclient_1.IdTokenClient({ targetAudience, idTokenProvider: client4 }); + return new idtokenclient_1.IdTokenClient({ targetAudience, idTokenProvider: client }); } async getAccessToken() { - const client4 = await this.getClient(); - return (await client4.getAccessToken()).token; + const client = await this.getClient(); + return (await client.getAccessToken()).token; } async getRequestHeaders(url3) { - const client4 = await this.getClient(); - return client4.getRequestHeaders(url3); + const client = await this.getClient(); + return client.getRequestHeaders(url3); } async authorizeRequest(opts) { opts = opts || {}; const url3 = opts.url || opts.uri; - const client4 = await this.getClient(); - const headers = await client4.getRequestHeaders(url3); + const client = await this.getClient(); + const headers = await client.getRequestHeaders(url3); opts.headers = Object.assign(opts.headers || {}, headers); return opts; } async request(opts) { - const client4 = await this.getClient(); - return client4.request(opts); + const client = await this.getClient(); + return client.request(opts); } getEnv() { return (0, envDetect_1.getEnv)(); } async sign(data, endpoint) { - const client4 = await this.getClient(); + const client = await this.getClient(); const universe = await this.getUniverseDomain(); endpoint = endpoint || `https://iamcredentials.${universe}/v1/projects/-/serviceAccounts/`; - if (client4 instanceof impersonated_1.Impersonated) { - const signed = await client4.sign(data); + if (client instanceof impersonated_1.Impersonated) { + const signed = await client.sign(data); return signed.signedBlob; } const crypto3 = (0, crypto_1.createCrypto)(); - if (client4 instanceof jwtclient_1.JWT && client4.key) { - const sign = await crypto3.sign(client4.key, data); + if (client instanceof jwtclient_1.JWT && client.key) { + const sign = await crypto3.sign(client.key, data); return sign; } const creds = await this.getCredentials(); @@ -177664,7 +123351,7 @@ var require_googleauth2 = __commonJS((exports) => { return res.data.signedBlob; } } - exports.GoogleAuth = GoogleAuth2; + exports.GoogleAuth = GoogleAuth; _GoogleAuth_pendingAuthClient = new WeakMap, _GoogleAuth_instances = new WeakSet, _GoogleAuth_prepareAndCacheClient = async function _GoogleAuth_prepareAndCacheClient(credential, quotaProjectIdOverride = process.env["GOOGLE_CLOUD_QUOTA_PROJECT"] || null) { const projectId = await this.getProjectIdOptional(); if (quotaProjectIdOverride) { @@ -177676,24 +123363,24 @@ var require_googleauth2 = __commonJS((exports) => { if (this.jsonContent) { return this._cacheClientFromJSON(this.jsonContent, this.clientOptions); } else if (this.keyFilename) { - const filePath = path11.resolve(this.keyFilename); + const filePath = path9.resolve(this.keyFilename); const stream4 = fs2.createReadStream(filePath); return await this.fromStreamAsync(stream4, this.clientOptions); } else if (this.apiKey) { - const client4 = await this.fromAPIKey(this.apiKey, this.clientOptions); - client4.scopes = this.scopes; - const { credential } = await __classPrivateFieldGet3(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, client4); + const client = await this.fromAPIKey(this.apiKey, this.clientOptions); + client.scopes = this.scopes; + const { credential } = await __classPrivateFieldGet2(this, _GoogleAuth_instances, "m", _GoogleAuth_prepareAndCacheClient).call(this, client); return credential; } else { const { credential } = await this.getApplicationDefaultAsync(this.clientOptions); return credential; } }; - GoogleAuth2.DefaultTransporter = transporters_1.DefaultTransporter; + GoogleAuth.DefaultTransporter = transporters_1.DefaultTransporter; }); // node_modules/google-auth-library/build/src/auth/iam.js -var require_iam2 = __commonJS((exports) => { +var require_iam = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.IAMAuth = undefined; @@ -177715,12 +123402,12 @@ var require_iam2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/downscopedclient.js -var require_downscopedclient2 = __commonJS((exports) => { +var require_downscopedclient = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.DownscopedClient = exports.EXPIRATION_TIME_OFFSET = exports.MAX_ACCESS_BOUNDARY_RULES_COUNT = undefined; var stream4 = __require("stream"); - var authclient_1 = require_authclient2(); - var sts = require_stscredentials2(); + var authclient_1 = require_authclient(); + var sts = require_stscredentials(); var STS_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange"; var STS_REQUEST_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"; var STS_SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"; @@ -177806,7 +123493,7 @@ var require_downscopedclient2 = __commonJS((exports) => { return response; } async refreshAccessTokenAsync() { - var _a3; + var _a2; const subjectToken = (await this.authClient.getAccessToken()).token; const stsCredentialsOptions = { grantType: STS_GRANT_TYPE, @@ -177815,7 +123502,7 @@ var require_downscopedclient2 = __commonJS((exports) => { subjectTokenType: STS_SUBJECT_TOKEN_TYPE }; const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, undefined, this.credentialAccessBoundary); - const sourceCredExpireDate = ((_a3 = this.authClient.credentials) === null || _a3 === undefined ? undefined : _a3.expiry_date) || null; + const sourceCredExpireDate = ((_a2 = this.authClient.credentials) === null || _a2 === undefined ? undefined : _a2.expiry_date) || null; const expiryDate = stsResponse.expires_in ? new Date().getTime() + stsResponse.expires_in * 1000 : sourceCredExpireDate; this.cachedDownscopedAccessToken = { access_token: stsResponse.access_token, @@ -177843,10 +123530,10 @@ var require_downscopedclient2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/auth/passthrough.js -var require_passthrough2 = __commonJS((exports) => { +var require_passthrough = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.PassThroughClient = undefined; - var authclient_1 = require_authclient2(); + var authclient_1 = require_authclient(); class PassThroughClient extends authclient_1.AuthClient { async request(opts) { @@ -177865,51 +123552,51 @@ var require_passthrough2 = __commonJS((exports) => { }); // node_modules/google-auth-library/build/src/index.js -var require_src12 = __commonJS((exports) => { +var require_src6 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.GoogleAuth = exports.auth = exports.DefaultTransporter = exports.PassThroughClient = exports.ExecutableError = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsRequestSigner = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.ClientAuthentication = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gaxios = exports.gcpMetadata = undefined; - var googleauth_1 = require_googleauth2(); + var googleauth_1 = require_googleauth(); Object.defineProperty(exports, "GoogleAuth", { enumerable: true, get: function() { return googleauth_1.GoogleAuth; } }); - exports.gcpMetadata = require_src10(); - exports.gaxios = require_src8(); - var authclient_1 = require_authclient2(); + exports.gcpMetadata = require_src4(); + exports.gaxios = require_src2(); + var authclient_1 = require_authclient(); Object.defineProperty(exports, "AuthClient", { enumerable: true, get: function() { return authclient_1.AuthClient; } }); Object.defineProperty(exports, "DEFAULT_UNIVERSE", { enumerable: true, get: function() { return authclient_1.DEFAULT_UNIVERSE; } }); - var computeclient_1 = require_computeclient2(); + var computeclient_1 = require_computeclient(); Object.defineProperty(exports, "Compute", { enumerable: true, get: function() { return computeclient_1.Compute; } }); - var envDetect_1 = require_envDetect2(); + var envDetect_1 = require_envDetect(); Object.defineProperty(exports, "GCPEnv", { enumerable: true, get: function() { return envDetect_1.GCPEnv; } }); - var iam_1 = require_iam2(); + var iam_1 = require_iam(); Object.defineProperty(exports, "IAMAuth", { enumerable: true, get: function() { return iam_1.IAMAuth; } }); - var idtokenclient_1 = require_idtokenclient2(); + var idtokenclient_1 = require_idtokenclient(); Object.defineProperty(exports, "IdTokenClient", { enumerable: true, get: function() { return idtokenclient_1.IdTokenClient; } }); - var jwtaccess_1 = require_jwtaccess2(); + var jwtaccess_1 = require_jwtaccess(); Object.defineProperty(exports, "JWTAccess", { enumerable: true, get: function() { return jwtaccess_1.JWTAccess; } }); - var jwtclient_1 = require_jwtclient2(); + var jwtclient_1 = require_jwtclient(); Object.defineProperty(exports, "JWT", { enumerable: true, get: function() { return jwtclient_1.JWT; } }); - var impersonated_1 = require_impersonated2(); + var impersonated_1 = require_impersonated(); Object.defineProperty(exports, "Impersonated", { enumerable: true, get: function() { return impersonated_1.Impersonated; } }); - var oauth2client_1 = require_oauth2client2(); + var oauth2client_1 = require_oauth2client(); Object.defineProperty(exports, "CodeChallengeMethod", { enumerable: true, get: function() { return oauth2client_1.CodeChallengeMethod; } }); @@ -177919,50 +123606,50 @@ var require_src12 = __commonJS((exports) => { Object.defineProperty(exports, "ClientAuthentication", { enumerable: true, get: function() { return oauth2client_1.ClientAuthentication; } }); - var loginticket_1 = require_loginticket2(); + var loginticket_1 = require_loginticket(); Object.defineProperty(exports, "LoginTicket", { enumerable: true, get: function() { return loginticket_1.LoginTicket; } }); - var refreshclient_1 = require_refreshclient2(); + var refreshclient_1 = require_refreshclient(); Object.defineProperty(exports, "UserRefreshClient", { enumerable: true, get: function() { return refreshclient_1.UserRefreshClient; } }); - var awsclient_1 = require_awsclient2(); + var awsclient_1 = require_awsclient(); Object.defineProperty(exports, "AwsClient", { enumerable: true, get: function() { return awsclient_1.AwsClient; } }); - var awsrequestsigner_1 = require_awsrequestsigner2(); + var awsrequestsigner_1 = require_awsrequestsigner(); Object.defineProperty(exports, "AwsRequestSigner", { enumerable: true, get: function() { return awsrequestsigner_1.AwsRequestSigner; } }); - var identitypoolclient_1 = require_identitypoolclient2(); + var identitypoolclient_1 = require_identitypoolclient(); Object.defineProperty(exports, "IdentityPoolClient", { enumerable: true, get: function() { return identitypoolclient_1.IdentityPoolClient; } }); - var externalclient_1 = require_externalclient2(); + var externalclient_1 = require_externalclient(); Object.defineProperty(exports, "ExternalAccountClient", { enumerable: true, get: function() { return externalclient_1.ExternalAccountClient; } }); - var baseexternalclient_1 = require_baseexternalclient2(); + var baseexternalclient_1 = require_baseexternalclient(); Object.defineProperty(exports, "BaseExternalAccountClient", { enumerable: true, get: function() { return baseexternalclient_1.BaseExternalAccountClient; } }); - var downscopedclient_1 = require_downscopedclient2(); + var downscopedclient_1 = require_downscopedclient(); Object.defineProperty(exports, "DownscopedClient", { enumerable: true, get: function() { return downscopedclient_1.DownscopedClient; } }); - var pluggable_auth_client_1 = require_pluggable_auth_client2(); + var pluggable_auth_client_1 = require_pluggable_auth_client(); Object.defineProperty(exports, "PluggableAuthClient", { enumerable: true, get: function() { return pluggable_auth_client_1.PluggableAuthClient; } }); Object.defineProperty(exports, "ExecutableError", { enumerable: true, get: function() { return pluggable_auth_client_1.ExecutableError; } }); - var passthrough_1 = require_passthrough2(); + var passthrough_1 = require_passthrough(); Object.defineProperty(exports, "PassThroughClient", { enumerable: true, get: function() { return passthrough_1.PassThroughClient; } }); - var transporters_1 = require_transporters2(); + var transporters_1 = require_transporters(); Object.defineProperty(exports, "DefaultTransporter", { enumerable: true, get: function() { return transporters_1.DefaultTransporter; } }); @@ -178025,7 +123712,7 @@ async function getAnthropicClient({ } }; if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK)) { - const { AnthropicBedrock: AnthropicBedrock2 } = await Promise.resolve().then(() => (init_bedrock_sdk(), exports_bedrock_sdk)); + const { AnthropicBedrock } = await Promise.resolve().then(() => (init_bedrock_sdk(), exports_bedrock_sdk)); const awsRegion = model === getSmallFastModel() && process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION ? process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION : getAWSRegion(); const bedrockArgs = { ...ARGS, @@ -178049,10 +123736,10 @@ async function getAnthropicClient({ bedrockArgs.awsSessionToken = cachedCredentials.sessionToken; } } - return new AnthropicBedrock2(bedrockArgs); + return new AnthropicBedrock(bedrockArgs); } if (isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY)) { - const { AnthropicFoundry: AnthropicFoundry2 } = await Promise.resolve().then(() => (init_foundry_sdk(), exports_foundry_sdk)); + const { AnthropicFoundry } = await Promise.resolve().then(() => (init_foundry_sdk(), exports_foundry_sdk)); let azureADTokenProvider; if (!process.env.ANTHROPIC_FOUNDRY_API_KEY) { if (isEnvTruthy(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH)) { @@ -178070,15 +123757,15 @@ async function getAnthropicClient({ ...azureADTokenProvider && { azureADTokenProvider }, ...isDebugToStdErr() && { logger: createStderrLogger() } }; - return new AnthropicFoundry2(foundryArgs); + return new AnthropicFoundry(foundryArgs); } if (isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX)) { if (!isEnvTruthy(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)) { await refreshGcpCredentialsIfNeeded(); } - const [{ AnthropicVertex: AnthropicVertex2 }, { GoogleAuth: GoogleAuth2 }] = await Promise.all([ + const [{ AnthropicVertex }, { GoogleAuth }] = await Promise.all([ Promise.resolve().then(() => (init_vertex_sdk(), exports_vertex_sdk)), - Promise.resolve().then(() => __toESM(require_src12(), 1)) + Promise.resolve().then(() => __toESM(require_src6(), 1)) ]); const hasProjectEnvVar = process.env["GCLOUD_PROJECT"] || process.env["GOOGLE_CLOUD_PROJECT"] || process.env["gcloud_project"] || process.env["google_cloud_project"]; const hasKeyFile = process.env["GOOGLE_APPLICATION_CREDENTIALS"] || process.env["google_application_credentials"]; @@ -178086,7 +123773,7 @@ async function getAnthropicClient({ getClient: () => ({ getRequestHeaders: () => ({}) }) - } : new GoogleAuth2({ + } : new GoogleAuth({ scopes: ["https://www.googleapis.com/auth/cloud-platform"], ...hasProjectEnvVar || hasKeyFile ? {} : { projectId: process.env.ANTHROPIC_VERTEX_PROJECT_ID @@ -178098,7 +123785,7 @@ async function getAnthropicClient({ googleAuth, ...isDebugToStdErr() && { logger: createStderrLogger() } }; - return new AnthropicVertex2(vertexArgs); + return new AnthropicVertex(vertexArgs); } const clientConfig = { apiKey: isClaudeAISubscriber() ? null : apiKey || getAnthropicApiKey(), @@ -178138,23 +123825,23 @@ function getCustomHeaders() { function buildFetch(fetchOverride, source) { const inner = fetchOverride ?? globalThis.fetch; const injectClientRequestId = getAPIProvider() === "firstParty" && isFirstPartyAnthropicBaseUrl(); - return (input2, init) => { + return (input, init) => { const headers = new Headers(init?.headers); if (injectClientRequestId && !headers.has(CLIENT_REQUEST_ID_HEADER)) { headers.set(CLIENT_REQUEST_ID_HEADER, randomUUID2()); } try { - const url3 = input2 instanceof Request ? input2.url : String(input2); + const url3 = input instanceof Request ? input.url : String(input); const id = headers.get(CLIENT_REQUEST_ID_HEADER); logForDebugging(`[API REQUEST] ${new URL(url3).pathname}${id ? ` ${CLIENT_REQUEST_ID_HEADER}=${id}` : ""} source=${source ?? "unknown"}`); } catch {} - return inner(input2, { ...init, headers }); + return inner(input, { ...init, headers }); }; } var CLIENT_REQUEST_ID_HEADER = "x-client-request-id"; -var init_client7 = __esm(() => { +var init_client3 = __esm(() => { init_sdk(); - init_auth2(); + init_auth(); init_http2(); init_model(); init_providers(); @@ -178215,21 +123902,21 @@ async function refreshModelCapabilities() { } if (parsed.length === 0) return; - const path11 = getCachePath(); + const path9 = getCachePath(); const models = sortForMatching(parsed); - if (isEqual_default(loadCache(path11), models)) { + if (isEqual_default(loadCache(path9), models)) { logForDebugging("[modelCapabilities] cache unchanged, skipping write"); return; } await mkdir3(getCacheDir(), { recursive: true }); - await writeFile2(path11, jsonStringify({ models, timestamp: Date.now() }), { + await writeFile2(path9, jsonStringify({ models, timestamp: Date.now() }), { encoding: "utf-8", mode: 384 }); - loadCache.cache.delete(path11); + loadCache.cache.delete(path9); logForDebugging(`[modelCapabilities] cached ${models.length} models`); - } catch (error45) { - logForDebugging(`[modelCapabilities] fetch failed: ${error45 instanceof Error ? error45.message : "unknown"}`); + } catch (error41) { + logForDebugging(`[modelCapabilities] fetch failed: ${error41 instanceof Error ? error41.message : "unknown"}`); } } var ModelCapabilitySchema, CacheFileSchema, loadCache; @@ -178238,8 +123925,8 @@ var init_modelCapabilities = __esm(() => { init_memoize(); init_v4(); init_oauth(); - init_client7(); - init_auth2(); + init_client3(); + init_auth(); init_debug(); init_envUtils(); init_json(); @@ -178254,15 +123941,15 @@ var init_modelCapabilities = __esm(() => { models: exports_external.array(ModelCapabilitySchema()), timestamp: exports_external.number() })); - loadCache = memoize_default((path11) => { + loadCache = memoize_default((path9) => { try { - const raw = readFileSync6(path11, "utf-8"); + const raw = readFileSync6(path9, "utf-8"); const parsed = CacheFileSchema().safeParse(safeParseJSON(raw, false)); return parsed.success ? parsed.data.models : null; } catch { return null; } - }, (path11) => path11); + }, (path9) => path9); }); // src/utils/context.ts @@ -178565,7 +124252,7 @@ var init_betas2 = __esm(() => { init_state(); init_betas(); init_oauth(); - init_auth2(); + init_auth(); init_context(); init_envUtils(); init_model(); @@ -178692,14 +124379,14 @@ var require_polyfills = __commonJS((exports, module) => { fs2.fstatSync = statFixSync(fs2.fstatSync); fs2.lstatSync = statFixSync(fs2.lstatSync); if (fs2.chmod && !fs2.lchmod) { - fs2.lchmod = function(path11, mode, cb) { + fs2.lchmod = function(path9, mode, cb) { if (cb) process.nextTick(cb); }; fs2.lchmodSync = function() {}; } if (fs2.chown && !fs2.lchown) { - fs2.lchown = function(path11, uid, gid, cb) { + fs2.lchown = function(path9, uid, gid, cb) { if (cb) process.nextTick(cb); }; @@ -178769,8 +124456,8 @@ var require_polyfills = __commonJS((exports, module) => { }; }(fs2.readSync); function patchLchmod(fs3) { - fs3.lchmod = function(path11, mode, callback) { - fs3.open(path11, constants4.O_WRONLY | constants4.O_SYMLINK, mode, function(err, fd) { + fs3.lchmod = function(path9, mode, callback) { + fs3.open(path9, constants4.O_WRONLY | constants4.O_SYMLINK, mode, function(err, fd) { if (err) { if (callback) callback(err); @@ -178784,8 +124471,8 @@ var require_polyfills = __commonJS((exports, module) => { }); }); }; - fs3.lchmodSync = function(path11, mode) { - var fd = fs3.openSync(path11, constants4.O_WRONLY | constants4.O_SYMLINK, mode); + fs3.lchmodSync = function(path9, mode) { + var fd = fs3.openSync(path9, constants4.O_WRONLY | constants4.O_SYMLINK, mode); var threw = true; var ret; try { @@ -178805,8 +124492,8 @@ var require_polyfills = __commonJS((exports, module) => { } function patchLutimes(fs3) { if (constants4.hasOwnProperty("O_SYMLINK") && fs3.futimes) { - fs3.lutimes = function(path11, at2, mt, cb) { - fs3.open(path11, constants4.O_SYMLINK, function(er, fd) { + fs3.lutimes = function(path9, at2, mt, cb) { + fs3.open(path9, constants4.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); @@ -178820,8 +124507,8 @@ var require_polyfills = __commonJS((exports, module) => { }); }); }; - fs3.lutimesSync = function(path11, at2, mt) { - var fd = fs3.openSync(path11, constants4.O_SYMLINK); + fs3.lutimesSync = function(path9, at2, mt) { + var fd = fs3.openSync(path9, constants4.O_SYMLINK); var ret; var threw = true; try { @@ -178839,7 +124526,7 @@ var require_polyfills = __commonJS((exports, module) => { return ret; }; } else if (fs3.futimes) { - fs3.lutimes = function(_a3, _b, _c, cb) { + fs3.lutimes = function(_a2, _b, _c, cb) { if (cb) process.nextTick(cb); }; @@ -178946,19 +124633,19 @@ var require_polyfills = __commonJS((exports, module) => { // node_modules/graceful-fs/legacy-streams.js var require_legacy_streams = __commonJS((exports, module) => { - var Stream4 = __require("stream").Stream; + var Stream2 = __require("stream").Stream; module.exports = legacy; function legacy(fs2) { return { ReadStream, WriteStream }; - function ReadStream(path11, options) { + function ReadStream(path9, options) { if (!(this instanceof ReadStream)) - return new ReadStream(path11, options); - Stream4.call(this); + return new ReadStream(path9, options); + Stream2.call(this); var self2 = this; - this.path = path11; + this.path = path9; this.fd = null; this.readable = true; this.paused = false; @@ -179004,11 +124691,11 @@ var require_legacy_streams = __commonJS((exports, module) => { self2._read(); }); } - function WriteStream(path11, options) { + function WriteStream(path9, options) { if (!(this instanceof WriteStream)) - return new WriteStream(path11, options); - Stream4.call(this); - this.path = path11; + return new WriteStream(path9, options); + Stream2.call(this); + this.path = path9; this.fd = null; this.writable = true; this.flags = "w"; @@ -179077,7 +124764,7 @@ var require_graceful_fs = __commonJS((exports, module) => { gracefulQueue = "___graceful-fs.queue"; previousSymbol = "___graceful-fs.previous"; } - function noop9() {} + function noop7() {} function publishQueue(context, queue2) { Object.defineProperty(context, gracefulQueue, { get: function() { @@ -179085,7 +124772,7 @@ var require_graceful_fs = __commonJS((exports, module) => { } }); } - var debug = noop9; + var debug = noop7; if (util3.debuglog) debug = util3.debuglog("gfs4"); else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) @@ -179146,14 +124833,14 @@ GFS4: `); fs3.createWriteStream = createWriteStream3; var fs$readFile = fs3.readFile; fs3.readFile = readFile8; - function readFile8(path11, options, cb) { + function readFile8(path9, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$readFile(path11, options, cb); - function go$readFile(path12, options2, cb2, startTime) { - return fs$readFile(path12, options2, function(err) { + return go$readFile(path9, options, cb); + function go$readFile(path10, options2, cb2, startTime) { + return fs$readFile(path10, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path12, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$readFile, [path10, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -179163,14 +124850,14 @@ GFS4: `); } var fs$writeFile = fs3.writeFile; fs3.writeFile = writeFile3; - function writeFile3(path11, data, options, cb) { + function writeFile3(path9, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$writeFile(path11, data, options, cb); - function go$writeFile(path12, data2, options2, cb2, startTime) { - return fs$writeFile(path12, data2, options2, function(err) { + return go$writeFile(path9, data, options, cb); + function go$writeFile(path10, data2, options2, cb2, startTime) { + return fs$writeFile(path10, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path12, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$writeFile, [path10, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -179181,14 +124868,14 @@ GFS4: `); var fs$appendFile = fs3.appendFile; if (fs$appendFile) fs3.appendFile = appendFile3; - function appendFile3(path11, data, options, cb) { + function appendFile3(path9, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$appendFile(path11, data, options, cb); - function go$appendFile(path12, data2, options2, cb2, startTime) { - return fs$appendFile(path12, data2, options2, function(err) { + return go$appendFile(path9, data, options, cb); + function go$appendFile(path10, data2, options2, cb2, startTime) { + return fs$appendFile(path10, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path12, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$appendFile, [path10, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -179219,21 +124906,21 @@ GFS4: `); var fs$readdir = fs3.readdir; fs3.readdir = readdir5; var noReaddirOptionVersions = /^v[0-5]\./; - function readdir5(path11, options, cb) { + function readdir5(path9, options, cb) { if (typeof options === "function") cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(path12, options2, cb2, startTime) { - return fs$readdir(path12, fs$readdirCallback(path12, options2, cb2, startTime)); - } : function go$readdir(path12, options2, cb2, startTime) { - return fs$readdir(path12, options2, fs$readdirCallback(path12, options2, cb2, startTime)); + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(path10, options2, cb2, startTime) { + return fs$readdir(path10, fs$readdirCallback(path10, options2, cb2, startTime)); + } : function go$readdir(path10, options2, cb2, startTime) { + return fs$readdir(path10, options2, fs$readdirCallback(path10, options2, cb2, startTime)); }; - return go$readdir(path11, options, cb); - function fs$readdirCallback(path12, options2, cb2, startTime) { + return go$readdir(path9, options, cb); + function fs$readdirCallback(path10, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, - [path12, options2, cb2], + [path10, options2, cb2], err, startTime || Date.now(), Date.now() @@ -179304,7 +124991,7 @@ GFS4: `); enumerable: true, configurable: true }); - function ReadStream(path11, options) { + function ReadStream(path9, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else @@ -179324,7 +125011,7 @@ GFS4: `); } }); } - function WriteStream(path11, options) { + function WriteStream(path9, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else @@ -179342,22 +125029,22 @@ GFS4: `); } }); } - function createReadStream2(path11, options) { - return new fs3.ReadStream(path11, options); + function createReadStream2(path9, options) { + return new fs3.ReadStream(path9, options); } - function createWriteStream3(path11, options) { - return new fs3.WriteStream(path11, options); + function createWriteStream3(path9, options) { + return new fs3.WriteStream(path9, options); } var fs$open = fs3.open; fs3.open = open4; - function open4(path11, flags, mode, cb) { + function open4(path9, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; - return go$open(path11, flags, mode, cb); - function go$open(path12, flags2, mode2, cb2, startTime) { - return fs$open(path12, flags2, mode2, function(err, fd) { + return go$open(path9, flags, mode, cb); + function go$open(path10, flags2, mode2, cb2, startTime) { + return fs$open(path10, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path12, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$open, [path10, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -179535,12 +125222,12 @@ var require_retry_operation = __commonJS((exports, module) => { var mainError = null; var mainErrorCount = 0; for (var i2 = 0;i2 < this._errors.length; i2++) { - var error45 = this._errors[i2]; - var message = error45.message; + var error41 = this._errors[i2]; + var message = error41.message; var count3 = (counts[message] || 0) + 1; counts[message] = count3; if (count3 >= mainErrorCount) { - mainError = error45; + mainError = error41; mainErrorCount = count3; } } @@ -179549,7 +125236,7 @@ var require_retry_operation = __commonJS((exports, module) => { }); // node_modules/retry/lib/retry.js -var require_retry4 = __commonJS((exports) => { +var require_retry3 = __commonJS((exports) => { var RetryOperation = require_retry_operation(); exports.operation = function(options) { var timeouts = exports.timeouts(options); @@ -179660,7 +125347,7 @@ var require_signal_exit = __commonJS((exports, module) => { return function() {}; }; } else { - assert3 = __require("assert"); + assert2 = __require("assert"); signals2 = require_signals(); isWin = /^win/i.test(process12.platform); EE = __require("events"); @@ -179682,7 +125369,7 @@ var require_signal_exit = __commonJS((exports, module) => { if (!processOk2(global.process)) { return function() {}; } - assert3.equal(typeof cb, "function", "a callback must be provided for exit handler"); + assert2.equal(typeof cb, "function", "a callback must be provided for exit handler"); if (loaded === false) { load2(); } @@ -179786,7 +125473,7 @@ var require_signal_exit = __commonJS((exports, module) => { } }; } - var assert3; + var assert2; var signals2; var isWin; var EE; @@ -179843,9 +125530,9 @@ var require_mtime_precision = __commonJS((exports, module) => { // node_modules/proper-lockfile/lib/lockfile.js var require_lockfile = __commonJS((exports, module) => { - var path11 = __require("path"); + var path9 = __require("path"); var fs2 = require_graceful_fs(); - var retry = require_retry4(); + var retry = require_retry3(); var onExit2 = require_signal_exit(); var mtimePrecision = require_mtime_precision(); var locks = {}; @@ -179854,7 +125541,7 @@ var require_lockfile = __commonJS((exports, module) => { } function resolveCanonicalPath(file2, options, callback) { if (!options.realpath) { - return callback(null, path11.resolve(file2)); + return callback(null, path9.resolve(file2)); } options.fs.realpath(file2, callback); } @@ -180504,7 +126191,7 @@ var init_keychainPrefetch = __esm(() => { }); // src/utils/sleep.ts -function sleep4(ms, signal, opts) { +function sleep2(ms, signal, opts) { return new Promise((resolve8, reject2) => { if (signal?.aborted) { if (opts?.throwOnAbort || opts?.abortError) { @@ -180867,8 +126554,8 @@ async function _executeApiKeyHelper(isNonInteractiveSession) { if (isApiKeyHelperFromProjectOrLocalSettings()) { const hasTrust = checkHasTrustDialogAccepted(); if (!hasTrust && !isNonInteractiveSession) { - const error45 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${"https://github.com/anthropics/claude-code/issues"}.`); - logAntError("apiKeyHelper invoked before trust check", error45); + const error41 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${"https://github.com/anthropics/claude-code/issues"}.`); + logAntError("apiKeyHelper invoked before trust check", error41); logEvent("tengu_apiKeyHelper_missing_trust11", {}); return null; } @@ -180911,8 +126598,8 @@ async function runAwsAuthRefresh() { if (isAwsAuthRefreshFromProjectSettings()) { const hasTrust = checkHasTrustDialogAccepted(); if (!hasTrust && !getIsNonInteractiveSession()) { - const error45 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${"https://github.com/anthropics/claude-code/issues"}.`); - logAntError("awsAuthRefresh invoked before trust check", error45); + const error41 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${"https://github.com/anthropics/claude-code/issues"}.`); + logAntError("awsAuthRefresh invoked before trust check", error41); logEvent("tengu_awsAuthRefresh_missing_trust", {}); return false; } @@ -180942,10 +126629,10 @@ function refreshAwsAuth(awsAuthRefresh) { } }); refreshProc.stderr.on("data", (data) => { - const error45 = data.toString().trim(); - if (error45) { - authStatusManager.setError(error45); - logForDebugging(error45, { level: "error" }); + const error41 = data.toString().trim(); + if (error41) { + authStatusManager.setError(error41); + logForDebugging(error41, { level: "error" }); } }); refreshProc.on("close", (code, signal) => { @@ -180971,8 +126658,8 @@ async function getAwsCredsFromCredentialExport() { if (isAwsCredentialExportFromProjectSettings()) { const hasTrust = checkHasTrustDialogAccepted(); if (!hasTrust && !getIsNonInteractiveSession()) { - const error45 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${"https://github.com/anthropics/claude-code/issues"}.`); - logAntError("awsCredentialExport invoked before trust check", error45); + const error41 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${"https://github.com/anthropics/claude-code/issues"}.`); + logAntError("awsCredentialExport invoked before trust check", error41); logEvent("tengu_awsCredentialExport_missing_trust", {}); return null; } @@ -181031,15 +126718,15 @@ function isGcpAuthRefreshFromProjectSettings() { } async function checkGcpCredentialsValid() { try { - const { GoogleAuth: GoogleAuth2 } = await Promise.resolve().then(() => __toESM(require_src12(), 1)); - const auth = new GoogleAuth2({ + const { GoogleAuth } = await Promise.resolve().then(() => __toESM(require_src6(), 1)); + const auth = new GoogleAuth({ scopes: ["https://www.googleapis.com/auth/cloud-platform"] }); const probe = (async () => { - const client4 = await auth.getClient(); - await client4.getAccessToken(); + const client = await auth.getClient(); + await client.getAccessToken(); })(); - const timeout = sleep4(GCP_CREDENTIALS_CHECK_TIMEOUT_MS).then(() => { + const timeout = sleep2(GCP_CREDENTIALS_CHECK_TIMEOUT_MS).then(() => { throw new GcpCredentialsTimeoutError("GCP credentials check timed out"); }); await Promise.race([probe, timeout]); @@ -181056,8 +126743,8 @@ async function runGcpAuthRefresh() { if (isGcpAuthRefreshFromProjectSettings()) { const hasTrust = checkHasTrustDialogAccepted(); if (!hasTrust && !getIsNonInteractiveSession()) { - const error45 = new Error("Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in https://github.com/anthropics/claude-code/issues."); - logAntError("gcpAuthRefresh invoked before trust check", error45); + const error41 = new Error("Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in https://github.com/anthropics/claude-code/issues."); + logAntError("gcpAuthRefresh invoked before trust check", error41); logEvent("tengu_gcpAuthRefresh_missing_trust", {}); return false; } @@ -181088,10 +126775,10 @@ function refreshGcpAuth(gcpAuthRefresh) { } }); refreshProc.stderr.on("data", (data) => { - const error45 = data.toString().trim(); - if (error45) { - authStatusManager.setError(error45); - logForDebugging(error45, { level: "error" }); + const error41 = data.toString().trim(); + if (error41) { + authStatusManager.setError(error41); + logForDebugging(error41, { level: "error" }); } }); refreshProc.on("close", (code, signal) => { @@ -181241,11 +126928,11 @@ function saveOAuthTokensIfNeeded(tokens) { clearBetasCaches(); clearToolSchemaCache(); return updateStatus; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); logEvent("tengu_oauth_tokens_save_exception", { storageBackend, - error: errorMessage(error45) + error: errorMessage(error41) }); return { success: false, warning: "Failed to save OAuth tokens" }; } @@ -181301,8 +126988,8 @@ async function getClaudeAIOAuthTokensAsync() { return null; } return oauthData; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return null; } } @@ -181353,7 +127040,7 @@ async function checkAndRefreshOAuthTokenIfNeededImpl(retryCount, force) { logEvent("tengu_oauth_token_refresh_lock_retry", { retryCount: retryCount + 1 }); - await sleep4(1000 + Math.random() * 1000); + await sleep2(1000 + Math.random() * 1000); return checkAndRefreshOAuthTokenIfNeededImpl(retryCount + 1, force); } logEvent("tengu_oauth_token_refresh_lock_retry_limit_reached", { @@ -181383,8 +127070,8 @@ async function checkAndRefreshOAuthTokenIfNeededImpl(retryCount, force) { getClaudeAIOAuthTokens.cache?.clear?.(); clearKeychainCache(); return true; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); getClaudeAIOAuthTokens.cache?.clear?.(); clearKeychainCache(); const currentTokens = await getClaudeAIOAuthTokensAsync(); @@ -181538,9 +127225,9 @@ function getOtelHeadersFromHelper() { cachedOtelHeaders = headers; cachedOtelHeadersTimestamp = Date.now(); return cachedOtelHeaders; - } catch (error45) { - logError2(new Error(`Error getting OpenTelemetry headers from otelHeadersHelper (in settings): ${errorMessage(error45)}`)); - throw error45; + } catch (error41) { + logError2(new Error(`Error getting OpenTelemetry headers from otelHeadersHelper (in settings): ${errorMessage(error41)}`)); + throw error41; } } function isConsumerPlan(plan) { @@ -181635,7 +127322,7 @@ Please log in with the correct organization: claude auth login` }; } var DEFAULT_API_KEY_HELPER_TTL, _apiKeyHelperCache = null, _apiKeyHelperInflight = null, _apiKeyHelperEpoch = 0, DEFAULT_AWS_STS_TTL, AWS_AUTH_REFRESH_TIMEOUT_MS, refreshAndGetAwsCredentials, GCP_CREDENTIALS_CHECK_TIMEOUT_MS = 5000, DEFAULT_GCP_CREDENTIAL_TTL = 3600000, GCP_AUTH_REFRESH_TIMEOUT_MS = 180000, refreshGcpCredentialsIfNeeded, getApiKeyFromConfigOrMacOSKeychain, getClaudeAIOAuthTokens, lastCredentialsMtimeMs = 0, pending401Handlers, pendingRefreshCheck = null, cachedOtelHeaders = null, cachedOtelHeadersTimestamp = 0, DEFAULT_OTEL_HEADERS_DEBOUNCE_MS = 1740000, GcpCredentialsTimeoutError; -var init_auth2 = __esm(() => { +var init_auth = __esm(() => { init_source(); init_execa(); init_memoize(); @@ -181739,8 +127426,8 @@ var init_auth2 = __esm(() => { return null; } return oauthData; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return null; } }); @@ -181792,7 +127479,7 @@ function getMCPUserAgent() { function getWebFetchUserAgent() { return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`; } -function getAuthHeaders2() { +function getAuthHeaders() { if (isClaudeAISubscriber()) { const oauthTokens = getClaudeAIOAuthTokens(); if (!oauthTokens?.accessToken) { @@ -181841,7 +127528,7 @@ async function withOAuth401Retry(request, opts) { var init_http2 = __esm(() => { init_axios2(); init_oauth(); - init_auth2(); + init_auth(); init_workloadContext(); }); @@ -181897,7 +127584,7 @@ var init_user = __esm(() => { init_execa(); init_memoize(); init_state(); - init_auth2(); + init_auth(); init_config2(); init_cwd2(); init_env(); @@ -181956,7 +127643,7 @@ var init_user = __esm(() => { }); // node_modules/@opentelemetry/api/build/src/version.js -var require_version3 = __commonJS((exports) => { +var require_version2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.VERSION = undefined; exports.VERSION = "1.9.1"; @@ -181966,7 +127653,7 @@ var require_version3 = __commonJS((exports) => { var require_semver = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isCompatible = exports._makeCompatibilityCheck = undefined; - var version_1 = require_version3(); + var version_1 = require_version2(); var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; function _makeCompatibilityCheck(ownVersion) { const acceptedVersions = new Set([ownVersion]); @@ -182037,14 +127724,14 @@ var require_semver = __commonJS((exports) => { var require_global_utils = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = undefined; - var version_1 = require_version3(); + var version_1 = require_version2(); var semver_1 = require_semver(); var major = version_1.VERSION.split(".")[0]; var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`); var _global2 = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {}; function registerGlobal(type, instance, diag, allowOverride = false) { - var _a3; - const api2 = _global2[GLOBAL_OPENTELEMETRY_API_KEY] = (_a3 = _global2[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a3 !== undefined ? _a3 : { + var _a2; + const api2 = _global2[GLOBAL_OPENTELEMETRY_API_KEY] = (_a2 = _global2[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a2 !== undefined ? _a2 : { version: version_1.VERSION }; if (!allowOverride && api2[type]) { @@ -182063,8 +127750,8 @@ var require_global_utils = __commonJS((exports) => { } exports.registerGlobal = registerGlobal; function getGlobal2(type) { - var _a3, _b; - const globalVersion = (_a3 = _global2[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a3 === undefined ? undefined : _a3.version; + var _a2, _b; + const globalVersion = (_a2 = _global2[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a2 === undefined ? undefined : _a2.version; if (!globalVersion || !(0, semver_1.isCompatible)(globalVersion)) { return; } @@ -182191,10 +127878,10 @@ var require_diag = __commonJS((exports) => { } const self2 = this; const setLogger = (logger, optionsOrLogLevel = { logLevel: types_1.DiagLogLevel.INFO }) => { - var _a3, _b, _c; + var _a2, _b, _c; if (logger === self2) { const err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); - self2.error((_a3 = err.stack) !== null && _a3 !== undefined ? _a3 : err.message); + self2.error((_a2 = err.stack) !== null && _a2 !== undefined ? _a2 : err.message); return false; } if (typeof optionsOrLogLevel === "number") { @@ -182279,7 +127966,7 @@ var require_symbol = __commonJS((exports) => { }); // node_modules/@opentelemetry/api/build/src/baggage/utils.js -var require_utils4 = __commonJS((exports) => { +var require_utils3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.baggageEntryMetadataFromString = exports.createBaggage = undefined; var diag_1 = require_diag(); @@ -182680,8 +128367,8 @@ var require_context_utils = __commonJS((exports) => { } exports.setSpanContext = setSpanContext; function getSpanContext(context) { - var _a3; - return (_a3 = getSpan(context)) === null || _a3 === undefined ? undefined : _a3.spanContext(); + var _a2; + return (_a2 = getSpan(context)) === null || _a2 === undefined ? undefined : _a2.spanContext(); } exports.getSpanContext = getSpanContext; }); @@ -182935,19 +128622,19 @@ var require_ProxyTracerProvider = __commonJS((exports) => { class ProxyTracerProvider { getTracer(name, version2, options) { - var _a3; - return (_a3 = this.getDelegateTracer(name, version2, options)) !== null && _a3 !== undefined ? _a3 : new ProxyTracer_1.ProxyTracer(this, name, version2, options); + var _a2; + return (_a2 = this.getDelegateTracer(name, version2, options)) !== null && _a2 !== undefined ? _a2 : new ProxyTracer_1.ProxyTracer(this, name, version2, options); } getDelegate() { - var _a3; - return (_a3 = this._delegate) !== null && _a3 !== undefined ? _a3 : NOOP_TRACER_PROVIDER; + var _a2; + return (_a2 = this._delegate) !== null && _a2 !== undefined ? _a2 : NOOP_TRACER_PROVIDER; } setDelegate(delegate) { this._delegate = delegate; } getDelegateTracer(name, version2, options) { - var _a3; - return (_a3 = this._delegate) === null || _a3 === undefined ? undefined : _a3.getTracer(name, version2, options); + var _a2; + return (_a2 = this._delegate) === null || _a2 === undefined ? undefined : _a2.getTracer(name, version2, options); } } exports.ProxyTracerProvider = ProxyTracerProvider; @@ -183081,7 +128768,7 @@ var require_tracestate_impl = __commonJS((exports) => { }); // node_modules/@opentelemetry/api/build/src/trace/internal/utils.js -var require_utils5 = __commonJS((exports) => { +var require_utils4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createTraceState = undefined; var tracestate_impl_1 = require_tracestate_impl(); @@ -183213,7 +128900,7 @@ var require_propagation = __commonJS((exports) => { var NoopTextMapPropagator_1 = require_NoopTextMapPropagator(); var TextMapPropagator_1 = require_TextMapPropagator(); var context_helpers_1 = require_context_helpers(); - var utils_1 = require_utils4(); + var utils_1 = require_utils3(); var diag_1 = require_diag(); var API_NAME = "propagation"; var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator; @@ -183321,10 +129008,10 @@ var require_trace_api = __commonJS((exports) => { }); // node_modules/@opentelemetry/api/build/src/index.js -var require_src13 = __commonJS((exports) => { +var require_src7 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.trace = exports.propagation = exports.metrics = exports.diag = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.TraceFlags = exports.SpanStatusCode = exports.SpanKind = exports.SamplingDecision = exports.ProxyTracerProvider = exports.ProxyTracer = exports.defaultTextMapSetter = exports.defaultTextMapGetter = exports.ValueType = exports.createNoopMeter = exports.DiagLogLevel = exports.DiagConsoleLogger = exports.ROOT_CONTEXT = exports.createContextKey = exports.baggageEntryMetadataFromString = undefined; - var utils_1 = require_utils4(); + var utils_1 = require_utils3(); Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function() { return utils_1.baggageEntryMetadataFromString; } }); @@ -183382,7 +129069,7 @@ var require_src13 = __commonJS((exports) => { Object.defineProperty(exports, "TraceFlags", { enumerable: true, get: function() { return trace_flags_1.TraceFlags; } }); - var utils_2 = require_utils5(); + var utils_2 = require_utils4(); Object.defineProperty(exports, "createTraceState", { enumerable: true, get: function() { return utils_2.createTraceState; } }); @@ -183436,14 +129123,14 @@ var require_src13 = __commonJS((exports) => { }); // node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js -var require_utils6 = __commonJS((exports) => { +var require_utils5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createConstMap = undefined; - function createConstMap(values3) { + function createConstMap(values2) { let res = {}; - const len = values3.length; + const len = values2.length; for (let lp = 0;lp < len; lp++) { - const val = values3[lp]; + const val = values2[lp]; if (val) { res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val; } @@ -183462,7 +129149,7 @@ var require_SemanticAttributes = __commonJS((exports) => { exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = exports.FaasDocumentOperationValues = exports.FAASDOCUMENTOPERATIONVALUES_DELETE = exports.FAASDOCUMENTOPERATIONVALUES_EDIT = exports.FAASDOCUMENTOPERATIONVALUES_INSERT = exports.FaasTriggerValues = exports.FAASTRIGGERVALUES_OTHER = exports.FAASTRIGGERVALUES_TIMER = exports.FAASTRIGGERVALUES_PUBSUB = exports.FAASTRIGGERVALUES_HTTP = exports.FAASTRIGGERVALUES_DATASOURCE = exports.DbCassandraConsistencyLevelValues = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = exports.DbSystemValues = exports.DBSYSTEMVALUES_COCKROACHDB = exports.DBSYSTEMVALUES_MEMCACHED = exports.DBSYSTEMVALUES_ELASTICSEARCH = exports.DBSYSTEMVALUES_GEODE = exports.DBSYSTEMVALUES_NEO4J = exports.DBSYSTEMVALUES_DYNAMODB = exports.DBSYSTEMVALUES_COSMOSDB = exports.DBSYSTEMVALUES_COUCHDB = exports.DBSYSTEMVALUES_COUCHBASE = exports.DBSYSTEMVALUES_REDIS = exports.DBSYSTEMVALUES_MONGODB = exports.DBSYSTEMVALUES_HBASE = exports.DBSYSTEMVALUES_CASSANDRA = exports.DBSYSTEMVALUES_COLDFUSION = exports.DBSYSTEMVALUES_H2 = exports.DBSYSTEMVALUES_VERTICA = exports.DBSYSTEMVALUES_TERADATA = exports.DBSYSTEMVALUES_SYBASE = exports.DBSYSTEMVALUES_SQLITE = exports.DBSYSTEMVALUES_POINTBASE = exports.DBSYSTEMVALUES_PERVASIVE = exports.DBSYSTEMVALUES_NETEZZA = exports.DBSYSTEMVALUES_MARIADB = exports.DBSYSTEMVALUES_INTERBASE = exports.DBSYSTEMVALUES_INSTANTDB = exports.DBSYSTEMVALUES_INFORMIX = undefined; exports.MESSAGINGOPERATIONVALUES_RECEIVE = exports.MessagingDestinationKindValues = exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = exports.HttpFlavorValues = exports.HTTPFLAVORVALUES_QUIC = exports.HTTPFLAVORVALUES_SPDY = exports.HTTPFLAVORVALUES_HTTP_2_0 = exports.HTTPFLAVORVALUES_HTTP_1_1 = exports.HTTPFLAVORVALUES_HTTP_1_0 = exports.NetHostConnectionSubtypeValues = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = exports.NetHostConnectionTypeValues = exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = exports.NETHOSTCONNECTIONTYPEVALUES_CELL = exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = exports.NetTransportValues = exports.NETTRANSPORTVALUES_OTHER = exports.NETTRANSPORTVALUES_INPROC = exports.NETTRANSPORTVALUES_PIPE = exports.NETTRANSPORTVALUES_UNIX = exports.NETTRANSPORTVALUES_IP = exports.NETTRANSPORTVALUES_IP_UDP = exports.NETTRANSPORTVALUES_IP_TCP = exports.FaasInvokedProviderValues = exports.FAASINVOKEDPROVIDERVALUES_GCP = exports.FAASINVOKEDPROVIDERVALUES_AZURE = exports.FAASINVOKEDPROVIDERVALUES_AWS = undefined; exports.MessageTypeValues = exports.MESSAGETYPEVALUES_RECEIVED = exports.MESSAGETYPEVALUES_SENT = exports.RpcGrpcStatusCodeValues = exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = exports.RPCGRPCSTATUSCODEVALUES_ABORTED = exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = exports.RPCGRPCSTATUSCODEVALUES_OK = exports.MessagingOperationValues = exports.MESSAGINGOPERATIONVALUES_PROCESS = undefined; - var utils_1 = require_utils6(); + var utils_1 = require_utils5(); var TMP_AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"; var TMP_DB_SYSTEM = "db.system"; var TMP_DB_CONNECTION_STRING = "db.connection_string"; @@ -184298,7 +129985,7 @@ var require_SemanticResourceAttributes = __commonJS((exports) => { exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = undefined; exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = exports.CLOUDPLATFORMVALUES_AZURE_AKS = exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = exports.CLOUDPLATFORMVALUES_AZURE_VM = exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = exports.CLOUDPLATFORMVALUES_AWS_EKS = exports.CLOUDPLATFORMVALUES_AWS_ECS = exports.CLOUDPLATFORMVALUES_AWS_EC2 = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = exports.CloudProviderValues = exports.CLOUDPROVIDERVALUES_GCP = exports.CLOUDPROVIDERVALUES_AZURE = exports.CLOUDPROVIDERVALUES_AWS = exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = exports.SemanticResourceAttributes = exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = exports.SEMRESATTRS_WEBENGINE_VERSION = exports.SEMRESATTRS_WEBENGINE_NAME = exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = exports.SEMRESATTRS_TELEMETRY_SDK_NAME = exports.SEMRESATTRS_SERVICE_VERSION = exports.SEMRESATTRS_SERVICE_INSTANCE_ID = exports.SEMRESATTRS_SERVICE_NAMESPACE = exports.SEMRESATTRS_SERVICE_NAME = exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = exports.SEMRESATTRS_PROCESS_OWNER = exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = exports.SEMRESATTRS_PROCESS_COMMAND_LINE = exports.SEMRESATTRS_PROCESS_COMMAND = exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = exports.SEMRESATTRS_PROCESS_PID = exports.SEMRESATTRS_OS_VERSION = exports.SEMRESATTRS_OS_NAME = exports.SEMRESATTRS_OS_DESCRIPTION = exports.SEMRESATTRS_OS_TYPE = exports.SEMRESATTRS_K8S_CRONJOB_NAME = exports.SEMRESATTRS_K8S_CRONJOB_UID = exports.SEMRESATTRS_K8S_JOB_NAME = exports.SEMRESATTRS_K8S_JOB_UID = exports.SEMRESATTRS_K8S_DAEMONSET_NAME = exports.SEMRESATTRS_K8S_DAEMONSET_UID = undefined; exports.TelemetrySdkLanguageValues = exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = exports.TELEMETRYSDKLANGUAGEVALUES_PHP = exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = exports.TELEMETRYSDKLANGUAGEVALUES_GO = exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = exports.TELEMETRYSDKLANGUAGEVALUES_CPP = exports.OsTypeValues = exports.OSTYPEVALUES_Z_OS = exports.OSTYPEVALUES_SOLARIS = exports.OSTYPEVALUES_AIX = exports.OSTYPEVALUES_HPUX = exports.OSTYPEVALUES_DRAGONFLYBSD = exports.OSTYPEVALUES_OPENBSD = exports.OSTYPEVALUES_NETBSD = exports.OSTYPEVALUES_FREEBSD = exports.OSTYPEVALUES_DARWIN = exports.OSTYPEVALUES_LINUX = exports.OSTYPEVALUES_WINDOWS = exports.HostArchValues = exports.HOSTARCHVALUES_X86 = exports.HOSTARCHVALUES_PPC64 = exports.HOSTARCHVALUES_PPC32 = exports.HOSTARCHVALUES_IA64 = exports.HOSTARCHVALUES_ARM64 = exports.HOSTARCHVALUES_ARM32 = exports.HOSTARCHVALUES_AMD64 = exports.AwsEcsLaunchtypeValues = exports.AWSECSLAUNCHTYPEVALUES_FARGATE = exports.AWSECSLAUNCHTYPEVALUES_EC2 = exports.CloudPlatformValues = exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = undefined; - var utils_1 = require_utils6(); + var utils_1 = require_utils5(); var TMP_CLOUD_PROVIDER = "cloud.provider"; var TMP_CLOUD_ACCOUNT_ID = "cloud.account.id"; var TMP_CLOUD_REGION = "cloud.region"; @@ -184891,7 +130578,7 @@ var require_stable_metrics = __commonJS((exports) => { }); // node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/index.js -var require_src14 = __commonJS((exports) => { +var require_src8 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -184919,7 +130606,7 @@ var require_src14 = __commonJS((exports) => { var require_suppress_tracing = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); function suppressTracing(context) { return context.setValue(SUPPRESS_TRACING_KEY, true); @@ -184936,7 +130623,7 @@ var require_suppress_tracing = __commonJS((exports) => { }); // node_modules/@opentelemetry/core/build/src/baggage/constants.js -var require_constants7 = __commonJS((exports) => { +var require_constants6 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = undefined; exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; @@ -184949,11 +130636,11 @@ var require_constants7 = __commonJS((exports) => { }); // node_modules/@opentelemetry/core/build/src/baggage/utils.js -var require_utils7 = __commonJS((exports) => { +var require_utils6 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = undefined; - var api_1 = require_src13(); - var constants_1 = require_constants7(); + var api_1 = require_src7(); + var constants_1 = require_constants6(); function serializeKeyPairs(keyPairs) { return keyPairs.reduce((hValue, current) => { const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; @@ -185007,10 +130694,10 @@ var require_utils7 = __commonJS((exports) => { var require_W3CBaggagePropagator = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.W3CBaggagePropagator = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var suppress_tracing_1 = require_suppress_tracing(); - var constants_1 = require_constants7(); - var utils_1 = require_utils7(); + var constants_1 = require_constants6(); + var utils_1 = require_utils6(); class W3CBaggagePropagator { inject(context, carrier, setter) { @@ -185080,7 +130767,7 @@ var require_anchored_clock = __commonJS((exports) => { var require_attributes = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); function sanitizeAttributes(attributes) { const out = {}; if (typeof attributes !== "object" || attributes == null) { @@ -185152,7 +130839,7 @@ var require_attributes = __commonJS((exports) => { var require_logging_error_handler = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.loggingErrorHandler = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); function loggingErrorHandler() { return (ex) => { api_1.diag.error(stringifyException(ex)); @@ -185190,14 +130877,14 @@ var require_global_error_handler = __commonJS((exports) => { exports.globalErrorHandler = exports.setGlobalErrorHandler = undefined; var logging_error_handler_1 = require_logging_error_handler(); var delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); - function setGlobalErrorHandler(handler2) { - delegateHandler = handler2; + function setGlobalErrorHandler(handler8) { + delegateHandler = handler8; } exports.setGlobalErrorHandler = setGlobalErrorHandler; function globalErrorHandler(ex) { try { delegateHandler(ex); - } catch (_a3) {} + } catch (_a2) {} } exports.globalErrorHandler = globalErrorHandler; }); @@ -185221,7 +130908,7 @@ var require_sampling = __commonJS((exports) => { var require_environment = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var sampling_1 = require_sampling(); var DEFAULT_LIST_SEPARATOR = ","; var ENVIRONMENT_BOOLEAN_KEYS = ["OTEL_SDK_DISABLED"]; @@ -185348,16 +131035,16 @@ var require_environment = __commonJS((exports) => { OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: "cumulative", OTEL_SEMCONV_STABILITY_OPT_IN: [] }; - function parseBoolean(key, environment, values3) { - if (typeof values3[key] === "undefined") { + function parseBoolean(key, environment, values2) { + if (typeof values2[key] === "undefined") { return; } - const value = String(values3[key]); + const value = String(values2[key]); environment[key] = value.toLowerCase() === "true"; } - function parseNumber2(name, environment, values3, min2 = -Infinity, max2 = Infinity) { - if (typeof values3[name] !== "undefined") { - const value = Number(values3[name]); + function parseNumber2(name, environment, values2, min2 = -Infinity, max2 = Infinity) { + if (typeof values2[name] !== "undefined") { + const value = Number(values2[name]); if (!isNaN(value)) { if (value < min2) { environment[name] = min2; @@ -185369,8 +131056,8 @@ var require_environment = __commonJS((exports) => { } } } - function parseStringList(name, output, input2, separator = DEFAULT_LIST_SEPARATOR) { - const givenValue = input2[name]; + function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { + const givenValue = input[name]; if (typeof givenValue === "string") { output[name] = givenValue.split(separator).map((v) => v.trim()); } @@ -185384,8 +131071,8 @@ var require_environment = __commonJS((exports) => { ERROR: api_1.DiagLogLevel.ERROR, NONE: api_1.DiagLogLevel.NONE }; - function setLogLevelFromEnv(key, environment, values3) { - const value = values3[key]; + function setLogLevelFromEnv(key, environment, values2) { + const value = values2[key]; if (typeof value === "string") { const theLevel = logLevelMap[value.toUpperCase()]; if (theLevel != null) { @@ -185393,23 +131080,23 @@ var require_environment = __commonJS((exports) => { } } } - function parseEnvironment(values3) { + function parseEnvironment(values2) { const environment = {}; - for (const env5 in exports.DEFAULT_ENVIRONMENT) { - const key = env5; + for (const env4 in exports.DEFAULT_ENVIRONMENT) { + const key = env4; switch (key) { case "OTEL_LOG_LEVEL": - setLogLevelFromEnv(key, environment, values3); + setLogLevelFromEnv(key, environment, values2); break; default: if (isEnvVarABoolean(key)) { - parseBoolean(key, environment, values3); + parseBoolean(key, environment, values2); } else if (isEnvVarANumber(key)) { - parseNumber2(key, environment, values3); + parseNumber2(key, environment, values2); } else if (isEnvVarAList(key)) { - parseStringList(key, environment, values3); + parseStringList(key, environment, values2); } else { - const value = values3[key]; + const value = values2[key]; if (typeof value !== "undefined" && value !== null) { environment[key] = String(value); } @@ -185522,21 +131209,21 @@ var require_performance = __commonJS((exports) => { }); // node_modules/@opentelemetry/core/build/src/version.js -var require_version4 = __commonJS((exports) => { +var require_version3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.VERSION = undefined; exports.VERSION = "1.30.1"; }); // node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js -var require_utils8 = __commonJS((exports) => { +var require_utils7 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createConstMap = undefined; - function createConstMap(values3) { + function createConstMap(values2) { let res = {}; - const len = values3.length; + const len = values2.length; for (let lp = 0;lp < len; lp++) { - const val = values3[lp]; + const val = values2[lp]; if (val) { res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val; } @@ -185555,7 +131242,7 @@ var require_SemanticAttributes2 = __commonJS((exports) => { exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = exports.FaasDocumentOperationValues = exports.FAASDOCUMENTOPERATIONVALUES_DELETE = exports.FAASDOCUMENTOPERATIONVALUES_EDIT = exports.FAASDOCUMENTOPERATIONVALUES_INSERT = exports.FaasTriggerValues = exports.FAASTRIGGERVALUES_OTHER = exports.FAASTRIGGERVALUES_TIMER = exports.FAASTRIGGERVALUES_PUBSUB = exports.FAASTRIGGERVALUES_HTTP = exports.FAASTRIGGERVALUES_DATASOURCE = exports.DbCassandraConsistencyLevelValues = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = exports.DbSystemValues = exports.DBSYSTEMVALUES_COCKROACHDB = exports.DBSYSTEMVALUES_MEMCACHED = exports.DBSYSTEMVALUES_ELASTICSEARCH = exports.DBSYSTEMVALUES_GEODE = exports.DBSYSTEMVALUES_NEO4J = exports.DBSYSTEMVALUES_DYNAMODB = exports.DBSYSTEMVALUES_COSMOSDB = exports.DBSYSTEMVALUES_COUCHDB = exports.DBSYSTEMVALUES_COUCHBASE = exports.DBSYSTEMVALUES_REDIS = exports.DBSYSTEMVALUES_MONGODB = exports.DBSYSTEMVALUES_HBASE = exports.DBSYSTEMVALUES_CASSANDRA = exports.DBSYSTEMVALUES_COLDFUSION = exports.DBSYSTEMVALUES_H2 = exports.DBSYSTEMVALUES_VERTICA = exports.DBSYSTEMVALUES_TERADATA = exports.DBSYSTEMVALUES_SYBASE = exports.DBSYSTEMVALUES_SQLITE = exports.DBSYSTEMVALUES_POINTBASE = exports.DBSYSTEMVALUES_PERVASIVE = exports.DBSYSTEMVALUES_NETEZZA = exports.DBSYSTEMVALUES_MARIADB = exports.DBSYSTEMVALUES_INTERBASE = exports.DBSYSTEMVALUES_INSTANTDB = exports.DBSYSTEMVALUES_INFORMIX = undefined; exports.MESSAGINGOPERATIONVALUES_RECEIVE = exports.MessagingDestinationKindValues = exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = exports.HttpFlavorValues = exports.HTTPFLAVORVALUES_QUIC = exports.HTTPFLAVORVALUES_SPDY = exports.HTTPFLAVORVALUES_HTTP_2_0 = exports.HTTPFLAVORVALUES_HTTP_1_1 = exports.HTTPFLAVORVALUES_HTTP_1_0 = exports.NetHostConnectionSubtypeValues = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = exports.NetHostConnectionTypeValues = exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = exports.NETHOSTCONNECTIONTYPEVALUES_CELL = exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = exports.NetTransportValues = exports.NETTRANSPORTVALUES_OTHER = exports.NETTRANSPORTVALUES_INPROC = exports.NETTRANSPORTVALUES_PIPE = exports.NETTRANSPORTVALUES_UNIX = exports.NETTRANSPORTVALUES_IP = exports.NETTRANSPORTVALUES_IP_UDP = exports.NETTRANSPORTVALUES_IP_TCP = exports.FaasInvokedProviderValues = exports.FAASINVOKEDPROVIDERVALUES_GCP = exports.FAASINVOKEDPROVIDERVALUES_AZURE = exports.FAASINVOKEDPROVIDERVALUES_AWS = undefined; exports.MessageTypeValues = exports.MESSAGETYPEVALUES_RECEIVED = exports.MESSAGETYPEVALUES_SENT = exports.RpcGrpcStatusCodeValues = exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = exports.RPCGRPCSTATUSCODEVALUES_ABORTED = exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = exports.RPCGRPCSTATUSCODEVALUES_OK = exports.MessagingOperationValues = exports.MESSAGINGOPERATIONVALUES_PROCESS = undefined; - var utils_1 = require_utils8(); + var utils_1 = require_utils7(); var TMP_AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"; var TMP_DB_SYSTEM = "db.system"; var TMP_DB_CONNECTION_STRING = "db.connection_string"; @@ -186391,7 +132078,7 @@ var require_SemanticResourceAttributes2 = __commonJS((exports) => { exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = undefined; exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = exports.CLOUDPLATFORMVALUES_AZURE_AKS = exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = exports.CLOUDPLATFORMVALUES_AZURE_VM = exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = exports.CLOUDPLATFORMVALUES_AWS_EKS = exports.CLOUDPLATFORMVALUES_AWS_ECS = exports.CLOUDPLATFORMVALUES_AWS_EC2 = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = exports.CloudProviderValues = exports.CLOUDPROVIDERVALUES_GCP = exports.CLOUDPROVIDERVALUES_AZURE = exports.CLOUDPROVIDERVALUES_AWS = exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = exports.SemanticResourceAttributes = exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = exports.SEMRESATTRS_WEBENGINE_VERSION = exports.SEMRESATTRS_WEBENGINE_NAME = exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = exports.SEMRESATTRS_TELEMETRY_SDK_NAME = exports.SEMRESATTRS_SERVICE_VERSION = exports.SEMRESATTRS_SERVICE_INSTANCE_ID = exports.SEMRESATTRS_SERVICE_NAMESPACE = exports.SEMRESATTRS_SERVICE_NAME = exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = exports.SEMRESATTRS_PROCESS_OWNER = exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = exports.SEMRESATTRS_PROCESS_COMMAND_LINE = exports.SEMRESATTRS_PROCESS_COMMAND = exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = exports.SEMRESATTRS_PROCESS_PID = exports.SEMRESATTRS_OS_VERSION = exports.SEMRESATTRS_OS_NAME = exports.SEMRESATTRS_OS_DESCRIPTION = exports.SEMRESATTRS_OS_TYPE = exports.SEMRESATTRS_K8S_CRONJOB_NAME = exports.SEMRESATTRS_K8S_CRONJOB_UID = exports.SEMRESATTRS_K8S_JOB_NAME = exports.SEMRESATTRS_K8S_JOB_UID = exports.SEMRESATTRS_K8S_DAEMONSET_NAME = exports.SEMRESATTRS_K8S_DAEMONSET_UID = undefined; exports.TelemetrySdkLanguageValues = exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = exports.TELEMETRYSDKLANGUAGEVALUES_PHP = exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = exports.TELEMETRYSDKLANGUAGEVALUES_GO = exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = exports.TELEMETRYSDKLANGUAGEVALUES_CPP = exports.OsTypeValues = exports.OSTYPEVALUES_Z_OS = exports.OSTYPEVALUES_SOLARIS = exports.OSTYPEVALUES_AIX = exports.OSTYPEVALUES_HPUX = exports.OSTYPEVALUES_DRAGONFLYBSD = exports.OSTYPEVALUES_OPENBSD = exports.OSTYPEVALUES_NETBSD = exports.OSTYPEVALUES_FREEBSD = exports.OSTYPEVALUES_DARWIN = exports.OSTYPEVALUES_LINUX = exports.OSTYPEVALUES_WINDOWS = exports.HostArchValues = exports.HOSTARCHVALUES_X86 = exports.HOSTARCHVALUES_PPC64 = exports.HOSTARCHVALUES_PPC32 = exports.HOSTARCHVALUES_IA64 = exports.HOSTARCHVALUES_ARM64 = exports.HOSTARCHVALUES_ARM32 = exports.HOSTARCHVALUES_AMD64 = exports.AwsEcsLaunchtypeValues = exports.AWSECSLAUNCHTYPEVALUES_FARGATE = exports.AWSECSLAUNCHTYPEVALUES_EC2 = exports.CloudPlatformValues = exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = undefined; - var utils_1 = require_utils8(); + var utils_1 = require_utils7(); var TMP_CLOUD_PROVIDER = "cloud.provider"; var TMP_CLOUD_ACCOUNT_ID = "cloud.account.id"; var TMP_CLOUD_REGION = "cloud.region"; @@ -186984,7 +132671,7 @@ var require_stable_metrics2 = __commonJS((exports) => { }); // node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/index.js -var require_src15 = __commonJS((exports) => { +var require_src9 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -187012,8 +132699,8 @@ var require_src15 = __commonJS((exports) => { var require_sdk_info = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.SDK_INFO = undefined; - var version_1 = require_version4(); - var semantic_conventions_1 = require_src15(); + var version_1 = require_version3(); + var semantic_conventions_1 = require_src9(); exports.SDK_INFO = { [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: "opentelemetry", [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: "node", @@ -187033,7 +132720,7 @@ var require_timer_util = __commonJS((exports) => { }); // node_modules/@opentelemetry/core/build/src/platform/node/index.js -var require_node3 = __commonJS((exports) => { +var require_node2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = undefined; var environment_1 = require_environment2(); @@ -187073,7 +132760,7 @@ var require_node3 = __commonJS((exports) => { var require_platform = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = undefined; - var node_1 = require_node3(); + var node_1 = require_node2(); Object.defineProperty(exports, "RandomIdGenerator", { enumerable: true, get: function() { return node_1.RandomIdGenerator; } }); @@ -187211,12 +132898,12 @@ var require_ExportResult = __commonJS((exports) => { var require_composite = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.CompositePropagator = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); class CompositePropagator { constructor(config2 = {}) { - var _a3; - this._propagators = (_a3 = config2.propagators) !== null && _a3 !== undefined ? _a3 : []; + var _a2; + this._propagators = (_a2 = config2.propagators) !== null && _a2 !== undefined ? _a2 : []; this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x2, y2) => x2.concat(y2), []))); } inject(context, carrier, setter) { @@ -187338,12 +133025,12 @@ var require_TraceState = __commonJS((exports) => { var require_W3CTraceContextPropagator = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var suppress_tracing_1 = require_suppress_tracing(); var TraceState_1 = require_TraceState(); exports.TRACE_PARENT_HEADER = "traceparent"; exports.TRACE_STATE_HEADER = "tracestate"; - var VERSION6 = "00"; + var VERSION5 = "00"; var VERSION_PART = "(?!ff)[\\da-f]{2}"; var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; @@ -187368,7 +133055,7 @@ var require_W3CTraceContextPropagator = __commonJS((exports) => { const spanContext = api_1.trace.getSpanContext(context); if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context) || !(0, api_1.isSpanContextValid)(spanContext)) return; - const traceParent = `${VERSION6}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + const traceParent = `${VERSION5}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); if (spanContext.traceState) { setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); @@ -187403,7 +133090,7 @@ var require_W3CTraceContextPropagator = __commonJS((exports) => { var require_rpc_metadata = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var RPC_METADATA_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); var RPCType; (function(RPCType2) { @@ -187427,7 +133114,7 @@ var require_rpc_metadata = __commonJS((exports) => { var require_AlwaysOffSampler = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AlwaysOffSampler = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); class AlwaysOffSampler { shouldSample() { @@ -187446,7 +133133,7 @@ var require_AlwaysOffSampler = __commonJS((exports) => { var require_AlwaysOnSampler = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AlwaysOnSampler = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); class AlwaysOnSampler { shouldSample() { @@ -187465,20 +133152,20 @@ var require_AlwaysOnSampler = __commonJS((exports) => { var require_ParentBasedSampler = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ParentBasedSampler = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var global_error_handler_1 = require_global_error_handler(); var AlwaysOffSampler_1 = require_AlwaysOffSampler(); var AlwaysOnSampler_1 = require_AlwaysOnSampler(); class ParentBasedSampler { constructor(config2) { - var _a3, _b, _c, _d; + var _a2, _b, _c, _d; this._root = config2.root; if (!this._root) { (0, global_error_handler_1.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")); this._root = new AlwaysOnSampler_1.AlwaysOnSampler; } - this._remoteParentSampled = (_a3 = config2.remoteParentSampled) !== null && _a3 !== undefined ? _a3 : new AlwaysOnSampler_1.AlwaysOnSampler; + this._remoteParentSampled = (_a2 = config2.remoteParentSampled) !== null && _a2 !== undefined ? _a2 : new AlwaysOnSampler_1.AlwaysOnSampler; this._remoteParentNotSampled = (_b = config2.remoteParentNotSampled) !== null && _b !== undefined ? _b : new AlwaysOffSampler_1.AlwaysOffSampler; this._localParentSampled = (_c = config2.localParentSampled) !== null && _c !== undefined ? _c : new AlwaysOnSampler_1.AlwaysOnSampler; this._localParentNotSampled = (_d = config2.localParentNotSampled) !== null && _d !== undefined ? _d : new AlwaysOffSampler_1.AlwaysOffSampler; @@ -187510,7 +133197,7 @@ var require_ParentBasedSampler = __commonJS((exports) => { var require_TraceIdRatioBasedSampler = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.TraceIdRatioBasedSampler = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); class TraceIdRatioBasedSampler { constructor(_ratio = 0) { @@ -187623,7 +133310,7 @@ var require_merge = __commonJS((exports) => { } exports.merge = merge4; function takeValue(value) { - if (isArray8(value)) { + if (isArray4(value)) { return value.slice(); } return value; @@ -187636,9 +133323,9 @@ var require_merge = __commonJS((exports) => { level++; if (isPrimitive(one) || isPrimitive(two) || isFunction4(two)) { result2 = takeValue(two); - } else if (isArray8(one)) { + } else if (isArray4(one)) { result2 = one.slice(); - if (isArray8(two)) { + if (isArray4(two)) { for (let i2 = 0, j = two.length;i2 < j; i2++) { result2.push(takeValue(two[i2])); } @@ -187699,14 +133386,14 @@ var require_merge = __commonJS((exports) => { } return false; } - function isArray8(value) { + function isArray4(value) { return Array.isArray(value); } function isFunction4(value) { return typeof value === "function"; } function isObject5(value) { - return !isPrimitive(value) && !isArray8(value) && !isFunction4(value) && typeof value === "object"; + return !isPrimitive(value) && !isArray4(value) && !isFunction4(value) && typeof value === "object"; } function isPrimitive(value) { return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; @@ -187848,7 +133535,7 @@ var require_callback = __commonJS((exports) => { var require_exporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports._export = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var suppress_tracing_1 = require_suppress_tracing(); function _export(exporter, arg) { return new Promise((resolve8) => { @@ -187863,7 +133550,7 @@ var require_exporter = __commonJS((exports) => { }); // node_modules/@opentelemetry/core/build/src/index.js -var require_src16 = __commonJS((exports) => { +var require_src10 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined; exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = undefined; @@ -187941,7 +133628,7 @@ var require_src16 = __commonJS((exports) => { Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { return ExportResult_1.ExportResultCode; } }); - var utils_1 = require_utils7(); + var utils_1 = require_utils6(); exports.baggageUtils = { getKeyPairs: utils_1.getKeyPairs, serializeKeyPairs: utils_1.serializeKeyPairs, @@ -188082,7 +133769,7 @@ var require_src16 = __commonJS((exports) => { Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { return callback_1.BindOnceFuture; } }); - var version_1 = require_version4(); + var version_1 = require_version3(); Object.defineProperty(exports, "VERSION", { enumerable: true, get: function() { return version_1.VERSION; } }); @@ -188103,7 +133790,7 @@ var require_default_service_name = __commonJS((exports) => { }); // node_modules/@opentelemetry/resources/build/src/platform/node/index.js -var require_node4 = __commonJS((exports) => { +var require_node3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultServiceName = undefined; var default_service_name_1 = require_default_service_name(); @@ -188116,7 +133803,7 @@ var require_node4 = __commonJS((exports) => { var require_platform2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultServiceName = undefined; - var node_1 = require_node4(); + var node_1 = require_node3(); Object.defineProperty(exports, "defaultServiceName", { enumerable: true, get: function() { return node_1.defaultServiceName; } }); @@ -188126,17 +133813,17 @@ var require_platform2 = __commonJS((exports) => { var require_Resource = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Resource = undefined; - var api_1 = require_src13(); - var semantic_conventions_1 = require_src14(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var semantic_conventions_1 = require_src8(); + var core_1 = require_src10(); var platform_1 = require_platform2(); class Resource { constructor(attributes, asyncAttributesPromise) { - var _a3; + var _a2; this._attributes = attributes; this.asyncAttributesPending = asyncAttributesPromise != null; - this._syncAttributes = (_a3 = this._attributes) !== null && _a3 !== undefined ? _a3 : {}; + this._syncAttributes = (_a2 = this._attributes) !== null && _a2 !== undefined ? _a2 : {}; this._asyncAttributesPromise = asyncAttributesPromise === null || asyncAttributesPromise === undefined ? undefined : asyncAttributesPromise.then((asyncAttributes) => { this._attributes = Object.assign({}, this._attributes, asyncAttributes); this.asyncAttributesPending = false; @@ -188159,11 +133846,11 @@ var require_Resource = __commonJS((exports) => { }); } get attributes() { - var _a3; + var _a2; if (this.asyncAttributesPending) { api_1.diag.error("Accessing resource attributes before async attributes settled"); } - return (_a3 = this._attributes) !== null && _a3 !== undefined ? _a3 : {}; + return (_a2 = this._attributes) !== null && _a2 !== undefined ? _a2 : {}; } async waitForAsyncAttributes() { if (this.asyncAttributesPending) { @@ -188171,10 +133858,10 @@ var require_Resource = __commonJS((exports) => { } } merge(other) { - var _a3; + var _a2; if (!other) return this; - const mergedSyncAttributes = Object.assign(Object.assign({}, this._syncAttributes), (_a3 = other._syncAttributes) !== null && _a3 !== undefined ? _a3 : other.attributes); + const mergedSyncAttributes = Object.assign(Object.assign({}, this._syncAttributes), (_a2 = other._syncAttributes) !== null && _a2 !== undefined ? _a2 : other.attributes); if (!this._asyncAttributesPromise && !other._asyncAttributesPromise) { return new Resource(mergedSyncAttributes); } @@ -188182,8 +133869,8 @@ var require_Resource = __commonJS((exports) => { this._asyncAttributesPromise, other._asyncAttributesPromise ]).then(([thisAsyncAttributes, otherAsyncAttributes]) => { - var _a4; - return Object.assign(Object.assign(Object.assign(Object.assign({}, this._syncAttributes), thisAsyncAttributes), (_a4 = other._syncAttributes) !== null && _a4 !== undefined ? _a4 : other.attributes), otherAsyncAttributes); + var _a3; + return Object.assign(Object.assign(Object.assign(Object.assign({}, this._syncAttributes), thisAsyncAttributes), (_a3 = other._syncAttributes) !== null && _a3 !== undefined ? _a3 : other.attributes), otherAsyncAttributes); }); return new Resource(mergedSyncAttributes, mergedAttributesPromise); } @@ -188193,10 +133880,10 @@ var require_Resource = __commonJS((exports) => { }); // node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js -var require_utils9 = __commonJS((exports) => { +var require_utils8 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeType = exports.normalizeArch = undefined; - var normalizeArch3 = (nodeArchString) => { + var normalizeArch2 = (nodeArchString) => { switch (nodeArchString) { case "arm": return "arm32"; @@ -188208,7 +133895,7 @@ var require_utils9 = __commonJS((exports) => { return nodeArchString; } }; - exports.normalizeArch = normalizeArch3; + exports.normalizeArch = normalizeArch2; var normalizeType = (nodePlatform) => { switch (nodePlatform) { case "sunos": @@ -188236,7 +133923,7 @@ var require_getMachineId_darwin = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getMachineId = undefined; var execAsync_1 = require_execAsync(); - var api_1 = require_src13(); + var api_1 = require_src7(); async function getMachineId() { try { const result2 = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"'); @@ -188262,12 +133949,12 @@ var require_getMachineId_linux = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getMachineId = undefined; var fs_1 = __require("fs"); - var api_1 = require_src13(); + var api_1 = require_src7(); async function getMachineId() { const paths2 = ["/etc/machine-id", "/var/lib/dbus/machine-id"]; - for (const path11 of paths2) { + for (const path9 of paths2) { try { - const result2 = await fs_1.promises.readFile(path11, { encoding: "utf8" }); + const result2 = await fs_1.promises.readFile(path9, { encoding: "utf8" }); return result2.trim(); } catch (e) { api_1.diag.debug(`error reading machine id: ${e}`); @@ -188284,7 +133971,7 @@ var require_getMachineId_bsd = __commonJS((exports) => { exports.getMachineId = undefined; var fs_1 = __require("fs"); var execAsync_1 = require_execAsync(); - var api_1 = require_src13(); + var api_1 = require_src7(); async function getMachineId() { try { const result2 = await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" }); @@ -188309,7 +133996,7 @@ var require_getMachineId_win = __commonJS((exports) => { exports.getMachineId = undefined; var process12 = __require("process"); var execAsync_1 = require_execAsync(); - var api_1 = require_src13(); + var api_1 = require_src7(); async function getMachineId() { const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; let command = "%windir%\\System32\\REG.exe"; @@ -188334,7 +134021,7 @@ var require_getMachineId_win = __commonJS((exports) => { var require_getMachineId_unsupported = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getMachineId = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); async function getMachineId() { api_1.diag.debug("could not read machine-id: unsupported platform"); return ""; @@ -188371,10 +134058,10 @@ var require_getMachineId = __commonJS((exports) => { var require_HostDetectorSync = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.hostDetectorSync = undefined; - var semantic_conventions_1 = require_src14(); + var semantic_conventions_1 = require_src8(); var Resource_1 = require_Resource(); var os_1 = __require("os"); - var utils_1 = require_utils9(); + var utils_1 = require_utils8(); var getMachineId_1 = require_getMachineId(); class HostDetectorSync { @@ -188416,10 +134103,10 @@ var require_HostDetector = __commonJS((exports) => { var require_OSDetectorSync = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.osDetectorSync = undefined; - var semantic_conventions_1 = require_src14(); + var semantic_conventions_1 = require_src8(); var Resource_1 = require_Resource(); var os_1 = __require("os"); - var utils_1 = require_utils9(); + var utils_1 = require_utils8(); class OSDetectorSync { detect(_config) { @@ -188451,8 +134138,8 @@ var require_OSDetector = __commonJS((exports) => { var require_ProcessDetectorSync = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.processDetectorSync = undefined; - var api_1 = require_src13(); - var semantic_conventions_1 = require_src14(); + var api_1 = require_src7(); + var semantic_conventions_1 = require_src8(); var Resource_1 = require_Resource(); var os3 = __require("os"); @@ -188504,7 +134191,7 @@ var require_ProcessDetector = __commonJS((exports) => { var require_ServiceInstanceIdDetectorSync = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.serviceInstanceIdDetectorSync = undefined; - var semantic_conventions_1 = require_src14(); + var semantic_conventions_1 = require_src8(); var Resource_1 = require_Resource(); var crypto_1 = __require("crypto"); @@ -188520,7 +134207,7 @@ var require_ServiceInstanceIdDetectorSync = __commonJS((exports) => { }); // node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js -var require_node5 = __commonJS((exports) => { +var require_node4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = undefined; var HostDetector_1 = require_HostDetector(); @@ -188557,7 +134244,7 @@ var require_node5 = __commonJS((exports) => { var require_platform3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = undefined; - var node_1 = require_node5(); + var node_1 = require_node4(); Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { return node_1.hostDetector; } }); @@ -188585,14 +134272,14 @@ var require_platform3 = __commonJS((exports) => { var require_BrowserDetectorSync = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.browserDetectorSync = undefined; - var semantic_conventions_1 = require_src14(); - var api_1 = require_src13(); + var semantic_conventions_1 = require_src8(); + var api_1 = require_src7(); var Resource_1 = require_Resource(); class BrowserDetectorSync { detect(config2) { - var _a3, _b, _c; - const isBrowser2 = typeof navigator !== "undefined" && ((_b = (_a3 = global.process) === null || _a3 === undefined ? undefined : _a3.versions) === null || _b === undefined ? undefined : _b.node) === undefined && ((_c = global.Bun) === null || _c === undefined ? undefined : _c.version) === undefined; + var _a2, _b, _c; + const isBrowser2 = typeof navigator !== "undefined" && ((_b = (_a2 = global.process) === null || _a2 === undefined ? undefined : _a2.versions) === null || _b === undefined ? undefined : _b.node) === undefined && ((_c = global.Bun) === null || _c === undefined ? undefined : _c.version) === undefined; if (!isBrowser2) { return Resource_1.Resource.empty(); } @@ -188633,9 +134320,9 @@ var require_BrowserDetector = __commonJS((exports) => { var require_EnvDetectorSync = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.envDetectorSync = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); - var semantic_conventions_1 = require_src14(); + var api_1 = require_src7(); + var core_1 = require_src10(); + var semantic_conventions_1 = require_src8(); var Resource_1 = require_Resource(); class EnvDetectorSync { @@ -188648,9 +134335,9 @@ var require_EnvDetectorSync = __commonJS((exports) => { } detect(_config) { const attributes = {}; - const env5 = (0, core_1.getEnv)(); - const rawAttributes = env5.OTEL_RESOURCE_ATTRIBUTES; - const serviceName = env5.OTEL_SERVICE_NAME; + const env4 = (0, core_1.getEnv)(); + const rawAttributes = env4.OTEL_RESOURCE_ATTRIBUTES; + const serviceName = env4.OTEL_SERVICE_NAME; if (rawAttributes) { try { const parsedAttributes = this._parseResourceAttributes(rawAttributes); @@ -188765,7 +134452,7 @@ var require_detectors = __commonJS((exports) => { }); // node_modules/@opentelemetry/resources/build/src/utils.js -var require_utils10 = __commonJS((exports) => { +var require_utils9 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isPromiseLike = undefined; var isPromiseLike = (val) => { @@ -188779,8 +134466,8 @@ var require_detect_resources = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.detectResourcesSync = exports.detectResources = undefined; var Resource_1 = require_Resource(); - var api_1 = require_src13(); - var utils_1 = require_utils10(); + var api_1 = require_src7(); + var utils_1 = require_utils9(); var detectResources = async (config2 = {}) => { const resources = await Promise.all((config2.detectors || []).map(async (d) => { try { @@ -188797,16 +134484,16 @@ var require_detect_resources = __commonJS((exports) => { }; exports.detectResources = detectResources; var detectResourcesSync = (config2 = {}) => { - var _a3; - const resources = ((_a3 = config2.detectors) !== null && _a3 !== undefined ? _a3 : []).map((d) => { + var _a2; + const resources = ((_a2 = config2.detectors) !== null && _a2 !== undefined ? _a2 : []).map((d) => { try { const resourceOrPromise = d.detect(config2); let resource; if ((0, utils_1.isPromiseLike)(resourceOrPromise)) { const createPromise = async () => { - var _a4; + var _a3; const resolvedResource = await resourceOrPromise; - await ((_a4 = resolvedResource.waitForAsyncAttributes) === null || _a4 === undefined ? undefined : _a4.call(resolvedResource)); + await ((_a3 = resolvedResource.waitForAsyncAttributes) === null || _a3 === undefined ? undefined : _a3.call(resolvedResource)); return resolvedResource.attributes; }; resource = new Resource_1.Resource({}, createPromise()); @@ -188844,7 +134531,7 @@ var require_detect_resources = __commonJS((exports) => { }); // node_modules/@opentelemetry/resources/build/src/index.js -var require_src17 = __commonJS((exports) => { +var require_src11 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.detectResources = exports.detectResourcesSync = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = exports.envDetectorSync = exports.envDetector = exports.browserDetectorSync = exports.browserDetector = exports.defaultServiceName = exports.Resource = undefined; var Resource_1 = require_Resource(); @@ -188999,19 +134686,19 @@ var require_ProxyLoggerProvider = __commonJS((exports) => { class ProxyLoggerProvider { getLogger(name, version2, options) { - var _a3; - return (_a3 = this.getDelegateLogger(name, version2, options)) !== null && _a3 !== undefined ? _a3 : new ProxyLogger_1.ProxyLogger(this, name, version2, options); + var _a2; + return (_a2 = this.getDelegateLogger(name, version2, options)) !== null && _a2 !== undefined ? _a2 : new ProxyLogger_1.ProxyLogger(this, name, version2, options); } getDelegate() { - var _a3; - return (_a3 = this._delegate) !== null && _a3 !== undefined ? _a3 : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; + var _a2; + return (_a2 = this._delegate) !== null && _a2 !== undefined ? _a2 : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; } setDelegate(delegate) { this._delegate = delegate; } getDelegateLogger(name, version2, options) { - var _a3; - return (_a3 = this._delegate) === null || _a3 === undefined ? undefined : _a3.getLogger(name, version2, options); + var _a2; + return (_a2 = this._delegate) === null || _a2 === undefined ? undefined : _a2.getLogger(name, version2, options); } } exports.ProxyLoggerProvider = ProxyLoggerProvider; @@ -189025,7 +134712,7 @@ var require_globalThis2 = __commonJS((exports) => { }); // node_modules/@opentelemetry/api-logs/build/src/platform/node/index.js -var require_node6 = __commonJS((exports) => { +var require_node5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports._globalThis = undefined; var globalThis_1 = require_globalThis2(); @@ -189038,7 +134725,7 @@ var require_node6 = __commonJS((exports) => { var require_platform4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports._globalThis = undefined; - var node_1 = require_node6(); + var node_1 = require_node5(); Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { return node_1._globalThis; } }); @@ -189085,8 +134772,8 @@ var require_logs = __commonJS((exports) => { return provider; } getLoggerProvider() { - var _a3, _b; - return (_b = (_a3 = global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) === null || _a3 === undefined ? undefined : _a3.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== undefined ? _b : this._proxyLoggerProvider; + var _a2, _b; + return (_b = (_a2 = global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) === null || _a2 === undefined ? undefined : _a2.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== undefined ? _b : this._proxyLoggerProvider; } getLogger(name, version2, options) { return this.getLoggerProvider().getLogger(name, version2, options); @@ -189100,7 +134787,7 @@ var require_logs = __commonJS((exports) => { }); // node_modules/@opentelemetry/api-logs/build/src/index.js -var require_src18 = __commonJS((exports) => { +var require_src12 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.logs = exports.ProxyLoggerProvider = exports.ProxyLogger = exports.NoopLoggerProvider = exports.NOOP_LOGGER_PROVIDER = exports.NoopLogger = exports.NOOP_LOGGER = exports.SeverityNumber = undefined; var LogRecord_1 = require_LogRecord(); @@ -189137,9 +134824,9 @@ var require_src18 = __commonJS((exports) => { var require_LogRecord2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.LogRecord = undefined; - var api_1 = require_src13(); - var api2 = require_src13(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var api2 = require_src7(); + var core_1 = require_src10(); class LogRecord { constructor(_sharedState, instrumentationScope, logRecord) { @@ -189278,7 +134965,7 @@ var require_LogRecord2 = __commonJS((exports) => { var require_Logger = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Logger = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var LogRecord_1 = require_LogRecord2(); class Logger { @@ -189300,7 +134987,7 @@ var require_Logger = __commonJS((exports) => { var require_config = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.reconfigureLimits = exports.loadDefaultConfig = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); function loadDefaultConfig() { return { forceFlushTimeoutMillis: 30000, @@ -189314,10 +135001,10 @@ var require_config = __commonJS((exports) => { } exports.loadDefaultConfig = loadDefaultConfig; function reconfigureLimits(logRecordLimits) { - var _a3, _b, _c, _d, _e, _f; + var _a2, _b, _c, _d, _e, _f; const parsedEnvConfig = (0, core_1.getEnvWithoutDefaults)(); return { - attributeCountLimit: (_c = (_b = (_a3 = logRecordLimits.attributeCountLimit) !== null && _a3 !== undefined ? _a3 : parsedEnvConfig.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT) !== null && _b !== undefined ? _b : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _c !== undefined ? _c : core_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT, + attributeCountLimit: (_c = (_b = (_a2 = logRecordLimits.attributeCountLimit) !== null && _a2 !== undefined ? _a2 : parsedEnvConfig.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT) !== null && _b !== undefined ? _b : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _c !== undefined ? _c : core_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT, attributeValueLengthLimit: (_f = (_e = (_d = logRecordLimits.attributeValueLengthLimit) !== null && _d !== undefined ? _d : parsedEnvConfig.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _e !== undefined ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _f !== undefined ? _f : core_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT }; } @@ -189328,7 +135015,7 @@ var require_config = __commonJS((exports) => { var require_MultiLogRecordProcessor = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.MultiLogRecordProcessor = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); class MultiLogRecordProcessor { constructor(processors, forceFlushTimeoutMillis) { @@ -189389,10 +135076,10 @@ var require_LoggerProviderSharedState = __commonJS((exports) => { var require_LoggerProvider = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.LoggerProvider = exports.DEFAULT_LOGGER_NAME = undefined; - var api_1 = require_src13(); - var api_logs_1 = require_src18(); - var resources_1 = require_src17(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var api_logs_1 = require_src12(); + var resources_1 = require_src11(); + var core_1 = require_src10(); var Logger_1 = require_Logger(); var config_1 = require_config(); var MultiLogRecordProcessor_1 = require_MultiLogRecordProcessor(); @@ -189460,8 +135147,8 @@ var require_LoggerProvider = __commonJS((exports) => { var require_ConsoleLogRecordExporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ConsoleLogRecordExporter = undefined; - var core_1 = require_src16(); - var core_2 = require_src16(); + var core_1 = require_src10(); + var core_2 = require_src10(); class ConsoleLogRecordExporter { export(logs, resultCallback) { @@ -189471,14 +135158,14 @@ var require_ConsoleLogRecordExporter = __commonJS((exports) => { return Promise.resolve(); } _exportInfo(logRecord) { - var _a3, _b, _c; + var _a2, _b, _c; return { resource: { attributes: logRecord.resource.attributes }, instrumentationScope: logRecord.instrumentationScope, timestamp: (0, core_1.hrTimeToMicroseconds)(logRecord.hrTime), - traceId: (_a3 = logRecord.spanContext) === null || _a3 === undefined ? undefined : _a3.traceId, + traceId: (_a2 = logRecord.spanContext) === null || _a2 === undefined ? undefined : _a2.traceId, spanId: (_b = logRecord.spanContext) === null || _b === undefined ? undefined : _b.spanId, traceFlags: (_c = logRecord.spanContext) === null || _c === undefined ? undefined : _c.traceFlags, severityText: logRecord.severityText, @@ -189501,7 +135188,7 @@ var require_ConsoleLogRecordExporter = __commonJS((exports) => { var require_SimpleLogRecordProcessor = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.SimpleLogRecordProcessor = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); class SimpleLogRecordProcessor { constructor(_exporter) { @@ -189510,18 +135197,18 @@ var require_SimpleLogRecordProcessor = __commonJS((exports) => { this._unresolvedExports = new Set; } onEmit(logRecord) { - var _a3, _b; + var _a2, _b; if (this._shutdownOnce.isCalled) { return; } const doExport = () => core_1.internal._export(this._exporter, [logRecord]).then((result2) => { - var _a4; + var _a3; if (result2.code !== core_1.ExportResultCode.SUCCESS) { - (0, core_1.globalErrorHandler)((_a4 = result2.error) !== null && _a4 !== undefined ? _a4 : new Error(`SimpleLogRecordProcessor: log record export failed (status ${result2})`)); + (0, core_1.globalErrorHandler)((_a3 = result2.error) !== null && _a3 !== undefined ? _a3 : new Error(`SimpleLogRecordProcessor: log record export failed (status ${result2})`)); } }).catch(core_1.globalErrorHandler); if (logRecord.resource.asyncAttributesPending) { - const exportPromise = (_b = (_a3 = logRecord.resource).waitForAsyncAttributes) === null || _b === undefined ? undefined : _b.call(_a3).then(() => { + const exportPromise = (_b = (_a2 = logRecord.resource).waitForAsyncAttributes) === null || _b === undefined ? undefined : _b.call(_a2).then(() => { this._unresolvedExports.delete(exportPromise); return doExport(); }, core_1.globalErrorHandler); @@ -189549,7 +135236,7 @@ var require_SimpleLogRecordProcessor = __commonJS((exports) => { var require_InMemoryLogRecordExporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.InMemoryLogRecordExporter = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); class InMemoryLogRecordExporter { constructor() { @@ -189585,19 +135272,19 @@ var require_InMemoryLogRecordExporter = __commonJS((exports) => { var require_BatchLogRecordProcessorBase = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchLogRecordProcessorBase = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var core_1 = require_src10(); class BatchLogRecordProcessorBase { constructor(_exporter, config2) { - var _a3, _b, _c, _d; + var _a2, _b, _c, _d; this._exporter = _exporter; this._finishedLogRecords = []; - const env5 = (0, core_1.getEnv)(); - this._maxExportBatchSize = (_a3 = config2 === null || config2 === undefined ? undefined : config2.maxExportBatchSize) !== null && _a3 !== undefined ? _a3 : env5.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE; - this._maxQueueSize = (_b = config2 === null || config2 === undefined ? undefined : config2.maxQueueSize) !== null && _b !== undefined ? _b : env5.OTEL_BLRP_MAX_QUEUE_SIZE; - this._scheduledDelayMillis = (_c = config2 === null || config2 === undefined ? undefined : config2.scheduledDelayMillis) !== null && _c !== undefined ? _c : env5.OTEL_BLRP_SCHEDULE_DELAY; - this._exportTimeoutMillis = (_d = config2 === null || config2 === undefined ? undefined : config2.exportTimeoutMillis) !== null && _d !== undefined ? _d : env5.OTEL_BLRP_EXPORT_TIMEOUT; + const env4 = (0, core_1.getEnv)(); + this._maxExportBatchSize = (_a2 = config2 === null || config2 === undefined ? undefined : config2.maxExportBatchSize) !== null && _a2 !== undefined ? _a2 : env4.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE; + this._maxQueueSize = (_b = config2 === null || config2 === undefined ? undefined : config2.maxQueueSize) !== null && _b !== undefined ? _b : env4.OTEL_BLRP_MAX_QUEUE_SIZE; + this._scheduledDelayMillis = (_c = config2 === null || config2 === undefined ? undefined : config2.scheduledDelayMillis) !== null && _c !== undefined ? _c : env4.OTEL_BLRP_SCHEDULE_DELAY; + this._exportTimeoutMillis = (_d = config2 === null || config2 === undefined ? undefined : config2.exportTimeoutMillis) !== null && _d !== undefined ? _d : env4.OTEL_BLRP_EXPORT_TIMEOUT; this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); if (this._maxExportBatchSize > this._maxQueueSize) { api_1.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"); @@ -189676,9 +135363,9 @@ var require_BatchLogRecordProcessorBase = __commonJS((exports) => { } _export(logRecords) { const doExport = () => core_1.internal._export(this._exporter, logRecords).then((result2) => { - var _a3; + var _a2; if (result2.code !== core_1.ExportResultCode.SUCCESS) { - (0, core_1.globalErrorHandler)((_a3 = result2.error) !== null && _a3 !== undefined ? _a3 : new Error(`BatchLogRecordProcessor: log record export failed (status ${result2})`)); + (0, core_1.globalErrorHandler)((_a2 = result2.error) !== null && _a2 !== undefined ? _a2 : new Error(`BatchLogRecordProcessor: log record export failed (status ${result2})`)); } }).catch(core_1.globalErrorHandler); const pendingResources = logRecords.map((logRecord) => logRecord.resource).filter((resource) => resource.asyncAttributesPending); @@ -189686,8 +135373,8 @@ var require_BatchLogRecordProcessorBase = __commonJS((exports) => { return doExport(); } else { return Promise.all(pendingResources.map((resource) => { - var _a3; - return (_a3 = resource.waitForAsyncAttributes) === null || _a3 === undefined ? undefined : _a3.call(resource); + var _a2; + return (_a2 = resource.waitForAsyncAttributes) === null || _a2 === undefined ? undefined : _a2.call(resource); })).then(doExport, core_1.globalErrorHandler); } } @@ -189708,7 +135395,7 @@ var require_BatchLogRecordProcessor = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-logs/build/src/platform/node/index.js -var require_node7 = __commonJS((exports) => { +var require_node6 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchLogRecordProcessor = undefined; var BatchLogRecordProcessor_1 = require_BatchLogRecordProcessor(); @@ -189721,14 +135408,14 @@ var require_node7 = __commonJS((exports) => { var require_platform5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchLogRecordProcessor = undefined; - var node_1 = require_node7(); + var node_1 = require_node6(); Object.defineProperty(exports, "BatchLogRecordProcessor", { enumerable: true, get: function() { return node_1.BatchLogRecordProcessor; } }); }); // node_modules/@opentelemetry/sdk-logs/build/src/index.js -var require_src19 = __commonJS((exports) => { +var require_src13 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchLogRecordProcessor = exports.InMemoryLogRecordExporter = exports.SimpleLogRecordProcessor = exports.ConsoleLogRecordExporter = exports.NoopLogRecordProcessor = exports.LogRecord = exports.LoggerProvider = undefined; var LoggerProvider_1 = require_LoggerProvider(); @@ -189762,14 +135449,14 @@ var require_src19 = __commonJS((exports) => { }); // node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js -var require_utils11 = __commonJS((exports) => { +var require_utils10 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createConstMap = undefined; - function createConstMap(values3) { + function createConstMap(values2) { let res = {}; - const len = values3.length; + const len = values2.length; for (let lp = 0;lp < len; lp++) { - const val = values3[lp]; + const val = values2[lp]; if (val) { res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val; } @@ -189788,7 +135475,7 @@ var require_SemanticAttributes3 = __commonJS((exports) => { exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = exports.FaasDocumentOperationValues = exports.FAASDOCUMENTOPERATIONVALUES_DELETE = exports.FAASDOCUMENTOPERATIONVALUES_EDIT = exports.FAASDOCUMENTOPERATIONVALUES_INSERT = exports.FaasTriggerValues = exports.FAASTRIGGERVALUES_OTHER = exports.FAASTRIGGERVALUES_TIMER = exports.FAASTRIGGERVALUES_PUBSUB = exports.FAASTRIGGERVALUES_HTTP = exports.FAASTRIGGERVALUES_DATASOURCE = exports.DbCassandraConsistencyLevelValues = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = exports.DbSystemValues = exports.DBSYSTEMVALUES_COCKROACHDB = exports.DBSYSTEMVALUES_MEMCACHED = exports.DBSYSTEMVALUES_ELASTICSEARCH = exports.DBSYSTEMVALUES_GEODE = exports.DBSYSTEMVALUES_NEO4J = exports.DBSYSTEMVALUES_DYNAMODB = exports.DBSYSTEMVALUES_COSMOSDB = exports.DBSYSTEMVALUES_COUCHDB = exports.DBSYSTEMVALUES_COUCHBASE = exports.DBSYSTEMVALUES_REDIS = exports.DBSYSTEMVALUES_MONGODB = exports.DBSYSTEMVALUES_HBASE = exports.DBSYSTEMVALUES_CASSANDRA = exports.DBSYSTEMVALUES_COLDFUSION = exports.DBSYSTEMVALUES_H2 = exports.DBSYSTEMVALUES_VERTICA = exports.DBSYSTEMVALUES_TERADATA = exports.DBSYSTEMVALUES_SYBASE = exports.DBSYSTEMVALUES_SQLITE = exports.DBSYSTEMVALUES_POINTBASE = exports.DBSYSTEMVALUES_PERVASIVE = exports.DBSYSTEMVALUES_NETEZZA = exports.DBSYSTEMVALUES_MARIADB = exports.DBSYSTEMVALUES_INTERBASE = exports.DBSYSTEMVALUES_INSTANTDB = exports.DBSYSTEMVALUES_INFORMIX = undefined; exports.MESSAGINGOPERATIONVALUES_RECEIVE = exports.MessagingDestinationKindValues = exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = exports.HttpFlavorValues = exports.HTTPFLAVORVALUES_QUIC = exports.HTTPFLAVORVALUES_SPDY = exports.HTTPFLAVORVALUES_HTTP_2_0 = exports.HTTPFLAVORVALUES_HTTP_1_1 = exports.HTTPFLAVORVALUES_HTTP_1_0 = exports.NetHostConnectionSubtypeValues = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = exports.NetHostConnectionTypeValues = exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = exports.NETHOSTCONNECTIONTYPEVALUES_CELL = exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = exports.NetTransportValues = exports.NETTRANSPORTVALUES_OTHER = exports.NETTRANSPORTVALUES_INPROC = exports.NETTRANSPORTVALUES_PIPE = exports.NETTRANSPORTVALUES_UNIX = exports.NETTRANSPORTVALUES_IP = exports.NETTRANSPORTVALUES_IP_UDP = exports.NETTRANSPORTVALUES_IP_TCP = exports.FaasInvokedProviderValues = exports.FAASINVOKEDPROVIDERVALUES_GCP = exports.FAASINVOKEDPROVIDERVALUES_AZURE = exports.FAASINVOKEDPROVIDERVALUES_AWS = undefined; exports.MessageTypeValues = exports.MESSAGETYPEVALUES_RECEIVED = exports.MESSAGETYPEVALUES_SENT = exports.RpcGrpcStatusCodeValues = exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = exports.RPCGRPCSTATUSCODEVALUES_ABORTED = exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = exports.RPCGRPCSTATUSCODEVALUES_OK = exports.MessagingOperationValues = exports.MESSAGINGOPERATIONVALUES_PROCESS = undefined; - var utils_1 = require_utils11(); + var utils_1 = require_utils10(); var TMP_AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"; var TMP_DB_SYSTEM = "db.system"; var TMP_DB_CONNECTION_STRING = "db.connection_string"; @@ -190628,7 +136315,7 @@ var require_SemanticResourceAttributes3 = __commonJS((exports) => { exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = undefined; exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = exports.CLOUDPLATFORMVALUES_AZURE_AKS = exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = exports.CLOUDPLATFORMVALUES_AZURE_VM = exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = exports.CLOUDPLATFORMVALUES_AWS_EKS = exports.CLOUDPLATFORMVALUES_AWS_ECS = exports.CLOUDPLATFORMVALUES_AWS_EC2 = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = exports.CloudProviderValues = exports.CLOUDPROVIDERVALUES_GCP = exports.CLOUDPROVIDERVALUES_AZURE = exports.CLOUDPROVIDERVALUES_AWS = exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = exports.SemanticResourceAttributes = exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = exports.SEMRESATTRS_WEBENGINE_VERSION = exports.SEMRESATTRS_WEBENGINE_NAME = exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = exports.SEMRESATTRS_TELEMETRY_SDK_NAME = exports.SEMRESATTRS_SERVICE_VERSION = exports.SEMRESATTRS_SERVICE_INSTANCE_ID = exports.SEMRESATTRS_SERVICE_NAMESPACE = exports.SEMRESATTRS_SERVICE_NAME = exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = exports.SEMRESATTRS_PROCESS_OWNER = exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = exports.SEMRESATTRS_PROCESS_COMMAND_LINE = exports.SEMRESATTRS_PROCESS_COMMAND = exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = exports.SEMRESATTRS_PROCESS_PID = exports.SEMRESATTRS_OS_VERSION = exports.SEMRESATTRS_OS_NAME = exports.SEMRESATTRS_OS_DESCRIPTION = exports.SEMRESATTRS_OS_TYPE = exports.SEMRESATTRS_K8S_CRONJOB_NAME = exports.SEMRESATTRS_K8S_CRONJOB_UID = exports.SEMRESATTRS_K8S_JOB_NAME = exports.SEMRESATTRS_K8S_JOB_UID = exports.SEMRESATTRS_K8S_DAEMONSET_NAME = exports.SEMRESATTRS_K8S_DAEMONSET_UID = undefined; exports.TelemetrySdkLanguageValues = exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = exports.TELEMETRYSDKLANGUAGEVALUES_PHP = exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = exports.TELEMETRYSDKLANGUAGEVALUES_GO = exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = exports.TELEMETRYSDKLANGUAGEVALUES_CPP = exports.OsTypeValues = exports.OSTYPEVALUES_Z_OS = exports.OSTYPEVALUES_SOLARIS = exports.OSTYPEVALUES_AIX = exports.OSTYPEVALUES_HPUX = exports.OSTYPEVALUES_DRAGONFLYBSD = exports.OSTYPEVALUES_OPENBSD = exports.OSTYPEVALUES_NETBSD = exports.OSTYPEVALUES_FREEBSD = exports.OSTYPEVALUES_DARWIN = exports.OSTYPEVALUES_LINUX = exports.OSTYPEVALUES_WINDOWS = exports.HostArchValues = exports.HOSTARCHVALUES_X86 = exports.HOSTARCHVALUES_PPC64 = exports.HOSTARCHVALUES_PPC32 = exports.HOSTARCHVALUES_IA64 = exports.HOSTARCHVALUES_ARM64 = exports.HOSTARCHVALUES_ARM32 = exports.HOSTARCHVALUES_AMD64 = exports.AwsEcsLaunchtypeValues = exports.AWSECSLAUNCHTYPEVALUES_FARGATE = exports.AWSECSLAUNCHTYPEVALUES_EC2 = exports.CloudPlatformValues = exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = undefined; - var utils_1 = require_utils11(); + var utils_1 = require_utils10(); var TMP_CLOUD_PROVIDER = "cloud.provider"; var TMP_CLOUD_ACCOUNT_ID = "cloud.account.id"; var TMP_CLOUD_REGION = "cloud.region"; @@ -191280,7 +136967,7 @@ var require_stable_events = __commonJS((exports) => { }); // node_modules/@opentelemetry/semantic-conventions/build/src/index.js -var require_src20 = __commonJS((exports) => { +var require_src14 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -191366,7 +137053,7 @@ function isSet3(value) { return value !== null && value !== undefined; } var PublicApiAuth; -var init_auth3 = __esm(() => { +var init_auth2 = __esm(() => { PublicApiAuth = { fromJSON(object2) { return { @@ -191505,7 +137192,7 @@ function isSet4(value) { var GitHubActionsMetadata, EnvironmentMetadata, SlackContext, ClaudeCodeInternalEvent; var init_claude_code_internal_event = __esm(() => { init_timestamp(); - init_auth3(); + init_auth2(); GitHubActionsMetadata = { fromJSON(object2) { return { @@ -191968,7 +137655,7 @@ function isSet5(value) { var GrowthbookExperimentEvent; var init_growthbook_experiment_event = __esm(() => { init_timestamp(); - init_auth3(); + init_auth2(); GrowthbookExperimentEvent = { fromJSON(object2) { return { @@ -192253,8 +137940,8 @@ async function prefetchOfficialMcpUrls() { } officialUrls = urls; logForDebugging(`[mcp-registry] Loaded ${urls.size} official MCP URLs`); - } catch (error45) { - logForDebugging(`Failed to fetch MCP registry: ${errorMessage(error45)}`, { + } catch (error41) { + logForDebugging(`Failed to fetch MCP registry: ${errorMessage(error41)}`, { level: "error" }); } @@ -192588,12 +138275,12 @@ function extractMcpToolDetails(toolName) { mcpToolName }; } -function extractSkillName(toolName, input2) { +function extractSkillName(toolName, input) { if (toolName !== "Skill") { return; } - if (typeof input2 === "object" && input2 !== null && "skill" in input2 && typeof input2.skill === "string") { - return input2.skill; + if (typeof input === "object" && input !== null && "skill" in input && typeof input.skill === "string") { + return input.skill; } return; } @@ -192627,11 +138314,11 @@ function truncateToolInputValue(value, depth = 0) { } return String(value); } -function extractToolInputForTelemetry(input2) { +function extractToolInputForTelemetry(input) { if (!isToolDetailsLoggingEnabled()) { return; } - const truncated = truncateToolInputValue(input2); + const truncated = truncateToolInputValue(input); let json2 = jsonStringify(truncated); if (json2.length > TOOL_INPUT_MAX_JSON_CHARS) { json2 = json2.slice(0, TOOL_INPUT_MAX_JSON_CHARS) + "…[truncated]"; @@ -192795,7 +138482,7 @@ function to1PEventFormat(metadata, userMetadata, additionalMetadata = {}) { observerMode, ...coreFields } = metadata; - const env5 = { + const env4 = { platform: envContext.platform, platform_raw: envContext.platformRaw, arch: envContext.arch, @@ -192817,49 +138504,49 @@ function to1PEventFormat(metadata, userMetadata, additionalMetadata = {}) { deployment_environment: envContext.deploymentEnvironment }; if (envContext.remoteEnvironmentType) { - env5.remote_environment_type = envContext.remoteEnvironmentType; + env4.remote_environment_type = envContext.remoteEnvironmentType; } if (feature("COWORKER_TYPE_TELEMETRY") && envContext.coworkerType) { - env5.coworker_type = envContext.coworkerType; + env4.coworker_type = envContext.coworkerType; } if (envContext.claudeCodeContainerId) { - env5.claude_code_container_id = envContext.claudeCodeContainerId; + env4.claude_code_container_id = envContext.claudeCodeContainerId; } if (envContext.claudeCodeRemoteSessionId) { - env5.claude_code_remote_session_id = envContext.claudeCodeRemoteSessionId; + env4.claude_code_remote_session_id = envContext.claudeCodeRemoteSessionId; } if (envContext.tags) { - env5.tags = envContext.tags.split(",").map((t) => t.trim()).filter(Boolean); + env4.tags = envContext.tags.split(",").map((t) => t.trim()).filter(Boolean); } if (envContext.githubEventName) { - env5.github_event_name = envContext.githubEventName; + env4.github_event_name = envContext.githubEventName; } if (envContext.githubActionsRunnerEnvironment) { - env5.github_actions_runner_environment = envContext.githubActionsRunnerEnvironment; + env4.github_actions_runner_environment = envContext.githubActionsRunnerEnvironment; } if (envContext.githubActionsRunnerOs) { - env5.github_actions_runner_os = envContext.githubActionsRunnerOs; + env4.github_actions_runner_os = envContext.githubActionsRunnerOs; } if (envContext.githubActionRef) { - env5.github_action_ref = envContext.githubActionRef; + env4.github_action_ref = envContext.githubActionRef; } if (envContext.wslVersion) { - env5.wsl_version = envContext.wslVersion; + env4.wsl_version = envContext.wslVersion; } if (envContext.linuxDistroId) { - env5.linux_distro_id = envContext.linuxDistroId; + env4.linux_distro_id = envContext.linuxDistroId; } if (envContext.linuxDistroVersion) { - env5.linux_distro_version = envContext.linuxDistroVersion; + env4.linux_distro_version = envContext.linuxDistroVersion; } if (envContext.linuxKernel) { - env5.linux_kernel = envContext.linuxKernel; + env4.linux_kernel = envContext.linuxKernel; } if (envContext.vcs) { - env5.vcs = envContext.vcs; + env4.vcs = envContext.vcs; } if (envContext.versionBase) { - env5.version_base = envContext.versionBase; + env4.version_base = envContext.versionBase; } const core2 = { session_id: coreFields.sessionId, @@ -192900,7 +138587,7 @@ function to1PEventFormat(metadata, userMetadata, additionalMetadata = {}) { } if (userMetadata.githubActionsMetadata) { const ghMeta = userMetadata.githubActionsMetadata; - env5.github_actions_metadata = { + env4.github_actions_metadata = { actor_id: ghMeta.actorId, repository_id: ghMeta.repositoryId, repository_owner_id: ghMeta.repositoryOwnerId @@ -192914,7 +138601,7 @@ function to1PEventFormat(metadata, userMetadata, additionalMetadata = {}) { }; } return { - env: env5, + env: env4, ...processMetrics && { process: Buffer.from(jsonStringify(processMetrics)).toString("base64") }, @@ -192939,7 +138626,7 @@ var init_metadata = __esm(() => { init_state(); init_envUtils(); init_officialRegistry(); - init_auth2(); + init_auth(); init_git(); init_platform2(); init_agentContext(); @@ -193014,7 +138701,7 @@ var init_metadata = __esm(() => { isClaudeAiAuth: isClaudeAISubscriber(), version: "2.1.88-custom", versionBase: getVersionBase(), - buildTime: "2026-04-01T09:59:54.268Z", + buildTime: "2026-04-03T01:33:36.988Z", deploymentEnvironment: env3.detectDeploymentEnvironment(), ...isEnvTruthy(process.env.GITHUB_ACTIONS) && { githubEventName: process.env.GITHUB_EVENT_NAME, @@ -193032,9 +138719,9 @@ var init_metadata = __esm(() => { // src/services/analytics/firstPartyEventLoggingExporter.ts import { randomUUID as randomUUID3 } from "crypto"; import { appendFile as appendFile3, mkdir as mkdir5, readdir as readdir5, unlink as unlink2, writeFile as writeFile3 } from "fs/promises"; -import * as path11 from "path"; +import * as path9 from "path"; function getStorageDir() { - return path11.join(getClaudeConfigHomeDir(), "telemetry"); + return path9.join(getClaudeConfigHomeDir(), "telemetry"); } class FirstPartyEventLoggingExporter { @@ -193075,7 +138762,7 @@ class FirstPartyEventLoggingExporter { return (await this.loadEventsFromCurrentBatch()).length; } getCurrentBatchFilePath() { - return path11.join(getStorageDir(), `${FILE_PREFIX}${getSessionId()}.${BATCH_UUID}.json`); + return path9.join(getStorageDir(), `${FILE_PREFIX}${getSessionId()}.${BATCH_UUID}.json`); } async loadEventsFromFile(filePath) { try { @@ -193100,8 +138787,8 @@ class FirstPartyEventLoggingExporter { `; await writeFile3(filePath, content, "utf8"); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } async appendEventsToFile(filePath, events) { @@ -193113,8 +138800,8 @@ class FirstPartyEventLoggingExporter { `) + ` `; await appendFile3(filePath, content, "utf8"); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } async deleteFile(filePath) { @@ -193134,11 +138821,11 @@ class FirstPartyEventLoggingExporter { throw e; } for (const file2 of files) { - const filePath = path11.join(getStorageDir(), file2); + const filePath = path9.join(getStorageDir(), file2); this.retryFileInBackground(filePath); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } async retryFileInBackground(filePath) { @@ -193189,7 +138876,7 @@ class FirstPartyEventLoggingExporter { } async doExport(logs, resultCallback) { try { - const eventLogs = logs.filter((log2) => log2.instrumentationScope?.name === "com.anthropic.claude_code.events"); + const eventLogs = logs.filter((log) => log.instrumentationScope?.name === "com.anthropic.claude_code.events"); if (eventLogs.length === 0) { resultCallback({ code: import_core13.ExportResultCode.SUCCESS }); return; @@ -193223,14 +138910,14 @@ class FirstPartyEventLoggingExporter { this.retryFailedEvents(); } resultCallback({ code: import_core13.ExportResultCode.SUCCESS }); - } catch (error45) { + } catch (error41) { if (process.env.USER_TYPE === "ant") { - logForDebugging(`1P event logging export failed: ${errorMessage(error45)}`); + logForDebugging(`1P event logging export failed: ${errorMessage(error41)}`); } - logError2(error45); + logError2(error41); resultCallback({ code: import_core13.ExportResultCode.FAILED, - error: toError(error45) + error: toError(error41) }); } } @@ -193248,8 +138935,8 @@ class FirstPartyEventLoggingExporter { const batch = batches[i2]; try { await this.sendBatchWithRetry({ events: batch }); - } catch (error45) { - lastErrorContext = getAxiosErrorContext(error45); + } catch (error41) { + lastErrorContext = getAxiosErrorContext(error41); for (let j = i2;j < batches.length; j++) { failedBatchEvents.push(...batches[j]); } @@ -193260,7 +138947,7 @@ class FirstPartyEventLoggingExporter { break; } if (i2 < batches.length - 1 && this.batchDelayMs > 0) { - await sleep4(this.batchDelayMs); + await sleep2(this.batchDelayMs); } } if (failedBatchEvents.length > 0 && lastErrorContext) { @@ -193353,7 +139040,7 @@ class FirstPartyEventLoggingExporter { } } } - const authResult = shouldSkipAuth ? { headers: {}, error: "trust not established or Oauth token expired" } : getAuthHeaders2(); + const authResult = shouldSkipAuth ? { headers: {}, error: "trust not established or Oauth token expired" } : getAuthHeaders(); const useAuth = !authResult.error; if (!useAuth && process.env.USER_TYPE === "ant") { logForDebugging(`1P event logging: auth not available, sending without auth`); @@ -193366,8 +139053,8 @@ class FirstPartyEventLoggingExporter { }); this.logSuccess(payload.events.length, useAuth, response.data); return; - } catch (error45) { - if (useAuth && axios_default.isAxiosError(error45) && error45.response?.status === 401) { + } catch (error41) { + if (useAuth && axios_default.isAxiosError(error41) && error41.response?.status === 401) { if (process.env.USER_TYPE === "ant") { logForDebugging("1P event logging: 401 auth error, retrying without auth"); } @@ -193378,7 +139065,7 @@ class FirstPartyEventLoggingExporter { this.logSuccess(payload.events.length, false, response.data); return; } - throw error45; + throw error41; } } logSuccess(eventCount, withAuth, responseData) { @@ -193393,10 +139080,10 @@ class FirstPartyEventLoggingExporter { } transformLogsToEvents(logs) { const events = []; - for (const log2 of logs) { - const attributes = log2.attributes || {}; + for (const log of logs) { + const attributes = log.attributes || {}; if (attributes.event_type === "GrowthbookExperimentEvent") { - const timestamp = this.hrTimeToDate(log2.hrTime); + const timestamp = this.hrTimeToDate(log.hrTime); const account_uuid = attributes.account_uuid; const organization_uuid = attributes.organization_uuid; events.push({ @@ -193416,7 +139103,7 @@ class FirstPartyEventLoggingExporter { }); continue; } - const eventName = attributes.event_name || log2.body || "unknown"; + const eventName = attributes.event_name || log.body || "unknown"; const coreMetadata = attributes.core_metadata; const userMetadata = attributes.user_metadata; const eventMetadata = attributes.event_metadata || {}; @@ -193429,7 +139116,7 @@ class FirstPartyEventLoggingExporter { event_data: ClaudeCodeInternalEvent.toJSON({ event_id: attributes.event_id, event_name: eventName, - client_timestamp: this.hrTimeToDate(log2.hrTime), + client_timestamp: this.hrTimeToDate(log.hrTime), session_id: getSessionId(), additional_metadata: Buffer.from(jsonStringify({ transform_error: "core_metadata attribute is missing" @@ -193451,7 +139138,7 @@ class FirstPartyEventLoggingExporter { event_data: ClaudeCodeInternalEvent.toJSON({ event_id: attributes.event_id, event_name: eventName, - client_timestamp: this.hrTimeToDate(log2.hrTime), + client_timestamp: this.hrTimeToDate(log.hrTime), device_id: attributes.user_id, email: userMetadata?.email, auth: formatted.auth, @@ -193482,34 +139169,34 @@ class FirstPartyEventLoggingExporter { } } } -function getAxiosErrorContext(error45) { - if (!axios_default.isAxiosError(error45)) { - return errorMessage(error45); +function getAxiosErrorContext(error41) { + if (!axios_default.isAxiosError(error41)) { + return errorMessage(error41); } const parts = []; - const requestId = error45.response?.headers?.["request-id"]; + const requestId = error41.response?.headers?.["request-id"]; if (requestId) { parts.push(`request-id=${requestId}`); } - if (error45.response?.status) { - parts.push(`status=${error45.response.status}`); + if (error41.response?.status) { + parts.push(`status=${error41.response.status}`); } - if (error45.code) { - parts.push(`code=${error45.code}`); + if (error41.code) { + parts.push(`code=${error41.code}`); } - if (error45.message) { - parts.push(error45.message); + if (error41.message) { + parts.push(error41.message); } return parts.join(", "); } var import_core13, BATCH_UUID, FILE_PREFIX = "1p_failed_events."; var init_firstPartyEventLoggingExporter = __esm(() => { - import_core13 = __toESM(require_src16(), 1); + import_core13 = __toESM(require_src10(), 1); init_axios2(); init_state(); init_claude_code_internal_event(); init_growthbook_experiment_event(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_envUtils(); @@ -193741,9 +139428,9 @@ async function reinitialize1PEventLoggingIfConfigChanged() { } var import_resources, import_sdk_logs, import_semantic_conventions, EVENT_SAMPLING_CONFIG_NAME = "tengu_event_sampling_config", BATCH_CONFIG_NAME = "tengu_1p_event_batch_config", firstPartyEventLogger = null, firstPartyEventLoggerProvider = null, lastBatchConfig = null, DEFAULT_LOGS_EXPORT_INTERVAL_MS = 1e4, DEFAULT_MAX_EXPORT_BATCH_SIZE = 200, DEFAULT_MAX_QUEUE_SIZE = 8192; var init_firstPartyEventLogger = __esm(() => { - import_resources = __toESM(require_src17(), 1); - import_sdk_logs = __toESM(require_src19(), 1); - import_semantic_conventions = __toESM(require_src20(), 1); + import_resources = __toESM(require_src11(), 1); + import_sdk_logs = __toESM(require_src13(), 1); + import_semantic_conventions = __toESM(require_src14(), 1); init_lodash(); init_config2(); init_debug(); @@ -194143,17 +139830,17 @@ function refreshGrowthBookAfterAuthChange() { try { resetGrowthBook(); refreshed.emit(); - reinitializingPromise = initializeGrowthBook().catch((error45) => { - logError2(toError(error45)); + reinitializingPromise = initializeGrowthBook().catch((error41) => { + logError2(toError(error41)); return null; }).finally(() => { reinitializingPromise = null; }); - } catch (error45) { + } catch (error41) { if (true) { - throw error45; + throw error41; } - logError2(toError(error45)); + logError2(toError(error41)); } } function resetGrowthBook() { @@ -194166,8 +139853,8 @@ function resetGrowthBook() { process.off("exit", currentExitHandler); currentExitHandler = null; } - client4?.destroy(); - client4 = null; + client?.destroy(); + client = null; clientCreatedWithAuth = false; reinitializingPromise = null; experimentDataByFeature.clear(); @@ -194189,14 +139876,14 @@ async function refreshGrowthBookFeatures() { return; } await growthBookClient.refreshFeatures(); - if (growthBookClient !== client4) { + if (growthBookClient !== client) { if (process.env.USER_TYPE === "ant") { logForDebugging("GrowthBook: Skipping refresh processing for replaced client"); } return; } const hadFeatures = await processRemoteEvalPayload(growthBookClient); - if (growthBookClient !== client4) + if (growthBookClient !== client) return; if (process.env.USER_TYPE === "ant") { logForDebugging("GrowthBook: Light refresh completed"); @@ -194205,11 +139892,11 @@ async function refreshGrowthBookFeatures() { syncRemoteEvalToDisk(); refreshed.emit(); } - } catch (error45) { + } catch (error41) { if (true) { - throw error45; + throw error41; } - logError2(toError(error45)); + logError2(toError(error41)); } } function setupPeriodicGrowthBookRefresh() { @@ -194246,7 +139933,7 @@ async function getDynamicConfig_BLOCKS_ON_INIT(configName, defaultValue) { function getDynamicConfig_CACHED_MAY_BE_STALE(configName, defaultValue) { return getFeatureValue_CACHED_MAY_BE_STALE(configName, defaultValue); } -var client4 = null, currentBeforeExitHandler = null, currentExitHandler = null, clientCreatedWithAuth = false, experimentDataByFeature, remoteEvalFeatureValues, pendingExposures, loggedExposures, reinitializingPromise = null, refreshed, envOverrides = null, envOverridesParsed = false, getGrowthBookClient, initializeGrowthBook, GROWTHBOOK_REFRESH_INTERVAL_MS, refreshInterval = null, beforeExitListener = null; +var client = null, currentBeforeExitHandler = null, currentExitHandler = null, clientCreatedWithAuth = false, experimentDataByFeature, remoteEvalFeatureValues, pendingExposures, loggedExposures, reinitializingPromise = null, refreshed, envOverrides = null, envOverridesParsed = false, getGrowthBookClient, initializeGrowthBook, GROWTHBOOK_REFRESH_INTERVAL_MS, refreshInterval = null, beforeExitListener = null; var init_growthbook = __esm(() => { init_esm(); init_lodash(); @@ -194276,7 +139963,7 @@ var init_growthbook = __esm(() => { } const baseUrl = process.env.USER_TYPE === "ant" ? process.env.CLAUDE_CODE_GB_BASE_URL || "https://api.anthropic.com/" : "https://api.anthropic.com/"; const hasTrust = checkHasTrustDialogAccepted() || getSessionTrustAccepted() || getIsNonInteractiveSession(); - const authHeaders = hasTrust ? getAuthHeaders2() : { headers: {}, error: "trust not established" }; + const authHeaders = hasTrust ? getAuthHeaders() : { headers: {}, error: "trust not established" }; const hasAuth = !authHeaders.error; clientCreatedWithAuth = hasAuth; const thisClient = new GrowthBook({ @@ -194292,12 +139979,12 @@ var init_growthbook = __esm(() => { } } : {} }); - client4 = thisClient; + client = thisClient; if (!hasAuth) { return { client: thisClient, initialized: Promise.resolve() }; } const initialized = thisClient.init({ timeout: 5000 }).then(async (result2) => { - if (client4 !== thisClient) { + if (client !== thisClient) { if (process.env.USER_TYPE === "ant") { logForDebugging("GrowthBook: Skipping init callback for replaced client"); } @@ -194307,7 +139994,7 @@ var init_growthbook = __esm(() => { logForDebugging(`GrowthBook initialized successfully, source: ${result2.source}, success: ${result2.success}`); } const hadFeatures = await processRemoteEvalPayload(thisClient); - if (client4 !== thisClient) + if (client !== thisClient) return; if (hadFeatures) { for (const feature2 of pendingExposures) { @@ -194324,13 +140011,13 @@ var init_growthbook = __esm(() => { logForDebugging(`GrowthBook loaded ${featureKeys.length} features: ${featureKeys.slice(0, 10).join(", ")}${featureKeys.length > 10 ? "..." : ""}`); } } - }).catch((error45) => { + }).catch((error41) => { if (process.env.USER_TYPE === "ant") { - logError2(toError(error45)); + logError2(toError(error41)); } }); - currentBeforeExitHandler = () => client4?.destroy(); - currentExitHandler = () => client4?.destroy(); + currentBeforeExitHandler = () => client?.destroy(); + currentExitHandler = () => client?.destroy(); process.on("beforeExit", currentBeforeExitHandler); process.on("exit", currentExitHandler); return { client: thisClient, initialized }; @@ -194343,7 +140030,7 @@ var init_growthbook = __esm(() => { if (!clientCreatedWithAuth) { const hasTrust = checkHasTrustDialogAccepted() || getSessionTrustAccepted() || getIsNonInteractiveSession(); if (hasTrust) { - const currentAuth = getAuthHeaders2(); + const currentAuth = getAuthHeaders(); if (!currentAuth.error) { if (process.env.USER_TYPE === "ant") { logForDebugging("GrowthBook: Auth became available after client creation, reinitializing"); @@ -194621,7 +140308,7 @@ var init_teamMemPaths = __esm(() => { }); // node_modules/semver/internal/constants.js -var require_constants8 = __commonJS((exports, module) => { +var require_constants7 = __commonJS((exports, module) => { var SEMVER_SPEC_VERSION = "2.0.0"; var MAX_LENGTH = 256; var MAX_SAFE_INTEGER7 = Number.MAX_SAFE_INTEGER || 9007199254740991; @@ -194660,7 +140347,7 @@ var require_re = __commonJS((exports, module) => { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH - } = require_constants8(); + } = require_constants7(); var debug = require_debug2(); exports = module.exports = {}; var re = exports.re = []; @@ -194780,7 +140467,7 @@ var require_identifiers = __commonJS((exports, module) => { // node_modules/semver/classes/semver.js var require_semver2 = __commonJS((exports, module) => { var debug = require_debug2(); - var { MAX_LENGTH, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER7 } = require_constants8(); + var { MAX_LENGTH, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER7 } = require_constants7(); var { safeRe: re, t } = require_re(); var parseOptions = require_parse_options(); var { compareIdentifiers } = require_identifiers(); @@ -195047,7 +140734,7 @@ var require_semver2 = __commonJS((exports, module) => { }); // node_modules/semver/functions/parse.js -var require_parse7 = __commonJS((exports, module) => { +var require_parse5 = __commonJS((exports, module) => { var SemVer = require_semver2(); var parse7 = (version2, options, throwErrors = false) => { if (version2 instanceof SemVer) { @@ -195067,7 +140754,7 @@ var require_parse7 = __commonJS((exports, module) => { // node_modules/semver/functions/valid.js var require_valid = __commonJS((exports, module) => { - var parse7 = require_parse7(); + var parse7 = require_parse5(); var valid = (version2, options) => { const v = parse7(version2, options); return v ? v.version : null; @@ -195077,7 +140764,7 @@ var require_valid = __commonJS((exports, module) => { // node_modules/semver/functions/clean.js var require_clean = __commonJS((exports, module) => { - var parse7 = require_parse7(); + var parse7 = require_parse5(); var clean = (version2, options) => { const s = parse7(version2.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; @@ -195105,7 +140792,7 @@ var require_inc = __commonJS((exports, module) => { // node_modules/semver/functions/diff.js var require_diff = __commonJS((exports, module) => { - var parse7 = require_parse7(); + var parse7 = require_parse5(); var diff = (version1, version2) => { const v1 = parse7(version1, null, true); const v2 = parse7(version2, null, true); @@ -195167,7 +140854,7 @@ var require_patch = __commonJS((exports, module) => { // node_modules/semver/functions/prerelease.js var require_prerelease = __commonJS((exports, module) => { - var parse7 = require_parse7(); + var parse7 = require_parse5(); var prerelease = (version2, options) => { const parsed = parse7(version2, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; @@ -195313,7 +141000,7 @@ var require_cmp = __commonJS((exports, module) => { // node_modules/semver/functions/coerce.js var require_coerce = __commonJS((exports, module) => { var SemVer = require_semver2(); - var parse7 = require_parse7(); + var parse7 = require_parse5(); var { safeRe: re, t } = require_re(); var coerce = (version2, options) => { if (version2 instanceof SemVer) { @@ -195543,7 +141230,7 @@ var require_range2 = __commonJS((exports, module) => { tildeTrimReplace, caretTrimReplace } = require_re(); - var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants8(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants7(); var isNullSet = (c5) => c5.value === "<0.0.0-0"; var isAny = (c5) => c5.value === ""; var isSatisfiable = (comparators, options) => { @@ -196314,10 +142001,10 @@ var require_subset = __commonJS((exports, module) => { // node_modules/semver/index.js var require_semver3 = __commonJS((exports, module) => { var internalRe = require_re(); - var constants4 = require_constants8(); + var constants4 = require_constants7(); var SemVer = require_semver2(); var identifiers = require_identifiers(); - var parse7 = require_parse7(); + var parse7 = require_parse5(); var valid = require_valid(); var clean = require_clean(); var inc = require_inc(); @@ -196518,7 +142205,7 @@ function isCcrMirrorEnabled() { var init_bridgeEnabled = __esm(() => { init_bun_bundle(); init_growthbook(); - init_auth2(); + init_auth(); init_envUtils(); }); @@ -196674,8 +142361,8 @@ function saveGlobalConfig(updater) { if (didWrite && written) { writeThroughGlobalConfigCache(written); } - } catch (error45) { - logForDebugging(`Failed to save config with lock: ${error45}`, { + } catch (error41) { + logForDebugging(`Failed to save config with lock: ${error41}`, { level: "error" }); const currentConfig = getConfig(getGlobalClaudeFile(), createDefaultGlobalConfig); @@ -196748,14 +142435,14 @@ function removeProjectHistory(projects) { } const cleanedProjects = {}; let needsCleaning = false; - for (const [path12, projectConfig] of Object.entries(projects)) { + for (const [path10, projectConfig] of Object.entries(projects)) { const legacy = projectConfig; if (legacy.history !== undefined) { needsCleaning = true; const { history, ...cleanedConfig } = legacy; - cleanedProjects[path12] = cleanedConfig; + cleanedProjects[path10] = cleanedConfig; } else { - cleanedProjects[path12] = projectConfig; + cleanedProjects[path10] = projectConfig; } } return needsCleaning ? cleanedProjects : projects; @@ -197006,12 +142693,12 @@ function getConfig(file2, createDefault, throwOnInvalid) { ...createDefault(), ...parsedConfig }; - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); throw new ConfigParseError(errorMessage2, file2, createDefault()); } - } catch (error45) { - const errCode = getErrnoCode(error45); + } catch (error41) { + const errCode = getErrnoCode(error41); if (errCode === "ENOENT") { const backupPath = findMostRecentBackup(file2); if (backupPath) { @@ -197024,15 +142711,15 @@ Claude configuration file not found at: ${file2} } return createDefault(); } - if (error45 instanceof ConfigParseError && throwOnInvalid) { - throw error45; + if (error41 instanceof ConfigParseError && throwOnInvalid) { + throw error41; } - if (error45 instanceof ConfigParseError) { - logForDebugging(`Config file corrupted, resetting to defaults: ${error45.message}`, { level: "error" }); + if (error41 instanceof ConfigParseError) { + logForDebugging(`Config file corrupted, resetting to defaults: ${error41.message}`, { level: "error" }); if (!insideGetConfig) { insideGetConfig = true; try { - logError2(error45); + logError2(error41); let hasBackup = false; try { fs2.statSync(`${file2}.backup`); @@ -197046,7 +142733,7 @@ Claude configuration file not found at: ${file2} } } process.stderr.write(` -Claude configuration file at ${file2} is corrupted: ${error45.message} +Claude configuration file at ${file2} is corrupted: ${error41.message} `); const fileBase = basename4(file2); const corruptedBackupDir = getConfigBackupDir(); @@ -197137,8 +142824,8 @@ function saveCurrentProjectConfig(updater) { if (didWrite && written) { writeThroughGlobalConfigCache(written); } - } catch (error45) { - logForDebugging(`Failed to save config with lock: ${error45}`, { + } catch (error41) { + logForDebugging(`Failed to save config with lock: ${error41}`, { level: "error" }); const config2 = getConfig(getGlobalClaudeFile(), createDefaultGlobalConfig); @@ -197359,7 +143046,7 @@ var require_ignore = __commonJS((exports, module) => { return Array.isArray(subject) ? subject : [subject]; } var UNDEFINED = undefined; - var EMPTY2 = ""; + var EMPTY = ""; var SPACE = " "; var ESCAPE = "\\"; var REGEX_TEST_BLANK_LINE = /^\s+$/; @@ -197381,7 +143068,7 @@ var require_ignore = __commonJS((exports, module) => { }; var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; var RETURN_FALSE = () => false; - var sanitizeRange = (range2) => range2.replace(REGEX_REGEXP_RANGE, (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY2); + var sanitizeRange = (range2) => range2.replace(REGEX_REGEXP_RANGE, (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY); var cleanRangeBackSlash = (slashes) => { const { length } = slashes; return slashes.slice(0, length - length % 2); @@ -197389,11 +143076,11 @@ var require_ignore = __commonJS((exports, module) => { var REPLACERS = [ [ /^\uFEFF/, - () => EMPTY2 + () => EMPTY ], [ /((?:\\\\)*?)(\\?\s+)$/, - (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY2) + (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY) ], [ /(\\+?)\s/g, @@ -197546,7 +143233,7 @@ var require_ignore = __commonJS((exports, module) => { makeArray(isString3(pattern) ? splitPattern(pattern) : pattern).forEach(this._add, this); return this._added; } - test(path12, checkUnignored, mode) { + test(path10, checkUnignored, mode) { let ignored = false; let unignored = false; let matchedRule; @@ -197555,7 +143242,7 @@ var require_ignore = __commonJS((exports, module) => { if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { return; } - const matched = rule[mode].test(path12); + const matched = rule[mode].test(path10); if (!matched) { return; } @@ -197576,20 +143263,20 @@ var require_ignore = __commonJS((exports, module) => { var throwError = (message, Ctor) => { throw new Ctor(message); }; - var checkPath = (path12, originalPath, doThrow) => { - if (!isString3(path12)) { + var checkPath = (path10, originalPath, doThrow) => { + if (!isString3(path10)) { return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError); } - if (!path12) { + if (!path10) { return doThrow(`path must not be empty`, TypeError); } - if (checkPath.isNotRelative(path12)) { + if (checkPath.isNotRelative(path10)) { const r = "`path.relative()`d"; return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError); } return true; }; - var isNotRelative = (path12) => REGEX_TEST_INVALID_PATH.test(path12); + var isNotRelative = (path10) => REGEX_TEST_INVALID_PATH.test(path10); checkPath.isNotRelative = isNotRelative; checkPath.convert = (p) => p; @@ -197618,15 +143305,15 @@ var require_ignore = __commonJS((exports, module) => { return this.add(pattern); } _test(originalPath, cache2, checkUnignored, slices) { - const path12 = originalPath && checkPath.convert(originalPath); - checkPath(path12, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE); - return this._t(path12, cache2, checkUnignored, slices); + const path10 = originalPath && checkPath.convert(originalPath); + checkPath(path10, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE); + return this._t(path10, cache2, checkUnignored, slices); } - checkIgnore(path12) { - if (!REGEX_TEST_TRAILING_SLASH.test(path12)) { - return this.test(path12); + checkIgnore(path10) { + if (!REGEX_TEST_TRAILING_SLASH.test(path10)) { + return this.test(path10); } - const slices = path12.split(SLASH).filter(Boolean); + const slices = path10.split(SLASH).filter(Boolean); slices.pop(); if (slices.length) { const parent2 = this._t(slices.join(SLASH) + SLASH, this._testCache, true, slices); @@ -197634,42 +143321,42 @@ var require_ignore = __commonJS((exports, module) => { return parent2; } } - return this._rules.test(path12, false, MODE_CHECK_IGNORE); + return this._rules.test(path10, false, MODE_CHECK_IGNORE); } - _t(path12, cache2, checkUnignored, slices) { - if (path12 in cache2) { - return cache2[path12]; + _t(path10, cache2, checkUnignored, slices) { + if (path10 in cache2) { + return cache2[path10]; } if (!slices) { - slices = path12.split(SLASH).filter(Boolean); + slices = path10.split(SLASH).filter(Boolean); } slices.pop(); if (!slices.length) { - return cache2[path12] = this._rules.test(path12, checkUnignored, MODE_IGNORE); + return cache2[path10] = this._rules.test(path10, checkUnignored, MODE_IGNORE); } const parent2 = this._t(slices.join(SLASH) + SLASH, cache2, checkUnignored, slices); - return cache2[path12] = parent2.ignored ? parent2 : this._rules.test(path12, checkUnignored, MODE_IGNORE); + return cache2[path10] = parent2.ignored ? parent2 : this._rules.test(path10, checkUnignored, MODE_IGNORE); } - ignores(path12) { - return this._test(path12, this._ignoreCache, false).ignored; + ignores(path10) { + return this._test(path10, this._ignoreCache, false).ignored; } createFilter() { - return (path12) => !this.ignores(path12); + return (path10) => !this.ignores(path10); } filter(paths2) { return makeArray(paths2).filter(this.createFilter()); } - test(path12) { - return this._test(path12, this._testCache, true); + test(path10) { + return this._test(path10, this._testCache, true); } } var factory2 = (options) => new Ignore(options); - var isPathValid = (path12) => checkPath(path12 && checkPath.convert(path12), path12, RETURN_FALSE); + var isPathValid = (path10) => checkPath(path10 && checkPath.convert(path10), path10, RETURN_FALSE); var setupWindows = () => { const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"); checkPath.convert = makePosix; const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; - checkPath.isNotRelative = (path12) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path12) || isNotRelative(path12); + checkPath.isNotRelative = (path10) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path10) || isNotRelative(path10); }; if (typeof process !== "undefined" && process.platform === "win32") { setupWindows(); @@ -197909,7 +143596,7 @@ function isReplModeEnabled() { return process.env.USER_TYPE === "ant" && process.env.CLAUDE_CODE_ENTRYPOINT === "cli"; } var REPL_TOOL_NAME = "REPL", REPL_ONLY_TOOLS; -var init_constants6 = __esm(() => { +var init_constants5 = __esm(() => { init_envUtils(); init_constants3(); init_prompt3(); @@ -197975,7 +143662,7 @@ var require_react_development = __commonJS((exports, module) => { this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } - function noop9() {} + function noop7() {} function testStringCoercion(value) { return "" + value; } @@ -198158,10 +143845,10 @@ var require_react_development = __commonJS((exports, module) => { case "rejected": throw thenable.reason; default: - switch (typeof thenable.status === "string" ? thenable.then(noop9, noop9) : (thenable.status = "pending", thenable.then(function(fulfilledValue) { + switch (typeof thenable.status === "string" ? thenable.then(noop7, noop7) : (thenable.status = "pending", thenable.then(function(fulfilledValue) { thenable.status === "pending" && (thenable.status = "fulfilled", thenable.value = fulfilledValue); - }, function(error45) { - thenable.status === "pending" && (thenable.status = "rejected", thenable.reason = error45); + }, function(error41) { + thenable.status === "pending" && (thenable.status = "rejected", thenable.reason = error41); })), thenable.status) { case "fulfilled": return thenable.value; @@ -198252,13 +143939,13 @@ var require_react_development = __commonJS((exports, module) => { } thenable.status === undefined && (thenable.status = "fulfilled", thenable.value = moduleObject); } - }, function(error45) { + }, function(error41) { if (payload._status === 0 || payload._status === -1) { payload._status = 2; - payload._result = error45; + payload._result = error41; var _ioInfo2 = payload._ioInfo; - _ioInfo2 != null && (_ioInfo2.end = performance.now(), _ioInfo2.value.then(noop9, noop9), rejectDebugValue(error45), _ioInfo2.value.status = "rejected", _ioInfo2.value.reason = error45); - thenable.status === undefined && (thenable.status = "rejected", thenable.reason = error45); + _ioInfo2 != null && (_ioInfo2.end = performance.now(), _ioInfo2.value.then(noop7, noop7), rejectDebugValue(error41), _ioInfo2.value.status = "rejected", _ioInfo2.value.reason = error41); + thenable.status === undefined && (thenable.status = "rejected", thenable.reason = error41); } }); ioInfo = payload._ioInfo; @@ -198304,9 +143991,9 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix try { var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S; onStartTransitionFinish !== null && onStartTransitionFinish(currentTransition, returnValue); - typeof returnValue === "object" && returnValue !== null && typeof returnValue.then === "function" && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop9, reportGlobalError)); - } catch (error45) { - reportGlobalError(error45); + typeof returnValue === "object" && returnValue !== null && typeof returnValue.then === "function" && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop7, reportGlobalError)); + } catch (error41) { + reportGlobalError(error41); } finally { prevTransition === null && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")), prevTransition !== null && currentTransition.types !== null && (prevTransition.types !== null && prevTransition.types !== currentTransition.types && console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition; } @@ -198351,8 +144038,8 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix return recursivelyFlushAsyncActWork(returnValue, resolve10, reject2); }); return; - } catch (error45) { - ReactSharedInternals.thrownErrors.push(error45); + } catch (error41) { + ReactSharedInternals.thrownErrors.push(error41); } else ReactSharedInternals.actQueue = null; @@ -198380,8 +144067,8 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix } while (1); } queue.length = 0; - } catch (error45) { - queue.splice(0, i2 + 1), ReactSharedInternals.thrownErrors.push(error45); + } catch (error41) { + queue.splice(0, i2 + 1), ReactSharedInternals.thrownErrors.push(error41); } finally { isFlushing = false; } @@ -198455,21 +144142,21 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix var didWarnAboutElementRef = {}; var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(deprecatedAPIs, UnknownOwner)(); var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); - var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = typeof reportError === "function" ? reportError : function(error45) { + var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = typeof reportError === "function" ? reportError : function(error41) { if (typeof window === "object" && typeof window.ErrorEvent === "function") { var event = new window.ErrorEvent("error", { bubbles: true, cancelable: true, - message: typeof error45 === "object" && error45 !== null && typeof error45.message === "string" ? String(error45.message) : String(error45), - error: error45 + message: typeof error41 === "object" && error41 !== null && typeof error41.message === "string" ? String(error41.message) : String(error41), + error: error41 }); if (!window.dispatchEvent(event)) return; } else if (typeof process === "object" && typeof process.emit === "function") { - process.emit("uncaughtException", error45); + process.emit("uncaughtException", error41); return; } - console.error(error45); + console.error(error41); }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = typeof queueMicrotask === "function" ? function(callback) { queueMicrotask(function() { return queueMicrotask(callback); @@ -198523,8 +144210,8 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix var queue = ReactSharedInternals.actQueue = prevActQueue !== null ? prevActQueue : [], didAwaitActCall = false; try { var result2 = callback(); - } catch (error45) { - ReactSharedInternals.thrownErrors.push(error45); + } catch (error41) { + ReactSharedInternals.thrownErrors.push(error41); } if (0 < ReactSharedInternals.thrownErrors.length) throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback; @@ -198553,9 +144240,9 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix } } else resolve10(returnValue); - }, function(error45) { + }, function(error41) { popActScope(prevActQueue, prevActScopeDepth); - 0 < ReactSharedInternals.thrownErrors.length ? (error45 = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject2(error45)) : reject2(error45); + 0 < ReactSharedInternals.thrownErrors.length ? (error41 = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject2(error41)) : reject2(error41); }); } }; @@ -198751,12 +144438,12 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix var onStartGestureTransitionFinish = ReactSharedInternals.G; if (onStartGestureTransitionFinish !== null) return onStartGestureTransitionFinish(currentTransition, provider, options); - } catch (error45) { - reportGlobalError(error45); + } catch (error41) { + reportGlobalError(error41); } finally { ReactSharedInternals.T = prevTransition; } - return noop9; + return noop7; }; exports.unstable_useCacheRefresh = function() { return resolveDispatcher().useCacheRefresh(); @@ -199369,7 +145056,7 @@ var require_react_reconciler_constants_development = __commonJS((exports) => { }); // node_modules/react-reconciler/constants.js -var require_constants9 = __commonJS((exports, module) => { +var require_constants8 = __commonJS((exports, module) => { if (false) {} else { module.exports = require_react_reconciler_constants_development(); } @@ -201273,9 +146960,9 @@ function stopCapturingEarlyInput() { } function consumeEarlyInput() { stopCapturingEarlyInput(); - const input2 = earlyInputBuffer.trim(); + const input = earlyInputBuffer.trim(); earlyInputBuffer = ""; - return input2; + return input; } function hasEarlyInput() { return earlyInputBuffer.trim().length > 0; @@ -201571,14 +147258,14 @@ function createTokenizer(options) { let currentBuffer = ""; const x10Mouse = options?.x10Mouse ?? false; return { - feed(input2) { - const result2 = tokenize3(input2, currentState, currentBuffer, false, x10Mouse); + feed(input) { + const result2 = tokenize2(input, currentState, currentBuffer, false, x10Mouse); currentState = result2.state.state; currentBuffer = result2.state.buffer; return result2.tokens; }, flush() { - const result2 = tokenize3("", currentState, currentBuffer, true, x10Mouse); + const result2 = tokenize2("", currentState, currentBuffer, true, x10Mouse); currentState = result2.state.state; currentBuffer = result2.state.buffer; return result2.tokens; @@ -201592,13 +147279,13 @@ function createTokenizer(options) { } }; } -function tokenize3(input2, initialState, initialBuffer, flush, x10Mouse) { +function tokenize2(input, initialState, initialBuffer, flush, x10Mouse) { const tokens = []; const result2 = { state: initialState, buffer: "" }; - const data = initialBuffer + input2; + const data = initialBuffer + input; let i2 = 0; let textStart = 0; let seqStart = 0; @@ -201809,25 +147496,25 @@ function splitNumericParams(params) { return []; return params.split(";").map((p) => parseInt(p, 10)); } -function inputToString(input2) { - if (Buffer7.isBuffer(input2)) { - if (input2[0] > 127 && input2[1] === undefined) { - input2[0] -= 128; - return "\x1B" + String(input2); +function inputToString(input) { + if (Buffer7.isBuffer(input)) { + if (input[0] > 127 && input[1] === undefined) { + input[0] -= 128; + return "\x1B" + String(input); } else { - return String(input2); + return String(input); } - } else if (input2 !== undefined && typeof input2 !== "string") { - return String(input2); - } else if (!input2) { + } else if (input !== undefined && typeof input !== "string") { + return String(input); + } else if (!input) { return ""; } else { - return input2; + return input; } } -function parseMultipleKeypresses(prevState, input2 = "") { - const isFlush = input2 === null; - const inputString = isFlush ? "" : inputToString(input2); +function parseMultipleKeypresses(prevState, input = "") { + const isFlush = input === null; + const inputString = isFlush ? "" : inputToString(input); const tokenizer = prevState._tokenizer ?? createTokenizer({ x10Mouse: true }); const tokens = isFlush ? tokenizer.flush() : tokenizer.feed(inputString); const keys2 = []; @@ -202290,50 +147977,50 @@ function parseKey(keypress) { meta: keypress.meta || keypress.name === "escape" || keypress.option, super: keypress.super }; - let input2 = keypress.ctrl ? keypress.name : keypress.sequence; - if (input2 === undefined) { - input2 = ""; + let input = keypress.ctrl ? keypress.name : keypress.sequence; + if (input === undefined) { + input = ""; } - if (keypress.ctrl && input2 === "space") { - input2 = " "; + if (keypress.ctrl && input === "space") { + input = " "; } if (keypress.code && !keypress.name) { - input2 = ""; + input = ""; } - if (!keypress.name && /^\[<\d+;\d+;\d+[Mm]/.test(input2)) { - input2 = ""; + if (!keypress.name && /^\[<\d+;\d+;\d+[Mm]/.test(input)) { + input = ""; } - if (input2.startsWith("\x1B")) { - input2 = input2.slice(1); + if (input.startsWith("\x1B")) { + input = input.slice(1); } let processedAsSpecialSequence = false; - if (/^\[\d/.test(input2) && input2.endsWith("u")) { + if (/^\[\d/.test(input) && input.endsWith("u")) { if (!keypress.name) { - input2 = ""; + input = ""; } else { - input2 = keypress.name === "space" ? " " : keypress.name === "escape" ? "" : keypress.name; + input = keypress.name === "space" ? " " : keypress.name === "escape" ? "" : keypress.name; } processedAsSpecialSequence = true; } - if (input2.startsWith("[27;") && input2.endsWith("~")) { + if (input.startsWith("[27;") && input.endsWith("~")) { if (!keypress.name) { - input2 = ""; + input = ""; } else { - input2 = keypress.name === "space" ? " " : keypress.name === "escape" ? "" : keypress.name; + input = keypress.name === "space" ? " " : keypress.name === "escape" ? "" : keypress.name; } processedAsSpecialSequence = true; } - if (input2.startsWith("O") && input2.length === 2 && keypress.name && keypress.name.length === 1) { - input2 = keypress.name; + if (input.startsWith("O") && input.length === 2 && keypress.name && keypress.name.length === 1) { + input = keypress.name; processedAsSpecialSequence = true; } if (!processedAsSpecialSequence && keypress.name && nonAlphanumericKeys.includes(keypress.name)) { - input2 = ""; + input = ""; } - if (input2.length === 1 && typeof input2[0] === "string" && input2[0] >= "A" && input2[0] <= "Z") { + if (input.length === 1 && typeof input[0] === "string" && input[0] >= "A" && input[0] <= "Z") { key.shift = true; } - return [key, input2]; + return [key, input]; } var InputEvent; var init_input_event = __esm(() => { @@ -202344,10 +148031,10 @@ var init_input_event = __esm(() => { input; constructor(keypress) { super(); - const [key, input2] = parseKey(keypress); + const [key, input] = parseKey(keypress); this.keypress = keypress; this.key = key; - this.input = input2; + this.input = input; } }; }); @@ -202635,11 +148322,11 @@ var require_react_reconciler_development = __commonJS((exports, module) => { fiber = fiber.next, id--; return fiber; } - function copyWithSetImpl(obj, path12, index, value) { - if (index >= path12.length) + function copyWithSetImpl(obj, path10, index, value) { + if (index >= path10.length) return value; - var key = path12[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj); - updated[key] = copyWithSetImpl(obj[key], path12, index + 1, value); + var key = path10[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj); + updated[key] = copyWithSetImpl(obj[key], path10, index + 1, value); return updated; } function copyWithRename(obj, oldPath, newPath) { @@ -202659,11 +148346,11 @@ var require_react_reconciler_development = __commonJS((exports, module) => { index + 1 === oldPath.length ? (updated[newPath[index]] = updated[oldKey], isArrayImpl(updated) ? updated.splice(oldKey, 1) : delete updated[oldKey]) : updated[oldKey] = copyWithRenameImpl(obj[oldKey], oldPath, newPath, index + 1); return updated; } - function copyWithDeleteImpl(obj, path12, index) { - var key = path12[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj); - if (index + 1 === path12.length) + function copyWithDeleteImpl(obj, path10, index) { + var key = path10[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj); + if (index + 1 === path10.length) return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated; - updated[key] = copyWithDeleteImpl(obj[key], path12, index + 1); + updated[key] = copyWithDeleteImpl(obj[key], path10, index + 1); return updated; } function shouldSuspendImpl() { @@ -202687,8 +148374,8 @@ var require_react_reconciler_development = __commonJS((exports, module) => { flushSyncWork(); } } - function setRefreshHandler(handler2) { - resolveFamily2 = handler2; + function setRefreshHandler(handler8) { + resolveFamily2 = handler8; } function warnInvalidHookAccess() { console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks"); @@ -202696,7 +148383,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => { function warnInvalidContextAccess() { console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); } - function noop9() {} + function noop7() {} function warnForMissingKey() {} function setToSortedString(set3) { var array2 = []; @@ -203213,7 +148900,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => { return hook.checkDCE ? true : false; } function setIsStrictModeForDevtools(newIsStrictMode) { - typeof log3 === "function" && unstable_setDisableYieldValue2(newIsStrictMode); + typeof log2 === "function" && unstable_setDisableYieldValue2(newIsStrictMode); if (injectedHook && typeof injectedHook.setStrictMode === "function") try { injectedHook.setStrictMode(rendererID, newIsStrictMode); @@ -203531,10 +149218,10 @@ var require_react_reconciler_development = __commonJS((exports, module) => { if (name !== null) { selfTime = []; for (var i2 = 0;i2 < errors3.length; i2++) { - var error45 = errors3[i2].value; + var error41 = errors3[i2].value; selfTime.push([ "Error", - typeof error45 === "object" && error45 !== null && typeof error45.message === "string" ? String(error45.message) : String(error45) + typeof error41 === "object" && error41 !== null && typeof error41.message === "string" ? String(error41.message) : String(error41) ]); } fiber.key !== null && addValueToProperties("key", fiber.key, selfTime, 0, ""); @@ -203575,10 +149262,10 @@ var require_react_reconciler_development = __commonJS((exports, module) => { function logCommitErrored(startTime, endTime, errors3, passive, debugTask) { if (supportsUserTiming && !(endTime <= startTime)) { for (var properties = [], i2 = 0;i2 < errors3.length; i2++) { - var error45 = errors3[i2].value; + var error41 = errors3[i2].value; properties.push([ "Error", - typeof error45 === "object" && error45 !== null && typeof error45.message === "string" ? String(error45.message) : String(error45) + typeof error41 === "object" && error41 !== null && typeof error41.message === "string" ? String(error41.message) : String(error41) ]); } startTime = { @@ -203651,24 +149338,24 @@ var require_react_reconciler_development = __commonJS((exports, module) => { } 0 > disabledDepth && console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } - function formatOwnerStack(error45) { + function formatOwnerStack(error41) { var prevPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = undefined; - error45 = error45.stack; + error41 = error41.stack; Error.prepareStackTrace = prevPrepareStackTrace; - error45.startsWith(`Error: react-stack-top-frame -`) && (error45 = error45.slice(29)); - prevPrepareStackTrace = error45.indexOf(` + error41.startsWith(`Error: react-stack-top-frame +`) && (error41 = error41.slice(29)); + prevPrepareStackTrace = error41.indexOf(` `); - prevPrepareStackTrace !== -1 && (error45 = error45.slice(prevPrepareStackTrace + 1)); - prevPrepareStackTrace = error45.indexOf("react_stack_bottom_frame"); - prevPrepareStackTrace !== -1 && (prevPrepareStackTrace = error45.lastIndexOf(` + prevPrepareStackTrace !== -1 && (error41 = error41.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error41.indexOf("react_stack_bottom_frame"); + prevPrepareStackTrace !== -1 && (prevPrepareStackTrace = error41.lastIndexOf(` `, prevPrepareStackTrace)); if (prevPrepareStackTrace !== -1) - error45 = error45.slice(0, prevPrepareStackTrace); + error41 = error41.slice(0, prevPrepareStackTrace); else return ""; - return error45; + return error41; } function describeBuiltInComponentFrame(name) { if (prefix === undefined) @@ -203816,7 +149503,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => { if (typeof entry.name === "string") { var JSCompiler_temp_const = info; a: { - var { name, env: env5, debugLocation: location } = entry; + var { name, env: env4, debugLocation: location } = entry; if (location != null) { var childStack = formatOwnerStack(location), idx = childStack.lastIndexOf(` `), lastLine = idx === -1 ? childStack : childStack.slice(idx + 1); @@ -203826,7 +149513,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => { break a; } } - JSCompiler_inline_result = describeBuiltInComponentFrame(name + (env5 ? " [" + env5 + "]" : "")); + JSCompiler_inline_result = describeBuiltInComponentFrame(name + (env4 ? " [" + env4 + "]" : "")); } info = JSCompiler_temp_const + JSCompiler_inline_result; } @@ -204385,8 +150072,8 @@ https://react.dev/link/hydration-mismatch` + diff), fiber)); queuedErrors !== null && (workInProgressRootRecoverableErrors === null ? workInProgressRootRecoverableErrors = queuedErrors : workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, queuedErrors), hydrationErrors = null); return queuedErrors; } - function queueHydrationError(error45) { - hydrationErrors === null ? hydrationErrors = [error45] : hydrationErrors.push(error45); + function queueHydrationError(error41) { + hydrationErrors === null ? hydrationErrors = [error41] : hydrationErrors.push(error41); } function emitPendingHydrationWarnings() { var diffRoot = hydrationDiffRootDEV; @@ -204928,11 +150615,11 @@ It can also happen if the client has a browser extension installed which messes thenableWithOverride.value = result2; for (var i2 = 0;i2 < listeners.length; i2++) (0, listeners[i2])(result2); - }, function(error45) { + }, function(error41) { thenableWithOverride.status = "rejected"; - thenableWithOverride.reason = error45; - for (error45 = 0;error45 < listeners.length; error45++) - (0, listeners[error45])(undefined); + thenableWithOverride.reason = error41; + for (error41 = 0;error41 < listeners.length; error41++) + (0, listeners[error41])(undefined); }); return thenableWithOverride; } @@ -205077,11 +150764,11 @@ It can also happen if the client has a browser extension installed which messes fulfilledThenable.status = "fulfilled"; fulfilledThenable.value = fulfilledValue; } - }, function(error45) { + }, function(error41) { if (thenable.status === "pending") { var rejectedThenable = thenable; rejectedThenable.status = "rejected"; - rejectedThenable.reason = error45; + rejectedThenable.reason = error41; } }); } @@ -205883,11 +151570,11 @@ Please update the following component: %s`, componentName2); pop(currentTreeHiddenStackCursor, fiber); pop(prevEntangledRenderLanesCursor, fiber); } - function pushPrimaryTreeSuspenseHandler(handler2) { - var current2 = handler2.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & SubtreeSuspenseContextMask, handler2); - push(suspenseHandlerStackCursor, handler2, handler2); - shellBoundary === null && (current2 === null || currentTreeHiddenStackCursor.current !== null ? shellBoundary = handler2 : current2.memoizedState !== null && (shellBoundary = handler2)); + function pushPrimaryTreeSuspenseHandler(handler8) { + var current2 = handler8.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & SubtreeSuspenseContextMask, handler8); + push(suspenseHandlerStackCursor, handler8, handler8); + shellBoundary === null && (current2 === null || currentTreeHiddenStackCursor.current !== null ? shellBoundary = handler8 : current2.memoizedState !== null && (shellBoundary = handler8)); } function pushDehydratedActivitySuspenseHandler(fiber) { push(suspenseStackCursor, suspenseStackCursor.current, fiber); @@ -206399,7 +152086,7 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); - } catch (error45) { + } catch (error41) { return true; } } @@ -206503,8 +152190,8 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next var returnValue = action(prevState, payload), onStartTransitionFinish = ReactSharedInternals.S; onStartTransitionFinish !== null && onStartTransitionFinish(currentTransition, returnValue); handleActionReturnValue(actionQueue, node, returnValue); - } catch (error45) { - onActionError(actionQueue, node, error45); + } catch (error41) { + onActionError(actionQueue, node, error41); } finally { prevTransition !== null && currentTransition.types !== null && (prevTransition.types !== null && prevTransition.types !== currentTransition.types && console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition, prevTransition === null && currentTransition._updatedFibers && (actionQueue = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < actionQueue && console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")); } @@ -206518,8 +152205,8 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next function handleActionReturnValue(actionQueue, node, returnValue) { returnValue !== null && typeof returnValue === "object" && typeof returnValue.then === "function" ? (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(function(nextState) { onActionSuccess(actionQueue, node, nextState); - }, function(error45) { - return onActionError(actionQueue, node, error45); + }, function(error41) { + return onActionError(actionQueue, node, error41); }), node.isTransition || console.error("An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop.")) : onActionSuccess(actionQueue, node, returnValue); } function onActionSuccess(actionQueue, actionNode, nextState) { @@ -206530,13 +152217,13 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next actionNode = actionQueue.pending; actionNode !== null && (nextState = actionNode.next, nextState === actionNode ? actionQueue.pending = null : (nextState = nextState.next, actionNode.next = nextState, runActionStateAction(actionQueue, nextState))); } - function onActionError(actionQueue, actionNode, error45) { + function onActionError(actionQueue, actionNode, error41) { var last2 = actionQueue.pending; actionQueue.pending = null; if (last2 !== null) { last2 = last2.next; do - actionNode.status = "rejected", actionNode.reason = error45, notifyActionListeners(actionNode), actionNode = actionNode.next; + actionNode.status = "rejected", actionNode.reason = error41, notifyActionListeners(actionNode), actionNode = actionNode.next; while (actionNode !== last2); } actionQueue.action = null; @@ -206823,8 +152510,8 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next dispatchSetStateInternal(fiber, queue, thenableForFinishedState, requestUpdateLane(fiber)); } else dispatchSetStateInternal(fiber, queue, finishedState, requestUpdateLane(fiber)); - } catch (error45) { - dispatchSetStateInternal(fiber, queue, { then: function() {}, status: "rejected", reason: error45 }, requestUpdateLane(fiber)); + } catch (error41) { + dispatchSetStateInternal(fiber, queue, { then: function() {}, status: "rejected", reason: error41 }, requestUpdateLane(fiber)); } finally { setCurrentUpdatePriority(previousPriority), prevTransition !== null && currentTransition.types !== null && (prevTransition.types !== null && prevTransition.types !== currentTransition.types && console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition, prevTransition === null && currentTransition._updatedFibers && (fiber = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < fiber && console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")); } @@ -206964,7 +152651,7 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next update2.eagerState = eagerState; if (objectIs(eagerState, currentState)) return enqueueUpdate$1(fiber, queue, update2, 0), workInProgressRoot === null && finishQueueingConcurrentUpdates(), false; - } catch (error45) {} finally { + } catch (error41) {} finally { ReactSharedInternals.H = prevDispatcher; } } @@ -207105,12 +152792,12 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next try { componentName = errorInfo.source ? getComponentNameFromFiber(errorInfo.source) : null; errorBoundaryName = null; - var error45 = errorInfo.value; + var error41 = errorInfo.value; if (ReactSharedInternals.actQueue !== null) - ReactSharedInternals.thrownErrors.push(error45); + ReactSharedInternals.thrownErrors.push(error41); else { var onUncaughtError = root2.onUncaughtError; - onUncaughtError(error45, { componentStack: errorInfo.stack }); + onUncaughtError(error41, { componentStack: errorInfo.stack }); } } catch (e) { setTimeout(function() { @@ -207150,9 +152837,9 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next function initializeClassErrorUpdate(update2, root2, fiber, errorInfo) { var getDerivedStateFromError = fiber.type.getDerivedStateFromError; if (typeof getDerivedStateFromError === "function") { - var error45 = errorInfo.value; + var error41 = errorInfo.value; update2.payload = function() { - return getDerivedStateFromError(error45); + return getDerivedStateFromError(error41); }; update2.callback = function() { markFailedErrorBoundaryForHotReloading(fiber); @@ -207197,8 +152884,8 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next } if (isHydrating) return didSuspendOrErrorDEV = true, returnFiber = suspenseHandlerStackCursor.current, returnFiber !== null ? (returnFiber.tag === 19 && console.error("SuspenseList should never catch while hydrating. This is a bug in React."), (returnFiber.flags & 65536) === 0 && (returnFiber.flags |= 256), returnFiber.flags |= 65536, returnFiber.lanes = rootRenderLanes, value !== HydrationMismatchException && queueHydrationError(createCapturedValueAtFiber(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", { cause: value }), sourceFiber))) : (value !== HydrationMismatchException && queueHydrationError(createCapturedValueAtFiber(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.", { cause: value }), sourceFiber)), root2 = root2.current.alternate, root2.flags |= 65536, rootRenderLanes &= -rootRenderLanes, root2.lanes |= rootRenderLanes, value = createCapturedValueAtFiber(value, sourceFiber), rootRenderLanes = createRootErrorUpdate(root2.stateNode, value, rootRenderLanes), enqueueCapturedUpdate(root2, rootRenderLanes), workInProgressRootExitStatus !== RootSuspendedWithDelay && (workInProgressRootExitStatus = RootErrored)), false; - var error45 = createCapturedValueAtFiber(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", { cause: value }), sourceFiber); - workInProgressRootConcurrentErrors === null ? workInProgressRootConcurrentErrors = [error45] : workInProgressRootConcurrentErrors.push(error45); + var error41 = createCapturedValueAtFiber(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", { cause: value }), sourceFiber); + workInProgressRootConcurrentErrors === null ? workInProgressRootConcurrentErrors = [error41] : workInProgressRootConcurrentErrors.push(error41); workInProgressRootExitStatus !== RootSuspendedWithDelay && (workInProgressRootExitStatus = RootErrored); if (returnFiber === null) return true; @@ -207210,8 +152897,8 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next return sourceFiber.flags |= 65536, root2 = rootRenderLanes & -rootRenderLanes, sourceFiber.lanes |= root2, root2 = createRootErrorUpdate(sourceFiber.stateNode, value, root2), enqueueCapturedUpdate(sourceFiber, root2), false; case 1: returnFiber = sourceFiber.type; - error45 = sourceFiber.stateNode; - if ((sourceFiber.flags & 128) === 0 && (typeof returnFiber.getDerivedStateFromError === "function" || error45 !== null && typeof error45.componentDidCatch === "function" && (legacyErrorBoundariesThatAlreadyFailed === null || !legacyErrorBoundariesThatAlreadyFailed.has(error45)))) + error41 = sourceFiber.stateNode; + if ((sourceFiber.flags & 128) === 0 && (typeof returnFiber.getDerivedStateFromError === "function" || error41 !== null && typeof error41.componentDidCatch === "function" && (legacyErrorBoundariesThatAlreadyFailed === null || !legacyErrorBoundariesThatAlreadyFailed.has(error41)))) return sourceFiber.flags |= 65536, rootRenderLanes &= -rootRenderLanes, sourceFiber.lanes |= rootRenderLanes, rootRenderLanes = createClassErrorUpdate(rootRenderLanes), initializeClassErrorUpdate(rootRenderLanes, root2, sourceFiber, value), enqueueCapturedUpdate(sourceFiber, rootRenderLanes), false; break; case 22: @@ -208738,8 +154425,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); } - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) { @@ -208756,8 +154443,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); } - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } function commitHookPassiveMountEffects(finishedWork, hookFlags) { @@ -208773,8 +154460,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || (instance.props !== finishedWork.memoizedProps && console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"), instance.state !== finishedWork.memoizedState && console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance")); try { runWithFiberInDEV(finishedWork, commitCallbacks, updateQueue, instance); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } } @@ -208793,8 +154480,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork)); })); current2.__reactInternalSnapshotBeforeUpdate = snapshot; - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) { @@ -208841,8 +154528,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet function safelyAttachRef(current2, nearestMountedAncestor) { try { runWithFiberInDEV(current2, commitAttachRef, current2); - } catch (error45) { - captureCommitPhaseError(current2, nearestMountedAncestor, error45); + } catch (error41) { + captureCommitPhaseError(current2, nearestMountedAncestor, error41); } } function safelyDetachRef(current2, nearestMountedAncestor) { @@ -208858,8 +154545,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet } else runWithFiberInDEV(current2, refCleanup); - } catch (error45) { - captureCommitPhaseError(current2, nearestMountedAncestor, error45); + } catch (error41) { + captureCommitPhaseError(current2, nearestMountedAncestor, error41); } finally { current2.refCleanup = null, current2 = current2.alternate, current2 != null && (current2.refCleanup = null); } @@ -208908,15 +154595,15 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet var { type, memoizedProps: props, stateNode: instance } = finishedWork; try { runWithFiberInDEV(finishedWork, commitMount, instance, type, props, finishedWork); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } function commitHostUpdate(finishedWork, newProps, oldProps) { try { runWithFiberInDEV(finishedWork, commitUpdate, finishedWork.stateNode, finishedWork.type, oldProps, newProps, finishedWork); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } function commitNewChildToFragmentInstances(fiber, parentFragmentInstances) { @@ -209029,16 +154716,16 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet portal = portal.containerInfo; try { runWithFiberInDEV(finishedWork, replaceContainerChildren, portal, pendingChildren); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } function commitHostSingletonAcquisition(finishedWork) { var { stateNode: singleton, memoizedProps: props } = finishedWork; try { runWithFiberInDEV(finishedWork, acquireSingletonInstance, finishedWork.type, props, singleton, finishedWork); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } function trackEnterViewTransitions$1(placement) { @@ -209382,8 +155069,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet } try { runWithFiberInDEV(finishedWork, commitCallbacks, flags, prevProps); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } finishedRoot.effectDuration += popNestedEffectDurations(current2); @@ -209402,8 +155089,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet prevProps = finishedWork.stateNode; try { runWithFiberInDEV(finishedWork, commitHydratedInstance, prevProps, finishedRoot, current2, finishedWork); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } } @@ -209417,8 +155104,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet finishedRoot.effectDuration += bubbleNestedEffectDurations(flags); try { runWithFiberInDEV(finishedWork, commitProfiler, finishedWork, current2, commitStartTime, finishedRoot.effectDuration); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -209473,8 +155160,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet try { var instance = fiber.stateNode; isHidden ? runWithFiberInDEV(fiber, hideInstance, instance) : runWithFiberInDEV(fiber, unhideInstance, fiber.stateNode, fiber.memoizedProps); - } catch (error45) { - captureCommitPhaseError(fiber, fiber.return, error45); + } catch (error41) { + captureCommitPhaseError(fiber, fiber.return, error41); } hideOrUnhideNearestPortals(fiber, isHidden); break; @@ -209483,16 +155170,16 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet var instance$jscomp$0 = fiber.stateNode; isHidden ? runWithFiberInDEV(fiber, hideTextInstance, instance$jscomp$0) : runWithFiberInDEV(fiber, unhideTextInstance, instance$jscomp$0, fiber.memoizedProps); viewTransitionMutationContext = true; - } catch (error45) { - captureCommitPhaseError(fiber, fiber.return, error45); + } catch (error41) { + captureCommitPhaseError(fiber, fiber.return, error41); } break; case 18: try { var instance$jscomp$1 = fiber.stateNode; isHidden ? runWithFiberInDEV(fiber, hideDehydratedBoundary, instance$jscomp$1) : runWithFiberInDEV(fiber, unhideDehydratedBoundary, fiber.stateNode); - } catch (error45) { - captureCommitPhaseError(fiber, fiber.return, error45); + } catch (error41) { + captureCommitPhaseError(fiber, fiber.return, error41); } break; case 22: @@ -209577,14 +155264,14 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet if (hostParentIsContainer) try { runWithFiberInDEV(deletedFiber, removeChildFromContainer, hostParent, deletedFiber.stateNode), viewTransitionMutationContext = true; - } catch (error45) { - captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error45); + } catch (error41) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error41); } else try { runWithFiberInDEV(deletedFiber, removeChild, hostParent, deletedFiber.stateNode), viewTransitionMutationContext = true; - } catch (error45) { - captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error45); + } catch (error41) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error41); } } else recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); @@ -209638,8 +155325,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet finishedRoot = finishedRoot.dehydrated; try { runWithFiberInDEV(finishedWork, commitHydratedActivityInstance, finishedRoot); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } } @@ -209647,8 +155334,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet if (supportsHydration && finishedWork.memoizedState === null && (finishedRoot = finishedWork.alternate, finishedRoot !== null && (finishedRoot = finishedRoot.memoizedState, finishedRoot !== null && (finishedRoot = finishedRoot.dehydrated, finishedRoot !== null)))) try { runWithFiberInDEV(finishedWork, commitHydratedSuspenseInstance, finishedRoot); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } function getRetryCache(finishedWork) { @@ -209775,8 +155462,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet root2 = finishedWork.stateNode; try { runWithFiberInDEV(finishedWork, resetTextContent, root2), viewTransitionMutationContext = true; - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } flags & 4 && finishedWork.stateNode != null && (root2 = finishedWork.memoizedProps, commitHostUpdate(finishedWork, root2, current2 !== null ? current2.memoizedProps : root2)); @@ -209795,8 +155482,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet current2 = finishedWork.stateNode; try { runWithFiberInDEV(finishedWork, commitTextUpdate, current2, lanes, root2), viewTransitionMutationContext = true; - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } break; @@ -209816,16 +155503,16 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet if (supportsMutation && supportsHydration && current2 !== null && current2.memoizedState.isDehydrated) try { runWithFiberInDEV(finishedWork, commitHydratedContainer, root2.containerInfo); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } if (supportsPersistence) { current2 = root2.containerInfo; flags = root2.pendingChildren; try { runWithFiberInDEV(finishedWork, replaceContainerChildren, current2, flags), viewTransitionMutationContext = true; - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } } @@ -209913,8 +155600,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet if (flags & 2) { try { runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } finishedWork.flags &= -3; } @@ -210053,8 +155740,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet finishedRoot = finishedWork.stateNode; try { runWithFiberInDEV(finishedWork, commitHiddenCallbacks, current2, finishedRoot); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -210084,8 +155771,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet includeWorkInProgressEffects.effectDuration += bubbleNestedEffectDurations(flags); try { runWithFiberInDEV(finishedWork, commitProfiler, finishedWork, current2, commitStartTime, includeWorkInProgressEffects.effectDuration); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } else recursivelyTraverseReappearLayoutEffects(finishedRoot, finishedWork, includeWorkInProgressEffects); @@ -210177,8 +155864,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet finishedRoot.passiveEffectDuration += bubbleNestedEffectDurations(flags); try { runWithFiberInDEV(finishedWork, commitProfilerPostCommitImpl, finishedWork, finishedWork.alternate, commitStartTime, finishedRoot.passiveEffectDuration); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } else recursivelyTraversePassiveMountEffects(finishedRoot, finishedWork, committedLanes, committedTransitions, endTime); @@ -211162,7 +156849,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet try { if (!objectIs(getSnapshot(), check3)) return false; - } catch (error45) { + } catch (error41) { return false; } } @@ -211378,8 +157065,8 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet erroredWork === null ? (workInProgressRootExitStatus = RootFatalErrored, logUncaughtError(root2, createCapturedValueAtFiber(thrownValue, root2.current))) : erroredWork.mode & 2 && stopProfilerTimerIfRunningAndRecordDuration(erroredWork); } function shouldRemainOnPreviousScreen() { - var handler2 = suspenseHandlerStackCursor.current; - return handler2 === null ? true : (workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? shellBoundary === null ? true : false : (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes || (workInProgressRootRenderLanes & 536870912) !== 0 ? handler2 === shellBoundary : false; + var handler8 = suspenseHandlerStackCursor.current; + return handler8 === null ? true : (workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? shellBoundary === null ? true : false : (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes || (workInProgressRootRenderLanes & 536870912) !== 0 ? handler8 === shellBoundary : false; } function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; @@ -211616,9 +157303,9 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet workInProgress = null; return; } - } catch (error45) { + } catch (error41) { if (returnFiber !== null) - throw workInProgress = returnFiber, error45; + throw workInProgress = returnFiber, error41; workInProgressRootExitStatus = RootFatalErrored; logUncaughtError(root2, createCapturedValueAtFiber(thrownValue, root2.current)); workInProgress = null; @@ -211703,10 +157390,10 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet var startTime = completedRenderStartTime, endTime = completedRenderEndTime, hydrationFailed = finishedWork !== null && finishedWork.alternate !== null && finishedWork.alternate.memoizedState.isDehydrated && (finishedWork.flags & 256) !== 0, debugTask = workInProgressUpdateTask; if (supportsUserTiming && !(endTime <= startTime)) { for (var properties = [], i2 = 0;i2 < recoverableErrors.length; i2++) { - var error45 = recoverableErrors[i2].value; + var error41 = recoverableErrors[i2].value; properties.push([ "Recoverable Error", - typeof error45 === "object" && error45 !== null && typeof error45.message === "string" ? String(error45.message) : String(error45) + typeof error41 === "object" && error41 !== null && typeof error41.message === "string" ? String(error41.message) : String(error41) ]); } startTime = { @@ -211812,10 +157499,10 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet pendingEffectsStatus = PENDING_MUTATION_PHASE; shouldStartViewTransition ? (animatingLanes |= lanes, animatingTask = null, pendingViewTransition = startViewTransition(suspendedState, root2.containerInfo, pendingTransitionTypes, flushMutationEffects, flushLayoutEffects, flushAfterMutationEffects, flushSpawnedWork, flushPassiveEffects, reportViewTransitionError, suspendedViewTransition, finishedViewTransition.bind(null, lanes))) : (flushMutationEffects(), flushLayoutEffects(), flushSpawnedWork()); } - function reportViewTransitionError(error45) { + function reportViewTransitionError(error41) { if (pendingEffectsStatus !== NO_PENDING_EFFECTS) { var onRecoverableError = pendingEffectsRoot.onRecoverableError; - onRecoverableError(error45, makeErrorInfo(null)); + onRecoverableError(error41, makeErrorInfo(null)); } } function suspendedViewTransition(reason) { @@ -212138,31 +157825,31 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = renderPriority, releaseRootPooledCache(root2, remainingLanes); } } - function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error45) { - sourceFiber = createCapturedValueAtFiber(error45, sourceFiber); + function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error41) { + sourceFiber = createCapturedValueAtFiber(error41, sourceFiber); recordEffectError(sourceFiber); sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); rootFiber !== null && (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } - function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error45) { + function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error41) { isRunningInsertionEffect = false; if (sourceFiber.tag === 3) - captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error45); + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error41); else { for (;nearestMountedAncestor !== null; ) { if (nearestMountedAncestor.tag === 3) { - captureCommitPhaseErrorOnRoot(nearestMountedAncestor, sourceFiber, error45); + captureCommitPhaseErrorOnRoot(nearestMountedAncestor, sourceFiber, error41); return; } if (nearestMountedAncestor.tag === 1) { var instance = nearestMountedAncestor.stateNode; if (typeof nearestMountedAncestor.type.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && (legacyErrorBoundariesThatAlreadyFailed === null || !legacyErrorBoundariesThatAlreadyFailed.has(instance))) { - sourceFiber = createCapturedValueAtFiber(error45, sourceFiber); + sourceFiber = createCapturedValueAtFiber(error41, sourceFiber); recordEffectError(sourceFiber); - error45 = createClassErrorUpdate(2); - instance = enqueueUpdate(nearestMountedAncestor, error45, 2); - instance !== null && (initializeClassErrorUpdate(error45, instance, nearestMountedAncestor, sourceFiber), markRootUpdated$1(instance, 2), ensureRootIsScheduled(instance)); + error41 = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error41, 2); + instance !== null && (initializeClassErrorUpdate(error41, instance, nearestMountedAncestor, sourceFiber), markRootUpdated$1(instance, 2), ensureRootIsScheduled(instance)); return; } } @@ -212172,7 +157859,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet Error message: -%s`, error45); +%s`, error41); } } function attachPingListener(root2, wakeable, lanes) { @@ -212655,7 +158342,7 @@ Check the render method of %s.`, getComponentNameFromFiber(current) || "Unknown" var fiberStack = []; var index$jscomp$0 = -1, emptyContextObject = {}; Object.freeze(emptyContextObject); - var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log$1 = Math.log, LN2 = Math.LN2, nextTransitionUpdateLane = 256, nextTransitionDeferredLane = 262144, nextRetryLane = 4194304, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now$1 = Scheduler.unstable_now, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, IdlePriority = Scheduler.unstable_IdlePriority, log3 = Scheduler.log, unstable_setDisableYieldValue2 = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, hasLoggedError = false, isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined", globalClientIdCounter$1 = 0, lastResetTime = 0; + var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log$1 = Math.log, LN2 = Math.LN2, nextTransitionUpdateLane = 256, nextTransitionDeferredLane = 262144, nextRetryLane = 4194304, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now$1 = Scheduler.unstable_now, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, IdlePriority = Scheduler.unstable_IdlePriority, log2 = Scheduler.log, unstable_setDisableYieldValue2 = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, hasLoggedError = false, isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined", globalClientIdCounter$1 = 0, lastResetTime = 0; if (typeof performance === "object" && typeof performance.now === "function") { var localPerformance = performance; var getCurrentTime = function() { @@ -212667,21 +158354,21 @@ Check the render method of %s.`, getComponentNameFromFiber(current) || "Unknown" return localDate.now(); }; } - var objectIs = typeof Object.is === "function" ? Object.is : is, reportGlobalError = typeof reportError === "function" ? reportError : function(error45) { + var objectIs = typeof Object.is === "function" ? Object.is : is, reportGlobalError = typeof reportError === "function" ? reportError : function(error41) { if (typeof window === "object" && typeof window.ErrorEvent === "function") { var event = new window.ErrorEvent("error", { bubbles: true, cancelable: true, - message: typeof error45 === "object" && error45 !== null && typeof error45.message === "string" ? String(error45.message) : String(error45), - error: error45 + message: typeof error41 === "object" && error41 !== null && typeof error41.message === "string" ? String(error41.message) : String(error41), + error: error41 }); if (!window.dispatchEvent(event)) return; } else if (typeof process === "object" && typeof process.emit === "function") { - process.emit("uncaughtException", error45); + process.emit("uncaughtException", error41); return; } - console.error(error45); + console.error(error41); }, hasOwnProperty28 = Object.prototype.hasOwnProperty, supportsUserTiming = typeof console !== "undefined" && typeof console.timeStamp === "function" && typeof performance !== "undefined" && typeof performance.measure === "function", currentTrack = "Blocking", alreadyWarnedForDeepEquality = false, reusableComponentDevToolDetails = { color: "primary", properties: null, @@ -212910,16 +158597,16 @@ Learn more about this warning here: https://react.dev/link/legacy-context`, sort react_stack_bottom_frame: function(finishedWork, instance) { try { instance.componentDidMount(); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } }, callComponentDidMountInDEV = callComponentDidMount.react_stack_bottom_frame.bind(callComponentDidMount), callComponentDidUpdate = { react_stack_bottom_frame: function(finishedWork, instance, prevProps, prevState, snapshot) { try { instance.componentDidUpdate(prevProps, prevState, snapshot); - } catch (error45) { - captureCommitPhaseError(finishedWork, finishedWork.return, error45); + } catch (error41) { + captureCommitPhaseError(finishedWork, finishedWork.return, error41); } } }, callComponentDidUpdateInDEV = callComponentDidUpdate.react_stack_bottom_frame.bind(callComponentDidUpdate), callComponentDidCatch = { @@ -212933,8 +158620,8 @@ Learn more about this warning here: https://react.dev/link/legacy-context`, sort react_stack_bottom_frame: function(current2, nearestMountedAncestor, instance) { try { instance.componentWillUnmount(); - } catch (error45) { - captureCommitPhaseError(current2, nearestMountedAncestor, error45); + } catch (error41) { + captureCommitPhaseError(current2, nearestMountedAncestor, error41); } } }, callComponentWillUnmountInDEV = callComponentWillUnmount.react_stack_bottom_frame.bind(callComponentWillUnmount), callCreate = { @@ -212948,8 +158635,8 @@ Learn more about this warning here: https://react.dev/link/legacy-context`, sort react_stack_bottom_frame: function(current2, nearestMountedAncestor, destroy) { try { destroy(); - } catch (error45) { - captureCommitPhaseError(current2, nearestMountedAncestor, error45); + } catch (error41) { + captureCommitPhaseError(current2, nearestMountedAncestor, error41); } } }, callDestroyInDEV = callDestroy.react_stack_bottom_frame.bind(callDestroy), callLazyInit = { @@ -214077,29 +159764,29 @@ Check the top-level render call using <` + componentName2 + ">."); var didWarnAboutNestedUpdates = false; var didWarnAboutFindNodeInStrictMode = {}; var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null; - overrideHookState = function(fiber, id, path12, value) { + overrideHookState = function(fiber, id, path10, value) { id = findHook(fiber, id); - id !== null && (path12 = copyWithSetImpl(id.memoizedState, path12, 0, value), id.memoizedState = path12, id.baseState = path12, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path12 = enqueueConcurrentRenderForLane(fiber, 2), path12 !== null && scheduleUpdateOnFiber(path12, fiber, 2)); + id !== null && (path10 = copyWithSetImpl(id.memoizedState, path10, 0, value), id.memoizedState = path10, id.baseState = path10, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path10 = enqueueConcurrentRenderForLane(fiber, 2), path10 !== null && scheduleUpdateOnFiber(path10, fiber, 2)); }; - overrideHookStateDeletePath = function(fiber, id, path12) { + overrideHookStateDeletePath = function(fiber, id, path10) { id = findHook(fiber, id); - id !== null && (path12 = copyWithDeleteImpl(id.memoizedState, path12, 0), id.memoizedState = path12, id.baseState = path12, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path12 = enqueueConcurrentRenderForLane(fiber, 2), path12 !== null && scheduleUpdateOnFiber(path12, fiber, 2)); + id !== null && (path10 = copyWithDeleteImpl(id.memoizedState, path10, 0), id.memoizedState = path10, id.baseState = path10, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path10 = enqueueConcurrentRenderForLane(fiber, 2), path10 !== null && scheduleUpdateOnFiber(path10, fiber, 2)); }; overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) { id = findHook(fiber, id); id !== null && (oldPath = copyWithRename(id.memoizedState, oldPath, newPath), id.memoizedState = oldPath, id.baseState = oldPath, fiber.memoizedProps = assign2({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), oldPath !== null && scheduleUpdateOnFiber(oldPath, fiber, 2)); }; - overrideProps = function(fiber, path12, value) { - fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path12, 0, value); + overrideProps = function(fiber, path10, value) { + fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path10, 0, value); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path12 = enqueueConcurrentRenderForLane(fiber, 2); - path12 !== null && scheduleUpdateOnFiber(path12, fiber, 2); + path10 = enqueueConcurrentRenderForLane(fiber, 2); + path10 !== null && scheduleUpdateOnFiber(path10, fiber, 2); }; - overridePropsDeletePath = function(fiber, path12) { - fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path12, 0); + overridePropsDeletePath = function(fiber, path10) { + fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path10, 0); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path12 = enqueueConcurrentRenderForLane(fiber, 2); - path12 !== null && scheduleUpdateOnFiber(path12, fiber, 2); + path10 = enqueueConcurrentRenderForLane(fiber, 2); + path10 !== null && scheduleUpdateOnFiber(path10, fiber, 2); }; overridePropsRenamePath = function(fiber, oldPath, newPath) { fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath); @@ -214224,25 +159911,25 @@ Check the top-level render call using <` + componentName2 + ">."); exports2.createTextSelector = function(text) { return { $$typeof: TEXT_TYPE, value: text }; }; - exports2.defaultOnCaughtError = function(error45) { + exports2.defaultOnCaughtError = function(error41) { var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component." : "The above error occurred in one of your React components.", recreateMessage = "React will try to recreate this component tree from scratch using the error boundary you provided, " + ((errorBoundaryName || "Anonymous") + "."); - typeof error45 === "object" && error45 !== null && typeof error45.environmentName === "string" ? bindToConsole("error", [`%o + typeof error41 === "object" && error41 !== null && typeof error41.environmentName === "string" ? bindToConsole("error", [`%o %s %s -`, error45, componentNameMessage, recreateMessage], error45.environmentName)() : console.error(`%o +`, error41, componentNameMessage, recreateMessage], error41.environmentName)() : console.error(`%o %s %s -`, error45, componentNameMessage, recreateMessage); +`, error41, componentNameMessage, recreateMessage); }; - exports2.defaultOnRecoverableError = function(error45) { - reportGlobalError(error45); + exports2.defaultOnRecoverableError = function(error41) { + reportGlobalError(error41); }; - exports2.defaultOnUncaughtError = function(error45) { - reportGlobalError(error45); + exports2.defaultOnUncaughtError = function(error41) { + reportGlobalError(error41); console.warn(`%s %s @@ -214458,7 +160145,7 @@ No matching component was found for: throw Error("Expected the form instance to be a HostComponent. This is a bug in React."); var queue = ensureFormComponentIsStateful(formFiber).queue; startHostActionTimer(formFiber); - startTransition(formFiber, queue, pendingState, NotPendingTransition, action === null ? noop9 : function() { + startTransition(formFiber, queue, pendingState, NotPendingTransition, action === null ? noop7 : function() { var transition = ReactSharedInternals.T; if (transition === null) console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition."); @@ -214647,13 +160334,13 @@ class YogaLayoutNode { this.yoga.setMaxHeightPercent(value); } setFlexDirection(dir) { - const map4 = { + const map3 = { row: FlexDirection.Row, "row-reverse": FlexDirection.RowReverse, column: FlexDirection.Column, "column-reverse": FlexDirection.ColumnReverse }; - this.yoga.setFlexDirection(map4[dir]); + this.yoga.setFlexDirection(map3[dir]); } setFlexGrow(value) { this.yoga.setFlexGrow(value); @@ -214668,35 +160355,35 @@ class YogaLayoutNode { this.yoga.setFlexBasisPercent(value); } setFlexWrap(wrap2) { - const map4 = { + const map3 = { nowrap: Wrap.NoWrap, wrap: Wrap.Wrap, "wrap-reverse": Wrap.WrapReverse }; - this.yoga.setFlexWrap(map4[wrap2]); + this.yoga.setFlexWrap(map3[wrap2]); } setAlignItems(align) { - const map4 = { + const map3 = { auto: Align.Auto, stretch: Align.Stretch, "flex-start": Align.FlexStart, center: Align.Center, "flex-end": Align.FlexEnd }; - this.yoga.setAlignItems(map4[align]); + this.yoga.setAlignItems(map3[align]); } setAlignSelf(align) { - const map4 = { + const map3 = { auto: Align.Auto, stretch: Align.Stretch, "flex-start": Align.FlexStart, center: Align.Center, "flex-end": Align.FlexEnd }; - this.yoga.setAlignSelf(map4[align]); + this.yoga.setAlignSelf(map3[align]); } setJustifyContent(justify) { - const map4 = { + const map3 = { "flex-start": Justify.FlexStart, center: Justify.Center, "flex-end": Justify.FlexEnd, @@ -214704,7 +160391,7 @@ class YogaLayoutNode { "space-around": Justify.SpaceAround, "space-evenly": Justify.SpaceEvenly }; - this.yoga.setJustifyContent(map4[justify]); + this.yoga.setJustifyContent(map3[justify]); } setDisplay(display) { this.yoga.setDisplay(display === "flex" ? Display.Flex : Display.None); @@ -214722,12 +160409,12 @@ class YogaLayoutNode { this.yoga.setPositionPercent(EDGE_MAP[edge], value); } setOverflow(overflow) { - const map4 = { + const map3 = { visible: Overflow.Visible, hidden: Overflow.Hidden, scroll: Overflow.Scroll }; - this.yoga.setOverflow(map4[overflow]); + this.yoga.setOverflow(map3[overflow]); } setMargin(edge, value) { this.yoga.setMargin(EDGE_MAP[edge], value); @@ -215360,7 +161047,7 @@ function splitCompoundSGRSequences(code) { } return ret.map((part) => `\x1B[${part}m`); } -function tokenize4(str, endChar = Number.POSITIVE_INFINITY) { +function tokenize3(str, endChar = Number.POSITIVE_INFINITY) { const ret = []; let visible = 0; let codeEndIndex = 0; @@ -215445,7 +161132,7 @@ function filterStartCodes(codes) { return codes.filter((c5) => !isEndCode(c5)); } function sliceAnsi(str, start, end) { - const tokens = tokenize4(str); + const tokens = tokenize3(str); let activeCodes = []; let position = 0; let result2 = ""; @@ -216436,15 +162123,15 @@ var require_route = __commonJS((exports, module) => { }; } function wrapConversion(toModel, graph) { - const path12 = [graph[toModel].parent, toModel]; + const path10 = [graph[toModel].parent, toModel]; let fn = conversions[graph[toModel].parent][toModel]; let cur = graph[toModel].parent; while (graph[cur].parent) { - path12.unshift(graph[cur].parent); + path10.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); cur = graph[cur].parent; } - fn.conversion = path12; + fn.conversion = path10; return fn; } module.exports = function(fromModel) { @@ -217170,7 +162857,7 @@ function collectListeners(target, event) { } function processDispatchQueue(listeners, event) { let previousNode; - for (const { node, handler: handler2, phase } of listeners) { + for (const { node, handler: handler8, phase } of listeners) { if (event._isImmediatePropagationStopped()) { break; } @@ -217181,9 +162868,9 @@ function processDispatchQueue(listeners, event) { event._setCurrentTarget(node); event._prepareForTarget(node); try { - handler2(event); - } catch (error45) { - logError2(error45); + handler8(event); + } catch (error41) { + logError2(error41); } previousNode = node; } @@ -217196,28 +162883,28 @@ function getEventPriority(eventType) { case "focus": case "blur": case "paste": - return import_constants15.DiscreteEventPriority; + return import_constants13.DiscreteEventPriority; case "resize": case "scroll": case "mousemove": - return import_constants15.ContinuousEventPriority; + return import_constants13.ContinuousEventPriority; default: - return import_constants15.DefaultEventPriority; + return import_constants13.DefaultEventPriority; } } class Dispatcher { currentEvent = null; - currentUpdatePriority = import_constants15.DefaultEventPriority; + currentUpdatePriority = import_constants13.DefaultEventPriority; discreteUpdates = null; resolveEventPriority() { - if (this.currentUpdatePriority !== import_constants15.NoEventPriority) { + if (this.currentUpdatePriority !== import_constants13.NoEventPriority) { return this.currentUpdatePriority; } if (this.currentEvent) { return getEventPriority(this.currentEvent.type); } - return import_constants15.DefaultEventPriority; + return import_constants13.DefaultEventPriority; } dispatch(target, event) { const previousEvent = this.currentEvent; @@ -217242,16 +162929,16 @@ class Dispatcher { dispatchContinuous(target, event) { const previousPriority = this.currentUpdatePriority; try { - this.currentUpdatePriority = import_constants15.ContinuousEventPriority; + this.currentUpdatePriority = import_constants13.ContinuousEventPriority; return this.dispatch(target, event); } finally { this.currentUpdatePriority = previousPriority; } } } -var import_constants15; +var import_constants13; var init_dispatcher = __esm(() => { - import_constants15 = __toESM(require_constants9(), 1); + import_constants13 = __toESM(require_constants8(), 1); init_log3(); init_event_handlers(); }); @@ -217849,8 +163536,8 @@ var init_reconciler = __esm(() => { if (true) { try { Promise.resolve().then(() => init_devtools()); - } catch (error45) { - if (error45.code === "ERR_MODULE_NOT_FOUND") { + } catch (error41) { + if (error41.code === "ERR_MODULE_NOT_FOUND") { console.warn(` The environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`, but this failed as it was not installed. Debugging with React Devtools requires it. @@ -217861,7 +163548,7 @@ $ npm install --save-dev react-devtools-core `.trim() + ` `); } else { - throw error45; + throw error41; } } } @@ -220100,8 +165787,8 @@ var init_CursorDeclarationContext = __esm(() => { }); // node_modules/convert-to-spaces/dist/index.js -var convertToSpaces = (input2, spaces = 2) => { - return input2.replace(/^\t+/gm, ($1) => " ".repeat($1.length * spaces)); +var convertToSpaces = (input, spaces = 2) => { + return input.replace(/^\t+/gm, ($1) => " ".repeat($1.length * spaces)); }, dist_default; var init_dist = __esm(() => { dist_default = convertToSpaces; @@ -220117,7 +165804,7 @@ var generateLineNumbers = (line, around) => { } return lineNumbers; }, codeExcerpt = (source, line, options = {}) => { - var _a3; + var _a2; if (typeof source !== "string") { throw new TypeError("Source code is missing."); } @@ -220128,7 +165815,7 @@ var generateLineNumbers = (line, around) => { if (line > lines.length) { return; } - return generateLineNumbers(line, (_a3 = options.around) !== null && _a3 !== undefined ? _a3 : 3).filter((line2) => lines[line2 - 1] !== undefined).map((line2) => ({ line: line2, value: lines[line2 - 1] })); + return generateLineNumbers(line, (_a2 = options.around) !== null && _a2 !== undefined ? _a2 : 3).filter((line2) => lines[line2 - 1] !== undefined).map((line2) => ({ line: line2, value: lines[line2 - 1] })); }, dist_default2; var init_dist2 = __esm(() => { init_dist(); @@ -220784,9 +166471,9 @@ function getStackUtils() { }); } function ErrorOverview({ - error: error45 + error: error41 }) { - const stack = error45.stack ? error45.stack.split(` + const stack = error41.stack ? error41.stack.split(` `).slice(1) : undefined; const origin2 = stack ? getStackUtils().parseLine(stack[0]) : undefined; const filePath = cleanupPath(origin2?.file); @@ -220823,7 +166510,7 @@ function ErrorOverview({ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, { children: [ " ", - error45.message + error41.message ] }, undefined, true, undefined, this) ] @@ -220869,10 +166556,10 @@ function ErrorOverview({ ] }, line_0, true, undefined, this)) }, undefined, false, undefined, this), - error45.stack && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, { + error41.stack && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, { marginTop: 1, flexDirection: "column", - children: error45.stack.split(` + children: error41.stack.split(` `).slice(1).map((line_1) => { const parsedLine = getStackUtils().parseLine(line_1); if (!parsedLine) { @@ -220919,8 +166606,8 @@ function ErrorOverview({ ] }, undefined, true, undefined, this); } -var import_stack_utils, jsx_dev_runtime6, cleanupPath = (path12) => { - return path12?.replace(`file://${process.cwd()}/`, ""); +var import_stack_utils, jsx_dev_runtime6, cleanupPath = (path10) => { + return path10?.replace(`file://${process.cwd()}/`, ""); }, stackUtils; var init_ErrorOverview = __esm(() => { init_dist2(); @@ -221088,9 +166775,9 @@ var init_App = __esm(() => { SUPPORTS_SUSPEND = process.platform !== "win32"; App = class App extends import_react10.PureComponent { static displayName = "InternalApp"; - static getDerivedStateFromError(error45) { + static getDerivedStateFromError(error41) { return { - error: error45 + error: error41 }; } state = { @@ -221168,8 +166855,8 @@ var init_App = __esm(() => { this.handleSetRawMode(false); } } - componentDidCatch(error45) { - this.handleExit(error45); + componentDidCatch(error41) { + this.handleExit(error41); } handleSetRawMode = (isEnabled) => { const { @@ -221231,8 +166918,8 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr } this.processInput(null); }; - processInput = (input2) => { - const [keys2, newState] = parseMultipleKeypresses(this.keyParseState, input2); + processInput = (input) => { + const [keys2, newState] = parseMultipleKeypresses(this.keyParseState, input); this.keyParseState = newState; if (keys2.length > 0) { reconciler_default.discreteUpdates(processKeysInBatch, this, keys2, undefined, undefined); @@ -221255,8 +166942,8 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr while ((chunk2 = this.props.stdin.read()) !== null) { this.processInput(chunk2); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); const { stdin } = this.props; @@ -221268,16 +166955,16 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr } } }; - handleInput = (input2) => { - if (input2 === "\x03" && this.props.exitOnCtrlC) { + handleInput = (input) => { + if (input === "\x03" && this.props.exitOnCtrlC) { this.handleExit(); } }; - handleExit = (error45) => { + handleExit = (error41) => { if (this.isRawModeSupported()) { this.handleSetRawMode(false); } - this.props.onExit(error45); + this.props.onExit(error41); }; handleTerminalFocus = (isFocused) => { setTerminalFocused(isFocused); @@ -221415,15 +167102,15 @@ function dispatchClick(root2, col, row, cellIsBlank = false) { const event = new ClickEvent(col, row, cellIsBlank); let handled = false; while (target) { - const handler2 = target._eventHandlers?.onClick; - if (handler2) { + const handler8 = target._eventHandlers?.onClick; + if (handler8) { handled = true; const rect = nodeCache.get(target); if (rect) { event.localCol = col - rect.x; event.localRow = row - rect.y; } - handler2(event); + handler8(event); if (event.didStopImmediatePropagation()) return true; } @@ -221961,10 +167648,10 @@ var require_bidi = __commonJS((exports, module) => { var NEUTRAL_ISOLATE_TYPES = TYPES.B | TYPES.S | TYPES.WS | TYPES.ON | TYPES.FSI | TYPES.LRI | TYPES.RLI | TYPES.PDI; var BN_LIKE_TYPES = TYPES.BN | TYPES.RLE | TYPES.LRE | TYPES.RLO | TYPES.LRO | TYPES.PDF; var TRAILING_TYPES = TYPES.S | TYPES.WS | TYPES.B | ISOLATE_INIT_TYPES | TYPES.PDI | BN_LIKE_TYPES; - var map4 = null; + var map3 = null; function parseData() { - if (!map4) { - map4 = new Map; + if (!map3) { + map3 = new Map; var loop = function(type2) { if (DATA.hasOwnProperty(type2)) { var lastCode = 0; @@ -221974,9 +167661,9 @@ var require_bidi = __commonJS((exports, module) => { var step = ref[1]; skip = parseInt(skip, 36); step = step ? parseInt(step, 36) : 0; - map4.set(lastCode += skip, TYPES[type2]); + map3.set(lastCode += skip, TYPES[type2]); for (var i2 = 0;i2 < step; i2++) { - map4.set(++lastCode, TYPES[type2]); + map3.set(++lastCode, TYPES[type2]); } }); } @@ -221987,7 +167674,7 @@ var require_bidi = __commonJS((exports, module) => { } function getBidiCharType(char) { parseData(); - return map4.get(char.codePointAt(0)) || TYPES.L; + return map3.get(char.codePointAt(0)) || TYPES.L; } function getBidiCharTypeName(char) { return TYPES_TO_NAMES[getBidiCharType(char)]; @@ -221999,7 +167686,7 @@ var require_bidi = __commonJS((exports, module) => { function parseCharacterMap(encodedString, includeReverse) { var radix = 36; var lastCode = 0; - var map5 = new Map; + var map4 = new Map; var reverseMap = includeReverse && new Map; var prevPair; encodedString.split(",").forEach(function visit(entry) { @@ -222014,19 +167701,19 @@ var require_bidi = __commonJS((exports, module) => { var b = ref[1]; a2 = String.fromCodePoint(lastCode += parseInt(a2, radix)); b = String.fromCodePoint(lastCode += parseInt(b, radix)); - map5.set(a2, b); + map4.set(a2, b); includeReverse && reverseMap.set(b, a2); } }); - return { map: map5, reverseMap }; + return { map: map4, reverseMap }; } var openToClose, closeToOpen, canonical; function parse$1() { if (!openToClose) { var ref = parseCharacterMap(data$1.pairs, true); - var map5 = ref.map; + var map4 = ref.map; var reverseMap = ref.reverseMap; - openToClose = map5; + openToClose = map4; closeToOpen = reverseMap; canonical = parseCharacterMap(data$1.canonical, false).map; } @@ -222575,12 +168262,12 @@ var require_bidi = __commonJS((exports, module) => { function parse7() { if (!mirrorMap) { var ref = parseCharacterMap(data, true); - var map5 = ref.map; + var map4 = ref.map; var reverseMap = ref.reverseMap; reverseMap.forEach(function(value, key) { - map5.set(key, value); + map4.set(key, value); }); - mirrorMap = map5; + mirrorMap = map4; } } function getMirroredCharacter(char) { @@ -222591,16 +168278,16 @@ var require_bidi = __commonJS((exports, module) => { var strLen = string4.length; start = Math.max(0, start == null ? 0 : +start); end = Math.min(strLen - 1, end == null ? strLen - 1 : +end); - var map5 = new Map; + var map4 = new Map; for (var i2 = start;i2 <= end; i2++) { if (embeddingLevels[i2] & 1) { var mirror = getMirroredCharacter(string4[i2]); if (mirror !== null) { - map5.set(i2, mirror); + map4.set(i2, mirror); } } } - return map5; + return map4; } function getReorderSegments(string4, embeddingLevelsResult, start, end) { var strLen = string4.length; @@ -223079,7 +168766,7 @@ function flushBuffer(buffer, styles5, stylePool, out) { function writeLineToScreen(screen, line, x2, y2, screenWidth, stylePool, charCache) { let characters = charCache.get(line); if (!characters) { - characters = reorderBidi(styledCharsWithGraphemeClustering(styledCharsFromTokens(tokenize4(line)), stylePool)); + characters = reorderBidi(styledCharsWithGraphemeClustering(styledCharsFromTokens(tokenize3(line)), stylePool)); charCache.set(line, characters); } let offsetX = x2; @@ -223480,14 +169167,14 @@ function wrapWithOsc8Link(text, url3) { return `${OSC3}8;;${url3}${BEL3}${text}${OSC3}8;;${BEL3}`; } function buildCharToSegmentMap(segments) { - const map4 = []; + const map3 = []; for (let i2 = 0;i2 < segments.length; i2++) { const len = segments[i2].text.length; for (let j = 0;j < len; j++) { - map4.push(i2); + map3.push(i2); } } - return map4; + return map3; } function applyStylesToWrappedText(wrappedPlain, segments, charToSegment, originalPlain, trimEnabled = false) { const lines = wrappedPlain.split(` @@ -224172,10 +169859,10 @@ function applyPositionedHighlight(screen, stylePool, positions, rowOffset, curre } return true; } -var import_constants17, timing; +var import_constants15, timing; var init_render_to_screen = __esm(() => { init_noop(); - import_constants17 = __toESM(require_constants9(), 1); + import_constants15 = __toESM(require_constants8(), 1); init_debug(); init_dom(); init_focus(); @@ -224488,7 +170175,7 @@ class Ink { }; } }; - this.container = reconciler_default.createContainer(this.rootNode, import_constants18.ConcurrentRoot, null, false, null, "id", noop_default, noop_default, noop_default, noop_default); + this.container = reconciler_default.createContainer(this.rootNode, import_constants16.ConcurrentRoot, null, false, null, "id", noop_default, noop_default, noop_default, noop_default); if (false) {} } handleResume = () => { @@ -225147,7 +170834,7 @@ class Ink { reconciler_default.updateContainerSync(tree, this.container, null, noop_default); reconciler_default.flushSyncWork(); } - unmount(error45) { + unmount(error41) { if (this.isUnmounted) { return; } @@ -225186,8 +170873,8 @@ class Ink { instances_default.delete(this.options.stdout); this.rootNode.yogaNode?.free(); this.rootNode.yogaNode = undefined; - if (error45 instanceof Error) { - this.rejectExitPromise(error45); + if (error41 instanceof Error) { + this.rejectExitPromise(error41); } else { this.resolveExitPromise(); } @@ -225301,11 +170988,11 @@ function drainStdin(stdin = process.stdin) { } } } -var import_constants18, jsx_dev_runtime8, ALT_SCREEN_ANCHOR_CURSOR, CURSOR_HOME_PATCH, ERASE_THEN_HOME_PATCH, CONSOLE_STDOUT_METHODS, CONSOLE_STDERR_METHODS; +var import_constants16, jsx_dev_runtime8, ALT_SCREEN_ANCHOR_CURSOR, CURSOR_HOME_PATCH, ERASE_THEN_HOME_PATCH, CONSOLE_STDOUT_METHODS, CONSOLE_STDERR_METHODS; var init_ink = __esm(() => { init_noop(); init_throttle(); - import_constants18 = __toESM(require_constants9(), 1); + import_constants16 = __toESM(require_constants8(), 1); init_mjs(); init_state(); init_yoga_layout(); @@ -225353,7 +171040,7 @@ var init_ink = __esm(() => { }); // src/ink/root.ts -import { Stream as Stream4 } from "stream"; +import { Stream as Stream2 } from "stream"; async function createRoot({ stdout = process.stdout, stdin = process.stdin, @@ -225404,7 +171091,7 @@ var renderSync = (node, options) => { logForDebugging(`[render] first ink render: ${Math.round(process.uptime() * 1000)}ms since process start`); return instance; }, root_default, getOptions = (stdout = {}) => { - if (stdout instanceof Stream4) { + if (stdout instanceof Stream2) { return { stdout, stdin: process.stdin @@ -226218,16 +171905,16 @@ function supportsHyperlinks(options) { if (stdoutSupported) { return true; } - const env5 = options?.env ?? process.env; - const termProgram = env5["TERM_PROGRAM"]; + const env4 = options?.env ?? process.env; + const termProgram = env4["TERM_PROGRAM"]; if (termProgram && ADDITIONAL_HYPERLINK_TERMINALS.includes(termProgram)) { return true; } - const lcTerminal = env5["LC_TERMINAL"]; + const lcTerminal = env4["LC_TERMINAL"]; if (lcTerminal && ADDITIONAL_HYPERLINK_TERMINALS.includes(lcTerminal)) { return true; } - const term = env5["TERM"]; + const term = env4["TERM"]; if (term?.includes("kitty")) { return true; } @@ -226813,8 +172500,8 @@ class Parser { this.inLink = false; this.linkUrl = undefined; } - feed(input2) { - const tokens = this.tokenizer.feed(input2); + feed(input) { + const tokens = this.tokenizer.feed(input); const actions = []; for (const token of tokens) { const tokenActions = this.processToken(token); @@ -226902,7 +172589,7 @@ class Parser { } } } -var init_parser4 = __esm(() => { +var init_parser3 = __esm(() => { init_intl(); init_ansi(); init_csi(); @@ -226914,13 +172601,13 @@ var init_parser4 = __esm(() => { // src/ink/termio.ts var init_termio = __esm(() => { - init_parser4(); + init_parser3(); }); // src/ink/Ansi.tsx -function parseToSpans(input2) { +function parseToSpans(input) { const parser = new Parser; - const actions = parser.feed(input2); + const actions = parser.feed(input); const spans = []; let currentHyperlink; for (const action of actions) { @@ -227765,8 +173452,8 @@ function useEventCallback(fn) { ref.current = fn; }, [fn]); return import_react18.useCallback((...args) => { - var _a3; - return (_a3 = ref.current) == null ? undefined : _a3.call(ref, ...args); + var _a2; + return (_a2 = ref.current) == null ? undefined : _a2.call(ref, ...args); }, [ref]); } function useUnmount(func) { @@ -227827,9 +173514,9 @@ var import_react19, useInput = (inputHandler, options = {}) => { if (options.isActive === false) { return; } - const { input: input2, key } = event; - if (!(input2 === "c" && key.ctrl) || !internal_exitOnCtrlC) { - inputHandler(input2, key, event); + const { input, key } = event; + if (!(input === "c" && key.ctrl) || !internal_exitOnCtrlC) { + inputHandler(input, key, event); } }); import_react19.useEffect(() => { @@ -228596,7 +174283,7 @@ function readdirp(root2, options = {}) { options.root = root2; return new ReaddirpStream(options); } -var EntryTypes, defaultOptions, RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR", NORMAL_FLOW_ERRORS, ALL_TYPES, DIR_TYPES, FILE_TYPES2, isNormalFlowError = (error45) => NORMAL_FLOW_ERRORS.has(error45.code), wantBigintFsStats, emptyFn = (_entryInfo) => true, normalizeFilter = (filter3) => { +var EntryTypes, defaultOptions, RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR", NORMAL_FLOW_ERRORS, ALL_TYPES, DIR_TYPES, FILE_TYPES2, isNormalFlowError = (error41) => NORMAL_FLOW_ERRORS.has(error41.code), wantBigintFsStats, emptyFn = (_entryInfo) => true, normalizeFilter = (filter3) => { if (filter3 === undefined) return emptyFn; if (typeof filter3 === "function") @@ -228660,7 +174347,7 @@ var init_esm2 = __esm(() => { this._directoryFilter = normalizeFilter(opts.directoryFilter); const statMethod = opts.lstat ? lstat2 : stat10; if (wantBigintFsStats) { - this._stat = (path12) => statMethod(path12, { bigint: true }); + this._stat = (path10) => statMethod(path10, { bigint: true }); } else { this._stat = statMethod; } @@ -228685,8 +174372,8 @@ var init_esm2 = __esm(() => { const par = this.parent; const fil = par && par.files; if (fil && fil.length > 0) { - const { path: path12, depth } = par; - const slice2 = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path12)); + const { path: path10, depth } = par; + const slice2 = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path10)); const awaited = await Promise.all(slice2); for (const entry of awaited) { if (!entry) @@ -228720,26 +174407,26 @@ var init_esm2 = __esm(() => { return; } } - } catch (error45) { - this.destroy(error45); + } catch (error41) { + this.destroy(error41); } finally { this.reading = false; } } - async _exploreDir(path12, depth) { + async _exploreDir(path10, depth) { let files; try { - files = await readdir6(path12, this._rdOptions); - } catch (error45) { - this._onError(error45); + files = await readdir6(path10, this._rdOptions); + } catch (error41) { + this._onError(error41); } - return { files, depth, path: path12 }; + return { files, depth, path: path10 }; } - async _formatEntry(dirent, path12) { + async _formatEntry(dirent, path10) { let entry; const basename5 = this._isDirent ? dirent.name : dirent; try { - const fullPath = presolve(pjoin(path12, basename5)); + const fullPath = presolve(pjoin(path10, basename5)); entry = { path: prelative(this._root, fullPath), fullPath, basename: basename5 }; entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); } catch (err) { @@ -228781,8 +174468,8 @@ var init_esm2 = __esm(() => { } return "directory"; } - } catch (error45) { - this._onError(error45); + } catch (error41) { + this._onError(error41); return ""; } } @@ -228799,20 +174486,20 @@ import { watchFile as watchFile3, unwatchFile as unwatchFile3, watch as fs_watch import { open as open4, stat as stat11, lstat as lstat3, realpath as fsrealpath } from "fs/promises"; import * as sysPath from "path"; import { type as osType } from "os"; -function createFsWatchInstance(path12, options, listener, errHandler, emitRaw) { +function createFsWatchInstance(path10, options, listener, errHandler, emitRaw) { const handleEvent = (rawEvent, evPath) => { - listener(path12); - emitRaw(rawEvent, evPath, { watchedPath: path12 }); - if (evPath && path12 !== evPath) { - fsWatchBroadcast(sysPath.resolve(path12, evPath), KEY_LISTENERS, sysPath.join(path12, evPath)); + listener(path10); + emitRaw(rawEvent, evPath, { watchedPath: path10 }); + if (evPath && path10 !== evPath) { + fsWatchBroadcast(sysPath.resolve(path10, evPath), KEY_LISTENERS, sysPath.join(path10, evPath)); } }; try { - return fs_watch(path12, { + return fs_watch(path10, { persistent: options.persistent }, handleEvent); - } catch (error45) { - errHandler(error45); + } catch (error41) { + errHandler(error41); return; } } @@ -228820,15 +174507,15 @@ function createFsWatchInstance(path12, options, listener, errHandler, emitRaw) { class NodeFsHandler { constructor(fsW) { this.fsw = fsW; - this._boundHandleError = (error45) => fsW._handleError(error45); + this._boundHandleError = (error41) => fsW._handleError(error41); } - _watchWithNodeFs(path12, listener) { + _watchWithNodeFs(path10, listener) { const opts = this.fsw.options; - const directory = sysPath.dirname(path12); - const basename6 = sysPath.basename(path12); + const directory = sysPath.dirname(path10); + const basename6 = sysPath.basename(path10); const parent2 = this.fsw._getWatchedDir(directory); parent2.add(basename6); - const absolutePath = sysPath.resolve(path12); + const absolutePath = sysPath.resolve(path10); const options = { persistent: opts.persistent }; @@ -228838,12 +174525,12 @@ class NodeFsHandler { if (opts.usePolling) { const enableBin = opts.interval !== opts.binaryInterval; options.interval = enableBin && isBinaryPath(basename6) ? opts.binaryInterval : opts.interval; - closer = setFsWatchFileListener(path12, absolutePath, options, { + closer = setFsWatchFileListener(path10, absolutePath, options, { listener, rawEmitter: this.fsw._emitRaw }); } else { - closer = setFsWatchListener(path12, absolutePath, options, { + closer = setFsWatchListener(path10, absolutePath, options, { listener, errHandler: this._boundHandleError, rawEmitter: this.fsw._emitRaw @@ -228861,7 +174548,7 @@ class NodeFsHandler { let prevStats = stats; if (parent2.has(basename6)) return; - const listener = async (path12, newStats) => { + const listener = async (path10, newStats) => { if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5)) return; if (!newStats || newStats.mtimeMs === 0) { @@ -228875,15 +174562,15 @@ class NodeFsHandler { this.fsw._emit(EV.CHANGE, file2, newStats2); } if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) { - this.fsw._closeFile(path12); + this.fsw._closeFile(path10); prevStats = newStats2; const closer2 = this._watchWithNodeFs(file2, listener); if (closer2) - this.fsw._addPathCloser(path12, closer2); + this.fsw._addPathCloser(path10, closer2); } else { prevStats = newStats2; } - } catch (error45) { + } catch (error41) { this.fsw._remove(dirname15, basename6); } } else if (parent2.has(basename6)) { @@ -228903,7 +174590,7 @@ class NodeFsHandler { } return closer; } - async _handleSymlink(entry, directory, path12, item) { + async _handleSymlink(entry, directory, path10, item) { if (this.fsw.closed) { return; } @@ -228913,7 +174600,7 @@ class NodeFsHandler { this.fsw._incrReadyCount(); let linkPath; try { - linkPath = await fsrealpath(path12); + linkPath = await fsrealpath(path10); } catch (e) { this.fsw._emitReady(); return true; @@ -228923,12 +174610,12 @@ class NodeFsHandler { if (dir.has(item)) { if (this.fsw._symlinkPaths.get(full) !== linkPath) { this.fsw._symlinkPaths.set(full, linkPath); - this.fsw._emit(EV.CHANGE, path12, entry.stats); + this.fsw._emit(EV.CHANGE, path10, entry.stats); } } else { dir.add(item); this.fsw._symlinkPaths.set(full, linkPath); - this.fsw._emit(EV.ADD, path12, entry.stats); + this.fsw._emit(EV.ADD, path10, entry.stats); } this.fsw._emitReady(); return true; @@ -228957,9 +174644,9 @@ class NodeFsHandler { return; } const item = entry.path; - let path12 = sysPath.join(directory, item); + let path10 = sysPath.join(directory, item); current.add(item); - if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path12, item)) { + if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path10, item)) { return; } if (this.fsw.closed) { @@ -228968,8 +174655,8 @@ class NodeFsHandler { } if (item === target || !target && !previous.has(item)) { this.fsw._incrReadyCount(); - path12 = sysPath.join(dir, sysPath.relative(dir, path12)); - this._addToNodeFs(path12, initialAdd, wh, depth + 1); + path10 = sysPath.join(dir, sysPath.relative(dir, path10)); + this._addToNodeFs(path10, initialAdd, wh, depth + 1); } }).on(EV.ERROR, this._boundHandleError); return new Promise((resolve12, reject2) => { @@ -229018,13 +174705,13 @@ class NodeFsHandler { } return closer; } - async _addToNodeFs(path12, initialAdd, priorWh, depth, target) { + async _addToNodeFs(path10, initialAdd, priorWh, depth, target) { const ready = this.fsw._emitReady; - if (this.fsw._isIgnored(path12) || this.fsw.closed) { + if (this.fsw._isIgnored(path10) || this.fsw.closed) { ready(); return false; } - const wh = this.fsw._getWatchHelpers(path12); + const wh = this.fsw._getWatchHelpers(path10); if (priorWh) { wh.filterPath = (entry) => priorWh.filterPath(entry); wh.filterDir = (entry) => priorWh.filterDir(entry); @@ -229040,8 +174727,8 @@ class NodeFsHandler { const follow = this.fsw.options.followSymlinks; let closer; if (stats.isDirectory()) { - const absPath = sysPath.resolve(path12); - const targetPath = follow ? await fsrealpath(path12) : path12; + const absPath = sysPath.resolve(path10); + const targetPath = follow ? await fsrealpath(path10) : path10; if (this.fsw.closed) return; closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); @@ -229051,29 +174738,29 @@ class NodeFsHandler { this.fsw._symlinkPaths.set(absPath, targetPath); } } else if (stats.isSymbolicLink()) { - const targetPath = follow ? await fsrealpath(path12) : path12; + const targetPath = follow ? await fsrealpath(path10) : path10; if (this.fsw.closed) return; const parent2 = sysPath.dirname(wh.watchPath); this.fsw._getWatchedDir(parent2).add(wh.watchPath); this.fsw._emit(EV.ADD, wh.watchPath, stats); - closer = await this._handleDir(parent2, stats, initialAdd, depth, path12, wh, targetPath); + closer = await this._handleDir(parent2, stats, initialAdd, depth, path10, wh, targetPath); if (this.fsw.closed) return; if (targetPath !== undefined) { - this.fsw._symlinkPaths.set(sysPath.resolve(path12), targetPath); + this.fsw._symlinkPaths.set(sysPath.resolve(path10), targetPath); } } else { closer = this._handleFile(wh.watchPath, stats, initialAdd); } ready(); if (closer) - this.fsw._addPathCloser(path12, closer); + this.fsw._addPathCloser(path10, closer); return false; - } catch (error45) { - if (this.fsw._handleError(error45)) { + } catch (error41) { + if (this.fsw._handleError(error41)) { ready(); - return path12; + return path10; } } } @@ -229111,12 +174798,12 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {} foreach(cont[listenerType], (listener) => { listener(val1, val2, val3); }); -}, setFsWatchListener = (path12, fullPath, options, handlers) => { +}, setFsWatchListener = (path10, fullPath, options, handlers) => { const { listener, errHandler, rawEmitter } = handlers; let cont = FsWatchInstances.get(fullPath); let watcher; if (!options.persistent) { - watcher = createFsWatchInstance(path12, options, listener, errHandler, rawEmitter); + watcher = createFsWatchInstance(path10, options, listener, errHandler, rawEmitter); if (!watcher) return; return watcher.close.bind(watcher); @@ -229126,21 +174813,21 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {} addAndConvert(cont, KEY_ERR, errHandler); addAndConvert(cont, KEY_RAW, rawEmitter); } else { - watcher = createFsWatchInstance(path12, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW)); + watcher = createFsWatchInstance(path10, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW)); if (!watcher) return; - watcher.on(EV.ERROR, async (error45) => { + watcher.on(EV.ERROR, async (error41) => { const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); if (cont) cont.watcherUnusable = true; - if (isWindows && error45.code === "EPERM") { + if (isWindows && error41.code === "EPERM") { try { - const fd = await open4(path12, "r"); + const fd = await open4(path10, "r"); await fd.close(); - broadcastErr(error45); + broadcastErr(error41); } catch (err) {} } else { - broadcastErr(error45); + broadcastErr(error41); } }); cont = { @@ -229163,7 +174850,7 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {} Object.freeze(cont); } }; -}, FsWatchFileInstances, setFsWatchFileListener = (path12, fullPath, options, handlers) => { +}, FsWatchFileInstances, setFsWatchFileListener = (path10, fullPath, options, handlers) => { const { listener, rawEmitter } = handlers; let cont = FsWatchFileInstances.get(fullPath); const copts = cont && cont.options; @@ -229185,7 +174872,7 @@ var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {} }); const currmtime = curr.mtimeMs; if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { - foreach(cont.listeners, (listener2) => listener2(path12, curr)); + foreach(cont.listeners, (listener2) => listener2(path10, curr)); } }) }; @@ -229528,26 +175215,26 @@ function createPattern(matcher) { } return () => false; } -function normalizePath(path12) { - if (typeof path12 !== "string") +function normalizePath(path10) { + if (typeof path10 !== "string") throw new Error("string expected"); - path12 = sysPath2.normalize(path12); - path12 = path12.replace(/\\/g, "/"); + path10 = sysPath2.normalize(path10); + path10 = path10.replace(/\\/g, "/"); let prepend = false; - if (path12.startsWith("//")) + if (path10.startsWith("//")) prepend = true; const DOUBLE_SLASH_RE2 = /\/\//; - while (path12.match(DOUBLE_SLASH_RE2)) - path12 = path12.replace(DOUBLE_SLASH_RE2, "/"); + while (path10.match(DOUBLE_SLASH_RE2)) + path10 = path10.replace(DOUBLE_SLASH_RE2, "/"); if (prepend) - path12 = "/" + path12; - return path12; + path10 = "/" + path10; + return path10; } function matchPatterns(patterns, testString, stats) { - const path12 = normalizePath(testString); + const path10 = normalizePath(testString); for (let index = 0;index < patterns.length; index++) { const pattern = patterns[index]; - if (pattern(path12, stats)) { + if (pattern(path10, stats)) { return true; } } @@ -229618,10 +175305,10 @@ class DirEntry { } class WatchHelper { - constructor(path12, follow, fsw) { + constructor(path10, follow, fsw) { this.fsw = fsw; - const watchPath = path12; - this.path = path12 = path12.replace(REPLACER_RE, ""); + const watchPath = path10; + this.path = path10 = path10.replace(REPLACER_RE, ""); this.watchPath = watchPath; this.fullWatchPath = sysPath2.resolve(watchPath); this.dirParts = []; @@ -229670,17 +175357,17 @@ var SLASH = "/", SLASH_SLASH = "//", ONE_DOT = ".", TWO_DOTS = "..", STRING_TYPE str = SLASH + str; } return str; -}, normalizePathToUnix = (path12) => toUnix(sysPath2.normalize(toUnix(path12))), normalizeIgnored = (cwd2 = "") => (path12) => { - if (typeof path12 === "string") { - return normalizePathToUnix(sysPath2.isAbsolute(path12) ? path12 : sysPath2.join(cwd2, path12)); +}, normalizePathToUnix = (path10) => toUnix(sysPath2.normalize(toUnix(path10))), normalizeIgnored = (cwd2 = "") => (path10) => { + if (typeof path10 === "string") { + return normalizePathToUnix(sysPath2.isAbsolute(path10) ? path10 : sysPath2.join(cwd2, path10)); } else { - return path12; + return path10; } -}, getAbsolutePath = (path12, cwd2) => { - if (sysPath2.isAbsolute(path12)) { - return path12; +}, getAbsolutePath = (path10, cwd2) => { + if (sysPath2.isAbsolute(path10)) { + return path10; } - return sysPath2.join(cwd2, path12); + return sysPath2.join(cwd2, path10); }, EMPTY_SET, STAT_METHOD_F = "stat", STAT_METHOD_L = "lstat", FSWatcher, esm_default; var init_esm3 = __esm(() => { init_esm2(); @@ -229778,20 +175465,20 @@ var init_esm3 = __esm(() => { this._closePromise = undefined; let paths2 = unifyPaths(paths_); if (cwd2) { - paths2 = paths2.map((path12) => { - const absPath = getAbsolutePath(path12, cwd2); + paths2 = paths2.map((path10) => { + const absPath = getAbsolutePath(path10, cwd2); return absPath; }); } - paths2.forEach((path12) => { - this._removeIgnoredPath(path12); + paths2.forEach((path10) => { + this._removeIgnoredPath(path10); }); this._userIgnored = undefined; if (!this._readyCount) this._readyCount = 0; this._readyCount += paths2.length; - Promise.all(paths2.map(async (path12) => { - const res = await this._nodeFsHandler._addToNodeFs(path12, !_internal, undefined, 0, _origAdd); + Promise.all(paths2.map(async (path10) => { + const res = await this._nodeFsHandler._addToNodeFs(path10, !_internal, undefined, 0, _origAdd); if (res) this._emitReady(); return res; @@ -229810,17 +175497,17 @@ var init_esm3 = __esm(() => { return this; const paths2 = unifyPaths(paths_); const { cwd: cwd2 } = this.options; - paths2.forEach((path12) => { - if (!sysPath2.isAbsolute(path12) && !this._closers.has(path12)) { + paths2.forEach((path10) => { + if (!sysPath2.isAbsolute(path10) && !this._closers.has(path10)) { if (cwd2) - path12 = sysPath2.join(cwd2, path12); - path12 = sysPath2.resolve(path12); + path10 = sysPath2.join(cwd2, path10); + path10 = sysPath2.resolve(path10); } - this._closePath(path12); - this._addIgnoredPath(path12); - if (this._watched.has(path12)) { + this._closePath(path10); + this._addIgnoredPath(path10); + if (this._watched.has(path10)) { this._addIgnoredPath({ - path: path12, + path: path10, recursive: true }); } @@ -229869,38 +175556,38 @@ var init_esm3 = __esm(() => { if (event !== EVENTS.ERROR) this.emit(EVENTS.ALL, event, ...args); } - async _emit(event, path12, stats) { + async _emit(event, path10, stats) { if (this.closed) return; const opts = this.options; if (isWindows) - path12 = sysPath2.normalize(path12); + path10 = sysPath2.normalize(path10); if (opts.cwd) - path12 = sysPath2.relative(opts.cwd, path12); - const args = [path12]; + path10 = sysPath2.relative(opts.cwd, path10); + const args = [path10]; if (stats != null) args.push(stats); const awf = opts.awaitWriteFinish; let pw; - if (awf && (pw = this._pendingWrites.get(path12))) { + if (awf && (pw = this._pendingWrites.get(path10))) { pw.lastChange = new Date; return this; } if (opts.atomic) { if (event === EVENTS.UNLINK) { - this._pendingUnlinks.set(path12, [event, ...args]); + this._pendingUnlinks.set(path10, [event, ...args]); setTimeout(() => { - this._pendingUnlinks.forEach((entry, path13) => { + this._pendingUnlinks.forEach((entry, path11) => { this.emit(...entry); this.emit(EVENTS.ALL, ...entry); - this._pendingUnlinks.delete(path13); + this._pendingUnlinks.delete(path11); }); }, typeof opts.atomic === "number" ? opts.atomic : 100); return this; } - if (event === EVENTS.ADD && this._pendingUnlinks.has(path12)) { + if (event === EVENTS.ADD && this._pendingUnlinks.has(path10)) { event = EVENTS.CHANGE; - this._pendingUnlinks.delete(path12); + this._pendingUnlinks.delete(path10); } } if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) { @@ -229918,16 +175605,16 @@ var init_esm3 = __esm(() => { this.emitWithAll(event, args); } }; - this._awaitWriteFinish(path12, awf.stabilityThreshold, event, awfEmit); + this._awaitWriteFinish(path10, awf.stabilityThreshold, event, awfEmit); return this; } if (event === EVENTS.CHANGE) { - const isThrottled = !this._throttle(EVENTS.CHANGE, path12, 50); + const isThrottled = !this._throttle(EVENTS.CHANGE, path10, 50); if (isThrottled) return this; } if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) { - const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path12) : path12; + const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path10) : path10; let stats2; try { stats2 = await stat12(fullPath); @@ -229939,30 +175626,30 @@ var init_esm3 = __esm(() => { this.emitWithAll(event, args); return this; } - _handleError(error45) { - const code = error45 && error45.code; - if (error45 && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) { - this.emit(EVENTS.ERROR, error45); + _handleError(error41) { + const code = error41 && error41.code; + if (error41 && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) { + this.emit(EVENTS.ERROR, error41); } - return error45 || this.closed; + return error41 || this.closed; } - _throttle(actionType, path12, timeout) { + _throttle(actionType, path10, timeout) { if (!this._throttled.has(actionType)) { this._throttled.set(actionType, new Map); } const action = this._throttled.get(actionType); if (!action) throw new Error("invalid throttle"); - const actionPath = action.get(path12); + const actionPath = action.get(path10); if (actionPath) { actionPath.count++; return false; } let timeoutObject; const clear = () => { - const item = action.get(path12); + const item = action.get(path10); const count3 = item ? item.count : 0; - action.delete(path12); + action.delete(path10); clearTimeout(timeoutObject); if (item) clearTimeout(item.timeoutObject); @@ -229970,50 +175657,50 @@ var init_esm3 = __esm(() => { }; timeoutObject = setTimeout(clear, timeout); const thr = { timeoutObject, clear, count: 0 }; - action.set(path12, thr); + action.set(path10, thr); return thr; } _incrReadyCount() { return this._readyCount++; } - _awaitWriteFinish(path12, threshold, event, awfEmit) { + _awaitWriteFinish(path10, threshold, event, awfEmit) { const awf = this.options.awaitWriteFinish; if (typeof awf !== "object") return; const pollInterval = awf.pollInterval; let timeoutHandler; - let fullPath = path12; - if (this.options.cwd && !sysPath2.isAbsolute(path12)) { - fullPath = sysPath2.join(this.options.cwd, path12); + let fullPath = path10; + if (this.options.cwd && !sysPath2.isAbsolute(path10)) { + fullPath = sysPath2.join(this.options.cwd, path10); } const now2 = new Date; const writes = this._pendingWrites; function awaitWriteFinishFn(prevStat) { statcb(fullPath, (err, curStat) => { - if (err || !writes.has(path12)) { + if (err || !writes.has(path10)) { if (err && err.code !== "ENOENT") awfEmit(err); return; } const now3 = Number(new Date); if (prevStat && curStat.size !== prevStat.size) { - writes.get(path12).lastChange = now3; + writes.get(path10).lastChange = now3; } - const pw = writes.get(path12); + const pw = writes.get(path10); const df = now3 - pw.lastChange; if (df >= threshold) { - writes.delete(path12); + writes.delete(path10); awfEmit(undefined, curStat); } else { timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat); } }); } - if (!writes.has(path12)) { - writes.set(path12, { + if (!writes.has(path10)) { + writes.set(path10, { lastChange: now2, cancelWait: () => { - writes.delete(path12); + writes.delete(path10); clearTimeout(timeoutHandler); return event; } @@ -230021,8 +175708,8 @@ var init_esm3 = __esm(() => { timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval); } } - _isIgnored(path12, stats) { - if (this.options.atomic && DOT_RE.test(path12)) + _isIgnored(path10, stats) { + if (this.options.atomic && DOT_RE.test(path10)) return true; if (!this._userIgnored) { const { cwd: cwd2 } = this.options; @@ -230032,13 +175719,13 @@ var init_esm3 = __esm(() => { const list = [...ignoredPaths.map(normalizeIgnored(cwd2)), ...ignored]; this._userIgnored = anymatch(list, undefined); } - return this._userIgnored(path12, stats); + return this._userIgnored(path10, stats); } - _isntIgnored(path12, stat13) { - return !this._isIgnored(path12, stat13); + _isntIgnored(path10, stat13) { + return !this._isIgnored(path10, stat13); } - _getWatchHelpers(path12) { - return new WatchHelper(path12, this.options.followSymlinks, this); + _getWatchHelpers(path10) { + return new WatchHelper(path10, this.options.followSymlinks, this); } _getWatchedDir(directory) { const dir = sysPath2.resolve(directory); @@ -230052,57 +175739,57 @@ var init_esm3 = __esm(() => { return Boolean(Number(stats.mode) & 256); } _remove(directory, item, isDirectory) { - const path12 = sysPath2.join(directory, item); - const fullPath = sysPath2.resolve(path12); - isDirectory = isDirectory != null ? isDirectory : this._watched.has(path12) || this._watched.has(fullPath); - if (!this._throttle("remove", path12, 100)) + const path10 = sysPath2.join(directory, item); + const fullPath = sysPath2.resolve(path10); + isDirectory = isDirectory != null ? isDirectory : this._watched.has(path10) || this._watched.has(fullPath); + if (!this._throttle("remove", path10, 100)) return; if (!isDirectory && this._watched.size === 1) { this.add(directory, item, true); } - const wp = this._getWatchedDir(path12); + const wp = this._getWatchedDir(path10); const nestedDirectoryChildren = wp.getChildren(); - nestedDirectoryChildren.forEach((nested) => this._remove(path12, nested)); + nestedDirectoryChildren.forEach((nested) => this._remove(path10, nested)); const parent2 = this._getWatchedDir(directory); const wasTracked = parent2.has(item); parent2.remove(item); if (this._symlinkPaths.has(fullPath)) { this._symlinkPaths.delete(fullPath); } - let relPath = path12; + let relPath = path10; if (this.options.cwd) - relPath = sysPath2.relative(this.options.cwd, path12); + relPath = sysPath2.relative(this.options.cwd, path10); if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { const event = this._pendingWrites.get(relPath).cancelWait(); if (event === EVENTS.ADD) return; } - this._watched.delete(path12); + this._watched.delete(path10); this._watched.delete(fullPath); const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK; - if (wasTracked && !this._isIgnored(path12)) - this._emit(eventName, path12); - this._closePath(path12); + if (wasTracked && !this._isIgnored(path10)) + this._emit(eventName, path10); + this._closePath(path10); } - _closePath(path12) { - this._closeFile(path12); - const dir = sysPath2.dirname(path12); - this._getWatchedDir(dir).remove(sysPath2.basename(path12)); + _closePath(path10) { + this._closeFile(path10); + const dir = sysPath2.dirname(path10); + this._getWatchedDir(dir).remove(sysPath2.basename(path10)); } - _closeFile(path12) { - const closers = this._closers.get(path12); + _closeFile(path10) { + const closers = this._closers.get(path10); if (!closers) return; closers.forEach((closer) => closer()); - this._closers.delete(path12); + this._closers.delete(path10); } - _addPathCloser(path12, closer) { + _addPathCloser(path10, closer) { if (!closer) return; - let list = this._closers.get(path12); + let list = this._closers.get(path10); if (!list) { list = []; - this._closers.set(path12, list); + this._closers.set(path10, list); } list.push(closer); } @@ -230161,14 +175848,14 @@ async function initialize() { stabilityThreshold: testOverrides?.stabilityThreshold ?? FILE_STABILITY_THRESHOLD_MS, pollInterval: testOverrides?.pollInterval ?? FILE_STABILITY_POLL_INTERVAL_MS }, - ignored: (path12, stats) => { + ignored: (path10, stats) => { if (stats && !stats.isFile() && !stats.isDirectory()) return true; - if (path12.split(platformPath.sep).some((dir) => dir === ".git")) + if (path10.split(platformPath.sep).some((dir) => dir === ".git")) return true; if (!stats || stats.isDirectory()) return false; - const normalized = platformPath.normalize(path12); + const normalized = platformPath.normalize(path10); if (settingsFiles.has(normalized)) return false; if (dropInDir && normalized.startsWith(dropInDir + platformPath.sep) && normalized.endsWith(".json")) { @@ -230207,17 +175894,17 @@ async function getWatchTargets() { if (source === "flagSettings") { continue; } - const path12 = getSettingsFilePathForSource(source); - if (!path12) { + const path10 = getSettingsFilePathForSource(source); + if (!path10) { continue; } - const dir = platformPath.dirname(path12); + const dir = platformPath.dirname(path10); if (!dirToSettingsFiles.has(dir)) { dirToSettingsFiles.set(dir, new Set); } - dirToSettingsFiles.get(dir).add(path12); + dirToSettingsFiles.get(dir).add(path10); try { - const stats = await stat13(path12); + const stats = await stat13(path10); if (stats.isFile()) { dirsWithExistingFiles.add(dir); } @@ -230256,46 +175943,46 @@ function settingSourceToConfigChangeSource(source) { return "policy_settings"; } } -function handleChange(path12) { - const source = getSourceForPath(path12); +function handleChange(path10) { + const source = getSourceForPath(path10); if (!source) return; - const pendingTimer = pendingDeletions.get(path12); + const pendingTimer = pendingDeletions.get(path10); if (pendingTimer) { clearTimeout(pendingTimer); - pendingDeletions.delete(path12); - logForDebugging(`Cancelled pending deletion of ${path12} — file was recreated`); + pendingDeletions.delete(path10); + logForDebugging(`Cancelled pending deletion of ${path10} — file was recreated`); } - if (consumeInternalWrite(path12, INTERNAL_WRITE_WINDOW_MS)) { + if (consumeInternalWrite(path10, INTERNAL_WRITE_WINDOW_MS)) { return; } - logForDebugging(`Detected change to ${path12}`); - executeConfigChangeHooks(settingSourceToConfigChangeSource(source), path12).then((results) => { + logForDebugging(`Detected change to ${path10}`); + executeConfigChangeHooks(settingSourceToConfigChangeSource(source), path10).then((results) => { if (hasBlockingResult(results)) { - logForDebugging(`ConfigChange hook blocked change to ${path12}`); + logForDebugging(`ConfigChange hook blocked change to ${path10}`); return; } fanOut(source); }); } -function handleAdd(path12) { - const source = getSourceForPath(path12); +function handleAdd(path10) { + const source = getSourceForPath(path10); if (!source) return; - const pendingTimer = pendingDeletions.get(path12); + const pendingTimer = pendingDeletions.get(path10); if (pendingTimer) { clearTimeout(pendingTimer); - pendingDeletions.delete(path12); - logForDebugging(`Cancelled pending deletion of ${path12} — file was re-added`); + pendingDeletions.delete(path10); + logForDebugging(`Cancelled pending deletion of ${path10} — file was re-added`); } - handleChange(path12); + handleChange(path10); } -function handleDelete(path12) { - const source = getSourceForPath(path12); +function handleDelete(path10) { + const source = getSourceForPath(path10); if (!source) return; - logForDebugging(`Detected deletion of ${path12}`); - if (pendingDeletions.has(path12)) + logForDebugging(`Detected deletion of ${path10}`); + if (pendingDeletions.has(path10)) return; const timer = setTimeout((p, src) => { pendingDeletions.delete(p); @@ -230306,11 +175993,11 @@ function handleDelete(path12) { } fanOut(src); }); - }, testOverrides?.deletionGrace ?? DELETION_GRACE_MS, path12, source); - pendingDeletions.set(path12, timer); + }, testOverrides?.deletionGrace ?? DELETION_GRACE_MS, path10, source); + pendingDeletions.set(path10, timer); } -function getSourceForPath(path12) { - const normalizedPath = platformPath.normalize(path12); +function getSourceForPath(path10) { + const normalizedPath = platformPath.normalize(path10); const dropInDir = getManagedSettingsDropInDir(); if (normalizedPath.startsWith(dropInDir + platformPath.sep)) { return "policySettings"; @@ -230342,8 +176029,8 @@ function startMdmPoll() { logForDebugging("Detected MDM settings change via poll"); fanOut("policySettings"); } - } catch (error45) { - logForDebugging(`MDM poll error: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`MDM poll error: ${errorMessage(error41)}`); } })(); }, testOverrides?.mdmPollInterval ?? MDM_POLL_INTERVAL_MS); @@ -230497,7 +176184,7 @@ var init_Tool = __esm(() => { isConcurrencySafe: (_input) => false, isReadOnly: (_input) => false, isDestructive: (_input) => false, - checkPermissions: (input2, _ctx) => Promise.resolve({ behavior: "allow", updatedInput: input2 }), + checkPermissions: (input, _ctx) => Promise.resolve({ behavior: "allow", updatedInput: input }), toAutoClassifierInput: (_input) => "", userFacingName: (_input) => "" }; @@ -232126,25 +177813,25 @@ ${text} this.use(...args); } walkTokens(tokens, callback) { - let values3 = []; + let values2 = []; for (const token of tokens) { - values3 = values3.concat(callback.call(this, token)); + values2 = values2.concat(callback.call(this, token)); switch (token.type) { case "table": { const tableToken = token; for (const cell of tableToken.header) { - values3 = values3.concat(this.walkTokens(cell.tokens, callback)); + values2 = values2.concat(this.walkTokens(cell.tokens, callback)); } for (const row of tableToken.rows) { for (const cell of row) { - values3 = values3.concat(this.walkTokens(cell.tokens, callback)); + values2 = values2.concat(this.walkTokens(cell.tokens, callback)); } } break; } case "list": { const listToken = token; - values3 = values3.concat(this.walkTokens(listToken.items, callback)); + values2 = values2.concat(this.walkTokens(listToken.items, callback)); break; } default: { @@ -232152,15 +177839,15 @@ ${text} if (this.defaults.extensions?.childTokens?.[genericToken.type]) { this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => { const tokens2 = genericToken[childTokens].flat(Infinity); - values3 = values3.concat(this.walkTokens(tokens2, callback)); + values2 = values2.concat(this.walkTokens(tokens2, callback)); }); } else if (genericToken.tokens) { - values3 = values3.concat(this.walkTokens(genericToken.tokens, callback)); + values2 = values2.concat(this.walkTokens(genericToken.tokens, callback)); } } } } - return values3; + return values2; } use(...args) { const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} }; @@ -232300,12 +177987,12 @@ ${text} const walkTokens2 = this.defaults.walkTokens; const packWalktokens = pack.walkTokens; opts.walkTokens = function(token) { - let values3 = []; - values3.push(packWalktokens.call(this, token)); + let values2 = []; + values2.push(packWalktokens.call(this, token)); if (walkTokens2) { - values3 = values3.concat(walkTokens2.call(this, token)); + values2 = values2.concat(walkTokens2.call(this, token)); } - return values3; + return values2; }; } this.defaults = { ...this.defaults, ...opts }; @@ -232646,7 +178333,7 @@ var init_marked_esm = __esm(() => { }); // node_modules/picomatch/lib/constants.js -var require_constants10 = __commonJS((exports, module) => { +var require_constants9 = __commonJS((exports, module) => { var WIN_SLASH = "\\\\/"; var WIN_NO_SLASH = `[^${WIN_SLASH}]`; var DEFAULT_MAX_EXTGLOB_RECURSION = 0; @@ -232791,13 +178478,13 @@ var require_constants10 = __commonJS((exports, module) => { }); // node_modules/picomatch/lib/utils.js -var require_utils12 = __commonJS((exports) => { +var require_utils11 = __commonJS((exports) => { var { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL - } = require_constants10(); + } = require_constants9(); exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val); exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str); exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str); @@ -232818,33 +178505,33 @@ var require_utils12 = __commonJS((exports) => { return match === "\\" ? "" : match; }); }; - exports.escapeLast = (input2, char, lastIdx) => { - const idx = input2.lastIndexOf(char, lastIdx); + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); if (idx === -1) - return input2; - if (input2[idx - 1] === "\\") - return exports.escapeLast(input2, char, idx - 1); - return `${input2.slice(0, idx)}\\${input2.slice(idx)}`; + return input; + if (input[idx - 1] === "\\") + return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; }; - exports.removePrefix = (input2, state = {}) => { - let output = input2; + exports.removePrefix = (input, state = {}) => { + let output = input; if (output.startsWith("./")) { output = output.slice(2); state.prefix = "./"; } return output; }; - exports.wrapOutput = (input2, state = {}, options2 = {}) => { + exports.wrapOutput = (input, state = {}, options2 = {}) => { const prepend = options2.contains ? "" : "^"; const append2 = options2.contains ? "" : "$"; - let output = `${prepend}(?:${input2})${append2}`; + let output = `${prepend}(?:${input})${append2}`; if (state.negated === true) { output = `(?:^(?!${output}).*$)`; } return output; }; - exports.basename = (path12, { windows: windows2 } = {}) => { - const segs = path12.split(windows2 ? /[\\/]/ : "/"); + exports.basename = (path10, { windows: windows2 } = {}) => { + const segs = path10.split(windows2 ? /[\\/]/ : "/"); const last2 = segs[segs.length - 1]; if (last2 === "") { return segs[segs.length - 2]; @@ -232855,7 +178542,7 @@ var require_utils12 = __commonJS((exports) => { // node_modules/picomatch/lib/scan.js var require_scan = __commonJS((exports, module) => { - var utils = require_utils12(); + var utils = require_utils11(); var { CHAR_ASTERISK, CHAR_AT, @@ -232872,7 +178559,7 @@ var require_scan = __commonJS((exports, module) => { CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET - } = require_constants10(); + } = require_constants9(); var isPathSeparator = (code) => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; }; @@ -232881,14 +178568,14 @@ var require_scan = __commonJS((exports, module) => { token.depth = token.isGlobstar ? Infinity : 1; } }; - var scan = (input2, options2) => { + var scan = (input, options2) => { const opts = options2 || {}; - const length = input2.length - 1; + const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; const slashes = []; const tokens = []; const parts = []; - let str = input2; + let str = input; let index = -1; let start = 0; let lastIndex = 0; @@ -233111,7 +178798,7 @@ var require_scan = __commonJS((exports, module) => { } const state = { prefix, - input: input2, + input, start, base: base2, glob, @@ -233135,7 +178822,7 @@ var require_scan = __commonJS((exports, module) => { for (let idx = 0;idx < slashes.length; idx++) { const n2 = prevIndex ? prevIndex + 1 : start; const i2 = slashes[idx]; - const value = input2.slice(n2, i2); + const value = input.slice(n2, i2); if (opts.tokens) { if (idx === 0 && start !== 0) { tokens[idx].isPrefix = true; @@ -233151,8 +178838,8 @@ var require_scan = __commonJS((exports, module) => { } prevIndex = i2; } - if (prevIndex && prevIndex + 1 < input2.length) { - const value = input2.slice(prevIndex + 1); + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); parts.push(value); if (opts.tokens) { tokens[tokens.length - 1].value = value; @@ -233169,9 +178856,9 @@ var require_scan = __commonJS((exports, module) => { }); // node_modules/picomatch/lib/parse.js -var require_parse8 = __commonJS((exports, module) => { - var constants4 = require_constants10(); - var utils = require_utils12(); +var require_parse6 = __commonJS((exports, module) => { + var constants4 = require_constants9(); + var utils = require_utils11(); var { MAX_LENGTH, POSIX_REGEX_SOURCE, @@ -233195,14 +178882,14 @@ var require_parse8 = __commonJS((exports, module) => { var syntaxError = (type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }; - var splitTopLevel = (input2) => { + var splitTopLevel = (input) => { const parts = []; let bracket = 0; let paren = 0; let quote = 0; let value = ""; let escaped = false; - for (const ch of input2) { + for (const ch of input) { if (escaped === true) { value += ch; escaped = false; @@ -233273,11 +178960,11 @@ var require_parse8 = __commonJS((exports, module) => { return value.replace(/\\(.)/g, "$1"); }; var hasRepeatedCharPrefixOverlap = (branches) => { - const values3 = branches.map(normalizeSimpleBranch).filter(Boolean); - for (let i2 = 0;i2 < values3.length; i2++) { - for (let j = i2 + 1;j < values3.length; j++) { - const a2 = values3[i2]; - const b = values3[j]; + const values2 = branches.map(normalizeSimpleBranch).filter(Boolean); + for (let i2 = 0;i2 < values2.length; i2++) { + for (let j = i2 + 1;j < values2.length; j++) { + const a2 = values2[i2]; + const b = values2[j]; const char = a2[0]; if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) { continue; @@ -233402,14 +179089,14 @@ var require_parse8 = __commonJS((exports, module) => { } return { risky: false }; }; - var parse7 = (input2, options2) => { - if (typeof input2 !== "string") { + var parse7 = (input, options2) => { + if (typeof input !== "string") { throw new TypeError("Expected a string"); } - input2 = REPLACEMENTS[input2] || input2; + input = REPLACEMENTS[input] || input; const opts = { ...options2 }; const max2 = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - let len = input2.length; + let len = input.length; if (len > max2) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max2}`); } @@ -233445,7 +179132,7 @@ var require_parse8 = __commonJS((exports, module) => { opts.noextglob = opts.noext; } const state = { - input: input2, + input, index: -1, start: 0, dot: opts.dot === true, @@ -233461,17 +179148,17 @@ var require_parse8 = __commonJS((exports, module) => { globstar: false, tokens }; - input2 = utils.removePrefix(input2, state); - len = input2.length; + input = utils.removePrefix(input, state); + len = input.length; const extglobs = []; const braces = []; const stack = []; let prev = bos; let value; const eos = () => state.index === len - 1; - const peek = state.peek = (n2 = 1) => input2[state.index + n2]; - const advance = state.advance = () => input2[++state.index] || ""; - const remaining = () => input2.slice(state.index + 1); + const peek = state.peek = (n2 = 1) => input[state.index + n2]; + const advance = state.advance = () => input[++state.index] || ""; + const remaining = () => input.slice(state.index + 1); const consume = (value2 = "", num = 0) => { state.consumed += value2; state.index += num; @@ -233542,8 +179229,8 @@ var require_parse8 = __commonJS((exports, module) => { extglobs.push(token); }; const extglobClose = (token) => { - const literal2 = input2.slice(token.startIndex, state.index + 1); - const body = input2.slice(token.startIndex + 2, state.index); + const literal2 = input.slice(token.startIndex, state.index + 1); + const body = input.slice(token.startIndex + 2, state.index); const analysis = analyzeRepeatedExtglob(body, opts); if ((token.type === "plus" || token.type === "star") && analysis.risky) { const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : undefined; @@ -233583,9 +179270,9 @@ var require_parse8 = __commonJS((exports, module) => { push({ type: "paren", extglob: true, value, output }); decrement("parens"); }; - if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input2)) { + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { let backslashes = false; - let output = input2.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc2, chars, first, rest2, index) => { + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc2, chars, first, rest2, index) => { if (first === "\\") { backslashes = true; return m; @@ -233619,8 +179306,8 @@ var require_parse8 = __commonJS((exports, module) => { }); } } - if (output === input2 && opts.contains === true) { - state.output = input2; + if (output === input && opts.contains === true) { + state.output = input; return state; } state.output = utils.wrapOutput(output, state, options2); @@ -233976,7 +179663,7 @@ var require_parse8 = __commonJS((exports, module) => { continue; } while (rest2.slice(0, 3) === "/**") { - const after2 = input2[state.index + 4]; + const after2 = input[state.index + 4]; if (after2 && after2 !== "/") { break; } @@ -234099,14 +179786,14 @@ var require_parse8 = __commonJS((exports, module) => { } return state; }; - parse7.fastpaths = (input2, options2) => { + parse7.fastpaths = (input, options2) => { const opts = { ...options2 }; const max2 = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - const len = input2.length; + const len = input.length; if (len > max2) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max2}`); } - input2 = REPLACEMENTS[input2] || input2; + input = REPLACEMENTS[input] || input; const { DOT_LITERAL, SLASH_LITERAL, @@ -234160,7 +179847,7 @@ var require_parse8 = __commonJS((exports, module) => { } } }; - const output = utils.removePrefix(input2, state); + const output = utils.removePrefix(input, state); let source = create2(output); if (source && opts.strictSlashes !== true) { source += `${SLASH_LITERAL}?`; @@ -234173,13 +179860,13 @@ var require_parse8 = __commonJS((exports, module) => { // node_modules/picomatch/lib/picomatch.js var require_picomatch = __commonJS((exports, module) => { var scan = require_scan(); - var parse7 = require_parse8(); - var utils = require_utils12(); - var constants4 = require_constants10(); + var parse7 = require_parse6(); + var utils = require_utils11(); + var constants4 = require_constants9(); var isObject5 = (val) => val && typeof val === "object" && !Array.isArray(val); var picomatch = (glob, options2, returnState = false) => { if (Array.isArray(glob)) { - const fns = glob.map((input2) => picomatch(input2, options2, returnState)); + const fns = glob.map((input) => picomatch(input, options2, returnState)); const arrayMatcher = (str) => { for (const isMatch2 of fns) { const state2 = isMatch2(str); @@ -234204,9 +179891,9 @@ var require_picomatch = __commonJS((exports, module) => { const ignoreOpts = { ...options2, ignore: null, onMatch: null, onResult: null }; isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); } - const matcher = (input2, returnObject = false) => { - const { isMatch: isMatch2, match, output } = picomatch.test(input2, regex2, options2, { glob, posix }); - const result2 = { glob, state, regex: regex2, posix, input: input2, output, match, isMatch: isMatch2 }; + const matcher = (input, returnObject = false) => { + const { isMatch: isMatch2, match, output } = picomatch.test(input, regex2, options2, { glob, posix }); + const result2 = { glob, state, regex: regex2, posix, input, output, match, isMatch: isMatch2 }; if (typeof opts.onResult === "function") { opts.onResult(result2); } @@ -234214,7 +179901,7 @@ var require_picomatch = __commonJS((exports, module) => { result2.isMatch = false; return returnObject ? result2 : false; } - if (isIgnored(input2)) { + if (isIgnored(input)) { if (typeof opts.onIgnore === "function") { opts.onIgnore(result2); } @@ -234231,33 +179918,33 @@ var require_picomatch = __commonJS((exports, module) => { } return matcher; }; - picomatch.test = (input2, regex2, options2, { glob, posix } = {}) => { - if (typeof input2 !== "string") { + picomatch.test = (input, regex2, options2, { glob, posix } = {}) => { + if (typeof input !== "string") { throw new TypeError("Expected input to be a string"); } - if (input2 === "") { + if (input === "") { return { isMatch: false, output: "" }; } const opts = options2 || {}; const format4 = opts.format || (posix ? utils.toPosixSlashes : null); - let match = input2 === glob; - let output = match && format4 ? format4(input2) : input2; + let match = input === glob; + let output = match && format4 ? format4(input) : input; if (match === false) { - output = format4 ? format4(input2) : input2; + output = format4 ? format4(input) : input; match = output === glob; } if (match === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input2, regex2, options2, posix); + match = picomatch.matchBase(input, regex2, options2, posix); } else { match = regex2.exec(output); } } return { isMatch: Boolean(match), match, output }; }; - picomatch.matchBase = (input2, glob, options2) => { + picomatch.matchBase = (input, glob, options2) => { const regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options2); - return regex2.test(utils.basename(input2)); + return regex2.test(utils.basename(input)); }; picomatch.isMatch = (str, patterns, options2) => picomatch(patterns, options2)(str); picomatch.parse = (pattern, options2) => { @@ -234265,7 +179952,7 @@ var require_picomatch = __commonJS((exports, module) => { return pattern.map((p) => picomatch.parse(p, options2)); return parse7(pattern, { ...options2, fastpaths: false }); }; - picomatch.scan = (input2, options2) => scan(input2, options2); + picomatch.scan = (input, options2) => scan(input, options2); picomatch.compileRe = (state, options2, returnOutput = false, returnState = false) => { if (returnOutput === true) { return state.output; @@ -234283,16 +179970,16 @@ var require_picomatch = __commonJS((exports, module) => { } return regex2; }; - picomatch.makeRe = (input2, options2 = {}, returnOutput = false, returnState = false) => { - if (!input2 || typeof input2 !== "string") { + picomatch.makeRe = (input, options2 = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== "string") { throw new TypeError("Expected a non-empty string"); } let parsed = { negated: false, fastpaths: true }; - if (options2.fastpaths !== false && (input2[0] === "." || input2[0] === "*")) { - parsed.output = parse7.fastpaths(input2, options2); + if (options2.fastpaths !== false && (input[0] === "." || input[0] === "*")) { + parsed.output = parse7.fastpaths(input, options2); } if (!parsed.output) { - parsed = parse7(input2, options2); + parsed = parse7(input, options2); } return picomatch.compileRe(parsed, options2, returnOutput, returnState); }; @@ -234313,7 +180000,7 @@ var require_picomatch = __commonJS((exports, module) => { // node_modules/picomatch/index.js var require_picomatch2 = __commonJS((exports, module) => { var pico = require_picomatch(); - var utils = require_utils12(); + var utils = require_utils11(); function picomatch(glob, options2, returnState = false) { if (options2 && (options2.windows === null || options2.windows === undefined)) { options2 = { ...options2, windows: utils.isWindows() }; @@ -234479,17 +180166,17 @@ var require_visit = __commonJS((exports) => { visit2.BREAK = BREAK; visit2.SKIP = SKIP; visit2.REMOVE = REMOVE; - function visit_(key, node, visitor, path12) { - const ctrl = callVisitor(key, node, visitor, path12); + function visit_(key, node, visitor, path10) { + const ctrl = callVisitor(key, node, visitor, path10); if (identity4.isNode(ctrl) || identity4.isPair(ctrl)) { - replaceNode(key, path12, ctrl); - return visit_(key, ctrl, visitor, path12); + replaceNode(key, path10, ctrl); + return visit_(key, ctrl, visitor, path10); } if (typeof ctrl !== "symbol") { if (identity4.isCollection(node)) { - path12 = Object.freeze(path12.concat(node)); + path10 = Object.freeze(path10.concat(node)); for (let i2 = 0;i2 < node.items.length; ++i2) { - const ci = visit_(i2, node.items[i2], visitor, path12); + const ci = visit_(i2, node.items[i2], visitor, path10); if (typeof ci === "number") i2 = ci - 1; else if (ci === BREAK) @@ -234500,13 +180187,13 @@ var require_visit = __commonJS((exports) => { } } } else if (identity4.isPair(node)) { - path12 = Object.freeze(path12.concat(node)); - const ck = visit_("key", node.key, visitor, path12); + path10 = Object.freeze(path10.concat(node)); + const ck = visit_("key", node.key, visitor, path10); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; - const cv = visit_("value", node.value, visitor, path12); + const cv = visit_("value", node.value, visitor, path10); if (cv === BREAK) return BREAK; else if (cv === REMOVE) @@ -234527,17 +180214,17 @@ var require_visit = __commonJS((exports) => { visitAsync.BREAK = BREAK; visitAsync.SKIP = SKIP; visitAsync.REMOVE = REMOVE; - async function visitAsync_(key, node, visitor, path12) { - const ctrl = await callVisitor(key, node, visitor, path12); + async function visitAsync_(key, node, visitor, path10) { + const ctrl = await callVisitor(key, node, visitor, path10); if (identity4.isNode(ctrl) || identity4.isPair(ctrl)) { - replaceNode(key, path12, ctrl); - return visitAsync_(key, ctrl, visitor, path12); + replaceNode(key, path10, ctrl); + return visitAsync_(key, ctrl, visitor, path10); } if (typeof ctrl !== "symbol") { if (identity4.isCollection(node)) { - path12 = Object.freeze(path12.concat(node)); + path10 = Object.freeze(path10.concat(node)); for (let i2 = 0;i2 < node.items.length; ++i2) { - const ci = await visitAsync_(i2, node.items[i2], visitor, path12); + const ci = await visitAsync_(i2, node.items[i2], visitor, path10); if (typeof ci === "number") i2 = ci - 1; else if (ci === BREAK) @@ -234548,13 +180235,13 @@ var require_visit = __commonJS((exports) => { } } } else if (identity4.isPair(node)) { - path12 = Object.freeze(path12.concat(node)); - const ck = await visitAsync_("key", node.key, visitor, path12); + path10 = Object.freeze(path10.concat(node)); + const ck = await visitAsync_("key", node.key, visitor, path10); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; - const cv = await visitAsync_("value", node.value, visitor, path12); + const cv = await visitAsync_("value", node.value, visitor, path10); if (cv === BREAK) return BREAK; else if (cv === REMOVE) @@ -234581,23 +180268,23 @@ var require_visit = __commonJS((exports) => { } return visitor; } - function callVisitor(key, node, visitor, path12) { + function callVisitor(key, node, visitor, path10) { if (typeof visitor === "function") - return visitor(key, node, path12); + return visitor(key, node, path10); if (identity4.isMap(node)) - return visitor.Map?.(key, node, path12); + return visitor.Map?.(key, node, path10); if (identity4.isSeq(node)) - return visitor.Seq?.(key, node, path12); + return visitor.Seq?.(key, node, path10); if (identity4.isPair(node)) - return visitor.Pair?.(key, node, path12); + return visitor.Pair?.(key, node, path10); if (identity4.isScalar(node)) - return visitor.Scalar?.(key, node, path12); + return visitor.Scalar?.(key, node, path10); if (identity4.isAlias(node)) - return visitor.Alias?.(key, node, path12); + return visitor.Alias?.(key, node, path10); return; } - function replaceNode(key, path12, node) { - const parent2 = path12[path12.length - 1]; + function replaceNode(key, path10, node) { + const parent2 = path10[path10.length - 1]; if (identity4.isCollection(parent2)) { parent2.items[key] = node; } else if (identity4.isPair(parent2)) { @@ -234723,8 +180410,8 @@ var require_directives = __commonJS((exports) => { if (prefix) { try { return prefix + decodeURIComponent(suffix); - } catch (error45) { - onError(String(error45)); + } catch (error41) { + onError(String(error41)); return null; } } @@ -234815,9 +180502,9 @@ var require_anchors = __commonJS((exports) => { if (typeof ref === "object" && ref.anchor && (identity4.isScalar(ref.node) || identity4.isCollection(ref.node))) { ref.node.anchor = ref.anchor; } else { - const error45 = new Error("Failed to resolve repeated object (this should not happen)"); - error45.source = source; - throw error45; + const error41 = new Error("Failed to resolve repeated object (this should not happen)"); + error41.source = source; + throw error41; } } }, @@ -235099,9 +180786,9 @@ var require_createNode = __commonJS((exports) => { if (identity4.isNode(value)) return value; if (identity4.isPair(value)) { - const map4 = ctx.schema[identity4.MAP].createNode?.(ctx.schema, null, ctx); - map4.items.push(value); - return map4; + const map3 = ctx.schema[identity4.MAP].createNode?.(ctx.schema, null, ctx); + map3.items.push(value); + return map3; } if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) { value = value.valueOf(); @@ -235154,10 +180841,10 @@ var require_Collection = __commonJS((exports) => { var createNode2 = require_createNode(); var identity4 = require_identity(); var Node2 = require_Node(); - function collectionFromPath(schema, path12, value) { + function collectionFromPath(schema, path10, value) { let v = value; - for (let i2 = path12.length - 1;i2 >= 0; --i2) { - const k = path12[i2]; + for (let i2 = path10.length - 1;i2 >= 0; --i2) { + const k = path10[i2]; if (typeof k === "number" && Number.isInteger(k) && k >= 0) { const a2 = []; a2[k] = v; @@ -235176,7 +180863,7 @@ var require_Collection = __commonJS((exports) => { sourceObjects: new Map }); } - var isEmptyPath = (path12) => path12 == null || typeof path12 === "object" && !!path12[Symbol.iterator]().next().done; + var isEmptyPath = (path10) => path10 == null || typeof path10 === "object" && !!path10[Symbol.iterator]().next().done; class Collection extends Node2.NodeBase { constructor(type, schema) { @@ -235197,11 +180884,11 @@ var require_Collection = __commonJS((exports) => { copy.range = this.range.slice(); return copy; } - addIn(path12, value) { - if (isEmptyPath(path12)) + addIn(path10, value) { + if (isEmptyPath(path10)) this.add(value); else { - const [key, ...rest2] = path12; + const [key, ...rest2] = path10; const node = this.get(key, true); if (identity4.isCollection(node)) node.addIn(rest2, value); @@ -235211,8 +180898,8 @@ var require_Collection = __commonJS((exports) => { throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest2}`); } } - deleteIn(path12) { - const [key, ...rest2] = path12; + deleteIn(path10) { + const [key, ...rest2] = path10; if (rest2.length === 0) return this.delete(key); const node = this.get(key, true); @@ -235221,8 +180908,8 @@ var require_Collection = __commonJS((exports) => { else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest2}`); } - getIn(path12, keepScalar) { - const [key, ...rest2] = path12; + getIn(path10, keepScalar) { + const [key, ...rest2] = path10; const node = this.get(key, true); if (rest2.length === 0) return !keepScalar && identity4.isScalar(node) ? node.value : node; @@ -235237,15 +180924,15 @@ var require_Collection = __commonJS((exports) => { return n2 == null || allowScalar && identity4.isScalar(n2) && n2.value == null && !n2.commentBefore && !n2.comment && !n2.tag; }); } - hasIn(path12) { - const [key, ...rest2] = path12; + hasIn(path10) { + const [key, ...rest2] = path10; if (rest2.length === 0) return this.has(key); const node = this.get(key, true); return identity4.isCollection(node) ? node.hasIn(rest2) : false; } - setIn(path12, value) { - const [key, ...rest2] = path12; + setIn(path10, value) { + const [key, ...rest2] = path10; if (rest2.length === 0) { this.set(key, value); } else { @@ -235717,7 +181404,7 @@ ${indent}`); }); // node_modules/yaml/dist/stringify/stringify.js -var require_stringify5 = __commonJS((exports) => { +var require_stringify3 = __commonJS((exports) => { var anchors = require_anchors(); var identity4 = require_identity(); var stringifyComment = require_stringifyComment(); @@ -235841,7 +181528,7 @@ ${ctx.indent}${str}`; var require_stringifyPair = __commonJS((exports) => { var identity4 = require_identity(); var Scalar = require_Scalar(); - var stringify = require_stringify5(); + var stringify = require_stringify3(); var stringifyComment = require_stringifyComment(); function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { const { allNullValues, doc: doc2, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; @@ -236008,30 +181695,30 @@ var require_merge2 = __commonJS((exports) => { stringify: () => MERGE_KEY }; var isMergeKey = (ctx, key) => (merge4.identify(key) || identity4.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge4.identify(key.value)) && ctx?.doc.schema.tags.some((tag2) => tag2.tag === merge4.tag && tag2.default); - function addMergeToJSMap(ctx, map4, value) { + function addMergeToJSMap(ctx, map3, value) { value = ctx && identity4.isAlias(value) ? value.resolve(ctx.doc) : value; if (identity4.isSeq(value)) for (const it of value.items) - mergeValue(ctx, map4, it); + mergeValue(ctx, map3, it); else if (Array.isArray(value)) for (const it of value) - mergeValue(ctx, map4, it); + mergeValue(ctx, map3, it); else - mergeValue(ctx, map4, value); + mergeValue(ctx, map3, value); } - function mergeValue(ctx, map4, value) { + function mergeValue(ctx, map3, value) { const source = ctx && identity4.isAlias(value) ? value.resolve(ctx.doc) : value; if (!identity4.isMap(source)) throw new Error("Merge sources must be maps or map aliases"); const srcMap = source.toJSON(null, ctx, Map); for (const [key, value2] of srcMap) { - if (map4 instanceof Map) { - if (!map4.has(key)) - map4.set(key, value2); - } else if (map4 instanceof Set) { - map4.add(key); - } else if (!Object.prototype.hasOwnProperty.call(map4, key)) { - Object.defineProperty(map4, key, { + if (map3 instanceof Map) { + if (!map3.has(key)) + map3.set(key, value2); + } else if (map3 instanceof Set) { + map3.add(key); + } else if (!Object.prototype.hasOwnProperty.call(map3, key)) { + Object.defineProperty(map3, key, { value: value2, writable: true, enumerable: true, @@ -236039,7 +181726,7 @@ var require_merge2 = __commonJS((exports) => { }); } } - return map4; + return map3; } exports.addMergeToJSMap = addMergeToJSMap; exports.isMergeKey = isMergeKey; @@ -236048,37 +181735,37 @@ var require_merge2 = __commonJS((exports) => { // node_modules/yaml/dist/nodes/addPairToJSMap.js var require_addPairToJSMap = __commonJS((exports) => { - var log2 = require_log(); + var log = require_log(); var merge4 = require_merge2(); - var stringify = require_stringify5(); + var stringify = require_stringify3(); var identity4 = require_identity(); var toJS = require_toJS(); - function addPairToJSMap(ctx, map4, { key, value }) { + function addPairToJSMap(ctx, map3, { key, value }) { if (identity4.isNode(key) && key.addToJSMap) - key.addToJSMap(ctx, map4, value); + key.addToJSMap(ctx, map3, value); else if (merge4.isMergeKey(ctx, key)) - merge4.addMergeToJSMap(ctx, map4, value); + merge4.addMergeToJSMap(ctx, map3, value); else { const jsKey = toJS.toJS(key, "", ctx); - if (map4 instanceof Map) { - map4.set(jsKey, toJS.toJS(value, jsKey, ctx)); - } else if (map4 instanceof Set) { - map4.add(jsKey); + if (map3 instanceof Map) { + map3.set(jsKey, toJS.toJS(value, jsKey, ctx)); + } else if (map3 instanceof Set) { + map3.add(jsKey); } else { const stringKey = stringifyKey(key, jsKey, ctx); const jsValue = toJS.toJS(value, stringKey, ctx); - if (stringKey in map4) - Object.defineProperty(map4, stringKey, { + if (stringKey in map3) + Object.defineProperty(map3, stringKey, { value: jsValue, writable: true, enumerable: true, configurable: true }); else - map4[stringKey] = jsValue; + map3[stringKey] = jsValue; } } - return map4; + return map3; } function stringifyKey(key, jsKey, ctx) { if (jsKey === null) @@ -236097,7 +181784,7 @@ var require_addPairToJSMap = __commonJS((exports) => { let jsonStr = JSON.stringify(strKey); if (jsonStr.length > 40) jsonStr = jsonStr.substring(0, 36) + '..."'; - log2.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`); + log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`); ctx.mapKeyWarned = true; } return strKey; @@ -236148,7 +181835,7 @@ var require_Pair = __commonJS((exports) => { // node_modules/yaml/dist/stringify/stringifyCollection.js var require_stringifyCollection = __commonJS((exports) => { var identity4 = require_identity(); - var stringify = require_stringify5(); + var stringify = require_stringify3(); var stringifyComment = require_stringifyComment(); function stringifyCollection(collection, ctx, options2) { const flow2 = ctx.inFlow ?? collection.flow; @@ -236328,14 +182015,14 @@ var require_YAMLMap = __commonJS((exports) => { } static from(schema, obj, ctx) { const { keepUndefined, replacer } = ctx; - const map4 = new this(schema); + const map3 = new this(schema); const add2 = (key, value) => { if (typeof replacer === "function") value = replacer.call(obj, key, value); else if (Array.isArray(replacer) && !replacer.includes(key)) return; if (value !== undefined || keepUndefined) - map4.items.push(Pair.createPair(key, value, ctx)); + map3.items.push(Pair.createPair(key, value, ctx)); }; if (obj instanceof Map) { for (const [key, value] of obj) @@ -236345,9 +182032,9 @@ var require_YAMLMap = __commonJS((exports) => { add2(key, obj[key]); } if (typeof schema.sortMapEntries === "function") { - map4.items.sort(schema.sortMapEntries); + map3.items.sort(schema.sortMapEntries); } - return map4; + return map3; } add(pair, overwrite) { let _pair; @@ -236395,12 +182082,12 @@ var require_YAMLMap = __commonJS((exports) => { this.add(new Pair.Pair(key, value), true); } toJSON(_, ctx, Type) { - const map4 = Type ? new Type : ctx?.mapAsMap ? new Map : {}; + const map3 = Type ? new Type : ctx?.mapAsMap ? new Map : {}; if (ctx?.onCreate) - ctx.onCreate(map4); + ctx.onCreate(map3); for (const item of this.items) - addPairToJSMap.addPairToJSMap(ctx, map4, item); - return map4; + addPairToJSMap.addPairToJSMap(ctx, map3, item); + return map3; } toString(ctx, onComment, onChompKeep) { if (!ctx) @@ -236428,19 +182115,19 @@ var require_YAMLMap = __commonJS((exports) => { var require_map = __commonJS((exports) => { var identity4 = require_identity(); var YAMLMap = require_YAMLMap(); - var map4 = { + var map3 = { collection: "map", default: true, nodeClass: YAMLMap.YAMLMap, tag: "tag:yaml.org,2002:map", - resolve(map5, onError) { - if (!identity4.isMap(map5)) + resolve(map4, onError) { + if (!identity4.isMap(map4)) onError("Expected a mapping for this tag"); - return map5; + return map4; }, createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx) }; - exports.map = map4; + exports.map = map3; }); // node_modules/yaml/dist/nodes/YAMLSeq.js @@ -236717,8 +182404,8 @@ var require_int = __commonJS((exports) => { }); // node_modules/yaml/dist/schema/core/schema.js -var require_schema3 = __commonJS((exports) => { - var map4 = require_map(); +var require_schema2 = __commonJS((exports) => { + var map3 = require_map(); var _null4 = require_null(); var seq = require_seq(); var string4 = require_string(); @@ -236726,7 +182413,7 @@ var require_schema3 = __commonJS((exports) => { var float = require_float(); var int2 = require_int(); var schema = [ - map4.map, + map3.map, seq.seq, string4.string, _null4.nullTag, @@ -236742,9 +182429,9 @@ var require_schema3 = __commonJS((exports) => { }); // node_modules/yaml/dist/schema/json/schema.js -var require_schema4 = __commonJS((exports) => { +var require_schema3 = __commonJS((exports) => { var Scalar = require_Scalar(); - var map4 = require_map(); + var map3 = require_map(); var seq = require_seq(); function intIdentify(value) { return typeof value === "bigint" || Number.isInteger(value); @@ -236801,7 +182488,7 @@ var require_schema4 = __commonJS((exports) => { return str; } }; - var schema = [map4.map, seq.seq].concat(jsonScalars, jsonError); + var schema = [map3.map, seq.seq].concat(jsonScalars, jsonError); exports.schema = schema; }); @@ -236956,9 +182643,9 @@ var require_omap = __commonJS((exports) => { toJSON(_, ctx) { if (!ctx) return super.toJSON(_); - const map4 = new Map; + const map3 = new Map; if (ctx?.onCreate) - ctx.onCreate(map4); + ctx.onCreate(map3); for (const pair of this.items) { let key, value; if (identity4.isPair(pair)) { @@ -236967,11 +182654,11 @@ var require_omap = __commonJS((exports) => { } else { key = toJS.toJS(pair, "", ctx); } - if (map4.has(key)) + if (map3.has(key)) throw new Error("Ordered maps must not include duplicate keys"); - map4.set(key, value); + map3.set(key, value); } - return map4; + return map3; } static from(schema, iterable, ctx) { const pairs$1 = pairs.createPairs(schema, iterable, ctx); @@ -237226,15 +182913,15 @@ var require_set = __commonJS((exports) => { default: false, tag: "tag:yaml.org,2002:set", createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx), - resolve(map4, onError) { - if (identity4.isMap(map4)) { - if (map4.hasAllNullValues(true)) - return Object.assign(new YAMLSet, map4); + resolve(map3, onError) { + if (identity4.isMap(map3)) { + if (map3.hasAllNullValues(true)) + return Object.assign(new YAMLSet, map3); else onError("Set items must all have null values"); } else onError("Expected a mapping for this tag"); - return map4; + return map3; } }; exports.YAMLSet = YAMLSet; @@ -237324,8 +183011,8 @@ var require_timestamp = __commonJS((exports) => { }); // node_modules/yaml/dist/schema/yaml-1.1/schema.js -var require_schema5 = __commonJS((exports) => { - var map4 = require_map(); +var require_schema4 = __commonJS((exports) => { + var map3 = require_map(); var _null4 = require_null(); var seq = require_seq(); var string4 = require_string(); @@ -237339,7 +183026,7 @@ var require_schema5 = __commonJS((exports) => { var set3 = require_set(); var timestamp = require_timestamp(); var schema = [ - map4.map, + map3.map, seq.seq, string4.string, _null4.nullTag, @@ -237366,25 +183053,25 @@ var require_schema5 = __commonJS((exports) => { // node_modules/yaml/dist/schema/tags.js var require_tags = __commonJS((exports) => { - var map4 = require_map(); + var map3 = require_map(); var _null4 = require_null(); var seq = require_seq(); var string4 = require_string(); var bool = require_bool(); var float = require_float(); var int2 = require_int(); - var schema = require_schema3(); - var schema$1 = require_schema4(); + var schema = require_schema2(); + var schema$1 = require_schema3(); var binary = require_binary(); var merge4 = require_merge2(); var omap = require_omap(); var pairs = require_pairs(); - var schema$2 = require_schema5(); + var schema$2 = require_schema4(); var set3 = require_set(); var timestamp = require_timestamp(); var schemas3 = new Map([ ["core", schema.schema], - ["failsafe", [map4.map, seq.seq, string4.string]], + ["failsafe", [map3.map, seq.seq, string4.string]], ["json", schema$1.schema], ["yaml11", schema$2.schema], ["yaml-1.1", schema$2.schema] @@ -237400,7 +183087,7 @@ var require_tags = __commonJS((exports) => { intHex: int2.intHex, intOct: int2.intOct, intTime: timestamp.intTime, - map: map4.map, + map: map3.map, merge: merge4.merge, null: _null4.nullTag, omap: omap.omap, @@ -237458,7 +183145,7 @@ var require_tags = __commonJS((exports) => { // node_modules/yaml/dist/schema/Schema.js var require_Schema = __commonJS((exports) => { var identity4 = require_identity(); - var map4 = require_map(); + var map3 = require_map(); var seq = require_seq(); var string4 = require_string(); var tags = require_tags(); @@ -237471,7 +183158,7 @@ var require_Schema = __commonJS((exports) => { this.knownTags = resolveKnownTags ? tags.coreKnownTags : {}; this.tags = tags.getTags(customTags, this.name, merge4); this.toStringOptions = toStringDefaults ?? null; - Object.defineProperty(this, identity4.MAP, { value: map4.map }); + Object.defineProperty(this, identity4.MAP, { value: map3.map }); Object.defineProperty(this, identity4.SCALAR, { value: string4.string }); Object.defineProperty(this, identity4.SEQ, { value: seq.seq }); this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null; @@ -237488,7 +183175,7 @@ var require_Schema = __commonJS((exports) => { // node_modules/yaml/dist/stringify/stringifyDocument.js var require_stringifyDocument = __commonJS((exports) => { var identity4 = require_identity(); - var stringify = require_stringify5(); + var stringify = require_stringify3(); var stringifyComment = require_stringifyComment(); function stringifyDocument(doc2, options2) { const lines = []; @@ -237635,9 +183322,9 @@ var require_Document = __commonJS((exports) => { if (assertCollection(this.contents)) this.contents.add(value); } - addIn(path12, value) { + addIn(path10, value) { if (assertCollection(this.contents)) - this.contents.addIn(path12, value); + this.contents.addIn(path10, value); } createAlias(node, name) { if (!node.anchor) { @@ -237686,30 +183373,30 @@ var require_Document = __commonJS((exports) => { delete(key) { return assertCollection(this.contents) ? this.contents.delete(key) : false; } - deleteIn(path12) { - if (Collection.isEmptyPath(path12)) { + deleteIn(path10) { + if (Collection.isEmptyPath(path10)) { if (this.contents == null) return false; this.contents = null; return true; } - return assertCollection(this.contents) ? this.contents.deleteIn(path12) : false; + return assertCollection(this.contents) ? this.contents.deleteIn(path10) : false; } get(key, keepScalar) { return identity4.isCollection(this.contents) ? this.contents.get(key, keepScalar) : undefined; } - getIn(path12, keepScalar) { - if (Collection.isEmptyPath(path12)) + getIn(path10, keepScalar) { + if (Collection.isEmptyPath(path10)) return !keepScalar && identity4.isScalar(this.contents) ? this.contents.value : this.contents; - return identity4.isCollection(this.contents) ? this.contents.getIn(path12, keepScalar) : undefined; + return identity4.isCollection(this.contents) ? this.contents.getIn(path10, keepScalar) : undefined; } has(key) { return identity4.isCollection(this.contents) ? this.contents.has(key) : false; } - hasIn(path12) { - if (Collection.isEmptyPath(path12)) + hasIn(path10) { + if (Collection.isEmptyPath(path10)) return this.contents !== undefined; - return identity4.isCollection(this.contents) ? this.contents.hasIn(path12) : false; + return identity4.isCollection(this.contents) ? this.contents.hasIn(path10) : false; } set(key, value) { if (this.contents == null) { @@ -237718,13 +183405,13 @@ var require_Document = __commonJS((exports) => { this.contents.set(key, value); } } - setIn(path12, value) { - if (Collection.isEmptyPath(path12)) { + setIn(path10, value) { + if (Collection.isEmptyPath(path10)) { this.contents = value; } else if (this.contents == null) { - this.contents = Collection.collectionFromPath(this.schema, Array.from(path12), value); + this.contents = Collection.collectionFromPath(this.schema, Array.from(path10), value); } else if (assertCollection(this.contents)) { - this.contents.setIn(path12, value); + this.contents.setIn(path10, value); } } setSchema(version2, options2 = {}) { @@ -237823,12 +183510,12 @@ var require_errors7 = __commonJS((exports) => { super("YAMLWarning", pos, code, message); } } - var prettifyError2 = (src, lc) => (error45) => { - if (error45.pos[0] === -1) + var prettifyError2 = (src, lc) => (error41) => { + if (error41.pos[0] === -1) return; - error45.linePos = error45.pos.map((pos) => lc.linePos(pos)); - const { line, col } = error45.linePos[0]; - error45.message += ` at line ${line}, column ${col}`; + error41.linePos = error41.pos.map((pos) => lc.linePos(pos)); + const { line, col } = error41.linePos[0]; + error41.message += ` at line ${line}, column ${col}`; let ci = col - 1; let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, ""); if (ci >= 60 && lineStr.length > 80) { @@ -237847,12 +183534,12 @@ var require_errors7 = __commonJS((exports) => { } if (/[^ ]/.test(lineStr)) { let count3 = 1; - const end = error45.linePos[1]; + const end = error41.linePos[1]; if (end?.line === line && end.col > col) { count3 = Math.max(1, Math.min(end.col - col, 80 - ci)); } const pointer = " ".repeat(ci) + "^".repeat(count3); - error45.message += `: + error41.message += `: ${lineStr} ${pointer} @@ -238074,7 +183761,7 @@ var require_resolve_block_map = __commonJS((exports) => { var startColMsg = "All mapping items must start at the same column"; function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag2) { const NodeClass = tag2?.nodeClass ?? YAMLMap.YAMLMap; - const map4 = new NodeClass(ctx.schema); + const map3 = new NodeClass(ctx.schema); if (ctx.atRoot) ctx.atRoot = false; let offset = bm.offset; @@ -238100,11 +183787,11 @@ var require_resolve_block_map = __commonJS((exports) => { if (!keyProps.anchor && !keyProps.tag && !sep7) { commentEnd = keyProps.end; if (keyProps.comment) { - if (map4.comment) - map4.comment += ` + if (map3.comment) + map3.comment += ` ` + keyProps.comment; else - map4.comment = keyProps.comment; + map3.comment = keyProps.comment; } continue; } @@ -238120,7 +183807,7 @@ var require_resolve_block_map = __commonJS((exports) => { if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError); ctx.atKey = false; - if (utilMapIncludes.mapIncludes(ctx, map4.items, keyNode)) + if (utilMapIncludes.mapIncludes(ctx, map3.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); const valueProps = resolveProps.resolveProps(sep7 ?? [], { indicator: "map-value-ind", @@ -238145,7 +183832,7 @@ var require_resolve_block_map = __commonJS((exports) => { const pair = new Pair.Pair(keyNode, valueNode); if (ctx.options.keepSourceTokens) pair.srcToken = collItem; - map4.items.push(pair); + map3.items.push(pair); } else { if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"); @@ -238159,13 +183846,13 @@ var require_resolve_block_map = __commonJS((exports) => { const pair = new Pair.Pair(keyNode); if (ctx.options.keepSourceTokens) pair.srcToken = collItem; - map4.items.push(pair); + map3.items.push(pair); } } if (commentEnd && commentEnd < offset) onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content"); - map4.range = [bm.offset, offset, commentEnd ?? offset]; - return map4; + map3.range = [bm.offset, offset, commentEnd ?? offset]; + return map3; } exports.resolveBlockMap = resolveBlockMap; }); @@ -238404,17 +184091,17 @@ var require_resolve_flow_collection = __commonJS((exports) => { if (ctx.options.keepSourceTokens) pair.srcToken = collItem; if (isMap2) { - const map4 = coll; - if (utilMapIncludes.mapIncludes(ctx, map4.items, keyNode)) + const map3 = coll; + if (utilMapIncludes.mapIncludes(ctx, map3.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); - map4.items.push(pair); + map3.items.push(pair); } else { - const map4 = new YAMLMap.YAMLMap(ctx.schema); - map4.flow = true; - map4.items.push(pair); + const map3 = new YAMLMap.YAMLMap(ctx.schema); + map3.flow = true; + map3.items.push(pair); const endRange = (valueNode ?? keyNode).range; - map4.range = [keyNode.range[0], endRange[1], endRange[2]]; - coll.items.push(map4); + map3.range = [keyNode.range[0], endRange[1], endRange[2]]; + coll.items.push(map3); } offset = valueNode ? valueNode.range[2] : valueProps.end; } @@ -238642,7 +184329,7 @@ var require_resolve_block_scalar = __commonJS((exports) => { const mode = source[0]; let indent = 0; let chomp = ""; - let error45 = -1; + let error41 = -1; for (let i2 = 1;i2 < source.length; ++i2) { const ch = source[i2]; if (!chomp && (ch === "-" || ch === "+")) @@ -238651,12 +184338,12 @@ var require_resolve_block_scalar = __commonJS((exports) => { const n2 = Number(ch); if (!indent && n2) indent = n2; - else if (error45 === -1) - error45 = offset + i2; + else if (error41 === -1) + error41 = offset + i2; } } - if (error45 !== -1) - onError(error45, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`); + if (error41 !== -1) + onError(error41, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`); let hasSpace = false; let comment = ""; let length = source.length; @@ -238942,8 +184629,8 @@ var require_compose_scalar = __commonJS((exports) => { try { const res = tag2.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options); scalar = identity4.isScalar(res) ? res : new Scalar.Scalar(res); - } catch (error45) { - const msg = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const msg = error41 instanceof Error ? error41.message : String(error41); onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg); scalar = new Scalar.Scalar(value); } @@ -239060,8 +184747,8 @@ var require_compose_node = __commonJS((exports) => { node = composeCollection.composeCollection(CN, ctx, token, props, onError); if (anchor) node.anchor = anchor.source.substring(1); - } catch (error45) { - const message = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const message = error41 instanceof Error ? error41.message : String(error41); onError(token, "RESOURCE_EXHAUSTION", message); } break; @@ -239310,11 +184997,11 @@ ${cb}` : comment; break; case "error": { const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message; - const error45 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg); + const error41 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg); if (this.atDirectives || !this.doc) - this.errors.push(error45); + this.errors.push(error41); else - this.doc.errors.push(error45); + this.doc.errors.push(error41); break; } case "doc-end": { @@ -239618,9 +185305,9 @@ var require_cst_visit = __commonJS((exports) => { visit2.BREAK = BREAK; visit2.SKIP = SKIP; visit2.REMOVE = REMOVE; - visit2.itemAtPath = (cst, path12) => { + visit2.itemAtPath = (cst, path10) => { let item = cst; - for (const [field, index] of path12) { + for (const [field, index] of path10) { const tok = item?.[field]; if (tok && "items" in tok) { item = tok.items[index]; @@ -239629,23 +185316,23 @@ var require_cst_visit = __commonJS((exports) => { } return item; }; - visit2.parentCollection = (cst, path12) => { - const parent2 = visit2.itemAtPath(cst, path12.slice(0, -1)); - const field = path12[path12.length - 1][0]; + visit2.parentCollection = (cst, path10) => { + const parent2 = visit2.itemAtPath(cst, path10.slice(0, -1)); + const field = path10[path10.length - 1][0]; const coll = parent2?.[field]; if (coll && "items" in coll) return coll; throw new Error("Parent collection not found"); }; - function _visit(path12, item, visitor) { - let ctrl = visitor(item, path12); + function _visit(path10, item, visitor) { + let ctrl = visitor(item, path10); if (typeof ctrl === "symbol") return ctrl; for (const field of ["key", "value"]) { const token = item[field]; if (token && "items" in token) { for (let i2 = 0;i2 < token.items.length; ++i2) { - const ci = _visit(Object.freeze(path12.concat([[field, i2]])), token.items[i2], visitor); + const ci = _visit(Object.freeze(path10.concat([[field, i2]])), token.items[i2], visitor); if (typeof ci === "number") i2 = ci - 1; else if (ci === BREAK) @@ -239656,10 +185343,10 @@ var require_cst_visit = __commonJS((exports) => { } } if (typeof ctrl === "function" && field === "key") - ctrl = ctrl(item, path12); + ctrl = ctrl(item, path10); } } - return typeof ctrl === "function" ? ctrl(item, path12) : ctrl; + return typeof ctrl === "function" ? ctrl(item, path10) : ctrl; } exports.visit = visit2; }); @@ -240587,8 +186274,8 @@ var require_parser = __commonJS((exports) => { peek(n2) { return this.stack[this.stack.length - n2]; } - *pop(error45) { - const token = error45 ?? this.stack.pop(); + *pop(error41) { + const token = error41 ?? this.stack.pop(); if (!token) { const message = "Tried to pop an empty stack"; yield { type: "error", offset: this.offset, source: "", message }; @@ -240733,14 +186420,14 @@ var require_parser = __commonJS((exports) => { delete scalar.end; } else sep7 = [this.sourceToken]; - const map4 = { + const map3 = { type: "block-map", offset: scalar.offset, indent: scalar.indent, items: [{ start, key: scalar, sep: sep7 }] }; this.onKeyLine = true; - this.stack[this.stack.length - 1] = map4; + this.stack[this.stack.length - 1] = map3; } else yield* this.lineEnd(scalar); } @@ -240771,8 +186458,8 @@ var require_parser = __commonJS((exports) => { yield* this.step(); } } - *blockMap(map4) { - const it = map4.items[map4.items.length - 1]; + *blockMap(map3) { + const it = map3.items[map3.items.length - 1]; switch (this.type) { case "newline": this.onKeyLine = false; @@ -240782,7 +186469,7 @@ var require_parser = __commonJS((exports) => { if (last2?.type === "comment") end?.push(this.sourceToken); else - map4.items.push({ start: [this.sourceToken] }); + map3.items.push({ start: [this.sourceToken] }); } else if (it.sep) { it.sep.push(this.sourceToken); } else { @@ -240792,17 +186479,17 @@ var require_parser = __commonJS((exports) => { case "space": case "comment": if (it.value) { - map4.items.push({ start: [this.sourceToken] }); + map3.items.push({ start: [this.sourceToken] }); } else if (it.sep) { it.sep.push(this.sourceToken); } else { - if (this.atIndentedComment(it.start, map4.indent)) { - const prev = map4.items[map4.items.length - 2]; + if (this.atIndentedComment(it.start, map3.indent)) { + const prev = map3.items[map3.items.length - 2]; const end = prev?.value?.end; if (Array.isArray(end)) { Array.prototype.push.apply(end, it.start); end.push(this.sourceToken); - map4.items.pop(); + map3.items.pop(); return; } } @@ -240810,8 +186497,8 @@ var require_parser = __commonJS((exports) => { } return; } - if (this.indent >= map4.indent) { - const atMapIndent = !this.onKeyLine && this.indent === map4.indent; + if (this.indent >= map3.indent) { + const atMapIndent = !this.onKeyLine && this.indent === map3.indent; const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind"; let start = []; if (atNextItem && it.sep && !it.value) { @@ -240825,7 +186512,7 @@ var require_parser = __commonJS((exports) => { case "space": break; case "comment": - if (st.indent > map4.indent) + if (st.indent > map3.indent) nl.length = 0; break; default: @@ -240840,7 +186527,7 @@ var require_parser = __commonJS((exports) => { case "tag": if (atNextItem || it.value) { start.push(this.sourceToken); - map4.items.push({ start }); + map3.items.push({ start }); this.onKeyLine = true; } else if (it.sep) { it.sep.push(this.sourceToken); @@ -240854,7 +186541,7 @@ var require_parser = __commonJS((exports) => { it.explicitKey = true; } else if (atNextItem || it.value) { start.push(this.sourceToken); - map4.items.push({ start, explicitKey: true }); + map3.items.push({ start, explicitKey: true }); } else { this.stack.push({ type: "block-map", @@ -240880,7 +186567,7 @@ var require_parser = __commonJS((exports) => { }); } } else if (it.value) { - map4.items.push({ start: [], key: null, sep: [this.sourceToken] }); + map3.items.push({ start: [], key: null, sep: [this.sourceToken] }); } else if (includesToken(it.sep, "map-value-ind")) { this.stack.push({ type: "block-map", @@ -240910,7 +186597,7 @@ var require_parser = __commonJS((exports) => { if (!it.sep) { Object.assign(it, { key: null, sep: [this.sourceToken] }); } else if (it.value || atNextItem) { - map4.items.push({ start, key: null, sep: [this.sourceToken] }); + map3.items.push({ start, key: null, sep: [this.sourceToken] }); } else if (includesToken(it.sep, "map-value-ind")) { this.stack.push({ type: "block-map", @@ -240930,7 +186617,7 @@ var require_parser = __commonJS((exports) => { case "double-quoted-scalar": { const fs2 = this.flowScalar(this.type); if (atNextItem || it.value) { - map4.items.push({ start, key: fs2, sep: [] }); + map3.items.push({ start, key: fs2, sep: [] }); this.onKeyLine = true; } else if (it.sep) { this.stack.push(fs2); @@ -240941,7 +186628,7 @@ var require_parser = __commonJS((exports) => { return; } default: { - const bv = this.startBlockValue(map4); + const bv = this.startBlockValue(map3); if (bv) { if (bv.type === "block-seq") { if (!it.explicitKey && it.sep && !includesToken(it.sep, "newline")) { @@ -240954,7 +186641,7 @@ var require_parser = __commonJS((exports) => { return; } } else if (atMapIndent) { - map4.items.push({ start }); + map3.items.push({ start }); } this.stack.push(bv); return; @@ -241095,14 +186782,14 @@ var require_parser = __commonJS((exports) => { fixFlowSeqItems(fc); const sep7 = fc.end.splice(1, fc.end.length); sep7.push(this.sourceToken); - const map4 = { + const map3 = { type: "block-map", offset: fc.offset, indent: fc.indent, items: [{ start, key: fc, sep: sep7 }] }; this.onKeyLine = true; - this.stack[this.stack.length - 1] = map4; + this.stack[this.stack.length - 1] = map3; } else { yield* this.lineEnd(fc); } @@ -241229,11 +186916,11 @@ var require_parser = __commonJS((exports) => { }); // node_modules/yaml/dist/public-api.js -var require_public_api3 = __commonJS((exports) => { +var require_public_api2 = __commonJS((exports) => { var composer = require_composer(); var Document = require_Document(); var errors3 = require_errors7(); - var log2 = require_log(); + var log = require_log(); var identity4 = require_identity(); var lineCounter = require_line_counter(); var parser2 = require_parser(); @@ -241285,7 +186972,7 @@ var require_public_api3 = __commonJS((exports) => { const doc2 = parseDocument(src, options2); if (!doc2) return null; - doc2.warnings.forEach((warning) => log2.warn(doc2.options.logLevel, warning)); + doc2.warnings.forEach((warning) => log.warn(doc2.options.logLevel, warning)); if (doc2.errors.length > 0) { if (doc2.options.logLevel !== "silent") throw doc2.errors[0]; @@ -241323,7 +187010,7 @@ var require_public_api3 = __commonJS((exports) => { }); // node_modules/yaml/dist/index.js -var require_dist8 = __commonJS((exports) => { +var require_dist5 = __commonJS((exports) => { var composer = require_composer(); var Document = require_Document(); var Schema = require_Schema(); @@ -241338,7 +187025,7 @@ var require_dist8 = __commonJS((exports) => { var lexer2 = require_lexer(); var lineCounter = require_line_counter(); var parser2 = require_parser(); - var publicApi = require_public_api3(); + var publicApi = require_public_api2(); var visit2 = require_visit(); exports.Composer = composer.Composer; exports.Document = Document.Document; @@ -241372,11 +187059,11 @@ var require_dist8 = __commonJS((exports) => { }); // src/utils/yaml.ts -function parseYaml(input2) { +function parseYaml(input) { if (typeof Bun !== "undefined") { - return Bun.YAML.parse(input2); + return Bun.YAML.parse(input); } - return require_dist8().parse(input2); + return require_dist5().parse(input); } // src/utils/frontmatterParser.ts @@ -241440,18 +187127,18 @@ function parseFrontmatter(markdown, sourcePath) { content }; } -function splitPathInFrontmatter(input2) { - if (Array.isArray(input2)) { - return input2.flatMap(splitPathInFrontmatter); +function splitPathInFrontmatter(input) { + if (Array.isArray(input)) { + return input.flatMap(splitPathInFrontmatter); } - if (typeof input2 !== "string") { + if (typeof input !== "string") { return []; } const parts = []; let current = ""; let braceDepth = 0; - for (let i2 = 0;i2 < input2.length; i2++) { - const char = input2[i2]; + for (let i2 = 0;i2 < input.length; i2++) { + const char = input[i2]; if (char === "{") { braceDepth++; current += char; @@ -241575,8 +187262,8 @@ import { relative as relative5, sep as sep7 } from "path"; -function pathInOriginalCwd(path12) { - return pathInWorkingPath(path12, getOriginalCwd()); +function pathInOriginalCwd(path10) { + return pathInWorkingPath(path10, getOriginalCwd()); } function parseFrontmatterPaths(rawContent) { const { frontmatter, content } = parseFrontmatter(rawContent); @@ -241645,8 +187332,8 @@ function parseMemoryFileContent(rawContent, filePath, type, includeBasePath) { includePaths }; } -function handleMemoryFileReadError(error45, filePath) { - const code = getErrnoCode(error45); +function handleMemoryFileReadError(error41, filePath) { + const code = getErrnoCode(error41); if (code === "ENOENT" || code === "EISDIR") { return; } @@ -241662,8 +187349,8 @@ async function safelyReadMemoryFileAsync(filePath, type, includeBasePath) { const fs2 = getFsImplementation(); const rawContent = await fs2.readFile(filePath, { encoding: "utf-8" }); return parseMemoryFileContent(rawContent, filePath, type, includeBasePath); - } catch (error45) { - handleMemoryFileReadError(error45, filePath); + } catch (error41) { + handleMemoryFileReadError(error41, filePath); return { info: null, includePaths: [] }; } } @@ -241673,20 +187360,20 @@ function extractIncludePathsFromTokens(tokens, basePath) { const includeRegex = /(?:^|\s)@((?:[^\s\\]|\\ )+)/g; let match; while ((match = includeRegex.exec(textContent)) !== null) { - let path12 = match[1]; - if (!path12) + let path10 = match[1]; + if (!path10) continue; - const hashIndex = path12.indexOf("#"); + const hashIndex = path10.indexOf("#"); if (hashIndex !== -1) { - path12 = path12.substring(0, hashIndex); + path10 = path10.substring(0, hashIndex); } - if (!path12) + if (!path10) continue; - path12 = path12.replace(/\\ /g, " "); - if (path12) { - const isValidPath = path12.startsWith("./") || path12.startsWith("~/") || path12.startsWith("/") && path12 !== "/" || !path12.startsWith("@") && !path12.match(/^[#%^&*()]+/) && path12.match(/^[a-zA-Z0-9._-]/); + path10 = path10.replace(/\\ /g, " "); + if (path10) { + const isValidPath = path10.startsWith("./") || path10.startsWith("~/") || path10.startsWith("/") && path10 !== "/" || !path10.startsWith("@") && !path10.match(/^[#%^&*()]+/) && path10.match(/^[a-zA-Z0-9._-]/); if (isValidPath) { - const resolvedPath = expandPath(path12, dirname17(basePath)); + const resolvedPath = expandPath(path10, dirname17(basePath)); absolutePaths.add(resolvedPath); } } @@ -241841,8 +187528,8 @@ async function processMdRules({ } } return result2; - } catch (error45) { - if (error45 instanceof Error && error45.message.includes("EACCES")) { + } catch (error41) { + if (error41 instanceof Error && error41.message.includes("EACCES")) { logEvent("tengu_claude_rules_md_permission_error", { is_access_error: 1, has_home_dir: rulesDir.includes(getClaudeConfigHomeDir()) ? 1 : 0 @@ -241911,8 +187598,8 @@ async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths) conditionalRule: false })); result2.push(...await processConditionedMdRules(targetPath, rulesDir, "Project", processedPaths, false)); - for (const path12 of unconditionalProcessedPaths) { - processedPaths.add(path12); + for (const path10 of unconditionalProcessedPaths) { + processedPaths.add(path10); } return result2; } @@ -242345,7 +188032,7 @@ var init_context2 = __esm(() => { } try { const gitCmdsStart = Date.now(); - const [branch, mainBranch, status, log2, userName] = await Promise.all([ + const [branch, mainBranch, status, log, userName] = await Promise.all([ getBranch(), getDefaultBranch(), execFileNoThrow(gitExe(), ["--no-optional-locks", "status", "--short"], { @@ -242376,15 +188063,15 @@ var init_context2 = __esm(() => { `Status: ${truncatedStatus || "(clean)"}`, `Recent commits: -${log2}` +${log}` ].join(` `); - } catch (error45) { + } catch (error41) { logForDiagnosticsNoPII("error", "git_status_failed", { duration_ms: Date.now() - startTime }); - logError2(error45); + logError2(error41); return null; } }); @@ -242606,8 +188293,8 @@ var init_ZodError = __esm(() => { return issue2.message; }; const fieldErrors = { _errors: [] }; - const processError = (error45) => { - for (const issue2 of error45.issues) { + const processError = (error41) => { + for (const issue2 of error41.issues) { if (issue2.code === "invalid_union") { issue2.unionErrors.map(processError); } else if (issue2.code === "invalid_return_type") { @@ -242670,8 +188357,8 @@ var init_ZodError = __esm(() => { } }; ZodError2.create = (issues) => { - const error45 = new ZodError2(issues); - return error45; + const error41 = new ZodError2(issues); + return error41; }; }); @@ -242783,8 +188470,8 @@ var init_en2 = __esm(() => { }); // node_modules/zod/v3/errors.js -function setErrorMap2(map4) { - overrideErrorMap = map4; +function setErrorMap2(map3) { + overrideErrorMap = map3; } function getErrorMap2() { return overrideErrorMap; @@ -242867,8 +188554,8 @@ class ParseStatus { } } var makeIssue = (params) => { - const { data, path: path12, errorMaps, issueData } = params; - const fullPath = [...path12, ...issueData.path || []]; + const { data, path: path10, errorMaps, issueData } = params; + const fullPath = [...path10, ...issueData.path || []]; const fullIssue = { ...issueData, path: fullPath @@ -242882,8 +188569,8 @@ var makeIssue = (params) => { } let errorMessage2 = ""; const maps = errorMaps.filter((m) => !!m).slice().reverse(); - for (const map4 of maps) { - errorMessage2 = map4(fullIssue, { data, defaultError: errorMessage2 }).message; + for (const map3 of maps) { + errorMessage2 = map3(fullIssue, { data, defaultError: errorMessage2 }).message; } return { ...issueData, @@ -242914,11 +188601,11 @@ var init_errorUtil = __esm(() => { // node_modules/zod/v3/types.js class ParseInputLazyPath { - constructor(parent2, value, path12, key) { + constructor(parent2, value, path10, key) { this._cachedPath = []; this.parent = parent2; this.data = value; - this._path = path12; + this._path = path10; this._key = key; } get path() { @@ -242960,41 +188647,41 @@ class ZodType2 { get description() { return this._def.description; } - _getType(input2) { - return getParsedType2(input2.data); + _getType(input) { + return getParsedType2(input.data); } - _getOrReturnCtx(input2, ctx) { + _getOrReturnCtx(input, ctx) { return ctx || { - common: input2.parent.common, - data: input2.data, - parsedType: getParsedType2(input2.data), + common: input.parent.common, + data: input.data, + parsedType: getParsedType2(input.data), schemaErrorMap: this._def.errorMap, - path: input2.path, - parent: input2.parent + path: input.path, + parent: input.parent }; } - _processInputParams(input2) { + _processInputParams(input) { return { status: new ParseStatus, ctx: { - common: input2.parent.common, - data: input2.data, - parsedType: getParsedType2(input2.data), + common: input.parent.common, + data: input.data, + parsedType: getParsedType2(input.data), schemaErrorMap: this._def.errorMap, - path: input2.path, - parent: input2.parent + path: input.path, + parent: input.parent } }; } - _parseSync(input2) { - const result2 = this._parse(input2); + _parseSync(input) { + const result2 = this._parse(input); if (isAsync(result2)) { throw new Error("Synchronous parse encountered promise."); } return result2; } - _parseAsync(input2) { - const result2 = this._parse(input2); + _parseAsync(input) { + const result2 = this._parse(input); return Promise.resolve(result2); } parse(data, params) { @@ -243277,8 +188964,8 @@ function isValidJWT2(jwt2, alg) { const [header] = jwt2.split("."); if (!header) return false; - const base644 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); - const decoded = JSON.parse(atob(base644)); + const base643 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); + const decoded = JSON.parse(atob(base643)); if (typeof decoded !== "object" || decoded === null) return false; if ("typ" in decoded && decoded?.typ !== "JWT") @@ -243373,9 +189060,9 @@ function mergeValues2(a2, b) { return { valid: false }; } } -function createZodEnum(values3, params) { +function createZodEnum(values2, params) { return new ZodEnum2({ - values: values3, + values: values2, typeName: ZodFirstPartyTypeKind.ZodEnum, ...processCreateParams(params) }); @@ -243419,8 +189106,8 @@ var handleResult2 = (ctx, result2) => { get error() { if (this._error) return this._error; - const error45 = new ZodError2(ctx.common.issues); - this._error = error45; + const error41 = new ZodError2(ctx.common.issues); + this._error = error41; return this._error; } }; @@ -243480,13 +189167,13 @@ var init_types3 = __esm(() => { base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; dateRegex = new RegExp(`^${dateRegexSource}$`); ZodString2 = class ZodString2 extends ZodType2 { - _parse(input2) { + _parse(input) { if (this._def.coerce) { - input2.data = String(input2.data); + input.data = String(input.data); } - const parsedType4 = this._getType(input2); + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.string) { - const ctx2 = this._getOrReturnCtx(input2); + const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.string, @@ -243498,8 +189185,8 @@ var init_types3 = __esm(() => { let ctx = undefined; for (const check3 of this._def.checks) { if (check3.kind === "min") { - if (input2.data.length < check3.value) { - ctx = this._getOrReturnCtx(input2, ctx); + if (input.data.length < check3.value) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.too_small, minimum: check3.value, @@ -243511,8 +189198,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "max") { - if (input2.data.length > check3.value) { - ctx = this._getOrReturnCtx(input2, ctx); + if (input.data.length > check3.value) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.too_big, maximum: check3.value, @@ -243524,10 +189211,10 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "length") { - const tooBig = input2.data.length > check3.value; - const tooSmall = input2.data.length < check3.value; + const tooBig = input.data.length > check3.value; + const tooSmall = input.data.length < check3.value; if (tooBig || tooSmall) { - ctx = this._getOrReturnCtx(input2, ctx); + ctx = this._getOrReturnCtx(input, ctx); if (tooBig) { addIssueToContext(ctx, { code: ZodIssueCode2.too_big, @@ -243550,8 +189237,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "email") { - if (!emailRegex.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!emailRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "email", code: ZodIssueCode2.invalid_string, @@ -243563,8 +189250,8 @@ var init_types3 = __esm(() => { if (!emojiRegex2) { emojiRegex2 = new RegExp(_emojiRegex, "u"); } - if (!emojiRegex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!emojiRegex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "emoji", code: ZodIssueCode2.invalid_string, @@ -243573,8 +189260,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "uuid") { - if (!uuidRegex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!uuidRegex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "uuid", code: ZodIssueCode2.invalid_string, @@ -243583,8 +189270,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "nanoid") { - if (!nanoidRegex.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!nanoidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "nanoid", code: ZodIssueCode2.invalid_string, @@ -243593,8 +189280,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "cuid") { - if (!cuidRegex.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!cuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "cuid", code: ZodIssueCode2.invalid_string, @@ -243603,8 +189290,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "cuid2") { - if (!cuid2Regex.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!cuid2Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "cuid2", code: ZodIssueCode2.invalid_string, @@ -243613,8 +189300,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "ulid") { - if (!ulidRegex.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!ulidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "ulid", code: ZodIssueCode2.invalid_string, @@ -243624,9 +189311,9 @@ var init_types3 = __esm(() => { } } else if (check3.kind === "url") { try { - new URL(input2.data); + new URL(input.data); } catch { - ctx = this._getOrReturnCtx(input2, ctx); + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "url", code: ZodIssueCode2.invalid_string, @@ -243636,9 +189323,9 @@ var init_types3 = __esm(() => { } } else if (check3.kind === "regex") { check3.regex.lastIndex = 0; - const testResult = check3.regex.test(input2.data); + const testResult = check3.regex.test(input.data); if (!testResult) { - ctx = this._getOrReturnCtx(input2, ctx); + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "regex", code: ZodIssueCode2.invalid_string, @@ -243647,10 +189334,10 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "trim") { - input2.data = input2.data.trim(); + input.data = input.data.trim(); } else if (check3.kind === "includes") { - if (!input2.data.includes(check3.value, check3.position)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!input.data.includes(check3.value, check3.position)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_string, validation: { includes: check3.value, position: check3.position }, @@ -243659,12 +189346,12 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "toLowerCase") { - input2.data = input2.data.toLowerCase(); + input.data = input.data.toLowerCase(); } else if (check3.kind === "toUpperCase") { - input2.data = input2.data.toUpperCase(); + input.data = input.data.toUpperCase(); } else if (check3.kind === "startsWith") { - if (!input2.data.startsWith(check3.value)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!input.data.startsWith(check3.value)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_string, validation: { startsWith: check3.value }, @@ -243673,8 +189360,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "endsWith") { - if (!input2.data.endsWith(check3.value)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!input.data.endsWith(check3.value)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_string, validation: { endsWith: check3.value }, @@ -243684,8 +189371,8 @@ var init_types3 = __esm(() => { } } else if (check3.kind === "datetime") { const regex2 = datetimeRegex(check3); - if (!regex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!regex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_string, validation: "datetime", @@ -243695,8 +189382,8 @@ var init_types3 = __esm(() => { } } else if (check3.kind === "date") { const regex2 = dateRegex; - if (!regex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!regex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_string, validation: "date", @@ -243706,8 +189393,8 @@ var init_types3 = __esm(() => { } } else if (check3.kind === "time") { const regex2 = timeRegex(check3); - if (!regex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!regex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_string, validation: "time", @@ -243716,8 +189403,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "duration") { - if (!durationRegex.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!durationRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "duration", code: ZodIssueCode2.invalid_string, @@ -243726,8 +189413,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "ip") { - if (!isValidIP(input2.data, check3.version)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!isValidIP(input.data, check3.version)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "ip", code: ZodIssueCode2.invalid_string, @@ -243736,8 +189423,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "jwt") { - if (!isValidJWT2(input2.data, check3.alg)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!isValidJWT2(input.data, check3.alg)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "jwt", code: ZodIssueCode2.invalid_string, @@ -243746,8 +189433,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "cidr") { - if (!isValidCidr(input2.data, check3.version)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!isValidCidr(input.data, check3.version)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "cidr", code: ZodIssueCode2.invalid_string, @@ -243756,8 +189443,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "base64") { - if (!base64Regex.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!base64Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "base64", code: ZodIssueCode2.invalid_string, @@ -243766,8 +189453,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "base64url") { - if (!base64urlRegex.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!base64urlRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "base64url", code: ZodIssueCode2.invalid_string, @@ -243779,7 +189466,7 @@ var init_types3 = __esm(() => { util3.assertNever(check3); } } - return { status: status.value, value: input2.data }; + return { status: status.value, value: input.data }; } _regex(regex2, validation, message) { return this.refinement((data) => regex2.test(data), { @@ -244029,13 +189716,13 @@ var init_types3 = __esm(() => { this.max = this.lte; this.step = this.multipleOf; } - _parse(input2) { + _parse(input) { if (this._def.coerce) { - input2.data = Number(input2.data); + input.data = Number(input.data); } - const parsedType4 = this._getType(input2); + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.number) { - const ctx2 = this._getOrReturnCtx(input2); + const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.number, @@ -244047,8 +189734,8 @@ var init_types3 = __esm(() => { const status = new ParseStatus; for (const check3 of this._def.checks) { if (check3.kind === "int") { - if (!util3.isInteger(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!util3.isInteger(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: "integer", @@ -244058,9 +189745,9 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "min") { - const tooSmall = check3.inclusive ? input2.data < check3.value : input2.data <= check3.value; + const tooSmall = check3.inclusive ? input.data < check3.value : input.data <= check3.value; if (tooSmall) { - ctx = this._getOrReturnCtx(input2, ctx); + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.too_small, minimum: check3.value, @@ -244072,9 +189759,9 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "max") { - const tooBig = check3.inclusive ? input2.data > check3.value : input2.data >= check3.value; + const tooBig = check3.inclusive ? input.data > check3.value : input.data >= check3.value; if (tooBig) { - ctx = this._getOrReturnCtx(input2, ctx); + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.too_big, maximum: check3.value, @@ -244086,8 +189773,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "multipleOf") { - if (floatSafeRemainder2(input2.data, check3.value) !== 0) { - ctx = this._getOrReturnCtx(input2, ctx); + if (floatSafeRemainder2(input.data, check3.value) !== 0) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.not_multiple_of, multipleOf: check3.value, @@ -244096,8 +189783,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "finite") { - if (!Number.isFinite(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.not_finite, message: check3.message @@ -244108,7 +189795,7 @@ var init_types3 = __esm(() => { util3.assertNever(check3); } } - return { status: status.value, value: input2.data }; + return { status: status.value, value: input.data }; } gte(value, message) { return this.setLimit("min", value, true, errorUtil.toString(message)); @@ -244260,25 +189947,25 @@ var init_types3 = __esm(() => { this.min = this.gte; this.max = this.lte; } - _parse(input2) { + _parse(input) { if (this._def.coerce) { try { - input2.data = BigInt(input2.data); + input.data = BigInt(input.data); } catch { - return this._getInvalidInput(input2); + return this._getInvalidInput(input); } } - const parsedType4 = this._getType(input2); + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.bigint) { - return this._getInvalidInput(input2); + return this._getInvalidInput(input); } let ctx = undefined; const status = new ParseStatus; for (const check3 of this._def.checks) { if (check3.kind === "min") { - const tooSmall = check3.inclusive ? input2.data < check3.value : input2.data <= check3.value; + const tooSmall = check3.inclusive ? input.data < check3.value : input.data <= check3.value; if (tooSmall) { - ctx = this._getOrReturnCtx(input2, ctx); + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.too_small, type: "bigint", @@ -244289,9 +189976,9 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "max") { - const tooBig = check3.inclusive ? input2.data > check3.value : input2.data >= check3.value; + const tooBig = check3.inclusive ? input.data > check3.value : input.data >= check3.value; if (tooBig) { - ctx = this._getOrReturnCtx(input2, ctx); + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.too_big, type: "bigint", @@ -244302,8 +189989,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "multipleOf") { - if (input2.data % check3.value !== BigInt(0)) { - ctx = this._getOrReturnCtx(input2, ctx); + if (input.data % check3.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.not_multiple_of, multipleOf: check3.value, @@ -244315,10 +190002,10 @@ var init_types3 = __esm(() => { util3.assertNever(check3); } } - return { status: status.value, value: input2.data }; + return { status: status.value, value: input.data }; } - _getInvalidInput(input2) { - const ctx = this._getOrReturnCtx(input2); + _getInvalidInput(input) { + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.bigint, @@ -244427,13 +190114,13 @@ var init_types3 = __esm(() => { }); }; ZodBoolean2 = class ZodBoolean2 extends ZodType2 { - _parse(input2) { + _parse(input) { if (this._def.coerce) { - input2.data = Boolean(input2.data); + input.data = Boolean(input.data); } - const parsedType4 = this._getType(input2); + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.boolean) { - const ctx = this._getOrReturnCtx(input2); + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.boolean, @@ -244441,7 +190128,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - return OK(input2.data); + return OK(input.data); } }; ZodBoolean2.create = (params) => { @@ -244452,13 +190139,13 @@ var init_types3 = __esm(() => { }); }; ZodDate2 = class ZodDate2 extends ZodType2 { - _parse(input2) { + _parse(input) { if (this._def.coerce) { - input2.data = new Date(input2.data); + input.data = new Date(input.data); } - const parsedType4 = this._getType(input2); + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.date) { - const ctx2 = this._getOrReturnCtx(input2); + const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.date, @@ -244466,8 +190153,8 @@ var init_types3 = __esm(() => { }); return INVALID; } - if (Number.isNaN(input2.data.getTime())) { - const ctx2 = this._getOrReturnCtx(input2); + if (Number.isNaN(input.data.getTime())) { + const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode2.invalid_date }); @@ -244477,8 +190164,8 @@ var init_types3 = __esm(() => { let ctx = undefined; for (const check3 of this._def.checks) { if (check3.kind === "min") { - if (input2.data.getTime() < check3.value) { - ctx = this._getOrReturnCtx(input2, ctx); + if (input.data.getTime() < check3.value) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.too_small, message: check3.message, @@ -244490,8 +190177,8 @@ var init_types3 = __esm(() => { status.dirty(); } } else if (check3.kind === "max") { - if (input2.data.getTime() > check3.value) { - ctx = this._getOrReturnCtx(input2, ctx); + if (input.data.getTime() > check3.value) { + ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode2.too_big, message: check3.message, @@ -244508,7 +190195,7 @@ var init_types3 = __esm(() => { } return { status: status.value, - value: new Date(input2.data.getTime()) + value: new Date(input.data.getTime()) }; } _addCheck(check3) { @@ -244561,10 +190248,10 @@ var init_types3 = __esm(() => { }); }; ZodSymbol2 = class ZodSymbol2 extends ZodType2 { - _parse(input2) { - const parsedType4 = this._getType(input2); + _parse(input) { + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.symbol) { - const ctx = this._getOrReturnCtx(input2); + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.symbol, @@ -244572,7 +190259,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - return OK(input2.data); + return OK(input.data); } }; ZodSymbol2.create = (params) => { @@ -244582,10 +190269,10 @@ var init_types3 = __esm(() => { }); }; ZodUndefined2 = class ZodUndefined2 extends ZodType2 { - _parse(input2) { - const parsedType4 = this._getType(input2); + _parse(input) { + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input2); + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.undefined, @@ -244593,7 +190280,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - return OK(input2.data); + return OK(input.data); } }; ZodUndefined2.create = (params) => { @@ -244603,10 +190290,10 @@ var init_types3 = __esm(() => { }); }; ZodNull2 = class ZodNull2 extends ZodType2 { - _parse(input2) { - const parsedType4 = this._getType(input2); + _parse(input) { + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.null) { - const ctx = this._getOrReturnCtx(input2); + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.null, @@ -244614,7 +190301,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - return OK(input2.data); + return OK(input.data); } }; ZodNull2.create = (params) => { @@ -244628,8 +190315,8 @@ var init_types3 = __esm(() => { super(...arguments); this._any = true; } - _parse(input2) { - return OK(input2.data); + _parse(input) { + return OK(input.data); } }; ZodAny2.create = (params) => { @@ -244643,8 +190330,8 @@ var init_types3 = __esm(() => { super(...arguments); this._unknown = true; } - _parse(input2) { - return OK(input2.data); + _parse(input) { + return OK(input.data); } }; ZodUnknown2.create = (params) => { @@ -244654,8 +190341,8 @@ var init_types3 = __esm(() => { }); }; ZodNever2 = class ZodNever2 extends ZodType2 { - _parse(input2) { - const ctx = this._getOrReturnCtx(input2); + _parse(input) { + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.never, @@ -244671,10 +190358,10 @@ var init_types3 = __esm(() => { }); }; ZodVoid2 = class ZodVoid2 extends ZodType2 { - _parse(input2) { - const parsedType4 = this._getType(input2); + _parse(input) { + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input2); + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.void, @@ -244682,7 +190369,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - return OK(input2.data); + return OK(input.data); } }; ZodVoid2.create = (params) => { @@ -244692,8 +190379,8 @@ var init_types3 = __esm(() => { }); }; ZodArray2 = class ZodArray2 extends ZodType2 { - _parse(input2) { - const { ctx, status } = this._processInputParams(input2); + _parse(input) { + const { ctx, status } = this._processInputParams(input); const def2 = this._def; if (ctx.parsedType !== ZodParsedType.array) { addIssueToContext(ctx, { @@ -244807,10 +190494,10 @@ var init_types3 = __esm(() => { this._cached = { shape, keys: keys2 }; return this._cached; } - _parse(input2) { - const parsedType4 = this._getType(input2); + _parse(input) { + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.object) { - const ctx2 = this._getOrReturnCtx(input2); + const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.object, @@ -244818,7 +190505,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - const { status, ctx } = this._processInputParams(input2); + const { status, ctx } = this._processInputParams(input); const { shape, keys: shapeKeys } = this._getCached(); const extraKeys = []; if (!(this._def.catchall instanceof ZodNever2 && this._def.unknownKeys === "strip")) { @@ -245046,8 +190733,8 @@ var init_types3 = __esm(() => { }); }; ZodUnion2 = class ZodUnion2 extends ZodType2 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); + _parse(input) { + const { ctx } = this._processInputParams(input); const options2 = this._def.options; function handleResults(results) { for (const result2 of results) { @@ -245137,8 +190824,8 @@ var init_types3 = __esm(() => { }); }; ZodDiscriminatedUnion2 = class ZodDiscriminatedUnion2 extends ZodType2 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); + _parse(input) { + const { ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.object) { addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, @@ -245205,8 +190892,8 @@ var init_types3 = __esm(() => { } }; ZodIntersection2 = class ZodIntersection2 extends ZodType2 { - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); + _parse(input) { + const { status, ctx } = this._processInputParams(input); const handleParsed = (parsedLeft, parsedRight) => { if (isAborted(parsedLeft) || isAborted(parsedRight)) { return INVALID; @@ -245258,8 +190945,8 @@ var init_types3 = __esm(() => { }); }; ZodTuple2 = class ZodTuple2 extends ZodType2 { - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); + _parse(input) { + const { status, ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.array) { addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, @@ -245331,8 +191018,8 @@ var init_types3 = __esm(() => { get valueSchema() { return this._def.valueType; } - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); + _parse(input) { + const { status, ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.object) { addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, @@ -245384,8 +191071,8 @@ var init_types3 = __esm(() => { get valueSchema() { return this._def.valueType; } - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); + _parse(input) { + const { status, ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.map) { addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, @@ -245444,8 +191131,8 @@ var init_types3 = __esm(() => { }); }; ZodSet2 = class ZodSet2 extends ZodType2 { - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); + _parse(input) { + const { status, ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.set) { addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, @@ -245533,8 +191220,8 @@ var init_types3 = __esm(() => { super(...arguments); this.validate = this.implement; } - _parse(input2) { - const { ctx } = this._processInputParams(input2); + _parse(input) { + const { ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.function) { addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, @@ -245543,25 +191230,25 @@ var init_types3 = __esm(() => { }); return INVALID; } - function makeArgsIssue(args, error45) { + function makeArgsIssue(args, error41) { return makeIssue({ data: args, path: ctx.path, errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap2(), en_default2].filter((x2) => !!x2), issueData: { code: ZodIssueCode2.invalid_arguments, - argumentsError: error45 + argumentsError: error41 } }); } - function makeReturnsIssue(returns, error45) { + function makeReturnsIssue(returns, error41) { return makeIssue({ data: returns, path: ctx.path, errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap2(), en_default2].filter((x2) => !!x2), issueData: { code: ZodIssueCode2.invalid_return_type, - returnTypeError: error45 + returnTypeError: error41 } }); } @@ -245570,15 +191257,15 @@ var init_types3 = __esm(() => { if (this._def.returns instanceof ZodPromise2) { const me = this; return OK(async function(...args) { - const error45 = new ZodError2([]); + const error41 = new ZodError2([]); const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => { - error45.addIssue(makeArgsIssue(args, e)); - throw error45; + error41.addIssue(makeArgsIssue(args, e)); + throw error41; }); const result2 = await Reflect.apply(fn, this, parsedArgs); const parsedReturns = await me._def.returns._def.type.parseAsync(result2, params).catch((e) => { - error45.addIssue(makeReturnsIssue(result2, e)); - throw error45; + error41.addIssue(makeReturnsIssue(result2, e)); + throw error41; }); return parsedReturns; }); @@ -245637,8 +191324,8 @@ var init_types3 = __esm(() => { get schema() { return this._def.getter(); } - _parse(input2) { - const { ctx } = this._processInputParams(input2); + _parse(input) { + const { ctx } = this._processInputParams(input); const lazySchema2 = this._def.getter(); return lazySchema2._parse({ data: ctx.data, path: ctx.path, parent: ctx }); } @@ -245651,9 +191338,9 @@ var init_types3 = __esm(() => { }); }; ZodLiteral2 = class ZodLiteral2 extends ZodType2 { - _parse(input2) { - if (input2.data !== this._def.value) { - const ctx = this._getOrReturnCtx(input2); + _parse(input) { + if (input.data !== this._def.value) { + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { received: ctx.data, code: ZodIssueCode2.invalid_literal, @@ -245661,7 +191348,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - return { status: "valid", value: input2.data }; + return { status: "valid", value: input.data }; } get value() { return this._def.value; @@ -245675,9 +191362,9 @@ var init_types3 = __esm(() => { }); }; ZodEnum2 = class ZodEnum2 extends ZodType2 { - _parse(input2) { - if (typeof input2.data !== "string") { - const ctx = this._getOrReturnCtx(input2); + _parse(input) { + if (typeof input.data !== "string") { + const ctx = this._getOrReturnCtx(input); const expectedValues = this._def.values; addIssueToContext(ctx, { expected: util3.joinValues(expectedValues), @@ -245689,8 +191376,8 @@ var init_types3 = __esm(() => { if (!this._cache) { this._cache = new Set(this._def.values); } - if (!this._cache.has(input2.data)) { - const ctx = this._getOrReturnCtx(input2); + if (!this._cache.has(input.data)) { + const ctx = this._getOrReturnCtx(input); const expectedValues = this._def.values; addIssueToContext(ctx, { received: ctx.data, @@ -245699,7 +191386,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - return OK(input2.data); + return OK(input.data); } get options() { return this._def.values; @@ -245725,14 +191412,14 @@ var init_types3 = __esm(() => { } return enumValues; } - extract(values3, newDef = this._def) { - return ZodEnum2.create(values3, { + extract(values2, newDef = this._def) { + return ZodEnum2.create(values2, { ...this._def, ...newDef }); } - exclude(values3, newDef = this._def) { - return ZodEnum2.create(this.options.filter((opt) => !values3.includes(opt)), { + exclude(values2, newDef = this._def) { + return ZodEnum2.create(this.options.filter((opt) => !values2.includes(opt)), { ...this._def, ...newDef }); @@ -245740,9 +191427,9 @@ var init_types3 = __esm(() => { }; ZodEnum2.create = createZodEnum; ZodNativeEnum = class ZodNativeEnum extends ZodType2 { - _parse(input2) { + _parse(input) { const nativeEnumValues = util3.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input2); + const ctx = this._getOrReturnCtx(input); if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { const expectedValues = util3.objectValues(nativeEnumValues); addIssueToContext(ctx, { @@ -245755,7 +191442,7 @@ var init_types3 = __esm(() => { if (!this._cache) { this._cache = new Set(util3.getValidEnumValues(this._def.values)); } - if (!this._cache.has(input2.data)) { + if (!this._cache.has(input.data)) { const expectedValues = util3.objectValues(nativeEnumValues); addIssueToContext(ctx, { received: ctx.data, @@ -245764,15 +191451,15 @@ var init_types3 = __esm(() => { }); return INVALID; } - return OK(input2.data); + return OK(input.data); } get enum() { return this._def.values; } }; - ZodNativeEnum.create = (values3, params) => { + ZodNativeEnum.create = (values2, params) => { return new ZodNativeEnum({ - values: values3, + values: values2, typeName: ZodFirstPartyTypeKind.ZodNativeEnum, ...processCreateParams(params) }); @@ -245781,8 +191468,8 @@ var init_types3 = __esm(() => { unwrap() { return this._def.type; } - _parse(input2) { - const { ctx } = this._processInputParams(input2); + _parse(input) { + const { ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, @@ -245814,8 +191501,8 @@ var init_types3 = __esm(() => { sourceType() { return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; } - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); + _parse(input) { + const { status, ctx } = this._processInputParams(input); const effect = this._def.effect || null; const checkCtx = { addIssue: (arg) => { @@ -245947,12 +191634,12 @@ var init_types3 = __esm(() => { }); }; ZodOptional2 = class ZodOptional2 extends ZodType2 { - _parse(input2) { - const parsedType4 = this._getType(input2); + _parse(input) { + const parsedType4 = this._getType(input); if (parsedType4 === ZodParsedType.undefined) { return OK(undefined); } - return this._def.innerType._parse(input2); + return this._def.innerType._parse(input); } unwrap() { return this._def.innerType; @@ -245966,12 +191653,12 @@ var init_types3 = __esm(() => { }); }; ZodNullable2 = class ZodNullable2 extends ZodType2 { - _parse(input2) { - const parsedType4 = this._getType(input2); + _parse(input) { + const parsedType4 = this._getType(input); if (parsedType4 === ZodParsedType.null) { return OK(null); } - return this._def.innerType._parse(input2); + return this._def.innerType._parse(input); } unwrap() { return this._def.innerType; @@ -245985,8 +191672,8 @@ var init_types3 = __esm(() => { }); }; ZodDefault2 = class ZodDefault2 extends ZodType2 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); + _parse(input) { + const { ctx } = this._processInputParams(input); let data = ctx.data; if (ctx.parsedType === ZodParsedType.undefined) { data = this._def.defaultValue(); @@ -246010,8 +191697,8 @@ var init_types3 = __esm(() => { }); }; ZodCatch2 = class ZodCatch2 extends ZodType2 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); + _parse(input) { + const { ctx } = this._processInputParams(input); const newCtx = { ...ctx, common: { @@ -246063,10 +191750,10 @@ var init_types3 = __esm(() => { }); }; ZodNaN2 = class ZodNaN2 extends ZodType2 { - _parse(input2) { - const parsedType4 = this._getType(input2); + _parse(input) { + const parsedType4 = this._getType(input); if (parsedType4 !== ZodParsedType.nan) { - const ctx = this._getOrReturnCtx(input2); + const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode2.invalid_type, expected: ZodParsedType.nan, @@ -246074,7 +191761,7 @@ var init_types3 = __esm(() => { }); return INVALID; } - return { status: "valid", value: input2.data }; + return { status: "valid", value: input.data }; } }; ZodNaN2.create = (params) => { @@ -246085,8 +191772,8 @@ var init_types3 = __esm(() => { }; BRAND = Symbol("zod_brand"); ZodBranded = class ZodBranded extends ZodType2 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); + _parse(input) { + const { ctx } = this._processInputParams(input); const data = ctx.data; return this._def.type._parse({ data, @@ -246099,8 +191786,8 @@ var init_types3 = __esm(() => { } }; ZodPipeline = class ZodPipeline extends ZodType2 { - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); + _parse(input) { + const { status, ctx } = this._processInputParams(input); if (ctx.common.async) { const handleAsync = async () => { const inResult = await this._def.in._parseAsync({ @@ -246154,8 +191841,8 @@ var init_types3 = __esm(() => { } }; ZodReadonly2 = class ZodReadonly2 extends ZodType2 { - _parse(input2) { - const result2 = this._def.innerType._parse(input2); + _parse(input) { + const result2 = this._def.innerType._parse(input); const freeze = (data) => { if (isValid(data)) { data.value = Object.freeze(data.value); @@ -246390,7 +192077,7 @@ var init_v3 = __esm(() => { }); // node_modules/zod/v4/mini/parse.js -var init_parse5 = __esm(() => { +var init_parse4 = __esm(() => { init_core4(); }); @@ -246398,7 +192085,7 @@ var init_parse5 = __esm(() => { var init_schemas4 = __esm(() => { init_core4(); init_core4(); - init_parse5(); + init_parse4(); }); // node_modules/zod/v4/mini/checks.js @@ -246421,7 +192108,7 @@ var init_coerce2 = __esm(() => { // node_modules/zod/v4/mini/external.js var init_external3 = __esm(() => { init_core4(); - init_parse5(); + init_parse4(); init_schemas4(); init_checks3(); init_core4(); @@ -247633,8 +193320,8 @@ class Protocol { resolver(message); } else { const errorMessage2 = message; - const error45 = new McpError(errorMessage2.error.code, errorMessage2.error.message, errorMessage2.error.data); - resolver(error45); + const error41 = new McpError(errorMessage2.error.code, errorMessage2.error.message, errorMessage2.error.data); + resolver(error41); } } else { const messageType = queuedMessage.type === "response" ? "Response" : "Error"; @@ -247678,8 +193365,8 @@ class Protocol { nextCursor, _meta: {} }; - } catch (error45) { - throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${error45 instanceof Error ? error45.message : String(error45)}`); + } catch (error41) { + throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${error41 instanceof Error ? error41.message : String(error41)}`); } }); this.setRequestHandler(CancelTaskRequestSchema, async (request, extra) => { @@ -247701,11 +193388,11 @@ class Protocol { _meta: {}, ...cancelledTask }; - } catch (error45) { - if (error45 instanceof McpError) { - throw error45; + } catch (error41) { + if (error41 instanceof McpError) { + throw error41; } - throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${error45 instanceof Error ? error45.message : String(error45)}`); + throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${error41 instanceof Error ? error41.message : String(error41)}`); } }); } @@ -247761,9 +193448,9 @@ class Protocol { this._onclose(); }; const _onerror = this.transport?.onerror; - this._transport.onerror = (error45) => { - _onerror?.(error45); - this._onerror(error45); + this._transport.onerror = (error41) => { + _onerror?.(error41); + this._onerror(error41); }; const _onmessage = this._transport?.onmessage; this._transport.onmessage = (message, extra) => { @@ -247794,28 +193481,28 @@ class Protocol { controller.abort(); } this._requestHandlerAbortControllers.clear(); - const error45 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed"); + const error41 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed"); this._transport = undefined; this.onclose?.(); - for (const handler2 of responseHandlers.values()) { - handler2(error45); + for (const handler8 of responseHandlers.values()) { + handler8(error41); } } - _onerror(error45) { - this.onerror?.(error45); + _onerror(error41) { + this.onerror?.(error41); } _onnotification(notification) { - const handler2 = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler; - if (handler2 === undefined) { + const handler8 = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler; + if (handler8 === undefined) { return; } - Promise.resolve().then(() => handler2(notification)).catch((error45) => this._onerror(new Error(`Uncaught error in notification handler: ${error45}`))); + Promise.resolve().then(() => handler8(notification)).catch((error41) => this._onerror(new Error(`Uncaught error in notification handler: ${error41}`))); } _onrequest(request, extra) { - const handler2 = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler; + const handler8 = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler; const capturedTransport = this._transport; const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId; - if (handler2 === undefined) { + if (handler8 === undefined) { const errorResponse = { jsonrpc: "2.0", id: request.id, @@ -247829,9 +193516,9 @@ class Protocol { type: "error", message: errorResponse, timestamp: Date.now() - }, capturedTransport?.sessionId).catch((error45) => this._onerror(new Error(`Failed to enqueue error response: ${error45}`))); + }, capturedTransport?.sessionId).catch((error41) => this._onerror(new Error(`Failed to enqueue error response: ${error41}`))); } else { - capturedTransport?.send(errorResponse).catch((error45) => this._onerror(new Error(`Failed to send an error response: ${error45}`))); + capturedTransport?.send(errorResponse).catch((error41) => this._onerror(new Error(`Failed to send an error response: ${error41}`))); } return; } @@ -247879,7 +193566,7 @@ class Protocol { if (taskCreationParams) { this.assertTaskHandlerCapability(request.method); } - }).then(() => handler2(request, fullExtra)).then(async (result2) => { + }).then(() => handler8(request, fullExtra)).then(async (result2) => { if (abortController.signal.aborted) { return; } @@ -247897,7 +193584,7 @@ class Protocol { } else { await capturedTransport?.send(response); } - }, async (error45) => { + }, async (error41) => { if (abortController.signal.aborted) { return; } @@ -247905,9 +193592,9 @@ class Protocol { jsonrpc: "2.0", id: request.id, error: { - code: Number.isSafeInteger(error45["code"]) ? error45["code"] : ErrorCode.InternalError, - message: error45.message ?? "Internal error", - ...error45["data"] !== undefined && { data: error45["data"] } + code: Number.isSafeInteger(error41["code"]) ? error41["code"] : ErrorCode.InternalError, + message: error41.message ?? "Internal error", + ...error41["data"] !== undefined && { data: error41["data"] } } }; if (relatedTaskId && this._taskMessageQueue) { @@ -247919,7 +193606,7 @@ class Protocol { } else { await capturedTransport?.send(errorResponse); } - }).catch((error45) => this._onerror(new Error(`Failed to send response: ${error45}`))).finally(() => { + }).catch((error41) => this._onerror(new Error(`Failed to send response: ${error41}`))).finally(() => { if (this._requestHandlerAbortControllers.get(request.id) === abortController) { this._requestHandlerAbortControllers.delete(request.id); } @@ -247928,8 +193615,8 @@ class Protocol { _onprogress(notification) { const { progressToken, ...params } = notification.params; const messageId = Number(progressToken); - const handler2 = this._progressHandlers.get(messageId); - if (!handler2) { + const handler8 = this._progressHandlers.get(messageId); + if (!handler8) { this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`)); return; } @@ -247938,15 +193625,15 @@ class Protocol { if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) { try { this._resetTimeout(messageId); - } catch (error45) { + } catch (error41) { this._responseHandlers.delete(messageId); this._progressHandlers.delete(messageId); this._cleanupTimeout(messageId); - responseHandler(error45); + responseHandler(error41); return; } } - handler2(params); + handler8(params); } _onresponse(response) { const messageId = Number(response.id); @@ -247956,13 +193643,13 @@ class Protocol { if (isJSONRPCResultResponse(response)) { resolver(response); } else { - const error45 = new McpError(response.error.code, response.error.message, response.error.data); - resolver(error45); + const error41 = new McpError(response.error.code, response.error.message, response.error.data); + resolver(error41); } return; } - const handler2 = this._responseHandlers.get(messageId); - if (handler2 === undefined) { + const handler8 = this._responseHandlers.get(messageId); + if (handler8 === undefined) { this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`)); return; } @@ -247983,10 +193670,10 @@ class Protocol { this._progressHandlers.delete(messageId); } if (isJSONRPCResultResponse(response)) { - handler2(response); + handler8(response); } else { - const error45 = McpError.fromError(response.error.code, response.error.message, response.error.data); - handler2(error45); + const error41 = McpError.fromError(response.error.code, response.error.message, response.error.data); + handler8(error41); } } get transport() { @@ -248001,10 +193688,10 @@ class Protocol { try { const result2 = await this.request(request, resultSchema, options2); yield { type: "result", result: result2 }; - } catch (error45) { + } catch (error41) { yield { type: "error", - error: error45 instanceof McpError ? error45 : new McpError(ErrorCode.InternalError, String(error45)) + error: error41 instanceof McpError ? error41 : new McpError(ErrorCode.InternalError, String(error41)) }; } return; @@ -248047,18 +193734,18 @@ class Protocol { await new Promise((resolve13) => setTimeout(resolve13, pollInterval)); options2?.signal?.throwIfAborted(); } - } catch (error45) { + } catch (error41) { yield { type: "error", - error: error45 instanceof McpError ? error45 : new McpError(ErrorCode.InternalError, String(error45)) + error: error41 instanceof McpError ? error41 : new McpError(ErrorCode.InternalError, String(error41)) }; } } request(request, resultSchema, options2) { const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options2 ?? {}; return new Promise((resolve13, reject2) => { - const earlyReject = (error45) => { - reject2(error45); + const earlyReject = (error41) => { + reject2(error41); }; if (!this._transport) { earlyReject(new Error("Not connected")); @@ -248118,9 +193805,9 @@ class Protocol { requestId: messageId, reason: String(reason) } - }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error46) => this._onerror(new Error(`Failed to send cancellation: ${error46}`))); - const error45 = reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason)); - reject2(error45); + }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error42) => this._onerror(new Error(`Failed to send cancellation: ${error42}`))); + const error41 = reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason)); + reject2(error41); }; this._responseHandlers.set(messageId, (response) => { if (options2?.signal?.aborted) { @@ -248136,8 +193823,8 @@ class Protocol { } else { resolve13(parseResult.data); } - } catch (error45) { - reject2(error45); + } catch (error41) { + reject2(error41); } }); options2?.signal?.addEventListener("abort", () => { @@ -248149,9 +193836,9 @@ class Protocol { const relatedTaskId = relatedTask?.taskId; if (relatedTaskId) { const responseResolver = (response) => { - const handler2 = this._responseHandlers.get(messageId); - if (handler2) { - handler2(response); + const handler8 = this._responseHandlers.get(messageId); + if (handler8) { + handler8(response); } else { this._onerror(new Error(`Response handler missing for side-channeled request ${messageId}`)); } @@ -248161,14 +193848,14 @@ class Protocol { type: "request", message: jsonrpcRequest, timestamp: Date.now() - }).catch((error45) => { + }).catch((error41) => { this._cleanupTimeout(messageId); - reject2(error45); + reject2(error41); }); } else { - this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error45) => { + this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error41) => { this._cleanupTimeout(messageId); - reject2(error45); + reject2(error41); }); } }); @@ -248238,7 +193925,7 @@ class Protocol { } }; } - this._transport?.send(jsonrpcNotification2, options2).catch((error45) => this._onerror(error45)); + this._transport?.send(jsonrpcNotification2, options2).catch((error41) => this._onerror(error41)); }); return; } @@ -248260,12 +193947,12 @@ class Protocol { } await this._transport.send(jsonrpcNotification, options2); } - setRequestHandler(requestSchema, handler2) { + setRequestHandler(requestSchema, handler8) { const method2 = getMethodLiteral(requestSchema); this.assertRequestHandlerCapability(method2); this._requestHandlers.set(method2, (request, extra) => { const parsed = parseWithCompat(requestSchema, request); - return Promise.resolve(handler2(parsed, extra)); + return Promise.resolve(handler8(parsed, extra)); }); } removeRequestHandler(method2) { @@ -248276,11 +193963,11 @@ class Protocol { throw new Error(`A request handler for ${method2} already exists, which would be overridden`); } } - setNotificationHandler(notificationSchema, handler2) { + setNotificationHandler(notificationSchema, handler8) { const method2 = getMethodLiteral(notificationSchema); this._notificationHandlers.set(method2, (notification) => { const parsed = parseWithCompat(notificationSchema, notification); - return Promise.resolve(handler2(parsed)); + return Promise.resolve(handler8(parsed)); }); } removeNotificationHandler(method2) { @@ -248473,12 +194160,12 @@ var require_code = __commonJS((exports) => { return item === "" || item === '""'; } get str() { - var _a3; - return (_a3 = this._str) !== null && _a3 !== undefined ? _a3 : this._str = this._items.reduce((s, c5) => `${s}${c5}`, ""); + var _a2; + return (_a2 = this._str) !== null && _a2 !== undefined ? _a2 : this._str = this._items.reduce((s, c5) => `${s}${c5}`, ""); } get names() { - var _a3; - return (_a3 = this._names) !== null && _a3 !== undefined ? _a3 : this._names = this._items.reduce((names, c5) => { + var _a2; + return (_a2 = this._names) !== null && _a2 !== undefined ? _a2 : this._names = this._items.reduce((names, c5) => { if (c5 instanceof Name) names[c5.str] = (names[c5.str] || 0) + 1; return names; @@ -248623,8 +194310,8 @@ var require_scope = __commonJS((exports) => { return `${prefix}${ng.index++}`; } _nameGroup(prefix) { - var _a3, _b; - if (((_b = (_a3 = this._parent) === null || _a3 === undefined ? undefined : _a3._prefixes) === null || _b === undefined ? undefined : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { + var _a2, _b; + if (((_b = (_a2 = this._parent) === null || _a2 === undefined ? undefined : _a2._prefixes) === null || _b === undefined ? undefined : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); } return this._names[prefix] = { prefix, index: 0 }; @@ -248659,12 +194346,12 @@ var require_scope = __commonJS((exports) => { return new ValueScopeName(prefix, this._newName(prefix)); } value(nameOrPrefix, value) { - var _a3; + var _a2; if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value"); const name = this.toName(nameOrPrefix); const { prefix } = name; - const valueKey = (_a3 = value.key) !== null && _a3 !== undefined ? _a3 : value.ref; + const valueKey = (_a2 = value.key) !== null && _a2 !== undefined ? _a2 : value.ref; let vs = this._values[prefix]; if (vs) { const _name = vs.get(valueKey); @@ -248686,24 +194373,24 @@ var require_scope = __commonJS((exports) => { return; return vs.get(keyOrRef); } - scopeRefs(scopeName, values3 = this._values) { - return this._reduceValues(values3, (name) => { + scopeRefs(scopeName, values2 = this._values) { + return this._reduceValues(values2, (name) => { if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`); return (0, code_1._)`${scopeName}${name.scopePath}`; }); } - scopeCode(values3 = this._values, usedValues, getCode) { - return this._reduceValues(values3, (name) => { + scopeCode(values2 = this._values, usedValues, getCode) { + return this._reduceValues(values2, (name) => { if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`); return name.value.code; }, usedValues, getCode); } - _reduceValues(values3, valueCode, usedValues = {}, getCode) { + _reduceValues(values2, valueCode, usedValues = {}, getCode) { let code = code_1.nil; - for (const prefix in values3) { - const vs = values3[prefix]; + for (const prefix in values2) { + const vs = values2[prefix]; if (!vs) continue; const nameSet = usedValues[prefix] = usedValues[prefix] || new Map; @@ -248875,9 +194562,9 @@ var require_codegen = __commonJS((exports) => { } class Throw extends Node2 { - constructor(error45) { + constructor(error41) { super(); - this.error = error45; + this.error = error41; } render({ _n }) { return `throw ${this.error};` + _n; @@ -248992,8 +194679,8 @@ var require_codegen = __commonJS((exports) => { return this; } optimizeNames(names, constants4) { - var _a3; - this.else = (_a3 = this.else) === null || _a3 === undefined ? undefined : _a3.optimizeNames(names, constants4); + var _a2; + this.else = (_a2 = this.else) === null || _a2 === undefined ? undefined : _a2.optimizeNames(names, constants4); if (!(super.optimizeNames(names, constants4) || this.else)) return; this.condition = optimizeExpr(this.condition, names, constants4); @@ -249104,16 +194791,16 @@ var require_codegen = __commonJS((exports) => { return code; } optimizeNodes() { - var _a3, _b; + var _a2, _b; super.optimizeNodes(); - (_a3 = this.catch) === null || _a3 === undefined || _a3.optimizeNodes(); + (_a2 = this.catch) === null || _a2 === undefined || _a2.optimizeNodes(); (_b = this.finally) === null || _b === undefined || _b.optimizeNodes(); return this; } optimizeNames(names, constants4) { - var _a3, _b; + var _a2, _b; super.optimizeNames(names, constants4); - (_a3 = this.catch) === null || _a3 === undefined || _a3.optimizeNames(names, constants4); + (_a2 = this.catch) === null || _a2 === undefined || _a2.optimizeNames(names, constants4); (_b = this.finally) === null || _b === undefined || _b.optimizeNames(names, constants4); return this; } @@ -249128,9 +194815,9 @@ var require_codegen = __commonJS((exports) => { } class Catch extends BlockNode { - constructor(error45) { + constructor(error41) { super(); - this.error = error45; + this.error = error41; } render(opts) { return `catch(${this.error})` + super.render(opts); @@ -249298,9 +194985,9 @@ var require_codegen = __commonJS((exports) => { this._blockNode(node); this.code(tryBody); if (catchCode) { - const error45 = this.name("e"); - this._currNode = node.catch = new Catch(error45); - catchCode(error45); + const error41 = this.name("e"); + this._currNode = node.catch = new Catch(error41); + catchCode(error41); } if (finallyCode) { this._currNode = node.finally = new Finally; @@ -249308,8 +194995,8 @@ var require_codegen = __commonJS((exports) => { } return this._endBlockNode(Catch, Finally); } - throw(error45) { - return this._leafNode(new Throw(error45)); + throw(error41) { + return this._leafNode(new Throw(error41)); } block(body, nodeCount) { this._blockStarts.push(this._nodes.length); @@ -249440,7 +195127,7 @@ var require_codegen = __commonJS((exports) => { }); // node_modules/ajv/dist/compile/util.js -var require_util11 = __commonJS((exports) => { +var require_util9 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = undefined; var codegen_1 = require_codegen(); @@ -249633,7 +195320,7 @@ var require_errors8 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = undefined; var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var names_1 = require_names(); exports.keywordError = { message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation` @@ -249641,10 +195328,10 @@ var require_errors8 = __commonJS((exports) => { exports.keyword$DataError = { message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)` }; - function reportError2(cxt, error45 = exports.keywordError, errorPaths, overrideAllErrors) { + function reportError2(cxt, error41 = exports.keywordError, errorPaths, overrideAllErrors) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error45, errorPaths); + const errObj = errorObjectCode(cxt, error41, errorPaths); if (overrideAllErrors !== null && overrideAllErrors !== undefined ? overrideAllErrors : compositeRule || allErrors) { addError(gen, errObj); } else { @@ -249652,10 +195339,10 @@ var require_errors8 = __commonJS((exports) => { } } exports.reportError = reportError2; - function reportExtraError(cxt, error45 = exports.keywordError, errorPaths) { + function reportExtraError(cxt, error41 = exports.keywordError, errorPaths) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error45, errorPaths); + const errObj = errorObjectCode(cxt, error41, errorPaths); addError(gen, errObj); if (!(compositeRule || allErrors)) { returnErrors(it, names_1.default.vErrors); @@ -249705,19 +195392,19 @@ var require_errors8 = __commonJS((exports) => { schema: new codegen_1.Name("schema"), parentSchema: new codegen_1.Name("parentSchema") }; - function errorObjectCode(cxt, error45, errorPaths) { + function errorObjectCode(cxt, error41, errorPaths) { const { createErrors } = cxt.it; if (createErrors === false) return (0, codegen_1._)`{}`; - return errorObject(cxt, error45, errorPaths); + return errorObject(cxt, error41, errorPaths); } - function errorObject(cxt, error45, errorPaths = {}) { + function errorObject(cxt, error41, errorPaths = {}) { const { gen, it } = cxt; const keyValues = [ errorInstancePath(it, errorPaths), errorSchemaPath(cxt, errorPaths) ]; - extraErrorProps(cxt, error45, keyValues); + extraErrorProps(cxt, error41, keyValues); return gen.object(...keyValues); } function errorInstancePath({ errorPath }, { instancePath }) { @@ -249836,8 +195523,8 @@ var require_applicability = __commonJS((exports) => { } exports.shouldUseGroup = shouldUseGroup; function shouldUseRule(schema, rule) { - var _a3; - return schema[rule.keyword] !== undefined || ((_a3 = rule.definition.implements) === null || _a3 === undefined ? undefined : _a3.some((kwd) => schema[kwd] !== undefined)); + var _a2; + return schema[rule.keyword] !== undefined || ((_a2 = rule.definition.implements) === null || _a2 === undefined ? undefined : _a2.some((kwd) => schema[kwd] !== undefined)); } exports.shouldUseRule = shouldUseRule; }); @@ -249850,7 +195537,7 @@ var require_dataType = __commonJS((exports) => { var applicability_1 = require_applicability(); var errors_1 = require_errors8(); var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var DataType; (function(DataType2) { DataType2[DataType2["Correct"] = 0] = "Correct"; @@ -250028,7 +195715,7 @@ var require_defaults = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.assignDefaults = undefined; var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); function assignDefaults(it, ty) { const { properties, items } = it.schema; if (ty === "object" && properties) { @@ -250062,9 +195749,9 @@ var require_code2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = undefined; var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var names_1 = require_names(); - var util_2 = require_util11(); + var util_2 = require_util9(); function checkReportMissingProp(cxt, prop) { const { gen, data, it } = cxt; gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { @@ -250212,14 +195899,14 @@ var require_keyword = __commonJS((exports) => { } exports.macroKeywordCode = macroKeywordCode; function funcKeywordCode(cxt, def2) { - var _a3; + var _a2; const { gen, keyword, schema, parentSchema, $data, it } = cxt; checkAsyncKeyword(it, def2); const validate2 = !$data && def2.compile ? def2.compile.call(it.self, schema, parentSchema, it) : def2.validate; const validateRef = useKeyword(gen, keyword, validate2); const valid = gen.let("valid"); cxt.block$data(valid, validateKeyword); - cxt.ok((_a3 = def2.valid) !== null && _a3 !== undefined ? _a3 : valid); + cxt.ok((_a2 = def2.valid) !== null && _a2 !== undefined ? _a2 : valid); function validateKeyword() { if (def2.errors === false) { assignValid(); @@ -250250,8 +195937,8 @@ var require_keyword = __commonJS((exports) => { gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def2.modifying); } function reportErrs(errors4) { - var _a4; - gen.if((0, codegen_1.not)((_a4 = def2.valid) !== null && _a4 !== undefined ? _a4 : valid), errors4); + var _a3; + gen.if((0, codegen_1.not)((_a3 = def2.valid) !== null && _a3 !== undefined ? _a3 : valid), errors4); } } exports.funcKeywordCode = funcKeywordCode; @@ -250306,7 +195993,7 @@ var require_subschema = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = undefined; var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { if (keyword !== undefined && schema !== undefined) { throw new Error('both "keyword" and "schema" passed, only one allowed'); @@ -250510,7 +196197,7 @@ var require_json_schema_traverse = __commonJS((exports, module) => { var require_resolve = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = undefined; - var util_1 = require_util11(); + var util_1 = require_util9(); var equal = require_fast_deep_equal(); var traverse = require_json_schema_traverse(); var SIMPLE_INLINED = new Set([ @@ -250660,7 +196347,7 @@ var require_resolve = __commonJS((exports) => { }); // node_modules/ajv/dist/compile/validate/index.js -var require_validate3 = __commonJS((exports) => { +var require_validate2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getData = exports.KeywordCxt = exports.validateFunctionCode = undefined; var boolSchema_1 = require_boolSchema(); @@ -250673,7 +196360,7 @@ var require_validate3 = __commonJS((exports) => { var codegen_1 = require_codegen(); var names_1 = require_names(); var resolve_1 = require_resolve(); - var util_1 = require_util11(); + var util_1 = require_util9(); var errors_1 = require_errors8(); function validateFunctionCode(it) { if (isSchemaObj(it)) { @@ -251201,24 +196888,24 @@ var require_compile = __commonJS((exports) => { var validation_error_1 = require_validation_error(); var names_1 = require_names(); var resolve_1 = require_resolve(); - var util_1 = require_util11(); - var validate_1 = require_validate3(); + var util_1 = require_util9(); + var validate_1 = require_validate2(); class SchemaEnv { - constructor(env5) { - var _a3; + constructor(env4) { + var _a2; this.refs = {}; this.dynamicAnchors = {}; let schema; - if (typeof env5.schema == "object") - schema = env5.schema; - this.schema = env5.schema; - this.schemaId = env5.schemaId; - this.root = env5.root || this; - this.baseId = (_a3 = env5.baseId) !== null && _a3 !== undefined ? _a3 : (0, resolve_1.normalizeId)(schema === null || schema === undefined ? undefined : schema[env5.schemaId || "$id"]); - this.schemaPath = env5.schemaPath; - this.localRefs = env5.localRefs; - this.meta = env5.meta; + if (typeof env4.schema == "object") + schema = env4.schema; + this.schema = env4.schema; + this.schemaId = env4.schemaId; + this.root = env4.root || this; + this.baseId = (_a2 = env4.baseId) !== null && _a2 !== undefined ? _a2 : (0, resolve_1.normalizeId)(schema === null || schema === undefined ? undefined : schema[env4.schemaId || "$id"]); + this.schemaPath = env4.schemaPath; + this.localRefs = env4.localRefs; + this.meta = env4.meta; this.$async = schema === null || schema === undefined ? undefined : schema.$async; this.refs = {}; } @@ -251310,14 +196997,14 @@ var require_compile = __commonJS((exports) => { } exports.compileSchema = compileSchema; function resolveRef2(root2, baseId, ref) { - var _a3; + var _a2; ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); const schOrFunc = root2.refs[ref]; if (schOrFunc) return schOrFunc; let _sch = resolve13.call(this, root2, ref); if (_sch === undefined) { - const schema = (_a3 = root2.localRefs) === null || _a3 === undefined ? undefined : _a3[ref]; + const schema = (_a2 = root2.localRefs) === null || _a2 === undefined ? undefined : _a2[ref]; const { schemaId } = this.opts; if (schema) _sch = new SchemaEnv({ schema, schemaId, root: root2, baseId }); @@ -251386,8 +197073,8 @@ var require_compile = __commonJS((exports) => { "definitions" ]); function getJsonPointer(parsedRef, { baseId, schema, root: root2 }) { - var _a3; - if (((_a3 = parsedRef.fragment) === null || _a3 === undefined ? undefined : _a3[0]) !== "/") + var _a2; + if (((_a2 = parsedRef.fragment) === null || _a2 === undefined ? undefined : _a2[0]) !== "/") return; for (const part of parsedRef.fragment.slice(1).split("/")) { if (typeof schema === "boolean") @@ -251401,15 +197088,15 @@ var require_compile = __commonJS((exports) => { baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); } } - let env5; + let env4; if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); - env5 = resolveSchema.call(this, root2, $ref); + env4 = resolveSchema.call(this, root2, $ref); } const { schemaId } = this.opts; - env5 = env5 || new SchemaEnv({ schema, schemaId, root: root2, baseId }); - if (env5.schema !== env5.root.schema) - return env5; + env4 = env4 || new SchemaEnv({ schema, schemaId, root: root2, baseId }); + if (env4.schema !== env4.root.schema) + return env4; return; } }); @@ -251432,30 +197119,30 @@ var require_data = __commonJS((exports, module) => { }); // node_modules/fast-uri/lib/utils.js -var require_utils13 = __commonJS((exports, module) => { +var require_utils12 = __commonJS((exports, module) => { var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu); var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u); - function stringArrayToHexStripped(input2) { + function stringArrayToHexStripped(input) { let acc = ""; let code = 0; let i2 = 0; - for (i2 = 0;i2 < input2.length; i2++) { - code = input2[i2].charCodeAt(0); + for (i2 = 0;i2 < input.length; i2++) { + code = input[i2].charCodeAt(0); if (code === 48) { continue; } if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { return ""; } - acc += input2[i2]; + acc += input[i2]; break; } - for (i2 += 1;i2 < input2.length; i2++) { - code = input2[i2].charCodeAt(0); + for (i2 += 1;i2 < input.length; i2++) { + code = input[i2].charCodeAt(0); if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { return ""; } - acc += input2[i2]; + acc += input[i2]; } return acc; } @@ -251477,7 +197164,7 @@ var require_utils13 = __commonJS((exports, module) => { } return true; } - function getIPV6(input2) { + function getIPV6(input) { let tokenCount = 0; const output = { error: false, address: "", zone: "" }; const address = []; @@ -251485,8 +197172,8 @@ var require_utils13 = __commonJS((exports, module) => { let endipv6Encountered = false; let endIpv6 = false; let consume = consumeHextets; - for (let i2 = 0;i2 < input2.length; i2++) { - const cursor = input2[i2]; + for (let i2 = 0;i2 < input.length; i2++) { + const cursor = input[i2]; if (cursor === "[" || cursor === "]") { continue; } @@ -251501,7 +197188,7 @@ var require_utils13 = __commonJS((exports, module) => { output.error = true; break; } - if (i2 > 0 && input2[i2 - 1] === ":") { + if (i2 > 0 && input[i2 - 1] === ":") { endipv6Encountered = true; } address.push(":"); @@ -251553,38 +197240,38 @@ var require_utils13 = __commonJS((exports, module) => { } return ind; } - function removeDotSegments(path12) { - let input2 = path12; + function removeDotSegments(path10) { + let input = path10; const output = []; let nextSlash = -1; let len = 0; - while (len = input2.length) { + while (len = input.length) { if (len === 1) { - if (input2 === ".") { + if (input === ".") { break; - } else if (input2 === "/") { + } else if (input === "/") { output.push("/"); break; } else { - output.push(input2); + output.push(input); break; } } else if (len === 2) { - if (input2[0] === ".") { - if (input2[1] === ".") { + if (input[0] === ".") { + if (input[1] === ".") { break; - } else if (input2[1] === "/") { - input2 = input2.slice(2); + } else if (input[1] === "/") { + input = input.slice(2); continue; } - } else if (input2[0] === "/") { - if (input2[1] === "." || input2[1] === "/") { + } else if (input[0] === "/") { + if (input[1] === "." || input[1] === "/") { output.push("/"); break; } } } else if (len === 3) { - if (input2 === "/..") { + if (input === "/..") { if (output.length !== 0) { output.pop(); } @@ -251592,24 +197279,24 @@ var require_utils13 = __commonJS((exports, module) => { break; } } - if (input2[0] === ".") { - if (input2[1] === ".") { - if (input2[2] === "/") { - input2 = input2.slice(3); + if (input[0] === ".") { + if (input[1] === ".") { + if (input[2] === "/") { + input = input.slice(3); continue; } - } else if (input2[1] === "/") { - input2 = input2.slice(2); + } else if (input[1] === "/") { + input = input.slice(2); continue; } - } else if (input2[0] === "/") { - if (input2[1] === ".") { - if (input2[2] === "/") { - input2 = input2.slice(2); + } else if (input[0] === "/") { + if (input[1] === ".") { + if (input[2] === "/") { + input = input.slice(2); continue; - } else if (input2[2] === ".") { - if (input2[3] === "/") { - input2 = input2.slice(3); + } else if (input[2] === ".") { + if (input[3] === "/") { + input = input.slice(3); if (output.length !== 0) { output.pop(); } @@ -251618,12 +197305,12 @@ var require_utils13 = __commonJS((exports, module) => { } } } - if ((nextSlash = input2.indexOf("/", 1)) === -1) { - output.push(input2); + if ((nextSlash = input.indexOf("/", 1)) === -1) { + output.push(input); break; } else { - output.push(input2.slice(0, nextSlash)); - input2 = input2.slice(nextSlash); + output.push(input.slice(0, nextSlash)); + input = input.slice(nextSlash); } } return output.join(""); @@ -251688,7 +197375,7 @@ var require_utils13 = __commonJS((exports, module) => { // node_modules/fast-uri/lib/schemes.js var require_schemes = __commonJS((exports, module) => { - var { isUUID } = require_utils13(); + var { isUUID } = require_utils12(); var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; var supportedSchemeNames = [ "http", @@ -251744,8 +197431,8 @@ var require_schemes = __commonJS((exports, module) => { wsComponent.secure = undefined; } if (wsComponent.resourceName) { - const [path12, query] = wsComponent.resourceName.split("?"); - wsComponent.path = path12 && path12 !== "/" ? path12 : undefined; + const [path10, query] = wsComponent.resourceName.split("?"); + wsComponent.path = path10 && path10 !== "/" ? path10 : undefined; wsComponent.query = query; wsComponent.resourceName = undefined; } @@ -251862,7 +197549,7 @@ var require_schemes = __commonJS((exports, module) => { // node_modules/fast-uri/index.js var require_fast_uri = __commonJS((exports, module) => { - var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils13(); + var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils12(); var { SCHEMES, getSchemeHandler } = require_schemes(); function normalize7(uri, options2) { if (typeof uri === "string") { @@ -252123,7 +197810,7 @@ var require_uri2 = __commonJS((exports) => { var require_core = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = undefined; - var validate_1 = require_validate3(); + var validate_1 = require_validate2(); Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { return validate_1.KeywordCxt; } }); @@ -252153,7 +197840,7 @@ var require_core = __commonJS((exports) => { var codegen_2 = require_codegen(); var resolve_1 = require_resolve(); var dataType_1 = require_dataType(); - var util_1 = require_util11(); + var util_1 = require_util9(); var $dataRefSchema = require_data(); var uri_1 = require_uri2(); var defaultRegExp = (str, flags) => new RegExp(str, flags); @@ -252198,9 +197885,9 @@ var require_core = __commonJS((exports) => { }; var MAX_EXPRESSION = 200; function requiredOptions(o2) { - var _a3, _b, _c19, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; + var _a2, _b, _c19, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; const s = o2.strict; - const _optz = (_a3 = o2.code) === null || _a3 === undefined ? undefined : _a3.optimize; + const _optz = (_a2 = o2.code) === null || _a2 === undefined ? undefined : _a2.optimize; const optimize2 = _optz === true || _optz === undefined ? 1 : _optz || 0; const regExp = (_c19 = (_b = o2.code) === null || _b === undefined ? undefined : _b.regExp) !== null && _c19 !== undefined ? _c19 : defaultRegExp; const uriResolver = (_d = o2.uriResolver) !== null && _d !== undefined ? _d : uri_1.default; @@ -252586,11 +198273,11 @@ var require_core = __commonJS((exports) => { Ajv.ValidationError = validation_error_1.default; Ajv.MissingRefError = ref_error_1.default; exports.default = Ajv; - function checkOptions(checkOpts, options2, msg, log2 = "error") { + function checkOptions(checkOpts, options2, msg, log = "error") { for (const key in checkOpts) { const opt = key; if (opt in options2) - this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`); + this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); } } function getSchEnv(keyRef) { @@ -252659,7 +198346,7 @@ var require_core = __commonJS((exports) => { } } function addRule(keyword, definition, dataType) { - var _a3; + var _a2; const post = definition === null || definition === undefined ? undefined : definition.post; if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"'); @@ -252685,7 +198372,7 @@ var require_core = __commonJS((exports) => { else ruleGroup.rules.push(rule); RULES.all[keyword] = rule; - (_a3 = definition.implements) === null || _a3 === undefined || _a3.forEach((kwd) => this.addKeyword(kwd)); + (_a2 = definition.implements) === null || _a2 === undefined || _a2.forEach((kwd) => this.addKeyword(kwd)); } function addBeforeRule(ruleGroup, rule, before2) { const i2 = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before2); @@ -252733,14 +198420,14 @@ var require_ref2 = __commonJS((exports) => { var codegen_1 = require_codegen(); var names_1 = require_names(); var compile_1 = require_compile(); - var util_1 = require_util11(); + var util_1 = require_util9(); var def2 = { keyword: "$ref", schemaType: "string", code(cxt) { const { gen, schema: $ref, it } = cxt; - const { baseId, schemaEnv: env5, validateName, opts, self: self2 } = it; - const { root: root2 } = env5; + const { baseId, schemaEnv: env4, validateName, opts, self: self2 } = it; + const { root: root2 } = env4; if (($ref === "#" || $ref === "#/") && baseId === root2.baseId) return callRootRef(); const schOrEnv = compile_1.resolveRef.call(self2, root2, baseId, $ref); @@ -252750,8 +198437,8 @@ var require_ref2 = __commonJS((exports) => { return callValidate(schOrEnv); return inlineRefSchema(schOrEnv); function callRootRef() { - if (env5 === root2) - return callRef(cxt, validateName, env5, env5.$async); + if (env4 === root2) + return callRef(cxt, validateName, env4, env4.$async); const rootName = gen.scopeValue("root", { ref: root2 }); return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root2, root2.$async); } @@ -252781,14 +198468,14 @@ var require_ref2 = __commonJS((exports) => { exports.getValidate = getValidate; function callRef(cxt, v, sch, $async) { const { gen, it } = cxt; - const { allErrors, schemaEnv: env5, opts } = it; + const { allErrors, schemaEnv: env4, opts } = it; const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; if ($async) callAsyncRef(); else callSyncRef(); function callAsyncRef() { - if (!env5.$async) + if (!env4.$async) throw new Error("async schema referenced by sync schema"); const valid = gen.let("valid"); gen.try(() => { @@ -252813,10 +198500,10 @@ var require_ref2 = __commonJS((exports) => { gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); } function addEvaluatedFrom(source) { - var _a3; + var _a2; if (!it.opts.unevaluated) return; - const schEvaluated = (_a3 = sch === null || sch === undefined ? undefined : sch.validate) === null || _a3 === undefined ? undefined : _a3.evaluated; + const schEvaluated = (_a2 = sch === null || sch === undefined ? undefined : sch.validate) === null || _a2 === undefined ? undefined : _a2.evaluated; if (it.props !== true) { if (schEvaluated && !schEvaluated.dynamicProps) { if (schEvaluated.props !== undefined) { @@ -252872,7 +198559,7 @@ var require_limitNumber = __commonJS((exports) => { exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; - var error45 = { + var error41 = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; @@ -252881,7 +198568,7 @@ var require_limitNumber = __commonJS((exports) => { type: "number", schemaType: "number", $data: true, - error: error45, + error: error41, code(cxt) { const { keyword, data, schemaCode } = cxt; cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); @@ -252894,7 +198581,7 @@ var require_limitNumber = __commonJS((exports) => { var require_multipleOf = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var error45 = { + var error41 = { message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}` }; @@ -252903,7 +198590,7 @@ var require_multipleOf = __commonJS((exports) => { type: "number", schemaType: "number", $data: true, - error: error45, + error: error41, code(cxt) { const { gen, data, schemaCode, it } = cxt; const prec = it.opts.multipleOfPrecision; @@ -252942,9 +198629,9 @@ var require_ucs2length = __commonJS((exports) => { var require_limitLength = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var ucs2length_1 = require_ucs2length(); - var error45 = { + var error41 = { message({ keyword, schemaCode }) { const comp = keyword === "maxLength" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`; @@ -252956,7 +198643,7 @@ var require_limitLength = __commonJS((exports) => { type: "string", schemaType: "number", $data: true, - error: error45, + error: error41, code(cxt) { const { keyword, data, schemaCode, it } = cxt; const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -252971,9 +198658,9 @@ var require_limitLength = __commonJS((exports) => { var require_pattern = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); - var util_1 = require_util11(); + var util_1 = require_util9(); var codegen_1 = require_codegen(); - var error45 = { + var error41 = { message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}` }; @@ -252982,7 +198669,7 @@ var require_pattern = __commonJS((exports) => { type: "string", schemaType: "string", $data: true, - error: error45, + error: error41, code(cxt) { const { gen, data, $data, schema, schemaCode, it } = cxt; const u2 = it.opts.unicodeRegExp ? "u" : ""; @@ -253005,7 +198692,7 @@ var require_pattern = __commonJS((exports) => { var require_limitProperties = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var error45 = { + var error41 = { message({ keyword, schemaCode }) { const comp = keyword === "maxProperties" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`; @@ -253017,7 +198704,7 @@ var require_limitProperties = __commonJS((exports) => { type: "object", schemaType: "number", $data: true, - error: error45, + error: error41, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -253032,8 +198719,8 @@ var require_required = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); var codegen_1 = require_codegen(); - var util_1 = require_util11(); - var error45 = { + var util_1 = require_util9(); + var error41 = { message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}` }; @@ -253042,7 +198729,7 @@ var require_required = __commonJS((exports) => { type: "object", schemaType: "array", $data: true, - error: error45, + error: error41, code(cxt) { const { gen, schema, schemaCode, data, $data, it } = cxt; const { opts } = it; @@ -253110,7 +198797,7 @@ var require_required = __commonJS((exports) => { var require_limitItems = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var error45 = { + var error41 = { message({ keyword, schemaCode }) { const comp = keyword === "maxItems" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`; @@ -253122,7 +198809,7 @@ var require_limitItems = __commonJS((exports) => { type: "array", schemaType: "number", $data: true, - error: error45, + error: error41, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -253145,9 +198832,9 @@ var require_uniqueItems = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var dataType_1 = require_dataType(); var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var equal_1 = require_equal(); - var error45 = { + var error41 = { message: ({ params: { i: i2, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i2} are identical)`, params: ({ params: { i: i2, j } }) => (0, codegen_1._)`{i: ${i2}, j: ${j}}` }; @@ -253156,7 +198843,7 @@ var require_uniqueItems = __commonJS((exports) => { type: "array", schemaType: "boolean", $data: true, - error: error45, + error: error41, code(cxt) { const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; if (!$data && !schema) @@ -253208,16 +198895,16 @@ var require_uniqueItems = __commonJS((exports) => { var require_const = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var equal_1 = require_equal(); - var error45 = { + var error41 = { message: "must be equal to constant", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}` }; var def2 = { keyword: "const", $data: true, - error: error45, + error: error41, code(cxt) { const { gen, data, $data, schemaCode, schema } = cxt; if ($data || schema && typeof schema == "object") { @@ -253234,9 +198921,9 @@ var require_const = __commonJS((exports) => { var require_enum = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var equal_1 = require_equal(); - var error45 = { + var error41 = { message: "must be equal to one of the allowed values", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` }; @@ -253244,7 +198931,7 @@ var require_enum = __commonJS((exports) => { keyword: "enum", schemaType: "array", $data: true, - error: error45, + error: error41, code(cxt) { const { gen, data, $data, schema, schemaCode, it } = cxt; if (!$data && schema.length === 0) @@ -253311,8 +198998,8 @@ var require_additionalItems = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateAdditionalItems = undefined; var codegen_1 = require_codegen(); - var util_1 = require_util11(); - var error45 = { + var util_1 = require_util9(); + var error41 = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; @@ -253321,7 +199008,7 @@ var require_additionalItems = __commonJS((exports) => { type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", - error: error45, + error: error41, code(cxt) { const { parentSchema, it } = cxt; const { items } = parentSchema; @@ -253361,7 +199048,7 @@ var require_items = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateTuple = undefined; var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var code_1 = require_code2(); var def2 = { keyword: "items", @@ -253428,10 +199115,10 @@ var require_prefixItems = __commonJS((exports) => { var require_items2020 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var code_1 = require_code2(); var additionalItems_1 = require_additionalItems(); - var error45 = { + var error41 = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; @@ -253440,7 +199127,7 @@ var require_items2020 = __commonJS((exports) => { type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", - error: error45, + error: error41, code(cxt) { const { schema, parentSchema, it } = cxt; const { prefixItems } = parentSchema; @@ -253460,8 +199147,8 @@ var require_items2020 = __commonJS((exports) => { var require_contains = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var util_1 = require_util11(); - var error45 = { + var util_1 = require_util9(); + var error41 = { message: ({ params: { min: min2, max: max2 } }) => max2 === undefined ? (0, codegen_1.str)`must contain at least ${min2} valid item(s)` : (0, codegen_1.str)`must contain at least ${min2} and no more than ${max2} valid item(s)`, params: ({ params: { min: min2, max: max2 } }) => max2 === undefined ? (0, codegen_1._)`{minContains: ${min2}}` : (0, codegen_1._)`{minContains: ${min2}, maxContains: ${max2}}` }; @@ -253471,7 +199158,7 @@ var require_contains = __commonJS((exports) => { schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: true, - error: error45, + error: error41, code(cxt) { const { gen, schema, parentSchema, data, it } = cxt; let min2; @@ -253552,7 +199239,7 @@ var require_dependencies = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = undefined; var codegen_1 = require_codegen(); - var util_1 = require_util11(); + var util_1 = require_util9(); var code_1 = require_code2(); exports.error = { message: ({ params: { property: property2, depsCount, deps } }) => { @@ -253636,8 +199323,8 @@ var require_dependencies = __commonJS((exports) => { var require_propertyNames = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var util_1 = require_util11(); - var error45 = { + var util_1 = require_util9(); + var error41 = { message: "property name must be valid", params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}` }; @@ -253645,7 +199332,7 @@ var require_propertyNames = __commonJS((exports) => { keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], - error: error45, + error: error41, code(cxt) { const { gen, schema, data, it } = cxt; if ((0, util_1.alwaysValidSchema)(it, schema)) @@ -253678,8 +199365,8 @@ var require_additionalProperties = __commonJS((exports) => { var code_1 = require_code2(); var codegen_1 = require_codegen(); var names_1 = require_names(); - var util_1 = require_util11(); - var error45 = { + var util_1 = require_util9(); + var error41 = { message: "must NOT have additional properties", params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}` }; @@ -253689,7 +199376,7 @@ var require_additionalProperties = __commonJS((exports) => { schemaType: ["boolean", "object"], allowUndefined: true, trackErrors: true, - error: error45, + error: error41, code(cxt) { const { gen, schema, parentSchema, data, errsCount, it } = cxt; if (!errsCount) @@ -253778,9 +199465,9 @@ var require_additionalProperties = __commonJS((exports) => { // node_modules/ajv/dist/vocabularies/applicator/properties.js var require_properties = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var validate_1 = require_validate3(); + var validate_1 = require_validate2(); var code_1 = require_code2(); - var util_1 = require_util11(); + var util_1 = require_util9(); var additionalProperties_1 = require_additionalProperties(); var def2 = { keyword: "properties", @@ -253835,8 +199522,8 @@ var require_patternProperties = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code2(); var codegen_1 = require_codegen(); - var util_1 = require_util11(); - var util_2 = require_util11(); + var util_1 = require_util9(); + var util_2 = require_util9(); var def2 = { keyword: "patternProperties", type: "object", @@ -253904,7 +199591,7 @@ var require_patternProperties = __commonJS((exports) => { // node_modules/ajv/dist/vocabularies/applicator/not.js var require_not = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util11(); + var util_1 = require_util9(); var def2 = { keyword: "not", schemaType: ["object", "boolean"], @@ -253947,8 +199634,8 @@ var require_anyOf = __commonJS((exports) => { var require_oneOf = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var util_1 = require_util11(); - var error45 = { + var util_1 = require_util9(); + var error41 = { message: "must match exactly one schema in oneOf", params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}` }; @@ -253956,7 +199643,7 @@ var require_oneOf = __commonJS((exports) => { keyword: "oneOf", schemaType: "array", trackErrors: true, - error: error45, + error: error41, code(cxt) { const { gen, schema, parentSchema, it } = cxt; if (!Array.isArray(schema)) @@ -254001,7 +199688,7 @@ var require_oneOf = __commonJS((exports) => { // node_modules/ajv/dist/vocabularies/applicator/allOf.js var require_allOf = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util11(); + var util_1 = require_util9(); var def2 = { keyword: "allOf", schemaType: "array", @@ -254026,8 +199713,8 @@ var require_allOf = __commonJS((exports) => { var require_if = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var util_1 = require_util11(); - var error45 = { + var util_1 = require_util9(); + var error41 = { message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}` }; @@ -254035,7 +199722,7 @@ var require_if = __commonJS((exports) => { keyword: "if", schemaType: ["object", "boolean"], trackErrors: true, - error: error45, + error: error41, code(cxt) { const { gen, parentSchema, it } = cxt; if (parentSchema.then === undefined && parentSchema.else === undefined) { @@ -254091,7 +199778,7 @@ var require_if = __commonJS((exports) => { // node_modules/ajv/dist/vocabularies/applicator/thenElse.js var require_thenElse = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util11(); + var util_1 = require_util9(); var def2 = { keyword: ["then", "else"], schemaType: ["object", "boolean"], @@ -254150,7 +199837,7 @@ var require_applicator = __commonJS((exports) => { var require_format = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen(); - var error45 = { + var error41 = { message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}` }; @@ -254159,7 +199846,7 @@ var require_format = __commonJS((exports) => { type: ["number", "string"], schemaType: "string", $data: true, - error: error45, + error: error41, code(cxt, ruleType) { const { gen, data, $data, schema, schemaCode, it } = cxt; const { opts, errSchemaPath, schemaEnv, self: self2 } = it; @@ -254298,8 +199985,8 @@ var require_discriminator = __commonJS((exports) => { var types_1 = require_types2(); var compile_1 = require_compile(); var ref_error_1 = require_ref_error(); - var util_1 = require_util11(); - var error45 = { + var util_1 = require_util9(); + var error41 = { message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`, params: ({ params: { discrError, tag: tag2, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag2}}` }; @@ -254307,7 +199994,7 @@ var require_discriminator = __commonJS((exports) => { keyword: "discriminator", type: "object", schemaType: "object", - error: error45, + error: error41, code(cxt) { const { gen, data, schema, parentSchema, it } = cxt; const { oneOf } = parentSchema; @@ -254343,7 +200030,7 @@ var require_discriminator = __commonJS((exports) => { return _valid; } function getMapping() { - var _a3; + var _a2; const oneOfMapping = {}; const topRequired = hasRequired(parentSchema); let tagRequired = true; @@ -254357,7 +200044,7 @@ var require_discriminator = __commonJS((exports) => { if (sch === undefined) throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); } - const propSch = (_a3 = sch === null || sch === undefined ? undefined : sch.properties) === null || _a3 === undefined ? undefined : _a3[tagName]; + const propSch = (_a2 = sch === null || sch === undefined ? undefined : sch.properties) === null || _a2 === undefined ? undefined : _a2[tagName]; if (typeof propSch != "object") { throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); } @@ -254583,7 +200270,7 @@ var require_ajv = __commonJS((exports, module) => { module.exports.Ajv = Ajv; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Ajv; - var validate_1 = require_validate3(); + var validate_1 = require_validate2(); Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { return validate_1.KeywordCxt; } }); @@ -254806,7 +200493,7 @@ var require_limit = __commonJS((exports) => { formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; - var error45 = { + var error41 = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; @@ -254815,7 +200502,7 @@ var require_limit = __commonJS((exports) => { type: "string", schemaType: "string", $data: true, - error: error45, + error: error41, code(cxt) { const { gen, data, schemaCode, keyword, it } = cxt; const { opts, self: self2 } = it; @@ -254863,7 +200550,7 @@ var require_limit = __commonJS((exports) => { }); // node_modules/ajv-formats/dist/index.js -var require_dist9 = __commonJS((exports, module) => { +var require_dist6 = __commonJS((exports, module) => { Object.defineProperty(exports, "__esModule", { value: true }); var formats_1 = require_formats(); var limit_1 = require_limit(); @@ -254890,9 +200577,9 @@ var require_dist9 = __commonJS((exports, module) => { return f; }; function addFormats(ajv, list2, fs2, exportName) { - var _a3; + var _a2; var _b; - (_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== undefined || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`); + (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== undefined || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`); for (const f of list2) ajv.addFormat(f, fs2[f]); } @@ -254920,12 +200607,12 @@ class AjvJsonSchemaValidator { } getValidator(schema) { const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema) : this._ajv.compile(schema); - return (input2) => { - const valid = ajvValidator(input2); + return (input) => { + const valid = ajvValidator(input); if (valid) { return { valid: true, - data: input2, + data: input, errorMessage: undefined }; } else { @@ -254941,7 +200628,7 @@ class AjvJsonSchemaValidator { var import_ajv, import_ajv_formats; var init_ajv_provider = __esm(() => { import_ajv = __toESM(require_ajv(), 1); - import_ajv_formats = __toESM(require_dist9(), 1); + import_ajv_formats = __toESM(require_dist6(), 1); }); // node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js @@ -254977,14 +200664,14 @@ class ExperimentalClientTasks { }; return; } - } catch (error45) { - if (error45 instanceof McpError) { - yield { type: "error", error: error45 }; + } catch (error41) { + if (error41 instanceof McpError) { + yield { type: "error", error: error41 }; return; } yield { type: "error", - error: new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error45 instanceof Error ? error45.message : String(error45)}`) + error: new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error41 instanceof Error ? error41.message : String(error41)}`) }; return; } @@ -255009,7 +200696,7 @@ class ExperimentalClientTasks { return this._client.requestStream(request, resultSchema, options2); } } -var init_client8 = __esm(() => { +var init_client4 = __esm(() => { init_types4(); }); @@ -255091,12 +200778,12 @@ function getSupportedElicitationModes(capabilities) { return { supportsFormMode, supportsUrlMode }; } var Client; -var init_client9 = __esm(() => { +var init_client5 = __esm(() => { init_protocol(); init_types4(); init_ajv_provider(); init_zod_compat(); - init_client8(); + init_client4(); Client = class Client extends Protocol { constructor(_clientInfo, options2) { super(options2); @@ -255145,7 +200832,7 @@ var init_client9 = __esm(() => { } this._capabilities = mergeCapabilities(this._capabilities, capabilities); } - setRequestHandler(requestSchema, handler2) { + setRequestHandler(requestSchema, handler8) { const shape = getObjectShape(requestSchema); const methodSchema = shape?.method; if (!methodSchema) { @@ -255181,7 +200868,7 @@ var init_client9 = __esm(() => { if (params.mode === "url" && !supportsUrlMode) { throw new McpError(ErrorCode.InvalidParams, "Client does not support URL-mode elicitation requests"); } - const result2 = await Promise.resolve(handler2(request, extra)); + const result2 = await Promise.resolve(handler8(request, extra)); if (params.task) { const taskValidationResult = safeParse3(CreateTaskResultSchema, result2); if (!taskValidationResult.success) { @@ -255216,7 +200903,7 @@ var init_client9 = __esm(() => { throw new McpError(ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage2}`); } const { params } = validatedRequest.data; - const result2 = await Promise.resolve(handler2(request, extra)); + const result2 = await Promise.resolve(handler8(request, extra)); if (params.task) { const taskValidationResult = safeParse3(CreateTaskResultSchema, result2); if (!taskValidationResult.success) { @@ -255236,7 +200923,7 @@ var init_client9 = __esm(() => { }; return super.setRequestHandler(requestSchema, wrappedHandler); } - return super.setRequestHandler(requestSchema, handler2); + return super.setRequestHandler(requestSchema, handler8); } assertCapability(capability, method2) { if (!this._serverCapabilities?.[capability]) { @@ -255276,9 +200963,9 @@ var init_client9 = __esm(() => { this._setupListChangedHandlers(this._pendingListChangedConfig); this._pendingListChangedConfig = undefined; } - } catch (error45) { + } catch (error41) { this.close(); - throw error45; + throw error41; } } getServerCapabilities() { @@ -255434,11 +201121,11 @@ var init_client9 = __esm(() => { if (!validationResult.valid) { throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`); } - } catch (error45) { - if (error45 instanceof McpError) { - throw error45; + } catch (error41) { + if (error41 instanceof McpError) { + throw error41; } - throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error45 instanceof Error ? error45.message : String(error45)}`); + throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error41 instanceof Error ? error41.message : String(error41)}`); } } } @@ -255498,11 +201185,11 @@ var init_client9 = __esm(() => { const items = await fetcher(); onChanged(null, items); } catch (e) { - const error45 = e instanceof Error ? e : new Error(String(e)); - onChanged(error45, null); + const error41 = e instanceof Error ? e : new Error(String(e)); + onChanged(error41, null); } }; - const handler2 = () => { + const handler8 = () => { if (debounceMs) { const existingTimer = this._listChangedDebounceTimers.get(listType); if (existingTimer) { @@ -255514,7 +201201,7 @@ var init_client9 = __esm(() => { refresh(); } }; - this.setNotificationHandler(notificationSchema, handler2); + this.setNotificationHandler(notificationSchema, handler8); } async sendRootsListChanged() { return this.notification({ method: "notifications/roots/list_changed" }); @@ -255523,11 +201210,11 @@ var init_client9 = __esm(() => { }); // node_modules/eventsource-parser/dist/index.js -function noop9(_arg) {} +function noop7(_arg) {} function createParser(callbacks) { if (typeof callbacks == "function") throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"); - const { onEvent = noop9, onError = noop9, onRetry = noop9, onComment } = callbacks; + const { onEvent = noop7, onError = noop7, onRetry = noop7, onComment } = callbacks; let incompleteLine = "", isFirstChunk = true, id, data = "", eventType = ""; function feed(newChunk) { const chunk2 = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete, incomplete] = splitLines(`${incompleteLine}${chunk2}`); @@ -255645,8 +201332,8 @@ var init_dist5 = __esm(() => { init_dist4(); ErrorEvent = class ErrorEvent extends Event { constructor(type, errorEventInitDict) { - var _a3, _b; - super(type), this.code = (_a3 = errorEventInitDict == null ? undefined : errorEventInitDict.code) != null ? _a3 : undefined, this.message = (_b = errorEventInitDict == null ? undefined : errorEventInitDict.message) != null ? _b : undefined; + var _a2, _b; + super(type), this.code = (_a2 = errorEventInitDict == null ? undefined : errorEventInitDict.code) != null ? _a2 : undefined, this.message = (_b = errorEventInitDict == null ? undefined : errorEventInitDict.message) != null ? _b : undefined; } [Symbol.for("nodejs.util.inspect.custom")](_depth, options2, inspect3) { return inspect3(inspectableError(this), options2); @@ -255657,7 +201344,7 @@ var init_dist5 = __esm(() => { }; EventSource = class EventSource extends EventTarget { constructor(url3, eventSourceInitDict) { - var _a3, _b; + var _a2, _b; super(), __privateAdd(this, _EventSource_instances), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, __privateAdd(this, _readyState), __privateAdd(this, _url2), __privateAdd(this, _redirectUrl), __privateAdd(this, _withCredentials), __privateAdd(this, _fetch), __privateAdd(this, _reconnectInterval), __privateAdd(this, _reconnectTimer), __privateAdd(this, _lastEventId, null), __privateAdd(this, _controller), __privateAdd(this, _parser), __privateAdd(this, _onError, null), __privateAdd(this, _onMessage, null), __privateAdd(this, _onOpen, null), __privateAdd(this, _onFetchResponse, async (response) => { var _a22; __privateGet(this, _parser).reset(); @@ -255716,7 +201403,7 @@ var init_dist5 = __esm(() => { __privateSet(this, _parser, createParser({ onEvent: __privateGet(this, _onEvent), onRetry: __privateGet(this, _onRetryChange) - })), __privateSet(this, _readyState, this.CONNECTING), __privateSet(this, _reconnectInterval, 3000), __privateSet(this, _fetch, (_a3 = eventSourceInitDict == null ? undefined : eventSourceInitDict.fetch) != null ? _a3 : globalThis.fetch), __privateSet(this, _withCredentials, (_b = eventSourceInitDict == null ? undefined : eventSourceInitDict.withCredentials) != null ? _b : false), __privateMethod(this, _EventSource_instances, connect_fn).call(this); + })), __privateSet(this, _readyState, this.CONNECTING), __privateSet(this, _reconnectInterval, 3000), __privateSet(this, _fetch, (_a2 = eventSourceInitDict == null ? undefined : eventSourceInitDict.fetch) != null ? _a2 : globalThis.fetch), __privateSet(this, _withCredentials, (_b = eventSourceInitDict == null ? undefined : eventSourceInitDict.withCredentials) != null ? _b : false), __privateMethod(this, _EventSource_instances, connect_fn).call(this); } get readyState() { return __privateGet(this, _readyState); @@ -255760,27 +201447,27 @@ var init_dist5 = __esm(() => { _readyState = /* @__PURE__ */ new WeakMap, _url2 = /* @__PURE__ */ new WeakMap, _redirectUrl = /* @__PURE__ */ new WeakMap, _withCredentials = /* @__PURE__ */ new WeakMap, _fetch = /* @__PURE__ */ new WeakMap, _reconnectInterval = /* @__PURE__ */ new WeakMap, _reconnectTimer = /* @__PURE__ */ new WeakMap, _lastEventId = /* @__PURE__ */ new WeakMap, _controller = /* @__PURE__ */ new WeakMap, _parser = /* @__PURE__ */ new WeakMap, _onError = /* @__PURE__ */ new WeakMap, _onMessage = /* @__PURE__ */ new WeakMap, _onOpen = /* @__PURE__ */ new WeakMap, _EventSource_instances = /* @__PURE__ */ new WeakSet, connect_fn = function() { __privateSet(this, _readyState, this.CONNECTING), __privateSet(this, _controller, new AbortController), __privateGet(this, _fetch)(__privateGet(this, _url2), __privateMethod(this, _EventSource_instances, getRequestOptions_fn).call(this)).then(__privateGet(this, _onFetchResponse)).catch(__privateGet(this, _onFetchError)); }, _onFetchResponse = /* @__PURE__ */ new WeakMap, _onFetchError = /* @__PURE__ */ new WeakMap, getRequestOptions_fn = function() { - var _a3; + var _a2; const init = { mode: "cors", redirect: "follow", headers: { Accept: "text/event-stream", ...__privateGet(this, _lastEventId) ? { "Last-Event-ID": __privateGet(this, _lastEventId) } : undefined }, cache: "no-store", - signal: (_a3 = __privateGet(this, _controller)) == null ? undefined : _a3.signal + signal: (_a2 = __privateGet(this, _controller)) == null ? undefined : _a2.signal }; return "window" in globalThis && (init.credentials = this.withCredentials ? "include" : "same-origin"), init; }, _onEvent = /* @__PURE__ */ new WeakMap, _onRetryChange = /* @__PURE__ */ new WeakMap, failConnection_fn = function(message, code) { - var _a3; + var _a2; __privateGet(this, _readyState) !== this.CLOSED && __privateSet(this, _readyState, this.CLOSED); const errorEvent = new ErrorEvent("error", { code, message }); - (_a3 = __privateGet(this, _onError)) == null || _a3.call(this, errorEvent), this.dispatchEvent(errorEvent); + (_a2 = __privateGet(this, _onError)) == null || _a2.call(this, errorEvent), this.dispatchEvent(errorEvent); }, scheduleReconnect_fn = function(message, code) { - var _a3; + var _a2; if (__privateGet(this, _readyState) === this.CLOSED) return; __privateSet(this, _readyState, this.CONNECTING); const errorEvent = new ErrorEvent("error", { code, message }); - (_a3 = __privateGet(this, _onError)) == null || _a3.call(this, errorEvent), this.dispatchEvent(errorEvent), __privateSet(this, _reconnectTimer, setTimeout(__privateGet(this, _reconnect), __privateGet(this, _reconnectInterval))); + (_a2 = __privateGet(this, _onError)) == null || _a2.call(this, errorEvent), this.dispatchEvent(errorEvent), __privateSet(this, _reconnectTimer, setTimeout(__privateGet(this, _reconnect), __privateGet(this, _reconnectInterval))); }, _reconnect = /* @__PURE__ */ new WeakMap, EventSource.CONNECTING = 0, EventSource.OPEN = 1, EventSource.CLOSED = 2; }); @@ -255855,7 +201542,7 @@ var init_index_node = __esm(() => { // node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js var SafeUrlSchema, OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, OAuthErrorResponseSchema, OptionalSafeUrlSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema, OAuthClientRegistrationErrorSchema, OAuthTokenRevocationRequestSchema; -var init_auth4 = __esm(() => { +var init_auth3 = __esm(() => { init_v4(); SafeUrlSchema = url2().superRefine((val, ctx) => { if (!URL.canParse(val)) { @@ -256172,31 +201859,31 @@ function applyPostAuth(clientId, clientSecret, params) { function applyPublicAuth(clientId, params) { params.set("client_id", clientId); } -async function parseErrorResponse(input2) { - const statusCode = input2 instanceof Response ? input2.status : undefined; - const body = input2 instanceof Response ? await input2.text() : input2; +async function parseErrorResponse(input) { + const statusCode = input instanceof Response ? input.status : undefined; + const body = input instanceof Response ? await input.text() : input; try { const result2 = OAuthErrorResponseSchema.parse(JSON.parse(body)); - const { error: error45, error_description, error_uri } = result2; - const errorClass = OAUTH_ERRORS[error45] || ServerError; + const { error: error41, error_description, error_uri } = result2; + const errorClass = OAUTH_ERRORS[error41] || ServerError; return new errorClass(error_description || "", error_uri); - } catch (error45) { - const errorMessage2 = `${statusCode ? `HTTP ${statusCode}: ` : ""}Invalid OAuth error response: ${error45}. Raw body: ${body}`; + } catch (error41) { + const errorMessage2 = `${statusCode ? `HTTP ${statusCode}: ` : ""}Invalid OAuth error response: ${error41}. Raw body: ${body}`; return new ServerError(errorMessage2); } } async function auth(provider, options2) { try { return await authInternal(provider, options2); - } catch (error45) { - if (error45 instanceof InvalidClientError || error45 instanceof UnauthorizedClientError) { + } catch (error41) { + if (error41 instanceof InvalidClientError || error41 instanceof UnauthorizedClientError) { await provider.invalidateCredentials?.("all"); return await authInternal(provider, options2); - } else if (error45 instanceof InvalidGrantError) { + } else if (error41 instanceof InvalidGrantError) { await provider.invalidateCredentials?.("tokens"); return await authInternal(provider, options2); } - throw error45; + throw error41; } } async function authInternal(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl, fetchFn }) { @@ -256293,9 +201980,9 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res }); await provider.saveTokens(newTokens); return "AUTHORIZED"; - } catch (error45) { - if (!(error45 instanceof OAuthError) || error45 instanceof ServerError) {} else { - throw error45; + } catch (error41) { + if (!(error41 instanceof OAuthError) || error41 instanceof ServerError) {} else { + throw error41; } } } @@ -256352,11 +202039,11 @@ function extractWWWAuthenticateParams(res) { } catch {} } const scope = extractFieldFromWwwAuth(res, "scope") || undefined; - const error45 = extractFieldFromWwwAuth(res, "error") || undefined; + const error41 = extractFieldFromWwwAuth(res, "error") || undefined; return { resourceMetadataUrl, scope, - error: error45 + error: error41 }; } function extractFieldFromWwwAuth(response, fieldName) { @@ -256389,15 +202076,15 @@ async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = async function fetchWithCorsRetry(url3, headers, fetchFn = fetch) { try { return await fetchFn(url3, { headers }); - } catch (error45) { - if (error45 instanceof TypeError) { + } catch (error41) { + if (error41 instanceof TypeError) { if (headers) { return fetchWithCorsRetry(url3, undefined, fetchFn); } else { return; } } - throw error45; + throw error41; } } function buildWellKnownPath(wellKnownPrefix, pathname = "", options2 = {}) { @@ -256658,11 +202345,11 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata return OAuthClientInformationFullSchema.parse(await response.json()); } var UnauthorizedError, AUTHORIZATION_CODE_RESPONSE_TYPE = "code", AUTHORIZATION_CODE_CHALLENGE_METHOD = "S256"; -var init_auth5 = __esm(() => { +var init_auth4 = __esm(() => { init_index_node(); init_types4(); - init_auth4(); - init_auth4(); + init_auth3(); + init_auth3(); init_errors5(); UnauthorizedError = class UnauthorizedError extends Error { constructor(message) { @@ -256695,9 +202382,9 @@ class SSEClientTransport { scope: this._scope, fetchFn: this._fetchWithInit }); - } catch (error45) { - this.onerror?.(error45); - throw error45; + } catch (error41) { + this.onerror?.(error41); + throw error41; } if (result2 !== "AUTHORIZED") { throw new UnauthorizedError; @@ -256747,9 +202434,9 @@ class SSEClientTransport { this._authThenStart().then(resolve13, reject2); return; } - const error45 = new SseError(event.code, event.message, event); - reject2(error45); - this.onerror?.(error45); + const error41 = new SseError(event.code, event.message, event); + reject2(error41); + this.onerror?.(error41); }; this._eventSource.onopen = () => {}; this._eventSource.addEventListener("endpoint", (event) => { @@ -256759,9 +202446,9 @@ class SSEClientTransport { if (this._endpoint.origin !== this._url.origin) { throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`); } - } catch (error45) { - reject2(error45); - this.onerror?.(error45); + } catch (error41) { + reject2(error41); + this.onerror?.(error41); this.close(); return; } @@ -256772,8 +202459,8 @@ class SSEClientTransport { let message; try { message = JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data)); - } catch (error45) { - this.onerror?.(error45); + } catch (error41) { + this.onerror?.(error41); return; } this.onmessage?.(message); @@ -256841,9 +202528,9 @@ class SSEClientTransport { throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`); } await response.body?.cancel(); - } catch (error45) { - this.onerror?.(error45); - throw error45; + } catch (error41) { + this.onerror?.(error41); + throw error41; } } setProtocolVersion(version2) { @@ -256854,7 +202541,7 @@ var SseError; var init_sse = __esm(() => { init_dist5(); init_types4(); - init_auth5(); + init_auth4(); SseError = class SseError extends Error { constructor(code, message, event) { super(`SSE error: ${message}`); @@ -256901,7 +202588,7 @@ var init_stdio2 = __esm(() => { import process12 from "node:process"; import { PassThrough as PassThrough2 } from "node:stream"; function getDefaultEnvironment() { - const env5 = {}; + const env4 = {}; for (const key of DEFAULT_INHERITED_ENV_VARS) { const value = process12.env[key]; if (value === undefined) { @@ -256910,9 +202597,9 @@ function getDefaultEnvironment() { if (value.startsWith("()")) { continue; } - env5[key] = value; + env4[key] = value; } - return env5; + return env4; } class StdioClientTransport { @@ -256939,9 +202626,9 @@ class StdioClientTransport { windowsHide: process12.platform === "win32", cwd: this._serverParams.cwd }); - this._process.on("error", (error45) => { - reject2(error45); - this.onerror?.(error45); + this._process.on("error", (error41) => { + reject2(error41); + this.onerror?.(error41); }); this._process.on("spawn", () => { resolve13(); @@ -256950,15 +202637,15 @@ class StdioClientTransport { this._process = undefined; this.onclose?.(); }); - this._process.stdin?.on("error", (error45) => { - this.onerror?.(error45); + this._process.stdin?.on("error", (error41) => { + this.onerror?.(error41); }); this._process.stdout?.on("data", (chunk2) => { this._readBuffer.append(chunk2); this.processReadBuffer(); }); - this._process.stdout?.on("error", (error45) => { - this.onerror?.(error45); + this._process.stdout?.on("error", (error41) => { + this.onerror?.(error41); }); if (this._stderrStream && this._process.stderr) { this._process.stderr.pipe(this._stderrStream); @@ -256982,8 +202669,8 @@ class StdioClientTransport { break; } this.onmessage?.(message); - } catch (error45) { - this.onerror?.(error45); + } catch (error41) { + this.onerror?.(error41); } } } @@ -257062,8 +202749,8 @@ var init_stream2 = __esm(() => { onEvent: (event) => { controller.enqueue(event); }, - onError(error45) { - onError === "terminate" ? controller.error(error45) : typeof onError == "function" && onError(error45); + onError(error41) { + onError === "terminate" ? controller.error(error41) : typeof onError == "function" && onError(error41); }, onRetry, onComment @@ -257103,9 +202790,9 @@ class StreamableHTTPClientTransport { scope: this._scope, fetchFn: this._fetchWithInit }); - } catch (error45) { - this.onerror?.(error45); - throw error45; + } catch (error41) { + this.onerror?.(error41); + throw error41; } if (result2 !== "AUTHORIZED") { throw new UnauthorizedError; @@ -257156,9 +202843,9 @@ class StreamableHTTPClientTransport { throw new StreamableHTTPError(response.status, `Failed to open SSE stream: ${response.statusText}`); } this._handleSseStream(response.body, options2, true); - } catch (error45) { - this.onerror?.(error45); - throw error45; + } catch (error41) { + this.onerror?.(error41); + throw error41; } } _getNextReconnectionDelay(attempt2) { @@ -257178,8 +202865,8 @@ class StreamableHTTPClientTransport { } const delay2 = this._getNextReconnectionDelay(attemptCount); this._reconnectionTimeout = setTimeout(() => { - this._startOrAuthSse(options2).catch((error45) => { - this.onerror?.(new Error(`Failed to reconnect SSE stream: ${error45 instanceof Error ? error45.message : String(error45)}`)); + this._startOrAuthSse(options2).catch((error41) => { + this.onerror?.(new Error(`Failed to reconnect SSE stream: ${error41 instanceof Error ? error41.message : String(error41)}`)); this._scheduleReconnection(options2, attemptCount + 1); }); }, delay2); @@ -257222,8 +202909,8 @@ class StreamableHTTPClientTransport { } } this.onmessage?.(message); - } catch (error45) { - this.onerror?.(error45); + } catch (error41) { + this.onerror?.(error41); } } } @@ -257236,8 +202923,8 @@ class StreamableHTTPClientTransport { replayMessageId }, 0); } - } catch (error45) { - this.onerror?.(new Error(`SSE stream disconnected: ${error45}`)); + } catch (error41) { + this.onerror?.(new Error(`SSE stream disconnected: ${error41}`)); const canResume = isReconnectable || hasPrimingEvent; const needsReconnect = canResume && !receivedResponse; if (needsReconnect && this._abortController && !this._abortController.signal.aborted) { @@ -257247,8 +202934,8 @@ class StreamableHTTPClientTransport { onresumptiontoken, replayMessageId }, 0); - } catch (error46) { - this.onerror?.(new Error(`Failed to reconnect: ${error46 instanceof Error ? error46.message : String(error46)}`)); + } catch (error42) { + this.onerror?.(new Error(`Failed to reconnect: ${error42 instanceof Error ? error42.message : String(error42)}`)); } } } @@ -257328,8 +203015,8 @@ class StreamableHTTPClientTransport { return this.send(message); } if (response.status === 403 && this._authProvider) { - const { resourceMetadataUrl, scope, error: error45 } = extractWWWAuthenticateParams(response); - if (error45 === "insufficient_scope") { + const { resourceMetadataUrl, scope, error: error41 } = extractWWWAuthenticateParams(response); + if (error41 === "insufficient_scope") { const wwwAuthHeader = response.headers.get("WWW-Authenticate"); if (this._lastUpscopingHeader === wwwAuthHeader) { throw new StreamableHTTPError(403, "Server returned 403 after trying upscoping"); @@ -257383,9 +203070,9 @@ class StreamableHTTPClientTransport { } else { await response.body?.cancel(); } - } catch (error45) { - this.onerror?.(error45); - throw error45; + } catch (error41) { + this.onerror?.(error41); + throw error41; } } get sessionId() { @@ -257409,9 +203096,9 @@ class StreamableHTTPClientTransport { throw new StreamableHTTPError(response.status, `Failed to terminate session: ${response.statusText}`); } this._sessionId = undefined; - } catch (error45) { - this.onerror?.(error45); - throw error45; + } catch (error41) { + this.onerror?.(error41); + throw error41; } } setProtocolVersion(version2) { @@ -257430,7 +203117,7 @@ class StreamableHTTPClientTransport { var DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS, StreamableHTTPError; var init_streamableHttp = __esm(() => { init_types4(); - init_auth5(); + init_auth4(); init_stream2(); DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = { initialReconnectionDelay: 1000, @@ -257543,16 +203230,16 @@ async function pMap(iterable, mapper, { result2[index] = value; resolvingCount--; await next(); - } catch (error45) { + } catch (error41) { if (stopOnError) { - reject2(error45); + reject2(error41); } else { - errors4.push(error45); + errors4.push(error41); resolvingCount--; try { await next(); - } catch (error46) { - reject2(error46); + } catch (error42) { + reject2(error42); } } } @@ -257562,8 +203249,8 @@ async function pMap(iterable, mapper, { for (let index = 0;index < concurrency; index++) { try { await next(); - } catch (error45) { - reject2(error45); + } catch (error41) { + reject2(error41); break; } if (isIterableDone || isRejected) { @@ -257619,20 +203306,20 @@ function pMapIterable(iterable, mapper, { } trySpawn(); return { done: false, value: returnValue }; - } catch (error45) { + } catch (error41) { pendingPromisesCount--; isDone = true; - return { error: error45 }; + return { error: error41 }; } })(); promises.push(promise3); } trySpawn(); while (promises.length > 0) { - const { error: error45, done, value } = await promises[0]; + const { error: error41, done, value } = await promises[0]; promises.shift(); - if (error45) { - throw error45; + if (error41) { + throw error41; } if (done) { return; @@ -257958,8 +203645,8 @@ var init_defaultBindings = __esm(() => { }); // src/keybindings/parser.ts -function parseKeystroke(input2) { - const parts = input2.split("+"); +function parseKeystroke(input) { + const parts = input.split("+"); const keystroke = { key: "", ctrl: false, @@ -258020,10 +203707,10 @@ function parseKeystroke(input2) { } return keystroke; } -function parseChord(input2) { - if (input2 === " ") +function parseChord(input) { + if (input === " ") return [parseKeystroke("space")]; - return input2.trim().split(/\s+/).map(parseKeystroke); + return input.trim().split(/\s+/).map(parseKeystroke); } function keystrokeToString(ks) { const parts = []; @@ -258549,18 +204236,18 @@ async function loadKeybindings() { logForDebugging(`[keybindings] Found ${warnings.length} validation issue(s)`); } return { bindings: mergedBindings, warnings }; - } catch (error45) { - if (isENOENT(error45)) { + } catch (error41) { + if (isENOENT(error41)) { return { bindings: defaultBindings, warnings: [] }; } - logForDebugging(`[keybindings] Error loading ${userPath}: ${errorMessage(error45)}`); + logForDebugging(`[keybindings] Error loading ${userPath}: ${errorMessage(error41)}`); return { bindings: defaultBindings, warnings: [ { type: "parse_error", severity: "error", - message: `Failed to parse keybindings.json: ${errorMessage(error45)}` + message: `Failed to parse keybindings.json: ${errorMessage(error41)}` } ] }; @@ -258680,19 +204367,19 @@ function disposeKeybindingWatcher() { } keybindingsChanged.clear(); } -async function handleChange2(path12) { - logForDebugging(`[keybindings] Detected change to ${path12}`); +async function handleChange2(path10) { + logForDebugging(`[keybindings] Detected change to ${path10}`); try { const result2 = await loadKeybindings(); cachedBindings = result2.bindings; cachedWarnings = result2.warnings; keybindingsChanged.emit(result2); - } catch (error45) { - logForDebugging(`[keybindings] Error reloading: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`[keybindings] Error reloading: ${errorMessage(error41)}`); } } -function handleDelete2(path12) { - logForDebugging(`[keybindings] Detected deletion of ${path12}`); +function handleDelete2(path10) { + logForDebugging(`[keybindings] Detected deletion of ${path10}`); const defaultBindings = getDefaultParsedBindings(); cachedBindings = defaultBindings; cachedWarnings = []; @@ -258719,7 +204406,7 @@ var init_loadUserBindings = __esm(() => { }); // src/keybindings/match.ts -function getKeyName(input2, key) { +function getKeyName(input, key) { if (key.escape) return "escape"; if (key.return) @@ -258750,8 +204437,8 @@ function getKeyName(input2, key) { return "home"; if (key.end) return "end"; - if (input2.length === 1) - return input2.toLowerCase(); + if (input.length === 1) + return input.toLowerCase(); return null; } @@ -258760,8 +204447,8 @@ function getBindingDisplayText(action, context, bindings) { const binding = bindings.findLast((b) => b.action === action && b.context === context); return binding ? chordToString(binding.chord) : undefined; } -function buildKeystroke(input2, key) { - const keyName2 = getKeyName(input2, key); +function buildKeystroke(input, key) { + const keyName2 = getKeyName(input, key); if (!keyName2) return null; const effectiveMeta = key.escape ? false : key.meta; @@ -258803,11 +204490,11 @@ function chordExactlyMatches(chord, binding) { } return true; } -function resolveKeyWithChordState(input2, key, activeContexts, bindings, pending) { +function resolveKeyWithChordState(input, key, activeContexts, bindings, pending) { if (key.escape && pending !== null) { return { type: "chord_cancelled" }; } - const currentKeystroke = buildKeystroke(input2, key); + const currentKeystroke = buildKeystroke(input, key); if (!currentKeystroke) { if (pending !== null) { return { type: "chord_cancelled" }; @@ -258957,7 +204644,7 @@ function KeybindingProvider(t0) { const invokeAction = t3; let t4; if ($2[7] !== bindings || $2[8] !== pendingChordRef) { - t4 = (input2, key, contexts) => resolveKeyWithChordState(input2, key, contexts, bindings, pendingChordRef.current); + t4 = (input, key, contexts) => resolveKeyWithChordState(input, key, contexts, bindings, pendingChordRef.current); $2[7] = bindings; $2[8] = pendingChordRef; $2[9] = t4; @@ -259144,15 +204831,15 @@ var init_KeyboardShortcutHint = __esm(() => { }); // src/keybindings/useKeybinding.ts -function useKeybinding(action, handler2, options2 = {}) { +function useKeybinding(action, handler8, options2 = {}) { const { context = "Global", isActive = true } = options2; const keybindingContext = useOptionalKeybindingContext(); import_react33.useEffect(() => { if (!keybindingContext || !isActive) return; - return keybindingContext.registerHandler({ action, context, handler: handler2 }); - }, [action, context, handler2, keybindingContext, isActive]); - const handleInput = import_react33.useCallback((input2, key, event) => { + return keybindingContext.registerHandler({ action, context, handler: handler8 }); + }, [action, context, handler8, keybindingContext, isActive]); + const handleInput = import_react33.useCallback((input, key, event) => { if (!keybindingContext) return; const contextsToCheck = [ @@ -259161,12 +204848,12 @@ function useKeybinding(action, handler2, options2 = {}) { "Global" ]; const uniqueContexts = [...new Set(contextsToCheck)]; - const result2 = keybindingContext.resolve(input2, key, uniqueContexts); + const result2 = keybindingContext.resolve(input, key, uniqueContexts); switch (result2.type) { case "match": keybindingContext.setPendingChord(null); if (result2.action === action) { - if (handler2() !== false) { + if (handler8() !== false) { event.stopImmediatePropagation(); } } @@ -259185,7 +204872,7 @@ function useKeybinding(action, handler2, options2 = {}) { case "none": break; } - }, [action, context, handler2, keybindingContext]); + }, [action, context, handler8, keybindingContext]); use_input_default(handleInput, { isActive }); } function useKeybindings(handlers, options2 = {}) { @@ -259195,8 +204882,8 @@ function useKeybindings(handlers, options2 = {}) { if (!keybindingContext || !isActive) return; const unregisterFns = []; - for (const [action, handler2] of Object.entries(handlers)) { - unregisterFns.push(keybindingContext.registerHandler({ action, context, handler: handler2 })); + for (const [action, handler8] of Object.entries(handlers)) { + unregisterFns.push(keybindingContext.registerHandler({ action, context, handler: handler8 })); } return () => { for (const unregister of unregisterFns) { @@ -259204,7 +204891,7 @@ function useKeybindings(handlers, options2 = {}) { } }; }, [context, handlers, keybindingContext, isActive]); - const handleInput = import_react33.useCallback((input2, key, event) => { + const handleInput = import_react33.useCallback((input, key, event) => { if (!keybindingContext) return; const contextsToCheck = [ @@ -259213,13 +204900,13 @@ function useKeybindings(handlers, options2 = {}) { "Global" ]; const uniqueContexts = [...new Set(contextsToCheck)]; - const result2 = keybindingContext.resolve(input2, key, uniqueContexts); + const result2 = keybindingContext.resolve(input, key, uniqueContexts); switch (result2.type) { case "match": keybindingContext.setPendingChord(null); if (result2.action in handlers) { - const handler2 = handlers[result2.action]; - if (handler2 && handler2() !== false) { + const handler8 = handlers[result2.action]; + if (handler8 && handler8() !== false) { event.stopImmediatePropagation(); } } @@ -259470,7 +205157,7 @@ var NO_CONTENT_MESSAGE = "(no content)"; // src/utils/ripgrep.ts import { execFile as execFile3, spawn as spawn3 } from "child_process"; import { homedir as homedir10 } from "os"; -import * as path12 from "path"; +import * as path10 from "path"; import { fileURLToPath as fileURLToPath3 } from "url"; function ripgrepCommand() { const config2 = getRipgrepConfig(); @@ -259537,10 +205224,10 @@ function ripGrepRaw(args, target, abortSignal, callback, singleThread = false) { if (code === 0 || code === 1) { callback(null, stdout, stderr); } else { - const error45 = new Error(`ripgrep exited with code ${code}`); - error45.code = code ?? undefined; - error45.signal = signal ?? undefined; - callback(error45, stdout, stderr); + const error41 = new Error(`ripgrep exited with code ${code}`); + error41.code = code ?? undefined; + error41.signal = signal ?? undefined; + callback(error41, stdout, stderr); } }); child.on("error", (err) => { @@ -259549,8 +205236,8 @@ function ripGrepRaw(args, target, abortSignal, callback, singleThread = false) { settled = true; clearTimeout(timeoutId); clearTimeout(killTimeoutId); - const error45 = err; - callback(error45, stdout, stderr); + const error41 = err; + callback(error41, stdout, stderr); }); return child; } @@ -259639,23 +205326,23 @@ async function ripGrepStream(args, target, abortSignal, onLines) { } async function ripGrep(args, target, abortSignal) { await codesignRipgrepIfNecessary(); - testRipgrepOnFirstUse().catch((error45) => { - logError2(error45); + testRipgrepOnFirstUse().catch((error41) => { + logError2(error41); }); return new Promise((resolve14, reject2) => { - const handleResult3 = (error45, stdout, stderr, isRetry) => { - if (!error45) { + const handleResult3 = (error41, stdout, stderr, isRetry) => { + if (!error41) { resolve14(stdout.trim().split(` `).map((line) => line.replace(/\r$/, "")).filter(Boolean)); return; } - if (error45.code === 1) { + if (error41.code === 1) { resolve14([]); return; } const CRITICAL_ERROR_CODES = ["ENOENT", "EACCES", "EPERM"]; - if (CRITICAL_ERROR_CODES.includes(error45.code)) { - reject2(error45); + if (CRITICAL_ERROR_CODES.includes(error41.code)) { + reject2(error41); return; } if (!isRetry && isEagainError(stderr)) { @@ -259667,8 +205354,8 @@ async function ripGrep(args, target, abortSignal) { return; } const hasOutput = stdout && stdout.trim().length > 0; - const isTimeout = error45.signal === "SIGTERM" || error45.signal === "SIGKILL" || error45.code === "ABORT_ERR"; - const isBufferOverflow = error45.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER"; + const isTimeout = error41.signal === "SIGTERM" || error41.signal === "SIGKILL" || error41.code === "ABORT_ERR"; + const isBufferOverflow = error41.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER"; let lines = []; if (hasOutput) { lines = stdout.trim().split(` @@ -259677,9 +205364,9 @@ async function ripGrep(args, target, abortSignal) { lines = lines.slice(0, -1); } } - logForDebugging(`rg error (signal=${error45.signal}, code=${error45.code}, stderr: ${stderr}), ${lines.length} results`); - if (error45.code !== 2 && error45.code !== "ABORT_ERR") { - logError2(error45); + logForDebugging(`rg error (signal=${error41.signal}, code=${error41.code}, stderr: ${stderr}), ${lines.length} results`); + if (error41.code !== 2 && error41.code !== "ABORT_ERR") { + logError2(error41); } if (isTimeout && lines.length === 0) { reject2(new RipgrepTimeoutError(`Ripgrep search timed out after ${getPlatform() === "wsl" ? 60 : 20} seconds. The search may have matched files but did not complete in time. Try searching a more specific path or pattern.`, lines)); @@ -259687,8 +205374,8 @@ async function ripGrep(args, target, abortSignal) { } resolve14(lines); }; - ripGrepRaw(args, target, abortSignal, (error45, stdout, stderr) => { - handleResult3(error45, stdout, stderr, false); + ripGrepRaw(args, target, abortSignal, (error41, stdout, stderr) => { + handleResult3(error41, stdout, stderr, false); }); }); } @@ -259753,7 +205440,7 @@ var init_ripgrep = __esm(() => { init_platform2(); init_stringUtils(); __filename2 = fileURLToPath3(import.meta.url); - __dirname2 = path12.join(__filename2, "../"); + __dirname2 = path10.join(__filename2, "../"); getRipgrepConfig = memoize_default(() => { const userWantsSystemRipgrep = isEnvDefinedFalsy(process.env.USE_BUILTIN_RIPGREP); if (userWantsSystemRipgrep) { @@ -259770,8 +205457,8 @@ var init_ripgrep = __esm(() => { argv0: "rg" }; } - const rgRoot = path12.resolve(__dirname2, "vendor", "ripgrep"); - const command = process.platform === "win32" ? path12.resolve(rgRoot, `${process.arch}-win32`, "rg.exe") : path12.resolve(rgRoot, `${process.arch}-${process.platform}`, "rg"); + const rgRoot = path10.resolve(__dirname2, "vendor", "ripgrep"); + const command = process.platform === "win32" ? path10.resolve(rgRoot, `${process.arch}-win32`, "rg.exe") : path10.resolve(rgRoot, `${process.arch}-${process.platform}`, "rg"); return { mode: "builtin", command, args: [] }; }); RipgrepTimeoutError = class RipgrepTimeoutError extends Error { @@ -259783,7 +205470,7 @@ var init_ripgrep = __esm(() => { } }; countFilesRoundedRg = memoize_default(async (dirPath, abortSignal, ignorePatterns = []) => { - if (path12.resolve(dirPath) === path12.resolve(homedir10())) { + if (path10.resolve(dirPath) === path10.resolve(homedir10())) { return; } try { @@ -259797,9 +205484,9 @@ var init_ripgrep = __esm(() => { const magnitude = Math.floor(Math.log10(count3)); const power = Math.pow(10, magnitude); return Math.round(count3 / power) * power; - } catch (error45) { - if (error45?.name !== "AbortError") - logError2(error45); + } catch (error41) { + if (error41?.name !== "AbortError") + logError2(error41); } }, (dirPath, _abortSignal, ignorePatterns = []) => `${dirPath}|${ignorePatterns.join(",")}`); testRipgrepOnFirstUse = memoize_default(async () => { @@ -259839,13 +205526,13 @@ var init_ripgrep = __esm(() => { working: working ? 1 : 0, using_system: config2.mode === "system" ? 1 : 0 }); - } catch (error45) { + } catch (error41) { ripgrepStatus = { working: false, lastTested: Date.now(), config: config2 }; - logError2(error45); + logError2(error41); } }); }); @@ -260004,8 +205691,8 @@ async function findMarkdownFilesNative(dir, signal) { } visitedDirs.add(dirKey); } - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Failed to stat directory ${currentDir}: ${errorMessage2}`); return; } @@ -260025,8 +205712,8 @@ async function findMarkdownFilesNative(dir, signal) { } else if (stats.isFile() && entry.name.endsWith(".md")) { files.push(fullPath); } - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Failed to follow symlink ${fullPath}: ${errorMessage2}`); } } else if (entry.isDirectory()) { @@ -260034,13 +205721,13 @@ async function findMarkdownFilesNative(dir, signal) { } else if (entry.isFile() && entry.name.endsWith(".md")) { files.push(fullPath); } - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Failed to access ${fullPath}: ${errorMessage2}`); } } - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Failed to read directory ${currentDir}: ${errorMessage2}`); } } @@ -260067,8 +205754,8 @@ async function loadMarkdownFiles(dir) { frontmatter, content }; - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Failed to read/parse markdown file: ${filePath}: ${errorMessage2}`); return null; } @@ -260170,68 +205857,68 @@ var init_markdownConfigLoader = __esm(() => { }); // src/types/plugin.ts -function getPluginErrorMessage(error45) { - switch (error45.type) { +function getPluginErrorMessage(error41) { + switch (error41.type) { case "generic-error": - return error45.error; + return error41.error; case "path-not-found": - return `Path not found: ${error45.path} (${error45.component})`; + return `Path not found: ${error41.path} (${error41.component})`; case "git-auth-failed": - return `Git authentication failed (${error45.authType}): ${error45.gitUrl}`; + return `Git authentication failed (${error41.authType}): ${error41.gitUrl}`; case "git-timeout": - return `Git ${error45.operation} timeout: ${error45.gitUrl}`; + return `Git ${error41.operation} timeout: ${error41.gitUrl}`; case "network-error": - return `Network error: ${error45.url}${error45.details ? ` - ${error45.details}` : ""}`; + return `Network error: ${error41.url}${error41.details ? ` - ${error41.details}` : ""}`; case "manifest-parse-error": - return `Manifest parse error: ${error45.parseError}`; + return `Manifest parse error: ${error41.parseError}`; case "manifest-validation-error": - return `Manifest validation failed: ${error45.validationErrors.join(", ")}`; + return `Manifest validation failed: ${error41.validationErrors.join(", ")}`; case "plugin-not-found": - return `Plugin ${error45.pluginId} not found in marketplace ${error45.marketplace}`; + return `Plugin ${error41.pluginId} not found in marketplace ${error41.marketplace}`; case "marketplace-not-found": - return `Marketplace ${error45.marketplace} not found`; + return `Marketplace ${error41.marketplace} not found`; case "marketplace-load-failed": - return `Marketplace ${error45.marketplace} failed to load: ${error45.reason}`; + return `Marketplace ${error41.marketplace} failed to load: ${error41.reason}`; case "mcp-config-invalid": - return `MCP server ${error45.serverName} invalid: ${error45.validationError}`; + return `MCP server ${error41.serverName} invalid: ${error41.validationError}`; case "mcp-server-suppressed-duplicate": { - const dup = error45.duplicateOf.startsWith("plugin:") ? `server provided by plugin "${error45.duplicateOf.split(":")[1] ?? "?"}"` : `already-configured "${error45.duplicateOf}"`; - return `MCP server "${error45.serverName}" skipped — same command/URL as ${dup}`; + const dup = error41.duplicateOf.startsWith("plugin:") ? `server provided by plugin "${error41.duplicateOf.split(":")[1] ?? "?"}"` : `already-configured "${error41.duplicateOf}"`; + return `MCP server "${error41.serverName}" skipped — same command/URL as ${dup}`; } case "hook-load-failed": - return `Hook load failed: ${error45.reason}`; + return `Hook load failed: ${error41.reason}`; case "component-load-failed": - return `${error45.component} load failed from ${error45.path}: ${error45.reason}`; + return `${error41.component} load failed from ${error41.path}: ${error41.reason}`; case "mcpb-download-failed": - return `Failed to download MCPB from ${error45.url}: ${error45.reason}`; + return `Failed to download MCPB from ${error41.url}: ${error41.reason}`; case "mcpb-extract-failed": - return `Failed to extract MCPB ${error45.mcpbPath}: ${error45.reason}`; + return `Failed to extract MCPB ${error41.mcpbPath}: ${error41.reason}`; case "mcpb-invalid-manifest": - return `MCPB manifest invalid at ${error45.mcpbPath}: ${error45.validationError}`; + return `MCPB manifest invalid at ${error41.mcpbPath}: ${error41.validationError}`; case "lsp-config-invalid": - return `Plugin "${error45.plugin}" has invalid LSP server config for "${error45.serverName}": ${error45.validationError}`; + return `Plugin "${error41.plugin}" has invalid LSP server config for "${error41.serverName}": ${error41.validationError}`; case "lsp-server-start-failed": - return `Plugin "${error45.plugin}" failed to start LSP server "${error45.serverName}": ${error45.reason}`; + return `Plugin "${error41.plugin}" failed to start LSP server "${error41.serverName}": ${error41.reason}`; case "lsp-server-crashed": - if (error45.signal) { - return `Plugin "${error45.plugin}" LSP server "${error45.serverName}" crashed with signal ${error45.signal}`; + if (error41.signal) { + return `Plugin "${error41.plugin}" LSP server "${error41.serverName}" crashed with signal ${error41.signal}`; } - return `Plugin "${error45.plugin}" LSP server "${error45.serverName}" crashed with exit code ${error45.exitCode ?? "unknown"}`; + return `Plugin "${error41.plugin}" LSP server "${error41.serverName}" crashed with exit code ${error41.exitCode ?? "unknown"}`; case "lsp-request-timeout": - return `Plugin "${error45.plugin}" LSP server "${error45.serverName}" timed out on ${error45.method} request after ${error45.timeoutMs}ms`; + return `Plugin "${error41.plugin}" LSP server "${error41.serverName}" timed out on ${error41.method} request after ${error41.timeoutMs}ms`; case "lsp-request-failed": - return `Plugin "${error45.plugin}" LSP server "${error45.serverName}" ${error45.method} request failed: ${error45.error}`; + return `Plugin "${error41.plugin}" LSP server "${error41.serverName}" ${error41.method} request failed: ${error41.error}`; case "marketplace-blocked-by-policy": - if (error45.blockedByBlocklist) { - return `Marketplace '${error45.marketplace}' is blocked by enterprise policy`; + if (error41.blockedByBlocklist) { + return `Marketplace '${error41.marketplace}' is blocked by enterprise policy`; } - return `Marketplace '${error45.marketplace}' is not in the allowed marketplace list`; + return `Marketplace '${error41.marketplace}' is not in the allowed marketplace list`; case "dependency-unsatisfied": { - const hint = error45.reason === "not-enabled" ? "disabled — enable it or remove the dependency" : "not found in any configured marketplace"; - return `Dependency "${error45.dependency}" is ${hint}`; + const hint = error41.reason === "not-enabled" ? "disabled — enable it or remove the dependency" : "not found in any configured marketplace"; + return `Dependency "${error41.dependency}" is ${hint}`; } case "plugin-cache-miss": - return `Plugin "${error45.plugin}" not cached at ${error45.installPath} — run /plugins to refresh`; + return `Plugin "${error41.plugin}" not cached at ${error41.installPath} — run /plugins to refresh`; } } @@ -260551,8 +206238,8 @@ function logPluginFetch(source, urlOrSpec, outcome, durationMs, errorKind) { ...errorKind && { error_kind: errorKind } }); } -function classifyFetchError(error45) { - const msg = String(error45?.message ?? error45); +function classifyFetchError(error41) { + const msg = String(error41?.message ?? error41); if (/ENOTFOUND|ECONNREFUSED|EAI_AGAIN|Could not resolve host|Connection refused/i.test(msg)) { return "dns_or_refused"; } @@ -260610,19050 +206297,14 @@ var init_gitAvailability = __esm(() => { }); }); -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.js -function logForDebugging2(message, options2) { - if (!process.env.SRT_DEBUG) { - return; - } - const level = options2?.level || "info"; - const prefix = "[SandboxDebug]"; - switch (level) { - case "error": - console.error(`${prefix} ${message}`); - break; - case "warn": - console.warn(`${prefix} ${message}`); - break; - default: - console.error(`${prefix} ${message}`); - } -} - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js -import { Agent, createServer } from "node:http"; -import { request as httpRequest } from "node:http"; -import { request as httpsRequest } from "node:https"; -import { connect } from "node:net"; -import { URL as URL2 } from "node:url"; -function createHttpProxyServer(options2) { - const server = createServer(); - server.on("connect", async (req, socket) => { - socket.on("error", (err) => { - logForDebugging2(`Client socket error: ${err.message}`, { level: "error" }); - }); - try { - const [hostname2, portStr] = req.url.split(":"); - const port = portStr === undefined ? undefined : parseInt(portStr, 10); - if (!hostname2 || !port) { - logForDebugging2(`Invalid CONNECT request: ${req.url}`, { - level: "error" - }); - socket.end(`HTTP/1.1 400 Bad Request\r -\r -`); - return; - } - const allowed = await options2.filter(port, hostname2, socket); - if (!allowed) { - logForDebugging2(`Connection blocked to ${hostname2}:${port}`, { - level: "error" - }); - socket.end(`HTTP/1.1 403 Forbidden\r -` + `Content-Type: text/plain\r -` + `X-Proxy-Error: blocked-by-allowlist\r -` + `\r -` + "Connection blocked by network allowlist"); - return; - } - const mitmSocketPath = options2.getMitmSocketPath?.(hostname2); - if (mitmSocketPath) { - logForDebugging2(`Routing CONNECT ${hostname2}:${port} through MITM proxy at ${mitmSocketPath}`); - const mitmSocket = connect({ path: mitmSocketPath }, () => { - mitmSocket.write(`CONNECT ${hostname2}:${port} HTTP/1.1\r -` + `Host: ${hostname2}:${port}\r -` + `\r -`); - }); - let responseBuffer = ""; - const onMitmData = (chunk2) => { - responseBuffer += chunk2.toString(); - const headerEndIndex = responseBuffer.indexOf(`\r -\r -`); - if (headerEndIndex !== -1) { - mitmSocket.removeListener("data", onMitmData); - const statusLine = responseBuffer.substring(0, responseBuffer.indexOf(`\r -`)); - if (statusLine.includes(" 200 ")) { - socket.write(`HTTP/1.1 200 Connection Established\r -\r -`); - const remainingData = responseBuffer.substring(headerEndIndex + 4); - if (remainingData.length > 0) { - socket.write(remainingData); - } - mitmSocket.pipe(socket); - socket.pipe(mitmSocket); - } else { - logForDebugging2(`MITM proxy rejected CONNECT: ${statusLine}`, { - level: "error" - }); - socket.end(`HTTP/1.1 502 Bad Gateway\r -\r -`); - mitmSocket.destroy(); - } - } - }; - mitmSocket.on("data", onMitmData); - mitmSocket.on("error", (err) => { - logForDebugging2(`MITM proxy connection failed: ${err.message}`, { - level: "error" - }); - socket.end(`HTTP/1.1 502 Bad Gateway\r -\r -`); - }); - socket.on("error", (err) => { - logForDebugging2(`Client socket error: ${err.message}`, { - level: "error" - }); - mitmSocket.destroy(); - }); - socket.on("end", () => mitmSocket.end()); - mitmSocket.on("end", () => socket.end()); - } else { - const serverSocket = connect(port, hostname2, () => { - socket.write(`HTTP/1.1 200 Connection Established\r -\r -`); - serverSocket.pipe(socket); - socket.pipe(serverSocket); - }); - serverSocket.on("error", (err) => { - logForDebugging2(`CONNECT tunnel failed: ${err.message}`, { - level: "error" - }); - socket.end(`HTTP/1.1 502 Bad Gateway\r -\r -`); - }); - socket.on("error", (err) => { - logForDebugging2(`Client socket error: ${err.message}`, { - level: "error" - }); - serverSocket.destroy(); - }); - socket.on("end", () => serverSocket.end()); - serverSocket.on("end", () => socket.end()); - } - } catch (err) { - logForDebugging2(`Error handling CONNECT: ${err}`, { level: "error" }); - socket.end(`HTTP/1.1 500 Internal Server Error\r -\r -`); - } - }); - server.on("request", async (req, res) => { - try { - const url3 = new URL2(req.url); - const hostname2 = url3.hostname; - const port = url3.port ? parseInt(url3.port, 10) : url3.protocol === "https:" ? 443 : 80; - const allowed = await options2.filter(port, hostname2, req.socket); - if (!allowed) { - logForDebugging2(`HTTP request blocked to ${hostname2}:${port}`, { - level: "error" - }); - res.writeHead(403, { - "Content-Type": "text/plain", - "X-Proxy-Error": "blocked-by-allowlist" - }); - res.end("Connection blocked by network allowlist"); - return; - } - const mitmSocketPath = options2.getMitmSocketPath?.(hostname2); - if (mitmSocketPath) { - logForDebugging2(`Routing HTTP ${req.method} ${hostname2}:${port} through MITM proxy at ${mitmSocketPath}`); - const mitmAgent = new Agent({ - socketPath: mitmSocketPath - }); - const proxyReq = httpRequest({ - agent: mitmAgent, - path: req.url, - method: req.method, - headers: { - ...req.headers, - host: url3.host - } - }, (proxyRes) => { - res.writeHead(proxyRes.statusCode, proxyRes.headers); - proxyRes.pipe(res); - }); - proxyReq.on("error", (err) => { - logForDebugging2(`MITM proxy request failed: ${err.message}`, { - level: "error" - }); - if (!res.headersSent) { - res.writeHead(502, { "Content-Type": "text/plain" }); - res.end("Bad Gateway"); - } - }); - req.pipe(proxyReq); - } else { - const requestFn = url3.protocol === "https:" ? httpsRequest : httpRequest; - const proxyReq = requestFn({ - hostname: hostname2, - port, - path: url3.pathname + url3.search, - method: req.method, - headers: { - ...req.headers, - host: url3.host - } - }, (proxyRes) => { - res.writeHead(proxyRes.statusCode, proxyRes.headers); - proxyRes.pipe(res); - }); - proxyReq.on("error", (err) => { - logForDebugging2(`Proxy request failed: ${err.message}`, { - level: "error" - }); - if (!res.headersSent) { - res.writeHead(502, { "Content-Type": "text/plain" }); - res.end("Bad Gateway"); - } - }); - req.pipe(proxyReq); - } - } catch (err) { - logForDebugging2(`Error handling HTTP request: ${err}`, { level: "error" }); - res.writeHead(500, { "Content-Type": "text/plain" }); - res.end("Internal Server Error"); - } - }); - return server; -} -var init_http_proxy = () => {}; - -// ../node_modules/@pondwader/socks5-server/dist/index.js -var require_dist10 = __commonJS((exports, module) => { - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all3) => { - for (var name in all3) - __defProp2(target, name, { get: all3[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM2 = (mod2, isNodeMode, target) => (target = mod2 != null ? __create2(__getProtoOf2(mod2)) : {}, __copyProps(isNodeMode || !mod2 || !mod2.__esModule ? __defProp2(target, "default", { value: mod2, enumerable: true }) : target, mod2)); - var __toCommonJS2 = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2); - var src_exports = {}; - __export2(src_exports, { - Socks5Server: () => Socks5Server, - createServer: () => createServer2, - defaultConnectionHandler: () => connectionHandler_default - }); - module.exports = __toCommonJS2(src_exports); - var import_net2 = __toESM2(__require("net")); - var Socks5ConnectionCommand = /* @__PURE__ */ ((Socks5ConnectionCommand2) => { - Socks5ConnectionCommand2[Socks5ConnectionCommand2["connect"] = 1] = "connect"; - Socks5ConnectionCommand2[Socks5ConnectionCommand2["bind"] = 2] = "bind"; - Socks5ConnectionCommand2[Socks5ConnectionCommand2["udp"] = 3] = "udp"; - return Socks5ConnectionCommand2; - })(Socks5ConnectionCommand || {}); - var Socks5ConnectionStatus = /* @__PURE__ */ ((Socks5ConnectionStatus2) => { - Socks5ConnectionStatus2[Socks5ConnectionStatus2["REQUEST_GRANTED"] = 0] = "REQUEST_GRANTED"; - Socks5ConnectionStatus2[Socks5ConnectionStatus2["GENERAL_FAILURE"] = 1] = "GENERAL_FAILURE"; - Socks5ConnectionStatus2[Socks5ConnectionStatus2["CONNECTION_NOT_ALLOWED"] = 2] = "CONNECTION_NOT_ALLOWED"; - Socks5ConnectionStatus2[Socks5ConnectionStatus2["NETWORK_UNREACHABLE"] = 3] = "NETWORK_UNREACHABLE"; - Socks5ConnectionStatus2[Socks5ConnectionStatus2["HOST_UNREACHABLE"] = 4] = "HOST_UNREACHABLE"; - Socks5ConnectionStatus2[Socks5ConnectionStatus2["CONNECTION_REFUSED"] = 5] = "CONNECTION_REFUSED"; - Socks5ConnectionStatus2[Socks5ConnectionStatus2["TTL_EXPIRED"] = 6] = "TTL_EXPIRED"; - Socks5ConnectionStatus2[Socks5ConnectionStatus2["COMMAND_NOT_SUPPORTED"] = 7] = "COMMAND_NOT_SUPPORTED"; - Socks5ConnectionStatus2[Socks5ConnectionStatus2["ADDRESS_TYPE_NOT_SUPPORTED"] = 8] = "ADDRESS_TYPE_NOT_SUPPORTED"; - return Socks5ConnectionStatus2; - })(Socks5ConnectionStatus || {}); - var Socks5Connection = class { - constructor(server, socket) { - this.errorHandler = () => {}; - this.metadata = {}; - this.socket = socket; - this.server = server; - socket.on("error", this.errorHandler); - socket.pause(); - this.handleGreeting(); - } - readBytes(len) { - return new Promise((resolve15) => { - let buf = Buffer.allocUnsafe(len); - let offset = 0; - const dataListener = (chunk2) => { - const readAmount = Math.min(chunk2.length, len - offset); - chunk2.copy(buf, offset, 0, readAmount); - offset += readAmount; - if (offset < len) - return; - this.socket.removeListener("data", dataListener); - this.socket.push(chunk2.subarray(readAmount)); - resolve15(buf); - this.socket.pause(); - }; - this.socket.on("data", dataListener); - this.socket.resume(); - }); - } - async handleGreeting() { - const ver = (await this.readBytes(1)).readUInt8(); - if (ver !== 5) - return this.socket.destroy(); - const authMethodsAmount = (await this.readBytes(1)).readUInt8(); - if (authMethodsAmount > 128 || authMethodsAmount === 0) - return this.socket.destroy(); - const authMethods = await this.readBytes(authMethodsAmount); - const authMethodByteCode = this.server.authHandler ? 2 : 0; - if (!authMethods.includes(authMethodByteCode)) { - this.socket.write(Buffer.from([ - 5, - 255 - ])); - return this.socket.destroy(); - } - this.socket.write(Buffer.from([ - 5, - authMethodByteCode - ])); - if (this.server.authHandler) - this.handleUserPassword(); - else - this.handleConnectionRequest(); - } - async handleUserPassword() { - await this.readBytes(1); - const usernameLength = (await this.readBytes(1)).readUint8(); - const username = (await this.readBytes(usernameLength)).toString(); - const passwordLength = (await this.readBytes(1)).readUint8(); - const password = (await this.readBytes(passwordLength)).toString(); - this.username = username; - this.password = password; - let calledBack = false; - const acceptCallback = () => { - if (calledBack) - return; - calledBack = true; - this.socket.write(Buffer.from([ - 1, - 0 - ])); - this.handleConnectionRequest(); - }; - const denyCallback = () => { - if (calledBack) - return; - calledBack = true; - this.socket.write(Buffer.from([ - 1, - 1 - ])); - this.socket.destroy(); - }; - const resp = await this.server.authHandler(this, acceptCallback, denyCallback); - if (resp === true) - acceptCallback(); - else if (resp === false) - denyCallback(); - } - async handleConnectionRequest() { - await this.readBytes(1); - const commandByte = (await this.readBytes(1))[0]; - const command = Socks5ConnectionCommand[commandByte]; - if (!command) - return this.socket.destroy(); - this.command = command; - await this.readBytes(1); - const addrType = (await this.readBytes(1)).readUInt8(); - let address = ""; - switch (addrType) { - case 1: - address = (await this.readBytes(4)).join("."); - break; - case 3: - const hostLength = (await this.readBytes(1)).readUInt8(); - address = (await this.readBytes(hostLength)).toString(); - break; - case 4: - const bytes = await this.readBytes(16); - for (let i2 = 0;i2 < 16; i2++) { - if (i2 % 2 === 0 && i2 > 0) - address += ":"; - address += `${bytes[i2] < 16 ? "0" : ""}${bytes[i2].toString(16)}`; - } - break; - default: - this.socket.destroy(); - return; - } - const port = (await this.readBytes(2)).readUInt16BE(); - if (!this.server.supportedCommands.has(command)) { - this.socket.write(Buffer.from([5, 7])); - return this.socket.destroy(); - } - this.destAddress = address; - this.destPort = port; - let calledBack = false; - const acceptCallback = () => { - if (calledBack) - return; - calledBack = true; - this.connect(); - }; - if (!this.server.rulesetValidator) - return acceptCallback(); - const denyCallback = () => { - if (calledBack) - return; - calledBack = true; - this.socket.write(Buffer.from([ - 5, - 2, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - ])); - this.socket.destroy(); - }; - const resp = await this.server.rulesetValidator(this, acceptCallback, denyCallback); - if (resp === true) - acceptCallback(); - else if (resp === false) - denyCallback(); - } - connect() { - this.socket.removeListener("error", this.errorHandler); - this.server.connectionHandler(this, (status) => { - if (Socks5ConnectionStatus[status] === undefined) - throw new Error(`"${status}" is not a valid status.`); - this.socket.write(Buffer.from([ - 5, - Socks5ConnectionStatus[status], - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - ])); - if (status !== "REQUEST_GRANTED") { - this.socket.destroy(); - } - }); - this.socket.resume(); - } - }; - var import_net = __toESM2(__require("net")); - function connectionHandler_default(connection, sendStatus) { - if (connection.command !== "connect") - return sendStatus("COMMAND_NOT_SUPPORTED"); - connection.socket.on("error", () => {}); - const stream4 = import_net.default.createConnection({ - host: connection.destAddress, - port: connection.destPort - }); - stream4.setNoDelay(); - let streamOpened = false; - stream4.on("error", (err) => { - if (!streamOpened) { - switch (err.code) { - case "EINVAL": - case "ENOENT": - case "ENOTFOUND": - case "ETIMEDOUT": - case "EADDRNOTAVAIL": - case "EHOSTUNREACH": - sendStatus("HOST_UNREACHABLE"); - break; - case "ENETUNREACH": - sendStatus("NETWORK_UNREACHABLE"); - break; - case "ECONNREFUSED": - sendStatus("CONNECTION_REFUSED"); - break; - default: - sendStatus("GENERAL_FAILURE"); - } - } - }); - stream4.on("ready", () => { - streamOpened = true; - sendStatus("REQUEST_GRANTED"); - connection.socket.pipe(stream4).pipe(connection.socket); - }); - connection.socket.on("close", () => stream4.destroy()); - return stream4; - } - var Socks5Server = class { - constructor() { - this.supportedCommands = /* @__PURE__ */ new Set(["connect"]); - this.connectionHandler = connectionHandler_default; - this.server = import_net2.default.createServer((socket) => { - socket.setNoDelay(); - this._handleConnection(socket); - }); - } - listen(...args) { - this.server.listen(...args); - return this; - } - close(callback) { - this.server.close(callback); - return this; - } - setAuthHandler(handler2) { - this.authHandler = handler2; - return this; - } - disableAuthHandler() { - this.authHandler = undefined; - return this; - } - setRulesetValidator(handler2) { - this.rulesetValidator = handler2; - return this; - } - disableRulesetValidator() { - this.rulesetValidator = undefined; - return this; - } - setConnectionHandler(handler2) { - this.connectionHandler = handler2; - return this; - } - useDefaultConnectionHandler() { - this.connectionHandler = connectionHandler_default; - return this; - } - _handleConnection(socket) { - new Socks5Connection(this, socket); - return this; - } - }; - function createServer2(opts) { - const server = new Socks5Server; - if (opts?.auth) - server.setAuthHandler((conn) => { - return conn.username === opts.auth.username && conn.password === opts.auth.password; - }); - if (opts?.port) - server.listen(opts.port, opts.hostname); - return server; - } -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.js -function createSocksProxyServer(options2) { - const socksServer = import_socks5_server.createServer(); - socksServer.setRulesetValidator(async (conn) => { - try { - const hostname2 = conn.destAddress; - const port = conn.destPort; - logForDebugging2(`Connection request to ${hostname2}:${port}`); - const allowed = await options2.filter(port, hostname2); - if (!allowed) { - logForDebugging2(`Connection blocked to ${hostname2}:${port}`, { - level: "error" - }); - return false; - } - logForDebugging2(`Connection allowed to ${hostname2}:${port}`); - return true; - } catch (error45) { - logForDebugging2(`Error validating connection: ${error45}`, { - level: "error" - }); - return false; - } - }); - return { - server: socksServer, - getPort() { - try { - const serverInternal = socksServer?.server; - if (serverInternal && typeof serverInternal?.address === "function") { - const address = serverInternal.address(); - if (address && typeof address === "object" && "port" in address) { - return address.port; - } - } - } catch (error45) { - logForDebugging2(`Error getting port: ${error45}`, { level: "error" }); - } - return; - }, - listen(port, hostname2) { - return new Promise((resolve15, reject2) => { - const listeningCallback = () => { - const actualPort = this.getPort(); - if (actualPort) { - logForDebugging2(`SOCKS proxy listening on ${hostname2}:${actualPort}`); - resolve15(actualPort); - } else { - reject2(new Error("Failed to get SOCKS proxy server port")); - } - }; - socksServer.listen(port, hostname2, listeningCallback); - }); - }, - async close() { - return new Promise((resolve15, reject2) => { - socksServer.close((error45) => { - if (error45) { - const errorMessage2 = error45.message?.toLowerCase() || ""; - const isAlreadyClosed = errorMessage2.includes("not running") || errorMessage2.includes("already closed") || errorMessage2.includes("not listening"); - if (!isAlreadyClosed) { - reject2(error45); - return; - } - } - resolve15(); - }); - }); - }, - unref() { - try { - const serverInternal = socksServer?.server; - if (serverInternal && typeof serverInternal?.unref === "function") { - serverInternal.unref(); - } - } catch (error45) { - logForDebugging2(`Error calling unref: ${error45}`, { level: "error" }); - } - } - }; -} -var import_socks5_server; -var init_socks_proxy = __esm(() => { - import_socks5_server = __toESM(require_dist10(), 1); -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.js -import { spawnSync as spawnSync3 } from "node:child_process"; -function whichSync2(bin) { - if (typeof globalThis.Bun !== "undefined") { - return globalThis.Bun.which(bin); - } - const result2 = spawnSync3("which", [bin], { - encoding: "utf8", - stdio: ["ignore", "pipe", "ignore"], - timeout: 1000 - }); - if (result2.status === 0 && result2.stdout) { - return result2.stdout.trim(); - } - return null; -} -var init_which2 = () => {}; - -// ../node_modules/lodash-es/_freeGlobal.js -var freeGlobal2, _freeGlobal_default2; -var init__freeGlobal2 = __esm(() => { - freeGlobal2 = typeof global == "object" && global && global.Object === Object && global; - _freeGlobal_default2 = freeGlobal2; -}); - -// ../node_modules/lodash-es/_root.js -var freeSelf2, root2, _root_default2; -var init__root2 = __esm(() => { - init__freeGlobal2(); - freeSelf2 = typeof self == "object" && self && self.Object === Object && self; - root2 = _freeGlobal_default2 || freeSelf2 || Function("return this")(); - _root_default2 = root2; -}); - -// ../node_modules/lodash-es/_Symbol.js -var Symbol3, _Symbol_default2; -var init__Symbol2 = __esm(() => { - init__root2(); - Symbol3 = _root_default2.Symbol; - _Symbol_default2 = Symbol3; -}); - -// ../node_modules/lodash-es/_getRawTag.js -function getRawTag2(value) { - var isOwn = hasOwnProperty28.call(value, symToStringTag3), tag2 = value[symToStringTag3]; - try { - value[symToStringTag3] = undefined; - var unmasked = true; - } catch (e) {} - var result2 = nativeObjectToString5.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag3] = tag2; - } else { - delete value[symToStringTag3]; - } - } - return result2; -} -var objectProto31, hasOwnProperty28, nativeObjectToString5, symToStringTag3, _getRawTag_default2; -var init__getRawTag2 = __esm(() => { - init__Symbol2(); - objectProto31 = Object.prototype; - hasOwnProperty28 = objectProto31.hasOwnProperty; - nativeObjectToString5 = objectProto31.toString; - symToStringTag3 = _Symbol_default2 ? _Symbol_default2.toStringTag : undefined; - _getRawTag_default2 = getRawTag2; -}); - -// ../node_modules/lodash-es/_objectToString.js -function objectToString4(value) { - return nativeObjectToString6.call(value); -} -var objectProto32, nativeObjectToString6, _objectToString_default2; -var init__objectToString2 = __esm(() => { - objectProto32 = Object.prototype; - nativeObjectToString6 = objectProto32.toString; - _objectToString_default2 = objectToString4; -}); - -// ../node_modules/lodash-es/_baseGetTag.js -function baseGetTag2(value) { - if (value == null) { - return value === undefined ? undefinedTag2 : nullTag2; - } - return symToStringTag4 && symToStringTag4 in Object(value) ? _getRawTag_default2(value) : _objectToString_default2(value); -} -var nullTag2 = "[object Null]", undefinedTag2 = "[object Undefined]", symToStringTag4, _baseGetTag_default2; -var init__baseGetTag2 = __esm(() => { - init__Symbol2(); - init__getRawTag2(); - init__objectToString2(); - symToStringTag4 = _Symbol_default2 ? _Symbol_default2.toStringTag : undefined; - _baseGetTag_default2 = baseGetTag2; -}); - -// ../node_modules/lodash-es/isObjectLike.js -function isObjectLike2(value) { - return value != null && typeof value == "object"; -} -var isObjectLike_default2; -var init_isObjectLike2 = __esm(() => { - isObjectLike_default2 = isObjectLike2; -}); - -// ../node_modules/lodash-es/isSymbol.js -function isSymbol2(value) { - return typeof value == "symbol" || isObjectLike_default2(value) && _baseGetTag_default2(value) == symbolTag5; -} -var symbolTag5 = "[object Symbol]", isSymbol_default2; -var init_isSymbol2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - isSymbol_default2 = isSymbol2; -}); - -// ../node_modules/lodash-es/_baseToNumber.js -function baseToNumber2(value) { - if (typeof value == "number") { - return value; - } - if (isSymbol_default2(value)) { - return NAN4; - } - return +value; -} -var NAN4, _baseToNumber_default2; -var init__baseToNumber2 = __esm(() => { - init_isSymbol2(); - NAN4 = 0 / 0; - _baseToNumber_default2 = baseToNumber2; -}); - -// ../node_modules/lodash-es/_arrayMap.js -function arrayMap2(array3, iteratee2) { - var index = -1, length = array3 == null ? 0 : array3.length, result2 = Array(length); - while (++index < length) { - result2[index] = iteratee2(array3[index], index, array3); - } - return result2; -} -var _arrayMap_default2; -var init__arrayMap2 = __esm(() => { - _arrayMap_default2 = arrayMap2; -}); - -// ../node_modules/lodash-es/isArray.js -var isArray8, isArray_default2; -var init_isArray2 = __esm(() => { - isArray8 = Array.isArray; - isArray_default2 = isArray8; -}); - -// ../node_modules/lodash-es/_baseToString.js -function baseToString2(value) { - if (typeof value == "string") { - return value; - } - if (isArray_default2(value)) { - return _arrayMap_default2(value, baseToString2) + ""; - } - if (isSymbol_default2(value)) { - return symbolToString2 ? symbolToString2.call(value) : ""; - } - var result2 = value + ""; - return result2 == "0" && 1 / value == -INFINITY7 ? "-0" : result2; -} -var INFINITY7, symbolProto4, symbolToString2, _baseToString_default2; -var init__baseToString2 = __esm(() => { - init__Symbol2(); - init__arrayMap2(); - init_isArray2(); - init_isSymbol2(); - INFINITY7 = 1 / 0; - symbolProto4 = _Symbol_default2 ? _Symbol_default2.prototype : undefined; - symbolToString2 = symbolProto4 ? symbolProto4.toString : undefined; - _baseToString_default2 = baseToString2; -}); - -// ../node_modules/lodash-es/_createMathOperation.js -function createMathOperation2(operator, defaultValue) { - return function(value, other2) { - var result2; - if (value === undefined && other2 === undefined) { - return defaultValue; - } - if (value !== undefined) { - result2 = value; - } - if (other2 !== undefined) { - if (result2 === undefined) { - return other2; - } - if (typeof value == "string" || typeof other2 == "string") { - value = _baseToString_default2(value); - other2 = _baseToString_default2(other2); - } else { - value = _baseToNumber_default2(value); - other2 = _baseToNumber_default2(other2); - } - result2 = operator(value, other2); - } - return result2; - }; -} -var _createMathOperation_default2; -var init__createMathOperation2 = __esm(() => { - init__baseToNumber2(); - init__baseToString2(); - _createMathOperation_default2 = createMathOperation2; -}); - -// ../node_modules/lodash-es/add.js -var add2, add_default2; -var init_add3 = __esm(() => { - init__createMathOperation2(); - add2 = _createMathOperation_default2(function(augend, addend) { - return augend + addend; - }, 0); - add_default2 = add2; -}); - -// ../node_modules/lodash-es/_trimmedEndIndex.js -function trimmedEndIndex2(string5) { - var index = string5.length; - while (index-- && reWhitespace2.test(string5.charAt(index))) {} - return index; -} -var reWhitespace2, _trimmedEndIndex_default2; -var init__trimmedEndIndex2 = __esm(() => { - reWhitespace2 = /\s/; - _trimmedEndIndex_default2 = trimmedEndIndex2; -}); - -// ../node_modules/lodash-es/_baseTrim.js -function baseTrim2(string5) { - return string5 ? string5.slice(0, _trimmedEndIndex_default2(string5) + 1).replace(reTrimStart4, "") : string5; -} -var reTrimStart4, _baseTrim_default2; -var init__baseTrim2 = __esm(() => { - init__trimmedEndIndex2(); - reTrimStart4 = /^\s+/; - _baseTrim_default2 = baseTrim2; -}); - -// ../node_modules/lodash-es/isObject.js -function isObject5(value) { - var type = typeof value; - return value != null && (type == "object" || type == "function"); -} -var isObject_default2; -var init_isObject2 = __esm(() => { - isObject_default2 = isObject5; -}); - -// ../node_modules/lodash-es/toNumber.js -function toNumber2(value) { - if (typeof value == "number") { - return value; - } - if (isSymbol_default2(value)) { - return NAN5; - } - if (isObject_default2(value)) { - var other2 = typeof value.valueOf == "function" ? value.valueOf() : value; - value = isObject_default2(other2) ? other2 + "" : other2; - } - if (typeof value != "string") { - return value === 0 ? value : +value; - } - value = _baseTrim_default2(value); - var isBinary = reIsBinary2.test(value); - return isBinary || reIsOctal2.test(value) ? freeParseInt2(value.slice(2), isBinary ? 2 : 8) : reIsBadHex2.test(value) ? NAN5 : +value; -} -var NAN5, reIsBadHex2, reIsBinary2, reIsOctal2, freeParseInt2, toNumber_default2; -var init_toNumber2 = __esm(() => { - init__baseTrim2(); - init_isObject2(); - init_isSymbol2(); - NAN5 = 0 / 0; - reIsBadHex2 = /^[-+]0x[0-9a-f]+$/i; - reIsBinary2 = /^0b[01]+$/i; - reIsOctal2 = /^0o[0-7]+$/i; - freeParseInt2 = parseInt; - toNumber_default2 = toNumber2; -}); - -// ../node_modules/lodash-es/toFinite.js -function toFinite2(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber_default2(value); - if (value === INFINITY8 || value === -INFINITY8) { - var sign = value < 0 ? -1 : 1; - return sign * MAX_INTEGER2; - } - return value === value ? value : 0; -} -var INFINITY8, MAX_INTEGER2 = 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, toFinite_default2; -var init_toFinite2 = __esm(() => { - init_toNumber2(); - INFINITY8 = 1 / 0; - toFinite_default2 = toFinite2; -}); - -// ../node_modules/lodash-es/toInteger.js -function toInteger2(value) { - var result2 = toFinite_default2(value), remainder = result2 % 1; - return result2 === result2 ? remainder ? result2 - remainder : result2 : 0; -} -var toInteger_default2; -var init_toInteger2 = __esm(() => { - init_toFinite2(); - toInteger_default2 = toInteger2; -}); - -// ../node_modules/lodash-es/after.js -function after2(n2, func) { - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT13); - } - n2 = toInteger_default2(n2); - return function() { - if (--n2 < 1) { - return func.apply(this, arguments); - } - }; -} -var FUNC_ERROR_TEXT13 = "Expected a function", after_default2; -var init_after2 = __esm(() => { - init_toInteger2(); - after_default2 = after2; -}); - -// ../node_modules/lodash-es/identity.js -function identity4(value) { - return value; -} -var identity_default3; -var init_identity3 = __esm(() => { - identity_default3 = identity4; -}); - -// ../node_modules/lodash-es/isFunction.js -function isFunction4(value) { - if (!isObject_default2(value)) { - return false; - } - var tag2 = _baseGetTag_default2(value); - return tag2 == funcTag4 || tag2 == genTag3 || tag2 == asyncTag2 || tag2 == proxyTag2; -} -var asyncTag2 = "[object AsyncFunction]", funcTag4 = "[object Function]", genTag3 = "[object GeneratorFunction]", proxyTag2 = "[object Proxy]", isFunction_default2; -var init_isFunction2 = __esm(() => { - init__baseGetTag2(); - init_isObject2(); - isFunction_default2 = isFunction4; -}); - -// ../node_modules/lodash-es/_coreJsData.js -var coreJsData2, _coreJsData_default2; -var init__coreJsData2 = __esm(() => { - init__root2(); - coreJsData2 = _root_default2["__core-js_shared__"]; - _coreJsData_default2 = coreJsData2; -}); - -// ../node_modules/lodash-es/_isMasked.js -function isMasked2(func) { - return !!maskSrcKey2 && maskSrcKey2 in func; -} -var maskSrcKey2, _isMasked_default2; -var init__isMasked2 = __esm(() => { - init__coreJsData2(); - maskSrcKey2 = function() { - var uid = /[^.]+$/.exec(_coreJsData_default2 && _coreJsData_default2.keys && _coreJsData_default2.keys.IE_PROTO || ""); - return uid ? "Symbol(src)_1." + uid : ""; - }(); - _isMasked_default2 = isMasked2; -}); - -// ../node_modules/lodash-es/_toSource.js -function toSource2(func) { - if (func != null) { - try { - return funcToString4.call(func); - } catch (e) {} - try { - return func + ""; - } catch (e) {} - } - return ""; -} -var funcProto4, funcToString4, _toSource_default2; -var init__toSource2 = __esm(() => { - funcProto4 = Function.prototype; - funcToString4 = funcProto4.toString; - _toSource_default2 = toSource2; -}); - -// ../node_modules/lodash-es/_baseIsNative.js -function baseIsNative2(value) { - if (!isObject_default2(value) || _isMasked_default2(value)) { - return false; - } - var pattern = isFunction_default2(value) ? reIsNative2 : reIsHostCtor2; - return pattern.test(_toSource_default2(value)); -} -var reRegExpChar3, reIsHostCtor2, funcProto5, objectProto33, funcToString5, hasOwnProperty29, reIsNative2, _baseIsNative_default2; -var init__baseIsNative2 = __esm(() => { - init_isFunction2(); - init__isMasked2(); - init_isObject2(); - init__toSource2(); - reRegExpChar3 = /[\\^$.*+?()[\]{}|]/g; - reIsHostCtor2 = /^\[object .+?Constructor\]$/; - funcProto5 = Function.prototype; - objectProto33 = Object.prototype; - funcToString5 = funcProto5.toString; - hasOwnProperty29 = objectProto33.hasOwnProperty; - reIsNative2 = RegExp("^" + funcToString5.call(hasOwnProperty29).replace(reRegExpChar3, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); - _baseIsNative_default2 = baseIsNative2; -}); - -// ../node_modules/lodash-es/_getValue.js -function getValue2(object4, key) { - return object4 == null ? undefined : object4[key]; -} -var _getValue_default2; -var init__getValue2 = __esm(() => { - _getValue_default2 = getValue2; -}); - -// ../node_modules/lodash-es/_getNative.js -function getNative2(object4, key) { - var value = _getValue_default2(object4, key); - return _baseIsNative_default2(value) ? value : undefined; -} -var _getNative_default2; -var init__getNative2 = __esm(() => { - init__baseIsNative2(); - init__getValue2(); - _getNative_default2 = getNative2; -}); - -// ../node_modules/lodash-es/_WeakMap.js -var WeakMap3, _WeakMap_default2; -var init__WeakMap2 = __esm(() => { - init__getNative2(); - init__root2(); - WeakMap3 = _getNative_default2(_root_default2, "WeakMap"); - _WeakMap_default2 = WeakMap3; -}); - -// ../node_modules/lodash-es/_metaMap.js -var metaMap2, _metaMap_default2; -var init__metaMap2 = __esm(() => { - init__WeakMap2(); - metaMap2 = _WeakMap_default2 && new _WeakMap_default2; - _metaMap_default2 = metaMap2; -}); - -// ../node_modules/lodash-es/_baseSetData.js -var baseSetData2, _baseSetData_default2; -var init__baseSetData2 = __esm(() => { - init_identity3(); - init__metaMap2(); - baseSetData2 = !_metaMap_default2 ? identity_default3 : function(func, data) { - _metaMap_default2.set(func, data); - return func; - }; - _baseSetData_default2 = baseSetData2; -}); - -// ../node_modules/lodash-es/_baseCreate.js -var objectCreate2, baseCreate2, _baseCreate_default2; -var init__baseCreate2 = __esm(() => { - init_isObject2(); - objectCreate2 = Object.create; - baseCreate2 = function() { - function object4() {} - return function(proto2) { - if (!isObject_default2(proto2)) { - return {}; - } - if (objectCreate2) { - return objectCreate2(proto2); - } - object4.prototype = proto2; - var result2 = new object4; - object4.prototype = undefined; - return result2; - }; - }(); - _baseCreate_default2 = baseCreate2; -}); - -// ../node_modules/lodash-es/_createCtor.js -function createCtor2(Ctor) { - return function() { - var args = arguments; - switch (args.length) { - case 0: - return new Ctor; - case 1: - return new Ctor(args[0]); - case 2: - return new Ctor(args[0], args[1]); - case 3: - return new Ctor(args[0], args[1], args[2]); - case 4: - return new Ctor(args[0], args[1], args[2], args[3]); - case 5: - return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: - return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: - return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = _baseCreate_default2(Ctor.prototype), result2 = Ctor.apply(thisBinding, args); - return isObject_default2(result2) ? result2 : thisBinding; - }; -} -var _createCtor_default2; -var init__createCtor2 = __esm(() => { - init__baseCreate2(); - init_isObject2(); - _createCtor_default2 = createCtor2; -}); - -// ../node_modules/lodash-es/_createBind.js -function createBind2(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG10, Ctor = _createCtor_default2(func); - function wrapper() { - var fn = this && this !== _root_default2 && this instanceof wrapper ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; -} -var WRAP_BIND_FLAG10 = 1, _createBind_default2; -var init__createBind2 = __esm(() => { - init__createCtor2(); - init__root2(); - _createBind_default2 = createBind2; -}); - -// ../node_modules/lodash-es/_apply.js -function apply2(func, thisArg, args) { - switch (args.length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} -var _apply_default2; -var init__apply2 = __esm(() => { - _apply_default2 = apply2; -}); - -// ../node_modules/lodash-es/_composeArgs.js -function composeArgs2(args, partials, holders, isCurried) { - var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax18(argsLength - holdersLength, 0), result2 = Array(leftLength + rangeLength), isUncurried = !isCurried; - while (++leftIndex < leftLength) { - result2[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result2[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result2[leftIndex++] = args[argsIndex++]; - } - return result2; -} -var nativeMax18, _composeArgs_default2; -var init__composeArgs2 = __esm(() => { - nativeMax18 = Math.max; - _composeArgs_default2 = composeArgs2; -}); - -// ../node_modules/lodash-es/_composeArgsRight.js -function composeArgsRight2(args, partials, holders, isCurried) { - var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax19(argsLength - holdersLength, 0), result2 = Array(rangeLength + rightLength), isUncurried = !isCurried; - while (++argsIndex < rangeLength) { - result2[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result2[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result2[offset + holders[holdersIndex]] = args[argsIndex++]; - } - } - return result2; -} -var nativeMax19, _composeArgsRight_default2; -var init__composeArgsRight2 = __esm(() => { - nativeMax19 = Math.max; - _composeArgsRight_default2 = composeArgsRight2; -}); - -// ../node_modules/lodash-es/_countHolders.js -function countHolders2(array3, placeholder) { - var length = array3.length, result2 = 0; - while (length--) { - if (array3[length] === placeholder) { - ++result2; - } - } - return result2; -} -var _countHolders_default2; -var init__countHolders2 = __esm(() => { - _countHolders_default2 = countHolders2; -}); - -// ../node_modules/lodash-es/_baseLodash.js -function baseLodash2() {} -var _baseLodash_default2; -var init__baseLodash2 = __esm(() => { - _baseLodash_default2 = baseLodash2; -}); - -// ../node_modules/lodash-es/_LazyWrapper.js -function LazyWrapper2(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH8; - this.__views__ = []; -} -var MAX_ARRAY_LENGTH8 = 4294967295, _LazyWrapper_default2; -var init__LazyWrapper2 = __esm(() => { - init__baseCreate2(); - init__baseLodash2(); - LazyWrapper2.prototype = _baseCreate_default2(_baseLodash_default2.prototype); - LazyWrapper2.prototype.constructor = LazyWrapper2; - _LazyWrapper_default2 = LazyWrapper2; -}); - -// ../node_modules/lodash-es/noop.js -function noop10() {} -var noop_default2; -var init_noop2 = __esm(() => { - noop_default2 = noop10; -}); - -// ../node_modules/lodash-es/_getData.js -var getData2, _getData_default2; -var init__getData2 = __esm(() => { - init__metaMap2(); - init_noop2(); - getData2 = !_metaMap_default2 ? noop_default2 : function(func) { - return _metaMap_default2.get(func); - }; - _getData_default2 = getData2; -}); - -// ../node_modules/lodash-es/_realNames.js -var realNames2, _realNames_default2; -var init__realNames2 = __esm(() => { - realNames2 = {}; - _realNames_default2 = realNames2; -}); - -// ../node_modules/lodash-es/_getFuncName.js -function getFuncName2(func) { - var result2 = func.name + "", array3 = _realNames_default2[result2], length = hasOwnProperty30.call(_realNames_default2, result2) ? array3.length : 0; - while (length--) { - var data = array3[length], otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result2; -} -var objectProto34, hasOwnProperty30, _getFuncName_default2; -var init__getFuncName2 = __esm(() => { - init__realNames2(); - objectProto34 = Object.prototype; - hasOwnProperty30 = objectProto34.hasOwnProperty; - _getFuncName_default2 = getFuncName2; -}); - -// ../node_modules/lodash-es/_LodashWrapper.js -function LodashWrapper2(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; -} -var _LodashWrapper_default2; -var init__LodashWrapper2 = __esm(() => { - init__baseCreate2(); - init__baseLodash2(); - LodashWrapper2.prototype = _baseCreate_default2(_baseLodash_default2.prototype); - LodashWrapper2.prototype.constructor = LodashWrapper2; - _LodashWrapper_default2 = LodashWrapper2; -}); - -// ../node_modules/lodash-es/_copyArray.js -function copyArray2(source, array3) { - var index = -1, length = source.length; - array3 || (array3 = Array(length)); - while (++index < length) { - array3[index] = source[index]; - } - return array3; -} -var _copyArray_default2; -var init__copyArray2 = __esm(() => { - _copyArray_default2 = copyArray2; -}); - -// ../node_modules/lodash-es/_wrapperClone.js -function wrapperClone2(wrapper) { - if (wrapper instanceof _LazyWrapper_default2) { - return wrapper.clone(); - } - var result2 = new _LodashWrapper_default2(wrapper.__wrapped__, wrapper.__chain__); - result2.__actions__ = _copyArray_default2(wrapper.__actions__); - result2.__index__ = wrapper.__index__; - result2.__values__ = wrapper.__values__; - return result2; -} -var _wrapperClone_default2; -var init__wrapperClone2 = __esm(() => { - init__LazyWrapper2(); - init__LodashWrapper2(); - init__copyArray2(); - _wrapperClone_default2 = wrapperClone2; -}); - -// ../node_modules/lodash-es/wrapperLodash.js -function lodash2(value) { - if (isObjectLike_default2(value) && !isArray_default2(value) && !(value instanceof _LazyWrapper_default2)) { - if (value instanceof _LodashWrapper_default2) { - return value; - } - if (hasOwnProperty31.call(value, "__wrapped__")) { - return _wrapperClone_default2(value); - } - } - return new _LodashWrapper_default2(value); -} -var objectProto35, hasOwnProperty31, wrapperLodash_default2; -var init_wrapperLodash2 = __esm(() => { - init__LazyWrapper2(); - init__LodashWrapper2(); - init__baseLodash2(); - init_isArray2(); - init_isObjectLike2(); - init__wrapperClone2(); - objectProto35 = Object.prototype; - hasOwnProperty31 = objectProto35.hasOwnProperty; - lodash2.prototype = _baseLodash_default2.prototype; - lodash2.prototype.constructor = lodash2; - wrapperLodash_default2 = lodash2; -}); - -// ../node_modules/lodash-es/_isLaziable.js -function isLaziable2(func) { - var funcName = _getFuncName_default2(func), other2 = wrapperLodash_default2[funcName]; - if (typeof other2 != "function" || !(funcName in _LazyWrapper_default2.prototype)) { - return false; - } - if (func === other2) { - return true; - } - var data = _getData_default2(other2); - return !!data && func === data[0]; -} -var _isLaziable_default2; -var init__isLaziable2 = __esm(() => { - init__LazyWrapper2(); - init__getData2(); - init__getFuncName2(); - init_wrapperLodash2(); - _isLaziable_default2 = isLaziable2; -}); - -// ../node_modules/lodash-es/_shortOut.js -function shortOut2(func) { - var count3 = 0, lastCalled = 0; - return function() { - var stamp = nativeNow2(), remaining = HOT_SPAN2 - (stamp - lastCalled); - lastCalled = stamp; - if (remaining > 0) { - if (++count3 >= HOT_COUNT2) { - return arguments[0]; - } - } else { - count3 = 0; - } - return func.apply(undefined, arguments); - }; -} -var HOT_COUNT2 = 800, HOT_SPAN2 = 16, nativeNow2, _shortOut_default2; -var init__shortOut2 = __esm(() => { - nativeNow2 = Date.now; - _shortOut_default2 = shortOut2; -}); - -// ../node_modules/lodash-es/_setData.js -var setData2, _setData_default2; -var init__setData2 = __esm(() => { - init__baseSetData2(); - init__shortOut2(); - setData2 = _shortOut_default2(_baseSetData_default2); - _setData_default2 = setData2; -}); - -// ../node_modules/lodash-es/_getWrapDetails.js -function getWrapDetails2(source) { - var match = source.match(reWrapDetails2); - return match ? match[1].split(reSplitDetails2) : []; -} -var reWrapDetails2, reSplitDetails2, _getWrapDetails_default2; -var init__getWrapDetails2 = __esm(() => { - reWrapDetails2 = /\{\n\/\* \[wrapped with (.+)\] \*/; - reSplitDetails2 = /,? & /; - _getWrapDetails_default2 = getWrapDetails2; -}); - -// ../node_modules/lodash-es/_insertWrapDetails.js -function insertWrapDetails2(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex]; - details = details.join(length > 2 ? ", " : " "); - return source.replace(reWrapComment2, `{ -/* [wrapped with ` + details + `] */ -`); -} -var reWrapComment2, _insertWrapDetails_default2; -var init__insertWrapDetails2 = __esm(() => { - reWrapComment2 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; - _insertWrapDetails_default2 = insertWrapDetails2; -}); - -// ../node_modules/lodash-es/constant.js -function constant2(value) { - return function() { - return value; - }; -} -var constant_default2; -var init_constant2 = __esm(() => { - constant_default2 = constant2; -}); - -// ../node_modules/lodash-es/_defineProperty.js -var defineProperty2, _defineProperty_default2; -var init__defineProperty2 = __esm(() => { - init__getNative2(); - defineProperty2 = function() { - try { - var func = _getNative_default2(Object, "defineProperty"); - func({}, "", {}); - return func; - } catch (e) {} - }(); - _defineProperty_default2 = defineProperty2; -}); - -// ../node_modules/lodash-es/_baseSetToString.js -var baseSetToString2, _baseSetToString_default2; -var init__baseSetToString2 = __esm(() => { - init_constant2(); - init__defineProperty2(); - init_identity3(); - baseSetToString2 = !_defineProperty_default2 ? identity_default3 : function(func, string5) { - return _defineProperty_default2(func, "toString", { - configurable: true, - enumerable: false, - value: constant_default2(string5), - writable: true - }); - }; - _baseSetToString_default2 = baseSetToString2; -}); - -// ../node_modules/lodash-es/_setToString.js -var setToString2, _setToString_default2; -var init__setToString2 = __esm(() => { - init__baseSetToString2(); - init__shortOut2(); - setToString2 = _shortOut_default2(_baseSetToString_default2); - _setToString_default2 = setToString2; -}); - -// ../node_modules/lodash-es/_arrayEach.js -function arrayEach2(array3, iteratee2) { - var index = -1, length = array3 == null ? 0 : array3.length; - while (++index < length) { - if (iteratee2(array3[index], index, array3) === false) { - break; - } - } - return array3; -} -var _arrayEach_default2; -var init__arrayEach2 = __esm(() => { - _arrayEach_default2 = arrayEach2; -}); - -// ../node_modules/lodash-es/_baseFindIndex.js -function baseFindIndex2(array3, predicate, fromIndex, fromRight) { - var length = array3.length, index = fromIndex + (fromRight ? 1 : -1); - while (fromRight ? index-- : ++index < length) { - if (predicate(array3[index], index, array3)) { - return index; - } - } - return -1; -} -var _baseFindIndex_default2; -var init__baseFindIndex2 = __esm(() => { - _baseFindIndex_default2 = baseFindIndex2; -}); - -// ../node_modules/lodash-es/_baseIsNaN.js -function baseIsNaN2(value) { - return value !== value; -} -var _baseIsNaN_default2; -var init__baseIsNaN2 = __esm(() => { - _baseIsNaN_default2 = baseIsNaN2; -}); - -// ../node_modules/lodash-es/_strictIndexOf.js -function strictIndexOf2(array3, value, fromIndex) { - var index = fromIndex - 1, length = array3.length; - while (++index < length) { - if (array3[index] === value) { - return index; - } - } - return -1; -} -var _strictIndexOf_default2; -var init__strictIndexOf2 = __esm(() => { - _strictIndexOf_default2 = strictIndexOf2; -}); - -// ../node_modules/lodash-es/_baseIndexOf.js -function baseIndexOf2(array3, value, fromIndex) { - return value === value ? _strictIndexOf_default2(array3, value, fromIndex) : _baseFindIndex_default2(array3, _baseIsNaN_default2, fromIndex); -} -var _baseIndexOf_default2; -var init__baseIndexOf2 = __esm(() => { - init__baseFindIndex2(); - init__baseIsNaN2(); - init__strictIndexOf2(); - _baseIndexOf_default2 = baseIndexOf2; -}); - -// ../node_modules/lodash-es/_arrayIncludes.js -function arrayIncludes2(array3, value) { - var length = array3 == null ? 0 : array3.length; - return !!length && _baseIndexOf_default2(array3, value, 0) > -1; -} -var _arrayIncludes_default2; -var init__arrayIncludes2 = __esm(() => { - init__baseIndexOf2(); - _arrayIncludes_default2 = arrayIncludes2; -}); - -// ../node_modules/lodash-es/_updateWrapDetails.js -function updateWrapDetails2(details, bitmask) { - _arrayEach_default2(wrapFlags2, function(pair) { - var value = "_." + pair[0]; - if (bitmask & pair[1] && !_arrayIncludes_default2(details, value)) { - details.push(value); - } - }); - return details.sort(); -} -var WRAP_BIND_FLAG11 = 1, WRAP_BIND_KEY_FLAG8 = 2, WRAP_CURRY_FLAG8 = 8, WRAP_CURRY_RIGHT_FLAG5 = 16, WRAP_PARTIAL_FLAG8 = 32, WRAP_PARTIAL_RIGHT_FLAG5 = 64, WRAP_ARY_FLAG6 = 128, WRAP_REARG_FLAG5 = 256, WRAP_FLIP_FLAG4 = 512, wrapFlags2, _updateWrapDetails_default2; -var init__updateWrapDetails2 = __esm(() => { - init__arrayEach2(); - init__arrayIncludes2(); - wrapFlags2 = [ - ["ary", WRAP_ARY_FLAG6], - ["bind", WRAP_BIND_FLAG11], - ["bindKey", WRAP_BIND_KEY_FLAG8], - ["curry", WRAP_CURRY_FLAG8], - ["curryRight", WRAP_CURRY_RIGHT_FLAG5], - ["flip", WRAP_FLIP_FLAG4], - ["partial", WRAP_PARTIAL_FLAG8], - ["partialRight", WRAP_PARTIAL_RIGHT_FLAG5], - ["rearg", WRAP_REARG_FLAG5] - ]; - _updateWrapDetails_default2 = updateWrapDetails2; -}); - -// ../node_modules/lodash-es/_setWrapToString.js -function setWrapToString2(wrapper, reference, bitmask) { - var source = reference + ""; - return _setToString_default2(wrapper, _insertWrapDetails_default2(source, _updateWrapDetails_default2(_getWrapDetails_default2(source), bitmask))); -} -var _setWrapToString_default2; -var init__setWrapToString2 = __esm(() => { - init__getWrapDetails2(); - init__insertWrapDetails2(); - init__setToString2(); - init__updateWrapDetails2(); - _setWrapToString_default2 = setWrapToString2; -}); - -// ../node_modules/lodash-es/_createRecurry.js -function createRecurry2(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG9, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; - bitmask |= isCurry ? WRAP_PARTIAL_FLAG9 : WRAP_PARTIAL_RIGHT_FLAG6; - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG6 : WRAP_PARTIAL_FLAG9); - if (!(bitmask & WRAP_CURRY_BOUND_FLAG3)) { - bitmask &= ~(WRAP_BIND_FLAG12 | WRAP_BIND_KEY_FLAG9); - } - var newData = [ - func, - bitmask, - thisArg, - newPartials, - newHolders, - newPartialsRight, - newHoldersRight, - argPos, - ary2, - arity - ]; - var result2 = wrapFunc.apply(undefined, newData); - if (_isLaziable_default2(func)) { - _setData_default2(result2, newData); - } - result2.placeholder = placeholder; - return _setWrapToString_default2(result2, func, bitmask); -} -var WRAP_BIND_FLAG12 = 1, WRAP_BIND_KEY_FLAG9 = 2, WRAP_CURRY_BOUND_FLAG3 = 4, WRAP_CURRY_FLAG9 = 8, WRAP_PARTIAL_FLAG9 = 32, WRAP_PARTIAL_RIGHT_FLAG6 = 64, _createRecurry_default2; -var init__createRecurry2 = __esm(() => { - init__isLaziable2(); - init__setData2(); - init__setWrapToString2(); - _createRecurry_default2 = createRecurry2; -}); - -// ../node_modules/lodash-es/_getHolder.js -function getHolder2(func) { - var object4 = func; - return object4.placeholder; -} -var _getHolder_default2; -var init__getHolder2 = __esm(() => { - _getHolder_default2 = getHolder2; -}); - -// ../node_modules/lodash-es/_isIndex.js -function isIndex2(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER7 : length; - return !!length && (type == "number" || type != "symbol" && reIsUint2.test(value)) && (value > -1 && value % 1 == 0 && value < length); -} -var MAX_SAFE_INTEGER7 = 9007199254740991, reIsUint2, _isIndex_default2; -var init__isIndex2 = __esm(() => { - reIsUint2 = /^(?:0|[1-9]\d*)$/; - _isIndex_default2 = isIndex2; -}); - -// ../node_modules/lodash-es/_reorder.js -function reorder2(array3, indexes) { - var arrLength = array3.length, length = nativeMin16(indexes.length, arrLength), oldArray = _copyArray_default2(array3); - while (length--) { - var index = indexes[length]; - array3[length] = _isIndex_default2(index, arrLength) ? oldArray[index] : undefined; - } - return array3; -} -var nativeMin16, _reorder_default2; -var init__reorder2 = __esm(() => { - init__copyArray2(); - init__isIndex2(); - nativeMin16 = Math.min; - _reorder_default2 = reorder2; -}); - -// ../node_modules/lodash-es/_replaceHolders.js -function replaceHolders2(array3, placeholder) { - var index = -1, length = array3.length, resIndex = 0, result2 = []; - while (++index < length) { - var value = array3[index]; - if (value === placeholder || value === PLACEHOLDER3) { - array3[index] = PLACEHOLDER3; - result2[resIndex++] = index; - } - } - return result2; -} -var PLACEHOLDER3 = "__lodash_placeholder__", _replaceHolders_default2; -var init__replaceHolders2 = __esm(() => { - _replaceHolders_default2 = replaceHolders2; -}); - -// ../node_modules/lodash-es/_createHybrid.js -function createHybrid2(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) { - var isAry = bitmask & WRAP_ARY_FLAG7, isBind = bitmask & WRAP_BIND_FLAG13, isBindKey = bitmask & WRAP_BIND_KEY_FLAG10, isCurried = bitmask & (WRAP_CURRY_FLAG10 | WRAP_CURRY_RIGHT_FLAG6), isFlip = bitmask & WRAP_FLIP_FLAG5, Ctor = isBindKey ? undefined : _createCtor_default2(func); - function wrapper() { - var length = arguments.length, args = Array(length), index = length; - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = _getHolder_default2(wrapper), holdersCount = _countHolders_default2(args, placeholder); - } - if (partials) { - args = _composeArgs_default2(args, partials, holders, isCurried); - } - if (partialsRight) { - args = _composeArgsRight_default2(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = _replaceHolders_default2(args, placeholder); - return _createRecurry_default2(func, bitmask, createHybrid2, wrapper.placeholder, thisArg, args, newHolders, argPos, ary2, arity - length); - } - var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; - length = args.length; - if (argPos) { - args = _reorder_default2(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary2 < length) { - args.length = ary2; - } - if (this && this !== _root_default2 && this instanceof wrapper) { - fn = Ctor || _createCtor_default2(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; -} -var WRAP_BIND_FLAG13 = 1, WRAP_BIND_KEY_FLAG10 = 2, WRAP_CURRY_FLAG10 = 8, WRAP_CURRY_RIGHT_FLAG6 = 16, WRAP_ARY_FLAG7 = 128, WRAP_FLIP_FLAG5 = 512, _createHybrid_default2; -var init__createHybrid2 = __esm(() => { - init__composeArgs2(); - init__composeArgsRight2(); - init__countHolders2(); - init__createCtor2(); - init__createRecurry2(); - init__getHolder2(); - init__reorder2(); - init__replaceHolders2(); - init__root2(); - _createHybrid_default2 = createHybrid2; -}); - -// ../node_modules/lodash-es/_createCurry.js -function createCurry2(func, bitmask, arity) { - var Ctor = _createCtor_default2(func); - function wrapper() { - var length = arguments.length, args = Array(length), index = length, placeholder = _getHolder_default2(wrapper); - while (index--) { - args[index] = arguments[index]; - } - var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : _replaceHolders_default2(args, placeholder); - length -= holders.length; - if (length < arity) { - return _createRecurry_default2(func, bitmask, _createHybrid_default2, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); - } - var fn = this && this !== _root_default2 && this instanceof wrapper ? Ctor : func; - return _apply_default2(fn, this, args); - } - return wrapper; -} -var _createCurry_default2; -var init__createCurry2 = __esm(() => { - init__apply2(); - init__createCtor2(); - init__createHybrid2(); - init__createRecurry2(); - init__getHolder2(); - init__replaceHolders2(); - init__root2(); - _createCurry_default2 = createCurry2; -}); - -// ../node_modules/lodash-es/_createPartial.js -function createPartial2(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG14, Ctor = _createCtor_default2(func); - function wrapper() { - var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== _root_default2 && this instanceof wrapper ? Ctor : func; - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return _apply_default2(fn, isBind ? thisArg : this, args); - } - return wrapper; -} -var WRAP_BIND_FLAG14 = 1, _createPartial_default2; -var init__createPartial2 = __esm(() => { - init__apply2(); - init__createCtor2(); - init__root2(); - _createPartial_default2 = createPartial2; -}); - -// ../node_modules/lodash-es/_mergeData.js -function mergeData2(data, source) { - var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG15 | WRAP_BIND_KEY_FLAG11 | WRAP_ARY_FLAG8); - var isCombo = srcBitmask == WRAP_ARY_FLAG8 && bitmask == WRAP_CURRY_FLAG11 || srcBitmask == WRAP_ARY_FLAG8 && bitmask == WRAP_REARG_FLAG6 && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG8 | WRAP_REARG_FLAG6) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG11; - if (!(isCommon || isCombo)) { - return data; - } - if (srcBitmask & WRAP_BIND_FLAG15) { - data[2] = source[2]; - newBitmask |= bitmask & WRAP_BIND_FLAG15 ? 0 : WRAP_CURRY_BOUND_FLAG4; - } - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? _composeArgs_default2(partials, value, source[4]) : value; - data[4] = partials ? _replaceHolders_default2(data[3], PLACEHOLDER4) : source[4]; - } - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? _composeArgsRight_default2(partials, value, source[6]) : value; - data[6] = partials ? _replaceHolders_default2(data[5], PLACEHOLDER4) : source[6]; - } - value = source[7]; - if (value) { - data[7] = value; - } - if (srcBitmask & WRAP_ARY_FLAG8) { - data[8] = data[8] == null ? source[8] : nativeMin17(data[8], source[8]); - } - if (data[9] == null) { - data[9] = source[9]; - } - data[0] = source[0]; - data[1] = newBitmask; - return data; -} -var PLACEHOLDER4 = "__lodash_placeholder__", WRAP_BIND_FLAG15 = 1, WRAP_BIND_KEY_FLAG11 = 2, WRAP_CURRY_BOUND_FLAG4 = 4, WRAP_CURRY_FLAG11 = 8, WRAP_ARY_FLAG8 = 128, WRAP_REARG_FLAG6 = 256, nativeMin17, _mergeData_default2; -var init__mergeData2 = __esm(() => { - init__composeArgs2(); - init__composeArgsRight2(); - init__replaceHolders2(); - nativeMin17 = Math.min; - _mergeData_default2 = mergeData2; -}); - -// ../node_modules/lodash-es/_createWrap.js -function createWrap2(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG12; - if (!isBindKey && typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT14); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG10 | WRAP_PARTIAL_RIGHT_FLAG7); - partials = holders = undefined; - } - ary2 = ary2 === undefined ? ary2 : nativeMax20(toInteger_default2(ary2), 0); - arity = arity === undefined ? arity : toInteger_default2(arity); - length -= holders ? holders.length : 0; - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG7) { - var partialsRight = partials, holdersRight = holders; - partials = holders = undefined; - } - var data = isBindKey ? undefined : _getData_default2(func); - var newData = [ - func, - bitmask, - thisArg, - partials, - holders, - partialsRight, - holdersRight, - argPos, - ary2, - arity - ]; - if (data) { - _mergeData_default2(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined ? isBindKey ? 0 : func.length : nativeMax20(newData[9] - length, 0); - if (!arity && bitmask & (WRAP_CURRY_FLAG12 | WRAP_CURRY_RIGHT_FLAG7)) { - bitmask &= ~(WRAP_CURRY_FLAG12 | WRAP_CURRY_RIGHT_FLAG7); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG16) { - var result2 = _createBind_default2(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG12 || bitmask == WRAP_CURRY_RIGHT_FLAG7) { - result2 = _createCurry_default2(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG10 || bitmask == (WRAP_BIND_FLAG16 | WRAP_PARTIAL_FLAG10)) && !holders.length) { - result2 = _createPartial_default2(func, bitmask, thisArg, partials); - } else { - result2 = _createHybrid_default2.apply(undefined, newData); - } - var setter = data ? _baseSetData_default2 : _setData_default2; - return _setWrapToString_default2(setter(result2, newData), func, bitmask); -} -var FUNC_ERROR_TEXT14 = "Expected a function", WRAP_BIND_FLAG16 = 1, WRAP_BIND_KEY_FLAG12 = 2, WRAP_CURRY_FLAG12 = 8, WRAP_CURRY_RIGHT_FLAG7 = 16, WRAP_PARTIAL_FLAG10 = 32, WRAP_PARTIAL_RIGHT_FLAG7 = 64, nativeMax20, _createWrap_default2; -var init__createWrap2 = __esm(() => { - init__baseSetData2(); - init__createBind2(); - init__createCurry2(); - init__createHybrid2(); - init__createPartial2(); - init__getData2(); - init__mergeData2(); - init__setData2(); - init__setWrapToString2(); - init_toInteger2(); - nativeMax20 = Math.max; - _createWrap_default2 = createWrap2; -}); - -// ../node_modules/lodash-es/ary.js -function ary2(func, n2, guard) { - n2 = guard ? undefined : n2; - n2 = func && n2 == null ? func.length : n2; - return _createWrap_default2(func, WRAP_ARY_FLAG9, undefined, undefined, undefined, undefined, n2); -} -var WRAP_ARY_FLAG9 = 128, ary_default2; -var init_ary2 = __esm(() => { - init__createWrap2(); - ary_default2 = ary2; -}); - -// ../node_modules/lodash-es/_baseAssignValue.js -function baseAssignValue2(object4, key, value) { - if (key == "__proto__" && _defineProperty_default2) { - _defineProperty_default2(object4, key, { - configurable: true, - enumerable: true, - value, - writable: true - }); - } else { - object4[key] = value; - } -} -var _baseAssignValue_default2; -var init__baseAssignValue2 = __esm(() => { - init__defineProperty2(); - _baseAssignValue_default2 = baseAssignValue2; -}); - -// ../node_modules/lodash-es/eq.js -function eq2(value, other2) { - return value === other2 || value !== value && other2 !== other2; -} -var eq_default2; -var init_eq2 = __esm(() => { - eq_default2 = eq2; -}); - -// ../node_modules/lodash-es/_assignValue.js -function assignValue2(object4, key, value) { - var objValue = object4[key]; - if (!(hasOwnProperty32.call(object4, key) && eq_default2(objValue, value)) || value === undefined && !(key in object4)) { - _baseAssignValue_default2(object4, key, value); - } -} -var objectProto36, hasOwnProperty32, _assignValue_default2; -var init__assignValue2 = __esm(() => { - init__baseAssignValue2(); - init_eq2(); - objectProto36 = Object.prototype; - hasOwnProperty32 = objectProto36.hasOwnProperty; - _assignValue_default2 = assignValue2; -}); - -// ../node_modules/lodash-es/_copyObject.js -function copyObject2(source, props, object4, customizer) { - var isNew = !object4; - object4 || (object4 = {}); - var index = -1, length = props.length; - while (++index < length) { - var key = props[index]; - var newValue = customizer ? customizer(object4[key], source[key], key, object4, source) : undefined; - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - _baseAssignValue_default2(object4, key, newValue); - } else { - _assignValue_default2(object4, key, newValue); - } - } - return object4; -} -var _copyObject_default2; -var init__copyObject2 = __esm(() => { - init__assignValue2(); - init__baseAssignValue2(); - _copyObject_default2 = copyObject2; -}); - -// ../node_modules/lodash-es/_overRest.js -function overRest2(func, start, transform3) { - start = nativeMax21(start === undefined ? func.length - 1 : start, 0); - return function() { - var args = arguments, index = -1, length = nativeMax21(args.length - start, 0), array3 = Array(length); - while (++index < length) { - array3[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform3(array3); - return _apply_default2(func, this, otherArgs); - }; -} -var nativeMax21, _overRest_default2; -var init__overRest2 = __esm(() => { - init__apply2(); - nativeMax21 = Math.max; - _overRest_default2 = overRest2; -}); - -// ../node_modules/lodash-es/_baseRest.js -function baseRest2(func, start) { - return _setToString_default2(_overRest_default2(func, start, identity_default3), func + ""); -} -var _baseRest_default2; -var init__baseRest2 = __esm(() => { - init_identity3(); - init__overRest2(); - init__setToString2(); - _baseRest_default2 = baseRest2; -}); - -// ../node_modules/lodash-es/isLength.js -function isLength2(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER8; -} -var MAX_SAFE_INTEGER8 = 9007199254740991, isLength_default2; -var init_isLength2 = __esm(() => { - isLength_default2 = isLength2; -}); - -// ../node_modules/lodash-es/isArrayLike.js -function isArrayLike2(value) { - return value != null && isLength_default2(value.length) && !isFunction_default2(value); -} -var isArrayLike_default2; -var init_isArrayLike2 = __esm(() => { - init_isFunction2(); - init_isLength2(); - isArrayLike_default2 = isArrayLike2; -}); - -// ../node_modules/lodash-es/_isIterateeCall.js -function isIterateeCall2(value, index, object4) { - if (!isObject_default2(object4)) { - return false; - } - var type = typeof index; - if (type == "number" ? isArrayLike_default2(object4) && _isIndex_default2(index, object4.length) : type == "string" && (index in object4)) { - return eq_default2(object4[index], value); - } - return false; -} -var _isIterateeCall_default2; -var init__isIterateeCall2 = __esm(() => { - init_eq2(); - init_isArrayLike2(); - init__isIndex2(); - init_isObject2(); - _isIterateeCall_default2 = isIterateeCall2; -}); - -// ../node_modules/lodash-es/_createAssigner.js -function createAssigner2(assigner) { - return _baseRest_default2(function(object4, sources) { - var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; - customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined; - if (guard && _isIterateeCall_default2(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object4 = Object(object4); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object4, source, index, customizer); - } - } - return object4; - }); -} -var _createAssigner_default2; -var init__createAssigner2 = __esm(() => { - init__baseRest2(); - init__isIterateeCall2(); - _createAssigner_default2 = createAssigner2; -}); - -// ../node_modules/lodash-es/_isPrototype.js -function isPrototype2(value) { - var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto37; - return value === proto2; -} -var objectProto37, _isPrototype_default2; -var init__isPrototype2 = __esm(() => { - objectProto37 = Object.prototype; - _isPrototype_default2 = isPrototype2; -}); - -// ../node_modules/lodash-es/_baseTimes.js -function baseTimes2(n2, iteratee2) { - var index = -1, result2 = Array(n2); - while (++index < n2) { - result2[index] = iteratee2(index); - } - return result2; -} -var _baseTimes_default2; -var init__baseTimes2 = __esm(() => { - _baseTimes_default2 = baseTimes2; -}); - -// ../node_modules/lodash-es/_baseIsArguments.js -function baseIsArguments2(value) { - return isObjectLike_default2(value) && _baseGetTag_default2(value) == argsTag5; -} -var argsTag5 = "[object Arguments]", _baseIsArguments_default2; -var init__baseIsArguments2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - _baseIsArguments_default2 = baseIsArguments2; -}); - -// ../node_modules/lodash-es/isArguments.js -var objectProto38, hasOwnProperty33, propertyIsEnumerable3, isArguments2, isArguments_default2; -var init_isArguments2 = __esm(() => { - init__baseIsArguments2(); - init_isObjectLike2(); - objectProto38 = Object.prototype; - hasOwnProperty33 = objectProto38.hasOwnProperty; - propertyIsEnumerable3 = objectProto38.propertyIsEnumerable; - isArguments2 = _baseIsArguments_default2(function() { - return arguments; - }()) ? _baseIsArguments_default2 : function(value) { - return isObjectLike_default2(value) && hasOwnProperty33.call(value, "callee") && !propertyIsEnumerable3.call(value, "callee"); - }; - isArguments_default2 = isArguments2; -}); - -// ../node_modules/lodash-es/stubFalse.js -function stubFalse2() { - return false; -} -var stubFalse_default2; -var init_stubFalse2 = __esm(() => { - stubFalse_default2 = stubFalse2; -}); - -// ../node_modules/lodash-es/isBuffer.js -var exports_isBuffer2 = {}; -__export(exports_isBuffer2, { - default: () => isBuffer_default2 -}); -var freeExports4, freeModule4, moduleExports4, Buffer9, nativeIsBuffer2, isBuffer3, isBuffer_default2; -var init_isBuffer2 = __esm(() => { - init__root2(); - init_stubFalse2(); - freeExports4 = typeof exports_isBuffer2 == "object" && exports_isBuffer2 && !exports_isBuffer2.nodeType && exports_isBuffer2; - freeModule4 = freeExports4 && typeof module_isBuffer == "object" && module_isBuffer && !module_isBuffer.nodeType && module_isBuffer; - moduleExports4 = freeModule4 && freeModule4.exports === freeExports4; - Buffer9 = moduleExports4 ? _root_default2.Buffer : undefined; - nativeIsBuffer2 = Buffer9 ? Buffer9.isBuffer : undefined; - isBuffer3 = nativeIsBuffer2 || stubFalse_default2; - isBuffer_default2 = isBuffer3; -}); - -// ../node_modules/lodash-es/_baseIsTypedArray.js -function baseIsTypedArray2(value) { - return isObjectLike_default2(value) && isLength_default2(value.length) && !!typedArrayTags2[_baseGetTag_default2(value)]; -} -var argsTag6 = "[object Arguments]", arrayTag4 = "[object Array]", boolTag6 = "[object Boolean]", dateTag6 = "[object Date]", errorTag5 = "[object Error]", funcTag5 = "[object Function]", mapTag11 = "[object Map]", numberTag6 = "[object Number]", objectTag6 = "[object Object]", regexpTag6 = "[object RegExp]", setTag11 = "[object Set]", stringTag6 = "[object String]", weakMapTag5 = "[object WeakMap]", arrayBufferTag6 = "[object ArrayBuffer]", dataViewTag6 = "[object DataView]", float32Tag4 = "[object Float32Array]", float64Tag4 = "[object Float64Array]", int8Tag4 = "[object Int8Array]", int16Tag4 = "[object Int16Array]", int32Tag4 = "[object Int32Array]", uint8Tag4 = "[object Uint8Array]", uint8ClampedTag4 = "[object Uint8ClampedArray]", uint16Tag4 = "[object Uint16Array]", uint32Tag4 = "[object Uint32Array]", typedArrayTags2, _baseIsTypedArray_default2; -var init__baseIsTypedArray2 = __esm(() => { - init__baseGetTag2(); - init_isLength2(); - init_isObjectLike2(); - typedArrayTags2 = {}; - typedArrayTags2[float32Tag4] = typedArrayTags2[float64Tag4] = typedArrayTags2[int8Tag4] = typedArrayTags2[int16Tag4] = typedArrayTags2[int32Tag4] = typedArrayTags2[uint8Tag4] = typedArrayTags2[uint8ClampedTag4] = typedArrayTags2[uint16Tag4] = typedArrayTags2[uint32Tag4] = true; - typedArrayTags2[argsTag6] = typedArrayTags2[arrayTag4] = typedArrayTags2[arrayBufferTag6] = typedArrayTags2[boolTag6] = typedArrayTags2[dataViewTag6] = typedArrayTags2[dateTag6] = typedArrayTags2[errorTag5] = typedArrayTags2[funcTag5] = typedArrayTags2[mapTag11] = typedArrayTags2[numberTag6] = typedArrayTags2[objectTag6] = typedArrayTags2[regexpTag6] = typedArrayTags2[setTag11] = typedArrayTags2[stringTag6] = typedArrayTags2[weakMapTag5] = false; - _baseIsTypedArray_default2 = baseIsTypedArray2; -}); - -// ../node_modules/lodash-es/_baseUnary.js -function baseUnary2(func) { - return function(value) { - return func(value); - }; -} -var _baseUnary_default2; -var init__baseUnary2 = __esm(() => { - _baseUnary_default2 = baseUnary2; -}); - -// ../node_modules/lodash-es/_nodeUtil.js -var exports__nodeUtil2 = {}; -__export(exports__nodeUtil2, { - default: () => _nodeUtil_default2 -}); -var freeExports5, freeModule5, moduleExports5, freeProcess2, nodeUtil2, _nodeUtil_default2; -var init__nodeUtil2 = __esm(() => { - init__freeGlobal2(); - freeExports5 = typeof exports__nodeUtil2 == "object" && exports__nodeUtil2 && !exports__nodeUtil2.nodeType && exports__nodeUtil2; - freeModule5 = freeExports5 && typeof module__nodeUtil == "object" && module__nodeUtil && !module__nodeUtil.nodeType && module__nodeUtil; - moduleExports5 = freeModule5 && freeModule5.exports === freeExports5; - freeProcess2 = moduleExports5 && _freeGlobal_default2.process; - nodeUtil2 = function() { - try { - var types2 = freeModule5 && freeModule5.require && freeModule5.require("util").types; - if (types2) { - return types2; - } - return freeProcess2 && freeProcess2.binding && freeProcess2.binding("util"); - } catch (e) {} - }(); - _nodeUtil_default2 = nodeUtil2; -}); - -// ../node_modules/lodash-es/isTypedArray.js -var nodeIsTypedArray2, isTypedArray3, isTypedArray_default2; -var init_isTypedArray2 = __esm(() => { - init__baseIsTypedArray2(); - init__baseUnary2(); - init__nodeUtil2(); - nodeIsTypedArray2 = _nodeUtil_default2 && _nodeUtil_default2.isTypedArray; - isTypedArray3 = nodeIsTypedArray2 ? _baseUnary_default2(nodeIsTypedArray2) : _baseIsTypedArray_default2; - isTypedArray_default2 = isTypedArray3; -}); - -// ../node_modules/lodash-es/_arrayLikeKeys.js -function arrayLikeKeys2(value, inherited) { - var isArr = isArray_default2(value), isArg = !isArr && isArguments_default2(value), isBuff = !isArr && !isArg && isBuffer_default2(value), isType = !isArr && !isArg && !isBuff && isTypedArray_default2(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? _baseTimes_default2(value.length, String) : [], length = result2.length; - for (var key in value) { - if ((inherited || hasOwnProperty34.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || _isIndex_default2(key, length)))) { - result2.push(key); - } - } - return result2; -} -var objectProto39, hasOwnProperty34, _arrayLikeKeys_default2; -var init__arrayLikeKeys2 = __esm(() => { - init__baseTimes2(); - init_isArguments2(); - init_isArray2(); - init_isBuffer2(); - init__isIndex2(); - init_isTypedArray2(); - objectProto39 = Object.prototype; - hasOwnProperty34 = objectProto39.hasOwnProperty; - _arrayLikeKeys_default2 = arrayLikeKeys2; -}); - -// ../node_modules/lodash-es/_overArg.js -function overArg2(func, transform3) { - return function(arg) { - return func(transform3(arg)); - }; -} -var _overArg_default2; -var init__overArg2 = __esm(() => { - _overArg_default2 = overArg2; -}); - -// ../node_modules/lodash-es/_nativeKeys.js -var nativeKeys2, _nativeKeys_default2; -var init__nativeKeys2 = __esm(() => { - init__overArg2(); - nativeKeys2 = _overArg_default2(Object.keys, Object); - _nativeKeys_default2 = nativeKeys2; -}); - -// ../node_modules/lodash-es/_baseKeys.js -function baseKeys2(object4) { - if (!_isPrototype_default2(object4)) { - return _nativeKeys_default2(object4); - } - var result2 = []; - for (var key in Object(object4)) { - if (hasOwnProperty35.call(object4, key) && key != "constructor") { - result2.push(key); - } - } - return result2; -} -var objectProto40, hasOwnProperty35, _baseKeys_default2; -var init__baseKeys2 = __esm(() => { - init__isPrototype2(); - init__nativeKeys2(); - objectProto40 = Object.prototype; - hasOwnProperty35 = objectProto40.hasOwnProperty; - _baseKeys_default2 = baseKeys2; -}); - -// ../node_modules/lodash-es/keys.js -function keys2(object4) { - return isArrayLike_default2(object4) ? _arrayLikeKeys_default2(object4) : _baseKeys_default2(object4); -} -var keys_default2; -var init_keys3 = __esm(() => { - init__arrayLikeKeys2(); - init__baseKeys2(); - init_isArrayLike2(); - keys_default2 = keys2; -}); - -// ../node_modules/lodash-es/assign.js -var objectProto41, hasOwnProperty36, assign2, assign_default2; -var init_assign2 = __esm(() => { - init__assignValue2(); - init__copyObject2(); - init__createAssigner2(); - init_isArrayLike2(); - init__isPrototype2(); - init_keys3(); - objectProto41 = Object.prototype; - hasOwnProperty36 = objectProto41.hasOwnProperty; - assign2 = _createAssigner_default2(function(object4, source) { - if (_isPrototype_default2(source) || isArrayLike_default2(source)) { - _copyObject_default2(source, keys_default2(source), object4); - return; - } - for (var key in source) { - if (hasOwnProperty36.call(source, key)) { - _assignValue_default2(object4, key, source[key]); - } - } - }); - assign_default2 = assign2; -}); - -// ../node_modules/lodash-es/_nativeKeysIn.js -function nativeKeysIn2(object4) { - var result2 = []; - if (object4 != null) { - for (var key in Object(object4)) { - result2.push(key); - } - } - return result2; -} -var _nativeKeysIn_default2; -var init__nativeKeysIn2 = __esm(() => { - _nativeKeysIn_default2 = nativeKeysIn2; -}); - -// ../node_modules/lodash-es/_baseKeysIn.js -function baseKeysIn2(object4) { - if (!isObject_default2(object4)) { - return _nativeKeysIn_default2(object4); - } - var isProto = _isPrototype_default2(object4), result2 = []; - for (var key in object4) { - if (!(key == "constructor" && (isProto || !hasOwnProperty37.call(object4, key)))) { - result2.push(key); - } - } - return result2; -} -var objectProto42, hasOwnProperty37, _baseKeysIn_default2; -var init__baseKeysIn2 = __esm(() => { - init_isObject2(); - init__isPrototype2(); - init__nativeKeysIn2(); - objectProto42 = Object.prototype; - hasOwnProperty37 = objectProto42.hasOwnProperty; - _baseKeysIn_default2 = baseKeysIn2; -}); - -// ../node_modules/lodash-es/keysIn.js -function keysIn2(object4) { - return isArrayLike_default2(object4) ? _arrayLikeKeys_default2(object4, true) : _baseKeysIn_default2(object4); -} -var keysIn_default2; -var init_keysIn2 = __esm(() => { - init__arrayLikeKeys2(); - init__baseKeysIn2(); - init_isArrayLike2(); - keysIn_default2 = keysIn2; -}); - -// ../node_modules/lodash-es/assignIn.js -var assignIn2, assignIn_default2; -var init_assignIn2 = __esm(() => { - init__copyObject2(); - init__createAssigner2(); - init_keysIn2(); - assignIn2 = _createAssigner_default2(function(object4, source) { - _copyObject_default2(source, keysIn_default2(source), object4); - }); - assignIn_default2 = assignIn2; -}); - -// ../node_modules/lodash-es/assignInWith.js -var assignInWith2, assignInWith_default2; -var init_assignInWith2 = __esm(() => { - init__copyObject2(); - init__createAssigner2(); - init_keysIn2(); - assignInWith2 = _createAssigner_default2(function(object4, source, srcIndex, customizer) { - _copyObject_default2(source, keysIn_default2(source), object4, customizer); - }); - assignInWith_default2 = assignInWith2; -}); - -// ../node_modules/lodash-es/assignWith.js -var assignWith2, assignWith_default2; -var init_assignWith2 = __esm(() => { - init__copyObject2(); - init__createAssigner2(); - init_keys3(); - assignWith2 = _createAssigner_default2(function(object4, source, srcIndex, customizer) { - _copyObject_default2(source, keys_default2(source), object4, customizer); - }); - assignWith_default2 = assignWith2; -}); - -// ../node_modules/lodash-es/_isKey.js -function isKey2(value, object4) { - if (isArray_default2(value)) { - return false; - } - var type = typeof value; - if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol_default2(value)) { - return true; - } - return reIsPlainProp2.test(value) || !reIsDeepProp2.test(value) || object4 != null && value in Object(object4); -} -var reIsDeepProp2, reIsPlainProp2, _isKey_default2; -var init__isKey2 = __esm(() => { - init_isArray2(); - init_isSymbol2(); - reIsDeepProp2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; - reIsPlainProp2 = /^\w*$/; - _isKey_default2 = isKey2; -}); - -// ../node_modules/lodash-es/_nativeCreate.js -var nativeCreate2, _nativeCreate_default2; -var init__nativeCreate2 = __esm(() => { - init__getNative2(); - nativeCreate2 = _getNative_default2(Object, "create"); - _nativeCreate_default2 = nativeCreate2; -}); - -// ../node_modules/lodash-es/_hashClear.js -function hashClear2() { - this.__data__ = _nativeCreate_default2 ? _nativeCreate_default2(null) : {}; - this.size = 0; -} -var _hashClear_default2; -var init__hashClear2 = __esm(() => { - init__nativeCreate2(); - _hashClear_default2 = hashClear2; -}); - -// ../node_modules/lodash-es/_hashDelete.js -function hashDelete2(key) { - var result2 = this.has(key) && delete this.__data__[key]; - this.size -= result2 ? 1 : 0; - return result2; -} -var _hashDelete_default2; -var init__hashDelete2 = __esm(() => { - _hashDelete_default2 = hashDelete2; -}); - -// ../node_modules/lodash-es/_hashGet.js -function hashGet2(key) { - var data = this.__data__; - if (_nativeCreate_default2) { - var result2 = data[key]; - return result2 === HASH_UNDEFINED4 ? undefined : result2; - } - return hasOwnProperty38.call(data, key) ? data[key] : undefined; -} -var HASH_UNDEFINED4 = "__lodash_hash_undefined__", objectProto43, hasOwnProperty38, _hashGet_default2; -var init__hashGet2 = __esm(() => { - init__nativeCreate2(); - objectProto43 = Object.prototype; - hasOwnProperty38 = objectProto43.hasOwnProperty; - _hashGet_default2 = hashGet2; -}); - -// ../node_modules/lodash-es/_hashHas.js -function hashHas2(key) { - var data = this.__data__; - return _nativeCreate_default2 ? data[key] !== undefined : hasOwnProperty39.call(data, key); -} -var objectProto44, hasOwnProperty39, _hashHas_default2; -var init__hashHas2 = __esm(() => { - init__nativeCreate2(); - objectProto44 = Object.prototype; - hasOwnProperty39 = objectProto44.hasOwnProperty; - _hashHas_default2 = hashHas2; -}); - -// ../node_modules/lodash-es/_hashSet.js -function hashSet2(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = _nativeCreate_default2 && value === undefined ? HASH_UNDEFINED5 : value; - return this; -} -var HASH_UNDEFINED5 = "__lodash_hash_undefined__", _hashSet_default2; -var init__hashSet2 = __esm(() => { - init__nativeCreate2(); - _hashSet_default2 = hashSet2; -}); - -// ../node_modules/lodash-es/_Hash.js -function Hash2(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} -var _Hash_default2; -var init__Hash2 = __esm(() => { - init__hashClear2(); - init__hashDelete2(); - init__hashGet2(); - init__hashHas2(); - init__hashSet2(); - Hash2.prototype.clear = _hashClear_default2; - Hash2.prototype["delete"] = _hashDelete_default2; - Hash2.prototype.get = _hashGet_default2; - Hash2.prototype.has = _hashHas_default2; - Hash2.prototype.set = _hashSet_default2; - _Hash_default2 = Hash2; -}); - -// ../node_modules/lodash-es/_listCacheClear.js -function listCacheClear2() { - this.__data__ = []; - this.size = 0; -} -var _listCacheClear_default2; -var init__listCacheClear2 = __esm(() => { - _listCacheClear_default2 = listCacheClear2; -}); - -// ../node_modules/lodash-es/_assocIndexOf.js -function assocIndexOf2(array3, key) { - var length = array3.length; - while (length--) { - if (eq_default2(array3[length][0], key)) { - return length; - } - } - return -1; -} -var _assocIndexOf_default2; -var init__assocIndexOf2 = __esm(() => { - init_eq2(); - _assocIndexOf_default2 = assocIndexOf2; -}); - -// ../node_modules/lodash-es/_listCacheDelete.js -function listCacheDelete2(key) { - var data = this.__data__, index = _assocIndexOf_default2(data, key); - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice4.call(data, index, 1); - } - --this.size; - return true; -} -var arrayProto7, splice4, _listCacheDelete_default2; -var init__listCacheDelete2 = __esm(() => { - init__assocIndexOf2(); - arrayProto7 = Array.prototype; - splice4 = arrayProto7.splice; - _listCacheDelete_default2 = listCacheDelete2; -}); - -// ../node_modules/lodash-es/_listCacheGet.js -function listCacheGet2(key) { - var data = this.__data__, index = _assocIndexOf_default2(data, key); - return index < 0 ? undefined : data[index][1]; -} -var _listCacheGet_default2; -var init__listCacheGet2 = __esm(() => { - init__assocIndexOf2(); - _listCacheGet_default2 = listCacheGet2; -}); - -// ../node_modules/lodash-es/_listCacheHas.js -function listCacheHas2(key) { - return _assocIndexOf_default2(this.__data__, key) > -1; -} -var _listCacheHas_default2; -var init__listCacheHas2 = __esm(() => { - init__assocIndexOf2(); - _listCacheHas_default2 = listCacheHas2; -}); - -// ../node_modules/lodash-es/_listCacheSet.js -function listCacheSet2(key, value) { - var data = this.__data__, index = _assocIndexOf_default2(data, key); - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} -var _listCacheSet_default2; -var init__listCacheSet2 = __esm(() => { - init__assocIndexOf2(); - _listCacheSet_default2 = listCacheSet2; -}); - -// ../node_modules/lodash-es/_ListCache.js -function ListCache2(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} -var _ListCache_default2; -var init__ListCache2 = __esm(() => { - init__listCacheClear2(); - init__listCacheDelete2(); - init__listCacheGet2(); - init__listCacheHas2(); - init__listCacheSet2(); - ListCache2.prototype.clear = _listCacheClear_default2; - ListCache2.prototype["delete"] = _listCacheDelete_default2; - ListCache2.prototype.get = _listCacheGet_default2; - ListCache2.prototype.has = _listCacheHas_default2; - ListCache2.prototype.set = _listCacheSet_default2; - _ListCache_default2 = ListCache2; -}); - -// ../node_modules/lodash-es/_Map.js -var Map3, _Map_default2; -var init__Map2 = __esm(() => { - init__getNative2(); - init__root2(); - Map3 = _getNative_default2(_root_default2, "Map"); - _Map_default2 = Map3; -}); - -// ../node_modules/lodash-es/_mapCacheClear.js -function mapCacheClear2() { - this.size = 0; - this.__data__ = { - hash: new _Hash_default2, - map: new (_Map_default2 || _ListCache_default2), - string: new _Hash_default2 - }; -} -var _mapCacheClear_default2; -var init__mapCacheClear2 = __esm(() => { - init__Hash2(); - init__ListCache2(); - init__Map2(); - _mapCacheClear_default2 = mapCacheClear2; -}); - -// ../node_modules/lodash-es/_isKeyable.js -function isKeyable2(value) { - var type = typeof value; - return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; -} -var _isKeyable_default2; -var init__isKeyable2 = __esm(() => { - _isKeyable_default2 = isKeyable2; -}); - -// ../node_modules/lodash-es/_getMapData.js -function getMapData2(map5, key) { - var data = map5.__data__; - return _isKeyable_default2(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; -} -var _getMapData_default2; -var init__getMapData2 = __esm(() => { - init__isKeyable2(); - _getMapData_default2 = getMapData2; -}); - -// ../node_modules/lodash-es/_mapCacheDelete.js -function mapCacheDelete2(key) { - var result2 = _getMapData_default2(this, key)["delete"](key); - this.size -= result2 ? 1 : 0; - return result2; -} -var _mapCacheDelete_default2; -var init__mapCacheDelete2 = __esm(() => { - init__getMapData2(); - _mapCacheDelete_default2 = mapCacheDelete2; -}); - -// ../node_modules/lodash-es/_mapCacheGet.js -function mapCacheGet2(key) { - return _getMapData_default2(this, key).get(key); -} -var _mapCacheGet_default2; -var init__mapCacheGet2 = __esm(() => { - init__getMapData2(); - _mapCacheGet_default2 = mapCacheGet2; -}); - -// ../node_modules/lodash-es/_mapCacheHas.js -function mapCacheHas2(key) { - return _getMapData_default2(this, key).has(key); -} -var _mapCacheHas_default2; -var init__mapCacheHas2 = __esm(() => { - init__getMapData2(); - _mapCacheHas_default2 = mapCacheHas2; -}); - -// ../node_modules/lodash-es/_mapCacheSet.js -function mapCacheSet2(key, value) { - var data = _getMapData_default2(this, key), size2 = data.size; - data.set(key, value); - this.size += data.size == size2 ? 0 : 1; - return this; -} -var _mapCacheSet_default2; -var init__mapCacheSet2 = __esm(() => { - init__getMapData2(); - _mapCacheSet_default2 = mapCacheSet2; -}); - -// ../node_modules/lodash-es/_MapCache.js -function MapCache2(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} -var _MapCache_default2; -var init__MapCache2 = __esm(() => { - init__mapCacheClear2(); - init__mapCacheDelete2(); - init__mapCacheGet2(); - init__mapCacheHas2(); - init__mapCacheSet2(); - MapCache2.prototype.clear = _mapCacheClear_default2; - MapCache2.prototype["delete"] = _mapCacheDelete_default2; - MapCache2.prototype.get = _mapCacheGet_default2; - MapCache2.prototype.has = _mapCacheHas_default2; - MapCache2.prototype.set = _mapCacheSet_default2; - _MapCache_default2 = MapCache2; -}); - -// ../node_modules/lodash-es/memoize.js -function memoize2(func, resolver) { - if (typeof func != "function" || resolver != null && typeof resolver != "function") { - throw new TypeError(FUNC_ERROR_TEXT15); - } - var memoized = function() { - var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache3 = memoized.cache; - if (cache3.has(key)) { - return cache3.get(key); - } - var result2 = func.apply(this, args); - memoized.cache = cache3.set(key, result2) || cache3; - return result2; - }; - memoized.cache = new (memoize2.Cache || _MapCache_default2); - return memoized; -} -var FUNC_ERROR_TEXT15 = "Expected a function", memoize_default2; -var init_memoize3 = __esm(() => { - init__MapCache2(); - memoize2.Cache = _MapCache_default2; - memoize_default2 = memoize2; -}); - -// ../node_modules/lodash-es/_memoizeCapped.js -function memoizeCapped2(func) { - var result2 = memoize_default2(func, function(key) { - if (cache3.size === MAX_MEMOIZE_SIZE2) { - cache3.clear(); - } - return key; - }); - var cache3 = result2.cache; - return result2; -} -var MAX_MEMOIZE_SIZE2 = 500, _memoizeCapped_default2; -var init__memoizeCapped2 = __esm(() => { - init_memoize3(); - _memoizeCapped_default2 = memoizeCapped2; -}); - -// ../node_modules/lodash-es/_stringToPath.js -var rePropName2, reEscapeChar2, stringToPath2, _stringToPath_default2; -var init__stringToPath2 = __esm(() => { - init__memoizeCapped2(); - rePropName2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - reEscapeChar2 = /\\(\\)?/g; - stringToPath2 = _memoizeCapped_default2(function(string5) { - var result2 = []; - if (string5.charCodeAt(0) === 46) { - result2.push(""); - } - string5.replace(rePropName2, function(match, number5, quote, subString) { - result2.push(quote ? subString.replace(reEscapeChar2, "$1") : number5 || match); - }); - return result2; - }); - _stringToPath_default2 = stringToPath2; -}); - -// ../node_modules/lodash-es/toString.js -function toString6(value) { - return value == null ? "" : _baseToString_default2(value); -} -var toString_default2; -var init_toString2 = __esm(() => { - init__baseToString2(); - toString_default2 = toString6; -}); - -// ../node_modules/lodash-es/_castPath.js -function castPath2(value, object4) { - if (isArray_default2(value)) { - return value; - } - return _isKey_default2(value, object4) ? [value] : _stringToPath_default2(toString_default2(value)); -} -var _castPath_default2; -var init__castPath2 = __esm(() => { - init_isArray2(); - init__isKey2(); - init__stringToPath2(); - init_toString2(); - _castPath_default2 = castPath2; -}); - -// ../node_modules/lodash-es/_toKey.js -function toKey2(value) { - if (typeof value == "string" || isSymbol_default2(value)) { - return value; - } - var result2 = value + ""; - return result2 == "0" && 1 / value == -INFINITY9 ? "-0" : result2; -} -var INFINITY9, _toKey_default2; -var init__toKey2 = __esm(() => { - init_isSymbol2(); - INFINITY9 = 1 / 0; - _toKey_default2 = toKey2; -}); - -// ../node_modules/lodash-es/_baseGet.js -function baseGet2(object4, path13) { - path13 = _castPath_default2(path13, object4); - var index = 0, length = path13.length; - while (object4 != null && index < length) { - object4 = object4[_toKey_default2(path13[index++])]; - } - return index && index == length ? object4 : undefined; -} -var _baseGet_default2; -var init__baseGet2 = __esm(() => { - init__castPath2(); - init__toKey2(); - _baseGet_default2 = baseGet2; -}); - -// ../node_modules/lodash-es/get.js -function get2(object4, path13, defaultValue) { - var result2 = object4 == null ? undefined : _baseGet_default2(object4, path13); - return result2 === undefined ? defaultValue : result2; -} -var get_default2; -var init_get2 = __esm(() => { - init__baseGet2(); - get_default2 = get2; -}); - -// ../node_modules/lodash-es/_baseAt.js -function baseAt2(object4, paths2) { - var index = -1, length = paths2.length, result2 = Array(length), skip = object4 == null; - while (++index < length) { - result2[index] = skip ? undefined : get_default2(object4, paths2[index]); - } - return result2; -} -var _baseAt_default2; -var init__baseAt2 = __esm(() => { - init_get2(); - _baseAt_default2 = baseAt2; -}); - -// ../node_modules/lodash-es/_arrayPush.js -function arrayPush2(array3, values3) { - var index = -1, length = values3.length, offset = array3.length; - while (++index < length) { - array3[offset + index] = values3[index]; - } - return array3; -} -var _arrayPush_default2; -var init__arrayPush2 = __esm(() => { - _arrayPush_default2 = arrayPush2; -}); - -// ../node_modules/lodash-es/_isFlattenable.js -function isFlattenable2(value) { - return isArray_default2(value) || isArguments_default2(value) || !!(spreadableSymbol2 && value && value[spreadableSymbol2]); -} -var spreadableSymbol2, _isFlattenable_default2; -var init__isFlattenable2 = __esm(() => { - init__Symbol2(); - init_isArguments2(); - init_isArray2(); - spreadableSymbol2 = _Symbol_default2 ? _Symbol_default2.isConcatSpreadable : undefined; - _isFlattenable_default2 = isFlattenable2; -}); - -// ../node_modules/lodash-es/_baseFlatten.js -function baseFlatten2(array3, depth, predicate, isStrict, result2) { - var index = -1, length = array3.length; - predicate || (predicate = _isFlattenable_default2); - result2 || (result2 = []); - while (++index < length) { - var value = array3[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - baseFlatten2(value, depth - 1, predicate, isStrict, result2); - } else { - _arrayPush_default2(result2, value); - } - } else if (!isStrict) { - result2[result2.length] = value; - } - } - return result2; -} -var _baseFlatten_default2; -var init__baseFlatten2 = __esm(() => { - init__arrayPush2(); - init__isFlattenable2(); - _baseFlatten_default2 = baseFlatten2; -}); - -// ../node_modules/lodash-es/flatten.js -function flatten2(array3) { - var length = array3 == null ? 0 : array3.length; - return length ? _baseFlatten_default2(array3, 1) : []; -} -var flatten_default2; -var init_flatten2 = __esm(() => { - init__baseFlatten2(); - flatten_default2 = flatten2; -}); - -// ../node_modules/lodash-es/_flatRest.js -function flatRest2(func) { - return _setToString_default2(_overRest_default2(func, undefined, flatten_default2), func + ""); -} -var _flatRest_default2; -var init__flatRest2 = __esm(() => { - init_flatten2(); - init__overRest2(); - init__setToString2(); - _flatRest_default2 = flatRest2; -}); - -// ../node_modules/lodash-es/at.js -var at2, at_default2; -var init_at2 = __esm(() => { - init__baseAt2(); - init__flatRest2(); - at2 = _flatRest_default2(_baseAt_default2); - at_default2 = at2; -}); - -// ../node_modules/lodash-es/_getPrototype.js -var getPrototype2, _getPrototype_default2; -var init__getPrototype2 = __esm(() => { - init__overArg2(); - getPrototype2 = _overArg_default2(Object.getPrototypeOf, Object); - _getPrototype_default2 = getPrototype2; -}); - -// ../node_modules/lodash-es/isPlainObject.js -function isPlainObject6(value) { - if (!isObjectLike_default2(value) || _baseGetTag_default2(value) != objectTag7) { - return false; - } - var proto2 = _getPrototype_default2(value); - if (proto2 === null) { - return true; - } - var Ctor = hasOwnProperty40.call(proto2, "constructor") && proto2.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString6.call(Ctor) == objectCtorString2; -} -var objectTag7 = "[object Object]", funcProto6, objectProto45, funcToString6, hasOwnProperty40, objectCtorString2, isPlainObject_default2; -var init_isPlainObject2 = __esm(() => { - init__baseGetTag2(); - init__getPrototype2(); - init_isObjectLike2(); - funcProto6 = Function.prototype; - objectProto45 = Object.prototype; - funcToString6 = funcProto6.toString; - hasOwnProperty40 = objectProto45.hasOwnProperty; - objectCtorString2 = funcToString6.call(Object); - isPlainObject_default2 = isPlainObject6; -}); - -// ../node_modules/lodash-es/isError.js -function isError2(value) { - if (!isObjectLike_default2(value)) { - return false; - } - var tag2 = _baseGetTag_default2(value); - return tag2 == errorTag6 || tag2 == domExcTag2 || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject_default2(value); -} -var domExcTag2 = "[object DOMException]", errorTag6 = "[object Error]", isError_default2; -var init_isError2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - init_isPlainObject2(); - isError_default2 = isError2; -}); - -// ../node_modules/lodash-es/attempt.js -var attempt2, attempt_default2; -var init_attempt2 = __esm(() => { - init__apply2(); - init__baseRest2(); - init_isError2(); - attempt2 = _baseRest_default2(function(func, args) { - try { - return _apply_default2(func, undefined, args); - } catch (e) { - return isError_default2(e) ? e : new Error(e); - } - }); - attempt_default2 = attempt2; -}); - -// ../node_modules/lodash-es/before.js -function before2(n2, func) { - var result2; - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT16); - } - n2 = toInteger_default2(n2); - return function() { - if (--n2 > 0) { - result2 = func.apply(this, arguments); - } - if (n2 <= 1) { - func = undefined; - } - return result2; - }; -} -var FUNC_ERROR_TEXT16 = "Expected a function", before_default2; -var init_before2 = __esm(() => { - init_toInteger2(); - before_default2 = before2; -}); - -// ../node_modules/lodash-es/bind.js -var WRAP_BIND_FLAG17 = 1, WRAP_PARTIAL_FLAG11 = 32, bind3, bind_default2; -var init_bind3 = __esm(() => { - init__baseRest2(); - init__createWrap2(); - init__getHolder2(); - init__replaceHolders2(); - bind3 = _baseRest_default2(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG17; - if (partials.length) { - var holders = _replaceHolders_default2(partials, _getHolder_default2(bind3)); - bitmask |= WRAP_PARTIAL_FLAG11; - } - return _createWrap_default2(func, bitmask, thisArg, partials, holders); - }); - bind3.placeholder = {}; - bind_default2 = bind3; -}); - -// ../node_modules/lodash-es/bindAll.js -var bindAll2, bindAll_default2; -var init_bindAll2 = __esm(() => { - init__arrayEach2(); - init__baseAssignValue2(); - init_bind3(); - init__flatRest2(); - init__toKey2(); - bindAll2 = _flatRest_default2(function(object4, methodNames) { - _arrayEach_default2(methodNames, function(key) { - key = _toKey_default2(key); - _baseAssignValue_default2(object4, key, bind_default2(object4[key], object4)); - }); - return object4; - }); - bindAll_default2 = bindAll2; -}); - -// ../node_modules/lodash-es/bindKey.js -var WRAP_BIND_FLAG18 = 1, WRAP_BIND_KEY_FLAG13 = 2, WRAP_PARTIAL_FLAG12 = 32, bindKey2, bindKey_default2; -var init_bindKey2 = __esm(() => { - init__baseRest2(); - init__createWrap2(); - init__getHolder2(); - init__replaceHolders2(); - bindKey2 = _baseRest_default2(function(object4, key, partials) { - var bitmask = WRAP_BIND_FLAG18 | WRAP_BIND_KEY_FLAG13; - if (partials.length) { - var holders = _replaceHolders_default2(partials, _getHolder_default2(bindKey2)); - bitmask |= WRAP_PARTIAL_FLAG12; - } - return _createWrap_default2(key, bitmask, object4, partials, holders); - }); - bindKey2.placeholder = {}; - bindKey_default2 = bindKey2; -}); - -// ../node_modules/lodash-es/_baseSlice.js -function baseSlice2(array3, start, end) { - var index = -1, length = array3.length; - if (start < 0) { - start = -start > length ? 0 : length + start; - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : end - start >>> 0; - start >>>= 0; - var result2 = Array(length); - while (++index < length) { - result2[index] = array3[index + start]; - } - return result2; -} -var _baseSlice_default2; -var init__baseSlice2 = __esm(() => { - _baseSlice_default2 = baseSlice2; -}); - -// ../node_modules/lodash-es/_castSlice.js -function castSlice2(array3, start, end) { - var length = array3.length; - end = end === undefined ? length : end; - return !start && end >= length ? array3 : _baseSlice_default2(array3, start, end); -} -var _castSlice_default2; -var init__castSlice2 = __esm(() => { - init__baseSlice2(); - _castSlice_default2 = castSlice2; -}); - -// ../node_modules/lodash-es/_hasUnicode.js -function hasUnicode2(string5) { - return reHasUnicode2.test(string5); -} -var rsAstralRange5 = "\\ud800-\\udfff", rsComboMarksRange6 = "\\u0300-\\u036f", reComboHalfMarksRange6 = "\\ufe20-\\ufe2f", rsComboSymbolsRange6 = "\\u20d0-\\u20ff", rsComboRange6, rsVarRange5 = "\\ufe0e\\ufe0f", rsZWJ5 = "\\u200d", reHasUnicode2, _hasUnicode_default2; -var init__hasUnicode2 = __esm(() => { - rsComboRange6 = rsComboMarksRange6 + reComboHalfMarksRange6 + rsComboSymbolsRange6; - reHasUnicode2 = RegExp("[" + rsZWJ5 + rsAstralRange5 + rsComboRange6 + rsVarRange5 + "]"); - _hasUnicode_default2 = hasUnicode2; -}); - -// ../node_modules/lodash-es/_asciiToArray.js -function asciiToArray2(string5) { - return string5.split(""); -} -var _asciiToArray_default2; -var init__asciiToArray2 = __esm(() => { - _asciiToArray_default2 = asciiToArray2; -}); - -// ../node_modules/lodash-es/_unicodeToArray.js -function unicodeToArray2(string5) { - return string5.match(reUnicode3) || []; -} -var rsAstralRange6 = "\\ud800-\\udfff", rsComboMarksRange7 = "\\u0300-\\u036f", reComboHalfMarksRange7 = "\\ufe20-\\ufe2f", rsComboSymbolsRange7 = "\\u20d0-\\u20ff", rsComboRange7, rsVarRange6 = "\\ufe0e\\ufe0f", rsAstral3, rsCombo5, rsFitz4 = "\\ud83c[\\udffb-\\udfff]", rsModifier4, rsNonAstral4, rsRegional4 = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair4 = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ6 = "\\u200d", reOptMod4, rsOptVar4, rsOptJoin4, rsSeq4, rsSymbol3, reUnicode3, _unicodeToArray_default2; -var init__unicodeToArray2 = __esm(() => { - rsComboRange7 = rsComboMarksRange7 + reComboHalfMarksRange7 + rsComboSymbolsRange7; - rsAstral3 = "[" + rsAstralRange6 + "]"; - rsCombo5 = "[" + rsComboRange7 + "]"; - rsModifier4 = "(?:" + rsCombo5 + "|" + rsFitz4 + ")"; - rsNonAstral4 = "[^" + rsAstralRange6 + "]"; - reOptMod4 = rsModifier4 + "?"; - rsOptVar4 = "[" + rsVarRange6 + "]?"; - rsOptJoin4 = "(?:" + rsZWJ6 + "(?:" + [rsNonAstral4, rsRegional4, rsSurrPair4].join("|") + ")" + rsOptVar4 + reOptMod4 + ")*"; - rsSeq4 = rsOptVar4 + reOptMod4 + rsOptJoin4; - rsSymbol3 = "(?:" + [rsNonAstral4 + rsCombo5 + "?", rsCombo5, rsRegional4, rsSurrPair4, rsAstral3].join("|") + ")"; - reUnicode3 = RegExp(rsFitz4 + "(?=" + rsFitz4 + ")|" + rsSymbol3 + rsSeq4, "g"); - _unicodeToArray_default2 = unicodeToArray2; -}); - -// ../node_modules/lodash-es/_stringToArray.js -function stringToArray2(string5) { - return _hasUnicode_default2(string5) ? _unicodeToArray_default2(string5) : _asciiToArray_default2(string5); -} -var _stringToArray_default2; -var init__stringToArray2 = __esm(() => { - init__asciiToArray2(); - init__hasUnicode2(); - init__unicodeToArray2(); - _stringToArray_default2 = stringToArray2; -}); - -// ../node_modules/lodash-es/_createCaseFirst.js -function createCaseFirst2(methodName) { - return function(string5) { - string5 = toString_default2(string5); - var strSymbols = _hasUnicode_default2(string5) ? _stringToArray_default2(string5) : undefined; - var chr = strSymbols ? strSymbols[0] : string5.charAt(0); - var trailing = strSymbols ? _castSlice_default2(strSymbols, 1).join("") : string5.slice(1); - return chr[methodName]() + trailing; - }; -} -var _createCaseFirst_default2; -var init__createCaseFirst2 = __esm(() => { - init__castSlice2(); - init__hasUnicode2(); - init__stringToArray2(); - init_toString2(); - _createCaseFirst_default2 = createCaseFirst2; -}); - -// ../node_modules/lodash-es/upperFirst.js -var upperFirst2, upperFirst_default2; -var init_upperFirst2 = __esm(() => { - init__createCaseFirst2(); - upperFirst2 = _createCaseFirst_default2("toUpperCase"); - upperFirst_default2 = upperFirst2; -}); - -// ../node_modules/lodash-es/capitalize.js -function capitalize3(string5) { - return upperFirst_default2(toString_default2(string5).toLowerCase()); -} -var capitalize_default2; -var init_capitalize2 = __esm(() => { - init_toString2(); - init_upperFirst2(); - capitalize_default2 = capitalize3; -}); - -// ../node_modules/lodash-es/_arrayReduce.js -function arrayReduce2(array3, iteratee2, accumulator, initAccum) { - var index = -1, length = array3 == null ? 0 : array3.length; - if (initAccum && length) { - accumulator = array3[++index]; - } - while (++index < length) { - accumulator = iteratee2(accumulator, array3[index], index, array3); - } - return accumulator; -} -var _arrayReduce_default2; -var init__arrayReduce2 = __esm(() => { - _arrayReduce_default2 = arrayReduce2; -}); - -// ../node_modules/lodash-es/_basePropertyOf.js -function basePropertyOf2(object4) { - return function(key) { - return object4 == null ? undefined : object4[key]; - }; -} -var _basePropertyOf_default2; -var init__basePropertyOf2 = __esm(() => { - _basePropertyOf_default2 = basePropertyOf2; -}); - -// ../node_modules/lodash-es/_deburrLetter.js -var deburredLetters2, deburrLetter2, _deburrLetter_default2; -var init__deburrLetter2 = __esm(() => { - init__basePropertyOf2(); - deburredLetters2 = { - "À": "A", - "Á": "A", - "Â": "A", - "Ã": "A", - "Ä": "A", - "Å": "A", - "à": "a", - "á": "a", - "â": "a", - "ã": "a", - "ä": "a", - "å": "a", - "Ç": "C", - "ç": "c", - "Ð": "D", - "ð": "d", - "È": "E", - "É": "E", - "Ê": "E", - "Ë": "E", - "è": "e", - "é": "e", - "ê": "e", - "ë": "e", - "Ì": "I", - "Í": "I", - "Î": "I", - "Ï": "I", - "ì": "i", - "í": "i", - "î": "i", - "ï": "i", - "Ñ": "N", - "ñ": "n", - "Ò": "O", - "Ó": "O", - "Ô": "O", - "Õ": "O", - "Ö": "O", - "Ø": "O", - "ò": "o", - "ó": "o", - "ô": "o", - "õ": "o", - "ö": "o", - "ø": "o", - "Ù": "U", - "Ú": "U", - "Û": "U", - "Ü": "U", - "ù": "u", - "ú": "u", - "û": "u", - "ü": "u", - "Ý": "Y", - "ý": "y", - "ÿ": "y", - "Æ": "Ae", - "æ": "ae", - "Þ": "Th", - "þ": "th", - "ß": "ss", - "Ā": "A", - "Ă": "A", - "Ą": "A", - "ā": "a", - "ă": "a", - "ą": "a", - "Ć": "C", - "Ĉ": "C", - "Ċ": "C", - "Č": "C", - "ć": "c", - "ĉ": "c", - "ċ": "c", - "č": "c", - "Ď": "D", - "Đ": "D", - "ď": "d", - "đ": "d", - "Ē": "E", - "Ĕ": "E", - "Ė": "E", - "Ę": "E", - "Ě": "E", - "ē": "e", - "ĕ": "e", - "ė": "e", - "ę": "e", - "ě": "e", - "Ĝ": "G", - "Ğ": "G", - "Ġ": "G", - "Ģ": "G", - "ĝ": "g", - "ğ": "g", - "ġ": "g", - "ģ": "g", - "Ĥ": "H", - "Ħ": "H", - "ĥ": "h", - "ħ": "h", - "Ĩ": "I", - "Ī": "I", - "Ĭ": "I", - "Į": "I", - "İ": "I", - "ĩ": "i", - "ī": "i", - "ĭ": "i", - "į": "i", - "ı": "i", - "Ĵ": "J", - "ĵ": "j", - "Ķ": "K", - "ķ": "k", - "ĸ": "k", - "Ĺ": "L", - "Ļ": "L", - "Ľ": "L", - "Ŀ": "L", - "Ł": "L", - "ĺ": "l", - "ļ": "l", - "ľ": "l", - "ŀ": "l", - "ł": "l", - "Ń": "N", - "Ņ": "N", - "Ň": "N", - "Ŋ": "N", - "ń": "n", - "ņ": "n", - "ň": "n", - "ŋ": "n", - "Ō": "O", - "Ŏ": "O", - "Ő": "O", - "ō": "o", - "ŏ": "o", - "ő": "o", - "Ŕ": "R", - "Ŗ": "R", - "Ř": "R", - "ŕ": "r", - "ŗ": "r", - "ř": "r", - "Ś": "S", - "Ŝ": "S", - "Ş": "S", - "Š": "S", - "ś": "s", - "ŝ": "s", - "ş": "s", - "š": "s", - "Ţ": "T", - "Ť": "T", - "Ŧ": "T", - "ţ": "t", - "ť": "t", - "ŧ": "t", - "Ũ": "U", - "Ū": "U", - "Ŭ": "U", - "Ů": "U", - "Ű": "U", - "Ų": "U", - "ũ": "u", - "ū": "u", - "ŭ": "u", - "ů": "u", - "ű": "u", - "ų": "u", - "Ŵ": "W", - "ŵ": "w", - "Ŷ": "Y", - "ŷ": "y", - "Ÿ": "Y", - "Ź": "Z", - "Ż": "Z", - "Ž": "Z", - "ź": "z", - "ż": "z", - "ž": "z", - "IJ": "IJ", - "ij": "ij", - "Œ": "Oe", - "œ": "oe", - "ʼn": "'n", - "ſ": "s" - }; - deburrLetter2 = _basePropertyOf_default2(deburredLetters2); - _deburrLetter_default2 = deburrLetter2; -}); - -// ../node_modules/lodash-es/deburr.js -function deburr2(string5) { - string5 = toString_default2(string5); - return string5 && string5.replace(reLatin2, _deburrLetter_default2).replace(reComboMark2, ""); -} -var reLatin2, rsComboMarksRange8 = "\\u0300-\\u036f", reComboHalfMarksRange8 = "\\ufe20-\\ufe2f", rsComboSymbolsRange8 = "\\u20d0-\\u20ff", rsComboRange8, rsCombo6, reComboMark2, deburr_default2; -var init_deburr2 = __esm(() => { - init__deburrLetter2(); - init_toString2(); - reLatin2 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - rsComboRange8 = rsComboMarksRange8 + reComboHalfMarksRange8 + rsComboSymbolsRange8; - rsCombo6 = "[" + rsComboRange8 + "]"; - reComboMark2 = RegExp(rsCombo6, "g"); - deburr_default2 = deburr2; -}); - -// ../node_modules/lodash-es/_asciiWords.js -function asciiWords2(string5) { - return string5.match(reAsciiWord2) || []; -} -var reAsciiWord2, _asciiWords_default2; -var init__asciiWords2 = __esm(() => { - reAsciiWord2 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - _asciiWords_default2 = asciiWords2; -}); - -// ../node_modules/lodash-es/_hasUnicodeWord.js -function hasUnicodeWord2(string5) { - return reHasUnicodeWord2.test(string5); -} -var reHasUnicodeWord2, _hasUnicodeWord_default2; -var init__hasUnicodeWord2 = __esm(() => { - reHasUnicodeWord2 = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - _hasUnicodeWord_default2 = hasUnicodeWord2; -}); - -// ../node_modules/lodash-es/_unicodeWords.js -function unicodeWords2(string5) { - return string5.match(reUnicodeWord2) || []; -} -var rsAstralRange7 = "\\ud800-\\udfff", rsComboMarksRange9 = "\\u0300-\\u036f", reComboHalfMarksRange9 = "\\ufe20-\\ufe2f", rsComboSymbolsRange9 = "\\u20d0-\\u20ff", rsComboRange9, rsDingbatRange2 = "\\u2700-\\u27bf", rsLowerRange2 = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange2 = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange2 = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange2 = "\\u2000-\\u206f", rsSpaceRange2 = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange2 = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange7 = "\\ufe0e\\ufe0f", rsBreakRange2, rsApos3 = "['’]", rsBreak2, rsCombo7, rsDigits2 = "\\d+", rsDingbat2, rsLower2, rsMisc2, rsFitz5 = "\\ud83c[\\udffb-\\udfff]", rsModifier5, rsNonAstral5, rsRegional5 = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair5 = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper2, rsZWJ7 = "\\u200d", rsMiscLower2, rsMiscUpper2, rsOptContrLower2, rsOptContrUpper2, reOptMod5, rsOptVar5, rsOptJoin5, rsOrdLower2 = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper2 = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq5, rsEmoji2, reUnicodeWord2, _unicodeWords_default2; -var init__unicodeWords2 = __esm(() => { - rsComboRange9 = rsComboMarksRange9 + reComboHalfMarksRange9 + rsComboSymbolsRange9; - rsBreakRange2 = rsMathOpRange2 + rsNonCharRange2 + rsPunctuationRange2 + rsSpaceRange2; - rsBreak2 = "[" + rsBreakRange2 + "]"; - rsCombo7 = "[" + rsComboRange9 + "]"; - rsDingbat2 = "[" + rsDingbatRange2 + "]"; - rsLower2 = "[" + rsLowerRange2 + "]"; - rsMisc2 = "[^" + rsAstralRange7 + rsBreakRange2 + rsDigits2 + rsDingbatRange2 + rsLowerRange2 + rsUpperRange2 + "]"; - rsModifier5 = "(?:" + rsCombo7 + "|" + rsFitz5 + ")"; - rsNonAstral5 = "[^" + rsAstralRange7 + "]"; - rsUpper2 = "[" + rsUpperRange2 + "]"; - rsMiscLower2 = "(?:" + rsLower2 + "|" + rsMisc2 + ")"; - rsMiscUpper2 = "(?:" + rsUpper2 + "|" + rsMisc2 + ")"; - rsOptContrLower2 = "(?:" + rsApos3 + "(?:d|ll|m|re|s|t|ve))?"; - rsOptContrUpper2 = "(?:" + rsApos3 + "(?:D|LL|M|RE|S|T|VE))?"; - reOptMod5 = rsModifier5 + "?"; - rsOptVar5 = "[" + rsVarRange7 + "]?"; - rsOptJoin5 = "(?:" + rsZWJ7 + "(?:" + [rsNonAstral5, rsRegional5, rsSurrPair5].join("|") + ")" + rsOptVar5 + reOptMod5 + ")*"; - rsSeq5 = rsOptVar5 + reOptMod5 + rsOptJoin5; - rsEmoji2 = "(?:" + [rsDingbat2, rsRegional5, rsSurrPair5].join("|") + ")" + rsSeq5; - reUnicodeWord2 = RegExp([ - rsUpper2 + "?" + rsLower2 + "+" + rsOptContrLower2 + "(?=" + [rsBreak2, rsUpper2, "$"].join("|") + ")", - rsMiscUpper2 + "+" + rsOptContrUpper2 + "(?=" + [rsBreak2, rsUpper2 + rsMiscLower2, "$"].join("|") + ")", - rsUpper2 + "?" + rsMiscLower2 + "+" + rsOptContrLower2, - rsUpper2 + "+" + rsOptContrUpper2, - rsOrdUpper2, - rsOrdLower2, - rsDigits2, - rsEmoji2 - ].join("|"), "g"); - _unicodeWords_default2 = unicodeWords2; -}); - -// ../node_modules/lodash-es/words.js -function words2(string5, pattern, guard) { - string5 = toString_default2(string5); - pattern = guard ? undefined : pattern; - if (pattern === undefined) { - return _hasUnicodeWord_default2(string5) ? _unicodeWords_default2(string5) : _asciiWords_default2(string5); - } - return string5.match(pattern) || []; -} -var words_default2; -var init_words2 = __esm(() => { - init__asciiWords2(); - init__hasUnicodeWord2(); - init_toString2(); - init__unicodeWords2(); - words_default2 = words2; -}); - -// ../node_modules/lodash-es/_createCompounder.js -function createCompounder2(callback) { - return function(string5) { - return _arrayReduce_default2(words_default2(deburr_default2(string5).replace(reApos2, "")), callback, ""); - }; -} -var rsApos4 = "['’]", reApos2, _createCompounder_default2; -var init__createCompounder2 = __esm(() => { - init__arrayReduce2(); - init_deburr2(); - init_words2(); - reApos2 = RegExp(rsApos4, "g"); - _createCompounder_default2 = createCompounder2; -}); - -// ../node_modules/lodash-es/camelCase.js -var camelCase2, camelCase_default2; -var init_camelCase2 = __esm(() => { - init_capitalize2(); - init__createCompounder2(); - camelCase2 = _createCompounder_default2(function(result2, word, index) { - word = word.toLowerCase(); - return result2 + (index ? capitalize_default2(word) : word); - }); - camelCase_default2 = camelCase2; -}); - -// ../node_modules/lodash-es/castArray.js -function castArray2() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray_default2(value) ? value : [value]; -} -var castArray_default2; -var init_castArray2 = __esm(() => { - init_isArray2(); - castArray_default2 = castArray2; -}); - -// ../node_modules/lodash-es/_createRound.js -function createRound2(methodName) { - var func = Math[methodName]; - return function(number5, precision) { - number5 = toNumber_default2(number5); - precision = precision == null ? 0 : nativeMin18(toInteger_default2(precision), 292); - if (precision && nativeIsFinite3(number5)) { - var pair = (toString_default2(number5) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision)); - pair = (toString_default2(value) + "e").split("e"); - return +(pair[0] + "e" + (+pair[1] - precision)); - } - return func(number5); - }; -} -var nativeIsFinite3, nativeMin18, _createRound_default2; -var init__createRound2 = __esm(() => { - init__root2(); - init_toInteger2(); - init_toNumber2(); - init_toString2(); - nativeIsFinite3 = _root_default2.isFinite; - nativeMin18 = Math.min; - _createRound_default2 = createRound2; -}); - -// ../node_modules/lodash-es/ceil.js -var ceil2, ceil_default2; -var init_ceil2 = __esm(() => { - init__createRound2(); - ceil2 = _createRound_default2("ceil"); - ceil_default2 = ceil2; -}); - -// ../node_modules/lodash-es/chain.js -function chain2(value) { - var result2 = wrapperLodash_default2(value); - result2.__chain__ = true; - return result2; -} -var chain_default2; -var init_chain2 = __esm(() => { - init_wrapperLodash2(); - chain_default2 = chain2; -}); - -// ../node_modules/lodash-es/chunk.js -function chunk2(array3, size2, guard) { - if (guard ? _isIterateeCall_default2(array3, size2, guard) : size2 === undefined) { - size2 = 1; - } else { - size2 = nativeMax22(toInteger_default2(size2), 0); - } - var length = array3 == null ? 0 : array3.length; - if (!length || size2 < 1) { - return []; - } - var index = 0, resIndex = 0, result2 = Array(nativeCeil5(length / size2)); - while (index < length) { - result2[resIndex++] = _baseSlice_default2(array3, index, index += size2); - } - return result2; -} -var nativeCeil5, nativeMax22, chunk_default2; -var init_chunk2 = __esm(() => { - init__baseSlice2(); - init__isIterateeCall2(); - init_toInteger2(); - nativeCeil5 = Math.ceil; - nativeMax22 = Math.max; - chunk_default2 = chunk2; -}); - -// ../node_modules/lodash-es/_baseClamp.js -function baseClamp2(number5, lower, upper) { - if (number5 === number5) { - if (upper !== undefined) { - number5 = number5 <= upper ? number5 : upper; - } - if (lower !== undefined) { - number5 = number5 >= lower ? number5 : lower; - } - } - return number5; -} -var _baseClamp_default2; -var init__baseClamp2 = __esm(() => { - _baseClamp_default2 = baseClamp2; -}); - -// ../node_modules/lodash-es/clamp.js -function clamp3(number5, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber_default2(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber_default2(lower); - lower = lower === lower ? lower : 0; - } - return _baseClamp_default2(toNumber_default2(number5), lower, upper); -} -var clamp_default2; -var init_clamp2 = __esm(() => { - init__baseClamp2(); - init_toNumber2(); - clamp_default2 = clamp3; -}); - -// ../node_modules/lodash-es/_stackClear.js -function stackClear2() { - this.__data__ = new _ListCache_default2; - this.size = 0; -} -var _stackClear_default2; -var init__stackClear2 = __esm(() => { - init__ListCache2(); - _stackClear_default2 = stackClear2; -}); - -// ../node_modules/lodash-es/_stackDelete.js -function stackDelete2(key) { - var data = this.__data__, result2 = data["delete"](key); - this.size = data.size; - return result2; -} -var _stackDelete_default2; -var init__stackDelete2 = __esm(() => { - _stackDelete_default2 = stackDelete2; -}); - -// ../node_modules/lodash-es/_stackGet.js -function stackGet2(key) { - return this.__data__.get(key); -} -var _stackGet_default2; -var init__stackGet2 = __esm(() => { - _stackGet_default2 = stackGet2; -}); - -// ../node_modules/lodash-es/_stackHas.js -function stackHas2(key) { - return this.__data__.has(key); -} -var _stackHas_default2; -var init__stackHas2 = __esm(() => { - _stackHas_default2 = stackHas2; -}); - -// ../node_modules/lodash-es/_stackSet.js -function stackSet2(key, value) { - var data = this.__data__; - if (data instanceof _ListCache_default2) { - var pairs = data.__data__; - if (!_Map_default2 || pairs.length < LARGE_ARRAY_SIZE4 - 1) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new _MapCache_default2(pairs); - } - data.set(key, value); - this.size = data.size; - return this; -} -var LARGE_ARRAY_SIZE4 = 200, _stackSet_default2; -var init__stackSet2 = __esm(() => { - init__ListCache2(); - init__Map2(); - init__MapCache2(); - _stackSet_default2 = stackSet2; -}); - -// ../node_modules/lodash-es/_Stack.js -function Stack2(entries) { - var data = this.__data__ = new _ListCache_default2(entries); - this.size = data.size; -} -var _Stack_default2; -var init__Stack2 = __esm(() => { - init__ListCache2(); - init__stackClear2(); - init__stackDelete2(); - init__stackGet2(); - init__stackHas2(); - init__stackSet2(); - Stack2.prototype.clear = _stackClear_default2; - Stack2.prototype["delete"] = _stackDelete_default2; - Stack2.prototype.get = _stackGet_default2; - Stack2.prototype.has = _stackHas_default2; - Stack2.prototype.set = _stackSet_default2; - _Stack_default2 = Stack2; -}); - -// ../node_modules/lodash-es/_baseAssign.js -function baseAssign2(object4, source) { - return object4 && _copyObject_default2(source, keys_default2(source), object4); -} -var _baseAssign_default2; -var init__baseAssign2 = __esm(() => { - init__copyObject2(); - init_keys3(); - _baseAssign_default2 = baseAssign2; -}); - -// ../node_modules/lodash-es/_baseAssignIn.js -function baseAssignIn2(object4, source) { - return object4 && _copyObject_default2(source, keysIn_default2(source), object4); -} -var _baseAssignIn_default2; -var init__baseAssignIn2 = __esm(() => { - init__copyObject2(); - init_keysIn2(); - _baseAssignIn_default2 = baseAssignIn2; -}); - -// ../node_modules/lodash-es/_cloneBuffer.js -var exports__cloneBuffer2 = {}; -__export(exports__cloneBuffer2, { - default: () => _cloneBuffer_default2 -}); -function cloneBuffer2(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, result2 = allocUnsafe2 ? allocUnsafe2(length) : new buffer.constructor(length); - buffer.copy(result2); - return result2; -} -var freeExports6, freeModule6, moduleExports6, Buffer10, allocUnsafe2, _cloneBuffer_default2; -var init__cloneBuffer2 = __esm(() => { - init__root2(); - freeExports6 = typeof exports__cloneBuffer2 == "object" && exports__cloneBuffer2 && !exports__cloneBuffer2.nodeType && exports__cloneBuffer2; - freeModule6 = freeExports6 && typeof module__cloneBuffer == "object" && module__cloneBuffer && !module__cloneBuffer.nodeType && module__cloneBuffer; - moduleExports6 = freeModule6 && freeModule6.exports === freeExports6; - Buffer10 = moduleExports6 ? _root_default2.Buffer : undefined; - allocUnsafe2 = Buffer10 ? Buffer10.allocUnsafe : undefined; - _cloneBuffer_default2 = cloneBuffer2; -}); - -// ../node_modules/lodash-es/_arrayFilter.js -function arrayFilter2(array3, predicate) { - var index = -1, length = array3 == null ? 0 : array3.length, resIndex = 0, result2 = []; - while (++index < length) { - var value = array3[index]; - if (predicate(value, index, array3)) { - result2[resIndex++] = value; - } - } - return result2; -} -var _arrayFilter_default2; -var init__arrayFilter2 = __esm(() => { - _arrayFilter_default2 = arrayFilter2; -}); - -// ../node_modules/lodash-es/stubArray.js -function stubArray2() { - return []; -} -var stubArray_default2; -var init_stubArray2 = __esm(() => { - stubArray_default2 = stubArray2; -}); - -// ../node_modules/lodash-es/_getSymbols.js -var objectProto46, propertyIsEnumerable4, nativeGetSymbols3, getSymbols2, _getSymbols_default2; -var init__getSymbols2 = __esm(() => { - init__arrayFilter2(); - init_stubArray2(); - objectProto46 = Object.prototype; - propertyIsEnumerable4 = objectProto46.propertyIsEnumerable; - nativeGetSymbols3 = Object.getOwnPropertySymbols; - getSymbols2 = !nativeGetSymbols3 ? stubArray_default2 : function(object4) { - if (object4 == null) { - return []; - } - object4 = Object(object4); - return _arrayFilter_default2(nativeGetSymbols3(object4), function(symbol2) { - return propertyIsEnumerable4.call(object4, symbol2); - }); - }; - _getSymbols_default2 = getSymbols2; -}); - -// ../node_modules/lodash-es/_copySymbols.js -function copySymbols2(source, object4) { - return _copyObject_default2(source, _getSymbols_default2(source), object4); -} -var _copySymbols_default2; -var init__copySymbols2 = __esm(() => { - init__copyObject2(); - init__getSymbols2(); - _copySymbols_default2 = copySymbols2; -}); - -// ../node_modules/lodash-es/_getSymbolsIn.js -var nativeGetSymbols4, getSymbolsIn2, _getSymbolsIn_default2; -var init__getSymbolsIn2 = __esm(() => { - init__arrayPush2(); - init__getPrototype2(); - init__getSymbols2(); - init_stubArray2(); - nativeGetSymbols4 = Object.getOwnPropertySymbols; - getSymbolsIn2 = !nativeGetSymbols4 ? stubArray_default2 : function(object4) { - var result2 = []; - while (object4) { - _arrayPush_default2(result2, _getSymbols_default2(object4)); - object4 = _getPrototype_default2(object4); - } - return result2; - }; - _getSymbolsIn_default2 = getSymbolsIn2; -}); - -// ../node_modules/lodash-es/_copySymbolsIn.js -function copySymbolsIn2(source, object4) { - return _copyObject_default2(source, _getSymbolsIn_default2(source), object4); -} -var _copySymbolsIn_default2; -var init__copySymbolsIn2 = __esm(() => { - init__copyObject2(); - init__getSymbolsIn2(); - _copySymbolsIn_default2 = copySymbolsIn2; -}); - -// ../node_modules/lodash-es/_baseGetAllKeys.js -function baseGetAllKeys2(object4, keysFunc, symbolsFunc) { - var result2 = keysFunc(object4); - return isArray_default2(object4) ? result2 : _arrayPush_default2(result2, symbolsFunc(object4)); -} -var _baseGetAllKeys_default2; -var init__baseGetAllKeys2 = __esm(() => { - init__arrayPush2(); - init_isArray2(); - _baseGetAllKeys_default2 = baseGetAllKeys2; -}); - -// ../node_modules/lodash-es/_getAllKeys.js -function getAllKeys2(object4) { - return _baseGetAllKeys_default2(object4, keys_default2, _getSymbols_default2); -} -var _getAllKeys_default2; -var init__getAllKeys2 = __esm(() => { - init__baseGetAllKeys2(); - init__getSymbols2(); - init_keys3(); - _getAllKeys_default2 = getAllKeys2; -}); - -// ../node_modules/lodash-es/_getAllKeysIn.js -function getAllKeysIn2(object4) { - return _baseGetAllKeys_default2(object4, keysIn_default2, _getSymbolsIn_default2); -} -var _getAllKeysIn_default2; -var init__getAllKeysIn2 = __esm(() => { - init__baseGetAllKeys2(); - init__getSymbolsIn2(); - init_keysIn2(); - _getAllKeysIn_default2 = getAllKeysIn2; -}); - -// ../node_modules/lodash-es/_DataView.js -var DataView3, _DataView_default2; -var init__DataView2 = __esm(() => { - init__getNative2(); - init__root2(); - DataView3 = _getNative_default2(_root_default2, "DataView"); - _DataView_default2 = DataView3; -}); - -// ../node_modules/lodash-es/_Promise.js -var Promise3, _Promise_default2; -var init__Promise2 = __esm(() => { - init__getNative2(); - init__root2(); - Promise3 = _getNative_default2(_root_default2, "Promise"); - _Promise_default2 = Promise3; -}); - -// ../node_modules/lodash-es/_Set.js -var Set3, _Set_default2; -var init__Set2 = __esm(() => { - init__getNative2(); - init__root2(); - Set3 = _getNative_default2(_root_default2, "Set"); - _Set_default2 = Set3; -}); - -// ../node_modules/lodash-es/_getTag.js -var mapTag12 = "[object Map]", objectTag8 = "[object Object]", promiseTag2 = "[object Promise]", setTag12 = "[object Set]", weakMapTag6 = "[object WeakMap]", dataViewTag7 = "[object DataView]", dataViewCtorString2, mapCtorString2, promiseCtorString2, setCtorString2, weakMapCtorString2, getTag2, _getTag_default2; -var init__getTag2 = __esm(() => { - init__DataView2(); - init__Map2(); - init__Promise2(); - init__Set2(); - init__WeakMap2(); - init__baseGetTag2(); - init__toSource2(); - dataViewCtorString2 = _toSource_default2(_DataView_default2); - mapCtorString2 = _toSource_default2(_Map_default2); - promiseCtorString2 = _toSource_default2(_Promise_default2); - setCtorString2 = _toSource_default2(_Set_default2); - weakMapCtorString2 = _toSource_default2(_WeakMap_default2); - getTag2 = _baseGetTag_default2; - if (_DataView_default2 && getTag2(new _DataView_default2(new ArrayBuffer(1))) != dataViewTag7 || _Map_default2 && getTag2(new _Map_default2) != mapTag12 || _Promise_default2 && getTag2(_Promise_default2.resolve()) != promiseTag2 || _Set_default2 && getTag2(new _Set_default2) != setTag12 || _WeakMap_default2 && getTag2(new _WeakMap_default2) != weakMapTag6) { - getTag2 = function(value) { - var result2 = _baseGetTag_default2(value), Ctor = result2 == objectTag8 ? value.constructor : undefined, ctorString = Ctor ? _toSource_default2(Ctor) : ""; - if (ctorString) { - switch (ctorString) { - case dataViewCtorString2: - return dataViewTag7; - case mapCtorString2: - return mapTag12; - case promiseCtorString2: - return promiseTag2; - case setCtorString2: - return setTag12; - case weakMapCtorString2: - return weakMapTag6; - } - } - return result2; - }; - } - _getTag_default2 = getTag2; -}); - -// ../node_modules/lodash-es/_initCloneArray.js -function initCloneArray2(array3) { - var length = array3.length, result2 = new array3.constructor(length); - if (length && typeof array3[0] == "string" && hasOwnProperty41.call(array3, "index")) { - result2.index = array3.index; - result2.input = array3.input; - } - return result2; -} -var objectProto47, hasOwnProperty41, _initCloneArray_default2; -var init__initCloneArray2 = __esm(() => { - objectProto47 = Object.prototype; - hasOwnProperty41 = objectProto47.hasOwnProperty; - _initCloneArray_default2 = initCloneArray2; -}); - -// ../node_modules/lodash-es/_Uint8Array.js -var Uint8Array3, _Uint8Array_default2; -var init__Uint8Array2 = __esm(() => { - init__root2(); - Uint8Array3 = _root_default2.Uint8Array; - _Uint8Array_default2 = Uint8Array3; -}); - -// ../node_modules/lodash-es/_cloneArrayBuffer.js -function cloneArrayBuffer2(arrayBuffer) { - var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength); - new _Uint8Array_default2(result2).set(new _Uint8Array_default2(arrayBuffer)); - return result2; -} -var _cloneArrayBuffer_default2; -var init__cloneArrayBuffer2 = __esm(() => { - init__Uint8Array2(); - _cloneArrayBuffer_default2 = cloneArrayBuffer2; -}); - -// ../node_modules/lodash-es/_cloneDataView.js -function cloneDataView2(dataView, isDeep) { - var buffer = isDeep ? _cloneArrayBuffer_default2(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} -var _cloneDataView_default2; -var init__cloneDataView2 = __esm(() => { - init__cloneArrayBuffer2(); - _cloneDataView_default2 = cloneDataView2; -}); - -// ../node_modules/lodash-es/_cloneRegExp.js -function cloneRegExp2(regexp) { - var result2 = new regexp.constructor(regexp.source, reFlags3.exec(regexp)); - result2.lastIndex = regexp.lastIndex; - return result2; -} -var reFlags3, _cloneRegExp_default2; -var init__cloneRegExp2 = __esm(() => { - reFlags3 = /\w*$/; - _cloneRegExp_default2 = cloneRegExp2; -}); - -// ../node_modules/lodash-es/_cloneSymbol.js -function cloneSymbol2(symbol2) { - return symbolValueOf3 ? Object(symbolValueOf3.call(symbol2)) : {}; -} -var symbolProto5, symbolValueOf3, _cloneSymbol_default2; -var init__cloneSymbol2 = __esm(() => { - init__Symbol2(); - symbolProto5 = _Symbol_default2 ? _Symbol_default2.prototype : undefined; - symbolValueOf3 = symbolProto5 ? symbolProto5.valueOf : undefined; - _cloneSymbol_default2 = cloneSymbol2; -}); - -// ../node_modules/lodash-es/_cloneTypedArray.js -function cloneTypedArray2(typedArray, isDeep) { - var buffer = isDeep ? _cloneArrayBuffer_default2(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} -var _cloneTypedArray_default2; -var init__cloneTypedArray2 = __esm(() => { - init__cloneArrayBuffer2(); - _cloneTypedArray_default2 = cloneTypedArray2; -}); - -// ../node_modules/lodash-es/_initCloneByTag.js -function initCloneByTag2(object4, tag2, isDeep) { - var Ctor = object4.constructor; - switch (tag2) { - case arrayBufferTag7: - return _cloneArrayBuffer_default2(object4); - case boolTag7: - case dateTag7: - return new Ctor(+object4); - case dataViewTag8: - return _cloneDataView_default2(object4, isDeep); - case float32Tag5: - case float64Tag5: - case int8Tag5: - case int16Tag5: - case int32Tag5: - case uint8Tag5: - case uint8ClampedTag5: - case uint16Tag5: - case uint32Tag5: - return _cloneTypedArray_default2(object4, isDeep); - case mapTag13: - return new Ctor; - case numberTag7: - case stringTag7: - return new Ctor(object4); - case regexpTag7: - return _cloneRegExp_default2(object4); - case setTag13: - return new Ctor; - case symbolTag6: - return _cloneSymbol_default2(object4); - } -} -var boolTag7 = "[object Boolean]", dateTag7 = "[object Date]", mapTag13 = "[object Map]", numberTag7 = "[object Number]", regexpTag7 = "[object RegExp]", setTag13 = "[object Set]", stringTag7 = "[object String]", symbolTag6 = "[object Symbol]", arrayBufferTag7 = "[object ArrayBuffer]", dataViewTag8 = "[object DataView]", float32Tag5 = "[object Float32Array]", float64Tag5 = "[object Float64Array]", int8Tag5 = "[object Int8Array]", int16Tag5 = "[object Int16Array]", int32Tag5 = "[object Int32Array]", uint8Tag5 = "[object Uint8Array]", uint8ClampedTag5 = "[object Uint8ClampedArray]", uint16Tag5 = "[object Uint16Array]", uint32Tag5 = "[object Uint32Array]", _initCloneByTag_default2; -var init__initCloneByTag2 = __esm(() => { - init__cloneArrayBuffer2(); - init__cloneDataView2(); - init__cloneRegExp2(); - init__cloneSymbol2(); - init__cloneTypedArray2(); - _initCloneByTag_default2 = initCloneByTag2; -}); - -// ../node_modules/lodash-es/_initCloneObject.js -function initCloneObject2(object4) { - return typeof object4.constructor == "function" && !_isPrototype_default2(object4) ? _baseCreate_default2(_getPrototype_default2(object4)) : {}; -} -var _initCloneObject_default2; -var init__initCloneObject2 = __esm(() => { - init__baseCreate2(); - init__getPrototype2(); - init__isPrototype2(); - _initCloneObject_default2 = initCloneObject2; -}); - -// ../node_modules/lodash-es/_baseIsMap.js -function baseIsMap2(value) { - return isObjectLike_default2(value) && _getTag_default2(value) == mapTag14; -} -var mapTag14 = "[object Map]", _baseIsMap_default2; -var init__baseIsMap2 = __esm(() => { - init__getTag2(); - init_isObjectLike2(); - _baseIsMap_default2 = baseIsMap2; -}); - -// ../node_modules/lodash-es/isMap.js -var nodeIsMap2, isMap2, isMap_default2; -var init_isMap2 = __esm(() => { - init__baseIsMap2(); - init__baseUnary2(); - init__nodeUtil2(); - nodeIsMap2 = _nodeUtil_default2 && _nodeUtil_default2.isMap; - isMap2 = nodeIsMap2 ? _baseUnary_default2(nodeIsMap2) : _baseIsMap_default2; - isMap_default2 = isMap2; -}); - -// ../node_modules/lodash-es/_baseIsSet.js -function baseIsSet2(value) { - return isObjectLike_default2(value) && _getTag_default2(value) == setTag14; -} -var setTag14 = "[object Set]", _baseIsSet_default2; -var init__baseIsSet2 = __esm(() => { - init__getTag2(); - init_isObjectLike2(); - _baseIsSet_default2 = baseIsSet2; -}); - -// ../node_modules/lodash-es/isSet.js -var nodeIsSet2, isSet6, isSet_default2; -var init_isSet2 = __esm(() => { - init__baseIsSet2(); - init__baseUnary2(); - init__nodeUtil2(); - nodeIsSet2 = _nodeUtil_default2 && _nodeUtil_default2.isSet; - isSet6 = nodeIsSet2 ? _baseUnary_default2(nodeIsSet2) : _baseIsSet_default2; - isSet_default2 = isSet6; -}); - -// ../node_modules/lodash-es/_baseClone.js -function baseClone2(value, bitmask, customizer, key, object4, stack) { - var result2, isDeep = bitmask & CLONE_DEEP_FLAG9, isFlat = bitmask & CLONE_FLAT_FLAG3, isFull = bitmask & CLONE_SYMBOLS_FLAG7; - if (customizer) { - result2 = object4 ? customizer(value, key, object4, stack) : customizer(value); - } - if (result2 !== undefined) { - return result2; - } - if (!isObject_default2(value)) { - return value; - } - var isArr = isArray_default2(value); - if (isArr) { - result2 = _initCloneArray_default2(value); - if (!isDeep) { - return _copyArray_default2(value, result2); - } - } else { - var tag2 = _getTag_default2(value), isFunc = tag2 == funcTag6 || tag2 == genTag4; - if (isBuffer_default2(value)) { - return _cloneBuffer_default2(value, isDeep); - } - if (tag2 == objectTag9 || tag2 == argsTag7 || isFunc && !object4) { - result2 = isFlat || isFunc ? {} : _initCloneObject_default2(value); - if (!isDeep) { - return isFlat ? _copySymbolsIn_default2(value, _baseAssignIn_default2(result2, value)) : _copySymbols_default2(value, _baseAssign_default2(result2, value)); - } - } else { - if (!cloneableTags2[tag2]) { - return object4 ? value : {}; - } - result2 = _initCloneByTag_default2(value, tag2, isDeep); - } - } - stack || (stack = new _Stack_default2); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result2); - if (isSet_default2(value)) { - value.forEach(function(subValue) { - result2.add(baseClone2(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap_default2(value)) { - value.forEach(function(subValue, key2) { - result2.set(key2, baseClone2(subValue, bitmask, customizer, key2, value, stack)); - }); - } - var keysFunc = isFull ? isFlat ? _getAllKeysIn_default2 : _getAllKeys_default2 : isFlat ? keysIn_default2 : keys_default2; - var props = isArr ? undefined : keysFunc(value); - _arrayEach_default2(props || value, function(subValue, key2) { - if (props) { - key2 = subValue; - subValue = value[key2]; - } - _assignValue_default2(result2, key2, baseClone2(subValue, bitmask, customizer, key2, value, stack)); - }); - return result2; -} -var CLONE_DEEP_FLAG9 = 1, CLONE_FLAT_FLAG3 = 2, CLONE_SYMBOLS_FLAG7 = 4, argsTag7 = "[object Arguments]", arrayTag5 = "[object Array]", boolTag8 = "[object Boolean]", dateTag8 = "[object Date]", errorTag7 = "[object Error]", funcTag6 = "[object Function]", genTag4 = "[object GeneratorFunction]", mapTag15 = "[object Map]", numberTag8 = "[object Number]", objectTag9 = "[object Object]", regexpTag8 = "[object RegExp]", setTag15 = "[object Set]", stringTag8 = "[object String]", symbolTag7 = "[object Symbol]", weakMapTag7 = "[object WeakMap]", arrayBufferTag8 = "[object ArrayBuffer]", dataViewTag9 = "[object DataView]", float32Tag6 = "[object Float32Array]", float64Tag6 = "[object Float64Array]", int8Tag6 = "[object Int8Array]", int16Tag6 = "[object Int16Array]", int32Tag6 = "[object Int32Array]", uint8Tag6 = "[object Uint8Array]", uint8ClampedTag6 = "[object Uint8ClampedArray]", uint16Tag6 = "[object Uint16Array]", uint32Tag6 = "[object Uint32Array]", cloneableTags2, _baseClone_default2; -var init__baseClone2 = __esm(() => { - init__Stack2(); - init__arrayEach2(); - init__assignValue2(); - init__baseAssign2(); - init__baseAssignIn2(); - init__cloneBuffer2(); - init__copyArray2(); - init__copySymbols2(); - init__copySymbolsIn2(); - init__getAllKeys2(); - init__getAllKeysIn2(); - init__getTag2(); - init__initCloneArray2(); - init__initCloneByTag2(); - init__initCloneObject2(); - init_isArray2(); - init_isBuffer2(); - init_isMap2(); - init_isObject2(); - init_isSet2(); - init_keys3(); - init_keysIn2(); - cloneableTags2 = {}; - cloneableTags2[argsTag7] = cloneableTags2[arrayTag5] = cloneableTags2[arrayBufferTag8] = cloneableTags2[dataViewTag9] = cloneableTags2[boolTag8] = cloneableTags2[dateTag8] = cloneableTags2[float32Tag6] = cloneableTags2[float64Tag6] = cloneableTags2[int8Tag6] = cloneableTags2[int16Tag6] = cloneableTags2[int32Tag6] = cloneableTags2[mapTag15] = cloneableTags2[numberTag8] = cloneableTags2[objectTag9] = cloneableTags2[regexpTag8] = cloneableTags2[setTag15] = cloneableTags2[stringTag8] = cloneableTags2[symbolTag7] = cloneableTags2[uint8Tag6] = cloneableTags2[uint8ClampedTag6] = cloneableTags2[uint16Tag6] = cloneableTags2[uint32Tag6] = true; - cloneableTags2[errorTag7] = cloneableTags2[funcTag6] = cloneableTags2[weakMapTag7] = false; - _baseClone_default2 = baseClone2; -}); - -// ../node_modules/lodash-es/clone.js -function clone4(value) { - return _baseClone_default2(value, CLONE_SYMBOLS_FLAG8); -} -var CLONE_SYMBOLS_FLAG8 = 4, clone_default2; -var init_clone2 = __esm(() => { - init__baseClone2(); - clone_default2 = clone4; -}); - -// ../node_modules/lodash-es/cloneDeep.js -function cloneDeep2(value) { - return _baseClone_default2(value, CLONE_DEEP_FLAG10 | CLONE_SYMBOLS_FLAG9); -} -var CLONE_DEEP_FLAG10 = 1, CLONE_SYMBOLS_FLAG9 = 4, cloneDeep_default2; -var init_cloneDeep2 = __esm(() => { - init__baseClone2(); - cloneDeep_default2 = cloneDeep2; -}); - -// ../node_modules/lodash-es/cloneDeepWith.js -function cloneDeepWith2(value, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined; - return _baseClone_default2(value, CLONE_DEEP_FLAG11 | CLONE_SYMBOLS_FLAG10, customizer); -} -var CLONE_DEEP_FLAG11 = 1, CLONE_SYMBOLS_FLAG10 = 4, cloneDeepWith_default2; -var init_cloneDeepWith2 = __esm(() => { - init__baseClone2(); - cloneDeepWith_default2 = cloneDeepWith2; -}); - -// ../node_modules/lodash-es/cloneWith.js -function cloneWith2(value, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined; - return _baseClone_default2(value, CLONE_SYMBOLS_FLAG11, customizer); -} -var CLONE_SYMBOLS_FLAG11 = 4, cloneWith_default2; -var init_cloneWith2 = __esm(() => { - init__baseClone2(); - cloneWith_default2 = cloneWith2; -}); - -// ../node_modules/lodash-es/commit.js -function wrapperCommit2() { - return new _LodashWrapper_default2(this.value(), this.__chain__); -} -var commit_default2; -var init_commit2 = __esm(() => { - init__LodashWrapper2(); - commit_default2 = wrapperCommit2; -}); - -// ../node_modules/lodash-es/compact.js -function compact2(array3) { - var index = -1, length = array3 == null ? 0 : array3.length, resIndex = 0, result2 = []; - while (++index < length) { - var value = array3[index]; - if (value) { - result2[resIndex++] = value; - } - } - return result2; -} -var compact_default2; -var init_compact2 = __esm(() => { - compact_default2 = compact2; -}); - -// ../node_modules/lodash-es/concat.js -function concat2() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), array3 = arguments[0], index = length; - while (index--) { - args[index - 1] = arguments[index]; - } - return _arrayPush_default2(isArray_default2(array3) ? _copyArray_default2(array3) : [array3], _baseFlatten_default2(args, 1)); -} -var concat_default2; -var init_concat2 = __esm(() => { - init__arrayPush2(); - init__baseFlatten2(); - init__copyArray2(); - init_isArray2(); - concat_default2 = concat2; -}); - -// ../node_modules/lodash-es/_setCacheAdd.js -function setCacheAdd2(value) { - this.__data__.set(value, HASH_UNDEFINED6); - return this; -} -var HASH_UNDEFINED6 = "__lodash_hash_undefined__", _setCacheAdd_default2; -var init__setCacheAdd2 = __esm(() => { - _setCacheAdd_default2 = setCacheAdd2; -}); - -// ../node_modules/lodash-es/_setCacheHas.js -function setCacheHas2(value) { - return this.__data__.has(value); -} -var _setCacheHas_default2; -var init__setCacheHas2 = __esm(() => { - _setCacheHas_default2 = setCacheHas2; -}); - -// ../node_modules/lodash-es/_SetCache.js -function SetCache2(values3) { - var index = -1, length = values3 == null ? 0 : values3.length; - this.__data__ = new _MapCache_default2; - while (++index < length) { - this.add(values3[index]); - } -} -var _SetCache_default2; -var init__SetCache2 = __esm(() => { - init__MapCache2(); - init__setCacheAdd2(); - init__setCacheHas2(); - SetCache2.prototype.add = SetCache2.prototype.push = _setCacheAdd_default2; - SetCache2.prototype.has = _setCacheHas_default2; - _SetCache_default2 = SetCache2; -}); - -// ../node_modules/lodash-es/_arraySome.js -function arraySome2(array3, predicate) { - var index = -1, length = array3 == null ? 0 : array3.length; - while (++index < length) { - if (predicate(array3[index], index, array3)) { - return true; - } - } - return false; -} -var _arraySome_default2; -var init__arraySome2 = __esm(() => { - _arraySome_default2 = arraySome2; -}); - -// ../node_modules/lodash-es/_cacheHas.js -function cacheHas2(cache3, key) { - return cache3.has(key); -} -var _cacheHas_default2; -var init__cacheHas2 = __esm(() => { - _cacheHas_default2 = cacheHas2; -}); - -// ../node_modules/lodash-es/_equalArrays.js -function equalArrays2(array3, other2, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG7, arrLength = array3.length, othLength = other2.length; - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - var arrStacked = stack.get(array3); - var othStacked = stack.get(other2); - if (arrStacked && othStacked) { - return arrStacked == other2 && othStacked == array3; - } - var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG5 ? new _SetCache_default2 : undefined; - stack.set(array3, other2); - stack.set(other2, array3); - while (++index < arrLength) { - var arrValue = array3[index], othValue = other2[index]; - if (customizer) { - var compared = isPartial ? customizer(othValue, arrValue, index, other2, array3, stack) : customizer(arrValue, othValue, index, array3, other2, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result2 = false; - break; - } - if (seen) { - if (!_arraySome_default2(other2, function(othValue2, othIndex) { - if (!_cacheHas_default2(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result2 = false; - break; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - result2 = false; - break; - } - } - stack["delete"](array3); - stack["delete"](other2); - return result2; -} -var COMPARE_PARTIAL_FLAG7 = 1, COMPARE_UNORDERED_FLAG5 = 2, _equalArrays_default2; -var init__equalArrays2 = __esm(() => { - init__SetCache2(); - init__arraySome2(); - init__cacheHas2(); - _equalArrays_default2 = equalArrays2; -}); - -// ../node_modules/lodash-es/_mapToArray.js -function mapToArray2(map5) { - var index = -1, result2 = Array(map5.size); - map5.forEach(function(value, key) { - result2[++index] = [key, value]; - }); - return result2; -} -var _mapToArray_default2; -var init__mapToArray2 = __esm(() => { - _mapToArray_default2 = mapToArray2; -}); - -// ../node_modules/lodash-es/_setToArray.js -function setToArray2(set4) { - var index = -1, result2 = Array(set4.size); - set4.forEach(function(value) { - result2[++index] = value; - }); - return result2; -} -var _setToArray_default2; -var init__setToArray2 = __esm(() => { - _setToArray_default2 = setToArray2; -}); - -// ../node_modules/lodash-es/_equalByTag.js -function equalByTag2(object4, other2, tag2, bitmask, customizer, equalFunc, stack) { - switch (tag2) { - case dataViewTag10: - if (object4.byteLength != other2.byteLength || object4.byteOffset != other2.byteOffset) { - return false; - } - object4 = object4.buffer; - other2 = other2.buffer; - case arrayBufferTag9: - if (object4.byteLength != other2.byteLength || !equalFunc(new _Uint8Array_default2(object4), new _Uint8Array_default2(other2))) { - return false; - } - return true; - case boolTag9: - case dateTag9: - case numberTag9: - return eq_default2(+object4, +other2); - case errorTag8: - return object4.name == other2.name && object4.message == other2.message; - case regexpTag9: - case stringTag9: - return object4 == other2 + ""; - case mapTag16: - var convert = _mapToArray_default2; - case setTag16: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG8; - convert || (convert = _setToArray_default2); - if (object4.size != other2.size && !isPartial) { - return false; - } - var stacked = stack.get(object4); - if (stacked) { - return stacked == other2; - } - bitmask |= COMPARE_UNORDERED_FLAG6; - stack.set(object4, other2); - var result2 = _equalArrays_default2(convert(object4), convert(other2), bitmask, customizer, equalFunc, stack); - stack["delete"](object4); - return result2; - case symbolTag8: - if (symbolValueOf4) { - return symbolValueOf4.call(object4) == symbolValueOf4.call(other2); - } - } - return false; -} -var COMPARE_PARTIAL_FLAG8 = 1, COMPARE_UNORDERED_FLAG6 = 2, boolTag9 = "[object Boolean]", dateTag9 = "[object Date]", errorTag8 = "[object Error]", mapTag16 = "[object Map]", numberTag9 = "[object Number]", regexpTag9 = "[object RegExp]", setTag16 = "[object Set]", stringTag9 = "[object String]", symbolTag8 = "[object Symbol]", arrayBufferTag9 = "[object ArrayBuffer]", dataViewTag10 = "[object DataView]", symbolProto6, symbolValueOf4, _equalByTag_default2; -var init__equalByTag2 = __esm(() => { - init__Symbol2(); - init__Uint8Array2(); - init_eq2(); - init__equalArrays2(); - init__mapToArray2(); - init__setToArray2(); - symbolProto6 = _Symbol_default2 ? _Symbol_default2.prototype : undefined; - symbolValueOf4 = symbolProto6 ? symbolProto6.valueOf : undefined; - _equalByTag_default2 = equalByTag2; -}); - -// ../node_modules/lodash-es/_equalObjects.js -function equalObjects2(object4, other2, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG9, objProps = _getAllKeys_default2(object4), objLength = objProps.length, othProps = _getAllKeys_default2(other2), othLength = othProps.length; - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other2 : hasOwnProperty42.call(other2, key))) { - return false; - } - } - var objStacked = stack.get(object4); - var othStacked = stack.get(other2); - if (objStacked && othStacked) { - return objStacked == other2 && othStacked == object4; - } - var result2 = true; - stack.set(object4, other2); - stack.set(other2, object4); - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object4[key], othValue = other2[key]; - if (customizer) { - var compared = isPartial ? customizer(othValue, objValue, key, other2, object4, stack) : customizer(objValue, othValue, key, object4, other2, stack); - } - if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { - result2 = false; - break; - } - skipCtor || (skipCtor = key == "constructor"); - } - if (result2 && !skipCtor) { - var objCtor = object4.constructor, othCtor = other2.constructor; - if (objCtor != othCtor && (("constructor" in object4) && ("constructor" in other2)) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { - result2 = false; - } - } - stack["delete"](object4); - stack["delete"](other2); - return result2; -} -var COMPARE_PARTIAL_FLAG9 = 1, objectProto48, hasOwnProperty42, _equalObjects_default2; -var init__equalObjects2 = __esm(() => { - init__getAllKeys2(); - objectProto48 = Object.prototype; - hasOwnProperty42 = objectProto48.hasOwnProperty; - _equalObjects_default2 = equalObjects2; -}); - -// ../node_modules/lodash-es/_baseIsEqualDeep.js -function baseIsEqualDeep2(object4, other2, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray_default2(object4), othIsArr = isArray_default2(other2), objTag = objIsArr ? arrayTag6 : _getTag_default2(object4), othTag = othIsArr ? arrayTag6 : _getTag_default2(other2); - objTag = objTag == argsTag8 ? objectTag10 : objTag; - othTag = othTag == argsTag8 ? objectTag10 : othTag; - var objIsObj = objTag == objectTag10, othIsObj = othTag == objectTag10, isSameTag = objTag == othTag; - if (isSameTag && isBuffer_default2(object4)) { - if (!isBuffer_default2(other2)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new _Stack_default2); - return objIsArr || isTypedArray_default2(object4) ? _equalArrays_default2(object4, other2, bitmask, customizer, equalFunc, stack) : _equalByTag_default2(object4, other2, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG10)) { - var objIsWrapped = objIsObj && hasOwnProperty43.call(object4, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty43.call(other2, "__wrapped__"); - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object4.value() : object4, othUnwrapped = othIsWrapped ? other2.value() : other2; - stack || (stack = new _Stack_default2); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new _Stack_default2); - return _equalObjects_default2(object4, other2, bitmask, customizer, equalFunc, stack); -} -var COMPARE_PARTIAL_FLAG10 = 1, argsTag8 = "[object Arguments]", arrayTag6 = "[object Array]", objectTag10 = "[object Object]", objectProto49, hasOwnProperty43, _baseIsEqualDeep_default2; -var init__baseIsEqualDeep2 = __esm(() => { - init__Stack2(); - init__equalArrays2(); - init__equalByTag2(); - init__equalObjects2(); - init__getTag2(); - init_isArray2(); - init_isBuffer2(); - init_isTypedArray2(); - objectProto49 = Object.prototype; - hasOwnProperty43 = objectProto49.hasOwnProperty; - _baseIsEqualDeep_default2 = baseIsEqualDeep2; -}); - -// ../node_modules/lodash-es/_baseIsEqual.js -function baseIsEqual2(value, other2, bitmask, customizer, stack) { - if (value === other2) { - return true; - } - if (value == null || other2 == null || !isObjectLike_default2(value) && !isObjectLike_default2(other2)) { - return value !== value && other2 !== other2; - } - return _baseIsEqualDeep_default2(value, other2, bitmask, customizer, baseIsEqual2, stack); -} -var _baseIsEqual_default2; -var init__baseIsEqual2 = __esm(() => { - init__baseIsEqualDeep2(); - init_isObjectLike2(); - _baseIsEqual_default2 = baseIsEqual2; -}); - -// ../node_modules/lodash-es/_baseIsMatch.js -function baseIsMatch2(object4, source, matchData, customizer) { - var index = matchData.length, length = index, noCustomizer = !customizer; - if (object4 == null) { - return !length; - } - object4 = Object(object4); - while (index--) { - var data = matchData[index]; - if (noCustomizer && data[2] ? data[1] !== object4[data[0]] : !(data[0] in object4)) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], objValue = object4[key], srcValue = data[1]; - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object4)) { - return false; - } - } else { - var stack = new _Stack_default2; - if (customizer) { - var result2 = customizer(objValue, srcValue, key, object4, source, stack); - } - if (!(result2 === undefined ? _baseIsEqual_default2(srcValue, objValue, COMPARE_PARTIAL_FLAG11 | COMPARE_UNORDERED_FLAG7, customizer, stack) : result2)) { - return false; - } - } - } - return true; -} -var COMPARE_PARTIAL_FLAG11 = 1, COMPARE_UNORDERED_FLAG7 = 2, _baseIsMatch_default2; -var init__baseIsMatch2 = __esm(() => { - init__Stack2(); - init__baseIsEqual2(); - _baseIsMatch_default2 = baseIsMatch2; -}); - -// ../node_modules/lodash-es/_isStrictComparable.js -function isStrictComparable2(value) { - return value === value && !isObject_default2(value); -} -var _isStrictComparable_default2; -var init__isStrictComparable2 = __esm(() => { - init_isObject2(); - _isStrictComparable_default2 = isStrictComparable2; -}); - -// ../node_modules/lodash-es/_getMatchData.js -function getMatchData2(object4) { - var result2 = keys_default2(object4), length = result2.length; - while (length--) { - var key = result2[length], value = object4[key]; - result2[length] = [key, value, _isStrictComparable_default2(value)]; - } - return result2; -} -var _getMatchData_default2; -var init__getMatchData2 = __esm(() => { - init__isStrictComparable2(); - init_keys3(); - _getMatchData_default2 = getMatchData2; -}); - -// ../node_modules/lodash-es/_matchesStrictComparable.js -function matchesStrictComparable2(key, srcValue) { - return function(object4) { - if (object4 == null) { - return false; - } - return object4[key] === srcValue && (srcValue !== undefined || (key in Object(object4))); - }; -} -var _matchesStrictComparable_default2; -var init__matchesStrictComparable2 = __esm(() => { - _matchesStrictComparable_default2 = matchesStrictComparable2; -}); - -// ../node_modules/lodash-es/_baseMatches.js -function baseMatches2(source) { - var matchData = _getMatchData_default2(source); - if (matchData.length == 1 && matchData[0][2]) { - return _matchesStrictComparable_default2(matchData[0][0], matchData[0][1]); - } - return function(object4) { - return object4 === source || _baseIsMatch_default2(object4, source, matchData); - }; -} -var _baseMatches_default2; -var init__baseMatches2 = __esm(() => { - init__baseIsMatch2(); - init__getMatchData2(); - init__matchesStrictComparable2(); - _baseMatches_default2 = baseMatches2; -}); - -// ../node_modules/lodash-es/_baseHasIn.js -function baseHasIn2(object4, key) { - return object4 != null && key in Object(object4); -} -var _baseHasIn_default2; -var init__baseHasIn2 = __esm(() => { - _baseHasIn_default2 = baseHasIn2; -}); - -// ../node_modules/lodash-es/_hasPath.js -function hasPath2(object4, path13, hasFunc) { - path13 = _castPath_default2(path13, object4); - var index = -1, length = path13.length, result2 = false; - while (++index < length) { - var key = _toKey_default2(path13[index]); - if (!(result2 = object4 != null && hasFunc(object4, key))) { - break; - } - object4 = object4[key]; - } - if (result2 || ++index != length) { - return result2; - } - length = object4 == null ? 0 : object4.length; - return !!length && isLength_default2(length) && _isIndex_default2(key, length) && (isArray_default2(object4) || isArguments_default2(object4)); -} -var _hasPath_default2; -var init__hasPath2 = __esm(() => { - init__castPath2(); - init_isArguments2(); - init_isArray2(); - init__isIndex2(); - init_isLength2(); - init__toKey2(); - _hasPath_default2 = hasPath2; -}); - -// ../node_modules/lodash-es/hasIn.js -function hasIn2(object4, path13) { - return object4 != null && _hasPath_default2(object4, path13, _baseHasIn_default2); -} -var hasIn_default2; -var init_hasIn2 = __esm(() => { - init__baseHasIn2(); - init__hasPath2(); - hasIn_default2 = hasIn2; -}); - -// ../node_modules/lodash-es/_baseMatchesProperty.js -function baseMatchesProperty2(path13, srcValue) { - if (_isKey_default2(path13) && _isStrictComparable_default2(srcValue)) { - return _matchesStrictComparable_default2(_toKey_default2(path13), srcValue); - } - return function(object4) { - var objValue = get_default2(object4, path13); - return objValue === undefined && objValue === srcValue ? hasIn_default2(object4, path13) : _baseIsEqual_default2(srcValue, objValue, COMPARE_PARTIAL_FLAG12 | COMPARE_UNORDERED_FLAG8); - }; -} -var COMPARE_PARTIAL_FLAG12 = 1, COMPARE_UNORDERED_FLAG8 = 2, _baseMatchesProperty_default2; -var init__baseMatchesProperty2 = __esm(() => { - init__baseIsEqual2(); - init_get2(); - init_hasIn2(); - init__isKey2(); - init__isStrictComparable2(); - init__matchesStrictComparable2(); - init__toKey2(); - _baseMatchesProperty_default2 = baseMatchesProperty2; -}); - -// ../node_modules/lodash-es/_baseProperty.js -function baseProperty2(key) { - return function(object4) { - return object4 == null ? undefined : object4[key]; - }; -} -var _baseProperty_default2; -var init__baseProperty2 = __esm(() => { - _baseProperty_default2 = baseProperty2; -}); - -// ../node_modules/lodash-es/_basePropertyDeep.js -function basePropertyDeep2(path13) { - return function(object4) { - return _baseGet_default2(object4, path13); - }; -} -var _basePropertyDeep_default2; -var init__basePropertyDeep2 = __esm(() => { - init__baseGet2(); - _basePropertyDeep_default2 = basePropertyDeep2; -}); - -// ../node_modules/lodash-es/property.js -function property2(path13) { - return _isKey_default2(path13) ? _baseProperty_default2(_toKey_default2(path13)) : _basePropertyDeep_default2(path13); -} -var property_default2; -var init_property2 = __esm(() => { - init__baseProperty2(); - init__basePropertyDeep2(); - init__isKey2(); - init__toKey2(); - property_default2 = property2; -}); - -// ../node_modules/lodash-es/_baseIteratee.js -function baseIteratee2(value) { - if (typeof value == "function") { - return value; - } - if (value == null) { - return identity_default3; - } - if (typeof value == "object") { - return isArray_default2(value) ? _baseMatchesProperty_default2(value[0], value[1]) : _baseMatches_default2(value); - } - return property_default2(value); -} -var _baseIteratee_default2; -var init__baseIteratee2 = __esm(() => { - init__baseMatches2(); - init__baseMatchesProperty2(); - init_identity3(); - init_isArray2(); - init_property2(); - _baseIteratee_default2 = baseIteratee2; -}); - -// ../node_modules/lodash-es/cond.js -function cond2(pairs) { - var length = pairs == null ? 0 : pairs.length, toIteratee = _baseIteratee_default2; - pairs = !length ? [] : _arrayMap_default2(pairs, function(pair) { - if (typeof pair[1] != "function") { - throw new TypeError(FUNC_ERROR_TEXT17); - } - return [toIteratee(pair[0]), pair[1]]; - }); - return _baseRest_default2(function(args) { - var index = -1; - while (++index < length) { - var pair = pairs[index]; - if (_apply_default2(pair[0], this, args)) { - return _apply_default2(pair[1], this, args); - } - } - }); -} -var FUNC_ERROR_TEXT17 = "Expected a function", cond_default2; -var init_cond2 = __esm(() => { - init__apply2(); - init__arrayMap2(); - init__baseIteratee2(); - init__baseRest2(); - cond_default2 = cond2; -}); - -// ../node_modules/lodash-es/_baseConformsTo.js -function baseConformsTo2(object4, source, props) { - var length = props.length; - if (object4 == null) { - return !length; - } - object4 = Object(object4); - while (length--) { - var key = props[length], predicate = source[key], value = object4[key]; - if (value === undefined && !(key in object4) || !predicate(value)) { - return false; - } - } - return true; -} -var _baseConformsTo_default2; -var init__baseConformsTo2 = __esm(() => { - _baseConformsTo_default2 = baseConformsTo2; -}); - -// ../node_modules/lodash-es/_baseConforms.js -function baseConforms2(source) { - var props = keys_default2(source); - return function(object4) { - return _baseConformsTo_default2(object4, source, props); - }; -} -var _baseConforms_default2; -var init__baseConforms2 = __esm(() => { - init__baseConformsTo2(); - init_keys3(); - _baseConforms_default2 = baseConforms2; -}); - -// ../node_modules/lodash-es/conforms.js -function conforms2(source) { - return _baseConforms_default2(_baseClone_default2(source, CLONE_DEEP_FLAG12)); -} -var CLONE_DEEP_FLAG12 = 1, conforms_default2; -var init_conforms2 = __esm(() => { - init__baseClone2(); - init__baseConforms2(); - conforms_default2 = conforms2; -}); - -// ../node_modules/lodash-es/conformsTo.js -function conformsTo2(object4, source) { - return source == null || _baseConformsTo_default2(object4, source, keys_default2(source)); -} -var conformsTo_default2; -var init_conformsTo2 = __esm(() => { - init__baseConformsTo2(); - init_keys3(); - conformsTo_default2 = conformsTo2; -}); - -// ../node_modules/lodash-es/_arrayAggregator.js -function arrayAggregator2(array3, setter, iteratee2, accumulator) { - var index = -1, length = array3 == null ? 0 : array3.length; - while (++index < length) { - var value = array3[index]; - setter(accumulator, value, iteratee2(value), array3); - } - return accumulator; -} -var _arrayAggregator_default2; -var init__arrayAggregator2 = __esm(() => { - _arrayAggregator_default2 = arrayAggregator2; -}); - -// ../node_modules/lodash-es/_createBaseFor.js -function createBaseFor2(fromRight) { - return function(object4, iteratee2, keysFunc) { - var index = -1, iterable = Object(object4), props = keysFunc(object4), length = props.length; - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee2(iterable[key], key, iterable) === false) { - break; - } - } - return object4; - }; -} -var _createBaseFor_default2; -var init__createBaseFor2 = __esm(() => { - _createBaseFor_default2 = createBaseFor2; -}); - -// ../node_modules/lodash-es/_baseFor.js -var baseFor2, _baseFor_default2; -var init__baseFor2 = __esm(() => { - init__createBaseFor2(); - baseFor2 = _createBaseFor_default2(); - _baseFor_default2 = baseFor2; -}); - -// ../node_modules/lodash-es/_baseForOwn.js -function baseForOwn2(object4, iteratee2) { - return object4 && _baseFor_default2(object4, iteratee2, keys_default2); -} -var _baseForOwn_default2; -var init__baseForOwn2 = __esm(() => { - init__baseFor2(); - init_keys3(); - _baseForOwn_default2 = baseForOwn2; -}); - -// ../node_modules/lodash-es/_createBaseEach.js -function createBaseEach2(eachFunc, fromRight) { - return function(collection, iteratee2) { - if (collection == null) { - return collection; - } - if (!isArrayLike_default2(collection)) { - return eachFunc(collection, iteratee2); - } - var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); - while (fromRight ? index-- : ++index < length) { - if (iteratee2(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; -} -var _createBaseEach_default2; -var init__createBaseEach2 = __esm(() => { - init_isArrayLike2(); - _createBaseEach_default2 = createBaseEach2; -}); - -// ../node_modules/lodash-es/_baseEach.js -var baseEach2, _baseEach_default2; -var init__baseEach2 = __esm(() => { - init__baseForOwn2(); - init__createBaseEach2(); - baseEach2 = _createBaseEach_default2(_baseForOwn_default2); - _baseEach_default2 = baseEach2; -}); - -// ../node_modules/lodash-es/_baseAggregator.js -function baseAggregator2(collection, setter, iteratee2, accumulator) { - _baseEach_default2(collection, function(value, key, collection2) { - setter(accumulator, value, iteratee2(value), collection2); - }); - return accumulator; -} -var _baseAggregator_default2; -var init__baseAggregator2 = __esm(() => { - init__baseEach2(); - _baseAggregator_default2 = baseAggregator2; -}); - -// ../node_modules/lodash-es/_createAggregator.js -function createAggregator2(setter, initializer3) { - return function(collection, iteratee2) { - var func = isArray_default2(collection) ? _arrayAggregator_default2 : _baseAggregator_default2, accumulator = initializer3 ? initializer3() : {}; - return func(collection, setter, _baseIteratee_default2(iteratee2, 2), accumulator); - }; -} -var _createAggregator_default2; -var init__createAggregator2 = __esm(() => { - init__arrayAggregator2(); - init__baseAggregator2(); - init__baseIteratee2(); - init_isArray2(); - _createAggregator_default2 = createAggregator2; -}); - -// ../node_modules/lodash-es/countBy.js -var objectProto50, hasOwnProperty44, countBy2, countBy_default2; -var init_countBy2 = __esm(() => { - init__baseAssignValue2(); - init__createAggregator2(); - objectProto50 = Object.prototype; - hasOwnProperty44 = objectProto50.hasOwnProperty; - countBy2 = _createAggregator_default2(function(result2, value, key) { - if (hasOwnProperty44.call(result2, key)) { - ++result2[key]; - } else { - _baseAssignValue_default2(result2, key, 1); - } - }); - countBy_default2 = countBy2; -}); - -// ../node_modules/lodash-es/create.js -function create2(prototype2, properties) { - var result2 = _baseCreate_default2(prototype2); - return properties == null ? result2 : _baseAssign_default2(result2, properties); -} -var create_default2; -var init_create3 = __esm(() => { - init__baseAssign2(); - init__baseCreate2(); - create_default2 = create2; -}); - -// ../node_modules/lodash-es/curry.js -function curry2(func, arity, guard) { - arity = guard ? undefined : arity; - var result2 = _createWrap_default2(func, WRAP_CURRY_FLAG13, undefined, undefined, undefined, undefined, undefined, arity); - result2.placeholder = curry2.placeholder; - return result2; -} -var WRAP_CURRY_FLAG13 = 8, curry_default2; -var init_curry2 = __esm(() => { - init__createWrap2(); - curry2.placeholder = {}; - curry_default2 = curry2; -}); - -// ../node_modules/lodash-es/curryRight.js -function curryRight2(func, arity, guard) { - arity = guard ? undefined : arity; - var result2 = _createWrap_default2(func, WRAP_CURRY_RIGHT_FLAG8, undefined, undefined, undefined, undefined, undefined, arity); - result2.placeholder = curryRight2.placeholder; - return result2; -} -var WRAP_CURRY_RIGHT_FLAG8 = 16, curryRight_default2; -var init_curryRight2 = __esm(() => { - init__createWrap2(); - curryRight2.placeholder = {}; - curryRight_default2 = curryRight2; -}); - -// ../node_modules/lodash-es/now.js -var now2 = function() { - return _root_default2.Date.now(); -}, now_default2; -var init_now2 = __esm(() => { - init__root2(); - now_default2 = now2; -}); - -// ../node_modules/lodash-es/debounce.js -function debounce3(func, wait, options2) { - var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT18); - } - wait = toNumber_default2(wait) || 0; - if (isObject_default2(options2)) { - leading = !!options2.leading; - maxing = "maxWait" in options2; - maxWait = maxing ? nativeMax23(toNumber_default2(options2.maxWait) || 0, wait) : maxWait; - trailing = "trailing" in options2 ? !!options2.trailing : trailing; - } - function invokeFunc(time3) { - var args = lastArgs, thisArg = lastThis; - lastArgs = lastThis = undefined; - lastInvokeTime = time3; - result2 = func.apply(thisArg, args); - return result2; - } - function leadingEdge2(time3) { - lastInvokeTime = time3; - timerId = setTimeout(timerExpired, wait); - return leading ? invokeFunc(time3) : result2; - } - function remainingWait(time3) { - var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; - return maxing ? nativeMin19(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; - } - function shouldInvoke(time3) { - var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime; - return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; - } - function timerExpired() { - var time3 = now_default2(); - if (shouldInvoke(time3)) { - return trailingEdge2(time3); - } - timerId = setTimeout(timerExpired, remainingWait(time3)); - } - function trailingEdge2(time3) { - timerId = undefined; - if (trailing && lastArgs) { - return invokeFunc(time3); - } - lastArgs = lastThis = undefined; - return result2; - } - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - function flush() { - return timerId === undefined ? result2 : trailingEdge2(now_default2()); - } - function debounced() { - var time3 = now_default2(), isInvoking = shouldInvoke(time3); - lastArgs = arguments; - lastThis = this; - lastCallTime = time3; - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge2(lastCallTime); - } - if (maxing) { - clearTimeout(timerId); - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result2; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; -} -var FUNC_ERROR_TEXT18 = "Expected a function", nativeMax23, nativeMin19, debounce_default2; -var init_debounce2 = __esm(() => { - init_isObject2(); - init_now2(); - init_toNumber2(); - nativeMax23 = Math.max; - nativeMin19 = Math.min; - debounce_default2 = debounce3; -}); - -// ../node_modules/lodash-es/defaultTo.js -function defaultTo2(value, defaultValue) { - return value == null || value !== value ? defaultValue : value; -} -var defaultTo_default2; -var init_defaultTo2 = __esm(() => { - defaultTo_default2 = defaultTo2; -}); - -// ../node_modules/lodash-es/defaults.js -var objectProto51, hasOwnProperty45, defaults3, defaults_default3; -var init_defaults3 = __esm(() => { - init__baseRest2(); - init_eq2(); - init__isIterateeCall2(); - init_keysIn2(); - objectProto51 = Object.prototype; - hasOwnProperty45 = objectProto51.hasOwnProperty; - defaults3 = _baseRest_default2(function(object4, sources) { - object4 = Object(object4); - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; - if (guard && _isIterateeCall_default2(sources[0], sources[1], guard)) { - length = 1; - } - while (++index < length) { - var source = sources[index]; - var props = keysIn_default2(source); - var propsIndex = -1; - var propsLength = props.length; - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object4[key]; - if (value === undefined || eq_default2(value, objectProto51[key]) && !hasOwnProperty45.call(object4, key)) { - object4[key] = source[key]; - } - } - } - return object4; - }); - defaults_default3 = defaults3; -}); - -// ../node_modules/lodash-es/_assignMergeValue.js -function assignMergeValue2(object4, key, value) { - if (value !== undefined && !eq_default2(object4[key], value) || value === undefined && !(key in object4)) { - _baseAssignValue_default2(object4, key, value); - } -} -var _assignMergeValue_default2; -var init__assignMergeValue2 = __esm(() => { - init__baseAssignValue2(); - init_eq2(); - _assignMergeValue_default2 = assignMergeValue2; -}); - -// ../node_modules/lodash-es/isArrayLikeObject.js -function isArrayLikeObject2(value) { - return isObjectLike_default2(value) && isArrayLike_default2(value); -} -var isArrayLikeObject_default2; -var init_isArrayLikeObject2 = __esm(() => { - init_isArrayLike2(); - init_isObjectLike2(); - isArrayLikeObject_default2 = isArrayLikeObject2; -}); - -// ../node_modules/lodash-es/_safeGet.js -function safeGet2(object4, key) { - if (key === "constructor" && typeof object4[key] === "function") { - return; - } - if (key == "__proto__") { - return; - } - return object4[key]; -} -var _safeGet_default2; -var init__safeGet2 = __esm(() => { - _safeGet_default2 = safeGet2; -}); - -// ../node_modules/lodash-es/toPlainObject.js -function toPlainObject2(value) { - return _copyObject_default2(value, keysIn_default2(value)); -} -var toPlainObject_default2; -var init_toPlainObject2 = __esm(() => { - init__copyObject2(); - init_keysIn2(); - toPlainObject_default2 = toPlainObject2; -}); - -// ../node_modules/lodash-es/_baseMergeDeep.js -function baseMergeDeep2(object4, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = _safeGet_default2(object4, key), srcValue = _safeGet_default2(source, key), stacked = stack.get(srcValue); - if (stacked) { - _assignMergeValue_default2(object4, key, stacked); - return; - } - var newValue = customizer ? customizer(objValue, srcValue, key + "", object4, source, stack) : undefined; - var isCommon = newValue === undefined; - if (isCommon) { - var isArr = isArray_default2(srcValue), isBuff = !isArr && isBuffer_default2(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default2(srcValue); - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray_default2(objValue)) { - newValue = objValue; - } else if (isArrayLikeObject_default2(objValue)) { - newValue = _copyArray_default2(objValue); - } else if (isBuff) { - isCommon = false; - newValue = _cloneBuffer_default2(srcValue, true); - } else if (isTyped) { - isCommon = false; - newValue = _cloneTypedArray_default2(srcValue, true); - } else { - newValue = []; - } - } else if (isPlainObject_default2(srcValue) || isArguments_default2(srcValue)) { - newValue = objValue; - if (isArguments_default2(objValue)) { - newValue = toPlainObject_default2(objValue); - } else if (!isObject_default2(objValue) || isFunction_default2(objValue)) { - newValue = _initCloneObject_default2(srcValue); - } - } else { - isCommon = false; - } - } - if (isCommon) { - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack["delete"](srcValue); - } - _assignMergeValue_default2(object4, key, newValue); -} -var _baseMergeDeep_default2; -var init__baseMergeDeep2 = __esm(() => { - init__assignMergeValue2(); - init__cloneBuffer2(); - init__cloneTypedArray2(); - init__copyArray2(); - init__initCloneObject2(); - init_isArguments2(); - init_isArray2(); - init_isArrayLikeObject2(); - init_isBuffer2(); - init_isFunction2(); - init_isObject2(); - init_isPlainObject2(); - init_isTypedArray2(); - init__safeGet2(); - init_toPlainObject2(); - _baseMergeDeep_default2 = baseMergeDeep2; -}); - -// ../node_modules/lodash-es/_baseMerge.js -function baseMerge2(object4, source, srcIndex, customizer, stack) { - if (object4 === source) { - return; - } - _baseFor_default2(source, function(srcValue, key) { - stack || (stack = new _Stack_default2); - if (isObject_default2(srcValue)) { - _baseMergeDeep_default2(object4, source, key, srcIndex, baseMerge2, customizer, stack); - } else { - var newValue = customizer ? customizer(_safeGet_default2(object4, key), srcValue, key + "", object4, source, stack) : undefined; - if (newValue === undefined) { - newValue = srcValue; - } - _assignMergeValue_default2(object4, key, newValue); - } - }, keysIn_default2); -} -var _baseMerge_default2; -var init__baseMerge2 = __esm(() => { - init__Stack2(); - init__assignMergeValue2(); - init__baseFor2(); - init__baseMergeDeep2(); - init_isObject2(); - init_keysIn2(); - init__safeGet2(); - _baseMerge_default2 = baseMerge2; -}); - -// ../node_modules/lodash-es/_customDefaultsMerge.js -function customDefaultsMerge2(objValue, srcValue, key, object4, source, stack) { - if (isObject_default2(objValue) && isObject_default2(srcValue)) { - stack.set(srcValue, objValue); - _baseMerge_default2(objValue, srcValue, undefined, customDefaultsMerge2, stack); - stack["delete"](srcValue); - } - return objValue; -} -var _customDefaultsMerge_default2; -var init__customDefaultsMerge2 = __esm(() => { - init__baseMerge2(); - init_isObject2(); - _customDefaultsMerge_default2 = customDefaultsMerge2; -}); - -// ../node_modules/lodash-es/mergeWith.js -var mergeWith2, mergeWith_default2; -var init_mergeWith2 = __esm(() => { - init__baseMerge2(); - init__createAssigner2(); - mergeWith2 = _createAssigner_default2(function(object4, source, srcIndex, customizer) { - _baseMerge_default2(object4, source, srcIndex, customizer); - }); - mergeWith_default2 = mergeWith2; -}); - -// ../node_modules/lodash-es/defaultsDeep.js -var defaultsDeep2, defaultsDeep_default2; -var init_defaultsDeep2 = __esm(() => { - init__apply2(); - init__baseRest2(); - init__customDefaultsMerge2(); - init_mergeWith2(); - defaultsDeep2 = _baseRest_default2(function(args) { - args.push(undefined, _customDefaultsMerge_default2); - return _apply_default2(mergeWith_default2, undefined, args); - }); - defaultsDeep_default2 = defaultsDeep2; -}); - -// ../node_modules/lodash-es/_baseDelay.js -function baseDelay2(func, wait, args) { - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT19); - } - return setTimeout(function() { - func.apply(undefined, args); - }, wait); -} -var FUNC_ERROR_TEXT19 = "Expected a function", _baseDelay_default2; -var init__baseDelay2 = __esm(() => { - _baseDelay_default2 = baseDelay2; -}); - -// ../node_modules/lodash-es/defer.js -var defer2, defer_default2; -var init_defer2 = __esm(() => { - init__baseDelay2(); - init__baseRest2(); - defer2 = _baseRest_default2(function(func, args) { - return _baseDelay_default2(func, 1, args); - }); - defer_default2 = defer2; -}); - -// ../node_modules/lodash-es/delay.js -var delay2, delay_default2; -var init_delay2 = __esm(() => { - init__baseDelay2(); - init__baseRest2(); - init_toNumber2(); - delay2 = _baseRest_default2(function(func, wait, args) { - return _baseDelay_default2(func, toNumber_default2(wait) || 0, args); - }); - delay_default2 = delay2; -}); - -// ../node_modules/lodash-es/_arrayIncludesWith.js -function arrayIncludesWith2(array3, value, comparator) { - var index = -1, length = array3 == null ? 0 : array3.length; - while (++index < length) { - if (comparator(value, array3[index])) { - return true; - } - } - return false; -} -var _arrayIncludesWith_default2; -var init__arrayIncludesWith2 = __esm(() => { - _arrayIncludesWith_default2 = arrayIncludesWith2; -}); - -// ../node_modules/lodash-es/_baseDifference.js -function baseDifference2(array3, values3, iteratee2, comparator) { - var index = -1, includes2 = _arrayIncludes_default2, isCommon = true, length = array3.length, result2 = [], valuesLength = values3.length; - if (!length) { - return result2; - } - if (iteratee2) { - values3 = _arrayMap_default2(values3, _baseUnary_default2(iteratee2)); - } - if (comparator) { - includes2 = _arrayIncludesWith_default2; - isCommon = false; - } else if (values3.length >= LARGE_ARRAY_SIZE5) { - includes2 = _cacheHas_default2; - isCommon = false; - values3 = new _SetCache_default2(values3); - } - outer: - while (++index < length) { - var value = array3[index], computed = iteratee2 == null ? value : iteratee2(value); - value = comparator || value !== 0 ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values3[valuesIndex] === computed) { - continue outer; - } - } - result2.push(value); - } else if (!includes2(values3, computed, comparator)) { - result2.push(value); - } - } - return result2; -} -var LARGE_ARRAY_SIZE5 = 200, _baseDifference_default2; -var init__baseDifference2 = __esm(() => { - init__SetCache2(); - init__arrayIncludes2(); - init__arrayIncludesWith2(); - init__arrayMap2(); - init__baseUnary2(); - init__cacheHas2(); - _baseDifference_default2 = baseDifference2; -}); - -// ../node_modules/lodash-es/difference.js -var difference2, difference_default2; -var init_difference2 = __esm(() => { - init__baseDifference2(); - init__baseFlatten2(); - init__baseRest2(); - init_isArrayLikeObject2(); - difference2 = _baseRest_default2(function(array3, values3) { - return isArrayLikeObject_default2(array3) ? _baseDifference_default2(array3, _baseFlatten_default2(values3, 1, isArrayLikeObject_default2, true)) : []; - }); - difference_default2 = difference2; -}); - -// ../node_modules/lodash-es/last.js -function last2(array3) { - var length = array3 == null ? 0 : array3.length; - return length ? array3[length - 1] : undefined; -} -var last_default2; -var init_last2 = __esm(() => { - last_default2 = last2; -}); - -// ../node_modules/lodash-es/differenceBy.js -var differenceBy2, differenceBy_default2; -var init_differenceBy2 = __esm(() => { - init__baseDifference2(); - init__baseFlatten2(); - init__baseIteratee2(); - init__baseRest2(); - init_isArrayLikeObject2(); - init_last2(); - differenceBy2 = _baseRest_default2(function(array3, values3) { - var iteratee2 = last_default2(values3); - if (isArrayLikeObject_default2(iteratee2)) { - iteratee2 = undefined; - } - return isArrayLikeObject_default2(array3) ? _baseDifference_default2(array3, _baseFlatten_default2(values3, 1, isArrayLikeObject_default2, true), _baseIteratee_default2(iteratee2, 2)) : []; - }); - differenceBy_default2 = differenceBy2; -}); - -// ../node_modules/lodash-es/differenceWith.js -var differenceWith2, differenceWith_default2; -var init_differenceWith2 = __esm(() => { - init__baseDifference2(); - init__baseFlatten2(); - init__baseRest2(); - init_isArrayLikeObject2(); - init_last2(); - differenceWith2 = _baseRest_default2(function(array3, values3) { - var comparator = last_default2(values3); - if (isArrayLikeObject_default2(comparator)) { - comparator = undefined; - } - return isArrayLikeObject_default2(array3) ? _baseDifference_default2(array3, _baseFlatten_default2(values3, 1, isArrayLikeObject_default2, true), undefined, comparator) : []; - }); - differenceWith_default2 = differenceWith2; -}); - -// ../node_modules/lodash-es/divide.js -var divide2, divide_default2; -var init_divide2 = __esm(() => { - init__createMathOperation2(); - divide2 = _createMathOperation_default2(function(dividend, divisor) { - return dividend / divisor; - }, 1); - divide_default2 = divide2; -}); - -// ../node_modules/lodash-es/drop.js -function drop2(array3, n2, guard) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return []; - } - n2 = guard || n2 === undefined ? 1 : toInteger_default2(n2); - return _baseSlice_default2(array3, n2 < 0 ? 0 : n2, length); -} -var drop_default2; -var init_drop2 = __esm(() => { - init__baseSlice2(); - init_toInteger2(); - drop_default2 = drop2; -}); - -// ../node_modules/lodash-es/dropRight.js -function dropRight2(array3, n2, guard) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return []; - } - n2 = guard || n2 === undefined ? 1 : toInteger_default2(n2); - n2 = length - n2; - return _baseSlice_default2(array3, 0, n2 < 0 ? 0 : n2); -} -var dropRight_default2; -var init_dropRight2 = __esm(() => { - init__baseSlice2(); - init_toInteger2(); - dropRight_default2 = dropRight2; -}); - -// ../node_modules/lodash-es/_baseWhile.js -function baseWhile2(array3, predicate, isDrop, fromRight) { - var length = array3.length, index = fromRight ? length : -1; - while ((fromRight ? index-- : ++index < length) && predicate(array3[index], index, array3)) {} - return isDrop ? _baseSlice_default2(array3, fromRight ? 0 : index, fromRight ? index + 1 : length) : _baseSlice_default2(array3, fromRight ? index + 1 : 0, fromRight ? length : index); -} -var _baseWhile_default2; -var init__baseWhile2 = __esm(() => { - init__baseSlice2(); - _baseWhile_default2 = baseWhile2; -}); - -// ../node_modules/lodash-es/dropRightWhile.js -function dropRightWhile2(array3, predicate) { - return array3 && array3.length ? _baseWhile_default2(array3, _baseIteratee_default2(predicate, 3), true, true) : []; -} -var dropRightWhile_default2; -var init_dropRightWhile2 = __esm(() => { - init__baseIteratee2(); - init__baseWhile2(); - dropRightWhile_default2 = dropRightWhile2; -}); - -// ../node_modules/lodash-es/dropWhile.js -function dropWhile2(array3, predicate) { - return array3 && array3.length ? _baseWhile_default2(array3, _baseIteratee_default2(predicate, 3), true) : []; -} -var dropWhile_default2; -var init_dropWhile2 = __esm(() => { - init__baseIteratee2(); - init__baseWhile2(); - dropWhile_default2 = dropWhile2; -}); - -// ../node_modules/lodash-es/_castFunction.js -function castFunction2(value) { - return typeof value == "function" ? value : identity_default3; -} -var _castFunction_default2; -var init__castFunction2 = __esm(() => { - init_identity3(); - _castFunction_default2 = castFunction2; -}); - -// ../node_modules/lodash-es/forEach.js -function forEach3(collection, iteratee2) { - var func = isArray_default2(collection) ? _arrayEach_default2 : _baseEach_default2; - return func(collection, _castFunction_default2(iteratee2)); -} -var forEach_default2; -var init_forEach2 = __esm(() => { - init__arrayEach2(); - init__baseEach2(); - init__castFunction2(); - init_isArray2(); - forEach_default2 = forEach3; -}); - -// ../node_modules/lodash-es/each.js -var init_each2 = __esm(() => { - init_forEach2(); -}); - -// ../node_modules/lodash-es/_arrayEachRight.js -function arrayEachRight2(array3, iteratee2) { - var length = array3 == null ? 0 : array3.length; - while (length--) { - if (iteratee2(array3[length], length, array3) === false) { - break; - } - } - return array3; -} -var _arrayEachRight_default2; -var init__arrayEachRight2 = __esm(() => { - _arrayEachRight_default2 = arrayEachRight2; -}); - -// ../node_modules/lodash-es/_baseForRight.js -var baseForRight2, _baseForRight_default2; -var init__baseForRight2 = __esm(() => { - init__createBaseFor2(); - baseForRight2 = _createBaseFor_default2(true); - _baseForRight_default2 = baseForRight2; -}); - -// ../node_modules/lodash-es/_baseForOwnRight.js -function baseForOwnRight2(object4, iteratee2) { - return object4 && _baseForRight_default2(object4, iteratee2, keys_default2); -} -var _baseForOwnRight_default2; -var init__baseForOwnRight2 = __esm(() => { - init__baseForRight2(); - init_keys3(); - _baseForOwnRight_default2 = baseForOwnRight2; -}); - -// ../node_modules/lodash-es/_baseEachRight.js -var baseEachRight2, _baseEachRight_default2; -var init__baseEachRight2 = __esm(() => { - init__baseForOwnRight2(); - init__createBaseEach2(); - baseEachRight2 = _createBaseEach_default2(_baseForOwnRight_default2, true); - _baseEachRight_default2 = baseEachRight2; -}); - -// ../node_modules/lodash-es/forEachRight.js -function forEachRight2(collection, iteratee2) { - var func = isArray_default2(collection) ? _arrayEachRight_default2 : _baseEachRight_default2; - return func(collection, _castFunction_default2(iteratee2)); -} -var forEachRight_default2; -var init_forEachRight2 = __esm(() => { - init__arrayEachRight2(); - init__baseEachRight2(); - init__castFunction2(); - init_isArray2(); - forEachRight_default2 = forEachRight2; -}); - -// ../node_modules/lodash-es/eachRight.js -var init_eachRight2 = __esm(() => { - init_forEachRight2(); -}); - -// ../node_modules/lodash-es/endsWith.js -function endsWith3(string5, target, position) { - string5 = toString_default2(string5); - target = _baseToString_default2(target); - var length = string5.length; - position = position === undefined ? length : _baseClamp_default2(toInteger_default2(position), 0, length); - var end = position; - position -= target.length; - return position >= 0 && string5.slice(position, end) == target; -} -var endsWith_default2; -var init_endsWith2 = __esm(() => { - init__baseClamp2(); - init__baseToString2(); - init_toInteger2(); - init_toString2(); - endsWith_default2 = endsWith3; -}); - -// ../node_modules/lodash-es/_baseToPairs.js -function baseToPairs2(object4, props) { - return _arrayMap_default2(props, function(key) { - return [key, object4[key]]; - }); -} -var _baseToPairs_default2; -var init__baseToPairs2 = __esm(() => { - init__arrayMap2(); - _baseToPairs_default2 = baseToPairs2; -}); - -// ../node_modules/lodash-es/_setToPairs.js -function setToPairs2(set4) { - var index = -1, result2 = Array(set4.size); - set4.forEach(function(value) { - result2[++index] = [value, value]; - }); - return result2; -} -var _setToPairs_default2; -var init__setToPairs2 = __esm(() => { - _setToPairs_default2 = setToPairs2; -}); - -// ../node_modules/lodash-es/_createToPairs.js -function createToPairs2(keysFunc) { - return function(object4) { - var tag2 = _getTag_default2(object4); - if (tag2 == mapTag17) { - return _mapToArray_default2(object4); - } - if (tag2 == setTag17) { - return _setToPairs_default2(object4); - } - return _baseToPairs_default2(object4, keysFunc(object4)); - }; -} -var mapTag17 = "[object Map]", setTag17 = "[object Set]", _createToPairs_default2; -var init__createToPairs2 = __esm(() => { - init__baseToPairs2(); - init__getTag2(); - init__mapToArray2(); - init__setToPairs2(); - _createToPairs_default2 = createToPairs2; -}); - -// ../node_modules/lodash-es/toPairs.js -var toPairs2, toPairs_default2; -var init_toPairs2 = __esm(() => { - init__createToPairs2(); - init_keys3(); - toPairs2 = _createToPairs_default2(keys_default2); - toPairs_default2 = toPairs2; -}); - -// ../node_modules/lodash-es/entries.js -var init_entries2 = __esm(() => { - init_toPairs2(); -}); - -// ../node_modules/lodash-es/toPairsIn.js -var toPairsIn2, toPairsIn_default2; -var init_toPairsIn2 = __esm(() => { - init__createToPairs2(); - init_keysIn2(); - toPairsIn2 = _createToPairs_default2(keysIn_default2); - toPairsIn_default2 = toPairsIn2; -}); - -// ../node_modules/lodash-es/entriesIn.js -var init_entriesIn2 = __esm(() => { - init_toPairsIn2(); -}); - -// ../node_modules/lodash-es/_escapeHtmlChar.js -var htmlEscapes2, escapeHtmlChar2, _escapeHtmlChar_default2; -var init__escapeHtmlChar2 = __esm(() => { - init__basePropertyOf2(); - htmlEscapes2 = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'" - }; - escapeHtmlChar2 = _basePropertyOf_default2(htmlEscapes2); - _escapeHtmlChar_default2 = escapeHtmlChar2; -}); - -// ../node_modules/lodash-es/escape.js -function escape4(string5) { - string5 = toString_default2(string5); - return string5 && reHasUnescapedHtml2.test(string5) ? string5.replace(reUnescapedHtml2, _escapeHtmlChar_default2) : string5; -} -var reUnescapedHtml2, reHasUnescapedHtml2, escape_default2; -var init_escape3 = __esm(() => { - init__escapeHtmlChar2(); - init_toString2(); - reUnescapedHtml2 = /[&<>"']/g; - reHasUnescapedHtml2 = RegExp(reUnescapedHtml2.source); - escape_default2 = escape4; -}); - -// ../node_modules/lodash-es/escapeRegExp.js -function escapeRegExp3(string5) { - string5 = toString_default2(string5); - return string5 && reHasRegExpChar2.test(string5) ? string5.replace(reRegExpChar4, "\\$&") : string5; -} -var reRegExpChar4, reHasRegExpChar2, escapeRegExp_default2; -var init_escapeRegExp2 = __esm(() => { - init_toString2(); - reRegExpChar4 = /[\\^$.*+?()[\]{}|]/g; - reHasRegExpChar2 = RegExp(reRegExpChar4.source); - escapeRegExp_default2 = escapeRegExp3; -}); - -// ../node_modules/lodash-es/_arrayEvery.js -function arrayEvery2(array3, predicate) { - var index = -1, length = array3 == null ? 0 : array3.length; - while (++index < length) { - if (!predicate(array3[index], index, array3)) { - return false; - } - } - return true; -} -var _arrayEvery_default2; -var init__arrayEvery2 = __esm(() => { - _arrayEvery_default2 = arrayEvery2; -}); - -// ../node_modules/lodash-es/_baseEvery.js -function baseEvery2(collection, predicate) { - var result2 = true; - _baseEach_default2(collection, function(value, index, collection2) { - result2 = !!predicate(value, index, collection2); - return result2; - }); - return result2; -} -var _baseEvery_default2; -var init__baseEvery2 = __esm(() => { - init__baseEach2(); - _baseEvery_default2 = baseEvery2; -}); - -// ../node_modules/lodash-es/every.js -function every2(collection, predicate, guard) { - var func = isArray_default2(collection) ? _arrayEvery_default2 : _baseEvery_default2; - if (guard && _isIterateeCall_default2(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, _baseIteratee_default2(predicate, 3)); -} -var every_default2; -var init_every2 = __esm(() => { - init__arrayEvery2(); - init__baseEvery2(); - init__baseIteratee2(); - init_isArray2(); - init__isIterateeCall2(); - every_default2 = every2; -}); - -// ../node_modules/lodash-es/extend.js -var init_extend2 = __esm(() => { - init_assignIn2(); -}); - -// ../node_modules/lodash-es/extendWith.js -var init_extendWith2 = __esm(() => { - init_assignInWith2(); -}); - -// ../node_modules/lodash-es/toLength.js -function toLength2(value) { - return value ? _baseClamp_default2(toInteger_default2(value), 0, MAX_ARRAY_LENGTH9) : 0; -} -var MAX_ARRAY_LENGTH9 = 4294967295, toLength_default2; -var init_toLength2 = __esm(() => { - init__baseClamp2(); - init_toInteger2(); - toLength_default2 = toLength2; -}); - -// ../node_modules/lodash-es/_baseFill.js -function baseFill2(array3, value, start, end) { - var length = array3.length; - start = toInteger_default2(start); - if (start < 0) { - start = -start > length ? 0 : length + start; - } - end = end === undefined || end > length ? length : toInteger_default2(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength_default2(end); - while (start < end) { - array3[start++] = value; - } - return array3; -} -var _baseFill_default2; -var init__baseFill2 = __esm(() => { - init_toInteger2(); - init_toLength2(); - _baseFill_default2 = baseFill2; -}); - -// ../node_modules/lodash-es/fill.js -function fill2(array3, value, start, end) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return []; - } - if (start && typeof start != "number" && _isIterateeCall_default2(array3, value, start)) { - start = 0; - end = length; - } - return _baseFill_default2(array3, value, start, end); -} -var fill_default2; -var init_fill2 = __esm(() => { - init__baseFill2(); - init__isIterateeCall2(); - fill_default2 = fill2; -}); - -// ../node_modules/lodash-es/_baseFilter.js -function baseFilter2(collection, predicate) { - var result2 = []; - _baseEach_default2(collection, function(value, index, collection2) { - if (predicate(value, index, collection2)) { - result2.push(value); - } - }); - return result2; -} -var _baseFilter_default2; -var init__baseFilter2 = __esm(() => { - init__baseEach2(); - _baseFilter_default2 = baseFilter2; -}); - -// ../node_modules/lodash-es/filter.js -function filter3(collection, predicate) { - var func = isArray_default2(collection) ? _arrayFilter_default2 : _baseFilter_default2; - return func(collection, _baseIteratee_default2(predicate, 3)); -} -var filter_default2; -var init_filter2 = __esm(() => { - init__arrayFilter2(); - init__baseFilter2(); - init__baseIteratee2(); - init_isArray2(); - filter_default2 = filter3; -}); - -// ../node_modules/lodash-es/_createFind.js -function createFind2(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike_default2(collection)) { - var iteratee2 = _baseIteratee_default2(predicate, 3); - collection = keys_default2(collection); - predicate = function(key) { - return iteratee2(iterable[key], key, iterable); - }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined; - }; -} -var _createFind_default2; -var init__createFind2 = __esm(() => { - init__baseIteratee2(); - init_isArrayLike2(); - init_keys3(); - _createFind_default2 = createFind2; -}); - -// ../node_modules/lodash-es/findIndex.js -function findIndex2(array3, predicate, fromIndex) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger_default2(fromIndex); - if (index < 0) { - index = nativeMax24(length + index, 0); - } - return _baseFindIndex_default2(array3, _baseIteratee_default2(predicate, 3), index); -} -var nativeMax24, findIndex_default2; -var init_findIndex2 = __esm(() => { - init__baseFindIndex2(); - init__baseIteratee2(); - init_toInteger2(); - nativeMax24 = Math.max; - findIndex_default2 = findIndex2; -}); - -// ../node_modules/lodash-es/find.js -var find2, find_default2; -var init_find2 = __esm(() => { - init__createFind2(); - init_findIndex2(); - find2 = _createFind_default2(findIndex_default2); - find_default2 = find2; -}); - -// ../node_modules/lodash-es/_baseFindKey.js -function baseFindKey2(collection, predicate, eachFunc) { - var result2; - eachFunc(collection, function(value, key, collection2) { - if (predicate(value, key, collection2)) { - result2 = key; - return false; - } - }); - return result2; -} -var _baseFindKey_default2; -var init__baseFindKey2 = __esm(() => { - _baseFindKey_default2 = baseFindKey2; -}); - -// ../node_modules/lodash-es/findKey.js -function findKey3(object4, predicate) { - return _baseFindKey_default2(object4, _baseIteratee_default2(predicate, 3), _baseForOwn_default2); -} -var findKey_default2; -var init_findKey2 = __esm(() => { - init__baseFindKey2(); - init__baseForOwn2(); - init__baseIteratee2(); - findKey_default2 = findKey3; -}); - -// ../node_modules/lodash-es/findLastIndex.js -function findLastIndex2(array3, predicate, fromIndex) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger_default2(fromIndex); - index = fromIndex < 0 ? nativeMax25(length + index, 0) : nativeMin20(index, length - 1); - } - return _baseFindIndex_default2(array3, _baseIteratee_default2(predicate, 3), index, true); -} -var nativeMax25, nativeMin20, findLastIndex_default2; -var init_findLastIndex2 = __esm(() => { - init__baseFindIndex2(); - init__baseIteratee2(); - init_toInteger2(); - nativeMax25 = Math.max; - nativeMin20 = Math.min; - findLastIndex_default2 = findLastIndex2; -}); - -// ../node_modules/lodash-es/findLast.js -var findLast2, findLast_default2; -var init_findLast2 = __esm(() => { - init__createFind2(); - init_findLastIndex2(); - findLast2 = _createFind_default2(findLastIndex_default2); - findLast_default2 = findLast2; -}); - -// ../node_modules/lodash-es/findLastKey.js -function findLastKey2(object4, predicate) { - return _baseFindKey_default2(object4, _baseIteratee_default2(predicate, 3), _baseForOwnRight_default2); -} -var findLastKey_default2; -var init_findLastKey2 = __esm(() => { - init__baseFindKey2(); - init__baseForOwnRight2(); - init__baseIteratee2(); - findLastKey_default2 = findLastKey2; -}); - -// ../node_modules/lodash-es/head.js -function head2(array3) { - return array3 && array3.length ? array3[0] : undefined; -} -var head_default2; -var init_head2 = __esm(() => { - head_default2 = head2; -}); - -// ../node_modules/lodash-es/first.js -var init_first2 = __esm(() => { - init_head2(); -}); - -// ../node_modules/lodash-es/_baseMap.js -function baseMap2(collection, iteratee2) { - var index = -1, result2 = isArrayLike_default2(collection) ? Array(collection.length) : []; - _baseEach_default2(collection, function(value, key, collection2) { - result2[++index] = iteratee2(value, key, collection2); - }); - return result2; -} -var _baseMap_default2; -var init__baseMap2 = __esm(() => { - init__baseEach2(); - init_isArrayLike2(); - _baseMap_default2 = baseMap2; -}); - -// ../node_modules/lodash-es/map.js -function map5(collection, iteratee2) { - var func = isArray_default2(collection) ? _arrayMap_default2 : _baseMap_default2; - return func(collection, _baseIteratee_default2(iteratee2, 3)); -} -var map_default2; -var init_map3 = __esm(() => { - init__arrayMap2(); - init__baseIteratee2(); - init__baseMap2(); - init_isArray2(); - map_default2 = map5; -}); - -// ../node_modules/lodash-es/flatMap.js -function flatMap2(collection, iteratee2) { - return _baseFlatten_default2(map_default2(collection, iteratee2), 1); -} -var flatMap_default2; -var init_flatMap2 = __esm(() => { - init__baseFlatten2(); - init_map3(); - flatMap_default2 = flatMap2; -}); - -// ../node_modules/lodash-es/flatMapDeep.js -function flatMapDeep2(collection, iteratee2) { - return _baseFlatten_default2(map_default2(collection, iteratee2), INFINITY10); -} -var INFINITY10, flatMapDeep_default2; -var init_flatMapDeep2 = __esm(() => { - init__baseFlatten2(); - init_map3(); - INFINITY10 = 1 / 0; - flatMapDeep_default2 = flatMapDeep2; -}); - -// ../node_modules/lodash-es/flatMapDepth.js -function flatMapDepth2(collection, iteratee2, depth) { - depth = depth === undefined ? 1 : toInteger_default2(depth); - return _baseFlatten_default2(map_default2(collection, iteratee2), depth); -} -var flatMapDepth_default2; -var init_flatMapDepth2 = __esm(() => { - init__baseFlatten2(); - init_map3(); - init_toInteger2(); - flatMapDepth_default2 = flatMapDepth2; -}); - -// ../node_modules/lodash-es/flattenDeep.js -function flattenDeep2(array3) { - var length = array3 == null ? 0 : array3.length; - return length ? _baseFlatten_default2(array3, INFINITY11) : []; -} -var INFINITY11, flattenDeep_default2; -var init_flattenDeep2 = __esm(() => { - init__baseFlatten2(); - INFINITY11 = 1 / 0; - flattenDeep_default2 = flattenDeep2; -}); - -// ../node_modules/lodash-es/flattenDepth.js -function flattenDepth2(array3, depth) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger_default2(depth); - return _baseFlatten_default2(array3, depth); -} -var flattenDepth_default2; -var init_flattenDepth2 = __esm(() => { - init__baseFlatten2(); - init_toInteger2(); - flattenDepth_default2 = flattenDepth2; -}); - -// ../node_modules/lodash-es/flip.js -function flip2(func) { - return _createWrap_default2(func, WRAP_FLIP_FLAG6); -} -var WRAP_FLIP_FLAG6 = 512, flip_default2; -var init_flip2 = __esm(() => { - init__createWrap2(); - flip_default2 = flip2; -}); - -// ../node_modules/lodash-es/floor.js -var floor2, floor_default2; -var init_floor2 = __esm(() => { - init__createRound2(); - floor2 = _createRound_default2("floor"); - floor_default2 = floor2; -}); - -// ../node_modules/lodash-es/_createFlow.js -function createFlow2(fromRight) { - return _flatRest_default2(function(funcs) { - var length = funcs.length, index = length, prereq = _LodashWrapper_default2.prototype.thru; - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT20); - } - if (prereq && !wrapper && _getFuncName_default2(func) == "wrapper") { - var wrapper = new _LodashWrapper_default2([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - var funcName = _getFuncName_default2(func), data = funcName == "wrapper" ? _getData_default2(func) : undefined; - if (data && _isLaziable_default2(data[0]) && data[1] == (WRAP_ARY_FLAG10 | WRAP_CURRY_FLAG14 | WRAP_PARTIAL_FLAG13 | WRAP_REARG_FLAG7) && !data[4].length && data[9] == 1) { - wrapper = wrapper[_getFuncName_default2(data[0])].apply(wrapper, data[3]); - } else { - wrapper = func.length == 1 && _isLaziable_default2(func) ? wrapper[funcName]() : wrapper.thru(func); - } - } - return function() { - var args = arguments, value = args[0]; - if (wrapper && args.length == 1 && isArray_default2(value)) { - return wrapper.plant(value).value(); - } - var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value; - while (++index2 < length) { - result2 = funcs[index2].call(this, result2); - } - return result2; - }; - }); -} -var FUNC_ERROR_TEXT20 = "Expected a function", WRAP_CURRY_FLAG14 = 8, WRAP_PARTIAL_FLAG13 = 32, WRAP_ARY_FLAG10 = 128, WRAP_REARG_FLAG7 = 256, _createFlow_default2; -var init__createFlow2 = __esm(() => { - init__LodashWrapper2(); - init__flatRest2(); - init__getData2(); - init__getFuncName2(); - init_isArray2(); - init__isLaziable2(); - _createFlow_default2 = createFlow2; -}); - -// ../node_modules/lodash-es/flow.js -var flow2, flow_default2; -var init_flow2 = __esm(() => { - init__createFlow2(); - flow2 = _createFlow_default2(); - flow_default2 = flow2; -}); - -// ../node_modules/lodash-es/flowRight.js -var flowRight2, flowRight_default2; -var init_flowRight2 = __esm(() => { - init__createFlow2(); - flowRight2 = _createFlow_default2(true); - flowRight_default2 = flowRight2; -}); - -// ../node_modules/lodash-es/forIn.js -function forIn2(object4, iteratee2) { - return object4 == null ? object4 : _baseFor_default2(object4, _castFunction_default2(iteratee2), keysIn_default2); -} -var forIn_default2; -var init_forIn2 = __esm(() => { - init__baseFor2(); - init__castFunction2(); - init_keysIn2(); - forIn_default2 = forIn2; -}); - -// ../node_modules/lodash-es/forInRight.js -function forInRight2(object4, iteratee2) { - return object4 == null ? object4 : _baseForRight_default2(object4, _castFunction_default2(iteratee2), keysIn_default2); -} -var forInRight_default2; -var init_forInRight2 = __esm(() => { - init__baseForRight2(); - init__castFunction2(); - init_keysIn2(); - forInRight_default2 = forInRight2; -}); - -// ../node_modules/lodash-es/forOwn.js -function forOwn2(object4, iteratee2) { - return object4 && _baseForOwn_default2(object4, _castFunction_default2(iteratee2)); -} -var forOwn_default2; -var init_forOwn2 = __esm(() => { - init__baseForOwn2(); - init__castFunction2(); - forOwn_default2 = forOwn2; -}); - -// ../node_modules/lodash-es/forOwnRight.js -function forOwnRight2(object4, iteratee2) { - return object4 && _baseForOwnRight_default2(object4, _castFunction_default2(iteratee2)); -} -var forOwnRight_default2; -var init_forOwnRight2 = __esm(() => { - init__baseForOwnRight2(); - init__castFunction2(); - forOwnRight_default2 = forOwnRight2; -}); - -// ../node_modules/lodash-es/fromPairs.js -function fromPairs2(pairs) { - var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {}; - while (++index < length) { - var pair = pairs[index]; - result2[pair[0]] = pair[1]; - } - return result2; -} -var fromPairs_default2; -var init_fromPairs2 = __esm(() => { - fromPairs_default2 = fromPairs2; -}); - -// ../node_modules/lodash-es/_baseFunctions.js -function baseFunctions2(object4, props) { - return _arrayFilter_default2(props, function(key) { - return isFunction_default2(object4[key]); - }); -} -var _baseFunctions_default2; -var init__baseFunctions2 = __esm(() => { - init__arrayFilter2(); - init_isFunction2(); - _baseFunctions_default2 = baseFunctions2; -}); - -// ../node_modules/lodash-es/functions.js -function functions2(object4) { - return object4 == null ? [] : _baseFunctions_default2(object4, keys_default2(object4)); -} -var functions_default2; -var init_functions2 = __esm(() => { - init__baseFunctions2(); - init_keys3(); - functions_default2 = functions2; -}); - -// ../node_modules/lodash-es/functionsIn.js -function functionsIn2(object4) { - return object4 == null ? [] : _baseFunctions_default2(object4, keysIn_default2(object4)); -} -var functionsIn_default2; -var init_functionsIn2 = __esm(() => { - init__baseFunctions2(); - init_keysIn2(); - functionsIn_default2 = functionsIn2; -}); - -// ../node_modules/lodash-es/groupBy.js -var objectProto52, hasOwnProperty46, groupBy2, groupBy_default2; -var init_groupBy2 = __esm(() => { - init__baseAssignValue2(); - init__createAggregator2(); - objectProto52 = Object.prototype; - hasOwnProperty46 = objectProto52.hasOwnProperty; - groupBy2 = _createAggregator_default2(function(result2, value, key) { - if (hasOwnProperty46.call(result2, key)) { - result2[key].push(value); - } else { - _baseAssignValue_default2(result2, key, [value]); - } - }); - groupBy_default2 = groupBy2; -}); - -// ../node_modules/lodash-es/_baseGt.js -function baseGt2(value, other2) { - return value > other2; -} -var _baseGt_default2; -var init__baseGt2 = __esm(() => { - _baseGt_default2 = baseGt2; -}); - -// ../node_modules/lodash-es/_createRelationalOperation.js -function createRelationalOperation2(operator) { - return function(value, other2) { - if (!(typeof value == "string" && typeof other2 == "string")) { - value = toNumber_default2(value); - other2 = toNumber_default2(other2); - } - return operator(value, other2); - }; -} -var _createRelationalOperation_default2; -var init__createRelationalOperation2 = __esm(() => { - init_toNumber2(); - _createRelationalOperation_default2 = createRelationalOperation2; -}); - -// ../node_modules/lodash-es/gt.js -var gt3, gt_default2; -var init_gt2 = __esm(() => { - init__baseGt2(); - init__createRelationalOperation2(); - gt3 = _createRelationalOperation_default2(_baseGt_default2); - gt_default2 = gt3; -}); - -// ../node_modules/lodash-es/gte.js -var gte3, gte_default2; -var init_gte2 = __esm(() => { - init__createRelationalOperation2(); - gte3 = _createRelationalOperation_default2(function(value, other2) { - return value >= other2; - }); - gte_default2 = gte3; -}); - -// ../node_modules/lodash-es/_baseHas.js -function baseHas2(object4, key) { - return object4 != null && hasOwnProperty47.call(object4, key); -} -var objectProto53, hasOwnProperty47, _baseHas_default2; -var init__baseHas2 = __esm(() => { - objectProto53 = Object.prototype; - hasOwnProperty47 = objectProto53.hasOwnProperty; - _baseHas_default2 = baseHas2; -}); - -// ../node_modules/lodash-es/has.js -function has2(object4, path13) { - return object4 != null && _hasPath_default2(object4, path13, _baseHas_default2); -} -var has_default2; -var init_has2 = __esm(() => { - init__baseHas2(); - init__hasPath2(); - has_default2 = has2; -}); - -// ../node_modules/lodash-es/_baseInRange.js -function baseInRange2(number5, start, end) { - return number5 >= nativeMin21(start, end) && number5 < nativeMax26(start, end); -} -var nativeMax26, nativeMin21, _baseInRange_default2; -var init__baseInRange2 = __esm(() => { - nativeMax26 = Math.max; - nativeMin21 = Math.min; - _baseInRange_default2 = baseInRange2; -}); - -// ../node_modules/lodash-es/inRange.js -function inRange3(number5, start, end) { - start = toFinite_default2(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite_default2(end); - } - number5 = toNumber_default2(number5); - return _baseInRange_default2(number5, start, end); -} -var inRange_default2; -var init_inRange2 = __esm(() => { - init__baseInRange2(); - init_toFinite2(); - init_toNumber2(); - inRange_default2 = inRange3; -}); - -// ../node_modules/lodash-es/isString.js -function isString3(value) { - return typeof value == "string" || !isArray_default2(value) && isObjectLike_default2(value) && _baseGetTag_default2(value) == stringTag10; -} -var stringTag10 = "[object String]", isString_default2; -var init_isString2 = __esm(() => { - init__baseGetTag2(); - init_isArray2(); - init_isObjectLike2(); - isString_default2 = isString3; -}); - -// ../node_modules/lodash-es/_baseValues.js -function baseValues2(object4, props) { - return _arrayMap_default2(props, function(key) { - return object4[key]; - }); -} -var _baseValues_default2; -var init__baseValues2 = __esm(() => { - init__arrayMap2(); - _baseValues_default2 = baseValues2; -}); - -// ../node_modules/lodash-es/values.js -function values3(object4) { - return object4 == null ? [] : _baseValues_default2(object4, keys_default2(object4)); -} -var values_default2; -var init_values8 = __esm(() => { - init__baseValues2(); - init_keys3(); - values_default2 = values3; -}); - -// ../node_modules/lodash-es/includes.js -function includes2(collection, value, fromIndex, guard) { - collection = isArrayLike_default2(collection) ? collection : values_default2(collection); - fromIndex = fromIndex && !guard ? toInteger_default2(fromIndex) : 0; - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax27(length + fromIndex, 0); - } - return isString_default2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && _baseIndexOf_default2(collection, value, fromIndex) > -1; -} -var nativeMax27, includes_default2; -var init_includes2 = __esm(() => { - init__baseIndexOf2(); - init_isArrayLike2(); - init_isString2(); - init_toInteger2(); - init_values8(); - nativeMax27 = Math.max; - includes_default2 = includes2; -}); - -// ../node_modules/lodash-es/indexOf.js -function indexOf2(array3, value, fromIndex) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger_default2(fromIndex); - if (index < 0) { - index = nativeMax28(length + index, 0); - } - return _baseIndexOf_default2(array3, value, index); -} -var nativeMax28, indexOf_default2; -var init_indexOf2 = __esm(() => { - init__baseIndexOf2(); - init_toInteger2(); - nativeMax28 = Math.max; - indexOf_default2 = indexOf2; -}); - -// ../node_modules/lodash-es/initial.js -function initial2(array3) { - var length = array3 == null ? 0 : array3.length; - return length ? _baseSlice_default2(array3, 0, -1) : []; -} -var initial_default2; -var init_initial2 = __esm(() => { - init__baseSlice2(); - initial_default2 = initial2; -}); - -// ../node_modules/lodash-es/_baseIntersection.js -function baseIntersection2(arrays, iteratee2, comparator) { - var includes3 = comparator ? _arrayIncludesWith_default2 : _arrayIncludes_default2, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result2 = []; - while (othIndex--) { - var array3 = arrays[othIndex]; - if (othIndex && iteratee2) { - array3 = _arrayMap_default2(array3, _baseUnary_default2(iteratee2)); - } - maxLength = nativeMin22(array3.length, maxLength); - caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array3.length >= 120) ? new _SetCache_default2(othIndex && array3) : undefined; - } - array3 = arrays[0]; - var index = -1, seen = caches[0]; - outer: - while (++index < length && result2.length < maxLength) { - var value = array3[index], computed = iteratee2 ? iteratee2(value) : value; - value = comparator || value !== 0 ? value : 0; - if (!(seen ? _cacheHas_default2(seen, computed) : includes3(result2, computed, comparator))) { - othIndex = othLength; - while (--othIndex) { - var cache3 = caches[othIndex]; - if (!(cache3 ? _cacheHas_default2(cache3, computed) : includes3(arrays[othIndex], computed, comparator))) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result2.push(value); - } - } - return result2; -} -var nativeMin22, _baseIntersection_default2; -var init__baseIntersection2 = __esm(() => { - init__SetCache2(); - init__arrayIncludes2(); - init__arrayIncludesWith2(); - init__arrayMap2(); - init__baseUnary2(); - init__cacheHas2(); - nativeMin22 = Math.min; - _baseIntersection_default2 = baseIntersection2; -}); - -// ../node_modules/lodash-es/_castArrayLikeObject.js -function castArrayLikeObject2(value) { - return isArrayLikeObject_default2(value) ? value : []; -} -var _castArrayLikeObject_default2; -var init__castArrayLikeObject2 = __esm(() => { - init_isArrayLikeObject2(); - _castArrayLikeObject_default2 = castArrayLikeObject2; -}); - -// ../node_modules/lodash-es/intersection.js -var intersection4, intersection_default2; -var init_intersection3 = __esm(() => { - init__arrayMap2(); - init__baseIntersection2(); - init__baseRest2(); - init__castArrayLikeObject2(); - intersection4 = _baseRest_default2(function(arrays) { - var mapped = _arrayMap_default2(arrays, _castArrayLikeObject_default2); - return mapped.length && mapped[0] === arrays[0] ? _baseIntersection_default2(mapped) : []; - }); - intersection_default2 = intersection4; -}); - -// ../node_modules/lodash-es/intersectionBy.js -var intersectionBy2, intersectionBy_default2; -var init_intersectionBy2 = __esm(() => { - init__arrayMap2(); - init__baseIntersection2(); - init__baseIteratee2(); - init__baseRest2(); - init__castArrayLikeObject2(); - init_last2(); - intersectionBy2 = _baseRest_default2(function(arrays) { - var iteratee2 = last_default2(arrays), mapped = _arrayMap_default2(arrays, _castArrayLikeObject_default2); - if (iteratee2 === last_default2(mapped)) { - iteratee2 = undefined; - } else { - mapped.pop(); - } - return mapped.length && mapped[0] === arrays[0] ? _baseIntersection_default2(mapped, _baseIteratee_default2(iteratee2, 2)) : []; - }); - intersectionBy_default2 = intersectionBy2; -}); - -// ../node_modules/lodash-es/intersectionWith.js -var intersectionWith2, intersectionWith_default2; -var init_intersectionWith2 = __esm(() => { - init__arrayMap2(); - init__baseIntersection2(); - init__baseRest2(); - init__castArrayLikeObject2(); - init_last2(); - intersectionWith2 = _baseRest_default2(function(arrays) { - var comparator = last_default2(arrays), mapped = _arrayMap_default2(arrays, _castArrayLikeObject_default2); - comparator = typeof comparator == "function" ? comparator : undefined; - if (comparator) { - mapped.pop(); - } - return mapped.length && mapped[0] === arrays[0] ? _baseIntersection_default2(mapped, undefined, comparator) : []; - }); - intersectionWith_default2 = intersectionWith2; -}); - -// ../node_modules/lodash-es/_baseInverter.js -function baseInverter2(object4, setter, iteratee2, accumulator) { - _baseForOwn_default2(object4, function(value, key, object5) { - setter(accumulator, iteratee2(value), key, object5); - }); - return accumulator; -} -var _baseInverter_default2; -var init__baseInverter2 = __esm(() => { - init__baseForOwn2(); - _baseInverter_default2 = baseInverter2; -}); - -// ../node_modules/lodash-es/_createInverter.js -function createInverter2(setter, toIteratee) { - return function(object4, iteratee2) { - return _baseInverter_default2(object4, setter, toIteratee(iteratee2), {}); - }; -} -var _createInverter_default2; -var init__createInverter2 = __esm(() => { - init__baseInverter2(); - _createInverter_default2 = createInverter2; -}); - -// ../node_modules/lodash-es/invert.js -var objectProto54, nativeObjectToString7, invert2, invert_default2; -var init_invert2 = __esm(() => { - init_constant2(); - init__createInverter2(); - init_identity3(); - objectProto54 = Object.prototype; - nativeObjectToString7 = objectProto54.toString; - invert2 = _createInverter_default2(function(result2, value, key) { - if (value != null && typeof value.toString != "function") { - value = nativeObjectToString7.call(value); - } - result2[value] = key; - }, constant_default2(identity_default3)); - invert_default2 = invert2; -}); - -// ../node_modules/lodash-es/invertBy.js -var objectProto55, hasOwnProperty48, nativeObjectToString8, invertBy2, invertBy_default2; -var init_invertBy2 = __esm(() => { - init__baseIteratee2(); - init__createInverter2(); - objectProto55 = Object.prototype; - hasOwnProperty48 = objectProto55.hasOwnProperty; - nativeObjectToString8 = objectProto55.toString; - invertBy2 = _createInverter_default2(function(result2, value, key) { - if (value != null && typeof value.toString != "function") { - value = nativeObjectToString8.call(value); - } - if (hasOwnProperty48.call(result2, value)) { - result2[value].push(key); - } else { - result2[value] = [key]; - } - }, _baseIteratee_default2); - invertBy_default2 = invertBy2; -}); - -// ../node_modules/lodash-es/_parent.js -function parent2(object4, path13) { - return path13.length < 2 ? object4 : _baseGet_default2(object4, _baseSlice_default2(path13, 0, -1)); -} -var _parent_default2; -var init__parent2 = __esm(() => { - init__baseGet2(); - init__baseSlice2(); - _parent_default2 = parent2; -}); - -// ../node_modules/lodash-es/_baseInvoke.js -function baseInvoke2(object4, path13, args) { - path13 = _castPath_default2(path13, object4); - object4 = _parent_default2(object4, path13); - var func = object4 == null ? object4 : object4[_toKey_default2(last_default2(path13))]; - return func == null ? undefined : _apply_default2(func, object4, args); -} -var _baseInvoke_default2; -var init__baseInvoke2 = __esm(() => { - init__apply2(); - init__castPath2(); - init_last2(); - init__parent2(); - init__toKey2(); - _baseInvoke_default2 = baseInvoke2; -}); - -// ../node_modules/lodash-es/invoke.js -var invoke2, invoke_default2; -var init_invoke2 = __esm(() => { - init__baseInvoke2(); - init__baseRest2(); - invoke2 = _baseRest_default2(_baseInvoke_default2); - invoke_default2 = invoke2; -}); - -// ../node_modules/lodash-es/invokeMap.js -var invokeMap2, invokeMap_default2; -var init_invokeMap2 = __esm(() => { - init__apply2(); - init__baseEach2(); - init__baseInvoke2(); - init__baseRest2(); - init_isArrayLike2(); - invokeMap2 = _baseRest_default2(function(collection, path13, args) { - var index = -1, isFunc = typeof path13 == "function", result2 = isArrayLike_default2(collection) ? Array(collection.length) : []; - _baseEach_default2(collection, function(value) { - result2[++index] = isFunc ? _apply_default2(path13, value, args) : _baseInvoke_default2(value, path13, args); - }); - return result2; - }); - invokeMap_default2 = invokeMap2; -}); - -// ../node_modules/lodash-es/_baseIsArrayBuffer.js -function baseIsArrayBuffer2(value) { - return isObjectLike_default2(value) && _baseGetTag_default2(value) == arrayBufferTag10; -} -var arrayBufferTag10 = "[object ArrayBuffer]", _baseIsArrayBuffer_default2; -var init__baseIsArrayBuffer2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - _baseIsArrayBuffer_default2 = baseIsArrayBuffer2; -}); - -// ../node_modules/lodash-es/isArrayBuffer.js -var nodeIsArrayBuffer2, isArrayBuffer4, isArrayBuffer_default2; -var init_isArrayBuffer2 = __esm(() => { - init__baseIsArrayBuffer2(); - init__baseUnary2(); - init__nodeUtil2(); - nodeIsArrayBuffer2 = _nodeUtil_default2 && _nodeUtil_default2.isArrayBuffer; - isArrayBuffer4 = nodeIsArrayBuffer2 ? _baseUnary_default2(nodeIsArrayBuffer2) : _baseIsArrayBuffer_default2; - isArrayBuffer_default2 = isArrayBuffer4; -}); - -// ../node_modules/lodash-es/isBoolean.js -function isBoolean3(value) { - return value === true || value === false || isObjectLike_default2(value) && _baseGetTag_default2(value) == boolTag10; -} -var boolTag10 = "[object Boolean]", isBoolean_default2; -var init_isBoolean2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - isBoolean_default2 = isBoolean3; -}); - -// ../node_modules/lodash-es/_baseIsDate.js -function baseIsDate2(value) { - return isObjectLike_default2(value) && _baseGetTag_default2(value) == dateTag10; -} -var dateTag10 = "[object Date]", _baseIsDate_default2; -var init__baseIsDate2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - _baseIsDate_default2 = baseIsDate2; -}); - -// ../node_modules/lodash-es/isDate.js -var nodeIsDate2, isDate3, isDate_default2; -var init_isDate2 = __esm(() => { - init__baseIsDate2(); - init__baseUnary2(); - init__nodeUtil2(); - nodeIsDate2 = _nodeUtil_default2 && _nodeUtil_default2.isDate; - isDate3 = nodeIsDate2 ? _baseUnary_default2(nodeIsDate2) : _baseIsDate_default2; - isDate_default2 = isDate3; -}); - -// ../node_modules/lodash-es/isElement.js -function isElement2(value) { - return isObjectLike_default2(value) && value.nodeType === 1 && !isPlainObject_default2(value); -} -var isElement_default2; -var init_isElement2 = __esm(() => { - init_isObjectLike2(); - init_isPlainObject2(); - isElement_default2 = isElement2; -}); - -// ../node_modules/lodash-es/isEmpty.js -function isEmpty2(value) { - if (value == null) { - return true; - } - if (isArrayLike_default2(value) && (isArray_default2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer_default2(value) || isTypedArray_default2(value) || isArguments_default2(value))) { - return !value.length; - } - var tag2 = _getTag_default2(value); - if (tag2 == mapTag18 || tag2 == setTag18) { - return !value.size; - } - if (_isPrototype_default2(value)) { - return !_baseKeys_default2(value).length; - } - for (var key in value) { - if (hasOwnProperty49.call(value, key)) { - return false; - } - } - return true; -} -var mapTag18 = "[object Map]", setTag18 = "[object Set]", objectProto56, hasOwnProperty49, isEmpty_default2; -var init_isEmpty2 = __esm(() => { - init__baseKeys2(); - init__getTag2(); - init_isArguments2(); - init_isArray2(); - init_isArrayLike2(); - init_isBuffer2(); - init__isPrototype2(); - init_isTypedArray2(); - objectProto56 = Object.prototype; - hasOwnProperty49 = objectProto56.hasOwnProperty; - isEmpty_default2 = isEmpty2; -}); - -// ../node_modules/lodash-es/isEqual.js -function isEqual2(value, other2) { - return _baseIsEqual_default2(value, other2); -} -var isEqual_default2; -var init_isEqual2 = __esm(() => { - init__baseIsEqual2(); - isEqual_default2 = isEqual2; -}); - -// ../node_modules/lodash-es/isEqualWith.js -function isEqualWith2(value, other2, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined; - var result2 = customizer ? customizer(value, other2) : undefined; - return result2 === undefined ? _baseIsEqual_default2(value, other2, undefined, customizer) : !!result2; -} -var isEqualWith_default2; -var init_isEqualWith2 = __esm(() => { - init__baseIsEqual2(); - isEqualWith_default2 = isEqualWith2; -}); - -// ../node_modules/lodash-es/isFinite.js -function isFinite3(value) { - return typeof value == "number" && nativeIsFinite4(value); -} -var nativeIsFinite4, isFinite_default2; -var init_isFinite2 = __esm(() => { - init__root2(); - nativeIsFinite4 = _root_default2.isFinite; - isFinite_default2 = isFinite3; -}); - -// ../node_modules/lodash-es/isInteger.js -function isInteger2(value) { - return typeof value == "number" && value == toInteger_default2(value); -} -var isInteger_default2; -var init_isInteger2 = __esm(() => { - init_toInteger2(); - isInteger_default2 = isInteger2; -}); - -// ../node_modules/lodash-es/isMatch.js -function isMatch2(object4, source) { - return object4 === source || _baseIsMatch_default2(object4, source, _getMatchData_default2(source)); -} -var isMatch_default2; -var init_isMatch2 = __esm(() => { - init__baseIsMatch2(); - init__getMatchData2(); - isMatch_default2 = isMatch2; -}); - -// ../node_modules/lodash-es/isMatchWith.js -function isMatchWith2(object4, source, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined; - return _baseIsMatch_default2(object4, source, _getMatchData_default2(source), customizer); -} -var isMatchWith_default2; -var init_isMatchWith2 = __esm(() => { - init__baseIsMatch2(); - init__getMatchData2(); - isMatchWith_default2 = isMatchWith2; -}); - -// ../node_modules/lodash-es/isNumber.js -function isNumber3(value) { - return typeof value == "number" || isObjectLike_default2(value) && _baseGetTag_default2(value) == numberTag10; -} -var numberTag10 = "[object Number]", isNumber_default2; -var init_isNumber2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - isNumber_default2 = isNumber3; -}); - -// ../node_modules/lodash-es/isNaN.js -function isNaN3(value) { - return isNumber_default2(value) && value != +value; -} -var isNaN_default2; -var init_isNaN2 = __esm(() => { - init_isNumber2(); - isNaN_default2 = isNaN3; -}); - -// ../node_modules/lodash-es/_isMaskable.js -var isMaskable2, _isMaskable_default2; -var init__isMaskable2 = __esm(() => { - init__coreJsData2(); - init_isFunction2(); - init_stubFalse2(); - isMaskable2 = _coreJsData_default2 ? isFunction_default2 : stubFalse_default2; - _isMaskable_default2 = isMaskable2; -}); - -// ../node_modules/lodash-es/isNative.js -function isNative2(value) { - if (_isMaskable_default2(value)) { - throw new Error(CORE_ERROR_TEXT2); - } - return _baseIsNative_default2(value); -} -var CORE_ERROR_TEXT2 = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", isNative_default2; -var init_isNative2 = __esm(() => { - init__baseIsNative2(); - init__isMaskable2(); - isNative_default2 = isNative2; -}); - -// ../node_modules/lodash-es/isNil.js -function isNil2(value) { - return value == null; -} -var isNil_default2; -var init_isNil2 = __esm(() => { - isNil_default2 = isNil2; -}); - -// ../node_modules/lodash-es/isNull.js -function isNull2(value) { - return value === null; -} -var isNull_default2; -var init_isNull2 = __esm(() => { - isNull_default2 = isNull2; -}); - -// ../node_modules/lodash-es/_baseIsRegExp.js -function baseIsRegExp2(value) { - return isObjectLike_default2(value) && _baseGetTag_default2(value) == regexpTag10; -} -var regexpTag10 = "[object RegExp]", _baseIsRegExp_default2; -var init__baseIsRegExp2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - _baseIsRegExp_default2 = baseIsRegExp2; -}); - -// ../node_modules/lodash-es/isRegExp.js -var nodeIsRegExp2, isRegExp3, isRegExp_default2; -var init_isRegExp2 = __esm(() => { - init__baseIsRegExp2(); - init__baseUnary2(); - init__nodeUtil2(); - nodeIsRegExp2 = _nodeUtil_default2 && _nodeUtil_default2.isRegExp; - isRegExp3 = nodeIsRegExp2 ? _baseUnary_default2(nodeIsRegExp2) : _baseIsRegExp_default2; - isRegExp_default2 = isRegExp3; -}); - -// ../node_modules/lodash-es/isSafeInteger.js -function isSafeInteger2(value) { - return isInteger_default2(value) && value >= -MAX_SAFE_INTEGER9 && value <= MAX_SAFE_INTEGER9; -} -var MAX_SAFE_INTEGER9 = 9007199254740991, isSafeInteger_default2; -var init_isSafeInteger2 = __esm(() => { - init_isInteger2(); - isSafeInteger_default2 = isSafeInteger2; -}); - -// ../node_modules/lodash-es/isUndefined.js -function isUndefined3(value) { - return value === undefined; -} -var isUndefined_default2; -var init_isUndefined2 = __esm(() => { - isUndefined_default2 = isUndefined3; -}); - -// ../node_modules/lodash-es/isWeakMap.js -function isWeakMap2(value) { - return isObjectLike_default2(value) && _getTag_default2(value) == weakMapTag8; -} -var weakMapTag8 = "[object WeakMap]", isWeakMap_default2; -var init_isWeakMap2 = __esm(() => { - init__getTag2(); - init_isObjectLike2(); - isWeakMap_default2 = isWeakMap2; -}); - -// ../node_modules/lodash-es/isWeakSet.js -function isWeakSet2(value) { - return isObjectLike_default2(value) && _baseGetTag_default2(value) == weakSetTag2; -} -var weakSetTag2 = "[object WeakSet]", isWeakSet_default2; -var init_isWeakSet2 = __esm(() => { - init__baseGetTag2(); - init_isObjectLike2(); - isWeakSet_default2 = isWeakSet2; -}); - -// ../node_modules/lodash-es/iteratee.js -function iteratee2(func) { - return _baseIteratee_default2(typeof func == "function" ? func : _baseClone_default2(func, CLONE_DEEP_FLAG13)); -} -var CLONE_DEEP_FLAG13 = 1, iteratee_default2; -var init_iteratee2 = __esm(() => { - init__baseClone2(); - init__baseIteratee2(); - iteratee_default2 = iteratee2; -}); - -// ../node_modules/lodash-es/join.js -function join36(array3, separator) { - return array3 == null ? "" : nativeJoin2.call(array3, separator); -} -var arrayProto8, nativeJoin2, join_default2; -var init_join2 = __esm(() => { - arrayProto8 = Array.prototype; - nativeJoin2 = arrayProto8.join; - join_default2 = join36; -}); - -// ../node_modules/lodash-es/kebabCase.js -var kebabCase2, kebabCase_default2; -var init_kebabCase2 = __esm(() => { - init__createCompounder2(); - kebabCase2 = _createCompounder_default2(function(result2, word, index) { - return result2 + (index ? "-" : "") + word.toLowerCase(); - }); - kebabCase_default2 = kebabCase2; -}); - -// ../node_modules/lodash-es/keyBy.js -var keyBy2, keyBy_default2; -var init_keyBy2 = __esm(() => { - init__baseAssignValue2(); - init__createAggregator2(); - keyBy2 = _createAggregator_default2(function(result2, value, key) { - _baseAssignValue_default2(result2, key, value); - }); - keyBy_default2 = keyBy2; -}); - -// ../node_modules/lodash-es/_strictLastIndexOf.js -function strictLastIndexOf2(array3, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array3[index] === value) { - return index; - } - } - return index; -} -var _strictLastIndexOf_default2; -var init__strictLastIndexOf2 = __esm(() => { - _strictLastIndexOf_default2 = strictLastIndexOf2; -}); - -// ../node_modules/lodash-es/lastIndexOf.js -function lastIndexOf2(array3, value, fromIndex) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger_default2(fromIndex); - index = index < 0 ? nativeMax29(length + index, 0) : nativeMin23(index, length - 1); - } - return value === value ? _strictLastIndexOf_default2(array3, value, index) : _baseFindIndex_default2(array3, _baseIsNaN_default2, index, true); -} -var nativeMax29, nativeMin23, lastIndexOf_default2; -var init_lastIndexOf2 = __esm(() => { - init__baseFindIndex2(); - init__baseIsNaN2(); - init__strictLastIndexOf2(); - init_toInteger2(); - nativeMax29 = Math.max; - nativeMin23 = Math.min; - lastIndexOf_default2 = lastIndexOf2; -}); - -// ../node_modules/lodash-es/lowerCase.js -var lowerCase2, lowerCase_default2; -var init_lowerCase2 = __esm(() => { - init__createCompounder2(); - lowerCase2 = _createCompounder_default2(function(result2, word, index) { - return result2 + (index ? " " : "") + word.toLowerCase(); - }); - lowerCase_default2 = lowerCase2; -}); - -// ../node_modules/lodash-es/lowerFirst.js -var lowerFirst2, lowerFirst_default2; -var init_lowerFirst2 = __esm(() => { - init__createCaseFirst2(); - lowerFirst2 = _createCaseFirst_default2("toLowerCase"); - lowerFirst_default2 = lowerFirst2; -}); - -// ../node_modules/lodash-es/_baseLt.js -function baseLt2(value, other2) { - return value < other2; -} -var _baseLt_default2; -var init__baseLt2 = __esm(() => { - _baseLt_default2 = baseLt2; -}); - -// ../node_modules/lodash-es/lt.js -var lt3, lt_default2; -var init_lt2 = __esm(() => { - init__baseLt2(); - init__createRelationalOperation2(); - lt3 = _createRelationalOperation_default2(_baseLt_default2); - lt_default2 = lt3; -}); - -// ../node_modules/lodash-es/lte.js -var lte2, lte_default2; -var init_lte2 = __esm(() => { - init__createRelationalOperation2(); - lte2 = _createRelationalOperation_default2(function(value, other2) { - return value <= other2; - }); - lte_default2 = lte2; -}); - -// ../node_modules/lodash-es/mapKeys.js -function mapKeys2(object4, iteratee3) { - var result2 = {}; - iteratee3 = _baseIteratee_default2(iteratee3, 3); - _baseForOwn_default2(object4, function(value, key, object5) { - _baseAssignValue_default2(result2, iteratee3(value, key, object5), value); - }); - return result2; -} -var mapKeys_default2; -var init_mapKeys2 = __esm(() => { - init__baseAssignValue2(); - init__baseForOwn2(); - init__baseIteratee2(); - mapKeys_default2 = mapKeys2; -}); - -// ../node_modules/lodash-es/mapValues.js -function mapValues2(object4, iteratee3) { - var result2 = {}; - iteratee3 = _baseIteratee_default2(iteratee3, 3); - _baseForOwn_default2(object4, function(value, key, object5) { - _baseAssignValue_default2(result2, key, iteratee3(value, key, object5)); - }); - return result2; -} -var mapValues_default2; -var init_mapValues2 = __esm(() => { - init__baseAssignValue2(); - init__baseForOwn2(); - init__baseIteratee2(); - mapValues_default2 = mapValues2; -}); - -// ../node_modules/lodash-es/matches.js -function matches2(source) { - return _baseMatches_default2(_baseClone_default2(source, CLONE_DEEP_FLAG14)); -} -var CLONE_DEEP_FLAG14 = 1, matches_default2; -var init_matches2 = __esm(() => { - init__baseClone2(); - init__baseMatches2(); - matches_default2 = matches2; -}); - -// ../node_modules/lodash-es/matchesProperty.js -function matchesProperty2(path13, srcValue) { - return _baseMatchesProperty_default2(path13, _baseClone_default2(srcValue, CLONE_DEEP_FLAG15)); -} -var CLONE_DEEP_FLAG15 = 1, matchesProperty_default2; -var init_matchesProperty2 = __esm(() => { - init__baseClone2(); - init__baseMatchesProperty2(); - matchesProperty_default2 = matchesProperty2; -}); - -// ../node_modules/lodash-es/_baseExtremum.js -function baseExtremum2(array3, iteratee3, comparator) { - var index = -1, length = array3.length; - while (++index < length) { - var value = array3[index], current = iteratee3(value); - if (current != null && (computed === undefined ? current === current && !isSymbol_default2(current) : comparator(current, computed))) { - var computed = current, result2 = value; - } - } - return result2; -} -var _baseExtremum_default2; -var init__baseExtremum2 = __esm(() => { - init_isSymbol2(); - _baseExtremum_default2 = baseExtremum2; -}); - -// ../node_modules/lodash-es/max.js -function max2(array3) { - return array3 && array3.length ? _baseExtremum_default2(array3, identity_default3, _baseGt_default2) : undefined; -} -var max_default2; -var init_max2 = __esm(() => { - init__baseExtremum2(); - init__baseGt2(); - init_identity3(); - max_default2 = max2; -}); - -// ../node_modules/lodash-es/maxBy.js -function maxBy2(array3, iteratee3) { - return array3 && array3.length ? _baseExtremum_default2(array3, _baseIteratee_default2(iteratee3, 2), _baseGt_default2) : undefined; -} -var maxBy_default2; -var init_maxBy2 = __esm(() => { - init__baseExtremum2(); - init__baseGt2(); - init__baseIteratee2(); - maxBy_default2 = maxBy2; -}); - -// ../node_modules/lodash-es/_baseSum.js -function baseSum2(array3, iteratee3) { - var result2, index = -1, length = array3.length; - while (++index < length) { - var current = iteratee3(array3[index]); - if (current !== undefined) { - result2 = result2 === undefined ? current : result2 + current; - } - } - return result2; -} -var _baseSum_default2; -var init__baseSum2 = __esm(() => { - _baseSum_default2 = baseSum2; -}); - -// ../node_modules/lodash-es/_baseMean.js -function baseMean2(array3, iteratee3) { - var length = array3 == null ? 0 : array3.length; - return length ? _baseSum_default2(array3, iteratee3) / length : NAN6; -} -var NAN6, _baseMean_default2; -var init__baseMean2 = __esm(() => { - init__baseSum2(); - NAN6 = 0 / 0; - _baseMean_default2 = baseMean2; -}); - -// ../node_modules/lodash-es/mean.js -function mean2(array3) { - return _baseMean_default2(array3, identity_default3); -} -var mean_default2; -var init_mean2 = __esm(() => { - init__baseMean2(); - init_identity3(); - mean_default2 = mean2; -}); - -// ../node_modules/lodash-es/meanBy.js -function meanBy2(array3, iteratee3) { - return _baseMean_default2(array3, _baseIteratee_default2(iteratee3, 2)); -} -var meanBy_default2; -var init_meanBy2 = __esm(() => { - init__baseIteratee2(); - init__baseMean2(); - meanBy_default2 = meanBy2; -}); - -// ../node_modules/lodash-es/merge.js -var merge4, merge_default2; -var init_merge2 = __esm(() => { - init__baseMerge2(); - init__createAssigner2(); - merge4 = _createAssigner_default2(function(object4, source, srcIndex) { - _baseMerge_default2(object4, source, srcIndex); - }); - merge_default2 = merge4; -}); - -// ../node_modules/lodash-es/method.js -var method2, method_default2; -var init_method2 = __esm(() => { - init__baseInvoke2(); - init__baseRest2(); - method2 = _baseRest_default2(function(path13, args) { - return function(object4) { - return _baseInvoke_default2(object4, path13, args); - }; - }); - method_default2 = method2; -}); - -// ../node_modules/lodash-es/methodOf.js -var methodOf2, methodOf_default2; -var init_methodOf2 = __esm(() => { - init__baseInvoke2(); - init__baseRest2(); - methodOf2 = _baseRest_default2(function(object4, args) { - return function(path13) { - return _baseInvoke_default2(object4, path13, args); - }; - }); - methodOf_default2 = methodOf2; -}); - -// ../node_modules/lodash-es/min.js -function min2(array3) { - return array3 && array3.length ? _baseExtremum_default2(array3, identity_default3, _baseLt_default2) : undefined; -} -var min_default2; -var init_min2 = __esm(() => { - init__baseExtremum2(); - init__baseLt2(); - init_identity3(); - min_default2 = min2; -}); - -// ../node_modules/lodash-es/minBy.js -function minBy2(array3, iteratee3) { - return array3 && array3.length ? _baseExtremum_default2(array3, _baseIteratee_default2(iteratee3, 2), _baseLt_default2) : undefined; -} -var minBy_default2; -var init_minBy2 = __esm(() => { - init__baseExtremum2(); - init__baseIteratee2(); - init__baseLt2(); - minBy_default2 = minBy2; -}); - -// ../node_modules/lodash-es/mixin.js -function mixin3(object4, source, options2) { - var props = keys_default2(source), methodNames = _baseFunctions_default2(source, props); - var chain3 = !(isObject_default2(options2) && ("chain" in options2)) || !!options2.chain, isFunc = isFunction_default2(object4); - _arrayEach_default2(methodNames, function(methodName) { - var func = source[methodName]; - object4[methodName] = func; - if (isFunc) { - object4.prototype[methodName] = function() { - var chainAll = this.__chain__; - if (chain3 || chainAll) { - var result2 = object4(this.__wrapped__), actions = result2.__actions__ = _copyArray_default2(this.__actions__); - actions.push({ func, args: arguments, thisArg: object4 }); - result2.__chain__ = chainAll; - return result2; - } - return func.apply(object4, _arrayPush_default2([this.value()], arguments)); - }; - } - }); - return object4; -} -var mixin_default2; -var init_mixin2 = __esm(() => { - init__arrayEach2(); - init__arrayPush2(); - init__baseFunctions2(); - init__copyArray2(); - init_isFunction2(); - init_isObject2(); - init_keys3(); - mixin_default2 = mixin3; -}); - -// ../node_modules/lodash-es/multiply.js -var multiply2, multiply_default2; -var init_multiply2 = __esm(() => { - init__createMathOperation2(); - multiply2 = _createMathOperation_default2(function(multiplier, multiplicand) { - return multiplier * multiplicand; - }, 1); - multiply_default2 = multiply2; -}); - -// ../node_modules/lodash-es/negate.js -function negate2(predicate) { - if (typeof predicate != "function") { - throw new TypeError(FUNC_ERROR_TEXT21); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: - return !predicate.call(this); - case 1: - return !predicate.call(this, args[0]); - case 2: - return !predicate.call(this, args[0], args[1]); - case 3: - return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; -} -var FUNC_ERROR_TEXT21 = "Expected a function", negate_default2; -var init_negate2 = __esm(() => { - negate_default2 = negate2; -}); - -// ../node_modules/lodash-es/_iteratorToArray.js -function iteratorToArray2(iterator2) { - var data, result2 = []; - while (!(data = iterator2.next()).done) { - result2.push(data.value); - } - return result2; -} -var _iteratorToArray_default2; -var init__iteratorToArray2 = __esm(() => { - _iteratorToArray_default2 = iteratorToArray2; -}); - -// ../node_modules/lodash-es/toArray.js -function toArray3(value) { - if (!value) { - return []; - } - if (isArrayLike_default2(value)) { - return isString_default2(value) ? _stringToArray_default2(value) : _copyArray_default2(value); - } - if (symIterator3 && value[symIterator3]) { - return _iteratorToArray_default2(value[symIterator3]()); - } - var tag2 = _getTag_default2(value), func = tag2 == mapTag19 ? _mapToArray_default2 : tag2 == setTag19 ? _setToArray_default2 : values_default2; - return func(value); -} -var mapTag19 = "[object Map]", setTag19 = "[object Set]", symIterator3, toArray_default2; -var init_toArray2 = __esm(() => { - init__Symbol2(); - init__copyArray2(); - init__getTag2(); - init_isArrayLike2(); - init_isString2(); - init__iteratorToArray2(); - init__mapToArray2(); - init__setToArray2(); - init__stringToArray2(); - init_values8(); - symIterator3 = _Symbol_default2 ? _Symbol_default2.iterator : undefined; - toArray_default2 = toArray3; -}); - -// ../node_modules/lodash-es/next.js -function wrapperNext2() { - if (this.__values__ === undefined) { - this.__values__ = toArray_default2(this.value()); - } - var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++]; - return { done, value }; -} -var next_default2; -var init_next2 = __esm(() => { - init_toArray2(); - next_default2 = wrapperNext2; -}); - -// ../node_modules/lodash-es/_baseNth.js -function baseNth2(array3, n2) { - var length = array3.length; - if (!length) { - return; - } - n2 += n2 < 0 ? length : 0; - return _isIndex_default2(n2, length) ? array3[n2] : undefined; -} -var _baseNth_default2; -var init__baseNth2 = __esm(() => { - init__isIndex2(); - _baseNth_default2 = baseNth2; -}); - -// ../node_modules/lodash-es/nth.js -function nth2(array3, n2) { - return array3 && array3.length ? _baseNth_default2(array3, toInteger_default2(n2)) : undefined; -} -var nth_default2; -var init_nth2 = __esm(() => { - init__baseNth2(); - init_toInteger2(); - nth_default2 = nth2; -}); - -// ../node_modules/lodash-es/nthArg.js -function nthArg2(n2) { - n2 = toInteger_default2(n2); - return _baseRest_default2(function(args) { - return _baseNth_default2(args, n2); - }); -} -var nthArg_default2; -var init_nthArg2 = __esm(() => { - init__baseNth2(); - init__baseRest2(); - init_toInteger2(); - nthArg_default2 = nthArg2; -}); - -// ../node_modules/lodash-es/_baseUnset.js -function baseUnset2(object4, path13) { - path13 = _castPath_default2(path13, object4); - var index = -1, length = path13.length; - if (!length) { - return true; - } - var isRootPrimitive = object4 == null || typeof object4 !== "object" && typeof object4 !== "function"; - while (++index < length) { - var key = path13[index]; - if (typeof key !== "string") { - continue; - } - if (key === "__proto__" && !hasOwnProperty50.call(object4, "__proto__")) { - return false; - } - if (key === "constructor" && index + 1 < length && typeof path13[index + 1] === "string" && path13[index + 1] === "prototype") { - if (isRootPrimitive && index === 0) { - continue; - } - return false; - } - } - var obj = _parent_default2(object4, path13); - return obj == null || delete obj[_toKey_default2(last_default2(path13))]; -} -var objectProto57, hasOwnProperty50, _baseUnset_default2; -var init__baseUnset2 = __esm(() => { - init__castPath2(); - init_last2(); - init__parent2(); - init__toKey2(); - objectProto57 = Object.prototype; - hasOwnProperty50 = objectProto57.hasOwnProperty; - _baseUnset_default2 = baseUnset2; -}); - -// ../node_modules/lodash-es/_customOmitClone.js -function customOmitClone2(value) { - return isPlainObject_default2(value) ? undefined : value; -} -var _customOmitClone_default2; -var init__customOmitClone2 = __esm(() => { - init_isPlainObject2(); - _customOmitClone_default2 = customOmitClone2; -}); - -// ../node_modules/lodash-es/omit.js -var CLONE_DEEP_FLAG16 = 1, CLONE_FLAT_FLAG4 = 2, CLONE_SYMBOLS_FLAG12 = 4, omit3, omit_default2; -var init_omit2 = __esm(() => { - init__arrayMap2(); - init__baseClone2(); - init__baseUnset2(); - init__castPath2(); - init__copyObject2(); - init__customOmitClone2(); - init__flatRest2(); - init__getAllKeysIn2(); - omit3 = _flatRest_default2(function(object4, paths2) { - var result2 = {}; - if (object4 == null) { - return result2; - } - var isDeep = false; - paths2 = _arrayMap_default2(paths2, function(path13) { - path13 = _castPath_default2(path13, object4); - isDeep || (isDeep = path13.length > 1); - return path13; - }); - _copyObject_default2(object4, _getAllKeysIn_default2(object4), result2); - if (isDeep) { - result2 = _baseClone_default2(result2, CLONE_DEEP_FLAG16 | CLONE_FLAT_FLAG4 | CLONE_SYMBOLS_FLAG12, _customOmitClone_default2); - } - var length = paths2.length; - while (length--) { - _baseUnset_default2(result2, paths2[length]); - } - return result2; - }); - omit_default2 = omit3; -}); - -// ../node_modules/lodash-es/_baseSet.js -function baseSet2(object4, path13, value, customizer) { - if (!isObject_default2(object4)) { - return object4; - } - path13 = _castPath_default2(path13, object4); - var index = -1, length = path13.length, lastIndex = length - 1, nested = object4; - while (nested != null && ++index < length) { - var key = _toKey_default2(path13[index]), newValue = value; - if (key === "__proto__" || key === "constructor" || key === "prototype") { - return object4; - } - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject_default2(objValue) ? objValue : _isIndex_default2(path13[index + 1]) ? [] : {}; - } - } - _assignValue_default2(nested, key, newValue); - nested = nested[key]; - } - return object4; -} -var _baseSet_default2; -var init__baseSet2 = __esm(() => { - init__assignValue2(); - init__castPath2(); - init__isIndex2(); - init_isObject2(); - init__toKey2(); - _baseSet_default2 = baseSet2; -}); - -// ../node_modules/lodash-es/_basePickBy.js -function basePickBy2(object4, paths2, predicate) { - var index = -1, length = paths2.length, result2 = {}; - while (++index < length) { - var path13 = paths2[index], value = _baseGet_default2(object4, path13); - if (predicate(value, path13)) { - _baseSet_default2(result2, _castPath_default2(path13, object4), value); - } - } - return result2; -} -var _basePickBy_default2; -var init__basePickBy2 = __esm(() => { - init__baseGet2(); - init__baseSet2(); - init__castPath2(); - _basePickBy_default2 = basePickBy2; -}); - -// ../node_modules/lodash-es/pickBy.js -function pickBy2(object4, predicate) { - if (object4 == null) { - return {}; - } - var props = _arrayMap_default2(_getAllKeysIn_default2(object4), function(prop) { - return [prop]; - }); - predicate = _baseIteratee_default2(predicate); - return _basePickBy_default2(object4, props, function(value, path13) { - return predicate(value, path13[0]); - }); -} -var pickBy_default2; -var init_pickBy2 = __esm(() => { - init__arrayMap2(); - init__baseIteratee2(); - init__basePickBy2(); - init__getAllKeysIn2(); - pickBy_default2 = pickBy2; -}); - -// ../node_modules/lodash-es/omitBy.js -function omitBy2(object4, predicate) { - return pickBy_default2(object4, negate_default2(_baseIteratee_default2(predicate))); -} -var omitBy_default2; -var init_omitBy2 = __esm(() => { - init__baseIteratee2(); - init_negate2(); - init_pickBy2(); - omitBy_default2 = omitBy2; -}); - -// ../node_modules/lodash-es/once.js -function once10(func) { - return before_default2(2, func); -} -var once_default2; -var init_once2 = __esm(() => { - init_before2(); - once_default2 = once10; -}); - -// ../node_modules/lodash-es/_baseSortBy.js -function baseSortBy2(array3, comparer) { - var length = array3.length; - array3.sort(comparer); - while (length--) { - array3[length] = array3[length].value; - } - return array3; -} -var _baseSortBy_default2; -var init__baseSortBy2 = __esm(() => { - _baseSortBy_default2 = baseSortBy2; -}); - -// ../node_modules/lodash-es/_compareAscending.js -function compareAscending2(value, other2) { - if (value !== other2) { - var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol_default2(value); - var othIsDefined = other2 !== undefined, othIsNull = other2 === null, othIsReflexive = other2 === other2, othIsSymbol = isSymbol_default2(other2); - if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other2 || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { - return 1; - } - if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other2 || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { - return -1; - } - } - return 0; -} -var _compareAscending_default2; -var init__compareAscending2 = __esm(() => { - init_isSymbol2(); - _compareAscending_default2 = compareAscending2; -}); - -// ../node_modules/lodash-es/_compareMultiple.js -function compareMultiple2(object4, other2, orders) { - var index = -1, objCriteria = object4.criteria, othCriteria = other2.criteria, length = objCriteria.length, ordersLength = orders.length; - while (++index < length) { - var result2 = _compareAscending_default2(objCriteria[index], othCriteria[index]); - if (result2) { - if (index >= ordersLength) { - return result2; - } - var order = orders[index]; - return result2 * (order == "desc" ? -1 : 1); - } - } - return object4.index - other2.index; -} -var _compareMultiple_default2; -var init__compareMultiple2 = __esm(() => { - init__compareAscending2(); - _compareMultiple_default2 = compareMultiple2; -}); - -// ../node_modules/lodash-es/_baseOrderBy.js -function baseOrderBy2(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = _arrayMap_default2(iteratees, function(iteratee3) { - if (isArray_default2(iteratee3)) { - return function(value) { - return _baseGet_default2(value, iteratee3.length === 1 ? iteratee3[0] : iteratee3); - }; - } - return iteratee3; - }); - } else { - iteratees = [identity_default3]; - } - var index = -1; - iteratees = _arrayMap_default2(iteratees, _baseUnary_default2(_baseIteratee_default2)); - var result2 = _baseMap_default2(collection, function(value, key, collection2) { - var criteria = _arrayMap_default2(iteratees, function(iteratee3) { - return iteratee3(value); - }); - return { criteria, index: ++index, value }; - }); - return _baseSortBy_default2(result2, function(object4, other2) { - return _compareMultiple_default2(object4, other2, orders); - }); -} -var _baseOrderBy_default2; -var init__baseOrderBy2 = __esm(() => { - init__arrayMap2(); - init__baseGet2(); - init__baseIteratee2(); - init__baseMap2(); - init__baseSortBy2(); - init__baseUnary2(); - init__compareMultiple2(); - init_identity3(); - init_isArray2(); - _baseOrderBy_default2 = baseOrderBy2; -}); - -// ../node_modules/lodash-es/orderBy.js -function orderBy2(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray_default2(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray_default2(orders)) { - orders = orders == null ? [] : [orders]; - } - return _baseOrderBy_default2(collection, iteratees, orders); -} -var orderBy_default2; -var init_orderBy2 = __esm(() => { - init__baseOrderBy2(); - init_isArray2(); - orderBy_default2 = orderBy2; -}); - -// ../node_modules/lodash-es/_createOver.js -function createOver2(arrayFunc) { - return _flatRest_default2(function(iteratees) { - iteratees = _arrayMap_default2(iteratees, _baseUnary_default2(_baseIteratee_default2)); - return _baseRest_default2(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee3) { - return _apply_default2(iteratee3, thisArg, args); - }); - }); - }); -} -var _createOver_default2; -var init__createOver2 = __esm(() => { - init__apply2(); - init__arrayMap2(); - init__baseIteratee2(); - init__baseRest2(); - init__baseUnary2(); - init__flatRest2(); - _createOver_default2 = createOver2; -}); - -// ../node_modules/lodash-es/over.js -var over2, over_default2; -var init_over2 = __esm(() => { - init__arrayMap2(); - init__createOver2(); - over2 = _createOver_default2(_arrayMap_default2); - over_default2 = over2; -}); - -// ../node_modules/lodash-es/_castRest.js -var castRest2, _castRest_default2; -var init__castRest2 = __esm(() => { - init__baseRest2(); - castRest2 = _baseRest_default2; - _castRest_default2 = castRest2; -}); - -// ../node_modules/lodash-es/overArgs.js -var nativeMin24, overArgs2, overArgs_default2; -var init_overArgs2 = __esm(() => { - init__apply2(); - init__arrayMap2(); - init__baseFlatten2(); - init__baseIteratee2(); - init__baseRest2(); - init__baseUnary2(); - init__castRest2(); - init_isArray2(); - nativeMin24 = Math.min; - overArgs2 = _castRest_default2(function(func, transforms) { - transforms = transforms.length == 1 && isArray_default2(transforms[0]) ? _arrayMap_default2(transforms[0], _baseUnary_default2(_baseIteratee_default2)) : _arrayMap_default2(_baseFlatten_default2(transforms, 1), _baseUnary_default2(_baseIteratee_default2)); - var funcsLength = transforms.length; - return _baseRest_default2(function(args) { - var index = -1, length = nativeMin24(args.length, funcsLength); - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return _apply_default2(func, this, args); - }); - }); - overArgs_default2 = overArgs2; -}); - -// ../node_modules/lodash-es/overEvery.js -var overEvery2, overEvery_default2; -var init_overEvery2 = __esm(() => { - init__arrayEvery2(); - init__createOver2(); - overEvery2 = _createOver_default2(_arrayEvery_default2); - overEvery_default2 = overEvery2; -}); - -// ../node_modules/lodash-es/overSome.js -var overSome2, overSome_default2; -var init_overSome2 = __esm(() => { - init__arraySome2(); - init__createOver2(); - overSome2 = _createOver_default2(_arraySome_default2); - overSome_default2 = overSome2; -}); - -// ../node_modules/lodash-es/_baseRepeat.js -function baseRepeat2(string5, n2) { - var result2 = ""; - if (!string5 || n2 < 1 || n2 > MAX_SAFE_INTEGER10) { - return result2; - } - do { - if (n2 % 2) { - result2 += string5; - } - n2 = nativeFloor5(n2 / 2); - if (n2) { - string5 += string5; - } - } while (n2); - return result2; -} -var MAX_SAFE_INTEGER10 = 9007199254740991, nativeFloor5, _baseRepeat_default2; -var init__baseRepeat2 = __esm(() => { - nativeFloor5 = Math.floor; - _baseRepeat_default2 = baseRepeat2; -}); - -// ../node_modules/lodash-es/_asciiSize.js -var asciiSize2, _asciiSize_default2; -var init__asciiSize2 = __esm(() => { - init__baseProperty2(); - asciiSize2 = _baseProperty_default2("length"); - _asciiSize_default2 = asciiSize2; -}); - -// ../node_modules/lodash-es/_unicodeSize.js -function unicodeSize2(string5) { - var result2 = reUnicode4.lastIndex = 0; - while (reUnicode4.test(string5)) { - ++result2; - } - return result2; -} -var rsAstralRange8 = "\\ud800-\\udfff", rsComboMarksRange10 = "\\u0300-\\u036f", reComboHalfMarksRange10 = "\\ufe20-\\ufe2f", rsComboSymbolsRange10 = "\\u20d0-\\u20ff", rsComboRange10, rsVarRange8 = "\\ufe0e\\ufe0f", rsAstral4, rsCombo8, rsFitz6 = "\\ud83c[\\udffb-\\udfff]", rsModifier6, rsNonAstral6, rsRegional6 = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair6 = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ8 = "\\u200d", reOptMod6, rsOptVar6, rsOptJoin6, rsSeq6, rsSymbol4, reUnicode4, _unicodeSize_default2; -var init__unicodeSize2 = __esm(() => { - rsComboRange10 = rsComboMarksRange10 + reComboHalfMarksRange10 + rsComboSymbolsRange10; - rsAstral4 = "[" + rsAstralRange8 + "]"; - rsCombo8 = "[" + rsComboRange10 + "]"; - rsModifier6 = "(?:" + rsCombo8 + "|" + rsFitz6 + ")"; - rsNonAstral6 = "[^" + rsAstralRange8 + "]"; - reOptMod6 = rsModifier6 + "?"; - rsOptVar6 = "[" + rsVarRange8 + "]?"; - rsOptJoin6 = "(?:" + rsZWJ8 + "(?:" + [rsNonAstral6, rsRegional6, rsSurrPair6].join("|") + ")" + rsOptVar6 + reOptMod6 + ")*"; - rsSeq6 = rsOptVar6 + reOptMod6 + rsOptJoin6; - rsSymbol4 = "(?:" + [rsNonAstral6 + rsCombo8 + "?", rsCombo8, rsRegional6, rsSurrPair6, rsAstral4].join("|") + ")"; - reUnicode4 = RegExp(rsFitz6 + "(?=" + rsFitz6 + ")|" + rsSymbol4 + rsSeq6, "g"); - _unicodeSize_default2 = unicodeSize2; -}); - -// ../node_modules/lodash-es/_stringSize.js -function stringSize2(string5) { - return _hasUnicode_default2(string5) ? _unicodeSize_default2(string5) : _asciiSize_default2(string5); -} -var _stringSize_default2; -var init__stringSize2 = __esm(() => { - init__asciiSize2(); - init__hasUnicode2(); - init__unicodeSize2(); - _stringSize_default2 = stringSize2; -}); - -// ../node_modules/lodash-es/_createPadding.js -function createPadding2(length, chars) { - chars = chars === undefined ? " " : _baseToString_default2(chars); - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? _baseRepeat_default2(chars, length) : chars; - } - var result2 = _baseRepeat_default2(chars, nativeCeil6(length / _stringSize_default2(chars))); - return _hasUnicode_default2(chars) ? _castSlice_default2(_stringToArray_default2(result2), 0, length).join("") : result2.slice(0, length); -} -var nativeCeil6, _createPadding_default2; -var init__createPadding2 = __esm(() => { - init__baseRepeat2(); - init__baseToString2(); - init__castSlice2(); - init__hasUnicode2(); - init__stringSize2(); - init__stringToArray2(); - nativeCeil6 = Math.ceil; - _createPadding_default2 = createPadding2; -}); - -// ../node_modules/lodash-es/pad.js -function pad2(string5, length, chars) { - string5 = toString_default2(string5); - length = toInteger_default2(length); - var strLength = length ? _stringSize_default2(string5) : 0; - if (!length || strLength >= length) { - return string5; - } - var mid = (length - strLength) / 2; - return _createPadding_default2(nativeFloor6(mid), chars) + string5 + _createPadding_default2(nativeCeil7(mid), chars); -} -var nativeCeil7, nativeFloor6, pad_default2; -var init_pad2 = __esm(() => { - init__createPadding2(); - init__stringSize2(); - init_toInteger2(); - init_toString2(); - nativeCeil7 = Math.ceil; - nativeFloor6 = Math.floor; - pad_default2 = pad2; -}); - -// ../node_modules/lodash-es/padEnd.js -function padEnd2(string5, length, chars) { - string5 = toString_default2(string5); - length = toInteger_default2(length); - var strLength = length ? _stringSize_default2(string5) : 0; - return length && strLength < length ? string5 + _createPadding_default2(length - strLength, chars) : string5; -} -var padEnd_default2; -var init_padEnd2 = __esm(() => { - init__createPadding2(); - init__stringSize2(); - init_toInteger2(); - init_toString2(); - padEnd_default2 = padEnd2; -}); - -// ../node_modules/lodash-es/padStart.js -function padStart2(string5, length, chars) { - string5 = toString_default2(string5); - length = toInteger_default2(length); - var strLength = length ? _stringSize_default2(string5) : 0; - return length && strLength < length ? _createPadding_default2(length - strLength, chars) + string5 : string5; -} -var padStart_default2; -var init_padStart2 = __esm(() => { - init__createPadding2(); - init__stringSize2(); - init_toInteger2(); - init_toString2(); - padStart_default2 = padStart2; -}); - -// ../node_modules/lodash-es/parseInt.js -function parseInt3(string5, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt2(toString_default2(string5).replace(reTrimStart5, ""), radix || 0); -} -var reTrimStart5, nativeParseInt2, parseInt_default2; -var init_parseInt2 = __esm(() => { - init__root2(); - init_toString2(); - reTrimStart5 = /^\s+/; - nativeParseInt2 = _root_default2.parseInt; - parseInt_default2 = parseInt3; -}); - -// ../node_modules/lodash-es/partial.js -var WRAP_PARTIAL_FLAG14 = 32, partial3, partial_default2; -var init_partial2 = __esm(() => { - init__baseRest2(); - init__createWrap2(); - init__getHolder2(); - init__replaceHolders2(); - partial3 = _baseRest_default2(function(func, partials) { - var holders = _replaceHolders_default2(partials, _getHolder_default2(partial3)); - return _createWrap_default2(func, WRAP_PARTIAL_FLAG14, undefined, partials, holders); - }); - partial3.placeholder = {}; - partial_default2 = partial3; -}); - -// ../node_modules/lodash-es/partialRight.js -var WRAP_PARTIAL_RIGHT_FLAG8 = 64, partialRight2, partialRight_default2; -var init_partialRight2 = __esm(() => { - init__baseRest2(); - init__createWrap2(); - init__getHolder2(); - init__replaceHolders2(); - partialRight2 = _baseRest_default2(function(func, partials) { - var holders = _replaceHolders_default2(partials, _getHolder_default2(partialRight2)); - return _createWrap_default2(func, WRAP_PARTIAL_RIGHT_FLAG8, undefined, partials, holders); - }); - partialRight2.placeholder = {}; - partialRight_default2 = partialRight2; -}); - -// ../node_modules/lodash-es/partition.js -var partition4, partition_default2; -var init_partition2 = __esm(() => { - init__createAggregator2(); - partition4 = _createAggregator_default2(function(result2, value, key) { - result2[key ? 0 : 1].push(value); - }, function() { - return [[], []]; - }); - partition_default2 = partition4; -}); - -// ../node_modules/lodash-es/_basePick.js -function basePick2(object4, paths2) { - return _basePickBy_default2(object4, paths2, function(value, path13) { - return hasIn_default2(object4, path13); - }); -} -var _basePick_default2; -var init__basePick2 = __esm(() => { - init__basePickBy2(); - init_hasIn2(); - _basePick_default2 = basePick2; -}); - -// ../node_modules/lodash-es/pick.js -var pick4, pick_default2; -var init_pick2 = __esm(() => { - init__basePick2(); - init__flatRest2(); - pick4 = _flatRest_default2(function(object4, paths2) { - return object4 == null ? {} : _basePick_default2(object4, paths2); - }); - pick_default2 = pick4; -}); - -// ../node_modules/lodash-es/plant.js -function wrapperPlant2(value) { - var result2, parent3 = this; - while (parent3 instanceof _baseLodash_default2) { - var clone5 = _wrapperClone_default2(parent3); - clone5.__index__ = 0; - clone5.__values__ = undefined; - if (result2) { - previous.__wrapped__ = clone5; - } else { - result2 = clone5; - } - var previous = clone5; - parent3 = parent3.__wrapped__; - } - previous.__wrapped__ = value; - return result2; -} -var plant_default2; -var init_plant2 = __esm(() => { - init__baseLodash2(); - init__wrapperClone2(); - plant_default2 = wrapperPlant2; -}); - -// ../node_modules/lodash-es/propertyOf.js -function propertyOf2(object4) { - return function(path13) { - return object4 == null ? undefined : _baseGet_default2(object4, path13); - }; -} -var propertyOf_default2; -var init_propertyOf2 = __esm(() => { - init__baseGet2(); - propertyOf_default2 = propertyOf2; -}); - -// ../node_modules/lodash-es/_baseIndexOfWith.js -function baseIndexOfWith2(array3, value, fromIndex, comparator) { - var index = fromIndex - 1, length = array3.length; - while (++index < length) { - if (comparator(array3[index], value)) { - return index; - } - } - return -1; -} -var _baseIndexOfWith_default2; -var init__baseIndexOfWith2 = __esm(() => { - _baseIndexOfWith_default2 = baseIndexOfWith2; -}); - -// ../node_modules/lodash-es/_basePullAll.js -function basePullAll2(array3, values4, iteratee3, comparator) { - var indexOf3 = comparator ? _baseIndexOfWith_default2 : _baseIndexOf_default2, index = -1, length = values4.length, seen = array3; - if (array3 === values4) { - values4 = _copyArray_default2(values4); - } - if (iteratee3) { - seen = _arrayMap_default2(array3, _baseUnary_default2(iteratee3)); - } - while (++index < length) { - var fromIndex = 0, value = values4[index], computed = iteratee3 ? iteratee3(value) : value; - while ((fromIndex = indexOf3(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array3) { - splice5.call(seen, fromIndex, 1); - } - splice5.call(array3, fromIndex, 1); - } - } - return array3; -} -var arrayProto9, splice5, _basePullAll_default2; -var init__basePullAll2 = __esm(() => { - init__arrayMap2(); - init__baseIndexOf2(); - init__baseIndexOfWith2(); - init__baseUnary2(); - init__copyArray2(); - arrayProto9 = Array.prototype; - splice5 = arrayProto9.splice; - _basePullAll_default2 = basePullAll2; -}); - -// ../node_modules/lodash-es/pullAll.js -function pullAll2(array3, values4) { - return array3 && array3.length && values4 && values4.length ? _basePullAll_default2(array3, values4) : array3; -} -var pullAll_default2; -var init_pullAll2 = __esm(() => { - init__basePullAll2(); - pullAll_default2 = pullAll2; -}); - -// ../node_modules/lodash-es/pull.js -var pull2, pull_default2; -var init_pull2 = __esm(() => { - init__baseRest2(); - init_pullAll2(); - pull2 = _baseRest_default2(pullAll_default2); - pull_default2 = pull2; -}); - -// ../node_modules/lodash-es/pullAllBy.js -function pullAllBy2(array3, values4, iteratee3) { - return array3 && array3.length && values4 && values4.length ? _basePullAll_default2(array3, values4, _baseIteratee_default2(iteratee3, 2)) : array3; -} -var pullAllBy_default2; -var init_pullAllBy2 = __esm(() => { - init__baseIteratee2(); - init__basePullAll2(); - pullAllBy_default2 = pullAllBy2; -}); - -// ../node_modules/lodash-es/pullAllWith.js -function pullAllWith2(array3, values4, comparator) { - return array3 && array3.length && values4 && values4.length ? _basePullAll_default2(array3, values4, undefined, comparator) : array3; -} -var pullAllWith_default2; -var init_pullAllWith2 = __esm(() => { - init__basePullAll2(); - pullAllWith_default2 = pullAllWith2; -}); - -// ../node_modules/lodash-es/_basePullAt.js -function basePullAt2(array3, indexes) { - var length = array3 ? indexes.length : 0, lastIndex = length - 1; - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (_isIndex_default2(index)) { - splice6.call(array3, index, 1); - } else { - _baseUnset_default2(array3, index); - } - } - } - return array3; -} -var arrayProto10, splice6, _basePullAt_default2; -var init__basePullAt2 = __esm(() => { - init__baseUnset2(); - init__isIndex2(); - arrayProto10 = Array.prototype; - splice6 = arrayProto10.splice; - _basePullAt_default2 = basePullAt2; -}); - -// ../node_modules/lodash-es/pullAt.js -var pullAt2, pullAt_default2; -var init_pullAt2 = __esm(() => { - init__arrayMap2(); - init__baseAt2(); - init__basePullAt2(); - init__compareAscending2(); - init__flatRest2(); - init__isIndex2(); - pullAt2 = _flatRest_default2(function(array3, indexes) { - var length = array3 == null ? 0 : array3.length, result2 = _baseAt_default2(array3, indexes); - _basePullAt_default2(array3, _arrayMap_default2(indexes, function(index) { - return _isIndex_default2(index, length) ? +index : index; - }).sort(_compareAscending_default2)); - return result2; - }); - pullAt_default2 = pullAt2; -}); - -// ../node_modules/lodash-es/_baseRandom.js -function baseRandom2(lower, upper) { - return lower + nativeFloor7(nativeRandom3() * (upper - lower + 1)); -} -var nativeFloor7, nativeRandom3, _baseRandom_default2; -var init__baseRandom2 = __esm(() => { - nativeFloor7 = Math.floor; - nativeRandom3 = Math.random; - _baseRandom_default2 = baseRandom2; -}); - -// ../node_modules/lodash-es/random.js -function random3(lower, upper, floating) { - if (floating && typeof floating != "boolean" && _isIterateeCall_default2(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == "boolean") { - floating = upper; - upper = undefined; - } else if (typeof lower == "boolean") { - floating = lower; - lower = undefined; - } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } else { - lower = toFinite_default2(lower); - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toFinite_default2(upper); - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom4(); - return nativeMin25(lower + rand * (upper - lower + freeParseFloat2("1e-" + ((rand + "").length - 1))), upper); - } - return _baseRandom_default2(lower, upper); -} -var freeParseFloat2, nativeMin25, nativeRandom4, random_default2; -var init_random2 = __esm(() => { - init__baseRandom2(); - init__isIterateeCall2(); - init_toFinite2(); - freeParseFloat2 = parseFloat; - nativeMin25 = Math.min; - nativeRandom4 = Math.random; - random_default2 = random3; -}); - -// ../node_modules/lodash-es/_baseRange.js -function baseRange2(start, end, step, fromRight) { - var index = -1, length = nativeMax30(nativeCeil8((end - start) / (step || 1)), 0), result2 = Array(length); - while (length--) { - result2[fromRight ? length : ++index] = start; - start += step; - } - return result2; -} -var nativeCeil8, nativeMax30, _baseRange_default2; -var init__baseRange2 = __esm(() => { - nativeCeil8 = Math.ceil; - nativeMax30 = Math.max; - _baseRange_default2 = baseRange2; -}); - -// ../node_modules/lodash-es/_createRange.js -function createRange2(fromRight) { - return function(start, end, step) { - if (step && typeof step != "number" && _isIterateeCall_default2(start, end, step)) { - end = step = undefined; - } - start = toFinite_default2(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite_default2(end); - } - step = step === undefined ? start < end ? 1 : -1 : toFinite_default2(step); - return _baseRange_default2(start, end, step, fromRight); - }; -} -var _createRange_default2; -var init__createRange2 = __esm(() => { - init__baseRange2(); - init__isIterateeCall2(); - init_toFinite2(); - _createRange_default2 = createRange2; -}); - -// ../node_modules/lodash-es/range.js -var range2, range_default2; -var init_range2 = __esm(() => { - init__createRange2(); - range2 = _createRange_default2(); - range_default2 = range2; -}); - -// ../node_modules/lodash-es/rangeRight.js -var rangeRight2, rangeRight_default2; -var init_rangeRight2 = __esm(() => { - init__createRange2(); - rangeRight2 = _createRange_default2(true); - rangeRight_default2 = rangeRight2; -}); - -// ../node_modules/lodash-es/rearg.js -var WRAP_REARG_FLAG8 = 256, rearg2, rearg_default2; -var init_rearg2 = __esm(() => { - init__createWrap2(); - init__flatRest2(); - rearg2 = _flatRest_default2(function(func, indexes) { - return _createWrap_default2(func, WRAP_REARG_FLAG8, undefined, undefined, undefined, indexes); - }); - rearg_default2 = rearg2; -}); - -// ../node_modules/lodash-es/_baseReduce.js -function baseReduce2(collection, iteratee3, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection2) { - accumulator = initAccum ? (initAccum = false, value) : iteratee3(accumulator, value, index, collection2); - }); - return accumulator; -} -var _baseReduce_default2; -var init__baseReduce2 = __esm(() => { - _baseReduce_default2 = baseReduce2; -}); - -// ../node_modules/lodash-es/reduce.js -function reduce2(collection, iteratee3, accumulator) { - var func = isArray_default2(collection) ? _arrayReduce_default2 : _baseReduce_default2, initAccum = arguments.length < 3; - return func(collection, _baseIteratee_default2(iteratee3, 4), accumulator, initAccum, _baseEach_default2); -} -var reduce_default2; -var init_reduce3 = __esm(() => { - init__arrayReduce2(); - init__baseEach2(); - init__baseIteratee2(); - init__baseReduce2(); - init_isArray2(); - reduce_default2 = reduce2; -}); - -// ../node_modules/lodash-es/_arrayReduceRight.js -function arrayReduceRight2(array3, iteratee3, accumulator, initAccum) { - var length = array3 == null ? 0 : array3.length; - if (initAccum && length) { - accumulator = array3[--length]; - } - while (length--) { - accumulator = iteratee3(accumulator, array3[length], length, array3); - } - return accumulator; -} -var _arrayReduceRight_default2; -var init__arrayReduceRight2 = __esm(() => { - _arrayReduceRight_default2 = arrayReduceRight2; -}); - -// ../node_modules/lodash-es/reduceRight.js -function reduceRight2(collection, iteratee3, accumulator) { - var func = isArray_default2(collection) ? _arrayReduceRight_default2 : _baseReduce_default2, initAccum = arguments.length < 3; - return func(collection, _baseIteratee_default2(iteratee3, 4), accumulator, initAccum, _baseEachRight_default2); -} -var reduceRight_default2; -var init_reduceRight2 = __esm(() => { - init__arrayReduceRight2(); - init__baseEachRight2(); - init__baseIteratee2(); - init__baseReduce2(); - init_isArray2(); - reduceRight_default2 = reduceRight2; -}); - -// ../node_modules/lodash-es/reject.js -function reject2(collection, predicate) { - var func = isArray_default2(collection) ? _arrayFilter_default2 : _baseFilter_default2; - return func(collection, negate_default2(_baseIteratee_default2(predicate, 3))); -} -var reject_default2; -var init_reject3 = __esm(() => { - init__arrayFilter2(); - init__baseFilter2(); - init__baseIteratee2(); - init_isArray2(); - init_negate2(); - reject_default2 = reject2; -}); - -// ../node_modules/lodash-es/remove.js -function remove2(array3, predicate) { - var result2 = []; - if (!(array3 && array3.length)) { - return result2; - } - var index = -1, indexes = [], length = array3.length; - predicate = _baseIteratee_default2(predicate, 3); - while (++index < length) { - var value = array3[index]; - if (predicate(value, index, array3)) { - result2.push(value); - indexes.push(index); - } - } - _basePullAt_default2(array3, indexes); - return result2; -} -var remove_default2; -var init_remove2 = __esm(() => { - init__baseIteratee2(); - init__basePullAt2(); - remove_default2 = remove2; -}); - -// ../node_modules/lodash-es/repeat.js -function repeat3(string5, n2, guard) { - if (guard ? _isIterateeCall_default2(string5, n2, guard) : n2 === undefined) { - n2 = 1; - } else { - n2 = toInteger_default2(n2); - } - return _baseRepeat_default2(toString_default2(string5), n2); -} -var repeat_default2; -var init_repeat2 = __esm(() => { - init__baseRepeat2(); - init__isIterateeCall2(); - init_toInteger2(); - init_toString2(); - repeat_default2 = repeat3; -}); - -// ../node_modules/lodash-es/replace.js -function replace2() { - var args = arguments, string5 = toString_default2(args[0]); - return args.length < 3 ? string5 : string5.replace(args[1], args[2]); -} -var replace_default2; -var init_replace2 = __esm(() => { - init_toString2(); - replace_default2 = replace2; -}); - -// ../node_modules/lodash-es/rest.js -function rest2(func, start) { - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT22); - } - start = start === undefined ? start : toInteger_default2(start); - return _baseRest_default2(func, start); -} -var FUNC_ERROR_TEXT22 = "Expected a function", rest_default2; -var init_rest2 = __esm(() => { - init__baseRest2(); - init_toInteger2(); - rest_default2 = rest2; -}); - -// ../node_modules/lodash-es/result.js -function result2(object4, path13, defaultValue) { - path13 = _castPath_default2(path13, object4); - var index = -1, length = path13.length; - if (!length) { - length = 1; - object4 = undefined; - } - while (++index < length) { - var value = object4 == null ? undefined : object4[_toKey_default2(path13[index])]; - if (value === undefined) { - index = length; - value = defaultValue; - } - object4 = isFunction_default2(value) ? value.call(object4) : value; - } - return object4; -} -var result_default2; -var init_result3 = __esm(() => { - init__castPath2(); - init_isFunction2(); - init__toKey2(); - result_default2 = result2; -}); - -// ../node_modules/lodash-es/reverse.js -function reverse2(array3) { - return array3 == null ? array3 : nativeReverse2.call(array3); -} -var arrayProto11, nativeReverse2, reverse_default2; -var init_reverse2 = __esm(() => { - arrayProto11 = Array.prototype; - nativeReverse2 = arrayProto11.reverse; - reverse_default2 = reverse2; -}); - -// ../node_modules/lodash-es/round.js -var round2, round_default2; -var init_round2 = __esm(() => { - init__createRound2(); - round2 = _createRound_default2("round"); - round_default2 = round2; -}); - -// ../node_modules/lodash-es/_arraySample.js -function arraySample2(array3) { - var length = array3.length; - return length ? array3[_baseRandom_default2(0, length - 1)] : undefined; -} -var _arraySample_default2; -var init__arraySample2 = __esm(() => { - init__baseRandom2(); - _arraySample_default2 = arraySample2; -}); - -// ../node_modules/lodash-es/_baseSample.js -function baseSample2(collection) { - return _arraySample_default2(values_default2(collection)); -} -var _baseSample_default2; -var init__baseSample2 = __esm(() => { - init__arraySample2(); - init_values8(); - _baseSample_default2 = baseSample2; -}); - -// ../node_modules/lodash-es/sample.js -function sample2(collection) { - var func = isArray_default2(collection) ? _arraySample_default2 : _baseSample_default2; - return func(collection); -} -var sample_default2; -var init_sample2 = __esm(() => { - init__arraySample2(); - init__baseSample2(); - init_isArray2(); - sample_default2 = sample2; -}); - -// ../node_modules/lodash-es/_shuffleSelf.js -function shuffleSelf2(array3, size2) { - var index = -1, length = array3.length, lastIndex = length - 1; - size2 = size2 === undefined ? length : size2; - while (++index < size2) { - var rand = _baseRandom_default2(index, lastIndex), value = array3[rand]; - array3[rand] = array3[index]; - array3[index] = value; - } - array3.length = size2; - return array3; -} -var _shuffleSelf_default2; -var init__shuffleSelf2 = __esm(() => { - init__baseRandom2(); - _shuffleSelf_default2 = shuffleSelf2; -}); - -// ../node_modules/lodash-es/_arraySampleSize.js -function arraySampleSize2(array3, n2) { - return _shuffleSelf_default2(_copyArray_default2(array3), _baseClamp_default2(n2, 0, array3.length)); -} -var _arraySampleSize_default2; -var init__arraySampleSize2 = __esm(() => { - init__baseClamp2(); - init__copyArray2(); - init__shuffleSelf2(); - _arraySampleSize_default2 = arraySampleSize2; -}); - -// ../node_modules/lodash-es/_baseSampleSize.js -function baseSampleSize2(collection, n2) { - var array3 = values_default2(collection); - return _shuffleSelf_default2(array3, _baseClamp_default2(n2, 0, array3.length)); -} -var _baseSampleSize_default2; -var init__baseSampleSize2 = __esm(() => { - init__baseClamp2(); - init__shuffleSelf2(); - init_values8(); - _baseSampleSize_default2 = baseSampleSize2; -}); - -// ../node_modules/lodash-es/sampleSize.js -function sampleSize2(collection, n2, guard) { - if (guard ? _isIterateeCall_default2(collection, n2, guard) : n2 === undefined) { - n2 = 1; - } else { - n2 = toInteger_default2(n2); - } - var func = isArray_default2(collection) ? _arraySampleSize_default2 : _baseSampleSize_default2; - return func(collection, n2); -} -var sampleSize_default2; -var init_sampleSize2 = __esm(() => { - init__arraySampleSize2(); - init__baseSampleSize2(); - init_isArray2(); - init__isIterateeCall2(); - init_toInteger2(); - sampleSize_default2 = sampleSize2; -}); - -// ../node_modules/lodash-es/set.js -function set4(object4, path13, value) { - return object4 == null ? object4 : _baseSet_default2(object4, path13, value); -} -var set_default2; -var init_set3 = __esm(() => { - init__baseSet2(); - set_default2 = set4; -}); - -// ../node_modules/lodash-es/setWith.js -function setWith2(object4, path13, value, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined; - return object4 == null ? object4 : _baseSet_default2(object4, path13, value, customizer); -} -var setWith_default2; -var init_setWith2 = __esm(() => { - init__baseSet2(); - setWith_default2 = setWith2; -}); - -// ../node_modules/lodash-es/_arrayShuffle.js -function arrayShuffle2(array3) { - return _shuffleSelf_default2(_copyArray_default2(array3)); -} -var _arrayShuffle_default2; -var init__arrayShuffle2 = __esm(() => { - init__copyArray2(); - init__shuffleSelf2(); - _arrayShuffle_default2 = arrayShuffle2; -}); - -// ../node_modules/lodash-es/_baseShuffle.js -function baseShuffle2(collection) { - return _shuffleSelf_default2(values_default2(collection)); -} -var _baseShuffle_default2; -var init__baseShuffle2 = __esm(() => { - init__shuffleSelf2(); - init_values8(); - _baseShuffle_default2 = baseShuffle2; -}); - -// ../node_modules/lodash-es/shuffle.js -function shuffle2(collection) { - var func = isArray_default2(collection) ? _arrayShuffle_default2 : _baseShuffle_default2; - return func(collection); -} -var shuffle_default2; -var init_shuffle2 = __esm(() => { - init__arrayShuffle2(); - init__baseShuffle2(); - init_isArray2(); - shuffle_default2 = shuffle2; -}); - -// ../node_modules/lodash-es/size.js -function size2(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike_default2(collection)) { - return isString_default2(collection) ? _stringSize_default2(collection) : collection.length; - } - var tag2 = _getTag_default2(collection); - if (tag2 == mapTag20 || tag2 == setTag20) { - return collection.size; - } - return _baseKeys_default2(collection).length; -} -var mapTag20 = "[object Map]", setTag20 = "[object Set]", size_default2; -var init_size2 = __esm(() => { - init__baseKeys2(); - init__getTag2(); - init_isArrayLike2(); - init_isString2(); - init__stringSize2(); - size_default2 = size2; -}); - -// ../node_modules/lodash-es/slice.js -function slice2(array3, start, end) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return []; - } - if (end && typeof end != "number" && _isIterateeCall_default2(array3, start, end)) { - start = 0; - end = length; - } else { - start = start == null ? 0 : toInteger_default2(start); - end = end === undefined ? length : toInteger_default2(end); - } - return _baseSlice_default2(array3, start, end); -} -var slice_default2; -var init_slice2 = __esm(() => { - init__baseSlice2(); - init__isIterateeCall2(); - init_toInteger2(); - slice_default2 = slice2; -}); - -// ../node_modules/lodash-es/snakeCase.js -var snakeCase2, snakeCase_default2; -var init_snakeCase2 = __esm(() => { - init__createCompounder2(); - snakeCase2 = _createCompounder_default2(function(result3, word, index) { - return result3 + (index ? "_" : "") + word.toLowerCase(); - }); - snakeCase_default2 = snakeCase2; -}); - -// ../node_modules/lodash-es/_baseSome.js -function baseSome2(collection, predicate) { - var result3; - _baseEach_default2(collection, function(value, index, collection2) { - result3 = predicate(value, index, collection2); - return !result3; - }); - return !!result3; -} -var _baseSome_default2; -var init__baseSome2 = __esm(() => { - init__baseEach2(); - _baseSome_default2 = baseSome2; -}); - -// ../node_modules/lodash-es/some.js -function some2(collection, predicate, guard) { - var func = isArray_default2(collection) ? _arraySome_default2 : _baseSome_default2; - if (guard && _isIterateeCall_default2(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, _baseIteratee_default2(predicate, 3)); -} -var some_default2; -var init_some2 = __esm(() => { - init__arraySome2(); - init__baseIteratee2(); - init__baseSome2(); - init_isArray2(); - init__isIterateeCall2(); - some_default2 = some2; -}); - -// ../node_modules/lodash-es/sortBy.js -var sortBy2, sortBy_default2; -var init_sortBy2 = __esm(() => { - init__baseFlatten2(); - init__baseOrderBy2(); - init__baseRest2(); - init__isIterateeCall2(); - sortBy2 = _baseRest_default2(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && _isIterateeCall_default2(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && _isIterateeCall_default2(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return _baseOrderBy_default2(collection, _baseFlatten_default2(iteratees, 1), []); - }); - sortBy_default2 = sortBy2; -}); - -// ../node_modules/lodash-es/_baseSortedIndexBy.js -function baseSortedIndexBy2(array3, value, iteratee3, retHighest) { - var low = 0, high = array3 == null ? 0 : array3.length; - if (high === 0) { - return 0; - } - value = iteratee3(value); - var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol_default2(value), valIsUndefined = value === undefined; - while (low < high) { - var mid = nativeFloor8((low + high) / 2), computed = iteratee3(array3[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol_default2(computed); - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? computed <= value : computed < value; - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin26(high, MAX_ARRAY_INDEX2); -} -var MAX_ARRAY_LENGTH10 = 4294967295, MAX_ARRAY_INDEX2, nativeFloor8, nativeMin26, _baseSortedIndexBy_default2; -var init__baseSortedIndexBy2 = __esm(() => { - init_isSymbol2(); - MAX_ARRAY_INDEX2 = MAX_ARRAY_LENGTH10 - 1; - nativeFloor8 = Math.floor; - nativeMin26 = Math.min; - _baseSortedIndexBy_default2 = baseSortedIndexBy2; -}); - -// ../node_modules/lodash-es/_baseSortedIndex.js -function baseSortedIndex2(array3, value, retHighest) { - var low = 0, high = array3 == null ? low : array3.length; - if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH2) { - while (low < high) { - var mid = low + high >>> 1, computed = array3[mid]; - if (computed !== null && !isSymbol_default2(computed) && (retHighest ? computed <= value : computed < value)) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return _baseSortedIndexBy_default2(array3, value, identity_default3, retHighest); -} -var MAX_ARRAY_LENGTH11 = 4294967295, HALF_MAX_ARRAY_LENGTH2, _baseSortedIndex_default2; -var init__baseSortedIndex2 = __esm(() => { - init__baseSortedIndexBy2(); - init_identity3(); - init_isSymbol2(); - HALF_MAX_ARRAY_LENGTH2 = MAX_ARRAY_LENGTH11 >>> 1; - _baseSortedIndex_default2 = baseSortedIndex2; -}); - -// ../node_modules/lodash-es/sortedIndex.js -function sortedIndex2(array3, value) { - return _baseSortedIndex_default2(array3, value); -} -var sortedIndex_default2; -var init_sortedIndex2 = __esm(() => { - init__baseSortedIndex2(); - sortedIndex_default2 = sortedIndex2; -}); - -// ../node_modules/lodash-es/sortedIndexBy.js -function sortedIndexBy2(array3, value, iteratee3) { - return _baseSortedIndexBy_default2(array3, value, _baseIteratee_default2(iteratee3, 2)); -} -var sortedIndexBy_default2; -var init_sortedIndexBy2 = __esm(() => { - init__baseIteratee2(); - init__baseSortedIndexBy2(); - sortedIndexBy_default2 = sortedIndexBy2; -}); - -// ../node_modules/lodash-es/sortedIndexOf.js -function sortedIndexOf2(array3, value) { - var length = array3 == null ? 0 : array3.length; - if (length) { - var index = _baseSortedIndex_default2(array3, value); - if (index < length && eq_default2(array3[index], value)) { - return index; - } - } - return -1; -} -var sortedIndexOf_default2; -var init_sortedIndexOf2 = __esm(() => { - init__baseSortedIndex2(); - init_eq2(); - sortedIndexOf_default2 = sortedIndexOf2; -}); - -// ../node_modules/lodash-es/sortedLastIndex.js -function sortedLastIndex2(array3, value) { - return _baseSortedIndex_default2(array3, value, true); -} -var sortedLastIndex_default2; -var init_sortedLastIndex2 = __esm(() => { - init__baseSortedIndex2(); - sortedLastIndex_default2 = sortedLastIndex2; -}); - -// ../node_modules/lodash-es/sortedLastIndexBy.js -function sortedLastIndexBy2(array3, value, iteratee3) { - return _baseSortedIndexBy_default2(array3, value, _baseIteratee_default2(iteratee3, 2), true); -} -var sortedLastIndexBy_default2; -var init_sortedLastIndexBy2 = __esm(() => { - init__baseIteratee2(); - init__baseSortedIndexBy2(); - sortedLastIndexBy_default2 = sortedLastIndexBy2; -}); - -// ../node_modules/lodash-es/sortedLastIndexOf.js -function sortedLastIndexOf2(array3, value) { - var length = array3 == null ? 0 : array3.length; - if (length) { - var index = _baseSortedIndex_default2(array3, value, true) - 1; - if (eq_default2(array3[index], value)) { - return index; - } - } - return -1; -} -var sortedLastIndexOf_default2; -var init_sortedLastIndexOf2 = __esm(() => { - init__baseSortedIndex2(); - init_eq2(); - sortedLastIndexOf_default2 = sortedLastIndexOf2; -}); - -// ../node_modules/lodash-es/_baseSortedUniq.js -function baseSortedUniq2(array3, iteratee3) { - var index = -1, length = array3.length, resIndex = 0, result3 = []; - while (++index < length) { - var value = array3[index], computed = iteratee3 ? iteratee3(value) : value; - if (!index || !eq_default2(computed, seen)) { - var seen = computed; - result3[resIndex++] = value === 0 ? 0 : value; - } - } - return result3; -} -var _baseSortedUniq_default2; -var init__baseSortedUniq2 = __esm(() => { - init_eq2(); - _baseSortedUniq_default2 = baseSortedUniq2; -}); - -// ../node_modules/lodash-es/sortedUniq.js -function sortedUniq2(array3) { - return array3 && array3.length ? _baseSortedUniq_default2(array3) : []; -} -var sortedUniq_default2; -var init_sortedUniq2 = __esm(() => { - init__baseSortedUniq2(); - sortedUniq_default2 = sortedUniq2; -}); - -// ../node_modules/lodash-es/sortedUniqBy.js -function sortedUniqBy2(array3, iteratee3) { - return array3 && array3.length ? _baseSortedUniq_default2(array3, _baseIteratee_default2(iteratee3, 2)) : []; -} -var sortedUniqBy_default2; -var init_sortedUniqBy2 = __esm(() => { - init__baseIteratee2(); - init__baseSortedUniq2(); - sortedUniqBy_default2 = sortedUniqBy2; -}); - -// ../node_modules/lodash-es/split.js -function split2(string5, separator, limit) { - if (limit && typeof limit != "number" && _isIterateeCall_default2(string5, separator, limit)) { - separator = limit = undefined; - } - limit = limit === undefined ? MAX_ARRAY_LENGTH12 : limit >>> 0; - if (!limit) { - return []; - } - string5 = toString_default2(string5); - if (string5 && (typeof separator == "string" || separator != null && !isRegExp_default2(separator))) { - separator = _baseToString_default2(separator); - if (!separator && _hasUnicode_default2(string5)) { - return _castSlice_default2(_stringToArray_default2(string5), 0, limit); - } - } - return string5.split(separator, limit); -} -var MAX_ARRAY_LENGTH12 = 4294967295, split_default2; -var init_split3 = __esm(() => { - init__baseToString2(); - init__castSlice2(); - init__hasUnicode2(); - init__isIterateeCall2(); - init_isRegExp2(); - init__stringToArray2(); - init_toString2(); - split_default2 = split2; -}); - -// ../node_modules/lodash-es/spread.js -function spread4(func, start) { - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT23); - } - start = start == null ? 0 : nativeMax31(toInteger_default2(start), 0); - return _baseRest_default2(function(args) { - var array3 = args[start], otherArgs = _castSlice_default2(args, 0, start); - if (array3) { - _arrayPush_default2(otherArgs, array3); - } - return _apply_default2(func, this, otherArgs); - }); -} -var FUNC_ERROR_TEXT23 = "Expected a function", nativeMax31, spread_default2; -var init_spread2 = __esm(() => { - init__apply2(); - init__arrayPush2(); - init__baseRest2(); - init__castSlice2(); - init_toInteger2(); - nativeMax31 = Math.max; - spread_default2 = spread4; -}); - -// ../node_modules/lodash-es/startCase.js -var startCase2, startCase_default2; -var init_startCase2 = __esm(() => { - init__createCompounder2(); - init_upperFirst2(); - startCase2 = _createCompounder_default2(function(result3, word, index) { - return result3 + (index ? " " : "") + upperFirst_default2(word); - }); - startCase_default2 = startCase2; -}); - -// ../node_modules/lodash-es/startsWith.js -function startsWith2(string5, target, position) { - string5 = toString_default2(string5); - position = position == null ? 0 : _baseClamp_default2(toInteger_default2(position), 0, string5.length); - target = _baseToString_default2(target); - return string5.slice(position, position + target.length) == target; -} -var startsWith_default2; -var init_startsWith2 = __esm(() => { - init__baseClamp2(); - init__baseToString2(); - init_toInteger2(); - init_toString2(); - startsWith_default2 = startsWith2; -}); - -// ../node_modules/lodash-es/stubObject.js -function stubObject2() { - return {}; -} -var stubObject_default2; -var init_stubObject2 = __esm(() => { - stubObject_default2 = stubObject2; -}); - -// ../node_modules/lodash-es/stubString.js -function stubString2() { - return ""; -} -var stubString_default2; -var init_stubString2 = __esm(() => { - stubString_default2 = stubString2; -}); - -// ../node_modules/lodash-es/stubTrue.js -function stubTrue2() { - return true; -} -var stubTrue_default2; -var init_stubTrue2 = __esm(() => { - stubTrue_default2 = stubTrue2; -}); - -// ../node_modules/lodash-es/subtract.js -var subtract2, subtract_default2; -var init_subtract2 = __esm(() => { - init__createMathOperation2(); - subtract2 = _createMathOperation_default2(function(minuend, subtrahend) { - return minuend - subtrahend; - }, 0); - subtract_default2 = subtract2; -}); - -// ../node_modules/lodash-es/sum.js -function sum2(array3) { - return array3 && array3.length ? _baseSum_default2(array3, identity_default3) : 0; -} -var sum_default2; -var init_sum2 = __esm(() => { - init__baseSum2(); - init_identity3(); - sum_default2 = sum2; -}); - -// ../node_modules/lodash-es/sumBy.js -function sumBy2(array3, iteratee3) { - return array3 && array3.length ? _baseSum_default2(array3, _baseIteratee_default2(iteratee3, 2)) : 0; -} -var sumBy_default2; -var init_sumBy2 = __esm(() => { - init__baseIteratee2(); - init__baseSum2(); - sumBy_default2 = sumBy2; -}); - -// ../node_modules/lodash-es/tail.js -function tail2(array3) { - var length = array3 == null ? 0 : array3.length; - return length ? _baseSlice_default2(array3, 1, length) : []; -} -var tail_default2; -var init_tail2 = __esm(() => { - init__baseSlice2(); - tail_default2 = tail2; -}); - -// ../node_modules/lodash-es/take.js -function take3(array3, n2, guard) { - if (!(array3 && array3.length)) { - return []; - } - n2 = guard || n2 === undefined ? 1 : toInteger_default2(n2); - return _baseSlice_default2(array3, 0, n2 < 0 ? 0 : n2); -} -var take_default2; -var init_take2 = __esm(() => { - init__baseSlice2(); - init_toInteger2(); - take_default2 = take3; -}); - -// ../node_modules/lodash-es/takeRight.js -function takeRight2(array3, n2, guard) { - var length = array3 == null ? 0 : array3.length; - if (!length) { - return []; - } - n2 = guard || n2 === undefined ? 1 : toInteger_default2(n2); - n2 = length - n2; - return _baseSlice_default2(array3, n2 < 0 ? 0 : n2, length); -} -var takeRight_default2; -var init_takeRight2 = __esm(() => { - init__baseSlice2(); - init_toInteger2(); - takeRight_default2 = takeRight2; -}); - -// ../node_modules/lodash-es/takeRightWhile.js -function takeRightWhile2(array3, predicate) { - return array3 && array3.length ? _baseWhile_default2(array3, _baseIteratee_default2(predicate, 3), false, true) : []; -} -var takeRightWhile_default2; -var init_takeRightWhile2 = __esm(() => { - init__baseIteratee2(); - init__baseWhile2(); - takeRightWhile_default2 = takeRightWhile2; -}); - -// ../node_modules/lodash-es/takeWhile.js -function takeWhile2(array3, predicate) { - return array3 && array3.length ? _baseWhile_default2(array3, _baseIteratee_default2(predicate, 3)) : []; -} -var takeWhile_default2; -var init_takeWhile2 = __esm(() => { - init__baseIteratee2(); - init__baseWhile2(); - takeWhile_default2 = takeWhile2; -}); - -// ../node_modules/lodash-es/tap.js -function tap2(value, interceptor) { - interceptor(value); - return value; -} -var tap_default2; -var init_tap2 = __esm(() => { - tap_default2 = tap2; -}); - -// ../node_modules/lodash-es/_customDefaultsAssignIn.js -function customDefaultsAssignIn2(objValue, srcValue, key, object4) { - if (objValue === undefined || eq_default2(objValue, objectProto58[key]) && !hasOwnProperty51.call(object4, key)) { - return srcValue; - } - return objValue; -} -var objectProto58, hasOwnProperty51, _customDefaultsAssignIn_default2; -var init__customDefaultsAssignIn2 = __esm(() => { - init_eq2(); - objectProto58 = Object.prototype; - hasOwnProperty51 = objectProto58.hasOwnProperty; - _customDefaultsAssignIn_default2 = customDefaultsAssignIn2; -}); - -// ../node_modules/lodash-es/_escapeStringChar.js -function escapeStringChar2(chr) { - return "\\" + stringEscapes2[chr]; -} -var stringEscapes2, _escapeStringChar_default2; -var init__escapeStringChar2 = __esm(() => { - stringEscapes2 = { - "\\": "\\", - "'": "'", - "\n": "n", - "\r": "r", - "\u2028": "u2028", - "\u2029": "u2029" - }; - _escapeStringChar_default2 = escapeStringChar2; -}); - -// ../node_modules/lodash-es/_reInterpolate.js -var reInterpolate2, _reInterpolate_default2; -var init__reInterpolate2 = __esm(() => { - reInterpolate2 = /<%=([\s\S]+?)%>/g; - _reInterpolate_default2 = reInterpolate2; -}); - -// ../node_modules/lodash-es/_reEscape.js -var reEscape2, _reEscape_default2; -var init__reEscape2 = __esm(() => { - reEscape2 = /<%-([\s\S]+?)%>/g; - _reEscape_default2 = reEscape2; -}); - -// ../node_modules/lodash-es/_reEvaluate.js -var reEvaluate2, _reEvaluate_default2; -var init__reEvaluate2 = __esm(() => { - reEvaluate2 = /<%([\s\S]+?)%>/g; - _reEvaluate_default2 = reEvaluate2; -}); - -// ../node_modules/lodash-es/templateSettings.js -var templateSettings2, templateSettings_default2; -var init_templateSettings2 = __esm(() => { - init_escape3(); - init__reEscape2(); - init__reEvaluate2(); - init__reInterpolate2(); - templateSettings2 = { - escape: _reEscape_default2, - evaluate: _reEvaluate_default2, - interpolate: _reInterpolate_default2, - variable: "", - imports: { - _: { escape: escape_default2 } - } - }; - templateSettings_default2 = templateSettings2; -}); - -// ../node_modules/lodash-es/template.js -function template2(string5, options2, guard) { - var settings = templateSettings_default2.imports._.templateSettings || templateSettings_default2; - if (guard && _isIterateeCall_default2(string5, options2, guard)) { - options2 = undefined; - } - string5 = toString_default2(string5); - options2 = assignInWith_default2({}, options2, settings, _customDefaultsAssignIn_default2); - var imports = assignInWith_default2({}, options2.imports, settings.imports, _customDefaultsAssignIn_default2), importsKeys = keys_default2(imports), importsValues = _baseValues_default2(imports, importsKeys); - var isEscaping, isEvaluating, index = 0, interpolate = options2.interpolate || reNoMatch2, source = "__p += '"; - var reDelimiters = RegExp((options2.escape || reNoMatch2).source + "|" + interpolate.source + "|" + (interpolate === _reInterpolate_default2 ? reEsTemplate2 : reNoMatch2).source + "|" + (options2.evaluate || reNoMatch2).source + "|$", "g"); - var sourceURL = hasOwnProperty52.call(options2, "sourceURL") ? "//# sourceURL=" + (options2.sourceURL + "").replace(/\s/g, " ") + ` -` : ""; - string5.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { - interpolateValue || (interpolateValue = esTemplateValue); - source += string5.slice(index, offset).replace(reUnescapedString2, _escapeStringChar_default2); - if (escapeValue) { - isEscaping = true; - source += `' + -__e(` + escapeValue + `) + -'`; - } - if (evaluateValue) { - isEvaluating = true; - source += `'; -` + evaluateValue + `; -__p += '`; - } - if (interpolateValue) { - source += `' + -((__t = (` + interpolateValue + `)) == null ? '' : __t) + -'`; - } - index = offset + match.length; - return match; - }); - source += `'; -`; - var variable = hasOwnProperty52.call(options2, "variable") && options2.variable; - if (!variable) { - source = `with (obj) { -` + source + ` -} -`; - } else if (reForbiddenIdentifierChars2.test(variable)) { - throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT2); - } - source = (isEvaluating ? source.replace(reEmptyStringLeading2, "") : source).replace(reEmptyStringMiddle2, "$1").replace(reEmptyStringTrailing2, "$1;"); - source = "function(" + (variable || "obj") + `) { -` + (variable ? "" : `obj || (obj = {}); -`) + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? `, __j = Array.prototype.join; -` + `function print() { __p += __j.call(arguments, '') } -` : `; -`) + source + `return __p -}`; - var result3 = attempt_default2(function() { - return Function(importsKeys, sourceURL + "return " + source).apply(undefined, importsValues); - }); - result3.source = source; - if (isError_default2(result3)) { - throw result3; - } - return result3; -} -var INVALID_TEMPL_VAR_ERROR_TEXT2 = "Invalid `variable` option passed into `_.template`", reEmptyStringLeading2, reEmptyStringMiddle2, reEmptyStringTrailing2, reForbiddenIdentifierChars2, reEsTemplate2, reNoMatch2, reUnescapedString2, objectProto59, hasOwnProperty52, template_default2; -var init_template3 = __esm(() => { - init_assignInWith2(); - init_attempt2(); - init__baseValues2(); - init__customDefaultsAssignIn2(); - init__escapeStringChar2(); - init_isError2(); - init__isIterateeCall2(); - init_keys3(); - init__reInterpolate2(); - init_templateSettings2(); - init_toString2(); - reEmptyStringLeading2 = /\b__p \+= '';/g; - reEmptyStringMiddle2 = /\b(__p \+=) '' \+/g; - reEmptyStringTrailing2 = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - reForbiddenIdentifierChars2 = /[()=,{}\[\]\/\s]/; - reEsTemplate2 = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - reNoMatch2 = /($^)/; - reUnescapedString2 = /['\n\r\u2028\u2029\\]/g; - objectProto59 = Object.prototype; - hasOwnProperty52 = objectProto59.hasOwnProperty; - template_default2 = template2; -}); - -// ../node_modules/lodash-es/throttle.js -function throttle3(func, wait, options2) { - var leading = true, trailing = true; - if (typeof func != "function") { - throw new TypeError(FUNC_ERROR_TEXT24); - } - if (isObject_default2(options2)) { - leading = "leading" in options2 ? !!options2.leading : leading; - trailing = "trailing" in options2 ? !!options2.trailing : trailing; - } - return debounce_default2(func, wait, { - leading, - maxWait: wait, - trailing - }); -} -var FUNC_ERROR_TEXT24 = "Expected a function", throttle_default3; -var init_throttle3 = __esm(() => { - init_debounce2(); - init_isObject2(); - throttle_default3 = throttle3; -}); - -// ../node_modules/lodash-es/thru.js -function thru2(value, interceptor) { - return interceptor(value); -} -var thru_default2; -var init_thru2 = __esm(() => { - thru_default2 = thru2; -}); - -// ../node_modules/lodash-es/times.js -function times2(n2, iteratee3) { - n2 = toInteger_default2(n2); - if (n2 < 1 || n2 > MAX_SAFE_INTEGER11) { - return []; - } - var index = MAX_ARRAY_LENGTH13, length = nativeMin27(n2, MAX_ARRAY_LENGTH13); - iteratee3 = _castFunction_default2(iteratee3); - n2 -= MAX_ARRAY_LENGTH13; - var result3 = _baseTimes_default2(length, iteratee3); - while (++index < n2) { - iteratee3(index); - } - return result3; -} -var MAX_SAFE_INTEGER11 = 9007199254740991, MAX_ARRAY_LENGTH13 = 4294967295, nativeMin27, times_default2; -var init_times2 = __esm(() => { - init__baseTimes2(); - init__castFunction2(); - init_toInteger2(); - nativeMin27 = Math.min; - times_default2 = times2; -}); - -// ../node_modules/lodash-es/toIterator.js -function wrapperToIterator2() { - return this; -} -var toIterator_default2; -var init_toIterator2 = __esm(() => { - toIterator_default2 = wrapperToIterator2; -}); - -// ../node_modules/lodash-es/_baseWrapperValue.js -function baseWrapperValue2(value, actions) { - var result3 = value; - if (result3 instanceof _LazyWrapper_default2) { - result3 = result3.value(); - } - return _arrayReduce_default2(actions, function(result4, action) { - return action.func.apply(action.thisArg, _arrayPush_default2([result4], action.args)); - }, result3); -} -var _baseWrapperValue_default2; -var init__baseWrapperValue2 = __esm(() => { - init__LazyWrapper2(); - init__arrayPush2(); - init__arrayReduce2(); - _baseWrapperValue_default2 = baseWrapperValue2; -}); - -// ../node_modules/lodash-es/wrapperValue.js -function wrapperValue2() { - return _baseWrapperValue_default2(this.__wrapped__, this.__actions__); -} -var wrapperValue_default2; -var init_wrapperValue2 = __esm(() => { - init__baseWrapperValue2(); - wrapperValue_default2 = wrapperValue2; -}); - -// ../node_modules/lodash-es/toJSON.js -var init_toJSON2 = __esm(() => { - init_wrapperValue2(); -}); - -// ../node_modules/lodash-es/toLower.js -function toLower2(value) { - return toString_default2(value).toLowerCase(); -} -var toLower_default2; -var init_toLower2 = __esm(() => { - init_toString2(); - toLower_default2 = toLower2; -}); - -// ../node_modules/lodash-es/toPath.js -function toPath3(value) { - if (isArray_default2(value)) { - return _arrayMap_default2(value, _toKey_default2); - } - return isSymbol_default2(value) ? [value] : _copyArray_default2(_stringToPath_default2(toString_default2(value))); -} -var toPath_default2; -var init_toPath2 = __esm(() => { - init__arrayMap2(); - init__copyArray2(); - init_isArray2(); - init_isSymbol2(); - init__stringToPath2(); - init__toKey2(); - init_toString2(); - toPath_default2 = toPath3; -}); - -// ../node_modules/lodash-es/toSafeInteger.js -function toSafeInteger2(value) { - return value ? _baseClamp_default2(toInteger_default2(value), -MAX_SAFE_INTEGER12, MAX_SAFE_INTEGER12) : value === 0 ? value : 0; -} -var MAX_SAFE_INTEGER12 = 9007199254740991, toSafeInteger_default2; -var init_toSafeInteger2 = __esm(() => { - init__baseClamp2(); - init_toInteger2(); - toSafeInteger_default2 = toSafeInteger2; -}); - -// ../node_modules/lodash-es/toUpper.js -function toUpper2(value) { - return toString_default2(value).toUpperCase(); -} -var toUpper_default2; -var init_toUpper2 = __esm(() => { - init_toString2(); - toUpper_default2 = toUpper2; -}); - -// ../node_modules/lodash-es/transform.js -function transform3(object4, iteratee3, accumulator) { - var isArr = isArray_default2(object4), isArrLike = isArr || isBuffer_default2(object4) || isTypedArray_default2(object4); - iteratee3 = _baseIteratee_default2(iteratee3, 4); - if (accumulator == null) { - var Ctor = object4 && object4.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } else if (isObject_default2(object4)) { - accumulator = isFunction_default2(Ctor) ? _baseCreate_default2(_getPrototype_default2(object4)) : {}; - } else { - accumulator = {}; - } - } - (isArrLike ? _arrayEach_default2 : _baseForOwn_default2)(object4, function(value, index, object5) { - return iteratee3(accumulator, value, index, object5); - }); - return accumulator; -} -var transform_default2; -var init_transform2 = __esm(() => { - init__arrayEach2(); - init__baseCreate2(); - init__baseForOwn2(); - init__baseIteratee2(); - init__getPrototype2(); - init_isArray2(); - init_isBuffer2(); - init_isFunction2(); - init_isObject2(); - init_isTypedArray2(); - transform_default2 = transform3; -}); - -// ../node_modules/lodash-es/_charsEndIndex.js -function charsEndIndex2(strSymbols, chrSymbols) { - var index = strSymbols.length; - while (index-- && _baseIndexOf_default2(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} -var _charsEndIndex_default2; -var init__charsEndIndex2 = __esm(() => { - init__baseIndexOf2(); - _charsEndIndex_default2 = charsEndIndex2; -}); - -// ../node_modules/lodash-es/_charsStartIndex.js -function charsStartIndex2(strSymbols, chrSymbols) { - var index = -1, length = strSymbols.length; - while (++index < length && _baseIndexOf_default2(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} -var _charsStartIndex_default2; -var init__charsStartIndex2 = __esm(() => { - init__baseIndexOf2(); - _charsStartIndex_default2 = charsStartIndex2; -}); - -// ../node_modules/lodash-es/trim.js -function trim3(string5, chars, guard) { - string5 = toString_default2(string5); - if (string5 && (guard || chars === undefined)) { - return _baseTrim_default2(string5); - } - if (!string5 || !(chars = _baseToString_default2(chars))) { - return string5; - } - var strSymbols = _stringToArray_default2(string5), chrSymbols = _stringToArray_default2(chars), start = _charsStartIndex_default2(strSymbols, chrSymbols), end = _charsEndIndex_default2(strSymbols, chrSymbols) + 1; - return _castSlice_default2(strSymbols, start, end).join(""); -} -var trim_default2; -var init_trim2 = __esm(() => { - init__baseToString2(); - init__baseTrim2(); - init__castSlice2(); - init__charsEndIndex2(); - init__charsStartIndex2(); - init__stringToArray2(); - init_toString2(); - trim_default2 = trim3; -}); - -// ../node_modules/lodash-es/trimEnd.js -function trimEnd2(string5, chars, guard) { - string5 = toString_default2(string5); - if (string5 && (guard || chars === undefined)) { - return string5.slice(0, _trimmedEndIndex_default2(string5) + 1); - } - if (!string5 || !(chars = _baseToString_default2(chars))) { - return string5; - } - var strSymbols = _stringToArray_default2(string5), end = _charsEndIndex_default2(strSymbols, _stringToArray_default2(chars)) + 1; - return _castSlice_default2(strSymbols, 0, end).join(""); -} -var trimEnd_default2; -var init_trimEnd2 = __esm(() => { - init__baseToString2(); - init__castSlice2(); - init__charsEndIndex2(); - init__stringToArray2(); - init_toString2(); - init__trimmedEndIndex2(); - trimEnd_default2 = trimEnd2; -}); - -// ../node_modules/lodash-es/trimStart.js -function trimStart2(string5, chars, guard) { - string5 = toString_default2(string5); - if (string5 && (guard || chars === undefined)) { - return string5.replace(reTrimStart6, ""); - } - if (!string5 || !(chars = _baseToString_default2(chars))) { - return string5; - } - var strSymbols = _stringToArray_default2(string5), start = _charsStartIndex_default2(strSymbols, _stringToArray_default2(chars)); - return _castSlice_default2(strSymbols, start).join(""); -} -var reTrimStart6, trimStart_default2; -var init_trimStart2 = __esm(() => { - init__baseToString2(); - init__castSlice2(); - init__charsStartIndex2(); - init__stringToArray2(); - init_toString2(); - reTrimStart6 = /^\s+/; - trimStart_default2 = trimStart2; -}); - -// ../node_modules/lodash-es/truncate.js -function truncate4(string5, options2) { - var length = DEFAULT_TRUNC_LENGTH2, omission = DEFAULT_TRUNC_OMISSION2; - if (isObject_default2(options2)) { - var separator = "separator" in options2 ? options2.separator : separator; - length = "length" in options2 ? toInteger_default2(options2.length) : length; - omission = "omission" in options2 ? _baseToString_default2(options2.omission) : omission; - } - string5 = toString_default2(string5); - var strLength = string5.length; - if (_hasUnicode_default2(string5)) { - var strSymbols = _stringToArray_default2(string5); - strLength = strSymbols.length; - } - if (length >= strLength) { - return string5; - } - var end = length - _stringSize_default2(omission); - if (end < 1) { - return omission; - } - var result3 = strSymbols ? _castSlice_default2(strSymbols, 0, end).join("") : string5.slice(0, end); - if (separator === undefined) { - return result3 + omission; - } - if (strSymbols) { - end += result3.length - end; - } - if (isRegExp_default2(separator)) { - if (string5.slice(end).search(separator)) { - var match, substring = result3; - if (!separator.global) { - separator = RegExp(separator.source, toString_default2(reFlags4.exec(separator)) + "g"); - } - separator.lastIndex = 0; - while (match = separator.exec(substring)) { - var newEnd = match.index; - } - result3 = result3.slice(0, newEnd === undefined ? end : newEnd); - } - } else if (string5.indexOf(_baseToString_default2(separator), end) != end) { - var index = result3.lastIndexOf(separator); - if (index > -1) { - result3 = result3.slice(0, index); - } - } - return result3 + omission; -} -var DEFAULT_TRUNC_LENGTH2 = 30, DEFAULT_TRUNC_OMISSION2 = "...", reFlags4, truncate_default2; -var init_truncate3 = __esm(() => { - init__baseToString2(); - init__castSlice2(); - init__hasUnicode2(); - init_isObject2(); - init_isRegExp2(); - init__stringSize2(); - init__stringToArray2(); - init_toInteger2(); - init_toString2(); - reFlags4 = /\w*$/; - truncate_default2 = truncate4; -}); - -// ../node_modules/lodash-es/unary.js -function unary2(func) { - return ary_default2(func, 1); -} -var unary_default2; -var init_unary2 = __esm(() => { - init_ary2(); - unary_default2 = unary2; -}); - -// ../node_modules/lodash-es/_unescapeHtmlChar.js -var htmlUnescapes2, unescapeHtmlChar2, _unescapeHtmlChar_default2; -var init__unescapeHtmlChar2 = __esm(() => { - init__basePropertyOf2(); - htmlUnescapes2 = { - "&": "&", - "<": "<", - ">": ">", - """: '"', - "'": "'" - }; - unescapeHtmlChar2 = _basePropertyOf_default2(htmlUnescapes2); - _unescapeHtmlChar_default2 = unescapeHtmlChar2; -}); - -// ../node_modules/lodash-es/unescape.js -function unescape3(string5) { - string5 = toString_default2(string5); - return string5 && reHasEscapedHtml2.test(string5) ? string5.replace(reEscapedHtml2, _unescapeHtmlChar_default2) : string5; -} -var reEscapedHtml2, reHasEscapedHtml2, unescape_default2; -var init_unescape2 = __esm(() => { - init_toString2(); - init__unescapeHtmlChar2(); - reEscapedHtml2 = /&(?:amp|lt|gt|quot|#39);/g; - reHasEscapedHtml2 = RegExp(reEscapedHtml2.source); - unescape_default2 = unescape3; -}); - -// ../node_modules/lodash-es/_createSet.js -var INFINITY12, createSet2, _createSet_default2; -var init__createSet2 = __esm(() => { - init__Set2(); - init_noop2(); - init__setToArray2(); - INFINITY12 = 1 / 0; - createSet2 = !(_Set_default2 && 1 / _setToArray_default2(new _Set_default2([, -0]))[1] == INFINITY12) ? noop_default2 : function(values4) { - return new _Set_default2(values4); - }; - _createSet_default2 = createSet2; -}); - -// ../node_modules/lodash-es/_baseUniq.js -function baseUniq2(array3, iteratee3, comparator) { - var index = -1, includes3 = _arrayIncludes_default2, length = array3.length, isCommon = true, result3 = [], seen = result3; - if (comparator) { - isCommon = false; - includes3 = _arrayIncludesWith_default2; - } else if (length >= LARGE_ARRAY_SIZE6) { - var set5 = iteratee3 ? null : _createSet_default2(array3); - if (set5) { - return _setToArray_default2(set5); - } - isCommon = false; - includes3 = _cacheHas_default2; - seen = new _SetCache_default2; - } else { - seen = iteratee3 ? [] : result3; - } - outer: - while (++index < length) { - var value = array3[index], computed = iteratee3 ? iteratee3(value) : value; - value = comparator || value !== 0 ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee3) { - seen.push(computed); - } - result3.push(value); - } else if (!includes3(seen, computed, comparator)) { - if (seen !== result3) { - seen.push(computed); - } - result3.push(value); - } - } - return result3; -} -var LARGE_ARRAY_SIZE6 = 200, _baseUniq_default2; -var init__baseUniq2 = __esm(() => { - init__SetCache2(); - init__arrayIncludes2(); - init__arrayIncludesWith2(); - init__cacheHas2(); - init__createSet2(); - init__setToArray2(); - _baseUniq_default2 = baseUniq2; -}); - -// ../node_modules/lodash-es/union.js -var union4, union_default2; -var init_union3 = __esm(() => { - init__baseFlatten2(); - init__baseRest2(); - init__baseUniq2(); - init_isArrayLikeObject2(); - union4 = _baseRest_default2(function(arrays) { - return _baseUniq_default2(_baseFlatten_default2(arrays, 1, isArrayLikeObject_default2, true)); - }); - union_default2 = union4; -}); - -// ../node_modules/lodash-es/unionBy.js -var unionBy2, unionBy_default2; -var init_unionBy2 = __esm(() => { - init__baseFlatten2(); - init__baseIteratee2(); - init__baseRest2(); - init__baseUniq2(); - init_isArrayLikeObject2(); - init_last2(); - unionBy2 = _baseRest_default2(function(arrays) { - var iteratee3 = last_default2(arrays); - if (isArrayLikeObject_default2(iteratee3)) { - iteratee3 = undefined; - } - return _baseUniq_default2(_baseFlatten_default2(arrays, 1, isArrayLikeObject_default2, true), _baseIteratee_default2(iteratee3, 2)); - }); - unionBy_default2 = unionBy2; -}); - -// ../node_modules/lodash-es/unionWith.js -var unionWith2, unionWith_default2; -var init_unionWith2 = __esm(() => { - init__baseFlatten2(); - init__baseRest2(); - init__baseUniq2(); - init_isArrayLikeObject2(); - init_last2(); - unionWith2 = _baseRest_default2(function(arrays) { - var comparator = last_default2(arrays); - comparator = typeof comparator == "function" ? comparator : undefined; - return _baseUniq_default2(_baseFlatten_default2(arrays, 1, isArrayLikeObject_default2, true), undefined, comparator); - }); - unionWith_default2 = unionWith2; -}); - -// ../node_modules/lodash-es/uniq.js -function uniq3(array3) { - return array3 && array3.length ? _baseUniq_default2(array3) : []; -} -var uniq_default2; -var init_uniq2 = __esm(() => { - init__baseUniq2(); - uniq_default2 = uniq3; -}); - -// ../node_modules/lodash-es/uniqBy.js -function uniqBy2(array3, iteratee3) { - return array3 && array3.length ? _baseUniq_default2(array3, _baseIteratee_default2(iteratee3, 2)) : []; -} -var uniqBy_default2; -var init_uniqBy2 = __esm(() => { - init__baseIteratee2(); - init__baseUniq2(); - uniqBy_default2 = uniqBy2; -}); - -// ../node_modules/lodash-es/uniqWith.js -function uniqWith2(array3, comparator) { - comparator = typeof comparator == "function" ? comparator : undefined; - return array3 && array3.length ? _baseUniq_default2(array3, undefined, comparator) : []; -} -var uniqWith_default2; -var init_uniqWith2 = __esm(() => { - init__baseUniq2(); - uniqWith_default2 = uniqWith2; -}); - -// ../node_modules/lodash-es/uniqueId.js -function uniqueId2(prefix) { - var id = ++idCounter2; - return toString_default2(prefix) + id; -} -var idCounter2 = 0, uniqueId_default2; -var init_uniqueId2 = __esm(() => { - init_toString2(); - uniqueId_default2 = uniqueId2; -}); - -// ../node_modules/lodash-es/unset.js -function unset2(object4, path13) { - return object4 == null ? true : _baseUnset_default2(object4, path13); -} -var unset_default2; -var init_unset2 = __esm(() => { - init__baseUnset2(); - unset_default2 = unset2; -}); - -// ../node_modules/lodash-es/unzip.js -function unzip2(array3) { - if (!(array3 && array3.length)) { - return []; - } - var length = 0; - array3 = _arrayFilter_default2(array3, function(group) { - if (isArrayLikeObject_default2(group)) { - length = nativeMax32(group.length, length); - return true; - } - }); - return _baseTimes_default2(length, function(index) { - return _arrayMap_default2(array3, _baseProperty_default2(index)); - }); -} -var nativeMax32, unzip_default2; -var init_unzip2 = __esm(() => { - init__arrayFilter2(); - init__arrayMap2(); - init__baseProperty2(); - init__baseTimes2(); - init_isArrayLikeObject2(); - nativeMax32 = Math.max; - unzip_default2 = unzip2; -}); - -// ../node_modules/lodash-es/unzipWith.js -function unzipWith2(array3, iteratee3) { - if (!(array3 && array3.length)) { - return []; - } - var result3 = unzip_default2(array3); - if (iteratee3 == null) { - return result3; - } - return _arrayMap_default2(result3, function(group) { - return _apply_default2(iteratee3, undefined, group); - }); -} -var unzipWith_default2; -var init_unzipWith2 = __esm(() => { - init__apply2(); - init__arrayMap2(); - init_unzip2(); - unzipWith_default2 = unzipWith2; -}); - -// ../node_modules/lodash-es/_baseUpdate.js -function baseUpdate2(object4, path13, updater, customizer) { - return _baseSet_default2(object4, path13, updater(_baseGet_default2(object4, path13)), customizer); -} -var _baseUpdate_default2; -var init__baseUpdate2 = __esm(() => { - init__baseGet2(); - init__baseSet2(); - _baseUpdate_default2 = baseUpdate2; -}); - -// ../node_modules/lodash-es/update.js -function update2(object4, path13, updater) { - return object4 == null ? object4 : _baseUpdate_default2(object4, path13, _castFunction_default2(updater)); -} -var update_default2; -var init_update2 = __esm(() => { - init__baseUpdate2(); - init__castFunction2(); - update_default2 = update2; -}); - -// ../node_modules/lodash-es/updateWith.js -function updateWith2(object4, path13, updater, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined; - return object4 == null ? object4 : _baseUpdate_default2(object4, path13, _castFunction_default2(updater), customizer); -} -var updateWith_default2; -var init_updateWith2 = __esm(() => { - init__baseUpdate2(); - init__castFunction2(); - updateWith_default2 = updateWith2; -}); - -// ../node_modules/lodash-es/upperCase.js -var upperCase2, upperCase_default2; -var init_upperCase2 = __esm(() => { - init__createCompounder2(); - upperCase2 = _createCompounder_default2(function(result3, word, index) { - return result3 + (index ? " " : "") + word.toUpperCase(); - }); - upperCase_default2 = upperCase2; -}); - -// ../node_modules/lodash-es/value.js -var init_value2 = __esm(() => { - init_wrapperValue2(); -}); - -// ../node_modules/lodash-es/valueOf.js -var init_valueOf2 = __esm(() => { - init_wrapperValue2(); -}); - -// ../node_modules/lodash-es/valuesIn.js -function valuesIn2(object4) { - return object4 == null ? [] : _baseValues_default2(object4, keysIn_default2(object4)); -} -var valuesIn_default2; -var init_valuesIn2 = __esm(() => { - init__baseValues2(); - init_keysIn2(); - valuesIn_default2 = valuesIn2; -}); - -// ../node_modules/lodash-es/without.js -var without2, without_default2; -var init_without2 = __esm(() => { - init__baseDifference2(); - init__baseRest2(); - init_isArrayLikeObject2(); - without2 = _baseRest_default2(function(array3, values4) { - return isArrayLikeObject_default2(array3) ? _baseDifference_default2(array3, values4) : []; - }); - without_default2 = without2; -}); - -// ../node_modules/lodash-es/wrap.js -function wrap2(value, wrapper) { - return partial_default2(_castFunction_default2(wrapper), value); -} -var wrap_default2; -var init_wrap2 = __esm(() => { - init__castFunction2(); - init_partial2(); - wrap_default2 = wrap2; -}); - -// ../node_modules/lodash-es/wrapperAt.js -var wrapperAt2, wrapperAt_default2; -var init_wrapperAt2 = __esm(() => { - init__LazyWrapper2(); - init__LodashWrapper2(); - init__baseAt2(); - init__flatRest2(); - init__isIndex2(); - init_thru2(); - wrapperAt2 = _flatRest_default2(function(paths2) { - var length = paths2.length, start = length ? paths2[0] : 0, value = this.__wrapped__, interceptor = function(object4) { - return _baseAt_default2(object4, paths2); - }; - if (length > 1 || this.__actions__.length || !(value instanceof _LazyWrapper_default2) || !_isIndex_default2(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ - func: thru_default2, - args: [interceptor], - thisArg: undefined - }); - return new _LodashWrapper_default2(value, this.__chain__).thru(function(array3) { - if (length && !array3.length) { - array3.push(undefined); - } - return array3; - }); - }); - wrapperAt_default2 = wrapperAt2; -}); - -// ../node_modules/lodash-es/wrapperChain.js -function wrapperChain2() { - return chain_default2(this); -} -var wrapperChain_default2; -var init_wrapperChain2 = __esm(() => { - init_chain2(); - wrapperChain_default2 = wrapperChain2; -}); - -// ../node_modules/lodash-es/wrapperReverse.js -function wrapperReverse2() { - var value = this.__wrapped__; - if (value instanceof _LazyWrapper_default2) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new _LazyWrapper_default2(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - func: thru_default2, - args: [reverse_default2], - thisArg: undefined - }); - return new _LodashWrapper_default2(wrapped, this.__chain__); - } - return this.thru(reverse_default2); -} -var wrapperReverse_default2; -var init_wrapperReverse2 = __esm(() => { - init__LazyWrapper2(); - init__LodashWrapper2(); - init_reverse2(); - init_thru2(); - wrapperReverse_default2 = wrapperReverse2; -}); - -// ../node_modules/lodash-es/_baseXor.js -function baseXor2(arrays, iteratee3, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? _baseUniq_default2(arrays[0]) : []; - } - var index = -1, result3 = Array(length); - while (++index < length) { - var array3 = arrays[index], othIndex = -1; - while (++othIndex < length) { - if (othIndex != index) { - result3[index] = _baseDifference_default2(result3[index] || array3, arrays[othIndex], iteratee3, comparator); - } - } - } - return _baseUniq_default2(_baseFlatten_default2(result3, 1), iteratee3, comparator); -} -var _baseXor_default2; -var init__baseXor2 = __esm(() => { - init__baseDifference2(); - init__baseFlatten2(); - init__baseUniq2(); - _baseXor_default2 = baseXor2; -}); - -// ../node_modules/lodash-es/xor.js -var xor2, xor_default2; -var init_xor2 = __esm(() => { - init__arrayFilter2(); - init__baseRest2(); - init__baseXor2(); - init_isArrayLikeObject2(); - xor2 = _baseRest_default2(function(arrays) { - return _baseXor_default2(_arrayFilter_default2(arrays, isArrayLikeObject_default2)); - }); - xor_default2 = xor2; -}); - -// ../node_modules/lodash-es/xorBy.js -var xorBy2, xorBy_default2; -var init_xorBy2 = __esm(() => { - init__arrayFilter2(); - init__baseIteratee2(); - init__baseRest2(); - init__baseXor2(); - init_isArrayLikeObject2(); - init_last2(); - xorBy2 = _baseRest_default2(function(arrays) { - var iteratee3 = last_default2(arrays); - if (isArrayLikeObject_default2(iteratee3)) { - iteratee3 = undefined; - } - return _baseXor_default2(_arrayFilter_default2(arrays, isArrayLikeObject_default2), _baseIteratee_default2(iteratee3, 2)); - }); - xorBy_default2 = xorBy2; -}); - -// ../node_modules/lodash-es/xorWith.js -var xorWith2, xorWith_default2; -var init_xorWith2 = __esm(() => { - init__arrayFilter2(); - init__baseRest2(); - init__baseXor2(); - init_isArrayLikeObject2(); - init_last2(); - xorWith2 = _baseRest_default2(function(arrays) { - var comparator = last_default2(arrays); - comparator = typeof comparator == "function" ? comparator : undefined; - return _baseXor_default2(_arrayFilter_default2(arrays, isArrayLikeObject_default2), undefined, comparator); - }); - xorWith_default2 = xorWith2; -}); - -// ../node_modules/lodash-es/zip.js -var zip2, zip_default2; -var init_zip2 = __esm(() => { - init__baseRest2(); - init_unzip2(); - zip2 = _baseRest_default2(unzip_default2); - zip_default2 = zip2; -}); - -// ../node_modules/lodash-es/_baseZipObject.js -function baseZipObject2(props, values4, assignFunc) { - var index = -1, length = props.length, valsLength = values4.length, result3 = {}; - while (++index < length) { - var value = index < valsLength ? values4[index] : undefined; - assignFunc(result3, props[index], value); - } - return result3; -} -var _baseZipObject_default2; -var init__baseZipObject2 = __esm(() => { - _baseZipObject_default2 = baseZipObject2; -}); - -// ../node_modules/lodash-es/zipObject.js -function zipObject2(props, values4) { - return _baseZipObject_default2(props || [], values4 || [], _assignValue_default2); -} -var zipObject_default2; -var init_zipObject2 = __esm(() => { - init__assignValue2(); - init__baseZipObject2(); - zipObject_default2 = zipObject2; -}); - -// ../node_modules/lodash-es/zipObjectDeep.js -function zipObjectDeep2(props, values4) { - return _baseZipObject_default2(props || [], values4 || [], _baseSet_default2); -} -var zipObjectDeep_default2; -var init_zipObjectDeep2 = __esm(() => { - init__baseSet2(); - init__baseZipObject2(); - zipObjectDeep_default2 = zipObjectDeep2; -}); - -// ../node_modules/lodash-es/zipWith.js -var zipWith2, zipWith_default2; -var init_zipWith2 = __esm(() => { - init__baseRest2(); - init_unzipWith2(); - zipWith2 = _baseRest_default2(function(arrays) { - var length = arrays.length, iteratee3 = length > 1 ? arrays[length - 1] : undefined; - iteratee3 = typeof iteratee3 == "function" ? (arrays.pop(), iteratee3) : undefined; - return unzipWith_default2(arrays, iteratee3); - }); - zipWith_default2 = zipWith2; -}); - -// ../node_modules/lodash-es/array.default.js -var array_default_default2; -var init_array_default2 = __esm(() => { - init_chunk2(); - init_compact2(); - init_concat2(); - init_difference2(); - init_differenceBy2(); - init_differenceWith2(); - init_drop2(); - init_dropRight2(); - init_dropRightWhile2(); - init_dropWhile2(); - init_fill2(); - init_findIndex2(); - init_findLastIndex2(); - init_first2(); - init_flatten2(); - init_flattenDeep2(); - init_flattenDepth2(); - init_fromPairs2(); - init_head2(); - init_indexOf2(); - init_initial2(); - init_intersection3(); - init_intersectionBy2(); - init_intersectionWith2(); - init_join2(); - init_last2(); - init_lastIndexOf2(); - init_nth2(); - init_pull2(); - init_pullAll2(); - init_pullAllBy2(); - init_pullAllWith2(); - init_pullAt2(); - init_remove2(); - init_reverse2(); - init_slice2(); - init_sortedIndex2(); - init_sortedIndexBy2(); - init_sortedIndexOf2(); - init_sortedLastIndex2(); - init_sortedLastIndexBy2(); - init_sortedLastIndexOf2(); - init_sortedUniq2(); - init_sortedUniqBy2(); - init_tail2(); - init_take2(); - init_takeRight2(); - init_takeRightWhile2(); - init_takeWhile2(); - init_union3(); - init_unionBy2(); - init_unionWith2(); - init_uniq2(); - init_uniqBy2(); - init_uniqWith2(); - init_unzip2(); - init_unzipWith2(); - init_without2(); - init_xor2(); - init_xorBy2(); - init_xorWith2(); - init_zip2(); - init_zipObject2(); - init_zipObjectDeep2(); - init_zipWith2(); - array_default_default2 = { - chunk: chunk_default2, - compact: compact_default2, - concat: concat_default2, - difference: difference_default2, - differenceBy: differenceBy_default2, - differenceWith: differenceWith_default2, - drop: drop_default2, - dropRight: dropRight_default2, - dropRightWhile: dropRightWhile_default2, - dropWhile: dropWhile_default2, - fill: fill_default2, - findIndex: findIndex_default2, - findLastIndex: findLastIndex_default2, - first: head_default2, - flatten: flatten_default2, - flattenDeep: flattenDeep_default2, - flattenDepth: flattenDepth_default2, - fromPairs: fromPairs_default2, - head: head_default2, - indexOf: indexOf_default2, - initial: initial_default2, - intersection: intersection_default2, - intersectionBy: intersectionBy_default2, - intersectionWith: intersectionWith_default2, - join: join_default2, - last: last_default2, - lastIndexOf: lastIndexOf_default2, - nth: nth_default2, - pull: pull_default2, - pullAll: pullAll_default2, - pullAllBy: pullAllBy_default2, - pullAllWith: pullAllWith_default2, - pullAt: pullAt_default2, - remove: remove_default2, - reverse: reverse_default2, - slice: slice_default2, - sortedIndex: sortedIndex_default2, - sortedIndexBy: sortedIndexBy_default2, - sortedIndexOf: sortedIndexOf_default2, - sortedLastIndex: sortedLastIndex_default2, - sortedLastIndexBy: sortedLastIndexBy_default2, - sortedLastIndexOf: sortedLastIndexOf_default2, - sortedUniq: sortedUniq_default2, - sortedUniqBy: sortedUniqBy_default2, - tail: tail_default2, - take: take_default2, - takeRight: takeRight_default2, - takeRightWhile: takeRightWhile_default2, - takeWhile: takeWhile_default2, - union: union_default2, - unionBy: unionBy_default2, - unionWith: unionWith_default2, - uniq: uniq_default2, - uniqBy: uniqBy_default2, - uniqWith: uniqWith_default2, - unzip: unzip_default2, - unzipWith: unzipWith_default2, - without: without_default2, - xor: xor_default2, - xorBy: xorBy_default2, - xorWith: xorWith_default2, - zip: zip_default2, - zipObject: zipObject_default2, - zipObjectDeep: zipObjectDeep_default2, - zipWith: zipWith_default2 - }; -}); - -// ../node_modules/lodash-es/array.js -var init_array4 = __esm(() => { - init_chunk2(); - init_compact2(); - init_concat2(); - init_difference2(); - init_differenceBy2(); - init_differenceWith2(); - init_drop2(); - init_dropRight2(); - init_dropRightWhile2(); - init_dropWhile2(); - init_fill2(); - init_findIndex2(); - init_findLastIndex2(); - init_first2(); - init_flatten2(); - init_flattenDeep2(); - init_flattenDepth2(); - init_fromPairs2(); - init_head2(); - init_indexOf2(); - init_initial2(); - init_intersection3(); - init_intersectionBy2(); - init_intersectionWith2(); - init_join2(); - init_last2(); - init_lastIndexOf2(); - init_nth2(); - init_pull2(); - init_pullAll2(); - init_pullAllBy2(); - init_pullAllWith2(); - init_pullAt2(); - init_remove2(); - init_reverse2(); - init_slice2(); - init_sortedIndex2(); - init_sortedIndexBy2(); - init_sortedIndexOf2(); - init_sortedLastIndex2(); - init_sortedLastIndexBy2(); - init_sortedLastIndexOf2(); - init_sortedUniq2(); - init_sortedUniqBy2(); - init_tail2(); - init_take2(); - init_takeRight2(); - init_takeRightWhile2(); - init_takeWhile2(); - init_union3(); - init_unionBy2(); - init_unionWith2(); - init_uniq2(); - init_uniqBy2(); - init_uniqWith2(); - init_unzip2(); - init_unzipWith2(); - init_without2(); - init_xor2(); - init_xorBy2(); - init_xorWith2(); - init_zip2(); - init_zipObject2(); - init_zipObjectDeep2(); - init_zipWith2(); - init_array_default2(); -}); - -// ../node_modules/lodash-es/collection.default.js -var collection_default_default2; -var init_collection_default2 = __esm(() => { - init_countBy2(); - init_each2(); - init_eachRight2(); - init_every2(); - init_filter2(); - init_find2(); - init_findLast2(); - init_flatMap2(); - init_flatMapDeep2(); - init_flatMapDepth2(); - init_forEach2(); - init_forEachRight2(); - init_groupBy2(); - init_includes2(); - init_invokeMap2(); - init_keyBy2(); - init_map3(); - init_orderBy2(); - init_partition2(); - init_reduce3(); - init_reduceRight2(); - init_reject3(); - init_sample2(); - init_sampleSize2(); - init_shuffle2(); - init_size2(); - init_some2(); - init_sortBy2(); - collection_default_default2 = { - countBy: countBy_default2, - each: forEach_default2, - eachRight: forEachRight_default2, - every: every_default2, - filter: filter_default2, - find: find_default2, - findLast: findLast_default2, - flatMap: flatMap_default2, - flatMapDeep: flatMapDeep_default2, - flatMapDepth: flatMapDepth_default2, - forEach: forEach_default2, - forEachRight: forEachRight_default2, - groupBy: groupBy_default2, - includes: includes_default2, - invokeMap: invokeMap_default2, - keyBy: keyBy_default2, - map: map_default2, - orderBy: orderBy_default2, - partition: partition_default2, - reduce: reduce_default2, - reduceRight: reduceRight_default2, - reject: reject_default2, - sample: sample_default2, - sampleSize: sampleSize_default2, - shuffle: shuffle_default2, - size: size_default2, - some: some_default2, - sortBy: sortBy_default2 - }; -}); - -// ../node_modules/lodash-es/collection.js -var init_collection2 = __esm(() => { - init_countBy2(); - init_each2(); - init_eachRight2(); - init_every2(); - init_filter2(); - init_find2(); - init_findLast2(); - init_flatMap2(); - init_flatMapDeep2(); - init_flatMapDepth2(); - init_forEach2(); - init_forEachRight2(); - init_groupBy2(); - init_includes2(); - init_invokeMap2(); - init_keyBy2(); - init_map3(); - init_orderBy2(); - init_partition2(); - init_reduce3(); - init_reduceRight2(); - init_reject3(); - init_sample2(); - init_sampleSize2(); - init_shuffle2(); - init_size2(); - init_some2(); - init_sortBy2(); - init_collection_default2(); -}); - -// ../node_modules/lodash-es/date.default.js -var date_default_default2; -var init_date_default2 = __esm(() => { - init_now2(); - date_default_default2 = { - now: now_default2 - }; -}); - -// ../node_modules/lodash-es/date.js -var init_date3 = __esm(() => { - init_now2(); - init_date_default2(); -}); - -// ../node_modules/lodash-es/function.default.js -var function_default_default2; -var init_function_default2 = __esm(() => { - init_after2(); - init_ary2(); - init_before2(); - init_bind3(); - init_bindKey2(); - init_curry2(); - init_curryRight2(); - init_debounce2(); - init_defer2(); - init_delay2(); - init_flip2(); - init_memoize3(); - init_negate2(); - init_once2(); - init_overArgs2(); - init_partial2(); - init_partialRight2(); - init_rearg2(); - init_rest2(); - init_spread2(); - init_throttle3(); - init_unary2(); - init_wrap2(); - function_default_default2 = { - after: after_default2, - ary: ary_default2, - before: before_default2, - bind: bind_default2, - bindKey: bindKey_default2, - curry: curry_default2, - curryRight: curryRight_default2, - debounce: debounce_default2, - defer: defer_default2, - delay: delay_default2, - flip: flip_default2, - memoize: memoize_default2, - negate: negate_default2, - once: once_default2, - overArgs: overArgs_default2, - partial: partial_default2, - partialRight: partialRight_default2, - rearg: rearg_default2, - rest: rest_default2, - spread: spread_default2, - throttle: throttle_default3, - unary: unary_default2, - wrap: wrap_default2 - }; -}); - -// ../node_modules/lodash-es/function.js -var init_function3 = __esm(() => { - init_after2(); - init_ary2(); - init_before2(); - init_bind3(); - init_bindKey2(); - init_curry2(); - init_curryRight2(); - init_debounce2(); - init_defer2(); - init_delay2(); - init_flip2(); - init_memoize3(); - init_negate2(); - init_once2(); - init_overArgs2(); - init_partial2(); - init_partialRight2(); - init_rearg2(); - init_rest2(); - init_spread2(); - init_throttle3(); - init_unary2(); - init_wrap2(); - init_function_default2(); -}); - -// ../node_modules/lodash-es/lang.default.js -var lang_default_default2; -var init_lang_default2 = __esm(() => { - init_castArray2(); - init_clone2(); - init_cloneDeep2(); - init_cloneDeepWith2(); - init_cloneWith2(); - init_conformsTo2(); - init_eq2(); - init_gt2(); - init_gte2(); - init_isArguments2(); - init_isArray2(); - init_isArrayBuffer2(); - init_isArrayLike2(); - init_isArrayLikeObject2(); - init_isBoolean2(); - init_isBuffer2(); - init_isDate2(); - init_isElement2(); - init_isEmpty2(); - init_isEqual2(); - init_isEqualWith2(); - init_isError2(); - init_isFinite2(); - init_isFunction2(); - init_isInteger2(); - init_isLength2(); - init_isMap2(); - init_isMatch2(); - init_isMatchWith2(); - init_isNaN2(); - init_isNative2(); - init_isNil2(); - init_isNull2(); - init_isNumber2(); - init_isObject2(); - init_isObjectLike2(); - init_isPlainObject2(); - init_isRegExp2(); - init_isSafeInteger2(); - init_isSet2(); - init_isString2(); - init_isSymbol2(); - init_isTypedArray2(); - init_isUndefined2(); - init_isWeakMap2(); - init_isWeakSet2(); - init_lt2(); - init_lte2(); - init_toArray2(); - init_toFinite2(); - init_toInteger2(); - init_toLength2(); - init_toNumber2(); - init_toPlainObject2(); - init_toSafeInteger2(); - init_toString2(); - lang_default_default2 = { - castArray: castArray_default2, - clone: clone_default2, - cloneDeep: cloneDeep_default2, - cloneDeepWith: cloneDeepWith_default2, - cloneWith: cloneWith_default2, - conformsTo: conformsTo_default2, - eq: eq_default2, - gt: gt_default2, - gte: gte_default2, - isArguments: isArguments_default2, - isArray: isArray_default2, - isArrayBuffer: isArrayBuffer_default2, - isArrayLike: isArrayLike_default2, - isArrayLikeObject: isArrayLikeObject_default2, - isBoolean: isBoolean_default2, - isBuffer: isBuffer_default2, - isDate: isDate_default2, - isElement: isElement_default2, - isEmpty: isEmpty_default2, - isEqual: isEqual_default2, - isEqualWith: isEqualWith_default2, - isError: isError_default2, - isFinite: isFinite_default2, - isFunction: isFunction_default2, - isInteger: isInteger_default2, - isLength: isLength_default2, - isMap: isMap_default2, - isMatch: isMatch_default2, - isMatchWith: isMatchWith_default2, - isNaN: isNaN_default2, - isNative: isNative_default2, - isNil: isNil_default2, - isNull: isNull_default2, - isNumber: isNumber_default2, - isObject: isObject_default2, - isObjectLike: isObjectLike_default2, - isPlainObject: isPlainObject_default2, - isRegExp: isRegExp_default2, - isSafeInteger: isSafeInteger_default2, - isSet: isSet_default2, - isString: isString_default2, - isSymbol: isSymbol_default2, - isTypedArray: isTypedArray_default2, - isUndefined: isUndefined_default2, - isWeakMap: isWeakMap_default2, - isWeakSet: isWeakSet_default2, - lt: lt_default2, - lte: lte_default2, - toArray: toArray_default2, - toFinite: toFinite_default2, - toInteger: toInteger_default2, - toLength: toLength_default2, - toNumber: toNumber_default2, - toPlainObject: toPlainObject_default2, - toSafeInteger: toSafeInteger_default2, - toString: toString_default2 - }; -}); - -// ../node_modules/lodash-es/lang.js -var init_lang2 = __esm(() => { - init_castArray2(); - init_clone2(); - init_cloneDeep2(); - init_cloneDeepWith2(); - init_cloneWith2(); - init_conformsTo2(); - init_eq2(); - init_gt2(); - init_gte2(); - init_isArguments2(); - init_isArray2(); - init_isArrayBuffer2(); - init_isArrayLike2(); - init_isArrayLikeObject2(); - init_isBoolean2(); - init_isBuffer2(); - init_isDate2(); - init_isElement2(); - init_isEmpty2(); - init_isEqual2(); - init_isEqualWith2(); - init_isError2(); - init_isFinite2(); - init_isFunction2(); - init_isInteger2(); - init_isLength2(); - init_isMap2(); - init_isMatch2(); - init_isMatchWith2(); - init_isNaN2(); - init_isNative2(); - init_isNil2(); - init_isNull2(); - init_isNumber2(); - init_isObject2(); - init_isObjectLike2(); - init_isPlainObject2(); - init_isRegExp2(); - init_isSafeInteger2(); - init_isSet2(); - init_isString2(); - init_isSymbol2(); - init_isTypedArray2(); - init_isUndefined2(); - init_isWeakMap2(); - init_isWeakSet2(); - init_lt2(); - init_lte2(); - init_toArray2(); - init_toFinite2(); - init_toInteger2(); - init_toLength2(); - init_toNumber2(); - init_toPlainObject2(); - init_toSafeInteger2(); - init_toString2(); - init_lang_default2(); -}); - -// ../node_modules/lodash-es/math.default.js -var math_default_default2; -var init_math_default2 = __esm(() => { - init_add3(); - init_ceil2(); - init_divide2(); - init_floor2(); - init_max2(); - init_maxBy2(); - init_mean2(); - init_meanBy2(); - init_min2(); - init_minBy2(); - init_multiply2(); - init_round2(); - init_subtract2(); - init_sum2(); - init_sumBy2(); - math_default_default2 = { - add: add_default2, - ceil: ceil_default2, - divide: divide_default2, - floor: floor_default2, - max: max_default2, - maxBy: maxBy_default2, - mean: mean_default2, - meanBy: meanBy_default2, - min: min_default2, - minBy: minBy_default2, - multiply: multiply_default2, - round: round_default2, - subtract: subtract_default2, - sum: sum_default2, - sumBy: sumBy_default2 - }; -}); - -// ../node_modules/lodash-es/math.js -var init_math2 = __esm(() => { - init_add3(); - init_ceil2(); - init_divide2(); - init_floor2(); - init_max2(); - init_maxBy2(); - init_mean2(); - init_meanBy2(); - init_min2(); - init_minBy2(); - init_multiply2(); - init_round2(); - init_subtract2(); - init_sum2(); - init_sumBy2(); - init_math_default2(); -}); - -// ../node_modules/lodash-es/number.default.js -var number_default_default2; -var init_number_default2 = __esm(() => { - init_clamp2(); - init_inRange2(); - init_random2(); - number_default_default2 = { - clamp: clamp_default2, - inRange: inRange_default2, - random: random_default2 - }; -}); - -// ../node_modules/lodash-es/number.js -var init_number3 = __esm(() => { - init_clamp2(); - init_inRange2(); - init_random2(); - init_number_default2(); -}); - -// ../node_modules/lodash-es/object.default.js -var object_default_default2; -var init_object_default2 = __esm(() => { - init_assign2(); - init_assignIn2(); - init_assignInWith2(); - init_assignWith2(); - init_at2(); - init_create3(); - init_defaults3(); - init_defaultsDeep2(); - init_entries2(); - init_entriesIn2(); - init_extend2(); - init_extendWith2(); - init_findKey2(); - init_findLastKey2(); - init_forIn2(); - init_forInRight2(); - init_forOwn2(); - init_forOwnRight2(); - init_functions2(); - init_functionsIn2(); - init_get2(); - init_has2(); - init_hasIn2(); - init_invert2(); - init_invertBy2(); - init_invoke2(); - init_keys3(); - init_keysIn2(); - init_mapKeys2(); - init_mapValues2(); - init_merge2(); - init_mergeWith2(); - init_omit2(); - init_omitBy2(); - init_pick2(); - init_pickBy2(); - init_result3(); - init_set3(); - init_setWith2(); - init_toPairs2(); - init_toPairsIn2(); - init_transform2(); - init_unset2(); - init_update2(); - init_updateWith2(); - init_values8(); - init_valuesIn2(); - object_default_default2 = { - assign: assign_default2, - assignIn: assignIn_default2, - assignInWith: assignInWith_default2, - assignWith: assignWith_default2, - at: at_default2, - create: create_default2, - defaults: defaults_default3, - defaultsDeep: defaultsDeep_default2, - entries: toPairs_default2, - entriesIn: toPairsIn_default2, - extend: assignIn_default2, - extendWith: assignInWith_default2, - findKey: findKey_default2, - findLastKey: findLastKey_default2, - forIn: forIn_default2, - forInRight: forInRight_default2, - forOwn: forOwn_default2, - forOwnRight: forOwnRight_default2, - functions: functions_default2, - functionsIn: functionsIn_default2, - get: get_default2, - has: has_default2, - hasIn: hasIn_default2, - invert: invert_default2, - invertBy: invertBy_default2, - invoke: invoke_default2, - keys: keys_default2, - keysIn: keysIn_default2, - mapKeys: mapKeys_default2, - mapValues: mapValues_default2, - merge: merge_default2, - mergeWith: mergeWith_default2, - omit: omit_default2, - omitBy: omitBy_default2, - pick: pick_default2, - pickBy: pickBy_default2, - result: result_default2, - set: set_default2, - setWith: setWith_default2, - toPairs: toPairs_default2, - toPairsIn: toPairsIn_default2, - transform: transform_default2, - unset: unset_default2, - update: update_default2, - updateWith: updateWith_default2, - values: values_default2, - valuesIn: valuesIn_default2 - }; -}); - -// ../node_modules/lodash-es/object.js -var init_object3 = __esm(() => { - init_assign2(); - init_assignIn2(); - init_assignInWith2(); - init_assignWith2(); - init_at2(); - init_create3(); - init_defaults3(); - init_defaultsDeep2(); - init_entries2(); - init_entriesIn2(); - init_extend2(); - init_extendWith2(); - init_findKey2(); - init_findLastKey2(); - init_forIn2(); - init_forInRight2(); - init_forOwn2(); - init_forOwnRight2(); - init_functions2(); - init_functionsIn2(); - init_get2(); - init_has2(); - init_hasIn2(); - init_invert2(); - init_invertBy2(); - init_invoke2(); - init_keys3(); - init_keysIn2(); - init_mapKeys2(); - init_mapValues2(); - init_merge2(); - init_mergeWith2(); - init_omit2(); - init_omitBy2(); - init_pick2(); - init_pickBy2(); - init_result3(); - init_set3(); - init_setWith2(); - init_toPairs2(); - init_toPairsIn2(); - init_transform2(); - init_unset2(); - init_update2(); - init_updateWith2(); - init_values8(); - init_valuesIn2(); - init_object_default2(); -}); - -// ../node_modules/lodash-es/seq.default.js -var seq_default_default2; -var init_seq_default2 = __esm(() => { - init_wrapperAt2(); - init_chain2(); - init_commit2(); - init_wrapperLodash2(); - init_next2(); - init_plant2(); - init_wrapperReverse2(); - init_tap2(); - init_thru2(); - init_toIterator2(); - init_toJSON2(); - init_wrapperValue2(); - init_valueOf2(); - init_wrapperChain2(); - seq_default_default2 = { - at: wrapperAt_default2, - chain: chain_default2, - commit: commit_default2, - lodash: wrapperLodash_default2, - next: next_default2, - plant: plant_default2, - reverse: wrapperReverse_default2, - tap: tap_default2, - thru: thru_default2, - toIterator: toIterator_default2, - toJSON: wrapperValue_default2, - value: wrapperValue_default2, - valueOf: wrapperValue_default2, - wrapperChain: wrapperChain_default2 - }; -}); - -// ../node_modules/lodash-es/seq.js -var init_seq2 = __esm(() => { - init_wrapperAt2(); - init_chain2(); - init_commit2(); - init_wrapperLodash2(); - init_next2(); - init_plant2(); - init_wrapperReverse2(); - init_tap2(); - init_thru2(); - init_toIterator2(); - init_toJSON2(); - init_wrapperValue2(); - init_valueOf2(); - init_wrapperChain2(); - init_seq_default2(); -}); - -// ../node_modules/lodash-es/string.default.js -var string_default_default2; -var init_string_default2 = __esm(() => { - init_camelCase2(); - init_capitalize2(); - init_deburr2(); - init_endsWith2(); - init_escape3(); - init_escapeRegExp2(); - init_kebabCase2(); - init_lowerCase2(); - init_lowerFirst2(); - init_pad2(); - init_padEnd2(); - init_padStart2(); - init_parseInt2(); - init_repeat2(); - init_replace2(); - init_snakeCase2(); - init_split3(); - init_startCase2(); - init_startsWith2(); - init_template3(); - init_templateSettings2(); - init_toLower2(); - init_toUpper2(); - init_trim2(); - init_trimEnd2(); - init_trimStart2(); - init_truncate3(); - init_unescape2(); - init_upperCase2(); - init_upperFirst2(); - init_words2(); - string_default_default2 = { - camelCase: camelCase_default2, - capitalize: capitalize_default2, - deburr: deburr_default2, - endsWith: endsWith_default2, - escape: escape_default2, - escapeRegExp: escapeRegExp_default2, - kebabCase: kebabCase_default2, - lowerCase: lowerCase_default2, - lowerFirst: lowerFirst_default2, - pad: pad_default2, - padEnd: padEnd_default2, - padStart: padStart_default2, - parseInt: parseInt_default2, - repeat: repeat_default2, - replace: replace_default2, - snakeCase: snakeCase_default2, - split: split_default2, - startCase: startCase_default2, - startsWith: startsWith_default2, - template: template_default2, - templateSettings: templateSettings_default2, - toLower: toLower_default2, - toUpper: toUpper_default2, - trim: trim_default2, - trimEnd: trimEnd_default2, - trimStart: trimStart_default2, - truncate: truncate_default2, - unescape: unescape_default2, - upperCase: upperCase_default2, - upperFirst: upperFirst_default2, - words: words_default2 - }; -}); - -// ../node_modules/lodash-es/string.js -var init_string4 = __esm(() => { - init_camelCase2(); - init_capitalize2(); - init_deburr2(); - init_endsWith2(); - init_escape3(); - init_escapeRegExp2(); - init_kebabCase2(); - init_lowerCase2(); - init_lowerFirst2(); - init_pad2(); - init_padEnd2(); - init_padStart2(); - init_parseInt2(); - init_repeat2(); - init_replace2(); - init_snakeCase2(); - init_split3(); - init_startCase2(); - init_startsWith2(); - init_template3(); - init_templateSettings2(); - init_toLower2(); - init_toUpper2(); - init_trim2(); - init_trimEnd2(); - init_trimStart2(); - init_truncate3(); - init_unescape2(); - init_upperCase2(); - init_upperFirst2(); - init_words2(); - init_string_default2(); -}); - -// ../node_modules/lodash-es/util.default.js -var util_default_default2; -var init_util_default2 = __esm(() => { - init_attempt2(); - init_bindAll2(); - init_cond2(); - init_conforms2(); - init_constant2(); - init_defaultTo2(); - init_flow2(); - init_flowRight2(); - init_identity3(); - init_iteratee2(); - init_matches2(); - init_matchesProperty2(); - init_method2(); - init_methodOf2(); - init_mixin2(); - init_noop2(); - init_nthArg2(); - init_over2(); - init_overEvery2(); - init_overSome2(); - init_property2(); - init_propertyOf2(); - init_range2(); - init_rangeRight2(); - init_stubArray2(); - init_stubFalse2(); - init_stubObject2(); - init_stubString2(); - init_stubTrue2(); - init_times2(); - init_toPath2(); - init_uniqueId2(); - util_default_default2 = { - attempt: attempt_default2, - bindAll: bindAll_default2, - cond: cond_default2, - conforms: conforms_default2, - constant: constant_default2, - defaultTo: defaultTo_default2, - flow: flow_default2, - flowRight: flowRight_default2, - identity: identity_default3, - iteratee: iteratee_default2, - matches: matches_default2, - matchesProperty: matchesProperty_default2, - method: method_default2, - methodOf: methodOf_default2, - mixin: mixin_default2, - noop: noop_default2, - nthArg: nthArg_default2, - over: over_default2, - overEvery: overEvery_default2, - overSome: overSome_default2, - property: property_default2, - propertyOf: propertyOf_default2, - range: range_default2, - rangeRight: rangeRight_default2, - stubArray: stubArray_default2, - stubFalse: stubFalse_default2, - stubObject: stubObject_default2, - stubString: stubString_default2, - stubTrue: stubTrue_default2, - times: times_default2, - toPath: toPath_default2, - uniqueId: uniqueId_default2 - }; -}); - -// ../node_modules/lodash-es/util.js -var init_util5 = __esm(() => { - init_attempt2(); - init_bindAll2(); - init_cond2(); - init_conforms2(); - init_constant2(); - init_defaultTo2(); - init_flow2(); - init_flowRight2(); - init_identity3(); - init_iteratee2(); - init_matches2(); - init_matchesProperty2(); - init_method2(); - init_methodOf2(); - init_mixin2(); - init_noop2(); - init_nthArg2(); - init_over2(); - init_overEvery2(); - init_overSome2(); - init_property2(); - init_propertyOf2(); - init_range2(); - init_rangeRight2(); - init_stubArray2(); - init_stubFalse2(); - init_stubObject2(); - init_stubString2(); - init_stubTrue2(); - init_times2(); - init_toPath2(); - init_uniqueId2(); - init_util_default2(); -}); - -// ../node_modules/lodash-es/_lazyClone.js -function lazyClone2() { - var result3 = new _LazyWrapper_default2(this.__wrapped__); - result3.__actions__ = _copyArray_default2(this.__actions__); - result3.__dir__ = this.__dir__; - result3.__filtered__ = this.__filtered__; - result3.__iteratees__ = _copyArray_default2(this.__iteratees__); - result3.__takeCount__ = this.__takeCount__; - result3.__views__ = _copyArray_default2(this.__views__); - return result3; -} -var _lazyClone_default2; -var init__lazyClone2 = __esm(() => { - init__LazyWrapper2(); - init__copyArray2(); - _lazyClone_default2 = lazyClone2; -}); - -// ../node_modules/lodash-es/_lazyReverse.js -function lazyReverse2() { - if (this.__filtered__) { - var result3 = new _LazyWrapper_default2(this); - result3.__dir__ = -1; - result3.__filtered__ = true; - } else { - result3 = this.clone(); - result3.__dir__ *= -1; - } - return result3; -} -var _lazyReverse_default2; -var init__lazyReverse2 = __esm(() => { - init__LazyWrapper2(); - _lazyReverse_default2 = lazyReverse2; -}); - -// ../node_modules/lodash-es/_getView.js -function getView2(start, end, transforms) { - var index = -1, length = transforms.length; - while (++index < length) { - var data = transforms[index], size3 = data.size; - switch (data.type) { - case "drop": - start += size3; - break; - case "dropRight": - end -= size3; - break; - case "take": - end = nativeMin28(end, start + size3); - break; - case "takeRight": - start = nativeMax33(start, end - size3); - break; - } - } - return { start, end }; -} -var nativeMax33, nativeMin28, _getView_default2; -var init__getView2 = __esm(() => { - nativeMax33 = Math.max; - nativeMin28 = Math.min; - _getView_default2 = getView2; -}); - -// ../node_modules/lodash-es/_lazyValue.js -function lazyValue2() { - var array3 = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray_default2(array3), isRight = dir < 0, arrLength = isArr ? array3.length : 0, view = _getView_default2(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin29(length, this.__takeCount__); - if (!isArr || !isRight && arrLength == length && takeCount == length) { - return _baseWrapperValue_default2(array3, this.__actions__); - } - var result3 = []; - outer: - while (length-- && resIndex < takeCount) { - index += dir; - var iterIndex = -1, value = array3[index]; - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], iteratee3 = data.iteratee, type = data.type, computed = iteratee3(value); - if (type == LAZY_MAP_FLAG2) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG3) { - continue outer; - } else { - break outer; - } - } - } - result3[resIndex++] = value; - } - return result3; -} -var LAZY_FILTER_FLAG3 = 1, LAZY_MAP_FLAG2 = 2, nativeMin29, _lazyValue_default2; -var init__lazyValue2 = __esm(() => { - init__baseWrapperValue2(); - init__getView2(); - init_isArray2(); - nativeMin29 = Math.min; - _lazyValue_default2 = lazyValue2; -}); - -// ../node_modules/lodash-es/lodash.default.js -var VERSION6 = "4.17.23", WRAP_BIND_KEY_FLAG14 = 2, LAZY_FILTER_FLAG4 = 1, LAZY_WHILE_FLAG2 = 3, MAX_ARRAY_LENGTH14 = 4294967295, arrayProto12, objectProto60, hasOwnProperty53, symIterator4, nativeMax34, nativeMin30, mixin4; -var init_lodash_default2 = __esm(() => { - init_array4(); - init_collection2(); - init_date3(); - init_function3(); - init_lang2(); - init_math2(); - init_number3(); - init_object3(); - init_seq2(); - init_string4(); - init_util5(); - init__LazyWrapper2(); - init__LodashWrapper2(); - init__Symbol2(); - init__arrayEach2(); - init__arrayPush2(); - init__baseForOwn2(); - init__baseFunctions2(); - init__baseInvoke2(); - init__baseIteratee2(); - init__baseRest2(); - init__createHybrid2(); - init_identity3(); - init_isArray2(); - init_isObject2(); - init_keys3(); - init_last2(); - init__lazyClone2(); - init__lazyReverse2(); - init__lazyValue2(); - init_mixin2(); - init_negate2(); - init__realNames2(); - init_thru2(); - init_toInteger2(); - init_wrapperLodash2(); - arrayProto12 = Array.prototype; - objectProto60 = Object.prototype; - hasOwnProperty53 = objectProto60.hasOwnProperty; - symIterator4 = _Symbol_default2 ? _Symbol_default2.iterator : undefined; - nativeMax34 = Math.max; - nativeMin30 = Math.min; - mixin4 = function(func) { - return function(object4, source, options2) { - if (options2 == null) { - var isObj4 = isObject_default2(source), props = isObj4 && keys_default2(source), methodNames = props && props.length && _baseFunctions_default2(source, props); - if (!(methodNames ? methodNames.length : isObj4)) { - options2 = source; - source = object4; - object4 = this; - } - } - return func(object4, source, options2); - }; - }(mixin_default2); - wrapperLodash_default2.after = function_default_default2.after; - wrapperLodash_default2.ary = function_default_default2.ary; - wrapperLodash_default2.assign = object_default_default2.assign; - wrapperLodash_default2.assignIn = object_default_default2.assignIn; - wrapperLodash_default2.assignInWith = object_default_default2.assignInWith; - wrapperLodash_default2.assignWith = object_default_default2.assignWith; - wrapperLodash_default2.at = object_default_default2.at; - wrapperLodash_default2.before = function_default_default2.before; - wrapperLodash_default2.bind = function_default_default2.bind; - wrapperLodash_default2.bindAll = util_default_default2.bindAll; - wrapperLodash_default2.bindKey = function_default_default2.bindKey; - wrapperLodash_default2.castArray = lang_default_default2.castArray; - wrapperLodash_default2.chain = seq_default_default2.chain; - wrapperLodash_default2.chunk = array_default_default2.chunk; - wrapperLodash_default2.compact = array_default_default2.compact; - wrapperLodash_default2.concat = array_default_default2.concat; - wrapperLodash_default2.cond = util_default_default2.cond; - wrapperLodash_default2.conforms = util_default_default2.conforms; - wrapperLodash_default2.constant = util_default_default2.constant; - wrapperLodash_default2.countBy = collection_default_default2.countBy; - wrapperLodash_default2.create = object_default_default2.create; - wrapperLodash_default2.curry = function_default_default2.curry; - wrapperLodash_default2.curryRight = function_default_default2.curryRight; - wrapperLodash_default2.debounce = function_default_default2.debounce; - wrapperLodash_default2.defaults = object_default_default2.defaults; - wrapperLodash_default2.defaultsDeep = object_default_default2.defaultsDeep; - wrapperLodash_default2.defer = function_default_default2.defer; - wrapperLodash_default2.delay = function_default_default2.delay; - wrapperLodash_default2.difference = array_default_default2.difference; - wrapperLodash_default2.differenceBy = array_default_default2.differenceBy; - wrapperLodash_default2.differenceWith = array_default_default2.differenceWith; - wrapperLodash_default2.drop = array_default_default2.drop; - wrapperLodash_default2.dropRight = array_default_default2.dropRight; - wrapperLodash_default2.dropRightWhile = array_default_default2.dropRightWhile; - wrapperLodash_default2.dropWhile = array_default_default2.dropWhile; - wrapperLodash_default2.fill = array_default_default2.fill; - wrapperLodash_default2.filter = collection_default_default2.filter; - wrapperLodash_default2.flatMap = collection_default_default2.flatMap; - wrapperLodash_default2.flatMapDeep = collection_default_default2.flatMapDeep; - wrapperLodash_default2.flatMapDepth = collection_default_default2.flatMapDepth; - wrapperLodash_default2.flatten = array_default_default2.flatten; - wrapperLodash_default2.flattenDeep = array_default_default2.flattenDeep; - wrapperLodash_default2.flattenDepth = array_default_default2.flattenDepth; - wrapperLodash_default2.flip = function_default_default2.flip; - wrapperLodash_default2.flow = util_default_default2.flow; - wrapperLodash_default2.flowRight = util_default_default2.flowRight; - wrapperLodash_default2.fromPairs = array_default_default2.fromPairs; - wrapperLodash_default2.functions = object_default_default2.functions; - wrapperLodash_default2.functionsIn = object_default_default2.functionsIn; - wrapperLodash_default2.groupBy = collection_default_default2.groupBy; - wrapperLodash_default2.initial = array_default_default2.initial; - wrapperLodash_default2.intersection = array_default_default2.intersection; - wrapperLodash_default2.intersectionBy = array_default_default2.intersectionBy; - wrapperLodash_default2.intersectionWith = array_default_default2.intersectionWith; - wrapperLodash_default2.invert = object_default_default2.invert; - wrapperLodash_default2.invertBy = object_default_default2.invertBy; - wrapperLodash_default2.invokeMap = collection_default_default2.invokeMap; - wrapperLodash_default2.iteratee = util_default_default2.iteratee; - wrapperLodash_default2.keyBy = collection_default_default2.keyBy; - wrapperLodash_default2.keys = keys_default2; - wrapperLodash_default2.keysIn = object_default_default2.keysIn; - wrapperLodash_default2.map = collection_default_default2.map; - wrapperLodash_default2.mapKeys = object_default_default2.mapKeys; - wrapperLodash_default2.mapValues = object_default_default2.mapValues; - wrapperLodash_default2.matches = util_default_default2.matches; - wrapperLodash_default2.matchesProperty = util_default_default2.matchesProperty; - wrapperLodash_default2.memoize = function_default_default2.memoize; - wrapperLodash_default2.merge = object_default_default2.merge; - wrapperLodash_default2.mergeWith = object_default_default2.mergeWith; - wrapperLodash_default2.method = util_default_default2.method; - wrapperLodash_default2.methodOf = util_default_default2.methodOf; - wrapperLodash_default2.mixin = mixin4; - wrapperLodash_default2.negate = negate_default2; - wrapperLodash_default2.nthArg = util_default_default2.nthArg; - wrapperLodash_default2.omit = object_default_default2.omit; - wrapperLodash_default2.omitBy = object_default_default2.omitBy; - wrapperLodash_default2.once = function_default_default2.once; - wrapperLodash_default2.orderBy = collection_default_default2.orderBy; - wrapperLodash_default2.over = util_default_default2.over; - wrapperLodash_default2.overArgs = function_default_default2.overArgs; - wrapperLodash_default2.overEvery = util_default_default2.overEvery; - wrapperLodash_default2.overSome = util_default_default2.overSome; - wrapperLodash_default2.partial = function_default_default2.partial; - wrapperLodash_default2.partialRight = function_default_default2.partialRight; - wrapperLodash_default2.partition = collection_default_default2.partition; - wrapperLodash_default2.pick = object_default_default2.pick; - wrapperLodash_default2.pickBy = object_default_default2.pickBy; - wrapperLodash_default2.property = util_default_default2.property; - wrapperLodash_default2.propertyOf = util_default_default2.propertyOf; - wrapperLodash_default2.pull = array_default_default2.pull; - wrapperLodash_default2.pullAll = array_default_default2.pullAll; - wrapperLodash_default2.pullAllBy = array_default_default2.pullAllBy; - wrapperLodash_default2.pullAllWith = array_default_default2.pullAllWith; - wrapperLodash_default2.pullAt = array_default_default2.pullAt; - wrapperLodash_default2.range = util_default_default2.range; - wrapperLodash_default2.rangeRight = util_default_default2.rangeRight; - wrapperLodash_default2.rearg = function_default_default2.rearg; - wrapperLodash_default2.reject = collection_default_default2.reject; - wrapperLodash_default2.remove = array_default_default2.remove; - wrapperLodash_default2.rest = function_default_default2.rest; - wrapperLodash_default2.reverse = array_default_default2.reverse; - wrapperLodash_default2.sampleSize = collection_default_default2.sampleSize; - wrapperLodash_default2.set = object_default_default2.set; - wrapperLodash_default2.setWith = object_default_default2.setWith; - wrapperLodash_default2.shuffle = collection_default_default2.shuffle; - wrapperLodash_default2.slice = array_default_default2.slice; - wrapperLodash_default2.sortBy = collection_default_default2.sortBy; - wrapperLodash_default2.sortedUniq = array_default_default2.sortedUniq; - wrapperLodash_default2.sortedUniqBy = array_default_default2.sortedUniqBy; - wrapperLodash_default2.split = string_default_default2.split; - wrapperLodash_default2.spread = function_default_default2.spread; - wrapperLodash_default2.tail = array_default_default2.tail; - wrapperLodash_default2.take = array_default_default2.take; - wrapperLodash_default2.takeRight = array_default_default2.takeRight; - wrapperLodash_default2.takeRightWhile = array_default_default2.takeRightWhile; - wrapperLodash_default2.takeWhile = array_default_default2.takeWhile; - wrapperLodash_default2.tap = seq_default_default2.tap; - wrapperLodash_default2.throttle = function_default_default2.throttle; - wrapperLodash_default2.thru = thru_default2; - wrapperLodash_default2.toArray = lang_default_default2.toArray; - wrapperLodash_default2.toPairs = object_default_default2.toPairs; - wrapperLodash_default2.toPairsIn = object_default_default2.toPairsIn; - wrapperLodash_default2.toPath = util_default_default2.toPath; - wrapperLodash_default2.toPlainObject = lang_default_default2.toPlainObject; - wrapperLodash_default2.transform = object_default_default2.transform; - wrapperLodash_default2.unary = function_default_default2.unary; - wrapperLodash_default2.union = array_default_default2.union; - wrapperLodash_default2.unionBy = array_default_default2.unionBy; - wrapperLodash_default2.unionWith = array_default_default2.unionWith; - wrapperLodash_default2.uniq = array_default_default2.uniq; - wrapperLodash_default2.uniqBy = array_default_default2.uniqBy; - wrapperLodash_default2.uniqWith = array_default_default2.uniqWith; - wrapperLodash_default2.unset = object_default_default2.unset; - wrapperLodash_default2.unzip = array_default_default2.unzip; - wrapperLodash_default2.unzipWith = array_default_default2.unzipWith; - wrapperLodash_default2.update = object_default_default2.update; - wrapperLodash_default2.updateWith = object_default_default2.updateWith; - wrapperLodash_default2.values = object_default_default2.values; - wrapperLodash_default2.valuesIn = object_default_default2.valuesIn; - wrapperLodash_default2.without = array_default_default2.without; - wrapperLodash_default2.words = string_default_default2.words; - wrapperLodash_default2.wrap = function_default_default2.wrap; - wrapperLodash_default2.xor = array_default_default2.xor; - wrapperLodash_default2.xorBy = array_default_default2.xorBy; - wrapperLodash_default2.xorWith = array_default_default2.xorWith; - wrapperLodash_default2.zip = array_default_default2.zip; - wrapperLodash_default2.zipObject = array_default_default2.zipObject; - wrapperLodash_default2.zipObjectDeep = array_default_default2.zipObjectDeep; - wrapperLodash_default2.zipWith = array_default_default2.zipWith; - wrapperLodash_default2.entries = object_default_default2.toPairs; - wrapperLodash_default2.entriesIn = object_default_default2.toPairsIn; - wrapperLodash_default2.extend = object_default_default2.assignIn; - wrapperLodash_default2.extendWith = object_default_default2.assignInWith; - mixin4(wrapperLodash_default2, wrapperLodash_default2); - wrapperLodash_default2.add = math_default_default2.add; - wrapperLodash_default2.attempt = util_default_default2.attempt; - wrapperLodash_default2.camelCase = string_default_default2.camelCase; - wrapperLodash_default2.capitalize = string_default_default2.capitalize; - wrapperLodash_default2.ceil = math_default_default2.ceil; - wrapperLodash_default2.clamp = number_default_default2.clamp; - wrapperLodash_default2.clone = lang_default_default2.clone; - wrapperLodash_default2.cloneDeep = lang_default_default2.cloneDeep; - wrapperLodash_default2.cloneDeepWith = lang_default_default2.cloneDeepWith; - wrapperLodash_default2.cloneWith = lang_default_default2.cloneWith; - wrapperLodash_default2.conformsTo = lang_default_default2.conformsTo; - wrapperLodash_default2.deburr = string_default_default2.deburr; - wrapperLodash_default2.defaultTo = util_default_default2.defaultTo; - wrapperLodash_default2.divide = math_default_default2.divide; - wrapperLodash_default2.endsWith = string_default_default2.endsWith; - wrapperLodash_default2.eq = lang_default_default2.eq; - wrapperLodash_default2.escape = string_default_default2.escape; - wrapperLodash_default2.escapeRegExp = string_default_default2.escapeRegExp; - wrapperLodash_default2.every = collection_default_default2.every; - wrapperLodash_default2.find = collection_default_default2.find; - wrapperLodash_default2.findIndex = array_default_default2.findIndex; - wrapperLodash_default2.findKey = object_default_default2.findKey; - wrapperLodash_default2.findLast = collection_default_default2.findLast; - wrapperLodash_default2.findLastIndex = array_default_default2.findLastIndex; - wrapperLodash_default2.findLastKey = object_default_default2.findLastKey; - wrapperLodash_default2.floor = math_default_default2.floor; - wrapperLodash_default2.forEach = collection_default_default2.forEach; - wrapperLodash_default2.forEachRight = collection_default_default2.forEachRight; - wrapperLodash_default2.forIn = object_default_default2.forIn; - wrapperLodash_default2.forInRight = object_default_default2.forInRight; - wrapperLodash_default2.forOwn = object_default_default2.forOwn; - wrapperLodash_default2.forOwnRight = object_default_default2.forOwnRight; - wrapperLodash_default2.get = object_default_default2.get; - wrapperLodash_default2.gt = lang_default_default2.gt; - wrapperLodash_default2.gte = lang_default_default2.gte; - wrapperLodash_default2.has = object_default_default2.has; - wrapperLodash_default2.hasIn = object_default_default2.hasIn; - wrapperLodash_default2.head = array_default_default2.head; - wrapperLodash_default2.identity = identity_default3; - wrapperLodash_default2.includes = collection_default_default2.includes; - wrapperLodash_default2.indexOf = array_default_default2.indexOf; - wrapperLodash_default2.inRange = number_default_default2.inRange; - wrapperLodash_default2.invoke = object_default_default2.invoke; - wrapperLodash_default2.isArguments = lang_default_default2.isArguments; - wrapperLodash_default2.isArray = isArray_default2; - wrapperLodash_default2.isArrayBuffer = lang_default_default2.isArrayBuffer; - wrapperLodash_default2.isArrayLike = lang_default_default2.isArrayLike; - wrapperLodash_default2.isArrayLikeObject = lang_default_default2.isArrayLikeObject; - wrapperLodash_default2.isBoolean = lang_default_default2.isBoolean; - wrapperLodash_default2.isBuffer = lang_default_default2.isBuffer; - wrapperLodash_default2.isDate = lang_default_default2.isDate; - wrapperLodash_default2.isElement = lang_default_default2.isElement; - wrapperLodash_default2.isEmpty = lang_default_default2.isEmpty; - wrapperLodash_default2.isEqual = lang_default_default2.isEqual; - wrapperLodash_default2.isEqualWith = lang_default_default2.isEqualWith; - wrapperLodash_default2.isError = lang_default_default2.isError; - wrapperLodash_default2.isFinite = lang_default_default2.isFinite; - wrapperLodash_default2.isFunction = lang_default_default2.isFunction; - wrapperLodash_default2.isInteger = lang_default_default2.isInteger; - wrapperLodash_default2.isLength = lang_default_default2.isLength; - wrapperLodash_default2.isMap = lang_default_default2.isMap; - wrapperLodash_default2.isMatch = lang_default_default2.isMatch; - wrapperLodash_default2.isMatchWith = lang_default_default2.isMatchWith; - wrapperLodash_default2.isNaN = lang_default_default2.isNaN; - wrapperLodash_default2.isNative = lang_default_default2.isNative; - wrapperLodash_default2.isNil = lang_default_default2.isNil; - wrapperLodash_default2.isNull = lang_default_default2.isNull; - wrapperLodash_default2.isNumber = lang_default_default2.isNumber; - wrapperLodash_default2.isObject = isObject_default2; - wrapperLodash_default2.isObjectLike = lang_default_default2.isObjectLike; - wrapperLodash_default2.isPlainObject = lang_default_default2.isPlainObject; - wrapperLodash_default2.isRegExp = lang_default_default2.isRegExp; - wrapperLodash_default2.isSafeInteger = lang_default_default2.isSafeInteger; - wrapperLodash_default2.isSet = lang_default_default2.isSet; - wrapperLodash_default2.isString = lang_default_default2.isString; - wrapperLodash_default2.isSymbol = lang_default_default2.isSymbol; - wrapperLodash_default2.isTypedArray = lang_default_default2.isTypedArray; - wrapperLodash_default2.isUndefined = lang_default_default2.isUndefined; - wrapperLodash_default2.isWeakMap = lang_default_default2.isWeakMap; - wrapperLodash_default2.isWeakSet = lang_default_default2.isWeakSet; - wrapperLodash_default2.join = array_default_default2.join; - wrapperLodash_default2.kebabCase = string_default_default2.kebabCase; - wrapperLodash_default2.last = last_default2; - wrapperLodash_default2.lastIndexOf = array_default_default2.lastIndexOf; - wrapperLodash_default2.lowerCase = string_default_default2.lowerCase; - wrapperLodash_default2.lowerFirst = string_default_default2.lowerFirst; - wrapperLodash_default2.lt = lang_default_default2.lt; - wrapperLodash_default2.lte = lang_default_default2.lte; - wrapperLodash_default2.max = math_default_default2.max; - wrapperLodash_default2.maxBy = math_default_default2.maxBy; - wrapperLodash_default2.mean = math_default_default2.mean; - wrapperLodash_default2.meanBy = math_default_default2.meanBy; - wrapperLodash_default2.min = math_default_default2.min; - wrapperLodash_default2.minBy = math_default_default2.minBy; - wrapperLodash_default2.stubArray = util_default_default2.stubArray; - wrapperLodash_default2.stubFalse = util_default_default2.stubFalse; - wrapperLodash_default2.stubObject = util_default_default2.stubObject; - wrapperLodash_default2.stubString = util_default_default2.stubString; - wrapperLodash_default2.stubTrue = util_default_default2.stubTrue; - wrapperLodash_default2.multiply = math_default_default2.multiply; - wrapperLodash_default2.nth = array_default_default2.nth; - wrapperLodash_default2.noop = util_default_default2.noop; - wrapperLodash_default2.now = date_default_default2.now; - wrapperLodash_default2.pad = string_default_default2.pad; - wrapperLodash_default2.padEnd = string_default_default2.padEnd; - wrapperLodash_default2.padStart = string_default_default2.padStart; - wrapperLodash_default2.parseInt = string_default_default2.parseInt; - wrapperLodash_default2.random = number_default_default2.random; - wrapperLodash_default2.reduce = collection_default_default2.reduce; - wrapperLodash_default2.reduceRight = collection_default_default2.reduceRight; - wrapperLodash_default2.repeat = string_default_default2.repeat; - wrapperLodash_default2.replace = string_default_default2.replace; - wrapperLodash_default2.result = object_default_default2.result; - wrapperLodash_default2.round = math_default_default2.round; - wrapperLodash_default2.sample = collection_default_default2.sample; - wrapperLodash_default2.size = collection_default_default2.size; - wrapperLodash_default2.snakeCase = string_default_default2.snakeCase; - wrapperLodash_default2.some = collection_default_default2.some; - wrapperLodash_default2.sortedIndex = array_default_default2.sortedIndex; - wrapperLodash_default2.sortedIndexBy = array_default_default2.sortedIndexBy; - wrapperLodash_default2.sortedIndexOf = array_default_default2.sortedIndexOf; - wrapperLodash_default2.sortedLastIndex = array_default_default2.sortedLastIndex; - wrapperLodash_default2.sortedLastIndexBy = array_default_default2.sortedLastIndexBy; - wrapperLodash_default2.sortedLastIndexOf = array_default_default2.sortedLastIndexOf; - wrapperLodash_default2.startCase = string_default_default2.startCase; - wrapperLodash_default2.startsWith = string_default_default2.startsWith; - wrapperLodash_default2.subtract = math_default_default2.subtract; - wrapperLodash_default2.sum = math_default_default2.sum; - wrapperLodash_default2.sumBy = math_default_default2.sumBy; - wrapperLodash_default2.template = string_default_default2.template; - wrapperLodash_default2.times = util_default_default2.times; - wrapperLodash_default2.toFinite = lang_default_default2.toFinite; - wrapperLodash_default2.toInteger = toInteger_default2; - wrapperLodash_default2.toLength = lang_default_default2.toLength; - wrapperLodash_default2.toLower = string_default_default2.toLower; - wrapperLodash_default2.toNumber = lang_default_default2.toNumber; - wrapperLodash_default2.toSafeInteger = lang_default_default2.toSafeInteger; - wrapperLodash_default2.toString = lang_default_default2.toString; - wrapperLodash_default2.toUpper = string_default_default2.toUpper; - wrapperLodash_default2.trim = string_default_default2.trim; - wrapperLodash_default2.trimEnd = string_default_default2.trimEnd; - wrapperLodash_default2.trimStart = string_default_default2.trimStart; - wrapperLodash_default2.truncate = string_default_default2.truncate; - wrapperLodash_default2.unescape = string_default_default2.unescape; - wrapperLodash_default2.uniqueId = util_default_default2.uniqueId; - wrapperLodash_default2.upperCase = string_default_default2.upperCase; - wrapperLodash_default2.upperFirst = string_default_default2.upperFirst; - wrapperLodash_default2.each = collection_default_default2.forEach; - wrapperLodash_default2.eachRight = collection_default_default2.forEachRight; - wrapperLodash_default2.first = array_default_default2.head; - mixin4(wrapperLodash_default2, function() { - var source = {}; - _baseForOwn_default2(wrapperLodash_default2, function(func, methodName) { - if (!hasOwnProperty53.call(wrapperLodash_default2.prototype, methodName)) { - source[methodName] = func; - } - }); - return source; - }(), { chain: false }); - wrapperLodash_default2.VERSION = VERSION6; - (wrapperLodash_default2.templateSettings = string_default_default2.templateSettings).imports._ = wrapperLodash_default2; - _arrayEach_default2(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) { - wrapperLodash_default2[methodName].placeholder = wrapperLodash_default2; - }); - _arrayEach_default2(["drop", "take"], function(methodName, index) { - _LazyWrapper_default2.prototype[methodName] = function(n2) { - n2 = n2 === undefined ? 1 : nativeMax34(toInteger_default2(n2), 0); - var result3 = this.__filtered__ && !index ? new _LazyWrapper_default2(this) : this.clone(); - if (result3.__filtered__) { - result3.__takeCount__ = nativeMin30(n2, result3.__takeCount__); - } else { - result3.__views__.push({ - size: nativeMin30(n2, MAX_ARRAY_LENGTH14), - type: methodName + (result3.__dir__ < 0 ? "Right" : "") - }); - } - return result3; - }; - _LazyWrapper_default2.prototype[methodName + "Right"] = function(n2) { - return this.reverse()[methodName](n2).reverse(); - }; - }); - _arrayEach_default2(["filter", "map", "takeWhile"], function(methodName, index) { - var type = index + 1, isFilter = type == LAZY_FILTER_FLAG4 || type == LAZY_WHILE_FLAG2; - _LazyWrapper_default2.prototype[methodName] = function(iteratee3) { - var result3 = this.clone(); - result3.__iteratees__.push({ - iteratee: _baseIteratee_default2(iteratee3, 3), - type - }); - result3.__filtered__ = result3.__filtered__ || isFilter; - return result3; - }; - }); - _arrayEach_default2(["head", "last"], function(methodName, index) { - var takeName = "take" + (index ? "Right" : ""); - _LazyWrapper_default2.prototype[methodName] = function() { - return this[takeName](1).value()[0]; - }; - }); - _arrayEach_default2(["initial", "tail"], function(methodName, index) { - var dropName = "drop" + (index ? "" : "Right"); - _LazyWrapper_default2.prototype[methodName] = function() { - return this.__filtered__ ? new _LazyWrapper_default2(this) : this[dropName](1); - }; - }); - _LazyWrapper_default2.prototype.compact = function() { - return this.filter(identity_default3); - }; - _LazyWrapper_default2.prototype.find = function(predicate) { - return this.filter(predicate).head(); - }; - _LazyWrapper_default2.prototype.findLast = function(predicate) { - return this.reverse().find(predicate); - }; - _LazyWrapper_default2.prototype.invokeMap = _baseRest_default2(function(path13, args) { - if (typeof path13 == "function") { - return new _LazyWrapper_default2(this); - } - return this.map(function(value) { - return _baseInvoke_default2(value, path13, args); - }); - }); - _LazyWrapper_default2.prototype.reject = function(predicate) { - return this.filter(negate_default2(_baseIteratee_default2(predicate))); - }; - _LazyWrapper_default2.prototype.slice = function(start, end) { - start = toInteger_default2(start); - var result3 = this; - if (result3.__filtered__ && (start > 0 || end < 0)) { - return new _LazyWrapper_default2(result3); - } - if (start < 0) { - result3 = result3.takeRight(-start); - } else if (start) { - result3 = result3.drop(start); - } - if (end !== undefined) { - end = toInteger_default2(end); - result3 = end < 0 ? result3.dropRight(-end) : result3.take(end - start); - } - return result3; - }; - _LazyWrapper_default2.prototype.takeRightWhile = function(predicate) { - return this.reverse().takeWhile(predicate).reverse(); - }; - _LazyWrapper_default2.prototype.toArray = function() { - return this.take(MAX_ARRAY_LENGTH14); - }; - _baseForOwn_default2(_LazyWrapper_default2.prototype, function(func, methodName) { - var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = wrapperLodash_default2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName); - if (!lodashFunc) { - return; - } - wrapperLodash_default2.prototype[methodName] = function() { - var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof _LazyWrapper_default2, iteratee3 = args[0], useLazy = isLazy || isArray_default2(value); - var interceptor = function(value2) { - var result4 = lodashFunc.apply(wrapperLodash_default2, _arrayPush_default2([value2], args)); - return isTaker && chainAll ? result4[0] : result4; - }; - if (useLazy && checkIteratee && typeof iteratee3 == "function" && iteratee3.length != 1) { - isLazy = useLazy = false; - } - var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; - if (!retUnwrapped && useLazy) { - value = onlyLazy ? value : new _LazyWrapper_default2(this); - var result3 = func.apply(value, args); - result3.__actions__.push({ func: thru_default2, args: [interceptor], thisArg: undefined }); - return new _LodashWrapper_default2(result3, chainAll); - } - if (isUnwrapped && onlyLazy) { - return func.apply(this, args); - } - result3 = this.thru(interceptor); - return isUnwrapped ? isTaker ? result3.value()[0] : result3.value() : result3; - }; - }); - _arrayEach_default2(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) { - var func = arrayProto12[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName); - wrapperLodash_default2.prototype[methodName] = function() { - var args = arguments; - if (retUnwrapped && !this.__chain__) { - var value = this.value(); - return func.apply(isArray_default2(value) ? value : [], args); - } - return this[chainName](function(value2) { - return func.apply(isArray_default2(value2) ? value2 : [], args); - }); - }; - }); - _baseForOwn_default2(_LazyWrapper_default2.prototype, function(func, methodName) { - var lodashFunc = wrapperLodash_default2[methodName]; - if (lodashFunc) { - var key = lodashFunc.name + ""; - if (!hasOwnProperty53.call(_realNames_default2, key)) { - _realNames_default2[key] = []; - } - _realNames_default2[key].push({ name: methodName, func: lodashFunc }); - } - }); - _realNames_default2[_createHybrid_default2(undefined, WRAP_BIND_KEY_FLAG14).name] = [{ - name: "wrapper", - func: undefined - }]; - _LazyWrapper_default2.prototype.clone = _lazyClone_default2; - _LazyWrapper_default2.prototype.reverse = _lazyReverse_default2; - _LazyWrapper_default2.prototype.value = _lazyValue_default2; - wrapperLodash_default2.prototype.at = seq_default_default2.at; - wrapperLodash_default2.prototype.chain = seq_default_default2.wrapperChain; - wrapperLodash_default2.prototype.commit = seq_default_default2.commit; - wrapperLodash_default2.prototype.next = seq_default_default2.next; - wrapperLodash_default2.prototype.plant = seq_default_default2.plant; - wrapperLodash_default2.prototype.reverse = seq_default_default2.reverse; - wrapperLodash_default2.prototype.toJSON = wrapperLodash_default2.prototype.valueOf = wrapperLodash_default2.prototype.value = seq_default_default2.value; - wrapperLodash_default2.prototype.first = wrapperLodash_default2.prototype.head; - if (symIterator4) { - wrapperLodash_default2.prototype[symIterator4] = seq_default_default2.toIterator; - } -}); - -// ../node_modules/lodash-es/lodash.js -var init_lodash2 = __esm(() => { - init_add3(); - init_after2(); - init_ary2(); - init_assign2(); - init_assignIn2(); - init_assignInWith2(); - init_assignWith2(); - init_at2(); - init_attempt2(); - init_before2(); - init_bind3(); - init_bindAll2(); - init_bindKey2(); - init_camelCase2(); - init_capitalize2(); - init_castArray2(); - init_ceil2(); - init_chain2(); - init_chunk2(); - init_clamp2(); - init_clone2(); - init_cloneDeep2(); - init_cloneDeepWith2(); - init_cloneWith2(); - init_commit2(); - init_compact2(); - init_concat2(); - init_cond2(); - init_conforms2(); - init_conformsTo2(); - init_constant2(); - init_countBy2(); - init_create3(); - init_curry2(); - init_curryRight2(); - init_debounce2(); - init_deburr2(); - init_defaultTo2(); - init_defaults3(); - init_defaultsDeep2(); - init_defer2(); - init_delay2(); - init_difference2(); - init_differenceBy2(); - init_differenceWith2(); - init_divide2(); - init_drop2(); - init_dropRight2(); - init_dropRightWhile2(); - init_dropWhile2(); - init_each2(); - init_eachRight2(); - init_endsWith2(); - init_entries2(); - init_entriesIn2(); - init_eq2(); - init_escape3(); - init_escapeRegExp2(); - init_every2(); - init_extend2(); - init_extendWith2(); - init_fill2(); - init_filter2(); - init_find2(); - init_findIndex2(); - init_findKey2(); - init_findLast2(); - init_findLastIndex2(); - init_findLastKey2(); - init_first2(); - init_flatMap2(); - init_flatMapDeep2(); - init_flatMapDepth2(); - init_flatten2(); - init_flattenDeep2(); - init_flattenDepth2(); - init_flip2(); - init_floor2(); - init_flow2(); - init_flowRight2(); - init_forEach2(); - init_forEachRight2(); - init_forIn2(); - init_forInRight2(); - init_forOwn2(); - init_forOwnRight2(); - init_fromPairs2(); - init_functions2(); - init_functionsIn2(); - init_get2(); - init_groupBy2(); - init_gt2(); - init_gte2(); - init_has2(); - init_hasIn2(); - init_head2(); - init_identity3(); - init_inRange2(); - init_includes2(); - init_indexOf2(); - init_initial2(); - init_intersection3(); - init_intersectionBy2(); - init_intersectionWith2(); - init_invert2(); - init_invertBy2(); - init_invoke2(); - init_invokeMap2(); - init_isArguments2(); - init_isArray2(); - init_isArrayBuffer2(); - init_isArrayLike2(); - init_isArrayLikeObject2(); - init_isBoolean2(); - init_isBuffer2(); - init_isDate2(); - init_isElement2(); - init_isEmpty2(); - init_isEqual2(); - init_isEqualWith2(); - init_isError2(); - init_isFinite2(); - init_isFunction2(); - init_isInteger2(); - init_isLength2(); - init_isMap2(); - init_isMatch2(); - init_isMatchWith2(); - init_isNaN2(); - init_isNative2(); - init_isNil2(); - init_isNull2(); - init_isNumber2(); - init_isObject2(); - init_isObjectLike2(); - init_isPlainObject2(); - init_isRegExp2(); - init_isSafeInteger2(); - init_isSet2(); - init_isString2(); - init_isSymbol2(); - init_isTypedArray2(); - init_isUndefined2(); - init_isWeakMap2(); - init_isWeakSet2(); - init_iteratee2(); - init_join2(); - init_kebabCase2(); - init_keyBy2(); - init_keys3(); - init_keysIn2(); - init_last2(); - init_lastIndexOf2(); - init_wrapperLodash2(); - init_lowerCase2(); - init_lowerFirst2(); - init_lt2(); - init_lte2(); - init_map3(); - init_mapKeys2(); - init_mapValues2(); - init_matches2(); - init_matchesProperty2(); - init_max2(); - init_maxBy2(); - init_mean2(); - init_meanBy2(); - init_memoize3(); - init_merge2(); - init_mergeWith2(); - init_method2(); - init_methodOf2(); - init_min2(); - init_minBy2(); - init_mixin2(); - init_multiply2(); - init_negate2(); - init_next2(); - init_noop2(); - init_now2(); - init_nth2(); - init_nthArg2(); - init_omit2(); - init_omitBy2(); - init_once2(); - init_orderBy2(); - init_over2(); - init_overArgs2(); - init_overEvery2(); - init_overSome2(); - init_pad2(); - init_padEnd2(); - init_padStart2(); - init_parseInt2(); - init_partial2(); - init_partialRight2(); - init_partition2(); - init_pick2(); - init_pickBy2(); - init_plant2(); - init_property2(); - init_propertyOf2(); - init_pull2(); - init_pullAll2(); - init_pullAllBy2(); - init_pullAllWith2(); - init_pullAt2(); - init_random2(); - init_range2(); - init_rangeRight2(); - init_rearg2(); - init_reduce3(); - init_reduceRight2(); - init_reject3(); - init_remove2(); - init_repeat2(); - init_replace2(); - init_rest2(); - init_result3(); - init_reverse2(); - init_round2(); - init_sample2(); - init_sampleSize2(); - init_set3(); - init_setWith2(); - init_shuffle2(); - init_size2(); - init_slice2(); - init_snakeCase2(); - init_some2(); - init_sortBy2(); - init_sortedIndex2(); - init_sortedIndexBy2(); - init_sortedIndexOf2(); - init_sortedLastIndex2(); - init_sortedLastIndexBy2(); - init_sortedLastIndexOf2(); - init_sortedUniq2(); - init_sortedUniqBy2(); - init_split3(); - init_spread2(); - init_startCase2(); - init_startsWith2(); - init_stubArray2(); - init_stubFalse2(); - init_stubObject2(); - init_stubString2(); - init_stubTrue2(); - init_subtract2(); - init_sum2(); - init_sumBy2(); - init_tail2(); - init_take2(); - init_takeRight2(); - init_takeRightWhile2(); - init_takeWhile2(); - init_tap2(); - init_template3(); - init_templateSettings2(); - init_throttle3(); - init_thru2(); - init_times2(); - init_toArray2(); - init_toFinite2(); - init_toInteger2(); - init_toIterator2(); - init_toJSON2(); - init_toLength2(); - init_toLower2(); - init_toNumber2(); - init_toPairs2(); - init_toPairsIn2(); - init_toPath2(); - init_toPlainObject2(); - init_toSafeInteger2(); - init_toString2(); - init_toUpper2(); - init_transform2(); - init_trim2(); - init_trimEnd2(); - init_trimStart2(); - init_truncate3(); - init_unary2(); - init_unescape2(); - init_union3(); - init_unionBy2(); - init_unionWith2(); - init_uniq2(); - init_uniqBy2(); - init_uniqWith2(); - init_uniqueId2(); - init_unset2(); - init_unzip2(); - init_unzipWith2(); - init_update2(); - init_updateWith2(); - init_upperCase2(); - init_upperFirst2(); - init_value2(); - init_valueOf2(); - init_values8(); - init_valuesIn2(); - init_without2(); - init_words2(); - init_wrap2(); - init_wrapperAt2(); - init_wrapperChain2(); - init_commit2(); - init_wrapperLodash2(); - init_next2(); - init_plant2(); - init_wrapperReverse2(); - init_toIterator2(); - init_wrapperValue2(); - init_xor2(); - init_xorBy2(); - init_xorWith2(); - init_zip2(); - init_zipObject2(); - init_zipObjectDeep2(); - init_zipWith2(); - init_lodash_default2(); -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.js -import * as fs2 from "fs"; -function getWslVersion2() { - if (process.platform !== "linux") { - return; - } - try { - const procVersion = fs2.readFileSync("/proc/version", { encoding: "utf8" }); - const wslVersionMatch = procVersion.match(/WSL(\d+)/i); - if (wslVersionMatch && wslVersionMatch[1]) { - return wslVersionMatch[1]; - } - if (procVersion.toLowerCase().includes("microsoft")) { - return "1"; - } - return; - } catch { - return; - } -} -function getPlatform2() { - switch (process.platform) { - case "darwin": - return "macos"; - case "linux": - return "linux"; - case "win32": - return "windows"; - default: - return "unknown"; - } -} -var init_platform3 = () => {}; - -// ../node_modules/shell-quote/quote.js -var require_quote = __commonJS((exports, module) => { - module.exports = function quote(xs) { - return xs.map(function(s) { - if (s === "") { - return "''"; - } - if (s && typeof s === "object") { - return s.op.replace(/(.)/g, "\\$1"); - } - if (/["\s\\]/.test(s) && !/'/.test(s)) { - return "'" + s.replace(/(['])/g, "\\$1") + "'"; - } - if (/["'\s]/.test(s)) { - return '"' + s.replace(/(["\\$`!])/g, "\\$1") + '"'; - } - return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2"); - }).join(" "); - }; -}); - -// ../node_modules/shell-quote/parse.js -var require_parse9 = __commonJS((exports, module) => { - var CONTROL = "(?:" + [ - "\\|\\|", - "\\&\\&", - ";;", - "\\|\\&", - "\\<\\(", - "\\<\\<\\<", - ">>", - ">\\&", - "<\\&", - "[&;()|<>]" - ].join("|") + ")"; - var controlRE = new RegExp("^" + CONTROL + "$"); - var META = "|&;()<> \\t"; - var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"'; - var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'"; - var hash2 = /^#$/; - var SQ = "'"; - var DQ = '"'; - var DS = "$"; - var TOKEN = ""; - var mult = 4294967296; - for (i2 = 0;i2 < 4; i2++) { - TOKEN += (mult * Math.random()).toString(16); - } - var i2; - var startsWithToken = new RegExp("^" + TOKEN); - function matchAll2(s, r) { - var origIndex = r.lastIndex; - var matches3 = []; - var matchObj; - while (matchObj = r.exec(s)) { - matches3.push(matchObj); - if (r.lastIndex === matchObj.index) { - r.lastIndex += 1; - } - } - r.lastIndex = origIndex; - return matches3; - } - function getVar(env5, pre, key) { - var r = typeof env5 === "function" ? env5(key) : env5[key]; - if (typeof r === "undefined" && key != "") { - r = ""; - } else if (typeof r === "undefined") { - r = "$"; - } - if (typeof r === "object") { - return pre + TOKEN + JSON.stringify(r) + TOKEN; - } - return pre + r; - } - function parseInternal(string5, env5, opts) { - if (!opts) { - opts = {}; - } - var BS = opts.escape || "\\"; - var BAREWORD = "(\\" + BS + `['"` + META + `]|[^\\s'"` + META + "])+"; - var chunker = new RegExp([ - "(" + CONTROL + ")", - "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+" - ].join("|"), "g"); - var matches3 = matchAll2(string5, chunker); - if (matches3.length === 0) { - return []; - } - if (!env5) { - env5 = {}; - } - var commented = false; - return matches3.map(function(match) { - var s = match[0]; - if (!s || commented) { - return; - } - if (controlRE.test(s)) { - return { op: s }; - } - var quote = false; - var esc2 = false; - var out = ""; - var isGlob = false; - var i3; - function parseEnvVar() { - i3 += 1; - var varend; - var varname; - var char = s.charAt(i3); - if (char === "{") { - i3 += 1; - if (s.charAt(i3) === "}") { - throw new Error("Bad substitution: " + s.slice(i3 - 2, i3 + 1)); - } - varend = s.indexOf("}", i3); - if (varend < 0) { - throw new Error("Bad substitution: " + s.slice(i3)); - } - varname = s.slice(i3, varend); - i3 = varend; - } else if (/[*@#?$!_-]/.test(char)) { - varname = char; - i3 += 1; - } else { - var slicedFromI = s.slice(i3); - varend = slicedFromI.match(/[^\w\d_]/); - if (!varend) { - varname = slicedFromI; - i3 = s.length; - } else { - varname = slicedFromI.slice(0, varend.index); - i3 += varend.index - 1; - } - } - return getVar(env5, "", varname); - } - for (i3 = 0;i3 < s.length; i3++) { - var c6 = s.charAt(i3); - isGlob = isGlob || !quote && (c6 === "*" || c6 === "?"); - if (esc2) { - out += c6; - esc2 = false; - } else if (quote) { - if (c6 === quote) { - quote = false; - } else if (quote == SQ) { - out += c6; - } else { - if (c6 === BS) { - i3 += 1; - c6 = s.charAt(i3); - if (c6 === DQ || c6 === BS || c6 === DS) { - out += c6; - } else { - out += BS + c6; - } - } else if (c6 === DS) { - out += parseEnvVar(); - } else { - out += c6; - } - } - } else if (c6 === DQ || c6 === SQ) { - quote = c6; - } else if (controlRE.test(c6)) { - return { op: s }; - } else if (hash2.test(c6)) { - commented = true; - var commentObj = { comment: string5.slice(match.index + i3 + 1) }; - if (out.length) { - return [out, commentObj]; - } - return [commentObj]; - } else if (c6 === BS) { - esc2 = true; - } else if (c6 === DS) { - out += parseEnvVar(); - } else { - out += c6; - } - } - if (isGlob) { - return { op: "glob", pattern: out }; - } - return out; - }).reduce(function(prev, arg) { - return typeof arg === "undefined" ? prev : prev.concat(arg); - }, []); - } - module.exports = function parse(s, env5, opts) { - var mapped = parseInternal(s, env5, opts); - if (typeof env5 !== "function") { - return mapped; - } - return mapped.reduce(function(acc, s2) { - if (typeof s2 === "object") { - return acc.concat(s2); - } - var xs = s2.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g")); - if (xs.length === 1) { - return acc.concat(xs[0]); - } - return acc.concat(xs.filter(Boolean).map(function(x2) { - if (startsWithToken.test(x2)) { - return JSON.parse(x2.split(TOKEN)[1]); - } - return x2; - })); - }, []); - }; -}); - -// ../node_modules/shell-quote/index.js -var require_shell_quote = __commonJS((exports) => { - exports.quote = require_quote(); - exports.parse = require_parse9(); -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.js -import { spawn as spawn4 } from "child_process"; -import { text } from "node:stream/consumers"; -async function ripGrep2(args, target, abortSignal, config2 = { command: "rg" }) { - const { command, args: commandArgs = [], argv0 } = config2; - const child = spawn4(command, [...commandArgs, ...args, target], { - argv0, - signal: abortSignal, - timeout: 1e4, - windowsHide: true - }); - const [stdout, stderr, code] = await Promise.all([ - text(child.stdout), - text(child.stderr), - new Promise((resolve15, reject3) => { - child.on("close", resolve15); - child.on("error", reject3); - }) - ]); - if (code === 0) { - return stdout.trim().split(` -`).filter(Boolean); - } - if (code === 1) { - return []; - } - throw new Error(`ripgrep failed with exit code ${code}: ${stderr}`); -} -var init_ripgrep2 = __esm(() => { - init_which2(); -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js -import { homedir as homedir12 } from "os"; -import * as path13 from "path"; -import * as fs3 from "fs"; -function getDangerousDirectories() { - return [ - ...DANGEROUS_DIRECTORIES.filter((d) => d !== ".git"), - ".claude/commands", - ".claude/agents" - ]; -} -function normalizeCaseForComparison(pathStr) { - return pathStr.toLowerCase(); -} -function containsGlobChars(pathPattern) { - return pathPattern.includes("*") || pathPattern.includes("?") || pathPattern.includes("[") || pathPattern.includes("]"); -} -function removeTrailingGlobSuffix(pathPattern) { - const stripped = pathPattern.replace(/\/\*\*$/, ""); - return stripped || "/"; -} -function isSymlinkOutsideBoundary(originalPath, resolvedPath) { - const normalizedOriginal = path13.normalize(originalPath); - const normalizedResolved = path13.normalize(resolvedPath); - if (normalizedResolved === normalizedOriginal) { - return false; - } - if (normalizedOriginal.startsWith("/tmp/") && normalizedResolved === "/private" + normalizedOriginal) { - return false; - } - if (normalizedOriginal.startsWith("/var/") && normalizedResolved === "/private" + normalizedOriginal) { - return false; - } - if (normalizedOriginal.startsWith("/private/tmp/") && normalizedResolved === normalizedOriginal) { - return false; - } - if (normalizedOriginal.startsWith("/private/var/") && normalizedResolved === normalizedOriginal) { - return false; - } - if (normalizedResolved === "/") { - return true; - } - const resolvedParts = normalizedResolved.split("/").filter(Boolean); - if (resolvedParts.length <= 1) { - return true; - } - if (normalizedOriginal.startsWith(normalizedResolved + "/")) { - return true; - } - let canonicalOriginal = normalizedOriginal; - if (normalizedOriginal.startsWith("/tmp/")) { - canonicalOriginal = "/private" + normalizedOriginal; - } else if (normalizedOriginal.startsWith("/var/")) { - canonicalOriginal = "/private" + normalizedOriginal; - } - if (canonicalOriginal !== normalizedOriginal && canonicalOriginal.startsWith(normalizedResolved + "/")) { - return true; - } - const resolvedStartsWithOriginal = normalizedResolved.startsWith(normalizedOriginal + "/"); - const resolvedStartsWithCanonical = canonicalOriginal !== normalizedOriginal && normalizedResolved.startsWith(canonicalOriginal + "/"); - const resolvedIsCanonical = canonicalOriginal !== normalizedOriginal && normalizedResolved === canonicalOriginal; - const resolvedIsSame = normalizedResolved === normalizedOriginal; - if (!resolvedIsSame && !resolvedIsCanonical && !resolvedStartsWithOriginal && !resolvedStartsWithCanonical) { - return true; - } - return false; -} -function normalizePathForSandbox(pathPattern) { - const cwd2 = process.cwd(); - let normalizedPath = pathPattern; - if (pathPattern === "~") { - normalizedPath = homedir12(); - } else if (pathPattern.startsWith("~/")) { - normalizedPath = homedir12() + pathPattern.slice(1); - } else if (pathPattern.startsWith("./") || pathPattern.startsWith("../")) { - normalizedPath = path13.resolve(cwd2, pathPattern); - } else if (!path13.isAbsolute(pathPattern)) { - normalizedPath = path13.resolve(cwd2, pathPattern); - } - if (containsGlobChars(normalizedPath)) { - const staticPrefix = normalizedPath.split(/[*?[\]]/)[0]; - if (staticPrefix && staticPrefix !== "/") { - const baseDir = staticPrefix.endsWith("/") ? staticPrefix.slice(0, -1) : path13.dirname(staticPrefix); - try { - const resolvedBaseDir = fs3.realpathSync(baseDir); - if (!isSymlinkOutsideBoundary(baseDir, resolvedBaseDir)) { - const patternSuffix = normalizedPath.slice(baseDir.length); - return resolvedBaseDir + patternSuffix; - } - } catch {} - } - return normalizedPath; - } - try { - const resolvedPath = fs3.realpathSync(normalizedPath); - if (isSymlinkOutsideBoundary(normalizedPath, resolvedPath)) {} else { - normalizedPath = resolvedPath; - } - } catch {} - return normalizedPath; -} -function getDefaultWritePaths() { - const homeDir = homedir12(); - const recommendedPaths = [ - "/dev/stdout", - "/dev/stderr", - "/dev/null", - "/dev/tty", - "/dev/dtracehelper", - "/dev/autofs_nowait", - "/tmp/claude", - "/private/tmp/claude", - path13.join(homeDir, ".npm/_logs"), - path13.join(homeDir, ".claude/debug") - ]; - return recommendedPaths; -} -function generateProxyEnvVars(httpProxyPort, socksProxyPort) { - const tmpdir2 = process.env.CLAUDE_TMPDIR || "/tmp/claude"; - const envVars = [`SANDBOX_RUNTIME=1`, `TMPDIR=${tmpdir2}`]; - if (!httpProxyPort && !socksProxyPort) { - return envVars; - } - const noProxyAddresses = [ - "localhost", - "127.0.0.1", - "::1", - "*.local", - ".local", - "169.254.0.0/16", - "10.0.0.0/8", - "172.16.0.0/12", - "192.168.0.0/16" - ].join(","); - envVars.push(`NO_PROXY=${noProxyAddresses}`); - envVars.push(`no_proxy=${noProxyAddresses}`); - if (httpProxyPort) { - envVars.push(`HTTP_PROXY=http://localhost:${httpProxyPort}`); - envVars.push(`HTTPS_PROXY=http://localhost:${httpProxyPort}`); - envVars.push(`http_proxy=http://localhost:${httpProxyPort}`); - envVars.push(`https_proxy=http://localhost:${httpProxyPort}`); - } - if (socksProxyPort) { - envVars.push(`ALL_PROXY=socks5h://localhost:${socksProxyPort}`); - envVars.push(`all_proxy=socks5h://localhost:${socksProxyPort}`); - const platform2 = getPlatform2(); - if (platform2 === "macos") { - envVars.push(`GIT_SSH_COMMAND=ssh -o ProxyCommand='nc -X 5 -x localhost:${socksProxyPort} %h %p'`); - } else if (platform2 === "linux" && httpProxyPort) { - envVars.push(`GIT_SSH_COMMAND=ssh -o ProxyCommand='socat - PROXY:localhost:%h:%p,proxyport=${httpProxyPort}'`); - } - envVars.push(`FTP_PROXY=socks5h://localhost:${socksProxyPort}`); - envVars.push(`ftp_proxy=socks5h://localhost:${socksProxyPort}`); - envVars.push(`RSYNC_PROXY=localhost:${socksProxyPort}`); - envVars.push(`DOCKER_HTTP_PROXY=http://localhost:${httpProxyPort || socksProxyPort}`); - envVars.push(`DOCKER_HTTPS_PROXY=http://localhost:${httpProxyPort || socksProxyPort}`); - if (httpProxyPort) { - envVars.push(`CLOUDSDK_PROXY_TYPE=https`); - envVars.push(`CLOUDSDK_PROXY_ADDRESS=localhost`); - envVars.push(`CLOUDSDK_PROXY_PORT=${httpProxyPort}`); - } - envVars.push(`GRPC_PROXY=socks5h://localhost:${socksProxyPort}`); - envVars.push(`grpc_proxy=socks5h://localhost:${socksProxyPort}`); - } - return envVars; -} -function encodeSandboxedCommand(command) { - const truncatedCommand = command.slice(0, 100); - return Buffer.from(truncatedCommand).toString("base64"); -} -function decodeSandboxedCommand(encodedCommand) { - return Buffer.from(encodedCommand, "base64").toString("utf8"); -} -function globToRegex(globPattern) { - return "^" + globPattern.replace(/[.^$+{}()|\\]/g, "\\$&").replace(/\[([^\]]*?)$/g, "\\[$1").replace(/\*\*\//g, "__GLOBSTAR_SLASH__").replace(/\*\*/g, "__GLOBSTAR__").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]").replace(/__GLOBSTAR_SLASH__/g, "(.*/)?").replace(/__GLOBSTAR__/g, ".*") + "$"; -} -function expandGlobPattern(globPath) { - const normalizedPattern = normalizePathForSandbox(globPath); - const staticPrefix = normalizedPattern.split(/[*?[\]]/)[0]; - if (!staticPrefix || staticPrefix === "/") { - logForDebugging2(`[Sandbox] Glob pattern too broad, skipping: ${globPath}`); - return []; - } - const baseDir = staticPrefix.endsWith("/") ? staticPrefix.slice(0, -1) : path13.dirname(staticPrefix); - if (!fs3.existsSync(baseDir)) { - logForDebugging2(`[Sandbox] Base directory for glob does not exist: ${baseDir}`); - return []; - } - const regex2 = new RegExp(globToRegex(normalizedPattern)); - const results = []; - try { - const entries = fs3.readdirSync(baseDir, { - recursive: true, - withFileTypes: true - }); - for (const entry of entries) { - const parentDir = entry.parentPath ?? entry.path ?? baseDir; - const fullPath = path13.join(parentDir, entry.name); - if (regex2.test(fullPath)) { - results.push(fullPath); - } - } - } catch (err) { - logForDebugging2(`[Sandbox] Error expanding glob pattern ${globPath}: ${err}`); - } - return results; -} -var DANGEROUS_FILES, DANGEROUS_DIRECTORIES; -var init_sandbox_utils = __esm(() => { - init_platform3(); - DANGEROUS_FILES = [ - ".gitconfig", - ".gitmodules", - ".bashrc", - ".bash_profile", - ".zshrc", - ".zprofile", - ".profile", - ".ripgreprc", - ".mcp.json" - ]; - DANGEROUS_DIRECTORIES = [".git", ".vscode", ".idea"]; -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js -import { join as join38, dirname as dirname21 } from "node:path"; -import { fileURLToPath as fileURLToPath4 } from "node:url"; -import * as fs4 from "node:fs"; -import { execSync } from "node:child_process"; -import { homedir as homedir13 } from "node:os"; -function getGlobalNpmPaths() { - if (cachedGlobalNpmPaths) - return cachedGlobalNpmPaths; - const paths2 = []; - try { - const npmRoot = execSync("npm root -g", { - encoding: "utf8", - timeout: 5000, - stdio: ["pipe", "pipe", "ignore"] - }).trim(); - if (npmRoot) { - paths2.push(join38(npmRoot, "@anthropic-ai", "sandbox-runtime")); - } - } catch {} - const home = homedir13(); - paths2.push(join38("/usr", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"), join38("/usr", "local", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"), join38("/opt", "homebrew", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"), join38(home, ".npm", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime"), join38(home, ".npm-global", "lib", "node_modules", "@anthropic-ai", "sandbox-runtime")); - cachedGlobalNpmPaths = paths2; - return paths2; -} -function getVendorArchitecture() { - const arch = process.arch; - switch (arch) { - case "x64": - case "x86_64": - return "x64"; - case "arm64": - case "aarch64": - return "arm64"; - case "ia32": - case "x86": - logForDebugging2(`[SeccompFilter] 32-bit x86 (ia32) is not currently supported due to missing socketcall() syscall blocking. ` + `The current seccomp filter only blocks socket(AF_UNIX, ...), but on 32-bit x86, socketcall() can be used to bypass this.`, { level: "error" }); - return null; - default: - logForDebugging2(`[SeccompFilter] Unsupported architecture: ${arch}. Only x64 and arm64 are supported.`); - return null; - } -} -function getLocalSeccompPaths(filename) { - const arch = getVendorArchitecture(); - if (!arch) - return []; - const baseDir = dirname21(fileURLToPath4(import.meta.url)); - const relativePath = join38("vendor", "seccomp", arch, filename); - return [ - join38(baseDir, relativePath), - join38(baseDir, "..", "..", relativePath), - join38(baseDir, "..", relativePath) - ]; -} -function getPreGeneratedBpfPath(seccompBinaryPath) { - const cacheKey = seccompBinaryPath ?? ""; - if (bpfPathCache.has(cacheKey)) { - return bpfPathCache.get(cacheKey); - } - const result3 = findBpfPath(seccompBinaryPath); - bpfPathCache.set(cacheKey, result3); - return result3; -} -function findBpfPath(seccompBinaryPath) { - if (seccompBinaryPath) { - if (fs4.existsSync(seccompBinaryPath)) { - logForDebugging2(`[SeccompFilter] Using BPF filter from explicit path: ${seccompBinaryPath}`); - return seccompBinaryPath; - } - logForDebugging2(`[SeccompFilter] Explicit path provided but file not found: ${seccompBinaryPath}`); - } - const arch = getVendorArchitecture(); - if (!arch) { - logForDebugging2(`[SeccompFilter] Cannot find pre-generated BPF filter: unsupported architecture ${process.arch}`); - return null; - } - logForDebugging2(`[SeccompFilter] Detected architecture: ${arch}`); - for (const bpfPath of getLocalSeccompPaths("unix-block.bpf")) { - if (fs4.existsSync(bpfPath)) { - logForDebugging2(`[SeccompFilter] Found pre-generated BPF filter: ${bpfPath} (${arch})`); - return bpfPath; - } - } - for (const globalBase of getGlobalNpmPaths()) { - const bpfPath = join38(globalBase, "vendor", "seccomp", arch, "unix-block.bpf"); - if (fs4.existsSync(bpfPath)) { - logForDebugging2(`[SeccompFilter] Found pre-generated BPF filter in global install: ${bpfPath} (${arch})`); - return bpfPath; - } - } - logForDebugging2(`[SeccompFilter] Pre-generated BPF filter not found in any expected location (${arch})`); - return null; -} -function getApplySeccompBinaryPath(seccompBinaryPath) { - const cacheKey = seccompBinaryPath ?? ""; - if (applySeccompPathCache.has(cacheKey)) { - return applySeccompPathCache.get(cacheKey); - } - const result3 = findApplySeccompPath(seccompBinaryPath); - applySeccompPathCache.set(cacheKey, result3); - return result3; -} -function findApplySeccompPath(seccompBinaryPath) { - if (seccompBinaryPath) { - if (fs4.existsSync(seccompBinaryPath)) { - logForDebugging2(`[SeccompFilter] Using apply-seccomp binary from explicit path: ${seccompBinaryPath}`); - return seccompBinaryPath; - } - logForDebugging2(`[SeccompFilter] Explicit path provided but file not found: ${seccompBinaryPath}`); - } - const arch = getVendorArchitecture(); - if (!arch) { - logForDebugging2(`[SeccompFilter] Cannot find apply-seccomp binary: unsupported architecture ${process.arch}`); - return null; - } - logForDebugging2(`[SeccompFilter] Looking for apply-seccomp binary for architecture: ${arch}`); - for (const binaryPath of getLocalSeccompPaths("apply-seccomp")) { - if (fs4.existsSync(binaryPath)) { - logForDebugging2(`[SeccompFilter] Found apply-seccomp binary: ${binaryPath} (${arch})`); - return binaryPath; - } - } - for (const globalBase of getGlobalNpmPaths()) { - const binaryPath = join38(globalBase, "vendor", "seccomp", arch, "apply-seccomp"); - if (fs4.existsSync(binaryPath)) { - logForDebugging2(`[SeccompFilter] Found apply-seccomp binary in global install: ${binaryPath} (${arch})`); - return binaryPath; - } - } - logForDebugging2(`[SeccompFilter] apply-seccomp binary not found in any expected location (${arch})`); - return null; -} -function generateSeccompFilter(seccompBinaryPath) { - const preGeneratedBpf = getPreGeneratedBpfPath(seccompBinaryPath); - if (preGeneratedBpf) { - logForDebugging2("[SeccompFilter] Using pre-generated BPF filter"); - return preGeneratedBpf; - } - logForDebugging2("[SeccompFilter] Pre-generated BPF filter not available for this architecture. " + "Only x64 and arm64 are supported.", { level: "error" }); - return null; -} -function cleanupSeccompFilter(_filterPath) {} -var bpfPathCache, applySeccompPathCache, cachedGlobalNpmPaths = null; -var init_generate_seccomp_filter = __esm(() => { - bpfPathCache = new Map; - applySeccompPathCache = new Map; -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.js -import { randomBytes as randomBytes2 } from "node:crypto"; -import * as fs5 from "fs"; -import { spawn as spawn5 } from "node:child_process"; -import { tmpdir as tmpdir2 } from "node:os"; -import path14, { join as join39 } from "node:path"; -function findSymlinkInPath(targetPath, allowedWritePaths) { - const parts = targetPath.split(path14.sep); - let currentPath = ""; - for (const part of parts) { - if (!part) - continue; - const nextPath = currentPath + path14.sep + part; - try { - const stats = fs5.lstatSync(nextPath); - if (stats.isSymbolicLink()) { - const isWithinAllowedPath = allowedWritePaths.some((allowedPath) => nextPath.startsWith(allowedPath + "/") || nextPath === allowedPath); - if (isWithinAllowedPath) { - return nextPath; - } - } - } catch { - break; - } - currentPath = nextPath; - } - return null; -} -function hasFileAncestor(targetPath) { - const parts = targetPath.split(path14.sep); - let currentPath = ""; - for (const part of parts) { - if (!part) - continue; - const nextPath = currentPath + path14.sep + part; - try { - const stat16 = fs5.statSync(nextPath); - if (stat16.isFile() || stat16.isSymbolicLink()) { - return true; - } - } catch { - break; - } - currentPath = nextPath; - } - return false; -} -function findFirstNonExistentComponent(targetPath) { - const parts = targetPath.split(path14.sep); - let currentPath = ""; - for (const part of parts) { - if (!part) - continue; - const nextPath = currentPath + path14.sep + part; - if (!fs5.existsSync(nextPath)) { - return nextPath; - } - currentPath = nextPath; - } - return targetPath; -} -async function linuxGetMandatoryDenyPaths(ripgrepConfig = { command: "rg" }, maxDepth = DEFAULT_MANDATORY_DENY_SEARCH_DEPTH, allowGitConfig = false, abortSignal) { - const cwd2 = process.cwd(); - const fallbackController = new AbortController; - const signal = abortSignal ?? fallbackController.signal; - const dangerousDirectories = getDangerousDirectories(); - const denyPaths = [ - ...DANGEROUS_FILES.map((f) => path14.resolve(cwd2, f)), - ...dangerousDirectories.map((d) => path14.resolve(cwd2, d)) - ]; - const dotGitPath = path14.resolve(cwd2, ".git"); - let dotGitIsDirectory = false; - try { - dotGitIsDirectory = fs5.statSync(dotGitPath).isDirectory(); - } catch {} - if (dotGitIsDirectory) { - denyPaths.push(path14.resolve(cwd2, ".git/hooks")); - if (!allowGitConfig) { - denyPaths.push(path14.resolve(cwd2, ".git/config")); - } - } - const iglobArgs = []; - for (const fileName of DANGEROUS_FILES) { - iglobArgs.push("--iglob", fileName); - } - for (const dirName of dangerousDirectories) { - iglobArgs.push("--iglob", `**/${dirName}/**`); - } - iglobArgs.push("--iglob", "**/.git/hooks/**"); - if (!allowGitConfig) { - iglobArgs.push("--iglob", "**/.git/config"); - } - let matches3 = []; - try { - matches3 = await ripGrep2([ - "--files", - "--hidden", - "--max-depth", - String(maxDepth), - ...iglobArgs, - "-g", - "!**/node_modules/**" - ], cwd2, signal, ripgrepConfig); - } catch (error45) { - logForDebugging2(`[Sandbox] ripgrep scan failed: ${error45}`); - } - for (const match of matches3) { - const absolutePath = path14.resolve(cwd2, match); - let foundDir = false; - for (const dirName of [...dangerousDirectories, ".git"]) { - const normalizedDirName = normalizeCaseForComparison(dirName); - const segments = absolutePath.split(path14.sep); - const dirIndex = segments.findIndex((s) => normalizeCaseForComparison(s) === normalizedDirName); - if (dirIndex !== -1) { - if (dirName === ".git") { - const gitDir = segments.slice(0, dirIndex + 1).join(path14.sep); - if (match.includes(".git/hooks")) { - denyPaths.push(path14.join(gitDir, "hooks")); - } else if (match.includes(".git/config")) { - denyPaths.push(path14.join(gitDir, "config")); - } - } else { - denyPaths.push(segments.slice(0, dirIndex + 1).join(path14.sep)); - } - foundDir = true; - break; - } - } - if (!foundDir) { - denyPaths.push(absolutePath); - } - } - return [...new Set(denyPaths)]; -} -function registerExitCleanupHandler() { - if (exitHandlerRegistered) { - return; - } - process.on("exit", () => { - for (const filterPath of generatedSeccompFilters) { - try { - cleanupSeccompFilter(filterPath); - } catch {} - } - cleanupBwrapMountPoints(); - }); - exitHandlerRegistered = true; -} -function cleanupBwrapMountPoints() { - for (const mountPoint of bwrapMountPoints) { - try { - const stat16 = fs5.statSync(mountPoint); - if (stat16.isFile() && stat16.size === 0) { - fs5.unlinkSync(mountPoint); - logForDebugging2(`[Sandbox Linux] Cleaned up bwrap mount point (file): ${mountPoint}`); - } else if (stat16.isDirectory()) { - const entries = fs5.readdirSync(mountPoint); - if (entries.length === 0) { - fs5.rmdirSync(mountPoint); - logForDebugging2(`[Sandbox Linux] Cleaned up bwrap mount point (dir): ${mountPoint}`); - } - } - } catch {} - } - bwrapMountPoints.clear(); -} -function checkLinuxDependencies(seccompConfig) { - const errors4 = []; - const warnings = []; - if (whichSync2("bwrap") === null) - errors4.push("bubblewrap (bwrap) not installed"); - if (whichSync2("socat") === null) - errors4.push("socat not installed"); - const hasBpf = getPreGeneratedBpfPath(seccompConfig?.bpfPath) !== null; - const hasApply = getApplySeccompBinaryPath(seccompConfig?.applyPath) !== null; - if (!hasBpf || !hasApply) { - warnings.push("seccomp not available - unix socket access not restricted"); - } - return { warnings, errors: errors4 }; -} -async function initializeLinuxNetworkBridge(httpProxyPort, socksProxyPort) { - const socketId = randomBytes2(8).toString("hex"); - const httpSocketPath = join39(tmpdir2(), `claude-http-${socketId}.sock`); - const socksSocketPath = join39(tmpdir2(), `claude-socks-${socketId}.sock`); - const httpSocatArgs = [ - `UNIX-LISTEN:${httpSocketPath},fork,reuseaddr`, - `TCP:localhost:${httpProxyPort},keepalive,keepidle=10,keepintvl=5,keepcnt=3` - ]; - logForDebugging2(`Starting HTTP bridge: socat ${httpSocatArgs.join(" ")}`); - const httpBridgeProcess = spawn5("socat", httpSocatArgs, { - stdio: "ignore" - }); - if (!httpBridgeProcess.pid) { - throw new Error("Failed to start HTTP bridge process"); - } - httpBridgeProcess.on("error", (err) => { - logForDebugging2(`HTTP bridge process error: ${err}`, { level: "error" }); - }); - httpBridgeProcess.on("exit", (code, signal) => { - logForDebugging2(`HTTP bridge process exited with code ${code}, signal ${signal}`, { level: code === 0 ? "info" : "error" }); - }); - const socksSocatArgs = [ - `UNIX-LISTEN:${socksSocketPath},fork,reuseaddr`, - `TCP:localhost:${socksProxyPort},keepalive,keepidle=10,keepintvl=5,keepcnt=3` - ]; - logForDebugging2(`Starting SOCKS bridge: socat ${socksSocatArgs.join(" ")}`); - const socksBridgeProcess = spawn5("socat", socksSocatArgs, { - stdio: "ignore" - }); - if (!socksBridgeProcess.pid) { - if (httpBridgeProcess.pid) { - try { - process.kill(httpBridgeProcess.pid, "SIGTERM"); - } catch {} - } - throw new Error("Failed to start SOCKS bridge process"); - } - socksBridgeProcess.on("error", (err) => { - logForDebugging2(`SOCKS bridge process error: ${err}`, { level: "error" }); - }); - socksBridgeProcess.on("exit", (code, signal) => { - logForDebugging2(`SOCKS bridge process exited with code ${code}, signal ${signal}`, { level: code === 0 ? "info" : "error" }); - }); - const maxAttempts = 5; - for (let i2 = 0;i2 < maxAttempts; i2++) { - if (!httpBridgeProcess.pid || httpBridgeProcess.killed || !socksBridgeProcess.pid || socksBridgeProcess.killed) { - throw new Error("Linux bridge process died unexpectedly"); - } - try { - if (fs5.existsSync(httpSocketPath) && fs5.existsSync(socksSocketPath)) { - logForDebugging2(`Linux bridges ready after ${i2 + 1} attempts`); - break; - } - } catch (err) { - logForDebugging2(`Error checking sockets (attempt ${i2 + 1}): ${err}`, { - level: "error" - }); - } - if (i2 === maxAttempts - 1) { - if (httpBridgeProcess.pid) { - try { - process.kill(httpBridgeProcess.pid, "SIGTERM"); - } catch {} - } - if (socksBridgeProcess.pid) { - try { - process.kill(socksBridgeProcess.pid, "SIGTERM"); - } catch {} - } - throw new Error(`Failed to create bridge sockets after ${maxAttempts} attempts`); - } - await new Promise((resolve16) => setTimeout(resolve16, i2 * 100)); - } - return { - httpSocketPath, - socksSocketPath, - httpBridgeProcess, - socksBridgeProcess, - httpProxyPort, - socksProxyPort - }; -} -function buildSandboxCommand(httpSocketPath, socksSocketPath, userCommand, seccompFilterPath, shell, applySeccompPath) { - const shellPath = shell || "bash"; - const socatCommands = [ - `socat TCP-LISTEN:3128,fork,reuseaddr UNIX-CONNECT:${httpSocketPath} >/dev/null 2>&1 &`, - `socat TCP-LISTEN:1080,fork,reuseaddr UNIX-CONNECT:${socksSocketPath} >/dev/null 2>&1 &`, - 'trap "kill %1 %2 2>/dev/null; exit" EXIT' - ]; - if (seccompFilterPath) { - const applySeccompBinary = getApplySeccompBinaryPath(applySeccompPath); - if (!applySeccompBinary) { - throw new Error("apply-seccomp binary not found. This should have been caught earlier. " + "Ensure vendor/seccomp/{x64,arm64}/apply-seccomp binaries are included in the package."); - } - const applySeccompCmd = import_shell_quote.default.quote([ - applySeccompBinary, - seccompFilterPath, - shellPath, - "-c", - userCommand - ]); - const innerScript = [...socatCommands, applySeccompCmd].join(` -`); - return `${shellPath} -c ${import_shell_quote.default.quote([innerScript])}`; - } else { - const innerScript = [ - ...socatCommands, - `eval ${import_shell_quote.default.quote([userCommand])}` - ].join(` -`); - return `${shellPath} -c ${import_shell_quote.default.quote([innerScript])}`; - } -} -async function generateFilesystemArgs(readConfig, writeConfig, ripgrepConfig = { command: "rg" }, mandatoryDenySearchDepth = DEFAULT_MANDATORY_DENY_SEARCH_DEPTH, allowGitConfig = false, abortSignal) { - const args = []; - if (writeConfig) { - args.push("--ro-bind", "/", "/"); - const allowedWritePaths = []; - for (const pathPattern of writeConfig.allowOnly || []) { - const normalizedPath = normalizePathForSandbox(pathPattern); - logForDebugging2(`[Sandbox Linux] Processing write path: ${pathPattern} -> ${normalizedPath}`); - if (normalizedPath.startsWith("/dev/")) { - logForDebugging2(`[Sandbox Linux] Skipping /dev path: ${normalizedPath}`); - continue; - } - if (!fs5.existsSync(normalizedPath)) { - logForDebugging2(`[Sandbox Linux] Skipping non-existent write path: ${normalizedPath}`); - continue; - } - try { - const resolvedPath = fs5.realpathSync(normalizedPath); - const normalizedForComparison = normalizedPath.replace(/\/+$/, ""); - if (resolvedPath !== normalizedForComparison && isSymlinkOutsideBoundary(normalizedPath, resolvedPath)) { - logForDebugging2(`[Sandbox Linux] Skipping symlink write path pointing outside expected location: ${pathPattern} -> ${resolvedPath}`); - continue; - } - } catch { - logForDebugging2(`[Sandbox Linux] Skipping write path that could not be resolved: ${normalizedPath}`); - continue; - } - args.push("--bind", normalizedPath, normalizedPath); - allowedWritePaths.push(normalizedPath); - } - const denyPaths = [ - ...writeConfig.denyWithinAllow || [], - ...await linuxGetMandatoryDenyPaths(ripgrepConfig, mandatoryDenySearchDepth, allowGitConfig, abortSignal) - ]; - for (const pathPattern of denyPaths) { - const normalizedPath = normalizePathForSandbox(pathPattern); - if (normalizedPath.startsWith("/dev/")) { - continue; - } - const symlinkInPath = findSymlinkInPath(normalizedPath, allowedWritePaths); - if (symlinkInPath) { - args.push("--ro-bind", "/dev/null", symlinkInPath); - logForDebugging2(`[Sandbox Linux] Mounted /dev/null at symlink ${symlinkInPath} to prevent symlink replacement attack`); - continue; - } - if (!fs5.existsSync(normalizedPath)) { - if (hasFileAncestor(normalizedPath)) { - logForDebugging2(`[Sandbox Linux] Skipping deny path with file ancestor (cannot create paths under a file): ${normalizedPath}`); - continue; - } - let ancestorPath = path14.dirname(normalizedPath); - while (ancestorPath !== "/" && !fs5.existsSync(ancestorPath)) { - ancestorPath = path14.dirname(ancestorPath); - } - const ancestorIsWithinAllowedPath = allowedWritePaths.some((allowedPath) => ancestorPath.startsWith(allowedPath + "/") || ancestorPath === allowedPath || normalizedPath.startsWith(allowedPath + "/")); - if (ancestorIsWithinAllowedPath) { - const firstNonExistent = findFirstNonExistentComponent(normalizedPath); - if (firstNonExistent !== normalizedPath) { - const emptyDir = fs5.mkdtempSync(path14.join(tmpdir2(), "claude-empty-")); - args.push("--ro-bind", emptyDir, firstNonExistent); - bwrapMountPoints.add(firstNonExistent); - registerExitCleanupHandler(); - logForDebugging2(`[Sandbox Linux] Mounted empty dir at ${firstNonExistent} to block creation of ${normalizedPath}`); - } else { - args.push("--ro-bind", "/dev/null", firstNonExistent); - bwrapMountPoints.add(firstNonExistent); - registerExitCleanupHandler(); - logForDebugging2(`[Sandbox Linux] Mounted /dev/null at ${firstNonExistent} to block creation of ${normalizedPath}`); - } - } else { - logForDebugging2(`[Sandbox Linux] Skipping non-existent deny path not within allowed paths: ${normalizedPath}`); - } - continue; - } - const isWithinAllowedPath = allowedWritePaths.some((allowedPath) => normalizedPath.startsWith(allowedPath + "/") || normalizedPath === allowedPath); - if (isWithinAllowedPath) { - args.push("--ro-bind", normalizedPath, normalizedPath); - } else { - logForDebugging2(`[Sandbox Linux] Skipping deny path not within allowed paths: ${normalizedPath}`); - } - } - } else { - args.push("--bind", "/", "/"); - } - const readDenyPaths = [...readConfig?.denyOnly || []]; - const readAllowPaths = (readConfig?.allowWithinDeny || []).map((p) => normalizePathForSandbox(p)); - if (fs5.existsSync("/etc/ssh/ssh_config.d")) { - readDenyPaths.push("/etc/ssh/ssh_config.d"); - } - for (const pathPattern of readDenyPaths) { - const normalizedPath = normalizePathForSandbox(pathPattern); - if (!fs5.existsSync(normalizedPath)) { - logForDebugging2(`[Sandbox Linux] Skipping non-existent read deny path: ${normalizedPath}`); - continue; - } - const readDenyStat = fs5.statSync(normalizedPath); - if (readDenyStat.isDirectory()) { - args.push("--tmpfs", normalizedPath); - for (const allowPath of readAllowPaths) { - if (allowPath.startsWith(normalizedPath + "/") || allowPath === normalizedPath) { - if (!fs5.existsSync(allowPath)) { - logForDebugging2(`[Sandbox Linux] Skipping non-existent read allow path: ${allowPath}`); - continue; - } - args.push("--ro-bind", allowPath, allowPath); - logForDebugging2(`[Sandbox Linux] Re-allowed read access within denied region: ${allowPath}`); - } - } - } else { - const isReAllowed = readAllowPaths.some((allowPath) => normalizedPath === allowPath || normalizedPath.startsWith(allowPath + "/")); - if (isReAllowed) { - logForDebugging2(`[Sandbox Linux] Skipping read deny for re-allowed path: ${normalizedPath}`); - continue; - } - args.push("--ro-bind", "/dev/null", normalizedPath); - } - } - return args; -} -async function wrapCommandWithSandboxLinux(params) { - const { command, needsNetworkRestriction, httpSocketPath, socksSocketPath, httpProxyPort, socksProxyPort, readConfig, writeConfig, enableWeakerNestedSandbox, allowAllUnixSockets, binShell, ripgrepConfig = { command: "rg" }, mandatoryDenySearchDepth = DEFAULT_MANDATORY_DENY_SEARCH_DEPTH, allowGitConfig = false, seccompConfig, abortSignal } = params; - const hasReadRestrictions = readConfig && readConfig.denyOnly.length > 0; - const hasWriteRestrictions = writeConfig !== undefined; - if (!needsNetworkRestriction && !hasReadRestrictions && !hasWriteRestrictions) { - return command; - } - const bwrapArgs = ["--new-session", "--die-with-parent"]; - let seccompFilterPath = undefined; - try { - if (!allowAllUnixSockets) { - seccompFilterPath = generateSeccompFilter(seccompConfig?.bpfPath) ?? undefined; - const applySeccompBinary = getApplySeccompBinaryPath(seccompConfig?.applyPath); - if (!seccompFilterPath || !applySeccompBinary) { - logForDebugging2("[Sandbox Linux] Seccomp binaries not available - unix socket blocking disabled. " + "Install @anthropic-ai/sandbox-runtime globally for full protection.", { level: "warn" }); - seccompFilterPath = undefined; - } else { - if (!seccompFilterPath.includes("/vendor/seccomp/")) { - generatedSeccompFilters.add(seccompFilterPath); - registerExitCleanupHandler(); - } - logForDebugging2("[Sandbox Linux] Generated seccomp BPF filter for Unix socket blocking"); - } - } else { - logForDebugging2("[Sandbox Linux] Skipping seccomp filter - allowAllUnixSockets is enabled"); - } - if (needsNetworkRestriction) { - bwrapArgs.push("--unshare-net"); - if (httpSocketPath && socksSocketPath) { - if (!fs5.existsSync(httpSocketPath)) { - throw new Error(`Linux HTTP bridge socket does not exist: ${httpSocketPath}. ` + "The bridge process may have died. Try reinitializing the sandbox."); - } - if (!fs5.existsSync(socksSocketPath)) { - throw new Error(`Linux SOCKS bridge socket does not exist: ${socksSocketPath}. ` + "The bridge process may have died. Try reinitializing the sandbox."); - } - bwrapArgs.push("--bind", httpSocketPath, httpSocketPath); - bwrapArgs.push("--bind", socksSocketPath, socksSocketPath); - const proxyEnv = generateProxyEnvVars(3128, 1080); - bwrapArgs.push(...proxyEnv.flatMap((env5) => { - const firstEq = env5.indexOf("="); - const key = env5.slice(0, firstEq); - const value = env5.slice(firstEq + 1); - return ["--setenv", key, value]; - })); - if (httpProxyPort !== undefined) { - bwrapArgs.push("--setenv", "CLAUDE_CODE_HOST_HTTP_PROXY_PORT", String(httpProxyPort)); - } - if (socksProxyPort !== undefined) { - bwrapArgs.push("--setenv", "CLAUDE_CODE_HOST_SOCKS_PROXY_PORT", String(socksProxyPort)); - } - } - } - const fsArgs = await generateFilesystemArgs(readConfig, writeConfig, ripgrepConfig, mandatoryDenySearchDepth, allowGitConfig, abortSignal); - bwrapArgs.push(...fsArgs); - bwrapArgs.push("--dev", "/dev"); - bwrapArgs.push("--unshare-pid"); - if (!enableWeakerNestedSandbox) { - bwrapArgs.push("--proc", "/proc"); - } - const shellName = binShell || "bash"; - const shell = whichSync2(shellName); - if (!shell) { - throw new Error(`Shell '${shellName}' not found in PATH`); - } - bwrapArgs.push("--", shell, "-c"); - if (needsNetworkRestriction && httpSocketPath && socksSocketPath) { - const sandboxCommand = buildSandboxCommand(httpSocketPath, socksSocketPath, command, seccompFilterPath, shell, seccompConfig?.applyPath); - bwrapArgs.push(sandboxCommand); - } else if (seccompFilterPath) { - const applySeccompBinary = getApplySeccompBinaryPath(seccompConfig?.applyPath); - if (!applySeccompBinary) { - throw new Error("apply-seccomp binary not found. This should have been caught earlier. " + "Ensure vendor/seccomp/{x64,arm64}/apply-seccomp binaries are included in the package."); - } - const applySeccompCmd = import_shell_quote.default.quote([ - applySeccompBinary, - seccompFilterPath, - shell, - "-c", - command - ]); - bwrapArgs.push(applySeccompCmd); - } else { - bwrapArgs.push(command); - } - const wrappedCommand = import_shell_quote.default.quote(["bwrap", ...bwrapArgs]); - const restrictions = []; - if (needsNetworkRestriction) - restrictions.push("network"); - if (hasReadRestrictions || hasWriteRestrictions) - restrictions.push("filesystem"); - if (seccompFilterPath) - restrictions.push("seccomp(unix-block)"); - logForDebugging2(`[Sandbox Linux] Wrapped command with bwrap (${restrictions.join(", ")} restrictions)`); - return wrappedCommand; - } catch (error45) { - if (seccompFilterPath && !seccompFilterPath.includes("/vendor/seccomp/")) { - generatedSeccompFilters.delete(seccompFilterPath); - try { - cleanupSeccompFilter(seccompFilterPath); - } catch (cleanupError) { - logForDebugging2(`[Sandbox Linux] Failed to clean up seccomp filter on error: ${cleanupError}`, { level: "error" }); - } - } - throw error45; - } -} -var import_shell_quote, DEFAULT_MANDATORY_DENY_SEARCH_DEPTH = 3, generatedSeccompFilters, bwrapMountPoints, exitHandlerRegistered = false; -var init_linux_sandbox_utils = __esm(() => { - import_shell_quote = __toESM(require_shell_quote(), 1); - init_which2(); - init_ripgrep2(); - init_sandbox_utils(); - init_generate_seccomp_filter(); - generatedSeccompFilters = new Set; - bwrapMountPoints = new Set; -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.js -import { spawn as spawn6 } from "child_process"; -import * as path15 from "path"; -function macGetMandatoryDenyPatterns(allowGitConfig = false) { - const cwd2 = process.cwd(); - const denyPaths = []; - for (const fileName of DANGEROUS_FILES) { - denyPaths.push(path15.resolve(cwd2, fileName)); - denyPaths.push(`**/${fileName}`); - } - for (const dirName of getDangerousDirectories()) { - denyPaths.push(path15.resolve(cwd2, dirName)); - denyPaths.push(`**/${dirName}/**`); - } - denyPaths.push(path15.resolve(cwd2, ".git/hooks")); - denyPaths.push("**/.git/hooks/**"); - if (!allowGitConfig) { - denyPaths.push(path15.resolve(cwd2, ".git/config")); - denyPaths.push("**/.git/config"); - } - return [...new Set(denyPaths)]; -} -function generateLogTag(command) { - const encodedCommand = encodeSandboxedCommand(command); - return `CMD64_${encodedCommand}_END_${sessionSuffix}`; -} -function getAncestorDirectories(pathStr) { - const ancestors = []; - let currentPath = path15.dirname(pathStr); - while (currentPath !== "/" && currentPath !== ".") { - ancestors.push(currentPath); - const parentPath = path15.dirname(currentPath); - if (parentPath === currentPath) { - break; - } - currentPath = parentPath; - } - return ancestors; -} -function generateMoveBlockingRules(pathPatterns, logTag) { - const rules = []; - for (const pathPattern of pathPatterns) { - const normalizedPath = normalizePathForSandbox(pathPattern); - if (containsGlobChars(normalizedPath)) { - const regexPattern = globToRegex(normalizedPath); - rules.push(`(deny file-write-unlink`, ` (regex ${escapePath(regexPattern)})`, ` (with message "${logTag}"))`); - const staticPrefix = normalizedPath.split(/[*?[\]]/)[0]; - if (staticPrefix && staticPrefix !== "/") { - const baseDir = staticPrefix.endsWith("/") ? staticPrefix.slice(0, -1) : path15.dirname(staticPrefix); - rules.push(`(deny file-write-unlink`, ` (literal ${escapePath(baseDir)})`, ` (with message "${logTag}"))`); - for (const ancestorDir of getAncestorDirectories(baseDir)) { - rules.push(`(deny file-write-unlink`, ` (literal ${escapePath(ancestorDir)})`, ` (with message "${logTag}"))`); - } - } - } else { - rules.push(`(deny file-write-unlink`, ` (subpath ${escapePath(normalizedPath)})`, ` (with message "${logTag}"))`); - for (const ancestorDir of getAncestorDirectories(normalizedPath)) { - rules.push(`(deny file-write-unlink`, ` (literal ${escapePath(ancestorDir)})`, ` (with message "${logTag}"))`); - } - } - } - return rules; -} -function generateReadRules(config2, logTag) { - if (!config2) { - return [`(allow file-read*)`]; - } - const rules = []; - rules.push(`(allow file-read*)`); - for (const pathPattern of config2.denyOnly || []) { - const normalizedPath = normalizePathForSandbox(pathPattern); - if (containsGlobChars(normalizedPath)) { - const regexPattern = globToRegex(normalizedPath); - rules.push(`(deny file-read*`, ` (regex ${escapePath(regexPattern)})`, ` (with message "${logTag}"))`); - } else { - rules.push(`(deny file-read*`, ` (subpath ${escapePath(normalizedPath)})`, ` (with message "${logTag}"))`); - } - } - for (const pathPattern of config2.allowWithinDeny || []) { - const normalizedPath = normalizePathForSandbox(pathPattern); - if (containsGlobChars(normalizedPath)) { - const regexPattern = globToRegex(normalizedPath); - rules.push(`(allow file-read*`, ` (regex ${escapePath(regexPattern)})`, ` (with message "${logTag}"))`); - } else { - rules.push(`(allow file-read*`, ` (subpath ${escapePath(normalizedPath)})`, ` (with message "${logTag}"))`); - } - } - if (config2.denyOnly.length > 0) { - rules.push(`(allow file-read-metadata`, ` (vnode-type DIRECTORY))`); - } - rules.push(...generateMoveBlockingRules(config2.denyOnly || [], logTag)); - return rules; -} -function generateWriteRules(config2, logTag, allowGitConfig = false) { - if (!config2) { - return [`(allow file-write*)`]; - } - const rules = []; - const tmpdirParents = getTmpdirParentIfMacOSPattern(); - for (const tmpdirParent of tmpdirParents) { - const normalizedPath = normalizePathForSandbox(tmpdirParent); - rules.push(`(allow file-write*`, ` (subpath ${escapePath(normalizedPath)})`, ` (with message "${logTag}"))`); - } - for (const pathPattern of config2.allowOnly || []) { - const normalizedPath = normalizePathForSandbox(pathPattern); - if (containsGlobChars(normalizedPath)) { - const regexPattern = globToRegex(normalizedPath); - rules.push(`(allow file-write*`, ` (regex ${escapePath(regexPattern)})`, ` (with message "${logTag}"))`); - } else { - rules.push(`(allow file-write*`, ` (subpath ${escapePath(normalizedPath)})`, ` (with message "${logTag}"))`); - } - } - const denyPaths = [ - ...config2.denyWithinAllow || [], - ...macGetMandatoryDenyPatterns(allowGitConfig) - ]; - for (const pathPattern of denyPaths) { - const normalizedPath = normalizePathForSandbox(pathPattern); - if (containsGlobChars(normalizedPath)) { - const regexPattern = globToRegex(normalizedPath); - rules.push(`(deny file-write*`, ` (regex ${escapePath(regexPattern)})`, ` (with message "${logTag}"))`); - } else { - rules.push(`(deny file-write*`, ` (subpath ${escapePath(normalizedPath)})`, ` (with message "${logTag}"))`); - } - } - rules.push(...generateMoveBlockingRules(denyPaths, logTag)); - return rules; -} -function generateSandboxProfile({ readConfig, writeConfig, httpProxyPort, socksProxyPort, needsNetworkRestriction, allowUnixSockets, allowAllUnixSockets, allowLocalBinding, allowPty, allowGitConfig = false, enableWeakerNetworkIsolation = false, logTag }) { - const profile = [ - "(version 1)", - `(deny default (with message "${logTag}"))`, - "", - `; LogTag: ${logTag}`, - "", - "; Essential permissions - based on Chrome sandbox policy", - "; Process permissions", - "(allow process-exec)", - "(allow process-fork)", - "(allow process-info* (target same-sandbox))", - "(allow signal (target same-sandbox))", - "(allow mach-priv-task-port (target same-sandbox))", - "", - "; User preferences", - "(allow user-preference-read)", - "", - "; Mach IPC - specific services only (no wildcard)", - "(allow mach-lookup", - ' (global-name "com.apple.audio.systemsoundserver")', - ' (global-name "com.apple.distributed_notifications@Uv3")', - ' (global-name "com.apple.FontObjectsServer")', - ' (global-name "com.apple.fonts")', - ' (global-name "com.apple.logd")', - ' (global-name "com.apple.lsd.mapdb")', - ' (global-name "com.apple.PowerManagement.control")', - ' (global-name "com.apple.system.logger")', - ' (global-name "com.apple.system.notification_center")', - ' (global-name "com.apple.system.opendirectoryd.libinfo")', - ' (global-name "com.apple.system.opendirectoryd.membership")', - ' (global-name "com.apple.bsd.dirhelper")', - ' (global-name "com.apple.securityd.xpc")', - ' (global-name "com.apple.coreservices.launchservicesd")', - ")", - "", - ...enableWeakerNetworkIsolation ? [ - "; trustd.agent - needed for Go TLS certificate verification (weaker network isolation)", - '(allow mach-lookup (global-name "com.apple.trustd.agent"))' - ] : [], - "", - "; POSIX IPC - shared memory", - "(allow ipc-posix-shm)", - "", - "; POSIX IPC - semaphores for Python multiprocessing", - "(allow ipc-posix-sem)", - "", - "; IOKit - specific operations only", - "(allow iokit-open", - ' (iokit-registry-entry-class "IOSurfaceRootUserClient")', - ' (iokit-registry-entry-class "RootDomainUserClient")', - ' (iokit-user-client-class "IOSurfaceSendRight")', - ")", - "", - "; IOKit properties", - "(allow iokit-get-properties)", - "", - "; Specific safe system-sockets, doesn't allow network access", - "(allow system-socket (require-all (socket-domain AF_SYSTEM) (socket-protocol 2)))", - "", - "; sysctl - specific sysctls only", - "(allow sysctl-read", - ' (sysctl-name "hw.activecpu")', - ' (sysctl-name "hw.busfrequency_compat")', - ' (sysctl-name "hw.byteorder")', - ' (sysctl-name "hw.cacheconfig")', - ' (sysctl-name "hw.cachelinesize_compat")', - ' (sysctl-name "hw.cpufamily")', - ' (sysctl-name "hw.cpufrequency")', - ' (sysctl-name "hw.cpufrequency_compat")', - ' (sysctl-name "hw.cputype")', - ' (sysctl-name "hw.l1dcachesize_compat")', - ' (sysctl-name "hw.l1icachesize_compat")', - ' (sysctl-name "hw.l2cachesize_compat")', - ' (sysctl-name "hw.l3cachesize_compat")', - ' (sysctl-name "hw.logicalcpu")', - ' (sysctl-name "hw.logicalcpu_max")', - ' (sysctl-name "hw.machine")', - ' (sysctl-name "hw.memsize")', - ' (sysctl-name "hw.ncpu")', - ' (sysctl-name "hw.nperflevels")', - ' (sysctl-name "hw.packages")', - ' (sysctl-name "hw.pagesize_compat")', - ' (sysctl-name "hw.pagesize")', - ' (sysctl-name "hw.physicalcpu")', - ' (sysctl-name "hw.physicalcpu_max")', - ' (sysctl-name "hw.tbfrequency_compat")', - ' (sysctl-name "hw.vectorunit")', - ' (sysctl-name "kern.argmax")', - ' (sysctl-name "kern.bootargs")', - ' (sysctl-name "kern.hostname")', - ' (sysctl-name "kern.maxfiles")', - ' (sysctl-name "kern.maxfilesperproc")', - ' (sysctl-name "kern.maxproc")', - ' (sysctl-name "kern.ngroups")', - ' (sysctl-name "kern.osproductversion")', - ' (sysctl-name "kern.osrelease")', - ' (sysctl-name "kern.ostype")', - ' (sysctl-name "kern.osvariant_status")', - ' (sysctl-name "kern.osversion")', - ' (sysctl-name "kern.secure_kernel")', - ' (sysctl-name "kern.tcsm_available")', - ' (sysctl-name "kern.tcsm_enable")', - ' (sysctl-name "kern.usrstack64")', - ' (sysctl-name "kern.version")', - ' (sysctl-name "kern.willshutdown")', - ' (sysctl-name "machdep.cpu.brand_string")', - ' (sysctl-name "machdep.ptrauth_enabled")', - ' (sysctl-name "security.mac.lockdown_mode_state")', - ' (sysctl-name "sysctl.proc_cputype")', - ' (sysctl-name "vm.loadavg")', - ' (sysctl-name-prefix "hw.optional.arm")', - ' (sysctl-name-prefix "hw.optional.arm.")', - ' (sysctl-name-prefix "hw.optional.armv8_")', - ' (sysctl-name-prefix "hw.perflevel")', - ' (sysctl-name-prefix "kern.proc.all")', - ' (sysctl-name-prefix "kern.proc.pgrp.")', - ' (sysctl-name-prefix "kern.proc.pid.")', - ' (sysctl-name-prefix "machdep.cpu.")', - ' (sysctl-name-prefix "net.routetable.")', - ")", - "", - "; V8 thread calculations", - "(allow sysctl-write", - ' (sysctl-name "kern.tcsm_enable")', - ")", - "", - "; Distributed notifications", - "(allow distributed-notification-post)", - "", - "; Specific mach-lookup permissions for security operations", - '(allow mach-lookup (global-name "com.apple.SecurityServer"))', - "", - "; File I/O on device files", - '(allow file-ioctl (literal "/dev/null"))', - '(allow file-ioctl (literal "/dev/zero"))', - '(allow file-ioctl (literal "/dev/random"))', - '(allow file-ioctl (literal "/dev/urandom"))', - '(allow file-ioctl (literal "/dev/dtracehelper"))', - '(allow file-ioctl (literal "/dev/tty"))', - "", - "(allow file-ioctl file-read-data file-write-data", - " (require-all", - ' (literal "/dev/null")', - " (vnode-type CHARACTER-DEVICE)", - " )", - ")", - "" - ]; - profile.push("; Network"); - if (!needsNetworkRestriction) { - profile.push("(allow network*)"); - } else { - if (allowLocalBinding) { - profile.push('(allow network-bind (local ip "*:*"))'); - profile.push('(allow network-inbound (local ip "*:*"))'); - profile.push('(allow network-outbound (local ip "*:*"))'); - } - if (allowAllUnixSockets) { - profile.push("(allow system-socket (socket-domain AF_UNIX))"); - profile.push('(allow network-bind (local unix-socket (path-regex #"^/")))'); - profile.push('(allow network-outbound (remote unix-socket (path-regex #"^/")))'); - } else if (allowUnixSockets && allowUnixSockets.length > 0) { - profile.push("(allow system-socket (socket-domain AF_UNIX))"); - for (const socketPath of allowUnixSockets) { - const normalizedPath = normalizePathForSandbox(socketPath); - profile.push(`(allow network-bind (local unix-socket (subpath ${escapePath(normalizedPath)})))`); - profile.push(`(allow network-outbound (remote unix-socket (subpath ${escapePath(normalizedPath)})))`); - } - } - if (httpProxyPort !== undefined) { - profile.push(`(allow network-bind (local ip "localhost:${httpProxyPort}"))`); - profile.push(`(allow network-inbound (local ip "localhost:${httpProxyPort}"))`); - profile.push(`(allow network-outbound (remote ip "localhost:${httpProxyPort}"))`); - } - if (socksProxyPort !== undefined) { - profile.push(`(allow network-bind (local ip "localhost:${socksProxyPort}"))`); - profile.push(`(allow network-inbound (local ip "localhost:${socksProxyPort}"))`); - profile.push(`(allow network-outbound (remote ip "localhost:${socksProxyPort}"))`); - } - } - profile.push(""); - profile.push("; File read"); - profile.push(...generateReadRules(readConfig, logTag)); - profile.push(""); - profile.push("; File write"); - profile.push(...generateWriteRules(writeConfig, logTag, allowGitConfig)); - if (allowPty) { - profile.push(""); - profile.push("; Pseudo-terminal (pty) support"); - profile.push("(allow pseudo-tty)"); - profile.push("(allow file-ioctl"); - profile.push(' (literal "/dev/ptmx")'); - profile.push(' (regex #"^/dev/ttys")'); - profile.push(")"); - profile.push("(allow file-read* file-write*"); - profile.push(' (literal "/dev/ptmx")'); - profile.push(' (regex #"^/dev/ttys")'); - profile.push(")"); - } - return profile.join(` -`); -} -function escapePath(pathStr) { - return JSON.stringify(pathStr); -} -function getTmpdirParentIfMacOSPattern() { - const tmpdir3 = process.env.TMPDIR; - if (!tmpdir3) - return []; - const match = tmpdir3.match(/^\/(private\/)?var\/folders\/[^/]{2}\/[^/]+\/T\/?$/); - if (!match) - return []; - const parent3 = tmpdir3.replace(/\/T\/?$/, ""); - if (parent3.startsWith("/private/var/")) { - return [parent3, parent3.replace("/private", "")]; - } else if (parent3.startsWith("/var/")) { - return [parent3, "/private" + parent3]; - } - return [parent3]; -} -function wrapCommandWithSandboxMacOS(params) { - const { command, needsNetworkRestriction, httpProxyPort, socksProxyPort, allowUnixSockets, allowAllUnixSockets, allowLocalBinding, readConfig, writeConfig, allowPty, allowGitConfig = false, enableWeakerNetworkIsolation = false, binShell } = params; - const hasReadRestrictions = readConfig && readConfig.denyOnly.length > 0; - const hasWriteRestrictions = writeConfig !== undefined; - if (!needsNetworkRestriction && !hasReadRestrictions && !hasWriteRestrictions) { - return command; - } - const logTag = generateLogTag(command); - const profile = generateSandboxProfile({ - readConfig, - writeConfig, - httpProxyPort, - socksProxyPort, - needsNetworkRestriction, - allowUnixSockets, - allowAllUnixSockets, - allowLocalBinding, - allowPty, - allowGitConfig, - enableWeakerNetworkIsolation, - logTag - }); - const proxyEnvArgs = generateProxyEnvVars(httpProxyPort, socksProxyPort); - const shellName = binShell || "bash"; - const shell = whichSync2(shellName); - if (!shell) { - throw new Error(`Shell '${shellName}' not found in PATH`); - } - const wrappedCommand = import_shell_quote2.default.quote([ - "env", - ...proxyEnvArgs, - "sandbox-exec", - "-p", - profile, - shell, - "-c", - command - ]); - logForDebugging2(`[Sandbox macOS] Applied restrictions - network: ${!!(httpProxyPort || socksProxyPort)}, read: ${readConfig ? "allowAllExcept" in readConfig ? "allowAllExcept" : "denyAllExcept" : "none"}, write: ${writeConfig ? "allowAllExcept" in writeConfig ? "allowAllExcept" : "denyAllExcept" : "none"}`); - return wrappedCommand; -} -function startMacOSSandboxLogMonitor(callback, ignoreViolations) { - const cmdExtractRegex = /CMD64_(.+?)_END/; - const sandboxExtractRegex = /Sandbox:\s+(.+)$/; - const wildcardPaths = ignoreViolations?.["*"] || []; - const commandPatterns = ignoreViolations ? Object.entries(ignoreViolations).filter(([pattern]) => pattern !== "*") : []; - const logProcess = spawn6("log", [ - "stream", - "--predicate", - `(eventMessage ENDSWITH "${sessionSuffix}")`, - "--style", - "compact" - ]); - logProcess.stdout?.on("data", (data) => { - const lines = data.toString().split(` -`); - const violationLine = lines.find((line) => line.includes("Sandbox:") && line.includes("deny")); - const commandLine = lines.find((line) => line.startsWith("CMD64_")); - if (!violationLine) - return; - const sandboxMatch = violationLine.match(sandboxExtractRegex); - if (!sandboxMatch?.[1]) - return; - const violationDetails = sandboxMatch[1]; - let command; - let encodedCommand; - if (commandLine) { - const cmdMatch = commandLine.match(cmdExtractRegex); - encodedCommand = cmdMatch?.[1]; - if (encodedCommand) { - try { - command = decodeSandboxedCommand(encodedCommand); - } catch {} - } - } - if (violationDetails.includes("mDNSResponder") || violationDetails.includes("mach-lookup com.apple.diagnosticd") || violationDetails.includes("mach-lookup com.apple.analyticsd")) { - return; - } - if (ignoreViolations && command) { - if (wildcardPaths.length > 0) { - const shouldIgnore = wildcardPaths.some((path16) => violationDetails.includes(path16)); - if (shouldIgnore) - return; - } - for (const [pattern, paths2] of commandPatterns) { - if (command.includes(pattern)) { - const shouldIgnore = paths2.some((path16) => violationDetails.includes(path16)); - if (shouldIgnore) - return; - } - } - } - callback({ - line: violationDetails, - command, - encodedCommand, - timestamp: new Date - }); - }); - logProcess.stderr?.on("data", (data) => { - logForDebugging2(`[Sandbox Monitor] Log stream stderr: ${data.toString()}`); - }); - logProcess.on("error", (error45) => { - logForDebugging2(`[Sandbox Monitor] Failed to start log stream: ${error45.message}`); - }); - logProcess.on("exit", (code) => { - logForDebugging2(`[Sandbox Monitor] Log stream exited with code: ${code}`); - }); - return () => { - logForDebugging2("[Sandbox Monitor] Stopping log monitor"); - logProcess.kill("SIGTERM"); - }; -} -var import_shell_quote2, sessionSuffix; -var init_macos_sandbox_utils = __esm(() => { - import_shell_quote2 = __toESM(require_shell_quote(), 1); - init_which2(); - init_sandbox_utils(); - sessionSuffix = `_${Math.random().toString(36).slice(2, 11)}_SBX`; -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.js -class SandboxViolationStore { - constructor() { - this.violations = []; - this.totalCount = 0; - this.maxSize = 100; - this.listeners = new Set; - } - addViolation(violation) { - this.violations.push(violation); - this.totalCount++; - if (this.violations.length > this.maxSize) { - this.violations = this.violations.slice(-this.maxSize); - } - this.notifyListeners(); - } - getViolations(limit) { - if (limit === undefined) { - return [...this.violations]; - } - return this.violations.slice(-limit); - } - getCount() { - return this.violations.length; - } - getTotalCount() { - return this.totalCount; - } - getViolationsForCommand(command) { - const commandBase64 = encodeSandboxedCommand(command); - return this.violations.filter((v) => v.encodedCommand === commandBase64); - } - clear() { - this.violations = []; - this.notifyListeners(); - } - subscribe(listener) { - this.listeners.add(listener); - listener(this.getViolations()); - return () => { - this.listeners.delete(listener); - }; - } - notifyListeners() { - const violations = this.getViolations(); - this.listeners.forEach((listener) => listener(violations)); - } -} -var init_sandbox_violation_store = __esm(() => { - init_sandbox_utils(); -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.js -import * as fs6 from "fs"; -import { EOL } from "node:os"; -function registerCleanup2() { - if (cleanupRegistered) { - return; - } - const cleanupHandler = () => reset2().catch((e) => { - logForDebugging2(`Cleanup failed in registerCleanup ${e}`, { - level: "error" - }); - }); - process.once("exit", cleanupHandler); - process.once("SIGINT", cleanupHandler); - process.once("SIGTERM", cleanupHandler); - cleanupRegistered = true; -} -function matchesDomainPattern(hostname2, pattern) { - if (pattern.startsWith("*.")) { - const baseDomain = pattern.substring(2); - return hostname2.toLowerCase().endsWith("." + baseDomain.toLowerCase()); - } - return hostname2.toLowerCase() === pattern.toLowerCase(); -} -async function filterNetworkRequest(port, host, sandboxAskCallback) { - if (!config2) { - logForDebugging2("No config available, denying network request"); - return false; - } - for (const deniedDomain of config2.network.deniedDomains) { - if (matchesDomainPattern(host, deniedDomain)) { - logForDebugging2(`Denied by config rule: ${host}:${port}`); - return false; - } - } - for (const allowedDomain of config2.network.allowedDomains) { - if (matchesDomainPattern(host, allowedDomain)) { - logForDebugging2(`Allowed by config rule: ${host}:${port}`); - return true; - } - } - if (!sandboxAskCallback) { - logForDebugging2(`No matching config rule, denying: ${host}:${port}`); - return false; - } - logForDebugging2(`No matching config rule, asking user: ${host}:${port}`); - try { - const userAllowed = await sandboxAskCallback({ host, port }); - if (userAllowed) { - logForDebugging2(`User allowed: ${host}:${port}`); - return true; - } else { - logForDebugging2(`User denied: ${host}:${port}`); - return false; - } - } catch (error45) { - logForDebugging2(`Error in permission callback: ${error45}`, { - level: "error" - }); - return false; - } -} -function getMitmSocketPath(host) { - if (!config2?.network.mitmProxy) { - return; - } - const { socketPath, domains } = config2.network.mitmProxy; - for (const pattern of domains) { - if (matchesDomainPattern(host, pattern)) { - logForDebugging2(`Host ${host} matches MITM pattern ${pattern}`); - return socketPath; - } - } - return; -} -async function startHttpProxyServer(sandboxAskCallback) { - httpProxyServer = createHttpProxyServer({ - filter: (port, host) => filterNetworkRequest(port, host, sandboxAskCallback), - getMitmSocketPath - }); - return new Promise((resolve17, reject3) => { - if (!httpProxyServer) { - reject3(new Error("HTTP proxy server undefined before listen")); - return; - } - const server = httpProxyServer; - server.once("error", reject3); - server.once("listening", () => { - const address = server.address(); - if (address && typeof address === "object") { - server.unref(); - logForDebugging2(`HTTP proxy listening on localhost:${address.port}`); - resolve17(address.port); - } else { - reject3(new Error("Failed to get proxy server address")); - } - }); - server.listen(0, "127.0.0.1"); - }); -} -async function startSocksProxyServer(sandboxAskCallback) { - socksProxyServer = createSocksProxyServer({ - filter: (port, host) => filterNetworkRequest(port, host, sandboxAskCallback) - }); - return new Promise((resolve17, reject3) => { - if (!socksProxyServer) { - reject3(new Error("SOCKS proxy server undefined before listen")); - return; - } - socksProxyServer.listen(0, "127.0.0.1").then((port) => { - socksProxyServer?.unref(); - resolve17(port); - }).catch(reject3); - }); -} -async function initialize2(runtimeConfig, sandboxAskCallback, enableLogMonitor = false) { - if (initializationPromise) { - await initializationPromise; - return; - } - config2 = runtimeConfig; - const deps = checkDependencies(); - if (deps.errors.length > 0) { - throw new Error(`Sandbox dependencies not available: ${deps.errors.join(", ")}`); - } - if (enableLogMonitor && getPlatform2() === "macos") { - logMonitorShutdown = startMacOSSandboxLogMonitor(sandboxViolationStore.addViolation.bind(sandboxViolationStore), config2.ignoreViolations); - logForDebugging2("Started macOS sandbox log monitor"); - } - registerCleanup2(); - initializationPromise = (async () => { - try { - let httpProxyPort; - if (config2.network.httpProxyPort !== undefined) { - httpProxyPort = config2.network.httpProxyPort; - logForDebugging2(`Using external HTTP proxy on port ${httpProxyPort}`); - } else { - httpProxyPort = await startHttpProxyServer(sandboxAskCallback); - } - let socksProxyPort; - if (config2.network.socksProxyPort !== undefined) { - socksProxyPort = config2.network.socksProxyPort; - logForDebugging2(`Using external SOCKS proxy on port ${socksProxyPort}`); - } else { - socksProxyPort = await startSocksProxyServer(sandboxAskCallback); - } - let linuxBridge; - if (getPlatform2() === "linux") { - linuxBridge = await initializeLinuxNetworkBridge(httpProxyPort, socksProxyPort); - } - const context = { - httpProxyPort, - socksProxyPort, - linuxBridge - }; - managerContext = context; - logForDebugging2("Network infrastructure initialized"); - return context; - } catch (error45) { - initializationPromise = undefined; - managerContext = undefined; - reset2().catch((e) => { - logForDebugging2(`Cleanup failed in initializationPromise ${e}`, { - level: "error" - }); - }); - throw error45; - } - })(); - await initializationPromise; -} -function isSupportedPlatform() { - const platform2 = getPlatform2(); - if (platform2 === "linux") { - return getWslVersion2() !== "1"; - } - return platform2 === "macos"; -} -function isSandboxingEnabled() { - return config2 !== undefined; -} -function checkDependencies(ripgrepConfig) { - if (!isSupportedPlatform()) { - return { errors: ["Unsupported platform"], warnings: [] }; - } - const errors4 = []; - const warnings = []; - const rgToCheck = ripgrepConfig ?? config2?.ripgrep ?? { command: "rg" }; - if (whichSync2(rgToCheck.command) === null) { - errors4.push(`ripgrep (${rgToCheck.command}) not found`); - } - const platform2 = getPlatform2(); - if (platform2 === "linux") { - const linuxDeps = checkLinuxDependencies(config2?.seccomp); - errors4.push(...linuxDeps.errors); - warnings.push(...linuxDeps.warnings); - } - return { errors: errors4, warnings }; -} -function getFsReadConfig() { - if (!config2) { - return { denyOnly: [], allowWithinDeny: [] }; - } - const denyPaths = []; - for (const p of config2.filesystem.denyRead) { - const stripped = removeTrailingGlobSuffix(p); - if (getPlatform2() === "linux" && containsGlobChars(stripped)) { - const expanded = expandGlobPattern(p); - logForDebugging2(`[Sandbox] Expanded glob pattern "${p}" to ${expanded.length} paths on Linux`); - denyPaths.push(...expanded); - } else { - denyPaths.push(stripped); - } - } - const allowPaths = []; - for (const p of config2.filesystem.allowRead ?? []) { - const stripped = removeTrailingGlobSuffix(p); - if (getPlatform2() === "linux" && containsGlobChars(stripped)) { - const expanded = expandGlobPattern(p); - logForDebugging2(`[Sandbox] Expanded allowRead glob pattern "${p}" to ${expanded.length} paths on Linux`); - allowPaths.push(...expanded); - } else { - allowPaths.push(stripped); - } - } - return { - denyOnly: denyPaths, - allowWithinDeny: allowPaths - }; -} -function getFsWriteConfig() { - if (!config2) { - return { allowOnly: getDefaultWritePaths(), denyWithinAllow: [] }; - } - const allowPaths = config2.filesystem.allowWrite.map((path16) => removeTrailingGlobSuffix(path16)).filter((path16) => { - if (getPlatform2() === "linux" && containsGlobChars(path16)) { - logForDebugging2(`Skipping glob pattern on Linux/WSL: ${path16}`); - return false; - } - return true; - }); - const denyPaths = config2.filesystem.denyWrite.map((path16) => removeTrailingGlobSuffix(path16)).filter((path16) => { - if (getPlatform2() === "linux" && containsGlobChars(path16)) { - logForDebugging2(`Skipping glob pattern on Linux/WSL: ${path16}`); - return false; - } - return true; - }); - const allowOnly = [...getDefaultWritePaths(), ...allowPaths]; - return { - allowOnly, - denyWithinAllow: denyPaths - }; -} -function getNetworkRestrictionConfig() { - if (!config2) { - return {}; - } - const allowedHosts = config2.network.allowedDomains; - const deniedHosts = config2.network.deniedDomains; - return { - ...allowedHosts.length > 0 && { allowedHosts }, - ...deniedHosts.length > 0 && { deniedHosts } - }; -} -function getAllowUnixSockets() { - return config2?.network?.allowUnixSockets; -} -function getAllowAllUnixSockets() { - return config2?.network?.allowAllUnixSockets; -} -function getAllowLocalBinding() { - return config2?.network?.allowLocalBinding; -} -function getIgnoreViolations() { - return config2?.ignoreViolations; -} -function getEnableWeakerNestedSandbox() { - return config2?.enableWeakerNestedSandbox; -} -function getEnableWeakerNetworkIsolation() { - return config2?.enableWeakerNetworkIsolation; -} -function getRipgrepConfig2() { - return config2?.ripgrep ?? { command: "rg" }; -} -function getMandatoryDenySearchDepth() { - return config2?.mandatoryDenySearchDepth ?? 3; -} -function getAllowGitConfig() { - return config2?.filesystem?.allowGitConfig ?? false; -} -function getSeccompConfig() { - return config2?.seccomp; -} -function getProxyPort() { - return managerContext?.httpProxyPort; -} -function getSocksProxyPort() { - return managerContext?.socksProxyPort; -} -function getLinuxHttpSocketPath() { - return managerContext?.linuxBridge?.httpSocketPath; -} -function getLinuxSocksSocketPath() { - return managerContext?.linuxBridge?.socksSocketPath; -} -async function waitForNetworkInitialization() { - if (!config2) { - return false; - } - if (initializationPromise) { - try { - await initializationPromise; - return true; - } catch { - return false; - } - } - return managerContext !== undefined; -} -async function wrapWithSandbox(command, binShell, customConfig, abortSignal) { - const platform2 = getPlatform2(); - const stripWriteGlobs = (paths2) => paths2.map((p) => removeTrailingGlobSuffix(p)).filter((p) => { - if (getPlatform2() === "linux" && containsGlobChars(p)) { - logForDebugging2(`[Sandbox] Skipping glob write pattern on Linux: ${p}`); - return false; - } - return true; - }); - const userAllowWrite = stripWriteGlobs(customConfig?.filesystem?.allowWrite ?? config2?.filesystem.allowWrite ?? []); - const writeConfig = { - allowOnly: [...getDefaultWritePaths(), ...userAllowWrite], - denyWithinAllow: stripWriteGlobs(customConfig?.filesystem?.denyWrite ?? config2?.filesystem.denyWrite ?? []) - }; - const rawDenyRead = customConfig?.filesystem?.denyRead ?? config2?.filesystem.denyRead ?? []; - const expandedDenyRead = []; - for (const p of rawDenyRead) { - const stripped = removeTrailingGlobSuffix(p); - if (getPlatform2() === "linux" && containsGlobChars(stripped)) { - expandedDenyRead.push(...expandGlobPattern(p)); - } else { - expandedDenyRead.push(stripped); - } - } - const rawAllowRead = customConfig?.filesystem?.allowRead ?? config2?.filesystem.allowRead ?? []; - const expandedAllowRead = []; - for (const p of rawAllowRead) { - const stripped = removeTrailingGlobSuffix(p); - if (getPlatform2() === "linux" && containsGlobChars(stripped)) { - expandedAllowRead.push(...expandGlobPattern(p)); - } else { - expandedAllowRead.push(stripped); - } - } - const readConfig = { - denyOnly: expandedDenyRead, - allowWithinDeny: expandedAllowRead - }; - const hasNetworkConfig = customConfig?.network?.allowedDomains !== undefined || config2?.network?.allowedDomains !== undefined; - const needsNetworkRestriction = hasNetworkConfig; - const needsNetworkProxy = hasNetworkConfig; - if (needsNetworkProxy) { - await waitForNetworkInitialization(); - } - const allowPty = customConfig?.allowPty ?? config2?.allowPty; - switch (platform2) { - case "macos": - return wrapCommandWithSandboxMacOS({ - command, - needsNetworkRestriction, - httpProxyPort: needsNetworkProxy ? getProxyPort() : undefined, - socksProxyPort: needsNetworkProxy ? getSocksProxyPort() : undefined, - readConfig, - writeConfig, - allowUnixSockets: getAllowUnixSockets(), - allowAllUnixSockets: getAllowAllUnixSockets(), - allowLocalBinding: getAllowLocalBinding(), - ignoreViolations: getIgnoreViolations(), - allowPty, - allowGitConfig: getAllowGitConfig(), - enableWeakerNetworkIsolation: getEnableWeakerNetworkIsolation(), - binShell - }); - case "linux": - return wrapCommandWithSandboxLinux({ - command, - needsNetworkRestriction, - httpSocketPath: needsNetworkProxy ? getLinuxHttpSocketPath() : undefined, - socksSocketPath: needsNetworkProxy ? getLinuxSocksSocketPath() : undefined, - httpProxyPort: needsNetworkProxy ? managerContext?.httpProxyPort : undefined, - socksProxyPort: needsNetworkProxy ? managerContext?.socksProxyPort : undefined, - readConfig, - writeConfig, - enableWeakerNestedSandbox: getEnableWeakerNestedSandbox(), - allowAllUnixSockets: getAllowAllUnixSockets(), - binShell, - ripgrepConfig: getRipgrepConfig2(), - mandatoryDenySearchDepth: getMandatoryDenySearchDepth(), - allowGitConfig: getAllowGitConfig(), - seccompConfig: getSeccompConfig(), - abortSignal - }); - default: - throw new Error(`Sandbox configuration is not supported on platform: ${platform2}`); - } -} -function getConfig2() { - return config2; -} -function updateConfig(newConfig) { - config2 = cloneDeep_default2(newConfig); - logForDebugging2("Sandbox configuration updated"); -} -function cleanupAfterCommand() { - cleanupBwrapMountPoints(); -} -async function reset2() { - cleanupAfterCommand(); - if (logMonitorShutdown) { - logMonitorShutdown(); - logMonitorShutdown = undefined; - } - if (managerContext?.linuxBridge) { - const { httpSocketPath, socksSocketPath, httpBridgeProcess, socksBridgeProcess } = managerContext.linuxBridge; - const exitPromises = []; - if (httpBridgeProcess.pid && !httpBridgeProcess.killed) { - try { - process.kill(httpBridgeProcess.pid, "SIGTERM"); - logForDebugging2("Sent SIGTERM to HTTP bridge process"); - exitPromises.push(new Promise((resolve17) => { - httpBridgeProcess.once("exit", () => { - logForDebugging2("HTTP bridge process exited"); - resolve17(); - }); - setTimeout(() => { - if (!httpBridgeProcess.killed) { - logForDebugging2("HTTP bridge did not exit, forcing SIGKILL", { - level: "warn" - }); - try { - if (httpBridgeProcess.pid) { - process.kill(httpBridgeProcess.pid, "SIGKILL"); - } - } catch {} - } - resolve17(); - }, 5000); - })); - } catch (err) { - if (err.code !== "ESRCH") { - logForDebugging2(`Error killing HTTP bridge: ${err}`, { - level: "error" - }); - } - } - } - if (socksBridgeProcess.pid && !socksBridgeProcess.killed) { - try { - process.kill(socksBridgeProcess.pid, "SIGTERM"); - logForDebugging2("Sent SIGTERM to SOCKS bridge process"); - exitPromises.push(new Promise((resolve17) => { - socksBridgeProcess.once("exit", () => { - logForDebugging2("SOCKS bridge process exited"); - resolve17(); - }); - setTimeout(() => { - if (!socksBridgeProcess.killed) { - logForDebugging2("SOCKS bridge did not exit, forcing SIGKILL", { - level: "warn" - }); - try { - if (socksBridgeProcess.pid) { - process.kill(socksBridgeProcess.pid, "SIGKILL"); - } - } catch {} - } - resolve17(); - }, 5000); - })); - } catch (err) { - if (err.code !== "ESRCH") { - logForDebugging2(`Error killing SOCKS bridge: ${err}`, { - level: "error" - }); - } - } - } - await Promise.all(exitPromises); - if (httpSocketPath) { - try { - fs6.rmSync(httpSocketPath, { force: true }); - logForDebugging2("Cleaned up HTTP socket"); - } catch (err) { - logForDebugging2(`HTTP socket cleanup error: ${err}`, { - level: "error" - }); - } - } - if (socksSocketPath) { - try { - fs6.rmSync(socksSocketPath, { force: true }); - logForDebugging2("Cleaned up SOCKS socket"); - } catch (err) { - logForDebugging2(`SOCKS socket cleanup error: ${err}`, { - level: "error" - }); - } - } - } - const closePromises = []; - if (httpProxyServer) { - const server = httpProxyServer; - const httpClose = new Promise((resolve17) => { - server.close((error45) => { - if (error45 && error45.message !== "Server is not running.") { - logForDebugging2(`Error closing HTTP proxy server: ${error45.message}`, { - level: "error" - }); - } - resolve17(); - }); - }); - closePromises.push(httpClose); - } - if (socksProxyServer) { - const socksClose = socksProxyServer.close().catch((error45) => { - logForDebugging2(`Error closing SOCKS proxy server: ${error45.message}`, { - level: "error" - }); - }); - closePromises.push(socksClose); - } - await Promise.all(closePromises); - httpProxyServer = undefined; - socksProxyServer = undefined; - managerContext = undefined; - initializationPromise = undefined; -} -function getSandboxViolationStore() { - return sandboxViolationStore; -} -function annotateStderrWithSandboxFailures(command, stderr) { - if (!config2) { - return stderr; - } - const violations = sandboxViolationStore.getViolationsForCommand(command); - if (violations.length === 0) { - return stderr; - } - let annotated = stderr; - annotated += EOL + "" + EOL; - for (const violation of violations) { - annotated += violation.line + EOL; - } - annotated += ""; - return annotated; -} -function getLinuxGlobPatternWarnings() { - if (getPlatform2() !== "linux" || !config2) { - return []; - } - const globPatterns = []; - const allPaths = [ - ...config2.filesystem.allowWrite, - ...config2.filesystem.denyWrite - ]; - for (const path16 of allPaths) { - const pathWithoutTrailingStar = removeTrailingGlobSuffix(path16); - if (containsGlobChars(pathWithoutTrailingStar)) { - globPatterns.push(path16); - } - } - return globPatterns; -} -var config2, httpProxyServer, socksProxyServer, managerContext, initializationPromise, cleanupRegistered = false, logMonitorShutdown, sandboxViolationStore, SandboxManager; -var init_sandbox_manager = __esm(() => { - init_http_proxy(); - init_socks_proxy(); - init_which2(); - init_lodash2(); - init_platform3(); - init_linux_sandbox_utils(); - init_macos_sandbox_utils(); - init_sandbox_utils(); - init_sandbox_violation_store(); - sandboxViolationStore = new SandboxViolationStore; - SandboxManager = { - initialize: initialize2, - isSupportedPlatform, - isSandboxingEnabled, - checkDependencies, - getFsReadConfig, - getFsWriteConfig, - getNetworkRestrictionConfig, - getAllowUnixSockets, - getAllowLocalBinding, - getIgnoreViolations, - getEnableWeakerNestedSandbox, - getProxyPort, - getSocksProxyPort, - getLinuxHttpSocketPath, - getLinuxSocksSocketPath, - waitForNetworkInitialization, - wrapWithSandbox, - cleanupAfterCommand, - reset: reset2, - getSandboxViolationStore, - annotateStderrWithSandboxFailures, - getLinuxGlobPatternWarnings, - getConfig: getConfig2, - updateConfig - }; -}); - -// ../node_modules/zod/v3/helpers/util.js -var util5, objectUtil2, ZodParsedType2, getParsedType3 = (data) => { - const t = typeof data; - switch (t) { - case "undefined": - return ZodParsedType2.undefined; - case "string": - return ZodParsedType2.string; - case "number": - return Number.isNaN(data) ? ZodParsedType2.nan : ZodParsedType2.number; - case "boolean": - return ZodParsedType2.boolean; - case "function": - return ZodParsedType2.function; - case "bigint": - return ZodParsedType2.bigint; - case "symbol": - return ZodParsedType2.symbol; - case "object": - if (Array.isArray(data)) { - return ZodParsedType2.array; - } - if (data === null) { - return ZodParsedType2.null; - } - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { - return ZodParsedType2.promise; - } - if (typeof Map !== "undefined" && data instanceof Map) { - return ZodParsedType2.map; - } - if (typeof Set !== "undefined" && data instanceof Set) { - return ZodParsedType2.set; - } - if (typeof Date !== "undefined" && data instanceof Date) { - return ZodParsedType2.date; - } - return ZodParsedType2.object; - default: - return ZodParsedType2.unknown; - } -}; -var init_util6 = __esm(() => { - (function(util6) { - util6.assertEqual = (_) => {}; - function assertIs2(_arg) {} - util6.assertIs = assertIs2; - function assertNever2(_x) { - throw new Error; - } - util6.assertNever = assertNever2; - util6.arrayToEnum = (items) => { - const obj = {}; - for (const item of items) { - obj[item] = item; - } - return obj; - }; - util6.getValidEnumValues = (obj) => { - const validKeys = util6.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); - const filtered = {}; - for (const k of validKeys) { - filtered[k] = obj[k]; - } - return util6.objectValues(filtered); - }; - util6.objectValues = (obj) => { - return util6.objectKeys(obj).map(function(e) { - return obj[e]; - }); - }; - util6.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object4) => { - const keys3 = []; - for (const key in object4) { - if (Object.prototype.hasOwnProperty.call(object4, key)) { - keys3.push(key); - } - } - return keys3; - }; - util6.find = (arr, checker) => { - for (const item of arr) { - if (checker(item)) - return item; - } - return; - }; - util6.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; - function joinValues2(array3, separator = " | ") { - return array3.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); - } - util6.joinValues = joinValues2; - util6.jsonStringifyReplacer = (_, value) => { - if (typeof value === "bigint") { - return value.toString(); - } - return value; - }; - })(util5 || (util5 = {})); - (function(objectUtil3) { - objectUtil3.mergeShapes = (first, second) => { - return { - ...first, - ...second - }; - }; - })(objectUtil2 || (objectUtil2 = {})); - ZodParsedType2 = util5.arrayToEnum([ - "string", - "nan", - "number", - "integer", - "float", - "boolean", - "date", - "bigint", - "symbol", - "function", - "undefined", - "null", - "array", - "object", - "unknown", - "promise", - "void", - "never", - "map", - "set" - ]); -}); - -// ../node_modules/zod/v3/ZodError.js -var ZodIssueCode3, quotelessJson2 = (obj) => { - const json2 = JSON.stringify(obj, null, 2); - return json2.replace(/"([^"]+)":/g, "$1:"); -}, ZodError4; -var init_ZodError2 = __esm(() => { - init_util6(); - ZodIssueCode3 = util5.arrayToEnum([ - "invalid_type", - "invalid_literal", - "custom", - "invalid_union", - "invalid_union_discriminator", - "invalid_enum_value", - "unrecognized_keys", - "invalid_arguments", - "invalid_return_type", - "invalid_date", - "invalid_string", - "too_small", - "too_big", - "invalid_intersection_types", - "not_multiple_of", - "not_finite" - ]); - ZodError4 = class ZodError4 extends Error { - get errors() { - return this.issues; - } - constructor(issues) { - super(); - this.issues = []; - this.addIssue = (sub) => { - this.issues = [...this.issues, sub]; - }; - this.addIssues = (subs = []) => { - this.issues = [...this.issues, ...subs]; - }; - const actualProto = new.target.prototype; - if (Object.setPrototypeOf) { - Object.setPrototypeOf(this, actualProto); - } else { - this.__proto__ = actualProto; - } - this.name = "ZodError"; - this.issues = issues; - } - format(_mapper) { - const mapper = _mapper || function(issue2) { - return issue2.message; - }; - const fieldErrors = { _errors: [] }; - const processError = (error45) => { - for (const issue2 of error45.issues) { - if (issue2.code === "invalid_union") { - issue2.unionErrors.map(processError); - } else if (issue2.code === "invalid_return_type") { - processError(issue2.returnTypeError); - } else if (issue2.code === "invalid_arguments") { - processError(issue2.argumentsError); - } else if (issue2.path.length === 0) { - fieldErrors._errors.push(mapper(issue2)); - } else { - let curr = fieldErrors; - let i2 = 0; - while (i2 < issue2.path.length) { - const el = issue2.path[i2]; - const terminal = i2 === issue2.path.length - 1; - if (!terminal) { - curr[el] = curr[el] || { _errors: [] }; - } else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue2)); - } - curr = curr[el]; - i2++; - } - } - } - }; - processError(this); - return fieldErrors; - } - static assert(value) { - if (!(value instanceof ZodError4)) { - throw new Error(`Not a ZodError: ${value}`); - } - } - toString() { - return this.message; - } - get message() { - return JSON.stringify(this.issues, util5.jsonStringifyReplacer, 2); - } - get isEmpty() { - return this.issues.length === 0; - } - flatten(mapper = (issue2) => issue2.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of this.issues) { - if (sub.path.length > 0) { - const firstEl = sub.path[0]; - fieldErrors[firstEl] = fieldErrors[firstEl] || []; - fieldErrors[firstEl].push(mapper(sub)); - } else { - formErrors.push(mapper(sub)); - } - } - return { formErrors, fieldErrors }; - } - get formErrors() { - return this.flatten(); - } - }; - ZodError4.create = (issues) => { - const error45 = new ZodError4(issues); - return error45; - }; -}); - -// ../node_modules/zod/v3/locales/en.js -var errorMap2 = (issue2, _ctx) => { - let message; - switch (issue2.code) { - case ZodIssueCode3.invalid_type: - if (issue2.received === ZodParsedType2.undefined) { - message = "Required"; - } else { - message = `Expected ${issue2.expected}, received ${issue2.received}`; - } - break; - case ZodIssueCode3.invalid_literal: - message = `Invalid literal value, expected ${JSON.stringify(issue2.expected, util5.jsonStringifyReplacer)}`; - break; - case ZodIssueCode3.unrecognized_keys: - message = `Unrecognized key(s) in object: ${util5.joinValues(issue2.keys, ", ")}`; - break; - case ZodIssueCode3.invalid_union: - message = `Invalid input`; - break; - case ZodIssueCode3.invalid_union_discriminator: - message = `Invalid discriminator value. Expected ${util5.joinValues(issue2.options)}`; - break; - case ZodIssueCode3.invalid_enum_value: - message = `Invalid enum value. Expected ${util5.joinValues(issue2.options)}, received '${issue2.received}'`; - break; - case ZodIssueCode3.invalid_arguments: - message = `Invalid function arguments`; - break; - case ZodIssueCode3.invalid_return_type: - message = `Invalid function return type`; - break; - case ZodIssueCode3.invalid_date: - message = `Invalid date`; - break; - case ZodIssueCode3.invalid_string: - if (typeof issue2.validation === "object") { - if ("includes" in issue2.validation) { - message = `Invalid input: must include "${issue2.validation.includes}"`; - if (typeof issue2.validation.position === "number") { - message = `${message} at one or more positions greater than or equal to ${issue2.validation.position}`; - } - } else if ("startsWith" in issue2.validation) { - message = `Invalid input: must start with "${issue2.validation.startsWith}"`; - } else if ("endsWith" in issue2.validation) { - message = `Invalid input: must end with "${issue2.validation.endsWith}"`; - } else { - util5.assertNever(issue2.validation); - } - } else if (issue2.validation !== "regex") { - message = `Invalid ${issue2.validation}`; - } else { - message = "Invalid"; - } - break; - case ZodIssueCode3.too_small: - if (issue2.type === "array") - message = `Array must contain ${issue2.exact ? "exactly" : issue2.inclusive ? `at least` : `more than`} ${issue2.minimum} element(s)`; - else if (issue2.type === "string") - message = `String must contain ${issue2.exact ? "exactly" : issue2.inclusive ? `at least` : `over`} ${issue2.minimum} character(s)`; - else if (issue2.type === "number") - message = `Number must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${issue2.minimum}`; - else if (issue2.type === "bigint") - message = `Number must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${issue2.minimum}`; - else if (issue2.type === "date") - message = `Date must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue2.minimum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode3.too_big: - if (issue2.type === "array") - message = `Array must contain ${issue2.exact ? `exactly` : issue2.inclusive ? `at most` : `less than`} ${issue2.maximum} element(s)`; - else if (issue2.type === "string") - message = `String must contain ${issue2.exact ? `exactly` : issue2.inclusive ? `at most` : `under`} ${issue2.maximum} character(s)`; - else if (issue2.type === "number") - message = `Number must be ${issue2.exact ? `exactly` : issue2.inclusive ? `less than or equal to` : `less than`} ${issue2.maximum}`; - else if (issue2.type === "bigint") - message = `BigInt must be ${issue2.exact ? `exactly` : issue2.inclusive ? `less than or equal to` : `less than`} ${issue2.maximum}`; - else if (issue2.type === "date") - message = `Date must be ${issue2.exact ? `exactly` : issue2.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue2.maximum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode3.custom: - message = `Invalid input`; - break; - case ZodIssueCode3.invalid_intersection_types: - message = `Intersection results could not be merged`; - break; - case ZodIssueCode3.not_multiple_of: - message = `Number must be a multiple of ${issue2.multipleOf}`; - break; - case ZodIssueCode3.not_finite: - message = "Number must be finite"; - break; - default: - message = _ctx.defaultError; - util5.assertNever(issue2); - } - return { message }; -}, en_default3; -var init_en3 = __esm(() => { - init_ZodError2(); - init_util6(); - en_default3 = errorMap2; -}); - -// ../node_modules/zod/v3/errors.js -function setErrorMap3(map6) { - overrideErrorMap2 = map6; -} -function getErrorMap3() { - return overrideErrorMap2; -} -var overrideErrorMap2; -var init_errors6 = __esm(() => { - init_en3(); - overrideErrorMap2 = en_default3; -}); - -// ../node_modules/zod/v3/helpers/parseUtil.js -function addIssueToContext2(ctx, issueData) { - const overrideMap = getErrorMap3(); - const issue2 = makeIssue2({ - issueData, - data: ctx.data, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - ctx.schemaErrorMap, - overrideMap, - overrideMap === en_default3 ? undefined : en_default3 - ].filter((x2) => !!x2) - }); - ctx.common.issues.push(issue2); -} - -class ParseStatus2 { - constructor() { - this.value = "valid"; - } - dirty() { - if (this.value === "valid") - this.value = "dirty"; - } - abort() { - if (this.value !== "aborted") - this.value = "aborted"; - } - static mergeArray(status, results) { - const arrayValue = []; - for (const s of results) { - if (s.status === "aborted") - return INVALID2; - if (s.status === "dirty") - status.dirty(); - arrayValue.push(s.value); - } - return { status: status.value, value: arrayValue }; - } - static async mergeObjectAsync(status, pairs) { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - syncPairs.push({ - key, - value - }); - } - return ParseStatus2.mergeObjectSync(status, syncPairs); - } - static mergeObjectSync(status, pairs) { - const finalObject = {}; - for (const pair of pairs) { - const { key, value } = pair; - if (key.status === "aborted") - return INVALID2; - if (value.status === "aborted") - return INVALID2; - if (key.status === "dirty") - status.dirty(); - if (value.status === "dirty") - status.dirty(); - if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { - finalObject[key.value] = value.value; - } - } - return { status: status.value, value: finalObject }; - } -} -var makeIssue2 = (params) => { - const { data, path: path16, errorMaps, issueData } = params; - const fullPath = [...path16, ...issueData.path || []]; - const fullIssue = { - ...issueData, - path: fullPath - }; - if (issueData.message !== undefined) { - return { - ...issueData, - path: fullPath, - message: issueData.message - }; - } - let errorMessage2 = ""; - const maps = errorMaps.filter((m) => !!m).slice().reverse(); - for (const map6 of maps) { - errorMessage2 = map6(fullIssue, { data, defaultError: errorMessage2 }).message; - } - return { - ...issueData, - path: fullPath, - message: errorMessage2 - }; -}, EMPTY_PATH2, INVALID2, DIRTY2 = (value) => ({ status: "dirty", value }), OK2 = (value) => ({ status: "valid", value }), isAborted2 = (x2) => x2.status === "aborted", isDirty2 = (x2) => x2.status === "dirty", isValid2 = (x2) => x2.status === "valid", isAsync2 = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise; -var init_parseUtil2 = __esm(() => { - init_errors6(); - init_en3(); - EMPTY_PATH2 = []; - INVALID2 = Object.freeze({ - status: "aborted" - }); -}); - -// ../node_modules/zod/v3/helpers/typeAliases.js -var init_typeAliases2 = () => {}; - -// ../node_modules/zod/v3/helpers/errorUtil.js -var errorUtil2; -var init_errorUtil2 = __esm(() => { - (function(errorUtil3) { - errorUtil3.errToObj = (message) => typeof message === "string" ? { message } : message || {}; - errorUtil3.toString = (message) => typeof message === "string" ? message : message?.message; - })(errorUtil2 || (errorUtil2 = {})); -}); - -// ../node_modules/zod/v3/types.js -class ParseInputLazyPath2 { - constructor(parent3, value, path16, key) { - this._cachedPath = []; - this.parent = parent3; - this.data = value; - this._path = path16; - this._key = key; - } - get path() { - if (!this._cachedPath.length) { - if (Array.isArray(this._key)) { - this._cachedPath.push(...this._path, ...this._key); - } else { - this._cachedPath.push(...this._path, this._key); - } - } - return this._cachedPath; - } -} -function processCreateParams2(params) { - if (!params) - return {}; - const { errorMap: errorMap3, invalid_type_error, required_error, description } = params; - if (errorMap3 && (invalid_type_error || required_error)) { - throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); - } - if (errorMap3) - return { errorMap: errorMap3, description }; - const customMap = (iss, ctx) => { - const { message } = params; - if (iss.code === "invalid_enum_value") { - return { message: message ?? ctx.defaultError }; - } - if (typeof ctx.data === "undefined") { - return { message: message ?? required_error ?? ctx.defaultError }; - } - if (iss.code !== "invalid_type") - return { message: ctx.defaultError }; - return { message: message ?? invalid_type_error ?? ctx.defaultError }; - }; - return { errorMap: customMap, description }; -} - -class ZodType3 { - get description() { - return this._def.description; - } - _getType(input2) { - return getParsedType3(input2.data); - } - _getOrReturnCtx(input2, ctx) { - return ctx || { - common: input2.parent.common, - data: input2.data, - parsedType: getParsedType3(input2.data), - schemaErrorMap: this._def.errorMap, - path: input2.path, - parent: input2.parent - }; - } - _processInputParams(input2) { - return { - status: new ParseStatus2, - ctx: { - common: input2.parent.common, - data: input2.data, - parsedType: getParsedType3(input2.data), - schemaErrorMap: this._def.errorMap, - path: input2.path, - parent: input2.parent - } - }; - } - _parseSync(input2) { - const result3 = this._parse(input2); - if (isAsync2(result3)) { - throw new Error("Synchronous parse encountered promise."); - } - return result3; - } - _parseAsync(input2) { - const result3 = this._parse(input2); - return Promise.resolve(result3); - } - parse(data, params) { - const result3 = this.safeParse(data, params); - if (result3.success) - return result3.data; - throw result3.error; - } - safeParse(data, params) { - const ctx = { - common: { - issues: [], - async: params?.async ?? false, - contextualErrorMap: params?.errorMap - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType3(data) - }; - const result3 = this._parseSync({ data, path: ctx.path, parent: ctx }); - return handleResult3(ctx, result3); - } - "~validate"(data) { - const ctx = { - common: { - issues: [], - async: !!this["~standard"].async - }, - path: [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType3(data) - }; - if (!this["~standard"].async) { - try { - const result3 = this._parseSync({ data, path: [], parent: ctx }); - return isValid2(result3) ? { - value: result3.value - } : { - issues: ctx.common.issues - }; - } catch (err) { - if (err?.message?.toLowerCase()?.includes("encountered")) { - this["~standard"].async = true; - } - ctx.common = { - issues: [], - async: true - }; - } - } - return this._parseAsync({ data, path: [], parent: ctx }).then((result3) => isValid2(result3) ? { - value: result3.value - } : { - issues: ctx.common.issues - }); - } - async parseAsync(data, params) { - const result3 = await this.safeParseAsync(data, params); - if (result3.success) - return result3.data; - throw result3.error; - } - async safeParseAsync(data, params) { - const ctx = { - common: { - issues: [], - contextualErrorMap: params?.errorMap, - async: true - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType3(data) - }; - const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); - const result3 = await (isAsync2(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); - return handleResult3(ctx, result3); - } - refine(check3, message) { - const getIssueProperties = (val) => { - if (typeof message === "string" || typeof message === "undefined") { - return { message }; - } else if (typeof message === "function") { - return message(val); - } else { - return message; - } - }; - return this._refinement((val, ctx) => { - const result3 = check3(val); - const setError = () => ctx.addIssue({ - code: ZodIssueCode3.custom, - ...getIssueProperties(val) - }); - if (typeof Promise !== "undefined" && result3 instanceof Promise) { - return result3.then((data) => { - if (!data) { - setError(); - return false; - } else { - return true; - } - }); - } - if (!result3) { - setError(); - return false; - } else { - return true; - } - }); - } - refinement(check3, refinementData) { - return this._refinement((val, ctx) => { - if (!check3(val)) { - ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); - return false; - } else { - return true; - } - }); - } - _refinement(refinement) { - return new ZodEffects2({ - schema: this, - typeName: ZodFirstPartyTypeKind2.ZodEffects, - effect: { type: "refinement", refinement } - }); - } - superRefine(refinement) { - return this._refinement(refinement); - } - constructor(def2) { - this.spa = this.safeParseAsync; - this._def = def2; - this.parse = this.parse.bind(this); - this.safeParse = this.safeParse.bind(this); - this.parseAsync = this.parseAsync.bind(this); - this.safeParseAsync = this.safeParseAsync.bind(this); - this.spa = this.spa.bind(this); - this.refine = this.refine.bind(this); - this.refinement = this.refinement.bind(this); - this.superRefine = this.superRefine.bind(this); - this.optional = this.optional.bind(this); - this.nullable = this.nullable.bind(this); - this.nullish = this.nullish.bind(this); - this.array = this.array.bind(this); - this.promise = this.promise.bind(this); - this.or = this.or.bind(this); - this.and = this.and.bind(this); - this.transform = this.transform.bind(this); - this.brand = this.brand.bind(this); - this.default = this.default.bind(this); - this.catch = this.catch.bind(this); - this.describe = this.describe.bind(this); - this.pipe = this.pipe.bind(this); - this.readonly = this.readonly.bind(this); - this.isNullable = this.isNullable.bind(this); - this.isOptional = this.isOptional.bind(this); - this["~standard"] = { - version: 1, - vendor: "zod", - validate: (data) => this["~validate"](data) - }; - } - optional() { - return ZodOptional3.create(this, this._def); - } - nullable() { - return ZodNullable3.create(this, this._def); - } - nullish() { - return this.nullable().optional(); - } - array() { - return ZodArray3.create(this); - } - promise() { - return ZodPromise3.create(this, this._def); - } - or(option) { - return ZodUnion3.create([this, option], this._def); - } - and(incoming) { - return ZodIntersection3.create(this, incoming, this._def); - } - transform(transform4) { - return new ZodEffects2({ - ...processCreateParams2(this._def), - schema: this, - typeName: ZodFirstPartyTypeKind2.ZodEffects, - effect: { type: "transform", transform: transform4 } - }); - } - default(def2) { - const defaultValueFunc = typeof def2 === "function" ? def2 : () => def2; - return new ZodDefault3({ - ...processCreateParams2(this._def), - innerType: this, - defaultValue: defaultValueFunc, - typeName: ZodFirstPartyTypeKind2.ZodDefault - }); - } - brand() { - return new ZodBranded2({ - typeName: ZodFirstPartyTypeKind2.ZodBranded, - type: this, - ...processCreateParams2(this._def) - }); - } - catch(def2) { - const catchValueFunc = typeof def2 === "function" ? def2 : () => def2; - return new ZodCatch3({ - ...processCreateParams2(this._def), - innerType: this, - catchValue: catchValueFunc, - typeName: ZodFirstPartyTypeKind2.ZodCatch - }); - } - describe(description) { - const This = this.constructor; - return new This({ - ...this._def, - description - }); - } - pipe(target) { - return ZodPipeline2.create(this, target); - } - readonly() { - return ZodReadonly3.create(this); - } - isOptional() { - return this.safeParse(undefined).success; - } - isNullable() { - return this.safeParse(null).success; - } -} -function timeRegexSource2(args) { - let secondsRegexSource = `[0-5]\\d`; - if (args.precision) { - secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`; - } else if (args.precision == null) { - secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; - } - const secondsQuantifier = args.precision ? "+" : "?"; - return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; -} -function timeRegex2(args) { - return new RegExp(`^${timeRegexSource2(args)}$`); -} -function datetimeRegex2(args) { - let regex2 = `${dateRegexSource2}T${timeRegexSource2(args)}`; - const opts = []; - opts.push(args.local ? `Z?` : `Z`); - if (args.offset) - opts.push(`([+-]\\d{2}:?\\d{2})`); - regex2 = `${regex2}(${opts.join("|")})`; - return new RegExp(`^${regex2}$`); -} -function isValidIP2(ip, version2) { - if ((version2 === "v4" || !version2) && ipv4Regex2.test(ip)) { - return true; - } - if ((version2 === "v6" || !version2) && ipv6Regex2.test(ip)) { - return true; - } - return false; -} -function isValidJWT3(jwt2, alg) { - if (!jwtRegex2.test(jwt2)) - return false; - try { - const [header] = jwt2.split("."); - if (!header) - return false; - const base644 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); - const decoded = JSON.parse(atob(base644)); - if (typeof decoded !== "object" || decoded === null) - return false; - if ("typ" in decoded && decoded?.typ !== "JWT") - return false; - if (!decoded.alg) - return false; - if (alg && decoded.alg !== alg) - return false; - return true; - } catch { - return false; - } -} -function isValidCidr2(ip, version2) { - if ((version2 === "v4" || !version2) && ipv4CidrRegex2.test(ip)) { - return true; - } - if ((version2 === "v6" || !version2) && ipv6CidrRegex2.test(ip)) { - return true; - } - return false; -} -function floatSafeRemainder3(val, step) { - const valDecCount = (val.toString().split(".")[1] || "").length; - const stepDecCount = (step.toString().split(".")[1] || "").length; - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; - const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); - const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); - return valInt % stepInt / 10 ** decCount; -} -function deepPartialify2(schema) { - if (schema instanceof ZodObject3) { - const newShape = {}; - for (const key in schema.shape) { - const fieldSchema = schema.shape[key]; - newShape[key] = ZodOptional3.create(deepPartialify2(fieldSchema)); - } - return new ZodObject3({ - ...schema._def, - shape: () => newShape - }); - } else if (schema instanceof ZodArray3) { - return new ZodArray3({ - ...schema._def, - type: deepPartialify2(schema.element) - }); - } else if (schema instanceof ZodOptional3) { - return ZodOptional3.create(deepPartialify2(schema.unwrap())); - } else if (schema instanceof ZodNullable3) { - return ZodNullable3.create(deepPartialify2(schema.unwrap())); - } else if (schema instanceof ZodTuple3) { - return ZodTuple3.create(schema.items.map((item) => deepPartialify2(item))); - } else { - return schema; - } -} -function mergeValues3(a2, b) { - const aType = getParsedType3(a2); - const bType = getParsedType3(b); - if (a2 === b) { - return { valid: true, data: a2 }; - } else if (aType === ZodParsedType2.object && bType === ZodParsedType2.object) { - const bKeys = util5.objectKeys(b); - const sharedKeys = util5.objectKeys(a2).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { ...a2, ...b }; - for (const key of sharedKeys) { - const sharedValue = mergeValues3(a2[key], b[key]); - if (!sharedValue.valid) { - return { valid: false }; - } - newObj[key] = sharedValue.data; - } - return { valid: true, data: newObj }; - } else if (aType === ZodParsedType2.array && bType === ZodParsedType2.array) { - if (a2.length !== b.length) { - return { valid: false }; - } - const newArray = []; - for (let index = 0;index < a2.length; index++) { - const itemA = a2[index]; - const itemB = b[index]; - const sharedValue = mergeValues3(itemA, itemB); - if (!sharedValue.valid) { - return { valid: false }; - } - newArray.push(sharedValue.data); - } - return { valid: true, data: newArray }; - } else if (aType === ZodParsedType2.date && bType === ZodParsedType2.date && +a2 === +b) { - return { valid: true, data: a2 }; - } else { - return { valid: false }; - } -} -function createZodEnum2(values4, params) { - return new ZodEnum3({ - values: values4, - typeName: ZodFirstPartyTypeKind2.ZodEnum, - ...processCreateParams2(params) - }); -} -function cleanParams2(params, data) { - const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params; - const p2 = typeof p === "string" ? { message: p } : p; - return p2; -} -function custom3(check3, _params = {}, fatal) { - if (check3) - return ZodAny3.create().superRefine((data, ctx) => { - const r = check3(data); - if (r instanceof Promise) { - return r.then((r2) => { - if (!r2) { - const params = cleanParams2(_params, data); - const _fatal = params.fatal ?? fatal ?? true; - ctx.addIssue({ code: "custom", ...params, fatal: _fatal }); - } - }); - } - if (!r) { - const params = cleanParams2(_params, data); - const _fatal = params.fatal ?? fatal ?? true; - ctx.addIssue({ code: "custom", ...params, fatal: _fatal }); - } - return; - }); - return ZodAny3.create(); -} -var handleResult3 = (ctx, result3) => { - if (isValid2(result3)) { - return { success: true, data: result3.value }; - } else { - if (!ctx.common.issues.length) { - throw new Error("Validation failed but no issues detected."); - } - return { - success: false, - get error() { - if (this._error) - return this._error; - const error45 = new ZodError4(ctx.common.issues); - this._error = error45; - return this._error; - } - }; - } -}, cuidRegex2, cuid2Regex2, ulidRegex2, uuidRegex3, nanoidRegex2, jwtRegex2, durationRegex2, emailRegex2, _emojiRegex2 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, emojiRegex3, ipv4Regex2, ipv4CidrRegex2, ipv6Regex2, ipv6CidrRegex2, base64Regex2, base64urlRegex2, dateRegexSource2 = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`, dateRegex2, ZodString3, ZodNumber3, ZodBigInt3, ZodBoolean3, ZodDate3, ZodSymbol3, ZodUndefined3, ZodNull3, ZodAny3, ZodUnknown3, ZodNever3, ZodVoid3, ZodArray3, ZodObject3, ZodUnion3, getDiscriminator2 = (type) => { - if (type instanceof ZodLazy3) { - return getDiscriminator2(type.schema); - } else if (type instanceof ZodEffects2) { - return getDiscriminator2(type.innerType()); - } else if (type instanceof ZodLiteral3) { - return [type.value]; - } else if (type instanceof ZodEnum3) { - return type.options; - } else if (type instanceof ZodNativeEnum2) { - return util5.objectValues(type.enum); - } else if (type instanceof ZodDefault3) { - return getDiscriminator2(type._def.innerType); - } else if (type instanceof ZodUndefined3) { - return [undefined]; - } else if (type instanceof ZodNull3) { - return [null]; - } else if (type instanceof ZodOptional3) { - return [undefined, ...getDiscriminator2(type.unwrap())]; - } else if (type instanceof ZodNullable3) { - return [null, ...getDiscriminator2(type.unwrap())]; - } else if (type instanceof ZodBranded2) { - return getDiscriminator2(type.unwrap()); - } else if (type instanceof ZodReadonly3) { - return getDiscriminator2(type.unwrap()); - } else if (type instanceof ZodCatch3) { - return getDiscriminator2(type._def.innerType); - } else { - return []; - } -}, ZodDiscriminatedUnion3, ZodIntersection3, ZodTuple3, ZodRecord3, ZodMap3, ZodSet3, ZodFunction2, ZodLazy3, ZodLiteral3, ZodEnum3, ZodNativeEnum2, ZodPromise3, ZodEffects2, ZodOptional3, ZodNullable3, ZodDefault3, ZodCatch3, ZodNaN3, BRAND2, ZodBranded2, ZodPipeline2, ZodReadonly3, late2, ZodFirstPartyTypeKind2, instanceOfType2 = (cls, params = { - message: `Input not instance of ${cls.name}` -}) => custom3((data) => data instanceof cls, params), stringType2, numberType2, nanType2, bigIntType2, booleanType2, dateType2, symbolType2, undefinedType2, nullType2, anyType2, unknownType2, neverType2, voidType2, arrayType2, objectType2, strictObjectType2, unionType2, discriminatedUnionType2, intersectionType2, tupleType2, recordType2, mapType2, setType2, functionType2, lazyType2, literalType2, enumType2, nativeEnumType2, promiseType2, effectsType2, optionalType2, nullableType2, preprocessType2, pipelineType2, ostring2 = () => stringType2().optional(), onumber2 = () => numberType2().optional(), oboolean2 = () => booleanType2().optional(), coerce3, NEVER3; -var init_types6 = __esm(() => { - init_ZodError2(); - init_errors6(); - init_errorUtil2(); - init_parseUtil2(); - init_util6(); - cuidRegex2 = /^c[^\s-]{8,}$/i; - cuid2Regex2 = /^[0-9a-z]+$/; - ulidRegex2 = /^[0-9A-HJKMNP-TV-Z]{26}$/i; - uuidRegex3 = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; - nanoidRegex2 = /^[a-z0-9_-]{21}$/i; - jwtRegex2 = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; - durationRegex2 = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; - emailRegex2 = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; - ipv4Regex2 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; - ipv4CidrRegex2 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/; - ipv6Regex2 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/; - ipv6CidrRegex2 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; - base64Regex2 = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; - base64urlRegex2 = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; - dateRegex2 = new RegExp(`^${dateRegexSource2}$`); - ZodString3 = class ZodString3 extends ZodType3 { - _parse(input2) { - if (this._def.coerce) { - input2.data = String(input2.data); - } - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.string) { - const ctx2 = this._getOrReturnCtx(input2); - addIssueToContext2(ctx2, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.string, - received: ctx2.parsedType - }); - return INVALID2; - } - const status = new ParseStatus2; - let ctx = undefined; - for (const check3 of this._def.checks) { - if (check3.kind === "min") { - if (input2.data.length < check3.value) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_small, - minimum: check3.value, - type: "string", - inclusive: true, - exact: false, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "max") { - if (input2.data.length > check3.value) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_big, - maximum: check3.value, - type: "string", - inclusive: true, - exact: false, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "length") { - const tooBig = input2.data.length > check3.value; - const tooSmall = input2.data.length < check3.value; - if (tooBig || tooSmall) { - ctx = this._getOrReturnCtx(input2, ctx); - if (tooBig) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_big, - maximum: check3.value, - type: "string", - inclusive: true, - exact: true, - message: check3.message - }); - } else if (tooSmall) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_small, - minimum: check3.value, - type: "string", - inclusive: true, - exact: true, - message: check3.message - }); - } - status.dirty(); - } - } else if (check3.kind === "email") { - if (!emailRegex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "email", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "emoji") { - if (!emojiRegex3) { - emojiRegex3 = new RegExp(_emojiRegex2, "u"); - } - if (!emojiRegex3.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "emoji", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "uuid") { - if (!uuidRegex3.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "uuid", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "nanoid") { - if (!nanoidRegex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "nanoid", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "cuid") { - if (!cuidRegex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "cuid", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "cuid2") { - if (!cuid2Regex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "cuid2", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "ulid") { - if (!ulidRegex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "ulid", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "url") { - try { - new URL(input2.data); - } catch { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "url", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "regex") { - check3.regex.lastIndex = 0; - const testResult = check3.regex.test(input2.data); - if (!testResult) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "regex", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "trim") { - input2.data = input2.data.trim(); - } else if (check3.kind === "includes") { - if (!input2.data.includes(check3.value, check3.position)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_string, - validation: { includes: check3.value, position: check3.position }, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "toLowerCase") { - input2.data = input2.data.toLowerCase(); - } else if (check3.kind === "toUpperCase") { - input2.data = input2.data.toUpperCase(); - } else if (check3.kind === "startsWith") { - if (!input2.data.startsWith(check3.value)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_string, - validation: { startsWith: check3.value }, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "endsWith") { - if (!input2.data.endsWith(check3.value)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_string, - validation: { endsWith: check3.value }, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "datetime") { - const regex2 = datetimeRegex2(check3); - if (!regex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_string, - validation: "datetime", - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "date") { - const regex2 = dateRegex2; - if (!regex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_string, - validation: "date", - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "time") { - const regex2 = timeRegex2(check3); - if (!regex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_string, - validation: "time", - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "duration") { - if (!durationRegex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "duration", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "ip") { - if (!isValidIP2(input2.data, check3.version)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "ip", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "jwt") { - if (!isValidJWT3(input2.data, check3.alg)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "jwt", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "cidr") { - if (!isValidCidr2(input2.data, check3.version)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "cidr", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "base64") { - if (!base64Regex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "base64", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "base64url") { - if (!base64urlRegex2.test(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - validation: "base64url", - code: ZodIssueCode3.invalid_string, - message: check3.message - }); - status.dirty(); - } - } else { - util5.assertNever(check3); - } - } - return { status: status.value, value: input2.data }; - } - _regex(regex2, validation, message) { - return this.refinement((data) => regex2.test(data), { - validation, - code: ZodIssueCode3.invalid_string, - ...errorUtil2.errToObj(message) - }); - } - _addCheck(check3) { - return new ZodString3({ - ...this._def, - checks: [...this._def.checks, check3] - }); - } - email(message) { - return this._addCheck({ kind: "email", ...errorUtil2.errToObj(message) }); - } - url(message) { - return this._addCheck({ kind: "url", ...errorUtil2.errToObj(message) }); - } - emoji(message) { - return this._addCheck({ kind: "emoji", ...errorUtil2.errToObj(message) }); - } - uuid(message) { - return this._addCheck({ kind: "uuid", ...errorUtil2.errToObj(message) }); - } - nanoid(message) { - return this._addCheck({ kind: "nanoid", ...errorUtil2.errToObj(message) }); - } - cuid(message) { - return this._addCheck({ kind: "cuid", ...errorUtil2.errToObj(message) }); - } - cuid2(message) { - return this._addCheck({ kind: "cuid2", ...errorUtil2.errToObj(message) }); - } - ulid(message) { - return this._addCheck({ kind: "ulid", ...errorUtil2.errToObj(message) }); - } - base64(message) { - return this._addCheck({ kind: "base64", ...errorUtil2.errToObj(message) }); - } - base64url(message) { - return this._addCheck({ - kind: "base64url", - ...errorUtil2.errToObj(message) - }); - } - jwt(options2) { - return this._addCheck({ kind: "jwt", ...errorUtil2.errToObj(options2) }); - } - ip(options2) { - return this._addCheck({ kind: "ip", ...errorUtil2.errToObj(options2) }); - } - cidr(options2) { - return this._addCheck({ kind: "cidr", ...errorUtil2.errToObj(options2) }); - } - datetime(options2) { - if (typeof options2 === "string") { - return this._addCheck({ - kind: "datetime", - precision: null, - offset: false, - local: false, - message: options2 - }); - } - return this._addCheck({ - kind: "datetime", - precision: typeof options2?.precision === "undefined" ? null : options2?.precision, - offset: options2?.offset ?? false, - local: options2?.local ?? false, - ...errorUtil2.errToObj(options2?.message) - }); - } - date(message) { - return this._addCheck({ kind: "date", message }); - } - time(options2) { - if (typeof options2 === "string") { - return this._addCheck({ - kind: "time", - precision: null, - message: options2 - }); - } - return this._addCheck({ - kind: "time", - precision: typeof options2?.precision === "undefined" ? null : options2?.precision, - ...errorUtil2.errToObj(options2?.message) - }); - } - duration(message) { - return this._addCheck({ kind: "duration", ...errorUtil2.errToObj(message) }); - } - regex(regex2, message) { - return this._addCheck({ - kind: "regex", - regex: regex2, - ...errorUtil2.errToObj(message) - }); - } - includes(value, options2) { - return this._addCheck({ - kind: "includes", - value, - position: options2?.position, - ...errorUtil2.errToObj(options2?.message) - }); - } - startsWith(value, message) { - return this._addCheck({ - kind: "startsWith", - value, - ...errorUtil2.errToObj(message) - }); - } - endsWith(value, message) { - return this._addCheck({ - kind: "endsWith", - value, - ...errorUtil2.errToObj(message) - }); - } - min(minLength, message) { - return this._addCheck({ - kind: "min", - value: minLength, - ...errorUtil2.errToObj(message) - }); - } - max(maxLength, message) { - return this._addCheck({ - kind: "max", - value: maxLength, - ...errorUtil2.errToObj(message) - }); - } - length(len, message) { - return this._addCheck({ - kind: "length", - value: len, - ...errorUtil2.errToObj(message) - }); - } - nonempty(message) { - return this.min(1, errorUtil2.errToObj(message)); - } - trim() { - return new ZodString3({ - ...this._def, - checks: [...this._def.checks, { kind: "trim" }] - }); - } - toLowerCase() { - return new ZodString3({ - ...this._def, - checks: [...this._def.checks, { kind: "toLowerCase" }] - }); - } - toUpperCase() { - return new ZodString3({ - ...this._def, - checks: [...this._def.checks, { kind: "toUpperCase" }] - }); - } - get isDatetime() { - return !!this._def.checks.find((ch) => ch.kind === "datetime"); - } - get isDate() { - return !!this._def.checks.find((ch) => ch.kind === "date"); - } - get isTime() { - return !!this._def.checks.find((ch) => ch.kind === "time"); - } - get isDuration() { - return !!this._def.checks.find((ch) => ch.kind === "duration"); - } - get isEmail() { - return !!this._def.checks.find((ch) => ch.kind === "email"); - } - get isURL() { - return !!this._def.checks.find((ch) => ch.kind === "url"); - } - get isEmoji() { - return !!this._def.checks.find((ch) => ch.kind === "emoji"); - } - get isUUID() { - return !!this._def.checks.find((ch) => ch.kind === "uuid"); - } - get isNANOID() { - return !!this._def.checks.find((ch) => ch.kind === "nanoid"); - } - get isCUID() { - return !!this._def.checks.find((ch) => ch.kind === "cuid"); - } - get isCUID2() { - return !!this._def.checks.find((ch) => ch.kind === "cuid2"); - } - get isULID() { - return !!this._def.checks.find((ch) => ch.kind === "ulid"); - } - get isIP() { - return !!this._def.checks.find((ch) => ch.kind === "ip"); - } - get isCIDR() { - return !!this._def.checks.find((ch) => ch.kind === "cidr"); - } - get isBase64() { - return !!this._def.checks.find((ch) => ch.kind === "base64"); - } - get isBase64url() { - return !!this._def.checks.find((ch) => ch.kind === "base64url"); - } - get minLength() { - let min3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min3 === null || ch.value > min3) - min3 = ch.value; - } - } - return min3; - } - get maxLength() { - let max3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max3 === null || ch.value < max3) - max3 = ch.value; - } - } - return max3; - } - }; - ZodString3.create = (params) => { - return new ZodString3({ - checks: [], - typeName: ZodFirstPartyTypeKind2.ZodString, - coerce: params?.coerce ?? false, - ...processCreateParams2(params) - }); - }; - ZodNumber3 = class ZodNumber3 extends ZodType3 { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - this.step = this.multipleOf; - } - _parse(input2) { - if (this._def.coerce) { - input2.data = Number(input2.data); - } - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.number) { - const ctx2 = this._getOrReturnCtx(input2); - addIssueToContext2(ctx2, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.number, - received: ctx2.parsedType - }); - return INVALID2; - } - let ctx = undefined; - const status = new ParseStatus2; - for (const check3 of this._def.checks) { - if (check3.kind === "int") { - if (!util5.isInteger(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: "integer", - received: "float", - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "min") { - const tooSmall = check3.inclusive ? input2.data < check3.value : input2.data <= check3.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_small, - minimum: check3.value, - type: "number", - inclusive: check3.inclusive, - exact: false, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "max") { - const tooBig = check3.inclusive ? input2.data > check3.value : input2.data >= check3.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_big, - maximum: check3.value, - type: "number", - inclusive: check3.inclusive, - exact: false, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "multipleOf") { - if (floatSafeRemainder3(input2.data, check3.value) !== 0) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.not_multiple_of, - multipleOf: check3.value, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "finite") { - if (!Number.isFinite(input2.data)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.not_finite, - message: check3.message - }); - status.dirty(); - } - } else { - util5.assertNever(check3); - } - } - return { status: status.value, value: input2.data }; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil2.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil2.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil2.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil2.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new ZodNumber3({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil2.toString(message) - } - ] - }); - } - _addCheck(check3) { - return new ZodNumber3({ - ...this._def, - checks: [...this._def.checks, check3] - }); - } - int(message) { - return this._addCheck({ - kind: "int", - message: errorUtil2.toString(message) - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: false, - message: errorUtil2.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: false, - message: errorUtil2.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: true, - message: errorUtil2.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: true, - message: errorUtil2.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil2.toString(message) - }); - } - finite(message) { - return this._addCheck({ - kind: "finite", - message: errorUtil2.toString(message) - }); - } - safe(message) { - return this._addCheck({ - kind: "min", - inclusive: true, - value: Number.MIN_SAFE_INTEGER, - message: errorUtil2.toString(message) - })._addCheck({ - kind: "max", - inclusive: true, - value: Number.MAX_SAFE_INTEGER, - message: errorUtil2.toString(message) - }); - } - get minValue() { - let min3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min3 === null || ch.value > min3) - min3 = ch.value; - } - } - return min3; - } - get maxValue() { - let max3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max3 === null || ch.value < max3) - max3 = ch.value; - } - } - return max3; - } - get isInt() { - return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util5.isInteger(ch.value)); - } - get isFinite() { - let max3 = null; - let min3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") { - return true; - } else if (ch.kind === "min") { - if (min3 === null || ch.value > min3) - min3 = ch.value; - } else if (ch.kind === "max") { - if (max3 === null || ch.value < max3) - max3 = ch.value; - } - } - return Number.isFinite(min3) && Number.isFinite(max3); - } - }; - ZodNumber3.create = (params) => { - return new ZodNumber3({ - checks: [], - typeName: ZodFirstPartyTypeKind2.ZodNumber, - coerce: params?.coerce || false, - ...processCreateParams2(params) - }); - }; - ZodBigInt3 = class ZodBigInt3 extends ZodType3 { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - } - _parse(input2) { - if (this._def.coerce) { - try { - input2.data = BigInt(input2.data); - } catch { - return this._getInvalidInput(input2); - } - } - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.bigint) { - return this._getInvalidInput(input2); - } - let ctx = undefined; - const status = new ParseStatus2; - for (const check3 of this._def.checks) { - if (check3.kind === "min") { - const tooSmall = check3.inclusive ? input2.data < check3.value : input2.data <= check3.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_small, - type: "bigint", - minimum: check3.value, - inclusive: check3.inclusive, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "max") { - const tooBig = check3.inclusive ? input2.data > check3.value : input2.data >= check3.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_big, - type: "bigint", - maximum: check3.value, - inclusive: check3.inclusive, - message: check3.message - }); - status.dirty(); - } - } else if (check3.kind === "multipleOf") { - if (input2.data % check3.value !== BigInt(0)) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.not_multiple_of, - multipleOf: check3.value, - message: check3.message - }); - status.dirty(); - } - } else { - util5.assertNever(check3); - } - } - return { status: status.value, value: input2.data }; - } - _getInvalidInput(input2) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.bigint, - received: ctx.parsedType - }); - return INVALID2; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil2.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil2.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil2.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil2.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new ZodBigInt3({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil2.toString(message) - } - ] - }); - } - _addCheck(check3) { - return new ZodBigInt3({ - ...this._def, - checks: [...this._def.checks, check3] - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: false, - message: errorUtil2.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: false, - message: errorUtil2.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: true, - message: errorUtil2.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: true, - message: errorUtil2.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil2.toString(message) - }); - } - get minValue() { - let min3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min3 === null || ch.value > min3) - min3 = ch.value; - } - } - return min3; - } - get maxValue() { - let max3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max3 === null || ch.value < max3) - max3 = ch.value; - } - } - return max3; - } - }; - ZodBigInt3.create = (params) => { - return new ZodBigInt3({ - checks: [], - typeName: ZodFirstPartyTypeKind2.ZodBigInt, - coerce: params?.coerce ?? false, - ...processCreateParams2(params) - }); - }; - ZodBoolean3 = class ZodBoolean3 extends ZodType3 { - _parse(input2) { - if (this._def.coerce) { - input2.data = Boolean(input2.data); - } - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.boolean) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.boolean, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input2.data); - } - }; - ZodBoolean3.create = (params) => { - return new ZodBoolean3({ - typeName: ZodFirstPartyTypeKind2.ZodBoolean, - coerce: params?.coerce || false, - ...processCreateParams2(params) - }); - }; - ZodDate3 = class ZodDate3 extends ZodType3 { - _parse(input2) { - if (this._def.coerce) { - input2.data = new Date(input2.data); - } - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.date) { - const ctx2 = this._getOrReturnCtx(input2); - addIssueToContext2(ctx2, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.date, - received: ctx2.parsedType - }); - return INVALID2; - } - if (Number.isNaN(input2.data.getTime())) { - const ctx2 = this._getOrReturnCtx(input2); - addIssueToContext2(ctx2, { - code: ZodIssueCode3.invalid_date - }); - return INVALID2; - } - const status = new ParseStatus2; - let ctx = undefined; - for (const check3 of this._def.checks) { - if (check3.kind === "min") { - if (input2.data.getTime() < check3.value) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_small, - message: check3.message, - inclusive: true, - exact: false, - minimum: check3.value, - type: "date" - }); - status.dirty(); - } - } else if (check3.kind === "max") { - if (input2.data.getTime() > check3.value) { - ctx = this._getOrReturnCtx(input2, ctx); - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_big, - message: check3.message, - inclusive: true, - exact: false, - maximum: check3.value, - type: "date" - }); - status.dirty(); - } - } else { - util5.assertNever(check3); - } - } - return { - status: status.value, - value: new Date(input2.data.getTime()) - }; - } - _addCheck(check3) { - return new ZodDate3({ - ...this._def, - checks: [...this._def.checks, check3] - }); - } - min(minDate, message) { - return this._addCheck({ - kind: "min", - value: minDate.getTime(), - message: errorUtil2.toString(message) - }); - } - max(maxDate, message) { - return this._addCheck({ - kind: "max", - value: maxDate.getTime(), - message: errorUtil2.toString(message) - }); - } - get minDate() { - let min3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min3 === null || ch.value > min3) - min3 = ch.value; - } - } - return min3 != null ? new Date(min3) : null; - } - get maxDate() { - let max3 = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max3 === null || ch.value < max3) - max3 = ch.value; - } - } - return max3 != null ? new Date(max3) : null; - } - }; - ZodDate3.create = (params) => { - return new ZodDate3({ - checks: [], - coerce: params?.coerce || false, - typeName: ZodFirstPartyTypeKind2.ZodDate, - ...processCreateParams2(params) - }); - }; - ZodSymbol3 = class ZodSymbol3 extends ZodType3 { - _parse(input2) { - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.symbol) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.symbol, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input2.data); - } - }; - ZodSymbol3.create = (params) => { - return new ZodSymbol3({ - typeName: ZodFirstPartyTypeKind2.ZodSymbol, - ...processCreateParams2(params) - }); - }; - ZodUndefined3 = class ZodUndefined3 extends ZodType3 { - _parse(input2) { - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.undefined) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.undefined, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input2.data); - } - }; - ZodUndefined3.create = (params) => { - return new ZodUndefined3({ - typeName: ZodFirstPartyTypeKind2.ZodUndefined, - ...processCreateParams2(params) - }); - }; - ZodNull3 = class ZodNull3 extends ZodType3 { - _parse(input2) { - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.null) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.null, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input2.data); - } - }; - ZodNull3.create = (params) => { - return new ZodNull3({ - typeName: ZodFirstPartyTypeKind2.ZodNull, - ...processCreateParams2(params) - }); - }; - ZodAny3 = class ZodAny3 extends ZodType3 { - constructor() { - super(...arguments); - this._any = true; - } - _parse(input2) { - return OK2(input2.data); - } - }; - ZodAny3.create = (params) => { - return new ZodAny3({ - typeName: ZodFirstPartyTypeKind2.ZodAny, - ...processCreateParams2(params) - }); - }; - ZodUnknown3 = class ZodUnknown3 extends ZodType3 { - constructor() { - super(...arguments); - this._unknown = true; - } - _parse(input2) { - return OK2(input2.data); - } - }; - ZodUnknown3.create = (params) => { - return new ZodUnknown3({ - typeName: ZodFirstPartyTypeKind2.ZodUnknown, - ...processCreateParams2(params) - }); - }; - ZodNever3 = class ZodNever3 extends ZodType3 { - _parse(input2) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.never, - received: ctx.parsedType - }); - return INVALID2; - } - }; - ZodNever3.create = (params) => { - return new ZodNever3({ - typeName: ZodFirstPartyTypeKind2.ZodNever, - ...processCreateParams2(params) - }); - }; - ZodVoid3 = class ZodVoid3 extends ZodType3 { - _parse(input2) { - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.undefined) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.void, - received: ctx.parsedType - }); - return INVALID2; - } - return OK2(input2.data); - } - }; - ZodVoid3.create = (params) => { - return new ZodVoid3({ - typeName: ZodFirstPartyTypeKind2.ZodVoid, - ...processCreateParams2(params) - }); - }; - ZodArray3 = class ZodArray3 extends ZodType3 { - _parse(input2) { - const { ctx, status } = this._processInputParams(input2); - const def2 = this._def; - if (ctx.parsedType !== ZodParsedType2.array) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.array, - received: ctx.parsedType - }); - return INVALID2; - } - if (def2.exactLength !== null) { - const tooBig = ctx.data.length > def2.exactLength.value; - const tooSmall = ctx.data.length < def2.exactLength.value; - if (tooBig || tooSmall) { - addIssueToContext2(ctx, { - code: tooBig ? ZodIssueCode3.too_big : ZodIssueCode3.too_small, - minimum: tooSmall ? def2.exactLength.value : undefined, - maximum: tooBig ? def2.exactLength.value : undefined, - type: "array", - inclusive: true, - exact: true, - message: def2.exactLength.message - }); - status.dirty(); - } - } - if (def2.minLength !== null) { - if (ctx.data.length < def2.minLength.value) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_small, - minimum: def2.minLength.value, - type: "array", - inclusive: true, - exact: false, - message: def2.minLength.message - }); - status.dirty(); - } - } - if (def2.maxLength !== null) { - if (ctx.data.length > def2.maxLength.value) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_big, - maximum: def2.maxLength.value, - type: "array", - inclusive: true, - exact: false, - message: def2.maxLength.message - }); - status.dirty(); - } - } - if (ctx.common.async) { - return Promise.all([...ctx.data].map((item, i2) => { - return def2.type._parseAsync(new ParseInputLazyPath2(ctx, item, ctx.path, i2)); - })).then((result4) => { - return ParseStatus2.mergeArray(status, result4); - }); - } - const result3 = [...ctx.data].map((item, i2) => { - return def2.type._parseSync(new ParseInputLazyPath2(ctx, item, ctx.path, i2)); - }); - return ParseStatus2.mergeArray(status, result3); - } - get element() { - return this._def.type; - } - min(minLength, message) { - return new ZodArray3({ - ...this._def, - minLength: { value: minLength, message: errorUtil2.toString(message) } - }); - } - max(maxLength, message) { - return new ZodArray3({ - ...this._def, - maxLength: { value: maxLength, message: errorUtil2.toString(message) } - }); - } - length(len, message) { - return new ZodArray3({ - ...this._def, - exactLength: { value: len, message: errorUtil2.toString(message) } - }); - } - nonempty(message) { - return this.min(1, message); - } - }; - ZodArray3.create = (schema, params) => { - return new ZodArray3({ - type: schema, - minLength: null, - maxLength: null, - exactLength: null, - typeName: ZodFirstPartyTypeKind2.ZodArray, - ...processCreateParams2(params) - }); - }; - ZodObject3 = class ZodObject3 extends ZodType3 { - constructor() { - super(...arguments); - this._cached = null; - this.nonstrict = this.passthrough; - this.augment = this.extend; - } - _getCached() { - if (this._cached !== null) - return this._cached; - const shape = this._def.shape(); - const keys3 = util5.objectKeys(shape); - this._cached = { shape, keys: keys3 }; - return this._cached; - } - _parse(input2) { - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.object) { - const ctx2 = this._getOrReturnCtx(input2); - addIssueToContext2(ctx2, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.object, - received: ctx2.parsedType - }); - return INVALID2; - } - const { status, ctx } = this._processInputParams(input2); - const { shape, keys: shapeKeys } = this._getCached(); - const extraKeys = []; - if (!(this._def.catchall instanceof ZodNever3 && this._def.unknownKeys === "strip")) { - for (const key in ctx.data) { - if (!shapeKeys.includes(key)) { - extraKeys.push(key); - } - } - } - const pairs = []; - for (const key of shapeKeys) { - const keyValidator = shape[key]; - const value = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: keyValidator._parse(new ParseInputLazyPath2(ctx, value, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (this._def.catchall instanceof ZodNever3) { - const unknownKeys = this._def.unknownKeys; - if (unknownKeys === "passthrough") { - for (const key of extraKeys) { - pairs.push({ - key: { status: "valid", value: key }, - value: { status: "valid", value: ctx.data[key] } - }); - } - } else if (unknownKeys === "strict") { - if (extraKeys.length > 0) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.unrecognized_keys, - keys: extraKeys - }); - status.dirty(); - } - } else if (unknownKeys === "strip") {} else { - throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); - } - } else { - const catchall = this._def.catchall; - for (const key of extraKeys) { - const value = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: catchall._parse(new ParseInputLazyPath2(ctx, value, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - } - if (ctx.common.async) { - return Promise.resolve().then(async () => { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - syncPairs.push({ - key, - value, - alwaysSet: pair.alwaysSet - }); - } - return syncPairs; - }).then((syncPairs) => { - return ParseStatus2.mergeObjectSync(status, syncPairs); - }); - } else { - return ParseStatus2.mergeObjectSync(status, pairs); - } - } - get shape() { - return this._def.shape(); - } - strict(message) { - errorUtil2.errToObj; - return new ZodObject3({ - ...this._def, - unknownKeys: "strict", - ...message !== undefined ? { - errorMap: (issue2, ctx) => { - const defaultError = this._def.errorMap?.(issue2, ctx).message ?? ctx.defaultError; - if (issue2.code === "unrecognized_keys") - return { - message: errorUtil2.errToObj(message).message ?? defaultError - }; - return { - message: defaultError - }; - } - } : {} - }); - } - strip() { - return new ZodObject3({ - ...this._def, - unknownKeys: "strip" - }); - } - passthrough() { - return new ZodObject3({ - ...this._def, - unknownKeys: "passthrough" - }); - } - extend(augmentation) { - return new ZodObject3({ - ...this._def, - shape: () => ({ - ...this._def.shape(), - ...augmentation - }) - }); - } - merge(merging) { - const merged = new ZodObject3({ - unknownKeys: merging._def.unknownKeys, - catchall: merging._def.catchall, - shape: () => ({ - ...this._def.shape(), - ...merging._def.shape() - }), - typeName: ZodFirstPartyTypeKind2.ZodObject - }); - return merged; - } - setKey(key, schema) { - return this.augment({ [key]: schema }); - } - catchall(index) { - return new ZodObject3({ - ...this._def, - catchall: index - }); - } - pick(mask) { - const shape = {}; - for (const key of util5.objectKeys(mask)) { - if (mask[key] && this.shape[key]) { - shape[key] = this.shape[key]; - } - } - return new ZodObject3({ - ...this._def, - shape: () => shape - }); - } - omit(mask) { - const shape = {}; - for (const key of util5.objectKeys(this.shape)) { - if (!mask[key]) { - shape[key] = this.shape[key]; - } - } - return new ZodObject3({ - ...this._def, - shape: () => shape - }); - } - deepPartial() { - return deepPartialify2(this); - } - partial(mask) { - const newShape = {}; - for (const key of util5.objectKeys(this.shape)) { - const fieldSchema = this.shape[key]; - if (mask && !mask[key]) { - newShape[key] = fieldSchema; - } else { - newShape[key] = fieldSchema.optional(); - } - } - return new ZodObject3({ - ...this._def, - shape: () => newShape - }); - } - required(mask) { - const newShape = {}; - for (const key of util5.objectKeys(this.shape)) { - if (mask && !mask[key]) { - newShape[key] = this.shape[key]; - } else { - const fieldSchema = this.shape[key]; - let newField = fieldSchema; - while (newField instanceof ZodOptional3) { - newField = newField._def.innerType; - } - newShape[key] = newField; - } - } - return new ZodObject3({ - ...this._def, - shape: () => newShape - }); - } - keyof() { - return createZodEnum2(util5.objectKeys(this.shape)); - } - }; - ZodObject3.create = (shape, params) => { - return new ZodObject3({ - shape: () => shape, - unknownKeys: "strip", - catchall: ZodNever3.create(), - typeName: ZodFirstPartyTypeKind2.ZodObject, - ...processCreateParams2(params) - }); - }; - ZodObject3.strictCreate = (shape, params) => { - return new ZodObject3({ - shape: () => shape, - unknownKeys: "strict", - catchall: ZodNever3.create(), - typeName: ZodFirstPartyTypeKind2.ZodObject, - ...processCreateParams2(params) - }); - }; - ZodObject3.lazycreate = (shape, params) => { - return new ZodObject3({ - shape, - unknownKeys: "strip", - catchall: ZodNever3.create(), - typeName: ZodFirstPartyTypeKind2.ZodObject, - ...processCreateParams2(params) - }); - }; - ZodUnion3 = class ZodUnion3 extends ZodType3 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); - const options2 = this._def.options; - function handleResults(results) { - for (const result3 of results) { - if (result3.result.status === "valid") { - return result3.result; - } - } - for (const result3 of results) { - if (result3.result.status === "dirty") { - ctx.common.issues.push(...result3.ctx.common.issues); - return result3.result; - } - } - const unionErrors = results.map((result3) => new ZodError4(result3.ctx.common.issues)); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_union, - unionErrors - }); - return INVALID2; - } - if (ctx.common.async) { - return Promise.all(options2.map(async (option) => { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - return { - result: await option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }), - ctx: childCtx - }; - })).then(handleResults); - } else { - let dirty = undefined; - const issues = []; - for (const option of options2) { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - const result3 = option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }); - if (result3.status === "valid") { - return result3; - } else if (result3.status === "dirty" && !dirty) { - dirty = { result: result3, ctx: childCtx }; - } - if (childCtx.common.issues.length) { - issues.push(childCtx.common.issues); - } - } - if (dirty) { - ctx.common.issues.push(...dirty.ctx.common.issues); - return dirty.result; - } - const unionErrors = issues.map((issues2) => new ZodError4(issues2)); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_union, - unionErrors - }); - return INVALID2; - } - } - get options() { - return this._def.options; - } - }; - ZodUnion3.create = (types2, params) => { - return new ZodUnion3({ - options: types2, - typeName: ZodFirstPartyTypeKind2.ZodUnion, - ...processCreateParams2(params) - }); - }; - ZodDiscriminatedUnion3 = class ZodDiscriminatedUnion3 extends ZodType3 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); - if (ctx.parsedType !== ZodParsedType2.object) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.object, - received: ctx.parsedType - }); - return INVALID2; - } - const discriminator = this.discriminator; - const discriminatorValue = ctx.data[discriminator]; - const option = this.optionsMap.get(discriminatorValue); - if (!option) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [discriminator] - }); - return INVALID2; - } - if (ctx.common.async) { - return option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } else { - return option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } - } - get discriminator() { - return this._def.discriminator; - } - get options() { - return this._def.options; - } - get optionsMap() { - return this._def.optionsMap; - } - static create(discriminator, options2, params) { - const optionsMap = new Map; - for (const type of options2) { - const discriminatorValues = getDiscriminator2(type.shape[discriminator]); - if (!discriminatorValues.length) { - throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); - } - for (const value of discriminatorValues) { - if (optionsMap.has(value)) { - throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); - } - optionsMap.set(value, type); - } - } - return new ZodDiscriminatedUnion3({ - typeName: ZodFirstPartyTypeKind2.ZodDiscriminatedUnion, - discriminator, - options: options2, - optionsMap, - ...processCreateParams2(params) - }); - } - }; - ZodIntersection3 = class ZodIntersection3 extends ZodType3 { - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); - const handleParsed = (parsedLeft, parsedRight) => { - if (isAborted2(parsedLeft) || isAborted2(parsedRight)) { - return INVALID2; - } - const merged = mergeValues3(parsedLeft.value, parsedRight.value); - if (!merged.valid) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_intersection_types - }); - return INVALID2; - } - if (isDirty2(parsedLeft) || isDirty2(parsedRight)) { - status.dirty(); - } - return { status: status.value, value: merged.data }; - }; - if (ctx.common.async) { - return Promise.all([ - this._def.left._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), - this._def.right._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }) - ]).then(([left, right]) => handleParsed(left, right)); - } else { - return handleParsed(this._def.left._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), this._def.right._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - })); - } - } - }; - ZodIntersection3.create = (left, right, params) => { - return new ZodIntersection3({ - left, - right, - typeName: ZodFirstPartyTypeKind2.ZodIntersection, - ...processCreateParams2(params) - }); - }; - ZodTuple3 = class ZodTuple3 extends ZodType3 { - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); - if (ctx.parsedType !== ZodParsedType2.array) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.array, - received: ctx.parsedType - }); - return INVALID2; - } - if (ctx.data.length < this._def.items.length) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_small, - minimum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - return INVALID2; - } - const rest3 = this._def.rest; - if (!rest3 && ctx.data.length > this._def.items.length) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_big, - maximum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - status.dirty(); - } - const items = [...ctx.data].map((item, itemIndex) => { - const schema = this._def.items[itemIndex] || this._def.rest; - if (!schema) - return null; - return schema._parse(new ParseInputLazyPath2(ctx, item, ctx.path, itemIndex)); - }).filter((x2) => !!x2); - if (ctx.common.async) { - return Promise.all(items).then((results) => { - return ParseStatus2.mergeArray(status, results); - }); - } else { - return ParseStatus2.mergeArray(status, items); - } - } - get items() { - return this._def.items; - } - rest(rest3) { - return new ZodTuple3({ - ...this._def, - rest: rest3 - }); - } - }; - ZodTuple3.create = (schemas4, params) => { - if (!Array.isArray(schemas4)) { - throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); - } - return new ZodTuple3({ - items: schemas4, - typeName: ZodFirstPartyTypeKind2.ZodTuple, - rest: null, - ...processCreateParams2(params) - }); - }; - ZodRecord3 = class ZodRecord3 extends ZodType3 { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); - if (ctx.parsedType !== ZodParsedType2.object) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.object, - received: ctx.parsedType - }); - return INVALID2; - } - const pairs = []; - const keyType = this._def.keyType; - const valueType = this._def.valueType; - for (const key in ctx.data) { - pairs.push({ - key: keyType._parse(new ParseInputLazyPath2(ctx, key, ctx.path, key)), - value: valueType._parse(new ParseInputLazyPath2(ctx, ctx.data[key], ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (ctx.common.async) { - return ParseStatus2.mergeObjectAsync(status, pairs); - } else { - return ParseStatus2.mergeObjectSync(status, pairs); - } - } - get element() { - return this._def.valueType; - } - static create(first, second, third) { - if (second instanceof ZodType3) { - return new ZodRecord3({ - keyType: first, - valueType: second, - typeName: ZodFirstPartyTypeKind2.ZodRecord, - ...processCreateParams2(third) - }); - } - return new ZodRecord3({ - keyType: ZodString3.create(), - valueType: first, - typeName: ZodFirstPartyTypeKind2.ZodRecord, - ...processCreateParams2(second) - }); - } - }; - ZodMap3 = class ZodMap3 extends ZodType3 { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); - if (ctx.parsedType !== ZodParsedType2.map) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.map, - received: ctx.parsedType - }); - return INVALID2; - } - const keyType = this._def.keyType; - const valueType = this._def.valueType; - const pairs = [...ctx.data.entries()].map(([key, value], index) => { - return { - key: keyType._parse(new ParseInputLazyPath2(ctx, key, ctx.path, [index, "key"])), - value: valueType._parse(new ParseInputLazyPath2(ctx, value, ctx.path, [index, "value"])) - }; - }); - if (ctx.common.async) { - const finalMap = new Map; - return Promise.resolve().then(async () => { - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - if (key.status === "aborted" || value.status === "aborted") { - return INVALID2; - } - if (key.status === "dirty" || value.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value.value); - } - return { status: status.value, value: finalMap }; - }); - } else { - const finalMap = new Map; - for (const pair of pairs) { - const key = pair.key; - const value = pair.value; - if (key.status === "aborted" || value.status === "aborted") { - return INVALID2; - } - if (key.status === "dirty" || value.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value.value); - } - return { status: status.value, value: finalMap }; - } - } - }; - ZodMap3.create = (keyType, valueType, params) => { - return new ZodMap3({ - valueType, - keyType, - typeName: ZodFirstPartyTypeKind2.ZodMap, - ...processCreateParams2(params) - }); - }; - ZodSet3 = class ZodSet3 extends ZodType3 { - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); - if (ctx.parsedType !== ZodParsedType2.set) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.set, - received: ctx.parsedType - }); - return INVALID2; - } - const def2 = this._def; - if (def2.minSize !== null) { - if (ctx.data.size < def2.minSize.value) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_small, - minimum: def2.minSize.value, - type: "set", - inclusive: true, - exact: false, - message: def2.minSize.message - }); - status.dirty(); - } - } - if (def2.maxSize !== null) { - if (ctx.data.size > def2.maxSize.value) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.too_big, - maximum: def2.maxSize.value, - type: "set", - inclusive: true, - exact: false, - message: def2.maxSize.message - }); - status.dirty(); - } - } - const valueType = this._def.valueType; - function finalizeSet(elements2) { - const parsedSet = new Set; - for (const element of elements2) { - if (element.status === "aborted") - return INVALID2; - if (element.status === "dirty") - status.dirty(); - parsedSet.add(element.value); - } - return { status: status.value, value: parsedSet }; - } - const elements = [...ctx.data.values()].map((item, i2) => valueType._parse(new ParseInputLazyPath2(ctx, item, ctx.path, i2))); - if (ctx.common.async) { - return Promise.all(elements).then((elements2) => finalizeSet(elements2)); - } else { - return finalizeSet(elements); - } - } - min(minSize, message) { - return new ZodSet3({ - ...this._def, - minSize: { value: minSize, message: errorUtil2.toString(message) } - }); - } - max(maxSize, message) { - return new ZodSet3({ - ...this._def, - maxSize: { value: maxSize, message: errorUtil2.toString(message) } - }); - } - size(size3, message) { - return this.min(size3, message).max(size3, message); - } - nonempty(message) { - return this.min(1, message); - } - }; - ZodSet3.create = (valueType, params) => { - return new ZodSet3({ - valueType, - minSize: null, - maxSize: null, - typeName: ZodFirstPartyTypeKind2.ZodSet, - ...processCreateParams2(params) - }); - }; - ZodFunction2 = class ZodFunction2 extends ZodType3 { - constructor() { - super(...arguments); - this.validate = this.implement; - } - _parse(input2) { - const { ctx } = this._processInputParams(input2); - if (ctx.parsedType !== ZodParsedType2.function) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.function, - received: ctx.parsedType - }); - return INVALID2; - } - function makeArgsIssue(args, error45) { - return makeIssue2({ - data: args, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap3(), en_default3].filter((x2) => !!x2), - issueData: { - code: ZodIssueCode3.invalid_arguments, - argumentsError: error45 - } - }); - } - function makeReturnsIssue(returns, error45) { - return makeIssue2({ - data: returns, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap3(), en_default3].filter((x2) => !!x2), - issueData: { - code: ZodIssueCode3.invalid_return_type, - returnTypeError: error45 - } - }); - } - const params = { errorMap: ctx.common.contextualErrorMap }; - const fn = ctx.data; - if (this._def.returns instanceof ZodPromise3) { - const me = this; - return OK2(async function(...args) { - const error45 = new ZodError4([]); - const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => { - error45.addIssue(makeArgsIssue(args, e)); - throw error45; - }); - const result3 = await Reflect.apply(fn, this, parsedArgs); - const parsedReturns = await me._def.returns._def.type.parseAsync(result3, params).catch((e) => { - error45.addIssue(makeReturnsIssue(result3, e)); - throw error45; - }); - return parsedReturns; - }); - } else { - const me = this; - return OK2(function(...args) { - const parsedArgs = me._def.args.safeParse(args, params); - if (!parsedArgs.success) { - throw new ZodError4([makeArgsIssue(args, parsedArgs.error)]); - } - const result3 = Reflect.apply(fn, this, parsedArgs.data); - const parsedReturns = me._def.returns.safeParse(result3, params); - if (!parsedReturns.success) { - throw new ZodError4([makeReturnsIssue(result3, parsedReturns.error)]); - } - return parsedReturns.data; - }); - } - } - parameters() { - return this._def.args; - } - returnType() { - return this._def.returns; - } - args(...items) { - return new ZodFunction2({ - ...this._def, - args: ZodTuple3.create(items).rest(ZodUnknown3.create()) - }); - } - returns(returnType) { - return new ZodFunction2({ - ...this._def, - returns: returnType - }); - } - implement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - strictImplement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - static create(args, returns, params) { - return new ZodFunction2({ - args: args ? args : ZodTuple3.create([]).rest(ZodUnknown3.create()), - returns: returns || ZodUnknown3.create(), - typeName: ZodFirstPartyTypeKind2.ZodFunction, - ...processCreateParams2(params) - }); - } - }; - ZodLazy3 = class ZodLazy3 extends ZodType3 { - get schema() { - return this._def.getter(); - } - _parse(input2) { - const { ctx } = this._processInputParams(input2); - const lazySchema2 = this._def.getter(); - return lazySchema2._parse({ data: ctx.data, path: ctx.path, parent: ctx }); - } - }; - ZodLazy3.create = (getter, params) => { - return new ZodLazy3({ - getter, - typeName: ZodFirstPartyTypeKind2.ZodLazy, - ...processCreateParams2(params) - }); - }; - ZodLiteral3 = class ZodLiteral3 extends ZodType3 { - _parse(input2) { - if (input2.data !== this._def.value) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - received: ctx.data, - code: ZodIssueCode3.invalid_literal, - expected: this._def.value - }); - return INVALID2; - } - return { status: "valid", value: input2.data }; - } - get value() { - return this._def.value; - } - }; - ZodLiteral3.create = (value, params) => { - return new ZodLiteral3({ - value, - typeName: ZodFirstPartyTypeKind2.ZodLiteral, - ...processCreateParams2(params) - }); - }; - ZodEnum3 = class ZodEnum3 extends ZodType3 { - _parse(input2) { - if (typeof input2.data !== "string") { - const ctx = this._getOrReturnCtx(input2); - const expectedValues = this._def.values; - addIssueToContext2(ctx, { - expected: util5.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode3.invalid_type - }); - return INVALID2; - } - if (!this._cache) { - this._cache = new Set(this._def.values); - } - if (!this._cache.has(input2.data)) { - const ctx = this._getOrReturnCtx(input2); - const expectedValues = this._def.values; - addIssueToContext2(ctx, { - received: ctx.data, - code: ZodIssueCode3.invalid_enum_value, - options: expectedValues - }); - return INVALID2; - } - return OK2(input2.data); - } - get options() { - return this._def.values; - } - get enum() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - get Values() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - get Enum() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - extract(values4, newDef = this._def) { - return ZodEnum3.create(values4, { - ...this._def, - ...newDef - }); - } - exclude(values4, newDef = this._def) { - return ZodEnum3.create(this.options.filter((opt) => !values4.includes(opt)), { - ...this._def, - ...newDef - }); - } - }; - ZodEnum3.create = createZodEnum2; - ZodNativeEnum2 = class ZodNativeEnum2 extends ZodType3 { - _parse(input2) { - const nativeEnumValues = util5.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input2); - if (ctx.parsedType !== ZodParsedType2.string && ctx.parsedType !== ZodParsedType2.number) { - const expectedValues = util5.objectValues(nativeEnumValues); - addIssueToContext2(ctx, { - expected: util5.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode3.invalid_type - }); - return INVALID2; - } - if (!this._cache) { - this._cache = new Set(util5.getValidEnumValues(this._def.values)); - } - if (!this._cache.has(input2.data)) { - const expectedValues = util5.objectValues(nativeEnumValues); - addIssueToContext2(ctx, { - received: ctx.data, - code: ZodIssueCode3.invalid_enum_value, - options: expectedValues - }); - return INVALID2; - } - return OK2(input2.data); - } - get enum() { - return this._def.values; - } - }; - ZodNativeEnum2.create = (values4, params) => { - return new ZodNativeEnum2({ - values: values4, - typeName: ZodFirstPartyTypeKind2.ZodNativeEnum, - ...processCreateParams2(params) - }); - }; - ZodPromise3 = class ZodPromise3 extends ZodType3 { - unwrap() { - return this._def.type; - } - _parse(input2) { - const { ctx } = this._processInputParams(input2); - if (ctx.parsedType !== ZodParsedType2.promise && ctx.common.async === false) { - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.promise, - received: ctx.parsedType - }); - return INVALID2; - } - const promisified = ctx.parsedType === ZodParsedType2.promise ? ctx.data : Promise.resolve(ctx.data); - return OK2(promisified.then((data) => { - return this._def.type.parseAsync(data, { - path: ctx.path, - errorMap: ctx.common.contextualErrorMap - }); - })); - } - }; - ZodPromise3.create = (schema, params) => { - return new ZodPromise3({ - type: schema, - typeName: ZodFirstPartyTypeKind2.ZodPromise, - ...processCreateParams2(params) - }); - }; - ZodEffects2 = class ZodEffects2 extends ZodType3 { - innerType() { - return this._def.schema; - } - sourceType() { - return this._def.schema._def.typeName === ZodFirstPartyTypeKind2.ZodEffects ? this._def.schema.sourceType() : this._def.schema; - } - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); - const effect = this._def.effect || null; - const checkCtx = { - addIssue: (arg) => { - addIssueToContext2(ctx, arg); - if (arg.fatal) { - status.abort(); - } else { - status.dirty(); - } - }, - get path() { - return ctx.path; - } - }; - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); - if (effect.type === "preprocess") { - const processed = effect.transform(ctx.data, checkCtx); - if (ctx.common.async) { - return Promise.resolve(processed).then(async (processed2) => { - if (status.value === "aborted") - return INVALID2; - const result3 = await this._def.schema._parseAsync({ - data: processed2, - path: ctx.path, - parent: ctx - }); - if (result3.status === "aborted") - return INVALID2; - if (result3.status === "dirty") - return DIRTY2(result3.value); - if (status.value === "dirty") - return DIRTY2(result3.value); - return result3; - }); - } else { - if (status.value === "aborted") - return INVALID2; - const result3 = this._def.schema._parseSync({ - data: processed, - path: ctx.path, - parent: ctx - }); - if (result3.status === "aborted") - return INVALID2; - if (result3.status === "dirty") - return DIRTY2(result3.value); - if (status.value === "dirty") - return DIRTY2(result3.value); - return result3; - } - } - if (effect.type === "refinement") { - const executeRefinement = (acc) => { - const result3 = effect.refinement(acc, checkCtx); - if (ctx.common.async) { - return Promise.resolve(result3); - } - if (result3 instanceof Promise) { - throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); - } - return acc; - }; - if (ctx.common.async === false) { - const inner = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inner.status === "aborted") - return INVALID2; - if (inner.status === "dirty") - status.dirty(); - executeRefinement(inner.value); - return { status: status.value, value: inner.value }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => { - if (inner.status === "aborted") - return INVALID2; - if (inner.status === "dirty") - status.dirty(); - return executeRefinement(inner.value).then(() => { - return { status: status.value, value: inner.value }; - }); - }); - } - } - if (effect.type === "transform") { - if (ctx.common.async === false) { - const base2 = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (!isValid2(base2)) - return INVALID2; - const result3 = effect.transform(base2.value, checkCtx); - if (result3 instanceof Promise) { - throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); - } - return { status: status.value, value: result3 }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base2) => { - if (!isValid2(base2)) - return INVALID2; - return Promise.resolve(effect.transform(base2.value, checkCtx)).then((result3) => ({ - status: status.value, - value: result3 - })); - }); - } - } - util5.assertNever(effect); - } - }; - ZodEffects2.create = (schema, effect, params) => { - return new ZodEffects2({ - schema, - typeName: ZodFirstPartyTypeKind2.ZodEffects, - effect, - ...processCreateParams2(params) - }); - }; - ZodEffects2.createWithPreprocess = (preprocess2, schema, params) => { - return new ZodEffects2({ - schema, - effect: { type: "preprocess", transform: preprocess2 }, - typeName: ZodFirstPartyTypeKind2.ZodEffects, - ...processCreateParams2(params) - }); - }; - ZodOptional3 = class ZodOptional3 extends ZodType3 { - _parse(input2) { - const parsedType4 = this._getType(input2); - if (parsedType4 === ZodParsedType2.undefined) { - return OK2(undefined); - } - return this._def.innerType._parse(input2); - } - unwrap() { - return this._def.innerType; - } - }; - ZodOptional3.create = (type, params) => { - return new ZodOptional3({ - innerType: type, - typeName: ZodFirstPartyTypeKind2.ZodOptional, - ...processCreateParams2(params) - }); - }; - ZodNullable3 = class ZodNullable3 extends ZodType3 { - _parse(input2) { - const parsedType4 = this._getType(input2); - if (parsedType4 === ZodParsedType2.null) { - return OK2(null); - } - return this._def.innerType._parse(input2); - } - unwrap() { - return this._def.innerType; - } - }; - ZodNullable3.create = (type, params) => { - return new ZodNullable3({ - innerType: type, - typeName: ZodFirstPartyTypeKind2.ZodNullable, - ...processCreateParams2(params) - }); - }; - ZodDefault3 = class ZodDefault3 extends ZodType3 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); - let data = ctx.data; - if (ctx.parsedType === ZodParsedType2.undefined) { - data = this._def.defaultValue(); - } - return this._def.innerType._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - removeDefault() { - return this._def.innerType; - } - }; - ZodDefault3.create = (type, params) => { - return new ZodDefault3({ - innerType: type, - typeName: ZodFirstPartyTypeKind2.ZodDefault, - defaultValue: typeof params.default === "function" ? params.default : () => params.default, - ...processCreateParams2(params) - }); - }; - ZodCatch3 = class ZodCatch3 extends ZodType3 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); - const newCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - } - }; - const result3 = this._def.innerType._parse({ - data: newCtx.data, - path: newCtx.path, - parent: { - ...newCtx - } - }); - if (isAsync2(result3)) { - return result3.then((result4) => { - return { - status: "valid", - value: result4.status === "valid" ? result4.value : this._def.catchValue({ - get error() { - return new ZodError4(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - }); - } else { - return { - status: "valid", - value: result3.status === "valid" ? result3.value : this._def.catchValue({ - get error() { - return new ZodError4(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - } - } - removeCatch() { - return this._def.innerType; - } - }; - ZodCatch3.create = (type, params) => { - return new ZodCatch3({ - innerType: type, - typeName: ZodFirstPartyTypeKind2.ZodCatch, - catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, - ...processCreateParams2(params) - }); - }; - ZodNaN3 = class ZodNaN3 extends ZodType3 { - _parse(input2) { - const parsedType4 = this._getType(input2); - if (parsedType4 !== ZodParsedType2.nan) { - const ctx = this._getOrReturnCtx(input2); - addIssueToContext2(ctx, { - code: ZodIssueCode3.invalid_type, - expected: ZodParsedType2.nan, - received: ctx.parsedType - }); - return INVALID2; - } - return { status: "valid", value: input2.data }; - } - }; - ZodNaN3.create = (params) => { - return new ZodNaN3({ - typeName: ZodFirstPartyTypeKind2.ZodNaN, - ...processCreateParams2(params) - }); - }; - BRAND2 = Symbol("zod_brand"); - ZodBranded2 = class ZodBranded2 extends ZodType3 { - _parse(input2) { - const { ctx } = this._processInputParams(input2); - const data = ctx.data; - return this._def.type._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - unwrap() { - return this._def.type; - } - }; - ZodPipeline2 = class ZodPipeline2 extends ZodType3 { - _parse(input2) { - const { status, ctx } = this._processInputParams(input2); - if (ctx.common.async) { - const handleAsync = async () => { - const inResult = await this._def.in._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID2; - if (inResult.status === "dirty") { - status.dirty(); - return DIRTY2(inResult.value); - } else { - return this._def.out._parseAsync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - }; - return handleAsync(); - } else { - const inResult = this._def.in._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID2; - if (inResult.status === "dirty") { - status.dirty(); - return { - status: "dirty", - value: inResult.value - }; - } else { - return this._def.out._parseSync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - } - } - static create(a2, b) { - return new ZodPipeline2({ - in: a2, - out: b, - typeName: ZodFirstPartyTypeKind2.ZodPipeline - }); - } - }; - ZodReadonly3 = class ZodReadonly3 extends ZodType3 { - _parse(input2) { - const result3 = this._def.innerType._parse(input2); - const freeze = (data) => { - if (isValid2(data)) { - data.value = Object.freeze(data.value); - } - return data; - }; - return isAsync2(result3) ? result3.then((data) => freeze(data)) : freeze(result3); - } - unwrap() { - return this._def.innerType; - } - }; - ZodReadonly3.create = (type, params) => { - return new ZodReadonly3({ - innerType: type, - typeName: ZodFirstPartyTypeKind2.ZodReadonly, - ...processCreateParams2(params) - }); - }; - late2 = { - object: ZodObject3.lazycreate - }; - (function(ZodFirstPartyTypeKind3) { - ZodFirstPartyTypeKind3["ZodString"] = "ZodString"; - ZodFirstPartyTypeKind3["ZodNumber"] = "ZodNumber"; - ZodFirstPartyTypeKind3["ZodNaN"] = "ZodNaN"; - ZodFirstPartyTypeKind3["ZodBigInt"] = "ZodBigInt"; - ZodFirstPartyTypeKind3["ZodBoolean"] = "ZodBoolean"; - ZodFirstPartyTypeKind3["ZodDate"] = "ZodDate"; - ZodFirstPartyTypeKind3["ZodSymbol"] = "ZodSymbol"; - ZodFirstPartyTypeKind3["ZodUndefined"] = "ZodUndefined"; - ZodFirstPartyTypeKind3["ZodNull"] = "ZodNull"; - ZodFirstPartyTypeKind3["ZodAny"] = "ZodAny"; - ZodFirstPartyTypeKind3["ZodUnknown"] = "ZodUnknown"; - ZodFirstPartyTypeKind3["ZodNever"] = "ZodNever"; - ZodFirstPartyTypeKind3["ZodVoid"] = "ZodVoid"; - ZodFirstPartyTypeKind3["ZodArray"] = "ZodArray"; - ZodFirstPartyTypeKind3["ZodObject"] = "ZodObject"; - ZodFirstPartyTypeKind3["ZodUnion"] = "ZodUnion"; - ZodFirstPartyTypeKind3["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; - ZodFirstPartyTypeKind3["ZodIntersection"] = "ZodIntersection"; - ZodFirstPartyTypeKind3["ZodTuple"] = "ZodTuple"; - ZodFirstPartyTypeKind3["ZodRecord"] = "ZodRecord"; - ZodFirstPartyTypeKind3["ZodMap"] = "ZodMap"; - ZodFirstPartyTypeKind3["ZodSet"] = "ZodSet"; - ZodFirstPartyTypeKind3["ZodFunction"] = "ZodFunction"; - ZodFirstPartyTypeKind3["ZodLazy"] = "ZodLazy"; - ZodFirstPartyTypeKind3["ZodLiteral"] = "ZodLiteral"; - ZodFirstPartyTypeKind3["ZodEnum"] = "ZodEnum"; - ZodFirstPartyTypeKind3["ZodEffects"] = "ZodEffects"; - ZodFirstPartyTypeKind3["ZodNativeEnum"] = "ZodNativeEnum"; - ZodFirstPartyTypeKind3["ZodOptional"] = "ZodOptional"; - ZodFirstPartyTypeKind3["ZodNullable"] = "ZodNullable"; - ZodFirstPartyTypeKind3["ZodDefault"] = "ZodDefault"; - ZodFirstPartyTypeKind3["ZodCatch"] = "ZodCatch"; - ZodFirstPartyTypeKind3["ZodPromise"] = "ZodPromise"; - ZodFirstPartyTypeKind3["ZodBranded"] = "ZodBranded"; - ZodFirstPartyTypeKind3["ZodPipeline"] = "ZodPipeline"; - ZodFirstPartyTypeKind3["ZodReadonly"] = "ZodReadonly"; - })(ZodFirstPartyTypeKind2 || (ZodFirstPartyTypeKind2 = {})); - stringType2 = ZodString3.create; - numberType2 = ZodNumber3.create; - nanType2 = ZodNaN3.create; - bigIntType2 = ZodBigInt3.create; - booleanType2 = ZodBoolean3.create; - dateType2 = ZodDate3.create; - symbolType2 = ZodSymbol3.create; - undefinedType2 = ZodUndefined3.create; - nullType2 = ZodNull3.create; - anyType2 = ZodAny3.create; - unknownType2 = ZodUnknown3.create; - neverType2 = ZodNever3.create; - voidType2 = ZodVoid3.create; - arrayType2 = ZodArray3.create; - objectType2 = ZodObject3.create; - strictObjectType2 = ZodObject3.strictCreate; - unionType2 = ZodUnion3.create; - discriminatedUnionType2 = ZodDiscriminatedUnion3.create; - intersectionType2 = ZodIntersection3.create; - tupleType2 = ZodTuple3.create; - recordType2 = ZodRecord3.create; - mapType2 = ZodMap3.create; - setType2 = ZodSet3.create; - functionType2 = ZodFunction2.create; - lazyType2 = ZodLazy3.create; - literalType2 = ZodLiteral3.create; - enumType2 = ZodEnum3.create; - nativeEnumType2 = ZodNativeEnum2.create; - promiseType2 = ZodPromise3.create; - effectsType2 = ZodEffects2.create; - optionalType2 = ZodOptional3.create; - nullableType2 = ZodNullable3.create; - preprocessType2 = ZodEffects2.createWithPreprocess; - pipelineType2 = ZodPipeline2.create; - coerce3 = { - string: (arg) => ZodString3.create({ ...arg, coerce: true }), - number: (arg) => ZodNumber3.create({ ...arg, coerce: true }), - boolean: (arg) => ZodBoolean3.create({ - ...arg, - coerce: true - }), - bigint: (arg) => ZodBigInt3.create({ ...arg, coerce: true }), - date: (arg) => ZodDate3.create({ ...arg, coerce: true }) - }; - NEVER3 = INVALID2; -}); - -// ../node_modules/zod/v3/external.js -var exports_external4 = {}; -__export(exports_external4, { - void: () => voidType2, - util: () => util5, - unknown: () => unknownType2, - union: () => unionType2, - undefined: () => undefinedType2, - tuple: () => tupleType2, - transformer: () => effectsType2, - symbol: () => symbolType2, - string: () => stringType2, - strictObject: () => strictObjectType2, - setErrorMap: () => setErrorMap3, - set: () => setType2, - record: () => recordType2, - quotelessJson: () => quotelessJson2, - promise: () => promiseType2, - preprocess: () => preprocessType2, - pipeline: () => pipelineType2, - ostring: () => ostring2, - optional: () => optionalType2, - onumber: () => onumber2, - oboolean: () => oboolean2, - objectUtil: () => objectUtil2, - object: () => objectType2, - number: () => numberType2, - nullable: () => nullableType2, - null: () => nullType2, - never: () => neverType2, - nativeEnum: () => nativeEnumType2, - nan: () => nanType2, - map: () => mapType2, - makeIssue: () => makeIssue2, - literal: () => literalType2, - lazy: () => lazyType2, - late: () => late2, - isValid: () => isValid2, - isDirty: () => isDirty2, - isAsync: () => isAsync2, - isAborted: () => isAborted2, - intersection: () => intersectionType2, - instanceof: () => instanceOfType2, - getParsedType: () => getParsedType3, - getErrorMap: () => getErrorMap3, - function: () => functionType2, - enum: () => enumType2, - effect: () => effectsType2, - discriminatedUnion: () => discriminatedUnionType2, - defaultErrorMap: () => en_default3, - datetimeRegex: () => datetimeRegex2, - date: () => dateType2, - custom: () => custom3, - coerce: () => coerce3, - boolean: () => booleanType2, - bigint: () => bigIntType2, - array: () => arrayType2, - any: () => anyType2, - addIssueToContext: () => addIssueToContext2, - ZodVoid: () => ZodVoid3, - ZodUnknown: () => ZodUnknown3, - ZodUnion: () => ZodUnion3, - ZodUndefined: () => ZodUndefined3, - ZodType: () => ZodType3, - ZodTuple: () => ZodTuple3, - ZodTransformer: () => ZodEffects2, - ZodSymbol: () => ZodSymbol3, - ZodString: () => ZodString3, - ZodSet: () => ZodSet3, - ZodSchema: () => ZodType3, - ZodRecord: () => ZodRecord3, - ZodReadonly: () => ZodReadonly3, - ZodPromise: () => ZodPromise3, - ZodPipeline: () => ZodPipeline2, - ZodParsedType: () => ZodParsedType2, - ZodOptional: () => ZodOptional3, - ZodObject: () => ZodObject3, - ZodNumber: () => ZodNumber3, - ZodNullable: () => ZodNullable3, - ZodNull: () => ZodNull3, - ZodNever: () => ZodNever3, - ZodNativeEnum: () => ZodNativeEnum2, - ZodNaN: () => ZodNaN3, - ZodMap: () => ZodMap3, - ZodLiteral: () => ZodLiteral3, - ZodLazy: () => ZodLazy3, - ZodIssueCode: () => ZodIssueCode3, - ZodIntersection: () => ZodIntersection3, - ZodFunction: () => ZodFunction2, - ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind2, - ZodError: () => ZodError4, - ZodEnum: () => ZodEnum3, - ZodEffects: () => ZodEffects2, - ZodDiscriminatedUnion: () => ZodDiscriminatedUnion3, - ZodDefault: () => ZodDefault3, - ZodDate: () => ZodDate3, - ZodCatch: () => ZodCatch3, - ZodBranded: () => ZodBranded2, - ZodBoolean: () => ZodBoolean3, - ZodBigInt: () => ZodBigInt3, - ZodArray: () => ZodArray3, - ZodAny: () => ZodAny3, - Schema: () => ZodType3, - ParseStatus: () => ParseStatus2, - OK: () => OK2, - NEVER: () => NEVER3, - INVALID: () => INVALID2, - EMPTY_PATH: () => EMPTY_PATH2, - DIRTY: () => DIRTY2, - BRAND: () => BRAND2 -}); -var init_external4 = __esm(() => { - init_errors6(); - init_parseUtil2(); - init_typeAliases2(); - init_util6(); - init_types6(); - init_ZodError2(); -}); - -// ../node_modules/zod/index.js -var init_zod = __esm(() => { - init_external4(); - init_external4(); -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.js -var domainPatternSchema, filesystemPathSchema, MitmProxyConfigSchema, NetworkConfigSchema, FilesystemConfigSchema, IgnoreViolationsConfigSchema, RipgrepConfigSchema, SeccompConfigSchema, SandboxRuntimeConfigSchema; -var init_sandbox_config = __esm(() => { - init_zod(); - domainPatternSchema = exports_external4.string().refine((val) => { - if (val.includes("://") || val.includes("/") || val.includes(":")) { - return false; - } - if (val === "localhost") - return true; - if (val.startsWith("*.")) { - const domain2 = val.slice(2); - if (!domain2.includes(".") || domain2.startsWith(".") || domain2.endsWith(".")) { - return false; - } - const parts = domain2.split("."); - return parts.length >= 2 && parts.every((p) => p.length > 0); - } - if (val.includes("*")) { - return false; - } - return val.includes(".") && !val.startsWith(".") && !val.endsWith("."); - }, { - message: 'Invalid domain pattern. Must be a valid domain (e.g., "example.com") or wildcard (e.g., "*.example.com"). Overly broad patterns like "*.com" or "*" are not allowed for security reasons.' - }); - filesystemPathSchema = exports_external4.string().min(1, "Path cannot be empty"); - MitmProxyConfigSchema = exports_external4.object({ - socketPath: exports_external4.string().min(1).describe("Unix socket path to the MITM proxy"), - domains: exports_external4.array(domainPatternSchema).min(1).describe('Domains to route through the MITM proxy (e.g., ["api.example.com", "*.internal.org"])') - }); - NetworkConfigSchema = exports_external4.object({ - allowedDomains: exports_external4.array(domainPatternSchema).describe('List of allowed domains (e.g., ["github.com", "*.npmjs.org"])'), - deniedDomains: exports_external4.array(domainPatternSchema).describe("List of denied domains"), - allowUnixSockets: exports_external4.array(exports_external4.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."), - allowAllUnixSockets: exports_external4.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."), - allowLocalBinding: exports_external4.boolean().optional().describe("Whether to allow binding to local ports (default: false)"), - httpProxyPort: exports_external4.number().int().min(1).max(65535).optional().describe("Port of an external HTTP proxy to use instead of starting a local one. When provided, the library will skip starting its own HTTP proxy and use this port. The external proxy must handle domain filtering."), - socksProxyPort: exports_external4.number().int().min(1).max(65535).optional().describe("Port of an external SOCKS proxy to use instead of starting a local one. When provided, the library will skip starting its own SOCKS proxy and use this port. The external proxy must handle domain filtering."), - mitmProxy: MitmProxyConfigSchema.optional().describe("Optional MITM proxy configuration. Routes matching domains through an upstream proxy via Unix socket while SRT still handles allow/deny filtering.") - }); - FilesystemConfigSchema = exports_external4.object({ - denyRead: exports_external4.array(filesystemPathSchema).describe("Paths denied for reading"), - allowRead: exports_external4.array(filesystemPathSchema).optional().describe("Paths to re-allow reading within denied regions (takes precedence over denyRead). " + "Use with denyRead to deny a broad region then allow back specific subdirectories."), - allowWrite: exports_external4.array(filesystemPathSchema).describe("Paths allowed for writing"), - denyWrite: exports_external4.array(filesystemPathSchema).describe("Paths denied for writing (takes precedence over allowWrite)"), - allowGitConfig: exports_external4.boolean().optional().describe("Allow writes to .git/config files (default: false). Enables git remote URL updates while keeping .git/hooks protected.") - }); - IgnoreViolationsConfigSchema = exports_external4.record(exports_external4.string(), exports_external4.array(exports_external4.string())).describe('Map of command patterns to filesystem paths to ignore violations for. Use "*" to match all commands'); - RipgrepConfigSchema = exports_external4.object({ - command: exports_external4.string().describe("The ripgrep command to execute"), - args: exports_external4.array(exports_external4.string()).optional().describe("Additional arguments to pass before ripgrep args"), - argv0: exports_external4.string().optional().describe("Override argv[0] when spawning (for multicall binaries that dispatch on argv[0])") - }); - SeccompConfigSchema = exports_external4.object({ - bpfPath: exports_external4.string().optional().describe("Path to the unix-block.bpf filter file"), - applyPath: exports_external4.string().optional().describe("Path to the apply-seccomp binary") - }); - SandboxRuntimeConfigSchema = exports_external4.object({ - network: NetworkConfigSchema.describe("Network restrictions configuration"), - filesystem: FilesystemConfigSchema.describe("Filesystem restrictions configuration"), - ignoreViolations: IgnoreViolationsConfigSchema.optional().describe("Optional configuration for ignoring specific violations"), - enableWeakerNestedSandbox: exports_external4.boolean().optional().describe("Enable weaker nested sandbox mode (for Docker environments)"), - enableWeakerNetworkIsolation: exports_external4.boolean().optional().describe("Enable weaker network isolation to allow access to com.apple.trustd.agent (macOS only). " + "This is needed for Go programs (gh, gcloud, terraform, kubectl, etc.) to verify TLS certificates " + "when using httpProxyPort with a MITM proxy and custom CA. Enabling this opens a potential data " + "exfiltration vector through the trustd service. Only enable if you need Go TLS verification."), - ripgrep: RipgrepConfigSchema.optional().describe('Custom ripgrep configuration (default: { command: "rg" })'), - mandatoryDenySearchDepth: exports_external4.number().int().min(1).max(10).optional().describe("Maximum directory depth to search for dangerous files on Linux (default: 3). " + "Higher values provide more protection but slower performance."), - allowPty: exports_external4.boolean().optional().describe("Allow pseudo-terminal (pty) operations (macOS only)"), - seccomp: SeccompConfigSchema.optional().describe("Custom seccomp binary paths (Linux only).") - }); -}); - -// ../node_modules/@anthropic-ai/sandbox-runtime/dist/index.js -var init_dist6 = __esm(() => { - init_sandbox_manager(); - init_sandbox_violation_store(); - init_sandbox_config(); - init_sandbox_utils(); - init_platform3(); +// stub-npm:@anthropic-ai/sandbox-runtime +var handler8, stub8, SandboxManager, SandboxRuntimeConfigSchema, SandboxViolationStore; +var init_sandbox_runtime = __esm(() => { + handler8 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub8 = new Proxy({}, handler8); + SandboxManager = new Proxy(function() {}, { get: (t, p) => typeof p === "string" ? () => {} : t[p], apply: () => ({}) }); + SandboxRuntimeConfigSchema = new Proxy(function() {}, { get: (t, p) => typeof p === "string" ? () => {} : t[p], apply: () => ({}) }); + SandboxViolationStore = new Proxy(function() {}, { get: (t, p) => typeof p === "string" ? () => {} : t[p], apply: () => ({}) }); }); // src/tools/WebFetchTool/prompt.ts @@ -279706,16 +206357,16 @@ __export(exports_sandbox_adapter, { SandboxRuntimeConfigSchema: () => SandboxRuntimeConfigSchema, SandboxManager: () => SandboxManager2 }); -import { rmSync as rmSync3, statSync as statSync6 } from "fs"; +import { rmSync as rmSync2, statSync as statSync5 } from "fs"; import { readFile as readFile10 } from "fs/promises"; -import { join as join40, resolve as resolve17, sep as sep9 } from "path"; +import { join as join36, resolve as resolve15, sep as sep9 } from "path"; function permissionRuleValueFromString2(ruleString) { - const matches3 = ruleString.match(/^([^(]+)\(([^)]+)\)$/); - if (!matches3) { + const matches2 = ruleString.match(/^([^(]+)\(([^)]+)\)$/); + if (!matches2) { return { toolName: ruleString }; } - const toolName = matches3[1]; - const ruleContent = matches3[2]; + const toolName = matches2[1]; + const ruleContent = matches2[2]; if (!toolName || !ruleContent) { return { toolName: ruleString }; } @@ -279730,8 +206381,8 @@ function resolvePathPatternForSandbox(pattern, source) { return pattern.slice(1); } if (pattern.startsWith("/") && !pattern.startsWith("//")) { - const root3 = getSettingsRootPathForSource(source); - return resolve17(root3, pattern.slice(1)); + const root2 = getSettingsRootPathForSource(source); + return resolve15(root2, pattern.slice(1)); } return pattern; } @@ -279788,20 +206439,20 @@ function convertToSandboxRuntimeConfig(settings) { const cwd2 = getCwdState(); const originalCwd = getOriginalCwd(); if (cwd2 !== originalCwd) { - denyWrite.push(resolve17(cwd2, ".claude", "settings.json")); - denyWrite.push(resolve17(cwd2, ".claude", "settings.local.json")); + denyWrite.push(resolve15(cwd2, ".claude", "settings.json")); + denyWrite.push(resolve15(cwd2, ".claude", "settings.local.json")); } - denyWrite.push(resolve17(originalCwd, ".claude", "skills")); + denyWrite.push(resolve15(originalCwd, ".claude", "skills")); if (cwd2 !== originalCwd) { - denyWrite.push(resolve17(cwd2, ".claude", "skills")); + denyWrite.push(resolve15(cwd2, ".claude", "skills")); } bareGitRepoScrubPaths.length = 0; const bareGitRepoFiles = ["HEAD", "objects", "refs", "hooks", "config"]; for (const dir of cwd2 === originalCwd ? [originalCwd] : [originalCwd, cwd2]) { for (const gitFile of bareGitRepoFiles) { - const p = resolve17(dir, gitFile); + const p = resolve15(dir, gitFile); try { - statSync6(p); + statSync5(p); denyWrite.push(p); } catch { bareGitRepoScrubPaths.push(p); @@ -279835,19 +206486,19 @@ function convertToSandboxRuntimeConfig(settings) { } } } - const fs7 = sourceSettings?.sandbox?.filesystem; - if (fs7) { - for (const p of fs7.allowWrite || []) { + const fs2 = sourceSettings?.sandbox?.filesystem; + if (fs2) { + for (const p of fs2.allowWrite || []) { allowWrite.push(resolveSandboxFilesystemPath(p, source)); } - for (const p of fs7.denyWrite || []) { + for (const p of fs2.denyWrite || []) { denyWrite.push(resolveSandboxFilesystemPath(p, source)); } - for (const p of fs7.denyRead || []) { + for (const p of fs2.denyRead || []) { denyRead.push(resolveSandboxFilesystemPath(p, source)); } if (!shouldAllowManagedReadPathsOnly() || source === "policySettings") { - for (const p of fs7.allowRead || []) { + for (const p of fs2.allowRead || []) { allowRead.push(resolveSandboxFilesystemPath(p, source)); } } @@ -279884,20 +206535,20 @@ function convertToSandboxRuntimeConfig(settings) { function scrubBareGitRepoFiles() { for (const p of bareGitRepoScrubPaths) { try { - rmSync3(p, { recursive: true }); + rmSync2(p, { recursive: true }); logForDebugging(`[Sandbox] scrubbed planted bare-repo file: ${p}`); } catch {} } } async function detectWorktreeMainRepoPath(cwd2) { - const gitPath = join40(cwd2, ".git"); + const gitPath = join36(cwd2, ".git"); try { const gitContent = await readFile10(gitPath, { encoding: "utf8" }); const gitdirMatch = gitContent.match(/^gitdir:\s*(.+)$/m); if (!gitdirMatch?.[1]) { return null; } - const gitdir = resolve17(cwd2, gitdirMatch[1].trim()); + const gitdir = resolve15(cwd2, gitdirMatch[1].trim()); const marker = `${sep9}.git${sep9}worktrees${sep9}`; const markerIndex = gitdir.lastIndexOf(marker); if (markerIndex > 0) { @@ -279912,8 +206563,8 @@ function getSandboxEnabledSetting() { try { const settings = getSettings_DEPRECATED(); return settings?.sandbox?.enabled ?? false; - } catch (error45) { - logForDebugging(`Failed to get settings for sandbox check: ${error45}`); + } catch (error41) { + logForDebugging(`Failed to get settings for sandbox check: ${error41}`); return false; } } @@ -279941,16 +206592,16 @@ function isPlatformInEnabledList() { } const currentPlatform = getPlatform(); return enabledPlatforms.includes(currentPlatform); - } catch (error45) { - logForDebugging(`Failed to check enabledPlatforms: ${error45}`); + } catch (error41) { + logForDebugging(`Failed to check enabledPlatforms: ${error41}`); return true; } } -function isSandboxingEnabled2() { - if (!isSupportedPlatform2()) { +function isSandboxingEnabled() { + if (!isSupportedPlatform()) { return false; } - if (checkDependencies2().errors.length > 0) { + if (checkDependencies().errors.length > 0) { return false; } if (!isPlatformInEnabledList()) { @@ -279962,7 +206613,7 @@ function getSandboxUnavailableReason() { if (!getSandboxEnabledSetting()) { return; } - if (!isSupportedPlatform2()) { + if (!isSupportedPlatform()) { const platform2 = getPlatform(); if (platform2 === "wsl") { return "sandbox.enabled is set but WSL1 is not supported (requires WSL2)"; @@ -279972,7 +206623,7 @@ function getSandboxUnavailableReason() { if (!isPlatformInEnabledList()) { return `sandbox.enabled is set but ${getPlatform()} is not in sandbox.enabledPlatforms`; } - const deps = checkDependencies2(); + const deps = checkDependencies(); if (deps.errors.length > 0) { const platform2 = getPlatform(); const hint = platform2 === "macos" ? "run /sandbox or /doctor for details" : "install missing tools (e.g. apt install bubblewrap socat) or run /sandbox for details"; @@ -279980,7 +206631,7 @@ function getSandboxUnavailableReason() { } return; } -function getLinuxGlobPatternWarnings2() { +function getLinuxGlobPatternWarnings() { const platform2 = getPlatform(); if (platform2 !== "linux" && platform2 !== "wsl") { return []; @@ -279992,8 +206643,8 @@ function getLinuxGlobPatternWarnings2() { } const permissions = settings?.permissions || {}; const warnings = []; - const hasGlobs = (path16) => { - const stripped = path16.replace(/\/\*\*$/, ""); + const hasGlobs = (path11) => { + const stripped = path11.replace(/\/\*\*$/, ""); return /[*?[\]]/.test(stripped); }; for (const ruleString of [ @@ -280006,8 +206657,8 @@ function getLinuxGlobPatternWarnings2() { } } return warnings; - } catch (error45) { - logForDebugging(`Failed to get Linux glob pattern warnings: ${error45}`); + } catch (error41) { + logForDebugging(`Failed to get Linux glob pattern warnings: ${error41}`); return []; } } @@ -280040,21 +206691,21 @@ function getExcludedCommands() { const settings = getSettings_DEPRECATED(); return settings?.sandbox?.excludedCommands ?? []; } -async function wrapWithSandbox2(command, binShell, customConfig, abortSignal) { - if (isSandboxingEnabled2()) { - if (initializationPromise2) { - await initializationPromise2; +async function wrapWithSandbox(command, binShell, customConfig, abortSignal) { + if (isSandboxingEnabled()) { + if (initializationPromise) { + await initializationPromise; } else { throw new Error("Sandbox failed to initialize. "); } } return SandboxManager.wrapWithSandbox(command, binShell, customConfig, abortSignal); } -async function initialize3(sandboxAskCallback) { - if (initializationPromise2) { - return initializationPromise2; +async function initialize2(sandboxAskCallback) { + if (initializationPromise) { + return initializationPromise; } - if (!isSandboxingEnabled2()) { + if (!isSandboxingEnabled()) { return; } const wrappedCallback = sandboxAskCallback ? async (hostPattern) => { @@ -280064,7 +206715,7 @@ async function initialize3(sandboxAskCallback) { } return sandboxAskCallback(hostPattern); } : undefined; - initializationPromise2 = (async () => { + initializationPromise = (async () => { try { if (worktreeMainRepoPath === undefined) { worktreeMainRepoPath = await detectWorktreeMainRepoPath(getCwdState()); @@ -280078,28 +206729,28 @@ async function initialize3(sandboxAskCallback) { SandboxManager.updateConfig(newConfig); logForDebugging("Sandbox configuration updated from settings change"); }); - } catch (error45) { - initializationPromise2 = undefined; - logForDebugging(`Failed to initialize sandbox: ${errorMessage(error45)}`); + } catch (error41) { + initializationPromise = undefined; + logForDebugging(`Failed to initialize sandbox: ${errorMessage(error41)}`); } })(); - return initializationPromise2; + return initializationPromise; } function refreshConfig() { - if (!isSandboxingEnabled2()) + if (!isSandboxingEnabled()) return; const settings = getSettings_DEPRECATED(); const newConfig = convertToSandboxRuntimeConfig(settings); SandboxManager.updateConfig(newConfig); } -async function reset3() { +async function reset2() { settingsSubscriptionCleanup?.(); settingsSubscriptionCleanup = undefined; worktreeMainRepoPath = undefined; bareGitRepoScrubPaths.length = 0; - checkDependencies2.cache.clear?.(); - isSupportedPlatform2.cache.clear?.(); - initializationPromise2 = undefined; + checkDependencies.cache.clear?.(); + isSupportedPlatform.cache.clear?.(); + initializationPromise = undefined; return SandboxManager.reset(); } function addToExcludedCommands(command, permissionUpdates) { @@ -280107,7 +206758,7 @@ function addToExcludedCommands(command, permissionUpdates) { const existingExcludedCommands = existingSettings?.sandbox?.excludedCommands || []; let commandPattern = command; if (permissionUpdates) { - const bashSuggestions = permissionUpdates.filter((update3) => update3.type === "addRules" && update3.rules.some((rule) => rule.toolName === BASH_TOOL_NAME)); + const bashSuggestions = permissionUpdates.filter((update2) => update2.type === "addRules" && update2.rules.some((rule) => rule.toolName === BASH_TOOL_NAME)); if (bashSuggestions.length > 0 && bashSuggestions[0].type === "addRules") { const firstBashRule = bashSuggestions[0].rules.find((rule) => rule.toolName === BASH_TOOL_NAME); if (firstBashRule?.ruleContent) { @@ -280126,9 +206777,9 @@ function addToExcludedCommands(command, permissionUpdates) { } return commandPattern; } -var initializationPromise2, settingsSubscriptionCleanup, worktreeMainRepoPath, bareGitRepoScrubPaths, checkDependencies2, isSupportedPlatform2, SandboxManager2; +var initializationPromise, settingsSubscriptionCleanup, worktreeMainRepoPath, bareGitRepoScrubPaths, checkDependencies, isSupportedPlatform, SandboxManager2; var init_sandbox_adapter = __esm(() => { - init_dist6(); + init_sandbox_runtime(); init_lodash(); init_state(); init_debug(); @@ -280143,19 +206794,19 @@ var init_sandbox_adapter = __esm(() => { init_filesystem(); init_ripgrep(); bareGitRepoScrubPaths = []; - checkDependencies2 = memoize_default(() => { + checkDependencies = memoize_default(() => { const { rgPath, rgArgs } = ripgrepCommand(); return SandboxManager.checkDependencies({ command: rgPath, args: rgArgs }); }); - isSupportedPlatform2 = memoize_default(() => { + isSupportedPlatform = memoize_default(() => { return SandboxManager.isSupportedPlatform(); }); SandboxManager2 = { - initialize: initialize3, - isSandboxingEnabled: isSandboxingEnabled2, + initialize: initialize2, + isSandboxingEnabled, isSandboxEnabledInSettings: getSandboxEnabledSetting, isPlatformInEnabledList, getSandboxUnavailableReason, @@ -280165,16 +206816,16 @@ var init_sandbox_adapter = __esm(() => { areSandboxSettingsLockedByPolicy, setSandboxSettings, getExcludedCommands, - wrapWithSandbox: wrapWithSandbox2, + wrapWithSandbox, refreshConfig, - reset: reset3, - checkDependencies: checkDependencies2, + reset: reset2, + checkDependencies, getFsReadConfig: SandboxManager.getFsReadConfig, getFsWriteConfig: SandboxManager.getFsWriteConfig, getNetworkRestrictionConfig: SandboxManager.getNetworkRestrictionConfig, getIgnoreViolations: SandboxManager.getIgnoreViolations, - getLinuxGlobPatternWarnings: getLinuxGlobPatternWarnings2, - isSupportedPlatform: isSupportedPlatform2, + getLinuxGlobPatternWarnings, + isSupportedPlatform, getAllowUnixSockets: SandboxManager.getAllowUnixSockets, getAllowLocalBinding: SandboxManager.getAllowLocalBinding, getEnableWeakerNestedSandbox: SandboxManager.getEnableWeakerNestedSandbox, @@ -280274,7 +206925,7 @@ function validateFlagArgument(value, argType) { return false; } } -function validateFlags(tokens, startIndex, config3, options2) { +function validateFlags(tokens, startIndex, config2, options2) { let i2 = startIndex; while (i2 < tokens.length) { let token = tokens[i2]; @@ -280293,7 +206944,7 @@ function validateFlags(tokens, startIndex, config3, options2) { return false; } if (token === "--") { - if (config3.respectsDoubleDash !== false) { + if (config2.respectsDoubleDash !== false) { i2++; break; } @@ -280307,7 +206958,7 @@ function validateFlags(tokens, startIndex, config3, options2) { if (!flag) { return false; } - const flagArgType = config3.safeFlags[flag]; + const flagArgType = config2.safeFlags[flag]; if (!flagArgType) { if (options2?.commandName === "git" && flag.match(/^-\d+$/)) { i2++; @@ -280316,8 +206967,8 @@ function validateFlags(tokens, startIndex, config3, options2) { if ((options2?.commandName === "grep" || options2?.commandName === "rg") && flag.startsWith("-") && !flag.startsWith("--") && flag.length > 2) { const potentialFlag = flag.substring(0, 2); const potentialValue = flag.substring(2); - if (config3.safeFlags[potentialFlag] && /^\d+$/.test(potentialValue)) { - const flagArgType2 = config3.safeFlags[potentialFlag]; + if (config2.safeFlags[potentialFlag] && /^\d+$/.test(potentialValue)) { + const flagArgType2 = config2.safeFlags[potentialFlag]; if (flagArgType2 === "number" || flagArgType2 === "string") { if (validateFlagArgument(potentialValue, flagArgType2)) { i2++; @@ -280331,7 +206982,7 @@ function validateFlags(tokens, startIndex, config3, options2) { if (flag.startsWith("-") && !flag.startsWith("--") && flag.length > 2) { for (let j = 1;j < flag.length; j++) { const singleFlag = "-" + flag[j]; - const flagType = config3.safeFlags[singleFlag]; + const flagType = config2.safeFlags[singleFlag]; if (!flagType) { return false; } @@ -281545,8 +208196,8 @@ var init_readOnlyCommandValidation = __esm(() => { }); // src/utils/permissions/pathValidation.ts -import { homedir as homedir14 } from "os"; -import { dirname as dirname23, isAbsolute as isAbsolute8, resolve as resolve18 } from "path"; +import { homedir as homedir12 } from "os"; +import { dirname as dirname20, isAbsolute as isAbsolute7, resolve as resolve16 } from "path"; function formatDirectoryList(directories) { const dirCount = directories.length; if (dirCount <= MAX_DIRS_TO_LIST) { @@ -281555,22 +208206,22 @@ function formatDirectoryList(directories) { const firstDirs = directories.slice(0, MAX_DIRS_TO_LIST).map((dir) => `'${dir}'`).join(", "); return `${firstDirs}, and ${dirCount - MAX_DIRS_TO_LIST} more`; } -function getGlobBaseDirectory(path16) { - const globMatch = path16.match(GLOB_PATTERN_REGEX); +function getGlobBaseDirectory(path11) { + const globMatch = path11.match(GLOB_PATTERN_REGEX); if (!globMatch || globMatch.index === undefined) { - return path16; + return path11; } - const beforeGlob = path16.substring(0, globMatch.index); + const beforeGlob = path11.substring(0, globMatch.index); const lastSepIndex = getPlatform() === "windows" ? Math.max(beforeGlob.lastIndexOf("/"), beforeGlob.lastIndexOf("\\")) : beforeGlob.lastIndexOf("/"); if (lastSepIndex === -1) return "."; return beforeGlob.substring(0, lastSepIndex) || "/"; } -function expandTilde(path16) { - if (path16 === "~" || path16.startsWith("~/") || process.platform === "win32" && path16.startsWith("~\\")) { - return homedir14() + path16.slice(1); +function expandTilde(path11) { + if (path11 === "~" || path11.startsWith("~/") || process.platform === "win32" && path11.startsWith("~\\")) { + return homedir12() + path11.slice(1); } - return path16; + return path11; } function isPathInSandboxWriteAllowlist(resolvedPath) { if (!SandboxManager2.isSandboxingEnabled()) { @@ -281654,23 +208305,23 @@ function isPathAllowed(resolvedPath, context, operationType, precomputedPathsToC } function validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationType) { if (containsPathTraversal(cleanPath)) { - const absolutePath = isAbsolute8(cleanPath) ? cleanPath : resolve18(cwd2, cleanPath); + const absolutePath = isAbsolute7(cleanPath) ? cleanPath : resolve16(cwd2, cleanPath); const { resolvedPath: resolvedPath2, isCanonical: isCanonical2 } = safeResolvePath(getFsImplementation(), absolutePath); - const result4 = isPathAllowed(resolvedPath2, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath2] : undefined); + const result3 = isPathAllowed(resolvedPath2, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath2] : undefined); return { - allowed: result4.allowed, + allowed: result3.allowed, resolvedPath: resolvedPath2, - decisionReason: result4.decisionReason + decisionReason: result3.decisionReason }; } const basePath = getGlobBaseDirectory(cleanPath); - const absoluteBasePath = isAbsolute8(basePath) ? basePath : resolve18(cwd2, basePath); + const absoluteBasePath = isAbsolute7(basePath) ? basePath : resolve16(cwd2, basePath); const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absoluteBasePath); - const result3 = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined); + const result2 = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined); return { - allowed: result3.allowed, + allowed: result2.allowed, resolvedPath, - decisionReason: result3.decisionReason + decisionReason: result2.decisionReason }; } function isDangerousRemovalPath(resolvedPath) { @@ -281685,11 +208336,11 @@ function isDangerousRemovalPath(resolvedPath) { if (WINDOWS_DRIVE_ROOT_REGEX.test(normalizedPath)) { return true; } - const normalizedHome = homedir14().replace(/[\\/]+/g, "/"); + const normalizedHome = homedir12().replace(/[\\/]+/g, "/"); if (normalizedPath === normalizedHome) { return true; } - const parentDir = dirname23(normalizedPath); + const parentDir = dirname20(normalizedPath); if (parentDir === "/") { return true; } @@ -281698,8 +208349,8 @@ function isDangerousRemovalPath(resolvedPath) { } return false; } -function validatePath(path16, cwd2, toolPermissionContext, operationType) { - const cleanPath = expandTilde(path16.replace(/^['"]|['"]$/g, "")); +function validatePath(path11, cwd2, toolPermissionContext, operationType) { + const cleanPath = expandTilde(path11.replace(/^['"]|['"]$/g, "")); if (containsVulnerableUncPath(cleanPath)) { return { allowed: false, @@ -281743,13 +208394,13 @@ function validatePath(path16, cwd2, toolPermissionContext, operationType) { } return validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationType); } - const absolutePath = isAbsolute8(cleanPath) ? cleanPath : resolve18(cwd2, cleanPath); + const absolutePath = isAbsolute7(cleanPath) ? cleanPath : resolve16(cwd2, cleanPath); const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absolutePath); - const result3 = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined); + const result2 = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined); return { - allowed: result3.allowed, + allowed: result2.allowed, resolvedPath, - decisionReason: result3.decisionReason + decisionReason: result2.decisionReason }; } var MAX_DIRS_TO_LIST = 5, GLOB_PATTERN_REGEX, getResolvedSandboxConfigPath, WINDOWS_DRIVE_ROOT_REGEX, WINDOWS_DRIVE_CHILD_REGEX; @@ -281770,7 +208421,7 @@ var init_pathValidation = __esm(() => { // src/utils/plugins/pluginDirectories.ts import { mkdirSync as mkdirSync3 } from "fs"; import { readdir as readdir9, rm, stat as stat16 } from "fs/promises"; -import { delimiter, join as join41 } from "path"; +import { delimiter, join as join37 } from "path"; function getPluginsDirectoryName() { if (getUseCoworkPlugins()) { return COWORK_PLUGINS_DIR; @@ -281785,7 +208436,7 @@ function getPluginsDirectory() { if (envOverride) { return expandTilde(envOverride); } - return join41(getClaudeConfigHomeDir(), getPluginsDirectoryName()); + return join37(getClaudeConfigHomeDir(), getPluginsDirectoryName()); } function getPluginSeedDirs() { const raw = process.env.CLAUDE_CODE_PLUGIN_SEED_DIR; @@ -281797,7 +208448,7 @@ function sanitizePluginId(pluginId) { return pluginId.replace(/[^a-zA-Z0-9\-_]/g, "-"); } function pluginDataDirPath(pluginId) { - return join41(getPluginsDirectory(), "data", sanitizePluginId(pluginId)); + return join37(getPluginsDirectory(), "data", sanitizePluginId(pluginId)); } function getPluginDataDir(pluginId) { const dir = pluginDataDirPath(pluginId); @@ -281809,7 +208460,7 @@ async function getPluginDataDirSize(pluginId) { let bytes = 0; const walk = async (p) => { for (const entry of await readdir9(p, { withFileTypes: true })) { - const full = join41(p, entry.name); + const full = join37(p, entry.name); if (entry.isDirectory()) { await walk(full); } else { @@ -281855,13 +208506,13 @@ function isUltrathinkEnabled() { } return getFeatureValue_CACHED_MAY_BE_STALE("tengu_turtle_carbon", true); } -function hasUltrathinkKeyword(text2) { - return /\bultrathink\b/i.test(text2); +function hasUltrathinkKeyword(text) { + return /\bultrathink\b/i.test(text); } -function findThinkingTriggerPositions(text2) { +function findThinkingTriggerPositions(text) { const positions = []; - const matches3 = text2.matchAll(/\bultrathink\b/gi); - for (const match of matches3) { + const matches2 = text.matchAll(/\bultrathink\b/gi); + for (const match of matches2) { if (match.index !== undefined) { positions.push({ word: match[0], @@ -282080,18 +208731,18 @@ function getEffortValueDescription(value) { return "Balanced approach with standard implementation and testing"; } function getOpusDefaultEffortConfig() { - const config3 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_grey_step2", OPUS_DEFAULT_EFFORT_CONFIG_DEFAULT); + const config2 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_grey_step2", OPUS_DEFAULT_EFFORT_CONFIG_DEFAULT); return { ...OPUS_DEFAULT_EFFORT_CONFIG_DEFAULT, - ...config3 + ...config2 }; } function getDefaultEffortForModel(model) { if (process.env.USER_TYPE === "ant") { - const config3 = getAntModelOverrideConfig(); - const isDefaultModel = config3?.defaultModel !== undefined && model.toLowerCase() === config3.defaultModel.toLowerCase(); - if (isDefaultModel && config3?.defaultModelEffortLevel) { - return config3.defaultModelEffortLevel; + const config2 = getAntModelOverrideConfig(); + const isDefaultModel = config2?.defaultModel !== undefined && model.toLowerCase() === config2.defaultModel.toLowerCase(); + if (isDefaultModel && config2?.defaultModelEffortLevel) { + return config2.defaultModelEffortLevel; } const antModel = resolveAntModel(model); if (antModel) { @@ -282121,7 +208772,7 @@ var EFFORT_LEVELS, OPUS_DEFAULT_EFFORT_CONFIG_DEFAULT; var init_effort = __esm(() => { init_thinking(); init_settings2(); - init_auth2(); + init_auth(); init_growthbook(); init_providers(); init_modelSupportOverrides(); @@ -282139,779 +208790,234 @@ var init_effort = __esm(() => { }; }); -// stub-npm:@inquirer/prompts -var handler2, stub2, confirm2 = () => {}, input2 = () => {}, select2 = () => {}; -var init_prompts = __esm(() => { - handler2 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub2 = new Proxy({}, handler2); +// stub-npm:@anthropic-ai/mcpb +var exports_mcpb = {}; +__export(exports_mcpb, { + default: () => mcpb_default, + __stub__: () => __stub__8 +}); +var handler9, stub9, mcpb_default, __stub__8 = true; +var init_mcpb = __esm(() => { + handler9 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub9 = new Proxy({}, handler9); + mcpb_default = stub9; }); -// ../node_modules/@anthropic-ai/mcpb/dist/schemas.js -var CURRENT_MANIFEST_VERSION = "0.2", McpServerConfigSchema2, McpbManifestAuthorSchema, McpbManifestRepositorySchema, McpbManifestPlatformOverrideSchema, McpbManifestMcpConfigSchema, McpbManifestServerSchema, McpbManifestCompatibilitySchema, McpbManifestToolSchema, McpbManifestPromptSchema, McpbUserConfigurationOptionSchema, McpbUserConfigValuesSchema, McpbManifestSchema, McpbSignatureInfoSchema; -var init_schemas5 = __esm(() => { - init_zod(); - McpServerConfigSchema2 = strictObjectType2({ - command: stringType2(), - args: arrayType2(stringType2()).optional(), - env: recordType2(stringType2(), stringType2()).optional() - }); - McpbManifestAuthorSchema = strictObjectType2({ - name: stringType2(), - email: stringType2().email().optional(), - url: stringType2().url().optional() - }); - McpbManifestRepositorySchema = strictObjectType2({ - type: stringType2(), - url: stringType2().url() - }); - McpbManifestPlatformOverrideSchema = McpServerConfigSchema2.partial(); - McpbManifestMcpConfigSchema = McpServerConfigSchema2.extend({ - platform_overrides: recordType2(stringType2(), McpbManifestPlatformOverrideSchema).optional() - }); - McpbManifestServerSchema = strictObjectType2({ - type: enumType2(["python", "node", "binary"]), - entry_point: stringType2(), - mcp_config: McpbManifestMcpConfigSchema - }); - McpbManifestCompatibilitySchema = strictObjectType2({ - claude_desktop: stringType2().optional(), - platforms: arrayType2(enumType2(["darwin", "win32", "linux"])).optional(), - runtimes: strictObjectType2({ - python: stringType2().optional(), - node: stringType2().optional() - }).optional() - }).passthrough(); - McpbManifestToolSchema = strictObjectType2({ - name: stringType2(), - description: stringType2().optional() - }); - McpbManifestPromptSchema = strictObjectType2({ - name: stringType2(), - description: stringType2().optional(), - arguments: arrayType2(stringType2()).optional(), - text: stringType2() - }); - McpbUserConfigurationOptionSchema = strictObjectType2({ - type: enumType2(["string", "number", "boolean", "directory", "file"]), - title: stringType2(), - description: stringType2(), - required: booleanType2().optional(), - default: unionType2([stringType2(), numberType2(), booleanType2(), arrayType2(stringType2())]).optional(), - multiple: booleanType2().optional(), - sensitive: booleanType2().optional(), - min: numberType2().optional(), - max: numberType2().optional() - }); - McpbUserConfigValuesSchema = recordType2(stringType2(), unionType2([stringType2(), numberType2(), booleanType2(), arrayType2(stringType2())])); - McpbManifestSchema = strictObjectType2({ - $schema: stringType2().optional(), - dxt_version: stringType2().optional().describe("@deprecated Use manifest_version instead"), - manifest_version: stringType2().optional(), - name: stringType2(), - display_name: stringType2().optional(), - version: stringType2(), - description: stringType2(), - long_description: stringType2().optional(), - author: McpbManifestAuthorSchema, - repository: McpbManifestRepositorySchema.optional(), - homepage: stringType2().url().optional(), - documentation: stringType2().url().optional(), - support: stringType2().url().optional(), - icon: stringType2().optional(), - screenshots: arrayType2(stringType2()).optional(), - server: McpbManifestServerSchema, - tools: arrayType2(McpbManifestToolSchema).optional(), - tools_generated: booleanType2().optional(), - prompts: arrayType2(McpbManifestPromptSchema).optional(), - prompts_generated: booleanType2().optional(), - keywords: arrayType2(stringType2()).optional(), - license: stringType2().optional(), - privacy_policies: arrayType2(stringType2()).optional(), - compatibility: McpbManifestCompatibilitySchema.optional(), - user_config: recordType2(stringType2(), McpbUserConfigurationOptionSchema).optional() - }).refine((data) => !!(data.dxt_version || data.manifest_version), { - message: "Either 'dxt_version' (deprecated) or 'manifest_version' must be provided" - }); - McpbSignatureInfoSchema = strictObjectType2({ - status: enumType2(["signed", "unsigned", "self-signed"]), - publisher: stringType2().optional(), - issuer: stringType2().optional(), - valid_from: stringType2().optional(), - valid_to: stringType2().optional(), - fingerprint: stringType2().optional() - }); -}); - -// ../node_modules/@anthropic-ai/mcpb/dist/cli/init.js -import { existsSync as existsSync6, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs"; -import { basename as basename8, join as join42, resolve as resolve19 } from "path"; -function readPackageJson(dirPath) { - const packageJsonPath = join42(dirPath, "package.json"); - if (existsSync6(packageJsonPath)) { - try { - return JSON.parse(readFileSync10(packageJsonPath, "utf-8")); - } catch (e) {} +// src/utils/dxt/helpers.ts +async function validateManifest(manifestJson) { + const { McpbManifestSchema } = await Promise.resolve().then(() => (init_mcpb(), exports_mcpb)); + const parseResult = McpbManifestSchema.safeParse(manifestJson); + if (!parseResult.success) { + const errors4 = parseResult.error.flatten(); + const errorMessages2 = [ + ...Object.entries(errors4.fieldErrors).map(([field, errs]) => `${field}: ${errs?.join(", ")}`), + ...errors4.formErrors || [] + ].filter(Boolean).join("; "); + throw new Error(`Invalid manifest: ${errorMessages2}`); } - return {}; + return parseResult.data; } -function getDefaultAuthorName(packageData) { - if (typeof packageData.author === "string") { - return packageData.author; - } - return packageData.author?.name || ""; -} -function getDefaultAuthorEmail(packageData) { - if (typeof packageData.author === "object") { - return packageData.author?.email || ""; - } - return ""; -} -function getDefaultAuthorUrl(packageData) { - if (typeof packageData.author === "object") { - return packageData.author?.url || ""; - } - return ""; -} -function getDefaultRepositoryUrl(packageData) { - if (typeof packageData.repository === "string") { - return packageData.repository; - } - return packageData.repository?.url || ""; -} -function getDefaultBasicInfo(packageData, resolvedPath) { - const name = packageData.name || basename8(resolvedPath); - const authorName = getDefaultAuthorName(packageData) || "Unknown Author"; - const displayName = name; - const version2 = packageData.version || "1.0.0"; - const description = packageData.description || "A MCPB bundle"; - return { name, authorName, displayName, version: version2, description }; -} -function getDefaultAuthorInfo(packageData) { - return { - authorEmail: getDefaultAuthorEmail(packageData), - authorUrl: getDefaultAuthorUrl(packageData) - }; -} -function getDefaultServerConfig(packageData) { - const serverType = "node"; - const entryPoint = getDefaultEntryPoint(serverType, packageData); - const mcp_config = createMcpConfig(serverType, entryPoint); - return { serverType, entryPoint, mcp_config }; -} -function getDefaultOptionalFields(packageData) { - return { - keywords: "", - license: packageData.license || "MIT", - repository: undefined - }; -} -function createMcpConfig(serverType, entryPoint) { - switch (serverType) { - case "node": - return { - command: "node", - args: ["${__dirname}/" + entryPoint], - env: {} - }; - case "python": - return { - command: "python", - args: ["${__dirname}/" + entryPoint], - env: { - PYTHONPATH: "${__dirname}/server/lib" - } - }; - case "binary": - return { - command: "${__dirname}/" + entryPoint, - args: [], - env: {} - }; - } -} -function getDefaultEntryPoint(serverType, packageData) { - switch (serverType) { - case "node": - return packageData?.main || "server/index.js"; - case "python": - return "server/main.py"; - case "binary": - return "server/my-server"; - } -} -async function promptBasicInfo(packageData, resolvedPath) { - const defaultName = packageData.name || basename8(resolvedPath); - const name = await input2({ - message: "Extension name:", - default: defaultName, - validate: (value) => value.trim().length > 0 || "Name is required" - }); - const authorName = await input2({ - message: "Author name:", - default: getDefaultAuthorName(packageData), - validate: (value) => value.trim().length > 0 || "Author name is required" - }); - const displayName = await input2({ - message: "Display name (optional):", - default: name - }); - const version2 = await input2({ - message: "Version:", - default: packageData.version || "1.0.0", - validate: (value) => { - if (!value.trim()) - return "Version is required"; - if (!/^\d+\.\d+\.\d+/.test(value)) { - return "Version must follow semantic versioning (e.g., 1.0.0)"; - } - return true; - } - }); - const description = await input2({ - message: "Description:", - default: packageData.description || "", - validate: (value) => value.trim().length > 0 || "Description is required" - }); - return { name, authorName, displayName, version: version2, description }; -} -async function promptAuthorInfo(packageData) { - const authorEmail = await input2({ - message: "Author email (optional):", - default: getDefaultAuthorEmail(packageData) - }); - const authorUrl = await input2({ - message: "Author URL (optional):", - default: getDefaultAuthorUrl(packageData) - }); - return { authorEmail, authorUrl }; -} -async function promptServerConfig(packageData) { - const serverType = await select2({ - message: "Server type:", - choices: [ - { name: "Node.js", value: "node" }, - { name: "Python", value: "python" }, - { name: "Binary", value: "binary" } - ], - default: "node" - }); - const entryPoint = await input2({ - message: "Entry point:", - default: getDefaultEntryPoint(serverType, packageData) - }); - const mcp_config = createMcpConfig(serverType, entryPoint); - return { serverType, entryPoint, mcp_config }; -} -async function promptTools() { - const addTools = await confirm2({ - message: "Does your MCP Server provide tools you want to advertise (optional)?", - default: true - }); - const tools = []; - let toolsGenerated = false; - if (addTools) { - let addMore = true; - while (addMore) { - const toolName = await input2({ - message: "Tool name:", - validate: (value) => value.trim().length > 0 || "Tool name is required" - }); - const toolDescription = await input2({ - message: "Tool description (optional):" - }); - tools.push({ - name: toolName, - ...toolDescription ? { description: toolDescription } : {} - }); - addMore = await confirm2({ - message: "Add another tool?", - default: false - }); - } - toolsGenerated = await confirm2({ - message: "Does your server generate additional tools at runtime?", - default: false - }); - } - return { tools, toolsGenerated }; -} -async function promptPrompts() { - const addPrompts = await confirm2({ - message: "Does your MCP Server provide prompts you want to advertise (optional)?", - default: false - }); - const prompts = []; - let promptsGenerated = false; - if (addPrompts) { - let addMore = true; - while (addMore) { - const promptName = await input2({ - message: "Prompt name:", - validate: (value) => value.trim().length > 0 || "Prompt name is required" - }); - const promptDescription = await input2({ - message: "Prompt description (optional):" - }); - const hasArguments = await confirm2({ - message: "Does this prompt have arguments?", - default: false - }); - const argumentNames = []; - if (hasArguments) { - let addMoreArgs = true; - while (addMoreArgs) { - const argName = await input2({ - message: "Argument name:", - validate: (value) => { - if (!value.trim()) - return "Argument name is required"; - if (argumentNames.includes(value)) { - return "Argument names must be unique"; - } - return true; - } - }); - argumentNames.push(argName); - addMoreArgs = await confirm2({ - message: "Add another argument?", - default: false - }); - } - } - const promptText = await input2({ - message: hasArguments ? `Prompt text (use \${arguments.name} for arguments: ${argumentNames.join(", ")}):` : "Prompt text:", - validate: (value) => value.trim().length > 0 || "Prompt text is required" - }); - prompts.push({ - name: promptName, - ...promptDescription ? { description: promptDescription } : {}, - ...argumentNames.length > 0 ? { arguments: argumentNames } : {}, - text: promptText - }); - addMore = await confirm2({ - message: "Add another prompt?", - default: false - }); - } - promptsGenerated = await confirm2({ - message: "Does your server generate additional prompts at runtime?", - default: false - }); - } - return { prompts, promptsGenerated }; -} -async function promptOptionalFields(packageData) { - const keywords = await input2({ - message: "Keywords (comma-separated, optional):", - default: "" - }); - const license = await input2({ - message: "License:", - default: packageData.license || "MIT" - }); - const addRepository = await confirm2({ - message: "Add repository information?", - default: !!packageData.repository - }); - let repository; - if (addRepository) { - const repoUrl = await input2({ - message: "Repository URL:", - default: getDefaultRepositoryUrl(packageData) - }); - if (repoUrl) { - repository = { - type: "git", - url: repoUrl - }; - } - } - return { keywords, license, repository }; -} -async function promptLongDescription(description) { - const hasLongDescription = await confirm2({ - message: "Add a detailed long description?", - default: false - }); - if (hasLongDescription) { - const longDescription = await input2({ - message: "Long description (supports basic markdown):", - default: description - }); - return longDescription; - } - return; -} -async function promptUrls() { - const homepage = await input2({ - message: "Homepage URL (optional):", - validate: (value) => { - if (!value.trim()) - return true; - try { - new URL(value); - return true; - } catch { - return "Must be a valid URL (e.g., https://example.com)"; - } - } - }); - const documentation = await input2({ - message: "Documentation URL (optional):", - validate: (value) => { - if (!value.trim()) - return true; - try { - new URL(value); - return true; - } catch { - return "Must be a valid URL"; - } - } - }); - const support = await input2({ - message: "Support URL (optional):", - validate: (value) => { - if (!value.trim()) - return true; - try { - new URL(value); - return true; - } catch { - return "Must be a valid URL"; - } - } - }); - return { homepage, documentation, support }; -} -async function promptVisualAssets() { - const icon = await input2({ - message: "Icon file path (optional, relative to manifest):", - validate: (value) => { - if (!value.trim()) - return true; - if (value.includes("..")) - return "Relative paths cannot include '..'"; - return true; - } - }); - const addScreenshots = await confirm2({ - message: "Add screenshots?", - default: false - }); - const screenshots = []; - if (addScreenshots) { - let addMore = true; - while (addMore) { - const screenshot = await input2({ - message: "Screenshot file path (relative to manifest):", - validate: (value) => { - if (!value.trim()) - return "Screenshot path is required"; - if (value.includes("..")) - return "Relative paths cannot include '..'"; - return true; - } - }); - screenshots.push(screenshot); - addMore = await confirm2({ - message: "Add another screenshot?", - default: false - }); - } - } - return { icon, screenshots }; -} -async function promptCompatibility(serverType) { - const addCompatibility = await confirm2({ - message: "Add compatibility constraints?", - default: false - }); - if (!addCompatibility) { - return; - } - const addPlatforms = await confirm2({ - message: "Specify supported platforms?", - default: false - }); - let platforms; - if (addPlatforms) { - const selectedPlatforms = []; - const supportsDarwin = await confirm2({ - message: "Support macOS (darwin)?", - default: true - }); - if (supportsDarwin) - selectedPlatforms.push("darwin"); - const supportsWin32 = await confirm2({ - message: "Support Windows (win32)?", - default: true - }); - if (supportsWin32) - selectedPlatforms.push("win32"); - const supportsLinux = await confirm2({ - message: "Support Linux?", - default: true - }); - if (supportsLinux) - selectedPlatforms.push("linux"); - platforms = selectedPlatforms.length > 0 ? selectedPlatforms : undefined; - } - let runtimes; - if (serverType !== "binary") { - const addRuntimes = await confirm2({ - message: "Specify runtime version constraints?", - default: false - }); - if (addRuntimes) { - if (serverType === "python") { - const pythonVersion = await input2({ - message: "Python version constraint (e.g., >=3.8,<4.0):", - validate: (value) => value.trim().length > 0 || "Python version constraint is required" - }); - runtimes = { python: pythonVersion }; - } else if (serverType === "node") { - const nodeVersion = await input2({ - message: "Node.js version constraint (e.g., >=16.0.0):", - validate: (value) => value.trim().length > 0 || "Node.js version constraint is required" - }); - runtimes = { node: nodeVersion }; - } - } - } - return { - ...platforms ? { platforms } : {}, - ...runtimes ? { runtimes } : {} - }; -} -async function promptUserConfig() { - const addUserConfig = await confirm2({ - message: "Add user-configurable options?", - default: false - }); - if (!addUserConfig) { - return {}; - } - const userConfig = {}; - let addMore = true; - while (addMore) { - const optionKey = await input2({ - message: "Configuration option key (unique identifier):", - validate: (value) => { - if (!value.trim()) - return "Key is required"; - if (userConfig[value]) - return "Key must be unique"; - return true; - } - }); - const optionType = await select2({ - message: "Option type:", - choices: [ - { name: "String", value: "string" }, - { name: "Number", value: "number" }, - { name: "Boolean", value: "boolean" }, - { name: "Directory", value: "directory" }, - { name: "File", value: "file" } - ] - }); - const optionTitle = await input2({ - message: "Option title (human-readable name):", - validate: (value) => value.trim().length > 0 || "Title is required" - }); - const optionDescription = await input2({ - message: "Option description:", - validate: (value) => value.trim().length > 0 || "Description is required" - }); - const optionRequired = await confirm2({ - message: "Is this option required?", - default: false - }); - const optionSensitive = await confirm2({ - message: "Is this option sensitive (like a password)?", - default: false - }); - const option = { - type: optionType, - title: optionTitle, - description: optionDescription, - required: optionRequired, - sensitive: optionSensitive - }; - if (!optionRequired) { - let defaultValue; - if (optionType === "boolean") { - defaultValue = await confirm2({ - message: "Default value:", - default: false - }); - } else if (optionType === "number") { - const defaultStr = await input2({ - message: "Default value (number):", - validate: (value) => { - if (!value.trim()) - return true; - return !isNaN(Number(value)) || "Must be a valid number"; - } - }); - defaultValue = defaultStr ? Number(defaultStr) : undefined; - } else { - defaultValue = await input2({ - message: "Default value (optional):" - }); - } - if (defaultValue !== undefined && defaultValue !== "") { - option.default = defaultValue; - } - } - if (optionType === "number") { - const addConstraints = await confirm2({ - message: "Add min/max constraints?", - default: false - }); - if (addConstraints) { - const min3 = await input2({ - message: "Minimum value (optional):", - validate: (value) => { - if (!value.trim()) - return true; - return !isNaN(Number(value)) || "Must be a valid number"; - } - }); - const max3 = await input2({ - message: "Maximum value (optional):", - validate: (value) => { - if (!value.trim()) - return true; - return !isNaN(Number(value)) || "Must be a valid number"; - } - }); - if (min3) - option.min = Number(min3); - if (max3) - option.max = Number(max3); - } - } - userConfig[optionKey] = option; - addMore = await confirm2({ - message: "Add another configuration option?", - default: false - }); - } - return userConfig; -} -function buildManifest(basicInfo, longDescription, authorInfo, urls, visualAssets, serverConfig, tools, toolsGenerated, prompts, promptsGenerated, compatibility, userConfig, optionalFields) { - const { name, displayName, version: version2, description, authorName } = basicInfo; - const { authorEmail, authorUrl } = authorInfo; - const { serverType, entryPoint, mcp_config } = serverConfig; - const { keywords, license, repository } = optionalFields; - return { - manifest_version: CURRENT_MANIFEST_VERSION, - name, - ...displayName && displayName !== name ? { display_name: displayName } : {}, - version: version2, - description, - ...longDescription ? { long_description: longDescription } : {}, - author: { - name: authorName, - ...authorEmail ? { email: authorEmail } : {}, - ...authorUrl ? { url: authorUrl } : {} - }, - ...urls.homepage ? { homepage: urls.homepage } : {}, - ...urls.documentation ? { documentation: urls.documentation } : {}, - ...urls.support ? { support: urls.support } : {}, - ...visualAssets.icon ? { icon: visualAssets.icon } : {}, - ...visualAssets.screenshots.length > 0 ? { screenshots: visualAssets.screenshots } : {}, - server: { - type: serverType, - entry_point: entryPoint, - mcp_config - }, - ...tools.length > 0 ? { tools } : {}, - ...toolsGenerated ? { tools_generated: true } : {}, - ...prompts.length > 0 ? { prompts } : {}, - ...promptsGenerated ? { prompts_generated: true } : {}, - ...compatibility ? { compatibility } : {}, - ...Object.keys(userConfig).length > 0 ? { user_config: userConfig } : {}, - ...keywords ? { - keywords: keywords.split(",").map((k) => k.trim()).filter((k) => k) - } : {}, - ...license ? { license } : {}, - ...repository ? { repository } : {} - }; -} -function printNextSteps() { - console.log(` -Next steps:`); - console.log(`1. Ensure all your production dependencies are in this directory`); - console.log(`2. Run 'mcpb pack' to create your .mcpb file`); -} -async function initExtension(targetPath = process.cwd(), nonInteractive = false) { - const resolvedPath = resolve19(targetPath); - const manifestPath = join42(resolvedPath, "manifest.json"); - if (existsSync6(manifestPath)) { - if (nonInteractive) { - console.log("manifest.json already exists. Use --force to overwrite in non-interactive mode."); - return false; - } - const overwrite = await confirm2({ - message: "manifest.json already exists. Overwrite?", - default: false - }); - if (!overwrite) { - console.log("Cancelled"); - return false; - } - } - if (!nonInteractive) { - console.log("This utility will help you create a manifest.json file for your MCPB bundle."); - console.log(`Press ^C at any time to quit. -`); - } else { - console.log("Creating manifest.json with default values..."); - } +async function parseAndValidateManifestFromText(manifestText) { + let manifestJson; try { - const packageData = readPackageJson(resolvedPath); - const basicInfo = nonInteractive ? getDefaultBasicInfo(packageData, resolvedPath) : await promptBasicInfo(packageData, resolvedPath); - const longDescription = nonInteractive ? undefined : await promptLongDescription(basicInfo.description); - const authorInfo = nonInteractive ? getDefaultAuthorInfo(packageData) : await promptAuthorInfo(packageData); - const urls = nonInteractive ? { homepage: "", documentation: "", support: "" } : await promptUrls(); - const visualAssets = nonInteractive ? { icon: "", screenshots: [] } : await promptVisualAssets(); - const serverConfig = nonInteractive ? getDefaultServerConfig(packageData) : await promptServerConfig(packageData); - const toolsData = nonInteractive ? { tools: [], toolsGenerated: false } : await promptTools(); - const promptsData = nonInteractive ? { prompts: [], promptsGenerated: false } : await promptPrompts(); - const compatibility = nonInteractive ? undefined : await promptCompatibility(serverConfig.serverType); - const userConfig = nonInteractive ? {} : await promptUserConfig(); - const optionalFields = nonInteractive ? getDefaultOptionalFields(packageData) : await promptOptionalFields(packageData); - const manifest = buildManifest(basicInfo, longDescription, authorInfo, urls, visualAssets, serverConfig, toolsData.tools, toolsData.toolsGenerated, promptsData.prompts, promptsData.promptsGenerated, compatibility, userConfig, optionalFields); - writeFileSync3(manifestPath, JSON.stringify(manifest, null, 2) + ` -`); - console.log(` -Created manifest.json at ${manifestPath}`); - printNextSteps(); - return true; - } catch (error45) { - if (error45 instanceof Error && error45.message.includes("User force closed")) { - console.log(` -Cancelled`); - return false; - } - throw error45; + manifestJson = jsonParse(manifestText); + } catch (error41) { + throw new Error(`Invalid JSON in manifest.json: ${errorMessage(error41)}`); } + return validateManifest(manifestJson); } -var init_init = __esm(() => { - init_prompts(); - init_schemas5(); +async function parseAndValidateManifestFromBytes(manifestData) { + const manifestText = new TextDecoder().decode(manifestData); + return parseAndValidateManifestFromText(manifestText); +} +var init_helpers = __esm(() => { + init_errors(); + init_slowOperations(); }); -// ../node_modules/fflate/esm/index.mjs +// node_modules/fflate/esm/index.mjs +var exports_esm2 = {}; +__export(exports_esm2, { + zlibSync: () => zlibSync, + zlib: () => zlib2, + zipSync: () => zipSync, + zip: () => zip2, + unzlibSync: () => unzlibSync, + unzlib: () => unzlib, + unzipSync: () => unzipSync, + unzip: () => unzip2, + strToU8: () => strToU8, + strFromU8: () => strFromU8, + inflateSync: () => inflateSync, + inflate: () => inflate, + gzipSync: () => gzipSync, + gzip: () => gzip, + gunzipSync: () => gunzipSync, + gunzip: () => gunzip, + deflateSync: () => deflateSync, + deflate: () => deflate, + decompressSync: () => decompressSync, + decompress: () => decompress, + compressSync: () => gzipSync, + compress: () => gzip, + Zlib: () => Zlib, + ZipPassThrough: () => ZipPassThrough, + ZipDeflate: () => ZipDeflate, + Zip: () => Zip, + Unzlib: () => Unzlib, + UnzipPassThrough: () => UnzipPassThrough, + UnzipInflate: () => UnzipInflate, + Unzip: () => Unzip, + Inflate: () => Inflate, + Gzip: () => Gzip, + Gunzip: () => Gunzip, + FlateErrorCode: () => FlateErrorCode, + EncodeUTF8: () => EncodeUTF8, + Deflate: () => Deflate, + Decompress: () => Decompress, + DecodeUTF8: () => DecodeUTF8, + Compress: () => Gzip, + AsyncZlib: () => AsyncZlib, + AsyncZipDeflate: () => AsyncZipDeflate, + AsyncUnzlib: () => AsyncUnzlib, + AsyncUnzipInflate: () => AsyncUnzipInflate, + AsyncInflate: () => AsyncInflate, + AsyncGzip: () => AsyncGzip, + AsyncGunzip: () => AsyncGunzip, + AsyncDeflate: () => AsyncDeflate, + AsyncDecompress: () => AsyncDecompress, + AsyncCompress: () => AsyncGzip +}); import { createRequire as createRequire2 } from "module"; +function StrmOpt(opts, cb) { + if (typeof opts == "function") + cb = opts, opts = {}; + this.ondata = cb; + return opts; +} +function deflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + return cbify(data, opts, [ + bDflt + ], function(ev) { + return pbf(deflateSync(ev.data[0], ev.data[1])); + }, 0, cb); +} function deflateSync(data, opts) { return dopt(data, opts || {}, 0, 0); } +function inflate(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + return cbify(data, opts, [ + bInflt + ], function(ev) { + return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); + }, 1, cb); +} function inflateSync(data, opts) { return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary); } +function gzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + return cbify(data, opts, [ + bDflt, + gze, + function() { + return [gzipSync]; + } + ], function(ev) { + return pbf(gzipSync(ev.data[0], ev.data[1])); + }, 2, cb); +} +function gzipSync(data, opts) { + if (!opts) + opts = {}; + var c6 = crc(), l = data.length; + c6.p(data); + var d = dopt(data, opts, gzhl(opts), 8), s = d.length; + return gzh(d, opts), wbytes(d, s - 8, c6.d()), wbytes(d, s - 4, l), d; +} +function gunzip(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + return cbify(data, opts, [ + bInflt, + guze, + function() { + return [gunzipSync]; + } + ], function(ev) { + return pbf(gunzipSync(ev.data[0], ev.data[1])); + }, 3, cb); +} +function gunzipSync(data, opts) { + var st = gzs(data); + if (st + 8 > data.length) + err(6, "invalid gzip data"); + return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary); +} +function zlib2(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + return cbify(data, opts, [ + bDflt, + zle, + function() { + return [zlibSync]; + } + ], function(ev) { + return pbf(zlibSync(ev.data[0], ev.data[1])); + }, 4, cb); +} +function zlibSync(data, opts) { + if (!opts) + opts = {}; + var a2 = adler(); + a2.p(data); + var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4); + return zlh(d, opts), wbytes(d, d.length - 4, a2.d()), d; +} +function unzlib(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + return cbify(data, opts, [ + bInflt, + zule, + function() { + return [unzlibSync]; + } + ], function(ev) { + return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); + }, 5, cb); +} +function unzlibSync(data, opts) { + return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary); +} +function decompress(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzip(data, opts, cb) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflate(data, opts, cb) : unzlib(data, opts, cb); +} +function decompressSync(data, opts) { + return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzipSync(data, opts) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflateSync(data, opts) : unzlibSync(data, opts); +} function strToU8(str, latin1) { if (latin1) { var ar_1 = new u8(str.length); @@ -282954,12 +209060,104 @@ function strFromU8(dat, latin1) { } else if (td) { return td.decode(dat); } else { - var _a4 = dutf8(dat), s = _a4.s, r = _a4.r; + var _a3 = dutf8(dat), s = _a3.s, r = _a3.r; if (r.length) err(8); return s; } } +function zip2(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + var r = {}; + fltn(data, "", r, opts); + var k = Object.keys(r); + var lft = k.length, o2 = 0, tot = 0; + var slft = lft, files = new Array(lft); + var term = []; + var tAll = function() { + for (var i4 = 0;i4 < term.length; ++i4) + term[i4](); + }; + var cbd = function(a2, b) { + mt(function() { + cb(a2, b); + }); + }; + mt(function() { + cbd = cb; + }); + var cbf = function() { + var out = new u8(tot + 22), oe = o2, cdl = tot - o2; + tot = 0; + for (var i4 = 0;i4 < slft; ++i4) { + var f = files[i4]; + try { + var l = f.c.length; + wzh(out, tot, f, f.f, f.u, l); + var badd = 30 + f.f.length + exfl(f.extra); + var loc = tot + badd; + out.set(f.c, loc); + wzh(out, o2, f, f.f, f.u, l, tot, f.m), o2 += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l; + } catch (e) { + return cbd(e, null); + } + } + wzf(out, o2, files.length, cdl, oe); + cbd(null, out); + }; + if (!lft) + cbf(); + var _loop_1 = function(i4) { + var fn = k[i4]; + var _a3 = r[fn], file2 = _a3[0], p = _a3[1]; + var c6 = crc(), size2 = file2.length; + c6.p(file2); + var f = strToU8(fn), s = f.length; + var com = p.comment, m = com && strToU8(com), ms = m && m.length; + var exl = exfl(p.extra); + var compression = p.level == 0 ? 0 : 8; + var cbl = function(e, d) { + if (e) { + tAll(); + cbd(e, null); + } else { + var l = d.length; + files[i4] = mrg(p, { + size: size2, + crc: c6.d(), + c: d, + f, + m, + u: s != fn.length || m && com.length != ms, + compression + }); + o2 += 30 + s + exl + l; + tot += 76 + 2 * (s + exl) + (ms || 0) + l; + if (!--lft) + cbf(); + } + }; + if (s > 65535) + cbl(err(11, 0, 1), null); + if (!compression) + cbl(null, file2); + else if (size2 < 160000) { + try { + cbl(null, deflateSync(file2, p)); + } catch (e) { + cbl(e, null); + } + } else + term.push(deflate(file2, p, cbl)); + }; + for (var i3 = 0;i3 < slft; ++i3) { + _loop_1(i3); + } + return tAll; +} function zipSync(data, opts) { if (!opts) opts = {}; @@ -282969,7 +209167,7 @@ function zipSync(data, opts) { var o2 = 0; var tot = 0; for (var fn in r) { - var _a4 = r[fn], file2 = _a4[0], p = _a4[1]; + var _a3 = r[fn], file2 = _a3[0], p = _a3[1]; var compression = p.level == 0 ? 0 : 8; var f = strToU8(fn), s = f.length; var com = p.comment, m = com && strToU8(com), ms = m && m.length; @@ -283003,6 +209201,90 @@ function zipSync(data, opts) { wzf(out, o2, files.length, cdl, oe); return out; } +function unzip2(data, opts, cb) { + if (!cb) + cb = opts, opts = {}; + if (typeof cb != "function") + err(7); + var term = []; + var tAll = function() { + for (var i4 = 0;i4 < term.length; ++i4) + term[i4](); + }; + var files = {}; + var cbd = function(a2, b) { + mt(function() { + cb(a2, b); + }); + }; + mt(function() { + cbd = cb; + }); + var e = data.length - 22; + for (;b4(data, e) != 101010256; --e) { + if (!e || data.length - e > 65558) { + cbd(err(13, 0, 1), null); + return tAll; + } + } + var lft = b2(data, e + 8); + if (lft) { + var c6 = lft; + var o2 = b4(data, e + 16); + var z2 = o2 == 4294967295 || c6 == 65535; + if (z2) { + var ze = b4(data, e - 12); + z2 = b4(data, ze) == 101075792; + if (z2) { + c6 = lft = b4(data, ze + 32); + o2 = b4(data, ze + 48); + } + } + var fltr = opts && opts.filter; + var _loop_3 = function(i4) { + var _a3 = zh(data, o2, z2), c_1 = _a3[0], sc = _a3[1], su = _a3[2], fn = _a3[3], no = _a3[4], off = _a3[5], b = slzh(data, off); + o2 = no; + var cbl = function(e2, d) { + if (e2) { + tAll(); + cbd(e2, null); + } else { + if (d) + files[fn] = d; + if (!--lft) + cbd(null, files); + } + }; + if (!fltr || fltr({ + name: fn, + size: sc, + originalSize: su, + compression: c_1 + })) { + if (!c_1) + cbl(null, slc(data, b, b + sc)); + else if (c_1 == 8) { + var infl = data.subarray(b, b + sc); + if (su < 524288 || sc > 0.8 * su) { + try { + cbl(null, inflateSync(infl, { out: new u8(su) })); + } catch (e2) { + cbl(e2, null); + } + } else + term.push(inflate(infl, { size: su }, cbl)); + } else + cbl(err(14, "unknown compression type " + c_1, 1), null); + } else + cbl(null, null); + }; + for (var i3 = 0;i3 < c6; ++i3) { + _loop_3(i3); + } + } else + cbd(null, {}); + return tAll; +} function unzipSync(data, opts) { var files = {}; var e = data.length - 22; @@ -283025,7 +209307,7 @@ function unzipSync(data, opts) { } var fltr = opts && opts.filter; for (var i3 = 0;i3 < c6; ++i3) { - var _a4 = zh(data, o2, z2), c_2 = _a4[0], sc = _a4[1], su = _a4[2], fn = _a4[3], no = _a4[4], off = _a4[5], b = slzh(data, off); + var _a3 = zh(data, o2, z2), c_2 = _a3[0], sc = _a3[1], su = _a3[2], fn = _a3[3], no = _a3[4], off = _a3[5], b = slzh(data, off); o2 = no; if (!fltr || fltr({ name: fn, @@ -283043,7 +209325,7 @@ function unzipSync(data, opts) { } return files; } -var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) { +var require2, Worker, workerAdd = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global", wk, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) { var b = new u16(31); for (var i2 = 0;i2 < 31; ++i2) { b[i2] = start += 1 << eb[i2 - 1]; @@ -283055,7 +209337,7 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) } } return { b, r }; -}, _a3, fl, revfl, _b, fd, revfd, rev, x2, i2, hMap = function(cd, mb, r) { +}, _a2, fl, revfl, _b, fd, revfd, rev, x2, i2, hMap = function(cd, mb, r) { var s = cd.length; var i3 = 0; var l = new u16(mb); @@ -283090,7 +209372,7 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) } } return co; -}, flt, i2, i2, i2, i2, fdt, i2, flm, flrm, fdm, fdrm, max3 = function(a2) { +}, flt, i2, i2, i2, i2, fdt, i2, flm, flrm, fdm, fdrm, max2 = function(a2) { var m = a2[0]; for (var i3 = 1;i3 < a2.length; ++i3) { if (a2[i3] > m) @@ -283111,7 +209393,7 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) if (e == null || e > v.length) e = v.length; return new u8(v.subarray(s, e)); -}, ec, err = function(ind, msg, nt) { +}, FlateErrorCode, ec, err = function(ind, msg, nt) { var e = new Error(msg || ec[ind]); e.code = ind; if (Error.captureStackTrace) @@ -283167,7 +209449,7 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) clt[clim[i3]] = bits(dat, pos + i3 * 3, 7); } pos += hcLen * 3; - var clb = max3(clt), clbmsk = (1 << clb) - 1; + var clb = max2(clt), clbmsk = (1 << clb) - 1; var clm = hMap(clt, clb, 1); for (var i3 = 0;i3 < tl; ) { var r = clm[bits(dat, pos, clbmsk)]; @@ -283187,10 +209469,10 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) ldt[i3++] = c6; } } - var lt4 = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); - lbt = max3(lt4); - dbt = max3(dt); - lm = hMap(lt4, lbt, 1); + var lt3 = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); + lbt = max2(lt3); + dbt = max2(dt); + lm = hMap(lt3, lbt, 1); dm = hMap(dt, dbt, 1); } else err(1); @@ -283220,10 +209502,10 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) lpos = pos, lm = null; break; } else { - var add3 = sym - 254; + var add2 = sym - 254; if (sym > 264) { var i3 = sym - 257, b = fleb[i3]; - add3 = bits(dat, pos, (1 << b) - 1) + fl[i3]; + add2 = bits(dat, pos, (1 << b) - 1) + fl[i3]; pos += b; } var d = dm[bits16(dat, pos) & dms], dsym = d >> 4; @@ -283242,7 +209524,7 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) } if (resize) cbuf(bt + 131072); - var end = bt + add3; + var end = bt + add2; if (bt < dt) { var shift = dl - dt, dend = Math.min(dt, end); if (shift + bt < 0) @@ -283389,7 +209671,7 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) }, wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) { wbits(out, p++, final); ++lf[256]; - var _a4 = hTree(lf, 15), dlt = _a4.t, mlb = _a4.l; + var _a3 = hTree(lf, 15), dlt = _a3.t, mlb = _a3.l; var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l; var _c21 = lc(dlt), lclt = _c21.c, nlc = _c21.n; var _d = lc(ddt), lcdt = _d.c, ndc = _d.n; @@ -283461,7 +209743,7 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) var opt = deo[lvl - 1]; var n2 = opt >> 13, c6 = opt & 8191; var msk_1 = (1 << plvl) - 1; - var prev = st.p || new u16(32768), head3 = st.h || new u16(msk_1 + 1); + var prev = st.p || new u16(32768), head2 = st.h || new u16(msk_1 + 1); var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; var hsh = function(i4) { return (dat[i4] ^ dat[i4 + 1] << bs1_1 ^ dat[i4 + 2] << bs2_1) & msk_1; @@ -283471,9 +209753,9 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) var lc_1 = 0, eb = 0, i3 = st.i || 0, li = 0, wi = st.w || 0, bs = 0; for (;i3 + 2 < s; ++i3) { var hv = hsh(i3); - var imod = i3 & 32767, pimod = head3[hv]; + var imod = i3 & 32767, pimod = head2[hv]; prev[imod] = pimod; - head3[hv] = imod; + head2[hv] = imod; if (wi <= i3) { var rem = s - i3; if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { @@ -283535,7 +209817,7 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) if (!lst) { st.r = pos & 7 | w[pos / 8 | 0] << 3; pos -= 7; - st.h = head3, st.p = prev, st.i = i3, st.w = wi; + st.h = head2, st.p = prev, st.i = i3, st.w = wi; } } else { for (var i3 = st.w || 0;i3 < s + lst; i3 += 65535) { @@ -283562,6 +209844,25 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) return ~c6; } }; +}, adler = function() { + var a2 = 1, b = 0; + return { + p: function(d) { + var n2 = a2, m = b; + var l = d.length | 0; + for (var i3 = 0;i3 != l; ) { + var e = Math.min(i3 + 2655, l); + for (;i3 < e; ++i3) + m += n2 += d[i3]; + n2 = (n2 & 65535) + 15 * (n2 >> 16), m = (m & 65535) + 15 * (m >> 16); + } + a2 = n2, b = m; + }, + d: function() { + a2 %= 65521, b %= 65521; + return (a2 & 255) << 24 | (a2 & 65280) << 8 | (b & 255) << 8 | b >> 8; + } + }; }, dopt = function(dat, opt, pre, post, st) { if (!st) { st = { l: 1 }; @@ -283582,6 +209883,121 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) for (var k in b) o2[k] = b[k]; return o2; +}, wcln = function(fn, fnStr, td) { + var dt = fn(); + var st = fn.toString(); + var ks = st.slice(st.indexOf("[") + 1, st.lastIndexOf("]")).replace(/\s+/g, "").split(","); + for (var i3 = 0;i3 < dt.length; ++i3) { + var v = dt[i3], k = ks[i3]; + if (typeof v == "function") { + fnStr += ";" + k + "="; + var st_1 = v.toString(); + if (v.prototype) { + if (st_1.indexOf("[native code]") != -1) { + var spInd = st_1.indexOf(" ", 8) + 1; + fnStr += st_1.slice(spInd, st_1.indexOf("(", spInd)); + } else { + fnStr += st_1; + for (var t in v.prototype) + fnStr += ";" + k + ".prototype." + t + "=" + v.prototype[t].toString(); + } + } else + fnStr += st_1; + } else + td[k] = v; + } + return fnStr; +}, ch, cbfs = function(v) { + var tl = []; + for (var k in v) { + if (v[k].buffer) { + tl.push((v[k] = new v[k].constructor(v[k])).buffer); + } + } + return tl; +}, wrkr = function(fns, init, id, cb) { + if (!ch[id]) { + var fnStr = "", td_1 = {}, m = fns.length - 1; + for (var i3 = 0;i3 < m; ++i3) + fnStr = wcln(fns[i3], fnStr, td_1); + ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 }; + } + var td = mrg({}, ch[id].e); + return wk(ch[id].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + init.toString() + "}", id, td, cbfs(td), cb); +}, bInflt = function() { + return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max2, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; +}, bDflt = function() { + return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; +}, gze = function() { + return [gzh, gzhl, wbytes, crc, crct]; +}, guze = function() { + return [gzs, gzl]; +}, zle = function() { + return [zlh, wbytes, adler]; +}, zule = function() { + return [zls]; +}, pbf = function(msg) { + return postMessage(msg, [msg.buffer]); +}, gopt = function(o2) { + return o2 && { + out: o2.size && new u8(o2.size), + dictionary: o2.dictionary + }; +}, cbify = function(dat, opts, fns, init, id, cb) { + var w = wrkr(fns, init, id, function(err2, dat2) { + w.terminate(); + cb(err2, dat2); + }); + w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []); + return function() { + w.terminate(); + }; +}, astrm = function(strm) { + strm.ondata = function(dat, final) { + return postMessage([dat, final], [dat.buffer]); + }; + return function(ev) { + if (ev.data.length) { + strm.push(ev.data[0], ev.data[1]); + postMessage([ev.data[0].length]); + } else + strm.flush(); + }; +}, astrmify = function(fns, strm, opts, init, id, flush, ext) { + var t; + var w = wrkr(fns, init, id, function(err2, dat) { + if (err2) + w.terminate(), strm.ondata.call(strm, err2); + else if (!Array.isArray(dat)) + ext(dat); + else if (dat.length == 1) { + strm.queuedSize -= dat[0]; + if (strm.ondrain) + strm.ondrain(dat[0]); + } else { + if (dat[1]) + w.terminate(); + strm.ondata.call(strm, err2, dat[0], dat[1]); + } + }); + w.postMessage(opts); + strm.queuedSize = 0; + strm.push = function(d, f) { + if (!strm.ondata) + err(5); + if (t) + strm.ondata(err(4, 0, 1), null, !!f); + strm.queuedSize += d.length; + w.postMessage([d, t = f], [d.buffer]); + }; + strm.terminate = function() { + w.terminate(); + }; + if (flush) { + strm.flush = function() { + w.postMessage([]); + }; + } }, b2 = function(d, b) { return d[b] | d[b + 1] << 8; }, b4 = function(d, b) { @@ -283591,7 +210007,47 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) }, wbytes = function(d, b, v) { for (;v; ++b) d[b] = v, v >>>= 8; -}, fltn = function(d, p, t, o2) { +}, gzh = function(c6, o2) { + var fn = o2.filename; + c6[0] = 31, c6[1] = 139, c6[2] = 8, c6[8] = o2.level < 2 ? 4 : o2.level == 9 ? 2 : 0, c6[9] = 3; + if (o2.mtime != 0) + wbytes(c6, 4, Math.floor(new Date(o2.mtime || Date.now()) / 1000)); + if (fn) { + c6[3] = 8; + for (var i3 = 0;i3 <= fn.length; ++i3) + c6[i3 + 10] = fn.charCodeAt(i3); + } +}, gzs = function(d) { + if (d[0] != 31 || d[1] != 139 || d[2] != 8) + err(6, "invalid gzip data"); + var flg = d[3]; + var st = 10; + if (flg & 4) + st += (d[10] | d[11] << 8) + 2; + for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1);zs > 0; zs -= !d[st++]) + ; + return st + (flg & 2); +}, gzl = function(d) { + var l = d.length; + return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0; +}, gzhl = function(o2) { + return 10 + (o2.filename ? o2.filename.length + 1 : 0); +}, zlh = function(c6, o2) { + var lv = o2.level, fl2 = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; + c6[0] = 120, c6[1] = fl2 << 6 | (o2.dictionary && 32); + c6[1] |= 31 - (c6[0] << 8 | c6[1]) % 31; + if (o2.dictionary) { + var h2 = adler(); + h2.p(o2.dictionary); + wbytes(c6, 2, h2.d()); + } +}, zls = function(d, dict) { + if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31) + err(6, "invalid zlib data"); + if ((d[1] >> 5 & 1) == +!dict) + err(6, "invalid zlib data: " + (d[1] & 32 ? "need" : "unexpected") + " dictionary"); + return (d[1] >> 3 & 4) + 2; +}, Deflate, AsyncDeflate, Inflate, AsyncInflate, Gzip, AsyncGzip, Gunzip, AsyncGunzip, Zlib, AsyncZlib, Unzlib, AsyncUnzlib, Decompress, AsyncDecompress, fltn = function(d, p, t, o2) { for (var k in d) { var val = d[k], n2 = p + k, op = o2; if (Array.isArray(val)) @@ -283618,11 +210074,13 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) else r += String.fromCharCode((c6 & 15) << 12 | (d[i3++] & 63) << 6 | d[i3++] & 63); } +}, DecodeUTF8, EncodeUTF8, dbf = function(l) { + return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; }, slzh = function(d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); }, zh = function(d, b, z2) { var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20); - var _a4 = z2 && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a4[0], su = _a4[1], off = _a4[2]; + var _a3 = z2 && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a3[0], su = _a3[1], off = _a3[2]; return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off]; }, z64e = function(d, b) { for (;b2(d, b) != 1; b += 4 + b2(d, b + 2)) @@ -283683,21 +210141,47 @@ var require2, Worker, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) wbytes(o2, b + 10, c6); wbytes(o2, b + 12, d); wbytes(o2, b + 16, e); -}; +}, ZipPassThrough, ZipDeflate, AsyncZipDeflate, Zip, UnzipPassThrough, UnzipInflate, AsyncUnzipInflate, Unzip, mt; var init_esm5 = __esm(() => { require2 = createRequire2("/"); try { Worker = require2("worker_threads").Worker; } catch (e) {} + wk = Worker ? function(c6, _, msg, transfer, cb) { + var done = false; + var w = new Worker(c6 + workerAdd, { eval: true }).on("error", function(e) { + return cb(e, null); + }).on("message", function(m) { + return cb(null, m); + }).on("exit", function(c7) { + if (c7 && !done) + cb(new Error("exited with code " + c7), null); + }); + w.postMessage(msg, transfer); + w.terminate = function() { + done = true; + return Worker.prototype.terminate.call(w); + }; + return w; + } : function(_, __, ___, ____, cb) { + setImmediate(function() { + return cb(new Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"), null); + }); + var NOP = function() {}; + return { + terminate: NOP, + postMessage: NOP + }; + }; u8 = Uint8Array; u16 = Uint16Array; i32 = Int32Array; fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]); fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]); clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); - _a3 = freb(fleb, 2); - fl = _a3.b; - revfl = _a3.r; + _a2 = freb(fleb, 2); + fl = _a2.b; + revfl = _a2.r; fl[28] = 258, revfl[258] = 28; _b = freb(fdeb, 0); fd = _b.b; @@ -283725,6 +210209,23 @@ var init_esm5 = __esm(() => { flrm = /* @__PURE__ */ hMap(flt, 9, 1); fdm = /* @__PURE__ */ hMap(fdt, 5, 0); fdrm = /* @__PURE__ */ hMap(fdt, 5, 1); + FlateErrorCode = { + UnexpectedEOF: 0, + InvalidBlockType: 1, + InvalidLengthLiteral: 2, + InvalidDistance: 3, + StreamFinished: 4, + NoStreamHandler: 5, + InvalidHeader: 6, + NoCallback: 7, + InvalidUTF8: 8, + ExtraFieldTooLong: 9, + InvalidDate: 10, + FilenameTooLong: 11, + StreamFinishing: 12, + InvalidZipData: 13, + UnknownCompressionMethod: 14 + }; ec = [ "unexpected EOF", "invalid block type", @@ -283753,2856 +210254,6 @@ var init_esm5 = __esm(() => { } return t; }(); - te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder; - td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder; - try { - td.decode(et, { stream: true }); - tds = 1; - } catch (e) {} -}); - -// ../node_modules/ignore/index.js -var require_ignore2 = __commonJS((exports, module) => { - function makeArray(subject) { - return Array.isArray(subject) ? subject : [subject]; - } - var UNDEFINED = undefined; - var EMPTY2 = ""; - var SPACE = " "; - var ESCAPE = "\\"; - var REGEX_TEST_BLANK_LINE = /^\s+$/; - var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; - var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; - var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; - var REGEX_SPLITALL_CRLF = /\r?\n/g; - var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/; - var REGEX_TEST_TRAILING_SLASH = /\/$/; - var SLASH2 = "/"; - var TMP_KEY_IGNORE = "node-ignore"; - if (typeof Symbol !== "undefined") { - TMP_KEY_IGNORE = Symbol.for("node-ignore"); - } - var KEY_IGNORE = TMP_KEY_IGNORE; - var define2 = (object4, key, value) => { - Object.defineProperty(object4, key, { value }); - return value; - }; - var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; - var RETURN_FALSE = () => false; - var sanitizeRange = (range3) => range3.replace(REGEX_REGEXP_RANGE, (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY2); - var cleanRangeBackSlash = (slashes) => { - const { length } = slashes; - return slashes.slice(0, length - length % 2); - }; - var REPLACERS = [ - [ - /^\uFEFF/, - () => EMPTY2 - ], - [ - /((?:\\\\)*?)(\\?\s+)$/, - (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY2) - ], - [ - /(\\+?)\s/g, - (_, m1) => { - const { length } = m1; - return m1.slice(0, length - length % 2) + SPACE; - } - ], - [ - /[\\$.|*+(){^]/g, - (match) => `\\${match}` - ], - [ - /(?!\\)\?/g, - () => "[^/]" - ], - [ - /^\//, - () => "^" - ], - [ - /\//g, - () => "\\/" - ], - [ - /^\^*\\\*\\\*\\\//, - () => "^(?:.*\\/)?" - ], - [ - /^(?=[^^])/, - function startingReplacer() { - return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; - } - ], - [ - /\\\/\\\*\\\*(?=\\\/|$)/g, - (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+" - ], - [ - /(^|[^\\]+)(\\\*)+(?=.+)/g, - (_, p1, p2) => { - const unescaped = p2.replace(/\\\*/g, "[^\\/]*"); - return p1 + unescaped; - } - ], - [ - /\\\\\\(?=[$.|*+(){^])/g, - () => ESCAPE - ], - [ - /\\\\/g, - () => ESCAPE - ], - [ - /(\\)?\[([^\]/]*?)(\\*)($|\])/g, - (match, leadEscape, range3, endEscape, close) => leadEscape === ESCAPE ? `\\[${range3}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range3)}${endEscape}]` : "[]" : "[]" - ], - [ - /(?:[^*])$/, - (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)` - ] - ]; - var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/; - var MODE_IGNORE = "regex"; - var MODE_CHECK_IGNORE = "checkRegex"; - var UNDERSCORE = "_"; - var TRAILING_WILD_CARD_REPLACERS = { - [MODE_IGNORE](_, p1) { - const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; - return `${prefix}(?=$|\\/$)`; - }, - [MODE_CHECK_IGNORE](_, p1) { - const prefix = p1 ? `${p1}[^/]*` : "[^/]*"; - return `${prefix}(?=$|\\/$)`; - } - }; - var makeRegexPrefix = (pattern) => REPLACERS.reduce((prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)), pattern); - var isString4 = (subject) => typeof subject === "string"; - var checkPattern = (pattern) => pattern && isString4(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0; - var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean); - - class IgnoreRule { - constructor(pattern, mark, body, ignoreCase, negative, prefix) { - this.pattern = pattern; - this.mark = mark; - this.negative = negative; - define2(this, "body", body); - define2(this, "ignoreCase", ignoreCase); - define2(this, "regexPrefix", prefix); - } - get regex() { - const key = UNDERSCORE + MODE_IGNORE; - if (this[key]) { - return this[key]; - } - return this._make(MODE_IGNORE, key); - } - get checkRegex() { - const key = UNDERSCORE + MODE_CHECK_IGNORE; - if (this[key]) { - return this[key]; - } - return this._make(MODE_CHECK_IGNORE, key); - } - _make(mode, key) { - const str = this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, TRAILING_WILD_CARD_REPLACERS[mode]); - const regex2 = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str); - return define2(this, key, regex2); - } - } - var createRule = ({ - pattern, - mark - }, ignoreCase) => { - let negative = false; - let body = pattern; - if (body.indexOf("!") === 0) { - negative = true; - body = body.substr(1); - } - body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); - const regexPrefix = makeRegexPrefix(body); - return new IgnoreRule(pattern, mark, body, ignoreCase, negative, regexPrefix); - }; - - class RuleManager { - constructor(ignoreCase) { - this._ignoreCase = ignoreCase; - this._rules = []; - } - _add(pattern) { - if (pattern && pattern[KEY_IGNORE]) { - this._rules = this._rules.concat(pattern._rules._rules); - this._added = true; - return; - } - if (isString4(pattern)) { - pattern = { - pattern - }; - } - if (checkPattern(pattern.pattern)) { - const rule = createRule(pattern, this._ignoreCase); - this._added = true; - this._rules.push(rule); - } - } - add(pattern) { - this._added = false; - makeArray(isString4(pattern) ? splitPattern(pattern) : pattern).forEach(this._add, this); - return this._added; - } - test(path16, checkUnignored, mode) { - let ignored = false; - let unignored = false; - let matchedRule; - this._rules.forEach((rule) => { - const { negative } = rule; - if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { - return; - } - const matched = rule[mode].test(path16); - if (!matched) { - return; - } - ignored = !negative; - unignored = negative; - matchedRule = negative ? UNDEFINED : rule; - }); - const ret = { - ignored, - unignored - }; - if (matchedRule) { - ret.rule = matchedRule; - } - return ret; - } - } - var throwError = (message, Ctor) => { - throw new Ctor(message); - }; - var checkPath = (path16, originalPath, doThrow) => { - if (!isString4(path16)) { - return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError); - } - if (!path16) { - return doThrow(`path must not be empty`, TypeError); - } - if (checkPath.isNotRelative(path16)) { - const r = "`path.relative()`d"; - return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError); - } - return true; - }; - var isNotRelative = (path16) => REGEX_TEST_INVALID_PATH.test(path16); - checkPath.isNotRelative = isNotRelative; - checkPath.convert = (p) => p; - - class Ignore { - constructor({ - ignorecase = true, - ignoreCase = ignorecase, - allowRelativePaths = false - } = {}) { - define2(this, KEY_IGNORE, true); - this._rules = new RuleManager(ignoreCase); - this._strictPathCheck = !allowRelativePaths; - this._initCache(); - } - _initCache() { - this._ignoreCache = Object.create(null); - this._testCache = Object.create(null); - } - add(pattern) { - if (this._rules.add(pattern)) { - this._initCache(); - } - return this; - } - addPattern(pattern) { - return this.add(pattern); - } - _test(originalPath, cache3, checkUnignored, slices) { - const path16 = originalPath && checkPath.convert(originalPath); - checkPath(path16, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE); - return this._t(path16, cache3, checkUnignored, slices); - } - checkIgnore(path16) { - if (!REGEX_TEST_TRAILING_SLASH.test(path16)) { - return this.test(path16); - } - const slices = path16.split(SLASH2).filter(Boolean); - slices.pop(); - if (slices.length) { - const parent3 = this._t(slices.join(SLASH2) + SLASH2, this._testCache, true, slices); - if (parent3.ignored) { - return parent3; - } - } - return this._rules.test(path16, false, MODE_CHECK_IGNORE); - } - _t(path16, cache3, checkUnignored, slices) { - if (path16 in cache3) { - return cache3[path16]; - } - if (!slices) { - slices = path16.split(SLASH2).filter(Boolean); - } - slices.pop(); - if (!slices.length) { - return cache3[path16] = this._rules.test(path16, checkUnignored, MODE_IGNORE); - } - const parent3 = this._t(slices.join(SLASH2) + SLASH2, cache3, checkUnignored, slices); - return cache3[path16] = parent3.ignored ? parent3 : this._rules.test(path16, checkUnignored, MODE_IGNORE); - } - ignores(path16) { - return this._test(path16, this._ignoreCache, false).ignored; - } - createFilter() { - return (path16) => !this.ignores(path16); - } - filter(paths2) { - return makeArray(paths2).filter(this.createFilter()); - } - test(path16) { - return this._test(path16, this._testCache, true); - } - } - var factory2 = (options2) => new Ignore(options2); - var isPathValid = (path16) => checkPath(path16 && checkPath.convert(path16), path16, RETURN_FALSE); - var setupWindows = () => { - const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"); - checkPath.convert = makePosix; - const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; - checkPath.isNotRelative = (path16) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path16) || isNotRelative(path16); - }; - if (typeof process !== "undefined" && process.platform === "win32") { - setupWindows(); - } - module.exports = factory2; - factory2.default = factory2; - module.exports.isPathValid = isPathValid; - define2(module.exports, Symbol.for("setupWindows"), setupWindows); -}); - -// ../node_modules/@anthropic-ai/mcpb/dist/node/files.js -import { existsSync as existsSync7, readdirSync as readdirSync4, readFileSync as readFileSync11, statSync as statSync7 } from "fs"; -import { join as join43, relative as relative6, sep as sep10 } from "path"; -function readMcpbIgnorePatterns(baseDir) { - const mcpbIgnorePath = join43(baseDir, ".mcpbignore"); - if (!existsSync7(mcpbIgnorePath)) { - return []; - } - try { - const content = readFileSync11(mcpbIgnorePath, "utf-8"); - return content.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#")); - } catch (error45) { - console.warn(`Warning: Could not read .mcpbignore file: ${error45 instanceof Error ? error45.message : "Unknown error"}`); - return []; - } -} -function buildIgnoreChecker(additionalPatterns) { - return import_ignore2.default().add(EXCLUDE_PATTERNS).add(additionalPatterns); -} -function shouldExclude(filePath, additionalPatterns = []) { - return buildIgnoreChecker(additionalPatterns).ignores(filePath); -} -function getAllFiles(dirPath, baseDir = dirPath, fileList = {}, additionalPatterns = []) { - const files = readdirSync4(dirPath); - const ignoreChecker = buildIgnoreChecker(additionalPatterns); - for (const file2 of files) { - const filePath = join43(dirPath, file2); - const relativePath = relative6(baseDir, filePath); - if (ignoreChecker.ignores(relativePath)) { - continue; - } - const stat17 = statSync7(filePath); - if (stat17.isDirectory()) { - getAllFiles(filePath, baseDir, fileList, additionalPatterns); - } else { - const zipPath = relativePath.split(sep10).join("/"); - fileList[zipPath] = readFileSync11(filePath); - } - } - return fileList; -} -function getAllFilesWithCount(dirPath, baseDir = dirPath, fileList = {}, additionalPatterns = [], ignoredCount = 0) { - const files = readdirSync4(dirPath); - const ignoreChecker = buildIgnoreChecker(additionalPatterns); - for (const file2 of files) { - const filePath = join43(dirPath, file2); - const relativePath = relative6(baseDir, filePath); - if (ignoreChecker.ignores(relativePath)) { - ignoredCount++; - continue; - } - const stat17 = statSync7(filePath); - if (stat17.isDirectory()) { - const result3 = getAllFilesWithCount(filePath, baseDir, fileList, additionalPatterns, ignoredCount); - ignoredCount = result3.ignoredCount; - } else { - const zipPath = relativePath.split(sep10).join("/"); - fileList[zipPath] = { - data: readFileSync11(filePath), - mode: stat17.mode - }; - } - } - return { files: fileList, ignoredCount }; -} -var import_ignore2, EXCLUDE_PATTERNS; -var init_files4 = __esm(() => { - import_ignore2 = __toESM(require_ignore2(), 1); - EXCLUDE_PATTERNS = [ - ".DS_Store", - "Thumbs.db", - ".gitignore", - ".git", - ".mcpbignore", - "*.log", - ".env*", - ".npm", - ".npmrc", - ".yarnrc", - ".yarn", - ".eslintrc", - ".editorconfig", - ".prettierrc", - ".prettierignore", - ".eslintignore", - ".nycrc", - ".babelrc", - ".pnp.*", - "node_modules/.cache", - "node_modules/.bin", - "*.map", - ".env.local", - ".env.*.local", - "npm-debug.log*", - "yarn-debug.log*", - "yarn-error.log*", - "package-lock.json", - "yarn.lock", - "*.mcpb", - "*.d.ts", - "*.tsbuildinfo", - "tsconfig.json" - ]; -}); - -// stub-npm:galactus -var handler3, stub3, DestroyerOfModules2 = class { -}; -var init_galactus = __esm(() => { - handler3 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub3 = new Proxy({}, handler3); -}); - -// stub-npm:pretty-bytes -var handler4, stub4, pretty_bytes_default; -var init_pretty_bytes = __esm(() => { - handler4 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub4 = new Proxy({}, handler4); - pretty_bytes_default = stub4; -}); - -// stub-npm:node-forge -var handler5, stub5, node_forge_default; -var init_node_forge = __esm(() => { - handler5 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub5 = new Proxy({}, handler5); - node_forge_default = stub5; -}); - -// ../node_modules/@anthropic-ai/mcpb/dist/node/sign.js -import { execFile as execFile4 } from "child_process"; -import { readFileSync as readFileSync12, writeFileSync as writeFileSync4 } from "fs"; -import { mkdtemp, rm as rm2, writeFile as writeFile4 } from "fs/promises"; -import { tmpdir as tmpdir3 } from "os"; -import { join as join44 } from "path"; -import { promisify as promisify4 } from "util"; -function signMcpbFile(mcpbPath, certPath, keyPath, intermediates) { - const mcpbContent = readFileSync12(mcpbPath); - const certificatePem = readFileSync12(certPath, "utf-8"); - const privateKeyPem = readFileSync12(keyPath, "utf-8"); - const intermediatePems = intermediates?.map((path16) => readFileSync12(path16, "utf-8")); - const p7 = node_forge_default.pkcs7.createSignedData(); - p7.content = node_forge_default.util.createBuffer(mcpbContent); - const signingCert = node_forge_default.pki.certificateFromPem(certificatePem); - const privateKey = node_forge_default.pki.privateKeyFromPem(privateKeyPem); - p7.addCertificate(signingCert); - if (intermediatePems) { - for (const pem of intermediatePems) { - p7.addCertificate(node_forge_default.pki.certificateFromPem(pem)); - } - } - p7.addSigner({ - key: privateKey, - certificate: signingCert, - digestAlgorithm: node_forge_default.pki.oids.sha256, - authenticatedAttributes: [ - { - type: node_forge_default.pki.oids.contentType, - value: node_forge_default.pki.oids.data - }, - { - type: node_forge_default.pki.oids.messageDigest - }, - { - type: node_forge_default.pki.oids.signingTime - } - ] - }); - p7.sign({ detached: true }); - const asn1 = node_forge_default.asn1.toDer(p7.toAsn1()); - const pkcs7Signature = Buffer.from(asn1.getBytes(), "binary"); - const signatureBlock = createSignatureBlock(pkcs7Signature); - const signedContent = Buffer.concat([mcpbContent, signatureBlock]); - writeFileSync4(mcpbPath, signedContent); -} -async function verifyMcpbFile(mcpbPath) { - try { - const fileContent = readFileSync12(mcpbPath); - const { originalContent, pkcs7Signature } = extractSignatureBlock(fileContent); - if (!pkcs7Signature) { - return { status: "unsigned" }; - } - const asn1 = node_forge_default.asn1.fromDer(pkcs7Signature.toString("binary")); - const p7Message = node_forge_default.pkcs7.messageFromAsn1(asn1); - if (!("type" in p7Message) || p7Message.type !== node_forge_default.pki.oids.signedData) { - return { status: "unsigned" }; - } - const p7 = p7Message; - const certificates = p7.certificates || []; - if (certificates.length === 0) { - return { status: "unsigned" }; - } - const signingCert = certificates[0]; - const contentBuf = node_forge_default.util.createBuffer(originalContent); - try { - p7.verify({ authenticatedAttributes: true }); - const signerInfos = p7.signerInfos; - const signerInfo = signerInfos?.[0]; - if (signerInfo) { - const md = node_forge_default.md.sha256.create(); - md.update(contentBuf.getBytes()); - const digest = md.digest().getBytes(); - let messageDigest = null; - for (const attr of signerInfo.authenticatedAttributes) { - if (attr.type === node_forge_default.pki.oids.messageDigest) { - messageDigest = attr.value; - break; - } - } - if (!messageDigest || messageDigest !== digest) { - return { status: "unsigned" }; - } - } - } catch (error45) { - return { status: "unsigned" }; - } - const certPem = node_forge_default.pki.certificateToPem(signingCert); - const intermediatePems = certificates.slice(1).map((cert) => Buffer.from(node_forge_default.pki.certificateToPem(cert))); - const chainValid = await verifyCertificateChain(Buffer.from(certPem), intermediatePems); - if (!chainValid) { - return { status: "unsigned" }; - } - const isSelfSigned = signingCert.issuer.getField("CN")?.value === signingCert.subject.getField("CN")?.value; - return { - status: isSelfSigned ? "self-signed" : "signed", - publisher: signingCert.subject.getField("CN")?.value || "Unknown", - issuer: signingCert.issuer.getField("CN")?.value || "Unknown", - valid_from: signingCert.validity.notBefore.toISOString(), - valid_to: signingCert.validity.notAfter.toISOString(), - fingerprint: node_forge_default.md.sha256.create().update(node_forge_default.asn1.toDer(node_forge_default.pki.certificateToAsn1(signingCert)).getBytes()).digest().toHex() - }; - } catch (error45) { - throw new Error(`Failed to verify MCPB file: ${error45}`); - } -} -function createSignatureBlock(pkcs7Signature) { - const parts = []; - parts.push(Buffer.from(SIGNATURE_HEADER, "utf-8")); - const sigLengthBuffer = Buffer.alloc(4); - sigLengthBuffer.writeUInt32LE(pkcs7Signature.length, 0); - parts.push(sigLengthBuffer); - parts.push(pkcs7Signature); - parts.push(Buffer.from(SIGNATURE_FOOTER, "utf-8")); - return Buffer.concat(parts); -} -function extractSignatureBlock(fileContent) { - const footerBytes = Buffer.from(SIGNATURE_FOOTER, "utf-8"); - const footerIndex = fileContent.lastIndexOf(footerBytes); - if (footerIndex === -1) { - return { originalContent: fileContent }; - } - const headerBytes = Buffer.from(SIGNATURE_HEADER, "utf-8"); - let headerIndex = -1; - for (let i3 = footerIndex - 1;i3 >= 0; i3--) { - if (fileContent.slice(i3, i3 + headerBytes.length).equals(headerBytes)) { - headerIndex = i3; - break; - } - } - if (headerIndex === -1) { - return { originalContent: fileContent }; - } - const originalContent = fileContent.slice(0, headerIndex); - let offset = headerIndex + headerBytes.length; - try { - const sigLength = fileContent.readUInt32LE(offset); - offset += 4; - const pkcs7Signature = fileContent.slice(offset, offset + sigLength); - return { - originalContent, - pkcs7Signature - }; - } catch { - return { originalContent: fileContent }; - } -} -async function verifyCertificateChain(certificate, intermediates) { - let tempDir = null; - try { - tempDir = await mkdtemp(join44(tmpdir3(), "mcpb-verify-")); - const certChainPath = join44(tempDir, "chain.pem"); - const certChain = [certificate, ...intermediates || []].join(` -`); - await writeFile4(certChainPath, certChain); - if (process.platform === "darwin") { - try { - await execFileAsync2("security", [ - "verify-cert", - "-c", - certChainPath, - "-p", - "codeSign" - ]); - return true; - } catch (error45) { - return false; - } - } else if (process.platform === "win32") { - const psCommand = ` - $ErrorActionPreference = 'Stop' - $certCollection = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection - $certCollection.Import('${certChainPath}') - - if ($certCollection.Count -eq 0) { - Write-Error 'No certificates found' - exit 1 - } - - $leafCert = $certCollection[0] - $chain = New-Object System.Security.Cryptography.X509Certificates.X509Chain - - # Enable revocation checking - $chain.ChainPolicy.RevocationMode = 'Online' - $chain.ChainPolicy.RevocationFlag = 'EntireChain' - $chain.ChainPolicy.UrlRetrievalTimeout = New-TimeSpan -Seconds 30 - - # Add code signing application policy - $codeSignOid = New-Object System.Security.Cryptography.Oid '1.3.6.1.5.5.7.3.3' - $chain.ChainPolicy.ApplicationPolicy.Add($codeSignOid) - - # Add intermediate certificates to extra store - for ($i = 1; $i -lt $certCollection.Count; $i++) { - [void]$chain.ChainPolicy.ExtraStore.Add($certCollection[$i]) - } - - # Build and validate chain - $result = $chain.Build($leafCert) - - if ($result) { - 'Valid' - } else { - $chain.ChainStatus | ForEach-Object { - Write-Error "$($_.Status): $($_.StatusInformation)" - } - exit 1 - } - `.trim(); - const { stdout } = await execFileAsync2("powershell.exe", [ - "-NoProfile", - "-NonInteractive", - "-Command", - psCommand - ]); - return stdout.includes("Valid"); - } else { - try { - await execFileAsync2("openssl", [ - "verify", - "-purpose", - "codesigning", - "-CApath", - "/etc/ssl/certs", - certChainPath - ]); - return true; - } catch (error45) { - return false; - } - } - } catch (error45) { - return false; - } finally { - if (tempDir) { - try { - await rm2(tempDir, { recursive: true, force: true }); - } catch {} - } - } -} -function unsignMcpbFile(mcpbPath) { - const fileContent = readFileSync12(mcpbPath); - const { originalContent } = extractSignatureBlock(fileContent); - writeFileSync4(mcpbPath, originalContent); -} -var SIGNATURE_HEADER = "MCPB_SIG_V1", SIGNATURE_FOOTER = "MCPB_SIG_END", execFileAsync2; -var init_sign = __esm(() => { - init_node_forge(); - execFileAsync2 = promisify4(execFile4); -}); - -// ../node_modules/@anthropic-ai/mcpb/dist/shared/log.js -function getLogger({ silent = false } = {}) { - return { - log: (...args) => { - if (!silent) { - console.log(...args); - } - }, - error: (...args) => { - if (!silent) { - console.error(...args); - } - }, - warn: (...args) => { - if (!silent) { - console.warn(...args); - } - }, - info: (...args) => { - if (!silent) { - console.info(...args); - } - }, - debug: (...args) => { - if (!silent) { - console.debug(...args); - } - } - }; -} - -// ../node_modules/@anthropic-ai/mcpb/dist/cli/unpack.js -import { chmodSync as chmodSync3, existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync13, writeFileSync as writeFileSync5 } from "fs"; -import { join as join45, resolve as resolve20, sep as sep11 } from "path"; -async function unpackExtension({ mcpbPath, outputDir, silent }) { - const logger = getLogger({ silent }); - const resolvedMcpbPath = resolve20(mcpbPath); - if (!existsSync8(resolvedMcpbPath)) { - logger.error(`ERROR: MCPB file not found: ${mcpbPath}`); - return false; - } - const finalOutputDir = outputDir ? resolve20(outputDir) : process.cwd(); - if (!existsSync8(finalOutputDir)) { - mkdirSync4(finalOutputDir, { recursive: true }); - } - try { - const fileContent = readFileSync13(resolvedMcpbPath); - const { originalContent } = extractSignatureBlock(fileContent); - const fileAttributes = new Map; - const isUnix = process.platform !== "win32"; - if (isUnix) { - const zipBuffer = originalContent; - let eocdOffset = -1; - for (let i3 = zipBuffer.length - 22;i3 >= 0; i3--) { - if (zipBuffer.readUInt32LE(i3) === 101010256) { - eocdOffset = i3; - break; - } - } - if (eocdOffset !== -1) { - const centralDirOffset = zipBuffer.readUInt32LE(eocdOffset + 16); - const centralDirEntries = zipBuffer.readUInt16LE(eocdOffset + 8); - let offset = centralDirOffset; - for (let i3 = 0;i3 < centralDirEntries; i3++) { - if (zipBuffer.readUInt32LE(offset) === 33639248) { - const externalAttrs = zipBuffer.readUInt32LE(offset + 38); - const filenameLength = zipBuffer.readUInt16LE(offset + 28); - const filename = zipBuffer.toString("utf8", offset + 46, offset + 46 + filenameLength); - const mode = externalAttrs >> 16 & 511; - if (mode > 0) { - fileAttributes.set(filename, mode); - } - const extraFieldLength = zipBuffer.readUInt16LE(offset + 30); - const commentLength = zipBuffer.readUInt16LE(offset + 32); - offset += 46 + filenameLength + extraFieldLength + commentLength; - } else { - break; - } - } - } - } - const decompressed = unzipSync(originalContent); - for (const relativePath in decompressed) { - if (Object.prototype.hasOwnProperty.call(decompressed, relativePath)) { - const data = decompressed[relativePath]; - const fullPath = join45(finalOutputDir, relativePath); - const normalizedPath = resolve20(fullPath); - const normalizedOutputDir = resolve20(finalOutputDir); - if (!normalizedPath.startsWith(normalizedOutputDir + sep11) && normalizedPath !== normalizedOutputDir) { - throw new Error(`Path traversal attempt detected: ${relativePath}`); - } - const dir = join45(fullPath, ".."); - if (!existsSync8(dir)) { - mkdirSync4(dir, { recursive: true }); - } - writeFileSync5(fullPath, data); - if (isUnix && fileAttributes.has(relativePath)) { - try { - const mode = fileAttributes.get(relativePath); - if (mode !== undefined) { - chmodSync3(fullPath, mode); - } - } catch (error45) {} - } - } - } - logger.log(`Extension unpacked successfully to ${finalOutputDir}`); - return true; - } catch (error45) { - if (error45 instanceof Error) { - logger.error(`ERROR: Failed to unpack extension: ${error45.message}`); - } else { - logger.error("ERROR: An unknown error occurred during unpacking."); - } - return false; - } -} -var init_unpack = __esm(() => { - init_esm5(); - init_sign(); -}); - -// ../node_modules/@anthropic-ai/mcpb/dist/schemas-loose.js -var McpServerConfigSchema3, McpbManifestAuthorSchema2, McpbManifestRepositorySchema2, McpbManifestPlatformOverrideSchema2, McpbManifestMcpConfigSchema2, McpbManifestServerSchema2, McpbManifestCompatibilitySchema2, McpbManifestToolSchema2, McpbManifestPromptSchema2, McpbUserConfigurationOptionSchema2, McpbUserConfigValuesSchema2, McpbManifestSchema2, McpbSignatureInfoSchema2; -var init_schemas_loose = __esm(() => { - init_zod(); - McpServerConfigSchema3 = objectType2({ - command: stringType2(), - args: arrayType2(stringType2()).optional(), - env: recordType2(stringType2(), stringType2()).optional() - }); - McpbManifestAuthorSchema2 = objectType2({ - name: stringType2(), - email: stringType2().email().optional(), - url: stringType2().url().optional() - }); - McpbManifestRepositorySchema2 = objectType2({ - type: stringType2(), - url: stringType2().url() - }); - McpbManifestPlatformOverrideSchema2 = McpServerConfigSchema3.partial(); - McpbManifestMcpConfigSchema2 = McpServerConfigSchema3.extend({ - platform_overrides: recordType2(stringType2(), McpbManifestPlatformOverrideSchema2).optional() - }); - McpbManifestServerSchema2 = objectType2({ - type: enumType2(["python", "node", "binary"]), - entry_point: stringType2(), - mcp_config: McpbManifestMcpConfigSchema2 - }); - McpbManifestCompatibilitySchema2 = objectType2({ - claude_desktop: stringType2().optional(), - platforms: arrayType2(enumType2(["darwin", "win32", "linux"])).optional(), - runtimes: objectType2({ - python: stringType2().optional(), - node: stringType2().optional() - }).optional() - }).passthrough(); - McpbManifestToolSchema2 = objectType2({ - name: stringType2(), - description: stringType2().optional() - }); - McpbManifestPromptSchema2 = objectType2({ - name: stringType2(), - description: stringType2().optional(), - arguments: arrayType2(stringType2()).optional(), - text: stringType2() - }); - McpbUserConfigurationOptionSchema2 = objectType2({ - type: enumType2(["string", "number", "boolean", "directory", "file"]), - title: stringType2(), - description: stringType2(), - required: booleanType2().optional(), - default: unionType2([stringType2(), numberType2(), booleanType2(), arrayType2(stringType2())]).optional(), - multiple: booleanType2().optional(), - sensitive: booleanType2().optional(), - min: numberType2().optional(), - max: numberType2().optional() - }); - McpbUserConfigValuesSchema2 = recordType2(stringType2(), unionType2([stringType2(), numberType2(), booleanType2(), arrayType2(stringType2())])); - McpbManifestSchema2 = objectType2({ - $schema: stringType2().optional(), - dxt_version: stringType2().optional().describe("@deprecated Use manifest_version instead"), - manifest_version: stringType2().optional(), - name: stringType2(), - display_name: stringType2().optional(), - version: stringType2(), - description: stringType2(), - long_description: stringType2().optional(), - author: McpbManifestAuthorSchema2, - repository: McpbManifestRepositorySchema2.optional(), - homepage: stringType2().url().optional(), - documentation: stringType2().url().optional(), - support: stringType2().url().optional(), - icon: stringType2().optional(), - screenshots: arrayType2(stringType2()).optional(), - server: McpbManifestServerSchema2, - tools: arrayType2(McpbManifestToolSchema2).optional(), - tools_generated: booleanType2().optional(), - prompts: arrayType2(McpbManifestPromptSchema2).optional(), - prompts_generated: booleanType2().optional(), - keywords: arrayType2(stringType2()).optional(), - license: stringType2().optional(), - compatibility: McpbManifestCompatibilitySchema2.optional(), - user_config: recordType2(stringType2(), McpbUserConfigurationOptionSchema2).optional() - }).refine((data) => !!(data.dxt_version || data.manifest_version), { - message: "Either 'dxt_version' (deprecated) or 'manifest_version' must be provided" - }); - McpbSignatureInfoSchema2 = objectType2({ - status: enumType2(["signed", "unsigned", "self-signed"]), - publisher: stringType2().optional(), - issuer: stringType2().optional(), - valid_from: stringType2().optional(), - valid_to: stringType2().optional(), - fingerprint: stringType2().optional() - }); -}); - -// ../node_modules/@anthropic-ai/mcpb/dist/node/validate.js -import { existsSync as existsSync9, readFileSync as readFileSync14, statSync as statSync8 } from "fs"; -import * as fs7 from "fs/promises"; -import * as os3 from "os"; -import { join as join46, resolve as resolve21 } from "path"; -function validateManifest(inputPath) { - try { - const resolvedPath = resolve21(inputPath); - let manifestPath = resolvedPath; - if (existsSync9(resolvedPath) && statSync8(resolvedPath).isDirectory()) { - manifestPath = join46(resolvedPath, "manifest.json"); - } - const manifestContent = readFileSync14(manifestPath, "utf-8"); - const manifestData = JSON.parse(manifestContent); - const result3 = McpbManifestSchema.safeParse(manifestData); - if (result3.success) { - console.log("Manifest schema validation passes!"); - return true; - } else { - console.log(`ERROR: Manifest validation failed: -`); - result3.error.issues.forEach((issue2) => { - const path16 = issue2.path.join("."); - console.log(` - ${path16 ? `${path16}: ` : ""}${issue2.message}`); - }); - return false; - } - } catch (error45) { - if (error45 instanceof Error) { - if (error45.message.includes("ENOENT")) { - console.error(`ERROR: File not found: ${inputPath}`); - if (existsSync9(resolve21(inputPath)) && statSync8(resolve21(inputPath)).isDirectory()) { - console.error(` (No manifest.json found in directory)`); - } - } else if (error45.message.includes("JSON")) { - console.error(`ERROR: Invalid JSON in manifest file: ${error45.message}`); - } else { - console.error(`ERROR: Error reading manifest: ${error45.message}`); - } - } else { - console.error("ERROR: Unknown error occurred"); - } - return false; - } -} -async function cleanMcpb(inputPath) { - const tmpDir = await fs7.mkdtemp(resolve21(os3.tmpdir(), "mcpb-clean-")); - const mcpbPath = resolve21(tmpDir, "in.mcpb"); - const unpackPath = resolve21(tmpDir, "out"); - console.log(" -- Cleaning MCPB..."); - try { - await fs7.copyFile(inputPath, mcpbPath); - console.log(" -- Unpacking MCPB..."); - await unpackExtension({ mcpbPath, silent: true, outputDir: unpackPath }); - const manifestPath = resolve21(unpackPath, "manifest.json"); - const originalManifest = await fs7.readFile(manifestPath, "utf-8"); - const manifestData = JSON.parse(originalManifest); - const result3 = McpbManifestSchema2.safeParse(manifestData); - if (!result3.success) { - throw new Error(`Unrecoverable manifest issues, please run "mcpb validate"`); - } - await fs7.writeFile(manifestPath, JSON.stringify(result3.data, null, 2)); - if (originalManifest.trim() !== (await fs7.readFile(manifestPath, "utf8")).trim()) { - console.log(" -- Update manifest to be valid per MCPB schema"); - } else { - console.log(" -- Manifest already valid per MCPB schema"); - } - const nodeModulesPath = resolve21(unpackPath, "node_modules"); - if (existsSync9(nodeModulesPath)) { - console.log(" -- node_modules found, deleting development dependencies"); - const destroyer = new DestroyerOfModules2({ - rootDirectory: unpackPath - }); - try { - await destroyer.destroy(); - } catch (error45) { - if (error45 instanceof Error && error45.message.includes("Failed to locate module")) { - console.log(" -- Some modules already removed, skipping remaining cleanup"); - } else { - throw error45; - } - } - console.log(" -- Removed development dependencies from node_modules"); - } else { - console.log(" -- No node_modules, not pruning"); - } - const before3 = await fs7.stat(inputPath); - const { packExtension } = await Promise.resolve().then(() => (init_pack(), exports_pack)); - await packExtension({ - extensionPath: unpackPath, - outputPath: inputPath, - silent: true - }); - const after3 = await fs7.stat(inputPath); - console.log(` -Clean Complete:`); - console.log("Before:", pretty_bytes_default(before3.size)); - console.log("After:", pretty_bytes_default(after3.size)); - } finally { - await fs7.rm(tmpDir, { - recursive: true, - force: true - }); - } -} -var init_validate3 = __esm(() => { - init_galactus(); - init_pretty_bytes(); - init_unpack(); - init_schemas5(); - init_schemas_loose(); -}); - -// ../node_modules/@anthropic-ai/mcpb/dist/cli/pack.js -var exports_pack = {}; -__export(exports_pack, { - packExtension: () => packExtension -}); -import { createHash as createHash3 } from "crypto"; -import { existsSync as existsSync10, mkdirSync as mkdirSync5, readFileSync as readFileSync15, statSync as statSync9, writeFileSync as writeFileSync6 } from "fs"; -import { basename as basename9, join as join47, relative as relative7, resolve as resolve22, sep as sep12 } from "path"; -function formatFileSize2(bytes) { - if (bytes < 1024) { - return `${bytes}B`; - } else if (bytes < 1024 * 1024) { - return `${(bytes / 1024).toFixed(1)}kB`; - } else { - return `${(bytes / (1024 * 1024)).toFixed(1)}MB`; - } -} -function sanitizeNameForFilename(name) { - return name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_.]/g, "").replace(/-+/g, "-").replace(/^-+|-+$/g, "").substring(0, 100); -} -async function packExtension({ extensionPath, outputPath, silent }) { - const resolvedPath = resolve22(extensionPath); - const logger = getLogger({ silent }); - if (!existsSync10(resolvedPath) || !statSync9(resolvedPath).isDirectory()) { - logger.error(`ERROR: Directory not found: ${extensionPath}`); - return false; - } - const manifestPath = join47(resolvedPath, "manifest.json"); - if (!existsSync10(manifestPath)) { - logger.log(`No manifest.json found in ${extensionPath}`); - const shouldInit = await confirm2({ - message: "Would you like to create a manifest.json file?", - default: true - }); - if (shouldInit) { - const success2 = await initExtension(extensionPath); - if (!success2) { - logger.error("ERROR: Failed to create manifest"); - return false; - } - } else { - logger.error("ERROR: Cannot pack extension without manifest.json"); - return false; - } - } - logger.log("Validating manifest..."); - if (!validateManifest(manifestPath)) { - logger.error("ERROR: Cannot pack extension with invalid manifest"); - return false; - } - let manifest; - try { - const manifestContent = readFileSync15(manifestPath, "utf-8"); - const manifestData = JSON.parse(manifestContent); - manifest = McpbManifestSchema.parse(manifestData); - } catch (error45) { - logger.error("ERROR: Failed to parse manifest.json"); - if (error45 instanceof Error) { - logger.error(` ${error45.message}`); - } - return false; - } - const manifestVersion = manifest.manifest_version || manifest.dxt_version; - if (manifestVersion !== CURRENT_MANIFEST_VERSION) { - logger.error(`ERROR: Manifest version mismatch. Expected "${CURRENT_MANIFEST_VERSION}", found "${manifestVersion}"`); - logger.error(` Please update the manifest_version in your manifest.json to "${CURRENT_MANIFEST_VERSION}"`); - return false; - } - const extensionName = basename9(resolvedPath); - const finalOutputPath = outputPath ? resolve22(outputPath) : resolve22(`${extensionName}.mcpb`); - const outputDir = join47(finalOutputPath, ".."); - mkdirSync5(outputDir, { recursive: true }); - try { - const mcpbIgnorePatterns = readMcpbIgnorePatterns(resolvedPath); - const { files, ignoredCount } = getAllFilesWithCount(resolvedPath, resolvedPath, {}, mcpbIgnorePatterns); - logger.log(` -\uD83D\uDCE6 ${manifest.name}@${manifest.version}`); - logger.log("Archive Contents"); - const fileEntries = Object.entries(files); - let totalUnpackedSize = 0; - fileEntries.sort(([a2], [b]) => a2.localeCompare(b)); - const directoryGroups = new Map; - const shallowFiles = []; - for (const [filePath, fileData] of fileEntries) { - const relPath = relative7(resolvedPath, filePath); - const content = fileData.data; - const size3 = typeof content === "string" ? Buffer.byteLength(content, "utf8") : content.length; - totalUnpackedSize += size3; - const parts = relPath.split(sep12); - if (parts.length > 3) { - const groupKey = parts.slice(0, 3).join("/"); - if (!directoryGroups.has(groupKey)) { - directoryGroups.set(groupKey, { files: [], totalSize: 0 }); - } - const group = directoryGroups.get(groupKey); - group.files.push(relPath); - group.totalSize += size3; - } else { - shallowFiles.push({ path: relPath, size: size3 }); - } - } - for (const { path: path16, size: size3 } of shallowFiles) { - logger.log(`${formatFileSize2(size3).padStart(8)} ${path16}`); - } - for (const [dir, { files: files2, totalSize }] of directoryGroups) { - if (files2.length === 1) { - const filePath = files2[0]; - const fileSize = totalSize; - logger.log(`${formatFileSize2(fileSize).padStart(8)} ${filePath}`); - } else { - logger.log(`${formatFileSize2(totalSize).padStart(8)} ${dir}/ [and ${files2.length} more files]`); - } - } - const zipFiles = {}; - const isUnix = process.platform !== "win32"; - for (const [filePath, fileData] of Object.entries(files)) { - if (isUnix) { - zipFiles[filePath] = [ - fileData.data, - { os: 3, attrs: (fileData.mode & 511) << 16 } - ]; - } else { - zipFiles[filePath] = fileData.data; - } - } - const zipData = zipSync(zipFiles, { - level: 9, - mtime: new Date - }); - writeFileSync6(finalOutputPath, zipData); - const shasum = createHash3("sha1").update(zipData).digest("hex"); - const sanitizedName = sanitizeNameForFilename(manifest.name); - const archiveName = `${sanitizedName}-${manifest.version}.mcpb`; - logger.log(` -Archive Details`); - logger.log(`name: ${manifest.name}`); - logger.log(`version: ${manifest.version}`); - logger.log(`filename: ${archiveName}`); - logger.log(`package size: ${formatFileSize2(zipData.length)}`); - logger.log(`unpacked size: ${formatFileSize2(totalUnpackedSize)}`); - logger.log(`shasum: ${shasum}`); - logger.log(`total files: ${fileEntries.length}`); - logger.log(`ignored (.mcpbignore) files: ${ignoredCount}`); - logger.log(` -Output: ${finalOutputPath}`); - return true; - } catch (error45) { - if (error45 instanceof Error) { - logger.error(`ERROR: Archive error: ${error45.message}`); - } else { - logger.error("ERROR: Unknown archive error occurred"); - } - return false; - } -} -var init_pack = __esm(() => { - init_prompts(); - init_esm5(); - init_files4(); - init_validate3(); - init_schemas5(); - init_init(); -}); - -// ../node_modules/@anthropic-ai/mcpb/dist/shared/config.js -function replaceVariables(value, variables) { - if (typeof value === "string") { - let result3 = value; - for (const [key, replacement] of Object.entries(variables)) { - const pattern = new RegExp(`\\$\\{${key}\\}`, "g"); - if (result3.match(pattern)) { - if (Array.isArray(replacement)) { - console.warn(`Cannot replace ${key} with array value in string context: "${value}"`, { key, replacement }); - } else { - result3 = result3.replace(pattern, replacement); - } - } - } - return result3; - } else if (Array.isArray(value)) { - const result3 = []; - for (const item of value) { - if (typeof item === "string" && item.match(/^\$\{user_config\.[^}]+\}$/)) { - const varName = item.match(/^\$\{([^}]+)\}$/)?.[1]; - if (varName && variables[varName]) { - const replacement = variables[varName]; - if (Array.isArray(replacement)) { - result3.push(...replacement); - } else { - result3.push(replacement); - } - } else { - result3.push(item); - } - } else { - result3.push(replaceVariables(item, variables)); - } - } - return result3; - } else if (value && typeof value === "object") { - const result3 = {}; - for (const [key, val] of Object.entries(value)) { - result3[key] = replaceVariables(val, variables); - } - return result3; - } - return value; -} -async function getMcpConfigForManifest(options2) { - const { manifest, extensionPath, systemDirs, userConfig, pathSeparator, logger } = options2; - const baseConfig = manifest.server?.mcp_config; - if (!baseConfig) { - return; - } - let result3 = { - ...baseConfig - }; - if (baseConfig.platform_overrides) { - if (process.platform in baseConfig.platform_overrides) { - const platformConfig = baseConfig.platform_overrides[process.platform]; - result3.command = platformConfig.command || result3.command; - result3.args = platformConfig.args || result3.args; - result3.env = platformConfig.env || result3.env; - } - } - if (hasRequiredConfigMissing({ manifest, userConfig })) { - logger?.warn(`Extension ${manifest.name} has missing required configuration, skipping MCP config`); - return; - } - const variables = { - __dirname: extensionPath, - pathSeparator, - "/": pathSeparator, - ...systemDirs - }; - const mergedConfig = {}; - if (manifest.user_config) { - for (const [key, configOption] of Object.entries(manifest.user_config)) { - if (configOption.default !== undefined) { - mergedConfig[key] = configOption.default; - } - } - } - if (userConfig) { - Object.assign(mergedConfig, userConfig); - } - for (const [key, value] of Object.entries(mergedConfig)) { - const userConfigKey = `user_config.${key}`; - if (Array.isArray(value)) { - variables[userConfigKey] = value.map(String); - } else if (typeof value === "boolean") { - variables[userConfigKey] = value ? "true" : "false"; - } else { - variables[userConfigKey] = String(value); - } - } - result3 = replaceVariables(result3, variables); - return result3; -} -function isInvalidSingleValue(value) { - return value === undefined || value === null || value === ""; -} -function hasRequiredConfigMissing({ manifest, userConfig }) { - if (!manifest.user_config) { - return false; - } - const config3 = userConfig || {}; - for (const [key, configOption] of Object.entries(manifest.user_config)) { - if (configOption.required) { - const value = config3[key]; - if (isInvalidSingleValue(value) || Array.isArray(value) && (value.length === 0 || value.some(isInvalidSingleValue))) { - return true; - } - } - } - return false; -} - -// stub-missing:/Users/chenqg/Downloads/node_modules/@anthropic-ai/mcpb/dist/types.js -var __stub__2 = true; -var init_types7 = () => {}; - -// ../node_modules/@anthropic-ai/mcpb/dist/index.js -var exports_dist = {}; -__export(exports_dist, { - verifyMcpbFile: () => verifyMcpbFile, - verifyCertificateChain: () => verifyCertificateChain, - validateManifest: () => validateManifest, - unsignMcpbFile: () => unsignMcpbFile, - unpackExtension: () => unpackExtension, - signMcpbFile: () => signMcpbFile, - shouldExclude: () => shouldExclude, - replaceVariables: () => replaceVariables, - readPackageJson: () => readPackageJson, - readMcpbIgnorePatterns: () => readMcpbIgnorePatterns, - promptVisualAssets: () => promptVisualAssets, - promptUserConfig: () => promptUserConfig, - promptUrls: () => promptUrls, - promptTools: () => promptTools, - promptServerConfig: () => promptServerConfig, - promptPrompts: () => promptPrompts, - promptOptionalFields: () => promptOptionalFields, - promptLongDescription: () => promptLongDescription, - promptCompatibility: () => promptCompatibility, - promptBasicInfo: () => promptBasicInfo, - promptAuthorInfo: () => promptAuthorInfo, - printNextSteps: () => printNextSteps, - packExtension: () => packExtension, - initExtension: () => initExtension, - hasRequiredConfigMissing: () => hasRequiredConfigMissing, - getMcpConfigForManifest: () => getMcpConfigForManifest, - getDefaultServerConfig: () => getDefaultServerConfig, - getDefaultRepositoryUrl: () => getDefaultRepositoryUrl, - getDefaultOptionalFields: () => getDefaultOptionalFields, - getDefaultEntryPoint: () => getDefaultEntryPoint, - getDefaultBasicInfo: () => getDefaultBasicInfo, - getDefaultAuthorUrl: () => getDefaultAuthorUrl, - getDefaultAuthorName: () => getDefaultAuthorName, - getDefaultAuthorInfo: () => getDefaultAuthorInfo, - getDefaultAuthorEmail: () => getDefaultAuthorEmail, - getAllFilesWithCount: () => getAllFilesWithCount, - getAllFiles: () => getAllFiles, - extractSignatureBlock: () => extractSignatureBlock, - createMcpConfig: () => createMcpConfig, - cleanMcpb: () => cleanMcpb, - buildManifest: () => buildManifest, - __stub__: () => __stub__2, - McpbUserConfigurationOptionSchema: () => McpbUserConfigurationOptionSchema, - McpbUserConfigValuesSchema: () => McpbUserConfigValuesSchema, - McpbSignatureInfoSchema: () => McpbSignatureInfoSchema, - McpbManifestToolSchema: () => McpbManifestToolSchema, - McpbManifestServerSchema: () => McpbManifestServerSchema, - McpbManifestSchema: () => McpbManifestSchema, - McpbManifestRepositorySchema: () => McpbManifestRepositorySchema, - McpbManifestPromptSchema: () => McpbManifestPromptSchema, - McpbManifestPlatformOverrideSchema: () => McpbManifestPlatformOverrideSchema, - McpbManifestMcpConfigSchema: () => McpbManifestMcpConfigSchema, - McpbManifestCompatibilitySchema: () => McpbManifestCompatibilitySchema, - McpbManifestAuthorSchema: () => McpbManifestAuthorSchema, - McpServerConfigSchema: () => McpServerConfigSchema2, - EXCLUDE_PATTERNS: () => EXCLUDE_PATTERNS, - CURRENT_MANIFEST_VERSION: () => CURRENT_MANIFEST_VERSION -}); -var init_dist7 = __esm(() => { - init_init(); - init_pack(); - init_unpack(); - init_files4(); - init_sign(); - init_validate3(); - init_schemas5(); - init_types7(); -}); - -// src/utils/dxt/helpers.ts -async function validateManifest2(manifestJson) { - const { McpbManifestSchema: McpbManifestSchema3 } = await Promise.resolve().then(() => (init_dist7(), exports_dist)); - const parseResult = McpbManifestSchema3.safeParse(manifestJson); - if (!parseResult.success) { - const errors5 = parseResult.error.flatten(); - const errorMessages2 = [ - ...Object.entries(errors5.fieldErrors).map(([field, errs]) => `${field}: ${errs?.join(", ")}`), - ...errors5.formErrors || [] - ].filter(Boolean).join("; "); - throw new Error(`Invalid manifest: ${errorMessages2}`); - } - return parseResult.data; -} -async function parseAndValidateManifestFromText(manifestText) { - let manifestJson; - try { - manifestJson = jsonParse(manifestText); - } catch (error45) { - throw new Error(`Invalid JSON in manifest.json: ${errorMessage(error45)}`); - } - return validateManifest2(manifestJson); -} -async function parseAndValidateManifestFromBytes(manifestData) { - const manifestText = new TextDecoder().decode(manifestData); - return parseAndValidateManifestFromText(manifestText); -} -var init_helpers = __esm(() => { - init_errors(); - init_slowOperations(); -}); - -// node_modules/fflate/esm/index.mjs -var exports_esm2 = {}; -__export(exports_esm2, { - zlibSync: () => zlibSync, - zlib: () => zlib2, - zipSync: () => zipSync2, - zip: () => zip3, - unzlibSync: () => unzlibSync, - unzlib: () => unzlib, - unzipSync: () => unzipSync2, - unzip: () => unzip3, - strToU8: () => strToU82, - strFromU8: () => strFromU82, - inflateSync: () => inflateSync2, - inflate: () => inflate, - gzipSync: () => gzipSync, - gzip: () => gzip, - gunzipSync: () => gunzipSync, - gunzip: () => gunzip, - deflateSync: () => deflateSync2, - deflate: () => deflate, - decompressSync: () => decompressSync, - decompress: () => decompress, - compressSync: () => gzipSync, - compress: () => gzip, - Zlib: () => Zlib, - ZipPassThrough: () => ZipPassThrough, - ZipDeflate: () => ZipDeflate, - Zip: () => Zip, - Unzlib: () => Unzlib, - UnzipPassThrough: () => UnzipPassThrough, - UnzipInflate: () => UnzipInflate, - Unzip: () => Unzip, - Inflate: () => Inflate, - Gzip: () => Gzip, - Gunzip: () => Gunzip, - FlateErrorCode: () => FlateErrorCode, - EncodeUTF8: () => EncodeUTF8, - Deflate: () => Deflate, - Decompress: () => Decompress, - DecodeUTF8: () => DecodeUTF8, - Compress: () => Gzip, - AsyncZlib: () => AsyncZlib, - AsyncZipDeflate: () => AsyncZipDeflate, - AsyncUnzlib: () => AsyncUnzlib, - AsyncUnzipInflate: () => AsyncUnzipInflate, - AsyncInflate: () => AsyncInflate, - AsyncGzip: () => AsyncGzip, - AsyncGunzip: () => AsyncGunzip, - AsyncDeflate: () => AsyncDeflate, - AsyncDecompress: () => AsyncDecompress, - AsyncCompress: () => AsyncGzip -}); -import { createRequire as createRequire3 } from "module"; -function StrmOpt(opts, cb) { - if (typeof opts == "function") - cb = opts, opts = {}; - this.ondata = cb; - return opts; -} -function deflate(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - return cbify(data, opts, [ - bDflt - ], function(ev) { - return pbf(deflateSync2(ev.data[0], ev.data[1])); - }, 0, cb); -} -function deflateSync2(data, opts) { - return dopt2(data, opts || {}, 0, 0); -} -function inflate(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - return cbify(data, opts, [ - bInflt - ], function(ev) { - return pbf(inflateSync2(ev.data[0], gopt(ev.data[1]))); - }, 1, cb); -} -function inflateSync2(data, opts) { - return inflt2(data, { i: 2 }, opts && opts.out, opts && opts.dictionary); -} -function gzip(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - return cbify(data, opts, [ - bDflt, - gze, - function() { - return [gzipSync]; - } - ], function(ev) { - return pbf(gzipSync(ev.data[0], ev.data[1])); - }, 2, cb); -} -function gzipSync(data, opts) { - if (!opts) - opts = {}; - var c6 = crc2(), l = data.length; - c6.p(data); - var d = dopt2(data, opts, gzhl(opts), 8), s = d.length; - return gzh(d, opts), wbytes2(d, s - 8, c6.d()), wbytes2(d, s - 4, l), d; -} -function gunzip(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - return cbify(data, opts, [ - bInflt, - guze, - function() { - return [gunzipSync]; - } - ], function(ev) { - return pbf(gunzipSync(ev.data[0], ev.data[1])); - }, 3, cb); -} -function gunzipSync(data, opts) { - var st = gzs(data); - if (st + 8 > data.length) - err2(6, "invalid gzip data"); - return inflt2(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u82(gzl(data)), opts && opts.dictionary); -} -function zlib2(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - return cbify(data, opts, [ - bDflt, - zle, - function() { - return [zlibSync]; - } - ], function(ev) { - return pbf(zlibSync(ev.data[0], ev.data[1])); - }, 4, cb); -} -function zlibSync(data, opts) { - if (!opts) - opts = {}; - var a2 = adler(); - a2.p(data); - var d = dopt2(data, opts, opts.dictionary ? 6 : 2, 4); - return zlh(d, opts), wbytes2(d, d.length - 4, a2.d()), d; -} -function unzlib(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - return cbify(data, opts, [ - bInflt, - zule, - function() { - return [unzlibSync]; - } - ], function(ev) { - return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); - }, 5, cb); -} -function unzlibSync(data, opts) { - return inflt2(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary); -} -function decompress(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzip(data, opts, cb) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflate(data, opts, cb) : unzlib(data, opts, cb); -} -function decompressSync(data, opts) { - return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzipSync(data, opts) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflateSync2(data, opts) : unzlibSync(data, opts); -} -function strToU82(str, latin1) { - if (latin1) { - var ar_1 = new u82(str.length); - for (var i4 = 0;i4 < str.length; ++i4) - ar_1[i4] = str.charCodeAt(i4); - return ar_1; - } - if (te2) - return te2.encode(str); - var l = str.length; - var ar = new u82(str.length + (str.length >> 1)); - var ai = 0; - var w = function(v) { - ar[ai++] = v; - }; - for (var i4 = 0;i4 < l; ++i4) { - if (ai + 5 > ar.length) { - var n2 = new u82(ai + 8 + (l - i4 << 1)); - n2.set(ar); - ar = n2; - } - var c6 = str.charCodeAt(i4); - if (c6 < 128 || latin1) - w(c6); - else if (c6 < 2048) - w(192 | c6 >> 6), w(128 | c6 & 63); - else if (c6 > 55295 && c6 < 57344) - c6 = 65536 + (c6 & 1023 << 10) | str.charCodeAt(++i4) & 1023, w(240 | c6 >> 18), w(128 | c6 >> 12 & 63), w(128 | c6 >> 6 & 63), w(128 | c6 & 63); - else - w(224 | c6 >> 12), w(128 | c6 >> 6 & 63), w(128 | c6 & 63); - } - return slc2(ar, 0, ai); -} -function strFromU82(dat, latin1) { - if (latin1) { - var r = ""; - for (var i4 = 0;i4 < dat.length; i4 += 16384) - r += String.fromCharCode.apply(null, dat.subarray(i4, i4 + 16384)); - return r; - } else if (td2) { - return td2.decode(dat); - } else { - var _a5 = dutf82(dat), s = _a5.s, r = _a5.r; - if (r.length) - err2(8); - return s; - } -} -function zip3(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - var r = {}; - fltn2(data, "", r, opts); - var k = Object.keys(r); - var lft = k.length, o2 = 0, tot = 0; - var slft = lft, files2 = new Array(lft); - var term = []; - var tAll = function() { - for (var i5 = 0;i5 < term.length; ++i5) - term[i5](); - }; - var cbd = function(a2, b) { - mt(function() { - cb(a2, b); - }); - }; - mt(function() { - cbd = cb; - }); - var cbf = function() { - var out = new u82(tot + 22), oe = o2, cdl = tot - o2; - tot = 0; - for (var i5 = 0;i5 < slft; ++i5) { - var f = files2[i5]; - try { - var l = f.c.length; - wzh2(out, tot, f, f.f, f.u, l); - var badd = 30 + f.f.length + exfl2(f.extra); - var loc = tot + badd; - out.set(f.c, loc); - wzh2(out, o2, f, f.f, f.u, l, tot, f.m), o2 += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l; - } catch (e) { - return cbd(e, null); - } - } - wzf2(out, o2, files2.length, cdl, oe); - cbd(null, out); - }; - if (!lft) - cbf(); - var _loop_1 = function(i5) { - var fn = k[i5]; - var _a5 = r[fn], file2 = _a5[0], p = _a5[1]; - var c6 = crc2(), size3 = file2.length; - c6.p(file2); - var f = strToU82(fn), s = f.length; - var com = p.comment, m = com && strToU82(com), ms = m && m.length; - var exl = exfl2(p.extra); - var compression = p.level == 0 ? 0 : 8; - var cbl = function(e, d) { - if (e) { - tAll(); - cbd(e, null); - } else { - var l = d.length; - files2[i5] = mrg2(p, { - size: size3, - crc: c6.d(), - c: d, - f, - m, - u: s != fn.length || m && com.length != ms, - compression - }); - o2 += 30 + s + exl + l; - tot += 76 + 2 * (s + exl) + (ms || 0) + l; - if (!--lft) - cbf(); - } - }; - if (s > 65535) - cbl(err2(11, 0, 1), null); - if (!compression) - cbl(null, file2); - else if (size3 < 160000) { - try { - cbl(null, deflateSync2(file2, p)); - } catch (e) { - cbl(e, null); - } - } else - term.push(deflate(file2, p, cbl)); - }; - for (var i4 = 0;i4 < slft; ++i4) { - _loop_1(i4); - } - return tAll; -} -function zipSync2(data, opts) { - if (!opts) - opts = {}; - var r = {}; - var files2 = []; - fltn2(data, "", r, opts); - var o2 = 0; - var tot = 0; - for (var fn in r) { - var _a5 = r[fn], file2 = _a5[0], p = _a5[1]; - var compression = p.level == 0 ? 0 : 8; - var f = strToU82(fn), s = f.length; - var com = p.comment, m = com && strToU82(com), ms = m && m.length; - var exl = exfl2(p.extra); - if (s > 65535) - err2(11); - var d = compression ? deflateSync2(file2, p) : file2, l = d.length; - var c6 = crc2(); - c6.p(file2); - files2.push(mrg2(p, { - size: file2.length, - crc: c6.d(), - c: d, - f, - m, - u: s != fn.length || m && com.length != ms, - o: o2, - compression - })); - o2 += 30 + s + exl + l; - tot += 76 + 2 * (s + exl) + (ms || 0) + l; - } - var out = new u82(tot + 22), oe = o2, cdl = tot - o2; - for (var i4 = 0;i4 < files2.length; ++i4) { - var f = files2[i4]; - wzh2(out, f.o, f, f.f, f.u, f.c.length); - var badd = 30 + f.f.length + exfl2(f.extra); - out.set(f.c, f.o + badd); - wzh2(out, o2, f, f.f, f.u, f.c.length, f.o, f.m), o2 += 16 + badd + (f.m ? f.m.length : 0); - } - wzf2(out, o2, files2.length, cdl, oe); - return out; -} -function unzip3(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err2(7); - var term = []; - var tAll = function() { - for (var i5 = 0;i5 < term.length; ++i5) - term[i5](); - }; - var files2 = {}; - var cbd = function(a2, b) { - mt(function() { - cb(a2, b); - }); - }; - mt(function() { - cbd = cb; - }); - var e = data.length - 22; - for (;b42(data, e) != 101010256; --e) { - if (!e || data.length - e > 65558) { - cbd(err2(13, 0, 1), null); - return tAll; - } - } - var lft = b22(data, e + 8); - if (lft) { - var c6 = lft; - var o2 = b42(data, e + 16); - var z2 = o2 == 4294967295 || c6 == 65535; - if (z2) { - var ze = b42(data, e - 12); - z2 = b42(data, ze) == 101075792; - if (z2) { - c6 = lft = b42(data, ze + 32); - o2 = b42(data, ze + 48); - } - } - var fltr = opts && opts.filter; - var _loop_3 = function(i5) { - var _a5 = zh2(data, o2, z2), c_1 = _a5[0], sc = _a5[1], su = _a5[2], fn = _a5[3], no = _a5[4], off = _a5[5], b = slzh2(data, off); - o2 = no; - var cbl = function(e2, d) { - if (e2) { - tAll(); - cbd(e2, null); - } else { - if (d) - files2[fn] = d; - if (!--lft) - cbd(null, files2); - } - }; - if (!fltr || fltr({ - name: fn, - size: sc, - originalSize: su, - compression: c_1 - })) { - if (!c_1) - cbl(null, slc2(data, b, b + sc)); - else if (c_1 == 8) { - var infl = data.subarray(b, b + sc); - if (su < 524288 || sc > 0.8 * su) { - try { - cbl(null, inflateSync2(infl, { out: new u82(su) })); - } catch (e2) { - cbl(e2, null); - } - } else - term.push(inflate(infl, { size: su }, cbl)); - } else - cbl(err2(14, "unknown compression type " + c_1, 1), null); - } else - cbl(null, null); - }; - for (var i4 = 0;i4 < c6; ++i4) { - _loop_3(i4); - } - } else - cbd(null, {}); - return tAll; -} -function unzipSync2(data, opts) { - var files2 = {}; - var e = data.length - 22; - for (;b42(data, e) != 101010256; --e) { - if (!e || data.length - e > 65558) - err2(13); - } - var c6 = b22(data, e + 8); - if (!c6) - return {}; - var o2 = b42(data, e + 16); - var z2 = o2 == 4294967295 || c6 == 65535; - if (z2) { - var ze = b42(data, e - 12); - z2 = b42(data, ze) == 101075792; - if (z2) { - c6 = b42(data, ze + 32); - o2 = b42(data, ze + 48); - } - } - var fltr = opts && opts.filter; - for (var i4 = 0;i4 < c6; ++i4) { - var _a5 = zh2(data, o2, z2), c_2 = _a5[0], sc = _a5[1], su = _a5[2], fn = _a5[3], no = _a5[4], off = _a5[5], b = slzh2(data, off); - o2 = no; - if (!fltr || fltr({ - name: fn, - size: sc, - originalSize: su, - compression: c_2 - })) { - if (!c_2) - files2[fn] = slc2(data, b, b + sc); - else if (c_2 == 8) - files2[fn] = inflateSync2(data.subarray(b, b + sc), { out: new u82(su) }); - else - err2(14, "unknown compression type " + c_2); - } - } - return files2; -} -var require3, Worker2, workerAdd = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global", wk, u82, u162, i322, fleb2, fdeb2, clim2, freb2 = function(eb, start) { - var b = new u162(31); - for (var i3 = 0;i3 < 31; ++i3) { - b[i3] = start += 1 << eb[i3 - 1]; - } - var r = new i322(b[30]); - for (var i3 = 1;i3 < 30; ++i3) { - for (var j = b[i3];j < b[i3 + 1]; ++j) { - r[j] = j - b[i3] << 5 | i3; - } - } - return { b, r }; -}, _a4, fl2, revfl2, _b2, fd2, revfd2, rev2, x3, i3, hMap2 = function(cd, mb, r) { - var s = cd.length; - var i4 = 0; - var l = new u162(mb); - for (;i4 < s; ++i4) { - if (cd[i4]) - ++l[cd[i4] - 1]; - } - var le = new u162(mb); - for (i4 = 1;i4 < mb; ++i4) { - le[i4] = le[i4 - 1] + l[i4 - 1] << 1; - } - var co; - if (r) { - co = new u162(1 << mb); - var rvb = 15 - mb; - for (i4 = 0;i4 < s; ++i4) { - if (cd[i4]) { - var sv = i4 << 4 | cd[i4]; - var r_1 = mb - cd[i4]; - var v = le[cd[i4] - 1]++ << r_1; - for (var m = v | (1 << r_1) - 1;v <= m; ++v) { - co[rev2[v] >> rvb] = sv; - } - } - } - } else { - co = new u162(s); - for (i4 = 0;i4 < s; ++i4) { - if (cd[i4]) { - co[i4] = rev2[le[cd[i4] - 1]++] >> 15 - cd[i4]; - } - } - } - return co; -}, flt2, i3, i3, i3, i3, fdt2, i3, flm2, flrm2, fdm2, fdrm2, max4 = function(a2) { - var m = a2[0]; - for (var i4 = 1;i4 < a2.length; ++i4) { - if (a2[i4] > m) - m = a2[i4]; - } - return m; -}, bits2 = function(d, p, m) { - var o2 = p / 8 | 0; - return (d[o2] | d[o2 + 1] << 8) >> (p & 7) & m; -}, bits162 = function(d, p) { - var o2 = p / 8 | 0; - return (d[o2] | d[o2 + 1] << 8 | d[o2 + 2] << 16) >> (p & 7); -}, shft2 = function(p) { - return (p + 7) / 8 | 0; -}, slc2 = function(v, s, e) { - if (s == null || s < 0) - s = 0; - if (e == null || e > v.length) - e = v.length; - return new u82(v.subarray(s, e)); -}, FlateErrorCode, ec2, err2 = function(ind, msg, nt) { - var e = new Error(msg || ec2[ind]); - e.code = ind; - if (Error.captureStackTrace) - Error.captureStackTrace(e, err2); - if (!nt) - throw e; - return e; -}, inflt2 = function(dat, st, buf, dict) { - var sl = dat.length, dl = dict ? dict.length : 0; - if (!sl || st.f && !st.l) - return buf || new u82(0); - var noBuf = !buf; - var resize = noBuf || st.i != 2; - var noSt = st.i; - if (noBuf) - buf = new u82(sl * 3); - var cbuf = function(l2) { - var bl = buf.length; - if (l2 > bl) { - var nbuf = new u82(Math.max(bl * 2, l2)); - nbuf.set(buf); - buf = nbuf; - } - }; - var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n; - var tbts = sl * 8; - do { - if (!lm) { - final = bits2(dat, pos, 1); - var type = bits2(dat, pos + 1, 3); - pos += 3; - if (!type) { - var s = shft2(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l; - if (t > sl) { - if (noSt) - err2(0); - break; - } - if (resize) - cbuf(bt + l); - buf.set(dat.subarray(s, t), bt); - st.b = bt += l, st.p = pos = t * 8, st.f = final; - continue; - } else if (type == 1) - lm = flrm2, dm = fdrm2, lbt = 9, dbt = 5; - else if (type == 2) { - var hLit = bits2(dat, pos, 31) + 257, hcLen = bits2(dat, pos + 10, 15) + 4; - var tl = hLit + bits2(dat, pos + 5, 31) + 1; - pos += 14; - var ldt = new u82(tl); - var clt = new u82(19); - for (var i4 = 0;i4 < hcLen; ++i4) { - clt[clim2[i4]] = bits2(dat, pos + i4 * 3, 7); - } - pos += hcLen * 3; - var clb = max4(clt), clbmsk = (1 << clb) - 1; - var clm = hMap2(clt, clb, 1); - for (var i4 = 0;i4 < tl; ) { - var r = clm[bits2(dat, pos, clbmsk)]; - pos += r & 15; - var s = r >> 4; - if (s < 16) { - ldt[i4++] = s; - } else { - var c6 = 0, n2 = 0; - if (s == 16) - n2 = 3 + bits2(dat, pos, 3), pos += 2, c6 = ldt[i4 - 1]; - else if (s == 17) - n2 = 3 + bits2(dat, pos, 7), pos += 3; - else if (s == 18) - n2 = 11 + bits2(dat, pos, 127), pos += 7; - while (n2--) - ldt[i4++] = c6; - } - } - var lt4 = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); - lbt = max4(lt4); - dbt = max4(dt); - lm = hMap2(lt4, lbt, 1); - dm = hMap2(dt, dbt, 1); - } else - err2(1); - if (pos > tbts) { - if (noSt) - err2(0); - break; - } - } - if (resize) - cbuf(bt + 131072); - var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1; - var lpos = pos; - for (;; lpos = pos) { - var c6 = lm[bits162(dat, pos) & lms], sym = c6 >> 4; - pos += c6 & 15; - if (pos > tbts) { - if (noSt) - err2(0); - break; - } - if (!c6) - err2(2); - if (sym < 256) - buf[bt++] = sym; - else if (sym == 256) { - lpos = pos, lm = null; - break; - } else { - var add3 = sym - 254; - if (sym > 264) { - var i4 = sym - 257, b = fleb2[i4]; - add3 = bits2(dat, pos, (1 << b) - 1) + fl2[i4]; - pos += b; - } - var d = dm[bits162(dat, pos) & dms], dsym = d >> 4; - if (!d) - err2(3); - pos += d & 15; - var dt = fd2[dsym]; - if (dsym > 3) { - var b = fdeb2[dsym]; - dt += bits162(dat, pos) & (1 << b) - 1, pos += b; - } - if (pos > tbts) { - if (noSt) - err2(0); - break; - } - if (resize) - cbuf(bt + 131072); - var end = bt + add3; - if (bt < dt) { - var shift = dl - dt, dend = Math.min(dt, end); - if (shift + bt < 0) - err2(3); - for (;bt < dend; ++bt) - buf[bt] = dict[shift + bt]; - } - for (;bt < end; ++bt) - buf[bt] = buf[bt - dt]; - } - } - st.l = lm, st.p = lpos, st.b = bt, st.f = final; - if (lm) - final = 1, st.m = lbt, st.d = dm, st.n = dbt; - } while (!final); - return bt != buf.length && noBuf ? slc2(buf, 0, bt) : buf.subarray(0, bt); -}, wbits2 = function(d, p, v) { - v <<= p & 7; - var o2 = p / 8 | 0; - d[o2] |= v; - d[o2 + 1] |= v >> 8; -}, wbits162 = function(d, p, v) { - v <<= p & 7; - var o2 = p / 8 | 0; - d[o2] |= v; - d[o2 + 1] |= v >> 8; - d[o2 + 2] |= v >> 16; -}, hTree2 = function(d, mb) { - var t = []; - for (var i4 = 0;i4 < d.length; ++i4) { - if (d[i4]) - t.push({ s: i4, f: d[i4] }); - } - var s = t.length; - var t2 = t.slice(); - if (!s) - return { t: et2, l: 0 }; - if (s == 1) { - var v = new u82(t[0].s + 1); - v[t[0].s] = 1; - return { t: v, l: 1 }; - } - t.sort(function(a2, b) { - return a2.f - b.f; - }); - t.push({ s: -1, f: 25001 }); - var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2; - t[0] = { s: -1, f: l.f + r.f, l, r }; - while (i1 != s - 1) { - l = t[t[i0].f < t[i22].f ? i0++ : i22++]; - r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++]; - t[i1++] = { s: -1, f: l.f + r.f, l, r }; - } - var maxSym = t2[0].s; - for (var i4 = 1;i4 < s; ++i4) { - if (t2[i4].s > maxSym) - maxSym = t2[i4].s; - } - var tr = new u162(maxSym + 1); - var mbt = ln2(t[i1 - 1], tr, 0); - if (mbt > mb) { - var i4 = 0, dt = 0; - var lft = mbt - mb, cst = 1 << lft; - t2.sort(function(a2, b) { - return tr[b.s] - tr[a2.s] || a2.f - b.f; - }); - for (;i4 < s; ++i4) { - var i2_1 = t2[i4].s; - if (tr[i2_1] > mb) { - dt += cst - (1 << mbt - tr[i2_1]); - tr[i2_1] = mb; - } else - break; - } - dt >>= lft; - while (dt > 0) { - var i2_2 = t2[i4].s; - if (tr[i2_2] < mb) - dt -= 1 << mb - tr[i2_2]++ - 1; - else - ++i4; - } - for (;i4 >= 0 && dt; --i4) { - var i2_3 = t2[i4].s; - if (tr[i2_3] == mb) { - --tr[i2_3]; - ++dt; - } - } - mbt = mb; - } - return { t: new u82(tr), l: mbt }; -}, ln2 = function(n2, l, d) { - return n2.s == -1 ? Math.max(ln2(n2.l, l, d + 1), ln2(n2.r, l, d + 1)) : l[n2.s] = d; -}, lc2 = function(c6) { - var s = c6.length; - while (s && !c6[--s]) - ; - var cl = new u162(++s); - var cli = 0, cln = c6[0], cls = 1; - var w = function(v) { - cl[cli++] = v; - }; - for (var i4 = 1;i4 <= s; ++i4) { - if (c6[i4] == cln && i4 != s) - ++cls; - else { - if (!cln && cls > 2) { - for (;cls > 138; cls -= 138) - w(32754); - if (cls > 2) { - w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305); - cls = 0; - } - } else if (cls > 3) { - w(cln), --cls; - for (;cls > 6; cls -= 6) - w(8304); - if (cls > 2) - w(cls - 3 << 5 | 8208), cls = 0; - } - while (cls--) - w(cln); - cls = 1; - cln = c6[i4]; - } - } - return { c: cl.subarray(0, cli), n: s }; -}, clen2 = function(cf, cl) { - var l = 0; - for (var i4 = 0;i4 < cl.length; ++i4) - l += cf[i4] * cl[i4]; - return l; -}, wfblk2 = function(out, pos, dat) { - var s = dat.length; - var o2 = shft2(pos + 2); - out[o2] = s & 255; - out[o2 + 1] = s >> 8; - out[o2 + 2] = out[o2] ^ 255; - out[o2 + 3] = out[o2 + 1] ^ 255; - for (var i4 = 0;i4 < s; ++i4) - out[o2 + i4 + 4] = dat[i4]; - return (o2 + 4 + s) * 8; -}, wblk2 = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) { - wbits2(out, p++, final); - ++lf[256]; - var _a5 = hTree2(lf, 15), dlt = _a5.t, mlb = _a5.l; - var _b3 = hTree2(df, 15), ddt = _b3.t, mdb = _b3.l; - var _c21 = lc2(dlt), lclt = _c21.c, nlc = _c21.n; - var _d = lc2(ddt), lcdt = _d.c, ndc = _d.n; - var lcfreq = new u162(19); - for (var i4 = 0;i4 < lclt.length; ++i4) - ++lcfreq[lclt[i4] & 31]; - for (var i4 = 0;i4 < lcdt.length; ++i4) - ++lcfreq[lcdt[i4] & 31]; - var _e = hTree2(lcfreq, 7), lct = _e.t, mlcb = _e.l; - var nlcc = 19; - for (;nlcc > 4 && !lct[clim2[nlcc - 1]]; --nlcc) - ; - var flen = bl + 5 << 3; - var ftlen = clen2(lf, flt2) + clen2(df, fdt2) + eb; - var dtlen = clen2(lf, dlt) + clen2(df, ddt) + eb + 14 + 3 * nlcc + clen2(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]; - if (bs >= 0 && flen <= ftlen && flen <= dtlen) - return wfblk2(out, p, dat.subarray(bs, bs + bl)); - var lm, ll, dm, dl; - wbits2(out, p, 1 + (dtlen < ftlen)), p += 2; - if (dtlen < ftlen) { - lm = hMap2(dlt, mlb, 0), ll = dlt, dm = hMap2(ddt, mdb, 0), dl = ddt; - var llm = hMap2(lct, mlcb, 0); - wbits2(out, p, nlc - 257); - wbits2(out, p + 5, ndc - 1); - wbits2(out, p + 10, nlcc - 4); - p += 14; - for (var i4 = 0;i4 < nlcc; ++i4) - wbits2(out, p + 3 * i4, lct[clim2[i4]]); - p += 3 * nlcc; - var lcts = [lclt, lcdt]; - for (var it = 0;it < 2; ++it) { - var clct = lcts[it]; - for (var i4 = 0;i4 < clct.length; ++i4) { - var len = clct[i4] & 31; - wbits2(out, p, llm[len]), p += lct[len]; - if (len > 15) - wbits2(out, p, clct[i4] >> 5 & 127), p += clct[i4] >> 12; - } - } - } else { - lm = flm2, ll = flt2, dm = fdm2, dl = fdt2; - } - for (var i4 = 0;i4 < li; ++i4) { - var sym = syms[i4]; - if (sym > 255) { - var len = sym >> 18 & 31; - wbits162(out, p, lm[len + 257]), p += ll[len + 257]; - if (len > 7) - wbits2(out, p, sym >> 23 & 31), p += fleb2[len]; - var dst = sym & 31; - wbits162(out, p, dm[dst]), p += dl[dst]; - if (dst > 3) - wbits162(out, p, sym >> 5 & 8191), p += fdeb2[dst]; - } else { - wbits162(out, p, lm[sym]), p += ll[sym]; - } - } - wbits162(out, p, lm[256]); - return p + ll[256]; -}, deo2, et2, dflt2 = function(dat, lvl, plvl, pre, post, st) { - var s = st.z || dat.length; - var o2 = new u82(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post); - var w = o2.subarray(pre, o2.length - post); - var lst = st.l; - var pos = (st.r || 0) & 7; - if (lvl) { - if (pos) - w[0] = st.r >> 3; - var opt = deo2[lvl - 1]; - var n2 = opt >> 13, c6 = opt & 8191; - var msk_1 = (1 << plvl) - 1; - var prev = st.p || new u162(32768), head3 = st.h || new u162(msk_1 + 1); - var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; - var hsh = function(i5) { - return (dat[i5] ^ dat[i5 + 1] << bs1_1 ^ dat[i5 + 2] << bs2_1) & msk_1; - }; - var syms = new i322(25000); - var lf = new u162(288), df = new u162(32); - var lc_1 = 0, eb = 0, i4 = st.i || 0, li = 0, wi = st.w || 0, bs = 0; - for (;i4 + 2 < s; ++i4) { - var hv = hsh(i4); - var imod = i4 & 32767, pimod = head3[hv]; - prev[imod] = pimod; - head3[hv] = imod; - if (wi <= i4) { - var rem = s - i4; - if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) { - pos = wblk2(dat, w, 0, syms, lf, df, eb, li, bs, i4 - bs, pos); - li = lc_1 = eb = 0, bs = i4; - for (var j = 0;j < 286; ++j) - lf[j] = 0; - for (var j = 0;j < 30; ++j) - df[j] = 0; - } - var l = 2, d = 0, ch_1 = c6, dif = imod - pimod & 32767; - if (rem > 2 && hv == hsh(i4 - dif)) { - var maxn = Math.min(n2, rem) - 1; - var maxd = Math.min(32767, i4); - var ml = Math.min(258, rem); - while (dif <= maxd && --ch_1 && imod != pimod) { - if (dat[i4 + l] == dat[i4 + l - dif]) { - var nl = 0; - for (;nl < ml && dat[i4 + nl] == dat[i4 + nl - dif]; ++nl) - ; - if (nl > l) { - l = nl, d = dif; - if (nl > maxn) - break; - var mmd = Math.min(dif, nl - 2); - var md = 0; - for (var j = 0;j < mmd; ++j) { - var ti = i4 - dif + j & 32767; - var pti = prev[ti]; - var cd = ti - pti & 32767; - if (cd > md) - md = cd, pimod = ti; - } - } - } - imod = pimod, pimod = prev[imod]; - dif += imod - pimod & 32767; - } - } - if (d) { - syms[li++] = 268435456 | revfl2[l] << 18 | revfd2[d]; - var lin = revfl2[l] & 31, din = revfd2[d] & 31; - eb += fleb2[lin] + fdeb2[din]; - ++lf[257 + lin]; - ++df[din]; - wi = i4 + l; - ++lc_1; - } else { - syms[li++] = dat[i4]; - ++lf[dat[i4]]; - } - } - } - for (i4 = Math.max(i4, wi);i4 < s; ++i4) { - syms[li++] = dat[i4]; - ++lf[dat[i4]]; - } - pos = wblk2(dat, w, lst, syms, lf, df, eb, li, bs, i4 - bs, pos); - if (!lst) { - st.r = pos & 7 | w[pos / 8 | 0] << 3; - pos -= 7; - st.h = head3, st.p = prev, st.i = i4, st.w = wi; - } - } else { - for (var i4 = st.w || 0;i4 < s + lst; i4 += 65535) { - var e = i4 + 65535; - if (e >= s) { - w[pos / 8 | 0] = lst; - e = s; - } - pos = wfblk2(w, pos + 1, dat.subarray(i4, e)); - } - st.i = s; - } - return slc2(o2, 0, pre + shft2(pos) + post); -}, crct2, crc2 = function() { - var c6 = -1; - return { - p: function(d) { - var cr = c6; - for (var i4 = 0;i4 < d.length; ++i4) - cr = crct2[cr & 255 ^ d[i4]] ^ cr >>> 8; - c6 = cr; - }, - d: function() { - return ~c6; - } - }; -}, adler = function() { - var a2 = 1, b = 0; - return { - p: function(d) { - var n2 = a2, m = b; - var l = d.length | 0; - for (var i4 = 0;i4 != l; ) { - var e = Math.min(i4 + 2655, l); - for (;i4 < e; ++i4) - m += n2 += d[i4]; - n2 = (n2 & 65535) + 15 * (n2 >> 16), m = (m & 65535) + 15 * (m >> 16); - } - a2 = n2, b = m; - }, - d: function() { - a2 %= 65521, b %= 65521; - return (a2 & 255) << 24 | (a2 & 65280) << 8 | (b & 255) << 8 | b >> 8; - } - }; -}, dopt2 = function(dat, opt, pre, post, st) { - if (!st) { - st = { l: 1 }; - if (opt.dictionary) { - var dict = opt.dictionary.subarray(-32768); - var newDat = new u82(dict.length + dat.length); - newDat.set(dict); - newDat.set(dat, dict.length); - dat = newDat; - st.w = dict.length; - } - } - return dflt2(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st); -}, mrg2 = function(a2, b) { - var o2 = {}; - for (var k in a2) - o2[k] = a2[k]; - for (var k in b) - o2[k] = b[k]; - return o2; -}, wcln = function(fn, fnStr, td2) { - var dt = fn(); - var st = fn.toString(); - var ks = st.slice(st.indexOf("[") + 1, st.lastIndexOf("]")).replace(/\s+/g, "").split(","); - for (var i4 = 0;i4 < dt.length; ++i4) { - var v = dt[i4], k = ks[i4]; - if (typeof v == "function") { - fnStr += ";" + k + "="; - var st_1 = v.toString(); - if (v.prototype) { - if (st_1.indexOf("[native code]") != -1) { - var spInd = st_1.indexOf(" ", 8) + 1; - fnStr += st_1.slice(spInd, st_1.indexOf("(", spInd)); - } else { - fnStr += st_1; - for (var t in v.prototype) - fnStr += ";" + k + ".prototype." + t + "=" + v.prototype[t].toString(); - } - } else - fnStr += st_1; - } else - td2[k] = v; - } - return fnStr; -}, ch, cbfs = function(v) { - var tl = []; - for (var k in v) { - if (v[k].buffer) { - tl.push((v[k] = new v[k].constructor(v[k])).buffer); - } - } - return tl; -}, wrkr = function(fns, init2, id, cb) { - if (!ch[id]) { - var fnStr = "", td_1 = {}, m = fns.length - 1; - for (var i4 = 0;i4 < m; ++i4) - fnStr = wcln(fns[i4], fnStr, td_1); - ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 }; - } - var td2 = mrg2({}, ch[id].e); - return wk(ch[id].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + init2.toString() + "}", id, td2, cbfs(td2), cb); -}, bInflt = function() { - return [u82, u162, i322, fleb2, fdeb2, clim2, fl2, fd2, flrm2, fdrm2, rev2, ec2, hMap2, max4, bits2, bits162, shft2, slc2, err2, inflt2, inflateSync2, pbf, gopt]; -}, bDflt = function() { - return [u82, u162, i322, fleb2, fdeb2, clim2, revfl2, revfd2, flm2, flt2, fdm2, fdt2, rev2, deo2, et2, hMap2, wbits2, wbits162, hTree2, ln2, lc2, clen2, wfblk2, wblk2, shft2, slc2, dflt2, dopt2, deflateSync2, pbf]; -}, gze = function() { - return [gzh, gzhl, wbytes2, crc2, crct2]; -}, guze = function() { - return [gzs, gzl]; -}, zle = function() { - return [zlh, wbytes2, adler]; -}, zule = function() { - return [zls]; -}, pbf = function(msg) { - return postMessage(msg, [msg.buffer]); -}, gopt = function(o2) { - return o2 && { - out: o2.size && new u82(o2.size), - dictionary: o2.dictionary - }; -}, cbify = function(dat, opts, fns, init2, id, cb) { - var w = wrkr(fns, init2, id, function(err3, dat2) { - w.terminate(); - cb(err3, dat2); - }); - w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []); - return function() { - w.terminate(); - }; -}, astrm = function(strm) { - strm.ondata = function(dat, final) { - return postMessage([dat, final], [dat.buffer]); - }; - return function(ev) { - if (ev.data.length) { - strm.push(ev.data[0], ev.data[1]); - postMessage([ev.data[0].length]); - } else - strm.flush(); - }; -}, astrmify = function(fns, strm, opts, init2, id, flush, ext) { - var t; - var w = wrkr(fns, init2, id, function(err3, dat) { - if (err3) - w.terminate(), strm.ondata.call(strm, err3); - else if (!Array.isArray(dat)) - ext(dat); - else if (dat.length == 1) { - strm.queuedSize -= dat[0]; - if (strm.ondrain) - strm.ondrain(dat[0]); - } else { - if (dat[1]) - w.terminate(); - strm.ondata.call(strm, err3, dat[0], dat[1]); - } - }); - w.postMessage(opts); - strm.queuedSize = 0; - strm.push = function(d, f) { - if (!strm.ondata) - err2(5); - if (t) - strm.ondata(err2(4, 0, 1), null, !!f); - strm.queuedSize += d.length; - w.postMessage([d, t = f], [d.buffer]); - }; - strm.terminate = function() { - w.terminate(); - }; - if (flush) { - strm.flush = function() { - w.postMessage([]); - }; - } -}, b22 = function(d, b) { - return d[b] | d[b + 1] << 8; -}, b42 = function(d, b) { - return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0; -}, b82 = function(d, b) { - return b42(d, b) + b42(d, b + 4) * 4294967296; -}, wbytes2 = function(d, b, v) { - for (;v; ++b) - d[b] = v, v >>>= 8; -}, gzh = function(c6, o2) { - var fn = o2.filename; - c6[0] = 31, c6[1] = 139, c6[2] = 8, c6[8] = o2.level < 2 ? 4 : o2.level == 9 ? 2 : 0, c6[9] = 3; - if (o2.mtime != 0) - wbytes2(c6, 4, Math.floor(new Date(o2.mtime || Date.now()) / 1000)); - if (fn) { - c6[3] = 8; - for (var i4 = 0;i4 <= fn.length; ++i4) - c6[i4 + 10] = fn.charCodeAt(i4); - } -}, gzs = function(d) { - if (d[0] != 31 || d[1] != 139 || d[2] != 8) - err2(6, "invalid gzip data"); - var flg = d[3]; - var st = 10; - if (flg & 4) - st += (d[10] | d[11] << 8) + 2; - for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1);zs > 0; zs -= !d[st++]) - ; - return st + (flg & 2); -}, gzl = function(d) { - var l = d.length; - return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0; -}, gzhl = function(o2) { - return 10 + (o2.filename ? o2.filename.length + 1 : 0); -}, zlh = function(c6, o2) { - var lv = o2.level, fl3 = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; - c6[0] = 120, c6[1] = fl3 << 6 | (o2.dictionary && 32); - c6[1] |= 31 - (c6[0] << 8 | c6[1]) % 31; - if (o2.dictionary) { - var h2 = adler(); - h2.p(o2.dictionary); - wbytes2(c6, 2, h2.d()); - } -}, zls = function(d, dict) { - if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31) - err2(6, "invalid zlib data"); - if ((d[1] >> 5 & 1) == +!dict) - err2(6, "invalid zlib data: " + (d[1] & 32 ? "need" : "unexpected") + " dictionary"); - return (d[1] >> 3 & 4) + 2; -}, Deflate, AsyncDeflate, Inflate, AsyncInflate, Gzip, AsyncGzip, Gunzip, AsyncGunzip, Zlib, AsyncZlib, Unzlib, AsyncUnzlib, Decompress, AsyncDecompress, fltn2 = function(d, p, t, o2) { - for (var k in d) { - var val = d[k], n2 = p + k, op = o2; - if (Array.isArray(val)) - op = mrg2(o2, val[1]), val = val[0]; - if (val instanceof u82) - t[n2] = [val, op]; - else { - t[n2 += "/"] = [new u82(0), op]; - fltn2(val, n2, t, o2); - } - } -}, te2, td2, tds2 = 0, dutf82 = function(d) { - for (var r = "", i4 = 0;; ) { - var c6 = d[i4++]; - var eb = (c6 > 127) + (c6 > 223) + (c6 > 239); - if (i4 + eb > d.length) - return { s: r, r: slc2(d, i4 - 1) }; - if (!eb) - r += String.fromCharCode(c6); - else if (eb == 3) { - c6 = ((c6 & 15) << 18 | (d[i4++] & 63) << 12 | (d[i4++] & 63) << 6 | d[i4++] & 63) - 65536, r += String.fromCharCode(55296 | c6 >> 10, 56320 | c6 & 1023); - } else if (eb & 1) - r += String.fromCharCode((c6 & 31) << 6 | d[i4++] & 63); - else - r += String.fromCharCode((c6 & 15) << 12 | (d[i4++] & 63) << 6 | d[i4++] & 63); - } -}, DecodeUTF8, EncodeUTF8, dbf = function(l) { - return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; -}, slzh2 = function(d, b) { - return b + 30 + b22(d, b + 26) + b22(d, b + 28); -}, zh2 = function(d, b, z2) { - var fnl = b22(d, b + 28), fn = strFromU82(d.subarray(b + 46, b + 46 + fnl), !(b22(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b42(d, b + 20); - var _a5 = z2 && bs == 4294967295 ? z64e2(d, es) : [bs, b42(d, b + 24), b42(d, b + 42)], sc = _a5[0], su = _a5[1], off = _a5[2]; - return [b22(d, b + 10), sc, su, fn, es + b22(d, b + 30) + b22(d, b + 32), off]; -}, z64e2 = function(d, b) { - for (;b22(d, b) != 1; b += 4 + b22(d, b + 2)) - ; - return [b82(d, b + 12), b82(d, b + 4), b82(d, b + 20)]; -}, exfl2 = function(ex) { - var le = 0; - if (ex) { - for (var k in ex) { - var l = ex[k].length; - if (l > 65535) - err2(9); - le += l + 4; - } - } - return le; -}, wzh2 = function(d, b, f, fn, u2, c6, ce, co) { - var fl3 = fn.length, ex = f.extra, col = co && co.length; - var exl = exfl2(ex); - wbytes2(d, b, ce != null ? 33639248 : 67324752), b += 4; - if (ce != null) - d[b++] = 20, d[b++] = f.os; - d[b] = 20, b += 2; - d[b++] = f.flag << 1 | (c6 < 0 && 8), d[b++] = u2 && 8; - d[b++] = f.compression & 255, d[b++] = f.compression >> 8; - var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y2 = dt.getFullYear() - 1980; - if (y2 < 0 || y2 > 119) - err2(10); - wbytes2(d, b, y2 << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4; - if (c6 != -1) { - wbytes2(d, b, f.crc); - wbytes2(d, b + 4, c6 < 0 ? -c6 - 2 : c6); - wbytes2(d, b + 8, f.size); - } - wbytes2(d, b + 12, fl3); - wbytes2(d, b + 14, exl), b += 16; - if (ce != null) { - wbytes2(d, b, col); - wbytes2(d, b + 6, f.attrs); - wbytes2(d, b + 10, ce), b += 14; - } - d.set(fn, b); - b += fl3; - if (exl) { - for (var k in ex) { - var exf = ex[k], l = exf.length; - wbytes2(d, b, +k); - wbytes2(d, b + 2, l); - d.set(exf, b + 4), b += 4 + l; - } - } - if (col) - d.set(co, b), b += col; - return b; -}, wzf2 = function(o2, b, c6, d, e) { - wbytes2(o2, b, 101010256); - wbytes2(o2, b + 8, c6); - wbytes2(o2, b + 10, c6); - wbytes2(o2, b + 12, d); - wbytes2(o2, b + 16, e); -}, ZipPassThrough, ZipDeflate, AsyncZipDeflate, Zip, UnzipPassThrough, UnzipInflate, AsyncUnzipInflate, Unzip, mt; -var init_esm6 = __esm(() => { - require3 = createRequire3("/"); - try { - Worker2 = require3("worker_threads").Worker; - } catch (e) {} - wk = Worker2 ? function(c6, _, msg, transfer, cb) { - var done = false; - var w = new Worker2(c6 + workerAdd, { eval: true }).on("error", function(e) { - return cb(e, null); - }).on("message", function(m) { - return cb(null, m); - }).on("exit", function(c7) { - if (c7 && !done) - cb(new Error("exited with code " + c7), null); - }); - w.postMessage(msg, transfer); - w.terminate = function() { - done = true; - return Worker2.prototype.terminate.call(w); - }; - return w; - } : function(_, __, ___, ____, cb) { - setImmediate(function() { - return cb(new Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"), null); - }); - var NOP = function() {}; - return { - terminate: NOP, - postMessage: NOP - }; - }; - u82 = Uint8Array; - u162 = Uint16Array; - i322 = Int32Array; - fleb2 = new u82([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]); - fdeb2 = new u82([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]); - clim2 = new u82([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); - _a4 = freb2(fleb2, 2); - fl2 = _a4.b; - revfl2 = _a4.r; - fl2[28] = 258, revfl2[258] = 28; - _b2 = freb2(fdeb2, 0); - fd2 = _b2.b; - revfd2 = _b2.r; - rev2 = new u162(32768); - for (i3 = 0;i3 < 32768; ++i3) { - x3 = (i3 & 43690) >> 1 | (i3 & 21845) << 1; - x3 = (x3 & 52428) >> 2 | (x3 & 13107) << 2; - x3 = (x3 & 61680) >> 4 | (x3 & 3855) << 4; - rev2[i3] = ((x3 & 65280) >> 8 | (x3 & 255) << 8) >> 1; - } - flt2 = new u82(288); - for (i3 = 0;i3 < 144; ++i3) - flt2[i3] = 8; - for (i3 = 144;i3 < 256; ++i3) - flt2[i3] = 9; - for (i3 = 256;i3 < 280; ++i3) - flt2[i3] = 7; - for (i3 = 280;i3 < 288; ++i3) - flt2[i3] = 8; - fdt2 = new u82(32); - for (i3 = 0;i3 < 32; ++i3) - fdt2[i3] = 5; - flm2 = /* @__PURE__ */ hMap2(flt2, 9, 0); - flrm2 = /* @__PURE__ */ hMap2(flt2, 9, 1); - fdm2 = /* @__PURE__ */ hMap2(fdt2, 5, 0); - fdrm2 = /* @__PURE__ */ hMap2(fdt2, 5, 1); - FlateErrorCode = { - UnexpectedEOF: 0, - InvalidBlockType: 1, - InvalidLengthLiteral: 2, - InvalidDistance: 3, - StreamFinished: 4, - NoStreamHandler: 5, - InvalidHeader: 6, - NoCallback: 7, - InvalidUTF8: 8, - ExtraFieldTooLong: 9, - InvalidDate: 10, - FilenameTooLong: 11, - StreamFinishing: 12, - InvalidZipData: 13, - UnknownCompressionMethod: 14 - }; - ec2 = [ - "unexpected EOF", - "invalid block type", - "invalid length/literal", - "invalid distance", - "stream finished", - "no stream handler", - , - "no callback", - "invalid UTF-8 data", - "extra field too long", - "date not in range 1980-2099", - "filename too long", - "stream finishing", - "invalid zip data" - ]; - deo2 = /* @__PURE__ */ new i322([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]); - et2 = /* @__PURE__ */ new u82(0); - crct2 = /* @__PURE__ */ function() { - var t = new Int32Array(256); - for (var i4 = 0;i4 < 256; ++i4) { - var c6 = i4, k = 9; - while (--k) - c6 = (c6 & 1 && -306674912) ^ c6 >>> 1; - t[i4] = c6; - } - return t; - }(); ch = []; Deflate = /* @__PURE__ */ function() { function Deflate2(opts, cb) { @@ -286611,7 +210262,7 @@ var init_esm6 = __esm(() => { this.ondata = cb; this.o = opts || {}; this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; - this.b = new u82(98304); + this.b = new u8(98304); if (this.o.dictionary) { var dict = this.o.dictionary.subarray(-32768); this.b.set(dict, 32768 - dict.length); @@ -286619,31 +210270,31 @@ var init_esm6 = __esm(() => { } } Deflate2.prototype.p = function(c6, f) { - this.ondata(dopt2(c6, this.o, 0, 0, this.s), f); + this.ondata(dopt(c6, this.o, 0, 0, this.s), f); }; - Deflate2.prototype.push = function(chunk3, final) { + Deflate2.prototype.push = function(chunk2, final) { if (!this.ondata) - err2(5); + err(5); if (this.s.l) - err2(4); - var endLen = chunk3.length + this.s.z; + err(4); + var endLen = chunk2.length + this.s.z; if (endLen > this.b.length) { if (endLen > 2 * this.b.length - 32768) { - var newBuf = new u82(endLen & -32768); + var newBuf = new u8(endLen & -32768); newBuf.set(this.b.subarray(0, this.s.z)); this.b = newBuf; } - var split3 = this.b.length - this.s.z; - this.b.set(chunk3.subarray(0, split3), this.s.z); + var split2 = this.b.length - this.s.z; + this.b.set(chunk2.subarray(0, split2), this.s.z); this.s.z = this.b.length; this.p(this.b, false); this.b.set(this.b.subarray(-32768)); - this.b.set(chunk3.subarray(split3), 32768); - this.s.z = chunk3.length - split3 + 32768; + this.b.set(chunk2.subarray(split2), 32768); + this.s.z = chunk2.length - split2 + 32768; this.s.i = 32766, this.s.w = 32768; } else { - this.b.set(chunk3, this.s.z); - this.s.z += chunk3.length; + this.b.set(chunk2, this.s.z); + this.s.z += chunk2.length; } this.s.l = final & 1; if (this.s.z > this.s.w + 8191 || final) { @@ -286653,9 +210304,9 @@ var init_esm6 = __esm(() => { }; Deflate2.prototype.flush = function() { if (!this.ondata) - err2(5); + err(5); if (this.s.l) - err2(4); + err(4); this.p(this.b, false); this.s.w = this.s.i, this.s.i -= 2; }; @@ -286682,33 +210333,33 @@ var init_esm6 = __esm(() => { this.ondata = cb; var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768); this.s = { i: 0, b: dict ? dict.length : 0 }; - this.o = new u82(32768); - this.p = new u82(0); + this.o = new u8(32768); + this.p = new u8(0); if (dict) this.o.set(dict); } Inflate2.prototype.e = function(c6) { if (!this.ondata) - err2(5); + err(5); if (this.d) - err2(4); + err(4); if (!this.p.length) this.p = c6; else if (c6.length) { - var n2 = new u82(this.p.length + c6.length); + var n2 = new u8(this.p.length + c6.length); n2.set(this.p), n2.set(c6, this.p.length), this.p = n2; } }; Inflate2.prototype.c = function(final) { this.s.i = +(this.d = final || false); var bts = this.s.b; - var dt = inflt2(this.p, this.s, this.o); - this.ondata(slc2(dt, bts, this.s.b), this.d); - this.o = slc2(dt, this.s.b - 32768), this.s.b = this.o.length; - this.p = slc2(this.p, this.s.p / 8 | 0), this.s.p &= 7; + var dt = inflt(this.p, this.s, this.o); + this.ondata(slc(dt, bts, this.s.b), this.d); + this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length; + this.p = slc(this.p, this.s.p / 8 | 0), this.s.p &= 7; }; - Inflate2.prototype.push = function(chunk3, final) { - this.e(chunk3), this.c(final); + Inflate2.prototype.push = function(chunk2, final) { + this.e(chunk2), this.c(final); }; return Inflate2; }(); @@ -286728,22 +210379,22 @@ var init_esm6 = __esm(() => { }(); Gzip = /* @__PURE__ */ function() { function Gzip2(opts, cb) { - this.c = crc2(); + this.c = crc(); this.l = 0; this.v = 1; Deflate.call(this, opts, cb); } - Gzip2.prototype.push = function(chunk3, final) { - this.c.p(chunk3); - this.l += chunk3.length; - Deflate.prototype.push.call(this, chunk3, final); + Gzip2.prototype.push = function(chunk2, final) { + this.c.p(chunk2); + this.l += chunk2.length; + Deflate.prototype.push.call(this, chunk2, final); }; Gzip2.prototype.p = function(c6, f) { - var raw = dopt2(c6, this.o, this.v && gzhl(this.o), f && 8, this.s); + var raw = dopt(c6, this.o, this.v && gzhl(this.o), f && 8, this.s); if (this.v) gzh(raw, this.o), this.v = 0; if (f) - wbytes2(raw, raw.length - 8, this.c.d()), wbytes2(raw, raw.length - 4, this.l); + wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l); this.ondata(raw, f); }; Gzip2.prototype.flush = function() { @@ -286772,9 +210423,9 @@ var init_esm6 = __esm(() => { this.r = 0; Inflate.call(this, opts, cb); } - Gunzip2.prototype.push = function(chunk3, final) { - Inflate.prototype.e.call(this, chunk3); - this.r += chunk3.length; + Gunzip2.prototype.push = function(chunk2, final) { + Inflate.prototype.e.call(this, chunk2); + this.r += chunk2.length; if (this.v) { var p = this.p.subarray(this.v - 1); var s = p.length > 3 ? gzs(p) : 4; @@ -286788,10 +210439,10 @@ var init_esm6 = __esm(() => { } Inflate.prototype.c.call(this, final); if (this.s.f && !this.s.l && !final) { - this.v = shft2(this.s.p) + 9; + this.v = shft(this.s.p) + 9; this.s = { i: 0 }; - this.o = new u82(0); - this.push(new u82(0), final); + this.o = new u8(0); + this.push(new u8(0), final); } }; return Gunzip2; @@ -286823,16 +210474,16 @@ var init_esm6 = __esm(() => { this.v = 1; Deflate.call(this, opts, cb); } - Zlib2.prototype.push = function(chunk3, final) { - this.c.p(chunk3); - Deflate.prototype.push.call(this, chunk3, final); + Zlib2.prototype.push = function(chunk2, final) { + this.c.p(chunk2); + Deflate.prototype.push.call(this, chunk2, final); }; Zlib2.prototype.p = function(c6, f) { - var raw = dopt2(c6, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); + var raw = dopt(c6, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); if (this.v) zlh(raw, this.o), this.v = 0; if (f) - wbytes2(raw, raw.length - 4, this.c.d()); + wbytes(raw, raw.length - 4, this.c.d()); this.ondata(raw, f); }; Zlib2.prototype.flush = function() { @@ -286860,8 +210511,8 @@ var init_esm6 = __esm(() => { Inflate.call(this, opts, cb); this.v = opts && opts.dictionary ? 2 : 1; } - Unzlib2.prototype.push = function(chunk3, final) { - Inflate.prototype.e.call(this, chunk3); + Unzlib2.prototype.push = function(chunk2, final) { + Inflate.prototype.e.call(this, chunk2); if (this.v) { if (this.p.length < 6 && !final) return; @@ -286869,7 +210520,7 @@ var init_esm6 = __esm(() => { } if (final) { if (this.p.length < 4) - err2(6, "invalid zlib data"); + err(6, "invalid zlib data"); this.p = this.p.subarray(0, -4); } Inflate.prototype.c.call(this, final); @@ -286904,15 +210555,15 @@ var init_esm6 = __esm(() => { _this.ondata(dat, final); }; }; - Decompress2.prototype.push = function(chunk3, final) { + Decompress2.prototype.push = function(chunk2, final) { if (!this.ondata) - err2(5); + err(5); if (!this.s) { if (this.p && this.p.length) { - var n2 = new u82(this.p.length + chunk3.length); - n2.set(this.p), n2.set(chunk3, this.p.length); + var n2 = new u8(this.p.length + chunk2.length); + n2.set(this.p), n2.set(chunk2, this.p.length); } else - this.p = chunk3; + this.p = chunk2; if (this.p.length > 2) { this.s = this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8 ? new this.G(this.o) : (this.p[0] & 15) != 8 || this.p[0] >> 4 > 7 || (this.p[0] << 8 | this.p[1]) % 31 ? new this.I(this.o) : new this.Z(this.o); this.i(); @@ -286920,7 +210571,7 @@ var init_esm6 = __esm(() => { this.p = null; } } else - this.s.push(chunk3, final); + this.s.push(chunk2, final); }; return Decompress2; }(); @@ -286934,57 +210585,57 @@ var init_esm6 = __esm(() => { } AsyncDecompress2.prototype.i = function() { var _this = this; - this.s.ondata = function(err3, dat, final) { - _this.ondata(err3, dat, final); + this.s.ondata = function(err2, dat, final) { + _this.ondata(err2, dat, final); }; - this.s.ondrain = function(size3) { - _this.queuedSize -= size3; + this.s.ondrain = function(size2) { + _this.queuedSize -= size2; if (_this.ondrain) - _this.ondrain(size3); + _this.ondrain(size2); }; }; - AsyncDecompress2.prototype.push = function(chunk3, final) { - this.queuedSize += chunk3.length; - Decompress.prototype.push.call(this, chunk3, final); + AsyncDecompress2.prototype.push = function(chunk2, final) { + this.queuedSize += chunk2.length; + Decompress.prototype.push.call(this, chunk2, final); }; return AsyncDecompress2; }(); - te2 = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder; - td2 = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder; + te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder; + td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder; try { - td2.decode(et2, { stream: true }); - tds2 = 1; + td.decode(et, { stream: true }); + tds = 1; } catch (e) {} DecodeUTF8 = /* @__PURE__ */ function() { function DecodeUTF82(cb) { this.ondata = cb; - if (tds2) + if (tds) this.t = new TextDecoder; else - this.p = et2; + this.p = et; } - DecodeUTF82.prototype.push = function(chunk3, final) { + DecodeUTF82.prototype.push = function(chunk2, final) { if (!this.ondata) - err2(5); + err(5); final = !!final; if (this.t) { - this.ondata(this.t.decode(chunk3, { stream: true }), final); + this.ondata(this.t.decode(chunk2, { stream: true }), final); if (final) { if (this.t.decode().length) - err2(8); + err(8); this.t = null; } return; } if (!this.p) - err2(4); - var dat = new u82(this.p.length + chunk3.length); + err(4); + var dat = new u8(this.p.length + chunk2.length); dat.set(this.p); - dat.set(chunk3, this.p.length); - var _a5 = dutf82(dat), s = _a5.s, r = _a5.r; + dat.set(chunk2, this.p.length); + var _a3 = dutf8(dat), s = _a3.s, r = _a3.r; if (final) { if (r.length) - err2(8); + err(8); this.p = null; } else this.p = r; @@ -286996,33 +210647,33 @@ var init_esm6 = __esm(() => { function EncodeUTF82(cb) { this.ondata = cb; } - EncodeUTF82.prototype.push = function(chunk3, final) { + EncodeUTF82.prototype.push = function(chunk2, final) { if (!this.ondata) - err2(5); + err(5); if (this.d) - err2(4); - this.ondata(strToU82(chunk3), this.d = final || false); + err(4); + this.ondata(strToU8(chunk2), this.d = final || false); }; return EncodeUTF82; }(); ZipPassThrough = /* @__PURE__ */ function() { function ZipPassThrough2(filename) { this.filename = filename; - this.c = crc2(); + this.c = crc(); this.size = 0; this.compression = 0; } - ZipPassThrough2.prototype.process = function(chunk3, final) { - this.ondata(null, chunk3, final); + ZipPassThrough2.prototype.process = function(chunk2, final) { + this.ondata(null, chunk2, final); }; - ZipPassThrough2.prototype.push = function(chunk3, final) { + ZipPassThrough2.prototype.push = function(chunk2, final) { if (!this.ondata) - err2(5); - this.c.p(chunk3); - this.size += chunk3.length; + err(5); + this.c.p(chunk2); + this.size += chunk2.length; if (final) this.crc = this.c.d(); - this.process(chunk3, final || false); + this.process(chunk2, final || false); }; return ZipPassThrough2; }(); @@ -287038,15 +210689,15 @@ var init_esm6 = __esm(() => { this.compression = 8; this.flag = dbf(opts.level); } - ZipDeflate2.prototype.process = function(chunk3, final) { + ZipDeflate2.prototype.process = function(chunk2, final) { try { - this.d.push(chunk3, final); + this.d.push(chunk2, final); } catch (e) { this.ondata(e, null, final); } }; - ZipDeflate2.prototype.push = function(chunk3, final) { - ZipPassThrough.prototype.push.call(this, chunk3, final); + ZipDeflate2.prototype.push = function(chunk2, final) { + ZipPassThrough.prototype.push.call(this, chunk2, final); }; return ZipDeflate2; }(); @@ -287056,18 +210707,18 @@ var init_esm6 = __esm(() => { if (!opts) opts = {}; ZipPassThrough.call(this, filename); - this.d = new AsyncDeflate(opts, function(err3, dat, final) { - _this.ondata(err3, dat, final); + this.d = new AsyncDeflate(opts, function(err2, dat, final) { + _this.ondata(err2, dat, final); }); this.compression = 8; this.flag = dbf(opts.level); this.terminate = this.d.terminate; } - AsyncZipDeflate2.prototype.process = function(chunk3, final) { - this.d.push(chunk3, final); + AsyncZipDeflate2.prototype.process = function(chunk2, final) { + this.d.push(chunk2, final); }; - AsyncZipDeflate2.prototype.push = function(chunk3, final) { - ZipPassThrough.prototype.push.call(this, chunk3, final); + AsyncZipDeflate2.prototype.push = function(chunk2, final) { + ZipPassThrough.prototype.push.call(this, chunk2, final); }; return AsyncZipDeflate2; }(); @@ -287080,18 +210731,18 @@ var init_esm6 = __esm(() => { Zip2.prototype.add = function(file2) { var _this = this; if (!this.ondata) - err2(5); + err(5); if (this.d & 2) - this.ondata(err2(4 + (this.d & 1) * 8, 0, 1), null, false); + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false); else { - var f = strToU82(file2.filename), fl_1 = f.length; - var com = file2.comment, o2 = com && strToU82(com); + var f = strToU8(file2.filename), fl_1 = f.length; + var com = file2.comment, o2 = com && strToU8(com); var u2 = fl_1 != file2.filename.length || o2 && com.length != o2.length; - var hl_1 = fl_1 + exfl2(file2.extra) + 30; + var hl_1 = fl_1 + exfl(file2.extra) + 30; if (fl_1 > 65535) - this.ondata(err2(11, 0, 1), null, false); - var header = new u82(hl_1); - wzh2(header, 0, file2, f, u2, -1); + this.ondata(err(11, 0, 1), null, false); + var header = new u8(hl_1); + wzh(header, 0, file2, f, u2, -1); var chks_1 = [header]; var pAll_1 = function() { for (var _i = 0, chks_2 = chks_1;_i < chks_2.length; _i++) { @@ -287103,7 +210754,7 @@ var init_esm6 = __esm(() => { var tr_1 = this.d; this.d = 0; var ind_1 = this.u.length; - var uf_1 = mrg2(file2, { + var uf_1 = mrg(file2, { f, u: u2, o: o2, @@ -287124,19 +210775,19 @@ var init_esm6 = __esm(() => { } }); var cl_1 = 0; - file2.ondata = function(err3, dat, final) { - if (err3) { - _this.ondata(err3, dat, final); + file2.ondata = function(err2, dat, final) { + if (err2) { + _this.ondata(err2, dat, final); _this.terminate(); } else { cl_1 += dat.length; chks_1.push(dat); if (final) { - var dd = new u82(16); - wbytes2(dd, 0, 134695760); - wbytes2(dd, 4, file2.crc); - wbytes2(dd, 8, cl_1); - wbytes2(dd, 12, file2.size); + var dd = new u8(16); + wbytes(dd, 0, 134695760); + wbytes(dd, 4, file2.crc); + wbytes(dd, 8, cl_1); + wbytes(dd, 12, file2.size); chks_1.push(dd); uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file2.crc, uf_1.size = file2.size; if (tr_1) @@ -287152,7 +210803,7 @@ var init_esm6 = __esm(() => { Zip2.prototype.end = function() { var _this = this; if (this.d & 2) { - this.ondata(err2(4 + (this.d & 1) * 8, 0, 1), null, true); + this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true); return; } if (this.d) @@ -287171,23 +210822,23 @@ var init_esm6 = __esm(() => { }; Zip2.prototype.e = function() { var bt = 0, l = 0, tl = 0; - for (var _i = 0, _a5 = this.u;_i < _a5.length; _i++) { - var f = _a5[_i]; - tl += 46 + f.f.length + exfl2(f.extra) + (f.o ? f.o.length : 0); + for (var _i = 0, _a3 = this.u;_i < _a3.length; _i++) { + var f = _a3[_i]; + tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0); } - var out = new u82(tl + 22); - for (var _b3 = 0, _c21 = this.u;_b3 < _c21.length; _b3++) { - var f = _c21[_b3]; - wzh2(out, bt, f, f.f, f.u, -f.c - 2, l, f.o); - bt += 46 + f.f.length + exfl2(f.extra) + (f.o ? f.o.length : 0), l += f.b; + var out = new u8(tl + 22); + for (var _b2 = 0, _c21 = this.u;_b2 < _c21.length; _b2++) { + var f = _c21[_b2]; + wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o); + bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b; } - wzf2(out, bt, this.u.length, tl, l); + wzf(out, bt, this.u.length, tl, l); this.ondata(null, out, true); this.d = 2; }; Zip2.prototype.terminate = function() { - for (var _i = 0, _a5 = this.u;_i < _a5.length; _i++) { - var f = _a5[_i]; + for (var _i = 0, _a3 = this.u;_i < _a3.length; _i++) { + var f = _a3[_i]; f.t(); } this.d = 2; @@ -287227,15 +210878,15 @@ var init_esm6 = __esm(() => { _this.ondata(null, dat, final); }); } else { - this.i = new AsyncInflate(function(err3, dat, final) { - _this.ondata(err3, dat, final); + this.i = new AsyncInflate(function(err2, dat, final) { + _this.ondata(err2, dat, final); }); this.terminate = this.i.terminate; } } AsyncUnzipInflate2.prototype.push = function(data, final) { if (this.i.terminate) - data = slc2(data, 0); + data = slc(data, 0); this.i.push(data, final); }; AsyncUnzipInflate2.compression = 8; @@ -287248,55 +210899,55 @@ var init_esm6 = __esm(() => { this.o = { 0: UnzipPassThrough }; - this.p = et2; + this.p = et; } - Unzip2.prototype.push = function(chunk3, final) { + Unzip2.prototype.push = function(chunk2, final) { var _this = this; if (!this.onfile) - err2(5); + err(5); if (!this.p) - err2(4); + err(4); if (this.c > 0) { - var len = Math.min(this.c, chunk3.length); - var toAdd = chunk3.subarray(0, len); + var len = Math.min(this.c, chunk2.length); + var toAdd = chunk2.subarray(0, len); this.c -= len; if (this.d) this.d.push(toAdd, !this.c); else this.k[0].push(toAdd); - chunk3 = chunk3.subarray(len); - if (chunk3.length) - return this.push(chunk3, final); + chunk2 = chunk2.subarray(len); + if (chunk2.length) + return this.push(chunk2, final); } else { - var f = 0, i4 = 0, is = undefined, buf = undefined; + var f = 0, i3 = 0, is = undefined, buf = undefined; if (!this.p.length) - buf = chunk3; - else if (!chunk3.length) + buf = chunk2; + else if (!chunk2.length) buf = this.p; else { - buf = new u82(this.p.length + chunk3.length); - buf.set(this.p), buf.set(chunk3, this.p.length); + buf = new u8(this.p.length + chunk2.length); + buf.set(this.p), buf.set(chunk2, this.p.length); } - var l = buf.length, oc = this.c, add3 = oc && this.d; + var l = buf.length, oc = this.c, add2 = oc && this.d; var _loop_2 = function() { - var _a5; - var sig = b42(buf, i4); + var _a3; + var sig = b4(buf, i3); if (sig == 67324752) { - f = 1, is = i4; + f = 1, is = i3; this_1.d = null; this_1.c = 0; - var bf = b22(buf, i4 + 6), cmp_1 = b22(buf, i4 + 8), u2 = bf & 2048, dd = bf & 8, fnl = b22(buf, i4 + 26), es = b22(buf, i4 + 28); - if (l > i4 + 30 + fnl + es) { + var bf = b2(buf, i3 + 6), cmp_1 = b2(buf, i3 + 8), u2 = bf & 2048, dd = bf & 8, fnl = b2(buf, i3 + 26), es = b2(buf, i3 + 28); + if (l > i3 + 30 + fnl + es) { var chks_3 = []; this_1.k.unshift(chks_3); f = 2; - var sc_1 = b42(buf, i4 + 18), su_1 = b42(buf, i4 + 22); - var fn_1 = strFromU82(buf.subarray(i4 + 30, i4 += 30 + fnl), !u2); + var sc_1 = b4(buf, i3 + 18), su_1 = b4(buf, i3 + 22); + var fn_1 = strFromU8(buf.subarray(i3 + 30, i3 += 30 + fnl), !u2); if (sc_1 == 4294967295) { - _a5 = dd ? [-2] : z64e2(buf, i4), sc_1 = _a5[0], su_1 = _a5[1]; + _a3 = dd ? [-2] : z64e(buf, i3), sc_1 = _a3[0], su_1 = _a3[1]; } else if (dd) sc_1 = -1; - i4 += es; + i3 += es; this_1.c = sc_1; var d_1; var file_1 = { @@ -287304,16 +210955,16 @@ var init_esm6 = __esm(() => { compression: cmp_1, start: function() { if (!file_1.ondata) - err2(5); + err(5); if (!sc_1) - file_1.ondata(null, et2, true); + file_1.ondata(null, et, true); else { var ctr = _this.o[cmp_1]; if (!ctr) - file_1.ondata(err2(14, "unknown compression type " + cmp_1, 1), null, false); + file_1.ondata(err(14, "unknown compression type " + cmp_1, 1), null, false); d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1); - d_1.ondata = function(err3, dat3, final2) { - file_1.ondata(err3, dat3, final2); + d_1.ondata = function(err2, dat3, final2) { + file_1.ondata(err2, dat3, final2); }; for (var _i = 0, chks_4 = chks_3;_i < chks_4.length; _i++) { var dat2 = chks_4[_i]; @@ -287322,7 +210973,7 @@ var init_esm6 = __esm(() => { if (_this.k[0] == chks_3 && _this.c) _this.d = d_1; else - d_1.push(et2, true); + d_1.push(et, true); } }, terminate: function() { @@ -287337,35 +210988,35 @@ var init_esm6 = __esm(() => { return "break"; } else if (oc) { if (sig == 134695760) { - is = i4 += 12 + (oc == -2 && 8), f = 3, this_1.c = 0; + is = i3 += 12 + (oc == -2 && 8), f = 3, this_1.c = 0; return "break"; } else if (sig == 33639248) { - is = i4 -= 4, f = 3, this_1.c = 0; + is = i3 -= 4, f = 3, this_1.c = 0; return "break"; } } }; var this_1 = this; - for (;i4 < l - 4; ++i4) { + for (;i3 < l - 4; ++i3) { var state_1 = _loop_2(); if (state_1 === "break") break; } - this.p = et2; + this.p = et; if (oc < 0) { - var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b42(buf, is - 16) == 134695760 && 4)) : buf.subarray(0, i4); - if (add3) - add3.push(dat, !!f); + var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 134695760 && 4)) : buf.subarray(0, i3); + if (add2) + add2.push(dat, !!f); else this.k[+(f == 2)].push(dat); } if (f & 2) - return this.push(buf.subarray(i4), final); - this.p = buf.subarray(i4); + return this.push(buf.subarray(i3), final); + this.p = buf.subarray(i3); } if (final) { if (this.c) - err2(13); + err(13); this.p = null; } }; @@ -287380,42 +211031,42 @@ var init_esm6 = __esm(() => { }); // src/utils/dxt/zip.ts -import { isAbsolute as isAbsolute9, normalize as normalize8 } from "path"; +import { isAbsolute as isAbsolute8, normalize as normalize7 } from "path"; function isPathSafe(filePath) { if (containsPathTraversal(filePath)) { return false; } - const normalized = normalize8(filePath); - if (isAbsolute9(normalized)) { + const normalized = normalize7(filePath); + if (isAbsolute8(normalized)) { return false; } return true; } function validateZipFile(file2, state) { state.fileCount++; - let error45; + let error41; if (state.fileCount > LIMITS.MAX_FILE_COUNT) { - error45 = `Archive contains too many files: ${state.fileCount} (max: ${LIMITS.MAX_FILE_COUNT})`; + error41 = `Archive contains too many files: ${state.fileCount} (max: ${LIMITS.MAX_FILE_COUNT})`; } if (!isPathSafe(file2.name)) { - error45 = `Unsafe file path detected: "${file2.name}". Path traversal or absolute paths are not allowed.`; + error41 = `Unsafe file path detected: "${file2.name}". Path traversal or absolute paths are not allowed.`; } const fileSize = file2.originalSize || 0; if (fileSize > LIMITS.MAX_FILE_SIZE) { - error45 = `File "${file2.name}" is too large: ${Math.round(fileSize / 1024 / 1024)}MB (max: ${Math.round(LIMITS.MAX_FILE_SIZE / 1024 / 1024)}MB)`; + error41 = `File "${file2.name}" is too large: ${Math.round(fileSize / 1024 / 1024)}MB (max: ${Math.round(LIMITS.MAX_FILE_SIZE / 1024 / 1024)}MB)`; } state.totalUncompressedSize += fileSize; if (state.totalUncompressedSize > LIMITS.MAX_TOTAL_SIZE) { - error45 = `Archive total size is too large: ${Math.round(state.totalUncompressedSize / 1024 / 1024)}MB (max: ${Math.round(LIMITS.MAX_TOTAL_SIZE / 1024 / 1024)}MB)`; + error41 = `Archive total size is too large: ${Math.round(state.totalUncompressedSize / 1024 / 1024)}MB (max: ${Math.round(LIMITS.MAX_TOTAL_SIZE / 1024 / 1024)}MB)`; } const currentRatio = state.totalUncompressedSize / state.compressedSize; if (currentRatio > LIMITS.MAX_COMPRESSION_RATIO) { - error45 = `Suspicious compression ratio detected: ${currentRatio.toFixed(1)}:1 (max: ${LIMITS.MAX_COMPRESSION_RATIO}:1). This may be a zip bomb.`; + error41 = `Suspicious compression ratio detected: ${currentRatio.toFixed(1)}:1 (max: ${LIMITS.MAX_COMPRESSION_RATIO}:1). This may be a zip bomb.`; } - return error45 ? { isValid: false, error: error45 } : { isValid: true }; + return error41 ? { isValid: false, error: error41 } : { isValid: true }; } async function unzipFile(zipData) { - const { unzipSync: unzipSync3 } = await Promise.resolve().then(() => (init_esm6(), exports_esm2)); + const { unzipSync: unzipSync2 } = await Promise.resolve().then(() => (init_esm5(), exports_esm2)); const compressedSize = zipData.length; const state = { fileCount: 0, @@ -287423,7 +211074,7 @@ async function unzipFile(zipData) { compressedSize, errors: [] }; - const result3 = unzipSync3(new Uint8Array(zipData), { + const result2 = unzipSync2(new Uint8Array(zipData), { filter: (file2) => { const validationResult = validateZipFile(file2, state); if (!validationResult.isValid) { @@ -287433,16 +211084,16 @@ async function unzipFile(zipData) { } }); logForDebugging(`Zip extraction completed: ${state.fileCount} files, ${Math.round(state.totalUncompressedSize / 1024)}KB uncompressed`); - return result3; + return result2; } function parseZipModes(data) { const buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength); const modes = {}; const minEocd = Math.max(0, buf.length - 22 - 65535); let eocd = -1; - for (let i4 = buf.length - 22;i4 >= minEocd; i4--) { - if (buf.readUInt32LE(i4) === 101010256) { - eocd = i4; + for (let i3 = buf.length - 22;i3 >= minEocd; i3--) { + if (buf.readUInt32LE(i3) === 101010256) { + eocd = i3; break; } } @@ -287450,7 +211101,7 @@ function parseZipModes(data) { return modes; const entryCount = buf.readUInt16LE(eocd + 10); let off = buf.readUInt32LE(eocd + 16); - for (let i4 = 0;i4 < entryCount; i4++) { + for (let i3 = 0;i3 < entryCount; i3++) { if (off + 46 > buf.length || buf.readUInt32LE(off) !== 33639248) break; const versionMadeBy = buf.readUInt16LE(off + 4); @@ -287469,7 +211120,7 @@ function parseZipModes(data) { return modes; } var LIMITS; -var init_zip3 = __esm(() => { +var init_zip2 = __esm(() => { init_debug(); init_errors(); init_fsOperations(); @@ -287484,35 +211135,35 @@ var init_zip3 = __esm(() => { }); // src/utils/systemDirectories.ts -import { homedir as homedir15 } from "os"; -import { join as join48 } from "path"; +import { homedir as homedir13 } from "os"; +import { join as join38 } from "path"; function getSystemDirectories(options2) { const platform2 = options2?.platform ?? getPlatform(); - const homeDir = options2?.homedir ?? homedir15(); - const env5 = options2?.env ?? process.env; - const defaults4 = { + const homeDir = options2?.homedir ?? homedir13(); + const env4 = options2?.env ?? process.env; + const defaults3 = { HOME: homeDir, - DESKTOP: join48(homeDir, "Desktop"), - DOCUMENTS: join48(homeDir, "Documents"), - DOWNLOADS: join48(homeDir, "Downloads") + DESKTOP: join38(homeDir, "Desktop"), + DOCUMENTS: join38(homeDir, "Documents"), + DOWNLOADS: join38(homeDir, "Downloads") }; switch (platform2) { case "windows": { - const userProfile = env5.USERPROFILE || homeDir; + const userProfile = env4.USERPROFILE || homeDir; return { HOME: homeDir, - DESKTOP: join48(userProfile, "Desktop"), - DOCUMENTS: join48(userProfile, "Documents"), - DOWNLOADS: join48(userProfile, "Downloads") + DESKTOP: join38(userProfile, "Desktop"), + DOCUMENTS: join38(userProfile, "Documents"), + DOWNLOADS: join38(userProfile, "Downloads") }; } case "linux": case "wsl": { return { HOME: homeDir, - DESKTOP: env5.XDG_DESKTOP_DIR || defaults4.DESKTOP, - DOCUMENTS: env5.XDG_DOCUMENTS_DIR || defaults4.DOCUMENTS, - DOWNLOADS: env5.XDG_DOWNLOAD_DIR || defaults4.DOWNLOADS + DESKTOP: env4.XDG_DESKTOP_DIR || defaults3.DESKTOP, + DOCUMENTS: env4.XDG_DOCUMENTS_DIR || defaults3.DOCUMENTS, + DOWNLOADS: env4.XDG_DOWNLOAD_DIR || defaults3.DOWNLOADS }; } case "macos": @@ -287520,7 +211171,7 @@ function getSystemDirectories(options2) { if (platform2 === "unknown") { logForDebugging(`Unknown platform detected, using default paths`); } - return defaults4; + return defaults3; } } } @@ -287530,9 +211181,9 @@ var init_systemDirectories = __esm(() => { }); // src/utils/plugins/mcpbHandler.ts -import { createHash as createHash4 } from "crypto"; -import { chmod, writeFile as writeFile6 } from "fs/promises"; -import { dirname as dirname24, join as join49 } from "path"; +import { createHash as createHash3 } from "crypto"; +import { chmod, writeFile as writeFile4 } from "fs/promises"; +import { dirname as dirname21, join as join39 } from "path"; function isMcpbSource(source) { return source.endsWith(".mcpb") || source.endsWith(".dxt"); } @@ -287540,14 +211191,14 @@ function isUrl2(source) { return source.startsWith("http://") || source.startsWith("https://"); } function generateContentHash(data) { - return createHash4("sha256").update(data).digest("hex").substring(0, 16); + return createHash3("sha256").update(data).digest("hex").substring(0, 16); } function getMcpbCacheDir(pluginPath) { - return join49(pluginPath, ".mcpb-cache"); + return join39(pluginPath, ".mcpb-cache"); } function getMetadataPath(cacheDir, source) { - const sourceHash = createHash4("md5").update(source).digest("hex").substring(0, 8); - return join49(cacheDir, `${sourceHash}.metadata.json`); + const sourceHash = createHash3("md5").update(source).digest("hex").substring(0, 8); + return join39(cacheDir, `${sourceHash}.metadata.json`); } function serverSecretsKey(pluginId, serverName) { return `${pluginId}/${serverName}`; @@ -287562,18 +211213,18 @@ function loadMcpServerUserConfig(pluginId, serverName) { } logForDebugging(`Loaded user config for ${pluginId}/${serverName} (settings + secureStorage)`); return { ...nonSensitive, ...sensitive }; - } catch (error45) { - const errorObj = toError(error45); + } catch (error41) { + const errorObj = toError(error41); logError2(errorObj); - logForDebugging(`Failed to load user config for ${pluginId}/${serverName}: ${error45}`, { level: "error" }); + logForDebugging(`Failed to load user config for ${pluginId}/${serverName}: ${error41}`, { level: "error" }); return null; } } -function saveMcpServerUserConfig(pluginId, serverName, config4, schema) { +function saveMcpServerUserConfig(pluginId, serverName, config2, schema) { try { const nonSensitive = {}; const sensitive = {}; - for (const [key, value] of Object.entries(config4)) { + for (const [key, value] of Object.entries(config2)) { if (schema[key]?.sensitive === true) { sensitive[key] = String(value); } else { @@ -287596,12 +211247,12 @@ function saveMcpServerUserConfig(pluginId, serverName, config4, schema) { ...secureScrubbed, ...sensitive }; - const result3 = storage.update(existing); - if (!result3.success) { + const result2 = storage.update(existing); + if (!result2.success) { throw new Error(`Failed to save sensitive config to secure storage for ${k}`); } - if (result3.warning) { - logForDebugging(`Server secrets save warning: ${result3.warning}`, { + if (result2.warning) { + logForDebugging(`Server secrets save warning: ${result2.warning}`, { level: "warn" }); } @@ -287627,27 +211278,27 @@ function saveMcpServerUserConfig(pluginId, serverName, config4, schema) { ...nonSensitive, ...scrubbed }; - const result3 = updateSettingsForSource("userSettings", settings); - if (result3.error) { - throw result3.error; + const result2 = updateSettingsForSource("userSettings", settings); + if (result2.error) { + throw result2.error; } if (keysToScrubFromSettings.length > 0) { logForDebugging(`saveMcpServerUserConfig: scrubbed ${keysToScrubFromSettings.length} plaintext sensitive key(s) from settings.json for ${pluginId}/${serverName}`); } } logForDebugging(`Saved user config for ${pluginId}/${serverName} (${Object.keys(nonSensitive).length} non-sensitive, ${Object.keys(sensitive).length} sensitive)`); - } catch (error45) { - const errorObj = toError(error45); + } catch (error41) { + const errorObj = toError(error41); logError2(errorObj); throw new Error(`Failed to save user configuration for ${pluginId}/${serverName}: ${errorObj.message}`); } } -function validateUserConfig2(values4, schema) { - const errors5 = []; +function validateUserConfig2(values2, schema) { + const errors4 = []; for (const [key, fieldSchema] of Object.entries(schema)) { - const value = values4[key]; + const value = values2[key]; if (fieldSchema.required && (value === undefined || value === "")) { - errors5.push(`${fieldSchema.title || key} is required but not provided`); + errors4.push(`${fieldSchema.title || key} is required but not provided`); continue; } if (value === undefined || value === "") { @@ -287656,34 +211307,34 @@ function validateUserConfig2(values4, schema) { if (fieldSchema.type === "string") { if (Array.isArray(value)) { if (!fieldSchema.multiple) { - errors5.push(`${fieldSchema.title || key} must be a string, not an array`); + errors4.push(`${fieldSchema.title || key} must be a string, not an array`); } else if (!value.every((v) => typeof v === "string")) { - errors5.push(`${fieldSchema.title || key} must be an array of strings`); + errors4.push(`${fieldSchema.title || key} must be an array of strings`); } } else if (typeof value !== "string") { - errors5.push(`${fieldSchema.title || key} must be a string`); + errors4.push(`${fieldSchema.title || key} must be a string`); } } else if (fieldSchema.type === "number" && typeof value !== "number") { - errors5.push(`${fieldSchema.title || key} must be a number`); + errors4.push(`${fieldSchema.title || key} must be a number`); } else if (fieldSchema.type === "boolean" && typeof value !== "boolean") { - errors5.push(`${fieldSchema.title || key} must be a boolean`); + errors4.push(`${fieldSchema.title || key} must be a boolean`); } else if ((fieldSchema.type === "file" || fieldSchema.type === "directory") && typeof value !== "string") { - errors5.push(`${fieldSchema.title || key} must be a path string`); + errors4.push(`${fieldSchema.title || key} must be a path string`); } if (fieldSchema.type === "number" && typeof value === "number") { if (fieldSchema.min !== undefined && value < fieldSchema.min) { - errors5.push(`${fieldSchema.title || key} must be at least ${fieldSchema.min}`); + errors4.push(`${fieldSchema.title || key} must be at least ${fieldSchema.min}`); } if (fieldSchema.max !== undefined && value > fieldSchema.max) { - errors5.push(`${fieldSchema.title || key} must be at most ${fieldSchema.max}`); + errors4.push(`${fieldSchema.title || key} must be at most ${fieldSchema.max}`); } } } - return { valid: errors5.length === 0, errors: errors5 }; + return { valid: errors4.length === 0, errors: errors4 }; } async function generateMcpConfig(manifest, extractedPath, userConfig = {}) { - const { getMcpConfigForManifest: getMcpConfigForManifest2 } = await Promise.resolve().then(() => (init_dist7(), exports_dist)); - const mcpConfig = await getMcpConfigForManifest2({ + const { getMcpConfigForManifest } = await Promise.resolve().then(() => (init_mcpb(), exports_mcpb)); + const mcpConfig = await getMcpConfigForManifest({ manifest, extensionPath: extractedPath, systemDirs: getSystemDirectories(), @@ -287691,25 +211342,25 @@ async function generateMcpConfig(manifest, extractedPath, userConfig = {}) { pathSeparator: "/" }); if (!mcpConfig) { - const error45 = new Error(`Failed to generate MCP server configuration from manifest "${manifest.name}"`); - logError2(error45); - throw error45; + const error41 = new Error(`Failed to generate MCP server configuration from manifest "${manifest.name}"`); + logError2(error41); + throw error41; } return mcpConfig; } async function loadCacheMetadata(cacheDir, source) { - const fs8 = getFsImplementation(); + const fs2 = getFsImplementation(); const metadataPath = getMetadataPath(cacheDir, source); try { - const content = await fs8.readFile(metadataPath, { encoding: "utf-8" }); + const content = await fs2.readFile(metadataPath, { encoding: "utf-8" }); return jsonParse(content); - } catch (error45) { - const code = getErrnoCode(error45); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") return null; - const errorObj = toError(error45); + const errorObj = toError(error41); logError2(errorObj); - logForDebugging(`Failed to load MCPB cache metadata: ${error45}`, { + logForDebugging(`Failed to load MCPB cache metadata: ${error41}`, { level: "error" }); return null; @@ -287718,7 +211369,7 @@ async function loadCacheMetadata(cacheDir, source) { async function saveCacheMetadata(cacheDir, source, metadata) { const metadataPath = getMetadataPath(cacheDir, source); await getFsImplementation().mkdir(cacheDir); - await writeFile6(metadataPath, jsonStringify(metadata, null, 2), "utf-8"); + await writeFile4(metadataPath, jsonStringify(metadata, null, 2), "utf-8"); } async function downloadMcpb(url3, destPath, onProgress) { logForDebugging(`Downloading MCPB from ${url3}`); @@ -287742,17 +211393,17 @@ async function downloadMcpb(url3, destPath, onProgress) { const data = new Uint8Array(response.data); logPluginFetch("mcpb", url3, "success", performance.now() - started); fetchTelemetryFired = true; - await writeFile6(destPath, Buffer.from(data)); + await writeFile4(destPath, Buffer.from(data)); logForDebugging(`Downloaded ${data.length} bytes to ${destPath}`); if (onProgress) { onProgress("Download complete"); } return data; - } catch (error45) { + } catch (error41) { if (!fetchTelemetryFired) { - logPluginFetch("mcpb", url3, "failure", performance.now() - started, classifyFetchError(error45)); + logPluginFetch("mcpb", url3, "failure", performance.now() - started, classifyFetchError(error41)); } - const errorMsg = errorMessage(error45); + const errorMsg = errorMessage(error41); const fullError = new Error(`Failed to download MCPB file from ${url3}: ${errorMsg}`); logError2(fullError); throw fullError; @@ -287767,17 +211418,17 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) { const entries = Object.entries(unzipped).filter(([k]) => !k.endsWith("/")); const totalFiles = entries.length; for (const [filePath, fileData] of entries) { - const fullPath = join49(extractPath, filePath); - const dir = dirname24(fullPath); + const fullPath = join39(extractPath, filePath); + const dir = dirname21(fullPath); if (dir !== extractPath) { await getFsImplementation().mkdir(dir); } const isTextFile = filePath.endsWith(".json") || filePath.endsWith(".js") || filePath.endsWith(".ts") || filePath.endsWith(".txt") || filePath.endsWith(".md") || filePath.endsWith(".yml") || filePath.endsWith(".yaml"); if (isTextFile) { const content = new TextDecoder().decode(fileData); - await writeFile6(fullPath, content, "utf-8"); + await writeFile4(fullPath, content, "utf-8"); } else { - await writeFile6(fullPath, Buffer.from(fileData)); + await writeFile4(fullPath, Buffer.from(fileData)); } const mode = modes[filePath]; if (mode && mode & 73) { @@ -287794,34 +211445,34 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) { } } async function checkMcpbChanged(source, pluginPath) { - const fs8 = getFsImplementation(); + const fs2 = getFsImplementation(); const cacheDir = getMcpbCacheDir(pluginPath); const metadata = await loadCacheMetadata(cacheDir, source); if (!metadata) { return true; } try { - await fs8.stat(metadata.extractedPath); - } catch (error45) { - const code = getErrnoCode(error45); + await fs2.stat(metadata.extractedPath); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") { logForDebugging(`MCPB extraction path missing: ${metadata.extractedPath}`); } else { - logForDebugging(`MCPB extraction path inaccessible: ${metadata.extractedPath}: ${error45}`, { level: "error" }); + logForDebugging(`MCPB extraction path inaccessible: ${metadata.extractedPath}: ${error41}`, { level: "error" }); } return true; } if (!isUrl2(source)) { - const localPath = join49(pluginPath, source); + const localPath = join39(pluginPath, source); let stats; try { - stats = await fs8.stat(localPath); - } catch (error45) { - const code = getErrnoCode(error45); + stats = await fs2.stat(localPath); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") { logForDebugging(`MCPB source file missing: ${localPath}`); } else { - logForDebugging(`MCPB source file inaccessible: ${localPath}: ${error45}`, { level: "error" }); + logForDebugging(`MCPB source file inaccessible: ${localPath}: ${error41}`, { level: "error" }); } return true; } @@ -287835,24 +211486,24 @@ async function checkMcpbChanged(source, pluginPath) { return false; } async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUserConfig, forceConfigDialog) { - const fs8 = getFsImplementation(); + const fs2 = getFsImplementation(); const cacheDir = getMcpbCacheDir(pluginPath); - await fs8.mkdir(cacheDir); + await fs2.mkdir(cacheDir); logForDebugging(`Loading MCPB from source: ${source}`); const metadata = await loadCacheMetadata(cacheDir, source); if (metadata && !await checkMcpbChanged(source, pluginPath)) { logForDebugging(`Using cached MCPB from ${metadata.extractedPath} (hash: ${metadata.contentHash})`); - const manifestPath = join49(metadata.extractedPath, "manifest.json"); + const manifestPath = join39(metadata.extractedPath, "manifest.json"); let manifestContent; try { - manifestContent = await fs8.readFile(manifestPath, { encoding: "utf-8" }); - } catch (error45) { - if (isENOENT(error45)) { - const err3 = new Error(`Cached manifest not found: ${manifestPath}`); - logError2(err3); - throw err3; + manifestContent = await fs2.readFile(manifestPath, { encoding: "utf-8" }); + } catch (error41) { + if (isENOENT(error41)) { + const err2 = new Error(`Cached manifest not found: ${manifestPath}`); + logError2(err2); + throw err2; } - throw error45; + throw error41; } const manifestData2 = new TextEncoder().encode(manifestContent); const manifest2 = await parseAndValidateManifestFromBytes(manifestData2); @@ -287894,24 +211545,24 @@ async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUs let mcpbData; let mcpbFilePath; if (isUrl2(source)) { - const sourceHash = createHash4("md5").update(source).digest("hex").substring(0, 8); - mcpbFilePath = join49(cacheDir, `${sourceHash}.mcpb`); + const sourceHash = createHash3("md5").update(source).digest("hex").substring(0, 8); + mcpbFilePath = join39(cacheDir, `${sourceHash}.mcpb`); mcpbData = await downloadMcpb(source, mcpbFilePath, onProgress); } else { - const localPath = join49(pluginPath, source); + const localPath = join39(pluginPath, source); if (onProgress) { onProgress(`Loading ${source}...`); } try { - mcpbData = await fs8.readFileBytes(localPath); + mcpbData = await fs2.readFileBytes(localPath); mcpbFilePath = localPath; - } catch (error45) { - if (isENOENT(error45)) { - const err3 = new Error(`MCPB file not found: ${localPath}`); - logError2(err3); - throw err3; + } catch (error41) { + if (isENOENT(error41)) { + const err2 = new Error(`MCPB file not found: ${localPath}`); + logError2(err2); + throw err2; } - throw error45; + throw error41; } } const contentHash = generateContentHash(mcpbData); @@ -287923,18 +211574,18 @@ async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUs const modes = parseZipModes(mcpbData); const manifestData = unzipped["manifest.json"]; if (!manifestData) { - const error45 = new Error("No manifest.json found in MCPB file"); - logError2(error45); - throw error45; + const error41 = new Error("No manifest.json found in MCPB file"); + logError2(error41); + throw error41; } const manifest = await parseAndValidateManifestFromBytes(manifestData); logForDebugging(`MCPB manifest: ${manifest.name} v${manifest.version} by ${manifest.author.name}`); if (!manifest.server) { - const error45 = new Error(`MCPB manifest for "${manifest.name}" does not define a server configuration`); - logError2(error45); - throw error45; + const error41 = new Error(`MCPB manifest for "${manifest.name}" does not define a server configuration`); + logError2(error41); + throw error41; } - const extractPath = join49(cacheDir, contentHash); + const extractPath = join39(cacheDir, contentHash); await extractMcpbContents(unzipped, extractPath, modes, onProgress); if (manifest.user_config && Object.keys(manifest.user_config).length > 0) { const serverName = manifest.name; @@ -288006,7 +211657,7 @@ var init_mcpbHandler = __esm(() => { init_axios2(); init_debug(); init_helpers(); - init_zip3(); + init_zip2(); init_errors(); init_fsOperations(); init_log3(); @@ -288024,10 +211675,10 @@ function getPluginStorageId(plugin) { function clearPluginOptionsCache() { loadPluginOptions.cache?.clear?.(); } -function savePluginOptions(pluginId, values4, schema) { +function savePluginOptions(pluginId, values2, schema) { const nonSensitive = {}; const sensitive = {}; - for (const [key, value] of Object.entries(values4)) { + for (const [key, value] of Object.entries(values2)) { if (schema[key]?.sensitive === true) { sensitive[key] = String(value); } else { @@ -288049,14 +211700,14 @@ function savePluginOptions(pluginId, values4, schema) { ...secureScrubbed, ...sensitive }; - const result3 = storage.update(existing); - if (!result3.success) { - const err3 = new Error(`Failed to save sensitive plugin options for ${pluginId} to secure storage`); - logError2(err3); - throw err3; + const result2 = storage.update(existing); + if (!result2.success) { + const err2 = new Error(`Failed to save sensitive plugin options for ${pluginId} to secure storage`); + logError2(err2); + throw err2; } - if (result3.warning) { - logForDebugging(`Plugin secrets save warning: ${result3.warning}`, { + if (result2.warning) { + logForDebugging(`Plugin secrets save warning: ${result2.warning}`, { level: "warn" }); } @@ -288076,10 +211727,10 @@ function savePluginOptions(pluginId, values4, schema) { ...nonSensitive, ...scrubbed }; - const result3 = updateSettingsForSource("userSettings", settings); - if (result3.error) { - logError2(result3.error); - throw new Error(`Failed to save plugin options for ${pluginId}: ${result3.error.message}`); + const result2 = updateSettingsForSource("userSettings", settings); + if (result2.error) { + logError2(result2.error); + throw new Error(`Failed to save plugin options for ${pluginId}: ${result2.error.message}`); } } clearPluginOptionsCache(); @@ -288088,11 +211739,11 @@ function deletePluginOptions(pluginId) { const settings = getSettings_DEPRECATED(); if (settings.pluginConfigs?.[pluginId]) { const pluginConfigs = { [pluginId]: undefined }; - const { error: error45 } = updateSettingsForSource("userSettings", { + const { error: error41 } = updateSettingsForSource("userSettings", { pluginConfigs }); - if (error45) { - logForDebugging(`deletePluginOptions: failed to clear settings.pluginConfigs[${pluginId}]: ${error45.message}`, { level: "warn" }); + if (error41) { + logForDebugging(`deletePluginOptions: failed to clear settings.pluginConfigs[${pluginId}]: ${error41.message}`, { level: "warn" }); } } const storage = getSecureStorage(); @@ -288101,11 +211752,11 @@ function deletePluginOptions(pluginId) { const prefix = `${pluginId}/`; const survivingEntries = Object.entries(existing.pluginSecrets).filter(([k]) => k !== pluginId && !k.startsWith(prefix)); if (survivingEntries.length !== Object.keys(existing.pluginSecrets).length) { - const result3 = storage.update({ + const result2 = storage.update({ ...existing, pluginSecrets: survivingEntries.length > 0 ? Object.fromEntries(survivingEntries) : undefined }); - if (!result3.success) { + if (!result2.success) { logForDebugging(`deletePluginOptions: failed to clear pluginSecrets for ${pluginId} from keychain`, { level: "warn" }); } } @@ -288132,11 +211783,11 @@ function getUnconfiguredOptions(plugin) { return unconfigured; } function substitutePluginVariables(value, plugin) { - const normalize9 = (p) => process.platform === "win32" ? p.replace(/\\/g, "/") : p; - let out = value.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, () => normalize9(plugin.path)); + const normalize8 = (p) => process.platform === "win32" ? p.replace(/\\/g, "/") : p; + let out = value.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, () => normalize8(plugin.path)); if (plugin.source) { const source = plugin.source; - out = out.replace(/\$\{CLAUDE_PLUGIN_DATA\}/g, () => normalize9(getPluginDataDir(source))); + out = out.replace(/\$\{CLAUDE_PLUGIN_DATA\}/g, () => normalize8(getPluginDataDir(source))); } return out; } @@ -288180,19 +211831,19 @@ var init_pluginOptionsStorage = __esm(() => { }); // src/utils/plugins/walkPluginMarkdown.ts -import { join as join50 } from "path"; +import { join as join40 } from "path"; async function walkPluginMarkdown(rootDir, onFile, opts = {}) { - const fs8 = getFsImplementation(); + const fs2 = getFsImplementation(); const label = opts.logLabel ?? "plugin"; async function scan(dirPath, namespace) { try { - const entries = await fs8.readdir(dirPath); + const entries = await fs2.readdir(dirPath); if (opts.stopAtSkillDir && entries.some((e) => e.isFile() && SKILL_MD_RE.test(e.name))) { - await Promise.all(entries.map((entry) => entry.isFile() && entry.name.toLowerCase().endsWith(".md") ? onFile(join50(dirPath, entry.name), namespace) : undefined)); + await Promise.all(entries.map((entry) => entry.isFile() && entry.name.toLowerCase().endsWith(".md") ? onFile(join40(dirPath, entry.name), namespace) : undefined)); return; } await Promise.all(entries.map((entry) => { - const fullPath = join50(dirPath, entry.name); + const fullPath = join40(dirPath, entry.name); if (entry.isDirectory()) { return scan(fullPath, [...namespace, entry.name]); } @@ -288201,8 +211852,8 @@ async function walkPluginMarkdown(rootDir, onFile, opts = {}) { } return; })); - } catch (error45) { - logForDebugging(`Failed to scan ${label} directory ${dirPath}: ${error45}`, { level: "error" }); + } catch (error41) { + logForDebugging(`Failed to scan ${label} directory ${dirPath}: ${error41}`, { level: "error" }); } } await scan(rootDir, []); @@ -288215,7 +211866,7 @@ var init_walkPluginMarkdown = __esm(() => { }); // src/utils/plugins/loadPluginAgents.ts -import { basename as basename10 } from "path"; +import { basename as basename8 } from "path"; async function loadAgentsFromDirectory(agentsPath, pluginName, sourceName, pluginPath, pluginManifest, loadedPaths) { const agents = []; await walkPluginMarkdown(agentsPath, async (fullPath, namespace) => { @@ -288226,14 +211877,14 @@ async function loadAgentsFromDirectory(agentsPath, pluginName, sourceName, plugi return agents; } async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pluginPath, pluginManifest, loadedPaths) { - const fs8 = getFsImplementation(); - if (isDuplicatePath(fs8, filePath, loadedPaths)) { + const fs2 = getFsImplementation(); + if (isDuplicatePath(fs2, filePath, loadedPaths)) { return null; } try { - const content = await fs8.readFile(filePath, { encoding: "utf-8" }); + const content = await fs2.readFile(filePath, { encoding: "utf-8" }); const { frontmatter, content: markdownContent } = parseFrontmatter(content, filePath); - const baseAgentName = frontmatter.name || basename10(filePath).replace(/\.md$/, ""); + const baseAgentName = frontmatter.name || basename8(filePath).replace(/\.md$/, ""); const nameParts = [pluginName, ...namespace, baseAgentName]; const agentType = nameParts.join(":"); const whenToUse = coerceDescriptionToString(frontmatter.description, agentType) ?? coerceDescriptionToString(frontmatter["when-to-use"], agentType) ?? `Agent from ${pluginName} plugin`; @@ -288320,8 +211971,8 @@ async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pl ...effort !== undefined ? { effort } : {}, ...maxTurns !== undefined ? { maxTurns } : {} }; - } catch (error45) { - logForDebugging(`Failed to load agent from ${filePath}: ${error45}`, { + } catch (error41) { + logForDebugging(`Failed to load agent from ${filePath}: ${error41}`, { level: "error" }); return null; @@ -288347,9 +211998,9 @@ var init_loadPluginAgents = __esm(() => { init_walkPluginMarkdown(); VALID_MEMORY_SCOPES = ["user", "project", "local"]; loadPluginAgents = memoize_default(async () => { - const { enabled, errors: errors5 } = await loadAllPluginsCacheOnly(); - if (errors5.length > 0) { - logForDebugging(`Plugin loading errors: ${errors5.map((e) => getPluginErrorMessage(e)).join(", ")}`); + const { enabled, errors: errors4 } = await loadAllPluginsCacheOnly(); + if (errors4.length > 0) { + logForDebugging(`Plugin loading errors: ${errors4.map((e) => getPluginErrorMessage(e)).join(", ")}`); } const perPluginAgents = await Promise.all(enabled.map(async (plugin) => { const loadedPaths = new Set; @@ -288361,15 +212012,15 @@ var init_loadPluginAgents = __esm(() => { if (agents.length > 0) { logForDebugging(`Loaded ${agents.length} agents from plugin ${plugin.name} default directory`); } - } catch (error45) { - logForDebugging(`Failed to load agents from plugin ${plugin.name} default directory: ${error45}`, { level: "error" }); + } catch (error41) { + logForDebugging(`Failed to load agents from plugin ${plugin.name} default directory: ${error41}`, { level: "error" }); } } if (plugin.agentsPaths) { const pathResults = await Promise.all(plugin.agentsPaths.map(async (agentPath) => { try { - const fs8 = getFsImplementation(); - const stats = await fs8.stat(agentPath); + const fs2 = getFsImplementation(); + const stats = await fs2.stat(agentPath); if (stats.isDirectory()) { const agents = await loadAgentsFromDirectory(agentPath, plugin.name, plugin.source, plugin.path, plugin.manifest, loadedPaths); if (agents.length > 0) { @@ -288384,8 +212035,8 @@ var init_loadPluginAgents = __esm(() => { } } return []; - } catch (error45) { - logForDebugging(`Failed to load agents from plugin ${plugin.name} custom path ${agentPath}: ${error45}`, { level: "error" }); + } catch (error41) { + logForDebugging(`Failed to load agents from plugin ${plugin.name} custom path ${agentPath}: ${error41}`, { level: "error" }); return []; } })); @@ -288449,22 +212100,22 @@ var init_agentColorManager = __esm(() => { }); // src/tools/AgentTool/agentMemorySnapshot.ts -import { mkdir as mkdir6, readdir as readdir10, readFile as readFile12, unlink as unlink3, writeFile as writeFile7 } from "fs/promises"; -import { join as join51 } from "path"; +import { mkdir as mkdir6, readdir as readdir10, readFile as readFile11, unlink as unlink3, writeFile as writeFile5 } from "fs/promises"; +import { join as join41 } from "path"; function getSnapshotDirForAgent(agentType) { - return join51(getCwd(), ".claude", SNAPSHOT_BASE, agentType); + return join41(getCwd(), ".claude", SNAPSHOT_BASE, agentType); } function getSnapshotJsonPath(agentType) { - return join51(getSnapshotDirForAgent(agentType), SNAPSHOT_JSON); + return join41(getSnapshotDirForAgent(agentType), SNAPSHOT_JSON); } function getSyncedJsonPath(agentType, scope) { - return join51(getAgentMemoryDir(agentType, scope), SYNCED_JSON); + return join41(getAgentMemoryDir(agentType, scope), SYNCED_JSON); } -async function readJsonFile(path16, schema) { +async function readJsonFile(path11, schema) { try { - const content = await readFile12(path16, { encoding: "utf-8" }); - const result3 = schema.safeParse(jsonParse(content)); - return result3.success ? result3.data : null; + const content = await readFile11(path11, { encoding: "utf-8" }); + const result2 = schema.safeParse(jsonParse(content)); + return result2.success ? result2.data : null; } catch { return null; } @@ -288474,14 +212125,14 @@ async function copySnapshotToLocal(agentType, scope) { const localMemDir = getAgentMemoryDir(agentType, scope); await mkdir6(localMemDir, { recursive: true }); try { - const files2 = await readdir10(snapshotMemDir, { withFileTypes: true }); - for (const dirent of files2) { + const files = await readdir10(snapshotMemDir, { withFileTypes: true }); + for (const dirent of files) { if (!dirent.isFile() || dirent.name === SNAPSHOT_JSON) continue; - const content = await readFile12(join51(snapshotMemDir, dirent.name), { + const content = await readFile11(join41(snapshotMemDir, dirent.name), { encoding: "utf-8" }); - await writeFile7(join51(localMemDir, dirent.name), content); + await writeFile5(join41(localMemDir, dirent.name), content); } } catch (e) { logForDebugging(`Failed to copy snapshot to local agent memory: ${e}`); @@ -288493,7 +212144,7 @@ async function saveSyncedMeta(agentType, scope, snapshotTimestamp) { await mkdir6(localMemDir, { recursive: true }); const meta = { syncedFrom: snapshotTimestamp }; try { - await writeFile7(syncedPath, jsonStringify(meta)); + await writeFile5(syncedPath, jsonStringify(meta)); } catch (e) { logForDebugging(`Failed to save snapshot sync metadata: ${e}`); } @@ -288652,7 +212303,7 @@ var init_claudeCodeGuideAgent = __esm(() => { init_prompt3(); init_prompt2(); init_prompt6(); - init_auth2(); + init_auth(); init_embeddedTools(); init_settings2(); init_slowOperations(); @@ -288694,7 +212345,7 @@ ${agentList}`); } const mcpClients = toolUseContext.options.mcpClients; if (mcpClients && mcpClients.length > 0) { - const mcpList = mcpClients.map((client5) => `- ${client5.name}`).join(` + const mcpList = mcpClients.map((client2) => `- ${client2.name}`).join(` `); contextSections.push(`**Configured MCP servers:** ${mcpList}`); @@ -289275,7 +212926,7 @@ __export(exports_loadAgentsDir, { filterAgentsByMcpRequirements: () => filterAgentsByMcpRequirements, clearAgentDefinitionsCache: () => clearAgentDefinitionsCache }); -import { basename as basename11 } from "path"; +import { basename as basename9 } from "path"; function isBuiltInAgent(agent) { return agent.source === "built-in"; } @@ -289321,17 +212972,17 @@ async function initializeAgentMemorySnapshots(agents) { await Promise.all(agents.map(async (agent) => { if (agent.memory !== "user") return; - const result3 = await checkAgentMemorySnapshot(agent.agentType, agent.memory); - switch (result3.action) { + const result2 = await checkAgentMemorySnapshot(agent.agentType, agent.memory); + switch (result2.action) { case "initialize": logForDebugging(`Initializing ${agent.agentType} memory from project snapshot`); - await initializeFromSnapshot(agent.agentType, agent.memory, result3.snapshotTimestamp); + await initializeFromSnapshot(agent.agentType, agent.memory, result2.snapshotTimestamp); break; case "prompt-update": agent.pendingSnapshotUpdate = { - snapshotTimestamp: result3.snapshotTimestamp + snapshotTimestamp: result2.snapshotTimestamp }; - logForDebugging(`Newer snapshot available for ${agent.agentType} memory (snapshot: ${result3.snapshotTimestamp})`); + logForDebugging(`Newer snapshot available for ${agent.agentType} memory (snapshot: ${result2.snapshotTimestamp})`); break; } })); @@ -289355,12 +213006,12 @@ function parseHooksFromFrontmatter(frontmatter, agentType) { if (!frontmatter.hooks) { return; } - const result3 = HooksSchema().safeParse(frontmatter.hooks); - if (!result3.success) { - logForDebugging(`Invalid hooks in agent '${agentType}': ${result3.error.message}`); + const result2 = HooksSchema().safeParse(frontmatter.hooks); + if (!result2.success) { + logForDebugging(`Invalid hooks in agent '${agentType}': ${result2.error.message}`); return; } - return result3.data; + return result2.data; } function parseAgentFromJson(name, definition, source = "flagSettings") { try { @@ -289407,10 +213058,10 @@ function parseAgentFromJson(name, definition, source = "flagSettings") { ...parsed.isolation ? { isolation: parsed.isolation } : {} }; return agent; - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Error parsing agent '${name}' from JSON: ${errorMessage2}`); - logError2(error45); + logError2(error41); return null; } } @@ -289418,10 +213069,10 @@ function parseAgentsFromJson(agentsJson, source = "flagSettings") { try { const parsed = AgentsJsonSchema().parse(agentsJson); return Object.entries(parsed).map(([name, def2]) => parseAgentFromJson(name, def2, source)).filter((agent) => agent !== null); - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Error parsing agents from JSON: ${errorMessage2}`); - logError2(error45); + logError2(error41); return []; } } @@ -289486,7 +213137,7 @@ function parseAgentFromMarkdown(filePath, baseDir, frontmatter, content, source) if (maxTurnsRaw !== undefined && maxTurns === undefined) { logForDebugging(`Agent file ${filePath} has invalid maxTurns '${maxTurnsRaw}'. Must be a positive integer.`); } - const filename = basename11(filePath, ".md"); + const filename = basename9(filePath, ".md"); let tools = parseAgentToolsFromFrontmatter(frontmatter["tools"]); if (isAutoMemoryEnabled() && memory && tools !== undefined) { const toolSet = new Set(tools); @@ -289509,11 +213160,11 @@ function parseAgentFromMarkdown(filePath, baseDir, frontmatter, content, source) let mcpServers; if (Array.isArray(mcpServersRaw)) { mcpServers = mcpServersRaw.map((item) => { - const result3 = AgentMcpServerSpecSchema().safeParse(item); - if (result3.success) { - return result3.data; + const result2 = AgentMcpServerSpecSchema().safeParse(item); + if (result2.success) { + return result2.data; } - logForDebugging(`Agent file ${filePath} has invalid mcpServers item: ${jsonStringify(item)}. Error: ${result3.error.message}`); + logForDebugging(`Agent file ${filePath} has invalid mcpServers item: ${jsonStringify(item)}. Error: ${result2.error.message}`); return null; }).filter((item) => item !== null); } @@ -289550,10 +213201,10 @@ function parseAgentFromMarkdown(filePath, baseDir, frontmatter, content, source) ...isolation ? { isolation } : {} }; return agentDef; - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Error parsing agent from ${filePath}: ${errorMessage2}`); - logError2(error45); + logError2(error41); return null; } } @@ -289657,10 +213308,10 @@ var init_loadAgentsDir = __esm(() => { allAgents: allAgentsList, failedFiles: failedFiles.length > 0 ? failedFiles : undefined }; - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Error loading agent definitions: ${errorMessage2}`); - logError2(error45); + logError2(error41); const builtInAgents = getBuiltInAgents(); return { activeAgents: builtInAgents, @@ -289714,28 +213365,28 @@ function formatCommandsWithinBudget(commands, contextWindowTokens) { cmd, full: formatCommandDescription(cmd) })); - const fullTotal = fullEntries.reduce((sum3, e) => sum3 + stringWidth(e.full), 0) + (fullEntries.length - 1); + const fullTotal = fullEntries.reduce((sum2, e) => sum2 + stringWidth(e.full), 0) + (fullEntries.length - 1); if (fullTotal <= budget) { return fullEntries.map((e) => e.full).join(` `); } const bundledIndices = new Set; const restCommands = []; - for (let i4 = 0;i4 < commands.length; i4++) { - const cmd = commands[i4]; + for (let i3 = 0;i3 < commands.length; i3++) { + const cmd = commands[i3]; if (cmd.type === "prompt" && cmd.source === "bundled") { - bundledIndices.add(i4); + bundledIndices.add(i3); } else { restCommands.push(cmd); } } - const bundledChars = fullEntries.reduce((sum3, e, i4) => bundledIndices.has(i4) ? sum3 + stringWidth(e.full) + 1 : sum3, 0); + const bundledChars = fullEntries.reduce((sum2, e, i3) => bundledIndices.has(i3) ? sum2 + stringWidth(e.full) + 1 : sum2, 0); const remainingBudget = budget - bundledChars; if (restCommands.length === 0) { return fullEntries.map((e) => e.full).join(` `); } - const restNameOverhead = restCommands.reduce((sum3, cmd) => sum3 + stringWidth(cmd.name) + 4, 0) + (restCommands.length - 1); + const restNameOverhead = restCommands.reduce((sum2, cmd) => sum2 + stringWidth(cmd.name) + 4, 0) + (restCommands.length - 1); const availableForDescs = remainingBudget - restNameOverhead; const maxDescLen = Math.floor(availableForDescs / restCommands.length); if (maxDescLen < MIN_DESC_LENGTH) { @@ -289750,7 +213401,7 @@ function formatCommandsWithinBudget(commands, contextWindowTokens) { bundled_chars: bundledChars }); } - return commands.map((cmd, i4) => bundledIndices.has(i4) ? fullEntries[i4].full : `- ${cmd.name}`).join(` + return commands.map((cmd, i3) => bundledIndices.has(i3) ? fullEntries[i3].full : `- ${cmd.name}`).join(` `); } const truncatedCount = count2(restCommands, (cmd) => stringWidth(getCommandDescription(cmd)) > maxDescLen); @@ -289766,9 +213417,9 @@ function formatCommandsWithinBudget(commands, contextWindowTokens) { bundled_chars: bundledChars }); } - return commands.map((cmd, i4) => { - if (bundledIndices.has(i4)) - return fullEntries[i4].full; + return commands.map((cmd, i3) => { + if (bundledIndices.has(i3)) + return fullEntries[i3].full; const description = getCommandDescription(cmd); return `- ${cmd.name}: ${truncate(description, maxDescLen)}`; }).join(` @@ -289794,8 +213445,8 @@ async function getSkillInfo(cwd2) { totalSkills: skills.length, includedSkills: skills.length }; - } catch (error45) { - logError2(toError(error45)); + } catch (error41) { + logError2(toError(error41)); return { totalSkills: 0, includedSkills: 0 @@ -289868,10 +213519,10 @@ function memoryFreshnessText(mtimeMs) { return `This memory is ${d} days old. ` + `Memories are point-in-time observations, not live state — ` + `claims about code behavior or file:line citations may be outdated. ` + `Verify against current code before asserting as fact.`; } function memoryFreshnessNote(mtimeMs) { - const text2 = memoryFreshnessText(mtimeMs); - if (!text2) + const text = memoryFreshnessText(mtimeMs); + if (!text) return ""; - return `${text2} + return `${text} `; } @@ -289973,9 +213624,9 @@ function createSyntheticOutputTool(jsonSchema) { const cached2 = toolCache.get(jsonSchema); if (cached2) return cached2; - const result3 = buildSyntheticOutputTool(jsonSchema); - toolCache.set(jsonSchema, result3); - return result3; + const result2 = buildSyntheticOutputTool(jsonSchema); + toolCache.set(jsonSchema, result2); + return result2; } function buildSyntheticOutputTool(jsonSchema) { try { @@ -289989,15 +213640,15 @@ function buildSyntheticOutputTool(jsonSchema) { tool: { ...SyntheticOutputTool, inputJSONSchema: jsonSchema, - async call(input3) { - const isValid3 = validateSchema(input3); - if (!isValid3) { - const errors5 = validateSchema.errors?.map((e) => `${e.instancePath || "root"}: ${e.message}`).join(", "); - throw new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`Output does not match required schema: ${errors5}`, `StructuredOutput schema mismatch: ${(errors5 ?? "").slice(0, 150)}`); + async call(input) { + const isValid2 = validateSchema(input); + if (!isValid2) { + const errors4 = validateSchema.errors?.map((e) => `${e.instancePath || "root"}: ${e.message}`).join(", "); + throw new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`Output does not match required schema: ${errors4}`, `StructuredOutput schema mismatch: ${(errors4 ?? "").slice(0, 150)}`); } return { data: "Structured output provided successfully", - structured_output: input3 + structured_output: input }; } } @@ -290044,26 +213695,26 @@ var init_SyntheticOutputTool = __esm(() => { get outputSchema() { return outputSchema(); }, - async call(input3) { + async call(input) { return { data: "Structured output provided successfully", - structured_output: input3 + structured_output: input }; }, - async checkPermissions(input3) { + async checkPermissions(input) { return { behavior: "allow", - updatedInput: input3 + updatedInput: input }; }, - renderToolUseMessage(input3) { - const keys3 = Object.keys(input3); - if (keys3.length === 0) + renderToolUseMessage(input) { + const keys2 = Object.keys(input); + if (keys2.length === 0) return null; - if (keys3.length <= 3) { - return keys3.map((k) => `${k}: ${jsonStringify(input3[k])}`).join(", "); + if (keys2.length <= 3) { + return keys2.map((k) => `${k}: ${jsonStringify(input[k])}`).join(", "); } - return `${keys3.length} fields: ${keys3.slice(0, 3).join(", ")}…`; + return `${keys2.length} fields: ${keys2.slice(0, 3).join(", ")}…`; }, renderToolUseRejectedMessage() { return "Structured output rejected"; @@ -290102,8 +213753,8 @@ __export(exports_constants, { var WORKFLOW_TOOL_NAME = "WorkflowTool"; // src/utils/cron.ts -function expandField(field, range3) { - const { min: min3, max: max5 } = range3; +function expandField(field, range2) { + const { min: min2, max: max3 } = range2; const out = new Set; for (const part of field.split(",")) { const stepMatch = part.match(/^\*(?:\/(\d+))?$/); @@ -290111,8 +213762,8 @@ function expandField(field, range3) { const step = stepMatch[1] ? parseInt(stepMatch[1], 10) : 1; if (step < 1) return null; - for (let i4 = min3;i4 <= max5; i4 += step) - out.add(i4); + for (let i3 = min2;i3 <= max3; i3 += step) + out.add(i3); continue; } const rangeMatch = part.match(/^(\d+)-(\d+)(?:\/(\d+))?$/); @@ -290120,21 +213771,21 @@ function expandField(field, range3) { const lo = parseInt(rangeMatch[1], 10); const hi = parseInt(rangeMatch[2], 10); const step = rangeMatch[3] ? parseInt(rangeMatch[3], 10) : 1; - const isDow = min3 === 0 && max5 === 6; - const effMax = isDow ? 7 : max5; - if (lo > hi || step < 1 || lo < min3 || hi > effMax) + const isDow = min2 === 0 && max3 === 6; + const effMax = isDow ? 7 : max3; + if (lo > hi || step < 1 || lo < min2 || hi > effMax) return null; - for (let i4 = lo;i4 <= hi; i4 += step) { - out.add(isDow && i4 === 7 ? 0 : i4); + for (let i3 = lo;i3 <= hi; i3 += step) { + out.add(isDow && i3 === 7 ? 0 : i3); } continue; } const singleMatch = part.match(/^\d+$/); if (singleMatch) { let n2 = parseInt(part, 10); - if (min3 === 0 && max5 === 6 && n2 === 7) + if (min2 === 0 && max3 === 6 && n2 === 7) n2 = 0; - if (n2 < min3 || n2 > max5) + if (n2 < min2 || n2 > max3) return null; out.add(n2); continue; @@ -290150,11 +213801,11 @@ function parseCronExpression(expr) { if (parts.length !== 5) return null; const expanded = []; - for (let i4 = 0;i4 < 5; i4++) { - const result3 = expandField(parts[i4], FIELD_RANGES[i4]); - if (!result3) + for (let i3 = 0;i3 < 5; i3++) { + const result2 = expandField(parts[i3], FIELD_RANGES[i3]); + if (!result2) return null; - expanded.push(result3); + expanded.push(result2); } return { minute: expanded[0], @@ -290176,7 +213827,7 @@ function computeNextCronRun(fields, from) { t.setSeconds(0, 0); t.setMinutes(t.getMinutes() + 1); const maxIter = 366 * 24 * 60; - for (let i4 = 0;i4 < maxIter; i4++) { + for (let i3 = 0;i3 < maxIter; i3++) { const month = t.getMonth() + 1; if (!monthSet.has(month)) { t.setMonth(t.getMonth() + 1, 1); @@ -290290,17 +213941,17 @@ var init_cron = __esm(() => { // src/utils/cronTasks.ts import { randomUUID as randomUUID5 } from "crypto"; -import { readFileSync as readFileSync16 } from "fs"; -import { mkdir as mkdir7, writeFile as writeFile8 } from "fs/promises"; -import { join as join52 } from "path"; +import { readFileSync as readFileSync9 } from "fs"; +import { mkdir as mkdir7, writeFile as writeFile6 } from "fs/promises"; +import { join as join42 } from "path"; function getCronFilePath(dir) { - return join52(dir ?? getProjectRoot(), CRON_FILE_REL); + return join42(dir ?? getProjectRoot(), CRON_FILE_REL); } async function readCronTasks(dir) { - const fs8 = getFsImplementation(); + const fs2 = getFsImplementation(); let raw; try { - raw = await fs8.readFile(getCronFilePath(dir), { encoding: "utf-8" }); + raw = await fs2.readFile(getCronFilePath(dir), { encoding: "utf-8" }); } catch (e) { if (isFsInaccessible(e)) return []; @@ -290338,7 +213989,7 @@ async function readCronTasks(dir) { function hasCronTasksSync(dir) { let raw; try { - raw = readFileSync16(getCronFilePath(dir), "utf-8"); + raw = readFileSync9(getCronFilePath(dir), "utf-8"); } catch { return false; } @@ -290349,12 +214000,12 @@ function hasCronTasksSync(dir) { return Array.isArray(tasks) && tasks.length > 0; } async function writeCronTasks(tasks, dir) { - const root3 = dir ?? getProjectRoot(); - await mkdir7(join52(root3, ".claude"), { recursive: true }); + const root2 = dir ?? getProjectRoot(); + await mkdir7(join42(root2, ".claude"), { recursive: true }); const body = { - tasks: tasks.map(({ durable: _durable, ...rest3 }) => rest3) + tasks: tasks.map(({ durable: _durable, ...rest2 }) => rest2) }; - await writeFile8(getCronFilePath(root3), jsonStringify(body, null, 2) + ` + await writeFile6(getCronFilePath(root2), jsonStringify(body, null, 2) + ` `, "utf-8"); } async function addCronTask(cron, prompt, recurring, durable, agentId) { @@ -290460,7 +214111,7 @@ var init_cronTasks = __esm(() => { init_json(); init_log3(); init_slowOperations(); - CRON_FILE_REL = join52(".claude", "scheduled_tasks.json"); + CRON_FILE_REL = join42(".claude", "scheduled_tasks.json"); DEFAULT_CRON_JITTER_CONFIG = { recurringFrac: 0.1, recurringCapMs: 15 * 60 * 1000, @@ -291059,7 +214710,7 @@ var init_forkSubagent = __esm(() => { init_xml(); init_coordinatorMode(); init_debug(); - init_messages5(); + init_messages3(); FORK_AGENT = { agentType: FORK_SUBAGENT_TYPE, whenToUse: "Implicit fork — inherits full conversation context. Not selectable via subagent_type; triggered by omitting subagent_type when the fork experiment is active.", @@ -291148,8 +214799,8 @@ function buildValues(diff3, lastComponent, newString, oldString, useLongestToken if (!component.removed) { if (!component.added && useLongestToken) { var value = newString.slice(newPos, newPos + component.count); - value = value.map(function(value2, i4) { - var oldValue = oldString[oldPos + i4]; + value = value.map(function(value2, i3) { + var oldValue = oldString[oldPos + i3]; return oldValue.length > value2.length ? oldValue : value2; }); component.value = diff3.join(value); @@ -291168,25 +214819,25 @@ function buildValues(diff3, lastComponent, newString, oldString, useLongestToken return components; } function longestCommonPrefix(str1, str2) { - var i4; - for (i4 = 0;i4 < str1.length && i4 < str2.length; i4++) { - if (str1[i4] != str2[i4]) { - return str1.slice(0, i4); + var i3; + for (i3 = 0;i3 < str1.length && i3 < str2.length; i3++) { + if (str1[i3] != str2[i3]) { + return str1.slice(0, i3); } } - return str1.slice(0, i4); + return str1.slice(0, i3); } function longestCommonSuffix(str1, str2) { - var i4; + var i3; if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) { return ""; } - for (i4 = 0;i4 < str1.length && i4 < str2.length; i4++) { - if (str1[str1.length - (i4 + 1)] != str2[str2.length - (i4 + 1)]) { - return str1.slice(-i4); + for (i3 = 0;i3 < str1.length && i3 < str2.length; i3++) { + if (str1[str1.length - (i3 + 1)] != str2[str2.length - (i3 + 1)]) { + return str1.slice(-i3); } } - return str1.slice(-i4); + return str1.slice(-i3); } function replacePrefix(string5, oldPrefix, newPrefix) { if (string5.slice(0, oldPrefix.length) != oldPrefix) { @@ -291221,28 +214872,28 @@ function overlapCount(a2, b) { if (a2.length < b.length) { endB = a2.length; } - var map6 = Array(endB); + var map4 = Array(endB); var k = 0; - map6[0] = 0; + map4[0] = 0; for (var j = 1;j < endB; j++) { if (b[j] == b[k]) { - map6[j] = map6[k]; + map4[j] = map4[k]; } else { - map6[j] = k; + map4[j] = k; } while (k > 0 && b[j] != b[k]) { - k = map6[k]; + k = map4[k]; } if (b[j] == b[k]) { k++; } } k = 0; - for (var i4 = startA;i4 < a2.length; i4++) { - while (k > 0 && a2[i4] != b[k]) { - k = map6[k]; + for (var i3 = startA;i3 < a2.length; i3++) { + while (k > 0 && a2[i3] != b[k]) { + k = map4[k]; } - if (a2[i4] == b[k]) { + if (a2[i3] == b[k]) { k++; } } @@ -291325,16 +214976,16 @@ function _toPrimitive(t, r) { return t; var e = t[Symbol.toPrimitive]; if (e !== undefined) { - var i4 = e.call(t, r || "default"); - if (typeof i4 != "object") - return i4; + var i3 = e.call(t, r || "default"); + if (typeof i3 != "object") + return i3; throw new TypeError("@@toPrimitive must return a primitive value."); } return (r === "string" ? String : Number)(t); } function _toPropertyKey(t) { - var i4 = _toPrimitive(t, "string"); - return typeof i4 == "symbol" ? i4 : i4 + ""; + var i3 = _toPrimitive(t, "string"); + return typeof i3 == "symbol" ? i3 : i3 + ""; } function _typeof(o2) { "@babel/helpers - typeof"; @@ -291385,8 +215036,8 @@ function _unsupportedIterableToArray(o2, minLen) { function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; - for (var i4 = 0, arr2 = new Array(len);i4 < len; i4++) - arr2[i4] = arr[i4]; + for (var i3 = 0, arr2 = new Array(len);i3 < len; i3++) + arr2[i3] = arr[i3]; return arr2; } function _nonIterableSpread() { @@ -291399,10 +215050,10 @@ function canonicalize(obj, stack, replacementStack, replacer, key) { if (replacer) { obj = replacer(key, obj); } - var i4; - for (i4 = 0;i4 < stack.length; i4 += 1) { - if (stack[i4] === obj) { - return replacementStack[i4]; + var i3; + for (i3 = 0;i3 < stack.length; i3 += 1) { + if (stack[i3] === obj) { + return replacementStack[i3]; } } var canonicalizedObj; @@ -291410,8 +215061,8 @@ function canonicalize(obj, stack, replacementStack, replacer, key) { stack.push(obj); canonicalizedObj = new Array(obj.length); replacementStack.push(canonicalizedObj); - for (i4 = 0;i4 < obj.length; i4 += 1) { - canonicalizedObj[i4] = canonicalize(obj[i4], stack, replacementStack, replacer, key); + for (i3 = 0;i3 < obj.length; i3 += 1) { + canonicalizedObj[i3] = canonicalize(obj[i3], stack, replacementStack, replacer, key); } stack.pop(); replacementStack.pop(); @@ -291431,8 +215082,8 @@ function canonicalize(obj, stack, replacementStack, replacer, key) { } } sortedKeys.sort(); - for (i4 = 0;i4 < sortedKeys.length; i4 += 1) { - _key = sortedKeys[i4]; + for (i3 = 0;i3 < sortedKeys.length; i3 += 1) { + _key = sortedKeys[i3]; canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); } stack.pop(); @@ -291487,12 +215138,12 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne var hunks = []; var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; var _loop = function _loop() { - var current = diff3[i4], lines = current.lines || splitLines2(current.value); + var current = diff3[i3], lines = current.lines || splitLines2(current.value); current.lines = lines; if (current.added || current.removed) { var _curRange; if (!oldRangeStart) { - var prev = diff3[i4 - 1]; + var prev = diff3[i3 - 1]; oldRangeStart = oldLine; newRangeStart = newLine; if (prev) { @@ -291511,7 +215162,7 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne } } else { if (oldRangeStart) { - if (lines.length <= options2.context * 2 && i4 < diff3.length - 2) { + if (lines.length <= options2.context * 2 && i3 < diff3.length - 2) { var _curRange2; (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); } else { @@ -291535,7 +215186,7 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne newLine += lines.length; } }; - for (var i4 = 0;i4 < diff3.length; i4++) { + for (var i3 = 0;i3 < diff3.length; i3++) { _loop(); } for (var _i = 0, _hunks = hunks;_i < _hunks.length; _i++) { @@ -291571,8 +215222,8 @@ function formatPatch(diff3) { ret.push("==================================================================="); ret.push("--- " + diff3.oldFileName + (typeof diff3.oldHeader === "undefined" ? "" : "\t" + diff3.oldHeader)); ret.push("+++ " + diff3.newFileName + (typeof diff3.newHeader === "undefined" ? "" : "\t" + diff3.newHeader)); - for (var i4 = 0;i4 < diff3.hunks.length; i4++) { - var hunk = diff3.hunks[i4]; + for (var i3 = 0;i3 < diff3.hunks.length; i3++) { + var hunk = diff3.hunks[i3]; if (hunk.oldLines === 0) { hunk.oldStart -= 1; } @@ -291615,20 +215266,20 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options2) { return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options2); } -function splitLines2(text2) { - var hasTrailingNl = text2.endsWith(` +function splitLines2(text) { + var hasTrailingNl = text.endsWith(` `); - var result3 = text2.split(` + var result2 = text.split(` `).map(function(line) { return line + ` `; }); if (hasTrailingNl) { - result3.pop(); + result2.pop(); } else { - result3.push(result3.pop().slice(0, -1)); + result2.push(result2.pop().slice(0, -1)); } - return result3; + return result2; } var characterDiff, extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", tokenizeIncludingWhitespace, wordDiff, wordWithSpaceDiff, lineDiff, sentenceDiff, cssDiff, jsonDiff, arrayDiff; var init_lib = __esm(() => { @@ -291731,26 +215382,26 @@ var init_lib = __esm(() => { } } }, - addToPath: function addToPath(path16, added, removed, oldPosInc, options2) { - var last3 = path16.lastComponent; - if (last3 && !options2.oneChangePerToken && last3.added === added && last3.removed === removed) { + addToPath: function addToPath(path11, added, removed, oldPosInc, options2) { + var last2 = path11.lastComponent; + if (last2 && !options2.oneChangePerToken && last2.added === added && last2.removed === removed) { return { - oldPos: path16.oldPos + oldPosInc, + oldPos: path11.oldPos + oldPosInc, lastComponent: { - count: last3.count + 1, + count: last2.count + 1, added, removed, - previousComponent: last3.previousComponent + previousComponent: last2.previousComponent } }; } else { return { - oldPos: path16.oldPos + oldPosInc, + oldPos: path11.oldPos + oldPosInc, lastComponent: { count: 1, added, removed, - previousComponent: last3 + previousComponent: last2 } }; } @@ -291790,9 +215441,9 @@ var init_lib = __esm(() => { }, removeEmpty: function removeEmpty(array3) { var ret = []; - for (var i4 = 0;i4 < array3.length; i4++) { - if (array3[i4]) { - ret.push(array3[i4]); + for (var i3 = 0;i3 < array3.length; i3++) { + if (array3[i3]) { + ret.push(array3[i3]); } } return ret; @@ -291800,10 +215451,10 @@ var init_lib = __esm(() => { castInput: function castInput(value) { return value; }, - tokenize: function tokenize6(value) { + tokenize: function tokenize5(value) { return Array.from(value); }, - join: function join53(chars) { + join: function join43(chars) { return chars.join(""); }, postProcess: function postProcess(changeObjects) { @@ -291856,8 +215507,8 @@ var init_lib = __esm(() => { return tokens; }; wordDiff.join = function(tokens) { - return tokens.map(function(token, i4) { - if (i4 == 0) { + return tokens.map(function(token, i3) { + if (i3 == 0) { return token; } else { return token.replace(/^\s+/, ""); @@ -291905,9 +215556,9 @@ var init_lib = __esm(() => { if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); } - for (var i4 = 0;i4 < linesAndNewlines.length; i4++) { - var line = linesAndNewlines[i4]; - if (i4 % 2 && !options2.newlineIsToken) { + for (var i3 = 0;i3 < linesAndNewlines.length; i3++) { + var line = linesAndNewlines[i3]; + if (i3 % 2 && !options2.newlineIsToken) { retLines[retLines.length - 1] += line; } else { retLines.push(line); @@ -291967,15 +215618,15 @@ var init_lib = __esm(() => { }); // src/services/api/promptCacheBreakDetection.ts -import { mkdir as mkdir8, writeFile as writeFile9 } from "fs/promises"; -import { join as join54 } from "path"; +import { mkdir as mkdir8, writeFile as writeFile7 } from "fs/promises"; +import { join as join44 } from "path"; function getCacheBreakDiffPath() { const chars = "abcdefghijklmnopqrstuvwxyz0123456789"; let suffix = ""; - for (let i4 = 0;i4 < 4; i4++) { + for (let i3 = 0;i3 < 4; i3++) { suffix += chars[Math.floor(Math.random() * chars.length)]; } - return join54(getClaudeTempDir(), `cache-break-${suffix}.diff`); + return join44(getClaudeTempDir(), `cache-break-${suffix}.diff`); } function isExcludedModel(model) { return model.includes("haiku"); @@ -291993,8 +215644,8 @@ function stripCacheControl(items) { return items.map((item) => { if (!("cache_control" in item)) return item; - const { cache_control: _, ...rest3 } = item; - return rest3; + const { cache_control: _, ...rest2 } = item; + return rest2; }); } function computeHash(data) { @@ -292010,8 +215661,8 @@ function sanitizeToolName(name) { } function computePerToolHashes(strippedTools, names) { const hashes = {}; - for (let i4 = 0;i4 < strippedTools.length; i4++) { - hashes[names[i4] ?? `__idx_${i4}`] = computeHash(strippedTools[i4]); + for (let i3 = 0;i3 < strippedTools.length; i3++) { + hashes[names[i3] ?? `__idx_${i3}`] = computeHash(strippedTools[i3]); } return hashes; } @@ -292119,7 +215770,7 @@ function recordPromptState(snapshot) { const fastModeChanged = isFastMode !== prev.fastMode; const cacheControlChanged = cacheControlHash !== prev.cacheControlHash; const globalCacheStrategyChanged = globalCacheStrategy !== prev.globalCacheStrategy; - const betasChanged = sortedBetas.length !== prev.betas.length || sortedBetas.some((b, i4) => b !== prev.betas[i4]); + const betasChanged = sortedBetas.length !== prev.betas.length || sortedBetas.some((b, i3) => b !== prev.betas[i3]); const autoModeChanged = autoModeActive !== prev.autoModeActive; const overageChanged = isUsingOverage !== prev.isUsingOverage; const cachedMCChanged = cachedMCEnabled !== prev.cachedMCEnabled; @@ -292351,7 +216002,7 @@ async function writeCacheBreakDiff(prevContent, newContent) { const diffPath = getCacheBreakDiffPath(); await mkdir8(getClaudeTempDir(), { recursive: true }); const patch = createPatch("prompt-state", prevContent, newContent, "before", "after"); - await writeFile9(diffPath, patch); + await writeFile7(diffPath, patch); return diffPath; } catch { return; @@ -292464,13 +216115,13 @@ function calculateToolResultTokens(block2) { if (typeof block2.content === "string") { return roughTokenCountEstimation(block2.content); } - return block2.content.reduce((sum3, item) => { + return block2.content.reduce((sum2, item) => { if (item.type === "text") { - return sum3 + roughTokenCountEstimation(item.text); + return sum2 + roughTokenCountEstimation(item.text); } else if (item.type === "image" || item.type === "document") { - return sum3 + IMAGE_MAX_TOKEN_SIZE; + return sum2 + IMAGE_MAX_TOKEN_SIZE; } - return sum3; + return sum2; }, 0); } function estimateMessageTokens(messages) { @@ -292536,7 +216187,7 @@ async function microcompactMessages(messages, toolUseContext, querySource) { async function cachedMicrocompactPath2(messages, querySource) { const mod2 = await getCachedMCModule(); const state = ensureCachedMCState(); - const config4 = mod2.getCachedMCConfig(); + const config2 = mod2.getCachedMCConfig(); const compactableToolIds = new Set(collectCompactableToolIds(messages)); for (const message of messages) { if (message.type === "user" && Array.isArray(message.message.content)) { @@ -292562,8 +216213,8 @@ async function cachedMicrocompactPath2(messages, querySource) { deletedToolIds: toolsToDelete.join(","), activeToolCount: state.toolOrder.length - state.deletedRefs.size, triggerType: "auto", - threshold: config4.triggerThreshold, - keepRecent: config4.keepRecent + threshold: config2.triggerThreshold, + keepRecent: config2.keepRecent }); suppressCompactWarning(); if (feature("PROMPT_CACHE_BREAK_DETECTION")) { @@ -292585,8 +216236,8 @@ async function cachedMicrocompactPath2(messages, querySource) { return { messages }; } function evaluateTimeBasedTrigger(messages, querySource) { - const config4 = getTimeBasedMCConfig(); - if (!config4.enabled || !querySource || !isMainThreadSource(querySource)) { + const config2 = getTimeBasedMCConfig(); + if (!config2.enabled || !querySource || !isMainThreadSource(querySource)) { return null; } const lastAssistant = messages.findLast((m) => m.type === "assistant"); @@ -292594,26 +216245,26 @@ function evaluateTimeBasedTrigger(messages, querySource) { return null; } const gapMinutes = (Date.now() - new Date(lastAssistant.timestamp).getTime()) / 60000; - if (!Number.isFinite(gapMinutes) || gapMinutes < config4.gapThresholdMinutes) { + if (!Number.isFinite(gapMinutes) || gapMinutes < config2.gapThresholdMinutes) { return null; } - return { gapMinutes, config: config4 }; + return { gapMinutes, config: config2 }; } function maybeTimeBasedMicrocompact(messages, querySource) { const trigger = evaluateTimeBasedTrigger(messages, querySource); if (!trigger) { return null; } - const { gapMinutes, config: config4 } = trigger; + const { gapMinutes, config: config2 } = trigger; const compactableIds = collectCompactableToolIds(messages); - const keepRecent = Math.max(1, config4.keepRecent); + const keepRecent = Math.max(1, config2.keepRecent); const keepSet = new Set(compactableIds.slice(-keepRecent)); const clearSet = new Set(compactableIds.filter((id) => !keepSet.has(id))); if (clearSet.size === 0) { return null; } let tokensSaved = 0; - const result3 = messages.map((message) => { + const result2 = messages.map((message) => { if (message.type !== "user" || !Array.isArray(message.message.content)) { return message; } @@ -292638,19 +216289,19 @@ function maybeTimeBasedMicrocompact(messages, querySource) { } logEvent("tengu_time_based_microcompact", { gapMinutes: Math.round(gapMinutes), - gapThresholdMinutes: config4.gapThresholdMinutes, + gapThresholdMinutes: config2.gapThresholdMinutes, toolsCleared: clearSet.size, toolsKept: keepSet.size, - keepRecent: config4.keepRecent, + keepRecent: config2.keepRecent, tokensSaved }); - logForDebugging(`[TIME-BASED MC] gap ${Math.round(gapMinutes)}min > ${config4.gapThresholdMinutes}min, cleared ${clearSet.size} tool results (~${tokensSaved} tokens), kept last ${keepSet.size}`); + logForDebugging(`[TIME-BASED MC] gap ${Math.round(gapMinutes)}min > ${config2.gapThresholdMinutes}min, cleared ${clearSet.size} tool results (~${tokensSaved} tokens), kept last ${keepSet.size}`); suppressCompactWarning(); resetMicrocompactState(); if (feature("PROMPT_CACHE_BREAK_DETECTION") && querySource) { notifyCacheDeletion(querySource); } - return { messages: result3 }; + return { messages: result2 }; } var TIME_BASED_MC_CLEARED_MESSAGE = "[Old tool result content cleared]", IMAGE_MAX_TOKEN_SIZE = 2000, COMPACTABLE_TOOLS, cachedMCModule = null, cachedMCState = null, pendingCacheEdits = null; var init_microCompact = __esm(() => { @@ -292697,37 +216348,37 @@ function getTokenCountFromUsage(usage) { return usage.input_tokens + (usage.cache_creation_input_tokens ?? 0) + (usage.cache_read_input_tokens ?? 0) + usage.output_tokens; } function tokenCountFromLastAPIResponse(messages) { - let i4 = messages.length - 1; - while (i4 >= 0) { - const message = messages[i4]; + let i3 = messages.length - 1; + while (i3 >= 0) { + const message = messages[i3]; const usage = message ? getTokenUsage(message) : undefined; if (usage) { return getTokenCountFromUsage(usage); } - i4--; + i3--; } return 0; } function finalContextTokensFromLastResponse(messages) { - let i4 = messages.length - 1; - while (i4 >= 0) { - const message = messages[i4]; + let i3 = messages.length - 1; + while (i3 >= 0) { + const message = messages[i3]; const usage = message ? getTokenUsage(message) : undefined; if (usage) { const iterations = usage.iterations; if (iterations && iterations.length > 0) { - const last3 = iterations.at(-1); - return last3.input_tokens + last3.output_tokens; + const last2 = iterations.at(-1); + return last2.input_tokens + last2.output_tokens; } return usage.input_tokens + usage.output_tokens; } - i4--; + i3--; } return 0; } function getCurrentUsage(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; const usage = message ? getTokenUsage(message) : undefined; if (usage) { return { @@ -292764,34 +216415,34 @@ function getAssistantMessageContentLength(message) { return contentLength; } function tokenCountWithEstimation(messages) { - let i4 = messages.length - 1; - while (i4 >= 0) { - const message = messages[i4]; + let i3 = messages.length - 1; + while (i3 >= 0) { + const message = messages[i3]; const usage = message ? getTokenUsage(message) : undefined; if (message && usage) { const responseId = getAssistantMessageId(message); if (responseId) { - let j = i4 - 1; + let j = i3 - 1; while (j >= 0) { const prior = messages[j]; const priorId = prior ? getAssistantMessageId(prior) : undefined; if (priorId === responseId) { - i4 = j; + i3 = j; } else if (priorId !== undefined) { break; } j--; } } - return getTokenCountFromUsage(usage) + roughTokenCountEstimationForMessages(messages.slice(i4 + 1)); + return getTokenCountFromUsage(usage) + roughTokenCountEstimationForMessages(messages.slice(i3 + 1)); } - i4--; + i3--; } return roughTokenCountEstimationForMessages(messages); } var init_tokens = __esm(() => { init_tokenEstimation(); - init_messages5(); + init_messages3(); init_slowOperations(); }); @@ -292818,14 +216469,14 @@ async function waitForSessionMemoryExtraction() { if (Date.now() - startTime > EXTRACTION_WAIT_TIMEOUT_MS) { return; } - await sleep4(1000); + await sleep2(1000); } } async function getSessionMemoryContent() { - const fs8 = getFsImplementation(); + const fs2 = getFsImplementation(); const memoryPath = getSessionMemoryPath(); try { - const content = await fs8.readFile(memoryPath, { encoding: "utf-8" }); + const content = await fs2.readFile(memoryPath, { encoding: "utf-8" }); logEvent("tengu_session_memory_loaded", { content_length: content.length }); @@ -292836,10 +216487,10 @@ async function getSessionMemoryContent() { throw e; } } -function setSessionMemoryConfig(config4) { +function setSessionMemoryConfig(config2) { sessionMemoryConfig = { ...sessionMemoryConfig, - ...config4 + ...config2 }; } function getSessionMemoryConfig() { @@ -292903,10 +216554,10 @@ function clearToolSearchDescriptionCache() { getToolDescriptionMemoized.cache.clear?.(); cachedDeferredToolNames = null; } -function buildSearchResult(matches3, query, totalDeferredTools, pendingMcpServers) { +function buildSearchResult(matches2, query, totalDeferredTools, pendingMcpServers) { return { data: { - matches: matches3, + matches: matches2, query, total_deferred_tools: totalDeferredTools, ...pendingMcpServers && pendingMcpServers.length > 0 ? { pending_mcp_servers: pendingMcpServers } : {} @@ -292965,7 +216616,7 @@ async function searchToolsWithKeywords(query, deferredTools, tools, maxResults) const termPatterns = compileTermPatterns(allScoringTerms); let candidateTools = deferredTools; if (requiredTerms.length > 0) { - const matches3 = await Promise.all(deferredTools.map(async (tool) => { + const matches2 = await Promise.all(deferredTools.map(async (tool) => { const parsed = parseToolName(tool.name); const description = await getToolDescriptionMemoized(tool.name, tools); const descNormalized = description.toLowerCase(); @@ -292976,7 +216627,7 @@ async function searchToolsWithKeywords(query, deferredTools, tools, maxResults) }); return matchesAll ? tool : null; })); - candidateTools = matches3.filter((t) => t !== null); + candidateTools = matches2.filter((t) => t !== null); } const scored = await Promise.all(candidateTools.map(async (tool) => { const parsed = parseToolName(tool.name); @@ -293067,8 +216718,8 @@ var init_ToolSearchTool = __esm(() => { get outputSchema() { return outputSchema2(); }, - async call(input3, { options: { tools }, getAppState }) { - const { query, max_results = 5 } = input3; + async call(input, { options: { tools }, getAppState }) { + const { query, max_results = 5 } = input; const deferredTools = tools.filter(isDeferredTool); maybeInvalidateCache(deferredTools); function getPendingServerNames() { @@ -293076,14 +216727,14 @@ var init_ToolSearchTool = __esm(() => { const pending = appState.mcp.clients.filter((c6) => c6.type === "pending"); return pending.length > 0 ? pending.map((s) => s.name) : undefined; } - function logSearchOutcome(matches4, queryType) { + function logSearchOutcome(matches3, queryType) { logEvent("tengu_tool_search_outcome", { query, queryType, - matchCount: matches4.length, + matchCount: matches3.length, totalDeferredTools: deferredTools.length, maxResults: max_results, - hasMatches: matches4.length > 0 + hasMatches: matches3.length > 0 }); } const selectMatch = query.match(/^select:(.+)$/i); @@ -293114,14 +216765,14 @@ var init_ToolSearchTool = __esm(() => { logSearchOutcome(found, "select"); return buildSearchResult(found, query, deferredTools.length); } - const matches3 = await searchToolsWithKeywords(query, deferredTools, tools, max_results); - logForDebugging(`ToolSearchTool: keyword search for "${query}", found ${matches3.length} matches`); - logSearchOutcome(matches3, "keyword"); - if (matches3.length === 0) { + const matches2 = await searchToolsWithKeywords(query, deferredTools, tools, max_results); + logForDebugging(`ToolSearchTool: keyword search for "${query}", found ${matches2.length} matches`); + logSearchOutcome(matches2, "keyword"); + if (matches2.length === 0) { const pendingServers = getPendingServerNames(); - return buildSearchResult(matches3, query, deferredTools.length, pendingServers); + return buildSearchResult(matches2, query, deferredTools.length, pendingServers); } - return buildSearchResult(matches3, query, deferredTools.length); + return buildSearchResult(matches2, query, deferredTools.length); }, renderToolUseMessage() { return null; @@ -293129,14 +216780,14 @@ var init_ToolSearchTool = __esm(() => { userFacingName: () => "", mapToolResultToToolResultBlockParam(content, toolUseID) { if (content.matches.length === 0) { - let text2 = "No matching deferred tools found"; + let text = "No matching deferred tools found"; if (content.pending_mcp_servers && content.pending_mcp_servers.length > 0) { - text2 += `. Some MCP servers are still connecting: ${content.pending_mcp_servers.join(", ")}. Their tools will become available shortly — try searching again.`; + text += `. Some MCP servers are still connecting: ${content.pending_mcp_servers.join(", ")}. Their tools will become available shortly — try searching again.`; } return { type: "tool_result", tool_use_id: toolUseID, - content: text2 + content: text }; } return { @@ -293188,11 +216839,11 @@ function analyzeContext(messages) { content.forEach((block2) => processBlock(block2, msg, stats, toolIdsToToolNames, readToolIdToFilePath, fileReadStats)); } }); - fileReadStats.forEach((data, path16) => { + fileReadStats.forEach((data, path11) => { if (data.count > 1) { const averageTokensPerRead = Math.floor(data.totalTokens / data.count); const duplicateTokens = averageTokensPerRead * (data.count - 1); - stats.duplicateFileReads.set(path16, { + stats.duplicateFileReads.set(path11, { count: data.count, tokens: duplicateTokens }); @@ -293217,8 +216868,8 @@ function processBlock(block2, message, stats, toolIds, readToolPaths, fileReads) increment2(stats.toolRequests, toolName, tokens); toolIds.set(block2.id, toolName); if (toolName === "Read" && "input" in block2 && block2.input && typeof block2.input === "object" && "file_path" in block2.input) { - const path16 = String(block2.input.file_path); - readToolPaths.set(block2.id, path16); + const path11 = String(block2.input.file_path); + readToolPaths.set(block2.id, path11); } } break; @@ -293228,10 +216879,10 @@ function processBlock(block2, message, stats, toolIds, readToolPaths, fileReads) const toolName = toolIds.get(block2.tool_use_id) || "unknown"; increment2(stats.toolResults, toolName, tokens); if (toolName === "Read") { - const path16 = readToolPaths.get(block2.tool_use_id); - if (path16) { - const current = fileReads.get(path16) || { count: 0, totalTokens: 0 }; - fileReads.set(path16, { + const path11 = readToolPaths.get(block2.tool_use_id); + if (path11) { + const current = fileReads.get(path11) || { count: 0, totalTokens: 0 }; + fileReads.set(path11, { count: current.count + 1, totalTokens: current.totalTokens + tokens }); @@ -293260,8 +216911,8 @@ function processBlock(block2, message, stats, toolIds, readToolPaths, fileReads) break; } } -function increment2(map6, key, value) { - map6.set(key, (map6.get(key) || 0) + value); +function increment2(map4, key, value) { + map4.set(key, (map4.get(key) || 0) + value); } function tokenStatsToStatsigMetrics(stats) { const metrics = { @@ -293280,7 +216931,7 @@ function tokenStatsToStatsigMetrics(stats) { stats.toolResults.forEach((tokens, tool) => { metrics[`tool_result_${tool}_tokens`] = tokens; }); - const duplicateTotal = [...stats.duplicateFileReads.values()].reduce((sum3, d) => sum3 + d.tokens, 0); + const duplicateTotal = [...stats.duplicateFileReads.values()].reduce((sum2, d) => sum2 + d.tokens, 0); metrics.duplicate_read_tokens = duplicateTotal; metrics.duplicate_read_file_count = stats.duplicateFileReads.size; if (stats.total > 0) { @@ -293288,8 +216939,8 @@ function tokenStatsToStatsigMetrics(stats) { metrics.assistant_message_percent = Math.round(stats.assistantMessages / stats.total * 100); metrics.local_command_output_percent = Math.round(stats.localCommandOutputs / stats.total * 100); metrics.duplicate_read_percent = Math.round(duplicateTotal / stats.total * 100); - const toolRequestTotal = [...stats.toolRequests.values()].reduce((sum3, v) => sum3 + v, 0); - const toolResultTotal = [...stats.toolResults.values()].reduce((sum3, v) => sum3 + v, 0); + const toolRequestTotal = [...stats.toolRequests.values()].reduce((sum2, v) => sum2 + v, 0); + const toolResultTotal = [...stats.toolResults.values()].reduce((sum2, v) => sum2 + v, 0); metrics.tool_request_percent = Math.round(toolRequestTotal / stats.total * 100); metrics.tool_result_percent = Math.round(toolResultTotal / stats.total * 100); stats.toolRequests.forEach((tokens, tool) => { @@ -293303,7 +216954,7 @@ function tokenStatsToStatsigMetrics(stats) { } var init_contextAnalysis = __esm(() => { init_tokenEstimation(); - init_messages5(); + init_messages3(); init_slowOperations(); }); @@ -293342,18 +216993,18 @@ function checkMockRateLimitError(currentModel, isFastModeActive) { if (fastModeHeaders === null) { return null; } - const error45 = new APIError(429, { error: { type: "rate_limit_error", message: "Rate limit exceeded" } }, "Rate limit exceeded", new globalThis.Headers(Object.entries(fastModeHeaders).filter(([_, v]) => v !== undefined))); - return error45; + const error41 = new APIError(429, { error: { type: "rate_limit_error", message: "Rate limit exceeded" } }, "Rate limit exceeded", new globalThis.Headers(Object.entries(fastModeHeaders).filter(([_, v]) => v !== undefined))); + return error41; } const shouldThrow429 = status === "rejected" && (!overageStatus || overageStatus === "rejected"); if (shouldThrow429) { - const error45 = new APIError(429, { error: { type: "rate_limit_error", message: "Rate limit exceeded" } }, "Rate limit exceeded", new globalThis.Headers(Object.entries(mockHeaders2).filter(([_, v]) => v !== undefined))); - return error45; + const error41 = new APIError(429, { error: { type: "rate_limit_error", message: "Rate limit exceeded" } }, "Rate limit exceeded", new globalThis.Headers(Object.entries(mockHeaders2).filter(([_, v]) => v !== undefined))); + return error41; } return null; } -function isMockRateLimitError(error45) { - return shouldProcessMockLimits() && error45.status === 429; +function isMockRateLimitError(error41) { + return shouldProcessMockLimits() && error41.status === 429; } var init_rateLimitMocking = __esm(() => { init_sdk(); @@ -293387,9 +217038,9 @@ var imageProcessorModule = null; var init_imageProcessor = () => {}; // src/utils/imageResizer.ts -function classifyImageError(error45) { - if (error45 instanceof Error) { - const errorWithCode = error45; +function classifyImageError(error41) { + if (error41 instanceof Error) { + const errorWithCode = error41; if (errorWithCode.code === "MODULE_NOT_FOUND" || errorWithCode.code === "ERR_MODULE_NOT_FOUND" || errorWithCode.code === "ERR_DLOPEN_FAILED") { return ERROR_TYPE_MODULE_LOAD; } @@ -293400,7 +217051,7 @@ function classifyImageError(error45) { return ERROR_TYPE_MEMORY; } } - const message = errorMessage(error45); + const message = errorMessage(error41); if (message.includes("Native image processor module not available")) { return ERROR_TYPE_MODULE_LOAD; } @@ -293423,8 +217074,8 @@ function classifyImageError(error45) { } function hashString2(str) { let hash2 = 5381; - for (let i4 = 0;i4 < str.length; i4++) { - hash2 = (hash2 << 5) + hash2 + str.charCodeAt(i4) | 0; + for (let i3 = 0;i3 < str.length; i3++) { + hash2 = (hash2 << 5) + hash2 + str.charCodeAt(i3) | 0; } return hash2 >>> 0; } @@ -293574,10 +217225,10 @@ async function maybeResizeAndDownsampleImageBuffer(imageBuffer, originalSize, ex displayHeight: height } }; - } catch (error45) { - logError2(error45); - const errorType = classifyImageError(error45); - const errorMsg = errorMessage(error45); + } catch (error41) { + logError2(error41); + const errorType = classifyImageError(error41); + const errorMsg = errorMessage(error41); logEvent("tengu_image_resize_failed", { original_size_bytes: originalSize, error_type: errorType, @@ -293652,10 +217303,10 @@ async function compressImageBuffer(imageBuffer, maxBytes = IMAGE_TARGET_RAW_SIZE return jpegResult; } return await createUltraCompressedJPEG(context, sharp); - } catch (error45) { - logError2(error45); - const errorType = classifyImageError(error45); - const errorMsg = errorMessage(error45); + } catch (error41) { + logError2(error41); + const errorType = classifyImageError(error41); + const errorMsg = errorMessage(error41); logEvent("tengu_image_compress_failed", { original_size_bytes: imageBuffer.length, max_bytes: maxBytes, @@ -293900,8 +217551,8 @@ var init_imageValidation = __esm(() => { }); // src/services/rateLimitMessages.ts -function isRateLimitErrorMessage(text2) { - return RATE_LIMIT_ERROR_PREFIXES.some((prefix) => text2.startsWith(prefix)); +function isRateLimitErrorMessage(text) { + return RATE_LIMIT_ERROR_PREFIXES.some((prefix) => text.startsWith(prefix)); } function getRateLimitMessage(limits, model) { if (limits.isUsingOverage) { @@ -293927,9 +217578,9 @@ function getRateLimitMessage(limits, model) { if (isTeamOrEnterprise && hasExtraUsageEnabled && !hasClaudeAiBillingAccess()) { return null; } - const text2 = getEarlyWarningText(limits); - if (text2) { - return { message: text2, severity: "warning" }; + const text = getEarlyWarningText(limits); + if (text) { + return { message: text, severity: "warning" }; } } return null; @@ -294081,7 +217732,7 @@ function formatLimitReachedText(limit, resetMessage, _model) { } var FEEDBACK_CHANNEL_ANT = "#briarpatch-cc", RATE_LIMIT_ERROR_PREFIXES; var init_rateLimitMessages = __esm(() => { - init_auth2(); + init_auth(); init_billing(); init_format(); RATE_LIMIT_ERROR_PREFIXES = [ @@ -294104,18 +217755,18 @@ function getRawUtilization() { return rawUtilization; } function extractRawUtilization(headers) { - const result3 = {}; + const result2 = {}; for (const [key, abbrev] of [ ["five_hour", "5h"], ["seven_day", "7d"] ]) { - const util7 = headers.get(`anthropic-ratelimit-unified-${abbrev}-utilization`); - const reset4 = headers.get(`anthropic-ratelimit-unified-${abbrev}-reset`); - if (util7 !== null && reset4 !== null) { - result3[key] = { utilization: Number(util7), resets_at: Number(reset4) }; + const util5 = headers.get(`anthropic-ratelimit-unified-${abbrev}-utilization`); + const reset3 = headers.get(`anthropic-ratelimit-unified-${abbrev}-reset`); + if (util5 !== null && reset3 !== null) { + result2[key] = { utilization: Number(util5), resets_at: Number(reset3) }; } } - return result3; + return result2; } function emitStatusChange(limits) { currentLimits = limits; @@ -294157,9 +217808,9 @@ async function checkQuotaStatus() { try { const raw = await makeTestQuery(); extractQuotaStatusFromHeaders(raw.headers); - } catch (error45) { - if (error45 instanceof APIError) { - extractQuotaStatusFromError(error45); + } catch (error41) { + if (error41 instanceof APIError) { + extractQuotaStatusFromError(error41); } } } @@ -294184,8 +217835,8 @@ function getHeaderBasedEarlyWarning(headers, unifiedRateLimitFallbackAvailable) } return null; } -function getTimeRelativeEarlyWarning(headers, config4, unifiedRateLimitFallbackAvailable) { - const { rateLimitType, claimAbbrev, windowSeconds, thresholds } = config4; +function getTimeRelativeEarlyWarning(headers, config2, unifiedRateLimitFallbackAvailable) { + const { rateLimitType, claimAbbrev, windowSeconds, thresholds } = config2; const utilizationHeader = headers.get(`anthropic-ratelimit-unified-${claimAbbrev}-utilization`); const resetHeader = headers.get(`anthropic-ratelimit-unified-${claimAbbrev}-reset`); if (utilizationHeader === null || resetHeader === null) { @@ -294212,8 +217863,8 @@ function getEarlyWarningFromHeaders(headers, unifiedRateLimitFallbackAvailable) if (headerBasedWarning) { return headerBasedWarning; } - for (const config4 of EARLY_WARNING_CONFIGS) { - const timeRelativeWarning = getTimeRelativeEarlyWarning(headers, config4, unifiedRateLimitFallbackAvailable); + for (const config2 of EARLY_WARNING_CONFIGS) { + const timeRelativeWarning = getTimeRelativeEarlyWarning(headers, config2, unifiedRateLimitFallbackAvailable); if (timeRelativeWarning) { return timeRelativeWarning; } @@ -294282,14 +217933,14 @@ function extractQuotaStatusFromHeaders(headers) { emitStatusChange(newLimits); } } -function extractQuotaStatusFromError(error45) { - if (!shouldProcessRateLimits(isClaudeAISubscriber()) || error45.status !== 429) { +function extractQuotaStatusFromError(error41) { + if (!shouldProcessRateLimits(isClaudeAISubscriber()) || error41.status !== 429) { return; } try { let newLimits = { ...currentLimits }; - if (error45.headers) { - const headersToUse = processRateLimitHeaders(error45.headers); + if (error41.headers) { + const headersToUse = processRateLimitHeaders(error41.headers); rawUtilization = extractRawUtilization(headersToUse); newLimits = computeNewLimitsFromHeaders(headersToUse); cacheExtraUsageDisabledReason(headersToUse); @@ -294307,14 +217958,14 @@ var init_claudeAiLimits = __esm(() => { init_sdk(); init_isEqual(); init_state(); - init_auth2(); + init_auth(); init_betas2(); init_config2(); init_log3(); init_model(); init_analytics(); init_claude(); - init_client7(); + init_client3(); init_rateLimitMocking(); init_rateLimitMessages(); EARLY_WARNING_CONFIGS = [ @@ -294350,11 +218001,11 @@ var init_claudeAiLimits = __esm(() => { }); // src/services/api/errorUtils.ts -function extractConnectionErrorDetails(error45) { - if (!error45 || typeof error45 !== "object") { +function extractConnectionErrorDetails(error41) { + if (!error41 || typeof error41 !== "object") { return null; } - let current = error45; + let current = error41; const maxDepth = 5; let depth = 0; while (current && depth < maxDepth) { @@ -294376,8 +218027,8 @@ function extractConnectionErrorDetails(error45) { } return null; } -function getSSLErrorHint(error45) { - const details = extractConnectionErrorDetails(error45); +function getSSLErrorHint(error41) { + const details = extractConnectionErrorDetails(error41); if (!details?.isSSLError) { return null; } @@ -294403,11 +218054,11 @@ function sanitizeAPIError(apiError) { function hasNestedError(value) { return typeof value === "object" && value !== null && "error" in value && typeof value.error === "object" && value.error !== null; } -function extractNestedErrorMessage(error45) { - if (!hasNestedError(error45)) { +function extractNestedErrorMessage(error41) { + if (!hasNestedError(error41)) { return null; } - const narrowed = error45; + const narrowed = error41; const nested = narrowed.error; const deepMsg = nested?.error?.message; if (typeof deepMsg === "string" && deepMsg.length > 0) { @@ -294425,8 +218076,8 @@ function extractNestedErrorMessage(error45) { } return null; } -function formatAPIError(error45) { - const connectionDetails = extractConnectionErrorDetails(error45); +function formatAPIError(error41) { + const connectionDetails = extractConnectionErrorDetails(error41); if (connectionDetails) { const { code, isSSLError } = connectionDetails; if (code === "ETIMEDOUT") { @@ -294455,17 +218106,17 @@ function formatAPIError(error45) { } } } - if (error45.message === "Connection error.") { + if (error41.message === "Connection error.") { if (connectionDetails?.code) { return `Unable to connect to API (${connectionDetails.code})`; } return "Unable to connect to API. Check your internet connection"; } - if (!error45.message) { - return extractNestedErrorMessage(error45) ?? `API error (status ${error45.status ?? "unknown"})`; + if (!error41.message) { + return extractNestedErrorMessage(error41) ?? `API error (status ${error41.status ?? "unknown"})`; } - const sanitizedMessage = sanitizeAPIError(error45); - return sanitizedMessage !== error45.message && sanitizedMessage.length > 0 ? sanitizedMessage : error45.message; + const sanitizedMessage = sanitizeAPIError(error41); + return sanitizedMessage !== error41.message && sanitizedMessage.length > 0 ? sanitizedMessage : error41.message; } var SSL_ERROR_CODES; var init_errorUtils = __esm(() => { @@ -294492,8 +218143,8 @@ var init_errorUtils = __esm(() => { }); // src/services/api/errors.ts -function startsWithApiErrorPrefix(text2) { - return text2.startsWith(API_ERROR_MESSAGE_PREFIX) || text2.startsWith(`Please run /login · ${API_ERROR_MESSAGE_PREFIX}`); +function startsWithApiErrorPrefix(text) { + return text.startsWith(API_ERROR_MESSAGE_PREFIX) || text.startsWith(`Please run /login · ${API_ERROR_MESSAGE_PREFIX}`); } function isPromptTooLongMessage(msg) { if (!msg.isApiErrorMessage) { @@ -294552,15 +218203,15 @@ function isCCRMode() { function logToolUseToolResultMismatch(toolUseId, messages, messagesForAPI) { try { let normalizedIndex = -1; - for (let i4 = 0;i4 < messagesForAPI.length; i4++) { - const msg = messagesForAPI[i4]; + for (let i3 = 0;i3 < messagesForAPI.length; i3++) { + const msg = messagesForAPI[i3]; if (!msg) continue; const content = msg.message.content; if (Array.isArray(content)) { for (const block2 of content) { if (block2.type === "tool_use" && "id" in block2 && block2.id === toolUseId) { - normalizedIndex = i4; + normalizedIndex = i3; break; } } @@ -294569,8 +218220,8 @@ function logToolUseToolResultMismatch(toolUseId, messages, messagesForAPI) { break; } let originalIndex = -1; - for (let i4 = 0;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = 0;i3 < messages.length; i3++) { + const msg = messages[i3]; if (!msg) continue; if (msg.type === "assistant" && "message" in msg) { @@ -294578,7 +218229,7 @@ function logToolUseToolResultMismatch(toolUseId, messages, messagesForAPI) { if (Array.isArray(content)) { for (const block2 of content) { if (block2.type === "tool_use" && "id" in block2 && block2.id === toolUseId) { - originalIndex = i4; + originalIndex = i3; break; } } @@ -294588,8 +218239,8 @@ function logToolUseToolResultMismatch(toolUseId, messages, messagesForAPI) { break; } const normalizedSeq = []; - for (let i4 = normalizedIndex + 1;i4 < messagesForAPI.length; i4++) { - const msg = messagesForAPI[i4]; + for (let i3 = normalizedIndex + 1;i3 < messagesForAPI.length; i3++) { + const msg = messagesForAPI[i3]; if (!msg) continue; const content = msg.message.content; @@ -294615,8 +218266,8 @@ function logToolUseToolResultMismatch(toolUseId, messages, messagesForAPI) { } } const preNormalizedSeq = []; - for (let i4 = originalIndex + 1;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = originalIndex + 1;i3 < messages.length; i3++) { + const msg = messages[i3]; if (!msg) continue; switch (msg.type) { @@ -294677,34 +218328,34 @@ function logToolUseToolResultMismatch(toolUseId, messages, messagesForAPI) { }); } catch (_) {} } -function getAssistantMessageFromError(error45, model, options2) { - if (error45 instanceof APIConnectionTimeoutError || error45 instanceof APIConnectionError && error45.message.toLowerCase().includes("timeout")) { +function getAssistantMessageFromError(error41, model, options2) { + if (error41 instanceof APIConnectionTimeoutError || error41 instanceof APIConnectionError && error41.message.toLowerCase().includes("timeout")) { return createAssistantAPIErrorMessage({ content: API_TIMEOUT_ERROR_MESSAGE, error: "unknown" }); } - if (error45 instanceof ImageSizeError || error45 instanceof ImageResizeError) { + if (error41 instanceof ImageSizeError || error41 instanceof ImageResizeError) { return createAssistantAPIErrorMessage({ content: getImageTooLargeErrorMessage() }); } - if (error45 instanceof Error && error45.message.includes(CUSTOM_OFF_SWITCH_MESSAGE)) { + if (error41 instanceof Error && error41.message.includes(CUSTOM_OFF_SWITCH_MESSAGE)) { return createAssistantAPIErrorMessage({ content: CUSTOM_OFF_SWITCH_MESSAGE, error: "rate_limit" }); } - if (error45 instanceof APIError && error45.status === 429 && shouldProcessRateLimits(isClaudeAISubscriber())) { - const rateLimitType = error45.headers?.get?.("anthropic-ratelimit-unified-representative-claim"); - const overageStatus = error45.headers?.get?.("anthropic-ratelimit-unified-overage-status"); + if (error41 instanceof APIError && error41.status === 429 && shouldProcessRateLimits(isClaudeAISubscriber())) { + const rateLimitType = error41.headers?.get?.("anthropic-ratelimit-unified-representative-claim"); + const overageStatus = error41.headers?.get?.("anthropic-ratelimit-unified-overage-status"); if (rateLimitType || overageStatus) { const limits = { status: "rejected", unifiedRateLimitFallbackAvailable: false, isUsingOverage: false }; - const resetHeader = error45.headers?.get?.("anthropic-ratelimit-unified-reset"); + const resetHeader = error41.headers?.get?.("anthropic-ratelimit-unified-reset"); if (resetHeader) { limits.resetsAt = Number(resetHeader); } @@ -294714,11 +218365,11 @@ function getAssistantMessageFromError(error45, model, options2) { if (overageStatus) { limits.overageStatus = overageStatus; } - const overageResetHeader = error45.headers?.get?.("anthropic-ratelimit-unified-overage-reset"); + const overageResetHeader = error41.headers?.get?.("anthropic-ratelimit-unified-overage-reset"); if (overageResetHeader) { limits.overageResetsAt = Number(overageResetHeader); } - const overageDisabledReason = error45.headers?.get?.("anthropic-ratelimit-unified-overage-disabled-reason"); + const overageDisabledReason = error41.headers?.get?.("anthropic-ratelimit-unified-overage-disabled-reason"); if (overageDisabledReason) { limits.overageDisabledReason = overageDisabledReason; } @@ -294734,14 +218385,14 @@ function getAssistantMessageFromError(error45, model, options2) { error: "rate_limit" }); } - if (error45.message.includes("Extra usage is required for long context")) { + if (error41.message.includes("Extra usage is required for long context")) { const hint = getIsNonInteractiveSession() ? "enable extra usage at claude.ai/settings/usage, or use --model to switch to standard context" : "run /extra-usage to enable, or /model to switch to standard context"; return createAssistantAPIErrorMessage({ content: `${API_ERROR_MESSAGE_PREFIX}: Extra usage is required for 1M context · ${hint}`, error: "rate_limit" }); } - const stripped = error45.message.replace(/^429\s+/, ""); + const stripped = error41.message.replace(/^429\s+/, ""); const innerMessage = stripped.match(/"message"\s*:\s*"([^"]*)"/)?.[1]; const detail = innerMessage || stripped; return createAssistantAPIErrorMessage({ @@ -294749,67 +218400,67 @@ function getAssistantMessageFromError(error45, model, options2) { error: "rate_limit" }); } - if (error45 instanceof Error && error45.message.toLowerCase().includes("prompt is too long")) { + if (error41 instanceof Error && error41.message.toLowerCase().includes("prompt is too long")) { return createAssistantAPIErrorMessage({ content: PROMPT_TOO_LONG_ERROR_MESSAGE, error: "invalid_request", - errorDetails: error45.message + errorDetails: error41.message }); } - if (error45 instanceof Error && /maximum of \d+ PDF pages/.test(error45.message)) { + if (error41 instanceof Error && /maximum of \d+ PDF pages/.test(error41.message)) { return createAssistantAPIErrorMessage({ content: getPdfTooLargeErrorMessage(), error: "invalid_request", - errorDetails: error45.message + errorDetails: error41.message }); } - if (error45 instanceof Error && error45.message.includes("The PDF specified is password protected")) { + if (error41 instanceof Error && error41.message.includes("The PDF specified is password protected")) { return createAssistantAPIErrorMessage({ content: getPdfPasswordProtectedErrorMessage(), error: "invalid_request" }); } - if (error45 instanceof Error && error45.message.includes("The PDF specified was not valid")) { + if (error41 instanceof Error && error41.message.includes("The PDF specified was not valid")) { return createAssistantAPIErrorMessage({ content: getPdfInvalidErrorMessage(), error: "invalid_request" }); } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("image exceeds") && error45.message.includes("maximum")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("image exceeds") && error41.message.includes("maximum")) { return createAssistantAPIErrorMessage({ content: getImageTooLargeErrorMessage(), - errorDetails: error45.message + errorDetails: error41.message }); } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("image dimensions exceed") && error45.message.includes("many-image")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("image dimensions exceed") && error41.message.includes("many-image")) { return createAssistantAPIErrorMessage({ content: getIsNonInteractiveSession() ? "An image in the conversation exceeds the dimension limit for many-image requests (2000px). Start a new session with fewer images." : "An image in the conversation exceeds the dimension limit for many-image requests (2000px). Run /compact to remove old images from context, or start a new session.", error: "invalid_request", - errorDetails: error45.message + errorDetails: error41.message }); } - if (AFK_MODE_BETA_HEADER && error45 instanceof APIError && error45.status === 400 && error45.message.includes(AFK_MODE_BETA_HEADER) && error45.message.includes("anthropic-beta")) { + if (AFK_MODE_BETA_HEADER && error41 instanceof APIError && error41.status === 400 && error41.message.includes(AFK_MODE_BETA_HEADER) && error41.message.includes("anthropic-beta")) { return createAssistantAPIErrorMessage({ content: "Auto mode is unavailable for your plan", error: "invalid_request" }); } - if (error45 instanceof APIError && error45.status === 413) { + if (error41 instanceof APIError && error41.status === 413) { return createAssistantAPIErrorMessage({ content: getRequestTooLargeErrorMessage(), error: "invalid_request" }); } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("`tool_use` ids were found without `tool_result` blocks immediately after")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("`tool_use` ids were found without `tool_result` blocks immediately after")) { if (options2?.messages && options2?.messagesForAPI) { - const toolUseIdMatch = error45.message.match(/toolu_[a-zA-Z0-9]+/); + const toolUseIdMatch = error41.message.match(/toolu_[a-zA-Z0-9]+/); const toolUseId = toolUseIdMatch ? toolUseIdMatch[0] : null; if (toolUseId) { logToolUseToolResultMismatch(toolUseId, options2.messages, options2.messagesForAPI); } } if (process.env.USER_TYPE === "ant") { - const baseMessage = `API Error: 400 ${error45.message} + const baseMessage = `API Error: 400 ${error41.message} Run /share and post the JSON file to ${"https://github.com/anthropics/claude-code/issues"}.`; const rewindInstruction = getIsNonInteractiveSession() ? "" : " Then, use /rewind to recover the conversation."; @@ -294826,25 +218477,25 @@ Run /share and post the JSON file to ${"https://github.com/anthropics/claude-cod }); } } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("unexpected `tool_use_id` found in `tool_result`")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("unexpected `tool_use_id` found in `tool_result`")) { logEvent("tengu_unexpected_tool_result", {}); } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("`tool_use` ids must be unique")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("`tool_use` ids must be unique")) { logEvent("tengu_duplicate_tool_use_id", {}); const rewindInstruction = getIsNonInteractiveSession() ? "" : " Run /rewind to recover the conversation."; return createAssistantAPIErrorMessage({ content: `API Error: 400 duplicate tool_use ID in conversation history.${rewindInstruction}`, error: "invalid_request", - errorDetails: error45.message + errorDetails: error41.message }); } - if (isClaudeAISubscriber() && error45 instanceof APIError && error45.status === 400 && error45.message.toLowerCase().includes("invalid model name") && (isNonCustomOpusModel(model) || model === "opus")) { + if (isClaudeAISubscriber() && error41 instanceof APIError && error41.status === 400 && error41.message.toLowerCase().includes("invalid model name") && (isNonCustomOpusModel(model) || model === "opus")) { return createAssistantAPIErrorMessage({ content: "Claude Opus is not available with the Claude Pro plan. If you have updated your subscription plan recently, run /logout and /login for the plan to take effect.", error: "invalid_request" }); } - if (process.env.USER_TYPE === "ant" && !process.env.ANTHROPIC_MODEL && error45 instanceof Error && error45.message.toLowerCase().includes("invalid model name")) { + if (process.env.USER_TYPE === "ant" && !process.env.ANTHROPIC_MODEL && error41 instanceof Error && error41.message.toLowerCase().includes("invalid model name")) { const orgId = getOauthAccountInfo()?.organizationUuid; const baseMsg = `[ANT-ONLY] Your org isn't gated into the \`${model}\` model. Either run \`claude\` with \`ANTHROPIC_MODEL=${getDefaultMainLoopModelSetting()}\``; const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${"https://github.com/anthropics/claude-code/issues"} for help getting access.` : `${baseMsg} or reach out in ${"https://github.com/anthropics/claude-code/issues"} for help getting access.`; @@ -294853,13 +218504,13 @@ Run /share and post the JSON file to ${"https://github.com/anthropics/claude-cod error: "invalid_request" }); } - if (error45 instanceof Error && error45.message.includes("Your credit balance is too low")) { + if (error41 instanceof Error && error41.message.includes("Your credit balance is too low")) { return createAssistantAPIErrorMessage({ content: CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE, error: "billing_error" }); } - if (error45 instanceof APIError && error45.status === 400 && error45.message.toLowerCase().includes("organization has been disabled")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.toLowerCase().includes("organization has been disabled")) { const { source } = getAnthropicApiKeyWithSource(); if (source === "ANTHROPIC_API_KEY" && process.env.ANTHROPIC_API_KEY && !isClaudeAISubscriber()) { const hasStoredOAuth = getClaudeAIOAuthTokens()?.accessToken != null; @@ -294869,7 +218520,7 @@ Run /share and post the JSON file to ${"https://github.com/anthropics/claude-cod }); } } - if (error45 instanceof Error && error45.message.toLowerCase().includes("x-api-key")) { + if (error41 instanceof Error && error41.message.toLowerCase().includes("x-api-key")) { if (isCCRMode()) { return createAssistantAPIErrorMessage({ error: "authentication_failed", @@ -294883,19 +218534,19 @@ Run /share and post the JSON file to ${"https://github.com/anthropics/claude-cod content: isExternalSource ? INVALID_API_KEY_ERROR_MESSAGE_EXTERNAL : INVALID_API_KEY_ERROR_MESSAGE }); } - if (error45 instanceof APIError && error45.status === 403 && error45.message.includes("OAuth token has been revoked")) { + if (error41 instanceof APIError && error41.status === 403 && error41.message.includes("OAuth token has been revoked")) { return createAssistantAPIErrorMessage({ error: "authentication_failed", content: getTokenRevokedErrorMessage() }); } - if (error45 instanceof APIError && (error45.status === 401 || error45.status === 403) && error45.message.includes("OAuth authentication is currently not allowed for this organization")) { + if (error41 instanceof APIError && (error41.status === 401 || error41.status === 403) && error41.message.includes("OAuth authentication is currently not allowed for this organization")) { return createAssistantAPIErrorMessage({ error: "authentication_failed", content: getOauthOrgNotAllowedErrorMessage() }); } - if (error45 instanceof APIError && (error45.status === 401 || error45.status === 403)) { + if (error41 instanceof APIError && (error41.status === 401 || error41.status === 403)) { if (isCCRMode()) { return createAssistantAPIErrorMessage({ error: "authentication_failed", @@ -294904,18 +218555,18 @@ Run /share and post the JSON file to ${"https://github.com/anthropics/claude-cod } return createAssistantAPIErrorMessage({ error: "authentication_failed", - content: getIsNonInteractiveSession() ? `Failed to authenticate. ${API_ERROR_MESSAGE_PREFIX}: ${error45.message}` : `Please run /login · ${API_ERROR_MESSAGE_PREFIX}: ${error45.message}` + content: getIsNonInteractiveSession() ? `Failed to authenticate. ${API_ERROR_MESSAGE_PREFIX}: ${error41.message}` : `Please run /login · ${API_ERROR_MESSAGE_PREFIX}: ${error41.message}` }); } - if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) && error45 instanceof Error && error45.message.toLowerCase().includes("model id")) { + if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) && error41 instanceof Error && error41.message.toLowerCase().includes("model id")) { const switchCmd = getIsNonInteractiveSession() ? "--model" : "/model"; const fallbackSuggestion = get3PModelFallbackSuggestion(model); return createAssistantAPIErrorMessage({ - content: fallbackSuggestion ? `${API_ERROR_MESSAGE_PREFIX} (${model}): ${error45.message}. Try ${switchCmd} to switch to ${fallbackSuggestion}.` : `${API_ERROR_MESSAGE_PREFIX} (${model}): ${error45.message}. Run ${switchCmd} to pick a different model.`, + content: fallbackSuggestion ? `${API_ERROR_MESSAGE_PREFIX} (${model}): ${error41.message}. Try ${switchCmd} to switch to ${fallbackSuggestion}.` : `${API_ERROR_MESSAGE_PREFIX} (${model}): ${error41.message}. Run ${switchCmd} to pick a different model.`, error: "invalid_request" }); } - if (error45 instanceof APIError && error45.status === 404) { + if (error41 instanceof APIError && error41.status === 404) { const switchCmd = getIsNonInteractiveSession() ? "--model" : "/model"; const fallbackSuggestion = get3PModelFallbackSuggestion(model); return createAssistantAPIErrorMessage({ @@ -294923,15 +218574,15 @@ Run /share and post the JSON file to ${"https://github.com/anthropics/claude-cod error: "invalid_request" }); } - if (error45 instanceof APIConnectionError) { + if (error41 instanceof APIConnectionError) { return createAssistantAPIErrorMessage({ - content: `${API_ERROR_MESSAGE_PREFIX}: ${formatAPIError(error45)}`, + content: `${API_ERROR_MESSAGE_PREFIX}: ${formatAPIError(error41)}`, error: "unknown" }); } - if (error45 instanceof Error) { + if (error41 instanceof Error) { return createAssistantAPIErrorMessage({ - content: `${API_ERROR_MESSAGE_PREFIX}: ${error45.message}`, + content: `${API_ERROR_MESSAGE_PREFIX}: ${error41.message}`, error: "unknown" }); } @@ -294956,79 +218607,79 @@ function get3PModelFallbackSuggestion(model) { } return; } -function classifyAPIError(error45) { - if (error45 instanceof Error && error45.message === "Request was aborted.") { +function classifyAPIError(error41) { + if (error41 instanceof Error && error41.message === "Request was aborted.") { return "aborted"; } - if (error45 instanceof APIConnectionTimeoutError || error45 instanceof APIConnectionError && error45.message.toLowerCase().includes("timeout")) { + if (error41 instanceof APIConnectionTimeoutError || error41 instanceof APIConnectionError && error41.message.toLowerCase().includes("timeout")) { return "api_timeout"; } - if (error45 instanceof Error && error45.message.includes(REPEATED_529_ERROR_MESSAGE)) { + if (error41 instanceof Error && error41.message.includes(REPEATED_529_ERROR_MESSAGE)) { return "repeated_529"; } - if (error45 instanceof Error && error45.message.includes(CUSTOM_OFF_SWITCH_MESSAGE)) { + if (error41 instanceof Error && error41.message.includes(CUSTOM_OFF_SWITCH_MESSAGE)) { return "capacity_off_switch"; } - if (error45 instanceof APIError && error45.status === 429) { + if (error41 instanceof APIError && error41.status === 429) { return "rate_limit"; } - if (error45 instanceof APIError && (error45.status === 529 || error45.message?.includes('"type":"overloaded_error"'))) { + if (error41 instanceof APIError && (error41.status === 529 || error41.message?.includes('"type":"overloaded_error"'))) { return "server_overload"; } - if (error45 instanceof Error && error45.message.toLowerCase().includes(PROMPT_TOO_LONG_ERROR_MESSAGE.toLowerCase())) { + if (error41 instanceof Error && error41.message.toLowerCase().includes(PROMPT_TOO_LONG_ERROR_MESSAGE.toLowerCase())) { return "prompt_too_long"; } - if (error45 instanceof Error && /maximum of \d+ PDF pages/.test(error45.message)) { + if (error41 instanceof Error && /maximum of \d+ PDF pages/.test(error41.message)) { return "pdf_too_large"; } - if (error45 instanceof Error && error45.message.includes("The PDF specified is password protected")) { + if (error41 instanceof Error && error41.message.includes("The PDF specified is password protected")) { return "pdf_password_protected"; } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("image exceeds") && error45.message.includes("maximum")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("image exceeds") && error41.message.includes("maximum")) { return "image_too_large"; } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("image dimensions exceed") && error45.message.includes("many-image")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("image dimensions exceed") && error41.message.includes("many-image")) { return "image_too_large"; } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("`tool_use` ids were found without `tool_result` blocks immediately after")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("`tool_use` ids were found without `tool_result` blocks immediately after")) { return "tool_use_mismatch"; } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("unexpected `tool_use_id` found in `tool_result`")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("unexpected `tool_use_id` found in `tool_result`")) { return "unexpected_tool_result"; } - if (error45 instanceof APIError && error45.status === 400 && error45.message.includes("`tool_use` ids must be unique")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.includes("`tool_use` ids must be unique")) { return "duplicate_tool_use_id"; } - if (error45 instanceof APIError && error45.status === 400 && error45.message.toLowerCase().includes("invalid model name")) { + if (error41 instanceof APIError && error41.status === 400 && error41.message.toLowerCase().includes("invalid model name")) { return "invalid_model"; } - if (error45 instanceof Error && error45.message.toLowerCase().includes(CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE.toLowerCase())) { + if (error41 instanceof Error && error41.message.toLowerCase().includes(CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE.toLowerCase())) { return "credit_balance_low"; } - if (error45 instanceof Error && error45.message.toLowerCase().includes("x-api-key")) { + if (error41 instanceof Error && error41.message.toLowerCase().includes("x-api-key")) { return "invalid_api_key"; } - if (error45 instanceof APIError && error45.status === 403 && error45.message.includes("OAuth token has been revoked")) { + if (error41 instanceof APIError && error41.status === 403 && error41.message.includes("OAuth token has been revoked")) { return "token_revoked"; } - if (error45 instanceof APIError && (error45.status === 401 || error45.status === 403) && error45.message.includes("OAuth authentication is currently not allowed for this organization")) { + if (error41 instanceof APIError && (error41.status === 401 || error41.status === 403) && error41.message.includes("OAuth authentication is currently not allowed for this organization")) { return "oauth_org_not_allowed"; } - if (error45 instanceof APIError && (error45.status === 401 || error45.status === 403)) { + if (error41 instanceof APIError && (error41.status === 401 || error41.status === 403)) { return "auth_error"; } - if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) && error45 instanceof Error && error45.message.toLowerCase().includes("model id")) { + if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) && error41 instanceof Error && error41.message.toLowerCase().includes("model id")) { return "bedrock_model_access"; } - if (error45 instanceof APIError) { - const status = error45.status; + if (error41 instanceof APIError) { + const status = error41.status; if (status >= 500) return "server_error"; if (status >= 400) return "client_error"; } - if (error45 instanceof APIConnectionError) { - const connectionDetails = extractConnectionErrorDetails(error45); + if (error41 instanceof APIConnectionError) { + const connectionDetails = extractConnectionErrorDetails(error41); if (connectionDetails?.isSSLError) { return "ssl_cert_error"; } @@ -295036,17 +218687,17 @@ function classifyAPIError(error45) { } return "unknown"; } -function categorizeRetryableAPIError(error45) { - if (error45.status === 529 || error45.message?.includes('"type":"overloaded_error"')) { +function categorizeRetryableAPIError(error41) { + if (error41.status === 529 || error41.message?.includes('"type":"overloaded_error"')) { return "rate_limit"; } - if (error45.status === 429) { + if (error41.status === 429) { return "rate_limit"; } - if (error45.status === 401 || error45.status === 403) { + if (error41.status === 401 || error41.status === 403) { return "authentication_failed"; } - if (error45.status !== undefined && error45.status >= 408) { + if (error41.status !== undefined && error41.status >= 408) { return "server_error"; } return "unknown"; @@ -295064,11 +218715,11 @@ function getErrorMessageIfRefusal(stopReason, model) { }); } var API_ERROR_MESSAGE_PREFIX = "API Error", PROMPT_TOO_LONG_ERROR_MESSAGE = "Prompt is too long", CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE = "Credit balance is too low", INVALID_API_KEY_ERROR_MESSAGE = "Not logged in · Please run /login", INVALID_API_KEY_ERROR_MESSAGE_EXTERNAL = "Invalid API key · Fix external API key", ORG_DISABLED_ERROR_MESSAGE_ENV_KEY_WITH_OAUTH = "Your ANTHROPIC_API_KEY belongs to a disabled organization · Unset the environment variable to use your subscription instead", ORG_DISABLED_ERROR_MESSAGE_ENV_KEY = "Your ANTHROPIC_API_KEY belongs to a disabled organization · Update or unset the environment variable", TOKEN_REVOKED_ERROR_MESSAGE = "OAuth token revoked · Please run /login", CCR_AUTH_ERROR_MESSAGE = "Authentication error · This may be a temporary network issue, please try again", REPEATED_529_ERROR_MESSAGE = "Repeated 529 Overloaded errors", CUSTOM_OFF_SWITCH_MESSAGE = "Opus is experiencing high load, please use /model to switch to Sonnet", API_TIMEOUT_ERROR_MESSAGE = "Request timed out", OAUTH_ORG_NOT_ALLOWED_ERROR_MESSAGE = "Your account does not have access to Claude Code. Please run /login."; -var init_errors7 = __esm(() => { +var init_errors6 = __esm(() => { init_sdk(); init_betas(); - init_auth2(); - init_messages5(); + init_auth(); + init_messages3(); init_model(); init_modelStrings(); init_providers(); @@ -295091,14 +218742,14 @@ function shouldRetry529(querySource) { function isPersistentRetryEnabled() { return feature("UNATTENDED_RETRY") ? isEnvTruthy(process.env.CLAUDE_CODE_UNATTENDED_RETRY) : false; } -function isTransientCapacityError(error45) { - return is529Error(error45) || error45 instanceof APIError && error45.status === 429; +function isTransientCapacityError(error41) { + return is529Error(error41) || error41 instanceof APIError && error41.status === 429; } -function isStaleConnectionError(error45) { - if (!(error45 instanceof APIConnectionError)) { +function isStaleConnectionError(error41) { + if (!(error41 instanceof APIConnectionError)) { return false; } - const details = extractConnectionErrorDetails(error45); + const details = extractConnectionErrorDetails(error41); return details?.code === "ECONNRESET" || details?.code === "EPIPE"; } async function* withRetry(getClient, operation, options2) { @@ -295108,11 +218759,11 @@ async function* withRetry(getClient, operation, options2) { thinkingConfig: options2.thinkingConfig, ...isFastModeEnabled() && { fastMode: options2.fastMode } }; - let client5 = null; + let client2 = null; let consecutive529Errors = options2.initialConsecutive529Errors ?? 0; let lastError; let persistentAttempt = 0; - for (let attempt3 = 1;attempt3 <= maxRetries + 1; attempt3++) { + for (let attempt2 = 1;attempt2 <= maxRetries + 1; attempt2++) { if (options2.signal?.aborted) { throw new APIUserAbortError; } @@ -295129,51 +218780,51 @@ async function* withRetry(getClient, operation, options2) { logForDebugging("Stale connection (ECONNRESET/EPIPE) — disabling keep-alive for retry"); disableKeepAlive(); } - if (client5 === null || lastError instanceof APIError && lastError.status === 401 || isOAuthTokenRevokedError(lastError) || isBedrockAuthError(lastError) || isVertexAuthError(lastError) || isStaleConnection) { + if (client2 === null || lastError instanceof APIError && lastError.status === 401 || isOAuthTokenRevokedError(lastError) || isBedrockAuthError(lastError) || isVertexAuthError(lastError) || isStaleConnection) { if (lastError instanceof APIError && lastError.status === 401 || isOAuthTokenRevokedError(lastError)) { const failedAccessToken = getClaudeAIOAuthTokens()?.accessToken; if (failedAccessToken) { await handleOAuth401Error(failedAccessToken); } } - client5 = await getClient(); + client2 = await getClient(); } - return await operation(client5, attempt3, retryContext); - } catch (error45) { - lastError = error45; - logForDebugging(`API error (attempt ${attempt3}/${maxRetries + 1}): ${error45 instanceof APIError ? `${error45.status} ${error45.message}` : errorMessage(error45)}`, { level: "error" }); - if (wasFastModeActive && !isPersistentRetryEnabled() && error45 instanceof APIError && (error45.status === 429 || is529Error(error45))) { - const overageReason = error45.headers?.get("anthropic-ratelimit-unified-overage-disabled-reason"); + return await operation(client2, attempt2, retryContext); + } catch (error41) { + lastError = error41; + logForDebugging(`API error (attempt ${attempt2}/${maxRetries + 1}): ${error41 instanceof APIError ? `${error41.status} ${error41.message}` : errorMessage(error41)}`, { level: "error" }); + if (wasFastModeActive && !isPersistentRetryEnabled() && error41 instanceof APIError && (error41.status === 429 || is529Error(error41))) { + const overageReason = error41.headers?.get("anthropic-ratelimit-unified-overage-disabled-reason"); if (overageReason !== null && overageReason !== undefined) { handleFastModeOverageRejection(overageReason); retryContext.fastMode = false; continue; } - const retryAfterMs = getRetryAfterMs(error45); + const retryAfterMs = getRetryAfterMs(error41); if (retryAfterMs !== null && retryAfterMs < SHORT_RETRY_THRESHOLD_MS) { - await sleep4(retryAfterMs, options2.signal, { abortError }); + await sleep2(retryAfterMs, options2.signal, { abortError }); continue; } const cooldownMs = Math.max(retryAfterMs ?? DEFAULT_FAST_MODE_FALLBACK_HOLD_MS, MIN_COOLDOWN_MS); - const cooldownReason = is529Error(error45) ? "overloaded" : "rate_limit"; + const cooldownReason = is529Error(error41) ? "overloaded" : "rate_limit"; triggerFastModeCooldown(Date.now() + cooldownMs, cooldownReason); if (isFastModeEnabled()) { retryContext.fastMode = false; } continue; } - if (wasFastModeActive && isFastModeNotEnabledError(error45)) { + if (wasFastModeActive && isFastModeNotEnabledError(error41)) { handleFastModeRejectedByAPI(); retryContext.fastMode = false; continue; } - if (is529Error(error45) && !shouldRetry529(options2.querySource)) { + if (is529Error(error41) && !shouldRetry529(options2.querySource)) { logEvent("tengu_api_529_background_dropped", { query_source: options2.querySource }); - throw new CannotRetryError(error45, retryContext); + throw new CannotRetryError(error41, retryContext); } - if (is529Error(error45) && (process.env.FALLBACK_FOR_ALL_PRIMARY_MODELS || !isClaudeAISubscriber() && isNonCustomOpusModel(options2.model))) { + if (is529Error(error41) && (process.env.FALLBACK_FOR_ALL_PRIMARY_MODELS || !isClaudeAISubscriber() && isNonCustomOpusModel(options2.model))) { consecutive529Errors++; if (consecutive529Errors >= MAX_529_RETRIES) { if (options2.fallbackModel) { @@ -295190,23 +218841,23 @@ async function* withRetry(getClient, operation, options2) { } } } - const persistent = isPersistentRetryEnabled() && isTransientCapacityError(error45); - if (attempt3 > maxRetries && !persistent) { - throw new CannotRetryError(error45, retryContext); + const persistent = isPersistentRetryEnabled() && isTransientCapacityError(error41); + if (attempt2 > maxRetries && !persistent) { + throw new CannotRetryError(error41, retryContext); } - const handledCloudAuthError = handleAwsCredentialError(error45) || handleGcpCredentialError(error45); - if (!handledCloudAuthError && (!(error45 instanceof APIError) || !shouldRetry(error45))) { - throw new CannotRetryError(error45, retryContext); + const handledCloudAuthError = handleAwsCredentialError(error41) || handleGcpCredentialError(error41); + if (!handledCloudAuthError && (!(error41 instanceof APIError) || !shouldRetry(error41))) { + throw new CannotRetryError(error41, retryContext); } - if (error45 instanceof APIError) { - const overflowData = parseMaxTokensContextOverflowError(error45); + if (error41 instanceof APIError) { + const overflowData = parseMaxTokensContextOverflowError(error41); if (overflowData) { const { inputTokens, contextLimit } = overflowData; const safetyBuffer = 1000; const availableContext = Math.max(0, contextLimit - inputTokens - safetyBuffer); if (availableContext < FLOOR_OUTPUT_TOKENS) { logError2(new Error(`availableContext ${availableContext} is less than FLOOR_OUTPUT_TOKENS ${FLOOR_OUTPUT_TOKENS}`)); - throw error45; + throw error41; } const minRequired = (retryContext.thinkingConfig.type === "enabled" ? retryContext.thinkingConfig.budgetTokens : 0) + 1; const adjustedMaxTokens = Math.max(FLOOR_OUTPUT_TOKENS, availableContext, minRequired); @@ -295215,35 +218866,35 @@ async function* withRetry(getClient, operation, options2) { inputTokens, contextLimit, adjustedMaxTokens, - attempt: attempt3 + attempt: attempt2 }); continue; } } - const retryAfter = getRetryAfter(error45); + const retryAfter = getRetryAfter(error41); let delayMs; - if (persistent && error45 instanceof APIError && error45.status === 429) { + if (persistent && error41 instanceof APIError && error41.status === 429) { persistentAttempt++; - const resetDelay = getRateLimitResetDelayMs(error45); + const resetDelay = getRateLimitResetDelayMs(error41); delayMs = resetDelay ?? Math.min(getRetryDelay(persistentAttempt, retryAfter, PERSISTENT_MAX_BACKOFF_MS), PERSISTENT_RESET_CAP_MS); } else if (persistent) { persistentAttempt++; delayMs = Math.min(getRetryDelay(persistentAttempt, retryAfter, PERSISTENT_MAX_BACKOFF_MS), PERSISTENT_RESET_CAP_MS); } else { - delayMs = getRetryDelay(attempt3, retryAfter); + delayMs = getRetryDelay(attempt2, retryAfter); } - const reportedAttempt = persistent ? persistentAttempt : attempt3; + const reportedAttempt = persistent ? persistentAttempt : attempt2; logEvent("tengu_api_retry", { attempt: reportedAttempt, delayMs, - error: error45.message, - status: error45.status, + error: error41.message, + status: error41.status, provider: getAPIProviderForStatsig() }); if (persistent) { if (delayMs > 60000) { logEvent("tengu_api_persistent_retry_wait", { - status: error45.status, + status: error41.status, delayMs, attempt: reportedAttempt, provider: getAPIProviderForStatsig() @@ -295253,48 +218904,48 @@ async function* withRetry(getClient, operation, options2) { while (remaining > 0) { if (options2.signal?.aborted) throw new APIUserAbortError; - if (error45 instanceof APIError) { - yield createSystemAPIErrorMessage(error45, remaining, reportedAttempt, maxRetries); + if (error41 instanceof APIError) { + yield createSystemAPIErrorMessage(error41, remaining, reportedAttempt, maxRetries); } - const chunk3 = Math.min(remaining, HEARTBEAT_INTERVAL_MS); - await sleep4(chunk3, options2.signal, { abortError }); - remaining -= chunk3; + const chunk2 = Math.min(remaining, HEARTBEAT_INTERVAL_MS); + await sleep2(chunk2, options2.signal, { abortError }); + remaining -= chunk2; } - if (attempt3 >= maxRetries) - attempt3 = maxRetries; + if (attempt2 >= maxRetries) + attempt2 = maxRetries; } else { - if (error45 instanceof APIError) { - yield createSystemAPIErrorMessage(error45, delayMs, attempt3, maxRetries); + if (error41 instanceof APIError) { + yield createSystemAPIErrorMessage(error41, delayMs, attempt2, maxRetries); } - await sleep4(delayMs, options2.signal, { abortError }); + await sleep2(delayMs, options2.signal, { abortError }); } } } throw new CannotRetryError(lastError, retryContext); } -function getRetryAfter(error45) { - return (error45.headers?.["retry-after"] || error45.headers?.get?.("retry-after")) ?? null; +function getRetryAfter(error41) { + return (error41.headers?.["retry-after"] || error41.headers?.get?.("retry-after")) ?? null; } -function getRetryDelay(attempt3, retryAfterHeader, maxDelayMs = 32000) { +function getRetryDelay(attempt2, retryAfterHeader, maxDelayMs = 32000) { if (retryAfterHeader) { const seconds = parseInt(retryAfterHeader, 10); if (!isNaN(seconds)) { return seconds * 1000; } } - const baseDelay3 = Math.min(BASE_DELAY_MS * Math.pow(2, attempt3 - 1), maxDelayMs); - const jitter = Math.random() * 0.25 * baseDelay3; - return baseDelay3 + jitter; + const baseDelay2 = Math.min(BASE_DELAY_MS * Math.pow(2, attempt2 - 1), maxDelayMs); + const jitter = Math.random() * 0.25 * baseDelay2; + return baseDelay2 + jitter; } -function parseMaxTokensContextOverflowError(error45) { - if (error45.status !== 400 || !error45.message) { +function parseMaxTokensContextOverflowError(error41) { + if (error41.status !== 400 || !error41.message) { return; } - if (!error45.message.includes("input length and `max_tokens` exceed context limit")) { + if (!error41.message.includes("input length and `max_tokens` exceed context limit")) { return; } const regex2 = /input length and `max_tokens` exceed context limit: (\d+) \+ (\d+) > (\d+)/; - const match = error45.message.match(regex2); + const match = error41.message.match(regex2); if (!match || match.length !== 4) { return; } @@ -295310,106 +218961,106 @@ function parseMaxTokensContextOverflowError(error45) { } return { inputTokens, maxTokens, contextLimit }; } -function isFastModeNotEnabledError(error45) { - if (!(error45 instanceof APIError)) { +function isFastModeNotEnabledError(error41) { + if (!(error41 instanceof APIError)) { return false; } - return error45.status === 400 && (error45.message?.includes("Fast mode is not enabled") ?? false); + return error41.status === 400 && (error41.message?.includes("Fast mode is not enabled") ?? false); } -function is529Error(error45) { - if (!(error45 instanceof APIError)) { +function is529Error(error41) { + if (!(error41 instanceof APIError)) { return false; } - return error45.status === 529 || (error45.message?.includes('"type":"overloaded_error"') ?? false); + return error41.status === 529 || (error41.message?.includes('"type":"overloaded_error"') ?? false); } -function isOAuthTokenRevokedError(error45) { - return error45 instanceof APIError && error45.status === 403 && (error45.message?.includes("OAuth token has been revoked") ?? false); +function isOAuthTokenRevokedError(error41) { + return error41 instanceof APIError && error41.status === 403 && (error41.message?.includes("OAuth token has been revoked") ?? false); } -function isBedrockAuthError(error45) { +function isBedrockAuthError(error41) { if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK)) { - if (isAwsCredentialsProviderError(error45) || error45 instanceof APIError && error45.status === 403) { + if (isAwsCredentialsProviderError(error41) || error41 instanceof APIError && error41.status === 403) { return true; } } return false; } -function handleAwsCredentialError(error45) { - if (isBedrockAuthError(error45)) { +function handleAwsCredentialError(error41) { + if (isBedrockAuthError(error41)) { clearAwsCredentialsCache(); return true; } return false; } -function isGoogleAuthLibraryCredentialError(error45) { - if (!(error45 instanceof Error)) +function isGoogleAuthLibraryCredentialError(error41) { + if (!(error41 instanceof Error)) return false; - const msg = error45.message; + const msg = error41.message; return msg.includes("Could not load the default credentials") || msg.includes("Could not refresh access token") || msg.includes("invalid_grant"); } -function isVertexAuthError(error45) { +function isVertexAuthError(error41) { if (isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX)) { - if (isGoogleAuthLibraryCredentialError(error45)) { + if (isGoogleAuthLibraryCredentialError(error41)) { return true; } - if (error45 instanceof APIError && error45.status === 401) { + if (error41 instanceof APIError && error41.status === 401) { return true; } } return false; } -function handleGcpCredentialError(error45) { - if (isVertexAuthError(error45)) { +function handleGcpCredentialError(error41) { + if (isVertexAuthError(error41)) { clearGcpCredentialsCache(); return true; } return false; } -function shouldRetry(error45) { - if (isMockRateLimitError(error45)) { +function shouldRetry(error41) { + if (isMockRateLimitError(error41)) { return false; } - if (isPersistentRetryEnabled() && isTransientCapacityError(error45)) { + if (isPersistentRetryEnabled() && isTransientCapacityError(error41)) { return true; } - if (isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) && (error45.status === 401 || error45.status === 403)) { + if (isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) && (error41.status === 401 || error41.status === 403)) { return true; } - if (error45.message?.includes('"type":"overloaded_error"')) { + if (error41.message?.includes('"type":"overloaded_error"')) { return true; } - if (parseMaxTokensContextOverflowError(error45)) { + if (parseMaxTokensContextOverflowError(error41)) { return true; } - const shouldRetryHeader = error45.headers?.get("x-should-retry"); + const shouldRetryHeader = error41.headers?.get("x-should-retry"); if (shouldRetryHeader === "true" && (!isClaudeAISubscriber() || isEnterpriseSubscriber())) { return true; } if (shouldRetryHeader === "false") { - const is5xxError = error45.status !== undefined && error45.status >= 500; + const is5xxError = error41.status !== undefined && error41.status >= 500; if (!(process.env.USER_TYPE === "ant" && is5xxError)) { return false; } } - if (error45 instanceof APIConnectionError) { + if (error41 instanceof APIConnectionError) { return true; } - if (!error45.status) + if (!error41.status) return false; - if (error45.status === 408) + if (error41.status === 408) return true; - if (error45.status === 409) + if (error41.status === 409) return true; - if (error45.status === 429) { + if (error41.status === 429) { return !isClaudeAISubscriber() || isEnterpriseSubscriber(); } - if (error45.status === 401) { + if (error41.status === 401) { clearApiKeyHelperCache(); return true; } - if (isOAuthTokenRevokedError(error45)) { + if (isOAuthTokenRevokedError(error41)) { return true; } - if (error45.status && error45.status >= 500) + if (error41.status && error41.status >= 500) return true; return false; } @@ -295422,8 +219073,8 @@ function getDefaultMaxRetries() { function getMaxRetries(options2) { return options2.maxRetries ?? getDefaultMaxRetries(); } -function getRetryAfterMs(error45) { - const retryAfter = getRetryAfter(error45); +function getRetryAfterMs(error41) { + const retryAfter = getRetryAfter(error41); if (retryAfter) { const seconds = parseInt(retryAfter, 10); if (!isNaN(seconds)) { @@ -295432,8 +219083,8 @@ function getRetryAfterMs(error45) { } return null; } -function getRateLimitResetDelayMs(error45) { - const resetHeader = error45.headers?.get?.("anthropic-ratelimit-unified-reset"); +function getRateLimitResetDelayMs(error41) { + const resetHeader = error41.headers?.get?.("anthropic-ratelimit-unified-reset"); if (!resetHeader) return null; const resetUnixSec = Number(resetHeader); @@ -295451,9 +219102,9 @@ var init_withRetry = __esm(() => { init_aws(); init_debug(); init_log3(); - init_messages5(); + init_messages3(); init_providers(); - init_auth2(); + init_auth(); init_envUtils(); init_errors(); init_fastMode(); @@ -295462,7 +219113,7 @@ var init_withRetry = __esm(() => { init_growthbook(); init_analytics(); init_rateLimitMocking(); - init_errors7(); + init_errors6(); init_errorUtils(); FOREGROUND_529_RETRY_SOURCES = new Set([ "repl_main_thread", @@ -295562,10 +219213,10 @@ Label:`, }); const summary = response.message.content.filter((block2) => block2.type === "text").map((block2) => block2.type === "text" ? block2.text : "").join("").trim(); return summary || null; - } catch (error45) { - const err3 = toError(error45); - err3.cause = { errorId: E_TOOL_USE_SUMMARY_GENERATION_FAILED }; - logError2(err3); + } catch (error41) { + const err2 = toError(error41); + err2.cause = { errorId: E_TOOL_USE_SUMMARY_GENERATION_FAILED }; + logError2(err2); return null; } } @@ -295599,16 +219250,16 @@ var init_toolUseSummaryGenerator = __esm(() => { // src/utils/objectGroupBy.ts function objectGroupBy(items, keySelector) { - const result3 = Object.create(null); + const result2 = Object.create(null); let index = 0; for (const item of items) { const key = keySelector(item, index++); - if (result3[key] === undefined) { - result3[key] = []; + if (result2[key] === undefined) { + result2[key] = []; } - result3[key].push(item); + result2[key].push(item); } - return result3; + return result2; } // src/utils/messageQueueManager.ts @@ -295649,19 +219300,19 @@ function enqueuePendingNotification(command) { notifySubscribers(); logOperation("enqueue", typeof command.value === "string" ? command.value : undefined); } -function dequeue(filter4) { +function dequeue(filter3) { if (commandQueue.length === 0) { return; } let bestIdx = -1; let bestPriority = Infinity; - for (let i4 = 0;i4 < commandQueue.length; i4++) { - const cmd = commandQueue[i4]; - if (filter4 && !filter4(cmd)) + for (let i3 = 0;i3 < commandQueue.length; i3++) { + const cmd = commandQueue[i3]; + if (filter3 && !filter3(cmd)) continue; const priority = PRIORITY_ORDER[cmd.priority ?? "next"]; if (priority < bestPriority) { - bestIdx = i4; + bestIdx = i3; bestPriority = priority; } } @@ -295672,19 +219323,19 @@ function dequeue(filter4) { logOperation("dequeue"); return dequeued; } -function peek(filter4) { +function peek(filter3) { if (commandQueue.length === 0) { return; } let bestIdx = -1; let bestPriority = Infinity; - for (let i4 = 0;i4 < commandQueue.length; i4++) { - const cmd = commandQueue[i4]; - if (filter4 && !filter4(cmd)) + for (let i3 = 0;i3 < commandQueue.length; i3++) { + const cmd = commandQueue[i3]; + if (filter3 && !filter3(cmd)) continue; const priority = PRIORITY_ORDER[cmd.priority ?? "next"]; if (priority < bestPriority) { - bestIdx = i4; + bestIdx = i3; bestPriority = priority; } } @@ -295713,17 +219364,17 @@ function dequeueAllMatching(predicate) { } return matched; } -function remove3(commandsToRemove) { +function remove2(commandsToRemove) { if (commandsToRemove.length === 0) { return; } - const before3 = commandQueue.length; - for (let i4 = commandQueue.length - 1;i4 >= 0; i4--) { - if (commandsToRemove.includes(commandQueue[i4])) { - commandQueue.splice(i4, 1); + const before2 = commandQueue.length; + for (let i3 = commandQueue.length - 1;i3 >= 0; i3--) { + if (commandsToRemove.includes(commandQueue[i3])) { + commandQueue.splice(i3, 1); } } - if (commandQueue.length !== before3) { + if (commandQueue.length !== before2) { notifySubscribers(); } for (const _cmd of commandsToRemove) { @@ -295732,9 +219383,9 @@ function remove3(commandsToRemove) { } function removeByFilter(predicate) { const removed = []; - for (let i4 = commandQueue.length - 1;i4 >= 0; i4--) { - if (predicate(commandQueue[i4])) { - removed.unshift(commandQueue.splice(i4, 1)[0]); + for (let i3 = commandQueue.length - 1;i3 >= 0; i3--) { + if (predicate(commandQueue[i3])) { + removed.unshift(commandQueue.splice(i3, 1)[0]); } } if (removed.length > 0) { @@ -295833,7 +219484,7 @@ var commandQueue, snapshot, queueChanged, subscribeToCommandQueue, PRIORITY_ORDE var init_messageQueueManager = __esm(() => { init_bun_bundle(); init_state(); - init_messages5(); + init_messages3(); init_sessionStorage(); commandQueue = []; snapshot = Object.freeze([]); @@ -295853,8 +219504,8 @@ var init_messageQueueManager = __esm(() => { function setCommandLifecycleListener(cb) { listener = cb; } -function notifyCommandLifecycle(uuid5, state) { - listener?.(uuid5, state); +function notifyCommandLifecycle(uuid3, state) { + listener?.(uuid3, state); } var listener = null; @@ -295986,8 +219637,8 @@ async function executePostSamplingHooks(messages, systemPrompt, userContext, sys for (const hook of postSamplingHooks) { try { await hook(context); - } catch (error45) { - logError2(toError(error45)); + } catch (error41) { + logError2(toError(error41)); } } } @@ -295999,11 +219650,11 @@ var init_postSamplingHooks = __esm(() => { }); // src/services/api/dumpPrompts.ts -import { createHash as createHash5 } from "crypto"; -import { promises as fs8 } from "fs"; -import { dirname as dirname25, join as join55 } from "path"; +import { createHash as createHash4 } from "crypto"; +import { promises as fs2 } from "fs"; +import { dirname as dirname22, join as join45 } from "path"; function hashString3(str) { - return createHash5("sha256").update(str).digest("hex"); + return createHash4("sha256").update(str).digest("hex"); } function clearDumpState(agentIdOrSessionId) { dumpState.delete(agentIdOrSessionId); @@ -296023,12 +219674,12 @@ function addApiRequestToCache(requestData) { } } function getDumpPromptsPath(agentIdOrSessionId) { - return join55(getClaudeConfigHomeDir(), "dump-prompts", `${agentIdOrSessionId ?? getSessionId()}.jsonl`); + return join45(getClaudeConfigHomeDir(), "dump-prompts", `${agentIdOrSessionId ?? getSessionId()}.jsonl`); } function appendToFile(filePath, entries) { if (entries.length === 0) return; - fs8.mkdir(dirname25(filePath), { recursive: true }).then(() => fs8.appendFile(filePath, entries.join(` + fs2.mkdir(dirname22(filePath), { recursive: true }).then(() => fs2.appendFile(filePath, entries.join(` `) + ` `)).catch(() => {}); } @@ -296073,7 +219724,7 @@ function dumpRequest(body, ts, state, filePath) { } function createDumpPromptsFetch(agentIdOrSessionId) { const filePath = getDumpPromptsPath(agentIdOrSessionId); - return async (input3, init2) => { + return async (input, init) => { const state = dumpState.get(agentIdOrSessionId) ?? { initialized: false, messageCountSeen: 0, @@ -296082,11 +219733,11 @@ function createDumpPromptsFetch(agentIdOrSessionId) { }; dumpState.set(agentIdOrSessionId, state); let timestamp; - if (init2?.method === "POST" && init2.body) { + if (init?.method === "POST" && init.body) { timestamp = new Date().toISOString(); - setImmediate(dumpRequest, init2.body, timestamp, state, filePath); + setImmediate(dumpRequest, init.body, timestamp, state, filePath); } - const response = await globalThis.fetch(input3, init2); + const response = await globalThis.fetch(input, init); if (timestamp && response.ok && process.env.USER_TYPE === "ant") { const cloned = response.clone(); (async () => { @@ -296124,7 +219775,7 @@ function createDumpPromptsFetch(agentIdOrSessionId) { } else { data = await cloned.json(); } - await fs8.appendFile(filePath, jsonStringify({ type: "response", timestamp, data }) + ` + await fs2.appendFile(filePath, jsonStringify({ type: "response", timestamp, data }) + ` `); } catch {} })(); @@ -296149,27 +219800,27 @@ function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) { return controller; } function propagateAbort(weakChild) { - const parent3 = this.deref(); - weakChild.deref()?.abort(parent3?.signal.reason); + const parent2 = this.deref(); + weakChild.deref()?.abort(parent2?.signal.reason); } function removeAbortHandler(weakHandler) { - const parent3 = this.deref(); - const handler6 = weakHandler.deref(); - if (parent3 && handler6) { - parent3.signal.removeEventListener("abort", handler6); + const parent2 = this.deref(); + const handler10 = weakHandler.deref(); + if (parent2 && handler10) { + parent2.signal.removeEventListener("abort", handler10); } } -function createChildAbortController(parent3, maxListeners) { +function createChildAbortController(parent2, maxListeners) { const child = createAbortController(maxListeners); - if (parent3.signal.aborted) { - child.abort(parent3.signal.reason); + if (parent2.signal.aborted) { + child.abort(parent2.signal.reason); return child; } const weakChild = new WeakRef(child); - const weakParent = new WeakRef(parent3); - const handler6 = propagateAbort.bind(weakParent, weakChild); - parent3.signal.addEventListener("abort", handler6, { once: true }); - child.signal.addEventListener("abort", removeAbortHandler.bind(weakParent, new WeakRef(handler6)), { once: true }); + const weakParent = new WeakRef(parent2); + const handler10 = propagateAbort.bind(weakParent, weakChild); + parent2.signal.addEventListener("abort", handler10, { once: true }); + child.signal.addEventListener("abort", removeAbortHandler.bind(weakParent, new WeakRef(handler10)), { once: true }); return child; } var DEFAULT_MAX_LISTENERS = 50; @@ -296215,16 +219866,16 @@ var require_core3 = __commonJS((exports, module) => { return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); } function inherit(original, ...objects) { - const result3 = Object.create(null); + const result2 = Object.create(null); for (const key in original) { - result3[key] = original[key]; + result2[key] = original[key]; } objects.forEach(function(obj) { for (const key in obj) { - result3[key] = obj[key]; + result2[key] = obj[key]; } }); - return result3; + return result2; } var SPAN_CLOSE = ""; var emitsWrappingTags = (node) => { @@ -296237,8 +219888,8 @@ var require_core3 = __commonJS((exports, module) => { this.classPrefix = options2.classPrefix; parseTree2.walk(this); } - addText(text2) { - this.buffer += escapeHTML(text2); + addText(text) { + this.buffer += escapeHTML(text); } openNode(node) { if (!emitsWrappingTags(node)) @@ -296327,19 +219978,19 @@ var require_core3 = __commonJS((exports, module) => { super(); this.options = options2; } - addKeyword(text2, kind) { - if (text2 === "") { + addKeyword(text, kind) { + if (text === "") { return; } this.openNode(kind); - this.addText(text2); + this.addText(text); this.closeNode(); } - addText(text2) { - if (text2 === "") { + addText(text) { + if (text === "") { return; } - this.add(text2); + this.add(text); } addSublanguage(emitter, name) { const node = emitter.root; @@ -296355,7 +220006,7 @@ var require_core3 = __commonJS((exports, module) => { return true; } } - function escape5(value) { + function escape4(value) { return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "m"); } function source(re) { @@ -296365,23 +220016,23 @@ var require_core3 = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function countMatchGroups(re) { return new RegExp(re.toString() + "|").exec("").length - 1; } - function startsWith3(re, lexeme) { + function startsWith2(re, lexeme) { const match = re && re.exec(lexeme); return match && match.index === 0; } var BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./; - function join56(regexps, separator = "|") { + function join46(regexps, separator = "|") { let numCaptures = 0; return regexps.map((regex2) => { numCaptures += 1; @@ -296418,7 +220069,7 @@ var require_core3 = __commonJS((exports, module) => { var SHEBANG = (opts = {}) => { const beginShebang = /^#![ ]*\//; if (opts.binary) { - opts.begin = concat3(beginShebang, /.*\b/, opts.binary, /\b.*/); + opts.begin = concat2(beginShebang, /.*\b/, opts.binary, /\b.*/); } return inherit({ className: "meta", @@ -296562,13 +220213,13 @@ var require_core3 = __commonJS((exports, module) => { END_SAME_AS_BEGIN }); function skipIfhasPrecedingDot(match, response) { - const before3 = match.input[match.index - 1]; - if (before3 === ".") { + const before2 = match.input[match.index - 1]; + if (before2 === ".") { response.ignoreMatch(); } } - function beginKeywords(mode, parent3) { - if (!parent3) + function beginKeywords(mode, parent2) { + if (!parent2) return; if (!mode.beginKeywords) return; @@ -296624,7 +220275,7 @@ var require_core3 = __commonJS((exports, module) => { return compiledKeywords; function compileList(className2, keywordList) { if (caseInsensitive) { - keywordList = keywordList.map((x4) => x4.toLowerCase()); + keywordList = keywordList.map((x3) => x3.toLowerCase()); } keywordList.forEach(function(keyword) { const pair = keyword.split("|"); @@ -296664,7 +220315,7 @@ var require_core3 = __commonJS((exports, module) => { this.exec = () => null; } const terminators = this.regexes.map((el) => el[1]); - this.matcherRe = langRe(join56(terminators), true); + this.matcherRe = langRe(join46(terminators), true); this.lastIndex = 0; } exec(s) { @@ -296673,9 +220324,9 @@ var require_core3 = __commonJS((exports, module) => { if (!match) { return null; } - const i4 = match.findIndex((el, i5) => i5 > 0 && el !== undefined); - const matchData = this.matchIndexes[i4]; - match.splice(0, i4); + const i3 = match.findIndex((el, i4) => i4 > 0 && el !== undefined); + const matchData = this.matchIndexes[i3]; + match.splice(0, i3); return Object.assign(match, matchData); } } @@ -296711,23 +220362,23 @@ var require_core3 = __commonJS((exports, module) => { exec(s) { const m = this.getMatcher(this.regexIndex); m.lastIndex = this.lastIndex; - let result3 = m.exec(s); + let result2 = m.exec(s); if (this.resumingScanAtSamePosition()) { - if (result3 && result3.index === this.lastIndex) + if (result2 && result2.index === this.lastIndex) ; else { const m2 = this.getMatcher(0); m2.lastIndex = this.lastIndex + 1; - result3 = m2.exec(s); + result2 = m2.exec(s); } } - if (result3) { - this.regexIndex += result3.position + 1; + if (result2) { + this.regexIndex += result2.position + 1; if (this.regexIndex === this.count) { this.considerAll(); } } - return result3; + return result2; } } function buildModeRegex(mode) { @@ -296741,20 +220392,20 @@ var require_core3 = __commonJS((exports, module) => { } return mm; } - function compileMode(mode, parent3) { + function compileMode(mode, parent2) { const cmode = mode; if (mode.isCompiled) return cmode; [ compileMatch - ].forEach((ext) => ext(mode, parent3)); - language.compilerExtensions.forEach((ext) => ext(mode, parent3)); + ].forEach((ext) => ext(mode, parent2)); + language.compilerExtensions.forEach((ext) => ext(mode, parent2)); mode.__beforeBegin = null; [ beginKeywords, compileIllegal, compileRelevance - ].forEach((ext) => ext(mode, parent3)); + ].forEach((ext) => ext(mode, parent2)); mode.isCompiled = true; let keywordPattern = null; if (typeof mode.keywords === "object") { @@ -296769,7 +220420,7 @@ var require_core3 = __commonJS((exports, module) => { } keywordPattern = keywordPattern || mode.lexemes || /\w+/; cmode.keywordPatternRe = langRe(keywordPattern, true); - if (parent3) { + if (parent2) { if (!mode.begin) mode.begin = /\B|\b/; cmode.beginRe = langRe(mode.begin); @@ -296780,8 +220431,8 @@ var require_core3 = __commonJS((exports, module) => { if (mode.end) cmode.endRe = langRe(mode.end); cmode.terminatorEnd = source(mode.end) || ""; - if (mode.endsWithParent && parent3.terminatorEnd) { - cmode.terminatorEnd += (mode.end ? "|" : "") + parent3.terminatorEnd; + if (mode.endsWithParent && parent2.terminatorEnd) { + cmode.terminatorEnd += (mode.end ? "|" : "") + parent2.terminatorEnd; } } if (mode.illegal) @@ -296795,7 +220446,7 @@ var require_core3 = __commonJS((exports, module) => { compileMode(c6, cmode); }); if (mode.starts) { - compileMode(mode.starts, parent3); + compileMode(mode.starts, parent2); } cmode.matcher = buildModeRegex(cmode); return cmode; @@ -296855,15 +220506,15 @@ var require_core3 = __commonJS((exports, module) => { this.unknownLanguage = true; return escapeHTML(this.code); } - let result3 = {}; + let result2 = {}; if (this.autoDetect) { - result3 = hljs.highlightAuto(this.code); - this.detectedLanguage = result3.language; + result2 = hljs.highlightAuto(this.code); + this.detectedLanguage = result2.language; } else { - result3 = hljs.highlight(this.language, this.code, this.ignoreIllegals); + result2 = hljs.highlight(this.language, this.code, this.ignoreIllegals); this.detectedLanguage = this.language; } - return result3.value; + return result2.value; }, autoDetect() { return !this.language || hasValueOrEmptyAttribute(this.autodetect); @@ -296889,33 +220540,33 @@ var require_core3 = __commonJS((exports, module) => { return { Component, VuePlugin }; } var mergeHTMLPlugin = { - "after:highlightElement": ({ el, result: result3, text: text2 }) => { + "after:highlightElement": ({ el, result: result2, text }) => { const originalStream = nodeStream(el); if (!originalStream.length) return; const resultNode = document.createElement("div"); - resultNode.innerHTML = result3.value; - result3.value = mergeStreams2(originalStream, nodeStream(resultNode), text2); + resultNode.innerHTML = result2.value; + result2.value = mergeStreams2(originalStream, nodeStream(resultNode), text); } }; function tag2(node) { return node.nodeName.toLowerCase(); } function nodeStream(node) { - const result3 = []; + const result2 = []; (function _nodeStream(node2, offset) { for (let child = node2.firstChild;child; child = child.nextSibling) { if (child.nodeType === 3) { offset += child.nodeValue.length; } else if (child.nodeType === 1) { - result3.push({ + result2.push({ event: "start", offset, node: child }); offset = _nodeStream(child, offset); if (!tag2(child).match(/br|hr|img|input/)) { - result3.push({ + result2.push({ event: "stop", offset, node: child @@ -296925,11 +220576,11 @@ var require_core3 = __commonJS((exports, module) => { } return offset; })(node, 0); - return result3; + return result2; } function mergeStreams2(original, highlighted, value) { let processed = 0; - let result3 = ""; + let result2 = ""; const nodeStack = []; function selectStream() { if (!original.length || !highlighted.length) { @@ -296944,17 +220595,17 @@ var require_core3 = __commonJS((exports, module) => { function attributeString(attr) { return " " + attr.nodeName + '="' + escapeHTML(attr.value) + '"'; } - result3 += "<" + tag2(node) + [].map.call(node.attributes, attributeString).join("") + ">"; + result2 += "<" + tag2(node) + [].map.call(node.attributes, attributeString).join("") + ">"; } function close(node) { - result3 += ""; + result2 += ""; } function render2(event) { (event.event === "start" ? open5 : close)(event.node); } while (original.length || highlighted.length) { let stream4 = selectStream(); - result3 += escapeHTML(value.substring(processed, stream4[0].offset)); + result2 += escapeHTML(value.substring(processed, stream4[0].offset)); processed = stream4[0].offset; if (stream4 === original) { nodeStack.reverse().forEach(close); @@ -296972,10 +220623,10 @@ var require_core3 = __commonJS((exports, module) => { render2(stream4.splice(0, 1)[0]); } } - return result3 + escapeHTML(value.substr(processed)); + return result2 + escapeHTML(value.substr(processed)); } var seenDeprecations = {}; - var error45 = (message) => { + var error41 = (message) => { console.error(message); }; var warn = (message, ...args) => { @@ -297044,10 +220695,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`); language: languageName }; fire("before:highlight", context); - const result3 = context.result ? context.result : _highlight(context.language, context.code, ignoreIllegals, continuation); - result3.code = context.code; - fire("after:highlight", result3); - return result3; + const result2 = context.result ? context.result : _highlight(context.language, context.code, ignoreIllegals, continuation); + result2.code = context.code; + fire("after:highlight", result2); + return result2; } function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) { function keywordData(mode, match) { @@ -297089,21 +220740,21 @@ https://github.com/highlightjs/highlight.js/issues/2277`); function processSubLanguage() { if (modeBuffer === "") return; - let result4 = null; + let result3 = null; if (typeof top.subLanguage === "string") { if (!languages[top.subLanguage]) { emitter.addText(modeBuffer); return; } - result4 = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]); - continuations[top.subLanguage] = result4.top; + result3 = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]); + continuations[top.subLanguage] = result3.top; } else { - result4 = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null); + result3 = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null); } if (top.relevance > 0) { - relevance += result4.relevance; + relevance += result3.relevance; } - emitter.addSublanguage(result4.emitter, result4.language); + emitter.addSublanguage(result3.emitter, result3.language); } function processBuffer() { if (top.subLanguage != null) { @@ -297121,7 +220772,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`); return top; } function endOfMode(mode, match, matchPlusRemainder) { - let matched = startsWith3(mode.endRe, matchPlusRemainder); + let matched = startsWith2(mode.endRe, matchPlusRemainder); if (matched) { if (mode["on:end"]) { const resp = new Response2(mode); @@ -297162,7 +220813,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`); return doIgnore(lexeme); } if (newMode && newMode.endSameAsBegin) { - newMode.endRe = escape5(lexeme); + newMode.endRe = escape4(lexeme); } if (newMode.skip) { modeBuffer += lexeme; @@ -297234,10 +220885,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`); if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") { modeBuffer += codeToHighlight.slice(match.index, match.index + 1); if (!SAFE_MODE) { - const err3 = new Error("0 width match regex"); - err3.languageName = languageName; - err3.badRule = lastMatch.rule; - throw err3; + const err2 = new Error("0 width match regex"); + err2.languageName = languageName; + err2.badRule = lastMatch.rule; + throw err2; } return 1; } @@ -297245,9 +220896,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`); if (match.type === "begin") { return doBeginMatch(match); } else if (match.type === "illegal" && !ignoreIllegals) { - const err3 = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || "") + '"'); - err3.mode = top; - throw err3; + const err2 = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || "") + '"'); + err2.mode = top; + throw err2; } else if (match.type === "end") { const processed = doEndMatch(match); if (processed !== NO_MATCH) { @@ -297258,19 +220909,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`); return 1; } if (iterations > 1e5 && iterations > match.index * 3) { - const err3 = new Error("potential infinite loop, way more iterations than matches"); - throw err3; + const err2 = new Error("potential infinite loop, way more iterations than matches"); + throw err2; } modeBuffer += lexeme; return lexeme.length; } const language = getLanguage(languageName); if (!language) { - error45(LANGUAGE_NOT_FOUND.replace("{}", languageName)); + error41(LANGUAGE_NOT_FOUND.replace("{}", languageName)); throw new Error('Unknown language: "' + languageName + '"'); } const md = compileLanguage(language, { plugins }); - let result3 = ""; + let result2 = ""; let top = continuation || md; const continuations = {}; const emitter = new options2.__emitter(options2); @@ -297300,25 +220951,25 @@ https://github.com/highlightjs/highlight.js/issues/2277`); processLexeme(codeToHighlight.substr(index)); emitter.closeAllNodes(); emitter.finalize(); - result3 = emitter.toHTML(); + result2 = emitter.toHTML(); return { relevance: Math.floor(relevance), - value: result3, + value: result2, language: languageName, illegal: false, emitter, top }; - } catch (err3) { - if (err3.message && err3.message.includes("Illegal")) { + } catch (err2) { + if (err2.message && err2.message.includes("Illegal")) { return { illegal: true, illegalBy: { - msg: err3.message, + msg: err2.message, context: codeToHighlight.slice(index - 100, index + 100), - mode: err3.mode + mode: err2.mode }, - sofar: result3, + sofar: result2, relevance: 0, value: escape$1(codeToHighlight), emitter @@ -297331,23 +220982,23 @@ https://github.com/highlightjs/highlight.js/issues/2277`); emitter, language: languageName, top, - errorRaised: err3 + errorRaised: err2 }; } else { - throw err3; + throw err2; } } } function justTextHighlightResult(code) { - const result3 = { + const result2 = { relevance: 0, emitter: new options2.__emitter(options2), value: escape$1(code), illegal: false, top: PLAINTEXT_LANGUAGE }; - result3.emitter.addText(code); - return result3; + result2.emitter.addText(code); + return result2; } function highlightAuto(code, languageSubset) { languageSubset = languageSubset || options2.languages || Object.keys(languages); @@ -297367,9 +221018,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`); return 0; }); const [best, secondBest] = sorted; - const result3 = best; - result3.second_best = secondBest; - return result3; + const result2 = best; + result2.second_best = secondBest; + return result2; } function fixMarkup(html2) { if (!(options2.tabReplace || options2.useBR)) { @@ -297398,17 +221049,17 @@ https://github.com/highlightjs/highlight.js/issues/2277`); `); } }, - "after:highlightElement": ({ result: result3 }) => { + "after:highlightElement": ({ result: result2 }) => { if (options2.useBR) { - result3.value = result3.value.replace(/\n/g, "
"); + result2.value = result2.value.replace(/\n/g, "
"); } } }; const TAB_REPLACE_RE = /^(<[^>]+>|\t)+/gm; const tabReplacePlugin = { - "after:highlightElement": ({ result: result3 }) => { + "after:highlightElement": ({ result: result2 }) => { if (options2.tabReplace) { - result3.value = result3.value.replace(TAB_REPLACE_RE, (m) => m.replace(/\t/g, options2.tabReplace)); + result2.value = result2.value.replace(TAB_REPLACE_RE, (m) => m.replace(/\t/g, options2.tabReplace)); } } }; @@ -297419,21 +221070,21 @@ https://github.com/highlightjs/highlight.js/issues/2277`); return; fire("before:highlightElement", { el: element, language }); node = element; - const text2 = node.textContent; - const result3 = language ? highlight2(text2, { language, ignoreIllegals: true }) : highlightAuto(text2); - fire("after:highlightElement", { el: element, result: result3, text: text2 }); - element.innerHTML = result3.value; - updateClassName(element, language, result3.language); + const text = node.textContent; + const result2 = language ? highlight2(text, { language, ignoreIllegals: true }) : highlightAuto(text); + fire("after:highlightElement", { el: element, result: result2, text }); + element.innerHTML = result2.value; + updateClassName(element, language, result2.language); element.result = { - language: result3.language, - re: result3.relevance, - relavance: result3.relevance + language: result2.language, + re: result2.relevance, + relavance: result2.relevance }; - if (result3.second_best) { + if (result2.second_best) { element.second_best = { - language: result3.second_best.language, - re: result3.second_best.relevance, - relavance: result3.second_best.relevance + language: result2.second_best.language, + re: result2.second_best.relevance, + relavance: result2.second_best.relevance }; } } @@ -297477,11 +221128,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`); try { lang = languageDefinition(hljs); } catch (error$1) { - error45("Language definition for '{}' could not be registered.".replace("{}", languageName)); + error41("Language definition for '{}' could not be registered.".replace("{}", languageName)); if (!SAFE_MODE) { throw error$1; } else { - error45(error$1); + error41(error$1); } lang = PLAINTEXT_LANGUAGE; } @@ -297511,8 +221162,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`); if (lang) { return lang; } - const err3 = new Error("The '{}' language is required, but not loaded.".replace("{}", name)); - throw err3; + const err2 = new Error("The '{}' language is required, but not loaded.".replace("{}", name)); + throw err2; } function getLanguage(name) { name = (name || "").toLowerCase(); @@ -297756,8 +221407,8 @@ var require_abnf = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function abnf(hljs) { @@ -297802,7 +221453,7 @@ var require_abnf = __commonJS((exports, module) => { }; const ruleDeclarationMode = { className: "attribute", - begin: concat3(regexes.ruleDeclaration, /(?=\s*=)/) + begin: concat2(regexes.ruleDeclaration, /(?=\s*=)/) }; return { name: "Augmented Backus-Naur Form", @@ -297832,12 +221483,12 @@ var require_accesslog = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function accesslog(_hljs) { @@ -297867,7 +221518,7 @@ var require_accesslog = __commonJS((exports, module) => { }, { className: "string", - begin: concat3(/"/, either(...HTTP_VERBS)), + begin: concat2(/"/, either(...HTTP_VERBS)), end: /"/, keywords: HTTP_VERBS, illegal: /\n/, @@ -297921,8 +221572,8 @@ var require_actionscript = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function actionscript(hljs) { @@ -297989,7 +221640,7 @@ var require_actionscript = __commonJS((exports, module) => { AS3_REST_ARG_MODE ] }, - { begin: concat3(/:\s*/, IDENT_FUNC_RETURN_TYPE_RE) } + { begin: concat2(/:\s*/, IDENT_FUNC_RETURN_TYPE_RE) } ] }, hljs.METHOD_GUARD @@ -298302,12 +221953,12 @@ var require_applescript = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function applescript(hljs) { @@ -298389,7 +222040,7 @@ var require_applescript = __commonJS((exports, module) => { hljs.C_NUMBER_MODE, { className: "built_in", - begin: concat3(/\b/, either(...BUILT_IN_PATTERNS), /\b/) + begin: concat2(/\b/, either(...BUILT_IN_PATTERNS), /\b/) }, { className: "built_in", @@ -298401,7 +222052,7 @@ var require_applescript = __commonJS((exports, module) => { }, { className: "keyword", - begin: concat3(/\b/, either(...KEYWORD_PATTERNS), /\b/) + begin: concat2(/\b/, either(...KEYWORD_PATTERNS), /\b/) }, { beginKeywords: "on", @@ -298574,13 +222225,13 @@ var require_arduino = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function cPlusPlus(hljs) { @@ -298789,7 +222440,7 @@ var require_arduino = __commonJS((exports, module) => { className: "function.dispatch", relevance: 0, keywords: CPP_KEYWORDS, - begin: concat3(/\b/, /(?!decltype)/, /(?!if)/, /(?!for)/, /(?!while)/, hljs.IDENT_RE, lookahead(/\s*\(/)) + begin: concat2(/\b/, /(?!decltype)/, /(?!if)/, /(?!for)/, /(?!while)/, hljs.IDENT_RE, lookahead(/\s*\(/)) }; const EXPRESSION_CONTAINS = [ FUNCTION_DISPATCH, @@ -299058,21 +222709,21 @@ var require_xml = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function xml(hljs) { - const TAG_NAME_RE = concat3(/[A-Z_]/, optional3(/[A-Z0-9_.-]*:/), /[A-Z0-9_.-]*/); + const TAG_NAME_RE = concat2(/[A-Z_]/, optional3(/[A-Z0-9_.-]*:/), /[A-Z0-9_.-]*/); const XML_IDENT_RE = /[A-Za-z0-9._:-]+/; const XML_ENTITIES = { className: "symbol", @@ -299236,7 +222887,7 @@ var require_xml = __commonJS((exports, module) => { }, { className: "tag", - begin: concat3(//, />/, /\s/)))), + begin: concat2(//, />/, /\s/)))), end: /\/?>/, contains: [ { @@ -299249,7 +222900,7 @@ var require_xml = __commonJS((exports, module) => { }, { className: "tag", - begin: concat3(/<\//, lookahead(concat3(TAG_NAME_RE, />/))), + begin: concat2(/<\//, lookahead(concat2(TAG_NAME_RE, />/))), contains: [ { className: "name", @@ -299278,8 +222929,8 @@ var require_asciidoc = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function asciidoc(hljs) { @@ -299311,7 +222962,7 @@ var require_asciidoc = __commonJS((exports, module) => { }, { className: "strong", - begin: concat3(/\*\*/, /((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/, /(\*(?!\*)|\\[^\n]|[^*\n\\])*/, /\*\*/), + begin: concat2(/\*\*/, /((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/, /(\*(?!\*)|\\[^\n]|[^*\n\\])*/, /\*\*/), relevance: 0 }, { @@ -299330,7 +222981,7 @@ var require_asciidoc = __commonJS((exports, module) => { }, { className: "emphasis", - begin: concat3(/__/, /((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/, /(_(?!_)|\\[^\n]|[^_\n\\])*/, /__/), + begin: concat2(/__/, /((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/, /(_(?!_)|\\[^\n]|[^_\n\\])*/, /__/), relevance: 0 }, { @@ -299500,8 +223151,8 @@ var require_aspectj = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function aspectj(hljs) { @@ -299570,7 +223221,7 @@ var require_aspectj = __commonJS((exports, module) => { illegal: /["\[\]]/, contains: [ { - begin: concat3(hljs.UNDERSCORE_IDENT_RE, /\s*\(/), + begin: concat2(hljs.UNDERSCORE_IDENT_RE, /\s*\(/), returnBegin: true, contains: [hljs.UNDERSCORE_TITLE_MODE] } @@ -299586,7 +223237,7 @@ var require_aspectj = __commonJS((exports, module) => { illegal: /["\[\]]/, contains: [ { - begin: concat3(hljs.UNDERSCORE_IDENT_RE, /\s*\(/), + begin: concat2(hljs.UNDERSCORE_IDENT_RE, /\s*\(/), keywords: KEYWORDS + " " + SHORTKEYS, relevance: 0 }, @@ -299606,7 +223257,7 @@ var require_aspectj = __commonJS((exports, module) => { excludeEnd: true, contains: [ { - begin: concat3(hljs.UNDERSCORE_IDENT_RE, /\s*\(/), + begin: concat2(hljs.UNDERSCORE_IDENT_RE, /\s*\(/), returnBegin: true, relevance: 0, contains: [hljs.UNDERSCORE_TITLE_MODE] @@ -300160,8 +223811,8 @@ var require_bash = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function bash(hljs) { @@ -300180,7 +223831,7 @@ var require_bash = __commonJS((exports, module) => { Object.assign(VAR, { className: "variable", variants: [ - { begin: concat3(/\$[\w\d#@][\w\d_]*/, `(?![\\w\\d])(?![$])`) }, + { begin: concat2(/\$[\w\d#@][\w\d_]*/, `(?![\\w\\d])(?![$])`) }, BRACED_VAR ] }); @@ -300402,13 +224053,13 @@ var require_c_like = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function cPlusPlus(hljs) { @@ -300617,7 +224268,7 @@ var require_c_like = __commonJS((exports, module) => { className: "function.dispatch", relevance: 0, keywords: CPP_KEYWORDS, - begin: concat3(/\b/, /(?!decltype)/, /(?!if)/, /(?!for)/, /(?!while)/, hljs.IDENT_RE, lookahead(/\s*\(/)) + begin: concat2(/\b/, /(?!decltype)/, /(?!if)/, /(?!for)/, /(?!while)/, hljs.IDENT_RE, lookahead(/\s*\(/)) }; const EXPRESSION_CONTAINS = [ FUNCTION_DISPATCH, @@ -300807,10 +224458,10 @@ var require_c = __commonJS((exports, module) => { return re.source; } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function c6(hljs) { @@ -301868,13 +225519,13 @@ var require_cpp = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function cpp(hljs) { @@ -302083,7 +225734,7 @@ var require_cpp = __commonJS((exports, module) => { className: "function.dispatch", relevance: 0, keywords: CPP_KEYWORDS, - begin: concat3(/\b/, /(?!decltype)/, /(?!if)/, /(?!for)/, /(?!while)/, hljs.IDENT_RE, lookahead(/\s*\(/)) + begin: concat2(/\b/, /(?!decltype)/, /(?!if)/, /(?!for)/, /(?!while)/, hljs.IDENT_RE, lookahead(/\s*\(/)) }; const EXPRESSION_CONTAINS = [ FUNCTION_DISPATCH, @@ -303523,10 +227174,10 @@ var require_css = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function css(hljs) { @@ -303773,8 +227424,8 @@ var require_markdown = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function markdown(hljs) { @@ -303857,7 +227508,7 @@ var require_markdown = __commonJS((exports, module) => { relevance: 2 }, { - begin: concat3(/\[.+?\]\(/, URL_SCHEME, /:\/\/.*?\)/), + begin: concat2(/\[.+?\]\(/, URL_SCHEME, /:\/\/.*?\)/), relevance: 2 }, { @@ -305153,10 +228804,10 @@ var require_ruby = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function ruby(hljs) { @@ -305335,7 +228986,7 @@ var require_ruby = __commonJS((exports, module) => { }, { className: "function", - begin: concat3(/def\s+/, lookahead(RUBY_METHOD_RE + "\\s*(\\(|;|$)")), + begin: concat2(/def\s+/, lookahead(RUBY_METHOD_RE + "\\s*(\\(|;|$)")), relevance: 0, keywords: "def", end: "$|;", @@ -305489,8 +229140,8 @@ var require_erlang_repl = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function erlangRepl(hljs) { @@ -305515,7 +229166,7 @@ var require_erlang_repl = __commonJS((exports, module) => { hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, { - begin: concat3(/\?(::)?/, /([A-Z]\w*)/, /((::)[A-Z]\w*)*/) + begin: concat2(/\?(::)?/, /([A-Z]\w*)/, /((::)[A-Z]\w*)*/) }, { begin: "->" @@ -305703,7 +229354,7 @@ var require_erlang = __commonJS((exports, module) => { returnBegin: true, keywords: { $pattern: "-" + hljs.IDENT_RE, - keyword: DIRECTIVES.map((x4) => `${x4}|1.5`).join(" ") + keyword: DIRECTIVES.map((x3) => `${x3}|1.5`).join(" ") }, contains: [PARAMS] }, @@ -305862,8 +229513,8 @@ var require_fortran = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function fortran(hljs) { @@ -305891,13 +229542,13 @@ var require_fortran = __commonJS((exports, module) => { className: "number", variants: [ { - begin: concat3(/\b\d+/, /\.(\d*)/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) + begin: concat2(/\b\d+/, /\.(\d*)/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) }, { - begin: concat3(/\b\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) + begin: concat2(/\b\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) }, { - begin: concat3(/\.\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) + begin: concat2(/\.\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) } ], relevance: 0 @@ -306030,10 +229681,10 @@ var require_gams = __commonJS((exports, module) => { return re.source; } function anyNumberOfTimes(re) { - return concat3("(", re, ")*"); + return concat2("(", re, ")*"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function gams(hljs) { @@ -306099,7 +229750,7 @@ var require_gams = __commonJS((exports, module) => { ASSIGNMENT, { className: "comment", - begin: concat3(COMMENT_WORD, anyNumberOfTimes(concat3(/[ ]+/, COMMENT_WORD))), + begin: concat2(COMMENT_WORD, anyNumberOfTimes(concat2(/[ ]+/, COMMENT_WORD))), relevance: 0 } ] @@ -306662,10 +230313,10 @@ var require_groovy = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function variants(variants2, obj = {}) { @@ -306899,17 +230550,17 @@ var require_handlebars = __commonJS((exports, module) => { return re.source; } function anyNumberOfTimes(re) { - return concat3("(", re, ")*"); + return concat2("(", re, ")*"); } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function handlebars(hljs) { @@ -306960,8 +230611,8 @@ var require_handlebars = __commonJS((exports, module) => { const PLAIN_ID_REGEX = /[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/; const PATH_DELIMITER_REGEX = /(\.|\/)/; const ANY_ID = either(DOUBLE_QUOTED_ID_REGEX, SINGLE_QUOTED_ID_REGEX, BRACKET_QUOTED_ID_REGEX, PLAIN_ID_REGEX); - const IDENTIFIER_REGEX = concat3(optional3(/\.|\.\/|\//), ANY_ID, anyNumberOfTimes(concat3(PATH_DELIMITER_REGEX, ANY_ID))); - const HASH_PARAM_REGEX = concat3("(", BRACKET_QUOTED_ID_REGEX, "|", PLAIN_ID_REGEX, ")(?==)"); + const IDENTIFIER_REGEX = concat2(optional3(/\.|\.\/|\//), ANY_ID, anyNumberOfTimes(concat2(PATH_DELIMITER_REGEX, ANY_ID))); + const HASH_PARAM_REGEX = concat2("(", BRACKET_QUOTED_ID_REGEX, "|", PLAIN_ID_REGEX, ")(?==)"); const HELPER_NAME_OR_PATH_EXPRESSION = { begin: IDENTIFIER_REGEX, lexemes: /[\w.\/]+/ @@ -307478,17 +231129,17 @@ var require_htmlbars = __commonJS((exports, module) => { return re.source; } function anyNumberOfTimes(re) { - return concat3("(", re, ")*"); + return concat2("(", re, ")*"); } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function handlebars(hljs) { @@ -307539,8 +231190,8 @@ var require_htmlbars = __commonJS((exports, module) => { const PLAIN_ID_REGEX = /[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/; const PATH_DELIMITER_REGEX = /(\.|\/)/; const ANY_ID = either(DOUBLE_QUOTED_ID_REGEX, SINGLE_QUOTED_ID_REGEX, BRACKET_QUOTED_ID_REGEX, PLAIN_ID_REGEX); - const IDENTIFIER_REGEX = concat3(optional3(/\.|\.\/|\//), ANY_ID, anyNumberOfTimes(concat3(PATH_DELIMITER_REGEX, ANY_ID))); - const HASH_PARAM_REGEX = concat3("(", BRACKET_QUOTED_ID_REGEX, "|", PLAIN_ID_REGEX, ")(?==)"); + const IDENTIFIER_REGEX = concat2(optional3(/\.|\.\/|\//), ANY_ID, anyNumberOfTimes(concat2(PATH_DELIMITER_REGEX, ANY_ID))); + const HASH_PARAM_REGEX = concat2("(", BRACKET_QUOTED_ID_REGEX, "|", PLAIN_ID_REGEX, ")(?==)"); const HELPER_NAME_OR_PATH_EXPRESSION = { begin: IDENTIFIER_REGEX, lexemes: /[\w.\/]+/ @@ -307719,16 +231370,16 @@ var require_http = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function http3(hljs) { - const VERSION7 = "HTTP/(2|1\\.[01])"; + const VERSION5 = "HTTP/(2|1\\.[01])"; const HEADER_NAME = /[A-Za-z][A-Za-z0-9-]*/; const HEADER = { className: "attribute", - begin: concat3("^", HEADER_NAME, "(?=\\:\\s)"), + begin: concat2("^", HEADER_NAME, "(?=\\:\\s)"), starts: { contains: [ { @@ -307756,12 +231407,12 @@ var require_http = __commonJS((exports, module) => { illegal: /\S/, contains: [ { - begin: "^(?=" + VERSION7 + " \\d{3})", + begin: "^(?=" + VERSION5 + " \\d{3})", end: /$/, contains: [ { className: "meta", - begin: VERSION7 + begin: VERSION5 }, { className: "number", @@ -307775,7 +231426,7 @@ var require_http = __commonJS((exports, module) => { } }, { - begin: "(?=^[A-Z]+ (.*?) " + VERSION7 + "$)", + begin: "(?=^[A-Z]+ (.*?) " + VERSION5 + "$)", end: /$/, contains: [ { @@ -307787,7 +231438,7 @@ var require_http = __commonJS((exports, module) => { }, { className: "meta", - begin: VERSION7 + begin: VERSION5 }, { className: "keyword", @@ -307941,14 +231592,14 @@ var require_ini = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function ini(hljs) { @@ -308031,7 +231682,7 @@ var require_ini = __commonJS((exports, module) => { const QUOTED_KEY_DOUBLE_QUOTE = /"(\\"|[^"])*"/; const QUOTED_KEY_SINGLE_QUOTE = /'[^']*'/; const ANY_KEY = either(BARE_KEY, QUOTED_KEY_DOUBLE_QUOTE, QUOTED_KEY_SINGLE_QUOTE); - const DOTTED_KEY = concat3(ANY_KEY, "(\\s*\\.\\s*", ANY_KEY, ")*", lookahead(/\s*=\s*[^#\s]/)); + const DOTTED_KEY = concat2(ANY_KEY, "(\\s*\\.\\s*", ANY_KEY, ")*", lookahead(/\s*=\s*[^#\s]/)); return { name: "TOML, also INI", aliases: ["toml"], @@ -308074,8 +231725,8 @@ var require_irpf90 = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function irpf90(hljs) { @@ -308090,13 +231741,13 @@ var require_irpf90 = __commonJS((exports, module) => { className: "number", variants: [ { - begin: concat3(/\b\d+/, /\.(\d*)/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) + begin: concat2(/\b\d+/, /\.(\d*)/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) }, { - begin: concat3(/\b\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) + begin: concat2(/\b\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) }, { - begin: concat3(/\.\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) + begin: concat2(/\.\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX) } ], relevance: 0 @@ -308689,16 +232340,16 @@ var require_javascript = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function javascript(hljs) { - const hasClosingTag = (match, { after: after3 }) => { + const hasClosingTag = (match, { after: after2 }) => { const tag2 = " { COMMENT, NUMBER, { - begin: concat3(/[{,\n]\s*/, lookahead(concat3(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/, IDENT_RE$1 + "\\s*:"))), + begin: concat2(/[{,\n]\s*/, lookahead(concat2(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/, IDENT_RE$1 + "\\s*:"))), relevance: 0, contains: [ { @@ -309915,7 +233566,7 @@ var require_latex = __commonJS((exports, module) => { return re.source; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function latex(hljs) { @@ -311388,8 +235039,8 @@ var require_llvm = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function llvm(hljs) { @@ -311426,7 +235077,7 @@ var require_llvm = __commonJS((exports, module) => { const VARIABLE = { className: "variable", variants: [ - { begin: concat3(/%/, IDENT_RE) }, + { begin: concat2(/%/, IDENT_RE) }, { begin: /%\d+/ }, { begin: /#\d+/ } ] @@ -311434,10 +235085,10 @@ var require_llvm = __commonJS((exports, module) => { const FUNCTION = { className: "title", variants: [ - { begin: concat3(/@/, IDENT_RE) }, + { begin: concat2(/@/, IDENT_RE) }, { begin: /@\d+/ }, - { begin: concat3(/!/, IDENT_RE) }, - { begin: concat3(/!\d+/, IDENT_RE) }, + { begin: concat2(/!/, IDENT_RE) }, + { begin: concat2(/!\d+/, IDENT_RE) }, { begin: /!\d+/ } ] }; @@ -318321,26 +241972,26 @@ var require_mathematica = __commonJS((exports, module) => { return re.source; } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function mathematica(hljs) { const BASE_RE = /([2-9]|[1-2]\d|[3][0-5])\^\^/; const BASE_DIGITS_RE = /(\w*\.\w+|\w+\.\w*|\w+)/; const NUMBER_RE = /(\d*\.\d+|\d+\.\d*|\d+)/; - const BASE_NUMBER_RE = either(concat3(BASE_RE, BASE_DIGITS_RE), NUMBER_RE); + const BASE_NUMBER_RE = either(concat2(BASE_RE, BASE_DIGITS_RE), NUMBER_RE); const ACCURACY_RE = /``[+-]?(\d*\.\d+|\d+\.\d*|\d+)/; const PRECISION_RE = /`([+-]?(\d*\.\d+|\d+\.\d*|\d+))?/; const APPROXIMATE_NUMBER_RE = either(ACCURACY_RE, PRECISION_RE); const SCIENTIFIC_NOTATION_RE = /\*\^[+-]?\d+/; - const MATHEMATICA_NUMBER_RE = concat3(BASE_NUMBER_RE, optional3(APPROXIMATE_NUMBER_RE), optional3(SCIENTIFIC_NOTATION_RE)); + const MATHEMATICA_NUMBER_RE = concat2(BASE_NUMBER_RE, optional3(APPROXIMATE_NUMBER_RE), optional3(SCIENTIFIC_NOTATION_RE)); const NUMBERS = { className: "number", relevance: 0, @@ -318392,7 +242043,7 @@ var require_mathematica = __commonJS((exports, module) => { const MESSAGES = { className: "message-name", relevance: 0, - begin: concat3("::", SYMBOL_RE) + begin: concat2("::", SYMBOL_RE) }; return { name: "Mathematica", @@ -318766,12 +242417,12 @@ var require_perl = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function perl(hljs) { @@ -319028,7 +242679,7 @@ var require_perl = __commonJS((exports, module) => { begin: /\$\d/ }, { - begin: concat3(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/, `(?![A-Za-z])(?![@$%])`) + begin: concat2(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/, `(?![A-Za-z])(?![@$%])`) }, { begin: /[$%@][^\s\w{]/, @@ -319051,11 +242702,11 @@ var require_perl = __commonJS((exports, module) => { /#/ ]; const PAIRED_DOUBLE_RE = (prefix, open5, close = "\\1") => { - const middle = close === "\\1" ? close : concat3(close, open5); - return concat3(concat3("(?:", prefix, ")"), open5, /(?:\\.|[^\\\/])*?/, middle, /(?:\\.|[^\\\/])*?/, close, REGEX_MODIFIERS); + const middle = close === "\\1" ? close : concat2(close, open5); + return concat2(concat2("(?:", prefix, ")"), open5, /(?:\\.|[^\\\/])*?/, middle, /(?:\\.|[^\\\/])*?/, close, REGEX_MODIFIERS); }; const PAIRED_RE = (prefix, open5, close) => { - return concat3(concat3("(?:", prefix, ")"), open5, /(?:\\.|[^\\\/])*?/, close, REGEX_MODIFIERS); + return concat2(concat2("(?:", prefix, ")"), open5, /(?:\\.|[^\\\/])*?/, close, REGEX_MODIFIERS); }; const PERL_DEFAULT_CONTAINS = [ VAR, @@ -321497,10 +245148,10 @@ var require_python = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function python(hljs) { @@ -321937,8 +245588,8 @@ var require_qml = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function qml(hljs) { @@ -321990,7 +245641,7 @@ var require_qml = __commonJS((exports, module) => { relevance: 0 }; const QML_OBJECT = { - begin: concat3(QML_IDENT_RE, /\s*\{/), + begin: concat2(QML_IDENT_RE, /\s*\{/), end: /\{/, returnBegin: true, relevance: 0, @@ -322107,10 +245758,10 @@ var require_r = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function r(hljs) { @@ -322126,7 +245777,7 @@ var require_r = __commonJS((exports, module) => { built_in: "LETTERS letters month.abb month.name pi T F " + "abs acos acosh all any anyNA Arg as.call as.character " + "as.complex as.double as.environment as.integer as.logical " + "as.null.default as.numeric as.raw asin asinh atan atanh attr " + "attributes baseenv browser c call ceiling class Conj cos cosh " + "cospi cummax cummin cumprod cumsum digamma dim dimnames " + "emptyenv exp expression floor forceAndCall gamma gc.time " + "globalenv Im interactive invisible is.array is.atomic is.call " + "is.character is.complex is.double is.environment is.expression " + "is.finite is.function is.infinite is.integer is.language " + "is.list is.logical is.matrix is.na is.name is.nan is.null " + "is.numeric is.object is.pairlist is.raw is.recursive is.single " + "is.symbol lazyLoadDBfetch length lgamma list log max min " + "missing Mod names nargs nzchar oldClass on.exit pos.to.env " + "proc.time prod quote range Re rep retracemem return round " + "seq_along seq_len seq.int sign signif sin sinh sinpi sqrt " + "standardGeneric substitute sum switch tan tanh tanpi tracemem " + "trigamma trunc unclass untracemem UseMethod xtfrm" }, compilerExtensions: [ - (mode, parent3) => { + (mode, parent2) => { if (!mode.beforeMatch) return; if (mode.starts) @@ -322135,7 +245786,7 @@ var require_r = __commonJS((exports, module) => { Object.keys(mode).forEach((key) => { delete mode[key]; }); - mode.begin = concat3(originalMode.beforeMatch, lookahead(originalMode.begin)); + mode.begin = concat2(originalMode.beforeMatch, lookahead(originalMode.begin)); mode.starts = { relevance: 0, contains: [ @@ -322228,7 +245879,7 @@ var require_r = __commonJS((exports, module) => { end: "%" }, { - begin: concat3(SIMPLE_IDENT, "\\s+<-\\s+") + begin: concat2(SIMPLE_IDENT, "\\s+<-\\s+") }, { begin: "`", @@ -324247,12 +247898,12 @@ var require_sql = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function sql(hljs) { @@ -324828,7 +248479,7 @@ var require_sql = __commonJS((exports, module) => { relevance: 0 }; const FUNCTION_CALL = { - begin: concat3(/\b/, either(...FUNCTIONS), /\s*\(/), + begin: concat2(/\b/, either(...FUNCTIONS), /\s*\(/), keywords: { built_in: FUNCTIONS } @@ -324852,7 +248503,7 @@ var require_sql = __commonJS((exports, module) => { illegal: /[{}]|<\//, keywords: { $pattern: /\b[\w\.]+/, - keyword: reduceRelevancy(KEYWORDS, { when: (x4) => x4.length < 3 }), + keyword: reduceRelevancy(KEYWORDS, { when: (x3) => x3.length < 3 }), literal: LITERALS, type: TYPES, built_in: POSSIBLE_WITHOUT_PARENS @@ -326141,17 +249792,17 @@ var require_swift = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } - var keywordWrapper = (keyword) => concat3(/\b/, keyword, /\w$/.test(keyword) ? /\b/ : /\B/); + var keywordWrapper = (keyword) => concat2(/\b/, keyword, /\w$/.test(keyword) ? /\b/ : /\B/); var dotKeywords = [ "Protocol", "Type" @@ -326322,14 +249973,14 @@ var require_swift = __commonJS((exports, module) => { ]; var operatorHead = either(/[/=\-+!*%<>&|^~?]/, /[\u00A1-\u00A7]/, /[\u00A9\u00AB]/, /[\u00AC\u00AE]/, /[\u00B0\u00B1]/, /[\u00B6\u00BB\u00BF\u00D7\u00F7]/, /[\u2016-\u2017]/, /[\u2020-\u2027]/, /[\u2030-\u203E]/, /[\u2041-\u2053]/, /[\u2055-\u205E]/, /[\u2190-\u23FF]/, /[\u2500-\u2775]/, /[\u2794-\u2BFF]/, /[\u2E00-\u2E7F]/, /[\u3001-\u3003]/, /[\u3008-\u3020]/, /[\u3030]/); var operatorCharacter = either(operatorHead, /[\u0300-\u036F]/, /[\u1DC0-\u1DFF]/, /[\u20D0-\u20FF]/, /[\uFE00-\uFE0F]/, /[\uFE20-\uFE2F]/); - var operator = concat3(operatorHead, operatorCharacter, "*"); + var operator = concat2(operatorHead, operatorCharacter, "*"); var identifierHead = either(/[a-zA-Z_]/, /[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/, /[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/, /[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/, /[\u1E00-\u1FFF]/, /[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/, /[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/, /[\u2C00-\u2DFF\u2E80-\u2FFF]/, /[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/, /[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/, /[\uFE47-\uFEFE\uFF00-\uFFFD]/); var identifierCharacter = either(identifierHead, /\d/, /[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/); - var identifier = concat3(identifierHead, identifierCharacter, "*"); - var typeIdentifier = concat3(/[A-Z]/, identifierCharacter, "*"); + var identifier = concat2(identifierHead, identifierCharacter, "*"); + var typeIdentifier = concat2(/[A-Z]/, identifierCharacter, "*"); var keywordAttributes = [ "autoclosure", - concat3(/convention\(/, either("swift", "block", "c"), /\)/), + concat2(/convention\(/, either("swift", "block", "c"), /\)/), "discardableResult", "dynamicCallable", "dynamicMemberLookup", @@ -326347,7 +249998,7 @@ var require_swift = __commonJS((exports, module) => { "NSApplicationMain", "NSCopying", "NSManaged", - concat3(/objc\(/, identifier, /\)/), + concat2(/objc\(/, identifier, /\)/), "objc", "objcMembers", "propertyWrapper", @@ -326384,12 +250035,12 @@ var require_swift = __commonJS((exports, module) => { ]; const DOT_KEYWORD = { className: "keyword", - begin: concat3(/\./, lookahead(either(...dotKeywords, ...optionalDotKeywords))), + begin: concat2(/\./, lookahead(either(...dotKeywords, ...optionalDotKeywords))), end: either(...dotKeywords, ...optionalDotKeywords), excludeBegin: true }; const KEYWORD_GUARD = { - match: concat3(/\./, either(...keywords)), + match: concat2(/\./, either(...keywords)), relevance: 0 }; const PLAIN_KEYWORDS = keywords.filter((kw) => typeof kw === "string").concat(["_|0"]); @@ -326413,12 +250064,12 @@ var require_swift = __commonJS((exports, module) => { KEYWORD ]; const BUILT_IN_GUARD = { - match: concat3(/\./, either(...builtIns)), + match: concat2(/\./, either(...builtIns)), relevance: 0 }; const BUILT_IN = { className: "built_in", - match: concat3(/\b/, either(...builtIns), /(?=\()/) + match: concat2(/\b/, either(...builtIns), /(?=\()/) }; const BUILT_INS = [ BUILT_IN_GUARD, @@ -326468,26 +250119,26 @@ var require_swift = __commonJS((exports, module) => { className: "subst", variants: [ { - match: concat3(/\\/, rawDelimiter, /[0\\tnr"']/) + match: concat2(/\\/, rawDelimiter, /[0\\tnr"']/) }, { - match: concat3(/\\/, rawDelimiter, /u\{[0-9a-fA-F]{1,8}\}/) + match: concat2(/\\/, rawDelimiter, /u\{[0-9a-fA-F]{1,8}\}/) } ] }); const ESCAPED_NEWLINE = (rawDelimiter = "") => ({ className: "subst", - match: concat3(/\\/, rawDelimiter, /[\t ]*(?:[\r\n]|\r\n)/) + match: concat2(/\\/, rawDelimiter, /[\t ]*(?:[\r\n]|\r\n)/) }); const INTERPOLATION = (rawDelimiter = "") => ({ className: "subst", label: "interpol", - begin: concat3(/\\/, rawDelimiter, /\(/), + begin: concat2(/\\/, rawDelimiter, /\(/), end: /\)/ }); const MULTILINE_STRING = (rawDelimiter = "") => ({ - begin: concat3(rawDelimiter, /"""/), - end: concat3(/"""/, rawDelimiter), + begin: concat2(rawDelimiter, /"""/), + end: concat2(/"""/, rawDelimiter), contains: [ ESCAPED_CHARACTER(rawDelimiter), ESCAPED_NEWLINE(rawDelimiter), @@ -326495,8 +250146,8 @@ var require_swift = __commonJS((exports, module) => { ] }); const SINGLE_LINE_STRING = (rawDelimiter = "") => ({ - begin: concat3(rawDelimiter, /"/), - end: concat3(/"/, rawDelimiter), + begin: concat2(rawDelimiter, /"/), + end: concat2(/"/, rawDelimiter), contains: [ ESCAPED_CHARACTER(rawDelimiter), INTERPOLATION(rawDelimiter) @@ -326516,7 +250167,7 @@ var require_swift = __commonJS((exports, module) => { ] }; const QUOTED_IDENTIFIER = { - match: concat3(/`/, identifier, /`/) + match: concat2(/`/, identifier, /`/) }; const IMPLICIT_PARAMETER = { className: "variable", @@ -326551,11 +250202,11 @@ var require_swift = __commonJS((exports, module) => { }; const KEYWORD_ATTRIBUTE = { className: "keyword", - match: concat3(/@/, either(...keywordAttributes)) + match: concat2(/@/, either(...keywordAttributes)) }; const USER_DEFINED_ATTRIBUTE = { className: "meta", - match: concat3(/@/, identifier) + match: concat2(/@/, identifier) }; const ATTRIBUTES = [ AVAILABLE_ATTRIBUTE, @@ -326568,7 +250219,7 @@ var require_swift = __commonJS((exports, module) => { contains: [ { className: "type", - match: concat3(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, "+") + match: concat2(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, "+") }, { className: "type", @@ -326584,7 +250235,7 @@ var require_swift = __commonJS((exports, module) => { relevance: 0 }, { - match: concat3(/\s+&\s+/, lookahead(typeIdentifier)), + match: concat2(/\s+&\s+/, lookahead(typeIdentifier)), relevance: 0 } ] @@ -326603,7 +250254,7 @@ var require_swift = __commonJS((exports, module) => { }; TYPE.contains.push(GENERIC_ARGUMENTS); const TUPLE_ELEMENT_NAME = { - match: concat3(identifier, /\s*:/), + match: concat2(identifier, /\s*:/), keywords: "_|0", relevance: 0 }; @@ -326647,7 +250298,7 @@ var require_swift = __commonJS((exports, module) => { ] }; const FUNCTION_PARAMETER_NAME = { - begin: either(lookahead(concat3(identifier, /\s*:/)), lookahead(concat3(identifier, /\s+/, identifier, /\s*:/))), + begin: either(lookahead(concat2(identifier, /\s*:/)), lookahead(concat2(identifier, /\s+/, identifier, /\s*:/))), end: /:/, relevance: 0, contains: [ @@ -327002,7 +250653,7 @@ var require_yaml = __commonJS((exports, module) => { // node_modules/cli-highlight/node_modules/highlight.js/lib/languages/tap.js var require_tap = __commonJS((exports, module) => { - function tap3(hljs) { + function tap2(hljs) { return { name: "Test Anything Protocol", case_insensitive: true, @@ -327043,7 +250694,7 @@ var require_tap = __commonJS((exports, module) => { ] }; } - module.exports = tap3; + module.exports = tap2; }); // node_modules/cli-highlight/node_modules/highlight.js/lib/languages/tcl.js @@ -327056,10 +250707,10 @@ var require_tcl = __commonJS((exports, module) => { return re.source; } function optional3(re) { - return concat3("(", re, ")?"); + return concat2("(", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function tcl(hljs) { @@ -327093,7 +250744,7 @@ var require_tcl = __commonJS((exports, module) => { className: "variable", variants: [ { - begin: concat3(/\$/, optional3(/::/), TCL_IDENT, "(::", TCL_IDENT, ")*") + begin: concat2(/\$/, optional3(/::/), TCL_IDENT, "(::", TCL_IDENT, ")*") }, { begin: "\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*", @@ -327438,16 +251089,16 @@ var require_typescript = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function javascript(hljs) { - const hasClosingTag = (match, { after: after3 }) => { + const hasClosingTag = (match, { after: after2 }) => { const tag2 = " { COMMENT, NUMBER, { - begin: concat3(/[{,\n]\s*/, lookahead(concat3(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/, IDENT_RE$1 + "\\s*:"))), + begin: concat2(/[{,\n]\s*/, lookahead(concat2(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/, IDENT_RE$1 + "\\s*:"))), relevance: 0, contains: [ { @@ -327909,12 +251560,12 @@ var require_vbnet = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function vbnet(hljs) { @@ -327941,16 +251592,16 @@ var require_vbnet = __commonJS((exports, module) => { className: "literal", variants: [ { - begin: concat3(/# */, either(YYYY_MM_DD, MM_DD_YYYY), / *#/) + begin: concat2(/# */, either(YYYY_MM_DD, MM_DD_YYYY), / *#/) }, { - begin: concat3(/# */, TIME_24H, / *#/) + begin: concat2(/# */, TIME_24H, / *#/) }, { - begin: concat3(/# */, TIME_12H, / *#/) + begin: concat2(/# */, TIME_12H, / *#/) }, { - begin: concat3(/# */, either(YYYY_MM_DD, MM_DD_YYYY), / +/, either(TIME_12H, TIME_24H), / *#/) + begin: concat2(/# */, either(YYYY_MM_DD, MM_DD_YYYY), / +/, either(TIME_12H, TIME_24H), / *#/) } ] }; @@ -328045,12 +251696,12 @@ var require_vbscript = __commonJS((exports, module) => { return re; return re.source; } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function either(...args) { - const joined = "(" + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function vbscript(hljs) { @@ -328065,7 +251716,7 @@ var require_vbscript = __commonJS((exports, module) => { "scriptenginemajorversion" ]; const BUILT_IN_CALL = { - begin: concat3(either(...BUILT_IN_FUNCTIONS), "\\s*\\("), + begin: concat2(either(...BUILT_IN_FUNCTIONS), "\\s*\\("), relevance: 0, keywords: { built_in: BUILT_IN_FUNCTIONS @@ -328683,7 +252334,7 @@ var require_zephir = __commonJS((exports, module) => { }); // node_modules/cli-highlight/node_modules/highlight.js/lib/index.js -var require_lib5 = __commonJS((exports, module) => { +var require_lib3 = __commonJS((exports, module) => { var hljs = require_core3(); hljs.registerLanguage("1c", require_1c()); hljs.registerLanguage("abnf", require_abnf()); @@ -329091,18 +252742,18 @@ var require_preprocessor = __commonJS((exports, module) => { this.gapStack = []; } } - write(chunk3, isLastChunk) { + write(chunk2, isLastChunk) { if (this.html) { - this.html += chunk3; + this.html += chunk2; } else { - this.html = chunk3; + this.html = chunk2; } this.lastCharPos = this.html.length - 1; this.endOfChunkHit = false; this.lastChunkWritten = isLastChunk; } - insertHtmlAtCurrentPos(chunk3) { - this.html = this.html.substring(0, this.pos + 1) + chunk3 + this.html.substring(this.pos + 1, this.html.length); + insertHtmlAtCurrentPos(chunk2) { + this.html = this.html.substring(0, this.pos + 1) + chunk2 + this.html.substring(this.pos + 1, this.html.length); this.lastCharPos = this.html.length - 1; this.endOfChunkHit = false; } @@ -329351,9 +253002,9 @@ var require_tokenizer = __commonJS((exports, module) => { this.currentAttr = null; } _err() {} - _errOnNextCodePoint(err3) { + _errOnNextCodePoint(err2) { this._consume(); - this._err(err3); + this._err(err2); this._unconsume(); } getNextToken() { @@ -329366,13 +253017,13 @@ var require_tokenizer = __commonJS((exports, module) => { } return this.tokenQueue.shift(); } - write(chunk3, isLastChunk) { + write(chunk2, isLastChunk) { this.active = true; - this.preprocessor.write(chunk3, isLastChunk); + this.preprocessor.write(chunk2, isLastChunk); } - insertHtmlAtCurrentPos(chunk3) { + insertHtmlAtCurrentPos(chunk2) { this.active = true; - this.preprocessor.insertHtmlAtCurrentPos(chunk3); + this.preprocessor.insertHtmlAtCurrentPos(chunk2); } _ensureHibernation() { if (this.preprocessor.endOfChunkHit) { @@ -329399,7 +253050,7 @@ var require_tokenizer = __commonJS((exports, module) => { } _consumeSequenceIfMatch(pattern, startCp, caseSensitive) { let consumedCount = 0; - let isMatch3 = true; + let isMatch2 = true; const patternLength = pattern.length; let patternPos = 0; let cp = startCp; @@ -329410,28 +253061,28 @@ var require_tokenizer = __commonJS((exports, module) => { consumedCount++; } if (cp === $2.EOF) { - isMatch3 = false; + isMatch2 = false; break; } patternCp = pattern[patternPos]; if (cp !== patternCp && (caseSensitive || cp !== toAsciiLowerCodePoint(patternCp))) { - isMatch3 = false; + isMatch2 = false; break; } } - if (!isMatch3) { + if (!isMatch2) { while (consumedCount--) { this._unconsume(); } } - return isMatch3; + return isMatch2; } _isTempBufferEqualToScriptString() { if (this.tempBuff.length !== $$.SCRIPT_STRING.length) { return false; } - for (let i4 = 0;i4 < this.tempBuff.length; i4++) { - if (this.tempBuff[i4] !== $$.SCRIPT_STRING[i4]) { + for (let i3 = 0;i3 < this.tempBuff.length; i3++) { + if (this.tempBuff[i3] !== $$.SCRIPT_STRING[i3]) { return false; } } @@ -329541,24 +253192,24 @@ var require_tokenizer = __commonJS((exports, module) => { this._appendCharToCurrentCharacterToken(type, toChar(cp)); } _emitSeveralCodePoints(codePoints) { - for (let i4 = 0;i4 < codePoints.length; i4++) { - this._emitCodePoint(codePoints[i4]); + for (let i3 = 0;i3 < codePoints.length; i3++) { + this._emitCodePoint(codePoints[i3]); } } _emitChars(ch2) { this._appendCharToCurrentCharacterToken(Tokenizer.CHARACTER_TOKEN, ch2); } _matchNamedCharacterReference(startCp) { - let result3 = null; + let result2 = null; let excess = 1; - let i4 = findNamedEntityTreeBranch(0, startCp); + let i3 = findNamedEntityTreeBranch(0, startCp); this.tempBuff.push(startCp); - while (i4 > -1) { - const current = neTree[i4]; + while (i3 > -1) { + const current = neTree[i3]; const inNode = current < MAX_BRANCH_MARKER_VALUE; const nodeWithData = inNode && current & HAS_DATA_FLAG; if (nodeWithData) { - result3 = current & DATA_DUPLET_FLAG ? [neTree[++i4], neTree[++i4]] : [neTree[++i4]]; + result2 = current & DATA_DUPLET_FLAG ? [neTree[++i3], neTree[++i3]] : [neTree[++i3]]; excess = 0; } const cp = this._consume(); @@ -329568,16 +253219,16 @@ var require_tokenizer = __commonJS((exports, module) => { break; } if (inNode) { - i4 = current & HAS_BRANCHES_FLAG ? findNamedEntityTreeBranch(i4, cp) : -1; + i3 = current & HAS_BRANCHES_FLAG ? findNamedEntityTreeBranch(i3, cp) : -1; } else { - i4 = cp === current ? ++i4 : -1; + i3 = cp === current ? ++i3 : -1; } } while (excess--) { this.tempBuff.pop(); this._unconsume(); } - return result3; + return result2; } _isCharacterReferenceInAttribute() { return this.returnState === ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE || this.returnState === ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE || this.returnState === ATTRIBUTE_VALUE_UNQUOTED_STATE; @@ -329592,8 +253243,8 @@ var require_tokenizer = __commonJS((exports, module) => { } _flushCodePointsConsumedAsCharacterReference() { if (this._isCharacterReferenceInAttribute()) { - for (let i4 = 0;i4 < this.tempBuff.length; i4++) { - this.currentAttr.value += toChar(this.tempBuff[i4]); + for (let i3 = 0;i3 < this.tempBuff.length; i3++) { + this.currentAttr.value += toChar(this.tempBuff[i3]); } } else { this._emitSeveralCodePoints(this.tempBuff); @@ -330901,9 +254552,9 @@ var require_tokenizer = __commonJS((exports, module) => { PLAINTEXT: PLAINTEXT_STATE }; Tokenizer.getTokenAttr = function(token, attrName) { - for (let i4 = token.attrs.length - 1;i4 >= 0; i4--) { - if (token.attrs[i4].name === attrName) { - return token.attrs[i4].value; + for (let i3 = token.attrs.length - 1;i3 >= 0; i3--) { + if (token.attrs[i3].name === attrName) { + return token.attrs[i3].value; } } return null; @@ -331250,9 +254901,9 @@ var require_open_element_stack = __commonJS((exports, module) => { } _indexOf(element) { let idx = -1; - for (let i4 = this.stackTop;i4 >= 0; i4--) { - if (this.items[i4] === element) { - idx = i4; + for (let i3 = this.stackTop;i3 >= 0; i3--) { + if (this.items[i3] === element) { + idx = i3; break; } } @@ -331353,9 +255004,9 @@ var require_open_element_stack = __commonJS((exports, module) => { } } remove(element) { - for (let i4 = this.stackTop;i4 >= 0; i4--) { - if (this.items[i4] === element) { - this.items.splice(i4, 1); + for (let i3 = this.stackTop;i3 >= 0; i3--) { + if (this.items[i3] === element) { + this.items.splice(i3, 1); this.stackTop--; this._updateCurrentElement(); break; @@ -331377,9 +255028,9 @@ var require_open_element_stack = __commonJS((exports, module) => { return this.stackTop === 0 && this.currentTagName === $2.HTML; } hasInScope(tagName) { - for (let i4 = this.stackTop;i4 >= 0; i4--) { - const tn = this.treeAdapter.getTagName(this.items[i4]); - const ns = this.treeAdapter.getNamespaceURI(this.items[i4]); + for (let i3 = this.stackTop;i3 >= 0; i3--) { + const tn = this.treeAdapter.getTagName(this.items[i3]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i3]); if (tn === tagName && ns === NS.HTML) { return true; } @@ -331390,9 +255041,9 @@ var require_open_element_stack = __commonJS((exports, module) => { return true; } hasNumberedHeaderInScope() { - for (let i4 = this.stackTop;i4 >= 0; i4--) { - const tn = this.treeAdapter.getTagName(this.items[i4]); - const ns = this.treeAdapter.getNamespaceURI(this.items[i4]); + for (let i3 = this.stackTop;i3 >= 0; i3--) { + const tn = this.treeAdapter.getTagName(this.items[i3]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i3]); if ((tn === $2.H1 || tn === $2.H2 || tn === $2.H3 || tn === $2.H4 || tn === $2.H5 || tn === $2.H6) && ns === NS.HTML) { return true; } @@ -331403,9 +255054,9 @@ var require_open_element_stack = __commonJS((exports, module) => { return true; } hasInListItemScope(tagName) { - for (let i4 = this.stackTop;i4 >= 0; i4--) { - const tn = this.treeAdapter.getTagName(this.items[i4]); - const ns = this.treeAdapter.getNamespaceURI(this.items[i4]); + for (let i3 = this.stackTop;i3 >= 0; i3--) { + const tn = this.treeAdapter.getTagName(this.items[i3]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i3]); if (tn === tagName && ns === NS.HTML) { return true; } @@ -331416,9 +255067,9 @@ var require_open_element_stack = __commonJS((exports, module) => { return true; } hasInButtonScope(tagName) { - for (let i4 = this.stackTop;i4 >= 0; i4--) { - const tn = this.treeAdapter.getTagName(this.items[i4]); - const ns = this.treeAdapter.getNamespaceURI(this.items[i4]); + for (let i3 = this.stackTop;i3 >= 0; i3--) { + const tn = this.treeAdapter.getTagName(this.items[i3]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i3]); if (tn === tagName && ns === NS.HTML) { return true; } @@ -331429,9 +255080,9 @@ var require_open_element_stack = __commonJS((exports, module) => { return true; } hasInTableScope(tagName) { - for (let i4 = this.stackTop;i4 >= 0; i4--) { - const tn = this.treeAdapter.getTagName(this.items[i4]); - const ns = this.treeAdapter.getNamespaceURI(this.items[i4]); + for (let i3 = this.stackTop;i3 >= 0; i3--) { + const tn = this.treeAdapter.getTagName(this.items[i3]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i3]); if (ns !== NS.HTML) { continue; } @@ -331445,9 +255096,9 @@ var require_open_element_stack = __commonJS((exports, module) => { return true; } hasTableBodyContextInTableScope() { - for (let i4 = this.stackTop;i4 >= 0; i4--) { - const tn = this.treeAdapter.getTagName(this.items[i4]); - const ns = this.treeAdapter.getNamespaceURI(this.items[i4]); + for (let i3 = this.stackTop;i3 >= 0; i3--) { + const tn = this.treeAdapter.getTagName(this.items[i3]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i3]); if (ns !== NS.HTML) { continue; } @@ -331461,9 +255112,9 @@ var require_open_element_stack = __commonJS((exports, module) => { return true; } hasInSelectScope(tagName) { - for (let i4 = this.stackTop;i4 >= 0; i4--) { - const tn = this.treeAdapter.getTagName(this.items[i4]); - const ns = this.treeAdapter.getNamespaceURI(this.items[i4]); + for (let i3 = this.stackTop;i3 >= 0; i3--) { + const tn = this.treeAdapter.getTagName(this.items[i3]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i3]); if (ns !== NS.HTML) { continue; } @@ -331512,8 +255163,8 @@ var require_formatting_element_list = __commonJS((exports, module) => { const neAttrsLength = this.treeAdapter.getAttrList(newElement).length; const neTagName = this.treeAdapter.getTagName(newElement); const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement); - for (let i4 = this.length - 1;i4 >= 0; i4--) { - const entry = this.entries[i4]; + for (let i3 = this.length - 1;i3 >= 0; i3--) { + const entry = this.entries[i3]; if (entry.type === FormattingElementList.MARKER_ENTRY) { break; } @@ -331521,7 +255172,7 @@ var require_formatting_element_list = __commonJS((exports, module) => { const elementAttrs = this.treeAdapter.getAttrList(element); const isCandidate = this.treeAdapter.getTagName(element) === neTagName && this.treeAdapter.getNamespaceURI(element) === neNamespaceURI && elementAttrs.length === neAttrsLength; if (isCandidate) { - candidates.push({ idx: i4, attrs: elementAttrs }); + candidates.push({ idx: i3, attrs: elementAttrs }); } } } @@ -331534,13 +255185,13 @@ var require_formatting_element_list = __commonJS((exports, module) => { const neAttrs = this.treeAdapter.getAttrList(newElement); const neAttrsLength = neAttrs.length; const neAttrsMap = Object.create(null); - for (let i4 = 0;i4 < neAttrsLength; i4++) { - const neAttr = neAttrs[i4]; + for (let i3 = 0;i3 < neAttrsLength; i3++) { + const neAttr = neAttrs[i3]; neAttrsMap[neAttr.name] = neAttr.value; } - for (let i4 = 0;i4 < neAttrsLength; i4++) { + for (let i3 = 0;i3 < neAttrsLength; i3++) { for (let j = 0;j < cLength; j++) { - const cAttr = candidates[j].attrs[i4]; + const cAttr = candidates[j].attrs[i3]; if (neAttrsMap[cAttr.name] !== cAttr.value) { candidates.splice(j, 1); cLength--; @@ -331550,8 +255201,8 @@ var require_formatting_element_list = __commonJS((exports, module) => { } } } - for (let i4 = cLength - 1;i4 >= NOAH_ARK_CAPACITY - 1; i4--) { - this.entries.splice(candidates[i4].idx, 1); + for (let i3 = cLength - 1;i3 >= NOAH_ARK_CAPACITY - 1; i3--) { + this.entries.splice(candidates[i3].idx, 1); this.length--; } } @@ -331584,9 +255235,9 @@ var require_formatting_element_list = __commonJS((exports, module) => { this.length++; } removeEntry(entry) { - for (let i4 = this.length - 1;i4 >= 0; i4--) { - if (this.entries[i4] === entry) { - this.entries.splice(i4, 1); + for (let i3 = this.length - 1;i3 >= 0; i3--) { + if (this.entries[i3] === entry) { + this.entries.splice(i3, 1); this.length--; break; } @@ -331602,8 +255253,8 @@ var require_formatting_element_list = __commonJS((exports, module) => { } } getElementEntryInScopeWithTagName(tagName) { - for (let i4 = this.length - 1;i4 >= 0; i4--) { - const entry = this.entries[i4]; + for (let i3 = this.length - 1;i3 >= 0; i3--) { + const entry = this.entries[i3]; if (entry.type === FormattingElementList.MARKER_ENTRY) { return null; } @@ -331614,8 +255265,8 @@ var require_formatting_element_list = __commonJS((exports, module) => { return null; } getElementEntry(element) { - for (let i4 = this.length - 1;i4 >= 0; i4--) { - const entry = this.entries[i4]; + for (let i3 = this.length - 1;i3 >= 0; i3--) { + const entry = this.entries[i3]; if (entry.type === FormattingElementList.ELEMENT_ENTRY && entry.element === element) { return entry; } @@ -331649,14 +255300,14 @@ var require_mixin = __commonJS((exports, module) => { if (!host.__mixins) { host.__mixins = []; } - for (let i4 = 0;i4 < host.__mixins.length; i4++) { - if (host.__mixins[i4].constructor === Ctor) { - return host.__mixins[i4]; + for (let i3 = 0;i3 < host.__mixins.length; i3++) { + if (host.__mixins[i3].constructor === Ctor) { + return host.__mixins[i3]; } } - const mixin5 = new Ctor(host, opts); - host.__mixins.push(mixin5); - return mixin5; + const mixin3 = new Ctor(host, opts); + host.__mixins.push(mixin3); + return mixin3; }; module.exports = Mixin; }); @@ -331844,8 +255495,8 @@ var require_open_element_stack_mixin = __commonJS((exports, module) => { orig.pop.call(this); }, popAllUpToHtmlElement() { - for (let i4 = this.stackTop;i4 > 0; i4--) { - mxn.onItemPop(this.items[i4]); + for (let i3 = this.stackTop;i3 > 0; i3--) { + mxn.onItemPop(this.items[i3]); } orig.popAllUpToHtmlElement.call(this); }, @@ -331923,8 +255574,8 @@ var require_parser_mixin = __commonJS((exports, module) => { }, _runParsingLoop(scriptHandler) { orig._runParsingLoop.call(this, scriptHandler); - for (let i4 = this.openElements.stackTop;i4 >= 0; i4--) { - mxn._setEndLocation(this.openElements.items[i4], mxn.currentToken); + for (let i3 = this.openElements.stackTop;i3 >= 0; i3--) { + mxn._setEndLocation(this.openElements.items[i3], mxn.currentToken); } }, _processTokenInForeignContent(token) { @@ -331936,8 +255587,8 @@ var require_parser_mixin = __commonJS((exports, module) => { orig._processToken.call(this, token); const requireExplicitUpdate = token.type === Tokenizer.END_TAG_TOKEN && (token.tagName === $2.HTML || token.tagName === $2.BODY && this.openElements.hasInScope($2.BODY)); if (requireExplicitUpdate) { - for (let i4 = this.openElements.stackTop;i4 >= 0; i4--) { - const element = this.openElements.items[i4]; + for (let i3 = this.openElements.stackTop;i3 >= 0; i3--) { + const element = this.openElements.items[i3]; if (this.treeAdapter.getTagName(element) === token.tagName) { mxn._setEndLocation(element, token); break; @@ -331949,8 +255600,8 @@ var require_parser_mixin = __commonJS((exports, module) => { orig._setDocumentType.call(this, token); const documentChildren = this.treeAdapter.getChildNodes(this.document); const cnLength = documentChildren.length; - for (let i4 = 0;i4 < cnLength; i4++) { - const node = documentChildren[i4]; + for (let i3 = 0;i3 < cnLength; i3++) { + const node = documentChildren[i3]; if (this.treeAdapter.isDocumentTypeNode(node)) { this.treeAdapter.setNodeSourceCodeLocation(node, token.location); break; @@ -331980,9 +255631,9 @@ var require_parser_mixin = __commonJS((exports, module) => { orig._insertFakeRootElement.call(this); this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current, null); }, - _appendCommentNode(token, parent3) { - orig._appendCommentNode.call(this, token, parent3); - const children2 = this.treeAdapter.getChildNodes(parent3); + _appendCommentNode(token, parent2) { + orig._appendCommentNode.call(this, token, parent2); + const children2 = this.treeAdapter.getChildNodes(parent2); const commentNode = children2[children2.length - 1]; this.treeAdapter.setNodeSourceCodeLocation(commentNode, token.location); }, @@ -331993,8 +255644,8 @@ var require_parser_mixin = __commonJS((exports, module) => { _insertCharacters(token) { orig._insertCharacters.call(this, token); const hasFosterParent = this._shouldFosterParentOnInsertion(); - const parent3 = hasFosterParent && mxn.lastFosterParentingLocation.parent || this.openElements.currentTmplContent || this.openElements.current; - const siblings = this.treeAdapter.getChildNodes(parent3); + const parent2 = hasFosterParent && mxn.lastFosterParentingLocation.parent || this.openElements.currentTmplContent || this.openElements.current; + const siblings = this.treeAdapter.getChildNodes(parent2); const textNodeIdx = hasFosterParent && mxn.lastFosterParentingLocation.beforeElement ? siblings.indexOf(mxn.lastFosterParentingLocation.beforeElement) - 1 : siblings.length - 1; const textNode = siblings[textNodeIdx]; const tnLoc = this.treeAdapter.getNodeSourceCodeLocation(textNode); @@ -332022,13 +255673,13 @@ var require_mixin_base = __commonJS((exports, module) => { this.posTracker = null; this.onParseError = opts.onParseError; } - _setErrorLocation(err3) { - err3.startLine = err3.endLine = this.posTracker.line; - err3.startCol = err3.endCol = this.posTracker.col; - err3.startOffset = err3.endOffset = this.posTracker.offset; + _setErrorLocation(err2) { + err2.startLine = err2.endLine = this.posTracker.line; + err2.startCol = err2.endCol = this.posTracker.col; + err2.startOffset = err2.endOffset = this.posTracker.offset; } _reportError(code) { - const err3 = { + const err2 = { code, startLine: -1, startCol: -1, @@ -332037,8 +255688,8 @@ var require_mixin_base = __commonJS((exports, module) => { endCol: -1, endOffset: -1 }; - this._setErrorLocation(err3); - this.onParseError(err3); + this._setErrorLocation(err2); + this.onParseError(err2); } _getOverriddenMethods(mxn) { return { @@ -332103,14 +255754,14 @@ var require_parser_mixin2 = __commonJS((exports, module) => { this.ctLoc = null; this.locBeforeToken = false; } - _setErrorLocation(err3) { + _setErrorLocation(err2) { if (this.ctLoc) { - err3.startLine = this.ctLoc.startLine; - err3.startCol = this.ctLoc.startCol; - err3.startOffset = this.ctLoc.startOffset; - err3.endLine = this.locBeforeToken ? this.ctLoc.startLine : this.ctLoc.endLine; - err3.endCol = this.locBeforeToken ? this.ctLoc.startCol : this.ctLoc.endCol; - err3.endOffset = this.locBeforeToken ? this.ctLoc.startOffset : this.ctLoc.endOffset; + err2.startLine = this.ctLoc.startLine; + err2.startCol = this.ctLoc.startCol; + err2.startOffset = this.ctLoc.startOffset; + err2.endLine = this.locBeforeToken ? this.ctLoc.startLine : this.ctLoc.endLine; + err2.endCol = this.locBeforeToken ? this.ctLoc.startCol : this.ctLoc.endCol; + err2.endOffset = this.locBeforeToken ? this.ctLoc.startOffset : this.ctLoc.endOffset; } } _getOverriddenMethods(mxn, orig) { @@ -332191,9 +255842,9 @@ var require_default = __commonJS((exports) => { }; exports.setDocumentType = function(document2, name, publicId, systemId) { let doctypeNode = null; - for (let i4 = 0;i4 < document2.childNodes.length; i4++) { - if (document2.childNodes[i4].nodeName === "#documentType") { - doctypeNode = document2.childNodes[i4]; + for (let i3 = 0;i3 < document2.childNodes.length; i3++) { + if (document2.childNodes[i3].nodeName === "#documentType") { + doctypeNode = document2.childNodes[i3]; break; } } @@ -332223,28 +255874,28 @@ var require_default = __commonJS((exports) => { node.parentNode = null; } }; - exports.insertText = function(parentNode, text2) { + exports.insertText = function(parentNode, text) { if (parentNode.childNodes.length) { const prevNode = parentNode.childNodes[parentNode.childNodes.length - 1]; if (prevNode.nodeName === "#text") { - prevNode.value += text2; + prevNode.value += text; return; } } - appendChild(parentNode, createTextNode2(text2)); + appendChild(parentNode, createTextNode2(text)); }; - exports.insertTextBefore = function(parentNode, text2, referenceNode) { + exports.insertTextBefore = function(parentNode, text, referenceNode) { const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1]; if (prevNode && prevNode.nodeName === "#text") { - prevNode.value += text2; + prevNode.value += text; } else { - insertBefore(parentNode, createTextNode2(text2), referenceNode); + insertBefore(parentNode, createTextNode2(text), referenceNode); } }; exports.adoptAttributes = function(recipient, attrs) { const recipientAttrsMap = []; - for (let i4 = 0;i4 < recipient.attrs.length; i4++) { - recipientAttrsMap.push(recipient.attrs[i4].name); + for (let i3 = 0;i3 < recipient.attrs.length; i3++) { + recipientAttrsMap.push(recipient.attrs[i3].name); } for (let j = 0;j < attrs.length; j++) { if (recipientAttrsMap.indexOf(attrs[j].name) === -1) { @@ -332307,9 +255958,9 @@ var require_default = __commonJS((exports) => { // node_modules/parse5/lib/utils/merge-options.js var require_merge_options = __commonJS((exports, module) => { - module.exports = function mergeOptions(defaults4, options2) { + module.exports = function mergeOptions(defaults3, options2) { options2 = options2 || Object.create(null); - return [defaults4, options2].reduce((merged, optObj) => { + return [defaults3, options2].reduce((merged, optObj) => { Object.keys(optObj).forEach((key) => { merged[key] = optObj[key]; }); @@ -332396,8 +256047,8 @@ var require_doctype = __commonJS((exports) => { return quote + id + quote; } function hasPrefix2(publicId, prefixes) { - for (let i4 = 0;i4 < prefixes.length; i4++) { - if (publicId.indexOf(prefixes[i4]) === 0) { + for (let i3 = 0;i3 < prefixes.length; i3++) { + if (publicId.indexOf(prefixes[i3]) === 0) { return true; } } @@ -332625,28 +256276,28 @@ var require_foreign_content = __commonJS((exports) => { return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn]; }; exports.adjustTokenMathMLAttrs = function(token) { - for (let i4 = 0;i4 < token.attrs.length; i4++) { - if (token.attrs[i4].name === DEFINITION_URL_ATTR) { - token.attrs[i4].name = ADJUSTED_DEFINITION_URL_ATTR; + for (let i3 = 0;i3 < token.attrs.length; i3++) { + if (token.attrs[i3].name === DEFINITION_URL_ATTR) { + token.attrs[i3].name = ADJUSTED_DEFINITION_URL_ATTR; break; } } }; exports.adjustTokenSVGAttrs = function(token) { - for (let i4 = 0;i4 < token.attrs.length; i4++) { - const adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i4].name]; + for (let i3 = 0;i3 < token.attrs.length; i3++) { + const adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i3].name]; if (adjustedAttrName) { - token.attrs[i4].name = adjustedAttrName; + token.attrs[i3].name = adjustedAttrName; } } }; exports.adjustTokenXMLAttrs = function(token) { - for (let i4 = 0;i4 < token.attrs.length; i4++) { - const adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i4].name]; + for (let i3 = 0;i3 < token.attrs.length; i3++) { + const adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i3].name]; if (adjustedAttrEntry) { - token.attrs[i4].prefix = adjustedAttrEntry.prefix; - token.attrs[i4].name = adjustedAttrEntry.name; - token.attrs[i4].namespace = adjustedAttrEntry.namespace; + token.attrs[i3].prefix = adjustedAttrEntry.prefix; + token.attrs[i3].name = adjustedAttrEntry.name; + token.attrs[i3].namespace = adjustedAttrEntry.namespace; } } }; @@ -332661,9 +256312,9 @@ var require_foreign_content = __commonJS((exports) => { } function isHtmlIntegrationPoint(tn, ns, attrs) { if (ns === NS.MATHML && tn === $2.ANNOTATION_XML) { - for (let i4 = 0;i4 < attrs.length; i4++) { - if (attrs[i4].name === ATTRS.ENCODING) { - const value = attrs[i4].value.toLowerCase(); + for (let i3 = 0;i3 < attrs.length; i3++) { + if (attrs[i3].name === ATTRS.ENCODING) { + const value = attrs[i3].value.toLowerCase(); return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; } } @@ -333133,8 +256784,8 @@ var require_parser2 = __commonJS((exports, module) => { if (this._shouldFosterParentOnInsertion()) { this._fosterParentElement(element); } else { - const parent3 = this.openElements.currentTmplContent || this.openElements.current; - this.treeAdapter.appendChild(parent3, element); + const parent2 = this.openElements.currentTmplContent || this.openElements.current; + this.treeAdapter.appendChild(parent2, element); } } _appendElement(token, namespaceURI) { @@ -333163,16 +256814,16 @@ var require_parser2 = __commonJS((exports, module) => { this.treeAdapter.appendChild(this.openElements.current, element); this.openElements.push(element); } - _appendCommentNode(token, parent3) { + _appendCommentNode(token, parent2) { const commentNode = this.treeAdapter.createCommentNode(token.data); - this.treeAdapter.appendChild(parent3, commentNode); + this.treeAdapter.appendChild(parent2, commentNode); } _insertCharacters(token) { if (this._shouldFosterParentOnInsertion()) { this._fosterParentText(token.chars); } else { - const parent3 = this.openElements.currentTmplContent || this.openElements.current; - this.treeAdapter.insertText(parent3, token.chars); + const parent2 = this.openElements.currentTmplContent || this.openElements.current; + this.treeAdapter.insertText(parent2, token.chars); } } _adoptNodes(donor, recipient) { @@ -333253,8 +256904,8 @@ var require_parser2 = __commonJS((exports, module) => { break; } } while (unopenIdx > 0); - for (let i4 = unopenIdx;i4 < listLength; i4++) { - entry = this.activeFormattingElements.entries[i4]; + for (let i3 = unopenIdx;i3 < listLength; i3++) { + entry = this.activeFormattingElements.entries[i3]; this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element)); entry.element = this.openElements.current; } @@ -333271,10 +256922,10 @@ var require_parser2 = __commonJS((exports, module) => { this.openElements.popUntilTagNamePopped($2.P); } _resetInsertionMode() { - for (let i4 = this.openElements.stackTop, last3 = false;i4 >= 0; i4--) { - let element = this.openElements.items[i4]; - if (i4 === 0) { - last3 = true; + for (let i3 = this.openElements.stackTop, last2 = false;i3 >= 0; i3--) { + let element = this.openElements.items[i3]; + if (i3 === 0) { + last2 = true; if (this.fragmentContext) { element = this.fragmentContext; } @@ -333284,14 +256935,14 @@ var require_parser2 = __commonJS((exports, module) => { if (newInsertionMode) { this.insertionMode = newInsertionMode; break; - } else if (!last3 && (tn === $2.TD || tn === $2.TH)) { + } else if (!last2 && (tn === $2.TD || tn === $2.TH)) { this.insertionMode = IN_CELL_MODE; break; - } else if (!last3 && tn === $2.HEAD) { + } else if (!last2 && tn === $2.HEAD) { this.insertionMode = IN_HEAD_MODE; break; } else if (tn === $2.SELECT) { - this._resetInsertionModeForSelect(i4); + this._resetInsertionModeForSelect(i3); break; } else if (tn === $2.TEMPLATE) { this.insertionMode = this.currentTmplInsertionMode; @@ -333299,7 +256950,7 @@ var require_parser2 = __commonJS((exports, module) => { } else if (tn === $2.HTML) { this.insertionMode = this.headElement ? AFTER_HEAD_MODE : BEFORE_HEAD_MODE; break; - } else if (last3) { + } else if (last2) { this.insertionMode = IN_BODY_MODE; break; } @@ -333307,8 +256958,8 @@ var require_parser2 = __commonJS((exports, module) => { } _resetInsertionModeForSelect(selectIdx) { if (selectIdx > 0) { - for (let i4 = selectIdx - 1;i4 > 0; i4--) { - const ancestor = this.openElements.items[i4]; + for (let i3 = selectIdx - 1;i3 > 0; i3--) { + const ancestor = this.openElements.items[i3]; const tn = this.treeAdapter.getTagName(ancestor); if (tn === $2.TEMPLATE) { break; @@ -333342,8 +256993,8 @@ var require_parser2 = __commonJS((exports, module) => { parent: null, beforeElement: null }; - for (let i4 = this.openElements.stackTop;i4 >= 0; i4--) { - const openElement = this.openElements.items[i4]; + for (let i3 = this.openElements.stackTop;i3 >= 0; i3--) { + const openElement = this.openElements.items[i3]; const tn = this.treeAdapter.getTagName(openElement); const ns = this.treeAdapter.getNamespaceURI(openElement); if (tn === $2.TEMPLATE && ns === NS.HTML) { @@ -333354,7 +257005,7 @@ var require_parser2 = __commonJS((exports, module) => { if (location.parent) { location.beforeElement = openElement; } else { - location.parent = this.openElements.items[i4 - 1]; + location.parent = this.openElements.items[i3 - 1]; } break; } @@ -333403,8 +257054,8 @@ var require_parser2 = __commonJS((exports, module) => { } function aaObtainFurthestBlock(p, formattingElementEntry) { let furthestBlock = null; - for (let i4 = p.openElements.stackTop;i4 >= 0; i4--) { - const element = p.openElements.items[i4]; + for (let i3 = p.openElements.stackTop;i3 >= 0; i3--) { + const element = p.openElements.items[i3]; if (element === formattingElementEntry.element) { break; } @@ -333421,10 +257072,10 @@ var require_parser2 = __commonJS((exports, module) => { function aaInnerLoop(p, furthestBlock, formattingElement) { let lastElement = furthestBlock; let nextElement = p.openElements.getCommonAncestor(furthestBlock); - for (let i4 = 0, element = nextElement;element !== formattingElement; i4++, element = nextElement) { + for (let i3 = 0, element = nextElement;element !== formattingElement; i3++, element = nextElement) { nextElement = p.openElements.getCommonAncestor(element); const elementEntry = p.activeFormattingElements.getElementEntry(element); - const counterOverflow = elementEntry && i4 >= AA_INNER_LOOP_ITER; + const counterOverflow = elementEntry && i3 >= AA_INNER_LOOP_ITER; const shouldRemoveFromOpenElements = !elementEntry || counterOverflow; if (shouldRemoveFromOpenElements) { if (counterOverflow) { @@ -333475,7 +257126,7 @@ var require_parser2 = __commonJS((exports, module) => { } function callAdoptionAgency(p, token) { let formattingElementEntry; - for (let i4 = 0;i4 < AA_OUTER_LOOP_ITER; i4++) { + for (let i3 = 0;i3 < AA_OUTER_LOOP_ITER; i3++) { formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry); if (!formattingElementEntry) { break; @@ -333768,8 +257419,8 @@ var require_parser2 = __commonJS((exports, module) => { function listItemStartTagInBody(p, token) { p.framesetOk = false; const tn = token.tagName; - for (let i4 = p.openElements.stackTop;i4 >= 0; i4--) { - const element = p.openElements.items[i4]; + for (let i3 = p.openElements.stackTop;i3 >= 0; i3--) { + const element = p.openElements.items[i3]; const elementTn = p.treeAdapter.getTagName(element); let closeTn = null; if (tn === $2.LI && elementTn === $2.LI) { @@ -334216,8 +257867,8 @@ var require_parser2 = __commonJS((exports, module) => { } function genericEndTagInBody(p, token) { const tn = token.tagName; - for (let i4 = p.openElements.stackTop;i4 > 0; i4--) { - const element = p.openElements.items[i4]; + for (let i3 = p.openElements.stackTop;i3 > 0; i3--) { + const element = p.openElements.items[i3]; if (p.treeAdapter.getTagName(element) === tn) { p.openElements.generateImpliedEndTagsWithExclusion(tn); p.openElements.popUntilElementPopped(element); @@ -334504,14 +258155,14 @@ var require_parser2 = __commonJS((exports, module) => { p.hasNonWhitespacePendingCharacterToken = true; } function tokenInTableText(p, token) { - let i4 = 0; + let i3 = 0; if (p.hasNonWhitespacePendingCharacterToken) { - for (;i4 < p.pendingCharacterTokens.length; i4++) { - tokenInTable(p, p.pendingCharacterTokens[i4]); + for (;i3 < p.pendingCharacterTokens.length; i3++) { + tokenInTable(p, p.pendingCharacterTokens[i3]); } } else { - for (;i4 < p.pendingCharacterTokens.length; i4++) { - p._insertCharacters(p.pendingCharacterTokens[i4]); + for (;i3 < p.pendingCharacterTokens.length; i3++) { + p._insertCharacters(p.pendingCharacterTokens[i3]); } } p.insertionMode = p.originalInsertionMode; @@ -334901,8 +258552,8 @@ var require_parser2 = __commonJS((exports, module) => { } } function endTagInForeignContent(p, token) { - for (let i4 = p.openElements.stackTop;i4 > 0; i4--) { - const element = p.openElements.items[i4]; + for (let i3 = p.openElements.stackTop;i3 > 0; i3--) { + const element = p.openElements.items[i3]; if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) { p._processToken(token); break; @@ -334946,8 +258597,8 @@ var require_serializer = __commonJS((exports, module) => { _serializeChildNodes(parentNode) { const childNodes = this.treeAdapter.getChildNodes(parentNode); if (childNodes) { - for (let i4 = 0, cnLength = childNodes.length;i4 < cnLength; i4++) { - const currentNode = childNodes[i4]; + for (let i3 = 0, cnLength = childNodes.length;i3 < cnLength; i3++) { + const currentNode = childNodes[i3]; if (this.treeAdapter.isElementNode(currentNode)) { this._serializeElement(currentNode); } else if (this.treeAdapter.isTextNode(currentNode)) { @@ -334974,8 +258625,8 @@ var require_serializer = __commonJS((exports, module) => { } _serializeAttributes(node) { const attrs = this.treeAdapter.getAttrList(node); - for (let i4 = 0, attrsLength = attrs.length;i4 < attrsLength; i4++) { - const attr = attrs[i4]; + for (let i3 = 0, attrsLength = attrs.length;i3 < attrsLength; i3++) { + const attr = attrs[i3]; const value = Serializer.escapeString(attr.value, true); this.html += " "; if (!attr.namespace) { @@ -334997,10 +258648,10 @@ var require_serializer = __commonJS((exports, module) => { } _serializeTextNode(node) { const content = this.treeAdapter.getTextNodeContent(node); - const parent3 = this.treeAdapter.getParentNode(node); + const parent2 = this.treeAdapter.getParentNode(node); let parentTn = undefined; - if (parent3 && this.treeAdapter.isElementNode(parent3)) { - parentTn = this.treeAdapter.getTagName(parent3); + if (parent2 && this.treeAdapter.isElementNode(parent2)) { + parentTn = this.treeAdapter.getTagName(parent2); } if (parentTn === $2.STYLE || parentTn === $2.SCRIPT || parentTn === $2.XMP || parentTn === $2.IFRAME || parentTn === $2.NOEMBED || parentTn === $2.NOFRAMES || parentTn === $2.PLAINTEXT || parentTn === $2.NOSCRIPT) { this.html += content; @@ -335029,7 +258680,7 @@ var require_serializer = __commonJS((exports, module) => { }); // node_modules/parse5/lib/index.js -var require_lib6 = __commonJS((exports) => { +var require_lib4 = __commonJS((exports) => { var Parser2 = require_parser2(); var Serializer = require_serializer(); exports.parse = function parse(html2, options2) { @@ -335378,8 +259029,8 @@ var require_doctype2 = __commonJS((exports) => { return quote + id + quote; } function hasPrefix2(publicId, prefixes) { - for (let i4 = 0;i4 < prefixes.length; i4++) { - if (publicId.indexOf(prefixes[i4]) === 0) { + for (let i3 = 0;i3 < prefixes.length; i3++) { + if (publicId.indexOf(prefixes[i3]) === 0) { return true; } } @@ -335431,7 +259082,7 @@ var require_doctype2 = __commonJS((exports) => { }); // node_modules/parse5-htmlparser2-tree-adapter/lib/index.js -var require_lib7 = __commonJS((exports) => { +var require_lib5 = __commonJS((exports) => { var doctype = require_doctype2(); var { DOCUMENT_MODE } = require_html2(); var nodeTypes = { @@ -335504,11 +259155,11 @@ var require_lib7 = __commonJS((exports) => { const attribs = Object.create(null); const attribsNamespace = Object.create(null); const attribsPrefix = Object.create(null); - for (let i4 = 0;i4 < attrs.length; i4++) { - const attrName = attrs[i4].name; - attribs[attrName] = attrs[i4].value; - attribsNamespace[attrName] = attrs[i4].namespace; - attribsPrefix[attrName] = attrs[i4].prefix; + for (let i3 = 0;i3 < attrs.length; i3++) { + const attrName = attrs[i3].name; + attribs[attrName] = attrs[i3].value; + attribsNamespace[attrName] = attrs[i3].namespace; + attribsPrefix[attrName] = attrs[i3].prefix; } return new Node2({ type: tagName === "script" || tagName === "style" ? tagName : "tag", @@ -335571,9 +259222,9 @@ var require_lib7 = __commonJS((exports) => { exports.setDocumentType = function(document2, name, publicId, systemId) { const data = doctype.serializeContent(name, publicId, systemId); let doctypeNode = null; - for (let i4 = 0;i4 < document2.children.length; i4++) { - if (document2.children[i4].type === "directive" && document2.children[i4].name === "!doctype") { - doctypeNode = document2.children[i4]; + for (let i3 = 0;i3 < document2.children.length; i3++) { + if (document2.children[i3].type === "directive" && document2.children[i3].name === "!doctype") { + doctypeNode = document2.children[i3]; break; } } @@ -335616,29 +259267,29 @@ var require_lib7 = __commonJS((exports) => { node.parent = null; } }; - exports.insertText = function(parentNode, text2) { + exports.insertText = function(parentNode, text) { const lastChild = parentNode.children[parentNode.children.length - 1]; if (lastChild && lastChild.type === "text") { - lastChild.data += text2; + lastChild.data += text; } else { - appendChild(parentNode, createTextNode2(text2)); + appendChild(parentNode, createTextNode2(text)); } }; - exports.insertTextBefore = function(parentNode, text2, referenceNode) { + exports.insertTextBefore = function(parentNode, text, referenceNode) { const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1]; if (prevNode && prevNode.type === "text") { - prevNode.data += text2; + prevNode.data += text; } else { - insertBefore(parentNode, createTextNode2(text2), referenceNode); + insertBefore(parentNode, createTextNode2(text), referenceNode); } }; exports.adoptAttributes = function(recipient, attrs) { - for (let i4 = 0;i4 < attrs.length; i4++) { - const attrName = attrs[i4].name; + for (let i3 = 0;i3 < attrs.length; i3++) { + const attrName = attrs[i3].name; if (typeof recipient.attribs[attrName] === "undefined") { - recipient.attribs[attrName] = attrs[i4].value; - recipient["x-attribsNamespace"][attrName] = attrs[i4].namespace; - recipient["x-attribsPrefix"][attrName] = attrs[i4].prefix; + recipient.attribs[attrName] = attrs[i3].value; + recipient["x-attribsNamespace"][attrName] = attrs[i3].namespace; + recipient["x-attribsPrefix"][attrName] = attrs[i3].prefix; } } }; @@ -335723,11 +259374,11 @@ var require_ansi_styles2 = __commonJS((exports, module) => { }; var ansi2ansi = (n2) => n2; var rgb2rgb = (r, g, b) => [r, g, b]; - var setLazyProperty = (object4, property3, get3) => { - Object.defineProperty(object4, property3, { + var setLazyProperty = (object4, property2, get2) => { + Object.defineProperty(object4, property2, { get: () => { - const value = get3(); - Object.defineProperty(object4, property3, { + const value = get2(); + Object.defineProperty(object4, property2, { value, enumerable: true, configurable: true @@ -335739,7 +259390,7 @@ var require_ansi_styles2 = __commonJS((exports, module) => { }); }; var colorConvert; - var makeDynamicStyles = (wrap3, targetSpace, identity5, isBackground) => { + var makeDynamicStyles = (wrap2, targetSpace, identity4, isBackground) => { if (colorConvert === undefined) { colorConvert = require_color_convert(); } @@ -335748,9 +259399,9 @@ var require_ansi_styles2 = __commonJS((exports, module) => { for (const [sourceSpace, suite] of Object.entries(colorConvert)) { const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace; if (sourceSpace === targetSpace) { - styles5[name] = wrap3(identity5, offset); + styles5[name] = wrap2(identity4, offset); } else if (typeof suite === "object") { - styles5[name] = wrap3(suite[targetSpace], offset); + styles5[name] = wrap2(suite[targetSpace], offset); } } return styles5; @@ -335844,7 +259495,7 @@ var require_ansi_styles2 = __commonJS((exports, module) => { }); // node_modules/cli-highlight/node_modules/chalk/source/util.js -var require_util12 = __commonJS((exports, module) => { +var require_util10 = __commonJS((exports, module) => { var stringReplaceAll2 = (string5, substring, replacer) => { let index = string5.indexOf(substring); if (index === -1) { @@ -335901,7 +259552,7 @@ var require_templates = __commonJS((exports, module) => { ["e", "\x1B"], ["a", "\x07"] ]); - function unescape4(c6) { + function unescape3(c6) { const u2 = c6[0] === "u"; const bracket = c6[1] === "{"; if (u2 && !bracket && c6.length === 5 || c6[0] === "x" && c6.length === 3) { @@ -335915,15 +259566,15 @@ var require_templates = __commonJS((exports, module) => { function parseArguments2(name, arguments_) { const results = []; const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches3; - for (const chunk3 of chunks) { - const number5 = Number(chunk3); + let matches2; + for (const chunk2 of chunks) { + const number5 = Number(chunk2); if (!Number.isNaN(number5)) { results.push(number5); - } else if (matches3 = chunk3.match(STRING_REGEX)) { - results.push(matches3[2].replace(ESCAPE_REGEX, (m, escape5, character) => escape5 ? unescape4(escape5) : character)); + } else if (matches2 = chunk2.match(STRING_REGEX)) { + results.push(matches2[2].replace(ESCAPE_REGEX, (m, escape4, character) => escape4 ? unescape3(escape4) : character)); } else { - throw new Error(`Invalid Chalk template style argument: ${chunk3} (in style '${name}')`); + throw new Error(`Invalid Chalk template style argument: ${chunk2} (in style '${name}')`); } } return results; @@ -335931,11 +259582,11 @@ var require_templates = __commonJS((exports, module) => { function parseStyle(style) { STYLE_REGEX.lastIndex = 0; const results = []; - let matches3; - while ((matches3 = STYLE_REGEX.exec(style)) !== null) { - const name = matches3[1]; - if (matches3[2]) { - const args = parseArguments2(name, matches3[2]); + let matches2; + while ((matches2 = STYLE_REGEX.exec(style)) !== null) { + const name = matches2[1]; + if (matches2[2]) { + const args = parseArguments2(name, matches2[2]); results.push([name].concat(args)); } else { results.push([name]); @@ -335965,27 +259616,27 @@ var require_templates = __commonJS((exports, module) => { module.exports = (chalk2, temporary) => { const styles5 = []; const chunks = []; - let chunk3 = []; + let chunk2 = []; temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse2, style, close, character) => { if (escapeCharacter) { - chunk3.push(unescape4(escapeCharacter)); + chunk2.push(unescape3(escapeCharacter)); } else if (style) { - const string5 = chunk3.join(""); - chunk3 = []; + const string5 = chunk2.join(""); + chunk2 = []; chunks.push(styles5.length === 0 ? string5 : buildStyle(chalk2, styles5)(string5)); styles5.push({ inverse: inverse2, styles: parseStyle(style) }); } else if (close) { if (styles5.length === 0) { throw new Error("Found extraneous } in Chalk template literal"); } - chunks.push(buildStyle(chalk2, styles5)(chunk3.join(""))); - chunk3 = []; + chunks.push(buildStyle(chalk2, styles5)(chunk2.join(""))); + chunk2 = []; styles5.pop(); } else { - chunk3.push(character); + chunk2.push(character); } }); - chunks.push(chunk3.join("")); + chunks.push(chunk2.join("")); if (styles5.length > 0) { const errMessage = `Chalk template literal is missing ${styles5.length} closing bracket${styles5.length === 1 ? "" : "s"} (\`}\`)`; throw new Error(errMessage); @@ -336001,8 +259652,8 @@ var require_source = __commonJS((exports, module) => { var { stringReplaceAll: stringReplaceAll2, stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex2 - } = require_util12(); - var { isArray: isArray9 } = Array; + } = require_util10(); + var { isArray: isArray4 } = Array; var levelMapping2 = [ "ansi", "ansi", @@ -336090,27 +259741,27 @@ var require_source = __commonJS((exports, module) => { } } }); - var createStyler2 = (open5, close, parent3) => { + var createStyler2 = (open5, close, parent2) => { let openAll; let closeAll; - if (parent3 === undefined) { + if (parent2 === undefined) { openAll = open5; closeAll = close; } else { - openAll = parent3.openAll + open5; - closeAll = close + parent3.closeAll; + openAll = parent2.openAll + open5; + closeAll = close + parent2.closeAll; } return { open: open5, close, openAll, closeAll, - parent: parent3 + parent: parent2 }; }; var createBuilder2 = (self2, _styler, _isEmpty) => { const builder = (...arguments_) => { - if (isArray9(arguments_[0]) && isArray9(arguments_[0].raw)) { + if (isArray4(arguments_[0]) && isArray4(arguments_[0].raw)) { return applyStyle2(builder, chalkTag(builder, ...arguments_)); } return applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); @@ -336143,21 +259794,21 @@ var require_source = __commonJS((exports, module) => { } return openAll + string5 + closeAll; }; - var template3; + var template2; var chalkTag = (chalk3, ...strings) => { const [firstString] = strings; - if (!isArray9(firstString) || !isArray9(firstString.raw)) { + if (!isArray4(firstString) || !isArray4(firstString.raw)) { return strings.join(" "); } const arguments_ = strings.slice(1); const parts = [firstString.raw[0]]; - for (let i4 = 1;i4 < firstString.length; i4++) { - parts.push(String(arguments_[i4 - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i4])); + for (let i3 = 1;i3 < firstString.length; i3++) { + parts.push(String(arguments_[i3 - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i3])); } - if (template3 === undefined) { - template3 = require_templates(); + if (template2 === undefined) { + template2 = require_templates(); } - return template3(chalk3, parts.join("")); + return template2(chalk3, parts.join("")); }; Object.defineProperties(Chalk2.prototype, styles5); var chalk2 = Chalk2(); @@ -336225,8 +259876,8 @@ var require_theme = __commonJS((exports) => { }; function fromJson(json2) { var theme = {}; - for (var _i = 0, _a5 = Object.keys(json2);_i < _a5.length; _i++) { - var key = _a5[_i]; + for (var _i = 0, _a3 = Object.keys(json2);_i < _a3.length; _i++) { + var key = _a3[_i]; var style = json2[key]; if (Array.isArray(style)) { theme[key] = style.reduce(function(previous, current) { @@ -336241,8 +259892,8 @@ var require_theme = __commonJS((exports) => { exports.fromJson = fromJson; function toJson(theme) { var jsonTheme = {}; - for (var _i = 0, _a5 = Object.keys(jsonTheme);_i < _a5.length; _i++) { - var key = _a5[_i]; + for (var _i = 0, _a3 = Object.keys(jsonTheme);_i < _a3.length; _i++) { + var key = _a3[_i]; var style = jsonTheme[key]; jsonTheme[key] = style._styles; } @@ -336260,7 +259911,7 @@ var require_theme = __commonJS((exports) => { }); // node_modules/cli-highlight/dist/index.js -var require_dist11 = __commonJS((exports) => { +var require_dist7 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -336280,14 +259931,14 @@ var require_dist11 = __commonJS((exports) => { var __importStar = exports && exports.__importStar || function(mod2) { if (mod2 && mod2.__esModule) return mod2; - var result3 = {}; + var result2 = {}; if (mod2 != null) { for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result3, mod2, k); + __createBinding(result2, mod2, k); } - __setModuleDefault(result3, mod2); - return result3; + __setModuleDefault(result2, mod2); + return result2; }; var __exportStar = exports && exports.__exportStar || function(m, exports2) { for (var p in m) @@ -336299,9 +259950,9 @@ var require_dist11 = __commonJS((exports) => { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.supportsLanguage = exports.listLanguages = exports.highlight = undefined; - var hljs = __importStar(require_lib5()); - var parse52 = __importStar(require_lib6()); - var parse5_htmlparser2_tree_adapter_1 = __importDefault(require_lib7()); + var hljs = __importStar(require_lib3()); + var parse52 = __importStar(require_lib4()); + var parse5_htmlparser2_tree_adapter_1 = __importDefault(require_lib5()); var theme_1 = require_theme(); function colorizeNode(node, theme, context) { if (theme === undefined) { @@ -336309,11 +259960,11 @@ var require_dist11 = __commonJS((exports) => { } switch (node.type) { case "text": { - var text2 = node.data; + var text = node.data; if (context === undefined) { - return (theme.default || theme_1.DEFAULT_THEME.default || theme_1.plain)(text2); + return (theme.default || theme_1.DEFAULT_THEME.default || theme_1.plain)(text); } - return text2; + return text; } case "tag": { var hljsClass = /hljs-(\w+)/.exec(node.attribs.class); @@ -336405,16 +260056,16 @@ var require_core4 = __commonJS((exports, module) => { return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); } function inherit$1(original, ...objects) { - const result3 = Object.create(null); + const result2 = Object.create(null); for (const key in original) { - result3[key] = original[key]; + result2[key] = original[key]; } objects.forEach(function(obj) { for (const key in obj) { - result3[key] = obj[key]; + result2[key] = obj[key]; } }); - return result3; + return result2; } var SPAN_CLOSE = ""; var emitsWrappingTags = (node) => { @@ -336428,7 +260079,7 @@ var require_core4 = __commonJS((exports, module) => { const pieces = name.split("."); return [ `${prefix}${pieces.shift()}`, - ...pieces.map((x4, i4) => `${x4}${"_".repeat(i4 + 1)}`) + ...pieces.map((x3, i3) => `${x3}${"_".repeat(i3 + 1)}`) ].join(" "); } return `${prefix}${name}`; @@ -336440,8 +260091,8 @@ var require_core4 = __commonJS((exports, module) => { this.classPrefix = options2.classPrefix; parseTree2.walk(this); } - addText(text2) { - this.buffer += escapeHTML(text2); + addText(text) { + this.buffer += escapeHTML(text); } openNode(node) { if (!emitsWrappingTags(node)) @@ -336462,9 +260113,9 @@ var require_core4 = __commonJS((exports, module) => { } } var newNode = (opts = {}) => { - const result3 = { children: [] }; - Object.assign(result3, opts); - return result3; + const result2 = { children: [] }; + Object.assign(result2, opts); + return result2; }; class TokenTree { @@ -336532,11 +260183,11 @@ var require_core4 = __commonJS((exports, module) => { super(); this.options = options2; } - addText(text2) { - if (text2 === "") { + addText(text) { + if (text === "") { return; } - this.add(text2); + this.add(text); } startScope(scope) { this.openNode(scope); @@ -336567,16 +260218,16 @@ var require_core4 = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } function anyNumberOfTimes(re) { - return concat3("(?:", re, ")*"); + return concat2("(?:", re, ")*"); } function optional3(re) { - return concat3("(?:", re, ")?"); + return concat2("(?:", re, ")?"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function stripOptionsFromArgs(args) { @@ -336590,13 +260241,13 @@ var require_core4 = __commonJS((exports, module) => { } function either(...args) { const opts = stripOptionsFromArgs(args); - const joined = "(" + (opts.capture ? "" : "?:") + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + (opts.capture ? "" : "?:") + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function countMatchGroups(re) { return new RegExp(re.toString() + "|").exec("").length - 1; } - function startsWith3(re, lexeme) { + function startsWith2(re, lexeme) { const match = re && re.exec(lexeme); return match && match.index === 0; } @@ -336638,7 +260289,7 @@ var require_core4 = __commonJS((exports, module) => { var SHEBANG = (opts = {}) => { const beginShebang = /^#![ ]*\//; if (opts.binary) { - opts.begin = concat3(beginShebang, /.*\b/, opts.binary, /\b.*/); + opts.begin = concat2(beginShebang, /.*\b/, opts.binary, /\b.*/); } return inherit$1({ scope: "meta", @@ -336688,7 +260339,7 @@ var require_core4 = __commonJS((exports, module) => { }); const ENGLISH_WORD = either("I", "a", "is", "so", "us", "to", "at", "if", "in", "it", "on", /[A-Za-z]+['](d|ve|re|ll|t|s|n)/, /[A-Za-z]+[-][a-z]+/, /[A-Za-z][a-z]{2,}/); mode.contains.push({ - begin: concat3(/[ ]+/, "(", ENGLISH_WORD, /[.]?[:]?([.][ ]|[ ])/, "){3}") + begin: concat2(/[ ]+/, "(", ENGLISH_WORD, /[.]?[:]?([.][ ]|[ ])/, "){3}") }); return mode; }; @@ -336777,8 +260428,8 @@ var require_core4 = __commonJS((exports, module) => { UNDERSCORE_TITLE_MODE }); function skipIfHasPrecedingDot(match, response) { - const before3 = match.input[match.index - 1]; - if (before3 === ".") { + const before2 = match.input[match.index - 1]; + if (before2 === ".") { response.ignoreMatch(); } } @@ -336788,8 +260439,8 @@ var require_core4 = __commonJS((exports, module) => { delete mode.className; } } - function beginKeywords(mode, parent3) { - if (!parent3) + function beginKeywords(mode, parent2) { + if (!parent2) return; if (!mode.beginKeywords) return; @@ -336817,7 +260468,7 @@ var require_core4 = __commonJS((exports, module) => { if (mode.relevance === undefined) mode.relevance = 1; } - var beforeMatchExt = (mode, parent3) => { + var beforeMatchExt = (mode, parent2) => { if (!mode.beforeMatch) return; if (mode.starts) @@ -336827,7 +260478,7 @@ var require_core4 = __commonJS((exports, module) => { delete mode[key]; }); mode.keywords = originalMode.keywords; - mode.begin = concat3(originalMode.beforeMatch, lookahead(originalMode.begin)); + mode.begin = concat2(originalMode.beforeMatch, lookahead(originalMode.begin)); mode.starts = { relevance: 0, contains: [ @@ -336865,7 +260516,7 @@ var require_core4 = __commonJS((exports, module) => { return compiledKeywords; function compileList(scopeName2, keywordList) { if (caseInsensitive) { - keywordList = keywordList.map((x4) => x4.toLowerCase()); + keywordList = keywordList.map((x3) => x3.toLowerCase()); } keywordList.forEach(function(keyword) { const pair = keyword.split("|"); @@ -336883,7 +260534,7 @@ var require_core4 = __commonJS((exports, module) => { return COMMON_KEYWORDS.includes(keyword.toLowerCase()); } var seenDeprecations = {}; - var error45 = (message) => { + var error41 = (message) => { console.error(message); }; var warn = (message, ...args) => { @@ -336901,10 +260552,10 @@ var require_core4 = __commonJS((exports, module) => { const scopeNames = mode[key]; const emit = {}; const positions = {}; - for (let i4 = 1;i4 <= regexes.length; i4++) { - positions[i4 + offset] = scopeNames[i4]; - emit[i4 + offset] = true; - offset += countMatchGroups(regexes[i4 - 1]); + for (let i3 = 1;i3 <= regexes.length; i3++) { + positions[i3 + offset] = scopeNames[i3]; + emit[i3 + offset] = true; + offset += countMatchGroups(regexes[i3 - 1]); } mode[key] = positions; mode[key]._emit = emit; @@ -336914,11 +260565,11 @@ var require_core4 = __commonJS((exports, module) => { if (!Array.isArray(mode.begin)) return; if (mode.skip || mode.excludeBegin || mode.returnBegin) { - error45("skip, excludeBegin, returnBegin not compatible with beginScope: {}"); + error41("skip, excludeBegin, returnBegin not compatible with beginScope: {}"); throw MultiClassError; } if (typeof mode.beginScope !== "object" || mode.beginScope === null) { - error45("beginScope must be object"); + error41("beginScope must be object"); throw MultiClassError; } remapScopeNames(mode, mode.begin, { key: "beginScope" }); @@ -336928,11 +260579,11 @@ var require_core4 = __commonJS((exports, module) => { if (!Array.isArray(mode.end)) return; if (mode.skip || mode.excludeEnd || mode.returnEnd) { - error45("skip, excludeEnd, returnEnd not compatible with endScope: {}"); + error41("skip, excludeEnd, returnEnd not compatible with endScope: {}"); throw MultiClassError; } if (typeof mode.endScope !== "object" || mode.endScope === null) { - error45("endScope must be object"); + error41("endScope must be object"); throw MultiClassError; } remapScopeNames(mode, mode.end, { key: "endScope" }); @@ -336987,9 +260638,9 @@ var require_core4 = __commonJS((exports, module) => { if (!match) { return null; } - const i4 = match.findIndex((el, i5) => i5 > 0 && el !== undefined); - const matchData = this.matchIndexes[i4]; - match.splice(0, i4); + const i3 = match.findIndex((el, i4) => i4 > 0 && el !== undefined); + const matchData = this.matchIndexes[i3]; + match.splice(0, i3); return Object.assign(match, matchData); } } @@ -337025,23 +260676,23 @@ var require_core4 = __commonJS((exports, module) => { exec(s) { const m = this.getMatcher(this.regexIndex); m.lastIndex = this.lastIndex; - let result3 = m.exec(s); + let result2 = m.exec(s); if (this.resumingScanAtSamePosition()) { - if (result3 && result3.index === this.lastIndex) + if (result2 && result2.index === this.lastIndex) ; else { const m2 = this.getMatcher(0); m2.lastIndex = this.lastIndex + 1; - result3 = m2.exec(s); + result2 = m2.exec(s); } } - if (result3) { - this.regexIndex += result3.position + 1; + if (result2) { + this.regexIndex += result2.position + 1; if (this.regexIndex === this.count) { this.considerAll(); } } - return result3; + return result2; } } function buildModeRegex(mode) { @@ -337055,7 +260706,7 @@ var require_core4 = __commonJS((exports, module) => { } return mm; } - function compileMode(mode, parent3) { + function compileMode(mode, parent2) { const cmode = mode; if (mode.isCompiled) return cmode; @@ -337064,14 +260715,14 @@ var require_core4 = __commonJS((exports, module) => { compileMatch, MultiClass, beforeMatchExt - ].forEach((ext) => ext(mode, parent3)); - language.compilerExtensions.forEach((ext) => ext(mode, parent3)); + ].forEach((ext) => ext(mode, parent2)); + language.compilerExtensions.forEach((ext) => ext(mode, parent2)); mode.__beforeBegin = null; [ beginKeywords, compileIllegal, compileRelevance - ].forEach((ext) => ext(mode, parent3)); + ].forEach((ext) => ext(mode, parent2)); mode.isCompiled = true; let keywordPattern = null; if (typeof mode.keywords === "object" && mode.keywords.$pattern) { @@ -337084,7 +260735,7 @@ var require_core4 = __commonJS((exports, module) => { mode.keywords = compileKeywords(mode.keywords, language.case_insensitive); } cmode.keywordPatternRe = langRe(keywordPattern, true); - if (parent3) { + if (parent2) { if (!mode.begin) mode.begin = /\B|\b/; cmode.beginRe = langRe(cmode.begin); @@ -337093,8 +260744,8 @@ var require_core4 = __commonJS((exports, module) => { if (mode.end) cmode.endRe = langRe(cmode.end); cmode.terminatorEnd = source(cmode.end) || ""; - if (mode.endsWithParent && parent3.terminatorEnd) { - cmode.terminatorEnd += (mode.end ? "|" : "") + parent3.terminatorEnd; + if (mode.endsWithParent && parent2.terminatorEnd) { + cmode.terminatorEnd += (mode.end ? "|" : "") + parent2.terminatorEnd; } } if (mode.illegal) @@ -337108,7 +260759,7 @@ var require_core4 = __commonJS((exports, module) => { compileMode(c6, cmode); }); if (mode.starts) { - compileMode(mode.starts, parent3); + compileMode(mode.starts, parent2); } cmode.matcher = buildModeRegex(cmode); return cmode; @@ -337152,7 +260803,7 @@ var require_core4 = __commonJS((exports, module) => { this.html = html2; } } - var escape5 = escapeHTML; + var escape4 = escapeHTML; var inherit = inherit$1; var NO_MATCH = Symbol("nomatch"); var MAX_KEYWORD_HITS = 7; @@ -337212,10 +260863,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`); language: languageName }; fire("before:highlight", context); - const result3 = context.result ? context.result : _highlight(context.language, context.code, ignoreIllegals); - result3.code = context.code; - fire("after:highlight", result3); - return result3; + const result2 = context.result ? context.result : _highlight(context.language, context.code, ignoreIllegals); + result2.code = context.code; + fire("after:highlight", result2); + return result2; } function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) { const keywordHits = Object.create(null); @@ -337260,21 +260911,21 @@ https://github.com/highlightjs/highlight.js/issues/2277`); function processSubLanguage() { if (modeBuffer === "") return; - let result4 = null; + let result3 = null; if (typeof top.subLanguage === "string") { if (!languages[top.subLanguage]) { emitter.addText(modeBuffer); return; } - result4 = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]); - continuations[top.subLanguage] = result4._top; + result3 = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]); + continuations[top.subLanguage] = result3._top; } else { - result4 = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null); + result3 = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null); } if (top.relevance > 0) { - relevance += result4.relevance; + relevance += result3.relevance; } - emitter.__addSublanguage(result4._emitter, result4.language); + emitter.__addSublanguage(result3._emitter, result3.language); } function processBuffer() { if (top.subLanguage != null) { @@ -337292,23 +260943,23 @@ https://github.com/highlightjs/highlight.js/issues/2277`); emitter.endScope(); } function emitMultiClass(scope, match) { - let i4 = 1; - const max5 = match.length - 1; - while (i4 <= max5) { - if (!scope._emit[i4]) { - i4++; + let i3 = 1; + const max3 = match.length - 1; + while (i3 <= max3) { + if (!scope._emit[i3]) { + i3++; continue; } - const klass = language.classNameAliases[scope[i4]] || scope[i4]; - const text2 = match[i4]; + const klass = language.classNameAliases[scope[i3]] || scope[i3]; + const text = match[i3]; if (klass) { - emitKeyword(text2, klass); + emitKeyword(text, klass); } else { - modeBuffer = text2; + modeBuffer = text; processKeywords(); modeBuffer = ""; } - i4++; + i3++; } } function startNewMode(mode, match) { @@ -337328,7 +260979,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`); return top; } function endOfMode(mode, match, matchPlusRemainder) { - let matched = startsWith3(mode.endRe, matchPlusRemainder); + let matched = startsWith2(mode.endRe, matchPlusRemainder); if (matched) { if (mode["on:end"]) { const resp = new Response2(mode); @@ -337441,10 +261092,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`); if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") { modeBuffer += codeToHighlight.slice(match.index, match.index + 1); if (!SAFE_MODE) { - const err3 = new Error(`0 width match regex (${languageName})`); - err3.languageName = languageName; - err3.badRule = lastMatch.rule; - throw err3; + const err2 = new Error(`0 width match regex (${languageName})`); + err2.languageName = languageName; + err2.badRule = lastMatch.rule; + throw err2; } return 1; } @@ -337452,9 +261103,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`); if (match.type === "begin") { return doBeginMatch(match); } else if (match.type === "illegal" && !ignoreIllegals) { - const err3 = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.scope || "") + '"'); - err3.mode = top; - throw err3; + const err2 = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.scope || "") + '"'); + err2.mode = top; + throw err2; } else if (match.type === "end") { const processed = doEndMatch(match); if (processed !== NO_MATCH) { @@ -337467,19 +261118,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`); return 1; } if (iterations > 1e5 && iterations > match.index * 3) { - const err3 = new Error("potential infinite loop, way more iterations than matches"); - throw err3; + const err2 = new Error("potential infinite loop, way more iterations than matches"); + throw err2; } modeBuffer += lexeme; return lexeme.length; } const language = getLanguage(languageName); if (!language) { - error45(LANGUAGE_NOT_FOUND.replace("{}", languageName)); + error41(LANGUAGE_NOT_FOUND.replace("{}", languageName)); throw new Error('Unknown language: "' + languageName + '"'); } const md = compileLanguage(language); - let result3 = ""; + let result2 = ""; let top = continuation || md; const continuations = {}; const emitter = new options2.__emitter(options2); @@ -337512,56 +261163,56 @@ https://github.com/highlightjs/highlight.js/issues/2277`); language.__emitTokens(codeToHighlight, emitter); } emitter.finalize(); - result3 = emitter.toHTML(); + result2 = emitter.toHTML(); return { language: languageName, - value: result3, + value: result2, relevance, illegal: false, _emitter: emitter, _top: top }; - } catch (err3) { - if (err3.message && err3.message.includes("Illegal")) { + } catch (err2) { + if (err2.message && err2.message.includes("Illegal")) { return { language: languageName, - value: escape5(codeToHighlight), + value: escape4(codeToHighlight), illegal: true, relevance: 0, _illegalBy: { - message: err3.message, + message: err2.message, index, context: codeToHighlight.slice(index - 100, index + 100), - mode: err3.mode, - resultSoFar: result3 + mode: err2.mode, + resultSoFar: result2 }, _emitter: emitter }; } else if (SAFE_MODE) { return { language: languageName, - value: escape5(codeToHighlight), + value: escape4(codeToHighlight), illegal: false, relevance: 0, - errorRaised: err3, + errorRaised: err2, _emitter: emitter, _top: top }; } else { - throw err3; + throw err2; } } } function justTextHighlightResult(code) { - const result3 = { - value: escape5(code), + const result2 = { + value: escape4(code), illegal: false, relevance: 0, _top: PLAINTEXT_LANGUAGE, _emitter: new options2.__emitter(options2) }; - result3._emitter.addText(code); - return result3; + result2._emitter.addText(code); + return result2; } function highlightAuto(code, languageSubset) { languageSubset = languageSubset || options2.languages || Object.keys(languages); @@ -337581,9 +261232,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`); return 0; }); const [best, secondBest] = sorted; - const result3 = best; - result3.secondBest = secondBest; - return result3; + const result2 = best; + result2.secondBest = secondBest; + return result2; } function updateClassName(element, currentLang, resultLang) { const language = currentLang && aliases[currentLang] || resultLang; @@ -337608,28 +261259,28 @@ https://github.com/highlightjs/highlight.js/issues/2277`); console.warn(element); } if (options2.throwUnescapedHTML) { - const err3 = new HTMLInjectionError("One of your code blocks includes unescaped HTML.", element.innerHTML); - throw err3; + const err2 = new HTMLInjectionError("One of your code blocks includes unescaped HTML.", element.innerHTML); + throw err2; } } node = element; - const text2 = node.textContent; - const result3 = language ? highlight2(text2, { language, ignoreIllegals: true }) : highlightAuto(text2); - element.innerHTML = result3.value; + const text = node.textContent; + const result2 = language ? highlight2(text, { language, ignoreIllegals: true }) : highlightAuto(text); + element.innerHTML = result2.value; element.dataset.highlighted = "yes"; - updateClassName(element, language, result3.language); + updateClassName(element, language, result2.language); element.result = { - language: result3.language, - re: result3.relevance, - relevance: result3.relevance + language: result2.language, + re: result2.relevance, + relevance: result2.relevance }; - if (result3.secondBest) { + if (result2.secondBest) { element.secondBest = { - language: result3.secondBest.language, - relevance: result3.secondBest.relevance + language: result2.secondBest.language, + relevance: result2.secondBest.relevance }; } - fire("after:highlightElement", { el: element, result: result3, text: text2 }); + fire("after:highlightElement", { el: element, result: result2, text }); } function configure(userOptions) { options2 = inherit(options2, userOptions); @@ -337662,11 +261313,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`); try { lang = languageDefinition(hljs); } catch (error$1) { - error45("Language definition for '{}' could not be registered.".replace("{}", languageName)); + error41("Language definition for '{}' could not be registered.".replace("{}", languageName)); if (!SAFE_MODE) { throw error$1; } else { - error45(error$1); + error41(error$1); } lang = PLAINTEXT_LANGUAGE; } @@ -337767,7 +261418,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`); }; hljs.versionString = version2; hljs.regex = { - concat: concat3, + concat: concat2, lookahead, either, optional: optional3, @@ -347518,8 +271169,8 @@ var require_elixir2 = __commonJS((exports, module) => { const LOWERCASE_SIGIL = { className: "string", begin: "~[a-z]" + "(?=" + SIGIL_DELIMITERS + ")", - contains: SIGIL_DELIMITER_MODES.map((x4) => hljs.inherit(x4, { contains: [ - escapeSigilEnd(x4.end), + contains: SIGIL_DELIMITER_MODES.map((x3) => hljs.inherit(x3, { contains: [ + escapeSigilEnd(x3.end), BACKSLASH_ESCAPE, SUBST ] })) @@ -347527,17 +271178,17 @@ var require_elixir2 = __commonJS((exports, module) => { const UPCASE_SIGIL = { className: "string", begin: "~[A-Z]" + "(?=" + SIGIL_DELIMITERS + ")", - contains: SIGIL_DELIMITER_MODES.map((x4) => hljs.inherit(x4, { contains: [escapeSigilEnd(x4.end)] })) + contains: SIGIL_DELIMITER_MODES.map((x3) => hljs.inherit(x3, { contains: [escapeSigilEnd(x3.end)] })) }; const REGEX_SIGIL = { className: "regex", variants: [ { begin: "~r" + "(?=" + SIGIL_DELIMITERS + ")", - contains: SIGIL_DELIMITER_MODES.map((x4) => hljs.inherit(x4, { - end: regex2.concat(x4.end, /[uismxfU]{0,7}/), + contains: SIGIL_DELIMITER_MODES.map((x3) => hljs.inherit(x3, { + end: regex2.concat(x3.end, /[uismxfU]{0,7}/), contains: [ - escapeSigilEnd(x4.end), + escapeSigilEnd(x3.end), BACKSLASH_ESCAPE, SUBST ] @@ -347545,9 +271196,9 @@ var require_elixir2 = __commonJS((exports, module) => { }, { begin: "~R" + "(?=" + SIGIL_DELIMITERS + ")", - contains: SIGIL_DELIMITER_MODES.map((x4) => hljs.inherit(x4, { - end: regex2.concat(x4.end, /[uismxfU]{0,7}/), - contains: [escapeSigilEnd(x4.end)] + contains: SIGIL_DELIMITER_MODES.map((x3) => hljs.inherit(x3, { + end: regex2.concat(x3.end, /[uismxfU]{0,7}/), + contains: [escapeSigilEnd(x3.end)] })) } ] @@ -348425,7 +272076,7 @@ var require_erlang2 = __commonJS((exports, module) => { returnBegin: true, keywords: { $pattern: "-" + hljs.IDENT_RE, - keyword: DIRECTIVES.map((x4) => `${x4}|1.5`).join(" ") + keyword: DIRECTIVES.map((x3) => `${x3}|1.5`).join(" ") }, contains: [ PARAMS, @@ -349685,7 +273336,7 @@ var require_fortran2 = __commonJS((exports, module) => { // node_modules/highlight.js/lib/languages/fsharp.js var require_fsharp2 = __commonJS((exports, module) => { - function escape5(value) { + function escape4(value) { return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "m"); } function source(re) { @@ -349696,10 +273347,10 @@ var require_fsharp2 = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function stripOptionsFromArgs(args) { @@ -349713,7 +273364,7 @@ var require_fsharp2 = __commonJS((exports, module) => { } function either(...args) { const opts = stripOptionsFromArgs(args); - const joined = "(" + (opts.capture ? "" : "?:") + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + (opts.capture ? "" : "?:") + args.map((x3) => source(x3)).join("|") + ")"; return joined; } function fsharp(hljs) { @@ -349916,8 +273567,8 @@ var require_fsharp2 = __commonJS((exports, module) => { const GENERIC_TYPE_SYMBOL = { scope: "symbol", variants: [ - { match: concat3(BEGIN_GENERIC_TYPE_SYMBOL_RE, /``.*?``/) }, - { match: concat3(BEGIN_GENERIC_TYPE_SYMBOL_RE, hljs.UNDERSCORE_IDENT_RE) } + { match: concat2(BEGIN_GENERIC_TYPE_SYMBOL_RE, /``.*?``/) }, + { match: concat2(BEGIN_GENERIC_TYPE_SYMBOL_RE, hljs.UNDERSCORE_IDENT_RE) } ], relevance: 0 }; @@ -349928,10 +273579,10 @@ var require_fsharp2 = __commonJS((exports, module) => { else allOperatorChars = "!%&*+-/<>@^|~?"; const OPERATOR_CHARS = Array.from(allOperatorChars); - const OPERATOR_CHAR_RE = concat3("[", ...OPERATOR_CHARS.map(escape5), "]"); + const OPERATOR_CHAR_RE = concat2("[", ...OPERATOR_CHARS.map(escape4), "]"); const OPERATOR_CHAR_OR_DOT_RE = either(OPERATOR_CHAR_RE, /\./); - const OPERATOR_FIRST_CHAR_OF_MULTIPLE_RE = concat3(OPERATOR_CHAR_OR_DOT_RE, lookahead(OPERATOR_CHAR_OR_DOT_RE)); - const SYMBOLIC_OPERATOR_RE = either(concat3(OPERATOR_FIRST_CHAR_OF_MULTIPLE_RE, OPERATOR_CHAR_OR_DOT_RE, "*"), concat3(OPERATOR_CHAR_RE, "+")); + const OPERATOR_FIRST_CHAR_OF_MULTIPLE_RE = concat2(OPERATOR_CHAR_OR_DOT_RE, lookahead(OPERATOR_CHAR_OR_DOT_RE)); + const SYMBOLIC_OPERATOR_RE = either(concat2(OPERATOR_FIRST_CHAR_OF_MULTIPLE_RE, OPERATOR_CHAR_OR_DOT_RE, "*"), concat2(OPERATOR_CHAR_RE, "+")); return { scope: "operator", match: either(SYMBOLIC_OPERATOR_RE, /:\?>/, /:\?/, /:>/, /:=/, /::?/, /\$/), @@ -349942,7 +273593,7 @@ var require_fsharp2 = __commonJS((exports, module) => { const OPERATOR_WITHOUT_EQUAL = makeOperatorMode({ includeEqual: false }); const makeTypeAnnotationMode = function(prefix, prefixScope) { return { - begin: concat3(prefix, lookahead(concat3(/\s*/, either(/\w/, /'/, /\^/, /#/, /``/, /\(/, /{\|/)))), + begin: concat2(prefix, lookahead(concat2(/\s*/, either(/\w/, /'/, /\^/, /#/, /``/, /\(/, /{\|/)))), beginScope: prefixScope, end: lookahead(either(/\n/, /=/)), relevance: 0, @@ -349988,7 +273639,7 @@ var require_fsharp2 = __commonJS((exports, module) => { const PREPROCESSOR = { begin: [ /^\s*/, - concat3(/#/, either(...PREPROCESSOR_KEYWORDS)), + concat2(/#/, either(...PREPROCESSOR_KEYWORDS)), /\b/ ], beginScope: { 2: "meta" }, @@ -350081,7 +273732,7 @@ var require_fsharp2 = __commonJS((exports, module) => { }; const CHAR_LITERAL = { scope: "string", - match: concat3(/'/, either(/[^\\']/, /\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8})/), /'/) + match: concat2(/'/, either(/[^\\']/, /\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8})/), /'/) }; SUBST.contains = [ INTERPOLATED_VERBATIM_STRING, @@ -355146,7 +278797,7 @@ var require_hsp2 = __commonJS((exports, module) => { var require_http2 = __commonJS((exports, module) => { function http3(hljs) { const regex2 = hljs.regex; - const VERSION7 = "HTTP/([32]|1\\.[01])"; + const VERSION5 = "HTTP/([32]|1\\.[01])"; const HEADER_NAME = /[A-Za-z][A-Za-z0-9-]*/; const HEADER = { className: "attribute", @@ -355179,12 +278830,12 @@ var require_http2 = __commonJS((exports, module) => { illegal: /\S/, contains: [ { - begin: "^(?=" + VERSION7 + " \\d{3})", + begin: "^(?=" + VERSION5 + " \\d{3})", end: /$/, contains: [ { className: "meta", - begin: VERSION7 + begin: VERSION5 }, { className: "number", @@ -355198,7 +278849,7 @@ var require_http2 = __commonJS((exports, module) => { } }, { - begin: "(?=^[A-Z]+ (.*?) " + VERSION7 + "$)", + begin: "(?=^[A-Z]+ (.*?) " + VERSION5 + "$)", end: /$/, contains: [ { @@ -355210,7 +278861,7 @@ var require_http2 = __commonJS((exports, module) => { }, { className: "meta", - begin: VERSION7 + begin: VERSION5 }, { className: "keyword", @@ -356180,9 +279831,9 @@ var require_javascript2 = __commonJS((exports, module) => { var BUILT_INS = [].concat(BUILT_IN_GLOBALS, TYPES, ERROR_TYPES); function javascript(hljs) { const regex2 = hljs.regex; - const hasClosingTag = (match, { after: after3 }) => { + const hasClosingTag = (match, { after: after2 }) => { const tag2 = " { ...BUILT_IN_GLOBALS, "super", "import" - ].map((x4) => `${x4}\\s*\\(`)), IDENT_RE$1, regex2.lookahead(/\s*\(/)), + ].map((x3) => `${x3}\\s*\\(`)), IDENT_RE$1, regex2.lookahead(/\s*\(/)), className: "title.function", relevance: 0 }; @@ -370745,16 +294396,16 @@ var require_php2 = __commonJS((exports, module) => { "stdClass" ]; const dualCase = (items) => { - const result3 = []; + const result2 = []; items.forEach((item) => { - result3.push(item); + result2.push(item); if (item.toLowerCase() === item) { - result3.push(item.toUpperCase()); + result2.push(item.toUpperCase()); } else { - result3.push(item.toLowerCase()); + result2.push(item.toLowerCase()); } }); - return result3; + return result2; }; const KEYWORDS = { keyword: KWS, @@ -379090,7 +302741,7 @@ var require_sql2 = __commonJS((exports, module) => { illegal: /[{}]|<\//, keywords: { $pattern: /\b[\w\.]+/, - keyword: reduceRelevancy(KEYWORDS, { when: (x4) => x4.length < 3 }), + keyword: reduceRelevancy(KEYWORDS, { when: (x3) => x3.length < 3 }), literal: LITERALS, type: TYPES, built_in: POSSIBLE_WITHOUT_PARENS @@ -380681,10 +304332,10 @@ var require_swift2 = __commonJS((exports, module) => { return re.source; } function lookahead(re) { - return concat3("(?=", re, ")"); + return concat2("(?=", re, ")"); } - function concat3(...args) { - const joined = args.map((x4) => source(x4)).join(""); + function concat2(...args) { + const joined = args.map((x3) => source(x3)).join(""); return joined; } function stripOptionsFromArgs(args) { @@ -380698,10 +304349,10 @@ var require_swift2 = __commonJS((exports, module) => { } function either(...args) { const opts = stripOptionsFromArgs(args); - const joined = "(" + (opts.capture ? "" : "?:") + args.map((x4) => source(x4)).join("|") + ")"; + const joined = "(" + (opts.capture ? "" : "?:") + args.map((x3) => source(x3)).join("|") + ")"; return joined; } - var keywordWrapper = (keyword) => concat3(/\b/, keyword, /\w$/.test(keyword) ? /\b/ : /\B/); + var keywordWrapper = (keyword) => concat2(/\b/, keyword, /\w$/.test(keyword) ? /\b/ : /\B/); var dotKeywords = [ "Protocol", "Type" @@ -380883,15 +304534,15 @@ var require_swift2 = __commonJS((exports, module) => { ]; var operatorHead = either(/[/=\-+!*%<>&|^~?]/, /[\u00A1-\u00A7]/, /[\u00A9\u00AB]/, /[\u00AC\u00AE]/, /[\u00B0\u00B1]/, /[\u00B6\u00BB\u00BF\u00D7\u00F7]/, /[\u2016-\u2017]/, /[\u2020-\u2027]/, /[\u2030-\u203E]/, /[\u2041-\u2053]/, /[\u2055-\u205E]/, /[\u2190-\u23FF]/, /[\u2500-\u2775]/, /[\u2794-\u2BFF]/, /[\u2E00-\u2E7F]/, /[\u3001-\u3003]/, /[\u3008-\u3020]/, /[\u3030]/); var operatorCharacter = either(operatorHead, /[\u0300-\u036F]/, /[\u1DC0-\u1DFF]/, /[\u20D0-\u20FF]/, /[\uFE00-\uFE0F]/, /[\uFE20-\uFE2F]/); - var operator = concat3(operatorHead, operatorCharacter, "*"); + var operator = concat2(operatorHead, operatorCharacter, "*"); var identifierHead = either(/[a-zA-Z_]/, /[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/, /[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/, /[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/, /[\u1E00-\u1FFF]/, /[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/, /[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/, /[\u2C00-\u2DFF\u2E80-\u2FFF]/, /[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/, /[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/, /[\uFE47-\uFEFE\uFF00-\uFFFD]/); var identifierCharacter = either(identifierHead, /\d/, /[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/); - var identifier = concat3(identifierHead, identifierCharacter, "*"); - var typeIdentifier = concat3(/[A-Z]/, identifierCharacter, "*"); + var identifier = concat2(identifierHead, identifierCharacter, "*"); + var typeIdentifier = concat2(/[A-Z]/, identifierCharacter, "*"); var keywordAttributes = [ "attached", "autoclosure", - concat3(/convention\(/, either("swift", "block", "c"), /\)/), + concat2(/convention\(/, either("swift", "block", "c"), /\)/), "discardableResult", "dynamicCallable", "dynamicMemberLookup", @@ -380910,7 +304561,7 @@ var require_swift2 = __commonJS((exports, module) => { "NSApplicationMain", "NSCopying", "NSManaged", - concat3(/objc\(/, identifier, /\)/), + concat2(/objc\(/, identifier, /\)/), "objc", "objcMembers", "propertyWrapper", @@ -380955,7 +304606,7 @@ var require_swift2 = __commonJS((exports, module) => { className: { 2: "keyword" } }; const KEYWORD_GUARD = { - match: concat3(/\./, either(...keywords)), + match: concat2(/\./, either(...keywords)), relevance: 0 }; const PLAIN_KEYWORDS = keywords.filter((kw) => typeof kw === "string").concat(["_|0"]); @@ -380977,12 +304628,12 @@ var require_swift2 = __commonJS((exports, module) => { KEYWORD ]; const BUILT_IN_GUARD = { - match: concat3(/\./, either(...builtIns)), + match: concat2(/\./, either(...builtIns)), relevance: 0 }; const BUILT_IN = { className: "built_in", - match: concat3(/\b/, either(...builtIns), /(?=\()/) + match: concat2(/\b/, either(...builtIns), /(?=\()/) }; const BUILT_INS = [ BUILT_IN_GUARD, @@ -381021,23 +304672,23 @@ var require_swift2 = __commonJS((exports, module) => { const ESCAPED_CHARACTER = (rawDelimiter = "") => ({ className: "subst", variants: [ - { match: concat3(/\\/, rawDelimiter, /[0\\tnr"']/) }, - { match: concat3(/\\/, rawDelimiter, /u\{[0-9a-fA-F]{1,8}\}/) } + { match: concat2(/\\/, rawDelimiter, /[0\\tnr"']/) }, + { match: concat2(/\\/, rawDelimiter, /u\{[0-9a-fA-F]{1,8}\}/) } ] }); const ESCAPED_NEWLINE = (rawDelimiter = "") => ({ className: "subst", - match: concat3(/\\/, rawDelimiter, /[\t ]*(?:[\r\n]|\r\n)/) + match: concat2(/\\/, rawDelimiter, /[\t ]*(?:[\r\n]|\r\n)/) }); const INTERPOLATION = (rawDelimiter = "") => ({ className: "subst", label: "interpol", - begin: concat3(/\\/, rawDelimiter, /\(/), + begin: concat2(/\\/, rawDelimiter, /\(/), end: /\)/ }); const MULTILINE_STRING = (rawDelimiter = "") => ({ - begin: concat3(rawDelimiter, /"""/), - end: concat3(/"""/, rawDelimiter), + begin: concat2(rawDelimiter, /"""/), + end: concat2(/"""/, rawDelimiter), contains: [ ESCAPED_CHARACTER(rawDelimiter), ESCAPED_NEWLINE(rawDelimiter), @@ -381045,8 +304696,8 @@ var require_swift2 = __commonJS((exports, module) => { ] }); const SINGLE_LINE_STRING = (rawDelimiter = "") => ({ - begin: concat3(rawDelimiter, /"/), - end: concat3(/"/, rawDelimiter), + begin: concat2(rawDelimiter, /"/), + end: concat2(/"/, rawDelimiter), contains: [ ESCAPED_CHARACTER(rawDelimiter), INTERPOLATION(rawDelimiter) @@ -381080,8 +304731,8 @@ var require_swift2 = __commonJS((exports, module) => { contains: REGEXP_CONTENTS }; const EXTENDED_REGEXP_LITERAL = (rawDelimiter) => { - const begin = concat3(rawDelimiter, /\//); - const end = concat3(/\//, rawDelimiter); + const begin = concat2(rawDelimiter, /\//); + const end = concat2(/\//, rawDelimiter); return { begin, end, @@ -381104,7 +304755,7 @@ var require_swift2 = __commonJS((exports, module) => { BARE_REGEXP_LITERAL ] }; - const QUOTED_IDENTIFIER = { match: concat3(/`/, identifier, /`/) }; + const QUOTED_IDENTIFIER = { match: concat2(/`/, identifier, /`/) }; const IMPLICIT_PARAMETER = { className: "variable", match: /\$\d+/ @@ -381136,11 +304787,11 @@ var require_swift2 = __commonJS((exports, module) => { }; const KEYWORD_ATTRIBUTE = { scope: "keyword", - match: concat3(/@/, either(...keywordAttributes), lookahead(either(/\(/, /\s+/))) + match: concat2(/@/, either(...keywordAttributes), lookahead(either(/\(/, /\s+/))) }; const USER_DEFINED_ATTRIBUTE = { scope: "meta", - match: concat3(/@/, identifier) + match: concat2(/@/, identifier) }; const ATTRIBUTES = [ AVAILABLE_ATTRIBUTE, @@ -381153,7 +304804,7 @@ var require_swift2 = __commonJS((exports, module) => { contains: [ { className: "type", - match: concat3(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, "+") + match: concat2(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, identifierCharacter, "+") }, { className: "type", @@ -381169,7 +304820,7 @@ var require_swift2 = __commonJS((exports, module) => { relevance: 0 }, { - match: concat3(/\s+&\s+/, lookahead(typeIdentifier)), + match: concat2(/\s+&\s+/, lookahead(typeIdentifier)), relevance: 0 } ] @@ -381188,7 +304839,7 @@ var require_swift2 = __commonJS((exports, module) => { }; TYPE.contains.push(GENERIC_ARGUMENTS); const TUPLE_ELEMENT_NAME = { - match: concat3(identifier, /\s*:/), + match: concat2(identifier, /\s*:/), keywords: "_|0", relevance: 0 }; @@ -381222,7 +304873,7 @@ var require_swift2 = __commonJS((exports, module) => { ] }; const FUNCTION_PARAMETER_NAME = { - begin: either(lookahead(concat3(identifier, /\s*:/)), lookahead(concat3(identifier, /\s+/, identifier, /\s*:/))), + begin: either(lookahead(concat2(identifier, /\s*:/)), lookahead(concat2(identifier, /\s+/, identifier, /\s*:/))), end: /:/, relevance: 0, contains: [ @@ -381661,7 +305312,7 @@ var require_yaml2 = __commonJS((exports, module) => { // node_modules/highlight.js/lib/languages/tap.js var require_tap2 = __commonJS((exports, module) => { - function tap3(hljs) { + function tap2(hljs) { return { name: "Test Anything Protocol", case_insensitive: true, @@ -381694,7 +305345,7 @@ var require_tap2 = __commonJS((exports, module) => { ] }; } - module.exports = tap3; + module.exports = tap2; }); // node_modules/highlight.js/lib/languages/tcl.js @@ -382485,9 +306136,9 @@ var require_typescript2 = __commonJS((exports, module) => { var BUILT_INS = [].concat(BUILT_IN_GLOBALS, TYPES, ERROR_TYPES); function javascript(hljs) { const regex2 = hljs.regex; - const hasClosingTag = (match, { after: after3 }) => { + const hasClosingTag = (match, { after: after2 }) => { const tag2 = " { ...BUILT_IN_GLOBALS, "super", "import" - ].map((x4) => `${x4}\\s*\\(`)), IDENT_RE$1, regex2.lookahead(/\s*\(/)), + ].map((x3) => `${x3}\\s*\\(`)), IDENT_RE$1, regex2.lookahead(/\s*\(/)), className: "title.function", relevance: 0 }; @@ -385307,7 +308958,7 @@ var require_zephir2 = __commonJS((exports, module) => { }); // node_modules/highlight.js/lib/index.js -var require_lib8 = __commonJS((exports, module) => { +var require_lib6 = __commonJS((exports, module) => { var hljs = require_core4(); hljs.registerLanguage("1c", require_1c2()); hljs.registerLanguage("abnf", require_abnf2()); @@ -385514,7 +309165,7 @@ __export(exports_es, { }); var import_lib, es_default2; var init_es2 = __esm(() => { - import_lib = __toESM(require_lib8(), 1); + import_lib = __toESM(require_lib6(), 1); es_default2 = import_lib.default; }); @@ -385522,7 +309173,7 @@ var init_es2 = __esm(() => { import { extname as extname5 } from "path"; async function loadCliHighlight() { try { - const cliHighlight = await Promise.resolve().then(() => __toESM(require_dist11(), 1)); + const cliHighlight = await Promise.resolve().then(() => __toESM(require_dist7(), 1)); const highlightJs = await Promise.resolve().then(() => (init_es2(), exports_es)); loadedGetLanguage = highlightJs.getLanguage; return { @@ -385550,29 +309201,29 @@ var init_cliHighlight = () => {}; // src/utils/taggedId.ts function base58Encode(n2) { const base2 = BigInt(BASE_58_CHARS.length); - const result3 = new Array(ENCODED_LENGTH).fill(BASE_58_CHARS[0]); - let i4 = ENCODED_LENGTH - 1; + const result2 = new Array(ENCODED_LENGTH).fill(BASE_58_CHARS[0]); + let i3 = ENCODED_LENGTH - 1; let value = n2; while (value > 0n) { const rem = Number(value % base2); - result3[i4] = BASE_58_CHARS[rem]; + result2[i3] = BASE_58_CHARS[rem]; value = value / base2; - i4--; + i3--; } - return result3.join(""); + return result2.join(""); } -function uuidToBigInt(uuid5) { - const hex = uuid5.replace(/-/g, ""); +function uuidToBigInt(uuid3) { + const hex = uuid3.replace(/-/g, ""); if (hex.length !== 32) { throw new Error(`Invalid UUID hex length: ${hex.length}`); } return BigInt("0x" + hex); } -function toTaggedId(tag2, uuid5) { - const n2 = uuidToBigInt(uuid5); - return `${tag2}_${VERSION7}${base58Encode(n2)}`; +function toTaggedId(tag2, uuid3) { + const n2 = uuidToBigInt(uuid3); + return `${tag2}_${VERSION5}${base58Encode(n2)}`; } -var BASE_58_CHARS = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", VERSION7 = "01", ENCODED_LENGTH = 22; +var BASE_58_CHARS = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", VERSION5 = "01", ENCODED_LENGTH = 22; // src/utils/telemetryAttributes.ts function shouldIncludeAttribute(envVar) { @@ -385617,7 +309268,7 @@ function getTelemetryAttributes() { var METRICS_CARDINALITY_DEFAULTS; var init_telemetryAttributes = __esm(() => { init_state(); - init_auth2(); + init_auth(); init_config2(); init_envDynamic(); init_envUtils(); @@ -385681,10 +309332,10 @@ var init_events = __esm(() => { function isCodeEditingTool(toolName) { return CODE_EDITING_TOOLS.includes(toolName); } -async function buildCodeEditToolAttributes(tool, input3, decision, source) { +async function buildCodeEditToolAttributes(tool, input, decision, source) { let language; - if (tool.getPath && input3) { - const parseResult = tool.inputSchema.safeParse(input3); + if (tool.getPath && input) { + const parseResult = tool.inputSchema.safeParse(input); if (parseResult.success) { const filePath = tool.getPath(parseResult.data); if (filePath) { @@ -385760,7 +309411,7 @@ function logRejectionEvent(tool, messageId, source, waitMs) { }); } function logPermissionDecision(ctx, args, permissionPromptStartTimeMs) { - const { tool, input: input3, toolUseContext, messageId, toolUseID } = ctx; + const { tool, input, toolUseContext, messageId, toolUseID } = ctx; const { decision, source } = args; const waiting_for_user_permission_ms = permissionPromptStartTimeMs !== undefined ? Date.now() - permissionPromptStartTimeMs : undefined; if (args.decision === "accept") { @@ -385770,7 +309421,7 @@ function logPermissionDecision(ctx, args, permissionPromptStartTimeMs) { } const sourceString = source === "config" ? "config" : sourceToString(source); if (isCodeEditingTool(tool.name)) { - buildCodeEditToolAttributes(tool, input3, decision, sourceString).then((attributes) => getCodeEditToolDecisionCounter()?.add(1, attributes)); + buildCodeEditToolAttributes(tool, input, decision, sourceString).then((attributes) => getCodeEditToolDecisionCounter()?.add(1, attributes)); } if (!toolUseContext.toolDecisions) { toolUseContext.toolDecisions = new Map; @@ -385837,23 +309488,23 @@ function byteAt(L2, charIdx) { return L2.byteTable[charIdx]; const t = new Uint32Array(L2.len + 1); let b = 0; - let i4 = 0; - while (i4 < L2.len) { - t[i4] = b; - const c6 = L2.src.charCodeAt(i4); + let i3 = 0; + while (i3 < L2.len) { + t[i3] = b; + const c6 = L2.src.charCodeAt(i3); if (c6 < 128) { b++; - i4++; + i3++; } else if (c6 < 2048) { b += 2; - i4++; + i3++; } else if (c6 >= 55296 && c6 <= 56319) { - t[i4 + 1] = b + 2; + t[i3 + 1] = b + 2; b += 4; - i4 += 2; + i3 += 2; } else { b += 3; - i4++; + i3++; } } t[L2.len] = b; @@ -386143,8 +309794,8 @@ function nextToken(L2, ctx = "arg") { let j = L2.i; while (j < L2.len && isDigit2(L2.src[j])) j++; - const after3 = j < L2.len ? L2.src[j] : ""; - if (after3 === ">" || after3 === "<") { + const after2 = j < L2.len ? L2.src[j] : ""; + if (after2 === ">" || after2 === "<") { const si = L2.i; while (L2.i < j) advance(L2); @@ -386215,15 +309866,15 @@ function parseSource(source, timeoutMs) { } function byteLengthUtf8(s) { let b = 0; - for (let i4 = 0;i4 < s.length; i4++) { - const c6 = s.charCodeAt(i4); + for (let i3 = 0;i3 < s.length; i3++) { + const c6 = s.charCodeAt(i3); if (c6 < 128) b++; else if (c6 < 2048) b += 2; else if (c6 >= 55296 && c6 <= 56319) { b += 4; - i4++; + i3++; } else b += 3; } @@ -386373,16 +310024,16 @@ function parseStatements(P, terminator) { out.push(stmt); skipBlanks(P.L); const save2 = saveLex(P.L); - const sep13 = nextToken(P.L, "cmd"); - if (sep13.type === "OP" && (sep13.value === ";" || sep13.value === "&")) { + const sep10 = nextToken(P.L, "cmd"); + if (sep10.type === "OP" && (sep10.value === ";" || sep10.value === "&")) { const save3 = saveLex(P.L); - const after3 = nextToken(P.L, "cmd"); + const after2 = nextToken(P.L, "cmd"); restoreLex(P.L, save3); - out.push(leaf(P, sep13.value, sep13)); - if (after3.type === "EOF" || after3.type === "OP" && (after3.value === ")" || after3.value === "}" || after3.value === ";;" || after3.value === ";&" || after3.value === ";;&") || after3.type === "WORD" && (after3.value === "then" || after3.value === "elif" || after3.value === "else" || after3.value === "fi" || after3.value === "do" || after3.value === "done" || after3.value === "esac")) { + out.push(leaf(P, sep10.value, sep10)); + if (after2.type === "EOF" || after2.type === "OP" && (after2.value === ")" || after2.value === "}" || after2.value === ";;" || after2.value === ";&" || after2.value === ";;&") || after2.type === "WORD" && (after2.value === "then" || after2.value === "elif" || after2.value === "else" || after2.value === "fi" || after2.value === "do" || after2.value === "done" || after2.value === "esac")) { continue; } - } else if (sep13.type === "NEWLINE") { + } else if (sep10.type === "NEWLINE") { if (P.L.heredocs.length > 0) { scanHeredocBodies(P); } @@ -386474,8 +310125,8 @@ function parsePipeline(P) { } if (parts.length === 1) return parts[0]; - const last3 = parts[parts.length - 1]; - return mk(P, "pipeline", parts[0].startIndex, last3.endIndex, parts); + const last2 = parts[parts.length - 1]; + return mk(P, "pipeline", parts[0].startIndex, last2.endIndex, parts); } function parseCommand2(P) { skipBlanks(P.L); @@ -386624,17 +310275,17 @@ function parseSimpleCommand(P) { return assignments[0]; } if (preRedirects.length > 0 && assignments.length === 0) { - const last3 = preRedirects[preRedirects.length - 1]; - return mk(P, "redirected_statement", preRedirects[0].startIndex, last3.endIndex, preRedirects); + const last2 = preRedirects[preRedirects.length - 1]; + return mk(P, "redirected_statement", preRedirects[0].startIndex, last2.endIndex, preRedirects); } if (assignments.length > 1 && preRedirects.length === 0) { - const last3 = assignments[assignments.length - 1]; - return mk(P, "variable_assignments", assignments[0].startIndex, last3.endIndex, assignments); + const last2 = assignments[assignments.length - 1]; + return mk(P, "variable_assignments", assignments[0].startIndex, last2.endIndex, assignments); } if (assignments.length > 0 || preRedirects.length > 0) { const all3 = [...assignments, ...preRedirects]; - const last3 = all3[all3.length - 1]; - return mk(P, "command", start, last3.endIndex, all3); + const last2 = all3[all3.length - 1]; + return mk(P, "command", start, last2.endIndex, all3); } return null; } @@ -386656,8 +310307,8 @@ function parseSimpleCommand(P) { if (body.type === "redirected_statement" && body.children.length >= 2 && body.children[0].type === "compound_statement") { bodyKids = body.children; } - const last3 = bodyKids[bodyKids.length - 1]; - return mk(P, "function_definition", nm.startIndex, last3.endIndex, [ + const last2 = bodyKids[bodyKids.length - 1]; + return mk(P, "function_definition", nm.startIndex, last2.endIndex, [ nm, oParen, cParen, @@ -386752,8 +310403,8 @@ function parseSimpleCommand(P) { ]); } if (redirects.length > 0) { - const last3 = redirects[redirects.length - 1]; - return mk(P, "redirected_statement", cmd.startIndex, last3.endIndex, [ + const last2 = redirects[redirects.length - 1]; + return mk(P, "redirected_statement", cmd.startIndex, last2.endIndex, [ cmd, ...redirects ]); @@ -386776,8 +310427,8 @@ function maybeRedirect(P, node, allowHerestring = false) { } if (redirects.length === 0) return node; - const last3 = redirects[redirects.length - 1]; - return mk(P, "redirected_statement", node.startIndex, last3.endIndex, [ + const last2 = redirects[redirects.length - 1]; + return mk(P, "redirected_statement", node.startIndex, last2.endIndex, [ node, ...redirects ]); @@ -386891,16 +310542,16 @@ function parseSubscriptIndexInline(P) { return parseArithExpr(P, "]", "word"); } function parseSubscriptIndex(P, startB, endB) { - const text2 = sliceBytes(P, startB, endB); - if (/^\d+$/.test(text2)) + const text = sliceBytes(P, startB, endB); + if (/^\d+$/.test(text)) return mk(P, "number", startB, endB, []); - const m = /^\$([a-zA-Z_]\w*)$/.exec(text2); + const m = /^\$([a-zA-Z_]\w*)$/.exec(text); if (m) { const dollar = mk(P, "$", startB, startB + 1, []); const vn = mk(P, "variable_name", startB + 1, endB, []); return mk(P, "simple_expansion", startB, endB, [dollar, vn]); } - if (text2.length === 2 && text2[0] === "$" && SPECIAL_VARS.has(text2[1])) { + if (text.length === 2 && text[0] === "$" && SPECIAL_VARS.has(text[1])) { const dollar = mk(P, "$", startB, startB + 1, []); const vn = mk(P, "special_variable_name", startB + 1, endB, []); return mk(P, "simple_expansion", startB, endB, [dollar, vn]); @@ -386921,8 +310572,8 @@ function isRedirectLiteralStart(P) { let j = P.L.i; while (j < P.L.len && isDigit2(P.L.src[j])) j++; - const after3 = j < P.L.len ? P.L.src[j] : ""; - if (after3 === ">" || after3 === "<") + const after2 = j < P.L.len ? P.L.src[j] : ""; + if (after2 === ">" || after2 === "<") return false; } if (c6 === "}") @@ -386934,17 +310585,17 @@ function isRedirectLiteralStart(P) { function tryParseRedirect(P, greedy = false) { const save = saveLex(P.L); skipBlanks(P.L); - let fd3 = null; + let fd2 = null; if (isDigit2(peek2(P.L))) { const startB = P.L.b; let j = P.L.i; while (j < P.L.len && isDigit2(P.L.src[j])) j++; - const after3 = j < P.L.len ? P.L.src[j] : ""; - if (after3 === ">" || after3 === "<") { + const after2 = j < P.L.len ? P.L.src[j] : ""; + if (after2 === ">" || after2 === "<") { while (P.L.i < j) advance(P.L); - fd3 = mk(P, "file_descriptor", startB, P.L.b, []); + fd2 = mk(P, "file_descriptor", startB, P.L.b, []); } } const t = nextToken(P.L, "arg"); @@ -386959,7 +310610,7 @@ function tryParseRedirect(P, greedy = false) { const target = parseWord(P, "arg"); const end = target ? target.endIndex : op.endIndex; const kids = target ? [op, target] : [op]; - return mk(P, "herestring_redirect", fd3 ? fd3.startIndex : op.startIndex, end, fd3 ? [fd3, ...kids] : kids); + return mk(P, "herestring_redirect", fd2 ? fd2.startIndex : op.startIndex, end, fd2 ? [fd2, ...kids] : kids); } if (v === "<<" || v === "<<-") { const op = leaf(P, v, t); @@ -387006,8 +310657,8 @@ function tryParseRedirect(P, greedy = false) { endStart: 0, endEnd: 0 }); - const kids = fd3 ? [fd3, op, startNode] : [op, startNode]; - const startIdx = fd3 ? fd3.startIndex : op.startIndex; + const kids = fd2 ? [fd2, op, startNode] : [op, startNode]; + const startIdx = fd2 ? fd2.startIndex : op.startIndex; while (true) { skipBlanks(P.L); const tc = peek2(P.L); @@ -387083,8 +310734,8 @@ function tryParseRedirect(P, greedy = false) { if (v === "<&-" || v === ">&-") { const op = leaf(P, v, t); const kids = []; - if (fd3) - kids.push(fd3); + if (fd2) + kids.push(fd2); kids.push(op); skipBlanks(P.L); const dSave = saveLex(P.L); @@ -387094,15 +310745,15 @@ function tryParseRedirect(P, greedy = false) { } else { restoreLex(P.L, dSave); } - const startIdx = fd3 ? fd3.startIndex : op.startIndex; + const startIdx = fd2 ? fd2.startIndex : op.startIndex; const end = dest ? dest.endIndex : op.endIndex; return mk(P, "file_redirect", startIdx, end, kids); } if (v === ">" || v === ">>" || v === ">&" || v === ">|" || v === "&>" || v === "&>>" || v === "<" || v === "<&") { const op = leaf(P, v, t); const kids = []; - if (fd3) - kids.push(fd3); + if (fd2) + kids.push(fd2); kids.push(op); let end = op.endIndex; let taken = 0; @@ -387126,7 +310777,7 @@ function tryParseRedirect(P, greedy = false) { end = target.endIndex; taken++; } - const startIdx = fd3 ? fd3.startIndex : op.startIndex; + const startIdx = fd2 ? fd2.startIndex : op.startIndex; return mk(P, "file_redirect", startIdx, end, kids); } restoreLex(P.L, save); @@ -387366,8 +311017,8 @@ function parseWord(P, _ctx) { if (parts.length === 1) return parts[0]; const first = parts[0]; - const last3 = parts[parts.length - 1]; - return mk(P, "concatenation", first.startIndex, last3.endIndex, parts); + const last2 = parts[parts.length - 1]; + return mk(P, "concatenation", first.startIndex, last2.endIndex, parts); } function parseBareWord(P) { const start = P.L.b; @@ -387396,8 +311047,8 @@ function parseBareWord(P) { } if (P.L.b === start) return null; - const text2 = P.src.slice(startI, P.L.i); - const type = /^-?\d+$/.test(text2) ? "number" : "word"; + const text = P.src.slice(startI, P.L.i); + const type = /^-?\d+$/.test(text) ? "number" : "word"; return mk(P, type, start, P.L.b, []); } function tryParseBraceExpr(P) { @@ -387844,9 +311495,9 @@ function parseExpansionBody(P) { } if (peek2(P.L) === '"') { out.push(parseDoubleQuoted(P)); - const tail3 = parseExpansionRest(P, "regex", true); - if (tail3) - out.push(tail3); + const tail2 = parseExpansionRest(P, "regex", true); + if (tail2) + out.push(tail2); } else { const regex2 = parseExpansionRest(P, "regex", true); if (regex2) @@ -387870,9 +311521,9 @@ function parseExpansionBody(P) { for (const p of parseExpansionRegexSegmented(P)) out.push(p); } else { - const rest3 = parseExpansionRest(P, isPattern ? "regex" : "word", false); - if (rest3) - out.push(rest3); + const rest2 = parseExpansionRest(P, isPattern ? "regex" : "word", false); + if (rest2) + out.push(rest2); } } return out; @@ -388099,8 +311750,8 @@ function parseExpansionRest(P, nodeType, stopAtSlash) { return null; if (parts.length === 1) return parts[0]; - const last3 = parts[parts.length - 1]; - return mk(P, "concatenation", parts[0].startIndex, last3.endIndex, parts); + const last2 = parts[parts.length - 1]; + return mk(P, "concatenation", parts[0].startIndex, last2.endIndex, parts); } function parseExpansionRegexSegmented(P) { const out = []; @@ -388203,10 +311854,10 @@ function parseBacktick(P) { if (peek2(P.L) === "`") break; const save2 = saveLex(P.L); - const sep13 = nextToken(P.L, "cmd"); - if (sep13.type === "OP" && (sep13.value === ";" || sep13.value === "&")) { - body.push(leaf(P, sep13.value, sep13)); - } else if (sep13.type !== "NEWLINE") { + const sep10 = nextToken(P.L, "cmd"); + if (sep10.type === "OP" && (sep10.value === ";" || sep10.value === "&")) { + body.push(leaf(P, sep10.value, sep10)); + } else if (sep10.type !== "NEWLINE") { restoreLex(P.L, save2); } } @@ -388230,8 +311881,8 @@ function parseBacktick(P) { function parseIf(P, ifTok) { const ifKw = leaf(P, "if", ifTok); const kids = [ifKw]; - const cond3 = parseStatements(P, null); - kids.push(...cond3); + const cond2 = parseStatements(P, null); + kids.push(...cond2); consumeKeyword(P, "then", kids); const body = parseStatements(P, null); kids.push(...body); @@ -388245,32 +311896,32 @@ function parseIf(P, ifTok) { consumeKeyword(P, "then", eKids); const eBody = parseStatements(P, null); eKids.push(...eBody); - const last4 = eKids[eKids.length - 1]; - kids.push(mk(P, "elif_clause", eKw.startIndex, last4.endIndex, eKids)); + const last3 = eKids[eKids.length - 1]; + kids.push(mk(P, "elif_clause", eKw.startIndex, last3.endIndex, eKids)); } else if (t.type === "WORD" && t.value === "else") { const elKw = leaf(P, "else", t); const elBody = parseStatements(P, null); - const last4 = elBody.length > 0 ? elBody[elBody.length - 1] : elKw; - kids.push(mk(P, "else_clause", elKw.startIndex, last4.endIndex, [elKw, ...elBody])); + const last3 = elBody.length > 0 ? elBody[elBody.length - 1] : elKw; + kids.push(mk(P, "else_clause", elKw.startIndex, last3.endIndex, [elKw, ...elBody])); } else { restoreLex(P.L, save); break; } } consumeKeyword(P, "fi", kids); - const last3 = kids[kids.length - 1]; - return mk(P, "if_statement", ifKw.startIndex, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "if_statement", ifKw.startIndex, last2.endIndex, kids); } function parseWhile(P, kwTok) { const kw = leaf(P, kwTok.value, kwTok); const kids = [kw]; - const cond3 = parseStatements(P, null); - kids.push(...cond3); + const cond2 = parseStatements(P, null); + kids.push(...cond2); const dg = parseDoGroup(P); if (dg) kids.push(dg); - const last3 = kids[kids.length - 1]; - return mk(P, "while_statement", kw.startIndex, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "while_statement", kw.startIndex, last2.endIndex, kids); } function parseFor(P, forTok) { const forKw = leaf(P, forTok.value, forTok); @@ -388301,10 +311952,10 @@ function parseFor(P, forTok) { kids2.push(mk(P, "))", cStart, P.L.b, [])); } const save3 = saveLex(P.L); - const sep14 = nextToken(P.L, "cmd"); - if (sep14.type === "OP" && sep14.value === ";") { - kids2.push(leaf(P, ";", sep14)); - } else if (sep14.type !== "NEWLINE") { + const sep11 = nextToken(P.L, "cmd"); + if (sep11.type === "OP" && sep11.value === ";") { + kids2.push(leaf(P, ";", sep11)); + } else if (sep11.type !== "NEWLINE") { restoreLex(P.L, save3); } const dg2 = parseDoGroup(P); @@ -388333,8 +311984,8 @@ function parseFor(P, forTok) { ])); } } - const last4 = kids2[kids2.length - 1]; - return mk(P, "c_style_for_statement", forKw.startIndex, last4.endIndex, kids2); + const last3 = kids2[kids2.length - 1]; + return mk(P, "c_style_for_statement", forKw.startIndex, last3.endIndex, kids2); } const kids = [forKw]; const varTok = nextToken(P.L, "arg"); @@ -388359,17 +312010,17 @@ function parseFor(P, forTok) { restoreLex(P.L, save); } const save2 = saveLex(P.L); - const sep13 = nextToken(P.L, "cmd"); - if (sep13.type === "OP" && sep13.value === ";") { - kids.push(leaf(P, ";", sep13)); - } else if (sep13.type !== "NEWLINE") { + const sep10 = nextToken(P.L, "cmd"); + if (sep10.type === "OP" && sep10.value === ";") { + kids.push(leaf(P, ";", sep10)); + } else if (sep10.type !== "NEWLINE") { restoreLex(P.L, save2); } const dg = parseDoGroup(P); if (dg) kids.push(dg); - const last3 = kids[kids.length - 1]; - return mk(P, "for_statement", forKw.startIndex, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "for_statement", forKw.startIndex, last2.endIndex, kids); } function parseDoGroup(P) { skipNewlines(P); @@ -388383,8 +312034,8 @@ function parseDoGroup(P) { const body = parseStatements(P, null); const kids = [doKw, ...body]; consumeKeyword(P, "done", kids); - const last3 = kids[kids.length - 1]; - return mk(P, "do_group", doKw.startIndex, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "do_group", doKw.startIndex, last2.endIndex, kids); } function parseCase(P, caseTok) { const caseKw = leaf(P, "case", caseTok); @@ -388413,8 +312064,8 @@ function parseCase(P, caseTok) { break; kids.push(item); } - const last3 = kids[kids.length - 1]; - return mk(P, "case_statement", caseKw.startIndex, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "case_statement", caseKw.startIndex, last2.endIndex, kids); } function parseCaseItem(P) { skipBlanks(P.L); @@ -388437,8 +312088,8 @@ function parseCaseItem(P) { if (!isFirstAlt && pats.length > 1) { const rewritten = pats.map((p) => p.type === "extglob_pattern" ? mk(P, "word", p.startIndex, p.endIndex, []) : p); const first = rewritten[0]; - const last4 = rewritten[rewritten.length - 1]; - kids.push(mk(P, "concatenation", first.startIndex, last4.endIndex, rewritten)); + const last3 = rewritten[rewritten.length - 1]; + kids.push(mk(P, "concatenation", first.startIndex, last3.endIndex, rewritten)); } else { kids.push(...pats); } @@ -388480,18 +312131,18 @@ function parseCaseItem(P) { if (kids.length === 0) return null; if (body.length === 0) { - for (let i4 = 0;i4 < kids.length; i4++) { - const k = kids[i4]; + for (let i3 = 0;i3 < kids.length; i3++) { + const k = kids[i3]; if (k.type !== "extglob_pattern") continue; - const text2 = sliceBytes(P, k.startIndex, k.endIndex); - if (/^[-+?*@!][a-zA-Z]/.test(text2) && !/[*?(]/.test(text2)) { - kids[i4] = mk(P, "word", k.startIndex, k.endIndex, []); + const text = sliceBytes(P, k.startIndex, k.endIndex); + if (/^[-+?*@!][a-zA-Z]/.test(text) && !/[*?(]/.test(text)) { + kids[i3] = mk(P, "word", k.startIndex, k.endIndex, []); } } } - const last3 = kids[kids.length - 1]; - return mk(P, "case_item", start, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "case_item", start, last2.endIndex, kids); } function parseCasePattern(P) { skipBlanks(P.L); @@ -388549,8 +312200,8 @@ function parseCasePattern(P) { } if (P.L.b === start) return []; - const text2 = P.src.slice(startI, P.L.i); - const hasExtglobParen = /[*?+@!]\(/.test(text2); + const text = P.src.slice(startI, P.L.i); + const hasExtglobParen = /[*?+@!]\(/.test(text); if (hasQuote && !hasExtglobParen) { restoreLex(P.L, save); return parseCasePatternSegmented(P); @@ -388560,7 +312211,7 @@ function parseCasePattern(P) { const w = parseWord(P, "arg"); return w ? [w] : []; } - const type = hasExtglobParen || /[*?]/.test(text2) || /^[-+?*@!][a-zA-Z]/.test(text2) ? "extglob_pattern" : "word"; + const type = hasExtglobParen || /[*?]/.test(text) || /^[-+?*@!][a-zA-Z]/.test(text) ? "extglob_pattern" : "word"; return [mk(P, type, start, P.L.b, [])]; } function parseCasePatternSegmented(P) { @@ -388627,8 +312278,8 @@ function parseFunction(P, fnTok) { kids.push(body); } } - const last3 = kids[kids.length - 1]; - return mk(P, "function_definition", fnKw.startIndex, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "function_definition", fnKw.startIndex, last2.endIndex, kids); } function parseDeclaration(P, kwTok) { const kw = leaf(P, kwTok.value, kwTok); @@ -388668,8 +312319,8 @@ function parseDeclaration(P, kwTok) { break; } } - const last3 = kids[kids.length - 1]; - return mk(P, "declaration_command", kw.startIndex, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "declaration_command", kw.startIndex, last2.endIndex, kids); } function parseUnset(P, kwTok) { const kw = leaf(P, "unset", kwTok); @@ -388694,8 +312345,8 @@ function parseUnset(P, kwTok) { kids.push(arg); } } - const last3 = kids[kids.length - 1]; - return mk(P, "unset_command", kw.startIndex, last3.endIndex, kids); + const last2 = kids[kids.length - 1]; + return mk(P, "unset_command", kw.startIndex, last2.endIndex, kids); } function consumeKeyword(P, name, kids) { skipNewlines(P); @@ -388823,33 +312474,33 @@ function parseTestBinary(P, closer) { const c6 = peek2(P.L); const c1 = peek2(P.L, 1); let op = null; - const os4 = P.L.b; + const os3 = P.L.b; if (c6 === "=" && c1 === "=") { advance(P.L); advance(P.L); - op = mk(P, "==", os4, P.L.b, []); + op = mk(P, "==", os3, P.L.b, []); } else if (c6 === "!" && c1 === "=") { advance(P.L); advance(P.L); - op = mk(P, "!=", os4, P.L.b, []); + op = mk(P, "!=", os3, P.L.b, []); } else if (c6 === "=" && c1 === "~") { advance(P.L); advance(P.L); - op = mk(P, "=~", os4, P.L.b, []); + op = mk(P, "=~", os3, P.L.b, []); } else if (c6 === "=" && c1 !== "=") { advance(P.L); - op = mk(P, "=", os4, P.L.b, []); + op = mk(P, "=", os3, P.L.b, []); } else if (c6 === "<" && c1 !== "<") { advance(P.L); - op = mk(P, "<", os4, P.L.b, []); + op = mk(P, "<", os3, P.L.b, []); } else if (c6 === ">" && c1 !== ">") { advance(P.L); - op = mk(P, ">", os4, P.L.b, []); + op = mk(P, ">", os3, P.L.b, []); } else if (c6 === "-" && isIdentStart(c1)) { advance(P.L); while (isIdentChar(peek2(P.L))) advance(P.L); - op = mk(P, "test_operator", os4, P.L.b, []); + op = mk(P, "test_operator", os3, P.L.b, []); } if (!op) return left; @@ -388899,8 +312550,8 @@ function parseTestBinary(P, closer) { const parts = parseTestExtglobRhs(P); if (parts.length === 0) return left; - const last3 = parts[parts.length - 1]; - return mk(P, "binary_expression", left.startIndex, last3.endIndex, [ + const last2 = parts[parts.length - 1]; + return mk(P, "binary_expression", left.startIndex, last2.endIndex, [ left, op, ...parts @@ -388969,8 +312620,8 @@ function parseTestExtglobRhs(P) { let parenDepth = 0; const flushSeg = () => { if (P.L.i > segStartI) { - const text2 = P.src.slice(segStartI, P.L.i); - const type = /^\d+$/.test(text2) ? "number" : "extglob_pattern"; + const text = P.src.slice(segStartI, P.L.i); + const type = /^\d+$/.test(text) ? "number" : "extglob_pattern"; parts.push(mk(P, type, segStart, P.L.b, [])); } }; @@ -389063,8 +312714,8 @@ function parseArithCommaList(P, stop, mode = "var") { return out; } function parseArithTernary(P, stop, mode) { - const cond3 = parseArithBinary(P, stop, 0, mode); - if (!cond3) + const cond2 = parseArithBinary(P, stop, 0, mode); + if (!cond2) return null; skipBlanks(P.L); if (peek2(P.L) === "?") { @@ -389082,16 +312733,16 @@ function parseArithTernary(P, stop, mode) { colon = mk(P, ":", P.L.b, P.L.b, []); } const f = parseArithTernary(P, stop, mode); - const last3 = f ?? colon; - const kids = [cond3, q]; + const last2 = f ?? colon; + const kids = [cond2, q]; if (t) kids.push(t); kids.push(colon); if (f) kids.push(f); - return mk(P, "ternary_expression", cond3.startIndex, last3.endIndex, kids); + return mk(P, "ternary_expression", cond2.startIndex, last2.endIndex, kids); } - return cond3; + return cond2; } function scanArithOp(P) { const c6 = peek2(P.L); @@ -389176,10 +312827,10 @@ function parseArithBinary(P, stop, minPrec, mode) { const prec = ARITH_PREC[opText]; if (prec === undefined || prec < minPrec) break; - const os4 = P.L.b; + const os3 = P.L.b; for (let k = 0;k < opLen; k++) advance(P.L); - const op = mk(P, opText, os4, P.L.b, []); + const op = mk(P, opText, os3, P.L.b, []); const nextMin = ARITH_RIGHT_ASSOC.has(opText) ? prec : prec + 1; const right = parseArithBinary(P, stop, nextMin, mode); if (!right) @@ -389300,10 +312951,10 @@ function parseArithPrimary(P, stop, mode) { const vn = mk(P, "variable_name", s, P.L.b, []); const es = P.L.b; advance(P.L); - const eq3 = mk(P, "=", es, P.L.b, []); + const eq2 = mk(P, "=", es, P.L.b, []); const val = parseArithTernary(P, stop, mode); - const end = val ? val.endIndex : eq3.endIndex; - const kids = val ? [vn, eq3, val] : [vn, eq3]; + const end = val ? val.endIndex : eq2.endIndex; + const kids = val ? [vn, eq2, val] : [vn, eq2]; return mk(P, "variable_assignment", s, end, kids); } } @@ -389479,15 +313130,15 @@ async function parseCommandRaw(command) { if (!mod2) return null; try { - const result3 = mod2.parse(command); - if (result3 === null) { + const result2 = mod2.parse(command); + if (result2 === null) { logEvent("tengu_tree_sitter_parse_abort", { cmdLength: command.length, panic: false }); return PARSE_ABORTED; } - return result3; + return result2; } catch { logEvent("tengu_tree_sitter_parse_abort", { cmdLength: command.length, @@ -389498,18 +313149,18 @@ async function parseCommandRaw(command) { } return null; } -function findCommandNode(node, parent3) { +function findCommandNode(node, parent2) { const { type, children: children2 } = node; if (COMMAND_TYPES.has(type)) return node; - if (type === "variable_assignment" && parent3) { - return parent3.children.find((c6) => COMMAND_TYPES.has(c6.type) && c6.startIndex > node.startIndex) ?? null; + if (type === "variable_assignment" && parent2) { + return parent2.children.find((c6) => COMMAND_TYPES.has(c6.type) && c6.startIndex > node.startIndex) ?? null; } if (type === "pipeline") { for (const child of children2) { - const result3 = findCommandNode(child, node); - if (result3) - return result3; + const result2 = findCommandNode(child, node); + if (result2) + return result2; } return null; } @@ -389517,9 +313168,9 @@ function findCommandNode(node, parent3) { return children2.find((c6) => COMMAND_TYPES.has(c6.type)) ?? null; } for (const child of children2) { - const result3 = findCommandNode(child, node); - if (result3) - return result3; + const result2 = findCommandNode(child, node); + if (result2) + return result2; } return null; } @@ -389559,11 +313210,11 @@ function extractCommandArguments(commandNode) { } return args; } -function stripQuotes(text2) { - return text2.length >= 2 && (text2[0] === '"' && text2.at(-1) === '"' || text2[0] === "'" && text2.at(-1) === "'") ? text2.slice(1, -1) : text2; +function stripQuotes(text) { + return text.length >= 2 && (text[0] === '"' && text.at(-1) === '"' || text[0] === "'" && text.at(-1) === "'") ? text.slice(1, -1) : text; } var MAX_COMMAND_LENGTH = 1e4, DECLARATION_COMMANDS, ARGUMENT_TYPES, SUBSTITUTION_TYPES, COMMAND_TYPES, logged = false, PARSE_ABORTED; -var init_parser5 = __esm(() => { +var init_parser4 = __esm(() => { init_bun_bundle(); init_analytics(); init_debug(); @@ -389595,8 +313246,8 @@ function nodeTypeId(nodeType) { return -2; if (nodeType === "ERROR") return -1; - const i4 = DANGEROUS_TYPE_IDS.indexOf(nodeType); - return i4 >= 0 ? i4 + 1 : 0; + const i3 = DANGEROUS_TYPE_IDS.indexOf(nodeType); + return i3 >= 0 ? i3 + 1 : 0; } function maskBracesInQuotedContexts(cmd) { if (!cmd.includes("{")) @@ -389604,35 +313255,35 @@ function maskBracesInQuotedContexts(cmd) { const out = []; let inSingle = false; let inDouble = false; - let i4 = 0; - while (i4 < cmd.length) { - const c6 = cmd[i4]; + let i3 = 0; + while (i3 < cmd.length) { + const c6 = cmd[i3]; if (inSingle) { if (c6 === "'") inSingle = false; out.push(c6 === "{" ? " " : c6); - i4++; + i3++; } else if (inDouble) { - if (c6 === "\\" && (cmd[i4 + 1] === '"' || cmd[i4 + 1] === "\\")) { - out.push(c6, cmd[i4 + 1]); - i4 += 2; + if (c6 === "\\" && (cmd[i3 + 1] === '"' || cmd[i3 + 1] === "\\")) { + out.push(c6, cmd[i3 + 1]); + i3 += 2; } else { if (c6 === '"') inDouble = false; out.push(c6 === "{" ? " " : c6); - i4++; + i3++; } } else { - if (c6 === "\\" && i4 + 1 < cmd.length) { - out.push(c6, cmd[i4 + 1]); - i4 += 2; + if (c6 === "\\" && i3 + 1 < cmd.length) { + out.push(c6, cmd[i3 + 1]); + i3 += 2; } else { if (c6 === "'") inSingle = true; else if (c6 === '"') inDouble = true; out.push(c6); - i4++; + i3++; } } } @@ -389641,10 +313292,10 @@ function maskBracesInQuotedContexts(cmd) { async function parseForSecurity(cmd) { if (cmd === "") return { kind: "simple", commands: [] }; - const root3 = await parseCommandRaw(cmd); - return root3 === null ? { kind: "parse-unavailable" } : parseForSecurityFromAst(cmd, root3); + const root2 = await parseCommandRaw(cmd); + return root2 === null ? { kind: "parse-unavailable" } : parseForSecurityFromAst(cmd, root2); } -function parseForSecurityFromAst(cmd, root3) { +function parseForSecurityFromAst(cmd, root2) { if (CONTROL_CHAR_RE.test(cmd)) { return { kind: "too-complex", reason: "Contains control characters" }; } @@ -389679,29 +313330,29 @@ function parseForSecurityFromAst(cmd, root3) { if (trimmed === "") { return { kind: "simple", commands: [] }; } - if (root3 === PARSE_ABORTED) { + if (root2 === PARSE_ABORTED) { return { kind: "too-complex", reason: "Parser aborted (timeout or resource limit) — possible adversarial input", nodeType: "PARSE_ABORT" }; } - return walkProgram(root3); + return walkProgram(root2); } -function walkProgram(root3) { +function walkProgram(root2) { const commands = []; const varScope = new Map; - const err3 = collectCommands(root3, commands, varScope); - if (err3) - return err3; + const err2 = collectCommands(root2, commands, varScope); + if (err2) + return err2; return { kind: "simple", commands }; } function collectCommands(node, commands, varScope) { if (node.type === "command") { - const result3 = walkCommand(node, [], commands, varScope); - if (result3.kind !== "simple") - return result3; - commands.push(...result3.commands); + const result2 = walkCommand(node, [], commands, varScope); + if (result2.kind !== "simple") + return result2; + commands.push(...result2.commands); return null; } if (node.type === "redirected_statement") { @@ -389732,9 +313383,9 @@ function collectCommands(node, commands, varScope) { } continue; } - const err3 = collectCommands(child, commands, scope); - if (err3) - return err3; + const err2 = collectCommands(child, commands, scope); + if (err2) + return err2; } return null; } @@ -389824,9 +313475,9 @@ function collectCommands(node, commands, varScope) { } else if (child.type === "for" || child.type === "in" || child.type === "select" || child.type === ";") { continue; } else if (child.type === "command_substitution") { - const err3 = collectCommandSubstitution(child, commands, varScope); - if (err3) - return err3; + const err2 = collectCommandSubstitution(child, commands, varScope); + if (err2) + return err2; } else { const arg = walkArgument(child, commands, varScope); if (typeof arg !== "string") @@ -389849,9 +313500,9 @@ function collectCommands(node, commands, varScope) { continue; if (c6.type === "do" || c6.type === "done" || c6.type === ";") continue; - const err3 = collectCommands(c6, commands, bodyScope); - if (err3) - return err3; + const err2 = collectCommands(c6, commands, bodyScope); + if (err2) + return err2; } return null; } @@ -389874,9 +313525,9 @@ function collectCommands(node, commands, varScope) { continue; if (c6.type === "do" || c6.type === "done" || c6.type === ";") continue; - const err4 = collectCommands(c6, commands, bodyScope); - if (err4) - return err4; + const err3 = collectCommands(c6, commands, bodyScope); + if (err3) + return err3; } continue; } @@ -389888,20 +313539,20 @@ function collectCommands(node, commands, varScope) { if (c6.type === "elif" || c6.type === "else" || c6.type === "then" || c6.type === ";") { continue; } - const err4 = collectCommands(c6, commands, branchScope); - if (err4) - return err4; + const err3 = collectCommands(c6, commands, branchScope); + if (err3) + return err3; } continue; } const targetScope = seenThen ? new Map(varScope) : varScope; - const before3 = commands.length; - const err3 = collectCommands(child, commands, targetScope); - if (err3) - return err3; + const before2 = commands.length; + const err2 = collectCommands(child, commands, targetScope); + if (err2) + return err2; if (!seenThen) { - for (let i4 = before3;i4 < commands.length; i4++) { - const c6 = commands[i4]; + for (let i3 = before2;i3 < commands.length; i3++) { + const c6 = commands[i3]; if (c6?.argv[0] === "read") { for (const a2 of c6.argv.slice(1)) { if (!a2.startsWith("-") && /^[A-Za-z_][A-Za-z0-9_]*$/.test(a2)) { @@ -389929,9 +313580,9 @@ function collectCommands(node, commands, varScope) { continue; if (child.type === "(" || child.type === ")") continue; - const err3 = collectCommands(child, commands, innerScope); - if (err3) - return err3; + const err2 = collectCommands(child, commands, innerScope); + if (err2) + return err2; } return null; } @@ -389944,9 +313595,9 @@ function collectCommands(node, commands, varScope) { continue; if (child.type === "[" || child.type === "]") continue; - const err3 = walkTestExpr(child, argv, commands, varScope); - if (err3) - return err3; + const err2 = walkTestExpr(child, argv, commands, varScope); + if (err2) + return err2; } commands.push({ argv, envVars: [], redirects: [], text: node.text }); return null; @@ -389989,9 +313640,9 @@ function walkTestExpr(node, argv, innerCommands, varScope) { for (const c6 of node.children) { if (!c6) continue; - const err3 = walkTestExpr(c6, argv, innerCommands, varScope); - if (err3) - return err3; + const err2 = walkTestExpr(c6, argv, innerCommands, varScope); + if (err2) + return err2; } return null; } @@ -390047,26 +313698,26 @@ function walkRedirectedStatement(node, commands, varScope) { commands.push({ argv: [], envVars: [], redirects, text: node.text }); return null; } - const before3 = commands.length; - const err3 = collectCommands(innerCommand, commands, varScope); - if (err3) - return err3; - if (commands.length > before3 && redirects.length > 0) { - const last3 = commands[commands.length - 1]; - if (last3) - last3.redirects.push(...redirects); + const before2 = commands.length; + const err2 = collectCommands(innerCommand, commands, varScope); + if (err2) + return err2; + if (commands.length > before2 && redirects.length > 0) { + const last2 = commands[commands.length - 1]; + if (last2) + last2.redirects.push(...redirects); } return null; } function walkFileRedirect(node, innerCommands, varScope) { let op = null; let target = null; - let fd3; + let fd2; for (const child of node.children) { if (!child) continue; if (child.type === "file_descriptor") { - fd3 = Number(child.text); + fd2 = Number(child.text); } else if (child.type in REDIRECT_OPS) { op = REDIRECT_OPS[child.type] ?? null; } else if (child.type === "word" || child.type === "number") { @@ -390098,7 +313749,7 @@ function walkFileRedirect(node, innerCommands, varScope) { nodeType: node.type }; } - return { op, target, fd: fd3 }; + return { op, target, fd: fd2 }; } function walkHeredocRedirect(node) { let startText = null; @@ -390196,20 +313847,20 @@ function walkCommand(node, extraRedirects, innerCommands, varScope) { break; } case "herestring_redirect": { - const err3 = walkHerestringRedirect(child, innerCommands, varScope); - if (err3) - return err3; + const err2 = walkHerestringRedirect(child, innerCommands, varScope); + if (err2) + return err2; break; } default: return tooComplex(child); } } - const text2 = /\$[A-Za-z_]/.test(node.text) || node.text.includes(` + const text = /\$[A-Za-z_]/.test(node.text) || node.text.includes(` `) ? argv.map((a2) => a2 === "" || /["'\\ \t\n$`;|&<>(){}*?[\]~#]/.test(a2) ? `'${a2.replace(/'/g, "'\\''")}'` : a2).join(" ") : node.text; return { kind: "simple", - commands: [{ argv, envVars, redirects, text: text2 }] + commands: [{ argv, envVars, redirects, text }] }; } function collectCommandSubstitution(csNode, innerCommands, varScope) { @@ -390220,9 +313871,9 @@ function collectCommandSubstitution(csNode, innerCommands, varScope) { if (child.type === "$(" || child.type === "`" || child.type === ")") { continue; } - const err3 = collectCommands(child, innerCommands, innerScope); - if (err3) - return err3; + const err2 = collectCommands(child, innerCommands, innerScope); + if (err2) + return err2; } return null; } @@ -390262,21 +313913,21 @@ function walkArgument(node, innerCommands, varScope) { nodeType: "concatenation" }; } - let result3 = ""; + let result2 = ""; for (const child of node.children) { if (!child) continue; const part = walkArgument(child, innerCommands, varScope); if (typeof part !== "string") return part; - result3 += part; + result2 += part; } - return result3; + return result2; } case "arithmetic_expansion": { - const err3 = walkArithmetic(node); - if (err3) - return err3; + const err2 = walkArithmetic(node); + if (err2) + return err2; return node.text; } case "simple_expansion": { @@ -390287,7 +313938,7 @@ function walkArgument(node, innerCommands, varScope) { } } function walkString(node, innerCommands, varScope) { - let result3 = ""; + let result2 = ""; let cursor = -1; let sawDynamicPlaceholder = false; let sawLiteralContent = false; @@ -390295,7 +313946,7 @@ function walkString(node, innerCommands, varScope) { if (!child) continue; if (cursor !== -1 && child.startIndex > cursor && child.type !== '"') { - result3 += ` + result2 += ` `.repeat(child.startIndex - cursor); sawLiteralContent = true; } @@ -390305,11 +313956,11 @@ function walkString(node, innerCommands, varScope) { cursor = child.endIndex; break; case "string_content": - result3 += child.text.replace(/\\([$`"\\])/g, "$1"); + result2 += child.text.replace(/\\([$`"\\])/g, "$1"); sawLiteralContent = true; break; case DOLLAR: - result3 += DOLLAR; + result2 += DOLLAR; sawLiteralContent = true; break; case "command_substitution": { @@ -390323,14 +313974,14 @@ function walkString(node, innerCommands, varScope) { sawLiteralContent = true; break; } - result3 += trimmed; + result2 += trimmed; sawLiteralContent = true; break; } - const err3 = collectCommandSubstitution(child, innerCommands, varScope); - if (err3) - return err3; - result3 += CMDSUB_PLACEHOLDER; + const err2 = collectCommandSubstitution(child, innerCommands, varScope); + if (err2) + return err2; + result2 += CMDSUB_PLACEHOLDER; sawDynamicPlaceholder = true; break; } @@ -390342,14 +313993,14 @@ function walkString(node, innerCommands, varScope) { sawDynamicPlaceholder = true; else sawLiteralContent = true; - result3 += v; + result2 += v; break; } case "arithmetic_expansion": { - const err3 = walkArithmetic(child); - if (err3) - return err3; - result3 += child.text; + const err2 = walkArithmetic(child); + if (err2) + return err2; + result2 += child.text; sawLiteralContent = true; break; } @@ -390363,7 +314014,7 @@ function walkString(node, innerCommands, varScope) { if (!sawLiteralContent && !sawDynamicPlaceholder && node.text.length > 2) { return tooComplex(node); } - return result3; + return result2; } function walkArithmetic(node) { for (const child of node.children) { @@ -390384,9 +314035,9 @@ function walkArithmetic(node) { case "unary_expression": case "ternary_expression": case "parenthesized_expression": { - const err3 = walkArithmetic(child); - if (err3) - return err3; + const err2 = walkArithmetic(child); + if (err2) + return err2; break; } default: @@ -390456,9 +314107,9 @@ function walkVariableAssignment(node, innerCommands, varScope) { isAppend = child.type === "+="; continue; } else if (child.type === "command_substitution") { - const err3 = collectCommandSubstitution(child, innerCommands, varScope); - if (err3) - return err3; + const err2 = collectCommandSubstitution(child, innerCommands, varScope); + if (err2) + return err2; value = CMDSUB_PLACEHOLDER; } else if (child.type === "simple_expansion") { const v = resolveSimpleExpansion(child, varScope, true); @@ -390570,8 +314221,8 @@ function applyVarToScope(varScope, ev) { const combined = ev.isAppend ? existing + ev.value : ev.value; varScope.set(ev.name, containsAnyPlaceholder(combined) ? VAR_PLACEHOLDER : combined); } -function stripRawString(text2) { - return text2.slice(1, -1); +function stripRawString(text) { + return text.slice(1, -1); } function tooComplex(node) { const reason = node.type === "ERROR" ? "Parse error" : DANGEROUS_TYPES.has(node.type) ? `Contains ${node.type}` : `Unhandled node type: ${node.type}`; @@ -390584,26 +314235,26 @@ function checkSemantics(commands) { if (a2[0] === "time" || a2[0] === "nohup") { a2 = a2.slice(1); } else if (a2[0] === "timeout") { - let i4 = 1; - while (i4 < a2.length) { - const arg = a2[i4]; + let i3 = 1; + while (i3 < a2.length) { + const arg = a2[i3]; if (arg === "--foreground" || arg === "--preserve-status" || arg === "--verbose") { - i4++; + i3++; } else if (/^--(?:kill-after|signal)=[A-Za-z0-9_.+-]+$/.test(arg)) { - i4++; - } else if ((arg === "--kill-after" || arg === "--signal") && a2[i4 + 1] && /^[A-Za-z0-9_.+-]+$/.test(a2[i4 + 1])) { - i4 += 2; + i3++; + } else if ((arg === "--kill-after" || arg === "--signal") && a2[i3 + 1] && /^[A-Za-z0-9_.+-]+$/.test(a2[i3 + 1])) { + i3 += 2; } else if (arg.startsWith("--")) { return { ok: false, reason: `timeout with ${arg} flag cannot be statically analyzed` }; } else if (arg === "-v") { - i4++; - } else if ((arg === "-k" || arg === "-s") && a2[i4 + 1] && /^[A-Za-z0-9_.+-]+$/.test(a2[i4 + 1])) { - i4 += 2; + i3++; + } else if ((arg === "-k" || arg === "-s") && a2[i3 + 1] && /^[A-Za-z0-9_.+-]+$/.test(a2[i3 + 1])) { + i3 += 2; } else if (/^-[ks][A-Za-z0-9_.+-]+$/.test(arg)) { - i4++; + i3++; } else if (arg.startsWith("-")) { return { ok: false, @@ -390613,12 +314264,12 @@ function checkSemantics(commands) { break; } } - if (a2[i4] && /^\d+(?:\.\d+)?[smhd]?$/.test(a2[i4])) { - a2 = a2.slice(i4 + 1); - } else if (a2[i4]) { + if (a2[i3] && /^\d+(?:\.\d+)?[smhd]?$/.test(a2[i3])) { + a2 = a2.slice(i3 + 1); + } else if (a2[i3]) { return { ok: false, - reason: `timeout duration '${a2[i4]}' cannot be statically analyzed` + reason: `timeout duration '${a2[i3]}' cannot be statically analyzed` }; } else { break; @@ -390637,15 +314288,15 @@ function checkSemantics(commands) { a2 = a2.slice(1); } } else if (a2[0] === "env") { - let i4 = 1; - while (i4 < a2.length) { - const arg = a2[i4]; + let i3 = 1; + while (i3 < a2.length) { + const arg = a2[i3]; if (arg.includes("=") && !arg.startsWith("-")) { - i4++; + i3++; } else if (arg === "-i" || arg === "-0" || arg === "-v") { - i4++; - } else if (arg === "-u" && a2[i4 + 1]) { - i4 += 2; + i3++; + } else if (arg === "-u" && a2[i3 + 1]) { + i3 += 2; } else if (arg.startsWith("-")) { return { ok: false, @@ -390655,21 +314306,21 @@ function checkSemantics(commands) { break; } } - if (i4 < a2.length) { - a2 = a2.slice(i4); + if (i3 < a2.length) { + a2 = a2.slice(i3); } else { break; } } else if (a2[0] === "stdbuf") { - let i4 = 1; - while (i4 < a2.length) { - const arg = a2[i4]; - if (STDBUF_SHORT_SEP_RE.test(arg) && a2[i4 + 1]) { - i4 += 2; + let i3 = 1; + while (i3 < a2.length) { + const arg = a2[i3]; + if (STDBUF_SHORT_SEP_RE.test(arg) && a2[i3 + 1]) { + i3 += 2; } else if (STDBUF_SHORT_FUSED_RE.test(arg)) { - i4++; + i3++; } else if (STDBUF_LONG_RE.test(arg)) { - i4++; + i3++; } else if (arg.startsWith("-")) { return { ok: false, @@ -390679,8 +314330,8 @@ function checkSemantics(commands) { break; } } - if (i4 > 1 && i4 < a2.length) { - a2 = a2.slice(i4); + if (i3 > 1 && i3 < a2.length) { + a2 = a2.slice(i3); } else { break; } @@ -390711,9 +314362,9 @@ function checkSemantics(commands) { } const dangerFlags = SUBSCRIPT_EVAL_FLAGS[name]; if (dangerFlags !== undefined) { - for (let i4 = 1;i4 < a2.length; i4++) { - const arg = a2[i4]; - if (dangerFlags.has(arg) && a2[i4 + 1]?.includes("[")) { + for (let i3 = 1;i3 < a2.length; i3++) { + const arg = a2[i3]; + if (dangerFlags.has(arg) && a2[i3 + 1]?.includes("[")) { return { ok: false, reason: `'${name} ${arg}' operand contains array subscript — bash evaluates $(cmd) in subscripts` @@ -390722,7 +314373,7 @@ function checkSemantics(commands) { if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-" && !arg.includes("[")) { for (const flag of dangerFlags) { if (flag.length === 2 && arg.includes(flag[1])) { - if (a2[i4 + 1]?.includes("[")) { + if (a2[i3 + 1]?.includes("[")) { return { ok: false, reason: `'${name} ${flag}' (combined in '${arg}') operand contains array subscript — bash evaluates $(cmd) in subscripts` @@ -390742,21 +314393,21 @@ function checkSemantics(commands) { } } if (name === "[[") { - for (let i4 = 2;i4 < a2.length; i4++) { - if (!TEST_ARITH_CMP_OPS.has(a2[i4])) + for (let i3 = 2;i3 < a2.length; i3++) { + if (!TEST_ARITH_CMP_OPS.has(a2[i3])) continue; - if (a2[i4 - 1]?.includes("[") || a2[i4 + 1]?.includes("[")) { + if (a2[i3 - 1]?.includes("[") || a2[i3 + 1]?.includes("[")) { return { ok: false, - reason: `'[[ ... ${a2[i4]} ... ]]' operand contains array subscript — bash arithmetically evaluates $(cmd) in subscripts` + reason: `'[[ ... ${a2[i3]} ... ]]' operand contains array subscript — bash arithmetically evaluates $(cmd) in subscripts` }; } } } if (BARE_SUBSCRIPT_NAME_BUILTINS.has(name)) { let skipNext = false; - for (let i4 = 1;i4 < a2.length; i4++) { - const arg = a2[i4]; + for (let i3 = 1;i3 < a2.length; i3++) { + const arg = a2[i3]; if (skipNext) { skipNext = false; continue; @@ -390870,7 +314521,7 @@ function checkSemantics(commands) { var STRUCTURAL_TYPES, SEPARATOR_TYPES, CMDSUB_PLACEHOLDER = "__CMDSUB_OUTPUT__", VAR_PLACEHOLDER = "__TRACKED_VAR__", BARE_VAR_UNSAFE_RE, STDBUF_SHORT_SEP_RE, STDBUF_SHORT_FUSED_RE, STDBUF_LONG_RE, SAFE_ENV_VARS, SPECIAL_VAR_NAMES, DANGEROUS_TYPES, DANGEROUS_TYPE_IDS, REDIRECT_OPS, BRACE_EXPANSION_RE, CONTROL_CHAR_RE, UNICODE_WHITESPACE_RE, BACKSLASH_WHITESPACE_RE, ZSH_TILDE_BRACKET_RE, ZSH_EQUALS_EXPANSION_RE, BRACE_WITH_QUOTE_RE, DOLLAR, ARITH_LEAF_RE, ZSH_DANGEROUS_BUILTINS, EVAL_LIKE_BUILTINS, SUBSCRIPT_EVAL_FLAGS, TEST_ARITH_CMP_OPS, BARE_SUBSCRIPT_NAME_BUILTINS, READ_DATA_FLAGS, PROC_ENVIRON_RE, NEWLINE_HASH_RE; var init_ast = __esm(() => { init_bashParser(); - init_parser5(); + init_parser4(); STRUCTURAL_TYPES = new Set([ "program", "list", @@ -391012,7 +314663,7 @@ var init_ast = __esm(() => { }); // node_modules/shell-quote/quote.js -var require_quote2 = __commonJS((exports, module) => { +var require_quote = __commonJS((exports, module) => { module.exports = function quote(xs) { return xs.map(function(s) { if (s === "") { @@ -391033,7 +314684,7 @@ var require_quote2 = __commonJS((exports, module) => { }); // node_modules/shell-quote/parse.js -var require_parse10 = __commonJS((exports, module) => { +var require_parse7 = __commonJS((exports, module) => { var CONTROL = "(?:" + [ "\\|\\|", "\\&\\&", @@ -391056,26 +314707,26 @@ var require_parse10 = __commonJS((exports, module) => { var DS = "$"; var TOKEN = ""; var mult = 4294967296; - for (i4 = 0;i4 < 4; i4++) { + for (i3 = 0;i3 < 4; i3++) { TOKEN += (mult * Math.random()).toString(16); } - var i4; + var i3; var startsWithToken = new RegExp("^" + TOKEN); function matchAll2(s, r) { var origIndex = r.lastIndex; - var matches3 = []; + var matches2 = []; var matchObj; while (matchObj = r.exec(s)) { - matches3.push(matchObj); + matches2.push(matchObj); if (r.lastIndex === matchObj.index) { r.lastIndex += 1; } } r.lastIndex = origIndex; - return matches3; + return matches2; } - function getVar(env5, pre, key) { - var r = typeof env5 === "function" ? env5(key) : env5[key]; + function getVar(env4, pre, key) { + var r = typeof env4 === "function" ? env4(key) : env4[key]; if (typeof r === "undefined" && key != "") { r = ""; } else if (typeof r === "undefined") { @@ -391086,7 +314737,7 @@ var require_parse10 = __commonJS((exports, module) => { } return pre + r; } - function parseInternal(string5, env5, opts) { + function parseInternal(string5, env4, opts) { if (!opts) { opts = {}; } @@ -391096,15 +314747,15 @@ var require_parse10 = __commonJS((exports, module) => { "(" + CONTROL + ")", "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+" ].join("|"), "g"); - var matches3 = matchAll2(string5, chunker); - if (matches3.length === 0) { + var matches2 = matchAll2(string5, chunker); + if (matches2.length === 0) { return []; } - if (!env5) { - env5 = {}; + if (!env4) { + env4 = {}; } var commented = false; - return matches3.map(function(match) { + return matches2.map(function(match) { var s = match[0]; if (!s || commented) { return; @@ -391116,41 +314767,41 @@ var require_parse10 = __commonJS((exports, module) => { var esc2 = false; var out = ""; var isGlob = false; - var i5; + var i4; function parseEnvVar() { - i5 += 1; + i4 += 1; var varend; var varname; - var char = s.charAt(i5); + var char = s.charAt(i4); if (char === "{") { - i5 += 1; - if (s.charAt(i5) === "}") { - throw new Error("Bad substitution: " + s.slice(i5 - 2, i5 + 1)); + i4 += 1; + if (s.charAt(i4) === "}") { + throw new Error("Bad substitution: " + s.slice(i4 - 2, i4 + 1)); } - varend = s.indexOf("}", i5); + varend = s.indexOf("}", i4); if (varend < 0) { - throw new Error("Bad substitution: " + s.slice(i5)); + throw new Error("Bad substitution: " + s.slice(i4)); } - varname = s.slice(i5, varend); - i5 = varend; + varname = s.slice(i4, varend); + i4 = varend; } else if (/[*@#?$!_-]/.test(char)) { varname = char; - i5 += 1; + i4 += 1; } else { - var slicedFromI = s.slice(i5); + var slicedFromI = s.slice(i4); varend = slicedFromI.match(/[^\w\d_]/); if (!varend) { varname = slicedFromI; - i5 = s.length; + i4 = s.length; } else { varname = slicedFromI.slice(0, varend.index); - i5 += varend.index - 1; + i4 += varend.index - 1; } } - return getVar(env5, "", varname); + return getVar(env4, "", varname); } - for (i5 = 0;i5 < s.length; i5++) { - var c6 = s.charAt(i5); + for (i4 = 0;i4 < s.length; i4++) { + var c6 = s.charAt(i4); isGlob = isGlob || !quote && (c6 === "*" || c6 === "?"); if (esc2) { out += c6; @@ -391162,8 +314813,8 @@ var require_parse10 = __commonJS((exports, module) => { out += c6; } else { if (c6 === BS) { - i5 += 1; - c6 = s.charAt(i5); + i4 += 1; + c6 = s.charAt(i4); if (c6 === DQ || c6 === BS || c6 === DS) { out += c6; } else { @@ -391181,7 +314832,7 @@ var require_parse10 = __commonJS((exports, module) => { return { op: s }; } else if (hash2.test(c6)) { commented = true; - var commentObj = { comment: string5.slice(match.index + i5 + 1) }; + var commentObj = { comment: string5.slice(match.index + i4 + 1) }; if (out.length) { return [out, commentObj]; } @@ -391202,9 +314853,9 @@ var require_parse10 = __commonJS((exports, module) => { return typeof arg === "undefined" ? prev : prev.concat(arg); }, []); } - module.exports = function parse(s, env5, opts) { - var mapped = parseInternal(s, env5, opts); - if (typeof env5 !== "function") { + module.exports = function parse(s, env4, opts) { + var mapped = parseInternal(s, env4, opts); + if (typeof env4 !== "function") { return mapped; } return mapped.reduce(function(acc, s2) { @@ -391215,11 +314866,11 @@ var require_parse10 = __commonJS((exports, module) => { if (xs.length === 1) { return acc.concat(xs[0]); } - return acc.concat(xs.filter(Boolean).map(function(x4) { - if (startsWithToken.test(x4)) { - return JSON.parse(x4.split(TOKEN)[1]); + return acc.concat(xs.filter(Boolean).map(function(x3) { + if (startsWithToken.test(x3)) { + return JSON.parse(x3.split(TOKEN)[1]); } - return x4; + return x3; })); }, []); }; @@ -391228,22 +314879,22 @@ var require_parse10 = __commonJS((exports, module) => { // node_modules/shell-quote/index.js var $quote, $parse; var init_shell_quote = __esm(() => { - $quote = require_quote2(); - $parse = require_parse10(); + $quote = require_quote(); + $parse = require_parse7(); }); // src/utils/bash/shellQuote.ts -function tryParseShellCommand(cmd, env5) { +function tryParseShellCommand(cmd, env4) { try { - const tokens = typeof env5 === "function" ? $parse(cmd, env5) : $parse(cmd, env5); + const tokens = typeof env4 === "function" ? $parse(cmd, env4) : $parse(cmd, env4); return { success: true, tokens }; - } catch (error45) { - if (error45 instanceof Error) { - logError2(error45); + } catch (error41) { + if (error41 instanceof Error) { + logError2(error41); } return { success: false, - error: error45 instanceof Error ? error45.message : "Unknown parse error" + error: error41 instanceof Error ? error41.message : "Unknown parse error" }; } } @@ -391273,13 +314924,13 @@ function tryQuoteShellArgs(args) { }); const quoted = $quote(validated); return { success: true, quoted }; - } catch (error45) { - if (error45 instanceof Error) { - logError2(error45); + } catch (error41) { + if (error41 instanceof Error) { + logError2(error41); } return { success: false, - error: error45 instanceof Error ? error45.message : "Unknown quote error" + error: error41 instanceof Error ? error41.message : "Unknown quote error" }; } } @@ -391288,10 +314939,10 @@ function hasMalformedTokens(command, parsed) { let inDouble = false; let doubleCount = 0; let singleCount = 0; - for (let i4 = 0;i4 < command.length; i4++) { - const c6 = command[i4]; + for (let i3 = 0;i3 < command.length; i3++) { + const c6 = command[i3]; if (c6 === "\\" && !inSingle) { - i4++; + i3++; continue; } if (c6 === '"' && !inSingle) { @@ -391331,10 +314982,10 @@ function hasMalformedTokens(command, parsed) { function hasShellQuoteSingleQuoteBug(command) { let inSingleQuote = false; let inDoubleQuote = false; - for (let i4 = 0;i4 < command.length; i4++) { - const char = command[i4]; + for (let i3 = 0;i3 < command.length; i3++) { + const char = command[i3]; if (char === "\\" && !inSingleQuote) { - i4++; + i3++; continue; } if (char === '"' && !inSingleQuote) { @@ -391345,7 +314996,7 @@ function hasShellQuoteSingleQuoteBug(command) { inSingleQuote = !inSingleQuote; if (!inSingleQuote) { let backslashCount = 0; - let j = i4 - 1; + let j = i3 - 1; while (j >= 0 && command[j] === "\\") { backslashCount++; j--; @@ -391353,7 +315004,7 @@ function hasShellQuoteSingleQuoteBug(command) { if (backslashCount > 0 && backslashCount % 2 === 1) { return true; } - if (backslashCount > 0 && backslashCount % 2 === 0 && command.indexOf("'", i4 + 1) !== -1) { + if (backslashCount > 0 && backslashCount % 2 === 0 && command.indexOf("'", i3 + 1) !== -1) { return true; } } @@ -391363,9 +315014,9 @@ function hasShellQuoteSingleQuoteBug(command) { return false; } function quote(args) { - const result3 = tryQuoteShellArgs([...args]); - if (result3.success) { - return result3.quoted; + const result2 = tryQuoteShellArgs([...args]); + if (result2.success) { + return result2.quoted; } try { const stringArgs = args.map((arg) => { @@ -391379,9 +315030,9 @@ function quote(args) { return jsonStringify(arg); }); return $quote(stringArgs); - } catch (error45) { - if (error45 instanceof Error) { - logError2(error45); + } catch (error41) { + if (error41 instanceof Error) { + logError2(error41); } throw new Error("Failed to quote shell arguments safely"); } @@ -391503,13 +315154,13 @@ function deletePermissionRuleFromSettings(rule) { [rule.ruleBehavior]: behaviorArray.filter((raw) => normalizeEntry(raw) !== ruleString) } }; - const { error: error45 } = updateSettingsForSource(rule.source, updatedSettingsData); - if (error45) { + const { error: error41 } = updateSettingsForSource(rule.source, updatedSettingsData); + if (error41) { return false; } return true; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return false; } } @@ -391545,13 +315196,13 @@ function addPermissionRulesToSettings({ [ruleBehavior]: [...existingRules, ...newRules] } }; - const result3 = updateSettingsForSource(source, updatedSettingsData); - if (result3.error) { - throw result3.error; + const result2 = updateSettingsForSource(source, updatedSettingsData); + if (result2.error) { + throw result2.error; } return true; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return false; } } @@ -391581,10 +315232,10 @@ import { posix } from "path"; function extractRules(updates) { if (!updates) return []; - return updates.flatMap((update3) => { - switch (update3.type) { + return updates.flatMap((update2) => { + switch (update2.type) { case "addRules": - return update3.rules; + return update2.rules; default: return []; } @@ -391593,48 +315244,48 @@ function extractRules(updates) { function hasRules(updates) { return extractRules(updates).length > 0; } -function applyPermissionUpdate(context, update3) { - switch (update3.type) { +function applyPermissionUpdate(context, update2) { + switch (update2.type) { case "setMode": - logForDebugging(`Applying permission update: Setting mode to '${update3.mode}'`); + logForDebugging(`Applying permission update: Setting mode to '${update2.mode}'`); return { ...context, - mode: update3.mode + mode: update2.mode }; case "addRules": { - const ruleStrings = update3.rules.map((rule) => permissionRuleValueToString(rule)); - logForDebugging(`Applying permission update: Adding ${update3.rules.length} ${update3.behavior} rule(s) to destination '${update3.destination}': ${jsonStringify(ruleStrings)}`); - const ruleKind = update3.behavior === "allow" ? "alwaysAllowRules" : update3.behavior === "deny" ? "alwaysDenyRules" : "alwaysAskRules"; + const ruleStrings = update2.rules.map((rule) => permissionRuleValueToString(rule)); + logForDebugging(`Applying permission update: Adding ${update2.rules.length} ${update2.behavior} rule(s) to destination '${update2.destination}': ${jsonStringify(ruleStrings)}`); + const ruleKind = update2.behavior === "allow" ? "alwaysAllowRules" : update2.behavior === "deny" ? "alwaysDenyRules" : "alwaysAskRules"; return { ...context, [ruleKind]: { ...context[ruleKind], - [update3.destination]: [ - ...context[ruleKind][update3.destination] || [], + [update2.destination]: [ + ...context[ruleKind][update2.destination] || [], ...ruleStrings ] } }; } case "replaceRules": { - const ruleStrings = update3.rules.map((rule) => permissionRuleValueToString(rule)); - logForDebugging(`Replacing all ${update3.behavior} rules for destination '${update3.destination}' with ${update3.rules.length} rule(s): ${jsonStringify(ruleStrings)}`); - const ruleKind = update3.behavior === "allow" ? "alwaysAllowRules" : update3.behavior === "deny" ? "alwaysDenyRules" : "alwaysAskRules"; + const ruleStrings = update2.rules.map((rule) => permissionRuleValueToString(rule)); + logForDebugging(`Replacing all ${update2.behavior} rules for destination '${update2.destination}' with ${update2.rules.length} rule(s): ${jsonStringify(ruleStrings)}`); + const ruleKind = update2.behavior === "allow" ? "alwaysAllowRules" : update2.behavior === "deny" ? "alwaysDenyRules" : "alwaysAskRules"; return { ...context, [ruleKind]: { ...context[ruleKind], - [update3.destination]: ruleStrings + [update2.destination]: ruleStrings } }; } case "addDirectories": { - logForDebugging(`Applying permission update: Adding ${update3.directories.length} director${update3.directories.length === 1 ? "y" : "ies"} with destination '${update3.destination}': ${jsonStringify(update3.directories)}`); + logForDebugging(`Applying permission update: Adding ${update2.directories.length} director${update2.directories.length === 1 ? "y" : "ies"} with destination '${update2.destination}': ${jsonStringify(update2.directories)}`); const newAdditionalDirs = new Map(context.additionalWorkingDirectories); - for (const directory of update3.directories) { + for (const directory of update2.directories) { newAdditionalDirs.set(directory, { path: directory, - source: update3.destination + source: update2.destination }); } return { @@ -391643,24 +315294,24 @@ function applyPermissionUpdate(context, update3) { }; } case "removeRules": { - const ruleStrings = update3.rules.map((rule) => permissionRuleValueToString(rule)); - logForDebugging(`Applying permission update: Removing ${update3.rules.length} ${update3.behavior} rule(s) from source '${update3.destination}': ${jsonStringify(ruleStrings)}`); - const ruleKind = update3.behavior === "allow" ? "alwaysAllowRules" : update3.behavior === "deny" ? "alwaysDenyRules" : "alwaysAskRules"; - const existingRules = context[ruleKind][update3.destination] || []; + const ruleStrings = update2.rules.map((rule) => permissionRuleValueToString(rule)); + logForDebugging(`Applying permission update: Removing ${update2.rules.length} ${update2.behavior} rule(s) from source '${update2.destination}': ${jsonStringify(ruleStrings)}`); + const ruleKind = update2.behavior === "allow" ? "alwaysAllowRules" : update2.behavior === "deny" ? "alwaysDenyRules" : "alwaysAskRules"; + const existingRules = context[ruleKind][update2.destination] || []; const rulesToRemove = new Set(ruleStrings); const filteredRules = existingRules.filter((rule) => !rulesToRemove.has(rule)); return { ...context, [ruleKind]: { ...context[ruleKind], - [update3.destination]: filteredRules + [update2.destination]: filteredRules } }; } case "removeDirectories": { - logForDebugging(`Applying permission update: Removing ${update3.directories.length} director${update3.directories.length === 1 ? "y" : "ies"}: ${jsonStringify(update3.directories)}`); + logForDebugging(`Applying permission update: Removing ${update2.directories.length} director${update2.directories.length === 1 ? "y" : "ies"}: ${jsonStringify(update2.directories)}`); const newAdditionalDirs = new Map(context.additionalWorkingDirectories); - for (const directory of update3.directories) { + for (const directory of update2.directories) { newAdditionalDirs.delete(directory); } return { @@ -391674,35 +315325,35 @@ function applyPermissionUpdate(context, update3) { } function applyPermissionUpdates(context, updates) { let updatedContext = context; - for (const update3 of updates) { - updatedContext = applyPermissionUpdate(updatedContext, update3); + for (const update2 of updates) { + updatedContext = applyPermissionUpdate(updatedContext, update2); } return updatedContext; } function supportsPersistence(destination) { return destination === "localSettings" || destination === "userSettings" || destination === "projectSettings"; } -function persistPermissionUpdate(update3) { - if (!supportsPersistence(update3.destination)) +function persistPermissionUpdate(update2) { + if (!supportsPersistence(update2.destination)) return; - logForDebugging(`Persisting permission update: ${update3.type} to source '${update3.destination}'`); - switch (update3.type) { + logForDebugging(`Persisting permission update: ${update2.type} to source '${update2.destination}'`); + switch (update2.type) { case "addRules": { - logForDebugging(`Persisting ${update3.rules.length} ${update3.behavior} rule(s) to ${update3.destination}`); + logForDebugging(`Persisting ${update2.rules.length} ${update2.behavior} rule(s) to ${update2.destination}`); addPermissionRulesToSettings({ - ruleValues: update3.rules, - ruleBehavior: update3.behavior - }, update3.destination); + ruleValues: update2.rules, + ruleBehavior: update2.behavior + }, update2.destination); break; } case "addDirectories": { - logForDebugging(`Persisting ${update3.directories.length} director${update3.directories.length === 1 ? "y" : "ies"} to ${update3.destination}`); - const existingSettings = getSettingsForSource(update3.destination); + logForDebugging(`Persisting ${update2.directories.length} director${update2.directories.length === 1 ? "y" : "ies"} to ${update2.destination}`); + const existingSettings = getSettingsForSource(update2.destination); const existingDirs = existingSettings?.permissions?.additionalDirectories || []; - const dirsToAdd = update3.directories.filter((dir) => !existingDirs.includes(dir)); + const dirsToAdd = update2.directories.filter((dir) => !existingDirs.includes(dir)); if (dirsToAdd.length > 0) { const updatedDirs = [...existingDirs, ...dirsToAdd]; - updateSettingsForSource(update3.destination, { + updateSettingsForSource(update2.destination, { permissions: { additionalDirectories: updatedDirs } @@ -391711,29 +315362,29 @@ function persistPermissionUpdate(update3) { break; } case "removeRules": { - logForDebugging(`Removing ${update3.rules.length} ${update3.behavior} rule(s) from ${update3.destination}`); - const existingSettings = getSettingsForSource(update3.destination); + logForDebugging(`Removing ${update2.rules.length} ${update2.behavior} rule(s) from ${update2.destination}`); + const existingSettings = getSettingsForSource(update2.destination); const existingPermissions = existingSettings?.permissions || {}; - const existingRules = existingPermissions[update3.behavior] || []; - const rulesToRemove = new Set(update3.rules.map(permissionRuleValueToString)); + const existingRules = existingPermissions[update2.behavior] || []; + const rulesToRemove = new Set(update2.rules.map(permissionRuleValueToString)); const filteredRules = existingRules.filter((rule) => { const normalized = permissionRuleValueToString(permissionRuleValueFromString(rule)); return !rulesToRemove.has(normalized); }); - updateSettingsForSource(update3.destination, { + updateSettingsForSource(update2.destination, { permissions: { - [update3.behavior]: filteredRules + [update2.behavior]: filteredRules } }); break; } case "removeDirectories": { - logForDebugging(`Removing ${update3.directories.length} director${update3.directories.length === 1 ? "y" : "ies"} from ${update3.destination}`); - const existingSettings = getSettingsForSource(update3.destination); + logForDebugging(`Removing ${update2.directories.length} director${update2.directories.length === 1 ? "y" : "ies"} from ${update2.destination}`); + const existingSettings = getSettingsForSource(update2.destination); const existingDirs = existingSettings?.permissions?.additionalDirectories || []; - const dirsToRemove = new Set(update3.directories); + const dirsToRemove = new Set(update2.directories); const filteredDirs = existingDirs.filter((dir) => !dirsToRemove.has(dir)); - updateSettingsForSource(update3.destination, { + updateSettingsForSource(update2.destination, { permissions: { additionalDirectories: filteredDirs } @@ -391741,20 +315392,20 @@ function persistPermissionUpdate(update3) { break; } case "setMode": { - logForDebugging(`Persisting mode '${update3.mode}' to ${update3.destination}`); - updateSettingsForSource(update3.destination, { + logForDebugging(`Persisting mode '${update2.mode}' to ${update2.destination}`); + updateSettingsForSource(update2.destination, { permissions: { - defaultMode: update3.mode + defaultMode: update2.mode } }); break; } case "replaceRules": { - logForDebugging(`Replacing all ${update3.behavior} rules in ${update3.destination} with ${update3.rules.length} rule(s)`); - const ruleStrings = update3.rules.map(permissionRuleValueToString); - updateSettingsForSource(update3.destination, { + logForDebugging(`Replacing all ${update2.behavior} rules in ${update2.destination} with ${update2.rules.length} rule(s)`); + const ruleStrings = update2.rules.map(permissionRuleValueToString); + updateSettingsForSource(update2.destination, { permissions: { - [update3.behavior]: ruleStrings + [update2.behavior]: ruleStrings } }); break; @@ -391762,8 +315413,8 @@ function persistPermissionUpdate(update3) { } } function persistPermissionUpdates(updates) { - for (const update3 of updates) { - persistPermissionUpdate(update3); + for (const update2 of updates) { + persistPermissionUpdate(update2); } } function createReadRuleSuggestion(dirPath, destination = "session") { @@ -391802,10 +315453,10 @@ function hasWildcards(pattern) { if (pattern.endsWith(":*")) { return false; } - for (let i4 = 0;i4 < pattern.length; i4++) { - if (pattern[i4] === "*") { + for (let i3 = 0;i3 < pattern.length; i3++) { + if (pattern[i3] === "*") { let backslashCount = 0; - let j = i4 - 1; + let j = i3 - 1; while (j >= 0 && pattern[j] === "\\") { backslashCount++; j--; @@ -391820,23 +315471,23 @@ function hasWildcards(pattern) { function matchWildcardPattern(pattern, command, caseInsensitive = false) { const trimmedPattern = pattern.trim(); let processed = ""; - let i4 = 0; - while (i4 < trimmedPattern.length) { - const char = trimmedPattern[i4]; - if (char === "\\" && i4 + 1 < trimmedPattern.length) { - const nextChar = trimmedPattern[i4 + 1]; + let i3 = 0; + while (i3 < trimmedPattern.length) { + const char = trimmedPattern[i3]; + if (char === "\\" && i3 + 1 < trimmedPattern.length) { + const nextChar = trimmedPattern[i3 + 1]; if (nextChar === "*") { processed += ESCAPED_STAR_PLACEHOLDER; - i4 += 2; + i3 += 2; continue; } else if (nextChar === "\\") { processed += ESCAPED_BACKSLASH_PLACEHOLDER; - i4 += 2; + i3 += 2; continue; } } processed += char; - i4++; + i3++; } const escaped = processed.replace(/[.+?^${}()|[\]\\'"]/g, "\\$&"); const withWildcards = escaped.replace(/\*/g, ".*"); @@ -391922,15 +315573,15 @@ function notifyVscodeFileUpdated(filePath, oldContent, newContent) { vscodeMcpClient.client.notification({ method: "file_updated", params: { filePath, oldContent, newContent } - }).catch((error45) => { - logForDebugging(`[VSCode] Failed to send file_updated notification: ${error45.message}`); + }).catch((error41) => { + logForDebugging(`[VSCode] Failed to send file_updated notification: ${error41.message}`); }); } function setupVscodeSdkMcp(sdkClients) { - const client5 = sdkClients.find((client6) => client6.name === "claude-vscode"); - if (client5 && client5.type === "connected") { - vscodeMcpClient = client5; - client5.client.setNotificationHandler(LogEventNotificationSchema(), async (notification) => { + const client2 = sdkClients.find((client3) => client3.name === "claude-vscode"); + if (client2 && client2.type === "connected") { + vscodeMcpClient = client2; + client2.client.setNotificationHandler(LogEventNotificationSchema(), async (notification) => { const { eventName, eventData } = notification.params; logEvent(`tengu_vscode_${eventName}`, eventData); }); @@ -391944,7 +315595,7 @@ function setupVscodeSdkMcp(sdkClients) { if (autoModeState !== undefined) { gates.tengu_auto_mode_state = autoModeState; } - client5.client.notification({ + client2.client.notification({ method: "experiment_gates", params: { gates } }); @@ -392079,28 +315730,28 @@ async function executePromptSuggestion(context) { const abortController = currentAbortController; const cacheSafeParams = createCacheSafeParams(context); try { - const result3 = await tryGenerateSuggestion(abortController, context.messages, context.toolUseContext.getAppState, cacheSafeParams, "cli"); - if (!result3) + const result2 = await tryGenerateSuggestion(abortController, context.messages, context.toolUseContext.getAppState, cacheSafeParams, "cli"); + if (!result2) return; context.toolUseContext.setAppState((prev) => ({ ...prev, promptSuggestion: { - text: result3.suggestion, - promptId: result3.promptId, + text: result2.suggestion, + promptId: result2.promptId, shownAt: 0, acceptedAt: 0, - generationRequestId: result3.generationRequestId + generationRequestId: result2.generationRequestId } })); - if (isSpeculationEnabled() && result3.suggestion) { - startSpeculation(result3.suggestion, context, context.toolUseContext.setAppState, false, cacheSafeParams); + if (isSpeculationEnabled() && result2.suggestion) { + startSpeculation(result2.suggestion, context, context.toolUseContext.setAppState, false, cacheSafeParams); } - } catch (error45) { - if (error45 instanceof Error && (error45.name === "AbortError" || error45.name === "APIUserAbortError")) { + } catch (error41) { + if (error41 instanceof Error && (error41.name === "AbortError" || error41.name === "APIUserAbortError")) { logSuggestionSuppressed("aborted", undefined, undefined, "cli"); return; } - logError2(toError(error45)); + logError2(toError(error41)); } finally { if (currentAbortController === abortController) { currentAbortController = null; @@ -392123,7 +315774,7 @@ async function generateSuggestion(abortController, promptId, cacheSafeParams) { message: "No tools needed for suggestion", decisionReason: { type: "other", reason: "suggestion only" } }); - const result3 = await runForkedAgent({ + const result2 = await runForkedAgent({ promptMessages: [createUserMessage({ content: prompt })], cacheSafeParams, canUseTool, @@ -392135,9 +315786,9 @@ async function generateSuggestion(abortController, promptId, cacheSafeParams) { skipTranscript: true, skipCacheWrite: true }); - const firstAssistantMsg = result3.messages.find((m) => m.type === "assistant"); + const firstAssistantMsg = result2.messages.find((m) => m.type === "assistant"); const generationRequestId = firstAssistantMsg?.type === "assistant" ? firstAssistantMsg.requestId ?? null : null; - for (const msg of result3.messages) { + for (const msg of result2.messages) { if (msg.type !== "assistant") continue; const textBlock = msg.message.content.find((b) => b.type === "text"); @@ -392295,7 +315946,7 @@ var init_promptSuggestion = __esm(() => { init_errors(); init_forkedAgent(); init_log3(); - init_messages5(); + init_messages3(); init_settings2(); init_teammate(); init_growthbook(); @@ -392309,10 +315960,10 @@ var init_promptSuggestion = __esm(() => { }); // src/utils/generatedFiles.ts -import { basename as basename12, extname as extname6, posix as posix2, sep as sep13 } from "path"; +import { basename as basename10, extname as extname6, posix as posix2, sep as sep10 } from "path"; function isGeneratedFile(filePath) { - const normalizedPath = posix2.sep + filePath.split(sep13).join(posix2.sep).replace(/^\/+/, ""); - const fileName = basename12(filePath).toLowerCase(); + const normalizedPath = posix2.sep + filePath.split(sep10).join(posix2.sep).replace(/^\/+/, ""); + const fileName = basename10(filePath).toLowerCase(); const ext = extname6(filePath).toLowerCase(); if (EXCLUDED_FILENAMES.has(fileName)) { return true; @@ -392436,9 +316087,9 @@ __export(exports_commitAttribution, { buildSurfaceKey: () => buildSurfaceKey, attributionRestoreStateFromLog: () => attributionRestoreStateFromLog }); -import { createHash as createHash6, randomUUID as randomUUID7 } from "crypto"; -import { stat as stat18 } from "fs/promises"; -import { isAbsolute as isAbsolute10, join as join56, relative as relative8, sep as sep14 } from "path"; +import { createHash as createHash5, randomUUID as randomUUID7 } from "crypto"; +import { stat as stat17 } from "fs/promises"; +import { isAbsolute as isAbsolute9, join as join46, relative as relative6, sep as sep11 } from "path"; function getAttributionRepoRoot() { const cwd2 = getCwd(); return findGitRoot(cwd2) ?? getOriginalCwd(); @@ -392489,35 +316140,35 @@ function buildSurfaceKey(surface, model) { return `${surface}/${getCanonicalName(model)}`; } function computeContentHash(content) { - return createHash6("sha256").update(content).digest("hex"); + return createHash5("sha256").update(content).digest("hex"); } function normalizeFilePath(filePath) { - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); const cwd2 = getAttributionRepoRoot(); - if (!isAbsolute10(filePath)) { + if (!isAbsolute9(filePath)) { return filePath; } let resolvedPath = filePath; let resolvedCwd = cwd2; try { - resolvedPath = fs9.realpathSync(filePath); + resolvedPath = fs3.realpathSync(filePath); } catch {} try { - resolvedCwd = fs9.realpathSync(cwd2); + resolvedCwd = fs3.realpathSync(cwd2); } catch {} - if (resolvedPath.startsWith(resolvedCwd + sep14) || resolvedPath === resolvedCwd) { - return relative8(resolvedCwd, resolvedPath).replaceAll(sep14, "/"); + if (resolvedPath.startsWith(resolvedCwd + sep11) || resolvedPath === resolvedCwd) { + return relative6(resolvedCwd, resolvedPath).replaceAll(sep11, "/"); } - if (filePath.startsWith(cwd2 + sep14) || filePath === cwd2) { - return relative8(cwd2, filePath).replaceAll(sep14, "/"); + if (filePath.startsWith(cwd2 + sep11) || filePath === cwd2) { + return relative6(cwd2, filePath).replaceAll(sep11, "/"); } return filePath; } function expandFilePath(filePath) { - if (isAbsolute10(filePath)) { + if (isAbsolute9(filePath)) { return filePath; } - return join56(getAttributionRepoRoot(), filePath); + return join46(getAttributionRepoRoot(), filePath); } function createEmptyAttributionState() { return { @@ -392560,8 +316211,8 @@ function computeFileModificationState(existingFileStates, filePath, oldContent, claudeContribution: existingContribution + claudeContribution, mtime }; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return null; } } @@ -392569,7 +316220,7 @@ async function getFileMtime(filePath) { const normalizedPath = normalizeFilePath(filePath); const absPath = expandFilePath(normalizedPath); try { - const stats = await stat18(absPath); + const stats = await stat17(absPath); return stats.mtimeMs; } catch { return Date.now(); @@ -392642,7 +316293,7 @@ function trackBulkFileChanges(state, changes) { async function calculateCommitAttribution(states, stagedFiles) { const cwd2 = getAttributionRepoRoot(); const sessionId = getSessionId(); - const files2 = {}; + const files = {}; const excludedGenerated = []; const surfaces = new Set; const surfaceCounts = {}; @@ -392653,21 +316304,21 @@ async function calculateCommitAttribution(states, stagedFiles) { for (const state of states) { surfaces.add(state.surface); const baselines = state.sessionBaselines instanceof Map ? state.sessionBaselines : new Map(Object.entries(state.sessionBaselines ?? {})); - for (const [path16, baseline] of baselines) { - if (!mergedBaselines.has(path16)) { - mergedBaselines.set(path16, baseline); + for (const [path11, baseline] of baselines) { + if (!mergedBaselines.has(path11)) { + mergedBaselines.set(path11, baseline); } } const fileStates = state.fileStates instanceof Map ? state.fileStates : new Map(Object.entries(state.fileStates ?? {})); - for (const [path16, fileState] of fileStates) { - const existing = mergedFileStates.get(path16); + for (const [path11, fileState] of fileStates) { + const existing = mergedFileStates.get(path11); if (existing) { - mergedFileStates.set(path16, { + mergedFileStates.set(path11, { ...fileState, claudeContribution: existing.claudeContribution + fileState.claudeContribution }); } else { - mergedFileStates.set(path16, fileState); + mergedFileStates.set(path11, fileState); } } } @@ -392675,7 +316326,7 @@ async function calculateCommitAttribution(states, stagedFiles) { if (isGeneratedFile(file2)) { return { type: "generated", file: file2 }; } - const absPath = join56(cwd2, file2); + const absPath = join46(cwd2, file2); const fileState = mergedFileStates.get(file2); const baseline = mergedBaselines.get(file2); const fileSurface = states[0].surface; @@ -392692,7 +316343,7 @@ async function calculateCommitAttribution(states, stagedFiles) { } } else { try { - const stats = await stat18(absPath); + const stats = await stat17(absPath); if (fileState) { claudeChars = fileState.claudeContribution; humanChars = 0; @@ -392719,22 +316370,22 @@ async function calculateCommitAttribution(states, stagedFiles) { surface: fileSurface }; })); - for (const result3 of fileResults) { - if (!result3) + for (const result2 of fileResults) { + if (!result2) continue; - if (result3.type === "generated") { - excludedGenerated.push(result3.file); + if (result2.type === "generated") { + excludedGenerated.push(result2.file); continue; } - files2[result3.file] = { - claudeChars: result3.claudeChars, - humanChars: result3.humanChars, - percent: result3.percent, - surface: result3.surface + files[result2.file] = { + claudeChars: result2.claudeChars, + humanChars: result2.humanChars, + percent: result2.percent, + surface: result2.surface }; - totalClaudeChars += result3.claudeChars; - totalHumanChars += result3.humanChars; - surfaceCounts[result3.surface] = (surfaceCounts[result3.surface] ?? 0) + result3.claudeChars; + totalClaudeChars += result2.claudeChars; + totalHumanChars += result2.humanChars; + surfaceCounts[result2.surface] = (surfaceCounts[result2.surface] ?? 0) + result2.claudeChars; } const totalChars = totalClaudeChars + totalHumanChars; const claudePercent = totalChars > 0 ? Math.round(totalClaudeChars / totalChars * 100) : 0; @@ -392751,7 +316402,7 @@ async function calculateCommitAttribution(states, stagedFiles) { humanChars: totalHumanChars, surfaces: Array.from(surfaces) }, - files: files2, + files, surfaceBreakdown, excludedGenerated, sessions: [sessionId] @@ -392760,11 +316411,11 @@ async function calculateCommitAttribution(states, stagedFiles) { async function getGitDiffSize(filePath) { const cwd2 = getAttributionRepoRoot(); try { - const result3 = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--stat", "--", filePath], { cwd: cwd2, timeout: 5000 }); - if (result3.code !== 0 || !result3.stdout) { + const result2 = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--stat", "--", filePath], { cwd: cwd2, timeout: 5000 }); + if (result2.code !== 0 || !result2.stdout) { return 0; } - const lines = result3.stdout.split(` + const lines = result2.stdout.split(` `).filter(Boolean); let totalChanges = 0; for (const line of lines) { @@ -392784,9 +316435,9 @@ async function getGitDiffSize(filePath) { async function isFileDeleted(filePath) { const cwd2 = getAttributionRepoRoot(); try { - const result3 = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--name-status", "--", filePath], { cwd: cwd2, timeout: 5000 }); - if (result3.code === 0 && result3.stdout) { - return result3.stdout.trim().startsWith("D "); + const result2 = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--name-status", "--", filePath], { cwd: cwd2, timeout: 5000 }); + if (result2.code === 0 && result2.stdout) { + return result2.stdout.trim().startsWith("D "); } } catch {} return false; @@ -392794,13 +316445,13 @@ async function isFileDeleted(filePath) { async function getStagedFiles() { const cwd2 = getAttributionRepoRoot(); try { - const result3 = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--name-only"], { cwd: cwd2, timeout: 5000 }); - if (result3.code === 0 && result3.stdout) { - return result3.stdout.split(` + const result2 = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--name-only"], { cwd: cwd2, timeout: 5000 }); + if (result2.code === 0 && result2.stdout) { + return result2.stdout.split(` `).filter(Boolean); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } return []; } @@ -392817,7 +316468,7 @@ async function isGitTransientState() { ]; const results = await Promise.all(indicators.map(async (indicator) => { try { - await stat18(join56(gitDir, indicator)); + await stat17(join46(gitDir, indicator)); return true; } catch { return false; @@ -392827,8 +316478,8 @@ async function isGitTransientState() { } function stateToSnapshotMessage(state, messageId) { const fileStates = {}; - for (const [path16, fileState] of state.fileStates) { - fileStates[path16] = fileState; + for (const [path11, fileState] of state.fileStates) { + fileStates[path11] = fileState; } return { type: "attribution-snapshot", @@ -392850,8 +316501,8 @@ function restoreAttributionStateFromSnapshots(snapshots) { return state; } state.surface = lastSnapshot.surface; - for (const [path16, fileState] of Object.entries(lastSnapshot.fileStates)) { - state.fileStates.set(path16, fileState); + for (const [path11, fileState] of Object.entries(lastSnapshot.fileStates)) { + state.fileStates.set(path11, fileState); } state.promptCount = lastSnapshot.promptCount ?? 0; state.promptCountAtLastCommit = lastSnapshot.promptCountAtLastCommit ?? 0; @@ -393065,9 +316716,9 @@ var init_AppStateStore = __esm(() => { }); // src/utils/bash/heredoc.ts -import { randomBytes as randomBytes3 } from "crypto"; +import { randomBytes as randomBytes2 } from "crypto"; function generatePlaceholderSalt() { - return randomBytes3(8).toString("hex"); + return randomBytes2(8).toString("hex"); } function extractHeredocs(command, options2) { const heredocs = new Map; @@ -393100,8 +316751,8 @@ function extractHeredocs(command, options2) { let scanDqEscapeNext = false; let scanPendingBackslashes = 0; const advanceScan = (target) => { - for (let i4 = scanPos;i4 < target; i4++) { - const ch2 = command[i4]; + for (let i3 = scanPos;i3 < target; i3++) { + const ch2 = command[i3]; if (ch2 === ` `) scanInComment = false; @@ -393235,17 +316886,17 @@ function extractHeredocs(command, options2) { const contentLines = afterNewline.split(` `); let closingLineIndex = -1; - for (let i4 = 0;i4 < contentLines.length; i4++) { - const line = contentLines[i4]; + for (let i3 = 0;i3 < contentLines.length; i3++) { + const line = contentLines[i3]; if (isDash) { const stripped = line.replace(/^\t*/, ""); if (stripped === delimiter2) { - closingLineIndex = i4; + closingLineIndex = i3; break; } } else { if (line === delimiter2) { - closingLineIndex = i4; + closingLineIndex = i3; break; } } @@ -393334,12 +316985,12 @@ function extractHeredocs(command, options2) { }); return { processedCommand, heredocs }; } -function restoreHeredocsInString(text2, heredocs) { - let result3 = text2; +function restoreHeredocsInString(text, heredocs) { + let result2 = text; for (const [placeholder, info] of heredocs) { - result3 = result3.replaceAll(placeholder, info.fullText); + result2 = result2.replaceAll(placeholder, info.fullText); } - return result3; + return result2; } function restoreHeredocs(parts, heredocs) { if (heredocs.size === 0) { @@ -393391,36 +317042,36 @@ function collectQuoteSpans(node, out, inDouble) { } } function buildPositionSet(spans) { - const set5 = new Set; + const set4 = new Set; for (const [start, end] of spans) { - for (let i4 = start;i4 < end; i4++) { - set5.add(i4); + for (let i3 = start;i3 < end; i3++) { + set4.add(i3); } } - return set5; + return set4; } function dropContainedSpans(spans) { - return spans.filter((s, i4) => !spans.some((other2, j) => j !== i4 && other2[0] <= s[0] && other2[1] >= s[1] && (other2[0] < s[0] || other2[1] > s[1]))); + return spans.filter((s, i3) => !spans.some((other2, j) => j !== i3 && other2[0] <= s[0] && other2[1] >= s[1] && (other2[0] < s[0] || other2[1] > s[1]))); } function removeSpans(command, spans) { if (spans.length === 0) return command; const sorted = dropContainedSpans(spans).sort((a2, b) => b[0] - a2[0]); - let result3 = command; + let result2 = command; for (const [start, end] of sorted) { - result3 = result3.slice(0, start) + result3.slice(end); + result2 = result2.slice(0, start) + result2.slice(end); } - return result3; + return result2; } function replaceSpansKeepQuotes(command, spans) { if (spans.length === 0) return command; const sorted = dropContainedSpans(spans).sort((a2, b) => b[0] - a2[0]); - let result3 = command; + let result2 = command; for (const [start, end, open5, close] of sorted) { - result3 = result3.slice(0, start) + open5 + close + result3.slice(end); + result2 = result2.slice(0, start) + open5 + close + result2.slice(end); } - return result3; + return result2; } function extractQuoteContext(rootNode, command) { const spans = { raw: [], ansiC: [], double: [], heredoc: [] }; @@ -393446,12 +317097,12 @@ function extractQuoteContext(rootNode, command) { doubleQuoteDelimSet.add(end - 1); } let withDoubleQuotes = ""; - for (let i4 = 0;i4 < command.length; i4++) { - if (singleQuoteSet.has(i4)) + for (let i3 = 0;i3 < command.length; i3++) { + if (singleQuoteSet.has(i3)) continue; - if (doubleQuoteDelimSet.has(i4)) + if (doubleQuoteDelimSet.has(i3)) continue; - withDoubleQuotes += command[i4]; + withDoubleQuotes += command[i3]; } const fullyUnquoted = removeSpans(command, allQuoteSpans); const spansWithQuoteChars = []; @@ -393738,14 +317389,14 @@ class TreeSitterParsedCommand { if (this.redirectionNodes.length === 0) return this.originalCommand; const sorted = [...this.redirectionNodes].sort((a2, b) => b.startIndex - a2.startIndex); - let result3 = this.commandBytes; + let result2 = this.commandBytes; for (const redir of sorted) { - result3 = Buffer.concat([ - result3.subarray(0, redir.startIndex), - result3.subarray(redir.endIndex) + result2 = Buffer.concat([ + result2.subarray(0, redir.startIndex), + result2.subarray(redir.endIndex) ]); } - return result3.toString("utf8").trim().replace(/\s+/g, " "); + return result2.toString("utf8").trim().replace(/\s+/g, " "); } getOutputRedirections() { return this.redirectionNodes.map(({ target, operator }) => ({ @@ -393757,10 +317408,10 @@ class TreeSitterParsedCommand { return this.treeSitterAnalysis; } } -function buildParsedCommandFromRoot(command, root3) { - const pipePositions = extractPipePositions(root3); - const redirectionNodes = extractRedirectionNodes(root3); - const analysis = analyzeCommand(root3, command); +function buildParsedCommandFromRoot(command, root2) { + const pipePositions = extractPipePositions(root2); + const redirectionNodes = extractRedirectionNodes(root2); + const analysis = analyzeCommand(root2, command); return new TreeSitterParsedCommand(command, pipePositions, redirectionNodes, analysis); } async function doParse(command) { @@ -393769,7 +317420,7 @@ async function doParse(command) { const treeSitterAvailable = await getTreeSitterAvailable(); if (treeSitterAvailable) { try { - const { parseCommand: parseCommand4 } = await Promise.resolve().then(() => (init_parser5(), exports_parser2)); + const { parseCommand: parseCommand4 } = await Promise.resolve().then(() => (init_parser4(), exports_parser2)); const data = await parseCommand4(command); if (data) { return buildParsedCommandFromRoot(command, data.rootNode); @@ -393784,7 +317435,7 @@ var init_ParsedCommand = __esm(() => { init_commands(); getTreeSitterAvailable = memoize_default(async () => { try { - const { parseCommand: parseCommand4 } = await Promise.resolve().then(() => (init_parser5(), exports_parser2)); + const { parseCommand: parseCommand4 } = await Promise.resolve().then(() => (init_parser4(), exports_parser2)); const testResult = await parseCommand4("echo test"); return testResult !== null; } catch { @@ -393811,8 +317462,8 @@ function extractQuotedContent(command, isJq = false) { let inSingleQuote = false; let inDoubleQuote = false; let escaped = false; - for (let i4 = 0;i4 < command.length; i4++) { - const char = command[i4]; + for (let i3 = 0;i3 < command.length; i3++) { + const char = command[i3]; if (escaped) { escaped = false; if (!inSingleQuote) @@ -393860,16 +317511,16 @@ function hasUnescapedChar(content, char) { if (char.length !== 1) { throw new Error("hasUnescapedChar only works with single characters"); } - let i4 = 0; - while (i4 < content.length) { - if (content[i4] === "\\" && i4 + 1 < content.length) { - i4 += 2; + let i3 = 0; + while (i3 < content.length) { + if (content[i3] === "\\" && i3 + 1 < content.length) { + i3 += 2; continue; } - if (content[i4] === char) { + if (content[i3] === char) { return true; } - i4++; + i3++; } return false; } @@ -393954,18 +317605,18 @@ function isSafeHeredoc(command) { let closingLineIdx = -1; let closeParenLineIdx = -1; let closeParenColIdx = -1; - for (let i4 = 0;i4 < bodyLines.length; i4++) { - const rawLine = bodyLines[i4]; + for (let i3 = 0;i3 < bodyLines.length; i3++) { + const rawLine = bodyLines[i3]; const line = isDash ? rawLine.replace(/^\t*/, "") : rawLine; if (line === delimiter2) { - closingLineIdx = i4; - const nextLine = bodyLines[i4 + 1]; + closingLineIdx = i3; + const nextLine = bodyLines[i3 + 1]; if (nextLine === undefined) return false; const parenMatch = nextLine.match(/^([ \t]*)\)/); if (!parenMatch) return false; - closeParenLineIdx = i4 + 1; + closeParenLineIdx = i3 + 1; closeParenColIdx = parenMatch[1].length; break; } @@ -393973,8 +317624,8 @@ function isSafeHeredoc(command) { const afterDelim = line.slice(delimiter2.length); const parenMatch = afterDelim.match(/^([ \t]*)\)/); if (parenMatch) { - closingLineIdx = i4; - closeParenLineIdx = i4; + closingLineIdx = i3; + closeParenLineIdx = i3; const tabPrefix = isDash ? rawLine.match(/^\t*/)?.[0] ?? "" : ""; closeParenColIdx = tabPrefix.length + delimiter2.length + parenMatch[1].length; break; @@ -393987,8 +317638,8 @@ function isSafeHeredoc(command) { if (closingLineIdx === -1) return false; let endPos = bodyStart; - for (let i4 = 0;i4 < closeParenLineIdx; i4++) { - endPos += bodyLines[i4].length + 1; + for (let i3 = 0;i3 < closeParenLineIdx; i3++) { + endPos += bodyLines[i3].length + 1; } endPos += closeParenColIdx + 1; verified.push({ start, end: endPos }); @@ -394025,7 +317676,7 @@ function stripSafeHeredocSubstitutions(command) { if (!HEREDOC_IN_SUBSTITUTION.test(command)) return null; const heredocPattern = /\$\(cat[ \t]*<<(-?)[ \t]*(?:'+([A-Za-z_]\w*)'+|\\([A-Za-z_]\w*))/g; - let result3 = command; + let result2 = command; let found = false; let match; const ranges = []; @@ -394047,20 +317698,20 @@ function stripSafeHeredocSubstitutions(command) { const bodyStart = operatorEnd + openLineEnd + 1; const bodyLines = command.slice(bodyStart).split(` `); - for (let i4 = 0;i4 < bodyLines.length; i4++) { - const rawLine = bodyLines[i4]; + for (let i3 = 0;i3 < bodyLines.length; i3++) { + const rawLine = bodyLines[i3]; const line = isDash ? rawLine.replace(/^\t*/, "") : rawLine; if (line.startsWith(delimiter2)) { - const after3 = line.slice(delimiter2.length); + const after2 = line.slice(delimiter2.length); let closePos = -1; - if (/^[ \t]*\)/.test(after3)) { - const lineStart = bodyStart + bodyLines.slice(0, i4).join(` -`).length + (i4 > 0 ? 1 : 0); + if (/^[ \t]*\)/.test(after2)) { + const lineStart = bodyStart + bodyLines.slice(0, i3).join(` +`).length + (i3 > 0 ? 1 : 0); closePos = command.indexOf(")", lineStart); - } else if (after3 === "") { - const nextLine = bodyLines[i4 + 1]; + } else if (after2 === "") { + const nextLine = bodyLines[i3 + 1]; if (nextLine !== undefined && /^[ \t]*\)/.test(nextLine)) { - const nextLineStart = bodyStart + bodyLines.slice(0, i4 + 1).join(` + const nextLineStart = bodyStart + bodyLines.slice(0, i3 + 1).join(` `).length + 1; closePos = command.indexOf(")", nextLineStart); } @@ -394075,11 +317726,11 @@ function stripSafeHeredocSubstitutions(command) { } if (!found) return null; - for (let i4 = ranges.length - 1;i4 >= 0; i4--) { - const r = ranges[i4]; - result3 = result3.slice(0, r.start) + result3.slice(r.end); + for (let i3 = ranges.length - 1;i3 >= 0; i3--) { + const r = ranges[i3]; + result2 = result2.slice(0, r.start) + result2.slice(r.end); } - return result3; + return result2; } function validateSafeCommandSubstitution(context) { const { originalCommand } = context; @@ -394135,8 +317786,8 @@ function validateGitCommit(context) { let unquoted = ""; let inSQ = false; let inDQ = false; - for (let i4 = 0;i4 < remainder.length; i4++) { - const c6 = remainder[i4]; + for (let i3 = 0;i3 < remainder.length; i3++) { + const c6 = remainder[i3]; if (c6 === "'" && !inDQ) { inSQ = !inSQ; continue; @@ -394321,8 +317972,8 @@ function validateCarriageReturn(context) { let inSingleQuote = false; let inDoubleQuote = false; let escaped = false; - for (let i4 = 0;i4 < originalCommand.length; i4++) { - const c6 = originalCommand[i4]; + for (let i3 = 0;i3 < originalCommand.length; i3++) { + const c6 = originalCommand[i3]; if (escaped) { escaped = false; continue; @@ -394484,9 +318135,9 @@ function validateObfuscatedFlags(context) { let inSingleQuote = false; let inDoubleQuote = false; let escaped = false; - for (let i4 = 0;i4 < originalCommand.length - 1; i4++) { - const currentChar = originalCommand[i4]; - const nextChar = originalCommand[i4 + 1]; + for (let i3 = 0;i3 < originalCommand.length - 1; i3++) { + const currentChar = originalCommand[i3]; + const nextChar = originalCommand[i3 + 1]; if (escaped) { escaped = false; continue; @@ -394508,7 +318159,7 @@ function validateObfuscatedFlags(context) { } if (currentChar && nextChar && /\s/.test(currentChar) && /['"`]/.test(nextChar)) { const quoteChar = nextChar; - let j = i4 + 2; + let j = i3 + 2; let insideQuote = ""; while (j < originalCommand.length && originalCommand[j] !== quoteChar) { insideQuote += originalCommand[j]; @@ -394568,7 +318219,7 @@ function validateObfuscatedFlags(context) { } } if (currentChar && nextChar && /\s/.test(currentChar) && nextChar === "-") { - let j = i4 + 1; + let j = i3 + 1; let flagContent = ""; while (j < originalCommand.length) { const flagChar = originalCommand[j]; @@ -394628,16 +318279,16 @@ function validateObfuscatedFlags(context) { function hasBackslashEscapedWhitespace(command) { let inSingleQuote = false; let inDoubleQuote = false; - for (let i4 = 0;i4 < command.length; i4++) { - const char = command[i4]; + for (let i3 = 0;i3 < command.length; i3++) { + const char = command[i3]; if (char === "\\" && !inSingleQuote) { if (!inDoubleQuote) { - const nextChar = command[i4 + 1]; + const nextChar = command[i3 + 1]; if (nextChar === " " || nextChar === "\t") { return true; } } - i4++; + i3++; continue; } if (char === '"' && !inSingleQuote) { @@ -394669,16 +318320,16 @@ function validateBackslashEscapedWhitespace(context) { function hasBackslashEscapedOperator(command) { let inSingleQuote = false; let inDoubleQuote = false; - for (let i4 = 0;i4 < command.length; i4++) { - const char = command[i4]; + for (let i3 = 0;i3 < command.length; i3++) { + const char = command[i3]; if (char === "\\" && !inSingleQuote) { if (!inDoubleQuote) { - const nextChar = command[i4 + 1]; + const nextChar = command[i3 + 1]; if (nextChar && SHELL_OPERATORS.has(nextChar)) { return true; } } - i4++; + i3++; continue; } if (char === "'" && !inDoubleQuote) { @@ -394712,10 +318363,10 @@ function validateBackslashEscapedOperators(context) { } function isEscapedAtPosition(content, pos) { let backslashCount = 0; - let i4 = pos - 1; - while (i4 >= 0 && content[i4] === "\\") { + let i3 = pos - 1; + while (i3 >= 0 && content[i3] === "\\") { backslashCount++; - i4--; + i3--; } return backslashCount % 2 === 1; } @@ -394723,10 +318374,10 @@ function validateBraceExpansion(context) { const content = context.fullyUnquotedPreStrip; let unescapedOpenBraces = 0; let unescapedCloseBraces = 0; - for (let i4 = 0;i4 < content.length; i4++) { - if (content[i4] === "{" && !isEscapedAtPosition(content, i4)) { + for (let i3 = 0;i3 < content.length; i3++) { + if (content[i3] === "{" && !isEscapedAtPosition(content, i3)) { unescapedOpenBraces++; - } else if (content[i4] === "}" && !isEscapedAtPosition(content, i4)) { + } else if (content[i3] === "}" && !isEscapedAtPosition(content, i3)) { unescapedCloseBraces++; } } @@ -394753,14 +318404,14 @@ function validateBraceExpansion(context) { }; } } - for (let i4 = 0;i4 < content.length; i4++) { - if (content[i4] !== "{") + for (let i3 = 0;i3 < content.length; i3++) { + if (content[i3] !== "{") continue; - if (isEscapedAtPosition(content, i4)) + if (isEscapedAtPosition(content, i3)) continue; let depth = 1; let matchingClose = -1; - for (let j = i4 + 1;j < content.length; j++) { + for (let j = i3 + 1;j < content.length; j++) { const ch2 = content[j]; if (ch2 === "{" && !isEscapedAtPosition(content, j)) { depth++; @@ -394775,7 +318426,7 @@ function validateBraceExpansion(context) { if (matchingClose === -1) continue; let innerDepth = 0; - for (let k = i4 + 1;k < matchingClose; k++) { + for (let k = i3 + 1;k < matchingClose; k++) { const ch2 = content[k]; if (ch2 === "{" && !isEscapedAtPosition(content, k)) { innerDepth++; @@ -394841,8 +318492,8 @@ function validateCommentQuoteDesync(context) { let inSingleQuote = false; let inDoubleQuote = false; let escaped = false; - for (let i4 = 0;i4 < originalCommand.length; i4++) { - const char = originalCommand[i4]; + for (let i3 = 0;i3 < originalCommand.length; i3++) { + const char = originalCommand[i3]; if (escaped) { escaped = false; continue; @@ -394871,8 +318522,8 @@ function validateCommentQuoteDesync(context) { } if (char === "#") { const lineEnd = originalCommand.indexOf(` -`, i4); - const commentText = originalCommand.slice(i4 + 1, lineEnd === -1 ? originalCommand.length : lineEnd); +`, i3); + const commentText = originalCommand.slice(i3 + 1, lineEnd === -1 ? originalCommand.length : lineEnd); if (/['"]/.test(commentText)) { logEvent("tengu_bash_security_check_triggered", { checkId: BASH_SECURITY_CHECK_IDS.COMMENT_QUOTE_DESYNC @@ -394884,7 +318535,7 @@ function validateCommentQuoteDesync(context) { } if (lineEnd === -1) break; - i4 = lineEnd; + i3 = lineEnd; } } return { behavior: "passthrough", message: "No comment quote desync" }; @@ -394898,8 +318549,8 @@ function validateQuotedNewline(context) { let inSingleQuote = false; let inDoubleQuote = false; let escaped = false; - for (let i4 = 0;i4 < originalCommand.length; i4++) { - const char = originalCommand[i4]; + for (let i3 = 0;i3 < originalCommand.length; i3++) { + const char = originalCommand[i3]; if (escaped) { escaped = false; continue; @@ -394918,7 +318569,7 @@ function validateQuotedNewline(context) { } if (char === ` ` && (inSingleQuote || inDoubleQuote)) { - const lineStart = i4 + 1; + const lineStart = i3 + 1; const nextNewline = originalCommand.indexOf(` `, lineStart); const lineEnd = nextNewline === -1 ? originalCommand.length : nextNewline; @@ -395016,15 +318667,15 @@ function bashCommandIsSafe_DEPRECATED(command) { validateGitCommit ]; for (const validator of earlyValidators) { - const result3 = validator(context); - if (result3.behavior === "allow") { + const result2 = validator(context); + if (result2.behavior === "allow") { return { behavior: "passthrough", - message: result3.decisionReason?.type === "other" || result3.decisionReason?.type === "safetyCheck" ? result3.decisionReason.reason : "Command allowed" + message: result2.decisionReason?.type === "other" || result2.decisionReason?.type === "safetyCheck" ? result2.decisionReason.reason : "Command allowed" }; } - if (result3.behavior !== "passthrough") { - return result3.behavior === "ask" ? { ...result3, isBashSecurityCheckForMisparsing: true } : result3; + if (result2.behavior !== "passthrough") { + return result2.behavior === "ask" ? { ...result2, isBashSecurityCheckForMisparsing: true } : result2; } } const nonMisparsingValidators = new Set([ @@ -395054,15 +318705,15 @@ function bashCommandIsSafe_DEPRECATED(command) { ]; let deferredNonMisparsingResult = null; for (const validator of validators3) { - const result3 = validator(context); - if (result3.behavior === "ask") { + const result2 = validator(context); + if (result2.behavior === "ask") { if (nonMisparsingValidators.has(validator)) { if (deferredNonMisparsingResult === null) { - deferredNonMisparsingResult = result3; + deferredNonMisparsingResult = result2; } continue; } - return { ...result3, isBashSecurityCheckForMisparsing: true }; + return { ...result2, isBashSecurityCheckForMisparsing: true }; } } if (deferredNonMisparsingResult !== null) { @@ -395131,15 +318782,15 @@ async function bashCommandIsSafeAsync_DEPRECATED(command, onDivergence) { validateGitCommit ]; for (const validator of earlyValidators) { - const result3 = validator(context); - if (result3.behavior === "allow") { + const result2 = validator(context); + if (result2.behavior === "allow") { return { behavior: "passthrough", - message: result3.decisionReason?.type === "other" || result3.decisionReason?.type === "safetyCheck" ? result3.decisionReason.reason : "Command allowed" + message: result2.decisionReason?.type === "other" || result2.decisionReason?.type === "safetyCheck" ? result2.decisionReason.reason : "Command allowed" }; } - if (result3.behavior !== "passthrough") { - return result3.behavior === "ask" ? { ...result3, isBashSecurityCheckForMisparsing: true } : result3; + if (result2.behavior !== "passthrough") { + return result2.behavior === "ask" ? { ...result2, isBashSecurityCheckForMisparsing: true } : result2; } } const nonMisparsingValidators = new Set([ @@ -395169,15 +318820,15 @@ async function bashCommandIsSafeAsync_DEPRECATED(command, onDivergence) { ]; let deferredNonMisparsingResult = null; for (const validator of validators3) { - const result3 = validator(context); - if (result3.behavior === "ask") { + const result2 = validator(context); + if (result2.behavior === "ask") { if (nonMisparsingValidators.has(validator)) { if (deferredNonMisparsingResult === null) { - deferredNonMisparsingResult = result3; + deferredNonMisparsingResult = result2; } continue; } - return { ...result3, isBashSecurityCheckForMisparsing: true }; + return { ...result2, isBashSecurityCheckForMisparsing: true }; } } if (deferredNonMisparsingResult !== null) { @@ -395269,8 +318920,8 @@ var init_bashSecurity = __esm(() => { function validateFlagsAgainstAllowlist(flags, allowedFlags) { for (const flag of flags) { if (flag.startsWith("-") && !flag.startsWith("--") && flag.length > 2) { - for (let i4 = 1;i4 < flag.length; i4++) { - const singleFlag = "-" + flag[i4]; + for (let i3 = 1;i3 < flag.length; i3++) { + const singleFlag = "-" + flag[i3]; if (!allowedFlags.includes(singleFlag)) { return false; } @@ -395381,25 +319032,25 @@ function isSubstitutionCommand(command, expressions, hasFileArguments, options2) if (!substitutionMatch) { return false; } - const rest3 = substitutionMatch[1]; + const rest2 = substitutionMatch[1]; let delimiterCount = 0; let lastDelimiterPos = -1; - let i4 = 0; - while (i4 < rest3.length) { - if (rest3[i4] === "\\") { - i4 += 2; + let i3 = 0; + while (i3 < rest2.length) { + if (rest2[i3] === "\\") { + i3 += 2; continue; } - if (rest3[i4] === "/") { + if (rest2[i3] === "/") { delimiterCount++; - lastDelimiterPos = i4; + lastDelimiterPos = i3; } - i4++; + i3++; } if (delimiterCount !== 2) { return false; } - const exprFlags = rest3.slice(lastDelimiterPos + 1); + const exprFlags = rest2.slice(lastDelimiterPos + 1); const allowedFlagChars = /^[gpimIM]*[1-9]?[gpimIM]*$/; if (!allowedFlagChars.test(exprFlags)) { return false; @@ -395452,8 +319103,8 @@ function hasFileArgs(command) { try { let argCount = 0; let hasEFlag = false; - for (let i4 = 0;i4 < parsed.length; i4++) { - const arg = parsed[i4]; + for (let i3 = 0;i3 < parsed.length; i3++) { + const arg = parsed[i3]; if (typeof arg !== "string" && typeof arg !== "object") continue; if (typeof arg === "object" && arg !== null && "op" in arg && arg.op === "glob") { @@ -395461,9 +319112,9 @@ function hasFileArgs(command) { } if (typeof arg !== "string") continue; - if ((arg === "-e" || arg === "--expression") && i4 + 1 < parsed.length) { + if ((arg === "-e" || arg === "--expression") && i3 + 1 < parsed.length) { hasEFlag = true; - i4++; + i3++; continue; } if (arg.startsWith("--expression=")) { @@ -395506,16 +319157,16 @@ function extractSedExpressions(command) { try { let foundEFlag = false; let foundExpression = false; - for (let i4 = 0;i4 < parsed.length; i4++) { - const arg = parsed[i4]; + for (let i3 = 0;i3 < parsed.length; i3++) { + const arg = parsed[i3]; if (typeof arg !== "string") continue; - if ((arg === "-e" || arg === "--expression") && i4 + 1 < parsed.length) { + if ((arg === "-e" || arg === "--expression") && i3 + 1 < parsed.length) { foundEFlag = true; - const nextArg = parsed[i4 + 1]; + const nextArg = parsed[i3 + 1]; if (typeof nextArg === "string") { expressions.push(nextArg); - i4++; + i3++; } continue; } @@ -395538,8 +319189,8 @@ function extractSedExpressions(command) { } break; } - } catch (error45) { - throw new Error(`Failed to parse sed command: ${error45 instanceof Error ? error45.message : "Unknown error"}`); + } catch (error41) { + throw new Error(`Failed to parse sed command: ${error41 instanceof Error ? error41.message : "Unknown error"}`); } return expressions; } @@ -395615,8 +319266,8 @@ function containsDangerousOperations(expression) { } return false; } -function checkSedConstraints(input3, toolPermissionContext) { - const commands = splitCommand_DEPRECATED(input3.command); +function checkSedConstraints(input, toolPermissionContext) { + const commands = splitCommand_DEPRECATED(input.command); for (const cmd of commands) { const trimmed = cmd.trim(); const baseCmd = trimmed.split(/\s+/)[0]; @@ -395649,14 +319300,14 @@ var init_sedValidation = __esm(() => { }); // src/tools/BashTool/pathValidation.ts -import { homedir as homedir16 } from "os"; -import { isAbsolute as isAbsolute11, resolve as resolve23 } from "path"; +import { homedir as homedir14 } from "os"; +import { isAbsolute as isAbsolute10, resolve as resolve17 } from "path"; function checkDangerousRemovalPaths(command, args, cwd2) { const extractor = PATH_EXTRACTORS[command]; const paths2 = extractor(args); - for (const path16 of paths2) { - const cleanPath = expandTilde(path16.replace(/^['"]|['"]$/g, "")); - const absolutePath = isAbsolute11(cleanPath) ? cleanPath : resolve23(cwd2, cleanPath); + for (const path11 of paths2) { + const cleanPath = expandTilde(path11.replace(/^['"]|['"]$/g, "")); + const absolutePath = isAbsolute10(cleanPath) ? cleanPath : resolve17(cwd2, cleanPath); if (isDangerousRemovalPath(absolutePath)) { return { behavior: "ask", @@ -395677,25 +319328,25 @@ This command would remove a critical system directory. This requires explicit ap }; } function filterOutFlags(args) { - const result3 = []; + const result2 = []; let afterDoubleDash = false; for (const arg of args) { if (afterDoubleDash) { - result3.push(arg); + result2.push(arg); } else if (arg === "--") { afterDoubleDash = true; } else if (!arg?.startsWith("-")) { - result3.push(arg); + result2.push(arg); } } - return result3; + return result2; } -function parsePatternCommand(args, flagsWithArgs, defaults4 = []) { +function parsePatternCommand(args, flagsWithArgs, defaults3 = []) { const paths2 = []; let patternFound = false; let afterDoubleDash = false; - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (arg === undefined || arg === null) continue; if (!afterDoubleDash && arg === "--") { @@ -395708,7 +319359,7 @@ function parsePatternCommand(args, flagsWithArgs, defaults4 = []) { patternFound = true; } if (flag && flagsWithArgs.has(flag) && !arg.includes("=")) { - i4++; + i3++; } continue; } @@ -395718,7 +319369,7 @@ function parsePatternCommand(args, flagsWithArgs, defaults4 = []) { } paths2.push(arg); } - return paths2.length > 0 ? paths2 : defaults4; + return paths2.length > 0 ? paths2 : defaults3; } function validateCommandPaths(command, args, cwd2, toolPermissionContext, compoundCommandHasCd, operationTypeOverride) { const extractor = PATH_EXTRACTORS[command]; @@ -395745,8 +319396,8 @@ function validateCommandPaths(command, args, cwd2, toolPermissionContext, compou } }; } - for (const path16 of paths2) { - const { allowed, resolvedPath, decisionReason } = validatePath(path16, cwd2, toolPermissionContext, operationType); + for (const path11 of paths2) { + const { allowed, resolvedPath, decisionReason } = validatePath(path11, cwd2, toolPermissionContext, operationType); if (!allowed) { const workingDirs = Array.from(allWorkingDirectories(toolPermissionContext)); const dirListStr = formatDirectoryList(workingDirs); @@ -395773,9 +319424,9 @@ function validateCommandPaths(command, args, cwd2, toolPermissionContext, compou } function createPathChecker(command, operationTypeOverride) { return (args, cwd2, context, compoundCommandHasCd) => { - const result3 = validateCommandPaths(command, args, cwd2, context, compoundCommandHasCd, operationTypeOverride); - if (result3.behavior === "deny") { - return result3; + const result2 = validateCommandPaths(command, args, cwd2, context, compoundCommandHasCd, operationTypeOverride); + if (result2.behavior === "deny") { + return result2; } if (command === "rm" || command === "rmdir") { const dangerousPathResult = checkDangerousRemovalPaths(command, args, cwd2); @@ -395783,15 +319434,15 @@ function createPathChecker(command, operationTypeOverride) { return dangerousPathResult; } } - if (result3.behavior === "passthrough") { - return result3; + if (result2.behavior === "passthrough") { + return result2; } - if (result3.behavior === "ask") { + if (result2.behavior === "ask") { const operationType = operationTypeOverride ?? COMMAND_OPERATION_TYPE[command]; const suggestions = []; - if (result3.blockedPath) { + if (result2.blockedPath) { if (operationType === "read") { - const dirPath = getDirectoryForPath(result3.blockedPath); + const dirPath = getDirectoryForPath(result2.blockedPath); const suggestion = createReadRuleSuggestion(dirPath, "session"); if (suggestion) { suggestions.push(suggestion); @@ -395799,7 +319450,7 @@ function createPathChecker(command, operationTypeOverride) { } else { suggestions.push({ type: "addDirectories", - directories: [getDirectoryForPath(result3.blockedPath)], + directories: [getDirectoryForPath(result2.blockedPath)], destination: "session" }); } @@ -395811,13 +319462,13 @@ function createPathChecker(command, operationTypeOverride) { destination: "session" }); } - result3.suggestions = suggestions; + result2.suggestions = suggestions; } - return result3; + return result2; }; } function parseCommandArguments(cmd) { - const parseResult = tryParseShellCommand(cmd, (env5) => `$${env5}`); + const parseResult = tryParseShellCommand(cmd, (env4) => `$${env4}`); if (!parseResult.success) { return []; } @@ -395918,8 +319569,8 @@ function validateOutputRedirections(redirections, cwd2, toolPermissionContext, c message: "No unsafe redirections found" }; } -function checkPathConstraints(input3, cwd2, toolPermissionContext, compoundCommandHasCd, astRedirects, astCommands) { - if (!astCommands && />>\s*>\s*\(|>\s*>\s*\(|<\s*\(/.test(input3.command)) { +function checkPathConstraints(input, cwd2, toolPermissionContext, compoundCommandHasCd, astRedirects, astCommands) { + if (!astCommands && />>\s*>\s*\(|>\s*>\s*\(|<\s*\(/.test(input.command)) { return { behavior: "ask", message: "Process substitution (>(...) or <(...)) can execute arbitrary commands and requires manual approval", @@ -395929,7 +319580,7 @@ function checkPathConstraints(input3, cwd2, toolPermissionContext, compoundComma } }; } - const { redirections, hasDangerousRedirection } = astRedirects ? astRedirectsToOutputRedirections(astRedirects) : extractOutputRedirections(input3.command); + const { redirections, hasDangerousRedirection } = astRedirects ? astRedirectsToOutputRedirections(astRedirects) : extractOutputRedirections(input.command); if (hasDangerousRedirection) { return { behavior: "ask", @@ -395946,17 +319597,17 @@ function checkPathConstraints(input3, cwd2, toolPermissionContext, compoundComma } if (astCommands) { for (const cmd of astCommands) { - const result3 = validateSinglePathCommandArgv(cmd, cwd2, toolPermissionContext, compoundCommandHasCd); - if (result3.behavior === "ask" || result3.behavior === "deny") { - return result3; + const result2 = validateSinglePathCommandArgv(cmd, cwd2, toolPermissionContext, compoundCommandHasCd); + if (result2.behavior === "ask" || result2.behavior === "deny") { + return result2; } } } else { - const commands = splitCommand_DEPRECATED(input3.command); + const commands = splitCommand_DEPRECATED(input.command); for (const cmd of commands) { - const result3 = validateSinglePathCommand(cmd, cwd2, toolPermissionContext, compoundCommandHasCd); - if (result3.behavior === "ask" || result3.behavior === "deny") { - return result3; + const result2 = validateSinglePathCommand(cmd, cwd2, toolPermissionContext, compoundCommandHasCd); + if (result2.behavior === "ask" || result2.behavior === "deny") { + return result2; } } } @@ -395993,67 +319644,67 @@ function astRedirectsToOutputRedirections(redirects) { return { redirections, hasDangerousRedirection: false }; } function skipTimeoutFlags(a2) { - let i4 = 1; - while (i4 < a2.length) { - const arg = a2[i4]; - const next = a2[i4 + 1]; + let i3 = 1; + while (i3 < a2.length) { + const arg = a2[i3]; + const next = a2[i3 + 1]; if (arg === "--foreground" || arg === "--preserve-status" || arg === "--verbose") - i4++; + i3++; else if (/^--(?:kill-after|signal)=[A-Za-z0-9_.+-]+$/.test(arg)) - i4++; + i3++; else if ((arg === "--kill-after" || arg === "--signal") && next && TIMEOUT_FLAG_VALUE_RE.test(next)) - i4 += 2; + i3 += 2; else if (arg === "--") { - i4++; + i3++; break; } else if (arg.startsWith("--")) return -1; else if (arg === "-v") - i4++; + i3++; else if ((arg === "-k" || arg === "-s") && next && TIMEOUT_FLAG_VALUE_RE.test(next)) - i4 += 2; + i3 += 2; else if (/^-[ks][A-Za-z0-9_.+-]+$/.test(arg)) - i4++; + i3++; else if (arg.startsWith("-")) return -1; else break; } - return i4; + return i3; } function skipStdbufFlags(a2) { - let i4 = 1; - while (i4 < a2.length) { - const arg = a2[i4]; - if (/^-[ioe]$/.test(arg) && a2[i4 + 1]) - i4 += 2; + let i3 = 1; + while (i3 < a2.length) { + const arg = a2[i3]; + if (/^-[ioe]$/.test(arg) && a2[i3 + 1]) + i3 += 2; else if (/^-[ioe]./.test(arg)) - i4++; + i3++; else if (/^--(input|output|error)=/.test(arg)) - i4++; + i3++; else if (arg.startsWith("-")) return -1; else break; } - return i4 > 1 && i4 < a2.length ? i4 : -1; + return i3 > 1 && i3 < a2.length ? i3 : -1; } function skipEnvFlags(a2) { - let i4 = 1; - while (i4 < a2.length) { - const arg = a2[i4]; + let i3 = 1; + while (i3 < a2.length) { + const arg = a2[i3]; if (arg.includes("=") && !arg.startsWith("-")) - i4++; + i3++; else if (arg === "-i" || arg === "-0" || arg === "-v") - i4++; - else if (arg === "-u" && a2[i4 + 1]) - i4 += 2; + i3++; + else if (arg === "-u" && a2[i3 + 1]) + i3 += 2; else if (arg.startsWith("-")) return -1; else break; } - return i4 < a2.length ? i4 : -1; + return i3 < a2.length ? i3 : -1; } function stripWrappersFromArgv(argv) { let a2 = argv; @@ -396061,10 +319712,10 @@ function stripWrappersFromArgv(argv) { if (a2[0] === "time" || a2[0] === "nohup") { a2 = a2.slice(a2[1] === "--" ? 2 : 1); } else if (a2[0] === "timeout") { - const i4 = skipTimeoutFlags(a2); - if (i4 < 0 || !a2[i4] || !/^\d+(?:\.\d+)?[smhd]?$/.test(a2[i4])) + const i3 = skipTimeoutFlags(a2); + if (i3 < 0 || !a2[i3] || !/^\d+(?:\.\d+)?[smhd]?$/.test(a2[i3])) return a2; - a2 = a2.slice(i4 + 1); + a2 = a2.slice(i3 + 1); } else if (a2[0] === "nice") { if (a2[1] === "-n" && a2[2] && /^-?\d+$/.test(a2[2])) a2 = a2.slice(a2[3] === "--" ? 4 : 3); @@ -396073,15 +319724,15 @@ function stripWrappersFromArgv(argv) { else a2 = a2.slice(a2[1] === "--" ? 2 : 1); } else if (a2[0] === "stdbuf") { - const i4 = skipStdbufFlags(a2); - if (i4 < 0) + const i3 = skipStdbufFlags(a2); + if (i3 < 0) return a2; - a2 = a2.slice(i4); + a2 = a2.slice(i3); } else if (a2[0] === "env") { - const i4 = skipEnvFlags(a2); - if (i4 < 0) + const i3 = skipEnvFlags(a2); + if (i3 < 0) return a2; - a2 = a2.slice(i4); + a2 = a2.slice(i3); } else { return a2; } @@ -396098,7 +319749,7 @@ var init_pathValidation2 = __esm(() => { init_bashPermissions(); init_sedValidation(); PATH_EXTRACTORS = { - cd: (args) => args.length === 0 ? [homedir16()] : [args.join(" ")], + cd: (args) => args.length === 0 ? [homedir14()] : [args.join(" ")], ls: (args) => { const paths2 = filterOutFlags(args); return paths2.length > 0 ? paths2 : ["."]; @@ -396121,8 +319772,8 @@ var init_pathValidation2 = __esm(() => { const newerPattern = /^-newer[acmBt][acmtB]$/; let foundNonGlobalFlag = false; let afterDoubleDash = false; - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (!arg) continue; if (afterDoubleDash) { @@ -396138,10 +319789,10 @@ var init_pathValidation2 = __esm(() => { continue; foundNonGlobalFlag = true; if (pathFlags.has(arg) || newerPattern.test(arg)) { - const nextArg = args[i4 + 1]; + const nextArg = args[i3 + 1]; if (nextArg) { paths2.push(nextArg); - i4++; + i3++; } } continue; @@ -396240,12 +319891,12 @@ var init_pathValidation2 = __esm(() => { let skipNext = false; let scriptFound = false; let afterDoubleDash = false; - for (let i4 = 0;i4 < args.length; i4++) { + for (let i3 = 0;i3 < args.length; i3++) { if (skipNext) { skipNext = false; continue; } - const arg = args[i4]; + const arg = args[i3]; if (!arg) continue; if (!afterDoubleDash && arg === "--") { @@ -396254,7 +319905,7 @@ var init_pathValidation2 = __esm(() => { } if (!afterDoubleDash && arg.startsWith("-")) { if (["-f", "--file"].includes(arg)) { - const scriptFile = args[i4 + 1]; + const scriptFile = args[i3 + 1]; if (scriptFile) { paths2.push(scriptFile); skipNext = true; @@ -396296,8 +319947,8 @@ var init_pathValidation2 = __esm(() => { ]); let filterFound = false; let afterDoubleDash = false; - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (arg === undefined || arg === null) continue; if (!afterDoubleDash && arg === "--") { @@ -396310,7 +319961,7 @@ var init_pathValidation2 = __esm(() => { filterFound = true; } if (flag && flagsWithArgs.has(flag) && !arg.includes("=")) { - i4++; + i3++; } continue; } @@ -396420,8 +320071,8 @@ var init_pathValidation2 = __esm(() => { function getCommandAllowlist() { let allowlist = COMMAND_ALLOWLIST; if (getPlatform() === "windows") { - const { xargs: _, ...rest3 } = allowlist; - allowlist = rest3; + const { xargs: _, ...rest2 } = allowlist; + allowlist = rest2; } if (process.env.USER_TYPE === "ant") { return { ...allowlist, ...ANT_ONLY_COMMAND_ALLOWLIST }; @@ -396429,7 +320080,7 @@ function getCommandAllowlist() { return allowlist; } function isCommandSafeViaFlagParsing(command) { - const parseResult = tryParseShellCommand(command, (env5) => `$${env5}`); + const parseResult = tryParseShellCommand(command, (env4) => `$${env4}`); if (!parseResult.success) return false; const parsed = parseResult.tokens.map((token) => { @@ -396455,14 +320106,14 @@ function isCommandSafeViaFlagParsing(command) { for (const [cmdPattern] of Object.entries(allowlist)) { const cmdTokens = cmdPattern.split(" "); if (tokens.length >= cmdTokens.length) { - let matches3 = true; - for (let i4 = 0;i4 < cmdTokens.length; i4++) { - if (tokens[i4] !== cmdTokens[i4]) { - matches3 = false; + let matches2 = true; + for (let i3 = 0;i3 < cmdTokens.length; i3++) { + if (tokens[i3] !== cmdTokens[i3]) { + matches2 = false; break; } } - if (matches3) { + if (matches2) { commandConfig = allowlist[cmdPattern]; commandTokens = cmdTokens.length; break; @@ -396473,8 +320124,8 @@ function isCommandSafeViaFlagParsing(command) { return false; } if (tokens[0] === "git" && tokens[1] === "ls-remote") { - for (let i4 = 2;i4 < tokens.length; i4++) { - const token = tokens[i4]; + for (let i3 = 2;i3 < tokens.length; i3++) { + const token = tokens[i3]; if (token && !token.startsWith("-")) { if (token.includes("://")) { return false; @@ -396488,8 +320139,8 @@ function isCommandSafeViaFlagParsing(command) { } } } - for (let i4 = commandTokens;i4 < tokens.length; i4++) { - const token = tokens[i4]; + for (let i3 = commandTokens;i3 < tokens.length; i3++) { + const token = tokens[i3]; if (!token) continue; if (token.includes("$")) { @@ -396527,8 +320178,8 @@ function containsUnquotedExpansion(command) { let inSingleQuote = false; let inDoubleQuote = false; let escaped = false; - for (let i4 = 0;i4 < command.length; i4++) { - const currentChar = command[i4]; + for (let i3 = 0;i3 < command.length; i3++) { + const currentChar = command[i3]; if (escaped) { escaped = false; continue; @@ -396549,7 +320200,7 @@ function containsUnquotedExpansion(command) { continue; } if (currentChar === "$") { - const next = command[i4 + 1]; + const next = command[i3 + 1]; if (next && /[A-Za-z_@*#?!$0-9-]/.test(next)) { return true; } @@ -396596,12 +320247,12 @@ function isCommandReadOnly(command) { function commandHasAnyGit(command) { return splitCommand_DEPRECATED(command).some((subcmd) => isNormalizedGitCommand(subcmd.trim())); } -function isGitInternalPath(path16) { - const normalized = path16.replace(/^\.?\//, ""); +function isGitInternalPath(path11) { + const normalized = path11.replace(/^\.?\//, ""); return GIT_INTERNAL_PATTERNS.some((pattern) => pattern.test(normalized)); } function extractWritePathsFromSubcommand(subcommand) { - const parseResult = tryParseShellCommand(subcommand, (env5) => `$${env5}`); + const parseResult = tryParseShellCommand(subcommand, (env4) => `$${env4}`); if (!parseResult.success) return []; const tokens = parseResult.tokens.filter((t) => typeof t === "string"); @@ -396627,8 +320278,8 @@ function commandWritesToGitInternalPaths(command) { for (const subcmd of subcommands) { const trimmed = subcmd.trim(); const writePaths = extractWritePathsFromSubcommand(trimmed); - for (const path16 of writePaths) { - if (isGitInternalPath(path16)) { + for (const path11 of writePaths) { + if (isGitInternalPath(path11)) { return true; } } @@ -396641,10 +320292,10 @@ function commandWritesToGitInternalPaths(command) { } return false; } -function checkReadOnlyConstraints(input3, compoundCommandHasCd) { - const { command } = input3; - const result3 = tryParseShellCommand(command, (env5) => `$${env5}`); - if (!result3.success) { +function checkReadOnlyConstraints(input, compoundCommandHasCd) { + const { command } = input; + const result2 = tryParseShellCommand(command, (env4) => `$${env4}`); + if (!result2.success) { return { behavior: "passthrough", message: "Command cannot be parsed, requires further permission checks" @@ -396696,7 +320347,7 @@ function checkReadOnlyConstraints(input3, compoundCommandHasCd) { if (allSubcommandsReadOnly) { return { behavior: "allow", - updatedInput: input3 + updatedInput: input }; } return { @@ -397270,22 +320921,22 @@ var init_readOnlyValidation = __esm(() => { "--iso-8601", "--rfc-3339" ]); - let i4 = 0; - while (i4 < args.length) { - const token = args[i4]; + let i3 = 0; + while (i3 < args.length) { + const token = args[i3]; if (token.startsWith("--") && token.includes("=")) { - i4++; + i3++; } else if (token.startsWith("-")) { if (flagsWithArgs.has(token)) { - i4 += 2; + i3 += 2; } else { - i4++; + i3++; } } else { if (!token.startsWith("+")) { return true; } - i4++; + i3++; } } return false; @@ -397470,27 +321121,27 @@ var init_readOnlyValidation = __esm(() => { "rmcup" ]); const flagsWithArgs = new Set(["-T"]); - let i4 = 0; + let i3 = 0; let afterDoubleDash = false; - while (i4 < args.length) { - const token = args[i4]; + while (i3 < args.length) { + const token = args[i3]; if (token === "--") { afterDoubleDash = true; - i4++; + i3++; } else if (!afterDoubleDash && token.startsWith("-")) { if (token === "-S") return true; if (!token.startsWith("--") && token.length > 2 && token.includes("S")) return true; if (flagsWithArgs.has(token)) { - i4 += 2; + i3 += 2; } else { - i4++; + i3++; } } else { if (DANGEROUS_CAPABILITIES.has(token)) return true; - i4++; + i3++; } } return false; @@ -397756,15 +321407,15 @@ async function* all3(generators, concurrencyCap = Infinity) { } } } -async function toArray4(generator) { - const result3 = []; +async function toArray3(generator) { + const result2 = []; for await (const a2 of generator) { - result3.push(a2); + result2.push(a2); } - return result3; + return result2; } -async function* fromArray(values4) { - for (const value of values4) { +async function* fromArray(values2) { + for (const value of values2) { yield value; } } @@ -397782,16 +321433,16 @@ async function* runTools(toolUseMessages, assistantMessages, canUseTool, toolUse for (const { isConcurrencySafe, blocks } of partitionToolCalls(toolUseMessages, currentContext)) { if (isConcurrencySafe) { const queuedContextModifiers = {}; - for await (const update3 of runToolsConcurrently(blocks, assistantMessages, canUseTool, currentContext)) { - if (update3.contextModifier) { - const { toolUseID, modifyContext } = update3.contextModifier; + for await (const update2 of runToolsConcurrently(blocks, assistantMessages, canUseTool, currentContext)) { + if (update2.contextModifier) { + const { toolUseID, modifyContext } = update2.contextModifier; if (!queuedContextModifiers[toolUseID]) { queuedContextModifiers[toolUseID] = []; } queuedContextModifiers[toolUseID].push(modifyContext); } yield { - message: update3.message, + message: update2.message, newContext: currentContext }; } @@ -397806,12 +321457,12 @@ async function* runTools(toolUseMessages, assistantMessages, canUseTool, toolUse } yield { newContext: currentContext }; } else { - for await (const update3 of runToolsSerially(blocks, assistantMessages, canUseTool, currentContext)) { - if (update3.newContext) { - currentContext = update3.newContext; + for await (const update2 of runToolsSerially(blocks, assistantMessages, canUseTool, currentContext)) { + if (update2.newContext) { + currentContext = update2.newContext; } yield { - message: update3.message, + message: update2.message, newContext: currentContext }; } @@ -397841,12 +321492,12 @@ async function* runToolsSerially(toolUseMessages, assistantMessages, canUseTool, let currentContext = toolUseContext; for (const toolUse of toolUseMessages) { toolUseContext.setInProgressToolUseIDs((prev) => new Set(prev).add(toolUse.id)); - for await (const update3 of runToolUse(toolUse, assistantMessages.find((_) => _.message.content.some((_2) => _2.type === "tool_use" && _2.id === toolUse.id)), canUseTool, currentContext)) { - if (update3.contextModifier) { - currentContext = update3.contextModifier.modifyContext(currentContext); + for await (const update2 of runToolUse(toolUse, assistantMessages.find((_) => _.message.content.some((_2) => _2.type === "tool_use" && _2.id === toolUse.id)), canUseTool, currentContext)) { + if (update2.contextModifier) { + currentContext = update2.contextModifier.modifyContext(currentContext); } yield { - message: update3.message, + message: update2.message, newContext: currentContext }; } @@ -397942,9 +321593,9 @@ function* normalizeMessage(message) { break; } const trackingKey = message.parentToolUseID; - const now3 = Date.now(); + const now2 = Date.now(); const lastSent = toolProgressLastSentTime.get(trackingKey) || 0; - const timeSinceLastSent = now3 - lastSent; + const timeSinceLastSent = now2 - lastSent; if (timeSinceLastSent >= TOOL_PROGRESS_THROTTLE_MS) { if (toolProgressLastSentTime.size >= MAX_TOOL_PROGRESS_TRACKING_ENTRIES) { const firstKey = toolProgressLastSentTime.keys().next().value; @@ -397952,7 +321603,7 @@ function* normalizeMessage(message) { toolProgressLastSentTime.delete(firstKey); } } - toolProgressLastSentTime.set(trackingKey, now3); + toolProgressLastSentTime.set(trackingKey, now2); yield { type: "tool_progress", tool_use_id: message.toolUseID, @@ -398041,14 +321692,14 @@ async function* handleOrphanedPermission(orphanedPermission, tools, mutableMessa parent_tool_use_id: null }; yield sdkAssistantMessage; - for await (const update3 of runTools([finalToolUseBlock], [assistantMessage], canUseTool, processUserInputContext)) { - if (update3.message) { - mutableMessages.push(update3.message); + for await (const update2 of runTools([finalToolUseBlock], [assistantMessage], canUseTool, processUserInputContext)) { + if (update2.message) { + mutableMessages.push(update2.message); if (persistSession) { await recordTranscript(mutableMessages); } const sdkMessage = { - ...update3.message, + ...update2.message, session_id: getSessionId(), parent_tool_use_id: null }; @@ -398065,24 +321716,24 @@ function extractReadFilesFromMessages(messages, cwd2, maxSize = ASK_READ_FILE_ST if (message.type === "assistant" && Array.isArray(message.message.content)) { for (const content of message.message.content) { if (content.type === "tool_use" && content.name === FILE_READ_TOOL_NAME) { - const input3 = content.input; - if (input3?.file_path && input3?.offset === undefined && input3?.limit === undefined) { - const absolutePath = expandPath(input3.file_path, cwd2); + const input = content.input; + if (input?.file_path && input?.offset === undefined && input?.limit === undefined) { + const absolutePath = expandPath(input.file_path, cwd2); fileReadToolUseIds.set(content.id, absolutePath); } } else if (content.type === "tool_use" && content.name === FILE_WRITE_TOOL_NAME) { - const input3 = content.input; - if (input3?.file_path && input3?.content) { - const absolutePath = expandPath(input3.file_path, cwd2); + const input = content.input; + if (input?.file_path && input?.content) { + const absolutePath = expandPath(input.file_path, cwd2); fileWriteToolUseIds.set(content.id, { filePath: absolutePath, - content: input3.content + content: input.content }); } } else if (content.type === "tool_use" && content.name === FILE_EDIT_TOOL_NAME) { - const input3 = content.input; - if (input3?.file_path) { - const absolutePath = expandPath(input3.file_path, cwd2); + const input = content.input; + if (input?.file_path) { + const absolutePath = expandPath(input.file_path, cwd2); fileEditToolUseIds.set(content.id, absolutePath); } } @@ -398147,10 +321798,10 @@ function extractBashToolsFromMessages(messages) { if (message.type === "assistant" && Array.isArray(message.message.content)) { for (const content of message.message.content) { if (content.type === "tool_use" && content.name === BASH_TOOL_NAME) { - const { input: input3 } = content; - if (typeof input3 !== "object" || input3 === null || !("command" in input3)) + const { input } = content; + if (typeof input !== "object" || input === null || !("command" in input)) continue; - const cmd = extractCliName(typeof input3.command === "string" ? input3.command : undefined); + const cmd = extractCliName(typeof input.command === "string" ? input.command : undefined); if (cmd) { tools.add(cmd); } @@ -398187,7 +321838,7 @@ var init_queryHelpers = __esm(() => { init_file(); init_fileRead(); init_fileStateCache(); - init_messages5(); + init_messages3(); init_path2(); init_sessionStorage(); toolProgressLastSentTime = new Map; @@ -398196,14 +321847,14 @@ var init_queryHelpers = __esm(() => { // src/services/PromptSuggestion/speculation.ts import { randomUUID as randomUUID8 } from "crypto"; -import { rm as rm4 } from "fs"; -import { appendFile as appendFile4, copyFile as copyFile2, mkdir as mkdir9 } from "fs/promises"; -import { dirname as dirname26, isAbsolute as isAbsolute12, join as join57, relative as relative9 } from "path"; +import { rm as rm2 } from "fs"; +import { appendFile as appendFile4, copyFile, mkdir as mkdir9 } from "fs/promises"; +import { dirname as dirname23, isAbsolute as isAbsolute11, join as join47, relative as relative7 } from "path"; function safeRemoveOverlay(overlayPath) { - rm4(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {}); + rm2(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {}); } function getOverlayPath(id) { - return join57(getClaudeTempDir(), "speculation", String(process.pid), id); + return join47(getClaudeTempDir(), "speculation", String(process.pid), id); } function denySpeculation(message, reason) { return { @@ -398215,11 +321866,11 @@ function denySpeculation(message, reason) { async function copyOverlayToMain(overlayPath, writtenPaths, cwd2) { let allCopied = true; for (const rel of writtenPaths) { - const src = join57(overlayPath, rel); - const dest = join57(cwd2, rel); + const src = join47(overlayPath, rel); + const dest = join47(cwd2, rel); try { - await mkdir9(dirname26(dest), { recursive: true }); - await copyFile2(src, dest); + await mkdir9(dirname23(dest), { recursive: true }); + await copyFile(src, dest); } catch { allCopied = false; logForDebugging(`[Speculation] Failed to copy ${rel} to main`); @@ -398312,8 +321963,8 @@ function createSpeculationFeedbackMessage(messages, boundary, timeSavedMs, sessi parts.push(`${formatNumber(tokens)} tokens`); } const savedText = `+${formatDuration(timeSavedMs)} saved`; - const sessionSuffix2 = sessionTotalMs !== timeSavedMs ? ` (${formatDuration(sessionTotalMs)} this session)` : ""; - return createSystemMessage(`[ANT-ONLY] ${parts.join(" · ")} · ${savedText}${sessionSuffix2}`, "warning"); + const sessionSuffix = sessionTotalMs !== timeSavedMs ? ` (${formatDuration(sessionTotalMs)} this session)` : ""; + return createSystemMessage(`[ANT-ONLY] ${parts.join(" · ")} · ${savedText}${sessionSuffix}`, "warning"); } function updateActiveSpeculationState(setAppState, updater) { setAppState((prev) => { @@ -398375,10 +322026,10 @@ async function generatePipelinedSuggestion(context, suggestionText, speculatedMe generationRequestId } })); - } catch (error45) { - if (error45 instanceof Error && error45.name === "AbortError") + } catch (error41) { + if (error41 instanceof Error && error41.name === "AbortError") return; - logForDebugging(`[Speculation] Pipelined suggestion failed: ${errorMessage(error45)}`); + logForDebugging(`[Speculation] Pipelined suggestion failed: ${errorMessage(error41)}`); } } async function startSpeculation(suggestionText, context, setAppState, isPipelined = false, cacheSafeParams) { @@ -398419,11 +322070,11 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline })); logForDebugging(`[Speculation] Starting speculation ${id}`); try { - const result3 = await runForkedAgent({ + const result2 = await runForkedAgent({ promptMessages: [createUserMessage({ content: suggestionText })], cacheSafeParams: cacheSafeParams ?? createCacheSafeParams(context), skipTranscript: true, - canUseTool: async (tool, input3) => { + canUseTool: async (tool, input) => { const isWriteTool = WRITE_TOOLS.has(tool.name); const isSafeReadOnlyTool = SAFE_READ_ONLY_TOOLS.has(tool.name); if (isWriteTool) { @@ -398432,7 +322083,7 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline const canAutoAcceptEdits = mode === "acceptEdits" || mode === "bypassPermissions" || mode === "plan" && isBypassPermissionsModeAvailable; if (!canAutoAcceptEdits) { logForDebugging(`[Speculation] Stopping at file edit: ${tool.name}`); - const editPath = "file_path" in input3 ? input3.file_path : undefined; + const editPath = "file_path" in input ? input.file_path : undefined; updateActiveSpeculationState(setAppState, () => ({ boundary: { type: "edit", @@ -398446,18 +322097,18 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline } } if (isWriteTool || isSafeReadOnlyTool) { - const pathKey2 = "notebook_path" in input3 ? "notebook_path" : ("path" in input3) ? "path" : "file_path"; - const filePath = input3[pathKey2]; + const pathKey2 = "notebook_path" in input ? "notebook_path" : ("path" in input) ? "path" : "file_path"; + const filePath = input[pathKey2]; if (filePath) { - const rel = relative9(cwd2, filePath); - if (isAbsolute12(rel) || rel.startsWith("..")) { + const rel = relative7(cwd2, filePath); + if (isAbsolute11(rel) || rel.startsWith("..")) { if (isWriteTool) { logForDebugging(`[Speculation] Denied ${tool.name}: path outside cwd: ${filePath}`); return denySpeculation("Write outside cwd not allowed during speculation", "speculation_write_outside_root"); } return { behavior: "allow", - updatedInput: input3, + updatedInput: input, decisionReason: { type: "other", reason: "speculation_read_outside_root" @@ -398466,23 +322117,23 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline } if (isWriteTool) { if (!writtenPathsRef.current.has(rel)) { - const overlayFile = join57(overlayPath, rel); - await mkdir9(dirname26(overlayFile), { recursive: true }); + const overlayFile = join47(overlayPath, rel); + await mkdir9(dirname23(overlayFile), { recursive: true }); try { - await copyFile2(join57(cwd2, rel), overlayFile); + await copyFile(join47(cwd2, rel), overlayFile); } catch {} writtenPathsRef.current.add(rel); } - input3 = { ...input3, [pathKey2]: join57(overlayPath, rel) }; + input = { ...input, [pathKey2]: join47(overlayPath, rel) }; } else { if (writtenPathsRef.current.has(rel)) { - input3 = { ...input3, [pathKey2]: join57(overlayPath, rel) }; + input = { ...input, [pathKey2]: join47(overlayPath, rel) }; } } - logForDebugging(`[Speculation] ${isWriteTool ? "Write" : "Read"} ${filePath} -> ${input3[pathKey2]}`); + logForDebugging(`[Speculation] ${isWriteTool ? "Write" : "Read"} ${filePath} -> ${input[pathKey2]}`); return { behavior: "allow", - updatedInput: input3, + updatedInput: input, decisionReason: { type: "other", reason: "speculation_file_access" @@ -398492,7 +322143,7 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline if (isSafeReadOnlyTool) { return { behavior: "allow", - updatedInput: input3, + updatedInput: input, decisionReason: { type: "other", reason: "speculation_read_default_cwd" @@ -398501,7 +322152,7 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline } } if (tool.name === "Bash") { - const command = "command" in input3 && typeof input3.command === "string" ? input3.command : ""; + const command = "command" in input && typeof input.command === "string" ? input.command : ""; if (!command || checkReadOnlyConstraints({ command }, commandHasAnyCd(command)).behavior !== "allow") { logForDebugging(`[Speculation] Stopping at bash: ${command.slice(0, 50) || "missing command"}`); updateActiveSpeculationState(setAppState, () => ({ @@ -398512,7 +322163,7 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline } return { behavior: "allow", - updatedInput: input3, + updatedInput: input, decisionReason: { type: "other", reason: "speculation_readonly_bash" @@ -398520,7 +322171,7 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline }; } logForDebugging(`[Speculation] Stopping at denied tool: ${tool.name}`); - const detail = String("url" in input3 && input3.url || "file_path" in input3 && input3.file_path || "path" in input3 && input3.path || "command" in input3 && input3.command || "").slice(0, 200); + const detail = String("url" in input && input.url || "file_path" in input && input.file_path || "path" in input && input.path || "command" in input && input.command || "").slice(0, 200); updateActiveSpeculationState(setAppState, () => ({ boundary: { type: "denied_tool", @@ -398559,23 +322210,23 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline boundary: { type: "complete", completedAt: Date.now(), - outputTokens: result3.totalUsage.output_tokens + outputTokens: result2.totalUsage.output_tokens } })); logForDebugging(`[Speculation] Complete: ${countToolsInMessages(messagesRef.current)} tools`); generatePipelinedSuggestion(contextRef.current, suggestionText, messagesRef.current, setAppState, abortController); - } catch (error45) { + } catch (error41) { abortController.abort(); - if (error45 instanceof Error && error45.name === "AbortError") { + if (error41 instanceof Error && error41.name === "AbortError") { safeRemoveOverlay(overlayPath); resetSpeculationState(setAppState); return; } safeRemoveOverlay(overlayPath); - logError2(error45 instanceof Error ? error45 : new Error("Speculation failed")); + logError2(error41 instanceof Error ? error41 : new Error("Speculation failed")); logSpeculation(id, "error", startTime, suggestionText.length, messagesRef.current, null, { - error_type: error45 instanceof Error ? error45.name : "Unknown", - error_message: errorMessage(error45).slice(0, 200), + error_type: error41 instanceof Error ? error41.name : "Unknown", + error_message: errorMessage(error41).slice(0, 200), error_phase: "start", is_pipelined: isPipelined }); @@ -398657,7 +322308,7 @@ function abortSpeculation(setAppState) { return { ...prev, speculation: IDLE_SPECULATION_STATE }; }); } -async function handleSpeculationAccept(speculationState, speculationSessionTimeSavedMs, setAppState, input3, deps) { +async function handleSpeculationAccept(speculationState, speculationSessionTimeSavedMs, setAppState, input, deps) { try { const { setMessages, readFileState, cwd: cwd2 } = deps; setAppState((prev) => { @@ -398677,31 +322328,31 @@ async function handleSpeculationAccept(speculationState, speculationSessionTimeS }); const speculationMessages = speculationState.messagesRef.current; let cleanMessages = prepareMessagesForInjection(speculationMessages); - const userMessage = createUserMessage({ content: input3 }); + const userMessage = createUserMessage({ content: input }); setMessages((prev) => [...prev, userMessage]); - const result3 = await acceptSpeculation(speculationState, setAppState, cleanMessages.length); - const isComplete = result3?.boundary?.type === "complete"; + const result2 = await acceptSpeculation(speculationState, setAppState, cleanMessages.length); + const isComplete = result2?.boundary?.type === "complete"; if (!isComplete) { const lastNonAssistant = cleanMessages.findLastIndex((m) => m.type !== "assistant"); cleanMessages = cleanMessages.slice(0, lastNonAssistant + 1); } - const timeSavedMs = result3?.timeSavedMs ?? 0; + const timeSavedMs = result2?.timeSavedMs ?? 0; const newSessionTotal = speculationSessionTimeSavedMs + timeSavedMs; - const feedbackMessage = createSpeculationFeedbackMessage(cleanMessages, result3?.boundary ?? null, timeSavedMs, newSessionTotal); + const feedbackMessage = createSpeculationFeedbackMessage(cleanMessages, result2?.boundary ?? null, timeSavedMs, newSessionTotal); setMessages((prev) => [...prev, ...cleanMessages]); const extracted = extractReadFilesFromMessages(cleanMessages, cwd2, READ_FILE_STATE_CACHE_SIZE); readFileState.current = mergeFileStateCaches(readFileState.current, extracted); if (feedbackMessage) { setMessages((prev) => [...prev, feedbackMessage]); } - logForDebugging(`[Speculation] ${result3?.boundary?.type ?? "incomplete"}, injected ${cleanMessages.length} messages`); + logForDebugging(`[Speculation] ${result2?.boundary?.type ?? "incomplete"}, injected ${cleanMessages.length} messages`); if (isComplete && speculationState.pipelinedSuggestion) { - const { text: text2, promptId, generationRequestId } = speculationState.pipelinedSuggestion; - logForDebugging(`[Speculation] Promoting pipelined suggestion: "${text2.slice(0, 50)}..."`); + const { text, promptId, generationRequestId } = speculationState.pipelinedSuggestion; + logForDebugging(`[Speculation] Promoting pipelined suggestion: "${text.slice(0, 50)}..."`); setAppState((prev) => ({ ...prev, promptSuggestion: { - text: text2, + text, promptId, shownAt: Date.now(), acceptedAt: 0, @@ -398712,18 +322363,18 @@ async function handleSpeculationAccept(speculationState, speculationSessionTimeS ...speculationState.contextRef.current, messages: [ ...speculationState.contextRef.current.messages, - createUserMessage({ content: input3 }), + createUserMessage({ content: input }), ...cleanMessages ] }; - startSpeculation(text2, augmentedContext, setAppState, true); + startSpeculation(text, augmentedContext, setAppState, true); } return { queryRequired: !isComplete }; - } catch (error45) { - logError2(error45 instanceof Error ? error45 : new Error("handleSpeculationAccept failed")); + } catch (error41) { + logError2(error41 instanceof Error ? error41 : new Error("handleSpeculationAccept failed")); logSpeculation(speculationState.id, "error", speculationState.startTime, speculationState.suggestionLength, speculationState.messagesRef.current, speculationState.boundary, { - error_type: error45 instanceof Error ? error45.name : "Unknown", - error_message: errorMessage(error45).slice(0, 200), + error_type: error41 instanceof Error ? error41.name : "Unknown", + error_message: errorMessage(error41).slice(0, 200), error_phase: "accept", is_pipelined: speculationState.isPipelined }); @@ -398746,7 +322397,7 @@ var init_speculation = __esm(() => { init_forkedAgent(); init_format(); init_log3(); - init_messages5(); + init_messages3(); init_filesystem(); init_queryHelpers(); init_sessionStorage(); @@ -398995,31 +322646,31 @@ var init_promptCategory = __esm(() => { }); // src/utils/claudeInChrome/common.ts -import { readdirSync as readdirSync5 } from "fs"; -import { stat as stat19 } from "fs/promises"; -import { homedir as homedir17, platform as platform2, tmpdir as tmpdir5, userInfo as userInfo3 } from "os"; -import { join as join58 } from "path"; +import { readdirSync as readdirSync2 } from "fs"; +import { stat as stat18 } from "fs/promises"; +import { homedir as homedir15, platform as platform2, tmpdir as tmpdir2, userInfo as userInfo3 } from "os"; +import { join as join48 } from "path"; function getAllBrowserDataPaths() { const platform3 = getPlatform(); - const home = homedir17(); + const home = homedir15(); const paths2 = []; for (const browserId of BROWSER_DETECTION_ORDER) { - const config4 = CHROMIUM_BROWSERS[browserId]; + const config2 = CHROMIUM_BROWSERS[browserId]; let dataPath; switch (platform3) { case "macos": - dataPath = config4.macos.dataPath; + dataPath = config2.macos.dataPath; break; case "linux": case "wsl": - dataPath = config4.linux.dataPath; + dataPath = config2.linux.dataPath; break; case "windows": { - if (config4.windows.dataPath.length > 0) { - const appDataBase = config4.windows.useRoaming ? join58(home, "AppData", "Roaming") : join58(home, "AppData", "Local"); + if (config2.windows.dataPath.length > 0) { + const appDataBase = config2.windows.useRoaming ? join48(home, "AppData", "Roaming") : join48(home, "AppData", "Local"); paths2.push({ browser: browserId, - path: join58(appDataBase, ...config4.windows.dataPath) + path: join48(appDataBase, ...config2.windows.dataPath) }); } continue; @@ -399028,7 +322679,7 @@ function getAllBrowserDataPaths() { if (dataPath && dataPath.length > 0) { paths2.push({ browser: browserId, - path: join58(home, ...dataPath) + path: join48(home, ...dataPath) }); } } @@ -399036,25 +322687,25 @@ function getAllBrowserDataPaths() { } function getAllNativeMessagingHostsDirs() { const platform3 = getPlatform(); - const home = homedir17(); + const home = homedir15(); const paths2 = []; for (const browserId of BROWSER_DETECTION_ORDER) { - const config4 = CHROMIUM_BROWSERS[browserId]; + const config2 = CHROMIUM_BROWSERS[browserId]; switch (platform3) { case "macos": - if (config4.macos.nativeMessagingPath.length > 0) { + if (config2.macos.nativeMessagingPath.length > 0) { paths2.push({ browser: browserId, - path: join58(home, ...config4.macos.nativeMessagingPath) + path: join48(home, ...config2.macos.nativeMessagingPath) }); } break; case "linux": case "wsl": - if (config4.linux.nativeMessagingPath.length > 0) { + if (config2.linux.nativeMessagingPath.length > 0) { paths2.push({ browser: browserId, - path: join58(home, ...config4.linux.nativeMessagingPath) + path: join48(home, ...config2.linux.nativeMessagingPath) }); } break; @@ -399065,29 +322716,29 @@ function getAllNativeMessagingHostsDirs() { return paths2; } function getAllWindowsRegistryKeys() { - const keys3 = []; + const keys2 = []; for (const browserId of BROWSER_DETECTION_ORDER) { - const config4 = CHROMIUM_BROWSERS[browserId]; - if (config4.windows.registryKey) { - keys3.push({ + const config2 = CHROMIUM_BROWSERS[browserId]; + if (config2.windows.registryKey) { + keys2.push({ browser: browserId, - key: config4.windows.registryKey + key: config2.windows.registryKey }); } } - return keys3; + return keys2; } async function detectAvailableBrowser() { const platform3 = getPlatform(); for (const browserId of BROWSER_DETECTION_ORDER) { - const config4 = CHROMIUM_BROWSERS[browserId]; + const config2 = CHROMIUM_BROWSERS[browserId]; switch (platform3) { case "macos": { - const appPath = `/Applications/${config4.macos.appName}.app`; + const appPath = `/Applications/${config2.macos.appName}.app`; try { - const stats = await stat19(appPath); + const stats = await stat18(appPath); if (stats.isDirectory()) { - logForDebugging(`[Claude in Chrome] Detected browser: ${config4.name}`); + logForDebugging(`[Claude in Chrome] Detected browser: ${config2.name}`); return browserId; } } catch (e) { @@ -399098,23 +322749,23 @@ async function detectAvailableBrowser() { } case "wsl": case "linux": { - for (const binary of config4.linux.binaries) { + for (const binary of config2.linux.binaries) { if (await which(binary).catch(() => null)) { - logForDebugging(`[Claude in Chrome] Detected browser: ${config4.name}`); + logForDebugging(`[Claude in Chrome] Detected browser: ${config2.name}`); return browserId; } } break; } case "windows": { - const home = homedir17(); - if (config4.windows.dataPath.length > 0) { - const appDataBase = config4.windows.useRoaming ? join58(home, "AppData", "Roaming") : join58(home, "AppData", "Local"); - const dataPath = join58(appDataBase, ...config4.windows.dataPath); + const home = homedir15(); + if (config2.windows.dataPath.length > 0) { + const appDataBase = config2.windows.useRoaming ? join48(home, "AppData", "Roaming") : join48(home, "AppData", "Local"); + const dataPath = join48(appDataBase, ...config2.windows.dataPath); try { - const stats = await stat19(dataPath); + const stats = await stat18(dataPath); if (stats.isDirectory()) { - logForDebugging(`[Claude in Chrome] Detected browser: ${config4.name}`); + logForDebugging(`[Claude in Chrome] Detected browser: ${config2.name}`); return browserId; } } catch (e) { @@ -399144,12 +322795,12 @@ async function openInChrome(url3) { logForDebugging("[Claude in Chrome] No compatible browser found"); return false; } - const config4 = CHROMIUM_BROWSERS[browser]; + const config2 = CHROMIUM_BROWSERS[browser]; switch (currentPlatform) { case "macos": { const { code } = await execFileNoThrow("open", [ "-a", - config4.macos.appName, + config2.macos.appName, url3 ]); return code === 0; @@ -399160,7 +322811,7 @@ async function openInChrome(url3) { } case "wsl": case "linux": { - for (const binary of config4.linux.binaries) { + for (const binary of config2.linux.binaries) { const { code } = await execFileNoThrow(binary, [url3]); if (code === 0) { return true; @@ -399179,7 +322830,7 @@ function getSecureSocketPath() { if (platform2() === "win32") { return `\\\\.\\pipe\\${getSocketName()}`; } - return join58(getSocketDir(), `${process.pid}.sock`); + return join48(getSocketDir(), `${process.pid}.sock`); } function getAllSocketPaths() { if (platform2() === "win32") { @@ -399188,15 +322839,15 @@ function getAllSocketPaths() { const paths2 = []; const socketDir = getSocketDir(); try { - const files2 = readdirSync5(socketDir); - for (const file2 of files2) { + const files = readdirSync2(socketDir); + for (const file2 of files) { if (file2.endsWith(".sock")) { - paths2.push(join58(socketDir, file2)); + paths2.push(join48(socketDir, file2)); } } } catch {} const legacyName = `claude-mcp-browser-bridge-${getUsername2()}`; - const legacyTmpdir = join58(tmpdir5(), legacyName); + const legacyTmpdir = join48(tmpdir2(), legacyName); const legacyTmp = `/tmp/${legacyName}`; if (!paths2.includes(legacyTmpdir)) { paths2.push(legacyTmpdir); @@ -399431,31 +323082,31 @@ function expandEnvVarsInString(value) { } // src/utils/plugins/mcpPluginIntegration.ts -import { join as join59 } from "path"; -async function loadMcpServersFromMcpb(plugin, mcpbPath, errors5) { +import { join as join49 } from "path"; +async function loadMcpServersFromMcpb(plugin, mcpbPath, errors4) { try { logForDebugging(`Loading MCP servers from MCPB: ${mcpbPath}`); const pluginId = plugin.repository; - const result3 = await loadMcpbFile(mcpbPath, plugin.path, pluginId, (status) => { + const result2 = await loadMcpbFile(mcpbPath, plugin.path, pluginId, (status) => { logForDebugging(`MCPB [${plugin.name}]: ${status}`); }); - if ("status" in result3 && result3.status === "needs-config") { + if ("status" in result2 && result2.status === "needs-config") { logForDebugging(`MCPB ${mcpbPath} requires user configuration. ` + `User can configure via: /plugin → Manage plugins → ${plugin.name} → Configure`); return null; } - const successResult = result3; + const successResult = result2; const serverName = successResult.manifest.name; logForDebugging(`Loaded MCP server "${serverName}" from MCPB (extracted to ${successResult.extractedPath})`); return { [serverName]: successResult.mcpConfig }; - } catch (error45) { - const errorMsg = errorMessage(error45); + } catch (error41) { + const errorMsg = errorMessage(error41); logForDebugging(`Failed to load MCPB ${mcpbPath}: ${errorMsg}`, { level: "error" }); const source = `${plugin.name}@${plugin.repository}`; const isUrl3 = mcpbPath.startsWith("http"); if (isUrl3 && (errorMsg.includes("download") || errorMsg.includes("network"))) { - errors5.push({ + errors4.push({ type: "mcpb-download-failed", source, plugin: plugin.name, @@ -399463,7 +323114,7 @@ async function loadMcpServersFromMcpb(plugin, mcpbPath, errors5) { reason: errorMsg }); } else if (errorMsg.includes("manifest") || errorMsg.includes("user configuration")) { - errors5.push({ + errors4.push({ type: "mcpb-invalid-manifest", source, plugin: plugin.name, @@ -399471,7 +323122,7 @@ async function loadMcpServersFromMcpb(plugin, mcpbPath, errors5) { validationError: errorMsg }); } else { - errors5.push({ + errors4.push({ type: "mcpb-extract-failed", source, plugin: plugin.name, @@ -399482,7 +323133,7 @@ async function loadMcpServersFromMcpb(plugin, mcpbPath, errors5) { return null; } } -async function loadPluginMcpServers(plugin, errors5 = []) { +async function loadPluginMcpServers(plugin, errors4 = []) { let servers = {}; const defaultMcpServers = await loadMcpServersFromFile(plugin.path, ".mcp.json"); if (defaultMcpServers) { @@ -399492,7 +323143,7 @@ async function loadPluginMcpServers(plugin, errors5 = []) { const mcpServersSpec = plugin.manifest.mcpServers; if (typeof mcpServersSpec === "string") { if (isMcpbSource(mcpServersSpec)) { - const mcpbServers = await loadMcpServersFromMcpb(plugin, mcpServersSpec, errors5); + const mcpbServers = await loadMcpServersFromMcpb(plugin, mcpServersSpec, errors4); if (mcpbServers) { servers = { ...servers, ...mcpbServers }; } @@ -399507,7 +323158,7 @@ async function loadPluginMcpServers(plugin, errors5 = []) { try { if (typeof spec === "string") { if (isMcpbSource(spec)) { - return await loadMcpServersFromMcpb(plugin, spec, errors5); + return await loadMcpServersFromMcpb(plugin, spec, errors4); } return await loadMcpServersFromFile(plugin.path, spec); } @@ -399517,9 +323168,9 @@ async function loadPluginMcpServers(plugin, errors5 = []) { return null; } })); - for (const result3 of results) { - if (result3) { - servers = { ...servers, ...result3 }; + for (const result2 of results) { + if (result2) { + servers = { ...servers, ...result2 }; } } } else { @@ -399529,11 +323180,11 @@ async function loadPluginMcpServers(plugin, errors5 = []) { return Object.keys(servers).length > 0 ? servers : undefined; } async function loadMcpServersFromFile(pluginPath, relativePath) { - const fs9 = getFsImplementation(); - const filePath = join59(pluginPath, relativePath); + const fs3 = getFsImplementation(); + const filePath = join49(pluginPath, relativePath); let content; try { - content = await fs9.readFile(filePath, { encoding: "utf-8" }); + content = await fs3.readFile(filePath, { encoding: "utf-8" }); } catch (e) { if (isENOENT(e)) { return null; @@ -399547,17 +323198,17 @@ async function loadMcpServersFromFile(pluginPath, relativePath) { const parsed = jsonParse(content); const mcpServers = parsed.mcpServers || parsed; const validatedServers = {}; - for (const [name, config4] of Object.entries(mcpServers)) { - const result3 = McpServerConfigSchema().safeParse(config4); - if (result3.success) { - validatedServers[name] = result3.data; + for (const [name, config2] of Object.entries(mcpServers)) { + const result2 = McpServerConfigSchema().safeParse(config2); + if (result2.success) { + validatedServers[name] = result2.data; } else { - logForDebugging(`Invalid MCP server config for ${name} in ${filePath}: ${result3.error.message}`, { level: "error" }); + logForDebugging(`Invalid MCP server config for ${name} in ${filePath}: ${result2.error.message}`, { level: "error" }); } } return validatedServers; - } catch (error45) { - logForDebugging(`Failed to load MCP servers from ${filePath}: ${error45}`, { + } catch (error41) { + logForDebugging(`Failed to load MCP servers from ${filePath}: ${error41}`, { level: "error" }); return null; @@ -399595,10 +323246,10 @@ function loadChannelUserConfig(plugin, serverName) { } function addPluginScopeToServers(servers, pluginName, pluginSource) { const scopedServers = {}; - for (const [name, config4] of Object.entries(servers)) { + for (const [name, config2] of Object.entries(servers)) { const scopedName = `plugin:${pluginName}:${name}`; const scoped = { - ...config4, + ...config2, scope: "dynamic", pluginSource }; @@ -399613,7 +323264,7 @@ function buildMcpUserConfig(plugin, serverName) { return; return { ...topLevel, ...channelSpecific }; } -function resolvePluginMcpEnvironment(config4, plugin, userConfig, errors5, pluginName, serverName) { +function resolvePluginMcpEnvironment(config2, plugin, userConfig, errors4, pluginName, serverName) { const allMissingVars = []; const resolveValue2 = (value) => { let resolved2 = substitutePluginVariables(value, plugin); @@ -399625,10 +323276,10 @@ function resolvePluginMcpEnvironment(config4, plugin, userConfig, errors5, plugi return expanded; }; let resolved; - switch (config4.type) { + switch (config2.type) { case undefined: case "stdio": { - const stdioConfig = { ...config4 }; + const stdioConfig = { ...config2 }; if (stdioConfig.command) { stdioConfig.command = resolveValue2(stdioConfig.command); } @@ -399652,7 +323303,7 @@ function resolvePluginMcpEnvironment(config4, plugin, userConfig, errors5, plugi case "sse": case "http": case "ws": { - const remoteConfig = { ...config4 }; + const remoteConfig = { ...config2 }; if (remoteConfig.url) { remoteConfig.url = resolveValue2(remoteConfig.url); } @@ -399670,15 +323321,15 @@ function resolvePluginMcpEnvironment(config4, plugin, userConfig, errors5, plugi case "ws-ide": case "sdk": case "claudeai-proxy": - resolved = config4; + resolved = config2; break; } - if (errors5 && allMissingVars.length > 0) { + if (errors4 && allMissingVars.length > 0) { const uniqueMissingVars = [...new Set(allMissingVars)]; const varList = uniqueMissingVars.join(", "); logForDebugging(`Missing environment variables in plugin MCP config: ${varList}`, { level: "warn" }); if (pluginName && serverName) { - errors5.push({ + errors4.push({ type: "mcp-config-invalid", source: `plugin:${pluginName}`, plugin: pluginName, @@ -399689,25 +323340,25 @@ function resolvePluginMcpEnvironment(config4, plugin, userConfig, errors5, plugi } return resolved; } -async function getPluginMcpServers(plugin, errors5 = []) { +async function getPluginMcpServers(plugin, errors4 = []) { if (!plugin.enabled) { return; } - const servers = plugin.mcpServers || await loadPluginMcpServers(plugin, errors5); + const servers = plugin.mcpServers || await loadPluginMcpServers(plugin, errors4); if (!servers) { return; } const resolvedServers = {}; - for (const [name, config4] of Object.entries(servers)) { + for (const [name, config2] of Object.entries(servers)) { const userConfig = buildMcpUserConfig(plugin, name); try { - resolvedServers[name] = resolvePluginMcpEnvironment(config4, plugin, userConfig, errors5, plugin.name, name); - } catch (err3) { - errors5?.push({ + resolvedServers[name] = resolvePluginMcpEnvironment(config2, plugin, userConfig, errors4, plugin.name, name); + } catch (err2) { + errors4?.push({ type: "generic-error", source: name, plugin: plugin.name, - error: errorMessage(err3) + error: errorMessage(err2) }); } } @@ -399746,11 +323397,11 @@ var init_claudeai = __esm(() => { init_memoize(); init_oauth(); init_analytics(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_envUtils(); - init_client10(); + init_client6(); fetchClaudeAIMcpConfigsIfEligible = memoize_default(async () => { try { if (isEnvDefinedFalsy(process.env.ENABLE_CLAUDEAI_MCP_SERVERS)) { @@ -399820,8 +323471,8 @@ var init_claudeai = __esm(() => { }); // src/services/mcp/utils.ts -import { createHash as createHash7 } from "crypto"; -import { join as join60 } from "path"; +import { createHash as createHash6 } from "crypto"; +import { join as join50 } from "path"; function filterToolsByServer(tools, serverName) { const prefix = `mcp__${normalizeNameForMCP(serverName)}__`; return tools.filter((tool) => tool.name?.startsWith(prefix)); @@ -399844,13 +323495,13 @@ function excludeCommandsByServer(commands, serverName) { return commands.filter((c6) => !commandBelongsToServer(c6, serverName)); } function excludeResourcesByServer(resources, serverName) { - const result3 = { ...resources }; - delete result3[serverName]; - return result3; + const result2 = { ...resources }; + delete result2[serverName]; + return result2; } -function hashMcpConfig(config4) { - const { scope: _scope, ...rest3 } = config4; - const stable = jsonStringify(rest3, (_k, v) => { +function hashMcpConfig(config2) { + const { scope: _scope, ...rest2 } = config2; + const stable = jsonStringify(rest2, (_k, v) => { if (v && typeof v === "object" && !Array.isArray(v)) { const obj = v; const sorted = {}; @@ -399860,7 +323511,7 @@ function hashMcpConfig(config4) { } return v; }); - return createHash7("sha256").update(stable).digest("hex").slice(0, 16); + return createHash6("sha256").update(stable).digest("hex").slice(0, 16); } function excludeStalePluginClients(mcp, configs) { const stale = mcp.clients.filter((c6) => { @@ -399899,7 +323550,7 @@ function describeMcpConfigFilePath(scope) { case "user": return getGlobalClaudeFile(); case "project": - return join60(getCwd(), ".mcp.json"); + return join50(getCwd(), ".mcp.json"); case "local": return `${getGlobalClaudeFile()} [project: ${getCwd()}]`; case "dynamic": @@ -399993,17 +323644,17 @@ function getMcpServerScopeFromToolName(toolName) { } return serverConfig?.scope ?? null; } -function isStdioConfig(config4) { - return config4.type === "stdio" || config4.type === undefined; +function isStdioConfig(config2) { + return config2.type === "stdio" || config2.type === undefined; } -function isSSEConfig(config4) { - return config4.type === "sse"; +function isSSEConfig(config2) { + return config2.type === "sse"; } -function isHTTPConfig(config4) { - return config4.type === "http"; +function isHTTPConfig(config2) { + return config2.type === "http"; } -function isWebSocketConfig(config4) { - return config4.type === "ws"; +function isWebSocketConfig(config2) { + return config2.type === "ws"; } function extractAgentMcpServers(agents) { const serverMap = new Map; @@ -400030,57 +323681,57 @@ function extractAgentMcpServers(agents) { } } } - const result3 = []; - for (const [name, { config: config4, sourceAgents }] of serverMap) { - if (isStdioConfig(config4)) { - result3.push({ + const result2 = []; + for (const [name, { config: config2, sourceAgents }] of serverMap) { + if (isStdioConfig(config2)) { + result2.push({ name, sourceAgents, transport: "stdio", - command: config4.command, + command: config2.command, needsAuth: false }); - } else if (isSSEConfig(config4)) { - result3.push({ + } else if (isSSEConfig(config2)) { + result2.push({ name, sourceAgents, transport: "sse", - url: config4.url, + url: config2.url, needsAuth: true }); - } else if (isHTTPConfig(config4)) { - result3.push({ + } else if (isHTTPConfig(config2)) { + result2.push({ name, sourceAgents, transport: "http", - url: config4.url, + url: config2.url, needsAuth: true }); - } else if (isWebSocketConfig(config4)) { - result3.push({ + } else if (isWebSocketConfig(config2)) { + result2.push({ name, sourceAgents, transport: "ws", - url: config4.url, + url: config2.url, needsAuth: false }); } } - return result3.sort((a2, b) => a2.name.localeCompare(b.name)); + return result2.sort((a2, b) => a2.name.localeCompare(b.name)); } -function getLoggingSafeMcpBaseUrl(config4) { - if (!("url" in config4) || typeof config4.url !== "string") { +function getLoggingSafeMcpBaseUrl(config2) { + if (!("url" in config2) || typeof config2.url !== "string") { return; } try { - const url3 = new URL(config4.url); + const url3 = new URL(config2.url); url3.search = ""; return url3.toString().replace(/\/$/, ""); } catch { return; } } -var init_utils4 = __esm(() => { +var init_utils3 = __esm(() => { init_state(); init_cwd2(); init_env(); @@ -400093,26 +323744,26 @@ var init_utils4 = __esm(() => { }); // src/services/mcp/config.ts -import { chmod as chmod2, open as open5, rename, stat as stat20, unlink as unlink4 } from "fs/promises"; -import { dirname as dirname27, join as join61, parse as parse9 } from "path"; +import { chmod as chmod2, open as open5, rename, stat as stat19, unlink as unlink4 } from "fs/promises"; +import { dirname as dirname24, join as join51, parse as parse9 } from "path"; function getEnterpriseMcpFilePath() { - return join61(getManagedFilePath(), "managed-mcp.json"); + return join51(getManagedFilePath(), "managed-mcp.json"); } function addScopeToServers(servers, scope) { if (!servers) { return {}; } const scopedServers = {}; - for (const [name, config4] of Object.entries(servers)) { - scopedServers[name] = { ...config4, scope }; + for (const [name, config2] of Object.entries(servers)) { + scopedServers[name] = { ...config2, scope }; } return scopedServers; } -async function writeMcpjsonFile(config4) { - const mcpJsonPath = join61(getCwd(), ".mcp.json"); +async function writeMcpjsonFile(config2) { + const mcpJsonPath = join51(getCwd(), ".mcp.json"); let existingMode; try { - const stats = await stat20(mcpJsonPath); + const stats = await stat19(mcpJsonPath); existingMode = stats.mode; } catch (e) { const code = getErrnoCode(e); @@ -400123,7 +323774,7 @@ async function writeMcpjsonFile(config4) { const tempPath = `${mcpJsonPath}.tmp.${process.pid}.${Date.now()}`; const handle = await open5(tempPath, "w", existingMode ?? 420); try { - await handle.writeFile(jsonStringify(config4, null, 2), { + await handle.writeFile(jsonStringify(config2, null, 2), { encoding: "utf8" }); await handle.datasync(); @@ -400142,11 +323793,11 @@ async function writeMcpjsonFile(config4) { throw e; } } -function getServerCommandArray(config4) { - if (config4.type !== undefined && config4.type !== "stdio") { +function getServerCommandArray(config2) { + if (config2.type !== undefined && config2.type !== "stdio") { return null; } - const stdioConfig = config4; + const stdioConfig = config2; return [stdioConfig.command, ...stdioConfig.args ?? []]; } function commandArraysMatch(a2, b) { @@ -400155,8 +323806,8 @@ function commandArraysMatch(a2, b) { } return a2.every((val, idx) => val === b[idx]); } -function getServerUrl(config4) { - return "url" in config4 ? config4.url : null; +function getServerUrl(config2) { + return "url" in config2 ? config2.url : null; } function unwrapCcrProxyUrl(url3) { if (!CCR_PROXY_PATH_MARKERS.some((m) => url3.includes(m))) { @@ -400170,12 +323821,12 @@ function unwrapCcrProxyUrl(url3) { return url3; } } -function getMcpServerSignature(config4) { - const cmd = getServerCommandArray(config4); +function getMcpServerSignature(config2) { + const cmd = getServerCommandArray(config2); if (cmd) { return `stdio:${jsonStringify(cmd)}`; } - const url3 = getServerUrl(config4); + const url3 = getServerUrl(config2); if (url3) { return `url:${unwrapCcrProxyUrl(url3)}`; } @@ -400183,18 +323834,18 @@ function getMcpServerSignature(config4) { } function dedupPluginMcpServers(pluginServers, manualServers) { const manualSigs = new Map; - for (const [name, config4] of Object.entries(manualServers)) { - const sig = getMcpServerSignature(config4); + for (const [name, config2] of Object.entries(manualServers)) { + const sig = getMcpServerSignature(config2); if (sig && !manualSigs.has(sig)) manualSigs.set(sig, name); } const servers = {}; const suppressed = []; const seenPluginSigs = new Map; - for (const [name, config4] of Object.entries(pluginServers)) { - const sig = getMcpServerSignature(config4); + for (const [name, config2] of Object.entries(pluginServers)) { + const sig = getMcpServerSignature(config2); if (sig === null) { - servers[name] = config4; + servers[name] = config2; continue; } const manualDup = manualSigs.get(sig); @@ -400210,30 +323861,30 @@ function dedupPluginMcpServers(pluginServers, manualServers) { continue; } seenPluginSigs.set(sig, name); - servers[name] = config4; + servers[name] = config2; } return { servers, suppressed }; } function dedupClaudeAiMcpServers(claudeAiServers, manualServers) { const manualSigs = new Map; - for (const [name, config4] of Object.entries(manualServers)) { + for (const [name, config2] of Object.entries(manualServers)) { if (isMcpServerDisabled(name)) continue; - const sig = getMcpServerSignature(config4); + const sig = getMcpServerSignature(config2); if (sig && !manualSigs.has(sig)) manualSigs.set(sig, name); } const servers = {}; const suppressed = []; - for (const [name, config4] of Object.entries(claudeAiServers)) { - const sig = getMcpServerSignature(config4); + for (const [name, config2] of Object.entries(claudeAiServers)) { + const sig = getMcpServerSignature(config2); const manualDup = sig !== null ? manualSigs.get(sig) : undefined; if (manualDup !== undefined) { logForDebugging(`Suppressing claude.ai connector "${name}": duplicates manually-configured "${manualDup}"`); suppressed.push({ name, duplicateOf: manualDup }); continue; } - servers[name] = config4; + servers[name] = config2; } return { servers, suppressed }; } @@ -400255,7 +323906,7 @@ function getMcpAllowlistSettings() { function getMcpDenylistSettings() { return getInitialSettings(); } -function isMcpServerDenied(serverName, config4) { +function isMcpServerDenied(serverName, config2) { const settings = getMcpDenylistSettings(); if (!settings.deniedMcpServers) { return false; @@ -400265,8 +323916,8 @@ function isMcpServerDenied(serverName, config4) { return true; } } - if (config4) { - const serverCommand = getServerCommandArray(config4); + if (config2) { + const serverCommand = getServerCommandArray(config2); if (serverCommand) { for (const entry of settings.deniedMcpServers) { if (isMcpServerCommandEntry(entry) && commandArraysMatch(entry.serverCommand, serverCommand)) { @@ -400274,7 +323925,7 @@ function isMcpServerDenied(serverName, config4) { } } } - const serverUrl = getServerUrl(config4); + const serverUrl = getServerUrl(config2); if (serverUrl) { for (const entry of settings.deniedMcpServers) { if (isMcpServerUrlEntry(entry) && urlMatchesPattern(serverUrl, entry.serverUrl)) { @@ -400285,8 +323936,8 @@ function isMcpServerDenied(serverName, config4) { } return false; } -function isMcpServerAllowedByPolicy(serverName, config4) { - if (isMcpServerDenied(serverName, config4)) { +function isMcpServerAllowedByPolicy(serverName, config2) { + if (isMcpServerDenied(serverName, config2)) { return false; } const settings = getMcpAllowlistSettings(); @@ -400298,9 +323949,9 @@ function isMcpServerAllowedByPolicy(serverName, config4) { } const hasCommandEntries = settings.allowedMcpServers.some(isMcpServerCommandEntry); const hasUrlEntries = settings.allowedMcpServers.some(isMcpServerUrlEntry); - if (config4) { - const serverCommand = getServerCommandArray(config4); - const serverUrl = getServerUrl(config4); + if (config2) { + const serverCommand = getServerCommandArray(config2); + const serverUrl = getServerUrl(config2); if (serverCommand) { if (hasCommandEntries) { for (const entry of settings.allowedMcpServers) { @@ -400352,17 +324003,17 @@ function isMcpServerAllowedByPolicy(serverName, config4) { function filterMcpServersByPolicy(configs) { const allowed = {}; const blocked = []; - for (const [name, config4] of Object.entries(configs)) { - const c6 = config4; + for (const [name, config2] of Object.entries(configs)) { + const c6 = config2; if (c6.type === "sdk" || isMcpServerAllowedByPolicy(name, c6)) { - allowed[name] = config4; + allowed[name] = config2; } else { blocked.push(name); } } return { allowed, blocked }; } -function expandEnvVars(config4) { +function expandEnvVars(config2) { const missingVars = []; function expandString(str) { const { expanded: expanded2, missingVars: vars } = expandEnvVarsInString(str); @@ -400370,10 +324021,10 @@ function expandEnvVars(config4) { return expanded2; } let expanded; - switch (config4.type) { + switch (config2.type) { case undefined: case "stdio": { - const stdioConfig = config4; + const stdioConfig = config2; expanded = { ...stdioConfig, command: expandString(stdioConfig.command), @@ -400385,7 +324036,7 @@ function expandEnvVars(config4) { case "sse": case "http": case "ws": { - const remoteConfig = config4; + const remoteConfig = config2; expanded = { ...remoteConfig, url: expandString(remoteConfig.url), @@ -400395,13 +324046,13 @@ function expandEnvVars(config4) { } case "sse-ide": case "ws-ide": - expanded = config4; + expanded = config2; break; case "sdk": - expanded = config4; + expanded = config2; break; case "claudeai-proxy": - expanded = config4; + expanded = config2; break; } return { @@ -400409,7 +324060,7 @@ function expandEnvVars(config4) { missingVars: [...new Set(missingVars)] }; } -async function addMcpConfig(name, config4, scope) { +async function addMcpConfig(name, config2, scope) { if (name.match(/[^a-zA-Z0-9_-]/)) { throw new Error(`Invalid name ${name}. Names can only contain letters, numbers, hyphens, and underscores.`); } @@ -400425,12 +324076,12 @@ async function addMcpConfig(name, config4, scope) { if (doesEnterpriseMcpConfigExist()) { throw new Error(`Cannot add MCP server: enterprise MCP configuration is active and has exclusive control over MCP servers`); } - const result3 = McpServerConfigSchema().safeParse(config4); - if (!result3.success) { - const formattedErrors = result3.error.issues.map((err3) => `${err3.path.join(".")}: ${err3.message}`).join(", "); + const result2 = McpServerConfigSchema().safeParse(config2); + if (!result2.success) { + const formattedErrors = result2.error.issues.map((err2) => `${err2.path.join(".")}: ${err2.message}`).join(", "); throw new Error(`Invalid configuration: ${formattedErrors}`); } - const validatedConfig = result3.data; + const validatedConfig = result2.data; if (isMcpServerDenied(name, validatedConfig)) { throw new Error(`Cannot add MCP server "${name}": server is explicitly blocked by enterprise policy`); } @@ -400478,8 +324129,8 @@ async function addMcpConfig(name, config4, scope) { const mcpConfig = { mcpServers }; try { await writeMcpjsonFile(mcpConfig); - } catch (error45) { - throw new Error(`Failed to write to .mcp.json: ${error45}`); + } catch (error41) { + throw new Error(`Failed to write to .mcp.json: ${error41}`); } break; } @@ -400524,14 +324175,14 @@ async function removeMcpConfig(name, scope) { const mcpConfig = { mcpServers }; try { await writeMcpjsonFile(mcpConfig); - } catch (error45) { - throw new Error(`Failed to remove from .mcp.json: ${error45}`); + } catch (error41) { + throw new Error(`Failed to remove from .mcp.json: ${error41}`); } break; } case "user": { - const config4 = getGlobalConfig(); - if (!config4.mcpServers?.[name]) { + const config2 = getGlobalConfig(); + if (!config2.mcpServers?.[name]) { throw new Error(`No user-scoped MCP server found with name: ${name}`); } saveGlobalConfig((current) => { @@ -400544,8 +324195,8 @@ async function removeMcpConfig(name, scope) { break; } case "local": { - const config4 = getCurrentProjectConfig(); - if (!config4.mcpServers?.[name]) { + const config2 = getCurrentProjectConfig(); + if (!config2.mcpServers?.[name]) { throw new Error(`No project-local MCP server found with name: ${name}`); } saveCurrentProjectConfig((current) => { @@ -400565,14 +324216,14 @@ function getProjectMcpConfigsFromCwd() { if (!isSettingSourceEnabled("projectSettings")) { return { servers: {}, errors: [] }; } - const mcpJsonPath = join61(getCwd(), ".mcp.json"); - const { config: config4, errors: errors5 } = parseMcpConfigFromFilePath({ + const mcpJsonPath = join51(getCwd(), ".mcp.json"); + const { config: config2, errors: errors4 } = parseMcpConfigFromFilePath({ filePath: mcpJsonPath, expandVars: true, scope: "project" }); - if (!config4) { - const nonMissingErrors = errors5.filter((e) => !e.message.startsWith("MCP config file not found")); + if (!config2) { + const nonMissingErrors = errors4.filter((e) => !e.message.startsWith("MCP config file not found")); if (nonMissingErrors.length > 0) { logForDebugging(`MCP config errors for ${mcpJsonPath}: ${jsonStringify(nonMissingErrors.map((e) => e.message))}`, { level: "error" }); return { servers: {}, errors: nonMissingErrors }; @@ -400580,8 +324231,8 @@ function getProjectMcpConfigsFromCwd() { return { servers: {}, errors: [] }; } return { - servers: config4.mcpServers ? addScopeToServers(config4.mcpServers, "project") : {}, - errors: errors5 || [] + servers: config2.mcpServers ? addScopeToServers(config2.mcpServers, "project") : {}, + errors: errors4 || [] }; } function getMcpConfigsByScope(scope) { @@ -400601,28 +324252,28 @@ function getMcpConfigsByScope(scope) { let currentDir = getCwd(); while (currentDir !== parse9(currentDir).root) { dirs.push(currentDir); - currentDir = dirname27(currentDir); + currentDir = dirname24(currentDir); } for (const dir of dirs.reverse()) { - const mcpJsonPath = join61(dir, ".mcp.json"); - const { config: config4, errors: errors5 } = parseMcpConfigFromFilePath({ + const mcpJsonPath = join51(dir, ".mcp.json"); + const { config: config2, errors: errors4 } = parseMcpConfigFromFilePath({ filePath: mcpJsonPath, expandVars: true, scope: "project" }); - if (!config4) { - const nonMissingErrors = errors5.filter((e) => !e.message.startsWith("MCP config file not found")); + if (!config2) { + const nonMissingErrors = errors4.filter((e) => !e.message.startsWith("MCP config file not found")); if (nonMissingErrors.length > 0) { logForDebugging(`MCP config errors for ${mcpJsonPath}: ${jsonStringify(nonMissingErrors.map((e) => e.message))}`, { level: "error" }); allErrors.push(...nonMissingErrors); } continue; } - if (config4.mcpServers) { - Object.assign(allServers, addScopeToServers(config4.mcpServers, scope)); + if (config2.mcpServers) { + Object.assign(allServers, addScopeToServers(config2.mcpServers, scope)); } - if (errors5.length > 0) { - allErrors.push(...errors5); + if (errors4.length > 0) { + allErrors.push(...errors4); } } return { @@ -400635,14 +324286,14 @@ function getMcpConfigsByScope(scope) { if (!mcpServers) { return { servers: {}, errors: [] }; } - const { config: config4, errors: errors5 } = parseMcpConfig({ + const { config: config2, errors: errors4 } = parseMcpConfig({ configObject: { mcpServers }, expandVars: true, scope: "user" }); return { - servers: addScopeToServers(config4?.mcpServers, scope), - errors: errors5 + servers: addScopeToServers(config2?.mcpServers, scope), + errors: errors4 }; } case "local": { @@ -400650,25 +324301,25 @@ function getMcpConfigsByScope(scope) { if (!mcpServers) { return { servers: {}, errors: [] }; } - const { config: config4, errors: errors5 } = parseMcpConfig({ + const { config: config2, errors: errors4 } = parseMcpConfig({ configObject: { mcpServers }, expandVars: true, scope: "local" }); return { - servers: addScopeToServers(config4?.mcpServers, scope), - errors: errors5 + servers: addScopeToServers(config2?.mcpServers, scope), + errors: errors4 }; } case "enterprise": { const enterpriseMcpPath = getEnterpriseMcpFilePath(); - const { config: config4, errors: errors5 } = parseMcpConfigFromFilePath({ + const { config: config2, errors: errors4 } = parseMcpConfigFromFilePath({ filePath: enterpriseMcpPath, expandVars: true, scope: "enterprise" }); - if (!config4) { - const nonMissingErrors = errors5.filter((e) => !e.message.startsWith("MCP config file not found")); + if (!config2) { + const nonMissingErrors = errors4.filter((e) => !e.message.startsWith("MCP config file not found")); if (nonMissingErrors.length > 0) { logForDebugging(`Enterprise MCP config errors for ${enterpriseMcpPath}: ${jsonStringify(nonMissingErrors.map((e) => e.message))}`, { level: "error" }); return { servers: {}, errors: nonMissingErrors }; @@ -400676,8 +324327,8 @@ function getMcpConfigsByScope(scope) { return { servers: {}, errors: [] }; } return { - servers: addScopeToServers(config4.mcpServers, scope), - errors: errors5 + servers: addScopeToServers(config2.mcpServers, scope), + errors: errors4 }; } } @@ -400727,13 +324378,13 @@ async function getClaudeCodeMcpConfigs(dynamicServers = {}, extraDedupTargets = const pluginResult = await loadAllPluginsCacheOnly(); const mcpErrors = []; if (pluginResult.errors.length > 0) { - for (const error45 of pluginResult.errors) { - if (error45.type === "mcp-config-invalid" || error45.type === "mcpb-download-failed" || error45.type === "mcpb-extract-failed" || error45.type === "mcpb-invalid-manifest") { - const errorMessage2 = `Plugin MCP loading error - ${error45.type}: ${getPluginErrorMessage(error45)}`; + for (const error41 of pluginResult.errors) { + if (error41.type === "mcp-config-invalid" || error41.type === "mcpb-download-failed" || error41.type === "mcpb-extract-failed" || error41.type === "mcpb-invalid-manifest") { + const errorMessage2 = `Plugin MCP loading error - ${error41.type}: ${getPluginErrorMessage(error41)}`; logError2(new Error(errorMessage2)); } else { - const errorType = error45.type; - logForDebugging(`Plugin not available for MCP: ${error45.source} - error type: ${errorType}`); + const errorType = error41.type; + logForDebugging(`Plugin not available for MCP: ${error41.source} - error type: ${errorType}`); } } } @@ -400744,37 +324395,37 @@ async function getClaudeCodeMcpConfigs(dynamicServers = {}, extraDedupTargets = } } if (mcpErrors.length > 0) { - for (const error45 of mcpErrors) { - const errorMessage2 = `Plugin MCP server error - ${error45.type}: ${getPluginErrorMessage(error45)}`; + for (const error41 of mcpErrors) { + const errorMessage2 = `Plugin MCP server error - ${error41.type}: ${getPluginErrorMessage(error41)}`; logError2(new Error(errorMessage2)); } } const approvedProjectServers = {}; - for (const [name, config4] of Object.entries(projectServers)) { + for (const [name, config2] of Object.entries(projectServers)) { if (getProjectMcpServerStatus(name) === "approved") { - approvedProjectServers[name] = config4; + approvedProjectServers[name] = config2; } } const extraTargets = await extraDedupTargets; const enabledManualServers = {}; - for (const [name, config4] of Object.entries({ + for (const [name, config2] of Object.entries({ ...userServers, ...approvedProjectServers, ...localServers, ...dynamicServers, ...extraTargets })) { - if (!isMcpServerDisabled(name) && isMcpServerAllowedByPolicy(name, config4)) { - enabledManualServers[name] = config4; + if (!isMcpServerDisabled(name) && isMcpServerAllowedByPolicy(name, config2)) { + enabledManualServers[name] = config2; } } const enabledPluginServers = {}; const disabledPluginServers = {}; - for (const [name, config4] of Object.entries(pluginMcpServers)) { - if (isMcpServerDisabled(name) || !isMcpServerAllowedByPolicy(name, config4)) { - disabledPluginServers[name] = config4; + for (const [name, config2] of Object.entries(pluginMcpServers)) { + if (isMcpServerDisabled(name) || !isMcpServerAllowedByPolicy(name, config2)) { + disabledPluginServers[name] = config2; } else { - enabledPluginServers[name] = config4; + enabledPluginServers[name] = config2; } } const { servers: dedupedPluginServers, suppressed } = dedupPluginMcpServers(enabledPluginServers, enabledManualServers); @@ -400806,11 +324457,11 @@ async function getAllMcpConfigs() { return getClaudeCodeMcpConfigs(); } const claudeaiPromise = fetchClaudeAIMcpConfigsIfEligible(); - const { servers: claudeCodeServers, errors: errors5 } = await getClaudeCodeMcpConfigs({}, claudeaiPromise); + const { servers: claudeCodeServers, errors: errors4 } = await getClaudeCodeMcpConfigs({}, claudeaiPromise); const { allowed: claudeaiMcpServers } = filterMcpServersByPolicy(await claudeaiPromise); const { servers: dedupedClaudeAi } = dedupClaudeAiMcpServers(claudeaiMcpServers, claudeCodeServers); const servers = Object.assign({}, dedupedClaudeAi, claudeCodeServers); - return { servers, errors: errors5 }; + return { servers, errors: errors4 }; } function parseMcpConfig(params) { const { configObject, expandVars, scope, filePath } = params; @@ -400829,14 +324480,14 @@ function parseMcpConfig(params) { })) }; } - const errors5 = []; + const errors4 = []; const validatedServers = {}; - for (const [name, config4] of Object.entries(schemaResult.data.mcpServers)) { - let configToCheck = config4; + for (const [name, config2] of Object.entries(schemaResult.data.mcpServers)) { + let configToCheck = config2; if (expandVars) { - const { expanded, missingVars } = expandEnvVars(config4); + const { expanded, missingVars } = expandEnvVars(config2); if (missingVars.length > 0) { - errors5.push({ + errors4.push({ ...filePath && { file: filePath }, path: `mcpServers.${name}`, message: `Missing environment variables: ${missingVars.join(", ")}`, @@ -400851,7 +324502,7 @@ function parseMcpConfig(params) { configToCheck = expanded; } if (getPlatform() === "windows" && (!configToCheck.type || configToCheck.type === "stdio") && (configToCheck.command === "npx" || configToCheck.command.endsWith("\\npx") || configToCheck.command.endsWith("/npx"))) { - errors5.push({ + errors4.push({ ...filePath && { file: filePath }, path: `mcpServers.${name}`, message: `Windows requires 'cmd /c' wrapper to execute npx`, @@ -400867,17 +324518,17 @@ function parseMcpConfig(params) { } return { config: { mcpServers: validatedServers }, - errors: errors5 + errors: errors4 }; } function parseMcpConfigFromFilePath(params) { const { filePath, expandVars, scope } = params; - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); let configContent; try { - configContent = fs9.readFileSync(filePath, { encoding: "utf8" }); - } catch (error45) { - const code = getErrnoCode(error45); + configContent = fs3.readFileSync(filePath, { encoding: "utf8" }); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") { return { config: null, @@ -400895,14 +324546,14 @@ function parseMcpConfigFromFilePath(params) { ] }; } - logForDebugging(`MCP config read error for ${filePath} (scope=${scope}): ${error45}`, { level: "error" }); + logForDebugging(`MCP config read error for ${filePath} (scope=${scope}): ${error41}`, { level: "error" }); return { config: null, errors: [ { file: filePath, path: "", - message: `Failed to read file: ${error45}`, + message: `Failed to read file: ${error41}`, suggestion: "Check file permissions and ensure the file exists", mcpErrorMetadata: { scope, @@ -401010,18 +324661,18 @@ var init_config3 = __esm(() => { init_analytics(); init_claudeai(); init_types(); - init_utils4(); + init_utils3(); CCR_PROXY_PATH_MARKERS = [ "/v2/session_ingress/shttp/mcp/", "/v2/ccr-sessions/" ]; doesEnterpriseMcpConfigExist = memoize_default(() => { - const { config: config4 } = parseMcpConfigFromFilePath({ + const { config: config2 } = parseMcpConfigFromFilePath({ filePath: getEnterpriseMcpFilePath(), expandVars: true, scope: "enterprise" }); - return config4 !== null; + return config2 !== null; }); DEFAULT_DISABLED_BUILTIN = feature("CHICAGO_MCP") ? (init_common(), __toCommonJS(exports_common)).COMPUTER_USE_MCP_SERVER_NAME : null; }); @@ -401041,8 +324692,8 @@ function killTask(taskId, setAppState) { logForDebugging(`LocalShellTask ${taskId} kill requested`); task.shellCommand?.kill(); task.shellCommand?.cleanup(); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } task.unregisterCleanup?.(); if (task.cleanupTimeoutId) { @@ -401079,11 +324730,11 @@ var init_killShellTasks = __esm(() => { }); // src/utils/hooks/hooksSettings.ts -import { resolve as resolve24 } from "path"; +import { resolve as resolve18 } from "path"; function isHookEqual(a2, b) { if (a2.type !== b.type) return false; - const sameIf = (x4, y2) => (x4.if ?? "") === (y2.if ?? ""); + const sameIf = (x3, y2) => (x3.if ?? "") === (y2.if ?? ""); switch (a2.type) { case "command": return b.type === "command" && a2.command === b.command && (a2.shell ?? DEFAULT_HOOK_SHELL) === (b.shell ?? DEFAULT_HOOK_SHELL) && sameIf(a2, b); @@ -401130,7 +324781,7 @@ function getAllHooks(appState) { for (const source of sources) { const filePath = getSettingsFilePathForSource(source); if (filePath) { - const resolvedPath = resolve24(filePath); + const resolvedPath = resolve18(filePath); if (seenFiles.has(resolvedPath)) { continue; } @@ -401329,28 +324980,28 @@ function getSessionHooks(appState, sessionId, event) { if (!store) { return new Map; } - const result3 = new Map; + const result2 = new Map; if (event) { const sessionMatchers = store.hooks[event]; if (sessionMatchers) { - result3.set(event, convertToHookMatchers(sessionMatchers)); + result2.set(event, convertToHookMatchers(sessionMatchers)); } - return result3; + return result2; } for (const evt of HOOK_EVENTS) { const sessionMatchers = store.hooks[evt]; if (sessionMatchers) { - result3.set(evt, convertToHookMatchers(sessionMatchers)); + result2.set(evt, convertToHookMatchers(sessionMatchers)); } } - return result3; + return result2; } function getSessionFunctionHooks(appState, sessionId, event) { const store = appState.sessionHooks.get(sessionId); if (!store) { return new Map; } - const result3 = new Map; + const result2 = new Map; const extractFunctionHooks = (sessionMatchers) => { return sessionMatchers.map((sm) => ({ matcher: sm.matcher, @@ -401362,21 +325013,21 @@ function getSessionFunctionHooks(appState, sessionId, event) { if (sessionMatchers) { const functionMatchers = extractFunctionHooks(sessionMatchers); if (functionMatchers.length > 0) { - result3.set(event, functionMatchers); + result2.set(event, functionMatchers); } } - return result3; + return result2; } for (const evt of HOOK_EVENTS) { const sessionMatchers = store.hooks[evt]; if (sessionMatchers) { const functionMatchers = extractFunctionHooks(sessionMatchers); if (functionMatchers.length > 0) { - result3.set(evt, functionMatchers); + result2.set(evt, functionMatchers); } } } - return result3; + return result2; } function getSessionHookCallback(appState, sessionId, event, matcher, hook) { const store = appState.sessionHooks.get(sessionId); @@ -401541,9 +325192,9 @@ var init_agent = __esm(() => { }); // src/utils/telemetry/perfettoTracing.ts -import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync7 } from "fs"; -import { mkdir as mkdir10, writeFile as writeFile10 } from "fs/promises"; -import { dirname as dirname28, join as join62 } from "path"; +import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync3 } from "fs"; +import { mkdir as mkdir10, writeFile as writeFile8 } from "fs/promises"; +import { dirname as dirname25, join as join52 } from "path"; function stringToNumericHash(str) { return Math.abs(djb2Hash(str)) || 1; } @@ -401580,21 +325231,21 @@ function generateSpanId() { return `span_${++spanIdCounter}`; } function evictStaleSpans() { - const now3 = getTimestamp(); + const now2 = getTimestamp(); const ttlUs = STALE_SPAN_TTL_MS * 1000; for (const [spanId, span] of pendingSpans) { - if (now3 - span.startTime > ttlUs) { + if (now2 - span.startTime > ttlUs) { events.push({ name: span.name, cat: span.category, ph: "E", - ts: now3, + ts: now2, pid: span.agentInfo.processId, tid: span.agentInfo.threadId, args: { ...span.args, evicted: true, - duration_ms: (now3 - span.startTime) / 1000 + duration_ms: (now2 - span.startTime) / 1000 } }); pendingSpans.delete(spanId); @@ -401638,8 +325289,8 @@ function initializePerfettoTracing() { isEnabled = true; startTimeMs = Date.now(); if (isEnvTruthy(envValue)) { - const tracesDir = join62(getClaudeConfigHomeDir(), "traces"); - tracePath = join62(tracesDir, `trace-${getSessionId()}.json`); + const tracesDir = join52(getClaudeConfigHomeDir(), "traces"); + tracePath = join52(tracesDir, `trace-${getSessionId()}.json`); } else { tracePath = envValue; } @@ -401817,20 +325468,20 @@ function endLLMRequestPerfettoSpan(spanId, metadata) { }); if (attemptStartTimes && attemptStartTimes.length > 1) { const baseWallMs = attemptStartTimes[0]; - for (let i4 = 0;i4 < attemptStartTimes.length - 1; i4++) { - const attemptStartUs = pending.startTime + (attemptStartTimes[i4] - baseWallMs) * 1000; - const attemptEndUs = pending.startTime + (attemptStartTimes[i4 + 1] - baseWallMs) * 1000; + for (let i3 = 0;i3 < attemptStartTimes.length - 1; i3++) { + const attemptStartUs = pending.startTime + (attemptStartTimes[i3] - baseWallMs) * 1000; + const attemptEndUs = pending.startTime + (attemptStartTimes[i3 + 1] - baseWallMs) * 1000; events.push({ - name: `Attempt ${i4 + 1} (retry)`, + name: `Attempt ${i3 + 1} (retry)`, cat: "api,retry", ph: "B", ts: attemptStartUs, pid: pending.agentInfo.processId, tid: pending.agentInfo.threadId, - args: { attempt: i4 + 1 } + args: { attempt: i3 + 1 } }); events.push({ - name: `Attempt ${i4 + 1} (retry)`, + name: `Attempt ${i3 + 1} (retry)`, cat: "api,retry", ph: "E", ts: attemptEndUs, @@ -402091,11 +325742,11 @@ async function periodicWrite() { if (!isEnabled || !tracePath || traceWritten) return; try { - await mkdir10(dirname28(tracePath), { recursive: true }); - await writeFile10(tracePath, buildTraceDocument()); + await mkdir10(dirname25(tracePath), { recursive: true }); + await writeFile8(tracePath, buildTraceDocument()); logForDebugging(`[Perfetto] Periodic write: ${events.length} events to ${tracePath}`); - } catch (error45) { - logForDebugging(`[Perfetto] Periodic write failed: ${errorMessage(error45)}`, { level: "error" }); + } catch (error41) { + logForDebugging(`[Perfetto] Periodic write failed: ${errorMessage(error41)}`, { level: "error" }); } } async function writePerfettoTrace() { @@ -402107,12 +325758,12 @@ async function writePerfettoTrace() { closeOpenSpans(); logForDebugging(`[Perfetto] writePerfettoTrace called: events=${events.length}`); try { - await mkdir10(dirname28(tracePath), { recursive: true }); - await writeFile10(tracePath, buildTraceDocument()); + await mkdir10(dirname25(tracePath), { recursive: true }); + await writeFile8(tracePath, buildTraceDocument()); traceWritten = true; logForDebugging(`[Perfetto] Trace finalized at: ${tracePath}`); - } catch (error45) { - logForDebugging(`[Perfetto] Failed to write final trace: ${errorMessage(error45)}`, { level: "error" }); + } catch (error41) { + logForDebugging(`[Perfetto] Failed to write final trace: ${errorMessage(error41)}`, { level: "error" }); } } function writePerfettoTraceSync() { @@ -402124,13 +325775,13 @@ function writePerfettoTraceSync() { closeOpenSpans(); logForDebugging(`[Perfetto] writePerfettoTraceSync called: events=${events.length}`); try { - const dir = dirname28(tracePath); - mkdirSync6(dir, { recursive: true }); - writeFileSync7(tracePath, buildTraceDocument()); + const dir = dirname25(tracePath); + mkdirSync4(dir, { recursive: true }); + writeFileSync3(tracePath, buildTraceDocument()); traceWritten = true; logForDebugging(`[Perfetto] Trace finalized synchronously at: ${tracePath}`); - } catch (error45) { - logForDebugging(`[Perfetto] Failed to write final trace synchronously: ${errorMessage(error45)}`, { level: "error" }); + } catch (error41) { + logForDebugging(`[Perfetto] Failed to write final trace synchronously: ${errorMessage(error41)}`, { level: "error" }); } } var isEnabled = false, tracePath = null, metadataEvents, events, MAX_EVENTS = 1e5, pendingSpans, agentRegistry, totalAgentCount = 0, startTimeMs = 0, spanIdCounter = 0, traceWritten = false, processIdCounter = 1, agentIdToProcessId, writeIntervalId = null, STALE_SPAN_TTL_MS, STALE_SPAN_CLEANUP_INTERVAL_MS, staleSpanCleanupId = null; @@ -402153,19 +325804,19 @@ var init_perfettoTracing = __esm(() => { }); // src/utils/uuid.ts -import { randomBytes as randomBytes4 } from "crypto"; +import { randomBytes as randomBytes3 } from "crypto"; function validateUuid2(maybeUuid) { if (typeof maybeUuid !== "string") return null; - return uuidRegex4.test(maybeUuid) ? maybeUuid : null; + return uuidRegex3.test(maybeUuid) ? maybeUuid : null; } function createAgentId(label) { - const suffix = randomBytes4(8).toString("hex"); + const suffix = randomBytes3(8).toString("hex"); return label ? `a${label}-${suffix}` : `a${suffix}`; } -var uuidRegex4; -var init_uuid2 = __esm(() => { - uuidRegex4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; +var uuidRegex3; +var init_uuid = __esm(() => { + uuidRegex3 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; }); // src/utils/model/antModels.ts @@ -402196,7 +325847,7 @@ var init_antModels = __esm(() => { }); // src/utils/fingerprint.ts -import { createHash as createHash8 } from "crypto"; +import { createHash as createHash7 } from "crypto"; function extractFirstMessageText(messages) { const firstUserMessage = messages.find((msg) => msg.type === "user"); if (!firstUserMessage) { @@ -402216,9 +325867,9 @@ function extractFirstMessageText(messages) { } function computeFingerprint(messageText, version2) { const indices = [4, 7, 20]; - const chars = indices.map((i4) => messageText[i4] || "0").join(""); + const chars = indices.map((i3) => messageText[i3] || "0").join(""); const fingerprintInput = `${FINGERPRINT_SALT}${chars}${version2}`; - const hash2 = createHash8("sha256").update(fingerprintInput).digest("hex"); + const hash2 = createHash7("sha256").update(fingerprintInput).digest("hex"); return hash2.slice(0, 3); } function computeFingerprintFromMessages(messages) { @@ -402255,7 +325906,7 @@ async function sideQuery(opts) { thinking, stop_sequences } = opts; - const client5 = await getAnthropicClient({ + const client2 = await getAnthropicClient({ maxRetries, model, source: "side_query" @@ -402291,7 +325942,7 @@ async function sideQuery(opts) { } const normalizedModel = normalizeModelStringForAPI(model); const start = Date.now(); - const response = await client5.beta.messages.create({ + const response = await client2.beta.messages.create({ model: normalizedModel, max_tokens, system: systemBlocks, @@ -402306,7 +325957,7 @@ async function sideQuery(opts) { metadata: getAPIMetadata() }, { signal }); const requestId = response._request_id ?? undefined; - const now3 = Date.now(); + const now2 = Date.now(); const lastCompletion = getLastApiCompletionTimestamp(); logEvent("tengu_api_success", { requestId, @@ -402316,10 +325967,10 @@ async function sideQuery(opts) { outputTokens: response.usage.output_tokens, cachedInputTokens: response.usage.cache_read_input_tokens ?? 0, uncachedInputTokens: response.usage.cache_creation_input_tokens ?? 0, - durationMsIncludingRetries: now3 - start, - timeSinceLastApiCallMs: lastCompletion !== null ? now3 - lastCompletion : undefined + durationMsIncludingRetries: now2 - start, + timeSinceLastApiCallMs: lastCompletion !== null ? now2 - lastCompletion : undefined }); - setLastApiCompletionTimestamp(now3); + setLastApiCompletionTimestamp(now2); return response; } var init_sideQuery = __esm(() => { @@ -402328,7 +325979,7 @@ var init_sideQuery = __esm(() => { init_system(); init_analytics(); init_claude(); - init_client7(); + init_client3(); init_betas2(); init_fingerprint(); init_model(); @@ -402372,16 +326023,16 @@ __export(exports_permissions_anthropic, { var permissions_anthropic_default = ""; // src/utils/permissions/yoloClassifier.ts -import { mkdir as mkdir11, writeFile as writeFile11 } from "fs/promises"; -import { dirname as dirname29, join as join63 } from "path"; +import { mkdir as mkdir11, writeFile as writeFile9 } from "fs/promises"; +import { dirname as dirname26, join as join53 } from "path"; function txtRequire(mod2) { return typeof mod2 === "string" ? mod2 : mod2.default; } function isUsingExternalPermissions() { if (process.env.USER_TYPE !== "ant") return true; - const config4 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); - return config4?.forceExternalPermissions === true; + const config2 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); + return config2?.forceExternalPermissions === true; } function getDefaultExternalAutoModeRules() { return { @@ -402398,10 +326049,10 @@ function extractTaggedBullets(tagName) { `).map((line) => line.trim()).filter((line) => line.startsWith("- ")).map((line) => line.slice(2)); } function buildDefaultExternalSystemPrompt() { - return BASE_PROMPT.replace("", () => EXTERNAL_PERMISSIONS_TEMPLATE).replace(/([\s\S]*?)<\/user_allow_rules_to_replace>/, (_m, defaults4) => defaults4).replace(/([\s\S]*?)<\/user_deny_rules_to_replace>/, (_m, defaults4) => defaults4).replace(/([\s\S]*?)<\/user_environment_to_replace>/, (_m, defaults4) => defaults4); + return BASE_PROMPT.replace("", () => EXTERNAL_PERMISSIONS_TEMPLATE).replace(/([\s\S]*?)<\/user_allow_rules_to_replace>/, (_m, defaults3) => defaults3).replace(/([\s\S]*?)<\/user_deny_rules_to_replace>/, (_m, defaults3) => defaults3).replace(/([\s\S]*?)<\/user_environment_to_replace>/, (_m, defaults3) => defaults3); } function getAutoModeDumpDir() { - return join63(getClaudeTempDir(), "auto-mode"); + return join53(getClaudeTempDir(), "auto-mode"); } async function maybeDumpAutoMode(request, response, timestamp, suffix) { if (process.env.USER_TYPE !== "ant") @@ -402411,20 +326062,20 @@ async function maybeDumpAutoMode(request, response, timestamp, suffix) { const base2 = suffix ? `${timestamp}.${suffix}` : `${timestamp}`; try { await mkdir11(getAutoModeDumpDir(), { recursive: true }); - await writeFile11(join63(getAutoModeDumpDir(), `${base2}.req.json`), jsonStringify(request, null, 2), "utf-8"); - await writeFile11(join63(getAutoModeDumpDir(), `${base2}.res.json`), jsonStringify(response, null, 2), "utf-8"); + await writeFile9(join53(getAutoModeDumpDir(), `${base2}.req.json`), jsonStringify(request, null, 2), "utf-8"); + await writeFile9(join53(getAutoModeDumpDir(), `${base2}.res.json`), jsonStringify(response, null, 2), "utf-8"); logForDebugging(`Dumped auto mode req/res to ${getAutoModeDumpDir()}/${base2}.{req,res}.json`); } catch {} } function getAutoModeClassifierErrorDumpPath() { - return join63(getClaudeTempDir(), "auto-mode-classifier-errors", `${getSessionId()}.txt`); + return join53(getClaudeTempDir(), "auto-mode-classifier-errors", `${getSessionId()}.txt`); } -async function dumpErrorPrompts(systemPrompt, userPrompt, error45, contextInfo) { +async function dumpErrorPrompts(systemPrompt, userPrompt, error41, contextInfo) { try { - const path16 = getAutoModeClassifierErrorDumpPath(); - await mkdir11(dirname29(path16), { recursive: true }); + const path11 = getAutoModeClassifierErrorDumpPath(); + await mkdir11(dirname26(path11), { recursive: true }); const content = `=== ERROR === -${errorMessage(error45)} +${errorMessage(error41)} ` + `=== CONTEXT COMPARISON === ` + `timestamp: ${new Date().toISOString()} @@ -402445,9 +326096,9 @@ ${systemPrompt} ` + `=== USER PROMPT (transcript) === ${userPrompt} `; - await writeFile11(path16, content, "utf-8"); - logForDebugging(`Dumped auto mode classifier error prompts to ${path16}`); - return path16; + await writeFile9(path11, content, "utf-8"); + logForDebugging(`Dumped auto mode classifier error prompts to ${path11}`); + return path11; } catch { return null; } @@ -402457,17 +326108,17 @@ function buildTranscriptEntries(messages) { for (const msg of messages) { if (msg.type === "attachment" && msg.attachment.type === "queued_command") { const prompt = msg.attachment.prompt; - let text2 = null; + let text = null; if (typeof prompt === "string") { - text2 = prompt; + text = prompt; } else if (Array.isArray(prompt)) { - text2 = prompt.filter((block2) => block2.type === "text").map((block2) => block2.text).join(` + text = prompt.filter((block2) => block2.type === "text").map((block2) => block2.text).join(` `) || null; } - if (text2 !== null) { + if (text !== null) { transcript.push({ role: "user", - content: [{ type: "text", text: text2 }] + content: [{ type: "text", text }] }); } } else if (msg.type === "user") { @@ -402504,30 +326155,30 @@ function buildTranscriptEntries(messages) { return transcript; } function buildToolLookup(tools) { - const map6 = new Map; + const map4 = new Map; for (const tool of tools) { - map6.set(tool.name, tool); + map4.set(tool.name, tool); for (const alias of tool.aliases ?? []) { - map6.set(alias, tool); + map4.set(alias, tool); } } - return map6; + return map4; } function toCompactBlock(block2, role, lookup) { if (block2.type === "tool_use") { const tool = lookup.get(block2.name); if (!tool) return ""; - const input3 = block2.input ?? {}; + const input = block2.input ?? {}; let encoded; try { - encoded = tool.toAutoClassifierInput(input3) ?? input3; + encoded = tool.toAutoClassifierInput(input) ?? input; } catch (e) { logForDebugging(`toAutoClassifierInput failed for ${block2.name}: ${errorMessage(e)}`); logEvent("tengu_auto_mode_malformed_tool_input", { toolName: block2.name }); - encoded = input3; + encoded = input; } if (encoded === "") return ""; @@ -402593,41 +326244,41 @@ async function buildYoloSystemPrompt(context) { `) : undefined; const userEnvironment = autoMode?.environment?.length ? autoMode.environment.map((e) => `- ${e}`).join(` `) : undefined; - return systemPrompt.replace(/([\s\S]*?)<\/user_allow_rules_to_replace>/, (_m, defaults4) => userAllow ?? defaults4).replace(/([\s\S]*?)<\/user_deny_rules_to_replace>/, (_m, defaults4) => userDeny ?? defaults4).replace(/([\s\S]*?)<\/user_environment_to_replace>/, (_m, defaults4) => userEnvironment ?? defaults4); + return systemPrompt.replace(/([\s\S]*?)<\/user_allow_rules_to_replace>/, (_m, defaults3) => userAllow ?? defaults3).replace(/([\s\S]*?)<\/user_deny_rules_to_replace>/, (_m, defaults3) => userDeny ?? defaults3).replace(/([\s\S]*?)<\/user_environment_to_replace>/, (_m, defaults3) => userEnvironment ?? defaults3); } -function stripThinking(text2) { - return text2.replace(/[\s\S]*?<\/thinking>/g, "").replace(/[\s\S]*$/, ""); +function stripThinking(text) { + return text.replace(/[\s\S]*?<\/thinking>/g, "").replace(/[\s\S]*$/, ""); } -function parseXmlBlock(text2) { - const matches3 = [ - ...stripThinking(text2).matchAll(/(yes|no)\b(<\/block>)?/gi) +function parseXmlBlock(text) { + const matches2 = [ + ...stripThinking(text).matchAll(/(yes|no)\b(<\/block>)?/gi) ]; - if (matches3.length === 0) + if (matches2.length === 0) return null; - return matches3[0][1].toLowerCase() === "yes"; + return matches2[0][1].toLowerCase() === "yes"; } -function parseXmlReason(text2) { - const matches3 = [ - ...stripThinking(text2).matchAll(/([\s\S]*?)<\/reason>/g) +function parseXmlReason(text) { + const matches2 = [ + ...stripThinking(text).matchAll(/([\s\S]*?)<\/reason>/g) ]; - if (matches3.length === 0) + if (matches2.length === 0) return null; - return matches3[0][1].trim(); + return matches2[0][1].trim(); } -function parseXmlThinking(text2) { - const match = /([\s\S]*?)<\/thinking>/.exec(text2); +function parseXmlThinking(text) { + const match = /([\s\S]*?)<\/thinking>/.exec(text); return match ? match[1].trim() : null; } -function extractUsage(result3) { +function extractUsage(result2) { return { - inputTokens: result3.usage.input_tokens, - outputTokens: result3.usage.output_tokens, - cacheReadInputTokens: result3.usage.cache_read_input_tokens ?? 0, - cacheCreationInputTokens: result3.usage.cache_creation_input_tokens ?? 0 + inputTokens: result2.usage.input_tokens, + outputTokens: result2.usage.output_tokens, + cacheReadInputTokens: result2.usage.cache_read_input_tokens ?? 0, + cacheCreationInputTokens: result2.usage.cache_creation_input_tokens ?? 0 }; } -function extractRequestId(result3) { - return result3._request_id ?? undefined; +function extractRequestId(result2) { + return result2._request_id ?? undefined; } function combineUsage(a2, b) { return { @@ -402838,7 +326489,7 @@ async function classifyYoloActionXml(prefixMessages, systemPrompt, userPrompt, u stage2RequestId, stage2MsgId }; - } catch (error45) { + } catch (error41) { if (signal.aborted) { logForDebugging("Auto mode classifier (XML): aborted by user"); logAutoModeOutcome("interrupted", model, { classifierType }); @@ -402851,11 +326502,11 @@ async function classifyYoloActionXml(prefixMessages, systemPrompt, userPrompt, u promptLengths }; } - const tooLong = detectPromptTooLong(error45); - logForDebugging(`Auto mode classifier (XML) error: ${errorMessage(error45)}`, { + const tooLong = detectPromptTooLong(error41); + logForDebugging(`Auto mode classifier (XML) error: ${errorMessage(error41)}`, { level: "warn" }); - const errorDumpPath = await dumpErrorPrompts(xmlSystemPrompt, userPrompt, error45, { + const errorDumpPath = await dumpErrorPrompts(xmlSystemPrompt, userPrompt, error41, { ...dumpContextInfo, model }) ?? undefined; @@ -402981,23 +326632,23 @@ async function classifyYoloAction(messages, action, tools, context, signal) { signal, querySource: "auto_mode" }; - const result3 = await sideQuery(sideQueryOpts); - maybeDumpAutoMode(sideQueryOpts, result3, start); + const result2 = await sideQuery(sideQueryOpts); + maybeDumpAutoMode(sideQueryOpts, result2, start); setLastClassifierRequests([sideQueryOpts]); const durationMs = Date.now() - start; - const stage1RequestId = extractRequestId(result3); - const stage1MsgId = result3.id; + const stage1RequestId = extractRequestId(result2); + const stage1MsgId = result2.id; const usage = { - inputTokens: result3.usage.input_tokens, - outputTokens: result3.usage.output_tokens, - cacheReadInputTokens: result3.usage.cache_read_input_tokens ?? 0, - cacheCreationInputTokens: result3.usage.cache_creation_input_tokens ?? 0 + inputTokens: result2.usage.input_tokens, + outputTokens: result2.usage.output_tokens, + cacheReadInputTokens: result2.usage.cache_read_input_tokens ?? 0, + cacheCreationInputTokens: result2.usage.cache_creation_input_tokens ?? 0 }; const classifierInputTokens = usage.inputTokens + usage.cacheReadInputTokens + usage.cacheCreationInputTokens; if (isDebugMode()) { logForDebugging(`[auto-mode] API usage: ` + `actualInputTokens=${classifierInputTokens} ` + `(uncached=${usage.inputTokens} ` + `cacheRead=${usage.cacheReadInputTokens} ` + `cacheCreate=${usage.cacheCreationInputTokens}) ` + `estimateWas=${classifierTokensEst} ` + `deltaVsMainLoop=${classifierInputTokens - mainLoopTokens} ` + `durationMs=${durationMs}`); } - const toolUseBlock = extractToolUseBlock(result3.content, YOLO_CLASSIFIER_TOOL_NAME); + const toolUseBlock = extractToolUseBlock(result2.content, YOLO_CLASSIFIER_TOOL_NAME); if (!toolUseBlock) { logForDebugging("Auto mode classifier: No tool use block found", { level: "warn" @@ -403051,7 +326702,7 @@ async function classifyYoloAction(messages, action, tools, context, signal) { classifierTokensEst }); return classifierResult; - } catch (error45) { + } catch (error41) { if (signal.aborted) { logForDebugging("Auto mode classifier: aborted by user"); logAutoModeOutcome("interrupted", model); @@ -403062,11 +326713,11 @@ async function classifyYoloAction(messages, action, tools, context, signal) { unavailable: true }; } - const tooLong = detectPromptTooLong(error45); - logForDebugging(`Auto mode classifier error: ${errorMessage(error45)}`, { + const tooLong = detectPromptTooLong(error41); + logForDebugging(`Auto mode classifier error: ${errorMessage(error41)}`, { level: "warn" }); - const errorDumpPath = await dumpErrorPrompts(systemPrompt, userPrompt, error45, { + const errorDumpPath = await dumpErrorPrompts(systemPrompt, userPrompt, error41, { mainLoopTokens, classifierChars, classifierTokensEst, @@ -403099,24 +326750,24 @@ function getClassifierModel() { if (envModel) return envModel; } - const config4 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); - if (config4?.model) { - return config4.model; + const config2 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); + if (config2?.model) { + return config2.model; } return getMainLoopModel(); } function resolveTwoStageClassifier() { if (process.env.USER_TYPE === "ant") { - const env5 = process.env.CLAUDE_CODE_TWO_STAGE_CLASSIFIER; - if (env5 === "fast" || env5 === "thinking") - return env5; - if (isEnvTruthy(env5)) + const env4 = process.env.CLAUDE_CODE_TWO_STAGE_CLASSIFIER; + if (env4 === "fast" || env4 === "thinking") + return env4; + if (isEnvTruthy(env4)) return true; - if (isEnvDefinedFalsy(env5)) + if (isEnvDefinedFalsy(env4)) return false; } - const config4 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); - return config4?.twoStageClassifier; + const config2 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); + return config2?.twoStageClassifier; } function isTwoStageClassifierEnabled() { const v = resolveTwoStageClassifier(); @@ -403124,17 +326775,17 @@ function isTwoStageClassifierEnabled() { } function isJsonlTranscriptEnabled() { if (process.env.USER_TYPE === "ant") { - const env5 = process.env.CLAUDE_CODE_JSONL_TRANSCRIPT; - if (isEnvTruthy(env5)) + const env4 = process.env.CLAUDE_CODE_JSONL_TRANSCRIPT; + if (isEnvTruthy(env4)) return true; - if (isEnvDefinedFalsy(env5)) + if (isEnvDefinedFalsy(env4)) return false; } - const config4 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); - return config4?.jsonlTranscript === true; + const config2 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); + return config2?.jsonlTranscript === true; } function logAutoModeOutcome(outcome, model, extra) { - const { classifierType, failureKind, ...rest3 } = extra ?? {}; + const { classifierType, failureKind, ...rest2 } = extra ?? {}; logEvent("tengu_auto_mode_outcome", { outcome, classifierModel: model, @@ -403144,16 +326795,16 @@ function logAutoModeOutcome(outcome, model, extra) { ...failureKind !== undefined && { failureKind }, - ...rest3 + ...rest2 }); } -function detectPromptTooLong(error45) { - if (!(error45 instanceof Error)) +function detectPromptTooLong(error41) { + if (!(error41 instanceof Error)) return; - if (!error45.message.toLowerCase().includes("prompt is too long")) { + if (!error41.message.toLowerCase().includes("prompt is too long")) { return; } - return parsePromptTooLongTokenCounts(error45.message); + return parsePromptTooLongTokenCounts(error41.message); } function getTwoStageMode() { const v = resolveTwoStageClassifier(); @@ -403175,12 +326826,12 @@ var init_yoloClassifier = __esm(() => { init_growthbook(); init_analytics(); init_claude(); - init_errors7(); + init_errors6(); init_withRetry(); init_debug(); init_envUtils(); init_errors(); - init_messages5(); + init_messages3(); init_antModels(); init_model(); init_settings2(); @@ -403253,7 +326904,7 @@ var init_sdkProgress = __esm(() => { function filterToolsForAgent({ tools, isBuiltIn, - isAsync: isAsync3 = false, + isAsync: isAsync2 = false, permissionMode }) { return tools.filter((tool) => { @@ -403269,7 +326920,7 @@ function filterToolsForAgent({ if (!isBuiltIn && CUSTOM_AGENT_DISALLOWED_TOOLS.has(tool.name)) { return false; } - if (isAsync3 && !ASYNC_AGENT_ALLOWED_TOOLS.has(tool.name)) { + if (isAsync2 && !ASYNC_AGENT_ALLOWED_TOOLS.has(tool.name)) { if (isAgentSwarmsEnabled() && isInProcessTeammate()) { if (toolMatchesName(tool, AGENT_TOOL_NAME)) { return true; @@ -403283,7 +326934,7 @@ function filterToolsForAgent({ return true; }); } -function resolveAgentTools(agentDefinition, availableTools, isAsync3 = false, isMainThread = false) { +function resolveAgentTools(agentDefinition, availableTools, isAsync2 = false, isMainThread = false) { const { tools: agentTools, disallowedTools, @@ -403293,7 +326944,7 @@ function resolveAgentTools(agentDefinition, availableTools, isAsync3 = false, is const filteredAvailableTools = isMainThread ? availableTools : filterToolsForAgent({ tools: availableTools, isBuiltIn: source === "built-in", - isAsync: isAsync3, + isAsync: isAsync2, permissionMode }); const disallowedToolSet = new Set(disallowedTools?.map((toolSpec) => { @@ -403369,7 +327020,7 @@ function finalizeAgentTool(agentMessages, agentId, metadata) { isBuiltInAgent: isBuiltInAgent2, startTime, agentType, - isAsync: isAsync3 + isAsync: isAsync2 } = metadata; const lastAssistantMessage = getLastAssistantMessage(agentMessages); if (lastAssistantMessage === undefined) { @@ -403377,8 +327028,8 @@ function finalizeAgentTool(agentMessages, agentId, metadata) { } let content = lastAssistantMessage.message.content.filter((_) => _.type === "text"); if (content.length === 0) { - for (let i4 = agentMessages.length - 1;i4 >= 0; i4--) { - const m = agentMessages[i4]; + for (let i3 = agentMessages.length - 1;i3 >= 0; i3--) { + const m = agentMessages[i3]; if (m.type !== "assistant") continue; const textBlocks = m.message.content.filter((_) => _.type === "text"); @@ -403400,7 +327051,7 @@ function finalizeAgentTool(agentMessages, agentId, metadata) { duration_ms: Date.now() - startTime, total_tokens: totalTokens, is_built_in_agent: isBuiltInAgent2, - is_async: isAsync3 + is_async: isAsync2 }); const lastRequestId = lastAssistantMessage.requestId; if (lastRequestId) { @@ -403488,14 +327139,14 @@ async function classifyHandoffIfNeeded({ return null; } function extractPartialResult(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const m = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const m = messages[i3]; if (m.type !== "assistant") continue; - const text2 = extractTextContent(m.message.content, ` + const text = extractTextContent(m.message.content, ` `); - if (text2) { - return text2; + if (text) { + return text; } } return; @@ -403578,9 +327229,9 @@ ${finalMessage}`; toolUseId: toolUseContext.toolUseId, ...worktreeResult }); - } catch (error45) { + } catch (error41) { stopSummarization?.(); - if (error45 instanceof AbortError) { + if (error41 instanceof AbortError) { killAsyncAgent(taskId, rootSetAppState); logEvent("tengu_agent_tool_terminated", { agent_type: metadata.agentType, @@ -403603,7 +327254,7 @@ ${finalMessage}`; }); return; } - const msg = errorMessage(error45); + const msg = errorMessage(error41); failAgentTask(taskId, msg, rootSetAppState); const worktreeResult = await getWorktreeResult(); enqueueAgentNotification({ @@ -403636,7 +327287,7 @@ var init_agentToolUtils = __esm(() => { init_debug(); init_envUtils(); init_errors(); - init_messages5(); + init_messages3(); init_permissionRuleParser(); init_yoloClassifier(); init_sdkProgress(); @@ -403783,10 +327434,10 @@ function AgentProgressLine(t0) { lastToolInfo, hideType: t2 } = t0; - const isAsync3 = t1 === undefined ? false : t1; + const isAsync2 = t1 === undefined ? false : t1; const hideType = t2 === undefined ? false : t2; const treeChar = isLast ? "└─" : "├─"; - const isBackgrounded = isAsync3 && isResolved; + const isBackgrounded = isAsync2 && isResolved; let t3; if ($2[0] !== isBackgrounded || $2[1] !== isResolved || $2[2] !== lastToolInfo || $2[3] !== taskDescription) { t3 = () => { @@ -404051,7 +327702,7 @@ function OutputLine(t0) { const { content, verbose, - isError: isError3, + isError: isError2, isWarning, linkifyUrls } = t0; @@ -404084,7 +327735,7 @@ function OutputLine(t0) { t1 = $2[5]; } const formattedContent = t1; - const color2 = isError3 ? "error" : isWarning ? "warning" : undefined; + const color2 = isError2 ? "error" : isWarning ? "warning" : undefined; let t2; if ($2[6] !== formattedContent) { t2 = /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Ansi, { @@ -404131,15 +327782,15 @@ var init_OutputLine = __esm(() => { }); // src/utils/sandbox/sandbox-ui-utils.ts -function removeSandboxViolationTags(text2) { - return text2.replace(/[\s\S]*?<\/sandbox_violations>/g, ""); +function removeSandboxViolationTags(text) { + return text.replace(/[\s\S]*?<\/sandbox_violations>/g, ""); } // src/components/FallbackToolUseErrorMessage.tsx function FallbackToolUseErrorMessage(t0) { const $2 = import_compiler_runtime26.c(25); const { - result: result3, + result: result2, verbose } = t0; const transcriptShortcut = useShortcutDisplay("app:toggleTranscript", "Global", "ctrl+o"); @@ -404150,36 +327801,36 @@ function FallbackToolUseErrorMessage(t0) { let t1; let t2; let t3; - if ($2[0] !== result3 || $2[1] !== verbose) { - let error45; - if (typeof result3 !== "string") { - error45 = "Tool execution failed"; + if ($2[0] !== result2 || $2[1] !== verbose) { + let error41; + if (typeof result2 !== "string") { + error41 = "Tool execution failed"; } else { - const extractedError = extractTag(result3, "tool_use_error") ?? result3; + const extractedError = extractTag(result2, "tool_use_error") ?? result2; const withoutSandboxViolations = removeSandboxViolationTags(extractedError); const withoutErrorTags = withoutSandboxViolations.replace(/<\/?error>/g, ""); const trimmed = withoutErrorTags.trim(); if (!verbose && trimmed.includes("InputValidationError: ")) { - error45 = "Invalid tool parameters"; + error41 = "Invalid tool parameters"; } else { if (trimmed.startsWith("Error: ") || trimmed.startsWith("Cancelled: ")) { - error45 = trimmed; + error41 = trimmed; } else { - error45 = `Error: ${trimmed}`; + error41 = `Error: ${trimmed}`; } } } - plusLines = countCharInString(error45, ` + plusLines = countCharInString(error41, ` `) + 1 - MAX_RENDERED_LINES; T2 = MessageResponse; T1 = ThemedBox_default; t3 = "column"; T0 = ThemedText; t1 = "error"; - t2 = stripUnderlineAnsi(verbose ? error45 : error45.split(` + t2 = stripUnderlineAnsi(verbose ? error41 : error41.split(` `).slice(0, MAX_RENDERED_LINES).join(` `)); - $2[0] = result3; + $2[0] = result2; $2[1] = verbose; $2[2] = T0; $2[3] = T1; @@ -404279,7 +327930,7 @@ var import_compiler_runtime26, jsx_dev_runtime29, MAX_RENDERED_LINES = 10; var init_FallbackToolUseErrorMessage = __esm(() => { import_compiler_runtime26 = __toESM(require_compiler_runtime(), 1); init_OutputLine(); - init_messages5(); + init_messages3(); init_ink2(); init_useShortcutDisplay(); init_stringUtils(); @@ -404365,16 +328016,16 @@ function applyMarkdown(content, theme, highlight = null) { configureMarked(); return marked.lexer(stripPromptXMLTags(content)).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("").trim(); } -function formatToken(token, theme, listDepth = 0, orderedListNumber = null, parent3 = null, highlight = null) { +function formatToken(token, theme, listDepth = 0, orderedListNumber = null, parent2 = null, highlight = null) { switch (token.type) { case "blockquote": { const inner = (token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join(""); const bar = source_default.dim(BLOCKQUOTE_BAR); - return inner.split(EOL2).map((line) => stripAnsi(line).trim() ? `${bar} ${source_default.italic(line)}` : line).join(EOL2); + return inner.split(EOL).map((line) => stripAnsi(line).trim() ? `${bar} ${source_default.italic(line)}` : line).join(EOL); } case "code": { if (!highlight) { - return token.text + EOL2; + return token.text + EOL; } let language = "plaintext"; if (token.lang) { @@ -404384,23 +328035,23 @@ function formatToken(token, theme, listDepth = 0, orderedListNumber = null, pare logForDebugging(`Language not supported while highlighting code, falling back to plaintext: ${token.lang}`); } } - return highlight.highlight(token.text, { language }) + EOL2; + return highlight.highlight(token.text, { language }) + EOL; } case "codespan": { return color("permission", theme)(token.text); } case "em": - return source_default.italic((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, parent3, highlight)).join("")); + return source_default.italic((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, parent2, highlight)).join("")); case "strong": - return source_default.bold((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, parent3, highlight)).join("")); + return source_default.bold((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, parent2, highlight)).join("")); case "heading": switch (token.depth) { case 1: - return source_default.bold.italic.underline((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("")) + EOL2 + EOL2; + return source_default.bold.italic.underline((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("")) + EOL + EOL; case 2: - return source_default.bold((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("")) + EOL2 + EOL2; + return source_default.bold((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("")) + EOL + EOL; default: - return source_default.bold((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("")) + EOL2 + EOL2; + return source_default.bold((token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("")) + EOL + EOL; } case "hr": return "---"; @@ -404424,17 +328075,17 @@ function formatToken(token, theme, listDepth = 0, orderedListNumber = null, pare case "list_item": return (token.tokens ?? []).map((_) => `${" ".repeat(listDepth)}${formatToken(_, theme, listDepth + 1, orderedListNumber, token, highlight)}`).join(""); case "paragraph": - return (token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("") + EOL2; + return (token.tokens ?? []).map((_) => formatToken(_, theme, 0, null, null, highlight)).join("") + EOL; case "space": - return EOL2; + return EOL; case "br": - return EOL2; + return EOL; case "text": - if (parent3?.type === "link") { + if (parent2?.type === "link") { return token.text; } - if (parent3?.type === "list_item") { - return `${orderedListNumber === null ? "-" : getListNumber(listDepth, orderedListNumber) + "."} ${token.tokens ? token.tokens.map((_) => formatToken(_, theme, listDepth, orderedListNumber, token, highlight)).join("") : linkifyIssueReferences(token.text)}${EOL2}`; + if (parent2?.type === "list_item") { + return `${orderedListNumber === null ? "-" : getListNumber(listDepth, orderedListNumber) + "."} ${token.tokens ? token.tokens.map((_) => formatToken(_, theme, listDepth, orderedListNumber, token, highlight)).join("") : linkifyIssueReferences(token.text)}${EOL}`; } return linkifyIssueReferences(token.text); case "table": { @@ -404458,13 +328109,13 @@ function formatToken(token, theme, listDepth = 0, orderedListNumber = null, pare const align = tableToken.align?.[index]; tableOutput += padAligned(content, stringWidth(displayText), width, align) + " | "; }); - tableOutput = tableOutput.trimEnd() + EOL2; + tableOutput = tableOutput.trimEnd() + EOL; tableOutput += "|"; columnWidths.forEach((width) => { const separator = "-".repeat(width + 2); tableOutput += separator + "|"; }); - tableOutput += EOL2; + tableOutput += EOL; tableToken.rows.forEach((row) => { tableOutput += "| "; row.forEach((cell, index) => { @@ -404474,9 +328125,9 @@ function formatToken(token, theme, listDepth = 0, orderedListNumber = null, pare const align = tableToken.align?.[index]; tableOutput += padAligned(content, stringWidth(displayText), width, align) + " | "; }); - tableOutput = tableOutput.trimEnd() + EOL2; + tableOutput = tableOutput.trimEnd() + EOL; }); - return tableOutput + EOL2; + return tableOutput + EOL; } case "escape": return token.text; @@ -404487,30 +328138,30 @@ function formatToken(token, theme, listDepth = 0, orderedListNumber = null, pare } return ""; } -function linkifyIssueReferences(text2) { +function linkifyIssueReferences(text) { if (!supportsHyperlinks()) { - return text2; + return text; } - return text2.replace(ISSUE_REF_PATTERN, (_match, prefix, repo, num) => prefix + createHyperlink(`https://github.com/${repo}/issues/${num}`, `${repo}#${num}`)); + return text.replace(ISSUE_REF_PATTERN, (_match, prefix, repo, num) => prefix + createHyperlink(`https://github.com/${repo}/issues/${num}`, `${repo}#${num}`)); } function numberToLetter(n2) { - let result3 = ""; + let result2 = ""; while (n2 > 0) { n2--; - result3 = String.fromCharCode(97 + n2 % 26) + result3; + result2 = String.fromCharCode(97 + n2 % 26) + result2; n2 = Math.floor(n2 / 26); } - return result3; + return result2; } function numberToRoman(n2) { - let result3 = ""; + let result2 = ""; for (const [value, numeral] of ROMAN_VALUES) { while (n2 >= value) { - result3 += numeral; + result2 += numeral; n2 -= value; } } - return result3; + return result2; } function getListNumber(listDepth, orderedListNumber) { switch (listDepth) { @@ -404536,7 +328187,7 @@ function padAligned(content, displayWidth, targetWidth, align) { } return content + " ".repeat(padding); } -var EOL2 = ` +var EOL = ` `, markedConfigured = false, ISSUE_REF_PATTERN, ROMAN_VALUES; var init_markdown = __esm(() => { init_source(); @@ -404548,7 +328199,7 @@ var init_markdown = __esm(() => { init_supports_hyperlinks(); init_debug(); init_hyperlink(); - init_messages5(); + init_messages3(); ISSUE_REF_PATTERN = /(^|[^\w./-])([A-Za-z0-9][\w-]*\/[A-Za-z0-9][\w.-]*)#(\d+)\b/g; ROMAN_VALUES = [ [1000, "m"], @@ -404568,10 +328219,10 @@ var init_markdown = __esm(() => { }); // src/components/MarkdownTable.tsx -function wrapText3(text2, width, options2) { +function wrapText3(text, width, options2) { if (width <= 0) - return [text2]; - const trimmedText = text2.trimEnd(); + return [text]; + const trimmedText = text.trimEnd(); const wrapped = wrapAnsi(trimmedText, width, { hard: options2?.hard ?? false, trim: false, @@ -404598,11 +328249,11 @@ function MarkdownTable({ return stripAnsi(formatCell(tokens_0)); } function getMinWidth(tokens_1) { - const text2 = getPlainText(tokens_1); - const words3 = text2.split(/\s+/).filter((w) => w.length > 0); - if (words3.length === 0) + const text = getPlainText(tokens_1); + const words2 = text.split(/\s+/).filter((w) => w.length > 0); + if (words2.length === 0) return MIN_COLUMN_WIDTH; - return Math.max(...words3.map((w_0) => stringWidth(w_0)), MIN_COLUMN_WIDTH); + return Math.max(...words2.map((w_0) => stringWidth(w_0)), MIN_COLUMN_WIDTH); } function getIdealWidth(tokens_2) { return Math.max(stringWidth(getPlainText(tokens_2)), MIN_COLUMN_WIDTH); @@ -404624,7 +328275,7 @@ function MarkdownTable({ const numCols = token.header.length; const borderOverhead = 1 + numCols * 3; const availableWidth = Math.max(terminalWidth - borderOverhead - SAFETY_MARGIN, numCols * MIN_COLUMN_WIDTH); - const totalMin = minWidths.reduce((sum3, w_1) => sum3 + w_1, 0); + const totalMin = minWidths.reduce((sum2, w_1) => sum2 + w_1, 0); const totalIdeal = idealWidths.reduce((sum_0, w_2) => sum_0 + w_2, 0); let needsHardWrap = false; let columnWidths; @@ -404632,13 +328283,13 @@ function MarkdownTable({ columnWidths = idealWidths; } else if (totalMin <= availableWidth) { const extraSpace = availableWidth - totalMin; - const overflows = idealWidths.map((ideal, i4) => ideal - minWidths[i4]); + const overflows = idealWidths.map((ideal, i3) => ideal - minWidths[i3]); const totalOverflow = overflows.reduce((sum_1, o2) => sum_1 + o2, 0); - columnWidths = minWidths.map((min3, i_0) => { + columnWidths = minWidths.map((min2, i_0) => { if (totalOverflow === 0) - return min3; + return min2; const extra = Math.floor(overflows[i_0] / totalOverflow * extraSpace); - return min3 + extra; + return min2 + extra; }); } else { needsHardWrap = true; @@ -404677,7 +328328,7 @@ function MarkdownTable({ }); const maxLines_0 = Math.max(...cellLines.map((lines) => lines.length), 1); const verticalOffsets = cellLines.map((lines_0) => Math.floor((maxLines_0 - lines_0.length) / 2)); - const result3 = []; + const result2 = []; for (let lineIdx = 0;lineIdx < maxLines_0; lineIdx++) { let line = "│"; for (let colIndex_2 = 0;colIndex_2 < cells.length; colIndex_2++) { @@ -404689,9 +328340,9 @@ function MarkdownTable({ const align = isHeader ? "center" : token.align?.[colIndex_2] ?? "left"; line += " " + padAligned(lineText, stringWidth(lineText), width_0, align) + " │"; } - result3.push(line); + result2.push(line); } - return result3; + return result2; } function renderBorderLine(type) { const [left, mid, cross, right] = { @@ -404949,8 +328600,8 @@ function StreamingMarkdown({ lastContentIdx--; } let advance2 = 0; - for (let i4 = 0;i4 < lastContentIdx; i4++) { - advance2 += tokens[i4].raw.length; + for (let i3 = 0;i3 < lastContentIdx; i3++) { + advance2 += tokens[i3].raw.length; } if (advance2 > 0) { stablePrefixRef.current = stripped.substring(0, boundary + advance2); @@ -404979,7 +328630,7 @@ var init_Markdown = __esm(() => { init_ink2(); init_cliHighlight(); init_markdown(); - init_messages5(); + init_messages3(); init_MarkdownTable(); jsx_dev_runtime33 = __toESM(require_jsx_dev_runtime(), 1); tokenCache = new Map; @@ -405006,8 +328657,8 @@ function canUserConfigureAdvisor() { return isAdvisorEnabled() && (getAdvisorConfig().canUserConfigure ?? false); } function getExperimentAdvisorModels() { - const config4 = getAdvisorConfig(); - return isAdvisorEnabled() && !canUserConfigureAdvisor() && config4.baseModel && config4.advisorModel ? { baseModel: config4.baseModel, advisorModel: config4.advisorModel } : undefined; + const config2 = getAdvisorConfig(); + return isAdvisorEnabled() && !canUserConfigureAdvisor() && config2.baseModel && config2.advisorModel ? { baseModel: config2.baseModel, advisorModel: config2.advisorModel } : undefined; } function modelSupportsAdvisor(model) { const m = model.toLowerCase(); @@ -405272,7 +328923,7 @@ var init_CompactSummary = __esm(() => { import_compiler_runtime30 = __toESM(require_compiler_runtime(), 1); init_figures2(); init_ink2(); - init_messages5(); + init_messages3(); init_ConfigurableShortcutHint(); init_MessageResponse(); jsx_dev_runtime34 = __toESM(require_jsx_dev_runtime(), 1); @@ -405296,13 +328947,13 @@ var init_useBlink = __esm(() => { function ToolUseLoader(t0) { const $2 = import_compiler_runtime31.c(7); const { - isError: isError3, + isError: isError2, isUnresolved, shouldAnimate } = t0; const [ref, isBlinking] = useBlink(shouldAnimate); - const color2 = isUnresolved ? undefined : isError3 ? "error" : "success"; - const t1 = !shouldAnimate || isBlinking || isError3 || !isUnresolved ? BLACK_CIRCLE : " "; + const color2 = isUnresolved ? undefined : isError2 ? "error" : "success"; + const t1 = !shouldAnimate || isBlinking || isError2 || !isUnresolved ? BLACK_CIRCLE : " "; let t2; if ($2[0] !== color2 || $2[1] !== isUnresolved || $2[2] !== t1) { t2 = /* @__PURE__ */ jsx_dev_runtime35.jsxDEV(ThemedText, { @@ -405362,7 +329013,7 @@ function AdvisorMessage(t0) { } else { t12 = $2[1]; } - const input3 = t12; + const input = t12; const t2 = addMargin ? 1 : 0; let t3; if ($2[2] !== block2.id || $2[3] !== resolvedToolUseIDs) { @@ -405422,15 +329073,15 @@ function AdvisorMessage(t0) { t8 = $2[14]; } let t9; - if ($2[15] !== input3) { - t9 = input3 ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ThemedText, { + if ($2[15] !== input) { + t9 = input ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ThemedText, { dimColor: true, children: [ " · ", - input3 + input ] }, undefined, true, undefined, this) : null; - $2[15] = input3; + $2[15] = input; $2[16] = t9; } else { t9 = $2[16]; @@ -405635,7 +329286,7 @@ function checkSonnet1mAccess() { return true; } var init_check1mAccess = __esm(() => { - init_auth2(); + init_auth(); init_config2(); init_context(); }); @@ -405721,7 +329372,7 @@ async function enrollTrustedDevice() { logForDebugging("[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)"); return; } - const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = (init_auth2(), __toCommonJS(exports_auth)); + const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = (init_auth(), __toCommonJS(exports_auth)); const accessToken = getClaudeAIOAuthTokens2()?.accessToken; if (!accessToken) { logForDebugging("[trusted-device] No OAuth token, skipping enrollment"); @@ -405743,8 +329394,8 @@ async function enrollTrustedDevice() { timeout: 1e4, validateStatus: (s) => s < 500 }); - } catch (err3) { - logForDebugging(`[trusted-device] Enrollment request failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[trusted-device] Enrollment request failed: ${errorMessage(err2)}`); return; } if (response.status !== 200 && response.status !== 201) { @@ -405763,18 +329414,18 @@ async function enrollTrustedDevice() { return; } storageData.trustedDeviceToken = token; - const result3 = secureStorage.update(storageData); - if (!result3.success) { - logForDebugging(`[trusted-device] Failed to persist token: ${result3.warning ?? "unknown"}`); + const result2 = secureStorage.update(storageData); + if (!result2.success) { + logForDebugging(`[trusted-device] Failed to persist token: ${result2.warning ?? "unknown"}`); return; } readStoredToken.cache?.clear?.(); logForDebugging(`[trusted-device] Enrolled device_id=${response.data.device_id ?? "unknown"}`); - } catch (err3) { - logForDebugging(`[trusted-device] Storage write failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[trusted-device] Storage write failed: ${errorMessage(err2)}`); } - } catch (err3) { - logForDebugging(`[trusted-device] Enrollment error: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[trusted-device] Enrollment error: ${errorMessage(err2)}`); } } var TRUSTED_DEVICE_GATE = "tengu_sessions_elevated_auth_enforcement", readStoredToken; @@ -405797,7 +329448,7 @@ var init_trustedDevice = __esm(() => { }); // src/services/analytics/datadog.ts -import { createHash as createHash9 } from "crypto"; +import { createHash as createHash8 } from "crypto"; function camelToSnakeCase(str) { return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); } @@ -405814,8 +329465,8 @@ async function flushLogs() { }, timeout: NETWORK_TIMEOUT_MS }); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } function scheduleFlush() { @@ -405883,7 +329534,7 @@ async function trackDatadogEvent(eventName, properties) { `event:${eventName}`, ...TAG_FIELDS.filter((field) => allDataRecord[field] !== undefined && allDataRecord[field] !== null).map((field) => `${camelToSnakeCase(field)}:${allDataRecord[field]}`) ]; - const log2 = { + const log = { ddsource: "nodejs", ddtags: tags.join(","), message: eventName, @@ -405893,10 +329544,10 @@ async function trackDatadogEvent(eventName, properties) { }; for (const [key, value] of Object.entries(allData)) { if (value !== undefined && value !== null) { - log2[camelToSnakeCase(key)] = value; + log[camelToSnakeCase(key)] = value; } } - logBatch.push(log2); + logBatch.push(log); if (logBatch.length >= MAX_BATCH_SIZE) { if (flushTimer) { clearTimeout(flushTimer); @@ -405906,8 +329557,8 @@ async function trackDatadogEvent(eventName, properties) { } else { scheduleFlush(); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } function getFlushIntervalMs() { @@ -405997,15 +329648,15 @@ var init_datadog = __esm(() => { try { datadogInitialized = true; return true; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); datadogInitialized = false; return false; } }); getUserBucket = memoize_default(() => { const userId = getOrCreateUserID(); - const hash2 = createHash9("sha256").update(userId).digest("hex"); + const hash2 = createHash8("sha256").update(userId).digest("hex"); return parseInt(hash2.slice(0, 8), 16) % NUM_USER_BUCKETS; }); }); @@ -406092,8 +329743,8 @@ function forceExit(exitCode) { } function gracefulShutdownSync(exitCode = 0, reason = "other", options2) { process.exitCode = exitCode; - pendingShutdown = gracefulShutdown(exitCode, reason, options2).catch((error45) => { - logForDebugging(`Graceful shutdown failed: ${error45}`, { level: "error" }); + pendingShutdown = gracefulShutdown(exitCode, reason, options2).catch((error41) => { + logForDebugging(`Graceful shutdown failed: ${error41}`, { level: "error" }); cleanupTerminalModes(); printResumeHint(); forceExit(exitCode); @@ -406127,8 +329778,8 @@ async function gracefulShutdown(exitCode = 0, reason = "other", options2) { })(); await Promise.race([ cleanupPromise, - new Promise((_, reject3) => { - cleanupTimeoutId = setTimeout((rej) => rej(new CleanupTimeoutError), 2000, reject3); + new Promise((_, reject2) => { + cleanupTimeoutId = setTimeout((rej) => rej(new CleanupTimeoutError), 2000, reject2); }) ]); clearTimeout(cleanupTimeoutId); @@ -406155,7 +329806,7 @@ async function gracefulShutdown(exitCode = 0, reason = "other", options2) { try { await Promise.race([ Promise.all([shutdown1PEventLogging(), shutdownDatadog()]), - sleep4(500) + sleep2(500) ]); } catch {} if (options2?.finalMessage) { @@ -406218,13 +329869,13 @@ var init_gracefulShutdown = __esm(() => { orphanCheckInterval.unref(); } } - process.on("uncaughtException", (error45) => { + process.on("uncaughtException", (error41) => { logForDiagnosticsNoPII("error", "uncaught_exception", { - error_name: error45.name, - error_message: error45.message.slice(0, 2000) + error_name: error41.name, + error_message: error41.message.slice(0, 2000) }); logEvent("tengu_uncaught_exception", { - error_name: error45.name + error_name: error41.name }); }); process.on("unhandledRejection", (reason) => { @@ -406251,7 +329902,7 @@ var init_gracefulShutdown = __esm(() => { async function markGroveNoticeViewed() { try { await withOAuth401Retry(() => { - const authHeaders = getAuthHeaders2(); + const authHeaders = getAuthHeaders(); if (authHeaders.error) { throw new Error(`Failed to get auth headers: ${authHeaders.error}`); } @@ -406263,14 +329914,14 @@ async function markGroveNoticeViewed() { }); }); getGroveSettings.cache.clear?.(); - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); } } async function updateGroveSettings(groveEnabled) { try { await withOAuth401Retry(() => { - const authHeaders = getAuthHeaders2(); + const authHeaders = getAuthHeaders(); if (authHeaders.error) { throw new Error(`Failed to get auth headers: ${authHeaders.error}`); } @@ -406284,8 +329935,8 @@ async function updateGroveSettings(groveEnabled) { }); }); getGroveSettings.cache.clear?.(); - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); } } async function isQualifiedForGrove() { @@ -406298,13 +329949,13 @@ async function isQualifiedForGrove() { } const globalConfig2 = getGlobalConfig(); const cachedEntry = globalConfig2.groveConfigCache?.[accountId]; - const now3 = Date.now(); + const now2 = Date.now(); if (!cachedEntry) { logForDebugging("Grove: No cache, fetching config in background (dialog skipped this session)"); fetchAndStoreGroveConfig(accountId); return false; } - if (now3 - cachedEntry.timestamp > GROVE_CACHE_EXPIRATION_MS) { + if (now2 - cachedEntry.timestamp > GROVE_CACHE_EXPIRATION_MS) { logForDebugging("Grove: Cache stale, returning cached data and refreshing in background"); fetchAndStoreGroveConfig(accountId); return cachedEntry.grove_enabled; @@ -406314,11 +329965,11 @@ async function isQualifiedForGrove() { } async function fetchAndStoreGroveConfig(accountId) { try { - const result3 = await getGroveNoticeConfig(); - if (!result3.success) { + const result2 = await getGroveNoticeConfig(); + if (!result2.success) { return; } - const groveEnabled = result3.data.grove_enabled; + const groveEnabled = result2.data.grove_enabled; const cachedEntry = getGlobalConfig().groveConfigCache?.[accountId]; if (cachedEntry?.grove_enabled === groveEnabled && Date.now() - cachedEntry.timestamp <= GROVE_CACHE_EXPIRATION_MS) { return; @@ -406333,8 +329984,8 @@ async function fetchAndStoreGroveConfig(accountId) { } } })); - } catch (err3) { - logForDebugging(`Grove: Failed to fetch and store config: ${err3}`); + } catch (err2) { + logForDebugging(`Grove: Failed to fetch and store config: ${err2}`); } } function calculateShouldShowGrove(settingsResult, configResult, showIfAlreadyViewed) { @@ -406342,7 +329993,7 @@ function calculateShouldShowGrove(settingsResult, configResult, showIfAlreadyVie return false; } const settings = settingsResult.data; - const config4 = configResult.data; + const config2 = configResult.data; const hasChosen = settings.grove_enabled !== null; if (hasChosen) { return false; @@ -406350,10 +330001,10 @@ function calculateShouldShowGrove(settingsResult, configResult, showIfAlreadyVie if (showIfAlreadyViewed) { return true; } - if (!config4.notice_is_grace_period) { + if (!config2.notice_is_grace_period) { return true; } - const reminderFrequency = config4.notice_reminder_frequency; + const reminderFrequency = config2.notice_reminder_frequency; if (reminderFrequency !== null && settings.grove_notice_viewed_at) { const daysSinceViewed = Math.floor((Date.now() - new Date(settings.grove_notice_viewed_at).getTime()) / (1000 * 60 * 60 * 24)); return daysSinceViewed >= reminderFrequency; @@ -406369,11 +330020,11 @@ async function checkGroveForNonInteractive() { ]); const shouldShowGrove = calculateShouldShowGrove(settingsResult, configResult, false); if (shouldShowGrove) { - const config4 = configResult.success ? configResult.data : null; + const config2 = configResult.success ? configResult.data : null; logEvent("tengu_grove_print_viewed", { - dismissable: config4?.notice_is_grace_period + dismissable: config2?.notice_is_grace_period }); - if (config4 === null || config4.notice_is_grace_period) { + if (config2 === null || config2.notice_is_grace_period) { writeToStderr(` An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms. @@ -406393,7 +330044,7 @@ var init_grove = __esm(() => { init_axios2(); init_memoize(); init_analytics(); - init_auth2(); + init_auth(); init_debug(); init_gracefulShutdown(); init_oauth(); @@ -406407,7 +330058,7 @@ var init_grove = __esm(() => { } try { const response = await withOAuth401Retry(() => { - const authHeaders = getAuthHeaders2(); + const authHeaders = getAuthHeaders(); if (authHeaders.error) { throw new Error(`Failed to get auth headers: ${authHeaders.error}`); } @@ -406419,8 +330070,8 @@ var init_grove = __esm(() => { }); }); return { success: true, data: response.data }; - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); getGroveSettings.cache.clear?.(); return { success: false }; } @@ -406431,7 +330082,7 @@ var init_grove = __esm(() => { } try { const response = await withOAuth401Retry(() => { - const authHeaders = getAuthHeaders2(); + const authHeaders = getAuthHeaders(); if (authHeaders.error) { throw new Error(`Failed to get auth headers: ${authHeaders.error}`); } @@ -406458,8 +330109,8 @@ var init_grove = __esm(() => { notice_reminder_frequency } }; - } catch (err3) { - logForDebugging(`Failed to fetch Grove notice config: ${err3}`); + } catch (err2) { + logForDebugging(`Failed to fetch Grove notice config: ${err2}`); return { success: false }; } }); @@ -406467,7 +330118,7 @@ var init_grove = __esm(() => { // src/services/policyLimits/types.ts var PolicyLimitsResponseSchema; -var init_types8 = __esm(() => { +var init_types6 = __esm(() => { init_v4(); PolicyLimitsResponseSchema = lazySchema(() => exports_external.object({ restrictions: exports_external.record(exports_external.string(), exports_external.object({ allowed: exports_external.boolean() })) @@ -406488,10 +330139,10 @@ __export(exports_policyLimits, { clearPolicyLimitsCache: () => clearPolicyLimitsCache, _resetPolicyLimitsForTesting: () => _resetPolicyLimitsForTesting }); -import { createHash as createHash10 } from "crypto"; +import { createHash as createHash9 } from "crypto"; import { readFileSync as fsReadFileSync } from "fs"; -import { unlink as unlink5, writeFile as writeFile12 } from "fs/promises"; -import { join as join64 } from "path"; +import { unlink as unlink5, writeFile as writeFile10 } from "fs/promises"; +import { join as join54 } from "path"; function isNodeError(e) { return e instanceof Error; } @@ -406506,8 +330157,8 @@ function initializePolicyLimitsLoadingPromise() { return; } if (isPolicyLimitsEligible()) { - loadingCompletePromise = new Promise((resolve25) => { - loadingCompleteResolve = resolve25; + loadingCompletePromise = new Promise((resolve19) => { + loadingCompleteResolve = resolve19; setTimeout(() => { if (loadingCompleteResolve) { logForDebugging("Policy limits: Loading promise timed out, resolving anyway"); @@ -406519,7 +330170,7 @@ function initializePolicyLimitsLoadingPromise() { } } function getCachePath2() { - return join64(getClaudeConfigHomeDir(), CACHE_FILENAME); + return join54(getClaudeConfigHomeDir(), CACHE_FILENAME); } function getPolicyLimitsEndpoint() { return `${getOauthConfig().BASE_API_URL}/api/claude_code/policy_limits`; @@ -406540,7 +330191,7 @@ function sortKeysDeep(obj) { function computeChecksum(restrictions) { const sorted = sortKeysDeep(restrictions); const normalized = jsonStringify(sorted); - const hash2 = createHash10("sha256").update(normalized).digest("hex"); + const hash2 = createHash9("sha256").update(normalized).digest("hex"); return `sha256:${hash2}`; } function isPolicyLimitsEligible() { @@ -406575,7 +330226,7 @@ async function waitForPolicyLimitsToLoad() { await loadingCompletePromise; } } -function getAuthHeaders3() { +function getAuthHeaders2() { try { const { key: apiKey } = getAnthropicApiKeyWithSource({ skipRetrievingKeyFromApiKeyHelper: true @@ -406604,7 +330255,7 @@ function getAuthHeaders3() { } async function fetchWithRetry(cachedChecksum) { let lastResult2 = null; - for (let attempt3 = 1;attempt3 <= DEFAULT_MAX_RETRIES2 + 1; attempt3++) { + for (let attempt2 = 1;attempt2 <= DEFAULT_MAX_RETRIES2 + 1; attempt2++) { lastResult2 = await fetchPolicyLimits(cachedChecksum); if (lastResult2.success) { return lastResult2; @@ -406612,19 +330263,19 @@ async function fetchWithRetry(cachedChecksum) { if (lastResult2.skipRetry) { return lastResult2; } - if (attempt3 > DEFAULT_MAX_RETRIES2) { + if (attempt2 > DEFAULT_MAX_RETRIES2) { return lastResult2; } - const delayMs = getRetryDelay(attempt3); - logForDebugging(`Policy limits: Retry ${attempt3}/${DEFAULT_MAX_RETRIES2} after ${delayMs}ms`); - await sleep4(delayMs); + const delayMs = getRetryDelay(attempt2); + logForDebugging(`Policy limits: Retry ${attempt2}/${DEFAULT_MAX_RETRIES2} after ${delayMs}ms`); + await sleep2(delayMs); } return lastResult2; } async function fetchPolicyLimits(cachedChecksum) { try { await checkAndRefreshOAuthTokenIfNeeded(); - const authHeaders = getAuthHeaders3(); + const authHeaders = getAuthHeaders2(); if (authHeaders.error) { return { success: false, @@ -406674,8 +330325,8 @@ async function fetchPolicyLimits(cachedChecksum) { success: true, restrictions: parsed.data.restrictions }; - } catch (error45) { - const { kind, message } = classifyAxiosError(error45); + } catch (error41) { + const { kind, message } = classifyAxiosError(error41); switch (kind) { case "auth": return { @@ -406707,15 +330358,15 @@ function loadCachedRestrictions() { } async function saveCachedRestrictions(restrictions) { try { - const path16 = getCachePath2(); + const path11 = getCachePath2(); const data = { restrictions }; - await writeFile12(path16, jsonStringify(data, null, 2), { + await writeFile10(path11, jsonStringify(data, null, 2), { encoding: "utf-8", mode: 384 }); - logForDebugging(`Policy limits: Saved to ${path16}`); - } catch (error45) { - logForDebugging(`Policy limits: Failed to save - ${error45 instanceof Error ? error45.message : "unknown error"}`); + logForDebugging(`Policy limits: Saved to ${path11}`); + } catch (error41) { + logForDebugging(`Policy limits: Failed to save - ${error41 instanceof Error ? error41.message : "unknown error"}`); } } async function fetchAndLoadPolicyLimits() { @@ -406725,8 +330376,8 @@ async function fetchAndLoadPolicyLimits() { const cachedRestrictions = loadCachedRestrictions(); const cachedChecksum = cachedRestrictions ? computeChecksum(cachedRestrictions) : undefined; try { - const result3 = await fetchWithRetry(cachedChecksum); - if (!result3.success) { + const result2 = await fetchWithRetry(cachedChecksum); + if (!result2.success) { if (cachedRestrictions) { logForDebugging("Policy limits: Using stale cache after fetch failure"); sessionCache2 = cachedRestrictions; @@ -406734,12 +330385,12 @@ async function fetchAndLoadPolicyLimits() { } return null; } - if (result3.restrictions === null && cachedRestrictions) { + if (result2.restrictions === null && cachedRestrictions) { logForDebugging("Policy limits: Cache still valid (304 Not Modified)"); sessionCache2 = cachedRestrictions; return cachedRestrictions; } - const newRestrictions = result3.restrictions || {}; + const newRestrictions = result2.restrictions || {}; const hasContent = Object.keys(newRestrictions).length > 0; if (hasContent) { sessionCache2 = newRestrictions; @@ -406796,8 +330447,8 @@ function getRestrictionsFromCache() { } async function loadPolicyLimits() { if (isPolicyLimitsEligible() && !loadingCompletePromise) { - loadingCompletePromise = new Promise((resolve25) => { - loadingCompleteResolve = resolve25; + loadingCompletePromise = new Promise((resolve19) => { + loadingCompleteResolve = resolve19; }); } try { @@ -406853,8 +330504,8 @@ function startBackgroundPolling() { pollPolicyLimits(); }, POLLING_INTERVAL_MS); pollingIntervalId.unref(); - if (!cleanupRegistered2) { - cleanupRegistered2 = true; + if (!cleanupRegistered) { + cleanupRegistered = true; registerCleanup(async () => stopBackgroundPolling()); } } @@ -406864,11 +330515,11 @@ function stopBackgroundPolling() { pollingIntervalId = null; } } -var CACHE_FILENAME = "policy-limits.json", FETCH_TIMEOUT_MS2 = 1e4, DEFAULT_MAX_RETRIES2 = 5, POLLING_INTERVAL_MS, pollingIntervalId = null, cleanupRegistered2 = false, loadingCompletePromise = null, loadingCompleteResolve = null, LOADING_PROMISE_TIMEOUT_MS = 30000, sessionCache2 = null, ESSENTIAL_TRAFFIC_DENY_ON_MISS; +var CACHE_FILENAME = "policy-limits.json", FETCH_TIMEOUT_MS2 = 1e4, DEFAULT_MAX_RETRIES2 = 5, POLLING_INTERVAL_MS, pollingIntervalId = null, cleanupRegistered = false, loadingCompletePromise = null, loadingCompleteResolve = null, LOADING_PROMISE_TIMEOUT_MS = 30000, sessionCache2 = null, ESSENTIAL_TRAFFIC_DENY_ON_MISS; var init_policyLimits = __esm(() => { init_axios2(); init_oauth(); - init_auth2(); + init_auth(); init_cleanupRegistry(); init_debug(); init_envUtils(); @@ -406877,7 +330528,7 @@ var init_policyLimits = __esm(() => { init_providers(); init_slowOperations(); init_withRetry(); - init_types8(); + init_types6(); POLLING_INTERVAL_MS = 60 * 60 * 1000; ESSENTIAL_TRAFFIC_DENY_ON_MISS = new Set(["allow_product_feedback"]); }); @@ -406898,8 +330549,8 @@ function useDoublePress(setPending, onDoublePress, onFirstPress) { }; }, [clearTimeoutSafe]); return import_react37.useCallback(() => { - const now3 = Date.now(); - const timeSinceLastPress = now3 - lastPressRef.current; + const now2 = Date.now(); + const timeSinceLastPress = now2 - lastPressRef.current; const isDoublePress = timeSinceLastPress <= DOUBLE_PRESS_TIMEOUT_MS && timeoutRef.current !== undefined; if (isDoublePress) { clearTimeoutSafe(); @@ -406914,7 +330565,7 @@ function useDoublePress(setPending, onDoublePress, onFirstPress) { timeoutRef2.current = undefined; }, DOUBLE_PRESS_TIMEOUT_MS, setPending, timeoutRef); } - lastPressRef.current = now3; + lastPressRef.current = now2; }, [setPending, onDoublePress, onFirstPress, clearTimeoutSafe]); } var import_react37, DOUBLE_PRESS_TIMEOUT_MS = 800; @@ -406964,16 +330615,16 @@ var init_useExitOnCtrlCDWithKeybindings = __esm(() => { }); // src/utils/imagePaste.ts -import { randomBytes as randomBytes5 } from "crypto"; -import { basename as basename13, extname as extname7, isAbsolute as isAbsolute13, join as join65 } from "path"; +import { randomBytes as randomBytes4 } from "crypto"; +import { basename as basename11, extname as extname7, isAbsolute as isAbsolute12, join as join55 } from "path"; function getClipboardCommands() { const platform3 = process.platform; const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (platform3 === "win32" ? process.env.TEMP || "C:\\Temp" : "/tmp"); const screenshotFilename = "claude_cli_latest_screenshot.png"; const tempPaths = { - darwin: join65(baseTmpDir, screenshotFilename), - linux: join65(baseTmpDir, screenshotFilename), - win32: join65(baseTmpDir, screenshotFilename) + darwin: join55(baseTmpDir, screenshotFilename), + linux: join55(baseTmpDir, screenshotFilename), + win32: join55(baseTmpDir, screenshotFilename) }; const screenshotPath = tempPaths[platform3] || tempPaths.linux; const commands = { @@ -407016,11 +330667,11 @@ async function hasImageInClipboard() { logError2(e); } } - const result3 = await execFileNoThrowWithCwd("osascript", [ + const result2 = await execFileNoThrowWithCwd("osascript", [ "-e", "the clipboard as «class PNGf»" ]); - return result3.code === 0; + return result2.code === 0; } async function getImageFromClipboard() { if (feature("NATIVE_CLIPBOARD_IMAGE") && process.platform === "darwin" && getFeatureValue_CACHED_MAY_BE_STALE("tengu_collage_kaleidoscope", true)) { @@ -407099,62 +330750,62 @@ async function getImageFromClipboard() { async function getImagePathFromClipboard() { const { commands } = getClipboardCommands(); try { - const result3 = await execa(commands.getPath, { + const result2 = await execa(commands.getPath, { shell: true, reject: false }); - if (result3.exitCode !== 0 || !result3.stdout) { + if (result2.exitCode !== 0 || !result2.stdout) { return null; } - return result3.stdout.trim(); + return result2.stdout.trim(); } catch (e) { logError2(e); return null; } } -function removeOuterQuotes(text2) { - if (text2.startsWith('"') && text2.endsWith('"') || text2.startsWith("'") && text2.endsWith("'")) { - return text2.slice(1, -1); +function removeOuterQuotes(text) { + if (text.startsWith('"') && text.endsWith('"') || text.startsWith("'") && text.endsWith("'")) { + return text.slice(1, -1); } - return text2; + return text; } -function stripBackslashEscapes(path16) { +function stripBackslashEscapes(path11) { const platform3 = process.platform; if (platform3 === "win32") { - return path16; + return path11; } - const salt = randomBytes5(8).toString("hex"); + const salt = randomBytes4(8).toString("hex"); const placeholder = `__DOUBLE_BACKSLASH_${salt}__`; - const withPlaceholder = path16.replace(/\\\\/g, placeholder); + const withPlaceholder = path11.replace(/\\\\/g, placeholder); const withoutEscapes = withPlaceholder.replace(/\\(.)/g, "$1"); return withoutEscapes.replace(new RegExp(placeholder, "g"), "\\"); } -function isImageFilePath(text2) { - const cleaned = removeOuterQuotes(text2.trim()); +function isImageFilePath(text) { + const cleaned = removeOuterQuotes(text.trim()); const unescaped = stripBackslashEscapes(cleaned); return IMAGE_EXTENSION_REGEX.test(unescaped); } -function asImageFilePath(text2) { - const cleaned = removeOuterQuotes(text2.trim()); +function asImageFilePath(text) { + const cleaned = removeOuterQuotes(text.trim()); const unescaped = stripBackslashEscapes(cleaned); if (IMAGE_EXTENSION_REGEX.test(unescaped)) { return unescaped; } return null; } -async function tryReadImageFromPath(text2) { - const cleanedPath = asImageFilePath(text2); +async function tryReadImageFromPath(text) { + const cleanedPath = asImageFilePath(text); if (!cleanedPath) { return null; } const imagePath = cleanedPath; let imageBuffer; try { - if (isAbsolute13(imagePath)) { + if (isAbsolute12(imagePath)) { imageBuffer = getFsImplementation().readFileBytesSync(imagePath); } else { const clipboardPath = await getImagePathFromClipboard(); - if (clipboardPath && imagePath === basename13(clipboardPath)) { + if (clipboardPath && imagePath === basename11(clipboardPath)) { imageBuffer = getFsImplementation().readFileBytesSync(clipboardPath); } } @@ -407201,9 +330852,9 @@ var init_imagePaste = __esm(() => { // src/utils/imageStore.ts import { mkdir as mkdir12, open as open6 } from "fs/promises"; -import { join as join66 } from "path"; +import { join as join56 } from "path"; function getImageStoreDir() { - return join66(getClaudeConfigHomeDir(), IMAGE_STORE_DIR, getSessionId()); + return join56(getClaudeConfigHomeDir(), IMAGE_STORE_DIR, getSessionId()); } async function ensureImageStoreDir() { const dir = getImageStoreDir(); @@ -407211,7 +330862,7 @@ async function ensureImageStoreDir() { } function getImagePath(imageId, mediaType) { const extension = mediaType.split("/")[1] || "png"; - return join66(getImageStoreDir(), `${imageId}.${extension}`); + return join56(getImageStoreDir(), `${imageId}.${extension}`); } function cacheImagePath(content) { if (content.type !== "image") { @@ -407240,8 +330891,8 @@ async function storeImage(content) { storedImagePaths.set(content.id, imagePath); logForDebugging(`Stored image ${content.id} to ${imagePath}`); return imagePath; - } catch (error45) { - logForDebugging(`Failed to store image: ${error45}`); + } catch (error41) { + logForDebugging(`Failed to store image: ${error41}`); return null; } } @@ -407249,9 +330900,9 @@ async function storeImages(pastedContents) { const pathMap = new Map; for (const [id, content] of Object.entries(pastedContents)) { if (content.type === "image") { - const path16 = await storeImage(content); - if (path16) { - pathMap.set(Number(id), path16); + const path11 = await storeImage(content); + if (path11) { + pathMap.set(Number(id), path11); } } } @@ -407275,7 +330926,7 @@ function evictOldestIfAtCap() { } async function cleanupOldImageCaches() { const fsImpl = getFsImplementation(); - const baseDir = join66(getClaudeConfigHomeDir(), IMAGE_STORE_DIR); + const baseDir = join56(getClaudeConfigHomeDir(), IMAGE_STORE_DIR); const currentSessionId = getSessionId(); try { let sessionDirs; @@ -407288,7 +330939,7 @@ async function cleanupOldImageCaches() { if (sessionDir.name === currentSessionId) { continue; } - const sessionPath = join66(baseDir, sessionDir.name); + const sessionPath = join56(baseDir, sessionDir.name); try { await fsImpl.rm(sessionPath, { recursive: true, force: true }); logForDebugging(`Cleaned up old image cache: ${sessionPath}`); @@ -407992,12 +331643,12 @@ function SelectInputOption(t0) { onImagePaste, onPaste: (pastedText) => { isUserEditing.current = true; - const before3 = inputValue.slice(0, cursorOffset); - const after3 = inputValue.slice(cursorOffset); - const newValue = before3 + pastedText + after3; + const before2 = inputValue.slice(0, cursorOffset); + const after2 = inputValue.slice(cursorOffset); + const newValue = before2 + pastedText + after2; onInputChange(newValue); option.onChange(newValue); - setCursorOffset(before3.length + pastedText.length); + setCursorOffset(before2.length + pastedText.length); } }, undefined, false, undefined, this) ] @@ -408719,8 +332370,8 @@ function useMultiSelectState({ }); return initialMap; }); - const updateSelectedValues = import_react43.useCallback((values4) => { - const newValues = typeof values4 === "function" ? values4(selectedValues) : values4; + const updateSelectedValues = import_react43.useCallback((values2) => { + const newValues = typeof values2 === "function" ? values2(selectedValues) : values2; setSelectedValues(newValues); onChange?.(newValues); }, [selectedValues, onChange]); @@ -408753,12 +332404,12 @@ function useMultiSelectState({ } }); }, [options2, updateSelectedValues]); - use_input_default((input3, key, event) => { - const normalizedInput = normalizeFullWidthDigits(input3); + use_input_default((input, key, event) => { + const normalizedInput = normalizeFullWidthDigits(input); const focusedOption = options2.find((opt) => opt.value === navigation.focusedValue); const isInInput = focusedOption?.type === "input"; if (isInInput) { - const isAllowedKey = key.upArrow || key.downArrow || key.escape || key.tab || key.return || key.ctrl && (input3 === "n" || input3 === "p" || key.return); + const isAllowedKey = key.upArrow || key.downArrow || key.escape || key.tab || key.return || key.ctrl && (input === "n" || input === "p" || key.return); if (!isAllowedKey) return; } @@ -408780,7 +332431,7 @@ function useMultiSelectState({ } return; } - if (key.downArrow || key.ctrl && input3 === "n" || !key.ctrl && !key.shift && input3 === "j") { + if (key.downArrow || key.ctrl && input === "n" || !key.ctrl && !key.shift && input === "j") { if (isSubmitFocused && onDownFromLastItem) { onDownFromLastItem(); } else if (submitButtonText && onSubmit && navigation.focusedValue === lastOptionValue && !isSubmitFocused) { @@ -408792,7 +332443,7 @@ function useMultiSelectState({ } return; } - if (key.upArrow || key.ctrl && input3 === "p" || !key.ctrl && !key.shift && input3 === "k") { + if (key.upArrow || key.ctrl && input === "p" || !key.ctrl && !key.shift && input === "k") { if (submitButtonText && onSubmit && isSubmitFocused) { setIsSubmitFocused(false); navigation.focusOption(lastOptionValue); @@ -408811,7 +332462,7 @@ function useMultiSelectState({ navigation.focusPreviousPage(); return; } - if (key.return || normalizeFullWidthSpace(input3) === " ") { + if (key.return || normalizeFullWidthSpace(input) === " ") { if (key.ctrl && key.return && isInInput && onSubmit) { onSubmit(selectedValues); return; @@ -408952,7 +332603,7 @@ function SelectMulti(t0) { const isLastVisibleOption = option.index === state.visibleToIndex - 1; const areMoreOptionsBelow = state.visibleToIndex < options2.length; const areMoreOptionsAbove = state.visibleFromIndex > 0; - const i4 = state.visibleFromIndex + index + 1; + const i3 = state.visibleFromIndex + index + 1; if (option.type === "input") { const inputValue = state.inputValues.get(option.value) || ""; return /* @__PURE__ */ jsx_dev_runtime42.jsxDEV(ThemedBox_default, { @@ -408964,7 +332615,7 @@ function SelectMulti(t0) { shouldShowDownArrow: areMoreOptionsBelow && isLastVisibleOption, shouldShowUpArrow: areMoreOptionsAbove && isFirstVisibleOption, maxIndexWidth, - index: i4, + index: i3, inputValue, onInputChange: (value) => { state.updateInputValue(option.value, value); @@ -409001,7 +332652,7 @@ function SelectMulti(t0) { children: [ !hideIndexes && /* @__PURE__ */ jsx_dev_runtime42.jsxDEV(ThemedText, { dimColor: true, - children: `${i4}.`.padEnd(maxIndexWidth) + children: `${i3}.`.padEnd(maxIndexWidth) }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime42.jsxDEV(ThemedText, { color: isSelected ? "success" : undefined, @@ -409185,8 +332836,8 @@ var import_react44, useSelectInput = ({ context: "Select", isActive: !isDisabled }); - use_input_default((input3, key, event) => { - const normalizedInput = normalizeFullWidthDigits(input3); + use_input_default((input, key, event) => { + const normalizedInput = normalizeFullWidthDigits(input); const focusedOption = options2.find((opt) => opt.value === state.focusedValue); const currentIsInInput = focusedOption?.type === "input"; if (key.tab && onInputModeToggle && state.focusedValue !== undefined) { @@ -409200,7 +332851,7 @@ var import_react44, useSelectInput = ({ event.stopImmediatePropagation(); return; } - if (key.downArrow || key.ctrl && input3 === "n") { + if (key.downArrow || key.ctrl && input === "n") { if (onDownFromLastItem) { const lastOption = options2[options2.length - 1]; if (lastOption && state.focusedValue === lastOption.value) { @@ -409213,7 +332864,7 @@ var import_react44, useSelectInput = ({ event.stopImmediatePropagation(); return; } - if (key.upArrow || key.ctrl && input3 === "p") { + if (key.upArrow || key.ctrl && input === "p") { if (onUpFromFirstItem && state.visibleFromIndex === 0) { const firstOption = options2[0]; if (firstOption && state.focusedValue === firstOption.value) { @@ -409235,7 +332886,7 @@ var import_react44, useSelectInput = ({ state.focusPreviousPage(); } if (disableSelection !== true) { - if (isMultiSelect && normalizeFullWidthSpace(input3) === " " && state.focusedValue !== undefined) { + if (isMultiSelect && normalizeFullWidthSpace(input) === " " && state.focusedValue !== undefined) { const isFocusedOptionDisabled = focusedOption?.disabled === true; if (!isFocusedOptionDisabled) { state.selectFocusedOption?.(); @@ -409512,7 +333163,7 @@ function Select(t0) { const isLastVisibleOption = option_1.index === state.visibleToIndex - 1; const areMoreOptionsBelow = state.visibleToIndex < options2.length; const areMoreOptionsAbove = state.visibleFromIndex > 0; - const i4 = state.visibleFromIndex + index + 1; + const i3 = state.visibleFromIndex + index + 1; const isFocused = !isDisabled && state.focusedValue === option_1.value; const isSelected = state.value === option_1.value; if (option_1.type === "input") { @@ -409524,7 +333175,7 @@ function Select(t0) { shouldShowDownArrow: areMoreOptionsBelow && isLastVisibleOption, shouldShowUpArrow: areMoreOptionsAbove && isFirstVisibleOption, maxIndexWidth, - index: i4, + index: i3, inputValue, onInputChange: (value) => { setInputValues((prev_0) => { @@ -410523,7 +334174,7 @@ function formatDangerousSettingsList(dangerous) { } return items; } -var init_utils5 = __esm(() => { +var init_utils4 = __esm(() => { init_managedEnvConstants(); init_slowOperations(); }); @@ -410728,7 +334379,7 @@ var init_ManagedSettingsSecurityDialog = __esm(() => { init_useKeybinding(); init_CustomSelect(); init_PermissionDialog(); - init_utils5(); + init_utils4(); jsx_dev_runtime46 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -410800,9 +334451,9 @@ function KeybindingSetup({ bindings, warnings }, setLoadResult] = import_react47.useState(() => { - const result3 = loadKeybindingsSyncWithWarnings(); - logForDebugging(`[keybindings] KeybindingSetup initialized with ${result3.bindings.length} bindings, ${result3.warnings.length} warnings`); - return result3; + const result2 = loadKeybindingsSyncWithWarnings(); + logForDebugging(`[keybindings] KeybindingSetup initialized with ${result2.bindings.length} bindings, ${result2.warnings.length} warnings`); + return result2; }); const [isReload, setIsReload] = import_react47.useState(false); useKeybindingWarnings(warnings, isReload); @@ -410879,7 +334530,7 @@ function ChordInterceptor(t0) { } = t0; let t1; if ($2[0] !== activeContexts || $2[1] !== bindings || $2[2] !== handlerRegistryRef || $2[3] !== pendingChordRef || $2[4] !== setPendingChord) { - t1 = (input3, key, event) => { + t1 = (input, key, event) => { if ((key.wheelUp || key.wheelDown) && pendingChordRef.current === null) { return; } @@ -410894,11 +334545,11 @@ function ChordInterceptor(t0) { } const contexts = [...handlerContexts, ...activeContexts, "Global"]; const wasInChord = pendingChordRef.current !== null; - const result3 = resolveKeyWithChordState(input3, key, contexts, bindings, pendingChordRef.current); + const result2 = resolveKeyWithChordState(input, key, contexts, bindings, pendingChordRef.current); bb23: - switch (result3.type) { + switch (result2.type) { case "chord_started": { - setPendingChord(result3.pending); + setPendingChord(result2.pending); event.stopImmediatePropagation(); break bb23; } @@ -410907,7 +334558,7 @@ function ChordInterceptor(t0) { if (wasInChord) { const contextsSet = new Set(contexts); if (registry2) { - const handlers_0 = registry2.get(result3.action); + const handlers_0 = registry2.get(result2.action); if (handlers_0 && handlers_0.size > 0) { for (const registration_0 of handlers_0) { if (contextsSet.has(registration_0.context)) { @@ -410990,8 +334641,8 @@ function getStdinOverride() { ttyStream.isTTY = true; cachedStdinOverride = ttyStream; return cachedStdinOverride; - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); cachedStdinOverride = undefined; return; } @@ -411022,7 +334673,7 @@ async function checkManagedSettingsSecurity(cachedSettings, newSettings) { return "no_check_needed"; } logEvent("tengu_managed_settings_security_dialog_shown", {}); - return new Promise((resolve25) => { + return new Promise((resolve19) => { (async () => { const { unmount @@ -411033,12 +334684,12 @@ async function checkManagedSettingsSecurity(cachedSettings, newSettings) { onAccept: () => { logEvent("tengu_managed_settings_security_dialog_accepted", {}); unmount(); - resolve25("approved"); + resolve19("approved"); }, onReject: () => { logEvent("tengu_managed_settings_security_dialog_rejected", {}); unmount(); - resolve25("rejected"); + resolve19("rejected"); } }, undefined, false, undefined, this) }, undefined, false, undefined, this) @@ -411046,8 +334697,8 @@ async function checkManagedSettingsSecurity(cachedSettings, newSettings) { })(); }); } -function handleSecurityCheckResult(result3) { - if (result3 === "rejected") { +function handleSecurityCheckResult(result2) { + if (result2 === "rejected") { gracefulShutdownSync(1); return false; } @@ -411057,7 +334708,7 @@ var jsx_dev_runtime48; var init_securityCheck = __esm(() => { init_state(); init_ManagedSettingsSecurityDialog(); - init_utils5(); + init_utils4(); init_ink2(); init_KeybindingProviderSetup(); init_AppState(); @@ -411104,14 +334755,14 @@ function isRemoteManagedSettingsEligible() { var cached2; var init_syncCache = __esm(() => { init_oauth(); - init_auth2(); + init_auth(); init_providers(); init_syncCacheState(); }); // src/services/remoteManagedSettings/types.ts var RemoteManagedSettingsResponseSchema; -var init_types9 = __esm(() => { +var init_types7 = __esm(() => { init_v4(); RemoteManagedSettingsResponseSchema = lazySchema(() => exports_external.object({ uuid: exports_external.string(), @@ -411121,15 +334772,15 @@ var init_types9 = __esm(() => { }); // src/services/remoteManagedSettings/index.ts -import { createHash as createHash11 } from "crypto"; +import { createHash as createHash10 } from "crypto"; import { open as open7, unlink as unlink6 } from "fs/promises"; function initializeRemoteManagedSettingsLoadingPromise() { if (loadingCompletePromise2) { return; } if (isRemoteManagedSettingsEligible()) { - loadingCompletePromise2 = new Promise((resolve25) => { - loadingCompleteResolve2 = resolve25; + loadingCompletePromise2 = new Promise((resolve19) => { + loadingCompleteResolve2 = resolve19; setTimeout(() => { if (loadingCompleteResolve2) { logForDebugging("Remote settings: Loading promise timed out, resolving anyway"); @@ -411159,7 +334810,7 @@ function sortKeysDeep2(obj) { function computeChecksumFromSettings(settings) { const sorted = sortKeysDeep2(settings); const normalized = jsonStringify(sorted); - const hash2 = createHash11("sha256").update(normalized).digest("hex"); + const hash2 = createHash10("sha256").update(normalized).digest("hex"); return `sha256:${hash2}`; } function isEligibleForRemoteManagedSettings() { @@ -411199,7 +334850,7 @@ function getRemoteSettingsAuthHeaders() { } async function fetchWithRetry2(cachedChecksum) { let lastResult2 = null; - for (let attempt3 = 1;attempt3 <= DEFAULT_MAX_RETRIES3 + 1; attempt3++) { + for (let attempt2 = 1;attempt2 <= DEFAULT_MAX_RETRIES3 + 1; attempt2++) { lastResult2 = await fetchRemoteManagedSettings(cachedChecksum); if (lastResult2.success) { return lastResult2; @@ -411207,12 +334858,12 @@ async function fetchWithRetry2(cachedChecksum) { if (lastResult2.skipRetry) { return lastResult2; } - if (attempt3 > DEFAULT_MAX_RETRIES3) { + if (attempt2 > DEFAULT_MAX_RETRIES3) { return lastResult2; } - const delayMs = getRetryDelay(attempt3); - logForDebugging(`Remote settings: Retry ${attempt3}/${DEFAULT_MAX_RETRIES3} after ${delayMs}ms`); - await sleep4(delayMs); + const delayMs = getRetryDelay(attempt2); + logForDebugging(`Remote settings: Retry ${attempt2}/${DEFAULT_MAX_RETRIES3} after ${delayMs}ms`); + await sleep2(delayMs); } return lastResult2; } @@ -411278,8 +334929,8 @@ async function fetchRemoteManagedSettings(cachedChecksum) { settings: settingsValidation.data, checksum: parsed.data.checksum }; - } catch (error45) { - const { kind, status, message } = classifyAxiosError(error45); + } catch (error41) { + const { kind, status, message } = classifyAxiosError(error41); if (status === 404) { return { success: true, settings: {}, checksum: "" }; } @@ -411301,8 +334952,8 @@ async function fetchRemoteManagedSettings(cachedChecksum) { } async function saveSettings(settings) { try { - const path16 = getSettingsPath(); - const handle = await open7(path16, "w", 384); + const path11 = getSettingsPath(); + const handle = await open7(path11, "w", 384); try { await handle.writeFile(jsonStringify(settings, null, 2), { encoding: "utf-8" @@ -411311,9 +334962,9 @@ async function saveSettings(settings) { } finally { await handle.close(); } - logForDebugging(`Remote settings: Saved to ${path16}`); - } catch (error45) { - logForDebugging(`Remote settings: Failed to save - ${error45 instanceof Error ? error45.message : "unknown error"}`); + logForDebugging(`Remote settings: Saved to ${path11}`); + } catch (error41) { + logForDebugging(`Remote settings: Failed to save - ${error41 instanceof Error ? error41.message : "unknown error"}`); } } async function clearRemoteManagedSettingsCache() { @@ -411322,8 +334973,8 @@ async function clearRemoteManagedSettingsCache() { loadingCompletePromise2 = null; loadingCompleteResolve2 = null; try { - const path16 = getSettingsPath(); - await unlink6(path16); + const path11 = getSettingsPath(); + await unlink6(path11); } catch {} } async function fetchAndLoadRemoteManagedSettings() { @@ -411333,8 +334984,8 @@ async function fetchAndLoadRemoteManagedSettings() { const cachedSettings = getRemoteManagedSettingsSyncFromCache(); const cachedChecksum = cachedSettings ? computeChecksumFromSettings(cachedSettings) : undefined; try { - const result3 = await fetchWithRetry2(cachedChecksum); - if (!result3.success) { + const result2 = await fetchWithRetry2(cachedChecksum); + if (!result2.success) { if (cachedSettings) { logForDebugging("Remote settings: Using stale cache after fetch failure"); setSessionCache(cachedSettings); @@ -411342,12 +334993,12 @@ async function fetchAndLoadRemoteManagedSettings() { } return null; } - if (result3.settings === null && cachedSettings) { + if (result2.settings === null && cachedSettings) { logForDebugging("Remote settings: Cache still valid (304 Not Modified)"); setSessionCache(cachedSettings); return cachedSettings; } - const newSettings = result3.settings || {}; + const newSettings = result2.settings || {}; const hasContent = Object.keys(newSettings).length > 0; if (hasContent) { const securityResult = await checkManagedSettingsSecurity(cachedSettings, newSettings); @@ -411362,8 +335013,8 @@ async function fetchAndLoadRemoteManagedSettings() { } setSessionCache(newSettings); try { - const path16 = getSettingsPath(); - await unlink6(path16); + const path11 = getSettingsPath(); + await unlink6(path11); logForDebugging("Remote settings: Deleted cached file (404 response)"); } catch (e) { const code = getErrnoCode(e); @@ -411383,8 +335034,8 @@ async function fetchAndLoadRemoteManagedSettings() { } async function loadRemoteManagedSettings() { if (isRemoteManagedSettingsEligible() && !loadingCompletePromise2) { - loadingCompletePromise2 = new Promise((resolve25) => { - loadingCompleteResolve2 = resolve25; + loadingCompletePromise2 = new Promise((resolve19) => { + loadingCompleteResolve2 = resolve19; }); } if (getRemoteManagedSettingsSyncFromCache() && loadingCompleteResolve2) { @@ -411455,7 +335106,7 @@ var SETTINGS_TIMEOUT_MS = 1e4, DEFAULT_MAX_RETRIES3 = 5, POLLING_INTERVAL_MS2, p var init_remoteManagedSettings = __esm(() => { init_axios2(); init_oauth(); - init_auth2(); + init_auth(); init_cleanupRegistry(); init_debug(); init_errors(); @@ -411466,7 +335117,7 @@ var init_remoteManagedSettings = __esm(() => { init_securityCheck(); init_syncCache(); init_syncCacheState(); - init_types9(); + init_types7(); POLLING_INTERVAL_MS2 = 60 * 60 * 1000; }); @@ -411495,7 +335146,7 @@ var require_MetricData = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-metrics/build/src/utils.js -var require_utils14 = __commonJS((exports) => { +var require_utils13 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.equalsCaseInsensitive = exports.binarySearchUB = exports.setEquals = exports.FlatMap = exports.isPromiseAllSettledRejectionResult = exports.PromiseAllSettled = exports.callWithTimeout = exports.TimeoutError = exports.instrumentationScopeId = exports.hashAttributes = exports.isNotNullish = undefined; function isNotNullish(item) { @@ -411503,16 +335154,16 @@ var require_utils14 = __commonJS((exports) => { } exports.isNotNullish = isNotNullish; function hashAttributes(attributes) { - let keys3 = Object.keys(attributes); - if (keys3.length === 0) + let keys2 = Object.keys(attributes); + if (keys2.length === 0) return ""; - keys3 = keys3.sort(); - return JSON.stringify(keys3.map((key) => [key, attributes[key]])); + keys2 = keys2.sort(); + return JSON.stringify(keys2.map((key) => [key, attributes[key]])); } exports.hashAttributes = hashAttributes; function instrumentationScopeId(instrumentationScope) { - var _a5, _b3; - return `${instrumentationScope.name}:${(_a5 = instrumentationScope.version) !== null && _a5 !== undefined ? _a5 : ""}:${(_b3 = instrumentationScope.schemaUrl) !== null && _b3 !== undefined ? _b3 : ""}`; + var _a3, _b2; + return `${instrumentationScope.name}:${(_a3 = instrumentationScope.version) !== null && _a3 !== undefined ? _a3 : ""}:${(_b2 = instrumentationScope.schemaUrl) !== null && _b2 !== undefined ? _b2 : ""}`; } exports.instrumentationScopeId = instrumentationScopeId; @@ -411525,14 +335176,14 @@ var require_utils14 = __commonJS((exports) => { exports.TimeoutError = TimeoutError; function callWithTimeout(promise3, timeout) { let timeoutHandle; - const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject3) { + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject2) { timeoutHandle = setTimeout(function timeoutHandler() { - reject3(new TimeoutError("Operation timed out.")); + reject2(new TimeoutError("Operation timed out.")); }, timeout); }); - return Promise.race([promise3, timeoutPromise]).then((result3) => { + return Promise.race([promise3, timeoutPromise]).then((result2) => { clearTimeout(timeoutHandle); - return result3; + return result2; }, (reason) => { clearTimeout(timeoutHandle); throw reason; @@ -411561,11 +335212,11 @@ var require_utils14 = __commonJS((exports) => { } exports.isPromiseAllSettledRejectionResult = isPromiseAllSettledRejectionResult; function FlatMap(arr, fn) { - const result3 = []; + const result2 = []; arr.forEach((it) => { - result3.push(...fn(it)); + result2.push(...fn(it)); }); - return result3; + return result2; } exports.FlatMap = FlatMap; function setEquals(lhs, rhs) { @@ -411646,8 +335297,8 @@ var require_Drop = __commonJS((exports) => { var require_InstrumentDescriptor = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isValidName = exports.isDescriptorCompatibleWith = exports.createInstrumentDescriptorWithView = exports.createInstrumentDescriptor = exports.InstrumentType = undefined; - var api_1 = require_src13(); - var utils_1 = require_utils14(); + var api_1 = require_src7(); + var utils_1 = require_utils13(); var InstrumentType; (function(InstrumentType2) { InstrumentType2["COUNTER"] = "COUNTER"; @@ -411659,25 +335310,25 @@ var require_InstrumentDescriptor = __commonJS((exports) => { InstrumentType2["OBSERVABLE_UP_DOWN_COUNTER"] = "OBSERVABLE_UP_DOWN_COUNTER"; })(InstrumentType = exports.InstrumentType || (exports.InstrumentType = {})); function createInstrumentDescriptor(name, type, options2) { - var _a5, _b3, _c45, _d; + var _a3, _b2, _c45, _d; if (!isValidName(name)) { api_1.diag.warn(`Invalid metric name: "${name}". The metric name should be a ASCII string with a length no greater than 255 characters.`); } return { name, type, - description: (_a5 = options2 === null || options2 === undefined ? undefined : options2.description) !== null && _a5 !== undefined ? _a5 : "", - unit: (_b3 = options2 === null || options2 === undefined ? undefined : options2.unit) !== null && _b3 !== undefined ? _b3 : "", + description: (_a3 = options2 === null || options2 === undefined ? undefined : options2.description) !== null && _a3 !== undefined ? _a3 : "", + unit: (_b2 = options2 === null || options2 === undefined ? undefined : options2.unit) !== null && _b2 !== undefined ? _b2 : "", valueType: (_c45 = options2 === null || options2 === undefined ? undefined : options2.valueType) !== null && _c45 !== undefined ? _c45 : api_1.ValueType.DOUBLE, advice: (_d = options2 === null || options2 === undefined ? undefined : options2.advice) !== null && _d !== undefined ? _d : {} }; } exports.createInstrumentDescriptor = createInstrumentDescriptor; function createInstrumentDescriptorWithView(view, instrument) { - var _a5, _b3; + var _a3, _b2; return { - name: (_a5 = view.name) !== null && _a5 !== undefined ? _a5 : instrument.name, - description: (_b3 = view.description) !== null && _b3 !== undefined ? _b3 : instrument.description, + name: (_a3 = view.name) !== null && _a3 !== undefined ? _a3 : instrument.name, + description: (_b2 = view.description) !== null && _b2 !== undefined ? _b2 : instrument.description, type: instrument.type, unit: instrument.unit, valueType: instrument.valueType, @@ -411703,7 +335354,7 @@ var require_Histogram = __commonJS((exports) => { var types_1 = require_types3(); var MetricData_1 = require_MetricData(); var InstrumentDescriptor_1 = require_InstrumentDescriptor(); - var utils_1 = require_utils14(); + var utils_1 = require_utils13(); function createNewEmptyCheckpoint(boundaries) { const counts = boundaries.map(() => 0); counts.push(0); @@ -411768,18 +335419,18 @@ var require_Histogram = __commonJS((exports) => { for (let idx = 0;idx < previousCounts.length; idx++) { mergedCounts[idx] = previousCounts[idx] + deltaCounts[idx]; } - let min3 = Infinity; - let max5 = -Infinity; + let min2 = Infinity; + let max3 = -Infinity; if (this._recordMinMax) { if (previousValue.hasMinMax && deltaValue.hasMinMax) { - min3 = Math.min(previousValue.min, deltaValue.min); - max5 = Math.max(previousValue.max, deltaValue.max); + min2 = Math.min(previousValue.min, deltaValue.min); + max3 = Math.max(previousValue.max, deltaValue.max); } else if (previousValue.hasMinMax) { - min3 = previousValue.min; - max5 = previousValue.max; + min2 = previousValue.min; + max3 = previousValue.max; } else if (deltaValue.hasMinMax) { - min3 = deltaValue.min; - max5 = deltaValue.max; + min2 = deltaValue.min; + max3 = deltaValue.max; } } return new HistogramAccumulation(previous.startTime, previousValue.buckets.boundaries, this._recordMinMax, { @@ -411790,8 +335441,8 @@ var require_Histogram = __commonJS((exports) => { count: previousValue.count + deltaValue.count, sum: previousValue.sum + deltaValue.sum, hasMinMax: this._recordMinMax && (previousValue.hasMinMax || deltaValue.hasMinMax), - min: min3, - max: max5 + min: min2, + max: max3 }); } diff(previous, current) { @@ -411867,7 +335518,7 @@ var require_Buckets = __commonJS((exports) => { return this.indexEnd - this.indexStart + 1; } counts() { - return Array.from({ length: this.length }, (_, i4) => this.at(i4)); + return Array.from({ length: this.length }, (_, i3) => this.at(i3)); } at(position) { const bias = this.indexBase - this.indexStart; @@ -411884,18 +335535,18 @@ var require_Buckets = __commonJS((exports) => { this.backing.decrement(bucketIndex, decrement); } trim() { - for (let i4 = 0;i4 < this.length; i4++) { - if (this.at(i4) !== 0) { - this.indexStart += i4; + for (let i3 = 0;i3 < this.length; i3++) { + if (this.at(i3) !== 0) { + this.indexStart += i3; break; - } else if (i4 === this.length - 1) { + } else if (i3 === this.length - 1) { this.indexStart = this.indexEnd = this.indexBase = 0; return; } } - for (let i4 = this.length - 1;i4 >= 0; i4--) { - if (this.at(i4) !== 0) { - this.indexEnd -= this.length - i4 - 1; + for (let i3 = this.length - 1;i3 >= 0; i3--) { + if (this.at(i3) !== 0) { + this.indexEnd -= this.length - i3 - 1; break; } } @@ -411903,7 +335554,7 @@ var require_Buckets = __commonJS((exports) => { } downscale(by) { this._rotate(); - const size3 = 1 + this.indexEnd - this.indexStart; + const size2 = 1 + this.indexEnd - this.indexStart; const each = 1 << by; let inpos = 0; let outpos = 0; @@ -411912,7 +335563,7 @@ var require_Buckets = __commonJS((exports) => { if (mod2 < 0) { mod2 += each; } - for (let i4 = mod2;i4 < each && inpos < size3; i4++) { + for (let i3 = mod2;i3 < each && inpos < size2; i3++) { this._relocateBucket(outpos, inpos); inpos++; pos++; @@ -411967,10 +335618,10 @@ var require_Buckets = __commonJS((exports) => { } reverse(from, limit) { const num = Math.floor((from + limit) / 2) - from; - for (let i4 = 0;i4 < num; i4++) { - const tmp = this._counts[from + i4]; - this._counts[from + i4] = this._counts[limit - i4 - 1]; - this._counts[limit - i4 - 1] = tmp; + for (let i3 = 0;i3 < num; i3++) { + const tmp = this._counts[from + i3]; + this._counts[from + i3] = this._counts[limit - i3 - 1]; + this._counts[limit - i3 - 1] = tmp; } } emptyBucket(src) { @@ -412025,7 +335676,7 @@ var require_ieee754 = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/util.js -var require_util13 = __commonJS((exports) => { +var require_util11 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.nextGreaterSquare = exports.ldexp = undefined; function ldexp(frac, exp) { @@ -412063,7 +335714,7 @@ var require_ExponentMapping = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ExponentMapping = undefined; var ieee754 = require_ieee754(); - var util7 = require_util13(); + var util5 = require_util11(); var types_1 = require_types4(); class ExponentMapping { @@ -412087,7 +335738,7 @@ var require_ExponentMapping = __commonJS((exports) => { if (index > maxIndex) { throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); } - return util7.ldexp(1, index << this._shift); + return util5.ldexp(1, index << this._shift); } get scale() { if (this._shift === 0) { @@ -412117,14 +335768,14 @@ var require_LogarithmMapping = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.LogarithmMapping = undefined; var ieee754 = require_ieee754(); - var util7 = require_util13(); + var util5 = require_util11(); var types_1 = require_types4(); class LogarithmMapping { constructor(scale) { this._scale = scale; - this._scaleFactor = util7.ldexp(Math.LOG2E, scale); - this._inverseFactor = util7.ldexp(Math.LN2, -scale); + this._scaleFactor = util5.ldexp(Math.LOG2E, scale); + this._inverseFactor = util5.ldexp(Math.LN2, -scale); } mapToIndex(value) { if (value <= ieee754.MIN_VALUE) { @@ -412182,11 +335833,11 @@ var require_getMapping = __commonJS((exports) => { var types_1 = require_types4(); var MIN_SCALE = -10; var MAX_SCALE = 20; - var PREBUILT_MAPPINGS = Array.from({ length: 31 }, (_, i4) => { - if (i4 > 10) { - return new LogarithmMapping_1.LogarithmMapping(i4 - 10); + var PREBUILT_MAPPINGS = Array.from({ length: 31 }, (_, i3) => { + if (i3 > 10) { + return new LogarithmMapping_1.LogarithmMapping(i3 - 10); } - return new ExponentMapping_1.ExponentMapping(i4 - 10); + return new ExponentMapping_1.ExponentMapping(i3 - 10); }); function getMapping(scale) { if (scale > MAX_SCALE || scale < MIN_SCALE) { @@ -412203,11 +335854,11 @@ var require_ExponentialHistogram = __commonJS((exports) => { exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = undefined; var types_1 = require_types3(); var MetricData_1 = require_MetricData(); - var api_1 = require_src13(); + var api_1 = require_src7(); var InstrumentDescriptor_1 = require_InstrumentDescriptor(); var Buckets_1 = require_Buckets(); var getMapping_1 = require_getMapping(); - var util_1 = require_util13(); + var util_1 = require_util11(); class HighLow { constructor(low, high) { @@ -412401,9 +336052,9 @@ var require_ExponentialHistogram = __commonJS((exports) => { buckets.incrementBucket(bucketIndex, increment3); } _grow(buckets, needed) { - const size3 = buckets.backing.length; + const size2 = buckets.backing.length; const bias = buckets.indexBase - buckets.indexStart; - const oldPositiveLimit = size3 - bias; + const oldPositiveLimit = size2 - bias; let newSize = (0, util_1.nextGreaterSquare)(needed); if (newSize > this._maxSize) { newSize = this._maxSize; @@ -412448,20 +336099,20 @@ var require_ExponentialHistogram = __commonJS((exports) => { _mergeBuckets(ours, other2, theirs, scale) { const theirOffset = theirs.offset; const theirChange = other2.scale - scale; - for (let i4 = 0;i4 < theirs.length; i4++) { - this._incrementIndexBy(ours, theirOffset + i4 >> theirChange, theirs.at(i4)); + for (let i3 = 0;i3 < theirs.length; i3++) { + this._incrementIndexBy(ours, theirOffset + i3 >> theirChange, theirs.at(i3)); } } _diffBuckets(ours, other2, theirs, scale) { const theirOffset = theirs.offset; const theirChange = other2.scale - scale; - for (let i4 = 0;i4 < theirs.length; i4++) { - const ourIndex = theirOffset + i4 >> theirChange; + for (let i3 = 0;i3 < theirs.length; i3++) { + const ourIndex = theirOffset + i3 >> theirChange; let bucketIndex = ourIndex - ours.indexBase; if (bucketIndex < 0) { bucketIndex += ours.backing.length; } - ours.decrementBucket(bucketIndex, theirs.at(i4)); + ours.decrementBucket(bucketIndex, theirs.at(i3)); } ours.trim(); } @@ -412478,14 +336129,14 @@ var require_ExponentialHistogram = __commonJS((exports) => { return new ExponentialHistogramAccumulation(startTime, this._maxSize, this._recordMinMax); } merge(previous, delta) { - const result3 = delta.clone(); - result3.merge(previous); - return result3; + const result2 = delta.clone(); + result2.merge(previous); + return result2; } diff(previous, current) { - const result3 = current.clone(); - result3.diff(previous); - return result3; + const result2 = current.clone(); + result2.diff(previous); + return result2; } toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { return { @@ -412528,7 +336179,7 @@ var require_LastValue = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.LastValueAggregator = exports.LastValueAccumulation = undefined; var types_1 = require_types3(); - var core_1 = require_src16(); + var core_1 = require_src10(); var MetricData_1 = require_MetricData(); class LastValueAccumulation { @@ -412592,11 +336243,11 @@ var require_Sum = __commonJS((exports) => { var MetricData_1 = require_MetricData(); class SumAccumulation { - constructor(startTime, monotonic, _current = 0, reset4 = false) { + constructor(startTime, monotonic, _current = 0, reset3 = false) { this.startTime = startTime; this.monotonic = monotonic; this._current = _current; - this.reset = reset4; + this.reset = reset3; } record(value) { if (this.monotonic && value < 0) { @@ -412699,7 +336350,7 @@ var require_aggregator = __commonJS((exports) => { var require_Aggregation = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultAggregation = exports.ExponentialHistogramAggregation = exports.ExplicitBucketHistogramAggregation = exports.HistogramAggregation = exports.LastValueAggregation = exports.SumAggregation = exports.DropAggregation = exports.Aggregation = undefined; - var api2 = require_src13(); + var api2 = require_src7(); var aggregator_1 = require_aggregator(); var InstrumentDescriptor_1 = require_InstrumentDescriptor(); @@ -412853,16 +336504,16 @@ var require_AggregationSelector = __commonJS((exports) => { var require_MetricReader = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.MetricReader = undefined; - var api2 = require_src13(); - var utils_1 = require_utils14(); + var api2 = require_src7(); + var utils_1 = require_utils13(); var AggregationSelector_1 = require_AggregationSelector(); class MetricReader { constructor(options2) { - var _a5, _b3, _c45; + var _a3, _b2, _c45; this._shutdown = false; - this._aggregationSelector = (_a5 = options2 === null || options2 === undefined ? undefined : options2.aggregationSelector) !== null && _a5 !== undefined ? _a5 : AggregationSelector_1.DEFAULT_AGGREGATION_SELECTOR; - this._aggregationTemporalitySelector = (_b3 = options2 === null || options2 === undefined ? undefined : options2.aggregationTemporalitySelector) !== null && _b3 !== undefined ? _b3 : AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; + this._aggregationSelector = (_a3 = options2 === null || options2 === undefined ? undefined : options2.aggregationSelector) !== null && _a3 !== undefined ? _a3 : AggregationSelector_1.DEFAULT_AGGREGATION_SELECTOR; + this._aggregationTemporalitySelector = (_b2 = options2 === null || options2 === undefined ? undefined : options2.aggregationTemporalitySelector) !== null && _b2 !== undefined ? _b2 : AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; this._metricProducers = (_c45 = options2 === null || options2 === undefined ? undefined : options2.metricProducers) !== null && _c45 !== undefined ? _c45 : []; this._cardinalitySelector = options2 === null || options2 === undefined ? undefined : options2.cardinalitySelector; } @@ -412898,15 +336549,15 @@ var require_MetricReader = __commonJS((exports) => { timeoutMillis: options2 === null || options2 === undefined ? undefined : options2.timeoutMillis })) ]); - const errors5 = sdkCollectionResults.errors.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result3) => result3.errors)); + const errors4 = sdkCollectionResults.errors.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result2) => result2.errors)); const resource = sdkCollectionResults.resourceMetrics.resource; - const scopeMetrics = sdkCollectionResults.resourceMetrics.scopeMetrics.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result3) => result3.resourceMetrics.scopeMetrics)); + const scopeMetrics = sdkCollectionResults.resourceMetrics.scopeMetrics.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result2) => result2.resourceMetrics.scopeMetrics)); return { resourceMetrics: { resource, scopeMetrics }, - errors: errors5 + errors: errors4 }; } async shutdown(options2) { @@ -412940,17 +336591,17 @@ var require_MetricReader = __commonJS((exports) => { var require_PeriodicExportingMetricReader = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.PeriodicExportingMetricReader = undefined; - var api2 = require_src13(); - var core_1 = require_src16(); + var api2 = require_src7(); + var core_1 = require_src10(); var MetricReader_1 = require_MetricReader(); - var utils_1 = require_utils14(); + var utils_1 = require_utils13(); class PeriodicExportingMetricReader extends MetricReader_1.MetricReader { constructor(options2) { - var _a5, _b3, _c45, _d; + var _a3, _b2, _c45, _d; super({ - aggregationSelector: (_a5 = options2.exporter.selectAggregation) === null || _a5 === undefined ? undefined : _a5.bind(options2.exporter), - aggregationTemporalitySelector: (_b3 = options2.exporter.selectAggregationTemporality) === null || _b3 === undefined ? undefined : _b3.bind(options2.exporter), + aggregationSelector: (_a3 = options2.exporter.selectAggregation) === null || _a3 === undefined ? undefined : _a3.bind(options2.exporter), + aggregationTemporalitySelector: (_b2 = options2.exporter.selectAggregationTemporality) === null || _b2 === undefined ? undefined : _b2.bind(options2.exporter), metricProducers: options2.metricProducers }); if (options2.exportIntervalMillis !== undefined && options2.exportIntervalMillis <= 0) { @@ -412969,25 +336620,25 @@ var require_PeriodicExportingMetricReader = __commonJS((exports) => { async _runOnce() { try { await (0, utils_1.callWithTimeout)(this._doRun(), this._exportTimeout); - } catch (err3) { - if (err3 instanceof utils_1.TimeoutError) { + } catch (err2) { + if (err2 instanceof utils_1.TimeoutError) { api2.diag.error("Export took longer than %s milliseconds and timed out.", this._exportTimeout); return; } - (0, core_1.globalErrorHandler)(err3); + (0, core_1.globalErrorHandler)(err2); } } async _doRun() { - var _a5, _b3; - const { resourceMetrics, errors: errors5 } = await this.collect({ + var _a3, _b2; + const { resourceMetrics, errors: errors4 } = await this.collect({ timeoutMillis: this._exportTimeout }); - if (errors5.length > 0) { - api2.diag.error("PeriodicExportingMetricReader: metrics collection errors", ...errors5); + if (errors4.length > 0) { + api2.diag.error("PeriodicExportingMetricReader: metrics collection errors", ...errors4); } if (resourceMetrics.resource.asyncAttributesPending) { try { - await ((_b3 = (_a5 = resourceMetrics.resource).waitForAsyncAttributes) === null || _b3 === undefined ? undefined : _b3.call(_a5)); + await ((_b2 = (_a3 = resourceMetrics.resource).waitForAsyncAttributes) === null || _b2 === undefined ? undefined : _b2.call(_a3)); } catch (e) { api2.diag.debug("Error while resolving async portion of resource: ", e); (0, core_1.globalErrorHandler)(e); @@ -412996,9 +336647,9 @@ var require_PeriodicExportingMetricReader = __commonJS((exports) => { if (resourceMetrics.scopeMetrics.length === 0) { return; } - const result3 = await core_1.internal._export(this._exporter, resourceMetrics); - if (result3.code !== core_1.ExportResultCode.SUCCESS) { - throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${result3.error})`); + const result2 = await core_1.internal._export(this._exporter, resourceMetrics); + if (result2.code !== core_1.ExportResultCode.SUCCESS) { + throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${result2.error})`); } } onInitialized() { @@ -413026,7 +336677,7 @@ var require_PeriodicExportingMetricReader = __commonJS((exports) => { var require_InMemoryMetricExporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.InMemoryMetricExporter = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); class InMemoryMetricExporter { constructor(aggregationTemporality) { @@ -413066,14 +336717,14 @@ var require_InMemoryMetricExporter = __commonJS((exports) => { var require_ConsoleMetricExporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ConsoleMetricExporter = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); var AggregationSelector_1 = require_AggregationSelector(); class ConsoleMetricExporter { constructor(options2) { - var _a5; + var _a3; this._shutdown = false; - this._temporalitySelector = (_a5 = options2 === null || options2 === undefined ? undefined : options2.temporalitySelector) !== null && _a5 !== undefined ? _a5 : AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; + this._temporalitySelector = (_a3 = options2 === null || options2 === undefined ? undefined : options2.temporalitySelector) !== null && _a3 !== undefined ? _a3 : AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; } export(metrics, resultCallback) { if (this._shutdown) { @@ -413140,8 +336791,8 @@ var require_ViewRegistry = __commonJS((exports) => { var require_Instruments = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isObservableInstrument = exports.ObservableUpDownCounterInstrument = exports.ObservableGaugeInstrument = exports.ObservableCounterInstrument = exports.ObservableInstrument = exports.HistogramInstrument = exports.GaugeInstrument = exports.CounterInstrument = exports.UpDownCounterInstrument = exports.SyncInstrument = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var core_1 = require_src10(); class SyncInstrument { constructor(_writableMetricStorage, _descriptor) { @@ -413318,7 +336969,7 @@ var require_MetricStorage = __commonJS((exports) => { var require_HashMap = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AttributeHashMap = exports.HashMap = undefined; - var utils_1 = require_utils14(); + var utils_1 = require_utils13(); class HashMap { constructor(_hash) { @@ -413387,7 +337038,7 @@ var require_HashMap = __commonJS((exports) => { var require_DeltaMetricProcessor = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.DeltaMetricProcessor = undefined; - var utils_1 = require_utils14(); + var utils_1 = require_utils13(); var HashMap_1 = require_HashMap(); class DeltaMetricProcessor { @@ -413466,26 +337117,26 @@ var require_TemporalMetricProcessor = __commonJS((exports) => { buildMetrics(collector, instrumentDescriptor, currentAccumulations, collectionTime) { this._stashAccumulations(currentAccumulations); const unreportedAccumulations = this._getMergedUnreportedAccumulations(collector); - let result3 = unreportedAccumulations; + let result2 = unreportedAccumulations; let aggregationTemporality; if (this._reportHistory.has(collector)) { - const last3 = this._reportHistory.get(collector); - const lastCollectionTime = last3.collectionTime; - aggregationTemporality = last3.aggregationTemporality; + const last2 = this._reportHistory.get(collector); + const lastCollectionTime = last2.collectionTime; + aggregationTemporality = last2.aggregationTemporality; if (aggregationTemporality === AggregationTemporality_1.AggregationTemporality.CUMULATIVE) { - result3 = TemporalMetricProcessor.merge(last3.accumulations, unreportedAccumulations, this._aggregator); + result2 = TemporalMetricProcessor.merge(last2.accumulations, unreportedAccumulations, this._aggregator); } else { - result3 = TemporalMetricProcessor.calibrateStartTime(last3.accumulations, unreportedAccumulations, lastCollectionTime); + result2 = TemporalMetricProcessor.calibrateStartTime(last2.accumulations, unreportedAccumulations, lastCollectionTime); } } else { aggregationTemporality = collector.selectAggregationTemporality(instrumentDescriptor.type); } this._reportHistory.set(collector, { - accumulations: result3, + accumulations: result2, collectionTime, aggregationTemporality }); - const accumulationRecords = AttributesMapToAccumulationRecords(result3); + const accumulationRecords = AttributesMapToAccumulationRecords(result2); if (accumulationRecords.length === 0) { return; } @@ -413503,36 +337154,36 @@ var require_TemporalMetricProcessor = __commonJS((exports) => { } } _getMergedUnreportedAccumulations(collector) { - let result3 = new HashMap_1.AttributeHashMap; + let result2 = new HashMap_1.AttributeHashMap; const unreportedList = this._unreportedAccumulations.get(collector); this._unreportedAccumulations.set(collector, []); if (unreportedList === undefined) { - return result3; + return result2; } for (const it of unreportedList) { - result3 = TemporalMetricProcessor.merge(result3, it, this._aggregator); + result2 = TemporalMetricProcessor.merge(result2, it, this._aggregator); } - return result3; + return result2; } - static merge(last3, current, aggregator) { - const result3 = last3; + static merge(last2, current, aggregator) { + const result2 = last2; const iterator2 = current.entries(); let next = iterator2.next(); while (next.done !== true) { const [key, record3, hash2] = next.value; - if (last3.has(key, hash2)) { - const lastAccumulation = last3.get(key, hash2); + if (last2.has(key, hash2)) { + const lastAccumulation = last2.get(key, hash2); const accumulation = aggregator.merge(lastAccumulation, record3); - result3.set(key, accumulation, hash2); + result2.set(key, accumulation, hash2); } else { - result3.set(key, record3, hash2); + result2.set(key, record3, hash2); } next = iterator2.next(); } - return result3; + return result2; } - static calibrateStartTime(last3, current, lastCollectionTime) { - for (const [key, hash2] of last3.keys()) { + static calibrateStartTime(last2, current, lastCollectionTime) { + for (const [key, hash2] of last2.keys()) { const currentAccumulation = current.get(key, hash2); currentAccumulation === null || currentAccumulation === undefined || currentAccumulation.setStartTime(lastCollectionTime); } @@ -413540,8 +337191,8 @@ var require_TemporalMetricProcessor = __commonJS((exports) => { } } exports.TemporalMetricProcessor = TemporalMetricProcessor; - function AttributesMapToAccumulationRecords(map6) { - return Array.from(map6.entries()); + function AttributesMapToAccumulationRecords(map4) { + return Array.from(map4.entries()); } }); @@ -413655,7 +337306,7 @@ var require_MetricStorageRegistry = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.MetricStorageRegistry = undefined; var InstrumentDescriptor_1 = require_InstrumentDescriptor(); - var api2 = require_src13(); + var api2 = require_src7(); var RegistrationConflicts_1 = require_RegistrationConflicts(); class MetricStorageRegistry { @@ -413767,7 +337418,7 @@ var require_MultiWritableMetricStorage = __commonJS((exports) => { var require_ObservableResult = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchObservableResultImpl = exports.ObservableResultImpl = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var HashMap_1 = require_HashMap(); var Instruments_1 = require_Instruments(); @@ -413802,10 +337453,10 @@ var require_ObservableResult = __commonJS((exports) => { if (!(0, Instruments_1.isObservableInstrument)(metric)) { return; } - let map6 = this._buffer.get(metric); - if (map6 == null) { - map6 = new HashMap_1.AttributeHashMap; - this._buffer.set(metric, map6); + let map4 = this._buffer.get(metric); + if (map4 == null) { + map4 = new HashMap_1.AttributeHashMap; + this._buffer.set(metric, map4); } if (typeof value !== "number") { api_1.diag.warn(`non-number value provided to metric ${metric._descriptor.name}: ${value}`); @@ -413818,7 +337469,7 @@ var require_ObservableResult = __commonJS((exports) => { return; } } - map6.set(attributes, value); + map4.set(attributes, value); } } exports.BatchObservableResultImpl = BatchObservableResultImpl; @@ -413828,10 +337479,10 @@ var require_ObservableResult = __commonJS((exports) => { var require_ObservableRegistry = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ObservableRegistry = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var Instruments_1 = require_Instruments(); var ObservableResult_1 = require_ObservableResult(); - var utils_1 = require_utils14(); + var utils_1 = require_utils13(); class ObservableRegistry { constructor() { @@ -413996,7 +337647,7 @@ var require_MeterSharedState = __commonJS((exports) => { exports.MeterSharedState = undefined; var InstrumentDescriptor_1 = require_InstrumentDescriptor(); var Meter_1 = require_Meter(); - var utils_1 = require_utils14(); + var utils_1 = require_utils13(); var AsyncMetricStorage_1 = require_AsyncMetricStorage(); var MetricStorageRegistry_1 = require_MetricStorageRegistry(); var MultiWritableMetricStorage_1 = require_MultiWritableMetricStorage(); @@ -414024,7 +337675,7 @@ var require_MeterSharedState = __commonJS((exports) => { return storages; } async collect(collector, collectionTime, options2) { - const errors5 = await this.observableRegistry.observe(collectionTime, options2 === null || options2 === undefined ? undefined : options2.timeoutMillis); + const errors4 = await this.observableRegistry.observe(collectionTime, options2 === null || options2 === undefined ? undefined : options2.timeoutMillis); const storages = this.metricStorageRegistry.getStorages(collector); if (storages.length === 0) { return null; @@ -414033,14 +337684,14 @@ var require_MeterSharedState = __commonJS((exports) => { return metricStorage.collect(collector, collectionTime); }).filter(utils_1.isNotNullish); if (metricDataList.length === 0) { - return { errors: errors5 }; + return { errors: errors4 }; } return { scopeMetrics: { scope: this._instrumentationScope, metrics: metricDataList }, - errors: errors5 + errors: errors4 }; } _registerMetricStorage(descriptor, MetricStorageType) { @@ -414081,7 +337732,7 @@ var require_MeterSharedState = __commonJS((exports) => { var require_MeterProviderSharedState = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.MeterProviderSharedState = undefined; - var utils_1 = require_utils14(); + var utils_1 = require_utils13(); var ViewRegistry_1 = require_ViewRegistry(); var MeterSharedState_1 = require_MeterSharedState(); @@ -414102,11 +337753,11 @@ var require_MeterProviderSharedState = __commonJS((exports) => { return meterSharedState; } selectAggregations(instrumentType) { - const result3 = []; + const result2 = []; for (const collector of this.metricCollectors) { - result3.push([collector, collector.selectAggregation(instrumentType)]); + result2.push([collector, collector.selectAggregation(instrumentType)]); } - return result3; + return result2; } } exports.MeterProviderSharedState = MeterProviderSharedState; @@ -414116,7 +337767,7 @@ var require_MeterProviderSharedState = __commonJS((exports) => { var require_MetricCollector = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.MetricCollector = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); class MetricCollector { constructor(_sharedState, _metricReader) { @@ -414126,14 +337777,14 @@ var require_MetricCollector = __commonJS((exports) => { async collect(options2) { const collectionTime = (0, core_1.millisToHrTime)(Date.now()); const scopeMetrics = []; - const errors5 = []; + const errors4 = []; const meterCollectionPromises = Array.from(this._sharedState.meterSharedStates.values()).map(async (meterSharedState) => { const current = await meterSharedState.collect(this, collectionTime, options2); if ((current === null || current === undefined ? undefined : current.scopeMetrics) != null) { scopeMetrics.push(current.scopeMetrics); } if ((current === null || current === undefined ? undefined : current.errors) != null) { - errors5.push(...current.errors); + errors4.push(...current.errors); } }); await Promise.all(meterCollectionPromises); @@ -414142,7 +337793,7 @@ var require_MetricCollector = __commonJS((exports) => { resource: this._sharedState.resource, scopeMetrics }, - errors: errors5 + errors: errors4 }; } async forceFlush(options2) { @@ -414158,8 +337809,8 @@ var require_MetricCollector = __commonJS((exports) => { return this._metricReader.selectAggregation(instrumentType); } selectCardinalityLimit(instrumentType) { - var _a5, _b3, _c45; - return (_c45 = (_b3 = (_a5 = this._metricReader).selectCardinalityLimit) === null || _b3 === undefined ? undefined : _b3.call(_a5, instrumentType)) !== null && _c45 !== undefined ? _c45 : 2000; + var _a3, _b2, _c45; + return (_c45 = (_b2 = (_a3 = this._metricReader).selectCardinalityLimit) === null || _b2 === undefined ? undefined : _b2.call(_a3, instrumentType)) !== null && _c45 !== undefined ? _c45 : 2000; } } exports.MetricCollector = MetricCollector; @@ -414169,8 +337820,8 @@ var require_MetricCollector = __commonJS((exports) => { var require_MeterProvider = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.MeterProvider = undefined; - var api_1 = require_src13(); - var resources_1 = require_src17(); + var api_1 = require_src7(); + var resources_1 = require_src11(); var MeterProviderSharedState_1 = require_MeterProviderSharedState(); var MetricCollector_1 = require_MetricCollector(); function prepareResource(mergeWithDefaults, providedResource) { @@ -414183,9 +337834,9 @@ var require_MeterProvider = __commonJS((exports) => { class MeterProvider { constructor(options2) { - var _a5; + var _a3; this._shutdown = false; - this._sharedState = new MeterProviderSharedState_1.MeterProviderSharedState(prepareResource((_a5 = options2 === null || options2 === undefined ? undefined : options2.mergeResourceWithDefaults) !== null && _a5 !== undefined ? _a5 : true, options2 === null || options2 === undefined ? undefined : options2.resource)); + this._sharedState = new MeterProviderSharedState_1.MeterProviderSharedState(prepareResource((_a3 = options2 === null || options2 === undefined ? undefined : options2.mergeResourceWithDefaults) !== null && _a3 !== undefined ? _a3 : true, options2 === null || options2 === undefined ? undefined : options2.resource)); if ((options2 === null || options2 === undefined ? undefined : options2.views) != null && options2.views.length > 0) { for (const view of options2.views) { this._sharedState.viewRegistry.addView(view); @@ -414293,8 +337944,8 @@ var require_InstrumentSelector = __commonJS((exports) => { class InstrumentSelector { constructor(criteria) { - var _a5; - this._nameFilter = new Predicate_1.PatternPredicate((_a5 = criteria === null || criteria === undefined ? undefined : criteria.name) !== null && _a5 !== undefined ? _a5 : "*"); + var _a3; + this._nameFilter = new Predicate_1.PatternPredicate((_a3 = criteria === null || criteria === undefined ? undefined : criteria.name) !== null && _a3 !== undefined ? _a3 : "*"); this._type = criteria === null || criteria === undefined ? undefined : criteria.type; this._unitFilter = new Predicate_1.ExactPredicate(criteria === null || criteria === undefined ? undefined : criteria.unit); } @@ -414351,7 +338002,7 @@ var require_View = __commonJS((exports) => { class View { constructor(viewOptions) { - var _a5; + var _a3; if (isSelectorNotProvided(viewOptions)) { throw new Error("Cannot create view with no selector arguments supplied"); } @@ -414365,7 +338016,7 @@ var require_View = __commonJS((exports) => { } this.name = viewOptions.name; this.description = viewOptions.description; - this.aggregation = (_a5 = viewOptions.aggregation) !== null && _a5 !== undefined ? _a5 : Aggregation_1.Aggregation.Default(); + this.aggregation = (_a3 = viewOptions.aggregation) !== null && _a3 !== undefined ? _a3 : Aggregation_1.Aggregation.Default(); this.instrumentSelector = new InstrumentSelector_1.InstrumentSelector({ name: viewOptions.instrumentName, type: viewOptions.instrumentType, @@ -414383,7 +338034,7 @@ var require_View = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-metrics/build/src/index.js -var require_src21 = __commonJS((exports) => { +var require_src15 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.TimeoutError = exports.View = exports.Aggregation = exports.SumAggregation = exports.LastValueAggregation = exports.HistogramAggregation = exports.DropAggregation = exports.ExponentialHistogramAggregation = exports.ExplicitBucketHistogramAggregation = exports.DefaultAggregation = exports.MeterProvider = exports.InstrumentType = exports.ConsoleMetricExporter = exports.InMemoryMetricExporter = exports.PeriodicExportingMetricReader = exports.MetricReader = exports.DataPointType = exports.AggregationTemporality = undefined; var AggregationTemporality_1 = require_AggregationTemporality(); @@ -414447,21 +338098,21 @@ var require_src21 = __commonJS((exports) => { Object.defineProperty(exports, "View", { enumerable: true, get: function() { return View_1.View; } }); - var utils_1 = require_utils14(); + var utils_1 = require_utils13(); Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { return utils_1.TimeoutError; } }); }); // node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js -var require_utils15 = __commonJS((exports) => { +var require_utils14 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createConstMap = undefined; - function createConstMap(values4) { + function createConstMap(values2) { let res = {}; - const len = values4.length; + const len = values2.length; for (let lp = 0;lp < len; lp++) { - const val = values4[lp]; + const val = values2[lp]; if (val) { res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val; } @@ -414480,7 +338131,7 @@ var require_SemanticAttributes4 = __commonJS((exports) => { exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = exports.FaasDocumentOperationValues = exports.FAASDOCUMENTOPERATIONVALUES_DELETE = exports.FAASDOCUMENTOPERATIONVALUES_EDIT = exports.FAASDOCUMENTOPERATIONVALUES_INSERT = exports.FaasTriggerValues = exports.FAASTRIGGERVALUES_OTHER = exports.FAASTRIGGERVALUES_TIMER = exports.FAASTRIGGERVALUES_PUBSUB = exports.FAASTRIGGERVALUES_HTTP = exports.FAASTRIGGERVALUES_DATASOURCE = exports.DbCassandraConsistencyLevelValues = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = exports.DbSystemValues = exports.DBSYSTEMVALUES_COCKROACHDB = exports.DBSYSTEMVALUES_MEMCACHED = exports.DBSYSTEMVALUES_ELASTICSEARCH = exports.DBSYSTEMVALUES_GEODE = exports.DBSYSTEMVALUES_NEO4J = exports.DBSYSTEMVALUES_DYNAMODB = exports.DBSYSTEMVALUES_COSMOSDB = exports.DBSYSTEMVALUES_COUCHDB = exports.DBSYSTEMVALUES_COUCHBASE = exports.DBSYSTEMVALUES_REDIS = exports.DBSYSTEMVALUES_MONGODB = exports.DBSYSTEMVALUES_HBASE = exports.DBSYSTEMVALUES_CASSANDRA = exports.DBSYSTEMVALUES_COLDFUSION = exports.DBSYSTEMVALUES_H2 = exports.DBSYSTEMVALUES_VERTICA = exports.DBSYSTEMVALUES_TERADATA = exports.DBSYSTEMVALUES_SYBASE = exports.DBSYSTEMVALUES_SQLITE = exports.DBSYSTEMVALUES_POINTBASE = exports.DBSYSTEMVALUES_PERVASIVE = exports.DBSYSTEMVALUES_NETEZZA = exports.DBSYSTEMVALUES_MARIADB = exports.DBSYSTEMVALUES_INTERBASE = exports.DBSYSTEMVALUES_INSTANTDB = exports.DBSYSTEMVALUES_INFORMIX = undefined; exports.MESSAGINGOPERATIONVALUES_RECEIVE = exports.MessagingDestinationKindValues = exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = exports.HttpFlavorValues = exports.HTTPFLAVORVALUES_QUIC = exports.HTTPFLAVORVALUES_SPDY = exports.HTTPFLAVORVALUES_HTTP_2_0 = exports.HTTPFLAVORVALUES_HTTP_1_1 = exports.HTTPFLAVORVALUES_HTTP_1_0 = exports.NetHostConnectionSubtypeValues = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = exports.NetHostConnectionTypeValues = exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = exports.NETHOSTCONNECTIONTYPEVALUES_CELL = exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = exports.NetTransportValues = exports.NETTRANSPORTVALUES_OTHER = exports.NETTRANSPORTVALUES_INPROC = exports.NETTRANSPORTVALUES_PIPE = exports.NETTRANSPORTVALUES_UNIX = exports.NETTRANSPORTVALUES_IP = exports.NETTRANSPORTVALUES_IP_UDP = exports.NETTRANSPORTVALUES_IP_TCP = exports.FaasInvokedProviderValues = exports.FAASINVOKEDPROVIDERVALUES_GCP = exports.FAASINVOKEDPROVIDERVALUES_AZURE = exports.FAASINVOKEDPROVIDERVALUES_AWS = undefined; exports.MessageTypeValues = exports.MESSAGETYPEVALUES_RECEIVED = exports.MESSAGETYPEVALUES_SENT = exports.RpcGrpcStatusCodeValues = exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = exports.RPCGRPCSTATUSCODEVALUES_ABORTED = exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = exports.RPCGRPCSTATUSCODEVALUES_OK = exports.MessagingOperationValues = exports.MESSAGINGOPERATIONVALUES_PROCESS = undefined; - var utils_1 = require_utils15(); + var utils_1 = require_utils14(); var TMP_AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"; var TMP_DB_SYSTEM = "db.system"; var TMP_DB_CONNECTION_STRING = "db.connection_string"; @@ -415316,7 +338967,7 @@ var require_SemanticResourceAttributes4 = __commonJS((exports) => { exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = undefined; exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = exports.CLOUDPLATFORMVALUES_AZURE_AKS = exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = exports.CLOUDPLATFORMVALUES_AZURE_VM = exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = exports.CLOUDPLATFORMVALUES_AWS_EKS = exports.CLOUDPLATFORMVALUES_AWS_ECS = exports.CLOUDPLATFORMVALUES_AWS_EC2 = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = exports.CloudProviderValues = exports.CLOUDPROVIDERVALUES_GCP = exports.CLOUDPROVIDERVALUES_AZURE = exports.CLOUDPROVIDERVALUES_AWS = exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = exports.SemanticResourceAttributes = exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = exports.SEMRESATTRS_WEBENGINE_VERSION = exports.SEMRESATTRS_WEBENGINE_NAME = exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = exports.SEMRESATTRS_TELEMETRY_SDK_NAME = exports.SEMRESATTRS_SERVICE_VERSION = exports.SEMRESATTRS_SERVICE_INSTANCE_ID = exports.SEMRESATTRS_SERVICE_NAMESPACE = exports.SEMRESATTRS_SERVICE_NAME = exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = exports.SEMRESATTRS_PROCESS_OWNER = exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = exports.SEMRESATTRS_PROCESS_COMMAND_LINE = exports.SEMRESATTRS_PROCESS_COMMAND = exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = exports.SEMRESATTRS_PROCESS_PID = exports.SEMRESATTRS_OS_VERSION = exports.SEMRESATTRS_OS_NAME = exports.SEMRESATTRS_OS_DESCRIPTION = exports.SEMRESATTRS_OS_TYPE = exports.SEMRESATTRS_K8S_CRONJOB_NAME = exports.SEMRESATTRS_K8S_CRONJOB_UID = exports.SEMRESATTRS_K8S_JOB_NAME = exports.SEMRESATTRS_K8S_JOB_UID = exports.SEMRESATTRS_K8S_DAEMONSET_NAME = exports.SEMRESATTRS_K8S_DAEMONSET_UID = undefined; exports.TelemetrySdkLanguageValues = exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = exports.TELEMETRYSDKLANGUAGEVALUES_PHP = exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = exports.TELEMETRYSDKLANGUAGEVALUES_GO = exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = exports.TELEMETRYSDKLANGUAGEVALUES_CPP = exports.OsTypeValues = exports.OSTYPEVALUES_Z_OS = exports.OSTYPEVALUES_SOLARIS = exports.OSTYPEVALUES_AIX = exports.OSTYPEVALUES_HPUX = exports.OSTYPEVALUES_DRAGONFLYBSD = exports.OSTYPEVALUES_OPENBSD = exports.OSTYPEVALUES_NETBSD = exports.OSTYPEVALUES_FREEBSD = exports.OSTYPEVALUES_DARWIN = exports.OSTYPEVALUES_LINUX = exports.OSTYPEVALUES_WINDOWS = exports.HostArchValues = exports.HOSTARCHVALUES_X86 = exports.HOSTARCHVALUES_PPC64 = exports.HOSTARCHVALUES_PPC32 = exports.HOSTARCHVALUES_IA64 = exports.HOSTARCHVALUES_ARM64 = exports.HOSTARCHVALUES_ARM32 = exports.HOSTARCHVALUES_AMD64 = exports.AwsEcsLaunchtypeValues = exports.AWSECSLAUNCHTYPEVALUES_FARGATE = exports.AWSECSLAUNCHTYPEVALUES_EC2 = exports.CloudPlatformValues = exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = undefined; - var utils_1 = require_utils15(); + var utils_1 = require_utils14(); var TMP_CLOUD_PROVIDER = "cloud.provider"; var TMP_CLOUD_ACCOUNT_ID = "cloud.account.id"; var TMP_CLOUD_REGION = "cloud.region"; @@ -415909,7 +339560,7 @@ var require_stable_metrics4 = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/index.js -var require_src22 = __commonJS((exports) => { +var require_src16 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -415944,9 +339595,9 @@ var require_enums = __commonJS((exports) => { var require_Span = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Span = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); - var semantic_conventions_1 = require_src22(); + var api_1 = require_src7(); + var core_1 = require_src10(); + var semantic_conventions_1 = require_src16(); var enums_1 = require_enums(); class Span { @@ -415968,11 +339619,11 @@ var require_Span = __commonJS((exports) => { this.parentSpanId = parentSpanId; this.kind = kind; this.links = links; - const now3 = Date.now(); + const now2 = Date.now(); this._performanceStartTime = core_1.otperformance.now(); - this._performanceOffset = now3 - (this._performanceStartTime + (0, core_1.getTimeOrigin)()); + this._performanceOffset = now2 - (this._performanceStartTime + (0, core_1.getTimeOrigin)()); this._startTimeProvided = startTime != null; - this.startTime = this._getTime(startTime !== null && startTime !== undefined ? startTime : now3); + this.startTime = this._getTime(startTime !== null && startTime !== undefined ? startTime : now2); this.resource = parentTracer.resource; this.instrumentationLibrary = parentTracer.instrumentationLibrary; this._spanLimits = parentTracer.getSpanLimits(); @@ -416226,23 +339877,23 @@ var require_AlwaysOnSampler2 = __commonJS((exports) => { var require_ParentBasedSampler2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ParentBasedSampler = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var core_1 = require_src10(); var AlwaysOffSampler_1 = require_AlwaysOffSampler2(); var AlwaysOnSampler_1 = require_AlwaysOnSampler2(); class ParentBasedSampler { - constructor(config4) { - var _a5, _b3, _c45, _d; - this._root = config4.root; + constructor(config2) { + var _a3, _b2, _c45, _d; + this._root = config2.root; if (!this._root) { (0, core_1.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")); this._root = new AlwaysOnSampler_1.AlwaysOnSampler; } - this._remoteParentSampled = (_a5 = config4.remoteParentSampled) !== null && _a5 !== undefined ? _a5 : new AlwaysOnSampler_1.AlwaysOnSampler; - this._remoteParentNotSampled = (_b3 = config4.remoteParentNotSampled) !== null && _b3 !== undefined ? _b3 : new AlwaysOffSampler_1.AlwaysOffSampler; - this._localParentSampled = (_c45 = config4.localParentSampled) !== null && _c45 !== undefined ? _c45 : new AlwaysOnSampler_1.AlwaysOnSampler; - this._localParentNotSampled = (_d = config4.localParentNotSampled) !== null && _d !== undefined ? _d : new AlwaysOffSampler_1.AlwaysOffSampler; + this._remoteParentSampled = (_a3 = config2.remoteParentSampled) !== null && _a3 !== undefined ? _a3 : new AlwaysOnSampler_1.AlwaysOnSampler; + this._remoteParentNotSampled = (_b2 = config2.remoteParentNotSampled) !== null && _b2 !== undefined ? _b2 : new AlwaysOffSampler_1.AlwaysOffSampler; + this._localParentSampled = (_c45 = config2.localParentSampled) !== null && _c45 !== undefined ? _c45 : new AlwaysOnSampler_1.AlwaysOnSampler; + this._localParentNotSampled = (_d = config2.localParentNotSampled) !== null && _d !== undefined ? _d : new AlwaysOffSampler_1.AlwaysOffSampler; } shouldSample(context, traceId, spanName, spanKind, attributes, links) { const parentContext = api_1.trace.getSpanContext(context); @@ -416271,7 +339922,7 @@ var require_ParentBasedSampler2 = __commonJS((exports) => { var require_TraceIdRatioBasedSampler2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.TraceIdRatioBasedSampler = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); var Sampler_1 = require_Sampler(); class TraceIdRatioBasedSampler { @@ -416295,8 +339946,8 @@ var require_TraceIdRatioBasedSampler2 = __commonJS((exports) => { } _accumulate(traceId) { let accumulation = 0; - for (let i4 = 0;i4 < traceId.length / 8; i4++) { - const pos = i4 * 8; + for (let i3 = 0;i3 < traceId.length / 8; i3++) { + const pos = i3 * 8; const part = parseInt(traceId.slice(pos, pos + 8), 16); accumulation = (accumulation ^ part) >>> 0; } @@ -416310,8 +339961,8 @@ var require_TraceIdRatioBasedSampler2 = __commonJS((exports) => { var require_config2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.buildSamplerFromEnv = exports.loadDefaultConfig = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var core_1 = require_src10(); var AlwaysOffSampler_1 = require_AlwaysOffSampler2(); var AlwaysOnSampler_1 = require_AlwaysOnSampler2(); var ParentBasedSampler_1 = require_ParentBasedSampler2(); @@ -416319,21 +339970,21 @@ var require_config2 = __commonJS((exports) => { var FALLBACK_OTEL_TRACES_SAMPLER = core_1.TracesSamplerValues.AlwaysOn; var DEFAULT_RATIO = 1; function loadDefaultConfig() { - const env5 = (0, core_1.getEnv)(); + const env4 = (0, core_1.getEnv)(); return { - sampler: buildSamplerFromEnv(env5), + sampler: buildSamplerFromEnv(env4), forceFlushTimeoutMillis: 30000, generalLimits: { - attributeValueLengthLimit: env5.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, - attributeCountLimit: env5.OTEL_ATTRIBUTE_COUNT_LIMIT + attributeValueLengthLimit: env4.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: env4.OTEL_ATTRIBUTE_COUNT_LIMIT }, spanLimits: { - attributeValueLengthLimit: env5.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, - attributeCountLimit: env5.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, - linkCountLimit: env5.OTEL_SPAN_LINK_COUNT_LIMIT, - eventCountLimit: env5.OTEL_SPAN_EVENT_COUNT_LIMIT, - attributePerEventCountLimit: env5.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, - attributePerLinkCountLimit: env5.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT + attributeValueLengthLimit: env4.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: env4.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, + linkCountLimit: env4.OTEL_SPAN_LINK_COUNT_LIMIT, + eventCountLimit: env4.OTEL_SPAN_EVENT_COUNT_LIMIT, + attributePerEventCountLimit: env4.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, + attributePerLinkCountLimit: env4.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT }, mergeResourceWithDefaults: true }; @@ -416388,7 +340039,7 @@ var require_utility = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.reconfigureLimits = exports.mergeConfig = undefined; var config_1 = require_config2(); - var core_1 = require_src16(); + var core_1 = require_src10(); function mergeConfig3(userConfig) { const perInstanceDefaults = { sampler: (0, config_1.buildSamplerFromEnv)() @@ -416401,10 +340052,10 @@ var require_utility = __commonJS((exports) => { } exports.mergeConfig = mergeConfig3; function reconfigureLimits(userConfig) { - var _a5, _b3, _c45, _d, _e, _f, _g, _h, _j, _k, _l, _m; + var _a3, _b2, _c45, _d, _e, _f, _g, _h, _j, _k, _l, _m; const spanLimits = Object.assign({}, userConfig.spanLimits); const parsedEnvConfig = (0, core_1.getEnvWithoutDefaults)(); - spanLimits.attributeCountLimit = (_f = (_e = (_d = (_b3 = (_a5 = userConfig.spanLimits) === null || _a5 === undefined ? undefined : _a5.attributeCountLimit) !== null && _b3 !== undefined ? _b3 : (_c45 = userConfig.generalLimits) === null || _c45 === undefined ? undefined : _c45.attributeCountLimit) !== null && _d !== undefined ? _d : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT) !== null && _e !== undefined ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _f !== undefined ? _f : core_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; + spanLimits.attributeCountLimit = (_f = (_e = (_d = (_b2 = (_a3 = userConfig.spanLimits) === null || _a3 === undefined ? undefined : _a3.attributeCountLimit) !== null && _b2 !== undefined ? _b2 : (_c45 = userConfig.generalLimits) === null || _c45 === undefined ? undefined : _c45.attributeCountLimit) !== null && _d !== undefined ? _d : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT) !== null && _e !== undefined ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _f !== undefined ? _f : core_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; spanLimits.attributeValueLengthLimit = (_m = (_l = (_k = (_h = (_g = userConfig.spanLimits) === null || _g === undefined ? undefined : _g.attributeValueLengthLimit) !== null && _h !== undefined ? _h : (_j = userConfig.generalLimits) === null || _j === undefined ? undefined : _j.attributeValueLengthLimit) !== null && _k !== undefined ? _k : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _l !== undefined ? _l : parsedEnvConfig.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _m !== undefined ? _m : core_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; return Object.assign({}, userConfig, { spanLimits }); } @@ -416415,20 +340066,20 @@ var require_utility = __commonJS((exports) => { var require_BatchSpanProcessorBase = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchSpanProcessorBase = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var core_1 = require_src10(); class BatchSpanProcessorBase { - constructor(_exporter, config4) { + constructor(_exporter, config2) { this._exporter = _exporter; this._isExporting = false; this._finishedSpans = []; this._droppedSpansCount = 0; - const env5 = (0, core_1.getEnv)(); - this._maxExportBatchSize = typeof (config4 === null || config4 === undefined ? undefined : config4.maxExportBatchSize) === "number" ? config4.maxExportBatchSize : env5.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; - this._maxQueueSize = typeof (config4 === null || config4 === undefined ? undefined : config4.maxQueueSize) === "number" ? config4.maxQueueSize : env5.OTEL_BSP_MAX_QUEUE_SIZE; - this._scheduledDelayMillis = typeof (config4 === null || config4 === undefined ? undefined : config4.scheduledDelayMillis) === "number" ? config4.scheduledDelayMillis : env5.OTEL_BSP_SCHEDULE_DELAY; - this._exportTimeoutMillis = typeof (config4 === null || config4 === undefined ? undefined : config4.exportTimeoutMillis) === "number" ? config4.exportTimeoutMillis : env5.OTEL_BSP_EXPORT_TIMEOUT; + const env4 = (0, core_1.getEnv)(); + this._maxExportBatchSize = typeof (config2 === null || config2 === undefined ? undefined : config2.maxExportBatchSize) === "number" ? config2.maxExportBatchSize : env4.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; + this._maxQueueSize = typeof (config2 === null || config2 === undefined ? undefined : config2.maxQueueSize) === "number" ? config2.maxQueueSize : env4.OTEL_BSP_MAX_QUEUE_SIZE; + this._scheduledDelayMillis = typeof (config2 === null || config2 === undefined ? undefined : config2.scheduledDelayMillis) === "number" ? config2.scheduledDelayMillis : env4.OTEL_BSP_SCHEDULE_DELAY; + this._exportTimeoutMillis = typeof (config2 === null || config2 === undefined ? undefined : config2.exportTimeoutMillis) === "number" ? config2.exportTimeoutMillis : env4.OTEL_BSP_EXPORT_TIMEOUT; this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); if (this._maxExportBatchSize > this._maxQueueSize) { api_1.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"); @@ -416479,15 +340130,15 @@ var require_BatchSpanProcessorBase = __commonJS((exports) => { this._maybeStartTimer(); } _flushAll() { - return new Promise((resolve25, reject3) => { + return new Promise((resolve19, reject2) => { const promises = []; const count3 = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); - for (let i4 = 0, j = count3;i4 < j; i4++) { + for (let i3 = 0, j = count3;i3 < j; i3++) { promises.push(this._flushOneBatch()); } Promise.all(promises).then(() => { - resolve25(); - }).catch(reject3); + resolve19(); + }).catch(reject2); }); } _flushOneBatch() { @@ -416495,9 +340146,9 @@ var require_BatchSpanProcessorBase = __commonJS((exports) => { if (this._finishedSpans.length === 0) { return Promise.resolve(); } - return new Promise((resolve25, reject3) => { + return new Promise((resolve19, reject2) => { const timer = setTimeout(() => { - reject3(new Error("Timeout")); + reject2(new Error("Timeout")); }, this._exportTimeoutMillis); api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { let spans; @@ -416507,18 +340158,18 @@ var require_BatchSpanProcessorBase = __commonJS((exports) => { } else { spans = this._finishedSpans.splice(0, this._maxExportBatchSize); } - const doExport = () => this._exporter.export(spans, (result3) => { - var _a5; + const doExport = () => this._exporter.export(spans, (result2) => { + var _a3; clearTimeout(timer); - if (result3.code === core_1.ExportResultCode.SUCCESS) { - resolve25(); + if (result2.code === core_1.ExportResultCode.SUCCESS) { + resolve19(); } else { - reject3((_a5 = result3.error) !== null && _a5 !== undefined ? _a5 : new Error("BatchSpanProcessor: span export failed")); + reject2((_a3 = result2.error) !== null && _a3 !== undefined ? _a3 : new Error("BatchSpanProcessor: span export failed")); } }); let pendingResources = null; - for (let i4 = 0, len = spans.length;i4 < len; i4++) { - const span = spans[i4]; + for (let i3 = 0, len = spans.length;i3 < len; i3++) { + const span = spans[i3]; if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) { pendingResources !== null && pendingResources !== undefined || (pendingResources = []); pendingResources.push(span.resource.waitForAsyncAttributes()); @@ -416527,9 +340178,9 @@ var require_BatchSpanProcessorBase = __commonJS((exports) => { if (pendingResources === null) { doExport(); } else { - Promise.all(pendingResources).then(doExport, (err3) => { - (0, core_1.globalErrorHandler)(err3); - reject3(err3); + Promise.all(pendingResources).then(doExport, (err2) => { + (0, core_1.globalErrorHandler)(err2); + reject2(err2); }); } }); @@ -416598,13 +340249,13 @@ var require_RandomIdGenerator2 = __commonJS((exports) => { var SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); function getIdGenerator(bytes) { return function generateId() { - for (let i4 = 0;i4 < bytes / 4; i4++) { - SHARED_BUFFER.writeUInt32BE(Math.random() * 2 ** 32 >>> 0, i4 * 4); + for (let i3 = 0;i3 < bytes / 4; i3++) { + SHARED_BUFFER.writeUInt32BE(Math.random() * 2 ** 32 >>> 0, i3 * 4); } - for (let i4 = 0;i4 < bytes; i4++) { - if (SHARED_BUFFER[i4] > 0) { + for (let i3 = 0;i3 < bytes; i3++) { + if (SHARED_BUFFER[i3] > 0) { break; - } else if (i4 === bytes - 1) { + } else if (i3 === bytes - 1) { SHARED_BUFFER[bytes - 1] = 1; } } @@ -416614,7 +340265,7 @@ var require_RandomIdGenerator2 = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/index.js -var require_node8 = __commonJS((exports) => { +var require_node7 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.RandomIdGenerator = exports.BatchSpanProcessor = undefined; var BatchSpanProcessor_1 = require_BatchSpanProcessor(); @@ -416631,7 +340282,7 @@ var require_node8 = __commonJS((exports) => { var require_platform6 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.RandomIdGenerator = exports.BatchSpanProcessor = undefined; - var node_1 = require_node8(); + var node_1 = require_node7(); Object.defineProperty(exports, "BatchSpanProcessor", { enumerable: true, get: function() { return node_1.BatchSpanProcessor; } }); @@ -416644,25 +340295,25 @@ var require_platform6 = __commonJS((exports) => { var require_Tracer = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Tracer = undefined; - var api2 = require_src13(); - var core_1 = require_src16(); + var api2 = require_src7(); + var core_1 = require_src10(); var Span_1 = require_Span(); var utility_1 = require_utility(); var platform_1 = require_platform6(); class Tracer { - constructor(instrumentationLibrary, config4, _tracerProvider) { + constructor(instrumentationLibrary, config2, _tracerProvider) { this._tracerProvider = _tracerProvider; - const localConfig = (0, utility_1.mergeConfig)(config4); + const localConfig = (0, utility_1.mergeConfig)(config2); this._sampler = localConfig.sampler; this._generalLimits = localConfig.generalLimits; this._spanLimits = localConfig.spanLimits; - this._idGenerator = config4.idGenerator || new platform_1.RandomIdGenerator; + this._idGenerator = config2.idGenerator || new platform_1.RandomIdGenerator; this.resource = _tracerProvider.resource; this.instrumentationLibrary = instrumentationLibrary; } startSpan(name, options2 = {}, context = api2.context.active()) { - var _a5, _b3, _c45; + var _a3, _b2, _c45; if (options2.root) { context = api2.trace.deleteSpan(context); } @@ -416684,8 +340335,8 @@ var require_Tracer = __commonJS((exports) => { traceState = parentSpanContext.traceState; parentSpanId = parentSpanContext.spanId; } - const spanKind = (_a5 = options2.kind) !== null && _a5 !== undefined ? _a5 : api2.SpanKind.INTERNAL; - const links = ((_b3 = options2.links) !== null && _b3 !== undefined ? _b3 : []).map((link3) => { + const spanKind = (_a3 = options2.kind) !== null && _a3 !== undefined ? _a3 : api2.SpanKind.INTERNAL; + const links = ((_b2 = options2.links) !== null && _b2 !== undefined ? _b2 : []).map((link3) => { return { context: link3.context, attributes: (0, core_1.sanitizeAttributes)(link3.attributes) @@ -416743,7 +340394,7 @@ var require_Tracer = __commonJS((exports) => { var require_MultiSpanProcessor = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.MultiSpanProcessor = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); class MultiSpanProcessor { constructor(_spanProcessors) { @@ -416754,12 +340405,12 @@ var require_MultiSpanProcessor = __commonJS((exports) => { for (const spanProcessor of this._spanProcessors) { promises.push(spanProcessor.forceFlush()); } - return new Promise((resolve25) => { + return new Promise((resolve19) => { Promise.all(promises).then(() => { - resolve25(); - }).catch((error45) => { - (0, core_1.globalErrorHandler)(error45 || new Error("MultiSpanProcessor: forceFlush failed")); - resolve25(); + resolve19(); + }).catch((error41) => { + (0, core_1.globalErrorHandler)(error41 || new Error("MultiSpanProcessor: forceFlush failed")); + resolve19(); }); }); } @@ -416778,10 +340429,10 @@ var require_MultiSpanProcessor = __commonJS((exports) => { for (const spanProcessor of this._spanProcessors) { promises.push(spanProcessor.shutdown()); } - return new Promise((resolve25, reject3) => { + return new Promise((resolve19, reject2) => { Promise.all(promises).then(() => { - resolve25(); - }, reject3); + resolve19(); + }, reject2); }); } } @@ -416810,9 +340461,9 @@ var require_NoopSpanProcessor = __commonJS((exports) => { var require_BasicTracerProvider = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BasicTracerProvider = exports.ForceFlushState = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); - var resources_1 = require_src17(); + var api_1 = require_src7(); + var core_1 = require_src10(); + var resources_1 = require_src11(); var Tracer_1 = require_Tracer(); var config_1 = require_config2(); var MultiSpanProcessor_1 = require_MultiSpanProcessor(); @@ -416828,20 +340479,20 @@ var require_BasicTracerProvider = __commonJS((exports) => { })(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); class BasicTracerProvider { - constructor(config4 = {}) { - var _a5, _b3; + constructor(config2 = {}) { + var _a3, _b2; this._registeredSpanProcessors = []; this._tracers = new Map; - const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config4)); - this.resource = (_a5 = mergedConfig.resource) !== null && _a5 !== undefined ? _a5 : resources_1.Resource.empty(); + const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config2)); + this.resource = (_a3 = mergedConfig.resource) !== null && _a3 !== undefined ? _a3 : resources_1.Resource.empty(); if (mergedConfig.mergeResourceWithDefaults) { this.resource = resources_1.Resource.default().merge(this.resource); } this._config = Object.assign({}, mergedConfig, { resource: this.resource }); - if ((_b3 = config4.spanProcessors) === null || _b3 === undefined ? undefined : _b3.length) { - this._registeredSpanProcessors = [...config4.spanProcessors]; + if ((_b2 = config2.spanProcessors) === null || _b2 === undefined ? undefined : _b2.length) { + this._registeredSpanProcessors = [...config2.spanProcessors]; this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); } else { const defaultExporter = this._buildExporterFromEnv(); @@ -416862,7 +340513,7 @@ var require_BasicTracerProvider = __commonJS((exports) => { } addSpanProcessor(spanProcessor) { if (this._registeredSpanProcessors.length === 0) { - this.activeSpanProcessor.shutdown().catch((err3) => api_1.diag.error("Error while trying to shutdown current span processor", err3)); + this.activeSpanProcessor.shutdown().catch((err2) => api_1.diag.error("Error while trying to shutdown current span processor", err2)); } this._registeredSpanProcessors.push(spanProcessor); this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); @@ -416870,61 +340521,61 @@ var require_BasicTracerProvider = __commonJS((exports) => { getActiveSpanProcessor() { return this.activeSpanProcessor; } - register(config4 = {}) { + register(config2 = {}) { api_1.trace.setGlobalTracerProvider(this); - if (config4.propagator === undefined) { - config4.propagator = this._buildPropagatorFromEnv(); + if (config2.propagator === undefined) { + config2.propagator = this._buildPropagatorFromEnv(); } - if (config4.contextManager) { - api_1.context.setGlobalContextManager(config4.contextManager); + if (config2.contextManager) { + api_1.context.setGlobalContextManager(config2.contextManager); } - if (config4.propagator) { - api_1.propagation.setGlobalPropagator(config4.propagator); + if (config2.propagator) { + api_1.propagation.setGlobalPropagator(config2.propagator); } } forceFlush() { const timeout = this._config.forceFlushTimeoutMillis; const promises = this._registeredSpanProcessors.map((spanProcessor) => { - return new Promise((resolve25) => { + return new Promise((resolve19) => { let state; const timeoutInterval = setTimeout(() => { - resolve25(new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); + resolve19(new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); state = ForceFlushState.timeout; }, timeout); spanProcessor.forceFlush().then(() => { clearTimeout(timeoutInterval); if (state !== ForceFlushState.timeout) { state = ForceFlushState.resolved; - resolve25(state); + resolve19(state); } - }).catch((error45) => { + }).catch((error41) => { clearTimeout(timeoutInterval); state = ForceFlushState.error; - resolve25(error45); + resolve19(error41); }); }); }); - return new Promise((resolve25, reject3) => { + return new Promise((resolve19, reject2) => { Promise.all(promises).then((results) => { - const errors5 = results.filter((result3) => result3 !== ForceFlushState.resolved); - if (errors5.length > 0) { - reject3(errors5); + const errors4 = results.filter((result2) => result2 !== ForceFlushState.resolved); + if (errors4.length > 0) { + reject2(errors4); } else { - resolve25(); + resolve19(); } - }).catch((error45) => reject3([error45])); + }).catch((error41) => reject2([error41])); }); } shutdown() { return this.activeSpanProcessor.shutdown(); } _getPropagator(name) { - var _a5; - return (_a5 = this.constructor._registeredPropagators.get(name)) === null || _a5 === undefined ? undefined : _a5(); + var _a3; + return (_a3 = this.constructor._registeredPropagators.get(name)) === null || _a3 === undefined ? undefined : _a3(); } _getSpanExporter(name) { - var _a5; - return (_a5 = this.constructor._registeredExporters.get(name)) === null || _a5 === undefined ? undefined : _a5(); + var _a3; + return (_a3 = this.constructor._registeredExporters.get(name)) === null || _a3 === undefined ? undefined : _a3(); } _buildPropagatorFromEnv() { const uniquePropagatorNames = Array.from(new Set((0, core_1.getEnv)().OTEL_PROPAGATORS)); @@ -416974,7 +340625,7 @@ var require_BasicTracerProvider = __commonJS((exports) => { var require_ConsoleSpanExporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ConsoleSpanExporter = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); class ConsoleSpanExporter { export(spans, resultCallback) { @@ -416988,7 +340639,7 @@ var require_ConsoleSpanExporter = __commonJS((exports) => { return Promise.resolve(); } _exportInfo(span) { - var _a5; + var _a3; return { resource: { attributes: span.resource.attributes @@ -416996,7 +340647,7 @@ var require_ConsoleSpanExporter = __commonJS((exports) => { instrumentationScope: span.instrumentationLibrary, traceId: span.spanContext().traceId, parentId: span.parentSpanId, - traceState: (_a5 = span.spanContext().traceState) === null || _a5 === undefined ? undefined : _a5.serialize(), + traceState: (_a3 = span.spanContext().traceState) === null || _a3 === undefined ? undefined : _a3.serialize(), name: span.name, id: span.spanContext().spanId, kind: span.kind, @@ -417024,7 +340675,7 @@ var require_ConsoleSpanExporter = __commonJS((exports) => { var require_InMemorySpanExporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.InMemorySpanExporter = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); class InMemorySpanExporter { constructor() { @@ -417062,8 +340713,8 @@ var require_InMemorySpanExporter = __commonJS((exports) => { var require_SimpleSpanProcessor = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.SimpleSpanProcessor = undefined; - var api_1 = require_src13(); - var core_1 = require_src16(); + var api_1 = require_src7(); + var core_1 = require_src10(); class SimpleSpanProcessor { constructor(_exporter) { @@ -417079,28 +340730,28 @@ var require_SimpleSpanProcessor = __commonJS((exports) => { } onStart(_span, _parentContext) {} onEnd(span) { - var _a5, _b3; + var _a3, _b2; if (this._shutdownOnce.isCalled) { return; } if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { return; } - const doExport = () => core_1.internal._export(this._exporter, [span]).then((result3) => { - var _a6; - if (result3.code !== core_1.ExportResultCode.SUCCESS) { - (0, core_1.globalErrorHandler)((_a6 = result3.error) !== null && _a6 !== undefined ? _a6 : new Error(`SimpleSpanProcessor: span export failed (status ${result3})`)); + const doExport = () => core_1.internal._export(this._exporter, [span]).then((result2) => { + var _a4; + if (result2.code !== core_1.ExportResultCode.SUCCESS) { + (0, core_1.globalErrorHandler)((_a4 = result2.error) !== null && _a4 !== undefined ? _a4 : new Error(`SimpleSpanProcessor: span export failed (status ${result2})`)); } - }).catch((error45) => { - (0, core_1.globalErrorHandler)(error45); + }).catch((error41) => { + (0, core_1.globalErrorHandler)(error41); }); if (span.resource.asyncAttributesPending) { - const exportPromise = (_b3 = (_a5 = span.resource).waitForAsyncAttributes) === null || _b3 === undefined ? undefined : _b3.call(_a5).then(() => { + const exportPromise = (_b2 = (_a3 = span.resource).waitForAsyncAttributes) === null || _b2 === undefined ? undefined : _b2.call(_a3).then(() => { if (exportPromise != null) { this._unresolvedExports.delete(exportPromise); } return doExport(); - }, (err3) => (0, core_1.globalErrorHandler)(err3)); + }, (err2) => (0, core_1.globalErrorHandler)(err2)); if (exportPromise != null) { this._unresolvedExports.add(exportPromise); } @@ -417119,7 +340770,7 @@ var require_SimpleSpanProcessor = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-trace-base/build/src/index.js -var require_src23 = __commonJS((exports) => { +var require_src17 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Span = exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.ForceFlushState = exports.BasicTracerProvider = exports.Tracer = undefined; var Tracer_1 = require_Tracer(); @@ -417183,7 +340834,7 @@ var require_src23 = __commonJS((exports) => { }); // src/utils/telemetry/betaSessionTracing.ts -import { createHash as createHash12 } from "crypto"; +import { createHash as createHash11 } from "crypto"; function clearBetaTracingState() { seenHashes.clear(); lastReportedMessageHash.clear(); @@ -417210,7 +340861,7 @@ function truncateContent(content, maxSize = MAX_CONTENT_SIZE) { }; } function shortHash(content) { - return createHash12("sha256").update(content).digest("hex").slice(0, 12); + return createHash11("sha256").update(content).digest("hex").slice(0, 12); } function hashSystemPrompt(systemPrompt) { return `sp_${shortHash(systemPrompt)}`; @@ -417219,8 +340870,8 @@ function hashMessage(message) { const content = jsonStringify(message.message.content); return `msg_${shortHash(content)}`; } -function extractSystemReminderContent(text2) { - const match = text2.trim().match(SYSTEM_REMINDER_REGEX); +function extractSystemReminderContent(text) { + const match = text.trim().match(SYSTEM_REMINDER_REGEX); return match && match[1] ? match[1].trim() : null; } function formatMessagesForContext(messages) { @@ -417331,10 +340982,10 @@ function addBetaLLMRequestAttributes(span, newContext, messagesForAPI) { const lastHash = lastReportedMessageHash.get(querySource); let startIndex = 0; if (lastHash) { - for (let i4 = 0;i4 < messagesForAPI.length; i4++) { - const msg = messagesForAPI[i4]; + for (let i3 = 0;i3 < messagesForAPI.length; i3++) { + const msg = messagesForAPI[i3]; if (msg && hashMessage(msg) === lastHash) { - startIndex = i4 + 1; + startIndex = i3 + 1; break; } } @@ -417444,7 +341095,7 @@ var init_betaSessionTracing = __esm(() => { // src/services/api/metricsOptOut.ts async function _fetchMetricsEnabled() { - const authResult = getAuthHeaders2(); + const authResult = getAuthHeaders(); if (authResult.error) { throw new Error(`Auth error: ${authResult.error}`); } @@ -417473,30 +341124,30 @@ async function _checkMetricsEnabledAPI() { enabled: data.metrics_logging_enabled, hasError: false }; - } catch (error45) { - logForDebugging(`Failed to check metrics opt-out status: ${errorMessage(error45)}`); - logError2(error45); + } catch (error41) { + logForDebugging(`Failed to check metrics opt-out status: ${errorMessage(error41)}`); + logError2(error41); return { enabled: false, hasError: true }; } } async function refreshMetricsStatus() { - const result3 = await memoizedCheckMetrics(); - if (result3.hasError) { - return result3; + const result2 = await memoizedCheckMetrics(); + if (result2.hasError) { + return result2; } const cached3 = getGlobalConfig().metricsStatusCache; - const unchanged = cached3 !== undefined && cached3.enabled === result3.enabled; + const unchanged = cached3 !== undefined && cached3.enabled === result2.enabled; if (unchanged && Date.now() - cached3.timestamp < DISK_CACHE_TTL_MS) { - return result3; + return result2; } saveGlobalConfig((current) => ({ ...current, metricsStatusCache: { - enabled: result3.enabled, + enabled: result2.enabled, timestamp: Date.now() } })); - return result3; + return result2; } async function checkMetricsEnabled() { if (isClaudeAISubscriber() && !hasProfileScope()) { @@ -417517,7 +341168,7 @@ async function checkMetricsEnabled() { var CACHE_TTL_MS, DISK_CACHE_TTL_MS, memoizedCheckMetrics; var init_metricsOptOut = __esm(() => { init_axios2(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_errors(); @@ -417576,7 +341227,7 @@ class BigQueryMetricsExporter { return; } const payload = this.transformMetricsForInternal(metrics); - const authResult = getAuthHeaders2(); + const authResult = getAuthHeaders(); if (authResult.error) { logForDebugging(`Metrics export failed: ${authResult.error}`); resultCallback({ @@ -417597,12 +341248,12 @@ class BigQueryMetricsExporter { logForDebugging("BigQuery metrics exported successfully"); logForDebugging(`BigQuery API Response: ${jsonStringify(response.data, null, 2)}`); resultCallback({ code: import_core18.ExportResultCode.SUCCESS }); - } catch (error45) { - logForDebugging(`BigQuery metrics export failed: ${errorMessage(error45)}`); - logError2(error45); + } catch (error41) { + logForDebugging(`BigQuery metrics export failed: ${errorMessage(error41)}`); + logError2(error41); resultCallback({ code: import_core18.ExportResultCode.FAILED, - error: toError(error45) + error: toError(error41) }); } } @@ -417657,15 +341308,15 @@ class BigQueryMetricsExporter { logForDebugging("BigQuery metrics exporter flush complete"); } convertAttributes(attributes) { - const result3 = {}; + const result2 = {}; if (attributes) { for (const [key, value] of Object.entries(attributes)) { if (value !== undefined && value !== null) { - result3[key] = String(value); + result2[key] = String(value); } } } - return result3; + return result2; } hrTimeToISOString(hrTime) { const [seconds, nanoseconds] = hrTime; @@ -417678,12 +341329,12 @@ class BigQueryMetricsExporter { } var import_core18, import_sdk_metrics; var init_bigqueryExporter = __esm(() => { - import_core18 = __toESM(require_src16(), 1); - import_sdk_metrics = __toESM(require_src21(), 1); + import_core18 = __toESM(require_src10(), 1); + import_sdk_metrics = __toESM(require_src15(), 1); init_axios2(); init_metricsOptOut(); init_state(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_errors(); @@ -417751,11 +341402,11 @@ function ensureCleanupInterval() { } function isEnhancedTelemetryEnabled() { if (feature("ENHANCED_TELEMETRY_BETA")) { - const env5 = process.env.CLAUDE_CODE_ENHANCED_TELEMETRY_BETA ?? process.env.ENABLE_ENHANCED_TELEMETRY_BETA; - if (isEnvTruthy(env5)) { + const env4 = process.env.CLAUDE_CODE_ENHANCED_TELEMETRY_BETA ?? process.env.ENABLE_ENHANCED_TELEMETRY_BETA; + if (isEnvTruthy(env4)) { return true; } - if (isEnvDefinedFalsy(env5)) { + if (isEnvDefinedFalsy(env4)) { return false; } return process.env.USER_TYPE === "ant" || getFeatureValue_CACHED_MAY_BE_STALE("enhanced_telemetry_beta", false); @@ -418224,7 +341875,7 @@ function endHookSpan(span, metadata) { var import_api2, interactionContext, toolContext, activeSpans, strongSpans, interactionSequence = 0, _cleanupIntervalStarted = false, SPAN_TTL_MS; var init_sessionTracing = __esm(() => { init_bun_bundle(); - import_api2 = __toESM(require_src13(), 1); + import_api2 = __toESM(require_src7(), 1); init_growthbook(); init_envUtils(); init_telemetryAttributes(); @@ -418240,91 +341891,66 @@ var init_sessionTracing = __esm(() => { // stub-npm:@opentelemetry/exporter-metrics-otlp-grpc var exports_exporter_metrics_otlp_grpc = {}; __export(exports_exporter_metrics_otlp_grpc, { - select: () => select4, - input: () => input3, default: () => exporter_metrics_otlp_grpc_default, - confirm: () => confirm3, - __stub__: () => __stub__3, - DestroyerOfModules: () => DestroyerOfModules3 + __stub__: () => __stub__9 }); -var handler6, stub6, exporter_metrics_otlp_grpc_default, __stub__3 = true, confirm3 = () => {}, input3 = () => {}, select4 = () => {}, DestroyerOfModules3 = class { -}; +var handler10, stub10, exporter_metrics_otlp_grpc_default, __stub__9 = true; var init_exporter_metrics_otlp_grpc = __esm(() => { - handler6 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub6 = new Proxy({}, handler6); - exporter_metrics_otlp_grpc_default = stub6; + handler10 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub10 = new Proxy({}, handler10); + exporter_metrics_otlp_grpc_default = stub10; }); // stub-npm:@opentelemetry/exporter-metrics-otlp-http var exports_exporter_metrics_otlp_http = {}; __export(exports_exporter_metrics_otlp_http, { - select: () => select5, - input: () => input4, default: () => exporter_metrics_otlp_http_default, - confirm: () => confirm4, - __stub__: () => __stub__4, - DestroyerOfModules: () => DestroyerOfModules4 + __stub__: () => __stub__10 }); -var handler7, stub7, exporter_metrics_otlp_http_default, __stub__4 = true, confirm4 = () => {}, input4 = () => {}, select5 = () => {}, DestroyerOfModules4 = class { -}; +var handler11, stub11, exporter_metrics_otlp_http_default, __stub__10 = true; var init_exporter_metrics_otlp_http = __esm(() => { - handler7 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub7 = new Proxy({}, handler7); - exporter_metrics_otlp_http_default = stub7; + handler11 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub11 = new Proxy({}, handler11); + exporter_metrics_otlp_http_default = stub11; }); // stub-npm:@opentelemetry/exporter-metrics-otlp-proto var exports_exporter_metrics_otlp_proto = {}; __export(exports_exporter_metrics_otlp_proto, { - select: () => select6, - input: () => input5, default: () => exporter_metrics_otlp_proto_default, - confirm: () => confirm5, - __stub__: () => __stub__5, - DestroyerOfModules: () => DestroyerOfModules5 + __stub__: () => __stub__11 }); -var handler8, stub8, exporter_metrics_otlp_proto_default, __stub__5 = true, confirm5 = () => {}, input5 = () => {}, select6 = () => {}, DestroyerOfModules5 = class { -}; +var handler12, stub12, exporter_metrics_otlp_proto_default, __stub__11 = true; var init_exporter_metrics_otlp_proto = __esm(() => { - handler8 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub8 = new Proxy({}, handler8); - exporter_metrics_otlp_proto_default = stub8; + handler12 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub12 = new Proxy({}, handler12); + exporter_metrics_otlp_proto_default = stub12; }); // stub-npm:@opentelemetry/exporter-prometheus var exports_exporter_prometheus = {}; __export(exports_exporter_prometheus, { - select: () => select7, - input: () => input6, default: () => exporter_prometheus_default, - confirm: () => confirm6, - __stub__: () => __stub__6, - DestroyerOfModules: () => DestroyerOfModules6 + __stub__: () => __stub__12 }); -var handler9, stub9, exporter_prometheus_default, __stub__6 = true, confirm6 = () => {}, input6 = () => {}, select7 = () => {}, DestroyerOfModules6 = class { -}; +var handler13, stub13, exporter_prometheus_default, __stub__12 = true; var init_exporter_prometheus = __esm(() => { - handler9 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub9 = new Proxy({}, handler9); - exporter_prometheus_default = stub9; + handler13 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub13 = new Proxy({}, handler13); + exporter_prometheus_default = stub13; }); // stub-npm:@opentelemetry/exporter-logs-otlp-grpc var exports_exporter_logs_otlp_grpc = {}; __export(exports_exporter_logs_otlp_grpc, { - select: () => select8, - input: () => input7, default: () => exporter_logs_otlp_grpc_default, - confirm: () => confirm7, - __stub__: () => __stub__7, - DestroyerOfModules: () => DestroyerOfModules7 + __stub__: () => __stub__13 }); -var handler10, stub10, exporter_logs_otlp_grpc_default, __stub__7 = true, confirm7 = () => {}, input7 = () => {}, select8 = () => {}, DestroyerOfModules7 = class { -}; +var handler14, stub14, exporter_logs_otlp_grpc_default, __stub__13 = true; var init_exporter_logs_otlp_grpc = __esm(() => { - handler10 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub10 = new Proxy({}, handler10); - exporter_logs_otlp_grpc_default = stub10; + handler14 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub14 = new Proxy({}, handler14); + exporter_logs_otlp_grpc_default = stub14; }); // node_modules/@opentelemetry/otlp-exporter-base/build/src/OTLPExporterBase.js @@ -418384,9 +342010,9 @@ var require_shared_configuration = __commonJS((exports) => { } exports.wrapStaticHeadersInFunction = wrapStaticHeadersInFunction; function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { - var _a5, _b3, _c45, _d, _e, _f; + var _a3, _b2, _c45, _d, _e, _f; return { - timeoutMillis: validateTimeoutMillis((_b3 = (_a5 = userProvidedConfiguration.timeoutMillis) !== null && _a5 !== undefined ? _a5 : fallbackConfiguration.timeoutMillis) !== null && _b3 !== undefined ? _b3 : defaultConfiguration.timeoutMillis), + timeoutMillis: validateTimeoutMillis((_b2 = (_a3 = userProvidedConfiguration.timeoutMillis) !== null && _a3 !== undefined ? _a3 : fallbackConfiguration.timeoutMillis) !== null && _b2 !== undefined ? _b2 : defaultConfiguration.timeoutMillis), concurrencyLimit: (_d = (_c45 = userProvidedConfiguration.concurrencyLimit) !== null && _c45 !== undefined ? _c45 : fallbackConfiguration.concurrencyLimit) !== null && _d !== undefined ? _d : defaultConfiguration.concurrencyLimit, compression: (_f = (_e = userProvidedConfiguration.compression) !== null && _e !== undefined ? _e : fallbackConfiguration.compression) !== null && _f !== undefined ? _f : defaultConfiguration.compression }; @@ -418451,7 +342077,7 @@ var require_bounded_queue_export_promise_handler = __commonJS((exports) => { var require_logging_response_handler = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createLoggingPartialSuccessResponseHandler = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); function isPartialSuccessResponse(response) { return Object.prototype.hasOwnProperty.call(response, "partialSuccess"); } @@ -418472,10 +342098,10 @@ var require_logging_response_handler = __commonJS((exports) => { var require_otlp_export_delegate = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createOtlpExportDelegate = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); var types_1 = require_types5(); var logging_response_handler_1 = require_logging_response_handler(); - var api_1 = require_src13(); + var api_1 = require_src7(); class OTLPExportDelegate { constructor(_transport, _serializer, _responseHandler, _promiseQueue, _timeout) { @@ -418572,7 +342198,7 @@ var require_otlp_network_export_delegate = __commonJS((exports) => { }); // node_modules/@opentelemetry/otlp-exporter-base/build/src/index.js -var require_src24 = __commonJS((exports) => { +var require_src18 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createOtlpNetworkExportDelegate = exports.CompressionAlgorithm = exports.getSharedConfigurationDefaults = exports.mergeOtlpSharedConfigurationWithDefaults = exports.OTLPExporterError = exports.OTLPExporterBase = undefined; var OTLPExporterBase_1 = require_OTLPExporterBase(); @@ -418607,26 +342233,26 @@ var require_aspromise = __commonJS((exports, module) => { var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true; while (index < arguments.length) params[offset++] = arguments[index++]; - return new Promise(function executor(resolve25, reject3) { - params[offset] = function callback(err3) { + return new Promise(function executor(resolve19, reject2) { + params[offset] = function callback(err2) { if (pending) { pending = false; - if (err3) - reject3(err3); + if (err2) + reject2(err2); else { var params2 = new Array(arguments.length - 1), offset2 = 0; while (offset2 < params2.length) params2[offset2++] = arguments[offset2]; - resolve25.apply(null, params2); + resolve19.apply(null, params2); } } }; try { fn.apply(ctx || null, params); - } catch (err3) { + } catch (err2) { if (pending) { pending = false; - reject3(err3); + reject2(err2); } } }); @@ -418635,8 +342261,8 @@ var require_aspromise = __commonJS((exports, module) => { // node_modules/@protobufjs/base64/index.js var require_base64 = __commonJS((exports) => { - var base644 = exports; - base644.length = function length(string5) { + var base643 = exports; + base643.length = function length(string5) { var p = string5.length; if (!p) return 0; @@ -418647,55 +342273,55 @@ var require_base64 = __commonJS((exports) => { }; var b64 = new Array(64); var s64 = new Array(123); - for (i4 = 0;i4 < 64; ) - s64[b64[i4] = i4 < 26 ? i4 + 65 : i4 < 52 ? i4 + 71 : i4 < 62 ? i4 - 4 : i4 - 59 | 43] = i4++; - var i4; - base644.encode = function encode(buffer, start, end) { - var parts = null, chunk3 = []; - var i5 = 0, j = 0, t; + for (i3 = 0;i3 < 64; ) + s64[b64[i3] = i3 < 26 ? i3 + 65 : i3 < 52 ? i3 + 71 : i3 < 62 ? i3 - 4 : i3 - 59 | 43] = i3++; + var i3; + base643.encode = function encode(buffer, start, end) { + var parts = null, chunk2 = []; + var i4 = 0, j = 0, t; while (start < end) { var b = buffer[start++]; switch (j) { case 0: - chunk3[i5++] = b64[b >> 2]; + chunk2[i4++] = b64[b >> 2]; t = (b & 3) << 4; j = 1; break; case 1: - chunk3[i5++] = b64[t | b >> 4]; + chunk2[i4++] = b64[t | b >> 4]; t = (b & 15) << 2; j = 2; break; case 2: - chunk3[i5++] = b64[t | b >> 6]; - chunk3[i5++] = b64[b & 63]; + chunk2[i4++] = b64[t | b >> 6]; + chunk2[i4++] = b64[b & 63]; j = 0; break; } - if (i5 > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk3)); - i5 = 0; + if (i4 > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk2)); + i4 = 0; } } if (j) { - chunk3[i5++] = b64[t]; - chunk3[i5++] = 61; + chunk2[i4++] = b64[t]; + chunk2[i4++] = 61; if (j === 1) - chunk3[i5++] = 61; + chunk2[i4++] = 61; } if (parts) { - if (i5) - parts.push(String.fromCharCode.apply(String, chunk3.slice(0, i5))); + if (i4) + parts.push(String.fromCharCode.apply(String, chunk2.slice(0, i4))); return parts.join(""); } - return String.fromCharCode.apply(String, chunk3.slice(0, i5)); + return String.fromCharCode.apply(String, chunk2.slice(0, i4)); }; var invalidEncoding = "invalid encoding"; - base644.decode = function decode(string5, buffer, offset) { + base643.decode = function decode(string5, buffer, offset) { var start = offset; var j = 0, t; - for (var i5 = 0;i5 < string5.length; ) { - var c6 = string5.charCodeAt(i5++); + for (var i4 = 0;i4 < string5.length; ) { + var c6 = string5.charCodeAt(i4++); if (c6 === 61 && j > 1) break; if ((c6 = s64[c6]) === undefined) @@ -418725,7 +342351,7 @@ var require_base64 = __commonJS((exports) => { throw Error(invalidEncoding); return offset - start; }; - base644.test = function test(string5) { + base643.test = function test(string5) { return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string5); }; }); @@ -418751,11 +342377,11 @@ var require_eventemitter = __commonJS((exports, module) => { this._listeners[evt] = []; else { var listeners = this._listeners[evt]; - for (var i4 = 0;i4 < listeners.length; ) - if (listeners[i4].fn === fn) - listeners.splice(i4, 1); + for (var i3 = 0;i3 < listeners.length; ) + if (listeners[i3].fn === fn) + listeners.splice(i3, 1); else - ++i4; + ++i3; } } return this; @@ -418763,11 +342389,11 @@ var require_eventemitter = __commonJS((exports, module) => { EventEmitter5.prototype.emit = function emit(evt) { var listeners = this._listeners[evt]; if (listeners) { - var args = [], i4 = 1; - for (;i4 < arguments.length; ) - args.push(arguments[i4++]); - for (i4 = 0;i4 < listeners.length; ) - listeners[i4].fn.apply(listeners[i4++].ctx, args); + var args = [], i3 = 1; + for (;i3 < arguments.length; ) + args.push(arguments[i3++]); + for (i3 = 0;i3 < listeners.length; ) + listeners[i3].fn.apply(listeners[i3++].ctx, args); } return this; }; @@ -418816,27 +342442,27 @@ var require_float3 = __commonJS((exports, module) => { else (function() { function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign2 = val < 0 ? 1 : 0; - if (sign2) + var sign = val < 0 ? 1 : 0; + if (sign) val = -val; if (val === 0) writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos); else if (isNaN(val)) writeUint(2143289344, buf, pos); else if (val > 340282346638528860000000000000000000000) - writeUint((sign2 << 31 | 2139095040) >>> 0, buf, pos); + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); else if (val < 0.000000000000000000000000000000000000011754943508222875) - writeUint((sign2 << 31 | Math.round(val / 0.000000000000000000000000000000000000000000001401298464324817)) >>> 0, buf, pos); + writeUint((sign << 31 | Math.round(val / 0.000000000000000000000000000000000000000000001401298464324817)) >>> 0, buf, pos); else { var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign2 << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); } } exports2.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); exports2.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), sign2 = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; - return exponent === 255 ? mantissa ? NaN : sign2 * Infinity : exponent === 0 ? sign2 * 0.000000000000000000000000000000000000000000001401298464324817 * mantissa : sign2 * Math.pow(2, exponent - 150) * (mantissa + 8388608); + var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; + return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 0.000000000000000000000000000000000000000000001401298464324817 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); } exports2.readFloatLE = readFloat_ieee754.bind(null, readUintLE); exports2.readFloatBE = readFloat_ieee754.bind(null, readUintBE); @@ -418896,8 +342522,8 @@ var require_float3 = __commonJS((exports, module) => { else (function() { function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign2 = val < 0 ? 1 : 0; - if (sign2) + var sign = val < 0 ? 1 : 0; + if (sign) val = -val; if (val === 0) { writeUint(0, buf, pos + off0); @@ -418907,20 +342533,20 @@ var require_float3 = __commonJS((exports, module) => { writeUint(2146959360, buf, pos + off1); } else if (val > 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) { writeUint(0, buf, pos + off0); - writeUint((sign2 << 31 | 2146435072) >>> 0, buf, pos + off1); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); } else { var mantissa; if (val < 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014) { mantissa = val / 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005; writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign2 << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); } else { var exponent = Math.floor(Math.log(val) / Math.LN2); if (exponent === 1024) exponent = 1023; mantissa = val * Math.pow(2, -exponent); writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign2 << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); } } } @@ -418928,8 +342554,8 @@ var require_float3 = __commonJS((exports, module) => { exports2.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); function readDouble_ieee754(readUint, off0, off1, buf, pos) { var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1); - var sign2 = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 ? mantissa ? NaN : sign2 * Infinity : exponent === 0 ? sign2 * 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005 * mantissa : sign2 * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); } exports2.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); exports2.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); @@ -418974,14 +342600,14 @@ var require_utf8 = __commonJS((exports) => { var utf8 = exports; utf8.length = function utf8_length(string5) { var len = 0, c6 = 0; - for (var i4 = 0;i4 < string5.length; ++i4) { - c6 = string5.charCodeAt(i4); + for (var i3 = 0;i3 < string5.length; ++i3) { + c6 = string5.charCodeAt(i3); if (c6 < 128) len += 1; else if (c6 < 2048) len += 2; - else if ((c6 & 64512) === 55296 && (string5.charCodeAt(i4 + 1) & 64512) === 56320) { - ++i4; + else if ((c6 & 64512) === 55296 && (string5.charCodeAt(i3 + 1) & 64512) === 56320) { + ++i3; len += 4; } else len += 3; @@ -418992,43 +342618,43 @@ var require_utf8 = __commonJS((exports) => { var len = end - start; if (len < 1) return ""; - var parts = null, chunk3 = [], i4 = 0, t; + var parts = null, chunk2 = [], i3 = 0, t; while (start < end) { t = buffer[start++]; if (t < 128) - chunk3[i4++] = t; + chunk2[i3++] = t; else if (t > 191 && t < 224) - chunk3[i4++] = (t & 31) << 6 | buffer[start++] & 63; + chunk2[i3++] = (t & 31) << 6 | buffer[start++] & 63; else if (t > 239 && t < 365) { t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 65536; - chunk3[i4++] = 55296 + (t >> 10); - chunk3[i4++] = 56320 + (t & 1023); + chunk2[i3++] = 55296 + (t >> 10); + chunk2[i3++] = 56320 + (t & 1023); } else - chunk3[i4++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - if (i4 > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk3)); - i4 = 0; + chunk2[i3++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i3 > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk2)); + i3 = 0; } } if (parts) { - if (i4) - parts.push(String.fromCharCode.apply(String, chunk3.slice(0, i4))); + if (i3) + parts.push(String.fromCharCode.apply(String, chunk2.slice(0, i3))); return parts.join(""); } - return String.fromCharCode.apply(String, chunk3.slice(0, i4)); + return String.fromCharCode.apply(String, chunk2.slice(0, i3)); }; utf8.write = function utf8_write(string5, buffer, offset) { var start = offset, c1, c22; - for (var i4 = 0;i4 < string5.length; ++i4) { - c1 = string5.charCodeAt(i4); + for (var i3 = 0;i3 < string5.length; ++i3) { + c1 = string5.charCodeAt(i3); if (c1 < 128) { buffer[offset++] = c1; } else if (c1 < 2048) { buffer[offset++] = c1 >> 6 | 192; buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 64512) === 55296 && ((c22 = string5.charCodeAt(i4 + 1)) & 64512) === 56320) { + } else if ((c1 & 64512) === 55296 && ((c22 = string5.charCodeAt(i3 + 1)) & 64512) === 56320) { c1 = 65536 + ((c1 & 1023) << 10) + (c22 & 1023); - ++i4; + ++i3; buffer[offset++] = c1 >> 18 | 240; buffer[offset++] = c1 >> 12 & 63 | 128; buffer[offset++] = c1 >> 6 & 63 | 128; @@ -419046,19 +342672,19 @@ var require_utf8 = __commonJS((exports) => { // node_modules/@protobufjs/pool/index.js var require_pool2 = __commonJS((exports, module) => { module.exports = pool; - function pool(alloc, slice3, size3) { - var SIZE = size3 || 8192; + function pool(alloc, slice2, size2) { + var SIZE = size2 || 8192; var MAX = SIZE >>> 1; var slab = null; var offset = SIZE; - return function pool_alloc(size4) { - if (size4 < 1 || size4 > MAX) - return alloc(size4); - if (offset + size4 > SIZE) { + return function pool_alloc(size3) { + if (size3 < 1 || size3 > MAX) + return alloc(size3); + if (offset + size3 > SIZE) { slab = alloc(SIZE); offset = 0; } - var buf = slice3.call(slab, offset, offset += size4); + var buf = slice2.call(slab, offset, offset += size3); if (offset & 7) offset = (offset | 7) + 1; return buf; @@ -419069,7 +342695,7 @@ var require_pool2 = __commonJS((exports, module) => { // node_modules/protobufjs/src/util/longbits.js var require_longbits = __commonJS((exports, module) => { module.exports = LongBits; - var util7 = require_minimal(); + var util5 = require_minimal(); function LongBits(lo, hi) { this.lo = lo >>> 0; this.hi = hi >>> 0; @@ -419088,11 +342714,11 @@ var require_longbits = __commonJS((exports, module) => { LongBits.fromNumber = function fromNumber(value) { if (value === 0) return zero; - var sign2 = value < 0; - if (sign2) + var sign = value < 0; + if (sign) value = -value; var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0; - if (sign2) { + if (sign) { hi = ~hi >>> 0; lo = ~lo >>> 0; if (++lo > 4294967295) { @@ -419106,9 +342732,9 @@ var require_longbits = __commonJS((exports, module) => { LongBits.from = function from(value) { if (typeof value === "number") return LongBits.fromNumber(value); - if (util7.isString(value)) { - if (util7.Long) - value = util7.Long.fromString(value); + if (util5.isString(value)) { + if (util5.Long) + value = util5.Long.fromString(value); else return LongBits.fromNumber(parseInt(value, 10)); } @@ -419124,7 +342750,7 @@ var require_longbits = __commonJS((exports, module) => { return this.lo + this.hi * 4294967296; }; LongBits.prototype.toLong = function toLong(unsigned) { - return util7.Long ? new util7.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; + return util5.Long ? new util5.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; }; var charCodeAt = String.prototype.charCodeAt; LongBits.fromHash = function fromHash(hash2) { @@ -419155,69 +342781,69 @@ var require_longbits = __commonJS((exports, module) => { // node_modules/protobufjs/src/util/minimal.js var require_minimal = __commonJS((exports) => { - var util7 = exports; - util7.asPromise = require_aspromise(); - util7.base64 = require_base64(); - util7.EventEmitter = require_eventemitter(); - util7.float = require_float3(); - util7.inquire = require_inquire(); - util7.utf8 = require_utf8(); - util7.pool = require_pool2(); - util7.LongBits = require_longbits(); - util7.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node); - util7.global = util7.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports; - util7.emptyArray = Object.freeze ? Object.freeze([]) : []; - util7.emptyObject = Object.freeze ? Object.freeze({}) : {}; - util7.isInteger = Number.isInteger || function isInteger(value) { + var util5 = exports; + util5.asPromise = require_aspromise(); + util5.base64 = require_base64(); + util5.EventEmitter = require_eventemitter(); + util5.float = require_float3(); + util5.inquire = require_inquire(); + util5.utf8 = require_utf8(); + util5.pool = require_pool2(); + util5.LongBits = require_longbits(); + util5.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node); + util5.global = util5.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports; + util5.emptyArray = Object.freeze ? Object.freeze([]) : []; + util5.emptyObject = Object.freeze ? Object.freeze({}) : {}; + util5.isInteger = Number.isInteger || function isInteger(value) { return typeof value === "number" && isFinite(value) && Math.floor(value) === value; }; - util7.isString = function isString(value) { + util5.isString = function isString(value) { return typeof value === "string" || value instanceof String; }; - util7.isObject = function isObject(value) { + util5.isObject = function isObject(value) { return value && typeof value === "object"; }; - util7.isset = util7.isSet = function isSet(obj, prop) { + util5.isset = util5.isSet = function isSet(obj, prop) { var value = obj[prop]; if (value != null && obj.hasOwnProperty(prop)) return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; return false; }; - util7.Buffer = function() { + util5.Buffer = function() { try { - var Buffer11 = util7.inquire("buffer").Buffer; - return Buffer11.prototype.utf8Write ? Buffer11 : null; + var Buffer9 = util5.inquire("buffer").Buffer; + return Buffer9.prototype.utf8Write ? Buffer9 : null; } catch (e) { return null; } }(); - util7._Buffer_from = null; - util7._Buffer_allocUnsafe = null; - util7.newBuffer = function newBuffer(sizeOrArray) { - return typeof sizeOrArray === "number" ? util7.Buffer ? util7._Buffer_allocUnsafe(sizeOrArray) : new util7.Array(sizeOrArray) : util7.Buffer ? util7._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); + util5._Buffer_from = null; + util5._Buffer_allocUnsafe = null; + util5.newBuffer = function newBuffer(sizeOrArray) { + return typeof sizeOrArray === "number" ? util5.Buffer ? util5._Buffer_allocUnsafe(sizeOrArray) : new util5.Array(sizeOrArray) : util5.Buffer ? util5._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); }; - util7.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array; - util7.Long = util7.global.dcodeIO && util7.global.dcodeIO.Long || util7.global.Long || util7.inquire("long"); - util7.key2Re = /^true|false|0|1$/; - util7.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - util7.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - util7.longToHash = function longToHash(value) { - return value ? util7.LongBits.from(value).toHash() : util7.LongBits.zeroHash; + util5.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + util5.Long = util5.global.dcodeIO && util5.global.dcodeIO.Long || util5.global.Long || util5.inquire("long"); + util5.key2Re = /^true|false|0|1$/; + util5.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + util5.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + util5.longToHash = function longToHash(value) { + return value ? util5.LongBits.from(value).toHash() : util5.LongBits.zeroHash; }; - util7.longFromHash = function longFromHash(hash2, unsigned) { - var bits3 = util7.LongBits.fromHash(hash2); - if (util7.Long) - return util7.Long.fromBits(bits3.lo, bits3.hi, unsigned); - return bits3.toNumber(Boolean(unsigned)); + util5.longFromHash = function longFromHash(hash2, unsigned) { + var bits2 = util5.LongBits.fromHash(hash2); + if (util5.Long) + return util5.Long.fromBits(bits2.lo, bits2.hi, unsigned); + return bits2.toNumber(Boolean(unsigned)); }; - function merge5(dst, src, ifNotSet) { - for (var keys3 = Object.keys(src), i4 = 0;i4 < keys3.length; ++i4) - if (dst[keys3[i4]] === undefined || !ifNotSet) - dst[keys3[i4]] = src[keys3[i4]]; + function merge4(dst, src, ifNotSet) { + for (var keys2 = Object.keys(src), i3 = 0;i3 < keys2.length; ++i3) + if (dst[keys2[i3]] === undefined || !ifNotSet) + dst[keys2[i3]] = src[keys2[i3]]; return dst; } - util7.merge = merge5; - util7.lcFirst = function lcFirst(str) { + util5.merge = merge4; + util5.lcFirst = function lcFirst(str) { return str.charAt(0).toLowerCase() + str.substring(1); }; function newError(name) { @@ -419232,7 +342858,7 @@ var require_minimal = __commonJS((exports) => { else Object.defineProperty(this, "stack", { value: new Error().stack || "" }); if (properties) - merge5(this, properties); + merge4(this, properties); } CustomError.prototype = Object.create(Error.prototype, { constructor: { @@ -419260,42 +342886,42 @@ var require_minimal = __commonJS((exports) => { }); return CustomError; } - util7.newError = newError; - util7.ProtocolError = newError("ProtocolError"); - util7.oneOfGetter = function getOneOf(fieldNames) { + util5.newError = newError; + util5.ProtocolError = newError("ProtocolError"); + util5.oneOfGetter = function getOneOf(fieldNames) { var fieldMap = {}; - for (var i4 = 0;i4 < fieldNames.length; ++i4) - fieldMap[fieldNames[i4]] = 1; + for (var i3 = 0;i3 < fieldNames.length; ++i3) + fieldMap[fieldNames[i3]] = 1; return function() { - for (var keys3 = Object.keys(this), i5 = keys3.length - 1;i5 > -1; --i5) - if (fieldMap[keys3[i5]] === 1 && this[keys3[i5]] !== undefined && this[keys3[i5]] !== null) - return keys3[i5]; + for (var keys2 = Object.keys(this), i4 = keys2.length - 1;i4 > -1; --i4) + if (fieldMap[keys2[i4]] === 1 && this[keys2[i4]] !== undefined && this[keys2[i4]] !== null) + return keys2[i4]; }; }; - util7.oneOfSetter = function setOneOf(fieldNames) { + util5.oneOfSetter = function setOneOf(fieldNames) { return function(name) { - for (var i4 = 0;i4 < fieldNames.length; ++i4) - if (fieldNames[i4] !== name) - delete this[fieldNames[i4]]; + for (var i3 = 0;i3 < fieldNames.length; ++i3) + if (fieldNames[i3] !== name) + delete this[fieldNames[i3]]; }; }; - util7.toJSONOptions = { + util5.toJSONOptions = { longs: String, enums: String, bytes: String, json: true }; - util7._configure = function() { - var Buffer11 = util7.Buffer; - if (!Buffer11) { - util7._Buffer_from = util7._Buffer_allocUnsafe = null; + util5._configure = function() { + var Buffer9 = util5.Buffer; + if (!Buffer9) { + util5._Buffer_from = util5._Buffer_allocUnsafe = null; return; } - util7._Buffer_from = Buffer11.from !== Uint8Array.from && Buffer11.from || function Buffer_from(value, encoding) { - return new Buffer11(value, encoding); + util5._Buffer_from = Buffer9.from !== Uint8Array.from && Buffer9.from || function Buffer_from(value, encoding) { + return new Buffer9(value, encoding); }; - util7._Buffer_allocUnsafe = Buffer11.allocUnsafe || function Buffer_allocUnsafe(size3) { - return new Buffer11(size3); + util5._Buffer_allocUnsafe = Buffer9.allocUnsafe || function Buffer_allocUnsafe(size2) { + return new Buffer9(size2); }; }; }); @@ -419303,18 +342929,18 @@ var require_minimal = __commonJS((exports) => { // node_modules/protobufjs/src/writer.js var require_writer = __commonJS((exports, module) => { module.exports = Writer; - var util7 = require_minimal(); + var util5 = require_minimal(); var BufferWriter; - var LongBits = util7.LongBits; - var base644 = util7.base64; - var utf8 = util7.utf8; + var LongBits = util5.LongBits; + var base643 = util5.base64; + var utf8 = util5.utf8; function Op(fn, len, val) { this.fn = fn; this.len = len; this.next = undefined; this.val = val; } - function noop11() {} + function noop8() {} function State(writer) { this.head = writer.head; this.tail = writer.tail; @@ -419323,12 +342949,12 @@ var require_writer = __commonJS((exports, module) => { } function Writer() { this.len = 0; - this.head = new Op(noop11, 0, 0); + this.head = new Op(noop8, 0, 0); this.tail = this.head; this.states = null; } - var create3 = function create() { - return util7.Buffer ? function create_buffer_setup() { + var create2 = function create() { + return util5.Buffer ? function create_buffer_setup() { return (Writer.create = function create_buffer() { return new BufferWriter; })(); @@ -419336,12 +342962,12 @@ var require_writer = __commonJS((exports, module) => { return new Writer; }; }; - Writer.create = create3(); - Writer.alloc = function alloc(size3) { - return new util7.Array(size3); + Writer.create = create2(); + Writer.alloc = function alloc(size2) { + return new util5.Array(size2); }; - if (util7.Array !== Array) - Writer.alloc = util7.pool(Writer.alloc, util7.Array.prototype.subarray); + if (util5.Array !== Array) + Writer.alloc = util5.pool(Writer.alloc, util5.Array.prototype.subarray); Writer.prototype._push = function push(fn, len, val) { this.tail = this.tail.next = new Op(fn, len, val); this.len += len; @@ -419387,13 +343013,13 @@ var require_writer = __commonJS((exports, module) => { buf[pos++] = val.lo; } Writer.prototype.uint64 = function write_uint64(value) { - var bits3 = LongBits.from(value); - return this._push(writeVarint64, bits3.length(), bits3); + var bits2 = LongBits.from(value); + return this._push(writeVarint64, bits2.length(), bits2); }; Writer.prototype.int64 = Writer.prototype.uint64; Writer.prototype.sint64 = function write_sint64(value) { - var bits3 = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits3.length(), bits3); + var bits2 = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits2.length(), bits2); }; Writer.prototype.bool = function write_bool(value) { return this._push(writeByte, 1, value ? 1 : 0); @@ -419409,29 +343035,29 @@ var require_writer = __commonJS((exports, module) => { }; Writer.prototype.sfixed32 = Writer.prototype.fixed32; Writer.prototype.fixed64 = function write_fixed64(value) { - var bits3 = LongBits.from(value); - return this._push(writeFixed32, 4, bits3.lo)._push(writeFixed32, 4, bits3.hi); + var bits2 = LongBits.from(value); + return this._push(writeFixed32, 4, bits2.lo)._push(writeFixed32, 4, bits2.hi); }; Writer.prototype.sfixed64 = Writer.prototype.fixed64; Writer.prototype.float = function write_float(value) { - return this._push(util7.float.writeFloatLE, 4, value); + return this._push(util5.float.writeFloatLE, 4, value); }; Writer.prototype.double = function write_double(value) { - return this._push(util7.float.writeDoubleLE, 8, value); + return this._push(util5.float.writeDoubleLE, 8, value); }; - var writeBytes = util7.Array.prototype.set ? function writeBytes_set(val, buf, pos) { + var writeBytes = util5.Array.prototype.set ? function writeBytes_set(val, buf, pos) { buf.set(val, pos); } : function writeBytes_for(val, buf, pos) { - for (var i4 = 0;i4 < val.length; ++i4) - buf[pos + i4] = val[i4]; + for (var i3 = 0;i3 < val.length; ++i3) + buf[pos + i3] = val[i3]; }; Writer.prototype.bytes = function write_bytes(value) { var len = value.length >>> 0; if (!len) return this._push(writeByte, 1, 0); - if (util7.isString(value)) { - var buf = Writer.alloc(len = base644.length(value)); - base644.decode(value, buf, 0); + if (util5.isString(value)) { + var buf = Writer.alloc(len = base643.length(value)); + base643.decode(value, buf, 0); value = buf; } return this.uint32(len)._push(writeBytes, len, value); @@ -419442,7 +343068,7 @@ var require_writer = __commonJS((exports, module) => { }; Writer.prototype.fork = function fork() { this.states = new State(this); - this.head = this.tail = new Op(noop11, 0, 0); + this.head = this.tail = new Op(noop8, 0, 0); this.len = 0; return this; }; @@ -419453,33 +343079,33 @@ var require_writer = __commonJS((exports, module) => { this.len = this.states.len; this.states = this.states.next; } else { - this.head = this.tail = new Op(noop11, 0, 0); + this.head = this.tail = new Op(noop8, 0, 0); this.len = 0; } return this; }; Writer.prototype.ldelim = function ldelim() { - var head3 = this.head, tail3 = this.tail, len = this.len; + var head2 = this.head, tail2 = this.tail, len = this.len; this.reset().uint32(len); if (len) { - this.tail.next = head3.next; - this.tail = tail3; + this.tail.next = head2.next; + this.tail = tail2; this.len += len; } return this; }; Writer.prototype.finish = function finish() { - var head3 = this.head.next, buf = this.constructor.alloc(this.len), pos = 0; - while (head3) { - head3.fn(head3.val, buf, pos); - pos += head3.len; - head3 = head3.next; + var head2 = this.head.next, buf = this.constructor.alloc(this.len), pos = 0; + while (head2) { + head2.fn(head2.val, buf, pos); + pos += head2.len; + head2 = head2.next; } return buf; }; Writer._configure = function(BufferWriter_) { BufferWriter = BufferWriter_; - Writer.create = create3(); + Writer.create = create2(); BufferWriter._configure(); }; }); @@ -419489,25 +343115,25 @@ var require_writer_buffer = __commonJS((exports, module) => { module.exports = BufferWriter; var Writer = require_writer(); (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - var util7 = require_minimal(); + var util5 = require_minimal(); function BufferWriter() { Writer.call(this); } BufferWriter._configure = function() { - BufferWriter.alloc = util7._Buffer_allocUnsafe; - BufferWriter.writeBytesBuffer = util7.Buffer && util7.Buffer.prototype instanceof Uint8Array && util7.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { + BufferWriter.alloc = util5._Buffer_allocUnsafe; + BufferWriter.writeBytesBuffer = util5.Buffer && util5.Buffer.prototype instanceof Uint8Array && util5.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { buf.set(val, pos); } : function writeBytesBuffer_copy(val, buf, pos) { if (val.copy) val.copy(buf, pos, 0, val.length); else - for (var i4 = 0;i4 < val.length; ) - buf[pos++] = val[i4++]; + for (var i3 = 0;i3 < val.length; ) + buf[pos++] = val[i3++]; }; }; BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util7.isString(value)) - value = util7._Buffer_from(value, "base64"); + if (util5.isString(value)) + value = util5._Buffer_from(value, "base64"); var len = value.length >>> 0; this.uint32(len); if (len) @@ -419516,14 +343142,14 @@ var require_writer_buffer = __commonJS((exports, module) => { }; function writeStringBuffer(val, buf, pos) { if (val.length < 40) - util7.utf8.write(val, buf, pos); + util5.utf8.write(val, buf, pos); else if (buf.utf8Write) buf.utf8Write(val, pos); else buf.write(val, pos); } BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util7.Buffer.byteLength(value); + var len = util5.Buffer.byteLength(value); this.uint32(len); if (len) this._push(writeStringBuffer, len, value); @@ -419535,10 +343161,10 @@ var require_writer_buffer = __commonJS((exports, module) => { // node_modules/protobufjs/src/reader.js var require_reader = __commonJS((exports, module) => { module.exports = Reader; - var util7 = require_minimal(); + var util5 = require_minimal(); var BufferReader; - var LongBits = util7.LongBits; - var utf8 = util7.utf8; + var LongBits = util5.LongBits; + var utf8 = util5.utf8; function indexOutOfRange(reader, writeLength) { return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); } @@ -419556,15 +343182,15 @@ var require_reader = __commonJS((exports, module) => { return new Reader(buffer); throw Error("illegal buffer"); }; - var create3 = function create() { - return util7.Buffer ? function create_buffer_setup(buffer) { + var create2 = function create() { + return util5.Buffer ? function create_buffer_setup(buffer) { return (Reader.create = function create_buffer(buffer2) { - return util7.Buffer.isBuffer(buffer2) ? new BufferReader(buffer2) : create_array(buffer2); + return util5.Buffer.isBuffer(buffer2) ? new BufferReader(buffer2) : create_array(buffer2); })(buffer); } : create_array; }; - Reader.create = create3(); - Reader.prototype._slice = util7.Array.prototype.subarray || util7.Array.prototype.slice; + Reader.create = create2(); + Reader.prototype._slice = util5.Array.prototype.subarray || util5.Array.prototype.slice; Reader.prototype.uint32 = function read_uint32_setup() { var value = 4294967295; return function read_uint32() { @@ -419598,43 +343224,43 @@ var require_reader = __commonJS((exports, module) => { return value >>> 1 ^ -(value & 1) | 0; }; function readLongVarint() { - var bits3 = new LongBits(0, 0); - var i4 = 0; + var bits2 = new LongBits(0, 0); + var i3 = 0; if (this.len - this.pos > 4) { - for (;i4 < 4; ++i4) { - bits3.lo = (bits3.lo | (this.buf[this.pos] & 127) << i4 * 7) >>> 0; + for (;i3 < 4; ++i3) { + bits2.lo = (bits2.lo | (this.buf[this.pos] & 127) << i3 * 7) >>> 0; if (this.buf[this.pos++] < 128) - return bits3; + return bits2; } - bits3.lo = (bits3.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits3.hi = (bits3.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + bits2.lo = (bits2.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits2.hi = (bits2.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; if (this.buf[this.pos++] < 128) - return bits3; - i4 = 0; + return bits2; + i3 = 0; } else { - for (;i4 < 3; ++i4) { + for (;i3 < 3; ++i3) { if (this.pos >= this.len) throw indexOutOfRange(this); - bits3.lo = (bits3.lo | (this.buf[this.pos] & 127) << i4 * 7) >>> 0; + bits2.lo = (bits2.lo | (this.buf[this.pos] & 127) << i3 * 7) >>> 0; if (this.buf[this.pos++] < 128) - return bits3; + return bits2; } - bits3.lo = (bits3.lo | (this.buf[this.pos++] & 127) << i4 * 7) >>> 0; - return bits3; + bits2.lo = (bits2.lo | (this.buf[this.pos++] & 127) << i3 * 7) >>> 0; + return bits2; } if (this.len - this.pos > 4) { - for (;i4 < 5; ++i4) { - bits3.hi = (bits3.hi | (this.buf[this.pos] & 127) << i4 * 7 + 3) >>> 0; + for (;i3 < 5; ++i3) { + bits2.hi = (bits2.hi | (this.buf[this.pos] & 127) << i3 * 7 + 3) >>> 0; if (this.buf[this.pos++] < 128) - return bits3; + return bits2; } } else { - for (;i4 < 5; ++i4) { + for (;i3 < 5; ++i3) { if (this.pos >= this.len) throw indexOutOfRange(this); - bits3.hi = (bits3.hi | (this.buf[this.pos] & 127) << i4 * 7 + 3) >>> 0; + bits2.hi = (bits2.hi | (this.buf[this.pos] & 127) << i3 * 7 + 3) >>> 0; if (this.buf[this.pos++] < 128) - return bits3; + return bits2; } } throw Error("invalid varint encoding"); @@ -419663,14 +343289,14 @@ var require_reader = __commonJS((exports, module) => { Reader.prototype.float = function read_float() { if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); - var value = util7.float.readFloatLE(this.buf, this.pos); + var value = util5.float.readFloatLE(this.buf, this.pos); this.pos += 4; return value; }; Reader.prototype.double = function read_double() { if (this.pos + 8 > this.len) throw indexOutOfRange(this, 4); - var value = util7.float.readDoubleLE(this.buf, this.pos); + var value = util5.float.readDoubleLE(this.buf, this.pos); this.pos += 8; return value; }; @@ -419682,7 +343308,7 @@ var require_reader = __commonJS((exports, module) => { if (Array.isArray(this.buf)) return this.buf.slice(start, end); if (start === end) { - var nativeBuffer = util7.Buffer; + var nativeBuffer = util5.Buffer; return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0); } return this._slice.call(this.buf, start, end); @@ -419730,10 +343356,10 @@ var require_reader = __commonJS((exports, module) => { }; Reader._configure = function(BufferReader_) { BufferReader = BufferReader_; - Reader.create = create3(); + Reader.create = create2(); BufferReader._configure(); - var fn = util7.Long ? "toLong" : "toNumber"; - util7.merge(Reader.prototype, { + var fn = util5.Long ? "toLong" : "toNumber"; + util5.merge(Reader.prototype, { int64: function read_int64() { return readLongVarint.call(this)[fn](false); }, @@ -419758,13 +343384,13 @@ var require_reader_buffer = __commonJS((exports, module) => { module.exports = BufferReader; var Reader = require_reader(); (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - var util7 = require_minimal(); + var util5 = require_minimal(); function BufferReader(buffer) { Reader.call(this, buffer); } BufferReader._configure = function() { - if (util7.Buffer) - BufferReader.prototype._slice = util7.Buffer.prototype.slice; + if (util5.Buffer) + BufferReader.prototype._slice = util5.Buffer.prototype.slice; }; BufferReader.prototype.string = function read_string_buffer() { var len = this.uint32(); @@ -419776,22 +343402,22 @@ var require_reader_buffer = __commonJS((exports, module) => { // node_modules/protobufjs/src/rpc/service.js var require_service = __commonJS((exports, module) => { module.exports = Service; - var util7 = require_minimal(); - (Service.prototype = Object.create(util7.EventEmitter.prototype)).constructor = Service; + var util5 = require_minimal(); + (Service.prototype = Object.create(util5.EventEmitter.prototype)).constructor = Service; function Service(rpcImpl, requestDelimited, responseDelimited) { if (typeof rpcImpl !== "function") throw TypeError("rpcImpl must be a function"); - util7.EventEmitter.call(this); + util5.EventEmitter.call(this); this.rpcImpl = rpcImpl; this.requestDelimited = Boolean(requestDelimited); this.responseDelimited = Boolean(responseDelimited); } - Service.prototype.rpcCall = function rpcCall(method3, requestCtor, responseCtor, request, callback) { + Service.prototype.rpcCall = function rpcCall(method2, requestCtor, responseCtor, request, callback) { if (!request) throw TypeError("request must be specified"); var self2 = this; if (!callback) - return util7.asPromise(rpcCall, self2, method3, requestCtor, responseCtor, request); + return util5.asPromise(rpcCall, self2, method2, requestCtor, responseCtor, request); if (!self2.rpcImpl) { setTimeout(function() { callback(Error("already ended")); @@ -419799,10 +343425,10 @@ var require_service = __commonJS((exports, module) => { return; } try { - return self2.rpcImpl(method3, requestCtor[self2.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), function rpcCallback(err3, response) { - if (err3) { - self2.emit("error", err3, method3); - return callback(err3); + return self2.rpcImpl(method2, requestCtor[self2.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), function rpcCallback(err2, response) { + if (err2) { + self2.emit("error", err2, method2); + return callback(err2); } if (response === null) { self2.end(true); @@ -419811,18 +343437,18 @@ var require_service = __commonJS((exports, module) => { if (!(response instanceof responseCtor)) { try { response = responseCtor[self2.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err4) { - self2.emit("error", err4, method3); - return callback(err4); + } catch (err3) { + self2.emit("error", err3, method2); + return callback(err3); } } - self2.emit("data", response, method3); + self2.emit("data", response, method2); return callback(null, response); }); - } catch (err3) { - self2.emit("error", err3, method3); + } catch (err2) { + self2.emit("error", err2, method2); setTimeout(function() { - callback(err3); + callback(err2); }, 0); return; } @@ -419887,9 +343513,9 @@ var require_root = __commonJS((exports, module) => { v1.AnyValue = function() { function AnyValue(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } AnyValue.prototype.stringValue = null; @@ -420011,9 +343637,9 @@ var require_root = __commonJS((exports, module) => { return "value: multiple values"; properties.value = 1; { - var error45 = $root.opentelemetry.proto.common.v1.ArrayValue.verify(message.arrayValue); - if (error45) - return "arrayValue." + error45; + var error41 = $root.opentelemetry.proto.common.v1.ArrayValue.verify(message.arrayValue); + if (error41) + return "arrayValue." + error41; } } if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { @@ -420021,9 +343647,9 @@ var require_root = __commonJS((exports, module) => { return "value: multiple values"; properties.value = 1; { - var error45 = $root.opentelemetry.proto.common.v1.KeyValueList.verify(message.kvlistValue); - if (error45) - return "kvlistValue." + error45; + var error41 = $root.opentelemetry.proto.common.v1.KeyValueList.verify(message.kvlistValue); + if (error41) + return "kvlistValue." + error41; } } if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { @@ -420132,9 +343758,9 @@ var require_root = __commonJS((exports, module) => { function ArrayValue(properties) { this.values = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ArrayValue.prototype.values = $util.emptyArray; @@ -420145,8 +343771,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.values != null && message.values.length) - for (var i4 = 0;i4 < message.values.length; ++i4) - $root.opentelemetry.proto.common.v1.AnyValue.encode(message.values[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.values.length; ++i3) + $root.opentelemetry.proto.common.v1.AnyValue.encode(message.values[i3], writer.uint32(10).fork()).ldelim(); return writer; }; ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { @@ -420183,10 +343809,10 @@ var require_root = __commonJS((exports, module) => { if (message.values != null && message.hasOwnProperty("values")) { if (!Array.isArray(message.values)) return "values: array expected"; - for (var i4 = 0;i4 < message.values.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.values[i4]); - if (error45) - return "values." + error45; + for (var i3 = 0;i3 < message.values.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.values[i3]); + if (error41) + return "values." + error41; } } return null; @@ -420199,10 +343825,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.values)) throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected"); message.values = []; - for (var i4 = 0;i4 < object4.values.length; ++i4) { - if (typeof object4.values[i4] !== "object") + for (var i3 = 0;i3 < object4.values.length; ++i3) { + if (typeof object4.values[i3] !== "object") throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected"); - message.values[i4] = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object4.values[i4]); + message.values[i3] = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object4.values[i3]); } } return message; @@ -420235,9 +343861,9 @@ var require_root = __commonJS((exports, module) => { function KeyValueList(properties) { this.values = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } KeyValueList.prototype.values = $util.emptyArray; @@ -420248,8 +343874,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.values != null && message.values.length) - for (var i4 = 0;i4 < message.values.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.values[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.values.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.values[i3], writer.uint32(10).fork()).ldelim(); return writer; }; KeyValueList.encodeDelimited = function encodeDelimited(message, writer) { @@ -420286,10 +343912,10 @@ var require_root = __commonJS((exports, module) => { if (message.values != null && message.hasOwnProperty("values")) { if (!Array.isArray(message.values)) return "values: array expected"; - for (var i4 = 0;i4 < message.values.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.values[i4]); - if (error45) - return "values." + error45; + for (var i3 = 0;i3 < message.values.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.values[i3]); + if (error41) + return "values." + error41; } } return null; @@ -420302,10 +343928,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.values)) throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected"); message.values = []; - for (var i4 = 0;i4 < object4.values.length; ++i4) { - if (typeof object4.values[i4] !== "object") + for (var i3 = 0;i3 < object4.values.length; ++i3) { + if (typeof object4.values[i3] !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected"); - message.values[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.values[i4]); + message.values[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.values[i3]); } } return message; @@ -420337,9 +343963,9 @@ var require_root = __commonJS((exports, module) => { v1.KeyValue = function() { function KeyValue(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } KeyValue.prototype.key = null; @@ -420394,9 +344020,9 @@ var require_root = __commonJS((exports, module) => { return "key: string expected"; } if (message.value != null && message.hasOwnProperty("value")) { - var error45 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.value); - if (error45) - return "value." + error45; + var error41 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.value); + if (error41) + return "value." + error41; } return null; }; @@ -420442,9 +344068,9 @@ var require_root = __commonJS((exports, module) => { function InstrumentationScope(properties) { this.attributes = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } InstrumentationScope.prototype.name = null; @@ -420462,8 +344088,8 @@ var require_root = __commonJS((exports, module) => { if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(18).string(message.version); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(26).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(26).fork()).ldelim(); if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(32).uint32(message.droppedAttributesCount); return writer; @@ -420522,10 +344148,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { @@ -420546,10 +344172,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.droppedAttributesCount != null) @@ -420603,9 +344229,9 @@ var require_root = __commonJS((exports, module) => { function Resource(properties) { this.attributes = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Resource.prototype.attributes = $util.emptyArray; @@ -420617,8 +344243,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(10).fork()).ldelim(); if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(16).uint32(message.droppedAttributesCount); return writer; @@ -420661,10 +344287,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { @@ -420681,10 +344307,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.droppedAttributesCount != null) @@ -420731,9 +344357,9 @@ var require_root = __commonJS((exports, module) => { function TracesData(properties) { this.resourceSpans = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } TracesData.prototype.resourceSpans = $util.emptyArray; @@ -420744,8 +344370,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.resourceSpans != null && message.resourceSpans.length) - for (var i4 = 0;i4 < message.resourceSpans.length; ++i4) - $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.resourceSpans.length; ++i3) + $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i3], writer.uint32(10).fork()).ldelim(); return writer; }; TracesData.encodeDelimited = function encodeDelimited(message, writer) { @@ -420782,10 +344408,10 @@ var require_root = __commonJS((exports, module) => { if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { if (!Array.isArray(message.resourceSpans)) return "resourceSpans: array expected"; - for (var i4 = 0;i4 < message.resourceSpans.length; ++i4) { - var error45 = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i4]); - if (error45) - return "resourceSpans." + error45; + for (var i3 = 0;i3 < message.resourceSpans.length; ++i3) { + var error41 = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i3]); + if (error41) + return "resourceSpans." + error41; } } return null; @@ -420798,10 +344424,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.resourceSpans)) throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected"); message.resourceSpans = []; - for (var i4 = 0;i4 < object4.resourceSpans.length; ++i4) { - if (typeof object4.resourceSpans[i4] !== "object") + for (var i3 = 0;i3 < object4.resourceSpans.length; ++i3) { + if (typeof object4.resourceSpans[i3] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected"); - message.resourceSpans[i4] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object4.resourceSpans[i4]); + message.resourceSpans[i3] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object4.resourceSpans[i3]); } } return message; @@ -420834,9 +344460,9 @@ var require_root = __commonJS((exports, module) => { function ResourceSpans(properties) { this.scopeSpans = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ResourceSpans.prototype.resource = null; @@ -420851,8 +344477,8 @@ var require_root = __commonJS((exports, module) => { if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); if (message.scopeSpans != null && message.scopeSpans.length) - for (var i4 = 0;i4 < message.scopeSpans.length; ++i4) - $root.opentelemetry.proto.trace.v1.ScopeSpans.encode(message.scopeSpans[i4], writer.uint32(18).fork()).ldelim(); + for (var i3 = 0;i3 < message.scopeSpans.length; ++i3) + $root.opentelemetry.proto.trace.v1.ScopeSpans.encode(message.scopeSpans[i3], writer.uint32(18).fork()).ldelim(); if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); return writer; @@ -420897,17 +344523,17 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.resource != null && message.hasOwnProperty("resource")) { - var error45 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error45) - return "resource." + error45; + var error41 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error41) + return "resource." + error41; } if (message.scopeSpans != null && message.hasOwnProperty("scopeSpans")) { if (!Array.isArray(message.scopeSpans)) return "scopeSpans: array expected"; - for (var i4 = 0;i4 < message.scopeSpans.length; ++i4) { - var error45 = $root.opentelemetry.proto.trace.v1.ScopeSpans.verify(message.scopeSpans[i4]); - if (error45) - return "scopeSpans." + error45; + for (var i3 = 0;i3 < message.scopeSpans.length; ++i3) { + var error41 = $root.opentelemetry.proto.trace.v1.ScopeSpans.verify(message.scopeSpans[i3]); + if (error41) + return "scopeSpans." + error41; } } if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { @@ -420929,10 +344555,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.scopeSpans)) throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected"); message.scopeSpans = []; - for (var i4 = 0;i4 < object4.scopeSpans.length; ++i4) { - if (typeof object4.scopeSpans[i4] !== "object") + for (var i3 = 0;i3 < object4.scopeSpans.length; ++i3) { + if (typeof object4.scopeSpans[i3] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected"); - message.scopeSpans[i4] = $root.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(object4.scopeSpans[i4]); + message.scopeSpans[i3] = $root.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(object4.scopeSpans[i3]); } } if (object4.schemaUrl != null) @@ -420975,9 +344601,9 @@ var require_root = __commonJS((exports, module) => { function ScopeSpans(properties) { this.spans = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ScopeSpans.prototype.scope = null; @@ -420992,8 +344618,8 @@ var require_root = __commonJS((exports, module) => { if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); if (message.spans != null && message.spans.length) - for (var i4 = 0;i4 < message.spans.length; ++i4) - $root.opentelemetry.proto.trace.v1.Span.encode(message.spans[i4], writer.uint32(18).fork()).ldelim(); + for (var i3 = 0;i3 < message.spans.length; ++i3) + $root.opentelemetry.proto.trace.v1.Span.encode(message.spans[i3], writer.uint32(18).fork()).ldelim(); if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); return writer; @@ -421038,17 +344664,17 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.scope != null && message.hasOwnProperty("scope")) { - var error45 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error45) - return "scope." + error45; + var error41 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error41) + return "scope." + error41; } if (message.spans != null && message.hasOwnProperty("spans")) { if (!Array.isArray(message.spans)) return "spans: array expected"; - for (var i4 = 0;i4 < message.spans.length; ++i4) { - var error45 = $root.opentelemetry.proto.trace.v1.Span.verify(message.spans[i4]); - if (error45) - return "spans." + error45; + for (var i3 = 0;i3 < message.spans.length; ++i3) { + var error41 = $root.opentelemetry.proto.trace.v1.Span.verify(message.spans[i3]); + if (error41) + return "spans." + error41; } } if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { @@ -421070,10 +344696,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.spans)) throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected"); message.spans = []; - for (var i4 = 0;i4 < object4.spans.length; ++i4) { - if (typeof object4.spans[i4] !== "object") + for (var i3 = 0;i3 < object4.spans.length; ++i3) { + if (typeof object4.spans[i3] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected"); - message.spans[i4] = $root.opentelemetry.proto.trace.v1.Span.fromObject(object4.spans[i4]); + message.spans[i3] = $root.opentelemetry.proto.trace.v1.Span.fromObject(object4.spans[i3]); } } if (object4.schemaUrl != null) @@ -421118,9 +344744,9 @@ var require_root = __commonJS((exports, module) => { this.events = []; this.links = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Span.prototype.traceId = null; @@ -421161,18 +344787,18 @@ var require_root = __commonJS((exports, module) => { if (message.endTimeUnixNano != null && Object.hasOwnProperty.call(message, "endTimeUnixNano")) writer.uint32(65).fixed64(message.endTimeUnixNano); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(74).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(74).fork()).ldelim(); if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(80).uint32(message.droppedAttributesCount); if (message.events != null && message.events.length) - for (var i4 = 0;i4 < message.events.length; ++i4) - $root.opentelemetry.proto.trace.v1.Span.Event.encode(message.events[i4], writer.uint32(90).fork()).ldelim(); + for (var i3 = 0;i3 < message.events.length; ++i3) + $root.opentelemetry.proto.trace.v1.Span.Event.encode(message.events[i3], writer.uint32(90).fork()).ldelim(); if (message.droppedEventsCount != null && Object.hasOwnProperty.call(message, "droppedEventsCount")) writer.uint32(96).uint32(message.droppedEventsCount); if (message.links != null && message.links.length) - for (var i4 = 0;i4 < message.links.length; ++i4) - $root.opentelemetry.proto.trace.v1.Span.Link.encode(message.links[i4], writer.uint32(106).fork()).ldelim(); + for (var i3 = 0;i3 < message.links.length; ++i3) + $root.opentelemetry.proto.trace.v1.Span.Link.encode(message.links[i3], writer.uint32(106).fork()).ldelim(); if (message.droppedLinksCount != null && Object.hasOwnProperty.call(message, "droppedLinksCount")) writer.uint32(112).uint32(message.droppedLinksCount); if (message.status != null && Object.hasOwnProperty.call(message, "status")) @@ -421313,10 +344939,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { @@ -421326,10 +344952,10 @@ var require_root = __commonJS((exports, module) => { if (message.events != null && message.hasOwnProperty("events")) { if (!Array.isArray(message.events)) return "events: array expected"; - for (var i4 = 0;i4 < message.events.length; ++i4) { - var error45 = $root.opentelemetry.proto.trace.v1.Span.Event.verify(message.events[i4]); - if (error45) - return "events." + error45; + for (var i3 = 0;i3 < message.events.length; ++i3) { + var error41 = $root.opentelemetry.proto.trace.v1.Span.Event.verify(message.events[i3]); + if (error41) + return "events." + error41; } } if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) { @@ -421339,10 +344965,10 @@ var require_root = __commonJS((exports, module) => { if (message.links != null && message.hasOwnProperty("links")) { if (!Array.isArray(message.links)) return "links: array expected"; - for (var i4 = 0;i4 < message.links.length; ++i4) { - var error45 = $root.opentelemetry.proto.trace.v1.Span.Link.verify(message.links[i4]); - if (error45) - return "links." + error45; + for (var i3 = 0;i3 < message.links.length; ++i3) { + var error41 = $root.opentelemetry.proto.trace.v1.Span.Link.verify(message.links[i3]); + if (error41) + return "links." + error41; } } if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) { @@ -421350,9 +344976,9 @@ var require_root = __commonJS((exports, module) => { return "droppedLinksCount: integer expected"; } if (message.status != null && message.hasOwnProperty("status")) { - var error45 = $root.opentelemetry.proto.trace.v1.Status.verify(message.status); - if (error45) - return "status." + error45; + var error41 = $root.opentelemetry.proto.trace.v1.Status.verify(message.status); + if (error41) + return "status." + error41; } return null; }; @@ -421438,10 +345064,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.droppedAttributesCount != null) @@ -421450,10 +345076,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.events)) throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected"); message.events = []; - for (var i4 = 0;i4 < object4.events.length; ++i4) { - if (typeof object4.events[i4] !== "object") + for (var i3 = 0;i3 < object4.events.length; ++i3) { + if (typeof object4.events[i3] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected"); - message.events[i4] = $root.opentelemetry.proto.trace.v1.Span.Event.fromObject(object4.events[i4]); + message.events[i3] = $root.opentelemetry.proto.trace.v1.Span.Event.fromObject(object4.events[i3]); } } if (object4.droppedEventsCount != null) @@ -421462,10 +345088,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.links)) throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected"); message.links = []; - for (var i4 = 0;i4 < object4.links.length; ++i4) { - if (typeof object4.links[i4] !== "object") + for (var i3 = 0;i3 < object4.links.length; ++i3) { + if (typeof object4.links[i3] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected"); - message.links[i4] = $root.opentelemetry.proto.trace.v1.Span.Link.fromObject(object4.links[i4]); + message.links[i3] = $root.opentelemetry.proto.trace.v1.Span.Link.fromObject(object4.links[i3]); } } if (object4.droppedLinksCount != null) @@ -421583,22 +345209,22 @@ var require_root = __commonJS((exports, module) => { return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span"; }; Span.SpanKind = function() { - var valuesById = {}, values4 = Object.create(valuesById); - values4[valuesById[0] = "SPAN_KIND_UNSPECIFIED"] = 0; - values4[valuesById[1] = "SPAN_KIND_INTERNAL"] = 1; - values4[valuesById[2] = "SPAN_KIND_SERVER"] = 2; - values4[valuesById[3] = "SPAN_KIND_CLIENT"] = 3; - values4[valuesById[4] = "SPAN_KIND_PRODUCER"] = 4; - values4[valuesById[5] = "SPAN_KIND_CONSUMER"] = 5; - return values4; + var valuesById = {}, values2 = Object.create(valuesById); + values2[valuesById[0] = "SPAN_KIND_UNSPECIFIED"] = 0; + values2[valuesById[1] = "SPAN_KIND_INTERNAL"] = 1; + values2[valuesById[2] = "SPAN_KIND_SERVER"] = 2; + values2[valuesById[3] = "SPAN_KIND_CLIENT"] = 3; + values2[valuesById[4] = "SPAN_KIND_PRODUCER"] = 4; + values2[valuesById[5] = "SPAN_KIND_CONSUMER"] = 5; + return values2; }(); Span.Event = function() { function Event3(properties) { this.attributes = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Event3.prototype.timeUnixNano = null; @@ -421616,8 +345242,8 @@ var require_root = __commonJS((exports, module) => { if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(18).string(message.name); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(26).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(26).fork()).ldelim(); if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(32).uint32(message.droppedAttributesCount); return writer; @@ -421676,10 +345302,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { @@ -421708,10 +345334,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.droppedAttributesCount != null) @@ -421764,9 +345390,9 @@ var require_root = __commonJS((exports, module) => { function Link2(properties) { this.attributes = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Link2.prototype.traceId = null; @@ -421787,8 +345413,8 @@ var require_root = __commonJS((exports, module) => { if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) writer.uint32(26).string(message.traceState); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(34).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(34).fork()).ldelim(); if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(40).uint32(message.droppedAttributesCount); return writer; @@ -421855,10 +345481,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { @@ -421889,10 +345515,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.droppedAttributesCount != null) @@ -421954,9 +345580,9 @@ var require_root = __commonJS((exports, module) => { v1.Status = function() { function Status(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Status.prototype.message = null; @@ -422073,11 +345699,11 @@ var require_root = __commonJS((exports, module) => { return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Status"; }; Status.StatusCode = function() { - var valuesById = {}, values4 = Object.create(valuesById); - values4[valuesById[0] = "STATUS_CODE_UNSET"] = 0; - values4[valuesById[1] = "STATUS_CODE_OK"] = 1; - values4[valuesById[2] = "STATUS_CODE_ERROR"] = 2; - return values4; + var valuesById = {}, values2 = Object.create(valuesById); + values2[valuesById[0] = "STATUS_CODE_UNSET"] = 0; + values2[valuesById[1] = "STATUS_CODE_OK"] = 1; + values2[valuesById[2] = "STATUS_CODE_ERROR"] = 2; + return values2; }(); return Status; }(); @@ -422108,9 +345734,9 @@ var require_root = __commonJS((exports, module) => { function ExportTraceServiceRequest(properties) { this.resourceSpans = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportTraceServiceRequest.prototype.resourceSpans = $util.emptyArray; @@ -422121,8 +345747,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.resourceSpans != null && message.resourceSpans.length) - for (var i4 = 0;i4 < message.resourceSpans.length; ++i4) - $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.resourceSpans.length; ++i3) + $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i3], writer.uint32(10).fork()).ldelim(); return writer; }; ExportTraceServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { @@ -422159,10 +345785,10 @@ var require_root = __commonJS((exports, module) => { if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { if (!Array.isArray(message.resourceSpans)) return "resourceSpans: array expected"; - for (var i4 = 0;i4 < message.resourceSpans.length; ++i4) { - var error45 = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i4]); - if (error45) - return "resourceSpans." + error45; + for (var i3 = 0;i3 < message.resourceSpans.length; ++i3) { + var error41 = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i3]); + if (error41) + return "resourceSpans." + error41; } } return null; @@ -422175,10 +345801,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.resourceSpans)) throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected"); message.resourceSpans = []; - for (var i4 = 0;i4 < object4.resourceSpans.length; ++i4) { - if (typeof object4.resourceSpans[i4] !== "object") + for (var i3 = 0;i3 < object4.resourceSpans.length; ++i3) { + if (typeof object4.resourceSpans[i3] !== "object") throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected"); - message.resourceSpans[i4] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object4.resourceSpans[i4]); + message.resourceSpans[i3] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object4.resourceSpans[i3]); } } return message; @@ -422210,9 +345836,9 @@ var require_root = __commonJS((exports, module) => { v1.ExportTraceServiceResponse = function() { function ExportTraceServiceResponse(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportTraceServiceResponse.prototype.partialSuccess = null; @@ -422256,9 +345882,9 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error45 = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(message.partialSuccess); - if (error45) - return "partialSuccess." + error45; + var error41 = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(message.partialSuccess); + if (error41) + return "partialSuccess." + error41; } return null; }; @@ -422297,9 +345923,9 @@ var require_root = __commonJS((exports, module) => { v1.ExportTracePartialSuccess = function() { function ExportTracePartialSuccess(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportTracePartialSuccess.prototype.rejectedSpans = null; @@ -422434,9 +346060,9 @@ var require_root = __commonJS((exports, module) => { function ExportMetricsServiceRequest(properties) { this.resourceMetrics = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportMetricsServiceRequest.prototype.resourceMetrics = $util.emptyArray; @@ -422447,8 +346073,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.resourceMetrics != null && message.resourceMetrics.length) - for (var i4 = 0;i4 < message.resourceMetrics.length; ++i4) - $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.resourceMetrics.length; ++i3) + $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i3], writer.uint32(10).fork()).ldelim(); return writer; }; ExportMetricsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { @@ -422485,10 +346111,10 @@ var require_root = __commonJS((exports, module) => { if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { if (!Array.isArray(message.resourceMetrics)) return "resourceMetrics: array expected"; - for (var i4 = 0;i4 < message.resourceMetrics.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i4]); - if (error45) - return "resourceMetrics." + error45; + for (var i3 = 0;i3 < message.resourceMetrics.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i3]); + if (error41) + return "resourceMetrics." + error41; } } return null; @@ -422501,10 +346127,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.resourceMetrics)) throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected"); message.resourceMetrics = []; - for (var i4 = 0;i4 < object4.resourceMetrics.length; ++i4) { - if (typeof object4.resourceMetrics[i4] !== "object") + for (var i3 = 0;i3 < object4.resourceMetrics.length; ++i3) { + if (typeof object4.resourceMetrics[i3] !== "object") throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected"); - message.resourceMetrics[i4] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object4.resourceMetrics[i4]); + message.resourceMetrics[i3] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object4.resourceMetrics[i3]); } } return message; @@ -422536,9 +346162,9 @@ var require_root = __commonJS((exports, module) => { v1.ExportMetricsServiceResponse = function() { function ExportMetricsServiceResponse(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportMetricsServiceResponse.prototype.partialSuccess = null; @@ -422582,9 +346208,9 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error45 = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(message.partialSuccess); - if (error45) - return "partialSuccess." + error45; + var error41 = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(message.partialSuccess); + if (error41) + return "partialSuccess." + error41; } return null; }; @@ -422623,9 +346249,9 @@ var require_root = __commonJS((exports, module) => { v1.ExportMetricsPartialSuccess = function() { function ExportMetricsPartialSuccess(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportMetricsPartialSuccess.prototype.rejectedDataPoints = null; @@ -422760,9 +346386,9 @@ var require_root = __commonJS((exports, module) => { function ExportLogsServiceRequest(properties) { this.resourceLogs = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportLogsServiceRequest.prototype.resourceLogs = $util.emptyArray; @@ -422773,8 +346399,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.resourceLogs != null && message.resourceLogs.length) - for (var i4 = 0;i4 < message.resourceLogs.length; ++i4) - $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.resourceLogs.length; ++i3) + $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i3], writer.uint32(10).fork()).ldelim(); return writer; }; ExportLogsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { @@ -422811,10 +346437,10 @@ var require_root = __commonJS((exports, module) => { if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { if (!Array.isArray(message.resourceLogs)) return "resourceLogs: array expected"; - for (var i4 = 0;i4 < message.resourceLogs.length; ++i4) { - var error45 = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i4]); - if (error45) - return "resourceLogs." + error45; + for (var i3 = 0;i3 < message.resourceLogs.length; ++i3) { + var error41 = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i3]); + if (error41) + return "resourceLogs." + error41; } } return null; @@ -422827,10 +346453,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.resourceLogs)) throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected"); message.resourceLogs = []; - for (var i4 = 0;i4 < object4.resourceLogs.length; ++i4) { - if (typeof object4.resourceLogs[i4] !== "object") + for (var i3 = 0;i3 < object4.resourceLogs.length; ++i3) { + if (typeof object4.resourceLogs[i3] !== "object") throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected"); - message.resourceLogs[i4] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object4.resourceLogs[i4]); + message.resourceLogs[i3] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object4.resourceLogs[i3]); } } return message; @@ -422862,9 +346488,9 @@ var require_root = __commonJS((exports, module) => { v1.ExportLogsServiceResponse = function() { function ExportLogsServiceResponse(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportLogsServiceResponse.prototype.partialSuccess = null; @@ -422908,9 +346534,9 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error45 = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(message.partialSuccess); - if (error45) - return "partialSuccess." + error45; + var error41 = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(message.partialSuccess); + if (error41) + return "partialSuccess." + error41; } return null; }; @@ -422949,9 +346575,9 @@ var require_root = __commonJS((exports, module) => { v1.ExportLogsPartialSuccess = function() { function ExportLogsPartialSuccess(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExportLogsPartialSuccess.prototype.rejectedLogRecords = null; @@ -423075,9 +346701,9 @@ var require_root = __commonJS((exports, module) => { function MetricsData(properties) { this.resourceMetrics = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } MetricsData.prototype.resourceMetrics = $util.emptyArray; @@ -423088,8 +346714,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.resourceMetrics != null && message.resourceMetrics.length) - for (var i4 = 0;i4 < message.resourceMetrics.length; ++i4) - $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.resourceMetrics.length; ++i3) + $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i3], writer.uint32(10).fork()).ldelim(); return writer; }; MetricsData.encodeDelimited = function encodeDelimited(message, writer) { @@ -423126,10 +346752,10 @@ var require_root = __commonJS((exports, module) => { if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { if (!Array.isArray(message.resourceMetrics)) return "resourceMetrics: array expected"; - for (var i4 = 0;i4 < message.resourceMetrics.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i4]); - if (error45) - return "resourceMetrics." + error45; + for (var i3 = 0;i3 < message.resourceMetrics.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i3]); + if (error41) + return "resourceMetrics." + error41; } } return null; @@ -423142,10 +346768,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.resourceMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected"); message.resourceMetrics = []; - for (var i4 = 0;i4 < object4.resourceMetrics.length; ++i4) { - if (typeof object4.resourceMetrics[i4] !== "object") + for (var i3 = 0;i3 < object4.resourceMetrics.length; ++i3) { + if (typeof object4.resourceMetrics[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected"); - message.resourceMetrics[i4] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object4.resourceMetrics[i4]); + message.resourceMetrics[i3] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object4.resourceMetrics[i3]); } } return message; @@ -423178,9 +346804,9 @@ var require_root = __commonJS((exports, module) => { function ResourceMetrics(properties) { this.scopeMetrics = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ResourceMetrics.prototype.resource = null; @@ -423195,8 +346821,8 @@ var require_root = __commonJS((exports, module) => { if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); if (message.scopeMetrics != null && message.scopeMetrics.length) - for (var i4 = 0;i4 < message.scopeMetrics.length; ++i4) - $root.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(message.scopeMetrics[i4], writer.uint32(18).fork()).ldelim(); + for (var i3 = 0;i3 < message.scopeMetrics.length; ++i3) + $root.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(message.scopeMetrics[i3], writer.uint32(18).fork()).ldelim(); if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); return writer; @@ -423241,17 +346867,17 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.resource != null && message.hasOwnProperty("resource")) { - var error45 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error45) - return "resource." + error45; + var error41 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error41) + return "resource." + error41; } if (message.scopeMetrics != null && message.hasOwnProperty("scopeMetrics")) { if (!Array.isArray(message.scopeMetrics)) return "scopeMetrics: array expected"; - for (var i4 = 0;i4 < message.scopeMetrics.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(message.scopeMetrics[i4]); - if (error45) - return "scopeMetrics." + error45; + for (var i3 = 0;i3 < message.scopeMetrics.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(message.scopeMetrics[i3]); + if (error41) + return "scopeMetrics." + error41; } } if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { @@ -423273,10 +346899,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.scopeMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected"); message.scopeMetrics = []; - for (var i4 = 0;i4 < object4.scopeMetrics.length; ++i4) { - if (typeof object4.scopeMetrics[i4] !== "object") + for (var i3 = 0;i3 < object4.scopeMetrics.length; ++i3) { + if (typeof object4.scopeMetrics[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected"); - message.scopeMetrics[i4] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(object4.scopeMetrics[i4]); + message.scopeMetrics[i3] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(object4.scopeMetrics[i3]); } } if (object4.schemaUrl != null) @@ -423319,9 +346945,9 @@ var require_root = __commonJS((exports, module) => { function ScopeMetrics(properties) { this.metrics = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ScopeMetrics.prototype.scope = null; @@ -423336,8 +346962,8 @@ var require_root = __commonJS((exports, module) => { if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); if (message.metrics != null && message.metrics.length) - for (var i4 = 0;i4 < message.metrics.length; ++i4) - $root.opentelemetry.proto.metrics.v1.Metric.encode(message.metrics[i4], writer.uint32(18).fork()).ldelim(); + for (var i3 = 0;i3 < message.metrics.length; ++i3) + $root.opentelemetry.proto.metrics.v1.Metric.encode(message.metrics[i3], writer.uint32(18).fork()).ldelim(); if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); return writer; @@ -423382,17 +347008,17 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.scope != null && message.hasOwnProperty("scope")) { - var error45 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error45) - return "scope." + error45; + var error41 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error41) + return "scope." + error41; } if (message.metrics != null && message.hasOwnProperty("metrics")) { if (!Array.isArray(message.metrics)) return "metrics: array expected"; - for (var i4 = 0;i4 < message.metrics.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.Metric.verify(message.metrics[i4]); - if (error45) - return "metrics." + error45; + for (var i3 = 0;i3 < message.metrics.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.Metric.verify(message.metrics[i3]); + if (error41) + return "metrics." + error41; } } if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { @@ -423414,10 +347040,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.metrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected"); message.metrics = []; - for (var i4 = 0;i4 < object4.metrics.length; ++i4) { - if (typeof object4.metrics[i4] !== "object") + for (var i3 = 0;i3 < object4.metrics.length; ++i3) { + if (typeof object4.metrics[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected"); - message.metrics[i4] = $root.opentelemetry.proto.metrics.v1.Metric.fromObject(object4.metrics[i4]); + message.metrics[i3] = $root.opentelemetry.proto.metrics.v1.Metric.fromObject(object4.metrics[i3]); } } if (object4.schemaUrl != null) @@ -423459,9 +347085,9 @@ var require_root = __commonJS((exports, module) => { v1.Metric = function() { function Metric(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Metric.prototype.name = null; @@ -423574,9 +347200,9 @@ var require_root = __commonJS((exports, module) => { if (message.gauge != null && message.hasOwnProperty("gauge")) { properties.data = 1; { - var error45 = $root.opentelemetry.proto.metrics.v1.Gauge.verify(message.gauge); - if (error45) - return "gauge." + error45; + var error41 = $root.opentelemetry.proto.metrics.v1.Gauge.verify(message.gauge); + if (error41) + return "gauge." + error41; } } if (message.sum != null && message.hasOwnProperty("sum")) { @@ -423584,9 +347210,9 @@ var require_root = __commonJS((exports, module) => { return "data: multiple values"; properties.data = 1; { - var error45 = $root.opentelemetry.proto.metrics.v1.Sum.verify(message.sum); - if (error45) - return "sum." + error45; + var error41 = $root.opentelemetry.proto.metrics.v1.Sum.verify(message.sum); + if (error41) + return "sum." + error41; } } if (message.histogram != null && message.hasOwnProperty("histogram")) { @@ -423594,9 +347220,9 @@ var require_root = __commonJS((exports, module) => { return "data: multiple values"; properties.data = 1; { - var error45 = $root.opentelemetry.proto.metrics.v1.Histogram.verify(message.histogram); - if (error45) - return "histogram." + error45; + var error41 = $root.opentelemetry.proto.metrics.v1.Histogram.verify(message.histogram); + if (error41) + return "histogram." + error41; } } if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { @@ -423604,9 +347230,9 @@ var require_root = __commonJS((exports, module) => { return "data: multiple values"; properties.data = 1; { - var error45 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(message.exponentialHistogram); - if (error45) - return "exponentialHistogram." + error45; + var error41 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(message.exponentialHistogram); + if (error41) + return "exponentialHistogram." + error41; } } if (message.summary != null && message.hasOwnProperty("summary")) { @@ -423614,9 +347240,9 @@ var require_root = __commonJS((exports, module) => { return "data: multiple values"; properties.data = 1; { - var error45 = $root.opentelemetry.proto.metrics.v1.Summary.verify(message.summary); - if (error45) - return "summary." + error45; + var error41 = $root.opentelemetry.proto.metrics.v1.Summary.verify(message.summary); + if (error41) + return "summary." + error41; } } return null; @@ -423715,9 +347341,9 @@ var require_root = __commonJS((exports, module) => { function Gauge(properties) { this.dataPoints = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Gauge.prototype.dataPoints = $util.emptyArray; @@ -423728,8 +347354,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.dataPoints != null && message.dataPoints.length) - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) - $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) + $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i3], writer.uint32(10).fork()).ldelim(); return writer; }; Gauge.encodeDelimited = function encodeDelimited(message, writer) { @@ -423766,10 +347392,10 @@ var require_root = __commonJS((exports, module) => { if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i4]); - if (error45) - return "dataPoints." + error45; + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i3]); + if (error41) + return "dataPoints." + error41; } } return null; @@ -423782,10 +347408,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected"); message.dataPoints = []; - for (var i4 = 0;i4 < object4.dataPoints.length; ++i4) { - if (typeof object4.dataPoints[i4] !== "object") + for (var i3 = 0;i3 < object4.dataPoints.length; ++i3) { + if (typeof object4.dataPoints[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected"); - message.dataPoints[i4] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object4.dataPoints[i4]); + message.dataPoints[i3] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object4.dataPoints[i3]); } } return message; @@ -423818,9 +347444,9 @@ var require_root = __commonJS((exports, module) => { function Sum(properties) { this.dataPoints = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Sum.prototype.dataPoints = $util.emptyArray; @@ -423833,8 +347459,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.dataPoints != null && message.dataPoints.length) - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) - $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) + $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i3], writer.uint32(10).fork()).ldelim(); if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); if (message.isMonotonic != null && Object.hasOwnProperty.call(message, "isMonotonic")) @@ -423883,10 +347509,10 @@ var require_root = __commonJS((exports, module) => { if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i4]); - if (error45) - return "dataPoints." + error45; + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i3]); + if (error41) + return "dataPoints." + error41; } } if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) @@ -423912,10 +347538,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected"); message.dataPoints = []; - for (var i4 = 0;i4 < object4.dataPoints.length; ++i4) { - if (typeof object4.dataPoints[i4] !== "object") + for (var i3 = 0;i3 < object4.dataPoints.length; ++i3) { + if (typeof object4.dataPoints[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected"); - message.dataPoints[i4] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object4.dataPoints[i4]); + message.dataPoints[i3] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object4.dataPoints[i3]); } } switch (object4.aggregationTemporality) { @@ -423978,9 +347604,9 @@ var require_root = __commonJS((exports, module) => { function Histogram(properties) { this.dataPoints = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Histogram.prototype.dataPoints = $util.emptyArray; @@ -423992,8 +347618,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.dataPoints != null && message.dataPoints.length) - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) - $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(message.dataPoints[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) + $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(message.dataPoints[i3], writer.uint32(10).fork()).ldelim(); if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); return writer; @@ -424036,10 +347662,10 @@ var require_root = __commonJS((exports, module) => { if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(message.dataPoints[i4]); - if (error45) - return "dataPoints." + error45; + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(message.dataPoints[i3]); + if (error41) + return "dataPoints." + error41; } } if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) @@ -424061,10 +347687,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected"); message.dataPoints = []; - for (var i4 = 0;i4 < object4.dataPoints.length; ++i4) { - if (typeof object4.dataPoints[i4] !== "object") + for (var i3 = 0;i3 < object4.dataPoints.length; ++i3) { + if (typeof object4.dataPoints[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected"); - message.dataPoints[i4] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(object4.dataPoints[i4]); + message.dataPoints[i3] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(object4.dataPoints[i3]); } } switch (object4.aggregationTemporality) { @@ -424121,9 +347747,9 @@ var require_root = __commonJS((exports, module) => { function ExponentialHistogram(properties) { this.dataPoints = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExponentialHistogram.prototype.dataPoints = $util.emptyArray; @@ -424135,8 +347761,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.dataPoints != null && message.dataPoints.length) - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) - $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(message.dataPoints[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) + $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(message.dataPoints[i3], writer.uint32(10).fork()).ldelim(); if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); return writer; @@ -424179,10 +347805,10 @@ var require_root = __commonJS((exports, module) => { if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(message.dataPoints[i4]); - if (error45) - return "dataPoints." + error45; + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(message.dataPoints[i3]); + if (error41) + return "dataPoints." + error41; } } if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) @@ -424204,10 +347830,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected"); message.dataPoints = []; - for (var i4 = 0;i4 < object4.dataPoints.length; ++i4) { - if (typeof object4.dataPoints[i4] !== "object") + for (var i3 = 0;i3 < object4.dataPoints.length; ++i3) { + if (typeof object4.dataPoints[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected"); - message.dataPoints[i4] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(object4.dataPoints[i4]); + message.dataPoints[i3] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(object4.dataPoints[i3]); } } switch (object4.aggregationTemporality) { @@ -424264,9 +347890,9 @@ var require_root = __commonJS((exports, module) => { function Summary(properties) { this.dataPoints = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Summary.prototype.dataPoints = $util.emptyArray; @@ -424277,8 +347903,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.dataPoints != null && message.dataPoints.length) - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) - $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(message.dataPoints[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) + $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(message.dataPoints[i3], writer.uint32(10).fork()).ldelim(); return writer; }; Summary.encodeDelimited = function encodeDelimited(message, writer) { @@ -424315,10 +347941,10 @@ var require_root = __commonJS((exports, module) => { if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i4 = 0;i4 < message.dataPoints.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(message.dataPoints[i4]); - if (error45) - return "dataPoints." + error45; + for (var i3 = 0;i3 < message.dataPoints.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(message.dataPoints[i3]); + if (error41) + return "dataPoints." + error41; } } return null; @@ -424331,10 +347957,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected"); message.dataPoints = []; - for (var i4 = 0;i4 < object4.dataPoints.length; ++i4) { - if (typeof object4.dataPoints[i4] !== "object") + for (var i3 = 0;i3 < object4.dataPoints.length; ++i3) { + if (typeof object4.dataPoints[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected"); - message.dataPoints[i4] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(object4.dataPoints[i4]); + message.dataPoints[i3] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(object4.dataPoints[i3]); } } return message; @@ -424364,26 +347990,26 @@ var require_root = __commonJS((exports, module) => { return Summary; }(); v1.AggregationTemporality = function() { - var valuesById = {}, values4 = Object.create(valuesById); - values4[valuesById[0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0; - values4[valuesById[1] = "AGGREGATION_TEMPORALITY_DELTA"] = 1; - values4[valuesById[2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2; - return values4; + var valuesById = {}, values2 = Object.create(valuesById); + values2[valuesById[0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0; + values2[valuesById[1] = "AGGREGATION_TEMPORALITY_DELTA"] = 1; + values2[valuesById[2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2; + return values2; }(); v1.DataPointFlags = function() { - var valuesById = {}, values4 = Object.create(valuesById); - values4[valuesById[0] = "DATA_POINT_FLAGS_DO_NOT_USE"] = 0; - values4[valuesById[1] = "DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"] = 1; - return values4; + var valuesById = {}, values2 = Object.create(valuesById); + values2[valuesById[0] = "DATA_POINT_FLAGS_DO_NOT_USE"] = 0; + values2[valuesById[1] = "DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"] = 1; + return values2; }(); v1.NumberDataPoint = function() { function NumberDataPoint(properties) { this.attributes = []; this.exemplars = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } NumberDataPoint.prototype.attributes = $util.emptyArray; @@ -424411,13 +348037,13 @@ var require_root = __commonJS((exports, module) => { if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) writer.uint32(33).double(message.asDouble); if (message.exemplars != null && message.exemplars.length) - for (var i4 = 0;i4 < message.exemplars.length; ++i4) - $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i4], writer.uint32(42).fork()).ldelim(); + for (var i3 = 0;i3 < message.exemplars.length; ++i3) + $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i3], writer.uint32(42).fork()).ldelim(); if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) writer.uint32(49).sfixed64(message.asInt); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(58).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(58).fork()).ldelim(); if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(64).uint32(message.flags); return writer; @@ -424483,10 +348109,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { @@ -424512,10 +348138,10 @@ var require_root = __commonJS((exports, module) => { if (message.exemplars != null && message.hasOwnProperty("exemplars")) { if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i4 = 0;i4 < message.exemplars.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i4]); - if (error45) - return "exemplars." + error45; + for (var i3 = 0;i3 < message.exemplars.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i3]); + if (error41) + return "exemplars." + error41; } } if (message.flags != null && message.hasOwnProperty("flags")) { @@ -424532,10 +348158,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.startTimeUnixNano != null) { @@ -424574,10 +348200,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected"); message.exemplars = []; - for (var i4 = 0;i4 < object4.exemplars.length; ++i4) { - if (typeof object4.exemplars[i4] !== "object") + for (var i3 = 0;i3 < object4.exemplars.length; ++i3) { + if (typeof object4.exemplars[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected"); - message.exemplars[i4] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object4.exemplars[i4]); + message.exemplars[i3] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object4.exemplars[i3]); } } if (object4.flags != null) @@ -424660,9 +348286,9 @@ var require_root = __commonJS((exports, module) => { this.explicitBounds = []; this.exemplars = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } HistogramDataPoint.prototype.attributes = $util.emptyArray; @@ -424705,22 +348331,22 @@ var require_root = __commonJS((exports, module) => { writer.uint32(41).double(message.sum); if (message.bucketCounts != null && message.bucketCounts.length) { writer.uint32(50).fork(); - for (var i4 = 0;i4 < message.bucketCounts.length; ++i4) - writer.fixed64(message.bucketCounts[i4]); + for (var i3 = 0;i3 < message.bucketCounts.length; ++i3) + writer.fixed64(message.bucketCounts[i3]); writer.ldelim(); } if (message.explicitBounds != null && message.explicitBounds.length) { writer.uint32(58).fork(); - for (var i4 = 0;i4 < message.explicitBounds.length; ++i4) - writer.double(message.explicitBounds[i4]); + for (var i3 = 0;i3 < message.explicitBounds.length; ++i3) + writer.double(message.explicitBounds[i3]); writer.ldelim(); } if (message.exemplars != null && message.exemplars.length) - for (var i4 = 0;i4 < message.exemplars.length; ++i4) - $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i4], writer.uint32(66).fork()).ldelim(); + for (var i3 = 0;i3 < message.exemplars.length; ++i3) + $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i3], writer.uint32(66).fork()).ldelim(); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(74).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(74).fork()).ldelim(); if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(80).uint32(message.flags); if (message.min != null && Object.hasOwnProperty.call(message, "min")) @@ -424820,10 +348446,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { @@ -424846,24 +348472,24 @@ var require_root = __commonJS((exports, module) => { if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; - for (var i4 = 0;i4 < message.bucketCounts.length; ++i4) - if (!$util.isInteger(message.bucketCounts[i4]) && !(message.bucketCounts[i4] && $util.isInteger(message.bucketCounts[i4].low) && $util.isInteger(message.bucketCounts[i4].high))) + for (var i3 = 0;i3 < message.bucketCounts.length; ++i3) + if (!$util.isInteger(message.bucketCounts[i3]) && !(message.bucketCounts[i3] && $util.isInteger(message.bucketCounts[i3].low) && $util.isInteger(message.bucketCounts[i3].high))) return "bucketCounts: integer|Long[] expected"; } if (message.explicitBounds != null && message.hasOwnProperty("explicitBounds")) { if (!Array.isArray(message.explicitBounds)) return "explicitBounds: array expected"; - for (var i4 = 0;i4 < message.explicitBounds.length; ++i4) - if (typeof message.explicitBounds[i4] !== "number") + for (var i3 = 0;i3 < message.explicitBounds.length; ++i3) + if (typeof message.explicitBounds[i3] !== "number") return "explicitBounds: number[] expected"; } if (message.exemplars != null && message.hasOwnProperty("exemplars")) { if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i4 = 0;i4 < message.exemplars.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i4]); - if (error45) - return "exemplars." + error45; + for (var i3 = 0;i3 < message.exemplars.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i3]); + if (error41) + return "exemplars." + error41; } } if (message.flags != null && message.hasOwnProperty("flags")) { @@ -424890,10 +348516,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.startTimeUnixNano != null) { @@ -424932,31 +348558,31 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected"); message.bucketCounts = []; - for (var i4 = 0;i4 < object4.bucketCounts.length; ++i4) + for (var i3 = 0;i3 < object4.bucketCounts.length; ++i3) if ($util.Long) - (message.bucketCounts[i4] = $util.Long.fromValue(object4.bucketCounts[i4])).unsigned = false; - else if (typeof object4.bucketCounts[i4] === "string") - message.bucketCounts[i4] = parseInt(object4.bucketCounts[i4], 10); - else if (typeof object4.bucketCounts[i4] === "number") - message.bucketCounts[i4] = object4.bucketCounts[i4]; - else if (typeof object4.bucketCounts[i4] === "object") - message.bucketCounts[i4] = new $util.LongBits(object4.bucketCounts[i4].low >>> 0, object4.bucketCounts[i4].high >>> 0).toNumber(); + (message.bucketCounts[i3] = $util.Long.fromValue(object4.bucketCounts[i3])).unsigned = false; + else if (typeof object4.bucketCounts[i3] === "string") + message.bucketCounts[i3] = parseInt(object4.bucketCounts[i3], 10); + else if (typeof object4.bucketCounts[i3] === "number") + message.bucketCounts[i3] = object4.bucketCounts[i3]; + else if (typeof object4.bucketCounts[i3] === "object") + message.bucketCounts[i3] = new $util.LongBits(object4.bucketCounts[i3].low >>> 0, object4.bucketCounts[i3].high >>> 0).toNumber(); } if (object4.explicitBounds) { if (!Array.isArray(object4.explicitBounds)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected"); message.explicitBounds = []; - for (var i4 = 0;i4 < object4.explicitBounds.length; ++i4) - message.explicitBounds[i4] = Number(object4.explicitBounds[i4]); + for (var i3 = 0;i3 < object4.explicitBounds.length; ++i3) + message.explicitBounds[i3] = Number(object4.explicitBounds[i3]); } if (object4.exemplars) { if (!Array.isArray(object4.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected"); message.exemplars = []; - for (var i4 = 0;i4 < object4.exemplars.length; ++i4) { - if (typeof object4.exemplars[i4] !== "object") + for (var i3 = 0;i3 < object4.exemplars.length; ++i3) { + if (typeof object4.exemplars[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected"); - message.exemplars[i4] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object4.exemplars[i4]); + message.exemplars[i3] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object4.exemplars[i3]); } } if (object4.flags != null) @@ -425068,9 +348694,9 @@ var require_root = __commonJS((exports, module) => { this.attributes = []; this.exemplars = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ExponentialHistogramDataPoint.prototype.attributes = $util.emptyArray; @@ -425107,8 +348733,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(10).fork()).ldelim(); if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) @@ -425128,8 +348754,8 @@ var require_root = __commonJS((exports, module) => { if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(80).uint32(message.flags); if (message.exemplars != null && message.exemplars.length) - for (var i4 = 0;i4 < message.exemplars.length; ++i4) - $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i4], writer.uint32(90).fork()).ldelim(); + for (var i3 = 0;i3 < message.exemplars.length; ++i3) + $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i3], writer.uint32(90).fork()).ldelim(); if (message.min != null && Object.hasOwnProperty.call(message, "min")) writer.uint32(97).double(message.min); if (message.max != null && Object.hasOwnProperty.call(message, "max")) @@ -425227,10 +348853,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { @@ -425259,14 +348885,14 @@ var require_root = __commonJS((exports, module) => { return "zeroCount: integer|Long expected"; } if (message.positive != null && message.hasOwnProperty("positive")) { - var error45 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.positive); - if (error45) - return "positive." + error45; + var error41 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.positive); + if (error41) + return "positive." + error41; } if (message.negative != null && message.hasOwnProperty("negative")) { - var error45 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.negative); - if (error45) - return "negative." + error45; + var error41 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.negative); + if (error41) + return "negative." + error41; } if (message.flags != null && message.hasOwnProperty("flags")) { if (!$util.isInteger(message.flags)) @@ -425275,10 +348901,10 @@ var require_root = __commonJS((exports, module) => { if (message.exemplars != null && message.hasOwnProperty("exemplars")) { if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i4 = 0;i4 < message.exemplars.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i4]); - if (error45) - return "exemplars." + error45; + for (var i3 = 0;i3 < message.exemplars.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i3]); + if (error41) + return "exemplars." + error41; } } if (message.min != null && message.hasOwnProperty("min")) { @@ -425305,10 +348931,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.startTimeUnixNano != null) { @@ -425371,10 +348997,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected"); message.exemplars = []; - for (var i4 = 0;i4 < object4.exemplars.length; ++i4) { - if (typeof object4.exemplars[i4] !== "object") + for (var i3 = 0;i3 < object4.exemplars.length; ++i3) { + if (typeof object4.exemplars[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected"); - message.exemplars[i4] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object4.exemplars[i4]); + message.exemplars[i3] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object4.exemplars[i3]); } } if (object4.min != null) @@ -425490,9 +349116,9 @@ var require_root = __commonJS((exports, module) => { function Buckets(properties) { this.bucketCounts = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Buckets.prototype.offset = null; @@ -425507,8 +349133,8 @@ var require_root = __commonJS((exports, module) => { writer.uint32(8).sint32(message.offset); if (message.bucketCounts != null && message.bucketCounts.length) { writer.uint32(18).fork(); - for (var i4 = 0;i4 < message.bucketCounts.length; ++i4) - writer.uint64(message.bucketCounts[i4]); + for (var i3 = 0;i3 < message.bucketCounts.length; ++i3) + writer.uint64(message.bucketCounts[i3]); writer.ldelim(); } return writer; @@ -425560,8 +349186,8 @@ var require_root = __commonJS((exports, module) => { if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; - for (var i4 = 0;i4 < message.bucketCounts.length; ++i4) - if (!$util.isInteger(message.bucketCounts[i4]) && !(message.bucketCounts[i4] && $util.isInteger(message.bucketCounts[i4].low) && $util.isInteger(message.bucketCounts[i4].high))) + for (var i3 = 0;i3 < message.bucketCounts.length; ++i3) + if (!$util.isInteger(message.bucketCounts[i3]) && !(message.bucketCounts[i3] && $util.isInteger(message.bucketCounts[i3].low) && $util.isInteger(message.bucketCounts[i3].high))) return "bucketCounts: integer|Long[] expected"; } return null; @@ -425576,15 +349202,15 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected"); message.bucketCounts = []; - for (var i4 = 0;i4 < object4.bucketCounts.length; ++i4) + for (var i3 = 0;i3 < object4.bucketCounts.length; ++i3) if ($util.Long) - (message.bucketCounts[i4] = $util.Long.fromValue(object4.bucketCounts[i4])).unsigned = true; - else if (typeof object4.bucketCounts[i4] === "string") - message.bucketCounts[i4] = parseInt(object4.bucketCounts[i4], 10); - else if (typeof object4.bucketCounts[i4] === "number") - message.bucketCounts[i4] = object4.bucketCounts[i4]; - else if (typeof object4.bucketCounts[i4] === "object") - message.bucketCounts[i4] = new $util.LongBits(object4.bucketCounts[i4].low >>> 0, object4.bucketCounts[i4].high >>> 0).toNumber(true); + (message.bucketCounts[i3] = $util.Long.fromValue(object4.bucketCounts[i3])).unsigned = true; + else if (typeof object4.bucketCounts[i3] === "string") + message.bucketCounts[i3] = parseInt(object4.bucketCounts[i3], 10); + else if (typeof object4.bucketCounts[i3] === "number") + message.bucketCounts[i3] = object4.bucketCounts[i3]; + else if (typeof object4.bucketCounts[i3] === "object") + message.bucketCounts[i3] = new $util.LongBits(object4.bucketCounts[i3].low >>> 0, object4.bucketCounts[i3].high >>> 0).toNumber(true); } return message; }; @@ -425626,9 +349252,9 @@ var require_root = __commonJS((exports, module) => { this.attributes = []; this.quantileValues = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } SummaryDataPoint.prototype.attributes = $util.emptyArray; @@ -425653,11 +349279,11 @@ var require_root = __commonJS((exports, module) => { if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); if (message.quantileValues != null && message.quantileValues.length) - for (var i4 = 0;i4 < message.quantileValues.length; ++i4) - $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(message.quantileValues[i4], writer.uint32(50).fork()).ldelim(); + for (var i3 = 0;i3 < message.quantileValues.length; ++i3) + $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(message.quantileValues[i3], writer.uint32(50).fork()).ldelim(); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(58).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(58).fork()).ldelim(); if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(64).uint32(message.flags); return writer; @@ -425722,10 +349348,10 @@ var require_root = __commonJS((exports, module) => { if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { @@ -425747,10 +349373,10 @@ var require_root = __commonJS((exports, module) => { if (message.quantileValues != null && message.hasOwnProperty("quantileValues")) { if (!Array.isArray(message.quantileValues)) return "quantileValues: array expected"; - for (var i4 = 0;i4 < message.quantileValues.length; ++i4) { - var error45 = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(message.quantileValues[i4]); - if (error45) - return "quantileValues." + error45; + for (var i3 = 0;i3 < message.quantileValues.length; ++i3) { + var error41 = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(message.quantileValues[i3]); + if (error41) + return "quantileValues." + error41; } } if (message.flags != null && message.hasOwnProperty("flags")) { @@ -425767,10 +349393,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.startTimeUnixNano != null) { @@ -425809,10 +349435,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.quantileValues)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected"); message.quantileValues = []; - for (var i4 = 0;i4 < object4.quantileValues.length; ++i4) { - if (typeof object4.quantileValues[i4] !== "object") + for (var i3 = 0;i3 < object4.quantileValues.length; ++i3) { + if (typeof object4.quantileValues[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected"); - message.quantileValues[i4] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(object4.quantileValues[i4]); + message.quantileValues[i3] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(object4.quantileValues[i3]); } } if (object4.flags != null) @@ -425889,9 +349515,9 @@ var require_root = __commonJS((exports, module) => { SummaryDataPoint.ValueAtQuantile = function() { function ValueAtQuantile(properties) { if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ValueAtQuantile.prototype.quantile = null; @@ -425992,9 +349618,9 @@ var require_root = __commonJS((exports, module) => { function Exemplar(properties) { this.filteredAttributes = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } Exemplar.prototype.filteredAttributes = $util.emptyArray; @@ -426025,8 +349651,8 @@ var require_root = __commonJS((exports, module) => { if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) writer.uint32(49).sfixed64(message.asInt); if (message.filteredAttributes != null && message.filteredAttributes.length) - for (var i4 = 0;i4 < message.filteredAttributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.filteredAttributes[i4], writer.uint32(58).fork()).ldelim(); + for (var i3 = 0;i3 < message.filteredAttributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.filteredAttributes[i3], writer.uint32(58).fork()).ldelim(); return writer; }; Exemplar.encodeDelimited = function encodeDelimited(message, writer) { @@ -426084,10 +349710,10 @@ var require_root = __commonJS((exports, module) => { if (message.filteredAttributes != null && message.hasOwnProperty("filteredAttributes")) { if (!Array.isArray(message.filteredAttributes)) return "filteredAttributes: array expected"; - for (var i4 = 0;i4 < message.filteredAttributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.filteredAttributes[i4]); - if (error45) - return "filteredAttributes." + error45; + for (var i3 = 0;i3 < message.filteredAttributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.filteredAttributes[i3]); + if (error41) + return "filteredAttributes." + error41; } } if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { @@ -426124,10 +349750,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.filteredAttributes)) throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected"); message.filteredAttributes = []; - for (var i4 = 0;i4 < object4.filteredAttributes.length; ++i4) { - if (typeof object4.filteredAttributes[i4] !== "object") + for (var i3 = 0;i3 < object4.filteredAttributes.length; ++i3) { + if (typeof object4.filteredAttributes[i3] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected"); - message.filteredAttributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.filteredAttributes[i4]); + message.filteredAttributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.filteredAttributes[i3]); } } if (object4.timeUnixNano != null) { @@ -426245,9 +349871,9 @@ var require_root = __commonJS((exports, module) => { function LogsData(properties) { this.resourceLogs = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } LogsData.prototype.resourceLogs = $util.emptyArray; @@ -426258,8 +349884,8 @@ var require_root = __commonJS((exports, module) => { if (!writer) writer = $Writer.create(); if (message.resourceLogs != null && message.resourceLogs.length) - for (var i4 = 0;i4 < message.resourceLogs.length; ++i4) - $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i4], writer.uint32(10).fork()).ldelim(); + for (var i3 = 0;i3 < message.resourceLogs.length; ++i3) + $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i3], writer.uint32(10).fork()).ldelim(); return writer; }; LogsData.encodeDelimited = function encodeDelimited(message, writer) { @@ -426296,10 +349922,10 @@ var require_root = __commonJS((exports, module) => { if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { if (!Array.isArray(message.resourceLogs)) return "resourceLogs: array expected"; - for (var i4 = 0;i4 < message.resourceLogs.length; ++i4) { - var error45 = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i4]); - if (error45) - return "resourceLogs." + error45; + for (var i3 = 0;i3 < message.resourceLogs.length; ++i3) { + var error41 = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i3]); + if (error41) + return "resourceLogs." + error41; } } return null; @@ -426312,10 +349938,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.resourceLogs)) throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected"); message.resourceLogs = []; - for (var i4 = 0;i4 < object4.resourceLogs.length; ++i4) { - if (typeof object4.resourceLogs[i4] !== "object") + for (var i3 = 0;i3 < object4.resourceLogs.length; ++i3) { + if (typeof object4.resourceLogs[i3] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected"); - message.resourceLogs[i4] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object4.resourceLogs[i4]); + message.resourceLogs[i3] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object4.resourceLogs[i3]); } } return message; @@ -426348,9 +349974,9 @@ var require_root = __commonJS((exports, module) => { function ResourceLogs(properties) { this.scopeLogs = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ResourceLogs.prototype.resource = null; @@ -426365,8 +349991,8 @@ var require_root = __commonJS((exports, module) => { if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); if (message.scopeLogs != null && message.scopeLogs.length) - for (var i4 = 0;i4 < message.scopeLogs.length; ++i4) - $root.opentelemetry.proto.logs.v1.ScopeLogs.encode(message.scopeLogs[i4], writer.uint32(18).fork()).ldelim(); + for (var i3 = 0;i3 < message.scopeLogs.length; ++i3) + $root.opentelemetry.proto.logs.v1.ScopeLogs.encode(message.scopeLogs[i3], writer.uint32(18).fork()).ldelim(); if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); return writer; @@ -426411,17 +350037,17 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.resource != null && message.hasOwnProperty("resource")) { - var error45 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error45) - return "resource." + error45; + var error41 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error41) + return "resource." + error41; } if (message.scopeLogs != null && message.hasOwnProperty("scopeLogs")) { if (!Array.isArray(message.scopeLogs)) return "scopeLogs: array expected"; - for (var i4 = 0;i4 < message.scopeLogs.length; ++i4) { - var error45 = $root.opentelemetry.proto.logs.v1.ScopeLogs.verify(message.scopeLogs[i4]); - if (error45) - return "scopeLogs." + error45; + for (var i3 = 0;i3 < message.scopeLogs.length; ++i3) { + var error41 = $root.opentelemetry.proto.logs.v1.ScopeLogs.verify(message.scopeLogs[i3]); + if (error41) + return "scopeLogs." + error41; } } if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { @@ -426443,10 +350069,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.scopeLogs)) throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected"); message.scopeLogs = []; - for (var i4 = 0;i4 < object4.scopeLogs.length; ++i4) { - if (typeof object4.scopeLogs[i4] !== "object") + for (var i3 = 0;i3 < object4.scopeLogs.length; ++i3) { + if (typeof object4.scopeLogs[i3] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected"); - message.scopeLogs[i4] = $root.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(object4.scopeLogs[i4]); + message.scopeLogs[i3] = $root.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(object4.scopeLogs[i3]); } } if (object4.schemaUrl != null) @@ -426489,9 +350115,9 @@ var require_root = __commonJS((exports, module) => { function ScopeLogs(properties) { this.logRecords = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } ScopeLogs.prototype.scope = null; @@ -426506,8 +350132,8 @@ var require_root = __commonJS((exports, module) => { if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); if (message.logRecords != null && message.logRecords.length) - for (var i4 = 0;i4 < message.logRecords.length; ++i4) - $root.opentelemetry.proto.logs.v1.LogRecord.encode(message.logRecords[i4], writer.uint32(18).fork()).ldelim(); + for (var i3 = 0;i3 < message.logRecords.length; ++i3) + $root.opentelemetry.proto.logs.v1.LogRecord.encode(message.logRecords[i3], writer.uint32(18).fork()).ldelim(); if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); return writer; @@ -426552,17 +350178,17 @@ var require_root = __commonJS((exports, module) => { if (typeof message !== "object" || message === null) return "object expected"; if (message.scope != null && message.hasOwnProperty("scope")) { - var error45 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error45) - return "scope." + error45; + var error41 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error41) + return "scope." + error41; } if (message.logRecords != null && message.hasOwnProperty("logRecords")) { if (!Array.isArray(message.logRecords)) return "logRecords: array expected"; - for (var i4 = 0;i4 < message.logRecords.length; ++i4) { - var error45 = $root.opentelemetry.proto.logs.v1.LogRecord.verify(message.logRecords[i4]); - if (error45) - return "logRecords." + error45; + for (var i3 = 0;i3 < message.logRecords.length; ++i3) { + var error41 = $root.opentelemetry.proto.logs.v1.LogRecord.verify(message.logRecords[i3]); + if (error41) + return "logRecords." + error41; } } if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { @@ -426584,10 +350210,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.logRecords)) throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected"); message.logRecords = []; - for (var i4 = 0;i4 < object4.logRecords.length; ++i4) { - if (typeof object4.logRecords[i4] !== "object") + for (var i3 = 0;i3 < object4.logRecords.length; ++i3) { + if (typeof object4.logRecords[i3] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected"); - message.logRecords[i4] = $root.opentelemetry.proto.logs.v1.LogRecord.fromObject(object4.logRecords[i4]); + message.logRecords[i3] = $root.opentelemetry.proto.logs.v1.LogRecord.fromObject(object4.logRecords[i3]); } } if (object4.schemaUrl != null) @@ -426627,47 +350253,47 @@ var require_root = __commonJS((exports, module) => { return ScopeLogs; }(); v1.SeverityNumber = function() { - var valuesById = {}, values4 = Object.create(valuesById); - values4[valuesById[0] = "SEVERITY_NUMBER_UNSPECIFIED"] = 0; - values4[valuesById[1] = "SEVERITY_NUMBER_TRACE"] = 1; - values4[valuesById[2] = "SEVERITY_NUMBER_TRACE2"] = 2; - values4[valuesById[3] = "SEVERITY_NUMBER_TRACE3"] = 3; - values4[valuesById[4] = "SEVERITY_NUMBER_TRACE4"] = 4; - values4[valuesById[5] = "SEVERITY_NUMBER_DEBUG"] = 5; - values4[valuesById[6] = "SEVERITY_NUMBER_DEBUG2"] = 6; - values4[valuesById[7] = "SEVERITY_NUMBER_DEBUG3"] = 7; - values4[valuesById[8] = "SEVERITY_NUMBER_DEBUG4"] = 8; - values4[valuesById[9] = "SEVERITY_NUMBER_INFO"] = 9; - values4[valuesById[10] = "SEVERITY_NUMBER_INFO2"] = 10; - values4[valuesById[11] = "SEVERITY_NUMBER_INFO3"] = 11; - values4[valuesById[12] = "SEVERITY_NUMBER_INFO4"] = 12; - values4[valuesById[13] = "SEVERITY_NUMBER_WARN"] = 13; - values4[valuesById[14] = "SEVERITY_NUMBER_WARN2"] = 14; - values4[valuesById[15] = "SEVERITY_NUMBER_WARN3"] = 15; - values4[valuesById[16] = "SEVERITY_NUMBER_WARN4"] = 16; - values4[valuesById[17] = "SEVERITY_NUMBER_ERROR"] = 17; - values4[valuesById[18] = "SEVERITY_NUMBER_ERROR2"] = 18; - values4[valuesById[19] = "SEVERITY_NUMBER_ERROR3"] = 19; - values4[valuesById[20] = "SEVERITY_NUMBER_ERROR4"] = 20; - values4[valuesById[21] = "SEVERITY_NUMBER_FATAL"] = 21; - values4[valuesById[22] = "SEVERITY_NUMBER_FATAL2"] = 22; - values4[valuesById[23] = "SEVERITY_NUMBER_FATAL3"] = 23; - values4[valuesById[24] = "SEVERITY_NUMBER_FATAL4"] = 24; - return values4; + var valuesById = {}, values2 = Object.create(valuesById); + values2[valuesById[0] = "SEVERITY_NUMBER_UNSPECIFIED"] = 0; + values2[valuesById[1] = "SEVERITY_NUMBER_TRACE"] = 1; + values2[valuesById[2] = "SEVERITY_NUMBER_TRACE2"] = 2; + values2[valuesById[3] = "SEVERITY_NUMBER_TRACE3"] = 3; + values2[valuesById[4] = "SEVERITY_NUMBER_TRACE4"] = 4; + values2[valuesById[5] = "SEVERITY_NUMBER_DEBUG"] = 5; + values2[valuesById[6] = "SEVERITY_NUMBER_DEBUG2"] = 6; + values2[valuesById[7] = "SEVERITY_NUMBER_DEBUG3"] = 7; + values2[valuesById[8] = "SEVERITY_NUMBER_DEBUG4"] = 8; + values2[valuesById[9] = "SEVERITY_NUMBER_INFO"] = 9; + values2[valuesById[10] = "SEVERITY_NUMBER_INFO2"] = 10; + values2[valuesById[11] = "SEVERITY_NUMBER_INFO3"] = 11; + values2[valuesById[12] = "SEVERITY_NUMBER_INFO4"] = 12; + values2[valuesById[13] = "SEVERITY_NUMBER_WARN"] = 13; + values2[valuesById[14] = "SEVERITY_NUMBER_WARN2"] = 14; + values2[valuesById[15] = "SEVERITY_NUMBER_WARN3"] = 15; + values2[valuesById[16] = "SEVERITY_NUMBER_WARN4"] = 16; + values2[valuesById[17] = "SEVERITY_NUMBER_ERROR"] = 17; + values2[valuesById[18] = "SEVERITY_NUMBER_ERROR2"] = 18; + values2[valuesById[19] = "SEVERITY_NUMBER_ERROR3"] = 19; + values2[valuesById[20] = "SEVERITY_NUMBER_ERROR4"] = 20; + values2[valuesById[21] = "SEVERITY_NUMBER_FATAL"] = 21; + values2[valuesById[22] = "SEVERITY_NUMBER_FATAL2"] = 22; + values2[valuesById[23] = "SEVERITY_NUMBER_FATAL3"] = 23; + values2[valuesById[24] = "SEVERITY_NUMBER_FATAL4"] = 24; + return values2; }(); v1.LogRecordFlags = function() { - var valuesById = {}, values4 = Object.create(valuesById); - values4[valuesById[0] = "LOG_RECORD_FLAGS_DO_NOT_USE"] = 0; - values4[valuesById[255] = "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"] = 255; - return values4; + var valuesById = {}, values2 = Object.create(valuesById); + values2[valuesById[0] = "LOG_RECORD_FLAGS_DO_NOT_USE"] = 0; + values2[valuesById[255] = "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"] = 255; + return values2; }(); v1.LogRecord = function() { function LogRecord(properties) { this.attributes = []; if (properties) { - for (var keys3 = Object.keys(properties), i4 = 0;i4 < keys3.length; ++i4) - if (properties[keys3[i4]] != null) - this[keys3[i4]] = properties[keys3[i4]]; + for (var keys2 = Object.keys(properties), i3 = 0;i3 < keys2.length; ++i3) + if (properties[keys2[i3]] != null) + this[keys2[i3]] = properties[keys2[i3]]; } } LogRecord.prototype.timeUnixNano = null; @@ -426695,8 +350321,8 @@ var require_root = __commonJS((exports, module) => { if (message.body != null && Object.hasOwnProperty.call(message, "body")) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.body, writer.uint32(42).fork()).ldelim(); if (message.attributes != null && message.attributes.length) - for (var i4 = 0;i4 < message.attributes.length; ++i4) - $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i4], writer.uint32(50).fork()).ldelim(); + for (var i3 = 0;i3 < message.attributes.length; ++i3) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i3], writer.uint32(50).fork()).ldelim(); if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(56).uint32(message.droppedAttributesCount); if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) @@ -426820,17 +350446,17 @@ var require_root = __commonJS((exports, module) => { return "severityText: string expected"; } if (message.body != null && message.hasOwnProperty("body")) { - var error45 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.body); - if (error45) - return "body." + error45; + var error41 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.body); + if (error41) + return "body." + error41; } if (message.attributes != null && message.hasOwnProperty("attributes")) { if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i4 = 0;i4 < message.attributes.length; ++i4) { - var error45 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i4]); - if (error45) - return "attributes." + error45; + for (var i3 = 0;i3 < message.attributes.length; ++i3) { + var error41 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i3]); + if (error41) + return "attributes." + error41; } } if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { @@ -426994,10 +350620,10 @@ var require_root = __commonJS((exports, module) => { if (!Array.isArray(object4.attributes)) throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected"); message.attributes = []; - for (var i4 = 0;i4 < object4.attributes.length; ++i4) { - if (typeof object4.attributes[i4] !== "object") + for (var i3 = 0;i3 < object4.attributes.length; ++i3) { + if (typeof object4.attributes[i3] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected"); - message.attributes[i4] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i4]); + message.attributes[i3] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object4.attributes[i3]); } } if (object4.droppedAttributesCount != null) @@ -427109,10 +350735,10 @@ var require_root = __commonJS((exports, module) => { }); // node_modules/@opentelemetry/otlp-transformer/build/src/common/utils.js -var require_utils16 = __commonJS((exports) => { +var require_utils15 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getOtlpEncoder = exports.encodeAsString = exports.encodeAsLongBits = exports.toLongBits = exports.hrTimeToNanos = undefined; - var core_1 = require_src16(); + var core_1 = require_src10(); function hrTimeToNanos(hrTime) { const NANOSECONDS = BigInt(1e9); return BigInt(hrTime[0]) * NANOSECONDS + BigInt(hrTime[1]); @@ -427135,7 +350761,7 @@ var require_utils16 = __commonJS((exports) => { } exports.encodeAsString = encodeAsString; var encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : core_1.hrTimeToNanoseconds; - function identity5(value) { + function identity4(value) { return value; } function optionalHexToBinary(str) { @@ -427149,16 +350775,16 @@ var require_utils16 = __commonJS((exports) => { encodeOptionalSpanContext: optionalHexToBinary }; function getOtlpEncoder(options2) { - var _a5, _b3; + var _a3, _b2; if (options2 === undefined) { return DEFAULT_ENCODER; } - const useLongBits = (_a5 = options2.useLongBits) !== null && _a5 !== undefined ? _a5 : true; - const useHex = (_b3 = options2.useHex) !== null && _b3 !== undefined ? _b3 : false; + const useLongBits = (_a3 = options2.useLongBits) !== null && _a3 !== undefined ? _a3 : true; + const useHex = (_b2 = options2.useHex) !== null && _b2 !== undefined ? _b2 : false; return { encodeHrTime: useLongBits ? encodeAsLongBits : encodeTimestamp, - encodeSpanContext: useHex ? identity5 : core_1.hexToBinary, - encodeOptionalSpanContext: useHex ? identity5 : optionalHexToBinary + encodeSpanContext: useHex ? identity4 : core_1.hexToBinary, + encodeOptionalSpanContext: useHex ? identity4 : optionalHexToBinary }; } exports.getOtlpEncoder = getOtlpEncoder; @@ -427223,7 +350849,7 @@ var require_internal = __commonJS((exports) => { var require_internal2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.toLogAttributes = exports.createExportLogsServiceRequest = undefined; - var utils_1 = require_utils16(); + var utils_1 = require_utils15(); var internal_1 = require_internal(); function createExportLogsServiceRequest(logRecords, options2) { const encoder = (0, utils_1.getOtlpEncoder)(options2); @@ -427258,26 +350884,26 @@ var require_internal2 = __commonJS((exports) => { scopeLogs: Array.from(ismMap, ([, scopeLogs]) => { return { scope: (0, internal_1.createInstrumentationScope)(scopeLogs[0].instrumentationScope), - logRecords: scopeLogs.map((log2) => toLogRecord(log2, encoder)), + logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)), schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl }; }), schemaUrl: undefined })); } - function toLogRecord(log2, encoder) { - var _a5, _b3, _c45; + function toLogRecord(log, encoder) { + var _a3, _b2, _c45; return { - timeUnixNano: encoder.encodeHrTime(log2.hrTime), - observedTimeUnixNano: encoder.encodeHrTime(log2.hrTimeObserved), - severityNumber: toSeverityNumber(log2.severityNumber), - severityText: log2.severityText, - body: (0, internal_1.toAnyValue)(log2.body), - attributes: toLogAttributes(log2.attributes), - droppedAttributesCount: log2.droppedAttributesCount, - flags: (_a5 = log2.spanContext) === null || _a5 === undefined ? undefined : _a5.traceFlags, - traceId: encoder.encodeOptionalSpanContext((_b3 = log2.spanContext) === null || _b3 === undefined ? undefined : _b3.traceId), - spanId: encoder.encodeOptionalSpanContext((_c45 = log2.spanContext) === null || _c45 === undefined ? undefined : _c45.spanId) + timeUnixNano: encoder.encodeHrTime(log.hrTime), + observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved), + severityNumber: toSeverityNumber(log.severityNumber), + severityText: log.severityText, + body: (0, internal_1.toAnyValue)(log.body), + attributes: toLogAttributes(log.attributes), + droppedAttributesCount: log.droppedAttributesCount, + flags: (_a3 = log.spanContext) === null || _a3 === undefined ? undefined : _a3.traceFlags, + traceId: encoder.encodeOptionalSpanContext((_b2 = log.spanContext) === null || _b2 === undefined ? undefined : _b2.traceId), + spanId: encoder.encodeOptionalSpanContext((_c45 = log.spanContext) === null || _c45 === undefined ? undefined : _c45.spanId) }; } function toSeverityNumber(severityNumber) { @@ -427293,10 +350919,10 @@ var require_internal2 = __commonJS((exports) => { var require_logs2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ProtobufLogsSerializer = undefined; - var root3 = require_root(); + var root2 = require_root(); var internal_1 = require_internal2(); - var logsResponseType = root3.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; - var logsRequestType = root3.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; + var logsResponseType = root2.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; + var logsRequestType = root2.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; exports.ProtobufLogsSerializer = { serializeRequest: (arg) => { const request = (0, internal_1.createExportLogsServiceRequest)(arg); @@ -427322,9 +350948,9 @@ var require_protobuf3 = __commonJS((exports) => { var require_internal3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createExportMetricsServiceRequest = exports.toMetric = exports.toScopeMetrics = exports.toResourceMetrics = undefined; - var api_1 = require_src13(); - var sdk_metrics_1 = require_src21(); - var utils_1 = require_utils16(); + var api_1 = require_src7(); + var sdk_metrics_1 = require_src15(); + var utils_1 = require_utils15(); var internal_1 = require_internal(); function toResourceMetrics(resourceMetrics, options2) { const encoder = (0, utils_1.getOtlpEncoder)(options2); @@ -427460,10 +351086,10 @@ var require_internal3 = __commonJS((exports) => { var require_metrics2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ProtobufMetricsSerializer = undefined; - var root3 = require_root(); + var root2 = require_root(); var internal_1 = require_internal3(); - var metricsResponseType = root3.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse; - var metricsRequestType = root3.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; + var metricsResponseType = root2.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse; + var metricsRequestType = root2.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; exports.ProtobufMetricsSerializer = { serializeRequest: (arg) => { const request = (0, internal_1.createExportMetricsServiceRequest)([arg]); @@ -427490,16 +351116,16 @@ var require_internal4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createExportTraceServiceRequest = exports.toOtlpSpanEvent = exports.toOtlpLink = exports.sdkSpanToOtlpSpan = undefined; var internal_1 = require_internal(); - var utils_1 = require_utils16(); + var utils_1 = require_utils15(); function sdkSpanToOtlpSpan(span, encoder) { - var _a5; + var _a3; const ctx = span.spanContext(); const status = span.status; return { traceId: encoder.encodeSpanContext(ctx.traceId), spanId: encoder.encodeSpanContext(ctx.spanId), parentSpanId: encoder.encodeOptionalSpanContext(span.parentSpanId), - traceState: (_a5 = ctx.traceState) === null || _a5 === undefined ? undefined : _a5.serialize(), + traceState: (_a3 = ctx.traceState) === null || _a3 === undefined ? undefined : _a3.serialize(), name: span.name, kind: span.kind == null ? 0 : span.kind + 1, startTimeUnixNano: encoder.encodeHrTime(span.startTime), @@ -427518,12 +351144,12 @@ var require_internal4 = __commonJS((exports) => { } exports.sdkSpanToOtlpSpan = sdkSpanToOtlpSpan; function toOtlpLink(link3, encoder) { - var _a5; + var _a3; return { attributes: link3.attributes ? (0, internal_1.toAttributes)(link3.attributes) : [], spanId: encoder.encodeSpanContext(link3.context.spanId), traceId: encoder.encodeSpanContext(link3.context.traceId), - traceState: (_a5 = link3.context.traceState) === null || _a5 === undefined ? undefined : _a5.serialize(), + traceState: (_a3 = link3.context.traceState) === null || _a3 === undefined ? undefined : _a3.serialize(), droppedAttributesCount: link3.droppedAttributesCount || 0 }; } @@ -427600,10 +351226,10 @@ var require_internal4 = __commonJS((exports) => { var require_trace6 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ProtobufTraceSerializer = undefined; - var root3 = require_root(); + var root2 = require_root(); var internal_1 = require_internal4(); - var traceResponseType = root3.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse; - var traceRequestType = root3.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; + var traceResponseType = root2.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse; + var traceRequestType = root2.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; exports.ProtobufTraceSerializer = { serializeRequest: (arg) => { const request = (0, internal_1.createExportTraceServiceRequest)(arg); @@ -427718,7 +351344,7 @@ var require_json5 = __commonJS((exports) => { }); // node_modules/@opentelemetry/otlp-transformer/build/src/index.js -var require_src25 = __commonJS((exports) => { +var require_src19 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.JsonTraceSerializer = exports.JsonMetricsSerializer = exports.JsonLogsSerializer = exports.ProtobufTraceSerializer = exports.ProtobufMetricsSerializer = exports.ProtobufLogsSerializer = undefined; var protobuf_1 = require_protobuf3(); @@ -427748,7 +351374,7 @@ var require_src25 = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/version.js -var require_version5 = __commonJS((exports) => { +var require_version4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.VERSION = undefined; exports.VERSION = "0.57.2"; @@ -427771,9 +351397,9 @@ var require_is_export_retryable = __commonJS((exports) => { if (Number.isInteger(seconds)) { return seconds > 0 ? seconds * 1000 : -1; } - const delay3 = new Date(retryAfter).getTime() - Date.now(); - if (delay3 >= 0) { - return delay3; + const delay2 = new Date(retryAfter).getTime() - Date.now(); + if (delay2 >= 0) { + return delay2; } return 0; } @@ -427804,7 +351430,7 @@ var require_http_transport_utils = __commonJS((exports) => { const request = parsedUrl.protocol === "http:" ? http3.request : https2.request; const req = request(options2, (res) => { const responseData = []; - res.on("data", (chunk3) => responseData.push(chunk3)); + res.on("data", (chunk2) => responseData.push(chunk2)); res.on("end", () => { if (res.statusCode && res.statusCode < 299) { onDone({ @@ -427817,10 +351443,10 @@ var require_http_transport_utils = __commonJS((exports) => { retryInMillis: (0, is_export_retryable_1.parseRetryAfterToMills)(res.headers["retry-after"]) }); } else { - const error45 = new types_1.OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString()); + const error41 = new types_1.OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString()); onDone({ status: "failure", - error: error45 + error: error41 }); } }); @@ -427832,10 +351458,10 @@ var require_http_transport_utils = __commonJS((exports) => { error: new Error("Request Timeout") }); }); - req.on("error", (error45) => { + req.on("error", (error41) => { onDone({ status: "failure", - error: error45 + error: error41 }); }); const reportTimeoutErrorEvent = nodeVersion >= 14 ? "close" : "abort"; @@ -427845,10 +351471,10 @@ var require_http_transport_utils = __commonJS((exports) => { error: new Error("Request timed out") }); }); - compressAndSend(req, params.compression, data, (error45) => { + compressAndSend(req, params.compression, data, (error41) => { onDone({ status: "failure", - error: error45 + error: error41 }); }); } @@ -427870,8 +351496,8 @@ var require_http_transport_utils = __commonJS((exports) => { } function createHttpAgent(rawUrl, agentOptions) { const parsedUrl = new URL(rawUrl); - const Agent2 = parsedUrl.protocol === "http:" ? http3.Agent : https2.Agent; - return new Agent2(agentOptions); + const Agent = parsedUrl.protocol === "http:" ? http3.Agent : https2.Agent; + return new Agent(agentOptions); } exports.createHttpAgent = createHttpAgent; }); @@ -427896,10 +351522,10 @@ var require_http_exporter_transport = __commonJS((exports) => { this._agent = createHttpAgent(this._parameters.url, this._parameters.agentOptions); this._send = sendWithHttp; } - return new Promise((resolve25) => { - var _a5; - (_a5 = this._send) === null || _a5 === undefined || _a5.call(this, this._parameters, this._agent, data, (result3) => { - resolve25(result3); + return new Promise((resolve19) => { + var _a3; + (_a3 = this._send) === null || _a3 === undefined || _a3.call(this, this._parameters, this._agent, data, (result2) => { + resolve19(result2); }, timeoutMillis); }); } @@ -427929,30 +351555,30 @@ var require_retrying_transport = __commonJS((exports) => { this._transport = _transport; } retry(data, timeoutMillis, inMillis) { - return new Promise((resolve25, reject3) => { + return new Promise((resolve19, reject2) => { setTimeout(() => { - this._transport.send(data, timeoutMillis).then(resolve25, reject3); + this._transport.send(data, timeoutMillis).then(resolve19, reject2); }, inMillis); }); } async send(data, timeoutMillis) { - var _a5; + var _a3; const deadline = Date.now() + timeoutMillis; - let result3 = await this._transport.send(data, timeoutMillis); + let result2 = await this._transport.send(data, timeoutMillis); let attempts = MAX_ATTEMPTS; let nextBackoff = INITIAL_BACKOFF; - while (result3.status === "retryable" && attempts > 0) { + while (result2.status === "retryable" && attempts > 0) { attempts--; const backoff = Math.max(Math.min(nextBackoff, MAX_BACKOFF) + getJitter(), 0); nextBackoff = nextBackoff * BACKOFF_MULTIPLIER; - const retryInMillis = (_a5 = result3.retryInMillis) !== null && _a5 !== undefined ? _a5 : backoff; + const retryInMillis = (_a3 = result2.retryInMillis) !== null && _a3 !== undefined ? _a3 : backoff; const remainingTimeoutMillis = deadline - Date.now(); if (retryInMillis > remainingTimeoutMillis) { - return result3; + return result2; } - result3 = await this.retry(data, remainingTimeoutMillis, retryInMillis); + result2 = await this.retry(data, remainingTimeoutMillis, retryInMillis); } - return result3; + return result2; } shutdown() { return this._transport.shutdown(); @@ -427988,10 +351614,10 @@ var require_otlp_http_export_delegate = __commonJS((exports) => { var require_shared_env_configuration = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getSharedConfigurationFromEnvironment = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); function parseAndValidateTimeoutFromEnv(timeoutEnvVar) { - var _a5; - const envTimeout = (_a5 = process.env[timeoutEnvVar]) === null || _a5 === undefined ? undefined : _a5.trim(); + var _a3; + const envTimeout = (_a3 = process.env[timeoutEnvVar]) === null || _a3 === undefined ? undefined : _a3.trim(); if (envTimeout != null && envTimeout !== "") { const definedTimeout = Number(envTimeout); if (!Number.isNaN(definedTimeout) && Number.isFinite(definedTimeout) && definedTimeout > 0) { @@ -428007,8 +351633,8 @@ var require_shared_env_configuration = __commonJS((exports) => { return specificTimeout !== null && specificTimeout !== undefined ? specificTimeout : nonSpecificTimeout; } function parseAndValidateCompressionFromEnv(compressionEnvVar) { - var _a5; - const compression = (_a5 = process.env[compressionEnvVar]) === null || _a5 === undefined ? undefined : _a5.trim(); + var _a3; + const compression = (_a3 = process.env[compressionEnvVar]) === null || _a3 === undefined ? undefined : _a3.trim(); if (compression === "") { return; } @@ -428033,15 +351659,15 @@ var require_shared_env_configuration = __commonJS((exports) => { }); // node_modules/@opentelemetry/otlp-exporter-base/build/src/util.js -var require_util14 = __commonJS((exports) => { +var require_util12 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateAndNormalizeHeaders = undefined; - var api_1 = require_src13(); + var api_1 = require_src7(); function validateAndNormalizeHeaders(partialHeaders) { return () => { - var _a5; + var _a3; const headers = {}; - Object.entries((_a5 = partialHeaders === null || partialHeaders === undefined ? undefined : partialHeaders()) !== null && _a5 !== undefined ? _a5 : {}).forEach(([key, value]) => { + Object.entries((_a3 = partialHeaders === null || partialHeaders === undefined ? undefined : partialHeaders()) !== null && _a3 !== undefined ? _a3 : {}).forEach(([key, value]) => { if (typeof value !== "undefined") { headers[key] = String(value); } else { @@ -428059,7 +351685,7 @@ var require_otlp_http_configuration = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getHttpConfigurationDefaults = exports.mergeOtlpHttpConfigurationWithDefaults = undefined; var shared_configuration_1 = require_shared_configuration(); - var util_1 = require_util14(); + var util_1 = require_util12(); function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) { const requiredHeaders = Object.assign({}, defaultHeaders()); const headers = {}; @@ -428085,8 +351711,8 @@ var require_otlp_http_configuration = __commonJS((exports) => { } } function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { - var _a5, _b3, _c45, _d; - return Object.assign(Object.assign({}, (0, shared_configuration_1.mergeOtlpSharedConfigurationWithDefaults)(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration)), { headers: mergeHeaders((0, util_1.validateAndNormalizeHeaders)(userProvidedConfiguration.headers), fallbackConfiguration.headers, defaultConfiguration.headers), url: (_b3 = (_a5 = validateUserProvidedUrl(userProvidedConfiguration.url)) !== null && _a5 !== undefined ? _a5 : fallbackConfiguration.url) !== null && _b3 !== undefined ? _b3 : defaultConfiguration.url, agentOptions: (_d = (_c45 = userProvidedConfiguration.agentOptions) !== null && _c45 !== undefined ? _c45 : fallbackConfiguration.agentOptions) !== null && _d !== undefined ? _d : defaultConfiguration.agentOptions }); + var _a3, _b2, _c45, _d; + return Object.assign(Object.assign({}, (0, shared_configuration_1.mergeOtlpSharedConfigurationWithDefaults)(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration)), { headers: mergeHeaders((0, util_1.validateAndNormalizeHeaders)(userProvidedConfiguration.headers), fallbackConfiguration.headers, defaultConfiguration.headers), url: (_b2 = (_a3 = validateUserProvidedUrl(userProvidedConfiguration.url)) !== null && _a3 !== undefined ? _a3 : fallbackConfiguration.url) !== null && _b2 !== undefined ? _b2 : defaultConfiguration.url, agentOptions: (_d = (_c45 = userProvidedConfiguration.agentOptions) !== null && _c45 !== undefined ? _c45 : fallbackConfiguration.agentOptions) !== null && _d !== undefined ? _d : defaultConfiguration.agentOptions }); } exports.mergeOtlpHttpConfigurationWithDefaults = mergeOtlpHttpConfigurationWithDefaults; function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { @@ -428099,14 +351725,14 @@ var require_otlp_http_configuration = __commonJS((exports) => { var require_otlp_http_env_configuration = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getHttpConfigurationFromEnvironment = undefined; - var core_1 = require_src16(); - var api_1 = require_src13(); + var core_1 = require_src10(); + var api_1 = require_src7(); var shared_env_configuration_1 = require_shared_env_configuration(); var shared_configuration_1 = require_shared_configuration(); function getStaticHeadersFromEnv(signalIdentifier) { - var _a5, _b3; - const signalSpecificRawHeaders = (_a5 = process.env[`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`]) === null || _a5 === undefined ? undefined : _a5.trim(); - const nonSignalSpecificRawHeaders = (_b3 = process.env["OTEL_EXPORTER_OTLP_HEADERS"]) === null || _b3 === undefined ? undefined : _b3.trim(); + var _a3, _b2; + const signalSpecificRawHeaders = (_a3 = process.env[`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`]) === null || _a3 === undefined ? undefined : _a3.trim(); + const nonSignalSpecificRawHeaders = (_b2 = process.env["OTEL_EXPORTER_OTLP_HEADERS"]) === null || _b2 === undefined ? undefined : _b2.trim(); const signalSpecificHeaders = core_1.baggageUtils.parseKeyPairsIntoRecord(signalSpecificRawHeaders); const nonSignalSpecificHeaders = core_1.baggageUtils.parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders); if (Object.keys(signalSpecificHeaders).length === 0 && Object.keys(nonSignalSpecificHeaders).length === 0) { @@ -428118,49 +351744,49 @@ var require_otlp_http_env_configuration = __commonJS((exports) => { try { const parsedUrl = new URL(url3); return parsedUrl.toString(); - } catch (_a5) { + } catch (_a3) { api_1.diag.warn(`Configuration: Could not parse environment-provided export URL: '${url3}', falling back to undefined`); return; } } - function appendResourcePathToUrl(url3, path16) { + function appendResourcePathToUrl(url3, path11) { try { new URL(url3); - } catch (_a5) { + } catch (_a3) { api_1.diag.warn(`Configuration: Could not parse environment-provided export URL: '${url3}', falling back to undefined`); return; } if (!url3.endsWith("/")) { url3 = url3 + "/"; } - url3 += path16; + url3 += path11; try { new URL(url3); - } catch (_b3) { - api_1.diag.warn(`Configuration: Provided URL appended with '${path16}' is not a valid URL, using 'undefined' instead of '${url3}'`); + } catch (_b2) { + api_1.diag.warn(`Configuration: Provided URL appended with '${path11}' is not a valid URL, using 'undefined' instead of '${url3}'`); return; } return url3; } function getNonSpecificUrlFromEnv(signalResourcePath) { - var _a5; - const envUrl = (_a5 = process.env.OTEL_EXPORTER_OTLP_ENDPOINT) === null || _a5 === undefined ? undefined : _a5.trim(); + var _a3; + const envUrl = (_a3 = process.env.OTEL_EXPORTER_OTLP_ENDPOINT) === null || _a3 === undefined ? undefined : _a3.trim(); if (envUrl == null || envUrl === "") { return; } return appendResourcePathToUrl(envUrl, signalResourcePath); } function getSpecificUrlFromEnv(signalIdentifier) { - var _a5; - const envUrl = (_a5 = process.env[`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`]) === null || _a5 === undefined ? undefined : _a5.trim(); + var _a3; + const envUrl = (_a3 = process.env[`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`]) === null || _a3 === undefined ? undefined : _a3.trim(); if (envUrl == null || envUrl === "") { return; } return appendRootPathToUrlIfNeeded(envUrl); } function getHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) { - var _a5; - return Object.assign(Object.assign({}, (0, shared_env_configuration_1.getSharedConfigurationFromEnvironment)(signalIdentifier)), { url: (_a5 = getSpecificUrlFromEnv(signalIdentifier)) !== null && _a5 !== undefined ? _a5 : getNonSpecificUrlFromEnv(signalResourcePath), headers: (0, shared_configuration_1.wrapStaticHeadersInFunction)(getStaticHeadersFromEnv(signalIdentifier)) }); + var _a3; + return Object.assign(Object.assign({}, (0, shared_env_configuration_1.getSharedConfigurationFromEnvironment)(signalIdentifier)), { url: (_a3 = getSpecificUrlFromEnv(signalIdentifier)) !== null && _a3 !== undefined ? _a3 : getNonSpecificUrlFromEnv(signalResourcePath), headers: (0, shared_configuration_1.wrapStaticHeadersInFunction)(getStaticHeadersFromEnv(signalIdentifier)) }); } exports.getHttpConfigurationFromEnvironment = getHttpConfigurationFromEnvironment; }); @@ -428171,33 +351797,33 @@ var require_convert_legacy_node_http_options = __commonJS((exports) => { exports.convertLegacyHttpOptions = undefined; var otlp_http_configuration_1 = require_otlp_http_configuration(); var otlp_http_env_configuration_1 = require_otlp_http_env_configuration(); - var api_1 = require_src13(); + var api_1 = require_src7(); var shared_configuration_1 = require_shared_configuration(); - function convertLegacyAgentOptions(config4) { - if ((config4 === null || config4 === undefined ? undefined : config4.keepAlive) != null) { - if (config4.httpAgentOptions != null) { - if (config4.httpAgentOptions.keepAlive == null) { - config4.httpAgentOptions.keepAlive = config4.keepAlive; + function convertLegacyAgentOptions(config2) { + if ((config2 === null || config2 === undefined ? undefined : config2.keepAlive) != null) { + if (config2.httpAgentOptions != null) { + if (config2.httpAgentOptions.keepAlive == null) { + config2.httpAgentOptions.keepAlive = config2.keepAlive; } } else { - config4.httpAgentOptions = { - keepAlive: config4.keepAlive + config2.httpAgentOptions = { + keepAlive: config2.keepAlive }; } } - return config4.httpAgentOptions; + return config2.httpAgentOptions; } - function convertLegacyHttpOptions(config4, signalIdentifier, signalResourcePath, requiredHeaders) { - if (config4.metadata) { + function convertLegacyHttpOptions(config2, signalIdentifier, signalResourcePath, requiredHeaders) { + if (config2.metadata) { api_1.diag.warn("Metadata cannot be set when using http"); } return (0, otlp_http_configuration_1.mergeOtlpHttpConfigurationWithDefaults)({ - url: config4.url, - headers: (0, shared_configuration_1.wrapStaticHeadersInFunction)(config4.headers), - concurrencyLimit: config4.concurrencyLimit, - timeoutMillis: config4.timeoutMillis, - compression: config4.compression, - agentOptions: convertLegacyAgentOptions(config4) + url: config2.url, + headers: (0, shared_configuration_1.wrapStaticHeadersInFunction)(config2.headers), + concurrencyLimit: config2.concurrencyLimit, + timeoutMillis: config2.timeoutMillis, + compression: config2.compression, + agentOptions: convertLegacyAgentOptions(config2) }, (0, otlp_http_env_configuration_1.getHttpConfigurationFromEnvironment)(signalIdentifier, signalResourcePath), (0, otlp_http_configuration_1.getHttpConfigurationDefaults)(requiredHeaders, signalResourcePath)); } exports.convertLegacyHttpOptions = convertLegacyHttpOptions; @@ -428225,14 +351851,14 @@ var require_index_node_http = __commonJS((exports) => { var require_OTLPLogExporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPLogExporter = undefined; - var otlp_exporter_base_1 = require_src24(); - var otlp_transformer_1 = require_src25(); - var version_1 = require_version5(); + var otlp_exporter_base_1 = require_src18(); + var otlp_transformer_1 = require_src19(); + var version_1 = require_version4(); var node_http_1 = require_index_node_http(); class OTLPLogExporter extends otlp_exporter_base_1.OTLPExporterBase { - constructor(config4 = {}) { - super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config4, "LOGS", "v1/logs", { + constructor(config2 = {}) { + super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config2, "LOGS", "v1/logs", { "User-Agent": `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`, "Content-Type": "application/json" }), otlp_transformer_1.JsonLogsSerializer)); @@ -428242,7 +351868,7 @@ var require_OTLPLogExporter = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/platform/node/index.js -var require_node9 = __commonJS((exports) => { +var require_node8 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPLogExporter = undefined; var OTLPLogExporter_1 = require_OTLPLogExporter(); @@ -428255,14 +351881,14 @@ var require_node9 = __commonJS((exports) => { var require_platform7 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPLogExporter = undefined; - var node_1 = require_node9(); + var node_1 = require_node8(); Object.defineProperty(exports, "OTLPLogExporter", { enumerable: true, get: function() { return node_1.OTLPLogExporter; } }); }); // node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/index.js -var require_src26 = __commonJS((exports) => { +var require_src20 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPLogExporter = undefined; var platform_1 = require_platform7(); @@ -428274,41 +351900,31 @@ var require_src26 = __commonJS((exports) => { // stub-npm:@opentelemetry/exporter-logs-otlp-proto var exports_exporter_logs_otlp_proto = {}; __export(exports_exporter_logs_otlp_proto, { - select: () => select9, - input: () => input8, default: () => exporter_logs_otlp_proto_default, - confirm: () => confirm8, - __stub__: () => __stub__8, - DestroyerOfModules: () => DestroyerOfModules8 + __stub__: () => __stub__14 }); -var handler11, stub11, exporter_logs_otlp_proto_default, __stub__8 = true, confirm8 = () => {}, input8 = () => {}, select9 = () => {}, DestroyerOfModules8 = class { -}; +var handler15, stub15, exporter_logs_otlp_proto_default, __stub__14 = true; var init_exporter_logs_otlp_proto = __esm(() => { - handler11 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub11 = new Proxy({}, handler11); - exporter_logs_otlp_proto_default = stub11; + handler15 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub15 = new Proxy({}, handler15); + exporter_logs_otlp_proto_default = stub15; }); // stub-npm:@opentelemetry/exporter-trace-otlp-grpc var exports_exporter_trace_otlp_grpc = {}; __export(exports_exporter_trace_otlp_grpc, { - select: () => select10, - input: () => input9, default: () => exporter_trace_otlp_grpc_default, - confirm: () => confirm9, - __stub__: () => __stub__9, - DestroyerOfModules: () => DestroyerOfModules9 + __stub__: () => __stub__15 }); -var handler12, stub12, exporter_trace_otlp_grpc_default, __stub__9 = true, confirm9 = () => {}, input9 = () => {}, select10 = () => {}, DestroyerOfModules9 = class { -}; +var handler16, stub16, exporter_trace_otlp_grpc_default, __stub__15 = true; var init_exporter_trace_otlp_grpc = __esm(() => { - handler12 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub12 = new Proxy({}, handler12); - exporter_trace_otlp_grpc_default = stub12; + handler16 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub16 = new Proxy({}, handler16); + exporter_trace_otlp_grpc_default = stub16; }); // node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/version.js -var require_version6 = __commonJS((exports) => { +var require_version5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.VERSION = undefined; exports.VERSION = "0.57.2"; @@ -428318,14 +351934,14 @@ var require_version6 = __commonJS((exports) => { var require_OTLPTraceExporter = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPTraceExporter = undefined; - var otlp_exporter_base_1 = require_src24(); - var version_1 = require_version6(); - var otlp_transformer_1 = require_src25(); + var otlp_exporter_base_1 = require_src18(); + var version_1 = require_version5(); + var otlp_transformer_1 = require_src19(); var node_http_1 = require_index_node_http(); class OTLPTraceExporter extends otlp_exporter_base_1.OTLPExporterBase { - constructor(config4 = {}) { - super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config4, "TRACES", "v1/traces", { + constructor(config2 = {}) { + super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config2, "TRACES", "v1/traces", { "User-Agent": `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`, "Content-Type": "application/json" }), otlp_transformer_1.JsonTraceSerializer)); @@ -428335,7 +351951,7 @@ var require_OTLPTraceExporter = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js -var require_node10 = __commonJS((exports) => { +var require_node9 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -428375,11 +351991,11 @@ var require_platform8 = __commonJS((exports) => { __createBinding(exports2, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(require_node10(), exports); + __exportStar(require_node9(), exports); }); // node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js -var require_src27 = __commonJS((exports) => { +var require_src21 = __commonJS((exports) => { var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) { if (k2 === undefined) k2 = k; @@ -428403,19 +352019,14 @@ var require_src27 = __commonJS((exports) => { // stub-npm:@opentelemetry/exporter-trace-otlp-proto var exports_exporter_trace_otlp_proto = {}; __export(exports_exporter_trace_otlp_proto, { - select: () => select11, - input: () => input10, default: () => exporter_trace_otlp_proto_default, - confirm: () => confirm10, - __stub__: () => __stub__10, - DestroyerOfModules: () => DestroyerOfModules10 + __stub__: () => __stub__16 }); -var handler13, stub13, exporter_trace_otlp_proto_default, __stub__10 = true, confirm10 = () => {}, input10 = () => {}, select11 = () => {}, DestroyerOfModules10 = class { -}; +var handler17, stub17, exporter_trace_otlp_proto_default, __stub__16 = true; var init_exporter_trace_otlp_proto = __esm(() => { - handler13 = { get: (t, p) => p === "__esModule" ? true : () => {} }; - stub13 = new Proxy({}, handler13); - exporter_trace_otlp_proto_default = stub13; + handler17 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub17 = new Proxy({}, handler17); + exporter_trace_otlp_proto_default = stub17; }); // src/utils/telemetry/instrumentation.ts @@ -428428,8 +352039,8 @@ __export(exports_instrumentation, { bootstrapTelemetry: () => bootstrapTelemetry }); function telemetryTimeout(ms, message) { - return new Promise((_, reject3) => { - setTimeout((rej, msg) => rej(new TelemetryTimeoutError(msg)), ms, reject3, message).unref(); + return new Promise((_, reject2) => { + setTimeout((rej, msg) => rej(new TelemetryTimeoutError(msg)), ms, reject2, message).unref(); }); } function bootstrapTelemetry() { @@ -428536,7 +352147,7 @@ async function getOtlpLogExporters() { break; } case "http/json": { - const { OTLPLogExporter } = await Promise.resolve().then(() => __toESM(require_src26(), 1)); + const { OTLPLogExporter } = await Promise.resolve().then(() => __toESM(require_src20(), 1)); exporters.push(new OTLPLogExporter(httpConfig)); break; } @@ -428570,7 +352181,7 @@ async function getOtlpTraceExporters() { break; } case "http/json": { - const { OTLPTraceExporter } = await Promise.resolve().then(() => __toESM(require_src27(), 1)); + const { OTLPTraceExporter } = await Promise.resolve().then(() => __toESM(require_src21(), 1)); exporters.push(new OTLPTraceExporter(httpConfig)); break; } @@ -428609,8 +352220,8 @@ async function initializeBetaTracing(resource) { return; } const [{ OTLPTraceExporter }, { OTLPLogExporter }] = await Promise.all([ - Promise.resolve().then(() => __toESM(require_src27(), 1)), - Promise.resolve().then(() => __toESM(require_src26(), 1)) + Promise.resolve().then(() => __toESM(require_src21(), 1)), + Promise.resolve().then(() => __toESM(require_src20(), 1)) ]); const httpConfig = { url: `${endpoint}/v1/traces` @@ -428789,8 +352400,8 @@ async function initializeTelemetry() { Promise.all(shutdownPromises), telemetryTimeout(timeoutMs, "OpenTelemetry shutdown timeout") ]); - } catch (error45) { - if (error45 instanceof Error && error45.message.includes("timeout")) { + } catch (error41) { + if (error41 instanceof Error && error41.message.includes("timeout")) { logForDebugging(` OpenTelemetry telemetry flush timed out after ${timeoutMs}ms @@ -428802,7 +352413,7 @@ To resolve this issue, you can: Current timeout: ${timeoutMs}ms `, { level: "error" }); } - throw error45; + throw error41; } }; registerCleanup(shutdownTelemetry); @@ -428829,11 +352440,11 @@ async function flushTelemetry() { telemetryTimeout(timeoutMs, "OpenTelemetry flush timeout") ]); logForDebugging("Telemetry flushed successfully"); - } catch (error45) { - if (error45 instanceof TelemetryTimeoutError) { + } catch (error41) { + if (error41 instanceof TelemetryTimeoutError) { logForDebugging(`Telemetry flush timed out after ${timeoutMs}ms. Some metrics may not be exported.`, { level: "warn" }); } else { - logForDebugging(`Telemetry flush failed: ${errorMessage(error45)}`, { + logForDebugging(`Telemetry flush failed: ${errorMessage(error41)}`, { level: "error" }); } @@ -428856,26 +352467,26 @@ function getOTLPExporterConfig() { const proxyUrl = getProxyUrl(); const mtlsConfig = getMTLSConfig(); const settings = getSettings_DEPRECATED(); - const config4 = {}; + const config2 = {}; const staticHeaders = parseOtelHeadersEnvVar(); if (settings?.otelHeadersHelper) { - config4.headers = async () => { + config2.headers = async () => { const dynamicHeaders = getOtelHeadersFromHelper(); return { ...staticHeaders, ...dynamicHeaders }; }; } else if (Object.keys(staticHeaders).length > 0) { - config4.headers = async () => staticHeaders; + config2.headers = async () => staticHeaders; } const otelEndpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT; if (!proxyUrl || otelEndpoint && shouldBypassProxy(otelEndpoint)) { const caCerts2 = getCACertificates(); if (mtlsConfig || caCerts2) { - config4.httpAgentOptions = { + config2.httpAgentOptions = { ...mtlsConfig, ...caCerts2 && { ca: caCerts2 } }; } - return config4; + return config2; } const caCerts = getCACertificates(); const agentFactory = (_protocol) => { @@ -428889,21 +352500,21 @@ function getOTLPExporterConfig() { }) : new import_https_proxy_agent2.HttpsProxyAgent(proxyUrl); return proxyAgent; }; - config4.httpAgentOptions = agentFactory; - return config4; + config2.httpAgentOptions = agentFactory; + return config2; } var import_api3, import_api_logs, import_resources2, import_sdk_logs2, import_sdk_metrics2, import_sdk_trace_base, import_semantic_conventions2, import_https_proxy_agent2, DEFAULT_METRICS_EXPORT_INTERVAL_MS = 60000, DEFAULT_LOGS_EXPORT_INTERVAL_MS2 = 5000, DEFAULT_TRACES_EXPORT_INTERVAL_MS = 5000, TelemetryTimeoutError; var init_instrumentation = __esm(() => { - import_api3 = __toESM(require_src13(), 1); - import_api_logs = __toESM(require_src18(), 1); - import_resources2 = __toESM(require_src17(), 1); - import_sdk_logs2 = __toESM(require_src19(), 1); - import_sdk_metrics2 = __toESM(require_src21(), 1); - import_sdk_trace_base = __toESM(require_src23(), 1); - import_semantic_conventions2 = __toESM(require_src20(), 1); + import_api3 = __toESM(require_src7(), 1); + import_api_logs = __toESM(require_src12(), 1); + import_resources2 = __toESM(require_src11(), 1); + import_sdk_logs2 = __toESM(require_src13(), 1); + import_sdk_metrics2 = __toESM(require_src15(), 1); + import_sdk_trace_base = __toESM(require_src17(), 1); + import_semantic_conventions2 = __toESM(require_src14(), 1); import_https_proxy_agent2 = __toESM(require_dist3(), 1); init_state(); - init_auth2(); + init_auth(); init_platform2(); init_caCerts(); init_cleanupRegistry(); @@ -428993,7 +352604,7 @@ var init_logout = __esm(() => { init_grove(); init_policyLimits(); init_remoteManagedSettings(); - init_auth2(); + init_auth(); init_betas2(); init_config2(); init_gracefulShutdown(); @@ -429006,11 +352617,11 @@ var init_logout = __esm(() => { // src/services/api/firstTokenDate.ts async function fetchAndStoreClaudeCodeFirstTokenDate() { try { - const config4 = getGlobalConfig(); - if (config4.claudeCodeFirstTokenDate !== undefined) { + const config2 = getGlobalConfig(); + if (config2.claudeCodeFirstTokenDate !== undefined) { return; } - const authHeaders = getAuthHeaders2(); + const authHeaders = getAuthHeaders(); if (authHeaders.error) { logError2(new Error(`Failed to get auth headers: ${authHeaders.error}`)); return; @@ -429036,8 +352647,8 @@ async function fetchAndStoreClaudeCodeFirstTokenDate() { ...current, claudeCodeFirstTokenDate: firstTokenDate })); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } var init_firstTokenDate = __esm(() => { @@ -429060,15 +352671,15 @@ function validateUrl(url3) { throw new Error(`Invalid URL protocol: must use http:// or https://, got ${parsedUrl.protocol}`); } } -async function openPath(path16) { +async function openPath(path11) { try { const platform3 = process.platform; if (platform3 === "win32") { - const { code: code2 } = await execFileNoThrow("explorer", [path16]); + const { code: code2 } = await execFileNoThrow("explorer", [path11]); return code2 === 0; } const command = platform3 === "darwin" ? "open" : "xdg-open"; - const { code } = await execFileNoThrow(command, [path16]); + const { code } = await execFileNoThrow(command, [path11]); return code === 0; } catch (_) { return false; @@ -429100,7 +352711,7 @@ var init_browser = __esm(() => { }); // src/services/oauth/auth-code-listener.ts -import { createServer as createServer3 } from "http"; +import { createServer } from "http"; class AuthCodeListener { localServer; @@ -429111,18 +352722,18 @@ class AuthCodeListener { pendingResponse = null; callbackPath; constructor(callbackPath = "/callback") { - this.localServer = createServer3(); + this.localServer = createServer(); this.callbackPath = callbackPath; } async start(port) { - return new Promise((resolve25, reject3) => { - this.localServer.once("error", (err3) => { - reject3(new Error(`Failed to start OAuth callback server: ${err3.message}`)); + return new Promise((resolve19, reject2) => { + this.localServer.once("error", (err2) => { + reject2(new Error(`Failed to start OAuth callback server: ${err2.message}`)); }); this.localServer.listen(port ?? 0, "localhost", () => { const address = this.localServer.address(); this.port = address.port; - resolve25(this.port); + resolve19(this.port); }); }); } @@ -429133,9 +352744,9 @@ class AuthCodeListener { return this.pendingResponse !== null; } async waitForAuthorization(state, onReady) { - return new Promise((resolve25, reject3) => { - this.promiseResolver = resolve25; - this.promiseRejecter = reject3; + return new Promise((resolve19, reject2) => { + this.promiseResolver = resolve19; + this.promiseRejecter = reject2; this.expectedState = state; this.startLocalListener(onReady); }); @@ -429196,10 +352807,10 @@ class AuthCodeListener { this.pendingResponse = res; this.resolve(authCode); } - handleError(err3) { - logError2(err3); + handleError(err2) { + logError2(err2); this.close(); - this.reject(err3); + this.reject(err2); } resolve(authorizationCode) { if (this.promiseResolver) { @@ -429208,9 +352819,9 @@ class AuthCodeListener { this.promiseRejecter = null; } } - reject(error45) { + reject(error41) { if (this.promiseRejecter) { - this.promiseRejecter(error45); + this.promiseRejecter(error41); this.promiseResolver = null; this.promiseRejecter = null; } @@ -429233,20 +352844,20 @@ var init_auth_code_listener = __esm(() => { }); // src/services/oauth/crypto.ts -import { createHash as createHash13, randomBytes as randomBytes6 } from "crypto"; +import { createHash as createHash12, randomBytes as randomBytes5 } from "crypto"; function base64URLEncode(buffer) { return buffer.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); } function generateCodeVerifier() { - return base64URLEncode(randomBytes6(32)); + return base64URLEncode(randomBytes5(32)); } function generateCodeChallenge(verifier) { - const hash2 = createHash13("sha256"); + const hash2 = createHash12("sha256"); hash2.update(verifier); return base64URLEncode(hash2.digest()); } function generateState() { - return base64URLEncode(randomBytes6(32)); + return base64URLEncode(randomBytes5(32)); } var init_crypto2 = () => {}; @@ -429294,24 +352905,24 @@ class OAuthService { this.authCodeListener?.handleSuccessRedirect(scopes); } return this.formatTokens(tokenResponse, profileInfo.subscriptionType, profileInfo.rateLimitTier, profileInfo.rawProfile); - } catch (error45) { + } catch (error41) { if (isAutomaticFlow) { this.authCodeListener?.handleErrorRedirect(); } - throw error45; + throw error41; } finally { this.authCodeListener?.close(); } } async waitForAuthorizationCode(state, onReady) { - return new Promise((resolve25, reject3) => { - this.manualAuthCodeResolver = resolve25; + return new Promise((resolve19, reject2) => { + this.manualAuthCodeResolver = resolve19; this.authCodeListener?.waitForAuthorization(state, onReady).then((authorizationCode) => { this.manualAuthCodeResolver = null; - resolve25(authorizationCode); - }).catch((error45) => { + resolve19(authorizationCode); + }).catch((error41) => { this.manualAuthCodeResolver = null; - reject3(error45); + reject2(error41); }); }); } @@ -429352,21 +352963,21 @@ var init_oauth2 = __esm(() => { }); // src/utils/localInstaller.ts -import { access, chmod as chmod3, writeFile as writeFile13 } from "fs/promises"; -import { join as join67 } from "path"; +import { access, chmod as chmod3, writeFile as writeFile11 } from "fs/promises"; +import { join as join57 } from "path"; function getLocalInstallDir() { - return join67(getClaudeConfigHomeDir(), "local"); + return join57(getClaudeConfigHomeDir(), "local"); } function getLocalClaudePath() { - return join67(getLocalInstallDir(), "claude"); + return join57(getLocalInstallDir(), "claude"); } function isRunningFromLocalInstallation() { const execPath2 = process.argv[1] || ""; return execPath2.includes("/.claude/local/node_modules/"); } -async function writeIfMissing(path16, content, mode) { +async function writeIfMissing(path11, content, mode) { try { - await writeFile13(path16, content, { encoding: "utf8", flag: "wx", mode }); + await writeFile11(path11, content, { encoding: "utf8", flag: "wx", mode }); return true; } catch (e) { if (getErrnoCode(e) === "EEXIST") @@ -429378,16 +352989,16 @@ async function ensureLocalPackageEnvironment() { try { const localInstallDir = getLocalInstallDir(); await getFsImplementation().mkdir(localInstallDir); - await writeIfMissing(join67(localInstallDir, "package.json"), jsonStringify({ name: "claude-local", version: "0.0.1", private: true }, null, 2)); - const wrapperPath = join67(localInstallDir, "claude"); + await writeIfMissing(join57(localInstallDir, "package.json"), jsonStringify({ name: "claude-local", version: "0.0.1", private: true }, null, 2)); + const wrapperPath = join57(localInstallDir, "claude"); const created = await writeIfMissing(wrapperPath, `#!/bin/sh exec "${localInstallDir}/node_modules/.bin/claude" "$@"`, 493); if (created) { await chmod3(wrapperPath, 493); } return true; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return false; } } @@ -429397,25 +353008,25 @@ async function installOrUpdateClaudePackage(channel, specificVersion) { return "install_failed"; } const versionSpec = specificVersion ? specificVersion : channel === "stable" ? "stable" : "latest"; - const result3 = await execFileNoThrowWithCwd("npm", ["install", `${"@anthropic-ai/claude-code"}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 }); - if (result3.code !== 0) { - const error45 = new Error(`Failed to install Claude CLI package: ${result3.stderr}`); - logError2(error45); - return result3.code === 190 ? "in_progress" : "install_failed"; + const result2 = await execFileNoThrowWithCwd("npm", ["install", `${"@anthropic-ai/claude-code"}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 }); + if (result2.code !== 0) { + const error41 = new Error(`Failed to install Claude CLI package: ${result2.stderr}`); + logError2(error41); + return result2.code === 190 ? "in_progress" : "install_failed"; } saveGlobalConfig((current) => ({ ...current, installMethod: "local" })); return "success"; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return "install_failed"; } } async function localInstallationExists() { try { - await access(join67(getLocalInstallDir(), "node_modules", ".bin", "claude")); + await access(join57(getLocalInstallDir(), "node_modules", ".bin", "claude")); return true; } catch { return false; @@ -429442,17 +353053,17 @@ var init_localInstaller = __esm(() => { }); // src/utils/shellConfig.ts -import { open as open8, readFile as readFile13, stat as stat21 } from "fs/promises"; +import { open as open8, readFile as readFile12, stat as stat20 } from "fs/promises"; import { homedir as osHomedir } from "os"; -import { join as join68 } from "path"; +import { join as join58 } from "path"; function getShellConfigPaths(options2) { const home = options2?.homedir ?? osHomedir(); - const env5 = options2?.env ?? process.env; - const zshConfigDir = env5.ZDOTDIR || home; + const env4 = options2?.env ?? process.env; + const zshConfigDir = env4.ZDOTDIR || home; return { - zsh: join68(zshConfigDir, ".zshrc"), - bash: join68(home, ".bashrc"), - fish: join68(home, ".config/fish/config.fish") + zsh: join58(zshConfigDir, ".zshrc"), + bash: join58(home, ".bashrc"), + fish: join58(home, ".config/fish/config.fish") }; } function filterClaudeAliases(lines) { @@ -429477,7 +353088,7 @@ function filterClaudeAliases(lines) { } async function readFileLines(filePath) { try { - const content = await readFile13(filePath, { encoding: "utf8" }); + const content = await readFile12(filePath, { encoding: "utf8" }); return content.split(` `); } catch (e) { @@ -429520,7 +353131,7 @@ async function findValidClaudeAlias(options2) { const home = options2?.homedir ?? osHomedir(); const expandedPath = aliasTarget.startsWith("~") ? aliasTarget.replace("~", home) : aliasTarget; try { - const stats = await stat21(expandedPath); + const stats = await stat20(expandedPath); if (stats.isFile() || stats.isSymbolicLink()) { return aliasTarget; } @@ -429536,9 +353147,9 @@ var init_shellConfig = __esm(() => { // src/utils/autoUpdater.ts import { constants as fsConstants2 } from "fs"; -import { access as access2, writeFile as writeFile14 } from "fs/promises"; -import { homedir as homedir18 } from "os"; -import { join as join69 } from "path"; +import { access as access2, writeFile as writeFile12 } from "fs/promises"; +import { homedir as homedir16 } from "os"; +import { join as join59 } from "path"; async function assertMinVersion() { if (false) {} try { @@ -429555,29 +353166,29 @@ This will ensure you have access to the latest features and improvements. `); gracefulShutdownSync(1); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } async function getMaxVersion() { - const config4 = await getMaxVersionConfig(); + const config2 = await getMaxVersionConfig(); if (process.env.USER_TYPE === "ant") { - return config4.ant || undefined; + return config2.ant || undefined; } - return config4.external || undefined; + return config2.external || undefined; } async function getMaxVersionMessage() { - const config4 = await getMaxVersionConfig(); + const config2 = await getMaxVersionConfig(); if (process.env.USER_TYPE === "ant") { - return config4.ant_message || undefined; + return config2.ant_message || undefined; } - return config4.external_message || undefined; + return config2.external_message || undefined; } async function getMaxVersionConfig() { try { return await getDynamicConfig_BLOCKS_ON_INIT("tengu_max_version_config", {}); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return {}; } } @@ -429594,50 +353205,50 @@ function shouldSkipVersion(targetVersion) { return shouldSkip; } function getLockFilePath() { - return join69(getClaudeConfigHomeDir(), ".update.lock"); + return join59(getClaudeConfigHomeDir(), ".update.lock"); } async function acquireLock() { - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); const lockPath = getLockFilePath(); try { - const stats = await fs9.stat(lockPath); + const stats = await fs3.stat(lockPath); const age = Date.now() - stats.mtimeMs; if (age < LOCK_TIMEOUT_MS) { return false; } try { - const recheck = await fs9.stat(lockPath); + const recheck = await fs3.stat(lockPath); if (Date.now() - recheck.mtimeMs < LOCK_TIMEOUT_MS) { return false; } - await fs9.unlink(lockPath); - } catch (err3) { - if (!isENOENT(err3)) { - logError2(err3); + await fs3.unlink(lockPath); + } catch (err2) { + if (!isENOENT(err2)) { + logError2(err2); return false; } } - } catch (err3) { - if (!isENOENT(err3)) { - logError2(err3); + } catch (err2) { + if (!isENOENT(err2)) { + logError2(err2); return false; } } try { - await writeFile14(lockPath, `${process.pid}`, { + await writeFile12(lockPath, `${process.pid}`, { encoding: "utf8", flag: "wx" }); return true; - } catch (err3) { - const code = getErrnoCode(err3); + } catch (err2) { + const code = getErrnoCode(err2); if (code === "EEXIST") { return false; } if (code === "ENOENT") { try { - await fs9.mkdir(getClaudeConfigHomeDir()); - await writeFile14(lockPath, `${process.pid}`, { + await fs3.mkdir(getClaudeConfigHomeDir()); + await writeFile12(lockPath, `${process.pid}`, { encoding: "utf8", flag: "wx" }); @@ -429650,23 +353261,23 @@ async function acquireLock() { return false; } } - logError2(err3); + logError2(err2); return false; } } async function releaseLock() { - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); const lockPath = getLockFilePath(); try { - const lockData = await fs9.readFile(lockPath, { encoding: "utf8" }); + const lockData = await fs3.readFile(lockPath, { encoding: "utf8" }); if (lockData === `${process.pid}`) { - await fs9.unlink(lockPath); + await fs3.unlink(lockPath); } - } catch (err3) { - if (isENOENT(err3)) { + } catch (err2) { + if (isENOENT(err2)) { return; } - logError2(err3); + logError2(err2); } } async function getInstallationPrefix() { @@ -429674,10 +353285,10 @@ async function getInstallationPrefix() { let prefixResult = null; if (isBun) { prefixResult = await execFileNoThrowWithCwd("bun", ["pm", "bin", "-g"], { - cwd: homedir18() + cwd: homedir16() }); } else { - prefixResult = await execFileNoThrowWithCwd("npm", ["-g", "config", "get", "prefix"], { cwd: homedir18() }); + prefixResult = await execFileNoThrowWithCwd("npm", ["-g", "config", "get", "prefix"], { cwd: homedir16() }); } if (prefixResult.code !== 0) { logError2(new Error(`Failed to check ${isBun ? "bun" : "npm"} permissions`)); @@ -429698,42 +353309,42 @@ async function checkGlobalInstallPermissions() { logError2(new AutoUpdaterError("Insufficient permissions for global npm install.")); return { hasPermissions: false, npmPrefix: prefix }; } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return { hasPermissions: false, npmPrefix: null }; } } async function getLatestVersion(channel) { const npmTag = channel === "stable" ? "stable" : "latest"; - const result3 = await execFileNoThrowWithCwd("npm", ["view", `${"@anthropic-ai/claude-code"}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() }); - if (result3.code !== 0) { - logForDebugging(`npm view failed with code ${result3.code}`); - if (result3.stderr) { - logForDebugging(`npm stderr: ${result3.stderr.trim()}`); + const result2 = await execFileNoThrowWithCwd("npm", ["view", `${"@anthropic-ai/claude-code"}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir16() }); + if (result2.code !== 0) { + logForDebugging(`npm view failed with code ${result2.code}`); + if (result2.stderr) { + logForDebugging(`npm stderr: ${result2.stderr.trim()}`); } else { logForDebugging("npm stderr: (empty)"); } - if (result3.stdout) { - logForDebugging(`npm stdout: ${result3.stdout.trim()}`); + if (result2.stdout) { + logForDebugging(`npm stdout: ${result2.stdout.trim()}`); } return null; } - return result3.stdout.trim(); + return result2.stdout.trim(); } async function getNpmDistTags() { - const result3 = await execFileNoThrowWithCwd("npm", ["view", "@anthropic-ai/claude-code", "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() }); - if (result3.code !== 0) { - logForDebugging(`npm view dist-tags failed with code ${result3.code}`); + const result2 = await execFileNoThrowWithCwd("npm", ["view", "@anthropic-ai/claude-code", "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir16() }); + if (result2.code !== 0) { + logForDebugging(`npm view dist-tags failed with code ${result2.code}`); return { latest: null, stable: null }; } try { - const parsed = jsonParse(result3.stdout.trim()); + const parsed = jsonParse(result2.stdout.trim()); return { latest: typeof parsed.latest === "string" ? parsed.latest : null, stable: typeof parsed.stable === "string" ? parsed.stable : null }; - } catch (error45) { - logForDebugging(`Failed to parse dist-tags: ${error45}`); + } catch (error41) { + logForDebugging(`Failed to parse dist-tags: ${error41}`); return { latest: null, stable: null }; } } @@ -429744,8 +353355,8 @@ async function getLatestVersionFromGcs(channel) { responseType: "text" }); return response.data.trim(); - } catch (error45) { - logForDebugging(`Failed to fetch ${channel} from GCS: ${error45}`); + } catch (error41) { + logForDebugging(`Failed to fetch ${channel} from GCS: ${error41}`); return null; } } @@ -429791,10 +353402,10 @@ To fix this issue: } const packageSpec = specificVersion ? `${"@anthropic-ai/claude-code"}@${specificVersion}` : "@anthropic-ai/claude-code"; const packageManager = env3.isRunningWithBun() ? "bun" : "npm"; - const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir18() }); + const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir16() }); if (installResult.code !== 0) { - const error45 = new AutoUpdaterError(`Failed to install new version of claude: ${installResult.stdout} ${installResult.stderr}`); - logError2(error45); + const error41 = new AutoUpdaterError(`Failed to install new version of claude: ${installResult.stdout} ${installResult.stderr}`); + logError2(error41); return "install_failed"; } saveGlobalConfig((current) => ({ @@ -429818,8 +353429,8 @@ async function removeClaudeAliasesFromShellConfigs() { await writeFileLines(configFile, filtered); logForDebugging(`Removed claude alias from ${configFile}`); } - } catch (error45) { - logForDebugging(`Failed to remove alias from ${configFile}: ${error45}`, { + } catch (error41) { + logForDebugging(`Failed to remove alias from ${configFile}: ${error41}`, { level: "error" }); } @@ -429848,7 +353459,7 @@ var init_autoUpdater = __esm(() => { }); // src/utils/nativeInstaller/packageManagers.ts -import { readFile as readFile14 } from "fs/promises"; +import { readFile as readFile13 } from "fs/promises"; function isDistroFamily(osRelease2, families) { return families.includes(osRelease2.id) || osRelease2.idLike.some((like) => families.includes(like)); } @@ -429906,7 +353517,7 @@ var init_packageManagers = __esm(() => { init_platform2(); getOsRelease = memoize_default(async () => { try { - const content = await readFile14("/etc/os-release", "utf8"); + const content = await readFile13("/etc/os-release", "utf8"); const idMatch = content.match(/^ID=["']?(\S+?)["']?\s*$/m); const idLikeMatch = content.match(/^ID_LIKE=["']?(.+?)["']?\s*$/m); return { @@ -429927,12 +353538,12 @@ var init_packageManagers = __esm(() => { return false; } const execPath2 = process.execPath || process.argv[0] || ""; - const result3 = await execFileNoThrow("pacman", ["-Qo", execPath2], { + const result2 = await execFileNoThrow("pacman", ["-Qo", execPath2], { timeout: 5000, useCwd: false }); - if (result3.code === 0 && result3.stdout) { - logForDebugging(`Detected pacman installation: ${result3.stdout.trim()}`); + if (result2.code === 0 && result2.stdout) { + logForDebugging(`Detected pacman installation: ${result2.stdout.trim()}`); return true; } return false; @@ -429947,12 +353558,12 @@ var init_packageManagers = __esm(() => { return false; } const execPath2 = process.execPath || process.argv[0] || ""; - const result3 = await execFileNoThrow("dpkg", ["-S", execPath2], { + const result2 = await execFileNoThrow("dpkg", ["-S", execPath2], { timeout: 5000, useCwd: false }); - if (result3.code === 0 && result3.stdout) { - logForDebugging(`Detected deb installation: ${result3.stdout.trim()}`); + if (result2.code === 0 && result2.stdout) { + logForDebugging(`Detected deb installation: ${result2.stdout.trim()}`); return true; } return false; @@ -429967,12 +353578,12 @@ var init_packageManagers = __esm(() => { return false; } const execPath2 = process.execPath || process.argv[0] || ""; - const result3 = await execFileNoThrow("rpm", ["-qf", execPath2], { + const result2 = await execFileNoThrow("rpm", ["-qf", execPath2], { timeout: 5000, useCwd: false }); - if (result3.code === 0 && result3.stdout) { - logForDebugging(`Detected rpm installation: ${result3.stdout.trim()}`); + if (result2.code === 0 && result2.stdout) { + logForDebugging(`Detected rpm installation: ${result2.stdout.trim()}`); return true; } return false; @@ -429987,12 +353598,12 @@ var init_packageManagers = __esm(() => { return false; } const execPath2 = process.execPath || process.argv[0] || ""; - const result3 = await execFileNoThrow("apk", ["info", "--who-owns", execPath2], { + const result2 = await execFileNoThrow("apk", ["info", "--who-owns", execPath2], { timeout: 5000, useCwd: false }); - if (result3.code === 0 && result3.stdout) { - logForDebugging(`Detected apk installation: ${result3.stdout.trim()}`); + if (result2.code === 0 && result2.stdout) { + logForDebugging(`Detected apk installation: ${result2.stdout.trim()}`); return true; } return false; @@ -430027,9 +353638,9 @@ var init_packageManagers = __esm(() => { }); // src/utils/doctorDiagnostic.ts -import { readFile as readFile15, realpath as realpath7 } from "fs/promises"; -import { homedir as homedir19 } from "os"; -import { delimiter as delimiter2, join as join70, posix as posix3, win32 } from "path"; +import { readFile as readFile14, realpath as realpath7 } from "fs/promises"; +import { homedir as homedir17 } from "os"; +import { delimiter as delimiter2, join as join60, posix as posix3, win32 } from "path"; function getNormalizedPaths() { let invokedPath = process.argv[1] || ""; let execPath2 = process.execPath || process.argv[0] || ""; @@ -430061,7 +353672,7 @@ async function getCurrentInstallationType() { "/usr/local/bin", "/.nvm/versions/node/" ]; - if (npmGlobalPaths.some((path16) => invokedPath.includes(path16))) { + if (npmGlobalPaths.some((path11) => invokedPath.includes(path11))) { return "npm-global"; } if (invokedPath.includes("/npm/") || invokedPath.includes("/nvm/")) { @@ -430086,14 +353697,14 @@ async function getInstallationPath() { return await realpath7(process.execPath); } catch {} try { - const path16 = await which("claude"); - if (path16) { - return path16; + const path11 = await which("claude"); + if (path11) { + return path11; } } catch {} try { - await getFsImplementation().stat(join70(homedir19(), ".local/bin/claude")); - return join70(homedir19(), ".local/bin/claude"); + await getFsImplementation().stat(join60(homedir17(), ".local/bin/claude")); + return join60(homedir17(), ".local/bin/claude"); } catch {} return "native"; } @@ -430114,9 +353725,9 @@ function getInvokedBinary() { } } async function detectMultipleInstallations() { - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); const installations = []; - const localPath = join70(homedir19(), ".claude", "local"); + const localPath = join60(homedir17(), ".claude", "local"); if (await localInstallationExists()) { installations.push({ type: "npm-local", path: localPath }); } @@ -430131,10 +353742,10 @@ async function detectMultipleInstallations() { if (npmResult.code === 0 && npmResult.stdout) { const npmPrefix = npmResult.stdout.trim(); const isWindows2 = getPlatform() === "windows"; - const globalBinPath = isWindows2 ? join70(npmPrefix, "claude") : join70(npmPrefix, "bin", "claude"); + const globalBinPath = isWindows2 ? join60(npmPrefix, "claude") : join60(npmPrefix, "bin", "claude"); let globalBinExists = false; try { - await fs9.stat(globalBinPath); + await fs3.stat(globalBinPath); globalBinExists = true; } catch {} if (globalBinExists) { @@ -430150,9 +353761,9 @@ async function detectMultipleInstallations() { } } else { for (const packageName of packagesToCheck) { - const globalPackagePath = isWindows2 ? join70(npmPrefix, "node_modules", packageName) : join70(npmPrefix, "lib", "node_modules", packageName); + const globalPackagePath = isWindows2 ? join60(npmPrefix, "node_modules", packageName) : join60(npmPrefix, "lib", "node_modules", packageName); try { - await fs9.stat(globalPackagePath); + await fs3.stat(globalPackagePath); installations.push({ type: "npm-global-orphan", path: globalPackagePath @@ -430161,17 +353772,17 @@ async function detectMultipleInstallations() { } } } - const nativeBinPath = join70(homedir19(), ".local", "bin", "claude"); + const nativeBinPath = join60(homedir17(), ".local", "bin", "claude"); try { - await fs9.stat(nativeBinPath); + await fs3.stat(nativeBinPath); installations.push({ type: "native", path: nativeBinPath }); } catch {} - const config4 = getGlobalConfig(); - if (config4.installMethod === "native") { - const nativeDataPath = join70(homedir19(), ".local", "share", "claude"); + const config2 = getGlobalConfig(); + if (config2.installMethod === "native") { + const nativeDataPath = join60(homedir17(), ".local", "share", "claude"); try { - await fs9.stat(nativeDataPath); - if (!installations.some((i4) => i4.type === "native")) { + await fs3.stat(nativeDataPath); + if (!installations.some((i3) => i3.type === "native")) { installations.push({ type: "native", path: nativeDataPath }); } } catch {} @@ -430181,7 +353792,7 @@ async function detectMultipleInstallations() { async function detectConfigurationIssues(type) { const warnings = []; try { - const raw = await readFile15(join70(getManagedFilePath(), "managed-settings.json"), "utf-8"); + const raw = await readFile14(join60(getManagedFilePath(), "managed-settings.json"), "utf-8"); const parsed = jsonParse(raw); const field = parsed && typeof parsed === "object" ? parsed.strictPluginOnlyCustomization : undefined; if (field !== undefined && typeof field !== "boolean") { @@ -430191,7 +353802,7 @@ async function detectConfigurationIssues(type) { fix: `The field is silently ignored (schema .catch rescues it). Set it to true, or an array of: ${CUSTOMIZATION_SURFACES.join(", ")}.` }); } else { - const unknown3 = field.filter((x4) => typeof x4 === "string" && !CUSTOMIZATION_SURFACES.includes(x4)); + const unknown3 = field.filter((x3) => typeof x3 === "string" && !CUSTOMIZATION_SURFACES.includes(x3)); if (unknown3.length > 0) { warnings.push({ issue: `managed-settings.json: strictPluginOnlyCustomization has ${unknown3.length} value(s) this client doesn't recognize: ${unknown3.map(String).join(", ")}`, @@ -430201,15 +353812,15 @@ async function detectConfigurationIssues(type) { } } } catch {} - const config4 = getGlobalConfig(); + const config2 = getGlobalConfig(); if (type === "development") { return warnings; } if (type === "native") { - const path16 = process.env.PATH || ""; - const pathDirectories = path16.split(delimiter2); - const homeDir = homedir19(); - const localBinPath = join70(homeDir, ".local", "bin"); + const path11 = process.env.PATH || ""; + const pathDirectories = path11.split(delimiter2); + const homeDir = homedir17(); + const localBinPath = join60(homeDir, ".local", "bin"); let normalizedLocalBinPath = localBinPath; if (getPlatform() === "windows") { normalizedLocalBinPath = localBinPath.split(win32.sep).join(posix3.sep); @@ -430235,7 +353846,7 @@ async function detectConfigurationIssues(type) { const shellType = getShellType(); const configPaths = getShellConfigPaths(); const configFile = configPaths[shellType]; - const displayPath = configFile ? configFile.replace(homedir19(), "~") : "your shell config file"; + const displayPath = configFile ? configFile.replace(homedir17(), "~") : "your shell config file"; warnings.push({ issue: "Native installation exists but ~/.local/bin is not in your PATH", fix: `Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${displayPath} then open a new terminal or run: source ${displayPath}` @@ -430244,15 +353855,15 @@ async function detectConfigurationIssues(type) { } } if (!isEnvTruthy(process.env.DISABLE_INSTALLATION_CHECKS)) { - if (type === "npm-local" && config4.installMethod !== "local") { + if (type === "npm-local" && config2.installMethod !== "local") { warnings.push({ - issue: `Running from local installation but config install method is '${config4.installMethod}'`, + issue: `Running from local installation but config install method is '${config2.installMethod}'`, fix: "Consider using native installation: claude install" }); } - if (type === "native" && config4.installMethod !== "native") { + if (type === "native" && config2.installMethod !== "native") { warnings.push({ - issue: `Running native installation but config install method is '${config4.installMethod}'`, + issue: `Running native installation but config install method is '${config2.installMethod}'`, fix: "Run claude install to update configuration" }); } @@ -430310,7 +353921,7 @@ async function getDoctorDiagnostic() { const warnings = await detectConfigurationIssues(installationType); warnings.push(...detectLinuxGlobPatternWarnings()); if (installationType === "native") { - const npmInstalls = multipleInstallations.filter((i4) => i4.type === "npm-global" || i4.type === "npm-global-orphan" || i4.type === "npm-local"); + const npmInstalls = multipleInstallations.filter((i3) => i3.type === "npm-global" || i3.type === "npm-global-orphan" || i3.type === "npm-local"); const isWindows2 = getPlatform() === "windows"; for (const install of npmInstalls) { if (install.type === "npm-global") { @@ -430333,8 +353944,8 @@ async function getDoctorDiagnostic() { } } } - const config4 = getGlobalConfig(); - const configInstallMethod = config4.installMethod || "not set"; + const config2 = getGlobalConfig(); + const configInstallMethod = config2.installMethod || "not set"; let hasUpdatePermissions = null; if (installationType === "npm-global") { const permCheck = await checkGlobalInstallPermissions(); @@ -430392,37 +354003,37 @@ var init_doctorDiagnostic = __esm(() => { }); // src/utils/jetbrains.ts -import { homedir as homedir20, platform as platform3 } from "os"; -import { join as join71 } from "path"; +import { homedir as homedir18, platform as platform3 } from "os"; +import { join as join61 } from "path"; function buildCommonPluginDirectoryPaths(ideName) { - const homeDir = homedir20(); + const homeDir = homedir18(); const directories = []; const idePatterns = ideNameToDirMap[ideName.toLowerCase()]; if (!idePatterns) { return directories; } - const appData = process.env.APPDATA || join71(homeDir, "AppData", "Roaming"); - const localAppData = process.env.LOCALAPPDATA || join71(homeDir, "AppData", "Local"); + const appData = process.env.APPDATA || join61(homeDir, "AppData", "Roaming"); + const localAppData = process.env.LOCALAPPDATA || join61(homeDir, "AppData", "Local"); switch (platform3()) { case "darwin": - directories.push(join71(homeDir, "Library", "Application Support", "JetBrains"), join71(homeDir, "Library", "Application Support")); + directories.push(join61(homeDir, "Library", "Application Support", "JetBrains"), join61(homeDir, "Library", "Application Support")); if (ideName.toLowerCase() === "androidstudio") { - directories.push(join71(homeDir, "Library", "Application Support", "Google")); + directories.push(join61(homeDir, "Library", "Application Support", "Google")); } break; case "win32": - directories.push(join71(appData, "JetBrains"), join71(localAppData, "JetBrains"), join71(appData)); + directories.push(join61(appData, "JetBrains"), join61(localAppData, "JetBrains"), join61(appData)); if (ideName.toLowerCase() === "androidstudio") { - directories.push(join71(localAppData, "Google")); + directories.push(join61(localAppData, "Google")); } break; case "linux": - directories.push(join71(homeDir, ".config", "JetBrains"), join71(homeDir, ".local", "share", "JetBrains")); + directories.push(join61(homeDir, ".config", "JetBrains"), join61(homeDir, ".local", "share", "JetBrains")); for (const pattern of idePatterns) { - directories.push(join71(homeDir, "." + pattern)); + directories.push(join61(homeDir, "." + pattern)); } if (ideName.toLowerCase() === "androidstudio") { - directories.push(join71(homeDir, ".config", "Google")); + directories.push(join61(homeDir, ".config", "Google")); } break; default: @@ -430432,7 +354043,7 @@ function buildCommonPluginDirectoryPaths(ideName) { } async function detectPluginDirectories(ideName) { const foundDirectories = []; - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); const pluginDirPaths = buildCommonPluginDirectoryPaths(ideName); const idePatterns = ideNameToDirMap[ideName.toLowerCase()]; if (!idePatterns) { @@ -430441,21 +354052,21 @@ async function detectPluginDirectories(ideName) { const regexes = idePatterns.map((p) => new RegExp("^" + p)); for (const baseDir of pluginDirPaths) { try { - const entries = await fs9.readdir(baseDir); + const entries = await fs3.readdir(baseDir); for (const regex2 of regexes) { for (const entry of entries) { if (!regex2.test(entry.name)) continue; if (!entry.isDirectory() && !entry.isSymbolicLink()) continue; - const dir = join71(baseDir, entry.name); + const dir = join61(baseDir, entry.name); if (platform3() === "linux") { foundDirectories.push(dir); continue; } - const pluginDir = join71(dir, "plugins"); + const pluginDir = join61(dir, "plugins"); try { - await fs9.stat(pluginDir); + await fs3.stat(pluginDir); foundDirectories.push(pluginDir); } catch {} } @@ -430469,7 +354080,7 @@ async function detectPluginDirectories(ideName) { async function isJetBrainsPluginInstalled(ideType) { const pluginDirs = await detectPluginDirectories(ideType); for (const dir of pluginDirs) { - const pluginPath = join71(dir, PLUGIN_PREFIX); + const pluginPath = join61(dir, PLUGIN_PREFIX); try { await getFsImplementation().stat(pluginPath); return true; @@ -430484,9 +354095,9 @@ async function isJetBrainsPluginInstalledMemoized(ideType, forceRefresh = false) return existing; } } - const promise3 = isJetBrainsPluginInstalled(ideType).then((result3) => { - pluginInstalledCache.set(ideType, result3); - return result3; + const promise3 = isJetBrainsPluginInstalled(ideType).then((result2) => { + pluginInstalledCache.set(ideType, result2); + return result2; }); pluginInstalledPromiseCache.set(ideType, promise3); return promise3; @@ -430543,11 +354154,11 @@ class WindowsToWSLConverter { } } try { - const result3 = execFileSync("wslpath", ["-u", windowsPath], { + const result2 = execFileSync("wslpath", ["-u", windowsPath], { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim(); - return result3; + return result2; } catch { return windowsPath.replace(/\\/g, "/").replace(/^([A-Z]):/i, (_, letter) => `/mnt/${letter.toLowerCase()}`); } @@ -430556,11 +354167,11 @@ class WindowsToWSLConverter { if (!wslPath) return wslPath; try { - const result3 = execFileSync("wslpath", ["-w", wslPath], { + const result2 = execFileSync("wslpath", ["-w", wslPath], { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim(); - return result3; + return result2; } catch { return wslPath; } @@ -431195,9 +354806,9 @@ function IdeOnboardingDialog(t0) { return t16; } function hasIdeOnboardingDialogBeenShown() { - const config4 = getGlobalConfig(); + const config2 = getGlobalConfig(); const terminal = envDynamic.terminal || "unknown"; - return config4.hasIdeOnboardingBeenShown?.[terminal] === true; + return config2.hasIdeOnboardingBeenShown?.[terminal] === true; } function markDialogAsShown() { if (hasIdeOnboardingDialogBeenShown()) { @@ -431227,8 +354838,8 @@ var init_IdeOnboardingDialog = __esm(() => { // src/utils/ide.ts import { createConnection } from "net"; -import * as os4 from "os"; -import { basename as basename14, join as join72, sep as pathSeparator, resolve as resolve25 } from "path"; +import * as os3 from "os"; +import { basename as basename12, join as join62, sep as pathSeparator, resolve as resolve19 } from "path"; function isProcessRunning2(pid) { try { process.kill(pid, 0); @@ -431249,14 +354860,14 @@ function makeAncestorPidLookup() { function isVSCodeIde(ide) { if (!ide) return false; - const config4 = supportedIdeConfigs[ide]; - return config4 && config4.ideKind === "vscode"; + const config2 = supportedIdeConfigs[ide]; + return config2 && config2.ideKind === "vscode"; } function isJetBrainsIde(ide) { if (!ide) return false; - const config4 = supportedIdeConfigs[ide]; - return config4 && config4.ideKind === "jetbrains"; + const config2 = supportedIdeConfigs[ide]; + return config2 && config2.ideKind === "jetbrains"; } function getTerminalIdeType() { if (!isSupportedTerminal()) { @@ -431272,7 +354883,7 @@ async function getSortedIdeLockfiles() { const entries = await getFsImplementation().readdir(ideLockFilePath); const lockEntries = entries.filter((file2) => file2.name.endsWith(".lock")); const stats = await Promise.all(lockEntries.map(async (file2) => { - const fullPath = join72(ideLockFilePath, file2.name); + const fullPath = join62(ideLockFilePath, file2.name); try { const fileStat = await getFsImplementation().stat(fullPath); return { path: fullPath, mtime: fileStat.mtime }; @@ -431281,22 +354892,22 @@ async function getSortedIdeLockfiles() { } })); return stats.filter((s) => s !== null); - } catch (error45) { - if (!isFsInaccessible(error45)) { - logError2(error45); + } catch (error41) { + if (!isFsInaccessible(error41)) { + logError2(error41); } return []; } })); return allLockfiles.flat().sort((a2, b) => b.mtime.getTime() - a2.mtime.getTime()).map((file2) => file2.path); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return []; } } -async function readIdeLockfile(path16) { +async function readIdeLockfile(path11) { try { - const content = await getFsImplementation().readFile(path16, { + const content = await getFsImplementation().readFile(path11, { encoding: "utf-8" }); let workspaceFolders = []; @@ -431319,7 +354930,7 @@ async function readIdeLockfile(path16) { workspaceFolders = content.split(` `).map((line) => line.trim()); } - const filename = path16.split(pathSeparator).pop(); + const filename = path11.split(pathSeparator).pop(); if (!filename) return null; const port = filename.replace(".lock", ""); @@ -431332,14 +354943,14 @@ async function readIdeLockfile(path16) { runningInWindows, authToken }; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return null; } } async function checkIdeConnection(host, port, timeout = 500) { try { - return new Promise((resolve26) => { + return new Promise((resolve20) => { const socket = createConnection({ host, port, @@ -431347,14 +354958,14 @@ async function checkIdeConnection(host, port, timeout = 500) { }); socket.on("connect", () => { socket.destroy(); - resolve26(true); + resolve20(true); }); socket.on("error", () => { - resolve26(false); + resolve20(false); }); socket.on("timeout", () => { socket.destroy(); - resolve26(false); + resolve20(false); }); }); } catch (_) { @@ -431362,7 +354973,7 @@ async function checkIdeConnection(host, port, timeout = 500) { } } async function getIdeLockfilesPaths() { - const paths2 = [join72(getClaudeConfigHomeDir(), "ide")]; + const paths2 = [join62(getClaudeConfigHomeDir(), "ide")]; if (getPlatform() !== "wsl") { return paths2; } @@ -431370,7 +354981,7 @@ async function getIdeLockfilesPaths() { if (windowsHome) { const converter = new WindowsToWSLConverter(process.env.WSL_DISTRO_NAME); const wslPath = converter.toLocalPath(windowsHome); - paths2.push(resolve25(wslPath, ".claude", "ide")); + paths2.push(resolve19(wslPath, ".claude", "ide")); } try { const usersDir = "/mnt/c/Users"; @@ -431382,13 +354993,13 @@ async function getIdeLockfilesPaths() { if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") { continue; } - paths2.push(join72(usersDir, user.name, ".claude", "ide")); + paths2.push(join62(usersDir, user.name, ".claude", "ide")); } - } catch (error45) { - if (isFsInaccessible(error45)) { - logForDebugging(`WSL IDE lockfile path detection failed (${error45.code}): ${errorMessage(error45)}`); + } catch (error41) { + if (isFsInaccessible(error41)) { + logForDebugging(`WSL IDE lockfile path detection failed (${error41.code}): ${errorMessage(error41)}`); } else { - logError2(error45); + logError2(error41); } } return paths2; @@ -431401,8 +355012,8 @@ async function cleanupStaleIdeLockfiles() { if (!lockfileInfo) { try { await getFsImplementation().unlink(lockfilePath); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } continue; } @@ -431428,13 +355039,13 @@ async function cleanupStaleIdeLockfiles() { if (shouldDelete) { try { await getFsImplementation().unlink(lockfilePath); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } async function maybeInstallIDEExtension(ideType) { @@ -431451,10 +355062,10 @@ async function maybeInstallIDEExtension(ideType) { installedVersion, ideType }; - } catch (error45) { + } catch (error41) { logEvent("tengu_ext_install_error", {}); - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); - logError2(error45); + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); + logError2(error41); return { installed: false, error: errorMessage2, @@ -431473,7 +355084,7 @@ async function findAvailableIDE() { const startTime = Date.now(); while (Date.now() - startTime < 30000 && !signal.aborted) { if (getIsScrollDraining()) { - await sleep4(1000, signal); + await sleep2(1000, signal); continue; } const ides = await detectIDEs(false); @@ -431483,7 +355094,7 @@ async function findAvailableIDE() { if (ides.length === 1) { return ides[0]; } - await sleep4(1000, signal); + await sleep2(1000, signal); } return null; } @@ -431500,13 +355111,13 @@ async function detectIDEs(includeInvalid) { for (const lockfileInfo of lockfileInfos) { if (!lockfileInfo) continue; - let isValid3 = false; + let isValid2 = false; if (isEnvTruthy(process.env.CLAUDE_CODE_IDE_SKIP_VALID_CHECK)) { - isValid3 = true; + isValid2 = true; } else if (lockfileInfo.port === envPort) { - isValid3 = true; + isValid2 = true; } else { - isValid3 = lockfileInfo.workspaceFolders.some((idePath) => { + isValid2 = lockfileInfo.workspaceFolders.some((idePath) => { if (!idePath) return false; let localPath = idePath; @@ -431514,14 +355125,14 @@ async function detectIDEs(includeInvalid) { if (!checkWSLDistroMatch(idePath, process.env.WSL_DISTRO_NAME)) { return false; } - const resolvedOriginal = resolve25(localPath).normalize("NFC"); + const resolvedOriginal = resolve19(localPath).normalize("NFC"); if (cwd2 === resolvedOriginal || cwd2.startsWith(resolvedOriginal + pathSeparator)) { return true; } const converter = new WindowsToWSLConverter(process.env.WSL_DISTRO_NAME); localPath = converter.toLocalPath(idePath); } - const resolvedPath = resolve25(localPath).normalize("NFC"); + const resolvedPath = resolve19(localPath).normalize("NFC"); if (getPlatform() === "windows") { const normalizedCwd = cwd2.replace(/^[a-zA-Z]:/, (match) => match.toUpperCase()); const normalizedResolvedPath = resolvedPath.replace(/^[a-zA-Z]:/, (match) => match.toUpperCase()); @@ -431530,7 +355141,7 @@ async function detectIDEs(includeInvalid) { return cwd2 === resolvedPath || cwd2.startsWith(resolvedPath + pathSeparator); }); } - if (!isValid3 && !includeInvalid) { + if (!isValid2 && !includeInvalid) { continue; } if (needsAncestryCheck) { @@ -431560,7 +355171,7 @@ async function detectIDEs(includeInvalid) { name: ideName, workspaceFolders: lockfileInfo.workspaceFolders, port: lockfileInfo.port, - isValid: isValid3, + isValid: isValid2, authToken: lockfileInfo.authToken, ideRunningInWindows: lockfileInfo.runningInWindows }); @@ -431571,13 +355182,13 @@ async function detectIDEs(includeInvalid) { return envPortMatch; } } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } return detectedIDEs; } -async function maybeNotifyIDEConnected(client5) { - await client5.notification({ +async function maybeNotifyIDEConnected(client2) { + await client2.notification({ method: "ide_connected", params: { pid: process.pid @@ -431585,17 +355196,17 @@ async function maybeNotifyIDEConnected(client5) { }); } function hasAccessToIDEExtensionDiffFeature(mcpClients) { - return mcpClients.some((client5) => client5.type === "connected" && client5.name === "ide"); + return mcpClients.some((client2) => client2.type === "connected" && client2.name === "ide"); } async function isIDEExtensionInstalled(ideType) { if (isVSCodeIde(ideType)) { const command = await getVSCodeIDECommand(ideType); if (command) { try { - const result3 = await execFileNoThrowWithCwd(command, ["--list-extensions"], { + const result2 = await execFileNoThrowWithCwd(command, ["--list-extensions"], { env: getInstallationEnv() }); - if (result3.stdout?.includes(EXTENSION_ID)) { + if (result2.stdout?.includes(EXTENSION_ID)) { return true; } } catch {} @@ -431614,12 +355225,12 @@ async function installIDEExtension(ideType) { } let version2 = await getInstalledVSCodeExtensionVersion(command); if (!version2 || lt2(version2, getClaudeCodeVersion())) { - await sleep4(500); - const result3 = await execFileNoThrowWithCwd(command, ["--force", "--install-extension", "anthropic.claude-code"], { + await sleep2(500); + const result2 = await execFileNoThrowWithCwd(command, ["--force", "--install-extension", "anthropic.claude-code"], { env: getInstallationEnv() }); - if (result3.code !== 0) { - throw new Error(`${result3.code}: ${result3.error} ${result3.stderr}`); + if (result2.code !== 0) { + throw new Error(`${result2.code}: ${result2.error} ${result2.stderr}`); } version2 = getClaudeCodeVersion(); } @@ -431661,7 +355272,7 @@ function getVSCodeIDECommandByParentProcess() { return null; } let pid = process.ppid; - for (let i4 = 0;i4 < 10; i4++) { + for (let i3 = 0;i3 < 10; i3++) { if (!pid || pid === 0 || pid === 1) break; const command = execSyncWithDefaults_DEPRECATED(`ps -o command= -p ${pid}`)?.trim(); @@ -431715,26 +355326,26 @@ async function getVSCodeIDECommand(ideType) { return null; } async function isCursorInstalled() { - const result3 = await execFileNoThrow("cursor", ["--version"]); - return result3.code === 0; + const result2 = await execFileNoThrow("cursor", ["--version"]); + return result2.code === 0; } async function isWindsurfInstalled() { - const result3 = await execFileNoThrow("windsurf", ["--version"]); - return result3.code === 0; + const result2 = await execFileNoThrow("windsurf", ["--version"]); + return result2.code === 0; } async function isVSCodeInstalled() { - const result3 = await execFileNoThrow("code", ["--help"]); - return result3.code === 0 && Boolean(result3.stdout?.includes("Visual Studio Code")); + const result2 = await execFileNoThrow("code", ["--help"]); + return result2.code === 0 && Boolean(result2.stdout?.includes("Visual Studio Code")); } async function detectRunningIDEsImpl() { const runningIDEs = []; try { const platform4 = getPlatform(); if (platform4 === "macos") { - const result3 = await execa('ps aux | grep -E "Visual Studio Code|Code Helper|Cursor Helper|Windsurf Helper|IntelliJ IDEA|PyCharm|WebStorm|PhpStorm|RubyMine|CLion|GoLand|Rider|DataGrip|AppCode|DataSpell|Aqua|Gateway|Fleet|Android Studio" | grep -v grep', { shell: true, reject: false }); - const stdout = result3.stdout ?? ""; - for (const [ide, config4] of Object.entries(supportedIdeConfigs)) { - for (const keyword of config4.processKeywordsMac) { + const result2 = await execa('ps aux | grep -E "Visual Studio Code|Code Helper|Cursor Helper|Windsurf Helper|IntelliJ IDEA|PyCharm|WebStorm|PhpStorm|RubyMine|CLion|GoLand|Rider|DataGrip|AppCode|DataSpell|Aqua|Gateway|Fleet|Android Studio" | grep -v grep', { shell: true, reject: false }); + const stdout = result2.stdout ?? ""; + for (const [ide, config2] of Object.entries(supportedIdeConfigs)) { + for (const keyword of config2.processKeywordsMac) { if (stdout.includes(keyword)) { runningIDEs.push(ide); break; @@ -431742,11 +355353,11 @@ async function detectRunningIDEsImpl() { } } } else if (platform4 === "windows") { - const result3 = await execa('tasklist | findstr /I "Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe webstorm64.exe phpstorm64.exe rubymine64.exe clion64.exe goland64.exe rider64.exe datagrip64.exe appcode.exe dataspell64.exe aqua64.exe gateway64.exe fleet.exe studio64.exe"', { shell: true, reject: false }); - const stdout = result3.stdout ?? ""; + const result2 = await execa('tasklist | findstr /I "Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe webstorm64.exe phpstorm64.exe rubymine64.exe clion64.exe goland64.exe rider64.exe datagrip64.exe appcode.exe dataspell64.exe aqua64.exe gateway64.exe fleet.exe studio64.exe"', { shell: true, reject: false }); + const stdout = result2.stdout ?? ""; const normalizedStdout = stdout.toLowerCase(); - for (const [ide, config4] of Object.entries(supportedIdeConfigs)) { - for (const keyword of config4.processKeywordsWindows) { + for (const [ide, config2] of Object.entries(supportedIdeConfigs)) { + for (const keyword of config2.processKeywordsWindows) { if (normalizedStdout.includes(keyword.toLowerCase())) { runningIDEs.push(ide); break; @@ -431754,11 +355365,11 @@ async function detectRunningIDEsImpl() { } } } else if (platform4 === "linux") { - const result3 = await execa('ps aux | grep -E "code|cursor|windsurf|idea|pycharm|webstorm|phpstorm|rubymine|clion|goland|rider|datagrip|dataspell|aqua|gateway|fleet|android-studio" | grep -v grep', { shell: true, reject: false }); - const stdout = result3.stdout ?? ""; + const result2 = await execa('ps aux | grep -E "code|cursor|windsurf|idea|pycharm|webstorm|phpstorm|rubymine|clion|goland|rider|datagrip|dataspell|aqua|gateway|fleet|android-studio" | grep -v grep', { shell: true, reject: false }); + const stdout = result2.stdout ?? ""; const normalizedStdout = stdout.toLowerCase(); - for (const [ide, config4] of Object.entries(supportedIdeConfigs)) { - for (const keyword of config4.processKeywordsLinux) { + for (const [ide, config2] of Object.entries(supportedIdeConfigs)) { + for (const keyword of config2.processKeywordsLinux) { if (normalizedStdout.includes(keyword)) { if (ide !== "vscode") { runningIDEs.push(ide); @@ -431771,15 +355382,15 @@ async function detectRunningIDEsImpl() { } } } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } return runningIDEs; } async function detectRunningIDEs() { - const result3 = await detectRunningIDEsImpl(); - cachedRunningIDEs = result3; - return result3; + const result2 = await detectRunningIDEsImpl(); + cachedRunningIDEs = result2; + return result2; } async function detectRunningIDEsCached() { if (cachedRunningIDEs === null) { @@ -431788,26 +355399,26 @@ async function detectRunningIDEsCached() { return cachedRunningIDEs; } function getConnectedIdeName(mcpClients) { - const ideClient = mcpClients.find((client5) => client5.type === "connected" && client5.name === "ide"); + const ideClient = mcpClients.find((client2) => client2.type === "connected" && client2.name === "ide"); return getIdeClientName(ideClient); } function getIdeClientName(ideClient) { - const config4 = ideClient?.config; - return config4?.type === "sse-ide" || config4?.type === "ws-ide" ? config4.ideName : isSupportedTerminal() ? toIDEDisplayName(envDynamic.terminal) : null; + const config2 = ideClient?.config; + return config2?.type === "sse-ide" || config2?.type === "ws-ide" ? config2.ideName : isSupportedTerminal() ? toIDEDisplayName(envDynamic.terminal) : null; } function toIDEDisplayName(terminal) { if (!terminal) return "IDE"; - const config4 = supportedIdeConfigs[terminal]; - if (config4) { - return config4.displayName; + const config2 = supportedIdeConfigs[terminal]; + if (config2) { + return config2.displayName; } const editorName = EDITOR_DISPLAY_NAMES[terminal.toLowerCase().trim()]; if (editorName) { return editorName; } const command = terminal.split(" ")[0]; - const commandName = command ? basename14(command).toLowerCase() : null; + const commandName = command ? basename12(command).toLowerCase() : null; if (commandName) { const mappedName = EDITOR_DISPLAY_NAMES[commandName]; if (mappedName) { @@ -431821,7 +355432,7 @@ function getConnectedIdeClient(mcpClients) { if (!mcpClients) { return; } - const ideClient = mcpClients.find((client5) => client5.type === "connected" && client5.name === "ide"); + const ideClient = mcpClients.find((client2) => client2.type === "connected" && client2.name === "ide"); return ideClient?.type === "connected" ? ideClient : undefined; } async function closeOpenDiffs(ideClient) { @@ -431837,10 +355448,10 @@ async function initializeIdeIntegration(onIdeDetected, ideToInstallExtension, on if (ideType) { if (isVSCodeIde(ideType)) { isIDEExtensionInstalled(ideType).then(async (isAlreadyInstalled) => { - maybeInstallIDEExtension(ideType).catch((error45) => { + maybeInstallIDEExtension(ideType).catch((error41) => { const ideInstallationStatus = { installed: false, - error: error45.message || "Installation failed", + error: error41.message || "Installation failed", installedVersion: null, ideType }; @@ -431866,11 +355477,11 @@ async function initializeIdeIntegration(onIdeDetected, ideToInstallExtension, on } } async function installFromArtifactory(command) { - const npmrcPath = join72(os4.homedir(), ".npmrc"); + const npmrcPath = join62(os3.homedir(), ".npmrc"); let authToken = null; - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); try { - const npmrcContent = await fs9.readFile(npmrcPath, { + const npmrcContent = await fs3.readFile(npmrcPath, { encoding: "utf8" }); const lines = npmrcContent.split(` @@ -431882,9 +355493,9 @@ async function installFromArtifactory(command) { break; } } - } catch (error45) { - logError2(error45); - throw new Error(`Failed to read npm authentication: ${error45}`); + } catch (error41) { + logError2(error41); + throw new Error(`Failed to read npm authentication: ${error41}`); } if (!authToken) { throw new Error("No artifactory auth token found in ~/.npmrc"); @@ -431901,7 +355512,7 @@ async function installFromArtifactory(command) { throw new Error("No version found in artifactory response"); } const vsixUrl = `https://artifactory.infra.ant.dev/artifactory/armorcode-claude-code-internal/claude-vscode-releases/${version2}/claude-code.vsix`; - const tempVsixPath = join72(os4.tmpdir(), `claude-code-${version2}-${Date.now()}.vsix`); + const tempVsixPath = join62(os3.tmpdir(), `claude-code-${version2}-${Date.now()}.vsix`); try { const vsixResponse = await axios_default.get(vsixUrl, { headers: { @@ -431910,29 +355521,29 @@ async function installFromArtifactory(command) { responseType: "stream" }); const writeStream = getFsImplementation().createWriteStream(tempVsixPath); - await new Promise((resolve26, reject3) => { + await new Promise((resolve20, reject2) => { vsixResponse.data.pipe(writeStream); - writeStream.on("finish", resolve26); - writeStream.on("error", reject3); + writeStream.on("finish", resolve20); + writeStream.on("error", reject2); }); - await sleep4(500); - const result3 = await execFileNoThrowWithCwd(command, ["--force", "--install-extension", tempVsixPath], { + await sleep2(500); + const result2 = await execFileNoThrowWithCwd(command, ["--force", "--install-extension", tempVsixPath], { env: getInstallationEnv() }); - if (result3.code !== 0) { - throw new Error(`${result3.code}: ${result3.error} ${result3.stderr}`); + if (result2.code !== 0) { + throw new Error(`${result2.code}: ${result2.error} ${result2.stderr}`); } return version2; } finally { try { - await fs9.unlink(tempVsixPath); + await fs3.unlink(tempVsixPath); } catch {} } - } catch (error45) { - if (axios_default.isAxiosError(error45)) { - throw new Error(`Failed to fetch extension version from artifactory: ${error45.message}`); + } catch (error41) { + if (axios_default.isAxiosError(error41)) { + throw new Error(`Failed to fetch extension version from artifactory: ${error41.message}`); } - throw error45; + throw error41; } } var ideOnboardingDialog = () => (init_IdeOnboardingDialog(), __toCommonJS(exports_IdeOnboardingDialog)), supportedIdeConfigs, isSupportedVSCodeTerminal, isSupportedJetBrainsTerminal, isSupportedTerminal, getWindowsUserProfile, currentIDESearch = null, EXTENSION_ID, cachedRunningIDEs = null, EDITOR_DISPLAY_NAMES, detectHostIP; @@ -431943,7 +355554,7 @@ var init_ide = __esm(() => { init_memoize(); init_analytics(); init_state(); - init_client10(); + init_client6(); init_config2(); init_env(); init_envUtils(); @@ -432153,7 +355764,7 @@ var init_ide = __esm(() => { // src/utils/xdg.ts import { homedir as osHomedir2 } from "os"; -import { join as join73 } from "path"; +import { join as join63 } from "path"; function resolveOptions(options2) { return { env: options2?.env ?? process.env, @@ -432161,27 +355772,27 @@ function resolveOptions(options2) { }; } function getXDGStateHome(options2) { - const { env: env5, home } = resolveOptions(options2); - return env5.XDG_STATE_HOME ?? join73(home, ".local", "state"); + const { env: env4, home } = resolveOptions(options2); + return env4.XDG_STATE_HOME ?? join63(home, ".local", "state"); } function getXDGCacheHome(options2) { - const { env: env5, home } = resolveOptions(options2); - return env5.XDG_CACHE_HOME ?? join73(home, ".cache"); + const { env: env4, home } = resolveOptions(options2); + return env4.XDG_CACHE_HOME ?? join63(home, ".cache"); } function getXDGDataHome(options2) { - const { env: env5, home } = resolveOptions(options2); - return env5.XDG_DATA_HOME ?? join73(home, ".local", "share"); + const { env: env4, home } = resolveOptions(options2); + return env4.XDG_DATA_HOME ?? join63(home, ".local", "share"); } function getUserBinDir(options2) { const { home } = resolveOptions(options2); - return join73(home, ".local", "bin"); + return join63(home, ".local", "bin"); } var init_xdg = () => {}; // src/utils/nativeInstaller/download.ts -import { createHash as createHash14 } from "crypto"; -import { chmod as chmod4, writeFile as writeFile15 } from "fs/promises"; -import { join as join74 } from "path"; +import { createHash as createHash13 } from "crypto"; +import { chmod as chmod4, writeFile as writeFile13 } from "fs/promises"; +import { join as join64 } from "path"; async function getLatestVersionFromArtifactory(tag2 = "latest") { const startTime = Date.now(); const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [ @@ -432202,9 +355813,9 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") { source_npm: true, exit_code: code }); - const error45 = new Error(`npm view failed with code ${code}: ${stderr}`); - logError2(error45); - throw error45; + const error41 = new Error(`npm view failed with code ${code}: ${stderr}`); + logError2(error41); + throw error41; } logEvent("tengu_version_check_success", { latency_ms: latencyMs, @@ -432227,12 +355838,12 @@ async function getLatestVersionFromBinaryRepo(channel = "latest", baseUrl, authC latency_ms: latencyMs }); return response.data.trim(); - } catch (error45) { + } catch (error41) { const latencyMs = Date.now() - startTime; - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); let httpStatus; - if (axios_default.isAxiosError(error45) && error45.response) { - httpStatus = error45.response.status; + if (axios_default.isAxiosError(error41) && error41.response) { + httpStatus = error41.response.status; } logEvent("tengu_version_check_failure", { latency_ms: latencyMs, @@ -432263,9 +355874,9 @@ async function getLatestVersion2(channelOrVersion) { return getLatestVersionFromBinaryRepo(channel, GCS_BUCKET_URL2); } async function downloadVersionFromArtifactory(version2, stagingPath) { - const fs9 = getFsImplementation(); - await fs9.rm(stagingPath, { recursive: true, force: true }); - const platform4 = getPlatform3(); + const fs3 = getFsImplementation(); + await fs3.rm(stagingPath, { recursive: true, force: true }); + const platform4 = getPlatform2(); const platformPackageName = `${MACRO.NATIVE_PACKAGE_URL}-${platform4}`; logForDebugging(`Fetching integrity hash for ${platformPackageName}@${version2}`); const { @@ -432290,7 +355901,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) { throw new Error(`Failed to fetch integrity hash for ${platformPackageName}@${version2}`); } logForDebugging(`Got integrity hash for ${platform4}: ${integrity}`); - await fs9.mkdir(stagingPath); + await fs3.mkdir(stagingPath); const packageJson = { name: "claude-native-installer", version: "0.0.1", @@ -432323,15 +355934,15 @@ async function downloadVersionFromArtifactory(version2, stagingPath) { } } }; - writeFileSync_DEPRECATED(join74(stagingPath, "package.json"), jsonStringify(packageJson, null, 2), { encoding: "utf8", flush: true }); - writeFileSync_DEPRECATED(join74(stagingPath, "package-lock.json"), jsonStringify(packageLock, null, 2), { encoding: "utf8", flush: true }); - const result3 = await execFileNoThrowWithCwd("npm", ["ci", "--prefer-online", "--registry", ARTIFACTORY_REGISTRY_URL], { + writeFileSync_DEPRECATED(join64(stagingPath, "package.json"), jsonStringify(packageJson, null, 2), { encoding: "utf8", flush: true }); + writeFileSync_DEPRECATED(join64(stagingPath, "package-lock.json"), jsonStringify(packageLock, null, 2), { encoding: "utf8", flush: true }); + const result2 = await execFileNoThrowWithCwd("npm", ["ci", "--prefer-online", "--registry", ARTIFACTORY_REGISTRY_URL], { timeout: 60000, preserveOutputOnError: true, cwd: stagingPath }); - if (result3.code !== 0) { - throw new Error(`npm ci failed with code ${result3.code}: ${result3.stderr}`); + if (result2.code !== 0) { + throw new Error(`npm ci failed with code ${result2.code}: ${result2.stderr}`); } logForDebugging(`Successfully downloaded and verified ${MACRO.NATIVE_PACKAGE_URL}@${version2}`); } @@ -432340,7 +355951,7 @@ function getStallTimeoutMs() { } async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath, requestConfig = {}) { let lastError; - for (let attempt3 = 1;attempt3 <= MAX_DOWNLOAD_RETRIES; attempt3++) { + for (let attempt2 = 1;attempt2 <= MAX_DOWNLOAD_RETRIES; attempt2++) { const controller = new AbortController; let stallTimer; const clearStallTimer = () => { @@ -432365,26 +355976,26 @@ async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath, ...requestConfig }); clearStallTimer(); - const hash2 = createHash14("sha256"); + const hash2 = createHash13("sha256"); hash2.update(response.data); const actualChecksum = hash2.digest("hex"); if (actualChecksum !== expectedChecksum) { throw new Error(`Checksum mismatch: expected ${expectedChecksum}, got ${actualChecksum}`); } - await writeFile15(binaryPath, Buffer.from(response.data)); + await writeFile13(binaryPath, Buffer.from(response.data)); await chmod4(binaryPath, 493); return; - } catch (error45) { + } catch (error41) { clearStallTimer(); - const isStallTimeout = axios_default.isCancel(error45); + const isStallTimeout = axios_default.isCancel(error41); if (isStallTimeout) { lastError = new StallTimeoutError; } else { - lastError = toError(error45); + lastError = toError(error41); } - if (isStallTimeout && attempt3 < MAX_DOWNLOAD_RETRIES) { - logForDebugging(`Download stalled on attempt ${attempt3}/${MAX_DOWNLOAD_RETRIES}, retrying...`); - await sleep4(1000); + if (isStallTimeout && attempt2 < MAX_DOWNLOAD_RETRIES) { + logForDebugging(`Download stalled on attempt ${attempt2}/${MAX_DOWNLOAD_RETRIES}, retrying...`); + await sleep2(1000); continue; } throw lastError; @@ -432393,9 +356004,9 @@ async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath, throw lastError ?? new Error("Download failed after all retries"); } async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, authConfig) { - const fs9 = getFsImplementation(); - await fs9.rm(stagingPath, { recursive: true, force: true }); - const platform4 = getPlatform3(); + const fs3 = getFsImplementation(); + await fs3.rm(stagingPath, { recursive: true, force: true }); + const platform4 = getPlatform2(); const startTime = Date.now(); logEvent("tengu_binary_download_attempt", {}); let manifest; @@ -432406,12 +356017,12 @@ async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, aut ...authConfig }); manifest = manifestResponse.data; - } catch (error45) { + } catch (error41) { const latencyMs = Date.now() - startTime; - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); let httpStatus; - if (axios_default.isAxiosError(error45) && error45.response) { - httpStatus = error45.response.status; + if (axios_default.isAxiosError(error41) && error41.response) { + httpStatus = error41.response.status; } logEvent("tengu_binary_manifest_fetch_failure", { latency_ms: latencyMs, @@ -432419,7 +356030,7 @@ async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, aut is_timeout: errorMessage2.includes("timeout") }); logError2(new Error(`Failed to fetch manifest from ${baseUrl}/${version2}/manifest.json: ${errorMessage2}`)); - throw error45; + throw error41; } const platformInfo = manifest.platforms[platform4]; if (!platformInfo) { @@ -432429,20 +356040,20 @@ async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, aut const expectedChecksum = platformInfo.checksum; const binaryName = getBinaryName(platform4); const binaryUrl = `${baseUrl}/${version2}/${platform4}/${binaryName}`; - await fs9.mkdir(stagingPath); - const binaryPath = join74(stagingPath, binaryName); + await fs3.mkdir(stagingPath); + const binaryPath = join64(stagingPath, binaryName); try { await downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath, authConfig || {}); const latencyMs = Date.now() - startTime; logEvent("tengu_binary_download_success", { latency_ms: latencyMs }); - } catch (error45) { + } catch (error41) { const latencyMs = Date.now() - startTime; - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); let httpStatus; - if (axios_default.isAxiosError(error45) && error45.response) { - httpStatus = error45.response.status; + if (axios_default.isAxiosError(error41) && error41.response) { + httpStatus = error41.response.status; } logEvent("tengu_binary_download_failure", { latency_ms: latencyMs, @@ -432451,7 +356062,7 @@ async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, aut is_checksum_mismatch: errorMessage2.includes("Checksum mismatch") }); logError2(new Error(`Failed to download binary from ${binaryUrl}: ${errorMessage2}`)); - throw error45; + throw error41; } } async function downloadVersion(version2, stagingPath) { @@ -432491,7 +356102,7 @@ var init_download = __esm(() => { }); // src/utils/nativeInstaller/pidLock.ts -import { basename as basename15, join as join75 } from "path"; +import { basename as basename13, join as join65 } from "path"; function isPidBasedLockingEnabled() { const envVar = process.env.ENABLE_PID_BASED_VERSION_LOCKING; if (isEnvTruthy(envVar)) { @@ -432533,9 +356144,9 @@ function isClaudeProcess(pid, expectedExecPath) { } } function readLockContent(lockFilePath) { - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); try { - const content = fs9.readFileSync(lockFilePath, { encoding: "utf8" }); + const content = fs3.readFileSync(lockFilePath, { encoding: "utf8" }); if (!content || content.trim() === "") { return null; } @@ -432561,9 +356172,9 @@ function isLockActive(lockFilePath) { logForDebugging(`Lock PID ${pid} is running but does not appear to be Claude - treating as stale`); return false; } - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); try { - const stats = fs9.statSync(lockFilePath); + const stats = fs3.statSync(lockFilePath); const age = Date.now() - stats.mtimeMs; if (age > FALLBACK_STALE_MS) { if (!isProcessRunning3(pid)) { @@ -432574,24 +356185,24 @@ function isLockActive(lockFilePath) { return true; } function writeLockFile(lockFilePath, content) { - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); const tempPath = `${lockFilePath}.tmp.${process.pid}.${Date.now()}`; try { writeFileSync_DEPRECATED(tempPath, jsonStringify(content, null, 2), { encoding: "utf8", flush: true }); - fs9.renameSync(tempPath, lockFilePath); - } catch (error45) { + fs3.renameSync(tempPath, lockFilePath); + } catch (error41) { try { - fs9.unlinkSync(tempPath); + fs3.unlinkSync(tempPath); } catch {} - throw error45; + throw error41; } } async function tryAcquireLock(versionPath, lockFilePath) { - const fs9 = getFsImplementation(); - const versionName = basename15(versionPath); + const fs3 = getFsImplementation(); + const versionName = basename13(versionPath); if (isLockActive(lockFilePath)) { const existingContent = readLockContent(lockFilePath); logForDebugging(`Cannot acquire lock for ${versionName} - held by PID ${existingContent?.pid}`); @@ -432614,15 +356225,15 @@ async function tryAcquireLock(versionPath, lockFilePath) { try { const currentContent = readLockContent(lockFilePath); if (currentContent?.pid === process.pid) { - fs9.unlinkSync(lockFilePath); + fs3.unlinkSync(lockFilePath); logForDebugging(`Released PID lock for ${versionName}`); } - } catch (error45) { - logForDebugging(`Failed to release lock for ${versionName}: ${error45}`); + } catch (error41) { + logForDebugging(`Failed to release lock for ${versionName}: ${error41}`); } }; - } catch (error45) { - logForDebugging(`Failed to acquire lock for ${versionName}: ${error45}`); + } catch (error41) { + logForDebugging(`Failed to acquire lock for ${versionName}: ${error41}`); return null; } } @@ -432654,12 +356265,12 @@ async function withLock(versionPath, lockFilePath, callback) { } } function getAllLockInfo(locksDir) { - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); const lockInfos = []; try { - const lockFiles = fs9.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock")); + const lockFiles = fs3.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock")); for (const lockFile of lockFiles) { - const lockFilePath = join75(locksDir, lockFile); + const lockFilePath = join65(locksDir, lockFile); const content = readLockContent(lockFilePath); if (content) { lockInfos.push({ @@ -432672,39 +356283,39 @@ function getAllLockInfo(locksDir) { }); } } - } catch (error45) { - if (isENOENT(error45)) { + } catch (error41) { + if (isENOENT(error41)) { return lockInfos; } - logError2(toError(error45)); + logError2(toError(error41)); } return lockInfos; } function cleanupStaleLocks(locksDir) { - const fs9 = getFsImplementation(); + const fs3 = getFsImplementation(); let cleanedCount = 0; try { - const lockEntries = fs9.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock")); + const lockEntries = fs3.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock")); for (const lockEntry of lockEntries) { - const lockFilePath = join75(locksDir, lockEntry); + const lockFilePath = join65(locksDir, lockEntry); try { - const stats = fs9.lstatSync(lockFilePath); + const stats = fs3.lstatSync(lockFilePath); if (stats.isDirectory()) { - fs9.rmSync(lockFilePath, { recursive: true, force: true }); + fs3.rmSync(lockFilePath, { recursive: true, force: true }); cleanedCount++; logForDebugging(`Cleaned up legacy directory lock: ${lockEntry}`); } else if (!isLockActive(lockFilePath)) { - fs9.unlinkSync(lockFilePath); + fs3.unlinkSync(lockFilePath); cleanedCount++; logForDebugging(`Cleaned up stale lock: ${lockEntry}`); } } catch {} } - } catch (error45) { - if (isENOENT(error45)) { + } catch (error41) { + if (isENOENT(error41)) { return 0; } - logError2(toError(error45)); + logError2(toError(error41)); } return cleanedCount; } @@ -432726,51 +356337,51 @@ import { constants as fsConstants3 } from "fs"; import { access as access3, chmod as chmod5, - copyFile as copyFile3, + copyFile as copyFile2, lstat as lstat5, mkdir as mkdir13, readdir as readdir11, readlink, realpath as realpath8, rename as rename2, - rm as rm5, + rm as rm3, rmdir, - stat as stat22, + stat as stat21, symlink as symlink2, unlink as unlink7, - writeFile as writeFile16 + writeFile as writeFile14 } from "fs/promises"; -import { homedir as homedir22 } from "os"; -import { basename as basename16, delimiter as delimiter3, dirname as dirname30, join as join76, resolve as resolve26 } from "path"; -function getPlatform3() { - const os5 = env3.platform; +import { homedir as homedir20 } from "os"; +import { basename as basename14, delimiter as delimiter3, dirname as dirname27, join as join66, resolve as resolve20 } from "path"; +function getPlatform2() { + const os4 = env3.platform; const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null; if (!arch) { - const error45 = new Error(`Unsupported architecture: ${process.arch}`); + const error41 = new Error(`Unsupported architecture: ${process.arch}`); logForDebugging(`Native installer does not support architecture: ${process.arch}`, { level: "error" }); - throw error45; + throw error41; } - if (os5 === "linux" && envDynamic.isMuslEnvironment()) { + if (os4 === "linux" && envDynamic.isMuslEnvironment()) { return `linux-${arch}-musl`; } - return `${os5}-${arch}`; + return `${os4}-${arch}`; } function getBinaryName(platform4) { return platform4.startsWith("win32") ? "claude.exe" : "claude"; } function getBaseDirectories() { - const platform4 = getPlatform3(); + const platform4 = getPlatform2(); const executableName = getBinaryName(platform4); return { - versions: join76(getXDGDataHome(), "claude", "versions"), - staging: join76(getXDGCacheHome(), "claude", "staging"), - locks: join76(getXDGStateHome(), "claude", "locks"), - executable: join76(getUserBinDir(), executableName) + versions: join66(getXDGDataHome(), "claude", "versions"), + staging: join66(getXDGCacheHome(), "claude", "staging"), + locks: join66(getXDGStateHome(), "claude", "locks"), + executable: join66(getUserBinDir(), executableName) }; } async function isPossibleClaudeBinary(filePath) { try { - const stats = await stat22(filePath); + const stats = await stat21(filePath); if (!stats.isFile() || stats.size === 0) { return false; } @@ -432784,16 +356395,16 @@ async function getVersionPaths(version2) { const dirs = getBaseDirectories(); const dirsToCreate = [dirs.versions, dirs.staging, dirs.locks]; await Promise.all(dirsToCreate.map((dir) => mkdir13(dir, { recursive: true }))); - const executableParentDir = dirname30(dirs.executable); + const executableParentDir = dirname27(dirs.executable); await mkdir13(executableParentDir, { recursive: true }); - const installPath = join76(dirs.versions, version2); + const installPath = join66(dirs.versions, version2); try { - await stat22(installPath); + await stat21(installPath); } catch { - await writeFile16(installPath, "", { encoding: "utf8" }); + await writeFile14(installPath, "", { encoding: "utf8" }); } return { - stagingPath: join76(dirs.staging, version2), + stagingPath: join66(dirs.staging, version2), installPath }; } @@ -432810,9 +356421,9 @@ async function tryWithVersionLock(versionFilePath, callback, retries = 0) { const success2 = await withLock(versionFilePath, lockfilePath, async () => { try { await callback(); - } catch (error45) { - logError2(error45); - throw error45; + } catch (error41) { + logError2(error41); + throw error41; } }); if (success2) { @@ -432826,7 +356437,7 @@ async function tryWithVersionLock(versionFilePath, callback, retries = 0) { attempts++; if (attempts < maxAttempts) { const timeout = Math.min(minTimeout * Math.pow(2, attempts - 1), maxTimeout); - await sleep4(timeout); + await sleep2(timeout); } } logEvent("tengu_version_lock_failed", { @@ -432848,8 +356459,8 @@ async function tryWithVersionLock(versionFilePath, callback, retries = 0) { maxTimeout: retries > 0 ? 5000 : 500 }, lockfilePath, - onCompromised: (err3) => { - logForDebugging(`NON-FATAL: Version lock was compromised during operation: ${err3.message}`, { level: "info" }); + onCompromised: (err2) => { + logForDebugging(`NON-FATAL: Version lock was compromised during operation: ${err2.message}`, { level: "info" }); } }); } catch (lockError) { @@ -432867,9 +356478,9 @@ async function tryWithVersionLock(versionFilePath, callback, retries = 0) { is_lifetime_lock: false }); return true; - } catch (error45) { - logError2(error45); - throw error45; + } catch (error41) { + logError2(error41); + throw error41; } } finally { if (release) { @@ -432878,23 +356489,23 @@ async function tryWithVersionLock(versionFilePath, callback, retries = 0) { } } async function atomicMoveToInstallPath(stagedBinaryPath, installPath) { - await mkdir13(dirname30(installPath), { recursive: true }); + await mkdir13(dirname27(installPath), { recursive: true }); const tempInstallPath = `${installPath}.tmp.${process.pid}.${Date.now()}`; try { - await copyFile3(stagedBinaryPath, tempInstallPath); + await copyFile2(stagedBinaryPath, tempInstallPath); await chmod5(tempInstallPath, 493); await rename2(tempInstallPath, installPath); logForDebugging(`Atomically installed binary to ${installPath}`); - } catch (error45) { + } catch (error41) { try { await unlink7(tempInstallPath); } catch {} - throw error45; + throw error41; } } async function installVersionFromPackage(stagingPath, installPath) { try { - const nodeModulesDir = join76(stagingPath, "node_modules", "@anthropic-ai"); + const nodeModulesDir = join66(stagingPath, "node_modules", "@anthropic-ai"); const entries = await readdir11(nodeModulesDir); const nativePackage = entries.find((entry) => entry.startsWith("claude-cli-native-")); if (!nativePackage) { @@ -432902,62 +356513,62 @@ async function installVersionFromPackage(stagingPath, installPath) { stage_find_package: true, error_package_not_found: true }); - const error45 = new Error("Could not find platform-specific native package"); - throw error45; + const error41 = new Error("Could not find platform-specific native package"); + throw error41; } - const stagedBinaryPath = join76(nodeModulesDir, nativePackage, "cli"); + const stagedBinaryPath = join66(nodeModulesDir, nativePackage, "cli"); try { - await stat22(stagedBinaryPath); + await stat21(stagedBinaryPath); } catch { logEvent("tengu_native_install_package_failure", { stage_binary_exists: true, error_binary_not_found: true }); - const error45 = new Error("Native binary not found in staged package"); - throw error45; + const error41 = new Error("Native binary not found in staged package"); + throw error41; } await atomicMoveToInstallPath(stagedBinaryPath, installPath); - await rm5(stagingPath, { recursive: true, force: true }); + await rm3(stagingPath, { recursive: true, force: true }); logEvent("tengu_native_install_package_success", {}); - } catch (error45) { - const msg = errorMessage(error45); + } catch (error41) { + const msg = errorMessage(error41); if (!msg.includes("Could not find platform-specific") && !msg.includes("Native binary not found")) { logEvent("tengu_native_install_package_failure", { stage_atomic_move: true, error_move_failed: true }); } - logError2(toError(error45)); - throw error45; + logError2(toError(error41)); + throw error41; } } async function installVersionFromBinary(stagingPath, installPath) { try { - const platform4 = getPlatform3(); + const platform4 = getPlatform2(); const binaryName = getBinaryName(platform4); - const stagedBinaryPath = join76(stagingPath, binaryName); + const stagedBinaryPath = join66(stagingPath, binaryName); try { - await stat22(stagedBinaryPath); + await stat21(stagedBinaryPath); } catch { logEvent("tengu_native_install_binary_failure", { stage_binary_exists: true, error_binary_not_found: true }); - const error45 = new Error("Staged binary not found"); - throw error45; + const error41 = new Error("Staged binary not found"); + throw error41; } await atomicMoveToInstallPath(stagedBinaryPath, installPath); - await rm5(stagingPath, { recursive: true, force: true }); + await rm3(stagingPath, { recursive: true, force: true }); logEvent("tengu_native_install_binary_success", {}); - } catch (error45) { - if (!errorMessage(error45).includes("Staged binary not found")) { + } catch (error41) { + if (!errorMessage(error41).includes("Staged binary not found")) { logEvent("tengu_native_install_binary_failure", { stage_atomic_move: true, error_move_failed: true }); } - logError2(toError(error45)); - throw error45; + logError2(toError(error41)); + throw error41; } } async function installVersion(stagingPath, installPath, downloadType) { @@ -432984,7 +356595,7 @@ async function performVersionUpdate(version2, forceReinstall) { if (!await isPossibleClaudeBinary(executablePath)) { let installPathExists = false; try { - await stat22(installPath); + await stat21(installPath); installPathExists = true; } catch {} throw new Error(`Failed to create executable at ${executablePath}. ` + `Source file exists: ${installPathExists}. ` + `Check write permissions to ${executablePath}.`); @@ -433076,31 +356687,31 @@ async function updateLatest(channelOrVersion, forceReinstall = false) { logForDebugging(`Successfully updated to version ${version2}`); return { success: true, latestVersion: version2 }; } -async function removeDirectoryIfEmpty(path16) { +async function removeDirectoryIfEmpty(path11) { try { - await rmdir(path16); - logForDebugging(`Removed empty directory at ${path16}`); - } catch (error45) { - const code = getErrnoCode(error45); + await rmdir(path11); + logForDebugging(`Removed empty directory at ${path11}`); + } catch (error41) { + const code = getErrnoCode(error41); if (code !== "ENOTDIR" && code !== "ENOENT" && code !== "ENOTEMPTY") { - logForDebugging(`Could not remove directory at ${path16}: ${error45}`); + logForDebugging(`Could not remove directory at ${path11}: ${error41}`); } } } async function updateSymlink(symlinkPath, targetPath) { - const platform4 = getPlatform3(); + const platform4 = getPlatform2(); const isWindows2 = platform4.startsWith("win32"); if (isWindows2) { try { - const parentDir2 = dirname30(symlinkPath); + const parentDir2 = dirname27(symlinkPath); await mkdir13(parentDir2, { recursive: true }); let existingStats; try { - existingStats = await stat22(symlinkPath); + existingStats = await stat21(symlinkPath); } catch {} if (existingStats) { try { - const targetStats = await stat22(targetPath); + const targetStats = await stat21(targetPath); if (existingStats.size === targetStats.size) { return false; } @@ -433108,7 +356719,7 @@ async function updateSymlink(symlinkPath, targetPath) { const oldFileName = `${symlinkPath}.old.${Date.now()}`; await rename2(symlinkPath, oldFileName); try { - await copyFile3(targetPath, symlinkPath); + await copyFile2(targetPath, symlinkPath); try { await unlink7(oldFileName); } catch {} @@ -433124,7 +356735,7 @@ async function updateSymlink(symlinkPath, targetPath) { } } else { try { - await copyFile3(targetPath, symlinkPath); + await copyFile2(targetPath, symlinkPath); } catch (e) { if (isENOENT(e)) { throw new Error(`Source file does not exist: ${targetPath}`); @@ -433133,12 +356744,12 @@ async function updateSymlink(symlinkPath, targetPath) { } } return true; - } catch (error45) { - logError2(new Error(`Failed to copy executable from ${targetPath} to ${symlinkPath}: ${error45}`)); + } catch (error41) { + logError2(new Error(`Failed to copy executable from ${targetPath} to ${symlinkPath}: ${error41}`)); return false; } } - const parentDir = dirname30(symlinkPath); + const parentDir = dirname27(symlinkPath); try { await mkdir13(parentDir, { recursive: true }); logForDebugging(`Created directory ${parentDir} for symlink`); @@ -433149,22 +356760,22 @@ async function updateSymlink(symlinkPath, targetPath) { try { let symlinkExists = false; try { - await stat22(symlinkPath); + await stat21(symlinkPath); symlinkExists = true; } catch {} if (symlinkExists) { try { const currentTarget = await readlink(symlinkPath); - const resolvedCurrentTarget = resolve26(dirname30(symlinkPath), currentTarget); - const resolvedTargetPath = resolve26(targetPath); + const resolvedCurrentTarget = resolve20(dirname27(symlinkPath), currentTarget); + const resolvedTargetPath = resolve20(targetPath); if (resolvedCurrentTarget === resolvedTargetPath) { return false; } } catch {} await unlink7(symlinkPath); } - } catch (error45) { - logError2(new Error(`Failed to check/remove existing symlink: ${error45}`)); + } catch (error41) { + logError2(new Error(`Failed to check/remove existing symlink: ${error41}`)); } const tempSymlink = `${symlinkPath}.tmp.${process.pid}.${Date.now()}`; try { @@ -433172,11 +356783,11 @@ async function updateSymlink(symlinkPath, targetPath) { await rename2(tempSymlink, symlinkPath); logForDebugging(`Atomically updated symlink ${symlinkPath} -> ${targetPath}`); return true; - } catch (error45) { + } catch (error41) { try { await unlink7(tempSymlink); } catch {} - logError2(new Error(`Failed to create symlink from ${symlinkPath} to ${targetPath}: ${error45}`)); + logError2(new Error(`Failed to create symlink from ${symlinkPath} to ${targetPath}: ${error41}`)); return false; } } @@ -433188,16 +356799,16 @@ async function checkInstall(force = false) { if (installationType === "development") { return []; } - const config4 = getGlobalConfig(); - const shouldCheckNative = force || installationType === "native" || config4.installMethod === "native"; + const config2 = getGlobalConfig(); + const shouldCheckNative = force || installationType === "native" || config2.installMethod === "native"; if (!shouldCheckNative) { return []; } const dirs = getBaseDirectories(); const messages = []; - const localBinDir = dirname30(dirs.executable); - const resolvedLocalBinPath = resolve26(localBinDir); - const platform4 = getPlatform3(); + const localBinDir = dirname27(dirs.executable); + const resolvedLocalBinPath = resolve20(localBinDir); + const platform4 = getPlatform2(); const isWindows2 = platform4.startsWith("win32"); try { await access3(localBinDir); @@ -433219,7 +356830,7 @@ async function checkInstall(force = false) { } else { try { const target = await readlink(dirs.executable); - const absoluteTarget = resolve26(dirname30(dirs.executable), target); + const absoluteTarget = resolve20(dirname27(dirs.executable), target); if (!await isPossibleClaudeBinary(absoluteTarget)) { messages.push({ message: `Claude symlink points to missing or invalid binary: ${target}`, @@ -433247,7 +356858,7 @@ async function checkInstall(force = false) { } const isInCurrentPath = (process.env.PATH || "").split(delimiter3).some((entry) => { try { - const resolvedEntry = resolve26(entry); + const resolvedEntry = resolve20(entry); if (isWindows2) { return resolvedEntry.toLowerCase() === resolvedLocalBinPath.toLowerCase(); } @@ -433268,7 +356879,7 @@ async function checkInstall(force = false) { const shellType = getShellType(); const configPaths = getShellConfigPaths(); const configFile = configPaths[shellType]; - const displayPath = configFile ? configFile.replace(homedir22(), "~") : "your shell config file"; + const displayPath = configFile ? configFile.replace(homedir20(), "~") : "your shell config file"; messages.push({ message: `Native installation exists but ~/.local/bin is not in your PATH. Run: @@ -433306,8 +356917,8 @@ async function installLatestImpl(channelOrVersion, forceReinstall = false) { lockHolderPid: updateResult.lockHolderPid }; } - const config4 = getGlobalConfig(); - if (config4.installMethod !== "native") { + const config2 = getGlobalConfig(); + if (config2.installMethod !== "native") { saveGlobalConfig((current) => ({ ...current, installMethod: "native", @@ -433326,7 +356937,7 @@ async function installLatestImpl(channelOrVersion, forceReinstall = false) { async function getVersionFromSymlink(symlinkPath) { try { const target = await readlink(symlinkPath); - const absoluteTarget = resolve26(dirname30(symlinkPath), target); + const absoluteTarget = resolve20(dirname27(symlinkPath), target); if (await isPossibleClaudeBinary(absoluteTarget)) { return absoluteTarget; } @@ -433334,15 +356945,15 @@ async function getVersionFromSymlink(symlinkPath) { return null; } function getLockFilePathFromVersionPath(dirs, versionPath) { - const versionName = basename16(versionPath); - return join76(dirs.locks, `${versionName}.lock`); + const versionName = basename14(versionPath); + return join66(dirs.locks, `${versionName}.lock`); } async function lockCurrentVersion() { const dirs = getBaseDirectories(); if (!process.execPath.includes(dirs.versions)) { return; } - const versionPath = resolve26(process.execPath); + const versionPath = resolve20(process.execPath); try { const lockfilePath = getLockFilePathFromVersionPath(dirs, versionPath); await mkdir13(dirs.locks, { recursive: true }); @@ -433368,8 +356979,8 @@ async function lockCurrentVersion() { stale: LOCK_STALE_MS, retries: 0, lockfilePath, - onCompromised: (err3) => { - logForDebugging(`NON-FATAL: Lock on running version was compromised: ${err3.message}`, { level: "info" }); + onCompromised: (err2) => { + logForDebugging(`NON-FATAL: Lock on running version was compromised: ${err2.message}`, { level: "info" }); } }); logEvent("tengu_version_lock_acquired", { @@ -433395,12 +357006,12 @@ async function lockCurrentVersion() { return; } } - } catch (error45) { - if (isENOENT(error45)) { + } catch (error41) { + if (isENOENT(error41)) { logForDebugging(`Cannot lock current version - file does not exist: ${versionPath}`, { level: "info" }); return; } - logForDebugging(`NON-FATAL: Failed to lock current version during execution ${errorMessage(error45)}`, { level: "info" }); + logForDebugging(`NON-FATAL: Failed to lock current version during execution ${errorMessage(error41)}`, { level: "info" }); } } function logLockAcquisitionError(versionPath, lockError) { @@ -433412,33 +357023,33 @@ async function forceRemoveLock(versionFilePath) { try { await unlink7(lockfilePath); logForDebugging(`Force-removed lock file at ${lockfilePath}`); - } catch (error45) { - logForDebugging(`Failed to force-remove lock file: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`Failed to force-remove lock file: ${errorMessage(error41)}`); } } async function cleanupOldVersions() { await Promise.resolve(); const dirs = getBaseDirectories(); const oneHourAgo = Date.now() - 3600000; - if (getPlatform3().startsWith("win32")) { - const executableDir = dirname30(dirs.executable); + if (getPlatform2().startsWith("win32")) { + const executableDir = dirname27(dirs.executable); try { - const files2 = await readdir11(executableDir); + const files = await readdir11(executableDir); let cleanedCount = 0; - for (const file2 of files2) { + for (const file2 of files) { if (!/^claude\.exe\.old\.\d+$/.test(file2)) continue; try { - await unlink7(join76(executableDir, file2)); + await unlink7(join66(executableDir, file2)); cleanedCount++; } catch {} } if (cleanedCount > 0) { logForDebugging(`Cleaned up ${cleanedCount} old Windows executables on startup`); } - } catch (error45) { - if (!isENOENT(error45)) { - logForDebugging(`Failed to clean up old Windows executables: ${error45}`); + } catch (error41) { + if (!isENOENT(error41)) { + logForDebugging(`Failed to clean up old Windows executables: ${error41}`); } } } @@ -433446,11 +357057,11 @@ async function cleanupOldVersions() { const stagingEntries = await readdir11(dirs.staging); let stagingCleanedCount = 0; for (const entry of stagingEntries) { - const stagingPath = join76(dirs.staging, entry); + const stagingPath = join66(dirs.staging, entry); try { - const stats = await stat22(stagingPath); + const stats = await stat21(stagingPath); if (stats.mtime.getTime() < oneHourAgo) { - await rm5(stagingPath, { recursive: true, force: true }); + await rm3(stagingPath, { recursive: true, force: true }); stagingCleanedCount++; logForDebugging(`Cleaned up old staging directory: ${entry}`); } @@ -433462,9 +357073,9 @@ async function cleanupOldVersions() { cleaned_count: stagingCleanedCount }); } - } catch (error45) { - if (!isENOENT(error45)) { - logForDebugging(`Failed to clean up staging directories: ${error45}`); + } catch (error41) { + if (!isENOENT(error41)) { + logForDebugging(`Failed to clean up staging directories: ${error41}`); } } if (isPidBasedLockingEnabled()) { @@ -433479,19 +357090,19 @@ async function cleanupOldVersions() { let versionEntries; try { versionEntries = await readdir11(dirs.versions); - } catch (error45) { - if (!isENOENT(error45)) { - logForDebugging(`Failed to readdir versions directory: ${error45}`); + } catch (error41) { + if (!isENOENT(error41)) { + logForDebugging(`Failed to readdir versions directory: ${error41}`); } return; } const versionFiles = []; let tempFilesCleanedCount = 0; for (const entry of versionEntries) { - const entryPath = join76(dirs.versions, entry); + const entryPath = join66(dirs.versions, entry); if (/\.tmp\.\d+\.\d+$/.test(entry)) { try { - const stats = await stat22(entryPath); + const stats = await stat21(entryPath); if (stats.mtime.getTime() < oneHourAgo) { await unlink7(entryPath); tempFilesCleanedCount++; @@ -433501,7 +357112,7 @@ async function cleanupOldVersions() { continue; } try { - const stats = await stat22(entryPath); + const stats = await stat21(entryPath); if (!stats.isFile()) continue; if (process.platform !== "win32" && stats.size > 0 && (stats.mode & 73) === 0) { @@ -433510,7 +357121,7 @@ async function cleanupOldVersions() { versionFiles.push({ name: entry, path: entryPath, - resolvedPath: resolve26(entryPath), + resolvedPath: resolve20(entryPath), mtime: stats.mtime }); } catch {} @@ -433528,7 +357139,7 @@ async function cleanupOldVersions() { const currentBinaryPath = process.execPath; const protectedVersions = new Set; if (currentBinaryPath && currentBinaryPath.includes(dirs.versions)) { - protectedVersions.add(resolve26(currentBinaryPath)); + protectedVersions.add(resolve20(currentBinaryPath)); } const currentSymlinkVersion = await getVersionFromSymlink(dirs.executable); if (currentSymlinkVersion) { @@ -433583,9 +357194,9 @@ async function cleanupOldVersions() { lockFailedCount++; logForDebugging(`Skipping deletion of ${version2.name} - locked by another process`); } - } catch (error45) { + } catch (error41) { errorCount++; - logError2(new Error(`Failed to delete version ${version2.name}: ${error45}`)); + logError2(new Error(`Failed to delete version ${version2.name}: ${error41}`)); } })); logEvent("tengu_native_version_cleanup", { @@ -433596,9 +357207,9 @@ async function cleanupOldVersions() { lock_failed_count: lockFailedCount, error_count: errorCount }); - } catch (error45) { - if (!isENOENT(error45)) { - logError2(new Error(`Version cleanup failed: ${error45}`)); + } catch (error41) { + if (!isENOENT(error41)) { + logError2(new Error(`Version cleanup failed: ${error41}`)); } } } @@ -433619,11 +357230,11 @@ async function removeInstalledSymlink() { } await unlink7(dirs.executable); logForDebugging(`Removed claude symlink at ${dirs.executable}`); - } catch (error45) { - if (isENOENT(error45)) { + } catch (error41) { + if (isENOENT(error41)) { return; } - logError2(new Error(`Failed to remove claude symlink: ${error45}`)); + logError2(new Error(`Failed to remove claude symlink: ${error41}`)); } } async function cleanupShellAliases() { @@ -433644,10 +357255,10 @@ async function cleanupShellAliases() { }); logForDebugging(`Cleaned up claude alias from ${shellType} config`); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); messages.push({ - message: `Failed to clean up ${configFile}: ${error45}`, + message: `Failed to clean up ${configFile}: ${error41}`, userActionRequired: false, type: "error" }); @@ -433679,10 +357290,10 @@ async function manualRemoveNpmPackage(packageName) { return false; } } - if (getPlatform3().startsWith("win32")) { - const binCmd = join76(globalPrefix, "claude.cmd"); - const binPs1 = join76(globalPrefix, "claude.ps1"); - const binExe = join76(globalPrefix, "claude"); + if (getPlatform2().startsWith("win32")) { + const binCmd = join66(globalPrefix, "claude.cmd"); + const binPs1 = join66(globalPrefix, "claude.ps1"); + const binExe = join66(globalPrefix, "claude"); if (await tryRemove(binCmd, "bin script")) { manuallyRemoved = true; } @@ -433693,14 +357304,14 @@ async function manualRemoveNpmPackage(packageName) { manuallyRemoved = true; } } else { - const binSymlink = join76(globalPrefix, "bin", "claude"); + const binSymlink = join66(globalPrefix, "bin", "claude"); if (await tryRemove(binSymlink, "bin symlink")) { manuallyRemoved = true; } } if (manuallyRemoved) { logForDebugging(`Successfully removed ${packageName} manually`); - const nodeModulesPath = getPlatform3().startsWith("win32") ? join76(globalPrefix, "node_modules", packageName) : join76(globalPrefix, "lib", "node_modules", packageName); + const nodeModulesPath = getPlatform2().startsWith("win32") ? join66(globalPrefix, "node_modules", packageName) : join66(globalPrefix, "lib", "node_modules", packageName); return { success: true, warning: `${packageName} executables removed, but node_modules directory was left intact for safety. You may manually delete it later at: ${nodeModulesPath}` @@ -433746,7 +357357,7 @@ async function attemptNpmUninstall(packageName) { return { success: false }; } async function cleanupNpmInstallations() { - const errors5 = []; + const errors4 = []; const warnings = []; let removed = 0; const codePackageResult = await attemptNpmUninstall("@anthropic-ai/claude-code"); @@ -433756,23 +357367,23 @@ async function cleanupNpmInstallations() { warnings.push(codePackageResult.warning); } } else if (codePackageResult.error) { - errors5.push(codePackageResult.error); + errors4.push(codePackageResult.error); } if (false) {} - const localInstallDir = join76(homedir22(), ".claude", "local"); + const localInstallDir = join66(homedir20(), ".claude", "local"); try { - await rm5(localInstallDir, { recursive: true }); + await rm3(localInstallDir, { recursive: true }); removed++; logForDebugging(`Removed local installation at ${localInstallDir}`); - } catch (error45) { - if (!isENOENT(error45)) { - errors5.push(`Failed to remove ${localInstallDir}: ${error45}`); - logForDebugging(`Failed to remove local installation: ${error45}`, { + } catch (error41) { + if (!isENOENT(error41)) { + errors4.push(`Failed to remove ${localInstallDir}: ${error41}`); + logForDebugging(`Failed to remove local installation: ${error41}`, { level: "error" }); } } - return { removed, errors: errors5, warnings }; + return { removed, errors: errors4, warnings }; } var VERSION_RETENTION_COUNT = 2, LOCK_STALE_MS, inFlightInstall = null; var init_installer = __esm(() => { @@ -433803,12 +357414,12 @@ var init_nativeInstaller = __esm(() => { // src/utils/settings/allErrors.ts function getSettingsWithAllErrors() { - const result3 = getSettingsWithErrors(); + const result2 = getSettingsWithErrors(); const scopes = ["user", "project", "local"]; const mcpErrors = scopes.flatMap((scope) => getMcpConfigsByScope(scope).errors); return { - settings: result3.settings, - errors: [...result3.errors, ...mcpErrors] + settings: result2.settings, + errors: [...result2.errors, ...mcpErrors] }; } var init_allErrors = __esm(() => { @@ -433828,7 +357439,7 @@ function buildSandboxProperties() { }]; } function buildIDEProperties(mcpClients, ideInstallationStatus = null, theme) { - const ideClient = mcpClients?.find((client5) => client5.name === "ide"); + const ideClient = mcpClients?.find((client2) => client2.name === "ide"); if (ideInstallationStatus) { const ideName = toIDEDisplayName(ideInstallationStatus.ideType); const pluginOrExtension = isJetBrainsIde(ideInstallationStatus.ideType) ? "plugin" : "extension"; @@ -433888,7 +357499,7 @@ function buildIDEProperties(mcpClients, ideInstallationStatus = null, theme) { return []; } function buildMcpProperties(clients = [], theme) { - const servers = clients.filter((client5) => client5.name !== "ide"); + const servers = clients.filter((client2) => client2.name !== "ide"); if (!servers.length) { return []; } @@ -433923,8 +357534,8 @@ function buildMcpProperties(clients = [], theme) { }]; } async function buildMemoryDiagnostics() { - const files2 = await getMemoryFiles(); - const largeFiles = getLargeMemoryFiles(files2); + const files = await getMemoryFiles(); + const largeFiles = getLargeMemoryFiles(files); const diagnostics = []; largeFiles.forEach((file2) => { const displayPath = getDisplayPath(file2.path); @@ -433986,7 +357597,7 @@ async function buildInstallationHealthDiagnostics() { errors: validationErrors } = getSettingsWithAllErrors(); if (validationErrors.length > 0) { - const invalidFiles = Array.from(new Set(validationErrors.map((error45) => error45.file))); + const invalidFiles = Array.from(new Set(validationErrors.map((error41) => error41.file))); const fileList = invalidFiles.join(", "); items.push(`Found invalid settings files: ${fileList}. They will be ignored.`); } @@ -434163,7 +357774,7 @@ var init_status = __esm(() => { init_source(); init_figures(); init_ink2(); - init_auth2(); + init_auth(); init_claudemd(); init_doctorDiagnostic(); init_envUtils(); @@ -434218,9 +357829,9 @@ async function installOAuthTokens(tokens) { warning: storageResult.warning }); } - await fetchAndStoreUserRoles(tokens.accessToken).catch((err3) => logForDebugging(String(err3), { level: "error" })); + await fetchAndStoreUserRoles(tokens.accessToken).catch((err2) => logForDebugging(String(err2), { level: "error" })); if (shouldUseClaudeAIAuth(tokens.scopes)) { - await fetchAndStoreClaudeCodeFirstTokenDate().catch((err3) => logForDebugging(String(err3), { level: "error" })); + await fetchAndStoreClaudeCodeFirstTokenDate().catch((err2) => logForDebugging(String(err2), { level: "error" })); } else { const apiKey = await createAndStoreApiKey(tokens.accessToken); if (!apiKey) { @@ -434275,10 +357886,10 @@ async function authLogin({ process.stdout.write(`Login successful. `); process.exit(0); - } catch (err3) { - logError2(err3); - const sslHint = getSSLErrorHint(err3); - process.stderr.write(`Login failed: ${errorMessage(err3)} + } catch (err2) { + logError2(err2); + const sslHint = getSSLErrorHint(err2); + process.stderr.write(`Login failed: ${errorMessage(err2)} ${sslHint ? sslHint + ` ` : ""}`); process.exit(1); @@ -434288,7 +357899,7 @@ ${sslHint ? sslHint + ` const oauthService = new OAuthService; try { logEvent("tengu_oauth_flow_start", { loginWithClaudeAi }); - const result3 = await oauthService.startOAuthFlow(async (url3) => { + const result2 = await oauthService.startOAuthFlow(async (url3) => { process.stdout.write(`Opening browser to sign in… `); process.stdout.write(`If the browser didn't open, visit: ${url3} @@ -434299,7 +357910,7 @@ ${sslHint ? sslHint + ` loginMethod: resolvedLoginMethod, orgUUID }); - await installOAuthTokens(result3); + await installOAuthTokens(result2); const orgResult = await validateForceLoginOrg(); if (!orgResult.valid) { process.stderr.write(orgResult.message + ` @@ -434310,10 +357921,10 @@ ${sslHint ? sslHint + ` process.stdout.write(`Login successful. `); process.exit(0); - } catch (err3) { - logError2(err3); - const sslHint = getSSLErrorHint(err3); - process.stderr.write(`Login failed: ${errorMessage(err3)} + } catch (err2) { + logError2(err2); + const sslHint = getSSLErrorHint(err2); + process.stderr.write(`Login failed: ${errorMessage(err2)} ${sslHint ? sslHint + ` ` : ""}`); process.exit(1); @@ -434405,7 +358016,7 @@ async function authLogout() { `); process.exit(0); } -var init_auth6 = __esm(() => { +var init_auth5 = __esm(() => { init_logout(); init_analytics(); init_errorUtils(); @@ -434413,7 +358024,7 @@ var init_auth6 = __esm(() => { init_client2(); init_getOauthProfile(); init_oauth2(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_envUtils(); @@ -434427,17 +358038,17 @@ var init_auth6 = __esm(() => { // node_modules/@xmldom/xmldom/lib/conventions.js var require_conventions = __commonJS((exports) => { - function find3(list2, predicate, ac) { + function find2(list2, predicate, ac) { if (ac === undefined) { ac = Array.prototype; } if (list2 && typeof ac.find === "function") { return ac.find.call(list2, predicate); } - for (var i4 = 0;i4 < list2.length; i4++) { - if (Object.prototype.hasOwnProperty.call(list2, i4)) { - var item = list2[i4]; - if (predicate.call(undefined, item, i4, list2)) { + for (var i3 = 0;i3 < list2.length; i3++) { + if (Object.prototype.hasOwnProperty.call(list2, i3)) { + var item = list2[i3]; + if (predicate.call(undefined, item, i3, list2)) { return item; } } @@ -434449,7 +358060,7 @@ var require_conventions = __commonJS((exports) => { } return oc && typeof oc.freeze === "function" ? oc.freeze(object4) : object4; } - function assign3(target, source) { + function assign2(target, source) { if (target === null || typeof target !== "object") { throw new TypeError("target is not an object"); } @@ -434479,8 +358090,8 @@ var require_conventions = __commonJS((exports) => { XML: "http://www.w3.org/XML/1998/namespace", XMLNS: "http://www.w3.org/2000/xmlns/" }); - exports.assign = assign3; - exports.find = find3; + exports.assign = assign2; + exports.find = find2; exports.freeze = freeze; exports.MIME_TYPE = MIME_TYPE; exports.NAMESPACE = NAMESPACE; @@ -434489,13 +358100,13 @@ var require_conventions = __commonJS((exports) => { // node_modules/@xmldom/xmldom/lib/dom.js var require_dom = __commonJS((exports) => { var conventions = require_conventions(); - var find3 = conventions.find; + var find2 = conventions.find; var NAMESPACE = conventions.NAMESPACE; - function notEmptyString(input11) { - return input11 !== ""; + function notEmptyString(input) { + return input !== ""; } - function splitOnASCIIWhitespace(input11) { - return input11 ? input11.split(/[\t\n\f\r ]+/).filter(notEmptyString) : []; + function splitOnASCIIWhitespace(input) { + return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : []; } function orderedSetReducer(current, element) { if (!current.hasOwnProperty(element)) { @@ -434503,13 +358114,13 @@ var require_dom = __commonJS((exports) => { } return current; } - function toOrderedSet(input11) { - if (!input11) + function toOrderedSet(input) { + if (!input) return []; - var list2 = splitOnASCIIWhitespace(input11); + var list2 = splitOnASCIIWhitespace(input); return Object.keys(list2.reduce(orderedSetReducer, {})); } - function arrayIncludes3(list2) { + function arrayIncludes2(list2) { return function(element) { return list2 && list2.indexOf(element) !== -1; }; @@ -434570,18 +358181,18 @@ var require_dom = __commonJS((exports) => { var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15); function DOMException2(code, message) { if (message instanceof Error) { - var error45 = message; + var error41 = message; } else { - error45 = this; + error41 = this; Error.call(this, ExceptionMessage[code]); this.message = ExceptionMessage[code]; if (Error.captureStackTrace) Error.captureStackTrace(this, DOMException2); } - error45.code = code; + error41.code = code; if (message) this.message = this.message + ": " + message; - return error45; + return error41; } DOMException2.prototype = Error.prototype; copy(ExceptionCode, DOMException2); @@ -434592,8 +358203,8 @@ var require_dom = __commonJS((exports) => { return index >= 0 && index < this.length ? this[index] : null; }, toString: function(isHTML, nodeFilter) { - for (var buf = [], i4 = 0;i4 < this.length; i4++) { - serializeToString(this[i4], buf, isHTML, nodeFilter); + for (var buf = [], i3 = 0;i3 < this.length; i3++) { + serializeToString(this[i3], buf, isHTML, nodeFilter); } return buf.join(""); }, @@ -434615,9 +358226,9 @@ var require_dom = __commonJS((exports) => { var ls = list2._refresh(list2._node); __set__(list2, "length", ls.length); if (!list2.$$length || ls.length < list2.$$length) { - for (var i4 = ls.length;i4 in list2; i4++) { - if (Object.prototype.hasOwnProperty.call(list2, i4)) { - delete list2[i4]; + for (var i3 = ls.length;i3 in list2; i3++) { + if (Object.prototype.hasOwnProperty.call(list2, i3)) { + delete list2[i3]; } } } @@ -434625,17 +358236,17 @@ var require_dom = __commonJS((exports) => { list2._inc = inc; } } - LiveNodeList.prototype.item = function(i4) { + LiveNodeList.prototype.item = function(i3) { _updateLiveList(this); - return this[i4] || null; + return this[i3] || null; }; _extends(LiveNodeList, NodeList); function NamedNodeMap() {} function _findNodeIndex(list2, node) { - var i4 = list2.length; - while (i4--) { - if (list2[i4] === node) { - return i4; + var i3 = list2.length; + while (i3--) { + if (list2[i3] === node) { + return i3; } } } @@ -434655,11 +358266,11 @@ var require_dom = __commonJS((exports) => { } } function _removeNamedNode(el, list2, attr) { - var i4 = _findNodeIndex(list2, attr); - if (i4 >= 0) { + var i3 = _findNodeIndex(list2, attr); + if (i3 >= 0) { var lastIndex = list2.length - 1; - while (i4 < lastIndex) { - list2[i4] = list2[++i4]; + while (i3 < lastIndex) { + list2[i3] = list2[++i3]; } list2.length = lastIndex; if (el) { @@ -434677,9 +358288,9 @@ var require_dom = __commonJS((exports) => { length: 0, item: NodeList.prototype.item, getNamedItem: function(key) { - var i4 = this.length; - while (i4--) { - var attr = this[i4]; + var i3 = this.length; + while (i3--) { + var attr = this[i3]; if (attr.nodeName == key) { return attr; } @@ -434714,9 +358325,9 @@ var require_dom = __commonJS((exports) => { return attr; }, getNamedItemNS: function(namespaceURI, localName) { - var i4 = this.length; - while (i4--) { - var node = this[i4]; + var i3 = this.length; + while (i3--) { + var node = this[i3]; if (node.localName == localName && node.namespaceURI == namespaceURI) { return node; } @@ -434738,8 +358349,8 @@ var require_dom = __commonJS((exports) => { doc2.appendChild(doctype); } if (qualifiedName) { - var root3 = doc2.createElementNS(namespaceURI, qualifiedName); - doc2.appendChild(root3); + var root2 = doc2.createElementNS(namespaceURI, qualifiedName); + doc2.appendChild(root2); } return doc2; }, @@ -434809,10 +358420,10 @@ var require_dom = __commonJS((exports) => { lookupPrefix: function(namespaceURI) { var el = this; while (el) { - var map6 = el._nsMap; - if (map6) { - for (var n2 in map6) { - if (Object.prototype.hasOwnProperty.call(map6, n2) && map6[n2] === namespaceURI) { + var map4 = el._nsMap; + if (map4) { + for (var n2 in map4) { + if (Object.prototype.hasOwnProperty.call(map4, n2) && map4[n2] === namespaceURI) { return n2; } } @@ -434824,10 +358435,10 @@ var require_dom = __commonJS((exports) => { lookupNamespaceURI: function(prefix) { var el = this; while (el) { - var map6 = el._nsMap; - if (map6) { - if (Object.prototype.hasOwnProperty.call(map6, prefix)) { - return map6[prefix]; + var map4 = el._nsMap; + if (map4) { + if (Object.prototype.hasOwnProperty.call(map4, prefix)) { + return map4[prefix]; } } el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode; @@ -434866,7 +358477,7 @@ var require_dom = __commonJS((exports) => { el._nsMap[newAttr.prefix ? newAttr.localName : ""] = newAttr.value; } } - function _onRemoveAttribute(doc2, el, newAttr, remove4) { + function _onRemoveAttribute(doc2, el, newAttr, remove3) { doc2 && doc2._inc++; var ns = newAttr.namespaceURI; if (ns === NAMESPACE.XMLNS) { @@ -434881,12 +358492,12 @@ var require_dom = __commonJS((exports) => { cs[cs.length++] = newChild; } else { var child = el.firstChild; - var i4 = 0; + var i3 = 0; while (child) { - cs[i4++] = child; + cs[i3++] = child; child = child.nextSibling; } - cs.length = i4; + cs.length = i3; delete cs[cs.length]; } } @@ -434927,10 +358538,10 @@ var require_dom = __commonJS((exports) => { } function isElementInsertionPossible(doc2, child) { var parentChildNodes = doc2.childNodes || []; - if (find3(parentChildNodes, isElementNode) || isDocTypeNode(child)) { + if (find2(parentChildNodes, isElementNode) || isDocTypeNode(child)) { return false; } - var docTypeNode = find3(parentChildNodes, isDocTypeNode); + var docTypeNode = find2(parentChildNodes, isDocTypeNode); return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child)); } function isElementReplacementPossible(doc2, child) { @@ -434938,45 +358549,45 @@ var require_dom = __commonJS((exports) => { function hasElementChildThatIsNotChild(node) { return isElementNode(node) && node !== child; } - if (find3(parentChildNodes, hasElementChildThatIsNotChild)) { + if (find2(parentChildNodes, hasElementChildThatIsNotChild)) { return false; } - var docTypeNode = find3(parentChildNodes, isDocTypeNode); + var docTypeNode = find2(parentChildNodes, isDocTypeNode); return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child)); } - function assertPreInsertionValidity1to5(parent3, node, child) { - if (!hasValidParentNodeType(parent3)) { - throw new DOMException2(HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + parent3.nodeType); + function assertPreInsertionValidity1to5(parent2, node, child) { + if (!hasValidParentNodeType(parent2)) { + throw new DOMException2(HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + parent2.nodeType); } - if (child && child.parentNode !== parent3) { + if (child && child.parentNode !== parent2) { throw new DOMException2(NOT_FOUND_ERR, "child not in parent"); } - if (!hasInsertableNodeType(node) || isDocTypeNode(node) && parent3.nodeType !== Node2.DOCUMENT_NODE) { - throw new DOMException2(HIERARCHY_REQUEST_ERR, "Unexpected node type " + node.nodeType + " for parent node type " + parent3.nodeType); + if (!hasInsertableNodeType(node) || isDocTypeNode(node) && parent2.nodeType !== Node2.DOCUMENT_NODE) { + throw new DOMException2(HIERARCHY_REQUEST_ERR, "Unexpected node type " + node.nodeType + " for parent node type " + parent2.nodeType); } } - function assertPreInsertionValidityInDocument(parent3, node, child) { - var parentChildNodes = parent3.childNodes || []; + function assertPreInsertionValidityInDocument(parent2, node, child) { + var parentChildNodes = parent2.childNodes || []; var nodeChildNodes = node.childNodes || []; if (node.nodeType === Node2.DOCUMENT_FRAGMENT_NODE) { var nodeChildElements = nodeChildNodes.filter(isElementNode); - if (nodeChildElements.length > 1 || find3(nodeChildNodes, isTextNode)) { + if (nodeChildElements.length > 1 || find2(nodeChildNodes, isTextNode)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment"); } - if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent3, child)) { + if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent2, child)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype"); } } if (isElementNode(node)) { - if (!isElementInsertionPossible(parent3, child)) { + if (!isElementInsertionPossible(parent2, child)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype"); } } if (isDocTypeNode(node)) { - if (find3(parentChildNodes, isDocTypeNode)) { + if (find2(parentChildNodes, isDocTypeNode)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed"); } - var parentElementChild = find3(parentChildNodes, isElementNode); + var parentElementChild = find2(parentChildNodes, isElementNode); if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element"); } @@ -434985,20 +358596,20 @@ var require_dom = __commonJS((exports) => { } } } - function assertPreReplacementValidityInDocument(parent3, node, child) { - var parentChildNodes = parent3.childNodes || []; + function assertPreReplacementValidityInDocument(parent2, node, child) { + var parentChildNodes = parent2.childNodes || []; var nodeChildNodes = node.childNodes || []; if (node.nodeType === Node2.DOCUMENT_FRAGMENT_NODE) { var nodeChildElements = nodeChildNodes.filter(isElementNode); - if (nodeChildElements.length > 1 || find3(nodeChildNodes, isTextNode)) { + if (nodeChildElements.length > 1 || find2(nodeChildNodes, isTextNode)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment"); } - if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent3, child)) { + if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent2, child)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype"); } } if (isElementNode(node)) { - if (!isElementReplacementPossible(parent3, child)) { + if (!isElementReplacementPossible(parent2, child)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype"); } } @@ -435007,19 +358618,19 @@ var require_dom = __commonJS((exports) => { return isDocTypeNode(node2) && node2 !== child; }; var hasDoctypeChildThatIsNotChild = hasDoctypeChildThatIsNotChild2; - if (find3(parentChildNodes, hasDoctypeChildThatIsNotChild2)) { + if (find2(parentChildNodes, hasDoctypeChildThatIsNotChild2)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed"); } - var parentElementChild = find3(parentChildNodes, isElementNode); + var parentElementChild = find2(parentChildNodes, isElementNode); if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) { throw new DOMException2(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element"); } } } - function _insertBefore(parent3, node, child, _inDocumentAssertion) { - assertPreInsertionValidity1to5(parent3, node, child); - if (parent3.nodeType === Node2.DOCUMENT_NODE) { - (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent3, node, child); + function _insertBefore(parent2, node, child, _inDocumentAssertion) { + assertPreInsertionValidity1to5(parent2, node, child); + if (parent2.nodeType === Node2.DOCUMENT_NODE) { + (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent2, node, child); } var cp = node.parentNode; if (cp) { @@ -435034,25 +358645,25 @@ var require_dom = __commonJS((exports) => { } else { newFirst = newLast = node; } - var pre = child ? child.previousSibling : parent3.lastChild; + var pre = child ? child.previousSibling : parent2.lastChild; newFirst.previousSibling = pre; newLast.nextSibling = child; if (pre) { pre.nextSibling = newFirst; } else { - parent3.firstChild = newFirst; + parent2.firstChild = newFirst; } if (child == null) { - parent3.lastChild = newLast; + parent2.lastChild = newLast; } else { child.previousSibling = newLast; } do { - newFirst.parentNode = parent3; - var targetDoc = parent3.ownerDocument || parent3; + newFirst.parentNode = parent2; + var targetDoc = parent2.ownerDocument || parent2; _updateOwnerDocument(newFirst, targetDoc); } while (newFirst !== newLast && (newFirst = newFirst.nextSibling)); - _onUpdateChild(parent3.ownerDocument || parent3, parent3); + _onUpdateChild(parent2.ownerDocument || parent2, parent2); if (node.nodeType == DOCUMENT_FRAGMENT_NODE) { node.firstChild = node.lastChild = null; } @@ -435064,8 +358675,8 @@ var require_dom = __commonJS((exports) => { } node.ownerDocument = newOwnerDocument; if (node.nodeType === ELEMENT_NODE && node.attributes) { - for (var i4 = 0;i4 < node.attributes.length; i4++) { - var attr = node.attributes.item(i4); + for (var i3 = 0;i3 < node.attributes.length; i3++) { + var attr = node.attributes.item(i3); if (attr) { attr.ownerDocument = newOwnerDocument; } @@ -435158,12 +358769,12 @@ var require_dom = __commonJS((exports) => { if (node !== base2 && node.nodeType === ELEMENT_NODE) { var nodeClassNames = node.getAttribute("class"); if (nodeClassNames) { - var matches3 = classNames === nodeClassNames; - if (!matches3) { + var matches2 = classNames === nodeClassNames; + if (!matches2) { var nodeClassNamesSet = toOrderedSet(nodeClassNames); - matches3 = classNamesSet.every(arrayIncludes3(nodeClassNamesSet)); + matches2 = classNamesSet.every(arrayIncludes2(nodeClassNamesSet)); } - if (matches3) { + if (matches2) { ls.push(node); } } @@ -435363,13 +358974,13 @@ var require_dom = __commonJS((exports) => { substringData: function(offset, count3) { return this.data.substring(offset, offset + count3); }, - appendData: function(text2) { - text2 = this.data + text2; - this.nodeValue = this.data = text2; - this.length = text2.length; + appendData: function(text) { + text = this.data + text; + this.nodeValue = this.data = text; + this.length = text.length; }, - insertData: function(offset, text2) { - this.replaceData(offset, 0, text2); + insertData: function(offset, text) { + this.replaceData(offset, 0, text); }, appendChild: function(newChild) { throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]); @@ -435377,12 +358988,12 @@ var require_dom = __commonJS((exports) => { deleteData: function(offset, count3) { this.replaceData(offset, count3, ""); }, - replaceData: function(offset, count3, text2) { + replaceData: function(offset, count3, text) { var start = this.data.substring(0, offset); var end = this.data.substring(offset + count3); - text2 = start + text2 + end; - this.nodeValue = this.data = text2; - this.length = text2.length; + text = start + text + end; + this.nodeValue = this.data = text; + this.length = text.length; } }; _extends(CharacterData, Node2); @@ -435391,11 +359002,11 @@ var require_dom = __commonJS((exports) => { nodeName: "#text", nodeType: TEXT_NODE, splitText: function(offset) { - var text2 = this.data; - var newText = text2.substring(offset); - text2 = text2.substring(0, offset); - this.data = this.nodeValue = text2; - this.length = text2.length; + var text = this.data; + var newText = text.substring(offset); + text = text.substring(0, offset); + this.data = this.nodeValue = text; + this.length = text.length; var newNode = this.ownerDocument.createTextNode(newText); if (this.parentNode) { this.parentNode.insertBefore(newNode, this.nextSibling); @@ -435465,9 +359076,9 @@ var require_dom = __commonJS((exports) => { if (prefix === "xml" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) { return false; } - var i4 = visibleNamespaces.length; - while (i4--) { - var ns = visibleNamespaces[i4]; + var i3 = visibleNamespaces.length; + while (i3--) { + var ns = visibleNamespaces[i3]; if (ns.prefix === prefix) { return ns.namespace !== uri; } @@ -435530,16 +359141,16 @@ var require_dom = __commonJS((exports) => { } } buf.push("<", prefixedNodeName); - for (var i4 = 0;i4 < len; i4++) { - var attr = attrs.item(i4); + for (var i3 = 0;i3 < len; i3++) { + var attr = attrs.item(i3); if (attr.prefix == "xmlns") { visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value }); } else if (attr.nodeName == "xmlns") { visibleNamespaces.push({ prefix: "", namespace: attr.value }); } } - for (var i4 = 0;i4 < len; i4++) { - var attr = attrs.item(i4); + for (var i3 = 0;i3 < len; i3++) { + var attr = attrs.item(i3); if (needNamespaceDefine(attr, isHTML, visibleNamespaces)) { var prefix = attr.prefix || ""; var uri = attr.namespaceURI; @@ -435668,8 +359279,8 @@ var require_dom = __commonJS((exports) => { var attrs2 = node2.attributes = new NamedNodeMap; var len = attrs.length; attrs2._ownerElement = node2; - for (var i4 = 0;i4 < len; i4++) { - node2.setAttributeNode(cloneNode(doc2, attrs.item(i4), true)); + for (var i3 = 0;i3 < len; i3++) { + node2.setAttributeNode(cloneNode(doc2, attrs.item(i3), true)); } break; ; @@ -437974,9 +361585,9 @@ var require_sax = __commonJS((exports) => { if (tagStart < 0) { if (!source.substr(start).match(/^\s*$/)) { var doc2 = domBuilder.doc; - var text2 = doc2.createTextNode(source.substr(start)); - doc2.appendChild(text2); - domBuilder.currentElement = text2; + var text = doc2.createTextNode(source.substr(start)); + doc2.appendChild(text); + domBuilder.currentElement = text; } return; } @@ -437987,21 +361598,21 @@ var require_sax = __commonJS((exports) => { case "/": var end = source.indexOf(">", tagStart + 3); var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, ""); - var config4 = parseStack.pop(); + var config2 = parseStack.pop(); if (end < 0) { tagName = source.substring(tagStart + 2).replace(/[\s<].*/, ""); - errorHandler.error("end tag name: " + tagName + " is not complete:" + config4.tagName); + errorHandler.error("end tag name: " + tagName + " is not complete:" + config2.tagName); end = tagStart + 1 + tagName.length; } else if (tagName.match(/\s { } } if (!endMatch) { - errorHandler.fatalError("end tag name: " + tagName + " is not match the current start tagName:" + config4.tagName); + errorHandler.fatalError("end tag name: " + tagName + " is not match the current start tagName:" + config2.tagName); } } else { - parseStack.push(config4); + parseStack.push(config2); } end++; break; @@ -438039,8 +361650,8 @@ var require_sax = __commonJS((exports) => { } if (locator && len) { var locator2 = copyLocator(locator, {}); - for (var i4 = 0;i4 < len; i4++) { - var a2 = el[i4]; + for (var i3 = 0;i3 < len; i3++) { + var a2 = el[i3]; position(a2.offset); a2.locator = copyLocator(locator, {}); } @@ -438240,9 +361851,9 @@ var require_sax = __commonJS((exports) => { function appendElement(el, domBuilder, currentNSMap) { var tagName = el.tagName; var localNSMap = null; - var i4 = el.length; - while (i4--) { - var a2 = el[i4]; + var i3 = el.length; + while (i3--) { + var a2 = el[i3]; var qName = a2.qName; var value = a2.value; var nsp = qName.indexOf(":"); @@ -438266,9 +361877,9 @@ var require_sax = __commonJS((exports) => { domBuilder.startPrefixMapping(nsPrefix, value); } } - var i4 = el.length; - while (i4--) { - a2 = el[i4]; + var i3 = el.length; + while (i3--) { + a2 = el[i3]; var prefix = a2.prefix; if (prefix) { if (prefix === "xml") { @@ -438307,14 +361918,14 @@ var require_sax = __commonJS((exports) => { function parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) { if (/^(?:script|textarea)$/i.test(tagName)) { var elEndStart = source.indexOf("", elStartEnd); - var text2 = source.substring(elStartEnd + 1, elEndStart); - if (/[&<]/.test(text2)) { + var text = source.substring(elStartEnd + 1, elEndStart); + if (/[&<]/.test(text)) { if (/^script$/i.test(tagName)) { - domBuilder.characters(text2, 0, text2.length); + domBuilder.characters(text, 0, text.length); return elEndStart; } - text2 = text2.replace(/&#?\w+;/g, entityReplacer); - domBuilder.characters(text2, 0, text2.length); + text = text.replace(/&#?\w+;/g, entityReplacer); + domBuilder.characters(text, 0, text.length); return elEndStart; } } @@ -438362,7 +361973,7 @@ var require_sax = __commonJS((exports) => { domBuilder.endCDATA(); return end + 3; } - var matchs = split3(source, start); + var matchs = split2(source, start); var len = matchs.length; if (len > 1 && /!doctype/i.test(matchs[0][0])) { var name = matchs[1][0]; @@ -438416,23 +362027,23 @@ var require_sax = __commonJS((exports) => { this[this.length++] = { qName, value, offset }; }, length: 0, - getLocalName: function(i4) { - return this[i4].localName; + getLocalName: function(i3) { + return this[i3].localName; }, - getLocator: function(i4) { - return this[i4].locator; + getLocator: function(i3) { + return this[i3].locator; }, - getQName: function(i4) { - return this[i4].qName; + getQName: function(i3) { + return this[i3].qName; }, - getURI: function(i4) { - return this[i4].uri; + getURI: function(i3) { + return this[i3].uri; }, - getValue: function(i4) { - return this[i4].value; + getValue: function(i3) { + return this[i3].value; } }; - function split3(source, start) { + function split2(source, start) { var match; var buf = []; var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g; @@ -438458,8 +362069,8 @@ var require_dom_parser = __commonJS((exports) => { var NAMESPACE = conventions.NAMESPACE; var ParseError2 = sax.ParseError; var XMLReader = sax.XMLReader; - function normalizeLineEndings(input11) { - return input11.replace(/\r[\n\u0085]/g, ` + function normalizeLineEndings(input) { + return input.replace(/\r[\n\u0085]/g, ` `).replace(/[\r\u0085\u2028]/g, ` `); } @@ -438484,9 +362095,9 @@ var require_dom_parser = __commonJS((exports) => { defaultNSMap[""] = NAMESPACE.HTML; } defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML; - var normalize9 = options2.normalizeLineEndings || normalizeLineEndings; + var normalize8 = options2.normalizeLineEndings || normalizeLineEndings; if (source && typeof source === "string") { - sax2.parse(normalize9(source), defaultNSMap, entityMap); + sax2.parse(normalize8(source), defaultNSMap, entityMap); } else { sax2.errorHandler.error("invalid doc source"); } @@ -438539,12 +362150,12 @@ var require_dom_parser = __commonJS((exports) => { appendElement(this, el); this.currentElement = el; this.locator && position(this.locator, el); - for (var i4 = 0;i4 < len; i4++) { - var namespaceURI = attrs.getURI(i4); - var value = attrs.getValue(i4); - var qName = attrs.getQName(i4); + for (var i3 = 0;i3 < len; i3++) { + var namespaceURI = attrs.getURI(i3); + var value = attrs.getValue(i3); + var qName = attrs.getQName(i3); var attr = doc2.createAttributeNS(namespaceURI, qName); - this.locator && position(attrs.getLocator(i4), attr); + this.locator && position(attrs.getLocator(i3), attr); attr.value = attr.nodeValue = value; el.setAttributeNode(attr); } @@ -438608,14 +362219,14 @@ var require_dom_parser = __commonJS((exports) => { this.doc.doctype = dt; } }, - warning: function(error45) { - console.warn("[xmldom warning]\t" + error45, _locator(this.locator)); + warning: function(error41) { + console.warn("[xmldom warning]\t" + error41, _locator(this.locator)); }, - error: function(error45) { - console.error("[xmldom error] " + error45, _locator(this.locator)); + error: function(error41) { + console.error("[xmldom error] " + error41, _locator(this.locator)); }, - fatalError: function(error45) { - throw new ParseError2(error45, this.locator); + fatalError: function(error41) { + throw new ParseError2(error41, this.locator); } }; function _locator(l) { @@ -438652,7 +362263,7 @@ var require_dom_parser = __commonJS((exports) => { }); // node_modules/@xmldom/xmldom/lib/index.js -var require_lib9 = __commonJS((exports) => { +var require_lib7 = __commonJS((exports) => { var dom = require_dom(); exports.DOMImplementation = dom.DOMImplementation; exports.XMLSerializer = dom.XMLSerializer; @@ -438660,8 +362271,8 @@ var require_lib9 = __commonJS((exports) => { }); // node_modules/plist/lib/parse.js -var require_parse11 = __commonJS((exports) => { - var { DOMParser } = require_lib9(); +var require_parse8 = __commonJS((exports) => { + var { DOMParser } = require_lib7(); exports.parse = parse10; var TEXT_NODE = 3; var CDATA_NODE = 4; @@ -438690,7 +362301,7 @@ var require_parse11 = __commonJS((exports) => { return plist; } function parsePlistXML(node) { - var i4, new_obj, key, val, new_arr, res, counter, type; + var i3, new_obj, key, val, new_arr, res, counter, type; if (!node) return null; if (node.nodeName === "plist") { @@ -438698,9 +362309,9 @@ var require_parse11 = __commonJS((exports) => { if (isEmptyNode(node)) { return new_arr; } - for (i4 = 0;i4 < node.childNodes.length; i4++) { - if (!shouldIgnoreNode(node.childNodes[i4])) { - new_arr.push(parsePlistXML(node.childNodes[i4])); + for (i3 = 0;i3 < node.childNodes.length; i3++) { + if (!shouldIgnoreNode(node.childNodes[i3])) { + new_arr.push(parsePlistXML(node.childNodes[i3])); } } return new_arr; @@ -438711,15 +362322,15 @@ var require_parse11 = __commonJS((exports) => { if (isEmptyNode(node)) { return new_obj; } - for (i4 = 0;i4 < node.childNodes.length; i4++) { - if (shouldIgnoreNode(node.childNodes[i4])) + for (i3 = 0;i3 < node.childNodes.length; i3++) { + if (shouldIgnoreNode(node.childNodes[i3])) continue; if (counter % 2 === 0) { - invariant(node.childNodes[i4].nodeName === "key", "Missing key while parsing ."); - key = parsePlistXML(node.childNodes[i4]); + invariant(node.childNodes[i3].nodeName === "key", "Missing key while parsing ."); + key = parsePlistXML(node.childNodes[i3]); } else { - invariant(node.childNodes[i4].nodeName !== "key", 'Unexpected key "' + parsePlistXML(node.childNodes[i4]) + '" while parsing .'); - new_obj[key] = parsePlistXML(node.childNodes[i4]); + invariant(node.childNodes[i3].nodeName !== "key", 'Unexpected key "' + parsePlistXML(node.childNodes[i3]) + '" while parsing .'); + new_obj[key] = parsePlistXML(node.childNodes[i3]); } counter += 1; } @@ -438732,9 +362343,9 @@ var require_parse11 = __commonJS((exports) => { if (isEmptyNode(node)) { return new_arr; } - for (i4 = 0;i4 < node.childNodes.length; i4++) { - if (!shouldIgnoreNode(node.childNodes[i4])) { - res = parsePlistXML(node.childNodes[i4]); + for (i3 = 0;i3 < node.childNodes.length; i3++) { + if (!shouldIgnoreNode(node.childNodes[i3])) { + res = parsePlistXML(node.childNodes[i3]); if (res != null) new_arr.push(res); } @@ -438751,10 +362362,10 @@ var require_parse11 = __commonJS((exports) => { if (isEmptyNode(node)) { return res; } - for (i4 = 0;i4 < node.childNodes.length; i4++) { - var type = node.childNodes[i4].nodeType; + for (i3 = 0;i3 < node.childNodes.length; i3++) { + var type = node.childNodes[i3].nodeType; if (type === TEXT_NODE || type === CDATA_NODE) { - res += node.childNodes[i4].nodeValue; + res += node.childNodes[i3].nodeValue; } } return res; @@ -438764,9 +362375,9 @@ var require_parse11 = __commonJS((exports) => { } else if (node.nodeName === "real") { invariant(!isEmptyNode(node), 'Cannot parse "" as real.'); res = ""; - for (i4 = 0;i4 < node.childNodes.length; i4++) { - if (node.childNodes[i4].nodeType === TEXT_NODE) { - res += node.childNodes[i4].nodeValue; + for (i3 = 0;i3 < node.childNodes.length; i3++) { + if (node.childNodes[i3].nodeType === TEXT_NODE) { + res += node.childNodes[i3].nodeValue; } } return parseFloat(res); @@ -438775,9 +362386,9 @@ var require_parse11 = __commonJS((exports) => { if (isEmptyNode(node)) { return Buffer.from(res, "base64"); } - for (i4 = 0;i4 < node.childNodes.length; i4++) { - if (node.childNodes[i4].nodeType === TEXT_NODE) { - res += node.childNodes[i4].nodeValue.replace(/\s+/g, ""); + for (i3 = 0;i3 < node.childNodes.length; i3++) { + if (node.childNodes[i3].nodeType === TEXT_NODE) { + res += node.childNodes[i3].nodeValue.replace(/\s+/g, ""); } } return Buffer.from(res, "base64"); @@ -438799,14 +362410,14 @@ var require_parse11 = __commonJS((exports) => { // node_modules/xmlbuilder/lib/Utility.js var require_Utility = __commonJS((exports, module) => { (function() { - var assign3, getValue3, isArray9, isEmpty3, isFunction5, isObject6, isPlainObject7, hasProp = {}.hasOwnProperty; - assign3 = function(target, ...sources) { - var i4, key, len, source; - if (isFunction5(Object.assign)) { + var assign2, getValue2, isArray4, isEmpty2, isFunction4, isObject5, isPlainObject6, hasProp = {}.hasOwnProperty; + assign2 = function(target, ...sources) { + var i3, key, len, source; + if (isFunction4(Object.assign)) { Object.assign.apply(null, arguments); } else { - for (i4 = 0, len = sources.length;i4 < len; i4++) { - source = sources[i4]; + for (i3 = 0, len = sources.length;i3 < len; i3++) { + source = sources[i3]; if (source != null) { for (key in source) { if (!hasProp.call(source, key)) @@ -438818,23 +362429,23 @@ var require_Utility = __commonJS((exports, module) => { } return target; }; - isFunction5 = function(val) { + isFunction4 = function(val) { return !!val && Object.prototype.toString.call(val) === "[object Function]"; }; - isObject6 = function(val) { + isObject5 = function(val) { var ref; return !!val && ((ref = typeof val) === "function" || ref === "object"); }; - isArray9 = function(val) { - if (isFunction5(Array.isArray)) { + isArray4 = function(val) { + if (isFunction4(Array.isArray)) { return Array.isArray(val); } else { return Object.prototype.toString.call(val) === "[object Array]"; } }; - isEmpty3 = function(val) { + isEmpty2 = function(val) { var key; - if (isArray9(val)) { + if (isArray4(val)) { return !val.length; } else { for (key in val) { @@ -438845,24 +362456,24 @@ var require_Utility = __commonJS((exports, module) => { return true; } }; - isPlainObject7 = function(val) { + isPlainObject6 = function(val) { var ctor, proto2; - return isObject6(val) && (proto2 = Object.getPrototypeOf(val)) && (ctor = proto2.constructor) && typeof ctor === "function" && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object); + return isObject5(val) && (proto2 = Object.getPrototypeOf(val)) && (ctor = proto2.constructor) && typeof ctor === "function" && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object); }; - getValue3 = function(obj) { - if (isFunction5(obj.valueOf)) { + getValue2 = function(obj) { + if (isFunction4(obj.valueOf)) { return obj.valueOf(); } else { return obj; } }; - exports.assign = assign3; - exports.isFunction = isFunction5; - exports.isObject = isObject6; - exports.isArray = isArray9; - exports.isEmpty = isEmpty3; - exports.isPlainObject = isPlainObject7; - exports.getValue = getValue3; + exports.assign = assign2; + exports.isFunction = isFunction4; + exports.isObject = isObject5; + exports.isArray = isArray4; + exports.isEmpty = isEmpty2; + exports.isPlainObject = isPlainObject6; + exports.getValue = getValue2; }).call(exports); }); @@ -438896,8 +362507,8 @@ var require_XMLDOMErrorHandler = __commonJS((exports, module) => { var XMLDOMErrorHandler; module.exports = XMLDOMErrorHandler = class XMLDOMErrorHandler2 { constructor() {} - handleError(error45) { - throw new Error(error45); + handleError(error41) { + throw new Error(error41); } }; }).call(exports); @@ -439024,8 +362635,8 @@ var require_XMLAttribute = __commonJS((exports, module) => { module.exports = XMLAttribute = function() { class XMLAttribute2 { - constructor(parent3, name, value) { - this.parent = parent3; + constructor(parent2, name, value) { + this.parent = parent2; if (this.parent) { this.options = this.parent.options; this.stringify = this.parent.stringify; @@ -439166,8 +362777,8 @@ var require_XMLNamedNodeMap = __commonJS((exports, module) => { // node_modules/xmlbuilder/lib/XMLElement.js var require_XMLElement = __commonJS((exports, module) => { (function() { - var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue3, isFunction5, isObject6, hasProp = {}.hasOwnProperty; - ({ isObject: isObject6, isFunction: isFunction5, getValue: getValue3 } = require_Utility()); + var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue2, isFunction4, isObject5, hasProp = {}.hasOwnProperty; + ({ isObject: isObject5, isFunction: isFunction4, getValue: getValue2 } = require_Utility()); XMLNode = require_XMLNode(); NodeType = require_NodeType(); XMLAttribute = require_XMLAttribute(); @@ -439175,9 +362786,9 @@ var require_XMLElement = __commonJS((exports, module) => { module.exports = XMLElement = function() { class XMLElement2 extends XMLNode { - constructor(parent3, name, attributes) { + constructor(parent2, name, attributes) { var child, j, len, ref; - super(parent3); + super(parent2); if (name == null) { throw new Error("Missing element name. " + this.debugInfo()); } @@ -439188,12 +362799,12 @@ var require_XMLElement = __commonJS((exports, module) => { if (attributes != null) { this.attribute(attributes); } - if (parent3.type === NodeType.Document) { + if (parent2.type === NodeType.Document) { this.isRoot = true; - this.documentObject = parent3; - parent3.rootObject = this; - if (parent3.children) { - ref = parent3.children; + this.documentObject = parent2; + parent2.rootObject = this; + if (parent2.children) { + ref = parent2.children; for (j = 0, len = ref.length;j < len; j++) { child = ref[j]; if (child.type === NodeType.DocType) { @@ -439230,9 +362841,9 @@ var require_XMLElement = __commonJS((exports, module) => { attribute(name, value) { var attName, attValue; if (name != null) { - name = getValue3(name); + name = getValue2(name); } - if (isObject6(name)) { + if (isObject5(name)) { for (attName in name) { if (!hasProp.call(name, attName)) continue; @@ -439240,7 +362851,7 @@ var require_XMLElement = __commonJS((exports, module) => { this.attribute(attName, attValue); } } else { - if (isFunction5(value)) { + if (isFunction4(value)) { value = value.apply(); } if (this.options.keepNullAttributes && value == null) { @@ -439256,7 +362867,7 @@ var require_XMLElement = __commonJS((exports, module) => { if (name == null) { throw new Error("Missing attribute name. " + this.debugInfo()); } - name = getValue3(name); + name = getValue2(name); if (Array.isArray(name)) { for (j = 0, len = name.length;j < len; j++) { attName = name[j]; @@ -439349,7 +362960,7 @@ var require_XMLElement = __commonJS((exports, module) => { throw new Error("This DOM method is not implemented." + this.debugInfo()); } isEqualNode(node) { - var i4, j, ref; + var i3, j, ref; if (!super.isEqualNode(node)) { return false; } @@ -439365,8 +362976,8 @@ var require_XMLElement = __commonJS((exports, module) => { if (node.attribs.length !== this.attribs.length) { return false; } - for (i4 = j = 0, ref = this.attribs.length - 1;0 <= ref ? j <= ref : j >= ref; i4 = 0 <= ref ? ++j : --j) { - if (!this.attribs[i4].isEqualNode(node.attribs[i4])) { + for (i3 = j = 0, ref = this.attribs.length - 1;0 <= ref ? j <= ref : j >= ref; i3 = 0 <= ref ? ++j : --j) { + if (!this.attribs[i3].isEqualNode(node.attribs[i3])) { return false; } } @@ -439429,8 +363040,8 @@ var require_XMLCharacterData = __commonJS((exports, module) => { module.exports = XMLCharacterData = function() { class XMLCharacterData2 extends XMLNode { - constructor(parent3) { - super(parent3); + constructor(parent2) { + super(parent2); this.value = ""; } clone() { @@ -439494,14 +363105,14 @@ var require_XMLCData = __commonJS((exports, module) => { NodeType = require_NodeType(); XMLCharacterData = require_XMLCharacterData(); module.exports = XMLCData = class XMLCData2 extends XMLCharacterData { - constructor(parent3, text2) { - super(parent3); - if (text2 == null) { + constructor(parent2, text) { + super(parent2); + if (text == null) { throw new Error("Missing CDATA text. " + this.debugInfo()); } this.name = "#cdata-section"; this.type = NodeType.CData; - this.value = this.stringify.cdata(text2); + this.value = this.stringify.cdata(text); } clone() { return Object.create(this); @@ -439520,14 +363131,14 @@ var require_XMLComment = __commonJS((exports, module) => { NodeType = require_NodeType(); XMLCharacterData = require_XMLCharacterData(); module.exports = XMLComment = class XMLComment2 extends XMLCharacterData { - constructor(parent3, text2) { - super(parent3); - if (text2 == null) { + constructor(parent2, text) { + super(parent2); + if (text == null) { throw new Error("Missing comment text. " + this.debugInfo()); } this.name = "#comment"; this.type = NodeType.Comment; - this.value = this.stringify.comment(text2); + this.value = this.stringify.comment(text); } clone() { return Object.create(this); @@ -439542,14 +363153,14 @@ var require_XMLComment = __commonJS((exports, module) => { // node_modules/xmlbuilder/lib/XMLDeclaration.js var require_XMLDeclaration = __commonJS((exports, module) => { (function() { - var NodeType, XMLDeclaration, XMLNode, isObject6; - ({ isObject: isObject6 } = require_Utility()); + var NodeType, XMLDeclaration, XMLNode, isObject5; + ({ isObject: isObject5 } = require_Utility()); XMLNode = require_XMLNode(); NodeType = require_NodeType(); module.exports = XMLDeclaration = class XMLDeclaration2 extends XMLNode { - constructor(parent3, version2, encoding, standalone) { - super(parent3); - if (isObject6(version2)) { + constructor(parent2, version2, encoding, standalone) { + super(parent2); + if (isObject5(version2)) { ({ version: version2, encoding, standalone } = version2); } if (!version2) { @@ -439578,8 +363189,8 @@ var require_XMLDTDAttList = __commonJS((exports, module) => { XMLNode = require_XMLNode(); NodeType = require_NodeType(); module.exports = XMLDTDAttList = class XMLDTDAttList2 extends XMLNode { - constructor(parent3, elementName, attributeName, attributeType, defaultValueType, defaultValue) { - super(parent3); + constructor(parent2, elementName, attributeName, attributeType, defaultValueType, defaultValue) { + super(parent2); if (elementName == null) { throw new Error("Missing DTD element name. " + this.debugInfo()); } @@ -439620,15 +363231,15 @@ var require_XMLDTDAttList = __commonJS((exports, module) => { // node_modules/xmlbuilder/lib/XMLDTDEntity.js var require_XMLDTDEntity = __commonJS((exports, module) => { (function() { - var NodeType, XMLDTDEntity, XMLNode, isObject6; - ({ isObject: isObject6 } = require_Utility()); + var NodeType, XMLDTDEntity, XMLNode, isObject5; + ({ isObject: isObject5 } = require_Utility()); XMLNode = require_XMLNode(); NodeType = require_NodeType(); module.exports = XMLDTDEntity = function() { class XMLDTDEntity2 extends XMLNode { - constructor(parent3, pe, name, value) { - super(parent3); + constructor(parent2, pe, name, value) { + super(parent2); if (name == null) { throw new Error("Missing DTD entity name. " + this.debugInfo(name)); } @@ -439638,7 +363249,7 @@ var require_XMLDTDEntity = __commonJS((exports, module) => { this.pe = !!pe; this.name = this.stringify.name(name); this.type = NodeType.EntityDeclaration; - if (!isObject6(value)) { + if (!isObject5(value)) { this.value = this.stringify.dtdEntityValue(value); this.internal = true; } else { @@ -439709,8 +363320,8 @@ var require_XMLDTDElement = __commonJS((exports, module) => { XMLNode = require_XMLNode(); NodeType = require_NodeType(); module.exports = XMLDTDElement = class XMLDTDElement2 extends XMLNode { - constructor(parent3, name, value) { - super(parent3); + constructor(parent2, name, value) { + super(parent2); if (name == null) { throw new Error("Missing DTD element name. " + this.debugInfo()); } @@ -439740,8 +363351,8 @@ var require_XMLDTDNotation = __commonJS((exports, module) => { module.exports = XMLDTDNotation = function() { class XMLDTDNotation2 extends XMLNode { - constructor(parent3, name, value) { - super(parent3); + constructor(parent2, name, value) { + super(parent2); if (name == null) { throw new Error("Missing DTD notation name. " + this.debugInfo(name)); } @@ -439779,8 +363390,8 @@ var require_XMLDTDNotation = __commonJS((exports, module) => { // node_modules/xmlbuilder/lib/XMLDocType.js var require_XMLDocType = __commonJS((exports, module) => { (function() { - var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject6; - ({ isObject: isObject6 } = require_Utility()); + var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject5; + ({ isObject: isObject5 } = require_Utility()); XMLNode = require_XMLNode(); NodeType = require_NodeType(); XMLDTDAttList = require_XMLDTDAttList(); @@ -439791,22 +363402,22 @@ var require_XMLDocType = __commonJS((exports, module) => { module.exports = XMLDocType = function() { class XMLDocType2 extends XMLNode { - constructor(parent3, pubID, sysID) { - var child, i4, len, ref; - super(parent3); + constructor(parent2, pubID, sysID) { + var child, i3, len, ref; + super(parent2); this.type = NodeType.DocType; - if (parent3.children) { - ref = parent3.children; - for (i4 = 0, len = ref.length;i4 < len; i4++) { - child = ref[i4]; + if (parent2.children) { + ref = parent2.children; + for (i3 = 0, len = ref.length;i3 < len; i3++) { + child = ref[i3]; if (child.type === NodeType.Element) { this.name = child.name; break; } } } - this.documentObject = parent3; - if (isObject6(pubID)) { + this.documentObject = parent2; + if (isObject5(pubID)) { ({ pubID, sysID } = pubID); } if (sysID == null) { @@ -439888,11 +363499,11 @@ var require_XMLDocType = __commonJS((exports, module) => { } Object.defineProperty(XMLDocType2.prototype, "entities", { get: function() { - var child, i4, len, nodes, ref; + var child, i3, len, nodes, ref; nodes = {}; ref = this.children; - for (i4 = 0, len = ref.length;i4 < len; i4++) { - child = ref[i4]; + for (i3 = 0, len = ref.length;i3 < len; i3++) { + child = ref[i3]; if (child.type === NodeType.EntityDeclaration && !child.pe) { nodes[child.name] = child; } @@ -439902,11 +363513,11 @@ var require_XMLDocType = __commonJS((exports, module) => { }); Object.defineProperty(XMLDocType2.prototype, "notations", { get: function() { - var child, i4, len, nodes, ref; + var child, i3, len, nodes, ref; nodes = {}; ref = this.children; - for (i4 = 0, len = ref.length;i4 < len; i4++) { - child = ref[i4]; + for (i3 = 0, len = ref.length;i3 < len; i3++) { + child = ref[i3]; if (child.type === NodeType.NotationDeclaration) { nodes[child.name] = child; } @@ -439941,13 +363552,13 @@ var require_XMLRaw = __commonJS((exports, module) => { NodeType = require_NodeType(); XMLNode = require_XMLNode(); module.exports = XMLRaw = class XMLRaw2 extends XMLNode { - constructor(parent3, text2) { - super(parent3); - if (text2 == null) { + constructor(parent2, text) { + super(parent2); + if (text == null) { throw new Error("Missing raw text. " + this.debugInfo()); } this.type = NodeType.Raw; - this.value = this.stringify.raw(text2); + this.value = this.stringify.raw(text); } clone() { return Object.create(this); @@ -439968,14 +363579,14 @@ var require_XMLText = __commonJS((exports, module) => { module.exports = XMLText = function() { class XMLText2 extends XMLCharacterData { - constructor(parent3, text2) { - super(parent3); - if (text2 == null) { + constructor(parent2, text) { + super(parent2); + if (text == null) { throw new Error("Missing element text. " + this.debugInfo()); } this.name = "#text"; this.type = NodeType.Text; - this.value = this.stringify.text(text2); + this.value = this.stringify.text(text); } clone() { return Object.create(this); @@ -440025,8 +363636,8 @@ var require_XMLProcessingInstruction = __commonJS((exports, module) => { NodeType = require_NodeType(); XMLCharacterData = require_XMLCharacterData(); module.exports = XMLProcessingInstruction = class XMLProcessingInstruction2 extends XMLCharacterData { - constructor(parent3, target, value) { - super(parent3); + constructor(parent2, target, value) { + super(parent2); if (target == null) { throw new Error("Missing instruction target. " + this.debugInfo()); } @@ -440063,8 +363674,8 @@ var require_XMLDummy = __commonJS((exports, module) => { XMLNode = require_XMLNode(); NodeType = require_NodeType(); module.exports = XMLDummy = class XMLDummy2 extends XMLNode { - constructor(parent3) { - super(parent3); + constructor(parent2) { + super(parent2); this.type = NodeType.Dummy; } clone() { @@ -440121,8 +363732,8 @@ var require_DocumentPosition = __commonJS((exports, module) => { // node_modules/xmlbuilder/lib/XMLNode.js var require_XMLNode = __commonJS((exports, module) => { (function() { - var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue3, isEmpty3, isFunction5, isObject6, hasProp = {}.hasOwnProperty, splice7 = [].splice; - ({ isObject: isObject6, isFunction: isFunction5, isEmpty: isEmpty3, getValue: getValue3 } = require_Utility()); + var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue2, isEmpty2, isFunction4, isObject5, hasProp = {}.hasOwnProperty, splice4 = [].splice; + ({ isObject: isObject5, isFunction: isFunction4, isEmpty: isEmpty2, getValue: getValue2 } = require_Utility()); XMLElement = null; XMLCData = null; XMLComment = null; @@ -440164,12 +363775,12 @@ var require_XMLNode = __commonJS((exports, module) => { DocumentPosition = require_DocumentPosition(); } } - setParent(parent3) { + setParent(parent2) { var child, j, len, ref1, results; - this.parent = parent3; - if (parent3) { - this.options = parent3.options; - this.stringify = parent3.stringify; + this.parent = parent2; + if (parent2) { + this.options = parent2.options; + this.stringify = parent2.stringify; } ref1 = this.children; results = []; @@ -440179,42 +363790,42 @@ var require_XMLNode = __commonJS((exports, module) => { } return results; } - element(name, attributes, text2) { + element(name, attributes, text) { var childNode, item, j, k, key, lastChild, len, len1, val; lastChild = null; - if (attributes === null && text2 == null) { - [attributes, text2] = [{}, null]; + if (attributes === null && text == null) { + [attributes, text] = [{}, null]; } if (attributes == null) { attributes = {}; } - attributes = getValue3(attributes); - if (!isObject6(attributes)) { - [text2, attributes] = [attributes, text2]; + attributes = getValue2(attributes); + if (!isObject5(attributes)) { + [text, attributes] = [attributes, text]; } if (name != null) { - name = getValue3(name); + name = getValue2(name); } if (Array.isArray(name)) { for (j = 0, len = name.length;j < len; j++) { item = name[j]; lastChild = this.element(item); } - } else if (isFunction5(name)) { + } else if (isFunction4(name)) { lastChild = this.element(name.apply()); - } else if (isObject6(name)) { + } else if (isObject5(name)) { for (key in name) { if (!hasProp.call(name, key)) continue; val = name[key]; - if (isFunction5(val)) { + if (isFunction4(val)) { val = val.apply(); } if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); - } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty3(val)) { + } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty2(val)) { lastChild = this.dummy(); - } else if (isObject6(val) && isEmpty3(val)) { + } else if (isObject5(val) && isEmpty2(val)) { lastChild = this.element(key); } else if (!this.options.keepNullNodes && val == null) { lastChild = this.dummy(); @@ -440225,7 +363836,7 @@ var require_XMLNode = __commonJS((exports, module) => { childNode[key] = item; lastChild = this.element(childNode); } - } else if (isObject6(val)) { + } else if (isObject5(val)) { if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) { lastChild = this.element(val); } else { @@ -440236,21 +363847,21 @@ var require_XMLNode = __commonJS((exports, module) => { lastChild = this.element(key, val); } } - } else if (!this.options.keepNullNodes && text2 === null) { + } else if (!this.options.keepNullNodes && text === null) { lastChild = this.dummy(); } else { if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) { - lastChild = this.text(text2); + lastChild = this.text(text); } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) { - lastChild = this.cdata(text2); + lastChild = this.cdata(text); } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) { - lastChild = this.comment(text2); + lastChild = this.comment(text); } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) { - lastChild = this.raw(text2); + lastChild = this.raw(text); } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) { - lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text2); + lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text); } else { - lastChild = this.node(name, attributes, text2); + lastChild = this.node(name, attributes, text); } } if (lastChild == null) { @@ -440258,15 +363869,15 @@ var require_XMLNode = __commonJS((exports, module) => { } return lastChild; } - insertBefore(name, attributes, text2) { - var child, i4, newChild, refChild, removed; + insertBefore(name, attributes, text) { + var child, i3, newChild, refChild, removed; if (name != null ? name.type : undefined) { newChild = name; refChild = attributes; newChild.setParent(this); if (refChild) { - i4 = children.indexOf(refChild); - removed = children.splice(i4); + i3 = children.indexOf(refChild); + removed = children.splice(i3); children.push(newChild); Array.prototype.push.apply(children, removed); } else { @@ -440277,53 +363888,53 @@ var require_XMLNode = __commonJS((exports, module) => { if (this.isRoot) { throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); } - i4 = this.parent.children.indexOf(this); - removed = this.parent.children.splice(i4); - child = this.parent.element(name, attributes, text2); + i3 = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i3); + child = this.parent.element(name, attributes, text); Array.prototype.push.apply(this.parent.children, removed); return child; } } - insertAfter(name, attributes, text2) { - var child, i4, removed; + insertAfter(name, attributes, text) { + var child, i3, removed; if (this.isRoot) { throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); } - i4 = this.parent.children.indexOf(this); - removed = this.parent.children.splice(i4 + 1); - child = this.parent.element(name, attributes, text2); + i3 = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i3 + 1); + child = this.parent.element(name, attributes, text); Array.prototype.push.apply(this.parent.children, removed); return child; } remove() { - var i4, ref1; + var i3, ref1; if (this.isRoot) { throw new Error("Cannot remove the root element. " + this.debugInfo()); } - i4 = this.parent.children.indexOf(this); - splice7.apply(this.parent.children, [i4, i4 - i4 + 1].concat(ref1 = [])); + i3 = this.parent.children.indexOf(this); + splice4.apply(this.parent.children, [i3, i3 - i3 + 1].concat(ref1 = [])); return this.parent; } - node(name, attributes, text2) { + node(name, attributes, text) { var child; if (name != null) { - name = getValue3(name); + name = getValue2(name); } attributes || (attributes = {}); - attributes = getValue3(attributes); - if (!isObject6(attributes)) { - [text2, attributes] = [attributes, text2]; + attributes = getValue2(attributes); + if (!isObject5(attributes)) { + [text, attributes] = [attributes, text]; } child = new XMLElement(this, name, attributes); - if (text2 != null) { - child.text(text2); + if (text != null) { + child.text(text); } this.children.push(child); return child; } text(value) { var child; - if (isObject6(value)) { + if (isObject5(value)) { this.element(value); } child = new XMLText(this, value); @@ -440343,17 +363954,17 @@ var require_XMLNode = __commonJS((exports, module) => { return this; } commentBefore(value) { - var child, i4, removed; - i4 = this.parent.children.indexOf(this); - removed = this.parent.children.splice(i4); + var child, i3, removed; + i3 = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i3); child = this.parent.comment(value); Array.prototype.push.apply(this.parent.children, removed); return this; } commentAfter(value) { - var child, i4, removed; - i4 = this.parent.children.indexOf(this); - removed = this.parent.children.splice(i4 + 1); + var child, i3, removed; + i3 = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i3 + 1); child = this.parent.comment(value); Array.prototype.push.apply(this.parent.children, removed); return this; @@ -440372,17 +363983,17 @@ var require_XMLNode = __commonJS((exports, module) => { instruction(target, value) { var insTarget, insValue, instruction, j, len; if (target != null) { - target = getValue3(target); + target = getValue2(target); } if (value != null) { - value = getValue3(value); + value = getValue2(value); } if (Array.isArray(target)) { for (j = 0, len = target.length;j < len; j++) { insTarget = target[j]; this.instruction(insTarget); } - } else if (isObject6(target)) { + } else if (isObject5(target)) { for (insTarget in target) { if (!hasProp.call(target, insTarget)) continue; @@ -440390,7 +364001,7 @@ var require_XMLNode = __commonJS((exports, module) => { this.instruction(insTarget, insValue); } } else { - if (isFunction5(value)) { + if (isFunction4(value)) { value = value.apply(); } instruction = new XMLProcessingInstruction(this, target, value); @@ -440399,17 +364010,17 @@ var require_XMLNode = __commonJS((exports, module) => { return this; } instructionBefore(target, value) { - var child, i4, removed; - i4 = this.parent.children.indexOf(this); - removed = this.parent.children.splice(i4); + var child, i3, removed; + i3 = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i3); child = this.parent.instruction(target, value); Array.prototype.push.apply(this.parent.children, removed); return this; } instructionAfter(target, value) { - var child, i4, removed; - i4 = this.parent.children.indexOf(this); - removed = this.parent.children.splice(i4 + 1); + var child, i3, removed; + i3 = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i3 + 1); child = this.parent.instruction(target, value); Array.prototype.push.apply(this.parent.children, removed); return this; @@ -440428,22 +364039,22 @@ var require_XMLNode = __commonJS((exports, module) => { return doc2.root() || doc2; } dtd(pubID, sysID) { - var child, doc2, doctype, i4, j, k, len, len1, ref1, ref2; + var child, doc2, doctype, i3, j, k, len, len1, ref1, ref2; doc2 = this.document(); doctype = new XMLDocType(doc2, pubID, sysID); ref1 = doc2.children; - for (i4 = j = 0, len = ref1.length;j < len; i4 = ++j) { - child = ref1[i4]; + for (i3 = j = 0, len = ref1.length;j < len; i3 = ++j) { + child = ref1[i3]; if (child.type === NodeType.DocType) { - doc2.children[i4] = doctype; + doc2.children[i3] = doctype; return doctype; } } ref2 = doc2.children; - for (i4 = k = 0, len1 = ref2.length;k < len1; i4 = ++k) { - child = ref2[i4]; + for (i3 = k = 0, len1 = ref2.length;k < len1; i3 = ++k) { + child = ref2[i3]; if (child.isRoot) { - doc2.children.splice(i4, 0, doctype); + doc2.children.splice(i3, 0, doctype); return doctype; } } @@ -440484,20 +364095,20 @@ var require_XMLNode = __commonJS((exports, module) => { return this.document().end(options2); } prev() { - var i4; - i4 = this.parent.children.indexOf(this); - if (i4 < 1) { + var i3; + i3 = this.parent.children.indexOf(this); + if (i3 < 1) { throw new Error("Already at the first node. " + this.debugInfo()); } - return this.parent.children[i4 - 1]; + return this.parent.children[i3 - 1]; } next() { - var i4; - i4 = this.parent.children.indexOf(this); - if (i4 === -1 || i4 === this.parent.children.length - 1) { + var i3; + i3 = this.parent.children.indexOf(this); + if (i3 === -1 || i3 === this.parent.children.length - 1) { throw new Error("Already at the last node. " + this.debugInfo()); } - return this.parent.children[i4 + 1]; + return this.parent.children[i3 + 1]; } importDocument(doc2) { var child, clonedRoot, j, len, ref1; @@ -440535,11 +364146,11 @@ var require_XMLNode = __commonJS((exports, module) => { return "node: <" + name + ">, parent: <" + this.parent.name + ">"; } } - ele(name, attributes, text2) { - return this.element(name, attributes, text2); + ele(name, attributes, text) { + return this.element(name, attributes, text); } - nod(name, attributes, text2) { - return this.node(name, attributes, text2); + nod(name, attributes, text) { + return this.node(name, attributes, text); } txt(value) { return this.text(value); @@ -440559,11 +364170,11 @@ var require_XMLNode = __commonJS((exports, module) => { dec(version2, encoding, standalone) { return this.declaration(version2, encoding, standalone); } - e(name, attributes, text2) { - return this.element(name, attributes, text2); + e(name, attributes, text) { + return this.element(name, attributes, text); } - n(name, attributes, text2) { - return this.node(name, attributes, text2); + n(name, attributes, text) { + return this.node(name, attributes, text); } t(value) { return this.text(value); @@ -440658,15 +364269,15 @@ var require_XMLNode = __commonJS((exports, module) => { throw new Error("This DOM method is not implemented." + this.debugInfo()); } isEqualNode(node) { - var i4, j, ref1; + var i3, j, ref1; if (node.nodeType !== this.nodeType) { return false; } if (node.children.length !== this.children.length) { return false; } - for (i4 = j = 0, ref1 = this.children.length - 1;0 <= ref1 ? j <= ref1 : j >= ref1; i4 = 0 <= ref1 ? ++j : --j) { - if (!this.children[i4].isEqualNode(node.children[i4])) { + for (i3 = j = 0, ref1 = this.children.length - 1;0 <= ref1 ? j <= ref1 : j >= ref1; i3 = 0 <= ref1 ? ++j : --j) { + if (!this.children[i3].isEqualNode(node.children[i3])) { return false; } } @@ -440675,7 +364286,7 @@ var require_XMLNode = __commonJS((exports, module) => { getFeature(feature2, version2) { throw new Error("This DOM method is not implemented." + this.debugInfo()); } - setUserData(key, data, handler14) { + setUserData(key, data, handler18) { throw new Error("This DOM method is not implemented." + this.debugInfo()); } getUserData(key) { @@ -440798,16 +364409,16 @@ var require_XMLNode = __commonJS((exports, module) => { }); Object.defineProperty(XMLNode2.prototype, "previousSibling", { get: function() { - var i4; - i4 = this.parent.children.indexOf(this); - return this.parent.children[i4 - 1] || null; + var i3; + i3 = this.parent.children.indexOf(this); + return this.parent.children[i3 - 1] || null; } }); Object.defineProperty(XMLNode2.prototype, "nextSibling", { get: function() { - var i4; - i4 = this.parent.children.indexOf(this); - return this.parent.children[i4 + 1] || null; + var i3; + i3 = this.parent.children.indexOf(this); + return this.parent.children[i3 + 1] || null; } }); Object.defineProperty(XMLNode2.prototype, "ownerDocument", { @@ -441072,8 +364683,8 @@ var require_WriterState = __commonJS((exports, module) => { // node_modules/xmlbuilder/lib/XMLWriterBase.js var require_XMLWriterBase = __commonJS((exports, module) => { (function() { - var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign3, hasProp = {}.hasOwnProperty; - ({ assign: assign3 } = require_Utility()); + var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign2, hasProp = {}.hasOwnProperty; + ({ assign: assign2 } = require_Utility()); NodeType = require_NodeType(); XMLDeclaration = require_XMLDeclaration(); XMLDocType = require_XMLDocType(); @@ -441106,7 +364717,7 @@ var require_XMLWriterBase = __commonJS((exports, module) => { filterOptions(options2) { var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7; options2 || (options2 = {}); - options2 = assign3({}, this.options, options2); + options2 = assign2({}, this.options, options2); filteredOptions = { writer: this }; @@ -441204,7 +364815,7 @@ var require_XMLWriterBase = __commonJS((exports, module) => { return r; } docType(node, options2, level) { - var child, i4, len1, r, ref; + var child, i3, len1, r, ref; level || (level = 0); this.openNode(node, options2, level); options2.state = WriterState.OpenTag; @@ -441220,8 +364831,8 @@ var require_XMLWriterBase = __commonJS((exports, module) => { r += this.endline(node, options2, level); options2.state = WriterState.InsideTag; ref = node.children; - for (i4 = 0, len1 = ref.length;i4 < len1; i4++) { - child = ref[i4]; + for (i3 = 0, len1 = ref.length;i3 < len1; i3++) { + child = ref[i3]; r += this.writeChildNode(child, options2, level + 1); } options2.state = WriterState.CloseTag; @@ -441235,7 +364846,7 @@ var require_XMLWriterBase = __commonJS((exports, module) => { return r; } element(node, options2, level) { - var att, attLen, child, childNodeCount, firstChildNode, i4, j, len, len1, len2, name, prettySuppressed, r, ratt, ref, ref1, ref2, ref3, rline; + var att, attLen, child, childNodeCount, firstChildNode, i3, j, len, len1, len2, name, prettySuppressed, r, ratt, ref, ref1, ref2, ref3, rline; level || (level = 0); prettySuppressed = false; this.openNode(node, options2, level); @@ -441295,8 +364906,8 @@ var require_XMLWriterBase = __commonJS((exports, module) => { } else { if (options2.dontPrettyTextNodes) { ref2 = node.children; - for (i4 = 0, len1 = ref2.length;i4 < len1; i4++) { - child = ref2[i4]; + for (i3 = 0, len1 = ref2.length;i3 < len1; i3++) { + child = ref2[i3]; if ((child.type === NodeType.Text || child.type === NodeType.Raw || child.type === NodeType.CData) && child.value != null) { options2.suppressPrettyCount++; prettySuppressed = true; @@ -441495,12 +365106,12 @@ var require_XMLStringWriter = __commonJS((exports, module) => { super(options2); } document(doc2, options2) { - var child, i4, len, r, ref; + var child, i3, len, r, ref; options2 = this.filterOptions(options2); r = ""; ref = doc2.children; - for (i4 = 0, len = ref.length;i4 < len; i4++) { - child = ref[i4]; + for (i3 = 0, len = ref.length;i3 < len; i3++) { + child = ref[i3]; r += this.writeChildNode(child, options2, 0); } if (options2.pretty && r.slice(-options2.newline.length) === options2.newline) { @@ -441515,8 +365126,8 @@ var require_XMLStringWriter = __commonJS((exports, module) => { // node_modules/xmlbuilder/lib/XMLDocument.js var require_XMLDocument = __commonJS((exports, module) => { (function() { - var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject7; - ({ isPlainObject: isPlainObject7 } = require_Utility()); + var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject6; + ({ isPlainObject: isPlainObject6 } = require_Utility()); XMLDOMImplementation = require_XMLDOMImplementation(); XMLDOMConfiguration = require_XMLDOMConfiguration(); XMLNode = require_XMLNode(); @@ -441544,7 +365155,7 @@ var require_XMLDocument = __commonJS((exports, module) => { writerOptions = {}; if (!writer) { writer = this.options.writer; - } else if (isPlainObject7(writer)) { + } else if (isPlainObject6(writer)) { writerOptions = writer; writer = this.options.writer; } @@ -441613,10 +365224,10 @@ var require_XMLDocument = __commonJS((exports, module) => { createRange() { throw new Error("This DOM method is not implemented." + this.debugInfo()); } - createNodeIterator(root3, whatToShow, filter4) { + createNodeIterator(root2, whatToShow, filter3) { throw new Error("This DOM method is not implemented." + this.debugInfo()); } - createTreeWalker(root3, whatToShow, filter4) { + createTreeWalker(root2, whatToShow, filter3) { throw new Error("This DOM method is not implemented." + this.debugInfo()); } } @@ -441625,10 +365236,10 @@ var require_XMLDocument = __commonJS((exports, module) => { }); Object.defineProperty(XMLDocument2.prototype, "doctype", { get: function() { - var child, i4, len, ref; + var child, i3, len, ref; ref = this.children; - for (i4 = 0, len = ref.length;i4 < len; i4++) { - child = ref[i4]; + for (i3 = 0, len = ref.length;i3 < len; i3++) { + child = ref[i3]; if (child.type === NodeType.DocType) { return child; } @@ -441711,8 +365322,8 @@ var require_XMLDocument = __commonJS((exports, module) => { // node_modules/xmlbuilder/lib/XMLDocumentCB.js var require_XMLDocumentCB = __commonJS((exports, module) => { (function() { - var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue3, isFunction5, isObject6, isPlainObject7, hasProp = {}.hasOwnProperty; - ({ isObject: isObject6, isFunction: isFunction5, isPlainObject: isPlainObject7, getValue: getValue3 } = require_Utility()); + var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue2, isFunction4, isObject5, isPlainObject6, hasProp = {}.hasOwnProperty; + ({ isObject: isObject5, isFunction: isFunction4, isPlainObject: isPlainObject6, getValue: getValue2 } = require_Utility()); NodeType = require_NodeType(); XMLDocument = require_XMLDocument(); XMLElement = require_XMLElement(); @@ -441740,7 +365351,7 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { writerOptions = {}; if (!options2.writer) { options2.writer = new XMLStringWriter; - } else if (isPlainObject7(options2.writer)) { + } else if (isPlainObject6(options2.writer)) { writerOptions = options2.writer; options2.writer = new XMLStringWriter; } @@ -441758,7 +365369,7 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { this.root = null; } createChildNode(node) { - var att, attName, attributes, child, i4, len, ref, ref1; + var att, attName, attributes, child, i3, len, ref, ref1; switch (node.type) { case NodeType.CData: this.cdata(node.value); @@ -441793,8 +365404,8 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name); } ref1 = node.children; - for (i4 = 0, len = ref1.length;i4 < len; i4++) { - child = ref1[i4]; + for (i3 = 0, len = ref1.length;i3 < len; i3++) { + child = ref1[i3]; this.createChildNode(child); if (child.type === NodeType.Element) { this.up(); @@ -441805,7 +365416,7 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { dummy() { return this; } - node(name, attributes, text2) { + node(name, attributes, text) { if (name == null) { throw new Error("Missing node name."); } @@ -441813,44 +365424,44 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { throw new Error("Document can only have one root node. " + this.debugInfo(name)); } this.openCurrent(); - name = getValue3(name); + name = getValue2(name); if (attributes == null) { attributes = {}; } - attributes = getValue3(attributes); - if (!isObject6(attributes)) { - [text2, attributes] = [attributes, text2]; + attributes = getValue2(attributes); + if (!isObject5(attributes)) { + [text, attributes] = [attributes, text]; } this.currentNode = new XMLElement(this, name, attributes); this.currentNode.children = false; this.currentLevel++; this.openTags[this.currentLevel] = this.currentNode; - if (text2 != null) { - this.text(text2); + if (text != null) { + this.text(text); } return this; } - element(name, attributes, text2) { - var child, i4, len, oldValidationFlag, ref, root3; + element(name, attributes, text) { + var child, i3, len, oldValidationFlag, ref, root2; if (this.currentNode && this.currentNode.type === NodeType.DocType) { this.dtdElement(...arguments); } else { - if (Array.isArray(name) || isObject6(name) || isFunction5(name)) { + if (Array.isArray(name) || isObject5(name) || isFunction4(name)) { oldValidationFlag = this.options.noValidation; this.options.noValidation = true; - root3 = new XMLDocument(this.options).element("TEMP_ROOT"); - root3.element(name); + root2 = new XMLDocument(this.options).element("TEMP_ROOT"); + root2.element(name); this.options.noValidation = oldValidationFlag; - ref = root3.children; - for (i4 = 0, len = ref.length;i4 < len; i4++) { - child = ref[i4]; + ref = root2.children; + for (i3 = 0, len = ref.length;i3 < len; i3++) { + child = ref[i3]; this.createChildNode(child); if (child.type === NodeType.Element) { this.up(); } } } else { - this.node(name, attributes, text2); + this.node(name, attributes, text); } } return this; @@ -441861,9 +365472,9 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name)); } if (name != null) { - name = getValue3(name); + name = getValue2(name); } - if (isObject6(name)) { + if (isObject5(name)) { for (attName in name) { if (!hasProp.call(name, attName)) continue; @@ -441871,7 +365482,7 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { this.attribute(attName, attValue); } } else { - if (isFunction5(value)) { + if (isFunction4(value)) { value = value.apply(); } if (this.options.keepNullAttributes && value == null) { @@ -441911,20 +365522,20 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { return this; } instruction(target, value) { - var i4, insTarget, insValue, len, node; + var i3, insTarget, insValue, len, node; this.openCurrent(); if (target != null) { - target = getValue3(target); + target = getValue2(target); } if (value != null) { - value = getValue3(value); + value = getValue2(value); } if (Array.isArray(target)) { - for (i4 = 0, len = target.length;i4 < len; i4++) { - insTarget = target[i4]; + for (i3 = 0, len = target.length;i3 < len; i3++) { + insTarget = target[i3]; this.instruction(insTarget); } - } else if (isObject6(target)) { + } else if (isObject5(target)) { for (insTarget in target) { if (!hasProp.call(target, insTarget)) continue; @@ -441932,7 +365543,7 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { this.instruction(insTarget, insValue); } } else { - if (isFunction5(value)) { + if (isFunction4(value)) { value = value.apply(); } node = new XMLProcessingInstruction(this, target, value); @@ -441950,16 +365561,16 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); return this; } - doctype(root3, pubID, sysID) { + doctype(root2, pubID, sysID) { this.openCurrent(); - if (root3 == null) { + if (root2 == 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 = root3; + this.currentNode.rootNodeName = root2; this.currentNode.children = false; this.currentLevel++; this.openTags[this.currentLevel] = this.currentNode; @@ -442031,63 +365642,63 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { } } openNode(node) { - var att, chunk3, name, ref; + var att, chunk2, name, ref; if (!node.isOpen) { if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) { this.root = node; } - chunk3 = ""; + chunk2 = ""; if (node.type === NodeType.Element) { this.writerOptions.state = WriterState.OpenTag; - chunk3 = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<" + node.name; + chunk2 = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<" + node.name; ref = node.attribs; for (name in ref) { if (!hasProp.call(ref, name)) continue; att = ref[name]; - chunk3 += this.writer.attribute(att, this.writerOptions, this.currentLevel); + chunk2 += this.writer.attribute(att, this.writerOptions, this.currentLevel); } - chunk3 += (node.children ? ">" : "/>") + this.writer.endline(node, this.writerOptions, this.currentLevel); + chunk2 += (node.children ? ">" : "/>") + this.writer.endline(node, this.writerOptions, this.currentLevel); this.writerOptions.state = WriterState.InsideTag; } else { this.writerOptions.state = WriterState.OpenTag; - chunk3 = this.writer.indent(node, this.writerOptions, this.currentLevel) + ""; + chunk2 += ">"; } - chunk3 += this.writer.endline(node, this.writerOptions, this.currentLevel); + chunk2 += this.writer.endline(node, this.writerOptions, this.currentLevel); } - this.onData(chunk3, this.currentLevel); + this.onData(chunk2, this.currentLevel); return node.isOpen = true; } } closeNode(node) { - var chunk3; + var chunk2; if (!node.isClosed) { - chunk3 = ""; + chunk2 = ""; this.writerOptions.state = WriterState.CloseTag; if (node.type === NodeType.Element) { - chunk3 = this.writer.indent(node, this.writerOptions, this.currentLevel) + "" + this.writer.endline(node, this.writerOptions, this.currentLevel); + chunk2 = this.writer.indent(node, this.writerOptions, this.currentLevel) + "" + this.writer.endline(node, this.writerOptions, this.currentLevel); } else { - chunk3 = this.writer.indent(node, this.writerOptions, this.currentLevel) + "]>" + this.writer.endline(node, this.writerOptions, this.currentLevel); + chunk2 = this.writer.indent(node, this.writerOptions, this.currentLevel) + "]>" + this.writer.endline(node, this.writerOptions, this.currentLevel); } this.writerOptions.state = WriterState.None; - this.onData(chunk3, this.currentLevel); + this.onData(chunk2, this.currentLevel); return node.isClosed = true; } } - onData(chunk3, level) { + onData(chunk2, level) { this.documentStarted = true; - return this.onDataCallback(chunk3, level + 1); + return this.onDataCallback(chunk2, level + 1); } onEnd() { this.documentCompleted = true; @@ -442103,8 +365714,8 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { ele() { return this.element(...arguments); } - nod(name, attributes, text2) { - return this.node(name, attributes, text2); + nod(name, attributes, text) { + return this.node(name, attributes, text); } txt(value) { return this.text(value); @@ -442121,14 +365732,14 @@ var require_XMLDocumentCB = __commonJS((exports, module) => { dec(version2, encoding, standalone) { return this.declaration(version2, encoding, standalone); } - dtd(root3, pubID, sysID) { - return this.doctype(root3, pubID, sysID); + dtd(root2, pubID, sysID) { + return this.doctype(root2, pubID, sysID); } - e(name, attributes, text2) { - return this.element(name, attributes, text2); + e(name, attributes, text) { + return this.element(name, attributes, text); } - n(name, attributes, text2) { - return this.node(name, attributes, text2); + n(name, attributes, text) { + return this.node(name, attributes, text); } t(value) { return this.text(value); @@ -442192,11 +365803,11 @@ var require_XMLStreamWriter = __commonJS((exports, module) => { } } document(doc2, options2) { - var child, i4, j, k, len1, len2, ref, ref1, results; + var child, i3, j, k, len1, len2, ref, ref1, results; ref = doc2.children; - for (i4 = j = 0, len1 = ref.length;j < len1; i4 = ++j) { - child = ref[i4]; - child.isLastRootNode = i4 === doc2.children.length - 1; + for (i3 = j = 0, len1 = ref.length;j < len1; i3 = ++j) { + child = ref[i3]; + child.isLastRootNode = i3 === doc2.children.length - 1; } options2 = this.filterOptions(options2); ref1 = doc2.children; @@ -442345,10 +365956,10 @@ var require_XMLStreamWriter = __commonJS((exports, module) => { }); // node_modules/xmlbuilder/lib/index.js -var require_lib10 = __commonJS((exports, module) => { +var require_lib8 = __commonJS((exports, module) => { (function() { - var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign3, isFunction5; - ({ assign: assign3, isFunction: isFunction5 } = require_Utility()); + var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign2, isFunction4; + ({ assign: assign2, isFunction: isFunction4 } = require_Utility()); XMLDOMImplementation = require_XMLDOMImplementation(); XMLDocument = require_XMLDocument(); XMLDocumentCB = require_XMLDocumentCB(); @@ -442357,23 +365968,23 @@ var require_lib10 = __commonJS((exports, module) => { NodeType = require_NodeType(); WriterState = require_WriterState(); exports.create = function(name, xmldec, doctype, options2) { - var doc2, root3; + var doc2, root2; if (name == null) { throw new Error("Root element needs a name."); } - options2 = assign3({}, xmldec, doctype, options2); + options2 = assign2({}, xmldec, doctype, options2); doc2 = new XMLDocument(options2); - root3 = doc2.element(name); + root2 = doc2.element(name); if (!options2.headless) { doc2.declaration(options2); if (options2.pubID != null || options2.sysID != null) { doc2.dtd(options2); } } - return root3; + return root2; }; exports.begin = function(options2, onData, onEnd) { - if (isFunction5(options2)) { + if (isFunction4(options2)) { [onData, onEnd] = [options2, onData]; options2 = {}; } @@ -442396,19 +366007,19 @@ var require_lib10 = __commonJS((exports, module) => { }); // node_modules/plist/lib/build.js -var require_build4 = __commonJS((exports) => { - var base644 = require_base64_js2(); - var xmlbuilder = require_lib10(); +var require_build = __commonJS((exports) => { + var base643 = require_base64_js(); + var xmlbuilder = require_lib8(); exports.build = build; function ISODateString(d) { - function pad3(n2) { + function pad2(n2) { return n2 < 10 ? "0" + n2 : n2; } - return d.getUTCFullYear() + "-" + pad3(d.getUTCMonth() + 1) + "-" + pad3(d.getUTCDate()) + "T" + pad3(d.getUTCHours()) + ":" + pad3(d.getUTCMinutes()) + ":" + pad3(d.getUTCSeconds()) + "Z"; + return d.getUTCFullYear() + "-" + pad2(d.getUTCMonth() + 1) + "-" + pad2(d.getUTCDate()) + "T" + pad2(d.getUTCHours()) + ":" + pad2(d.getUTCMinutes()) + ":" + pad2(d.getUTCSeconds()) + "Z"; } - var toString7 = Object.prototype.toString; + var toString6 = Object.prototype.toString; function type(obj) { - var m = toString7.call(obj).match(/\[object (.*)\]/); + var m = toString6.call(obj).match(/\[object (.*)\]/); return m ? m[1] : m; } function build(obj, opts) { @@ -442431,14 +366042,14 @@ var require_build4 = __commonJS((exports) => { return doc2.end(opts); } function walk_obj(next, next_child) { - var tag_type, i4, prop; + var tag_type, i3, prop; var name = type(next); if (name == "Undefined") { return; } else if (Array.isArray(next)) { next_child = next_child.ele("array"); - for (i4 = 0;i4 < next.length; i4++) { - walk_obj(next[i4], next_child); + for (i3 = 0;i3 < next.length; i3++) { + walk_obj(next[i3], next_child); } } else if (Buffer.isBuffer(next)) { next_child.ele("data").raw(next.toString("base64")); @@ -442462,9 +366073,9 @@ var require_build4 = __commonJS((exports) => { } else if (name == "String") { next_child.ele("string").txt(next); } else if (name == "ArrayBuffer") { - next_child.ele("data").raw(base644.fromByteArray(next)); + next_child.ele("data").raw(base643.fromByteArray(next)); } else if (next && next.buffer && type(next.buffer) == "ArrayBuffer") { - next_child.ele("data").raw(base644.fromByteArray(new Uint8Array(next.buffer), next_child)); + next_child.ele("data").raw(base643.fromByteArray(new Uint8Array(next.buffer), next_child)); } else if (name === "Null") { next_child.ele("null").txt(""); } @@ -442473,11 +366084,11 @@ var require_build4 = __commonJS((exports) => { // node_modules/plist/index.js var require_plist = __commonJS((exports) => { - var parserFunctions = require_parse11(); + var parserFunctions = require_parse8(); Object.keys(parserFunctions).forEach(function(k) { exports[k] = parserFunctions[k]; }); - var builderFunctions = require_build4(); + var builderFunctions = require_build(); Object.keys(builderFunctions).forEach(function(k) { exports[k] = builderFunctions[k]; }); @@ -442485,8 +366096,8 @@ var require_plist = __commonJS((exports) => { // src/services/notifier.ts async function sendNotification(notif, terminal) { - const config4 = getGlobalConfig(); - const channel = config4.preferredNotifChannel; + const config2 = getGlobalConfig(); + const channel = config2.preferredNotifChannel; await executeNotificationHooks(notif); const methodUsed = await sendToChannel(channel, notif, terminal); logEvent("tengu_notification_method_used", { @@ -442582,8 +366193,8 @@ async function isAppleTerminalBellDisabled() { return false; } return profileSettings.Bell === false; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return false; } } @@ -442599,10 +366210,10 @@ var init_notifier = __esm(() => { // src/bridge/bridgeStatusUtil.ts function timestamp() { - const now3 = new Date; - const h2 = String(now3.getHours()).padStart(2, "0"); - const m = String(now3.getMinutes()).padStart(2, "0"); - const s = String(now3.getSeconds()).padStart(2, "0"); + const now2 = new Date; + const h2 = String(now2.getHours()).padStart(2, "0"); + const m = String(now2.getMinutes()).padStart(2, "0"); + const s = String(now2.getSeconds()).padStart(2, "0"); return `${h2}:${m}:${s}`; } function buildBridgeConnectUrl(environmentId, ingressUrl) { @@ -442616,38 +366227,38 @@ function computeGlimmerIndex(tick, messageWidth) { const cycleLength = messageWidth + 20; return messageWidth + 10 - tick % cycleLength; } -function computeShimmerSegments(text2, glimmerIndex) { - const messageWidth = stringWidth(text2); +function computeShimmerSegments(text, glimmerIndex) { + const messageWidth = stringWidth(text); const shimmerStart = glimmerIndex - 1; const shimmerEnd = glimmerIndex + 1; if (shimmerStart >= messageWidth || shimmerEnd < 0) { - return { before: text2, shimmer: "", after: "" }; + return { before: text, shimmer: "", after: "" }; } const clampedStart = Math.max(0, shimmerStart); let colPos = 0; - let before3 = ""; + let before2 = ""; let shimmer = ""; - let after3 = ""; - for (const { segment } of getGraphemeSegmenter().segment(text2)) { + let after2 = ""; + for (const { segment } of getGraphemeSegmenter().segment(text)) { const segWidth = stringWidth(segment); if (colPos + segWidth <= clampedStart) { - before3 += segment; + before2 += segment; } else if (colPos > shimmerEnd) { - after3 += segment; + after2 += segment; } else { shimmer += segment; } colPos += segWidth; } - return { before: before3, shimmer, after: after3 }; + return { before: before2, shimmer, after: after2 }; } function getBridgeStatus({ - error: error45, + error: error41, connected, sessionActive, reconnecting }) { - if (error45) + if (error41) return { label: "Remote Control failed", color: "error" }; if (reconnecting) return { label: "Remote Control reconnecting", color: "warning" }; @@ -442661,8 +366272,8 @@ function buildIdleFooterText(url3) { function buildActiveFooterText(url3) { return `Continue coding in the Claude app or ${url3}`; } -function wrapWithOsc8Link2(text2, url3) { - return `\x1B]8;;${url3}\x07${text2}\x1B]8;;\x07`; +function wrapWithOsc8Link2(text, url3) { + return `\x1B]8;;${url3}\x07${text}\x1B]8;;\x07`; } var TOOL_DISPLAY_EXPIRY_MS = 30000, SHIMMER_INTERVAL_MS = 150, FAILED_FOOTER_TEXT = "Something went wrong, please try again"; var init_bridgeStatusUtil = __esm(() => { @@ -442701,8 +366312,8 @@ class ActivityManager { } recordUserActivity() { if (!this.isCLIActive && this.lastUserActivityTime !== 0) { - const now3 = this.getNow(); - const timeSinceLastActivity = (now3 - this.lastUserActivityTime) / 1000; + const now2 = this.getNow(); + const timeSinceLastActivity = (now2 - this.lastUserActivityTime) / 1000; if (timeSinceLastActivity > 0) { const activeTimeCounter = this.getActiveTimeCounter(); if (activeTimeCounter) { @@ -442729,15 +366340,15 @@ class ActivityManager { endCLIActivity(operationId) { this.activeOperations.delete(operationId); if (this.activeOperations.size === 0) { - const now3 = this.getNow(); - const timeSinceLastRecord = (now3 - this.lastCLIRecordedTime) / 1000; + const now2 = this.getNow(); + const timeSinceLastRecord = (now2 - this.lastCLIRecordedTime) / 1000; if (timeSinceLastRecord > 0) { const activeTimeCounter = this.getActiveTimeCounter(); if (activeTimeCounter) { activeTimeCounter.add(timeSinceLastRecord, { type: "cli" }); } } - this.lastCLIRecordedTime = now3; + this.lastCLIRecordedTime = now2; this.isCLIActive = false; } } @@ -442750,8 +366361,8 @@ class ActivityManager { } } getActivityStates() { - const now3 = this.getNow(); - const timeSinceUserActivity = (now3 - this.lastUserActivityTime) / 1000; + const now2 = this.getNow(); + const timeSinceUserActivity = (now2 - this.lastUserActivityTime) / 1000; const isUserActive = timeSinceUserActivity < this.USER_ACTIVITY_TIMEOUT_MS / 1000; return { isUserActive, @@ -442769,14 +366380,14 @@ var init_activityManager = __esm(() => { // src/constants/spinnerVerbs.ts function getSpinnerVerbs() { const settings = getInitialSettings(); - const config4 = settings.spinnerVerbs; - if (!config4) { + const config2 = settings.spinnerVerbs; + if (!config2) { return SPINNER_VERBS; } - if (config4.mode === "replace") { - return config4.verbs.length > 0 ? config4.verbs : SPINNER_VERBS; + if (config2.mode === "replace") { + return config2.verbs.length > 0 ? config2.verbs : SPINNER_VERBS; } - return [...SPINNER_VERBS, ...config4.verbs]; + return [...SPINNER_VERBS, ...config2.verbs]; } var SPINNER_VERBS; var init_spinnerVerbs = __esm(() => { @@ -442990,8 +366601,8 @@ function appendCappedMessage(prev, item) { var TEAMMATE_MESSAGES_UI_CAP = 50; // src/utils/tasks.ts -import { mkdir as mkdir14, readdir as readdir12, readFile as readFile16, unlink as unlink8, writeFile as writeFile17 } from "fs/promises"; -import { join as join77 } from "path"; +import { mkdir as mkdir14, readdir as readdir12, readFile as readFile15, unlink as unlink8, writeFile as writeFile15 } from "fs/promises"; +import { join as join67 } from "path"; function setLeaderTeamName(teamName) { if (leaderTeamName === teamName) return; @@ -443010,12 +366621,12 @@ function notifyTasksUpdated() { } catch {} } function getHighWaterMarkPath(taskListId) { - return join77(getTasksDir(taskListId), HIGH_WATER_MARK_FILE); + return join67(getTasksDir(taskListId), HIGH_WATER_MARK_FILE); } async function readHighWaterMark(taskListId) { - const path16 = getHighWaterMarkPath(taskListId); + const path11 = getHighWaterMarkPath(taskListId); try { - const content = (await readFile16(path16, "utf-8")).trim(); + const content = (await readFile15(path11, "utf-8")).trim(); const value = parseInt(content, 10); return isNaN(value) ? 0 : value; } catch { @@ -443023,8 +366634,8 @@ async function readHighWaterMark(taskListId) { } } async function writeHighWaterMark(taskListId, value) { - const path16 = getHighWaterMarkPath(taskListId); - await writeFile17(path16, String(value)); + const path11 = getHighWaterMarkPath(taskListId); + await writeFile15(path11, String(value)); } function isTodoV2Enabled() { if (isEnvTruthy(process.env.CLAUDE_CODE_ENABLE_TASKS)) { @@ -443045,15 +366656,15 @@ async function resetTaskList(taskListId) { await writeHighWaterMark(taskListId, currentHighest); } } - let files2; + let files; try { - files2 = await readdir12(dir); + files = await readdir12(dir); } catch { - files2 = []; + files = []; } - for (const file2 of files2) { + for (const file2 of files) { if (file2.endsWith(".json") && !file2.startsWith(".")) { - const filePath = join77(dir, file2); + const filePath = join67(dir, file2); try { await unlink8(filePath); } catch {} @@ -443076,14 +366687,14 @@ function getTaskListId() { } return getTeamName() || leaderTeamName || getSessionId(); } -function sanitizePathComponent(input11) { - return input11.replace(/[^a-zA-Z0-9_-]/g, "-"); +function sanitizePathComponent(input) { + return input.replace(/[^a-zA-Z0-9_-]/g, "-"); } function getTasksDir(taskListId) { - return join77(getClaudeConfigHomeDir(), "tasks", sanitizePathComponent(taskListId)); + return join67(getClaudeConfigHomeDir(), "tasks", sanitizePathComponent(taskListId)); } function getTaskPath(taskListId, taskId) { - return join77(getTasksDir(taskListId), `${sanitizePathComponent(taskId)}.json`); + return join67(getTasksDir(taskListId), `${sanitizePathComponent(taskId)}.json`); } async function ensureTasksDir(taskListId) { const dir = getTasksDir(taskListId); @@ -443093,14 +366704,14 @@ async function ensureTasksDir(taskListId) { } async function findHighestTaskIdFromFiles(taskListId) { const dir = getTasksDir(taskListId); - let files2; + let files; try { - files2 = await readdir12(dir); + files = await readdir12(dir); } catch { return 0; } let highest = 0; - for (const file2 of files2) { + for (const file2 of files) { if (!file2.endsWith(".json")) { continue; } @@ -443126,8 +366737,8 @@ async function createTask(taskListId, taskData) { const highestId = await findHighestTaskId(taskListId); const id = String(highestId + 1); const task = { id, ...taskData }; - const path16 = getTaskPath(taskListId, id); - await writeFile17(path16, jsonStringify(task, null, 2)); + const path11 = getTaskPath(taskListId, id); + await writeFile15(path11, jsonStringify(task, null, 2)); notifyTasksUpdated(); return id; } finally { @@ -443137,9 +366748,9 @@ async function createTask(taskListId, taskData) { } } async function getTask(taskListId, taskId) { - const path16 = getTaskPath(taskListId, taskId); + const path11 = getTaskPath(taskListId, taskId); try { - const content = await readFile16(path16, "utf-8"); + const content = await readFile15(path11, "utf-8"); const data = jsonParse(content); if (process.env.USER_TYPE === "ant") { if (data.status === "open") @@ -443172,27 +366783,27 @@ async function updateTaskUnsafe(taskListId, taskId, updates) { return null; } const updated = { ...existing, ...updates, id: taskId }; - const path16 = getTaskPath(taskListId, taskId); - await writeFile17(path16, jsonStringify(updated, null, 2)); + const path11 = getTaskPath(taskListId, taskId); + await writeFile15(path11, jsonStringify(updated, null, 2)); notifyTasksUpdated(); return updated; } async function updateTask(taskListId, taskId, updates) { - const path16 = getTaskPath(taskListId, taskId); + const path11 = getTaskPath(taskListId, taskId); const taskBeforeLock = await getTask(taskListId, taskId); if (!taskBeforeLock) { return null; } let release; try { - release = await lock(path16, LOCK_OPTIONS); + release = await lock(path11, LOCK_OPTIONS); return await updateTaskUnsafe(taskListId, taskId, updates); } finally { await release?.(); } } async function deleteTask(taskListId, taskId) { - const path16 = getTaskPath(taskListId, taskId); + const path11 = getTaskPath(taskListId, taskId); try { const numericId = parseInt(taskId, 10); if (!isNaN(numericId)) { @@ -443202,7 +366813,7 @@ async function deleteTask(taskListId, taskId) { } } try { - await unlink8(path16); + await unlink8(path11); } catch (e) { const code = getErrnoCode(e); if (code === "ENOENT") { @@ -443229,13 +366840,13 @@ async function deleteTask(taskListId, taskId) { } async function listTasks(taskListId) { const dir = getTasksDir(taskListId); - let files2; + let files; try { - files2 = await readdir12(dir); + files = await readdir12(dir); } catch { return []; } - const taskIds = files2.filter((f) => f.endsWith(".json")).map((f) => f.replace(".json", "")); + const taskIds = files.filter((f) => f.endsWith(".json")).map((f) => f.replace(".json", "")); const results = await Promise.all(taskIds.map((id) => getTask(taskListId, id))); return results.filter((t) => t !== null); } @@ -443260,13 +366871,13 @@ async function blockTask(taskListId, fromTaskId, toTaskId) { return true; } function getTaskListLockPath(taskListId) { - return join77(getTasksDir(taskListId), ".lock"); + return join67(getTasksDir(taskListId), ".lock"); } async function ensureTaskListLockFile(taskListId) { await ensureTasksDir(taskListId); const lockPath = getTaskListLockPath(taskListId); try { - await writeFile17(lockPath, "", { flag: "wx" }); + await writeFile15(lockPath, "", { flag: "wx" }); } catch {} return lockPath; } @@ -443302,9 +366913,9 @@ async function claimTask(taskListId, taskId, claimantAgentId, options2 = {}) { owner: claimantAgentId }); return { success: true, task: updated }; - } catch (error45) { - logForDebugging(`[Tasks] Failed to claim task ${taskId}: ${errorMessage(error45)}`); - logError2(error45); + } catch (error41) { + logForDebugging(`[Tasks] Failed to claim task ${taskId}: ${errorMessage(error41)}`); + logError2(error41); return { success: false, reason: "task_not_found" }; } finally { if (release) { @@ -443346,9 +366957,9 @@ async function claimTaskWithBusyCheck(taskListId, taskId, claimantAgentId) { owner: claimantAgentId }); return { success: true, task: updated }; - } catch (error45) { - logForDebugging(`[Tasks] Failed to claim task ${taskId} with busy check: ${errorMessage(error45)}`); - logError2(error45); + } catch (error41) { + logForDebugging(`[Tasks] Failed to claim task ${taskId} with busy check: ${errorMessage(error41)}`); + logError2(error41); return { success: false, reason: "task_not_found" }; } finally { if (release) { @@ -443440,10 +367051,10 @@ function TaskListV2({ } const maxDisplay = rows <= 10 ? 0 : Math.min(10, Math.max(3, rows - 14)); const currentCompletedIds = new Set(tasks.filter((t_1) => t_1.status === "completed").map((t_2) => t_2.id)); - const now3 = Date.now(); + const now2 = Date.now(); for (const id of currentCompletedIds) { if (!previousCompletedIdsRef.current.has(id)) { - completionTimestampsRef.current.set(id, now3); + completionTimestampsRef.current.set(id, now2); } } for (const id_0 of completionTimestampsRef.current.keys()) { @@ -443515,7 +367126,7 @@ function TaskListV2({ const olderCompleted = []; for (const task of tasks.filter((t_7) => t_7.status === "completed")) { const ts_0 = completionTimestampsRef.current.get(task.id); - if (ts_0 && now3 - ts_0 < RECENT_COMPLETED_TTL_MS) { + if (ts_0 && now2 - ts_0 < RECENT_COMPLETED_TTL_MS) { recentCompleted.push(task); } else { olderCompleted.push(task); @@ -444019,29 +367630,29 @@ function hueToRgb(hue) { const s = 0.7; const l = 0.6; const c6 = (1 - Math.abs(2 * l - 1)) * s; - const x4 = c6 * (1 - Math.abs(h2 / 60 % 2 - 1)); + const x3 = c6 * (1 - Math.abs(h2 / 60 % 2 - 1)); const m = l - c6 / 2; let r = 0; let g = 0; let b = 0; if (h2 < 60) { r = c6; - g = x4; + g = x3; } else if (h2 < 120) { - r = x4; + r = x3; g = c6; } else if (h2 < 180) { g = c6; - b = x4; + b = x3; } else if (h2 < 240) { - g = x4; + g = x3; b = c6; } else if (h2 < 300) { - r = x4; + r = x3; b = c6; } else { r = c6; - b = x4; + b = x3; } return { r: Math.round((r + m) * 255), @@ -444054,16 +367665,16 @@ function parseRGB(colorStr) { if (cached3 !== undefined) return cached3; const match = colorStr.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/); - const result3 = match ? { + const result2 = match ? { r: parseInt(match[1], 10), g: parseInt(match[2], 10), b: parseInt(match[3], 10) } : null; - RGB_CACHE.set(colorStr, result3); - return result3; + RGB_CACHE.set(colorStr, result2); + return result2; } var RGB_CACHE; -var init_utils6 = __esm(() => { +var init_utils5 = __esm(() => { RGB_CACHE = new Map; }); @@ -444073,7 +367684,7 @@ var init_FlashingChar = __esm(() => { import_compiler_runtime51 = __toESM(require_compiler_runtime(), 1); init_ink2(); init_theme(); - init_utils6(); + init_utils5(); jsx_dev_runtime56 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -444354,49 +367965,49 @@ function GlimmerMessage(t0) { } const clampedStart = Math.max(0, shimmerStart); let colPos = 0; - let before3 = ""; + let before2 = ""; let shim = ""; - let after3 = ""; - if ($2[48] !== after3 || $2[49] !== before3 || $2[50] !== clampedStart || $2[51] !== colPos || $2[52] !== segments || $2[53] !== shim || $2[54] !== shimmerEnd) { + let after2 = ""; + if ($2[48] !== after2 || $2[49] !== before2 || $2[50] !== clampedStart || $2[51] !== colPos || $2[52] !== segments || $2[53] !== shim || $2[54] !== shimmerEnd) { for (const { segment: segment_0, width } of segments) { if (colPos + width <= clampedStart) { - before3 = before3 + segment_0; + before2 = before2 + segment_0; } else { if (colPos > shimmerEnd) { - after3 = after3 + segment_0; + after2 = after2 + segment_0; } else { shim = shim + segment_0; } } colPos = colPos + width; } - $2[48] = after3; - $2[49] = before3; + $2[48] = after2; + $2[49] = before2; $2[50] = clampedStart; $2[51] = colPos; $2[52] = segments; $2[53] = shim; $2[54] = shimmerEnd; - $2[55] = before3; - $2[56] = after3; + $2[55] = before2; + $2[56] = after2; $2[57] = shim; $2[58] = colPos; } else { - before3 = $2[55]; - after3 = $2[56]; + before2 = $2[55]; + after2 = $2[56]; shim = $2[57]; colPos = $2[58]; } let t3; - if ($2[59] !== before3 || $2[60] !== messageColor) { - t3 = before3 && /* @__PURE__ */ jsx_dev_runtime57.jsxDEV(ThemedText, { + if ($2[59] !== before2 || $2[60] !== messageColor) { + t3 = before2 && /* @__PURE__ */ jsx_dev_runtime57.jsxDEV(ThemedText, { color: messageColor, - children: before3 + children: before2 }, undefined, false, undefined, this); - $2[59] = before3; + $2[59] = before2; $2[60] = messageColor; $2[61] = t3; } else { @@ -444415,12 +368026,12 @@ function GlimmerMessage(t0) { t4 = $2[64]; } let t5; - if ($2[65] !== after3 || $2[66] !== messageColor) { - t5 = after3 && /* @__PURE__ */ jsx_dev_runtime57.jsxDEV(ThemedText, { + if ($2[65] !== after2 || $2[66] !== messageColor) { + t5 = after2 && /* @__PURE__ */ jsx_dev_runtime57.jsxDEV(ThemedText, { color: messageColor, - children: after3 + children: after2 }, undefined, false, undefined, this); - $2[65] = after3; + $2[65] = after2; $2[66] = messageColor; $2[67] = t5; } else { @@ -444464,7 +368075,7 @@ var init_GlimmerMessage = __esm(() => { init_ink2(); init_intl(); init_theme(); - init_utils6(); + init_utils5(); jsx_dev_runtime57 = __toESM(require_jsx_dev_runtime(), 1); ERROR_RED = { r: 171, @@ -444605,7 +368216,7 @@ var init_SpinnerGlyph = __esm(() => { import_compiler_runtime54 = __toESM(require_compiler_runtime(), 1); init_ink2(); init_theme(); - init_utils6(); + init_utils5(); jsx_dev_runtime59 = __toESM(require_jsx_dev_runtime(), 1); DEFAULT_CHARACTERS = getDefaultCharacters(); SPINNER_FRAMES = [...DEFAULT_CHARACTERS, ...[...DEFAULT_CHARACTERS].reverse()]; @@ -444667,7 +368278,7 @@ function useStalledAnimation(time3, currentResponseLength, hasActiveTools = fals if (dt >= 50) { const steps = Math.floor(dt / 50); let current = stalledIntensityRef.current; - for (let i4 = 0;i4 < steps; i4++) { + for (let i3 = 0;i3 < steps; i3++) { const diff3 = intensity - current; if (Math.abs(diff3) < 0.01) { current = intensity; @@ -444698,7 +368309,7 @@ var init_Spinner = __esm(() => { init_SpinnerGlyph(); init_useShimmerAnimation(); init_useStalledAnimation(); - init_utils6(); + init_utils5(); }); // src/utils/ink.ts @@ -444741,9 +368352,9 @@ function SpinnerAnimationRow({ effortSuffix }) { const [viewportRef, time3] = useAnimationFrame(reducedMotion ? null : 50); - const now3 = Date.now(); - const elapsedTimeMs = pauseStartTimeRef.current !== null ? pauseStartTimeRef.current - loadingStartTimeRef.current - totalPausedMsRef.current : now3 - loadingStartTimeRef.current - totalPausedMsRef.current; - const derivedStart = now3 - elapsedTimeMs; + const now2 = Date.now(); + const elapsedTimeMs = pauseStartTimeRef.current !== null ? pauseStartTimeRef.current - loadingStartTimeRef.current - totalPausedMsRef.current : now2 - loadingStartTimeRef.current - totalPausedMsRef.current; + const derivedStart = now2 - elapsedTimeMs; const turnStartRef = import_react52.useRef(derivedStart); if (!hasRunningTeammates || derivedStart < turnStartRef.current) { turnStartRef.current = derivedStart; @@ -444779,7 +368390,7 @@ function SpinnerAnimationRow({ } const displayedResponseLength = tokenCounterRef.current; const leaderTokens = Math.round(displayedResponseLength / 4); - const effectiveElapsedMs = hasRunningTeammates ? Math.max(elapsedTimeMs, now3 - turnStartRef.current) : elapsedTimeMs; + const effectiveElapsedMs = hasRunningTeammates ? Math.max(elapsedTimeMs, now2 - turnStartRef.current) : elapsedTimeMs; const timerText = formatDuration(effectiveElapsedMs); const timerWidth = stringWidth(timerText); const totalTokens = foregroundedTeammate && !foregroundedTeammate.isIdle ? foregroundedTeammate.progress?.tokenCount ?? 0 : leaderTokens + teammateTokens; @@ -444789,7 +368400,7 @@ function SpinnerAnimationRow({ let thinkingText = thinkingStatus === "thinking" ? `thinking${effortSuffix}` : typeof thinkingStatus === "number" ? `thought for ${Math.max(1, Math.round(thinkingStatus / 1000))}s` : null; let thinkingWidthValue = thinkingText ? stringWidth(thinkingText) : 0; const messageWidth = glimmerMessageWidth + 2; - const sep15 = SEP_WIDTH; + const sep12 = SEP_WIDTH; const wantsThinking = thinkingStatus !== null; const wantsTimerAndTokens = verbose || hasRunningTeammates || effectiveElapsedMs > SHOW_TOKENS_AFTER_MS; const availableSpace = columns - messageWidth - 5; @@ -444801,9 +368412,9 @@ function SpinnerAnimationRow({ showThinking = true; } } - const usedAfterThinking = showThinking ? thinkingWidthValue + sep15 : 0; + const usedAfterThinking = showThinking ? thinkingWidthValue + sep12 : 0; const showTimer = wantsTimerAndTokens && availableSpace > usedAfterThinking + timerWidth; - const usedAfterTimer = usedAfterThinking + (showTimer ? timerWidth + sep15 : 0); + const usedAfterTimer = usedAfterThinking + (showTimer ? timerWidth + sep12 : 0); const showTokens = wantsTimerAndTokens && totalTokens > 0 && availableSpace > usedAfterTimer + tokensWidth; const thinkingOnly = showThinking && thinkingStatus === "thinking" && !spinnerSuffix && !showTimer && !showTokens && true; const thinkingElapsedSec = (time3 - THINKING_DELAY_MS) / 1000; @@ -444951,7 +368562,7 @@ var init_SpinnerAnimationRow = __esm(() => { init_GlimmerMessage(); init_SpinnerGlyph(); init_useStalledAnimation(); - init_utils6(); + init_utils5(); jsx_dev_runtime60 = __toESM(require_jsx_dev_runtime(), 1); SEP_WIDTH = stringWidth(" · "); THINKING_BARE_WIDTH = stringWidth("thinking"); @@ -445049,8 +368660,8 @@ function getLeaderPaneId() { return ORIGINAL_TMUX_PANE || null; } async function isTmuxAvailable() { - const result3 = await execFileNoThrow(TMUX_COMMAND, ["-V"]); - return result3.code === 0; + const result2 = await execFileNoThrow(TMUX_COMMAND, ["-V"]); + return result2.code === 0; } function isInITerm2() { if (isInITerm2Cached !== null) { @@ -445063,8 +368674,8 @@ function isInITerm2() { return isInITerm2Cached; } async function isIt2CliAvailable() { - const result3 = await execFileNoThrow(IT2_COMMAND, ["session", "list"]); - return result3.code === 0; + const result2 = await execFileNoThrow(IT2_COMMAND, ["session", "list"]); + return result2.code === 0; } function resetDetectionCache() { isInsideTmuxCached = null; @@ -446145,21 +369756,21 @@ __export(exports_teammateMailbox, { PlanApprovalRequestMessageSchema: () => PlanApprovalRequestMessageSchema, ModeSetRequestMessageSchema: () => ModeSetRequestMessageSchema }); -import { mkdir as mkdir15, readFile as readFile17, writeFile as writeFile18 } from "fs/promises"; -import { join as join78 } from "path"; +import { mkdir as mkdir15, readFile as readFile16, writeFile as writeFile16 } from "fs/promises"; +import { join as join68 } from "path"; function getInboxPath(agentName, teamName) { const team = teamName || getTeamName() || "default"; const safeTeam = sanitizePathComponent(team); const safeAgentName = sanitizePathComponent(agentName); - const inboxDir = join78(getTeamsDir(), safeTeam, "inboxes"); - const fullPath = join78(inboxDir, `${safeAgentName}.json`); + const inboxDir = join68(getTeamsDir(), safeTeam, "inboxes"); + const fullPath = join68(inboxDir, `${safeAgentName}.json`); logForDebugging(`[TeammateMailbox] getInboxPath: agent=${agentName}, team=${team}, fullPath=${fullPath}`); return fullPath; } async function ensureInboxDir(teamName) { const team = teamName || getTeamName() || "default"; const safeTeam = sanitizePathComponent(team); - const inboxDir = join78(getTeamsDir(), safeTeam, "inboxes"); + const inboxDir = join68(getTeamsDir(), safeTeam, "inboxes"); await mkdir15(inboxDir, { recursive: true }); logForDebugging(`[TeammateMailbox] Ensured inbox directory: ${inboxDir}`); } @@ -446167,18 +369778,18 @@ async function readMailbox(agentName, teamName) { const inboxPath = getInboxPath(agentName, teamName); logForDebugging(`[TeammateMailbox] readMailbox: path=${inboxPath}`); try { - const content = await readFile17(inboxPath, "utf-8"); + const content = await readFile16(inboxPath, "utf-8"); const messages = jsonParse(content); logForDebugging(`[TeammateMailbox] readMailbox: read ${messages.length} message(s)`); return messages; - } catch (error45) { - const code = getErrnoCode(error45); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") { logForDebugging(`[TeammateMailbox] readMailbox: file does not exist`); return []; } - logForDebugging(`Failed to read inbox for ${agentName}: ${error45}`); - logError2(error45); + logForDebugging(`Failed to read inbox for ${agentName}: ${error41}`); + logError2(error41); return []; } } @@ -446194,13 +369805,13 @@ async function writeToMailbox(recipientName, message, teamName) { const lockFilePath = `${inboxPath}.lock`; logForDebugging(`[TeammateMailbox] writeToMailbox: recipient=${recipientName}, from=${message.from}, path=${inboxPath}`); try { - await writeFile18(inboxPath, "[]", { encoding: "utf-8", flag: "wx" }); + await writeFile16(inboxPath, "[]", { encoding: "utf-8", flag: "wx" }); logForDebugging(`[TeammateMailbox] writeToMailbox: created new inbox file`); - } catch (error45) { - const code = getErrnoCode(error45); + } catch (error41) { + const code = getErrnoCode(error41); if (code !== "EEXIST") { - logForDebugging(`[TeammateMailbox] writeToMailbox: failed to create inbox file: ${error45}`); - logError2(error45); + logForDebugging(`[TeammateMailbox] writeToMailbox: failed to create inbox file: ${error41}`); + logError2(error41); return; } } @@ -446216,11 +369827,11 @@ async function writeToMailbox(recipientName, message, teamName) { read: false }; messages.push(newMessage); - await writeFile18(inboxPath, jsonStringify(messages, null, 2), "utf-8"); + await writeFile16(inboxPath, jsonStringify(messages, null, 2), "utf-8"); logForDebugging(`[TeammateMailbox] Wrote message to ${recipientName}'s inbox from ${message.from}`); - } catch (error45) { - logForDebugging(`Failed to write to inbox for ${recipientName}: ${error45}`); - logError2(error45); + } catch (error41) { + logForDebugging(`Failed to write to inbox for ${recipientName}: ${error41}`); + logError2(error41); } finally { if (release) { await release(); @@ -446251,16 +369862,16 @@ async function markMessageAsReadByIndex(agentName, teamName, messageIndex) { return; } messages[messageIndex] = { ...message, read: true }; - await writeFile18(inboxPath, jsonStringify(messages, null, 2), "utf-8"); + await writeFile16(inboxPath, jsonStringify(messages, null, 2), "utf-8"); logForDebugging(`[TeammateMailbox] markMessageAsReadByIndex: marked message at index ${messageIndex} as read`); - } catch (error45) { - const code = getErrnoCode(error45); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") { logForDebugging(`[TeammateMailbox] markMessageAsReadByIndex: file does not exist at ${inboxPath}`); return; } - logForDebugging(`[TeammateMailbox] markMessageAsReadByIndex FAILED for ${agentName}: ${error45}`); - logError2(error45); + logForDebugging(`[TeammateMailbox] markMessageAsReadByIndex FAILED for ${agentName}: ${error41}`); + logError2(error41); } finally { if (release) { await release(); @@ -446290,16 +369901,16 @@ async function markMessagesAsRead(agentName, teamName) { logForDebugging(`[TeammateMailbox] markMessagesAsRead: ${unreadCount} unread of ${messages.length} total`); for (const m of messages) m.read = true; - await writeFile18(inboxPath, jsonStringify(messages, null, 2), "utf-8"); + await writeFile16(inboxPath, jsonStringify(messages, null, 2), "utf-8"); logForDebugging(`[TeammateMailbox] markMessagesAsRead: WROTE ${unreadCount} message(s) as read to ${inboxPath}`); - } catch (error45) { - const code = getErrnoCode(error45); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") { logForDebugging(`[TeammateMailbox] markMessagesAsRead: file does not exist at ${inboxPath}`); return; } - logForDebugging(`[TeammateMailbox] markMessagesAsRead FAILED for ${agentName}: ${error45}`); - logError2(error45); + logForDebugging(`[TeammateMailbox] markMessagesAsRead FAILED for ${agentName}: ${error41}`); + logError2(error41); } finally { if (release) { await release(); @@ -446310,15 +369921,15 @@ async function markMessagesAsRead(agentName, teamName) { async function clearMailbox(agentName, teamName) { const inboxPath = getInboxPath(agentName, teamName); try { - await writeFile18(inboxPath, "[]", { encoding: "utf-8", flag: "r+" }); + await writeFile16(inboxPath, "[]", { encoding: "utf-8", flag: "r+" }); logForDebugging(`[TeammateMailbox] Cleared inbox for ${agentName}`); - } catch (error45) { - const code = getErrnoCode(error45); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") { return; } - logForDebugging(`Failed to clear inbox for ${agentName}: ${error45}`); - logError2(error45); + logForDebugging(`Failed to clear inbox for ${agentName}: ${error41}`); + logError2(error41); } } function formatTeammateMessages(messages) { @@ -446487,41 +370098,41 @@ async function sendShutdownRequestToMailbox(targetName, teamName, reason) { } function isShutdownRequest(messageText) { try { - const result3 = ShutdownRequestMessageSchema().safeParse(jsonParse(messageText)); - if (result3.success) - return result3.data; + const result2 = ShutdownRequestMessageSchema().safeParse(jsonParse(messageText)); + if (result2.success) + return result2.data; } catch {} return null; } function isPlanApprovalRequest(messageText) { try { - const result3 = PlanApprovalRequestMessageSchema().safeParse(jsonParse(messageText)); - if (result3.success) - return result3.data; + const result2 = PlanApprovalRequestMessageSchema().safeParse(jsonParse(messageText)); + if (result2.success) + return result2.data; } catch {} return null; } function isShutdownApproved(messageText) { try { - const result3 = ShutdownApprovedMessageSchema().safeParse(jsonParse(messageText)); - if (result3.success) - return result3.data; + const result2 = ShutdownApprovedMessageSchema().safeParse(jsonParse(messageText)); + if (result2.success) + return result2.data; } catch {} return null; } function isShutdownRejected(messageText) { try { - const result3 = ShutdownRejectedMessageSchema().safeParse(jsonParse(messageText)); - if (result3.success) - return result3.data; + const result2 = ShutdownRejectedMessageSchema().safeParse(jsonParse(messageText)); + if (result2.success) + return result2.data; } catch {} return null; } function isPlanApprovalResponse(messageText) { try { - const result3 = PlanApprovalResponseMessageSchema().safeParse(jsonParse(messageText)); - if (result3.success) - return result3.data; + const result2 = PlanApprovalResponseMessageSchema().safeParse(jsonParse(messageText)); + if (result2.success) + return result2.data; } catch {} return null; } @@ -446585,13 +370196,13 @@ async function markMessagesAsReadByPredicate(agentName, predicate, teamName) { return; } const updatedMessages = messages.map((m) => !m.read && predicate(m) ? { ...m, read: true } : m); - await writeFile18(inboxPath, jsonStringify(updatedMessages, null, 2), "utf-8"); - } catch (error45) { - const code = getErrnoCode(error45); + await writeFile16(inboxPath, jsonStringify(updatedMessages, null, 2), "utf-8"); + } catch (error41) { + const code = getErrnoCode(error41); if (code === "ENOENT") { return; } - logError2(error45); + logError2(error41); } finally { if (release) { try { @@ -446601,8 +370212,8 @@ async function markMessagesAsReadByPredicate(agentName, predicate, teamName) { } } function getLastPeerDmSummary(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const msg = messages[i3]; if (!msg) continue; if (msg.type === "user" && typeof msg.message.content === "string") { @@ -446746,8 +370357,8 @@ var init_PermissionUpdateSchema = __esm(() => { }); // src/utils/swarm/permissionSync.ts -import { mkdir as mkdir16, readdir as readdir13, readFile as readFile18, unlink as unlink9, writeFile as writeFile19 } from "fs/promises"; -import { join as join79 } from "path"; +import { mkdir as mkdir16, readdir as readdir13, readFile as readFile17, unlink as unlink9, writeFile as writeFile17 } from "fs/promises"; +import { join as join69 } from "path"; function generateRequestId2() { return `perm-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`; } @@ -446830,9 +370441,9 @@ async function sendPermissionRequestViaMailbox(request) { }, request.teamName); logForDebugging(`[PermissionSync] Sent permission request ${request.id} to leader ${leaderName} via mailbox`); return true; - } catch (error45) { - logForDebugging(`[PermissionSync] Failed to send permission request via mailbox: ${error45}`); - logError2(error45); + } catch (error41) { + logForDebugging(`[PermissionSync] Failed to send permission request via mailbox: ${error41}`); + logError2(error41); return false; } } @@ -446858,9 +370469,9 @@ async function sendPermissionResponseViaMailbox(workerName, resolution, requestI }, team); logForDebugging(`[PermissionSync] Sent permission response for ${requestId} to worker ${workerName} via mailbox`); return true; - } catch (error45) { - logForDebugging(`[PermissionSync] Failed to send permission response via mailbox: ${error45}`); - logError2(error45); + } catch (error41) { + logForDebugging(`[PermissionSync] Failed to send permission response via mailbox: ${error41}`); + logError2(error41); return false; } } @@ -446901,9 +370512,9 @@ async function sendSandboxPermissionRequestViaMailbox(host, requestId, teamName) }, team); logForDebugging(`[PermissionSync] Sent sandbox permission request ${requestId} for host ${host} to leader ${leaderName} via mailbox`); return true; - } catch (error45) { - logForDebugging(`[PermissionSync] Failed to send sandbox permission request via mailbox: ${error45}`); - logError2(error45); + } catch (error41) { + logForDebugging(`[PermissionSync] Failed to send sandbox permission request via mailbox: ${error41}`); + logError2(error41); return false; } } @@ -446927,9 +370538,9 @@ async function sendSandboxPermissionResponseViaMailbox(workerName, requestId, ho }, team); logForDebugging(`[PermissionSync] Sent sandbox permission response for ${requestId} (host: ${host}, allow: ${allow}) to worker ${workerName} via mailbox`); return true; - } catch (error45) { - logForDebugging(`[PermissionSync] Failed to send sandbox permission response via mailbox: ${error45}`); - logError2(error45); + } catch (error41) { + logForDebugging(`[PermissionSync] Failed to send sandbox permission response via mailbox: ${error41}`); + logError2(error41); return false; } } @@ -446972,11 +370583,11 @@ function parsePermissionUpdates(raw) { const schema = permissionUpdateSchema(); const valid = []; for (const entry of raw) { - const result3 = schema.safeParse(entry); - if (result3.success) { - valid.push(result3.data); + const result2 = schema.safeParse(entry); + if (result2.success) { + valid.push(result2.data); } else { - logForDebugging(`[SwarmPermissionPoller] Dropping malformed permissionUpdate entry: ${result3.error.message}`, { level: "warn" }); + logForDebugging(`[SwarmPermissionPoller] Dropping malformed permissionUpdate entry: ${result2.error.message}`, { level: "warn" }); } } return valid; @@ -447045,8 +370656,8 @@ var init_useSwarmPermissionPoller = __esm(() => { }); // src/utils/toolResultStorage.ts -import { mkdir as mkdir17, writeFile as writeFile20 } from "fs/promises"; -import { join as join80 } from "path"; +import { mkdir as mkdir17, writeFile as writeFile18 } from "fs/promises"; +import { join as join70 } from "path"; function getPersistenceThreshold(toolName, declaredMaxResultSizeChars) { if (!Number.isFinite(declaredMaxResultSizeChars)) { return declaredMaxResultSizeChars; @@ -447059,14 +370670,14 @@ function getPersistenceThreshold(toolName, declaredMaxResultSizeChars) { return Math.min(declaredMaxResultSizeChars, DEFAULT_MAX_RESULT_SIZE_CHARS); } function getSessionDir() { - return join80(getProjectDir2(getOriginalCwd()), getSessionId()); + return join70(getProjectDir2(getOriginalCwd()), getSessionId()); } function getToolResultsDir() { - return join80(getSessionDir(), TOOL_RESULTS_SUBDIR); + return join70(getSessionDir(), TOOL_RESULTS_SUBDIR); } function getToolResultPath(id, isJson) { const ext = isJson ? "json" : "txt"; - return join80(getToolResultsDir(), `${id}.${ext}`); + return join70(getToolResultsDir(), `${id}.${ext}`); } async function ensureToolResultsDir() { try { @@ -447087,12 +370698,12 @@ async function persistToolResult(content, toolUseId) { const filepath = getToolResultPath(toolUseId, isJson); const contentStr = isJson ? jsonStringify(content, null, 2) : content; try { - await writeFile20(filepath, contentStr, { encoding: "utf-8", flag: "wx" }); + await writeFile18(filepath, contentStr, { encoding: "utf-8", flag: "wx" }); logForDebugging(`Persisted tool result to ${filepath} (${formatFileSize(contentStr.length)})`); - } catch (error45) { - if (getErrnoCode(error45) !== "EEXIST") { - logError2(toError(error45)); - return { error: getFileSystemErrorMessage(toError(error45)) }; + } catch (error41) { + if (getErrnoCode(error41) !== "EEXIST") { + logError2(toError(error41)); + return { error: getFileSystemErrorMessage(toError(error41)) }; } } const { preview, hasMore } = generatePreview(contentStr, PREVIEW_SIZE_BYTES); @@ -447104,16 +370715,16 @@ async function persistToolResult(content, toolUseId) { hasMore }; } -function buildLargeToolResultMessage(result3) { +function buildLargeToolResultMessage(result2) { let message = `${PERSISTED_OUTPUT_TAG} `; - message += `Output too large (${formatFileSize(result3.originalSize)}). Full output saved to: ${result3.filepath} + message += `Output too large (${formatFileSize(result2.originalSize)}). Full output saved to: ${result2.filepath} `; message += `Preview (first ${formatFileSize(PREVIEW_SIZE_BYTES)}): `; - message += result3.preview; - message += result3.hasMore ? ` + message += result2.preview; + message += result2.hasMore ? ` ... ` : ` `; @@ -447155,21 +370766,21 @@ async function maybePersistLargeToolResult(toolResultBlock, toolName, persistenc if (hasImageBlock(content)) { return toolResultBlock; } - const size3 = contentSize(content); + const size2 = contentSize(content); const threshold = persistenceThreshold ?? MAX_TOOL_RESULT_BYTES; - if (size3 <= threshold) { + if (size2 <= threshold) { return toolResultBlock; } - const result3 = await persistToolResult(content, toolResultBlock.tool_use_id); - if (isPersistError(result3)) { + const result2 = await persistToolResult(content, toolResultBlock.tool_use_id); + if (isPersistError(result2)) { return toolResultBlock; } - const message = buildLargeToolResultMessage(result3); + const message = buildLargeToolResultMessage(result2); logEvent("tengu_tool_result_persisted", { toolName: sanitizeToolNameForAnalytics(toolName), - originalSizeBytes: result3.originalSize, + originalSizeBytes: result2.originalSize, persistedSizeBytes: message.length, - estimatedOriginalTokens: Math.ceil(result3.originalSize / BYTES_PER_TOKEN), + estimatedOriginalTokens: Math.ceil(result2.originalSize / BYTES_PER_TOKEN), estimatedPersistedTokens: Math.ceil(message.length / BYTES_PER_TOKEN), thresholdUsed: threshold }); @@ -447185,8 +370796,8 @@ function generatePreview(content, maxBytes) { const cutPoint = lastNewline > maxBytes * 0.5 ? lastNewline : maxBytes; return { preview: content.slice(0, cutPoint), hasMore: true }; } -function isPersistError(result3) { - return "error" in result3; +function isPersistError(result2) { + return "error" in result2; } function createContentReplacementState() { return { seenIds: new Set, replacements: new Map }; @@ -447222,10 +370833,10 @@ function hasImageBlock(content) { function contentSize(content) { if (typeof content === "string") return content.length; - return content.reduce((sum3, b) => sum3 + (b.type === "text" ? b.text.length : 0), 0); + return content.reduce((sum2, b) => sum2 + (b.type === "text" ? b.text.length : 0), 0); } function buildToolNameMap(messages) { - const map6 = new Map; + const map4 = new Map; for (const message of messages) { if (message.type !== "assistant") continue; @@ -447234,11 +370845,11 @@ function buildToolNameMap(messages) { continue; for (const block2 of content) { if (block2.type === "tool_use") { - map6.set(block2.id, block2.name); + map4.set(block2.id, block2.name); } } } - return map6; + return map4; } function collectCandidatesFromMessage(message) { if (message.type !== "user" || !Array.isArray(message.message.content)) { @@ -447298,7 +370909,7 @@ function partitionByPriorDecision(candidates, state) { function selectFreshToReplace(fresh, frozenSize, limit) { const sorted = [...fresh].sort((a2, b) => b.size - a2.size); const selected = []; - let remaining = frozenSize + fresh.reduce((sum3, c6) => sum3 + c6.size, 0); + let remaining = frozenSize + fresh.reduce((sum2, c6) => sum2 + c6.size, 0); for (const c6 of sorted) { if (remaining <= limit) break; @@ -447331,12 +370942,12 @@ function replaceToolResultContents(messages, replacementMap) { }); } async function buildReplacement(candidate) { - const result3 = await persistToolResult(candidate.content, candidate.toolUseId); - if (isPersistError(result3)) + const result2 = await persistToolResult(candidate.content, candidate.toolUseId); + if (isPersistError(result2)) return null; return { - content: buildLargeToolResultMessage(result3), - originalSize: result3.originalSize + content: buildLargeToolResultMessage(result2), + originalSize: result2.originalSize }; } async function enforceToolResultBudget(messages, state, skipToolNames = new Set) { @@ -447359,8 +370970,8 @@ async function enforceToolResultBudget(messages, state, skipToolNames = new Set) const skipped = fresh.filter((c6) => shouldSkip(c6.toolUseId)); skipped.forEach((c6) => state.seenIds.add(c6.toolUseId)); const eligible2 = fresh.filter((c6) => !shouldSkip(c6.toolUseId)); - const frozenSize = frozen.reduce((sum3, c6) => sum3 + c6.size, 0); - const freshSize = eligible2.reduce((sum3, c6) => sum3 + c6.size, 0); + const frozenSize = frozen.reduce((sum2, c6) => sum2 + c6.size, 0); + const freshSize = eligible2.reduce((sum2, c6) => sum2 + c6.size, 0); const selected = frozenSize + freshSize > limit ? selectFreshToReplace(eligible2, frozenSize, limit) : []; const selectedIds = new Set(selected.map((c6) => c6.toolUseId)); candidates.filter((c6) => !selectedIds.has(c6.toolUseId)).forEach((c6) => state.seenIds.add(c6.toolUseId)); @@ -447414,11 +371025,11 @@ async function enforceToolResultBudget(messages, state, skipToolNames = new Set) async function applyToolResultBudget(messages, state, writeToTranscript, skipToolNames) { if (!state) return messages; - const result3 = await enforceToolResultBudget(messages, state, skipToolNames); - if (result3.newlyReplaced.length > 0) { - writeToTranscript?.(result3.newlyReplaced); + const result2 = await enforceToolResultBudget(messages, state, skipToolNames); + if (result2.newlyReplaced.length > 0) { + writeToTranscript?.(result2.newlyReplaced); } - return result3.messages; + return result2.messages; } function reconstructContentReplacementState(messages, records, inheritedReplacements) { const state = createContentReplacementState(); @@ -447445,8 +371056,8 @@ function reconstructForSubagentResume(parentState, resumedMessages, sidechainRec return; return reconstructContentReplacementState(resumedMessages, sidechainRecords, parentState.replacements); } -function getFileSystemErrorMessage(error45) { - const nodeError = error45; +function getFileSystemErrorMessage(error41) { + const nodeError = error41; if (nodeError.code) { switch (nodeError.code) { case "ENOENT": @@ -447465,7 +371076,7 @@ function getFileSystemErrorMessage(error45) { return `${nodeError.code}: ${nodeError.message}`; } } - return error45.message; + return error41.message; } var TOOL_RESULTS_SUBDIR = "tool-results", PERSISTED_OUTPUT_TAG = "", PERSISTED_OUTPUT_CLOSING_TAG = "", PERSIST_THRESHOLD_OVERRIDE_FLAG = "tengu_satin_quoll", PREVIEW_SIZE_BYTES = 2000; var init_toolResultStorage = __esm(() => { @@ -447521,18 +371132,18 @@ The user interacts primarily with the team lead. Your work is coordinated throug `; // src/utils/swarm/inProcessRunner.ts -function createInProcessCanUseTool(identity5, abortController, onPermissionWaitMs) { - return async (tool, input11, toolUseContext, assistantMessage, toolUseID, forceDecision) => { - const result3 = forceDecision ?? await hasPermissionsToUseTool(tool, input11, toolUseContext, assistantMessage, toolUseID); - if (result3.behavior !== "ask") { - return result3; +function createInProcessCanUseTool(identity4, abortController, onPermissionWaitMs) { + return async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => { + const result2 = forceDecision ?? await hasPermissionsToUseTool(tool, input, toolUseContext, assistantMessage, toolUseID); + if (result2.behavior !== "ask") { + return result2; } - if (feature("BASH_CLASSIFIER") && tool.name === BASH_TOOL_NAME && result3.pendingClassifierCheck) { - const classifierDecision = await awaitClassifierAutoApproval(result3.pendingClassifierCheck, abortController.signal, toolUseContext.options.isNonInteractiveSession); + if (feature("BASH_CLASSIFIER") && tool.name === BASH_TOOL_NAME && result2.pendingClassifierCheck) { + const classifierDecision = await awaitClassifierAutoApproval(result2.pendingClassifierCheck, abortController.signal, toolUseContext.options.isNonInteractiveSession); if (classifierDecision) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: classifierDecision }; } @@ -447541,7 +371152,7 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM return { behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }; } const appState = toolUseContext.getAppState(); - const description = await tool.description(input11, { + const description = await tool.description(input, { isNonInteractiveSession: toolUseContext.options.isNonInteractiveSession, toolPermissionContext: appState.toolPermissionContext, tools: toolUseContext.options.tools @@ -447551,7 +371162,7 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM } const setToolUseConfirmQueue = getLeaderToolUseConfirmQueue(); if (setToolUseConfirmQueue) { - return new Promise((resolve27) => { + return new Promise((resolve21) => { let decisionMade = false; const permissionStartMs = Date.now(); const reportPermissionWait = () => { @@ -447562,7 +371173,7 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM return; decisionMade = true; reportPermissionWait(); - resolve27({ behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }); + resolve21({ behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }); setToolUseConfirmQueue((queue2) => queue2.filter((item) => item.toolUseID !== toolUseID)); }; abortController.signal.addEventListener("abort", onAbortListener, { @@ -447574,12 +371185,12 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM assistantMessage, tool, description, - input: input11, + input, toolUseContext, toolUseID, - permissionResult: result3, + permissionResult: result2, permissionPromptStartTimeMs: permissionStartMs, - workerBadge: identity5.color ? { name: identity5.agentName, color: identity5.color } : undefined, + workerBadge: identity4.color ? { name: identity4.agentName, color: identity4.color } : undefined, onUserInteraction() {}, onAbort() { if (decisionMade) @@ -447587,7 +371198,7 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM decisionMade = true; abortController.signal.removeEventListener("abort", onAbortListener); reportPermissionWait(); - resolve27({ behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }); + resolve21({ behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }); }, async onAllow(updatedInput, permissionUpdates, feedback, contentBlocks) { if (decisionMade) @@ -447607,7 +371218,7 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM } } const trimmedFeedback = feedback?.trim(); - resolve27({ + resolve21({ behavior: "allow", updatedInput, userModified: false, @@ -447622,20 +371233,20 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM abortController.signal.removeEventListener("abort", onAbortListener); reportPermissionWait(); const message = feedback ? `${SUBAGENT_REJECT_MESSAGE_WITH_REASON_PREFIX}${feedback}` : SUBAGENT_REJECT_MESSAGE; - resolve27({ behavior: "ask", message, contentBlocks }); + resolve21({ behavior: "ask", message, contentBlocks }); }, async recheckPermission() { if (decisionMade) return; - const freshResult = await hasPermissionsToUseTool(tool, input11, toolUseContext, assistantMessage, toolUseID); + const freshResult = await hasPermissionsToUseTool(tool, input, toolUseContext, assistantMessage, toolUseID); if (freshResult.behavior === "allow") { decisionMade = true; abortController.signal.removeEventListener("abort", onAbortListener); reportPermissionWait(); setToolUseConfirmQueue((queue3) => queue3.filter((item) => item.toolUseID !== toolUseID)); - resolve27({ + resolve21({ ...freshResult, - updatedInput: input11, + updatedInput: input, userModified: false }); } @@ -447644,17 +371255,17 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM ]); }); } - return new Promise((resolve27) => { + return new Promise((resolve21) => { const request = createPermissionRequest({ toolName: tool.name, toolUseId: toolUseID, - input: input11, + input, description, - permissionSuggestions: result3.suggestions, - workerId: identity5.agentId, - workerName: identity5.agentName, - workerColor: identity5.color, - teamName: identity5.teamName + permissionSuggestions: result2.suggestions, + workerId: identity4.agentId, + workerName: identity4.agentName, + workerColor: identity4.color, + teamName: identity4.teamName }); registerPermissionCallback({ requestId: request.id, @@ -447662,8 +371273,8 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM onAllow(updatedInput, permissionUpdates, _feedback, contentBlocks) { cleanup(); persistPermissionUpdates(permissionUpdates); - const finalInput = updatedInput && Object.keys(updatedInput).length > 0 ? updatedInput : input11; - resolve27({ + const finalInput = updatedInput && Object.keys(updatedInput).length > 0 ? updatedInput : input; + resolve21({ behavior: "allow", updatedInput: finalInput, userModified: false, @@ -447673,23 +371284,23 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM onReject(feedback, contentBlocks) { cleanup(); const message = feedback ? `${SUBAGENT_REJECT_MESSAGE_WITH_REASON_PREFIX}${feedback}` : SUBAGENT_REJECT_MESSAGE; - resolve27({ behavior: "ask", message, contentBlocks }); + resolve21({ behavior: "ask", message, contentBlocks }); } }); sendPermissionRequestViaMailbox(request); - const pollInterval = setInterval(async (abortController2, cleanup2, resolve28, identity6, request2) => { + const pollInterval = setInterval(async (abortController2, cleanup2, resolve22, identity5, request2) => { if (abortController2.signal.aborted) { cleanup2(); - resolve28({ behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }); + resolve22({ behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }); return; } - const allMessages = await readMailbox(identity6.agentName, identity6.teamName); - for (let i4 = 0;i4 < allMessages.length; i4++) { - const msg = allMessages[i4]; + const allMessages = await readMailbox(identity5.agentName, identity5.teamName); + for (let i3 = 0;i3 < allMessages.length; i3++) { + const msg = allMessages[i3]; if (msg && !msg.read) { const parsed = isPermissionResponse(msg.text); if (parsed && parsed.request_id === request2.id) { - await markMessageAsReadByIndex(identity6.agentName, identity6.teamName, i4); + await markMessageAsReadByIndex(identity5.agentName, identity5.teamName, i3); if (parsed.subtype === "success") { processMailboxPermissionResponse({ requestId: parsed.request_id, @@ -447708,10 +371319,10 @@ function createInProcessCanUseTool(identity5, abortController, onPermissionWaitM } } } - }, PERMISSION_POLL_INTERVAL_MS, abortController, cleanup, resolve27, identity5, request); + }, PERMISSION_POLL_INTERVAL_MS, abortController, cleanup, resolve21, identity4, request); const onAbortListener = () => { cleanup(); - resolve27({ behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }); + resolve21({ behavior: "ask", message: SUBAGENT_REJECT_MESSAGE }); }; abortController.signal.addEventListener("abort", onAbortListener, { once: true @@ -447750,10 +371361,10 @@ function updateTaskState2(taskId, updater, setAppState) { }; }); } -async function sendMessageToLeader(from, text2, color2, teamName) { +async function sendMessageToLeader(from, text, color2, teamName) { await writeToMailbox(TEAM_LEAD_NAME, { from, - text: text2, + text, timestamp: new Date().toISOString(), color: color2 }, teamName); @@ -447790,22 +371401,22 @@ async function tryClaimNextTask(taskListId, agentName) { if (!availableTask) { return; } - const result3 = await claimTask(taskListId, availableTask.id, agentName); - if (!result3.success) { - logForDebugging(`[inProcessRunner] Failed to claim task #${availableTask.id}: ${result3.reason}`); + const result2 = await claimTask(taskListId, availableTask.id, agentName); + if (!result2.success) { + logForDebugging(`[inProcessRunner] Failed to claim task #${availableTask.id}: ${result2.reason}`); return; } await updateTask(taskListId, availableTask.id, { status: "in_progress" }); logForDebugging(`[inProcessRunner] Claimed task #${availableTask.id}: ${availableTask.subject}`); return formatTaskAsPrompt(availableTask); - } catch (err3) { - logForDebugging(`[inProcessRunner] Error checking task list: ${err3}`); + } catch (err2) { + logForDebugging(`[inProcessRunner] Error checking task list: ${err2}`); return; } } -async function waitForNextPromptOrShutdown(identity5, abortController, taskId, getAppState, setAppState, taskListId) { +async function waitForNextPromptOrShutdown(identity4, abortController, taskId, getAppState, setAppState, taskListId) { const POLL_INTERVAL_MS = 500; - logForDebugging(`[inProcessRunner] ${identity5.agentName} starting poll loop (abort=${abortController.signal.aborted})`); + logForDebugging(`[inProcessRunner] ${identity4.agentName} starting poll loop (abort=${abortController.signal.aborted})`); let pollCount = 0; while (!abortController.signal.aborted) { const appState = getAppState(); @@ -447828,7 +371439,7 @@ async function waitForNextPromptOrShutdown(identity5, abortController, taskId, g } }; }); - logForDebugging(`[inProcessRunner] ${identity5.agentName} found pending user message (poll #${pollCount})`); + logForDebugging(`[inProcessRunner] ${identity4.agentName} found pending user message (poll #${pollCount})`); return { type: "new_message", message, @@ -447836,24 +371447,24 @@ async function waitForNextPromptOrShutdown(identity5, abortController, taskId, g }; } if (pollCount > 0) { - await sleep4(POLL_INTERVAL_MS); + await sleep2(POLL_INTERVAL_MS); } pollCount++; if (abortController.signal.aborted) { - logForDebugging(`[inProcessRunner] ${identity5.agentName} aborted while waiting (poll #${pollCount})`); + logForDebugging(`[inProcessRunner] ${identity4.agentName} aborted while waiting (poll #${pollCount})`); return { type: "aborted" }; } - logForDebugging(`[inProcessRunner] ${identity5.agentName} poll #${pollCount}: checking mailbox`); + logForDebugging(`[inProcessRunner] ${identity4.agentName} poll #${pollCount}: checking mailbox`); try { - const allMessages = await readMailbox(identity5.agentName, identity5.teamName); + const allMessages = await readMailbox(identity4.agentName, identity4.teamName); let shutdownIndex = -1; let shutdownParsed = null; - for (let i4 = 0;i4 < allMessages.length; i4++) { - const m = allMessages[i4]; + for (let i3 = 0;i3 < allMessages.length; i3++) { + const m = allMessages[i3]; if (m && !m.read) { const parsed = isShutdownRequest(m.text); if (parsed) { - shutdownIndex = i4; + shutdownIndex = i3; shutdownParsed = parsed; break; } @@ -447862,8 +371473,8 @@ async function waitForNextPromptOrShutdown(identity5, abortController, taskId, g if (shutdownIndex !== -1) { const msg = allMessages[shutdownIndex]; const skippedUnread = count2(allMessages.slice(0, shutdownIndex), (m) => !m.read); - logForDebugging(`[inProcessRunner] ${identity5.agentName} received shutdown request from ${shutdownParsed?.from} (prioritized over ${skippedUnread} unread messages)`); - await markMessageAsReadByIndex(identity5.agentName, identity5.teamName, shutdownIndex); + logForDebugging(`[inProcessRunner] ${identity4.agentName} received shutdown request from ${shutdownParsed?.from} (prioritized over ${skippedUnread} unread messages)`); + await markMessageAsReadByIndex(identity4.agentName, identity4.teamName, shutdownIndex); return { type: "shutdown_request", request: shutdownParsed, @@ -447871,10 +371482,10 @@ async function waitForNextPromptOrShutdown(identity5, abortController, taskId, g }; } let selectedIndex = -1; - for (let i4 = 0;i4 < allMessages.length; i4++) { - const m = allMessages[i4]; + for (let i3 = 0;i3 < allMessages.length; i3++) { + const m = allMessages[i3]; if (m && !m.read && m.from === TEAM_LEAD_NAME) { - selectedIndex = i4; + selectedIndex = i3; break; } } @@ -447884,8 +371495,8 @@ async function waitForNextPromptOrShutdown(identity5, abortController, taskId, g if (selectedIndex !== -1) { const msg = allMessages[selectedIndex]; if (msg) { - logForDebugging(`[inProcessRunner] ${identity5.agentName} received new message from ${msg.from} (index ${selectedIndex})`); - await markMessageAsReadByIndex(identity5.agentName, identity5.teamName, selectedIndex); + logForDebugging(`[inProcessRunner] ${identity4.agentName} received new message from ${msg.from} (index ${selectedIndex})`); + await markMessageAsReadByIndex(identity4.agentName, identity4.teamName, selectedIndex); return { type: "new_message", message: msg.text, @@ -447895,10 +371506,10 @@ async function waitForNextPromptOrShutdown(identity5, abortController, taskId, g }; } } - } catch (err3) { - logForDebugging(`[inProcessRunner] ${identity5.agentName} poll error: ${err3}`); + } catch (err2) { + logForDebugging(`[inProcessRunner] ${identity4.agentName} poll error: ${err2}`); } - const taskPrompt = await tryClaimNextTask(taskListId, identity5.agentName); + const taskPrompt = await tryClaimNextTask(taskListId, identity4.agentName); if (taskPrompt) { return { type: "new_message", @@ -447907,12 +371518,12 @@ async function waitForNextPromptOrShutdown(identity5, abortController, taskId, g }; } } - logForDebugging(`[inProcessRunner] ${identity5.agentName} exiting poll loop (abort=${abortController.signal.aborted}, polls=${pollCount})`); + logForDebugging(`[inProcessRunner] ${identity4.agentName} exiting poll loop (abort=${abortController.signal.aborted}, polls=${pollCount})`); return { type: "aborted" }; } -async function runInProcessTeammate(config4) { +async function runInProcessTeammate(config2) { const { - identity: identity5, + identity: identity4, taskId, prompt, description, @@ -447926,16 +371537,16 @@ async function runInProcessTeammate(config4) { allowedTools, allowPermissionPrompts, invokingRequestId - } = config4; + } = config2; const { setAppState } = toolUseContext; - logForDebugging(`[inProcessRunner] Starting agent loop for ${identity5.agentId}`); + logForDebugging(`[inProcessRunner] Starting agent loop for ${identity4.agentId}`); const agentContext = { - agentId: identity5.agentId, - parentSessionId: identity5.parentSessionId, - agentName: identity5.agentName, - teamName: identity5.teamName, - agentColor: identity5.color, - planModeRequired: identity5.planModeRequired, + agentId: identity4.agentId, + parentSessionId: identity4.parentSessionId, + agentName: identity4.agentName, + teamName: identity4.teamName, + agentColor: identity4.color, + planModeRequired: identity4.planModeRequired, isTeamLead: false, agentType: "teammate", invokingRequestId, @@ -447975,8 +371586,8 @@ ${customPrompt}`); `); } const resolvedAgentDefinition = { - agentType: identity5.agentName, - whenToUse: `In-process teammate: ${identity5.agentName}`, + agentType: identity4.agentName, + whenToUse: `In-process teammate: ${identity4.agentName}`, getSystemPrompt: () => teammateSystemPrompt, tools: agentDefinition?.tools ? [ ...new Set([ @@ -447998,7 +371609,7 @@ ${customPrompt}`); const wrappedInitialPrompt = formatAsTeammateMessage("team-lead", prompt, undefined, description); let currentPrompt = wrappedInitialPrompt; let shouldExit = false; - await tryClaimNextTask(identity5.parentSessionId, identity5.agentName); + await tryClaimNextTask(identity4.parentSessionId, identity4.agentName); try { updateTaskState2(taskId, (task) => ({ ...task, @@ -448006,7 +371617,7 @@ ${customPrompt}`); }), setAppState); let teammateReplacementState = toolUseContext.contentReplacementState ? createContentReplacementState() : undefined; while (!abortController.signal.aborted && !shouldExit) { - logForDebugging(`[inProcessRunner] ${identity5.agentId} processing prompt: ${currentPrompt.substring(0, 50)}...`); + logForDebugging(`[inProcessRunner] ${identity4.agentId} processing prompt: ${currentPrompt.substring(0, 50)}...`); const currentWorkAbortController = createAbortController(); updateTaskState2(taskId, (task) => ({ ...task, currentWorkAbortController }), setAppState); const userMessage = createUserMessage({ content: currentPrompt }); @@ -448014,7 +371625,7 @@ ${customPrompt}`); let contextMessages = allMessages; const tokenCount = tokenCountWithEstimation(allMessages); if (tokenCount > getAutoCompactThreshold(toolUseContext.options.mainLoopModel)) { - logForDebugging(`[inProcessRunner] ${identity5.agentId} compacting history (${tokenCount} tokens)`); + logForDebugging(`[inProcessRunner] ${identity4.agentId} compacting history (${tokenCount} tokens)`); const isolatedContext = { ...toolUseContext, readFileState: cloneFileStateCache(toolUseContext.readFileState), @@ -448057,7 +371668,7 @@ ${customPrompt}`); agentDefinition: iterationAgentDefinition, promptMessages, toolUseContext, - canUseTool: createInProcessCanUseTool(identity5, currentWorkAbortController, (waitMs) => { + canUseTool: createInProcessCanUseTool(identity4, currentWorkAbortController, (waitMs) => { updateTaskState2(taskId, (task) => ({ ...task, totalPausedMs: (task.totalPausedMs ?? 0) + waitMs @@ -448075,11 +371686,11 @@ ${customPrompt}`); contentReplacementState: teammateReplacementState })) { if (abortController.signal.aborted) { - logForDebugging(`[inProcessRunner] ${identity5.agentId} lifecycle aborted`); + logForDebugging(`[inProcessRunner] ${identity4.agentId} lifecycle aborted`); break; } if (currentWorkAbortController.signal.aborted) { - logForDebugging(`[inProcessRunner] ${identity5.agentId} current work aborted (Escape pressed)`); + logForDebugging(`[inProcessRunner] ${identity4.agentId} current work aborted (Escape pressed)`); workWasAborted = true; break; } @@ -448127,7 +371738,7 @@ ${customPrompt}`); break; } if (workWasAborted) { - logForDebugging(`[inProcessRunner] ${identity5.agentId} work interrupted, returning to idle`); + logForDebugging(`[inProcessRunner] ${identity4.agentId} work interrupted, returning to idle`); const interruptMessage = createAssistantAPIErrorMessage({ content: ERROR_MESSAGE_USER_ABORT }); @@ -448144,23 +371755,23 @@ ${customPrompt}`); return { ...task, isIdle: true, onIdleCallbacks: [] }; }, setAppState); if (!wasAlreadyIdle) { - await sendIdleNotification(identity5.agentName, identity5.color, identity5.teamName, { + await sendIdleNotification(identity4.agentName, identity4.color, identity4.teamName, { idleReason: workWasAborted ? "interrupted" : "available", summary: getLastPeerDmSummary(allMessages) }); } else { - logForDebugging(`[inProcessRunner] Skipping duplicate idle notification for ${identity5.agentName}`); + logForDebugging(`[inProcessRunner] Skipping duplicate idle notification for ${identity4.agentName}`); } - logForDebugging(`[inProcessRunner] ${identity5.agentId} finished prompt, waiting for next`); - const waitResult = await waitForNextPromptOrShutdown(identity5, abortController, taskId, toolUseContext.getAppState, setAppState, identity5.parentSessionId); + logForDebugging(`[inProcessRunner] ${identity4.agentId} finished prompt, waiting for next`); + const waitResult = await waitForNextPromptOrShutdown(identity4, abortController, taskId, toolUseContext.getAppState, setAppState, identity4.parentSessionId); switch (waitResult.type) { case "shutdown_request": - logForDebugging(`[inProcessRunner] ${identity5.agentId} received shutdown request - passing to model`); + logForDebugging(`[inProcessRunner] ${identity4.agentId} received shutdown request - passing to model`); currentPrompt = formatAsTeammateMessage(waitResult.request?.from || "team-lead", waitResult.originalMessage); appendTeammateMessage(taskId, createUserMessage({ content: currentPrompt }), setAppState); break; case "new_message": - logForDebugging(`[inProcessRunner] ${identity5.agentId} received new message from ${waitResult.from}`); + logForDebugging(`[inProcessRunner] ${identity4.agentId} received new message from ${waitResult.from}`); if (waitResult.from === "user") { currentPrompt = waitResult.message; } else { @@ -448169,7 +371780,7 @@ ${customPrompt}`); } break; case "aborted": - logForDebugging(`[inProcessRunner] ${identity5.agentId} aborted while waiting`); + logForDebugging(`[inProcessRunner] ${identity4.agentId} aborted while waiting`); shouldExit = true; break; } @@ -448203,14 +371814,14 @@ ${customPrompt}`); if (!alreadyTerminal) { emitTaskTerminatedSdk(taskId, "completed", { toolUseId, - summary: identity5.agentId + summary: identity4.agentId }); } - unregisterAgent(identity5.agentId); + unregisterAgent(identity4.agentId); return { success: true, messages: allMessages }; - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : "Unknown error"; - logForDebugging(`[inProcessRunner] Agent ${identity5.agentId} failed: ${errorMessage2}`); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : "Unknown error"; + logForDebugging(`[inProcessRunner] Agent ${identity4.agentId} failed: ${errorMessage2}`); let alreadyTerminal = false; let toolUseId; updateTaskState2(taskId, (task) => { @@ -448242,15 +371853,15 @@ ${customPrompt}`); if (!alreadyTerminal) { emitTaskTerminatedSdk(taskId, "failed", { toolUseId, - summary: identity5.agentId + summary: identity4.agentId }); } - await sendIdleNotification(identity5.agentName, identity5.color, identity5.teamName, { + await sendIdleNotification(identity4.agentName, identity4.color, identity4.teamName, { idleReason: "failed", completedStatus: "failed", failureReason: errorMessage2 }); - unregisterAgent(identity5.agentId); + unregisterAgent(identity4.agentId); return { success: false, error: errorMessage2, @@ -448258,27 +371869,27 @@ ${customPrompt}`); }; } } -function startInProcessTeammate(config4) { - const agentId = config4.identity.agentId; - runInProcessTeammate(config4).catch((error45) => { - logForDebugging(`[inProcessRunner] Unhandled error in ${agentId}: ${error45}`); +function startInProcessTeammate(config2) { + const agentId = config2.identity.agentId; + runInProcessTeammate(config2).catch((error41) => { + logForDebugging(`[inProcessRunner] Unhandled error in ${agentId}: ${error41}`); }); } var PERMISSION_POLL_INTERVAL_MS = 500; var init_inProcessRunner = __esm(() => { init_bun_bundle(); - init_prompts5(); + init_prompts4(); init_xml(); init_useSwarmPermissionPoller(); init_analytics(); init_autoCompact(); - init_compact3(); + init_compact2(); init_microCompact(); init_InProcessTeammateTask(); init_LocalAgentTask(); init_runAgent(); init_bashPermissions(); - init_messages5(); + init_messages3(); init_diskOutput(); init_framework(); init_tokens(); @@ -448286,7 +371897,7 @@ var init_inProcessRunner = __esm(() => { init_agentContext(); init_debug(); init_fileStateCache(); - init_messages5(); + init_messages3(); init_PermissionUpdate(); init_permissions2(); init_sdkEventQueue(); @@ -448309,52 +371920,52 @@ class InProcessBackend { async isAvailable() { return true; } - async spawn(config4) { + async spawn(config2) { if (!this.context) { - logForDebugging(`[InProcessBackend] spawn() called without context for ${config4.name}`); + logForDebugging(`[InProcessBackend] spawn() called without context for ${config2.name}`); return { success: false, - agentId: `${config4.name}@${config4.teamName}`, + agentId: `${config2.name}@${config2.teamName}`, error: "InProcessBackend not initialized. Call setContext() before spawn()." }; } - logForDebugging(`[InProcessBackend] spawn() called for ${config4.name}`); - const result3 = await spawnInProcessTeammate({ - name: config4.name, - teamName: config4.teamName, - prompt: config4.prompt, - color: config4.color, - planModeRequired: config4.planModeRequired ?? false + logForDebugging(`[InProcessBackend] spawn() called for ${config2.name}`); + const result2 = await spawnInProcessTeammate({ + name: config2.name, + teamName: config2.teamName, + prompt: config2.prompt, + color: config2.color, + planModeRequired: config2.planModeRequired ?? false }, this.context); - if (result3.success && result3.taskId && result3.teammateContext && result3.abortController) { + if (result2.success && result2.taskId && result2.teammateContext && result2.abortController) { startInProcessTeammate({ identity: { - agentId: result3.agentId, - agentName: config4.name, - teamName: config4.teamName, - color: config4.color, - planModeRequired: config4.planModeRequired ?? false, - parentSessionId: result3.teammateContext.parentSessionId + agentId: result2.agentId, + agentName: config2.name, + teamName: config2.teamName, + color: config2.color, + planModeRequired: config2.planModeRequired ?? false, + parentSessionId: result2.teammateContext.parentSessionId }, - taskId: result3.taskId, - prompt: config4.prompt, - teammateContext: result3.teammateContext, + taskId: result2.taskId, + prompt: config2.prompt, + teammateContext: result2.teammateContext, toolUseContext: { ...this.context, messages: [] }, - abortController: result3.abortController, - model: config4.model, - systemPrompt: config4.systemPrompt, - systemPromptMode: config4.systemPromptMode, - allowedTools: config4.permissions, - allowPermissionPrompts: config4.allowPermissionPrompts + abortController: result2.abortController, + model: config2.model, + systemPrompt: config2.systemPrompt, + systemPromptMode: config2.systemPromptMode, + allowedTools: config2.permissions, + allowPermissionPrompts: config2.allowPermissionPrompts }); - logForDebugging(`[InProcessBackend] Started agent execution for ${result3.agentId}`); + logForDebugging(`[InProcessBackend] Started agent execution for ${result2.agentId}`); } return { - success: result3.success, - agentId: result3.agentId, - taskId: result3.taskId, - abortController: result3.abortController, - error: result3.error + success: result2.success, + agentId: result2.agentId, + taskId: result2.taskId, + abortController: result2.abortController, + error: result2.error }; } async sendMessage(agentId, message) { @@ -448434,9 +372045,9 @@ class InProcessBackend { return false; } const isRunning = task.status === "running"; - const isAborted3 = task.abortController?.signal.aborted ?? true; - const active = isRunning && !isAborted3; - logForDebugging(`[InProcessBackend] isActive() for ${agentId}: ${active} (running=${isRunning}, aborted=${isAborted3})`); + const isAborted2 = task.abortController?.signal.aborted ?? true; + const active = isRunning && !isAborted2; + logForDebugging(`[InProcessBackend] isActive() for ${agentId}: ${active} (running=${isRunning}, aborted=${isAborted2})`); return active; } } @@ -448453,7 +372064,7 @@ var init_InProcessBackend = __esm(() => { }); // src/utils/swarm/backends/it2Setup.ts -import { homedir as homedir23 } from "os"; +import { homedir as homedir21 } from "os"; async function detectPythonPackageManager() { const uvResult = await execFileNoThrow("which", ["uv"]); if (uvResult.code === 0) { @@ -448479,36 +372090,36 @@ async function detectPythonPackageManager() { return null; } async function isIt2CliAvailable2() { - const result3 = await execFileNoThrow("which", ["it2"]); - return result3.code === 0; + const result2 = await execFileNoThrow("which", ["it2"]); + return result2.code === 0; } async function installIt2(packageManager) { logForDebugging(`[it2Setup] Installing it2 using ${packageManager}`); - let result3; + let result2; switch (packageManager) { case "uvx": - result3 = await execFileNoThrowWithCwd("uv", ["tool", "install", "it2"], { - cwd: homedir23() + result2 = await execFileNoThrowWithCwd("uv", ["tool", "install", "it2"], { + cwd: homedir21() }); break; case "pipx": - result3 = await execFileNoThrowWithCwd("pipx", ["install", "it2"], { - cwd: homedir23() + result2 = await execFileNoThrowWithCwd("pipx", ["install", "it2"], { + cwd: homedir21() }); break; case "pip": - result3 = await execFileNoThrowWithCwd("pip", ["install", "--user", "it2"], { cwd: homedir23() }); - if (result3.code !== 0) { - result3 = await execFileNoThrowWithCwd("pip3", ["install", "--user", "it2"], { cwd: homedir23() }); + result2 = await execFileNoThrowWithCwd("pip", ["install", "--user", "it2"], { cwd: homedir21() }); + if (result2.code !== 0) { + result2 = await execFileNoThrowWithCwd("pip3", ["install", "--user", "it2"], { cwd: homedir21() }); } break; } - if (result3.code !== 0) { - const error45 = result3.stderr || "Unknown installation error"; - logError2(new Error(`[it2Setup] Failed to install it2: ${error45}`)); + if (result2.code !== 0) { + const error41 = result2.stderr || "Unknown installation error"; + logError2(new Error(`[it2Setup] Failed to install it2: ${error41}`)); return { success: false, - error: error45, + error: error41, packageManager }; } @@ -448527,9 +372138,9 @@ async function verifyIt2Setup() { error: "it2 CLI is not installed or not in PATH" }; } - const result3 = await execFileNoThrow("it2", ["session", "list"]); - if (result3.code !== 0) { - const stderr = result3.stderr.toLowerCase(); + const result2 = await execFileNoThrow("it2", ["session", "list"]); + if (result2.code !== 0) { + const stderr = result2.stderr.toLowerCase(); if (stderr.includes("api") || stderr.includes("python") || stderr.includes("connection refused") || stderr.includes("not enabled")) { logForDebugging("[it2Setup] Python API not enabled in iTerm2"); return { @@ -448540,7 +372151,7 @@ async function verifyIt2Setup() { } return { success: false, - error: result3.stderr || "Failed to communicate with iTerm2" + error: result2.stderr || "Failed to communicate with iTerm2" }; } logForDebugging("[it2Setup] it2 setup verified successfully"); @@ -448558,8 +372169,8 @@ function getPythonApiInstructions() { ]; } function markIt2SetupComplete() { - const config4 = getGlobalConfig(); - if (config4.iterm2It2SetupComplete !== true) { + const config2 = getGlobalConfig(); + if (config2.iterm2It2SetupComplete !== true) { saveGlobalConfig((current) => ({ ...current, iterm2It2SetupComplete: true @@ -448568,8 +372179,8 @@ function markIt2SetupComplete() { } } function setPreferTmuxOverIterm2(prefer) { - const config4 = getGlobalConfig(); - if (config4.preferTmuxOverIterm2 !== prefer) { + const config2 = getGlobalConfig(); + if (config2.preferTmuxOverIterm2 !== prefer) { saveGlobalConfig((current) => ({ ...current, preferTmuxOverIterm2: prefer @@ -448612,8 +372223,8 @@ function captureTeammateModeSnapshot() { initialTeammateMode = cliTeammateModeOverride; logForDebugging(`[TeammateModeSnapshot] Captured from CLI override: ${initialTeammateMode}`); } else { - const config4 = getGlobalConfig(); - initialTeammateMode = config4.teammateMode ?? "auto"; + const config2 = getGlobalConfig(); + initialTeammateMode = config2.teammateMode ?? "auto"; logForDebugging(`[TeammateModeSnapshot] Captured from config: ${initialTeammateMode}`); } } @@ -448763,10 +372374,10 @@ class PaneBackendExecutor { async isAvailable() { return this.backend.isAvailable(); } - async spawn(config4) { - const agentId = formatAgentId(config4.name, config4.teamName); + async spawn(config2) { + const agentId = formatAgentId(config2.name, config2.teamName); if (!this.context) { - logForDebugging(`[PaneBackendExecutor] spawn() called without context for ${config4.name}`); + logForDebugging(`[PaneBackendExecutor] spawn() called without context for ${config2.name}`); return { success: false, agentId, @@ -448774,8 +372385,8 @@ class PaneBackendExecutor { }; } try { - const teammateColor = config4.color ?? assignTeammateColor(agentId); - const { paneId, isFirstTeammate } = await this.backend.createTeammatePaneInSwarmView(config4.name, teammateColor); + const teammateColor = config2.color ?? assignTeammateColor(agentId); + const { paneId, isFirstTeammate } = await this.backend.createTeammatePaneInSwarmView(config2.name, teammateColor); const insideTmux = await isInsideTmux(); if (isFirstTeammate && insideTmux) { await this.backend.enablePaneBorderStatus(); @@ -448783,23 +372394,23 @@ class PaneBackendExecutor { const binaryPath = getTeammateCommand(); const teammateArgs = [ `--agent-id ${quote([agentId])}`, - `--agent-name ${quote([config4.name])}`, - `--team-name ${quote([config4.teamName])}`, + `--agent-name ${quote([config2.name])}`, + `--team-name ${quote([config2.teamName])}`, `--agent-color ${quote([teammateColor])}`, - `--parent-session-id ${quote([config4.parentSessionId || getSessionId()])}`, - config4.planModeRequired ? "--plan-mode-required" : "" + `--parent-session-id ${quote([config2.parentSessionId || getSessionId()])}`, + config2.planModeRequired ? "--plan-mode-required" : "" ].filter(Boolean).join(" "); const appState = this.context.getAppState(); let inheritedFlags = buildInheritedCliFlags({ - planModeRequired: config4.planModeRequired, + planModeRequired: config2.planModeRequired, permissionMode: appState.toolPermissionContext.mode }); - if (config4.model) { - inheritedFlags = inheritedFlags.split(" ").filter((flag, i4, arr) => flag !== "--model" && arr[i4 - 1] !== "--model").join(" "); - inheritedFlags = inheritedFlags ? `${inheritedFlags} --model ${quote([config4.model])}` : `--model ${quote([config4.model])}`; + if (config2.model) { + inheritedFlags = inheritedFlags.split(" ").filter((flag, i3, arr) => flag !== "--model" && arr[i3 - 1] !== "--model").join(" "); + inheritedFlags = inheritedFlags ? `${inheritedFlags} --model ${quote([config2.model])}` : `--model ${quote([config2.model])}`; } const flagsStr = inheritedFlags ? ` ${inheritedFlags}` : ""; - const workingDir = config4.cwd; + const workingDir = config2.cwd; const envStr = buildInheritedEnvVars(); const spawnCommand = `cd ${quote([workingDir])} && env ${envStr} ${quote([binaryPath])} ${teammateArgs}${flagsStr}`; await this.backend.sendCommandToPane(paneId, spawnCommand, !insideTmux); @@ -448814,19 +372425,19 @@ class PaneBackendExecutor { this.spawnedTeammates.clear(); }); } - await writeToMailbox(config4.name, { + await writeToMailbox(config2.name, { from: "team-lead", - text: config4.prompt, + text: config2.prompt, timestamp: new Date().toISOString() - }, config4.teamName); + }, config2.teamName); logForDebugging(`[PaneBackendExecutor] Spawned teammate ${agentId} in pane ${paneId}`); return { success: true, agentId, paneId }; - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`[PaneBackendExecutor] Failed to spawn ${agentId}: ${errorMessage2}`); return { success: false, @@ -448920,12 +372531,12 @@ __export(exports_TmuxBackend, { TmuxBackend: () => TmuxBackend }); function waitForPaneShellReady() { - return sleep4(PANE_SHELL_INIT_DELAY_MS); + return sleep2(PANE_SHELL_INIT_DELAY_MS); } function acquirePaneCreationLock() { let release; - const newLock = new Promise((resolve27) => { - release = resolve27; + const newLock = new Promise((resolve21) => { + release = resolve21; }); const previousLock = paneCreationLock; paneCreationLock = newLock; @@ -448975,9 +372586,9 @@ class TmuxBackend { } async sendCommandToPane(paneId, command, useExternalSession = false) { const runTmux = useExternalSession ? runTmuxInSwarm : runTmuxInUserSession; - const result3 = await runTmux(["send-keys", "-t", paneId, command, "Enter"]); - if (result3.code !== 0) { - throw new Error(`Failed to send command to pane ${paneId}: ${result3.stderr}`); + const result2 = await runTmux(["send-keys", "-t", paneId, command, "Enter"]); + if (result2.code !== 0) { + throw new Error(`Failed to send command to pane ${paneId}: ${result2.stderr}`); } } async setPaneBorderColor(paneId, color2, useExternalSession = false) { @@ -449044,13 +372655,13 @@ class TmuxBackend { } async killPane(paneId, useExternalSession = false) { const runTmux = useExternalSession ? runTmuxInSwarm : runTmuxInUserSession; - const result3 = await runTmux(["kill-pane", "-t", paneId]); - return result3.code === 0; + const result2 = await runTmux(["kill-pane", "-t", paneId]); + return result2.code === 0; } async hidePane(paneId, useExternalSession = false) { const runTmux = useExternalSession ? runTmuxInSwarm : runTmuxInUserSession; await runTmux(["new-session", "-d", "-s", HIDDEN_SESSION_NAME]); - const result3 = await runTmux([ + const result2 = await runTmux([ "break-pane", "-d", "-s", @@ -449058,16 +372669,16 @@ class TmuxBackend { "-t", `${HIDDEN_SESSION_NAME}:` ]); - if (result3.code === 0) { + if (result2.code === 0) { logForDebugging(`[TmuxBackend] Hidden pane ${paneId}`); } else { - logForDebugging(`[TmuxBackend] Failed to hide pane ${paneId}: ${result3.stderr}`); + logForDebugging(`[TmuxBackend] Failed to hide pane ${paneId}: ${result2.stderr}`); } - return result3.code === 0; + return result2.code === 0; } async showPane(paneId, targetWindowOrPane, useExternalSession = false) { const runTmux = useExternalSession ? runTmuxInSwarm : runTmuxInUserSession; - const result3 = await runTmux([ + const result2 = await runTmux([ "join-pane", "-h", "-s", @@ -449075,8 +372686,8 @@ class TmuxBackend { "-t", targetWindowOrPane ]); - if (result3.code !== 0) { - logForDebugging(`[TmuxBackend] Failed to show pane ${paneId}: ${result3.stderr}`); + if (result2.code !== 0) { + logForDebugging(`[TmuxBackend] Failed to show pane ${paneId}: ${result2.stderr}`); return false; } logForDebugging(`[TmuxBackend] Showed pane ${paneId} in ${targetWindowOrPane}`); @@ -449100,16 +372711,16 @@ class TmuxBackend { if (leaderPane) { return leaderPane; } - const result3 = await execFileNoThrow(TMUX_COMMAND, [ + const result2 = await execFileNoThrow(TMUX_COMMAND, [ "display-message", "-p", "#{pane_id}" ]); - if (result3.code !== 0) { - logForDebugging(`[TmuxBackend] Failed to get current pane ID (exit ${result3.code}): ${result3.stderr}`); + if (result2.code !== 0) { + logForDebugging(`[TmuxBackend] Failed to get current pane ID (exit ${result2.code}): ${result2.stderr}`); return null; } - return result3.stdout.trim(); + return result2.stdout.trim(); } async getCurrentWindowTarget() { if (cachedLeaderWindowTarget) { @@ -449121,12 +372732,12 @@ class TmuxBackend { args.push("-t", leaderPane); } args.push("-p", "#{session_name}:#{window_index}"); - const result3 = await execFileNoThrow(TMUX_COMMAND, args); - if (result3.code !== 0) { - logForDebugging(`[TmuxBackend] Failed to get current window target (exit ${result3.code}): ${result3.stderr}`); + const result2 = await execFileNoThrow(TMUX_COMMAND, args); + if (result2.code !== 0) { + logForDebugging(`[TmuxBackend] Failed to get current window target (exit ${result2.code}): ${result2.stderr}`); return null; } - cachedLeaderWindowTarget = result3.stdout.trim(); + cachedLeaderWindowTarget = result2.stdout.trim(); return cachedLeaderWindowTarget; } async getCurrentWindowPaneCount(windowTarget, useSwarmSocket = false) { @@ -449135,22 +372746,22 @@ class TmuxBackend { return null; } const args = ["list-panes", "-t", target, "-F", "#{pane_id}"]; - const result3 = useSwarmSocket ? await runTmuxInSwarm(args) : await runTmuxInUserSession(args); - if (result3.code !== 0) { - logError2(new Error(`[TmuxBackend] Failed to get pane count for ${target} (exit ${result3.code}): ${result3.stderr}`)); + const result2 = useSwarmSocket ? await runTmuxInSwarm(args) : await runTmuxInUserSession(args); + if (result2.code !== 0) { + logError2(new Error(`[TmuxBackend] Failed to get pane count for ${target} (exit ${result2.code}): ${result2.stderr}`)); return null; } - return count2(result3.stdout.trim().split(` + return count2(result2.stdout.trim().split(` `), Boolean); } async hasSessionInSwarm(sessionName) { - const result3 = await runTmuxInSwarm(["has-session", "-t", sessionName]); - return result3.code === 0; + const result2 = await runTmuxInSwarm(["has-session", "-t", sessionName]); + return result2.code === 0; } async createExternalSwarmSession() { const sessionExists = await this.hasSessionInSwarm(SWARM_SESSION_NAME); if (!sessionExists) { - const result3 = await runTmuxInSwarm([ + const result2 = await runTmuxInSwarm([ "new-session", "-d", "-s", @@ -449161,10 +372772,10 @@ class TmuxBackend { "-F", "#{pane_id}" ]); - if (result3.code !== 0) { - throw new Error(`Failed to create swarm session: ${result3.stderr || "Unknown error"}`); + if (result2.code !== 0) { + throw new Error(`Failed to create swarm session: ${result2.stderr || "Unknown error"}`); } - const paneId = result3.stdout.trim(); + const paneId = result2.stdout.trim(); const windowTarget2 = `${SWARM_SESSION_NAME}:${SWARM_VIEW_WINDOW_NAME}`; logForDebugging(`[TmuxBackend] Created external swarm session with window ${windowTarget2}, pane ${paneId}`); return { windowTarget: windowTarget2, paneId }; @@ -449372,8 +372983,8 @@ __export(exports_ITermBackend, { }); function acquirePaneCreationLock2() { let release; - const newLock = new Promise((resolve27) => { - release = resolve27; + const newLock = new Promise((resolve21) => { + release = resolve21; }); const previousLock = paneCreationLock2; paneCreationLock2 = newLock; @@ -449417,9 +373028,9 @@ class ITermBackend { return it2Available; } async isRunningInside() { - const result3 = isInITerm2(); - logForDebugging(`[ITermBackend] isRunningInside: ${result3}`); - return result3; + const result2 = isInITerm2(); + logForDebugging(`[ITermBackend] isRunningInside: ${result2}`); + return result2; } async createTeammatePaneInSwarmView(name, color2) { logForDebugging(`[ITermBackend] createTeammatePaneInSwarmView called for ${name} with color ${color2}`); @@ -449484,9 +373095,9 @@ class ITermBackend { } async sendCommandToPane(paneId, command, _useExternalSession) { const args = paneId ? ["session", "run", "-s", paneId, command] : ["session", "run", command]; - const result3 = await runIt2(args); - if (result3.code !== 0) { - throw new Error(`Failed to send command to iTerm2 pane ${paneId}: ${result3.stderr}`); + const result2 = await runIt2(args); + if (result2.code !== 0) { + throw new Error(`Failed to send command to iTerm2 pane ${paneId}: ${result2.stderr}`); } } async setPaneBorderColor(_paneId, _color, _useExternalSession) {} @@ -449496,7 +373107,7 @@ class ITermBackend { logForDebugging("[ITermBackend] Pane rebalancing not implemented for iTerm2"); } async killPane(paneId, _useExternalSession) { - const result3 = await runIt2(["session", "close", "-f", "-s", paneId]); + const result2 = await runIt2(["session", "close", "-f", "-s", paneId]); const idx = teammateSessionIds.indexOf(paneId); if (idx !== -1) { teammateSessionIds.splice(idx, 1); @@ -449504,7 +373115,7 @@ class ITermBackend { if (teammateSessionIds.length === 0) { firstPaneUsed = false; } - return result3.code === 0; + return result2.code === 0; } async hidePane(_paneId, _useExternalSession) { logForDebugging("[ITermBackend] hidePane not supported in iTerm2"); @@ -449778,9 +373389,9 @@ __export(exports_teamHelpers, { cleanupSessionTeams: () => cleanupSessionTeams, addHiddenPaneId: () => addHiddenPaneId }); -import { mkdirSync as mkdirSync7, readFileSync as readFileSync17, writeFileSync as writeFileSync8 } from "fs"; -import { mkdir as mkdir18, readFile as readFile19, rm as rm6, writeFile as writeFile21 } from "fs/promises"; -import { join as join81 } from "path"; +import { mkdirSync as mkdirSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync4 } from "fs"; +import { mkdir as mkdir18, readFile as readFile18, rm as rm4, writeFile as writeFile19 } from "fs/promises"; +import { join as join71 } from "path"; function sanitizeName(name) { return name.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase(); } @@ -449788,14 +373399,14 @@ function sanitizeAgentName(name) { return name.replace(/@/g, "-"); } function getTeamDir(teamName) { - return join81(getTeamsDir(), sanitizeName(teamName)); + return join71(getTeamsDir(), sanitizeName(teamName)); } function getTeamFilePath(teamName) { - return join81(getTeamDir(teamName), "config.json"); + return join71(getTeamDir(teamName), "config.json"); } function readTeamFile(teamName) { try { - const content = readFileSync17(getTeamFilePath(teamName), "utf-8"); + const content = readFileSync10(getTeamFilePath(teamName), "utf-8"); return jsonParse(content); } catch (e) { if (getErrnoCode(e) === "ENOENT") @@ -449806,7 +373417,7 @@ function readTeamFile(teamName) { } async function readTeamFileAsync(teamName) { try { - const content = await readFile19(getTeamFilePath(teamName), "utf-8"); + const content = await readFile18(getTeamFilePath(teamName), "utf-8"); return jsonParse(content); } catch (e) { if (getErrnoCode(e) === "ENOENT") @@ -449817,13 +373428,13 @@ async function readTeamFileAsync(teamName) { } function writeTeamFile(teamName, teamFile) { const teamDir = getTeamDir(teamName); - mkdirSync7(teamDir, { recursive: true }); - writeFileSync8(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2)); + mkdirSync5(teamDir, { recursive: true }); + writeFileSync4(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2)); } async function writeTeamFileAsync(teamName, teamFile) { const teamDir = getTeamDir(teamName); await mkdir18(teamDir, { recursive: true }); - await writeFile21(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2)); + await writeFile19(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2)); } function removeTeammateFromTeamFile(teamName, identifier) { const identifierStr = identifier.agentId || identifier.name; @@ -449982,34 +373593,34 @@ async function setMemberActive(teamName, memberName, isActive) { logForDebugging(`[TeammateTool] Set member ${memberName} in team ${teamName} to ${isActive ? "active" : "idle"}`); } async function destroyWorktree(worktreePath) { - const gitFilePath = join81(worktreePath, ".git"); + const gitFilePath = join71(worktreePath, ".git"); let mainRepoPath = null; try { - const gitFileContent = (await readFile19(gitFilePath, "utf-8")).trim(); + const gitFileContent = (await readFile18(gitFilePath, "utf-8")).trim(); const match = gitFileContent.match(/^gitdir:\s*(.+)$/); if (match && match[1]) { const worktreeGitDir = match[1]; - const mainGitDir = join81(worktreeGitDir, "..", ".."); - mainRepoPath = join81(mainGitDir, ".."); + const mainGitDir = join71(worktreeGitDir, "..", ".."); + mainRepoPath = join71(mainGitDir, ".."); } } catch {} if (mainRepoPath) { - const result3 = await execFileNoThrowWithCwd(gitExe(), ["worktree", "remove", "--force", worktreePath], { cwd: mainRepoPath }); - if (result3.code === 0) { + const result2 = await execFileNoThrowWithCwd(gitExe(), ["worktree", "remove", "--force", worktreePath], { cwd: mainRepoPath }); + if (result2.code === 0) { logForDebugging(`[TeammateTool] Removed worktree via git: ${worktreePath}`); return; } - if (result3.stderr?.includes("not a working tree")) { + if (result2.stderr?.includes("not a working tree")) { logForDebugging(`[TeammateTool] Worktree already removed: ${worktreePath}`); return; } - logForDebugging(`[TeammateTool] git worktree remove failed, falling back to rm: ${result3.stderr}`); + logForDebugging(`[TeammateTool] git worktree remove failed, falling back to rm: ${result2.stderr}`); } try { - await rm6(worktreePath, { recursive: true, force: true }); + await rm4(worktreePath, { recursive: true, force: true }); logForDebugging(`[TeammateTool] Removed worktree directory manually: ${worktreePath}`); - } catch (error45) { - logForDebugging(`[TeammateTool] Failed to remove worktree ${worktreePath}: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`[TeammateTool] Failed to remove worktree ${worktreePath}: ${errorMessage(error41)}`); } } function registerTeamForSessionCleanup(teamName) { @@ -450065,18 +373676,18 @@ async function cleanupTeamDirectories(teamName) { } const teamDir = getTeamDir(teamName); try { - await rm6(teamDir, { recursive: true, force: true }); + await rm4(teamDir, { recursive: true, force: true }); logForDebugging(`[TeammateTool] Cleaned up team directory: ${teamDir}`); - } catch (error45) { - logForDebugging(`[TeammateTool] Failed to clean up team directory ${teamDir}: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`[TeammateTool] Failed to clean up team directory ${teamDir}: ${errorMessage(error41)}`); } const tasksDir = getTasksDir(sanitizedName); try { - await rm6(tasksDir, { recursive: true, force: true }); + await rm4(tasksDir, { recursive: true, force: true }); logForDebugging(`[TeammateTool] Cleaned up tasks directory: ${tasksDir}`); notifyTasksUpdated(); - } catch (error45) { - logForDebugging(`[TeammateTool] Failed to clean up tasks directory ${tasksDir}: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`[TeammateTool] Failed to clean up tasks directory ${tasksDir}: ${errorMessage(error41)}`); } } var inputSchema3; @@ -450100,8 +373711,8 @@ var init_teamHelpers = __esm(() => { }); // src/utils/swarm/spawnInProcess.ts -async function spawnInProcessTeammate(config4, context) { - const { name, teamName, prompt, color: color2, planModeRequired, model } = config4; +async function spawnInProcessTeammate(config2, context) { + const { name, teamName, prompt, color: color2, planModeRequired, model } = config2; const { setAppState } = context; const agentId = formatAgentId(name, teamName); const taskId = generateTaskId("in_process_teammate"); @@ -450109,7 +373720,7 @@ async function spawnInProcessTeammate(config4, context) { try { const abortController = createAbortController(); const parentSessionId = getSessionId(); - const identity5 = { + const identity4 = { agentId, agentName: name, teamName, @@ -450134,7 +373745,7 @@ async function spawnInProcessTeammate(config4, context) { ...createTaskStateBase(taskId, "in_process_teammate", description, context.toolUseId), type: "in_process_teammate", status: "running", - identity: identity5, + identity: identity4, prompt, model, abortController, @@ -450163,8 +373774,8 @@ async function spawnInProcessTeammate(config4, context) { abortController, teammateContext }; - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : "Unknown error during spawn"; + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : "Unknown error during spawn"; logForDebugging(`[spawnInProcessTeammate] Failed to spawn ${agentId}: ${errorMessage2}`); return { success: false, @@ -450330,7 +373941,7 @@ var InProcessTeammateTask; var init_InProcessTeammateTask = __esm(() => { init_Task(); init_debug(); - init_messages5(); + init_messages3(); init_spawnInProcess(); init_framework(); InProcessTeammateTask = { @@ -450375,14 +373986,14 @@ var init_selectors = () => {}; // src/hooks/useElapsedTime.ts function useElapsedTime(startTime, isRunning, ms = 1000, pausedMs = 0, endTime) { - const get3 = () => formatDuration(Math.max(0, (endTime ?? Date.now()) - startTime - pausedMs)); + const get2 = () => formatDuration(Math.max(0, (endTime ?? Date.now()) - startTime - pausedMs)); const subscribe3 = import_react54.useCallback((notify) => { if (!isRunning) return () => {}; const interval = setInterval(notify, ms); return () => clearInterval(interval); }, [isRunning, ms]); - return import_react54.useSyncExternalStore(subscribe3, get3, get3); + return import_react54.useSyncExternalStore(subscribe3, get2, get2); } var import_react54; var init_useElapsedTime = __esm(() => { @@ -450399,8 +374010,8 @@ function getMessagePreview(messages) { return []; const allLines = []; const maxLineLength = 80; - for (let i4 = messages.length - 1;i4 >= 0 && allLines.length < 3; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0 && allLines.length < 3; i3--) { + const msg = messages[i3]; if (!msg || msg.type !== "user" && msg.type !== "assistant" || !msg.message?.content?.length) { continue; } @@ -450411,10 +374022,10 @@ function getMessagePreview(messages) { if (!block2 || typeof block2 !== "object") continue; if ("type" in block2 && block2.type === "tool_use" && "name" in block2) { - const input11 = "input" in block2 ? block2.input : null; + const input = "input" in block2 ? block2.input : null; let toolLine = `Using ${block2.name}…`; - if (input11) { - const desc = input11.description || input11.prompt || input11.command || input11.query || input11.pattern; + if (input) { + const desc = input.description || input.prompt || input.command || input.query || input.pattern; if (desc) { toolLine = desc.split(` `)[0] ?? toolLine; @@ -451331,9 +374942,9 @@ function BriefSpinner(t0) { t5 = $2[13]; } const { - before: before3, + before: before2, shimmer, - after: after3 + after: after2 } = t5; const { columns @@ -451350,24 +374961,24 @@ function BriefSpinner(t0) { t6 = $2[17]; } const leftWidth = t6 + 3; - const pad3 = Math.max(1, columns - 2 - leftWidth - stringWidth(rightText)); + const pad2 = Math.max(1, columns - 2 - leftWidth - stringWidth(rightText)); let t7; - if ($2[18] !== after3 || $2[19] !== before3 || $2[20] !== connText || $2[21] !== dots || $2[22] !== shimmer || $2[23] !== showConnWarning) { + if ($2[18] !== after2 || $2[19] !== before2 || $2[20] !== connText || $2[21] !== dots || $2[22] !== shimmer || $2[23] !== showConnWarning) { t7 = showConnWarning ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { color: "error", children: connText + dots }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(jsx_dev_runtime63.Fragment, { children: [ - before3 ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { + before2 ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { dimColor: true, - children: before3 + children: before2 }, undefined, false, undefined, this) : null, shimmer ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { children: shimmer }, undefined, false, undefined, this) : null, - after3 ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { + after2 ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { dimColor: true, - children: after3 + children: after2 }, undefined, false, undefined, this) : null, /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { dimColor: true, @@ -451375,8 +374986,8 @@ function BriefSpinner(t0) { }, undefined, false, undefined, this) ] }, undefined, true, undefined, this); - $2[18] = after3; - $2[19] = before3; + $2[18] = after2; + $2[19] = before2; $2[20] = connText; $2[21] = dots; $2[22] = shimmer; @@ -451386,11 +374997,11 @@ function BriefSpinner(t0) { t7 = $2[24]; } let t8; - if ($2[25] !== pad3 || $2[26] !== rightText) { + if ($2[25] !== pad2 || $2[26] !== rightText) { t8 = rightText ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(jsx_dev_runtime63.Fragment, { children: [ /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { - children: " ".repeat(pad3) + children: " ".repeat(pad2) }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { color: "subtle", @@ -451398,7 +375009,7 @@ function BriefSpinner(t0) { }, undefined, false, undefined, this) ] }, undefined, true, undefined, this) : null; - $2[25] = pad3; + $2[25] = pad2; $2[26] = rightText; $2[27] = t8; } else { @@ -451456,7 +375067,7 @@ function BriefIdleStatus() { } return t02; } - const pad3 = Math.max(1, columns - 2 - stringWidth(leftText) - stringWidth(rightText)); + const pad2 = Math.max(1, columns - 2 - stringWidth(leftText) - stringWidth(rightText)); let t0; if ($2[1] !== leftText) { t0 = leftText ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { @@ -451469,11 +375080,11 @@ function BriefIdleStatus() { t0 = $2[2]; } let t1; - if ($2[3] !== pad3 || $2[4] !== rightText) { + if ($2[3] !== pad2 || $2[4] !== rightText) { t1 = rightText ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(jsx_dev_runtime63.Fragment, { children: [ /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { - children: " ".repeat(pad3) + children: " ".repeat(pad2) }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(ThemedText, { color: "subtle", @@ -451481,7 +375092,7 @@ function BriefIdleStatus() { }, undefined, false, undefined, this) ] }, undefined, true, undefined, this) : null; - $2[3] = pad3; + $2[3] = pad2; $2[4] = rightText; $2[5] = t1; } else { @@ -451736,11 +375347,11 @@ function ConsoleOAuthFlow({ authorizationCode, state }); - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); setOAuthStatus({ state: "error", - message: err3.message, + message: err2.message, toRetry: { state: "waiting_for_login", url: url3 @@ -451753,7 +375364,7 @@ function ConsoleOAuthFlow({ logEvent("tengu_oauth_flow_start", { loginWithClaudeAi }); - const result3 = await oauthService.startOAuthFlow(async (url_0) => { + const result2 = await oauthService.startOAuthFlow(async (url_0) => { setOAuthStatus({ state: "waiting_for_login", url: url_0 @@ -451785,10 +375396,10 @@ function ConsoleOAuthFlow({ if (mode === "setup-token") { setOAuthStatus({ state: "success", - token: result3.accessToken + token: result2.accessToken }); } else { - await installOAuthTokens(result3); + await installOAuthTokens(result2); const orgResult = await validateForceLoginOrg(); if (!orgResult.valid) { throw new Error(orgResult.message); @@ -452455,7 +376066,7 @@ var init_ConsoleOAuthFlow = __esm(() => { import_compiler_runtime58 = __toESM(require_compiler_runtime(), 1); import_react57 = __toESM(require_react(), 1); init_analytics(); - init_auth6(); + init_auth5(); init_useTerminalSize(); init_osc(); init_useTerminalNotification(); @@ -452464,7 +376075,7 @@ var init_ConsoleOAuthFlow = __esm(() => { init_errorUtils(); init_notifier(); init_oauth2(); - init_auth2(); + init_auth(); init_log3(); init_settings2(); init_select(); @@ -452478,7 +376089,7 @@ var init_ConsoleOAuthFlow = __esm(() => { function useMainLoopModel() { const mainLoopModel = useAppState((s) => s.mainLoopModel); const mainLoopModelForSession = useAppState((s) => s.mainLoopModelForSession); - const [, forceRerender] = import_react58.useReducer((x4) => x4 + 1, 0); + const [, forceRerender] = import_react58.useReducer((x3) => x3 + 1, 0); import_react58.useEffect(() => onGrowthBookRefresh(forceRerender), []); const model = parseUserSpecifiedModel(mainLoopModelForSession ?? mainLoopModel ?? getDefaultMainLoopModelSetting()); return model; @@ -452696,7 +376307,7 @@ var init_login = __esm(() => { init_growthbook(); init_policyLimits(); init_remoteManagedSettings(); - init_messages5(); + init_messages3(); init_bypassPermissionsKillswitch(); init_user(); jsx_dev_runtime65 = __toESM(require_jsx_dev_runtime(), 1); @@ -452718,35 +376329,35 @@ __export(exports_api, { CCR_BYOC_BETA: () => CCR_BYOC_BETA }); import { randomUUID as randomUUID10 } from "crypto"; -function isTransientNetworkError(error45) { - if (!axios_default.isAxiosError(error45)) { +function isTransientNetworkError(error41) { + if (!axios_default.isAxiosError(error41)) { return false; } - if (!error45.response) { + if (!error41.response) { return true; } - if (error45.response.status >= 500) { + if (error41.response.status >= 500) { return true; } return false; } -async function axiosGetWithRetry(url3, config4) { +async function axiosGetWithRetry(url3, config2) { let lastError; - for (let attempt3 = 0;attempt3 <= MAX_TELEPORT_RETRIES; attempt3++) { + for (let attempt2 = 0;attempt2 <= MAX_TELEPORT_RETRIES; attempt2++) { try { - return await axios_default.get(url3, config4); - } catch (error45) { - lastError = error45; - if (!isTransientNetworkError(error45)) { - throw error45; + return await axios_default.get(url3, config2); + } catch (error41) { + lastError = error41; + if (!isTransientNetworkError(error41)) { + throw error41; } - if (attempt3 >= MAX_TELEPORT_RETRIES) { - logForDebugging(`Teleport request failed after ${attempt3 + 1} attempts: ${errorMessage(error45)}`); - throw error45; + if (attempt2 >= MAX_TELEPORT_RETRIES) { + logForDebugging(`Teleport request failed after ${attempt2 + 1} attempts: ${errorMessage(error41)}`); + throw error41; } - const delay3 = TELEPORT_RETRY_DELAYS[attempt3] ?? 2000; - logForDebugging(`Teleport request failed (attempt ${attempt3 + 1}/${MAX_TELEPORT_RETRIES + 1}), retrying in ${delay3}ms: ${errorMessage(error45)}`); - await sleep4(delay3); + const delay2 = TELEPORT_RETRY_DELAYS[attempt2] ?? 2000; + logForDebugging(`Teleport request failed (attempt ${attempt2 + 1}/${MAX_TELEPORT_RETRIES + 1}), retrying in ${delay2}ms: ${errorMessage(error41)}`); + await sleep2(delay2); } } throw lastError; @@ -452807,10 +376418,10 @@ async function fetchCodeSessionsFromSessionsAPI() { }; }); return sessions; - } catch (error45) { - const err3 = toError(error45); - logError2(err3); - throw error45; + } catch (error41) { + const err2 = toError(error41); + logError2(err2); + throw error41; } } function getOAuthHeaders(accessToken) { @@ -452884,8 +376495,8 @@ async function sendEventToRemoteSession(sessionId, messageContent, opts) { } logForDebugging(`[sendEventToRemoteSession] Failed with status ${response.status}: ${jsonStringify(response.data)}`); return false; - } catch (error45) { - logForDebugging(`[sendEventToRemoteSession] Error: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`[sendEventToRemoteSession] Error: ${errorMessage(error41)}`); return false; } } @@ -452909,8 +376520,8 @@ async function updateSessionTitle(sessionId, title) { } logForDebugging(`[updateSessionTitle] Failed with status ${response.status}: ${jsonStringify(response.data)}`); return false; - } catch (error45) { - logForDebugging(`[updateSessionTitle] Error: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`[updateSessionTitle] Error: ${errorMessage(error41)}`); return false; } } @@ -452920,7 +376531,7 @@ var init_api2 = __esm(() => { init_oauth(); init_client2(); init_v4(); - init_auth2(); + init_auth(); init_debug(); init_detectRepository(); init_errors(); @@ -453007,8 +376618,8 @@ async function fetchOverageCreditGrant() { headers: getOAuthHeaders(accessToken) }); return response.data; - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); return null; } } @@ -453078,7 +376689,7 @@ var CACHE_TTL_MS2; var init_overageCreditGrant = __esm(() => { init_axios2(); init_oauth(); - init_auth2(); + init_auth(); init_config2(); init_log3(); init_api2(); @@ -453094,7 +376705,7 @@ async function fetchUtilization() { if (tokens && isOAuthTokenExpired(tokens.expiresAt)) { return null; } - const authResult = getAuthHeaders2(); + const authResult = getAuthHeaders(); if (authResult.error) { throw new Error(`Auth error: ${authResult.error}`); } @@ -453113,7 +376724,7 @@ async function fetchUtilization() { var init_usage = __esm(() => { init_axios2(); init_oauth(); - init_auth2(); + init_auth(); init_http2(); init_client2(); }); @@ -453132,8 +376743,8 @@ async function runExtraUsage() { try { const utilization = await fetchUtilization(); extraUsage = utilization?.extra_usage; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } if (extraUsage?.is_enabled && extraUsage.monthly_limit === null) { return { @@ -453149,8 +376760,8 @@ async function runExtraUsage() { value: "Please contact your admin to manage extra usage settings." }; } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } try { const pendingOrDismissedRequests = await getMyAdminRequests("limit_increase", ["pending", "dismissed"]); @@ -453160,8 +376771,8 @@ async function runExtraUsage() { value: "You have already submitted a request for extra usage to your admin." }; } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } try { await createAdminRequest({ @@ -453172,8 +376783,8 @@ async function runExtraUsage() { type: "message", value: extraUsage?.is_enabled ? "Request sent to your admin to increase extra usage." : "Request sent to your admin to enable extra usage." }; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } return { type: "message", @@ -453184,8 +376795,8 @@ async function runExtraUsage() { try { const opened = await openBrowser(url3); return { type: "browser-opened", url: url3, opened }; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return { type: "message", value: `Failed to open browser. Please visit ${url3} to manage extra usage.` @@ -453196,7 +376807,7 @@ var init_extra_usage_core = __esm(() => { init_adminRequests(); init_overageCreditGrant(); init_usage(); - init_auth2(); + init_auth(); init_billing(); init_browser(); init_config2(); @@ -453209,9 +376820,9 @@ __export(exports_extra_usage, { call: () => call3 }); async function call3(onDone, context) { - const result3 = await runExtraUsage(); - if (result3.type === "message") { - onDone(result3.value); + const result2 = await runExtraUsage(); + if (result2.type === "message") { + onDone(result2.value); return null; } return /* @__PURE__ */ jsx_dev_runtime66.jsxDEV(Login, { @@ -453235,13 +376846,13 @@ __export(exports_extra_usage_noninteractive, { call: () => call4 }); async function call4() { - const result3 = await runExtraUsage(); - if (result3.type === "message") { - return { type: "text", value: result3.value }; + const result2 = await runExtraUsage(); + if (result2.type === "message") { + return { type: "text", value: result2.value }; } return { type: "text", - value: result3.opened ? `Browser opened to manage extra usage. If it didn't open, visit: ${result3.url}` : `Please visit ${result3.url} to manage extra usage.` + value: result2.opened ? `Browser opened to manage extra usage. If it didn't open, visit: ${result2.url}` : `Please visit ${result2.url} to manage extra usage.` }; } var init_extra_usage_noninteractive = __esm(() => { @@ -453258,7 +376869,7 @@ function isExtraUsageAllowed() { var extraUsage, extraUsageNonInteractive; var init_extra_usage2 = __esm(() => { init_state(); - init_auth2(); + init_auth(); init_envUtils(); extraUsage = { type: "local-jsx", @@ -453336,7 +376947,7 @@ function getUpsellMessage({ function RateLimitMessage(t0) { const $2 = import_compiler_runtime60.c(16); const { - text: text2, + text, onOpenRateLimitOptions } = t0; let t1; @@ -453426,12 +377037,12 @@ function RateLimitMessage(t0) { } const upsell = t6; let t7; - if ($2[11] !== text2) { + if ($2[11] !== text) { t7 = /* @__PURE__ */ jsx_dev_runtime67.jsxDEV(ThemedText, { color: "error", - children: text2 + children: text }, undefined, false, undefined, this); - $2[11] = text2; + $2[11] = text; $2[12] = t7; } else { t7 = $2[12]; @@ -453464,7 +377075,7 @@ var init_RateLimitMessage = __esm(() => { init_ink2(); init_claudeAiLimitsHook(); init_rateLimitMocking(); - init_auth2(); + init_auth(); init_billing(); init_MessageResponse(); jsx_dev_runtime67 = __toESM(require_jsx_dev_runtime(), 1); @@ -453514,28 +377125,28 @@ function AssistantTextMessage(t0) { onOpenRateLimitOptions } = t0; const { - text: text2 + text } = t1; const isSelected = import_react62.useContext(MessageActionsSelectedContext); - if (isEmptyMessageText(text2)) { + if (isEmptyMessageText(text)) { return null; } - if (isRateLimitErrorMessage(text2)) { + if (isRateLimitErrorMessage(text)) { let t2; - if ($2[0] !== onOpenRateLimitOptions || $2[1] !== text2) { + if ($2[0] !== onOpenRateLimitOptions || $2[1] !== text) { t2 = /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(RateLimitMessage, { - text: text2, + text, onOpenRateLimitOptions }, undefined, false, undefined, this); $2[0] = onOpenRateLimitOptions; - $2[1] = text2; + $2[1] = text; $2[2] = t2; } else { t2 = $2[2]; } return t2; } - switch (text2) { + switch (text) { case NO_RESPONSE_REQUESTED: { return null; } @@ -453611,14 +377222,14 @@ function AssistantTextMessage(t0) { case ORG_DISABLED_ERROR_MESSAGE_ENV_KEY: case ORG_DISABLED_ERROR_MESSAGE_ENV_KEY_WITH_OAUTH: { let t2; - if ($2[8] !== text2) { + if ($2[8] !== text) { t2 = /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(ThemedText, { color: "error", - children: text2 + children: text }, undefined, false, undefined, this) }, undefined, false, undefined, this); - $2[8] = text2; + $2[8] = text; $2[9] = t2; } else { t2 = $2[9]; @@ -453717,9 +377328,9 @@ function AssistantTextMessage(t0) { return t2; } default: { - if (startsWithApiErrorPrefix(text2)) { - const truncated = !verbose && text2.length > MAX_API_ERROR_CHARS; - const t22 = text2 === API_ERROR_MESSAGE_PREFIX ? `${API_ERROR_MESSAGE_PREFIX}: Please wait a moment and try again.` : truncated ? text2.slice(0, MAX_API_ERROR_CHARS) + "…" : text2; + if (startsWithApiErrorPrefix(text)) { + const truncated = !verbose && text.length > MAX_API_ERROR_CHARS; + const t22 = text === API_ERROR_MESSAGE_PREFIX ? `${API_ERROR_MESSAGE_PREFIX}: Please wait a moment and try again.` : truncated ? text.slice(0, MAX_API_ERROR_CHARS) + "…" : text; let t32; if ($2[15] !== t22) { t32 = /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(ThemedText, { @@ -453777,14 +377388,14 @@ function AssistantTextMessage(t0) { t4 = $2[24]; } let t5; - if ($2[25] !== text2) { + if ($2[25] !== text) { t5 = /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(ThemedBox_default, { flexDirection: "column", children: /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(Markdown, { - children: text2 + children: text }, undefined, false, undefined, this) }, undefined, false, undefined, this); - $2[25] = text2; + $2[25] = text; $2[26] = t5; } else { t5 = $2[26]; @@ -453830,12 +377441,12 @@ var import_compiler_runtime61, import_react62, jsx_dev_runtime68, MAX_API_ERROR_ var init_AssistantTextMessage = __esm(() => { import_compiler_runtime61 = __toESM(require_compiler_runtime(), 1); import_react62 = __toESM(require_react(), 1); - init_compact3(); + init_compact2(); init_rateLimitMessages(); init_figures2(); init_ink2(); - init_errors7(); - init_messages5(); + init_errors6(); + init_messages3(); init_contextWindowUpgradeCheck(); init_model(); init_macOsKeychainStorage(); @@ -454248,11 +377859,11 @@ function AssistantToolUseMessage(t0) { t1 = null; break bb0; } - const input11 = tool.inputSchema.safeParse(param.input); - const data = input11.success ? input11.data : undefined; + const input = tool.inputSchema.safeParse(param.input); + const data = input.success ? input.data : undefined; t1 = { tool, - input: input11, + input, userFacingToolName: tool.userFacingName(data), userFacingToolNameBackgroundColor: tool.userFacingNameBackgroundColor?.(data), isTransparentWrapper: tool.isTransparentWrapper?.() ?? false @@ -454549,13 +378160,13 @@ function _temp27(state_0) { function _temp17(state) { return state.pendingWorkerRequest; } -function renderToolUseMessage(tool, input11, { +function renderToolUseMessage(tool, input, { theme, verbose, commands }) { try { - const parsed = tool.inputSchema.safeParse(input11); + const parsed = tool.inputSchema.safeParse(input); if (!parsed.success) { return ""; } @@ -454564,8 +378175,8 @@ function renderToolUseMessage(tool, input11, { verbose, commands }); - } catch (error45) { - logError2(new Error(`Error rendering tool use message for ${tool.name}: ${error45}`)); + } catch (error41) { + logError2(new Error(`Error rendering tool use message for ${tool.name}: ${error41}`)); return ""; } } @@ -454597,16 +378208,16 @@ function renderToolUseProgressMessage(tool, tools, lookups, toolUseID, progressM toolMessages ] }, undefined, true, undefined, this); - } catch (error45) { - logError2(new Error(`Error rendering tool use progress message for ${tool.name}: ${error45}`)); + } catch (error41) { + logError2(new Error(`Error rendering tool use progress message for ${tool.name}: ${error41}`)); return null; } } function renderToolUseQueuedMessage(tool) { try { return tool.renderToolUseQueuedMessage?.(); - } catch (error45) { - logError2(new Error(`Error rendering tool use queued message for ${tool.name}: ${error45}`)); + } catch (error41) { + logError2(new Error(`Error rendering tool use queued message for ${tool.name}: ${error41}`)); return null; } } @@ -454649,12 +378260,12 @@ function UserAgentNotificationMessage(t0) { param: t1 } = t0; const { - text: text2 + text } = t1; let t2; - if ($2[0] !== text2) { - t2 = extractTag(text2, "summary"); - $2[0] = text2; + if ($2[0] !== text) { + t2 = extractTag(text, "summary"); + $2[0] = text; $2[1] = t2; } else { t2 = $2[1]; @@ -454664,10 +378275,10 @@ function UserAgentNotificationMessage(t0) { return null; } let t3; - if ($2[2] !== text2) { - const status = extractTag(text2, "status"); + if ($2[2] !== text) { + const status = extractTag(text, "status"); t3 = getStatusColor(status); - $2[2] = text2; + $2[2] = text; $2[3] = t3; } else { t3 = $2[3]; @@ -454719,7 +378330,7 @@ var init_UserAgentNotificationMessage = __esm(() => { import_compiler_runtime65 = __toESM(require_compiler_runtime(), 1); init_figures2(); init_ink2(); - init_messages5(); + init_messages3(); jsx_dev_runtime72 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -454731,18 +378342,18 @@ function UserBashInputMessage(t0) { addMargin } = t0; const { - text: text2 + text } = t1; let t2; - if ($2[0] !== text2) { - t2 = extractTag(text2, "bash-input"); - $2[0] = text2; + if ($2[0] !== text) { + t2 = extractTag(text, "bash-input"); + $2[0] = text; $2[1] = t2; } else { t2 = $2[1]; } - const input11 = t2; - if (!input11) { + const input = t2; + if (!input) { return null; } const t3 = addMargin ? 1 : 0; @@ -454757,12 +378368,12 @@ function UserBashInputMessage(t0) { t4 = $2[2]; } let t5; - if ($2[3] !== input11) { + if ($2[3] !== input) { t5 = /* @__PURE__ */ jsx_dev_runtime73.jsxDEV(ThemedText, { color: "text", - children: input11 + children: input }, undefined, false, undefined, this); - $2[3] = input11; + $2[3] = input; $2[4] = t5; } else { t5 = $2[4]; @@ -454791,7 +378402,7 @@ var import_compiler_runtime66, jsx_dev_runtime73; var init_UserBashInputMessage = __esm(() => { import_compiler_runtime66 = __toESM(require_compiler_runtime(), 1); init_ink2(); - init_messages5(); + init_messages3(); jsx_dev_runtime73 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -455147,7 +378758,7 @@ var import_compiler_runtime69, jsx_dev_runtime76; var init_UserBashOutputMessage = __esm(() => { import_compiler_runtime69 = __toESM(require_compiler_runtime(), 1); init_BashToolResultMessage(); - init_messages5(); + init_messages3(); jsx_dev_runtime76 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -455159,27 +378770,27 @@ function UserCommandMessage(t0) { param: t1 } = t0; const { - text: text2 + text } = t1; let t2; - if ($2[0] !== text2) { - t2 = extractTag(text2, COMMAND_MESSAGE_TAG); - $2[0] = text2; + if ($2[0] !== text) { + t2 = extractTag(text, COMMAND_MESSAGE_TAG); + $2[0] = text; $2[1] = t2; } else { t2 = $2[1]; } const commandMessage = t2; let t3; - if ($2[2] !== text2) { - t3 = extractTag(text2, "command-args"); - $2[2] = text2; + if ($2[2] !== text) { + t3 = extractTag(text, "command-args"); + $2[2] = text; $2[3] = t3; } else { t3 = $2[3]; } const args = t3; - const isSkillFormat = extractTag(text2, "skill-format") === "true"; + const isSkillFormat = extractTag(text, "skill-format") === "true"; if (!commandMessage) { return null; } @@ -455298,7 +378909,7 @@ var init_UserCommandMessage = __esm(() => { init_figures(); init_xml(); init_ink2(); - init_messages5(); + init_messages3(); jsx_dev_runtime77 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -455412,23 +379023,23 @@ function CloudLaunchContent(t0) { } = t0; const diamond = children2[0]; let label; - let rest3; + let rest2; let t1; if ($2[0] !== children2) { const nl = children2.indexOf(` `); const header = nl === -1 ? children2.slice(2) : children2.slice(2, nl); - rest3 = nl === -1 ? "" : children2.slice(nl + 1).trim(); - const sep15 = header.indexOf(" · "); - label = sep15 === -1 ? header : header.slice(0, sep15); - t1 = sep15 === -1 ? "" : header.slice(sep15); + rest2 = nl === -1 ? "" : children2.slice(nl + 1).trim(); + const sep12 = header.indexOf(" · "); + label = sep12 === -1 ? header : header.slice(0, sep12); + t1 = sep12 === -1 ? "" : header.slice(sep12); $2[0] = children2; $2[1] = label; - $2[2] = rest3; + $2[2] = rest2; $2[3] = t1; } else { label = $2[1]; - rest3 = $2[2]; + rest2 = $2[2]; t1 = $2[3]; } const suffix = t1; @@ -455485,8 +379096,8 @@ function CloudLaunchContent(t0) { t5 = $2[13]; } let t6; - if ($2[14] !== rest3) { - t6 = rest3 && /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(ThemedBox_default, { + if ($2[14] !== rest2) { + t6 = rest2 && /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(ThemedBox_default, { flexDirection: "row", children: [ /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(ThemedText, { @@ -455495,11 +379106,11 @@ function CloudLaunchContent(t0) { }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(ThemedText, { dimColor: true, - children: rest3 + children: rest2 }, undefined, false, undefined, this) ] }, undefined, true, undefined, this); - $2[14] = rest3; + $2[14] = rest2; $2[15] = t6; } else { t6 = $2[15]; @@ -455526,7 +379137,7 @@ var init_UserLocalCommandOutputMessage = __esm(() => { import_compiler_runtime71 = __toESM(require_compiler_runtime(), 1); init_figures2(); init_ink2(); - init_messages5(); + init_messages3(); init_Markdown(); init_MessageResponse(); jsx_dev_runtime78 = __toESM(require_jsx_dev_runtime(), 1); @@ -455539,18 +379150,18 @@ function getSavingMessage() { function UserMemoryInputMessage(t0) { const $2 = import_compiler_runtime72.c(10); const { - text: text2, + text, addMargin } = t0; let t1; - if ($2[0] !== text2) { - t1 = extractTag(text2, "user-memory-input"); - $2[0] = text2; + if ($2[0] !== text) { + t1 = extractTag(text, "user-memory-input"); + $2[0] = text; $2[1] = t1; } else { t1 = $2[1]; } - const input11 = t1; + const input = t1; let t2; if ($2[2] === Symbol.for("react.memo_cache_sentinel")) { t2 = getSavingMessage(); @@ -455559,7 +379170,7 @@ function UserMemoryInputMessage(t0) { t2 = $2[2]; } const savingText = t2; - if (!input11) { + if (!input) { return null; } const t3 = addMargin ? 1 : 0; @@ -455575,7 +379186,7 @@ function UserMemoryInputMessage(t0) { t4 = $2[3]; } let t5; - if ($2[4] !== input11) { + if ($2[4] !== input) { t5 = /* @__PURE__ */ jsx_dev_runtime79.jsxDEV(ThemedBox_default, { children: [ t4, @@ -455584,13 +379195,13 @@ function UserMemoryInputMessage(t0) { color: "text", children: [ " ", - input11, + input, " " ] }, undefined, true, undefined, this) ] }, undefined, true, undefined, this); - $2[4] = input11; + $2[4] = input; $2[5] = t5; } else { t5 = $2[5]; @@ -455632,7 +379243,7 @@ var init_UserMemoryInputMessage = __esm(() => { import_compiler_runtime72 = __toESM(require_compiler_runtime(), 1); init_sample(); init_ink2(); - init_messages5(); + init_messages3(); init_MessageResponse(); jsx_dev_runtime79 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -455761,13 +379372,13 @@ var init_QueuedMessageContext = __esm(() => { }); // src/utils/formatBriefTimestamp.ts -function formatBriefTimestamp(isoString, now3 = new Date) { +function formatBriefTimestamp(isoString, now2 = new Date) { const d = new Date(isoString); if (Number.isNaN(d.getTime())) { return ""; } const locale = getLocale(); - const dayDiff = startOfDay(now3) - startOfDay(d); + const dayDiff = startOfDay(now2) - startOfDay(d); const daysAgo = Math.round(dayDiff / 86400000); if (daysAgo === 0) { return d.toLocaleTimeString(locale, { @@ -455815,7 +379426,7 @@ function startOfDay(d) { function HighlightedThinkingText(t0) { const $2 = import_compiler_runtime75.c(31); const { - text: text2, + text, useBriefLayout, timestamp: timestamp2 } = t0; @@ -455875,13 +379486,13 @@ function HighlightedThinkingText(t0) { } const t6 = isQueued ? "subtle" : "text"; let t7; - if ($2[9] !== t6 || $2[10] !== text2) { + if ($2[9] !== t6 || $2[10] !== text) { t7 = /* @__PURE__ */ jsx_dev_runtime82.jsxDEV(ThemedText, { color: t6, - children: text2 + children: text }, undefined, false, undefined, this); $2[9] = t6; - $2[10] = text2; + $2[10] = text; $2[11] = t7; } else { t7 = $2[11]; @@ -455906,10 +379517,10 @@ function HighlightedThinkingText(t0) { } let parts; let t1; - if ($2[15] !== pointerColor || $2[16] !== text2) { + if ($2[15] !== pointerColor || $2[16] !== text) { t1 = Symbol.for("react.early_return_sentinel"); bb0: { - const triggers = isUltrathinkEnabled() ? findThinkingTriggerPositions(text2) : []; + const triggers = isUltrathinkEnabled() ? findThinkingTriggerPositions(text) : []; if (triggers.length === 0) { let t22; if ($2[19] !== pointerColor) { @@ -455926,12 +379537,12 @@ function HighlightedThinkingText(t0) { t22 = $2[20]; } let t32; - if ($2[21] !== text2) { + if ($2[21] !== text) { t32 = /* @__PURE__ */ jsx_dev_runtime82.jsxDEV(ThemedText, { color: "text", - children: text2 + children: text }, undefined, false, undefined, this); - $2[21] = text2; + $2[21] = text; $2[22] = t32; } else { t32 = $2[22]; @@ -455959,26 +379570,26 @@ function HighlightedThinkingText(t0) { if (t.start > cursor) { parts.push(/* @__PURE__ */ jsx_dev_runtime82.jsxDEV(ThemedText, { color: "text", - children: text2.slice(cursor, t.start) + children: text.slice(cursor, t.start) }, `plain-${cursor}`, false, undefined, this)); } - for (let i4 = t.start;i4 < t.end; i4++) { + for (let i3 = t.start;i3 < t.end; i3++) { parts.push(/* @__PURE__ */ jsx_dev_runtime82.jsxDEV(ThemedText, { - color: getRainbowColor(i4 - t.start), - children: text2[i4] - }, `rb-${i4}`, false, undefined, this)); + color: getRainbowColor(i3 - t.start), + children: text[i3] + }, `rb-${i3}`, false, undefined, this)); } cursor = t.end; } - if (cursor < text2.length) { + if (cursor < text.length) { parts.push(/* @__PURE__ */ jsx_dev_runtime82.jsxDEV(ThemedText, { color: "text", - children: text2.slice(cursor) + children: text.slice(cursor) }, `plain-${cursor}`, false, undefined, this)); } } $2[15] = pointerColor; - $2[16] = text2; + $2[16] = text; $2[17] = parts; $2[18] = t1; } else { @@ -456034,7 +379645,7 @@ var init_HighlightedThinkingText = __esm(() => { function UserPromptMessage({ addMargin, param: { - text: text2 + text }, isTranscriptMode, timestamp: timestamp2 @@ -456044,19 +379655,19 @@ function UserPromptMessage({ const briefEnvEnabled = feature("KAIROS") || feature("KAIROS_BRIEF") ? import_react65.useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_BRIEF), []) : false; const useBriefLayout = feature("KAIROS") || feature("KAIROS_BRIEF") ? (getKairosActive() || getUserMsgOptIn() && (briefEnvEnabled || getFeatureValue_CACHED_MAY_BE_STALE("tengu_kairos_brief", false))) && isBriefOnly && !isTranscriptMode && !viewingAgentTaskId : false; const displayText = import_react65.useMemo(() => { - if (text2.length <= MAX_DISPLAY_CHARS) - return text2; - const head3 = text2.slice(0, TRUNCATE_HEAD_CHARS); - const tail3 = text2.slice(-TRUNCATE_TAIL_CHARS); - const hiddenLines = countCharInString(text2, ` -`, TRUNCATE_HEAD_CHARS) - countCharInString(tail3, ` + if (text.length <= MAX_DISPLAY_CHARS) + return text; + const head2 = text.slice(0, TRUNCATE_HEAD_CHARS); + const tail2 = text.slice(-TRUNCATE_TAIL_CHARS); + const hiddenLines = countCharInString(text, ` +`, TRUNCATE_HEAD_CHARS) - countCharInString(tail2, ` `); - return `${head3} + return `${head2} … +${hiddenLines} lines … -${tail3}`; - }, [text2]); +${tail2}`; + }, [text]); const isSelected = import_react65.useContext(MessageActionsSelectedContext); - if (!text2) { + if (!text) { logError2(new Error("No content found in user prompt message")); return null; } @@ -456089,11 +379700,11 @@ var init_UserPromptMessage = __esm(() => { }); // src/components/messages/UserResourceUpdateMessage.tsx -function parseUpdates(text2) { +function parseUpdates(text) { const updates = []; const resourceRegex = /]*>(?:[\s\S]*?([^<]+)<\/reason>)?/g; let match; - while ((match = resourceRegex.exec(text2)) !== null) { + while ((match = resourceRegex.exec(text)) !== null) { updates.push({ kind: "resource", server: match[1] ?? "", @@ -456102,7 +379713,7 @@ function parseUpdates(text2) { }); } const pollingRegex = /]*>(?:[\s\S]*?([^<]+)<\/reason>)?/g; - while ((match = pollingRegex.exec(text2)) !== null) { + while ((match = pollingRegex.exec(text)) !== null) { updates.push({ kind: "polling", server: match[2] ?? "", @@ -456114,9 +379725,9 @@ function parseUpdates(text2) { } function formatUri(uri) { if (uri.startsWith("file://")) { - const path16 = uri.slice(7); - const parts = path16.split("/"); - return parts[parts.length - 1] || path16; + const path11 = uri.slice(7); + const parts = path11.split("/"); + return parts[parts.length - 1] || path11; } if (uri.length > 40) { return uri.slice(0, 39) + "…"; @@ -456130,17 +379741,17 @@ function UserResourceUpdateMessage(t0) { param: t1 } = t0; const { - text: text2 + text } = t1; let T0; let t2; let t3; let t4; let t5; - if ($2[0] !== addMargin || $2[1] !== text2) { + if ($2[0] !== addMargin || $2[1] !== text) { t5 = Symbol.for("react.early_return_sentinel"); bb0: { - const updates = parseUpdates(text2); + const updates = parseUpdates(text); if (updates.length === 0) { t5 = null; break bb0; @@ -456151,7 +379762,7 @@ function UserResourceUpdateMessage(t0) { t4 = updates.map(_temp18); } $2[0] = addMargin; - $2[1] = text2; + $2[1] = text; $2[2] = T0; $2[3] = t2; $2[4] = t3; @@ -456184,7 +379795,7 @@ function UserResourceUpdateMessage(t0) { } return t6; } -function _temp18(update3, i4) { +function _temp18(update2, i3) { return /* @__PURE__ */ jsx_dev_runtime84.jsxDEV(ThemedBox_default, { children: /* @__PURE__ */ jsx_dev_runtime84.jsxDEV(ThemedText, { children: [ @@ -456196,25 +379807,25 @@ function _temp18(update3, i4) { /* @__PURE__ */ jsx_dev_runtime84.jsxDEV(ThemedText, { dimColor: true, children: [ - update3.server, + update2.server, ":" ] }, undefined, true, undefined, this), " ", /* @__PURE__ */ jsx_dev_runtime84.jsxDEV(ThemedText, { color: "suggestion", - children: update3.kind === "resource" ? formatUri(update3.target) : update3.target + children: update2.kind === "resource" ? formatUri(update2.target) : update2.target }, undefined, false, undefined, this), - update3.reason && /* @__PURE__ */ jsx_dev_runtime84.jsxDEV(ThemedText, { + update2.reason && /* @__PURE__ */ jsx_dev_runtime84.jsxDEV(ThemedText, { dimColor: true, children: [ " · ", - update3.reason + update2.reason ] }, undefined, true, undefined, this) ] }, undefined, true, undefined, this) - }, i4, false, undefined, this); + }, i3, false, undefined, this); } var import_compiler_runtime76, jsx_dev_runtime84; var init_UserResourceUpdateMessage = __esm(() => { @@ -456814,9 +380425,9 @@ var init_PlanApprovalMessage = __esm(() => { }); // src/components/messages/UserTeammateMessage.tsx -function parseTeammateMessages(text2) { +function parseTeammateMessages(text) { const messages = []; - for (const match of text2.matchAll(TEAMMATE_MSG_REGEX)) { + for (const match of text.matchAll(TEAMMATE_MSG_REGEX)) { if (match[1] && match[4]) { messages.push({ teammateId: match[1], @@ -456837,11 +380448,11 @@ function getDisplayName(teammateId) { function UserTeammateMessage({ addMargin, param: { - text: text2 + text }, isTranscriptMode }) { - const messages = parseTeammateMessages(text2).filter((msg) => { + const messages = parseTeammateMessages(text).filter((msg) => { if (isShutdownApproved(msg.content)) { return false; } @@ -457038,9 +380649,9 @@ var init_UserTeammateMessage = __esm(() => { var exports_UserGitHubWebhookMessage = {}; __export(exports_UserGitHubWebhookMessage, { default: () => UserGitHubWebhookMessage_default, - __stub__: () => __stub__11 + __stub__: () => __stub__17 }); -var UserGitHubWebhookMessage_default, __stub__11 = true; +var UserGitHubWebhookMessage_default, __stub__17 = true; var init_UserGitHubWebhookMessage = __esm(() => { UserGitHubWebhookMessage_default = {}; }); @@ -457049,9 +380660,9 @@ var init_UserGitHubWebhookMessage = __esm(() => { var exports_UserForkBoilerplateMessage = {}; __export(exports_UserForkBoilerplateMessage, { default: () => UserForkBoilerplateMessage_default, - __stub__: () => __stub__12 + __stub__: () => __stub__18 }); -var UserForkBoilerplateMessage_default, __stub__12 = true; +var UserForkBoilerplateMessage_default, __stub__18 = true; var init_UserForkBoilerplateMessage = __esm(() => { UserForkBoilerplateMessage_default = {}; }); @@ -457060,9 +380671,9 @@ var init_UserForkBoilerplateMessage = __esm(() => { var exports_UserCrossSessionMessage = {}; __export(exports_UserCrossSessionMessage, { default: () => UserCrossSessionMessage_default, - __stub__: () => __stub__13 + __stub__: () => __stub__19 }); -var UserCrossSessionMessage_default, __stub__13 = true; +var UserCrossSessionMessage_default, __stub__19 = true; var init_UserCrossSessionMessage = __esm(() => { UserCrossSessionMessage_default = {}; }); @@ -457073,8 +380684,8 @@ __export(exports_UserChannelMessage, { UserChannelMessage: () => UserChannelMessage }); function displayServerName(name) { - const i4 = name.lastIndexOf(":"); - return i4 === -1 ? name : name.slice(i4 + 1); + const i3 = name.lastIndexOf(":"); + return i3 === -1 ? name : name.slice(i3 + 1); } function UserChannelMessage(t0) { const $2 = import_compiler_runtime81.c(29); @@ -457083,7 +380694,7 @@ function UserChannelMessage(t0) { param: t1 } = t0; const { - text: text2 + text } = t1; let T0; let T1; @@ -457096,10 +380707,10 @@ function UserChannelMessage(t0) { let t7; let truncated; let user; - if ($2[0] !== addMargin || $2[1] !== text2) { + if ($2[0] !== addMargin || $2[1] !== text) { t7 = Symbol.for("react.early_return_sentinel"); bb0: { - const m = CHANNEL_RE.exec(text2); + const m = CHANNEL_RE.exec(text); if (!m) { t7 = null; break bb0; @@ -457126,7 +380737,7 @@ function UserChannelMessage(t0) { t3 = displayServerName(source ?? ""); } $2[0] = addMargin; - $2[1] = text2; + $2[1] = text; $2[2] = T0; $2[3] = T1; $2[4] = T2; @@ -457520,7 +381131,7 @@ var init_UserTextMessage = __esm(() => { init_bun_bundle(); init_xml(); init_agentSwarmsEnabled(); - init_messages5(); + init_messages3(); init_InterruptedByUser(); init_MessageResponse(); init_UserAgentNotificationMessage(); @@ -457596,8 +381207,8 @@ class DiagnosticTrackingService { selectToEndOfLine: false, makeFrontmost: false }, this.mcpClient); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } async beforeFileEdited(filePath) { @@ -457606,8 +381217,8 @@ class DiagnosticTrackingService { } const timestamp2 = Date.now(); try { - const result3 = await callIdeRpc("getDiagnostics", { uri: `file://${filePath}` }, this.mcpClient); - const diagnosticFile = this.parseDiagnosticResult(result3)[0]; + const result2 = await callIdeRpc("getDiagnostics", { uri: `file://${filePath}` }, this.mcpClient); + const diagnosticFile = this.parseDiagnosticResult(result2)[0]; if (diagnosticFile) { if (!pathsEqual(this.normalizeFileUri(filePath), this.normalizeFileUri(diagnosticFile.uri))) { logError2(new DiagnosticsTrackingError(`Diagnostics file path mismatch: expected ${filePath}, got ${diagnosticFile.uri})`)); @@ -457629,8 +381240,8 @@ class DiagnosticTrackingService { } let allDiagnosticFiles = []; try { - const result3 = await callIdeRpc("getDiagnostics", {}, this.mcpClient); - allDiagnosticFiles = this.parseDiagnosticResult(result3); + const result2 = await callIdeRpc("getDiagnostics", {}, this.mcpClient); + allDiagnosticFiles = this.parseDiagnosticResult(result2); } catch (_error) { return []; } @@ -457663,9 +381274,9 @@ class DiagnosticTrackingService { } return newDiagnosticFiles; } - parseDiagnosticResult(result3) { - if (Array.isArray(result3)) { - const textBlock = result3.find((block2) => block2.type === "text"); + parseDiagnosticResult(result2) { + if (Array.isArray(result2)) { + const textBlock = result2.find((block2) => block2.type === "text"); if (textBlock && "text" in textBlock) { const parsed = jsonParse(textBlock.text); return parsed; @@ -457691,9 +381302,9 @@ class DiagnosticTrackingService { this.reset(); } } - static formatDiagnosticsSummary(files2) { + static formatDiagnosticsSummary(files) { const truncationMarker = "…[truncated]"; - const result3 = files2.map((file2) => { + const result2 = files.map((file2) => { const filename = file2.uri.split("/").pop() || file2.uri; const diagnostics = file2.diagnostics.map((d) => { const severitySymbol = DiagnosticTrackingService.getSeveritySymbol(d.severity); @@ -457705,10 +381316,10 @@ ${diagnostics}`; }).join(` `); - if (result3.length > MAX_DIAGNOSTICS_SUMMARY_CHARS) { - return result3.slice(0, MAX_DIAGNOSTICS_SUMMARY_CHARS - truncationMarker.length) + truncationMarker; + if (result2.length > MAX_DIAGNOSTICS_SUMMARY_CHARS) { + return result2.slice(0, MAX_DIAGNOSTICS_SUMMARY_CHARS - truncationMarker.length) + truncationMarker; } - return result3; + return result2; } static getSeveritySymbol(severity) { return { @@ -457723,7 +381334,7 @@ var DiagnosticsTrackingError, MAX_DIAGNOSTICS_SUMMARY_CHARS = 4000, diagnosticTr var init_diagnosticTracking = __esm(() => { init_figures(); init_log3(); - init_client10(); + init_client6(); init_errors(); init_file(); init_ide(); @@ -457734,7 +381345,7 @@ var init_diagnosticTracking = __esm(() => { }); // src/components/DiagnosticsDisplay.tsx -import { relative as relative10 } from "path"; +import { relative as relative8 } from "path"; function DiagnosticsDisplay(t0) { const $2 = import_compiler_runtime83.c(14); const { @@ -457838,7 +381449,7 @@ function _temp36(file_0, fileIndex) { children: [ /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(ThemedText, { bold: true, - children: relative10(getCwd(), file_0.uri.replace("file://", "").replace("_claude_fs_right:", "")) + children: relative8(getCwd(), file_0.uri.replace("file://", "").replace("_claude_fs_right:", "")) }, undefined, false, undefined, this), " ", /* @__PURE__ */ jsx_dev_runtime91.jsxDEV(ThemedText, { @@ -457873,8 +381484,8 @@ function _temp28(diagnostic, diagIndex) { }, undefined, true, undefined, this) }, diagIndex, false, undefined, this); } -function _temp19(sum3, file2) { - return sum3 + file2.diagnostics.length; +function _temp19(sum2, file2) { + return sum2 + file2.diagnostics.length; } var import_compiler_runtime83, import_react66, jsx_dev_runtime91; var init_DiagnosticsDisplay = __esm(() => { @@ -457991,7 +381602,7 @@ var init_FilePathLink = __esm(() => { }); // src/components/messages/AttachmentMessage.tsx -import { basename as basename17, sep as sep15 } from "path"; +import { basename as basename15, sep as sep12 } from "path"; function AttachmentMessage({ attachment, addMargin, @@ -458110,7 +381721,7 @@ function AttachmentMessage({ "Listed directory ", /* @__PURE__ */ jsx_dev_runtime94.jsxDEV(ThemedText, { bold: true, - children: attachment.displayPath + sep15 + children: attachment.displayPath + sep12 }, undefined, false, undefined, this) ] }, undefined, true, undefined, this); @@ -458247,7 +381858,7 @@ function AttachmentMessage({ dimColor: true, children: /* @__PURE__ */ jsx_dev_runtime94.jsxDEV(FilePathLink, { filePath: m.path, - children: basename17(m.path) + children: basename15(m.path) }, undefined, false, undefined, this) }, undefined, false, undefined, this) }, undefined, false, undefined, this), @@ -458320,7 +381931,7 @@ function AttachmentMessage({ }, undefined, true, undefined, this); } case "queued_command": { - const text2 = typeof attachment.prompt === "string" ? attachment.prompt : getContentText(attachment.prompt) || ""; + const text = typeof attachment.prompt === "string" ? attachment.prompt : getContentText(attachment.prompt) || ""; const hasImages = attachment.imagePasteIds && attachment.imagePasteIds.length > 0; return /* @__PURE__ */ jsx_dev_runtime94.jsxDEV(ThemedBox_default, { flexDirection: "column", @@ -458328,7 +381939,7 @@ function AttachmentMessage({ /* @__PURE__ */ jsx_dev_runtime94.jsxDEV(UserTextMessage, { addMargin, param: { - text: text2, + text, type: "text" }, verbose, @@ -458768,7 +382379,7 @@ var init_AttachmentMessage = __esm(() => { init_MessageResponse(); init_UserTextMessage(); init_DiagnosticsDisplay(); - init_messages5(); + init_messages3(); init_UserImageMessage(); init_ink3(); init_slowOperations(); @@ -459105,7 +382716,7 @@ var init_teamMemCollapsed = __esm(() => { }); // src/components/messages/CollapsedReadSearchContent.tsx -import { basename as basename18 } from "path"; +import { basename as basename16 } from "path"; function VerboseToolUse(t0) { const $2 = import_compiler_runtime89.c(24); const { @@ -459146,7 +382757,7 @@ function VerboseToolUse(t0) { } else { t4 = $2[16]; } - const isError3 = t4; + const isError2 = t4; let t5; if ($2[17] !== content.id || $2[18] !== inProgressToolUseIDs) { t5 = inProgressToolUseIDs.has(content.id); @@ -459162,22 +382773,22 @@ function VerboseToolUse(t0) { const parsedOutput = tool.outputSchema?.safeParse(rawToolResult); const toolResult = parsedOutput?.success ? parsedOutput.data : undefined; const parsedInput = tool.inputSchema.safeParse(content.input); - const input11 = parsedInput.success ? parsedInput.data : undefined; - const userFacingName = tool.userFacingName(input11); - const toolUseMessage = input11 ? tool.renderToolUseMessage(input11, { + const input = parsedInput.success ? parsedInput.data : undefined; + const userFacingName = tool.userFacingName(input); + const toolUseMessage = input ? tool.renderToolUseMessage(input, { theme, verbose: true }) : null; const t6 = shouldAnimate && isInProgress; const t7 = !isResolved; let t8; - if ($2[20] !== isError3 || $2[21] !== t6 || $2[22] !== t7) { + if ($2[20] !== isError2 || $2[21] !== t6 || $2[22] !== t7) { t8 = /* @__PURE__ */ jsx_dev_runtime97.jsxDEV(ToolUseLoader, { shouldAnimate: t6, isUnresolved: t7, - isError: isError3 + isError: isError2 }, undefined, false, undefined, this); - $2[20] = isError3; + $2[20] = isError2; $2[21] = t6; $2[22] = t7; $2[23] = t8; @@ -459208,10 +382819,10 @@ function VerboseToolUse(t0) { }, undefined, true, undefined, this) ] }, undefined, true, undefined, this), - input11 && tool.renderToolUseTag?.(input11) + input && tool.renderToolUseTag?.(input) ] }, undefined, true, undefined, this), - isResolved && !isError3 && toolResult !== undefined && /* @__PURE__ */ jsx_dev_runtime97.jsxDEV(ThemedBox_default, { + isResolved && !isError2 && toolResult !== undefined && /* @__PURE__ */ jsx_dev_runtime97.jsxDEV(ThemedBox_default, { children: tool.renderToolResultMessage?.(toolResult, [], { verbose: true, tools, @@ -459298,8 +382909,8 @@ function CollapsedReadSearchContent({ continue; const latest = lookups.progressMessagesByToolUseID.get(id_0)?.at(-1)?.data; if (latest?.type === "repl_tool_call" && latest.phase === "start") { - const input11 = latest.toolInput; - incomingHint = input11.file_path ?? (input11.pattern ? `"${input11.pattern}"` : undefined) ?? input11.command ?? latest.toolName; + const input = latest.toolInput; + incomingHint = input.file_path ?? (input.pattern ? `"${input.pattern}"` : undefined) ?? input.command ?? latest.toolName; } } } @@ -459366,7 +382977,7 @@ function CollapsedReadSearchContent({ children: [ " ⎿ ", "Recalled ", - basename18(m.path) + basename16(m.path) ] }, undefined, true, undefined, this), /* @__PURE__ */ jsx_dev_runtime97.jsxDEV(ThemedBox_default, { @@ -459716,13 +383327,13 @@ function CollapsedReadSearchContent({ flexDirection: "column", flexGrow: 1, children: displayedHint.split(` -`).map((line, i4, arr) => /* @__PURE__ */ jsx_dev_runtime97.jsxDEV(ThemedText, { +`).map((line, i3, arr) => /* @__PURE__ */ jsx_dev_runtime97.jsxDEV(ThemedText, { dimColor: true, children: [ line, - i4 === arr.length - 1 && shellProgressSuffix + i3 === arr.length - 1 && shellProgressSuffix ] - }, `hint-${i4}`, true, undefined, this)) + }, `hint-${i3}`, true, undefined, this)) }, undefined, false, undefined, this) ] }, undefined, true, undefined, this), @@ -459821,14 +383432,14 @@ function GroupedToolUseContent({ } const toolUsesData = message.messages.map((msg) => { const content = msg.message.content[0]; - const result3 = resultsByToolUseId.get(content.id); + const result2 = resultsByToolUseId.get(content.id); return { param: content, isResolved: lookups.resolvedToolUseIDs.has(content.id), isError: lookups.erroredToolUseIDs.has(content.id), isInProgress: inProgressToolUseIDs.has(content.id), progressMessages: filterToolProgressMessages(lookups.progressMessagesByToolUseID.get(content.id) ?? []), - result: result3 + result: result2 }; }); const anyInProgress = toolUsesData.some((d) => d.isInProgress); @@ -459850,7 +383461,7 @@ function SystemAPIErrorMessage(t0) { } = t0; const { retryAttempt, - error: error45, + error: error41, retryInMs, maxRetries } = t1; @@ -459885,8 +383496,8 @@ function SystemAPIErrorMessage(t0) { let t5; let t6; let truncated; - if ($2[4] !== error45 || $2[5] !== verbose) { - const formatted = formatAPIError(error45); + if ($2[4] !== error41 || $2[5] !== verbose) { + const formatted = formatAPIError(error41); truncated = !verbose && formatted.length > MAX_API_ERROR_CHARS2; T2 = MessageResponse; T1 = ThemedBox_default; @@ -459894,7 +383505,7 @@ function SystemAPIErrorMessage(t0) { T0 = ThemedText; t4 = "error"; t5 = truncated ? formatted.slice(0, MAX_API_ERROR_CHARS2) + "…" : formatted; - $2[4] = error45; + $2[4] = error41; $2[5] = verbose; $2[6] = T0; $2[7] = T1; @@ -460079,7 +383690,7 @@ function teamMemSavedPart(message) { } // src/components/messages/SystemTextMessage.tsx -import { basename as basename19 } from "path"; +import { basename as basename17 } from "path"; function SystemTextMessage(t0) { const $2 = import_compiler_runtime92.c(51); const { @@ -460577,7 +384188,7 @@ function StopHookSummaryMessage(t0) { } let t13; if ($2[34] !== hookErrors || $2[35] !== message.hookLabel) { - t13 = hookErrors.length > 0 && hookErrors.map((err3, idx_1) => /* @__PURE__ */ jsx_dev_runtime100.jsxDEV(ThemedText, { + t13 = hookErrors.length > 0 && hookErrors.map((err2, idx_1) => /* @__PURE__ */ jsx_dev_runtime100.jsxDEV(ThemedText, { children: [ /* @__PURE__ */ jsx_dev_runtime100.jsxDEV(ThemedText, { dimColor: true, @@ -460585,7 +384196,7 @@ function StopHookSummaryMessage(t0) { }, undefined, false, undefined, this), message.hookLabel ?? "Stop", " hook error: ", - err3 + err2 ] }, idx_1, true, undefined, this)); $2[34] = hookErrors; @@ -460658,8 +384269,8 @@ function _temp29(info, idx) { ] }, `cmd-${idx}`, true, undefined, this); } -function _temp21(sum3, h2) { - return sum3 + (h2.durationMs ?? 0); +function _temp21(sum2, h2) { + return sum2 + (h2.durationMs ?? 0); } function SystemTextMessageInner(t0) { const $2 = import_compiler_runtime92.c(18); @@ -460979,13 +384590,13 @@ function _temp54(p) { function MemoryFileRow(t0) { const $2 = import_compiler_runtime92.c(16); const { - path: path16 + path: path11 } = t0; const [hover, setHover] = import_react71.useState(false); let t1; - if ($2[0] !== path16) { - t1 = () => void openPath(path16); - $2[0] = path16; + if ($2[0] !== path11) { + t1 = () => void openPath(path11); + $2[0] = path11; $2[1] = t1; } else { t1 = $2[1]; @@ -461003,20 +384614,20 @@ function MemoryFileRow(t0) { } const t4 = !hover; let t5; - if ($2[4] !== path16) { - t5 = basename19(path16); - $2[4] = path16; + if ($2[4] !== path11) { + t5 = basename17(path11); + $2[4] = path11; $2[5] = t5; } else { t5 = $2[5]; } let t6; - if ($2[6] !== path16 || $2[7] !== t5) { + if ($2[6] !== path11 || $2[7] !== t5) { t6 = /* @__PURE__ */ jsx_dev_runtime100.jsxDEV(FilePathLink, { - filePath: path16, + filePath: path11, children: t5 }, undefined, false, undefined, this); - $2[6] = path16; + $2[6] = path11; $2[7] = t5; $2[8] = t6; } else { @@ -461381,7 +384992,7 @@ var init_UserToolErrorMessage = __esm(() => { init_figures2(); init_ink2(); init_Tool(); - init_messages5(); + init_messages3(); init_FallbackToolUseErrorMessage(); init_InterruptedByUser(); init_MessageResponse(); @@ -461394,7 +385005,7 @@ var init_UserToolErrorMessage = __esm(() => { function UserToolRejectMessage(t0) { const $2 = import_compiler_runtime97.c(13); const { - input: input11, + input, progressMessagesForMessage, style, tool, @@ -461419,10 +385030,10 @@ function UserToolRejectMessage(t0) { const t1 = tool.inputSchema; let t2; let t3; - if ($2[1] !== columns || $2[2] !== input11 || $2[3] !== isTranscriptMode || $2[4] !== progressMessagesForMessage || $2[5] !== style || $2[6] !== theme || $2[7] !== tool || $2[8] !== tools || $2[9] !== verbose) { + if ($2[1] !== columns || $2[2] !== input || $2[3] !== isTranscriptMode || $2[4] !== progressMessagesForMessage || $2[5] !== style || $2[6] !== theme || $2[7] !== tool || $2[8] !== tools || $2[9] !== verbose) { t3 = Symbol.for("react.early_return_sentinel"); bb0: { - const parsedInput = t1.safeParse(input11); + const parsedInput = t1.safeParse(input); if (!parsedInput.success) { let t4; if ($2[12] === Symbol.for("react.memo_cache_sentinel")) { @@ -461446,7 +385057,7 @@ function UserToolRejectMessage(t0) { }) ?? /* @__PURE__ */ jsx_dev_runtime105.jsxDEV(FallbackToolUseRejectedMessage, {}, undefined, false, undefined, this); } $2[1] = columns; - $2[2] = input11; + $2[2] = input; $2[3] = isTranscriptMode; $2[4] = progressMessagesForMessage; $2[5] = style; @@ -461614,7 +385225,7 @@ function useGetToolFromMessages(toolUseID, tools, lookups) { return t0; } var import_compiler_runtime98; -var init_utils7 = __esm(() => { +var init_utils6 = __esm(() => { import_compiler_runtime98 = __toESM(require_compiler_runtime(), 1); init_Tool(); }); @@ -461731,12 +385342,12 @@ function UserToolResultMessage(t0) { var import_compiler_runtime99, jsx_dev_runtime107; var init_UserToolResultMessage = __esm(() => { import_compiler_runtime99 = __toESM(require_compiler_runtime(), 1); - init_messages5(); + init_messages3(); init_UserToolCanceledMessage(); init_UserToolErrorMessage(); init_UserToolRejectMessage(); init_UserToolSuccessMessage(); - init_utils7(); + init_utils6(); jsx_dev_runtime107 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -461799,9 +385410,9 @@ var init_snipCompact = __esm(() => { var exports_SnipBoundaryMessage = {}; __export(exports_SnipBoundaryMessage, { default: () => SnipBoundaryMessage_default, - __stub__: () => __stub__14 + __stub__: () => __stub__20 }); -var SnipBoundaryMessage_default, __stub__14 = true; +var SnipBoundaryMessage_default, __stub__20 = true; var init_SnipBoundaryMessage = __esm(() => { SnipBoundaryMessage_default = {}; }); @@ -462552,11 +386163,11 @@ function processProgressMessages(messages, tools, isAgentRunning) { message: m })); } - const result3 = []; + const result2 = []; let currentGroup = null; function flushGroup(isActive) { if (currentGroup && (currentGroup.searchCount > 0 || currentGroup.readCount > 0 || currentGroup.replCount > 0)) { - result3.push({ + result2.push({ type: "summary", searchCount: currentGroup.searchCount, readCount: currentGroup.readCount, @@ -462599,7 +386210,7 @@ function processProgressMessages(messages, tools, isAgentRunning) { } else { flushGroup(false); if (msg.data.message.type !== "user") { - result3.push({ + result2.push({ type: "original", message: msg }); @@ -462607,7 +386218,7 @@ function processProgressMessages(messages, tools, isAgentRunning) { } } flushGroup(isAgentRunning); - return result3; + return result2; } function AgentPromptDisplay(t0) { const $2 = import_compiler_runtime101.c(3); @@ -462870,8 +386481,8 @@ function renderToolResultMessage(data, progressMessagesForMessage, { content, prompt } = data; - const result3 = [totalToolUseCount === 1 ? "1 tool use" : `${totalToolUseCount} tool uses`, formatNumber(totalTokens) + " tokens", formatDuration(totalDurationMs)]; - const completionMessage = `Done (${result3.join(" · ")})`; + const result2 = [totalToolUseCount === 1 ? "1 tool use" : `${totalToolUseCount} tool uses`, formatNumber(totalTokens) + " tokens", formatDuration(totalDurationMs)]; + const completionMessage = `Done (${result2.join(" · ")})`; const finalAssistantMessage = createAssistantMessage({ content: completionMessage, usage: { @@ -462940,11 +386551,11 @@ function renderToolUseMessage2({ } return description; } -function renderToolUseTag(input11) { +function renderToolUseTag(input) { const tags = []; - if (input11.model) { + if (input.model) { const mainModel = getMainLoopModel(); - const agentModel = parseUserSpecifiedModel(input11.model); + const agentModel = parseUserSpecifiedModel(input.model); if (agentModel !== mainModel) { tags.push(/* @__PURE__ */ jsx_dev_runtime110.jsxDEV(ThemedBox_default, { flexWrap: "nowrap", @@ -463138,7 +386749,7 @@ function renderToolUseRejectedMessage(_input, { ] }, undefined, true, undefined, this); } -function renderToolUseErrorMessage(result3, { +function renderToolUseErrorMessage(result2, { progressMessagesForMessage, tools, verbose, @@ -463152,7 +386763,7 @@ function renderToolUseErrorMessage(result3, { isTranscriptMode }), /* @__PURE__ */ jsx_dev_runtime110.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this) ] @@ -463185,14 +386796,14 @@ function renderGroupedAgentToolUse(toolUses, options2) { const agentStats = toolUses.map(({ param, isResolved, - isError: isError3, + isError: isError2, progressMessages, - result: result3 + result: result2 }) => { const stats = calculateAgentStats(progressMessages); const lastToolInfo = extractLastToolInfo(progressMessages, tools); const parsedInput = inputSchema4().safeParse(param.input); - const isTeammateSpawn = result3?.output?.status === "teammate_spawned"; + const isTeammateSpawn = result2?.output?.status === "teammate_spawned"; let agentType; let description; let color2; @@ -463211,9 +386822,9 @@ function renderGroupedAgentToolUse(toolUses, options2) { taskDescription = undefined; } const launchedAsAsync = parsedInput.success && "run_in_background" in parsedInput.data && parsedInput.data.run_in_background === true; - const outputStatus = result3?.output?.status; + const outputStatus = result2?.output?.status; const backgroundedMidExecution = outputStatus === "async_launched" || outputStatus === "remote_launched"; - const isAsync3 = launchedAsAsync || backgroundedMidExecution || isTeammateSpawn; + const isAsync2 = launchedAsAsync || backgroundedMidExecution || isTeammateSpawn; const name = parsedInput.success ? parsedInput.data.name : undefined; return { id: param.id, @@ -463222,8 +386833,8 @@ function renderGroupedAgentToolUse(toolUses, options2) { toolUseCount: stats.toolUseCount, tokens: stats.tokens, isResolved, - isError: isError3, - isAsync: isAsync3, + isError: isError2, + isAsync: isAsync2, color: color2, descriptionColor, lastToolInfo, @@ -463234,9 +386845,9 @@ function renderGroupedAgentToolUse(toolUses, options2) { const anyUnresolved = toolUses.some((t) => !t.isResolved); const anyError = toolUses.some((t) => t.isError); const allComplete = !anyUnresolved; - const allSameType = agentStats.length > 0 && agentStats.every((stat23) => stat23.agentType === agentStats[0]?.agentType); + const allSameType = agentStats.length > 0 && agentStats.every((stat22) => stat22.agentType === agentStats[0]?.agentType); const commonType = allSameType && agentStats[0]?.agentType !== "Agent" ? agentStats[0]?.agentType : null; - const allAsync = agentStats.every((stat23) => stat23.isAsync); + const allAsync = agentStats.every((stat22) => stat22.isAsync); return /* @__PURE__ */ jsx_dev_runtime110.jsxDEV(ThemedBox_default, { flexDirection: "column", marginTop: 1, @@ -463296,40 +386907,40 @@ function renderGroupedAgentToolUse(toolUses, options2) { !allAsync && /* @__PURE__ */ jsx_dev_runtime110.jsxDEV(CtrlOToExpand, {}, undefined, false, undefined, this) ] }, undefined, true, undefined, this), - agentStats.map((stat23, index) => /* @__PURE__ */ jsx_dev_runtime110.jsxDEV(AgentProgressLine, { - agentType: stat23.agentType, - description: stat23.description, - descriptionColor: stat23.descriptionColor, - taskDescription: stat23.taskDescription, - toolUseCount: stat23.toolUseCount, - tokens: stat23.tokens, - color: stat23.color, + agentStats.map((stat22, index) => /* @__PURE__ */ jsx_dev_runtime110.jsxDEV(AgentProgressLine, { + agentType: stat22.agentType, + description: stat22.description, + descriptionColor: stat22.descriptionColor, + taskDescription: stat22.taskDescription, + toolUseCount: stat22.toolUseCount, + tokens: stat22.tokens, + color: stat22.color, isLast: index === agentStats.length - 1, - isResolved: stat23.isResolved, - isError: stat23.isError, - isAsync: stat23.isAsync, + isResolved: stat22.isResolved, + isError: stat22.isError, + isAsync: stat22.isAsync, shouldAnimate, - lastToolInfo: stat23.lastToolInfo, + lastToolInfo: stat22.lastToolInfo, hideType: allSameType, - name: stat23.name - }, stat23.id, false, undefined, this)) + name: stat22.name + }, stat22.id, false, undefined, this)) ] }, undefined, true, undefined, this); } -function userFacingName(input11) { - if (input11?.subagent_type && input11.subagent_type !== GENERAL_PURPOSE_AGENT.agentType) { - if (input11.subagent_type === "worker") { +function userFacingName(input) { + if (input?.subagent_type && input.subagent_type !== GENERAL_PURPOSE_AGENT.agentType) { + if (input.subagent_type === "worker") { return "Agent"; } - return input11.subagent_type; + return input.subagent_type; } return "Agent"; } -function userFacingNameBackgroundColor(input11) { - if (!input11?.subagent_type) { +function userFacingNameBackgroundColor(input) { + if (!input?.subagent_type) { return; } - return getAgentColor(input11.subagent_type); + return getAgentColor(input.subagent_type); } function extractLastToolInfo(progressMessages, tools) { const toolUseByID = new Map; @@ -463347,8 +386958,8 @@ function extractLastToolInfo(progressMessages, tools) { } let searchCount = 0; let readCount = 0; - for (let i4 = progressMessages.length - 1;i4 >= 0; i4--) { - const msg = progressMessages[i4]; + for (let i3 = progressMessages.length - 1;i3 >= 0; i3--) { + const msg = progressMessages[i3]; if (!hasProgressMessage(msg.data)) { continue; } @@ -463384,8 +386995,8 @@ function extractLastToolInfo(progressMessages, tools) { if (!tool) { return toolUseBlock.name; } - const input11 = toolUseBlock.input; - const parsedInput = tool.inputSchema.safeParse(input11); + const input = toolUseBlock.input; + const parsedInput = tool.inputSchema.safeParse(input); const userFacingToolName = tool.userFacingName(parsedInput.success ? parsedInput.data : undefined); if (tool.getToolUseSummary) { const summary = tool.getToolUseSummary(parsedInput.success ? parsedInput.data : undefined); @@ -463422,7 +387033,7 @@ var init_UI = __esm(() => { init_collapseReadSearch(); init_file(); init_format(); - init_messages5(); + init_messages3(); init_model(); init_AgentTool(); init_agentColorManager(); @@ -463459,25 +387070,25 @@ var init_registerSkillHooks = __esm(() => { }); // src/utils/slashCommandParsing.ts -function parseSlashCommand(input11) { - const trimmedInput = input11.trim(); +function parseSlashCommand(input) { + const trimmedInput = input.trim(); if (!trimmedInput.startsWith("/")) { return null; } const withoutSlash = trimmedInput.slice(1); - const words3 = withoutSlash.split(" "); - if (!words3[0]) { + const words2 = withoutSlash.split(" "); + if (!words2[0]) { return null; } - let commandName = words3[0]; + let commandName = words2[0]; let isMcp = false; let argsStartIndex = 1; - if (words3.length > 1 && words3[1] === "(MCP)") { + if (words2.length > 1 && words2[1] === "(MCP)") { commandName = commandName + " (MCP)"; isMcp = true; argsStartIndex = 2; } - const args = words3.slice(argsStartIndex).join(" "); + const args = words2.slice(argsStartIndex).join(" "); return { commandName, args, @@ -463487,12 +387098,12 @@ function parseSlashCommand(input11) { // src/utils/suggestions/skillUsageTracking.ts function recordSkillUsage(skillName) { - const now3 = Date.now(); + const now2 = Date.now(); const lastWrite = lastWriteBySkill.get(skillName); - if (lastWrite !== undefined && now3 - lastWrite < SKILL_USAGE_DEBOUNCE_MS) { + if (lastWrite !== undefined && now2 - lastWrite < SKILL_USAGE_DEBOUNCE_MS) { return; } - lastWriteBySkill.set(skillName, now3); + lastWriteBySkill.set(skillName, now2); saveGlobalConfig((current) => { const existing = current.skillUsage?.[skillName]; return { @@ -463501,15 +387112,15 @@ function recordSkillUsage(skillName) { ...current.skillUsage, [skillName]: { usageCount: (existing?.usageCount ?? 0) + 1, - lastUsedAt: now3 + lastUsedAt: now2 } } }; }); } function getSkillUsageScore(skillName) { - const config4 = getGlobalConfig(); - const usage = config4.skillUsage?.[skillName]; + const config2 = getGlobalConfig(); + const usage = config2.skillUsage?.[skillName]; if (!usage) return 0; const daysSinceUse = (Date.now() - usage.lastUsedAt) / (1000 * 60 * 60 * 24); @@ -463523,11 +387134,11 @@ var init_skillUsageTracking = __esm(() => { }); // src/utils/telemetry/pluginTelemetry.ts -import { createHash as createHash15 } from "crypto"; -import { sep as sep16 } from "path"; +import { createHash as createHash14 } from "crypto"; +import { sep as sep13 } from "path"; function hashPluginId(name, marketplace) { const key = marketplace ? `${name}@${marketplace.toLowerCase()}` : name; - return createHash15("sha256").update(key + PLUGIN_ID_HASH_SALT).digest("hex").slice(0, 16); + return createHash14("sha256").update(key + PLUGIN_ID_HASH_SALT).digest("hex").slice(0, 16); } function getTelemetryPluginScope(name, marketplace, managedNames) { if (marketplace === BUILTIN_MARKETPLACE_NAME2) @@ -463543,7 +387154,7 @@ function getEnabledVia(plugin, managedNames, seedDirs) { return "default-enable"; if (managedNames?.has(plugin.name)) return "org-policy"; - if (seedDirs.some((dir) => plugin.path.startsWith(dir.endsWith(sep16) ? dir : dir + sep16))) { + if (seedDirs.some((dir) => plugin.path.startsWith(dir.endsWith(sep13) ? dir : dir + sep13))) { return "seed-mount"; } return "user-install"; @@ -463583,8 +387194,8 @@ function logPluginsEnabledForSession(plugins, managedNames, seedDirs) { }); } } -function classifyPluginCommandError(error45) { - const msg = String(error45?.message ?? error45); +function classifyPluginCommandError(error41) { + const msg = String(error41?.message ?? error41); if (/ENOTFOUND|ECONNREFUSED|EAI_AGAIN|ETIMEDOUT|ECONNRESET|network|Could not resolve|Connection refused|timed out/i.test(msg)) { return "network"; } @@ -463599,12 +387210,12 @@ function classifyPluginCommandError(error45) { } return "unknown"; } -function logPluginLoadErrors(errors5, managedNames) { - for (const err3 of errors5) { - const { name, marketplace } = parsePluginIdentifier(err3.source); - const pluginName = "plugin" in err3 && err3.plugin ? err3.plugin : name; +function logPluginLoadErrors(errors4, managedNames) { + for (const err2 of errors4) { + const { name, marketplace } = parsePluginIdentifier(err2.source); + const pluginName = "plugin" in err2 && err2.plugin ? err2.plugin : name; logEvent("tengu_plugin_load_failed", { - error_category: err3.type, + error_category: err2.type, _PROTO_plugin_name: pluginName, ...marketplace && { _PROTO_marketplace_name: marketplace @@ -463671,7 +387282,7 @@ async function executeForkedSlashCommand(command, args, context, precedingInputB const s = context.getAppState(); if (!s.mcp.clients.some((c6) => c6.type === "pending")) break; - await sleep4(MCP_SETTLE_POLL_MS); + await sleep2(MCP_SETTLE_POLL_MS); } const freshTools = context.options.refreshTools?.() ?? context.options.tools; const agentMessages2 = []; @@ -463699,10 +387310,10 @@ async function executeForkedSlashCommand(command, args, context, precedingInputB enqueueResult(` ${resultText2} `); - })().catch((err3) => { - logError2(err3); + })().catch((err2) => { + logError2(err2); enqueueResult(` -${err3 instanceof Error ? err3.message : String(err3)} +${err2 instanceof Error ? err2.message : String(err2)} `); }); return { @@ -463804,7 +387415,7 @@ ${resultText} function looksLikeCommand(commandName) { return !/[^a-zA-Z0-9:\-_]/.test(commandName); } -async function processSlashCommand(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context, setToolJSX, uuid5, isAlreadyProcessing, canUseTool) { +async function processSlashCommand(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context, setToolJSX, uuid3, isAlreadyProcessing, canUseTool) { const parsed = parseSlashCommand(inputString); if (!parsed) { logEvent("tengu_input_slash_missing", {}); @@ -463867,7 +387478,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte inputString, precedingInputBlocks }), - uuid: uuid5 + uuid: uuid3 }), ...attachmentMessages], shouldQuery: true }; @@ -463882,7 +387493,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte resultText, nextInput, submitNextInput - } = await getMessagesForSlashCommand(commandName, parsedArgs, setToolJSX, context, precedingInputBlocks, imageContentBlocks, isAlreadyProcessing, canUseTool, uuid5); + } = await getMessagesForSlashCommand(commandName, parsedArgs, setToolJSX, context, precedingInputBlocks, imageContentBlocks, isAlreadyProcessing, canUseTool, uuid3); if (newMessages.length === 0) { const eventData2 = { input: sanitizedCommandName @@ -463974,7 +387585,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte submitNextInput }; } -async function getMessagesForSlashCommand(commandName, args, setToolJSX, context, precedingInputBlocks, imageContentBlocks, _isAlreadyProcessing, canUseTool, uuid5) { +async function getMessagesForSlashCommand(commandName, args, setToolJSX, context, precedingInputBlocks, imageContentBlocks, _isAlreadyProcessing, canUseTool, uuid3) { const command = getCommand(commandName, context.options.commands); if (command.type === "prompt" && command.userInvocable !== false) { recordSkillUsage(commandName); @@ -463996,12 +387607,12 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context try { switch (command.type) { case "local-jsx": { - return new Promise((resolve27) => { + return new Promise((resolve21) => { let doneWasCalled = false; - const onDone = (result3, options2) => { + const onDone = (result2, options2) => { doneWasCalled = true; if (options2?.display === "skip") { - resolve27({ + resolve21({ messages: [], shouldQuery: false, command, @@ -464014,15 +387625,15 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context content, isMeta: true })); - const skipTranscript = isFullscreenEnvEnabled() && typeof result3 === "string" && result3.endsWith(" dismissed"); - resolve27({ - messages: options2?.display === "system" ? skipTranscript ? metaMessages : [createCommandInputMessage(formatCommandInput(command, args)), createCommandInputMessage(`${result3}`), ...metaMessages] : [createUserMessage({ + const skipTranscript = isFullscreenEnvEnabled() && typeof result2 === "string" && result2.endsWith(" dismissed"); + resolve21({ + messages: options2?.display === "system" ? skipTranscript ? metaMessages : [createCommandInputMessage(formatCommandInput(command, args)), createCommandInputMessage(`${result2}`), ...metaMessages] : [createUserMessage({ content: prepareUserContent({ inputString: formatCommandInput(command, args), precedingInputBlocks }) - }), result3 ? createUserMessage({ - content: `${result3}` + }), result2 ? createUserMessage({ + content: `${result2}` }) : createUserMessage({ content: `${NO_CONTENT_MESSAGE}` }), ...metaMessages], @@ -464039,7 +387650,7 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context if (jsx == null) return; if (context.options.isNonInteractiveSession) { - resolve27({ + resolve21({ messages: [], shouldQuery: false, command @@ -464065,7 +387676,7 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context shouldHidePromptInput: false, clearLocalJSX: true }); - resolve27({ + resolve21({ messages: [], shouldQuery: false, command @@ -464084,22 +387695,22 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context try { const syntheticCaveatMessage = createSyntheticUserCaveatMessage(); const mod2 = await command.load(); - const result3 = await mod2.call(args, context); - if (result3.type === "skip") { + const result2 = await mod2.call(args, context); + if (result2.type === "skip") { return { messages: [], shouldQuery: false, command }; } - if (result3.type === "compact") { - const slashCommandMessages = [syntheticCaveatMessage, userMessage, ...result3.displayText ? [createUserMessage({ - content: `${result3.displayText}`, + if (result2.type === "compact") { + const slashCommandMessages = [syntheticCaveatMessage, userMessage, ...result2.displayText ? [createUserMessage({ + content: `${result2.displayText}`, timestamp: new Date(Date.now() + 100).toISOString() })] : []]; const compactionResultWithSlashMessages = { - ...result3.compactionResult, - messagesToKeep: [...result3.compactionResult.messagesToKeep ?? [], ...slashCommandMessages] + ...result2.compactionResult, + messagesToKeep: [...result2.compactionResult.messagesToKeep ?? [], ...slashCommandMessages] }; resetMicrocompactState(); return { @@ -464109,10 +387720,10 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context }; } return { - messages: [userMessage, createCommandInputMessage(`${result3.value}`)], + messages: [userMessage, createCommandInputMessage(`${result2.value}`)], shouldQuery: false, command, - resultText: result3.value + resultText: result2.value }; } catch (e) { logError2(e); @@ -464128,7 +387739,7 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context if (command.context === "fork") { return await executeForkedSlashCommand(command, args, context, precedingInputBlocks, setToolJSX, canUseTool ?? hasPermissionsToUseTool); } - return await getMessagesForPromptSlashCommand(command, args, context, precedingInputBlocks, imageContentBlocks, uuid5); + return await getMessagesForPromptSlashCommand(command, args, context, precedingInputBlocks, imageContentBlocks, uuid3); } catch (e) { if (e instanceof AbortError) { return { @@ -464205,7 +387816,7 @@ async function processPromptSlashCommand(commandName, args, commands, context, i } return getMessagesForPromptSlashCommand(command, args, context, [], imageContentBlocks); } -async function getMessagesForPromptSlashCommand(command, args, context, precedingInputBlocks = [], imageContentBlocks = [], uuid5) { +async function getMessagesForPromptSlashCommand(command, args, context, precedingInputBlocks = [], imageContentBlocks = [], uuid3) { if (feature("COORDINATOR_MODE") && isEnvTruthy(process.env.CLAUDE_CODE_COORDINATOR_MODE) && !context.agentId) { const metadata2 = formatCommandLoadingMetadata(command, args); const parts = [`Skill "/${command.name}" is available for workers.`]; @@ -464229,7 +387840,7 @@ Instruct a worker to use this skill by including "Use the /${command.name} skill return { messages: [createUserMessage({ content: metadata2, - uuid: uuid5 + uuid: uuid3 }), createUserMessage({ content: summaryContent, isMeta: true @@ -464240,26 +387851,26 @@ Instruct a worker to use this skill by including "Use the /${command.name} skill command }; } - const result3 = await command.getPromptForCommand(args, context); + const result2 = await command.getPromptForCommand(args, context); const hooksAllowedForThisSkill = !isRestrictedToPluginOnly("hooks") || isSourceAdminTrusted(command.source); if (command.hooks && hooksAllowedForThisSkill) { const sessionId = getSessionId(); registerSkillHooks(context.setAppState, sessionId, command.hooks, command.name, command.type === "prompt" ? command.skillRoot : undefined); } const skillPath = command.source ? `${command.source}:${command.name}` : command.name; - const skillContent = result3.filter((b) => b.type === "text").map((b) => b.text).join(` + const skillContent = result2.filter((b) => b.type === "text").map((b) => b.text).join(` `); addInvokedSkill(command.name, skillPath, skillContent, getAgentContext()?.agentId ?? null); const metadata = formatCommandLoadingMetadata(command, args); const additionalAllowedTools = parseToolListFromCLI(command.allowedTools ?? []); - const mainMessageContent = imageContentBlocks.length > 0 || precedingInputBlocks.length > 0 ? [...imageContentBlocks, ...precedingInputBlocks, ...result3] : result3; - const attachmentMessages = await toArray4(getAttachmentMessages(result3.filter((block2) => block2.type === "text").map((block2) => block2.text).join(" "), context, null, [], context.messages, "repl_main_thread", { + const mainMessageContent = imageContentBlocks.length > 0 || precedingInputBlocks.length > 0 ? [...imageContentBlocks, ...precedingInputBlocks, ...result2] : result2; + const attachmentMessages = await toArray3(getAttachmentMessages(result2.filter((block2) => block2.type === "text").map((block2) => block2.text).join(" "), context, null, [], context.messages, "repl_main_thread", { skipSkillDiscovery: true })); const messages = [createUserMessage({ content: metadata, - uuid: uuid5 + uuid: uuid3 }), createUserMessage({ content: mainMessageContent, isMeta: true @@ -464286,7 +387897,7 @@ var init_processSlashCommand = __esm(() => { init_xml(); init_analytics(); init_dumpPrompts(); - init_compact3(); + init_compact2(); init_microCompact(); init_runAgent(); init_UI(); @@ -464304,7 +387915,7 @@ var init_processSlashCommand = __esm(() => { init_registerSkillHooks(); init_log3(); init_messageQueueManager(); - init_messages5(); + init_messages3(); init_permissionSetup(); init_permissions2(); init_pluginIdentifier(); @@ -464313,7 +387924,7 @@ var init_processSlashCommand = __esm(() => { init_events(); init_pluginTelemetry(); init_tokens(); - init_uuid2(); + init_uuid(); init_workloadContext(); }); @@ -464350,13 +387961,13 @@ async function initializeAgentMcpServers(agentDefinition, parentClients) { const newlyCreatedClients = []; const agentTools = []; for (const spec of agentDefinition.mcpServers) { - let config4 = null; + let config2 = null; let name; let isNewlyCreated = false; if (typeof spec === "string") { name = spec; - config4 = getMcpConfigByName(spec); - if (!config4) { + config2 = getMcpConfigByName(spec); + if (!config2) { logForDebugging(`[Agent: ${agentDefinition.agentType}] MCP server not found: ${spec}`, { level: "warn" }); continue; } @@ -464368,32 +387979,32 @@ async function initializeAgentMcpServers(agentDefinition, parentClients) { } const [serverName, serverConfig] = entries[0]; name = serverName; - config4 = { + config2 = { ...serverConfig, scope: "dynamic" }; isNewlyCreated = true; } - const client5 = await connectToServer(name, config4); - agentClients.push(client5); + const client2 = await connectToServer(name, config2); + agentClients.push(client2); if (isNewlyCreated) { - newlyCreatedClients.push(client5); + newlyCreatedClients.push(client2); } - if (client5.type === "connected") { - const tools = await fetchToolsForClient(client5); + if (client2.type === "connected") { + const tools = await fetchToolsForClient(client2); agentTools.push(...tools); logForDebugging(`[Agent: ${agentDefinition.agentType}] Connected to MCP server '${name}' with ${tools.length} tools`); } else { - logForDebugging(`[Agent: ${agentDefinition.agentType}] Failed to connect to MCP server '${name}': ${client5.type}`, { level: "warn" }); + logForDebugging(`[Agent: ${agentDefinition.agentType}] Failed to connect to MCP server '${name}': ${client2.type}`, { level: "warn" }); } } const cleanup = async () => { - for (const client5 of newlyCreatedClients) { - if (client5.type === "connected") { + for (const client2 of newlyCreatedClients) { + if (client2.type === "connected") { try { - await client5.cleanup(); - } catch (error45) { - logForDebugging(`[Agent: ${agentDefinition.agentType}] Error cleaning up MCP server '${client5.name}': ${error45}`, { level: "warn" }); + await client2.cleanup(); + } catch (error41) { + logForDebugging(`[Agent: ${agentDefinition.agentType}] Error cleaning up MCP server '${client2.name}': ${error41}`, { level: "warn" }); } } } @@ -464412,7 +388023,7 @@ async function* runAgent({ promptMessages, toolUseContext, canUseTool, - isAsync: isAsync3, + isAsync: isAsync2, canShowPermissionPrompts, forkContextMessages, querySource, @@ -464467,14 +388078,14 @@ async function* runAgent({ mode: agentPermissionMode }; } - const shouldAvoidPrompts = canShowPermissionPrompts !== undefined ? !canShowPermissionPrompts : agentPermissionMode === "bubble" ? false : isAsync3; + const shouldAvoidPrompts = canShowPermissionPrompts !== undefined ? !canShowPermissionPrompts : agentPermissionMode === "bubble" ? false : isAsync2; if (shouldAvoidPrompts) { toolPermissionContext = { ...toolPermissionContext, shouldAvoidPermissionPrompts: true }; } - if (isAsync3 && !shouldAvoidPrompts) { + if (isAsync2 && !shouldAvoidPrompts) { toolPermissionContext = { ...toolPermissionContext, awaitAutomatedChecksBeforeDialog: true @@ -464499,10 +388110,10 @@ async function* runAgent({ effortValue }; }; - const resolvedTools = useExactTools ? availableTools : resolveAgentTools(agentDefinition, availableTools, isAsync3).resolvedTools; + const resolvedTools = useExactTools ? availableTools : resolveAgentTools(agentDefinition, availableTools, isAsync2).resolvedTools; const additionalWorkingDirectories = Array.from(appState.toolPermissionContext.additionalWorkingDirectories.keys()); const agentSystemPrompt = override?.systemPrompt ? override.systemPrompt : asSystemPrompt(await getAgentSystemPrompt(agentDefinition, toolUseContext, resolvedAgentModel, additionalWorkingDirectories, resolvedTools)); - const agentAbortController = override?.abortController ? override.abortController : isAsync3 ? new AbortController : toolUseContext.abortController; + const agentAbortController = override?.abortController ? override.abortController : isAsync2 ? new AbortController : toolUseContext.abortController; const additionalContexts = []; for await (const hookResult of executeSubagentStartHooks(agentId, agentDefinition.agentType, agentAbortController.signal)) { if (hookResult.additionalContexts && hookResult.additionalContexts.length > 0) { @@ -464562,7 +388173,7 @@ async function* runAgent({ } = await initializeAgentMcpServers(agentDefinition, toolUseContext.options.mcpClients); const allTools = agentMcpTools.length > 0 ? uniqBy_default([...resolvedTools, ...agentMcpTools], "name") : resolvedTools; const agentOptions = { - isNonInteractiveSession: useExactTools ? toolUseContext.options.isNonInteractiveSession : isAsync3 ? true : toolUseContext.options.isNonInteractiveSession ?? false, + isNonInteractiveSession: useExactTools ? toolUseContext.options.isNonInteractiveSession : isAsync2 ? true : toolUseContext.options.isNonInteractiveSession ?? false, appendSystemPrompt: toolUseContext.options.appendSystemPrompt, tools: allTools, commands: [], @@ -464583,7 +388194,7 @@ async function* runAgent({ readFileState: agentReadFileState, abortController: agentAbortController, getAppState: agentGetAppState, - shareSetAppState: !isAsync3, + shareSetAppState: !isAsync2, shareSetResponseLength: true, criticalSystemReminder_EXPERIMENTAL: agentDefinition.criticalSystemReminder_EXPERIMENTAL, contentReplacementState @@ -464641,7 +388252,7 @@ async function* runAgent({ continue; } if (isRecordableMessage(message)) { - await recordSidechainTranscript([message], agentId, lastRecordedUuid).catch((err3) => logForDebugging(`Failed to record sidechain transcript: ${err3}`)); + await recordSidechainTranscript([message], agentId, lastRecordedUuid).catch((err2) => logForDebugging(`Failed to record sidechain transcript: ${err2}`)); if (message.type !== "progress") { lastRecordedUuid = message.uuid; } @@ -464740,13 +388351,13 @@ var init_runAgent = __esm(() => { init_debug(); init_state(); init_commands2(); - init_prompts5(); + init_prompts4(); init_context2(); init_query(); init_growthbook(); init_dumpPrompts(); init_promptCacheBreakDetection(); - init_client10(); + init_client6(); init_config3(); init_killShellTasks(); init_attachments2(); @@ -464757,12 +388368,12 @@ var init_runAgent = __esm(() => { init_registerFrontmatterHooks(); init_sessionHooks(); init_hooks5(); - init_messages5(); + init_messages3(); init_agent(); init_sessionStorage(); init_pluginOnlyPolicy(); init_perfettoTracing(); - init_uuid2(); + init_uuid(); init_agentToolUtils(); init_loadAgentsDir(); }); @@ -464812,7 +388423,7 @@ function startAgentSummarization(taskId, agentId, cacheSafeParams, setAppState) message: "No tools needed for summary", decisionReason: { type: "other", reason: "summary only" } }); - const result3 = await runForkedAgent({ + const result2 = await runForkedAgent({ promptMessages: [ createUserMessage({ content: buildSummaryPrompt(previousSummary) }) ], @@ -464825,7 +388436,7 @@ function startAgentSummarization(taskId, agentId, cacheSafeParams, setAppState) }); if (stopped) return; - for (const msg of result3.messages) { + for (const msg of result2.messages) { if (msg.type !== "assistant") continue; if (msg.isApiErrorMessage) { @@ -464879,13 +388490,13 @@ var init_agentSummary = __esm(() => { init_debug(); init_forkedAgent(); init_log3(); - init_messages5(); + init_messages3(); init_sessionStorage(); }); // src/utils/todo/types.ts var TodoStatusSchema, TodoItemSchema, TodoListSchema; -var init_types10 = __esm(() => { +var init_types8 = __esm(() => { init_v4(); TodoStatusSchema = lazySchema(() => exports_external.enum(["pending", "in_progress", "completed"])); TodoItemSchema = lazySchema(() => exports_external.object({ @@ -465089,7 +388700,7 @@ var init_TodoWriteTool = __esm(() => { init_growthbook(); init_Tool(); init_tasks(); - init_types10(); + init_types8(); init_constants3(); init_prompt13(); inputSchema5 = lazySchema(() => exports_external.strictObject({ @@ -465124,11 +388735,11 @@ var init_TodoWriteTool = __esm(() => { isEnabled() { return !isTodoV2Enabled(); }, - toAutoClassifierInput(input11) { - return `${input11.todos.length} items`; + toAutoClassifierInput(input) { + return `${input.todos.length} items`; }, - async checkPermissions(input11) { - return { behavior: "allow", updatedInput: input11 }; + async checkPermissions(input) { + return { behavior: "allow", updatedInput: input }; }, renderToolUseMessage() { return null; @@ -465196,10 +388807,10 @@ async function fetchEnvironments() { throw new Error(`Failed to fetch environments: ${response.status} ${response.statusText}`); } return response.data.environments; - } catch (error45) { - const err3 = toError(error45); - logError2(err3); - throw new Error(`Failed to fetch environments: ${err3.message}`); + } catch (error41) { + const err2 = toError(error41); + logError2(err2); + throw new Error(`Failed to fetch environments: ${err2.message}`); } } async function createDefaultCloudEnvironment(name) { @@ -465244,7 +388855,7 @@ var init_environments = __esm(() => { init_axios2(); init_oauth(); init_client2(); - init_auth2(); + init_auth(); init_errors(); init_log3(); init_api2(); @@ -465265,8 +388876,8 @@ async function checkHasRemoteEnvironment() { try { const environments = await fetchEnvironments(); return environments.length > 0; - } catch (error45) { - logForDebugging(`checkHasRemoteEnvironment failed: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`checkHasRemoteEnvironment failed: ${errorMessage(error41)}`); return false; } } @@ -465307,15 +388918,15 @@ async function checkGithubAppInstalled(owner, repo, signal) { } logForDebugging(`checkGithubAppInstalled: Unexpected response status ${response.status}`); return false; - } catch (error45) { - if (axios_default.isAxiosError(error45)) { - const status = error45.response?.status; + } catch (error41) { + if (axios_default.isAxiosError(error41)) { + const status = error41.response?.status; if (status && status >= 400 && status < 500) { logForDebugging(`checkGithubAppInstalled: Got ${status} error, app likely not installed on ${owner}/${repo}`); return false; } } - logForDebugging(`checkGithubAppInstalled error: ${errorMessage(error45)}`); + logForDebugging(`checkGithubAppInstalled error: ${errorMessage(error41)}`); return false; } } @@ -465344,15 +388955,15 @@ async function checkGithubTokenSynced() { const synced = response.status === 200 && response.data?.is_authenticated === true; logForDebugging(`GitHub token synced: ${synced} (status=${response.status}, data=${JSON.stringify(response.data)})`); return synced; - } catch (error45) { - if (axios_default.isAxiosError(error45)) { - const status = error45.response?.status; + } catch (error41) { + if (axios_default.isAxiosError(error41)) { + const status = error41.response?.status; if (status && status >= 400 && status < 500) { logForDebugging(`checkGithubTokenSynced: Got ${status}, token not synced`); return false; } } - logForDebugging(`checkGithubTokenSynced error: ${errorMessage(error45)}`); + logForDebugging(`checkGithubTokenSynced error: ${errorMessage(error41)}`); return false; } } @@ -465370,7 +388981,7 @@ var init_preconditions = __esm(() => { init_oauth(); init_client2(); init_growthbook(); - init_auth2(); + init_auth(); init_cwd2(); init_debug(); init_detectRepository(); @@ -465384,10 +388995,10 @@ var init_preconditions = __esm(() => { async function checkBackgroundRemoteSessionEligibility({ skipBundle = false } = {}) { - const errors5 = []; + const errors4 = []; if (!isPolicyAllowed("allow_remote_sessions")) { - errors5.push({ type: "policy_blocked" }); - return errors5; + errors4.push({ type: "policy_blocked" }); + return errors4; } const [needsLogin, hasRemoteEnv, repository] = await Promise.all([ checkNeedsClaudeAiLogin(), @@ -465395,23 +389006,23 @@ async function checkBackgroundRemoteSessionEligibility({ detectCurrentRepositoryWithHost() ]); if (needsLogin) { - errors5.push({ type: "not_logged_in" }); + errors4.push({ type: "not_logged_in" }); } if (!hasRemoteEnv) { - errors5.push({ type: "no_remote_environment" }); + errors4.push({ type: "no_remote_environment" }); } const bundleSeedGateOn = !skipBundle && (isEnvTruthy(process.env.CCR_FORCE_BUNDLE) || isEnvTruthy(process.env.CCR_ENABLE_BUNDLE) || await checkGate_CACHED_OR_BLOCKING("tengu_ccr_bundle_seed_enabled")); if (!checkIsInGitRepo()) { - errors5.push({ type: "not_in_git_repo" }); + errors4.push({ type: "not_in_git_repo" }); } else if (bundleSeedGateOn) {} else if (repository === null) { - errors5.push({ type: "no_git_remote" }); + errors4.push({ type: "no_git_remote" }); } else if (repository.host === "github.com") { const hasGithubApp = await checkGithubAppInstalled(repository.owner, repository.name); if (!hasGithubApp) { - errors5.push({ type: "github_app_not_installed" }); + errors4.push({ type: "github_app_not_installed" }); } } - return errors5; + return errors4; } var init_remoteSession = __esm(() => { init_growthbook(); @@ -465430,14 +389041,14 @@ function TeleportStash({ const changedFiles = gitFileStatus !== null ? [...gitFileStatus.tracked, ...gitFileStatus.untracked] : []; const [loading, setLoading] = import_react73.useState(true); const [stashing, setStashing] = import_react73.useState(false); - const [error45, setError] = import_react73.useState(null); + const [error41, setError] = import_react73.useState(null); import_react73.useEffect(() => { const loadChangedFiles = async () => { try { const fileStatus = await getFileStatus(); setGitFileStatus(fileStatus); - } catch (err3) { - const errorMessage2 = err3 instanceof Error ? err3.message : String(err3); + } catch (err2) { + const errorMessage2 = err2 instanceof Error ? err2.message : String(err2); logForDebugging(`Error getting changed files: ${errorMessage2}`, { level: "error" }); @@ -465494,7 +389105,7 @@ function TeleportStash({ }, undefined, true, undefined, this) }, undefined, false, undefined, this); } - if (error45) { + if (error41) { return /* @__PURE__ */ jsx_dev_runtime111.jsxDEV(ThemedBox_default, { flexDirection: "column", padding: 1, @@ -465504,7 +389115,7 @@ function TeleportStash({ color: "error", children: [ "Error: ", - error45 + error41 ] }, undefined, true, undefined, this), /* @__PURE__ */ jsx_dev_runtime111.jsxDEV(ThemedBox_default, { @@ -465600,7 +389211,7 @@ function TeleportError(t0) { if ($2[0] !== errorsToIgnore || $2[1] !== onComplete) { t2 = async () => { const currentErrors = await getTeleportErrors(); - const filteredErrors = new Set(Array.from(currentErrors).filter((error45) => !errorsToIgnore.has(error45))); + const filteredErrors = new Set(Array.from(currentErrors).filter((error41) => !errorsToIgnore.has(error41))); if (filteredErrors.size === 0) { onComplete(); return; @@ -465767,15 +389378,15 @@ function _temp39() { gracefulShutdownSync(0); } async function getTeleportErrors() { - const errors5 = new Set; + const errors4 = new Set; const [needsLogin, isGitClean] = await Promise.all([checkNeedsClaudeAiLogin(), checkIsGitClean()]); if (needsLogin) { - errors5.add("needsLogin"); + errors4.add("needsLogin"); } if (!isGitClean) { - errors5.add("needsGitStash"); + errors4.add("needsGitStash"); } - return errors5; + return errors4; } var import_compiler_runtime102, import_react74, jsx_dev_runtime112, EMPTY_ERRORS_TO_IGNORE; var init_TeleportError = __esm(() => { @@ -465800,20 +389411,20 @@ function getTokenFromFileDescriptor() { } const fdEnv = process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR; if (!fdEnv) { - const path16 = process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE ?? CCR_SESSION_INGRESS_TOKEN_PATH; - const fromFile = readTokenFromWellKnownFile(path16, "session ingress token"); + const path11 = process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE ?? CCR_SESSION_INGRESS_TOKEN_PATH; + const fromFile = readTokenFromWellKnownFile(path11, "session ingress token"); setSessionIngressToken(fromFile); return fromFile; } - const fd3 = parseInt(fdEnv, 10); - if (Number.isNaN(fd3)) { + const fd2 = parseInt(fdEnv, 10); + if (Number.isNaN(fd2)) { logForDebugging(`CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${fdEnv}`, { level: "error" }); setSessionIngressToken(null); return null; } try { const fsOps = getFsImplementation(); - const fdPath = process.platform === "darwin" || process.platform === "freebsd" ? `/dev/fd/${fd3}` : `/proc/self/fd/${fd3}`; + const fdPath = process.platform === "darwin" || process.platform === "freebsd" ? `/dev/fd/${fd2}` : `/proc/self/fd/${fd2}`; const token = fsOps.readFileSync(fdPath, { encoding: "utf8" }).trim(); if (!token) { logForDebugging("File descriptor contained empty token", { @@ -465822,14 +389433,14 @@ function getTokenFromFileDescriptor() { setSessionIngressToken(null); return null; } - logForDebugging(`Successfully read token from file descriptor ${fd3}`); + logForDebugging(`Successfully read token from file descriptor ${fd2}`); setSessionIngressToken(token); maybePersistTokenForSubprocesses(CCR_SESSION_INGRESS_TOKEN_PATH, token, "session ingress token"); return token; - } catch (error45) { - logForDebugging(`Failed to read token from file descriptor ${fd3}: ${errorMessage(error45)}`, { level: "error" }); - const path16 = process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE ?? CCR_SESSION_INGRESS_TOKEN_PATH; - const fromFile = readTokenFromWellKnownFile(path16, "session ingress token"); + } catch (error41) { + logForDebugging(`Failed to read token from file descriptor ${fd2}: ${errorMessage(error41)}`, { level: "error" }); + const path11 = process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE ?? CCR_SESSION_INGRESS_TOKEN_PATH; + const fromFile = readTokenFromWellKnownFile(path11, "session ingress token"); setSessionIngressToken(fromFile); return fromFile; } @@ -465878,7 +389489,7 @@ function getOrCreateSequentialAppend(sessionId) { return sequentialAppend; } async function appendSessionLogImpl(sessionId, entry, url3, headers) { - for (let attempt3 = 1;attempt3 <= MAX_RETRIES; attempt3++) { + for (let attempt2 = 1;attempt2 <= MAX_RETRIES; attempt2++) { try { const lastUuid = lastUuidMap.get(sessionId); const requestHeaders = { ...headers }; @@ -465930,24 +389541,24 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) { logForDebugging(`Failed to persist session log: ${response.status} ${response.statusText}`); logForDiagnosticsNoPII("error", "session_persist_fail_status", { status: response.status, - attempt: attempt3 + attempt: attempt2 }); - } catch (error45) { - const axiosError = error45; + } catch (error41) { + const axiosError = error41; logError2(new Error(`Error persisting session log: ${axiosError.message}`)); logForDiagnosticsNoPII("error", "session_persist_fail_status", { status: axiosError.status, - attempt: attempt3 + attempt: attempt2 }); } - if (attempt3 === MAX_RETRIES) { + if (attempt2 === MAX_RETRIES) { logForDebugging(`Remote persistence failed after ${MAX_RETRIES} attempts`); - logForDiagnosticsNoPII("error", "session_persist_error_retries_exhausted", { attempt: attempt3 }); + logForDiagnosticsNoPII("error", "session_persist_error_retries_exhausted", { attempt: attempt2 }); return false; } - const delayMs = Math.min(BASE_DELAY_MS2 * Math.pow(2, attempt3 - 1), 8000); - logForDebugging(`Remote persistence attempt ${attempt3}/${MAX_RETRIES} failed, retrying in ${delayMs}ms…`); - await sleep4(delayMs); + const delayMs = Math.min(BASE_DELAY_MS2 * Math.pow(2, attempt2 - 1), 8000); + logForDebugging(`Remote persistence attempt ${attempt2}/${MAX_RETRIES} failed, retrying in ${delayMs}ms…`); + await sleep2(delayMs); } return false; } @@ -465989,8 +389600,8 @@ async function getSessionLogsViaOAuth(sessionId, accessToken, orgUUID) { ...getOAuthHeaders(accessToken), "x-organization-uuid": orgUUID }; - const result3 = await fetchSessionLogsFromUrl(sessionId, url3, headers); - return result3; + const result2 = await fetchSessionLogsFromUrl(sessionId, url3, headers); + return result2; } async function getTeleportEvents(sessionId, accessToken, orgUUID) { const baseUrl = `${getOauthConfig().BASE_API_URL}/v1/code/sessions/${sessionId}/teleport-events`; @@ -466017,8 +389628,8 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) { validateStatus: (status) => status < 500 }); } catch (e) { - const err3 = e; - logError2(new Error(`Teleport events fetch failed: ${err3.message}`)); + const err2 = e; + logError2(new Error(`Teleport events fetch failed: ${err2.message}`)); logForDiagnosticsNoPII("error", "teleport_events_fetch_fail"); return null; } @@ -466094,8 +389705,8 @@ async function fetchSessionLogsFromUrl(sessionId, url3, headers) { status: response.status }); return null; - } catch (error45) { - const axiosError = error45; + } catch (error41) { + const axiosError = error41; logError2(new Error(`Error fetching session logs: ${axiosError.message}`)); logForDiagnosticsNoPII("error", "session_get_fail_status", { status: axiosError.status @@ -466130,17 +389741,17 @@ var init_sessionIngress = __esm(() => { }); // src/utils/fileHistory.ts -import { createHash as createHash16 } from "crypto"; +import { createHash as createHash15 } from "crypto"; import { chmod as chmod6, - copyFile as copyFile4, + copyFile as copyFile3, link as link3, mkdir as mkdir19, - readFile as readFile20, - stat as stat23, + readFile as readFile19, + stat as stat22, unlink as unlink10 } from "fs/promises"; -import { dirname as dirname31, isAbsolute as isAbsolute14, join as join82, relative as relative11 } from "path"; +import { dirname as dirname28, isAbsolute as isAbsolute13, join as join72, relative as relative9 } from "path"; import { inspect as inspect3 } from "util"; function fileHistoryEnabled() { if (getIsNonInteractiveSession()) { @@ -466175,8 +389786,8 @@ async function fileHistoryTrackEdit(updateFileHistoryState, filePath, messageId) let backup; try { backup = await createBackup(filePath, 1); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); logEvent("tengu_file_history_track_edit_failed", {}); return; } @@ -466205,8 +389816,8 @@ async function fileHistoryTrackEdit(updateFileHistoryState, filePath, messageId) trackedFiles: updatedTrackedFiles }; maybeDumpStateForDebug(updatedState); - recordFileHistorySnapshot(messageId, updatedMostRecentSnapshot, true).catch((error45) => { - logError2(new Error(`FileHistory: Failed to record snapshot: ${error45}`)); + recordFileHistorySnapshot(messageId, updatedMostRecentSnapshot, true).catch((error41) => { + logError2(new Error(`FileHistory: Failed to record snapshot: ${error41}`)); }); logEvent("tengu_file_history_track_edit_success", { isNewFile: isAddingFile, @@ -466214,8 +389825,8 @@ async function fileHistoryTrackEdit(updateFileHistoryState, filePath, messageId) }); logForDebugging(`FileHistory: Tracked file modification for ${filePath}`); return updatedState; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); logEvent("tengu_file_history_track_edit_failed", {}); return state; } @@ -466243,7 +389854,7 @@ async function fileHistoryMakeSnapshot(updateFileHistoryState, messageId) { const nextVersion = latestBackup ? latestBackup.version + 1 : 1; let fileStats; try { - fileStats = await stat23(filePath); + fileStats = await stat22(filePath); } catch (e) { if (!isENOENT(e)) throw e; @@ -466265,8 +389876,8 @@ async function fileHistoryMakeSnapshot(updateFileHistoryState, messageId) { return; } trackedFileBackups[trackingPath] = await createBackup(filePath, nextVersion); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); logEvent("tengu_file_history_backup_file_failed", {}); } })); @@ -466283,11 +389894,11 @@ async function fileHistoryMakeSnapshot(updateFileHistoryState, messageId) { trackedFileBackups[trackingPath] = inherited; } } - const now3 = new Date; + const now2 = new Date; const newSnapshot = { messageId, trackedFileBackups, - timestamp: now3 + timestamp: now2 }; const allSnapshots = [...state.snapshots, newSnapshot]; const updatedState = { @@ -466297,8 +389908,8 @@ async function fileHistoryMakeSnapshot(updateFileHistoryState, messageId) { }; maybeDumpStateForDebug(updatedState); notifyVscodeSnapshotFilesUpdated(state, updatedState).catch(logError2); - recordFileHistorySnapshot(messageId, newSnapshot, false).catch((error45) => { - logError2(new Error(`FileHistory: Failed to record snapshot: ${error45}`)); + recordFileHistorySnapshot(messageId, newSnapshot, false).catch((error41) => { + logError2(new Error(`FileHistory: Failed to record snapshot: ${error41}`)); }); logForDebugging(`FileHistory: Added snapshot for ${messageId}, tracking ${state.trackedFiles.size} files`); logEvent("tengu_file_history_snapshot_success", { @@ -466306,8 +389917,8 @@ async function fileHistoryMakeSnapshot(updateFileHistoryState, messageId) { snapshotCount: updatedState.snapshots.length }); return updatedState; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); logEvent("tengu_file_history_snapshot_failed", {}); return state; } @@ -466341,13 +389952,13 @@ async function fileHistoryRewind(updateFileHistoryState, messageId) { trackedFilesCount: captured.trackedFiles.size, filesChangedCount: filesChanged.length }); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); logEvent("tengu_file_history_rewind_failed", { trackedFilesCount: captured.trackedFiles.size, snapshotFound: true }); - throw error45; + throw error41; } } function fileHistoryCanRestore(state, messageId) { @@ -466384,8 +389995,8 @@ async function fileHistoryGetDiffStats(state, messageId) { return { filePath, stats }; } return null; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); logEvent("tengu_file_history_rewind_restore_file_failed", { dryRun: true }); @@ -466427,8 +390038,8 @@ async function fileHistoryHasAnyChanges(state, messageId) { } if (await checkOriginFileChanged(filePath, backupFileName)) return true; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } return false; @@ -466463,8 +390074,8 @@ async function applySnapshot(state, targetSnapshot) { logForDebugging(`FileHistory: [Rewind] Restored ${filePath} from ${backupFileName}`); filesChanged.push(filePath); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); logEvent("tengu_file_history_rewind_restore_file_failed", { dryRun: false }); @@ -466477,7 +390088,7 @@ async function checkOriginFileChanged(originalFile, backupFileName, originalStat let originalStats = originalStatsHint ?? null; if (!originalStats) { try { - originalStats = await stat23(originalFile); + originalStats = await stat22(originalFile); } catch (e) { if (!isENOENT(e)) return true; @@ -466485,7 +390096,7 @@ async function checkOriginFileChanged(originalFile, backupFileName, originalStat } let backupStats = null; try { - backupStats = await stat23(backupPath); + backupStats = await stat22(backupPath); } catch (e) { if (!isENOENT(e)) return true; @@ -466493,8 +390104,8 @@ async function checkOriginFileChanged(originalFile, backupFileName, originalStat return compareStatsAndContent(originalStats, backupStats, async () => { try { const [originalContent, backupContent] = await Promise.all([ - readFile20(originalFile, "utf-8"), - readFile20(backupPath, "utf-8") + readFile19(originalFile, "utf-8"), + readFile19(backupPath, "utf-8") ]); return originalContent !== backupContent; } catch { @@ -466544,8 +390155,8 @@ async function computeDiffStatsForFile(originalFile, backupFileName) { deletions += c6.count || 0; } }); - } catch (error45) { - logError2(new Error(`FileHistory: Error generating diffStats: ${error45}`)); + } catch (error41) { + logError2(new Error(`FileHistory: Error generating diffStats: ${error41}`)); } return { filesChanged, @@ -466554,12 +390165,12 @@ async function computeDiffStatsForFile(originalFile, backupFileName) { }; } function getBackupFileName(filePath, version2) { - const fileNameHash = createHash16("sha256").update(filePath).digest("hex").slice(0, 16); + const fileNameHash = createHash15("sha256").update(filePath).digest("hex").slice(0, 16); return `${fileNameHash}@v${version2}`; } function resolveBackupPath(backupFileName, sessionId) { const configDir = getClaudeConfigHomeDir(); - return join82(configDir, "file-history", sessionId || getSessionId(), backupFileName); + return join72(configDir, "file-history", sessionId || getSessionId(), backupFileName); } async function createBackup(filePath, version2) { if (filePath === null) { @@ -466569,7 +390180,7 @@ async function createBackup(filePath, version2) { const backupPath = resolveBackupPath(backupFileName); let srcStats; try { - srcStats = await stat23(filePath); + srcStats = await stat22(filePath); } catch (e) { if (isENOENT(e)) { return { backupFileName: null, version: version2, backupTime: new Date }; @@ -466577,12 +390188,12 @@ async function createBackup(filePath, version2) { throw e; } try { - await copyFile4(filePath, backupPath); + await copyFile3(filePath, backupPath); } catch (e) { if (!isENOENT(e)) throw e; - await mkdir19(dirname31(backupPath), { recursive: true }); - await copyFile4(filePath, backupPath); + await mkdir19(dirname28(backupPath), { recursive: true }); + await copyFile3(filePath, backupPath); } await chmod6(backupPath, srcStats.mode); logEvent("tengu_file_history_backup_file_created", { @@ -466599,7 +390210,7 @@ async function restoreBackup(filePath, backupFileName) { const backupPath = resolveBackupPath(backupFileName); let backupStats; try { - backupStats = await stat23(backupPath); + backupStats = await stat22(backupPath); } catch (e) { if (isENOENT(e)) { logEvent("tengu_file_history_rewind_restore_file_failed", {}); @@ -466609,12 +390220,12 @@ async function restoreBackup(filePath, backupFileName) { throw e; } try { - await copyFile4(backupPath, filePath); + await copyFile3(backupPath, filePath); } catch (e) { if (!isENOENT(e)) throw e; - await mkdir19(dirname31(filePath), { recursive: true }); - await copyFile4(backupPath, filePath); + await mkdir19(dirname28(filePath), { recursive: true }); + await copyFile3(backupPath, filePath); } await chmod6(filePath, backupStats.mode); } @@ -466628,20 +390239,20 @@ function getBackupFileNameFirstVersion(trackingPath, state) { return; } function maybeShortenFilePath(filePath) { - if (!isAbsolute14(filePath)) { + if (!isAbsolute13(filePath)) { return filePath; } const cwd2 = getOriginalCwd(); if (filePath.startsWith(cwd2)) { - return relative11(cwd2, filePath); + return relative9(cwd2, filePath); } return filePath; } function maybeExpandFilePath(filePath) { - if (isAbsolute14(filePath)) { + if (isAbsolute13(filePath)) { return filePath; } - return join82(getOriginalCwd(), filePath); + return join72(getOriginalCwd(), filePath); } function fileHistoryRestoreStateFromLog(fileHistorySnapshots, onUpdateState) { if (!fileHistoryEnabled()) { @@ -466651,8 +390262,8 @@ function fileHistoryRestoreStateFromLog(fileHistorySnapshots, onUpdateState) { const trackedFiles = new Set; for (const snapshot2 of fileHistorySnapshots) { const trackedFileBackups = {}; - for (const [path16, backup] of Object.entries(snapshot2.trackedFileBackups)) { - const trackingPath = maybeShortenFilePath(path16); + for (const [path11, backup] of Object.entries(snapshot2.trackedFileBackups)) { + const trackingPath = maybeShortenFilePath(path11); trackedFiles.add(trackingPath); trackedFileBackups[trackingPath] = backup; } @@ -466667,15 +390278,15 @@ function fileHistoryRestoreStateFromLog(fileHistorySnapshots, onUpdateState) { snapshotSequence: snapshots.length }); } -async function copyFileHistoryForResume(log2) { +async function copyFileHistoryForResume(log) { if (!fileHistoryEnabled()) { return; } - const fileHistorySnapshots = log2.fileHistorySnapshots; - if (!fileHistorySnapshots || log2.messages.length === 0) { + const fileHistorySnapshots = log.fileHistorySnapshots; + if (!fileHistorySnapshots || log.messages.length === 0) { return; } - const lastMessage = log2.messages[log2.messages.length - 1]; + const lastMessage = log.messages[log.messages.length - 1]; const previousSessionId = lastMessage?.sessionId; if (!previousSessionId) { logError2(new Error(`FileHistory: Failed to copy backups on restore (no previous session id)`)); @@ -466687,14 +390298,14 @@ async function copyFileHistoryForResume(log2) { return; } try { - const newBackupDir = join82(getClaudeConfigHomeDir(), "file-history", sessionId); + const newBackupDir = join72(getClaudeConfigHomeDir(), "file-history", sessionId); await mkdir19(newBackupDir, { recursive: true }); let failedSnapshots = 0; await Promise.allSettled(fileHistorySnapshots.map(async (snapshot2) => { const backupEntries = Object.values(snapshot2.trackedFileBackups).filter((backup) => backup.backupFileName !== null); const results = await Promise.allSettled(backupEntries.map(async ({ backupFileName }) => { const oldBackupPath = resolveBackupPath(backupFileName, previousSessionId); - const newBackupPath = join82(newBackupDir, backupFileName); + const newBackupPath = join72(newBackupDir, backupFileName); try { await link3(oldBackupPath, newBackupPath); } catch (e) { @@ -466708,7 +390319,7 @@ async function copyFileHistoryForResume(log2) { } logError2(new Error(`FileHistory: Error hard linking backup file from previous session`)); try { - await copyFile4(oldBackupPath, newBackupPath); + await copyFile3(oldBackupPath, newBackupPath); } catch (copyErr) { logError2(new Error(`FileHistory: Error copying over backup from previous session`)); throw copyErr; @@ -466731,8 +390342,8 @@ async function copyFileHistoryForResume(log2) { failedSnapshots }); } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } async function notifyVscodeSnapshotFilesUpdated(oldState, newState) { @@ -466763,9 +390374,9 @@ async function notifyVscodeSnapshotFilesUpdated(oldState, newState) { } } } -async function readFileAsyncOrNull(path16) { +async function readFileAsyncOrNull(path11) { try { - return await readFile20(path16, "utf-8"); + return await readFile19(path11, "utf-8"); } catch { return null; } @@ -466791,8 +390402,8 @@ var init_fileHistory = __esm(() => { }); // src/utils/filePersistence/outputsScanner.ts -import * as fs9 from "fs/promises"; -import * as path16 from "path"; +import * as fs3 from "fs/promises"; +import * as path11 from "path"; function logDebug(message) { logForDebugging(`[file-persistence] ${message}`); } @@ -466806,14 +390417,14 @@ function getEnvironmentKind() { function hasParentPath(entry) { return "parentPath" in entry && typeof entry.parentPath === "string"; } -function hasPath3(entry) { +function hasPath2(entry) { return "path" in entry && typeof entry.path === "string"; } function getEntryParentPath(entry, fallback) { if (hasParentPath(entry)) { return entry.parentPath; } - if (hasPath3(entry)) { + if (hasPath2(entry)) { return entry.path; } return fallback; @@ -466821,7 +390432,7 @@ function getEntryParentPath(entry, fallback) { async function findModifiedFiles(turnStartTime, outputsDir) { let entries; try { - entries = await fs9.readdir(outputsDir, { + entries = await fs3.readdir(outputsDir, { withFileTypes: true, recursive: true }); @@ -466835,7 +390446,7 @@ async function findModifiedFiles(turnStartTime, outputsDir) { } if (entry.isFile()) { const parentPath = getEntryParentPath(entry, outputsDir); - filePaths.push(path16.join(parentPath, entry.name)); + filePaths.push(path11.join(parentPath, entry.name)); } } if (filePaths.length === 0) { @@ -466844,19 +390455,19 @@ async function findModifiedFiles(turnStartTime, outputsDir) { } const statResults = await Promise.all(filePaths.map(async (filePath) => { try { - const stat24 = await fs9.lstat(filePath); - if (stat24.isSymbolicLink()) { + const stat23 = await fs3.lstat(filePath); + if (stat23.isSymbolicLink()) { return null; } - return { filePath, mtimeMs: stat24.mtimeMs }; + return { filePath, mtimeMs: stat23.mtimeMs }; } catch { return null; } })); const modifiedFiles = []; - for (const result3 of statResults) { - if (result3 && result3.mtimeMs >= turnStartTime) { - modifiedFiles.push(result3.filePath); + for (const result2 of statResults) { + if (result2 && result2.mtimeMs >= turnStartTime) { + modifiedFiles.push(result2.filePath); } } logDebug(`Found ${modifiedFiles.length} modified files since turn start (scanned ${filePaths.length} total)`); @@ -466867,11 +390478,11 @@ var init_outputsScanner = __esm(() => { }); // src/utils/words.ts -import { randomBytes as randomBytes7 } from "crypto"; -function randomInt(max5) { - const bytes = randomBytes7(4); +import { randomBytes as randomBytes6 } from "crypto"; +function randomInt(max3) { + const bytes = randomBytes6(4); const value = bytes.readUInt32BE(0); - return value % max5; + return value % max3; } function pickRandom(array3) { return array3[randomInt(array3.length)]; @@ -466888,7 +390499,7 @@ function generateShortWordSlug() { return `${adjective}-${noun}`; } var ADJECTIVES, NOUNS, VERBS; -var init_words3 = __esm(() => { +var init_words2 = __esm(() => { ADJECTIVES = [ "abundant", "ancient", @@ -467636,17 +391247,17 @@ var init_words3 = __esm(() => { // src/utils/plans.ts import { randomUUID as randomUUID13 } from "crypto"; -import { copyFile as copyFile5, writeFile as writeFile22 } from "fs/promises"; -import { join as join84, resolve as resolve27, sep as sep17 } from "path"; +import { copyFile as copyFile4, writeFile as writeFile20 } from "fs/promises"; +import { join as join74, resolve as resolve21, sep as sep14 } from "path"; function getPlanSlug(sessionId) { const id = sessionId ?? getSessionId(); const cache3 = getPlanSlugCache(); let slug = cache3.get(id); if (!slug) { const plansDir = getPlansDirectory(); - for (let i4 = 0;i4 < MAX_SLUG_RETRIES; i4++) { + for (let i3 = 0;i3 < MAX_SLUG_RETRIES; i3++) { slug = generateWordSlug(); - const filePath = join84(plansDir, `${slug}.md`); + const filePath = join74(plansDir, `${slug}.md`); if (!getFsImplementation().existsSync(filePath)) { break; } @@ -467664,32 +391275,32 @@ function clearAllPlanSlugs() { function getPlanFilePath(agentId) { const planSlug = getPlanSlug(getSessionId()); if (!agentId) { - return join84(getPlansDirectory(), `${planSlug}.md`); + return join74(getPlansDirectory(), `${planSlug}.md`); } - return join84(getPlansDirectory(), `${planSlug}-agent-${agentId}.md`); + return join74(getPlansDirectory(), `${planSlug}-agent-${agentId}.md`); } function getPlan(agentId) { const filePath = getPlanFilePath(agentId); try { return getFsImplementation().readFileSync(filePath, { encoding: "utf-8" }); - } catch (error45) { - if (isENOENT(error45)) + } catch (error41) { + if (isENOENT(error41)) return null; - logError2(error45); + logError2(error41); return null; } } -function getSlugFromLog(log2) { - return log2.messages.find((m) => m.slug)?.slug; +function getSlugFromLog(log) { + return log.messages.find((m) => m.slug)?.slug; } -async function copyPlanForResume(log2, targetSessionId) { - const slug = getSlugFromLog(log2); +async function copyPlanForResume(log, targetSessionId) { + const slug = getSlugFromLog(log); if (!slug) { return false; } const sessionId = targetSessionId ?? getSessionId(); setPlanSlug(sessionId, slug); - const planPath = join84(getPlansDirectory(), `${slug}.md`); + const planPath = join74(getPlansDirectory(), `${slug}.md`); try { await getFsImplementation().readFile(planPath, { encoding: "utf-8" }); return true; @@ -467702,20 +391313,20 @@ async function copyPlanForResume(log2, targetSessionId) { return false; } logForDebugging(`Plan file missing during resume: ${planPath}. Attempting recovery.`); - const snapshotPlan = findFileSnapshotEntry(log2.messages, "plan"); + const snapshotPlan = findFileSnapshotEntry(log.messages, "plan"); let recovered = null; if (snapshotPlan && snapshotPlan.content.length > 0) { recovered = snapshotPlan.content; logForDebugging(`Plan recovered from file snapshot, ${recovered.length} chars`, { level: "info" }); } else { - recovered = recoverPlanFromMessages(log2); + recovered = recoverPlanFromMessages(log); if (recovered) { logForDebugging(`Plan recovered from message history, ${recovered.length} chars`, { level: "info" }); } } if (recovered) { try { - await writeFile22(planPath, recovered, { encoding: "utf-8" }); + await writeFile20(planPath, recovered, { encoding: "utf-8" }); return true; } catch (writeError) { logError2(writeError); @@ -467726,29 +391337,29 @@ async function copyPlanForResume(log2, targetSessionId) { return false; } } -async function copyPlanForFork(log2, targetSessionId) { - const originalSlug = getSlugFromLog(log2); +async function copyPlanForFork(log, targetSessionId) { + const originalSlug = getSlugFromLog(log); if (!originalSlug) { return false; } const plansDir = getPlansDirectory(); - const originalPlanPath = join84(plansDir, `${originalSlug}.md`); + const originalPlanPath = join74(plansDir, `${originalSlug}.md`); const newSlug = getPlanSlug(targetSessionId); - const newPlanPath = join84(plansDir, `${newSlug}.md`); + const newPlanPath = join74(plansDir, `${newSlug}.md`); try { - await copyFile5(originalPlanPath, newPlanPath); + await copyFile4(originalPlanPath, newPlanPath); return true; - } catch (error45) { - if (isENOENT(error45)) { + } catch (error41) { + if (isENOENT(error41)) { return false; } - logError2(error45); + logError2(error41); return false; } } -function recoverPlanFromMessages(log2) { - for (let i4 = log2.messages.length - 1;i4 >= 0; i4--) { - const msg = log2.messages[i4]; +function recoverPlanFromMessages(log) { + for (let i3 = log.messages.length - 1;i3 >= 0; i3--) { + const msg = log.messages[i3]; if (!msg) { continue; } @@ -467757,8 +391368,8 @@ function recoverPlanFromMessages(log2) { if (Array.isArray(content)) { for (const block2 of content) { if (block2.type === "tool_use" && block2.name === EXIT_PLAN_MODE_V2_TOOL_NAME) { - const input11 = block2.input; - const plan = input11?.plan; + const input = block2.input; + const plan = input?.plan; if (typeof plan === "string" && plan.length > 0) { return plan; } @@ -467785,11 +391396,11 @@ function recoverPlanFromMessages(log2) { return null; } function findFileSnapshotEntry(messages, key) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const msg = messages[i3]; if (msg?.type === "system" && "subtype" in msg && msg.subtype === "file_snapshot" && "snapshotFiles" in msg) { - const files2 = msg.snapshotFiles; - return files2.find((f) => f.key === key); + const files = msg.snapshotFiles; + return files.find((f) => f.key === key); } } return; @@ -467823,8 +391434,8 @@ async function persistFileSnapshotIfRemote() { }; const { recordTranscript: recordTranscript2 } = await Promise.resolve().then(() => (init_sessionStorage(), exports_sessionStorage)); await recordTranscript2([message]); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } var MAX_SLUG_RETRIES = 10, getPlansDirectory; @@ -467839,49 +391450,49 @@ var init_plans = __esm(() => { init_fsOperations(); init_log3(); init_settings2(); - init_words3(); + init_words2(); getPlansDirectory = memoize_default(function getPlansDirectory2() { const settings = getInitialSettings(); const settingsDir = settings.plansDirectory; let plansPath; if (settingsDir) { const cwd2 = getCwd(); - const resolved = resolve27(cwd2, settingsDir); - if (!resolved.startsWith(cwd2 + sep17) && resolved !== cwd2) { + const resolved = resolve21(cwd2, settingsDir); + if (!resolved.startsWith(cwd2 + sep14) && resolved !== cwd2) { logError2(new Error(`plansDirectory must be within project root: ${settingsDir}`)); - plansPath = join84(getClaudeConfigHomeDir(), "plans"); + plansPath = join74(getClaudeConfigHomeDir(), "plans"); } else { plansPath = resolved; } } else { - plansPath = join84(getClaudeConfigHomeDir(), "plans"); + plansPath = join74(getClaudeConfigHomeDir(), "plans"); } try { getFsImplementation().mkdirSync(plansPath); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } return plansPath; }); }); // src/utils/sessionEnvironment.ts -import { mkdir as mkdir20, readdir as readdir15, readFile as readFile21, writeFile as writeFile23 } from "fs/promises"; -import { join as join85 } from "path"; +import { mkdir as mkdir20, readdir as readdir15, readFile as readFile20, writeFile as writeFile21 } from "fs/promises"; +import { join as join75 } from "path"; async function getSessionEnvDirPath() { - const sessionEnvDir = join85(getClaudeConfigHomeDir(), "session-env", getSessionId()); + const sessionEnvDir = join75(getClaudeConfigHomeDir(), "session-env", getSessionId()); await mkdir20(sessionEnvDir, { recursive: true }); return sessionEnvDir; } async function getHookEnvFilePath(hookEvent, hookIndex) { const prefix = hookEvent.toLowerCase(); - return join85(await getSessionEnvDirPath(), `${prefix}-hook-${hookIndex}.sh`); + return join75(await getSessionEnvDirPath(), `${prefix}-hook-${hookIndex}.sh`); } async function clearCwdEnvFiles() { try { const dir = await getSessionEnvDirPath(); - const files2 = await readdir15(dir); - await Promise.all(files2.filter((f) => (f.startsWith("filechanged-hook-") || f.startsWith("cwdchanged-hook-")) && HOOK_ENV_REGEX.test(f)).map((f) => writeFile23(join85(dir, f), ""))); + const files = await readdir15(dir); + await Promise.all(files.filter((f) => (f.startsWith("filechanged-hook-") || f.startsWith("cwdchanged-hook-")) && HOOK_ENV_REGEX.test(f)).map((f) => writeFile21(join75(dir, f), ""))); } catch (e) { const code = getErrnoCode(e); if (code !== "ENOENT") { @@ -467905,7 +391516,7 @@ async function getSessionEnvironmentScript() { const envFile = process.env.CLAUDE_ENV_FILE; if (envFile) { try { - const envScript = (await readFile21(envFile, "utf8")).trim(); + const envScript = (await readFile20(envFile, "utf8")).trim(); if (envScript) { scripts.push(envScript); logForDebugging(`Session environment loaded from CLAUDE_ENV_FILE: ${envFile} (${envScript.length} chars)`); @@ -467919,12 +391530,12 @@ async function getSessionEnvironmentScript() { } const sessionEnvDir = await getSessionEnvDirPath(); try { - const files2 = await readdir15(sessionEnvDir); - const hookFiles = files2.filter((f) => HOOK_ENV_REGEX.test(f)).sort(sortHookEnvFiles); + const files = await readdir15(sessionEnvDir); + const hookFiles = files.filter((f) => HOOK_ENV_REGEX.test(f)).sort(sortHookEnvFiles); for (const file2 of hookFiles) { - const filePath = join85(sessionEnvDir, file2); + const filePath = join75(sessionEnvDir, file2); try { - const content = (await readFile21(filePath, "utf8")).trim(); + const content = (await readFile20(filePath, "utf8")).trim(); if (content) { scripts.push(content); } @@ -468035,7 +391646,7 @@ var init_hooksConfigSnapshot = __esm(() => { }); // src/utils/hooks/fileChangedWatcher.ts -import { isAbsolute as isAbsolute15, join as join86 } from "path"; +import { isAbsolute as isAbsolute14, join as join76 } from "path"; function setEnvHookNotifier(cb) { notifyCallback = cb; } @@ -468044,18 +391655,18 @@ function initializeFileChangedWatcher(cwd2) { return; initialized3 = true; currentCwd = cwd2; - const config4 = getHooksConfigFromSnapshot(); - hasEnvHooks = (config4?.CwdChanged?.length ?? 0) > 0 || (config4?.FileChanged?.length ?? 0) > 0; + const config2 = getHooksConfigFromSnapshot(); + hasEnvHooks = (config2?.CwdChanged?.length ?? 0) > 0 || (config2?.FileChanged?.length ?? 0) > 0; if (hasEnvHooks) { registerCleanup(async () => dispose2()); } - const paths2 = resolveWatchPaths(config4); + const paths2 = resolveWatchPaths(config2); if (paths2.length === 0) return; startWatching(paths2); } -function resolveWatchPaths(config4) { - const matchers = (config4 ?? getHooksConfigFromSnapshot())?.FileChanged ?? []; +function resolveWatchPaths(config2) { + const matchers = (config2 ?? getHooksConfigFromSnapshot())?.FileChanged ?? []; const staticPaths = []; for (const m of matchers) { if (!m.matcher) @@ -468063,7 +391674,7 @@ function resolveWatchPaths(config4) { for (const name of m.matcher.split("|").map((s) => s.trim())) { if (!name) continue; - staticPaths.push(isAbsolute15(name) ? name : join86(currentCwd, name)); + staticPaths.push(isAbsolute14(name) ? name : join76(currentCwd, name)); } } return [...new Set([...staticPaths, ...dynamicWatchPaths])]; @@ -468080,9 +391691,9 @@ function startWatching(paths2) { watcher3.on("add", (p) => handleFileEvent(p, "add")); watcher3.on("unlink", (p) => handleFileEvent(p, "unlink")); } -function handleFileEvent(path17, event) { - logForDebugging(`FileChanged: ${event} ${path17}`); - executeFileChangedHooks(path17, event).then(({ results, watchPaths, systemMessages }) => { +function handleFileEvent(path12, event) { + logForDebugging(`FileChanged: ${event} ${path12}`); + executeFileChangedHooks(path12, event).then(({ results, watchPaths, systemMessages }) => { if (watchPaths.length > 0) { updateWatchPaths(watchPaths); } @@ -468106,7 +391717,7 @@ function updateWatchPaths(paths2) { if (!initialized3) return; const sorted = paths2.slice().sort(); - if (sorted.length === dynamicWatchPathsSorted.length && sorted.every((p, i4) => p === dynamicWatchPathsSorted[i4])) { + if (sorted.length === dynamicWatchPathsSorted.length && sorted.every((p, i3) => p === dynamicWatchPathsSorted[i3])) { return; } dynamicWatchPaths = paths2; @@ -468126,8 +391737,8 @@ function restartWatching() { async function onCwdChangedForHooks(oldCwd, newCwd) { if (oldCwd === newCwd) return; - const config4 = getHooksConfigFromSnapshot(); - const currentHasEnvHooks = (config4?.CwdChanged?.length ?? 0) > 0 || (config4?.FileChanged?.length ?? 0) > 0; + const config2 = getHooksConfigFromSnapshot(); + const currentHasEnvHooks = (config2?.CwdChanged?.length ?? 0) > 0 || (config2?.FileChanged?.length ?? 0) > 0; if (!currentHasEnvHooks) return; currentCwd = newCwd; @@ -468352,7 +391963,7 @@ var init_loadPluginHooks = __esm(() => { } clearRegisteredPluginHooks(); registerHookCallbacks(allPluginHooks); - const totalHooks = Object.values(allPluginHooks).reduce((sum3, matchers) => sum3 + matchers.reduce((s, m) => s + m.hooks.length, 0), 0); + const totalHooks = Object.values(allPluginHooks).reduce((sum2, matchers) => sum2 + matchers.reduce((s, m) => s + m.hooks.length, 0), 0); logForDebugging(`Registered ${totalHooks} hooks from ${enabled.length} plugins`); }); }); @@ -468380,13 +391991,13 @@ async function processSessionStartHooks(source, { } else { try { await withDiagnosticsTiming("load_plugin_hooks", () => loadPluginHooks()); - } catch (error45) { - const enhancedError = error45 instanceof Error ? new Error(`Failed to load plugin hooks during ${source}: ${error45.message}`) : new Error(`Failed to load plugin hooks during ${source}: ${String(error45)}`); - if (error45 instanceof Error && error45.stack) { - enhancedError.stack = error45.stack; + } catch (error41) { + const enhancedError = error41 instanceof Error ? new Error(`Failed to load plugin hooks during ${source}: ${error41.message}`) : new Error(`Failed to load plugin hooks during ${source}: ${String(error41)}`); + if (error41 instanceof Error && error41.stack) { + enhancedError.stack = error41.stack; } logError2(enhancedError); - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); let userGuidance = ""; if (errorMessage2.includes("Failed to clone") || errorMessage2.includes("network") || errorMessage2.includes("ETIMEDOUT") || errorMessage2.includes("ENOTFOUND")) { userGuidance = "This appears to be a network issue. Check your internet connection and try again."; @@ -468441,8 +392052,8 @@ async function processSetupHooks(trigger, { forceSyncExecution } = {}) { } else { try { await loadPluginHooks(); - } catch (error45) { - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); logForDebugging(`Warning: Failed to load plugin hooks. Setup hooks from plugins will not execute. Error: ${errorMessage2}`, { level: "warn" }); } } @@ -468484,15 +392095,15 @@ var init_sessionStart = __esm(() => { var exports_udsClient = {}; __export(exports_udsClient, { default: () => udsClient_default, - __stub__: () => __stub__15 + __stub__: () => __stub__21 }); -var udsClient_default, __stub__15 = true; +var udsClient_default, __stub__21 = true; var init_udsClient = __esm(() => { udsClient_default = {}; }); // src/utils/conversationRecovery.ts -import { relative as relative12 } from "path"; +import { relative as relative10 } from "path"; function migrateLegacyAttachmentTypes(message) { if (message.type !== "attachment") { return message; @@ -468504,7 +392115,7 @@ function migrateLegacyAttachmentTypes(message) { attachment: { ...attachment, type: "file", - displayPath: relative12(getCwd(), attachment.filename) + displayPath: relative10(getCwd(), attachment.filename) } }; } @@ -468514,18 +392125,18 @@ function migrateLegacyAttachmentTypes(message) { attachment: { ...attachment, type: "directory", - displayPath: relative12(getCwd(), attachment.path) + displayPath: relative10(getCwd(), attachment.path) } }; } if (!("displayPath" in attachment)) { - const path17 = "filename" in attachment ? attachment.filename : ("path" in attachment) ? attachment.path : ("skillDir" in attachment) ? attachment.skillDir : undefined; - if (path17) { + const path12 = "filename" in attachment ? attachment.filename : ("path" in attachment) ? attachment.path : ("skillDir" in attachment) ? attachment.skillDir : undefined; + if (path12) { return { ...message, attachment: { ...attachment, - displayPath: relative12(getCwd(), path17) + displayPath: relative10(getCwd(), path12) } }; } @@ -468571,9 +392182,9 @@ function deserializeMessagesWithInterruptDetection(serializedMessages) { })); } return { messages: filteredMessages, turnInterruptionState }; - } catch (error45) { - logError2(error45); - throw error45; + } catch (error41) { + logError2(error41); + throw error41; } } function detectTurnInterruption(messages) { @@ -468605,16 +392216,16 @@ function detectTurnInterruption(messages) { } return { kind: "none" }; } -function isTerminalToolResult(result3, messages, resultIdx) { - const content = result3.message.content; +function isTerminalToolResult(result2, messages, resultIdx) { + const content = result2.message.content; if (!Array.isArray(content)) return false; const block2 = content[0]; if (block2?.type !== "tool_result") return false; const toolUseId = block2.tool_use_id; - for (let i4 = resultIdx - 1;i4 >= 0; i4--) { - const msg = messages[i4]; + for (let i3 = resultIdx - 1;i3 >= 0; i3--) { + const msg = messages[i3]; if (msg.type !== "assistant") continue; for (const b of msg.message.content) { @@ -468642,8 +392253,8 @@ function restoreSkillStateFromMessages(messages) { } } } -async function loadMessagesFromJsonlPath(path17) { - const { messages: byUuid, leafUuids } = await loadTranscriptFile(path17); +async function loadMessagesFromJsonlPath(path12) { + const { messages: byUuid, leafUuids } = await loadTranscriptFile(path12); let tip = null; let tipTs = 0; for (const m of byUuid.values()) { @@ -468657,15 +392268,15 @@ async function loadMessagesFromJsonlPath(path17) { } if (!tip) return { messages: [], sessionId: undefined }; - const chain3 = buildConversationChain(byUuid, tip); + const chain2 = buildConversationChain(byUuid, tip); return { - messages: removeExtraFields(chain3), + messages: removeExtraFields(chain2), sessionId: tip.sessionId }; } async function loadConversationForResume(source, sourceJsonlFile) { try { - let log2 = null; + let log = null; let messages = null; let sessionId; if (source === undefined) { @@ -468679,7 +392290,7 @@ async function loadConversationForResume(source, sourceJsonlFile) { } catch {} } const logs2 = await logsPromise; - log2 = logs2.find((l) => { + log = logs2.find((l) => { const id = getSessionIdFromLog(l); return !id || !skip.has(id); }) ?? null; @@ -468688,26 +392299,26 @@ async function loadConversationForResume(source, sourceJsonlFile) { messages = loaded.messages; sessionId = loaded.sessionId; } else if (typeof source === "string") { - log2 = await getLastSessionLog(source); + log = await getLastSessionLog(source); sessionId = source; } else { - log2 = source; + log = source; } - if (!log2 && !messages) { + if (!log && !messages) { return null; } - if (log2) { - if (isLiteLog(log2)) { - log2 = await loadFullLog(log2); + if (log) { + if (isLiteLog(log)) { + log = await loadFullLog(log); } if (!sessionId) { - sessionId = getSessionIdFromLog(log2); + sessionId = getSessionIdFromLog(log); } if (sessionId) { - await copyPlanForResume(log2, asSessionId(sessionId)); + await copyPlanForResume(log, asSessionId(sessionId)); } - copyFileHistoryForResume(log2); - messages = log2.messages; + copyFileHistoryForResume(log); + messages = log.messages; checkResumeConsistency(messages); } restoreSkillStateFromMessages(messages); @@ -468718,27 +392329,27 @@ async function loadConversationForResume(source, sourceJsonlFile) { return { messages, turnInterruptionState: deserialized.turnInterruptionState, - fileHistorySnapshots: log2?.fileHistorySnapshots, - attributionSnapshots: log2?.attributionSnapshots, - contentReplacements: log2?.contentReplacements, - contextCollapseCommits: log2?.contextCollapseCommits, - contextCollapseSnapshot: log2?.contextCollapseSnapshot, + fileHistorySnapshots: log?.fileHistorySnapshots, + attributionSnapshots: log?.attributionSnapshots, + contentReplacements: log?.contentReplacements, + contextCollapseCommits: log?.contextCollapseCommits, + contextCollapseSnapshot: log?.contextCollapseSnapshot, sessionId, - agentName: log2?.agentName, - agentColor: log2?.agentColor, - agentSetting: log2?.agentSetting, - customTitle: log2?.customTitle, - tag: log2?.tag, - mode: log2?.mode, - worktreeSession: log2?.worktreeSession, - prNumber: log2?.prNumber, - prUrl: log2?.prUrl, - prRepository: log2?.prRepository, - fullPath: log2?.fullPath + agentName: log?.agentName, + agentColor: log?.agentColor, + agentSetting: log?.agentSetting, + customTitle: log?.customTitle, + tag: log?.tag, + mode: log?.mode, + worktreeSession: log?.worktreeSession, + prNumber: log?.prNumber, + prUrl: log?.prUrl, + prRepository: log?.prRepository, + fullPath: log?.fullPath }; - } catch (error45) { - logError2(error45); - throw error45; + } catch (error41) { + logError2(error41); + throw error41; } } var BRIEF_TOOL_NAME4, LEGACY_BRIEF_TOOL_NAME2, SEND_USER_FILE_TOOL_NAME3; @@ -468751,7 +392362,7 @@ var init_conversationRecovery = __esm(() => { init_attachments2(); init_fileHistory(); init_log3(); - init_messages5(); + init_messages3(); init_plans(); init_sessionStart(); init_sessionStorage(); @@ -468762,8 +392373,8 @@ var init_conversationRecovery = __esm(() => { // src/services/api/filesApi.ts import { randomUUID as randomUUID14 } from "crypto"; -import * as fs10 from "fs/promises"; -import * as path17 from "path"; +import * as fs4 from "fs/promises"; +import * as path12 from "path"; function getDefaultApiBaseUrl() { return process.env.ANTHROPIC_BASE_URL || process.env.CLAUDE_CODE_API_BASE_URL || "https://api.anthropic.com"; } @@ -468775,26 +392386,26 @@ function logDebug2(message) { } async function retryWithBackoff(operation, attemptFn) { let lastError = ""; - for (let attempt3 = 1;attempt3 <= MAX_RETRIES2; attempt3++) { - const result3 = await attemptFn(attempt3); - if (result3.done) { - return result3.value; + for (let attempt2 = 1;attempt2 <= MAX_RETRIES2; attempt2++) { + const result2 = await attemptFn(attempt2); + if (result2.done) { + return result2.value; } - lastError = result3.error || `${operation} failed`; - logDebug2(`${operation} attempt ${attempt3}/${MAX_RETRIES2} failed: ${lastError}`); - if (attempt3 < MAX_RETRIES2) { - const delayMs = BASE_DELAY_MS3 * Math.pow(2, attempt3 - 1); + lastError = result2.error || `${operation} failed`; + logDebug2(`${operation} attempt ${attempt2}/${MAX_RETRIES2} failed: ${lastError}`); + if (attempt2 < MAX_RETRIES2) { + const delayMs = BASE_DELAY_MS3 * Math.pow(2, attempt2 - 1); logDebug2(`Retrying ${operation} in ${delayMs}ms...`); - await sleep4(delayMs); + await sleep2(delayMs); } } throw new Error(`${lastError} after ${MAX_RETRIES2} attempts`); } -async function downloadFile(fileId, config4) { - const baseUrl = config4.baseUrl || getDefaultApiBaseUrl(); +async function downloadFile(fileId, config2) { + const baseUrl = config2.baseUrl || getDefaultApiBaseUrl(); const url3 = `${baseUrl}/v1/files/${fileId}/content`; const headers = { - Authorization: `Bearer ${config4.oauthToken}`, + Authorization: `Bearer ${config2.oauthToken}`, "anthropic-version": ANTHROPIC_VERSION, "anthropic-beta": FILES_API_BETA_HEADER }; @@ -468821,32 +392432,32 @@ async function downloadFile(fileId, config4) { throw new Error(`Access denied to file: ${fileId}`); } return { done: false, error: `status ${response.status}` }; - } catch (error45) { - if (!axios_default.isAxiosError(error45)) { - throw error45; + } catch (error41) { + if (!axios_default.isAxiosError(error41)) { + throw error41; } - return { done: false, error: error45.message }; + return { done: false, error: error41.message }; } }); } function buildDownloadPath(basePath, sessionId, relativePath) { - const normalized = path17.normalize(relativePath); + const normalized = path12.normalize(relativePath); if (normalized.startsWith("..")) { logDebugError(`Invalid file path: ${relativePath}. Path must not traverse above workspace`); return null; } - const uploadsBase = path17.join(basePath, sessionId, "uploads"); + const uploadsBase = path12.join(basePath, sessionId, "uploads"); const redundantPrefixes = [ - path17.join(basePath, sessionId, "uploads") + path17.sep, - path17.sep + "uploads" + path17.sep + path12.join(basePath, sessionId, "uploads") + path12.sep, + path12.sep + "uploads" + path12.sep ]; const matchedPrefix = redundantPrefixes.find((p) => normalized.startsWith(p)); const cleanPath = matchedPrefix ? normalized.slice(matchedPrefix.length) : normalized; - return path17.join(uploadsBase, cleanPath); + return path12.join(uploadsBase, cleanPath); } -async function downloadAndSaveFile(attachment, config4) { +async function downloadAndSaveFile(attachment, config2) { const { fileId, relativePath } = attachment; - const fullPath = buildDownloadPath(getCwd(), config4.sessionId, relativePath); + const fullPath = buildDownloadPath(getCwd(), config2.sessionId, relativePath); if (!fullPath) { return { fileId, @@ -468856,10 +392467,10 @@ async function downloadAndSaveFile(attachment, config4) { }; } try { - const content = await downloadFile(fileId, config4); - const parentDir = path17.dirname(fullPath); - await fs10.mkdir(parentDir, { recursive: true }); - await fs10.writeFile(fullPath, content); + const content = await downloadFile(fileId, config2); + const parentDir = path12.dirname(fullPath); + await fs4.mkdir(parentDir, { recursive: true }); + await fs4.writeFile(fullPath, content); logDebug2(`Saved file ${fileId} to ${fullPath} (${content.length} bytes)`); return { fileId, @@ -468867,16 +392478,16 @@ async function downloadAndSaveFile(attachment, config4) { success: true, bytesWritten: content.length }; - } catch (error45) { - logDebugError(`Failed to download file ${fileId}: ${errorMessage(error45)}`); - if (error45 instanceof Error) { - logError2(error45); + } catch (error41) { + logDebugError(`Failed to download file ${fileId}: ${errorMessage(error41)}`); + if (error41 instanceof Error) { + logError2(error41); } return { fileId, path: fullPath, success: false, - error: errorMessage(error45) + error: errorMessage(error41) }; } } @@ -468894,43 +392505,43 @@ async function parallelWithLimit(items, fn, concurrency) { } const workers = []; const workerCount = Math.min(concurrency, items.length); - for (let i4 = 0;i4 < workerCount; i4++) { + for (let i3 = 0;i3 < workerCount; i3++) { workers.push(worker()); } await Promise.all(workers); return results; } -async function downloadSessionFiles(files2, config4, concurrency = DEFAULT_CONCURRENCY) { - if (files2.length === 0) { +async function downloadSessionFiles(files, config2, concurrency = DEFAULT_CONCURRENCY) { + if (files.length === 0) { return []; } - logDebug2(`Downloading ${files2.length} file(s) for session ${config4.sessionId}`); + logDebug2(`Downloading ${files.length} file(s) for session ${config2.sessionId}`); const startTime = Date.now(); - const results = await parallelWithLimit(files2, (file2) => downloadAndSaveFile(file2, config4), concurrency); + const results = await parallelWithLimit(files, (file2) => downloadAndSaveFile(file2, config2), concurrency); const elapsedMs = Date.now() - startTime; const successCount = count2(results, (r) => r.success); - logDebug2(`Downloaded ${successCount}/${files2.length} file(s) in ${elapsedMs}ms`); + logDebug2(`Downloaded ${successCount}/${files.length} file(s) in ${elapsedMs}ms`); return results; } -async function uploadFile(filePath, relativePath, config4, opts) { - const baseUrl = config4.baseUrl || getDefaultApiBaseUrl(); +async function uploadFile(filePath, relativePath, config2, opts) { + const baseUrl = config2.baseUrl || getDefaultApiBaseUrl(); const url3 = `${baseUrl}/v1/files`; const headers = { - Authorization: `Bearer ${config4.oauthToken}`, + Authorization: `Bearer ${config2.oauthToken}`, "anthropic-version": ANTHROPIC_VERSION, "anthropic-beta": FILES_API_BETA_HEADER }; logDebug2(`Uploading file ${filePath} as ${relativePath}`); let content; try { - content = await fs10.readFile(filePath); - } catch (error45) { + content = await fs4.readFile(filePath); + } catch (error41) { logEvent("tengu_file_upload_failed", { error_type: "file_read" }); return { path: relativePath, - error: errorMessage(error45), + error: errorMessage(error41), success: false }; } @@ -468946,7 +392557,7 @@ async function uploadFile(filePath, relativePath, config4, opts) { }; } const boundary = `----FormBoundary${randomUUID14()}`; - const filename = path17.basename(relativePath); + const filename = path12.basename(relativePath); const bodyParts = []; bodyParts.push(Buffer.from(`--${boundary}\r ` + `Content-Disposition: form-data; name="file"; filename="${filename}"\r @@ -469015,24 +392626,24 @@ async function uploadFile(filePath, relativePath, config4, opts) { throw new UploadNonRetriableError("File too large for upload"); } return { done: false, error: `status ${response.status}` }; - } catch (error45) { - if (error45 instanceof UploadNonRetriableError) { - throw error45; + } catch (error41) { + if (error41 instanceof UploadNonRetriableError) { + throw error41; } - if (axios_default.isCancel(error45)) { + if (axios_default.isCancel(error41)) { throw new UploadNonRetriableError("Upload canceled"); } - if (axios_default.isAxiosError(error45)) { - return { done: false, error: error45.message }; + if (axios_default.isAxiosError(error41)) { + return { done: false, error: error41.message }; } - throw error45; + throw error41; } }); - } catch (error45) { - if (error45 instanceof UploadNonRetriableError) { + } catch (error41) { + if (error41 instanceof UploadNonRetriableError) { return { path: relativePath, - error: error45.message, + error: error41.message, success: false }; } @@ -469041,25 +392652,25 @@ async function uploadFile(filePath, relativePath, config4, opts) { }); return { path: relativePath, - error: errorMessage(error45), + error: errorMessage(error41), success: false }; } } -async function uploadSessionFiles(files2, config4, concurrency = DEFAULT_CONCURRENCY) { - if (files2.length === 0) { +async function uploadSessionFiles(files, config2, concurrency = DEFAULT_CONCURRENCY) { + if (files.length === 0) { return []; } - logDebug2(`Uploading ${files2.length} file(s) for session ${config4.sessionId}`); + logDebug2(`Uploading ${files.length} file(s) for session ${config2.sessionId}`); const startTime = Date.now(); - const results = await parallelWithLimit(files2, (file2) => uploadFile(file2.path, file2.relativePath, config4), concurrency); + const results = await parallelWithLimit(files, (file2) => uploadFile(file2.path, file2.relativePath, config2), concurrency); const elapsedMs = Date.now() - startTime; const successCount = count2(results, (r) => r.success); - logDebug2(`Uploaded ${successCount}/${files2.length} file(s) in ${elapsedMs}ms`); + logDebug2(`Uploaded ${successCount}/${files.length} file(s) in ${elapsedMs}ms`); return results; } function parseFileSpecs(fileSpecs) { - const files2 = []; + const files = []; const expandedSpecs = fileSpecs.flatMap((s) => s.split(" ").filter(Boolean)); for (const spec of expandedSpecs) { const colonIndex = spec.indexOf(":"); @@ -469072,9 +392683,9 @@ function parseFileSpecs(fileSpecs) { logDebugError(`Invalid file spec: ${spec}. Both file_id and path are required`); continue; } - files2.push({ fileId, relativePath }); + files.push({ fileId, relativePath }); } - return files2; + return files; } var FILES_API_BETA_HEADER = "files-api-2025-04-14,oauth-2025-04-20", ANTHROPIC_VERSION = "2023-06-01", MAX_RETRIES2 = 3, BASE_DELAY_MS3 = 500, MAX_FILE_SIZE_BYTES2, DEFAULT_CONCURRENCY = 5, UploadNonRetriableError; var init_filesApi = __esm(() => { @@ -469094,17 +392705,17 @@ var init_filesApi = __esm(() => { }); // src/utils/tempfile.ts -import { createHash as createHash17, randomUUID as randomUUID15 } from "crypto"; -import { tmpdir as tmpdir7 } from "os"; -import { join as join88 } from "path"; +import { createHash as createHash16, randomUUID as randomUUID15 } from "crypto"; +import { tmpdir as tmpdir4 } from "os"; +import { join as join78 } from "path"; function generateTempFilePath(prefix = "claude-prompt", extension = ".md", options2) { - const id = options2?.contentHash ? createHash17("sha256").update(options2.contentHash).digest("hex").slice(0, 16) : randomUUID15(); - return join88(tmpdir7(), `${prefix}-${id}${extension}`); + const id = options2?.contentHash ? createHash16("sha256").update(options2.contentHash).digest("hex").slice(0, 16) : randomUUID15(); + return join78(tmpdir4(), `${prefix}-${id}${extension}`); } var init_tempfile = () => {}; // src/utils/teleport/gitBundle.ts -import { stat as stat24, unlink as unlink11 } from "fs/promises"; +import { stat as stat23, unlink as unlink11 } from "fs/promises"; async function _bundleWithFallback(gitRoot, bundlePath, maxBytes, hasStash, signal) { const extra = hasStash ? ["refs/seed/stash"] : []; const mkBundle = (base2) => execFileNoThrowWithCwd(gitExe(), ["bundle", "create", bundlePath, base2, ...extra], { cwd: gitRoot, abortSignal: signal }); @@ -469116,7 +392727,7 @@ async function _bundleWithFallback(gitRoot, bundlePath, maxBytes, hasStash, sign failReason: "git_error" }; } - const { size: allSize } = await stat24(bundlePath); + const { size: allSize } = await stat23(bundlePath); if (allSize <= maxBytes) { return { ok: true, size: allSize, scope: "all" }; } @@ -469129,7 +392740,7 @@ async function _bundleWithFallback(gitRoot, bundlePath, maxBytes, hasStash, sign failReason: "git_error" }; } - const { size: headSize } = await stat24(bundlePath); + const { size: headSize } = await stat23(bundlePath); if (headSize <= maxBytes) { return { ok: true, size: headSize, scope: "head" }; } @@ -469153,7 +392764,7 @@ async function _bundleWithFallback(gitRoot, bundlePath, maxBytes, hasStash, sign failReason: "git_error" }; } - const { size: squashSize } = await stat24(bundlePath); + const { size: squashSize } = await stat23(bundlePath); if (squashSize <= maxBytes) { return { ok: true, size: squashSize, scope: "squashed" }; } @@ -469163,7 +392774,7 @@ async function _bundleWithFallback(gitRoot, bundlePath, maxBytes, hasStash, sign failReason: "too_large" }; } -async function createAndUploadGitBundle(config4, opts) { +async function createAndUploadGitBundle(config2, opts) { const workdir = opts?.cwd ?? getCwd(); const gitRoot = findGitRoot(workdir); if (!gitRoot) { @@ -469210,7 +392821,7 @@ async function createAndUploadGitBundle(config4, opts) { failReason: bundle.failReason }; } - const upload = await uploadFile(bundlePath, "_source_seed.bundle", config4, { + const upload = await uploadFile(bundlePath, "_source_seed.bundle", config2, { signal: opts?.signal }); if (!upload.success) { @@ -469342,8 +392953,8 @@ async function generateTitleAndBranch(description, signal) { title: fallbackTitle, branchName: fallbackBranch }; - } catch (error45) { - logError2(new Error(`Error generating title and branch: ${error45}`)); + } catch (error41) { + logError2(new Error(`Error generating title and branch: ${error41}`)); return { title: fallbackTitle, branchName: fallbackBranch @@ -469356,9 +392967,9 @@ async function validateGitState() { }); if (!isClean) { logEvent("tengu_teleport_error_git_not_clean", {}); - const error45 = new TeleportOperationError("Git working directory is not clean. Please commit or stash your changes before using --teleport.", source_default.red(`Error: Git working directory is not clean. Please commit or stash your changes before using --teleport. + const error41 = new TeleportOperationError("Git working directory is not clean. Please commit or stash your changes before using --teleport.", source_default.red(`Error: Git working directory is not clean. Please commit or stash your changes before using --teleport. `)); - throw error45; + throw error41; } } async function fetchFromOrigin(branch) { @@ -469415,9 +393026,9 @@ async function checkoutBranch(branchName) { } = await execFileNoThrow(gitExe(), ["checkout", branchName]); if (checkoutCode !== 0) { logForDebugging(`Local checkout failed, trying to checkout from origin: ${checkoutStderr}`); - const result3 = await execFileNoThrow(gitExe(), ["checkout", "-b", branchName, "--track", `origin/${branchName}`]); - checkoutCode = result3.code; - checkoutStderr = result3.stderr; + const result2 = await execFileNoThrow(gitExe(), ["checkout", "-b", branchName, "--track", `origin/${branchName}`]); + checkoutCode = result2.code; + checkoutStderr = result2.stderr; if (checkoutCode !== 0) { logForDebugging(`Remote checkout with -b failed, trying without -b: ${checkoutStderr}`); const finalResult = await execFileNoThrow(gitExe(), ["checkout", "--track", `origin/${branchName}`]); @@ -469438,9 +393049,9 @@ async function getCurrentBranch() { } = await execFileNoThrow(gitExe(), ["branch", "--show-current"]); return currentBranch.trim(); } -function processMessagesForTeleportResume(messages, error45) { +function processMessagesForTeleportResume(messages, error41) { const deserializedMessages = deserializeMessages(messages); - const messagesWithTeleportNotice = [...deserializedMessages, createTeleportResumeUserMessage(), createTeleportResumeSystemMessage(error45)]; + const messagesWithTeleportNotice = [...deserializedMessages, createTeleportResumeUserMessage(), createTeleportResumeSystemMessage(error41)]; return messagesWithTeleportNotice; } async function checkOutTeleportedSessionBranch(branch) { @@ -469461,9 +393072,9 @@ async function checkOutTeleportedSessionBranch(branch) { branchName, branchError: null }; - } catch (error45) { + } catch (error41) { const branchName = await getCurrentBranch(); - const branchError = toError(error45); + const branchError = toError(error41); return { branchName, branchError @@ -469570,36 +393181,36 @@ This repo is ${source_default.bold(currentDisplay)}. } } return await teleportFromSessionsAPI(sessionId, orgUUID, accessToken, onProgress, sessionData); - } catch (error45) { - if (error45 instanceof TeleportOperationError) { - throw error45; + } catch (error41) { + if (error41 instanceof TeleportOperationError) { + throw error41; } - const err3 = toError(error45); - logError2(err3); + const err2 = toError(error41); + logError2(err2); logEvent("tengu_teleport_resume_error", { error_type: "resume_session_id_catch" }); - throw new TeleportOperationError(err3.message, source_default.red(`Error: ${err3.message} + throw new TeleportOperationError(err2.message, source_default.red(`Error: ${err2.message} `)); } } -async function handleTeleportPrerequisites(root3, errorsToIgnore) { - const errors5 = await getTeleportErrors(); - if (errors5.size > 0) { +async function handleTeleportPrerequisites(root2, errorsToIgnore) { + const errors4 = await getTeleportErrors(); + if (errors4.size > 0) { logEvent("tengu_teleport_errors_detected", { - error_types: Array.from(errors5).join(","), + error_types: Array.from(errors4).join(","), errors_ignored: Array.from(errorsToIgnore || []).join(",") }); - await new Promise((resolve28) => { - root3.render(/* @__PURE__ */ jsx_dev_runtime113.jsxDEV(AppStateProvider, { + await new Promise((resolve22) => { + root2.render(/* @__PURE__ */ jsx_dev_runtime113.jsxDEV(AppStateProvider, { children: /* @__PURE__ */ jsx_dev_runtime113.jsxDEV(KeybindingSetup, { children: /* @__PURE__ */ jsx_dev_runtime113.jsxDEV(TeleportError, { errorsToIgnore, onComplete: () => { logEvent("tengu_teleport_errors_resolved", { - error_types: Array.from(errors5).join(",") + error_types: Array.from(errors4).join(",") }); - resolve28(); + resolve22(); } }, undefined, false, undefined, this) }, undefined, false, undefined, this) @@ -469607,9 +393218,9 @@ async function handleTeleportPrerequisites(root3, errorsToIgnore) { }); } } -async function teleportToRemoteWithErrorHandling(root3, description, signal, branchName) { +async function teleportToRemoteWithErrorHandling(root2, description, signal, branchName) { const errorsToIgnore = new Set(["needsGitStash"]); - await handleTeleportPrerequisites(root3, errorsToIgnore); + await handleTeleportPrerequisites(root2, errorsToIgnore); return teleportToRemote({ initialMessage: description, signal, @@ -469647,17 +393258,17 @@ async function teleportFromSessionsAPI(sessionId, orgUUID, accessToken, onProgre log: messages, branch }; - } catch (error45) { - const err3 = toError(error45); - if (axios_default.isAxiosError(error45) && error45.response?.status === 404) { + } catch (error41) { + const err2 = toError(error41); + if (axios_default.isAxiosError(error41) && error41.response?.status === 404) { logEvent("tengu_teleport_error_session_not_found_404", { sessionId }); throw new TeleportOperationError(`${sessionId} not found.`, `${sessionId} not found. ${source_default.dim("Run /status in Claude Code to check your account.")}`); } - logError2(err3); - throw new Error(`Failed to fetch session from Sessions API: ${err3.message}`); + logError2(err2); + throw new Error(`Failed to fetch session from Sessions API: ${err2.message}`); } } async function pollRemoteSessionEvents(sessionId, afterId = null, opts) { @@ -469941,11 +393552,11 @@ async function teleportToRemote(options2) { logForDebugging(`Available environments: ${environments.map((e) => `${e.environment_id} (${e.name}, ${e.kind})`).join(", ")}`); const settings = getSettings_DEPRECATED(); const defaultEnvironmentId = options2.useDefaultEnvironment ? undefined : settings?.remote?.defaultEnvironmentId; - let cloudEnv = environments.find((env5) => env5.kind === "anthropic_cloud"); + let cloudEnv = environments.find((env4) => env4.kind === "anthropic_cloud"); if (options2.useDefaultEnvironment && !cloudEnv) { logForDebugging(`No anthropic_cloud in env list (${environments.length} envs); retrying fetchEnvironments`); const retried = await fetchEnvironments(); - cloudEnv = retried?.find((env5) => env5.kind === "anthropic_cloud"); + cloudEnv = retried?.find((env4) => env4.kind === "anthropic_cloud"); if (!cloudEnv) { logError2(new Error(`No anthropic_cloud environment available after retry (got: ${(retried ?? environments).map((e) => `${e.name} (${e.kind})`).join(", ")}). Silent byoc fallthrough would launch into a dead env — fail fast instead.`)); return null; @@ -469953,7 +393564,7 @@ async function teleportToRemote(options2) { if (retried) environments = retried; } - const selectedEnvironment = defaultEnvironmentId && environments.find((env5) => env5.environment_id === defaultEnvironmentId) || cloudEnv || environments.find((env5) => env5.kind !== "bridge") || environments[0]; + const selectedEnvironment = defaultEnvironmentId && environments.find((env4) => env4.environment_id === defaultEnvironmentId) || cloudEnv || environments.find((env4) => env4.kind !== "bridge") || environments[0]; if (!selectedEnvironment) { logError2(new Error("No environments available for session creation")); return null; @@ -470042,9 +393653,9 @@ Response data: ${jsonStringify(response.data, null, 2)}`)); id: sessionData.id, title: sessionData.title || requestBody.title }; - } catch (error45) { - const err3 = toError(error45); - logError2(err3); + } catch (error41) { + const err2 = toError(error41); + logError2(err2); return null; } } @@ -470072,8 +393683,8 @@ async function archiveRemoteSession(sessionId) { } else { logForDebugging(`[archiveRemoteSession] ${sessionId} failed ${resp.status}: ${jsonStringify(resp.data)}`); } - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); } } var jsx_dev_runtime113, SESSION_TITLE_AND_BRANCH_PROMPT = `You are coming up with a succinct title and git branch name for a coding session based on the provided description. The title should be clear, concise, and accurately reflect the content of the coding task. @@ -470107,7 +393718,7 @@ var init_teleport = __esm(() => { init_sessionIngress(); init_client2(); init_AppState(); - init_auth2(); + init_auth(); init_preconditions(); init_conversationRecovery(); init_cwd2(); @@ -470120,7 +393731,7 @@ var init_teleport = __esm(() => { init_git(); init_json(); init_log3(); - init_messages5(); + init_messages3(); init_model(); init_sessionStorage(); init_settings2(); @@ -470152,21 +393763,21 @@ async function removeRemoteAgentMetadata(taskId) { async function checkRemoteAgentEligibility({ skipBundle = false } = {}) { - const errors5 = await checkBackgroundRemoteSessionEligibility({ + const errors4 = await checkBackgroundRemoteSessionEligibility({ skipBundle }); - if (errors5.length > 0) { + if (errors4.length > 0) { return { eligible: false, - errors: errors5 + errors: errors4 }; } return { eligible: true }; } -function formatPreconditionError(error45) { - switch (error45.type) { +function formatPreconditionError(error41) { + switch (error41.type) { case "not_logged_in": return "Please run /login and sign in with your Claude.ai account (not Console)."; case "no_remote_environment": @@ -470215,17 +393826,17 @@ function markTaskNotified(taskId, setAppState) { }); return shouldEnqueue; } -function extractReviewFromLog(log2) { - for (let i4 = log2.length - 1;i4 >= 0; i4--) { - const msg = log2[i4]; +function extractReviewFromLog(log) { + for (let i3 = log.length - 1;i3 >= 0; i3--) { + const msg = log[i3]; if (msg?.type === "system" && (msg.subtype === "hook_progress" || msg.subtype === "hook_response")) { const tagged = extractTag(msg.stdout, REMOTE_REVIEW_TAG); if (tagged?.trim()) return tagged.trim(); } } - for (let i4 = log2.length - 1;i4 >= 0; i4--) { - const msg = log2[i4]; + for (let i3 = log.length - 1;i3 >= 0; i3--) { + const msg = log[i3]; if (msg?.type !== "assistant") continue; const fullText = extractTextContent(msg.message.content, ` @@ -470234,26 +393845,26 @@ function extractReviewFromLog(log2) { if (tagged?.trim()) return tagged.trim(); } - const hookStdout = log2.filter((msg) => msg.type === "system" && (msg.subtype === "hook_progress" || msg.subtype === "hook_response")).map((msg) => msg.stdout).join(""); + const hookStdout = log.filter((msg) => msg.type === "system" && (msg.subtype === "hook_progress" || msg.subtype === "hook_response")).map((msg) => msg.stdout).join(""); const hookTagged = extractTag(hookStdout, REMOTE_REVIEW_TAG); if (hookTagged?.trim()) return hookTagged.trim(); - const allText = log2.filter((msg) => msg.type === "assistant").map((msg) => extractTextContent(msg.message.content, ` + const allText = log.filter((msg) => msg.type === "assistant").map((msg) => extractTextContent(msg.message.content, ` `)).join(` `).trim(); return allText || null; } -function extractReviewTagFromLog(log2) { - for (let i4 = log2.length - 1;i4 >= 0; i4--) { - const msg = log2[i4]; +function extractReviewTagFromLog(log) { + for (let i3 = log.length - 1;i3 >= 0; i3--) { + const msg = log[i3]; if (msg?.type === "system" && (msg.subtype === "hook_progress" || msg.subtype === "hook_response")) { const tagged = extractTag(msg.stdout, REMOTE_REVIEW_TAG); if (tagged?.trim()) return tagged.trim(); } } - for (let i4 = log2.length - 1;i4 >= 0; i4--) { - const msg = log2[i4]; + for (let i3 = log.length - 1;i3 >= 0; i3--) { + const msg = log[i3]; if (msg?.type !== "assistant") continue; const fullText = extractTextContent(msg.message.content, ` @@ -470262,7 +393873,7 @@ function extractReviewTagFromLog(log2) { if (tagged?.trim()) return tagged.trim(); } - const hookStdout = log2.filter((msg) => msg.type === "system" && (msg.subtype === "hook_progress" || msg.subtype === "hook_response")).map((msg) => msg.stdout).join(""); + const hookStdout = log.filter((msg) => msg.type === "system" && (msg.subtype === "hook_progress" || msg.subtype === "hook_response")).map((msg) => msg.stdout).join(""); const hookTagged = extractTag(hookStdout, REMOTE_REVIEW_TAG); if (hookTagged?.trim()) return hookTagged.trim(); @@ -470300,16 +393911,16 @@ Remote review did not produce output (${reason}). Tell the user to retry /ultrar mode: "task-notification" }); } -function extractTodoListFromLog(log2) { - const todoListMessage = log2.findLast((msg) => msg.type === "assistant" && msg.message.content.some((block2) => block2.type === "tool_use" && block2.name === TodoWriteTool.name)); +function extractTodoListFromLog(log) { + const todoListMessage = log.findLast((msg) => msg.type === "assistant" && msg.message.content.some((block2) => block2.type === "tool_use" && block2.name === TodoWriteTool.name)); if (!todoListMessage) { return []; } - const input11 = todoListMessage.message.content.find((block2) => block2.type === "tool_use" && block2.name === TodoWriteTool.name)?.input; - if (!input11) { + const input = todoListMessage.message.content.find((block2) => block2.type === "tool_use" && block2.name === TodoWriteTool.name)?.input; + if (!input) { return []; } - const parsedInput = TodoWriteTool.inputSchema.safeParse(input11); + const parsedInput = TodoWriteTool.inputSchema.safeParse(input); if (!parsedInput.success) { return []; } @@ -470479,7 +394090,7 @@ function startRemoteSessionPolling(taskId, context) { return; } } - const result3 = task.isUltraplan || task.isLongRunning ? undefined : accumulatedLog.findLast((msg) => msg.type === "result"); + const result2 = task.isUltraplan || task.isLongRunning ? undefined : accumulatedLog.findLast((msg) => msg.type === "result"); if (task.isRemoteReview && logGrew && cachedReviewContent === null) { cachedReviewContent = extractReviewTagFromLog(response.newEvents); } @@ -470517,7 +394128,7 @@ function startRemoteSessionPolling(taskId, context) { const hasAssistantEvents = accumulatedLog.some((m) => m.type === "assistant"); const sessionDone = task.isRemoteReview && (cachedReviewContent !== null || !hasSessionStartHook && stableIdle && hasAssistantEvents); const reviewTimedOut = task.isRemoteReview && Date.now() - task.pollStartedAt > REMOTE_REVIEW_TIMEOUT_MS; - const newStatus = result3 ? result3.subtype === "success" ? "completed" : "failed" : sessionDone || reviewTimedOut ? "completed" : accumulatedLog.length > 0 ? "running" : "starting"; + const newStatus = result2 ? result2.subtype === "success" ? "completed" : "failed" : sessionDone || reviewTimedOut ? "completed" : accumulatedLog.length > 0 ? "running" : "starting"; let raceTerminated = false; updateTaskState(taskId, context.setAppState, (prevTask) => { if (prevTask.status !== "running") { @@ -470534,13 +394145,13 @@ function startRemoteSessionPolling(taskId, context) { log: accumulatedLog, todoList: logGrew ? extractTodoListFromLog(accumulatedLog) : prevTask.todoList, reviewProgress: newProgress ?? prevTask.reviewProgress, - endTime: result3 || sessionDone || reviewTimedOut ? Date.now() : undefined + endTime: result2 || sessionDone || reviewTimedOut ? Date.now() : undefined }; }); if (raceTerminated) return; - if (result3 || sessionDone || reviewTimedOut) { - const finalStatus = result3 && result3.subtype !== "success" ? "failed" : "completed"; + if (result2 || sessionDone || reviewTimedOut) { + const finalStatus = result2 && result2.subtype !== "success" ? "failed" : "completed"; if (task.isRemoteReview) { const reviewContent = cachedReviewContent ?? extractReviewFromLog(accumulatedLog); if (reviewContent && finalStatus === "completed") { @@ -470553,7 +394164,7 @@ function startRemoteSessionPolling(taskId, context) { ...t, status: "failed" })); - const reason = result3 && result3.subtype !== "success" ? "remote session returned an error" : reviewTimedOut && !sessionDone ? "remote session exceeded 30 minutes" : "no review output — orchestrator may have exited early"; + const reason = result2 && result2.subtype !== "success" ? "remote session returned an error" : reviewTimedOut && !sessionDone ? "remote session exceeded 30 minutes" : "no review output — orchestrator may have exited early"; enqueueRemoteReviewFailureNotification(taskId, reason, context.setAppState); evictTaskOutput(taskId); removeRemoteAgentMetadata(taskId); @@ -470564,8 +394175,8 @@ function startRemoteSessionPolling(taskId, context) { removeRemoteAgentMetadata(taskId); return; } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); consecutiveIdlePolls = 0; try { const appState = context.getAppState(); @@ -470604,7 +394215,7 @@ var init_RemoteAgentTask = __esm(() => { init_debug(); init_log3(); init_messageQueueManager(); - init_messages5(); + init_messages3(); init_sdkEventQueue(); init_sessionStorage(); init_slowOperations(); @@ -470782,7 +394393,7 @@ function renderToolUseRejectedMessage2(_input, { ] }, undefined, true, undefined, this); } -function renderToolUseErrorMessage2(result3, { +function renderToolUseErrorMessage2(result2, { progressMessagesForMessage, tools, verbose @@ -470794,7 +394405,7 @@ function renderToolUseErrorMessage2(result3, { verbose }), /* @__PURE__ */ jsx_dev_runtime114.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this) ] @@ -470809,7 +394420,7 @@ var init_UI2 = __esm(() => { init_Message(); init_MessageResponse(); init_ink2(); - init_messages5(); + init_messages3(); init_stringUtils(); jsx_dev_runtime114 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -470818,9 +394429,9 @@ var init_UI2 = __esm(() => { var exports_remoteSkillState = {}; __export(exports_remoteSkillState, { default: () => remoteSkillState_default, - __stub__: () => __stub__16 + __stub__: () => __stub__22 }); -var remoteSkillState_default, __stub__16 = true; +var remoteSkillState_default, __stub__22 = true; var init_remoteSkillState = __esm(() => { remoteSkillState_default = {}; }); @@ -470829,9 +394440,9 @@ var init_remoteSkillState = __esm(() => { var exports_remoteSkillLoader = {}; __export(exports_remoteSkillLoader, { default: () => remoteSkillLoader_default, - __stub__: () => __stub__17 + __stub__: () => __stub__23 }); -var remoteSkillLoader_default, __stub__17 = true; +var remoteSkillLoader_default, __stub__23 = true; var init_remoteSkillLoader = __esm(() => { remoteSkillLoader_default = {}; }); @@ -470840,9 +394451,9 @@ var init_remoteSkillLoader = __esm(() => { var exports_telemetry = {}; __export(exports_telemetry, { default: () => telemetry_default, - __stub__: () => __stub__18 + __stub__: () => __stub__24 }); -var telemetry_default, __stub__18 = true; +var telemetry_default, __stub__24 = true; var init_telemetry = __esm(() => { telemetry_default = {}; }); @@ -470851,15 +394462,15 @@ var init_telemetry = __esm(() => { var exports_featureCheck = {}; __export(exports_featureCheck, { default: () => featureCheck_default, - __stub__: () => __stub__19 + __stub__: () => __stub__25 }); -var featureCheck_default, __stub__19 = true; +var featureCheck_default, __stub__25 = true; var init_featureCheck = __esm(() => { featureCheck_default = {}; }); // src/tools/SkillTool/SkillTool.ts -import { dirname as dirname33 } from "path"; +import { dirname as dirname30 } from "path"; async function getAllCommands(context) { const mcpSkills = context.getAppState().mcp.commands.filter((cmd) => cmd.type === "prompt" && cmd.loadedFrom === "mcp"); if (mcpSkills.length === 0) @@ -471063,7 +394674,7 @@ async function executeRemoteSkill(slug, commandName, parentMessage, context) { recordSkillUsage(commandName); logForDebugging(`SkillTool loaded remote skill ${slug} (cacheHit=${cacheHit}, ${latencyMs}ms, ${content.length} chars)`); const { content: bodyContent } = parseFrontmatter(content, skillPath); - const skillDir = dirname33(skillPath); + const skillDir = dirname30(skillPath); const normalizedDir = process.platform === "win32" ? skillDir.replace(/\\/g, "/") : skillDir; let finalContent = `Base directory for this skill: ${normalizedDir} @@ -471096,10 +394707,10 @@ var init_SkillTool = __esm(() => { init_errors(); init_forkedAgent(); init_frontmatterParser(); - init_messages5(); + init_messages3(); init_model(); init_skillUsageTracking(); - init_uuid2(); + init_uuid(); init_runAgent(); init_prompt7(); init_UI2(); @@ -471429,21 +395040,21 @@ var init_SkillTool = __esm(() => { } }; }, - mapToolResultToToolResultBlockParam(result3, toolUseID) { - if ("status" in result3 && result3.status === "forked") { + mapToolResultToToolResultBlockParam(result2, toolUseID) { + if ("status" in result2 && result2.status === "forked") { return { type: "tool_result", tool_use_id: toolUseID, - content: `Skill "${result3.commandName}" completed (forked execution). + content: `Skill "${result2.commandName}" completed (forked execution). Result: -${result3.result}` +${result2.result}` }; } return { type: "tool_result", tool_use_id: toolUseID, - content: `Launching skill: ${result3.commandName}` + content: `Launching skill: ${result2.commandName}` }; }, renderToolResultMessage: renderToolResultMessage2, @@ -471490,13 +395101,13 @@ ${result3.result}` import { randomUUID as randomUUID17 } from "crypto"; function registerPendingLSPDiagnostic({ serverName, - files: files2 + files }) { const diagnosticId = randomUUID17(); - logForDebugging(`LSP Diagnostics: Registering ${files2.length} diagnostic file(s) from ${serverName} (ID: ${diagnosticId})`); + logForDebugging(`LSP Diagnostics: Registering ${files.length} diagnostic file(s) from ${serverName} (ID: ${diagnosticId})`); pendingDiagnostics.set(diagnosticId, { serverName, - files: files2, + files, timestamp: Date.now(), attachmentSent: false }); @@ -471543,10 +395154,10 @@ function deduplicateDiagnosticFiles(allFiles) { } seenDiagnostics.add(key); dedupedFile.diagnostics.push(diag2); - } catch (error45) { - const err3 = toError(error45); + } catch (error41) { + const err2 = toError(error41); const truncatedMessage = diag2.message?.substring(0, 100) || ""; - logError2(new Error(`Failed to deduplicate diagnostic in ${file2.uri}: ${err3.message}. ` + `Diagnostic message: ${truncatedMessage}`)); + logError2(new Error(`Failed to deduplicate diagnostic in ${file2.uri}: ${err2.message}. ` + `Diagnostic message: ${truncatedMessage}`)); dedupedFile.diagnostics.push(diag2); } } @@ -471571,9 +395182,9 @@ function checkForLSPDiagnostics() { let dedupedFiles; try { dedupedFiles = deduplicateDiagnosticFiles(allFiles); - } catch (error45) { - const err3 = toError(error45); - logError2(new Error(`Failed to deduplicate LSP diagnostics: ${err3.message}`)); + } catch (error41) { + const err2 = toError(error41); + logError2(new Error(`Failed to deduplicate LSP diagnostics: ${err2.message}`)); dedupedFiles = allFiles; } for (const diagnostic of diagnosticsToMark) { @@ -471584,8 +395195,8 @@ function checkForLSPDiagnostics() { pendingDiagnostics.delete(id); } } - const originalCount = allFiles.reduce((sum3, f) => sum3 + f.diagnostics.length, 0); - const dedupedCount = dedupedFiles.reduce((sum3, f) => sum3 + f.diagnostics.length, 0); + const originalCount = allFiles.reduce((sum2, f) => sum2 + f.diagnostics.length, 0); + const dedupedCount = dedupedFiles.reduce((sum2, f) => sum2 + f.diagnostics.length, 0); if (originalCount > dedupedCount) { logForDebugging(`LSP Diagnostics: Deduplication removed ${originalCount - dedupedCount} duplicate diagnostic(s)`); } @@ -471616,14 +395227,14 @@ function checkForLSPDiagnostics() { for (const diag2 of file2.diagnostics) { try { delivered.add(createDiagnosticKey(diag2)); - } catch (error45) { - const err3 = toError(error45); + } catch (error41) { + const err2 = toError(error41); const truncatedMessage = diag2.message?.substring(0, 100) || ""; - logError2(new Error(`Failed to track delivered diagnostic in ${file2.uri}: ${err3.message}. ` + `Diagnostic message: ${truncatedMessage}`)); + logError2(new Error(`Failed to track delivered diagnostic in ${file2.uri}: ${err2.message}. ` + `Diagnostic message: ${truncatedMessage}`)); } } } - const finalCount = dedupedFiles.reduce((sum3, f) => sum3 + f.diagnostics.length, 0); + const finalCount = dedupedFiles.reduce((sum2, f) => sum2 + f.diagnostics.length, 0); if (finalCount === 0) { logForDebugging(`LSP Diagnostics: No new diagnostics to deliver (all filtered by deduplication)`); return []; @@ -471665,59 +395276,59 @@ var init_LSPDiagnosticRegistry = __esm(() => { }); // src/utils/plugins/lspPluginIntegration.ts -import { readFile as readFile23 } from "fs/promises"; -import { join as join89, relative as relative13, resolve as resolve28 } from "path"; +import { readFile as readFile22 } from "fs/promises"; +import { join as join79, relative as relative11, resolve as resolve22 } from "path"; function validatePathWithinPlugin(pluginPath, relativePath) { - const resolvedPluginPath = resolve28(pluginPath); - const resolvedFilePath = resolve28(pluginPath, relativePath); - const rel = relative13(resolvedPluginPath, resolvedFilePath); - if (rel.startsWith("..") || resolve28(rel) === rel) { + const resolvedPluginPath = resolve22(pluginPath); + const resolvedFilePath = resolve22(pluginPath, relativePath); + const rel = relative11(resolvedPluginPath, resolvedFilePath); + if (rel.startsWith("..") || resolve22(rel) === rel) { return null; } return resolvedFilePath; } -async function loadPluginLspServers(plugin, errors5 = []) { +async function loadPluginLspServers(plugin, errors4 = []) { const servers = {}; - const lspJsonPath = join89(plugin.path, ".lsp.json"); + const lspJsonPath = join79(plugin.path, ".lsp.json"); try { - const content = await readFile23(lspJsonPath, "utf-8"); + const content = await readFile22(lspJsonPath, "utf-8"); const parsed = jsonParse(content); - const result3 = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed); - if (result3.success) { - Object.assign(servers, result3.data); + const result2 = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed); + if (result2.success) { + Object.assign(servers, result2.data); } else { - const errorMsg = `LSP config validation failed for .lsp.json in plugin ${plugin.name}: ${result3.error.message}`; + const errorMsg = `LSP config validation failed for .lsp.json in plugin ${plugin.name}: ${result2.error.message}`; logError2(new Error(errorMsg)); - errors5.push({ + errors4.push({ type: "lsp-config-invalid", plugin: plugin.name, serverName: ".lsp.json", - validationError: result3.error.message, + validationError: result2.error.message, source: "plugin" }); } - } catch (error45) { - if (!isENOENT(error45)) { - const _errorMsg = error45 instanceof Error ? `Failed to read/parse .lsp.json in plugin ${plugin.name}: ${error45.message}` : `Failed to read/parse .lsp.json file in plugin ${plugin.name}`; - logError2(toError(error45)); - errors5.push({ + } catch (error41) { + if (!isENOENT(error41)) { + const _errorMsg = error41 instanceof Error ? `Failed to read/parse .lsp.json in plugin ${plugin.name}: ${error41.message}` : `Failed to read/parse .lsp.json file in plugin ${plugin.name}`; + logError2(toError(error41)); + errors4.push({ type: "lsp-config-invalid", plugin: plugin.name, serverName: ".lsp.json", - validationError: error45 instanceof Error ? `Failed to parse JSON: ${error45.message}` : "Failed to parse JSON file", + validationError: error41 instanceof Error ? `Failed to parse JSON: ${error41.message}` : "Failed to parse JSON file", source: "plugin" }); } } if (plugin.manifest.lspServers) { - const manifestServers = await loadLspServersFromManifest(plugin.manifest.lspServers, plugin.path, plugin.name, errors5); + const manifestServers = await loadLspServersFromManifest(plugin.manifest.lspServers, plugin.path, plugin.name, errors4); if (manifestServers) { Object.assign(servers, manifestServers); } } return Object.keys(servers).length > 0 ? servers : undefined; } -async function loadLspServersFromManifest(declaration, pluginPath, pluginName, errors5) { +async function loadLspServersFromManifest(declaration, pluginPath, pluginName, errors4) { const servers = {}; const declarations = Array.isArray(declaration) ? declaration : [declaration]; for (const decl of declarations) { @@ -471727,7 +395338,7 @@ async function loadLspServersFromManifest(declaration, pluginPath, pluginName, e const securityMsg = `Security: Path traversal attempt blocked in plugin ${pluginName}: ${decl}`; logError2(new Error(securityMsg)); logForDebugging(securityMsg, { level: "warn" }); - errors5.push({ + errors4.push({ type: "lsp-config-invalid", plugin: pluginName, serverName: decl, @@ -471737,46 +395348,46 @@ async function loadLspServersFromManifest(declaration, pluginPath, pluginName, e continue; } try { - const content = await readFile23(validatedPath, "utf-8"); + const content = await readFile22(validatedPath, "utf-8"); const parsed = jsonParse(content); - const result3 = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed); - if (result3.success) { - Object.assign(servers, result3.data); + const result2 = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed); + if (result2.success) { + Object.assign(servers, result2.data); } else { - const errorMsg = `LSP config validation failed for ${decl} in plugin ${pluginName}: ${result3.error.message}`; + const errorMsg = `LSP config validation failed for ${decl} in plugin ${pluginName}: ${result2.error.message}`; logError2(new Error(errorMsg)); - errors5.push({ + errors4.push({ type: "lsp-config-invalid", plugin: pluginName, serverName: decl, - validationError: result3.error.message, + validationError: result2.error.message, source: "plugin" }); } - } catch (error45) { - const _errorMsg = error45 instanceof Error ? `Failed to read/parse LSP config from ${decl} in plugin ${pluginName}: ${error45.message}` : `Failed to read/parse LSP config file ${decl} in plugin ${pluginName}`; - logError2(toError(error45)); - errors5.push({ + } catch (error41) { + const _errorMsg = error41 instanceof Error ? `Failed to read/parse LSP config from ${decl} in plugin ${pluginName}: ${error41.message}` : `Failed to read/parse LSP config file ${decl} in plugin ${pluginName}`; + logError2(toError(error41)); + errors4.push({ type: "lsp-config-invalid", plugin: pluginName, serverName: decl, - validationError: error45 instanceof Error ? `Failed to parse JSON: ${error45.message}` : "Failed to parse JSON file", + validationError: error41 instanceof Error ? `Failed to parse JSON: ${error41.message}` : "Failed to parse JSON file", source: "plugin" }); } } else { - for (const [serverName, config4] of Object.entries(decl)) { - const result3 = LspServerConfigSchema().safeParse(config4); - if (result3.success) { - servers[serverName] = result3.data; + for (const [serverName, config2] of Object.entries(decl)) { + const result2 = LspServerConfigSchema().safeParse(config2); + if (result2.success) { + servers[serverName] = result2.data; } else { - const errorMsg = `LSP config validation failed for inline server "${serverName}" in plugin ${pluginName}: ${result3.error.message}`; + const errorMsg = `LSP config validation failed for inline server "${serverName}" in plugin ${pluginName}: ${result2.error.message}`; logError2(new Error(errorMsg)); - errors5.push({ + errors4.push({ type: "lsp-config-invalid", plugin: pluginName, serverName, - validationError: result3.error.message, + validationError: result2.error.message, source: "plugin" }); } @@ -471785,7 +395396,7 @@ async function loadLspServersFromManifest(declaration, pluginPath, pluginName, e } return Object.keys(servers).length > 0 ? servers : undefined; } -function resolvePluginLspEnvironment(config4, plugin, userConfig, _errors) { +function resolvePluginLspEnvironment(config2, plugin, userConfig, _errors) { const allMissingVars = []; const resolveValue2 = (value) => { let resolved2 = substitutePluginVariables(value, plugin); @@ -471796,7 +395407,7 @@ function resolvePluginLspEnvironment(config4, plugin, userConfig, _errors) { allMissingVars.push(...missingVars); return expanded; }; - const resolved = { ...config4 }; + const resolved = { ...config2 }; if (resolved.command) { resolved.command = resolveValue2(resolved.command); } @@ -471827,28 +395438,28 @@ function resolvePluginLspEnvironment(config4, plugin, userConfig, _errors) { } function addPluginScopeToLspServers(servers, pluginName) { const scopedServers = {}; - for (const [name, config4] of Object.entries(servers)) { + for (const [name, config2] of Object.entries(servers)) { const scopedName = `plugin:${pluginName}:${name}`; scopedServers[scopedName] = { - ...config4, + ...config2, scope: "dynamic", source: pluginName }; } return scopedServers; } -async function getPluginLspServers(plugin, errors5 = []) { +async function getPluginLspServers(plugin, errors4 = []) { if (!plugin.enabled) { return; } - const servers = plugin.lspServers || await loadPluginLspServers(plugin, errors5); + const servers = plugin.lspServers || await loadPluginLspServers(plugin, errors4); if (!servers) { return; } const userConfig = plugin.manifest.userConfig ? loadPluginOptions(getPluginStorageId(plugin)) : undefined; const resolvedServers = {}; - for (const [name, config4] of Object.entries(servers)) { - resolvedServers[name] = resolvePluginLspEnvironment(config4, plugin, userConfig, errors5); + for (const [name, config2] of Object.entries(servers)) { + resolvedServers[name] = resolvePluginLspEnvironment(config2, plugin, userConfig, errors4); } return addPluginScopeToLspServers(resolvedServers, plugin.name); } @@ -471869,29 +395480,29 @@ async function getAllLspServers() { try { const { enabled: plugins } = await loadAllPluginsCacheOnly(); const results = await Promise.all(plugins.map(async (plugin) => { - const errors5 = []; + const errors4 = []; try { - const scopedServers = await getPluginLspServers(plugin, errors5); - return { plugin, scopedServers, errors: errors5 }; + const scopedServers = await getPluginLspServers(plugin, errors4); + return { plugin, scopedServers, errors: errors4 }; } catch (e) { logForDebugging(`Failed to load LSP servers for plugin ${plugin.name}: ${e}`, { level: "error" }); - return { plugin, scopedServers: undefined, errors: errors5 }; + return { plugin, scopedServers: undefined, errors: errors4 }; } })); - for (const { plugin, scopedServers, errors: errors5 } of results) { + for (const { plugin, scopedServers, errors: errors4 } of results) { const serverCount = scopedServers ? Object.keys(scopedServers).length : 0; if (serverCount > 0) { Object.assign(allServers, scopedServers); logForDebugging(`Loaded ${serverCount} LSP server(s) from plugin: ${plugin.name}`); } - if (errors5.length > 0) { - logForDebugging(`${errors5.length} error(s) loading LSP servers from plugin: ${plugin.name}`); + if (errors4.length > 0) { + logForDebugging(`${errors4.length} error(s) loading LSP servers from plugin: ${plugin.name}`); } } logForDebugging(`Total LSP servers loaded: ${Object.keys(allServers).length}`); - } catch (error45) { - logError2(toError(error45)); - logForDebugging(`Error loading LSP servers: ${errorMessage(error45)}`); + } catch (error41) { + logError2(toError(error41)); + logForDebugging(`Error loading LSP servers: ${errorMessage(error41)}`); } return { servers: allServers @@ -471921,10 +395532,10 @@ var require_is = __commonJS((exports) => { return typeof value === "number" || value instanceof Number; } exports.number = number5; - function error45(value) { + function error41(value) { return value instanceof Error; } - exports.error = error45; + exports.error = error41; function func(value) { return typeof value === "function"; } @@ -471971,14 +395582,14 @@ var require_messages = __commonJS((exports) => { Object.setPrototypeOf(this, ResponseError.prototype); } toJson() { - const result3 = { + const result2 = { code: this.code, message: this.message }; if (this.data !== undefined) { - result3.data = this.data; + result2.data = this.data; } - return result3; + return result2; } } exports.ResponseError = ResponseError; @@ -472000,8 +395611,8 @@ var require_messages = __commonJS((exports) => { ParameterStructures.byName = new ParameterStructures("byName"); class AbstractMessageSignature { - constructor(method3, numberOfParams) { - this.method = method3; + constructor(method2, numberOfParams) { + this.method = method2; this.numberOfParams = numberOfParams; } get parameterStructures() { @@ -472011,15 +395622,15 @@ var require_messages = __commonJS((exports) => { exports.AbstractMessageSignature = AbstractMessageSignature; class RequestType0 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 0); + constructor(method2) { + super(method2, 0); } } exports.RequestType0 = RequestType0; class RequestType extends AbstractMessageSignature { - constructor(method3, _parameterStructures = ParameterStructures.auto) { - super(method3, 1); + constructor(method2, _parameterStructures = ParameterStructures.auto) { + super(method2, 1); this._parameterStructures = _parameterStructures; } get parameterStructures() { @@ -472029,8 +395640,8 @@ var require_messages = __commonJS((exports) => { exports.RequestType = RequestType; class RequestType1 extends AbstractMessageSignature { - constructor(method3, _parameterStructures = ParameterStructures.auto) { - super(method3, 1); + constructor(method2, _parameterStructures = ParameterStructures.auto) { + super(method2, 1); this._parameterStructures = _parameterStructures; } get parameterStructures() { @@ -472040,64 +395651,64 @@ var require_messages = __commonJS((exports) => { exports.RequestType1 = RequestType1; class RequestType2 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 2); + constructor(method2) { + super(method2, 2); } } exports.RequestType2 = RequestType2; class RequestType3 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 3); + constructor(method2) { + super(method2, 3); } } exports.RequestType3 = RequestType3; class RequestType4 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 4); + constructor(method2) { + super(method2, 4); } } exports.RequestType4 = RequestType4; class RequestType5 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 5); + constructor(method2) { + super(method2, 5); } } exports.RequestType5 = RequestType5; class RequestType6 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 6); + constructor(method2) { + super(method2, 6); } } exports.RequestType6 = RequestType6; class RequestType7 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 7); + constructor(method2) { + super(method2, 7); } } exports.RequestType7 = RequestType7; class RequestType8 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 8); + constructor(method2) { + super(method2, 8); } } exports.RequestType8 = RequestType8; class RequestType9 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 9); + constructor(method2) { + super(method2, 9); } } exports.RequestType9 = RequestType9; class NotificationType extends AbstractMessageSignature { - constructor(method3, _parameterStructures = ParameterStructures.auto) { - super(method3, 1); + constructor(method2, _parameterStructures = ParameterStructures.auto) { + super(method2, 1); this._parameterStructures = _parameterStructures; } get parameterStructures() { @@ -472107,15 +395718,15 @@ var require_messages = __commonJS((exports) => { exports.NotificationType = NotificationType; class NotificationType0 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 0); + constructor(method2) { + super(method2, 0); } } exports.NotificationType0 = NotificationType0; class NotificationType1 extends AbstractMessageSignature { - constructor(method3, _parameterStructures = ParameterStructures.auto) { - super(method3, 1); + constructor(method2, _parameterStructures = ParameterStructures.auto) { + super(method2, 1); this._parameterStructures = _parameterStructures; } get parameterStructures() { @@ -472125,57 +395736,57 @@ var require_messages = __commonJS((exports) => { exports.NotificationType1 = NotificationType1; class NotificationType2 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 2); + constructor(method2) { + super(method2, 2); } } exports.NotificationType2 = NotificationType2; class NotificationType3 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 3); + constructor(method2) { + super(method2, 3); } } exports.NotificationType3 = NotificationType3; class NotificationType4 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 4); + constructor(method2) { + super(method2, 4); } } exports.NotificationType4 = NotificationType4; class NotificationType5 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 5); + constructor(method2) { + super(method2, 5); } } exports.NotificationType5 = NotificationType5; class NotificationType6 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 6); + constructor(method2) { + super(method2, 6); } } exports.NotificationType6 = NotificationType6; class NotificationType7 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 7); + constructor(method2) { + super(method2, 7); } } exports.NotificationType7 = NotificationType7; class NotificationType8 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 8); + constructor(method2) { + super(method2, 8); } } exports.NotificationType8 = NotificationType8; class NotificationType9 extends AbstractMessageSignature { - constructor(method3) { - super(method3, 9); + constructor(method2) { + super(method2, 9); } } exports.NotificationType9 = NotificationType9; @@ -472201,7 +395812,7 @@ var require_messages = __commonJS((exports) => { // node_modules/vscode-jsonrpc/lib/common/linkedMap.js var require_linkedMap = __commonJS((exports) => { - var _a5; + var _a3; Object.defineProperty(exports, "__esModule", { value: true }); exports.LRUCache = exports.LinkedMap = exports.Touch = undefined; var Touch; @@ -472215,7 +395826,7 @@ var require_linkedMap = __commonJS((exports) => { class LinkedMap { constructor() { - this[_a5] = "LinkedMap"; + this[_a3] = "LinkedMap"; this._map = new Map; this._head = undefined; this._tail = undefined; @@ -472335,9 +395946,9 @@ var require_linkedMap = __commonJS((exports) => { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { - const result3 = { value: current.key, done: false }; + const result2 = { value: current.key, done: false }; current = current.next; - return result3; + return result2; } else { return { value: undefined, done: true }; } @@ -472357,9 +395968,9 @@ var require_linkedMap = __commonJS((exports) => { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { - const result3 = { value: current.value, done: false }; + const result2 = { value: current.value, done: false }; current = current.next; - return result3; + return result2; } else { return { value: undefined, done: true }; } @@ -472379,9 +395990,9 @@ var require_linkedMap = __commonJS((exports) => { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { - const result3 = { value: [current.key, current.value], done: false }; + const result2 = { value: [current.key, current.value], done: false }; current = current.next; - return result3; + return result2; } else { return { value: undefined, done: true }; } @@ -472389,7 +396000,7 @@ var require_linkedMap = __commonJS((exports) => { }; return iterator2; } - [(_a5 = Symbol.toStringTag, Symbol.iterator)]() { + [(_a3 = Symbol.toStringTag, Symbol.iterator)]() { return this.entries(); } trimOld(newSize) { @@ -472574,12 +396185,12 @@ var require_disposable = __commonJS((exports) => { exports.Disposable = undefined; var Disposable; (function(Disposable2) { - function create3(func) { + function create2(func) { return { dispose: func }; } - Disposable2.create = create3; + Disposable2.create = create2; })(Disposable || (exports.Disposable = Disposable = {})); }); @@ -472635,11 +396246,11 @@ var require_events2 = __commonJS((exports) => { return; } let foundCallbackWithDifferentContext = false; - for (let i4 = 0, len = this._callbacks.length;i4 < len; i4++) { - if (this._callbacks[i4] === callback) { - if (this._contexts[i4] === context) { - this._callbacks.splice(i4, 1); - this._contexts.splice(i4, 1); + for (let i3 = 0, len = this._callbacks.length;i3 < len; i3++) { + if (this._callbacks[i3] === callback) { + if (this._contexts[i3] === context) { + this._callbacks.splice(i3, 1); + this._contexts.splice(i3, 1); return; } else { foundCallbackWithDifferentContext = true; @@ -472655,9 +396266,9 @@ var require_events2 = __commonJS((exports) => { return []; } const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0); - for (let i4 = 0, len = callbacks.length;i4 < len; i4++) { + for (let i3 = 0, len = callbacks.length;i3 < len; i3++) { try { - ret.push(callbacks[i4].apply(contexts[i4], args)); + ret.push(callbacks[i3].apply(contexts[i3], args)); } catch (e) { (0, ral_1.default)().console.error(e); } @@ -472687,22 +396298,22 @@ var require_events2 = __commonJS((exports) => { this._options.onFirstListenerAdd(this); } this._callbacks.add(listener2, thisArgs); - const result3 = { + const result2 = { dispose: () => { if (!this._callbacks) { return; } this._callbacks.remove(listener2, thisArgs); - result3.dispose = Emitter2._noop; + result2.dispose = Emitter2._noop; if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) { this._options.onLastListenerRemove(this); } } }; if (Array.isArray(disposables)) { - disposables.push(result3); + disposables.push(result2); } - return result3; + return result2; }; } return this._event; @@ -472904,8 +396515,8 @@ var require_semaphore = __commonJS((exports) => { this._waiting = []; } lock(thunk) { - return new Promise((resolve29, reject3) => { - this._waiting.push({ thunk, resolve: resolve29, reject: reject3 }); + return new Promise((resolve23, reject2) => { + this._waiting.push({ thunk, resolve: resolve23, reject: reject2 }); this.runNext(); }); } @@ -472928,25 +396539,25 @@ var require_semaphore = __commonJS((exports) => { throw new Error(`To many thunks active`); } try { - const result3 = next.thunk(); - if (result3 instanceof Promise) { - result3.then((value) => { + const result2 = next.thunk(); + if (result2 instanceof Promise) { + result2.then((value) => { this._active--; next.resolve(value); this.runNext(); - }, (err3) => { + }, (err2) => { this._active--; - next.reject(err3); + next.reject(err2); this.runNext(); }); } else { this._active--; - next.resolve(result3); + next.resolve(result2); this.runNext(); } - } catch (err3) { + } catch (err2) { this._active--; - next.reject(err3); + next.reject(err2); this.runNext(); } } @@ -472984,8 +396595,8 @@ var require_messageReader = __commonJS((exports) => { get onError() { return this.errorEmitter.event; } - fireError(error45) { - this.errorEmitter.fire(this.asError(error45)); + fireError(error41) { + this.errorEmitter.fire(this.asError(error41)); } get onClose() { return this.closeEmitter.event; @@ -472999,11 +396610,11 @@ var require_messageReader = __commonJS((exports) => { firePartialMessage(info) { this.partialMessageEmitter.fire(info); } - asError(error45) { - if (error45 instanceof Error) { - return error45; + asError(error41) { + if (error41 instanceof Error) { + return error41; } else { - return new Error(`Reader received error. Reason: ${Is.string(error45.message) ? error45.message : "unknown"}`); + return new Error(`Reader received error. Reason: ${Is.string(error41.message) ? error41.message : "unknown"}`); } } } @@ -473012,7 +396623,7 @@ var require_messageReader = __commonJS((exports) => { (function(ResolvedMessageReaderOptions2) { function fromOptions(options2) { let charset; - let result3; + let result2; let contentDecoder; const contentDecoders = new Map; let contentTypeDecoder; @@ -473071,12 +396682,12 @@ var require_messageReader = __commonJS((exports) => { this.messageToken = 0; this.partialMessageTimer = undefined; this.callback = callback; - const result3 = this.readable.onData((data) => { + const result2 = this.readable.onData((data) => { this.onData(data); }); - this.readable.onError((error45) => this.fireError(error45)); + this.readable.onError((error41) => this.fireError(error41)); this.readable.onClose(() => this.fireClose()); - return result3; + return result2; } onData(data) { try { @@ -473111,12 +396722,12 @@ ${JSON.stringify(Object.fromEntries(headers))}`)); const bytes = this.options.contentDecoder !== undefined ? await this.options.contentDecoder.decode(body) : body; const message = await this.options.contentTypeDecoder.decode(bytes, this.options); this.callback(message); - }).catch((error45) => { - this.fireError(error45); + }).catch((error41) => { + this.fireError(error41); }); } - } catch (error45) { - this.fireError(error45); + } catch (error41) { + this.fireError(error41); } } clearPartialMessageTimer() { @@ -473174,8 +396785,8 @@ var require_messageWriter = __commonJS((exports) => { get onError() { return this.errorEmitter.event; } - fireError(error45, message, count3) { - this.errorEmitter.fire([this.asError(error45), message, count3]); + fireError(error41, message, count3) { + this.errorEmitter.fire([this.asError(error41), message, count3]); } get onClose() { return this.closeEmitter.event; @@ -473183,11 +396794,11 @@ var require_messageWriter = __commonJS((exports) => { fireClose() { this.closeEmitter.fire(undefined); } - asError(error45) { - if (error45 instanceof Error) { - return error45; + asError(error41) { + if (error41 instanceof Error) { + return error41; } else { - return new Error(`Writer received error. Reason: ${Is.string(error45.message) ? error45.message : "unknown"}`); + return new Error(`Writer received error. Reason: ${Is.string(error41.message) ? error41.message : "unknown"}`); } } } @@ -473211,7 +396822,7 @@ var require_messageWriter = __commonJS((exports) => { this.options = ResolvedMessageWriterOptions.fromOptions(options2); this.errorCount = 0; this.writeSemaphore = new semaphore_1.Semaphore(1); - this.writable.onError((error45) => this.fireError(error45)); + this.writable.onError((error41) => this.fireError(error41)); this.writable.onClose(() => this.fireClose()); } async write(msg) { @@ -473228,9 +396839,9 @@ var require_messageWriter = __commonJS((exports) => { headers.push(ContentLength, buffer.byteLength.toString(), CRLF2); headers.push(CRLF2); return this.doWrite(msg, headers, buffer); - }, (error45) => { - this.fireError(error45); - throw error45; + }, (error41) => { + this.fireError(error41); + throw error41; }); }); } @@ -473238,14 +396849,14 @@ var require_messageWriter = __commonJS((exports) => { try { await this.writable.write(headers.join(""), "ascii"); return this.writable.write(data); - } catch (error45) { - this.handleError(error45, msg); - return Promise.reject(error45); + } catch (error41) { + this.handleError(error41, msg); + return Promise.reject(error41); } } - handleError(error45, msg) { + handleError(error41, msg) { this.errorCount++; - this.fireError(error45, msg, this.errorCount); + this.fireError(error41, msg, this.errorCount); } end() { this.writable.end(); @@ -473272,8 +396883,8 @@ var require_messageBuffer = __commonJS((exports) => { get encoding() { return this._encoding; } - append(chunk3) { - const toAppend = typeof chunk3 === "string" ? this.fromString(chunk3, this._encoding) : chunk3; + append(chunk2) { + const toAppend = typeof chunk2 === "string" ? this.fromString(chunk2, this._encoding) : chunk2; this._chunks.push(toAppend); this._totalLength += toAppend.byteLength; } @@ -473287,11 +396898,11 @@ var require_messageBuffer = __commonJS((exports) => { let chunkBytesRead = 0; row: while (chunkIndex < this._chunks.length) { - const chunk3 = this._chunks[chunkIndex]; + const chunk2 = this._chunks[chunkIndex]; offset = 0; column: - while (offset < chunk3.length) { - const value = chunk3[offset]; + while (offset < chunk2.length) { + const value = chunk2[offset]; switch (value) { case CR2: switch (state) { @@ -473323,20 +396934,20 @@ var require_messageBuffer = __commonJS((exports) => { } offset++; } - chunkBytesRead += chunk3.byteLength; + chunkBytesRead += chunk2.byteLength; chunkIndex++; } if (state !== 4) { return; } const buffer = this._read(chunkBytesRead + offset); - const result3 = new Map; + const result2 = new Map; const headers = this.toString(buffer, "ascii").split(CRLF2); if (headers.length < 2) { - return result3; + return result2; } - for (let i4 = 0;i4 < headers.length - 2; i4++) { - const header = headers[i4]; + for (let i3 = 0;i3 < headers.length - 2; i3++) { + const header = headers[i3]; const index = header.indexOf(":"); if (index === -1) { throw new Error(`Message header must separate key and value using ':' @@ -473344,9 +396955,9 @@ ${header}`); } const key = header.substr(0, index); const value = header.substr(index + 1).trim(); - result3.set(lowerCaseKeys ? key.toLowerCase() : key, value); + result2.set(lowerCaseKeys ? key.toLowerCase() : key, value); } - return result3; + return result2; } tryReadBody(length) { if (this._totalLength < length) { @@ -473365,39 +396976,39 @@ ${header}`); throw new Error(`Cannot read so many bytes!`); } if (this._chunks[0].byteLength === byteCount) { - const chunk3 = this._chunks[0]; + const chunk2 = this._chunks[0]; this._chunks.shift(); this._totalLength -= byteCount; - return this.asNative(chunk3); + return this.asNative(chunk2); } if (this._chunks[0].byteLength > byteCount) { - const chunk3 = this._chunks[0]; - const result4 = this.asNative(chunk3, byteCount); - this._chunks[0] = chunk3.slice(byteCount); + const chunk2 = this._chunks[0]; + const result3 = this.asNative(chunk2, byteCount); + this._chunks[0] = chunk2.slice(byteCount); this._totalLength -= byteCount; - return result4; + return result3; } - const result3 = this.allocNative(byteCount); + const result2 = this.allocNative(byteCount); let resultOffset = 0; let chunkIndex = 0; while (byteCount > 0) { - const chunk3 = this._chunks[chunkIndex]; - if (chunk3.byteLength > byteCount) { - const chunkPart = chunk3.slice(0, byteCount); - result3.set(chunkPart, resultOffset); + const chunk2 = this._chunks[chunkIndex]; + if (chunk2.byteLength > byteCount) { + const chunkPart = chunk2.slice(0, byteCount); + result2.set(chunkPart, resultOffset); resultOffset += byteCount; - this._chunks[chunkIndex] = chunk3.slice(byteCount); + this._chunks[chunkIndex] = chunk2.slice(byteCount); this._totalLength -= byteCount; byteCount -= byteCount; } else { - result3.set(chunk3, resultOffset); - resultOffset += chunk3.byteLength; + result2.set(chunk2, resultOffset); + resultOffset += chunk2.byteLength; this._chunks.shift(); - this._totalLength -= chunk3.byteLength; - byteCount -= chunk3.byteLength; + this._totalLength -= chunk2.byteLength; + byteCount -= chunk2.byteLength; } } - return result3; + return result2; } } exports.AbstractMessageBuffer = AbstractMessageBuffer; @@ -473480,7 +397091,7 @@ var require_connection2 = __commonJS((exports) => { } } Trace2.fromString = fromString; - function toString7(value) { + function toString6(value) { switch (value) { case Trace2.Off: return "off"; @@ -473494,7 +397105,7 @@ var require_connection2 = __commonJS((exports) => { return "off"; } } - Trace2.toString = toString7; + Trace2.toString = toString6; })(Trace || (exports.Trace = Trace = {})); var TraceFormat; (function(TraceFormat2) { @@ -473692,8 +397303,8 @@ var require_connection2 = __commonJS((exports) => { closeEmitter.fire(undefined); } } - function readErrorHandler(error45) { - errorEmitter.fire([error45, undefined, undefined]); + function readErrorHandler(error41) { + errorEmitter.fire([error41, undefined, undefined]); } function writeErrorHandler(data) { errorEmitter.fire(data); @@ -473774,7 +397385,7 @@ var require_connection2 = __commonJS((exports) => { if (isDisposed()) { return; } - function reply(resultOrError, method3, startTime2) { + function reply(resultOrError, method2, startTime2) { const message = { jsonrpc: version2, id: requestMessage.id @@ -473784,28 +397395,28 @@ var require_connection2 = __commonJS((exports) => { } else { message.result = resultOrError === undefined ? null : resultOrError; } - traceSendingResponse(message, method3, startTime2); + traceSendingResponse(message, method2, startTime2); messageWriter.write(message).catch(() => logger.error(`Sending response failed.`)); } - function replyError(error45, method3, startTime2) { + function replyError(error41, method2, startTime2) { const message = { jsonrpc: version2, id: requestMessage.id, - error: error45.toJson() + error: error41.toJson() }; - traceSendingResponse(message, method3, startTime2); + traceSendingResponse(message, method2, startTime2); messageWriter.write(message).catch(() => logger.error(`Sending response failed.`)); } - function replySuccess(result3, method3, startTime2) { - if (result3 === undefined) { - result3 = null; + function replySuccess(result2, method2, startTime2) { + if (result2 === undefined) { + result2 = null; } const message = { jsonrpc: version2, id: requestMessage.id, - result: result3 + result: result2 }; - traceSendingResponse(message, method3, startTime2); + traceSendingResponse(message, method2, startTime2); messageWriter.write(message).catch(() => logger.error(`Sending response failed.`)); } traceReceivedRequest(requestMessage); @@ -473859,12 +397470,12 @@ var require_connection2 = __commonJS((exports) => { promise3.then((resultOrError) => { requestTokens.delete(tokenKey); reply(resultOrError, requestMessage.method, startTime); - }, (error45) => { + }, (error41) => { requestTokens.delete(tokenKey); - if (error45 instanceof messages_1.ResponseError) { - replyError(error45, requestMessage.method, startTime); - } else if (error45 && Is.string(error45.message)) { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error45.message}`), requestMessage.method, startTime); + if (error41 instanceof messages_1.ResponseError) { + replyError(error41, requestMessage.method, startTime); + } else if (error41 && Is.string(error41.message)) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error41.message}`), requestMessage.method, startTime); } else { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); } @@ -473873,12 +397484,12 @@ var require_connection2 = __commonJS((exports) => { requestTokens.delete(tokenKey); reply(handlerResult, requestMessage.method, startTime); } - } catch (error45) { + } catch (error41) { requestTokens.delete(tokenKey); - if (error45 instanceof messages_1.ResponseError) { - reply(error45, requestMessage.method, startTime); - } else if (error45 && Is.string(error45.message)) { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error45.message}`), requestMessage.method, startTime); + if (error41 instanceof messages_1.ResponseError) { + reply(error41, requestMessage.method, startTime); + } else if (error41 && Is.string(error41.message)) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error41.message}`), requestMessage.method, startTime); } else { replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); } @@ -473906,16 +397517,16 @@ ${JSON.stringify(responseMessage.error, undefined, 4)}`); responsePromises.delete(key); try { if (responseMessage.error) { - const error45 = responseMessage.error; - responsePromise.reject(new messages_1.ResponseError(error45.code, error45.message, error45.data)); + const error41 = responseMessage.error; + responsePromise.reject(new messages_1.ResponseError(error41.code, error41.message, error41.data)); } else if (responseMessage.result !== undefined) { responsePromise.resolve(responseMessage.result); } else { throw new Error("Should never happen."); } - } catch (error45) { - if (error45.message) { - logger.error(`Response handler '${responsePromise.method}' failed with message: ${error45.message}`); + } catch (error41) { + if (error41.message) { + logger.error(`Response handler '${responsePromise.method}' failed with message: ${error41.message}`); } else { logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`); } @@ -473976,9 +397587,9 @@ ${JSON.stringify(responseMessage.error, undefined, 4)}`); } else if (starNotificationHandler) { starNotificationHandler(message.method, message.params); } - } catch (error45) { - if (error45.message) { - logger.error(`Notification handler '${message.method}' failed with message: ${error45.message}`); + } catch (error41) { + if (error41.message) { + logger.error(`Notification handler '${message.method}' failed with message: ${error41.message}`); } else { logger.error(`Notification handler '${message.method}' failed unexpectedly.`); } @@ -474054,7 +397665,7 @@ ${JSON.stringify(message, null, 4)}`); logLSPMessage("send-notification", message); } } - function traceSendingResponse(message, method3, startTime) { + function traceSendingResponse(message, method2, startTime) { if (trace3 === Trace.Off || !tracer) { return; } @@ -474077,7 +397688,7 @@ ${JSON.stringify(message, null, 4)}`); } } } - tracer.log(`Sending response '${method3} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data); + tracer.log(`Sending response '${method2} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data); } else { logLSPMessage("send-response", message); } @@ -474144,8 +397755,8 @@ ${JSON.stringify(message, null, 4)}`); } } if (responsePromise) { - const error45 = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : ""; - tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error45}`, data); + const error41 = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : ""; + tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error41}`, data); } else { tracer.log(`Received response ${message.id} without active response promise.`, data); } @@ -474220,36 +397831,36 @@ ${JSON.stringify(message, null, 4)}`); } } function computeMessageParams(type, params) { - let result3; + let result2; const numberOfParams = type.numberOfParams; switch (numberOfParams) { case 0: - result3 = undefined; + result2 = undefined; break; case 1: - result3 = computeSingleParam(type.parameterStructures, params[0]); + result2 = computeSingleParam(type.parameterStructures, params[0]); break; default: - result3 = []; - for (let i4 = 0;i4 < params.length && i4 < numberOfParams; i4++) { - result3.push(undefinedToNull(params[i4])); + result2 = []; + for (let i3 = 0;i3 < params.length && i3 < numberOfParams; i3++) { + result2.push(undefinedToNull(params[i3])); } if (params.length < numberOfParams) { - for (let i4 = params.length;i4 < numberOfParams; i4++) { - result3.push(null); + for (let i3 = params.length;i3 < numberOfParams; i3++) { + result2.push(null); } } break; } - return result3; + return result2; } const connection = { sendNotification: (type, ...args) => { throwIfClosedOrDisposed(); - let method3; + let method2; let messageParams; if (Is.string(type)) { - method3 = type; + method2 = type; const first = args[0]; let paramStart = 0; let parameterStructures = messages_1.ParameterStructures.auto; @@ -474275,49 +397886,49 @@ ${JSON.stringify(message, null, 4)}`); } } else { const params = args; - method3 = type.method; + method2 = type.method; messageParams = computeMessageParams(type, params); } const notificationMessage = { jsonrpc: version2, - method: method3, + method: method2, params: messageParams }; traceSendingNotification(notificationMessage); - return messageWriter.write(notificationMessage).catch((error45) => { + return messageWriter.write(notificationMessage).catch((error41) => { logger.error(`Sending notification failed.`); - throw error45; + throw error41; }); }, - onNotification: (type, handler14) => { + onNotification: (type, handler18) => { throwIfClosedOrDisposed(); - let method3; + let method2; if (Is.func(type)) { starNotificationHandler = type; - } else if (handler14) { + } else if (handler18) { if (Is.string(type)) { - method3 = type; - notificationHandlers.set(type, { type: undefined, handler: handler14 }); + method2 = type; + notificationHandlers.set(type, { type: undefined, handler: handler18 }); } else { - method3 = type.method; - notificationHandlers.set(type.method, { type, handler: handler14 }); + method2 = type.method; + notificationHandlers.set(type.method, { type, handler: handler18 }); } } return { dispose: () => { - if (method3 !== undefined) { - notificationHandlers.delete(method3); + if (method2 !== undefined) { + notificationHandlers.delete(method2); } else { starNotificationHandler = undefined; } } }; }, - onProgress: (_type, token, handler14) => { + onProgress: (_type, token, handler18) => { if (progressHandlers.has(token)) { throw new Error(`Progress handler for token ${token} already registered`); } - progressHandlers.set(token, handler14); + progressHandlers.set(token, handler18); return { dispose: () => { progressHandlers.delete(token); @@ -474331,13 +397942,13 @@ ${JSON.stringify(message, null, 4)}`); sendRequest: (type, ...args) => { throwIfClosedOrDisposed(); throwIfNotListening(); - let method3; + let method2; let messageParams; let token = undefined; if (Is.string(type)) { - method3 = type; + method2 = type; const first = args[0]; - const last3 = args[args.length - 1]; + const last2 = args[args.length - 1]; let paramStart = 0; let parameterStructures = messages_1.ParameterStructures.auto; if (messages_1.ParameterStructures.is(first)) { @@ -474345,9 +397956,9 @@ ${JSON.stringify(message, null, 4)}`); parameterStructures = first; } let paramEnd = args.length; - if (cancellation_1.CancellationToken.is(last3)) { + if (cancellation_1.CancellationToken.is(last2)) { paramEnd = paramEnd - 1; - token = last3; + token = last2; } const numberOfParams = paramEnd - paramStart; switch (numberOfParams) { @@ -474366,7 +397977,7 @@ ${JSON.stringify(message, null, 4)}`); } } else { const params = args; - method3 = type.method; + method2 = type.method; messageParams = computeMessageParams(type, params); const numberOfParams = type.numberOfParams; token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined; @@ -474389,61 +398000,61 @@ ${JSON.stringify(message, null, 4)}`); const requestMessage = { jsonrpc: version2, id, - method: method3, + method: method2, params: messageParams }; traceSendingRequest(requestMessage); if (typeof cancellationStrategy.sender.enableCancellation === "function") { cancellationStrategy.sender.enableCancellation(requestMessage); } - return new Promise(async (resolve29, reject3) => { + return new Promise(async (resolve23, reject2) => { const resolveWithCleanup = (r) => { - resolve29(r); + resolve23(r); cancellationStrategy.sender.cleanup(id); disposable?.dispose(); }; const rejectWithCleanup = (r) => { - reject3(r); + reject2(r); cancellationStrategy.sender.cleanup(id); disposable?.dispose(); }; - const responsePromise = { method: method3, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup }; + const responsePromise = { method: method2, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup }; try { responsePromises.set(id, responsePromise); await messageWriter.write(requestMessage); - } catch (error45) { + } catch (error41) { responsePromises.delete(id); - responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error45.message ? error45.message : "Unknown reason")); + responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error41.message ? error41.message : "Unknown reason")); logger.error(`Sending request failed.`); - throw error45; + throw error41; } }); }, - onRequest: (type, handler14) => { + onRequest: (type, handler18) => { throwIfClosedOrDisposed(); - let method3 = null; + let method2 = null; if (StarRequestHandler.is(type)) { - method3 = undefined; + method2 = undefined; starRequestHandler = type; } else if (Is.string(type)) { - method3 = null; - if (handler14 !== undefined) { - method3 = type; - requestHandlers.set(type, { handler: handler14, type: undefined }); + method2 = null; + if (handler18 !== undefined) { + method2 = type; + requestHandlers.set(type, { handler: handler18, type: undefined }); } } else { - if (handler14 !== undefined) { - method3 = type.method; - requestHandlers.set(type.method, { type, handler: handler14 }); + if (handler18 !== undefined) { + method2 = type.method; + requestHandlers.set(type.method, { type, handler: handler18 }); } } return { dispose: () => { - if (method3 === null) { + if (method2 === null) { return; } - if (method3 !== undefined) { - requestHandlers.delete(method3); + if (method2 !== undefined) { + requestHandlers.delete(method2); } else { starRequestHandler = undefined; } @@ -474488,9 +398099,9 @@ ${JSON.stringify(message, null, 4)}`); } state = ConnectionState.Disposed; disposeEmitter.fire(undefined); - const error45 = new messages_1.ResponseError(messages_1.ErrorCodes.PendingResponseRejected, "Pending response rejected since connection got disposed"); + const error41 = new messages_1.ResponseError(messages_1.ErrorCodes.PendingResponseRejected, "Pending response rejected since connection got disposed"); for (const promise3 of responsePromises.values()) { - promise3.reject(error45); + promise3.reject(error41); } responsePromises = new Map; requestTokens = new Map; @@ -474521,9 +398132,9 @@ ${JSON.stringify(message, null, 4)}`); tracer.log(params.message, verbose ? params.verbose : undefined); }); connection.onNotification(ProgressNotification.type, (params) => { - const handler14 = progressHandlers.get(params.token); - if (handler14) { - handler14(params.value); + const handler18 = progressHandlers.get(params.token); + if (handler18) { + handler18(params.value); } else { unhandledProgressEmitter.fire(params); } @@ -474807,12 +398418,12 @@ var require_ril = __commonJS((exports) => { return api_1.Disposable.create(() => this.stream.off("end", listener2)); } write(data, encoding) { - return new Promise((resolve29, reject3) => { - const callback = (error45) => { - if (error45 === undefined || error45 === null) { - resolve29(); + return new Promise((resolve23, reject2) => { + const callback = (error41) => { + if (error41 === undefined || error41 === null) { + resolve23(); } else { - reject3(error45); + reject2(error41); } }; if (typeof data === "string") { @@ -474836,8 +398447,8 @@ var require_ril = __commonJS((exports) => { encode: (msg, options2) => { try { return Promise.resolve(Buffer.from(JSON.stringify(msg, undefined, 0), options2.charset)); - } catch (err3) { - return Promise.reject(err3); + } catch (err2) { + return Promise.reject(err2); } } }), @@ -474850,8 +398461,8 @@ var require_ril = __commonJS((exports) => { } else { return Promise.resolve(JSON.parse(new util_1.TextDecoder(options2.charset).decode(buffer))); } - } catch (err3) { - return Promise.reject(err3); + } catch (err2) { + return Promise.reject(err2); } } }) @@ -474914,8 +398525,8 @@ var require_main = __commonJS((exports) => { exports.createMessageConnection = exports.createServerSocketTransport = exports.createClientSocketTransport = exports.createServerPipeTransport = exports.createClientPipeTransport = exports.generateRandomPipeName = exports.StreamMessageWriter = exports.StreamMessageReader = exports.SocketMessageWriter = exports.SocketMessageReader = exports.PortMessageWriter = exports.PortMessageReader = exports.IPCMessageWriter = exports.IPCMessageReader = undefined; var ril_1 = require_ril(); ril_1.default.install(); - var path18 = __require("path"); - var os5 = __require("os"); + var path13 = __require("path"); + var os4 = __require("os"); var crypto_1 = __require("crypto"); var net_1 = __require("net"); var api_1 = require_api2(); @@ -474926,7 +398537,7 @@ var require_main = __commonJS((exports) => { super(); this.process = process13; let eventEmitter = this.process; - eventEmitter.on("error", (error45) => this.fireError(error45)); + eventEmitter.on("error", (error41) => this.fireError(error41)); eventEmitter.on("close", () => this.fireClose()); } listen(callback) { @@ -474942,30 +398553,30 @@ var require_main = __commonJS((exports) => { this.process = process13; this.errorCount = 0; const eventEmitter = this.process; - eventEmitter.on("error", (error45) => this.fireError(error45)); + eventEmitter.on("error", (error41) => this.fireError(error41)); eventEmitter.on("close", () => this.fireClose); } write(msg) { try { if (typeof this.process.send === "function") { - this.process.send(msg, undefined, undefined, (error45) => { - if (error45) { + this.process.send(msg, undefined, undefined, (error41) => { + if (error41) { this.errorCount++; - this.handleError(error45, msg); + this.handleError(error41, msg); } else { this.errorCount = 0; } }); } return Promise.resolve(); - } catch (error45) { - this.handleError(error45, msg); - return Promise.reject(error45); + } catch (error41) { + this.handleError(error41, msg); + return Promise.reject(error41); } } - handleError(error45, msg) { + handleError(error41, msg) { this.errorCount++; - this.fireError(error45, msg, this.errorCount); + this.fireError(error41, msg, this.errorCount); } end() {} } @@ -474976,7 +398587,7 @@ var require_main = __commonJS((exports) => { super(); this.onData = new api_1.Emitter; port.on("close", () => this.fireClose); - port.on("error", (error45) => this.fireError(error45)); + port.on("error", (error41) => this.fireError(error41)); port.on("message", (message) => { this.onData.fire(message); }); @@ -474993,20 +398604,20 @@ var require_main = __commonJS((exports) => { this.port = port; this.errorCount = 0; port.on("close", () => this.fireClose()); - port.on("error", (error45) => this.fireError(error45)); + port.on("error", (error41) => this.fireError(error41)); } write(msg) { try { this.port.postMessage(msg); return Promise.resolve(); - } catch (error45) { - this.handleError(error45, msg); - return Promise.reject(error45); + } catch (error41) { + this.handleError(error41, msg); + return Promise.reject(error41); } } - handleError(error45, msg) { + handleError(error41, msg) { this.errorCount++; - this.fireError(error45, msg, this.errorCount); + this.fireError(error41, msg, this.errorCount); } end() {} } @@ -475054,25 +398665,25 @@ var require_main = __commonJS((exports) => { if (process.platform === "win32") { return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`; } - let result3; + let result2; if (XDG_RUNTIME_DIR) { - result3 = path18.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`); + result2 = path13.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`); } else { - result3 = path18.join(os5.tmpdir(), `vscode-${randomSuffix}.sock`); + result2 = path13.join(os4.tmpdir(), `vscode-${randomSuffix}.sock`); } const limit = safeIpcPathLengths.get(process.platform); - if (limit !== undefined && result3.length > limit) { - (0, ril_1.default)().console.warn(`WARNING: IPC handle "${result3}" is longer than ${limit} characters.`); + if (limit !== undefined && result2.length > limit) { + (0, ril_1.default)().console.warn(`WARNING: IPC handle "${result2}" is longer than ${limit} characters.`); } - return result3; + return result2; } exports.generateRandomPipeName = generateRandomPipeName; function createClientPipeTransport(pipeName, encoding = "utf-8") { let connectResolve; - const connected = new Promise((resolve29, _reject) => { - connectResolve = resolve29; + const connected = new Promise((resolve23, _reject) => { + connectResolve = resolve23; }); - return new Promise((resolve29, reject3) => { + return new Promise((resolve23, reject2) => { let server = (0, net_1.createServer)((socket) => { server.close(); connectResolve([ @@ -475080,10 +398691,10 @@ var require_main = __commonJS((exports) => { new SocketMessageWriter(socket, encoding) ]); }); - server.on("error", reject3); + server.on("error", reject2); server.listen(pipeName, () => { - server.removeListener("error", reject3); - resolve29({ + server.removeListener("error", reject2); + resolve23({ onConnected: () => { return connected; } @@ -475102,10 +398713,10 @@ var require_main = __commonJS((exports) => { exports.createServerPipeTransport = createServerPipeTransport; function createClientSocketTransport(port, encoding = "utf-8") { let connectResolve; - const connected = new Promise((resolve29, _reject) => { - connectResolve = resolve29; + const connected = new Promise((resolve23, _reject) => { + connectResolve = resolve23; }); - return new Promise((resolve29, reject3) => { + return new Promise((resolve23, reject2) => { const server = (0, net_1.createServer)((socket) => { server.close(); connectResolve([ @@ -475113,10 +398724,10 @@ var require_main = __commonJS((exports) => { new SocketMessageWriter(socket, encoding) ]); }); - server.on("error", reject3); + server.on("error", reject2); server.listen(port, "127.0.0.1", () => { - server.removeListener("error", reject3); - resolve29({ + server.removeListener("error", reject2); + resolve23({ onConnected: () => { return connected; } @@ -475141,11 +398752,11 @@ var require_main = __commonJS((exports) => { const candidate = value; return candidate.write !== undefined && candidate.addListener !== undefined; } - function createMessageConnection(input11, output, logger, options2) { + function createMessageConnection(input, output, logger, options2) { if (!logger) { logger = api_1.NullLogger; } - const reader = isReadableStream4(input11) ? new StreamMessageReader(input11) : input11; + const reader = isReadableStream4(input) ? new StreamMessageReader(input) : input; const writer = isWritableStream3(output) ? new StreamMessageWriter(output) : output; if (api_1.ConnectionStrategy.is(options2)) { options2 = { connectionStrategy: options2 }; @@ -475169,12 +398780,12 @@ function subprocessEnv() { if (!isEnvTruthy(process.env.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB)) { return Object.keys(proxyEnv).length > 0 ? { ...process.env, ...proxyEnv } : process.env; } - const env5 = { ...process.env, ...proxyEnv }; + const env4 = { ...process.env, ...proxyEnv }; for (const k of GHA_SUBPROCESS_SCRUB) { - delete env5[k]; - delete env5[`INPUT_${k}`]; + delete env4[k]; + delete env4[`INPUT_${k}`]; } - return env5; + return env4; } var GHA_SUBPROCESS_SCRUB, _getUpstreamProxyEnv; var init_subprocessEnv = __esm(() => { @@ -475211,7 +398822,7 @@ var exports_LSPClient = {}; __export(exports_LSPClient, { createLSPClient: () => createLSPClient }); -import { spawn as spawn7 } from "child_process"; +import { spawn as spawn4 } from "child_process"; function createLSPClient(serverName, onCrash) { let process13; let connection; @@ -475236,7 +398847,7 @@ function createLSPClient(serverName, onCrash) { }, async start(command, args, options2) { try { - process13 = spawn7(command, args, { + process13 = spawn4(command, args, { stdio: ["pipe", "pipe", "pipe"], env: { ...subprocessEnv(), ...options2?.env }, cwd: options2?.cwd, @@ -475246,14 +398857,14 @@ function createLSPClient(serverName, onCrash) { throw new Error("LSP server process stdio not available"); } const spawnedProcess = process13; - await new Promise((resolve29, reject3) => { + await new Promise((resolve23, reject2) => { const onSpawn = () => { cleanup(); - resolve29(); + resolve23(); }; - const onError = (error45) => { + const onError = (error41) => { cleanup(); - reject3(error45); + reject2(error41); }; const cleanup = () => { spawnedProcess.removeListener("spawn", onSpawn); @@ -475270,11 +398881,11 @@ function createLSPClient(serverName, onCrash) { } }); } - process13.on("error", (error45) => { + process13.on("error", (error41) => { if (!isStopping) { startFailed = true; - startError = error45; - logError2(new Error(`LSP server ${serverName} failed to start: ${error45.message}`)); + startError = error41; + logError2(new Error(`LSP server ${serverName} failed to start: ${error41.message}`)); } }); process13.on("exit", (code, _signal) => { @@ -475287,19 +398898,19 @@ function createLSPClient(serverName, onCrash) { onCrash?.(crashError); } }); - process13.stdin.on("error", (error45) => { + process13.stdin.on("error", (error41) => { if (!isStopping) { - logForDebugging(`LSP server ${serverName} stdin error: ${error45.message}`); + logForDebugging(`LSP server ${serverName} stdin error: ${error41.message}`); } }); const reader = new import_node10.StreamMessageReader(process13.stdout); const writer = new import_node10.StreamMessageWriter(process13.stdin); connection = import_node10.createMessageConnection(reader, writer); - connection.onError(([error45, _message, _code]) => { + connection.onError(([error41, _message, _code]) => { if (!isStopping) { startFailed = true; - startError = error45; - logError2(new Error(`LSP server ${serverName} connection error: ${error45.message}`)); + startError = error41; + logError2(new Error(`LSP server ${serverName} connection error: ${error41.message}`)); } }); connection.onClose(() => { @@ -475313,24 +398924,24 @@ function createLSPClient(serverName, onCrash) { log: (message) => { logForDebugging(`[LSP PROTOCOL ${serverName}] ${message}`); } - }).catch((error45) => { - logForDebugging(`Failed to enable tracing for ${serverName}: ${error45.message}`); + }).catch((error41) => { + logForDebugging(`Failed to enable tracing for ${serverName}: ${error41.message}`); }); - for (const { method: method3, handler: handler14 } of pendingHandlers) { - connection.onNotification(method3, handler14); - logForDebugging(`Applied queued notification handler for ${serverName}.${method3}`); + for (const { method: method2, handler: handler18 } of pendingHandlers) { + connection.onNotification(method2, handler18); + logForDebugging(`Applied queued notification handler for ${serverName}.${method2}`); } pendingHandlers.length = 0; - for (const { method: method3, handler: handler14 } of pendingRequestHandlers) { - connection.onRequest(method3, handler14); - logForDebugging(`Applied queued request handler for ${serverName}.${method3}`); + for (const { method: method2, handler: handler18 } of pendingRequestHandlers) { + connection.onRequest(method2, handler18); + logForDebugging(`Applied queued request handler for ${serverName}.${method2}`); } pendingRequestHandlers.length = 0; logForDebugging(`LSP client started for ${serverName}`); - } catch (error45) { - const err3 = error45; - logError2(new Error(`LSP server ${serverName} failed to start: ${err3.message}`)); - throw error45; + } catch (error41) { + const err2 = error41; + logError2(new Error(`LSP server ${serverName} failed to start: ${err2.message}`)); + throw error41; } }, async initialize(params) { @@ -475339,19 +398950,19 @@ function createLSPClient(serverName, onCrash) { } checkStartFailed(); try { - const result3 = await connection.sendRequest("initialize", params); - capabilities = result3.capabilities; + const result2 = await connection.sendRequest("initialize", params); + capabilities = result2.capabilities; await connection.sendNotification("initialized", {}); isInitialized = true; logForDebugging(`LSP server ${serverName} initialized`); - return result3; - } catch (error45) { - const err3 = error45; - logError2(new Error(`LSP server ${serverName} initialize failed: ${err3.message}`)); - throw error45; + return result2; + } catch (error41) { + const err2 = error41; + logError2(new Error(`LSP server ${serverName} initialize failed: ${err2.message}`)); + throw error41; } }, - async sendRequest(method3, params) { + async sendRequest(method2, params) { if (!connection) { throw new Error("LSP client not started"); } @@ -475360,46 +398971,46 @@ function createLSPClient(serverName, onCrash) { throw new Error("LSP server not initialized"); } try { - return await connection.sendRequest(method3, params); - } catch (error45) { - const err3 = error45; - logError2(new Error(`LSP server ${serverName} request ${method3} failed: ${err3.message}`)); - throw error45; + return await connection.sendRequest(method2, params); + } catch (error41) { + const err2 = error41; + logError2(new Error(`LSP server ${serverName} request ${method2} failed: ${err2.message}`)); + throw error41; } }, - async sendNotification(method3, params) { + async sendNotification(method2, params) { if (!connection) { throw new Error("LSP client not started"); } checkStartFailed(); try { - await connection.sendNotification(method3, params); - } catch (error45) { - const err3 = error45; - logError2(new Error(`LSP server ${serverName} notification ${method3} failed: ${err3.message}`)); - logForDebugging(`Notification ${method3} failed but continuing`); + await connection.sendNotification(method2, params); + } catch (error41) { + const err2 = error41; + logError2(new Error(`LSP server ${serverName} notification ${method2} failed: ${err2.message}`)); + logForDebugging(`Notification ${method2} failed but continuing`); } }, - onNotification(method3, handler14) { + onNotification(method2, handler18) { if (!connection) { - pendingHandlers.push({ method: method3, handler: handler14 }); - logForDebugging(`Queued notification handler for ${serverName}.${method3} (connection not ready)`); + pendingHandlers.push({ method: method2, handler: handler18 }); + logForDebugging(`Queued notification handler for ${serverName}.${method2} (connection not ready)`); return; } checkStartFailed(); - connection.onNotification(method3, handler14); + connection.onNotification(method2, handler18); }, - onRequest(method3, handler14) { + onRequest(method2, handler18) { if (!connection) { pendingRequestHandlers.push({ - method: method3, - handler: handler14 + method: method2, + handler: handler18 }); - logForDebugging(`Queued request handler for ${serverName}.${method3} (connection not ready)`); + logForDebugging(`Queued request handler for ${serverName}.${method2} (connection not ready)`); return; } checkStartFailed(); - connection.onRequest(method3, handler14); + connection.onRequest(method2, handler18); }, async stop() { let shutdownError; @@ -475409,16 +399020,16 @@ function createLSPClient(serverName, onCrash) { await connection.sendRequest("shutdown", {}); await connection.sendNotification("exit", {}); } - } catch (error45) { - const err3 = error45; - logError2(new Error(`LSP server ${serverName} stop failed: ${err3.message}`)); - shutdownError = err3; + } catch (error41) { + const err2 = error41; + logError2(new Error(`LSP server ${serverName} stop failed: ${err2.message}`)); + shutdownError = err2; } finally { if (connection) { try { connection.dispose(); - } catch (error45) { - logForDebugging(`Connection disposal failed for ${serverName}: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`Connection disposal failed for ${serverName}: ${errorMessage(error41)}`); } connection = undefined; } @@ -475433,8 +399044,8 @@ function createLSPClient(serverName, onCrash) { } try { process13.kill(); - } catch (error45) { - logForDebugging(`Process kill failed for ${serverName} (may already be dead): ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`Process kill failed for ${serverName} (may already be dead): ${errorMessage(error41)}`); } process13 = undefined; } @@ -475463,13 +399074,13 @@ var init_LSPClient = __esm(() => { }); // src/services/lsp/LSPServerInstance.ts -import * as path18 from "path"; +import * as path13 from "path"; import { pathToFileURL as pathToFileURL4 } from "url"; -function createLSPServerInstance(name, config4) { - if (config4.restartOnCrash !== undefined) { +function createLSPServerInstance(name, config2) { + if (config2.restartOnCrash !== undefined) { throw new Error(`LSP server '${name}': restartOnCrash is not yet implemented. Remove this field from the configuration.`); } - if (config4.shutdownTimeout !== undefined) { + if (config2.shutdownTimeout !== undefined) { throw new Error(`LSP server '${name}': shutdownTimeout is not yet implemented. Remove this field from the configuration.`); } const { createLSPClient: createLSPClient2 } = (init_LSPClient(), __toCommonJS(exports_LSPClient)); @@ -475478,39 +399089,39 @@ function createLSPServerInstance(name, config4) { let lastError; let restartCount = 0; let crashRecoveryCount = 0; - const client5 = createLSPClient2(name, (error45) => { + const client2 = createLSPClient2(name, (error41) => { state = "error"; - lastError = error45; + lastError = error41; crashRecoveryCount++; }); async function start() { if (state === "running" || state === "starting") { return; } - const maxRestarts = config4.maxRestarts ?? 3; + const maxRestarts = config2.maxRestarts ?? 3; if (state === "error" && crashRecoveryCount > maxRestarts) { - const error45 = new Error(`LSP server '${name}' exceeded max crash recovery attempts (${maxRestarts})`); - lastError = error45; - logError2(error45); - throw error45; + const error41 = new Error(`LSP server '${name}' exceeded max crash recovery attempts (${maxRestarts})`); + lastError = error41; + logError2(error41); + throw error41; } let initPromise; try { state = "starting"; logForDebugging(`Starting LSP server instance: ${name}`); - await client5.start(config4.command, config4.args || [], { - env: config4.env, - cwd: config4.workspaceFolder + await client2.start(config2.command, config2.args || [], { + env: config2.env, + cwd: config2.workspaceFolder }); - const workspaceFolder = config4.workspaceFolder || getCwd(); + const workspaceFolder = config2.workspaceFolder || getCwd(); const workspaceUri = pathToFileURL4(workspaceFolder).href; const initParams = { processId: process.pid, - initializationOptions: config4.initializationOptions ?? {}, + initializationOptions: config2.initializationOptions ?? {}, workspaceFolders: [ { uri: workspaceUri, - name: path18.basename(workspaceFolder) + name: path13.basename(workspaceFolder) } ], rootPath: workspaceFolder, @@ -475560,9 +399171,9 @@ function createLSPServerInstance(name, config4) { } } }; - initPromise = client5.initialize(initParams); - if (config4.startupTimeout !== undefined) { - await withTimeout(initPromise, config4.startupTimeout, `LSP server '${name}' timed out after ${config4.startupTimeout}ms during initialization`); + initPromise = client2.initialize(initParams); + if (config2.startupTimeout !== undefined) { + await withTimeout(initPromise, config2.startupTimeout, `LSP server '${name}' timed out after ${config2.startupTimeout}ms during initialization`); } else { await initPromise; } @@ -475570,13 +399181,13 @@ function createLSPServerInstance(name, config4) { startTime = new Date; crashRecoveryCount = 0; logForDebugging(`LSP server instance started: ${name}`); - } catch (error45) { - client5.stop().catch(() => {}); + } catch (error41) { + client2.stop().catch(() => {}); initPromise?.catch(() => {}); state = "error"; - lastError = error45; - logError2(error45); - throw error45; + lastError = error41; + logError2(error41); + throw error41; } } async function stop() { @@ -475585,92 +399196,92 @@ function createLSPServerInstance(name, config4) { } try { state = "stopping"; - await client5.stop(); + await client2.stop(); state = "stopped"; logForDebugging(`LSP server instance stopped: ${name}`); - } catch (error45) { + } catch (error41) { state = "error"; - lastError = error45; - logError2(error45); - throw error45; + lastError = error41; + logError2(error41); + throw error41; } } async function restart() { try { await stop(); - } catch (error45) { - const stopError = new Error(`Failed to stop LSP server '${name}' during restart: ${errorMessage(error45)}`); + } catch (error41) { + const stopError = new Error(`Failed to stop LSP server '${name}' during restart: ${errorMessage(error41)}`); logError2(stopError); throw stopError; } restartCount++; - const maxRestarts = config4.maxRestarts ?? 3; + const maxRestarts = config2.maxRestarts ?? 3; if (restartCount > maxRestarts) { - const error45 = new Error(`Max restart attempts (${maxRestarts}) exceeded for server '${name}'`); - logError2(error45); - throw error45; + const error41 = new Error(`Max restart attempts (${maxRestarts}) exceeded for server '${name}'`); + logError2(error41); + throw error41; } try { await start(); - } catch (error45) { - const startError = new Error(`Failed to start LSP server '${name}' during restart (attempt ${restartCount}/${maxRestarts}): ${errorMessage(error45)}`); + } catch (error41) { + const startError = new Error(`Failed to start LSP server '${name}' during restart (attempt ${restartCount}/${maxRestarts}): ${errorMessage(error41)}`); logError2(startError); throw startError; } } function isHealthy() { - return state === "running" && client5.isInitialized; + return state === "running" && client2.isInitialized; } - async function sendRequest(method3, params) { + async function sendRequest(method2, params) { if (!isHealthy()) { - const error45 = new Error(`Cannot send request to LSP server '${name}': server is ${state}` + `${lastError ? `, last error: ${lastError.message}` : ""}`); - logError2(error45); - throw error45; + const error41 = new Error(`Cannot send request to LSP server '${name}': server is ${state}` + `${lastError ? `, last error: ${lastError.message}` : ""}`); + logError2(error41); + throw error41; } let lastAttemptError; - for (let attempt3 = 0;attempt3 <= MAX_RETRIES_FOR_TRANSIENT_ERRORS; attempt3++) { + for (let attempt2 = 0;attempt2 <= MAX_RETRIES_FOR_TRANSIENT_ERRORS; attempt2++) { try { - return await client5.sendRequest(method3, params); - } catch (error45) { - lastAttemptError = error45; - const errorCode = error45.code; + return await client2.sendRequest(method2, params); + } catch (error41) { + lastAttemptError = error41; + const errorCode = error41.code; const isContentModifiedError = typeof errorCode === "number" && errorCode === LSP_ERROR_CONTENT_MODIFIED; - if (isContentModifiedError && attempt3 < MAX_RETRIES_FOR_TRANSIENT_ERRORS) { - const delay3 = RETRY_BASE_DELAY_MS * Math.pow(2, attempt3); - logForDebugging(`LSP request '${method3}' to '${name}' got ContentModified error, ` + `retrying in ${delay3}ms (attempt ${attempt3 + 1}/${MAX_RETRIES_FOR_TRANSIENT_ERRORS})…`); - await sleep4(delay3); + if (isContentModifiedError && attempt2 < MAX_RETRIES_FOR_TRANSIENT_ERRORS) { + const delay2 = RETRY_BASE_DELAY_MS * Math.pow(2, attempt2); + logForDebugging(`LSP request '${method2}' to '${name}' got ContentModified error, ` + `retrying in ${delay2}ms (attempt ${attempt2 + 1}/${MAX_RETRIES_FOR_TRANSIENT_ERRORS})…`); + await sleep2(delay2); continue; } break; } } - const requestError = new Error(`LSP request '${method3}' failed for server '${name}': ${lastAttemptError?.message ?? "unknown error"}`); + const requestError = new Error(`LSP request '${method2}' failed for server '${name}': ${lastAttemptError?.message ?? "unknown error"}`); logError2(requestError); throw requestError; } - async function sendNotification2(method3, params) { + async function sendNotification2(method2, params) { if (!isHealthy()) { - const error45 = new Error(`Cannot send notification to LSP server '${name}': server is ${state}`); - logError2(error45); - throw error45; + const error41 = new Error(`Cannot send notification to LSP server '${name}': server is ${state}`); + logError2(error41); + throw error41; } try { - await client5.sendNotification(method3, params); - } catch (error45) { - const notificationError = new Error(`LSP notification '${method3}' failed for server '${name}': ${errorMessage(error45)}`); + await client2.sendNotification(method2, params); + } catch (error41) { + const notificationError = new Error(`LSP notification '${method2}' failed for server '${name}': ${errorMessage(error41)}`); logError2(notificationError); throw notificationError; } } - function onNotification(method3, handler14) { - client5.onNotification(method3, handler14); + function onNotification(method2, handler18) { + client2.onNotification(method2, handler18); } - function onRequest(method3, handler14) { - client5.onRequest(method3, handler14); + function onRequest(method2, handler18) { + client2.onRequest(method2, handler18); } return { name, - config: config4, + config: config2, get state() { return state; }, @@ -475695,8 +399306,8 @@ function createLSPServerInstance(name, config4) { } function withTimeout(promise3, ms, message) { let timer; - const timeoutPromise = new Promise((_, reject3) => { - timer = setTimeout((rej, msg) => rej(new Error(msg)), ms, reject3, message); + const timeoutPromise = new Promise((_, reject2) => { + timer = setTimeout((rej, msg) => rej(new Error(msg)), ms, reject2, message); }); return Promise.race([promise3, timeoutPromise]).finally(() => clearTimeout(timer)); } @@ -475709,32 +399320,32 @@ var init_LSPServerInstance = __esm(() => { }); // src/services/lsp/LSPServerManager.ts -import * as path19 from "path"; +import * as path14 from "path"; import { pathToFileURL as pathToFileURL5 } from "url"; function createLSPServerManager() { const servers = new Map; const extensionMap = new Map; const openedFiles = new Map; - async function initialize4() { + async function initialize3() { let serverConfigs; try { - const result3 = await getAllLspServers(); - serverConfigs = result3.servers; + const result2 = await getAllLspServers(); + serverConfigs = result2.servers; logForDebugging(`[LSP SERVER MANAGER] getAllLspServers returned ${Object.keys(serverConfigs).length} server(s)`); - } catch (error45) { - const err3 = error45; - logError2(new Error(`Failed to load LSP server configuration: ${err3.message}`)); - throw error45; + } catch (error41) { + const err2 = error41; + logError2(new Error(`Failed to load LSP server configuration: ${err2.message}`)); + throw error41; } - for (const [serverName, config4] of Object.entries(serverConfigs)) { + for (const [serverName, config2] of Object.entries(serverConfigs)) { try { - if (!config4.command) { + if (!config2.command) { throw new Error(`Server ${serverName} missing required 'command' field`); } - if (!config4.extensionToLanguage || Object.keys(config4.extensionToLanguage).length === 0) { + if (!config2.extensionToLanguage || Object.keys(config2.extensionToLanguage).length === 0) { throw new Error(`Server ${serverName} missing required 'extensionToLanguage' field`); } - const fileExtensions = Object.keys(config4.extensionToLanguage); + const fileExtensions = Object.keys(config2.extensionToLanguage); for (const ext of fileExtensions) { const normalized = ext.toLowerCase(); if (!extensionMap.has(normalized)) { @@ -475745,15 +399356,15 @@ function createLSPServerManager() { serverList.push(serverName); } } - const instance = createLSPServerInstance(serverName, config4); + const instance = createLSPServerInstance(serverName, config2); servers.set(serverName, instance); instance.onRequest("workspace/configuration", (params) => { logForDebugging(`LSP: Received workspace/configuration request from ${serverName}`); return params.items.map(() => null); }); - } catch (error45) { - const err3 = error45; - logError2(new Error(`Failed to initialize LSP server ${serverName}: ${err3.message}`)); + } catch (error41) { + const err2 = error41; + logError2(new Error(`Failed to initialize LSP server ${serverName}: ${err2.message}`)); } } logForDebugging(`LSP manager initialized with ${servers.size} servers`); @@ -475764,15 +399375,15 @@ function createLSPServerManager() { servers.clear(); extensionMap.clear(); openedFiles.clear(); - const errors5 = results.map((r, i4) => r.status === "rejected" ? `${toStop[i4][0]}: ${errorMessage(r.reason)}` : null).filter((e) => e !== null); - if (errors5.length > 0) { - const err3 = new Error(`Failed to stop ${errors5.length} LSP server(s): ${errors5.join("; ")}`); - logError2(err3); - throw err3; + const errors4 = results.map((r, i3) => r.status === "rejected" ? `${toStop[i3][0]}: ${errorMessage(r.reason)}` : null).filter((e) => e !== null); + if (errors4.length > 0) { + const err2 = new Error(`Failed to stop ${errors4.length} LSP server(s): ${errors4.join("; ")}`); + logError2(err2); + throw err2; } } function getServerForFile(filePath) { - const ext = path19.extname(filePath).toLowerCase(); + const ext = path14.extname(filePath).toLowerCase(); const serverNames = extensionMap.get(ext); if (!serverNames || serverNames.length === 0) { return; @@ -475790,24 +399401,24 @@ function createLSPServerManager() { if (server.state === "stopped" || server.state === "error") { try { await server.start(); - } catch (error45) { - const err3 = error45; - logError2(new Error(`Failed to start LSP server for file ${filePath}: ${err3.message}`)); - throw error45; + } catch (error41) { + const err2 = error41; + logError2(new Error(`Failed to start LSP server for file ${filePath}: ${err2.message}`)); + throw error41; } } return server; } - async function sendRequest(filePath, method3, params) { + async function sendRequest(filePath, method2, params) { const server = await ensureServerStarted(filePath); if (!server) return; try { - return await server.sendRequest(method3, params); - } catch (error45) { - const err3 = error45; - logError2(new Error(`LSP request failed for file ${filePath}, method '${method3}': ${err3.message}`)); - throw error45; + return await server.sendRequest(method2, params); + } catch (error41) { + const err2 = error41; + logError2(new Error(`LSP request failed for file ${filePath}, method '${method2}': ${err2.message}`)); + throw error41; } } function getAllServers() { @@ -475817,12 +399428,12 @@ function createLSPServerManager() { const server = await ensureServerStarted(filePath); if (!server) return; - const fileUri = pathToFileURL5(path19.resolve(filePath)).href; + const fileUri = pathToFileURL5(path14.resolve(filePath)).href; if (openedFiles.get(fileUri) === server.name) { logForDebugging(`LSP: File already open, skipping didOpen for ${filePath}`); return; } - const ext = path19.extname(filePath).toLowerCase(); + const ext = path14.extname(filePath).toLowerCase(); const languageId = server.config.extensionToLanguage[ext] || "plaintext"; try { await server.sendNotification("textDocument/didOpen", { @@ -475835,10 +399446,10 @@ function createLSPServerManager() { }); openedFiles.set(fileUri, server.name); logForDebugging(`LSP: Sent didOpen for ${filePath} (languageId: ${languageId})`); - } catch (error45) { - const err3 = new Error(`Failed to sync file open ${filePath}: ${errorMessage(error45)}`); - logError2(err3); - throw err3; + } catch (error41) { + const err2 = new Error(`Failed to sync file open ${filePath}: ${errorMessage(error41)}`); + logError2(err2); + throw err2; } } async function changeFile(filePath, content) { @@ -475846,7 +399457,7 @@ function createLSPServerManager() { if (!server || server.state !== "running") { return openFile(filePath, content); } - const fileUri = pathToFileURL5(path19.resolve(filePath)).href; + const fileUri = pathToFileURL5(path14.resolve(filePath)).href; if (openedFiles.get(fileUri) !== server.name) { return openFile(filePath, content); } @@ -475859,10 +399470,10 @@ function createLSPServerManager() { contentChanges: [{ text: content }] }); logForDebugging(`LSP: Sent didChange for ${filePath}`); - } catch (error45) { - const err3 = new Error(`Failed to sync file change ${filePath}: ${errorMessage(error45)}`); - logError2(err3); - throw err3; + } catch (error41) { + const err2 = new Error(`Failed to sync file change ${filePath}: ${errorMessage(error41)}`); + logError2(err2); + throw err2; } } async function saveFile(filePath) { @@ -475872,21 +399483,21 @@ function createLSPServerManager() { try { await server.sendNotification("textDocument/didSave", { textDocument: { - uri: pathToFileURL5(path19.resolve(filePath)).href + uri: pathToFileURL5(path14.resolve(filePath)).href } }); logForDebugging(`LSP: Sent didSave for ${filePath}`); - } catch (error45) { - const err3 = new Error(`Failed to sync file save ${filePath}: ${errorMessage(error45)}`); - logError2(err3); - throw err3; + } catch (error41) { + const err2 = new Error(`Failed to sync file save ${filePath}: ${errorMessage(error41)}`); + logError2(err2); + throw err2; } } async function closeFile(filePath) { const server = getServerForFile(filePath); if (!server || server.state !== "running") return; - const fileUri = pathToFileURL5(path19.resolve(filePath)).href; + const fileUri = pathToFileURL5(path14.resolve(filePath)).href; try { await server.sendNotification("textDocument/didClose", { textDocument: { @@ -475895,18 +399506,18 @@ function createLSPServerManager() { }); openedFiles.delete(fileUri); logForDebugging(`LSP: Sent didClose for ${filePath}`); - } catch (error45) { - const err3 = new Error(`Failed to sync file close ${filePath}: ${errorMessage(error45)}`); - logError2(err3); - throw err3; + } catch (error41) { + const err2 = new Error(`Failed to sync file close ${filePath}: ${errorMessage(error41)}`); + logError2(err2); + throw err2; } } function isFileOpen(filePath) { - const fileUri = pathToFileURL5(path19.resolve(filePath)).href; + const fileUri = pathToFileURL5(path14.resolve(filePath)).href; return openedFiles.has(fileUri); } return { - initialize: initialize4, + initialize: initialize3, shutdown, getServerForFile, ensureServerStarted, @@ -475928,7 +399539,7 @@ var init_LSPServerManager = __esm(() => { }); // src/services/lsp/passiveFeedback.ts -import { fileURLToPath as fileURLToPath5 } from "url"; +import { fileURLToPath as fileURLToPath4 } from "url"; function mapLSPSeverity(lspSeverity) { switch (lspSeverity) { case 1: @@ -475946,11 +399557,11 @@ function mapLSPSeverity(lspSeverity) { function formatDiagnosticsForAttachment(params) { let uri; try { - uri = params.uri.startsWith("file://") ? fileURLToPath5(params.uri) : params.uri; - } catch (error45) { - const err3 = toError(error45); - logError2(err3); - logForDebugging(`Failed to convert URI to file path: ${params.uri}. Error: ${err3.message}. Using original URI as fallback.`); + uri = params.uri.startsWith("file://") ? fileURLToPath4(params.uri) : params.uri; + } catch (error41) { + const err2 = toError(error41); + logError2(err2); + logForDebugging(`Failed to convert URI to file path: ${params.uri}. Error: ${err2.message}. Using original URI as fallback.`); uri = params.uri; } const diagnostics = params.diagnostics.map((diag2) => ({ @@ -475986,8 +399597,8 @@ function registerLSPNotificationHandlers(manager) { if (!serverInstance || typeof serverInstance.onNotification !== "function") { const errorMsg = !serverInstance ? "Server instance is null/undefined" : "Server instance has no onNotification method"; registrationErrors.push({ serverName, error: errorMsg }); - const err3 = new Error(`${errorMsg} for ${serverName}`); - logError2(err3); + const err2 = new Error(`${errorMsg} for ${serverName}`); + logError2(err2); logForDebugging(`Skipping handler registration for ${serverName}: ${errorMsg}`); continue; } @@ -475995,8 +399606,8 @@ function registerLSPNotificationHandlers(manager) { logForDebugging(`[PASSIVE DIAGNOSTICS] Handler invoked for ${serverName}! Params type: ${typeof params}`); try { if (!params || typeof params !== "object" || !("uri" in params) || !("diagnostics" in params)) { - const err3 = new Error(`LSP server ${serverName} sent invalid diagnostic params (missing uri or diagnostics)`); - logError2(err3); + const err2 = new Error(`LSP server ${serverName} sent invalid diagnostic params (missing uri or diagnostics)`); + logError2(err2); logForDebugging(`Invalid diagnostic params from ${serverName}: ${jsonStringify(params)}`); return; } @@ -476015,31 +399626,31 @@ function registerLSPNotificationHandlers(manager) { }); logForDebugging(`LSP Diagnostics: Registered ${diagnosticFiles.length} diagnostic file(s) from ${serverName} for async delivery`); diagnosticFailures.delete(serverName); - } catch (error45) { - const err3 = toError(error45); - logError2(err3); - logForDebugging(`Error registering LSP diagnostics from ${serverName}: ` + `URI: ${diagnosticParams.uri}, ` + `Diagnostic count: ${firstFile.diagnostics.length}, ` + `Error: ${err3.message}`); + } catch (error41) { + const err2 = toError(error41); + logError2(err2); + logForDebugging(`Error registering LSP diagnostics from ${serverName}: ` + `URI: ${diagnosticParams.uri}, ` + `Diagnostic count: ${firstFile.diagnostics.length}, ` + `Error: ${err2.message}`); const failures = diagnosticFailures.get(serverName) || { count: 0, lastError: "" }; failures.count++; - failures.lastError = err3.message; + failures.lastError = err2.message; diagnosticFailures.set(serverName, failures); if (failures.count >= 3) { logForDebugging(`WARNING: LSP diagnostic handler for ${serverName} has failed ${failures.count} times consecutively. ` + `Last error: ${failures.lastError}. ` + `This may indicate a problem with the LSP server or diagnostic processing. ` + `Check logs for details.`); } } - } catch (error45) { - const err3 = toError(error45); - logError2(err3); - logForDebugging(`Unexpected error processing diagnostics from ${serverName}: ${err3.message}`); + } catch (error41) { + const err2 = toError(error41); + logError2(err2); + logForDebugging(`Unexpected error processing diagnostics from ${serverName}: ${err2.message}`); const failures = diagnosticFailures.get(serverName) || { count: 0, lastError: "" }; failures.count++; - failures.lastError = err3.message; + failures.lastError = err2.message; diagnosticFailures.set(serverName, failures); if (failures.count >= 3) { logForDebugging(`WARNING: LSP diagnostic handler for ${serverName} has failed ${failures.count} times consecutively. ` + `Last error: ${failures.lastError}. ` + `This may indicate a problem with the LSP server or diagnostic processing. ` + `Check logs for details.`); @@ -476048,14 +399659,14 @@ function registerLSPNotificationHandlers(manager) { }); logForDebugging(`Registered diagnostics handler for ${serverName}`); successCount++; - } catch (error45) { - const err3 = toError(error45); + } catch (error41) { + const err2 = toError(error41); registrationErrors.push({ serverName, - error: err3.message + error: err2.message }); - logError2(err3); - logForDebugging(`Failed to register diagnostics handler for ${serverName}: ` + `Error: ${err3.message}`); + logError2(err2); + logForDebugging(`Failed to register diagnostics handler for ${serverName}: ` + `Error: ${err2.message}`); } } const totalServers = servers.size; @@ -476122,8 +399733,8 @@ async function waitForInitialization() { if (initializationState === "success" || initializationState === "failed") { return; } - if (initializationState === "pending" && initializationPromise3) { - await initializationPromise3; + if (initializationState === "pending" && initializationPromise2) { + await initializationPromise2; } } function initializeLspServerManager() { @@ -476144,7 +399755,7 @@ function initializeLspServerManager() { logForDebugging("[LSP MANAGER] Created manager instance, state=pending"); const currentGeneration = ++initializationGeneration; logForDebugging(`[LSP MANAGER] Starting async initialization (generation ${currentGeneration})`); - initializationPromise3 = lspManagerInstance.initialize().then(() => { + initializationPromise2 = lspManagerInstance.initialize().then(() => { if (currentGeneration === initializationGeneration) { initializationState = "success"; logForDebugging("LSP server manager initialized successfully"); @@ -476152,13 +399763,13 @@ function initializeLspServerManager() { registerLSPNotificationHandlers(lspManagerInstance); } } - }).catch((error45) => { + }).catch((error41) => { if (currentGeneration === initializationGeneration) { initializationState = "failed"; - initializationError = error45; + initializationError = error41; lspManagerInstance = undefined; - logError2(error45); - logForDebugging(`Failed to initialize LSP server manager: ${errorMessage(error45)}`); + logError2(error41); + logForDebugging(`Failed to initialize LSP server manager: ${errorMessage(error41)}`); } }); } @@ -476168,8 +399779,8 @@ function reinitializeLspServerManager() { } logForDebugging("[LSP MANAGER] reinitializeLspServerManager() called"); if (lspManagerInstance) { - lspManagerInstance.shutdown().catch((err3) => { - logForDebugging(`[LSP MANAGER] old instance shutdown during reinit failed: ${errorMessage(err3)}`); + lspManagerInstance.shutdown().catch((err2) => { + logForDebugging(`[LSP MANAGER] old instance shutdown during reinit failed: ${errorMessage(err2)}`); }); } lspManagerInstance = undefined; @@ -476184,18 +399795,18 @@ async function shutdownLspServerManager() { try { await lspManagerInstance.shutdown(); logForDebugging("LSP server manager shut down successfully"); - } catch (error45) { - logError2(error45); - logForDebugging(`Failed to shutdown LSP server manager: ${errorMessage(error45)}`); + } catch (error41) { + logError2(error41); + logForDebugging(`Failed to shutdown LSP server manager: ${errorMessage(error41)}`); } finally { lspManagerInstance = undefined; initializationState = "not-started"; initializationError = undefined; - initializationPromise3 = undefined; + initializationPromise2 = undefined; initializationGeneration++; } } -var lspManagerInstance, initializationState = "not-started", initializationError, initializationGeneration = 0, initializationPromise3; +var lspManagerInstance, initializationState = "not-started", initializationError, initializationGeneration = 0, initializationPromise2; var init_manager = __esm(() => { init_debug(); init_envUtils(); @@ -476244,7 +399855,7 @@ function ruleIdToLabel(ruleId) { return ruleId.split("-").map((part) => specialCase[part] ?? capitalize2(part)).join(" "); } function scanForSecrets(content) { - const matches3 = []; + const matches2 = []; const seen = new Set; for (const rule of getCompiledRules()) { if (seen.has(rule.id)) { @@ -476252,13 +399863,13 @@ function scanForSecrets(content) { } if (rule.re.test(content)) { seen.add(rule.id); - matches3.push({ + matches2.push({ ruleId: rule.id, label: ruleIdToLabel(rule.id) }); } } - return matches3; + return matches2; } function getSecretLabel(ruleId) { return ruleIdToLabel(ruleId); @@ -476432,11 +400043,11 @@ function checkTeamMemSecrets(filePath, content) { if (!isTeamMemPath2(filePath)) { return null; } - const matches3 = scanForSecrets2(content); - if (matches3.length === 0) { + const matches2 = scanForSecrets2(content); + if (matches2.length === 0) { return null; } - const labels = matches3.map((m) => m.label).join(", "); + const labels = matches2.map((m) => m.label).join(", "); return `Content contains potential secrets (${labels}) and cannot be written to team memory. ` + "Team memory is shared with all repository collaborators. " + "Remove the sensitive content and try again."; } return null; @@ -476450,11 +400061,11 @@ function parseArguments2(args) { if (!args || !args.trim()) { return []; } - const result3 = tryParseShellCommand(args, (key) => `$${key}`); - if (!result3.success) { + const result2 = tryParseShellCommand(args, (key) => `$${key}`); + if (!result2.success) { return args.split(/\s+/).filter(Boolean); } - return result3.tokens.filter((token) => typeof token === "string"); + return result2.tokens.filter((token) => typeof token === "string"); } function parseArgumentNames(argumentNames) { if (!argumentNames) { @@ -476481,11 +400092,11 @@ function substituteArguments(content, args, appendIfNoPlaceholder = true, argume } const parsedArgs = parseArguments2(args); const originalContent = content; - for (let i4 = 0;i4 < argumentNames.length; i4++) { - const name = argumentNames[i4]; + for (let i3 = 0;i3 < argumentNames.length; i3++) { + const name = argumentNames[i3]; if (!name) continue; - content = content.replace(new RegExp(`\\$${name}(?![\\[\\w])`, "g"), parsedArgs[i4] ?? ""); + content = content.replace(new RegExp(`\\$${name}(?![\\[\\w])`, "g"), parsedArgs[i3] ?? ""); } content = content.replace(/\$ARGUMENTS\[(\d+)\]/g, (_, indexStr) => { const index = parseInt(indexStr, 10); @@ -476704,25 +400315,25 @@ class CircularBuffer { } } getRecent(count3) { - const result3 = []; + const result2 = []; const start = this.size < this.capacity ? 0 : this.head; const available = Math.min(count3, this.size); - for (let i4 = 0;i4 < available; i4++) { - const index = (start + this.size - available + i4) % this.capacity; - result3.push(this.buffer[index]); + for (let i3 = 0;i3 < available; i3++) { + const index = (start + this.size - available + i3) % this.capacity; + result2.push(this.buffer[index]); } - return result3; + return result2; } toArray() { if (this.size === 0) return []; - const result3 = []; + const result2 = []; const start = this.size < this.capacity ? 0 : this.head; - for (let i4 = 0;i4 < this.size; i4++) { - const index = (start + i4) % this.capacity; - result3.push(this.buffer[index]); + for (let i3 = 0;i3 < this.size; i3++) { + const index = (start + i3) % this.capacity; + result2.push(this.buffer[index]); } - return result3; + return result2; } clear() { this.buffer.length = 0; @@ -476741,22 +400352,22 @@ function validateBoundedIntEnvVar(name, value, defaultValue, upperLimit) { } const parsed = parseInt(value, 10); if (isNaN(parsed) || parsed <= 0) { - const result3 = { + const result2 = { effective: defaultValue, status: "invalid", message: `Invalid value "${value}" (using default: ${defaultValue})` }; - logForDebugging(`${name} ${result3.message}`); - return result3; + logForDebugging(`${name} ${result2.message}`); + return result2; } if (parsed > upperLimit) { - const result3 = { + const result2 = { effective: upperLimit, status: "capped", message: `Capped from ${parsed} to ${upperLimit}` }; - logForDebugging(`${name} ${result3.message}`); - return result3; + logForDebugging(`${name} ${result2.message}`); + return result2; } return { effective: parsed, status: "valid" }; } @@ -476766,8 +400377,8 @@ var init_envValidation = __esm(() => { // src/utils/shell/outputLimits.ts function getMaxOutputLength() { - const result3 = validateBoundedIntEnvVar("BASH_MAX_OUTPUT_LENGTH", process.env.BASH_MAX_OUTPUT_LENGTH, BASH_MAX_OUTPUT_DEFAULT, BASH_MAX_OUTPUT_UPPER_LIMIT); - return result3.effective; + const result2 = validateBoundedIntEnvVar("BASH_MAX_OUTPUT_LENGTH", process.env.BASH_MAX_OUTPUT_LENGTH, BASH_MAX_OUTPUT_DEFAULT, BASH_MAX_OUTPUT_UPPER_LIMIT); + return result2.effective; } var BASH_MAX_OUTPUT_UPPER_LIMIT = 150000, BASH_MAX_OUTPUT_DEFAULT = 30000; var init_outputLimits = __esm(() => { @@ -476913,8 +400524,8 @@ var init_TaskOutput = __esm(() => { pos = prev; } this.#totalLines += lineCount; - for (let i4 = lines.length - 1;i4 >= 0; i4--) { - this.#recentLines.add(lines[i4]); + for (let i3 = lines.length - 1;i3 >= 0; i3--) { + this.#recentLines.add(lines[i3]); } if (this.#onProgress && lines.length > 0) { const recent = this.#recentLines.getRecent(5); @@ -476946,30 +400557,30 @@ var init_TaskOutput = __esm(() => { } if (this.#disk) { const recent = this.#recentLines.getRecent(5); - const tail3 = safeJoinLines(recent, ` + const tail2 = safeJoinLines(recent, ` `); const sizeKB = Math.round(this.#totalBytes / 1024); const notice = ` Output truncated (${sizeKB}KB total). Full output saved to: ${this.path}`; - return tail3 ? tail3 + notice : notice.trimStart(); + return tail2 ? tail2 + notice : notice.trimStart(); } return this.#stdoutBuffer; } async#readStdoutFromFile() { const maxBytes = getMaxOutputLength(); try { - const result3 = await readFileRange(this.path, 0, maxBytes); - if (!result3) { + const result2 = await readFileRange(this.path, 0, maxBytes); + if (!result2) { this.#outputFileRedundant = true; return ""; } - const { content, bytesRead, bytesTotal } = result3; + const { content, bytesRead, bytesTotal } = result2; this.#outputFileSize = bytesTotal; this.#outputFileRedundant = bytesTotal <= bytesRead; return content; - } catch (err3) { - const code = err3 instanceof Error && "code" in err3 ? String(err3.code) : "unknown"; - logForDebugging(`TaskOutput.#readStdoutFromFile: failed to read ${this.path} (${code}): ${err3}`); + } catch (err2) { + const code = err2 instanceof Error && "code" in err2 ? String(err2.code) : "unknown"; + logForDebugging(`TaskOutput.#readStdoutFromFile: failed to read ${this.path} (${code}): ${err2}`); return ``; } } @@ -477061,10 +400672,10 @@ function rearrangePipeCommand(command) { return singleQuoteForEval(parts.join(" ")); } function findFirstPipeOperator(parsed) { - for (let i4 = 0;i4 < parsed.length; i4++) { - const entry = parsed[i4]; + for (let i3 = 0;i3 < parsed.length; i3++) { + const entry = parsed[i3]; if (isOperator(entry, "|")) { - return i4; + return i3; } } return -1; @@ -477072,26 +400683,26 @@ function findFirstPipeOperator(parsed) { function buildCommandParts(parsed, start, end) { const parts = []; let seenNonEnvVar = false; - for (let i4 = start;i4 < end; i4++) { - const entry = parsed[i4]; - if (typeof entry === "string" && /^[012]$/.test(entry) && i4 + 2 < end && isOperator(parsed[i4 + 1])) { - const op = parsed[i4 + 1]; - const target = parsed[i4 + 2]; + for (let i3 = start;i3 < end; i3++) { + const entry = parsed[i3]; + if (typeof entry === "string" && /^[012]$/.test(entry) && i3 + 2 < end && isOperator(parsed[i3 + 1])) { + const op = parsed[i3 + 1]; + const target = parsed[i3 + 2]; if (op.op === ">&" && typeof target === "string" && /^[012]$/.test(target)) { parts.push(`${entry}>&${target}`); - i4 += 2; + i3 += 2; continue; } if (op.op === ">" && target === "/dev/null") { parts.push(`${entry}>/dev/null`); - i4 += 2; + i3 += 2; continue; } if (op.op === ">" && typeof target === "string" && target.startsWith("&")) { - const fd3 = target.slice(1); - if (/^[012]$/.test(fd3)) { - parts.push(`${entry}>&${fd3}`); - i4 += 2; + const fd2 = target.slice(1); + if (/^[012]$/.test(fd2)) { + parts.push(`${entry}>&${fd2}`); + i3 += 2; continue; } } @@ -477157,10 +400768,10 @@ var init_bashPipeCommand = __esm(() => { }); // src/utils/bash/ShellSnapshot.ts -import { execFile as execFile5 } from "child_process"; -import { mkdir as mkdir22, stat as stat25 } from "fs/promises"; -import * as os5 from "os"; -import { join as join90 } from "path"; +import { execFile as execFile4 } from "child_process"; +import { mkdir as mkdir22, stat as stat24 } from "fs/promises"; +import * as os4 from "os"; +import { join as join80 } from "path"; function createArgv0ShellFunction(funcName, argv0, binaryPath, prependArgs = []) { const quotedPath = quote([binaryPath]); const argSuffix = prependArgs.length > 0 ? `${prependArgs.join(" ")} "$@"` : '"$@"'; @@ -477216,7 +400827,7 @@ function createFindGrepShellIntegration() { } function getConfigFile(shellPath) { const fileName = shellPath.includes("zsh") ? ".zshrc" : shellPath.includes("bash") ? ".bashrc" : ".profile"; - const configPath = join90(os5.homedir(), fileName); + const configPath = join80(os4.homedir(), fileName); return configPath; } function getUserSnapshotContent(configFile) { @@ -477360,7 +400971,7 @@ async function getSnapshotScript(shellPath, snapshotFilePath, configFileExists) var LITERAL_BACKSLASH = "\\", SNAPSHOT_CREATION_TIMEOUT = 1e4, VCS_DIRECTORIES_TO_EXCLUDE, createAndSaveSnapshot = async (binShell) => { const shellType = binShell.includes("zsh") ? "zsh" : binShell.includes("bash") ? "bash" : "sh"; logForDebugging(`Creating shell snapshot for ${shellType} (${binShell})`); - return new Promise(async (resolve30) => { + return new Promise(async (resolve24) => { try { const configFile = getConfigFile(binShell); logForDebugging(`Looking for shell config file: ${configFile}`); @@ -477370,14 +400981,14 @@ var LITERAL_BACKSLASH = "\\", SNAPSHOT_CREATION_TIMEOUT = 1e4, VCS_DIRECTORIES_T } const timestamp2 = Date.now(); const randomId = Math.random().toString(36).substring(2, 8); - const snapshotsDir = join90(getClaudeConfigHomeDir(), "shell-snapshots"); + const snapshotsDir = join80(getClaudeConfigHomeDir(), "shell-snapshots"); logForDebugging(`Snapshots directory: ${snapshotsDir}`); - const shellSnapshotPath = join90(snapshotsDir, `snapshot-${shellType}-${timestamp2}-${randomId}.sh`); + const shellSnapshotPath = join80(snapshotsDir, `snapshot-${shellType}-${timestamp2}-${randomId}.sh`); await mkdir22(snapshotsDir, { recursive: true }); const snapshotScript = await getSnapshotScript(binShell, shellSnapshotPath, configFileExists); logForDebugging(`Creating snapshot at: ${shellSnapshotPath}`); logForDebugging(`Execution timeout: ${SNAPSHOT_CREATION_TIMEOUT}ms`); - execFile5(binShell, ["-c", "-l", snapshotScript], { + execFile4(binShell, ["-c", "-l", snapshotScript], { env: { ...process.env.CLAUDE_CODE_DONT_INHERIT_ENV ? {} : subprocessEnv(), SHELL: binShell, @@ -477387,10 +400998,10 @@ var LITERAL_BACKSLASH = "\\", SNAPSHOT_CREATION_TIMEOUT = 1e4, VCS_DIRECTORIES_T timeout: SNAPSHOT_CREATION_TIMEOUT, maxBuffer: 1024 * 1024, encoding: "utf8" - }, async (error45, stdout, stderr) => { - if (error45) { - const execError = error45; - logForDebugging(`Shell snapshot creation failed: ${error45.message}`); + }, async (error41, stdout, stderr) => { + if (error41) { + const execError = error41; + logForDebugging(`Shell snapshot creation failed: ${error41.message}`); logForDebugging(`Error details:`); logForDebugging(` - Error code: ${execError?.code}`); logForDebugging(` - Error signal: ${execError?.signal}`); @@ -477413,19 +401024,19 @@ ${stdout}`); } else { logForDebugging(`No stderr output captured`); } - logError2(new Error(`Failed to create shell snapshot: ${error45.message}`)); - const signalNumber = execError?.signal ? os5.constants.signals[execError.signal] : undefined; + logError2(new Error(`Failed to create shell snapshot: ${error41.message}`)); + const signalNumber = execError?.signal ? os4.constants.signals[execError.signal] : undefined; logEvent("tengu_shell_snapshot_failed", { stderr_length: stderr?.length || 0, has_error_code: !!execError?.code, error_signal_number: signalNumber, error_killed: execError?.killed }); - resolve30(undefined); + resolve24(undefined); } else { let snapshotSize; try { - snapshotSize = (await stat25(shellSnapshotPath)).size; + snapshotSize = (await stat24(shellSnapshotPath)).size; } catch {} if (snapshotSize !== undefined) { logForDebugging(`Shell snapshot created successfully (${snapshotSize} bytes)`); @@ -477433,11 +401044,11 @@ ${stdout}`); try { await getFsImplementation().unlink(shellSnapshotPath); logForDebugging(`Cleaned up session snapshot: ${shellSnapshotPath}`); - } catch (error46) { - logForDebugging(`Error cleaning up session snapshot: ${error46}`); + } catch (error42) { + logForDebugging(`Error cleaning up session snapshot: ${error42}`); } }); - resolve30(shellSnapshotPath); + resolve24(shellSnapshotPath); } else { logForDebugging(`Shell snapshot file not found after creation: ${shellSnapshotPath}`); logForDebugging(`Checking if parent directory still exists: ${snapshotsDir}`); @@ -477448,18 +401059,18 @@ ${stdout}`); logForDebugging(`Parent directory does not exist or is not accessible: ${snapshotsDir}`); } logEvent("tengu_shell_unknown_error", {}); - resolve30(undefined); + resolve24(undefined); } } }); - } catch (error45) { - logForDebugging(`Unexpected error during snapshot creation: ${error45}`); - if (error45 instanceof Error) { - logForDebugging(`Error stack trace: ${error45.stack}`); + } catch (error41) { + logForDebugging(`Unexpected error during snapshot creation: ${error41}`); + if (error41 instanceof Error) { + logForDebugging(`Error stack trace: ${error41.stack}`); } - logError2(error45); + logError2(error41); logEvent("tengu_shell_snapshot_error", {}); - resolve30(undefined); + resolve24(undefined); } }); }; @@ -477567,21 +401178,21 @@ var init_sessionEnvVars = __esm(() => { import { posix as posix4 } from "path"; async function execTmux(args, opts) { if (getPlatform() === "windows") { - const result4 = await execFileNoThrow("wsl", ["-e", TMUX_COMMAND2, ...args], { + const result3 = await execFileNoThrow("wsl", ["-e", TMUX_COMMAND2, ...args], { env: { ...process.env, WSL_UTF8: "1" }, ...opts }); return { - stdout: result4.stdout || "", - stderr: result4.stderr || "", - code: result4.code || 0 + stdout: result3.stdout || "", + stderr: result3.stderr || "", + code: result3.code || 0 }; } - const result3 = await execFileNoThrow(TMUX_COMMAND2, args, opts); + const result2 = await execFileNoThrow(TMUX_COMMAND2, args, opts); return { - stdout: result3.stdout || "", - stderr: result3.stderr || "", - code: result3.code || 0 + stdout: result2.stdout || "", + stderr: result2.stderr || "", + code: result2.code || 0 }; } function getClaudeSocketName() { @@ -477590,8 +401201,8 @@ function getClaudeSocketName() { } return socketName; } -function setClaudeSocketInfo(path20, pid) { - socketPath = path20; +function setClaudeSocketInfo(path15, pid) { + socketPath = path15; serverPid = pid; } function isSocketInitialized() { @@ -477605,13 +401216,13 @@ function getClaudeTmuxEnv() { } async function checkTmuxAvailable() { if (!tmuxAvailabilityChecked) { - const result3 = getPlatform() === "windows" ? await execFileNoThrow("wsl", ["-e", TMUX_COMMAND2, "-V"], { + const result2 = getPlatform() === "windows" ? await execFileNoThrow("wsl", ["-e", TMUX_COMMAND2, "-V"], { env: { ...process.env, WSL_UTF8: "1" }, useCwd: false }) : await execFileNoThrow("which", [TMUX_COMMAND2], { useCwd: false }); - tmuxAvailable = result3.code === 0; + tmuxAvailable = result2.code === 0; if (!tmuxAvailable) { logForDebugging(`[Socket] tmux is not installed. The Tmux tool and Teammate tool will not be available.`); } @@ -477640,10 +401251,10 @@ async function ensureSocketInitialized() { initPromise = doInitialize(); try { await initPromise; - } catch (error45) { - const err3 = toError(error45); - logError2(err3); - logForDebugging(`[Socket] Failed to initialize tmux socket: ${err3.message}. Tmux isolation will be disabled.`); + } catch (error41) { + const err2 = toError(error41); + logError2(err2); + logForDebugging(`[Socket] Failed to initialize tmux socket: ${err2.message}. Tmux isolation will be disabled.`); } finally { isInitializing = false; } @@ -477651,16 +401262,16 @@ async function ensureSocketInitialized() { async function killTmuxServer() { const socket = getClaudeSocketName(); logForDebugging(`[Socket] Killing tmux server for socket: ${socket}`); - const result3 = await execTmux(["-L", socket, "kill-server"]); - if (result3.code === 0) { + const result2 = await execTmux(["-L", socket, "kill-server"]); + if (result2.code === 0) { logForDebugging(`[Socket] Successfully killed tmux server`); } else { - logForDebugging(`[Socket] Failed to kill tmux server (exit ${result3.code}): ${result3.stderr}`); + logForDebugging(`[Socket] Failed to kill tmux server (exit ${result2.code}): ${result2.stderr}`); } } async function doInitialize() { const socket = getClaudeSocketName(); - const result3 = await execTmux([ + const result2 = await execTmux([ "-L", socket, "new-session", @@ -477671,7 +401282,7 @@ async function doInitialize() { "CLAUDE_CODE_SKIP_PROMPT_HISTORY=true", ...getPlatform() === "windows" ? ["-e", "WSL_INTEROP=/run/WSL/1_interop"] : [] ]); - if (result3.code !== 0) { + if (result2.code !== 0) { const checkResult = await execTmux([ "-L", socket, @@ -477680,7 +401291,7 @@ async function doInitialize() { "base" ]); if (checkResult.code !== 0) { - throw new Error(`Failed to create tmux session on socket ${socket}: ${result3.stderr}`); + throw new Error(`Failed to create tmux session on socket ${socket}: ${result2.stderr}`); } } registerCleanup(killTmuxServer); @@ -477710,11 +401321,11 @@ async function doInitialize() { "#{socket_path},#{pid}" ]); if (infoResult.code === 0) { - const [path20, pidStr] = infoResult.stdout.trim().split(","); - if (path20 && pidStr) { + const [path15, pidStr] = infoResult.stdout.trim().split(","); + if (path15 && pidStr) { const pid = parseInt(pidStr, 10); if (!isNaN(pid)) { - setClaudeSocketInfo(path20, pid); + setClaudeSocketInfo(path15, pid); return; } } @@ -477758,7 +401369,7 @@ var init_tmuxSocket = __esm(() => { // src/utils/shell/bashProvider.ts import { access as access4 } from "fs/promises"; import { tmpdir as osTmpdir } from "os"; -import { join as nativeJoin3 } from "path"; +import { join as nativeJoin2 } from "path"; import { join as posixJoin } from "path/posix"; function getDisableExtglobCommand(shellPath) { if (process.env.CLAUDE_CODE_SHELL_PREFIX) { @@ -477773,8 +401384,8 @@ function getDisableExtglobCommand(shellPath) { } async function createBashShellProvider(shellPath, options2) { let currentSandboxTmpDir; - const snapshotPromise = options2?.skipSnapshot ? Promise.resolve(undefined) : createAndSaveSnapshot(shellPath).catch((error45) => { - logForDebugging(`Failed to create shell snapshot: ${error45}`); + const snapshotPromise = options2?.skipSnapshot ? Promise.resolve(undefined) : createAndSaveSnapshot(shellPath).catch((error41) => { + logForDebugging(`Failed to create shell snapshot: ${error41}`); return; }); let lastSnapshotFilePath; @@ -477794,11 +401405,11 @@ async function createBashShellProvider(shellPath, options2) { } lastSnapshotFilePath = snapshotFilePath; currentSandboxTmpDir = opts.sandboxTmpDir; - const tmpdir8 = osTmpdir(); + const tmpdir5 = osTmpdir(); const isWindows2 = getPlatform() === "windows"; - const shellTmpdir = isWindows2 ? windowsPathToPosixPath(tmpdir8) : tmpdir8; + const shellTmpdir = isWindows2 ? windowsPathToPosixPath(tmpdir5) : tmpdir5; const shellCwdFilePath = opts.useSandbox ? posixJoin(opts.sandboxTmpDir, `cwd-${opts.id}`) : posixJoin(shellTmpdir, `claude-${opts.id}-cwd`); - const cwdFilePath = opts.useSandbox ? posixJoin(opts.sandboxTmpDir, `cwd-${opts.id}`) : nativeJoin3(tmpdir8, `claude-${opts.id}-cwd`); + const cwdFilePath = opts.useSandbox ? posixJoin(opts.sandboxTmpDir, `cwd-${opts.id}`) : nativeJoin2(tmpdir5, `claude-${opts.id}-cwd`); const normalizedCommand = rewriteWindowsNullRedirect(command); const addStdinRedirect = shouldAddStdinRedirect(normalizedCommand); let quotedCommand = quoteShellCommand(normalizedCommand, addStdinRedirect); @@ -477846,23 +401457,23 @@ ${quotedCommand.slice(0, 500)}`); await ensureSocketInitialized(); } const claudeTmuxEnv = getClaudeTmuxEnv(); - const env5 = {}; + const env4 = {}; if (claudeTmuxEnv) { - env5.TMUX = claudeTmuxEnv; + env4.TMUX = claudeTmuxEnv; } if (currentSandboxTmpDir) { let posixTmpDir = currentSandboxTmpDir; if (getPlatform() === "windows") { posixTmpDir = windowsPathToPosixPath(posixTmpDir); } - env5.TMPDIR = posixTmpDir; - env5.CLAUDE_CODE_TMPDIR = posixTmpDir; - env5.TMPPREFIX = posixJoin(posixTmpDir, "zsh"); + env4.TMPDIR = posixTmpDir; + env4.CLAUDE_CODE_TMPDIR = posixTmpDir; + env4.TMPPREFIX = posixJoin(posixTmpDir, "zsh"); } for (const [key, value] of getSessionEnvVars()) { - env5[key] = value; + env4[key] = value; } - return env5; + return env4; } }; } @@ -477882,10 +401493,10 @@ var init_bashProvider = __esm(() => { }); // src/utils/shell/powershellDetection.ts -import { realpath as realpath9, stat as stat26 } from "fs/promises"; +import { realpath as realpath9, stat as stat25 } from "fs/promises"; async function probePath(p) { try { - return (await stat26(p)).isFile() ? p : null; + return (await stat25(p)).isFile() ? p : null; } catch { return null; } @@ -477933,8 +401544,8 @@ var init_powershellDetection = __esm(() => { }); // src/utils/shell/powershellProvider.ts -import { tmpdir as tmpdir8 } from "os"; -import { join as join91 } from "path"; +import { tmpdir as tmpdir5 } from "os"; +import { join as join81 } from "path"; import { join as posixJoin2 } from "path/posix"; function buildPowerShellArgs(cmd) { return ["-NoProfile", "-NonInteractive", "-Command", cmd]; @@ -477950,7 +401561,7 @@ function createPowerShellProvider(shellPath) { detached: false, async buildExecCommand(command, opts) { currentSandboxTmpDir = opts.useSandbox ? opts.sandboxTmpDir : undefined; - const cwdFilePath = opts.useSandbox && opts.sandboxTmpDir ? posixJoin2(opts.sandboxTmpDir, `claude-pwd-ps-${opts.id}`) : join91(tmpdir8(), `claude-pwd-ps-${opts.id}`); + const cwdFilePath = opts.useSandbox && opts.sandboxTmpDir ? posixJoin2(opts.sandboxTmpDir, `claude-pwd-ps-${opts.id}`) : join81(tmpdir5(), `claude-pwd-ps-${opts.id}`); const escapedCwdFilePath = cwdFilePath.replace(/'/g, "''"); const cwdTracking = ` ; $_ec = if ($null -ne $LASTEXITCODE) { $LASTEXITCODE } elseif ($?) { 0 } else { 1 } @@ -477970,15 +401581,15 @@ function createPowerShellProvider(shellPath) { return buildPowerShellArgs(commandString); }, async getEnvironmentOverrides() { - const env5 = {}; + const env4 = {}; for (const [key, value] of getSessionEnvVars()) { - env5[key] = value; + env4[key] = value; } if (currentSandboxTmpDir) { - env5.TMPDIR = currentSandboxTmpDir; - env5.CLAUDE_CODE_TMPDIR = currentSandboxTmpDir; + env4.TMPDIR = currentSandboxTmpDir; + env4.CLAUDE_CODE_TMPDIR = currentSandboxTmpDir; } - return env5; + return env4; } }; } @@ -477987,10 +401598,10 @@ var init_powershellProvider = __esm(() => { }); // src/utils/Shell.ts -import { execFileSync as execFileSync2, spawn as spawn8 } from "child_process"; -import { constants as fsConstants4, readFileSync as readFileSync18, unlinkSync as unlinkSync3 } from "fs"; +import { execFileSync as execFileSync2, spawn as spawn5 } from "child_process"; +import { constants as fsConstants4, readFileSync as readFileSync11, unlinkSync as unlinkSync2 } from "fs"; import { mkdir as mkdir23, open as open9, realpath as realpath10 } from "fs/promises"; -import { isAbsolute as isAbsolute16, resolve as resolve30 } from "path"; +import { isAbsolute as isAbsolute15, resolve as resolve24 } from "path"; import { join as posixJoin3 } from "path/posix"; import { accessSync } from "fs"; function isExecutable(shellPath) { @@ -478026,7 +401637,7 @@ async function findSuitableShell() { const [zshPath, bashPath] = await Promise.all([which("zsh"), which("bash")]); const shellPaths = ["/bin", "/usr/bin", "/usr/local/bin", "/opt/homebrew/bin"]; const shellOrder = preferBash ? ["bash", "zsh"] : ["zsh", "bash"]; - const supportedShells = shellOrder.flatMap((shell) => shellPaths.map((path20) => `${path20}/${shell}`)); + const supportedShells = shellOrder.flatMap((shell) => shellPaths.map((path15) => `${path15}/${shell}`)); if (preferBash) { if (bashPath) supportedShells.unshift(bashPath); @@ -478096,10 +401707,10 @@ async function exec2(command, abortSignal, shellType, options2) { if (shouldUseSandbox) { commandString = await SandboxManager2.wrapWithSandbox(commandString, sandboxBinShell, undefined, abortSignal); try { - const fs11 = getFsImplementation(); - await fs11.mkdir(sandboxTmpDir, { mode: 448 }); - } catch (error45) { - logForDebugging(`Failed to create ${sandboxTmpDir} directory: ${error45}`); + const fs5 = getFsImplementation(); + await fs5.mkdir(sandboxTmpDir, { mode: 448 }); + } catch (error41) { + logForDebugging(`Failed to create ${sandboxTmpDir} directory: ${error41}`); } } const spawnBinary = isSandboxedPowerShell ? "/bin/sh" : binShell; @@ -478115,7 +401726,7 @@ async function exec2(command, abortSignal, shellType, options2) { outputHandle = await open9(taskOutput.path, process.platform === "win32" ? "w" : fsConstants4.O_WRONLY | fsConstants4.O_CREAT | fsConstants4.O_APPEND | O_NOFOLLOW); } try { - const childProcess = spawn8(spawnBinary, shellArgs, { + const childProcess = spawn5(spawnBinary, shellArgs, { env: { ...subprocessEnv(), SHELL: shellType === "bash" ? binShell : undefined, @@ -478138,18 +401749,18 @@ async function exec2(command, abortSignal, shellType, options2) { } catch {} } if (childProcess.stdout && onStdout) { - childProcess.stdout.on("data", (chunk3) => { - onStdout(typeof chunk3 === "string" ? chunk3 : chunk3.toString()); + childProcess.stdout.on("data", (chunk2) => { + onStdout(typeof chunk2 === "string" ? chunk2 : chunk2.toString()); }); } const nativeCwdFilePath = getPlatform() === "windows" ? posixPathToWindowsPath(cwdFilePath) : cwdFilePath; - shellCommand.result.then(async (result3) => { + shellCommand.result.then(async (result2) => { if (shouldUseSandbox) { SandboxManager2.cleanupAfterCommand(); } - if (result3 && !preventCwdChanges && !result3.backgroundTaskId) { + if (result2 && !preventCwdChanges && !result2.backgroundTaskId) { try { - let newCwd = readFileSync18(nativeCwdFilePath, { + let newCwd = readFileSync11(nativeCwdFilePath, { encoding: "utf8" }).trim(); if (getPlatform() === "windows") { @@ -478165,26 +401776,26 @@ async function exec2(command, abortSignal, shellType, options2) { } } try { - unlinkSync3(nativeCwdFilePath); + unlinkSync2(nativeCwdFilePath); } catch {} }); return shellCommand; - } catch (error45) { + } catch (error41) { if (outputHandle !== undefined) { try { await outputHandle.close(); } catch {} } taskOutput.clear(); - logForDebugging(`Shell exec error: ${errorMessage(error45)}`); + logForDebugging(`Shell exec error: ${errorMessage(error41)}`); return createAbortedCommand(undefined, { code: 126, - stderr: errorMessage(error45) + stderr: errorMessage(error41) }); } } -function setCwd(path20, relativeTo) { - const resolved = isAbsolute16(path20) ? path20 : resolve30(relativeTo || getFsImplementation().cwd(), path20); +function setCwd(path15, relativeTo) { + const resolved = isAbsolute15(path15) ? path15 : resolve24(relativeTo || getFsImplementation().cwd(), path15); let physicalPath; try { physicalPath = getFsImplementation().realpathSync(resolved); @@ -478461,7 +402072,7 @@ var init_ShellProgressMessage = __esm(() => { }); // src/tools/BashTool/sedEditParser.ts -import { randomBytes as randomBytes8 } from "crypto"; +import { randomBytes as randomBytes7 } from "crypto"; function parseSedEditCommand(command) { const trimmed = command.trim(); const sedMatch = trimmed.match(/^\s*sed\s+/); @@ -478484,36 +402095,36 @@ function parseSedEditCommand(command) { let extendedRegex = false; let expression = null; let filePath = null; - let i4 = 0; - while (i4 < args.length) { - const arg = args[i4]; + let i3 = 0; + while (i3 < args.length) { + const arg = args[i3]; if (arg === "-i" || arg === "--in-place") { hasInPlaceFlag = true; - i4++; - if (i4 < args.length) { - const nextArg = args[i4]; + i3++; + if (i3 < args.length) { + const nextArg = args[i3]; if (typeof nextArg === "string" && !nextArg.startsWith("-") && (nextArg === "" || nextArg.startsWith("."))) { - i4++; + i3++; } } continue; } if (arg.startsWith("-i")) { hasInPlaceFlag = true; - i4++; + i3++; continue; } if (arg === "-E" || arg === "-r" || arg === "--regexp-extended") { extendedRegex = true; - i4++; + i3++; continue; } if (arg === "-e" || arg === "--expression") { - if (i4 + 1 < args.length && typeof args[i4 + 1] === "string") { + if (i3 + 1 < args.length && typeof args[i3 + 1] === "string") { if (expression !== null) return null; - expression = args[i4 + 1]; - i4 += 2; + expression = args[i3 + 1]; + i3 += 2; continue; } return null; @@ -478522,7 +402133,7 @@ function parseSedEditCommand(command) { if (expression !== null) return null; expression = arg.slice("--expression=".length); - i4++; + i3++; continue; } if (arg.startsWith("-")) { @@ -478535,7 +402146,7 @@ function parseSedEditCommand(command) { } else { return null; } - i4++; + i3++; } if (!hasInPlaceFlag || !expression || !filePath) { return null; @@ -478544,21 +402155,21 @@ function parseSedEditCommand(command) { if (!substMatch) { return null; } - const rest3 = expression.slice(2); + const rest2 = expression.slice(2); let pattern = ""; let replacement = ""; let flags = ""; let state = "pattern"; let j = 0; - while (j < rest3.length) { - const char = rest3[j]; - if (char === "\\" && j + 1 < rest3.length) { + while (j < rest2.length) { + const char = rest2[j]; + if (char === "\\" && j + 1 < rest2.length) { if (state === "pattern") { - pattern += char + rest3[j + 1]; + pattern += char + rest2[j + 1]; } else if (state === "replacement") { - replacement += char + rest3[j + 1]; + replacement += char + rest2[j + 1]; } else { - flags += char + rest3[j + 1]; + flags += char + rest2[j + 1]; } j += 2; continue; @@ -478613,7 +402224,7 @@ function applySedSubstitution(content, sedInfo) { if (!sedInfo.extendedRegex) { jsPattern = jsPattern.replace(/\\\\/g, BACKSLASH_PLACEHOLDER).replace(/\\\+/g, PLUS_PLACEHOLDER).replace(/\\\?/g, QUESTION_PLACEHOLDER).replace(/\\\|/g, PIPE_PLACEHOLDER).replace(/\\\(/g, LPAREN_PLACEHOLDER).replace(/\\\)/g, RPAREN_PLACEHOLDER).replace(/\+/g, "\\+").replace(/\?/g, "\\?").replace(/\|/g, "\\|").replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(BACKSLASH_PLACEHOLDER_RE, "\\\\").replace(PLUS_PLACEHOLDER_RE, "+").replace(QUESTION_PLACEHOLDER_RE, "?").replace(PIPE_PLACEHOLDER_RE, "|").replace(LPAREN_PLACEHOLDER_RE, "(").replace(RPAREN_PLACEHOLDER_RE, ")"); } - const salt = randomBytes8(8).toString("hex"); + const salt = randomBytes7(8).toString("hex"); const ESCAPED_AMP_PLACEHOLDER = `___ESCAPED_AMPERSAND_${salt}___`; const jsReplacement = sedInfo.replacement.replace(/\\\//g, "/").replace(/\\&/g, ESCAPED_AMP_PLACEHOLDER).replace(/&/g, "$$&").replace(new RegExp(ESCAPED_AMP_PLACEHOLDER, "g"), "&"); try { @@ -478699,13 +402310,13 @@ function BackgroundHint(t0) { } return t4; } -function renderToolUseMessage4(input11, { +function renderToolUseMessage4(input, { verbose, theme: _theme }) { const { command - } = input11; + } = input; if (!command) { return null; } @@ -478794,13 +402405,13 @@ function renderToolResultMessage3(content, progressMessagesForMessage, { timeoutMs }, undefined, false, undefined, this); } -function renderToolUseErrorMessage3(result3, { +function renderToolUseErrorMessage3(result2, { verbose, progressMessagesForMessage: _progressMessagesForMessage, tools: _tools }) { return /* @__PURE__ */ jsx_dev_runtime116.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } @@ -478826,7 +402437,7 @@ var init_UI3 = __esm(() => { }); // src/tools/BashTool/utils.ts -import { readFile as readFile24, stat as stat27 } from "fs/promises"; +import { readFile as readFile23, stat as stat26 } from "fs/promises"; function stripEmptyLines(content) { const lines = content.split(` `); @@ -478875,10 +402486,10 @@ function buildImageToolResult(stdout, toolUseID) { async function resizeShellImageOutput(stdout, outputFilePath, outputFileSize) { let source = stdout; if (outputFilePath) { - const size3 = outputFileSize ?? (await stat27(outputFilePath)).size; - if (size3 > MAX_IMAGE_FILE_SIZE) + const size2 = outputFileSize ?? (await stat26(outputFilePath)).size; + if (size2 > MAX_IMAGE_FILE_SIZE) return null; - source = await readFile24(outputFilePath, "utf8"); + source = await readFile23(outputFilePath, "utf8"); } const parsed = parseDataUri(source); if (!parsed) @@ -478934,7 +402545,7 @@ function resetCwdIfOutsideProject(toolPermissionContext) { } var DATA_URI_RE, MAX_IMAGE_FILE_SIZE, stdErrAppendShellResetMessage = (stderr) => `${stderr.trim()} Shell cwd was reset to ${getOriginalCwd()}`; -var init_utils8 = __esm(() => { +var init_utils7 = __esm(() => { init_state(); init_analytics(); init_cwd2(); @@ -478980,10 +402591,10 @@ function parsePrNumberFromText(stdout) { return match?.[1] ? parseInt(match[1], 10) : undefined; } function parseRefFromCommand(command, verb) { - const after3 = command.split(gitCmdRe(verb))[1]; - if (!after3) + const after2 = command.split(gitCmdRe(verb))[1]; + if (!after2) return; - for (const t of after3.trim().split(/\s+/)) { + for (const t of after2.trim().split(/\s+/)) { if (/^[&|;><]/.test(t)) break; if (t.startsWith("-")) @@ -478993,12 +402604,12 @@ function parseRefFromCommand(command, verb) { return; } function detectGitOperation(command, output) { - const result3 = {}; + const result2 = {}; const isCherryPick = GIT_CHERRY_PICK_RE.test(command); if (GIT_COMMIT_RE.test(command) || isCherryPick) { const sha = parseGitCommitId(output); if (sha) { - result3.commit = { + result2.commit = { sha: sha.slice(0, 6), kind: isCherryPick ? "cherry-picked" : /--amend\b/.test(command) ? "amended" : "committed" }; @@ -479007,30 +402618,30 @@ function detectGitOperation(command, output) { if (GIT_PUSH_RE.test(command)) { const branch = parseGitPushBranch(output); if (branch) - result3.push = { branch }; + result2.push = { branch }; } if (GIT_MERGE_RE.test(command) && /(Fast-forward|Merge made by)/.test(output)) { const ref = parseRefFromCommand(command, "merge"); if (ref) - result3.branch = { ref, action: "merged" }; + result2.branch = { ref, action: "merged" }; } if (GIT_REBASE_RE.test(command) && /Successfully rebased/.test(output)) { const ref = parseRefFromCommand(command, "rebase"); if (ref) - result3.branch = { ref, action: "rebased" }; + result2.branch = { ref, action: "rebased" }; } const prAction = GH_PR_ACTIONS.find((a2) => a2.re.test(command))?.action; if (prAction) { const pr = findPrInStdout(output); if (pr) { - result3.pr = { number: pr.prNumber, url: pr.prUrl, action: prAction }; + result2.pr = { number: pr.prNumber, url: pr.prUrl, action: prAction }; } else { const num = parsePrNumberFromText(output); if (num) - result3.pr = { number: num, action: prAction }; + result2.pr = { number: num, action: prAction }; } } - return result3; + return result2; } function trackGitOperations(command, exitCode, stdout) { const success2 = exitCode === 0; @@ -479114,13 +402725,13 @@ function extractBaseCommand(segment) { const stripped = segment.trim().replace(/^[&.]\s+/, ""); const firstToken = stripped.split(/\s+/)[0] || ""; const unquoted = firstToken.replace(/^["']|["']$/g, ""); - const basename22 = unquoted.split(/[\\/]/).pop() || unquoted; - return basename22.toLowerCase().replace(/\.exe$/, ""); + const basename20 = unquoted.split(/[\\/]/).pop() || unquoted; + return basename20.toLowerCase().replace(/\.exe$/, ""); } function heuristicallyExtractBaseCommand(command) { const segments = command.split(/[;|]/).filter((s) => s.trim()); - const last3 = segments[segments.length - 1] || command; - return extractBaseCommand(last3); + const last2 = segments[segments.length - 1] || command; + return extractBaseCommand(last2); } function interpretCommandResult(command, exitCode, stdout, stderr) { const baseCommand = heuristicallyExtractBaseCommand(command); @@ -479151,9 +402762,9 @@ var init_commandSemantics = __esm(() => { // src/utils/powershell/parser.ts function getParseTimeoutMs() { - const env5 = process.env.CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS; - if (env5) { - const parsed = parseInt(env5, 10); + const env4 = process.env.CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS; + if (env4) { + const parsed = parseInt(env4, 10); if (!isNaN(parsed) && parsed > 0) return parsed; } @@ -479166,13 +402777,13 @@ function makeInvalidResult(command, message, errorId) { originalCommand: command }; } -function toUtf16LeBase64(text2) { +function toUtf16LeBase64(text) { if (typeof Buffer !== "undefined") { - return Buffer.from(text2, "utf16le").toString("base64"); + return Buffer.from(text, "utf16le").toString("base64"); } const bytes = []; - for (let i4 = 0;i4 < text2.length; i4++) { - const code = text2.charCodeAt(i4); + for (let i3 = 0;i3 < text.length; i3++) { + const code = text.charCodeAt(i3); bytes.push(code & 255, code >> 8 & 255); } return btoa(bytes.map((b) => String.fromCharCode(b)).join("")); @@ -479289,8 +402900,8 @@ function transformCommandAst(raw) { } name = stripModulePrefix(rawName); elementTypes.push(mapElementType(first.type, first.expressionType)); - for (let i4 = 1;i4 < cmdElements.length; i4++) { - const ce = cmdElements[i4]; + for (let i3 = 1;i3 < cmdElements.length; i3++) { + const ce = cmdElements[i3]; const isStringLiteral = ce.type === "StringConstantExpressionAst" || ce.type === "ExpandableStringExpressionAst"; args.push(isStringLiteral && ce.value != null ? ce.value : ce.text); elementTypes.push(mapElementType(ce.type, ce.expressionType)); @@ -479306,7 +402917,7 @@ function transformCommandAst(raw) { } } } - const result3 = { + const result2 = { name, nameType, elementType: "CommandAst", @@ -479317,9 +402928,9 @@ function transformCommandAst(raw) { }; const rawRedirs = ensureArray(raw.redirections); if (rawRedirs.length > 0) { - result3.redirections = rawRedirs.map(transformRedirection); + result2.redirections = rawRedirs.map(transformRedirection); } - return result3; + return result2; } function transformExpressionElement(raw) { const elementType = raw.type === "ParenExpressionAst" ? "ParenExpressionAst" : "CommandExpressionAst"; @@ -479413,7 +403024,7 @@ function transformStatement(raw) { if (rawNested.length > 0) { nestedCommands = rawNested.map(transformCommandAst); } - const result3 = { + const result2 = { statementType, commands, redirections, @@ -479421,12 +403032,12 @@ function transformStatement(raw) { nestedCommands }; if (raw.securityPatterns) { - result3.securityPatterns = raw.securityPatterns; + result2.securityPatterns = raw.securityPatterns; } - return result3; + return result2; } function transformRawOutput(raw) { - const result3 = { + const result2 = { valid: raw.valid, errors: ensureArray(raw.errors), statements: ensureArray(raw.statements).map(transformStatement), @@ -479436,15 +403047,15 @@ function transformRawOutput(raw) { }; const tl = ensureArray(raw.typeLiterals); if (tl.length > 0) { - result3.typeLiterals = tl; + result2.typeLiterals = tl; } if (raw.hasUsingStatements) { - result3.hasUsingStatements = true; + result2.hasUsingStatements = true; } if (raw.hasScriptRequirements) { - result3.hasScriptRequirements = true; + result2.hasScriptRequirements = true; } - return result3; + return result2; } async function parsePowerShellCommandImpl(command) { const commandBytes = Buffer.byteLength(command, "utf8"); @@ -479470,23 +403081,23 @@ async function parsePowerShellCommandImpl(command) { let stderr = ""; let code = null; let timedOut = false; - for (let attempt3 = 0;attempt3 < 2; attempt3++) { + for (let attempt2 = 0;attempt2 < 2; attempt2++) { try { - const result3 = await execa(pwshPath, args, { + const result2 = await execa(pwshPath, args, { timeout: parseTimeoutMs, reject: false }); - stdout = result3.stdout; - stderr = result3.stderr; - timedOut = result3.timedOut; - code = result3.failed ? result3.exitCode ?? 1 : 0; + stdout = result2.stdout; + stderr = result2.stderr; + timedOut = result2.timedOut; + code = result2.failed ? result2.exitCode ?? 1 : 0; } catch (e) { logForDebugging(`PowerShell parser: failed to spawn pwsh: ${e instanceof Error ? e.message : e}`); return makeInvalidResult(command, `Failed to spawn PowerShell: ${e instanceof Error ? e.message : e}`, "PwshSpawnError"); } if (!timedOut) break; - logForDebugging(`PowerShell parser: pwsh timed out after ${parseTimeoutMs}ms (attempt ${attempt3 + 1})`); + logForDebugging(`PowerShell parser: pwsh timed out after ${parseTimeoutMs}ms (attempt ${attempt2 + 1})`); } if (timedOut) { return makeInvalidResult(command, `pwsh timed out after ${parseTimeoutMs}ms (2 attempts)`, "PwshTimeout"); @@ -479618,8 +403229,8 @@ function deriveSecurityFlags(parsed) { if (!cmd.elementTypes) { return; } - for (const et3 of cmd.elementTypes) { - switch (et3) { + for (const et2 of cmd.elementTypes) { + switch (et2) { case "ScriptBlock": flags.hasScriptBlocks = true; break; @@ -479924,7 +403535,7 @@ $output = @{ $output | ConvertTo-Json -Depth 10 -Compress `, WINDOWS_ARGV_CAP = 32767, FIXED_ARGV_OVERHEAD = 200, ENCODED_CMD_WRAPPER, SAFETY_MARGIN2 = 100, SCRIPT_CHARS_BUDGET, CMD_B64_BUDGET, WINDOWS_MAX_COMMAND_LENGTH, UNIX_MAX_COMMAND_LENGTH = 4500, MAX_COMMAND_LENGTH2, INVALID_RESULT_BASE, TRANSIENT_ERROR_IDS, parsePowerShellCommandCached, COMMON_ALIASES, DIRECTORY_CHANGE_CMDLETS, DIRECTORY_CHANGE_ALIASES, PS_TOKENIZER_DASH_CHARS; -var init_parser6 = __esm(() => { +var init_parser5 = __esm(() => { init_execa(); init_debug(); init_memoize2(); @@ -479951,8 +403562,8 @@ var init_parser6 = __esm(() => { ]); parsePowerShellCommandCached = memoizeWithLRU((command) => { const promise3 = parsePowerShellCommandImpl(command); - promise3.then((result3) => { - if (!result3.valid && TRANSIENT_ERROR_IDS.has(result3.errors[0]?.errorId ?? "")) { + promise3.then((result2) => { + if (!result2.valid && TRANSIENT_ERROR_IDS.has(result2.errors[0]?.errorId ?? "")) { parsePowerShellCommandCached.cache.delete(command); } }); @@ -480060,11 +403671,11 @@ var init_parser6 = __esm(() => { }); // src/tools/PowerShellTool/gitSafety.ts -import { basename as basename22, posix as posix5, resolve as resolve31, sep as sep19 } from "path"; +import { basename as basename20, posix as posix5, resolve as resolve25, sep as sep16 } from "path"; function resolveCwdReentry(normalized) { if (!normalized.startsWith("../")) return normalized; - const cwdBase = basename22(getCwd()).toLowerCase(); + const cwdBase = basename20(getCwd()).toLowerCase(); if (!cwdBase) return normalized; const prefix = "../" + cwdBase + "/"; @@ -480108,8 +403719,8 @@ function normalizeGitPathArg(arg) { } function resolveEscapingPathToCwdRelative(n2) { const cwd2 = getCwd(); - const abs = resolve31(cwd2, n2); - const cwdWithSep = cwd2.endsWith(sep19) ? cwd2 : cwd2 + sep19; + const abs = resolve25(cwd2, n2); + const cwdWithSep = cwd2.endsWith(sep16) ? cwd2 : cwd2 + sep16; const absLower = abs.toLowerCase(); const cwdLower = cwd2.toLowerCase(); const cwdWithSepLower = cwdWithSep.toLowerCase(); @@ -480162,7 +403773,7 @@ function matchesDotGitPrefix(n2) { var GIT_INTERNAL_PREFIXES; var init_gitSafety = __esm(() => { init_cwd2(); - init_parser6(); + init_parser5(); GIT_INTERNAL_PREFIXES = ["head", "objects", "refs", "hooks"]; }); @@ -480193,21 +403804,21 @@ function argLeaksValue(_cmd, element) { const argTypes = (element?.elementTypes ?? []).slice(1); const args = element?.args ?? []; const children2 = element?.children; - for (let i4 = 0;i4 < argTypes.length; i4++) { - if (argTypes[i4] !== "StringConstant" && argTypes[i4] !== "Parameter") { - if (!/[$(@{[]/.test(args[i4] ?? "")) { + for (let i3 = 0;i3 < argTypes.length; i3++) { + if (argTypes[i3] !== "StringConstant" && argTypes[i3] !== "Parameter") { + if (!/[$(@{[]/.test(args[i3] ?? "")) { continue; } return true; } - if (argTypes[i4] === "Parameter") { - const paramChildren = children2?.[i4]; + if (argTypes[i3] === "Parameter") { + const paramChildren = children2?.[i3]; if (paramChildren) { if (paramChildren.some((c6) => c6.type !== "StringConstant")) { return true; } } else { - const arg = args[i4] ?? ""; + const arg = args[i3] ?? ""; const colonIdx = arg.indexOf(":"); if (colonIdx > 0 && /[$(@{[]/.test(arg.slice(colonIdx + 1))) { return true; @@ -480313,7 +403924,7 @@ function isReadOnlyCommand(command, parsed) { if (segments.length === 0) { return false; } - const totalCommands = segments.reduce((sum3, seg) => sum3 + seg.commands.length, 0); + const totalCommands = segments.reduce((sum2, seg) => sum2 + seg.commands.length, 0); if (totalCommands > 1) { const hasCd = segments.some((seg) => seg.commands.some((cmd) => isCwdChangingCmdlet(cmd.name))); if (hasCd) { @@ -480337,8 +403948,8 @@ function isReadOnlyCommand(command, parsed) { if (!isAllowlistedCommand(firstCmd, command)) { return false; } - for (let i4 = 1;i4 < pipeline2.commands.length; i4++) { - const cmd = pipeline2.commands[i4]; + for (let i3 = 1;i3 < pipeline2.commands.length; i3++) { + const cmd = pipeline2.commands[i3]; if (!cmd || cmd.nameType === "application") { return false; } @@ -480362,36 +403973,36 @@ function isAllowlistedCommand(cmd, originalCommand) { return false; } } - const config4 = lookupAllowlist(cmd.name); - if (!config4) { + const config2 = lookupAllowlist(cmd.name); + if (!config2) { return false; } - if (config4.regex && !config4.regex.test(originalCommand)) { + if (config2.regex && !config2.regex.test(originalCommand)) { return false; } - if (config4.additionalCommandIsDangerousCallback?.(originalCommand, cmd)) { + if (config2.additionalCommandIsDangerousCallback?.(originalCommand, cmd)) { return false; } if (!cmd.elementTypes) { return false; } { - for (let i4 = 1;i4 < cmd.elementTypes.length; i4++) { - const t = cmd.elementTypes[i4]; + for (let i3 = 1;i3 < cmd.elementTypes.length; i3++) { + const t = cmd.elementTypes[i3]; if (t !== "StringConstant" && t !== "Parameter") { - if (!/[$(@{[]/.test(cmd.args[i4 - 1] ?? "")) { + if (!/[$(@{[]/.test(cmd.args[i3 - 1] ?? "")) { continue; } return false; } if (t === "Parameter") { - const paramChildren = cmd.children?.[i4 - 1]; + const paramChildren = cmd.children?.[i3 - 1]; if (paramChildren) { if (paramChildren.some((c6) => c6.type !== "StringConstant")) { return false; } } else { - const arg = cmd.args[i4 - 1] ?? ""; + const arg = cmd.args[i3 - 1] ?? ""; const colonIdx = arg.indexOf(":"); if (colonIdx > 0 && /[$(@{[]/.test(arg.slice(colonIdx + 1))) { return false; @@ -480405,21 +404016,21 @@ function isAllowlistedCommand(cmd, originalCommand) { return isExternalCommandSafe(canonical, cmd.args); } const isCmdlet = canonical.includes("-"); - if (config4.allowAllFlags) { + if (config2.allowAllFlags) { return true; } - if (!config4.safeFlags || config4.safeFlags.length === 0) { - const hasFlags = cmd.args.some((arg, i4) => { + if (!config2.safeFlags || config2.safeFlags.length === 0) { + const hasFlags = cmd.args.some((arg, i3) => { if (isCmdlet) { - return isPowerShellParameter(arg, cmd.elementTypes?.[i4 + 1]); + return isPowerShellParameter(arg, cmd.elementTypes?.[i3 + 1]); } return arg.startsWith("-") || process.platform === "win32" && arg.startsWith("/"); }); return !hasFlags; } - for (let i4 = 0;i4 < cmd.args.length; i4++) { - const arg = cmd.args[i4]; - const isFlag = isCmdlet ? isPowerShellParameter(arg, cmd.elementTypes?.[i4 + 1]) : arg.startsWith("-") || process.platform === "win32" && arg.startsWith("/"); + for (let i3 = 0;i3 < cmd.args.length; i3++) { + const arg = cmd.args[i3]; + const isFlag = isCmdlet ? isPowerShellParameter(arg, cmd.elementTypes?.[i3 + 1]) : arg.startsWith("-") || process.platform === "win32" && arg.startsWith("/"); if (isFlag) { let paramName = isCmdlet ? "-" + arg.slice(1) : arg; const colonIndex = paramName.indexOf(":"); @@ -480430,7 +404041,7 @@ function isAllowlistedCommand(cmd, originalCommand) { if (isCmdlet && COMMON_PARAMETERS.has(paramLower)) { continue; } - const isSafe = config4.safeFlags.some((flag) => flag.toLowerCase() === paramLower); + const isSafe = config2.safeFlags.some((flag) => flag.toLowerCase() === paramLower); if (!isSafe) { return false; } @@ -480490,13 +404101,13 @@ function isGitSafe(args) { const second = idx + 1 < args.length ? args[idx + 1]?.toLowerCase() || "" : ""; const twoWordKey = `git ${first} ${second}`; const oneWordKey = `git ${first}`; - let config4 = GIT_READ_ONLY_COMMANDS[twoWordKey]; + let config2 = GIT_READ_ONLY_COMMANDS[twoWordKey]; let subcommandTokens = 2; - if (!config4) { - config4 = GIT_READ_ONLY_COMMANDS[oneWordKey]; + if (!config2) { + config2 = GIT_READ_ONLY_COMMANDS[oneWordKey]; subcommandTokens = 1; } - if (!config4) { + if (!config2) { return false; } const flagArgs = args.slice(idx + subcommandTokens); @@ -480509,10 +404120,10 @@ function isGitSafe(args) { } } } - if (config4.additionalCommandIsDangerousCallback && config4.additionalCommandIsDangerousCallback("", flagArgs)) { + if (config2.additionalCommandIsDangerousCallback && config2.additionalCommandIsDangerousCallback("", flagArgs)) { return false; } - return validateFlags(flagArgs, 0, config4, { commandName: "git" }); + return validateFlags(flagArgs, 0, config2, { commandName: "git" }); } function isGhSafe(args) { if (process.env.USER_TYPE !== "ant") { @@ -480521,19 +404132,19 @@ function isGhSafe(args) { if (args.length === 0) { return true; } - let config4; + let config2; let subcommandTokens = 0; if (args.length >= 2) { const twoWordKey = `gh ${args[0]?.toLowerCase()} ${args[1]?.toLowerCase()}`; - config4 = GH_READ_ONLY_COMMANDS[twoWordKey]; + config2 = GH_READ_ONLY_COMMANDS[twoWordKey]; subcommandTokens = 2; } - if (!config4 && args.length >= 1) { + if (!config2 && args.length >= 1) { const oneWordKey = `gh ${args[0]?.toLowerCase()}`; - config4 = GH_READ_ONLY_COMMANDS[oneWordKey]; + config2 = GH_READ_ONLY_COMMANDS[oneWordKey]; subcommandTokens = 1; } - if (!config4) { + if (!config2) { return false; } const flagArgs = args.slice(subcommandTokens); @@ -480542,10 +404153,10 @@ function isGhSafe(args) { return false; } } - if (config4.additionalCommandIsDangerousCallback && config4.additionalCommandIsDangerousCallback("", flagArgs)) { + if (config2.additionalCommandIsDangerousCallback && config2.additionalCommandIsDangerousCallback("", flagArgs)) { return false; } - return validateFlags(flagArgs, 0, config4); + return validateFlags(flagArgs, 0, config2); } function isDockerSafe(args) { if (args.length === 0) { @@ -480560,15 +404171,15 @@ function isDockerSafe(args) { if (EXTERNAL_READONLY_COMMANDS.includes(oneWordKey)) { return true; } - const config4 = DOCKER_READ_ONLY_COMMANDS[oneWordKey]; - if (!config4) { + const config2 = DOCKER_READ_ONLY_COMMANDS[oneWordKey]; + if (!config2) { return false; } const flagArgs = args.slice(1); - if (config4.additionalCommandIsDangerousCallback && config4.additionalCommandIsDangerousCallback("", flagArgs)) { + if (config2.additionalCommandIsDangerousCallback && config2.additionalCommandIsDangerousCallback("", flagArgs)) { return false; } - return validateFlags(flagArgs, 0, config4); + return validateFlags(flagArgs, 0, config2); } function isDotnetSafe(args) { if (args.length === 0) { @@ -480584,7 +404195,7 @@ function isDotnetSafe(args) { var DOTNET_READ_ONLY_FLAGS, CMDLET_ALLOWLIST, SAFE_OUTPUT_CMDLETS, PIPELINE_TAIL_CMDLETS, SAFE_EXTERNAL_EXES, WINDOWS_PATHEXT, DANGEROUS_GIT_GLOBAL_FLAGS, GIT_GLOBAL_FLAGS_WITH_VALUES, DANGEROUS_GIT_SHORT_FLAGS_ATTACHED; var init_readOnlyValidation2 = __esm(() => { init_platform2(); - init_parser6(); + init_parser5(); init_readOnlyCommandValidation(); init_commonParameters(); DOTNET_READ_ONLY_FLAGS = new Set([ @@ -481193,8 +404804,8 @@ function isSymlinkCreatingCommand(cmd) { const canonical = resolveToCanonical(cmd.name); if (canonical !== "new-item") return false; - for (let i4 = 0;i4 < cmd.args.length; i4++) { - const raw = cmd.args[i4] ?? ""; + for (let i3 = 0;i3 < cmd.args.length; i3++) { + const raw = cmd.args[i3] ?? ""; if (raw.length === 0) continue; const normalized = PS_TOKENIZER_DASH_CHARS.has(raw[0]) || raw[0] === "/" ? "-" + raw.slice(1) : raw; @@ -481204,14 +404815,14 @@ function isSymlinkCreatingCommand(cmd) { const param = paramRaw.replace(/`/g, ""); if (!isItemTypeParamAbbrev(param)) continue; - const rawVal = colonIdx > 0 ? lower.slice(colonIdx + 1) : cmd.args[i4 + 1]?.toLowerCase() ?? ""; + const rawVal = colonIdx > 0 ? lower.slice(colonIdx + 1) : cmd.args[i3 + 1]?.toLowerCase() ?? ""; const val = rawVal.replace(/`/g, "").replace(/^['"]|['"]$/g, ""); if (LINK_ITEM_TYPES.has(val)) return true; } return false; } -function checkPermissionMode(input11, parsed, toolPermissionContext) { +function checkPermissionMode(input, parsed, toolPermissionContext) { if (toolPermissionContext.mode === "bypassPermissions" || toolPermissionContext.mode === "dontAsk") { return { behavior: "passthrough", @@ -481244,7 +404855,7 @@ function checkPermissionMode(input11, parsed, toolPermissionContext) { message: "No commands found to validate for acceptEdits mode" }; } - const totalCommands = segments.reduce((sum3, seg) => sum3 + seg.commands.length, 0); + const totalCommands = segments.reduce((sum2, seg) => sum2 + seg.commands.length, 0); if (totalCommands > 1) { let hasCdCommand = false; let hasSymlinkCreate = false; @@ -481289,8 +404900,8 @@ function checkPermissionMode(input11, parsed, toolPermissionContext) { }; } if (cmd.elementTypes) { - for (let i4 = 1;i4 < cmd.elementTypes.length; i4++) { - const t = cmd.elementTypes[i4]; + for (let i3 = 1;i3 < cmd.elementTypes.length; i3++) { + const t = cmd.elementTypes[i3]; if (t !== "StringConstant" && t !== "Parameter") { return { behavior: "passthrough", @@ -481298,7 +404909,7 @@ function checkPermissionMode(input11, parsed, toolPermissionContext) { }; } if (t === "Parameter") { - const arg = cmd.args[i4 - 1] ?? ""; + const arg = cmd.args[i3 - 1] ?? ""; const colonIdx = arg.indexOf(":"); if (colonIdx > 0 && /[$(@{[]/.test(arg.slice(colonIdx + 1))) { return { @@ -481309,7 +404920,7 @@ function checkPermissionMode(input11, parsed, toolPermissionContext) { } } } - if (isSafeOutputCommand(cmd.name) || isAllowlistedPipelineTail(cmd, input11.command)) { + if (isSafeOutputCommand(cmd.name) || isAllowlistedPipelineTail(cmd, input.command)) { continue; } if (!isAcceptEditsAllowedCmdlet(cmd.name)) { @@ -481339,7 +404950,7 @@ function checkPermissionMode(input11, parsed, toolPermissionContext) { message: `Nested command '${cmd.name}' resolved from a path-like name and requires approval` }; } - if (isSafeOutputCommand(cmd.name) || isAllowlistedPipelineTail(cmd, input11.command)) { + if (isSafeOutputCommand(cmd.name) || isAllowlistedPipelineTail(cmd, input.command)) { continue; } if (!isAcceptEditsAllowedCmdlet(cmd.name)) { @@ -481359,7 +404970,7 @@ function checkPermissionMode(input11, parsed, toolPermissionContext) { } return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "mode", mode: "acceptEdits" @@ -481368,7 +404979,7 @@ function checkPermissionMode(input11, parsed, toolPermissionContext) { } var ACCEPT_EDITS_ALLOWED_CMDLETS, LINK_ITEM_TYPES; var init_modeValidation = __esm(() => { - init_parser6(); + init_parser5(); init_readOnlyValidation2(); ACCEPT_EDITS_ALLOWED_CMDLETS = new Set([ "set-content", @@ -481380,8 +404991,8 @@ var init_modeValidation = __esm(() => { }); // src/tools/PowerShellTool/pathValidation.ts -import { homedir as homedir25 } from "os"; -import { isAbsolute as isAbsolute17, resolve as resolve32 } from "path"; +import { homedir as homedir23 } from "os"; +import { isAbsolute as isAbsolute16, resolve as resolve26 } from "path"; function matchesParam(paramLower, paramList) { for (const p of paramList) { if (p === paramLower || paramLower.length > 1 && p.startsWith(paramLower)) { @@ -481403,7 +405014,7 @@ function formatDirectoryList2(directories) { } function expandTilde2(filePath) { if (filePath === "~" || filePath.startsWith("~/") || filePath.startsWith("~\\")) { - return homedir25() + filePath.slice(1); + return homedir23() + filePath.slice(1); } return filePath; } @@ -481411,10 +405022,10 @@ function isDangerousRemovalRawPath(filePath) { const expanded = expandTilde2(filePath.replace(/^['"]|['"]$/g, "")).replace(/\\/g, "/"); return isDangerousRemovalPath(expanded); } -function dangerousRemovalDeny(path20) { +function dangerousRemovalDeny(path15) { return { behavior: "deny", - message: `Remove-Item on system path '${path20}' is blocked. This path is protected from removal.`, + message: `Remove-Item on system path '${path15}' is blocked. This path is protected from removal.`, decisionReason: { type: "other", reason: "Removal targets a protected system path" @@ -481489,7 +405100,7 @@ function checkDenyRuleForGuessedPath(strippedPath, cwd2, toolPermissionContext, if (!strippedPath || strippedPath.includes("\x00")) return null; const tildeExpanded = expandTilde2(strippedPath); - const abs = isAbsolute17(tildeExpanded) ? tildeExpanded : resolve32(cwd2, tildeExpanded); + const abs = isAbsolute16(tildeExpanded) ? tildeExpanded : resolve26(cwd2, tildeExpanded); const { resolvedPath } = safeResolvePath(getFsImplementation(), abs); const permissionType = operationType === "read" ? "read" : "edit"; const denyRule = matchingRuleForInput(resolvedPath, toolPermissionContext, permissionType, "deny"); @@ -481579,17 +405190,17 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) { }; } if (containsPathTraversal(normalizedPath)) { - const absolutePath2 = isAbsolute17(normalizedPath) ? normalizedPath : resolve32(cwd2, normalizedPath); + const absolutePath2 = isAbsolute16(normalizedPath) ? normalizedPath : resolve26(cwd2, normalizedPath); const { resolvedPath: resolvedPath3, isCanonical: isCanonical2 } = safeResolvePath(getFsImplementation(), absolutePath2); - const result4 = isPathAllowed2(resolvedPath3, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath3] : undefined); + const result3 = isPathAllowed2(resolvedPath3, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath3] : undefined); return { - allowed: result4.allowed, + allowed: result3.allowed, resolvedPath: resolvedPath3, - decisionReason: result4.decisionReason + decisionReason: result3.decisionReason }; } const basePath = getGlobBaseDirectory2(normalizedPath); - const absoluteBasePath = isAbsolute17(basePath) ? basePath : resolve32(cwd2, basePath); + const absoluteBasePath = isAbsolute16(basePath) ? basePath : resolve26(cwd2, basePath); const { resolvedPath: resolvedPath2 } = safeResolvePath(getFsImplementation(), absoluteBasePath); const permissionType = operationType === "read" ? "read" : "edit"; const denyRule = matchingRuleForInput(resolvedPath2, toolPermissionContext, permissionType, "deny"); @@ -481609,13 +405220,13 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) { } }; } - const absolutePath = isAbsolute17(normalizedPath) ? normalizedPath : resolve32(cwd2, normalizedPath); + const absolutePath = isAbsolute16(normalizedPath) ? normalizedPath : resolve26(cwd2, normalizedPath); const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absolutePath); - const result3 = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined); + const result2 = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined); return { - allowed: result3.allowed, + allowed: result2.allowed, resolvedPath, - decisionReason: result3.decisionReason + decisionReason: result2.decisionReason }; } function getGlobBaseDirectory2(filePath) { @@ -481631,8 +405242,8 @@ function getGlobBaseDirectory2(filePath) { } function extractPathsFromCommand(cmd) { const canonical = resolveToCanonical(cmd.name); - const config4 = CMDLET_PATH_CONFIG[canonical]; - if (!config4) { + const config2 = CMDLET_PATH_CONFIG[canonical]; + if (!config2) { return { paths: [], operationType: "read", @@ -481640,33 +405251,33 @@ function extractPathsFromCommand(cmd) { optionalWrite: false }; } - const switchParams = [...config4.knownSwitches, ...COMMON_SWITCHES]; - const valueParams = [...config4.knownValueParams, ...COMMON_VALUE_PARAMS]; + const switchParams = [...config2.knownSwitches, ...COMMON_SWITCHES]; + const valueParams = [...config2.knownValueParams, ...COMMON_VALUE_PARAMS]; const paths2 = []; const args = cmd.args; const elementTypes = cmd.elementTypes; let hasUnvalidatablePathArg = false; let positionalsSeen = 0; - const positionalSkip = config4.positionalSkip ?? 0; + const positionalSkip = config2.positionalSkip ?? 0; function checkArgElementType(argIdx) { if (!elementTypes) return; - const et3 = elementTypes[argIdx + 1]; - if (et3 && !SAFE_PATH_ELEMENT_TYPES.has(et3)) { + const et2 = elementTypes[argIdx + 1]; + if (et2 && !SAFE_PATH_ELEMENT_TYPES.has(et2)) { hasUnvalidatablePathArg = true; } } - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (!arg) continue; - const argElementType = elementTypes ? elementTypes[i4 + 1] : undefined; + const argElementType = elementTypes ? elementTypes[i3 + 1] : undefined; if (isPowerShellParameter(arg, argElementType)) { const normalized = "-" + arg.slice(1); const colonIdx = normalized.indexOf(":", 1); const paramName = colonIdx > 0 ? normalized.substring(0, colonIdx) : normalized; const paramLower = paramName.toLowerCase(); - if (matchesParam(paramLower, config4.pathParams)) { + if (matchesParam(paramLower, config2.pathParams)) { let value; if (colonIdx > 0) { const rawValue = arg.substring(colonIdx + 1); @@ -481676,18 +405287,18 @@ function extractPathsFromCommand(cmd) { value = rawValue; } } else { - const nextVal = args[i4 + 1]; - const nextType = elementTypes ? elementTypes[i4 + 2] : undefined; + const nextVal = args[i3 + 1]; + const nextType = elementTypes ? elementTypes[i3 + 2] : undefined; if (nextVal && !isPowerShellParameter(nextVal, nextType)) { value = nextVal; - checkArgElementType(i4 + 1); - i4++; + checkArgElementType(i3 + 1); + i3++; } } if (value) { paths2.push(value); } - } else if (config4.leafOnlyPathParams && matchesParam(paramLower, config4.leafOnlyPathParams)) { + } else if (config2.leafOnlyPathParams && matchesParam(paramLower, config2.leafOnlyPathParams)) { let value; if (colonIdx > 0) { const rawValue = arg.substring(colonIdx + 1); @@ -481697,12 +405308,12 @@ function extractPathsFromCommand(cmd) { value = rawValue; } } else { - const nextVal = args[i4 + 1]; - const nextType = elementTypes ? elementTypes[i4 + 2] : undefined; + const nextVal = args[i3 + 1]; + const nextType = elementTypes ? elementTypes[i3 + 2] : undefined; if (nextVal && !isPowerShellParameter(nextVal, nextType)) { value = nextVal; - checkArgElementType(i4 + 1); - i4++; + checkArgElementType(i3 + 1); + i3++; } } if (value !== undefined) { @@ -481719,11 +405330,11 @@ function extractPathsFromCommand(cmd) { hasUnvalidatablePathArg = true; } } else { - const nextArg = args[i4 + 1]; - const nextArgType = elementTypes ? elementTypes[i4 + 2] : undefined; + const nextArg = args[i3 + 1]; + const nextArgType = elementTypes ? elementTypes[i3 + 2] : undefined; if (nextArg && !isPowerShellParameter(nextArg, nextArgType)) { - checkArgElementType(i4 + 1); - i4++; + checkArgElementType(i3 + 1); + i3++; } } } else { @@ -481742,17 +405353,17 @@ function extractPathsFromCommand(cmd) { continue; } positionalsSeen++; - checkArgElementType(i4); + checkArgElementType(i3); paths2.push(arg); } return { paths: paths2, - operationType: config4.operationType, + operationType: config2.operationType, hasUnvalidatablePathArg, - optionalWrite: config4.optionalWrite ?? false + optionalWrite: config2.optionalWrite ?? false }; } -function checkPathConstraints2(input11, parsed, toolPermissionContext, compoundCommandHasCd = false) { +function checkPathConstraints2(input, parsed, toolPermissionContext, compoundCommandHasCd = false) { if (!parsed.valid) { return { behavior: "passthrough", @@ -481761,12 +405372,12 @@ function checkPathConstraints2(input11, parsed, toolPermissionContext, compoundC } let firstAsk; for (const statement of parsed.statements) { - const result3 = checkPathConstraintsForStatement(statement, toolPermissionContext, compoundCommandHasCd); - if (result3.behavior === "deny") { - return result3; + const result2 = checkPathConstraintsForStatement(statement, toolPermissionContext, compoundCommandHasCd); + if (result2.behavior === "deny") { + return result2; } - if (result3.behavior === "ask" && !firstAsk) { - firstAsk = result3; + if (result2.behavior === "ask" && !firstAsk) { + firstAsk = result2; } } return firstAsk ?? { @@ -482050,7 +405661,7 @@ var init_pathValidation3 = __esm(() => { init_PermissionUpdate(); init_pathValidation(); init_platform2(); - init_parser6(); + init_parser5(); init_commonParameters(); init_readOnlyValidation2(); GLOB_PATTERN_REGEX2 = /[*?[\]]/; @@ -482682,7 +406293,7 @@ function aliasesOf(targets) { var FILEPATH_EXECUTION_CMDLETS, DANGEROUS_SCRIPT_BLOCK_CMDLETS, MODULE_LOADING_CMDLETS, SHELLS_AND_SPAWNERS, NETWORK_CMDLETS, ALIAS_HIJACK_CMDLETS, WMI_CIM_CMDLETS, ARG_GATED_CMDLETS, NEVER_SUGGEST; var init_dangerousCmdlets = __esm(() => { init_dangerousPatterns(); - init_parser6(); + init_parser5(); FILEPATH_EXECUTION_CMDLETS = new Set([ "invoke-command", "start-job", @@ -483083,8 +406694,8 @@ function checkComObject(parsed) { }; } let typeName; - for (let i4 = 0;i4 < cmd.args.length; i4++) { - const a2 = cmd.args[i4]; + for (let i3 = 0;i3 < cmd.args.length; i3++) { + const a2 = cmd.args[i3]; const lower = a2.toLowerCase(); if (lower.startsWith("-t") && lower.includes(":")) { const colonIdx = a2.indexOf(":"); @@ -483094,20 +406705,20 @@ function checkComObject(parsed) { break; } } - if (lower.startsWith("-t") && "-typename".startsWith(lower) && cmd.args[i4 + 1] !== undefined) { - typeName = cmd.args[i4 + 1]; + if (lower.startsWith("-t") && "-typename".startsWith(lower) && cmd.args[i3 + 1] !== undefined) { + typeName = cmd.args[i3 + 1]; break; } } if (typeName === undefined) { const VALUE_PARAMS = new Set(["-argumentlist", "-comobject", "-property"]); const SWITCH_PARAMS = new Set(["-strict"]); - for (let i4 = 0;i4 < cmd.args.length; i4++) { - const a2 = cmd.args[i4]; + for (let i3 = 0;i3 < cmd.args.length; i3++) { + const a2 = cmd.args[i3]; if (a2.startsWith("-")) { const lower = a2.toLowerCase(); if (lower.startsWith("-t") && "-typename".startsWith(lower)) { - i4++; + i3++; continue; } if (lower.includes(":")) @@ -483115,7 +406726,7 @@ function checkComObject(parsed) { if (SWITCH_PARAMS.has(lower)) continue; if (VALUE_PARAMS.has(lower)) { - i4++; + i3++; continue; } continue; @@ -483146,9 +406757,9 @@ function checkDangerousFilePathExecution(parsed) { message: `${cmd.name} -FilePath executes an arbitrary script file` }; } - for (let i4 = 0;i4 < cmd.args.length; i4++) { - const argType = cmd.elementTypes?.[i4 + 1]; - const arg = cmd.args[i4]; + for (let i3 = 0;i3 < cmd.args.length; i3++) { + const argType = cmd.elementTypes?.[i3 + 1]; + const arg = cmd.args[i3]; if (argType === "StringConstant" && arg && !arg.startsWith("-")) { return { behavior: "ask", @@ -483172,9 +406783,9 @@ function checkForEachMemberName(parsed) { message: "ForEach-Object -MemberName invokes methods by string name which cannot be validated" }; } - for (let i4 = 0;i4 < cmd.args.length; i4++) { - const argType = cmd.elementTypes?.[i4 + 1]; - const arg = cmd.args[i4]; + for (let i3 = 0;i3 < cmd.args.length; i3++) { + const argType = cmd.elementTypes?.[i3 + 1]; + const arg = cmd.args[i3]; if (argType === "StringConstant" && arg && !arg.startsWith("-")) { return { behavior: "ask", @@ -483198,11 +406809,11 @@ function checkStartProcess(parsed) { }; } if (cmd.children) { - for (let i4 = 0;i4 < cmd.args.length; i4++) { - const argClean = cmd.args[i4].replace(/`/g, ""); + for (let i3 = 0;i3 < cmd.args.length; i3++) { + const argClean = cmd.args[i3].replace(/`/g, ""); if (!/^[-\u2013\u2014\u2015/]v[a-z]*:/i.test(argClean)) continue; - const kids = cmd.children[i4]; + const kids = cmd.children[i3]; if (!kids) continue; for (const child of kids) { @@ -483452,9 +407063,9 @@ function powershellCommandIsSafe(_command, parsed) { checkWmiProcessSpawn ]; for (const validator of validators3) { - const result3 = validator(parsed); - if (result3.behavior === "ask") { - return result3; + const result2 = validator(parsed); + if (result2.behavior === "ask") { + return result2; } } return { behavior: "passthrough" }; @@ -483462,7 +407073,7 @@ function powershellCommandIsSafe(_command, parsed) { var POWERSHELL_EXECUTABLES, PS_ALT_PARAM_PREFIXES, DOWNLOADER_NAMES, SAFE_SCRIPT_BLOCK_CMDLETS, SCHEDULED_TASK_CMDLETS, ENV_WRITE_CMDLETS, RUNTIME_STATE_CMDLETS, WMI_SPAWN_CMDLETS; var init_powershellSecurity = __esm(() => { init_dangerousCmdlets(); - init_parser6(); + init_parser5(); init_clmTypes(); POWERSHELL_EXECUTABLES = new Set([ "pwsh", @@ -483536,7 +407147,7 @@ var init_powershellSecurity = __esm(() => { }); // src/tools/PowerShellTool/powershellPermissions.ts -import { resolve as resolve33 } from "path"; +import { resolve as resolve27 } from "path"; async function extractCommandName(command) { const trimmed = command.trim(); if (!trimmed) { @@ -483556,8 +407167,8 @@ function suggestionForExactCommand2(command) { } return suggestionForExactCommand(POWERSHELL_TOOL_NAME, command); } -function filterRulesByContentsMatchingInput(input11, rules, matchMode, behavior) { - const command = input11.command.trim(); +function filterRulesByContentsMatchingInput(input, rules, matchMode, behavior) { + const command = input.command.trim(); function strEquals(a2, b) { return a2.toLowerCase() === b.toLowerCase(); } @@ -483573,8 +407184,8 @@ function filterRulesByContentsMatchingInput(input11, rules, matchMode, behavior) const rawCmdName = command.split(/\s+/)[0] ?? ""; const inputCmdName = stripModulePrefix(rawCmdName); const inputCanonical = resolveToCanonical(inputCmdName); - const rest3 = command.slice(rawCmdName.length).replace(/^\s+/, " "); - const canonicalCommand = inputCanonical + rest3; + const rest2 = command.slice(rawCmdName.length).replace(/^\s+/, " "); + const canonicalCommand = inputCanonical + rest2; return Array.from(rules.entries()).filter(([ruleContent]) => { const rule = powershellPermissionRule(ruleContent); function matchesCommand(cmd) { @@ -483611,7 +407222,7 @@ function filterRulesByContentsMatchingInput(input11, rules, matchMode, behavior) const ruleCanonical = resolveToCanonical(stripModulePrefixForRule(rawRuleCmdName)); if (ruleCanonical === inputCanonical) { const ruleRest = rule.command.slice(rawRuleCmdName.length).replace(/^\s+/, " "); - const inputRest = rest3; + const inputRest = rest2; if (strEquals(ruleRest, inputRest)) { return true; } @@ -483646,18 +407257,18 @@ function filterRulesByContentsMatchingInput(input11, rules, matchMode, behavior) return false; }).map(([, rule]) => rule); } -function matchingRulesForInput(input11, toolPermissionContext, matchMode) { +function matchingRulesForInput(input, toolPermissionContext, matchMode) { const denyRuleByContents = getRuleByContentsForToolName(toolPermissionContext, POWERSHELL_TOOL_NAME, "deny"); - const matchingDenyRules = filterRulesByContentsMatchingInput(input11, denyRuleByContents, matchMode, "deny"); + const matchingDenyRules = filterRulesByContentsMatchingInput(input, denyRuleByContents, matchMode, "deny"); const askRuleByContents = getRuleByContentsForToolName(toolPermissionContext, POWERSHELL_TOOL_NAME, "ask"); - const matchingAskRules = filterRulesByContentsMatchingInput(input11, askRuleByContents, matchMode, "ask"); + const matchingAskRules = filterRulesByContentsMatchingInput(input, askRuleByContents, matchMode, "ask"); const allowRuleByContents = getRuleByContentsForToolName(toolPermissionContext, POWERSHELL_TOOL_NAME, "allow"); - const matchingAllowRules = filterRulesByContentsMatchingInput(input11, allowRuleByContents, matchMode, "allow"); + const matchingAllowRules = filterRulesByContentsMatchingInput(input, allowRuleByContents, matchMode, "allow"); return { matchingDenyRules, matchingAskRules, matchingAllowRules }; } -function powershellToolCheckExactMatchPermission(input11, toolPermissionContext) { - const trimmedCommand = input11.command.trim(); - const { matchingDenyRules, matchingAskRules, matchingAllowRules } = matchingRulesForInput(input11, toolPermissionContext, "exact"); +function powershellToolCheckExactMatchPermission(input, toolPermissionContext) { + const trimmedCommand = input.command.trim(); + const { matchingDenyRules, matchingAskRules, matchingAllowRules } = matchingRulesForInput(input, toolPermissionContext, "exact"); if (matchingDenyRules[0] !== undefined) { return { behavior: "deny", @@ -483675,7 +407286,7 @@ function powershellToolCheckExactMatchPermission(input11, toolPermissionContext) if (matchingAllowRules[0] !== undefined) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "rule", rule: matchingAllowRules[0] } }; } @@ -483690,13 +407301,13 @@ function powershellToolCheckExactMatchPermission(input11, toolPermissionContext) suggestions: suggestionForExactCommand2(trimmedCommand) }; } -function powershellToolCheckPermission(input11, toolPermissionContext) { - const command = input11.command.trim(); - const exactMatchResult = powershellToolCheckExactMatchPermission(input11, toolPermissionContext); +function powershellToolCheckPermission(input, toolPermissionContext) { + const command = input.command.trim(); + const exactMatchResult = powershellToolCheckExactMatchPermission(input, toolPermissionContext); if (exactMatchResult.behavior === "deny" || exactMatchResult.behavior === "ask") { return exactMatchResult; } - const { matchingDenyRules, matchingAskRules, matchingAllowRules } = matchingRulesForInput(input11, toolPermissionContext, "prefix"); + const { matchingDenyRules, matchingAskRules, matchingAllowRules } = matchingRulesForInput(input, toolPermissionContext, "prefix"); if (matchingDenyRules[0] !== undefined) { return { behavior: "deny", @@ -483723,7 +407334,7 @@ function powershellToolCheckPermission(input11, toolPermissionContext) { if (matchingAllowRules[0] !== undefined) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "rule", rule: matchingAllowRules[0] @@ -483800,13 +407411,13 @@ async function getSubCommandsForPermissionCheck(parsed, originalCommand) { } ]; } -async function powershellToolHasPermission(input11, context) { +async function powershellToolHasPermission(input, context) { const toolPermissionContext = context.getAppState().toolPermissionContext; - const command = input11.command.trim(); + const command = input.command.trim(); if (!command) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Empty command is safe" @@ -483814,11 +407425,11 @@ async function powershellToolHasPermission(input11, context) { }; } const parsed = await parsePowerShellCommandCached(command); - const exactMatchResult = powershellToolCheckExactMatchPermission(input11, toolPermissionContext); + const exactMatchResult = powershellToolCheckExactMatchPermission(input, toolPermissionContext); if (exactMatchResult.behavior === "deny") { return exactMatchResult; } - const { matchingDenyRules, matchingAskRules } = matchingRulesForInput(input11, toolPermissionContext, "prefix"); + const { matchingDenyRules, matchingAskRules } = matchingRulesForInput(input, toolPermissionContext, "prefix"); if (matchingDenyRules[0] !== undefined) { return { behavior: "deny", @@ -484098,7 +407709,7 @@ async function powershellToolHasPermission(input11, context) { }); } } - const pathResult = checkPathConstraints2(input11, parsed, toolPermissionContext, hasCdSubCommand); + const pathResult = checkPathConstraints2(input, parsed, toolPermissionContext, hasCdSubCommand); if (pathResult.behavior !== "passthrough") { decisions.push(pathResult); } @@ -484108,7 +407719,7 @@ async function powershellToolHasPermission(input11, context) { if (isReadOnlyCommand(command, parsed)) { decisions.push({ behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Command is read-only and safe to execute" @@ -484123,7 +407734,7 @@ async function powershellToolHasPermission(input11, context) { suggestions: suggestionForExactCommand2(command) }); } - const modeResult = checkPermissionMode(input11, parsed, toolPermissionContext); + const modeResult = checkPermissionMode(input, parsed, toolPermissionContext); if (modeResult.behavior !== "passthrough") { decisions.push(modeResult); } @@ -484149,7 +407760,7 @@ async function powershellToolHasPermission(input11, context) { const canonical = resolveToCanonical(element.name); if (canonical === "set-location" && element.args.length > 0) { const target = element.args.find((a2) => a2.length === 0 || !PS_TOKENIZER_DASH_CHARS.has(a2[0])); - if (target && resolve33(getCwd(), target) === getCwd()) { + if (target && resolve27(getCwd(), target) === getCwd()) { return false; } } @@ -484230,7 +407841,7 @@ async function powershellToolHasPermission(input11, context) { } return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "All pipeline commands are individually allowed" @@ -484258,7 +407869,7 @@ var init_powershellPermissions = __esm(() => { init_git(); init_permissions2(); init_shellRuleMatching(); - init_parser6(); + init_parser5(); init_readOnlyCommandValidation(); init_gitSafety(); init_modeValidation(); @@ -484301,8 +407912,8 @@ var init_powershellPermissions = __esm(() => { }); // src/utils/timeouts.ts -function getDefaultBashTimeoutMs(env5 = process.env) { - const envValue = env5.BASH_DEFAULT_TIMEOUT_MS; +function getDefaultBashTimeoutMs(env4 = process.env) { + const envValue = env4.BASH_DEFAULT_TIMEOUT_MS; if (envValue) { const parsed = parseInt(envValue, 10); if (!isNaN(parsed) && parsed > 0) { @@ -484311,15 +407922,15 @@ function getDefaultBashTimeoutMs(env5 = process.env) { } return DEFAULT_TIMEOUT_MS; } -function getMaxBashTimeoutMs(env5 = process.env) { - const envValue = env5.BASH_MAX_TIMEOUT_MS; +function getMaxBashTimeoutMs(env4 = process.env) { + const envValue = env4.BASH_MAX_TIMEOUT_MS; if (envValue) { const parsed = parseInt(envValue, 10); if (!isNaN(parsed) && parsed > 0) { - return Math.max(parsed, getDefaultBashTimeoutMs(env5)); + return Math.max(parsed, getDefaultBashTimeoutMs(env4)); } } - return Math.max(MAX_TIMEOUT_MS, getDefaultBashTimeoutMs(env5)); + return Math.max(MAX_TIMEOUT_MS, getDefaultBashTimeoutMs(env4)); } var DEFAULT_TIMEOUT_MS = 120000, MAX_TIMEOUT_MS = 600000; @@ -484449,13 +408060,13 @@ var init_prompt14 = __esm(() => { }); // src/tools/PowerShellTool/UI.tsx -function renderToolUseMessage5(input11, { +function renderToolUseMessage5(input, { verbose, theme: _theme }) { const { command - } = input11; + } = input; if (!command) { return null; } @@ -484583,13 +408194,13 @@ function renderToolResultMessage4(content, progressMessagesForMessage, { ] }, undefined, true, undefined, this); } -function renderToolUseErrorMessage4(result3, { +function renderToolUseErrorMessage4(result2, { verbose, progressMessagesForMessage: _progressMessagesForMessage, tools: _tools }) { return /* @__PURE__ */ jsx_dev_runtime117.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } @@ -484611,7 +408222,7 @@ __export(exports_PowerShellTool, { detectBlockedSleepPattern: () => detectBlockedSleepPattern, PowerShellTool: () => PowerShellTool }); -import { copyFile as copyFile6, stat as fsStat, truncate as fsTruncate, link as link4 } from "fs/promises"; +import { copyFile as copyFile5, stat as fsStat, truncate as fsTruncate, link as link4 } from "fs/promises"; function isSearchOrReadPowerShellCommand(command) { const trimmed = command.trim(); if (!trimmed) { @@ -484679,8 +408290,8 @@ function detectBlockedSleepPattern(command) { const secs = parseInt(m[1], 10); if (secs < 2) return null; - const rest3 = command.trim().slice(first.length).replace(/^[\s;|&]+/, ""); - return rest3 ? `Start-Sleep ${secs} followed by: ${rest3}` : `standalone Start-Sleep ${secs}`; + const rest2 = command.trim().slice(first.length).replace(/^[\s;|&]+/, ""); + return rest2 ? `Start-Sleep ${secs} followed by: ${rest2}` : `standalone Start-Sleep ${secs}`; } function isWindowsSandboxPolicyViolation() { return getPlatform() === "windows" && SandboxManager2.isSandboxEnabledInSettings() && !SandboxManager2.areUnsandboxedCommandsAllowed(); @@ -484696,7 +408307,7 @@ function getCommandTypeForLogging(command) { return "other"; } async function* runPowerShellCommand({ - input: input11, + input, abortController, setAppState, setToolJSX, @@ -484711,7 +408322,7 @@ async function* runPowerShellCommand({ timeout, run_in_background, dangerouslyDisableSandbox - } = input11; + } = input; const timeoutMs = Math.min(timeout || getDefaultTimeoutMs(), getMaxTimeoutMs()); let fullOutput = ""; let lastProgressOutput = ""; @@ -484722,8 +408333,8 @@ async function* runPowerShellCommand({ let assistantAutoBackgrounded = false; let resolveProgress = null; function createProgressSignal() { - return new Promise((resolve34) => { - resolveProgress = () => resolve34(null); + return new Promise((resolve28) => { + resolveProgress = () => resolve28(null); }); } const shouldAutoBackground = !isBackgroundTasksDisabled && isAutobackgroundingAllowed(command); @@ -484793,10 +408404,10 @@ async function* runPowerShellCommand({ } spawnBackgroundTask().then((shellId) => { backgroundShellId = shellId; - const resolve34 = resolveProgress; - if (resolve34) { + const resolve28 = resolveProgress; + if (resolve28) { resolveProgress = null; - resolve34(); + resolve28(); } logEvent(eventName, { command_type: getCommandTypeForLogging(command) @@ -484838,15 +408449,15 @@ async function* runPowerShellCommand({ let foregroundTaskId = undefined; try { while (true) { - const now3 = Date.now(); - const timeUntilNextProgress = Math.max(0, nextProgressTime - now3); + const now2 = Date.now(); + const timeUntilNextProgress = Math.max(0, nextProgressTime - now2); const progressSignal = createProgressSignal(); - const result3 = await Promise.race([resultPromise, new Promise((resolve34) => setTimeout((r) => r(null), timeUntilNextProgress, resolve34).unref()), progressSignal]); - if (result3 !== null) { - if (result3.backgroundTaskId !== undefined) { - markTaskNotified2(result3.backgroundTaskId, setAppState); + const result2 = await Promise.race([resultPromise, new Promise((resolve28) => setTimeout((r) => r(null), timeUntilNextProgress, resolve28).unref()), progressSignal]); + if (result2 !== null) { + if (result2.backgroundTaskId !== undefined) { + markTaskNotified2(result2.backgroundTaskId, setAppState); const fixedResult = { - ...result3, + ...result2, backgroundTaskId: undefined }; const { @@ -484860,7 +408471,7 @@ async function* runPowerShellCommand({ shellCommand.cleanup(); return fixedResult; } - return result3; + return result2; } if (backgroundShellId) { return { @@ -484934,7 +408545,7 @@ async function* runPowerShellCommand({ } } } -var jsx_dev_runtime118, EOL3 = ` +var jsx_dev_runtime118, EOL2 = ` `, PS_SEARCH_COMMANDS, PS_READ_COMMANDS, PS_SEMANTIC_NEUTRAL_COMMANDS, PROGRESS_THRESHOLD_MS = 2000, PROGRESS_INTERVAL_MS = 1000, ASSISTANT_BLOCKING_BUDGET_MS = 15000, DISALLOWED_AUTO_BACKGROUND_COMMANDS, WINDOWS_SANDBOX_POLICY_REFUSAL = "Enterprise policy requires sandboxing, but sandboxing is not available on native Windows. Shell command execution is blocked on this platform by policy.", isBackgroundTasksDisabled, fullInputSchema, inputSchema7, outputSchema5, COMMON_BACKGROUND_COMMANDS, PowerShellTool; var init_PowerShellTool = __esm(() => { init_bun_bundle(); @@ -484963,7 +408574,7 @@ var init_PowerShellTool = __esm(() => { init_toolResultStorage(); init_shouldUseSandbox(); init_UI3(); - init_utils8(); + init_utils7(); init_gitOperationTracking(); init_commandSemantics(); init_powershellPermissions(); @@ -485035,26 +408646,26 @@ var init_PowerShellTool = __esm(() => { async prompt() { return getPrompt3(); }, - isConcurrencySafe(input11) { - return this.isReadOnly?.(input11) ?? false; + isConcurrencySafe(input) { + return this.isReadOnly?.(input) ?? false; }, - isSearchOrReadCommand(input11) { - if (!input11.command) { + isSearchOrReadCommand(input) { + if (!input.command) { return { isSearch: false, isRead: false }; } - return isSearchOrReadPowerShellCommand(input11.command); + return isSearchOrReadPowerShellCommand(input.command); }, - isReadOnly(input11) { - if (hasSyncSecurityConcerns(input11.command)) { + isReadOnly(input) { + if (hasSyncSecurityConcerns(input.command)) { return false; } - return isReadOnlyCommand(input11.command); + return isReadOnlyCommand(input.command); }, - toAutoClassifierInput(input11) { - return input11.command; + toAutoClassifierInput(input) { + return input.command; }, get inputSchema() { return inputSchema7(); @@ -485065,30 +408676,30 @@ var init_PowerShellTool = __esm(() => { userFacingName() { return "PowerShell"; }, - getToolUseSummary(input11) { - if (!input11?.command) { + getToolUseSummary(input) { + if (!input?.command) { return null; } const { command, description - } = input11; + } = input; if (description) { return description; } return truncate(command, TOOL_SUMMARY_MAX_LENGTH); }, - getActivityDescription(input11) { - if (!input11?.command) { + getActivityDescription(input) { + if (!input?.command) { return "Running command"; } - const desc = input11.description ?? truncate(input11.command, TOOL_SUMMARY_MAX_LENGTH); + const desc = input.description ?? truncate(input.command, TOOL_SUMMARY_MAX_LENGTH); return `Running ${desc}`; }, isEnabled() { return true; }, - async validateInput(input11) { + async validateInput(input) { if (isWindowsSandboxPolicyViolation()) { return { result: false, @@ -485096,8 +408707,8 @@ var init_PowerShellTool = __esm(() => { errorCode: 11 }; } - if (feature("MONITOR_TOOL") && !isBackgroundTasksDisabled && !input11.run_in_background) { - const sleepPattern = detectBlockedSleepPattern(input11.command); + if (feature("MONITOR_TOOL") && !isBackgroundTasksDisabled && !input.run_in_background) { + const sleepPattern = detectBlockedSleepPattern(input.command); if (sleepPattern !== null) { return { result: false, @@ -485110,8 +408721,8 @@ var init_PowerShellTool = __esm(() => { result: true }; }, - async checkPermissions(input11, context) { - return await powershellToolHasPermission(input11, context); + async checkPermissions(input, context) { + return await powershellToolHasPermission(input, context); }, renderToolUseMessage: renderToolUseMessage5, renderToolUseProgressMessage: renderToolUseProgressMessage5, @@ -485152,7 +408763,7 @@ var init_PowerShellTool = __esm(() => { let errorMessage2 = stderr.trim(); if (interrupted) { if (stderr) - errorMessage2 += EOL3; + errorMessage2 += EOL2; errorMessage2 += "Command was aborted before completion"; } let backgroundInfo = ""; @@ -485174,7 +408785,7 @@ var init_PowerShellTool = __esm(() => { is_error: interrupted }; }, - async call(input11, toolUseContext, _canUseTool, _parentMessage, onProgress) { + async call(input, toolUseContext, _canUseTool, _parentMessage, onProgress) { if (isWindowsSandboxPolicyViolation()) { throw new Error(WINDOWS_SANDBOX_POLICY_REFUSAL); } @@ -485187,7 +408798,7 @@ var init_PowerShellTool = __esm(() => { let progressCounter = 0; try { const commandGenerator = runPowerShellCommand({ - input: input11, + input, abortController, setAppState: toolUseContext.setAppStateForTasks ?? setAppState, setToolJSX, @@ -485216,12 +408827,12 @@ var init_PowerShellTool = __esm(() => { }); } } while (!generatorResult.done); - const result3 = generatorResult.value; - const isPreFlightSentinel = result3.code === 0 && !result3.stdout && result3.stderr && !result3.backgroundTaskId; + const result2 = generatorResult.value; + const isPreFlightSentinel = result2.code === 0 && !result2.stdout && result2.stderr && !result2.backgroundTaskId; if (!isPreFlightSentinel) { - trackGitOperations(input11.command, result3.code, result3.stdout); + trackGitOperations(input.command, result2.code, result2.stdout); } - const isInterrupt = result3.interrupted && abortController.signal.reason === "interrupt"; + const isInterrupt = result2.interrupted && abortController.signal.reason === "interrupt"; let stderrForShellReset = ""; if (isMainThread) { const appState = toolUseContext.getAppState(); @@ -485229,8 +408840,8 @@ var init_PowerShellTool = __esm(() => { stderrForShellReset = stdErrAppendShellResetMessage(""); } } - if (result3.backgroundTaskId) { - const bgExtracted = extractClaudeCodeHints(result3.stdout || "", input11.command); + if (result2.backgroundTaskId) { + const bgExtracted = extractClaudeCodeHints(result2.stdout || "", input.command); if (isMainThread && bgExtracted.hints.length > 0) { for (const hint of bgExtracted.hints) maybeRecordPluginHint(hint); @@ -485238,48 +408849,48 @@ var init_PowerShellTool = __esm(() => { return { data: { stdout: bgExtracted.stripped, - stderr: [result3.stderr || "", stderrForShellReset].filter(Boolean).join(` + stderr: [result2.stderr || "", stderrForShellReset].filter(Boolean).join(` `), interrupted: false, - backgroundTaskId: result3.backgroundTaskId, - backgroundedByUser: result3.backgroundedByUser, - assistantAutoBackgrounded: result3.assistantAutoBackgrounded + backgroundTaskId: result2.backgroundTaskId, + backgroundedByUser: result2.backgroundedByUser, + assistantAutoBackgrounded: result2.assistantAutoBackgrounded } }; } const stdoutAccumulator = new EndTruncatingAccumulator; - const processedStdout = (result3.stdout || "").trimEnd(); - stdoutAccumulator.append(processedStdout + EOL3); - const interpretation = interpretCommandResult(input11.command, result3.code, processedStdout, result3.stderr || ""); + const processedStdout = (result2.stdout || "").trimEnd(); + stdoutAccumulator.append(processedStdout + EOL2); + const interpretation = interpretCommandResult(input.command, result2.code, processedStdout, result2.stderr || ""); let stdout = stripEmptyLines(stdoutAccumulator.toString()); - const extracted = extractClaudeCodeHints(stdout, input11.command); + const extracted = extractClaudeCodeHints(stdout, input.command); stdout = extracted.stripped; if (isMainThread && extracted.hints.length > 0) { for (const hint of extracted.hints) maybeRecordPluginHint(hint); } - if (result3.preSpawnError) { - throw new Error(result3.preSpawnError); + if (result2.preSpawnError) { + throw new Error(result2.preSpawnError); } if (interpretation.isError && !isInterrupt) { - throw new ShellError(stdout, result3.stderr || "", result3.code, result3.interrupted); + throw new ShellError(stdout, result2.stderr || "", result2.code, result2.interrupted); } const MAX_PERSISTED_SIZE = 64 * 1024 * 1024; let persistedOutputPath; let persistedOutputSize; - if (result3.outputFilePath && result3.outputTaskId) { + if (result2.outputFilePath && result2.outputTaskId) { try { - const fileStat = await fsStat(result3.outputFilePath); + const fileStat = await fsStat(result2.outputFilePath); persistedOutputSize = fileStat.size; await ensureToolResultsDir(); - const dest = getToolResultPath(result3.outputTaskId, false); + const dest = getToolResultPath(result2.outputTaskId, false); if (fileStat.size > MAX_PERSISTED_SIZE) { - await fsTruncate(result3.outputFilePath, MAX_PERSISTED_SIZE); + await fsTruncate(result2.outputFilePath, MAX_PERSISTED_SIZE); } try { - await link4(result3.outputFilePath, dest); + await link4(result2.outputFilePath, dest); } catch { - await copyFile6(result3.outputFilePath, dest); + await copyFile5(result2.outputFilePath, dest); } persistedOutputPath = dest; } catch {} @@ -485287,27 +408898,27 @@ var init_PowerShellTool = __esm(() => { let isImage = isImageOutput(stdout); let compressedStdout = stdout; if (isImage) { - const resized = await resizeShellImageOutput(stdout, result3.outputFilePath, persistedOutputSize); + const resized = await resizeShellImageOutput(stdout, result2.outputFilePath, persistedOutputSize); if (resized) { compressedStdout = resized; } else { isImage = false; } } - const finalStderr = [result3.stderr || "", stderrForShellReset].filter(Boolean).join(` + const finalStderr = [result2.stderr || "", stderrForShellReset].filter(Boolean).join(` `); logEvent("tengu_powershell_tool_command_executed", { - command_type: getCommandTypeForLogging(input11.command), + command_type: getCommandTypeForLogging(input.command), stdout_length: compressedStdout.length, stderr_length: finalStderr.length, - exit_code: result3.code, - interrupted: result3.interrupted + exit_code: result2.code, + interrupted: result2.interrupted }); return { data: { stdout: compressedStdout, stderr: finalStderr, - interrupted: result3.interrupted, + interrupted: result2.interrupted, returnCodeInterpretation: interpretation.message, isImage, persistedOutputPath, @@ -485327,11 +408938,11 @@ var init_PowerShellTool = __esm(() => { // src/utils/promptShellExecution.ts import { randomUUID as randomUUID18 } from "crypto"; -async function executeShellCommandsInPrompt(text2, context, slashCommandName, shell) { - let result3 = text2; +async function executeShellCommandsInPrompt(text, context, slashCommandName, shell) { + let result2 = text; const shellTool = shell === "powershell" && isPowerShellToolEnabled() ? getPowerShellTool() : BashTool; - const blockMatches = text2.matchAll(BLOCK_PATTERN); - const inlineMatches = text2.includes("!`") ? text2.matchAll(INLINE_PATTERN) : []; + const blockMatches = text.matchAll(BLOCK_PATTERN); + const inlineMatches = text.includes("!`") ? text.matchAll(INLINE_PATTERN) : []; await Promise.all([...blockMatches, ...inlineMatches].map(async (match) => { const command = match[1]?.trim(); if (command) { @@ -485344,7 +408955,7 @@ async function executeShellCommandsInPrompt(text2, context, slashCommandName, sh const { data } = await shellTool.call({ command }, context); const toolResultBlock = await processToolResultBlock(shellTool, data, randomUUID18()); const output = typeof toolResultBlock.content === "string" ? toolResultBlock.content : formatBashOutput(data.stdout, data.stderr); - result3 = result3.replace(match[0], () => output); + result2 = result2.replace(match[0], () => output); } catch (e) { if (e instanceof MalformedCommandError) { throw e; @@ -485353,7 +408964,7 @@ async function executeShellCommandsInPrompt(text2, context, slashCommandName, sh } } })); - return result3; + return result2; } function formatBashOutput(stdout, stderr, inline2 = false) { const parts = []; @@ -485389,7 +409000,7 @@ var init_promptShellExecution = __esm(() => { init_BashTool(); init_debug(); init_errors(); - init_messages5(); + init_messages3(); init_permissions2(); init_toolResultStorage(); init_shellToolUtils(); @@ -485415,19 +409026,19 @@ var builders = null; // src/skills/loadSkillsDir.ts import { realpath as realpath11 } from "fs/promises"; import { - basename as basename23, - dirname as dirname34, - isAbsolute as isAbsolute18, - join as join92, + basename as basename21, + dirname as dirname31, + isAbsolute as isAbsolute17, + join as join82, sep as pathSep, - relative as relative14 + relative as relative12 } from "path"; function getSkillsPath(source, dir) { switch (source) { case "policySettings": - return join92(getManagedFilePath(), ".claude", dir); + return join82(getManagedFilePath(), ".claude", dir); case "userSettings": - return join92(getClaudeConfigHomeDir(), dir); + return join82(getClaudeConfigHomeDir(), dir); case "projectSettings": return `.claude/${dir}`; case "plugin": @@ -485451,12 +409062,12 @@ function parseHooksFromFrontmatter2(frontmatter, skillName) { if (!frontmatter.hooks) { return; } - const result3 = HooksSchema().safeParse(frontmatter.hooks); - if (!result3.success) { - logForDebugging(`Invalid hooks in skill '${skillName}': ${result3.error.message}`); + const result2 = HooksSchema().safeParse(frontmatter.hooks); + if (!result2.success) { + logForDebugging(`Invalid hooks in skill '${skillName}': ${result2.error.message}`); return; } - return result3.data; + return result2.data; } function parseSkillPaths(frontmatter) { if (!frontmatter.paths) { @@ -485583,10 +409194,10 @@ ${markdownContent}` : markdownContent; }; } async function loadSkillsFromSkillsDir(basePath, source) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); let entries; try { - entries = await fs11.readdir(basePath); + entries = await fs5.readdir(basePath); } catch (e) { if (!isFsInaccessible(e)) logError2(e); @@ -485597,11 +409208,11 @@ async function loadSkillsFromSkillsDir(basePath, source) { if (!entry.isDirectory() && !entry.isSymbolicLink()) { return null; } - const skillDirPath = join92(basePath, entry.name); - const skillFilePath = join92(skillDirPath, "SKILL.md"); + const skillDirPath = join82(basePath, entry.name); + const skillFilePath = join82(skillDirPath, "SKILL.md"); let content; try { - content = await fs11.readFile(skillFilePath, { encoding: "utf-8" }); + content = await fs5.readFile(skillFilePath, { encoding: "utf-8" }); } catch (e) { if (!isENOENT(e)) { logForDebugging(`[skills] failed to read ${skillFilePath}: ${e}`, { @@ -485626,38 +409237,38 @@ async function loadSkillsFromSkillsDir(basePath, source) { }), filePath: skillFilePath }; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return null; } })); return results.filter((r) => r !== null); } function isSkillFile(filePath) { - return /^skill\.md$/i.test(basename23(filePath)); + return /^skill\.md$/i.test(basename21(filePath)); } -function transformSkillFiles(files2) { +function transformSkillFiles(files) { const filesByDir = new Map; - for (const file2 of files2) { - const dir = dirname34(file2.filePath); + for (const file2 of files) { + const dir = dirname31(file2.filePath); const dirFiles = filesByDir.get(dir) ?? []; dirFiles.push(file2); filesByDir.set(dir, dirFiles); } - const result3 = []; + const result2 = []; for (const [dir, dirFiles] of filesByDir) { const skillFiles = dirFiles.filter((f) => isSkillFile(f.filePath)); if (skillFiles.length > 0) { const skillFile = skillFiles[0]; if (skillFiles.length > 1) { - logForDebugging(`Multiple skill files found in ${dir}, using ${basename23(skillFile.filePath)}`); + logForDebugging(`Multiple skill files found in ${dir}, using ${basename21(skillFile.filePath)}`); } - result3.push(skillFile); + result2.push(skillFile); } else { - result3.push(...dirFiles); + result2.push(...dirFiles); } } - return result3; + return result2; } function buildNamespace(targetDir, baseDir) { const normalizedBaseDir = baseDir.endsWith(pathSep) ? baseDir.slice(0, -1) : baseDir; @@ -485668,15 +409279,15 @@ function buildNamespace(targetDir, baseDir) { return relativePath ? relativePath.split(pathSep).join(":") : ""; } function getSkillCommandName(filePath, baseDir) { - const skillDirectory = dirname34(filePath); - const parentOfSkillDir = dirname34(skillDirectory); - const commandBaseName = basename23(skillDirectory); + const skillDirectory = dirname31(filePath); + const parentOfSkillDir = dirname31(skillDirectory); + const commandBaseName = basename21(skillDirectory); const namespace = buildNamespace(parentOfSkillDir, baseDir); return namespace ? `${namespace}:${commandBaseName}` : commandBaseName; } function getRegularCommandName(filePath, baseDir) { - const fileName = basename23(filePath); - const fileDirectory = dirname34(filePath); + const fileName = basename21(filePath); + const fileDirectory = dirname31(filePath); const commandBaseName = fileName.replace(/\.md$/, ""); const namespace = buildNamespace(fileDirectory, baseDir); return namespace ? `${namespace}:${commandBaseName}` : commandBaseName; @@ -485699,7 +409310,7 @@ async function loadSkillsFromCommandsDir(cwd2) { } of processedFiles) { try { const isSkillFormat = isSkillFile(filePath); - const skillDirectory = isSkillFormat ? dirname34(filePath) : undefined; + const skillDirectory = isSkillFormat ? dirname31(filePath) : undefined; const cmdName = getCommandName2({ baseDir, filePath, @@ -485721,13 +409332,13 @@ async function loadSkillsFromCommandsDir(cwd2) { }), filePath }); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } return skills; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return []; } } @@ -485741,23 +409352,23 @@ function onDynamicSkillsLoaded(callback) { return skillsLoaded.subscribe(() => { try { callback(); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } }); } async function discoverSkillDirsForPaths(filePaths, cwd2) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const resolvedCwd = cwd2.endsWith(pathSep) ? cwd2.slice(0, -1) : cwd2; const newDirs = []; for (const filePath of filePaths) { - let currentDir = dirname34(filePath); + let currentDir = dirname31(filePath); while (currentDir.startsWith(resolvedCwd + pathSep)) { - const skillDir = join92(currentDir, ".claude", "skills"); + const skillDir = join82(currentDir, ".claude", "skills"); if (!dynamicSkillDirs.has(skillDir)) { dynamicSkillDirs.add(skillDir); try { - await fs11.stat(skillDir); + await fs5.stat(skillDir); if (await isPathGitignored(currentDir, resolvedCwd)) { logForDebugging(`[skills] Skipped gitignored skills dir: ${skillDir}`); continue; @@ -485765,10 +409376,10 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) { newDirs.push(skillDir); } catch {} } - const parent3 = dirname34(currentDir); - if (parent3 === currentDir) + const parent2 = dirname31(currentDir); + if (parent2 === currentDir) break; - currentDir = parent3; + currentDir = parent2; } } return newDirs.sort((a2, b) => b.split(pathSep).length - a2.split(pathSep).length); @@ -485783,8 +409394,8 @@ async function addSkillDirectories(dirs) { } const previousSkillNamesForLogging = new Set(dynamicSkills.keys()); const loadedSkills = await Promise.all(dirs.map((dir) => loadSkillsFromSkillsDir(dir, "projectSettings"))); - for (let i4 = loadedSkills.length - 1;i4 >= 0; i4--) { - for (const { skill } of loadedSkills[i4] ?? []) { + for (let i3 = loadedSkills.length - 1;i3 >= 0; i3--) { + for (const { skill } of loadedSkills[i3] ?? []) { if (skill.type === "prompt") { dynamicSkills.set(skill.name, skill); } @@ -485818,10 +409429,10 @@ function activateConditionalSkillsForPaths(filePaths, cwd2) { if (skill.type !== "prompt" || !skill.paths || skill.paths.length === 0) { continue; } - const skillIgnore = import_ignore3.default().add(skill.paths); + const skillIgnore = import_ignore2.default().add(skill.paths); for (const filePath of filePaths) { - const relativePath = isAbsolute18(filePath) ? relative14(cwd2, filePath) : filePath; - if (!relativePath || relativePath.startsWith("..") || isAbsolute18(relativePath)) { + const relativePath = isAbsolute17(filePath) ? relative12(cwd2, filePath) : filePath; + if (!relativePath || relativePath.startsWith("..") || isAbsolute17(relativePath)) { continue; } if (skillIgnore.ignores(relativePath)) { @@ -485852,9 +409463,9 @@ function clearDynamicSkills() { conditionalSkills.clear(); activatedConditionalSkillNames.clear(); } -var import_ignore3, getSkillDirCommands, dynamicSkillDirs, dynamicSkills, conditionalSkills, activatedConditionalSkillNames, skillsLoaded; +var import_ignore2, getSkillDirCommands, dynamicSkillDirs, dynamicSkills, conditionalSkills, activatedConditionalSkillNames, skillsLoaded; var init_loadSkillsDir = __esm(() => { - import_ignore3 = __toESM(require_ignore(), 1); + import_ignore2 = __toESM(require_ignore(), 1); init_memoize(); init_state(); init_analytics(); @@ -485876,8 +409487,8 @@ var init_loadSkillsDir = __esm(() => { init_pluginOnlyPolicy(); init_types2(); getSkillDirCommands = memoize_default(async (cwd2) => { - const userSkillsDir = join92(getClaudeConfigHomeDir(), "skills"); - const managedSkillsDir = join92(getManagedFilePath(), ".claude", "skills"); + const userSkillsDir = join82(getClaudeConfigHomeDir(), "skills"); + const managedSkillsDir = join82(getManagedFilePath(), ".claude", "skills"); const projectSkillsDirs = getProjectDirsUpToHome("skills", cwd2); logForDebugging(`Loading skills from: managed=${managedSkillsDir}, user=${userSkillsDir}, project=[${projectSkillsDirs.join(", ")}]`); const additionalDirs = getAdditionalDirectoriesForClaudeMd(); @@ -485888,7 +409499,7 @@ var init_loadSkillsDir = __esm(() => { logForDebugging(`[bare] Skipping skill dir discovery (${additionalDirs.length === 0 ? "no --add-dir" : "projectSettings disabled or skillsLocked"})`); return []; } - const additionalSkillsNested2 = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join92(dir, ".claude", "skills"), "projectSettings"))); + const additionalSkillsNested2 = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join82(dir, ".claude", "skills"), "projectSettings"))); return additionalSkillsNested2.flat().map((s) => s.skill); } const [ @@ -485901,7 +409512,7 @@ var init_loadSkillsDir = __esm(() => { isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_POLICY_SKILLS) ? Promise.resolve([]) : loadSkillsFromSkillsDir(managedSkillsDir, "policySettings"), isSettingSourceEnabled("userSettings") && !skillsLocked ? loadSkillsFromSkillsDir(userSkillsDir, "userSettings") : Promise.resolve([]), projectSettingsEnabled ? Promise.all(projectSkillsDirs.map((dir) => loadSkillsFromSkillsDir(dir, "projectSettings"))) : Promise.resolve([]), - projectSettingsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join92(dir, ".claude", "skills"), "projectSettings"))) : Promise.resolve([]), + projectSettingsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join82(dir, ".claude", "skills"), "projectSettings"))) : Promise.resolve([]), skillsLocked ? Promise.resolve([]) : loadSkillsFromCommandsDir(cwd2) ]); const allSkillsWithPaths = [ @@ -485914,12 +409525,12 @@ var init_loadSkillsDir = __esm(() => { const fileIds = await Promise.all(allSkillsWithPaths.map(({ skill, filePath }) => skill.type === "prompt" ? getFileIdentity2(filePath) : Promise.resolve(null))); const seenFileIds = new Map; const deduplicatedSkills = []; - for (let i4 = 0;i4 < allSkillsWithPaths.length; i4++) { - const entry = allSkillsWithPaths[i4]; + for (let i3 = 0;i3 < allSkillsWithPaths.length; i3++) { + const entry = allSkillsWithPaths[i3]; if (entry === undefined || entry.skill.type !== "prompt") continue; const { skill } = entry; - const fileId = fileIds[i4]; + const fileId = fileIds[i3]; if (fileId === null || fileId === undefined) { deduplicatedSkills.push(skill); continue; @@ -486033,7 +409644,7 @@ function saveCurrentSessionCosts(fpsMetrics) { })); } function formatCost(cost, maxDecimalPlaces = 4) { - return `$${cost > 0.5 ? round3(cost, 100).toFixed(2) : cost.toFixed(maxDecimalPlaces)}`; + return `$${cost > 0.5 ? round2(cost, 100).toFixed(2) : cost.toFixed(maxDecimalPlaces)}`; } function formatModelUsage() { const modelUsageMap = getModelUsage(); @@ -486063,13 +409674,13 @@ function formatModelUsage() { accumulated.webSearchRequests += usage.webSearchRequests; accumulated.costUSD += usage.costUSD; } - let result3 = "Usage by model:"; + let result2 = "Usage by model:"; for (const [shortName, usage] of Object.entries(usageByShortName)) { const usageString = ` ${formatNumber(usage.inputTokens)} input, ` + `${formatNumber(usage.outputTokens)} output, ` + `${formatNumber(usage.cacheReadInputTokens)} cache read, ` + `${formatNumber(usage.cacheCreationInputTokens)} cache write` + (usage.webSearchRequests > 0 ? `, ${formatNumber(usage.webSearchRequests)} web search` : "") + ` (${formatCost(usage.costUSD)})`; - result3 += ` + result2 += ` ` + `${shortName}:`.padStart(21) + usageString; } - return result3; + return result2; } function formatTotalCost() { const costDisplay = formatCost(getTotalCostUSD()) + (hasUnknownModelCost() ? " (costs may be inaccurate due to usage of unknown models)" : ""); @@ -486080,7 +409691,7 @@ Total duration (wall): ${formatDuration(getTotalDuration())} Total code changes: ${getTotalLinesAdded()} ${getTotalLinesAdded() === 1 ? "line" : "lines"} added, ${getTotalLinesRemoved()} ${getTotalLinesRemoved() === 1 ? "line" : "lines"} removed ${modelUsageDisplay}`); } -function round3(number5, precision) { +function round2(number5, precision) { return Math.round(number5 * precision) / precision; } function addToTotalModelUsage(cost, usage, model) { @@ -486187,15 +409798,15 @@ function getPatchFromContents({ ignoreWhitespace = false, singleHunk = false }) { - const result3 = structuredPatch(filePath, filePath, escapeForDiff(oldContent), escapeForDiff(newContent), undefined, undefined, { + const result2 = structuredPatch(filePath, filePath, escapeForDiff(oldContent), escapeForDiff(newContent), undefined, undefined, { ignoreWhitespace, context: singleHunk ? 1e5 : CONTEXT_LINES, timeout: DIFF_TIMEOUT_MS }); - if (!result3) { + if (!result2) { return []; } - return result3.hunks.map((_) => ({ + return result2.hunks.map((_) => ({ ..._, lines: _.lines.map(unescapeFromDiff) })); @@ -486207,7 +409818,7 @@ function getPatchForDisplay({ ignoreWhitespace = false }) { const preparedFileContents = escapeForDiff(convertLeadingTabsToSpaces(fileContents)); - const result3 = structuredPatch(filePath, filePath, preparedFileContents, edits.reduce((p, edit2) => { + const result2 = structuredPatch(filePath, filePath, preparedFileContents, edits.reduce((p, edit2) => { const { old_string, new_string } = edit2; const replace_all = "replace_all" in edit2 ? edit2.replace_all : false; const escapedOldString = escapeForDiff(convertLeadingTabsToSpaces(old_string)); @@ -486222,10 +409833,10 @@ function getPatchForDisplay({ ignoreWhitespace, timeout: DIFF_TIMEOUT_MS }); - if (!result3) { + if (!result2) { return []; } - return result3.hunks.map((_) => ({ + return result2.hunks.map((_) => ({ ..._, lines: _.lines.map(unescapeFromDiff) })); @@ -486240,12 +409851,12 @@ var init_diff2 = __esm(() => { }); // src/utils/fileOperationAnalytics.ts -import { createHash as createHash18 } from "crypto"; +import { createHash as createHash17 } from "crypto"; function hashFilePath(filePath) { - return createHash18("sha256").update(filePath).digest("hex").slice(0, 16); + return createHash17("sha256").update(filePath).digest("hex").slice(0, 16); } function hashFileContent(content) { - return createHash18("sha256").update(content).digest("hex"); + return createHash17("sha256").update(content).digest("hex"); } function logFileOperation(params) { const metadata = { @@ -486268,8 +409879,8 @@ var init_fileOperationAnalytics = __esm(() => { }); // src/utils/gitDiff.ts -import { access as access5, readFile as readFile25 } from "fs/promises"; -import { dirname as dirname35, join as join93, relative as relative15, sep as sep20 } from "path"; +import { access as access5, readFile as readFile24 } from "fs/promises"; +import { dirname as dirname32, join as join83, relative as relative13, sep as sep17 } from "path"; async function fetchGitDiff() { const isGit = await getIsGit(); if (!isGit) @@ -486297,8 +409908,8 @@ async function fetchGitDiff() { const untrackedStats = await fetchUntrackedFiles(remainingSlots); if (untrackedStats) { stats.filesCount += untrackedStats.size; - for (const [path20, fileStats] of untrackedStats) { - perFileStats.set(path20, fileStats); + for (const [path15, fileStats] of untrackedStats) { + perFileStats.set(path15, fileStats); } } } @@ -486355,12 +409966,12 @@ function parseGitNumstat(stdout) { }; } function parseGitDiff(stdout) { - const result3 = new Map; + const result2 = new Map; if (!stdout.trim()) - return result3; + return result2; const fileDiffs = stdout.split(/^diff --git /m).filter(Boolean); for (const fileDiff of fileDiffs) { - if (result3.size >= MAX_FILES) + if (result2.size >= MAX_FILES) break; if (fileDiff.length > MAX_DIFF_SIZE_BYTES) { continue; @@ -486374,8 +409985,8 @@ function parseGitDiff(stdout) { const fileHunks = []; let currentHunk = null; let lineCount = 0; - for (let i4 = 1;i4 < lines.length; i4++) { - const line = lines[i4] ?? ""; + for (let i3 = 1;i3 < lines.length; i3++) { + const line = lines[i3] ?? ""; const hunkMatch = line.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); if (hunkMatch) { if (currentHunk) { @@ -486405,10 +410016,10 @@ function parseGitDiff(stdout) { fileHunks.push(currentHunk); } if (fileHunks.length > 0) { - result3.set(filePath, fileHunks); + result2.set(filePath, fileHunks); } } - return result3; + return result2; } async function isInTransientGitState() { const gitDir = await getGitDir(getCwd()); @@ -486420,7 +410031,7 @@ async function isInTransientGitState() { "CHERRY_PICK_HEAD", "REVERT_HEAD" ]; - const results = await Promise.all(transientFiles.map((file2) => access5(join93(gitDir, file2)).then(() => true).catch(() => false))); + const results = await Promise.all(transientFiles.map((file2) => access5(join83(gitDir, file2)).then(() => true).catch(() => false))); return results.some(Boolean); } async function fetchUntrackedFiles(maxFiles) { @@ -486453,10 +410064,10 @@ function parseShortstat(stdout) { }; } async function fetchSingleFileGitDiff(absoluteFilePath) { - const gitRoot = findGitRoot(dirname35(absoluteFilePath)); + const gitRoot = findGitRoot(dirname32(absoluteFilePath)); if (!gitRoot) return null; - const gitPath = relative15(gitRoot, absoluteFilePath).split(sep20).join("/"); + const gitPath = relative13(gitRoot, absoluteFilePath).split(sep17).join("/"); const repository = getCachedRepository(); const { code: lsFilesCode } = await execFileNoThrowWithCwd(gitExe(), ["--no-optional-locks", "ls-files", "--error-unmatch", gitPath], { cwd: gitRoot, timeout: SINGLE_FILE_DIFF_TIMEOUT_MS }); if (lsFilesCode === 0) { @@ -486519,7 +410130,7 @@ async function generateSyntheticDiff(gitPath, absoluteFilePath) { if (!isFileWithinReadSizeLimit(absoluteFilePath, MAX_DIFF_SIZE_BYTES)) { return null; } - const content = await readFile25(absoluteFilePath, "utf-8"); + const content = await readFile24(absoluteFilePath, "utf-8"); const lines = content.split(` `); if (lines.length > 0 && lines.at(-1) === "") { @@ -486609,7 +410220,7 @@ var init_prompt15 = __esm(() => { // src/tools/FileEditTool/types.ts var inputSchema8, hunkSchema, gitDiffSchema, outputSchema6; -var init_types11 = __esm(() => { +var init_types9 = __esm(() => { init_v4(); init_semanticBoolean(); inputSchema8 = lazySchema(() => exports_external.strictObject({ @@ -486851,11 +410462,11 @@ var init_Fallback = __esm(() => { }); // src/native-ts/color-diff/index.ts -import { basename as basename24, extname as extname10 } from "path"; +import { basename as basename22, extname as extname10 } from "path"; function hljs() { if (cachedHljs) return cachedHljs; - const mod2 = require_lib8(); + const mod2 = require_lib6(); cachedHljs = "default" in mod2 && mod2.default ? mod2.default : mod2; return cachedHljs; } @@ -486911,12 +410522,12 @@ function colorToEscape(c6, fg, mode) { } function asTerminalEscaped(blocks, mode, skipBackground, dim2) { let out = dim2 ? RESET + DIM : RESET; - for (const [style, text2] of blocks) { + for (const [style, text] of blocks) { out += colorToEscape(style.foreground, true, mode); if (!skipBackground) { out += colorToEscape(style.background, false, mode); } - out += text2; + out += text; } return out + RESET; } @@ -487038,7 +410649,7 @@ function decorationColor(marker, theme) { } } function detectLanguage(filePath, firstLine) { - const base2 = basename24(filePath); + const base2 = basename22(filePath); const ext = extname10(filePath).slice(1); const stem = base2.split(".")[0] ?? ""; const byName = FILENAME_LANGS[base2] ?? FILENAME_LANGS[stem]; @@ -487070,10 +410681,10 @@ function detectLanguage(filePath, firstLine) { } return null; } -function scopeColor(scope, text2, theme) { +function scopeColor(scope, text, theme) { if (!scope) return theme.foreground; - if (scope === "keyword" && STORAGE_KEYWORDS.has(text2.trim())) { + if (scope === "keyword" && STORAGE_KEYWORDS.has(text.trim())) { return theme.scopes["_storage"] ?? theme.foreground; } return theme.scopes[scope] ?? theme.scopes[scope.split(".")[0]] ?? theme.foreground; @@ -487098,59 +410709,59 @@ function highlightLine(state, line, theme) { if (!state.lang) { return [[defaultStyle3(theme), code]]; } - let result3; + let result2; try { - result3 = hljs().highlight(code, { + result2 = hljs().highlight(code, { language: state.lang, ignoreIllegals: true }); } catch { return [[defaultStyle3(theme), code]]; } - if (!hasRootNode(result3.emitter)) { + if (!hasRootNode(result2.emitter)) { if (!loggedEmitterShapeError) { loggedEmitterShapeError = true; - logError2(new Error(`color-diff: hljs emitter shape mismatch (keys: ${Object.keys(result3.emitter).join(",")}). Syntax highlighting disabled.`)); + logError2(new Error(`color-diff: hljs emitter shape mismatch (keys: ${Object.keys(result2.emitter).join(",")}). Syntax highlighting disabled.`)); } return [[defaultStyle3(theme), code]]; } const blocks = []; - flattenHljs(result3.emitter.rootNode, theme, undefined, blocks); + flattenHljs(result2.emitter.rootNode, theme, undefined, blocks); return blocks; } -function tokenize7(text2) { +function tokenize6(text) { const tokens = []; - let i4 = 0; - while (i4 < text2.length) { - const ch2 = text2[i4]; + let i3 = 0; + while (i3 < text.length) { + const ch2 = text[i3]; if (/[\p{L}\p{N}_]/u.test(ch2)) { - let j = i4 + 1; - while (j < text2.length && /[\p{L}\p{N}_]/u.test(text2[j])) + let j = i3 + 1; + while (j < text.length && /[\p{L}\p{N}_]/u.test(text[j])) j++; - tokens.push(text2.slice(i4, j)); - i4 = j; + tokens.push(text.slice(i3, j)); + i3 = j; } else if (/\s/.test(ch2)) { - let j = i4 + 1; - while (j < text2.length && /\s/.test(text2[j])) + let j = i3 + 1; + while (j < text.length && /\s/.test(text[j])) j++; - tokens.push(text2.slice(i4, j)); - i4 = j; + tokens.push(text.slice(i3, j)); + i3 = j; } else { - const cp = text2.codePointAt(i4); + const cp = text.codePointAt(i3); const len = cp > 65535 ? 2 : 1; - tokens.push(text2.slice(i4, i4 + len)); - i4 += len; + tokens.push(text.slice(i3, i3 + len)); + i3 += len; } } return tokens; } function findAdjacentPairs(markers) { const pairs = []; - let i4 = 0; - while (i4 < markers.length) { - if (markers[i4] === "-") { - const delStart = i4; - let delEnd = i4; + let i3 = 0; + while (i3 < markers.length) { + if (markers[i3] === "-") { + const delStart = i3; + let delEnd = i3; while (delEnd < markers.length && markers[delEnd] === "-") delEnd++; let addEnd = delEnd; @@ -487163,19 +410774,19 @@ function findAdjacentPairs(markers) { for (let k = 0;k < n2; k++) { pairs.push([delStart + k, delEnd + k]); } - i4 = addEnd; + i3 = addEnd; } else { - i4 = delEnd; + i3 = delEnd; } } else { - i4++; + i3++; } } return pairs; } function wordDiffStrings(oldStr, newStr) { - const oldTokens = tokenize7(oldStr); - const newTokens = tokenize7(newStr); + const oldTokens = tokenize6(oldStr); + const newTokens = tokenize6(newStr); const ops = diffArrays(oldTokens, newTokens); const totalLen = oldStr.length + newStr.length; let changedLen = 0; @@ -487204,7 +410815,7 @@ function wordDiffStrings(oldStr, newStr) { return [oldRanges, newRanges]; } function removeNewlines(h2) { - h2.lines = h2.lines.map((line) => line.flatMap(([style, text2]) => text2.split(` + h2.lines = h2.lines.map((line) => line.flatMap(([style, text]) => text.split(` `).filter((p) => p.length > 0).map((p) => [style, p]))); } function charWidth(ch2) { @@ -487217,16 +410828,16 @@ function wrapText4(h2, width, theme) { let cur = []; let curW = 0; while (queue2.length > 0) { - const [style, text2] = queue2.shift(); - const tw = stringWidth(text2); + const [style, text] = queue2.shift(); + const tw = stringWidth(text); if (curW + tw <= width) { - cur.push([style, text2]); + cur.push([style, text]); curW += tw; } else { const remaining = width - curW; let bytePos = 0; let accW = 0; - for (const ch2 of text2) { + for (const ch2 of text) { const cw = charWidth(ch2); if (accW + cw > remaining) break; @@ -487235,19 +410846,19 @@ function wrapText4(h2, width, theme) { } if (bytePos === 0) { if (curW === 0) { - const firstCp = text2.codePointAt(0); + const firstCp = text.codePointAt(0); bytePos = firstCp > 65535 ? 2 : 1; } else { newLines.push(cur); - queue2.unshift([style, text2]); + queue2.unshift([style, text]); cur = []; curW = 0; continue; } } - cur.push([style, text2.slice(0, bytePos)]); + cur.push([style, text.slice(0, bytePos)]); newLines.push(cur); - queue2.unshift([style, text2.slice(bytePos)]); + queue2.unshift([style, text.slice(bytePos)]); cur = []; curW = 0; } @@ -487272,10 +410883,10 @@ function addLineNumber(h2, theme, maxDigits, fullDim) { background: h2.marker ? lineBackground(h2.marker, theme) : theme.background }; const shouldDim = h2.marker === null || h2.marker === " "; - for (let i4 = 0;i4 < h2.lines.length; i4++) { - const prefix = i4 === 0 ? ` ${String(h2.lineNumber).padStart(maxDigits)} ` : " ".repeat(maxDigits + 2); + for (let i3 = 0;i3 < h2.lines.length; i3++) { + const prefix = i3 === 0 ? ` ${String(h2.lineNumber).padStart(maxDigits)} ` : " ".repeat(maxDigits + 2); const wrapped = shouldDim && !fullDim ? `${DIM}${prefix}${UNDIM}` : prefix; - h2.lines[i4].unshift([style, wrapped]); + h2.lines[i3].unshift([style, wrapped]); } } function addMarker(h2, theme) { @@ -487293,8 +410904,8 @@ function dimContent(h2) { for (const line of h2.lines) { if (line.length > 0) { line[0][1] = DIM + line[0][1]; - const last3 = line.length - 1; - line[last3][1] = line[last3][1] + UNDIM; + const last2 = line.length - 1; + line[last2][1] = line[last2][1] + UNDIM; } } } @@ -487307,24 +410918,24 @@ function applyBackground(h2, theme, ranges) { let byteOff = 0; for (let li = 0;li < h2.lines.length; li++) { const newLine = []; - for (const [style, text2] of h2.lines[li]) { + for (const [style, text] of h2.lines[li]) { const textStart = byteOff; - const textEnd = byteOff + text2.length; + const textEnd = byteOff + text.length; while (rangeIdx < ranges.length && ranges[rangeIdx].end <= textStart) { rangeIdx++; } if (rangeIdx >= ranges.length) { - newLine.push([{ ...style, background: lineBg }, text2]); + newLine.push([{ ...style, background: lineBg }, text]); byteOff = textEnd; continue; } - let remaining = text2; + let remaining = text; let pos = textStart; while (remaining.length > 0 && rangeIdx < ranges.length) { const r = ranges[rangeIdx]; - const inRange4 = pos >= r.start && pos < r.end; + const inRange3 = pos >= r.start && pos < r.end; let next; - if (inRange4) { + if (inRange3) { next = Math.min(r.end, textEnd); } else if (r.start > pos && r.start < textEnd) { next = r.start; @@ -487333,7 +410944,7 @@ function applyBackground(h2, theme, ranges) { } const segLen = next - pos; const seg = remaining.slice(0, segLen); - newLine.push([{ ...style, background: inRange4 ? wordBg : lineBg }, seg]); + newLine.push([{ ...style, background: inRange3 ? wordBg : lineBg }, seg]); remaining = remaining.slice(segLen); pos = next; if (pos >= r.end) @@ -487409,12 +411020,12 @@ class ColorDiff { } } const out = []; - for (let i4 = 0;i4 < entries.length; i4++) { - const { lineNumber, marker, code } = entries[i4]; + for (let i3 = 0;i3 < entries.length; i3++) { + const { lineNumber, marker, code } = entries[i3]; const tokens = marker === "-" ? [[defaultStyle3(theme), code]] : highlightLine(hlState, code, theme); const h2 = { marker, lineNumber, lines: [tokens] }; removeNewlines(h2); - applyBackground(h2, theme, ranges[i4]); + applyBackground(h2, theme, ranges[i3]); wrapText4(h2, effectiveWidth, theme); if (mode === "ansi" && marker === "-") { dimContent(h2); @@ -487447,9 +411058,9 @@ class ColorFile { const maxDigits = String(lines.length).length; const effectiveWidth = Math.max(1, width - maxDigits - 2); const out = []; - for (let i4 = 0;i4 < lines.length; i4++) { - const tokens = highlightLine(hlState, lines[i4], theme); - const h2 = { marker: null, lineNumber: i4 + 1, lines: [tokens] }; + for (let i3 = 0;i3 < lines.length; i3++) { + const tokens = highlightLine(hlState, lines[i3], theme); + const h2 = { marker: null, lineNumber: i3 + 1, lines: [tokens] }; removeNewlines(h2); wrapText4(h2, effectiveWidth, theme); addLineNumber(h2, theme, maxDigits, dim2); @@ -487777,14 +411388,14 @@ var init_HighlightedCode = __esm(() => { ref, children: lines ? /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedBox_default, { flexDirection: "column", - children: lines.map((line, i4) => gutterWidth > 0 ? /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(CodeLine, { + children: lines.map((line, i3) => gutterWidth > 0 ? /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(CodeLine, { line, gutterWidth - }, i4, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedText, { + }, i3, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedText, { children: /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(Ansi, { children: line }, undefined, false, undefined, this) - }, i4, false, undefined, this)) + }, i3, false, undefined, this)) }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(HighlightedCodeFallback, { code, filePath, @@ -487850,10 +411461,10 @@ function StructuredDiffFallback(t0) { } return t3; } -function _temp46(node, i4) { +function _temp46(node, i3) { return /* @__PURE__ */ jsx_dev_runtime121.jsxDEV(ThemedBox_default, { children: node - }, i4, false, undefined, this); + }, i3, false, undefined, this); } function transformLinesToObjects(lines) { return lines.map((code) => { @@ -487883,16 +411494,16 @@ function transformLinesToObjects(lines) { } function processAdjacentLines(lineObjects) { const processedLines = []; - let i4 = 0; - while (i4 < lineObjects.length) { - const current = lineObjects[i4]; + let i3 = 0; + while (i3 < lineObjects.length) { + const current = lineObjects[i3]; if (!current) { - i4++; + i3++; continue; } if (current.type === "remove") { const removeLines = [current]; - let j = i4 + 1; + let j = i3 + 1; while (j < lineObjects.length && lineObjects[j]?.type === "remove") { const line = lineObjects[j]; if (line) { @@ -487922,28 +411533,28 @@ function processAdjacentLines(lineObjects) { } processedLines.push(...removeLines.filter(Boolean)); processedLines.push(...addLines.filter(Boolean)); - i4 = j; + i3 = j; } else { processedLines.push(current); - i4++; + i3++; } } else { processedLines.push(current); - i4++; + i3++; } } return processedLines; } function calculateWordDiffs(oldText, newText) { - const result3 = diffWordsWithSpace(oldText, newText, { + const result2 = diffWordsWithSpace(oldText, newText, { ignoreCase: false }); - return result3; + return result2; } function generateWordDiffElements(item, width, maxWidth, dim2, overrideTheme) { const { type, - i: i4, + i: i3, wordDiff: wordDiff2, matchedLine, originalCode @@ -487955,7 +411566,7 @@ function generateWordDiffElements(item, width, maxWidth, dim2, overrideTheme) { const addedLineText = type === "remove" ? matchedLine.originalCode : originalCode; const wordDiffs = calculateWordDiffs(removedLineText, addedLineText); const totalLength = removedLineText.length + addedLineText.length; - const changedLength = wordDiffs.filter((part) => part.added || part.removed).reduce((sum3, part) => sum3 + part.value.length, 0); + const changedLength = wordDiffs.filter((part) => part.added || part.removed).reduce((sum2, part) => sum2 + part.value.length, 0); const changeRatio = changedLength / totalLength; if (changeRatio > CHANGE_THRESHOLD2 || dim2) { return null; @@ -488019,9 +411630,9 @@ function generateWordDiffElements(item, width, maxWidth, dim2, overrideTheme) { content, contentWidth }, lineIndex) => { - const key = `${type}-${i4}-${lineIndex}`; + const key = `${type}-${i3}-${lineIndex}`; const lineBgColor = type === "add" ? dim2 ? "diffAddedDimmed" : "diffAdded" : dim2 ? "diffRemovedDimmed" : "diffRemoved"; - const lineNum = lineIndex === 0 ? i4 : undefined; + const lineNum = lineIndex === 0 ? i3 : undefined; const lineNumStr = (lineNum !== undefined ? lineNum.toString().padStart(maxWidth) : " ".repeat(maxWidth)) + " "; const usedWidth = lineNumStr.length + diffPrefixWidth + contentWidth; const padding = Math.max(0, width - usedWidth); @@ -488059,14 +411670,14 @@ function formatDiff(lines, startingLineNumber, width, dim2, overrideTheme) { const processedLines = processAdjacentLines(lineObjects); const ls = numberDiffLines(processedLines, startingLineNumber); const maxLineNumber2 = Math.max(...ls.map(({ - i: i4 - }) => i4), 0); + i: i3 + }) => i3), 0); const maxWidth = Math.max(maxLineNumber2.toString().length + 1, 0); return ls.flatMap((item) => { const { type, code, - i: i4, + i: i3, wordDiff: wordDiff2, matchedLine } = item; @@ -488082,8 +411693,8 @@ function formatDiff(lines, startingLineNumber, width, dim2, overrideTheme) { const wrappedLines = wrappedText.split(` `); return wrappedLines.map((line, lineIndex) => { - const key = `${type}-${i4}-${lineIndex}`; - const lineNum = lineIndex === 0 ? i4 : undefined; + const key = `${type}-${i3}-${lineIndex}`; + const lineNum = lineIndex === 0 ? i3 : undefined; const lineNumStr = (lineNum !== undefined ? lineNum.toString().padStart(maxWidth) : " ".repeat(maxWidth)) + " "; const sigil = type === "add" ? "+" : type === "remove" ? "-" : " "; const contentWidth = lineNumStr.length + 1 + stringWidth(line); @@ -488119,8 +411730,8 @@ function formatDiff(lines, startingLineNumber, width, dim2, overrideTheme) { }); } function numberDiffLines(diff3, startLine) { - let i4 = startLine; - const result3 = []; + let i3 = startLine; + const result2 = []; const queue2 = [...diff3]; while (queue2.length > 0) { const current = queue2.shift(); @@ -488134,25 +411745,25 @@ function numberDiffLines(diff3, startLine) { const line = { code, type, - i: i4, + i: i3, originalCode, wordDiff: wordDiff2, matchedLine }; switch (type) { case "nochange": - i4++; - result3.push(line); + i3++; + result2.push(line); break; case "add": - i4++; - result3.push(line); + i3++; + result2.push(line); break; case "remove": { - result3.push(line); + result2.push(line); let numRemoved = 0; while (queue2[0]?.type === "remove") { - i4++; + i3++; const current2 = queue2.shift(); const { code: code2, @@ -488164,20 +411775,20 @@ function numberDiffLines(diff3, startLine) { const line2 = { code: code2, type: type2, - i: i4, + i: i3, originalCode: originalCode2, wordDiff: wordDiff3, matchedLine: matchedLine2 }; - result3.push(line2); + result2.push(line2); numRemoved++; } - i4 -= numRemoved; + i3 -= numRemoved; break; } } } - return result3; + return result2; } var import_compiler_runtime107, jsx_dev_runtime121, CHANGE_THRESHOLD2 = 0.4; var init_Fallback2 = __esm(() => { @@ -488382,13 +411993,13 @@ function StructuredDiffList({ firstLine, fileContent }, undefined, false, undefined, this) - }, hunk.newStart, false, undefined, this)), (i4) => /* @__PURE__ */ jsx_dev_runtime123.jsxDEV(NoSelect, { + }, hunk.newStart, false, undefined, this)), (i3) => /* @__PURE__ */ jsx_dev_runtime123.jsxDEV(NoSelect, { fromLeftEdge: true, children: /* @__PURE__ */ jsx_dev_runtime123.jsxDEV(ThemedText, { dimColor: true, children: "..." }, undefined, false, undefined, this) - }, `ellipsis-${i4}`, false, undefined, this)); + }, `ellipsis-${i3}`, false, undefined, this)); } var jsx_dev_runtime123; var init_StructuredDiffList = __esm(() => { @@ -488398,7 +412009,7 @@ var init_StructuredDiffList = __esm(() => { }); // src/components/FileEditToolUseRejectedMessage.tsx -import { relative as relative16 } from "path"; +import { relative as relative14 } from "path"; function FileEditToolUseRejectedMessage(t0) { const $2 = import_compiler_runtime109.c(38); const { @@ -488431,7 +412042,7 @@ function FileEditToolUseRejectedMessage(t0) { } let t2; if ($2[2] !== file_path || $2[3] !== verbose) { - t2 = verbose ? file_path : relative16(getCwd(), file_path); + t2 = verbose ? file_path : relative14(getCwd(), file_path); $2[2] = file_path; $2[3] = verbose; $2[4] = t2; @@ -488465,14 +412076,14 @@ function FileEditToolUseRejectedMessage(t0) { } else { t4 = $2[9]; } - const text2 = t4; + const text = t4; if (style === "condensed" && !verbose) { let t52; - if ($2[10] !== text2) { + if ($2[10] !== text) { t52 = /* @__PURE__ */ jsx_dev_runtime124.jsxDEV(MessageResponse, { - children: text2 + children: text }, undefined, false, undefined, this); - $2[10] = text2; + $2[10] = text; $2[11] = t52; } else { t52 = $2[11]; @@ -488532,12 +412143,12 @@ function FileEditToolUseRejectedMessage(t0) { t9 = $2[22]; } let t10; - if ($2[23] !== t8 || $2[24] !== t9 || $2[25] !== text2) { + if ($2[23] !== t8 || $2[24] !== t9 || $2[25] !== text) { t10 = /* @__PURE__ */ jsx_dev_runtime124.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime124.jsxDEV(ThemedBox_default, { flexDirection: "column", children: [ - text2, + text, t8, t9 ] @@ -488545,7 +412156,7 @@ function FileEditToolUseRejectedMessage(t0) { }, undefined, false, undefined, this); $2[23] = t8; $2[24] = t9; - $2[25] = text2; + $2[25] = text; $2[26] = t10; } else { t10 = $2[26]; @@ -488554,11 +412165,11 @@ function FileEditToolUseRejectedMessage(t0) { } if (!patch || patch.length === 0) { let t52; - if ($2[27] !== text2) { + if ($2[27] !== text) { t52 = /* @__PURE__ */ jsx_dev_runtime124.jsxDEV(MessageResponse, { - children: text2 + children: text }, undefined, false, undefined, this); - $2[27] = text2; + $2[27] = text; $2[28] = t52; } else { t52 = $2[28]; @@ -488586,18 +412197,18 @@ function FileEditToolUseRejectedMessage(t0) { t6 = $2[34]; } let t7; - if ($2[35] !== t6 || $2[36] !== text2) { + if ($2[35] !== t6 || $2[36] !== text) { t7 = /* @__PURE__ */ jsx_dev_runtime124.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime124.jsxDEV(ThemedBox_default, { flexDirection: "column", children: [ - text2, + text, t6 ] }, undefined, true, undefined, this) }, undefined, false, undefined, this); $2[35] = t6; - $2[36] = text2; + $2[36] = text; $2[37] = t7; } else { t7 = $2[37]; @@ -488688,7 +412299,7 @@ function FileEditToolUpdatedMessage(t0) { } else { t4 = $2[8]; } - const text2 = t4; + const text = t4; if (previewHint) { if (style !== "condensed" && !verbose) { let t52; @@ -488708,15 +412319,15 @@ function FileEditToolUpdatedMessage(t0) { } } else { if (style === "condensed" && !verbose) { - return text2; + return text; } } let t5; - if ($2[11] !== text2) { + if ($2[11] !== text) { t5 = /* @__PURE__ */ jsx_dev_runtime125.jsxDEV(ThemedText, { - children: text2 + children: text }, undefined, false, undefined, this); - $2[11] = text2; + $2[11] = text; $2[12] = t5; } else { t5 = $2[12]; @@ -488784,8 +412395,8 @@ var init_FileEditToolUpdatedMessage = __esm(() => { // src/utils/readEditContext.ts import { open as open10 } from "fs/promises"; -async function readEditContext(path20, needle, contextLines = 3) { - const handle = await openForScan(path20); +async function readEditContext(path15, needle, contextLines = 3) { + const handle = await openForScan(path15); if (handle === null) return null; try { @@ -488794,9 +412405,9 @@ async function readEditContext(path20, needle, contextLines = 3) { await handle.close(); } } -async function openForScan(path20) { +async function openForScan(path15) { try { - return await open10(path20, "r"); + return await open10(path15, "r"); } catch (e) { if (isENOENT(e)) return null; @@ -488808,8 +412419,8 @@ async function scanForContext(handle, needle, contextLines) { return { content: "", lineOffset: 1, truncated: false }; const needleLF = Buffer.from(needle, "utf8"); let nlCount = 0; - for (let i4 = 0;i4 < needleLF.length; i4++) - if (needleLF[i4] === NL) + for (let i3 = 0;i3 < needleLF.length; i3++) + if (needleLF[i3] === NL) nlCount++; let needleCRLF; const overlap = needleLF.length + nlCount - 1; @@ -488862,13 +412473,13 @@ async function readCapped(handle) { return normalizeCRLF(buf, total); } function indexOfWithin(buf, needle, end) { - const at3 = buf.indexOf(needle); - return at3 === -1 || at3 + needle.length > end ? -1 : at3; + const at2 = buf.indexOf(needle); + return at2 === -1 || at2 + needle.length > end ? -1 : at2; } function countNewlines(buf, start, end) { let n2 = 0; - for (let i4 = start;i4 < end; i4++) - if (buf[i4] === NL) + for (let i3 = start;i3 < end; i3++) + if (buf[i3] === NL) n2++; return n2; } @@ -488883,8 +412494,8 @@ async function sliceContext(handle, scratch, matchStart, matchLen, contextLines, const { bytesRead: backRead } = await handle.read(scratch, 0, backChunk, matchStart - backChunk); let ctxStart = matchStart; let nlSeen = 0; - for (let i4 = backRead - 1;i4 >= 0 && nlSeen <= contextLines; i4--) { - if (scratch[i4] === NL) { + for (let i3 = backRead - 1;i3 >= 0 && nlSeen <= contextLines; i3--) { + if (scratch[i3] === NL) { nlSeen++; if (nlSeen > contextLines) break; @@ -488897,9 +412508,9 @@ async function sliceContext(handle, scratch, matchStart, matchLen, contextLines, const { bytesRead: fwdRead } = await handle.read(scratch, 0, CHUNK_SIZE, matchEnd); let ctxEnd = matchEnd; nlSeen = 0; - for (let i4 = 0;i4 < fwdRead; i4++) { + for (let i3 = 0;i3 < fwdRead; i3++) { ctxEnd++; - if (scratch[i4] === NL) { + if (scratch[i3] === NL) { nlSeen++; if (nlSeen >= contextLines + 1) break; @@ -488923,18 +412534,18 @@ function normalizeQuotes(str) { } function stripTrailingWhitespace(str) { const lines = str.split(/(\r\n|\n|\r)/); - let result3 = ""; - for (let i4 = 0;i4 < lines.length; i4++) { - const part = lines[i4]; + let result2 = ""; + for (let i3 = 0;i3 < lines.length; i3++) { + const part = lines[i3]; if (part !== undefined) { - if (i4 % 2 === 0) { - result3 += part.replace(/\s+$/, ""); + if (i3 % 2 === 0) { + result2 += part.replace(/\s+$/, ""); } else { - result3 += part; + result2 += part; } } } - return result3; + return result2; } function findActualString(fileContent, searchString) { if (fileContent.includes(searchString)) { @@ -488957,14 +412568,14 @@ function preserveQuoteStyle(oldString, actualOldString, newString) { if (!hasDoubleQuotes && !hasSingleQuotes) { return newString; } - let result3 = newString; + let result2 = newString; if (hasDoubleQuotes) { - result3 = applyCurlyDoubleQuotes(result3); + result2 = applyCurlyDoubleQuotes(result2); } if (hasSingleQuotes) { - result3 = applyCurlySingleQuotes(result3); + result2 = applyCurlySingleQuotes(result2); } - return result3; + return result2; } function isOpeningContext(chars, index) { if (index === 0) { @@ -488976,38 +412587,38 @@ function isOpeningContext(chars, index) { } function applyCurlyDoubleQuotes(str) { const chars = [...str]; - const result3 = []; - for (let i4 = 0;i4 < chars.length; i4++) { - if (chars[i4] === '"') { - result3.push(isOpeningContext(chars, i4) ? LEFT_DOUBLE_CURLY_QUOTE : RIGHT_DOUBLE_CURLY_QUOTE); + const result2 = []; + for (let i3 = 0;i3 < chars.length; i3++) { + if (chars[i3] === '"') { + result2.push(isOpeningContext(chars, i3) ? LEFT_DOUBLE_CURLY_QUOTE : RIGHT_DOUBLE_CURLY_QUOTE); } else { - result3.push(chars[i4]); + result2.push(chars[i3]); } } - return result3.join(""); + return result2.join(""); } function applyCurlySingleQuotes(str) { const chars = [...str]; - const result3 = []; - for (let i4 = 0;i4 < chars.length; i4++) { - if (chars[i4] === "'") { - const prev = i4 > 0 ? chars[i4 - 1] : undefined; - const next = i4 < chars.length - 1 ? chars[i4 + 1] : undefined; + const result2 = []; + for (let i3 = 0;i3 < chars.length; i3++) { + if (chars[i3] === "'") { + const prev = i3 > 0 ? chars[i3 - 1] : undefined; + const next = i3 < chars.length - 1 ? chars[i3 + 1] : undefined; const prevIsLetter = prev !== undefined && /\p{L}/u.test(prev); const nextIsLetter = next !== undefined && /\p{L}/u.test(next); if (prevIsLetter && nextIsLetter) { - result3.push(RIGHT_SINGLE_CURLY_QUOTE); + result2.push(RIGHT_SINGLE_CURLY_QUOTE); } else { - result3.push(isOpeningContext(chars, i4) ? LEFT_SINGLE_CURLY_QUOTE : RIGHT_SINGLE_CURLY_QUOTE); + result2.push(isOpeningContext(chars, i3) ? LEFT_SINGLE_CURLY_QUOTE : RIGHT_SINGLE_CURLY_QUOTE); } } else { - result3.push(chars[i4]); + result2.push(chars[i3]); } } - return result3.join(""); + return result2.join(""); } function applyEditToFile(originalContent, oldString, newString, replaceAll = false) { - const f = replaceAll ? (content, search, replace3) => content.replaceAll(search, () => replace3) : (content, search, replace3) => content.replace(search, () => replace3); + const f = replaceAll ? (content, search, replace2) => content.replaceAll(search, () => replace2) : (content, search, replace2) => content.replace(search, () => replace2); if (newString !== "") { return f(originalContent, oldString, newString); } @@ -489130,16 +412741,16 @@ function getEditsForPatch(patch) { }); } function desanitizeMatchString(matchString) { - let result3 = matchString; + let result2 = matchString; const appliedReplacements = []; for (const [from, to] of Object.entries(DESANITIZATIONS)) { - const beforeReplace = result3; - result3 = result3.replaceAll(from, to); - if (beforeReplace !== result3) { + const beforeReplace = result2; + result2 = result2.replaceAll(from, to); + if (beforeReplace !== result2) { appliedReplacements.push({ from, to }); } } - return { result: result3, appliedReplacements }; + return { result: result2, appliedReplacements }; } function normalizeFileEditInput({ file_path, @@ -489182,9 +412793,9 @@ function normalizeFileEditInput({ }; }) }; - } catch (error45) { - if (!isENOENT(error45)) { - logError2(error45); + } catch (error41) { + if (!isENOENT(error41)) { + logError2(error41); } } return { file_path, edits }; @@ -489198,7 +412809,7 @@ function areFileEditsEquivalent(edits1, edits2, originalContent) { } let result1 = null; let error1 = null; - let result22 = null; + let result2 = null; let error210 = null; try { result1 = getPatchForEdits({ @@ -489210,7 +412821,7 @@ function areFileEditsEquivalent(edits1, edits2, originalContent) { error1 = errorMessage(e); } try { - result22 = getPatchForEdits({ + result2 = getPatchForEdits({ filePath: "temp", fileContents: originalContent, edits: edits2 @@ -489224,14 +412835,14 @@ function areFileEditsEquivalent(edits1, edits2, originalContent) { if (error1 !== null || error210 !== null) { return false; } - return result1.updatedFile === result22.updatedFile; + return result1.updatedFile === result2.updatedFile; } -function areFileEditsInputsEquivalent(input1, input22) { - if (input1.file_path !== input22.file_path) { +function areFileEditsInputsEquivalent(input1, input2) { + if (input1.file_path !== input2.file_path) { return false; } - if (input1.edits.length === input22.edits.length && input1.edits.every((edit1, index) => { - const edit2 = input22.edits[index]; + if (input1.edits.length === input2.edits.length && input1.edits.every((edit1, index) => { + const edit2 = input2.edits[index]; return edit2 !== undefined && edit1.old_string === edit2.old_string && edit1.new_string === edit2.new_string && edit1.replace_all === edit2.replace_all; })) { return true; @@ -489239,15 +412850,15 @@ function areFileEditsInputsEquivalent(input1, input22) { let fileContent = ""; try { fileContent = readFileSyncCached(input1.file_path); - } catch (error45) { - if (!isENOENT(error45)) { - throw error45; + } catch (error41) { + if (!isENOENT(error41)) { + throw error41; } } - return areFileEditsEquivalent(input1.edits, input22.edits, fileContent); + return areFileEditsEquivalent(input1.edits, input2.edits, fileContent); } var LEFT_SINGLE_CURLY_QUOTE = "‘", RIGHT_SINGLE_CURLY_QUOTE = "’", LEFT_DOUBLE_CURLY_QUOTE = "“", RIGHT_DOUBLE_CURLY_QUOTE = "”", DIFF_SNIPPET_MAX_BYTES = 8192, DESANITIZATIONS; -var init_utils9 = __esm(() => { +var init_utils8 = __esm(() => { init_lib(); init_log3(); init_path2(); @@ -489282,26 +412893,26 @@ Assistant:` }); // src/tools/FileEditTool/UI.tsx -function userFacingName2(input11) { - if (!input11) { +function userFacingName2(input) { + if (!input) { return "Update"; } - if (input11.file_path?.startsWith(getPlansDirectory())) { + if (input.file_path?.startsWith(getPlansDirectory())) { return "Updated plan"; } - if (input11.edits != null) { + if (input.edits != null) { return "Update"; } - if (input11.old_string === "") { + if (input.old_string === "") { return "Create"; } return "Update"; } -function getToolUseSummary(input11) { - if (!input11?.file_path) { +function getToolUseSummary(input) { + if (!input?.file_path) { return null; } - return getDisplayPath(input11.file_path); + return getDisplayPath(input.file_path); } function renderToolUseMessage6({ file_path @@ -489339,16 +412950,16 @@ function renderToolResultMessage5({ previewHint: isPlanFile ? "/plan to preview" : undefined }, undefined, false, undefined, this); } -function renderToolUseRejectedMessage3(input11, options2) { +function renderToolUseRejectedMessage3(input, options2) { const { style, verbose } = options2; - const filePath = input11.file_path; - const oldString = input11.old_string ?? ""; - const newString = input11.new_string ?? ""; - const replaceAll = input11.replace_all ?? false; - if ("edits" in input11 && input11.edits != null) { + const filePath = input.file_path; + const oldString = input.old_string ?? ""; + const newString = input.new_string ?? ""; + const replaceAll = input.replace_all ?? false; + if ("edits" in input && input.edits != null) { return /* @__PURE__ */ jsx_dev_runtime126.jsxDEV(FileEditToolUseRejectedMessage, { file_path: filePath, operation: "update", @@ -489375,12 +412986,12 @@ function renderToolUseRejectedMessage3(input11, options2) { verbose }, undefined, false, undefined, this); } -function renderToolUseErrorMessage5(result3, options2) { +function renderToolUseErrorMessage5(result2, options2) { const { verbose } = options2; - if (!verbose && typeof result3 === "string" && extractTag(result3, "tool_use_error")) { - const errorMessage2 = extractTag(result3, "tool_use_error"); + if (!verbose && typeof result2 === "string" && extractTag(result2, "tool_use_error")) { + const errorMessage2 = extractTag(result2, "tool_use_error"); if (errorMessage2?.includes("File has not been read yet")) { return /* @__PURE__ */ jsx_dev_runtime126.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime126.jsxDEV(ThemedText, { @@ -489405,7 +413016,7 @@ function renderToolUseErrorMessage5(result3, options2) { }, undefined, false, undefined, this); } return /* @__PURE__ */ jsx_dev_runtime126.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } @@ -489560,7 +413171,7 @@ var init_UI5 = __esm(() => { import_react78 = __toESM(require_react(), 1); init_FileEditToolUseRejectedMessage(); init_MessageResponse(); - init_messages5(); + init_messages3(); init_FallbackToolUseErrorMessage(); init_FileEditToolUpdatedMessage(); init_FilePathLink(); @@ -489571,12 +413182,12 @@ var init_UI5 = __esm(() => { init_plans(); init_readEditContext(); init_stringUtils(); - init_utils9(); + init_utils8(); jsx_dev_runtime126 = __toESM(require_jsx_dev_runtime(), 1); }); // src/tools/FileEditTool/FileEditTool.ts -import { dirname as dirname36, isAbsolute as isAbsolute19, sep as sep21 } from "path"; +import { dirname as dirname33, isAbsolute as isAbsolute18, sep as sep18 } from "path"; function readFileForEdit(absoluteFilePath) { try { const meta = readFileSyncWithMetadata(absoluteFilePath); @@ -489627,9 +413238,9 @@ var init_FileEditTool = __esm(() => { init_shellRuleMatching(); init_validateEditTool(); init_prompt15(); - init_types11(); + init_types9(); init_UI5(); - init_utils9(); + init_utils8(); MAX_EDIT_FILE_SIZE = 1024 * 1024 * 1024; FileEditTool = buildTool({ name: FILE_EDIT_TOOL_NAME, @@ -489644,8 +413255,8 @@ var init_FileEditTool = __esm(() => { }, userFacingName: userFacingName2, getToolUseSummary, - getActivityDescription(input11) { - const summary = getToolUseSummary(input11); + getActivityDescription(input) { + const summary = getToolUseSummary(input); return summary ? `Editing ${summary}` : "Editing file"; }, get inputSchema() { @@ -489654,30 +413265,30 @@ var init_FileEditTool = __esm(() => { get outputSchema() { return outputSchema6(); }, - toAutoClassifierInput(input11) { - return `${input11.file_path}: ${input11.new_string}`; + toAutoClassifierInput(input) { + return `${input.file_path}: ${input.new_string}`; }, - getPath(input11) { - return input11.file_path; + getPath(input) { + return input.file_path; }, - backfillObservableInput(input11) { - if (typeof input11.file_path === "string") { - input11.file_path = expandPath(input11.file_path); + backfillObservableInput(input) { + if (typeof input.file_path === "string") { + input.file_path = expandPath(input.file_path); } }, async preparePermissionMatcher({ file_path }) { return (pattern) => matchWildcardPattern(pattern, file_path); }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); - return checkWritePermissionForTool(FileEditTool, input11, appState.toolPermissionContext); + return checkWritePermissionForTool(FileEditTool, input, appState.toolPermissionContext); }, renderToolUseMessage: renderToolUseMessage6, renderToolResultMessage: renderToolResultMessage5, renderToolUseRejectedMessage: renderToolUseRejectedMessage3, renderToolUseErrorMessage: renderToolUseErrorMessage5, - async validateInput(input11, toolUseContext) { - const { file_path, old_string, new_string, replace_all = false } = input11; + async validateInput(input, toolUseContext) { + const { file_path, old_string, new_string, replace_all = false } = input; const fullFilePath = expandPath(file_path); const secretError = checkTeamMemSecrets(fullFilePath, new_string); if (secretError) { @@ -489704,14 +413315,14 @@ var init_FileEditTool = __esm(() => { if (fullFilePath.startsWith("\\\\") || fullFilePath.startsWith("//")) { return { result: true }; } - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); try { - const { size: size3 } = await fs11.stat(fullFilePath); - if (size3 > MAX_EDIT_FILE_SIZE) { + const { size: size2 } = await fs5.stat(fullFilePath); + if (size2 > MAX_EDIT_FILE_SIZE) { return { result: false, behavior: "ask", - message: `File is too large to edit (${formatFileSize(size3)}). Maximum editable file size is ${formatFileSize(MAX_EDIT_FILE_SIZE)}.`, + message: `File is too large to edit (${formatFileSize(size2)}). Maximum editable file size is ${formatFileSize(MAX_EDIT_FILE_SIZE)}.`, errorCode: 10 }; } @@ -489722,7 +413333,7 @@ var init_FileEditTool = __esm(() => { } let fileContent; try { - const fileBuffer = await fs11.readFileBytes(fullFilePath); + const fileBuffer = await fs5.readFileBytes(fullFilePath); const encoding = fileBuffer.length >= 2 && fileBuffer[0] === 255 && fileBuffer[1] === 254 ? "utf16le" : "utf8"; fileContent = fileBuffer.toString(encoding).replaceAll(`\r `, ` @@ -489781,7 +413392,7 @@ var init_FileEditTool = __esm(() => { behavior: "ask", message: "File has not been read yet. Read it first before writing to it.", meta: { - isFilePathAbsolute: String(isAbsolute19(file_path)) + isFilePathAbsolute: String(isAbsolute18(file_path)) }, errorCode: 6 }; @@ -489809,20 +413420,20 @@ var init_FileEditTool = __esm(() => { message: `String to replace not found in file. String: ${old_string}`, meta: { - isFilePathAbsolute: String(isAbsolute19(file_path)) + isFilePathAbsolute: String(isAbsolute18(file_path)) }, errorCode: 8 }; } - const matches3 = file2.split(actualOldString).length - 1; - if (matches3 > 1 && !replace_all) { + const matches2 = file2.split(actualOldString).length - 1; + if (matches2 > 1 && !replace_all) { return { result: false, behavior: "ask", - message: `Found ${matches3} matches of the string to replace, but replace_all is false. To replace all occurrences, set replace_all to true. To replace only one occurrence, please provide more context to uniquely identify the instance. + message: `Found ${matches2} matches of the string to replace, but replace_all is false. To replace all occurrences, set replace_all to true. To replace only one occurrence, please provide more context to uniquely identify the instance. String: ${old_string}`, meta: { - isFilePathAbsolute: String(isAbsolute19(file_path)), + isFilePathAbsolute: String(isAbsolute18(file_path)), actualOldString }, errorCode: 9 @@ -489836,7 +413447,7 @@ String: ${old_string}`, } return { result: true, meta: { actualOldString } }; }, - inputsEquivalent(input1, input22) { + inputsEquivalent(input1, input2) { return areFileEditsInputsEquivalent({ file_path: input1.file_path, edits: [ @@ -489847,24 +413458,24 @@ String: ${old_string}`, } ] }, { - file_path: input22.file_path, + file_path: input2.file_path, edits: [ { - old_string: input22.old_string, - new_string: input22.new_string, - replace_all: input22.replace_all ?? false + old_string: input2.old_string, + new_string: input2.new_string, + replace_all: input2.replace_all ?? false } ] }); }, - async call(input11, { + async call(input, { readFileState, userModified, updateFileHistoryState, dynamicSkillDirTriggers }, _, parentMessage) { - const { file_path, old_string, new_string, replace_all = false } = input11; - const fs11 = getFsImplementation(); + const { file_path, old_string, new_string, replace_all = false } = input; + const fs5 = getFsImplementation(); const absoluteFilePath = expandPath(file_path); const cwd2 = getCwd(); if (!isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) { @@ -489878,7 +413489,7 @@ String: ${old_string}`, activateConditionalSkillsForPaths([absoluteFilePath], cwd2); } await diagnosticTracker.beforeFileEdited(absoluteFilePath); - await fs11.mkdir(dirname36(absoluteFilePath)); + await fs5.mkdir(dirname33(absoluteFilePath)); if (fileHistoryEnabled()) { await fileHistoryTrackEdit(updateFileHistoryState, absoluteFilePath, parentMessage.uuid); } @@ -489912,13 +413523,13 @@ String: ${old_string}`, const lspManager = getLspServerManager(); if (lspManager) { clearDeliveredDiagnosticsForFile(`file://${absoluteFilePath}`); - lspManager.changeFile(absoluteFilePath, updatedFile).catch((err3) => { - logForDebugging(`LSP: Failed to notify server of file change for ${absoluteFilePath}: ${err3.message}`); - logError2(err3); + lspManager.changeFile(absoluteFilePath, updatedFile).catch((err2) => { + logForDebugging(`LSP: Failed to notify server of file change for ${absoluteFilePath}: ${err2.message}`); + logError2(err2); }); - lspManager.saveFile(absoluteFilePath).catch((err3) => { - logForDebugging(`LSP: Failed to notify server of file save for ${absoluteFilePath}: ${err3.message}`); - logError2(err3); + lspManager.saveFile(absoluteFilePath).catch((err2) => { + logForDebugging(`LSP: Failed to notify server of file save for ${absoluteFilePath}: ${err2.message}`); + logError2(err2); }); } notifyVscodeFileUpdated(absoluteFilePath, originalFileContents, updatedFile); @@ -489928,7 +413539,7 @@ String: ${old_string}`, offset: undefined, limit: undefined }); - if (absoluteFilePath.endsWith(`${sep21}CLAUDE.md`)) { + if (absoluteFilePath.endsWith(`${sep18}CLAUDE.md`)) { logEvent("tengu_write_claudemd", {}); } countLinesChanged(patch); @@ -489988,10 +413599,10 @@ String: ${old_string}`, }); // src/tools/FileWriteTool/UI.tsx -import { isAbsolute as isAbsolute20, relative as relative17, resolve as resolve34 } from "path"; +import { isAbsolute as isAbsolute19, relative as relative15, resolve as resolve28 } from "path"; function countLines(content) { - const parts = content.split(EOL4); - return content.endsWith(EOL4) ? parts.length - 1 : parts.length; + const parts = content.split(EOL3); + return content.endsWith(EOL3) ? parts.length - 1 : parts.length; } function FileWriteToolCreatedMessage(t0) { const $2 = import_compiler_runtime112.c(25); @@ -490019,7 +413630,7 @@ function FileWriteToolCreatedMessage(t0) { } let t2; if ($2[2] !== filePath || $2[3] !== verbose) { - t2 = verbose ? filePath : relative17(getCwd(), filePath); + t2 = verbose ? filePath : relative15(getCwd(), filePath); $2[2] = filePath; $2[3] = verbose; $2[4] = t2; @@ -490124,8 +413735,8 @@ function FileWriteToolCreatedMessage(t0) { } return t9; } -function userFacingName3(input11) { - if (input11?.file_path?.startsWith(getPlansDirectory())) { +function userFacingName3(input) { + if (input?.file_path?.startsWith(getPlansDirectory())) { return "Updated plan"; } return "Write"; @@ -490137,32 +413748,32 @@ function isResultTruncated({ if (type !== "create") return false; let pos = 0; - for (let i4 = 0;i4 < MAX_LINES_TO_RENDER2; i4++) { - pos = content.indexOf(EOL4, pos); + for (let i3 = 0;i3 < MAX_LINES_TO_RENDER2; i3++) { + pos = content.indexOf(EOL3, pos); if (pos === -1) return false; pos++; } return pos < content.length; } -function getToolUseSummary2(input11) { - if (!input11?.file_path) { +function getToolUseSummary2(input) { + if (!input?.file_path) { return null; } - return getDisplayPath(input11.file_path); + return getDisplayPath(input.file_path); } -function renderToolUseMessage7(input11, { +function renderToolUseMessage7(input, { verbose }) { - if (!input11.file_path) { + if (!input.file_path) { return null; } - if (input11.file_path.startsWith(getPlansDirectory())) { + if (input.file_path.startsWith(getPlansDirectory())) { return ""; } return /* @__PURE__ */ jsx_dev_runtime127.jsxDEV(FilePathLink, { - filePath: input11.file_path, - children: verbose ? input11.file_path : getDisplayPath(input11.file_path) + filePath: input.file_path, + children: verbose ? input.file_path : getDisplayPath(input.file_path) }, undefined, false, undefined, this); } function renderToolUseRejectedMessage4({ @@ -490312,7 +413923,7 @@ function WriteRejectionBody(t0) { } async function loadRejectionDiff2(filePath, content) { try { - const fullFilePath = isAbsolute20(filePath) ? filePath : resolve34(getCwd(), filePath); + const fullFilePath = isAbsolute19(filePath) ? filePath : resolve28(getCwd(), filePath); const handle = await openForScan(fullFilePath); if (handle === null) return { @@ -490349,10 +413960,10 @@ async function loadRejectionDiff2(filePath, content) { }; } } -function renderToolUseErrorMessage6(result3, { +function renderToolUseErrorMessage6(result2, { verbose }) { - if (!verbose && typeof result3 === "string" && extractTag(result3, "tool_use_error")) { + if (!verbose && typeof result2 === "string" && extractTag(result2, "tool_use_error")) { return /* @__PURE__ */ jsx_dev_runtime127.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime127.jsxDEV(ThemedText, { color: "error", @@ -490361,7 +413972,7 @@ function renderToolUseErrorMessage6(result3, { }, undefined, false, undefined, this); } return /* @__PURE__ */ jsx_dev_runtime127.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } @@ -490400,7 +414011,7 @@ function renderToolResultMessage6({ " ", /* @__PURE__ */ jsx_dev_runtime127.jsxDEV(ThemedText, { bold: true, - children: relative17(getCwd(), filePath) + children: relative15(getCwd(), filePath) }, undefined, false, undefined, this) ] }, undefined, true, undefined, this); @@ -490426,13 +414037,13 @@ function renderToolResultMessage6({ } } } -var import_compiler_runtime112, import_react79, jsx_dev_runtime127, MAX_LINES_TO_RENDER2 = 10, EOL4 = ` +var import_compiler_runtime112, import_react79, jsx_dev_runtime127, MAX_LINES_TO_RENDER2 = 10, EOL3 = ` `; var init_UI6 = __esm(() => { import_compiler_runtime112 = __toESM(require_compiler_runtime(), 1); import_react79 = __toESM(require_react(), 1); init_MessageResponse(); - init_messages5(); + init_messages3(); init_CtrlOToExpand(); init_FallbackToolUseErrorMessage(); init_FileEditToolUpdatedMessage(); @@ -490451,7 +414062,7 @@ var init_UI6 = __esm(() => { }); // src/tools/FileWriteTool/FileWriteTool.ts -import { dirname as dirname37, sep as sep22 } from "path"; +import { dirname as dirname34, sep as sep19 } from "path"; var inputSchema9, outputSchema7, FileWriteTool; var init_FileWriteTool = __esm(() => { init_analytics(); @@ -490479,7 +414090,7 @@ var init_FileWriteTool = __esm(() => { init_path2(); init_filesystem(); init_shellRuleMatching(); - init_types11(); + init_types9(); init_prompt4(); init_UI6(); inputSchema9 = lazySchema(() => exports_external.strictObject({ @@ -490504,8 +414115,8 @@ var init_FileWriteTool = __esm(() => { }, userFacingName: userFacingName3, getToolUseSummary: getToolUseSummary2, - getActivityDescription(input11) { - const summary = getToolUseSummary2(input11); + getActivityDescription(input) { + const summary = getToolUseSummary2(input); return summary ? `Writing ${summary}` : "Writing file"; }, async prompt() { @@ -490519,23 +414130,23 @@ var init_FileWriteTool = __esm(() => { get outputSchema() { return outputSchema7(); }, - toAutoClassifierInput(input11) { - return `${input11.file_path}: ${input11.content}`; + toAutoClassifierInput(input) { + return `${input.file_path}: ${input.content}`; }, - getPath(input11) { - return input11.file_path; + getPath(input) { + return input.file_path; }, - backfillObservableInput(input11) { - if (typeof input11.file_path === "string") { - input11.file_path = expandPath(input11.file_path); + backfillObservableInput(input) { + if (typeof input.file_path === "string") { + input.file_path = expandPath(input.file_path); } }, async preparePermissionMatcher({ file_path }) { return (pattern) => matchWildcardPattern(pattern, file_path); }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); - return checkWritePermissionForTool(FileWriteTool, input11, appState.toolPermissionContext); + return checkWritePermissionForTool(FileWriteTool, input, appState.toolPermissionContext); }, renderToolUseRejectedMessage: renderToolUseRejectedMessage4, renderToolUseErrorMessage: renderToolUseErrorMessage6, @@ -490561,10 +414172,10 @@ var init_FileWriteTool = __esm(() => { if (fullFilePath.startsWith("\\\\") || fullFilePath.startsWith("//")) { return { result: true }; } - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); let fileMtimeMs; try { - const fileStat = await fs11.stat(fullFilePath); + const fileStat = await fs5.stat(fullFilePath); fileMtimeMs = fileStat.mtimeMs; } catch (e) { if (isENOENT(e)) { @@ -490592,7 +414203,7 @@ var init_FileWriteTool = __esm(() => { }, async call({ file_path, content }, { readFileState, updateFileHistoryState, dynamicSkillDirTriggers }, _, parentMessage) { const fullFilePath = expandPath(file_path); - const dir = dirname37(fullFilePath); + const dir = dirname34(fullFilePath); const cwd2 = getCwd(); const newSkillDirs = await discoverSkillDirsForPaths([fullFilePath], cwd2); if (newSkillDirs.length > 0) { @@ -490633,13 +414244,13 @@ var init_FileWriteTool = __esm(() => { const lspManager = getLspServerManager(); if (lspManager) { clearDeliveredDiagnosticsForFile(`file://${fullFilePath}`); - lspManager.changeFile(fullFilePath, content).catch((err3) => { - logForDebugging(`LSP: Failed to notify server of file change for ${fullFilePath}: ${err3.message}`); - logError2(err3); + lspManager.changeFile(fullFilePath, content).catch((err2) => { + logForDebugging(`LSP: Failed to notify server of file change for ${fullFilePath}: ${err2.message}`); + logError2(err2); }); - lspManager.saveFile(fullFilePath).catch((err3) => { - logForDebugging(`LSP: Failed to notify server of file save for ${fullFilePath}: ${err3.message}`); - logError2(err3); + lspManager.saveFile(fullFilePath).catch((err2) => { + logForDebugging(`LSP: Failed to notify server of file save for ${fullFilePath}: ${err2.message}`); + logError2(err2); }); } notifyVscodeFileUpdated(fullFilePath, oldContent, content); @@ -490649,7 +414260,7 @@ var init_FileWriteTool = __esm(() => { offset: undefined, limit: undefined }); - if (fullFilePath.endsWith(`${sep22}CLAUDE.md`)) { + if (fullFilePath.endsWith(`${sep19}CLAUDE.md`)) { logEvent("tengu_write_claudemd", {}); } let gitDiff; @@ -490734,9 +414345,9 @@ var init_FileWriteTool = __esm(() => { }); // src/utils/plugins/orphanedPluginFilter.ts -import { dirname as dirname38, isAbsolute as isAbsolute21, join as join94, normalize as normalize10, relative as relative18, sep as sep23 } from "path"; +import { dirname as dirname35, isAbsolute as isAbsolute20, join as join84, normalize as normalize9, relative as relative16, sep as sep20 } from "path"; async function getGlobExclusionsForPluginCache(searchPath) { - const cachePath = normalize10(join94(getPluginsDirectory(), "cache")); + const cachePath = normalize9(join84(getPluginsDirectory(), "cache")); if (searchPath && !pathsOverlap(searchPath, cachePath)) { return []; } @@ -490754,8 +414365,8 @@ async function getGlobExclusionsForPluginCache(searchPath) { ORPHANED_AT_FILENAME ], cachePath, new AbortController().signal); cachedExclusions = markers.map((markerPath) => { - const versionDir = dirname38(markerPath); - const rel = isAbsolute21(versionDir) ? relative18(cachePath, versionDir) : versionDir; + const versionDir = dirname35(markerPath); + const rel = isAbsolute20(versionDir) ? relative16(cachePath, versionDir) : versionDir; const posixRelative = rel.replace(/\\/g, "/"); return `!**/${posixRelative}/**`; }); @@ -490771,10 +414382,10 @@ function clearPluginCacheExclusions() { function pathsOverlap(a2, b) { const na = normalizeForCompare(a2); const nb = normalizeForCompare(b); - return na === nb || na === sep23 || nb === sep23 || na.startsWith(nb + sep23) || nb.startsWith(na + sep23); + return na === nb || na === sep20 || nb === sep20 || na.startsWith(nb + sep20) || nb.startsWith(na + sep20); } function normalizeForCompare(p) { - const n2 = normalize10(p); + const n2 = normalize9(p); return process.platform === "win32" ? n2.toLowerCase() : n2; } var ORPHANED_AT_FILENAME = ".orphaned_at", cachedExclusions = null; @@ -490784,17 +414395,17 @@ var init_orphanedPluginFilter = __esm(() => { }); // src/utils/glob.ts -import { basename as basename25, dirname as dirname39, isAbsolute as isAbsolute22, join as join95, sep as sep24 } from "path"; +import { basename as basename23, dirname as dirname36, isAbsolute as isAbsolute21, join as join85, sep as sep21 } from "path"; function extractGlobBaseDirectory(pattern) { const globChars = /[*?[{]/; const match = pattern.match(globChars); if (!match || match.index === undefined) { - const dir = dirname39(pattern); - const file2 = basename25(pattern); + const dir = dirname36(pattern); + const file2 = basename23(pattern); return { baseDir: dir, relativePattern: file2 }; } const staticPrefix = pattern.slice(0, match.index); - const lastSepIndex = Math.max(staticPrefix.lastIndexOf("/"), staticPrefix.lastIndexOf(sep24)); + const lastSepIndex = Math.max(staticPrefix.lastIndexOf("/"), staticPrefix.lastIndexOf(sep21)); if (lastSepIndex === -1) { return { baseDir: "", relativePattern: pattern }; } @@ -490804,14 +414415,14 @@ function extractGlobBaseDirectory(pattern) { baseDir = "/"; } if (getPlatform() === "windows" && /^[A-Za-z]:$/.test(baseDir)) { - baseDir = baseDir + sep24; + baseDir = baseDir + sep21; } return { baseDir, relativePattern }; } async function glob(filePattern, cwd2, { limit, offset }, abortSignal, toolPermissionContext) { let searchDir = cwd2; let searchPattern = filePattern; - if (isAbsolute22(filePattern)) { + if (isAbsolute21(filePattern)) { const { baseDir, relativePattern } = extractGlobBaseDirectory(filePattern); if (baseDir) { searchDir = baseDir; @@ -490836,10 +414447,10 @@ async function glob(filePattern, cwd2, { limit, offset }, abortSignal, toolPermi args.push("--glob", exclusion); } const allPaths = await ripGrep(args, searchDir, abortSignal); - const absolutePaths = allPaths.map((p) => isAbsolute22(p) ? p : join95(searchDir, p)); + const absolutePaths = allPaths.map((p) => isAbsolute21(p) ? p : join85(searchDir, p)); const truncated = absolutePaths.length > offset + limit; - const files2 = absolutePaths.slice(offset, offset + limit); - return { files: files2, truncated }; + const files = absolutePaths.slice(offset, offset + limit); + return { files, truncated }; } var init_glob = __esm(() => { init_envUtils(); @@ -491013,7 +414624,7 @@ function SearchResultSummary(t0) { } function renderToolUseMessage8({ pattern, - path: path20 + path: path15 }, { verbose }) { @@ -491021,16 +414632,16 @@ function renderToolUseMessage8({ return null; } const parts = [`pattern: "${pattern}"`]; - if (path20) { - parts.push(`path: "${verbose ? path20 : getDisplayPath(path20)}"`); + if (path15) { + parts.push(`path: "${verbose ? path15 : getDisplayPath(path15)}"`); } return parts.join(", "); } -function renderToolUseErrorMessage7(result3, { +function renderToolUseErrorMessage7(result2, { verbose }) { - if (!verbose && typeof result3 === "string" && extractTag(result3, "tool_use_error")) { - const errorMessage2 = extractTag(result3, "tool_use_error"); + if (!verbose && typeof result2 === "string" && extractTag(result2, "tool_use_error")) { + const errorMessage2 = extractTag(result2, "tool_use_error"); if (errorMessage2?.includes(FILE_NOT_FOUND_CWD_NOTE)) { return /* @__PURE__ */ jsx_dev_runtime128.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime128.jsxDEV(ThemedText, { @@ -491047,7 +414658,7 @@ function renderToolUseErrorMessage7(result3, { }, undefined, false, undefined, this); } return /* @__PURE__ */ jsx_dev_runtime128.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } @@ -491088,11 +414699,11 @@ function renderToolResultMessage7({ verbose }, undefined, false, undefined, this); } -function getToolUseSummary3(input11) { - if (!input11?.pattern) { +function getToolUseSummary3(input) { + if (!input?.pattern) { return null; } - return truncate(input11.pattern, TOOL_SUMMARY_MAX_LENGTH); + return truncate(input.pattern, TOOL_SUMMARY_MAX_LENGTH); } var import_compiler_runtime113, jsx_dev_runtime128; var init_UI7 = __esm(() => { @@ -491104,7 +414715,7 @@ var init_UI7 = __esm(() => { init_ink2(); init_file(); init_format(); - init_messages5(); + init_messages3(); jsx_dev_runtime128 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -491193,8 +414804,8 @@ var init_GrepTool = __esm(() => { return "Search"; }, getToolUseSummary: getToolUseSummary3, - getActivityDescription(input11) { - const summary = getToolUseSummary3(input11); + getActivityDescription(input) { + const summary = getToolUseSummary3(input); return summary ? `Searching for ${summary}` : "Searching"; }, get inputSchema() { @@ -491209,31 +414820,31 @@ var init_GrepTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.path ? `${input11.pattern} in ${input11.path}` : input11.pattern; + toAutoClassifierInput(input) { + return input.path ? `${input.pattern} in ${input.path}` : input.pattern; }, isSearchOrReadCommand() { return { isSearch: true, isRead: false }; }, - getPath({ path: path20 }) { - return path20 || getCwd(); + getPath({ path: path15 }) { + return path15 || getCwd(); }, async preparePermissionMatcher({ pattern }) { return (rulePattern) => matchWildcardPattern(rulePattern, pattern); }, - async validateInput({ path: path20 }) { - if (path20) { - const fs11 = getFsImplementation(); - const absolutePath = expandPath(path20); + async validateInput({ path: path15 }) { + if (path15) { + const fs5 = getFsImplementation(); + const absolutePath = expandPath(path15); if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) { return { result: true }; } try { - await fs11.stat(absolutePath); + await fs5.stat(absolutePath); } catch (e) { if (isENOENT(e)) { const cwdSuggestion = await suggestPathUnderCwd(absolutePath); - let message = `Path does not exist: ${path20}. ${FILE_NOT_FOUND_CWD_NOTE} ${getCwd()}.`; + let message = `Path does not exist: ${path15}. ${FILE_NOT_FOUND_CWD_NOTE} ${getCwd()}.`; if (cwdSuggestion) { message += ` Did you mean ${cwdSuggestion}?`; } @@ -491248,9 +414859,9 @@ var init_GrepTool = __esm(() => { } return { result: true }; }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); - return checkReadPermissionForTool(GrepTool, input11, appState.toolPermissionContext); + return checkReadPermissionForTool(GrepTool, input, appState.toolPermissionContext); }, async prompt() { return getDescription(); @@ -491289,11 +414900,11 @@ var init_GrepTool = __esm(() => { if (mode === "count") { const limitInfo2 = formatLimitInfo(appliedLimit, appliedOffset); const rawContent = content || "No matches found"; - const matches3 = numMatches ?? 0; - const files2 = numFiles ?? 0; + const matches2 = numMatches ?? 0; + const files = numFiles ?? 0; const summary = ` -Found ${matches3} total ${matches3 === 1 ? "occurrence" : "occurrences"} across ${files2} ${files2 === 1 ? "file" : "files"}.${limitInfo2 ? ` with pagination = ${limitInfo2}` : ""}`; +Found ${matches2} total ${matches2 === 1 ? "occurrence" : "occurrences"} across ${files} ${files === 1 ? "file" : "files"}.${limitInfo2 ? ` with pagination = ${limitInfo2}` : ""}`; return { tool_use_id: toolUseID, type: "tool_result", @@ -491308,18 +414919,18 @@ Found ${matches3} total ${matches3 === 1 ? "occurrence" : "occurrences"} across content: "No files found" }; } - const result3 = `Found ${numFiles} ${plural(numFiles, "file")}${limitInfo ? ` ${limitInfo}` : ""} + const result2 = `Found ${numFiles} ${plural(numFiles, "file")}${limitInfo ? ` ${limitInfo}` : ""} ${filenames.join(` `)}`; return { tool_use_id: toolUseID, type: "tool_result", - content: result3 + content: result2 }; }, async call({ pattern, - path: path20, + path: path15, glob: glob2, type, output_mode = "files_with_matches", @@ -491333,7 +414944,7 @@ ${filenames.join(` offset = 0, multiline = false }, { abortController, getAppState }) { - const absolutePath = path20 ? expandPath(path20) : getCwd(); + const absolutePath = path15 ? expandPath(path15) : getCwd(); const args = ["--hidden"]; for (const dir of VCS_DIRECTORIES_TO_EXCLUDE2) { args.push("--glob", `!${dir}`); @@ -491405,8 +415016,8 @@ ${filenames.join(` const colonIndex = line.indexOf(":"); if (colonIndex > 0) { const filePath = line.substring(0, colonIndex); - const rest3 = line.substring(colonIndex); - return toRelativePath(filePath) + rest3; + const rest2 = line.substring(colonIndex); + return toRelativePath(filePath) + rest2; } return line; }); @@ -491459,8 +415070,8 @@ ${filenames.join(` return { data: output2 }; } const stats = await Promise.allSettled(results.map((_) => getFsImplementation().stat(_))); - const sortedMatches = results.map((_, i4) => { - const r = stats[i4]; + const sortedMatches = results.map((_, i3) => { + const r = stats[i3]; return [ _, r.status === "fulfilled" ? r.value.mtimeMs ?? 0 : 0 @@ -491495,23 +415106,23 @@ function userFacingName4() { } function renderToolUseMessage9({ pattern, - path: path20 + path: path15 }, { verbose }) { if (!pattern) { return null; } - if (!path20) { + if (!path15) { return `pattern: "${pattern}"`; } - return `pattern: "${pattern}", path: "${verbose ? path20 : getDisplayPath(path20)}"`; + return `pattern: "${pattern}", path: "${verbose ? path15 : getDisplayPath(path15)}"`; } -function renderToolUseErrorMessage8(result3, { +function renderToolUseErrorMessage8(result2, { verbose }) { - if (!verbose && typeof result3 === "string" && extractTag(result3, "tool_use_error")) { - const errorMessage2 = extractTag(result3, "tool_use_error"); + if (!verbose && typeof result2 === "string" && extractTag(result2, "tool_use_error")) { + const errorMessage2 = extractTag(result2, "tool_use_error"); if (errorMessage2?.includes(FILE_NOT_FOUND_CWD_NOTE)) { return /* @__PURE__ */ jsx_dev_runtime129.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime129.jsxDEV(ThemedText, { @@ -491528,20 +415139,20 @@ function renderToolUseErrorMessage8(result3, { }, undefined, false, undefined, this); } return /* @__PURE__ */ jsx_dev_runtime129.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } -function getToolUseSummary4(input11) { - if (!input11?.pattern) { +function getToolUseSummary4(input) { + if (!input?.pattern) { return null; } - return truncate(input11.pattern, TOOL_SUMMARY_MAX_LENGTH); + return truncate(input.pattern, TOOL_SUMMARY_MAX_LENGTH); } var jsx_dev_runtime129, renderToolResultMessage8; var init_UI8 = __esm(() => { init_MessageResponse(); - init_messages5(); + init_messages3(); init_FallbackToolUseErrorMessage(); init_toolLimits(); init_ink2(); @@ -491585,8 +415196,8 @@ var init_GlobTool = __esm(() => { }, userFacingName: userFacingName4, getToolUseSummary: getToolUseSummary4, - getActivityDescription(input11) { - const summary = getToolUseSummary4(input11); + getActivityDescription(input) { + const summary = getToolUseSummary4(input); return summary ? `Finding ${summary}` : "Finding files"; }, get inputSchema() { @@ -491601,32 +415212,32 @@ var init_GlobTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.pattern; + toAutoClassifierInput(input) { + return input.pattern; }, isSearchOrReadCommand() { return { isSearch: true, isRead: false }; }, - getPath({ path: path20 }) { - return path20 ? expandPath(path20) : getCwd(); + getPath({ path: path15 }) { + return path15 ? expandPath(path15) : getCwd(); }, async preparePermissionMatcher({ pattern }) { return (rulePattern) => matchWildcardPattern(rulePattern, pattern); }, - async validateInput({ path: path20 }) { - if (path20) { - const fs11 = getFsImplementation(); - const absolutePath = expandPath(path20); + async validateInput({ path: path15 }) { + if (path15) { + const fs5 = getFsImplementation(); + const absolutePath = expandPath(path15); if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) { return { result: true }; } let stats; try { - stats = await fs11.stat(absolutePath); + stats = await fs5.stat(absolutePath); } catch (e) { if (isENOENT(e)) { const cwdSuggestion = await suggestPathUnderCwd(absolutePath); - let message = `Directory does not exist: ${path20}. ${FILE_NOT_FOUND_CWD_NOTE} ${getCwd()}.`; + let message = `Directory does not exist: ${path15}. ${FILE_NOT_FOUND_CWD_NOTE} ${getCwd()}.`; if (cwdSuggestion) { message += ` Did you mean ${cwdSuggestion}?`; } @@ -491641,16 +415252,16 @@ var init_GlobTool = __esm(() => { if (!stats.isDirectory()) { return { result: false, - message: `Path is not a directory: ${path20}`, + message: `Path is not a directory: ${path15}`, errorCode: 2 }; } } return { result: true }; }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); - return checkReadPermissionForTool(GlobTool, input11, appState.toolPermissionContext); + return checkReadPermissionForTool(GlobTool, input, appState.toolPermissionContext); }, async prompt() { return DESCRIPTION4; @@ -491662,12 +415273,12 @@ var init_GlobTool = __esm(() => { return filenames.join(` `); }, - async call(input11, { abortController, getAppState, globLimits }) { + async call(input, { abortController, getAppState, globLimits }) { const start = Date.now(); const appState = getAppState(); const limit = globLimits?.maxResults ?? 100; - const { files: files2, truncated } = await glob(input11.pattern, GlobTool.getPath(input11), { limit, offset: 0 }, abortController.signal, appState.toolPermissionContext); - const filenames = files2.map(toRelativePath); + const { files, truncated } = await glob(input.pattern, GlobTool.getPath(input), { limit, offset: 0 }, abortController.signal, appState.toolPermissionContext); + const filenames = files.map(toRelativePath); const output = { filenames, durationMs: Date.now() - start, @@ -491703,20 +415314,20 @@ var init_GlobTool = __esm(() => { // src/utils/notebook.ts function isLargeOutputs(outputs) { - let size3 = 0; + let size2 = 0; for (const o2 of outputs) { if (!o2) continue; - size3 += (o2.text?.length ?? 0) + (o2.image?.image_data.length ?? 0); - if (size3 > LARGE_OUTPUT_THRESHOLD) + size2 += (o2.text?.length ?? 0) + (o2.image?.image_data.length ?? 0); + if (size2 > LARGE_OUTPUT_THRESHOLD) return true; } return false; } -function processOutputText(text2) { - if (!text2) +function processOutputText(text) { + if (!text) return ""; - const rawText = Array.isArray(text2) ? text2.join("") : text2; + const rawText = Array.isArray(text) ? text.join("") : text; const { truncatedContent } = formatOutput(rawText); return truncatedContent; } @@ -491868,7 +415479,7 @@ function parseCellId(cellId) { } var LARGE_OUTPUT_THRESHOLD = 1e4; var init_notebook = __esm(() => { - init_utils8(); + init_utils7(); init_fsOperations(); init_path2(); init_slowOperations(); @@ -491878,7 +415489,7 @@ var init_notebook = __esm(() => { var DESCRIPTION8 = "Replace the contents of a specific cell in a Jupyter notebook.", PROMPT2 = `Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number.`; // src/components/NotebookEditToolUseRejectedMessage.tsx -import { relative as relative19 } from "path"; +import { relative as relative17 } from "path"; function NotebookEditToolUseRejectedMessage(t0) { const $2 = import_compiler_runtime114.c(20); const { @@ -491908,7 +415519,7 @@ function NotebookEditToolUseRejectedMessage(t0) { } let t3; if ($2[2] !== notebook_path || $2[3] !== verbose) { - t3 = verbose ? notebook_path : relative19(getCwd(), notebook_path); + t3 = verbose ? notebook_path : relative17(getCwd(), notebook_path); $2[2] = notebook_path; $2[3] = verbose; $2[4] = t3; @@ -492006,11 +415617,11 @@ var init_NotebookEditToolUseRejectedMessage = __esm(() => { }); // src/tools/NotebookEditTool/UI.tsx -function getToolUseSummary5(input11) { - if (!input11?.notebook_path) { +function getToolUseSummary5(input) { + if (!input?.notebook_path) { return null; } - return getDisplayPath(input11.notebook_path); + return getDisplayPath(input.notebook_path); } function renderToolUseMessage10({ notebook_path, @@ -492046,22 +415657,22 @@ function renderToolUseMessage10({ ] }, undefined, true, undefined, this); } -function renderToolUseRejectedMessage5(input11, { +function renderToolUseRejectedMessage5(input, { verbose }) { return /* @__PURE__ */ jsx_dev_runtime131.jsxDEV(NotebookEditToolUseRejectedMessage, { - notebook_path: input11.notebook_path, - cell_id: input11.cell_id, - new_source: input11.new_source, - cell_type: input11.cell_type, - edit_mode: input11.edit_mode, + notebook_path: input.notebook_path, + cell_id: input.cell_id, + new_source: input.new_source, + cell_type: input.cell_type, + edit_mode: input.edit_mode, verbose }, undefined, false, undefined, this); } -function renderToolUseErrorMessage9(result3, { +function renderToolUseErrorMessage9(result2, { verbose }) { - if (!verbose && typeof result3 === "string" && extractTag(result3, "tool_use_error")) { + if (!verbose && typeof result2 === "string" && extractTag(result2, "tool_use_error")) { return /* @__PURE__ */ jsx_dev_runtime131.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime131.jsxDEV(ThemedText, { color: "error", @@ -492070,20 +415681,20 @@ function renderToolUseErrorMessage9(result3, { }, undefined, false, undefined, this); } return /* @__PURE__ */ jsx_dev_runtime131.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } function renderToolResultMessage9({ cell_id, new_source, - error: error45 + error: error41 }) { - if (error45) { + if (error41) { return /* @__PURE__ */ jsx_dev_runtime131.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime131.jsxDEV(ThemedText, { color: "error", - children: error45 + children: error41 }, undefined, false, undefined, this) }, undefined, false, undefined, this); } @@ -492114,7 +415725,7 @@ function renderToolResultMessage9({ } var jsx_dev_runtime131; var init_UI9 = __esm(() => { - init_messages5(); + init_messages3(); init_FallbackToolUseErrorMessage(); init_FilePathLink(); init_HighlightedCode(); @@ -492126,7 +415737,7 @@ var init_UI9 = __esm(() => { }); // src/tools/NotebookEditTool/NotebookEditTool.ts -import { extname as extname11, isAbsolute as isAbsolute23, resolve as resolve35 } from "path"; +import { extname as extname11, isAbsolute as isAbsolute22, resolve as resolve29 } from "path"; var inputSchema12, outputSchema10, NotebookEditTool; var init_NotebookEditTool = __esm(() => { init_bun_bundle(); @@ -492175,8 +415786,8 @@ var init_NotebookEditTool = __esm(() => { return "Edit Notebook"; }, getToolUseSummary: getToolUseSummary5, - getActivityDescription(input11) { - const summary = getToolUseSummary5(input11); + getActivityDescription(input) { + const summary = getToolUseSummary5(input); return summary ? `Editing notebook ${summary}` : "Editing notebook"; }, get inputSchema() { @@ -492185,26 +415796,26 @@ var init_NotebookEditTool = __esm(() => { get outputSchema() { return outputSchema10(); }, - toAutoClassifierInput(input11) { + toAutoClassifierInput(input) { if (feature("TRANSCRIPT_CLASSIFIER")) { - const mode = input11.edit_mode ?? "replace"; - return `${input11.notebook_path} ${mode}: ${input11.new_source}`; + const mode = input.edit_mode ?? "replace"; + return `${input.notebook_path} ${mode}: ${input.new_source}`; } return ""; }, - getPath(input11) { - return input11.notebook_path; + getPath(input) { + return input.notebook_path; }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); - return checkWritePermissionForTool(NotebookEditTool, input11, appState.toolPermissionContext); + return checkWritePermissionForTool(NotebookEditTool, input, appState.toolPermissionContext); }, - mapToolResultToToolResultBlockParam({ cell_id, edit_mode, new_source, error: error45 }, toolUseID) { - if (error45) { + mapToolResultToToolResultBlockParam({ cell_id, edit_mode, new_source, error: error41 }, toolUseID) { + if (error41) { return { tool_use_id: toolUseID, type: "tool_result", - content: error45, + content: error41, is_error: true }; } @@ -492240,7 +415851,7 @@ var init_NotebookEditTool = __esm(() => { renderToolUseErrorMessage: renderToolUseErrorMessage9, renderToolResultMessage: renderToolResultMessage9, async validateInput({ notebook_path, cell_type, cell_id, edit_mode = "replace" }, toolUseContext) { - const fullPath = isAbsolute23(notebook_path) ? notebook_path : resolve35(getCwd(), notebook_path); + const fullPath = isAbsolute22(notebook_path) ? notebook_path : resolve29(getCwd(), notebook_path); if (fullPath.startsWith("\\\\") || fullPath.startsWith("//")) { return { result: true }; } @@ -492339,7 +415950,7 @@ var init_NotebookEditTool = __esm(() => { cell_type, edit_mode: originalEditMode }, { readFileState, updateFileHistoryState }, _, parentMessage) { - const fullPath = isAbsolute23(notebook_path) ? notebook_path : resolve35(getCwd(), notebook_path); + const fullPath = isAbsolute22(notebook_path) ? notebook_path : resolve29(getCwd(), notebook_path); if (fileHistoryEnabled()) { await fileHistoryTrackEdit(updateFileHistoryState, fullPath, parentMessage.uuid); } @@ -492450,14 +416061,14 @@ var init_NotebookEditTool = __esm(() => { return { data }; - } catch (error45) { - if (error45 instanceof Error) { + } catch (error41) { + if (error41 instanceof Error) { const data2 = { new_source, cell_type: cell_type ?? "code", language: "python", edit_mode: "replace", - error: error45.message, + error: error41.message, cell_id, notebook_path: fullPath, original_file: "", @@ -492601,12 +416212,12 @@ var init_preapproved = __esm(() => { hosts.add(entry); } else { const host = entry.slice(0, slash); - const path20 = entry.slice(slash); + const path15 = entry.slice(slash); const prefixes = paths2.get(host); if (prefixes) - prefixes.push(path20); + prefixes.push(path15); else - paths2.set(host, [path20]); + paths2.set(host, [path15]); } } return { HOSTNAME_ONLY: hosts, PATH_PREFIXES: paths2 }; @@ -492641,7 +416252,7 @@ function renderToolResultMessage10({ bytes, code, codeText, - result: result3 + result: result2 }, _progressMessagesForMessage, { verbose }) { @@ -492670,7 +416281,7 @@ function renderToolResultMessage10({ /* @__PURE__ */ jsx_dev_runtime132.jsxDEV(ThemedBox_default, { flexDirection: "column", children: /* @__PURE__ */ jsx_dev_runtime132.jsxDEV(ThemedText, { - children: result3 + children: result2 }, undefined, false, undefined, this) }, undefined, false, undefined, this) ] @@ -492694,11 +416305,11 @@ function renderToolResultMessage10({ }, undefined, true, undefined, this) }, undefined, false, undefined, this); } -function getToolUseSummary6(input11) { - if (!input11?.url) { +function getToolUseSummary6(input) { + if (!input?.url) { return null; } - return truncate(input11.url, TOOL_SUMMARY_MAX_LENGTH); + return truncate(input.url, TOOL_SUMMARY_MAX_LENGTH); } var jsx_dev_runtime132; var init_UI10 = __esm(() => { @@ -492710,8 +416321,8 @@ var init_UI10 = __esm(() => { }); // src/utils/mcpOutputStorage.ts -import { writeFile as writeFile25 } from "fs/promises"; -import { join as join96 } from "path"; +import { writeFile as writeFile23 } from "fs/promises"; +import { join as join86 } from "path"; function getFormatDescription(type, schema) { switch (type) { case "toolResult": @@ -492808,13 +416419,13 @@ function isBinaryContentType(contentType) { async function persistBinaryContent(bytes, mimeType, persistId) { await ensureToolResultsDir(); const ext = extensionForMimeType(mimeType); - const filepath = join96(getToolResultsDir(), `${persistId}.${ext}`); + const filepath = join86(getToolResultsDir(), `${persistId}.${ext}`); try { - await writeFile25(filepath, bytes); - } catch (error45) { - const err3 = toError(error45); - logError2(err3); - return { error: err3.message }; + await writeFile23(filepath, bytes); + } catch (error41) { + const err2 = toError(error41); + logError2(err2); + return { error: err2.message }; } logEvent("tengu_binary_content_persisted", { mimeType: mimeType ?? "unknown", @@ -492823,9 +416434,9 @@ async function persistBinaryContent(bytes, mimeType, persistId) { }); return { filepath, size: bytes.length, ext }; } -function getBinaryBlobSavedMessage(filepath, mimeType, size3, sourceDescription) { +function getBinaryBlobSavedMessage(filepath, mimeType, size2, sourceDescription) { const mt2 = mimeType || "unknown type"; - return `${sourceDescription}Binary content (${mt2}, ${formatFileSize(size3)}) saved to ${filepath}`; + return `${sourceDescription}Binary content (${mt2}, ${formatFileSize(size2)}) saved to ${filepath}`; } var init_mcpOutputStorage = __esm(() => { init_analytics(); @@ -493099,7 +416710,7 @@ var require_config3 = __commonJS((exports) => { }); // node_modules/@mixmark-io/domino/lib/utils.js -var require_utils17 = __commonJS((exports) => { +var require_utils16 = __commonJS((exports) => { var DOMException2 = require_DOMException(); var ERR = DOMException2; var isApiWritable = require_config3().isApiWritable; @@ -493215,7 +416826,7 @@ var require_utils17 = __commonJS((exports) => { var require_EventTarget = __commonJS((exports, module) => { var Event3 = require_Event(); var MouseEvent = require_MouseEvent(); - var utils = require_utils17(); + var utils = require_utils16(); module.exports = EventTarget2; function EventTarget2() {} EventTarget2.prototype = { @@ -493229,8 +416840,8 @@ var require_EventTarget = __commonJS((exports, module) => { if (!this._listeners[type]) this._listeners[type] = []; var list2 = this._listeners[type]; - for (var i4 = 0, n2 = list2.length;i4 < n2; i4++) { - var l = list2[i4]; + for (var i3 = 0, n2 = list2.length;i3 < n2; i3++) { + var l = list2[i3]; if (l.listener === listener2 && l.capture === capture) return; } @@ -493245,13 +416856,13 @@ var require_EventTarget = __commonJS((exports, module) => { if (this._listeners) { var list2 = this._listeners[type]; if (list2) { - for (var i4 = 0, n2 = list2.length;i4 < n2; i4++) { - var l = list2[i4]; + for (var i3 = 0, n2 = list2.length;i3 < n2; i3++) { + var l = list2[i3]; if (l.listener === listener2 && l.capture === capture) { if (list2.length === 1) { this._listeners[type] = undefined; } else { - list2.splice(i4, 1); + list2.splice(i3, 1); } return; } @@ -493265,19 +416876,19 @@ var require_EventTarget = __commonJS((exports, module) => { _dispatchEvent: function _dispatchEvent(event, trusted) { if (typeof trusted !== "boolean") trusted = false; - function invoke3(target, event2) { + function invoke2(target, event2) { var { type, eventPhase: phase } = event2; event2.currentTarget = target; if (phase !== Event3.CAPTURING_PHASE && target._handlers && target._handlers[type]) { - var handler14 = target._handlers[type]; + var handler18 = target._handlers[type]; var rv; - if (typeof handler14 === "function") { - rv = handler14.call(event2.currentTarget, event2); + if (typeof handler18 === "function") { + rv = handler18.call(event2.currentTarget, event2); } else { - var f = handler14.handleEvent; + var f = handler18.handleEvent; if (typeof f !== "function") throw new TypeError("handleEvent property of " + "event handler object is" + "not a function."); - rv = f.call(handler14, event2); + rv = f.call(handler18, event2); } switch (event2.type) { case "mouseover": @@ -493295,10 +416906,10 @@ var require_EventTarget = __commonJS((exports, module) => { if (!list2) return; list2 = list2.slice(); - for (var i5 = 0, n3 = list2.length;i5 < n3; i5++) { + for (var i4 = 0, n3 = list2.length;i4 < n3; i4++) { if (event2._immediatePropagationStopped) return; - var l = list2[i5]; + var l = list2[i4]; if (phase === Event3.CAPTURING_PHASE && !l.capture || phase === Event3.BUBBLING_PHASE && l.capture) continue; if (l.f) { @@ -493320,19 +416931,19 @@ var require_EventTarget = __commonJS((exports, module) => { for (var n2 = this.parentNode;n2; n2 = n2.parentNode) ancestors.push(n2); event.eventPhase = Event3.CAPTURING_PHASE; - for (var i4 = ancestors.length - 1;i4 >= 0; i4--) { - invoke3(ancestors[i4], event); + for (var i3 = ancestors.length - 1;i3 >= 0; i3--) { + invoke2(ancestors[i3], event); if (event._propagationStopped) break; } if (!event._propagationStopped) { event.eventPhase = Event3.AT_TARGET; - invoke3(this, event); + invoke2(this, event); } if (event.bubbles && !event._propagationStopped) { event.eventPhase = Event3.BUBBLING_PHASE; for (var ii = 0, nn = ancestors.length;ii < nn; ii++) { - invoke3(ancestors[ii], event); + invoke2(ancestors[ii], event); if (event._propagationStopped) break; } @@ -493377,9 +416988,9 @@ var require_EventTarget = __commonJS((exports, module) => { } var click = this.ownerDocument.createEvent("MouseEvent"); click.initMouseEvent("click", true, true, this.ownerDocument.defaultView, 1, event.screenX, event.screenY, event.clientX, event.clientY, event.ctrlKey, event.altKey, event.shiftKey, event.metaKey, event.button, null); - var result3 = this._dispatchEvent(click, true); + var result2 = this._dispatchEvent(click, true); if (activated) { - if (result3) { + if (result2) { if (activated._post_click_activation_steps) activated._post_click_activation_steps(click); } else { @@ -493388,10 +416999,10 @@ var require_EventTarget = __commonJS((exports, module) => { } } }, - _setEventHandler: function _setEventHandler(type, handler14) { + _setEventHandler: function _setEventHandler(type, handler18) { if (!this._handlers) this._handlers = Object.create(null); - this._handlers[type] = handler14; + this._handlers[type] = handler18; }, _getEventHandler: function _getEventHandler(type) { return this._handlers && this._handlers[type] || null; @@ -493401,7 +417012,7 @@ var require_EventTarget = __commonJS((exports, module) => { // node_modules/@mixmark-io/domino/lib/LinkedList.js var require_LinkedList = __commonJS((exports, module) => { - var utils = require_utils17(); + var utils = require_utils16(); var LinkedList = module.exports = { valid: function(a2) { utils.assert(a2, "list falsy"); @@ -493450,7 +417061,7 @@ var require_NodeUtils = __commonJS((exports, module) => { ɵescapeClosingCommentTag: escapeClosingCommentTag, ɵescapeProcessingInstructionContent: escapeProcessingInstructionContent }; - var utils = require_utils17(); + var utils = require_utils16(); var NAMESPACE = utils.NAMESPACE; var hasRawContent = { STYLE: true, @@ -493484,7 +417095,7 @@ var require_NodeUtils = __commonJS((exports, module) => { var extraNewLine = {}; var ESCAPE_REGEXP = /[&<>\u00A0]/g; var ESCAPE_ATTR_REGEXP = /[&"<>\u00A0]/g; - function escape5(s) { + function escape4(s) { if (!ESCAPE_REGEXP.test(s)) { return s; } @@ -493541,12 +417152,12 @@ var require_NodeUtils = __commonJS((exports, module) => { if (!rawText.toLowerCase().includes(parentClosingTag)) { return rawText; } - const result3 = [...rawText]; - const matches3 = rawText.matchAll(new RegExp(parentClosingTag, "ig")); - for (const match of matches3) { - result3[match.index] = "<"; + const result2 = [...rawText]; + const matches2 = rawText.matchAll(new RegExp(parentClosingTag, "ig")); + for (const match of matches2) { + result2[match.index] = "<"; } - return result3.join(""); + return result2.join(""); } var CLOSING_COMMENT_REGEXP = /--!?>/; function escapeClosingCommentTag(rawContent) { @@ -493558,7 +417169,7 @@ var require_NodeUtils = __commonJS((exports, module) => { function escapeProcessingInstructionContent(rawContent) { return rawContent.includes(">") ? rawContent.replaceAll(">", ">") : rawContent; } - function serializeOne(kid, parent3) { + function serializeOne(kid, parent2) { var s = ""; switch (kid.nodeType) { case 1: @@ -493589,14 +417200,14 @@ var require_NodeUtils = __commonJS((exports, module) => { case 3: case 4: var parenttag; - if (parent3.nodeType === 1 && parent3.namespaceURI === NAMESPACE.HTML) - parenttag = parent3.tagName; + if (parent2.nodeType === 1 && parent2.namespaceURI === NAMESPACE.HTML) + parenttag = parent2.tagName; else parenttag = ""; - if (hasRawContent[parenttag] || parenttag === "NOSCRIPT" && parent3.ownerDocument._scripting_enabled) { + if (hasRawContent[parenttag] || parenttag === "NOSCRIPT" && parent2.ownerDocument._scripting_enabled) { s += kid.data; } else { - s += escape5(kid.data); + s += escape4(kid.data); } break; case 8: @@ -493624,7 +417235,7 @@ var require_Node2 = __commonJS((exports, module) => { var EventTarget2 = require_EventTarget(); var LinkedList = require_LinkedList(); var NodeUtils = require_NodeUtils(); - var utils = require_utils17(); + var utils = require_utils16(); function Node2() { EventTarget2.call(this); this.parentNode = null; @@ -493673,18 +417284,18 @@ var require_Node2 = __commonJS((exports, module) => { } }, previousSibling: { get: function() { - var parent3 = this.parentNode; - if (!parent3) + var parent2 = this.parentNode; + if (!parent2) return null; - if (this === parent3.firstChild) + if (this === parent2.firstChild) return null; return this._previousSibling; } }, nextSibling: { get: function() { - var parent3 = this.parentNode, next = this._nextSibling; - if (!parent3) + var parent2 = this.parentNode, next = this._nextSibling; + if (!parent2) return null; - if (next === parent3.firstChild) + if (next === parent2.firstChild) return null; return next; } }, @@ -493701,18 +417312,18 @@ var require_Node2 = __commonJS((exports, module) => { set: function(v) {} }, _countChildrenOfType: { value: function(type) { - var sum3 = 0; + var sum2 = 0; for (var kid = this.firstChild;kid !== null; kid = kid.nextSibling) { if (kid.nodeType === type) - sum3++; + sum2++; } - return sum3; + return sum2; } }, _ensureInsertValid: { value: function _ensureInsertValid(node, child, isPreinsert) { - var parent3 = this, i4, kid; + var parent2 = this, i3, kid; if (!node.nodeType) throw new TypeError("not a node"); - switch (parent3.nodeType) { + switch (parent2.nodeType) { case DOCUMENT_NODE: case DOCUMENT_FRAGMENT_NODE: case ELEMENT_NODE: @@ -493720,10 +417331,10 @@ var require_Node2 = __commonJS((exports, module) => { default: utils.HierarchyRequestError(); } - if (node.isAncestor(parent3)) + if (node.isAncestor(parent2)) utils.HierarchyRequestError(); if (child !== null || !isPreinsert) { - if (child.parentNode !== parent3) + if (child.parentNode !== parent2) utils.NotFoundError(); } switch (node.nodeType) { @@ -493737,7 +417348,7 @@ var require_Node2 = __commonJS((exports, module) => { default: utils.HierarchyRequestError(); } - if (parent3.nodeType === DOCUMENT_NODE) { + if (parent2.nodeType === DOCUMENT_NODE) { switch (node.nodeType) { case TEXT_NODE: utils.HierarchyRequestError(); @@ -493757,12 +417368,12 @@ var require_Node2 = __commonJS((exports, module) => { utils.HierarchyRequestError(); } } - i4 = parent3._countChildrenOfType(ELEMENT_NODE); + i3 = parent2._countChildrenOfType(ELEMENT_NODE); if (isPreinsert) { - if (i4 > 0) + if (i3 > 0) utils.HierarchyRequestError(); } else { - if (i4 > 1 || i4 === 1 && child.nodeType !== ELEMENT_NODE) + if (i3 > 1 || i3 === 1 && child.nodeType !== ELEMENT_NODE) utils.HierarchyRequestError(); } break; @@ -493779,33 +417390,33 @@ var require_Node2 = __commonJS((exports, module) => { utils.HierarchyRequestError(); } } - i4 = parent3._countChildrenOfType(ELEMENT_NODE); + i3 = parent2._countChildrenOfType(ELEMENT_NODE); if (isPreinsert) { - if (i4 > 0) + if (i3 > 0) utils.HierarchyRequestError(); } else { - if (i4 > 1 || i4 === 1 && child.nodeType !== ELEMENT_NODE) + if (i3 > 1 || i3 === 1 && child.nodeType !== ELEMENT_NODE) utils.HierarchyRequestError(); } break; case DOCUMENT_TYPE_NODE: if (child === null) { - if (parent3._countChildrenOfType(ELEMENT_NODE)) + if (parent2._countChildrenOfType(ELEMENT_NODE)) utils.HierarchyRequestError(); } else { - for (kid = parent3.firstChild;kid !== null; kid = kid.nextSibling) { + for (kid = parent2.firstChild;kid !== null; kid = kid.nextSibling) { if (kid === child) break; if (kid.nodeType === ELEMENT_NODE) utils.HierarchyRequestError(); } } - i4 = parent3._countChildrenOfType(DOCUMENT_TYPE_NODE); + i3 = parent2._countChildrenOfType(DOCUMENT_TYPE_NODE); if (isPreinsert) { - if (i4 > 0) + if (i3 > 0) utils.HierarchyRequestError(); } else { - if (i4 > 1 || i4 === 1 && child.nodeType !== DOCUMENT_TYPE_NODE) + if (i3 > 1 || i3 === 1 && child.nodeType !== DOCUMENT_TYPE_NODE) utils.HierarchyRequestError(); } break; @@ -493816,14 +417427,14 @@ var require_Node2 = __commonJS((exports, module) => { } } }, insertBefore: { value: function insertBefore(node, child) { - var parent3 = this; - parent3._ensureInsertValid(node, child, true); + var parent2 = this; + parent2._ensureInsertValid(node, child, true); var refChild = child; if (refChild === node) { refChild = node.nextSibling; } - parent3.doc.adoptNode(node); - node._insertOrReplace(parent3, refChild, false); + parent2.doc.adoptNode(node); + node._insertOrReplace(parent2, refChild, false); return node; } }, appendChild: { value: function(child) { @@ -493833,21 +417444,21 @@ var require_Node2 = __commonJS((exports, module) => { child._insertOrReplace(this, null, false); } }, removeChild: { value: function removeChild(child) { - var parent3 = this; + var parent2 = this; if (!child.nodeType) throw new TypeError("not a node"); - if (child.parentNode !== parent3) + if (child.parentNode !== parent2) utils.NotFoundError(); child.remove(); return child; } }, replaceChild: { value: function replaceChild(node, child) { - var parent3 = this; - parent3._ensureInsertValid(node, child, false); - if (node.doc !== parent3.doc) { - parent3.doc.adoptNode(node); + var parent2 = this; + parent2._ensureInsertValid(node, child, false); + if (node.doc !== parent2.doc) { + parent2.doc.adoptNode(node); } - node._insertOrReplace(parent3, child, true); + node._insertOrReplace(parent2, child, true); return child; } }, contains: { value: function contains(node) { @@ -493874,9 +417485,9 @@ var require_Node2 = __commonJS((exports, module) => { if (these[0] !== those[0]) return DOCUMENT_POSITION_DISCONNECTED + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC; n2 = Math.min(these.length, those.length); - for (var i4 = 1;i4 < n2; i4++) { - if (these[i4] !== those[i4]) { - if (these[i4].index < those[i4].index) + for (var i3 = 1;i3 < n2; i3++) { + if (these[i3] !== those[i3]) { + if (these[i3].index < those[i3].index) return DOCUMENT_POSITION_FOLLOWING; else return DOCUMENT_POSITION_PRECEDING; @@ -493904,13 +417515,13 @@ var require_Node2 = __commonJS((exports, module) => { return c1 === null && c22 === null; } }, cloneNode: { value: function(deep) { - var clone5 = this.clone(); + var clone4 = this.clone(); if (deep) { for (var kid = this.firstChild;kid !== null; kid = kid.nextSibling) { - clone5._appendChild(kid.cloneNode(true)); + clone4._appendChild(kid.cloneNode(true)); } } - return clone5; + return clone4; } }, lookupPrefix: { value: function lookupPrefix(ns) { var e; @@ -493967,13 +417578,13 @@ var require_Node2 = __commonJS((exports, module) => { return defaultNamespace === ns; } }, index: { get: function() { - var parent3 = this.parentNode; - if (this === parent3.firstChild) + var parent2 = this.parentNode; + if (this === parent2.firstChild) return 0; - var kids = parent3.childNodes; + var kids = parent2.childNodes; if (this._index === undefined || kids[this._index] !== this) { - for (var i4 = 0;i4 < kids.length; i4++) { - kids[i4]._index = i4; + for (var i3 = 0;i3 < kids.length; i3++) { + kids[i3]._index = i3; } utils.assert(kids[this._index] === this); } @@ -493998,14 +417609,14 @@ var require_Node2 = __commonJS((exports, module) => { } } }, removeChildren: { value: utils.shouldOverride }, - _insertOrReplace: { value: function _insertOrReplace(parent3, before3, isReplace) { - var child = this, before_index, i4; + _insertOrReplace: { value: function _insertOrReplace(parent2, before2, isReplace) { + var child = this, before_index, i3; if (child.nodeType === DOCUMENT_FRAGMENT_NODE && child.rooted) { utils.HierarchyRequestError(); } - if (parent3._childNodes) { - before_index = before3 === null ? parent3._childNodes.length : before3.index; - if (child.parentNode === parent3) { + if (parent2._childNodes) { + before_index = before2 === null ? parent2._childNodes.length : before2.index; + if (child.parentNode === parent2) { var child_index = child.index; if (child_index < before_index) { before_index--; @@ -494013,21 +417624,21 @@ var require_Node2 = __commonJS((exports, module) => { } } if (isReplace) { - if (before3.rooted) - before3.doc.mutateRemove(before3); - before3.parentNode = null; + if (before2.rooted) + before2.doc.mutateRemove(before2); + before2.parentNode = null; } - var n2 = before3; + var n2 = before2; if (n2 === null) { - n2 = parent3.firstChild; + n2 = parent2.firstChild; } - var bothRooted = child.rooted && parent3.rooted; + var bothRooted = child.rooted && parent2.rooted; if (child.nodeType === DOCUMENT_FRAGMENT_NODE) { var spliceArgs = [0, isReplace ? 1 : 0], next; for (var kid = child.firstChild;kid !== null; kid = next) { next = kid.nextSibling; spliceArgs.push(kid); - kid.parentNode = parent3; + kid.parentNode = parent2; } var len = spliceArgs.length; if (isReplace) { @@ -494035,17 +417646,17 @@ var require_Node2 = __commonJS((exports, module) => { } else if (len > 2 && n2 !== null) { LinkedList.insertBefore(spliceArgs[2], n2); } - if (parent3._childNodes) { - spliceArgs[0] = before3 === null ? parent3._childNodes.length : before3._index; - parent3._childNodes.splice.apply(parent3._childNodes, spliceArgs); - for (i4 = 2;i4 < len; i4++) { - spliceArgs[i4]._index = spliceArgs[0] + (i4 - 2); + if (parent2._childNodes) { + spliceArgs[0] = before2 === null ? parent2._childNodes.length : before2._index; + parent2._childNodes.splice.apply(parent2._childNodes, spliceArgs); + for (i3 = 2;i3 < len; i3++) { + spliceArgs[i3]._index = spliceArgs[0] + (i3 - 2); } - } else if (parent3._firstChild === before3) { + } else if (parent2._firstChild === before2) { if (len > 2) { - parent3._firstChild = spliceArgs[2]; + parent2._firstChild = spliceArgs[2]; } else if (isReplace) { - parent3._firstChild = null; + parent2._firstChild = null; } } if (child._childNodes) { @@ -494053,14 +417664,14 @@ var require_Node2 = __commonJS((exports, module) => { } else { child._firstChild = null; } - if (parent3.rooted) { - parent3.modify(); - for (i4 = 2;i4 < len; i4++) { - parent3.doc.mutateInsert(spliceArgs[i4]); + if (parent2.rooted) { + parent2.modify(); + for (i3 = 2;i3 < len; i3++) { + parent2.doc.mutateInsert(spliceArgs[i3]); } } } else { - if (before3 === child) { + if (before2 === child) { return; } if (bothRooted) { @@ -494068,32 +417679,32 @@ var require_Node2 = __commonJS((exports, module) => { } else if (child.parentNode) { child.remove(); } - child.parentNode = parent3; + child.parentNode = parent2; if (isReplace) { LinkedList.replace(n2, child); - if (parent3._childNodes) { + if (parent2._childNodes) { child._index = before_index; - parent3._childNodes[before_index] = child; - } else if (parent3._firstChild === before3) { - parent3._firstChild = child; + parent2._childNodes[before_index] = child; + } else if (parent2._firstChild === before2) { + parent2._firstChild = child; } } else { if (n2 !== null) { LinkedList.insertBefore(child, n2); } - if (parent3._childNodes) { + if (parent2._childNodes) { child._index = before_index; - parent3._childNodes.splice(before_index, 0, child); - } else if (parent3._firstChild === before3) { - parent3._firstChild = child; + parent2._childNodes.splice(before_index, 0, child); + } else if (parent2._firstChild === before2) { + parent2._firstChild = child; } } if (bothRooted) { - parent3.modify(); - parent3.doc.mutateMove(child); - } else if (parent3.rooted) { - parent3.modify(); - parent3.doc.mutateInsert(child); + parent2.modify(); + parent2.doc.mutateMove(child); + } else if (parent2.rooted) { + parent2.modify(); + parent2.doc.mutateInsert(child); } } } }, @@ -494190,16 +417801,16 @@ var require_NodeList_es6 = __commonJS((exports, module) => { } } } - item(i4) { - return this[i4] || null; + item(i3) { + return this[i3] || null; } }; }); // node_modules/@mixmark-io/domino/lib/NodeList.es5.js var require_NodeList_es5 = __commonJS((exports, module) => { - function item(i4) { - return this[i4] || null; + function item(i3) { + return this[i3] || null; } function NodeList(a2) { if (!a2) @@ -494271,12 +417882,12 @@ var require_ContainerNode = __commonJS((exports, module) => { this._firstChild = null; } }, removeChildren: { value: function removeChildren() { - var root3 = this.rooted ? this.ownerDocument : null, next = this.firstChild, kid; + var root2 = this.rooted ? this.ownerDocument : null, next = this.firstChild, kid; while (next !== null) { kid = next; next = kid.nextSibling; - if (root3) - root3.mutateRemove(kid); + if (root2) + root2.mutateRemove(kid); kid.parentNode = null; } if (this._childNodes) { @@ -494340,7 +417951,7 @@ var require_xmlnames = __commonJS((exports) => { // node_modules/@mixmark-io/domino/lib/attributes.js var require_attributes2 = __commonJS((exports) => { - var utils = require_utils17(); + var utils = require_utils16(); exports.property = function(attr) { if (Array.isArray(attr.type)) { var valid = Object.create(null); @@ -494419,24 +418030,24 @@ var require_attributes2 = __commonJS((exports) => { var unsigned_long = a2.type === "unsigned long"; var signed_long = a2.type === "long"; var unsigned_fallback = a2.type === "limited unsigned long with fallback"; - var { min: min3, max: max5, setmin } = a2; - if (min3 === undefined) { + var { min: min2, max: max3, setmin } = a2; + if (min2 === undefined) { if (unsigned_long) - min3 = 0; + min2 = 0; if (signed_long) - min3 = -2147483648; + min2 = -2147483648; if (unsigned_fallback) - min3 = 1; + min2 = 1; } - if (max5 === undefined) { + if (max3 === undefined) { if (unsigned_long || signed_long || unsigned_fallback) - max5 = 2147483647; + max3 = 2147483647; } return { get: function() { var v = this._getattr(a2.name); var n2 = a2.float ? parseFloat(v) : parseInt(v, 10); - if (v === null || !isFinite(n2) || min3 !== undefined && n2 < min3 || max5 !== undefined && n2 > max5) { + if (v === null || !isFinite(n2) || min2 !== undefined && n2 < min2 || max3 !== undefined && n2 > max3) { return def2.call(this); } if (unsigned_long || signed_long || unsigned_fallback) { @@ -494465,12 +418076,12 @@ var require_attributes2 = __commonJS((exports) => { } }; } - exports.registerChangeHandler = function(c6, name, handler14) { + exports.registerChangeHandler = function(c6, name, handler18) { var p = c6.prototype; if (!Object.prototype.hasOwnProperty.call(p, "_attributeChangeHandlers")) { p._attributeChangeHandlers = Object.create(p._attributeChangeHandlers || null); } - p._attributeChangeHandlers[name] = handler14; + p._attributeChangeHandlers[name] = handler18; }; }); @@ -494478,10 +418089,10 @@ var require_attributes2 = __commonJS((exports) => { var require_FilteredElementList = __commonJS((exports, module) => { module.exports = FilteredElementList; var Node2 = require_Node2(); - function FilteredElementList(root3, filter4) { - this.root = root3; - this.filter = filter4; - this.lastModTime = root3.lastModTime; + function FilteredElementList(root2, filter3) { + this.root = root2; + this.filter = filter3; + this.lastModTime = root2.lastModTime; this.done = false; this.cache = []; this.traverse(); @@ -494502,8 +418113,8 @@ var require_FilteredElementList = __commonJS((exports, module) => { } }, checkcache: { value: function() { if (this.lastModTime !== this.root.lastModTime) { - for (var i4 = this.cache.length - 1;i4 >= 0; i4--) { - this[i4] = undefined; + for (var i3 = this.cache.length - 1;i3 >= 0; i3--) { + this[i3] = undefined; } this.cache.length = 0; this.done = false; @@ -494542,7 +418153,7 @@ var require_FilteredElementList = __commonJS((exports, module) => { // node_modules/@mixmark-io/domino/lib/DOMTokenList.js var require_DOMTokenList = __commonJS((exports, module) => { - var utils = require_utils17(); + var utils = require_utils16(); module.exports = DOMTokenList; function DOMTokenList(getter, setter) { this._getString = getter; @@ -494569,8 +418180,8 @@ var require_DOMTokenList = __commonJS((exports, module) => { } }, add: { value: function() { var list2 = getList(this); - for (var i4 = 0, len = arguments.length;i4 < len; i4++) { - var token = handleErrors(arguments[i4]); + for (var i3 = 0, len = arguments.length;i3 < len; i3++) { + var token = handleErrors(arguments[i3]); if (list2.indexOf(token) < 0) { list2.push(token); } @@ -494579,8 +418190,8 @@ var require_DOMTokenList = __commonJS((exports, module) => { } }, remove: { value: function() { var list2 = getList(this); - for (var i4 = 0, len = arguments.length;i4 < len; i4++) { - var token = handleErrors(arguments[i4]); + for (var i3 = 0, len = arguments.length;i3 < len; i3++) { + var token = handleErrors(arguments[i3]); var index = list2.indexOf(token); if (index > -1) { list2.splice(index, 1); @@ -494653,13 +418264,13 @@ var require_DOMTokenList = __commonJS((exports, module) => { }); function fixIndex(clist, list2) { var oldLength = clist._length; - var i4; + var i3; clist._length = list2.length; - for (i4 = 0;i4 < list2.length; i4++) { - clist[i4] = list2[i4]; + for (i3 = 0;i3 < list2.length; i3++) { + clist[i3] = list2[i3]; } - for (;i4 < oldLength; i4++) { - clist[i4] = undefined; + for (;i3 < oldLength; i3++) { + clist[i3] = undefined; } } function handleErrors(token) { @@ -494672,18 +418283,18 @@ var require_DOMTokenList = __commonJS((exports, module) => { } return token; } - function toArray5(clist) { + function toArray4(clist) { var length = clist._length; var arr = Array(length); - for (var i4 = 0;i4 < length; i4++) { - arr[i4] = clist[i4]; + for (var i3 = 0;i3 < length; i3++) { + arr[i3] = clist[i3]; } return arr; } function getList(clist) { var strProp = clist._getString(); if (strProp === clist._lastStringValue) { - return toArray5(clist); + return toArray4(clist); } var str = strProp.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g, ""); if (str === "") { @@ -494783,15 +418394,15 @@ var require_select = __commonJS((exports, module) => { return String.fromCodePoint ? String.fromCodePoint(cp) : String.fromCharCode(cp); }); }; - var indexOf3 = function() { + var indexOf2 = function() { if (Array.prototype.indexOf) { return Array.prototype.indexOf; } return function(obj, item) { - var i4 = this.length; - while (i4--) { - if (this[i4] === item) - return i4; + var i3 = this.length; + while (i3--) { + if (this[i3] === item) + return i3; } return -1; }; @@ -494800,7 +418411,7 @@ var require_select = __commonJS((exports, module) => { var regex2 = rules.inside.source.replace(//g, end); return new RegExp(regex2); }; - var replace3 = function(regex2, name, val) { + var replace2 = function(regex2, name, val) { regex2 = regex2.source; regex2 = regex2.replace(name, val.source || val); return new RegExp(regex2); @@ -494823,12 +418434,12 @@ var require_select = __commonJS((exports, module) => { offset: cap[4] ? cap[3] === "-" ? -cap[4] : +cap[4] : 0 }; }; - var nth3 = function(param_, test2, last3) { - var param = parseNth(param_), group = param.group, offset = param.offset, find4 = !last3 ? child : lastChild, advance2 = !last3 ? next : prev; + var nth2 = function(param_, test2, last2) { + var param = parseNth(param_), group = param.group, offset = param.offset, find3 = !last2 ? child : lastChild, advance2 = !last2 ? next : prev; return function(el) { if (!parentIsElement(el)) return; - var rel = find4(el.parentNode), pos = 0; + var rel = find3(el.parentNode), pos = 0; while (rel) { if (test2(rel, el)) pos++; @@ -494853,7 +418464,7 @@ var require_select = __commonJS((exports, module) => { return el.nodeName.toLowerCase() === type; }; }, - attr: function(key, op, val, i4) { + attr: function(key, op, val, i3) { op = operators[op]; return function(el) { var attr; @@ -494895,7 +418506,7 @@ var require_select = __commonJS((exports, module) => { if (attr == null) return; attr = attr + ""; - if (i4) { + if (i3) { attr = attr.toLowerCase(); val = val.toLowerCase(); } @@ -494911,10 +418522,10 @@ var require_select = __commonJS((exports, module) => { ":only-child": function(el) { return !prev(el) && !next(el) && parentIsElement(el); }, - ":nth-child": function(param, last3) { - return nth3(param, function() { + ":nth-child": function(param, last2) { + return nth2(param, function() { return true; - }, last3); + }, last2); }, ":nth-last-child": function(param) { return selectors[":nth-child"](param, true); @@ -494954,10 +418565,10 @@ var require_select = __commonJS((exports, module) => { ":only-of-type": function(el) { return selectors[":first-of-type"](el) && selectors[":last-of-type"](el); }, - ":nth-of-type": function(param, last3) { - return nth3(param, function(rel, el) { + ":nth-of-type": function(param, last2) { + return nth2(param, function(rel, el) { return rel.nodeName === el.nodeName; - }, last3); + }, last2); }, ":nth-last-of-type": function(param) { return selectors[":nth-of-type"](param, true); @@ -494986,9 +418597,9 @@ var require_select = __commonJS((exports, module) => { ":matches": function(sel) { return selectors[":is"](sel); }, - ":nth-match": function(param, last3) { + ":nth-match": function(param, last2) { var args = param.split(/\s*,\s*/), arg = args.shift(), test2 = compileGroup(args.join(",")); - return nth3(arg, test2, last3); + return nth2(arg, test2, last2); }, ":nth-last-match": function(param) { return selectors[":nth-match"](param, true); @@ -495099,13 +418710,13 @@ var require_select = __commonJS((exports, module) => { }, ":contains": function(param) { return function(el) { - var text2 = el.innerText || el.textContent || el.value || ""; - return text2.indexOf(param) !== -1; + var text = el.innerText || el.textContent || el.value || ""; + return text.indexOf(param) !== -1; }; }, ":has": function(param) { return function(el) { - return find3(param, el).length > 0; + return find2(param, el).length > 0; }; } }; @@ -495120,30 +418731,30 @@ var require_select = __commonJS((exports, module) => { return attr.indexOf(val) !== -1; }, "~=": function(attr, val) { - var i4, s, f, l; - for (s = 0;; s = i4 + 1) { - i4 = attr.indexOf(val, s); - if (i4 === -1) + var i3, s, f, l; + for (s = 0;; s = i3 + 1) { + i3 = attr.indexOf(val, s); + if (i3 === -1) return false; - f = attr[i4 - 1]; - l = attr[i4 + val.length]; + f = attr[i3 - 1]; + l = attr[i3 + val.length]; if ((!f || f === " ") && (!l || l === " ")) return true; } }, "|=": function(attr, val) { - var i4 = attr.indexOf(val), l; - if (i4 !== 0) + var i3 = attr.indexOf(val), l; + if (i3 !== 0) return; - l = attr[i4 + val.length]; + l = attr[i3 + val.length]; return l === "-" || !l; }, "^=": function(attr, val) { return attr.indexOf(val) === 0; }, "$=": function(attr, val) { - var i4 = attr.lastIndexOf(val); - return i4 !== -1 && i4 + val.length === attr.length; + var i3 = attr.lastIndexOf(val); + return i3 !== -1 && i3 + val.length === attr.length; }, "!=": function(attr, val) { return attr !== val; @@ -495188,9 +418799,9 @@ var require_select = __commonJS((exports, module) => { ref: function(test2, name) { var node; function ref(el) { - var doc2 = el.ownerDocument, nodes = doc2.getElementsByTagName("*"), i4 = nodes.length; - while (i4--) { - node = nodes[i4]; + var doc2 = el.ownerDocument, nodes = doc2.getElementsByTagName("*"), i3 = nodes.length; + while (i3--) { + node = nodes[i3]; if (ref.test(el)) { node = null; return true; @@ -495225,22 +418836,22 @@ var require_select = __commonJS((exports, module) => { inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/, ident: /^(cssid)$/ }; - rules.cssid = replace3(rules.cssid, "nonascii", rules.nonascii); - rules.cssid = replace3(rules.cssid, "escape", rules.escape); - rules.qname = replace3(rules.qname, "cssid", rules.cssid); - rules.simple = replace3(rules.simple, "cssid", rules.cssid); - rules.ref = replace3(rules.ref, "cssid", rules.cssid); - rules.attr = replace3(rules.attr, "cssid", rules.cssid); - rules.pseudo = replace3(rules.pseudo, "cssid", rules.cssid); - rules.inside = replace3(rules.inside, `[^"'>]*`, rules.inside); - rules.attr = replace3(rules.attr, "inside", makeInside("\\[", "\\]")); - rules.pseudo = replace3(rules.pseudo, "inside", makeInside("\\(", "\\)")); - rules.simple = replace3(rules.simple, "pseudo", rules.pseudo); - rules.simple = replace3(rules.simple, "attr", rules.attr); - rules.ident = replace3(rules.ident, "cssid", rules.cssid); - rules.str_escape = replace3(rules.str_escape, "escape", rules.escape); + rules.cssid = replace2(rules.cssid, "nonascii", rules.nonascii); + rules.cssid = replace2(rules.cssid, "escape", rules.escape); + rules.qname = replace2(rules.qname, "cssid", rules.cssid); + rules.simple = replace2(rules.simple, "cssid", rules.cssid); + rules.ref = replace2(rules.ref, "cssid", rules.cssid); + rules.attr = replace2(rules.attr, "cssid", rules.cssid); + rules.pseudo = replace2(rules.pseudo, "cssid", rules.cssid); + rules.inside = replace2(rules.inside, `[^"'>]*`, rules.inside); + rules.attr = replace2(rules.attr, "inside", makeInside("\\[", "\\]")); + rules.pseudo = replace2(rules.pseudo, "inside", makeInside("\\(", "\\)")); + rules.simple = replace2(rules.simple, "pseudo", rules.pseudo); + rules.simple = replace2(rules.simple, "attr", rules.attr); + rules.ident = replace2(rules.ident, "cssid", rules.cssid); + rules.str_escape = replace2(rules.str_escape, "escape", rules.escape); var compile = function(sel_) { - var sel = sel_.replace(/^\s+|\s+$/g, ""), test2, filter4 = [], buff = [], subject, qname, cap, op, ref; + var sel = sel_.replace(/^\s+|\s+$/g, ""), test2, filter3 = [], buff = [], subject, qname, cap, op, ref; while (sel) { if (cap = rules.qname.exec(sel)) { sel = sel.substring(cap[0].length); @@ -495267,7 +418878,7 @@ var require_select = __commonJS((exports, module) => { if (cap = rules.ref.exec(sel)) { sel = sel.substring(cap[0].length); ref = combinators.ref(makeSimple(buff), decodeid(cap[1])); - filter4.push(ref.combinator); + filter3.push(ref.combinator); buff = []; continue; } @@ -495275,7 +418886,7 @@ var require_select = __commonJS((exports, module) => { sel = sel.substring(cap[0].length); op = cap[1] || cap[2] || cap[3]; if (op === ",") { - filter4.push(combinators.noop(makeSimple(buff))); + filter3.push(combinators.noop(makeSimple(buff))); break; } } else { @@ -495284,10 +418895,10 @@ var require_select = __commonJS((exports, module) => { if (!combinators[op]) { throw new SyntaxError("Bad combinator."); } - filter4.push(combinators[op](makeSimple(buff))); + filter3.push(combinators[op](makeSimple(buff))); buff = []; } - test2 = makeTest(filter4); + test2 = makeTest(filter3); test2.qname = qname; test2.sel = sel; if (subject) { @@ -495317,23 +418928,23 @@ var require_select = __commonJS((exports, module) => { } if (cap[4]) { var value = cap[6]; - var i4 = /["'\s]\s*I$/i.test(value); - if (i4) { + var i3 = /["'\s]\s*I$/i.test(value); + if (i3) { value = value.replace(/\s*I$/i, ""); } - return selectors.attr(decodeid(cap[4]), cap[5] || "-", unquote(value), i4); + return selectors.attr(decodeid(cap[4]), cap[5] || "-", unquote(value), i3); } throw new SyntaxError("Unknown Selector."); }; var makeSimple = function(func) { - var l = func.length, i4; + var l = func.length, i3; if (l < 2) return func[0]; return function(el) { if (!el) return; - for (i4 = 0;i4 < l; i4++) { - if (!func[i4](el)) + for (i3 = 0;i3 < l; i3++) { + if (!func[i3](el)) return; } return true; @@ -495346,9 +418957,9 @@ var require_select = __commonJS((exports, module) => { }; } return function(el) { - var i4 = func.length; - while (i4--) { - if (!(el = func[i4](el))) + var i3 = func.length; + while (i3--) { + if (!(el = func[i3](el))) return; } return true; @@ -495357,9 +418968,9 @@ var require_select = __commonJS((exports, module) => { var makeSubject = function() { var target; function subject(el) { - var node = el.ownerDocument, scope = node.getElementsByTagName(subject.lname), i4 = scope.length; - while (i4--) { - if (subject.test(scope[i4]) && target === el) { + var node = el.ownerDocument, scope = node.getElementsByTagName(subject.lname), i3 = scope.length; + while (i3--) { + if (subject.test(scope[i3]) && target === el) { target = null; return true; } @@ -495381,16 +418992,16 @@ var require_select = __commonJS((exports, module) => { if (tests.length < 2) return test2; return function(el) { - var l = tests.length, i4 = 0; - for (;i4 < l; i4++) { - if (tests[i4](el)) + var l = tests.length, i3 = 0; + for (;i3 < l; i3++) { + if (tests[i3](el)) return true; } }; }; - var find3 = function(sel, node) { - var results = [], test2 = compile(sel), scope = node.getElementsByTagName(test2.qname), i4 = 0, el; - while (el = scope[i4++]) { + var find2 = function(sel, node) { + var results = [], test2 = compile(sel), scope = node.getElementsByTagName(test2.qname), i3 = 0, el; + while (el = scope[i3++]) { if (test2(el)) results.push(el); } @@ -495398,9 +419009,9 @@ var require_select = __commonJS((exports, module) => { while (test2.sel) { test2 = compile(test2.sel); scope = node.getElementsByTagName(test2.qname); - i4 = 0; - while (el = scope[i4++]) { - if (test2(el) && indexOf3.call(results, el) === -1) { + i3 = 0; + while (el = scope[i3++]) { + if (test2(el) && indexOf2.call(results, el) === -1) { results.push(el); } } @@ -495428,7 +419039,7 @@ var require_select = __commonJS((exports, module) => { return context.getElementsByTagName(sel); } } - return find3(sel, context); + return find2(sel, context); }; exports.selectors = selectors; exports.operators = operators; @@ -495451,8 +419062,8 @@ var require_ChildNode = __commonJS((exports, module) => { var LinkedList = require_LinkedList(); var createDocumentFragmentFromArguments = function(document2, args) { var docFrag = document2.createDocumentFragment(); - for (var i4 = 0;i4 < args.length; i4++) { - var argItem = args[i4]; + for (var i3 = 0;i3 < args.length; i3++) { + var argItem = args[i3]; var isNode = argItem instanceof Node2; docFrag.appendChild(isNode ? argItem : document2.createTextNode(String(argItem))); } @@ -495499,20 +419110,20 @@ var require_ChildNode = __commonJS((exports, module) => { this.parentNode = null; } }, _remove: { value: function _remove() { - var parent3 = this.parentNode; - if (parent3 === null) + var parent2 = this.parentNode; + if (parent2 === null) return; - if (parent3._childNodes) { - parent3._childNodes.splice(this.index, 1); - } else if (parent3._firstChild === this) { + if (parent2._childNodes) { + parent2._childNodes.splice(this.index, 1); + } else if (parent2._firstChild === this) { if (this._nextSibling === this) { - parent3._firstChild = null; + parent2._firstChild = null; } else { - parent3._firstChild = this._nextSibling; + parent2._firstChild = this._nextSibling; } } LinkedList.remove(this); - parent3.modify(); + parent2.modify(); } }, replaceWith: { value: function replaceWith() { var argArr = Array.prototype.slice.call(arguments); @@ -495564,7 +419175,7 @@ var require_NonDocumentTypeChildNode = __commonJS((exports, module) => { // node_modules/@mixmark-io/domino/lib/NamedNodeMap.js var require_NamedNodeMap = __commonJS((exports, module) => { module.exports = NamedNodeMap; - var utils = require_utils17(); + var utils = require_utils16(); function NamedNodeMap(element) { this.element = element; } @@ -495602,7 +419213,7 @@ var require_NamedNodeMap = __commonJS((exports, module) => { var require_Element = __commonJS((exports, module) => { module.exports = Element; var xml = require_xmlnames(); - var utils = require_utils17(); + var utils = require_utils16(); var NAMESPACE = utils.NAMESPACE; var attributes = require_attributes2(); var Node2 = require_Node2(); @@ -495611,7 +419222,7 @@ var require_Element = __commonJS((exports, module) => { var FilteredElementList = require_FilteredElementList(); var DOMException2 = require_DOMException(); var DOMTokenList = require_DOMTokenList(); - var select12 = require_select(); + var select2 = require_select(); var ContainerNode = require_ContainerNode(); var ChildNode = require_ChildNode(); var NonDocumentTypeChildNode = require_NonDocumentTypeChildNode(); @@ -495633,8 +419244,8 @@ var require_Element = __commonJS((exports, module) => { if (node.nodeType === Node2.TEXT_NODE) { a2.push(node._data); } else { - for (var i4 = 0, n2 = node.childNodes.length;i4 < n2; i4++) - recursiveGetText(node.childNodes[i4], a2); + for (var i3 = 0, n2 = node.childNodes.length;i3 < n2; i3++) + recursiveGetText(node.childNodes[i3], a2); } } Element.prototype = Object.create(ContainerNode.prototype, { @@ -495707,17 +419318,17 @@ var require_Element = __commonJS((exports, module) => { }, set: function(v) { var document2 = this.ownerDocument; - var parent3 = this.parentNode; - if (parent3 === null) { + var parent2 = this.parentNode; + if (parent2 === null) { return; } - if (parent3.nodeType === Node2.DOCUMENT_NODE) { + if (parent2.nodeType === Node2.DOCUMENT_NODE) { utils.NoModificationAllowedError(); } - if (parent3.nodeType === Node2.DOCUMENT_FRAGMENT_NODE) { - parent3 = parent3.ownerDocument.createElement("body"); + if (parent2.nodeType === Node2.DOCUMENT_FRAGMENT_NODE) { + parent2 = parent2.ownerDocument.createElement("body"); } - var parser2 = document2.implementation.mozHTMLParser(document2._address, parent3); + var parser2 = document2.implementation.mozHTMLParser(document2._address, parent2); parser2.parse(v === null ? "" : String(v), true); this.replaceWith(parser2._asDocumentFragment()); } @@ -495728,11 +419339,11 @@ var require_Element = __commonJS((exports, module) => { case "beforebegin": first = true; case "afterend": - var parent3 = this.parentNode; - if (parent3 === null) { + var parent2 = this.parentNode; + if (parent2 === null) { return null; } - return parent3.insertBefore(node, first ? this : this.nextSibling); + return parent2.insertBefore(node, first ? this : this.nextSibling); case "afterbegin": first = true; case "beforeend": @@ -495753,9 +419364,9 @@ var require_Element = __commonJS((exports, module) => { position = utils.toASCIILowerCase(String(position)); this._insertAdjacent(position, textNode); } }, - insertAdjacentHTML: { value: function insertAdjacentHTML(position, text2) { + insertAdjacentHTML: { value: function insertAdjacentHTML(position, text) { position = utils.toASCIILowerCase(String(position)); - text2 = String(text2); + text = String(text); var context; switch (position) { case "beforebegin": @@ -495776,7 +419387,7 @@ var require_Element = __commonJS((exports, module) => { context = context.ownerDocument.createElementNS(NAMESPACE.HTML, "body"); } var parser2 = this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address, context); - parser2.parse(text2, true); + parser2.parse(text, true); this._insertAdjacent(position, parser2._asDocumentFragment()); } }, children: { get: function() { @@ -495808,57 +419419,57 @@ var require_Element = __commonJS((exports, module) => { childElementCount: { get: function() { return this.children.length; } }, - nextElement: { value: function(root3) { - if (!root3) - root3 = this.ownerDocument.documentElement; + nextElement: { value: function(root2) { + if (!root2) + root2 = this.ownerDocument.documentElement; var next = this.firstElementChild; if (!next) { - if (this === root3) + if (this === root2) return null; next = this.nextElementSibling; } if (next) return next; - for (var parent3 = this.parentElement;parent3 && parent3 !== root3; parent3 = parent3.parentElement) { - next = parent3.nextElementSibling; + for (var parent2 = this.parentElement;parent2 && parent2 !== root2; parent2 = parent2.parentElement) { + next = parent2.nextElementSibling; if (next) return next; } return null; } }, getElementsByTagName: { value: function getElementsByTagName(lname) { - var filter4; + var filter3; if (!lname) return new NodeList; if (lname === "*") - filter4 = function() { + filter3 = function() { return true; }; else if (this.isHTML) - filter4 = htmlLocalNameElementFilter(lname); + filter3 = htmlLocalNameElementFilter(lname); else - filter4 = localNameElementFilter(lname); - return new FilteredElementList(this, filter4); + filter3 = localNameElementFilter(lname); + return new FilteredElementList(this, filter3); } }, getElementsByTagNameNS: { value: function getElementsByTagNameNS(ns, lname) { - var filter4; + var filter3; if (ns === "*" && lname === "*") - filter4 = function() { + filter3 = function() { return true; }; else if (ns === "*") - filter4 = localNameElementFilter(lname); + filter3 = localNameElementFilter(lname); else if (lname === "*") - filter4 = namespaceElementFilter(ns); + filter3 = namespaceElementFilter(ns); else - filter4 = namespaceLocalNameElementFilter(ns, lname); - return new FilteredElementList(this, filter4); + filter3 = namespaceLocalNameElementFilter(ns, lname); + return new FilteredElementList(this, filter3); } }, getElementsByClassName: { value: function getElementsByClassName(names) { names = String(names).trim(); if (names === "") { - var result3 = new NodeList; - return result3; + var result2 = new NodeList; + return result2; } names = names.split(/[ \t\r\n\f]+/); return new FilteredElementList(this, classNamesElementFilter(names)); @@ -495873,8 +419484,8 @@ var require_Element = __commonJS((exports, module) => { } else { e = this.ownerDocument.createElement(this.localName); } - for (var i4 = 0, n2 = this._attrKeys.length;i4 < n2; i4++) { - var lname = this._attrKeys[i4]; + for (var i3 = 0, n2 = this._attrKeys.length;i3 < n2; i3++) { + var lname = this._attrKeys[i3]; var a2 = this._attrsByLName[lname]; var b = a2.cloneNode(); b._setOwnerElement(e); @@ -495887,8 +419498,8 @@ var require_Element = __commonJS((exports, module) => { isEqual: { value: function isEqual(that) { if (this.localName !== that.localName || this.namespaceURI !== that.namespaceURI || this.prefix !== that.prefix || this._numattrs !== that._numattrs) return false; - for (var i4 = 0, n2 = this._numattrs;i4 < n2; i4++) { - var a2 = this._attr(i4); + for (var i3 = 0, n2 = this._numattrs;i3 < n2; i3++) { + var a2 = this._attr(i3); if (!that.hasAttributeNS(a2.namespaceURI, a2.localName)) return false; if (that.getAttributeNS(a2.namespaceURI, a2.localName) !== a2.value) @@ -495900,14 +419511,14 @@ var require_Element = __commonJS((exports, module) => { if (this.namespaceURI && this.namespaceURI === ns && this.prefix !== null && originalElement.lookupNamespaceURI(this.prefix) === ns) { return this.prefix; } - for (var i4 = 0, n2 = this._numattrs;i4 < n2; i4++) { - var a2 = this._attr(i4); + for (var i3 = 0, n2 = this._numattrs;i3 < n2; i3++) { + var a2 = this._attr(i3); if (a2.prefix === "xmlns" && a2.value === ns && originalElement.lookupNamespaceURI(a2.localName) === ns) { return a2.localName; } } - var parent3 = this.parentElement; - return parent3 ? parent3._lookupNamespacePrefix(ns, originalElement) : null; + var parent2 = this.parentElement; + return parent2 ? parent2._lookupNamespacePrefix(ns, originalElement) : null; } }, lookupNamespaceURI: { value: function lookupNamespaceURI(prefix) { if (prefix === "" || prefix === undefined) { @@ -495915,16 +419526,16 @@ var require_Element = __commonJS((exports, module) => { } if (this.namespaceURI !== null && this.prefix === prefix) return this.namespaceURI; - for (var i4 = 0, n2 = this._numattrs;i4 < n2; i4++) { - var a2 = this._attr(i4); + for (var i3 = 0, n2 = this._numattrs;i3 < n2; i3++) { + var a2 = this._attr(i3); if (a2.namespaceURI === NAMESPACE.XMLNS) { if (a2.prefix === "xmlns" && a2.localName === prefix || prefix === null && a2.prefix === null && a2.localName === "xmlns") { return a2.value || null; } } } - var parent3 = this.parentElement; - return parent3 ? parent3.lookupNamespaceURI(prefix) : null; + var parent2 = this.parentElement; + return parent2 ? parent2.lookupNamespaceURI(prefix) : null; } }, getAttribute: { value: function getAttribute(qname) { var attr = this.getAttributeNode(qname); @@ -496054,7 +419665,7 @@ var require_Element = __commonJS((exports, module) => { if (attr.ownerElement !== null && attr.ownerElement !== this) { throw new DOMException2(DOMException2.INUSE_ATTRIBUTE_ERR); } - var result3 = null; + var result2 = null; var oldAttrs = this._attrsByQName[attr.name]; if (oldAttrs) { if (!Array.isArray(oldAttrs)) { @@ -496070,10 +419681,10 @@ var require_Element = __commonJS((exports, module) => { oldAttrs.forEach(function(a2) { this.removeAttributeNode(a2); }, this); - result3 = oldAttrs[0]; + result2 = oldAttrs[0]; } this.setAttributeNodeNS(attr); - return result3; + return result2; } }, setAttributeNodeNS: { value: function setAttributeNodeNS(attr) { if (attr.ownerElement !== null) { @@ -496116,12 +419727,12 @@ var require_Element = __commonJS((exports, module) => { var ns = attr.namespaceURI; var key = (ns === null ? "" : ns) + "|" + attr.localName; this._attrsByLName[key] = undefined; - var i4 = this._attrKeys.indexOf(key); + var i3 = this._attrKeys.indexOf(key); if (this._attributes) { - Array.prototype.splice.call(this._attributes, i4, 1); + Array.prototype.splice.call(this._attributes, i3, 1); this._attributes[qname] = undefined; } - this._attrKeys.splice(i4, 1); + this._attrKeys.splice(i3, 1); var onchange = attr.onchange; attr._setOwnerElement(null); if (onchange) { @@ -496138,11 +419749,11 @@ var require_Element = __commonJS((exports, module) => { if (!attr) return; this._attrsByLName[key] = undefined; - var i4 = this._attrKeys.indexOf(key); + var i3 = this._attrKeys.indexOf(key); if (this._attributes) { - Array.prototype.splice.call(this._attributes, i4, 1); + Array.prototype.splice.call(this._attributes, i3, 1); } - this._attrKeys.splice(i4, 1); + this._attrKeys.splice(i3, 1); this._removeQName(attr); var onchange = attr.onchange; attr._setOwnerElement(null); @@ -496257,7 +419868,7 @@ var require_Element = __commonJS((exports, module) => { this.className = v; } }, matches: { value: function(selector) { - return select12.matches(this, selector); + return select2.matches(this, selector); } }, closest: { value: function(selector) { var el = this; @@ -496270,10 +419881,10 @@ var require_Element = __commonJS((exports, module) => { return null; } }, querySelector: { value: function(selector) { - return select12(selector, this)[0]; + return select2(selector, this)[0]; } }, querySelectorAll: { value: function(selector) { - var nodes = select12(selector, this); + var nodes = select2(selector, this); return nodes.item ? nodes : new NodeList(nodes); } } }); @@ -496385,8 +419996,8 @@ var require_Element = __commonJS((exports, module) => { for (var name in elt._attrsByQName) { this[name] = elt._attrsByQName[name]; } - for (var i4 = 0;i4 < elt._attrKeys.length; i4++) { - this[i4] = elt._attrsByLName[elt._attrKeys[i4]]; + for (var i3 = 0;i3 < elt._attrKeys.length; i3++) { + this[i3] = elt._attrsByLName[elt._attrKeys[i3]]; } } AttributesArray.prototype = Object.create(NamedNodeMap.prototype, { @@ -496403,11 +420014,11 @@ var require_Element = __commonJS((exports, module) => { }); if (globalThis.Symbol?.iterator) { AttributesArray.prototype[globalThis.Symbol.iterator] = function() { - var i4 = 0, n2 = this.length, self2 = this; + var i3 = 0, n2 = this.length, self2 = this; return { next: function() { - if (i4 < n2) - return { value: self2.item(i4++) }; + if (i3 < n2) + return { value: self2.item(i3++) }; return { done: true }; } }; @@ -496439,8 +420050,8 @@ var require_Element = __commonJS((exports, module) => { if (this.lastModTime !== this.element.lastModTime) { this.lastModTime = this.element.lastModTime; var n2 = this.childrenByNumber && this.childrenByNumber.length || 0; - for (var i4 = 0;i4 < n2; i4++) { - this[i4] = undefined; + for (var i3 = 0;i3 < n2; i3++) { + this[i3] = undefined; } this.childrenByNumber = []; this.childrenByName = Object.create(null); @@ -496504,9 +420115,9 @@ var require_Leaf = __commonJS((exports, module) => { module.exports = Leaf; var Node2 = require_Node2(); var NodeList = require_NodeList(); - var utils = require_utils17(); + var utils = require_utils16(); var HierarchyRequestError = utils.HierarchyRequestError; - var NotFoundError3 = utils.NotFoundError; + var NotFoundError2 = utils.NotFoundError; function Leaf() { Node2.call(this); } @@ -496529,7 +420140,7 @@ var require_Leaf = __commonJS((exports, module) => { removeChild: { value: function(node) { if (!node.nodeType) throw new TypeError("not a node"); - NotFoundError3(); + NotFoundError2(); } }, removeChildren: { value: function() {} }, childNodes: { get: function() { @@ -496544,7 +420155,7 @@ var require_Leaf = __commonJS((exports, module) => { var require_CharacterData = __commonJS((exports, module) => { module.exports = CharacterData; var Leaf = require_Leaf(); - var utils = require_utils17(); + var utils = require_utils16(); var ChildNode = require_ChildNode(); var NonDocumentTypeChildNode = require_NonDocumentTypeChildNode(); function CharacterData() { @@ -496600,7 +420211,7 @@ var require_CharacterData = __commonJS((exports, module) => { // node_modules/@mixmark-io/domino/lib/Text.js var require_Text = __commonJS((exports, module) => { module.exports = Text2; - var utils = require_utils17(); + var utils = require_utils16(); var Node2 = require_Node2(); var CharacterData = require_CharacterData(); function Text2(doc2, data) { @@ -496645,20 +420256,20 @@ var require_Text = __commonJS((exports, module) => { utils.IndexSizeError(); var newdata = this._data.substring(offset), newnode = this.ownerDocument.createTextNode(newdata); this.data = this.data.substring(0, offset); - var parent3 = this.parentNode; - if (parent3 !== null) - parent3.insertBefore(newnode, this.nextSibling); + var parent2 = this.parentNode; + if (parent2 !== null) + parent2.insertBefore(newnode, this.nextSibling); return newnode; } }, wholeText: { get: function wholeText() { - var result3 = this.textContent; + var result2 = this.textContent; for (var next = this.nextSibling;next; next = next.nextSibling) { if (next.nodeType !== Node2.TEXT_NODE) { break; } - result3 += next.textContent; + result2 += next.textContent; } - return result3; + return result2; } }, replaceWholeText: { value: utils.nyi }, clone: { value: function clone() { @@ -496717,8 +420328,8 @@ var require_DocumentFragment = __commonJS((exports, module) => { var NodeList = require_NodeList(); var ContainerNode = require_ContainerNode(); var Element = require_Element(); - var select12 = require_select(); - var utils = require_utils17(); + var select2 = require_select(); + var utils = require_utils16(); function DocumentFragment(doc2) { ContainerNode.call(this); this.nodeType = Node2.DOCUMENT_FRAGMENT_NODE; @@ -496743,7 +420354,7 @@ var require_DocumentFragment = __commonJS((exports, module) => { context.isHTML = true; context.getElementsByTagName = Element.prototype.getElementsByTagName; context.nextElement = Object.getOwnPropertyDescriptor(Element.prototype, "firstElementChild").get; - var nodes = select12(selector, context); + var nodes = select2(selector, context); return nodes.item ? nodes : new NodeList(nodes); } }, clone: { value: function clone() { @@ -496909,7 +420520,7 @@ var require_TreeWalker = __commonJS((exports, module) => { var Node2 = require_Node2(); var NodeFilter = require_NodeFilter(); var NodeTraversal = require_NodeTraversal(); - var utils = require_utils17(); + var utils = require_utils16(); var mapChild = { first: "firstChild", last: "lastChild", @@ -496923,15 +420534,15 @@ var require_TreeWalker = __commonJS((exports, module) => { previous: "previousSibling" }; function traverseChildren(tw, type) { - var child, node, parent3, result3, sibling; + var child, node, parent2, result2, sibling; node = tw._currentNode[mapChild[type]]; while (node !== null) { - result3 = tw._internalFilter(node); - if (result3 === NodeFilter.FILTER_ACCEPT) { + result2 = tw._internalFilter(node); + if (result2 === NodeFilter.FILTER_ACCEPT) { tw._currentNode = node; return node; } - if (result3 === NodeFilter.FILTER_SKIP) { + if (result2 === NodeFilter.FILTER_SKIP) { child = node[mapChild[type]]; if (child !== null) { node = child; @@ -496944,18 +420555,18 @@ var require_TreeWalker = __commonJS((exports, module) => { node = sibling; break; } - parent3 = node.parentNode; - if (parent3 === null || parent3 === tw.root || parent3 === tw._currentNode) { + parent2 = node.parentNode; + if (parent2 === null || parent2 === tw.root || parent2 === tw._currentNode) { return null; } else { - node = parent3; + node = parent2; } } } return null; } function traverseSiblings(tw, type) { - var node, result3, sibling; + var node, result2, sibling; node = tw._currentNode; if (node === tw.root) { return null; @@ -496964,13 +420575,13 @@ var require_TreeWalker = __commonJS((exports, module) => { sibling = node[mapSibling[type]]; while (sibling !== null) { node = sibling; - result3 = tw._internalFilter(node); - if (result3 === NodeFilter.FILTER_ACCEPT) { + result2 = tw._internalFilter(node); + if (result2 === NodeFilter.FILTER_ACCEPT) { tw._currentNode = node; return node; } sibling = node[mapChild[type]]; - if (result3 === NodeFilter.FILTER_REJECT || sibling === null) { + if (result2 === NodeFilter.FILTER_REJECT || sibling === null) { sibling = node[mapSibling[type]]; } } @@ -496983,15 +420594,15 @@ var require_TreeWalker = __commonJS((exports, module) => { } } } - function TreeWalker(root3, whatToShow, filter4) { - if (!root3 || !root3.nodeType) { + function TreeWalker(root2, whatToShow, filter3) { + if (!root2 || !root2.nodeType) { utils.NotSupportedError(); } - this._root = root3; + this._root = root2; this._whatToShow = Number(whatToShow) || 0; - this._filter = filter4 || null; + this._filter = filter3 || null; this._active = false; - this._currentNode = root3; + this._currentNode = root2; } Object.defineProperties(TreeWalker.prototype, { root: { get: function() { @@ -497015,29 +420626,29 @@ var require_TreeWalker = __commonJS((exports, module) => { } }, _internalFilter: { value: function _internalFilter(node) { - var result3, filter4; + var result2, filter3; if (this._active) { utils.InvalidStateError(); } if (!(1 << node.nodeType - 1 & this._whatToShow)) { return NodeFilter.FILTER_SKIP; } - filter4 = this._filter; - if (filter4 === null) { - result3 = NodeFilter.FILTER_ACCEPT; + filter3 = this._filter; + if (filter3 === null) { + result2 = NodeFilter.FILTER_ACCEPT; } else { this._active = true; try { - if (typeof filter4 === "function") { - result3 = filter4(node); + if (typeof filter3 === "function") { + result2 = filter3(node); } else { - result3 = filter4.acceptNode(node); + result2 = filter3.acceptNode(node); } } finally { this._active = false; } } - return +result3; + return +result2; } }, parentNode: { value: function parentNode() { var node = this._currentNode; @@ -497066,23 +420677,23 @@ var require_TreeWalker = __commonJS((exports, module) => { return traverseSiblings(this, "next"); } }, previousNode: { value: function previousNode() { - var node, result3, previousSibling, lastChild; + var node, result2, previousSibling, lastChild; node = this._currentNode; while (node !== this._root) { for (previousSibling = node.previousSibling;previousSibling; previousSibling = node.previousSibling) { node = previousSibling; - result3 = this._internalFilter(node); - if (result3 === NodeFilter.FILTER_REJECT) { + result2 = this._internalFilter(node); + if (result2 === NodeFilter.FILTER_REJECT) { continue; } for (lastChild = node.lastChild;lastChild; lastChild = node.lastChild) { node = lastChild; - result3 = this._internalFilter(node); - if (result3 === NodeFilter.FILTER_REJECT) { + result2 = this._internalFilter(node); + if (result2 === NodeFilter.FILTER_REJECT) { break; } } - if (result3 === NodeFilter.FILTER_ACCEPT) { + if (result2 === NodeFilter.FILTER_ACCEPT) { this._currentNode = node; return node; } @@ -497099,28 +420710,28 @@ var require_TreeWalker = __commonJS((exports, module) => { return null; } }, nextNode: { value: function nextNode() { - var node, result3, firstChild, nextSibling; + var node, result2, firstChild, nextSibling; node = this._currentNode; - result3 = NodeFilter.FILTER_ACCEPT; + result2 = NodeFilter.FILTER_ACCEPT; CHILDREN: while (true) { for (firstChild = node.firstChild;firstChild; firstChild = node.firstChild) { node = firstChild; - result3 = this._internalFilter(node); - if (result3 === NodeFilter.FILTER_ACCEPT) { + result2 = this._internalFilter(node); + if (result2 === NodeFilter.FILTER_ACCEPT) { this._currentNode = node; return node; - } else if (result3 === NodeFilter.FILTER_REJECT) { + } else if (result2 === NodeFilter.FILTER_REJECT) { break; } } for (nextSibling = NodeTraversal.nextSkippingChildren(node, this.root);nextSibling; nextSibling = NodeTraversal.nextSkippingChildren(node, this.root)) { node = nextSibling; - result3 = this._internalFilter(node); - if (result3 === NodeFilter.FILTER_ACCEPT) { + result2 = this._internalFilter(node); + if (result2 === NodeFilter.FILTER_ACCEPT) { this._currentNode = node; return node; - } else if (result3 === NodeFilter.FILTER_SKIP) { + } else if (result2 === NodeFilter.FILTER_SKIP) { continue CHILDREN; } } @@ -497138,7 +420749,7 @@ var require_NodeIterator = __commonJS((exports, module) => { module.exports = NodeIterator; var NodeFilter = require_NodeFilter(); var NodeTraversal = require_NodeTraversal(); - var utils = require_utils17(); + var utils = require_utils16(); function move(node, stayWithin, directionIsNext) { if (directionIsNext) { return NodeTraversal.next(node, stayWithin); @@ -497170,8 +420781,8 @@ var require_NodeIterator = __commonJS((exports, module) => { return null; } } - var result3 = ni._internalFilter(node); - if (result3 === NodeFilter.FILTER_ACCEPT) { + var result2 = ni._internalFilter(node); + if (result2 === NodeFilter.FILTER_ACCEPT) { break; } } @@ -497179,17 +420790,17 @@ var require_NodeIterator = __commonJS((exports, module) => { ni._pointerBeforeReferenceNode = beforeNode; return node; } - function NodeIterator(root3, whatToShow, filter4) { - if (!root3 || !root3.nodeType) { + function NodeIterator(root2, whatToShow, filter3) { + if (!root2 || !root2.nodeType) { utils.NotSupportedError(); } - this._root = root3; - this._referenceNode = root3; + this._root = root2; + this._referenceNode = root2; this._pointerBeforeReferenceNode = true; this._whatToShow = Number(whatToShow) || 0; - this._filter = filter4 || null; + this._filter = filter3 || null; this._active = false; - root3.doc._attachNodeIterator(this); + root2.doc._attachNodeIterator(this); } Object.defineProperties(NodeIterator.prototype, { root: { get: function root() { @@ -497208,29 +420819,29 @@ var require_NodeIterator = __commonJS((exports, module) => { return this._filter; } }, _internalFilter: { value: function _internalFilter(node) { - var result3, filter4; + var result2, filter3; if (this._active) { utils.InvalidStateError(); } if (!(1 << node.nodeType - 1 & this._whatToShow)) { return NodeFilter.FILTER_SKIP; } - filter4 = this._filter; - if (filter4 === null) { - result3 = NodeFilter.FILTER_ACCEPT; + filter3 = this._filter; + if (filter3 === null) { + result2 = NodeFilter.FILTER_ACCEPT; } else { this._active = true; try { - if (typeof filter4 === "function") { - result3 = filter4(node); + if (typeof filter3 === "function") { + result2 = filter3(node); } else { - result3 = filter4.acceptNode(node); + result2 = filter3.acceptNode(node); } } finally { this._active = false; } } - return +result3; + return +result2; } }, _preremove: { value: function _preremove(toBeRemovedNode) { if (isInclusiveAncestor(toBeRemovedNode, this._root)) { @@ -497275,24 +420886,24 @@ var require_NodeIterator = __commonJS((exports, module) => { }); // node_modules/@mixmark-io/domino/lib/URL.js -var require_URL3 = __commonJS((exports, module) => { - module.exports = URL3; - function URL3(url3) { +var require_URL2 = __commonJS((exports, module) => { + module.exports = URL2; + function URL2(url3) { if (!url3) - return Object.create(URL3.prototype); + return Object.create(URL2.prototype); this.url = url3.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g, ""); - var match = URL3.pattern.exec(this.url); + var match = URL2.pattern.exec(this.url); if (match) { if (match[2]) this.scheme = match[2]; if (match[4]) { - var userinfo = match[4].match(URL3.userinfoPattern); + var userinfo = match[4].match(URL2.userinfoPattern); if (userinfo) { this.username = userinfo[1]; this.password = userinfo[3]; match[4] = match[4].substring(userinfo[0].length); } - if (match[4].match(URL3.portPattern)) { + if (match[4].match(URL2.portPattern)) { var pos = match[4].lastIndexOf(":"); this.host = match[4].substring(0, pos); this.port = match[4].substring(pos + 1); @@ -497308,28 +420919,28 @@ var require_URL3 = __commonJS((exports, module) => { this.fragment = match[9]; } } - URL3.pattern = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/; - URL3.userinfoPattern = /^([^@:]*)(:([^@]*))?@/; - URL3.portPattern = /:\d+$/; - URL3.authorityPattern = /^[^:\/?#]+:\/\//; - URL3.hierarchyPattern = /^[^:\/?#]+:\//; - URL3.percentEncode = function percentEncode(s) { + URL2.pattern = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/; + URL2.userinfoPattern = /^([^@:]*)(:([^@]*))?@/; + URL2.portPattern = /:\d+$/; + URL2.authorityPattern = /^[^:\/?#]+:\/\//; + URL2.hierarchyPattern = /^[^:\/?#]+:\//; + URL2.percentEncode = function percentEncode(s) { var c6 = s.charCodeAt(0); if (c6 < 256) return "%" + c6.toString(16); else throw Error("can't percent-encode codepoints > 255 yet"); }; - URL3.prototype = { - constructor: URL3, + URL2.prototype = { + constructor: URL2, isAbsolute: function() { return !!this.scheme; }, isAuthorityBased: function() { - return URL3.authorityPattern.test(this.url); + return URL2.authorityPattern.test(this.url); }, isHierarchical: function() { - return URL3.hierarchyPattern.test(this.url); + return URL2.hierarchyPattern.test(this.url); }, toString: function() { var s = ""; @@ -497358,10 +420969,10 @@ var require_URL3 = __commonJS((exports, module) => { s += "#" + this.fragment; return s; }, - resolve: function(relative20) { + resolve: function(relative18) { var base2 = this; - var r = new URL3(relative20); - var t = new URL3; + var r = new URL2(relative18); + var t = new URL2; if (r.scheme !== undefined) { t.scheme = r.scheme; t.username = r.username; @@ -497394,7 +421005,7 @@ var require_URL3 = __commonJS((exports, module) => { if (r.path.charAt(0) === "/") { t.path = remove_dot_segments(r.path); } else { - t.path = merge5(base2.path, r.path); + t.path = merge4(base2.path, r.path); t.path = remove_dot_segments(t.path); } t.query = r.query; @@ -497403,7 +421014,7 @@ var require_URL3 = __commonJS((exports, module) => { } t.fragment = r.fragment; return t.toString(); - function merge5(basepath, refpath) { + function merge4(basepath, refpath) { if (base2.host !== undefined && !base2.path) return "/" + refpath; var lastslash = basepath.lastIndexOf("/"); @@ -497412,33 +421023,33 @@ var require_URL3 = __commonJS((exports, module) => { else return basepath.substring(0, lastslash + 1) + refpath; } - function remove_dot_segments(path20) { - if (!path20) - return path20; + function remove_dot_segments(path15) { + if (!path15) + return path15; var output = ""; - while (path20.length > 0) { - if (path20 === "." || path20 === "..") { - path20 = ""; + while (path15.length > 0) { + if (path15 === "." || path15 === "..") { + path15 = ""; break; } - var twochars = path20.substring(0, 2); - var threechars = path20.substring(0, 3); - var fourchars = path20.substring(0, 4); + var twochars = path15.substring(0, 2); + var threechars = path15.substring(0, 3); + var fourchars = path15.substring(0, 4); if (threechars === "../") { - path20 = path20.substring(3); + path15 = path15.substring(3); } else if (twochars === "./") { - path20 = path20.substring(2); + path15 = path15.substring(2); } else if (threechars === "/./") { - path20 = "/" + path20.substring(3); - } else if (twochars === "/." && path20.length === 2) { - path20 = "/"; - } else if (fourchars === "/../" || threechars === "/.." && path20.length === 3) { - path20 = "/" + path20.substring(4); + path15 = "/" + path15.substring(3); + } else if (twochars === "/." && path15.length === 2) { + path15 = "/"; + } else if (fourchars === "/../" || threechars === "/.." && path15.length === 3) { + path15 = "/" + path15.substring(4); output = output.replace(/\/?[^\/]*$/, ""); } else { - var segment = path20.match(/(\/?([^\/]*))/)[0]; + var segment = path15.match(/(\/?([^\/]*))/)[0]; output += segment; - path20 = path20.substring(segment.length); + path15 = path15.substring(segment.length); } } return output; @@ -497475,14 +421086,14 @@ var require_style_parser = __commonJS((exports) => { exports.hyphenate = exports.parse = undefined; function parse10(value) { const styles5 = []; - let i4 = 0; + let i3 = 0; let parenDepth = 0; let quote2 = 0; let valueStart = 0; let propStart = 0; let currentProp = null; - while (i4 < value.length) { - const token = value.charCodeAt(i4++); + while (i3 < value.length) { + const token = value.charCodeAt(i3++); switch (token) { case 40: parenDepth++; @@ -497493,28 +421104,28 @@ var require_style_parser = __commonJS((exports) => { case 39: if (quote2 === 0) { quote2 = 39; - } else if (quote2 === 39 && value.charCodeAt(i4 - 1) !== 92) { + } else if (quote2 === 39 && value.charCodeAt(i3 - 1) !== 92) { quote2 = 0; } break; case 34: if (quote2 === 0) { quote2 = 34; - } else if (quote2 === 34 && value.charCodeAt(i4 - 1) !== 92) { + } else if (quote2 === 34 && value.charCodeAt(i3 - 1) !== 92) { quote2 = 0; } break; case 58: if (!currentProp && parenDepth === 0 && quote2 === 0) { - currentProp = hyphenate(value.substring(propStart, i4 - 1).trim()); - valueStart = i4; + currentProp = hyphenate(value.substring(propStart, i3 - 1).trim()); + valueStart = i3; } break; case 59: if (currentProp && valueStart > 0 && parenDepth === 0 && quote2 === 0) { - const styleVal = value.substring(valueStart, i4 - 1).trim(); + const styleVal = value.substring(valueStart, i3 - 1).trim(); styles5.push(currentProp, styleVal); - propStart = i4; + propStart = i3; valueStart = 0; currentProp = null; } @@ -497541,61 +421152,61 @@ var require_CSSStyleDeclaration = __commonJS((exports, module) => { var { parse: parse10 } = require_style_parser(); module.exports = function(elt) { const style = new CSSStyleDeclaration(elt); - const handler14 = { - get: function(target, property3) { - return property3 in target ? target[property3] : target.getPropertyValue(dasherizeProperty(property3)); + const handler18 = { + get: function(target, property2) { + return property2 in target ? target[property2] : target.getPropertyValue(dasherizeProperty(property2)); }, has: function(target, key) { return true; }, - set: function(target, property3, value) { - if (property3 in target) { - target[property3] = value; + set: function(target, property2, value) { + if (property2 in target) { + target[property2] = value; } else { - target.setProperty(dasherizeProperty(property3), value ?? undefined); + target.setProperty(dasherizeProperty(property2), value ?? undefined); } return true; } }; - return new Proxy(style, handler14); + return new Proxy(style, handler18); }; - function dasherizeProperty(property3) { - return property3.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); + function dasherizeProperty(property2) { + return property2.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); } function CSSStyleDeclaration(elt) { this._element = elt; } var IMPORTANT_BANG = "!important"; function parseStyles(value) { - const result3 = { + const result2 = { property: {}, priority: {} }; if (!value) { - return result3; + return result2; } const styleValues = parse10(value); if (styleValues.length < 2) { - return result3; + return result2; } - for (let i4 = 0;i4 < styleValues.length; i4 += 2) { - const name = styleValues[i4]; - let value2 = styleValues[i4 + 1]; + for (let i3 = 0;i3 < styleValues.length; i3 += 2) { + const name = styleValues[i3]; + let value2 = styleValues[i3 + 1]; if (value2.endsWith(IMPORTANT_BANG)) { - result3.priority[name] = "important"; + result2.priority[name] = "important"; value2 = value2.slice(0, -IMPORTANT_BANG.length).trim(); } - result3.property[name] = value2; + result2.property[name] = value2; } - return result3; + return result2; } var NO_CHANGE = {}; CSSStyleDeclaration.prototype = Object.create(Object.prototype, { _parsed: { get: function() { if (!this._parsedStyles || this.cssText !== this._lastParsedText) { - var text2 = this.cssText; - this._parsedStyles = parseStyles(text2); - this._lastParsedText = text2; + var text = this.cssText; + this._parsedStyles = parseStyles(text); + this._lastParsedText = text; delete this._names; } return this._parsedStyles; @@ -497634,16 +421245,16 @@ var require_CSSStyleDeclaration = __commonJS((exports, module) => { this._names = Object.getOwnPropertyNames(this._parsed.property); return this._names[n2]; } }, - getPropertyValue: { value: function(property3) { - property3 = property3.toLowerCase(); - return this._parsed.property[property3] || ""; + getPropertyValue: { value: function(property2) { + property2 = property2.toLowerCase(); + return this._parsed.property[property2] || ""; } }, - getPropertyPriority: { value: function(property3) { - property3 = property3.toLowerCase(); - return this._parsed.priority[property3] || ""; + getPropertyPriority: { value: function(property2) { + property2 = property2.toLowerCase(); + return this._parsed.priority[property2] || ""; } }, - setProperty: { value: function(property3, value, priority) { - property3 = property3.toLowerCase(); + setProperty: { value: function(property2, value, priority) { + property2 = property2.toLowerCase(); if (value === null || value === undefined) { value = ""; } @@ -497655,7 +421266,7 @@ var require_CSSStyleDeclaration = __commonJS((exports, module) => { } value = value.trim(); if (value === "") { - this.removeProperty(property3); + this.removeProperty(property2); return; } if (priority !== "" && priority !== NO_CHANGE && !/^important$/i.test(priority)) { @@ -497663,18 +421274,18 @@ var require_CSSStyleDeclaration = __commonJS((exports, module) => { } var styles5 = this._parsed; if (value === NO_CHANGE) { - if (!styles5.property[property3]) { + if (!styles5.property[property2]) { return; } if (priority !== "") { - styles5.priority[property3] = "important"; + styles5.priority[property2] = "important"; } else { - delete styles5.priority[property3]; + delete styles5.priority[property2]; } } else { if (value.indexOf(";") !== -1) return; - var newprops = parseStyles(property3 + ":" + value); + var newprops = parseStyles(property2 + ":" + value); if (Object.getOwnPropertyNames(newprops.property).length === 0) { return; } @@ -497694,18 +421305,18 @@ var require_CSSStyleDeclaration = __commonJS((exports, module) => { } this._serialize(); } }, - setPropertyValue: { value: function(property3, value) { - return this.setProperty(property3, value, NO_CHANGE); + setPropertyValue: { value: function(property2, value) { + return this.setProperty(property2, value, NO_CHANGE); } }, - setPropertyPriority: { value: function(property3, priority) { - return this.setProperty(property3, NO_CHANGE, priority); + setPropertyPriority: { value: function(property2, priority) { + return this.setProperty(property2, NO_CHANGE, priority); } }, - removeProperty: { value: function(property3) { - property3 = property3.toLowerCase(); + removeProperty: { value: function(property2) { + property2 = property2.toLowerCase(); var styles5 = this._parsed; - if (property3 in styles5.property) { - delete styles5.property[property3]; - delete styles5.priority[property3]; + if (property2 in styles5.property) { + delete styles5.property[property2]; + delete styles5.priority[property2]; this._serialize(); } } } @@ -497714,12 +421325,12 @@ var require_CSSStyleDeclaration = __commonJS((exports, module) => { // node_modules/@mixmark-io/domino/lib/URLUtils.js var require_URLUtils = __commonJS((exports, module) => { - var URL3 = require_URL3(); + var URL2 = require_URL2(); module.exports = URLUtils; function URLUtils() {} URLUtils.prototype = Object.create(Object.prototype, { _url: { get: function() { - return new URL3(this.href); + return new URL2(this.href); } }, protocol: { get: function() { @@ -497731,10 +421342,10 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (url3.isAbsolute()) { v = v.replace(/:+$/, ""); - v = v.replace(/[^-+\.a-zA-Z0-9]/g, URL3.percentEncode); + v = v.replace(/[^-+\.a-zA-Z0-9]/g, URL2.percentEncode); if (v.length > 0) { url3.scheme = v; output = url3.toString(); @@ -497753,9 +421364,9 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (url3.isAbsolute() && url3.isAuthorityBased()) { - v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL3.percentEncode); + v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode); if (v.length > 0) { url3.host = v; delete url3.port; @@ -497775,10 +421386,10 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (url3.isAbsolute() && url3.isAuthorityBased()) { v = v.replace(/^\/+/, ""); - v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL3.percentEncode); + v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode); if (v.length > 0) { url3.host = v; output = url3.toString(); @@ -497797,7 +421408,7 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (url3.isAbsolute() && url3.isAuthorityBased()) { v = "" + v; v = v.replace(/[^0-9].*$/, ""); @@ -497822,11 +421433,11 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (url3.isAbsolute() && url3.isHierarchical()) { if (v.charAt(0) !== "/") v = "/" + v; - v = v.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL3.percentEncode); + v = v.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL2.percentEncode); url3.path = v; output = url3.toString(); } @@ -497843,11 +421454,11 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (url3.isAbsolute() && url3.isHierarchical()) { if (v.charAt(0) === "?") v = v.substring(1); - v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL3.percentEncode); + v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode); url3.query = v; output = url3.toString(); } @@ -497865,10 +421476,10 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (v.charAt(0) === "#") v = v.substring(1); - v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL3.percentEncode); + v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode); url3.fragment = v; output = url3.toString(); this.href = output; @@ -497881,9 +421492,9 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (url3.isAbsolute()) { - v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL3.percentEncode); + v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL2.percentEncode); url3.username = v; output = url3.toString(); } @@ -497897,12 +421508,12 @@ var require_URLUtils = __commonJS((exports, module) => { }, set: function(v) { var output = this.href; - var url3 = new URL3(output); + var url3 = new URL2(output); if (url3.isAbsolute()) { if (v === "") { url3.password = null; } else { - v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL3.percentEncode); + v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL2.percentEncode); url3.password = v; } output = url3.toString(); @@ -498013,7 +421624,7 @@ var require_htmlelts = __commonJS((exports) => { var Node2 = require_Node2(); var Element = require_Element(); var CSSStyleDeclaration = require_CSSStyleDeclaration(); - var utils = require_utils17(); + var utils = require_utils16(); var URLUtils = require_URLUtils(); var defineElement = require_defineElement(); var htmlElements = exports.elements = {}; @@ -498025,7 +421636,7 @@ var require_htmlelts = __commonJS((exports) => { function define2(spec) { return defineElement(spec, HTMLElement, htmlElements, htmlNameToImpl); } - function URL3(attr) { + function URL2(attr) { return { get: function() { var v = this._getattr(attr); @@ -498241,7 +421852,7 @@ var require_htmlelts = __commonJS((exports) => { } } }, attributes: { - href: URL3, + href: URL2, ping: String, download: String, target: String, @@ -498270,7 +421881,7 @@ var require_htmlelts = __commonJS((exports) => { download: String, rel: String, media: String, - href: URL3, + href: URL2, hreflang: String, type: String, shape: String, @@ -498350,7 +421961,7 @@ var require_htmlelts = __commonJS((exports) => { autofocus: Boolean, type: { type: ["submit", "reset", "button", "menu"], missing: "submit" }, formTarget: String, - formAction: URL3, + formAction: URL2, formNoValidate: Boolean, formMethod: { type: ["get", "post", "dialog"], invalid: "get", missing: "" }, formEnctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: "" } @@ -498410,7 +422021,7 @@ var require_htmlelts = __commonJS((exports) => { HTMLElement.call(this, doc2, localName, prefix); }, attributes: { - src: URL3, + src: URL2, type: String, width: String, height: String, @@ -498486,7 +422097,7 @@ var require_htmlelts = __commonJS((exports) => { HTMLElement.call(this, doc2, localName, prefix); }, attributes: { - xmlns: URL3, + xmlns: URL2, version: String } }); @@ -498497,7 +422108,7 @@ var require_htmlelts = __commonJS((exports) => { HTMLElement.call(this, doc2, localName, prefix); }, attributes: { - src: URL3, + src: URL2, srcdoc: String, name: String, width: String, @@ -498512,7 +422123,7 @@ var require_htmlelts = __commonJS((exports) => { align: String, scrolling: String, frameBorder: String, - longDesc: URL3, + longDesc: URL2, marginHeight: { type: String, treatNullAsEmptyString: true }, marginWidth: { type: String, treatNullAsEmptyString: true } } @@ -498525,7 +422136,7 @@ var require_htmlelts = __commonJS((exports) => { }, attributes: { alt: String, - src: URL3, + src: URL2, srcset: String, crossOrigin: CORS, useMap: String, @@ -498536,11 +422147,11 @@ var require_htmlelts = __commonJS((exports) => { referrerPolicy: REFERRER, loading: { type: ["eager", "lazy"], missing: "" }, name: String, - lowsrc: URL3, + lowsrc: URL2, align: String, hspace: { type: "unsigned long", default: 0 }, vspace: { type: "unsigned long", default: 0 }, - longDesc: URL3, + longDesc: URL2, border: { type: String, treatNullAsEmptyString: true } } }); @@ -498557,8 +422168,8 @@ var require_htmlelts = __commonJS((exports) => { this.checked = !this.checked; } else if (this.type === "radio") { var group = this.form.getElementsByName(this.name); - for (var i4 = group.length - 1;i4 >= 0; i4--) { - var el = group[i4]; + for (var i3 = group.length - 1;i3 >= 0; i3--) { + var el = group[i3]; el.checked = el === this; } } @@ -498582,7 +422193,7 @@ var require_htmlelts = __commonJS((exports) => { readOnly: Boolean, checked: Boolean, value: String, - src: URL3, + src: URL2, defaultChecked: { name: "checked", type: Boolean }, size: { type: "unsigned long", default: 20, min: 1, setmin: 1 }, width: { type: "unsigned long", min: 0, setmin: 0, default: 0 }, @@ -498681,7 +422292,7 @@ var require_htmlelts = __commonJS((exports) => { HTMLElement.call(this, doc2, localName, prefix); }, attributes: { - href: URL3, + href: URL2, rel: String, media: String, hreflang: String, @@ -498747,7 +422358,7 @@ var require_htmlelts = __commonJS((exports) => { HTMLElement.call(this, doc2, localName, prefix); }, attributes: { - cite: URL3, + cite: URL2, dateTime: String } }); @@ -498790,7 +422401,7 @@ var require_htmlelts = __commonJS((exports) => { }, props: formAssociatedProps, attributes: { - data: URL3, + data: URL2, type: String, name: String, useMap: String, @@ -498804,7 +422415,7 @@ var require_htmlelts = __commonJS((exports) => { hspace: { type: "unsigned long", default: 0 }, standby: String, vspace: { type: "unsigned long", default: 0 }, - codeBase: URL3, + codeBase: URL2, codeType: String, border: { type: String, treatNullAsEmptyString: true } } @@ -498920,7 +422531,7 @@ var require_htmlelts = __commonJS((exports) => { HTMLElement.call(this, doc2, localName, prefix); }, attributes: { - cite: URL3 + cite: URL2 } }); define2({ @@ -498933,8 +422544,8 @@ var require_htmlelts = __commonJS((exports) => { text: { get: function() { var s = ""; - for (var i4 = 0, n2 = this.childNodes.length;i4 < n2; i4++) { - var child = this.childNodes[i4]; + for (var i3 = 0, n2 = this.childNodes.length;i3 < n2; i3++) { + var child = this.childNodes[i3]; if (child.nodeType === Node2.TEXT_NODE) s += child._data; } @@ -498949,7 +422560,7 @@ var require_htmlelts = __commonJS((exports) => { } }, attributes: { - src: URL3, + src: URL2, type: String, charset: String, referrerPolicy: REFERRER, @@ -499212,7 +422823,7 @@ var require_htmlelts = __commonJS((exports) => { HTMLElement.call(this, doc2, localName, prefix); }, attributes: { - src: URL3, + src: URL2, crossOrigin: CORS, preload: { type: ["metadata", "none", "auto", { value: "", alias: "auto" }], missing: "auto" }, loop: Boolean, @@ -499238,7 +422849,7 @@ var require_htmlelts = __commonJS((exports) => { htmlElements.HTMLMediaElement.call(this, doc2, localName, prefix); }, attributes: { - poster: URL3, + poster: URL2, width: { type: "unsigned long", min: 0, default: 0 }, height: { type: "unsigned long", min: 0, default: 0 } } @@ -499340,7 +422951,7 @@ var require_htmlelts = __commonJS((exports) => { }, attributes: { type: { type: ["command", "checkbox", "radio"], missing: "command" }, - icon: URL3, + icon: URL2, disabled: Boolean, checked: Boolean, radiogroup: String, @@ -499357,7 +422968,7 @@ var require_htmlelts = __commonJS((exports) => { srcset: String, sizes: String, media: String, - src: URL3, + src: URL2, type: String, width: String, height: String @@ -499370,7 +422981,7 @@ var require_htmlelts = __commonJS((exports) => { HTMLElement.call(this, doc2, localName, prefix); }, attributes: { - src: URL3, + src: URL2, srclang: String, label: String, default: Boolean, @@ -499476,7 +423087,7 @@ var require_htmlelts = __commonJS((exports) => { var require_svg = __commonJS((exports) => { var Element = require_Element(); var defineElement = require_defineElement(); - var utils = require_utils17(); + var utils = require_utils16(); var CSSStyleDeclaration = require_CSSStyleDeclaration(); var svgElements = exports.elements = {}; var svgNameToImpl = Object.create(null); @@ -499626,13 +423237,13 @@ var require_Document2 = __commonJS((exports, module) => { var TreeWalker = require_TreeWalker(); var NodeIterator = require_NodeIterator(); var NodeFilter = require_NodeFilter(); - var URL3 = require_URL3(); - var select12 = require_select(); + var URL2 = require_URL2(); + var select2 = require_select(); var events2 = require_events3(); var xml = require_xmlnames(); var html2 = require_htmlelts(); var svg = require_svg(); - var utils = require_utils17(); + var utils = require_utils16(); var MUTATE = require_MutationConstants(); var NAMESPACE = utils.NAMESPACE; var isApiWritable = require_config3().isApiWritable; @@ -499715,8 +423326,8 @@ var require_Document2 = __commonJS((exports, module) => { return { namespace, prefix, localName }; } Document.prototype = Object.create(ContainerNode.prototype, { - _setMutationHandler: { value: function(handler14) { - this.mutationHandler = handler14; + _setMutationHandler: { value: function(handler18) { + this.mutationHandler = handler18; } }, _dispatchRendererEvent: { value: function(targetNid, type, details) { var target = this._nodes[targetNid]; @@ -499806,27 +423417,27 @@ var require_Document2 = __commonJS((exports, module) => { utils.NotSupportedError(); } } }, - createTreeWalker: { value: function(root4, whatToShow, filter4) { - if (!root4) { + createTreeWalker: { value: function(root3, whatToShow, filter3) { + if (!root3) { throw new TypeError("root argument is required"); } - if (!(root4 instanceof Node2)) { + if (!(root3 instanceof Node2)) { throw new TypeError("root not a node"); } whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : +whatToShow; - filter4 = filter4 === undefined ? null : filter4; - return new TreeWalker(root4, whatToShow, filter4); + filter3 = filter3 === undefined ? null : filter3; + return new TreeWalker(root3, whatToShow, filter3); } }, - createNodeIterator: { value: function(root4, whatToShow, filter4) { - if (!root4) { + createNodeIterator: { value: function(root3, whatToShow, filter3) { + if (!root3) { throw new TypeError("root argument is required"); } - if (!(root4 instanceof Node2)) { + if (!(root3 instanceof Node2)) { throw new TypeError("root not a node"); } whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : +whatToShow; - filter4 = filter4 === undefined ? null : filter4; - return new NodeIterator(root4, whatToShow, filter4); + filter3 = filter3 === undefined ? null : filter3; + return new NodeIterator(root3, whatToShow, filter3); } }, _attachNodeIterator: { value: function(ni) { if (!this._nodeIterators) { @@ -499935,13 +423546,13 @@ var require_Document2 = __commonJS((exports, module) => { }, set: function(value) { var elt = this._titleElement; - var head3 = this.head; - if (!elt && !head3) { + var head2 = this.head; + if (!elt && !head2) { return; } if (!elt) { elt = this.createElement("title"); - head3.appendChild(elt); + head2.appendChild(elt); } elt.textContent = value; } @@ -500044,14 +423655,14 @@ var require_Document2 = __commonJS((exports, module) => { return d; } }, cloneNode: { value: function cloneNode(deep) { - var clone5 = Node2.prototype.cloneNode.call(this, false); + var clone4 = Node2.prototype.cloneNode.call(this, false); if (deep) { for (var kid = this.firstChild;kid !== null; kid = kid.nextSibling) { - clone5._appendChild(clone5.importNode(kid, true)); + clone4._appendChild(clone4.importNode(kid, true)); } } - clone5._updateDocTypeElement(); - return clone5; + clone4._updateDocTypeElement(); + return clone4; } }, isEqual: { value: function isEqual(n2) { return true; @@ -500136,7 +423747,7 @@ var require_Document2 = __commonJS((exports, module) => { } } }, _resolve: { value: function(href) { - return new URL3(this._documentBaseURL).resolve(href); + return new URL2(this._documentBaseURL).resolve(href); } }, _documentBaseURL: { get: function() { var url3 = this._address; @@ -500144,7 +423755,7 @@ var require_Document2 = __commonJS((exports, module) => { url3 = "/"; var base2 = this.querySelector("base[href]"); if (base2) { - return new URL3(url3).resolve(base2.getAttribute("href")); + return new URL2(url3).resolve(base2.getAttribute("href")); } return url3; } }, @@ -500156,10 +423767,10 @@ var require_Document2 = __commonJS((exports, module) => { return this._templateDocCache; } }, querySelector: { value: function(selector) { - return select12(selector, this)[0]; + return select2(selector, this)[0]; } }, querySelectorAll: { value: function(selector) { - var nodes = select12(selector, this); + var nodes = select2(selector, this); return nodes.item ? nodes : new NodeList(nodes); } } }); @@ -500229,9 +423840,9 @@ var require_Document2 = __commonJS((exports, module) => { } }); }); - function namedHTMLChild(parent3, name) { - if (parent3 && parent3.isHTML) { - for (var kid = parent3.firstChild;kid !== null; kid = kid.nextSibling) { + function namedHTMLChild(parent2, name) { + if (parent2 && parent2.isHTML) { + for (var kid = parent2.firstChild;kid !== null; kid = kid.nextSibling) { if (kid.nodeType === Node2.ELEMENT_NODE && kid.localName === name && kid.namespaceURI === NAMESPACE.HTML) { return kid; } @@ -500239,7 +423850,7 @@ var require_Document2 = __commonJS((exports, module) => { } return null; } - function root3(n2) { + function root2(n2) { n2._nid = n2.ownerDocument._nextnid++; n2.ownerDocument._nodes[n2._nid] = n2; if (n2.nodeType === Node2.ELEMENT_NODE) { @@ -500260,7 +423871,7 @@ var require_Document2 = __commonJS((exports, module) => { n2._nid = undefined; } function recursivelyRoot(node) { - root3(node); + root2(node); if (node.nodeType === Node2.ELEMENT_NODE) { for (var kid = node.firstChild;kid !== null; kid = kid.nextSibling) recursivelyRoot(kid); @@ -500362,7 +423973,7 @@ var require_HTMLParser = __commonJS((exports, module) => { var Document = require_Document2(); var DocumentType = require_DocumentType(); var Node2 = require_Node2(); - var NAMESPACE = require_utils17().NAMESPACE; + var NAMESPACE = require_utils16().NAMESPACE; var html2 = require_htmlelts(); var impl = html2.elements; var pushAll = Function.prototype.apply.bind(Array.prototype.push); @@ -503039,24 +426650,24 @@ var require_HTMLParser = __commonJS((exports, module) => { if (buf.length < CHUNKSIZE) { return String.fromCharCode.apply(String, buf); } - var result3 = ""; - for (var i4 = 0;i4 < buf.length; i4 += CHUNKSIZE) { - result3 += String.fromCharCode.apply(String, buf.slice(i4, i4 + CHUNKSIZE)); + var result2 = ""; + for (var i3 = 0;i3 < buf.length; i3 += CHUNKSIZE) { + result2 += String.fromCharCode.apply(String, buf.slice(i3, i3 + CHUNKSIZE)); } - return result3; + return result2; } function str2buf(s) { - var result3 = []; - for (var i4 = 0;i4 < s.length; i4++) { - result3[i4] = s.charCodeAt(i4); + var result2 = []; + for (var i3 = 0;i3 < s.length; i3++) { + result2[i3] = s.charCodeAt(i3); } - return result3; + return result2; } - function isA(elt, set5) { - if (typeof set5 === "string") { - return elt.namespaceURI === NAMESPACE.HTML && elt.localName === set5; + function isA(elt, set4) { + if (typeof set4 === "string") { + return elt.namespaceURI === NAMESPACE.HTML && elt.localName === set4; } - var tagnames = set5[elt.namespaceURI]; + var tagnames = set4[elt.namespaceURI]; return tagnames && tagnames[elt.localName]; } function isMathmlTextIntegrationPoint(n2) { @@ -503081,30 +426692,30 @@ var require_HTMLParser = __commonJS((exports, module) => { return name; } function adjustSVGAttributes(attrs) { - for (var i4 = 0, n2 = attrs.length;i4 < n2; i4++) { - if (attrs[i4][0] in svgAttrAdjustments) { - attrs[i4][0] = svgAttrAdjustments[attrs[i4][0]]; + for (var i3 = 0, n2 = attrs.length;i3 < n2; i3++) { + if (attrs[i3][0] in svgAttrAdjustments) { + attrs[i3][0] = svgAttrAdjustments[attrs[i3][0]]; } } } function adjustMathMLAttributes(attrs) { - for (var i4 = 0, n2 = attrs.length;i4 < n2; i4++) { - if (attrs[i4][0] === "definitionurl") { - attrs[i4][0] = "definitionURL"; + for (var i3 = 0, n2 = attrs.length;i3 < n2; i3++) { + if (attrs[i3][0] === "definitionurl") { + attrs[i3][0] = "definitionURL"; break; } } } function adjustForeignAttributes(attrs) { - for (var i4 = 0, n2 = attrs.length;i4 < n2; i4++) { - if (attrs[i4][0] in foreignAttributes) { - attrs[i4].push(foreignAttributes[attrs[i4][0]]); + for (var i3 = 0, n2 = attrs.length;i3 < n2; i3++) { + if (attrs[i3][0] in foreignAttributes) { + attrs[i3].push(foreignAttributes[attrs[i3][0]]); } } } function transferAttributes(attrs, elt) { - for (var i4 = 0, n2 = attrs.length;i4 < n2; i4++) { - var name = attrs[i4][0], value = attrs[i4][1]; + for (var i3 = 0, n2 = attrs.length;i3 < n2; i3++) { + var name = attrs[i3][0], value = attrs[i3][1]; if (elt.hasAttribute(name)) continue; elt._setAttribute(name, value); @@ -503123,29 +426734,29 @@ var require_HTMLParser = __commonJS((exports, module) => { this.top = this.elements[this.elements.length - 1]; }; HTMLParser.ElementStack.prototype.popTag = function(tag2) { - for (var i4 = this.elements.length - 1;i4 > 0; i4--) { - var e = this.elements[i4]; + for (var i3 = this.elements.length - 1;i3 > 0; i3--) { + var e = this.elements[i3]; if (isA(e, tag2)) break; } - this.elements.length = i4; - this.top = this.elements[i4 - 1]; + this.elements.length = i3; + this.top = this.elements[i3 - 1]; }; HTMLParser.ElementStack.prototype.popElementType = function(type) { - for (var i4 = this.elements.length - 1;i4 > 0; i4--) { - if (this.elements[i4] instanceof type) + for (var i3 = this.elements.length - 1;i3 > 0; i3--) { + if (this.elements[i3] instanceof type) break; } - this.elements.length = i4; - this.top = this.elements[i4 - 1]; + this.elements.length = i3; + this.top = this.elements[i3 - 1]; }; HTMLParser.ElementStack.prototype.popElement = function(e) { - for (var i4 = this.elements.length - 1;i4 > 0; i4--) { - if (this.elements[i4] === e) + for (var i3 = this.elements.length - 1;i3 > 0; i3--) { + if (this.elements[i3] === e) break; } - this.elements.length = i4; - this.top = this.elements[i4 - 1]; + this.elements.length = i3; + this.top = this.elements[i3 - 1]; }; HTMLParser.ElementStack.prototype.removeElement = function(e) { if (this.top === e) @@ -503156,43 +426767,43 @@ var require_HTMLParser = __commonJS((exports, module) => { this.elements.splice(idx, 1); } }; - HTMLParser.ElementStack.prototype.clearToContext = function(set5) { - for (var i4 = this.elements.length - 1;i4 > 0; i4--) { - if (isA(this.elements[i4], set5)) + HTMLParser.ElementStack.prototype.clearToContext = function(set4) { + for (var i3 = this.elements.length - 1;i3 > 0; i3--) { + if (isA(this.elements[i3], set4)) break; } - this.elements.length = i4 + 1; - this.top = this.elements[i4]; + this.elements.length = i3 + 1; + this.top = this.elements[i3]; }; HTMLParser.ElementStack.prototype.contains = function(tag2) { return this.inSpecificScope(tag2, Object.create(null)); }; - HTMLParser.ElementStack.prototype.inSpecificScope = function(tag2, set5) { - for (var i4 = this.elements.length - 1;i4 >= 0; i4--) { - var elt = this.elements[i4]; + HTMLParser.ElementStack.prototype.inSpecificScope = function(tag2, set4) { + for (var i3 = this.elements.length - 1;i3 >= 0; i3--) { + var elt = this.elements[i3]; if (isA(elt, tag2)) return true; - if (isA(elt, set5)) + if (isA(elt, set4)) return false; } return false; }; - HTMLParser.ElementStack.prototype.elementInSpecificScope = function(target, set5) { - for (var i4 = this.elements.length - 1;i4 >= 0; i4--) { - var elt = this.elements[i4]; + HTMLParser.ElementStack.prototype.elementInSpecificScope = function(target, set4) { + for (var i3 = this.elements.length - 1;i3 >= 0; i3--) { + var elt = this.elements[i3]; if (elt === target) return true; - if (isA(elt, set5)) + if (isA(elt, set4)) return false; } return false; }; - HTMLParser.ElementStack.prototype.elementTypeInSpecificScope = function(target, set5) { - for (var i4 = this.elements.length - 1;i4 >= 0; i4--) { - var elt = this.elements[i4]; + HTMLParser.ElementStack.prototype.elementTypeInSpecificScope = function(target, set4) { + for (var i3 = this.elements.length - 1;i3 >= 0; i3--) { + var elt = this.elements[i3]; if (elt instanceof target) return true; - if (isA(elt, set5)) + if (isA(elt, set4)) return false; } return false; @@ -503216,8 +426827,8 @@ var require_HTMLParser = __commonJS((exports, module) => { return this.inSpecificScope(tag2, inTableScopeSet); }; HTMLParser.ElementStack.prototype.inSelectScope = function(tag2) { - for (var i4 = this.elements.length - 1;i4 >= 0; i4--) { - var elt = this.elements[i4]; + for (var i3 = this.elements.length - 1;i3 >= 0; i3--) { + var elt = this.elements[i3]; if (elt.namespaceURI !== NAMESPACE.HTML) return false; var localname = elt.localName; @@ -503230,15 +426841,15 @@ var require_HTMLParser = __commonJS((exports, module) => { }; HTMLParser.ElementStack.prototype.generateImpliedEndTags = function(butnot, thorough) { var endTagSet = thorough ? thoroughImpliedEndTagsSet : impliedEndTagsSet; - for (var i4 = this.elements.length - 1;i4 >= 0; i4--) { - var e = this.elements[i4]; + for (var i3 = this.elements.length - 1;i3 >= 0; i3--) { + var e = this.elements[i3]; if (butnot && isA(e, butnot)) break; - if (!isA(this.elements[i4], endTagSet)) + if (!isA(this.elements[i3], endTagSet)) break; } - this.elements.length = i4 + 1; - this.top = this.elements[i4]; + this.elements.length = i3 + 1; + this.top = this.elements[i3]; }; HTMLParser.ActiveFormattingElements = function AFE() { this.list = []; @@ -503251,14 +426862,14 @@ var require_HTMLParser = __commonJS((exports, module) => { }; HTMLParser.ActiveFormattingElements.prototype.push = function(elt, attrs) { var count3 = 0; - for (var i4 = this.list.length - 1;i4 >= 0; i4--) { - if (this.list[i4] === this.MARKER) + for (var i3 = this.list.length - 1;i3 >= 0; i3--) { + if (this.list[i3] === this.MARKER) break; - if (equal(elt, this.list[i4], this.attrs[i4])) { + if (equal(elt, this.list[i3], this.attrs[i3])) { count3++; if (count3 === 3) { - this.list.splice(i4, 1); - this.attrs.splice(i4, 1); + this.list.splice(i3, 1); + this.attrs.splice(i3, 1); break; } } @@ -503274,9 +426885,9 @@ var require_HTMLParser = __commonJS((exports, module) => { return false; if (newelt._numattrs !== oldattrs.length) return false; - for (var i5 = 0, n2 = oldattrs.length;i5 < n2; i5++) { - var oldname = oldattrs[i5][0]; - var oldval = oldattrs[i5][1]; + for (var i4 = 0, n2 = oldattrs.length;i4 < n2; i4++) { + var oldname = oldattrs[i4][0]; + var oldval = oldattrs[i4][1]; if (!newelt.hasAttribute(oldname)) return false; if (newelt.getAttribute(oldname) !== oldval) @@ -503286,18 +426897,18 @@ var require_HTMLParser = __commonJS((exports, module) => { } }; HTMLParser.ActiveFormattingElements.prototype.clearToMarker = function() { - for (var i4 = this.list.length - 1;i4 >= 0; i4--) { - if (this.list[i4] === this.MARKER) + for (var i3 = this.list.length - 1;i3 >= 0; i3--) { + if (this.list[i3] === this.MARKER) break; } - if (i4 < 0) - i4 = 0; - this.list.length = i4; - this.attrs.length = i4; + if (i3 < 0) + i3 = 0; + this.list.length = i3; + this.attrs.length = i3; }; HTMLParser.ActiveFormattingElements.prototype.findElementByTag = function(tag2) { - for (var i4 = this.list.length - 1;i4 >= 0; i4--) { - var elt = this.list[i4]; + for (var i3 = this.list.length - 1;i3 >= 0; i3--) { + var elt = this.list[i3]; if (elt === this.MARKER) break; if (elt.localName === tag2) @@ -503381,9 +426992,9 @@ var require_HTMLParser = __commonJS((exports, module) => { }, _asDocumentFragment: function() { var frag = doc2.createDocumentFragment(); - var root4 = doc2.firstChild; - while (root4.hasChildNodes()) { - frag.appendChild(root4.firstChild); + var root3 = doc2.firstChild; + while (root3.hasChildNodes()) { + frag.appendChild(root3.firstChild); } return frag; }, @@ -503469,9 +427080,9 @@ var require_HTMLParser = __commonJS((exports, module) => { break; } } - var root3 = doc2.createElement("html"); - doc2._appendChild(root3); - stack.push(root3); + var root2 = doc2.createElement("html"); + doc2._appendChild(root2); + stack.push(root2); if (fragmentContext instanceof impl.HTMLTemplateElement) { templateInsertionModes.push(in_template_mode); } @@ -503564,8 +427175,8 @@ var require_HTMLParser = __commonJS((exports, module) => { return false; } function addAttribute(name, value) { - for (var i4 = 0;i4 < attributes.length; i4++) { - if (attributes[i4][0] === name) + for (var i3 = 0;i3 < attributes.length; i3++) { + if (attributes[i3][0] === name) return; } if (value !== undefined) { @@ -503597,8 +427208,8 @@ var require_HTMLParser = __commonJS((exports, module) => { value = value.substring(0, len - 1); break; } - for (var i4 = 0;i4 < attributes.length; i4++) { - if (attributes[i4][0] === name) + for (var i3 = 0;i3 < attributes.length; i3++) { + if (attributes[i3][0] === name) return true; } attributes.push([name, value]); @@ -503767,41 +427378,41 @@ var require_HTMLParser = __commonJS((exports, module) => { } }; function insertComment(data) { - var parent3 = stack.top; - if (foster_parent_mode && isA(parent3, tablesectionrowSet)) { + var parent2 = stack.top; + if (foster_parent_mode && isA(parent2, tablesectionrowSet)) { fosterParent(function(doc3) { return doc3.createComment(data); }); } else { - if (parent3 instanceof impl.HTMLTemplateElement) { - parent3 = parent3.content; + if (parent2 instanceof impl.HTMLTemplateElement) { + parent2 = parent2.content; } - parent3._appendChild(parent3.ownerDocument.createComment(data)); + parent2._appendChild(parent2.ownerDocument.createComment(data)); } } function insertText(s) { - var parent3 = stack.top; - if (foster_parent_mode && isA(parent3, tablesectionrowSet)) { + var parent2 = stack.top; + if (foster_parent_mode && isA(parent2, tablesectionrowSet)) { fosterParent(function(doc3) { return doc3.createTextNode(s); }); } else { - if (parent3 instanceof impl.HTMLTemplateElement) { - parent3 = parent3.content; + if (parent2 instanceof impl.HTMLTemplateElement) { + parent2 = parent2.content; } - var lastChild = parent3.lastChild; + var lastChild = parent2.lastChild; if (lastChild && lastChild.nodeType === Node2.TEXT_NODE) { lastChild.appendData(s); } else { - parent3._appendChild(parent3.ownerDocument.createTextNode(s)); + parent2._appendChild(parent2.ownerDocument.createTextNode(s)); } } } function createHTMLElt(doc3, name, attrs) { var elt = html2.createElement(doc3, name, null); if (attrs) { - for (var i4 = 0, n2 = attrs.length;i4 < n2; i4++) { - elt._setAttribute(attrs[i4][0], attrs[i4][1]); + for (var i3 = 0, n2 = attrs.length;i3 < n2; i3++) { + elt._setAttribute(attrs[i3][0], attrs[i3][1]); } } return elt; @@ -503834,8 +427445,8 @@ var require_HTMLParser = __commonJS((exports, module) => { return insertElement(function(doc3) { var elt = doc3._createElementNS(name, ns, null); if (attrs) { - for (var i4 = 0, n2 = attrs.length;i4 < n2; i4++) { - var attr = attrs[i4]; + for (var i3 = 0, n2 = attrs.length;i3 < n2; i3++) { + var attr = attrs[i3]; if (attr.length === 2) elt._setAttribute(attr[0], attr[1]); else { @@ -503847,56 +427458,56 @@ var require_HTMLParser = __commonJS((exports, module) => { }); } function lastElementOfType(type) { - for (var i4 = stack.elements.length - 1;i4 >= 0; i4--) { - if (stack.elements[i4] instanceof type) { - return i4; + for (var i3 = stack.elements.length - 1;i3 >= 0; i3--) { + if (stack.elements[i3] instanceof type) { + return i3; } } return -1; } function fosterParent(eltFunc) { - var parent3, before3, lastTable = -1, lastTemplate = -1, elt; + var parent2, before2, lastTable = -1, lastTemplate = -1, elt; lastTable = lastElementOfType(impl.HTMLTableElement); lastTemplate = lastElementOfType(impl.HTMLTemplateElement); if (lastTemplate >= 0 && (lastTable < 0 || lastTemplate > lastTable)) { - parent3 = stack.elements[lastTemplate]; + parent2 = stack.elements[lastTemplate]; } else if (lastTable >= 0) { - parent3 = stack.elements[lastTable].parentNode; - if (parent3) { - before3 = stack.elements[lastTable]; + parent2 = stack.elements[lastTable].parentNode; + if (parent2) { + before2 = stack.elements[lastTable]; } else { - parent3 = stack.elements[lastTable - 1]; + parent2 = stack.elements[lastTable - 1]; } } - if (!parent3) - parent3 = stack.elements[0]; - if (parent3 instanceof impl.HTMLTemplateElement) { - parent3 = parent3.content; + if (!parent2) + parent2 = stack.elements[0]; + if (parent2 instanceof impl.HTMLTemplateElement) { + parent2 = parent2.content; } - elt = eltFunc(parent3.ownerDocument); + elt = eltFunc(parent2.ownerDocument); if (elt.nodeType === Node2.TEXT_NODE) { var prev; - if (before3) - prev = before3.previousSibling; + if (before2) + prev = before2.previousSibling; else - prev = parent3.lastChild; + prev = parent2.lastChild; if (prev && prev.nodeType === Node2.TEXT_NODE) { prev.appendData(elt.data); return elt; } } - if (before3) - parent3.insertBefore(elt, before3); + if (before2) + parent2.insertBefore(elt, before2); else - parent3._appendChild(elt); + parent2._appendChild(elt); return elt; } function resetInsertionMode() { - var last3 = false; - for (var i4 = stack.elements.length - 1;i4 >= 0; i4--) { - var node = stack.elements[i4]; - if (i4 === 0) { - last3 = true; + var last2 = false; + for (var i3 = stack.elements.length - 1;i3 >= 0; i3--) { + var node = stack.elements[i3]; + if (i3 === 0) { + last2 = true; if (fragment) { node = fragmentContext; } @@ -503905,7 +427516,7 @@ var require_HTMLParser = __commonJS((exports, module) => { var tag2 = node.localName; switch (tag2) { case "select": - for (var j = i4;j > 0; ) { + for (var j = i3;j > 0; ) { var ancestor = stack.elements[--j]; if (ancestor instanceof impl.HTMLTemplateElement) { break; @@ -503950,7 +427561,7 @@ var require_HTMLParser = __commonJS((exports, module) => { } return; default: - if (!last3) { + if (!last2) { if (tag2 === "head") { parser2 = in_head_mode; return; @@ -503962,7 +427573,7 @@ var require_HTMLParser = __commonJS((exports, module) => { } } } - if (last3) { + if (last2) { parser2 = in_body_mode; return; } @@ -503980,10 +427591,10 @@ var require_HTMLParser = __commonJS((exports, module) => { originalInsertionMode = parser2; parser2 = text_mode; } - function afeclone(doc3, i4) { + function afeclone(doc3, i3) { return { - elt: createHTMLElt(doc3, afe.list[i4].localName, afe.attrs[i4]), - attrs: afe.attrs[i4] + elt: createHTMLElt(doc3, afe.list[i3].localName, afe.attrs[i3]), + attrs: afe.attrs[i3] }; } function afereconstruct() { @@ -503994,18 +427605,18 @@ var require_HTMLParser = __commonJS((exports, module) => { return; if (stack.elements.lastIndexOf(entry) !== -1) return; - for (var i4 = afe.list.length - 2;i4 >= 0; i4--) { - entry = afe.list[i4]; + for (var i3 = afe.list.length - 2;i3 >= 0; i3--) { + entry = afe.list[i3]; if (entry === afe.MARKER) break; if (stack.elements.lastIndexOf(entry) !== -1) break; } - for (i4 = i4 + 1;i4 < afe.list.length; i4++) { + for (i3 = i3 + 1;i3 < afe.list.length; i3++) { var newelt = insertElement(function(doc3) { - return afeclone(doc3, i4).elt; + return afeclone(doc3, i3).elt; }); - afe.list[i4] = newelt; + afe.list[i3] = newelt; } } var BOOKMARK = { localName: "BM" }; @@ -504030,10 +427641,10 @@ var require_HTMLParser = __commonJS((exports, module) => { return true; } var furthestblock = null, furthestblockindex; - for (var i4 = index + 1;i4 < stack.elements.length; i4++) { - if (isA(stack.elements[i4], specialSet)) { - furthestblock = stack.elements[i4]; - furthestblockindex = i4; + for (var i3 = index + 1;i3 < stack.elements.length; i3++) { + if (isA(stack.elements[i3], specialSet)) { + furthestblock = stack.elements[i3]; + furthestblockindex = i3; break; } } @@ -506938,7 +430549,7 @@ var require_HTMLParser = __commonJS((exports, module) => { parser2(t, value, arg3, arg4); } function in_body_mode(t, value, arg3, arg4) { - var body, i4, node, elt; + var body, i3, node, elt; switch (t) { case 1: if (textIncludesNUL) { @@ -507068,8 +430679,8 @@ var require_HTMLParser = __commonJS((exports, module) => { return; case "li": frameset_ok = false; - for (i4 = stack.elements.length - 1;i4 >= 0; i4--) { - node = stack.elements[i4]; + for (i3 = stack.elements.length - 1;i3 >= 0; i3--) { + node = stack.elements[i3]; if (node instanceof impl.HTMLLIElement) { in_body_mode(ENDTAG, "li"); break; @@ -507084,8 +430695,8 @@ var require_HTMLParser = __commonJS((exports, module) => { case "dd": case "dt": frameset_ok = false; - for (i4 = stack.elements.length - 1;i4 >= 0; i4--) { - node = stack.elements[i4]; + for (i3 = stack.elements.length - 1;i3 >= 0; i3--) { + node = stack.elements[i3]; if (isA(node, dddtSet)) { in_body_mode(ENDTAG, node.localName); break; @@ -507400,8 +431011,8 @@ var require_HTMLParser = __commonJS((exports, module) => { case "strong": case "tt": case "u": - var result3 = adoptionAgency(value); - if (result3) + var result2 = adoptionAgency(value); + if (result2) return; break; case "applet": @@ -507417,8 +431028,8 @@ var require_HTMLParser = __commonJS((exports, module) => { in_body_mode(TAG, value, null); return; } - for (i4 = stack.elements.length - 1;i4 >= 0; i4--) { - node = stack.elements[i4]; + for (i3 = stack.elements.length - 1;i3 >= 0; i3--) { + node = stack.elements[i3]; if (isA(node, value)) { stack.generateImpliedEndTags(value); stack.popElement(node); @@ -507456,9 +431067,9 @@ var require_HTMLParser = __commonJS((exports, module) => { } function in_table_mode(t, value, arg3, arg4) { function getTypeAttr(attrs) { - for (var i4 = 0, n2 = attrs.length;i4 < n2; i4++) { - if (attrs[i4][0] === "type") - return attrs[i4][1].toLowerCase(); + for (var i3 = 0, n2 = attrs.length;i3 < n2; i3++) { + if (attrs[i3][0] === "type") + return attrs[i3][1].toLowerCase(); } return null; } @@ -508211,8 +431822,8 @@ var require_HTMLParser = __commonJS((exports, module) => { } function insertForeignToken(t, value, arg3, arg4) { function isHTMLFont(attrs) { - for (var i5 = 0, n2 = attrs.length;i5 < n2; i5++) { - switch (attrs[i5][0]) { + for (var i4 = 0, n2 = attrs.length;i4 < n2; i4++) { + switch (attrs[i4][0]) { case "color": case "face": case "size": @@ -508314,14 +431925,14 @@ var require_HTMLParser = __commonJS((exports, module) => { if (value === "script" && current.namespaceURI === NAMESPACE.SVG && current.localName === "script") { stack.pop(); } else { - var i4 = stack.elements.length - 1; - var node = stack.elements[i4]; + var i3 = stack.elements.length - 1; + var node = stack.elements[i3]; for (;; ) { if (node.localName.toLowerCase() === value) { stack.popElement(node); break; } - node = stack.elements[--i4]; + node = stack.elements[--i3]; if (node.namespaceURI !== NAMESPACE.HTML) continue; parser2(t, value, arg3, arg4); @@ -508331,7 +431942,7 @@ var require_HTMLParser = __commonJS((exports, module) => { return; } } - htmlparser.testTokenizer = function(input11, initialState, lastStartTag, charbychar) { + htmlparser.testTokenizer = function(input, initialState, lastStartTag, charbychar) { var tokens = []; switch (initialState) { case "PCDATA state": @@ -508373,8 +431984,8 @@ var require_HTMLParser = __commonJS((exports, module) => { break; case 2: var attrs = Object.create(null); - for (var i5 = 0;i5 < arg3.length; i5++) { - var a2 = arg3[i5]; + for (var i4 = 0;i4 < arg3.length; i4++) { + var a2 = arg3[i4]; if (a2.length === 1) { attrs[a2[0]] = ""; } else { @@ -508394,10 +432005,10 @@ var require_HTMLParser = __commonJS((exports, module) => { } }; if (!charbychar) { - this.parse(input11, true); + this.parse(input, true); } else { - for (var i4 = 0;i4 < input11.length; i4++) { - this.parse(input11[i4]); + for (var i3 = 0;i3 < input.length; i3++) { + this.parse(input[i3]); } this.parse("", true); } @@ -508413,7 +432024,7 @@ var require_DOMImplementation = __commonJS((exports, module) => { var Document = require_Document2(); var DocumentType = require_DocumentType(); var HTMLParser = require_HTMLParser(); - var utils = require_utils17(); + var utils = require_utils16(); var xml = require_xmlnames(); function DOMImplementation(contextObject) { this.contextObject = contextObject; @@ -508460,19 +432071,19 @@ var require_DOMImplementation = __commonJS((exports, module) => { d.appendChild(new DocumentType(d, "html")); var html2 = d.createElement("html"); d.appendChild(html2); - var head3 = d.createElement("head"); - html2.appendChild(head3); + var head2 = d.createElement("head"); + html2.appendChild(head2); if (titleText !== undefined) { var title = d.createElement("title"); - head3.appendChild(title); + head2.appendChild(title); title.appendChild(d.createTextNode(titleText)); } html2.appendChild(d.createElement("body")); d.modclock = 1; return d; }, - mozSetOutputMutationHandler: function(doc2, handler14) { - doc2.mutationHandler = handler14; + mozSetOutputMutationHandler: function(doc2, handler18) { + doc2.mutationHandler = handler18; }, mozGetInputMutationHandler: function(doc2) { utils.nyi(); @@ -508483,7 +432094,7 @@ var require_DOMImplementation = __commonJS((exports, module) => { // node_modules/@mixmark-io/domino/lib/Location.js var require_Location = __commonJS((exports, module) => { - var URL3 = require_URL3(); + var URL2 = require_URL2(); var URLUtils = require_URLUtils(); module.exports = Location; function Location(window2, href) { @@ -508501,7 +432112,7 @@ var require_Location = __commonJS((exports, module) => { } }, assign: { value: function(url3) { - var current = new URL3(this._href); + var current = new URL2(this._href); var newurl = current.resolve(url3); this._href = newurl; } }, @@ -508549,7 +432160,7 @@ var require_WindowTimers = __commonJS((exports, module) => { // node_modules/@mixmark-io/domino/lib/impl.js var require_impl = __commonJS((exports, module) => { - var utils = require_utils17(); + var utils = require_utils16(); exports = module.exports = { CSSStyleDeclaration: require_CSSStyleDeclaration(), CharacterData: require_CharacterData(), @@ -508580,7 +432191,7 @@ var require_Window = __commonJS((exports, module) => { var DOMImplementation = require_DOMImplementation(); var EventTarget2 = require_EventTarget(); var Location = require_Location(); - var utils = require_utils17(); + var utils = require_utils16(); module.exports = Window; function Window(document2) { this.document = document2 || new DOMImplementation(null).createHTMLDocument(""); @@ -508631,7 +432242,7 @@ var require_Window = __commonJS((exports, module) => { }); // node_modules/@mixmark-io/domino/lib/index.js -var require_lib11 = __commonJS((exports) => { +var require_lib9 = __commonJS((exports) => { var DOMImplementation = require_DOMImplementation(); var HTMLParser = require_HTMLParser(); var Window = require_Window(); @@ -508683,8 +432294,8 @@ var require_lib11 = __commonJS((exports) => { // node_modules/turndown/lib/turndown.cjs.js var require_turndown_cjs = __commonJS((exports, module) => { function extend3(destination) { - for (var i4 = 1;i4 < arguments.length; i4++) { - var source = arguments[i4]; + for (var i3 = 1;i3 < arguments.length; i3++) { + var source = arguments[i3]; for (var key in source) { if (source.hasOwnProperty(key)) destination[key] = source[key]; @@ -508692,7 +432303,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { } return destination; } - function repeat4(character, count3) { + function repeat3(character, count3) { return Array(count3 + 1).join(character); } function trimLeadingNewlines(string5) { @@ -508784,7 +432395,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { return is(node, voidElements); } function hasVoid(node) { - return has3(node, voidElements); + return has2(node, voidElements); } var meaningfulWhenBlankElements = [ "A", @@ -508803,12 +432414,12 @@ var require_turndown_cjs = __commonJS((exports, module) => { return is(node, meaningfulWhenBlankElements); } function hasMeaningfulWhenBlank(node) { - return has3(node, meaningfulWhenBlankElements); + return has2(node, meaningfulWhenBlankElements); } function is(node, tagNames) { return tagNames.indexOf(node.nodeName) >= 0; } - function has3(node, tagNames) { + function has2(node, tagNames) { return node.getElementsByTagName && tagNames.some(function(tagName) { return node.getElementsByTagName(tagName).length; }); @@ -508836,7 +432447,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { replacement: function(content, node, options2) { var hLevel = Number(node.nodeName.charAt(1)); if (options2.headingStyle === "setext" && hLevel < 3) { - var underline2 = repeat4(hLevel === 1 ? "=" : "-", content.length); + var underline2 = repeat3(hLevel === 1 ? "=" : "-", content.length); return ` ` + content + ` @@ -508846,7 +432457,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { } else { return ` -` + repeat4("#", hLevel) + " " + content + ` +` + repeat3("#", hLevel) + " " + content + ` `; } @@ -508866,8 +432477,8 @@ var require_turndown_cjs = __commonJS((exports, module) => { rules.list = { filter: ["ul", "ol"], replacement: function(content, node) { - var parent3 = node.parentNode; - if (parent3.nodeName === "LI" && parent3.lastElementChild === node) { + var parent2 = node.parentNode; + if (parent2.nodeName === "LI" && parent2.lastElementChild === node) { return ` ` + content; } else { @@ -508883,10 +432494,10 @@ var require_turndown_cjs = __commonJS((exports, module) => { filter: "li", replacement: function(content, node, options2) { var prefix = options2.bulletListMarker + " "; - var parent3 = node.parentNode; - if (parent3.nodeName === "OL") { - var start = parent3.getAttribute("start"); - var index = Array.prototype.indexOf.call(parent3.children, node); + var parent2 = node.parentNode; + if (parent2.nodeName === "OL") { + var start = parent2.getAttribute("start"); + var index = Array.prototype.indexOf.call(parent2.children, node); prefix = (start ? Number(start) + index : index + 1) + ". "; } var isParagraph = /\n$/.test(content); @@ -508928,7 +432539,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { fenceSize = match[0].length + 1; } } - var fence = repeat4(fenceChar, fenceSize); + var fence = repeat3(fenceChar, fenceSize); return ` ` + fence + language + ` @@ -509033,8 +432644,8 @@ var require_turndown_cjs = __commonJS((exports, module) => { content = content.replace(/\r?\n|\r/g, " "); var extraSpace = /^`|^ .*?[^ ].* $|`$/.test(content) ? " " : ""; var delimiter4 = "`"; - var matches3 = content.match(/`+/gm) || []; - while (matches3.indexOf(delimiter4) !== -1) + var matches2 = content.match(/`+/gm) || []; + while (matches2.indexOf(delimiter4) !== -1) delimiter4 = delimiter4 + "`"; return delimiter4 + extraSpace + content + extraSpace + delimiter4; } @@ -509072,15 +432683,15 @@ var require_turndown_cjs = __commonJS((exports, module) => { add: function(key, rule) { this.array.unshift(rule); }, - keep: function(filter4) { + keep: function(filter3) { this._keep.unshift({ - filter: filter4, + filter: filter3, replacement: this.keepReplacement }); }, - remove: function(filter4) { + remove: function(filter3) { this._remove.unshift({ - filter: filter4, + filter: filter3, replacement: function() { return ""; } @@ -509099,28 +432710,28 @@ var require_turndown_cjs = __commonJS((exports, module) => { return this.defaultRule; }, forEach: function(fn) { - for (var i4 = 0;i4 < this.array.length; i4++) - fn(this.array[i4], i4); + for (var i3 = 0;i3 < this.array.length; i3++) + fn(this.array[i3], i3); } }; function findRule(rules2, node, options2) { - for (var i4 = 0;i4 < rules2.length; i4++) { - var rule = rules2[i4]; + for (var i3 = 0;i3 < rules2.length; i3++) { + var rule = rules2[i3]; if (filterValue(rule, node, options2)) return rule; } return; } function filterValue(rule, node, options2) { - var filter4 = rule.filter; - if (typeof filter4 === "string") { - if (filter4 === node.nodeName.toLowerCase()) + var filter3 = rule.filter; + if (typeof filter3 === "string") { + if (filter3 === node.nodeName.toLowerCase()) return true; - } else if (Array.isArray(filter4)) { - if (filter4.indexOf(node.nodeName.toLowerCase()) > -1) + } else if (Array.isArray(filter3)) { + if (filter3.indexOf(node.nodeName.toLowerCase()) > -1) return true; - } else if (typeof filter4 === "function") { - if (filter4.call(rule, node, options2)) + } else if (typeof filter3 === "function") { + if (filter3.call(rule, node, options2)) return true; } else { throw new TypeError("`filter` needs to be a string, array, or function"); @@ -509141,15 +432752,15 @@ var require_turndown_cjs = __commonJS((exports, module) => { var node = next(prev, element, isPre); while (node !== element) { if (node.nodeType === 3 || node.nodeType === 4) { - var text2 = node.data.replace(/[ \r\n\t]+/g, " "); - if ((!prevText || / $/.test(prevText.data)) && !keepLeadingWs && text2[0] === " ") { - text2 = text2.substr(1); + var text = node.data.replace(/[ \r\n\t]+/g, " "); + if ((!prevText || / $/.test(prevText.data)) && !keepLeadingWs && text[0] === " ") { + text = text.substr(1); } - if (!text2) { - node = remove4(node); + if (!text) { + node = remove3(node); continue; } - node.data = text2; + node.data = text; prevText = node; } else if (node.nodeType === 1) { if (isBlock2(node) || node.nodeName === "BR") { @@ -509165,7 +432776,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { keepLeadingWs = false; } } else { - node = remove4(node); + node = remove3(node); continue; } var nextNode = next(prev, node, isPre); @@ -509175,11 +432786,11 @@ var require_turndown_cjs = __commonJS((exports, module) => { if (prevText) { prevText.data = prevText.data.replace(/ $/, ""); if (!prevText.data) { - remove4(prevText); + remove3(prevText); } } } - function remove4(node) { + function remove3(node) { var next2 = node.nextSibling || node.parentNode; node.parentNode.removeChild(node); return next2; @@ -509190,9 +432801,9 @@ var require_turndown_cjs = __commonJS((exports, module) => { } return current.firstChild || current.nextSibling || current.parentNode; } - var root3 = typeof window !== "undefined" ? window : {}; + var root2 = typeof window !== "undefined" ? window : {}; function canParseHTMLNatively() { - var Parser2 = root3.DOMParser; + var Parser2 = root2.DOMParser; var canParse = false; try { if (new Parser2().parseFromString("", "text/html")) { @@ -509204,29 +432815,29 @@ var require_turndown_cjs = __commonJS((exports, module) => { function createHTMLParser() { var Parser2 = function() {}; { - var domino = require_lib11(); + var domino = require_lib9(); Parser2.prototype.parseFromString = function(string5) { return domino.createDocument(string5); }; } return Parser2; } - var HTMLParser = canParseHTMLNatively() ? root3.DOMParser : createHTMLParser(); - function RootNode(input11, options2) { - var root4; - if (typeof input11 === "string") { - var doc2 = htmlParser().parseFromString('' + input11 + "", "text/html"); - root4 = doc2.getElementById("turndown-root"); + var HTMLParser = canParseHTMLNatively() ? root2.DOMParser : createHTMLParser(); + function RootNode(input, options2) { + var root3; + if (typeof input === "string") { + var doc2 = htmlParser().parseFromString('' + input + "", "text/html"); + root3 = doc2.getElementById("turndown-root"); } else { - root4 = input11.cloneNode(true); + root3 = input.cloneNode(true); } collapseWhitespace({ - element: root4, + element: root3, isBlock, isVoid, isPre: options2.preformattedCode ? isPreOrCode : null }); - return root4; + return root3; } var _htmlParser; function htmlParser() { @@ -509292,7 +432903,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { } return isFlanked; } - var reduce3 = Array.prototype.reduce; + var reduce2 = Array.prototype.reduce; var escapes = [ [/\\/g, "\\\\"], [/\*/g, "\\*"], @@ -509311,7 +432922,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { function TurndownService(options2) { if (!(this instanceof TurndownService)) return new TurndownService(options2); - var defaults4 = { + var defaults3 = { rules, headingStyle: "setext", hr: "* * *", @@ -509344,23 +432955,23 @@ var require_turndown_cjs = __commonJS((exports, module) => { ` : content; } }; - this.options = extend3({}, defaults4, options2); + this.options = extend3({}, defaults3, options2); this.rules = new Rules(this.options); } TurndownService.prototype = { - turndown: function(input11) { - if (!canConvert(input11)) { - throw new TypeError(input11 + " is not a string, or an element/document/fragment node."); + turndown: function(input) { + if (!canConvert(input)) { + throw new TypeError(input + " is not a string, or an element/document/fragment node."); } - if (input11 === "") + if (input === "") return ""; - var output = process13.call(this, new RootNode(input11, this.options)); + var output = process13.call(this, new RootNode(input, this.options)); return postProcess2.call(this, output); }, use: function(plugin) { if (Array.isArray(plugin)) { - for (var i4 = 0;i4 < plugin.length; i4++) - this.use(plugin[i4]); + for (var i3 = 0;i3 < plugin.length; i3++) + this.use(plugin[i3]); } else if (typeof plugin === "function") { plugin(this); } else { @@ -509372,23 +432983,23 @@ var require_turndown_cjs = __commonJS((exports, module) => { this.rules.add(key, rule); return this; }, - keep: function(filter4) { - this.rules.keep(filter4); + keep: function(filter3) { + this.rules.keep(filter3); return this; }, - remove: function(filter4) { - this.rules.remove(filter4); + remove: function(filter3) { + this.rules.remove(filter3); return this; }, escape: function(string5) { - return escapes.reduce(function(accumulator, escape5) { - return accumulator.replace(escape5[0], escape5[1]); + return escapes.reduce(function(accumulator, escape4) { + return accumulator.replace(escape4[0], escape4[1]); }, string5); } }; function process13(parentNode) { var self2 = this; - return reduce3.call(parentNode.childNodes, function(output, node) { + return reduce2.call(parentNode.childNodes, function(output, node) { node = new Node2(node, self2.options); var replacement = ""; if (node.nodeType === 3) { @@ -509396,14 +433007,14 @@ var require_turndown_cjs = __commonJS((exports, module) => { } else if (node.nodeType === 1) { replacement = replacementForNode.call(self2, node); } - return join97(output, replacement); + return join87(output, replacement); }, ""); } function postProcess2(output) { var self2 = this; this.rules.forEach(function(rule) { if (typeof rule.append === "function") { - output = join97(output, rule.append(self2.options)); + output = join87(output, rule.append(self2.options)); } }); return output.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, ""); @@ -509416,7 +433027,7 @@ var require_turndown_cjs = __commonJS((exports, module) => { content = content.trim(); return whitespace.leading + rule.replacement(content, node, this.options) + whitespace.trailing; } - function join97(output, replacement) { + function join87(output, replacement) { var s1 = trimTrailingNewlines(output); var s2 = trimLeadingNewlines(replacement); var nls = Math.max(output.length - s1.length, replacement.length - s2.length); @@ -509425,8 +433036,8 @@ var require_turndown_cjs = __commonJS((exports, module) => { `.substring(0, nls); return s1 + separator + s2; } - function canConvert(input11) { - return input11 != null && (typeof input11 === "string" || input11.nodeType && (input11.nodeType === 1 || input11.nodeType === 9 || input11.nodeType === 11)); + function canConvert(input) { + return input != null && (typeof input === "string" || input.nodeType && (input.nodeType === 1 || input.nodeType === 9 || input.nodeType === 11)); } module.exports = TurndownService; }); @@ -509541,9 +433152,9 @@ async function getWithPermittedRedirects(url3, signal, redirectChecker, depth = "User-Agent": getWebFetchUserAgent() } }); - } catch (error45) { - if (axios_default.isAxiosError(error45) && error45.response && [301, 302, 307, 308].includes(error45.response.status)) { - const redirectLocation = error45.response.headers.location; + } catch (error41) { + if (axios_default.isAxiosError(error41) && error41.response && [301, 302, 307, 308].includes(error41.response.status)) { + const redirectLocation = error41.response.headers.location; if (!redirectLocation) { throw new Error("Redirect missing Location header"); } @@ -509555,15 +433166,15 @@ async function getWithPermittedRedirects(url3, signal, redirectChecker, depth = type: "redirect", originalUrl: url3, redirectUrl, - statusCode: error45.response.status + statusCode: error41.response.status }; } } - if (axios_default.isAxiosError(error45) && error45.response?.status === 403 && error45.response.headers["x-proxy-error"] === "blocked-by-allowlist") { + if (axios_default.isAxiosError(error41) && error41.response?.status === 403 && error41.response.headers["x-proxy-error"] === "blocked-by-allowlist") { const hostname3 = new URL(url3).hostname; throw new EgressBlockedError(hostname3); } - throw error45; + throw error41; } } function isRedirectInfo(response) { @@ -509628,10 +433239,10 @@ async function getURLMarkdownContent(url3, abortController) { let persistedSize; if (isBinaryContentType(contentType)) { const persistId = `webfetch-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; - const result3 = await persistBinaryContent(rawBuffer, contentType, persistId); - if (!("error" in result3)) { - persistedPath = result3.filepath; - persistedSize = result3.size; + const result2 = await persistBinaryContent(rawBuffer, contentType, persistId); + if (!("error" in result2)) { + persistedPath = result2.filepath; + persistedSize = result2.size; } } const bytes = rawBuffer.length; @@ -509687,7 +433298,7 @@ async function applyPromptToMarkdown(prompt, markdownContent, signal, isNonInter return "No response from model"; } var DomainBlockedError, DomainCheckFailedError, EgressBlockedError, CACHE_TTL_MS3, MAX_CACHE_SIZE_BYTES, URL_CACHE, DOMAIN_CHECK_CACHE, turndownServicePromise, MAX_URL_LENGTH = 2000, MAX_HTTP_CONTENT_LENGTH = 10485760, FETCH_TIMEOUT_MS3 = 60000, DOMAIN_CHECK_TIMEOUT_MS = 1e4, MAX_REDIRECTS = 10, MAX_MARKDOWN_LENGTH = 1e5; -var init_utils10 = __esm(() => { +var init_utils9 = __esm(() => { init_axios2(); init_index_min(); init_analytics(); @@ -509735,17 +433346,17 @@ var init_utils10 = __esm(() => { }); // src/tools/WebFetchTool/WebFetchTool.ts -function webFetchToolInputToPermissionRuleContent(input11) { +function webFetchToolInputToPermissionRuleContent(input) { try { - const parsedInput = WebFetchTool.inputSchema.safeParse(input11); + const parsedInput = WebFetchTool.inputSchema.safeParse(input); if (!parsedInput.success) { - return `input:${input11.toString()}`; + return `input:${input.toString()}`; } const { url: url3 } = parsedInput.data; const hostname3 = new URL(url3).hostname; return `domain:${hostname3}`; } catch { - return `input:${input11.toString()}`; + return `input:${input.toString()}`; } } function buildSuggestions(ruleContent) { @@ -509766,7 +433377,7 @@ var init_WebFetchTool = __esm(() => { init_permissions2(); init_preapproved(); init_UI10(); - init_utils10(); + init_utils9(); inputSchema13 = lazySchema(() => exports_external.strictObject({ url: exports_external.string().url().describe("The URL to fetch content from"), prompt: exports_external.string().describe("The prompt to run on the fetched content") @@ -509784,8 +433395,8 @@ var init_WebFetchTool = __esm(() => { searchHint: "fetch and extract content from a URL", maxResultSizeChars: 1e5, shouldDefer: true, - async description(input11) { - const { url: url3 } = input11; + async description(input) { + const { url: url3 } = input; try { const hostname3 = new URL(url3).hostname; return `Claude wants to fetch content from ${hostname3}`; @@ -509797,8 +433408,8 @@ var init_WebFetchTool = __esm(() => { return "Fetch"; }, getToolUseSummary: getToolUseSummary6, - getActivityDescription(input11) { - const summary = getToolUseSummary6(input11); + getActivityDescription(input) { + const summary = getToolUseSummary6(input); return summary ? `Fetching ${summary}` : "Fetching web page"; }, get inputSchema() { @@ -509813,24 +433424,24 @@ var init_WebFetchTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.prompt ? `${input11.url}: ${input11.prompt}` : input11.url; + toAutoClassifierInput(input) { + return input.prompt ? `${input.url}: ${input.prompt}` : input.url; }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); const permissionContext = appState.toolPermissionContext; try { - const { url: url3 } = input11; + const { url: url3 } = input; const parsedUrl = new URL(url3); if (isPreapprovedHost(parsedUrl.hostname, parsedUrl.pathname)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Preapproved host" } }; } } catch {} - const ruleContent = webFetchToolInputToPermissionRuleContent(input11); + const ruleContent = webFetchToolInputToPermissionRuleContent(input); const denyRule = getRuleByContentsForTool(permissionContext, WebFetchTool, "deny").get(ruleContent); if (denyRule) { return { @@ -509858,7 +433469,7 @@ var init_WebFetchTool = __esm(() => { if (allowRule) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "rule", rule: allowRule @@ -509875,8 +433486,8 @@ var init_WebFetchTool = __esm(() => { return `IMPORTANT: WebFetch WILL FAIL for authenticated or private URLs. Before using this tool, check if the URL points to an authenticated service (e.g. Google Docs, Confluence, Jira, GitHub). If so, look for a specialized MCP tool that provides authenticated access. ${DESCRIPTION5}`; }, - async validateInput(input11) { - const { url: url3 } = input11; + async validateInput(input) { + const { url: url3 } = input; try { new URL(url3); } catch { @@ -509928,14 +433539,14 @@ To complete your request, I need to fetch content from the redirected URL. Pleas persistedSize } = response; const isPreapproved = isPreapprovedUrl(url3); - let result3; + let result2; if (isPreapproved && contentType.includes("text/markdown") && content.length < MAX_MARKDOWN_LENGTH) { - result3 = content; + result2 = content; } else { - result3 = await applyPromptToMarkdown(prompt, content, abortController.signal, isNonInteractiveSession, isPreapproved); + result2 = await applyPromptToMarkdown(prompt, content, abortController.signal, isNonInteractiveSession, isPreapproved); } if (persistedPath) { - result3 += ` + result2 += ` [Binary content (${contentType}, ${formatFileSize(persistedSize ?? bytes)}) also saved to ${persistedPath}]`; } @@ -509943,7 +433554,7 @@ To complete your request, I need to fetch content from the redirected URL. Pleas bytes, code, codeText, - result: result3, + result: result2, durationMs: Date.now() - start, url: url3 }; @@ -509951,19 +433562,19 @@ To complete your request, I need to fetch content from the redirected URL. Pleas data: output }; }, - mapToolResultToToolResultBlockParam({ result: result3 }, toolUseID) { + mapToolResultToToolResultBlockParam({ result: result2 }, toolUseID) { return { tool_use_id: toolUseID, type: "tool_result", - content: result3 + content: result2 }; } }); }); // src/utils/listSessionsImpl.ts -import { readdir as readdir16, stat as stat28 } from "fs/promises"; -import { basename as basename26, join as join97 } from "path"; +import { readdir as readdir16, stat as stat27 } from "fs/promises"; +import { basename as basename24, join as join87 } from "path"; async function listCandidates(projectDir, doStat, projectPath) { let names; try { @@ -509977,11 +433588,11 @@ async function listCandidates(projectDir, doStat, projectPath) { const sessionId = validateUuid(name.slice(0, -6)); if (!sessionId) return null; - const filePath = join97(projectDir, name); + const filePath = join87(projectDir, name); if (!doStat) return { sessionId, filePath, mtime: 0, projectPath }; try { - const s = await stat28(filePath); + const s = await stat27(filePath); return { sessionId, filePath, mtime: s.mtime.getTime(), projectPath }; } catch { return null; @@ -509995,25 +433606,25 @@ var init_listSessionsImpl = __esm(() => { }); // src/services/autoDream/consolidationLock.ts -import { mkdir as mkdir24, readFile as readFile26, stat as stat29, unlink as unlink13, utimes, writeFile as writeFile26 } from "fs/promises"; -import { join as join98 } from "path"; +import { mkdir as mkdir24, readFile as readFile25, stat as stat28, unlink as unlink13, utimes, writeFile as writeFile24 } from "fs/promises"; +import { join as join88 } from "path"; function lockPath() { - return join98(getAutoMemPath(), LOCK_FILE); + return join88(getAutoMemPath(), LOCK_FILE); } async function readLastConsolidatedAt() { try { - const s = await stat29(lockPath()); + const s = await stat28(lockPath()); return s.mtimeMs; } catch { return 0; } } async function tryAcquireConsolidationLock() { - const path20 = lockPath(); + const path15 = lockPath(); let mtimeMs; let holderPid; try { - const [s, raw] = await Promise.all([stat29(path20), readFile26(path20, "utf8")]); + const [s, raw] = await Promise.all([stat28(path15), readFile25(path15, "utf8")]); mtimeMs = s.mtimeMs; const parsed = parseInt(raw.trim(), 10); holderPid = Number.isFinite(parsed) ? parsed : undefined; @@ -510025,10 +433636,10 @@ async function tryAcquireConsolidationLock() { } } await mkdir24(getAutoMemPath(), { recursive: true }); - await writeFile26(path20, String(process.pid)); + await writeFile24(path15, String(process.pid)); let verify; try { - verify = await readFile26(path20, "utf8"); + verify = await readFile25(path15, "utf8"); } catch { return null; } @@ -510037,15 +433648,15 @@ async function tryAcquireConsolidationLock() { return mtimeMs ?? 0; } async function rollbackConsolidationLock(priorMtime) { - const path20 = lockPath(); + const path15 = lockPath(); try { if (priorMtime === 0) { - await unlink13(path20); + await unlink13(path15); return; } - await writeFile26(path20, ""); + await writeFile24(path15, ""); const t = priorMtime / 1000; - await utimes(path20, t, t); + await utimes(path15, t, t); } catch (e) { logForDebugging(`[autoDream] rollback failed: ${e.message} — next trigger delayed to minHours`); } @@ -510319,8 +433930,8 @@ var init_TaskStopTool = __esm(() => { isConcurrencySafe() { return true; }, - toAutoClassifierInput(input11) { - return input11.task_id ?? input11.shell_id ?? ""; + toAutoClassifierInput(input) { + return input.task_id ?? input.shell_id ?? ""; }, async validateInput({ task_id, shell_id }, { getAppState }) { const id = task_id ?? shell_id; @@ -510369,16 +433980,16 @@ var init_TaskStopTool = __esm(() => { if (!id) { throw new Error("Missing required parameter: task_id"); } - const result3 = await stopTask(id, { + const result2 = await stopTask(id, { getAppState, setAppState }); return { data: { - message: `Successfully stopped task: ${result3.taskId} (${result3.command})`, - task_id: result3.taskId, - task_type: result3.taskType, - command: result3.command + message: `Successfully stopped task: ${result2.taskId} (${result2.command})`, + task_id: result2.taskId, + task_type: result2.taskType, + command: result2.command } }; } @@ -510407,7 +434018,7 @@ function getBridgeBaseUrl() { } var init_bridgeConfig = __esm(() => { init_oauth(); - init_auth2(); + init_auth(); }); // src/tools/BriefTool/upload.ts @@ -510416,8 +434027,8 @@ __export(exports_upload, { uploadBriefAttachment: () => uploadBriefAttachment }); import { randomUUID as randomUUID19 } from "crypto"; -import { readFile as readFile27 } from "fs/promises"; -import { basename as basename27, extname as extname12 } from "path"; +import { readFile as readFile26 } from "fs/promises"; +import { basename as basename25, extname as extname12 } from "path"; function guessMimeType(filename) { const ext = extname12(filename).toLowerCase(); return MIME_BY_EXT[ext] ?? "application/octet-stream"; @@ -510428,12 +434039,12 @@ function debug(msg) { function getBridgeBaseUrl2() { return getBridgeBaseUrlOverride() ?? process.env.ANTHROPIC_BASE_URL ?? getOauthConfig().BASE_API_URL; } -async function uploadBriefAttachment(fullPath, size3, ctx) { +async function uploadBriefAttachment(fullPath, size2, ctx) { if (feature("BRIDGE_MODE")) { if (!ctx.replBridgeEnabled) return; - if (size3 > MAX_UPLOAD_BYTES) { - debug(`skip ${fullPath}: ${size3} bytes exceeds ${MAX_UPLOAD_BYTES} limit`); + if (size2 > MAX_UPLOAD_BYTES) { + debug(`skip ${fullPath}: ${size2} bytes exceeds ${MAX_UPLOAD_BYTES} limit`); return; } const token = getBridgeAccessToken(); @@ -510443,14 +434054,14 @@ async function uploadBriefAttachment(fullPath, size3, ctx) { } let content; try { - content = await readFile27(fullPath); + content = await readFile26(fullPath); } catch (e) { debug(`read failed for ${fullPath}: ${e}`); return; } const baseUrl = getBridgeBaseUrl2(); const url3 = `${baseUrl}/api/oauth/file_upload`; - const filename = basename27(fullPath); + const filename = basename25(fullPath); const mimeType = guessMimeType(filename); const boundary = `----FormBoundary${randomUUID19()}`; const body = Buffer.concat([ @@ -510484,7 +434095,7 @@ async function uploadBriefAttachment(fullPath, size3, ctx) { debug(`unexpected response shape for ${fullPath}: ${parsed.error.message}`); return; } - debug(`uploaded ${fullPath} → ${parsed.data.file_uuid} (${size3} bytes)`); + debug(`uploaded ${fullPath} → ${parsed.data.file_uuid} (${size2} bytes)`); return parsed.data.file_uuid; } catch (e) { debug(`upload threw for ${fullPath}: ${e}`); @@ -510514,13 +434125,13 @@ var init_upload = __esm(() => { }); // src/tools/BriefTool/attachments.ts -import { stat as stat30 } from "fs/promises"; +import { stat as stat29 } from "fs/promises"; async function validateAttachmentPaths(rawPaths) { const cwd2 = getCwd(); for (const rawPath of rawPaths) { const fullPath = expandPath(rawPath); try { - const stats = await stat30(fullPath); + const stats = await stat29(fullPath); if (!stats.isFile()) { return { result: false, @@ -510553,7 +434164,7 @@ async function resolveAttachments(rawPaths, uploadCtx) { const stated = []; for (const rawPath of rawPaths) { const fullPath = expandPath(rawPath); - const stats = await stat30(fullPath); + const stats = await stat29(fullPath); stated.push({ path: fullPath, size: stats.size, @@ -510567,7 +434178,7 @@ async function resolveAttachments(rawPaths, uploadCtx) { replBridgeEnabled: shouldUpload, signal: uploadCtx.signal }))); - return stated.map((a2, i4) => uuids[i4] === undefined ? a2 : { ...a2, file_uuid: uuids[i4] }); + return stated.map((a2, i3) => uuids[i3] === undefined ? a2 : { ...a2, file_uuid: uuids[i3] }); } return stated; } @@ -510807,8 +434418,8 @@ var init_BriefTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.message; + toAutoClassifierInput(input) { + return input.message; }, async validateInput({ attachments }, _context) { if (!attachments || attachments.length === 0) { @@ -510856,8 +434467,8 @@ var init_BriefTool = __esm(() => { // src/utils/task/outputFormatting.ts function getMaxTaskOutputLength() { - const result3 = validateBoundedIntEnvVar("TASK_MAX_OUTPUT_LENGTH", process.env.TASK_MAX_OUTPUT_LENGTH, TASK_MAX_OUTPUT_DEFAULT, TASK_MAX_OUTPUT_UPPER_LIMIT); - return result3.effective; + const result2 = validateBoundedIntEnvVar("TASK_MAX_OUTPUT_LENGTH", process.env.TASK_MAX_OUTPUT_LENGTH, TASK_MAX_OUTPUT_DEFAULT, TASK_MAX_OUTPUT_UPPER_LIMIT); + return result2.effective; } function formatTaskOutput(output, taskId) { const maxLen = getMaxTaskOutputLength(); @@ -510944,7 +434555,7 @@ async function waitForTaskCompletion(taskId, getAppState, timeoutMs, abortContro if (task.status !== "running" && task.status !== "pending") { return task; } - await sleep4(100); + await sleep2(100); } const finalState = getAppState(); return finalState.tasks?.[taskId] ?? null; @@ -510966,8 +434577,8 @@ function TaskOutputResultDisplay(t0) { } else { t2 = $2[1]; } - const result3 = t2; - if (!result3.task) { + const result2 = t2; + if (!result2.task) { let t32; if ($2[2] === Symbol.for("react.memo_cache_sentinel")) { t32 = /* @__PURE__ */ jsx_dev_runtime135.jsxDEV(MessageResponse, { @@ -510984,7 +434595,7 @@ function TaskOutputResultDisplay(t0) { } const { task - } = result3; + } = result2; if (task.task_type === "local_bash") { let t32; if ($2[3] !== task.error || $2[4] !== task.output) { @@ -511019,7 +434630,7 @@ function TaskOutputResultDisplay(t0) { if (task.task_type === "local_agent") { const lineCount = task.result ? countCharInString(task.result, ` `) + 1 : 0; - if (result3.retrieval_status === "success") { + if (result2.retrieval_status === "success") { if (verbose) { let t34; if ($2[9] !== lineCount || $2[10] !== task.description) { @@ -511148,7 +434759,7 @@ function TaskOutputResultDisplay(t0) { } return t33; } - if (result3.retrieval_status === "timeout" || task.status === "running") { + if (result2.retrieval_status === "timeout" || task.status === "running") { let t33; if ($2[29] === Symbol.for("react.memo_cache_sentinel")) { t33 = /* @__PURE__ */ jsx_dev_runtime135.jsxDEV(MessageResponse, { @@ -511163,7 +434774,7 @@ function TaskOutputResultDisplay(t0) { } return t33; } - if (result3.retrieval_status === "not_ready") { + if (result2.retrieval_status === "not_ready") { let t33; if ($2[30] === Symbol.for("react.memo_cache_sentinel")) { t33 = /* @__PURE__ */ jsx_dev_runtime135.jsxDEV(MessageResponse, { @@ -511320,7 +434931,7 @@ var init_TaskOutputTool = __esm(() => { init_useShortcutDisplay(); init_Tool(); init_errors(); - init_messages5(); + init_messages3(); init_semanticBoolean(); init_slowOperations(); init_stringUtils(); @@ -511359,8 +434970,8 @@ var init_TaskOutputTool = __esm(() => { isReadOnly(_input) { return true; }, - toAutoClassifierInput(input11) { - return input11.task_id; + toAutoClassifierInput(input) { + return input.task_id; }, async prompt() { return `DEPRECATED: Prefer using the Read tool on the task's output file path instead. Background tasks return their output file path in the tool result, and you receive a with the same path when the task completes — Read that file directly. @@ -511398,12 +435009,12 @@ var init_TaskOutputTool = __esm(() => { result: true }; }, - async call(input11, toolUseContext, _canUseTool, _parentMessage, onProgress) { + async call(input, toolUseContext, _canUseTool, _parentMessage, onProgress) { const { task_id, block: block2, timeout - } = input11; + } = input; const appState = toolUseContext.getAppState(); const task = appState.tasks?.[task_id]; if (!task) { @@ -511497,24 +435108,24 @@ ${content.trimEnd()} `) }; }, - renderToolUseMessage(input11) { + renderToolUseMessage(input) { const { block: block2 = true - } = input11; + } = input; if (!block2) { return "non-blocking"; } return ""; }, - renderToolUseTag(input11) { - if (!input11.task_id) { + renderToolUseTag(input) { + if (!input.task_id) { return null; } return /* @__PURE__ */ jsx_dev_runtime135.jsxDEV(ThemedText, { dimColor: true, children: [ " ", - input11.task_id + input.task_id ] }, undefined, true, undefined, this); }, @@ -511556,11 +435167,11 @@ ${content.trimEnd()} renderToolUseRejectedMessage() { return /* @__PURE__ */ jsx_dev_runtime135.jsxDEV(FallbackToolUseRejectedMessage, {}, undefined, false, undefined, this); }, - renderToolUseErrorMessage(result3, { + renderToolUseErrorMessage(result2, { verbose }) { return /* @__PURE__ */ jsx_dev_runtime135.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } @@ -511571,10 +435182,10 @@ ${content.trimEnd()} function getSearchSummary(results) { let searchCount = 0; let totalResultCount = 0; - for (const result3 of results) { - if (result3 != null && typeof result3 !== "string") { + for (const result2 of results) { + if (result2 != null && typeof result2 !== "string") { searchCount++; - totalResultCount += result3.content?.length ?? 0; + totalResultCount += result2.content?.length ?? 0; } } return { @@ -511666,11 +435277,11 @@ function renderToolResultMessage13(output) { }, undefined, false, undefined, this) }, undefined, false, undefined, this); } -function getToolUseSummary7(input11) { - if (!input11?.query) { +function getToolUseSummary7(input) { + if (!input?.query) { return null; } - return truncate(input11.query, TOOL_SUMMARY_MAX_LENGTH); + return truncate(input.query, TOOL_SUMMARY_MAX_LENGTH); } var jsx_dev_runtime136; var init_UI13 = __esm(() => { @@ -511682,20 +435293,20 @@ var init_UI13 = __esm(() => { }); // src/tools/WebSearchTool/WebSearchTool.ts -function makeToolSchema(input11) { +function makeToolSchema(input) { return { type: "web_search_20250305", name: "web_search", - allowed_domains: input11.allowed_domains, - blocked_domains: input11.blocked_domains, + allowed_domains: input.allowed_domains, + blocked_domains: input.blocked_domains, max_uses: 8 }; } -function makeOutputFromSearchResponse(result3, query2, durationSeconds) { +function makeOutputFromSearchResponse(result2, query2, durationSeconds) { const results = []; let textAcc = ""; let inText = true; - for (const block2 of result3) { + for (const block2 of result2) { if (block2.type === "server_tool_use") { if (inText) { inText = false; @@ -511745,7 +435356,7 @@ var init_WebSearchTool = __esm(() => { init_claude(); init_Tool(); init_log3(); - init_messages5(); + init_messages3(); init_model(); init_slowOperations(); init_prompt6(); @@ -511775,15 +435386,15 @@ var init_WebSearchTool = __esm(() => { searchHint: "search the web for current information", maxResultSizeChars: 1e5, shouldDefer: true, - async description(input11) { - return `Claude wants to search the web for: ${input11.query}`; + async description(input) { + return `Claude wants to search the web for: ${input.query}`; }, userFacingName() { return "Web Search"; }, getToolUseSummary: getToolUseSummary7, - getActivityDescription(input11) { - const summary = getToolUseSummary7(input11); + getActivityDescription(input) { + const summary = getToolUseSummary7(input); return summary ? `Searching for ${summary}` : "Searching the web"; }, isEnabled() { @@ -511813,8 +435424,8 @@ var init_WebSearchTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.query; + toAutoClassifierInput(input) { + return input.query; }, async checkPermissions(_input) { return { @@ -511839,8 +435450,8 @@ var init_WebSearchTool = __esm(() => { extractSearchText() { return ""; }, - async validateInput(input11) { - const { query: query2, allowed_domains, blocked_domains } = input11; + async validateInput(input) { + const { query: query2, allowed_domains, blocked_domains } = input; if (!query2.length) { return { result: false, @@ -511857,13 +435468,13 @@ var init_WebSearchTool = __esm(() => { } return { result: true }; }, - async call(input11, context, _canUseTool, _parentMessage, onProgress) { + async call(input, context, _canUseTool, _parentMessage, onProgress) { const startTime = performance.now(); - const { query: query2 } = input11; + const { query: query2 } = input; const userMessage = createUserMessage({ content: "Perform a web search for the query: " + query2 }); - const toolSchema = makeToolSchema(input11); + const toolSchema = makeToolSchema(input); const useHaiku = getFeatureValue_CACHED_MAY_BE_STALE("tengu_plum_vx3", false); const appState = context.getAppState(); const queryStream = queryModelWithStreaming({ @@ -511961,17 +435572,17 @@ var init_WebSearchTool = __esm(() => { let formattedOutput = `Web search results for query: "${query2}" `; - (results ?? []).forEach((result3) => { - if (result3 == null) { + (results ?? []).forEach((result2) => { + if (result2 == null) { return; } - if (typeof result3 === "string") { - formattedOutput += result3 + ` + if (typeof result2 === "string") { + formattedOutput += result2 + ` `; } else { - if (result3.content?.length > 0) { - formattedOutput += `Links: ${jsonStringify(result3.content)} + if (result2.content?.length > 0) { + formattedOutput += `Links: ${jsonStringify(result2.content)} `; } else { @@ -512055,10 +435666,10 @@ function renderToolResultMessage14(output, _progressMessagesForMessage, { plan, filePath } = output; - const isEmpty3 = !plan || plan.trim() === ""; + const isEmpty2 = !plan || plan.trim() === ""; const displayPath = filePath ? getDisplayPath(filePath) : ""; const awaitingLeaderApproval = output.awaitingLeaderApproval; - if (isEmpty3) { + if (isEmpty2) { return /* @__PURE__ */ jsx_dev_runtime137.jsxDEV(ThemedBox_default, { flexDirection: "column", marginTop: 1, @@ -512214,7 +435825,7 @@ function _resetForTesting() { var autoModeActive = false, autoModeFlagCli = false, autoModeCircuitBroken = false; // src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts -import { writeFile as writeFile27 } from "fs/promises"; +import { writeFile as writeFile25 } from "fs/promises"; var autoModeStateModule, permissionSetupModule, allowedPromptSchema, inputSchema18, _sdkInputSchema, outputSchema15, ExitPlanModeV2Tool; var init_ExitPlanModeV2Tool = __esm(() => { init_bun_bundle(); @@ -512312,29 +435923,29 @@ var init_ExitPlanModeV2Tool = __esm(() => { } return { result: true }; }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { if (isTeammate()) { return { behavior: "allow", - updatedInput: input11 + updatedInput: input }; } return { behavior: "ask", message: "Exit plan mode?", - updatedInput: input11 + updatedInput: input }; }, renderToolUseMessage: renderToolUseMessage15, renderToolResultMessage: renderToolResultMessage14, renderToolUseRejectedMessage: renderToolUseRejectedMessage6, - async call(input11, context) { + async call(input, context) { const isAgent = !!context.agentId; const filePath = getPlanFilePath(context.agentId); - const inputPlan = "plan" in input11 && typeof input11.plan === "string" ? input11.plan : undefined; + const inputPlan = "plan" in input && typeof input.plan === "string" ? input.plan : undefined; const plan = inputPlan ?? getPlan(context.agentId); if (inputPlan !== undefined && filePath) { - await writeFile27(filePath, inputPlan, "utf-8").catch((e) => logError2(e)); + await writeFile25(filePath, inputPlan, "utf-8").catch((e) => logError2(e)); persistFileSnapshotIfRemote(); } if (isTeammate() && isPlanModeRequired()) { @@ -512555,10 +436166,10 @@ var init_TestingPermissionTool = __esm(() => { data: `${NAME} executed successfully` }; }, - mapToolResultToToolResultBlockParam(result3, toolUseID) { + mapToolResultToToolResultBlockParam(result2, toolUseID) { return { type: "tool_result", - content: String(result3), + content: String(result2), tool_use_id: toolUseID }; } @@ -512752,8 +436363,8 @@ var init_AskUserQuestionTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.questions.map((q) => q.question).join(" | "); + toAutoClassifierInput(input) { + return input.questions.map((q) => q.question).join(" | "); }, requiresUserInteraction() { return true; @@ -512768,11 +436379,11 @@ var init_AskUserQuestionTool = __esm(() => { } for (const q of questions) { for (const opt of q.options) { - const err3 = validateHtmlPreview(opt.preview); - if (err3) { + const err2 = validateHtmlPreview(opt.preview); + if (err2) { return { result: false, - message: `Option "${opt.label}" in question "${q.question}": ${err3}`, + message: `Option "${opt.label}" in question "${q.question}": ${err2}`, errorCode: 1 }; } @@ -512782,11 +436393,11 @@ var init_AskUserQuestionTool = __esm(() => { result: true }; }, - async checkPermissions(input11) { + async checkPermissions(input) { return { behavior: "ask", message: "Answer questions?", - updatedInput: input11 + updatedInput: input }; }, renderToolUseMessage() { @@ -512864,7 +436475,7 @@ ${annotation.preview}`); }); // src/tools/LSPTool/formatters.ts -import { relative as relative20 } from "path"; +import { relative as relative18 } from "path"; function formatUri2(uri, cwd2) { if (!uri) { logForDebugging("formatUri called with undefined URI - indicates malformed LSP server response", { level: "warn" }); @@ -512876,12 +436487,12 @@ function formatUri2(uri, cwd2) { } try { filePath = decodeURIComponent(filePath); - } catch (error45) { - const errorMsg = errorMessage(error45); + } catch (error41) { + const errorMsg = errorMessage(error41); logForDebugging(`Failed to decode LSP URI '${uri}': ${errorMsg}. Using un-decoded path: ${filePath}`, { level: "warn" }); } if (cwd2) { - const relativePath = relative20(cwd2, filePath).replaceAll("\\", "/"); + const relativePath = relative18(cwd2, filePath).replaceAll("\\", "/"); if (relativePath.length < filePath.length && !relativePath.startsWith("../../")) { return relativePath; } @@ -512917,12 +436528,12 @@ function locationLinkToLocation(link5) { function isLocationLink(item) { return "targetUri" in item; } -function formatGoToDefinitionResult(result3, cwd2) { - if (!result3) { +function formatGoToDefinitionResult(result2, cwd2) { + if (!result2) { return "No definition found. This may occur if the cursor is not on a symbol, or if the definition is in an external library not indexed by the LSP server."; } - if (Array.isArray(result3)) { - const locations = result3.map((item) => isLocationLink(item) ? locationLinkToLocation(item) : item); + if (Array.isArray(result2)) { + const locations = result2.map((item) => isLocationLink(item) ? locationLinkToLocation(item) : item); const invalidLocations = locations.filter((loc) => !loc || !loc.uri); if (invalidLocations.length > 0) { logForDebugging(`formatGoToDefinitionResult: Filtering out ${invalidLocations.length} invalid location(s) - this should have been caught earlier`, { level: "warn" }); @@ -512939,18 +436550,18 @@ function formatGoToDefinitionResult(result3, cwd2) { return `Found ${validLocations.length} definitions: ${locationList}`; } - const location = isLocationLink(result3) ? locationLinkToLocation(result3) : result3; + const location = isLocationLink(result2) ? locationLinkToLocation(result2) : result2; return `Defined in ${formatLocation(location, cwd2)}`; } -function formatFindReferencesResult(result3, cwd2) { - if (!result3 || result3.length === 0) { +function formatFindReferencesResult(result2, cwd2) { + if (!result2 || result2.length === 0) { return "No references found. This may occur if the symbol has no usages, or if the LSP server has not fully indexed the workspace."; } - const invalidLocations = result3.filter((loc) => !loc || !loc.uri); + const invalidLocations = result2.filter((loc) => !loc || !loc.uri); if (invalidLocations.length > 0) { logForDebugging(`formatFindReferencesResult: Filtering out ${invalidLocations.length} invalid location(s) - this should have been caught earlier`, { level: "warn" }); } - const validLocations = result3.filter((loc) => loc && loc.uri); + const validLocations = result2.filter((loc) => loc && loc.uri); if (validLocations.length === 0) { return "No references found. This may occur if the symbol has no usages, or if the LSP server has not fully indexed the workspace."; } @@ -512993,14 +436604,14 @@ function extractMarkupText(contents) { } return contents.value; } -function formatHoverResult(result3, _cwd) { - if (!result3) { +function formatHoverResult(result2, _cwd) { + if (!result2) { return "No hover information available. This may occur if the cursor is not on a symbol, or if the LSP server has not fully indexed the file."; } - const content = extractMarkupText(result3.contents); - if (result3.range) { - const line = result3.range.start.line + 1; - const character = result3.range.start.character + 1; + const content = extractMarkupText(result2.contents); + if (result2.range) { + const line = result2.range.start.line + 1; + const character = result2.range.start.character + 1; return `Hover info at ${line}:${character}: ${content}`; @@ -513056,31 +436667,31 @@ function formatDocumentSymbolNode(symbol2, indent = 0) { } return lines; } -function formatDocumentSymbolResult(result3, cwd2) { - if (!result3 || result3.length === 0) { +function formatDocumentSymbolResult(result2, cwd2) { + if (!result2 || result2.length === 0) { return "No symbols found in document. This may occur if the file is empty, not supported by the LSP server, or if the server has not fully indexed the file."; } - const firstSymbol = result3[0]; + const firstSymbol = result2[0]; const isSymbolInformation = firstSymbol && "location" in firstSymbol; if (isSymbolInformation) { - return formatWorkspaceSymbolResult(result3, cwd2); + return formatWorkspaceSymbolResult(result2, cwd2); } const lines = ["Document symbols:"]; - for (const symbol2 of result3) { + for (const symbol2 of result2) { lines.push(...formatDocumentSymbolNode(symbol2)); } return lines.join(` `); } -function formatWorkspaceSymbolResult(result3, cwd2) { - if (!result3 || result3.length === 0) { +function formatWorkspaceSymbolResult(result2, cwd2) { + if (!result2 || result2.length === 0) { return "No symbols found in workspace. This may occur if the workspace is empty, or if the LSP server has not finished indexing the project."; } - const invalidSymbols = result3.filter((sym) => !sym || !sym.location || !sym.location.uri); + const invalidSymbols = result2.filter((sym) => !sym || !sym.location || !sym.location.uri); if (invalidSymbols.length > 0) { logForDebugging(`formatWorkspaceSymbolResult: Filtering out ${invalidSymbols.length} invalid symbol(s) - this should have been caught earlier`, { level: "warn" }); } - const validSymbols = result3.filter((sym) => sym && sym.location && sym.location.uri); + const validSymbols = result2.filter((sym) => sym && sym.location && sym.location.uri); if (validSymbols.length === 0) { return "No symbols found in workspace. This may occur if the workspace is empty, or if the LSP server has not finished indexing the project."; } @@ -513112,35 +436723,35 @@ function formatCallHierarchyItem(item, cwd2) { const filePath = formatUri2(item.uri, cwd2); const line = item.range.start.line + 1; const kind = symbolKindToString(item.kind); - let result3 = `${item.name} (${kind}) - ${filePath}:${line}`; + let result2 = `${item.name} (${kind}) - ${filePath}:${line}`; if (item.detail) { - result3 += ` [${item.detail}]`; + result2 += ` [${item.detail}]`; } - return result3; + return result2; } -function formatPrepareCallHierarchyResult(result3, cwd2) { - if (!result3 || result3.length === 0) { +function formatPrepareCallHierarchyResult(result2, cwd2) { + if (!result2 || result2.length === 0) { return "No call hierarchy item found at this position"; } - if (result3.length === 1) { - return `Call hierarchy item: ${formatCallHierarchyItem(result3[0], cwd2)}`; + if (result2.length === 1) { + return `Call hierarchy item: ${formatCallHierarchyItem(result2[0], cwd2)}`; } - const lines = [`Found ${result3.length} call hierarchy items:`]; - for (const item of result3) { + const lines = [`Found ${result2.length} call hierarchy items:`]; + for (const item of result2) { lines.push(` ${formatCallHierarchyItem(item, cwd2)}`); } return lines.join(` `); } -function formatIncomingCallsResult(result3, cwd2) { - if (!result3 || result3.length === 0) { +function formatIncomingCallsResult(result2, cwd2) { + if (!result2 || result2.length === 0) { return "No incoming calls found (nothing calls this function)"; } const lines = [ - `Found ${result3.length} incoming ${plural(result3.length, "call")}:` + `Found ${result2.length} incoming ${plural(result2.length, "call")}:` ]; const byFile = new Map; - for (const call5 of result3) { + for (const call5 of result2) { if (!call5.from) { logForDebugging("formatIncomingCallsResult: CallHierarchyIncomingCall has undefined from field", { level: "warn" }); continue; @@ -513173,15 +436784,15 @@ ${filePath}:`); return lines.join(` `); } -function formatOutgoingCallsResult(result3, cwd2) { - if (!result3 || result3.length === 0) { +function formatOutgoingCallsResult(result2, cwd2) { + if (!result2 || result2.length === 0) { return "No outgoing calls found (this function calls nothing)"; } const lines = [ - `Found ${result3.length} outgoing ${plural(result3.length, "call")}:` + `Found ${result2.length} outgoing ${plural(result2.length, "call")}:` ]; const byFile = new Map; - for (const call5 of result3) { + for (const call5 of result2) { if (!call5.to) { logForDebugging("formatOutgoingCallsResult: CallHierarchyOutgoingCall has undefined to field", { level: "warn" }); continue; @@ -513243,7 +436854,7 @@ Note: LSP servers must be configured for the file type. If no server is availabl // src/tools/LSPTool/schemas.ts var lspToolInputSchema; -var init_schemas6 = __esm(() => { +var init_schemas5 = __esm(() => { init_v4(); lspToolInputSchema = lazySchema(() => { const goToDefinitionSchema = exports_external.strictObject({ @@ -513317,9 +436928,9 @@ var init_schemas6 = __esm(() => { // src/tools/LSPTool/symbolContext.ts function getSymbolAtPosition(filePath, line, character) { try { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const absolutePath = expandPath(filePath); - const { buffer, bytesRead } = fs11.readSync(absolutePath, { + const { buffer, bytesRead } = fs5.readSync(absolutePath, { length: MAX_READ_BYTES }); const content = buffer.toString("utf-8", 0, bytesRead); @@ -513346,9 +436957,9 @@ function getSymbolAtPosition(filePath, line, character) { } } return null; - } catch (error45) { - if (error45 instanceof Error) { - logForDebugging(`Symbol extraction failed for ${filePath}:${line}:${character}: ${error45.message}`, { level: "warn" }); + } catch (error41) { + if (error41 instanceof Error) { + logForDebugging(`Symbol extraction failed for ${filePath}:${line}:${character}: ${error41.message}`, { level: "warn" }); } return null; } @@ -513528,38 +437139,38 @@ function LSPResultSummary(t0) { function userFacingName5() { return "LSP"; } -function renderToolUseMessage16(input11, { +function renderToolUseMessage16(input, { verbose }) { - if (!input11.operation) { + if (!input.operation) { return null; } const parts = []; - if ((input11.operation === "goToDefinition" || input11.operation === "findReferences" || input11.operation === "hover" || input11.operation === "goToImplementation") && input11.filePath && input11.line !== undefined && input11.character !== undefined) { - const symbol2 = getSymbolAtPosition(input11.filePath, input11.line - 1, input11.character - 1); - const displayPath = verbose ? input11.filePath : getDisplayPath(input11.filePath); + if ((input.operation === "goToDefinition" || input.operation === "findReferences" || input.operation === "hover" || input.operation === "goToImplementation") && input.filePath && input.line !== undefined && input.character !== undefined) { + const symbol2 = getSymbolAtPosition(input.filePath, input.line - 1, input.character - 1); + const displayPath = verbose ? input.filePath : getDisplayPath(input.filePath); if (symbol2) { - parts.push(`operation: "${input11.operation}"`); + parts.push(`operation: "${input.operation}"`); parts.push(`symbol: "${symbol2}"`); parts.push(`in: "${displayPath}"`); } else { - parts.push(`operation: "${input11.operation}"`); + parts.push(`operation: "${input.operation}"`); parts.push(`file: "${displayPath}"`); - parts.push(`position: ${input11.line}:${input11.character}`); + parts.push(`position: ${input.line}:${input.character}`); } return parts.join(", "); } - parts.push(`operation: "${input11.operation}"`); - if (input11.filePath) { - const displayPath = verbose ? input11.filePath : getDisplayPath(input11.filePath); + parts.push(`operation: "${input.operation}"`); + if (input.filePath) { + const displayPath = verbose ? input.filePath : getDisplayPath(input.filePath); parts.push(`file: "${displayPath}"`); } return parts.join(", "); } -function renderToolUseErrorMessage10(result3, { +function renderToolUseErrorMessage10(result2, { verbose }) { - if (!verbose && typeof result3 === "string" && extractTag(result3, "tool_use_error")) { + if (!verbose && typeof result2 === "string" && extractTag(result2, "tool_use_error")) { return /* @__PURE__ */ jsx_dev_runtime139.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime139.jsxDEV(ThemedText, { color: "error", @@ -513568,7 +437179,7 @@ function renderToolUseErrorMessage10(result3, { }, undefined, false, undefined, this); } return /* @__PURE__ */ jsx_dev_runtime139.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } @@ -513598,7 +437209,7 @@ var init_UI15 = __esm(() => { init_MessageResponse(); init_ink2(); init_file(); - init_messages5(); + init_messages3(); init_symbolContext(); jsx_dev_runtime139 = __toESM(require_jsx_dev_runtime(), 1); OPERATION_LABELS = { @@ -513644,15 +437255,15 @@ var init_UI15 = __esm(() => { // src/tools/LSPTool/LSPTool.ts import { open as open11 } from "fs/promises"; -import * as path20 from "path"; +import * as path15 from "path"; import { pathToFileURL as pathToFileURL6 } from "url"; -function getMethodAndParams(input11, absolutePath) { +function getMethodAndParams(input, absolutePath) { const uri = pathToFileURL6(absolutePath).href; const position = { - line: input11.line - 1, - character: input11.character - 1 + line: input.line - 1, + character: input.character - 1 }; - switch (input11.operation) { + switch (input.operation) { case "goToDefinition": return { method: "textDocument/definition", @@ -513764,15 +437375,15 @@ async function filterGitIgnoredLocations(locations, cwd2) { } const ignoredPaths = new Set; const BATCH_SIZE = 50; - for (let i4 = 0;i4 < uniquePaths.length; i4 += BATCH_SIZE) { - const batch = uniquePaths.slice(i4, i4 + BATCH_SIZE); - const result3 = await execFileNoThrowWithCwd("git", ["check-ignore", ...batch], { + for (let i3 = 0;i3 < uniquePaths.length; i3 += BATCH_SIZE) { + const batch = uniquePaths.slice(i3, i3 + BATCH_SIZE); + const result2 = await execFileNoThrowWithCwd("git", ["check-ignore", ...batch], { cwd: cwd2, preserveOutputOnError: false, timeout: 5000 }); - if (result3.code === 0 && result3.stdout) { - for (const line of result3.stdout.split(` + if (result2.code === 0 && result2.stdout) { + for (const line of result2.stdout.split(` `)) { const trimmed = line.trim(); if (trimmed) { @@ -513801,10 +437412,10 @@ function toLocation(item) { } return item; } -function formatResult(operation, result3, cwd2) { +function formatResult(operation, result2, cwd2) { switch (operation) { case "goToDefinition": { - const rawResults = Array.isArray(result3) ? result3 : result3 ? [result3] : []; + const rawResults = Array.isArray(result2) ? result2 : result2 ? [result2] : []; const locations = rawResults.map(toLocation); const invalidLocations = locations.filter((loc) => !loc || !loc.uri); if (invalidLocations.length > 0) { @@ -513812,43 +437423,43 @@ function formatResult(operation, result3, cwd2) { } const validLocations = locations.filter((loc) => loc && loc.uri); return { - formatted: formatGoToDefinitionResult(result3, cwd2), + formatted: formatGoToDefinitionResult(result2, cwd2), resultCount: validLocations.length, fileCount: countUniqueFiles(validLocations) }; } case "findReferences": { - const locations = result3 || []; + const locations = result2 || []; const invalidLocations = locations.filter((loc) => !loc || !loc.uri); if (invalidLocations.length > 0) { logError2(new Error(`LSP server returned ${invalidLocations.length} location(s) with undefined URI for findReferences on ${cwd2}. ` + `This indicates malformed data from the LSP server.`)); } const validLocations = locations.filter((loc) => loc && loc.uri); return { - formatted: formatFindReferencesResult(result3, cwd2), + formatted: formatFindReferencesResult(result2, cwd2), resultCount: validLocations.length, fileCount: countUniqueFiles(validLocations) }; } case "hover": { return { - formatted: formatHoverResult(result3, cwd2), - resultCount: result3 ? 1 : 0, - fileCount: result3 ? 1 : 0 + formatted: formatHoverResult(result2, cwd2), + resultCount: result2 ? 1 : 0, + fileCount: result2 ? 1 : 0 }; } case "documentSymbol": { - const symbols = result3 || []; + const symbols = result2 || []; const isDocumentSymbol = symbols.length > 0 && symbols[0] && "range" in symbols[0]; const count3 = isDocumentSymbol ? countSymbols(symbols) : symbols.length; return { - formatted: formatDocumentSymbolResult(result3, cwd2), + formatted: formatDocumentSymbolResult(result2, cwd2), resultCount: count3, fileCount: symbols.length > 0 ? 1 : 0 }; } case "workspaceSymbol": { - const symbols = result3 || []; + const symbols = result2 || []; const invalidSymbols = symbols.filter((sym) => !sym || !sym.location || !sym.location.uri); if (invalidSymbols.length > 0) { logError2(new Error(`LSP server returned ${invalidSymbols.length} symbol(s) with undefined location URI for workspaceSymbol on ${cwd2}. ` + `This indicates malformed data from the LSP server.`)); @@ -513856,13 +437467,13 @@ function formatResult(operation, result3, cwd2) { const validSymbols = symbols.filter((sym) => sym && sym.location && sym.location.uri); const locations = validSymbols.map((s) => s.location); return { - formatted: formatWorkspaceSymbolResult(result3, cwd2), + formatted: formatWorkspaceSymbolResult(result2, cwd2), resultCount: validSymbols.length, fileCount: countUniqueFiles(locations) }; } case "goToImplementation": { - const rawResults = Array.isArray(result3) ? result3 : result3 ? [result3] : []; + const rawResults = Array.isArray(result2) ? result2 : result2 ? [result2] : []; const locations = rawResults.map(toLocation); const invalidLocations = locations.filter((loc) => !loc || !loc.uri); if (invalidLocations.length > 0) { @@ -513870,31 +437481,31 @@ function formatResult(operation, result3, cwd2) { } const validLocations = locations.filter((loc) => loc && loc.uri); return { - formatted: formatGoToDefinitionResult(result3, cwd2), + formatted: formatGoToDefinitionResult(result2, cwd2), resultCount: validLocations.length, fileCount: countUniqueFiles(validLocations) }; } case "prepareCallHierarchy": { - const items = result3 || []; + const items = result2 || []; return { - formatted: formatPrepareCallHierarchyResult(result3, cwd2), + formatted: formatPrepareCallHierarchyResult(result2, cwd2), resultCount: items.length, fileCount: items.length > 0 ? countUniqueFilesFromCallItems(items) : 0 }; } case "incomingCalls": { - const calls = result3 || []; + const calls = result2 || []; return { - formatted: formatIncomingCallsResult(result3, cwd2), + formatted: formatIncomingCallsResult(result2, cwd2), resultCount: calls.length, fileCount: calls.length > 0 ? countUniqueFilesFromIncomingCalls(calls) : 0 }; } case "outgoingCalls": { - const calls = result3 || []; + const calls = result2 || []; return { - formatted: formatOutgoingCallsResult(result3, cwd2), + formatted: formatOutgoingCallsResult(result2, cwd2), resultCount: calls.length, fileCount: calls.length > 0 ? countUniqueFilesFromOutgoingCalls(calls) : 0 }; @@ -513927,7 +437538,7 @@ var init_LSPTool = __esm(() => { init_path2(); init_filesystem(); init_formatters(); - init_schemas6(); + init_schemas5(); init_UI15(); inputSchema21 = lazySchema(() => exports_external.strictObject({ operation: exports_external.enum([ @@ -513990,8 +437601,8 @@ var init_LSPTool = __esm(() => { getPath({ filePath }) { return expandPath(filePath); }, - async validateInput(input11) { - const parseResult = lspToolInputSchema().safeParse(input11); + async validateInput(input) { + const parseResult = lspToolInputSchema().safeParse(input); if (!parseResult.success) { return { result: false, @@ -513999,42 +437610,42 @@ var init_LSPTool = __esm(() => { errorCode: 3 }; } - const fs11 = getFsImplementation(); - const absolutePath = expandPath(input11.filePath); + const fs5 = getFsImplementation(); + const absolutePath = expandPath(input.filePath); if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) { return { result: true }; } let stats; try { - stats = await fs11.stat(absolutePath); - } catch (error45) { - if (isENOENT(error45)) { + stats = await fs5.stat(absolutePath); + } catch (error41) { + if (isENOENT(error41)) { return { result: false, - message: `File does not exist: ${input11.filePath}`, + message: `File does not exist: ${input.filePath}`, errorCode: 1 }; } - const err3 = toError(error45); - logError2(new Error(`Failed to access file stats for LSP operation on ${input11.filePath}: ${err3.message}`)); + const err2 = toError(error41); + logError2(new Error(`Failed to access file stats for LSP operation on ${input.filePath}: ${err2.message}`)); return { result: false, - message: `Cannot access file: ${input11.filePath}. ${err3.message}`, + message: `Cannot access file: ${input.filePath}. ${err2.message}`, errorCode: 4 }; } if (!stats.isFile()) { return { result: false, - message: `Path is not a file: ${input11.filePath}`, + message: `Path is not a file: ${input.filePath}`, errorCode: 2 }; } return { result: true }; }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); - return checkReadPermissionForTool(LSPTool, input11, appState.toolPermissionContext); + return checkReadPermissionForTool(LSPTool, input, appState.toolPermissionContext); }, async prompt() { return DESCRIPTION9; @@ -514042,8 +437653,8 @@ var init_LSPTool = __esm(() => { renderToolUseMessage: renderToolUseMessage16, renderToolUseErrorMessage: renderToolUseErrorMessage10, renderToolResultMessage: renderToolResultMessage15, - async call(input11, _context) { - const absolutePath = expandPath(input11.filePath); + async call(input, _context) { + const absolutePath = expandPath(input.filePath); const cwd2 = getCwd(); const status = getInitializationStatus(); if (status.status === "pending") { @@ -514053,15 +437664,15 @@ var init_LSPTool = __esm(() => { if (!manager) { logError2(new Error("LSP server manager not initialized when tool was called")); const output = { - operation: input11.operation, + operation: input.operation, result: "LSP server manager not initialized. This may indicate a startup issue.", - filePath: input11.filePath + filePath: input.filePath }; return { data: output }; } - const { method: method3, params } = getMethodAndParams(input11, absolutePath); + const { method: method2, params } = getMethodAndParams(input, absolutePath); try { if (!manager.isFileOpen(absolutePath)) { const handle = await open11(absolutePath, "r"); @@ -514069,9 +437680,9 @@ var init_LSPTool = __esm(() => { const stats = await handle.stat(); if (stats.size > MAX_LSP_FILE_SIZE_BYTES) { const output2 = { - operation: input11.operation, + operation: input.operation, result: `File too large for LSP analysis (${Math.ceil(stats.size / 1e6)}MB exceeds 10MB limit)`, - filePath: input11.filePath + filePath: input.filePath }; return { data: output2 }; } @@ -514081,74 +437692,74 @@ var init_LSPTool = __esm(() => { await handle.close(); } } - let result3 = await manager.sendRequest(absolutePath, method3, params); - if (result3 === undefined) { - logForDebugging(`No LSP server available for file type ${path20.extname(absolutePath)} for operation ${input11.operation} on file ${input11.filePath}`); + let result2 = await manager.sendRequest(absolutePath, method2, params); + if (result2 === undefined) { + logForDebugging(`No LSP server available for file type ${path15.extname(absolutePath)} for operation ${input.operation} on file ${input.filePath}`); const output2 = { - operation: input11.operation, - result: `No LSP server available for file type: ${path20.extname(absolutePath)}`, - filePath: input11.filePath + operation: input.operation, + result: `No LSP server available for file type: ${path15.extname(absolutePath)}`, + filePath: input.filePath }; return { data: output2 }; } - if (input11.operation === "incomingCalls" || input11.operation === "outgoingCalls") { - const callItems = result3; + if (input.operation === "incomingCalls" || input.operation === "outgoingCalls") { + const callItems = result2; if (!callItems || callItems.length === 0) { const output2 = { - operation: input11.operation, + operation: input.operation, result: "No call hierarchy item found at this position", - filePath: input11.filePath, + filePath: input.filePath, resultCount: 0, fileCount: 0 }; return { data: output2 }; } - const callMethod = input11.operation === "incomingCalls" ? "callHierarchy/incomingCalls" : "callHierarchy/outgoingCalls"; - result3 = await manager.sendRequest(absolutePath, callMethod, { + const callMethod = input.operation === "incomingCalls" ? "callHierarchy/incomingCalls" : "callHierarchy/outgoingCalls"; + result2 = await manager.sendRequest(absolutePath, callMethod, { item: callItems[0] }); - if (result3 === undefined) { - logForDebugging(`LSP server returned undefined for ${callMethod} on ${input11.filePath}`); + if (result2 === undefined) { + logForDebugging(`LSP server returned undefined for ${callMethod} on ${input.filePath}`); } } - if (result3 && Array.isArray(result3) && (input11.operation === "findReferences" || input11.operation === "goToDefinition" || input11.operation === "goToImplementation" || input11.operation === "workspaceSymbol")) { - if (input11.operation === "workspaceSymbol") { - const symbols = result3; + if (result2 && Array.isArray(result2) && (input.operation === "findReferences" || input.operation === "goToDefinition" || input.operation === "goToImplementation" || input.operation === "workspaceSymbol")) { + if (input.operation === "workspaceSymbol") { + const symbols = result2; const locations = symbols.filter((s) => s?.location?.uri).map((s) => s.location); const filteredLocations = await filterGitIgnoredLocations(locations, cwd2); const filteredUris = new Set(filteredLocations.map((l) => l.uri)); - result3 = symbols.filter((s) => !s?.location?.uri || filteredUris.has(s.location.uri)); + result2 = symbols.filter((s) => !s?.location?.uri || filteredUris.has(s.location.uri)); } else { - const locations = result3.map(toLocation); + const locations = result2.map(toLocation); const filteredLocations = await filterGitIgnoredLocations(locations, cwd2); const filteredUris = new Set(filteredLocations.map((l) => l.uri)); - result3 = result3.filter((item) => { + result2 = result2.filter((item) => { const loc = toLocation(item); return !loc.uri || filteredUris.has(loc.uri); }); } } - const { formatted, resultCount, fileCount } = formatResult(input11.operation, result3, cwd2); + const { formatted, resultCount, fileCount } = formatResult(input.operation, result2, cwd2); const output = { - operation: input11.operation, + operation: input.operation, result: formatted, - filePath: input11.filePath, + filePath: input.filePath, resultCount, fileCount }; return { data: output }; - } catch (error45) { - const err3 = toError(error45); - const errorMessage2 = err3.message; - logError2(new Error(`LSP tool request failed for ${input11.operation} on ${input11.filePath}: ${errorMessage2}`)); + } catch (error41) { + const err2 = toError(error41); + const errorMessage2 = err2.message; + logError2(new Error(`LSP tool request failed for ${input.operation} on ${input.filePath}: ${errorMessage2}`)); const output = { - operation: input11.operation, - result: `Error performing ${input11.operation}: ${errorMessage2}`, - filePath: input11.filePath + operation: input.operation, + result: `Error performing ${input.operation}: ${errorMessage2}`, + filePath: input.filePath }; return { data: output @@ -514182,11 +437793,11 @@ Parameters: `; // src/tools/ReadMcpResourceTool/UI.tsx -function renderToolUseMessage17(input11) { - if (!input11.uri || !input11.server) { +function renderToolUseMessage17(input) { + if (!input.uri || !input.server) { return null; } - return `Read resource "${input11.uri}" from server "${input11.server}"`; + return `Read resource "${input.uri}" from server "${input.server}"`; } function userFacingName6() { return "readMcpResource"; @@ -514228,7 +437839,7 @@ var inputSchema22, outputSchema18, ReadMcpResourceTool; var init_ReadMcpResourceTool = __esm(() => { init_types4(); init_v4(); - init_client10(); + init_client6(); init_Tool(); init_mcpOutputStorage(); init_slowOperations(); @@ -514253,8 +437864,8 @@ var init_ReadMcpResourceTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return `${input11.server} ${input11.uri}`; + toAutoClassifierInput(input) { + return `${input.server} ${input.uri}`; }, shouldDefer: true, name: "ReadMcpResourceTool", @@ -514272,31 +437883,31 @@ var init_ReadMcpResourceTool = __esm(() => { get outputSchema() { return outputSchema18(); }, - async call(input11, { options: { mcpClients } }) { - const { server: serverName, uri } = input11; - const client5 = mcpClients.find((client6) => client6.name === serverName); - if (!client5) { + async call(input, { options: { mcpClients } }) { + const { server: serverName, uri } = input; + const client2 = mcpClients.find((client3) => client3.name === serverName); + if (!client2) { throw new Error(`Server "${serverName}" not found. Available servers: ${mcpClients.map((c6) => c6.name).join(", ")}`); } - if (client5.type !== "connected") { + if (client2.type !== "connected") { throw new Error(`Server "${serverName}" is not connected`); } - if (!client5.capabilities?.resources) { + if (!client2.capabilities?.resources) { throw new Error(`Server "${serverName}" does not support resources`); } - const connectedClient = await ensureConnectedClient(client5); - const result3 = await connectedClient.client.request({ + const connectedClient = await ensureConnectedClient(client2); + const result2 = await connectedClient.client.request({ method: "resources/read", params: { uri } }, ReadResourceResultSchema); - const contents = await Promise.all(result3.contents.map(async (c6, i4) => { + const contents = await Promise.all(result2.contents.map(async (c6, i3) => { if ("text" in c6) { return { uri: c6.uri, mimeType: c6.mimeType, text: c6.text }; } if (!("blob" in c6) || typeof c6.blob !== "string") { return { uri: c6.uri, mimeType: c6.mimeType }; } - const persistId = `mcp-resource-${Date.now()}-${i4}-${Math.random().toString(36).slice(2, 8)}`; + const persistId = `mcp-resource-${Date.now()}-${i3}-${Math.random().toString(36).slice(2, 8)}`; const persisted = await persistBinaryContent(Buffer.from(c6.blob, "base64"), c6.mimeType, persistId); if ("error" in persisted) { return { @@ -514362,10 +437973,10 @@ function getPlanModeV2ExploreAgentCount() { function isPlanModeInterviewPhaseEnabled() { if (process.env.USER_TYPE === "ant") return true; - const env5 = process.env.CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE; - if (isEnvTruthy(env5)) + const env4 = process.env.CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE; + if (isEnvTruthy(env4)) return true; - if (isEnvDefinedFalsy(env5)) + if (isEnvDefinedFalsy(env4)) return false; return getFeatureValue_CACHED_MAY_BE_STALE("tengu_plan_mode_interview_phase", false); } @@ -514377,7 +437988,7 @@ function getPewterLedgerVariant() { } var init_planModeV2 = __esm(() => { init_growthbook(); - init_auth2(); + init_auth(); init_envUtils(); }); @@ -514829,12 +438440,12 @@ var init_EnterWorktreeTool = __esm(() => { return "Creating worktree"; }, shouldDefer: true, - toAutoClassifierInput(input11) { - return input11.name ?? ""; + toAutoClassifierInput(input) { + return input.name ?? ""; }, renderToolUseMessage: renderToolUseMessage19, renderToolResultMessage: renderToolResultMessage18, - async call(input11) { + async call(input) { if (getCurrentWorktreeSession()) { throw new Error("Already in a worktree session"); } @@ -514843,7 +438454,7 @@ var init_EnterWorktreeTool = __esm(() => { process.chdir(mainRepoRoot); setCwd(mainRepoRoot); } - const slug = input11.name ?? getPlanSlug(); + const slug = input.name ?? getPlanSlug(); const worktreeSession = await createWorktreeForSession(getSessionId(), slug); process.chdir(worktreeSession.worktreePath); setCwd(worktreeSession.worktreePath); @@ -515039,13 +438650,13 @@ var init_ExitWorktreeTool = __esm(() => { return "Exiting worktree"; }, shouldDefer: true, - isDestructive(input11) { - return input11.action === "remove"; + isDestructive(input) { + return input.action === "remove"; }, - toAutoClassifierInput(input11) { - return input11.action; + toAutoClassifierInput(input) { + return input.action; }, - async validateInput(input11) { + async validateInput(input) { const session = getCurrentWorktreeSession(); if (!session) { return { @@ -515054,7 +438665,7 @@ var init_ExitWorktreeTool = __esm(() => { errorCode: 1 }; } - if (input11.action === "remove" && !input11.discard_changes) { + if (input.action === "remove" && !input.discard_changes) { const summary = await countWorktreeChanges(session.worktreePath, session.originalHeadCommit); if (summary === null) { return { @@ -515083,7 +438694,7 @@ var init_ExitWorktreeTool = __esm(() => { }, renderToolUseMessage: renderToolUseMessage20, renderToolResultMessage: renderToolResultMessage19, - async call(input11) { + async call(input) { const session = getCurrentWorktreeSession(); if (!session) { throw new Error("Not in a worktree session"); @@ -515097,7 +438708,7 @@ var init_ExitWorktreeTool = __esm(() => { } = session; const projectRootIsWorktree = getProjectRoot() === getOriginalCwd(); const { changedFiles, commits } = await countWorktreeChanges(worktreePath, originalHeadCommit) ?? { changedFiles: 0, commits: 0 }; - if (input11.action === "keep") { + if (input.action === "keep") { await keepWorktree(); restoreSessionToOriginalCwd(originalCwd, projectRootIsWorktree); logEvent("tengu_worktree_kept", { @@ -515525,7 +439136,7 @@ function filterModelOptionsByAllowlist(options2) { var MaxSonnet46Option, MaxHaiku45Option; var init_modelOptions = __esm(() => { init_state(); - init_auth2(); + init_auth(); init_modelStrings(); init_modelCost(); init_settings2(); @@ -515570,7 +439181,7 @@ function isVoiceModeEnabled() { var init_voiceModeEnabled = __esm(() => { init_bun_bundle(); init_growthbook(); - init_auth2(); + init_auth(); }); // src/utils/model/validateModel.ts @@ -515616,12 +439227,12 @@ async function validateModel(model) { }); validModelCache.set(normalizedModel, true); return { valid: true }; - } catch (error45) { - return handleValidationError(error45, normalizedModel); + } catch (error41) { + return handleValidationError(error41, normalizedModel); } } -function handleValidationError(error45, modelName) { - if (error45 instanceof NotFoundError) { +function handleValidationError(error41, modelName) { + if (error41 instanceof NotFoundError) { const fallback = get3PFallbackSuggestion(modelName); const suggestion = fallback ? `. Try '${fallback}' instead` : ""; return { @@ -515629,26 +439240,26 @@ function handleValidationError(error45, modelName) { error: `Model '${modelName}' not found${suggestion}` }; } - if (error45 instanceof APIError) { - if (error45 instanceof AuthenticationError) { + if (error41 instanceof APIError) { + if (error41 instanceof AuthenticationError) { return { valid: false, error: "Authentication failed. Please check your API credentials." }; } - if (error45 instanceof APIConnectionError) { + if (error41 instanceof APIConnectionError) { return { valid: false, error: "Network error. Please check your internet connection." }; } - const errorBody = error45.error; + const errorBody = error41.error; if (errorBody && typeof errorBody === "object" && "type" in errorBody && errorBody.type === "not_found_error" && "message" in errorBody && typeof errorBody.message === "string" && errorBody.message.includes("model:")) { return { valid: false, error: `Model '${modelName}' not found` }; } - return { valid: false, error: `API error: ${error45.message}` }; + return { valid: false, error: `API error: ${error41.message}` }; } - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); return { valid: false, error: `Unable to validate model: ${errorMessage2}` @@ -515685,22 +439296,22 @@ var init_validateModel = __esm(() => { function isSupported(key) { return key in SUPPORTED_SETTINGS; } -function getConfig3(key) { +function getConfig2(key) { return SUPPORTED_SETTINGS[key]; } function getOptionsForSetting(key) { - const config4 = SUPPORTED_SETTINGS[key]; - if (!config4) + const config2 = SUPPORTED_SETTINGS[key]; + if (!config2) return; - if (config4.options) - return [...config4.options]; - if (config4.getOptions) - return config4.getOptions(); + if (config2.options) + return [...config2.options]; + if (config2.getOptions) + return config2.getOptions(); return; } function getPath2(key) { - const config4 = SUPPORTED_SETTINGS[key]; - return config4?.path ?? key.split("."); + const config2 = SUPPORTED_SETTINGS[key]; + return config2?.path ?? key.split("."); } var SUPPORTED_SETTINGS; var init_supportedSettings = __esm(() => { @@ -515854,7 +439465,7 @@ var init_supportedSettings = __esm(() => { function generatePrompt() { const globalSettings = []; const projectSettings = []; - for (const [key, config4] of Object.entries(SUPPORTED_SETTINGS)) { + for (const [key, config2] of Object.entries(SUPPORTED_SETTINGS)) { if (key === "model") continue; if (feature("VOICE_MODE") && key === "voiceEnabled" && !isVoiceGrowthBookEnabled()) @@ -515863,11 +439474,11 @@ function generatePrompt() { let line = `- ${key}`; if (options2) { line += `: ${options2.map((o2) => `"${o2}"`).join(", ")}`; - } else if (config4.type === "boolean") { + } else if (config2.type === "boolean") { line += `: true/false`; } - line += ` - ${config4.description}`; - if (config4.source === "global") { + line += ` - ${config2.description}`; + if (config2.source === "global") { globalSettings.push(line); } else { projectSettings.push(line); @@ -515929,15 +439540,15 @@ var init_prompt18 = __esm(() => { }); // src/tools/ConfigTool/UI.tsx -function renderToolUseMessage21(input11) { - if (!input11.setting) +function renderToolUseMessage21(input) { + if (!input.setting) return null; - if (input11.value === undefined) { + if (input.value === undefined) { return /* @__PURE__ */ jsx_dev_runtime144.jsxDEV(ThemedText, { dimColor: true, children: [ "Getting ", - input11.setting + input.setting ] }, undefined, true, undefined, this); } @@ -515945,9 +439556,9 @@ function renderToolUseMessage21(input11) { dimColor: true, children: [ "Setting ", - input11.setting, + input.setting, " to ", - jsonStringify(input11.value) + jsonStringify(input.value) ] }, undefined, true, undefined, this); } @@ -516010,7 +439621,7 @@ var init_UI20 = __esm(() => { }); // node_modules/ws/lib/constants.js -var require_constants11 = __commonJS((exports, module) => { +var require_constants10 = __commonJS((exports, module) => { var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"]; var hasBlob = typeof Blob !== "undefined"; if (hasBlob) @@ -516031,17 +439642,17 @@ var require_constants11 = __commonJS((exports, module) => { // node_modules/ws/lib/buffer-util.js var require_buffer_util = __commonJS((exports, module) => { - var { EMPTY_BUFFER } = require_constants11(); + var { EMPTY_BUFFER } = require_constants10(); var FastBuffer = Buffer[Symbol.species]; - function concat3(list2, totalLength) { + function concat2(list2, totalLength) { if (list2.length === 0) return EMPTY_BUFFER; if (list2.length === 1) return list2[0]; const target = Buffer.allocUnsafe(totalLength); let offset = 0; - for (let i4 = 0;i4 < list2.length; i4++) { - const buf = list2[i4]; + for (let i3 = 0;i3 < list2.length; i3++) { + const buf = list2[i3]; target.set(buf, offset); offset += buf.length; } @@ -516051,13 +439662,13 @@ var require_buffer_util = __commonJS((exports, module) => { return target; } function _mask(source, mask, output, offset, length) { - for (let i4 = 0;i4 < length; i4++) { - output[offset + i4] = source[i4] ^ mask[i4 & 3]; + for (let i3 = 0;i3 < length; i3++) { + output[offset + i3] = source[i3] ^ mask[i3 & 3]; } } function _unmask(buffer, mask) { - for (let i4 = 0;i4 < buffer.length; i4++) { - buffer[i4] ^= mask[i4 & 3]; + for (let i3 = 0;i3 < buffer.length; i3++) { + buffer[i3] ^= mask[i3 & 3]; } } function toArrayBuffer(buf) { @@ -516082,7 +439693,7 @@ var require_buffer_util = __commonJS((exports, module) => { return buf; } module.exports = { - concat: concat3, + concat: concat2, mask: _mask, toArrayBuffer, toBuffer, @@ -516144,7 +439755,7 @@ var require_permessage_deflate2 = __commonJS((exports, module) => { var zlib3 = __require("zlib"); var bufferUtil = require_buffer_util(); var Limiter = require_limiter(); - var { kStatusCode } = require_constants11(); + var { kStatusCode } = require_constants10(); var FastBuffer = Buffer[Symbol.species]; var TRAILER = Buffer.from([0, 0, 255, 255]); var kPerMessageDeflate = Symbol("permessage-deflate"); @@ -516287,17 +439898,17 @@ var require_permessage_deflate2 = __commonJS((exports, module) => { } decompress(data, fin, callback) { zlibLimiter.add((done) => { - this._decompress(data, fin, (err3, result3) => { + this._decompress(data, fin, (err2, result2) => { done(); - callback(err3, result3); + callback(err2, result2); }); }); } compress(data, fin, callback) { zlibLimiter.add((done) => { - this._compress(data, fin, (err3, result3) => { + this._compress(data, fin, (err2, result2) => { done(); - callback(err3, result3); + callback(err2, result2); }); }); } @@ -516321,11 +439932,11 @@ var require_permessage_deflate2 = __commonJS((exports, module) => { if (fin) this._inflate.write(TRAILER); this._inflate.flush(() => { - const err3 = this._inflate[kError]; - if (err3) { + const err2 = this._inflate[kError]; + if (err2) { this._inflate.close(); this._inflate = null; - callback(err3); + callback(err2); return; } const data2 = bufferUtil.concat(this._inflate[kBuffers], this._inflate[kTotalLength]); @@ -516376,14 +439987,14 @@ var require_permessage_deflate2 = __commonJS((exports, module) => { } } module.exports = PerMessageDeflate; - function deflateOnData(chunk3) { - this[kBuffers].push(chunk3); - this[kTotalLength] += chunk3.length; + function deflateOnData(chunk2) { + this[kBuffers].push(chunk2); + this[kTotalLength] += chunk2.length; } - function inflateOnData(chunk3) { - this[kTotalLength] += chunk3.length; + function inflateOnData(chunk2) { + this[kTotalLength] += chunk2.length; if (this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload) { - this[kBuffers].push(chunk3); + this[kBuffers].push(chunk2); return; } this[kError] = new RangeError("Max payload size exceeded"); @@ -516392,21 +440003,21 @@ var require_permessage_deflate2 = __commonJS((exports, module) => { this.removeListener("data", inflateOnData); this.reset(); } - function inflateOnError(err3) { + function inflateOnError(err2) { this[kPerMessageDeflate]._inflate = null; if (this[kError]) { this[kCallback](this[kError]); return; } - err3[kStatusCode] = 1007; - this[kCallback](err3); + err2[kStatusCode] = 1007; + this[kCallback](err2); } }); // node_modules/ws/lib/validation.js var require_validation2 = __commonJS((exports, module) => { var { isUtf8 } = __require("buffer"); - var { hasBlob } = require_constants11(); + var { hasBlob } = require_constants10(); var tokenChars = [ 0, 0, @@ -516542,25 +440153,25 @@ var require_validation2 = __commonJS((exports, module) => { } function _isValidUTF8(buf) { const len = buf.length; - let i4 = 0; - while (i4 < len) { - if ((buf[i4] & 128) === 0) { - i4++; - } else if ((buf[i4] & 224) === 192) { - if (i4 + 1 === len || (buf[i4 + 1] & 192) !== 128 || (buf[i4] & 254) === 192) { + let i3 = 0; + while (i3 < len) { + if ((buf[i3] & 128) === 0) { + i3++; + } else if ((buf[i3] & 224) === 192) { + if (i3 + 1 === len || (buf[i3 + 1] & 192) !== 128 || (buf[i3] & 254) === 192) { return false; } - i4 += 2; - } else if ((buf[i4] & 240) === 224) { - if (i4 + 2 >= len || (buf[i4 + 1] & 192) !== 128 || (buf[i4 + 2] & 192) !== 128 || buf[i4] === 224 && (buf[i4 + 1] & 224) === 128 || buf[i4] === 237 && (buf[i4 + 1] & 224) === 160) { + i3 += 2; + } else if ((buf[i3] & 240) === 224) { + if (i3 + 2 >= len || (buf[i3 + 1] & 192) !== 128 || (buf[i3 + 2] & 192) !== 128 || buf[i3] === 224 && (buf[i3 + 1] & 224) === 128 || buf[i3] === 237 && (buf[i3 + 1] & 224) === 160) { return false; } - i4 += 3; - } else if ((buf[i4] & 248) === 240) { - if (i4 + 3 >= len || (buf[i4 + 1] & 192) !== 128 || (buf[i4 + 2] & 192) !== 128 || (buf[i4 + 3] & 192) !== 128 || buf[i4] === 240 && (buf[i4 + 1] & 240) === 128 || buf[i4] === 244 && buf[i4 + 1] > 143 || buf[i4] > 244) { + i3 += 3; + } else if ((buf[i3] & 248) === 240) { + if (i3 + 3 >= len || (buf[i3 + 1] & 192) !== 128 || (buf[i3 + 2] & 192) !== 128 || (buf[i3 + 3] & 192) !== 128 || buf[i3] === 240 && (buf[i3 + 1] & 240) === 128 || buf[i3] === 244 && buf[i3 + 1] > 143 || buf[i3] > 244) { return false; } - i4 += 4; + i3 += 4; } else { return false; } @@ -516599,8 +440210,8 @@ var require_receiver2 = __commonJS((exports, module) => { EMPTY_BUFFER, kStatusCode, kWebSocket - } = require_constants11(); - var { concat: concat3, toArrayBuffer, unmask } = require_buffer_util(); + } = require_constants10(); + var { concat: concat2, toArrayBuffer, unmask } = require_buffer_util(); var { isValidStatusCode, isValidUTF8 } = require_validation2(); var FastBuffer = Buffer[Symbol.species]; var GET_INFO = 0; @@ -516637,11 +440248,11 @@ var require_receiver2 = __commonJS((exports, module) => { this._loop = false; this._state = GET_INFO; } - _write(chunk3, encoding, cb) { + _write(chunk2, encoding, cb) { if (this._opcode === 8 && this._state == GET_INFO) return cb(); - this._bufferedBytes += chunk3.length; - this._buffers.push(chunk3); + this._bufferedBytes += chunk2.length; + this._buffers.push(chunk2); this.startLoop(cb); } consume(n2) { @@ -516702,14 +440313,14 @@ var require_receiver2 = __commonJS((exports, module) => { } const buf = this.consume(2); if ((buf[0] & 48) !== 0) { - const error45 = this.createError(RangeError, "RSV2 and RSV3 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_2_3"); - cb(error45); + const error41 = this.createError(RangeError, "RSV2 and RSV3 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_2_3"); + cb(error41); return; } const compressed = (buf[0] & 64) === 64; if (compressed && !this._extensions[PerMessageDeflate.extensionName]) { - const error45 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); - cb(error45); + const error41 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); + cb(error41); return; } this._fin = (buf[0] & 128) === 128; @@ -516717,42 +440328,42 @@ var require_receiver2 = __commonJS((exports, module) => { this._payloadLength = buf[1] & 127; if (this._opcode === 0) { if (compressed) { - const error45 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); - cb(error45); + const error41 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); + cb(error41); return; } if (!this._fragmented) { - const error45 = this.createError(RangeError, "invalid opcode 0", true, 1002, "WS_ERR_INVALID_OPCODE"); - cb(error45); + const error41 = this.createError(RangeError, "invalid opcode 0", true, 1002, "WS_ERR_INVALID_OPCODE"); + cb(error41); return; } this._opcode = this._fragmented; } else if (this._opcode === 1 || this._opcode === 2) { if (this._fragmented) { - const error45 = this.createError(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); - cb(error45); + const error41 = this.createError(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); + cb(error41); return; } this._compressed = compressed; } else if (this._opcode > 7 && this._opcode < 11) { if (!this._fin) { - const error45 = this.createError(RangeError, "FIN must be set", true, 1002, "WS_ERR_EXPECTED_FIN"); - cb(error45); + const error41 = this.createError(RangeError, "FIN must be set", true, 1002, "WS_ERR_EXPECTED_FIN"); + cb(error41); return; } if (compressed) { - const error45 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); - cb(error45); + const error41 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); + cb(error41); return; } if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) { - const error45 = this.createError(RangeError, `invalid payload length ${this._payloadLength}`, true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"); - cb(error45); + const error41 = this.createError(RangeError, `invalid payload length ${this._payloadLength}`, true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"); + cb(error41); return; } } else { - const error45 = this.createError(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); - cb(error45); + const error41 = this.createError(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); + cb(error41); return; } if (!this._fin && !this._fragmented) @@ -516760,13 +440371,13 @@ var require_receiver2 = __commonJS((exports, module) => { this._masked = (buf[1] & 128) === 128; if (this._isServer) { if (!this._masked) { - const error45 = this.createError(RangeError, "MASK must be set", true, 1002, "WS_ERR_EXPECTED_MASK"); - cb(error45); + const error41 = this.createError(RangeError, "MASK must be set", true, 1002, "WS_ERR_EXPECTED_MASK"); + cb(error41); return; } } else if (this._masked) { - const error45 = this.createError(RangeError, "MASK must be clear", true, 1002, "WS_ERR_UNEXPECTED_MASK"); - cb(error45); + const error41 = this.createError(RangeError, "MASK must be clear", true, 1002, "WS_ERR_UNEXPECTED_MASK"); + cb(error41); return; } if (this._payloadLength === 126) @@ -516792,8 +440403,8 @@ var require_receiver2 = __commonJS((exports, module) => { const buf = this.consume(8); const num = buf.readUInt32BE(0); if (num > Math.pow(2, 53 - 32) - 1) { - const error45 = this.createError(RangeError, "Unsupported WebSocket frame: payload length > 2^53 - 1", false, 1009, "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"); - cb(error45); + const error41 = this.createError(RangeError, "Unsupported WebSocket frame: payload length > 2^53 - 1", false, 1009, "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"); + cb(error41); return; } this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); @@ -516803,8 +440414,8 @@ var require_receiver2 = __commonJS((exports, module) => { if (this._payloadLength && this._opcode < 8) { this._totalPayloadLength += this._payloadLength; if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { - const error45 = this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"); - cb(error45); + const error41 = this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"); + cb(error41); return; } } @@ -516850,14 +440461,14 @@ var require_receiver2 = __commonJS((exports, module) => { } decompress(data, cb) { const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; - perMessageDeflate.decompress(data, this._fin, (err3, buf) => { - if (err3) - return cb(err3); + perMessageDeflate.decompress(data, this._fin, (err2, buf) => { + if (err2) + return cb(err2); if (buf.length) { this._messageLength += buf.length; if (this._messageLength > this._maxPayload && this._maxPayload > 0) { - const error45 = this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"); - cb(error45); + const error41 = this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"); + cb(error41); return; } this._fragments.push(buf); @@ -516881,9 +440492,9 @@ var require_receiver2 = __commonJS((exports, module) => { if (this._opcode === 2) { let data; if (this._binaryType === "nodebuffer") { - data = concat3(fragments, messageLength); + data = concat2(fragments, messageLength); } else if (this._binaryType === "arraybuffer") { - data = toArrayBuffer(concat3(fragments, messageLength)); + data = toArrayBuffer(concat2(fragments, messageLength)); } else if (this._binaryType === "blob") { data = new Blob(fragments); } else { @@ -516901,10 +440512,10 @@ var require_receiver2 = __commonJS((exports, module) => { }); } } else { - const buf = concat3(fragments, messageLength); + const buf = concat2(fragments, messageLength); if (!this._skipUTF8Validation && !isValidUTF8(buf)) { - const error45 = this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); - cb(error45); + const error41 = this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); + cb(error41); return; } if (this._state === INFLATING || this._allowSynchronousEvents) { @@ -516929,14 +440540,14 @@ var require_receiver2 = __commonJS((exports, module) => { } else { const code = data.readUInt16BE(0); if (!isValidStatusCode(code)) { - const error45 = this.createError(RangeError, `invalid status code ${code}`, true, 1002, "WS_ERR_INVALID_CLOSE_CODE"); - cb(error45); + const error41 = this.createError(RangeError, `invalid status code ${code}`, true, 1002, "WS_ERR_INVALID_CLOSE_CODE"); + cb(error41); return; } const buf = new FastBuffer(data.buffer, data.byteOffset + 2, data.length - 2); if (!this._skipUTF8Validation && !isValidUTF8(buf)) { - const error45 = this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); - cb(error45); + const error41 = this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); + cb(error41); return; } this._loop = false; @@ -516961,11 +440572,11 @@ var require_receiver2 = __commonJS((exports, module) => { createError(ErrorCtor, message, prefix, statusCode, errorCode) { this._loop = false; this._errored = true; - const err3 = new ErrorCtor(prefix ? `Invalid WebSocket frame: ${message}` : message); - Error.captureStackTrace(err3, this.createError); - err3.code = errorCode; - err3[kStatusCode] = statusCode; - return err3; + const err2 = new ErrorCtor(prefix ? `Invalid WebSocket frame: ${message}` : message); + Error.captureStackTrace(err2, this.createError); + err2.code = errorCode; + err2[kStatusCode] = statusCode; + return err2; } } module.exports = Receiver; @@ -516976,7 +440587,7 @@ var require_sender2 = __commonJS((exports, module) => { var { Duplex: Duplex4 } = __require("stream"); var { randomFillSync } = __require("crypto"); var PerMessageDeflate = require_permessage_deflate2(); - var { EMPTY_BUFFER, kWebSocket, NOOP: NOOP2 } = require_constants11(); + var { EMPTY_BUFFER, kWebSocket, NOOP: NOOP2 } = require_constants10(); var { isBlob: isBlob2, isValidStatusCode } = require_validation2(); var { mask: applyMask, toBuffer } = require_buffer_util(); var kByteLength = Symbol("kByteLength"); @@ -517006,7 +440617,7 @@ var require_sender2 = __commonJS((exports, module) => { } static frame(data, options2) { let mask; - let merge5 = false; + let merge4 = false; let offset = 2; let skipMasking = false; if (options2.mask) { @@ -517039,7 +440650,7 @@ var require_sender2 = __commonJS((exports, module) => { } } else { dataLength = data.length; - merge5 = options2.mask && options2.readOnly && !skipMasking; + merge4 = options2.mask && options2.readOnly && !skipMasking; } let payloadLength = dataLength; if (dataLength >= 65536) { @@ -517049,7 +440660,7 @@ var require_sender2 = __commonJS((exports, module) => { offset += 2; payloadLength = 126; } - const target = Buffer.allocUnsafe(merge5 ? dataLength + offset : offset); + const target = Buffer.allocUnsafe(merge4 ? dataLength + offset : offset); target[0] = options2.fin ? options2.opcode | 128 : options2.opcode; if (options2.rsv1) target[0] |= 64; @@ -517069,7 +440680,7 @@ var require_sender2 = __commonJS((exports, module) => { target[offset - 1] = mask[3]; if (skipMasking) return [target, data]; - if (merge5) { + if (merge4) { applyMask(data, mask, target, offset, dataLength); return [target]; } @@ -517248,8 +440859,8 @@ var require_sender2 = __commonJS((exports, module) => { this._state = GET_BLOB_DATA; blob2.arrayBuffer().then((arrayBuffer) => { if (this._socket.destroyed) { - const err3 = new Error("The socket was closed while the blob was being read"); - process.nextTick(callCallbacks, this, err3, cb); + const err2 = new Error("The socket was closed while the blob was being read"); + process.nextTick(callCallbacks, this, err2, cb); return; } this._bufferedBytes -= options2[kByteLength]; @@ -517261,8 +440872,8 @@ var require_sender2 = __commonJS((exports, module) => { } else { this.dispatch(data, compress, options2, cb); } - }).catch((err3) => { - process.nextTick(onError, this, err3, cb); + }).catch((err2) => { + process.nextTick(onError, this, err2, cb); }); } dispatch(data, compress, options2, cb) { @@ -517275,8 +440886,8 @@ var require_sender2 = __commonJS((exports, module) => { this._state = DEFLATING; perMessageDeflate.compress(data, options2.fin, (_, buf) => { if (this._socket.destroyed) { - const err3 = new Error("The socket was closed while data was being compressed"); - callCallbacks(this, err3, cb); + const err2 = new Error("The socket was closed while data was being compressed"); + callCallbacks(this, err2, cb); return; } this._bufferedBytes -= options2[kByteLength]; @@ -517309,25 +440920,25 @@ var require_sender2 = __commonJS((exports, module) => { } } module.exports = Sender; - function callCallbacks(sender, err3, cb) { + function callCallbacks(sender, err2, cb) { if (typeof cb === "function") - cb(err3); - for (let i4 = 0;i4 < sender._queue.length; i4++) { - const params = sender._queue[i4]; + cb(err2); + for (let i3 = 0;i3 < sender._queue.length; i3++) { + const params = sender._queue[i3]; const callback = params[params.length - 1]; if (typeof callback === "function") - callback(err3); + callback(err2); } } - function onError(sender, err3, cb) { - callCallbacks(sender, err3, cb); - sender.onerror(err3); + function onError(sender, err2, cb) { + callCallbacks(sender, err2, cb); + sender.onerror(err2); } }); // node_modules/ws/lib/event-target.js var require_event_target = __commonJS((exports, module) => { - var { kForOnEventAttribute, kListener } = require_constants11(); + var { kForOnEventAttribute, kListener } = require_constants10(); var kCode = Symbol("kCode"); var kData = Symbol("kData"); var kError = Symbol("kError"); @@ -517400,9 +441011,9 @@ var require_event_target = __commonJS((exports, module) => { } Object.defineProperty(MessageEvent2.prototype, "data", { enumerable: true }); var EventTarget2 = { - addEventListener(type, handler14, options2 = {}) { + addEventListener(type, handler18, options2 = {}) { for (const listener2 of this.listeners(type)) { - if (!options2[kForOnEventAttribute] && listener2[kListener] === handler14 && !listener2[kForOnEventAttribute]) { + if (!options2[kForOnEventAttribute] && listener2[kListener] === handler18 && !listener2[kForOnEventAttribute]) { return; } } @@ -517413,7 +441024,7 @@ var require_event_target = __commonJS((exports, module) => { data: isBinary ? data : data.toString() }); event[kTarget] = this; - callListener(handler14, this, event); + callListener(handler18, this, event); }; } else if (type === "close") { wrapper = function onClose(code, message) { @@ -517423,37 +441034,37 @@ var require_event_target = __commonJS((exports, module) => { wasClean: this._closeFrameReceived && this._closeFrameSent }); event[kTarget] = this; - callListener(handler14, this, event); + callListener(handler18, this, event); }; } else if (type === "error") { - wrapper = function onError(error45) { + wrapper = function onError(error41) { const event = new ErrorEvent2("error", { - error: error45, - message: error45.message + error: error41, + message: error41.message }); event[kTarget] = this; - callListener(handler14, this, event); + callListener(handler18, this, event); }; } else if (type === "open") { wrapper = function onOpen() { const event = new Event3("open"); event[kTarget] = this; - callListener(handler14, this, event); + callListener(handler18, this, event); }; } else { return; } wrapper[kForOnEventAttribute] = !!options2[kForOnEventAttribute]; - wrapper[kListener] = handler14; + wrapper[kListener] = handler18; if (options2.once) { this.once(type, wrapper); } else { this.on(type, wrapper); } }, - removeEventListener(type, handler14) { + removeEventListener(type, handler18) { for (const listener2 of this.listeners(type)) { - if (listener2[kListener] === handler14 && !listener2[kForOnEventAttribute]) { + if (listener2[kListener] === handler18 && !listener2[kForOnEventAttribute]) { this.removeListener(type, listener2); break; } @@ -517496,22 +441107,22 @@ var require_extension = __commonJS((exports, module) => { let start = -1; let code = -1; let end = -1; - let i4 = 0; - for (;i4 < header.length; i4++) { - code = header.charCodeAt(i4); + let i3 = 0; + for (;i3 < header.length; i3++) { + code = header.charCodeAt(i3); if (extensionName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) - start = i4; - } else if (i4 !== 0 && (code === 32 || code === 9)) { + start = i3; + } else if (i3 !== 0 && (code === 32 || code === 9)) { if (end === -1 && start !== -1) - end = i4; + end = i3; } else if (code === 59 || code === 44) { if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } if (end === -1) - end = i4; + end = i3; const name = header.slice(start, end); if (code === 44) { push(offers, name, params); @@ -517521,21 +441132,21 @@ var require_extension = __commonJS((exports, module) => { } start = end = -1; } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } } else if (paramName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) - start = i4; + start = i3; } else if (code === 32 || code === 9) { if (end === -1 && start !== -1) - end = i4; + end = i3; } else if (code === 59 || code === 44) { if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } if (end === -1) - end = i4; + end = i3; push(params, header.slice(start, end), true); if (code === 44) { push(offers, extensionName, params); @@ -517544,47 +441155,47 @@ var require_extension = __commonJS((exports, module) => { } start = end = -1; } else if (code === 61 && start !== -1 && end === -1) { - paramName = header.slice(start, i4); + paramName = header.slice(start, i3); start = end = -1; } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } } else { if (isEscaping) { if (tokenChars[code] !== 1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } if (start === -1) - start = i4; + start = i3; else if (!mustUnescape) mustUnescape = true; isEscaping = false; } else if (inQuotes) { if (tokenChars[code] === 1) { if (start === -1) - start = i4; + start = i3; } else if (code === 34 && start !== -1) { inQuotes = false; - end = i4; + end = i3; } else if (code === 92) { isEscaping = true; } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } - } else if (code === 34 && header.charCodeAt(i4 - 1) === 61) { + } else if (code === 34 && header.charCodeAt(i3 - 1) === 61) { inQuotes = true; } else if (end === -1 && tokenChars[code] === 1) { if (start === -1) - start = i4; + start = i3; } else if (start !== -1 && (code === 32 || code === 9)) { if (end === -1) - end = i4; + end = i3; } else if (code === 59 || code === 44) { if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } if (end === -1) - end = i4; + end = i3; let value = header.slice(start, end); if (mustUnescape) { value = value.replace(/\\/g, ""); @@ -517599,7 +441210,7 @@ var require_extension = __commonJS((exports, module) => { paramName = undefined; start = end = -1; } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } } } @@ -517607,7 +441218,7 @@ var require_extension = __commonJS((exports, module) => { throw new SyntaxError("Unexpected end of input"); } if (end === -1) - end = i4; + end = i3; const token = header.slice(start, end); if (extensionName === undefined) { push(offers, token, params); @@ -517630,10 +441241,10 @@ var require_extension = __commonJS((exports, module) => { configurations = [configurations]; return configurations.map((params) => { return [extension].concat(Object.keys(params).map((k) => { - let values4 = params[k]; - if (!Array.isArray(values4)) - values4 = [values4]; - return values4.map((v) => v === true ? k : `${k}=${v}`).join("; "); + let values2 = params[k]; + if (!Array.isArray(values2)) + values2 = [values2]; + return values2.map((v) => v === true ? k : `${k}=${v}`).join("; "); })).join("; "); }).join(", "); }).join(", "); @@ -517648,9 +441259,9 @@ var require_websocket2 = __commonJS((exports, module) => { var http3 = __require("http"); var net = __require("net"); var tls = __require("tls"); - var { randomBytes: randomBytes9, createHash: createHash19 } = __require("crypto"); + var { randomBytes: randomBytes8, createHash: createHash18 } = __require("crypto"); var { Duplex: Duplex4, Readable: Readable6 } = __require("stream"); - var { URL: URL3 } = __require("url"); + var { URL: URL2 } = __require("url"); var PerMessageDeflate = require_permessage_deflate2(); var Receiver = require_receiver2(); var Sender = require_sender2(); @@ -517665,7 +441276,7 @@ var require_websocket2 = __commonJS((exports, module) => { kStatusCode, kWebSocket, NOOP: NOOP2 - } = require_constants11(); + } = require_constants10(); var { EventTarget: { addEventListener, removeEventListener } } = require_event_target(); @@ -517756,7 +441367,7 @@ var require_websocket2 = __commonJS((exports, module) => { get url() { return this._url; } - setSocket(socket, head3, options2) { + setSocket(socket, head2, options2) { const receiver = new Receiver({ allowSynchronousEvents: options2.allowSynchronousEvents, binaryType: this.binaryType, @@ -517783,8 +441394,8 @@ var require_websocket2 = __commonJS((exports, module) => { socket.setTimeout(0); if (socket.setNoDelay) socket.setNoDelay(); - if (head3.length > 0) - socket.unshift(head3); + if (head2.length > 0) + socket.unshift(head2); socket.on("close", socketOnClose); socket.on("data", socketOnData); socket.on("end", socketOnEnd); @@ -517820,8 +441431,8 @@ var require_websocket2 = __commonJS((exports, module) => { return; } this._readyState = WebSocket2.CLOSING; - this._sender.close(code, data, !this._isServer, (err3) => { - if (err3) + this._sender.close(code, data, !this._isServer, (err2) => { + if (err2) return; this._closeFrameSent = true; if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) { @@ -517967,29 +441578,29 @@ var require_websocket2 = __commonJS((exports, module) => { "protocol", "readyState", "url" - ].forEach((property3) => { - Object.defineProperty(WebSocket2.prototype, property3, { enumerable: true }); + ].forEach((property2) => { + Object.defineProperty(WebSocket2.prototype, property2, { enumerable: true }); }); - ["open", "error", "close", "message"].forEach((method3) => { - Object.defineProperty(WebSocket2.prototype, `on${method3}`, { + ["open", "error", "close", "message"].forEach((method2) => { + Object.defineProperty(WebSocket2.prototype, `on${method2}`, { enumerable: true, get() { - for (const listener2 of this.listeners(method3)) { + for (const listener2 of this.listeners(method2)) { if (listener2[kForOnEventAttribute]) return listener2[kListener]; } return null; }, - set(handler14) { - for (const listener2 of this.listeners(method3)) { + set(handler18) { + for (const listener2 of this.listeners(method2)) { if (listener2[kForOnEventAttribute]) { - this.removeListener(method3, listener2); + this.removeListener(method2, listener2); break; } } - if (typeof handler14 !== "function") + if (typeof handler18 !== "function") return; - this.addEventListener(method3, handler14, { + this.addEventListener(method2, handler18, { [kForOnEventAttribute]: true }); } @@ -518025,11 +441636,11 @@ var require_websocket2 = __commonJS((exports, module) => { throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} ` + `(supported versions: ${protocolVersions.join(", ")})`); } let parsedUrl; - if (address instanceof URL3) { + if (address instanceof URL2) { parsedUrl = address; } else { try { - parsedUrl = new URL3(address); + parsedUrl = new URL2(address); } catch { throw new SyntaxError(`Invalid URL: ${address}`); } @@ -518051,16 +441662,16 @@ var require_websocket2 = __commonJS((exports, module) => { invalidUrlMessage = "The URL contains a fragment identifier"; } if (invalidUrlMessage) { - const err3 = new SyntaxError(invalidUrlMessage); + const err2 = new SyntaxError(invalidUrlMessage); if (websocket._redirects === 0) { - throw err3; + throw err2; } else { - emitErrorAndClose(websocket, err3); + emitErrorAndClose(websocket, err2); return; } } const defaultPort = isSecure ? 443 : 80; - const key = randomBytes9(16).toString("base64"); + const key = randomBytes8(16).toString("base64"); const request = isSecure ? https2.request : http3.request; const protocolSet = new Set; let perMessageDeflate; @@ -518149,11 +441760,11 @@ var require_websocket2 = __commonJS((exports, module) => { abortHandshake(websocket, req, "Opening handshake has timed out"); }); } - req.on("error", (err3) => { + req.on("error", (err2) => { if (req === null || req[kAborted]) return; req = websocket._req = null; - emitErrorAndClose(websocket, err3); + emitErrorAndClose(websocket, err2); }); req.on("response", (res) => { const location = res.headers.location; @@ -518166,10 +441777,10 @@ var require_websocket2 = __commonJS((exports, module) => { req.abort(); let addr; try { - addr = new URL3(location, address); + addr = new URL2(location, address); } catch (e) { - const err3 = new SyntaxError(`Invalid URL: ${location}`); - emitErrorAndClose(websocket, err3); + const err2 = new SyntaxError(`Invalid URL: ${location}`); + emitErrorAndClose(websocket, err2); return; } initAsClient(websocket, addr, protocols, options2); @@ -518177,7 +441788,7 @@ var require_websocket2 = __commonJS((exports, module) => { abortHandshake(websocket, req, `Unexpected server response: ${res.statusCode}`); } }); - req.on("upgrade", (res, socket, head3) => { + req.on("upgrade", (res, socket, head2) => { websocket.emit("upgrade", res); if (websocket.readyState !== WebSocket2.CONNECTING) return; @@ -518187,7 +441798,7 @@ var require_websocket2 = __commonJS((exports, module) => { abortHandshake(websocket, socket, "Invalid Upgrade header"); return; } - const digest = createHash19("sha1").update(key + GUID).digest("base64"); + const digest = createHash18("sha1").update(key + GUID).digest("base64"); if (res.headers["sec-websocket-accept"] !== digest) { abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header"); return; @@ -518219,7 +441830,7 @@ var require_websocket2 = __commonJS((exports, module) => { let extensions; try { extensions = parse10(secWebSocketExtensions); - } catch (err3) { + } catch (err2) { const message = "Invalid Sec-WebSocket-Extensions header"; abortHandshake(websocket, socket, message); return; @@ -518232,14 +441843,14 @@ var require_websocket2 = __commonJS((exports, module) => { } try { perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]); - } catch (err3) { + } catch (err2) { const message = "Invalid Sec-WebSocket-Extensions header"; abortHandshake(websocket, socket, message); return; } websocket._extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } - websocket.setSocket(socket, head3, { + websocket.setSocket(socket, head2, { allowSynchronousEvents: opts.allowSynchronousEvents, generateMask: opts.generateMask, maxPayload: opts.maxPayload, @@ -518252,10 +441863,10 @@ var require_websocket2 = __commonJS((exports, module) => { req.end(); } } - function emitErrorAndClose(websocket, err3) { + function emitErrorAndClose(websocket, err2) { websocket._readyState = WebSocket2.CLOSING; websocket._errorEmitted = true; - websocket.emit("error", err3); + websocket.emit("error", err2); websocket.emitClose(); } function netConnect(options2) { @@ -518271,17 +441882,17 @@ var require_websocket2 = __commonJS((exports, module) => { } function abortHandshake(websocket, stream4, message) { websocket._readyState = WebSocket2.CLOSING; - const err3 = new Error(message); - Error.captureStackTrace(err3, abortHandshake); + const err2 = new Error(message); + Error.captureStackTrace(err2, abortHandshake); if (stream4.setHeader) { stream4[kAborted] = true; stream4.abort(); if (stream4.socket && !stream4.socket.destroyed) { stream4.socket.destroy(); } - process.nextTick(emitErrorAndClose, websocket, err3); + process.nextTick(emitErrorAndClose, websocket, err2); } else { - stream4.destroy(err3); + stream4.destroy(err2); stream4.once("error", websocket.emit.bind(websocket, "error")); stream4.once("close", websocket.emitClose.bind(websocket)); } @@ -518295,8 +441906,8 @@ var require_websocket2 = __commonJS((exports, module) => { websocket._bufferedAmount += length; } if (cb) { - const err3 = new Error(`WebSocket is not open: readyState ${websocket.readyState} ` + `(${readyStates[websocket.readyState]})`); - process.nextTick(cb, err3); + const err2 = new Error(`WebSocket is not open: readyState ${websocket.readyState} ` + `(${readyStates[websocket.readyState]})`); + process.nextTick(cb, err2); } } function receiverOnConclude(code, reason) { @@ -518318,16 +441929,16 @@ var require_websocket2 = __commonJS((exports, module) => { if (!websocket.isPaused) websocket._socket.resume(); } - function receiverOnError(err3) { + function receiverOnError(err2) { const websocket = this[kWebSocket]; if (websocket._socket[kWebSocket] !== undefined) { websocket._socket.removeListener("data", socketOnData); process.nextTick(resume, websocket._socket); - websocket.close(err3[kStatusCode]); + websocket.close(err2[kStatusCode]); } if (!websocket._errorEmitted) { websocket._errorEmitted = true; - websocket.emit("error", err3); + websocket.emit("error", err2); } } function receiverOnFinish() { @@ -518348,7 +441959,7 @@ var require_websocket2 = __commonJS((exports, module) => { function resume(stream4) { stream4.resume(); } - function senderOnError(err3) { + function senderOnError(err2) { const websocket = this[kWebSocket]; if (websocket.readyState === WebSocket2.CLOSED) return; @@ -518359,7 +441970,7 @@ var require_websocket2 = __commonJS((exports, module) => { this._socket.end(); if (!websocket._errorEmitted) { websocket._errorEmitted = true; - websocket.emit("error", err3); + websocket.emit("error", err2); } } function setCloseTimer(websocket) { @@ -518372,8 +441983,8 @@ var require_websocket2 = __commonJS((exports, module) => { this.removeListener("end", socketOnEnd); websocket._readyState = WebSocket2.CLOSING; if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) { - const chunk3 = this.read(this._readableState.length); - websocket._receiver.write(chunk3); + const chunk2 = this.read(this._readableState.length); + websocket._receiver.write(chunk2); } websocket._receiver.end(); this[kWebSocket] = undefined; @@ -518385,8 +441996,8 @@ var require_websocket2 = __commonJS((exports, module) => { websocket._receiver.on("finish", receiverOnFinish); } } - function socketOnData(chunk3) { - if (!this[kWebSocket]._receiver.write(chunk3)) { + function socketOnData(chunk2) { + if (!this[kWebSocket]._receiver.write(chunk2)) { this.pause(); } } @@ -518419,11 +442030,11 @@ var require_stream = __commonJS((exports, module) => { this.destroy(); } } - function duplexOnError(err3) { + function duplexOnError(err2) { this.removeListener("error", duplexOnError); this.destroy(); if (this.listenerCount("error") === 0) { - this.emit("error", err3); + this.emit("error", err2); } } function createWebSocketStream(ws, options2) { @@ -518440,31 +442051,31 @@ var require_stream = __commonJS((exports, module) => { if (!duplex2.push(data)) ws.pause(); }); - ws.once("error", function error(err3) { + ws.once("error", function error(err2) { if (duplex2.destroyed) return; terminateOnDestroy = false; - duplex2.destroy(err3); + duplex2.destroy(err2); }); ws.once("close", function close() { if (duplex2.destroyed) return; duplex2.push(null); }); - duplex2._destroy = function(err3, callback) { + duplex2._destroy = function(err2, callback) { if (ws.readyState === ws.CLOSED) { - callback(err3); + callback(err2); process.nextTick(emitClose, duplex2); return; } let called = false; - ws.once("error", function error(err4) { + ws.once("error", function error(err3) { called = true; - callback(err4); + callback(err3); }); ws.once("close", function close() { if (!called) - callback(err3); + callback(err2); process.nextTick(emitClose, duplex2); }); if (terminateOnDestroy) @@ -518494,14 +442105,14 @@ var require_stream = __commonJS((exports, module) => { if (ws.isPaused) ws.resume(); }; - duplex2._write = function(chunk3, encoding, callback) { + duplex2._write = function(chunk2, encoding, callback) { if (ws.readyState === ws.CONNECTING) { ws.once("open", function open() { - duplex2._write(chunk3, encoding, callback); + duplex2._write(chunk2, encoding, callback); }); return; } - ws.send(chunk3, callback); + ws.send(chunk2, callback); }; duplex2.on("end", duplexOnEnd); duplex2.on("error", duplexOnError); @@ -518517,21 +442128,21 @@ var require_subprotocol = __commonJS((exports, module) => { const protocols = new Set; let start = -1; let end = -1; - let i4 = 0; - for (i4;i4 < header.length; i4++) { - const code = header.charCodeAt(i4); + let i3 = 0; + for (i3;i3 < header.length; i3++) { + const code = header.charCodeAt(i3); if (end === -1 && tokenChars[code] === 1) { if (start === -1) - start = i4; - } else if (i4 !== 0 && (code === 32 || code === 9)) { + start = i3; + } else if (i3 !== 0 && (code === 32 || code === 9)) { if (end === -1 && start !== -1) - end = i4; + end = i3; } else if (code === 44) { if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } if (end === -1) - end = i4; + end = i3; const protocol2 = header.slice(start, end); if (protocols.has(protocol2)) { throw new SyntaxError(`The "${protocol2}" subprotocol is duplicated`); @@ -518539,13 +442150,13 @@ var require_subprotocol = __commonJS((exports, module) => { protocols.add(protocol2); start = end = -1; } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); + throw new SyntaxError(`Unexpected character at index ${i3}`); } } if (start === -1 || end !== -1) { throw new SyntaxError("Unexpected end of input"); } - const protocol = header.slice(start, i4); + const protocol = header.slice(start, i3); if (protocols.has(protocol)) { throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`); } @@ -518560,12 +442171,12 @@ var require_websocket_server = __commonJS((exports, module) => { var EventEmitter5 = __require("events"); var http3 = __require("http"); var { Duplex: Duplex4 } = __require("stream"); - var { createHash: createHash19 } = __require("crypto"); + var { createHash: createHash18 } = __require("crypto"); var extension = require_extension(); var PerMessageDeflate = require_permessage_deflate2(); var subprotocol = require_subprotocol(); var WebSocket2 = require_websocket2(); - var { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants11(); + var { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants10(); var keyRegex = /^[+/0-9A-Za-z]{22}==$/; var RUNNING = 0; var CLOSING = 1; @@ -518614,8 +442225,8 @@ var require_websocket_server = __commonJS((exports, module) => { this._removeListeners = addListeners(this._server, { listening: this.emit.bind(this, "listening"), error: this.emit.bind(this, "error"), - upgrade: (req, socket, head3) => { - this.handleUpgrade(req, socket, head3, emitConnection); + upgrade: (req, socket, head2) => { + this.handleUpgrade(req, socket, head2, emitConnection); } }); } @@ -518683,7 +442294,7 @@ var require_websocket_server = __commonJS((exports, module) => { } return true; } - handleUpgrade(req, socket, head3, cb) { + handleUpgrade(req, socket, head2, cb) { socket.on("error", socketOnError); const key = req.headers["sec-websocket-key"]; const upgrade = req.headers.upgrade; @@ -518719,7 +442330,7 @@ var require_websocket_server = __commonJS((exports, module) => { if (secWebSocketProtocol !== undefined) { try { protocols = subprotocol.parse(secWebSocketProtocol); - } catch (err3) { + } catch (err2) { const message = "Invalid Sec-WebSocket-Protocol header"; abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); return; @@ -518739,7 +442350,7 @@ var require_websocket_server = __commonJS((exports, module) => { perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } - } catch (err3) { + } catch (err2) { const message = "Invalid or unacceptable Sec-WebSocket-Extensions header"; abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); return; @@ -518756,16 +442367,16 @@ var require_websocket_server = __commonJS((exports, module) => { if (!verified) { return abortHandshake(socket, code || 401, message, headers); } - this.completeUpgrade(extensions, key, protocols, req, socket, head3, cb); + this.completeUpgrade(extensions, key, protocols, req, socket, head2, cb); }); return; } if (!this.options.verifyClient(info)) return abortHandshake(socket, 401); } - this.completeUpgrade(extensions, key, protocols, req, socket, head3, cb); + this.completeUpgrade(extensions, key, protocols, req, socket, head2, cb); } - completeUpgrade(extensions, key, protocols, req, socket, head3, cb) { + completeUpgrade(extensions, key, protocols, req, socket, head2, cb) { if (!socket.readable || !socket.writable) return socket.destroy(); if (socket[kWebSocket]) { @@ -518773,7 +442384,7 @@ var require_websocket_server = __commonJS((exports, module) => { } if (this._state > RUNNING) return abortHandshake(socket, 503); - const digest = createHash19("sha1").update(key + GUID).digest("base64"); + const digest = createHash18("sha1").update(key + GUID).digest("base64"); const headers = [ "HTTP/1.1 101 Switching Protocols", "Upgrade: websocket", @@ -518801,7 +442412,7 @@ var require_websocket_server = __commonJS((exports, module) => { `).join(`\r `)); socket.removeListener("error", socketOnError); - ws.setSocket(socket, head3, { + ws.setSocket(socket, head2, { allowSynchronousEvents: this.options.allowSynchronousEvents, maxPayload: this.options.maxPayload, skipUTF8Validation: this.options.skipUTF8Validation @@ -518819,12 +442430,12 @@ var require_websocket_server = __commonJS((exports, module) => { } } module.exports = WebSocketServer; - function addListeners(server, map6) { - for (const event of Object.keys(map6)) - server.on(event, map6[event]); + function addListeners(server, map4) { + for (const event of Object.keys(map4)) + server.on(event, map4[event]); return function removeListeners() { - for (const event of Object.keys(map6)) { - server.removeListener(event, map6[event]); + for (const event of Object.keys(map4)) { + server.removeListener(event, map4[event]); } }; } @@ -518852,9 +442463,9 @@ var require_websocket_server = __commonJS((exports, module) => { } function abortHandshakeOrEmitwsClientError(server, req, socket, code, message, headers) { if (server.listenerCount("wsClientError")) { - const err3 = new Error(message); - Error.captureStackTrace(err3, abortHandshakeOrEmitwsClientError); - server.emit("wsClientError", err3, socket, req); + const err2 = new Error(message); + Error.captureStackTrace(err2, abortHandshakeOrEmitwsClientError); + server.emit("wsClientError", err2, socket, req); } else { abortHandshake(socket, code, message, headers); } @@ -518969,7 +442580,7 @@ async function connectVoiceStream(callbacks, options2) { return Promise.resolve("ws_already_closed"); } finalizing = true; - return new Promise((resolve36) => { + return new Promise((resolve30) => { const safetyTimer = setTimeout(() => resolveFinalize?.("safety_timeout"), FINALIZE_TIMEOUTS_MS.safety); const noDataTimer = setTimeout(() => resolveFinalize?.("no_data_timeout"), FINALIZE_TIMEOUTS_MS.noData); cancelNoDataTimer = () => { @@ -518988,7 +442599,7 @@ async function connectVoiceStream(callbacks, options2) { callbacks.onTranscript(t, true); } logForDebugging(`[voice_stream] Finalize resolved via ${source}`); - resolve36(source); + resolve30(source); }; if (ws.readyState === wrapper_default.CLOSED || ws.readyState === wrapper_default.CLOSING) { resolveFinalize("ws_already_closed"); @@ -519033,11 +442644,11 @@ async function connectVoiceStream(callbacks, options2) { }); let lastTranscriptText = ""; ws.on("message", (raw) => { - const text2 = raw.toString(); - logForDebugging(`[voice_stream] Message received (${String(text2.length)} chars): ${text2.slice(0, 200)}`); + const text = raw.toString(); + logForDebugging(`[voice_stream] Message received (${String(text.length)} chars): ${text.slice(0, 200)}`); let msg; try { - msg = jsonParse(text2); + msg = jsonParse(text); } catch { return; } @@ -519128,11 +442739,11 @@ async function connectVoiceStream(callbacks, options2) { return; callbacks.onError(`WebSocket upgrade rejected with HTTP ${String(status)}`, { fatal: status >= 400 && status < 500 }); }); - ws.on("error", (err3) => { - logError2(err3); - logForDebugging(`[voice_stream] WebSocket error: ${err3.message}`); + ws.on("error", (err2) => { + logError2(err2); + logForDebugging(`[voice_stream] WebSocket error: ${err2.message}`); if (!finalizing) { - callbacks.onError(`Voice stream connection error: ${err3.message}`); + callbacks.onError(`Voice stream connection error: ${err2.message}`); } }); return connection; @@ -519141,7 +442752,7 @@ var KEEPALIVE_MSG = '{"type":"KeepAlive"}', CLOSE_STREAM_MSG = '{"type":"CloseSt var init_voiceStreamSTT = __esm(() => { init_wrapper(); init_oauth(); - init_auth2(); + init_auth(); init_debug(); init_http2(); init_log3(); @@ -519166,8 +442777,8 @@ __export(exports_voice2, { _resetArecordProbeForTesting: () => _resetArecordProbeForTesting, _resetAlsaCardsForTesting: () => _resetAlsaCardsForTesting }); -import { spawn as spawn9, spawnSync as spawnSync4 } from "child_process"; -import { readFile as readFile28 } from "fs/promises"; +import { spawn as spawn6, spawnSync as spawnSync3 } from "child_process"; +import { readFile as readFile27 } from "fs/promises"; function loadAudioNapi() { audioNapiPromise ??= (async () => { const t0 = Date.now(); @@ -519180,15 +442791,15 @@ function loadAudioNapi() { return audioNapiPromise; } function hasCommand2(cmd) { - const result3 = spawnSync4(cmd, ["--version"], { + const result2 = spawnSync3(cmd, ["--version"], { stdio: "ignore", timeout: 3000 }); - return result3.error === undefined; + return result2.error === undefined; } function probeArecord() { - arecordProbe ??= new Promise((resolve36) => { - const child = spawn9("arecord", [ + arecordProbe ??= new Promise((resolve30) => { + const child = spawn6("arecord", [ "-f", "S16_LE", "-r", @@ -519200,20 +442811,20 @@ function probeArecord() { "/dev/null" ], { stdio: ["ignore", "ignore", "pipe"] }); let stderr = ""; - child.stderr?.on("data", (chunk3) => { - stderr += chunk3.toString(); + child.stderr?.on("data", (chunk2) => { + stderr += chunk2.toString(); }); const timer = setTimeout((c6, r) => { c6.kill("SIGTERM"); r({ ok: true, stderr: "" }); - }, 150, child, resolve36); + }, 150, child, resolve30); child.once("close", (code) => { clearTimeout(timer); - resolve36({ ok: code === 0, stderr: stderr.trim() }); + resolve30({ ok: code === 0, stderr: stderr.trim() }); }); child.once("error", () => { clearTimeout(timer); - resolve36({ ok: false, stderr: "arecord: command not found" }); + resolve30({ ok: false, stderr: "arecord: command not found" }); }); }); return arecordProbe; @@ -519222,7 +442833,7 @@ function _resetArecordProbeForTesting() { arecordProbe = null; } function linuxHasAlsaCards() { - linuxAlsaCardsMemo ??= readFile28("/proc/asound/cards", "utf8").then((cards) => { + linuxAlsaCardsMemo ??= readFile27("/proc/asound/cards", "utf8").then((cards) => { const c6 = cards.trim(); return c6 !== "" && !c6.includes("no soundcards"); }, () => false); @@ -519405,20 +443016,20 @@ function startSoxRecording(onData, onEnd, options2) { if (useSilenceDetection) { args.push("silence", "1", "0.1", SILENCE_THRESHOLD, "1", SILENCE_DURATION_SECS, SILENCE_THRESHOLD); } - const child = spawn9("rec", args, { + const child = spawn6("rec", args, { stdio: ["pipe", "pipe", "pipe"] }); activeRecorder = child; - child.stdout?.on("data", (chunk3) => { - onData(chunk3); + child.stdout?.on("data", (chunk2) => { + onData(chunk2); }); child.stderr?.on("data", () => {}); child.on("close", () => { activeRecorder = null; onEnd(); }); - child.on("error", (err3) => { - logError2(err3); + child.on("error", (err2) => { + logError2(err2); activeRecorder = null; onEnd(); }); @@ -519437,20 +443048,20 @@ function startArecordRecording(onData, onEnd) { "-q", "-" ]; - const child = spawn9("arecord", args, { + const child = spawn6("arecord", args, { stdio: ["pipe", "pipe", "pipe"] }); activeRecorder = child; - child.stdout?.on("data", (chunk3) => { - onData(chunk3); + child.stdout?.on("data", (chunk2) => { + onData(chunk2); }); child.stderr?.on("data", () => {}); child.on("close", () => { activeRecorder = null; onEnd(); }); - child.on("error", (err3) => { - logError2(err3); + child.on("error", (err2) => { + logError2(err2); activeRecorder = null; onEnd(); }); @@ -519476,17 +443087,17 @@ var init_voice2 = __esm(() => { }); // src/tools/ConfigTool/ConfigTool.ts -function getValue3(source, path21) { +function getValue2(source, path16) { if (source === "global") { - const config4 = getGlobalConfig(); - const key = path21[0]; + const config2 = getGlobalConfig(); + const key = path16[0]; if (!key) return; - return config4[key]; + return config2[key]; } const settings = getInitialSettings(); let current = settings; - for (const key of path21) { + for (const key of path16) { if (current && typeof current === "object" && key in current) { current = current[key]; } else { @@ -519495,15 +443106,15 @@ function getValue3(source, path21) { } return current; } -function buildNestedObject(path21, value) { - if (path21.length === 0) { +function buildNestedObject(path16, value) { + if (path16.length === 0) { return {}; } - const key = path21[0]; - if (path21.length === 1) { + const key = path16[0]; + if (path16.length === 1) { return { [key]: value }; } - return { [key]: buildNestedObject(path21.slice(1), value) }; + return { [key]: buildNestedObject(path16.slice(1), value) }; } var inputSchema26, outputSchema22, ConfigTool; var init_ConfigTool = __esm(() => { @@ -519555,19 +443166,19 @@ var init_ConfigTool = __esm(() => { isConcurrencySafe() { return true; }, - isReadOnly(input11) { - return input11.value === undefined; + isReadOnly(input) { + return input.value === undefined; }, - toAutoClassifierInput(input11) { - return input11.value === undefined ? input11.setting : `${input11.setting} = ${input11.value}`; + toAutoClassifierInput(input) { + return input.value === undefined ? input.setting : `${input.setting} = ${input.value}`; }, - async checkPermissions(input11) { - if (input11.value === undefined) { - return { behavior: "allow", updatedInput: input11 }; + async checkPermissions(input) { + if (input.value === undefined) { + return { behavior: "allow", updatedInput: input }; } return { behavior: "ask", - message: `Set ${input11.setting} to ${jsonStringify(input11.value)}` + message: `Set ${input.setting} to ${jsonStringify(input.value)}` }; }, renderToolUseMessage: renderToolUseMessage21, @@ -519587,11 +443198,11 @@ var init_ConfigTool = __esm(() => { data: { success: false, error: `Unknown setting: "${setting}"` } }; } - const config4 = getConfig3(setting); - const path21 = getPath2(setting); + const config2 = getConfig2(setting); + const path16 = getPath2(setting); if (value === undefined) { - const currentValue = getValue3(config4.source, path21); - const displayValue = config4.formatOnRead ? config4.formatOnRead(currentValue) : currentValue; + const currentValue = getValue2(config2.source, path16); + const displayValue = config2.formatOnRead ? config2.formatOnRead(currentValue) : currentValue; return { data: { success: true, operation: "get", setting, value: displayValue } }; @@ -519624,7 +443235,7 @@ var init_ConfigTool = __esm(() => { }; } let finalValue = value; - if (config4.type === "boolean") { + if (config2.type === "boolean") { if (typeof value === "string") { const lower = value.toLowerCase().trim(); if (lower === "true") @@ -519654,15 +443265,15 @@ var init_ConfigTool = __esm(() => { } }; } - if (config4.validateOnWrite) { - const result3 = await config4.validateOnWrite(finalValue); - if (!result3.valid) { + if (config2.validateOnWrite) { + const result2 = await config2.validateOnWrite(finalValue); + if (!result2.valid) { return { data: { success: false, operation: "set", setting, - error: result3.error + error: result2.error } }; } @@ -519670,7 +443281,7 @@ var init_ConfigTool = __esm(() => { if (feature("VOICE_MODE") && setting === "voiceEnabled" && finalValue === true) { const { isVoiceModeEnabled: isVoiceModeEnabled2 } = await Promise.resolve().then(() => (init_voiceModeEnabled(), exports_voiceModeEnabled)); if (!isVoiceModeEnabled2()) { - const { isAnthropicAuthEnabled: isAnthropicAuthEnabled2 } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + const { isAnthropicAuthEnabled: isAnthropicAuthEnabled2 } = await Promise.resolve().then(() => (init_auth(), exports_auth)); return { data: { success: false, @@ -519727,10 +443338,10 @@ var init_ConfigTool = __esm(() => { }; } } - const previousValue = getValue3(config4.source, path21); + const previousValue = getValue2(config2.source, path16); try { - if (config4.source === "global") { - const key = path21[0]; + if (config2.source === "global") { + const key = path16[0]; if (!key) { return { data: { @@ -519747,15 +443358,15 @@ var init_ConfigTool = __esm(() => { return { ...prev, [key]: finalValue }; }); } else { - const update3 = buildNestedObject(path21, finalValue); - const result3 = updateSettingsForSource("userSettings", update3); - if (result3.error) { + const update2 = buildNestedObject(path16, finalValue); + const result2 = updateSettingsForSource("userSettings", update2); + if (result2.error) { return { data: { success: false, operation: "set", setting, - error: result3.error.message + error: result2.error.message } }; } @@ -519764,8 +443375,8 @@ var init_ConfigTool = __esm(() => { const { settingsChangeDetector: settingsChangeDetector2 } = await Promise.resolve().then(() => (init_changeDetector(), exports_changeDetector)); settingsChangeDetector2.notifyChange("userSettings"); } - if (config4.appStateKey) { - const appKey = config4.appStateKey; + if (config2.appStateKey) { + const appKey = config2.appStateKey; context.setAppState((prev) => { if (prev[appKey] === finalValue) return prev; @@ -519797,14 +443408,14 @@ var init_ConfigTool = __esm(() => { newValue: finalValue } }; - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return { data: { success: false, operation: "set", setting, - error: errorMessage(error45) + error: errorMessage(error41) } }; } @@ -519933,8 +443544,8 @@ var init_TaskCreateTool = __esm(() => { isConcurrencySafe() { return true; }, - toAutoClassifierInput(input11) { - return input11.subject; + toAutoClassifierInput(input) { + return input.subject; }, renderToolUseMessage() { return null; @@ -519952,9 +443563,9 @@ var init_TaskCreateTool = __esm(() => { }); const blockingErrors = []; const generator = executeTaskCreatedHooks(taskId, subject, description, getAgentName(), getTeamName(), undefined, context?.abortController?.signal, undefined, context); - for await (const result3 of generator) { - if (result3.blockingError) { - blockingErrors.push(getTaskCreatedHookMessage(result3.blockingError)); + for await (const result2 of generator) { + if (result2.blockingError) { + blockingErrors.push(getTaskCreatedHookMessage(result2.blockingError)); } } if (blockingErrors.length > 0) { @@ -520059,8 +443670,8 @@ var init_TaskGetTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.taskId; + toAutoClassifierInput(input) { + return input.taskId; }, renderToolUseMessage() { return null; @@ -520259,12 +443870,12 @@ var init_TaskUpdateTool = __esm(() => { isConcurrencySafe() { return true; }, - toAutoClassifierInput(input11) { - const parts = [input11.taskId]; - if (input11.status) - parts.push(input11.status); - if (input11.subject) - parts.push(input11.subject); + toAutoClassifierInput(input) { + const parts = [input.taskId]; + if (input.status) + parts.push(input.status); + if (input.subject) + parts.push(input.subject); return parts.join(" "); }, renderToolUseMessage() { @@ -520352,9 +443963,9 @@ var init_TaskUpdateTool = __esm(() => { if (status === "completed") { const blockingErrors = []; const generator = executeTaskCompletedHooks(taskId, existingTask.subject, existingTask.description, getAgentName(), getTeamName(), undefined, context?.abortController?.signal, undefined, context); - for await (const result3 of generator) { - if (result3.blockingError) { - blockingErrors.push(getTaskCompletedHookMessage(result3.blockingError)); + for await (const result2 of generator) { + if (result2.blockingError) { + blockingErrors.push(getTaskCompletedHookMessage(result2.blockingError)); } } if (blockingErrors.length > 0) { @@ -520435,7 +444046,7 @@ var init_TaskUpdateTool = __esm(() => { success: success2, taskId, updatedFields, - error: error45, + error: error41, statusChange, verificationNudgeNeeded } = content; @@ -520443,7 +444054,7 @@ var init_TaskUpdateTool = __esm(() => { return { tool_use_id: toolUseID, type: "tool_result", - content: error45 || `Task #${taskId} not found` + content: error41 || `Task #${taskId} not found` }; } let resultContent = `Updated task #${taskId} ${updatedFields.join(", ")}`; @@ -520641,8 +444252,8 @@ var init_SleepTool = __esm(() => { }); // src/tools/ScheduleCronTool/UI.tsx -function renderCreateToolUseMessage(input11) { - return `${input11.cron ?? ""}${input11.prompt ? `: ${truncate(input11.prompt, 60, true)}` : ""}`; +function renderCreateToolUseMessage(input) { + return `${input.cron ?? ""}${input.prompt ? `: ${truncate(input.prompt, 60, true)}` : ""}`; } function renderCreateResultMessage(output) { return /* @__PURE__ */ jsx_dev_runtime145.jsxDEV(MessageResponse, { @@ -520666,8 +444277,8 @@ function renderCreateResultMessage(output) { }, undefined, true, undefined, this) }, undefined, false, undefined, this); } -function renderDeleteToolUseMessage(input11) { - return input11.id ?? ""; +function renderDeleteToolUseMessage(input) { + return input.id ?? ""; } function renderDeleteResultMessage(output) { return /* @__PURE__ */ jsx_dev_runtime145.jsxDEV(MessageResponse, { @@ -520760,8 +444371,8 @@ var init_CronCreateTool = __esm(() => { isEnabled() { return isKairosCronEnabled(); }, - toAutoClassifierInput(input11) { - return `${input11.cron}: ${input11.prompt}`; + toAutoClassifierInput(input) { + return `${input.cron}: ${input.prompt}`; }, async description() { return buildCronCreateDescription(isDurableCronEnabled()); @@ -520772,18 +444383,18 @@ var init_CronCreateTool = __esm(() => { getPath() { return getCronFilePath(); }, - async validateInput(input11) { - if (!parseCronExpression(input11.cron)) { + async validateInput(input) { + if (!parseCronExpression(input.cron)) { return { result: false, - message: `Invalid cron expression '${input11.cron}'. Expected 5 fields: M H DoM Mon DoW.`, + message: `Invalid cron expression '${input.cron}'. Expected 5 fields: M H DoM Mon DoW.`, errorCode: 1 }; } - if (nextCronRunMs(input11.cron, Date.now()) === null) { + if (nextCronRunMs(input.cron, Date.now()) === null) { return { result: false, - message: `Cron expression '${input11.cron}' does not match any calendar date in the next year.`, + message: `Cron expression '${input.cron}' does not match any calendar date in the next year.`, errorCode: 2 }; } @@ -520795,7 +444406,7 @@ var init_CronCreateTool = __esm(() => { errorCode: 3 }; } - if (input11.durable && getTeammateContext()) { + if (input.durable && getTeammateContext()) { return { result: false, message: "durable crons are not supported for teammates (teammates do not persist across sessions)", @@ -520863,8 +444474,8 @@ var init_CronDeleteTool = __esm(() => { isEnabled() { return isKairosCronEnabled(); }, - toAutoClassifierInput(input11) { - return input11.id; + toAutoClassifierInput(input) { + return input.id; }, async description() { return CRON_DELETE_DESCRIPTION; @@ -520875,13 +444486,13 @@ var init_CronDeleteTool = __esm(() => { getPath() { return getCronFilePath(); }, - async validateInput(input11) { + async validateInput(input) { const tasks = await listAllCronTasks(); - const task = tasks.find((t) => t.id === input11.id); + const task = tasks.find((t) => t.id === input.id); if (!task) { return { result: false, - message: `No scheduled job with id '${input11.id}'`, + message: `No scheduled job with id '${input.id}'`, errorCode: 1 }; } @@ -520889,7 +444500,7 @@ var init_CronDeleteTool = __esm(() => { if (ctx && task.agentId !== ctx.agentId) { return { result: false, - message: `Cannot delete cron job '${input11.id}': owned by another agent`, + message: `Cannot delete cron job '${input.id}': owned by another agent`, errorCode: 2 }; } @@ -521003,8 +444614,8 @@ Actions: The response is the raw JSON from the API.`; // src/tools/RemoteTriggerTool/UI.tsx -function renderToolUseMessage22(input11) { - return `${input11.action ?? ""}${input11.trigger_id ? ` ${input11.trigger_id}` : ""}`; +function renderToolUseMessage22(input) { + return `${input.action ?? ""}${input.trigger_id ? ` ${input.trigger_id}` : ""}`; } function renderToolResultMessage21(output) { const lines = countCharInString(output.json, ` @@ -521049,7 +444660,7 @@ var init_RemoteTriggerTool = __esm(() => { init_client2(); init_policyLimits(); init_Tool(); - init_auth2(); + init_auth(); init_slowOperations(); init_UI22(); inputSchema34 = lazySchema(() => exports_external.strictObject({ @@ -521078,11 +444689,11 @@ var init_RemoteTriggerTool = __esm(() => { isConcurrencySafe() { return true; }, - isReadOnly(input11) { - return input11.action === "list" || input11.action === "get"; + isReadOnly(input) { + return input.action === "list" || input.action === "get"; }, - toAutoClassifierInput(input11) { - return `RemoteTrigger ${input11.action}${input11.trigger_id ? ` ${input11.trigger_id}` : ""}`; + toAutoClassifierInput(input) { + return `RemoteTrigger ${input.action}${input.trigger_id ? ` ${input.trigger_id}` : ""}`; }, async description() { return DESCRIPTION16; @@ -521090,7 +444701,7 @@ var init_RemoteTriggerTool = __esm(() => { async prompt() { return PROMPT6; }, - async call(input11, context) { + async call(input, context) { await checkAndRefreshOAuthTokenIfNeeded(); const accessToken = getClaudeAIOAuthTokens()?.accessToken; if (!accessToken) { @@ -521108,25 +444719,25 @@ var init_RemoteTriggerTool = __esm(() => { "anthropic-beta": TRIGGERS_BETA, "x-organization-uuid": orgUUID }; - const { action, trigger_id, body } = input11; - let method3; + const { action, trigger_id, body } = input; + let method2; let url3; let data; switch (action) { case "list": - method3 = "GET"; + method2 = "GET"; url3 = base2; break; case "get": if (!trigger_id) throw new Error("get requires trigger_id"); - method3 = "GET"; + method2 = "GET"; url3 = `${base2}/${trigger_id}`; break; case "create": if (!body) throw new Error("create requires body"); - method3 = "POST"; + method2 = "POST"; url3 = base2; data = body; break; @@ -521135,20 +444746,20 @@ var init_RemoteTriggerTool = __esm(() => { throw new Error("update requires trigger_id"); if (!body) throw new Error("update requires body"); - method3 = "POST"; + method2 = "POST"; url3 = `${base2}/${trigger_id}`; data = body; break; case "run": if (!trigger_id) throw new Error("run requires trigger_id"); - method3 = "POST"; + method2 = "POST"; url3 = `${base2}/${trigger_id}/run`; data = {}; break; } const res = await axios_default.request({ - method: method3, + method: method2, url: url3, headers, data, @@ -521336,8 +444947,8 @@ Teammates should: } // src/tools/TeamCreateTool/UI.tsx -function renderToolUseMessage23(input11) { - return `create team: ${input11.team_name}`; +function renderToolUseMessage23(input) { + return `create team: ${input.team_name}`; } // src/tools/TeamCreateTool/TeamCreateTool.ts @@ -521365,7 +444976,7 @@ var init_TeamCreateTool = __esm(() => { init_teamHelpers(); init_teammateLayoutManager(); init_tasks(); - init_words3(); + init_words2(); inputSchema35 = lazySchema(() => exports_external.strictObject({ team_name: exports_external.string().describe("Name for the new team to create."), description: exports_external.string().optional().describe("Team description/purpose."), @@ -521385,11 +444996,11 @@ var init_TeamCreateTool = __esm(() => { isEnabled() { return isAgentSwarmsEnabled(); }, - toAutoClassifierInput(input11) { - return input11.team_name; + toAutoClassifierInput(input) { + return input.team_name; }, - async validateInput(input11, _context) { - if (!input11.team_name || input11.team_name.trim().length === 0) { + async validateInput(input, _context) { + if (!input.team_name || input.team_name.trim().length === 0) { return { result: false, message: "team_name is required for TeamCreate", @@ -521416,9 +445027,9 @@ var init_TeamCreateTool = __esm(() => { ] }; }, - async call(input11, context) { + async call(input, context) { const { setAppState, getAppState } = context; - const { team_name, description: _description, agent_type } = input11; + const { team_name, description: _description, agent_type } = input; const appState = getAppState(); const existingTeam = appState.teamContext?.teamName; if (existingTeam) { @@ -521516,8 +445127,8 @@ function renderToolUseMessage24(_input) { function renderToolResultMessage22(content, _progressMessages, { verbose: _verbose }) { - const result3 = typeof content === "string" ? jsonParse(content) : content; - if ("success" in result3 && "team_name" in result3 && "message" in result3) { + const result2 = typeof content === "string" ? jsonParse(content) : content; + if ("success" in result2 && "team_name" in result2 && "message" in result2) { return null; } return null; @@ -521624,10 +445235,10 @@ var init_TeamDeleteTool = __esm(() => { }); // src/utils/concurrentSessions.ts -import { chmod as chmod7, mkdir as mkdir25, readdir as readdir17, readFile as readFile29, unlink as unlink14, writeFile as writeFile28 } from "fs/promises"; -import { join as join99 } from "path"; +import { chmod as chmod7, mkdir as mkdir25, readdir as readdir17, readFile as readFile28, unlink as unlink14, writeFile as writeFile26 } from "fs/promises"; +import { join as join89 } from "path"; function getSessionsDir() { - return join99(getClaudeConfigHomeDir(), "sessions"); + return join89(getClaudeConfigHomeDir(), "sessions"); } function envSessionKind() { if (feature("BG_SESSIONS")) { @@ -521645,7 +445256,7 @@ async function registerSession() { return false; const kind = envSessionKind() ?? "interactive"; const dir = getSessionsDir(); - const pidFile = join99(dir, `${process.pid}.json`); + const pidFile = join89(dir, `${process.pid}.json`); registerCleanup(async () => { try { await unlink14(pidFile); @@ -521654,7 +445265,7 @@ async function registerSession() { try { await mkdir25(dir, { recursive: true, mode: 448 }); await chmod7(dir, 448); - await writeFile28(pidFile, jsonStringify({ + await writeFile26(pidFile, jsonStringify({ pid: process.pid, sessionId: getSessionId(), cwd: getOriginalCwd(), @@ -521678,10 +445289,10 @@ async function registerSession() { } } async function updatePidFile(patch) { - const pidFile = join99(getSessionsDir(), `${process.pid}.json`); + const pidFile = join89(getSessionsDir(), `${process.pid}.json`); try { - const data = jsonParse(await readFile29(pidFile, "utf8")); - await writeFile28(pidFile, jsonStringify({ ...data, ...patch })); + const data = jsonParse(await readFile28(pidFile, "utf8")); + await writeFile26(pidFile, jsonStringify({ ...data, ...patch })); } catch (e) { logForDebugging(`[concurrentSessions] updatePidFile failed: ${errorMessage(e)}`); } @@ -521701,9 +445312,9 @@ async function updateSessionActivity(patch) { } async function countConcurrentSessions() { const dir = getSessionsDir(); - let files2; + let files; try { - files2 = await readdir17(dir); + files = await readdir17(dir); } catch (e) { if (!isFsInaccessible(e)) { logForDebugging(`[concurrentSessions] readdir failed: ${errorMessage(e)}`); @@ -521711,7 +445322,7 @@ async function countConcurrentSessions() { return 0; } let count3 = 0; - for (const file2 of files2) { + for (const file2 of files) { if (!/^\d+\.json$/.test(file2)) continue; const pid = parseInt(file2.slice(0, -5), 10); @@ -521722,7 +445333,7 @@ async function countConcurrentSessions() { if (isProcessRunning(pid)) { count3++; } else if (getPlatform() !== "wsl") { - unlink14(join99(dir, file2)).catch(() => {}); + unlink14(join89(dir, file2)).catch(() => {}); } } return count3; @@ -521758,12 +445369,12 @@ var init_replBridgeHandle = __esm(() => { }); // src/tasks/LocalMainSessionTask.ts -import { randomBytes as randomBytes9 } from "crypto"; +import { randomBytes as randomBytes8 } from "crypto"; function generateMainSessionTaskId() { - const bytes = randomBytes9(8); + const bytes = randomBytes8(8); let id = "s"; - for (let i4 = 0;i4 < 8; i4++) { - id += TASK_ID_ALPHABET[bytes[i4] % TASK_ID_ALPHABET.length]; + for (let i3 = 0;i3 < 8; i3++) { + id += TASK_ID_ALPHABET[bytes[i3] % TASK_ID_ALPHABET.length]; } return id; } @@ -521773,8 +445384,8 @@ function registerMainSessionTask(description, setAppState, mainThreadAgentDefini const abortController = existingAbortController ?? createAbortController(); const unregisterCleanup = registerCleanup(async () => { setAppState((prev) => { - const { [taskId]: removed, ...rest3 } = prev.tasks; - return { ...prev, tasks: rest3 }; + const { [taskId]: removed, ...rest2 } = prev.tasks; + return { ...prev, tasks: rest2 }; }); }); const selectedAgent = mainThreadAgentDefinition ?? DEFAULT_MAIN_SESSION_AGENT; @@ -521871,7 +445482,7 @@ function startBackgroundSession({ agentDefinition }) { const { taskId, abortSignal } = registerMainSessionTask(description, setAppState, agentDefinition); - recordSidechainTranscript(messages, taskId).catch((err3) => logForDebugging(`bg-session initial transcript write failed: ${err3}`)); + recordSidechainTranscript(messages, taskId).catch((err2) => logForDebugging(`bg-session initial transcript write failed: ${err2}`)); const agentContext = { agentId: taskId, agentType: "subagent", @@ -521906,7 +445517,7 @@ function startBackgroundSession({ continue; } bgMessages.push(event); - recordSidechainTranscript([event], taskId, lastRecordedUuid).catch((err3) => logForDebugging(`bg-session transcript write failed: ${err3}`)); + recordSidechainTranscript([event], taskId, lastRecordedUuid).catch((err2) => logForDebugging(`bg-session transcript write failed: ${err2}`)); lastRecordedUuid = event.uuid; if (event.type === "assistant") { for (const block2 of event.message.content) { @@ -521951,8 +445562,8 @@ function startBackgroundSession({ }); } completeMainSessionTask(taskId, true, setAppState); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); completeMainSessionTask(taskId, false, setAppState); } }); @@ -522096,8 +445707,8 @@ async function resumeAgentBackground({ return; }) : undefined; if (resumedWorktreePath) { - const now3 = new Date; - await fsp.utimes(resumedWorktreePath, now3, now3); + const now2 = new Date; + await fsp.utimes(resumedWorktreePath, now2, now2); } let selectedAgent; let isResumedFork = false; @@ -522211,7 +445822,7 @@ async function resumeAgentBackground({ } var init_resumeAgent = __esm(() => { init_state(); - init_prompts5(); + init_prompts4(); init_coordinatorMode(); init_LocalAgentTask(); init_tools2(); @@ -522219,7 +445830,7 @@ var init_resumeAgent = __esm(() => { init_agentContext(); init_cwd2(); init_debug(); - init_messages5(); + init_messages3(); init_agent(); init_promptCategory(); init_sessionStorage(); @@ -522285,29 +445896,29 @@ var init_prompt21 = __esm(() => { }); // src/tools/SendMessageTool/UI.tsx -function renderToolUseMessage25(input11) { - if (typeof input11.message !== "object" || input11.message === null) { +function renderToolUseMessage25(input) { + if (typeof input.message !== "object" || input.message === null) { return null; } - if (input11.message.type === "plan_approval_response") { - return input11.message.approve ? `approve plan from: ${input11.to}` : `reject plan from: ${input11.to}`; + if (input.message.type === "plan_approval_response") { + return input.message.approve ? `approve plan from: ${input.to}` : `reject plan from: ${input.to}`; } return null; } function renderToolResultMessage23(content, _progressMessages, { verbose }) { - const result3 = typeof content === "string" ? jsonParse(content) : content; - if ("routing" in result3 && result3.routing) { + const result2 = typeof content === "string" ? jsonParse(content) : content; + if ("routing" in result2 && result2.routing) { return null; } - if ("request_id" in result3 && "target" in result3) { + if ("request_id" in result2 && "target" in result2) { return null; } return /* @__PURE__ */ jsx_dev_runtime147.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime147.jsxDEV(ThemedText, { dimColor: true, - children: result3.message + children: result2.message }, undefined, false, undefined, this) }, undefined, false, undefined, this); } @@ -522323,9 +445934,9 @@ var init_UI24 = __esm(() => { var exports_peerSessions = {}; __export(exports_peerSessions, { default: () => peerSessions_default, - __stub__: () => __stub__20 + __stub__: () => __stub__26 }); -var peerSessions_default, __stub__20 = true; +var peerSessions_default, __stub__26 = true; var init_peerSessions = __esm(() => { peerSessions_default = {}; }); @@ -522663,53 +446274,53 @@ var init_SendMessageTool = __esm(() => { isEnabled() { return isAgentSwarmsEnabled(); }, - isReadOnly(input11) { - return typeof input11.message === "string"; + isReadOnly(input) { + return typeof input.message === "string"; }, - backfillObservableInput(input11) { - if ("type" in input11) + backfillObservableInput(input) { + if ("type" in input) return; - if (typeof input11.to !== "string") + if (typeof input.to !== "string") return; - if (input11.to === "*") { - input11.type = "broadcast"; - if (typeof input11.message === "string") - input11.content = input11.message; - } else if (typeof input11.message === "string") { - input11.type = "message"; - input11.recipient = input11.to; - input11.content = input11.message; - } else if (typeof input11.message === "object" && input11.message !== null) { - const msg = input11.message; - input11.type = msg.type; - input11.recipient = input11.to; + if (input.to === "*") { + input.type = "broadcast"; + if (typeof input.message === "string") + input.content = input.message; + } else if (typeof input.message === "string") { + input.type = "message"; + input.recipient = input.to; + input.content = input.message; + } else if (typeof input.message === "object" && input.message !== null) { + const msg = input.message; + input.type = msg.type; + input.recipient = input.to; if (msg.request_id !== undefined) - input11.request_id = msg.request_id; + input.request_id = msg.request_id; if (msg.approve !== undefined) - input11.approve = msg.approve; + input.approve = msg.approve; const content = msg.reason ?? msg.feedback; if (content !== undefined) - input11.content = content; + input.content = content; } }, - toAutoClassifierInput(input11) { - if (typeof input11.message === "string") { - return `to ${input11.to}: ${input11.message}`; + toAutoClassifierInput(input) { + if (typeof input.message === "string") { + return `to ${input.to}: ${input.message}`; } - switch (input11.message.type) { + switch (input.message.type) { case "shutdown_request": - return `shutdown_request to ${input11.to}`; + return `shutdown_request to ${input.to}`; case "shutdown_response": - return `shutdown_response ${input11.message.approve ? "approve" : "reject"} ${input11.message.request_id}`; + return `shutdown_response ${input.message.approve ? "approve" : "reject"} ${input.message.request_id}`; case "plan_approval_response": - return `plan_approval ${input11.message.approve ? "approve" : "reject"} to ${input11.to}`; + return `plan_approval ${input.message.approve ? "approve" : "reject"} to ${input.to}`; } }, - async checkPermissions(input11, _context) { - if (feature("UDS_INBOX") && parseAddress(input11.to).scheme === "bridge") { + async checkPermissions(input, _context) { + if (feature("UDS_INBOX") && parseAddress(input.to).scheme === "bridge") { return { behavior: "ask", - message: `Send a message to Remote Control session ${input11.to}? It arrives as a user prompt on the receiving Claude (possibly another machine) via Anthropic's servers.`, + message: `Send a message to Remote Control session ${input.to}? It arrives as a user prompt on the receiving Claude (possibly another machine) via Anthropic's servers.`, decisionReason: { type: "safetyCheck", reason: "Cross-machine bridge message requires explicit user consent", @@ -522717,17 +446328,17 @@ var init_SendMessageTool = __esm(() => { } }; } - return { behavior: "allow", updatedInput: input11 }; + return { behavior: "allow", updatedInput: input }; }, - async validateInput(input11, _context) { - if (input11.to.trim().length === 0) { + async validateInput(input, _context) { + if (input.to.trim().length === 0) { return { result: false, message: "to must not be empty", errorCode: 9 }; } - const addr = parseAddress(input11.to); + const addr = parseAddress(input.to); if ((addr.scheme === "bridge" || addr.scheme === "uds") && addr.target.trim().length === 0) { return { result: false, @@ -522735,15 +446346,15 @@ var init_SendMessageTool = __esm(() => { errorCode: 9 }; } - if (input11.to.includes("@")) { + if (input.to.includes("@")) { return { result: false, message: 'to must be a bare teammate name or "*" — there is only one team per session', errorCode: 9 }; } - if (feature("UDS_INBOX") && parseAddress(input11.to).scheme === "bridge") { - if (typeof input11.message !== "string") { + if (feature("UDS_INBOX") && parseAddress(input.to).scheme === "bridge") { + if (typeof input.message !== "string") { return { result: false, message: "structured messages cannot be sent cross-session — only plain text", @@ -522759,11 +446370,11 @@ var init_SendMessageTool = __esm(() => { } return { result: true }; } - if (feature("UDS_INBOX") && parseAddress(input11.to).scheme === "uds" && typeof input11.message === "string") { + if (feature("UDS_INBOX") && parseAddress(input.to).scheme === "uds" && typeof input.message === "string") { return { result: true }; } - if (typeof input11.message === "string") { - if (!input11.summary || input11.summary.trim().length === 0) { + if (typeof input.message === "string") { + if (!input.summary || input.summary.trim().length === 0) { return { result: false, message: "summary is required when message is a string", @@ -522772,28 +446383,28 @@ var init_SendMessageTool = __esm(() => { } return { result: true }; } - if (input11.to === "*") { + if (input.to === "*") { return { result: false, message: 'structured messages cannot be broadcast (to: "*")', errorCode: 9 }; } - if (feature("UDS_INBOX") && parseAddress(input11.to).scheme !== "other") { + if (feature("UDS_INBOX") && parseAddress(input.to).scheme !== "other") { return { result: false, message: "structured messages cannot be sent cross-session — only plain text", errorCode: 9 }; } - if (input11.message.type === "shutdown_response" && input11.to !== TEAM_LEAD_NAME) { + if (input.message.type === "shutdown_response" && input.to !== TEAM_LEAD_NAME) { return { result: false, message: `shutdown_response must be sent to "${TEAM_LEAD_NAME}"`, errorCode: 9 }; } - if (input11.message.type === "shutdown_response" && !input11.message.approve && (!input11.message.reason || input11.message.reason.trim().length === 0)) { + if (input.message.type === "shutdown_response" && !input.message.approve && (!input.message.reason || input.message.reason.trim().length === 0)) { return { result: false, message: "reason is required when rejecting a shutdown request", @@ -522820,69 +446431,69 @@ var init_SendMessageTool = __esm(() => { ] }; }, - async call(input11, context, canUseTool, assistantMessage) { - if (feature("UDS_INBOX") && typeof input11.message === "string") { - const addr = parseAddress(input11.to); + async call(input, context, canUseTool, assistantMessage) { + if (feature("UDS_INBOX") && typeof input.message === "string") { + const addr = parseAddress(input.to); if (addr.scheme === "bridge") { if (!getReplBridgeHandle2() || !isReplBridgeActive()) { return { data: { success: false, - message: `Remote Control disconnected before send — cannot deliver to ${input11.to}` + message: `Remote Control disconnected before send — cannot deliver to ${input.to}` } }; } const { postInterClaudeMessage } = (init_peerSessions(), __toCommonJS(exports_peerSessions)); - const result3 = await postInterClaudeMessage(addr.target, input11.message); - const preview = input11.summary || truncate(input11.message, 50); + const result2 = await postInterClaudeMessage(addr.target, input.message); + const preview = input.summary || truncate(input.message, 50); return { data: { - success: result3.ok, - message: result3.ok ? `“${preview}” → ${input11.to}` : `Failed to send to ${input11.to}: ${result3.error ?? "unknown"}` + success: result2.ok, + message: result2.ok ? `“${preview}” → ${input.to}` : `Failed to send to ${input.to}: ${result2.error ?? "unknown"}` } }; } if (addr.scheme === "uds") { const { sendToUdsSocket } = (init_udsClient(), __toCommonJS(exports_udsClient)); try { - await sendToUdsSocket(addr.target, input11.message); - const preview = input11.summary || truncate(input11.message, 50); + await sendToUdsSocket(addr.target, input.message); + const preview = input.summary || truncate(input.message, 50); return { data: { success: true, - message: `“${preview}” → ${input11.to}` + message: `“${preview}” → ${input.to}` } }; } catch (e) { return { data: { success: false, - message: `Failed to send to ${input11.to}: ${errorMessage(e)}` + message: `Failed to send to ${input.to}: ${errorMessage(e)}` } }; } } } - if (typeof input11.message === "string" && input11.to !== "*") { + if (typeof input.message === "string" && input.to !== "*") { const appState = context.getAppState(); - const registered = appState.agentNameRegistry.get(input11.to); - const agentId = registered ?? toAgentId(input11.to); + const registered = appState.agentNameRegistry.get(input.to); + const agentId = registered ?? toAgentId(input.to); if (agentId) { const task = appState.tasks[agentId]; if (isLocalAgentTask(task) && !isMainSessionTask(task)) { if (task.status === "running") { - queuePendingMessage(agentId, input11.message, context.setAppStateForTasks ?? context.setAppState); + queuePendingMessage(agentId, input.message, context.setAppStateForTasks ?? context.setAppState); return { data: { success: true, - message: `Message queued for delivery to ${input11.to} at its next tool round.` + message: `Message queued for delivery to ${input.to} at its next tool round.` } }; } try { - const result3 = await resumeAgentBackground({ + const result2 = await resumeAgentBackground({ agentId, - prompt: input11.message, + prompt: input.message, toolUseContext: context, canUseTool, invokingRequestId: assistantMessage?.requestId @@ -522890,22 +446501,22 @@ var init_SendMessageTool = __esm(() => { return { data: { success: true, - message: `Agent "${input11.to}" was stopped (${task.status}); resumed it in the background with your message. You'll be notified when it finishes. Output: ${result3.outputFile}` + message: `Agent "${input.to}" was stopped (${task.status}); resumed it in the background with your message. You'll be notified when it finishes. Output: ${result2.outputFile}` } }; } catch (e) { return { data: { success: false, - message: `Agent "${input11.to}" is stopped (${task.status}) and could not be resumed: ${errorMessage(e)}` + message: `Agent "${input.to}" is stopped (${task.status}) and could not be resumed: ${errorMessage(e)}` } }; } } else { try { - const result3 = await resumeAgentBackground({ + const result2 = await resumeAgentBackground({ agentId, - prompt: input11.message, + prompt: input.message, toolUseContext: context, canUseTool, invokingRequestId: assistantMessage?.requestId @@ -522913,42 +446524,42 @@ var init_SendMessageTool = __esm(() => { return { data: { success: true, - message: `Agent "${input11.to}" had no active task; resumed from transcript in the background with your message. You'll be notified when it finishes. Output: ${result3.outputFile}` + message: `Agent "${input.to}" had no active task; resumed from transcript in the background with your message. You'll be notified when it finishes. Output: ${result2.outputFile}` } }; } catch (e) { return { data: { success: false, - message: `Agent "${input11.to}" is registered but has no transcript to resume. It may have been cleaned up. (${errorMessage(e)})` + message: `Agent "${input.to}" is registered but has no transcript to resume. It may have been cleaned up. (${errorMessage(e)})` } }; } } } } - if (typeof input11.message === "string") { - if (input11.to === "*") { - return handleBroadcast(input11.message, input11.summary, context); + if (typeof input.message === "string") { + if (input.to === "*") { + return handleBroadcast(input.message, input.summary, context); } - return handleMessage(input11.to, input11.message, input11.summary, context); + return handleMessage(input.to, input.message, input.summary, context); } - if (input11.to === "*") { + if (input.to === "*") { throw new Error("structured messages cannot be broadcast"); } - switch (input11.message.type) { + switch (input.message.type) { case "shutdown_request": - return handleShutdownRequest(input11.to, input11.message.reason, context); + return handleShutdownRequest(input.to, input.message.reason, context); case "shutdown_response": - if (input11.message.approve) { - return handleShutdownApproval(input11.message.request_id, context); + if (input.message.approve) { + return handleShutdownApproval(input.message.request_id, context); } - return handleShutdownRejection(input11.message.request_id, input11.message.reason); + return handleShutdownRejection(input.message.request_id, input.message.reason); case "plan_approval_response": - if (input11.message.approve) { - return handlePlanApproval(input11.to, input11.message.request_id, context); + if (input.message.approve) { + return handlePlanApproval(input.to, input.message.request_id, context); } - return handlePlanRejection(input11.to, input11.message.request_id, input11.message.feedback ?? "Plan needs revision", context); + return handlePlanRejection(input.to, input.message.request_id, input.message.feedback ?? "Plan needs revision", context); } }, renderToolUseMessage: renderToolUseMessage25, @@ -523067,7 +446678,7 @@ function parseToolPreset(preset) { function getToolsForDefaultPreset() { const tools = getAllBaseTools(); const isEnabled2 = tools.map((tool) => tool.isEnabled()); - return tools.filter((_, i4) => isEnabled2[i4]).map((tool) => tool.name); + return tools.filter((_, i3) => isEnabled2[i3]).map((tool) => tool.name); } function getAllBaseTools() { return [ @@ -523161,7 +446772,7 @@ var REPLTool2, SuggestBackgroundPRTool2, SleepTool2, cronTools, RemoteTriggerToo } } const isEnabled2 = allowedTools.map((_) => _.isEnabled()); - return allowedTools.filter((_, i4) => isEnabled2[i4]); + return allowedTools.filter((_, i3) => isEnabled2[i3]); }; var init_tools2 = __esm(() => { init_Tool(); @@ -523207,7 +446818,7 @@ var init_tools2 = __esm(() => { init_envUtils(); init_shellToolUtils(); init_agentSwarmsEnabled(); - init_constants6(); + init_constants5(); REPLTool2 = process.env.USER_TYPE === "ant" ? (init_REPLTool(), __toCommonJS(exports_REPLTool)).REPLTool : null; SuggestBackgroundPRTool2 = process.env.USER_TYPE === "ant" ? (init_SuggestBackgroundPRTool(), __toCommonJS(exports_SuggestBackgroundPRTool)).SuggestBackgroundPRTool : null; SleepTool2 = feature("PROACTIVE") || feature("KAIROS") ? (init_SleepTool(), __toCommonJS(exports_SleepTool)).SleepTool : null; @@ -523245,7 +446856,7 @@ function It2SetupPrompt(t0) { } = t0; const [step, setStep] = import_react80.useState("initial"); const [packageManager, setPackageManager] = import_react80.useState(null); - const [error45, setError] = import_react80.useState(null); + const [error41, setError] = import_react80.useState(null); const exitState = useExitOnCtrlCDWithKeybindings(); let t1; let t2; @@ -523292,13 +446903,13 @@ function It2SetupPrompt(t0) { t6 = (_input, key) => { if (step === "api-instructions" && key.return) { setStep("verifying"); - verifyIt2Setup().then((result3) => { - if (result3.success) { + verifyIt2Setup().then((result2) => { + if (result2.success) { markIt2SetupComplete(); setStep("success"); setTimeout(onDone, 1500, "installed"); } else { - setError(result3.error || "Verification failed"); + setError(result2.error || "Verification failed"); setStep("failed"); } }); @@ -523354,7 +446965,7 @@ function It2SetupPrompt(t0) { let t13; let t14; let t9; - if ($2[13] !== error45 || $2[14] !== handleInstall || $2[15] !== handleUseTmux || $2[16] !== onDone || $2[17] !== packageManager || $2[18] !== step || $2[19] !== tmuxAvailable2) { + if ($2[13] !== error41 || $2[14] !== handleInstall || $2[15] !== handleUseTmux || $2[16] !== onDone || $2[17] !== packageManager || $2[18] !== step || $2[19] !== tmuxAvailable2) { let renderInitialPrompt = function() { const options2 = [{ label: "Install it2 now", @@ -523466,9 +447077,9 @@ function It2SetupPrompt(t0) { color: "error", children: "Installation failed" }, undefined, false, undefined, this), - error45 && /* @__PURE__ */ jsx_dev_runtime148.jsxDEV(ThemedText, { + error41 && /* @__PURE__ */ jsx_dev_runtime148.jsxDEV(ThemedText, { dimColor: true, - children: error45 + children: error41 }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime148.jsxDEV(ThemedText, { dimColor: true, @@ -523576,9 +447187,9 @@ function It2SetupPrompt(t0) { color: "error", children: "Verification failed" }, undefined, false, undefined, this), - error45 && /* @__PURE__ */ jsx_dev_runtime148.jsxDEV(ThemedText, { + error41 && /* @__PURE__ */ jsx_dev_runtime148.jsxDEV(ThemedText, { dimColor: true, - children: error45 + children: error41 }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime148.jsxDEV(ThemedText, { children: "Make sure:" @@ -523676,7 +447287,7 @@ function It2SetupPrompt(t0) { t12 = $2[28]; } t13 = renderContent(); - $2[13] = error45; + $2[13] = error41; $2[14] = handleInstall; $2[15] = handleUseTmux; $2[16] = onDone; @@ -523760,10 +447371,10 @@ function It2SetupPrompt(t0) { } return t17; } -function _temp51(line, i4) { +function _temp51(line, i3) { return /* @__PURE__ */ jsx_dev_runtime148.jsxDEV(ThemedText, { children: line - }, i4, false, undefined, this); + }, i3, false, undefined, this); } var import_compiler_runtime119, import_react80, jsx_dev_runtime148; var init_It2SetupPrompt = __esm(() => { @@ -523806,24 +447417,24 @@ function resolveTeammateModel(inputModel, leaderModel) { return inputModel ?? getDefaultTeammateModel(leaderModel); } async function hasSession(sessionName) { - const result3 = await execFileNoThrow(TMUX_COMMAND, [ + const result2 = await execFileNoThrow(TMUX_COMMAND, [ "has-session", "-t", sessionName ]); - return result3.code === 0; + return result2.code === 0; } async function ensureSession(sessionName) { const exists = await hasSession(sessionName); if (!exists) { - const result3 = await execFileNoThrow(TMUX_COMMAND, [ + const result2 = await execFileNoThrow(TMUX_COMMAND, [ "new-session", "-d", "-s", sessionName ]); - if (result3.code !== 0) { - throw new Error(`Failed to create tmux session '${sessionName}': ${result3.stderr || "Unknown error"}`); + if (result2.code !== 0) { + throw new Error(`Failed to create tmux session '${sessionName}': ${result2.stderr || "Unknown error"}`); } } } @@ -523881,15 +447492,15 @@ async function generateUniqueTeammateName(baseName, teamName) { } return `${baseName}-${suffix}`; } -async function handleSpawnSplitPane(input11, context) { +async function handleSpawnSplitPane(input, context) { const { setAppState, getAppState } = context; - const { name, prompt, agent_type, cwd: cwd2, plan_mode_required } = input11; - const model = resolveTeammateModel(input11.model, getAppState().mainLoopModel); + const { name, prompt, agent_type, cwd: cwd2, plan_mode_required } = input; + const model = resolveTeammateModel(input.model, getAppState().mainLoopModel); if (!name || !prompt) { throw new Error("name and prompt are required for spawn operation"); } const appState = getAppState(); - const teamName = input11.team_name || appState.teamContext?.teamName; + const teamName = input.team_name || appState.teamContext?.teamName; if (!teamName) { throw new Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context."); } @@ -523900,10 +447511,10 @@ async function handleSpawnSplitPane(input11, context) { let detectionResult = await detectAndGetBackend(); if (detectionResult.needsIt2Setup && context.setToolJSX) { const tmuxAvailable2 = await isTmuxAvailable(); - const setupResult = await new Promise((resolve36) => { + const setupResult = await new Promise((resolve30) => { context.setToolJSX({ jsx: import_react81.default.createElement(It2SetupPrompt, { - onDone: resolve36, + onDone: resolve30, tmuxAvailable: tmuxAvailable2 }), shouldHidePromptInput: true @@ -523939,7 +447550,7 @@ async function handleSpawnSplitPane(input11, context) { permissionMode: appState.toolPermissionContext.mode }); if (model) { - inheritedFlags = inheritedFlags.split(" ").filter((flag, i4, arr) => flag !== "--model" && arr[i4 - 1] !== "--model").join(" "); + inheritedFlags = inheritedFlags.split(" ").filter((flag, i3, arr) => flag !== "--model" && arr[i3 - 1] !== "--model").join(" "); inheritedFlags = inheritedFlags ? `${inheritedFlags} --model ${quote([model])}` : `--model ${quote([model])}`; } const flagsStr = inheritedFlags ? ` ${inheritedFlags}` : ""; @@ -524022,15 +447633,15 @@ async function handleSpawnSplitPane(input11, context) { } }; } -async function handleSpawnSeparateWindow(input11, context) { +async function handleSpawnSeparateWindow(input, context) { const { setAppState, getAppState } = context; - const { name, prompt, agent_type, cwd: cwd2, plan_mode_required } = input11; - const model = resolveTeammateModel(input11.model, getAppState().mainLoopModel); + const { name, prompt, agent_type, cwd: cwd2, plan_mode_required } = input; + const model = resolveTeammateModel(input.model, getAppState().mainLoopModel); if (!name || !prompt) { throw new Error("name and prompt are required for spawn operation"); } const appState = getAppState(); - const teamName = input11.team_name || appState.teamContext?.teamName; + const teamName = input.team_name || appState.teamContext?.teamName; if (!teamName) { throw new Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context."); } @@ -524070,7 +447681,7 @@ async function handleSpawnSeparateWindow(input11, context) { permissionMode: appState.toolPermissionContext.mode }); if (model) { - inheritedFlags = inheritedFlags.split(" ").filter((flag, i4, arr) => flag !== "--model" && arr[i4 - 1] !== "--model").join(" "); + inheritedFlags = inheritedFlags.split(" ").filter((flag, i3, arr) => flag !== "--model" && arr[i3 - 1] !== "--model").join(" "); inheritedFlags = inheritedFlags ? `${inheritedFlags} --model ${quote([model])}` : `--model ${quote([model])}`; } const flagsStr = inheritedFlags ? ` ${inheritedFlags}` : ""; @@ -524204,15 +447815,15 @@ function registerOutOfProcessTeammateTask(setAppState, { } }, { once: true }); } -async function handleSpawnInProcess(input11, context) { +async function handleSpawnInProcess(input, context) { const { setAppState, getAppState } = context; - const { name, prompt, agent_type, plan_mode_required } = input11; - const model = resolveTeammateModel(input11.model, getAppState().mainLoopModel); + const { name, prompt, agent_type, plan_mode_required } = input; + const model = resolveTeammateModel(input.model, getAppState().mainLoopModel); if (!name || !prompt) { throw new Error("name and prompt are required for spawn operation"); } const appState = getAppState(); - const teamName = input11.team_name || appState.teamContext?.teamName; + const teamName = input.team_name || appState.teamContext?.teamName; if (!teamName) { throw new Error("team_name is required for spawn operation. Either provide team_name in input or call spawnTeam first to establish team context."); } @@ -524229,7 +447840,7 @@ async function handleSpawnInProcess(input11, context) { } logForDebugging(`[handleSpawnInProcess] agent_type=${agent_type}, found=${!!agentDefinition}`); } - const config4 = { + const config2 = { name: sanitizedName, teamName, prompt, @@ -524237,12 +447848,12 @@ async function handleSpawnInProcess(input11, context) { planModeRequired: plan_mode_required ?? false, model }; - const result3 = await spawnInProcessTeammate(config4, context); - if (!result3.success) { - throw new Error(result3.error ?? "Failed to spawn in-process teammate"); + const result2 = await spawnInProcessTeammate(config2, context); + if (!result2.success) { + throw new Error(result2.error ?? "Failed to spawn in-process teammate"); } - logForDebugging(`[handleSpawnInProcess] spawn result: taskId=${result3.taskId}, hasContext=${!!result3.teammateContext}, hasAbort=${!!result3.abortController}`); - if (result3.taskId && result3.teammateContext && result3.abortController) { + logForDebugging(`[handleSpawnInProcess] spawn result: taskId=${result2.taskId}, hasContext=${!!result2.teammateContext}, hasAbort=${!!result2.abortController}`); + if (result2.taskId && result2.teammateContext && result2.abortController) { startInProcessTeammate({ identity: { agentId: teammateId, @@ -524250,17 +447861,17 @@ async function handleSpawnInProcess(input11, context) { teamName, color: teammateColor, planModeRequired: plan_mode_required ?? false, - parentSessionId: result3.teammateContext.parentSessionId + parentSessionId: result2.teammateContext.parentSessionId }, - taskId: result3.taskId, + taskId: result2.taskId, prompt, - description: input11.description, + description: input.description, model, agentDefinition, - teammateContext: result3.teammateContext, + teammateContext: result2.teammateContext, toolUseContext: { ...context, messages: [] }, - abortController: result3.abortController, - invokingRequestId: input11.invokingRequestId + abortController: result2.abortController, + invokingRequestId: input.invokingRequestId }); logForDebugging(`[handleSpawnInProcess] Started agent execution for ${teammateId}`); } @@ -524338,28 +447949,28 @@ async function handleSpawnInProcess(input11, context) { } }; } -async function handleSpawn(input11, context) { +async function handleSpawn(input, context) { if (isInProcessEnabled()) { - return handleSpawnInProcess(input11, context); + return handleSpawnInProcess(input, context); } try { await detectAndGetBackend(); - } catch (error45) { + } catch (error41) { if (getTeammateModeFromSnapshot() !== "auto") { - throw error45; + throw error41; } - logForDebugging(`[handleSpawn] No pane backend available, falling back to in-process: ${errorMessage(error45)}`); + logForDebugging(`[handleSpawn] No pane backend available, falling back to in-process: ${errorMessage(error41)}`); markInProcessFallback(); - return handleSpawnInProcess(input11, context); + return handleSpawnInProcess(input, context); } - const useSplitPane = input11.use_splitpane !== false; + const useSplitPane = input.use_splitpane !== false; if (useSplitPane) { - return handleSpawnSplitPane(input11, context); + return handleSpawnSplitPane(input, context); } - return handleSpawnSeparateWindow(input11, context); + return handleSpawnSeparateWindow(input, context); } -async function spawnTeammate(config4, context) { - return handleSpawn(config4, context); +async function spawnTeammate(config2, context) { + return handleSpawn(config2, context); } var import_react81; var init_spawnMultiAgent = __esm(() => { @@ -524529,7 +448140,7 @@ assistant: "I'm going to use the ${AGENT_TOOL_NAME} tool to launch the greeting- const agentListSection = listViaAttachment ? `Available agent types are listed in messages in the conversation.` : `Available agent types and the tools they have access to: ${effectiveAgents.map((agent) => formatAgentLine(agent)).join(` `)}`; - const shared3 = `Launch a new agent to handle complex, multi-step tasks autonomously. + const shared2 = `Launch a new agent to handle complex, multi-step tasks autonomously. The ${AGENT_TOOL_NAME} tool launches specialized agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it. @@ -524537,7 +448148,7 @@ ${agentListSection} ${forkEnabled ? `When using the ${AGENT_TOOL_NAME} tool, specify a subagent_type to use a specialized agent, or omit it to fork yourself — a fork inherits your full conversation context.` : `When using the ${AGENT_TOOL_NAME} tool, specify a subagent_type parameter to select which agent type to use. If omitted, the general-purpose agent is used.`}`; if (isCoordinator) { - return shared3; + return shared2; } const embedded = hasEmbeddedSearchTools(); const fileSearchHint = embedded ? "`find` via the Bash tool" : `the ${GLOB_TOOL_NAME} tool`; @@ -524551,7 +448162,7 @@ When NOT to use the ${AGENT_TOOL_NAME} tool: `; const concurrencyNote = !listViaAttachment && getSubscriptionType() !== "pro" ? ` - Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses` : ""; - return `${shared3} + return `${shared2} ${whenNotToUseSection} Usage notes: @@ -524573,7 +448184,7 @@ ${forkEnabled ? forkExamples : currentExamples}`; } var init_prompt22 = __esm(() => { init_growthbook(); - init_auth2(); + init_auth(); init_embeddedTools(); init_envUtils(); init_teammate(); @@ -524591,10 +448202,10 @@ function getAutoBackgroundMs() { } return 0; } -function resolveTeamName(input11, appState) { +function resolveTeamName(input, appState) { if (!isAgentSwarmsEnabled()) return; - return input11.team_name || appState.teamContext?.teamName; + return input.team_name || appState.teamContext?.teamName; } var jsx_dev_runtime149, proactiveModule2, PROGRESS_THRESHOLD_MS2 = 2000, isBackgroundTasksDisabled2, baseInputSchema, fullInputSchema2, inputSchema4, outputSchema31, AgentTool; var init_AgentTool = __esm(() => { @@ -524603,7 +448214,7 @@ var init_AgentTool = __esm(() => { init_promptCategory(); init_v4(); init_state(); - init_prompts5(); + init_prompts4(); init_coordinatorMode(); init_agentSummary(); init_growthbook(); @@ -524619,7 +448230,7 @@ var init_AgentTool = __esm(() => { init_debug(); init_envUtils(); init_errors(); - init_messages5(); + init_messages3(); init_agent(); init_PermissionMode(); init_permissions2(); @@ -524631,7 +448242,7 @@ var init_AgentTool = __esm(() => { init_teammateContext(); init_teleport(); init_tokens(); - init_uuid2(); + init_uuid(); init_worktree(); init_UI3(); init_prompt3(); @@ -524759,7 +448370,7 @@ var init_AgentTool = __esm(() => { if (agentDef?.color) { setAgentColor(subagent_type, agentDef.color); } - const result3 = await spawnTeammate({ + const result2 = await spawnTeammate({ name, prompt, description, @@ -524773,7 +448384,7 @@ var init_AgentTool = __esm(() => { const spawnResult = { status: "teammate_spawned", prompt, - ...result3.data + ...result2.data }; return { data: spawnResult @@ -524816,7 +448427,7 @@ var init_AgentTool = __esm(() => { const POLL_INTERVAL_MS2 = 500; const deadline = Date.now() + MAX_WAIT_MS; while (Date.now() < deadline) { - await sleep4(POLL_INTERVAL_MS2); + await sleep2(POLL_INTERVAL_MS2); currentAppState = toolUseContext.getAppState(); const hasFailedRequiredServer = currentAppState.mcp.clients.some((c6) => c6.type === "failed" && requiredMcpServers.some((pattern) => c6.name.toLowerCase().includes(pattern.toLowerCase()))); if (hasFailedRequiredServer) @@ -524890,8 +448501,8 @@ var init_AgentTool = __esm(() => { }); } enhancedSystemPrompt = await enhanceSystemPromptWithEnvDetails([agentPrompt], resolvedAgentModel, additionalWorkingDirectories); - } catch (error45) { - logForDebugging(`Failed to get system prompt for agent ${selectedAgent.agentType}: ${errorMessage(error45)}`); + } catch (error41) { + logForDebugging(`Failed to get system prompt for agent ${selectedAgent.agentType}: ${errorMessage(error41)}`); } promptMessages = [createUserMessage({ content: prompt @@ -525145,7 +448756,7 @@ var init_AgentTool = __esm(() => { runWithAgentContext(syncAgentContext, async () => { let stopBackgroundedSummarization; try { - await Promise.race([agentIterator.return(undefined).catch(() => {}), sleep4(1000)]); + await Promise.race([agentIterator.return(undefined).catch(() => {}), sleep2(1000)]); const tracker = createProgressTracker(); const resolveActivity2 = createActivityDescriptionResolver(toolUseContext.options.tools); for (const existingMsg of agentMessages) { @@ -525209,8 +448820,8 @@ ${finalMessage}`; toolUseId: toolUseContext.toolUseId, ...worktreeResult2 }); - } catch (error45) { - if (error45 instanceof AbortError) { + } catch (error41) { + if (error41 instanceof AbortError) { killAsyncAgent(backgroundedTaskId, rootSetAppState); logEvent("tengu_agent_tool_terminated", { agent_type: metadata.agentType, @@ -525233,7 +448844,7 @@ ${finalMessage}`; }); return; } - const errMsg = errorMessage(error45); + const errMsg = errorMessage(error41); failAgentTask(backgroundedTaskId, errMsg, rootSetAppState); const worktreeResult2 = await cleanupWorktreeIfNeeded(); enqueueAgentNotification({ @@ -525269,11 +448880,11 @@ ${finalMessage}`; continue; } const { - result: result3 + result: result2 } = raceResult; - if (result3.done) + if (result2.done) break; - const message = result3.value; + const message = result2.value; agentMessages.push(message); updateProgressFromMessage(syncTracker, message, syncResolveActivity, toolUseContext.options.tools); if (foregroundTaskId) { @@ -525320,8 +448931,8 @@ ${finalMessage}`; } } } - } catch (error45) { - if (error45 instanceof AbortError) { + } catch (error41) { + if (error41 instanceof AbortError) { wasAborted = true; logEvent("tengu_agent_tool_terminated", { agent_type: metadata.agentType, @@ -525331,12 +448942,12 @@ ${finalMessage}`; is_built_in_agent: metadata.isBuiltInAgent, reason: "user_cancel_sync" }); - throw error45; + throw error41; } - logForDebugging(`Sync agent error: ${errorMessage(error45)}`, { + logForDebugging(`Sync agent error: ${errorMessage(error41)}`, { level: "error" }); - syncAgentError = toError(error45); + syncAgentError = toError(error41); } finally { if (toolUseContext.setToolJSX) { toolUseContext.setToolJSX(null); @@ -525422,26 +449033,26 @@ ${finalMessage}`; isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - const i4 = input11; - const tags = [i4.subagent_type, i4.mode ? `mode=${i4.mode}` : undefined].filter((t) => t !== undefined); + toAutoClassifierInput(input) { + const i3 = input; + const tags = [i3.subagent_type, i3.mode ? `mode=${i3.mode}` : undefined].filter((t) => t !== undefined); const prefix = tags.length > 0 ? `(${tags.join(", ")}): ` : ": "; - return `${prefix}${i4.prompt}`; + return `${prefix}${i3.prompt}`; }, isConcurrencySafe() { return true; }, userFacingName, userFacingNameBackgroundColor, - getActivityDescription(input11) { - return input11?.description ?? "Running task"; + getActivityDescription(input) { + return input?.description ?? "Running task"; }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); if (false) {} return { behavior: "allow", - updatedInput: input11 + updatedInput: input }; }, mapToolResultToToolResultBlockParam(data, toolUseID) { @@ -525484,14 +449095,14 @@ The agent is working in the background. You will be notified automatically when const instructions = data.canReadOutputFile ? `Do not duplicate this agent's work — avoid working with the same files or topics it is using. Work on non-overlapping tasks, or briefly tell the user what you launched and end your response. output_file: ${data.outputFile} If asked, you can check progress before completion by using ${FILE_READ_TOOL_NAME} or ${BASH_TOOL_NAME} tail on the output file.` : `Briefly tell the user what you launched and end your response. Do not generate any other text — agent results will arrive in a subsequent message.`; - const text2 = `${prefix} + const text = `${prefix} ${instructions}`; return { tool_use_id: toolUseID, type: "tool_result", content: [{ type: "text", - text: text2 + text }] }; } @@ -525561,7 +449172,7 @@ var init_primitiveTools = __esm(() => { }); // src/utils/memoryFileDetection.ts -import { normalize as normalize11, posix as posix6, win32 as win322 } from "path"; +import { normalize as normalize10, posix as posix6, win32 as win322 } from "path"; function toPosix(p) { return p.split(win322.sep).join(posix6.sep); } @@ -525631,7 +449242,7 @@ function isAutoManagedMemoryFile(filePath) { return false; } function isMemoryDirectory(dirPath) { - const normalizedPath = normalize11(dirPath); + const normalizedPath = normalize10(dirPath); const normalizedCmp = toComparable(normalizedPath); if (isAutoMemoryEnabled() && (normalizedCmp.includes("/agent-memory/") || normalizedCmp.includes("/agent-memory-local/"))) { return true; @@ -525682,11 +449293,11 @@ function isShellCommandTargetingMemory(command) { if (!matchesAnyDir) { return false; } - const matches3 = command.match(/(?:[A-Za-z]:[/\\]|\/)[^\s'"]+/g); - if (!matches3) { + const matches2 = command.match(/(?:[A-Za-z]:[/\\]|\/)[^\s'"]+/g); + if (!matches2) { return false; } - for (const match of matches3) { + for (const match of matches2) { const cleanPath = match.replace(/[,;|&>]+$/, ""); const nativePath = IS_WINDOWS ? posixPathToWindowsPath(cleanPath) : cleanPath; if (isAutoManagedMemoryFile(nativePath) || isMemoryDirectory(nativePath)) { @@ -525724,11 +449335,11 @@ __export(exports_teamMemoryOps, { appendTeamMemorySummaryParts: () => appendTeamMemorySummaryParts }); function isTeamMemorySearch(toolInput) { - const input11 = toolInput; - if (!input11) { + const input = toolInput; + if (!input) { return false; } - if (input11.path && isTeamMemFile(input11.path)) { + if (input.path && isTeamMemFile(input.path)) { return true; } return false; @@ -525737,8 +449348,8 @@ function isTeamMemoryWriteOrEdit(toolName, toolInput) { if (toolName !== FILE_WRITE_TOOL_NAME && toolName !== FILE_EDIT_TOOL_NAME) { return false; } - const input11 = toolInput; - const filePath = input11?.file_path ?? input11?.path; + const input = toolInput; + const filePath = input?.file_path ?? input?.path; return filePath !== undefined && isTeamMemFile(filePath); } function appendTeamMemorySummaryParts(memoryCounts, isActive, parts) { @@ -525776,23 +449387,23 @@ var init_prompt23 = __esm(() => { // src/utils/collapseReadSearch.ts function getFilePathFromToolInput(toolInput) { - const input11 = toolInput; - return input11?.file_path ?? input11?.path; + const input = toolInput; + return input?.file_path ?? input?.path; } function isMemorySearch(toolInput) { - const input11 = toolInput; - if (!input11) { + const input = toolInput; + if (!input) { return false; } - if (input11.path) { - if (isAutoManagedMemoryFile(input11.path) || isMemoryDirectory(input11.path)) { + if (input.path) { + if (isAutoManagedMemoryFile(input.path) || isMemoryDirectory(input.path)) { return true; } } - if (input11.glob && isAutoManagedMemoryPattern(input11.glob)) { + if (input.glob && isAutoManagedMemoryPattern(input.glob)) { return true; } - if (input11.command && isShellCommandTargetingMemory(input11.command)) { + if (input.command && isShellCommandTargetingMemory(input.command)) { return true; } return false; @@ -525856,13 +449467,13 @@ function getToolSearchOrReadInfo(toolName, toolInput, tools) { isAbsorbedSilently: false }; } - const result3 = tool.isSearchOrReadCommand(toolInput); - const isList = result3.isList ?? false; - const isCollapsible = result3.isSearch || result3.isRead || isList; + const result2 = tool.isSearchOrReadCommand(toolInput); + const isList = result2.isList ?? false; + const isCollapsible = result2.isSearch || result2.isRead || isList; return { isCollapsible: isCollapsible || (isFullscreenEnvEnabled() ? toolName === BASH_TOOL_NAME : false), - isSearch: result3.isSearch, - isRead: result3.isRead, + isSearch: result2.isSearch, + isRead: result2.isRead, isList, isREPL: false, isMemoryWrite: false, @@ -526012,18 +449623,18 @@ function getFilePathsFromReadMessage(msg) { if (msg.type === "assistant") { const content = msg.message.content[0]; if (content?.type === "tool_use") { - const input11 = content.input; - if (input11?.file_path) { - paths2.push(input11.file_path); + const input = content.input; + if (input?.file_path) { + paths2.push(input.file_path); } } } else if (msg.type === "grouped_tool_use") { for (const m of msg.messages) { const content = m.message.content[0]; if (content?.type === "tool_use") { - const input11 = content.input; - if (input11?.file_path) { - paths2.push(input11.file_path); + const input = content.input; + if (input?.file_path) { + paths2.push(input.file_path); } } } @@ -526103,7 +449714,7 @@ function createCollapsedGroup(group) { const teamMemSearchCount = feature("TEAMMEM") ? group.teamMemorySearchCount ?? 0 : 0; const teamMemReadCount = feature("TEAMMEM") ? group.teamMemoryReadFilePaths?.size ?? 0 : 0; const teamMemWriteCount = feature("TEAMMEM") ? group.teamMemoryWriteCount ?? 0 : 0; - const result3 = { + const result2 = { type: "collapsed_read_search", searchCount: Math.max(0, group.searchCount - group.memorySearchCount - teamMemSearchCount), readCount: Math.max(0, totalReadCount - toolMemoryReadCount - teamMemReadCount), @@ -526121,49 +449732,49 @@ function createCollapsedGroup(group) { timestamp: firstMsg.timestamp }; if (feature("TEAMMEM")) { - result3.teamMemorySearchCount = teamMemSearchCount; - result3.teamMemoryReadCount = teamMemReadCount; - result3.teamMemoryWriteCount = teamMemWriteCount; + result2.teamMemorySearchCount = teamMemSearchCount; + result2.teamMemoryReadCount = teamMemReadCount; + result2.teamMemoryWriteCount = teamMemWriteCount; } if ((group.mcpCallCount ?? 0) > 0) { - result3.mcpCallCount = group.mcpCallCount; - result3.mcpServerNames = [...group.mcpServerNames ?? []]; + result2.mcpCallCount = group.mcpCallCount; + result2.mcpServerNames = [...group.mcpServerNames ?? []]; } if (isFullscreenEnvEnabled()) { if ((group.bashCount ?? 0) > 0) { - result3.bashCount = group.bashCount; - result3.gitOpBashCount = group.gitOpBashCount; + result2.bashCount = group.bashCount; + result2.gitOpBashCount = group.gitOpBashCount; } if ((group.commits?.length ?? 0) > 0) - result3.commits = group.commits; + result2.commits = group.commits; if ((group.pushes?.length ?? 0) > 0) - result3.pushes = group.pushes; + result2.pushes = group.pushes; if ((group.branches?.length ?? 0) > 0) - result3.branches = group.branches; + result2.branches = group.branches; if ((group.prs?.length ?? 0) > 0) - result3.prs = group.prs; + result2.prs = group.prs; } if (group.hookCount > 0) { - result3.hookTotalMs = group.hookTotalMs; - result3.hookCount = group.hookCount; - result3.hookInfos = group.hookInfos; + result2.hookTotalMs = group.hookTotalMs; + result2.hookCount = group.hookCount; + result2.hookInfos = group.hookInfos; } if (group.relevantMemories && group.relevantMemories.length > 0) { - result3.relevantMemories = group.relevantMemories; + result2.relevantMemories = group.relevantMemories; } - return result3; + return result2; } function collapseReadSearchGroups(messages, tools) { - const result3 = []; + const result2 = []; let currentGroup = createEmptyGroup(); let deferredSkippable = []; function flushGroup() { if (currentGroup.messages.length === 0) { return; } - result3.push(createCollapsedGroup(currentGroup)); + result2.push(createCollapsedGroup(currentGroup)); for (const deferred of deferredSkippable) { - result3.push(deferred); + result2.push(deferred); } deferredSkippable = []; currentGroup = createEmptyGroup(); @@ -526182,25 +449793,25 @@ function collapseReadSearchGroups(messages, tools) { const count3 = countToolUses2(msg); currentGroup.mcpCallCount = (currentGroup.mcpCallCount ?? 0) + count3; currentGroup.mcpServerNames?.add(toolInfo.mcpServerName); - const input11 = toolInfo.input; - if (input11?.query) { - currentGroup.latestDisplayHint = `"${input11.query}"`; + const input = toolInfo.input; + if (input?.query) { + currentGroup.latestDisplayHint = `"${input.query}"`; } } else if (isFullscreenEnvEnabled() && toolInfo.isBash) { const count3 = countToolUses2(msg); currentGroup.bashCount = (currentGroup.bashCount ?? 0) + count3; - const input11 = toolInfo.input; - if (input11?.command) { - currentGroup.latestDisplayHint = extractBashCommentLabel(input11.command) ?? commandAsHint(input11.command); + const input = toolInfo.input; + if (input?.command) { + currentGroup.latestDisplayHint = extractBashCommentLabel(input.command) ?? commandAsHint(input.command); for (const id of getToolUseIdsFromMessage(msg)) { - currentGroup.bashCommands?.set(id, input11.command); + currentGroup.bashCommands?.set(id, input.command); } } } else if (toolInfo.isList) { currentGroup.listCount += countToolUses2(msg); - const input11 = toolInfo.input; - if (input11?.command) { - currentGroup.latestDisplayHint = commandAsHint(input11.command); + const input = toolInfo.input; + if (input?.command) { + currentGroup.latestDisplayHint = commandAsHint(input.command); } } else if (toolInfo.isSearch) { const count3 = countToolUses2(msg); @@ -526210,10 +449821,10 @@ function collapseReadSearchGroups(messages, tools) { } else if (isMemorySearch(toolInfo.input)) { currentGroup.memorySearchCount += count3; } else { - const input11 = toolInfo.input; - if (input11?.pattern) { - currentGroup.nonMemSearchArgs.push(input11.pattern); - currentGroup.latestDisplayHint = `"${input11.pattern}"`; + const input = toolInfo.input; + if (input?.pattern) { + currentGroup.nonMemSearchArgs.push(input.pattern); + currentGroup.latestDisplayHint = `"${input.pattern}"`; } } } else { @@ -526230,9 +449841,9 @@ function collapseReadSearchGroups(messages, tools) { } if (filePaths.length === 0) { currentGroup.readOperationCount += countToolUses2(msg); - const input11 = toolInfo.input; - if (input11?.command) { - currentGroup.latestDisplayHint = commandAsHint(input11.command); + const input = toolInfo.input; + if (input?.command) { + currentGroup.latestDisplayHint = commandAsHint(input.command); } } } @@ -526247,7 +449858,7 @@ function collapseReadSearchGroups(messages, tools) { } } else if (currentGroup.messages.length > 0 && isPreToolHookSummary(msg)) { currentGroup.hookCount += msg.hookCount; - currentGroup.hookTotalMs += msg.totalDurationMs ?? msg.hookInfos.reduce((sum3, h2) => sum3 + (h2.durationMs ?? 0), 0); + currentGroup.hookTotalMs += msg.totalDurationMs ?? msg.hookInfos.reduce((sum2, h2) => sum2 + (h2.durationMs ?? 0), 0); currentGroup.hookInfos.push(...msg.hookInfos); } else if (currentGroup.messages.length > 0 && msg.type === "attachment" && msg.attachment.type === "relevant_memories") { currentGroup.relevantMemories ??= []; @@ -526256,21 +449867,21 @@ function collapseReadSearchGroups(messages, tools) { if (currentGroup.messages.length > 0 && !(msg.type === "attachment" && msg.attachment.type === "nested_memory")) { deferredSkippable.push(msg); } else { - result3.push(msg); + result2.push(msg); } } else if (isTextBreaker(msg)) { flushGroup(); - result3.push(msg); + result2.push(msg); } else if (isNonCollapsibleToolUse(msg, tools)) { flushGroup(); - result3.push(msg); + result2.push(msg); } else { flushGroup(); - result3.push(msg); + result2.push(msg); } } flushGroup(); - return result3; + return result2; } function getSearchReadSummaryText(searchCount, readCount, isActive, replCount = 0, memoryCounts, listCount = 0) { const parts = []; @@ -526308,8 +449919,8 @@ function getSearchReadSummaryText(searchCount, readCount, isActive, replCount = const replVerb = isActive ? "REPL'ing" : "REPL'd"; parts.push(`${replVerb} ${replCount} ${replCount === 1 ? "time" : "times"}`); } - const text2 = parts.join(", "); - return isActive ? `${text2}…` : text2; + const text = parts.join(", "); + return isActive ? `${text}…` : text; } function summarizeRecentActivities(activities) { if (activities.length === 0) { @@ -526317,8 +449928,8 @@ function summarizeRecentActivities(activities) { } let searchCount = 0; let readCount = 0; - for (let i4 = activities.length - 1;i4 >= 0; i4--) { - const activity = activities[i4]; + for (let i3 = activities.length - 1;i3 >= 0; i3--) { + const activity = activities[i3]; if (activity.isSearch) { searchCount++; } else if (activity.isRead) { @@ -526331,9 +449942,9 @@ function summarizeRecentActivities(activities) { if (collapsibleCount >= 2) { return getSearchReadSummaryText(searchCount, readCount, true); } - for (let i4 = activities.length - 1;i4 >= 0; i4--) { - if (activities[i4]?.activityDescription) { - return activities[i4].activityDescription; + for (let i3 = activities.length - 1;i3 >= 0; i3--) { + if (activities[i3]?.activityDescription) { + return activities[i3].activityDescription; } } return; @@ -526343,7 +449954,7 @@ var init_collapseReadSearch = __esm(() => { init_bun_bundle(); init_Tool(); init_prompt4(); - init_constants6(); + init_constants5(); init_primitiveTools(); init_gitOperationTracking(); init_prompt11(); @@ -526377,12 +449988,12 @@ function updateProgressFromMessage(tracker, message, resolveActivityDescription, if (content.type === "tool_use") { tracker.toolUseCount++; if (content.name !== SYNTHETIC_OUTPUT_TOOL_NAME) { - const input11 = content.input; - const classification = tools ? getToolSearchOrReadInfo(content.name, input11, tools) : undefined; + const input = content.input; + const classification = tools ? getToolSearchOrReadInfo(content.name, input, tools) : undefined; tracker.recentActivities.push({ toolName: content.name, - input: input11, - activityDescription: resolveActivityDescription?.(content.name, input11), + input, + activityDescription: resolveActivityDescription?.(content.name, input), isSearch: classification?.isSearch, isRead: classification?.isRead }); @@ -526402,9 +450013,9 @@ function getProgressUpdate(tracker) { }; } function createActivityDescriptionResolver(tools) { - return (toolName, input11) => { + return (toolName, input) => { const tool = findToolByName(tools, toolName); - return tool?.getActivityDescription?.(input11) ?? undefined; + return tool?.getActivityDescription?.(input) ?? undefined; }; } function isLocalAgentTask(task) { @@ -526441,7 +450052,7 @@ function enqueueAgentNotification({ taskId, description, status, - error: error45, + error: error41, setAppState, finalMessage, usage, @@ -526464,7 +450075,7 @@ function enqueueAgentNotification({ return; } abortSpeculation(setAppState); - const summary = status === "completed" ? `Agent "${description}" completed` : status === "failed" ? `Agent "${description}" failed: ${error45 || "Unknown error"}` : `Agent "${description}" was stopped`; + const summary = status === "completed" ? `Agent "${description}" completed` : status === "failed" ? `Agent "${description}" failed: ${error41 || "Unknown error"}` : `Agent "${description}" was stopped`; const outputPath = getTaskOutputPath(taskId); const toolUseIdLine = toolUseId ? ` <${TOOL_USE_ID_TAG}>${toolUseId}` : ""; @@ -526581,8 +450192,8 @@ function updateAgentSummary(taskId, summary, setAppState) { }); } } -function completeAgentTask(result3, setAppState) { - const taskId = result3.agentId; +function completeAgentTask(result2, setAppState) { + const taskId = result2.agentId; updateTaskState(taskId, setAppState, (task) => { if (task.status !== "running") { return task; @@ -526591,7 +450202,7 @@ function completeAgentTask(result3, setAppState) { return { ...task, status: "completed", - result: result3, + result: result2, endTime: Date.now(), evictAfter: task.retain ? undefined : Date.now() + PANEL_GRACE_MS, abortController: undefined, @@ -526601,7 +450212,7 @@ function completeAgentTask(result3, setAppState) { }); evictTaskOutput(taskId); } -function failAgentTask(taskId, error45, setAppState) { +function failAgentTask(taskId, error41, setAppState) { updateTaskState(taskId, setAppState, (task) => { if (task.status !== "running") { return task; @@ -526610,7 +450221,7 @@ function failAgentTask(taskId, error45, setAppState) { return { ...task, status: "failed", - error: error45, + error: error41, endTime: Date.now(), evictAfter: task.retain ? undefined : Date.now() + PANEL_GRACE_MS, abortController: undefined, @@ -526688,8 +450299,8 @@ function registerAgentForeground({ diskLoaded: false }; let resolveBackgroundSignal; - const backgroundSignal = new Promise((resolve36) => { - resolveBackgroundSignal = resolve36; + const backgroundSignal = new Promise((resolve30) => { + resolveBackgroundSignal = resolve30; }); backgroundSignalResolvers.set(agentId, resolveBackgroundSignal); registerTask(taskState, setAppState); @@ -526766,11 +450377,11 @@ function unregisterAgentForeground(taskId, setAppState) { cleanupFn = task.unregisterCleanup; const { [taskId]: removed, - ...rest3 + ...rest2 } = prev.tasks; return { ...prev, - tasks: rest3 + tasks: rest2 }; }); cleanupFn?.(); @@ -526803,9 +450414,9 @@ var init_LocalAgentTask = __esm(() => { }); // src/tasks/LocalShellTask/LocalShellTask.tsx -import { stat as stat31 } from "fs/promises"; -function looksLikePrompt(tail3) { - const lastLine = tail3.trimEnd().split(` +import { stat as stat30 } from "fs/promises"; +function looksLikePrompt(tail2) { + const lastLine = tail2.trimEnd().split(` `).pop() ?? ""; return PROMPT_PATTERNS.some((p) => p.test(lastLine)); } @@ -526817,7 +450428,7 @@ function startStallWatchdog(taskId, description, kind, toolUseId, agentId) { let lastGrowth = Date.now(); let cancelled = false; const timer = setInterval(() => { - stat31(outputPath).then((s) => { + stat30(outputPath).then((s) => { if (s.size > lastSize) { lastSize = s.size; lastGrowth = Date.now(); @@ -526921,7 +450532,7 @@ function enqueueShellNotification(taskId, description, status, exitCode, setAppS agentId }); } -async function spawnShellTask(input11, context) { +async function spawnShellTask(input, context) { const { command, description, @@ -526929,7 +450540,7 @@ async function spawnShellTask(input11, context) { toolUseId, agentId, kind - } = input11; + } = input; const { setAppState } = context; @@ -526956,7 +450567,7 @@ async function spawnShellTask(input11, context) { registerTask(taskState, setAppState); shellCommand.background(taskId); const cancelStallWatchdog = startStallWatchdog(taskId, description, kind, toolUseId, agentId); - shellCommand.result.then(async (result3) => { + shellCommand.result.then(async (result2) => { cancelStallWatchdog(); await flushAndCleanup(shellCommand); let wasKilled = false; @@ -526967,17 +450578,17 @@ async function spawnShellTask(input11, context) { } return { ...task, - status: result3.code === 0 ? "completed" : "failed", + status: result2.code === 0 ? "completed" : "failed", result: { - code: result3.code, - interrupted: result3.interrupted + code: result2.code, + interrupted: result2.interrupted }, shellCommand: null, unregisterCleanup: undefined, endTime: Date.now() }; }); - enqueueShellNotification(taskId, description, wasKilled ? "killed" : result3.code === 0 ? "completed" : "failed", result3.code, setAppState, toolUseId, kind, agentId); + enqueueShellNotification(taskId, description, wasKilled ? "killed" : result2.code === 0 ? "completed" : "failed", result2.code, setAppState, toolUseId, kind, agentId); evictTaskOutput(taskId); }); return { @@ -526987,13 +450598,13 @@ async function spawnShellTask(input11, context) { } }; } -function registerForeground(input11, setAppState, toolUseId) { +function registerForeground(input, setAppState, toolUseId) { const { command, description, shellCommand, agentId - } = input11; + } = input; const taskId = shellCommand.taskOutput.taskId; const unregisterCleanup = registerCleanup(async () => { killTask(taskId, setAppState); @@ -527046,7 +450657,7 @@ function backgroundTask(taskId, getAppState, setAppState) { }; }); const cancelStallWatchdog = startStallWatchdog(taskId, description, kind, toolUseId, agentId); - shellCommand.result.then(async (result3) => { + shellCommand.result.then(async (result2) => { cancelStallWatchdog(); await flushAndCleanup(shellCommand); let wasKilled = false; @@ -527059,10 +450670,10 @@ function backgroundTask(taskId, getAppState, setAppState) { cleanupFn = t.unregisterCleanup; return { ...t, - status: result3.code === 0 ? "completed" : "failed", + status: result2.code === 0 ? "completed" : "failed", result: { - code: result3.code, - interrupted: result3.interrupted + code: result2.code, + interrupted: result2.interrupted }, shellCommand: null, unregisterCleanup: undefined, @@ -527071,10 +450682,10 @@ function backgroundTask(taskId, getAppState, setAppState) { }); cleanupFn?.(); if (wasKilled) { - enqueueShellNotification(taskId, description, "killed", result3.code, setAppState, toolUseId, kind, agentId); + enqueueShellNotification(taskId, description, "killed", result2.code, setAppState, toolUseId, kind, agentId); } else { - const finalStatus = result3.code === 0 ? "completed" : "failed"; - enqueueShellNotification(taskId, description, finalStatus, result3.code, setAppState, toolUseId, kind, agentId); + const finalStatus = result2.code === 0 ? "completed" : "failed"; + enqueueShellNotification(taskId, description, finalStatus, result2.code, setAppState, toolUseId, kind, agentId); } evictTaskOutput(taskId); }); @@ -527131,7 +450742,7 @@ function backgroundExistingForegroundTask(taskId, shellCommand, description, set }; }); const cancelStallWatchdog = startStallWatchdog(taskId, description, undefined, toolUseId, agentId); - shellCommand.result.then(async (result3) => { + shellCommand.result.then(async (result2) => { cancelStallWatchdog(); await flushAndCleanup(shellCommand); let wasKilled = false; @@ -527144,10 +450755,10 @@ function backgroundExistingForegroundTask(taskId, shellCommand, description, set cleanupFn = t.unregisterCleanup; return { ...t, - status: result3.code === 0 ? "completed" : "failed", + status: result2.code === 0 ? "completed" : "failed", result: { - code: result3.code, - interrupted: result3.interrupted + code: result2.code, + interrupted: result2.interrupted }, shellCommand: null, unregisterCleanup: undefined, @@ -527155,8 +450766,8 @@ function backgroundExistingForegroundTask(taskId, shellCommand, description, set }; }); cleanupFn?.(); - const finalStatus = wasKilled ? "killed" : result3.code === 0 ? "completed" : "failed"; - enqueueShellNotification(taskId, description, finalStatus, result3.code, setAppState, toolUseId, undefined, agentId); + const finalStatus = wasKilled ? "killed" : result2.code === 0 ? "completed" : "failed"; + enqueueShellNotification(taskId, description, finalStatus, result2.code, setAppState, toolUseId, undefined, agentId); evictTaskOutput(taskId); }); return true; @@ -527177,11 +450788,11 @@ function unregisterForeground(taskId, setAppState) { cleanupFn = task.unregisterCleanup; const { [taskId]: removed, - ...rest3 + ...rest2 } = prev.tasks; return { ...prev, - tasks: rest3 + tasks: rest2 }; }); cleanupFn?.(); @@ -527190,8 +450801,8 @@ async function flushAndCleanup(shellCommand) { try { await shellCommand.taskOutput.flush(); shellCommand.cleanup(); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } var BACKGROUND_BASH_SUMMARY_PREFIX = "Background command ", STALL_CHECK_INTERVAL_MS = 5000, STALL_THRESHOLD_MS = 45000, STALL_TAIL_BYTES = 1024, PROMPT_PATTERNS, LocalShellTask; @@ -527321,10 +450932,10 @@ function heuristicallyExtractBaseCommand2(command) { } function interpretCommandResult2(command, exitCode, stdout, stderr) { const semantic = getCommandSemantic(command); - const result3 = semantic(exitCode, stdout, stderr); + const result2 = semantic(exitCode, stdout, stderr); return { - isError: result3.isError, - message: result3.message + isError: result2.isError, + message: result2.message }; } var DEFAULT_SEMANTIC2 = (exitCode, _stdout, _stderr) => ({ @@ -527381,7 +450992,7 @@ var init_commandSemantics2 = __esm(() => { // src/services/teamMemorySync/types.ts var TeamMemoryContentSchema, TeamMemoryDataSchema, TeamMemoryTooManyEntriesSchema; -var init_types12 = __esm(() => { +var init_types10 = __esm(() => { init_v4(); TeamMemoryContentSchema = lazySchema(() => exports_external.object({ entries: exports_external.record(exports_external.string(), exports_external.string()), @@ -527407,9 +451018,9 @@ var init_types12 = __esm(() => { }); // src/services/teamMemorySync/index.ts -import { createHash as createHash19 } from "crypto"; -import { mkdir as mkdir26, readdir as readdir18, readFile as readFile30, stat as stat32, writeFile as writeFile29 } from "fs/promises"; -import { join as join100, relative as relative21, sep as sep25 } from "path"; +import { createHash as createHash18 } from "crypto"; +import { mkdir as mkdir26, readdir as readdir18, readFile as readFile29, stat as stat31, writeFile as writeFile27 } from "fs/promises"; +import { join as join90, relative as relative19, sep as sep22 } from "path"; function createSyncState() { return { lastKnownChecksum: null, @@ -527418,7 +451029,7 @@ function createSyncState() { }; } function hashContent2(content) { - return "sha256:" + createHash19("sha256").update(content, "utf8").digest("hex"); + return "sha256:" + createHash18("sha256").update(content, "utf8").digest("hex"); } function isErrnoException(e) { return e instanceof Error && "code" in e && typeof e.code === "string"; @@ -527434,7 +451045,7 @@ function getTeamMemorySyncEndpoint(repoSlug) { const baseUrl = process.env.TEAM_MEMORY_SYNC_URL || getOauthConfig().BASE_API_URL; return `${baseUrl}/api/claude_code/team_memory?repo=${encodeURIComponent(repoSlug)}`; } -function getAuthHeaders4() { +function getAuthHeaders3() { const oauthTokens = getClaudeAIOAuthTokens(); if (oauthTokens?.accessToken) { return { @@ -527450,7 +451061,7 @@ function getAuthHeaders4() { async function fetchTeamMemoryOnce(state, repoSlug, etag) { try { await checkAndRefreshOAuthTokenIfNeeded(); - const auth2 = getAuthHeaders4(); + const auth2 = getAuthHeaders3(); if (auth2.error) { return { success: false, @@ -527505,9 +451116,9 @@ async function fetchTeamMemoryOnce(state, repoSlug, etag) { isEmpty: false, checksum: responseChecksum }; - } catch (error45) { - const { kind, status, message } = classifyAxiosError(error45); - const body = axios_default.isAxiosError(error45) ? JSON.stringify(error45.response?.data ?? "") : ""; + } catch (error41) { + const { kind, status, message } = classifyAxiosError(error41); + const body = axios_default.isAxiosError(error41) ? JSON.stringify(error41.response?.data ?? "") : ""; if (kind !== "other") { logForDebugging(`team-memory-sync: fetch error ${status}: ${body}`, { level: "warn" @@ -527547,7 +451158,7 @@ async function fetchTeamMemoryOnce(state, repoSlug, etag) { async function fetchTeamMemoryHashes(state, repoSlug) { try { await checkAndRefreshOAuthTokenIfNeeded(); - const auth2 = getAuthHeaders4(); + const auth2 = getAuthHeaders3(); if (auth2.error) { return { success: false, error: auth2.error, errorType: "auth" }; } @@ -527579,8 +451190,8 @@ async function fetchTeamMemoryHashes(state, repoSlug) { checksum, entryChecksums }; - } catch (error45) { - const { kind, status, message } = classifyAxiosError(error45); + } catch (error41) { + const { kind, status, message } = classifyAxiosError(error41); switch (kind) { case "auth": return { @@ -527605,32 +451216,32 @@ async function fetchTeamMemoryHashes(state, repoSlug) { } async function fetchTeamMemory(state, repoSlug, etag) { let lastResult2 = null; - for (let attempt3 = 1;attempt3 <= MAX_RETRIES3 + 1; attempt3++) { + for (let attempt2 = 1;attempt2 <= MAX_RETRIES3 + 1; attempt2++) { lastResult2 = await fetchTeamMemoryOnce(state, repoSlug, etag); if (lastResult2.success || lastResult2.skipRetry) { return lastResult2; } - if (attempt3 > MAX_RETRIES3) { + if (attempt2 > MAX_RETRIES3) { return lastResult2; } - const delayMs = getRetryDelay(attempt3); - logForDebugging(`team-memory-sync: retry ${attempt3}/${MAX_RETRIES3}`, { + const delayMs = getRetryDelay(attempt2); + logForDebugging(`team-memory-sync: retry ${attempt2}/${MAX_RETRIES3}`, { level: "debug" }); - await sleep4(delayMs); + await sleep2(delayMs); } return lastResult2; } function batchDeltaByBytes(delta) { - const keys3 = Object.keys(delta).sort(); - if (keys3.length === 0) + const keys2 = Object.keys(delta).sort(); + if (keys2.length === 0) return []; const EMPTY_BODY_BYTES = Buffer.byteLength('{"entries":{}}', "utf8"); const entryBytes = (k, v) => Buffer.byteLength(jsonStringify(k), "utf8") + Buffer.byteLength(jsonStringify(v), "utf8") + 2; const batches = []; let current = {}; let currentBytes = EMPTY_BODY_BYTES; - for (const key of keys3) { + for (const key of keys2) { const added = entryBytes(key, delta[key]); if (currentBytes + added > MAX_PUT_BODY_BYTES && Object.keys(current).length > 0) { batches.push(current); @@ -527646,7 +451257,7 @@ function batchDeltaByBytes(delta) { async function uploadTeamMemory(state, repoSlug, entries, ifMatchChecksum) { try { await checkAndRefreshOAuthTokenIfNeeded(); - const auth2 = getAuthHeaders4(); + const auth2 = getAuthHeaders3(); if (auth2.error) { return { success: false, error: auth2.error, errorType: "auth" }; } @@ -527679,16 +451290,16 @@ async function uploadTeamMemory(state, repoSlug, entries, ifMatchChecksum) { checksum: responseChecksum, lastModified: response.data?.lastModified }; - } catch (error45) { - const body = axios_default.isAxiosError(error45) ? JSON.stringify(error45.response?.data ?? "") : ""; - logForDebugging(`team-memory-sync: upload failed: ${error45 instanceof Error ? error45.message : ""} ${body}`, { level: "warn" }); - const { kind, status: httpStatus, message } = classifyAxiosError(error45); + } catch (error41) { + const body = axios_default.isAxiosError(error41) ? JSON.stringify(error41.response?.data ?? "") : ""; + logForDebugging(`team-memory-sync: upload failed: ${error41 instanceof Error ? error41.message : ""} ${body}`, { level: "warn" }); + const { kind, status: httpStatus, message } = classifyAxiosError(error41); const errorType = kind === "http" || kind === "other" ? "unknown" : kind; let serverErrorCode; let serverMaxEntries; let serverReceivedEntries; - if (httpStatus === 413 && axios_default.isAxiosError(error45)) { - const parsed = TeamMemoryTooManyEntriesSchema().safeParse(error45.response?.data); + if (httpStatus === 413 && axios_default.isAxiosError(error41)) { + const parsed = TeamMemoryTooManyEntriesSchema().safeParse(error41.response?.data); if (parsed.success) { serverErrorCode = parsed.data.error.details.error_code; serverMaxEntries = parsed.data.error.details.max_entries; @@ -527714,18 +451325,18 @@ async function readLocalTeamMemory(maxEntries) { try { const dirEntries = await readdir18(dir, { withFileTypes: true }); await Promise.all(dirEntries.map(async (entry) => { - const fullPath = join100(dir, entry.name); + const fullPath = join90(dir, entry.name); if (entry.isDirectory()) { await walkDir(fullPath); } else if (entry.isFile()) { try { - const stats = await stat32(fullPath); + const stats = await stat31(fullPath); if (stats.size > MAX_FILE_SIZE_BYTES3) { logForDebugging(`team-memory-sync: skipping oversized file ${entry.name} (${stats.size} > ${MAX_FILE_SIZE_BYTES3} bytes)`, { level: "info" }); return; } - const content = await readFile30(fullPath, "utf8"); - const relPath = relative21(teamDir, fullPath).replaceAll("\\", "/"); + const content = await readFile29(fullPath, "utf8"); + const relPath = relative19(teamDir, fullPath).replaceAll("\\", "/"); const secretMatches = scanForSecrets(content); if (secretMatches.length > 0) { const firstMatch = secretMatches[0]; @@ -527752,17 +451363,17 @@ async function readLocalTeamMemory(maxEntries) { } } await walkDir(teamDir); - const keys3 = Object.keys(entries).sort(); - if (maxEntries !== null && keys3.length > maxEntries) { - const dropped = keys3.slice(maxEntries); - logForDebugging(`team-memory-sync: ${keys3.length} local entries exceeds server cap of ${maxEntries}; ${dropped.length} file(s) will NOT sync: ${dropped.join(", ")}. Consider consolidating or removing some team memory files.`, { level: "warn" }); + const keys2 = Object.keys(entries).sort(); + if (maxEntries !== null && keys2.length > maxEntries) { + const dropped = keys2.slice(maxEntries); + logForDebugging(`team-memory-sync: ${keys2.length} local entries exceeds server cap of ${maxEntries}; ${dropped.length} file(s) will NOT sync: ${dropped.join(", ")}. Consider consolidating or removing some team memory files.`, { level: "warn" }); logEvent("tengu_team_mem_entries_capped", { - total_entries: keys3.length, + total_entries: keys2.length, dropped_count: dropped.length, max_entries: maxEntries }); const truncated = {}; - for (const key of keys3.slice(0, maxEntries)) { + for (const key of keys2.slice(0, maxEntries)) { truncated[key] = entries[key]; } return { entries: truncated, skippedSecrets }; @@ -527787,7 +451398,7 @@ async function writeRemoteEntriesToLocal(entries) { return false; } try { - const existing = await readFile30(validatedPath, "utf8"); + const existing = await readFile29(validatedPath, "utf8"); if (existing === content) { return false; } @@ -527797,9 +451408,9 @@ async function writeRemoteEntriesToLocal(entries) { } } try { - const parentDir = validatedPath.substring(0, validatedPath.lastIndexOf(sep25)); + const parentDir = validatedPath.substring(0, validatedPath.lastIndexOf(sep22)); await mkdir26(parentDir, { recursive: true }); - await writeFile29(validatedPath, content, "utf8"); + await writeFile27(validatedPath, content, "utf8"); return true; } catch (e) { logForDebugging(`team-memory-sync: failed to write "${relPath}": ${e}`, { level: "warn" }); @@ -527834,31 +451445,31 @@ async function pullTeamMemory(state, options2) { }; } const etag = skipEtagCache ? null : state.lastKnownChecksum; - const result3 = await fetchTeamMemory(state, repoSlug, etag); - if (!result3.success) { + const result2 = await fetchTeamMemory(state, repoSlug, etag); + if (!result2.success) { logPull(startTime, { success: false, - errorType: result3.errorType, - status: result3.httpStatus + errorType: result2.errorType, + status: result2.httpStatus }); return { success: false, filesWritten: 0, entryCount: 0, - error: result3.error + error: result2.error }; } - if (result3.notModified) { + if (result2.notModified) { logPull(startTime, { success: true, notModified: true }); return { success: true, filesWritten: 0, entryCount: 0, notModified: true }; } - if (result3.isEmpty || !result3.data) { + if (result2.isEmpty || !result2.data) { state.serverChecksums.clear(); logPull(startTime, { success: true }); return { success: true, filesWritten: 0, entryCount: 0 }; } - const entries = result3.data.content.entries; - const responseChecksums = result3.data.content.entryChecksums; + const entries = result2.data.content.entries; + const responseChecksums = result2.data.content.entryChecksums; state.serverChecksums.clear(); if (responseChecksums) { for (const [key, hash2] of Object.entries(responseChecksums)) { @@ -527942,18 +451553,18 @@ async function pushTeamMemory(state) { } const batches = batchDeltaByBytes(delta); let filesUploaded = 0; - let result3; + let result2; for (const batch of batches) { - result3 = await uploadTeamMemory(state, repoSlug, batch, state.lastKnownChecksum); - if (!result3.success) + result2 = await uploadTeamMemory(state, repoSlug, batch, state.lastKnownChecksum); + if (!result2.success) break; for (const key of Object.keys(batch)) { state.serverChecksums.set(key, localHashes.get(key)); } filesUploaded += Object.keys(batch).length; } - result3 = result3; - if (result3.success) { + result2 = result2; + if (result2.success) { logForDebugging(batches.length > 1 ? `team-memory-sync: pushed ${filesUploaded} of ${localHashes.size} files in ${batches.length} batches` : `team-memory-sync: pushed ${filesUploaded} of ${localHashes.size} files (delta)`, { level: "info" }); logPush(startTime, { success: true, @@ -527965,32 +451576,32 @@ async function pushTeamMemory(state) { return { success: true, filesUploaded, - checksum: result3.checksum, + checksum: result2.checksum, ...skippedSecrets.length > 0 && { skippedSecrets } }; } - if (!result3.conflict) { - if (result3.serverMaxEntries !== undefined) { - state.serverMaxEntries = result3.serverMaxEntries; - logForDebugging(`team-memory-sync: learned server max_entries=${result3.serverMaxEntries} from 413; next push will truncate to this`, { level: "warn" }); + if (!result2.conflict) { + if (result2.serverMaxEntries !== undefined) { + state.serverMaxEntries = result2.serverMaxEntries; + logForDebugging(`team-memory-sync: learned server max_entries=${result2.serverMaxEntries} from 413; next push will truncate to this`, { level: "warn" }); } logPush(startTime, { success: false, filesUploaded, conflictRetries, putBatches: batches.length > 1 ? batches.length : undefined, - errorType: result3.errorType, - status: result3.httpStatus, - errorCode: result3.serverErrorCode, - serverMaxEntries: result3.serverMaxEntries, - serverReceivedEntries: result3.serverReceivedEntries + errorType: result2.errorType, + status: result2.httpStatus, + errorCode: result2.serverErrorCode, + serverMaxEntries: result2.serverMaxEntries, + serverReceivedEntries: result2.serverReceivedEntries }); return { success: false, filesUploaded, - error: result3.error, - errorType: result3.errorType, - httpStatus: result3.httpStatus + error: result2.error, + errorType: result2.errorType, + httpStatus: result2.httpStatus }; } sawConflict = true; @@ -528078,7 +451689,7 @@ var init_teamMemorySync = __esm(() => { init_axios2(); init_oauth(); init_teamMemPaths(); - init_auth2(); + init_auth(); init_debug(); init_errors(); init_git(); @@ -528087,7 +451698,7 @@ var init_teamMemorySync = __esm(() => { init_analytics(); init_withRetry(); init_secretScanner(); - init_types12(); + init_types10(); }); // src/services/teamMemorySync/watcher.ts @@ -528101,8 +451712,8 @@ __export(exports_watcher, { _resetWatcherStateForTesting: () => _resetWatcherStateForTesting }); import { watch as watch3 } from "fs"; -import { mkdir as mkdir27, stat as stat33 } from "fs/promises"; -import { join as join101 } from "path"; +import { mkdir as mkdir27, stat as stat32 } from "fs/promises"; +import { join as join91 } from "path"; function isPermanentFailure(r) { if (r.errorType === "no_oauth" || r.errorType === "no_repo") return true; @@ -528117,22 +451728,22 @@ async function executePush() { } pushInProgress = true; try { - const result3 = await pushTeamMemory(syncState); - if (result3.success) { + const result2 = await pushTeamMemory(syncState); + if (result2.success) { hasPendingChanges = false; } - if (result3.success && result3.filesUploaded > 0) { - logForDebugging(`team-memory-watcher: pushed ${result3.filesUploaded} files`, { level: "info" }); - } else if (!result3.success) { - logForDebugging(`team-memory-watcher: push failed: ${result3.error}`, { + if (result2.success && result2.filesUploaded > 0) { + logForDebugging(`team-memory-watcher: pushed ${result2.filesUploaded} files`, { level: "info" }); + } else if (!result2.success) { + logForDebugging(`team-memory-watcher: push failed: ${result2.error}`, { level: "warn" }); - if (isPermanentFailure(result3) && pushSuppressedReason === null) { - pushSuppressedReason = result3.httpStatus !== undefined ? `http_${result3.httpStatus}` : result3.errorType ?? "unknown"; + if (isPermanentFailure(result2) && pushSuppressedReason === null) { + pushSuppressedReason = result2.httpStatus !== undefined ? `http_${result2.httpStatus}` : result2.errorType ?? "unknown"; logForDebugging(`team-memory-watcher: suppressing retry until next unlink or session restart (${pushSuppressedReason})`, { level: "warn" }); logEvent("tengu_team_mem_push_suppressed", { reason: pushSuppressedReason, - ...result3.httpStatus && { status: result3.httpStatus } + ...result2.httpStatus && { status: result2.httpStatus } }); } } @@ -528173,8 +451784,8 @@ async function startFileWatcher(teamDir) { return; } if (pushSuppressedReason !== null) { - stat33(join101(teamDir, filename)).catch((err3) => { - if (err3.code !== "ENOENT") + stat32(join91(teamDir, filename)).catch((err2) => { + if (err2.code !== "ENOENT") return; if (pushSuppressedReason !== null) { logForDebugging(`team-memory-watcher: unlink cleared suppression (was: ${pushSuppressedReason})`, { level: "info" }); @@ -528186,14 +451797,14 @@ async function startFileWatcher(teamDir) { } schedulePush(); }); - watcher4.on("error", (err3) => { - logForDebugging(`team-memory-watcher: fs.watch error: ${errorMessage(err3)}`, { level: "warn" }); + watcher4.on("error", (err2) => { + logForDebugging(`team-memory-watcher: fs.watch error: ${errorMessage(err2)}`, { level: "warn" }); }); logForDebugging(`team-memory-watcher: watching ${teamDir}`, { level: "debug" }); - } catch (err3) { - logForDebugging(`team-memory-watcher: failed to watch ${teamDir}: ${errorMessage(err3)}`, { level: "warn" }); + } catch (err2) { + logForDebugging(`team-memory-watcher: failed to watch ${teamDir}: ${errorMessage(err2)}`, { level: "warn" }); } registerCleanup(async () => stopTeamMemoryWatcher()); } @@ -528287,9 +451898,9 @@ var init_watcher = __esm(() => { var exports_memoryShapeTelemetry = {}; __export(exports_memoryShapeTelemetry, { default: () => memoryShapeTelemetry_default, - __stub__: () => __stub__21 + __stub__: () => __stub__27 }); -var memoryShapeTelemetry_default, __stub__21 = true; +var memoryShapeTelemetry_default, __stub__27 = true; var init_memoryShapeTelemetry = __esm(() => { memoryShapeTelemetry_default = {}; }); @@ -528370,10 +451981,10 @@ function isMemoryFileAccess(toolName, toolInput) { } return false; } -async function handleSessionFileAccess(input11, _toolUseID, _signal) { - if (input11.hook_event_name !== "PostToolUse") +async function handleSessionFileAccess(input, _toolUseID, _signal) { + if (input.hook_event_name !== "PostToolUse") return {}; - const fileType = getSessionFileTypeFromInput(input11.tool_name, input11.tool_input); + const fileType = getSessionFileTypeFromInput(input.tool_name, input.tool_input); const subagentName = getSubagentLogName(); const subagentProps = subagentName ? { subagent_name: subagentName } : {}; if (fileType === "session_memory") { @@ -528381,13 +451992,13 @@ async function handleSessionFileAccess(input11, _toolUseID, _signal) { } else if (fileType === "session_transcript") { logEvent("tengu_transcript_accessed", { ...subagentProps }); } - const filePath = getFilePathFromInput(input11.tool_name, input11.tool_input); + const filePath = getFilePathFromInput(input.tool_name, input.tool_input); if (filePath && isAutoMemFile(filePath)) { logEvent("tengu_memdir_accessed", { - tool: input11.tool_name, + tool: input.tool_name, ...subagentProps }); - switch (input11.tool_name) { + switch (input.tool_name) { case FILE_READ_TOOL_NAME: logEvent("tengu_memdir_file_read", { ...subagentProps }); break; @@ -528401,10 +452012,10 @@ async function handleSessionFileAccess(input11, _toolUseID, _signal) { } if (feature("TEAMMEM") && filePath && teamMemPaths4.isTeamMemFile(filePath)) { logEvent("tengu_team_mem_accessed", { - tool: input11.tool_name, + tool: input.tool_name, ...subagentProps }); - switch (input11.tool_name) { + switch (input.tool_name) { case FILE_READ_TOOL_NAME: logEvent("tengu_team_mem_file_read", { ...subagentProps }); break; @@ -528420,8 +452031,8 @@ async function handleSessionFileAccess(input11, _toolUseID, _signal) { } if (feature("MEMORY_SHAPE_TELEMETRY") && filePath) { const scope = memoryScopeForPath(filePath); - if (scope !== null && (input11.tool_name === FILE_EDIT_TOOL_NAME || input11.tool_name === FILE_WRITE_TOOL_NAME)) { - memoryShapeTelemetry.logMemoryWriteShape(input11.tool_name, input11.tool_input, filePath, scope); + if (scope !== null && (input.tool_name === FILE_EDIT_TOOL_NAME || input.tool_name === FILE_WRITE_TOOL_NAME)) { + memoryShapeTelemetry.logMemoryWriteShape(input.tool_name, input.tool_input, filePath, scope); } } return {}; @@ -528448,7 +452059,7 @@ var init_sessionFileAccessHooks = __esm(() => { init_bun_bundle(); init_state(); init_analytics(); - init_types11(); + init_types9(); init_FileReadTool(); init_prompt3(); init_FileWriteTool(); @@ -528524,7 +452135,7 @@ var init_attributionTrailer = __esm(() => { }); // src/utils/attribution.ts -import { stat as stat34 } from "fs/promises"; +import { stat as stat33 } from "fs/promises"; function getAttributionTexts() { if (process.env.USER_TYPE === "ant" && isUndercover()) { return { commit: "", pr: "" }; @@ -528605,15 +452216,15 @@ async function getPRAttributionData(appState) { return null; } const fileStates = attribution.fileStates; - const isMap3 = fileStates instanceof Map; - const trackedFiles = isMap3 ? Array.from(fileStates.keys()) : Object.keys(fileStates); + const isMap2 = fileStates instanceof Map; + const trackedFiles = isMap2 ? Array.from(fileStates.keys()) : Object.keys(fileStates); if (trackedFiles.length === 0) { return null; } try { return await calculateCommitAttribution([attribution], trackedFiles); - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); return null; } } @@ -528637,7 +452248,7 @@ function countMemoryFileAccessFromEntries(entries) { async function getTranscriptStats() { try { const filePath = getTranscriptPath(); - const fileSize = (await stat34(filePath)).size; + const fileSize = (await stat33(filePath)).size; const scan = await readTranscriptForLoad(filePath, fileSize); const buf = scan.postBoundaryBuf; const entries = parseJSONL(buf); @@ -528677,8 +452288,8 @@ async function getEnhancedPRAttribution(getAppState) { logForDebugging(`PR Attribution: appState.attribution exists: ${!!appState.attribution}`); if (appState.attribution) { const fileStates = appState.attribution.fileStates; - const isMap3 = fileStates instanceof Map; - const fileCount = isMap3 ? fileStates.size : Object.keys(fileStates).length; + const isMap2 = fileStates instanceof Map; + const fileCount = isMap2 ? fileStates.size : Object.keys(fileStates).length; logForDebugging(`PR Attribution: fileStates count: ${fileCount}`); } const [attributionData, { promptCount, memoryAccessCount }, isInternal] = await Promise.all([ @@ -528699,12 +452310,12 @@ async function getEnhancedPRAttribution(getAppState) { if (feature("COMMIT_ATTRIBUTION") && isInternal && attributionData) { const { buildPRTrailers: buildPRTrailers2 } = await Promise.resolve().then(() => (init_attributionTrailer(), exports_attributionTrailer)); const trailers = buildPRTrailers2(attributionData, appState.attribution); - const result3 = `${summary} + const result2 = `${summary} ${trailers.join(` `)}`; - logForDebugging(`PR Attribution: returning with trailers: ${result3}`); - return result3; + logForDebugging(`PR Attribution: returning with trailers: ${result2}`); + return result2; } logForDebugging(`PR Attribution: returning summary: ${summary}`); return summary; @@ -529026,7 +452637,7 @@ function getSimplePrompt() { } var init_prompt24 = __esm(() => { init_bun_bundle(); - init_prompts5(); + init_prompts4(); init_attribution(); init_embeddedTools(); init_envUtils(); @@ -529043,7 +452654,7 @@ var init_prompt24 = __esm(() => { }); // src/tools/BashTool/BashTool.tsx -import { copyFile as copyFile7, stat as fsStat2, truncate as fsTruncate2, link as link5 } from "fs/promises"; +import { copyFile as copyFile6, stat as fsStat2, truncate as fsTruncate2, link as link5 } from "fs/promises"; function isSearchOrReadBashCommand(command) { let partsWithOperators; try { @@ -529189,8 +452800,8 @@ function detectBlockedSleepPattern2(command) { const secs = parseInt(m[1], 10); if (secs < 2) return null; - const rest3 = parts.slice(1).join(" ").trim(); - return rest3 ? `sleep ${secs} followed by: ${rest3}` : `standalone sleep ${secs}`; + const rest2 = parts.slice(1).join(" ").trim(); + return rest2 ? `sleep ${secs} followed by: ${rest2}` : `standalone sleep ${secs}`; } async function applySedEdit(simulatedEdit, toolUseContext, parentMessage) { const { @@ -529198,11 +452809,11 @@ async function applySedEdit(simulatedEdit, toolUseContext, parentMessage) { newContent } = simulatedEdit; const absoluteFilePath = expandPath(filePath); - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const encoding = detectFileEncoding(absoluteFilePath); let originalContent; try { - originalContent = await fs11.readFile(absoluteFilePath, { + originalContent = await fs5.readFile(absoluteFilePath, { encoding }); } catch (e) { @@ -529239,7 +452850,7 @@ Exit code 1`, }; } async function* runShellCommand({ - input: input11, + input, abortController, setAppState, setToolJSX, @@ -529253,7 +452864,7 @@ async function* runShellCommand({ description, timeout, run_in_background - } = input11; + } = input; const timeoutMs = timeout || getDefaultTimeoutMs2(); let fullOutput = ""; let lastProgressOutput = ""; @@ -529263,8 +452874,8 @@ async function* runShellCommand({ let assistantAutoBackgrounded = false; let resolveProgress = null; function createProgressSignal() { - return new Promise((resolve36) => { - resolveProgress = () => resolve36(null); + return new Promise((resolve30) => { + resolveProgress = () => resolve30(null); }); } const shouldAutoBackground = !isBackgroundTasksDisabled3 && isAutobackgroundingAllowed2(command); @@ -529275,14 +452886,14 @@ async function* runShellCommand({ fullOutput = allLines; lastTotalLines = totalLines; lastTotalBytes = isIncomplete ? totalBytes : 0; - const resolve36 = resolveProgress; - if (resolve36) { + const resolve30 = resolveProgress; + if (resolve30) { resolveProgress = null; - resolve36(); + resolve30(); } }, preventCwdChanges, - shouldUseSandbox: shouldUseSandbox(input11), + shouldUseSandbox: shouldUseSandbox(input), shouldAutoBackground }); const resultPromise = shellCommand.result; @@ -529316,10 +452927,10 @@ async function* runShellCommand({ } spawnBackgroundTask().then((shellId) => { backgroundShellId = shellId; - const resolve36 = resolveProgress; - if (resolve36) { + const resolve30 = resolveProgress; + if (resolve30) { resolveProgress = null; - resolve36(); + resolve30(); } logEvent(eventName, { command_type: getCommandTypeForLogging2(command) @@ -529358,8 +452969,8 @@ async function* runShellCommand({ const startTime = Date.now(); let foregroundTaskId = undefined; { - const initialResult = await Promise.race([resultPromise, new Promise((resolve36) => { - const t = setTimeout((r) => r(null), PROGRESS_THRESHOLD_MS3, resolve36); + const initialResult = await Promise.race([resultPromise, new Promise((resolve30) => { + const t = setTimeout((r) => r(null), PROGRESS_THRESHOLD_MS3, resolve30); t.unref(); })]); if (initialResult !== null) { @@ -529381,12 +452992,12 @@ async function* runShellCommand({ try { while (true) { const progressSignal = createProgressSignal(); - const result3 = await Promise.race([resultPromise, progressSignal]); - if (result3 !== null) { - if (result3.backgroundTaskId !== undefined) { - markTaskNotified2(result3.backgroundTaskId, setAppState); + const result2 = await Promise.race([resultPromise, progressSignal]); + if (result2 !== null) { + if (result2.backgroundTaskId !== undefined) { + markTaskNotified2(result2.backgroundTaskId, setAppState); const fixedResult = { - ...result3, + ...result2, backgroundTaskId: undefined }; const { @@ -529404,7 +453015,7 @@ async function* runShellCommand({ unregisterForeground(foregroundTaskId, setAppState); } shellCommand.cleanup(); - return result3; + return result2; } if (backgroundShellId) { return { @@ -529463,7 +453074,7 @@ async function* runShellCommand({ TaskOutput.stopPolling(shellCommand.taskOutput.taskId); } } -var jsx_dev_runtime150, EOL5 = ` +var jsx_dev_runtime150, EOL4 = ` `, PROGRESS_THRESHOLD_MS3 = 2000, ASSISTANT_BLOCKING_BUDGET_MS2 = 15000, BASH_SEARCH_COMMANDS, BASH_READ_COMMANDS, BASH_LIST_COMMANDS, BASH_SEMANTIC_NEUTRAL_COMMANDS, BASH_SILENT_COMMANDS, DISALLOWED_AUTO_BACKGROUND_COMMANDS2, isBackgroundTasksDisabled3, fullInputSchema3, inputSchema38, COMMON_BACKGROUND_COMMANDS2, outputSchema32, BashTool; var init_BashTool = __esm(() => { init_bun_bundle(); @@ -529504,7 +453115,7 @@ var init_BashTool = __esm(() => { init_sedEditParser(); init_shouldUseSandbox(); init_UI3(); - init_utils8(); + init_utils7(); jsx_dev_runtime150 = __toESM(require_jsx_dev_runtime(), 1); BASH_SEARCH_COMMANDS = new Set(["find", "grep", "rg", "ag", "ack", "locate", "which", "whereis"]); BASH_READ_COMMANDS = new Set([ @@ -529594,16 +453205,16 @@ For commands that are harder to parse at a glance (piped commands, obscure flags async prompt() { return getSimplePrompt(); }, - isConcurrencySafe(input11) { - return this.isReadOnly?.(input11) ?? false; + isConcurrencySafe(input) { + return this.isReadOnly?.(input) ?? false; }, - isReadOnly(input11) { - const compoundCommandHasCd = commandHasAnyCd(input11.command); - const result3 = checkReadOnlyConstraints(input11, compoundCommandHasCd); - return result3.behavior === "allow"; + isReadOnly(input) { + const compoundCommandHasCd = commandHasAnyCd(input.command); + const result2 = checkReadOnlyConstraints(input, compoundCommandHasCd); + return result2.behavior === "allow"; }, - toAutoClassifierInput(input11) { - return input11.command; + toAutoClassifierInput(input) { + return input.command; }, async preparePermissionMatcher({ command @@ -529623,8 +453234,8 @@ For commands that are harder to parse at a glance (piped commands, obscure flags }); }; }, - isSearchOrReadCommand(input11) { - const parsed = inputSchema38().safeParse(input11); + isSearchOrReadCommand(input) { + const parsed = inputSchema38().safeParse(input); if (!parsed.success) return { isSearch: false, @@ -529639,12 +453250,12 @@ For commands that are harder to parse at a glance (piped commands, obscure flags get outputSchema() { return outputSchema32(); }, - userFacingName(input11) { - if (!input11) { + userFacingName(input) { + if (!input) { return "Bash"; } - if (input11.command) { - const sedInfo = parseSedEditCommand(input11.command); + if (input.command) { + const sedInfo = parseSedEditCommand(input.command); if (sedInfo) { return userFacingName2({ file_path: sedInfo.filePath, @@ -529652,31 +453263,31 @@ For commands that are harder to parse at a glance (piped commands, obscure flags }); } } - return isEnvTruthy(process.env.CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR) && shouldUseSandbox(input11) ? "SandboxedBash" : "Bash"; + return isEnvTruthy(process.env.CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR) && shouldUseSandbox(input) ? "SandboxedBash" : "Bash"; }, - getToolUseSummary(input11) { - if (!input11?.command) { + getToolUseSummary(input) { + if (!input?.command) { return null; } const { command, description - } = input11; + } = input; if (description) { return description; } return truncate(command, TOOL_SUMMARY_MAX_LENGTH); }, - getActivityDescription(input11) { - if (!input11?.command) { + getActivityDescription(input) { + if (!input?.command) { return "Running command"; } - const desc = input11.description ?? truncate(input11.command, TOOL_SUMMARY_MAX_LENGTH); + const desc = input.description ?? truncate(input.command, TOOL_SUMMARY_MAX_LENGTH); return `Running ${desc}`; }, - async validateInput(input11) { - if (feature("MONITOR_TOOL") && !isBackgroundTasksDisabled3 && !input11.run_in_background) { - const sleepPattern = detectBlockedSleepPattern2(input11.command); + async validateInput(input) { + if (feature("MONITOR_TOOL") && !isBackgroundTasksDisabled3 && !input.run_in_background) { + const sleepPattern = detectBlockedSleepPattern2(input.command); if (sleepPattern !== null) { return { result: false, @@ -529689,8 +453300,8 @@ For commands that are harder to parse at a glance (piped commands, obscure flags result: true }; }, - async checkPermissions(input11, context) { - return bashToolHasPermission(input11, context); + async checkPermissions(input, context) { + return bashToolHasPermission(input, context); }, renderToolUseMessage: renderToolUseMessage4, renderToolUseProgressMessage: renderToolUseProgressMessage4, @@ -529745,7 +453356,7 @@ ${stderr}` : stdout; let errorMessage2 = stderr.trim(); if (interrupted) { if (stderr) - errorMessage2 += EOL5; + errorMessage2 += EOL4; errorMessage2 += "Command was aborted before completion"; } let backgroundInfo = ""; @@ -529767,9 +453378,9 @@ ${stderr}` : stdout; is_error: interrupted }; }, - async call(input11, toolUseContext, _canUseTool, parentMessage, onProgress) { - if (input11._simulatedSedEdit) { - return applySedEdit(input11._simulatedSedEdit, toolUseContext, parentMessage); + async call(input, toolUseContext, _canUseTool, parentMessage, onProgress) { + if (input._simulatedSedEdit) { + return applySedEdit(input._simulatedSedEdit, toolUseContext, parentMessage); } const { abortController, @@ -529782,12 +453393,12 @@ ${stderr}` : stdout; let interpretationResult; let progressCounter = 0; let wasInterrupted = false; - let result3; + let result2; const isMainThread = !toolUseContext.agentId; const preventCwdChanges = !isMainThread; try { const commandGenerator = runShellCommand({ - input: input11, + input, abortController, setAppState: toolUseContext.setAppStateForTasks ?? setAppState, setToolJSX, @@ -529816,17 +453427,17 @@ ${stderr}` : stdout; }); } } while (!generatorResult.done); - result3 = generatorResult.value; - trackGitOperations(input11.command, result3.code, result3.stdout); - const isInterrupt = result3.interrupted && abortController.signal.reason === "interrupt"; - stdoutAccumulator.append((result3.stdout || "").trimEnd() + EOL5); - interpretationResult = interpretCommandResult2(input11.command, result3.code, result3.stdout || "", ""); - if (result3.stdout && result3.stdout.includes(".git/index.lock': File exists")) { + result2 = generatorResult.value; + trackGitOperations(input.command, result2.code, result2.stdout); + const isInterrupt = result2.interrupted && abortController.signal.reason === "interrupt"; + stdoutAccumulator.append((result2.stdout || "").trimEnd() + EOL4); + interpretationResult = interpretCommandResult2(input.command, result2.code, result2.stdout || "", ""); + if (result2.stdout && result2.stdout.includes(".git/index.lock': File exists")) { logEvent("tengu_git_index_lock_error", {}); } if (interpretationResult.isError && !isInterrupt) { - if (result3.code !== 0) { - stdoutAccumulator.append(`Exit code ${result3.code}`); + if (result2.code !== 0) { + stdoutAccumulator.append(`Exit code ${result2.code}`); } } if (!preventCwdChanges) { @@ -529835,14 +453446,14 @@ ${stderr}` : stdout; stderrForShellReset = stdErrAppendShellResetMessage(""); } } - const outputWithSbFailures = SandboxManager2.annotateStderrWithSandboxFailures(input11.command, result3.stdout || ""); - if (result3.preSpawnError) { - throw new Error(result3.preSpawnError); + const outputWithSbFailures = SandboxManager2.annotateStderrWithSandboxFailures(input.command, result2.stdout || ""); + if (result2.preSpawnError) { + throw new Error(result2.preSpawnError); } if (interpretationResult.isError && !isInterrupt) { - throw new ShellError("", outputWithSbFailures, result3.code, result3.interrupted); + throw new ShellError("", outputWithSbFailures, result2.code, result2.interrupted); } - wasInterrupted = result3.interrupted; + wasInterrupted = result2.interrupted; } finally { if (setToolJSX) setToolJSX(null); @@ -529851,41 +453462,41 @@ ${stderr}` : stdout; const MAX_PERSISTED_SIZE = 64 * 1024 * 1024; let persistedOutputPath; let persistedOutputSize; - if (result3.outputFilePath && result3.outputTaskId) { + if (result2.outputFilePath && result2.outputTaskId) { try { - const fileStat = await fsStat2(result3.outputFilePath); + const fileStat = await fsStat2(result2.outputFilePath); persistedOutputSize = fileStat.size; await ensureToolResultsDir(); - const dest = getToolResultPath(result3.outputTaskId, false); + const dest = getToolResultPath(result2.outputTaskId, false); if (fileStat.size > MAX_PERSISTED_SIZE) { - await fsTruncate2(result3.outputFilePath, MAX_PERSISTED_SIZE); + await fsTruncate2(result2.outputFilePath, MAX_PERSISTED_SIZE); } try { - await link5(result3.outputFilePath, dest); + await link5(result2.outputFilePath, dest); } catch { - await copyFile7(result3.outputFilePath, dest); + await copyFile6(result2.outputFilePath, dest); } persistedOutputPath = dest; } catch {} } - const commandType = input11.command.split(" ")[0]; + const commandType = input.command.split(" ")[0]; logEvent("tengu_bash_tool_command_executed", { command_type: commandType, stdout_length: stdout.length, stderr_length: 0, - exit_code: result3.code, + exit_code: result2.code, interrupted: wasInterrupted }); - const codeIndexingTool = detectCodeIndexingFromCommand(input11.command); + const codeIndexingTool = detectCodeIndexingFromCommand(input.command); if (codeIndexingTool) { logEvent("tengu_code_indexing_tool_used", { tool: codeIndexingTool, source: "cli", - success: result3.code === 0 + success: result2.code === 0 }); } let strippedStdout = stripEmptyLines(stdout); - const extracted = extractClaudeCodeHints(strippedStdout, input11.command); + const extracted = extractClaudeCodeHints(strippedStdout, input.command); strippedStdout = extracted.stripped; if (isMainThread && extracted.hints.length > 0) { for (const hint of extracted.hints) @@ -529894,7 +453505,7 @@ ${stderr}` : stdout; let isImage = isImageOutput(strippedStdout); let compressedStdout = strippedStdout; if (isImage) { - const resized = await resizeShellImageOutput(strippedStdout, result3.outputFilePath, persistedOutputSize); + const resized = await resizeShellImageOutput(strippedStdout, result2.outputFilePath, persistedOutputSize); if (resized) { compressedStdout = resized; } else { @@ -529907,11 +453518,11 @@ ${stderr}` : stdout; interrupted: wasInterrupted, isImage, returnCodeInterpretation: interpretationResult?.message, - noOutputExpected: isSilentBashCommand(input11.command), - backgroundTaskId: result3.backgroundTaskId, - backgroundedByUser: result3.backgroundedByUser, - assistantAutoBackgrounded: result3.assistantAutoBackgrounded, - dangerouslyDisableSandbox: "dangerouslyDisableSandbox" in input11 ? input11.dangerouslyDisableSandbox : undefined, + noOutputExpected: isSilentBashCommand(input.command), + backgroundTaskId: result2.backgroundTaskId, + backgroundedByUser: result2.backgroundedByUser, + assistantAutoBackgrounded: result2.assistantAutoBackgrounded, + dangerouslyDisableSandbox: "dangerouslyDisableSandbox" in input ? input.dangerouslyDisableSandbox : undefined, persistedOutputPath, persistedOutputSize }; @@ -529927,7 +453538,7 @@ ${stderr}` : stdout; }); // src/tools/BashTool/bashCommandHelpers.ts -async function segmentedCommandPermissionResult(input11, segments, bashToolHasPermissionFn, checkers) { +async function segmentedCommandPermissionResult(input, segments, bashToolHasPermissionFn, checkers) { const cdCommands = segments.filter((segment) => { const trimmed = segment.trim(); return checkers.isNormalizedCdCommand(trimmed); @@ -529976,12 +453587,12 @@ async function segmentedCommandPermissionResult(input11, segments, bashToolHasPe if (!trimmedSegment) continue; const segmentResult = await bashToolHasPermissionFn({ - ...input11, + ...input, command: trimmedSegment }); segmentResults.set(trimmedSegment, segmentResult); } - const deniedSegment = Array.from(segmentResults.entries()).find(([, result3]) => result3.behavior === "deny"); + const deniedSegment = Array.from(segmentResults.entries()).find(([, result2]) => result2.behavior === "deny"); if (deniedSegment) { const [segmentCommand, segmentResult] = deniedSegment; return { @@ -529993,11 +453604,11 @@ async function segmentedCommandPermissionResult(input11, segments, bashToolHasPe } }; } - const allAllowed = Array.from(segmentResults.values()).every((result3) => result3.behavior === "allow"); + const allAllowed = Array.from(segmentResults.values()).every((result2) => result2.behavior === "allow"); if (allAllowed) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "subcommandResults", reasons: segmentResults @@ -530005,9 +453616,9 @@ async function segmentedCommandPermissionResult(input11, segments, bashToolHasPe }; } const suggestions = []; - for (const [, result3] of segmentResults) { - if (result3.behavior !== "allow" && "suggestions" in result3 && result3.suggestions) { - suggestions.push(...result3.suggestions); + for (const [, result2] of segmentResults) { + if (result2.behavior !== "allow" && "suggestions" in result2 && result2.suggestions) { + suggestions.push(...result2.suggestions); } } const decisionReason = { @@ -530028,18 +453639,18 @@ async function buildSegmentWithoutRedirections(segmentCommand) { const parsed = await ParsedCommand.parse(segmentCommand); return parsed?.withoutOutputRedirections() ?? segmentCommand; } -async function checkCommandOperatorPermissions(input11, bashToolHasPermissionFn, checkers, astRoot) { - const parsed = astRoot && astRoot !== PARSE_ABORTED ? buildParsedCommandFromRoot(input11.command, astRoot) : await ParsedCommand.parse(input11.command); +async function checkCommandOperatorPermissions(input, bashToolHasPermissionFn, checkers, astRoot) { + const parsed = astRoot && astRoot !== PARSE_ABORTED ? buildParsedCommandFromRoot(input.command, astRoot) : await ParsedCommand.parse(input.command); if (!parsed) { return { behavior: "passthrough", message: "Failed to parse command" }; } - return bashToolCheckCommandOperatorPermissions(input11, bashToolHasPermissionFn, checkers, parsed); + return bashToolCheckCommandOperatorPermissions(input, bashToolHasPermissionFn, checkers, parsed); } -async function bashToolCheckCommandOperatorPermissions(input11, bashToolHasPermissionFn, checkers, parsed) { +async function bashToolCheckCommandOperatorPermissions(input, bashToolHasPermissionFn, checkers, parsed) { const tsAnalysis = parsed.getTreeSitterAnalysis(); - const isUnsafeCompound = tsAnalysis ? tsAnalysis.compoundStructure.hasSubshell || tsAnalysis.compoundStructure.hasCommandGroup : isUnsafeCompoundCommand_DEPRECATED(input11.command); + const isUnsafeCompound = tsAnalysis ? tsAnalysis.compoundStructure.hasSubshell || tsAnalysis.compoundStructure.hasCommandGroup : isUnsafeCompoundCommand_DEPRECATED(input.command); if (isUnsafeCompound) { - const safetyResult = await bashCommandIsSafeAsync_DEPRECATED(input11.command); + const safetyResult = await bashCommandIsSafeAsync_DEPRECATED(input.command); const decisionReason = { type: "other", reason: safetyResult.behavior === "ask" && safetyResult.message ? safetyResult.message : "This command uses shell operators that require approval for safety" @@ -530058,12 +453669,12 @@ async function bashToolCheckCommandOperatorPermissions(input11, bashToolHasPermi }; } const segments = await Promise.all(pipeSegments.map((segment) => buildSegmentWithoutRedirections(segment))); - return segmentedCommandPermissionResult(input11, segments, bashToolHasPermissionFn, checkers); + return segmentedCommandPermissionResult(input, segments, bashToolHasPermissionFn, checkers); } var init_bashCommandHelpers = __esm(() => { init_commands(); init_ParsedCommand(); - init_parser5(); + init_parser4(); init_permissions2(); init_BashTool(); init_bashSecurity(); @@ -530097,7 +453708,7 @@ function validateCommandForMode(cmd, toolPermissionContext) { message: `No mode-specific handling for '${baseCmd}' in ${toolPermissionContext.mode} mode` }; } -function checkPermissionMode2(input11, toolPermissionContext) { +function checkPermissionMode2(input, toolPermissionContext) { if (toolPermissionContext.mode === "bypassPermissions") { return { behavior: "passthrough", @@ -530110,11 +453721,11 @@ function checkPermissionMode2(input11, toolPermissionContext) { message: "DontAsk mode is handled in main permission flow" }; } - const commands = splitCommand_DEPRECATED(input11.command); + const commands = splitCommand_DEPRECATED(input.command); for (const cmd of commands) { - const result3 = validateCommandForMode(cmd, toolPermissionContext); - if (result3.behavior !== "passthrough") { - return result3; + const result2 = validateCommandForMode(cmd, toolPermissionContext); + if (result2.behavior !== "passthrough") { + return result2; } } return { @@ -530137,17 +453748,17 @@ var init_modeValidation2 = __esm(() => { }); // src/tools/BashTool/bashPermissions.ts -function logClassifierResultForAnts(command, behavior, descriptions, result3) { +function logClassifierResultForAnts(command, behavior, descriptions, result2) { if (process.env.USER_TYPE !== "ant") { return; } logEvent("tengu_internal_bash_classifier_result", { behavior, descriptions: jsonStringify(descriptions), - matches: result3.matches, - matchedDescription: result3.matchedDescription ?? "", - confidence: result3.confidence, - reason: result3.reason, + matches: result2.matches, + matchedDescription: result2.matchedDescription ?? "", + confidence: result2.confidence, + reason: result2.reason, command }); } @@ -530155,16 +453766,16 @@ function getSimpleCommandPrefix(command) { const tokens = command.trim().split(/\s+/).filter(Boolean); if (tokens.length === 0) return null; - let i4 = 0; - while (i4 < tokens.length && ENV_VAR_ASSIGN_RE.test(tokens[i4])) { - const varName = tokens[i4].split("=")[0]; + let i3 = 0; + while (i3 < tokens.length && ENV_VAR_ASSIGN_RE.test(tokens[i3])) { + const varName = tokens[i3].split("=")[0]; const isAntOnlySafe = process.env.USER_TYPE === "ant" && ANT_ONLY_SAFE_ENV_VARS.has(varName); if (!SAFE_ENV_VARS3.has(varName) && !isAntOnlySafe) { return null; } - i4++; + i3++; } - const remaining = tokens.slice(i4); + const remaining = tokens.slice(i3); if (remaining.length < 2) return null; const subcmd = remaining[1]; @@ -530174,16 +453785,16 @@ function getSimpleCommandPrefix(command) { } function getFirstWordPrefix(command) { const tokens = command.trim().split(/\s+/).filter(Boolean); - let i4 = 0; - while (i4 < tokens.length && ENV_VAR_ASSIGN_RE.test(tokens[i4])) { - const varName = tokens[i4].split("=")[0]; + let i3 = 0; + while (i3 < tokens.length && ENV_VAR_ASSIGN_RE.test(tokens[i3])) { + const varName = tokens[i3].split("=")[0]; const isAntOnlySafe = process.env.USER_TYPE === "ant" && ANT_ONLY_SAFE_ENV_VARS.has(varName); if (!SAFE_ENV_VARS3.has(varName) && !isAntOnlySafe) { return null; } - i4++; + i3++; } - const cmd = tokens[i4]; + const cmd = tokens[i3]; if (!cmd) return null; if (!/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(cmd)) @@ -530217,25 +453828,25 @@ function extractPrefixBeforeHeredoc(command) { const idx = command.indexOf("<<"); if (idx <= 0) return null; - const before3 = command.substring(0, idx).trim(); - if (!before3) + const before2 = command.substring(0, idx).trim(); + if (!before2) return null; - const prefix = getSimpleCommandPrefix(before3); + const prefix = getSimpleCommandPrefix(before2); if (prefix) return prefix; - const tokens = before3.split(/\s+/).filter(Boolean); - let i4 = 0; - while (i4 < tokens.length && ENV_VAR_ASSIGN_RE.test(tokens[i4])) { - const varName = tokens[i4].split("=")[0]; + const tokens = before2.split(/\s+/).filter(Boolean); + let i3 = 0; + while (i3 < tokens.length && ENV_VAR_ASSIGN_RE.test(tokens[i3])) { + const varName = tokens[i3].split("=")[0]; const isAntOnlySafe = process.env.USER_TYPE === "ant" && ANT_ONLY_SAFE_ENV_VARS.has(varName); if (!SAFE_ENV_VARS3.has(varName) && !isAntOnlySafe) { return null; } - i4++; + i3++; } - if (i4 >= tokens.length) + if (i3 >= tokens.length) return null; - return tokens.slice(i4, i4 + 2).join(" ") || null; + return tokens.slice(i3, i3 + 2).join(" ") || null; } function suggestionForPrefix2(prefix) { return suggestionForPrefix(BashTool.name, prefix); @@ -530305,11 +453916,11 @@ function stripAllLeadingEnvVars(command, blocklist) { } return stripped.trim(); } -function filterRulesByContentsMatchingInput2(input11, rules, matchMode, { +function filterRulesByContentsMatchingInput2(input, rules, matchMode, { stripAllEnvVars = false, skipCompoundCheck = false } = {}) { - const command = input11.command.trim(); + const command = input.command.trim(); const commandWithoutRedirections = extractOutputRedirections(command).commandWithoutRedirections; const commandsForMatching = matchMode === "exact" ? [command, commandWithoutRedirections] : [commandWithoutRedirections]; const commandsToTry = commandsForMatching.flatMap((cmd) => { @@ -530321,8 +453932,8 @@ function filterRulesByContentsMatchingInput2(input11, rules, matchMode, { let startIdx = 0; while (startIdx < commandsToTry.length) { const endIdx = commandsToTry.length; - for (let i4 = startIdx;i4 < endIdx; i4++) { - const cmd = commandsToTry[i4]; + for (let i3 = startIdx;i3 < endIdx; i3++) { + const cmd = commandsToTry[i3]; if (!cmd) { continue; } @@ -530388,30 +453999,30 @@ function filterRulesByContentsMatchingInput2(input11, rules, matchMode, { }); }).map(([, rule]) => rule); } -function matchingRulesForInput2(input11, toolPermissionContext, matchMode, { skipCompoundCheck = false } = {}) { +function matchingRulesForInput2(input, toolPermissionContext, matchMode, { skipCompoundCheck = false } = {}) { const denyRuleByContents = getRuleByContentsForTool(toolPermissionContext, BashTool, "deny"); - const matchingDenyRules = filterRulesByContentsMatchingInput2(input11, denyRuleByContents, matchMode, { stripAllEnvVars: true, skipCompoundCheck: true }); + const matchingDenyRules = filterRulesByContentsMatchingInput2(input, denyRuleByContents, matchMode, { stripAllEnvVars: true, skipCompoundCheck: true }); const askRuleByContents = getRuleByContentsForTool(toolPermissionContext, BashTool, "ask"); - const matchingAskRules = filterRulesByContentsMatchingInput2(input11, askRuleByContents, matchMode, { stripAllEnvVars: true, skipCompoundCheck: true }); + const matchingAskRules = filterRulesByContentsMatchingInput2(input, askRuleByContents, matchMode, { stripAllEnvVars: true, skipCompoundCheck: true }); const allowRuleByContents = getRuleByContentsForTool(toolPermissionContext, BashTool, "allow"); - const matchingAllowRules = filterRulesByContentsMatchingInput2(input11, allowRuleByContents, matchMode, { skipCompoundCheck }); + const matchingAllowRules = filterRulesByContentsMatchingInput2(input, allowRuleByContents, matchMode, { skipCompoundCheck }); return { matchingDenyRules, matchingAskRules, matchingAllowRules }; } -async function checkCommandAndSuggestRules(input11, toolPermissionContext, commandPrefixResult, compoundCommandHasCd, astParseSucceeded) { - const exactMatchResult = bashToolCheckExactMatchPermission(input11, toolPermissionContext); +async function checkCommandAndSuggestRules(input, toolPermissionContext, commandPrefixResult, compoundCommandHasCd, astParseSucceeded) { + const exactMatchResult = bashToolCheckExactMatchPermission(input, toolPermissionContext); if (exactMatchResult.behavior !== "passthrough") { return exactMatchResult; } - const permissionResult = bashToolCheckPermission(input11, toolPermissionContext, compoundCommandHasCd); + const permissionResult = bashToolCheckPermission(input, toolPermissionContext, compoundCommandHasCd); if (permissionResult.behavior === "deny" || permissionResult.behavior === "ask") { return permissionResult; } if (!astParseSucceeded && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK)) { - const safetyResult = await bashCommandIsSafeAsync(input11.command); + const safetyResult = await bashCommandIsSafeAsync(input.command); if (safetyResult.behavior !== "passthrough") { const decisionReason = { type: "other", @@ -530428,15 +454039,15 @@ async function checkCommandAndSuggestRules(input11, toolPermissionContext, comma if (permissionResult.behavior === "allow") { return permissionResult; } - const suggestedUpdates = commandPrefixResult?.commandPrefix ? suggestionForPrefix2(commandPrefixResult.commandPrefix) : suggestionForExactCommand3(input11.command); + const suggestedUpdates = commandPrefixResult?.commandPrefix ? suggestionForPrefix2(commandPrefixResult.commandPrefix) : suggestionForExactCommand3(input.command); return { ...permissionResult, suggestions: suggestedUpdates }; } -function checkSandboxAutoAllow(input11, toolPermissionContext) { - const command = input11.command.trim(); - const { matchingDenyRules, matchingAskRules } = matchingRulesForInput2(input11, toolPermissionContext, "prefix"); +function checkSandboxAutoAllow(input, toolPermissionContext) { + const command = input.command.trim(); + const { matchingDenyRules, matchingAskRules } = matchingRulesForInput2(input, toolPermissionContext, "prefix"); if (matchingDenyRules[0] !== undefined) { return { behavior: "deny", @@ -530487,7 +454098,7 @@ function checkSandboxAutoAllow(input11, toolPermissionContext) { } return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Auto-allowed with sandbox (autoAllowBashIfSandboxed enabled)" @@ -530497,40 +454108,40 @@ function checkSandboxAutoAllow(input11, toolPermissionContext) { function filterCdCwdSubcommands(rawSubcommands, astCommands, cwd2, cwdMingw) { const subcommands = []; const astCommandsByIdx = []; - for (let i4 = 0;i4 < rawSubcommands.length; i4++) { - const cmd = rawSubcommands[i4]; + for (let i3 = 0;i3 < rawSubcommands.length; i3++) { + const cmd = rawSubcommands[i3]; if (cmd === `cd ${cwd2}` || cmd === `cd ${cwdMingw}`) continue; subcommands.push(cmd); - astCommandsByIdx.push(astCommands?.[i4]); + astCommandsByIdx.push(astCommands?.[i3]); } return { subcommands, astCommandsByIdx }; } -function checkEarlyExitDeny(input11, toolPermissionContext) { - const exactMatchResult = bashToolCheckExactMatchPermission(input11, toolPermissionContext); +function checkEarlyExitDeny(input, toolPermissionContext) { + const exactMatchResult = bashToolCheckExactMatchPermission(input, toolPermissionContext); if (exactMatchResult.behavior !== "passthrough") { return exactMatchResult; } - const denyMatch = matchingRulesForInput2(input11, toolPermissionContext, "prefix").matchingDenyRules[0]; + const denyMatch = matchingRulesForInput2(input, toolPermissionContext, "prefix").matchingDenyRules[0]; if (denyMatch !== undefined) { return { behavior: "deny", - message: `Permission to use ${BashTool.name} with command ${input11.command} has been denied.`, + message: `Permission to use ${BashTool.name} with command ${input.command} has been denied.`, decisionReason: { type: "rule", rule: denyMatch } }; } return null; } -function checkSemanticsDeny(input11, toolPermissionContext, commands) { - const fullCmd = checkEarlyExitDeny(input11, toolPermissionContext); +function checkSemanticsDeny(input, toolPermissionContext, commands) { + const fullCmd = checkEarlyExitDeny(input, toolPermissionContext); if (fullCmd !== null) return fullCmd; for (const cmd of commands) { - const subDeny = matchingRulesForInput2({ ...input11, command: cmd.text }, toolPermissionContext, "prefix").matchingDenyRules[0]; + const subDeny = matchingRulesForInput2({ ...input, command: cmd.text }, toolPermissionContext, "prefix").matchingDenyRules[0]; if (subDeny !== undefined) { return { behavior: "deny", - message: `Permission to use ${BashTool.name} with command ${input11.command} has been denied.`, + message: `Permission to use ${BashTool.name} with command ${input.command} has been denied.`, decisionReason: { type: "rule", rule: subDeny } }; } @@ -530603,13 +454214,13 @@ async function executeAsyncClassifierCheck(pendingCheck, signal, isNonInteractiv let classifierResult; try { classifierResult = speculativeResult ? await speculativeResult : await classifyBashCommand(command, cwd2, descriptions, "allow", signal, isNonInteractiveSession); - } catch (error45) { - if (error45 instanceof APIUserAbortError || error45 instanceof AbortError) { + } catch (error41) { + if (error41 instanceof APIUserAbortError || error41 instanceof AbortError) { callbacks.onComplete?.(); return; } callbacks.onComplete?.(); - throw error45; + throw error41; } logClassifierResultForAnts(command, "allow", descriptions, classifierResult); if (!callbacks.shouldContinue()) @@ -530624,12 +454235,12 @@ async function executeAsyncClassifierCheck(pendingCheck, signal, isNonInteractiv callbacks.onComplete?.(); } } -async function bashToolHasPermission(input11, context, getCommandSubcommandPrefixFn = getCommandSubcommandPrefix) { +async function bashToolHasPermission(input, context, getCommandSubcommandPrefixFn = getCommandSubcommandPrefix) { let appState = context.getAppState(); const injectionCheckDisabled = isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK); const shadowEnabled = feature("TREE_SITTER_BASH_SHADOW") ? getFeatureValue_CACHED_MAY_BE_STALE("tengu_birch_trellis", true) : false; - let astRoot = injectionCheckDisabled ? null : feature("TREE_SITTER_BASH_SHADOW") && !shadowEnabled ? null : await parseCommandRaw(input11.command); - let astResult = astRoot ? parseForSecurityFromAst(input11.command, astRoot) : { kind: "parse-unavailable" }; + let astRoot = injectionCheckDisabled ? null : feature("TREE_SITTER_BASH_SHADOW") && !shadowEnabled ? null : await parseCommandRaw(input.command); + let astResult = astRoot ? parseForSecurityFromAst(input.command, astRoot) : { kind: "parse-unavailable" }; let astSubcommands = null; let astRedirects; let astCommands; @@ -530643,9 +454254,9 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi tooComplex2 = astResult.kind === "too-complex"; semanticFail = astResult.kind === "simple" && !checkSemantics(astResult.commands).ok; const tsSubs = astResult.kind === "simple" ? astResult.commands.map((c6) => c6.text) : undefined; - const legacySubs = splitCommand(input11.command); + const legacySubs = splitCommand(input.command); shadowLegacySubs = legacySubs; - subsDiffer = tsSubs !== undefined && (tsSubs.length !== legacySubs.length || tsSubs.some((s, i4) => s !== legacySubs[i4])); + subsDiffer = tsSubs !== undefined && (tsSubs.length !== legacySubs.length || tsSubs.some((s, i3) => s !== legacySubs[i3])); } logEvent("tengu_tree_sitter_shadow", { available, @@ -530654,13 +454265,13 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi subsDiffer, injectionCheckDisabled, killswitchOff: !shadowEnabled, - cmdOverLength: input11.command.length > 1e4 + cmdOverLength: input.command.length > 1e4 }); astResult = { kind: "parse-unavailable" }; astRoot = null; } if (astResult.kind === "too-complex") { - const earlyExit = checkEarlyExitDeny(input11, appState.toolPermissionContext); + const earlyExit = checkEarlyExitDeny(input, appState.toolPermissionContext); if (earlyExit !== null) return earlyExit; const decisionReason2 = { @@ -530676,14 +454287,14 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi message: createPermissionRequestMessage2(BashTool.name, decisionReason2), suggestions: [], ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: buildPendingClassifierCheck(input11.command, appState.toolPermissionContext) + pendingClassifierCheck: buildPendingClassifierCheck(input.command, appState.toolPermissionContext) } : {} }; } if (astResult.kind === "simple") { const sem = checkSemantics(astResult.commands); if (!sem.ok) { - const earlyExit = checkSemanticsDeny(input11, appState.toolPermissionContext, astResult.commands); + const earlyExit = checkSemanticsDeny(input, appState.toolPermissionContext, astResult.commands); if (earlyExit !== null) return earlyExit; const decisionReason2 = { @@ -530703,7 +454314,7 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi } if (astResult.kind === "parse-unavailable") { logForDebugging("bashToolHasPermission: tree-sitter unavailable, using legacy shell-quote path"); - const parseResult = tryParseShellCommand(input11.command); + const parseResult = tryParseShellCommand(input.command); if (!parseResult.success) { const decisionReason2 = { type: "other", @@ -530716,13 +454327,13 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi }; } } - if (SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input11)) { - const sandboxAutoAllowResult = checkSandboxAutoAllow(input11, appState.toolPermissionContext); + if (SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input)) { + const sandboxAutoAllowResult = checkSandboxAutoAllow(input, appState.toolPermissionContext); if (sandboxAutoAllowResult.behavior !== "passthrough") { return sandboxAutoAllowResult; } } - const exactMatchResult = bashToolCheckExactMatchPermission(input11, appState.toolPermissionContext); + const exactMatchResult = bashToolCheckExactMatchPermission(input, appState.toolPermissionContext); if (exactMatchResult.behavior === "deny") { return exactMatchResult; } @@ -530733,17 +454344,17 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi const hasAsk = askDescriptions.length > 0; if (hasDeny || hasAsk) { const [denyResult, askResult] = await Promise.all([ - hasDeny ? classifyBashCommand(input11.command, getCwd(), denyDescriptions, "deny", context.abortController.signal, context.options.isNonInteractiveSession) : null, - hasAsk ? classifyBashCommand(input11.command, getCwd(), askDescriptions, "ask", context.abortController.signal, context.options.isNonInteractiveSession) : null + hasDeny ? classifyBashCommand(input.command, getCwd(), denyDescriptions, "deny", context.abortController.signal, context.options.isNonInteractiveSession) : null, + hasAsk ? classifyBashCommand(input.command, getCwd(), askDescriptions, "ask", context.abortController.signal, context.options.isNonInteractiveSession) : null ]); if (context.abortController.signal.aborted) { throw new AbortError; } if (denyResult) { - logClassifierResultForAnts(input11.command, "deny", denyDescriptions, denyResult); + logClassifierResultForAnts(input.command, "deny", denyDescriptions, denyResult); } if (askResult) { - logClassifierResultForAnts(input11.command, "ask", askDescriptions, askResult); + logClassifierResultForAnts(input.command, "ask", askDescriptions, askResult); } if (denyResult?.matches && denyResult.confidence === "high") { return { @@ -530758,13 +454369,13 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi if (askResult?.matches && askResult.confidence === "high") { let suggestions; if (getCommandSubcommandPrefixFn === getCommandSubcommandPrefix) { - suggestions = suggestionForExactCommand3(input11.command); + suggestions = suggestionForExactCommand3(input.command); } else { - const commandPrefixResult = await getCommandSubcommandPrefixFn(input11.command, context.abortController.signal, context.options.isNonInteractiveSession); + const commandPrefixResult = await getCommandSubcommandPrefixFn(input.command, context.abortController.signal, context.options.isNonInteractiveSession); if (context.abortController.signal.aborted) { throw new AbortError; } - suggestions = commandPrefixResult?.commandPrefix ? suggestionForPrefix2(commandPrefixResult.commandPrefix) : suggestionForExactCommand3(input11.command); + suggestions = commandPrefixResult?.commandPrefix ? suggestionForPrefix2(commandPrefixResult.commandPrefix) : suggestionForExactCommand3(input.command); } return { behavior: "ask", @@ -530775,16 +454386,16 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi }, suggestions, ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: buildPendingClassifierCheck(input11.command, appState.toolPermissionContext) + pendingClassifierCheck: buildPendingClassifierCheck(input.command, appState.toolPermissionContext) } : {} }; } } } - const commandOperatorResult = await checkCommandOperatorPermissions(input11, (i4) => bashToolHasPermission(i4, context, getCommandSubcommandPrefixFn), { isNormalizedCdCommand, isNormalizedGitCommand }, astRoot); + const commandOperatorResult = await checkCommandOperatorPermissions(input, (i3) => bashToolHasPermission(i3, context, getCommandSubcommandPrefixFn), { isNormalizedCdCommand, isNormalizedGitCommand }, astRoot); if (commandOperatorResult.behavior !== "passthrough") { if (commandOperatorResult.behavior === "allow") { - const safetyResult = astSubcommands === null ? await bashCommandIsSafeAsync(input11.command) : null; + const safetyResult = astSubcommands === null ? await bashCommandIsSafeAsync(input.command) : null; if (safetyResult !== null && safetyResult.behavior !== "passthrough" && safetyResult.behavior !== "allow") { appState = context.getAppState(); return { @@ -530798,12 +454409,12 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi reason: safetyResult.message ?? "Command contains patterns that require approval" }, ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: buildPendingClassifierCheck(input11.command, appState.toolPermissionContext) + pendingClassifierCheck: buildPendingClassifierCheck(input.command, appState.toolPermissionContext) } : {} }; } appState = context.getAppState(); - const pathResult2 = checkPathConstraints(input11, getCwd(), appState.toolPermissionContext, commandHasAnyCd(input11.command), astRedirects, astCommands); + const pathResult2 = checkPathConstraints(input, getCwd(), appState.toolPermissionContext, commandHasAnyCd(input.command), astRedirects, astCommands); if (pathResult2.behavior !== "passthrough") { return pathResult2; } @@ -530813,20 +454424,20 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi return { ...commandOperatorResult, ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: buildPendingClassifierCheck(input11.command, appState.toolPermissionContext) + pendingClassifierCheck: buildPendingClassifierCheck(input.command, appState.toolPermissionContext) } : {} }; } return commandOperatorResult; } if (astSubcommands === null && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK)) { - const originalCommandSafetyResult = await bashCommandIsSafeAsync(input11.command); + const originalCommandSafetyResult = await bashCommandIsSafeAsync(input.command); if (originalCommandSafetyResult.behavior === "ask" && originalCommandSafetyResult.isBashSecurityCheckForMisparsing) { - const remainder = stripSafeHeredocSubstitutions(input11.command); + const remainder = stripSafeHeredocSubstitutions(input.command); const remainderResult = remainder !== null ? await bashCommandIsSafeAsync(remainder) : null; if (remainder === null || remainderResult?.behavior === "ask" && remainderResult.isBashSecurityCheckForMisparsing) { appState = context.getAppState(); - const exactMatchResult2 = bashToolCheckExactMatchPermission(input11, appState.toolPermissionContext); + const exactMatchResult2 = bashToolCheckExactMatchPermission(input, appState.toolPermissionContext); if (exactMatchResult2.behavior === "allow") { return exactMatchResult2; } @@ -530840,7 +454451,7 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi decisionReason: decisionReason2, suggestions: [], ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: buildPendingClassifierCheck(input11.command, appState.toolPermissionContext) + pendingClassifierCheck: buildPendingClassifierCheck(input.command, appState.toolPermissionContext) } : {} }; } @@ -530848,7 +454459,7 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi } const cwd2 = getCwd(); const cwdMingw = getPlatform() === "windows" ? windowsPathToPosixPath(cwd2) : cwd2; - const rawSubcommands = astSubcommands ?? shadowLegacySubs ?? splitCommand(input11.command); + const rawSubcommands = astSubcommands ?? shadowLegacySubs ?? splitCommand(input.command); const { subcommands, astCommandsByIdx } = filterCdCwdSubcommands(rawSubcommands, astCommands, cwd2, cwdMingw); if (astSubcommands === null && subcommands.length > MAX_SUBCOMMANDS_FOR_SECURITY_CHECK) { logForDebugging(`bashPermissions: ${subcommands.length} subcommands exceeds cap (${MAX_SUBCOMMANDS_FOR_SECURITY_CHECK}) — returning ask`, { level: "debug" }); @@ -530890,22 +454501,22 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi } } appState = context.getAppState(); - const subcommandPermissionDecisions = subcommands.map((command, i4) => bashToolCheckPermission({ command }, appState.toolPermissionContext, compoundCommandHasCd, astCommandsByIdx[i4])); + const subcommandPermissionDecisions = subcommands.map((command, i3) => bashToolCheckPermission({ command }, appState.toolPermissionContext, compoundCommandHasCd, astCommandsByIdx[i3])); const deniedSubresult = subcommandPermissionDecisions.find((_) => _.behavior === "deny"); if (deniedSubresult !== undefined) { return { behavior: "deny", - message: `Permission to use ${BashTool.name} with command ${input11.command} has been denied.`, + message: `Permission to use ${BashTool.name} with command ${input.command} has been denied.`, decisionReason: { type: "subcommandResults", - reasons: new Map(subcommandPermissionDecisions.map((result3, i4) => [ - subcommands[i4], - result3 + reasons: new Map(subcommandPermissionDecisions.map((result2, i3) => [ + subcommands[i3], + result2 ])) } }; } - const pathResult = checkPathConstraints(input11, getCwd(), appState.toolPermissionContext, compoundCommandHasCd, astRedirects, astCommands); + const pathResult = checkPathConstraints(input, getCwd(), appState.toolPermissionContext, compoundCommandHasCd, astRedirects, astCommands); if (pathResult.behavior === "deny") { return pathResult; } @@ -530918,7 +454529,7 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi return { ...askSubresult, ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: buildPendingClassifierCheck(input11.command, appState.toolPermissionContext) + pendingClassifierCheck: buildPendingClassifierCheck(input.command, appState.toolPermissionContext) } : {} }; } @@ -530943,40 +454554,40 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi if (subcommandPermissionDecisions.every((_) => _.behavior === "allow") && !hasPossibleCommandInjection) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "subcommandResults", - reasons: new Map(subcommandPermissionDecisions.map((result3, i4) => [ - subcommands[i4], - result3 + reasons: new Map(subcommandPermissionDecisions.map((result2, i3) => [ + subcommands[i3], + result2 ])) } }; } let commandSubcommandPrefix = null; if (getCommandSubcommandPrefixFn !== getCommandSubcommandPrefix) { - commandSubcommandPrefix = await getCommandSubcommandPrefixFn(input11.command, context.abortController.signal, context.options.isNonInteractiveSession); + commandSubcommandPrefix = await getCommandSubcommandPrefixFn(input.command, context.abortController.signal, context.options.isNonInteractiveSession); if (context.abortController.signal.aborted) { throw new AbortError; } } appState = context.getAppState(); if (subcommands.length === 1) { - const result3 = await checkCommandAndSuggestRules({ command: subcommands[0] }, appState.toolPermissionContext, commandSubcommandPrefix, compoundCommandHasCd, astSubcommands !== null); - if (result3.behavior === "ask" || result3.behavior === "passthrough") { + const result2 = await checkCommandAndSuggestRules({ command: subcommands[0] }, appState.toolPermissionContext, commandSubcommandPrefix, compoundCommandHasCd, astSubcommands !== null); + if (result2.behavior === "ask" || result2.behavior === "passthrough") { return { - ...result3, + ...result2, ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: buildPendingClassifierCheck(input11.command, appState.toolPermissionContext) + pendingClassifierCheck: buildPendingClassifierCheck(input.command, appState.toolPermissionContext) } : {} }; } - return result3; + return result2; } const subcommandResults = new Map; for (const subcommand of subcommands) { subcommandResults.set(subcommand, await checkCommandAndSuggestRules({ - ...input11, + ...input, command: subcommand }, appState.toolPermissionContext, commandSubcommandPrefix?.subcommandPrefixes.get(subcommand), compoundCommandHasCd, astSubcommands !== null)); } @@ -530986,7 +454597,7 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi })) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "subcommandResults", reasons: subcommandResults @@ -531029,7 +454640,7 @@ async function bashToolHasPermission(input11, context, getCommandSubcommandPrefi decisionReason, suggestions: suggestedUpdates, ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: buildPendingClassifierCheck(input11.command, appState.toolPermissionContext) + pendingClassifierCheck: buildPendingClassifierCheck(input.command, appState.toolPermissionContext) } : {} }; } @@ -531062,9 +454673,9 @@ function isNormalizedCdCommand(command) { function commandHasAnyCd(command) { return splitCommand(command).some((subcmd) => isNormalizedCdCommand(subcmd.trim())); } -var bashCommandIsSafeAsync, splitCommand, ENV_VAR_ASSIGN_RE, MAX_SUBCOMMANDS_FOR_SECURITY_CHECK = 50, MAX_SUGGESTED_RULES_FOR_COMPOUND = 5, BARE_SHELL_PREFIXES, permissionRuleExtractPrefix3, bashPermissionRule, SAFE_ENV_VARS3, ANT_ONLY_SAFE_ENV_VARS, BINARY_HIJACK_VARS, bashToolCheckExactMatchPermission = (input11, toolPermissionContext) => { - const command = input11.command.trim(); - const { matchingDenyRules, matchingAskRules, matchingAllowRules } = matchingRulesForInput2(input11, toolPermissionContext, "exact"); +var bashCommandIsSafeAsync, splitCommand, ENV_VAR_ASSIGN_RE, MAX_SUBCOMMANDS_FOR_SECURITY_CHECK = 50, MAX_SUGGESTED_RULES_FOR_COMPOUND = 5, BARE_SHELL_PREFIXES, permissionRuleExtractPrefix3, bashPermissionRule, SAFE_ENV_VARS3, ANT_ONLY_SAFE_ENV_VARS, BINARY_HIJACK_VARS, bashToolCheckExactMatchPermission = (input, toolPermissionContext) => { + const command = input.command.trim(); + const { matchingDenyRules, matchingAskRules, matchingAllowRules } = matchingRulesForInput2(input, toolPermissionContext, "exact"); if (matchingDenyRules[0] !== undefined) { return { behavior: "deny", @@ -531088,7 +454699,7 @@ var bashCommandIsSafeAsync, splitCommand, ENV_VAR_ASSIGN_RE, MAX_SUBCOMMANDS_FOR if (matchingAllowRules[0] !== undefined) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "rule", rule: matchingAllowRules[0] @@ -531105,13 +454716,13 @@ var bashCommandIsSafeAsync, splitCommand, ENV_VAR_ASSIGN_RE, MAX_SUBCOMMANDS_FOR decisionReason, suggestions: suggestionForExactCommand3(command) }; -}, bashToolCheckPermission = (input11, toolPermissionContext, compoundCommandHasCd, astCommand) => { - const command = input11.command.trim(); - const exactMatchResult = bashToolCheckExactMatchPermission(input11, toolPermissionContext); +}, bashToolCheckPermission = (input, toolPermissionContext, compoundCommandHasCd, astCommand) => { + const command = input.command.trim(); + const exactMatchResult = bashToolCheckExactMatchPermission(input, toolPermissionContext); if (exactMatchResult.behavior === "deny" || exactMatchResult.behavior === "ask") { return exactMatchResult; } - const { matchingDenyRules, matchingAskRules, matchingAllowRules } = matchingRulesForInput2(input11, toolPermissionContext, "prefix", { + const { matchingDenyRules, matchingAskRules, matchingAllowRules } = matchingRulesForInput2(input, toolPermissionContext, "prefix", { skipCompoundCheck: astCommand !== undefined }); if (matchingDenyRules[0] !== undefined) { @@ -531134,7 +454745,7 @@ var bashCommandIsSafeAsync, splitCommand, ENV_VAR_ASSIGN_RE, MAX_SUBCOMMANDS_FOR } }; } - const pathResult = checkPathConstraints(input11, getCwd(), toolPermissionContext, compoundCommandHasCd, astCommand?.redirects, astCommand ? [astCommand] : undefined); + const pathResult = checkPathConstraints(input, getCwd(), toolPermissionContext, compoundCommandHasCd, astCommand?.redirects, astCommand ? [astCommand] : undefined); if (pathResult.behavior !== "passthrough") { return pathResult; } @@ -531144,25 +454755,25 @@ var bashCommandIsSafeAsync, splitCommand, ENV_VAR_ASSIGN_RE, MAX_SUBCOMMANDS_FOR if (matchingAllowRules[0] !== undefined) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "rule", rule: matchingAllowRules[0] } }; } - const sedConstraintResult = checkSedConstraints(input11, toolPermissionContext); + const sedConstraintResult = checkSedConstraints(input, toolPermissionContext); if (sedConstraintResult.behavior !== "passthrough") { return sedConstraintResult; } - const modeResult = checkPermissionMode2(input11, toolPermissionContext); + const modeResult = checkPermissionMode2(input, toolPermissionContext); if (modeResult.behavior !== "passthrough") { return modeResult; } - if (BashTool.isReadOnly(input11)) { + if (BashTool.isReadOnly(input)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Read-only command is allowed" @@ -531187,7 +454798,7 @@ var init_bashPermissions = __esm(() => { init_analytics(); init_ast(); init_commands(); - init_parser5(); + init_parser4(); init_shellQuote(); init_cwd2(); init_debug(); @@ -531365,8 +454976,8 @@ function startSessionActivity(reason) { startHeartbeatTimer(); } } - if (!cleanupRegistered3) { - cleanupRegistered3 = true; + if (!cleanupRegistered2) { + cleanupRegistered2 = true; registerCleanup(async () => { logForDiagnosticsNoPII("info", "session_activity_at_shutdown", { refcount, @@ -531391,7 +455002,7 @@ function stopSessionActivity(reason) { startIdleTimer(); } } -var SESSION_ACTIVITY_INTERVAL_MS = 30000, activityCallback = null, refcount = 0, activeReasons, oldestActivityStartedAt = null, heartbeatTimer = null, idleTimer = null, cleanupRegistered3 = false; +var SESSION_ACTIVITY_INTERVAL_MS = 30000, activityCallback = null, refcount = 0, activeReasons, oldestActivityStartedAt = null, heartbeatTimer = null, idleTimer = null, cleanupRegistered2 = false; var init_sessionActivity = __esm(() => { init_cleanupRegistry(); init_diagLogs(); @@ -531400,9 +455011,9 @@ var init_sessionActivity = __esm(() => { }); // src/utils/stream.ts -var Stream5; +var Stream3; var init_stream3 = __esm(() => { - Stream5 = class Stream5 { + Stream3 = class Stream3 { returned; queue = []; readResolve; @@ -531433,17 +455044,17 @@ var init_stream3 = __esm(() => { if (this.hasError) { return Promise.reject(this.hasError); } - return new Promise((resolve36, reject3) => { - this.readResolve = resolve36; - this.readReject = reject3; + return new Promise((resolve30, reject2) => { + this.readResolve = resolve30; + this.readReject = reject2; }); } enqueue(value) { if (this.readResolve) { - const resolve36 = this.readResolve; + const resolve30 = this.readResolve; this.readResolve = undefined; this.readReject = undefined; - resolve36({ done: false, value }); + resolve30({ done: false, value }); } else { this.queue.push(value); } @@ -531451,19 +455062,19 @@ var init_stream3 = __esm(() => { done() { this.isDone = true; if (this.readResolve) { - const resolve36 = this.readResolve; + const resolve30 = this.readResolve; this.readResolve = undefined; this.readReject = undefined; - resolve36({ done: true, value: undefined }); + resolve30({ done: true, value: undefined }); } } - error(error45) { - this.hasError = error45; + error(error41) { + this.hasError = error41; if (this.readReject) { - const reject3 = this.readReject; + const reject2 = this.readReject; this.readResolve = undefined; this.readReject = undefined; - reject3(error45); + reject2(error41); } } return() { @@ -531477,14 +455088,14 @@ var init_stream3 = __esm(() => { }); // src/utils/toolErrors.ts -function formatError2(error45) { - if (error45 instanceof AbortError) { - return error45.message || INTERRUPT_MESSAGE_FOR_TOOL_USE; +function formatError2(error41) { + if (error41 instanceof AbortError) { + return error41.message || INTERRUPT_MESSAGE_FOR_TOOL_USE; } - if (!(error45 instanceof Error)) { - return String(error45); + if (!(error41 instanceof Error)) { + return String(error41); } - const parts = getErrorParts(error45); + const parts = getErrorParts(error41); const fullMessage = parts.filter(Boolean).join(` `).trim() || "Command failed with no output"; if (fullMessage.length <= 1e4) { @@ -531499,28 +455110,28 @@ function formatError2(error45) { ${end}`; } -function getErrorParts(error45) { - if (error45 instanceof ShellError) { +function getErrorParts(error41) { + if (error41 instanceof ShellError) { return [ - `Exit code ${error45.code}`, - error45.interrupted ? INTERRUPT_MESSAGE_FOR_TOOL_USE : "", - error45.stderr, - error45.stdout + `Exit code ${error41.code}`, + error41.interrupted ? INTERRUPT_MESSAGE_FOR_TOOL_USE : "", + error41.stderr, + error41.stdout ]; } - const parts = [error45.message]; - if ("stderr" in error45 && typeof error45.stderr === "string") { - parts.push(error45.stderr); + const parts = [error41.message]; + if ("stderr" in error41 && typeof error41.stderr === "string") { + parts.push(error41.stderr); } - if ("stdout" in error45 && typeof error45.stdout === "string") { - parts.push(error45.stdout); + if ("stdout" in error41 && typeof error41.stdout === "string") { + parts.push(error41.stdout); } return parts; } -function formatValidationPath(path21) { - if (path21.length === 0) +function formatValidationPath(path16) { + if (path16.length === 0) return ""; - return path21.reduce((acc, segment, index) => { + return path16.reduce((acc, segment, index) => { const segmentStr = String(segment); if (typeof segment === "number") { return `${String(acc)}[${segmentStr}]`; @@ -531528,20 +455139,20 @@ function formatValidationPath(path21) { return index === 0 ? segmentStr : `${String(acc)}.${segmentStr}`; }, ""); } -function formatZodValidationError(toolName, error45) { - const missingParams = error45.issues.filter((err3) => err3.code === "invalid_type" && err3.message.includes("received undefined")).map((err3) => formatValidationPath(err3.path)); - const unexpectedParams = error45.issues.filter((err3) => err3.code === "unrecognized_keys").flatMap((err3) => err3.keys); - const typeMismatchParams = error45.issues.filter((err3) => err3.code === "invalid_type" && !err3.message.includes("received undefined")).map((err3) => { - const typeErr = err3; - const receivedMatch = err3.message.match(/received (\w+)/); +function formatZodValidationError(toolName, error41) { + const missingParams = error41.issues.filter((err2) => err2.code === "invalid_type" && err2.message.includes("received undefined")).map((err2) => formatValidationPath(err2.path)); + const unexpectedParams = error41.issues.filter((err2) => err2.code === "unrecognized_keys").flatMap((err2) => err2.keys); + const typeMismatchParams = error41.issues.filter((err2) => err2.code === "invalid_type" && !err2.message.includes("received undefined")).map((err2) => { + const typeErr = err2; + const receivedMatch = err2.message.match(/received (\w+)/); const received = receivedMatch ? receivedMatch[1] : "unknown"; return { - param: formatValidationPath(err3.path), + param: formatValidationPath(err2.path), expected: typeErr.expected, received }; }); - let errorContent = error45.message; + let errorContent = error41.message; const errorParts = []; if (missingParams.length > 0) { const missingParamErrors = missingParams.map((param) => `The required parameter \`${param}\` is missing`); @@ -531564,7 +455175,7 @@ ${errorParts.join(` } var init_toolErrors = __esm(() => { init_errors(); - init_messages5(); + init_messages3(); }); // src/utils/permissions/PermissionResult.ts @@ -531586,9 +455197,9 @@ async function* runPostToolUseHooks(toolUseContext, tool, toolUseID, messageId, const appState = toolUseContext.getAppState(); const permissionMode = appState.toolPermissionContext.mode; let toolOutput = toolResponse; - for await (const result3 of executePostToolHooks(tool.name, toolUseID, toolInput, toolOutput, toolUseContext, permissionMode, toolUseContext.abortController.signal)) { + for await (const result2 of executePostToolHooks(tool.name, toolUseID, toolInput, toolOutput, toolUseContext, permissionMode, toolUseContext.abortController.signal)) { try { - if (result3.message?.type === "attachment" && result3.message.attachment.type === "hook_cancelled") { + if (result2.message?.type === "attachment" && result2.message.attachment.type === "hook_cancelled") { logEvent("tengu_post_tool_hooks_cancelled", { toolName: sanitizeToolNameForAnalytics(tool.name), queryChainId: toolUseContext.queryTracking?.chainId, @@ -531604,25 +455215,25 @@ async function* runPostToolUseHooks(toolUseContext, tool, toolUseID, messageId, }; continue; } - if (result3.message && !(result3.message.type === "attachment" && result3.message.attachment.type === "hook_blocking_error")) { - yield { message: result3.message }; + if (result2.message && !(result2.message.type === "attachment" && result2.message.attachment.type === "hook_blocking_error")) { + yield { message: result2.message }; } - if (result3.blockingError) { + if (result2.blockingError) { yield { message: createAttachmentMessage({ type: "hook_blocking_error", hookName: `PostToolUse:${tool.name}`, toolUseID, hookEvent: "PostToolUse", - blockingError: result3.blockingError + blockingError: result2.blockingError }) }; } - if (result3.preventContinuation) { + if (result2.preventContinuation) { yield { message: createAttachmentMessage({ type: "hook_stopped_continuation", - message: result3.stopReason || "Execution stopped by PostToolUse hook", + message: result2.stopReason || "Execution stopped by PostToolUse hook", hookName: `PostToolUse:${tool.name}`, toolUseID, hookEvent: "PostToolUse" @@ -531630,24 +455241,24 @@ async function* runPostToolUseHooks(toolUseContext, tool, toolUseID, messageId, }; return; } - if (result3.additionalContexts && result3.additionalContexts.length > 0) { + if (result2.additionalContexts && result2.additionalContexts.length > 0) { yield { message: createAttachmentMessage({ type: "hook_additional_context", - content: result3.additionalContexts, + content: result2.additionalContexts, hookName: `PostToolUse:${tool.name}`, toolUseID, hookEvent: "PostToolUse" }) }; } - if (result3.updatedMCPToolOutput && isMcpTool(tool)) { - toolOutput = result3.updatedMCPToolOutput; + if (result2.updatedMCPToolOutput && isMcpTool(tool)) { + toolOutput = result2.updatedMCPToolOutput; yield { updatedMCPToolOutput: toolOutput }; } - } catch (error45) { + } catch (error41) { const postToolDurationMs = Date.now() - postToolStartTime; logEvent("tengu_post_tool_hook_error", { messageID: messageId, @@ -531666,7 +455277,7 @@ async function* runPostToolUseHooks(toolUseContext, tool, toolUseID, messageId, yield { message: createAttachmentMessage({ type: "hook_error_during_execution", - content: formatError2(error45), + content: formatError2(error41), hookName: `PostToolUse:${tool.name}`, toolUseID, hookEvent: "PostToolUse" @@ -531674,18 +455285,18 @@ async function* runPostToolUseHooks(toolUseContext, tool, toolUseID, messageId, }; } } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); } } -async function* runPostToolUseFailureHooks(toolUseContext, tool, toolUseID, messageId, processedInput, error45, isInterrupt, requestId, mcpServerType, mcpServerBaseUrl) { +async function* runPostToolUseFailureHooks(toolUseContext, tool, toolUseID, messageId, processedInput, error41, isInterrupt, requestId, mcpServerType, mcpServerBaseUrl) { const postToolStartTime = Date.now(); try { const appState = toolUseContext.getAppState(); const permissionMode = appState.toolPermissionContext.mode; - for await (const result3 of executePostToolUseFailureHooks(tool.name, toolUseID, processedInput, error45, toolUseContext, isInterrupt, permissionMode, toolUseContext.abortController.signal)) { + for await (const result2 of executePostToolUseFailureHooks(tool.name, toolUseID, processedInput, error41, toolUseContext, isInterrupt, permissionMode, toolUseContext.abortController.signal)) { try { - if (result3.message?.type === "attachment" && result3.message.attachment.type === "hook_cancelled") { + if (result2.message?.type === "attachment" && result2.message.attachment.type === "hook_cancelled") { logEvent("tengu_post_tool_failure_hooks_cancelled", { toolName: sanitizeToolNameForAnalytics(tool.name), queryChainId: toolUseContext.queryTracking?.chainId, @@ -531701,25 +455312,25 @@ async function* runPostToolUseFailureHooks(toolUseContext, tool, toolUseID, mess }; continue; } - if (result3.message && !(result3.message.type === "attachment" && result3.message.attachment.type === "hook_blocking_error")) { - yield { message: result3.message }; + if (result2.message && !(result2.message.type === "attachment" && result2.message.attachment.type === "hook_blocking_error")) { + yield { message: result2.message }; } - if (result3.blockingError) { + if (result2.blockingError) { yield { message: createAttachmentMessage({ type: "hook_blocking_error", hookName: `PostToolUseFailure:${tool.name}`, toolUseID, hookEvent: "PostToolUseFailure", - blockingError: result3.blockingError + blockingError: result2.blockingError }) }; } - if (result3.additionalContexts && result3.additionalContexts.length > 0) { + if (result2.additionalContexts && result2.additionalContexts.length > 0) { yield { message: createAttachmentMessage({ type: "hook_additional_context", - content: result3.additionalContexts, + content: result2.additionalContexts, hookName: `PostToolUseFailure:${tool.name}`, toolUseID, hookEvent: "PostToolUseFailure" @@ -531757,11 +455368,11 @@ async function* runPostToolUseFailureHooks(toolUseContext, tool, toolUseID, mess logError2(outerError); } } -async function resolveHookPermissionDecision(hookPermissionResult, tool, input11, toolUseContext, canUseTool, assistantMessage, toolUseID) { +async function resolveHookPermissionDecision(hookPermissionResult, tool, input, toolUseContext, canUseTool, assistantMessage, toolUseID) { const requiresInteraction = tool.requiresUserInteraction?.(); const requireCanUseTool = toolUseContext.requireCanUseTool; if (hookPermissionResult?.behavior === "allow") { - const hookInput = hookPermissionResult.updatedInput ?? input11; + const hookInput = hookPermissionResult.updatedInput ?? input; const interactionSatisfied = requiresInteraction && hookPermissionResult.updatedInput !== undefined; if (requiresInteraction && !interactionSatisfied || requireCanUseTool) { logForDebugging(`Hook approved tool use for ${tool.name}, but canUseTool is required`); @@ -531787,10 +455398,10 @@ async function resolveHookPermissionDecision(hookPermissionResult, tool, input11 } if (hookPermissionResult?.behavior === "deny") { logForDebugging(`Hook denied tool use for ${tool.name}`); - return { decision: hookPermissionResult, input: input11 }; + return { decision: hookPermissionResult, input }; } const forceDecision = hookPermissionResult?.behavior === "ask" ? hookPermissionResult : undefined; - const askInput = hookPermissionResult?.behavior === "ask" && hookPermissionResult.updatedInput ? hookPermissionResult.updatedInput : input11; + const askInput = hookPermissionResult?.behavior === "ask" && hookPermissionResult.updatedInput ? hookPermissionResult.updatedInput : input; return { decision: await canUseTool(tool, askInput, toolUseContext, assistantMessage, toolUseID, forceDecision), input: askInput @@ -531800,13 +455411,13 @@ async function* runPreToolUseHooks(toolUseContext, tool, processedInput, toolUse const hookStartTime = Date.now(); try { const appState = toolUseContext.getAppState(); - for await (const result3 of executePreToolHooks(tool.name, toolUseID, processedInput, toolUseContext, appState.toolPermissionContext.mode, toolUseContext.abortController.signal, undefined, toolUseContext.requestPrompt, tool.getToolUseSummary?.(processedInput))) { + for await (const result2 of executePreToolHooks(tool.name, toolUseID, processedInput, toolUseContext, appState.toolPermissionContext.mode, toolUseContext.abortController.signal, undefined, toolUseContext.requestPrompt, tool.getToolUseSummary?.(processedInput))) { try { - if (result3.message) { - yield { type: "message", message: { message: result3.message } }; + if (result2.message) { + yield { type: "message", message: { message: result2.message } }; } - if (result3.blockingError) { - const denialMessage = getPreToolHookBlockingMessage(`PreToolUse:${tool.name}`, result3.blockingError); + if (result2.blockingError) { + const denialMessage = getPreToolHookBlockingMessage(`PreToolUse:${tool.name}`, result2.blockingError); yield { type: "hookPermissionResult", hookPermissionResult: { @@ -531820,39 +455431,39 @@ async function* runPreToolUseHooks(toolUseContext, tool, processedInput, toolUse } }; } - if (result3.preventContinuation) { + if (result2.preventContinuation) { yield { type: "preventContinuation", shouldPreventContinuation: true }; - if (result3.stopReason) { - yield { type: "stopReason", stopReason: result3.stopReason }; + if (result2.stopReason) { + yield { type: "stopReason", stopReason: result2.stopReason }; } } - if (result3.permissionBehavior !== undefined) { - logForDebugging(`Hook result has permissionBehavior=${result3.permissionBehavior}`); + if (result2.permissionBehavior !== undefined) { + logForDebugging(`Hook result has permissionBehavior=${result2.permissionBehavior}`); const decisionReason = { type: "hook", hookName: `PreToolUse:${tool.name}`, - hookSource: result3.hookSource, - reason: result3.hookPermissionDecisionReason + hookSource: result2.hookSource, + reason: result2.hookPermissionDecisionReason }; - if (result3.permissionBehavior === "allow") { + if (result2.permissionBehavior === "allow") { yield { type: "hookPermissionResult", hookPermissionResult: { behavior: "allow", - updatedInput: result3.updatedInput, + updatedInput: result2.updatedInput, decisionReason } }; - } else if (result3.permissionBehavior === "ask") { + } else if (result2.permissionBehavior === "ask") { yield { type: "hookPermissionResult", hookPermissionResult: { behavior: "ask", - updatedInput: result3.updatedInput, - message: result3.hookPermissionDecisionReason || `Hook PreToolUse:${tool.name} ${getRuleBehaviorDescription(result3.permissionBehavior)} this tool`, + updatedInput: result2.updatedInput, + message: result2.hookPermissionDecisionReason || `Hook PreToolUse:${tool.name} ${getRuleBehaviorDescription(result2.permissionBehavior)} this tool`, decisionReason } }; @@ -531860,26 +455471,26 @@ async function* runPreToolUseHooks(toolUseContext, tool, processedInput, toolUse yield { type: "hookPermissionResult", hookPermissionResult: { - behavior: result3.permissionBehavior, - message: result3.hookPermissionDecisionReason || `Hook PreToolUse:${tool.name} ${getRuleBehaviorDescription(result3.permissionBehavior)} this tool`, + behavior: result2.permissionBehavior, + message: result2.hookPermissionDecisionReason || `Hook PreToolUse:${tool.name} ${getRuleBehaviorDescription(result2.permissionBehavior)} this tool`, decisionReason } }; } } - if (result3.updatedInput && result3.permissionBehavior === undefined) { + if (result2.updatedInput && result2.permissionBehavior === undefined) { yield { type: "hookUpdatedInput", - updatedInput: result3.updatedInput + updatedInput: result2.updatedInput }; } - if (result3.additionalContexts && result3.additionalContexts.length > 0) { + if (result2.additionalContexts && result2.additionalContexts.length > 0) { yield { type: "additionalContext", message: { message: createAttachmentMessage({ type: "hook_additional_context", - content: result3.additionalContexts, + content: result2.additionalContexts, hookName: `PreToolUse:${tool.name}`, toolUseID, hookEvent: "PreToolUse" @@ -531907,8 +455518,8 @@ async function* runPreToolUseHooks(toolUseContext, tool, processedInput, toolUse yield { type: "stop" }; return; } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); const durationMs = Date.now() - hookStartTime; logEvent("tengu_pre_tool_hook_error", { messageID: messageId, @@ -531929,7 +455540,7 @@ async function* runPreToolUseHooks(toolUseContext, tool, processedInput, toolUse message: { message: createAttachmentMessage({ type: "hook_error_during_execution", - content: formatError2(error45), + content: formatError2(error41), hookName: `PreToolUse:${tool.name}`, toolUseID, hookEvent: "PreToolUse" @@ -531939,8 +455550,8 @@ async function* runPreToolUseHooks(toolUseContext, tool, processedInput, toolUse yield { type: "stop" }; } } - } catch (error45) { - logError2(error45); + } catch (error41) { + logError2(error41); yield { type: "stop" }; return; } @@ -531954,21 +455565,21 @@ var init_toolHooks = __esm(() => { init_log3(); init_permissions2(); init_toolErrors(); - init_utils4(); + init_utils3(); }); // src/services/tools/toolExecution.ts -function classifyToolError(error45) { - if (error45 instanceof TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS) { - return error45.telemetryMessage.slice(0, 200); +function classifyToolError(error41) { + if (error41 instanceof TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS) { + return error41.telemetryMessage.slice(0, 200); } - if (error45 instanceof Error) { - const errnoCode = getErrnoCode(error45); + if (error41 instanceof Error) { + const errnoCode = getErrnoCode(error41); if (typeof errnoCode === "string") { return `Error:${errnoCode}`; } - if (error45.name && error45.name !== "Error" && error45.name.length > 3) { - return error45.name.slice(0, 60); + if (error41.name && error41.name !== "Error" && error41.name.length > 3) { + return error41.name.slice(0, 60); } return "Error"; } @@ -532037,7 +455648,7 @@ function findMcpServerConnection(toolName, mcpClients) { if (!mcpInfo) { return; } - return mcpClients.find((client5) => normalizeNameForMCP(client5.name) === mcpInfo.serverName); + return mcpClients.find((client2) => normalizeNameForMCP(client2.name) === mcpInfo.serverName); } function getMcpServerType(toolName, mcpClients) { const serverConnection = findMcpServerConnection(toolName, mcpClients); @@ -532134,12 +455745,12 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext }; return; } - for await (const update3 of streamedCheckPermissionsAndCallTool(tool, toolUse.id, toolInput, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl)) { - yield update3; + for await (const update2 of streamedCheckPermissionsAndCallTool(tool, toolUse.id, toolInput, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl)) { + yield update2; } - } catch (error45) { - logError2(error45); - const errorMessage2 = error45 instanceof Error ? error45.message : String(error45); + } catch (error41) { + logError2(error41); + const errorMessage2 = error41 instanceof Error ? error41.message : String(error41); const toolInfo = tool ? ` (${tool.name})` : ""; const detailedError = `Error calling tool${toolInfo}: ${errorMessage2}`; yield { @@ -532158,9 +455769,9 @@ async function* runToolUse(toolUse, assistantMessage, canUseTool, toolUseContext }; } } -function streamedCheckPermissionsAndCallTool(tool, toolUseID, input11, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl) { - const stream4 = new Stream5; - checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl, (progress) => { +function streamedCheckPermissionsAndCallTool(tool, toolUseID, input, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl) { + const stream4 = new Stream3; + checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl, (progress) => { logEvent("tengu_tool_use_progress", { messageID: messageId, toolName: sanitizeToolNameForAnalytics(tool.name), @@ -532186,11 +455797,11 @@ function streamedCheckPermissionsAndCallTool(tool, toolUseID, input11, toolUseCo }) }); }).then((results) => { - for (const result3 of results) { - stream4.enqueue(result3); + for (const result2 of results) { + stream4.enqueue(result2); } - }).catch((error45) => { - stream4.error(error45); + }).catch((error41) => { + stream4.error(error41); }).finally(() => { stream4.done(); }); @@ -532210,8 +455821,8 @@ function buildSchemaNotSentHint(tool, messages, tools) { This tool's schema was not sent to the API — it was not in the discovered-tool set derived from message history. ` + `Without the schema in your prompt, typed parameters (arrays, numbers, booleans) get emitted as strings and the client-side parser rejects them. ` + `Load the tool first: call ${TOOL_SEARCH_TOOL_NAME} with query "select:${tool.name}", then retry this call.`; } -async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl, onToolProgress) { - const parsedInput = tool.inputSchema.safeParse(input11); +async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl, onToolProgress) { + const parsedInput = tool.inputSchema.safeParse(input); if (!parsedInput.success) { let errorContent = formatZodValidationError(tool.name, parsedInput.error); const schemaHint = buildSchemaNotSentHint(tool, toolUseContext.messages, toolUseContext.options.tools); @@ -532305,8 +455916,8 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont const resultingMessages = []; let processedInput = parsedInput.data; if (tool.name === BASH_TOOL_NAME && processedInput && typeof processedInput === "object" && "_simulatedSedEdit" in processedInput) { - const { _simulatedSedEdit: _, ...rest3 } = processedInput; - processedInput = rest3; + const { _simulatedSedEdit: _, ...rest2 } = processedInput; + processedInput = rest2; } let callInput = processedInput; const backfilledClone = tool.backfillObservableInput && typeof processedInput === "object" && processedInput !== null ? { ...processedInput } : null; @@ -532319,14 +455930,14 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont let hookPermissionResult; const preToolHookInfos = []; const preToolHookStart = Date.now(); - for await (const result3 of runPreToolUseHooks(toolUseContext, tool, processedInput, toolUseID, assistantMessage.message.id, requestId, mcpServerType, mcpServerBaseUrl)) { - switch (result3.type) { + for await (const result2 of runPreToolUseHooks(toolUseContext, tool, processedInput, toolUseID, assistantMessage.message.id, requestId, mcpServerType, mcpServerBaseUrl)) { + switch (result2.type) { case "message": - if (result3.message.message.type === "progress") { - onToolProgress(result3.message.message); + if (result2.message.message.type === "progress") { + onToolProgress(result2.message.message); } else { - resultingMessages.push(result3.message); - const att = result3.message.message.attachment; + resultingMessages.push(result2.message); + const att = result2.message.message.attachment; if (att && "command" in att && att.command !== undefined && "durationMs" in att && att.durationMs !== undefined) { preToolHookInfos.push({ command: att.command, @@ -532336,19 +455947,19 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont } break; case "hookPermissionResult": - hookPermissionResult = result3.hookPermissionResult; + hookPermissionResult = result2.hookPermissionResult; break; case "hookUpdatedInput": - processedInput = result3.updatedInput; + processedInput = result2.updatedInput; break; case "preventContinuation": - shouldPreventContinuation = result3.shouldPreventContinuation; + shouldPreventContinuation = result2.shouldPreventContinuation; break; case "stopReason": - stopReason = result3.stopReason; + stopReason = result2.stopReason; break; case "additionalContext": - resultingMessages.push(result3.message); + resultingMessages.push(result2.message); break; case "stop": getStatsStore()?.observe("pre_tool_hook_duration_ms", Date.now() - preToolHookStart); @@ -532460,7 +456071,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont const imageCount = count2(rejectContentBlocks, (b) => b.type === "image"); if (imageCount > 0) { const startId = getNextImagePasteId(toolUseContext.messages); - rejectImageIds = Array.from({ length: imageCount }, (_, i4) => startId + i4); + rejectImageIds = Array.from({ length: imageCount }, (_, i3) => startId + i3); } } resultingMessages.push({ @@ -532473,8 +456084,8 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont }); if (feature("TRANSCRIPT_CLASSIFIER") && permissionDecision.decisionReason?.type === "classifier" && permissionDecision.decisionReason.classifier === "auto-mode") { let hookSaysRetry = false; - for await (const result3 of executePermissionDeniedHooks(tool.name, toolUseID, processedInput, permissionDecision.decisionReason.reason ?? "Permission denied", toolUseContext, permissionMode, toolUseContext.abortController.signal)) { - if (result3.retry) + for await (const result2 of executePermissionDeniedHooks(tool.name, toolUseID, processedInput, permissionDecision.decisionReason.reason ?? "Permission denied", toolUseContext, permissionMode, toolUseContext.abortController.signal)) { + if (result2.retry) hookSaysRetry = true; } if (hookSaysRetry) { @@ -532552,7 +456163,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont callInput = processedInput; } try { - const result3 = await tool.call(callInput, { + const result2 = await tool.call(callInput, { ...toolUseContext, toolUseId: toolUseID, userModified: permissionDecision.userModified ?? false @@ -532564,18 +456175,18 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont }); const durationMs = Date.now() - startTime; addToToolDuration(durationMs); - if (result3.data && typeof result3.data === "object") { + if (result2.data && typeof result2.data === "object") { const contentAttributes = {}; - if (tool.name === FILE_READ_TOOL_NAME && "content" in result3.data) { + if (tool.name === FILE_READ_TOOL_NAME && "content" in result2.data) { if ("file_path" in processedInput) { contentAttributes.file_path = String(processedInput.file_path); } - contentAttributes.content = String(result3.data.content); + contentAttributes.content = String(result2.data.content); } if ((tool.name === FILE_EDIT_TOOL_NAME || tool.name === FILE_WRITE_TOOL_NAME) && "file_path" in processedInput) { contentAttributes.file_path = String(processedInput.file_path); - if (tool.name === FILE_EDIT_TOOL_NAME && "diff" in result3.data) { - contentAttributes.diff = String(result3.data.diff); + if (tool.name === FILE_EDIT_TOOL_NAME && "diff" in result2.data) { + contentAttributes.diff = String(result2.data.diff); } if (tool.name === FILE_WRITE_TOOL_NAME && "content" in processedInput) { contentAttributes.content = String(processedInput.content); @@ -532584,26 +456195,26 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont if (tool.name === BASH_TOOL_NAME && "command" in processedInput) { const bashInput = processedInput; contentAttributes.bash_command = bashInput.command; - if ("output" in result3.data) { - contentAttributes.output = String(result3.data.output); + if ("output" in result2.data) { + contentAttributes.output = String(result2.data.output); } } if (Object.keys(contentAttributes).length > 0) { addToolContentEvent("tool.output", contentAttributes); } } - if (typeof result3 === "object" && "structured_output" in result3) { + if (typeof result2 === "object" && "structured_output" in result2) { resultingMessages.push({ message: createAttachmentMessage({ type: "structured_output", - data: result3.structured_output + data: result2.structured_output }) }); } endToolExecutionSpan({ success: true }); - const toolResultStr = result3.data && typeof result3.data === "object" ? jsonStringify(result3.data) : String(result3.data ?? ""); + const toolResultStr = result2.data && typeof result2.data === "object" ? jsonStringify(result2.data) : String(result2.data ?? ""); endToolSpan(toolResultStr); - const mappedToolResultBlock = tool.mapToolResultToToolResultBlockParam(result3.data, toolUseID); + const mappedToolResultBlock = tool.mapToolResultToToolResultBlockParam(result2.data, toolUseID); const mappedContent = mappedToolResultBlock.content; const toolResultSizeBytes = !mappedContent ? 0 : typeof mappedContent === "string" ? mappedContent.length : jsonStringify(mappedContent).length; let fileExtension2; @@ -532638,8 +456249,8 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont }, ...mcpToolDetailsForAnalytics(tool.name, mcpServerType, mcpServerBaseUrl) }); - if (isToolDetailsLoggingEnabled() && (tool.name === BASH_TOOL_NAME || tool.name === POWERSHELL_TOOL_NAME) && "command" in processedInput && typeof processedInput.command === "string" && processedInput.command.match(/\bgit\s+commit\b/) && result3.data && typeof result3.data === "object" && "stdout" in result3.data) { - const gitCommitId = parseGitCommitId(String(result3.data.stdout)); + if (isToolDetailsLoggingEnabled() && (tool.name === BASH_TOOL_NAME || tool.name === POWERSHELL_TOOL_NAME) && "command" in processedInput && typeof processedInput.command === "string" && processedInput.command.match(/\bgit\s+commit\b/) && result2.data && typeof result2.data === "object" && "stdout" in result2.data) { + const gitCommitId = parseGitCommitId(String(result2.data.stdout)); if (gitCommitId) { toolParameters.git_commit_id = gitCommitId; } @@ -532660,10 +456271,10 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont }, ...mcpServerScope && { mcp_server_scope: mcpServerScope } }); - let toolOutput = result3.data; + let toolOutput = result2.data; const hookResults = []; - const toolContextModifier = result3.contextModifier; - const mcpMeta = result3.mcpMeta; + const toolContextModifier = result2.contextModifier; + const mcpMeta = result2.mcpMeta; async function addToolResult(toolUseResult, preMappedBlock) { const toolResultBlock = preMappedBlock ? await processPreMappedToolResultBlock(preMappedBlock, tool.name, tool.maxResultSizeChars) : await processToolResultBlock(tool, toolUseResult, toolUseID); const contentBlocks = [toolResultBlock]; @@ -532682,7 +456293,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont const imageCount = count2(allowContentBlocks, (b) => b.type === "image"); if (imageCount > 0) { const startId = getNextImagePasteId(toolUseContext.messages); - allowImageIds = Array.from({ length: imageCount }, (_, i4) => startId + i4); + allowImageIds = Array.from({ length: imageCount }, (_, i3) => startId + i3); } } resultingMessages.push({ @@ -532747,8 +456358,8 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont }); } } - if (result3.newMessages && result3.newMessages.length > 0) { - for (const message of result3.newMessages) { + if (result2.newMessages && result2.newMessages.length > 0) { + for (const message of result2.newMessages) { resultingMessages.push({ message }); } } @@ -532767,17 +456378,17 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont resultingMessages.push(hookResult); } return resultingMessages; - } catch (error45) { + } catch (error41) { const durationMs = Date.now() - startTime; addToToolDuration(durationMs); endToolExecutionSpan({ success: false, - error: errorMessage(error45) + error: errorMessage(error41) }); endToolSpan(); - if (error45 instanceof McpAuthError) { + if (error41 instanceof McpAuthError) { toolUseContext.setAppState((prevState) => { - const serverName = error45.serverName; + const serverName = error41.serverName; const existingClientIndex = prevState.mcp.clients.findIndex((c6) => c6.name === serverName); if (existingClientIndex === -1) { return prevState; @@ -532801,16 +456412,16 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont }; }); } - if (!(error45 instanceof AbortError)) { - const errorMsg = errorMessage(error45); + if (!(error41 instanceof AbortError)) { + const errorMsg = errorMessage(error41); logForDebugging(`${tool.name} tool error (${durationMs}ms): ${errorMsg.slice(0, 200)}`); - if (!(error45 instanceof ShellError)) { - logError2(error45); + if (!(error41 instanceof ShellError)) { + logError2(error41); } logEvent("tengu_tool_use_error", { messageID: messageId, toolName: sanitizeToolNameForAnalytics(tool.name), - error: classifyToolError(error45), + error: classifyToolError(error41), isMcp: tool.isMcp ?? false, queryChainId: toolUseContext.queryTracking?.chainId, queryDepth: toolUseContext.queryTracking?.depth, @@ -532831,7 +456442,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont use_id: toolUseID, success: "false", duration_ms: String(durationMs), - error: errorMessage(error45), + error: errorMessage(error41), ...Object.keys(toolParameters).length > 0 && { tool_parameters: jsonStringify(toolParameters) }, @@ -532843,8 +456454,8 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont ...mcpServerScope && { mcp_server_scope: mcpServerScope } }); } - const content = formatError2(error45); - const isInterrupt = error45 instanceof AbortError; + const content = formatError2(error41); + const isInterrupt = error41 instanceof AbortError; const hookMessages = []; for await (const hookResult of runPostToolUseFailureHooks(toolUseContext, tool, toolUseID, messageId, processedInput, content, isInterrupt, requestId, mcpServerType, mcpServerBaseUrl)) { hookMessages.push(hookResult); @@ -532861,7 +456472,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input11, toolUseCont } ], toolUseResult: `Error: ${content}`, - mcpMeta: toolUseContext.agentId ? undefined : error45 instanceof McpToolCallError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS ? error45.mcpMeta : undefined, + mcpMeta: toolUseContext.agentId ? undefined : error41 instanceof McpToolCallError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS ? error41.mcpMeta : undefined, sourceToolAssistantUUID: assistantMessage.uuid }) }, @@ -532893,7 +456504,7 @@ var init_toolExecution = __esm(() => { init_errors(); init_hooks5(); init_log3(); - init_messages5(); + init_messages3(); init_sessionActivity(); init_slowOperations(); init_stream3(); @@ -532902,9 +456513,9 @@ var init_toolExecution = __esm(() => { init_toolErrors(); init_toolResultStorage(); init_toolSearch(); - init_client10(); + init_client6(); init_mcpStringUtils(); - init_utils4(); + init_utils3(); init_toolHooks(); }); @@ -533059,8 +456670,8 @@ class StreamingToolExecutor { } } getToolDescription(tool) { - const input11 = tool.block.input; - const summary = input11?.command ?? input11?.file_path ?? input11?.pattern ?? ""; + const input = tool.block.input; + const summary = input?.command ?? input?.file_path ?? input?.pattern ?? ""; if (typeof summary === "string" && summary.length > 0) { const truncated = summary.length > 40 ? summary.slice(0, 40) + "…" : summary; return `${tool.block.name}(${truncated})`; @@ -533095,13 +456706,13 @@ class StreamingToolExecutor { }, { once: true }); const generator = runToolUse(tool.block, tool.assistantMessage, this.canUseTool, { ...this.toolUseContext, abortController: toolAbortController }); let thisToolErrored = false; - for await (const update3 of generator) { + for await (const update2 of generator) { const abortReason = this.getAbortReason(tool); if (abortReason && !thisToolErrored) { messages.push(this.createSyntheticErrorMessage(tool.id, abortReason, tool.assistantMessage)); break; } - const isErrorResult = update3.message.type === "user" && Array.isArray(update3.message.message.content) && update3.message.message.content.some((_) => _.type === "tool_result" && _.is_error === true); + const isErrorResult = update2.message.type === "user" && Array.isArray(update2.message.message.content) && update2.message.message.content.some((_) => _.type === "tool_result" && _.is_error === true); if (isErrorResult) { thisToolErrored = true; if (tool.block.name === BASH_TOOL_NAME) { @@ -533110,19 +456721,19 @@ class StreamingToolExecutor { this.siblingAbortController.abort("sibling_error"); } } - if (update3.message) { - if (update3.message.type === "progress") { - tool.pendingProgress.push(update3.message); + if (update2.message) { + if (update2.message.type === "progress") { + tool.pendingProgress.push(update2.message); if (this.progressAvailableResolve) { this.progressAvailableResolve(); this.progressAvailableResolve = undefined; } } else { - messages.push(update3.message); + messages.push(update2.message); } } - if (update3.contextModifier) { - contextModifiers.push(update3.contextModifier.modifyContext); + if (update2.contextModifier) { + contextModifiers.push(update2.contextModifier.modifyContext); } } tool.results = messages; @@ -533173,21 +456784,21 @@ class StreamingToolExecutor { } while (this.hasUnfinishedTools()) { await this.processQueue(); - for (const result3 of this.getCompletedResults()) { - yield result3; + for (const result2 of this.getCompletedResults()) { + yield result2; } if (this.hasExecutingTools() && !this.hasCompletedResults() && !this.hasPendingProgress()) { const executingPromises = this.tools.filter((t) => t.status === "executing" && t.promise).map((t) => t.promise); - const progressPromise = new Promise((resolve36) => { - this.progressAvailableResolve = resolve36; + const progressPromise = new Promise((resolve30) => { + this.progressAvailableResolve = resolve30; }); if (executingPromises.length > 0) { await Promise.race([...executingPromises, progressPromise]); } } } - for (const result3 of this.getCompletedResults()) { - yield result3; + for (const result2 of this.getCompletedResults()) { + yield result2; } } hasCompletedResults() { @@ -533211,7 +456822,7 @@ function markToolUseAsComplete2(toolUseContext, toolUseID) { }); } var init_StreamingToolExecutor = __esm(() => { - init_messages5(); + init_messages3(); init_Tool(); init_abortController(); init_toolExecution(); @@ -533412,7 +457023,7 @@ var init_config5 = __esm(() => { // src/utils/readFileInRange.ts import { createReadStream as createReadStream2, fstat } from "fs"; -import { stat as fsStat3, readFile as readFile31 } from "fs/promises"; +import { stat as fsStat3, readFile as readFile30 } from "fs/promises"; async function readFileInRange(filePath, offset = 0, maxLines, maxBytes, signal, options2) { signal?.throwIfAborted(); const truncateOnByteLimit = options2?.truncateOnByteLimit ?? false; @@ -533424,14 +457035,14 @@ async function readFileInRange(filePath, offset = 0, maxLines, maxBytes, signal, if (!truncateOnByteLimit && maxBytes !== undefined && stats.size > maxBytes) { throw new FileTooLargeError(stats.size, maxBytes); } - const text2 = await readFile31(filePath, { encoding: "utf8", signal }); - return readFileInRangeFast(text2, stats.mtimeMs, offset, maxLines, truncateOnByteLimit ? maxBytes : undefined); + const text = await readFile30(filePath, { encoding: "utf8", signal }); + return readFileInRangeFast(text, stats.mtimeMs, offset, maxLines, truncateOnByteLimit ? maxBytes : undefined); } return readFileInRangeStreaming(filePath, offset, maxLines, maxBytes, truncateOnByteLimit, signal); } function readFileInRangeFast(raw, mtimeMs, offset, maxLines, truncateAtBytes) { const endLine = maxLines !== undefined ? offset + maxLines : Infinity; - const text2 = raw.charCodeAt(0) === 65279 ? raw.slice(1) : raw; + const text = raw.charCodeAt(0) === 65279 ? raw.slice(1) : raw; const selectedLines = []; let lineIndex = 0; let startPos = 0; @@ -533440,8 +457051,8 @@ function readFileInRangeFast(raw, mtimeMs, offset, maxLines, truncateAtBytes) { let truncatedByBytes = false; function tryPush(line) { if (truncateAtBytes !== undefined) { - const sep26 = selectedLines.length > 0 ? 1 : 0; - const nextBytes = selectedBytes + sep26 + Buffer.byteLength(line); + const sep23 = selectedLines.length > 0 ? 1 : 0; + const nextBytes = selectedBytes + sep23 + Buffer.byteLength(line); if (nextBytes > truncateAtBytes) { truncatedByBytes = true; return false; @@ -533451,10 +457062,10 @@ function readFileInRangeFast(raw, mtimeMs, offset, maxLines, truncateAtBytes) { selectedLines.push(line); return true; } - while ((newlinePos = text2.indexOf(` + while ((newlinePos = text.indexOf(` `, startPos)) !== -1) { if (lineIndex >= offset && lineIndex < endLine && !truncatedByBytes) { - let line = text2.slice(startPos, newlinePos); + let line = text.slice(startPos, newlinePos); if (line.endsWith("\r")) { line = line.slice(0, -1); } @@ -533464,7 +457075,7 @@ function readFileInRangeFast(raw, mtimeMs, offset, maxLines, truncateAtBytes) { startPos = newlinePos + 1; } if (lineIndex >= offset && lineIndex < endLine && !truncatedByBytes) { - let line = text2.slice(startPos); + let line = text.slice(startPos); if (line.endsWith("\r")) { line = line.slice(0, -1); } @@ -533477,30 +457088,30 @@ function readFileInRangeFast(raw, mtimeMs, offset, maxLines, truncateAtBytes) { content, lineCount: selectedLines.length, totalLines: lineIndex, - totalBytes: Buffer.byteLength(text2, "utf8"), + totalBytes: Buffer.byteLength(text, "utf8"), readBytes: Buffer.byteLength(content, "utf8"), mtimeMs, ...truncatedByBytes ? { truncatedByBytes: true } : {} }; } -function streamOnOpen(fd3) { - fstat(fd3, (err3, stats) => { - this.resolveMtime(err3 ? 0 : stats.mtimeMs); +function streamOnOpen(fd2) { + fstat(fd2, (err2, stats) => { + this.resolveMtime(err2 ? 0 : stats.mtimeMs); }); } -function streamOnData(chunk3) { +function streamOnData(chunk2) { if (this.isFirstChunk) { this.isFirstChunk = false; - if (chunk3.charCodeAt(0) === 65279) { - chunk3 = chunk3.slice(1); + if (chunk2.charCodeAt(0) === 65279) { + chunk2 = chunk2.slice(1); } } - this.totalBytesRead += Buffer.byteLength(chunk3); + this.totalBytesRead += Buffer.byteLength(chunk2); if (!this.truncateOnByteLimit && this.maxBytes !== undefined && this.totalBytesRead > this.maxBytes) { this.stream.destroy(new FileTooLargeError(this.totalBytesRead, this.maxBytes)); return; } - const data = this.partial.length > 0 ? this.partial + chunk3 : chunk3; + const data = this.partial.length > 0 ? this.partial + chunk2 : chunk2; this.partial = ""; let startPos = 0; let newlinePos; @@ -533512,8 +457123,8 @@ function streamOnData(chunk3) { line = line.slice(0, -1); } if (this.truncateOnByteLimit && this.maxBytes !== undefined) { - const sep26 = this.selectedLines.length > 0 ? 1 : 0; - const nextBytes = this.selectedBytes + sep26 + Buffer.byteLength(line); + const sep23 = this.selectedLines.length > 0 ? 1 : 0; + const nextBytes = this.selectedBytes + sep23 + Buffer.byteLength(line); if (nextBytes > this.maxBytes) { this.truncatedByBytes = true; this.endLine = this.currentLineIndex; @@ -533532,8 +457143,8 @@ function streamOnData(chunk3) { if (this.currentLineIndex >= this.offset && this.currentLineIndex < this.endLine) { const fragment = data.slice(startPos); if (this.truncateOnByteLimit && this.maxBytes !== undefined) { - const sep26 = this.selectedLines.length > 0 ? 1 : 0; - const fragBytes = this.selectedBytes + sep26 + Buffer.byteLength(fragment); + const sep23 = this.selectedLines.length > 0 ? 1 : 0; + const fragBytes = this.selectedBytes + sep23 + Buffer.byteLength(fragment); if (fragBytes > this.maxBytes) { this.truncatedByBytes = true; this.endLine = this.currentLineIndex; @@ -533551,8 +457162,8 @@ function streamOnEnd() { } if (this.currentLineIndex >= this.offset && this.currentLineIndex < this.endLine) { if (this.truncateOnByteLimit && this.maxBytes !== undefined) { - const sep26 = this.selectedLines.length > 0 ? 1 : 0; - const nextBytes = this.selectedBytes + sep26 + Buffer.byteLength(line); + const sep23 = this.selectedLines.length > 0 ? 1 : 0; + const nextBytes = this.selectedBytes + sep23 + Buffer.byteLength(line); if (nextBytes > this.maxBytes) { this.truncatedByBytes = true; } else { @@ -533579,7 +457190,7 @@ function streamOnEnd() { }); } function readFileInRangeStreaming(filePath, offset, maxLines, maxBytes, truncateOnByteLimit, signal) { - return new Promise((resolve36, reject3) => { + return new Promise((resolve30, reject2) => { const state = { stream: createReadStream2(filePath, { encoding: "utf8", @@ -533590,7 +457201,7 @@ function readFileInRangeStreaming(filePath, offset, maxLines, maxBytes, truncate endLine: maxLines !== undefined ? offset + maxLines : Infinity, maxBytes, truncateOnByteLimit, - resolve: resolve36, + resolve: resolve30, totalBytesRead: 0, selectedBytes: 0, truncatedByBytes: false, @@ -533607,7 +457218,7 @@ function readFileInRangeStreaming(filePath, offset, maxLines, maxBytes, truncate state.stream.once("open", streamOnOpen.bind(state)); state.stream.on("data", streamOnData.bind(state)); state.stream.once("end", streamOnEnd.bind(state)); - state.stream.once("error", reject3); + state.stream.once("error", reject2); }); } var FAST_PATH_MAX_SIZE, FileTooLargeError; @@ -533822,13 +457433,13 @@ var init_memoryTypes = __esm(() => { // src/memdir/memoryScan.ts import { readdir as readdir19 } from "fs/promises"; -import { basename as basename28, join as join102 } from "path"; +import { basename as basename26, join as join92 } from "path"; async function scanMemoryFiles(memoryDir, signal) { try { const entries = await readdir19(memoryDir, { recursive: true }); - const mdFiles = entries.filter((f) => f.endsWith(".md") && basename28(f) !== "MEMORY.md"); + const mdFiles = entries.filter((f) => f.endsWith(".md") && basename26(f) !== "MEMORY.md"); const headerResults = await Promise.allSettled(mdFiles.map(async (relativePath) => { - const filePath = join102(memoryDir, relativePath); + const filePath = join92(memoryDir, relativePath); const { content, mtimeMs } = await readFileInRange(filePath, 0, FRONTMATTER_MAX_LINES, undefined, signal); const { frontmatter } = parseFrontmatter(content, filePath); return { @@ -533961,7 +457572,7 @@ function buildExtractCombinedPrompt(newMessageCount, existingMemories, skipIndex ].join(` `); } -var init_prompts2 = __esm(() => { +var init_prompts = __esm(() => { init_bun_bundle(); init_memoryTypes(); init_prompt3(); @@ -533977,7 +457588,7 @@ __export(exports_extractMemories, { drainPendingExtraction: () => drainPendingExtraction, createAutoMemCanUseTool: () => createAutoMemCanUseTool }); -import { basename as basename29 } from "path"; +import { basename as basename27 } from "path"; function isModelVisibleMessage(message) { return message.type === "user" || message.type === "assistant"; } @@ -534040,24 +457651,24 @@ function denyAutoMemTool(tool, reason) { }; } function createAutoMemCanUseTool(memoryDir) { - return async (tool, input11) => { + return async (tool, input) => { if (tool.name === REPL_TOOL_NAME) { - return { behavior: "allow", updatedInput: input11 }; + return { behavior: "allow", updatedInput: input }; } if (tool.name === FILE_READ_TOOL_NAME || tool.name === GREP_TOOL_NAME || tool.name === GLOB_TOOL_NAME) { - return { behavior: "allow", updatedInput: input11 }; + return { behavior: "allow", updatedInput: input }; } if (tool.name === BASH_TOOL_NAME) { - const parsed = tool.inputSchema.safeParse(input11); + const parsed = tool.inputSchema.safeParse(input); if (parsed.success && tool.isReadOnly(parsed.data)) { - return { behavior: "allow", updatedInput: input11 }; + return { behavior: "allow", updatedInput: input }; } return denyAutoMemTool(tool, "Only read-only shell commands are permitted in this context (ls, find, grep, cat, stat, wc, head, tail, and similar)"); } - if ((tool.name === FILE_EDIT_TOOL_NAME || tool.name === FILE_WRITE_TOOL_NAME) && "file_path" in input11) { - const filePath = input11.file_path; + if ((tool.name === FILE_EDIT_TOOL_NAME || tool.name === FILE_WRITE_TOOL_NAME) && "file_path" in input) { + const filePath = input.file_path; if (typeof filePath === "string" && isAutoMemPath(filePath)) { - return { behavior: "allow", updatedInput: input11 }; + return { behavior: "allow", updatedInput: input }; } } return denyAutoMemTool(tool, `only ${FILE_READ_TOOL_NAME}, ${GREP_TOOL_NAME}, ${GLOB_TOOL_NAME}, read-only ${BASH_TOOL_NAME}, and ${FILE_EDIT_TOOL_NAME}/${FILE_WRITE_TOOL_NAME} within ${memoryDir} are allowed`); @@ -534067,9 +457678,9 @@ function getWrittenFilePath(block2) { if (block2.type !== "tool_use" || block2.name !== FILE_EDIT_TOOL_NAME && block2.name !== FILE_WRITE_TOOL_NAME) { return; } - const input11 = block2.input; - if (typeof input11 === "object" && input11 !== null && "file_path" in input11) { - const fp = input11.file_path; + const input = block2.input; + if (typeof input === "object" && input !== null && "file_path" in input) { + const fp = input.file_path; return typeof fp === "string" ? fp : undefined; } return; @@ -534136,7 +457747,7 @@ function initExtractMemories() { logForDebugging(`[extractMemories] starting — ${newMessageCount} new messages, memoryDir=${memoryDir}`); const existingMemories = formatMemoryManifest(await scanMemoryFiles(memoryDir, createAbortController().signal)); const userPrompt = feature("TEAMMEM") && teamMemoryEnabled ? buildExtractCombinedPrompt(newMessageCount, existingMemories, skipIndex) : buildExtractAutoOnlyPrompt(newMessageCount, existingMemories, skipIndex); - const result3 = await runForkedAgent({ + const result2 = await runForkedAgent({ promptMessages: [createUserMessage({ content: userPrompt })], cacheSafeParams, canUseTool, @@ -534149,23 +457760,23 @@ function initExtractMemories() { if (lastMessage?.uuid) { lastMemoryMessageUuid = lastMessage.uuid; } - const writtenPaths = extractWrittenPaths(result3.messages); - const turnCount = count2(result3.messages, (m) => m.type === "assistant"); - const totalInput = result3.totalUsage.input_tokens + result3.totalUsage.cache_creation_input_tokens + result3.totalUsage.cache_read_input_tokens; - const hitPct = totalInput > 0 ? (result3.totalUsage.cache_read_input_tokens / totalInput * 100).toFixed(1) : "0.0"; - logForDebugging(`[extractMemories] finished — ${writtenPaths.length} files written, cache: read=${result3.totalUsage.cache_read_input_tokens} create=${result3.totalUsage.cache_creation_input_tokens} input=${result3.totalUsage.input_tokens} (${hitPct}% hit)`); + const writtenPaths = extractWrittenPaths(result2.messages); + const turnCount = count2(result2.messages, (m) => m.type === "assistant"); + const totalInput = result2.totalUsage.input_tokens + result2.totalUsage.cache_creation_input_tokens + result2.totalUsage.cache_read_input_tokens; + const hitPct = totalInput > 0 ? (result2.totalUsage.cache_read_input_tokens / totalInput * 100).toFixed(1) : "0.0"; + logForDebugging(`[extractMemories] finished — ${writtenPaths.length} files written, cache: read=${result2.totalUsage.cache_read_input_tokens} create=${result2.totalUsage.cache_creation_input_tokens} input=${result2.totalUsage.input_tokens} (${hitPct}% hit)`); if (writtenPaths.length > 0) { logForDebugging(`[extractMemories] memories saved: ${writtenPaths.join(", ")}`); } else { logForDebugging("[extractMemories] no memories saved this run"); } - const memoryPaths = writtenPaths.filter((p) => basename29(p) !== ENTRYPOINT_NAME); + const memoryPaths = writtenPaths.filter((p) => basename27(p) !== ENTRYPOINT_NAME); const teamCount = feature("TEAMMEM") ? count2(memoryPaths, teamMemPaths5.isTeamMemPath) : 0; logEvent("tengu_extract_memories_extraction", { - input_tokens: result3.totalUsage.input_tokens, - output_tokens: result3.totalUsage.output_tokens, - cache_read_input_tokens: result3.totalUsage.cache_read_input_tokens, - cache_creation_input_tokens: result3.totalUsage.cache_creation_input_tokens, + input_tokens: result2.totalUsage.input_tokens, + output_tokens: result2.totalUsage.output_tokens, + cache_read_input_tokens: result2.totalUsage.cache_read_input_tokens, + cache_creation_input_tokens: result2.totalUsage.cache_creation_input_tokens, message_count: newMessageCount, turn_count: turnCount, files_written: writtenPaths.length, @@ -534181,8 +457792,8 @@ function initExtractMemories() { } appendSystemMessage?.(msg); } - } catch (error45) { - logForDebugging(`[extractMemories] error: ${error45}`); + } catch (error41) { + logForDebugging(`[extractMemories] error: ${error41}`); logEvent("tengu_extract_memories_error", { duration_ms: Date.now() - startTime }); @@ -534259,15 +457870,15 @@ var init_extractMemories = __esm(() => { init_prompt3(); init_prompt4(); init_prompt2(); - init_constants6(); + init_constants5(); init_abortController(); init_debug(); init_forkedAgent(); - init_messages5(); + init_messages3(); init_growthbook(); init_analytics(); init_metadata(); - init_prompts2(); + init_prompts(); teamMemPaths5 = feature("TEAMMEM") ? (init_teamMemPaths(), __toCommonJS(exports_teamMemPaths)) : null; }); @@ -534333,7 +457944,7 @@ var init_consolidationPrompt = __esm(() => { }); // src/services/autoDream/autoDream.ts -function getConfig4() { +function getConfig3() { const raw = getFeatureValue_CACHED_MAY_BE_STALE("tengu_onyx_plover", null); return { minHours: typeof raw?.minHours === "number" && Number.isFinite(raw.minHours) && raw.minHours > 0 ? raw.minHours : DEFAULTS.minHours, @@ -534355,7 +457966,7 @@ function isForced() { function initAutoDream() { let lastSessionScanAt = 0; runner = async function runAutoDream(context, appendSystemMessage) { - const cfg = getConfig4(); + const cfg = getConfig3(); const force = isForced(); if (!force && !isGateOpen()) return; @@ -534424,7 +458035,7 @@ Sessions since last consolidation (${sessionIds.length}): ${sessionIds.map((id) => `- ${id}`).join(` `)}`; const prompt = buildConsolidationPrompt(memoryRoot, transcriptDir, extra); - const result3 = await runForkedAgent({ + const result2 = await runForkedAgent({ promptMessages: [createUserMessage({ content: prompt })], cacheSafeParams: createCacheSafeParams(context), canUseTool: createAutoMemCanUseTool(memoryRoot), @@ -534442,11 +458053,11 @@ ${sessionIds.map((id) => `- ${id}`).join(` verb: "Improved" }); } - logForDebugging(`[autoDream] completed — cache: read=${result3.totalUsage.cache_read_input_tokens} created=${result3.totalUsage.cache_creation_input_tokens}`); + logForDebugging(`[autoDream] completed — cache: read=${result2.totalUsage.cache_read_input_tokens} created=${result2.totalUsage.cache_creation_input_tokens}`); logEvent("tengu_auto_dream_completed", { - cache_read: result3.totalUsage.cache_read_input_tokens, - cache_created: result3.totalUsage.cache_creation_input_tokens, - output: result3.totalUsage.output_tokens, + cache_read: result2.totalUsage.cache_read_input_tokens, + cache_created: result2.totalUsage.cache_creation_input_tokens, + output: result2.totalUsage.output_tokens, sessions_reviewed: sessionIds.length }); } catch (e) { @@ -534465,23 +458076,23 @@ function makeDreamProgressWatcher(taskId, setAppState) { return (msg) => { if (msg.type !== "assistant") return; - let text2 = ""; + let text = ""; let toolUseCount = 0; const touchedPaths = []; for (const block2 of msg.message.content) { if (block2.type === "text") { - text2 += block2.text; + text += block2.text; } else if (block2.type === "tool_use") { toolUseCount++; if (block2.name === FILE_EDIT_TOOL_NAME || block2.name === FILE_WRITE_TOOL_NAME) { - const input11 = block2.input; - if (typeof input11.file_path === "string") { - touchedPaths.push(input11.file_path); + const input = block2.input; + if (typeof input.file_path === "string") { + touchedPaths.push(input.file_path); } } } } - addDreamTurn(taskId, { text: text2.trim(), toolUseCount }, touchedPaths, setAppState); + addDreamTurn(taskId, { text: text.trim(), toolUseCount }, touchedPaths, setAppState); }; } async function executeAutoDream(context, appendSystemMessage) { @@ -534490,7 +458101,7 @@ async function executeAutoDream(context, appendSystemMessage) { var SESSION_SCAN_INTERVAL_MS, DEFAULTS, runner = null; var init_autoDream = __esm(() => { init_forkedAgent(); - init_messages5(); + init_messages3(); init_debug(); init_analytics(); init_growthbook(); @@ -534522,29 +458133,29 @@ var init_classifier = __esm(() => { // src/utils/withResolvers.ts function withResolvers() { - let resolve36; - let reject3; + let resolve30; + let reject2; const promise3 = new Promise((res, rej) => { - resolve36 = res; - reject3 = rej; + resolve30 = res; + reject2 = rej; }); - return { promise: promise3, resolve: resolve36, reject: reject3 }; + return { promise: promise3, resolve: resolve30, reject: reject2 }; } // src/utils/computerUse/computerUseLock.ts -import { mkdir as mkdir28, readFile as readFile32, unlink as unlink15, writeFile as writeFile30 } from "fs/promises"; -import { join as join103 } from "path"; +import { mkdir as mkdir28, readFile as readFile31, unlink as unlink15, writeFile as writeFile28 } from "fs/promises"; +import { join as join93 } from "path"; function isComputerUseLock(value) { if (typeof value !== "object" || value === null) return false; return "sessionId" in value && typeof value.sessionId === "string" && "pid" in value && typeof value.pid === "number"; } function getLockPath() { - return join103(getClaudeConfigHomeDir(), LOCK_FILENAME); + return join93(getClaudeConfigHomeDir(), LOCK_FILENAME); } async function readLock() { try { - const raw = await readFile32(getLockPath(), "utf8"); + const raw = await readFile31(getLockPath(), "utf8"); const parsed = jsonParse(raw); return isComputerUseLock(parsed) ? parsed : undefined; } catch { @@ -534561,7 +458172,7 @@ function isProcessRunning4(pid) { } async function tryCreateExclusive(lock2) { try { - await writeFile30(getLockPath(), jsonStringify(lock2), { flag: "wx" }); + await writeFile28(getLockPath(), jsonStringify(lock2), { flag: "wx" }); return true; } catch (e) { if (getErrnoCode(e) === "EEXIST") @@ -534654,11 +458265,11 @@ var init_computerUseLock = __esm(() => { // ../node_modules/@ant/computer-use-swift/js/index.js var require_js = __commonJS((exports, module) => { var __dirname = "/Users/chenqg/Downloads/node_modules/@ant/computer-use-swift/js"; - var path21 = __require("path"); + var path16 = __require("path"); if (process.platform !== "darwin") { throw new Error("@ant/computer-use-swift is only available on macOS"); } - var native = __require(process.env.COMPUTER_USE_SWIFT_NODE_PATH ?? path21.resolve(__dirname, "../prebuilds/computer_use.node")); + var native = __require(process.env.COMPUTER_USE_SWIFT_NODE_PATH ?? path16.resolve(__dirname, "../prebuilds/computer_use.node")); module.exports = native.computerUse; }); @@ -534691,8 +458302,8 @@ function release() { pending = 0; } } -function timeoutReject(reject3) { - reject3(new Error(`computer-use native call exceeded ${TIMEOUT_MS}ms`)); +function timeoutReject(reject2) { + reject2(new Error(`computer-use native call exceeded ${TIMEOUT_MS}ms`)); } async function drainRunLoop(fn) { retain(); @@ -534753,7 +458364,7 @@ var init_escHotkey = __esm(() => { // ../node_modules/@ant/computer-use-mcp/src/types.ts var DEFAULT_GRANT_FLAGS; -var init_types13 = __esm(() => { +var init_types11 = __esm(() => { DEFAULT_GRANT_FLAGS = { clipboardRead: false, clipboardWrite: false, @@ -535130,27 +458741,27 @@ var init_deniedApps = __esm(() => { function partitionKeys(seq) { const parts = seq.toLowerCase().split("+").map((p) => p.trim()).filter(Boolean); const mods = []; - const keys3 = []; + const keys2 = []; for (const p of parts) { const canonical = CANONICAL_MODIFIER[p]; if (canonical !== undefined) { mods.push(canonical); } else { - keys3.push(p); + keys2.push(p); } } const uniqueMods = [...new Set(mods)]; uniqueMods.sort((a2, b) => MODIFIER_ORDER.indexOf(a2) - MODIFIER_ORDER.indexOf(b)); - return { mods: uniqueMods, keys: keys3 }; + return { mods: uniqueMods, keys: keys2 }; } function isSystemKeyCombo(seq, platform4) { const blocklist = platform4 === "darwin" ? BLOCKED_DARWIN : BLOCKED_WIN32; - const { mods, keys: keys3 } = partitionKeys(seq); + const { mods, keys: keys2 } = partitionKeys(seq); const prefix = mods.length > 0 ? mods.join("+") + "+" : ""; - if (keys3.length === 0) { + if (keys2.length === 0) { return blocklist.has(mods.join("+")); } - for (const key of keys3) { + for (const key of keys2) { if (blocklist.has(prefix + key)) { return true; } @@ -535288,8 +458899,8 @@ async function validateClickTarget(crop, lastScreenshot, xPercent, yPercent, tak skipped: false, warning: "Screen content at the target location changed since the last screenshot. Take a new screenshot before clicking." }; - } catch (err3) { - logger.debug("[pixelCompare] validation error, skipping", err3); + } catch (err2) { + logger.debug("[pixelCompare] validation error, skipping", err2); return { valid: true, skipped: true }; } } @@ -535297,15 +458908,15 @@ var DEFAULT_GRID_SIZE = 9; // ../node_modules/@ant/computer-use-mcp/src/toolCalls.ts import { randomUUID as randomUUID20 } from "node:crypto"; -function errorResult(text2, errorKind) { +function errorResult(text, errorKind) { return { - content: [{ type: "text", text: text2 }], + content: [{ type: "text", text }], isError: true, telemetry: errorKind ? { error_kind: errorKind } : undefined }; } -function okText(text2) { - return { content: [{ type: "text", text: text2 }] }; +function okText(text) { + return { content: [{ type: "text", text }] }; } function okJson(obj, telemetry) { return { @@ -535334,11 +458945,11 @@ function extractCoordinate(args, paramName = "coordinate") { if (!Array.isArray(coord) || coord.length !== 2) { return new Error(`${paramName} must be an array of length 2`); } - const [x4, y2] = coord; - if (typeof x4 !== "number" || typeof y2 !== "number" || x4 < 0 || y2 < 0) { + const [x3, y2] = coord; + if (typeof x3 !== "number" || typeof y2 !== "number" || x3 < 0 || y2 < 0) { return new Error(`${paramName} must be a tuple of non-negative numbers`); } - return [x4, y2]; + return [x3, y2]; } function scaleCoord(rawX, rawY, mode, display, lastScreenshot, logger) { if (mode === "normalized_0_100") { @@ -535442,8 +459053,8 @@ async function runInputActionGates(adapter2, overrides, subGates, actionKind) { } return errorResult(`"${frontmost.displayName}" is not in the allowed applications and is ` + `currently in front. Take a new screenshot — it may have appeared ` + `since your last one.`, "app_not_granted"); } -async function runHitTestGate(adapter2, overrides, subGates, x4, y2, actionKind) { - const target = await adapter2.executor.appUnderPoint(x4, y2); +async function runHitTestGate(adapter2, overrides, subGates, x3, y2, actionKind) { + const target = await adapter2.executor.appUnderPoint(x3, y2); if (!target) return null; if (target.bundleId === FINDER_BUNDLE_ID) @@ -535464,9 +459075,9 @@ async function runHitTestGate(adapter2, overrides, subGates, x4, y2, actionKind) const isBrowser2 = getDeniedCategoryForApp(target.bundleId, target.displayName) === "browser"; return errorResult(`Click at these coordinates would land on "${target.displayName}", ` + `which is granted at tier "read" (screenshots only, no interaction). ` + (isBrowser2 ? "Use the Claude-in-Chrome MCP for browser interaction." : "Ask the user to take any actions in this app themselves.") + TIER_ANTI_SUBVERSION, "tier_insufficient"); } -function decodedByteLength(base644) { - const padding = base644.endsWith("==") ? 2 : base644.endsWith("=") ? 1 : 0; - return Math.floor(base644.length * 3 / 4) - padding; +function decodedByteLength(base643) { + const padding = base643.endsWith("==") ? 2 : base643.endsWith("=") ? 1 : 0; + return Math.floor(base643.length * 3 / 4) - padding; } async function takeScreenshotWithRetry(executor, allowedBundleIds, logger, displayId) { let shot = await executor.screenshot({ allowedBundleIds, displayId }); @@ -535476,21 +459087,21 @@ async function takeScreenshotWithRetry(executor, allowedBundleIds, logger, displ } return shot; } -function segmentGraphemes2(text2) { +function segmentGraphemes2(text) { try { const Segmenter = Intl.Segmenter; if (typeof Segmenter === "function") { const seg = new Segmenter(undefined, { granularity: "grapheme" }); - return Array.from(seg.segment(text2), (s) => s.segment); + return Array.from(seg.segment(text), (s) => s.segment); } } catch {} - return Array.from(text2); + return Array.from(text); } -function sleep5(ms) { +function sleep3(ms) { return new Promise((r) => setTimeout(r, ms)); } -function parseKeyChord(text2) { - return text2.split("+").map((s) => s.trim()).filter(Boolean); +function parseKeyChord(text) { + return text.split("+").map((s) => s.trim()).filter(Boolean); } function resetMouseButtonHeld() { mouseButtonHeld = false; @@ -535715,13 +459326,13 @@ async function buildAccessRequest(adapter2, apps, allowedApps, userDeniedBundleI r.resolved.iconDataUrl = await adapter2.executor.getAppIcon(r.resolved.path); } catch {} } - const now3 = Date.now(); + const now2 = Date.now(); const skipDialogGrants = skipDialog.filter((r) => r.resolved).map((r) => { const existing = allowedApps.find((g) => g.bundleId === r.resolved.bundleId); return existing ?? { bundleId: r.resolved.bundleId, displayName: r.resolved.displayName, - grantedAt: now3, + grantedAt: now2, tier: r.proposedTier }; }); @@ -535900,16 +459511,16 @@ async function validateTeachStepArgs(raw, adapter2, overrides, label) { if (!Array.isArray(actions)) { return new Error(`${label}: "actions" must be an array (empty is allowed).`); } - for (const [i4, act] of actions.entries()) { + for (const [i3, act] of actions.entries()) { if (typeof act !== "object" || act === null) { - return new Error(`${label}: actions[${i4}] must be an object`); + return new Error(`${label}: actions[${i3}] must be an object`); } const action = act.action; if (typeof action !== "string") { - return new Error(`${label}: actions[${i4}].action must be a string`); + return new Error(`${label}: actions[${i3}].action must be a string`); } if (!BATCHABLE_ACTIONS.has(action)) { - return new Error(`${label}: actions[${i4}].action="${action}" is not allowed. ` + `Allowed: ${[...BATCHABLE_ACTIONS].join(", ")}.`); + return new Error(`${label}: actions[${i3}].action="${action}" is not allowed. ` + `Allowed: ${[...BATCHABLE_ACTIONS].join(", ")}.`); } } let anchorLogical; @@ -535955,24 +459566,24 @@ async function executeTeachStep(step, adapter2, overrides, subGates) { autoTargetDisplay: false }; const results = []; - for (const [i4, act] of step.actions.entries()) { + for (const [i3, act] of step.actions.entries()) { if (overrides.isAborted?.()) { await releaseHeldMouse(adapter2); return { kind: "exit" }; } - if (i4 > 0) - await sleep5(10); + if (i3 > 0) + await sleep3(10); const action = act.action; const { screenshot: _dropped, ...inner } = await dispatchAction(action, act, adapter2, overrides, stepSubGates); - const text2 = firstTextContent(inner); - const result3 = { action, ok: !inner.isError, output: text2 }; - results.push(result3); + const text = firstTextContent(inner); + const result2 = { action, ok: !inner.isError, output: text }; + results.push(result2); if (inner.isError) { await releaseHeldMouse(adapter2); return { kind: "action_error", executed: results.length - 1, - failed: result3, + failed: result2, remaining: step.actions.length - results.length, telemetry: inner.telemetry }; @@ -536025,25 +459636,25 @@ async function handleTeachBatch(adapter2, args, overrides, subGates) { return errorResult('"steps" must be a non-empty array.', "bad_args"); } const steps = []; - for (const [i4, raw] of rawSteps.entries()) { + for (const [i3, raw] of rawSteps.entries()) { if (typeof raw !== "object" || raw === null) { - return errorResult(`steps[${i4}] must be an object`, "bad_args"); + return errorResult(`steps[${i3}] must be an object`, "bad_args"); } - const v = await validateTeachStepArgs(raw, adapter2, overrides, `steps[${i4}]`); + const v = await validateTeachStepArgs(raw, adapter2, overrides, `steps[${i3}]`); if (v instanceof Error) return errorResult(v.message, "bad_args"); steps.push(v); } const allResults = []; - for (const [i4, step] of steps.entries()) { + for (const [i3, step] of steps.entries()) { const outcome = await executeTeachStep(step, adapter2, overrides, subGates); if (outcome.kind === "exit") { - return okJson({ exited: true, stepsCompleted: i4 }); + return okJson({ exited: true, stepsCompleted: i3 }); } if (outcome.kind === "action_error") { return okJson({ - stepsCompleted: i4, - stepFailed: i4, + stepsCompleted: i3, + stepFailed: i3, executed: outcome.executed, failed: outcome.failed, remaining: outcome.remaining, @@ -536115,42 +459726,42 @@ async function handleScreenshot(adapter2, overrides, subGates) { const currentAppSetKey = allowedBundleIds2.slice().sort().join(","); const appSetChanged = currentAppSetKey !== overrides.displayResolvedForApps; const autoResolve = !overrides.displayPinnedByModel && appSetChanged; - const result3 = await adapter2.executor.resolvePrepareCapture({ + const result2 = await adapter2.executor.resolvePrepareCapture({ allowedBundleIds: allowedBundleIds2, preferredDisplayId: overrides.selectedDisplayId, autoResolve, doHide: subGates.hideBeforeAction }); - if (result3.captureError === undefined && decodedByteLength(result3.base64) < MIN_SCREENSHOT_BYTES) { - adapter2.logger.warn(`[computer-use] resolvePrepareCapture result implausibly small (${decodedByteLength(result3.base64)} bytes decoded) — possible transient display state`); + if (result2.captureError === undefined && decodedByteLength(result2.base64) < MIN_SCREENSHOT_BYTES) { + adapter2.logger.warn(`[computer-use] resolvePrepareCapture result implausibly small (${decodedByteLength(result2.base64)} bytes decoded) — possible transient display state`); } - if (result3.displayId !== overrides.selectedDisplayId) { - adapter2.logger.debug(`[computer-use] resolver: preferred=${overrides.selectedDisplayId} resolved=${result3.displayId}`); - overrides.onResolvedDisplayUpdated?.(result3.displayId); + if (result2.displayId !== overrides.selectedDisplayId) { + adapter2.logger.debug(`[computer-use] resolver: preferred=${overrides.selectedDisplayId} resolved=${result2.displayId}`); + overrides.onResolvedDisplayUpdated?.(result2.displayId); } if (autoResolve) { overrides.onDisplayResolvedForApps?.(currentAppSetKey); } let hiddenSinceLastSeen2 = []; if (overrides.lastScreenshot !== undefined) { - hiddenSinceLastSeen2 = result3.hidden; + hiddenSinceLastSeen2 = result2.hidden; } - if (result3.hidden.length > 0) { - overrides.onAppsHidden?.(result3.hidden); + if (result2.hidden.length > 0) { + overrides.onAppsHidden?.(result2.hidden); } - if (result3.captureError !== undefined) { - return errorResult(result3.captureError, "capture_failed"); + if (result2.captureError !== undefined) { + return errorResult(result2.captureError, "capture_failed"); } const hiddenNote2 = await buildHiddenNote(adapter2, hiddenSinceLastSeen2); const shot2 = { - base64: result3.base64, - width: result3.width, - height: result3.height, - displayWidth: result3.displayWidth, - displayHeight: result3.displayHeight, - displayId: result3.displayId, - originX: result3.originX, - originY: result3.originY + base64: result2.base64, + width: result2.width, + height: result2.height, + displayWidth: result2.displayWidth, + displayHeight: result2.displayHeight, + displayId: result2.displayId, + originX: result2.originX, + originY: result2.originY }; const monitorNote2 = await buildMonitorNote(adapter2, shot2.displayId, overrides.lastScreenshot?.displayId, overrides.onDisplayPinned !== undefined); return { @@ -536206,15 +459817,15 @@ async function handleZoom(adapter2, args, overrides) { return errorResult("region x1 must be greater than x0", "bad_args"); if (y1 <= y0) return errorResult("region y1 must be greater than y0", "bad_args"); - const last3 = overrides.lastScreenshot; - if (!last3) { + const last2 = overrides.lastScreenshot; + if (!last2) { return errorResult("take a screenshot before zooming (region coords are relative to it)", "state_conflict"); } - if (x1 > last3.width || y1 > last3.height) { - return errorResult(`region exceeds screenshot bounds (${last3.width}×${last3.height})`, "bad_args"); + if (x1 > last2.width || y1 > last2.height) { + return errorResult(`region exceeds screenshot bounds (${last2.width}×${last2.height})`, "bad_args"); } - const ratioX = last3.displayWidth / last3.width; - const ratioY = last3.displayHeight / last3.height; + const ratioX = last2.displayWidth / last2.width; + const ratioY = last2.displayHeight / last2.height; const regionLogical = { x: x0 * ratioX, y: y0 * ratioY, @@ -536222,7 +459833,7 @@ async function handleZoom(adapter2, args, overrides) { h: (y1 - y0) * ratioY }; const allowedIds = overrides.allowedApps.map((g) => g.bundleId); - const zoomed = await adapter2.executor.zoom(regionLogical, allowedIds, last3.displayId); + const zoomed = await adapter2.executor.zoom(regionLogical, allowedIds, last2.displayId); return { content: [{ type: "image", data: zoomed.base64, mimeType: "image/jpeg" }] }; @@ -536269,32 +459880,32 @@ async function handleClickVariant(adapter2, args, overrides, subGates, button, c return okText(validation.warning); } } - const { x: x4, y: y2 } = scaleCoord(rawX, rawY, overrides.coordinateMode, display, overrides.lastScreenshot, adapter2.logger); - const hitGate = await runHitTestGate(adapter2, overrides, subGates, x4, y2, clickActionKind); + const { x: x3, y: y2 } = scaleCoord(rawX, rawY, overrides.coordinateMode, display, overrides.lastScreenshot, adapter2.logger); + const hitGate = await runHitTestGate(adapter2, overrides, subGates, x3, y2, clickActionKind); if (hitGate) return hitGate; - await adapter2.executor.click(x4, y2, button, count3, modifiers); + await adapter2.executor.click(x3, y2, button, count3, modifiers); return okText("Clicked."); } async function handleType(adapter2, args, overrides, subGates) { - const text2 = requireString(args, "text"); - if (text2 instanceof Error) - return errorResult(text2.message, "bad_args"); + const text = requireString(args, "text"); + if (text instanceof Error) + return errorResult(text.message, "bad_args"); const gate = await runInputActionGates(adapter2, overrides, subGates, "keyboard"); if (gate) return gate; - const viaClipboard = text2.includes(` + const viaClipboard = text.includes(` `) && overrides.grantFlags.clipboardWrite && subGates.clipboardPasteMultiline; if (viaClipboard) { - await adapter2.executor.type(text2, { viaClipboard: true }); + await adapter2.executor.type(text, { viaClipboard: true }); return okText("Typed (via clipboard)."); } - const graphemes = segmentGraphemes2(text2); - for (const [i4, g] of graphemes.entries()) { + const graphemes = segmentGraphemes2(text); + for (const [i3, g] of graphemes.entries()) { if (overrides.isAborted?.()) { - return errorResult(`Typing aborted after ${i4} of ${graphemes.length} graphemes (user interrupt).`); + return errorResult(`Typing aborted after ${i3} of ${graphemes.length} graphemes (user interrupt).`); } - await sleep5(INTER_GRAPHEME_SLEEP_MS); + await sleep3(INTER_GRAPHEME_SLEEP_MS); if (g === ` ` || g === "\r" || g === `\r `) { @@ -536311,7 +459922,7 @@ async function handleKey(adapter2, args, overrides, subGates) { const keySequence = requireString(args, "text"); if (keySequence instanceof Error) return errorResult("text is required", "bad_args"); - let repeat4; + let repeat3; if (args.repeat !== undefined) { if (typeof args.repeat !== "number" || !Number.isInteger(args.repeat) || args.repeat < 1) { return errorResult("repeat must be a positive integer", "bad_args"); @@ -536319,7 +459930,7 @@ async function handleKey(adapter2, args, overrides, subGates) { if (args.repeat > 100) { return errorResult("repeat exceeds maximum of 100", "bad_args"); } - repeat4 = args.repeat; + repeat3 = args.repeat; } if (isSystemKeyCombo(keySequence, adapter2.executor.capabilities.platform) && !overrides.grantFlags.systemKeyCombos) { return errorResult(`"${keySequence}" is a system-level shortcut. Request the \`systemKeyCombos\` grant via request_access to use it.`, "grant_flag_required"); @@ -536327,7 +459938,7 @@ async function handleKey(adapter2, args, overrides, subGates) { const gate = await runInputActionGates(adapter2, overrides, subGates, "keyboard"); if (gate) return gate; - await adapter2.executor.key(keySequence, repeat4); + await adapter2.executor.key(keySequence, repeat3); return okText("Key pressed."); } async function handleScroll(adapter2, args, overrides, subGates) { @@ -536352,13 +459963,13 @@ async function handleScroll(adapter2, args, overrides, subGates) { if (gate) return gate; const display = await adapter2.executor.getDisplaySize(overrides.selectedDisplayId); - const { x: x4, y: y2 } = scaleCoord(rawX, rawY, overrides.coordinateMode, display, overrides.lastScreenshot, adapter2.logger); - const hitGate = await runHitTestGate(adapter2, overrides, subGates, x4, y2, mouseButtonHeld ? "mouse_full" : "mouse"); + const { x: x3, y: y2 } = scaleCoord(rawX, rawY, overrides.coordinateMode, display, overrides.lastScreenshot, adapter2.logger); + const hitGate = await runHitTestGate(adapter2, overrides, subGates, x3, y2, mouseButtonHeld ? "mouse_full" : "mouse"); if (hitGate) return hitGate; if (mouseButtonHeld) mouseMoved = true; - await adapter2.executor.scroll(x4, y2, dx, dy); + await adapter2.executor.scroll(x3, y2, dx, dy); return okText("Scrolled."); } async function handleDrag(adapter2, args, overrides, subGates) { @@ -536404,13 +460015,13 @@ async function handleMoveMouse(adapter2, args, overrides, subGates) { if (gate) return gate; const display = await adapter2.executor.getDisplaySize(overrides.selectedDisplayId); - const { x: x4, y: y2 } = scaleCoord(rawX, rawY, overrides.coordinateMode, display, overrides.lastScreenshot, adapter2.logger); + const { x: x3, y: y2 } = scaleCoord(rawX, rawY, overrides.coordinateMode, display, overrides.lastScreenshot, adapter2.logger); if (mouseButtonHeld) { - const hitGate = await runHitTestGate(adapter2, overrides, subGates, x4, y2, "mouse_full"); + const hitGate = await runHitTestGate(adapter2, overrides, subGates, x3, y2, "mouse_full"); if (hitGate) return hitGate; } - await adapter2.executor.moveMouse(x4, y2); + await adapter2.executor.moveMouse(x3, y2); if (mouseButtonHeld) mouseMoved = true; return okText("Moved."); @@ -536488,16 +460099,16 @@ async function handleReadClipboard(adapter2, overrides, subGates) { const frontmostTier = frontmost ? tierByBundleId.get(frontmost.bundleId) : undefined; await syncClipboardStash(adapter2, overrides, frontmostTier === "click"); } - const text2 = await adapter2.executor.readClipboard(); - return okJson({ text: text2 }); + const text = await adapter2.executor.readClipboard(); + return okJson({ text }); } async function handleWriteClipboard(adapter2, args, overrides, subGates) { if (!overrides.grantFlags.clipboardWrite) { return errorResult("Clipboard write is not granted. Request `clipboardWrite` via request_access.", "grant_flag_required"); } - const text2 = requireString(args, "text"); - if (text2 instanceof Error) - return errorResult(text2.message, "bad_args"); + const text = requireString(args, "text"); + if (text instanceof Error) + return errorResult(text.message, "bad_args"); if (subGates.clipboardGuard) { const frontmost = await adapter2.executor.getFrontmostApp(); const tierByBundleId = new Map(overrides.allowedApps.map((a2) => [a2.bundleId, a2.tier])); @@ -536507,7 +460118,7 @@ async function handleWriteClipboard(adapter2, args, overrides, subGates) { } await syncClipboardStash(adapter2, overrides, frontmostTier === "click"); } - await adapter2.executor.writeClipboard(text2); + await adapter2.executor.writeClipboard(text); return okText("Clipboard written."); } async function handleWait(args) { @@ -536521,7 +460132,7 @@ async function handleWait(args) { if (duration3 > 100) { return errorResult("duration is too long. Duration is in seconds.", "bad_args"); } - await sleep5(duration3 * 1000); + await sleep3(duration3 * 1000); return okText(`Waited ${duration3}s.`); } async function handleCursorPosition(adapter2, overrides) { @@ -536538,9 +460149,9 @@ async function handleCursorPosition(adapter2, overrides) { note: "cursor is on a different monitor than your last screenshot; take a fresh screenshot" }); } - const x4 = Math.round(localX * (shot.width / shot.displayWidth)); + const x3 = Math.round(localX * (shot.width / shot.displayWidth)); const y2 = Math.round(localY * (shot.height / shot.displayHeight)); - return okJson({ x: x4, y: y2, coordinateSpace: "image_pixels" }); + return okJson({ x: x3, y: y2, coordinateSpace: "image_pixels" }); } return okJson({ x: logical.x, @@ -536550,9 +460161,9 @@ async function handleCursorPosition(adapter2, overrides) { }); } async function handleHoldKey(adapter2, args, overrides, subGates) { - const text2 = requireString(args, "text"); - if (text2 instanceof Error) - return errorResult(text2.message, "bad_args"); + const text = requireString(args, "text"); + if (text instanceof Error) + return errorResult(text.message, "bad_args"); const duration3 = args.duration; if (typeof duration3 !== "number" || !Number.isFinite(duration3)) { return errorResult("duration must be a number", "bad_args"); @@ -536563,13 +460174,13 @@ async function handleHoldKey(adapter2, args, overrides, subGates) { if (duration3 > 100) { return errorResult("duration is too long. Duration is in seconds.", "bad_args"); } - if (isSystemKeyCombo(text2, adapter2.executor.capabilities.platform) && !overrides.grantFlags.systemKeyCombos) { - return errorResult(`"${text2}" is a system-level shortcut. Request the \`systemKeyCombos\` grant via request_access to use it.`, "grant_flag_required"); + if (isSystemKeyCombo(text, adapter2.executor.capabilities.platform) && !overrides.grantFlags.systemKeyCombos) { + return errorResult(`"${text}" is a system-level shortcut. Request the \`systemKeyCombos\` grant via request_access to use it.`, "grant_flag_required"); } const gate = await runInputActionGates(adapter2, overrides, subGates, "keyboard"); if (gate) return gate; - const keyNames = parseKeyChord(text2); + const keyNames = parseKeyChord(text); await adapter2.executor.holdKey(keyNames, duration3 * 1000); return okText("Key held."); } @@ -536590,11 +460201,11 @@ async function handleLeftMouseDown(adapter2, overrides, subGates) { return okText("Mouse button pressed."); } async function handleLeftMouseUp(adapter2, overrides, subGates) { - const releaseFirst = async (err3) => { + const releaseFirst = async (err2) => { await adapter2.executor.mouseUp(); mouseButtonHeld = false; mouseMoved = false; - return err3; + return err2; }; const gate = await runInputActionGates(adapter2, overrides, subGates, "mouse"); if (gate) @@ -536613,16 +460224,16 @@ async function handleComputerBatch(adapter2, args, overrides, subGates) { if (!Array.isArray(actions) || actions.length === 0) { return errorResult("actions must be a non-empty array", "bad_args"); } - for (const [i4, act] of actions.entries()) { + for (const [i3, act] of actions.entries()) { if (typeof act !== "object" || act === null) { - return errorResult(`actions[${i4}] must be an object`, "bad_args"); + return errorResult(`actions[${i3}] must be an object`, "bad_args"); } const action = act.action; if (typeof action !== "string") { - return errorResult(`actions[${i4}].action must be a string`, "bad_args"); + return errorResult(`actions[${i3}].action must be a string`, "bad_args"); } if (!BATCHABLE_ACTIONS.has(action)) { - return errorResult(`actions[${i4}].action="${action}" is not allowed in a batch. ` + `Allowed: ${[...BATCHABLE_ACTIONS].join(", ")}.`, "bad_args"); + return errorResult(`actions[${i3}].action="${action}" is not allowed in a batch. ` + `Allowed: ${[...BATCHABLE_ACTIONS].join(", ")}.`, "bad_args"); } } if (subGates.hideBeforeAction) { @@ -536638,24 +460249,24 @@ async function handleComputerBatch(adapter2, args, overrides, subGates) { autoTargetDisplay: false }; const results = []; - for (const [i4, act] of actions.entries()) { + for (const [i3, act] of actions.entries()) { if (overrides.isAborted?.()) { await releaseHeldMouse(adapter2); return errorResult(`Batch aborted after ${results.length} of ${actions.length} actions (user interrupt).`); } - if (i4 > 0) - await sleep5(10); + if (i3 > 0) + await sleep3(10); const actionArgs = act; const action = actionArgs.action; const { screenshot: _dropped, ...inner } = await dispatchAction(action, actionArgs, adapter2, overrides, batchSubGates); - const text2 = firstTextContent(inner); - const result3 = { action, ok: !inner.isError, output: text2 }; - results.push(result3); + const text = firstTextContent(inner); + const result2 = { action, ok: !inner.isError, output: text }; + results.push(result2); if (inner.isError) { await releaseHeldMouse(adapter2); return okJson({ completed: results.slice(0, -1), - failed: result3, + failed: result2, remaining: actions.length - results.length }, inner.telemetry); } @@ -536767,9 +460378,9 @@ async function handleToolCall(adapter2, name, args, rawOverrides) { return await handleTeachBatch(adapter2, a2, overrides, subGates); } return await dispatchAction(name, a2, adapter2, overrides, subGates); - } catch (err3) { - const msg = err3 instanceof Error ? err3.message : String(err3); - logger.error(`[${serverName}] tool=${name} threw: ${msg}`, err3); + } catch (err2) { + const msg = err2 instanceof Error ? err2.message : String(err2); + logger.error(`[${serverName}] tool=${name} threw: ${msg}`, err2); return errorResult(`Tool "${name}" failed: ${msg}`, "executor_threw"); } } @@ -536800,6 +460411,3809 @@ var init_toolCalls = __esm(() => { ]); }); +// ../node_modules/zod/v3/helpers/util.js +var util5, objectUtil2, ZodParsedType2, getParsedType3 = (data) => { + const t = typeof data; + switch (t) { + case "undefined": + return ZodParsedType2.undefined; + case "string": + return ZodParsedType2.string; + case "number": + return Number.isNaN(data) ? ZodParsedType2.nan : ZodParsedType2.number; + case "boolean": + return ZodParsedType2.boolean; + case "function": + return ZodParsedType2.function; + case "bigint": + return ZodParsedType2.bigint; + case "symbol": + return ZodParsedType2.symbol; + case "object": + if (Array.isArray(data)) { + return ZodParsedType2.array; + } + if (data === null) { + return ZodParsedType2.null; + } + if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { + return ZodParsedType2.promise; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return ZodParsedType2.map; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return ZodParsedType2.set; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return ZodParsedType2.date; + } + return ZodParsedType2.object; + default: + return ZodParsedType2.unknown; + } +}; +var init_util5 = __esm(() => { + (function(util6) { + util6.assertEqual = (_) => {}; + function assertIs2(_arg) {} + util6.assertIs = assertIs2; + function assertNever2(_x) { + throw new Error; + } + util6.assertNever = assertNever2; + util6.arrayToEnum = (items) => { + const obj = {}; + for (const item of items) { + obj[item] = item; + } + return obj; + }; + util6.getValidEnumValues = (obj) => { + const validKeys = util6.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); + const filtered = {}; + for (const k of validKeys) { + filtered[k] = obj[k]; + } + return util6.objectValues(filtered); + }; + util6.objectValues = (obj) => { + return util6.objectKeys(obj).map(function(e) { + return obj[e]; + }); + }; + util6.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object4) => { + const keys2 = []; + for (const key in object4) { + if (Object.prototype.hasOwnProperty.call(object4, key)) { + keys2.push(key); + } + } + return keys2; + }; + util6.find = (arr, checker) => { + for (const item of arr) { + if (checker(item)) + return item; + } + return; + }; + util6.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; + function joinValues2(array3, separator = " | ") { + return array3.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); + } + util6.joinValues = joinValues2; + util6.jsonStringifyReplacer = (_, value) => { + if (typeof value === "bigint") { + return value.toString(); + } + return value; + }; + })(util5 || (util5 = {})); + (function(objectUtil3) { + objectUtil3.mergeShapes = (first, second) => { + return { + ...first, + ...second + }; + }; + })(objectUtil2 || (objectUtil2 = {})); + ZodParsedType2 = util5.arrayToEnum([ + "string", + "nan", + "number", + "integer", + "float", + "boolean", + "date", + "bigint", + "symbol", + "function", + "undefined", + "null", + "array", + "object", + "unknown", + "promise", + "void", + "never", + "map", + "set" + ]); +}); + +// ../node_modules/zod/v3/ZodError.js +var ZodIssueCode3, ZodError4; +var init_ZodError2 = __esm(() => { + init_util5(); + ZodIssueCode3 = util5.arrayToEnum([ + "invalid_type", + "invalid_literal", + "custom", + "invalid_union", + "invalid_union_discriminator", + "invalid_enum_value", + "unrecognized_keys", + "invalid_arguments", + "invalid_return_type", + "invalid_date", + "invalid_string", + "too_small", + "too_big", + "invalid_intersection_types", + "not_multiple_of", + "not_finite" + ]); + ZodError4 = class ZodError4 extends Error { + get errors() { + return this.issues; + } + constructor(issues) { + super(); + this.issues = []; + this.addIssue = (sub) => { + this.issues = [...this.issues, sub]; + }; + this.addIssues = (subs = []) => { + this.issues = [...this.issues, ...subs]; + }; + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(this, actualProto); + } else { + this.__proto__ = actualProto; + } + this.name = "ZodError"; + this.issues = issues; + } + format(_mapper) { + const mapper = _mapper || function(issue2) { + return issue2.message; + }; + const fieldErrors = { _errors: [] }; + const processError = (error41) => { + for (const issue2 of error41.issues) { + if (issue2.code === "invalid_union") { + issue2.unionErrors.map(processError); + } else if (issue2.code === "invalid_return_type") { + processError(issue2.returnTypeError); + } else if (issue2.code === "invalid_arguments") { + processError(issue2.argumentsError); + } else if (issue2.path.length === 0) { + fieldErrors._errors.push(mapper(issue2)); + } else { + let curr = fieldErrors; + let i3 = 0; + while (i3 < issue2.path.length) { + const el = issue2.path[i3]; + const terminal = i3 === issue2.path.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + } else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue2)); + } + curr = curr[el]; + i3++; + } + } + } + }; + processError(this); + return fieldErrors; + } + static assert(value) { + if (!(value instanceof ZodError4)) { + throw new Error(`Not a ZodError: ${value}`); + } + } + toString() { + return this.message; + } + get message() { + return JSON.stringify(this.issues, util5.jsonStringifyReplacer, 2); + } + get isEmpty() { + return this.issues.length === 0; + } + flatten(mapper = (issue2) => issue2.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of this.issues) { + if (sub.path.length > 0) { + const firstEl = sub.path[0]; + fieldErrors[firstEl] = fieldErrors[firstEl] || []; + fieldErrors[firstEl].push(mapper(sub)); + } else { + formErrors.push(mapper(sub)); + } + } + return { formErrors, fieldErrors }; + } + get formErrors() { + return this.flatten(); + } + }; + ZodError4.create = (issues) => { + const error41 = new ZodError4(issues); + return error41; + }; +}); + +// ../node_modules/zod/v3/locales/en.js +var errorMap2 = (issue2, _ctx) => { + let message; + switch (issue2.code) { + case ZodIssueCode3.invalid_type: + if (issue2.received === ZodParsedType2.undefined) { + message = "Required"; + } else { + message = `Expected ${issue2.expected}, received ${issue2.received}`; + } + break; + case ZodIssueCode3.invalid_literal: + message = `Invalid literal value, expected ${JSON.stringify(issue2.expected, util5.jsonStringifyReplacer)}`; + break; + case ZodIssueCode3.unrecognized_keys: + message = `Unrecognized key(s) in object: ${util5.joinValues(issue2.keys, ", ")}`; + break; + case ZodIssueCode3.invalid_union: + message = `Invalid input`; + break; + case ZodIssueCode3.invalid_union_discriminator: + message = `Invalid discriminator value. Expected ${util5.joinValues(issue2.options)}`; + break; + case ZodIssueCode3.invalid_enum_value: + message = `Invalid enum value. Expected ${util5.joinValues(issue2.options)}, received '${issue2.received}'`; + break; + case ZodIssueCode3.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodIssueCode3.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodIssueCode3.invalid_date: + message = `Invalid date`; + break; + case ZodIssueCode3.invalid_string: + if (typeof issue2.validation === "object") { + if ("includes" in issue2.validation) { + message = `Invalid input: must include "${issue2.validation.includes}"`; + if (typeof issue2.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue2.validation.position}`; + } + } else if ("startsWith" in issue2.validation) { + message = `Invalid input: must start with "${issue2.validation.startsWith}"`; + } else if ("endsWith" in issue2.validation) { + message = `Invalid input: must end with "${issue2.validation.endsWith}"`; + } else { + util5.assertNever(issue2.validation); + } + } else if (issue2.validation !== "regex") { + message = `Invalid ${issue2.validation}`; + } else { + message = "Invalid"; + } + break; + case ZodIssueCode3.too_small: + if (issue2.type === "array") + message = `Array must contain ${issue2.exact ? "exactly" : issue2.inclusive ? `at least` : `more than`} ${issue2.minimum} element(s)`; + else if (issue2.type === "string") + message = `String must contain ${issue2.exact ? "exactly" : issue2.inclusive ? `at least` : `over`} ${issue2.minimum} character(s)`; + else if (issue2.type === "number") + message = `Number must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${issue2.minimum}`; + else if (issue2.type === "bigint") + message = `Number must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${issue2.minimum}`; + else if (issue2.type === "date") + message = `Date must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue2.minimum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode3.too_big: + if (issue2.type === "array") + message = `Array must contain ${issue2.exact ? `exactly` : issue2.inclusive ? `at most` : `less than`} ${issue2.maximum} element(s)`; + else if (issue2.type === "string") + message = `String must contain ${issue2.exact ? `exactly` : issue2.inclusive ? `at most` : `under`} ${issue2.maximum} character(s)`; + else if (issue2.type === "number") + message = `Number must be ${issue2.exact ? `exactly` : issue2.inclusive ? `less than or equal to` : `less than`} ${issue2.maximum}`; + else if (issue2.type === "bigint") + message = `BigInt must be ${issue2.exact ? `exactly` : issue2.inclusive ? `less than or equal to` : `less than`} ${issue2.maximum}`; + else if (issue2.type === "date") + message = `Date must be ${issue2.exact ? `exactly` : issue2.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue2.maximum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode3.custom: + message = `Invalid input`; + break; + case ZodIssueCode3.invalid_intersection_types: + message = `Intersection results could not be merged`; + break; + case ZodIssueCode3.not_multiple_of: + message = `Number must be a multiple of ${issue2.multipleOf}`; + break; + case ZodIssueCode3.not_finite: + message = "Number must be finite"; + break; + default: + message = _ctx.defaultError; + util5.assertNever(issue2); + } + return { message }; +}, en_default3; +var init_en3 = __esm(() => { + init_ZodError2(); + init_util5(); + en_default3 = errorMap2; +}); + +// ../node_modules/zod/v3/errors.js +function getErrorMap3() { + return overrideErrorMap2; +} +var overrideErrorMap2; +var init_errors7 = __esm(() => { + init_en3(); + overrideErrorMap2 = en_default3; +}); + +// ../node_modules/zod/v3/helpers/parseUtil.js +function addIssueToContext2(ctx, issueData) { + const overrideMap = getErrorMap3(); + const issue2 = makeIssue2({ + issueData, + data: ctx.data, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + overrideMap, + overrideMap === en_default3 ? undefined : en_default3 + ].filter((x3) => !!x3) + }); + ctx.common.issues.push(issue2); +} + +class ParseStatus2 { + constructor() { + this.value = "valid"; + } + dirty() { + if (this.value === "valid") + this.value = "dirty"; + } + abort() { + if (this.value !== "aborted") + this.value = "aborted"; + } + static mergeArray(status, results) { + const arrayValue = []; + for (const s of results) { + if (s.status === "aborted") + return INVALID2; + if (s.status === "dirty") + status.dirty(); + arrayValue.push(s.value); + } + return { status: status.value, value: arrayValue }; + } + static async mergeObjectAsync(status, pairs) { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + syncPairs.push({ + key, + value + }); + } + return ParseStatus2.mergeObjectSync(status, syncPairs); + } + static mergeObjectSync(status, pairs) { + const finalObject = {}; + for (const pair of pairs) { + const { key, value } = pair; + if (key.status === "aborted") + return INVALID2; + if (value.status === "aborted") + return INVALID2; + if (key.status === "dirty") + status.dirty(); + if (value.status === "dirty") + status.dirty(); + if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { + finalObject[key.value] = value.value; + } + } + return { status: status.value, value: finalObject }; + } +} +var makeIssue2 = (params) => { + const { data, path: path16, errorMaps, issueData } = params; + const fullPath = [...path16, ...issueData.path || []]; + const fullIssue = { + ...issueData, + path: fullPath + }; + if (issueData.message !== undefined) { + return { + ...issueData, + path: fullPath, + message: issueData.message + }; + } + let errorMessage2 = ""; + const maps = errorMaps.filter((m) => !!m).slice().reverse(); + for (const map4 of maps) { + errorMessage2 = map4(fullIssue, { data, defaultError: errorMessage2 }).message; + } + return { + ...issueData, + path: fullPath, + message: errorMessage2 + }; +}, INVALID2, DIRTY2 = (value) => ({ status: "dirty", value }), OK2 = (value) => ({ status: "valid", value }), isAborted2 = (x3) => x3.status === "aborted", isDirty2 = (x3) => x3.status === "dirty", isValid2 = (x3) => x3.status === "valid", isAsync2 = (x3) => typeof Promise !== "undefined" && x3 instanceof Promise; +var init_parseUtil2 = __esm(() => { + init_errors7(); + init_en3(); + INVALID2 = Object.freeze({ + status: "aborted" + }); +}); + +// ../node_modules/zod/v3/helpers/typeAliases.js +var init_typeAliases2 = () => {}; + +// ../node_modules/zod/v3/helpers/errorUtil.js +var errorUtil2; +var init_errorUtil2 = __esm(() => { + (function(errorUtil3) { + errorUtil3.errToObj = (message) => typeof message === "string" ? { message } : message || {}; + errorUtil3.toString = (message) => typeof message === "string" ? message : message?.message; + })(errorUtil2 || (errorUtil2 = {})); +}); + +// ../node_modules/zod/v3/types.js +class ParseInputLazyPath2 { + constructor(parent2, value, path16, key) { + this._cachedPath = []; + this.parent = parent2; + this.data = value; + this._path = path16; + this._key = key; + } + get path() { + if (!this._cachedPath.length) { + if (Array.isArray(this._key)) { + this._cachedPath.push(...this._path, ...this._key); + } else { + this._cachedPath.push(...this._path, this._key); + } + } + return this._cachedPath; + } +} +function processCreateParams2(params) { + if (!params) + return {}; + const { errorMap: errorMap3, invalid_type_error, required_error, description } = params; + if (errorMap3 && (invalid_type_error || required_error)) { + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + } + if (errorMap3) + return { errorMap: errorMap3, description }; + const customMap = (iss, ctx) => { + const { message } = params; + if (iss.code === "invalid_enum_value") { + return { message: message ?? ctx.defaultError }; + } + if (typeof ctx.data === "undefined") { + return { message: message ?? required_error ?? ctx.defaultError }; + } + if (iss.code !== "invalid_type") + return { message: ctx.defaultError }; + return { message: message ?? invalid_type_error ?? ctx.defaultError }; + }; + return { errorMap: customMap, description }; +} + +class ZodType3 { + get description() { + return this._def.description; + } + _getType(input) { + return getParsedType3(input.data); + } + _getOrReturnCtx(input, ctx) { + return ctx || { + common: input.parent.common, + data: input.data, + parsedType: getParsedType3(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent + }; + } + _processInputParams(input) { + return { + status: new ParseStatus2, + ctx: { + common: input.parent.common, + data: input.data, + parsedType: getParsedType3(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent + } + }; + } + _parseSync(input) { + const result2 = this._parse(input); + if (isAsync2(result2)) { + throw new Error("Synchronous parse encountered promise."); + } + return result2; + } + _parseAsync(input) { + const result2 = this._parse(input); + return Promise.resolve(result2); + } + parse(data, params) { + const result2 = this.safeParse(data, params); + if (result2.success) + return result2.data; + throw result2.error; + } + safeParse(data, params) { + const ctx = { + common: { + issues: [], + async: params?.async ?? false, + contextualErrorMap: params?.errorMap + }, + path: params?.path || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType3(data) + }; + const result2 = this._parseSync({ data, path: ctx.path, parent: ctx }); + return handleResult3(ctx, result2); + } + "~validate"(data) { + const ctx = { + common: { + issues: [], + async: !!this["~standard"].async + }, + path: [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType3(data) + }; + if (!this["~standard"].async) { + try { + const result2 = this._parseSync({ data, path: [], parent: ctx }); + return isValid2(result2) ? { + value: result2.value + } : { + issues: ctx.common.issues + }; + } catch (err2) { + if (err2?.message?.toLowerCase()?.includes("encountered")) { + this["~standard"].async = true; + } + ctx.common = { + issues: [], + async: true + }; + } + } + return this._parseAsync({ data, path: [], parent: ctx }).then((result2) => isValid2(result2) ? { + value: result2.value + } : { + issues: ctx.common.issues + }); + } + async parseAsync(data, params) { + const result2 = await this.safeParseAsync(data, params); + if (result2.success) + return result2.data; + throw result2.error; + } + async safeParseAsync(data, params) { + const ctx = { + common: { + issues: [], + contextualErrorMap: params?.errorMap, + async: true + }, + path: params?.path || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType3(data) + }; + const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); + const result2 = await (isAsync2(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); + return handleResult3(ctx, result2); + } + refine(check3, message) { + const getIssueProperties = (val) => { + if (typeof message === "string" || typeof message === "undefined") { + return { message }; + } else if (typeof message === "function") { + return message(val); + } else { + return message; + } + }; + return this._refinement((val, ctx) => { + const result2 = check3(val); + const setError = () => ctx.addIssue({ + code: ZodIssueCode3.custom, + ...getIssueProperties(val) + }); + if (typeof Promise !== "undefined" && result2 instanceof Promise) { + return result2.then((data) => { + if (!data) { + setError(); + return false; + } else { + return true; + } + }); + } + if (!result2) { + setError(); + return false; + } else { + return true; + } + }); + } + refinement(check3, refinementData) { + return this._refinement((val, ctx) => { + if (!check3(val)) { + ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); + return false; + } else { + return true; + } + }); + } + _refinement(refinement) { + return new ZodEffects2({ + schema: this, + typeName: ZodFirstPartyTypeKind2.ZodEffects, + effect: { type: "refinement", refinement } + }); + } + superRefine(refinement) { + return this._refinement(refinement); + } + constructor(def2) { + this.spa = this.safeParseAsync; + this._def = def2; + this.parse = this.parse.bind(this); + this.safeParse = this.safeParse.bind(this); + this.parseAsync = this.parseAsync.bind(this); + this.safeParseAsync = this.safeParseAsync.bind(this); + this.spa = this.spa.bind(this); + this.refine = this.refine.bind(this); + this.refinement = this.refinement.bind(this); + this.superRefine = this.superRefine.bind(this); + this.optional = this.optional.bind(this); + this.nullable = this.nullable.bind(this); + this.nullish = this.nullish.bind(this); + this.array = this.array.bind(this); + this.promise = this.promise.bind(this); + this.or = this.or.bind(this); + this.and = this.and.bind(this); + this.transform = this.transform.bind(this); + this.brand = this.brand.bind(this); + this.default = this.default.bind(this); + this.catch = this.catch.bind(this); + this.describe = this.describe.bind(this); + this.pipe = this.pipe.bind(this); + this.readonly = this.readonly.bind(this); + this.isNullable = this.isNullable.bind(this); + this.isOptional = this.isOptional.bind(this); + this["~standard"] = { + version: 1, + vendor: "zod", + validate: (data) => this["~validate"](data) + }; + } + optional() { + return ZodOptional3.create(this, this._def); + } + nullable() { + return ZodNullable3.create(this, this._def); + } + nullish() { + return this.nullable().optional(); + } + array() { + return ZodArray3.create(this); + } + promise() { + return ZodPromise3.create(this, this._def); + } + or(option) { + return ZodUnion3.create([this, option], this._def); + } + and(incoming) { + return ZodIntersection3.create(this, incoming, this._def); + } + transform(transform3) { + return new ZodEffects2({ + ...processCreateParams2(this._def), + schema: this, + typeName: ZodFirstPartyTypeKind2.ZodEffects, + effect: { type: "transform", transform: transform3 } + }); + } + default(def2) { + const defaultValueFunc = typeof def2 === "function" ? def2 : () => def2; + return new ZodDefault3({ + ...processCreateParams2(this._def), + innerType: this, + defaultValue: defaultValueFunc, + typeName: ZodFirstPartyTypeKind2.ZodDefault + }); + } + brand() { + return new ZodBranded2({ + typeName: ZodFirstPartyTypeKind2.ZodBranded, + type: this, + ...processCreateParams2(this._def) + }); + } + catch(def2) { + const catchValueFunc = typeof def2 === "function" ? def2 : () => def2; + return new ZodCatch3({ + ...processCreateParams2(this._def), + innerType: this, + catchValue: catchValueFunc, + typeName: ZodFirstPartyTypeKind2.ZodCatch + }); + } + describe(description) { + const This = this.constructor; + return new This({ + ...this._def, + description + }); + } + pipe(target) { + return ZodPipeline2.create(this, target); + } + readonly() { + return ZodReadonly3.create(this); + } + isOptional() { + return this.safeParse(undefined).success; + } + isNullable() { + return this.safeParse(null).success; + } +} +function timeRegexSource2(args) { + let secondsRegexSource = `[0-5]\\d`; + if (args.precision) { + secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`; + } else if (args.precision == null) { + secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; + } + const secondsQuantifier = args.precision ? "+" : "?"; + return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; +} +function timeRegex2(args) { + return new RegExp(`^${timeRegexSource2(args)}$`); +} +function datetimeRegex2(args) { + let regex2 = `${dateRegexSource2}T${timeRegexSource2(args)}`; + const opts = []; + opts.push(args.local ? `Z?` : `Z`); + if (args.offset) + opts.push(`([+-]\\d{2}:?\\d{2})`); + regex2 = `${regex2}(${opts.join("|")})`; + return new RegExp(`^${regex2}$`); +} +function isValidIP2(ip, version2) { + if ((version2 === "v4" || !version2) && ipv4Regex2.test(ip)) { + return true; + } + if ((version2 === "v6" || !version2) && ipv6Regex2.test(ip)) { + return true; + } + return false; +} +function isValidJWT3(jwt2, alg) { + if (!jwtRegex2.test(jwt2)) + return false; + try { + const [header] = jwt2.split("."); + if (!header) + return false; + const base643 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); + const decoded = JSON.parse(atob(base643)); + if (typeof decoded !== "object" || decoded === null) + return false; + if ("typ" in decoded && decoded?.typ !== "JWT") + return false; + if (!decoded.alg) + return false; + if (alg && decoded.alg !== alg) + return false; + return true; + } catch { + return false; + } +} +function isValidCidr2(ip, version2) { + if ((version2 === "v4" || !version2) && ipv4CidrRegex2.test(ip)) { + return true; + } + if ((version2 === "v6" || !version2) && ipv6CidrRegex2.test(ip)) { + return true; + } + return false; +} +function floatSafeRemainder3(val, step) { + const valDecCount = (val.toString().split(".")[1] || "").length; + const stepDecCount = (step.toString().split(".")[1] || "").length; + const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; + const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); + const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); + return valInt % stepInt / 10 ** decCount; +} +function deepPartialify2(schema) { + if (schema instanceof ZodObject3) { + const newShape = {}; + for (const key in schema.shape) { + const fieldSchema = schema.shape[key]; + newShape[key] = ZodOptional3.create(deepPartialify2(fieldSchema)); + } + return new ZodObject3({ + ...schema._def, + shape: () => newShape + }); + } else if (schema instanceof ZodArray3) { + return new ZodArray3({ + ...schema._def, + type: deepPartialify2(schema.element) + }); + } else if (schema instanceof ZodOptional3) { + return ZodOptional3.create(deepPartialify2(schema.unwrap())); + } else if (schema instanceof ZodNullable3) { + return ZodNullable3.create(deepPartialify2(schema.unwrap())); + } else if (schema instanceof ZodTuple3) { + return ZodTuple3.create(schema.items.map((item) => deepPartialify2(item))); + } else { + return schema; + } +} +function mergeValues3(a2, b) { + const aType = getParsedType3(a2); + const bType = getParsedType3(b); + if (a2 === b) { + return { valid: true, data: a2 }; + } else if (aType === ZodParsedType2.object && bType === ZodParsedType2.object) { + const bKeys = util5.objectKeys(b); + const sharedKeys = util5.objectKeys(a2).filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a2, ...b }; + for (const key of sharedKeys) { + const sharedValue = mergeValues3(a2[key], b[key]); + if (!sharedValue.valid) { + return { valid: false }; + } + newObj[key] = sharedValue.data; + } + return { valid: true, data: newObj }; + } else if (aType === ZodParsedType2.array && bType === ZodParsedType2.array) { + if (a2.length !== b.length) { + return { valid: false }; + } + const newArray = []; + for (let index = 0;index < a2.length; index++) { + const itemA = a2[index]; + const itemB = b[index]; + const sharedValue = mergeValues3(itemA, itemB); + if (!sharedValue.valid) { + return { valid: false }; + } + newArray.push(sharedValue.data); + } + return { valid: true, data: newArray }; + } else if (aType === ZodParsedType2.date && bType === ZodParsedType2.date && +a2 === +b) { + return { valid: true, data: a2 }; + } else { + return { valid: false }; + } +} +function createZodEnum2(values2, params) { + return new ZodEnum3({ + values: values2, + typeName: ZodFirstPartyTypeKind2.ZodEnum, + ...processCreateParams2(params) + }); +} +var handleResult3 = (ctx, result2) => { + if (isValid2(result2)) { + return { success: true, data: result2.value }; + } else { + if (!ctx.common.issues.length) { + throw new Error("Validation failed but no issues detected."); + } + return { + success: false, + get error() { + if (this._error) + return this._error; + const error41 = new ZodError4(ctx.common.issues); + this._error = error41; + return this._error; + } + }; + } +}, cuidRegex2, cuid2Regex2, ulidRegex2, uuidRegex4, nanoidRegex2, jwtRegex2, durationRegex2, emailRegex2, _emojiRegex2 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, emojiRegex3, ipv4Regex2, ipv4CidrRegex2, ipv6Regex2, ipv6CidrRegex2, base64Regex2, base64urlRegex2, dateRegexSource2 = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`, dateRegex2, ZodString3, ZodNumber3, ZodBigInt3, ZodBoolean3, ZodDate3, ZodSymbol3, ZodUndefined3, ZodNull3, ZodAny3, ZodUnknown3, ZodNever3, ZodVoid3, ZodArray3, ZodObject3, ZodUnion3, getDiscriminator2 = (type) => { + if (type instanceof ZodLazy3) { + return getDiscriminator2(type.schema); + } else if (type instanceof ZodEffects2) { + return getDiscriminator2(type.innerType()); + } else if (type instanceof ZodLiteral3) { + return [type.value]; + } else if (type instanceof ZodEnum3) { + return type.options; + } else if (type instanceof ZodNativeEnum2) { + return util5.objectValues(type.enum); + } else if (type instanceof ZodDefault3) { + return getDiscriminator2(type._def.innerType); + } else if (type instanceof ZodUndefined3) { + return [undefined]; + } else if (type instanceof ZodNull3) { + return [null]; + } else if (type instanceof ZodOptional3) { + return [undefined, ...getDiscriminator2(type.unwrap())]; + } else if (type instanceof ZodNullable3) { + return [null, ...getDiscriminator2(type.unwrap())]; + } else if (type instanceof ZodBranded2) { + return getDiscriminator2(type.unwrap()); + } else if (type instanceof ZodReadonly3) { + return getDiscriminator2(type.unwrap()); + } else if (type instanceof ZodCatch3) { + return getDiscriminator2(type._def.innerType); + } else { + return []; + } +}, ZodDiscriminatedUnion3, ZodIntersection3, ZodTuple3, ZodRecord3, ZodMap3, ZodSet3, ZodFunction2, ZodLazy3, ZodLiteral3, ZodEnum3, ZodNativeEnum2, ZodPromise3, ZodEffects2, ZodOptional3, ZodNullable3, ZodDefault3, ZodCatch3, ZodNaN3, BRAND2, ZodBranded2, ZodPipeline2, ZodReadonly3, late2, ZodFirstPartyTypeKind2, stringType2, numberType2, nanType2, bigIntType2, booleanType2, dateType2, symbolType2, undefinedType2, nullType2, anyType2, unknownType2, neverType2, voidType2, arrayType2, objectType2, strictObjectType2, unionType2, discriminatedUnionType2, intersectionType2, tupleType2, recordType2, mapType2, setType2, functionType2, lazyType2, literalType2, enumType2, nativeEnumType2, promiseType2, effectsType2, optionalType2, nullableType2, preprocessType2, pipelineType2; +var init_types12 = __esm(() => { + init_ZodError2(); + init_errors7(); + init_errorUtil2(); + init_parseUtil2(); + init_util5(); + cuidRegex2 = /^c[^\s-]{8,}$/i; + cuid2Regex2 = /^[0-9a-z]+$/; + ulidRegex2 = /^[0-9A-HJKMNP-TV-Z]{26}$/i; + uuidRegex4 = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; + nanoidRegex2 = /^[a-z0-9_-]{21}$/i; + jwtRegex2 = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; + durationRegex2 = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; + emailRegex2 = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; + ipv4Regex2 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; + ipv4CidrRegex2 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/; + ipv6Regex2 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/; + ipv6CidrRegex2 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; + base64Regex2 = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; + base64urlRegex2 = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; + dateRegex2 = new RegExp(`^${dateRegexSource2}$`); + ZodString3 = class ZodString3 extends ZodType3 { + _parse(input) { + if (this._def.coerce) { + input.data = String(input.data); + } + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.string) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext2(ctx2, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.string, + received: ctx2.parsedType + }); + return INVALID2; + } + const status = new ParseStatus2; + let ctx = undefined; + for (const check3 of this._def.checks) { + if (check3.kind === "min") { + if (input.data.length < check3.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_small, + minimum: check3.value, + type: "string", + inclusive: true, + exact: false, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "max") { + if (input.data.length > check3.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_big, + maximum: check3.value, + type: "string", + inclusive: true, + exact: false, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "length") { + const tooBig = input.data.length > check3.value; + const tooSmall = input.data.length < check3.value; + if (tooBig || tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + if (tooBig) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_big, + maximum: check3.value, + type: "string", + inclusive: true, + exact: true, + message: check3.message + }); + } else if (tooSmall) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_small, + minimum: check3.value, + type: "string", + inclusive: true, + exact: true, + message: check3.message + }); + } + status.dirty(); + } + } else if (check3.kind === "email") { + if (!emailRegex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "email", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "emoji") { + if (!emojiRegex3) { + emojiRegex3 = new RegExp(_emojiRegex2, "u"); + } + if (!emojiRegex3.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "emoji", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "uuid") { + if (!uuidRegex4.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "uuid", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "nanoid") { + if (!nanoidRegex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "nanoid", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "cuid") { + if (!cuidRegex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "cuid", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "cuid2") { + if (!cuid2Regex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "cuid2", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "ulid") { + if (!ulidRegex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "ulid", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "url") { + try { + new URL(input.data); + } catch { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "url", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "regex") { + check3.regex.lastIndex = 0; + const testResult = check3.regex.test(input.data); + if (!testResult) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "regex", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "trim") { + input.data = input.data.trim(); + } else if (check3.kind === "includes") { + if (!input.data.includes(check3.value, check3.position)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_string, + validation: { includes: check3.value, position: check3.position }, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "toLowerCase") { + input.data = input.data.toLowerCase(); + } else if (check3.kind === "toUpperCase") { + input.data = input.data.toUpperCase(); + } else if (check3.kind === "startsWith") { + if (!input.data.startsWith(check3.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_string, + validation: { startsWith: check3.value }, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "endsWith") { + if (!input.data.endsWith(check3.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_string, + validation: { endsWith: check3.value }, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "datetime") { + const regex2 = datetimeRegex2(check3); + if (!regex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_string, + validation: "datetime", + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "date") { + const regex2 = dateRegex2; + if (!regex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_string, + validation: "date", + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "time") { + const regex2 = timeRegex2(check3); + if (!regex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_string, + validation: "time", + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "duration") { + if (!durationRegex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "duration", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "ip") { + if (!isValidIP2(input.data, check3.version)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "ip", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "jwt") { + if (!isValidJWT3(input.data, check3.alg)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "jwt", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "cidr") { + if (!isValidCidr2(input.data, check3.version)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "cidr", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "base64") { + if (!base64Regex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "base64", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "base64url") { + if (!base64urlRegex2.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + validation: "base64url", + code: ZodIssueCode3.invalid_string, + message: check3.message + }); + status.dirty(); + } + } else { + util5.assertNever(check3); + } + } + return { status: status.value, value: input.data }; + } + _regex(regex2, validation, message) { + return this.refinement((data) => regex2.test(data), { + validation, + code: ZodIssueCode3.invalid_string, + ...errorUtil2.errToObj(message) + }); + } + _addCheck(check3) { + return new ZodString3({ + ...this._def, + checks: [...this._def.checks, check3] + }); + } + email(message) { + return this._addCheck({ kind: "email", ...errorUtil2.errToObj(message) }); + } + url(message) { + return this._addCheck({ kind: "url", ...errorUtil2.errToObj(message) }); + } + emoji(message) { + return this._addCheck({ kind: "emoji", ...errorUtil2.errToObj(message) }); + } + uuid(message) { + return this._addCheck({ kind: "uuid", ...errorUtil2.errToObj(message) }); + } + nanoid(message) { + return this._addCheck({ kind: "nanoid", ...errorUtil2.errToObj(message) }); + } + cuid(message) { + return this._addCheck({ kind: "cuid", ...errorUtil2.errToObj(message) }); + } + cuid2(message) { + return this._addCheck({ kind: "cuid2", ...errorUtil2.errToObj(message) }); + } + ulid(message) { + return this._addCheck({ kind: "ulid", ...errorUtil2.errToObj(message) }); + } + base64(message) { + return this._addCheck({ kind: "base64", ...errorUtil2.errToObj(message) }); + } + base64url(message) { + return this._addCheck({ + kind: "base64url", + ...errorUtil2.errToObj(message) + }); + } + jwt(options2) { + return this._addCheck({ kind: "jwt", ...errorUtil2.errToObj(options2) }); + } + ip(options2) { + return this._addCheck({ kind: "ip", ...errorUtil2.errToObj(options2) }); + } + cidr(options2) { + return this._addCheck({ kind: "cidr", ...errorUtil2.errToObj(options2) }); + } + datetime(options2) { + if (typeof options2 === "string") { + return this._addCheck({ + kind: "datetime", + precision: null, + offset: false, + local: false, + message: options2 + }); + } + return this._addCheck({ + kind: "datetime", + precision: typeof options2?.precision === "undefined" ? null : options2?.precision, + offset: options2?.offset ?? false, + local: options2?.local ?? false, + ...errorUtil2.errToObj(options2?.message) + }); + } + date(message) { + return this._addCheck({ kind: "date", message }); + } + time(options2) { + if (typeof options2 === "string") { + return this._addCheck({ + kind: "time", + precision: null, + message: options2 + }); + } + return this._addCheck({ + kind: "time", + precision: typeof options2?.precision === "undefined" ? null : options2?.precision, + ...errorUtil2.errToObj(options2?.message) + }); + } + duration(message) { + return this._addCheck({ kind: "duration", ...errorUtil2.errToObj(message) }); + } + regex(regex2, message) { + return this._addCheck({ + kind: "regex", + regex: regex2, + ...errorUtil2.errToObj(message) + }); + } + includes(value, options2) { + return this._addCheck({ + kind: "includes", + value, + position: options2?.position, + ...errorUtil2.errToObj(options2?.message) + }); + } + startsWith(value, message) { + return this._addCheck({ + kind: "startsWith", + value, + ...errorUtil2.errToObj(message) + }); + } + endsWith(value, message) { + return this._addCheck({ + kind: "endsWith", + value, + ...errorUtil2.errToObj(message) + }); + } + min(minLength, message) { + return this._addCheck({ + kind: "min", + value: minLength, + ...errorUtil2.errToObj(message) + }); + } + max(maxLength, message) { + return this._addCheck({ + kind: "max", + value: maxLength, + ...errorUtil2.errToObj(message) + }); + } + length(len, message) { + return this._addCheck({ + kind: "length", + value: len, + ...errorUtil2.errToObj(message) + }); + } + nonempty(message) { + return this.min(1, errorUtil2.errToObj(message)); + } + trim() { + return new ZodString3({ + ...this._def, + checks: [...this._def.checks, { kind: "trim" }] + }); + } + toLowerCase() { + return new ZodString3({ + ...this._def, + checks: [...this._def.checks, { kind: "toLowerCase" }] + }); + } + toUpperCase() { + return new ZodString3({ + ...this._def, + checks: [...this._def.checks, { kind: "toUpperCase" }] + }); + } + get isDatetime() { + return !!this._def.checks.find((ch2) => ch2.kind === "datetime"); + } + get isDate() { + return !!this._def.checks.find((ch2) => ch2.kind === "date"); + } + get isTime() { + return !!this._def.checks.find((ch2) => ch2.kind === "time"); + } + get isDuration() { + return !!this._def.checks.find((ch2) => ch2.kind === "duration"); + } + get isEmail() { + return !!this._def.checks.find((ch2) => ch2.kind === "email"); + } + get isURL() { + return !!this._def.checks.find((ch2) => ch2.kind === "url"); + } + get isEmoji() { + return !!this._def.checks.find((ch2) => ch2.kind === "emoji"); + } + get isUUID() { + return !!this._def.checks.find((ch2) => ch2.kind === "uuid"); + } + get isNANOID() { + return !!this._def.checks.find((ch2) => ch2.kind === "nanoid"); + } + get isCUID() { + return !!this._def.checks.find((ch2) => ch2.kind === "cuid"); + } + get isCUID2() { + return !!this._def.checks.find((ch2) => ch2.kind === "cuid2"); + } + get isULID() { + return !!this._def.checks.find((ch2) => ch2.kind === "ulid"); + } + get isIP() { + return !!this._def.checks.find((ch2) => ch2.kind === "ip"); + } + get isCIDR() { + return !!this._def.checks.find((ch2) => ch2.kind === "cidr"); + } + get isBase64() { + return !!this._def.checks.find((ch2) => ch2.kind === "base64"); + } + get isBase64url() { + return !!this._def.checks.find((ch2) => ch2.kind === "base64url"); + } + get minLength() { + let min2 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "min") { + if (min2 === null || ch2.value > min2) + min2 = ch2.value; + } + } + return min2; + } + get maxLength() { + let max3 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "max") { + if (max3 === null || ch2.value < max3) + max3 = ch2.value; + } + } + return max3; + } + }; + ZodString3.create = (params) => { + return new ZodString3({ + checks: [], + typeName: ZodFirstPartyTypeKind2.ZodString, + coerce: params?.coerce ?? false, + ...processCreateParams2(params) + }); + }; + ZodNumber3 = class ZodNumber3 extends ZodType3 { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + this.step = this.multipleOf; + } + _parse(input) { + if (this._def.coerce) { + input.data = Number(input.data); + } + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.number) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext2(ctx2, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.number, + received: ctx2.parsedType + }); + return INVALID2; + } + let ctx = undefined; + const status = new ParseStatus2; + for (const check3 of this._def.checks) { + if (check3.kind === "int") { + if (!util5.isInteger(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: "integer", + received: "float", + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "min") { + const tooSmall = check3.inclusive ? input.data < check3.value : input.data <= check3.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_small, + minimum: check3.value, + type: "number", + inclusive: check3.inclusive, + exact: false, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "max") { + const tooBig = check3.inclusive ? input.data > check3.value : input.data >= check3.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_big, + maximum: check3.value, + type: "number", + inclusive: check3.inclusive, + exact: false, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "multipleOf") { + if (floatSafeRemainder3(input.data, check3.value) !== 0) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.not_multiple_of, + multipleOf: check3.value, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "finite") { + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.not_finite, + message: check3.message + }); + status.dirty(); + } + } else { + util5.assertNever(check3); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil2.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil2.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil2.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil2.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodNumber3({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil2.toString(message) + } + ] + }); + } + _addCheck(check3) { + return new ZodNumber3({ + ...this._def, + checks: [...this._def.checks, check3] + }); + } + int(message) { + return this._addCheck({ + kind: "int", + message: errorUtil2.toString(message) + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: false, + message: errorUtil2.toString(message) + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: false, + message: errorUtil2.toString(message) + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: true, + message: errorUtil2.toString(message) + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: true, + message: errorUtil2.toString(message) + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil2.toString(message) + }); + } + finite(message) { + return this._addCheck({ + kind: "finite", + message: errorUtil2.toString(message) + }); + } + safe(message) { + return this._addCheck({ + kind: "min", + inclusive: true, + value: Number.MIN_SAFE_INTEGER, + message: errorUtil2.toString(message) + })._addCheck({ + kind: "max", + inclusive: true, + value: Number.MAX_SAFE_INTEGER, + message: errorUtil2.toString(message) + }); + } + get minValue() { + let min2 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "min") { + if (min2 === null || ch2.value > min2) + min2 = ch2.value; + } + } + return min2; + } + get maxValue() { + let max3 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "max") { + if (max3 === null || ch2.value < max3) + max3 = ch2.value; + } + } + return max3; + } + get isInt() { + return !!this._def.checks.find((ch2) => ch2.kind === "int" || ch2.kind === "multipleOf" && util5.isInteger(ch2.value)); + } + get isFinite() { + let max3 = null; + let min2 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "finite" || ch2.kind === "int" || ch2.kind === "multipleOf") { + return true; + } else if (ch2.kind === "min") { + if (min2 === null || ch2.value > min2) + min2 = ch2.value; + } else if (ch2.kind === "max") { + if (max3 === null || ch2.value < max3) + max3 = ch2.value; + } + } + return Number.isFinite(min2) && Number.isFinite(max3); + } + }; + ZodNumber3.create = (params) => { + return new ZodNumber3({ + checks: [], + typeName: ZodFirstPartyTypeKind2.ZodNumber, + coerce: params?.coerce || false, + ...processCreateParams2(params) + }); + }; + ZodBigInt3 = class ZodBigInt3 extends ZodType3 { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + } + _parse(input) { + if (this._def.coerce) { + try { + input.data = BigInt(input.data); + } catch { + return this._getInvalidInput(input); + } + } + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.bigint) { + return this._getInvalidInput(input); + } + let ctx = undefined; + const status = new ParseStatus2; + for (const check3 of this._def.checks) { + if (check3.kind === "min") { + const tooSmall = check3.inclusive ? input.data < check3.value : input.data <= check3.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_small, + type: "bigint", + minimum: check3.value, + inclusive: check3.inclusive, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "max") { + const tooBig = check3.inclusive ? input.data > check3.value : input.data >= check3.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_big, + type: "bigint", + maximum: check3.value, + inclusive: check3.inclusive, + message: check3.message + }); + status.dirty(); + } + } else if (check3.kind === "multipleOf") { + if (input.data % check3.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.not_multiple_of, + multipleOf: check3.value, + message: check3.message + }); + status.dirty(); + } + } else { + util5.assertNever(check3); + } + } + return { status: status.value, value: input.data }; + } + _getInvalidInput(input) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.bigint, + received: ctx.parsedType + }); + return INVALID2; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil2.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil2.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil2.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil2.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodBigInt3({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil2.toString(message) + } + ] + }); + } + _addCheck(check3) { + return new ZodBigInt3({ + ...this._def, + checks: [...this._def.checks, check3] + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: false, + message: errorUtil2.toString(message) + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: false, + message: errorUtil2.toString(message) + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: true, + message: errorUtil2.toString(message) + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: true, + message: errorUtil2.toString(message) + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil2.toString(message) + }); + } + get minValue() { + let min2 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "min") { + if (min2 === null || ch2.value > min2) + min2 = ch2.value; + } + } + return min2; + } + get maxValue() { + let max3 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "max") { + if (max3 === null || ch2.value < max3) + max3 = ch2.value; + } + } + return max3; + } + }; + ZodBigInt3.create = (params) => { + return new ZodBigInt3({ + checks: [], + typeName: ZodFirstPartyTypeKind2.ZodBigInt, + coerce: params?.coerce ?? false, + ...processCreateParams2(params) + }); + }; + ZodBoolean3 = class ZodBoolean3 extends ZodType3 { + _parse(input) { + if (this._def.coerce) { + input.data = Boolean(input.data); + } + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.boolean) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.boolean, + received: ctx.parsedType + }); + return INVALID2; + } + return OK2(input.data); + } + }; + ZodBoolean3.create = (params) => { + return new ZodBoolean3({ + typeName: ZodFirstPartyTypeKind2.ZodBoolean, + coerce: params?.coerce || false, + ...processCreateParams2(params) + }); + }; + ZodDate3 = class ZodDate3 extends ZodType3 { + _parse(input) { + if (this._def.coerce) { + input.data = new Date(input.data); + } + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.date) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext2(ctx2, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.date, + received: ctx2.parsedType + }); + return INVALID2; + } + if (Number.isNaN(input.data.getTime())) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext2(ctx2, { + code: ZodIssueCode3.invalid_date + }); + return INVALID2; + } + const status = new ParseStatus2; + let ctx = undefined; + for (const check3 of this._def.checks) { + if (check3.kind === "min") { + if (input.data.getTime() < check3.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_small, + message: check3.message, + inclusive: true, + exact: false, + minimum: check3.value, + type: "date" + }); + status.dirty(); + } + } else if (check3.kind === "max") { + if (input.data.getTime() > check3.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_big, + message: check3.message, + inclusive: true, + exact: false, + maximum: check3.value, + type: "date" + }); + status.dirty(); + } + } else { + util5.assertNever(check3); + } + } + return { + status: status.value, + value: new Date(input.data.getTime()) + }; + } + _addCheck(check3) { + return new ZodDate3({ + ...this._def, + checks: [...this._def.checks, check3] + }); + } + min(minDate, message) { + return this._addCheck({ + kind: "min", + value: minDate.getTime(), + message: errorUtil2.toString(message) + }); + } + max(maxDate, message) { + return this._addCheck({ + kind: "max", + value: maxDate.getTime(), + message: errorUtil2.toString(message) + }); + } + get minDate() { + let min2 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "min") { + if (min2 === null || ch2.value > min2) + min2 = ch2.value; + } + } + return min2 != null ? new Date(min2) : null; + } + get maxDate() { + let max3 = null; + for (const ch2 of this._def.checks) { + if (ch2.kind === "max") { + if (max3 === null || ch2.value < max3) + max3 = ch2.value; + } + } + return max3 != null ? new Date(max3) : null; + } + }; + ZodDate3.create = (params) => { + return new ZodDate3({ + checks: [], + coerce: params?.coerce || false, + typeName: ZodFirstPartyTypeKind2.ZodDate, + ...processCreateParams2(params) + }); + }; + ZodSymbol3 = class ZodSymbol3 extends ZodType3 { + _parse(input) { + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.symbol) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.symbol, + received: ctx.parsedType + }); + return INVALID2; + } + return OK2(input.data); + } + }; + ZodSymbol3.create = (params) => { + return new ZodSymbol3({ + typeName: ZodFirstPartyTypeKind2.ZodSymbol, + ...processCreateParams2(params) + }); + }; + ZodUndefined3 = class ZodUndefined3 extends ZodType3 { + _parse(input) { + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.undefined, + received: ctx.parsedType + }); + return INVALID2; + } + return OK2(input.data); + } + }; + ZodUndefined3.create = (params) => { + return new ZodUndefined3({ + typeName: ZodFirstPartyTypeKind2.ZodUndefined, + ...processCreateParams2(params) + }); + }; + ZodNull3 = class ZodNull3 extends ZodType3 { + _parse(input) { + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.null) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.null, + received: ctx.parsedType + }); + return INVALID2; + } + return OK2(input.data); + } + }; + ZodNull3.create = (params) => { + return new ZodNull3({ + typeName: ZodFirstPartyTypeKind2.ZodNull, + ...processCreateParams2(params) + }); + }; + ZodAny3 = class ZodAny3 extends ZodType3 { + constructor() { + super(...arguments); + this._any = true; + } + _parse(input) { + return OK2(input.data); + } + }; + ZodAny3.create = (params) => { + return new ZodAny3({ + typeName: ZodFirstPartyTypeKind2.ZodAny, + ...processCreateParams2(params) + }); + }; + ZodUnknown3 = class ZodUnknown3 extends ZodType3 { + constructor() { + super(...arguments); + this._unknown = true; + } + _parse(input) { + return OK2(input.data); + } + }; + ZodUnknown3.create = (params) => { + return new ZodUnknown3({ + typeName: ZodFirstPartyTypeKind2.ZodUnknown, + ...processCreateParams2(params) + }); + }; + ZodNever3 = class ZodNever3 extends ZodType3 { + _parse(input) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.never, + received: ctx.parsedType + }); + return INVALID2; + } + }; + ZodNever3.create = (params) => { + return new ZodNever3({ + typeName: ZodFirstPartyTypeKind2.ZodNever, + ...processCreateParams2(params) + }); + }; + ZodVoid3 = class ZodVoid3 extends ZodType3 { + _parse(input) { + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.void, + received: ctx.parsedType + }); + return INVALID2; + } + return OK2(input.data); + } + }; + ZodVoid3.create = (params) => { + return new ZodVoid3({ + typeName: ZodFirstPartyTypeKind2.ZodVoid, + ...processCreateParams2(params) + }); + }; + ZodArray3 = class ZodArray3 extends ZodType3 { + _parse(input) { + const { ctx, status } = this._processInputParams(input); + const def2 = this._def; + if (ctx.parsedType !== ZodParsedType2.array) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.array, + received: ctx.parsedType + }); + return INVALID2; + } + if (def2.exactLength !== null) { + const tooBig = ctx.data.length > def2.exactLength.value; + const tooSmall = ctx.data.length < def2.exactLength.value; + if (tooBig || tooSmall) { + addIssueToContext2(ctx, { + code: tooBig ? ZodIssueCode3.too_big : ZodIssueCode3.too_small, + minimum: tooSmall ? def2.exactLength.value : undefined, + maximum: tooBig ? def2.exactLength.value : undefined, + type: "array", + inclusive: true, + exact: true, + message: def2.exactLength.message + }); + status.dirty(); + } + } + if (def2.minLength !== null) { + if (ctx.data.length < def2.minLength.value) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_small, + minimum: def2.minLength.value, + type: "array", + inclusive: true, + exact: false, + message: def2.minLength.message + }); + status.dirty(); + } + } + if (def2.maxLength !== null) { + if (ctx.data.length > def2.maxLength.value) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_big, + maximum: def2.maxLength.value, + type: "array", + inclusive: true, + exact: false, + message: def2.maxLength.message + }); + status.dirty(); + } + } + if (ctx.common.async) { + return Promise.all([...ctx.data].map((item, i3) => { + return def2.type._parseAsync(new ParseInputLazyPath2(ctx, item, ctx.path, i3)); + })).then((result3) => { + return ParseStatus2.mergeArray(status, result3); + }); + } + const result2 = [...ctx.data].map((item, i3) => { + return def2.type._parseSync(new ParseInputLazyPath2(ctx, item, ctx.path, i3)); + }); + return ParseStatus2.mergeArray(status, result2); + } + get element() { + return this._def.type; + } + min(minLength, message) { + return new ZodArray3({ + ...this._def, + minLength: { value: minLength, message: errorUtil2.toString(message) } + }); + } + max(maxLength, message) { + return new ZodArray3({ + ...this._def, + maxLength: { value: maxLength, message: errorUtil2.toString(message) } + }); + } + length(len, message) { + return new ZodArray3({ + ...this._def, + exactLength: { value: len, message: errorUtil2.toString(message) } + }); + } + nonempty(message) { + return this.min(1, message); + } + }; + ZodArray3.create = (schema, params) => { + return new ZodArray3({ + type: schema, + minLength: null, + maxLength: null, + exactLength: null, + typeName: ZodFirstPartyTypeKind2.ZodArray, + ...processCreateParams2(params) + }); + }; + ZodObject3 = class ZodObject3 extends ZodType3 { + constructor() { + super(...arguments); + this._cached = null; + this.nonstrict = this.passthrough; + this.augment = this.extend; + } + _getCached() { + if (this._cached !== null) + return this._cached; + const shape = this._def.shape(); + const keys2 = util5.objectKeys(shape); + this._cached = { shape, keys: keys2 }; + return this._cached; + } + _parse(input) { + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.object) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext2(ctx2, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.object, + received: ctx2.parsedType + }); + return INVALID2; + } + const { status, ctx } = this._processInputParams(input); + const { shape, keys: shapeKeys } = this._getCached(); + const extraKeys = []; + if (!(this._def.catchall instanceof ZodNever3 && this._def.unknownKeys === "strip")) { + for (const key in ctx.data) { + if (!shapeKeys.includes(key)) { + extraKeys.push(key); + } + } + } + const pairs = []; + for (const key of shapeKeys) { + const keyValidator = shape[key]; + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: keyValidator._parse(new ParseInputLazyPath2(ctx, value, ctx.path, key)), + alwaysSet: key in ctx.data + }); + } + if (this._def.catchall instanceof ZodNever3) { + const unknownKeys = this._def.unknownKeys; + if (unknownKeys === "passthrough") { + for (const key of extraKeys) { + pairs.push({ + key: { status: "valid", value: key }, + value: { status: "valid", value: ctx.data[key] } + }); + } + } else if (unknownKeys === "strict") { + if (extraKeys.length > 0) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.unrecognized_keys, + keys: extraKeys + }); + status.dirty(); + } + } else if (unknownKeys === "strip") {} else { + throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); + } + } else { + const catchall = this._def.catchall; + for (const key of extraKeys) { + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: catchall._parse(new ParseInputLazyPath2(ctx, value, ctx.path, key)), + alwaysSet: key in ctx.data + }); + } + } + if (ctx.common.async) { + return Promise.resolve().then(async () => { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + syncPairs.push({ + key, + value, + alwaysSet: pair.alwaysSet + }); + } + return syncPairs; + }).then((syncPairs) => { + return ParseStatus2.mergeObjectSync(status, syncPairs); + }); + } else { + return ParseStatus2.mergeObjectSync(status, pairs); + } + } + get shape() { + return this._def.shape(); + } + strict(message) { + errorUtil2.errToObj; + return new ZodObject3({ + ...this._def, + unknownKeys: "strict", + ...message !== undefined ? { + errorMap: (issue2, ctx) => { + const defaultError = this._def.errorMap?.(issue2, ctx).message ?? ctx.defaultError; + if (issue2.code === "unrecognized_keys") + return { + message: errorUtil2.errToObj(message).message ?? defaultError + }; + return { + message: defaultError + }; + } + } : {} + }); + } + strip() { + return new ZodObject3({ + ...this._def, + unknownKeys: "strip" + }); + } + passthrough() { + return new ZodObject3({ + ...this._def, + unknownKeys: "passthrough" + }); + } + extend(augmentation) { + return new ZodObject3({ + ...this._def, + shape: () => ({ + ...this._def.shape(), + ...augmentation + }) + }); + } + merge(merging) { + const merged = new ZodObject3({ + unknownKeys: merging._def.unknownKeys, + catchall: merging._def.catchall, + shape: () => ({ + ...this._def.shape(), + ...merging._def.shape() + }), + typeName: ZodFirstPartyTypeKind2.ZodObject + }); + return merged; + } + setKey(key, schema) { + return this.augment({ [key]: schema }); + } + catchall(index) { + return new ZodObject3({ + ...this._def, + catchall: index + }); + } + pick(mask) { + const shape = {}; + for (const key of util5.objectKeys(mask)) { + if (mask[key] && this.shape[key]) { + shape[key] = this.shape[key]; + } + } + return new ZodObject3({ + ...this._def, + shape: () => shape + }); + } + omit(mask) { + const shape = {}; + for (const key of util5.objectKeys(this.shape)) { + if (!mask[key]) { + shape[key] = this.shape[key]; + } + } + return new ZodObject3({ + ...this._def, + shape: () => shape + }); + } + deepPartial() { + return deepPartialify2(this); + } + partial(mask) { + const newShape = {}; + for (const key of util5.objectKeys(this.shape)) { + const fieldSchema = this.shape[key]; + if (mask && !mask[key]) { + newShape[key] = fieldSchema; + } else { + newShape[key] = fieldSchema.optional(); + } + } + return new ZodObject3({ + ...this._def, + shape: () => newShape + }); + } + required(mask) { + const newShape = {}; + for (const key of util5.objectKeys(this.shape)) { + if (mask && !mask[key]) { + newShape[key] = this.shape[key]; + } else { + const fieldSchema = this.shape[key]; + let newField = fieldSchema; + while (newField instanceof ZodOptional3) { + newField = newField._def.innerType; + } + newShape[key] = newField; + } + } + return new ZodObject3({ + ...this._def, + shape: () => newShape + }); + } + keyof() { + return createZodEnum2(util5.objectKeys(this.shape)); + } + }; + ZodObject3.create = (shape, params) => { + return new ZodObject3({ + shape: () => shape, + unknownKeys: "strip", + catchall: ZodNever3.create(), + typeName: ZodFirstPartyTypeKind2.ZodObject, + ...processCreateParams2(params) + }); + }; + ZodObject3.strictCreate = (shape, params) => { + return new ZodObject3({ + shape: () => shape, + unknownKeys: "strict", + catchall: ZodNever3.create(), + typeName: ZodFirstPartyTypeKind2.ZodObject, + ...processCreateParams2(params) + }); + }; + ZodObject3.lazycreate = (shape, params) => { + return new ZodObject3({ + shape, + unknownKeys: "strip", + catchall: ZodNever3.create(), + typeName: ZodFirstPartyTypeKind2.ZodObject, + ...processCreateParams2(params) + }); + }; + ZodUnion3 = class ZodUnion3 extends ZodType3 { + _parse(input) { + const { ctx } = this._processInputParams(input); + const options2 = this._def.options; + function handleResults(results) { + for (const result2 of results) { + if (result2.result.status === "valid") { + return result2.result; + } + } + for (const result2 of results) { + if (result2.result.status === "dirty") { + ctx.common.issues.push(...result2.ctx.common.issues); + return result2.result; + } + } + const unionErrors = results.map((result2) => new ZodError4(result2.ctx.common.issues)); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_union, + unionErrors + }); + return INVALID2; + } + if (ctx.common.async) { + return Promise.all(options2.map(async (option) => { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [] + }, + parent: null + }; + return { + result: await option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: childCtx + }), + ctx: childCtx + }; + })).then(handleResults); + } else { + let dirty = undefined; + const issues = []; + for (const option of options2) { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [] + }, + parent: null + }; + const result2 = option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: childCtx + }); + if (result2.status === "valid") { + return result2; + } else if (result2.status === "dirty" && !dirty) { + dirty = { result: result2, ctx: childCtx }; + } + if (childCtx.common.issues.length) { + issues.push(childCtx.common.issues); + } + } + if (dirty) { + ctx.common.issues.push(...dirty.ctx.common.issues); + return dirty.result; + } + const unionErrors = issues.map((issues2) => new ZodError4(issues2)); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_union, + unionErrors + }); + return INVALID2; + } + } + get options() { + return this._def.options; + } + }; + ZodUnion3.create = (types2, params) => { + return new ZodUnion3({ + options: types2, + typeName: ZodFirstPartyTypeKind2.ZodUnion, + ...processCreateParams2(params) + }); + }; + ZodDiscriminatedUnion3 = class ZodDiscriminatedUnion3 extends ZodType3 { + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType2.object) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.object, + received: ctx.parsedType + }); + return INVALID2; + } + const discriminator = this.discriminator; + const discriminatorValue = ctx.data[discriminator]; + const option = this.optionsMap.get(discriminatorValue); + if (!option) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_union_discriminator, + options: Array.from(this.optionsMap.keys()), + path: [discriminator] + }); + return INVALID2; + } + if (ctx.common.async) { + return option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + } else { + return option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + } + } + get discriminator() { + return this._def.discriminator; + } + get options() { + return this._def.options; + } + get optionsMap() { + return this._def.optionsMap; + } + static create(discriminator, options2, params) { + const optionsMap = new Map; + for (const type of options2) { + const discriminatorValues = getDiscriminator2(type.shape[discriminator]); + if (!discriminatorValues.length) { + throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + } + for (const value of discriminatorValues) { + if (optionsMap.has(value)) { + throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); + } + optionsMap.set(value, type); + } + } + return new ZodDiscriminatedUnion3({ + typeName: ZodFirstPartyTypeKind2.ZodDiscriminatedUnion, + discriminator, + options: options2, + optionsMap, + ...processCreateParams2(params) + }); + } + }; + ZodIntersection3 = class ZodIntersection3 extends ZodType3 { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const handleParsed = (parsedLeft, parsedRight) => { + if (isAborted2(parsedLeft) || isAborted2(parsedRight)) { + return INVALID2; + } + const merged = mergeValues3(parsedLeft.value, parsedRight.value); + if (!merged.valid) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_intersection_types + }); + return INVALID2; + } + if (isDirty2(parsedLeft) || isDirty2(parsedRight)) { + status.dirty(); + } + return { status: status.value, value: merged.data }; + }; + if (ctx.common.async) { + return Promise.all([ + this._def.left._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }), + this._def.right._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }) + ]).then(([left, right]) => handleParsed(left, right)); + } else { + return handleParsed(this._def.left._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }), this._def.right._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + })); + } + } + }; + ZodIntersection3.create = (left, right, params) => { + return new ZodIntersection3({ + left, + right, + typeName: ZodFirstPartyTypeKind2.ZodIntersection, + ...processCreateParams2(params) + }); + }; + ZodTuple3 = class ZodTuple3 extends ZodType3 { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType2.array) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.array, + received: ctx.parsedType + }); + return INVALID2; + } + if (ctx.data.length < this._def.items.length) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_small, + minimum: this._def.items.length, + inclusive: true, + exact: false, + type: "array" + }); + return INVALID2; + } + const rest2 = this._def.rest; + if (!rest2 && ctx.data.length > this._def.items.length) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_big, + maximum: this._def.items.length, + inclusive: true, + exact: false, + type: "array" + }); + status.dirty(); + } + const items = [...ctx.data].map((item, itemIndex) => { + const schema = this._def.items[itemIndex] || this._def.rest; + if (!schema) + return null; + return schema._parse(new ParseInputLazyPath2(ctx, item, ctx.path, itemIndex)); + }).filter((x3) => !!x3); + if (ctx.common.async) { + return Promise.all(items).then((results) => { + return ParseStatus2.mergeArray(status, results); + }); + } else { + return ParseStatus2.mergeArray(status, items); + } + } + get items() { + return this._def.items; + } + rest(rest2) { + return new ZodTuple3({ + ...this._def, + rest: rest2 + }); + } + }; + ZodTuple3.create = (schemas4, params) => { + if (!Array.isArray(schemas4)) { + throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); + } + return new ZodTuple3({ + items: schemas4, + typeName: ZodFirstPartyTypeKind2.ZodTuple, + rest: null, + ...processCreateParams2(params) + }); + }; + ZodRecord3 = class ZodRecord3 extends ZodType3 { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType2.object) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.object, + received: ctx.parsedType + }); + return INVALID2; + } + const pairs = []; + const keyType = this._def.keyType; + const valueType = this._def.valueType; + for (const key in ctx.data) { + pairs.push({ + key: keyType._parse(new ParseInputLazyPath2(ctx, key, ctx.path, key)), + value: valueType._parse(new ParseInputLazyPath2(ctx, ctx.data[key], ctx.path, key)), + alwaysSet: key in ctx.data + }); + } + if (ctx.common.async) { + return ParseStatus2.mergeObjectAsync(status, pairs); + } else { + return ParseStatus2.mergeObjectSync(status, pairs); + } + } + get element() { + return this._def.valueType; + } + static create(first, second, third) { + if (second instanceof ZodType3) { + return new ZodRecord3({ + keyType: first, + valueType: second, + typeName: ZodFirstPartyTypeKind2.ZodRecord, + ...processCreateParams2(third) + }); + } + return new ZodRecord3({ + keyType: ZodString3.create(), + valueType: first, + typeName: ZodFirstPartyTypeKind2.ZodRecord, + ...processCreateParams2(second) + }); + } + }; + ZodMap3 = class ZodMap3 extends ZodType3 { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType2.map) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.map, + received: ctx.parsedType + }); + return INVALID2; + } + const keyType = this._def.keyType; + const valueType = this._def.valueType; + const pairs = [...ctx.data.entries()].map(([key, value], index) => { + return { + key: keyType._parse(new ParseInputLazyPath2(ctx, key, ctx.path, [index, "key"])), + value: valueType._parse(new ParseInputLazyPath2(ctx, value, ctx.path, [index, "value"])) + }; + }); + if (ctx.common.async) { + const finalMap = new Map; + return Promise.resolve().then(async () => { + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return INVALID2; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + }); + } else { + const finalMap = new Map; + for (const pair of pairs) { + const key = pair.key; + const value = pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return INVALID2; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + } + } + }; + ZodMap3.create = (keyType, valueType, params) => { + return new ZodMap3({ + valueType, + keyType, + typeName: ZodFirstPartyTypeKind2.ZodMap, + ...processCreateParams2(params) + }); + }; + ZodSet3 = class ZodSet3 extends ZodType3 { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType2.set) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.set, + received: ctx.parsedType + }); + return INVALID2; + } + const def2 = this._def; + if (def2.minSize !== null) { + if (ctx.data.size < def2.minSize.value) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_small, + minimum: def2.minSize.value, + type: "set", + inclusive: true, + exact: false, + message: def2.minSize.message + }); + status.dirty(); + } + } + if (def2.maxSize !== null) { + if (ctx.data.size > def2.maxSize.value) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.too_big, + maximum: def2.maxSize.value, + type: "set", + inclusive: true, + exact: false, + message: def2.maxSize.message + }); + status.dirty(); + } + } + const valueType = this._def.valueType; + function finalizeSet(elements2) { + const parsedSet = new Set; + for (const element of elements2) { + if (element.status === "aborted") + return INVALID2; + if (element.status === "dirty") + status.dirty(); + parsedSet.add(element.value); + } + return { status: status.value, value: parsedSet }; + } + const elements = [...ctx.data.values()].map((item, i3) => valueType._parse(new ParseInputLazyPath2(ctx, item, ctx.path, i3))); + if (ctx.common.async) { + return Promise.all(elements).then((elements2) => finalizeSet(elements2)); + } else { + return finalizeSet(elements); + } + } + min(minSize, message) { + return new ZodSet3({ + ...this._def, + minSize: { value: minSize, message: errorUtil2.toString(message) } + }); + } + max(maxSize, message) { + return new ZodSet3({ + ...this._def, + maxSize: { value: maxSize, message: errorUtil2.toString(message) } + }); + } + size(size2, message) { + return this.min(size2, message).max(size2, message); + } + nonempty(message) { + return this.min(1, message); + } + }; + ZodSet3.create = (valueType, params) => { + return new ZodSet3({ + valueType, + minSize: null, + maxSize: null, + typeName: ZodFirstPartyTypeKind2.ZodSet, + ...processCreateParams2(params) + }); + }; + ZodFunction2 = class ZodFunction2 extends ZodType3 { + constructor() { + super(...arguments); + this.validate = this.implement; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType2.function) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.function, + received: ctx.parsedType + }); + return INVALID2; + } + function makeArgsIssue(args, error41) { + return makeIssue2({ + data: args, + path: ctx.path, + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap3(), en_default3].filter((x3) => !!x3), + issueData: { + code: ZodIssueCode3.invalid_arguments, + argumentsError: error41 + } + }); + } + function makeReturnsIssue(returns, error41) { + return makeIssue2({ + data: returns, + path: ctx.path, + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap3(), en_default3].filter((x3) => !!x3), + issueData: { + code: ZodIssueCode3.invalid_return_type, + returnTypeError: error41 + } + }); + } + const params = { errorMap: ctx.common.contextualErrorMap }; + const fn = ctx.data; + if (this._def.returns instanceof ZodPromise3) { + const me = this; + return OK2(async function(...args) { + const error41 = new ZodError4([]); + const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => { + error41.addIssue(makeArgsIssue(args, e)); + throw error41; + }); + const result2 = await Reflect.apply(fn, this, parsedArgs); + const parsedReturns = await me._def.returns._def.type.parseAsync(result2, params).catch((e) => { + error41.addIssue(makeReturnsIssue(result2, e)); + throw error41; + }); + return parsedReturns; + }); + } else { + const me = this; + return OK2(function(...args) { + const parsedArgs = me._def.args.safeParse(args, params); + if (!parsedArgs.success) { + throw new ZodError4([makeArgsIssue(args, parsedArgs.error)]); + } + const result2 = Reflect.apply(fn, this, parsedArgs.data); + const parsedReturns = me._def.returns.safeParse(result2, params); + if (!parsedReturns.success) { + throw new ZodError4([makeReturnsIssue(result2, parsedReturns.error)]); + } + return parsedReturns.data; + }); + } + } + parameters() { + return this._def.args; + } + returnType() { + return this._def.returns; + } + args(...items) { + return new ZodFunction2({ + ...this._def, + args: ZodTuple3.create(items).rest(ZodUnknown3.create()) + }); + } + returns(returnType) { + return new ZodFunction2({ + ...this._def, + returns: returnType + }); + } + implement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + strictImplement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + static create(args, returns, params) { + return new ZodFunction2({ + args: args ? args : ZodTuple3.create([]).rest(ZodUnknown3.create()), + returns: returns || ZodUnknown3.create(), + typeName: ZodFirstPartyTypeKind2.ZodFunction, + ...processCreateParams2(params) + }); + } + }; + ZodLazy3 = class ZodLazy3 extends ZodType3 { + get schema() { + return this._def.getter(); + } + _parse(input) { + const { ctx } = this._processInputParams(input); + const lazySchema2 = this._def.getter(); + return lazySchema2._parse({ data: ctx.data, path: ctx.path, parent: ctx }); + } + }; + ZodLazy3.create = (getter, params) => { + return new ZodLazy3({ + getter, + typeName: ZodFirstPartyTypeKind2.ZodLazy, + ...processCreateParams2(params) + }); + }; + ZodLiteral3 = class ZodLiteral3 extends ZodType3 { + _parse(input) { + if (input.data !== this._def.value) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + received: ctx.data, + code: ZodIssueCode3.invalid_literal, + expected: this._def.value + }); + return INVALID2; + } + return { status: "valid", value: input.data }; + } + get value() { + return this._def.value; + } + }; + ZodLiteral3.create = (value, params) => { + return new ZodLiteral3({ + value, + typeName: ZodFirstPartyTypeKind2.ZodLiteral, + ...processCreateParams2(params) + }); + }; + ZodEnum3 = class ZodEnum3 extends ZodType3 { + _parse(input) { + if (typeof input.data !== "string") { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext2(ctx, { + expected: util5.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode3.invalid_type + }); + return INVALID2; + } + if (!this._cache) { + this._cache = new Set(this._def.values); + } + if (!this._cache.has(input.data)) { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext2(ctx, { + received: ctx.data, + code: ZodIssueCode3.invalid_enum_value, + options: expectedValues + }); + return INVALID2; + } + return OK2(input.data); + } + get options() { + return this._def.values; + } + get enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Values() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + extract(values2, newDef = this._def) { + return ZodEnum3.create(values2, { + ...this._def, + ...newDef + }); + } + exclude(values2, newDef = this._def) { + return ZodEnum3.create(this.options.filter((opt) => !values2.includes(opt)), { + ...this._def, + ...newDef + }); + } + }; + ZodEnum3.create = createZodEnum2; + ZodNativeEnum2 = class ZodNativeEnum2 extends ZodType3 { + _parse(input) { + const nativeEnumValues = util5.getValidEnumValues(this._def.values); + const ctx = this._getOrReturnCtx(input); + if (ctx.parsedType !== ZodParsedType2.string && ctx.parsedType !== ZodParsedType2.number) { + const expectedValues = util5.objectValues(nativeEnumValues); + addIssueToContext2(ctx, { + expected: util5.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode3.invalid_type + }); + return INVALID2; + } + if (!this._cache) { + this._cache = new Set(util5.getValidEnumValues(this._def.values)); + } + if (!this._cache.has(input.data)) { + const expectedValues = util5.objectValues(nativeEnumValues); + addIssueToContext2(ctx, { + received: ctx.data, + code: ZodIssueCode3.invalid_enum_value, + options: expectedValues + }); + return INVALID2; + } + return OK2(input.data); + } + get enum() { + return this._def.values; + } + }; + ZodNativeEnum2.create = (values2, params) => { + return new ZodNativeEnum2({ + values: values2, + typeName: ZodFirstPartyTypeKind2.ZodNativeEnum, + ...processCreateParams2(params) + }); + }; + ZodPromise3 = class ZodPromise3 extends ZodType3 { + unwrap() { + return this._def.type; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType2.promise && ctx.common.async === false) { + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.promise, + received: ctx.parsedType + }); + return INVALID2; + } + const promisified = ctx.parsedType === ZodParsedType2.promise ? ctx.data : Promise.resolve(ctx.data); + return OK2(promisified.then((data) => { + return this._def.type.parseAsync(data, { + path: ctx.path, + errorMap: ctx.common.contextualErrorMap + }); + })); + } + }; + ZodPromise3.create = (schema, params) => { + return new ZodPromise3({ + type: schema, + typeName: ZodFirstPartyTypeKind2.ZodPromise, + ...processCreateParams2(params) + }); + }; + ZodEffects2 = class ZodEffects2 extends ZodType3 { + innerType() { + return this._def.schema; + } + sourceType() { + return this._def.schema._def.typeName === ZodFirstPartyTypeKind2.ZodEffects ? this._def.schema.sourceType() : this._def.schema; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const effect = this._def.effect || null; + const checkCtx = { + addIssue: (arg) => { + addIssueToContext2(ctx, arg); + if (arg.fatal) { + status.abort(); + } else { + status.dirty(); + } + }, + get path() { + return ctx.path; + } + }; + checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); + if (effect.type === "preprocess") { + const processed = effect.transform(ctx.data, checkCtx); + if (ctx.common.async) { + return Promise.resolve(processed).then(async (processed2) => { + if (status.value === "aborted") + return INVALID2; + const result2 = await this._def.schema._parseAsync({ + data: processed2, + path: ctx.path, + parent: ctx + }); + if (result2.status === "aborted") + return INVALID2; + if (result2.status === "dirty") + return DIRTY2(result2.value); + if (status.value === "dirty") + return DIRTY2(result2.value); + return result2; + }); + } else { + if (status.value === "aborted") + return INVALID2; + const result2 = this._def.schema._parseSync({ + data: processed, + path: ctx.path, + parent: ctx + }); + if (result2.status === "aborted") + return INVALID2; + if (result2.status === "dirty") + return DIRTY2(result2.value); + if (status.value === "dirty") + return DIRTY2(result2.value); + return result2; + } + } + if (effect.type === "refinement") { + const executeRefinement = (acc) => { + const result2 = effect.refinement(acc, checkCtx); + if (ctx.common.async) { + return Promise.resolve(result2); + } + if (result2 instanceof Promise) { + throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); + } + return acc; + }; + if (ctx.common.async === false) { + const inner = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inner.status === "aborted") + return INVALID2; + if (inner.status === "dirty") + status.dirty(); + executeRefinement(inner.value); + return { status: status.value, value: inner.value }; + } else { + return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => { + if (inner.status === "aborted") + return INVALID2; + if (inner.status === "dirty") + status.dirty(); + return executeRefinement(inner.value).then(() => { + return { status: status.value, value: inner.value }; + }); + }); + } + } + if (effect.type === "transform") { + if (ctx.common.async === false) { + const base2 = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (!isValid2(base2)) + return INVALID2; + const result2 = effect.transform(base2.value, checkCtx); + if (result2 instanceof Promise) { + throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); + } + return { status: status.value, value: result2 }; + } else { + return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base2) => { + if (!isValid2(base2)) + return INVALID2; + return Promise.resolve(effect.transform(base2.value, checkCtx)).then((result2) => ({ + status: status.value, + value: result2 + })); + }); + } + } + util5.assertNever(effect); + } + }; + ZodEffects2.create = (schema, effect, params) => { + return new ZodEffects2({ + schema, + typeName: ZodFirstPartyTypeKind2.ZodEffects, + effect, + ...processCreateParams2(params) + }); + }; + ZodEffects2.createWithPreprocess = (preprocess2, schema, params) => { + return new ZodEffects2({ + schema, + effect: { type: "preprocess", transform: preprocess2 }, + typeName: ZodFirstPartyTypeKind2.ZodEffects, + ...processCreateParams2(params) + }); + }; + ZodOptional3 = class ZodOptional3 extends ZodType3 { + _parse(input) { + const parsedType4 = this._getType(input); + if (parsedType4 === ZodParsedType2.undefined) { + return OK2(undefined); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } + }; + ZodOptional3.create = (type, params) => { + return new ZodOptional3({ + innerType: type, + typeName: ZodFirstPartyTypeKind2.ZodOptional, + ...processCreateParams2(params) + }); + }; + ZodNullable3 = class ZodNullable3 extends ZodType3 { + _parse(input) { + const parsedType4 = this._getType(input); + if (parsedType4 === ZodParsedType2.null) { + return OK2(null); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } + }; + ZodNullable3.create = (type, params) => { + return new ZodNullable3({ + innerType: type, + typeName: ZodFirstPartyTypeKind2.ZodNullable, + ...processCreateParams2(params) + }); + }; + ZodDefault3 = class ZodDefault3 extends ZodType3 { + _parse(input) { + const { ctx } = this._processInputParams(input); + let data = ctx.data; + if (ctx.parsedType === ZodParsedType2.undefined) { + data = this._def.defaultValue(); + } + return this._def.innerType._parse({ + data, + path: ctx.path, + parent: ctx + }); + } + removeDefault() { + return this._def.innerType; + } + }; + ZodDefault3.create = (type, params) => { + return new ZodDefault3({ + innerType: type, + typeName: ZodFirstPartyTypeKind2.ZodDefault, + defaultValue: typeof params.default === "function" ? params.default : () => params.default, + ...processCreateParams2(params) + }); + }; + ZodCatch3 = class ZodCatch3 extends ZodType3 { + _parse(input) { + const { ctx } = this._processInputParams(input); + const newCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [] + } + }; + const result2 = this._def.innerType._parse({ + data: newCtx.data, + path: newCtx.path, + parent: { + ...newCtx + } + }); + if (isAsync2(result2)) { + return result2.then((result3) => { + return { + status: "valid", + value: result3.status === "valid" ? result3.value : this._def.catchValue({ + get error() { + return new ZodError4(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + }); + } else { + return { + status: "valid", + value: result2.status === "valid" ? result2.value : this._def.catchValue({ + get error() { + return new ZodError4(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + } + } + removeCatch() { + return this._def.innerType; + } + }; + ZodCatch3.create = (type, params) => { + return new ZodCatch3({ + innerType: type, + typeName: ZodFirstPartyTypeKind2.ZodCatch, + catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, + ...processCreateParams2(params) + }); + }; + ZodNaN3 = class ZodNaN3 extends ZodType3 { + _parse(input) { + const parsedType4 = this._getType(input); + if (parsedType4 !== ZodParsedType2.nan) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext2(ctx, { + code: ZodIssueCode3.invalid_type, + expected: ZodParsedType2.nan, + received: ctx.parsedType + }); + return INVALID2; + } + return { status: "valid", value: input.data }; + } + }; + ZodNaN3.create = (params) => { + return new ZodNaN3({ + typeName: ZodFirstPartyTypeKind2.ZodNaN, + ...processCreateParams2(params) + }); + }; + BRAND2 = Symbol("zod_brand"); + ZodBranded2 = class ZodBranded2 extends ZodType3 { + _parse(input) { + const { ctx } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx + }); + } + unwrap() { + return this._def.type; + } + }; + ZodPipeline2 = class ZodPipeline2 extends ZodType3 { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.common.async) { + const handleAsync = async () => { + const inResult = await this._def.in._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inResult.status === "aborted") + return INVALID2; + if (inResult.status === "dirty") { + status.dirty(); + return DIRTY2(inResult.value); + } else { + return this._def.out._parseAsync({ + data: inResult.value, + path: ctx.path, + parent: ctx + }); + } + }; + return handleAsync(); + } else { + const inResult = this._def.in._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inResult.status === "aborted") + return INVALID2; + if (inResult.status === "dirty") { + status.dirty(); + return { + status: "dirty", + value: inResult.value + }; + } else { + return this._def.out._parseSync({ + data: inResult.value, + path: ctx.path, + parent: ctx + }); + } + } + } + static create(a2, b) { + return new ZodPipeline2({ + in: a2, + out: b, + typeName: ZodFirstPartyTypeKind2.ZodPipeline + }); + } + }; + ZodReadonly3 = class ZodReadonly3 extends ZodType3 { + _parse(input) { + const result2 = this._def.innerType._parse(input); + const freeze = (data) => { + if (isValid2(data)) { + data.value = Object.freeze(data.value); + } + return data; + }; + return isAsync2(result2) ? result2.then((data) => freeze(data)) : freeze(result2); + } + unwrap() { + return this._def.innerType; + } + }; + ZodReadonly3.create = (type, params) => { + return new ZodReadonly3({ + innerType: type, + typeName: ZodFirstPartyTypeKind2.ZodReadonly, + ...processCreateParams2(params) + }); + }; + late2 = { + object: ZodObject3.lazycreate + }; + (function(ZodFirstPartyTypeKind3) { + ZodFirstPartyTypeKind3["ZodString"] = "ZodString"; + ZodFirstPartyTypeKind3["ZodNumber"] = "ZodNumber"; + ZodFirstPartyTypeKind3["ZodNaN"] = "ZodNaN"; + ZodFirstPartyTypeKind3["ZodBigInt"] = "ZodBigInt"; + ZodFirstPartyTypeKind3["ZodBoolean"] = "ZodBoolean"; + ZodFirstPartyTypeKind3["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind3["ZodSymbol"] = "ZodSymbol"; + ZodFirstPartyTypeKind3["ZodUndefined"] = "ZodUndefined"; + ZodFirstPartyTypeKind3["ZodNull"] = "ZodNull"; + ZodFirstPartyTypeKind3["ZodAny"] = "ZodAny"; + ZodFirstPartyTypeKind3["ZodUnknown"] = "ZodUnknown"; + ZodFirstPartyTypeKind3["ZodNever"] = "ZodNever"; + ZodFirstPartyTypeKind3["ZodVoid"] = "ZodVoid"; + ZodFirstPartyTypeKind3["ZodArray"] = "ZodArray"; + ZodFirstPartyTypeKind3["ZodObject"] = "ZodObject"; + ZodFirstPartyTypeKind3["ZodUnion"] = "ZodUnion"; + ZodFirstPartyTypeKind3["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; + ZodFirstPartyTypeKind3["ZodIntersection"] = "ZodIntersection"; + ZodFirstPartyTypeKind3["ZodTuple"] = "ZodTuple"; + ZodFirstPartyTypeKind3["ZodRecord"] = "ZodRecord"; + ZodFirstPartyTypeKind3["ZodMap"] = "ZodMap"; + ZodFirstPartyTypeKind3["ZodSet"] = "ZodSet"; + ZodFirstPartyTypeKind3["ZodFunction"] = "ZodFunction"; + ZodFirstPartyTypeKind3["ZodLazy"] = "ZodLazy"; + ZodFirstPartyTypeKind3["ZodLiteral"] = "ZodLiteral"; + ZodFirstPartyTypeKind3["ZodEnum"] = "ZodEnum"; + ZodFirstPartyTypeKind3["ZodEffects"] = "ZodEffects"; + ZodFirstPartyTypeKind3["ZodNativeEnum"] = "ZodNativeEnum"; + ZodFirstPartyTypeKind3["ZodOptional"] = "ZodOptional"; + ZodFirstPartyTypeKind3["ZodNullable"] = "ZodNullable"; + ZodFirstPartyTypeKind3["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind3["ZodCatch"] = "ZodCatch"; + ZodFirstPartyTypeKind3["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind3["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind3["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind3["ZodReadonly"] = "ZodReadonly"; + })(ZodFirstPartyTypeKind2 || (ZodFirstPartyTypeKind2 = {})); + stringType2 = ZodString3.create; + numberType2 = ZodNumber3.create; + nanType2 = ZodNaN3.create; + bigIntType2 = ZodBigInt3.create; + booleanType2 = ZodBoolean3.create; + dateType2 = ZodDate3.create; + symbolType2 = ZodSymbol3.create; + undefinedType2 = ZodUndefined3.create; + nullType2 = ZodNull3.create; + anyType2 = ZodAny3.create; + unknownType2 = ZodUnknown3.create; + neverType2 = ZodNever3.create; + voidType2 = ZodVoid3.create; + arrayType2 = ZodArray3.create; + objectType2 = ZodObject3.create; + strictObjectType2 = ZodObject3.strictCreate; + unionType2 = ZodUnion3.create; + discriminatedUnionType2 = ZodDiscriminatedUnion3.create; + intersectionType2 = ZodIntersection3.create; + tupleType2 = ZodTuple3.create; + recordType2 = ZodRecord3.create; + mapType2 = ZodMap3.create; + setType2 = ZodSet3.create; + functionType2 = ZodFunction2.create; + lazyType2 = ZodLazy3.create; + literalType2 = ZodLiteral3.create; + enumType2 = ZodEnum3.create; + nativeEnumType2 = ZodNativeEnum2.create; + promiseType2 = ZodPromise3.create; + effectsType2 = ZodEffects2.create; + optionalType2 = ZodOptional3.create; + nullableType2 = ZodNullable3.create; + preprocessType2 = ZodEffects2.createWithPreprocess; + pipelineType2 = ZodPipeline2.create; +}); + +// ../node_modules/zod/v3/external.js +var init_external4 = __esm(() => { + init_errors7(); + init_parseUtil2(); + init_typeAliases2(); + init_util5(); + init_types12(); + init_ZodError2(); +}); + // ../node_modules/zod/v3/index.js var init_v32 = __esm(() => { init_external4(); @@ -536808,13 +464222,13 @@ var init_v32 = __esm(() => { // ../node_modules/zod/v4/core/core.js function $constructor2(name, initializer3, params) { - function init2(inst, def2) { - var _a5; + function init(inst, def2) { + var _a3; Object.defineProperty(inst, "_zod", { value: inst._zod ?? {}, enumerable: false }); - (_a5 = inst._zod).traits ?? (_a5.traits = new Set); + (_a3 = inst._zod).traits ?? (_a3.traits = new Set); inst._zod.traits.add(name); initializer3(inst, def2); for (const k in _.prototype) { @@ -536830,16 +464244,16 @@ function $constructor2(name, initializer3, params) { } Object.defineProperty(Definition, "name", { value: name }); function _(def2) { - var _a5; + var _a3; const inst = params?.Parent ? new Definition : this; - init2(inst, def2); - (_a5 = inst._zod).deferred ?? (_a5.deferred = []); + init(inst, def2); + (_a3 = inst._zod).deferred ?? (_a3.deferred = []); for (const fn of inst._zod.deferred) { fn(); } return inst; } - Object.defineProperty(_, "init", { value: init2 }); + Object.defineProperty(_, "init", { value: init }); Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => { if (params?.Parent && inst instanceof params.Parent) @@ -536850,14 +464264,14 @@ function $constructor2(name, initializer3, params) { Object.defineProperty(_, "name", { value: name }); return _; } -function config4(newConfig) { +function config2(newConfig) { if (newConfig) Object.assign(globalConfig2, newConfig); return globalConfig2; } -var NEVER4, $brand2, $ZodAsyncError2, globalConfig2; +var NEVER3, $brand2, $ZodAsyncError2, globalConfig2; var init_core5 = __esm(() => { - NEVER4 = Object.freeze({ + NEVER3 = Object.freeze({ status: "aborted" }); $brand2 = Symbol("zod_brand"); @@ -536880,19 +464294,19 @@ __export(exports_util2, { promiseAllObject: () => promiseAllObject2, primitiveTypes: () => primitiveTypes2, prefixIssues: () => prefixIssues2, - pick: () => pick5, - partial: () => partial4, + pick: () => pick4, + partial: () => partial3, optionalKeys: () => optionalKeys2, - omit: () => omit4, + omit: () => omit3, numKeys: () => numKeys2, nullish: () => nullish3, normalizeParams: () => normalizeParams2, - merge: () => merge5, + merge: () => merge4, jsonStringifyReplacer: () => jsonStringifyReplacer2, joinValues: () => joinValues2, issue: () => issue2, - isPlainObject: () => isPlainObject7, - isObject: () => isObject6, + isPlainObject: () => isPlainObject6, + isObject: () => isObject5, getSizableOrigin: () => getSizableOrigin2, getParsedType: () => getParsedType4, getLengthableOrigin: () => getLengthableOrigin2, @@ -536905,7 +464319,7 @@ __export(exports_util2, { esc: () => esc2, defineLazy: () => defineLazy2, createTransparentProxy: () => createTransparentProxy2, - clone: () => clone5, + clone: () => clone4, cleanRegex: () => cleanRegex2, cleanEnum: () => cleanEnum2, captureStackTrace: () => captureStackTrace2, @@ -536915,7 +464329,7 @@ __export(exports_util2, { assertNever: () => assertNever2, assertIs: () => assertIs2, assertEqual: () => assertEqual2, - assert: () => assert3, + assert: () => assert2, allowsEval: () => allowsEval2, aborted: () => aborted3, NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES2, @@ -536932,11 +464346,11 @@ function assertIs2(_arg) {} function assertNever2(_x) { throw new Error; } -function assert3(_) {} +function assert2(_) {} function getEnumValues2(entries) { const numericValues = Object.values(entries).filter((v) => typeof v === "number"); - const values4 = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); - return values4; + const values2 = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); + return values2; } function joinValues2(array3, separator = "|") { return array3.map((val) => stringifyPrimitive2(val)).join(separator); @@ -536947,10 +464361,10 @@ function jsonStringifyReplacer2(_, value) { return value; } function cached4(getter) { - const set5 = false; + const set4 = false; return { get value() { - if (!set5) { + if (!set4) { const value = getter(); Object.defineProperty(this, "value", { value }); return value; @@ -536959,8 +464373,8 @@ function cached4(getter) { } }; } -function nullish3(input11) { - return input11 === null || input11 === undefined; +function nullish3(input) { + return input === null || input === undefined; } function cleanRegex2(source) { const start = source.startsWith("^") ? 1 : 0; @@ -536976,10 +464390,10 @@ function floatSafeRemainder4(val, step) { return valInt % stepInt / 10 ** decCount; } function defineLazy2(object4, key, getter) { - const set5 = false; + const set4 = false; Object.defineProperty(object4, key, { get() { - if (!set5) { + if (!set4) { const value = getter(); object4[key] = value; return value; @@ -537002,18 +464416,18 @@ function assignProp2(target, prop, value) { configurable: true }); } -function getElementAtPath2(obj, path21) { - if (!path21) +function getElementAtPath2(obj, path16) { + if (!path16) return obj; - return path21.reduce((acc, key) => acc?.[key], obj); + return path16.reduce((acc, key) => acc?.[key], obj); } function promiseAllObject2(promisesObj) { - const keys3 = Object.keys(promisesObj); - const promises = keys3.map((key) => promisesObj[key]); + const keys2 = Object.keys(promisesObj); + const promises = keys2.map((key) => promisesObj[key]); return Promise.all(promises).then((results) => { const resolvedObj = {}; - for (let i4 = 0;i4 < keys3.length; i4++) { - resolvedObj[keys3[i4]] = results[i4]; + for (let i3 = 0;i3 < keys2.length; i3++) { + resolvedObj[keys2[i3]] = results[i3]; } return resolvedObj; }); @@ -537021,7 +464435,7 @@ function promiseAllObject2(promisesObj) { function randomString2(length = 10) { const chars = "abcdefghijklmnopqrstuvwxyz"; let str = ""; - for (let i4 = 0;i4 < length; i4++) { + for (let i3 = 0;i3 < length; i3++) { str += chars[Math.floor(Math.random() * chars.length)]; } return str; @@ -537029,17 +464443,17 @@ function randomString2(length = 10) { function esc2(str) { return JSON.stringify(str); } -function isObject6(data) { +function isObject5(data) { return typeof data === "object" && data !== null && !Array.isArray(data); } -function isPlainObject7(o2) { - if (isObject6(o2) === false) +function isPlainObject6(o2) { + if (isObject5(o2) === false) return false; const ctor = o2.constructor; if (ctor === undefined) return true; const prot = ctor.prototype; - if (isObject6(prot) === false) + if (isObject5(prot) === false) return false; if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) { return false; @@ -537058,7 +464472,7 @@ function numKeys2(data) { function escapeRegex2(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } -function clone5(inst, def2, params) { +function clone4(inst, def2, params) { const cl = new inst._zod.constr(def2 ?? inst._zod.def); if (!def2 || params?.parent) cl._zod.parent = inst; @@ -537125,7 +464539,7 @@ function optionalKeys2(shape) { return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; }); } -function pick5(schema, mask) { +function pick4(schema, mask) { const newShape = {}; const currDef = schema._zod.def; for (const key in mask) { @@ -537136,13 +464550,13 @@ function pick5(schema, mask) { continue; newShape[key] = currDef.shape[key]; } - return clone5(schema, { + return clone4(schema, { ...schema._zod.def, shape: newShape, checks: [] }); } -function omit4(schema, mask) { +function omit3(schema, mask) { const newShape = { ...schema._zod.def.shape }; const currDef = schema._zod.def; for (const key in mask) { @@ -537153,14 +464567,14 @@ function omit4(schema, mask) { continue; delete newShape[key]; } - return clone5(schema, { + return clone4(schema, { ...schema._zod.def, shape: newShape, checks: [] }); } function extend3(schema, shape) { - if (!isPlainObject7(shape)) { + if (!isPlainObject6(shape)) { throw new Error("Invalid input to extend: expected a plain object"); } const def2 = { @@ -537172,10 +464586,10 @@ function extend3(schema, shape) { }, checks: [] }; - return clone5(schema, def2); + return clone4(schema, def2); } -function merge5(a2, b) { - return clone5(a2, { +function merge4(a2, b) { + return clone4(a2, { ...a2._zod.def, get shape() { const _shape = { ...a2._zod.def.shape, ...b._zod.def.shape }; @@ -537186,7 +464600,7 @@ function merge5(a2, b) { checks: [] }); } -function partial4(Class2, schema, mask) { +function partial3(Class2, schema, mask) { const oldShape = schema._zod.def.shape; const shape = { ...oldShape }; if (mask) { @@ -537209,7 +464623,7 @@ function partial4(Class2, schema, mask) { }) : oldShape[key]; } } - return clone5(schema, { + return clone4(schema, { ...schema._zod.def, shape, checks: [] @@ -537238,34 +464652,34 @@ function required2(Class2, schema, mask) { }); } } - return clone5(schema, { + return clone4(schema, { ...schema._zod.def, shape, checks: [] }); } -function aborted3(x4, startIndex = 0) { - for (let i4 = startIndex;i4 < x4.issues.length; i4++) { - if (x4.issues[i4]?.continue !== true) +function aborted3(x3, startIndex = 0) { + for (let i3 = startIndex;i3 < x3.issues.length; i3++) { + if (x3.issues[i3]?.continue !== true) return true; } return false; } -function prefixIssues2(path21, issues) { +function prefixIssues2(path16, issues) { return issues.map((iss) => { - var _a5; - (_a5 = iss).path ?? (_a5.path = []); - iss.path.unshift(path21); + var _a3; + (_a3 = iss).path ?? (_a3.path = []); + iss.path.unshift(path16); return iss; }); } function unwrapMessage2(message) { return typeof message === "string" ? message : message?.message; } -function finalizeIssue2(iss, ctx, config5) { +function finalizeIssue2(iss, ctx, config3) { const full = { ...iss, path: iss.path ?? [] }; if (!iss.message) { - const message = unwrapMessage2(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage2(ctx?.error?.(iss)) ?? unwrapMessage2(config5.customError?.(iss)) ?? unwrapMessage2(config5.localeError?.(iss)) ?? "Invalid input"; + const message = unwrapMessage2(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage2(ctx?.error?.(iss)) ?? unwrapMessage2(config3.customError?.(iss)) ?? unwrapMessage2(config3.localeError?.(iss)) ?? "Invalid input"; full.message = message; } delete full.inst; @@ -537275,29 +464689,29 @@ function finalizeIssue2(iss, ctx, config5) { } return full; } -function getSizableOrigin2(input11) { - if (input11 instanceof Set) +function getSizableOrigin2(input) { + if (input instanceof Set) return "set"; - if (input11 instanceof Map) + if (input instanceof Map) return "map"; - if (input11 instanceof File) + if (input instanceof File) return "file"; return "unknown"; } -function getLengthableOrigin2(input11) { - if (Array.isArray(input11)) +function getLengthableOrigin2(input) { + if (Array.isArray(input)) return "array"; - if (typeof input11 === "string") + if (typeof input === "string") return "string"; return "unknown"; } function issue2(...args) { - const [iss, input11, inst] = args; + const [iss, input, inst] = args; if (typeof iss === "string") { return { message: iss, code: "custom", - input: input11, + input, inst }; } @@ -537356,7 +464770,7 @@ var captureStackTrace2, allowsEval2, getParsedType4 = (data) => { throw new Error(`Unknown data type: ${t}`); } }, propertyKeyTypes2, primitiveTypes2, NUMBER_FORMAT_RANGES2, BIGINT_FORMAT_RANGES2; -var init_util7 = __esm(() => { +var init_util6 = __esm(() => { captureStackTrace2 = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {}; allowsEval2 = cached4(() => { if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { @@ -537386,10 +464800,10 @@ var init_util7 = __esm(() => { }); // ../node_modules/zod/v4/core/errors.js -function flattenError3(error45, mapper = (issue3) => issue3.message) { +function flattenError3(error41, mapper = (issue3) => issue3.message) { const fieldErrors = {}; const formErrors = []; - for (const sub of error45.issues) { + for (const sub of error41.issues) { if (sub.path.length > 0) { fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; fieldErrors[sub.path[0]].push(mapper(sub)); @@ -537399,13 +464813,13 @@ function flattenError3(error45, mapper = (issue3) => issue3.message) { } return { formErrors, fieldErrors }; } -function formatError3(error45, _mapper) { +function formatError3(error41, _mapper) { const mapper = _mapper || function(issue3) { return issue3.message; }; const fieldErrors = { _errors: [] }; - const processError = (error46) => { - for (const issue3 of error46.issues) { + const processError = (error42) => { + for (const issue3 of error42.issues) { if (issue3.code === "invalid_union" && issue3.errors.length) { issue3.errors.map((issues) => processError({ issues })); } else if (issue3.code === "invalid_key") { @@ -537416,10 +464830,10 @@ function formatError3(error45, _mapper) { fieldErrors._errors.push(mapper(issue3)); } else { let curr = fieldErrors; - let i4 = 0; - while (i4 < issue3.path.length) { - const el = issue3.path[i4]; - const terminal = i4 === issue3.path.length - 1; + let i3 = 0; + while (i3 < issue3.path.length) { + const el = issue3.path[i3]; + const terminal = i3 === issue3.path.length - 1; if (!terminal) { curr[el] = curr[el] || { _errors: [] }; } else { @@ -537427,12 +464841,12 @@ function formatError3(error45, _mapper) { curr[el]._errors.push(mapper(issue3)); } curr = curr[el]; - i4++; + i3++; } } } }; - processError(error45); + processError(error41); return fieldErrors; } var initializer3 = (inst, def2) => { @@ -537458,7 +464872,7 @@ var initializer3 = (inst, def2) => { }, $ZodError2, $ZodRealError2; var init_errors8 = __esm(() => { init_core5(); - init_util7(); + init_util6(); $ZodError2 = $constructor2("$ZodError", initializer3); $ZodRealError2 = $constructor2("$ZodError", initializer3, { Parent: Error }); }); @@ -537466,51 +464880,51 @@ var init_errors8 = __esm(() => { // ../node_modules/zod/v4/core/parse.js var _parse2 = (_Err) => (schema, value, _ctx, _params) => { const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false }; - const result3 = schema._zod.run({ value, issues: [] }, ctx); - if (result3 instanceof Promise) { + const result2 = schema._zod.run({ value, issues: [] }, ctx); + if (result2 instanceof Promise) { throw new $ZodAsyncError2; } - if (result3.issues.length) { - const e = new (_params?.Err ?? _Err)(result3.issues.map((iss) => finalizeIssue2(iss, ctx, config4()))); + if (result2.issues.length) { + const e = new (_params?.Err ?? _Err)(result2.issues.map((iss) => finalizeIssue2(iss, ctx, config2()))); captureStackTrace2(e, _params?.callee); throw e; } - return result3.value; + return result2.value; }, _parseAsync2 = (_Err) => async (schema, value, _ctx, params) => { const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; - let result3 = schema._zod.run({ value, issues: [] }, ctx); - if (result3 instanceof Promise) - result3 = await result3; - if (result3.issues.length) { - const e = new (params?.Err ?? _Err)(result3.issues.map((iss) => finalizeIssue2(iss, ctx, config4()))); + let result2 = schema._zod.run({ value, issues: [] }, ctx); + if (result2 instanceof Promise) + result2 = await result2; + if (result2.issues.length) { + const e = new (params?.Err ?? _Err)(result2.issues.map((iss) => finalizeIssue2(iss, ctx, config2()))); captureStackTrace2(e, params?.callee); throw e; } - return result3.value; + return result2.value; }, _safeParse2 = (_Err) => (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, async: false } : { async: false }; - const result3 = schema._zod.run({ value, issues: [] }, ctx); - if (result3 instanceof Promise) { + const result2 = schema._zod.run({ value, issues: [] }, ctx); + if (result2 instanceof Promise) { throw new $ZodAsyncError2; } - return result3.issues.length ? { + return result2.issues.length ? { success: false, - error: new (_Err ?? $ZodError2)(result3.issues.map((iss) => finalizeIssue2(iss, ctx, config4()))) - } : { success: true, data: result3.value }; + error: new (_Err ?? $ZodError2)(result2.issues.map((iss) => finalizeIssue2(iss, ctx, config2()))) + } : { success: true, data: result2.value }; }, safeParse4, _safeParseAsync2 = (_Err) => async (schema, value, _ctx) => { const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; - let result3 = schema._zod.run({ value, issues: [] }, ctx); - if (result3 instanceof Promise) - result3 = await result3; - return result3.issues.length ? { + let result2 = schema._zod.run({ value, issues: [] }, ctx); + if (result2 instanceof Promise) + result2 = await result2; + return result2.issues.length ? { success: false, - error: new _Err(result3.issues.map((iss) => finalizeIssue2(iss, ctx, config4()))) - } : { success: true, data: result3.value }; + error: new _Err(result2.issues.map((iss) => finalizeIssue2(iss, ctx, config2()))) + } : { success: true, data: result2.value }; }, safeParseAsync3; -var init_parse6 = __esm(() => { +var init_parse5 = __esm(() => { init_core5(); init_errors8(); - init_util7(); + init_util6(); safeParse4 = /* @__PURE__ */ _safeParse2($ZodRealError2); safeParseAsync3 = /* @__PURE__ */ _safeParseAsync2($ZodRealError2); }); @@ -537537,11 +464951,11 @@ function datetime3(args) { const timeRegex3 = `${time4}(?:${opts.join("|")})`; return new RegExp(`^${dateSource2}T(?:${timeRegex3})$`); } -var cuid5, cuid23, ulid3, xid3, ksuid3, nanoid3, duration3, guid3, uuid5 = (version2) => { +var cuid5, cuid23, ulid3, xid3, ksuid3, nanoid3, duration3, guid3, uuid3 = (version2) => { if (!version2) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/; return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); -}, email3, _emoji3 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, ipv43, ipv63, cidrv43, cidrv63, base644, base64url3, hostname3, e1643, dateSource2 = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`, date6, string5 = (params) => { +}, email3, _emoji3 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, ipv43, ipv63, cidrv43, cidrv63, base643, base64url3, hostname3, e1643, dateSource2 = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`, date6, string5 = (params) => { const regex2 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; return new RegExp(`^${regex2}$`); }, integer2, number5, boolean5, _null4, lowercase2, uppercase2; @@ -537559,7 +464973,7 @@ var init_regexes2 = __esm(() => { ipv63 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/; cidrv43 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; cidrv63 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; - base644 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; + base643 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; base64url3 = /^[A-Za-z0-9_-]*$/; hostname3 = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/; e1643 = /^\+(?:[0-9]){6,14}[0-9]$/; @@ -537577,12 +464991,12 @@ var $ZodCheck2, numericOriginMap2, $ZodCheckLessThan2, $ZodCheckGreaterThan2, $Z var init_checks4 = __esm(() => { init_core5(); init_regexes2(); - init_util7(); + init_util6(); $ZodCheck2 = /* @__PURE__ */ $constructor2("$ZodCheck", (inst, def2) => { - var _a5; + var _a3; inst._zod ?? (inst._zod = {}); inst._zod.def = def2; - (_a5 = inst._zod).onattach ?? (_a5.onattach = []); + (_a3 = inst._zod).onattach ?? (_a3.onattach = []); }); numericOriginMap2 = { number: "number", @@ -537648,8 +465062,8 @@ var init_checks4 = __esm(() => { $ZodCheckMultipleOf2 = /* @__PURE__ */ $constructor2("$ZodCheckMultipleOf", (inst, def2) => { $ZodCheck2.init(inst, def2); inst._zod.onattach.push((inst2) => { - var _a5; - (_a5 = inst2._zod.bag).multipleOf ?? (_a5.multipleOf = def2.value); + var _a3; + (_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def2.value); }); inst._zod.check = (payload) => { if (typeof payload.value !== typeof def2.value) @@ -537682,22 +465096,22 @@ var init_checks4 = __esm(() => { bag.pattern = integer2; }); inst._zod.check = (payload) => { - const input11 = payload.value; + const input = payload.value; if (isInt) { - if (!Number.isInteger(input11)) { + if (!Number.isInteger(input)) { payload.issues.push({ expected: origin2, format: def2.format, code: "invalid_type", - input: input11, + input, inst }); return; } - if (!Number.isSafeInteger(input11)) { - if (input11 > 0) { + if (!Number.isSafeInteger(input)) { + if (input > 0) { payload.issues.push({ - input: input11, + input, code: "too_big", maximum: Number.MAX_SAFE_INTEGER, note: "Integers must be within the safe integer range.", @@ -537707,7 +465121,7 @@ var init_checks4 = __esm(() => { }); } else { payload.issues.push({ - input: input11, + input, code: "too_small", minimum: Number.MIN_SAFE_INTEGER, note: "Integers must be within the safe integer range.", @@ -537719,10 +465133,10 @@ var init_checks4 = __esm(() => { return; } } - if (input11 < minimum) { + if (input < minimum) { payload.issues.push({ origin: "number", - input: input11, + input, code: "too_small", minimum, inclusive: true, @@ -537730,10 +465144,10 @@ var init_checks4 = __esm(() => { continue: !def2.abort }); } - if (input11 > maximum) { + if (input > maximum) { payload.issues.push({ origin: "number", - input: input11, + input, code: "too_big", maximum, inst @@ -537742,9 +465156,9 @@ var init_checks4 = __esm(() => { }; }); $ZodCheckMaxLength2 = /* @__PURE__ */ $constructor2("$ZodCheckMaxLength", (inst, def2) => { - var _a5; + var _a3; $ZodCheck2.init(inst, def2); - (_a5 = inst._zod.def).when ?? (_a5.when = (payload) => { + (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => { const val = payload.value; return !nullish3(val) && val.length !== undefined; }); @@ -537754,26 +465168,26 @@ var init_checks4 = __esm(() => { inst2._zod.bag.maximum = def2.maximum; }); inst._zod.check = (payload) => { - const input11 = payload.value; - const length = input11.length; + const input = payload.value; + const length = input.length; if (length <= def2.maximum) return; - const origin2 = getLengthableOrigin2(input11); + const origin2 = getLengthableOrigin2(input); payload.issues.push({ origin: origin2, code: "too_big", maximum: def2.maximum, inclusive: true, - input: input11, + input, inst, continue: !def2.abort }); }; }); $ZodCheckMinLength2 = /* @__PURE__ */ $constructor2("$ZodCheckMinLength", (inst, def2) => { - var _a5; + var _a3; $ZodCheck2.init(inst, def2); - (_a5 = inst._zod.def).when ?? (_a5.when = (payload) => { + (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => { const val = payload.value; return !nullish3(val) && val.length !== undefined; }); @@ -537783,26 +465197,26 @@ var init_checks4 = __esm(() => { inst2._zod.bag.minimum = def2.minimum; }); inst._zod.check = (payload) => { - const input11 = payload.value; - const length = input11.length; + const input = payload.value; + const length = input.length; if (length >= def2.minimum) return; - const origin2 = getLengthableOrigin2(input11); + const origin2 = getLengthableOrigin2(input); payload.issues.push({ origin: origin2, code: "too_small", minimum: def2.minimum, inclusive: true, - input: input11, + input, inst, continue: !def2.abort }); }; }); $ZodCheckLengthEquals2 = /* @__PURE__ */ $constructor2("$ZodCheckLengthEquals", (inst, def2) => { - var _a5; + var _a3; $ZodCheck2.init(inst, def2); - (_a5 = inst._zod.def).when ?? (_a5.when = (payload) => { + (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => { const val = payload.value; return !nullish3(val) && val.length !== undefined; }); @@ -537813,11 +465227,11 @@ var init_checks4 = __esm(() => { bag.length = def2.length; }); inst._zod.check = (payload) => { - const input11 = payload.value; - const length = input11.length; + const input = payload.value; + const length = input.length; if (length === def2.length) return; - const origin2 = getLengthableOrigin2(input11); + const origin2 = getLengthableOrigin2(input); const tooBig = length > def2.length; payload.issues.push({ origin: origin2, @@ -537831,7 +465245,7 @@ var init_checks4 = __esm(() => { }; }); $ZodCheckStringFormat2 = /* @__PURE__ */ $constructor2("$ZodCheckStringFormat", (inst, def2) => { - var _a5, _b3; + var _a3, _b2; $ZodCheck2.init(inst, def2); inst._zod.onattach.push((inst2) => { const bag = inst2._zod.bag; @@ -537842,7 +465256,7 @@ var init_checks4 = __esm(() => { } }); if (def2.pattern) - (_a5 = inst._zod).check ?? (_a5.check = (payload) => { + (_a3 = inst._zod).check ?? (_a3.check = (payload) => { def2.pattern.lastIndex = 0; if (def2.pattern.test(payload.value)) return; @@ -537857,7 +465271,7 @@ var init_checks4 = __esm(() => { }); }); else - (_b3 = inst._zod).check ?? (_b3.check = () => {}); + (_b2 = inst._zod).check ?? (_b2.check = () => {}); }); $ZodCheckRegex2 = /* @__PURE__ */ $constructor2("$ZodCheckRegex", (inst, def2) => { $ZodCheckStringFormat2.init(inst, def2); @@ -537983,9 +465397,9 @@ class Doc2 { } const content = arg; const lines = content.split(` -`).filter((x4) => x4); - const minIndent = Math.min(...lines.map((x4) => x4.length - x4.trimStart().length)); - const dedented = lines.map((x4) => x4.slice(minIndent)).map((x4) => " ".repeat(this.indent * 2) + x4); +`).filter((x3) => x3); + const minIndent = Math.min(...lines.map((x3) => x3.length - x3.trimStart().length)); + const dedented = lines.map((x3) => x3.slice(minIndent)).map((x3) => " ".repeat(this.indent * 2) + x3); for (const line of dedented) { this.content.push(line); } @@ -537994,7 +465408,7 @@ class Doc2 { const F = Function; const args = this?.args; const content = this?.content ?? [``]; - const lines = [...content.map((x4) => ` ${x4}`)]; + const lines = [...content.map((x3) => ` ${x3}`)]; return new F(...args, lines.join(` `)); } @@ -538026,8 +465440,8 @@ function isValidBase642(data) { function isValidBase64URL2(data) { if (!base64url3.test(data)) return false; - const base645 = data.replace(/[-_]/g, (c6) => c6 === "-" ? "+" : "/"); - const padded = base645.padEnd(Math.ceil(base645.length / 4) * 4, "="); + const base644 = data.replace(/[-_]/g, (c6) => c6 === "-" ? "+" : "/"); + const padded = base644.padEnd(Math.ceil(base644.length / 4) * 4, "="); return isValidBase642(padded); } function isValidJWT4(token, algorithm = null) { @@ -538050,40 +465464,40 @@ function isValidJWT4(token, algorithm = null) { return false; } } -function handleArrayResult2(result3, final, index) { - if (result3.issues.length) { - final.issues.push(...prefixIssues2(index, result3.issues)); +function handleArrayResult2(result2, final, index) { + if (result2.issues.length) { + final.issues.push(...prefixIssues2(index, result2.issues)); } - final.value[index] = result3.value; + final.value[index] = result2.value; } -function handleObjectResult2(result3, final, key) { - if (result3.issues.length) { - final.issues.push(...prefixIssues2(key, result3.issues)); +function handleObjectResult2(result2, final, key) { + if (result2.issues.length) { + final.issues.push(...prefixIssues2(key, result2.issues)); } - final.value[key] = result3.value; + final.value[key] = result2.value; } -function handleOptionalObjectResult2(result3, final, key, input11) { - if (result3.issues.length) { - if (input11[key] === undefined) { - if (key in input11) { +function handleOptionalObjectResult2(result2, final, key, input) { + if (result2.issues.length) { + if (input[key] === undefined) { + if (key in input) { final.value[key] = undefined; } else { - final.value[key] = result3.value; + final.value[key] = result2.value; } } else { - final.issues.push(...prefixIssues2(key, result3.issues)); + final.issues.push(...prefixIssues2(key, result2.issues)); } - } else if (result3.value === undefined) { - if (key in input11) + } else if (result2.value === undefined) { + if (key in input) final.value[key] = undefined; } else { - final.value[key] = result3.value; + final.value[key] = result2.value; } } function handleUnionResults2(results, final, inst, ctx) { - for (const result3 of results) { - if (result3.issues.length === 0) { - final.value = result3.value; + for (const result2 of results) { + if (result2.issues.length === 0) { + final.value = result2.value; return final; } } @@ -538091,7 +465505,7 @@ function handleUnionResults2(results, final, inst, ctx) { code: "invalid_union", input: final.value, inst, - errors: results.map((result3) => result3.issues.map((iss) => finalizeIssue2(iss, ctx, config4()))) + errors: results.map((result2) => result2.issues.map((iss) => finalizeIssue2(iss, ctx, config2()))) }); return final; } @@ -538102,7 +465516,7 @@ function mergeValues4(a2, b) { if (a2 instanceof Date && b instanceof Date && +a2 === +b) { return { valid: true, data: a2 }; } - if (isPlainObject7(a2) && isPlainObject7(b)) { + if (isPlainObject6(a2) && isPlainObject6(b)) { const bKeys = Object.keys(b); const sharedKeys = Object.keys(a2).filter((key) => bKeys.indexOf(key) !== -1); const newObj = { ...a2, ...b }; @@ -538139,21 +465553,21 @@ function mergeValues4(a2, b) { } return { valid: false, mergeErrorPath: [] }; } -function handleIntersectionResults2(result3, left, right) { +function handleIntersectionResults2(result2, left, right) { if (left.issues.length) { - result3.issues.push(...left.issues); + result2.issues.push(...left.issues); } if (right.issues.length) { - result3.issues.push(...right.issues); + result2.issues.push(...right.issues); } - if (aborted3(result3)) - return result3; + if (aborted3(result2)) + return result2; const merged = mergeValues4(left.value, right.value); if (!merged.valid) { throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`); } - result3.value = merged.data; - return result3; + result2.value = merged.data; + return result2; } function handleDefaultResult2(payload, def2) { if (payload.value === undefined) { @@ -538182,11 +465596,11 @@ function handleReadonlyResult2(payload) { payload.value = Object.freeze(payload.value); return payload; } -function handleRefineResult2(result3, payload, input11, inst) { - if (!result3) { +function handleRefineResult2(result2, payload, input, inst) { + if (!result2) { const _iss = { code: "custom", - input: input11, + input, inst, path: [...inst._zod.def.path ?? []], continue: !inst._zod.def.abort @@ -538197,16 +465611,16 @@ function handleRefineResult2(result3, payload, input11, inst) { } } var $ZodType2, $ZodString2, $ZodStringFormat2, $ZodGUID2, $ZodUUID2, $ZodEmail2, $ZodURL2, $ZodEmoji2, $ZodNanoID2, $ZodCUID3, $ZodCUID22, $ZodULID2, $ZodXID2, $ZodKSUID2, $ZodISODateTime2, $ZodISODate2, $ZodISOTime2, $ZodISODuration2, $ZodIPv42, $ZodIPv62, $ZodCIDRv42, $ZodCIDRv62, $ZodBase642, $ZodBase64URL2, $ZodE1642, $ZodJWT2, $ZodNumber2, $ZodNumberFormat2, $ZodBoolean2, $ZodNull2, $ZodUnknown2, $ZodNever2, $ZodArray2, $ZodObject2, $ZodUnion2, $ZodDiscriminatedUnion2, $ZodIntersection2, $ZodRecord2, $ZodEnum2, $ZodLiteral2, $ZodTransform2, $ZodOptional2, $ZodNullable2, $ZodDefault2, $ZodPrefault2, $ZodNonOptional2, $ZodCatch2, $ZodPipe2, $ZodReadonly2, $ZodCustom2; -var init_schemas7 = __esm(() => { +var init_schemas6 = __esm(() => { init_checks4(); init_core5(); - init_parse6(); + init_parse5(); init_regexes2(); - init_util7(); + init_util6(); init_versions2(); - init_util7(); + init_util6(); $ZodType2 = /* @__PURE__ */ $constructor2("$ZodType", (inst, def2) => { - var _a5; + var _a3; inst ?? (inst = {}); inst._zod.def = def2; inst._zod.bag = inst._zod.bag || {}; @@ -538221,7 +465635,7 @@ var init_schemas7 = __esm(() => { } } if (checks4.length === 0) { - (_a5 = inst._zod).deferred ?? (_a5.deferred = []); + (_a3 = inst._zod).deferred ?? (_a3.deferred = []); inst._zod.deferred?.push(() => { inst._zod.run = inst._zod.parse; }); @@ -538267,13 +465681,13 @@ var init_schemas7 = __esm(() => { return payload; }; inst._zod.run = (payload, ctx) => { - const result3 = inst._zod.parse(payload, ctx); - if (result3 instanceof Promise) { + const result2 = inst._zod.parse(payload, ctx); + if (result2 instanceof Promise) { if (ctx.async === false) throw new $ZodAsyncError2; - return result3.then((result4) => runChecks(result4, checks4, ctx)); + return result2.then((result3) => runChecks(result3, checks4, ctx)); } - return runChecks(result3, checks4, ctx); + return runChecks(result2, checks4, ctx); }; } inst["~standard"] = { @@ -538331,9 +465745,9 @@ var init_schemas7 = __esm(() => { const v = versionMap[def2.version]; if (v === undefined) throw new Error(`Invalid UUID version: "${def2.version}"`); - def2.pattern ?? (def2.pattern = uuid5(v)); + def2.pattern ?? (def2.pattern = uuid3(v)); } else - def2.pattern ?? (def2.pattern = uuid5()); + def2.pattern ?? (def2.pattern = uuid3()); $ZodStringFormat2.init(inst, def2); }); $ZodEmail2 = /* @__PURE__ */ $constructor2("$ZodEmail", (inst, def2) => { @@ -538495,7 +465909,7 @@ var init_schemas7 = __esm(() => { }; }); $ZodBase642 = /* @__PURE__ */ $constructor2("$ZodBase64", (inst, def2) => { - def2.pattern ?? (def2.pattern = base644); + def2.pattern ?? (def2.pattern = base643); $ZodStringFormat2.init(inst, def2); inst._zod.onattach.push((inst2) => { inst2._zod.bag.contentEncoding = "base64"; @@ -538556,15 +465970,15 @@ var init_schemas7 = __esm(() => { try { payload.value = Number(payload.value); } catch (_) {} - const input11 = payload.value; - if (typeof input11 === "number" && !Number.isNaN(input11) && Number.isFinite(input11)) { + const input = payload.value; + if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) { return payload; } - const received = typeof input11 === "number" ? Number.isNaN(input11) ? "NaN" : !Number.isFinite(input11) ? "Infinity" : undefined : undefined; + const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : undefined : undefined; payload.issues.push({ expected: "number", code: "invalid_type", - input: input11, + input, inst, ...received ? { received } : {} }); @@ -538583,13 +465997,13 @@ var init_schemas7 = __esm(() => { try { payload.value = Boolean(payload.value); } catch (_) {} - const input11 = payload.value; - if (typeof input11 === "boolean") + const input = payload.value; + if (typeof input === "boolean") return payload; payload.issues.push({ expected: "boolean", code: "invalid_type", - input: input11, + input, inst }); return payload; @@ -538600,13 +466014,13 @@ var init_schemas7 = __esm(() => { inst._zod.pattern = _null4; inst._zod.values = new Set([null]); inst._zod.parse = (payload, _ctx) => { - const input11 = payload.value; - if (input11 === null) + const input = payload.value; + if (input === null) return payload; payload.issues.push({ expected: "null", code: "invalid_type", - input: input11, + input, inst }); return payload; @@ -538631,28 +466045,28 @@ var init_schemas7 = __esm(() => { $ZodArray2 = /* @__PURE__ */ $constructor2("$ZodArray", (inst, def2) => { $ZodType2.init(inst, def2); inst._zod.parse = (payload, ctx) => { - const input11 = payload.value; - if (!Array.isArray(input11)) { + const input = payload.value; + if (!Array.isArray(input)) { payload.issues.push({ expected: "array", code: "invalid_type", - input: input11, + input, inst }); return payload; } - payload.value = Array(input11.length); + payload.value = Array(input.length); const proms = []; - for (let i4 = 0;i4 < input11.length; i4++) { - const item = input11[i4]; - const result3 = def2.element._zod.run({ + for (let i3 = 0;i3 < input.length; i3++) { + const item = input[i3]; + const result2 = def2.element._zod.run({ value: item, issues: [] }, ctx); - if (result3 instanceof Promise) { - proms.push(result3.then((result4) => handleArrayResult2(result4, payload, i4))); + if (result2 instanceof Promise) { + proms.push(result2.then((result3) => handleArrayResult2(result3, payload, i3))); } else { - handleArrayResult2(result3, payload, i4); + handleArrayResult2(result2, payload, i3); } } if (proms.length) { @@ -538664,8 +466078,8 @@ var init_schemas7 = __esm(() => { $ZodObject2 = /* @__PURE__ */ $constructor2("$ZodObject", (inst, def2) => { $ZodType2.init(inst, def2); const _normalized = cached4(() => { - const keys3 = Object.keys(def2.shape); - for (const k of keys3) { + const keys2 = Object.keys(def2.shape); + for (const k of keys2) { if (!(def2.shape[k] instanceof $ZodType2)) { throw new Error(`Invalid element at key "${k}": expected a Zod schema`); } @@ -538673,9 +466087,9 @@ var init_schemas7 = __esm(() => { const okeys = optionalKeys2(def2.shape); return { shape: def2.shape, - keys: keys3, - keySet: new Set(keys3), - numKeys: keys3.length, + keys: keys2, + keySet: new Set(keys2), + numKeys: keys2.length, optionalKeys: new Set(okeys) }; }); @@ -538748,7 +466162,7 @@ var init_schemas7 = __esm(() => { return (payload, ctx) => fn(shape, payload, ctx); }; let fastpass; - const isObject7 = isObject6; + const isObject6 = isObject5; const jit = !globalConfig2.jitless; const allowsEval3 = allowsEval2; const fastEnabled = jit && allowsEval3.value; @@ -538756,12 +466170,12 @@ var init_schemas7 = __esm(() => { let value; inst._zod.parse = (payload, ctx) => { value ?? (value = _normalized.value); - const input11 = payload.value; - if (!isObject7(input11)) { + const input = payload.value; + if (!isObject6(input)) { payload.issues.push({ expected: "object", code: "invalid_type", - input: input11, + input, inst }); return payload; @@ -538776,12 +466190,12 @@ var init_schemas7 = __esm(() => { const shape = value.shape; for (const key of value.keys) { const el = shape[key]; - const r = el._zod.run({ value: input11[key], issues: [] }, ctx); + const r = el._zod.run({ value: input[key], issues: [] }, ctx); const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional"; if (r instanceof Promise) { - proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult2(r2, payload, key, input11) : handleObjectResult2(r2, payload, key))); + proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult2(r2, payload, key, input) : handleObjectResult2(r2, payload, key))); } else if (isOptional) { - handleOptionalObjectResult2(r, payload, key, input11); + handleOptionalObjectResult2(r, payload, key, input); } else { handleObjectResult2(r, payload, key); } @@ -538794,14 +466208,14 @@ var init_schemas7 = __esm(() => { const keySet = value.keySet; const _catchall = catchall._zod; const t = _catchall.def.type; - for (const key of Object.keys(input11)) { + for (const key of Object.keys(input)) { if (keySet.has(key)) continue; if (t === "never") { unrecognized.push(key); continue; } - const r = _catchall.run({ value: input11[key], issues: [] }, ctx); + const r = _catchall.run({ value: input[key], issues: [] }, ctx); if (r instanceof Promise) { proms.push(r.then((r2) => handleObjectResult2(r2, payload, key))); } else { @@ -538812,7 +466226,7 @@ var init_schemas7 = __esm(() => { payload.issues.push({ code: "unrecognized_keys", keys: unrecognized, - input: input11, + input, inst }); } @@ -538844,17 +466258,17 @@ var init_schemas7 = __esm(() => { let async = false; const results = []; for (const option of def2.options) { - const result3 = option._zod.run({ + const result2 = option._zod.run({ value: payload.value, issues: [] }, ctx); - if (result3 instanceof Promise) { - results.push(result3); + if (result2 instanceof Promise) { + results.push(result2); async = true; } else { - if (result3.issues.length === 0) - return result3; - results.push(result3); + if (result2.issues.length === 0) + return result2; + results.push(result2); } } if (!async) @@ -538885,32 +466299,32 @@ var init_schemas7 = __esm(() => { }); const disc = cached4(() => { const opts = def2.options; - const map6 = new Map; + const map4 = new Map; for (const o2 of opts) { - const values4 = o2._zod.propValues[def2.discriminator]; - if (!values4 || values4.size === 0) + const values2 = o2._zod.propValues[def2.discriminator]; + if (!values2 || values2.size === 0) throw new Error(`Invalid discriminated union option at index "${def2.options.indexOf(o2)}"`); - for (const v of values4) { - if (map6.has(v)) { + for (const v of values2) { + if (map4.has(v)) { throw new Error(`Duplicate discriminator value "${String(v)}"`); } - map6.set(v, o2); + map4.set(v, o2); } } - return map6; + return map4; }); inst._zod.parse = (payload, ctx) => { - const input11 = payload.value; - if (!isObject6(input11)) { + const input = payload.value; + if (!isObject5(input)) { payload.issues.push({ code: "invalid_type", expected: "object", - input: input11, + input, inst }); return payload; } - const opt = disc.value.get(input11?.[def2.discriminator]); + const opt = disc.value.get(input?.[def2.discriminator]); if (opt) { return opt._zod.run(payload, ctx); } @@ -538921,7 +466335,7 @@ var init_schemas7 = __esm(() => { code: "invalid_union", errors: [], note: "No matching discriminator", - input: input11, + input, path: [def2.discriminator], inst }); @@ -538931,9 +466345,9 @@ var init_schemas7 = __esm(() => { $ZodIntersection2 = /* @__PURE__ */ $constructor2("$ZodIntersection", (inst, def2) => { $ZodType2.init(inst, def2); inst._zod.parse = (payload, ctx) => { - const input11 = payload.value; - const left = def2.left._zod.run({ value: input11, issues: [] }, ctx); - const right = def2.right._zod.run({ value: input11, issues: [] }, ctx); + const input = payload.value; + const left = def2.left._zod.run({ value: input, issues: [] }, ctx); + const right = def2.right._zod.run({ value: input, issues: [] }, ctx); const async = left instanceof Promise || right instanceof Promise; if (async) { return Promise.all([left, right]).then(([left2, right2]) => { @@ -538946,41 +466360,41 @@ var init_schemas7 = __esm(() => { $ZodRecord2 = /* @__PURE__ */ $constructor2("$ZodRecord", (inst, def2) => { $ZodType2.init(inst, def2); inst._zod.parse = (payload, ctx) => { - const input11 = payload.value; - if (!isPlainObject7(input11)) { + const input = payload.value; + if (!isPlainObject6(input)) { payload.issues.push({ expected: "record", code: "invalid_type", - input: input11, + input, inst }); return payload; } const proms = []; if (def2.keyType._zod.values) { - const values4 = def2.keyType._zod.values; + const values2 = def2.keyType._zod.values; payload.value = {}; - for (const key of values4) { + for (const key of values2) { if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { - const result3 = def2.valueType._zod.run({ value: input11[key], issues: [] }, ctx); - if (result3 instanceof Promise) { - proms.push(result3.then((result4) => { - if (result4.issues.length) { - payload.issues.push(...prefixIssues2(key, result4.issues)); + const result2 = def2.valueType._zod.run({ value: input[key], issues: [] }, ctx); + if (result2 instanceof Promise) { + proms.push(result2.then((result3) => { + if (result3.issues.length) { + payload.issues.push(...prefixIssues2(key, result3.issues)); } - payload.value[key] = result4.value; + payload.value[key] = result3.value; })); } else { - if (result3.issues.length) { - payload.issues.push(...prefixIssues2(key, result3.issues)); + if (result2.issues.length) { + payload.issues.push(...prefixIssues2(key, result2.issues)); } - payload.value[key] = result3.value; + payload.value[key] = result2.value; } } } let unrecognized; - for (const key in input11) { - if (!values4.has(key)) { + for (const key in input) { + if (!values2.has(key)) { unrecognized = unrecognized ?? []; unrecognized.push(key); } @@ -538988,14 +466402,14 @@ var init_schemas7 = __esm(() => { if (unrecognized && unrecognized.length > 0) { payload.issues.push({ code: "unrecognized_keys", - input: input11, + input, inst, keys: unrecognized }); } } else { payload.value = {}; - for (const key of Reflect.ownKeys(input11)) { + for (const key of Reflect.ownKeys(input)) { if (key === "__proto__") continue; const keyResult = def2.keyType._zod.run({ value: key, issues: [] }, ctx); @@ -539006,7 +466420,7 @@ var init_schemas7 = __esm(() => { payload.issues.push({ origin: "record", code: "invalid_key", - issues: keyResult.issues.map((iss) => finalizeIssue2(iss, ctx, config4())), + issues: keyResult.issues.map((iss) => finalizeIssue2(iss, ctx, config2())), input: key, path: [key], inst @@ -539014,19 +466428,19 @@ var init_schemas7 = __esm(() => { payload.value[keyResult.value] = keyResult.value; continue; } - const result3 = def2.valueType._zod.run({ value: input11[key], issues: [] }, ctx); - if (result3 instanceof Promise) { - proms.push(result3.then((result4) => { - if (result4.issues.length) { - payload.issues.push(...prefixIssues2(key, result4.issues)); + const result2 = def2.valueType._zod.run({ value: input[key], issues: [] }, ctx); + if (result2 instanceof Promise) { + proms.push(result2.then((result3) => { + if (result3.issues.length) { + payload.issues.push(...prefixIssues2(key, result3.issues)); } - payload.value[keyResult.value] = result4.value; + payload.value[keyResult.value] = result3.value; })); } else { - if (result3.issues.length) { - payload.issues.push(...prefixIssues2(key, result3.issues)); + if (result2.issues.length) { + payload.issues.push(...prefixIssues2(key, result2.issues)); } - payload.value[keyResult.value] = result3.value; + payload.value[keyResult.value] = result2.value; } } } @@ -539038,18 +466452,18 @@ var init_schemas7 = __esm(() => { }); $ZodEnum2 = /* @__PURE__ */ $constructor2("$ZodEnum", (inst, def2) => { $ZodType2.init(inst, def2); - const values4 = getEnumValues2(def2.entries); - inst._zod.values = new Set(values4); - inst._zod.pattern = new RegExp(`^(${values4.filter((k) => propertyKeyTypes2.has(typeof k)).map((o2) => typeof o2 === "string" ? escapeRegex2(o2) : o2.toString()).join("|")})$`); + const values2 = getEnumValues2(def2.entries); + inst._zod.values = new Set(values2); + inst._zod.pattern = new RegExp(`^(${values2.filter((k) => propertyKeyTypes2.has(typeof k)).map((o2) => typeof o2 === "string" ? escapeRegex2(o2) : o2.toString()).join("|")})$`); inst._zod.parse = (payload, _ctx) => { - const input11 = payload.value; - if (inst._zod.values.has(input11)) { + const input = payload.value; + if (inst._zod.values.has(input)) { return payload; } payload.issues.push({ code: "invalid_value", - values: values4, - input: input11, + values: values2, + input, inst }); return payload; @@ -539060,14 +466474,14 @@ var init_schemas7 = __esm(() => { inst._zod.values = new Set(def2.values); inst._zod.pattern = new RegExp(`^(${def2.values.map((o2) => typeof o2 === "string" ? escapeRegex2(o2) : o2 ? o2.toString() : String(o2)).join("|")})$`); inst._zod.parse = (payload, _ctx) => { - const input11 = payload.value; - if (inst._zod.values.has(input11)) { + const input = payload.value; + if (inst._zod.values.has(input)) { return payload; } payload.issues.push({ code: "invalid_value", values: def2.values, - input: input11, + input, inst }); return payload; @@ -539138,11 +466552,11 @@ var init_schemas7 = __esm(() => { payload.value = def2.defaultValue; return payload; } - const result3 = def2.innerType._zod.run(payload, ctx); - if (result3 instanceof Promise) { - return result3.then((result4) => handleDefaultResult2(result4, def2)); + const result2 = def2.innerType._zod.run(payload, ctx); + if (result2 instanceof Promise) { + return result2.then((result3) => handleDefaultResult2(result3, def2)); } - return handleDefaultResult2(result3, def2); + return handleDefaultResult2(result2, def2); }; }); $ZodPrefault2 = /* @__PURE__ */ $constructor2("$ZodPrefault", (inst, def2) => { @@ -539160,14 +466574,14 @@ var init_schemas7 = __esm(() => { $ZodType2.init(inst, def2); defineLazy2(inst._zod, "values", () => { const v = def2.innerType._zod.values; - return v ? new Set([...v].filter((x4) => x4 !== undefined)) : undefined; + return v ? new Set([...v].filter((x3) => x3 !== undefined)) : undefined; }); inst._zod.parse = (payload, ctx) => { - const result3 = def2.innerType._zod.run(payload, ctx); - if (result3 instanceof Promise) { - return result3.then((result4) => handleNonOptionalResult2(result4, inst)); + const result2 = def2.innerType._zod.run(payload, ctx); + if (result2 instanceof Promise) { + return result2.then((result3) => handleNonOptionalResult2(result3, inst)); } - return handleNonOptionalResult2(result3, inst); + return handleNonOptionalResult2(result2, inst); }; }); $ZodCatch2 = /* @__PURE__ */ $constructor2("$ZodCatch", (inst, def2) => { @@ -539176,15 +466590,15 @@ var init_schemas7 = __esm(() => { defineLazy2(inst._zod, "optout", () => def2.innerType._zod.optout); defineLazy2(inst._zod, "values", () => def2.innerType._zod.values); inst._zod.parse = (payload, ctx) => { - const result3 = def2.innerType._zod.run(payload, ctx); - if (result3 instanceof Promise) { - return result3.then((result4) => { - payload.value = result4.value; - if (result4.issues.length) { + const result2 = def2.innerType._zod.run(payload, ctx); + if (result2 instanceof Promise) { + return result2.then((result3) => { + payload.value = result3.value; + if (result3.issues.length) { payload.value = def2.catchValue({ ...payload, error: { - issues: result4.issues.map((iss) => finalizeIssue2(iss, ctx, config4())) + issues: result3.issues.map((iss) => finalizeIssue2(iss, ctx, config2())) }, input: payload.value }); @@ -539193,12 +466607,12 @@ var init_schemas7 = __esm(() => { return payload; }); } - payload.value = result3.value; - if (result3.issues.length) { + payload.value = result2.value; + if (result2.issues.length) { payload.value = def2.catchValue({ ...payload, error: { - issues: result3.issues.map((iss) => finalizeIssue2(iss, ctx, config4())) + issues: result2.issues.map((iss) => finalizeIssue2(iss, ctx, config2())) }, input: payload.value }); @@ -539227,11 +466641,11 @@ var init_schemas7 = __esm(() => { defineLazy2(inst._zod, "optin", () => def2.innerType._zod.optin); defineLazy2(inst._zod, "optout", () => def2.innerType._zod.optout); inst._zod.parse = (payload, ctx) => { - const result3 = def2.innerType._zod.run(payload, ctx); - if (result3 instanceof Promise) { - return result3.then(handleReadonlyResult2); + const result2 = def2.innerType._zod.run(payload, ctx); + if (result2 instanceof Promise) { + return result2.then(handleReadonlyResult2); } - return handleReadonlyResult2(result3); + return handleReadonlyResult2(result2); }; }); $ZodCustom2 = /* @__PURE__ */ $constructor2("$ZodCustom", (inst, def2) => { @@ -539241,12 +466655,12 @@ var init_schemas7 = __esm(() => { return payload; }; inst._zod.check = (payload) => { - const input11 = payload.value; - const r = def2.fn(input11); + const input = payload.value; + const r = def2.fn(input); if (r instanceof Promise) { - return r.then((r2) => handleRefineResult2(r2, payload, input11, inst)); + return r.then((r2) => handleRefineResult2(r2, payload, input, inst)); } - handleRefineResult2(r, payload, input11, inst); + handleRefineResult2(r, payload, input, inst); return; }; }); @@ -539254,38 +466668,38 @@ var init_schemas7 = __esm(() => { // ../node_modules/zod/v4/locales/ar.js var init_ar2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/az.js var init_az2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/be.js var init_be2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ca.js var init_ca2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/cs.js var init_cs2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/de.js var init_de2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/en.js function en_default4() { return { - localeError: error45() + localeError: error41() }; } var parsedType4 = (data) => { @@ -539307,7 +466721,7 @@ var parsedType4 = (data) => { } } return t; -}, error45 = () => { +}, error41 = () => { const Sizable = { string: { unit: "characters", verb: "to have" }, file: { unit: "bytes", verb: "to have" }, @@ -539399,167 +466813,167 @@ var parsedType4 = (data) => { }; }; var init_en4 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/eo.js var init_eo2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/es.js var init_es3 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/fa.js var init_fa2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/fi.js var init_fi2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/fr.js var init_fr2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/fr-CA.js var init_fr_CA2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/he.js var init_he2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/hu.js var init_hu2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/id.js var init_id2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/it.js var init_it2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ja.js var init_ja2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/kh.js var init_kh2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ko.js var init_ko2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/mk.js var init_mk2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ms.js var init_ms2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/nl.js var init_nl2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/no.js var init_no2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ota.js var init_ota2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ps.js var init_ps2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/pl.js var init_pl2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/pt.js var init_pt2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ru.js var init_ru2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/sl.js var init_sl2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/sv.js var init_sv2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ta.js var init_ta2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/th.js var init_th2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/tr.js var init_tr2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ua.js var init_ua2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/ur.js var init_ur2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/vi.js var init_vi2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/zh-CN.js var init_zh_CN2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/zh-TW.js var init_zh_TW2 = __esm(() => { - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/locales/index.js @@ -540024,12 +467438,12 @@ function _uppercase2(params) { ...normalizeParams2(params) }); } -function _includes2(includes3, params) { +function _includes2(includes2, params) { return new $ZodCheckIncludes2({ check: "string_format", format: "includes", ...normalizeParams2(params), - includes: includes3 + includes: includes2 }); } function _startsWith2(prefix, params) { @@ -540055,16 +467469,16 @@ function _overwrite2(tx) { }); } function _normalize2(form) { - return _overwrite2((input11) => input11.normalize(form)); + return _overwrite2((input) => input.normalize(form)); } function _trim2() { - return _overwrite2((input11) => input11.trim()); + return _overwrite2((input) => input.trim()); } function _toLowerCase2() { - return _overwrite2((input11) => input11.toLowerCase()); + return _overwrite2((input) => input.toLowerCase()); } function _toUpperCase2() { - return _overwrite2((input11) => input11.toUpperCase()); + return _overwrite2((input) => input.toUpperCase()); } function _array2(Class3, element, params) { return new Class3({ @@ -540095,22 +467509,22 @@ function _refine2(Class3, fn, _params) { } var init_api3 = __esm(() => { init_checks4(); - init_schemas7(); - init_util7(); + init_schemas6(); + init_util6(); }); // ../node_modules/zod/v4/core/function.js -var init_function4 = __esm(() => { +var init_function3 = __esm(() => { init_api3(); - init_parse6(); - init_schemas7(); - init_schemas7(); + init_parse5(); + init_schemas6(); + init_schemas6(); }); // ../node_modules/zod/v4/core/to-json-schema.js var init_to_json_schema2 = __esm(() => { init_registries2(); - init_util7(); + init_util6(); }); // ../node_modules/zod/v4/core/json-schema.js @@ -540119,31 +467533,31 @@ var init_json_schema2 = () => {}; // ../node_modules/zod/v4/core/index.js var init_core6 = __esm(() => { init_core5(); - init_parse6(); + init_parse5(); init_errors8(); - init_schemas7(); + init_schemas6(); init_checks4(); init_versions2(); - init_util7(); + init_util6(); init_regexes2(); init_locales2(); init_registries2(); - init_function4(); + init_function3(); init_api3(); init_to_json_schema2(); init_json_schema2(); }); // ../node_modules/zod/v4/mini/parse.js -var init_parse7 = __esm(() => { +var init_parse6 = __esm(() => { init_core6(); }); // ../node_modules/zod/v4/mini/schemas.js -var init_schemas8 = __esm(() => { +var init_schemas7 = __esm(() => { init_core6(); init_core6(); - init_parse7(); + init_parse6(); }); // ../node_modules/zod/v4/mini/checks.js @@ -540154,20 +467568,20 @@ var init_checks5 = __esm(() => { // ../node_modules/zod/v4/mini/iso.js var init_iso3 = __esm(() => { init_core6(); - init_schemas8(); + init_schemas7(); }); // ../node_modules/zod/v4/mini/coerce.js var init_coerce3 = __esm(() => { init_core6(); - init_schemas8(); + init_schemas7(); }); // ../node_modules/zod/v4/mini/external.js var init_external5 = __esm(() => { init_core6(); - init_parse7(); - init_schemas8(); + init_parse6(); + init_schemas7(); init_checks5(); init_core6(); init_locales2(); @@ -540194,12 +467608,12 @@ function isZ4Schema2(s) { } function safeParse5(schema, data) { if (isZ4Schema2(schema)) { - const result4 = safeParse4(schema, data); - return result4; + const result3 = safeParse4(schema, data); + return result3; } const v3Schema = schema; - const result3 = v3Schema.safeParse(data); - return result3; + const result2 = v3Schema.safeParse(data); + return result2; } function getObjectShape2(schema) { if (!schema) @@ -540286,7 +467700,7 @@ function duration4(params) { var ZodISODateTime2, ZodISODate2, ZodISOTime2, ZodISODuration2; var init_iso4 = __esm(() => { init_core6(); - init_schemas9(); + init_schemas8(); ZodISODateTime2 = /* @__PURE__ */ $constructor2("ZodISODateTime", (inst, def2) => { $ZodISODateTime2.init(inst, def2); ZodStringFormat2.init(inst, def2); @@ -540340,7 +467754,7 @@ var init_errors9 = __esm(() => { // ../node_modules/zod/v4/classic/parse.js var parse13, parseAsync4, safeParse6, safeParseAsync4; -var init_parse8 = __esm(() => { +var init_parse7 = __esm(() => { init_core6(); init_errors9(); parse13 = /* @__PURE__ */ _parse2(ZodRealError2); @@ -540396,7 +467810,7 @@ function looseObject2(shape, params) { ...exports_util2.normalizeParams(params) }); } -function union5(options2, params) { +function union4(options2, params) { return new ZodUnion4({ type: "union", options: options2, @@ -540411,7 +467825,7 @@ function discriminatedUnion2(discriminator, options2, params) { ...exports_util2.normalizeParams(params) }); } -function intersection5(left, right) { +function intersection4(left, right) { return new ZodIntersection4({ type: "intersection", left, @@ -540426,8 +467840,8 @@ function record3(keyType, valueType, params) { ...exports_util2.normalizeParams(params) }); } -function _enum3(values4, params) { - const entries = Array.isArray(values4) ? Object.fromEntries(values4.map((v) => [v, v])) : values4; +function _enum3(values2, params) { + const entries = Array.isArray(values2) ? Object.fromEntries(values2.map((v) => [v, v])) : values2; return new ZodEnum4({ type: "enum", entries, @@ -540441,7 +467855,7 @@ function literal3(value, params) { ...exports_util2.normalizeParams(params) }); } -function transform4(fn) { +function transform3(fn) { return new ZodTransform2({ type: "transform", transform: fn @@ -540511,7 +467925,7 @@ function check3(fn) { ch2._zod.check = fn; return ch2; } -function custom4(fn, _params) { +function custom3(fn, _params) { return _custom2(ZodCustom2, fn ?? (() => true), _params); } function refine2(fn, _params = {}) { @@ -540538,15 +467952,15 @@ function superRefine2(fn) { return ch2; } function preprocess2(fn, schema) { - return pipe2(transform4(fn), schema); + return pipe2(transform3(fn), schema); } var ZodType4, _ZodString2, ZodString4, ZodStringFormat2, ZodEmail2, ZodGUID2, ZodUUID2, ZodURL2, ZodEmoji2, ZodNanoID2, ZodCUID3, ZodCUID22, ZodULID2, ZodXID2, ZodKSUID2, ZodIPv42, ZodIPv62, ZodCIDRv42, ZodCIDRv62, ZodBase642, ZodBase64URL2, ZodE1642, ZodJWT2, ZodNumber4, ZodNumberFormat2, ZodBoolean4, ZodNull4, ZodUnknown4, ZodNever4, ZodArray4, ZodObject4, ZodUnion4, ZodDiscriminatedUnion4, ZodIntersection4, ZodRecord4, ZodEnum4, ZodLiteral4, ZodTransform2, ZodOptional4, ZodNullable4, ZodDefault4, ZodPrefault2, ZodNonOptional2, ZodCatch4, ZodPipe2, ZodReadonly4, ZodCustom2; -var init_schemas9 = __esm(() => { +var init_schemas8 = __esm(() => { init_core6(); init_core6(); init_checks6(); init_iso4(); - init_parse8(); + init_parse7(); ZodType4 = /* @__PURE__ */ $constructor2("ZodType", (inst, def2) => { $ZodType2.init(inst, def2); inst.def = def2; @@ -540560,7 +467974,7 @@ var init_schemas9 = __esm(() => { ] }); }; - inst.clone = (def3, params) => clone5(inst, def3, params); + inst.clone = (def3, params) => clone4(inst, def3, params); inst.brand = () => inst; inst.register = (reg, meta) => { reg.add(inst, meta); @@ -540579,9 +467993,9 @@ var init_schemas9 = __esm(() => { inst.nullish = () => optional3(nullable3(inst)); inst.nonoptional = (params) => nonoptional2(inst, params); inst.array = () => array3(inst); - inst.or = (arg) => union5([inst, arg]); - inst.and = (arg) => intersection5(inst, arg); - inst.transform = (tx) => pipe2(inst, transform4(tx)); + inst.or = (arg) => union4([inst, arg]); + inst.and = (arg) => intersection4(inst, arg); + inst.transform = (tx) => pipe2(inst, transform3(tx)); inst.default = (def3) => _default3(inst, def3); inst.prefault = (def3) => prefault2(inst, def3); inst.catch = (params) => _catch3(inst, params); @@ -540841,11 +468255,11 @@ var init_schemas9 = __esm(() => { ZodType4.init(inst, def2); inst.enum = def2.entries; inst.options = Object.values(def2.entries); - const keys3 = new Set(Object.keys(def2.entries)); - inst.extract = (values4, params) => { + const keys2 = new Set(Object.keys(def2.entries)); + inst.extract = (values2, params) => { const newEntries = {}; - for (const value of values4) { - if (keys3.has(value)) { + for (const value of values2) { + if (keys2.has(value)) { newEntries[value] = def2.entries[value]; } else throw new Error(`Key ${value} not found in enum`); @@ -540857,10 +468271,10 @@ var init_schemas9 = __esm(() => { entries: newEntries }); }; - inst.exclude = (values4, params) => { + inst.exclude = (values2, params) => { const newEntries = { ...def2.entries }; - for (const value of values4) { - if (keys3.has(value)) { + for (const value of values2) { + if (keys2.has(value)) { delete newEntries[value]; } else throw new Error(`Key ${value} not found in enum`); @@ -540972,16 +468386,16 @@ var init_compat2 = __esm(() => { // ../node_modules/zod/v4/classic/coerce.js var init_coerce4 = __esm(() => { init_core6(); - init_schemas9(); + init_schemas8(); }); // ../node_modules/zod/v4/classic/external.js var init_external6 = __esm(() => { init_core6(); - init_schemas9(); + init_schemas8(); init_checks6(); init_errors9(); - init_parse8(); + init_parse7(); init_compat2(); init_core6(); init_en4(); @@ -540990,7 +468404,7 @@ var init_external6 = __esm(() => { init_iso4(); init_iso4(); init_coerce4(); - config4(en_default4()); + config2(en_default4()); }); // ../node_modules/zod/v4/classic/index.js @@ -541007,11 +468421,11 @@ var init_v42 = __esm(() => { // ../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js var LATEST_PROTOCOL_VERSION2 = "2025-11-25", SUPPORTED_PROTOCOL_VERSIONS2, RELATED_TASK_META_KEY2 = "io.modelcontextprotocol/related-task", JSONRPC_VERSION2 = "2.0", AssertObjectSchema2, ProgressTokenSchema2, CursorSchema2, TaskCreationParamsSchema2, TaskMetadataSchema2, RelatedTaskMetadataSchema2, RequestMetaSchema2, BaseRequestParamsSchema2, TaskAugmentedRequestParamsSchema2, isTaskAugmentedRequestParams2 = (value) => TaskAugmentedRequestParamsSchema2.safeParse(value).success, RequestSchema2, NotificationsParamsSchema2, NotificationSchema2, ResultSchema2, RequestIdSchema2, JSONRPCRequestSchema2, isJSONRPCRequest2 = (value) => JSONRPCRequestSchema2.safeParse(value).success, JSONRPCNotificationSchema2, isJSONRPCNotification2 = (value) => JSONRPCNotificationSchema2.safeParse(value).success, JSONRPCResultResponseSchema2, isJSONRPCResultResponse2 = (value) => JSONRPCResultResponseSchema2.safeParse(value).success, ErrorCode2, JSONRPCErrorResponseSchema2, isJSONRPCErrorResponse2 = (value) => JSONRPCErrorResponseSchema2.safeParse(value).success, JSONRPCMessageSchema2, JSONRPCResponseSchema2, EmptyResultSchema2, CancelledNotificationParamsSchema2, CancelledNotificationSchema2, IconSchema2, IconsSchema2, BaseMetadataSchema2, ImplementationSchema2, FormElicitationCapabilitySchema2, ElicitationCapabilitySchema2, ClientTasksCapabilitySchema2, ServerTasksCapabilitySchema2, ClientCapabilitiesSchema2, InitializeRequestParamsSchema2, InitializeRequestSchema2, ServerCapabilitiesSchema2, InitializeResultSchema2, InitializedNotificationSchema2, PingRequestSchema2, ProgressSchema2, ProgressNotificationParamsSchema2, ProgressNotificationSchema2, PaginatedRequestParamsSchema2, PaginatedRequestSchema2, PaginatedResultSchema2, TaskStatusSchema3, TaskSchema3, CreateTaskResultSchema2, TaskStatusNotificationParamsSchema2, TaskStatusNotificationSchema2, GetTaskRequestSchema2, GetTaskResultSchema2, GetTaskPayloadRequestSchema2, GetTaskPayloadResultSchema2, ListTasksRequestSchema2, ListTasksResultSchema2, CancelTaskRequestSchema2, CancelTaskResultSchema2, ResourceContentsSchema2, TextResourceContentsSchema2, Base64Schema2, BlobResourceContentsSchema2, RoleSchema2, AnnotationsSchema2, ResourceSchema2, ResourceTemplateSchema2, ListResourcesRequestSchema2, ListResourcesResultSchema2, ListResourceTemplatesRequestSchema2, ListResourceTemplatesResultSchema2, ResourceRequestParamsSchema2, ReadResourceRequestParamsSchema2, ReadResourceRequestSchema2, ReadResourceResultSchema2, ResourceListChangedNotificationSchema2, SubscribeRequestParamsSchema2, SubscribeRequestSchema2, UnsubscribeRequestParamsSchema2, UnsubscribeRequestSchema2, ResourceUpdatedNotificationParamsSchema2, ResourceUpdatedNotificationSchema2, PromptArgumentSchema2, PromptSchema2, ListPromptsRequestSchema2, ListPromptsResultSchema2, GetPromptRequestParamsSchema2, GetPromptRequestSchema2, TextContentSchema2, ImageContentSchema2, AudioContentSchema2, ToolUseContentSchema2, EmbeddedResourceSchema2, ResourceLinkSchema2, ContentBlockSchema2, PromptMessageSchema2, GetPromptResultSchema2, PromptListChangedNotificationSchema2, ToolAnnotationsSchema2, ToolExecutionSchema2, ToolSchema2, ListToolsRequestSchema2, ListToolsResultSchema2, CallToolResultSchema2, CompatibilityCallToolResultSchema2, CallToolRequestParamsSchema2, CallToolRequestSchema2, ToolListChangedNotificationSchema2, ListChangedOptionsBaseSchema2, LoggingLevelSchema2, SetLevelRequestParamsSchema2, SetLevelRequestSchema2, LoggingMessageNotificationParamsSchema2, LoggingMessageNotificationSchema2, ModelHintSchema2, ModelPreferencesSchema2, ToolChoiceSchema2, ToolResultContentSchema2, SamplingContentSchema2, SamplingMessageContentBlockSchema2, SamplingMessageSchema2, CreateMessageRequestParamsSchema2, CreateMessageRequestSchema2, CreateMessageResultSchema2, CreateMessageResultWithToolsSchema2, BooleanSchemaSchema2, StringSchemaSchema2, NumberSchemaSchema2, UntitledSingleSelectEnumSchemaSchema2, TitledSingleSelectEnumSchemaSchema2, LegacyTitledEnumSchemaSchema2, SingleSelectEnumSchemaSchema2, UntitledMultiSelectEnumSchemaSchema2, TitledMultiSelectEnumSchemaSchema2, MultiSelectEnumSchemaSchema2, EnumSchemaSchema2, PrimitiveSchemaDefinitionSchema2, ElicitRequestFormParamsSchema2, ElicitRequestURLParamsSchema2, ElicitRequestParamsSchema2, ElicitRequestSchema2, ElicitationCompleteNotificationParamsSchema2, ElicitationCompleteNotificationSchema2, ElicitResultSchema2, ResourceTemplateReferenceSchema2, PromptReferenceSchema2, CompleteRequestParamsSchema2, CompleteRequestSchema2, CompleteResultSchema2, RootSchema2, ListRootsRequestSchema2, ListRootsResultSchema2, RootsListChangedNotificationSchema2, ClientRequestSchema2, ClientNotificationSchema2, ClientResultSchema2, ServerRequestSchema2, ServerNotificationSchema2, ServerResultSchema2, McpError2, UrlElicitationRequiredError2; -var init_types14 = __esm(() => { +var init_types13 = __esm(() => { init_v42(); SUPPORTED_PROTOCOL_VERSIONS2 = [LATEST_PROTOCOL_VERSION2, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"]; - AssertObjectSchema2 = custom4((v) => v !== null && (typeof v === "object" || typeof v === "function")); - ProgressTokenSchema2 = union5([string6(), number6().int()]); + AssertObjectSchema2 = custom3((v) => v !== null && (typeof v === "object" || typeof v === "function")); + ProgressTokenSchema2 = union4([string6(), number6().int()]); CursorSchema2 = string6(); TaskCreationParamsSchema2 = looseObject2({ ttl: number6().optional(), @@ -541047,7 +468461,7 @@ var init_types14 = __esm(() => { ResultSchema2 = looseObject2({ _meta: RequestMetaSchema2.optional() }); - RequestIdSchema2 = union5([string6(), number6().int()]); + RequestIdSchema2 = union4([string6(), number6().int()]); JSONRPCRequestSchema2 = object5({ jsonrpc: literal3(JSONRPC_VERSION2), id: RequestIdSchema2, @@ -541081,13 +468495,13 @@ var init_types14 = __esm(() => { data: unknown3().optional() }) }).strict(); - JSONRPCMessageSchema2 = union5([ + JSONRPCMessageSchema2 = union4([ JSONRPCRequestSchema2, JSONRPCNotificationSchema2, JSONRPCResultResponseSchema2, JSONRPCErrorResponseSchema2 ]); - JSONRPCResponseSchema2 = union5([JSONRPCResultResponseSchema2, JSONRPCErrorResponseSchema2]); + JSONRPCResponseSchema2 = union4([JSONRPCResultResponseSchema2, JSONRPCErrorResponseSchema2]); EmptyResultSchema2 = ResultSchema2.strict(); CancelledNotificationParamsSchema2 = NotificationsParamsSchema2.extend({ requestId: RequestIdSchema2.optional(), @@ -541117,7 +468531,7 @@ var init_types14 = __esm(() => { websiteUrl: string6().optional(), description: string6().optional() }); - FormElicitationCapabilitySchema2 = intersection5(object5({ + FormElicitationCapabilitySchema2 = intersection4(object5({ applyDefaults: boolean6().optional() }), record3(string6(), unknown3())); ElicitationCapabilitySchema2 = preprocess2((value) => { @@ -541127,7 +468541,7 @@ var init_types14 = __esm(() => { } } return value; - }, intersection5(object5({ + }, intersection4(object5({ form: FormElicitationCapabilitySchema2.optional(), url: AssertObjectSchema2.optional() }), record3(string6(), unknown3()).optional())); @@ -541232,7 +468646,7 @@ var init_types14 = __esm(() => { TaskSchema3 = object5({ taskId: string6(), status: TaskStatusSchema3, - ttl: union5([number6(), _null6()]), + ttl: union4([number6(), _null6()]), createdAt: string6(), lastUpdatedAt: string6(), pollInterval: optional3(number6()), @@ -541338,7 +468752,7 @@ var init_types14 = __esm(() => { params: ReadResourceRequestParamsSchema2 }); ReadResourceResultSchema2 = ResultSchema2.extend({ - contents: array3(union5([TextResourceContentsSchema2, BlobResourceContentsSchema2])) + contents: array3(union4([TextResourceContentsSchema2, BlobResourceContentsSchema2])) }); ResourceListChangedNotificationSchema2 = NotificationSchema2.extend({ method: literal3("notifications/resources/list_changed"), @@ -541416,14 +468830,14 @@ var init_types14 = __esm(() => { }); EmbeddedResourceSchema2 = object5({ type: literal3("resource"), - resource: union5([TextResourceContentsSchema2, BlobResourceContentsSchema2]), + resource: union4([TextResourceContentsSchema2, BlobResourceContentsSchema2]), annotations: AnnotationsSchema2.optional(), _meta: record3(string6(), unknown3()).optional() }); ResourceLinkSchema2 = ResourceSchema2.extend({ type: literal3("resource_link") }); - ContentBlockSchema2 = union5([ + ContentBlockSchema2 = union4([ TextContentSchema2, ImageContentSchema2, AudioContentSchema2, @@ -541547,7 +468961,7 @@ var init_types14 = __esm(() => { ]); SamplingMessageSchema2 = object5({ role: RoleSchema2, - content: union5([SamplingMessageContentBlockSchema2, array3(SamplingMessageContentBlockSchema2)]), + content: union4([SamplingMessageContentBlockSchema2, array3(SamplingMessageContentBlockSchema2)]), _meta: record3(string6(), unknown3()).optional() }); CreateMessageRequestParamsSchema2 = TaskAugmentedRequestParamsSchema2.extend({ @@ -541576,7 +468990,7 @@ var init_types14 = __esm(() => { model: string6(), stopReason: optional3(_enum3(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string6())), role: RoleSchema2, - content: union5([SamplingMessageContentBlockSchema2, array3(SamplingMessageContentBlockSchema2)]) + content: union4([SamplingMessageContentBlockSchema2, array3(SamplingMessageContentBlockSchema2)]) }); BooleanSchemaSchema2 = object5({ type: literal3("boolean"), @@ -541626,7 +469040,7 @@ var init_types14 = __esm(() => { enumNames: array3(string6()).optional(), default: string6().optional() }); - SingleSelectEnumSchemaSchema2 = union5([UntitledSingleSelectEnumSchemaSchema2, TitledSingleSelectEnumSchemaSchema2]); + SingleSelectEnumSchemaSchema2 = union4([UntitledSingleSelectEnumSchemaSchema2, TitledSingleSelectEnumSchemaSchema2]); UntitledMultiSelectEnumSchemaSchema2 = object5({ type: literal3("array"), title: string6().optional(), @@ -541653,9 +469067,9 @@ var init_types14 = __esm(() => { }), default: array3(string6()).optional() }); - MultiSelectEnumSchemaSchema2 = union5([UntitledMultiSelectEnumSchemaSchema2, TitledMultiSelectEnumSchemaSchema2]); - EnumSchemaSchema2 = union5([LegacyTitledEnumSchemaSchema2, SingleSelectEnumSchemaSchema2, MultiSelectEnumSchemaSchema2]); - PrimitiveSchemaDefinitionSchema2 = union5([EnumSchemaSchema2, BooleanSchemaSchema2, StringSchemaSchema2, NumberSchemaSchema2]); + MultiSelectEnumSchemaSchema2 = union4([UntitledMultiSelectEnumSchemaSchema2, TitledMultiSelectEnumSchemaSchema2]); + EnumSchemaSchema2 = union4([LegacyTitledEnumSchemaSchema2, SingleSelectEnumSchemaSchema2, MultiSelectEnumSchemaSchema2]); + PrimitiveSchemaDefinitionSchema2 = union4([EnumSchemaSchema2, BooleanSchemaSchema2, StringSchemaSchema2, NumberSchemaSchema2]); ElicitRequestFormParamsSchema2 = TaskAugmentedRequestParamsSchema2.extend({ mode: literal3("form").optional(), message: string6(), @@ -541671,7 +469085,7 @@ var init_types14 = __esm(() => { elicitationId: string6(), url: string6().url() }); - ElicitRequestParamsSchema2 = union5([ElicitRequestFormParamsSchema2, ElicitRequestURLParamsSchema2]); + ElicitRequestParamsSchema2 = union4([ElicitRequestFormParamsSchema2, ElicitRequestURLParamsSchema2]); ElicitRequestSchema2 = RequestSchema2.extend({ method: literal3("elicitation/create"), params: ElicitRequestParamsSchema2 @@ -541685,7 +469099,7 @@ var init_types14 = __esm(() => { }); ElicitResultSchema2 = ResultSchema2.extend({ action: _enum3(["accept", "decline", "cancel"]), - content: preprocess2((val) => val === null ? undefined : val, record3(string6(), union5([string6(), number6(), boolean6(), array3(string6())])).optional()) + content: preprocess2((val) => val === null ? undefined : val, record3(string6(), union4([string6(), number6(), boolean6(), array3(string6())])).optional()) }); ResourceTemplateReferenceSchema2 = object5({ type: literal3("ref/resource"), @@ -541696,7 +469110,7 @@ var init_types14 = __esm(() => { name: string6() }); CompleteRequestParamsSchema2 = BaseRequestParamsSchema2.extend({ - ref: union5([PromptReferenceSchema2, ResourceTemplateReferenceSchema2]), + ref: union4([PromptReferenceSchema2, ResourceTemplateReferenceSchema2]), argument: object5({ name: string6(), value: string6() @@ -541732,7 +469146,7 @@ var init_types14 = __esm(() => { method: literal3("notifications/roots/list_changed"), params: NotificationsParamsSchema2.optional() }); - ClientRequestSchema2 = union5([ + ClientRequestSchema2 = union4([ PingRequestSchema2, InitializeRequestSchema2, CompleteRequestSchema2, @@ -541751,14 +469165,14 @@ var init_types14 = __esm(() => { ListTasksRequestSchema2, CancelTaskRequestSchema2 ]); - ClientNotificationSchema2 = union5([ + ClientNotificationSchema2 = union4([ CancelledNotificationSchema2, ProgressNotificationSchema2, InitializedNotificationSchema2, RootsListChangedNotificationSchema2, TaskStatusNotificationSchema2 ]); - ClientResultSchema2 = union5([ + ClientResultSchema2 = union4([ EmptyResultSchema2, CreateMessageResultSchema2, CreateMessageResultWithToolsSchema2, @@ -541768,7 +469182,7 @@ var init_types14 = __esm(() => { ListTasksResultSchema2, CreateTaskResultSchema2 ]); - ServerRequestSchema2 = union5([ + ServerRequestSchema2 = union4([ PingRequestSchema2, CreateMessageRequestSchema2, ElicitRequestSchema2, @@ -541778,7 +469192,7 @@ var init_types14 = __esm(() => { ListTasksRequestSchema2, CancelTaskRequestSchema2 ]); - ServerNotificationSchema2 = union5([ + ServerNotificationSchema2 = union4([ CancelledNotificationSchema2, ProgressNotificationSchema2, LoggingMessageNotificationSchema2, @@ -541789,7 +469203,7 @@ var init_types14 = __esm(() => { TaskStatusNotificationSchema2, ElicitationCompleteNotificationSchema2 ]); - ServerResultSchema2 = union5([ + ServerResultSchema2 = union4([ EmptyResultSchema2, InitializeResultSchema2, CompleteResultSchema2, @@ -541852,7 +469266,7 @@ var init_Refs2 = __esm(() => { var init_any2 = () => {}; // ../node_modules/zod-to-json-schema/dist/esm/parsers/array.js -var init_array5 = __esm(() => { +var init_array4 = __esm(() => { init_v32(); init_parseDef2(); }); @@ -541870,7 +469284,7 @@ var init_catch2 = __esm(() => { }); // ../node_modules/zod-to-json-schema/dist/esm/parsers/date.js -var init_date4 = () => {}; +var init_date3 = () => {}; // ../node_modules/zod-to-json-schema/dist/esm/parsers/default.js var init_default3 = __esm(() => { @@ -541883,12 +469297,12 @@ var init_effects2 = __esm(() => { init_any2(); }); // ../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js -var init_intersection4 = __esm(() => { +var init_intersection3 = __esm(() => { init_parseDef2(); }); // ../node_modules/zod-to-json-schema/dist/esm/parsers/string.js var ALPHA_NUMERIC2; -var init_string5 = __esm(() => { +var init_string4 = __esm(() => { ALPHA_NUMERIC2 = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"); }); @@ -541896,13 +469310,13 @@ var init_string5 = __esm(() => { var init_record2 = __esm(() => { init_v32(); init_parseDef2(); - init_string5(); + init_string4(); init_branded2(); init_any2(); }); // ../node_modules/zod-to-json-schema/dist/esm/parsers/map.js -var init_map4 = __esm(() => { +var init_map3 = __esm(() => { init_parseDef2(); init_record2(); init_any2(); @@ -541912,21 +469326,21 @@ var init_never2 = __esm(() => { init_any2(); }); // ../node_modules/zod-to-json-schema/dist/esm/parsers/union.js -var init_union4 = __esm(() => { +var init_union3 = __esm(() => { init_parseDef2(); }); // ../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js var init_nullable2 = __esm(() => { init_parseDef2(); - init_union4(); + init_union3(); }); // ../node_modules/zod-to-json-schema/dist/esm/parsers/number.js -var init_number4 = () => {}; +var init_number3 = () => {}; // ../node_modules/zod-to-json-schema/dist/esm/parsers/object.js -var init_object4 = __esm(() => { +var init_object3 = __esm(() => { init_parseDef2(); }); @@ -541947,7 +469361,7 @@ var init_promise3 = __esm(() => { }); // ../node_modules/zod-to-json-schema/dist/esm/parsers/set.js -var init_set4 = __esm(() => { +var init_set3 = __esm(() => { init_parseDef2(); }); @@ -541975,28 +469389,28 @@ var init_readonly2 = __esm(() => { var init_selectParser2 = __esm(() => { init_v32(); init_any2(); - init_array5(); + init_array4(); init_bigint2(); init_branded2(); init_catch2(); - init_date4(); + init_date3(); init_default3(); init_effects2(); - init_intersection4(); - init_map4(); + init_intersection3(); + init_map3(); init_never2(); init_nullable2(); - init_number4(); - init_object4(); + init_number3(); + init_object3(); init_optional2(); init_pipeline3(); init_promise3(); init_record2(); - init_set4(); - init_string5(); + init_set3(); + init_string4(); init_tuple2(); init_undefined2(); - init_union4(); + init_union3(); init_unknown2(); init_readonly2(); }); @@ -542019,35 +469433,35 @@ var init_zodToJsonSchema2 = __esm(() => { }); // ../node_modules/zod-to-json-schema/dist/esm/index.js -var init_esm7 = __esm(() => { +var init_esm6 = __esm(() => { init_Options2(); init_Refs2(); init_parseDef2(); init_parseTypes2(); init_any2(); - init_array5(); + init_array4(); init_bigint2(); init_branded2(); init_catch2(); - init_date4(); + init_date3(); init_default3(); init_effects2(); - init_intersection4(); - init_map4(); + init_intersection3(); + init_map3(); init_never2(); init_nullable2(); - init_number4(); - init_object4(); + init_number3(); + init_object3(); init_optional2(); init_pipeline3(); init_promise3(); init_readonly2(); init_record2(); - init_set4(); - init_string5(); + init_set3(); + init_string4(); init_tuple2(); init_undefined2(); - init_union4(); + init_union3(); init_unknown2(); init_selectParser2(); init_zodToJsonSchema2(); @@ -542068,16 +469482,16 @@ function getMethodLiteral2(schema) { return value; } function parseWithCompat2(schema, data) { - const result3 = safeParse5(schema, data); - if (!result3.success) { - throw result3.error; + const result2 = safeParse5(schema, data); + if (!result2.success) { + throw result2.error; } - return result3.data; + return result2.data; } var init_zod_json_schema_compat2 = __esm(() => { init_v4_mini2(); init_zod_compat2(); - init_esm7(); + init_esm6(); }); // ../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js @@ -542129,8 +469543,8 @@ class Protocol2 { resolver(message); } else { const errorMessage2 = message; - const error46 = new McpError2(errorMessage2.error.code, errorMessage2.error.message, errorMessage2.error.data); - resolver(error46); + const error42 = new McpError2(errorMessage2.error.code, errorMessage2.error.message, errorMessage2.error.data); + resolver(error42); } } else { const messageType = queuedMessage.type === "response" ? "Response" : "Error"; @@ -542150,12 +469564,12 @@ class Protocol2 { return await handleTaskResult(); } if (isTerminal2(task.status)) { - const result3 = await this._taskStore.getTaskResult(taskId, extra.sessionId); + const result2 = await this._taskStore.getTaskResult(taskId, extra.sessionId); this._clearTaskQueue(taskId); return { - ...result3, + ...result2, _meta: { - ...result3._meta, + ...result2._meta, [RELATED_TASK_META_KEY2]: { taskId } @@ -542174,8 +469588,8 @@ class Protocol2 { nextCursor, _meta: {} }; - } catch (error46) { - throw new McpError2(ErrorCode2.InvalidParams, `Failed to list tasks: ${error46 instanceof Error ? error46.message : String(error46)}`); + } catch (error42) { + throw new McpError2(ErrorCode2.InvalidParams, `Failed to list tasks: ${error42 instanceof Error ? error42.message : String(error42)}`); } }); this.setRequestHandler(CancelTaskRequestSchema2, async (request, extra) => { @@ -542197,11 +469611,11 @@ class Protocol2 { _meta: {}, ...cancelledTask }; - } catch (error46) { - if (error46 instanceof McpError2) { - throw error46; + } catch (error42) { + if (error42 instanceof McpError2) { + throw error42; } - throw new McpError2(ErrorCode2.InvalidRequest, `Failed to cancel task: ${error46 instanceof Error ? error46.message : String(error46)}`); + throw new McpError2(ErrorCode2.InvalidRequest, `Failed to cancel task: ${error42 instanceof Error ? error42.message : String(error42)}`); } }); } @@ -542257,9 +469671,9 @@ class Protocol2 { this._onclose(); }; const _onerror = this.transport?.onerror; - this._transport.onerror = (error46) => { - _onerror?.(error46); - this._onerror(error46); + this._transport.onerror = (error42) => { + _onerror?.(error42); + this._onerror(error42); }; const _onmessage = this._transport?.onmessage; this._transport.onmessage = (message, extra) => { @@ -542290,28 +469704,28 @@ class Protocol2 { controller.abort(); } this._requestHandlerAbortControllers.clear(); - const error46 = McpError2.fromError(ErrorCode2.ConnectionClosed, "Connection closed"); + const error42 = McpError2.fromError(ErrorCode2.ConnectionClosed, "Connection closed"); this._transport = undefined; this.onclose?.(); - for (const handler14 of responseHandlers.values()) { - handler14(error46); + for (const handler18 of responseHandlers.values()) { + handler18(error42); } } - _onerror(error46) { - this.onerror?.(error46); + _onerror(error42) { + this.onerror?.(error42); } _onnotification(notification) { - const handler14 = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler; - if (handler14 === undefined) { + const handler18 = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler; + if (handler18 === undefined) { return; } - Promise.resolve().then(() => handler14(notification)).catch((error46) => this._onerror(new Error(`Uncaught error in notification handler: ${error46}`))); + Promise.resolve().then(() => handler18(notification)).catch((error42) => this._onerror(new Error(`Uncaught error in notification handler: ${error42}`))); } _onrequest(request, extra) { - const handler14 = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler; + const handler18 = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler; const capturedTransport = this._transport; const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY2]?.taskId; - if (handler14 === undefined) { + if (handler18 === undefined) { const errorResponse = { jsonrpc: "2.0", id: request.id, @@ -542325,9 +469739,9 @@ class Protocol2 { type: "error", message: errorResponse, timestamp: Date.now() - }, capturedTransport?.sessionId).catch((error46) => this._onerror(new Error(`Failed to enqueue error response: ${error46}`))); + }, capturedTransport?.sessionId).catch((error42) => this._onerror(new Error(`Failed to enqueue error response: ${error42}`))); } else { - capturedTransport?.send(errorResponse).catch((error46) => this._onerror(new Error(`Failed to send an error response: ${error46}`))); + capturedTransport?.send(errorResponse).catch((error42) => this._onerror(new Error(`Failed to send an error response: ${error42}`))); } return; } @@ -542375,12 +469789,12 @@ class Protocol2 { if (taskCreationParams) { this.assertTaskHandlerCapability(request.method); } - }).then(() => handler14(request, fullExtra)).then(async (result3) => { + }).then(() => handler18(request, fullExtra)).then(async (result2) => { if (abortController.signal.aborted) { return; } const response = { - result: result3, + result: result2, jsonrpc: "2.0", id: request.id }; @@ -542393,7 +469807,7 @@ class Protocol2 { } else { await capturedTransport?.send(response); } - }, async (error46) => { + }, async (error42) => { if (abortController.signal.aborted) { return; } @@ -542401,9 +469815,9 @@ class Protocol2 { jsonrpc: "2.0", id: request.id, error: { - code: Number.isSafeInteger(error46["code"]) ? error46["code"] : ErrorCode2.InternalError, - message: error46.message ?? "Internal error", - ...error46["data"] !== undefined && { data: error46["data"] } + code: Number.isSafeInteger(error42["code"]) ? error42["code"] : ErrorCode2.InternalError, + message: error42.message ?? "Internal error", + ...error42["data"] !== undefined && { data: error42["data"] } } }; if (relatedTaskId && this._taskMessageQueue) { @@ -542415,7 +469829,7 @@ class Protocol2 { } else { await capturedTransport?.send(errorResponse); } - }).catch((error46) => this._onerror(new Error(`Failed to send response: ${error46}`))).finally(() => { + }).catch((error42) => this._onerror(new Error(`Failed to send response: ${error42}`))).finally(() => { if (this._requestHandlerAbortControllers.get(request.id) === abortController) { this._requestHandlerAbortControllers.delete(request.id); } @@ -542424,8 +469838,8 @@ class Protocol2 { _onprogress(notification) { const { progressToken, ...params } = notification.params; const messageId = Number(progressToken); - const handler14 = this._progressHandlers.get(messageId); - if (!handler14) { + const handler18 = this._progressHandlers.get(messageId); + if (!handler18) { this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`)); return; } @@ -542434,15 +469848,15 @@ class Protocol2 { if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) { try { this._resetTimeout(messageId); - } catch (error46) { + } catch (error42) { this._responseHandlers.delete(messageId); this._progressHandlers.delete(messageId); this._cleanupTimeout(messageId); - responseHandler(error46); + responseHandler(error42); return; } } - handler14(params); + handler18(params); } _onresponse(response) { const messageId = Number(response.id); @@ -542452,13 +469866,13 @@ class Protocol2 { if (isJSONRPCResultResponse2(response)) { resolver(response); } else { - const error46 = new McpError2(response.error.code, response.error.message, response.error.data); - resolver(error46); + const error42 = new McpError2(response.error.code, response.error.message, response.error.data); + resolver(error42); } return; } - const handler14 = this._responseHandlers.get(messageId); - if (handler14 === undefined) { + const handler18 = this._responseHandlers.get(messageId); + if (handler18 === undefined) { this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`)); return; } @@ -542466,9 +469880,9 @@ class Protocol2 { this._cleanupTimeout(messageId); let isTaskResponse = false; if (isJSONRPCResultResponse2(response) && response.result && typeof response.result === "object") { - const result3 = response.result; - if (result3.task && typeof result3.task === "object") { - const task = result3.task; + const result2 = response.result; + if (result2.task && typeof result2.task === "object") { + const task = result2.task; if (typeof task.taskId === "string") { isTaskResponse = true; this._taskProgressTokens.set(task.taskId, messageId); @@ -542479,10 +469893,10 @@ class Protocol2 { this._progressHandlers.delete(messageId); } if (isJSONRPCResultResponse2(response)) { - handler14(response); + handler18(response); } else { - const error46 = McpError2.fromError(response.error.code, response.error.message, response.error.data); - handler14(error46); + const error42 = McpError2.fromError(response.error.code, response.error.message, response.error.data); + handler18(error42); } } get transport() { @@ -542495,12 +469909,12 @@ class Protocol2 { const { task } = options2 ?? {}; if (!task) { try { - const result3 = await this.request(request, resultSchema, options2); - yield { type: "result", result: result3 }; - } catch (error46) { + const result2 = await this.request(request, resultSchema, options2); + yield { type: "result", result: result2 }; + } catch (error42) { yield { type: "error", - error: error46 instanceof McpError2 ? error46 : new McpError2(ErrorCode2.InternalError, String(error46)) + error: error42 instanceof McpError2 ? error42 : new McpError2(ErrorCode2.InternalError, String(error42)) }; } return; @@ -542519,8 +469933,8 @@ class Protocol2 { yield { type: "taskStatus", task: task2 }; if (isTerminal2(task2.status)) { if (task2.status === "completed") { - const result3 = await this.getTaskResult({ taskId }, resultSchema, options2); - yield { type: "result", result: result3 }; + const result2 = await this.getTaskResult({ taskId }, resultSchema, options2); + yield { type: "result", result: result2 }; } else if (task2.status === "failed") { yield { type: "error", @@ -542535,26 +469949,26 @@ class Protocol2 { return; } if (task2.status === "input_required") { - const result3 = await this.getTaskResult({ taskId }, resultSchema, options2); - yield { type: "result", result: result3 }; + const result2 = await this.getTaskResult({ taskId }, resultSchema, options2); + yield { type: "result", result: result2 }; return; } const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000; - await new Promise((resolve36) => setTimeout(resolve36, pollInterval)); + await new Promise((resolve30) => setTimeout(resolve30, pollInterval)); options2?.signal?.throwIfAborted(); } - } catch (error46) { + } catch (error42) { yield { type: "error", - error: error46 instanceof McpError2 ? error46 : new McpError2(ErrorCode2.InternalError, String(error46)) + error: error42 instanceof McpError2 ? error42 : new McpError2(ErrorCode2.InternalError, String(error42)) }; } } request(request, resultSchema, options2) { const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options2 ?? {}; - return new Promise((resolve36, reject3) => { - const earlyReject = (error46) => { - reject3(error46); + return new Promise((resolve30, reject2) => { + const earlyReject = (error42) => { + reject2(error42); }; if (!this._transport) { earlyReject(new Error("Not connected")); @@ -542614,26 +470028,26 @@ class Protocol2 { requestId: messageId, reason: String(reason) } - }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error47) => this._onerror(new Error(`Failed to send cancellation: ${error47}`))); - const error46 = reason instanceof McpError2 ? reason : new McpError2(ErrorCode2.RequestTimeout, String(reason)); - reject3(error46); + }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error43) => this._onerror(new Error(`Failed to send cancellation: ${error43}`))); + const error42 = reason instanceof McpError2 ? reason : new McpError2(ErrorCode2.RequestTimeout, String(reason)); + reject2(error42); }; this._responseHandlers.set(messageId, (response) => { if (options2?.signal?.aborted) { return; } if (response instanceof Error) { - return reject3(response); + return reject2(response); } try { const parseResult = safeParse5(resultSchema, response.result); if (!parseResult.success) { - reject3(parseResult.error); + reject2(parseResult.error); } else { - resolve36(parseResult.data); + resolve30(parseResult.data); } - } catch (error46) { - reject3(error46); + } catch (error42) { + reject2(error42); } }); options2?.signal?.addEventListener("abort", () => { @@ -542645,9 +470059,9 @@ class Protocol2 { const relatedTaskId = relatedTask?.taskId; if (relatedTaskId) { const responseResolver = (response) => { - const handler14 = this._responseHandlers.get(messageId); - if (handler14) { - handler14(response); + const handler18 = this._responseHandlers.get(messageId); + if (handler18) { + handler18(response); } else { this._onerror(new Error(`Response handler missing for side-channeled request ${messageId}`)); } @@ -542657,14 +470071,14 @@ class Protocol2 { type: "request", message: jsonrpcRequest, timestamp: Date.now() - }).catch((error46) => { + }).catch((error42) => { this._cleanupTimeout(messageId); - reject3(error46); + reject2(error42); }); } else { - this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error46) => { + this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error42) => { this._cleanupTimeout(messageId); - reject3(error46); + reject2(error42); }); } }); @@ -542734,7 +470148,7 @@ class Protocol2 { } }; } - this._transport?.send(jsonrpcNotification2, options2).catch((error46) => this._onerror(error46)); + this._transport?.send(jsonrpcNotification2, options2).catch((error42) => this._onerror(error42)); }); return; } @@ -542756,31 +470170,31 @@ class Protocol2 { } await this._transport.send(jsonrpcNotification, options2); } - setRequestHandler(requestSchema, handler14) { - const method3 = getMethodLiteral2(requestSchema); - this.assertRequestHandlerCapability(method3); - this._requestHandlers.set(method3, (request, extra) => { + setRequestHandler(requestSchema, handler18) { + const method2 = getMethodLiteral2(requestSchema); + this.assertRequestHandlerCapability(method2); + this._requestHandlers.set(method2, (request, extra) => { const parsed = parseWithCompat2(requestSchema, request); - return Promise.resolve(handler14(parsed, extra)); + return Promise.resolve(handler18(parsed, extra)); }); } - removeRequestHandler(method3) { - this._requestHandlers.delete(method3); + removeRequestHandler(method2) { + this._requestHandlers.delete(method2); } - assertCanSetRequestHandler(method3) { - if (this._requestHandlers.has(method3)) { - throw new Error(`A request handler for ${method3} already exists, which would be overridden`); + assertCanSetRequestHandler(method2) { + if (this._requestHandlers.has(method2)) { + throw new Error(`A request handler for ${method2} already exists, which would be overridden`); } } - setNotificationHandler(notificationSchema, handler14) { - const method3 = getMethodLiteral2(notificationSchema); - this._notificationHandlers.set(method3, (notification) => { + setNotificationHandler(notificationSchema, handler18) { + const method2 = getMethodLiteral2(notificationSchema); + this._notificationHandlers.set(method2, (notification) => { const parsed = parseWithCompat2(notificationSchema, notification); - return Promise.resolve(handler14(parsed)); + return Promise.resolve(handler18(parsed)); }); } - removeNotificationHandler(method3) { - this._notificationHandlers.delete(method3); + removeNotificationHandler(method2) { + this._notificationHandlers.delete(method2); } _cleanupTaskProgressHandler(taskId) { const progressToken = this._taskProgressTokens.get(taskId); @@ -542821,15 +470235,15 @@ class Protocol2 { interval = task.pollInterval; } } catch {} - return new Promise((resolve36, reject3) => { + return new Promise((resolve30, reject2) => { if (signal.aborted) { - reject3(new McpError2(ErrorCode2.InvalidRequest, "Request cancelled")); + reject2(new McpError2(ErrorCode2.InvalidRequest, "Request cancelled")); return; } - const timeoutId = setTimeout(resolve36, interval); + const timeoutId = setTimeout(resolve30, interval); signal.addEventListener("abort", () => { clearTimeout(timeoutId); - reject3(new McpError2(ErrorCode2.InvalidRequest, "Request cancelled")); + reject2(new McpError2(ErrorCode2.InvalidRequest, "Request cancelled")); }, { once: true }); }); } @@ -542855,8 +470269,8 @@ class Protocol2 { } return task; }, - storeTaskResult: async (taskId, status, result3) => { - await taskStore.storeTaskResult(taskId, status, result3, sessionId); + storeTaskResult: async (taskId, status, result2) => { + await taskStore.storeTaskResult(taskId, status, result2, sessionId); const task = await taskStore.getTask(taskId, sessionId); if (task) { const notification = TaskStatusNotificationSchema2.parse({ @@ -542899,29 +470313,29 @@ class Protocol2 { }; } } -function isPlainObject8(value) { +function isPlainObject7(value) { return value !== null && typeof value === "object" && !Array.isArray(value); } function mergeCapabilities2(base2, additional) { - const result3 = { ...base2 }; + const result2 = { ...base2 }; for (const key in additional) { const k = key; const addValue = additional[k]; if (addValue === undefined) continue; - const baseValue = result3[k]; - if (isPlainObject8(baseValue) && isPlainObject8(addValue)) { - result3[k] = { ...baseValue, ...addValue }; + const baseValue = result2[k]; + if (isPlainObject7(baseValue) && isPlainObject7(addValue)) { + result2[k] = { ...baseValue, ...addValue }; } else { - result3[k] = addValue; + result2[k] = addValue; } } - return result3; + return result2; } var DEFAULT_REQUEST_TIMEOUT_MSEC2 = 60000; var init_protocol2 = __esm(() => { init_zod_compat2(); - init_types14(); + init_types13(); init_zod_json_schema_compat2(); }); @@ -542969,12 +470383,12 @@ var require_code3 = __commonJS((exports) => { return item === "" || item === '""'; } get str() { - var _a5; - return (_a5 = this._str) !== null && _a5 !== undefined ? _a5 : this._str = this._items.reduce((s, c6) => `${s}${c6}`, ""); + var _a3; + return (_a3 = this._str) !== null && _a3 !== undefined ? _a3 : this._str = this._items.reduce((s, c6) => `${s}${c6}`, ""); } get names() { - var _a5; - return (_a5 = this._names) !== null && _a5 !== undefined ? _a5 : this._names = this._items.reduce((names, c6) => { + var _a3; + return (_a3 = this._names) !== null && _a3 !== undefined ? _a3 : this._names = this._items.reduce((names, c6) => { if (c6 instanceof Name) names[c6.str] = (names[c6.str] || 0) + 1; return names; @@ -542985,10 +470399,10 @@ var require_code3 = __commonJS((exports) => { exports.nil = new _Code(""); function _(strs, ...args) { const code = [strs[0]]; - let i4 = 0; - while (i4 < args.length) { - addCodeArg(code, args[i4]); - code.push(strs[++i4]); + let i3 = 0; + while (i3 < args.length) { + addCodeArg(code, args[i3]); + code.push(strs[++i3]); } return new _Code(code); } @@ -542996,11 +470410,11 @@ var require_code3 = __commonJS((exports) => { var plus = new _Code("+"); function str(strs, ...args) { const expr = [safeStringify(strs[0])]; - let i4 = 0; - while (i4 < args.length) { + let i3 = 0; + while (i3 < args.length) { expr.push(plus); - addCodeArg(expr, args[i4]); - expr.push(plus, safeStringify(strs[++i4])); + addCodeArg(expr, args[i3]); + expr.push(plus, safeStringify(strs[++i3])); } optimize2(expr); return new _Code(expr); @@ -543016,17 +470430,17 @@ var require_code3 = __commonJS((exports) => { } exports.addCodeArg = addCodeArg; function optimize2(expr) { - let i4 = 1; - while (i4 < expr.length - 1) { - if (expr[i4] === plus) { - const res = mergeExprItems(expr[i4 - 1], expr[i4 + 1]); + let i3 = 1; + while (i3 < expr.length - 1) { + if (expr[i3] === plus) { + const res = mergeExprItems(expr[i3 - 1], expr[i3 + 1]); if (res !== undefined) { - expr.splice(i4 - 1, 3, res); + expr.splice(i3 - 1, 3, res); continue; } - expr[i4++] = "+"; + expr[i3++] = "+"; } - i4++; + i3++; } } function mergeExprItems(a2, b) { @@ -543051,15 +470465,15 @@ var require_code3 = __commonJS((exports) => { return c22.emptyStr() ? c1 : c1.emptyStr() ? c22 : str`${c1}${c22}`; } exports.strConcat = strConcat; - function interpolate(x4) { - return typeof x4 == "number" || typeof x4 == "boolean" || x4 === null ? x4 : safeStringify(Array.isArray(x4) ? x4.join(",") : x4); + function interpolate(x3) { + return typeof x3 == "number" || typeof x3 == "boolean" || x3 === null ? x3 : safeStringify(Array.isArray(x3) ? x3.join(",") : x3); } - function stringify(x4) { - return new _Code(safeStringify(x4)); + function stringify(x3) { + return new _Code(safeStringify(x3)); } exports.stringify = stringify; - function safeStringify(x4) { - return JSON.stringify(x4).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); + function safeStringify(x3) { + return JSON.stringify(x3).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); } exports.safeStringify = safeStringify; function getProperty(key) { @@ -543103,10 +470517,10 @@ var require_scope2 = __commonJS((exports) => { }; class Scope { - constructor({ prefixes, parent: parent3 } = {}) { + constructor({ prefixes, parent: parent2 } = {}) { this._names = {}; this._prefixes = prefixes; - this._parent = parent3; + this._parent = parent2; } toName(nameOrPrefix) { return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); @@ -543119,8 +470533,8 @@ var require_scope2 = __commonJS((exports) => { return `${prefix}${ng.index++}`; } _nameGroup(prefix) { - var _a5, _b3; - if (((_b3 = (_a5 = this._parent) === null || _a5 === undefined ? undefined : _a5._prefixes) === null || _b3 === undefined ? undefined : _b3.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { + var _a3, _b2; + if (((_b2 = (_a3 = this._parent) === null || _a3 === undefined ? undefined : _a3._prefixes) === null || _b2 === undefined ? undefined : _b2.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); } return this._names[prefix] = { prefix, index: 0 }; @@ -543133,9 +470547,9 @@ var require_scope2 = __commonJS((exports) => { super(nameStr); this.prefix = prefix; } - setValue(value, { property: property3, itemIndex }) { + setValue(value, { property: property2, itemIndex }) { this.value = value; - this.scopePath = (0, code_1._)`.${new code_1.Name(property3)}[${itemIndex}]`; + this.scopePath = (0, code_1._)`.${new code_1.Name(property2)}[${itemIndex}]`; } } exports.ValueScopeName = ValueScopeName; @@ -543155,12 +470569,12 @@ var require_scope2 = __commonJS((exports) => { return new ValueScopeName(prefix, this._newName(prefix)); } value(nameOrPrefix, value) { - var _a5; + var _a3; if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value"); const name = this.toName(nameOrPrefix); const { prefix } = name; - const valueKey = (_a5 = value.key) !== null && _a5 !== undefined ? _a5 : value.ref; + const valueKey = (_a3 = value.key) !== null && _a3 !== undefined ? _a3 : value.ref; let vs = this._values[prefix]; if (vs) { const _name = vs.get(valueKey); @@ -543182,24 +470596,24 @@ var require_scope2 = __commonJS((exports) => { return; return vs.get(keyOrRef); } - scopeRefs(scopeName, values4 = this._values) { - return this._reduceValues(values4, (name) => { + scopeRefs(scopeName, values2 = this._values) { + return this._reduceValues(values2, (name) => { if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`); return (0, code_1._)`${scopeName}${name.scopePath}`; }); } - scopeCode(values4 = this._values, usedValues, getCode) { - return this._reduceValues(values4, (name) => { + scopeCode(values2 = this._values, usedValues, getCode) { + return this._reduceValues(values2, (name) => { if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`); return name.value.code; }, usedValues, getCode); } - _reduceValues(values4, valueCode, usedValues = {}, getCode) { + _reduceValues(values2, valueCode, usedValues = {}, getCode) { let code = code_1.nil; - for (const prefix in values4) { - const vs = values4[prefix]; + for (const prefix in values2) { + const vs = values2[prefix]; if (!vs) continue; const nameSet = usedValues[prefix] = usedValues[prefix] || new Map; @@ -543371,9 +470785,9 @@ var require_codegen2 = __commonJS((exports) => { } class Throw extends Node2 { - constructor(error46) { + constructor(error42) { super(); - this.error = error46; + this.error = error42; } render({ _n }) { return `throw ${this.error};` + _n; @@ -543413,27 +470827,27 @@ var require_codegen2 = __commonJS((exports) => { } optimizeNodes() { const { nodes } = this; - let i4 = nodes.length; - while (i4--) { - const n2 = nodes[i4].optimizeNodes(); + let i3 = nodes.length; + while (i3--) { + const n2 = nodes[i3].optimizeNodes(); if (Array.isArray(n2)) - nodes.splice(i4, 1, ...n2); + nodes.splice(i3, 1, ...n2); else if (n2) - nodes[i4] = n2; + nodes[i3] = n2; else - nodes.splice(i4, 1); + nodes.splice(i3, 1); } return nodes.length > 0 ? this : undefined; } optimizeNames(names, constants5) { const { nodes } = this; - let i4 = nodes.length; - while (i4--) { - const n2 = nodes[i4]; + let i3 = nodes.length; + while (i3--) { + const n2 = nodes[i3]; if (n2.optimizeNames(names, constants5)) continue; subtractNames(names, n2.names); - nodes.splice(i4, 1); + nodes.splice(i3, 1); } return nodes.length > 0 ? this : undefined; } @@ -543468,8 +470882,8 @@ var require_codegen2 = __commonJS((exports) => { } optimizeNodes() { super.optimizeNodes(); - const cond3 = this.condition; - if (cond3 === true) + const cond2 = this.condition; + if (cond2 === true) return this.nodes; let e = this.else; if (e) { @@ -543477,19 +470891,19 @@ var require_codegen2 = __commonJS((exports) => { e = this.else = Array.isArray(ns) ? new Else(ns) : ns; } if (e) { - if (cond3 === false) + if (cond2 === false) return e instanceof If ? e : e.nodes; if (this.nodes.length) return this; - return new If(not(cond3), e instanceof If ? [e] : e.nodes); + return new If(not(cond2), e instanceof If ? [e] : e.nodes); } - if (cond3 === false || !this.nodes.length) + if (cond2 === false || !this.nodes.length) return; return this; } optimizeNames(names, constants5) { - var _a5; - this.else = (_a5 = this.else) === null || _a5 === undefined ? undefined : _a5.optimizeNames(names, constants5); + var _a3; + this.else = (_a3 = this.else) === null || _a3 === undefined ? undefined : _a3.optimizeNames(names, constants5); if (!(super.optimizeNames(names, constants5) || this.else)) return; this.condition = optimizeExpr(this.condition, names, constants5); @@ -543600,17 +471014,17 @@ var require_codegen2 = __commonJS((exports) => { return code; } optimizeNodes() { - var _a5, _b3; + var _a3, _b2; super.optimizeNodes(); - (_a5 = this.catch) === null || _a5 === undefined || _a5.optimizeNodes(); - (_b3 = this.finally) === null || _b3 === undefined || _b3.optimizeNodes(); + (_a3 = this.catch) === null || _a3 === undefined || _a3.optimizeNodes(); + (_b2 = this.finally) === null || _b2 === undefined || _b2.optimizeNodes(); return this; } optimizeNames(names, constants5) { - var _a5, _b3; + var _a3, _b2; super.optimizeNames(names, constants5); - (_a5 = this.catch) === null || _a5 === undefined || _a5.optimizeNames(names, constants5); - (_b3 = this.finally) === null || _b3 === undefined || _b3.optimizeNames(names, constants5); + (_a3 = this.catch) === null || _a3 === undefined || _a3.optimizeNames(names, constants5); + (_b2 = this.finally) === null || _b2 === undefined || _b2.optimizeNames(names, constants5); return this; } get names() { @@ -543624,9 +471038,9 @@ var require_codegen2 = __commonJS((exports) => { } class Catch extends BlockNode { - constructor(error46) { + constructor(error42) { super(); - this.error = error46; + this.error = error42; } render(opts) { return `catch(${this.error})` + super.render(opts); @@ -543676,9 +471090,9 @@ var require_codegen2 = __commonJS((exports) => { scopeCode() { return this._extScope.scopeCode(this._values); } - _def(varKind, nameOrPrefix, rhs, constant3) { + _def(varKind, nameOrPrefix, rhs, constant2) { const name = this._scope.toName(nameOrPrefix); - if (rhs !== undefined && constant3) + if (rhs !== undefined && constant2) this._constants[name.str] = rhs; this._leafNode(new Def(varKind, name, rhs)); return name; @@ -543756,8 +471170,8 @@ var require_codegen2 = __commonJS((exports) => { const name = this._scope.toName(nameOrPrefix); if (this.opts.es5) { const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); - return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, (i4) => { - this.var(name, (0, code_1._)`${arr}[${i4}]`); + return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, (i3) => { + this.var(name, (0, code_1._)`${arr}[${i3}]`); forBody(name); }); } @@ -543794,9 +471208,9 @@ var require_codegen2 = __commonJS((exports) => { this._blockNode(node); this.code(tryBody); if (catchCode) { - const error46 = this.name("e"); - this._currNode = node.catch = new Catch(error46); - catchCode(error46); + const error42 = this.name("e"); + this._currNode = node.catch = new Catch(error42); + catchCode(error42); } if (finallyCode) { this._currNode = node.finally = new Finally; @@ -543804,8 +471218,8 @@ var require_codegen2 = __commonJS((exports) => { } return this._endBlockNode(Catch, Finally); } - throw(error46) { - return this._leafNode(new Throw(error46)); + throw(error42) { + return this._leafNode(new Throw(error42)); } block(body, nodeCount) { this._blockStarts.push(this._nodes.length); @@ -543913,8 +471327,8 @@ var require_codegen2 = __commonJS((exports) => { for (const n2 in from) names[n2] = (names[n2] || 0) - (from[n2] || 0); } - function not(x4) { - return typeof x4 == "boolean" || typeof x4 == "number" || x4 === null ? !x4 : (0, code_1._)`!${par(x4)}`; + function not(x3) { + return typeof x3 == "boolean" || typeof x3 == "number" || x3 === null ? !x3 : (0, code_1._)`!${par(x3)}`; } exports.not = not; var andCode = mappend(exports.operators.AND); @@ -543928,15 +471342,15 @@ var require_codegen2 = __commonJS((exports) => { } exports.or = or; function mappend(op) { - return (x4, y2) => x4 === code_1.nil ? y2 : y2 === code_1.nil ? x4 : (0, code_1._)`${par(x4)} ${op} ${par(y2)}`; + return (x3, y2) => x3 === code_1.nil ? y2 : y2 === code_1.nil ? x3 : (0, code_1._)`${par(x3)} ${op} ${par(y2)}`; } - function par(x4) { - return x4 instanceof code_1.Name ? x4 : (0, code_1._)`(${x4})`; + function par(x3) { + return x3 instanceof code_1.Name ? x3 : (0, code_1._)`(${x3})`; } }); // ../node_modules/ajv/dist/compile/util.js -var require_util15 = __commonJS((exports) => { +var require_util13 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = undefined; var codegen_1 = require_codegen2(); @@ -544018,8 +471432,8 @@ var require_util15 = __commonJS((exports) => { exports.unescapeJsonPointer = unescapeJsonPointer; function eachItem(xs, f) { if (Array.isArray(xs)) { - for (const x4 of xs) - f(x4); + for (const x3 of xs) + f(x3); } else { f(xs); } @@ -544082,8 +471496,8 @@ var require_util15 = __commonJS((exports) => { })(Type || (exports.Type = Type = {})); function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { if (dataProp instanceof codegen_1.Name) { - const isNumber4 = dataPropType === Type.Num; - return jsPropertySyntax ? isNumber4 ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber4 ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; + const isNumber3 = dataPropType === Type.Num; + return jsPropertySyntax ? isNumber3 ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber3 ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; } return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); } @@ -544129,7 +471543,7 @@ var require_errors9 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = undefined; var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var names_1 = require_names2(); exports.keywordError = { message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation` @@ -544137,10 +471551,10 @@ var require_errors9 = __commonJS((exports) => { exports.keyword$DataError = { message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)` }; - function reportError2(cxt, error46 = exports.keywordError, errorPaths, overrideAllErrors) { + function reportError2(cxt, error42 = exports.keywordError, errorPaths, overrideAllErrors) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error46, errorPaths); + const errObj = errorObjectCode(cxt, error42, errorPaths); if (overrideAllErrors !== null && overrideAllErrors !== undefined ? overrideAllErrors : compositeRule || allErrors) { addError(gen, errObj); } else { @@ -544148,10 +471562,10 @@ var require_errors9 = __commonJS((exports) => { } } exports.reportError = reportError2; - function reportExtraError(cxt, error46 = exports.keywordError, errorPaths) { + function reportExtraError(cxt, error42 = exports.keywordError, errorPaths) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error46, errorPaths); + const errObj = errorObjectCode(cxt, error42, errorPaths); addError(gen, errObj); if (!(compositeRule || allErrors)) { returnErrors(it, names_1.default.vErrors); @@ -544166,21 +471580,21 @@ var require_errors9 = __commonJS((exports) => { function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) { if (errsCount === undefined) throw new Error("ajv implementation error"); - const err3 = gen.name("err"); - gen.forRange("i", errsCount, names_1.default.errors, (i4) => { - gen.const(err3, (0, codegen_1._)`${names_1.default.vErrors}[${i4}]`); - gen.if((0, codegen_1._)`${err3}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err3}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); - gen.assign((0, codegen_1._)`${err3}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`); + const err2 = gen.name("err"); + gen.forRange("i", errsCount, names_1.default.errors, (i3) => { + gen.const(err2, (0, codegen_1._)`${names_1.default.vErrors}[${i3}]`); + gen.if((0, codegen_1._)`${err2}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err2}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); + gen.assign((0, codegen_1._)`${err2}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`); if (it.opts.verbose) { - gen.assign((0, codegen_1._)`${err3}.schema`, schemaValue); - gen.assign((0, codegen_1._)`${err3}.data`, data); + gen.assign((0, codegen_1._)`${err2}.schema`, schemaValue); + gen.assign((0, codegen_1._)`${err2}.data`, data); } }); } exports.extendErrors = extendErrors; function addError(gen, errObj) { - const err3 = gen.const("err", errObj); - gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err3}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err3})`); + const err2 = gen.const("err", errObj); + gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err2}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err2})`); gen.code((0, codegen_1._)`${names_1.default.errors}++`); } function returnErrors(it, errs) { @@ -544201,19 +471615,19 @@ var require_errors9 = __commonJS((exports) => { schema: new codegen_1.Name("schema"), parentSchema: new codegen_1.Name("parentSchema") }; - function errorObjectCode(cxt, error46, errorPaths) { + function errorObjectCode(cxt, error42, errorPaths) { const { createErrors } = cxt.it; if (createErrors === false) return (0, codegen_1._)`{}`; - return errorObject(cxt, error46, errorPaths); + return errorObject(cxt, error42, errorPaths); } - function errorObject(cxt, error46, errorPaths = {}) { + function errorObject(cxt, error42, errorPaths = {}) { const { gen, it } = cxt; const keyValues = [ errorInstancePath(it, errorPaths), errorSchemaPath(cxt, errorPaths) ]; - extraErrorProps(cxt, error46, keyValues); + extraErrorProps(cxt, error42, keyValues); return gen.object(...keyValues); } function errorInstancePath({ errorPath }, { instancePath }) { @@ -544296,8 +471710,8 @@ var require_rules2 = __commonJS((exports) => { exports.getRules = exports.isJSONType = undefined; var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; var jsonTypes = new Set(_jsonTypes); - function isJSONType(x4) { - return typeof x4 == "string" && jsonTypes.has(x4); + function isJSONType(x3) { + return typeof x3 == "string" && jsonTypes.has(x3); } exports.isJSONType = isJSONType; function getRules() { @@ -544332,8 +471746,8 @@ var require_applicability2 = __commonJS((exports) => { } exports.shouldUseGroup = shouldUseGroup; function shouldUseRule(schema, rule) { - var _a5; - return schema[rule.keyword] !== undefined || ((_a5 = rule.definition.implements) === null || _a5 === undefined ? undefined : _a5.some((kwd) => schema[kwd] !== undefined)); + var _a3; + return schema[rule.keyword] !== undefined || ((_a3 = rule.definition.implements) === null || _a3 === undefined ? undefined : _a3.some((kwd) => schema[kwd] !== undefined)); } exports.shouldUseRule = shouldUseRule; }); @@ -544346,44 +471760,44 @@ var require_dataType2 = __commonJS((exports) => { var applicability_1 = require_applicability2(); var errors_1 = require_errors9(); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var DataType; (function(DataType2) { DataType2[DataType2["Correct"] = 0] = "Correct"; DataType2[DataType2["Wrong"] = 1] = "Wrong"; })(DataType || (exports.DataType = DataType = {})); function getSchemaTypes(schema) { - const types4 = getJSONTypes(schema.type); - const hasNull = types4.includes("null"); + const types3 = getJSONTypes(schema.type); + const hasNull = types3.includes("null"); if (hasNull) { if (schema.nullable === false) throw new Error("type: null contradicts nullable: false"); } else { - if (!types4.length && schema.nullable !== undefined) { + if (!types3.length && schema.nullable !== undefined) { throw new Error('"nullable" cannot be used without "type"'); } if (schema.nullable === true) - types4.push("null"); + types3.push("null"); } - return types4; + return types3; } exports.getSchemaTypes = getSchemaTypes; function getJSONTypes(ts) { - const types4 = Array.isArray(ts) ? ts : ts ? [ts] : []; - if (types4.every(rules_1.isJSONType)) - return types4; - throw new Error("type must be JSONType or JSONType[]: " + types4.join(",")); + const types3 = Array.isArray(ts) ? ts : ts ? [ts] : []; + if (types3.every(rules_1.isJSONType)) + return types3; + throw new Error("type must be JSONType or JSONType[]: " + types3.join(",")); } exports.getJSONTypes = getJSONTypes; - function coerceAndCheckDataType(it, types4) { + function coerceAndCheckDataType(it, types3) { const { gen, data, opts } = it; - const coerceTo = coerceToTypes(types4, opts.coerceTypes); - const checkTypes = types4.length > 0 && !(coerceTo.length === 0 && types4.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types4[0])); + const coerceTo = coerceToTypes(types3, opts.coerceTypes); + const checkTypes = types3.length > 0 && !(coerceTo.length === 0 && types3.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types3[0])); if (checkTypes) { - const wrongType = checkDataTypes(types4, data, opts.strictNumbers, DataType.Wrong); + const wrongType = checkDataTypes(types3, data, opts.strictNumbers, DataType.Wrong); gen.if(wrongType, () => { if (coerceTo.length) - coerceData(it, types4, coerceTo); + coerceData(it, types3, coerceTo); else reportTypeError(it); }); @@ -544392,15 +471806,15 @@ var require_dataType2 = __commonJS((exports) => { } exports.coerceAndCheckDataType = coerceAndCheckDataType; var COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); - function coerceToTypes(types4, coerceTypes) { - return coerceTypes ? types4.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : []; + function coerceToTypes(types3, coerceTypes) { + return coerceTypes ? types3.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : []; } - function coerceData(it, types4, coerceTo) { + function coerceData(it, types3, coerceTo) { const { gen, data, opts } = it; const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`); const coerced = gen.let("coerced", (0, codegen_1._)`undefined`); if (opts.coerceTypes === "array") { - gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types4, data, opts.strictNumbers), () => gen.assign(coerced, data))); + gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types3, data, opts.strictNumbers), () => gen.assign(coerced, data))); } gen.if((0, codegen_1._)`${coerced} !== undefined`); for (const t of coerceTo) { @@ -544446,26 +471860,26 @@ var require_dataType2 = __commonJS((exports) => { } function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; - let cond3; + let cond2; switch (dataType) { case "null": return (0, codegen_1._)`${data} ${EQ} null`; case "array": - cond3 = (0, codegen_1._)`Array.isArray(${data})`; + cond2 = (0, codegen_1._)`Array.isArray(${data})`; break; case "object": - cond3 = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`; + cond2 = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`; break; case "integer": - cond3 = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`); + cond2 = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`); break; case "number": - cond3 = numCond(); + cond2 = numCond(); break; default: return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`; } - return correct === DataType.Correct ? cond3 : (0, codegen_1.not)(cond3); + return correct === DataType.Correct ? cond2 : (0, codegen_1.not)(cond2); function numCond(_cond = codegen_1.nil) { return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil); } @@ -544475,22 +471889,22 @@ var require_dataType2 = __commonJS((exports) => { if (dataTypes.length === 1) { return checkDataType(dataTypes[0], data, strictNums, correct); } - let cond3; - const types4 = (0, util_1.toHash)(dataTypes); - if (types4.array && types4.object) { + let cond2; + const types3 = (0, util_1.toHash)(dataTypes); + if (types3.array && types3.object) { const notObj = (0, codegen_1._)`typeof ${data} != "object"`; - cond3 = types4.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`; - delete types4.null; - delete types4.array; - delete types4.object; + cond2 = types3.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`; + delete types3.null; + delete types3.array; + delete types3.object; } else { - cond3 = codegen_1.nil; + cond2 = codegen_1.nil; } - if (types4.number) - delete types4.integer; - for (const t in types4) - cond3 = (0, codegen_1.and)(cond3, checkDataType(t, data, strictNums, correct)); - return cond3; + if (types3.number) + delete types3.integer; + for (const t in types3) + cond2 = (0, codegen_1.and)(cond2, checkDataType(t, data, strictNums, correct)); + return cond2; } exports.checkDataTypes = checkDataTypes; var typeError = { @@ -544524,7 +471938,7 @@ var require_defaults2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.assignDefaults = undefined; var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); function assignDefaults(it, ty) { const { properties, items } = it.schema; if (ty === "object" && properties) { @@ -544532,7 +471946,7 @@ var require_defaults2 = __commonJS((exports) => { assignDefault(it, key, properties[key].default); } } else if (ty === "array" && Array.isArray(items)) { - items.forEach((sch, i4) => assignDefault(it, i4, sch.default)); + items.forEach((sch, i3) => assignDefault(it, i3, sch.default)); } } exports.assignDefaults = assignDefaults; @@ -544558,9 +471972,9 @@ var require_code4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = undefined; var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var names_1 = require_names2(); - var util_2 = require_util15(); + var util_2 = require_util13(); function checkReportMissingProp(cxt, prop) { const { gen, data, it } = cxt; gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { @@ -544585,18 +471999,18 @@ var require_code4 = __commonJS((exports) => { }); } exports.hasPropFunc = hasPropFunc; - function isOwnProperty(gen, data, property3) { - return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property3})`; + function isOwnProperty(gen, data, property2) { + return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property2})`; } exports.isOwnProperty = isOwnProperty; - function propertyInData(gen, data, property3, ownProperties) { - const cond3 = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property3)} !== undefined`; - return ownProperties ? (0, codegen_1._)`${cond3} && ${isOwnProperty(gen, data, property3)}` : cond3; + function propertyInData(gen, data, property2, ownProperties) { + const cond2 = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property2)} !== undefined`; + return ownProperties ? (0, codegen_1._)`${cond2} && ${isOwnProperty(gen, data, property2)}` : cond2; } exports.propertyInData = propertyInData; - function noPropertyInData(gen, data, property3, ownProperties) { - const cond3 = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property3)} === undefined`; - return ownProperties ? (0, codegen_1.or)(cond3, (0, codegen_1.not)(isOwnProperty(gen, data, property3))) : cond3; + function noPropertyInData(gen, data, property2, ownProperties) { + const cond2 = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property2)} === undefined`; + return ownProperties ? (0, codegen_1.or)(cond2, (0, codegen_1.not)(isOwnProperty(gen, data, property2))) : cond2; } exports.noPropertyInData = noPropertyInData; function allSchemaProperties(schemaMap) { @@ -544646,10 +472060,10 @@ var require_code4 = __commonJS((exports) => { return valid; function validateItems(notValid) { const len = gen.const("len", (0, codegen_1._)`${data}.length`); - gen.forRange("i", 0, len, (i4) => { + gen.forRange("i", 0, len, (i3) => { cxt.subschema({ keyword, - dataProp: i4, + dataProp: i3, dataPropType: util_1.Type.Num }, valid); gen.if((0, codegen_1.not)(valid), notValid); @@ -544666,10 +472080,10 @@ var require_code4 = __commonJS((exports) => { return; const valid = gen.let("valid", false); const schValid = gen.name("_valid"); - gen.block(() => schema.forEach((_sch, i4) => { + gen.block(() => schema.forEach((_sch, i3) => { const schCxt = cxt.subschema({ keyword, - schemaProp: i4, + schemaProp: i3, compositeRule: true }, schValid); gen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`); @@ -544708,14 +472122,14 @@ var require_keyword2 = __commonJS((exports) => { } exports.macroKeywordCode = macroKeywordCode; function funcKeywordCode(cxt, def2) { - var _a5; + var _a3; const { gen, keyword, schema, parentSchema, $data, it } = cxt; checkAsyncKeyword(it, def2); - const validate3 = !$data && def2.compile ? def2.compile.call(it.self, schema, parentSchema, it) : def2.validate; - const validateRef = useKeyword(gen, keyword, validate3); + const validate2 = !$data && def2.compile ? def2.compile.call(it.self, schema, parentSchema, it) : def2.validate; + const validateRef = useKeyword(gen, keyword, validate2); const valid = gen.let("valid"); cxt.block$data(valid, validateKeyword); - cxt.ok((_a5 = def2.valid) !== null && _a5 !== undefined ? _a5 : valid); + cxt.ok((_a3 = def2.valid) !== null && _a3 !== undefined ? _a3 : valid); function validateKeyword() { if (def2.errors === false) { assignValid(); @@ -544746,8 +472160,8 @@ var require_keyword2 = __commonJS((exports) => { gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def2.modifying); } function reportErrs(errors7) { - var _a6; - gen.if((0, codegen_1.not)((_a6 = def2.valid) !== null && _a6 !== undefined ? _a6 : valid), errors7); + var _a4; + gen.if((0, codegen_1.not)((_a4 = def2.valid) !== null && _a4 !== undefined ? _a4 : valid), errors7); } } exports.funcKeywordCode = funcKeywordCode; @@ -544766,10 +472180,10 @@ var require_keyword2 = __commonJS((exports) => { if (def2.async && !schemaEnv.$async) throw new Error("async keyword in sync schema"); } - function useKeyword(gen, keyword, result3) { - if (result3 === undefined) + function useKeyword(gen, keyword, result2) { + if (result2 === undefined) throw new Error(`keyword "${keyword}" failed to compile`); - return gen.scopeValue("keyword", typeof result3 == "function" ? { ref: result3 } : { ref: result3, code: (0, codegen_1.stringify)(result3) }); + return gen.scopeValue("keyword", typeof result2 == "function" ? { ref: result2 } : { ref: result2, code: (0, codegen_1.stringify)(result2) }); } function validSchemaType(schema, schemaType, allowUndefined = false) { return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined"); @@ -544802,7 +472216,7 @@ var require_subschema2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = undefined; var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { if (keyword !== undefined && schema !== undefined) { throw new Error('both "keyword" and "schema" passed, only one allowed'); @@ -544885,13 +472299,13 @@ var require_fast_deep_equal2 = __commonJS((exports, module) => { if (a2 && b && typeof a2 == "object" && typeof b == "object") { if (a2.constructor !== b.constructor) return false; - var length, i4, keys3; + var length, i3, keys2; if (Array.isArray(a2)) { length = a2.length; if (length != b.length) return false; - for (i4 = length;i4-- !== 0; ) - if (!equal(a2[i4], b[i4])) + for (i3 = length;i3-- !== 0; ) + if (!equal(a2[i3], b[i3])) return false; return true; } @@ -544901,15 +472315,15 @@ var require_fast_deep_equal2 = __commonJS((exports, module) => { return a2.valueOf() === b.valueOf(); if (a2.toString !== Object.prototype.toString) return a2.toString() === b.toString(); - keys3 = Object.keys(a2); - length = keys3.length; + keys2 = Object.keys(a2); + length = keys2.length; if (length !== Object.keys(b).length) return false; - for (i4 = length;i4-- !== 0; ) - if (!Object.prototype.hasOwnProperty.call(b, keys3[i4])) + for (i3 = length;i3-- !== 0; ) + if (!Object.prototype.hasOwnProperty.call(b, keys2[i3])) return false; - for (i4 = length;i4-- !== 0; ) { - var key = keys3[i4]; + for (i3 = length;i3-- !== 0; ) { + var key = keys2[i3]; if (!equal(a2[key], b[key])) return false; } @@ -544982,8 +472396,8 @@ var require_json_schema_traverse2 = __commonJS((exports, module) => { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) { - for (var i4 = 0;i4 < sch.length; i4++) - _traverse(opts, pre, post, sch[i4], jsonPtr + "/" + key + "/" + i4, rootSchema, jsonPtr, key, schema, i4); + for (var i3 = 0;i3 < sch.length; i3++) + _traverse(opts, pre, post, sch[i3], jsonPtr + "/" + key + "/" + i3, rootSchema, jsonPtr, key, schema, i3); } } else if (key in traverse.propsKeywords) { if (sch && typeof sch == "object") { @@ -545006,7 +472420,7 @@ var require_json_schema_traverse2 = __commonJS((exports, module) => { var require_resolve2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = undefined; - var util_1 = require_util15(); + var util_1 = require_util13(); var equal = require_fast_deep_equal2(); var traverse = require_json_schema_traverse2(); var SIMPLE_INLINED = new Set([ @@ -545072,8 +472486,8 @@ var require_resolve2 = __commonJS((exports) => { } return count3; } - function getFullPath(resolver, id = "", normalize12) { - if (normalize12 !== false) + function getFullPath(resolver, id = "", normalize11) { + if (normalize11 !== false) id = normalizeId(id); const p = resolver.parse(id); return _getFullPath(resolver, p); @@ -545156,7 +472570,7 @@ var require_resolve2 = __commonJS((exports) => { }); // ../node_modules/ajv/dist/compile/validate/index.js -var require_validate4 = __commonJS((exports) => { +var require_validate3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getData = exports.KeywordCxt = exports.validateFunctionCode = undefined; var boolSchema_1 = require_boolSchema2(); @@ -545169,7 +472583,7 @@ var require_validate4 = __commonJS((exports) => { var codegen_1 = require_codegen2(); var names_1 = require_names2(); var resolve_1 = require_resolve2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var errors_1 = require_errors9(); function validateFunctionCode(it) { if (isSchemaObj(it)) { @@ -545276,9 +472690,9 @@ var require_validate4 = __commonJS((exports) => { function typeAndKeywords(it, errsCount) { if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount); - const types4 = (0, dataType_1.getSchemaTypes)(it.schema); - const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types4); - schemaKeywords(it, types4, !checkedTypes, errsCount); + const types3 = (0, dataType_1.getSchemaTypes)(it.schema); + const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types3); + schemaKeywords(it, types3, !checkedTypes, errsCount); } function checkRefsAndKeywords(it) { const { schema, errSchemaPath, opts, self: self2 } = it; @@ -545328,7 +472742,7 @@ var require_validate4 = __commonJS((exports) => { if (items instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.items`, items); } - function schemaKeywords(it, types4, typeErrors, errsCount) { + function schemaKeywords(it, types3, typeErrors, errsCount) { const { gen, schema, data, allErrors, opts, self: self2 } = it; const { RULES } = self2; if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { @@ -545336,7 +472750,7 @@ var require_validate4 = __commonJS((exports) => { return; } if (!opts.jtd) - checkStrictTypes(it, types4); + checkStrictTypes(it, types3); gen.block(() => { for (const group of RULES.rules) groupKeywords(group); @@ -545348,7 +472762,7 @@ var require_validate4 = __commonJS((exports) => { if (group.type) { gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); iterateKeywords(it, group); - if (types4.length === 1 && types4[0] === group.type && typeErrors) { + if (types3.length === 1 && types3[0] === group.type && typeErrors) { gen.else(); (0, dataType_2.reportTypeError)(it); } @@ -545372,27 +472786,27 @@ var require_validate4 = __commonJS((exports) => { } }); } - function checkStrictTypes(it, types4) { + function checkStrictTypes(it, types3) { if (it.schemaEnv.meta || !it.opts.strictTypes) return; - checkContextTypes(it, types4); + checkContextTypes(it, types3); if (!it.opts.allowUnionTypes) - checkMultipleTypes(it, types4); + checkMultipleTypes(it, types3); checkKeywordTypes(it, it.dataTypes); } - function checkContextTypes(it, types4) { - if (!types4.length) + function checkContextTypes(it, types3) { + if (!types3.length) return; if (!it.dataTypes.length) { - it.dataTypes = types4; + it.dataTypes = types3; return; } - types4.forEach((t) => { + types3.forEach((t) => { if (!includesType(it.dataTypes, t)) { strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); } }); - narrowSchemaTypes(it, types4); + narrowSchemaTypes(it, types3); } function checkMultipleTypes(it, ts) { if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { @@ -545449,7 +472863,7 @@ var require_validate4 = __commonJS((exports) => { this.it = it; this.def = def2; if (this.$data) { - this.schemaCode = it.gen.const("vSchema", getData3(this.$data, it)); + this.schemaCode = it.gen.const("vSchema", getData2(this.$data, it)); } else { this.schemaCode = this.schemaValue; if (!(0, keyword_1.validSchemaType)(this.schema, def2.schemaType, def2.allowUndefined)) { @@ -545524,12 +472938,12 @@ var require_validate4 = __commonJS((exports) => { throw new Error('add "trackErrors" to keyword definition'); (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); } - ok(cond3) { + ok(cond2) { if (!this.allErrors) - this.gen.if(cond3); + this.gen.if(cond2); } - setParams(obj, assign3) { - if (assign3) + setParams(obj, assign2) { + if (assign2) Object.assign(this.params, obj); else this.params = obj; @@ -545617,7 +473031,7 @@ var require_validate4 = __commonJS((exports) => { } var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; - function getData3($data, { dataLevel, dataNames, dataPathArr }) { + function getData2($data, { dataLevel, dataNames, dataPathArr }) { let jsonPointer; let data; if ($data === "") @@ -545628,11 +473042,11 @@ var require_validate4 = __commonJS((exports) => { jsonPointer = $data; data = names_1.default.rootData; } else { - const matches3 = RELATIVE_JSON_POINTER.exec($data); - if (!matches3) + const matches2 = RELATIVE_JSON_POINTER.exec($data); + if (!matches2) throw new Error(`Invalid JSON-pointer: ${$data}`); - const up = +matches3[1]; - jsonPointer = matches3[2]; + const up = +matches2[1]; + jsonPointer = matches2[2]; if (jsonPointer === "#") { if (up >= dataLevel) throw new Error(errorMsg("property/index", up)); @@ -545657,7 +473071,7 @@ var require_validate4 = __commonJS((exports) => { return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; } } - exports.getData = getData3; + exports.getData = getData2; }); // ../node_modules/ajv/dist/runtime/validation_error.js @@ -545697,24 +473111,24 @@ var require_compile2 = __commonJS((exports) => { var validation_error_1 = require_validation_error2(); var names_1 = require_names2(); var resolve_1 = require_resolve2(); - var util_1 = require_util15(); - var validate_1 = require_validate4(); + var util_1 = require_util13(); + var validate_1 = require_validate3(); class SchemaEnv { - constructor(env5) { - var _a5; + constructor(env4) { + var _a3; this.refs = {}; this.dynamicAnchors = {}; let schema; - if (typeof env5.schema == "object") - schema = env5.schema; - this.schema = env5.schema; - this.schemaId = env5.schemaId; - this.root = env5.root || this; - this.baseId = (_a5 = env5.baseId) !== null && _a5 !== undefined ? _a5 : (0, resolve_1.normalizeId)(schema === null || schema === undefined ? undefined : schema[env5.schemaId || "$id"]); - this.schemaPath = env5.schemaPath; - this.localRefs = env5.localRefs; - this.meta = env5.meta; + if (typeof env4.schema == "object") + schema = env4.schema; + this.schema = env4.schema; + this.schemaId = env4.schemaId; + this.root = env4.root || this; + this.baseId = (_a3 = env4.baseId) !== null && _a3 !== undefined ? _a3 : (0, resolve_1.normalizeId)(schema === null || schema === undefined ? undefined : schema[env4.schemaId || "$id"]); + this.schemaPath = env4.schemaPath; + this.localRefs = env4.localRefs; + this.meta = env4.meta; this.$async = schema === null || schema === undefined ? undefined : schema.$async; this.refs = {}; } @@ -545771,28 +473185,28 @@ var require_compile2 = __commonJS((exports) => { if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch); const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); - const validate3 = makeValidate(this, this.scope.get()); - this.scope.value(validateName, { ref: validate3 }); - validate3.errors = null; - validate3.schema = sch.schema; - validate3.schemaEnv = sch; + const validate2 = makeValidate(this, this.scope.get()); + this.scope.value(validateName, { ref: validate2 }); + validate2.errors = null; + validate2.schema = sch.schema; + validate2.schemaEnv = sch; if (sch.$async) - validate3.$async = true; + validate2.$async = true; if (this.opts.code.source === true) { - validate3.source = { validateName, validateCode, scopeValues: gen._values }; + validate2.source = { validateName, validateCode, scopeValues: gen._values }; } if (this.opts.unevaluated) { const { props, items } = schemaCxt; - validate3.evaluated = { + validate2.evaluated = { props: props instanceof codegen_1.Name ? undefined : props, items: items instanceof codegen_1.Name ? undefined : items, dynamicProps: props instanceof codegen_1.Name, dynamicItems: items instanceof codegen_1.Name }; - if (validate3.source) - validate3.source.evaluated = (0, codegen_1.stringify)(validate3.evaluated); + if (validate2.source) + validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated); } - sch.validate = validate3; + sch.validate = validate2; return sch; } catch (e) { delete sch.validate; @@ -545805,22 +473219,22 @@ var require_compile2 = __commonJS((exports) => { } } exports.compileSchema = compileSchema; - function resolveRef2(root3, baseId, ref) { - var _a5; + function resolveRef2(root2, baseId, ref) { + var _a3; ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); - const schOrFunc = root3.refs[ref]; + const schOrFunc = root2.refs[ref]; if (schOrFunc) return schOrFunc; - let _sch = resolve36.call(this, root3, ref); + let _sch = resolve30.call(this, root2, ref); if (_sch === undefined) { - const schema = (_a5 = root3.localRefs) === null || _a5 === undefined ? undefined : _a5[ref]; + const schema = (_a3 = root2.localRefs) === null || _a3 === undefined ? undefined : _a3[ref]; const { schemaId } = this.opts; if (schema) - _sch = new SchemaEnv({ schema, schemaId, root: root3, baseId }); + _sch = new SchemaEnv({ schema, schemaId, root: root2, baseId }); } if (_sch === undefined) return; - return root3.refs[ref] = inlineOrCompile.call(this, _sch); + return root2.refs[ref] = inlineOrCompile.call(this, _sch); } exports.resolveRef = resolveRef2; function inlineOrCompile(sch) { @@ -545838,23 +473252,23 @@ var require_compile2 = __commonJS((exports) => { function sameSchemaEnv(s1, s2) { return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; } - function resolve36(root3, ref) { + function resolve30(root2, ref) { let sch; while (typeof (sch = this.refs[ref]) == "string") ref = sch; - return sch || this.schemas[ref] || resolveSchema.call(this, root3, ref); + return sch || this.schemas[ref] || resolveSchema.call(this, root2, ref); } - function resolveSchema(root3, ref) { + function resolveSchema(root2, ref) { const p = this.opts.uriResolver.parse(ref); const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); - let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root3.baseId, undefined); - if (Object.keys(root3.schema).length > 0 && refPath === baseId) { - return getJsonPointer.call(this, p, root3); + let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root2.baseId, undefined); + if (Object.keys(root2.schema).length > 0 && refPath === baseId) { + return getJsonPointer.call(this, p, root2); } const id = (0, resolve_1.normalizeId)(refPath); const schOrRef = this.refs[id] || this.schemas[id]; if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root3, schOrRef); + const sch = resolveSchema.call(this, root2, schOrRef); if (typeof (sch === null || sch === undefined ? undefined : sch.schema) !== "object") return; return getJsonPointer.call(this, p, sch); @@ -545869,7 +473283,7 @@ var require_compile2 = __commonJS((exports) => { const schId = schema[schemaId]; if (schId) baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - return new SchemaEnv({ schema, schemaId, root: root3, baseId }); + return new SchemaEnv({ schema, schemaId, root: root2, baseId }); } return getJsonPointer.call(this, p, schOrRef); } @@ -545881,9 +473295,9 @@ var require_compile2 = __commonJS((exports) => { "dependencies", "definitions" ]); - function getJsonPointer(parsedRef, { baseId, schema, root: root3 }) { - var _a5; - if (((_a5 = parsedRef.fragment) === null || _a5 === undefined ? undefined : _a5[0]) !== "/") + function getJsonPointer(parsedRef, { baseId, schema, root: root2 }) { + var _a3; + if (((_a3 = parsedRef.fragment) === null || _a3 === undefined ? undefined : _a3[0]) !== "/") return; for (const part of parsedRef.fragment.slice(1).split("/")) { if (typeof schema === "boolean") @@ -545897,15 +473311,15 @@ var require_compile2 = __commonJS((exports) => { baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); } } - let env5; + let env4; if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); - env5 = resolveSchema.call(this, root3, $ref); + env4 = resolveSchema.call(this, root2, $ref); } const { schemaId } = this.opts; - env5 = env5 || new SchemaEnv({ schema, schemaId, root: root3, baseId }); - if (env5.schema !== env5.root.schema) - return env5; + env4 = env4 || new SchemaEnv({ schema, schemaId, root: root2, baseId }); + if (env4.schema !== env4.root.schema) + return env4; return; } }); @@ -545928,30 +473342,30 @@ var require_data2 = __commonJS((exports, module) => { }); // ../node_modules/fast-uri/lib/utils.js -var require_utils18 = __commonJS((exports, module) => { +var require_utils17 = __commonJS((exports, module) => { var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu); var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u); - function stringArrayToHexStripped(input11) { + function stringArrayToHexStripped(input) { let acc = ""; let code = 0; - let i4 = 0; - for (i4 = 0;i4 < input11.length; i4++) { - code = input11[i4].charCodeAt(0); + let i3 = 0; + for (i3 = 0;i3 < input.length; i3++) { + code = input[i3].charCodeAt(0); if (code === 48) { continue; } if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { return ""; } - acc += input11[i4]; + acc += input[i3]; break; } - for (i4 += 1;i4 < input11.length; i4++) { - code = input11[i4].charCodeAt(0); + for (i3 += 1;i3 < input.length; i3++) { + code = input[i3].charCodeAt(0); if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { return ""; } - acc += input11[i4]; + acc += input[i3]; } return acc; } @@ -545973,7 +473387,7 @@ var require_utils18 = __commonJS((exports, module) => { } return true; } - function getIPV6(input11) { + function getIPV6(input) { let tokenCount = 0; const output = { error: false, address: "", zone: "" }; const address = []; @@ -545981,8 +473395,8 @@ var require_utils18 = __commonJS((exports, module) => { let endipv6Encountered = false; let endIpv6 = false; let consume = consumeHextets; - for (let i4 = 0;i4 < input11.length; i4++) { - const cursor = input11[i4]; + for (let i3 = 0;i3 < input.length; i3++) { + const cursor = input[i3]; if (cursor === "[" || cursor === "]") { continue; } @@ -545997,7 +473411,7 @@ var require_utils18 = __commonJS((exports, module) => { output.error = true; break; } - if (i4 > 0 && input11[i4 - 1] === ":") { + if (i3 > 0 && input[i3 - 1] === ":") { endipv6Encountered = true; } address.push(":"); @@ -546043,44 +473457,44 @@ var require_utils18 = __commonJS((exports, module) => { } function findToken(str, token) { let ind = 0; - for (let i4 = 0;i4 < str.length; i4++) { - if (str[i4] === token) + for (let i3 = 0;i3 < str.length; i3++) { + if (str[i3] === token) ind++; } return ind; } - function removeDotSegments(path21) { - let input11 = path21; + function removeDotSegments(path16) { + let input = path16; const output = []; let nextSlash = -1; let len = 0; - while (len = input11.length) { + while (len = input.length) { if (len === 1) { - if (input11 === ".") { + if (input === ".") { break; - } else if (input11 === "/") { + } else if (input === "/") { output.push("/"); break; } else { - output.push(input11); + output.push(input); break; } } else if (len === 2) { - if (input11[0] === ".") { - if (input11[1] === ".") { + if (input[0] === ".") { + if (input[1] === ".") { break; - } else if (input11[1] === "/") { - input11 = input11.slice(2); + } else if (input[1] === "/") { + input = input.slice(2); continue; } - } else if (input11[0] === "/") { - if (input11[1] === "." || input11[1] === "/") { + } else if (input[0] === "/") { + if (input[1] === "." || input[1] === "/") { output.push("/"); break; } } } else if (len === 3) { - if (input11 === "/..") { + if (input === "/..") { if (output.length !== 0) { output.pop(); } @@ -546088,24 +473502,24 @@ var require_utils18 = __commonJS((exports, module) => { break; } } - if (input11[0] === ".") { - if (input11[1] === ".") { - if (input11[2] === "/") { - input11 = input11.slice(3); + if (input[0] === ".") { + if (input[1] === ".") { + if (input[2] === "/") { + input = input.slice(3); continue; } - } else if (input11[1] === "/") { - input11 = input11.slice(2); + } else if (input[1] === "/") { + input = input.slice(2); continue; } - } else if (input11[0] === "/") { - if (input11[1] === ".") { - if (input11[2] === "/") { - input11 = input11.slice(2); + } else if (input[0] === "/") { + if (input[1] === ".") { + if (input[2] === "/") { + input = input.slice(2); continue; - } else if (input11[2] === ".") { - if (input11[3] === "/") { - input11 = input11.slice(3); + } else if (input[2] === ".") { + if (input[3] === "/") { + input = input.slice(3); if (output.length !== 0) { output.pop(); } @@ -546114,12 +473528,12 @@ var require_utils18 = __commonJS((exports, module) => { } } } - if ((nextSlash = input11.indexOf("/", 1)) === -1) { - output.push(input11); + if ((nextSlash = input.indexOf("/", 1)) === -1) { + output.push(input); break; } else { - output.push(input11.slice(0, nextSlash)); - input11 = input11.slice(nextSlash); + output.push(input.slice(0, nextSlash)); + input = input.slice(nextSlash); } } return output.join(""); @@ -546184,7 +473598,7 @@ var require_utils18 = __commonJS((exports, module) => { // ../node_modules/fast-uri/lib/schemes.js var require_schemes2 = __commonJS((exports, module) => { - var { isUUID } = require_utils18(); + var { isUUID } = require_utils17(); var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; var supportedSchemeNames = [ "http", @@ -546240,8 +473654,8 @@ var require_schemes2 = __commonJS((exports, module) => { wsComponent.secure = undefined; } if (wsComponent.resourceName) { - const [path21, query2] = wsComponent.resourceName.split("?"); - wsComponent.path = path21 && path21 !== "/" ? path21 : undefined; + const [path16, query2] = wsComponent.resourceName.split("?"); + wsComponent.path = path16 && path16 !== "/" ? path16 : undefined; wsComponent.query = query2; wsComponent.resourceName = undefined; } @@ -546253,11 +473667,11 @@ var require_schemes2 = __commonJS((exports, module) => { urnComponent.error = "URN can not be parsed"; return urnComponent; } - const matches3 = urnComponent.path.match(URN_REG); - if (matches3) { + const matches2 = urnComponent.path.match(URN_REG); + if (matches2) { const scheme = options2.scheme || urnComponent.scheme || "urn"; - urnComponent.nid = matches3[1].toLowerCase(); - urnComponent.nss = matches3[2]; + urnComponent.nid = matches2[1].toLowerCase(); + urnComponent.nss = matches2[2]; const urnScheme = `${scheme}:${options2.nid || urnComponent.nid}`; const schemeHandler = getSchemeHandler(urnScheme); urnComponent.path = undefined; @@ -546358,9 +473772,9 @@ var require_schemes2 = __commonJS((exports, module) => { // ../node_modules/fast-uri/index.js var require_fast_uri2 = __commonJS((exports, module) => { - var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils18(); + var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils17(); var { SCHEMES, getSchemeHandler } = require_schemes2(); - function normalize12(uri, options2) { + function normalize11(uri, options2) { if (typeof uri === "string") { uri = serialize2(parse15(uri, options2), options2); } else if (typeof uri === "object") { @@ -546368,55 +473782,55 @@ var require_fast_uri2 = __commonJS((exports, module) => { } return uri; } - function resolve36(baseURI, relativeURI, options2) { + function resolve30(baseURI, relativeURI, options2) { const schemelessOptions = options2 ? Object.assign({ scheme: "null" }, options2) : { scheme: "null" }; const resolved = resolveComponent(parse15(baseURI, schemelessOptions), parse15(relativeURI, schemelessOptions), schemelessOptions, true); schemelessOptions.skipEscape = true; return serialize2(resolved, schemelessOptions); } - function resolveComponent(base2, relative22, options2, skipNormalization) { + function resolveComponent(base2, relative20, options2, skipNormalization) { const target = {}; if (!skipNormalization) { base2 = parse15(serialize2(base2, options2), options2); - relative22 = parse15(serialize2(relative22, options2), options2); + relative20 = parse15(serialize2(relative20, options2), options2); } options2 = options2 || {}; - if (!options2.tolerant && relative22.scheme) { - target.scheme = relative22.scheme; - target.userinfo = relative22.userinfo; - target.host = relative22.host; - target.port = relative22.port; - target.path = removeDotSegments(relative22.path || ""); - target.query = relative22.query; + if (!options2.tolerant && relative20.scheme) { + target.scheme = relative20.scheme; + target.userinfo = relative20.userinfo; + target.host = relative20.host; + target.port = relative20.port; + target.path = removeDotSegments(relative20.path || ""); + target.query = relative20.query; } else { - if (relative22.userinfo !== undefined || relative22.host !== undefined || relative22.port !== undefined) { - target.userinfo = relative22.userinfo; - target.host = relative22.host; - target.port = relative22.port; - target.path = removeDotSegments(relative22.path || ""); - target.query = relative22.query; + if (relative20.userinfo !== undefined || relative20.host !== undefined || relative20.port !== undefined) { + target.userinfo = relative20.userinfo; + target.host = relative20.host; + target.port = relative20.port; + target.path = removeDotSegments(relative20.path || ""); + target.query = relative20.query; } else { - if (!relative22.path) { + if (!relative20.path) { target.path = base2.path; - if (relative22.query !== undefined) { - target.query = relative22.query; + if (relative20.query !== undefined) { + target.query = relative20.query; } else { target.query = base2.query; } } else { - if (relative22.path[0] === "/") { - target.path = removeDotSegments(relative22.path); + if (relative20.path[0] === "/") { + target.path = removeDotSegments(relative20.path); } else { if ((base2.userinfo !== undefined || base2.host !== undefined || base2.port !== undefined) && !base2.path) { - target.path = "/" + relative22.path; + target.path = "/" + relative20.path; } else if (!base2.path) { - target.path = relative22.path; + target.path = relative20.path; } else { - target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative22.path; + target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative20.path; } target.path = removeDotSegments(target.path); } - target.query = relative22.query; + target.query = relative20.query; } target.userinfo = base2.userinfo; target.host = base2.host; @@ -546424,7 +473838,7 @@ var require_fast_uri2 = __commonJS((exports, module) => { } target.scheme = base2.scheme; } - target.fragment = relative22.fragment; + target.fragment = relative20.fragment; return target; } function equal(uriA, uriB, options2) { @@ -546525,17 +473939,17 @@ var require_fast_uri2 = __commonJS((exports, module) => { uri = "//" + uri; } } - const matches3 = uri.match(URI_PARSE); - if (matches3) { - parsed.scheme = matches3[1]; - parsed.userinfo = matches3[3]; - parsed.host = matches3[4]; - parsed.port = parseInt(matches3[5], 10); - parsed.path = matches3[6] || ""; - parsed.query = matches3[7]; - parsed.fragment = matches3[8]; + const matches2 = uri.match(URI_PARSE); + if (matches2) { + parsed.scheme = matches2[1]; + parsed.userinfo = matches2[3]; + parsed.host = matches2[4]; + parsed.port = parseInt(matches2[5], 10); + parsed.path = matches2[6] || ""; + parsed.query = matches2[7]; + parsed.fragment = matches2[8]; if (isNaN(parsed.port)) { - parsed.port = matches3[5]; + parsed.port = matches2[5]; } if (parsed.host) { const ipv4result = isIPv4(parsed.host); @@ -546595,8 +474009,8 @@ var require_fast_uri2 = __commonJS((exports, module) => { } var fastUri = { SCHEMES, - normalize: normalize12, - resolve: resolve36, + normalize: normalize11, + resolve: resolve30, resolveComponent, equal, serialize: serialize2, @@ -546619,7 +474033,7 @@ var require_uri3 = __commonJS((exports) => { var require_core5 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = undefined; - var validate_1 = require_validate4(); + var validate_1 = require_validate3(); Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { return validate_1.KeywordCxt; } }); @@ -546649,7 +474063,7 @@ var require_core5 = __commonJS((exports) => { var codegen_2 = require_codegen2(); var resolve_1 = require_resolve2(); var dataType_1 = require_dataType2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var $dataRefSchema = require_data2(); var uri_1 = require_uri3(); var defaultRegExp = (str, flags) => new RegExp(str, flags); @@ -546694,11 +474108,11 @@ var require_core5 = __commonJS((exports) => { }; var MAX_EXPRESSION = 200; function requiredOptions(o2) { - var _a5, _b3, _c120, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; + var _a3, _b2, _c120, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; const s = o2.strict; - const _optz = (_a5 = o2.code) === null || _a5 === undefined ? undefined : _a5.optimize; + const _optz = (_a3 = o2.code) === null || _a3 === undefined ? undefined : _a3.optimize; const optimize2 = _optz === true || _optz === undefined ? 1 : _optz || 0; - const regExp = (_c120 = (_b3 = o2.code) === null || _b3 === undefined ? undefined : _b3.regExp) !== null && _c120 !== undefined ? _c120 : defaultRegExp; + const regExp = (_c120 = (_b2 = o2.code) === null || _b2 === undefined ? undefined : _b2.regExp) !== null && _c120 !== undefined ? _c120 : defaultRegExp; const uriResolver = (_d = o2.uriResolver) !== null && _d !== undefined ? _d : uri_1.default; return { strictSchema: (_f = (_e = o2.strictSchema) !== null && _e !== undefined ? _e : s) !== null && _f !== undefined ? _f : true, @@ -546733,7 +474147,7 @@ var require_core5 = __commonJS((exports) => { opts = this.opts = { ...opts, ...requiredOptions(opts) }; const { es5, lines } = this.opts.code; this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); - this.logger = getLogger2(opts.logger); + this.logger = getLogger(opts.logger); const formatOpt = opts.validateFormats; opts.validateFormats = false; this.RULES = (0, rules_1.getRules)(); @@ -546890,8 +474304,8 @@ var require_core5 = __commonJS((exports) => { keyRef = sch; if (sch === undefined) { const { schemaId } = this.opts; - const root3 = new compile_1.SchemaEnv({ schema: {}, schemaId }); - sch = compile_1.resolveSchema.call(this, root3, keyRef); + const root2 = new compile_1.SchemaEnv({ schema: {}, schemaId }); + sch = compile_1.resolveSchema.call(this, root2, keyRef); if (!sch) return; this.refs[keyRef] = sch; @@ -546978,9 +474392,9 @@ var require_core5 = __commonJS((exports) => { delete RULES.keywords[keyword]; delete RULES.all[keyword]; for (const group of RULES.rules) { - const i4 = group.rules.findIndex((rule) => rule.keyword === keyword); - if (i4 >= 0) - group.rules.splice(i4, 1); + const i3 = group.rules.findIndex((rule) => rule.keyword === keyword); + if (i3 >= 0) + group.rules.splice(i3, 1); } return this; } @@ -546993,7 +474407,7 @@ var require_core5 = __commonJS((exports) => { errorsText(errors7 = this.errors, { separator = ", ", dataVar = "data" } = {}) { if (!errors7 || errors7.length === 0) return "No errors"; - return errors7.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text2, msg) => text2 + separator + msg); + return errors7.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg); } $dataMetaSchema(metaSchema, keywordsJsonPointers) { const rules = this.RULES.all; @@ -547015,15 +474429,15 @@ var require_core5 = __commonJS((exports) => { } return metaSchema; } - _removeAllSchemas(schemas8, regex2) { - for (const keyRef in schemas8) { - const sch = schemas8[keyRef]; + _removeAllSchemas(schemas7, regex2) { + for (const keyRef in schemas7) { + const sch = schemas7[keyRef]; if (!regex2 || regex2.test(keyRef)) { if (typeof sch == "string") { - delete schemas8[keyRef]; + delete schemas7[keyRef]; } else if (sch && !sch.meta) { this._cache.delete(sch.schema); - delete schemas8[keyRef]; + delete schemas7[keyRef]; } } } @@ -547082,11 +474496,11 @@ var require_core5 = __commonJS((exports) => { Ajv3.ValidationError = validation_error_1.default; Ajv3.MissingRefError = ref_error_1.default; exports.default = Ajv3; - function checkOptions(checkOpts, options2, msg, log2 = "error") { + function checkOptions(checkOpts, options2, msg, log = "error") { for (const key in checkOpts) { const opt = key; if (opt in options2) - this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`); + this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); } } function getSchEnv(keyRef) { @@ -547130,7 +474544,7 @@ var require_core5 = __commonJS((exports) => { return metaOpts; } var noLogs = { log() {}, warn() {}, error() {} }; - function getLogger2(logger) { + function getLogger(logger) { if (logger === false) return noLogs; if (logger === undefined) @@ -547155,7 +474569,7 @@ var require_core5 = __commonJS((exports) => { } } function addRule(keyword, definition, dataType) { - var _a5; + var _a3; const post = definition === null || definition === undefined ? undefined : definition.post; if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"'); @@ -547181,15 +474595,15 @@ var require_core5 = __commonJS((exports) => { else ruleGroup.rules.push(rule); RULES.all[keyword] = rule; - (_a5 = definition.implements) === null || _a5 === undefined || _a5.forEach((kwd) => this.addKeyword(kwd)); + (_a3 = definition.implements) === null || _a3 === undefined || _a3.forEach((kwd) => this.addKeyword(kwd)); } - function addBeforeRule(ruleGroup, rule, before3) { - const i4 = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before3); - if (i4 >= 0) { - ruleGroup.rules.splice(i4, 0, rule); + function addBeforeRule(ruleGroup, rule, before2) { + const i3 = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before2); + if (i3 >= 0) { + ruleGroup.rules.splice(i3, 0, rule); } else { ruleGroup.rules.push(rule); - this.logger.warn(`rule ${before3} is not defined`); + this.logger.warn(`rule ${before2} is not defined`); } } function keywordMetaschema(def2) { @@ -547229,27 +474643,27 @@ var require_ref3 = __commonJS((exports) => { var codegen_1 = require_codegen2(); var names_1 = require_names2(); var compile_1 = require_compile2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var def2 = { keyword: "$ref", schemaType: "string", code(cxt) { const { gen, schema: $ref, it } = cxt; - const { baseId, schemaEnv: env5, validateName, opts, self: self2 } = it; - const { root: root3 } = env5; - if (($ref === "#" || $ref === "#/") && baseId === root3.baseId) + const { baseId, schemaEnv: env4, validateName, opts, self: self2 } = it; + const { root: root2 } = env4; + if (($ref === "#" || $ref === "#/") && baseId === root2.baseId) return callRootRef(); - const schOrEnv = compile_1.resolveRef.call(self2, root3, baseId, $ref); + const schOrEnv = compile_1.resolveRef.call(self2, root2, baseId, $ref); if (schOrEnv === undefined) throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); if (schOrEnv instanceof compile_1.SchemaEnv) return callValidate(schOrEnv); return inlineRefSchema(schOrEnv); function callRootRef() { - if (env5 === root3) - return callRef(cxt, validateName, env5, env5.$async); - const rootName = gen.scopeValue("root", { ref: root3 }); - return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root3, root3.$async); + if (env4 === root2) + return callRef(cxt, validateName, env4, env4.$async); + const rootName = gen.scopeValue("root", { ref: root2 }); + return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root2, root2.$async); } function callValidate(sch) { const v = getValidate(cxt, sch); @@ -547277,14 +474691,14 @@ var require_ref3 = __commonJS((exports) => { exports.getValidate = getValidate; function callRef(cxt, v, sch, $async) { const { gen, it } = cxt; - const { allErrors, schemaEnv: env5, opts } = it; + const { allErrors, schemaEnv: env4, opts } = it; const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; if ($async) callAsyncRef(); else callSyncRef(); function callAsyncRef() { - if (!env5.$async) + if (!env4.$async) throw new Error("async schema referenced by sync schema"); const valid = gen.let("valid"); gen.try(() => { @@ -547309,10 +474723,10 @@ var require_ref3 = __commonJS((exports) => { gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); } function addEvaluatedFrom(source) { - var _a5; + var _a3; if (!it.opts.unevaluated) return; - const schEvaluated = (_a5 = sch === null || sch === undefined ? undefined : sch.validate) === null || _a5 === undefined ? undefined : _a5.evaluated; + const schEvaluated = (_a3 = sch === null || sch === undefined ? undefined : sch.validate) === null || _a3 === undefined ? undefined : _a3.evaluated; if (it.props !== true) { if (schEvaluated && !schEvaluated.dynamicProps) { if (schEvaluated.props !== undefined) { @@ -547368,7 +474782,7 @@ var require_limitNumber2 = __commonJS((exports) => { exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; - var error46 = { + var error42 = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; @@ -547377,7 +474791,7 @@ var require_limitNumber2 = __commonJS((exports) => { type: "number", schemaType: "number", $data: true, - error: error46, + error: error42, code(cxt) { const { keyword, data, schemaCode } = cxt; cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); @@ -547390,7 +474804,7 @@ var require_limitNumber2 = __commonJS((exports) => { var require_multipleOf2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var error46 = { + var error42 = { message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}` }; @@ -547399,7 +474813,7 @@ var require_multipleOf2 = __commonJS((exports) => { type: "number", schemaType: "number", $data: true, - error: error46, + error: error42, code(cxt) { const { gen, data, schemaCode, it } = cxt; const prec = it.opts.multipleOfPrecision; @@ -547438,9 +474852,9 @@ var require_ucs2length2 = __commonJS((exports) => { var require_limitLength2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var ucs2length_1 = require_ucs2length2(); - var error46 = { + var error42 = { message({ keyword, schemaCode }) { const comp = keyword === "maxLength" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`; @@ -547452,7 +474866,7 @@ var require_limitLength2 = __commonJS((exports) => { type: "string", schemaType: "number", $data: true, - error: error46, + error: error42, code(cxt) { const { keyword, data, schemaCode, it } = cxt; const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -547467,9 +474881,9 @@ var require_limitLength2 = __commonJS((exports) => { var require_pattern2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code4(); - var util_1 = require_util15(); + var util_1 = require_util13(); var codegen_1 = require_codegen2(); - var error46 = { + var error42 = { message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}` }; @@ -547478,7 +474892,7 @@ var require_pattern2 = __commonJS((exports) => { type: "string", schemaType: "string", $data: true, - error: error46, + error: error42, code(cxt) { const { gen, data, $data, schema, schemaCode, it } = cxt; const u2 = it.opts.unicodeRegExp ? "u" : ""; @@ -547501,7 +474915,7 @@ var require_pattern2 = __commonJS((exports) => { var require_limitProperties2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var error46 = { + var error42 = { message({ keyword, schemaCode }) { const comp = keyword === "maxProperties" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`; @@ -547513,7 +474927,7 @@ var require_limitProperties2 = __commonJS((exports) => { type: "object", schemaType: "number", $data: true, - error: error46, + error: error42, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -547528,8 +474942,8 @@ var require_required2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code4(); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); - var error46 = { + var util_1 = require_util13(); + var error42 = { message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}` }; @@ -547538,7 +474952,7 @@ var require_required2 = __commonJS((exports) => { type: "object", schemaType: "array", $data: true, - error: error46, + error: error42, code(cxt) { const { gen, schema, schemaCode, data, $data, it } = cxt; const { opts } = it; @@ -547606,7 +475020,7 @@ var require_required2 = __commonJS((exports) => { var require_limitItems2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var error46 = { + var error42 = { message({ keyword, schemaCode }) { const comp = keyword === "maxItems" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`; @@ -547618,7 +475032,7 @@ var require_limitItems2 = __commonJS((exports) => { type: "array", schemaType: "number", $data: true, - error: error46, + error: error42, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; @@ -547641,18 +475055,18 @@ var require_uniqueItems2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var dataType_1 = require_dataType2(); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var equal_1 = require_equal2(); - var error46 = { - message: ({ params: { i: i4, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i4} are identical)`, - params: ({ params: { i: i4, j } }) => (0, codegen_1._)`{i: ${i4}, j: ${j}}` + var error42 = { + message: ({ params: { i: i3, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i3} are identical)`, + params: ({ params: { i: i3, j } }) => (0, codegen_1._)`{i: ${i3}, j: ${j}}` }; var def2 = { keyword: "uniqueItems", type: "array", schemaType: "boolean", $data: true, - error: error46, + error: error42, code(cxt) { const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; if (!$data && !schema) @@ -547662,21 +475076,21 @@ var require_uniqueItems2 = __commonJS((exports) => { cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`); cxt.ok(valid); function validateUniqueItems() { - const i4 = gen.let("i", (0, codegen_1._)`${data}.length`); + const i3 = gen.let("i", (0, codegen_1._)`${data}.length`); const j = gen.let("j"); - cxt.setParams({ i: i4, j }); + cxt.setParams({ i: i3, j }); gen.assign(valid, true); - gen.if((0, codegen_1._)`${i4} > 1`, () => (canOptimize() ? loopN : loopN2)(i4, j)); + gen.if((0, codegen_1._)`${i3} > 1`, () => (canOptimize() ? loopN : loopN2)(i3, j)); } function canOptimize() { return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); } - function loopN(i4, j) { + function loopN(i3, j) { const item = gen.name("item"); const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); const indices = gen.const("indices", (0, codegen_1._)`{}`); - gen.for((0, codegen_1._)`;${i4}--;`, () => { - gen.let(item, (0, codegen_1._)`${data}[${i4}]`); + gen.for((0, codegen_1._)`;${i3}--;`, () => { + gen.let(item, (0, codegen_1._)`${data}[${i3}]`); gen.if(wrongType, (0, codegen_1._)`continue`); if (itemTypes.length > 1) gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`); @@ -547684,13 +475098,13 @@ var require_uniqueItems2 = __commonJS((exports) => { gen.assign(j, (0, codegen_1._)`${indices}[${item}]`); cxt.error(); gen.assign(valid, false).break(); - }).code((0, codegen_1._)`${indices}[${item}] = ${i4}`); + }).code((0, codegen_1._)`${indices}[${item}] = ${i3}`); }); } - function loopN2(i4, j) { + function loopN2(i3, j) { const eql = (0, util_1.useFunc)(gen, equal_1.default); const outer = gen.name("outer"); - gen.label(outer).for((0, codegen_1._)`;${i4}--;`, () => gen.for((0, codegen_1._)`${j} = ${i4}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i4}], ${data}[${j}])`, () => { + gen.label(outer).for((0, codegen_1._)`;${i3}--;`, () => gen.for((0, codegen_1._)`${j} = ${i3}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i3}], ${data}[${j}])`, () => { cxt.error(); gen.assign(valid, false).break(outer); }))); @@ -547704,16 +475118,16 @@ var require_uniqueItems2 = __commonJS((exports) => { var require_const2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var equal_1 = require_equal2(); - var error46 = { + var error42 = { message: "must be equal to constant", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}` }; var def2 = { keyword: "const", $data: true, - error: error46, + error: error42, code(cxt) { const { gen, data, $data, schemaCode, schema } = cxt; if ($data || schema && typeof schema == "object") { @@ -547730,9 +475144,9 @@ var require_const2 = __commonJS((exports) => { var require_enum2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var equal_1 = require_equal2(); - var error46 = { + var error42 = { message: "must be equal to one of the allowed values", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` }; @@ -547740,7 +475154,7 @@ var require_enum2 = __commonJS((exports) => { keyword: "enum", schemaType: "array", $data: true, - error: error46, + error: error42, code(cxt) { const { gen, data, $data, schema, schemaCode, it } = cxt; if (!$data && schema.length === 0) @@ -547756,16 +475170,16 @@ var require_enum2 = __commonJS((exports) => { if (!Array.isArray(schema)) throw new Error("ajv implementation error"); const vSchema = gen.const("vSchema", schemaCode); - valid = (0, codegen_1.or)(...schema.map((_x, i4) => equalCode(vSchema, i4))); + valid = (0, codegen_1.or)(...schema.map((_x, i3) => equalCode(vSchema, i3))); } cxt.pass(valid); function loopEnum() { gen.assign(valid, false); gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())); } - function equalCode(vSchema, i4) { - const sch = schema[i4]; - return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i4}])` : (0, codegen_1._)`${data} === ${sch}`; + function equalCode(vSchema, i3) { + const sch = schema[i3]; + return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i3}])` : (0, codegen_1._)`${data} === ${sch}`; } } }; @@ -547807,8 +475221,8 @@ var require_additionalItems2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateAdditionalItems = undefined; var codegen_1 = require_codegen2(); - var util_1 = require_util15(); - var error46 = { + var util_1 = require_util13(); + var error42 = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; @@ -547817,7 +475231,7 @@ var require_additionalItems2 = __commonJS((exports) => { type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", - error: error46, + error: error42, code(cxt) { const { parentSchema, it } = cxt; const { items } = parentSchema; @@ -547841,8 +475255,8 @@ var require_additionalItems2 = __commonJS((exports) => { cxt.ok(valid); } function validateItems(valid) { - gen.forRange("i", items.length, len, (i4) => { - cxt.subschema({ keyword, dataProp: i4, dataPropType: util_1.Type.Num }, valid); + gen.forRange("i", items.length, len, (i3) => { + cxt.subschema({ keyword, dataProp: i3, dataPropType: util_1.Type.Num }, valid); if (!it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break()); }); @@ -547857,7 +475271,7 @@ var require_items2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateTuple = undefined; var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var code_1 = require_code4(); var def2 = { keyword: "items", @@ -547882,13 +475296,13 @@ var require_items2 = __commonJS((exports) => { } const valid = gen.name("valid"); const len = gen.const("len", (0, codegen_1._)`${data}.length`); - schArr.forEach((sch, i4) => { + schArr.forEach((sch, i3) => { if ((0, util_1.alwaysValidSchema)(it, sch)) return; - gen.if((0, codegen_1._)`${len} > ${i4}`, () => cxt.subschema({ + gen.if((0, codegen_1._)`${len} > ${i3}`, () => cxt.subschema({ keyword, - schemaProp: i4, - dataProp: i4 + schemaProp: i3, + dataProp: i3 }, valid)); cxt.ok(valid); }); @@ -547924,10 +475338,10 @@ var require_prefixItems2 = __commonJS((exports) => { var require_items20202 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var code_1 = require_code4(); var additionalItems_1 = require_additionalItems2(); - var error46 = { + var error42 = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; @@ -547936,7 +475350,7 @@ var require_items20202 = __commonJS((exports) => { type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", - error: error46, + error: error42, code(cxt) { const { schema, parentSchema, it } = cxt; const { prefixItems } = parentSchema; @@ -547956,10 +475370,10 @@ var require_items20202 = __commonJS((exports) => { var require_contains2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); - var error46 = { - message: ({ params: { min: min3, max: max5 } }) => max5 === undefined ? (0, codegen_1.str)`must contain at least ${min3} valid item(s)` : (0, codegen_1.str)`must contain at least ${min3} and no more than ${max5} valid item(s)`, - params: ({ params: { min: min3, max: max5 } }) => max5 === undefined ? (0, codegen_1._)`{minContains: ${min3}}` : (0, codegen_1._)`{minContains: ${min3}, maxContains: ${max5}}` + var util_1 = require_util13(); + var error42 = { + message: ({ params: { min: min2, max: max3 } }) => max3 === undefined ? (0, codegen_1.str)`must contain at least ${min2} valid item(s)` : (0, codegen_1.str)`must contain at least ${min2} and no more than ${max3} valid item(s)`, + params: ({ params: { min: min2, max: max3 } }) => max3 === undefined ? (0, codegen_1._)`{minContains: ${min2}}` : (0, codegen_1._)`{minContains: ${min2}, maxContains: ${max3}}` }; var def2 = { keyword: "contains", @@ -547967,43 +475381,43 @@ var require_contains2 = __commonJS((exports) => { schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: true, - error: error46, + error: error42, code(cxt) { const { gen, schema, parentSchema, data, it } = cxt; - let min3; - let max5; + let min2; + let max3; const { minContains, maxContains } = parentSchema; if (it.opts.next) { - min3 = minContains === undefined ? 1 : minContains; - max5 = maxContains; + min2 = minContains === undefined ? 1 : minContains; + max3 = maxContains; } else { - min3 = 1; + min2 = 1; } const len = gen.const("len", (0, codegen_1._)`${data}.length`); - cxt.setParams({ min: min3, max: max5 }); - if (max5 === undefined && min3 === 0) { + cxt.setParams({ min: min2, max: max3 }); + if (max3 === undefined && min2 === 0) { (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); return; } - if (max5 !== undefined && min3 > max5) { + if (max3 !== undefined && min2 > max3) { (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); cxt.fail(); return; } if ((0, util_1.alwaysValidSchema)(it, schema)) { - let cond3 = (0, codegen_1._)`${len} >= ${min3}`; - if (max5 !== undefined) - cond3 = (0, codegen_1._)`${cond3} && ${len} <= ${max5}`; - cxt.pass(cond3); + let cond2 = (0, codegen_1._)`${len} >= ${min2}`; + if (max3 !== undefined) + cond2 = (0, codegen_1._)`${cond2} && ${len} <= ${max3}`; + cxt.pass(cond2); return; } it.items = true; const valid = gen.name("valid"); - if (max5 === undefined && min3 === 1) { + if (max3 === undefined && min2 === 1) { validateItems(valid, () => gen.if(valid, () => gen.break())); - } else if (min3 === 0) { + } else if (min2 === 0) { gen.let(valid, true); - if (max5 !== undefined) + if (max3 !== undefined) gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount); } else { gen.let(valid, false); @@ -548016,10 +475430,10 @@ var require_contains2 = __commonJS((exports) => { validateItems(schValid, () => gen.if(schValid, () => checkLimits(count3))); } function validateItems(_valid, block2) { - gen.forRange("i", 0, len, (i4) => { + gen.forRange("i", 0, len, (i3) => { cxt.subschema({ keyword: "contains", - dataProp: i4, + dataProp: i3, dataPropType: util_1.Type.Num, compositeRule: true }, _valid); @@ -548028,14 +475442,14 @@ var require_contains2 = __commonJS((exports) => { } function checkLimits(count3) { gen.code((0, codegen_1._)`${count3}++`); - if (max5 === undefined) { - gen.if((0, codegen_1._)`${count3} >= ${min3}`, () => gen.assign(valid, true).break()); + if (max3 === undefined) { + gen.if((0, codegen_1._)`${count3} >= ${min2}`, () => gen.assign(valid, true).break()); } else { - gen.if((0, codegen_1._)`${count3} > ${max5}`, () => gen.assign(valid, false).break()); - if (min3 === 1) + gen.if((0, codegen_1._)`${count3} > ${max3}`, () => gen.assign(valid, false).break()); + if (min2 === 1) gen.assign(valid, true); else - gen.if((0, codegen_1._)`${count3} >= ${min3}`, () => gen.assign(valid, true)); + gen.if((0, codegen_1._)`${count3} >= ${min2}`, () => gen.assign(valid, true)); } } } @@ -548048,14 +475462,14 @@ var require_dependencies2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = undefined; var codegen_1 = require_codegen2(); - var util_1 = require_util15(); + var util_1 = require_util13(); var code_1 = require_code4(); exports.error = { - message: ({ params: { property: property3, depsCount, deps } }) => { + message: ({ params: { property: property2, depsCount, deps } }) => { const property_ies = depsCount === 1 ? "property" : "properties"; - return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property3} is present`; + return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property2} is present`; }, - params: ({ params: { property: property3, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property3}, + params: ({ params: { property: property2, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property2}, missingProperty: ${missingProperty}, depsCount: ${depsCount}, deps: ${deps}}` @@ -548132,8 +475546,8 @@ var require_dependencies2 = __commonJS((exports) => { var require_propertyNames2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); - var error46 = { + var util_1 = require_util13(); + var error42 = { message: "property name must be valid", params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}` }; @@ -548141,7 +475555,7 @@ var require_propertyNames2 = __commonJS((exports) => { keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], - error: error46, + error: error42, code(cxt) { const { gen, schema, data, it } = cxt; if ((0, util_1.alwaysValidSchema)(it, schema)) @@ -548174,8 +475588,8 @@ var require_additionalProperties2 = __commonJS((exports) => { var code_1 = require_code4(); var codegen_1 = require_codegen2(); var names_1 = require_names2(); - var util_1 = require_util15(); - var error46 = { + var util_1 = require_util13(); + var error42 = { message: "must NOT have additional properties", params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}` }; @@ -548185,7 +475599,7 @@ var require_additionalProperties2 = __commonJS((exports) => { schemaType: ["boolean", "object"], allowUndefined: true, trackErrors: true, - error: error46, + error: error42, code(cxt) { const { gen, schema, parentSchema, data, errsCount, it } = cxt; if (!errsCount) @@ -548274,9 +475688,9 @@ var require_additionalProperties2 = __commonJS((exports) => { // ../node_modules/ajv/dist/vocabularies/applicator/properties.js var require_properties4 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var validate_1 = require_validate4(); + var validate_1 = require_validate3(); var code_1 = require_code4(); - var util_1 = require_util15(); + var util_1 = require_util13(); var additionalProperties_1 = require_additionalProperties2(); var def2 = { keyword: "properties", @@ -548331,8 +475745,8 @@ var require_patternProperties2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var code_1 = require_code4(); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); - var util_2 = require_util15(); + var util_1 = require_util13(); + var util_2 = require_util13(); var def2 = { keyword: "patternProperties", type: "object", @@ -548400,7 +475814,7 @@ var require_patternProperties2 = __commonJS((exports) => { // ../node_modules/ajv/dist/vocabularies/applicator/not.js var require_not2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util15(); + var util_1 = require_util13(); var def2 = { keyword: "not", schemaType: ["object", "boolean"], @@ -548443,8 +475857,8 @@ var require_anyOf2 = __commonJS((exports) => { var require_oneOf2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); - var error46 = { + var util_1 = require_util13(); + var error42 = { message: "must match exactly one schema in oneOf", params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}` }; @@ -548452,7 +475866,7 @@ var require_oneOf2 = __commonJS((exports) => { keyword: "oneOf", schemaType: "array", trackErrors: true, - error: error46, + error: error42, code(cxt) { const { gen, schema, parentSchema, it } = cxt; if (!Array.isArray(schema)) @@ -548467,23 +475881,23 @@ var require_oneOf2 = __commonJS((exports) => { gen.block(validateOneOf); cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); function validateOneOf() { - schArr.forEach((sch, i4) => { + schArr.forEach((sch, i3) => { let schCxt; if ((0, util_1.alwaysValidSchema)(it, sch)) { gen.var(schValid, true); } else { schCxt = cxt.subschema({ keyword: "oneOf", - schemaProp: i4, + schemaProp: i3, compositeRule: true }, schValid); } - if (i4 > 0) { - gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i4}]`).else(); + if (i3 > 0) { + gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i3}]`).else(); } gen.if(schValid, () => { gen.assign(valid, true); - gen.assign(passing, i4); + gen.assign(passing, i3); if (schCxt) cxt.mergeEvaluated(schCxt, codegen_1.Name); }); @@ -548497,7 +475911,7 @@ var require_oneOf2 = __commonJS((exports) => { // ../node_modules/ajv/dist/vocabularies/applicator/allOf.js var require_allOf2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util15(); + var util_1 = require_util13(); var def2 = { keyword: "allOf", schemaType: "array", @@ -548506,10 +475920,10 @@ var require_allOf2 = __commonJS((exports) => { if (!Array.isArray(schema)) throw new Error("ajv implementation error"); const valid = gen.name("valid"); - schema.forEach((sch, i4) => { + schema.forEach((sch, i3) => { if ((0, util_1.alwaysValidSchema)(it, sch)) return; - const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i4 }, valid); + const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i3 }, valid); cxt.ok(valid); cxt.mergeEvaluated(schCxt); }); @@ -548522,8 +475936,8 @@ var require_allOf2 = __commonJS((exports) => { var require_if2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var util_1 = require_util15(); - var error46 = { + var util_1 = require_util13(); + var error42 = { message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}` }; @@ -548531,7 +475945,7 @@ var require_if2 = __commonJS((exports) => { keyword: "if", schemaType: ["object", "boolean"], trackErrors: true, - error: error46, + error: error42, code(cxt) { const { gen, parentSchema, it } = cxt; if (parentSchema.then === undefined && parentSchema.else === undefined) { @@ -548587,7 +476001,7 @@ var require_if2 = __commonJS((exports) => { // ../node_modules/ajv/dist/vocabularies/applicator/thenElse.js var require_thenElse2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var util_1 = require_util15(); + var util_1 = require_util13(); var def2 = { keyword: ["then", "else"], schemaType: ["object", "boolean"], @@ -548646,7 +476060,7 @@ var require_applicator2 = __commonJS((exports) => { var require_format3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); var codegen_1 = require_codegen2(); - var error46 = { + var error42 = { message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}` }; @@ -548655,7 +476069,7 @@ var require_format3 = __commonJS((exports) => { type: ["number", "string"], schemaType: "string", $data: true, - error: error46, + error: error42, code(cxt, ruleType) { const { gen, data, $data, schema, schemaCode, it } = cxt; const { opts, errSchemaPath, schemaEnv, self: self2 } = it; @@ -548794,8 +476208,8 @@ var require_discriminator2 = __commonJS((exports) => { var types_1 = require_types6(); var compile_1 = require_compile2(); var ref_error_1 = require_ref_error2(); - var util_1 = require_util15(); - var error46 = { + var util_1 = require_util13(); + var error42 = { message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`, params: ({ params: { discrError, tag: tag2, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag2}}` }; @@ -548803,7 +476217,7 @@ var require_discriminator2 = __commonJS((exports) => { keyword: "discriminator", type: "object", schemaType: "object", - error: error46, + error: error42, code(cxt) { const { gen, data, schema, parentSchema, it } = cxt; const { oneOf } = parentSchema; @@ -548839,12 +476253,12 @@ var require_discriminator2 = __commonJS((exports) => { return _valid; } function getMapping() { - var _a5; + var _a3; const oneOfMapping = {}; const topRequired = hasRequired(parentSchema); let tagRequired = true; - for (let i4 = 0;i4 < oneOf.length; i4++) { - let sch = oneOf[i4]; + for (let i3 = 0;i3 < oneOf.length; i3++) { + let sch = oneOf[i3]; if ((sch === null || sch === undefined ? undefined : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { const ref = sch.$ref; sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref); @@ -548853,12 +476267,12 @@ var require_discriminator2 = __commonJS((exports) => { if (sch === undefined) throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); } - const propSch = (_a5 = sch === null || sch === undefined ? undefined : sch.properties) === null || _a5 === undefined ? undefined : _a5[tagName]; + const propSch = (_a3 = sch === null || sch === undefined ? undefined : sch.properties) === null || _a3 === undefined ? undefined : _a3[tagName]; if (typeof propSch != "object") { throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); } tagRequired = tagRequired && (topRequired || hasRequired(sch)); - addMappings(propSch, i4); + addMappings(propSch, i3); } if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`); @@ -548866,22 +476280,22 @@ var require_discriminator2 = __commonJS((exports) => { function hasRequired({ required: required3 }) { return Array.isArray(required3) && required3.includes(tagName); } - function addMappings(sch, i4) { + function addMappings(sch, i3) { if (sch.const) { - addMapping(sch.const, i4); + addMapping(sch.const, i3); } else if (sch.enum) { for (const tagValue of sch.enum) { - addMapping(tagValue, i4); + addMapping(tagValue, i3); } } else { throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); } } - function addMapping(tagValue, i4) { + function addMapping(tagValue, i3) { if (typeof tagValue != "string" || tagValue in oneOfMapping) { throw new Error(`discriminator: "${tagName}" values must be unique strings`); } - oneOfMapping[tagValue] = i4; + oneOfMapping[tagValue] = i3; } } } @@ -549079,7 +476493,7 @@ var require_ajv2 = __commonJS((exports, module) => { module.exports.Ajv = Ajv3; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Ajv3; - var validate_1 = require_validate4(); + var validate_1 = require_validate3(); Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() { return validate_1.KeywordCxt; } }); @@ -549116,8 +476530,8 @@ var require_ajv2 = __commonJS((exports, module) => { var require_formats2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.formatNames = exports.fastFormats = exports.fullFormats = undefined; - function fmtDef(validate3, compare) { - return { validate: validate3, compare }; + function fmtDef(validate2, compare) { + return { validate: validate2, compare }; } exports.fullFormats = { date: fmtDef(date9, compareDate), @@ -549165,12 +476579,12 @@ var require_formats2 = __commonJS((exports) => { var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function date9(str) { - const matches3 = DATE.exec(str); - if (!matches3) + const matches2 = DATE.exec(str); + if (!matches2) return false; - const year = +matches3[1]; - const month = +matches3[2]; - const day = +matches3[3]; + const year = +matches2[1]; + const month = +matches2[2]; + const day = +matches2[3]; return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]); } function compareDate(d1, d2) { @@ -549185,21 +476599,21 @@ var require_formats2 = __commonJS((exports) => { var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i; function getTime(strictTimeZone) { return function time(str) { - const matches3 = TIME.exec(str); - if (!matches3) + const matches2 = TIME.exec(str); + if (!matches2) return false; - const hr2 = +matches3[1]; - const min3 = +matches3[2]; - const sec = +matches3[3]; - const tz = matches3[4]; - const tzSign = matches3[5] === "-" ? -1 : 1; - const tzH = +(matches3[6] || 0); - const tzM = +(matches3[7] || 0); + const hr2 = +matches2[1]; + const min2 = +matches2[2]; + const sec = +matches2[3]; + const tz = matches2[4]; + const tzSign = matches2[5] === "-" ? -1 : 1; + const tzH = +(matches2[6] || 0); + const tzM = +(matches2[7] || 0); if (tzH > 23 || tzM > 59 || strictTimeZone && !tz) return false; - if (hr2 <= 23 && min3 <= 59 && sec < 60) + if (hr2 <= 23 && min2 <= 59 && sec < 60) return true; - const utcMin = min3 - tzM * tzSign; + const utcMin = min2 - tzM * tzSign; const utcHr = hr2 - tzH * tzSign - (utcMin < 0 ? 1 : 0); return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61; }; @@ -549302,7 +476716,7 @@ var require_limit2 = __commonJS((exports) => { formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; - var error46 = { + var error42 = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; @@ -549311,7 +476725,7 @@ var require_limit2 = __commonJS((exports) => { type: "string", schemaType: "string", $data: true, - error: error46, + error: error42, code(cxt) { const { gen, data, schemaCode, keyword, it } = cxt; const { opts, self: self2 } = it; @@ -549359,7 +476773,7 @@ var require_limit2 = __commonJS((exports) => { }); // ../node_modules/ajv-formats/dist/index.js -var require_dist12 = __commonJS((exports, module) => { +var require_dist8 = __commonJS((exports, module) => { Object.defineProperty(exports, "__esModule", { value: true }); var formats_1 = require_formats2(); var limit_1 = require_limit2(); @@ -549385,12 +476799,12 @@ var require_dist12 = __commonJS((exports, module) => { throw new Error(`Unknown format "${name}"`); return f; }; - function addFormats(ajv, list2, fs11, exportName) { - var _a5; - var _b3; - (_a5 = (_b3 = ajv.opts.code).formats) !== null && _a5 !== undefined || (_b3.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`); + function addFormats(ajv, list2, fs5, exportName) { + var _a3; + var _b2; + (_a3 = (_b2 = ajv.opts.code).formats) !== null && _a3 !== undefined || (_b2.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`); for (const f of list2) - ajv.addFormat(f, fs11[f]); + ajv.addFormat(f, fs5[f]); } module.exports = exports = formatsPlugin; Object.defineProperty(exports, "__esModule", { value: true }); @@ -549416,12 +476830,12 @@ class AjvJsonSchemaValidator2 { } getValidator(schema) { const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema) : this._ajv.compile(schema); - return (input11) => { - const valid = ajvValidator(input11); + return (input) => { + const valid = ajvValidator(input); if (valid) { return { valid: true, - data: input11, + data: input, errorMessage: undefined }; } else { @@ -549437,7 +476851,7 @@ class AjvJsonSchemaValidator2 { var import_ajv3, import_ajv_formats2; var init_ajv_provider2 = __esm(() => { import_ajv3 = __toESM(require_ajv2(), 1); - import_ajv_formats2 = __toESM(require_dist12(), 1); + import_ajv_formats2 = __toESM(require_dist8(), 1); }); // ../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js @@ -549518,37 +476932,37 @@ class ExperimentalServerTasks { } } var init_server = __esm(() => { - init_types14(); + init_types13(); }); // ../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js -function assertToolsCallTaskCapability2(requests, method3, entityName) { +function assertToolsCallTaskCapability2(requests, method2, entityName) { if (!requests) { - throw new Error(`${entityName} does not support task creation (required for ${method3})`); + throw new Error(`${entityName} does not support task creation (required for ${method2})`); } - switch (method3) { + switch (method2) { case "tools/call": if (!requests.tools?.call) { - throw new Error(`${entityName} does not support task creation for tools/call (required for ${method3})`); + throw new Error(`${entityName} does not support task creation for tools/call (required for ${method2})`); } break; default: break; } } -function assertClientRequestTaskCapability2(requests, method3, entityName) { +function assertClientRequestTaskCapability2(requests, method2, entityName) { if (!requests) { - throw new Error(`${entityName} does not support task creation (required for ${method3})`); + throw new Error(`${entityName} does not support task creation (required for ${method2})`); } - switch (method3) { + switch (method2) { case "sampling/createMessage": if (!requests.sampling?.createMessage) { - throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method3})`); + throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method2})`); } break; case "elicitation/create": if (!requests.elicitation?.create) { - throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method3})`); + throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method2})`); } break; default: @@ -549560,7 +476974,7 @@ function assertClientRequestTaskCapability2(requests, method3, entityName) { var Server; var init_server2 = __esm(() => { init_protocol2(); - init_types14(); + init_types13(); init_ajv_provider2(); init_zod_compat2(); init_server(); @@ -549605,7 +477019,7 @@ var init_server2 = __esm(() => { } this._capabilities = mergeCapabilities2(this._capabilities, capabilities); } - setRequestHandler(requestSchema, handler14) { + setRequestHandler(requestSchema, handler18) { const shape = getObjectShape2(requestSchema); const methodSchema = shape?.method; if (!methodSchema) { @@ -549624,8 +477038,8 @@ var init_server2 = __esm(() => { if (typeof methodValue !== "string") { throw new Error("Schema method literal must be a string"); } - const method3 = methodValue; - if (method3 === "tools/call") { + const method2 = methodValue; + if (method2 === "tools/call") { const wrappedHandler = async (request, extra) => { const validatedRequest = safeParse5(CallToolRequestSchema2, request); if (!validatedRequest.success) { @@ -549633,16 +477047,16 @@ var init_server2 = __esm(() => { throw new McpError2(ErrorCode2.InvalidParams, `Invalid tools/call request: ${errorMessage2}`); } const { params } = validatedRequest.data; - const result3 = await Promise.resolve(handler14(request, extra)); + const result2 = await Promise.resolve(handler18(request, extra)); if (params.task) { - const taskValidationResult = safeParse5(CreateTaskResultSchema2, result3); + const taskValidationResult = safeParse5(CreateTaskResultSchema2, result2); if (!taskValidationResult.success) { const errorMessage2 = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error); throw new McpError2(ErrorCode2.InvalidParams, `Invalid task creation result: ${errorMessage2}`); } return taskValidationResult.data; } - const validationResult = safeParse5(CallToolResultSchema2, result3); + const validationResult = safeParse5(CallToolResultSchema2, result2); if (!validationResult.success) { const errorMessage2 = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error); throw new McpError2(ErrorCode2.InvalidParams, `Invalid tools/call result: ${errorMessage2}`); @@ -549651,55 +477065,55 @@ var init_server2 = __esm(() => { }; return super.setRequestHandler(requestSchema, wrappedHandler); } - return super.setRequestHandler(requestSchema, handler14); + return super.setRequestHandler(requestSchema, handler18); } - assertCapabilityForMethod(method3) { - switch (method3) { + assertCapabilityForMethod(method2) { + switch (method2) { case "sampling/createMessage": if (!this._clientCapabilities?.sampling) { - throw new Error(`Client does not support sampling (required for ${method3})`); + throw new Error(`Client does not support sampling (required for ${method2})`); } break; case "elicitation/create": if (!this._clientCapabilities?.elicitation) { - throw new Error(`Client does not support elicitation (required for ${method3})`); + throw new Error(`Client does not support elicitation (required for ${method2})`); } break; case "roots/list": if (!this._clientCapabilities?.roots) { - throw new Error(`Client does not support listing roots (required for ${method3})`); + throw new Error(`Client does not support listing roots (required for ${method2})`); } break; case "ping": break; } } - assertNotificationCapability(method3) { - switch (method3) { + assertNotificationCapability(method2) { + switch (method2) { case "notifications/message": if (!this._capabilities.logging) { - throw new Error(`Server does not support logging (required for ${method3})`); + throw new Error(`Server does not support logging (required for ${method2})`); } break; case "notifications/resources/updated": case "notifications/resources/list_changed": if (!this._capabilities.resources) { - throw new Error(`Server does not support notifying about resources (required for ${method3})`); + throw new Error(`Server does not support notifying about resources (required for ${method2})`); } break; case "notifications/tools/list_changed": if (!this._capabilities.tools) { - throw new Error(`Server does not support notifying of tool list changes (required for ${method3})`); + throw new Error(`Server does not support notifying of tool list changes (required for ${method2})`); } break; case "notifications/prompts/list_changed": if (!this._capabilities.prompts) { - throw new Error(`Server does not support notifying of prompt list changes (required for ${method3})`); + throw new Error(`Server does not support notifying of prompt list changes (required for ${method2})`); } break; case "notifications/elicitation/complete": if (!this._clientCapabilities?.elicitation?.url) { - throw new Error(`Client does not support URL elicitation (required for ${method3})`); + throw new Error(`Client does not support URL elicitation (required for ${method2})`); } break; case "notifications/cancelled": @@ -549708,38 +477122,38 @@ var init_server2 = __esm(() => { break; } } - assertRequestHandlerCapability(method3) { + assertRequestHandlerCapability(method2) { if (!this._capabilities) { return; } - switch (method3) { + switch (method2) { case "completion/complete": if (!this._capabilities.completions) { - throw new Error(`Server does not support completions (required for ${method3})`); + throw new Error(`Server does not support completions (required for ${method2})`); } break; case "logging/setLevel": if (!this._capabilities.logging) { - throw new Error(`Server does not support logging (required for ${method3})`); + throw new Error(`Server does not support logging (required for ${method2})`); } break; case "prompts/get": case "prompts/list": if (!this._capabilities.prompts) { - throw new Error(`Server does not support prompts (required for ${method3})`); + throw new Error(`Server does not support prompts (required for ${method2})`); } break; case "resources/list": case "resources/templates/list": case "resources/read": if (!this._capabilities.resources) { - throw new Error(`Server does not support resources (required for ${method3})`); + throw new Error(`Server does not support resources (required for ${method2})`); } break; case "tools/call": case "tools/list": if (!this._capabilities.tools) { - throw new Error(`Server does not support tools (required for ${method3})`); + throw new Error(`Server does not support tools (required for ${method2})`); } break; case "tasks/get": @@ -549747,7 +477161,7 @@ var init_server2 = __esm(() => { case "tasks/result": case "tasks/cancel": if (!this._capabilities.tasks) { - throw new Error(`Server does not support tasks capability (required for ${method3})`); + throw new Error(`Server does not support tasks capability (required for ${method2})`); } break; case "ping": @@ -549755,14 +477169,14 @@ var init_server2 = __esm(() => { break; } } - assertTaskCapability(method3) { - assertClientRequestTaskCapability2(this._clientCapabilities?.tasks?.requests, method3, "Client"); + assertTaskCapability(method2) { + assertClientRequestTaskCapability2(this._clientCapabilities?.tasks?.requests, method2, "Client"); } - assertTaskHandlerCapability(method3) { + assertTaskHandlerCapability(method2) { if (!this._capabilities) { return; } - assertToolsCallTaskCapability2(this._capabilities.tasks?.requests, method3, "Server"); + assertToolsCallTaskCapability2(this._capabilities.tasks?.requests, method2, "Server"); } async _oninitialize(request) { const requestedVersion = request.params.protocolVersion; @@ -549837,22 +477251,22 @@ var init_server2 = __esm(() => { throw new Error("Client does not support form elicitation."); } const formParams = params.mode === "form" ? params : { ...params, mode: "form" }; - const result3 = await this.request({ method: "elicitation/create", params: formParams }, ElicitResultSchema2, options2); - if (result3.action === "accept" && result3.content && formParams.requestedSchema) { + const result2 = await this.request({ method: "elicitation/create", params: formParams }, ElicitResultSchema2, options2); + if (result2.action === "accept" && result2.content && formParams.requestedSchema) { try { const validator = this._jsonSchemaValidator.getValidator(formParams.requestedSchema); - const validationResult = validator(result3.content); + const validationResult = validator(result2.content); if (!validationResult.valid) { throw new McpError2(ErrorCode2.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`); } - } catch (error46) { - if (error46 instanceof McpError2) { - throw error46; + } catch (error42) { + if (error42 instanceof McpError2) { + throw error42; } - throw new McpError2(ErrorCode2.InternalError, `Error validating elicitation response: ${error46 instanceof Error ? error46.message : String(error46)}`); + throw new McpError2(ErrorCode2.InternalError, `Error validating elicitation response: ${error42 instanceof Error ? error42.message : String(error42)}`); } } - return result3; + return result2; } } } @@ -550445,9 +477859,9 @@ function bindSessionContext(adapter2, coordinateMode, ctx) { if (ctx.checkCuLock) { const lock2 = await ctx.checkCuLock(); if (lock2.holder !== undefined && !lock2.isSelf) { - const text2 = ctx.formatLockHeldMessage?.(lock2.holder) ?? DEFAULT_LOCK_HELD_MESSAGE; + const text = ctx.formatLockHeldMessage?.(lock2.holder) ?? DEFAULT_LOCK_HELD_MESSAGE; return { - content: [{ type: "text", text: text2 }], + content: [{ type: "text", text }], isError: true, telemetry: { error_kind: "cu_lock_held" } }; @@ -550456,9 +477870,9 @@ function bindSessionContext(adapter2, coordinateMode, ctx) { await ctx.acquireCuLock?.(); const recheck = await ctx.checkCuLock(); if (recheck.holder !== undefined && !recheck.isSelf) { - const text2 = ctx.formatLockHeldMessage?.(recheck.holder) ?? DEFAULT_LOCK_HELD_MESSAGE; + const text = ctx.formatLockHeldMessage?.(recheck.holder) ?? DEFAULT_LOCK_HELD_MESSAGE; return { - content: [{ type: "text", text: text2 }], + content: [{ type: "text", text }], isError: true, telemetry: { error_kind: "cu_lock_held" } }; @@ -550495,14 +477909,14 @@ function bindSessionContext(adapter2, coordinateMode, ctx) { }; logger.debug(`[${serverName}] tool=${name} allowedApps=${overrides.allowedApps.length} coordMode=${coordinateMode}`); try { - const result3 = await handleToolCall(adapter2, name, args, overrides); - if (result3.screenshot) { - lastScreenshot = result3.screenshot; - const { base64: _blob, ...dims } = result3.screenshot; + const result2 = await handleToolCall(adapter2, name, args, overrides); + if (result2.screenshot) { + lastScreenshot = result2.screenshot; + const { base64: _blob, ...dims } = result2.screenshot; logger.debug(`[${serverName}] screenshot dims: ${JSON.stringify(dims)}`); ctx.onScreenshotCaptured?.(dims); } - return result3; + return result2; } finally { dialogAbort.abort(); } @@ -550516,8 +477930,8 @@ function createComputerUseMcpServer(adapter2, coordinateMode, context) { if (context) { const dispatch = bindSessionContext(adapter2, coordinateMode, context); server.setRequestHandler(CallToolRequestSchema2, async (request) => { - const { screenshot: _s, telemetry: _t, ...result3 } = await dispatch(request.params.name, request.params.arguments ?? {}); - return result3; + const { screenshot: _s, telemetry: _t, ...result2 } = await dispatch(request.params.name, request.params.arguments ?? {}); + return result2; }); return server; } @@ -550538,16 +477952,16 @@ function createComputerUseMcpServer(adapter2, coordinateMode, context) { var DEFAULT_LOCK_HELD_MESSAGE; var init_mcpServer = __esm(() => { init_server2(); - init_types14(); + init_types13(); init_toolCalls(); init_tools3(); - init_types13(); + init_types11(); DEFAULT_LOCK_HELD_MESSAGE = "Another Claude session is currently using the computer. Wait for that " + "session to finish, or find a non-computer-use approach."; }); // ../node_modules/@ant/computer-use-mcp/src/index.ts var init_src = __esm(() => { - init_types13(); + init_types11(); init_sentinelApps(); init_deniedApps(); init_keyBlocklist(); @@ -550561,11 +477975,11 @@ var init_src = __esm(() => { // ../node_modules/@ant/computer-use-input/js/index.js var require_js2 = __commonJS((exports, module) => { var __dirname = "/Users/chenqg/Downloads/node_modules/@ant/computer-use-input/js"; - var path21 = __require("path"); + var path16 = __require("path"); if (process.platform !== "darwin") { module.exports = { isSupported: false }; } else { - const native = __require(process.env.COMPUTER_USE_INPUT_NODE_PATH ?? path21.resolve(__dirname, "../prebuilds/computer-use-input.node")); + const native = __require(process.env.COMPUTER_USE_INPUT_NODE_PATH ?? path16.resolve(__dirname, "../prebuilds/computer-use-input.node")); module.exports = { isSupported: true, ...native }; } }); @@ -550574,11 +477988,11 @@ var require_js2 = __commonJS((exports, module) => { function requireComputerUseInput() { if (cached5) return cached5; - const input11 = require_js2(); - if (!input11.isSupported) { + const input = require_js2(); + if (!input.isSupported) { throw new Error("@ant/computer-use-input is not supported on this platform"); } - return cached5 = input11; + return cached5 = input; } var cached5; @@ -550602,9 +478016,9 @@ async function readClipboardViaPbpaste() { } return stdout; } -async function writeClipboardViaPbcopy(text2) { +async function writeClipboardViaPbcopy(text) { const { code } = await execFileNoThrow("pbcopy", [], { - input: text2, + input: text, useCwd: false }); if (code !== 0) { @@ -550617,31 +478031,31 @@ function isBareEscape(parts) { const lower = parts[0].toLowerCase(); return lower === "escape" || lower === "esc"; } -async function moveAndSettle(input11, x4, y2) { - await input11.moveMouse(x4, y2, false); - await sleep4(MOVE_SETTLE_MS); +async function moveAndSettle(input, x3, y2) { + await input.moveMouse(x3, y2, false); + await sleep2(MOVE_SETTLE_MS); } -async function releasePressed(input11, pressed) { +async function releasePressed(input, pressed) { let k; while ((k = pressed.pop()) !== undefined) { try { - await input11.key(k, "release"); + await input.key(k, "release"); } catch {} } } -async function withModifiers(input11, mods, fn) { +async function withModifiers(input, mods, fn) { const pressed = []; try { for (const m of mods) { - await input11.key(m, "press"); + await input.key(m, "press"); pressed.push(m); } return await fn(); } finally { - await releasePressed(input11, pressed); + await releasePressed(input, pressed); } } -async function typeViaClipboard(input11, text2) { +async function typeViaClipboard(input, text) { let saved; try { saved = await readClipboardViaPbpaste(); @@ -550649,12 +478063,12 @@ async function typeViaClipboard(input11, text2) { logForDebugging("[computer-use] pbpaste before paste failed; proceeding without restore"); } try { - await writeClipboardViaPbcopy(text2); - if (await readClipboardViaPbpaste() !== text2) { + await writeClipboardViaPbcopy(text); + if (await readClipboardViaPbpaste() !== text) { throw new Error("Clipboard write did not round-trip."); } - await input11.keys(["command", "v"]); - await sleep4(100); + await input.keys(["command", "v"]); + await sleep2(100); } finally { if (typeof saved === "string") { try { @@ -550665,12 +478079,12 @@ async function typeViaClipboard(input11, text2) { } } } -async function animatedMove(input11, targetX, targetY, mouseAnimationEnabled) { +async function animatedMove(input, targetX, targetY, mouseAnimationEnabled) { if (!mouseAnimationEnabled) { - await moveAndSettle(input11, targetX, targetY); + await moveAndSettle(input, targetX, targetY); return; } - const start = await input11.mouseLocation(); + const start = await input.mouseLocation(); const deltaX = targetX - start.x; const deltaY = targetY - start.y; const distance = Math.hypot(deltaX, deltaY); @@ -550678,7 +478092,7 @@ async function animatedMove(input11, targetX, targetY, mouseAnimationEnabled) { return; const durationSec = Math.min(distance / 2000, 0.5); if (durationSec < 0.03) { - await moveAndSettle(input11, targetX, targetY); + await moveAndSettle(input, targetX, targetY); return; } const frameRate = 60; @@ -550687,12 +478101,12 @@ async function animatedMove(input11, targetX, targetY, mouseAnimationEnabled) { for (let frame = 1;frame <= totalFrames; frame++) { const t = frame / totalFrames; const eased = 1 - Math.pow(1 - t, 3); - await input11.moveMouse(Math.round(start.x + deltaX * eased), Math.round(start.y + deltaY * eased), false); + await input.moveMouse(Math.round(start.x + deltaX * eased), Math.round(start.y + deltaY * eased), false); if (frame < totalFrames) { - await sleep4(frameIntervalMs); + await sleep2(frameIntervalMs); } } - await sleep4(MOVE_SETTLE_MS); + await sleep2(MOVE_SETTLE_MS); } function createCliExecutor(opts) { if (process.platform !== "darwin") { @@ -550715,13 +478129,13 @@ function createCliExecutor(opts) { } return drainRunLoop(async () => { try { - const result3 = await cu.apps.prepareDisplay(allowlistBundleIds, surrogateHost, displayId); - if (result3.activated) { - logForDebugging(`[computer-use] prepareForAction: activated ${result3.activated}`); + const result2 = await cu.apps.prepareDisplay(allowlistBundleIds, surrogateHost, displayId); + if (result2.activated) { + logForDebugging(`[computer-use] prepareForAction: activated ${result2.activated}`); } - return result3.hidden; - } catch (err3) { - logForDebugging(`[computer-use] prepareForAction failed; continuing to action: ${errorMessage(err3)}`, { level: "warn" }); + return result2.hidden; + } catch (err2) { + logForDebugging(`[computer-use] prepareForAction failed; continuing to action: ${errorMessage(err2)}`, { level: "warn" }); return []; } }); @@ -550753,25 +478167,25 @@ function createCliExecutor(opts) { const [outW, outH] = computeTargetDims(regionLogical.w, regionLogical.h, d.scaleFactor); return drainRunLoop(() => cu.screenshot.captureRegion(withoutTerminal(allowedBundleIds), regionLogical.x, regionLogical.y, regionLogical.w, regionLogical.h, outW, outH, SCREENSHOT_JPEG_QUALITY, displayId)); }, - async key(keySequence, repeat4) { - const input11 = requireComputerUseInput(); + async key(keySequence, repeat3) { + const input = requireComputerUseInput(); const parts = keySequence.split("+").filter((p) => p.length > 0); const isEsc = isBareEscape(parts); - const n2 = repeat4 ?? 1; + const n2 = repeat3 ?? 1; await drainRunLoop(async () => { - for (let i4 = 0;i4 < n2; i4++) { - if (i4 > 0) { - await sleep4(8); + for (let i3 = 0;i3 < n2; i3++) { + if (i3 > 0) { + await sleep2(8); } if (isEsc) { notifyExpectedEscape(); } - await input11.keys(parts); + await input.keys(parts); } }); }, async holdKey(keyNames, durationMs) { - const input11 = requireComputerUseInput(); + const input = requireComputerUseInput(); const pressed = []; let orphaned = false; try { @@ -550782,36 +478196,36 @@ function createCliExecutor(opts) { if (isBareEscape([k])) { notifyExpectedEscape(); } - await input11.key(k, "press"); + await input.key(k, "press"); pressed.push(k); } }); - await sleep4(durationMs); + await sleep2(durationMs); } finally { orphaned = true; - await drainRunLoop(() => releasePressed(input11, pressed)); + await drainRunLoop(() => releasePressed(input, pressed)); } }, - async type(text2, opts2) { - const input11 = requireComputerUseInput(); + async type(text, opts2) { + const input = requireComputerUseInput(); if (opts2.viaClipboard) { - await drainRunLoop(() => typeViaClipboard(input11, text2)); + await drainRunLoop(() => typeViaClipboard(input, text)); return; } - await input11.typeText(text2); + await input.typeText(text); }, readClipboard: readClipboardViaPbpaste, writeClipboard: writeClipboardViaPbcopy, - async moveMouse(x4, y2) { - await moveAndSettle(requireComputerUseInput(), x4, y2); + async moveMouse(x3, y2) { + await moveAndSettle(requireComputerUseInput(), x3, y2); }, - async click(x4, y2, button, count3, modifiers) { - const input11 = requireComputerUseInput(); - await moveAndSettle(input11, x4, y2); + async click(x3, y2, button, count3, modifiers) { + const input = requireComputerUseInput(); + await moveAndSettle(input, x3, y2); if (modifiers && modifiers.length > 0) { - await drainRunLoop(() => withModifiers(input11, modifiers, () => input11.mouseButton(button, "click", count3))); + await drainRunLoop(() => withModifiers(input, modifiers, () => input.mouseButton(button, "click", count3))); } else { - await input11.mouseButton(button, "click", count3); + await input.mouseButton(button, "click", count3); } }, async mouseDown() { @@ -550824,26 +478238,26 @@ function createCliExecutor(opts) { return requireComputerUseInput().mouseLocation(); }, async drag(from, to) { - const input11 = requireComputerUseInput(); + const input = requireComputerUseInput(); if (from !== undefined) { - await moveAndSettle(input11, from.x, from.y); + await moveAndSettle(input, from.x, from.y); } - await input11.mouseButton("left", "press"); - await sleep4(MOVE_SETTLE_MS); + await input.mouseButton("left", "press"); + await sleep2(MOVE_SETTLE_MS); try { - await animatedMove(input11, to.x, to.y, getMouseAnimationEnabled()); + await animatedMove(input, to.x, to.y, getMouseAnimationEnabled()); } finally { - await input11.mouseButton("left", "release"); + await input.mouseButton("left", "release"); } }, - async scroll(x4, y2, dx, dy) { - const input11 = requireComputerUseInput(); - await moveAndSettle(input11, x4, y2); + async scroll(x3, y2, dx, dy) { + const input = requireComputerUseInput(); + await moveAndSettle(input, x3, y2); if (dy !== 0) { - await input11.mouseScroll(dy, "vertical"); + await input.mouseScroll(dy, "vertical"); } if (dx !== 0) { - await input11.mouseScroll(dx, "horizontal"); + await input.mouseScroll(dx, "horizontal"); } }, async getFrontmostApp() { @@ -550852,14 +478266,14 @@ function createCliExecutor(opts) { return null; return { bundleId: info.bundleId, displayName: info.appName }; }, - async appUnderPoint(x4, y2) { - return cu.apps.appUnderPoint(x4, y2); + async appUnderPoint(x3, y2) { + return cu.apps.appUnderPoint(x3, y2); }, async listInstalledApps() { return drainRunLoop(() => cu.apps.listInstalled()); }, - async getAppIcon(path21) { - return cu.apps.iconDataUrl(path21) ?? undefined; + async getAppIcon(path16) { + return cu.apps.iconDataUrl(path16) ?? undefined; }, async listRunningApps() { return cu.apps.listRunning(); @@ -550896,7 +478310,7 @@ async function cleanupComputerUseAfterTurn(ctx) { const hidden2 = appState.computerUseMcpState?.hiddenDuringTurn; if (hidden2 && hidden2.size > 0) { const { unhideComputerUseApps: unhideComputerUseApps2 } = await Promise.resolve().then(() => (init_executor(), exports_executor)); - const unhide = unhideComputerUseApps2([...hidden2]).catch((err3) => logForDebugging(`[Computer Use MCP] auto-unhide failed: ${errorMessage(err3)}`)); + const unhide = unhideComputerUseApps2([...hidden2]).catch((err2) => logForDebugging(`[Computer Use MCP] auto-unhide failed: ${errorMessage(err2)}`)); const timeout = withResolvers(); const timer = setTimeout(timeout.resolve, UNHIDE_TIMEOUT_MS); await Promise.race([unhide, timeout.promise]).finally(() => clearTimeout(timer)); @@ -550912,8 +478326,8 @@ async function cleanupComputerUseAfterTurn(ctx) { return; try { unregisterEscHotkey(); - } catch (err3) { - logForDebugging(`[Computer Use MCP] unregisterEscHotkey failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[Computer Use MCP] unregisterEscHotkey failed: ${errorMessage(err2)}`); } if (await releaseComputerUseLock()) { ctx.sendOSNotification?.({ @@ -550946,8 +478360,8 @@ async function* handleStopHooks(messagesForQuery, assistantMessages, systemPromp } if (feature("TEMPLATES") && process.env.CLAUDE_JOB_DIR && querySource.startsWith("repl_main_thread") && !toolUseContext.agentId) { const turnAssistantMessages = stopHookContext.messages.filter((m) => m.type === "assistant"); - const p = jobClassifierModule.classifyAndWriteState(process.env.CLAUDE_JOB_DIR, turnAssistantMessages).catch((err3) => { - logForDebugging(`[job] classifier error: ${errorMessage(err3)}`, { + const p = jobClassifierModule.classifyAndWriteState(process.env.CLAUDE_JOB_DIR, turnAssistantMessages).catch((err2) => { + logForDebugging(`[job] classifier error: ${errorMessage(err2)}`, { level: "error" }); }); @@ -550985,13 +478399,13 @@ async function* handleStopHooks(messagesForQuery, assistantMessages, systemPromp let hasOutput = false; const hookErrors = []; const hookInfos = []; - for await (const result3 of generator) { - if (result3.message) { - yield result3.message; - if (result3.message.type === "progress" && result3.message.toolUseID) { - stopHookToolUseID = result3.message.toolUseID; + for await (const result2 of generator) { + if (result2.message) { + yield result2.message; + if (result2.message.type === "progress" && result2.message.toolUseID) { + stopHookToolUseID = result2.message.toolUseID; hookCount++; - const progressData = result3.message.data; + const progressData = result2.message.data; if (progressData.command) { hookInfos.push({ command: progressData.command, @@ -550999,8 +478413,8 @@ async function* handleStopHooks(messagesForQuery, assistantMessages, systemPromp }); } } - if (result3.message.type === "attachment") { - const attachment = result3.message.attachment; + if (result2.message.type === "attachment") { + const attachment = result2.message.attachment; if ("hookEvent" in attachment && (attachment.hookEvent === "Stop" || attachment.hookEvent === "SubagentStop")) { if (attachment.type === "hook_non_blocking_error") { hookErrors.push(attachment.stderr || `Exit code ${attachment.exitCode}`); @@ -551014,7 +478428,7 @@ async function* handleStopHooks(messagesForQuery, assistantMessages, systemPromp } } if ("durationMs" in attachment && "command" in attachment) { - const info = hookInfos.find((i4) => i4.command === attachment.command && i4.durationMs === undefined); + const info = hookInfos.find((i3) => i3.command === attachment.command && i3.durationMs === undefined); if (info) { info.durationMs = attachment.durationMs; } @@ -551022,19 +478436,19 @@ async function* handleStopHooks(messagesForQuery, assistantMessages, systemPromp } } } - if (result3.blockingError) { + if (result2.blockingError) { const userMessage = createUserMessage({ - content: getStopHookMessage(result3.blockingError), + content: getStopHookMessage(result2.blockingError), isMeta: true }); blockingErrors.push(userMessage); yield userMessage; hasOutput = true; - hookErrors.push(result3.blockingError.blockingError); + hookErrors.push(result2.blockingError.blockingError); } - if (result3.preventContinuation) { + if (result2.preventContinuation) { preventedContinuation = true; - stopReason = result3.stopReason || "Stop hook prevented continuation"; + stopReason = result2.stopReason || "Stop hook prevented continuation"; yield createAttachmentMessage({ type: "hook_stopped_continuation", message: stopReason, @@ -551083,24 +478497,24 @@ async function* handleStopHooks(messagesForQuery, assistantMessages, systemPromp const inProgressTasks = tasks.filter((t) => t.status === "in_progress" && t.owner === teammateName); for (const task of inProgressTasks) { const taskCompletedGenerator = executeTaskCompletedHooks(task.id, task.subject, task.description, teammateName, teamName, permissionMode, toolUseContext.abortController.signal, undefined, toolUseContext); - for await (const result3 of taskCompletedGenerator) { - if (result3.message) { - if (result3.message.type === "progress" && result3.message.toolUseID) { - teammateHookToolUseID = result3.message.toolUseID; + for await (const result2 of taskCompletedGenerator) { + if (result2.message) { + if (result2.message.type === "progress" && result2.message.toolUseID) { + teammateHookToolUseID = result2.message.toolUseID; } - yield result3.message; + yield result2.message; } - if (result3.blockingError) { + if (result2.blockingError) { const userMessage = createUserMessage({ - content: getTaskCompletedHookMessage(result3.blockingError), + content: getTaskCompletedHookMessage(result2.blockingError), isMeta: true }); teammateBlockingErrors.push(userMessage); yield userMessage; } - if (result3.preventContinuation) { + if (result2.preventContinuation) { teammatePreventedContinuation = true; - teammateStopReason = result3.stopReason || "TaskCompleted hook prevented continuation"; + teammateStopReason = result2.stopReason || "TaskCompleted hook prevented continuation"; yield createAttachmentMessage({ type: "hook_stopped_continuation", message: teammateStopReason, @@ -551115,24 +478529,24 @@ async function* handleStopHooks(messagesForQuery, assistantMessages, systemPromp } } const teammateIdleGenerator = executeTeammateIdleHooks(teammateName, teamName, permissionMode, toolUseContext.abortController.signal); - for await (const result3 of teammateIdleGenerator) { - if (result3.message) { - if (result3.message.type === "progress" && result3.message.toolUseID) { - teammateHookToolUseID = result3.message.toolUseID; + for await (const result2 of teammateIdleGenerator) { + if (result2.message) { + if (result2.message.type === "progress" && result2.message.toolUseID) { + teammateHookToolUseID = result2.message.toolUseID; } - yield result3.message; + yield result2.message; } - if (result3.blockingError) { + if (result2.blockingError) { const userMessage = createUserMessage({ - content: getTeammateIdleHookMessage(result3.blockingError), + content: getTeammateIdleHookMessage(result2.blockingError), isMeta: true }); teammateBlockingErrors.push(userMessage); yield userMessage; } - if (result3.preventContinuation) { + if (result2.preventContinuation) { teammatePreventedContinuation = true; - teammateStopReason = result3.stopReason || "TeammateIdle hook prevented continuation"; + teammateStopReason = result2.stopReason || "TeammateIdle hook prevented continuation"; yield createAttachmentMessage({ type: "hook_stopped_continuation", message: teammateStopReason, @@ -551156,14 +478570,14 @@ async function* handleStopHooks(messagesForQuery, assistantMessages, systemPromp } } return { blockingErrors: [], preventContinuation: false }; - } catch (error46) { + } catch (error42) { const durationMs = Date.now() - hookStartTime; logEvent("tengu_stop_hook_error", { duration: durationMs, queryChainId: toolUseContext.queryTracking?.chainId, queryDepth: toolUseContext.queryTracking?.depth }); - yield createSystemMessage(`Stop hook failed: ${errorMessage(error46)}`, "warning"); + yield createSystemMessage(`Stop hook failed: ${errorMessage(error42)}`, "warning"); return { blockingErrors: [], preventContinuation: false }; } } @@ -551177,7 +478591,7 @@ var init_stopHooks = __esm(() => { init_debug(); init_errors(); init_hooks5(); - init_messages5(); + init_messages3(); init_tasks(); init_teammate(); init_autoDream(); @@ -551226,21 +478640,21 @@ var init_deps = __esm(() => { function parseBudgetMatch(value, suffix) { return parseFloat(value) * MULTIPLIERS[suffix.toLowerCase()]; } -function parseTokenBudget(text2) { - const startMatch = text2.match(SHORTHAND_START_RE); +function parseTokenBudget(text) { + const startMatch = text.match(SHORTHAND_START_RE); if (startMatch) return parseBudgetMatch(startMatch[1], startMatch[2]); - const endMatch = text2.match(SHORTHAND_END_RE); + const endMatch = text.match(SHORTHAND_END_RE); if (endMatch) return parseBudgetMatch(endMatch[1], endMatch[2]); - const verboseMatch = text2.match(VERBOSE_RE); + const verboseMatch = text.match(VERBOSE_RE); if (verboseMatch) return parseBudgetMatch(verboseMatch[1], verboseMatch[2]); return null; } -function findTokenBudgetPositions(text2) { +function findTokenBudgetPositions(text) { const positions = []; - const startMatch = text2.match(SHORTHAND_START_RE); + const startMatch = text.match(SHORTHAND_START_RE); if (startMatch) { const offset = startMatch.index + startMatch[0].length - startMatch[0].trimStart().length; positions.push({ @@ -551248,7 +478662,7 @@ function findTokenBudgetPositions(text2) { end: startMatch.index + startMatch[0].length }); } - const endMatch = text2.match(SHORTHAND_END_RE); + const endMatch = text.match(SHORTHAND_END_RE); if (endMatch) { const endStart = endMatch.index + 1; const alreadyCovered = positions.some((p) => endStart >= p.start && endStart < p.end); @@ -551259,7 +478673,7 @@ function findTokenBudgetPositions(text2) { }); } } - for (const match of text2.matchAll(VERBOSE_RE_G)) { + for (const match of text.matchAll(VERBOSE_RE_G)) { positions.push({ start: match.index, end: match.index + match[0].length }); } return positions; @@ -551410,8 +478824,8 @@ function isWithheldMaxOutputTokens(msg) { async function* query(params) { const consumedCommandUuids = []; const terminal = yield* queryLoop(params, consumedCommandUuids); - for (const uuid8 of consumedCommandUuids) { - notifyCommandLifecycle(uuid8, "completed"); + for (const uuid5 of consumedCommandUuids) { + notifyCommandLifecycle(uuid5, "completed"); } return terminal; } @@ -551443,7 +478857,7 @@ async function* queryLoop(params, consumedCommandUuids) { }; const budgetTracker = feature("TOKEN_BUDGET") ? createBudgetTracker() : null; let taskBudgetRemaining = undefined; - const config5 = buildQueryConfig(); + const config3 = buildQueryConfig(); const pendingMemoryPrefetch = __using(__stack, startRelevantMemoryPrefetch(state.messages, state.toolUseContext), 0); while (true) { let { toolUseContext } = state; @@ -551560,7 +478974,7 @@ async function* queryLoop(params, consumedCommandUuids) { const toolUseBlocks = []; let needsFollowUp = false; queryCheckpoint("query_setup_start"); - const useStreamingToolExecution = config5.gates.streamingToolExecution; + const useStreamingToolExecution = config3.gates.streamingToolExecution; let streamingToolExecutor = useStreamingToolExecution ? new StreamingToolExecutor(toolUseContext.options.tools, canUseTool, toolUseContext) : null; const appState = toolUseContext.getAppState(); const permissionMode = appState.toolPermissionContext.mode; @@ -551570,7 +478984,7 @@ async function* queryLoop(params, consumedCommandUuids) { exceeds200kTokens: permissionMode === "plan" && doesMostRecentAssistantMessageExceed200k(messagesForQuery) }); queryCheckpoint("query_setup_end"); - const dumpPromptsFetch = config5.gates.isAnt ? createDumpPromptsFetch(toolUseContext.agentId ?? config5.sessionId) : undefined; + const dumpPromptsFetch = config3.gates.isAnt ? createDumpPromptsFetch(toolUseContext.agentId ?? config3.sessionId) : undefined; let collapseOwnsIt = false; if (feature("CONTEXT_COLLAPSE")) { collapseOwnsIt = (contextCollapse?.isContextCollapseEnabled() ?? false) && isAutoCompactEnabled(); @@ -551606,7 +479020,7 @@ async function* queryLoop(params, consumedCommandUuids) { return appState2.toolPermissionContext; }, model: currentModel, - ...config5.gates.fastModeEnabled && { + ...config3.gates.fastModeEnabled && { fastMode: appState.fastMode }, toolChoice: undefined, @@ -551660,8 +479074,8 @@ async function* queryLoop(params, consumedCommandUuids) { let yieldMessage = message; if (message.type === "assistant") { let clonedContent; - for (let i4 = 0;i4 < message.message.content.length; i4++) { - const block2 = message.message.content[i4]; + for (let i3 = 0;i3 < message.message.content.length; i3++) { + const block2 = message.message.content[i3]; if (block2.type === "tool_use" && typeof block2.input === "object" && block2.input !== null) { const tool = findToolByName(toolUseContext.options.tools, block2.name); if (tool?.backfillObservableInput) { @@ -551671,7 +479085,7 @@ async function* queryLoop(params, consumedCommandUuids) { const addedFields = Object.keys(inputCopy).some((k) => !(k in originalInput)); if (addedFields) { clonedContent ??= [...message.message.content]; - clonedContent[i4] = { ...block2, input: inputCopy }; + clonedContent[i3] = { ...block2, input: inputCopy }; } } } @@ -551715,10 +479129,10 @@ async function* queryLoop(params, consumedCommandUuids) { } } if (streamingToolExecutor && !toolUseContext.abortController.signal.aborted) { - for (const result3 of streamingToolExecutor.getCompletedResults()) { - if (result3.message) { - yield result3.message; - toolResults.push(...normalizeMessagesForAPI([result3.message], toolUseContext.options.tools).filter((_) => _.type === "user")); + for (const result2 of streamingToolExecutor.getCompletedResults()) { + if (result2.message) { + yield result2.message; + toolResults.push(...normalizeMessagesForAPI([result2.message], toolUseContext.options.tools).filter((_) => _.type === "user")); } } } @@ -551763,18 +479177,18 @@ async function* queryLoop(params, consumedCommandUuids) { throw innerError; } } - } catch (error46) { - logError2(error46); - const errorMessage2 = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + logError2(error42); + const errorMessage2 = error42 instanceof Error ? error42.message : String(error42); logEvent("tengu_query_error", { assistantMessages: assistantMessages.length, toolUses: assistantMessages.flatMap((_) => _.message.content.filter((content) => content.type === "tool_use")).length, queryChainId: queryChainIdForAnalytics, queryDepth: queryTracking.depth }); - if (error46 instanceof ImageSizeError || error46 instanceof ImageResizeError) { + if (error42 instanceof ImageSizeError || error42 instanceof ImageResizeError) { yield createAssistantAPIErrorMessage({ - content: error46.message + content: error42.message }); return { reason: "image_error" }; } @@ -551782,17 +479196,17 @@ async function* queryLoop(params, consumedCommandUuids) { yield createAssistantAPIErrorMessage({ content: errorMessage2 }); - logAntError("Query error", error46); - return { reason: "model_error", error: error46 }; + logAntError("Query error", error42); + return { reason: "model_error", error: error42 }; } if (assistantMessages.length > 0) { executePostSamplingHooks([...messagesForQuery, ...assistantMessages], systemPrompt, userContext, systemContext, toolUseContext, querySource); } if (toolUseContext.abortController.signal.aborted) { if (streamingToolExecutor) { - for await (const update3 of streamingToolExecutor.getRemainingResults()) { - if (update3.message) { - yield update3.message; + for await (const update2 of streamingToolExecutor.getRemainingResults()) { + if (update2.message) { + yield update2.message; } } } else { @@ -552025,24 +479439,24 @@ async function* queryLoop(params, consumedCommandUuids) { }); } const toolUpdates = streamingToolExecutor ? streamingToolExecutor.getRemainingResults() : runTools(toolUseBlocks, assistantMessages, canUseTool, toolUseContext); - for await (const update3 of toolUpdates) { - if (update3.message) { - yield update3.message; - if (update3.message.type === "attachment" && update3.message.attachment.type === "hook_stopped_continuation") { + for await (const update2 of toolUpdates) { + if (update2.message) { + yield update2.message; + if (update2.message.type === "attachment" && update2.message.attachment.type === "hook_stopped_continuation") { shouldPreventContinuation = true; } - toolResults.push(...normalizeMessagesForAPI([update3.message], toolUseContext.options.tools).filter((_) => _.type === "user")); + toolResults.push(...normalizeMessagesForAPI([update2.message], toolUseContext.options.tools).filter((_) => _.type === "user")); } - if (update3.newContext) { + if (update2.newContext) { updatedToolUseContext = { - ...update3.newContext, + ...update2.newContext, queryTracking }; } } queryCheckpoint("query_tool_execution_end"); let nextPendingToolUseSummary; - if (config5.gates.emitToolUseSummaries && toolUseBlocks.length > 0 && !toolUseContext.abortController.signal.aborted && !toolUseContext.agentId) { + if (config3.gates.emitToolUseSummaries && toolUseBlocks.length > 0 && !toolUseContext.abortController.signal.aborted && !toolUseContext.agentId) { const lastAssistantMessage = assistantMessages.at(-1); let lastAssistantText; if (lastAssistantMessage) { @@ -552056,7 +479470,7 @@ async function* queryLoop(params, consumedCommandUuids) { } const toolUseIds = toolUseBlocks.map((block2) => block2.id); const toolInfoForSummary = toolUseBlocks.map((block2) => { - const toolResult = toolResults.find((result3) => result3.type === "user" && Array.isArray(result3.message.content) && result3.message.content.some((content) => content.type === "tool_result" && content.tool_use_id === block2.id)); + const toolResult = toolResults.find((result2) => result2.type === "user" && Array.isArray(result2.message.content) && result2.message.content.some((content) => content.type === "tool_result" && content.tool_use_id === block2.id)); const resultContent = toolResult?.type === "user" && Array.isArray(toolResult.message.content) ? toolResult.message.content.find((c6) => c6.type === "tool_result" && c6.tool_use_id === block2.id) : undefined; return { name: block2.name, @@ -552156,7 +479570,7 @@ async function* queryLoop(params, consumedCommandUuids) { notifyCommandLifecycle(cmd.uuid, "started"); } } - remove3(consumedCommands); + remove2(consumedCommands); } const fileChangeAttachmentCount = count2(toolResults, (tr) => tr.type === "attachment" && tr.attachment.type === "edited_text_file"); logEvent("tengu_query_after_attachments", { @@ -552230,15 +479644,15 @@ var reactiveCompact, contextCollapse, skillPrefetch, jobClassifier, snipModule, var init_query = __esm(() => { init_withRetry(); init_autoCompact(); - init_compact3(); + init_compact2(); init_analytics(); init_imageValidation(); init_imageResizer(); init_Tool(); init_log3(); - init_errors7(); + init_errors6(); init_debug(); - init_messages5(); + init_messages3(); init_toolUseSummaryGenerator(); init_api4(); init_attachments2(); @@ -552292,13 +479706,13 @@ var init_emptyUsage = __esm(() => { }); // src/services/api/logging.ts -function getErrorMessage2(error46) { - if (error46 instanceof APIError) { - const body = error46.error; +function getErrorMessage2(error42) { + if (error42 instanceof APIError) { + const body = error42.error; if (body?.error?.message) return body.error.message; } - return error46 instanceof Error ? error46.message : String(error46); + return error42 instanceof Error ? error42.message : String(error42); } function detectGateway({ headers, @@ -552341,7 +479755,7 @@ function getAnthropicEnvMetadata() { function getBuildAgeMinutes() { if (false) ; - const buildTime = new Date("2026-04-01T09:59:54.268Z").getTime(); + const buildTime = new Date("2026-04-03T01:33:36.988Z").getTime(); if (isNaN(buildTime)) return; return Math.floor((Date.now() - buildTime) / 60000); @@ -552384,13 +479798,13 @@ function logAPIQuery({ }); } function logAPIError({ - error: error46, + error: error42, model, messageCount, messageTokens, durationMs, durationMsIncludingRetries, - attempt: attempt3, + attempt: attempt2, requestId, clientRequestId, didFallBackToNonStreaming, @@ -552403,13 +479817,13 @@ function logAPIError({ previousRequestId }) { const gateway = detectGateway({ - headers: error46 instanceof APIError && error46.headers ? error46.headers : headers, + headers: error42 instanceof APIError && error42.headers ? error42.headers : headers, baseUrl: process.env.ANTHROPIC_BASE_URL }); - const errStr = getErrorMessage2(error46); - const status = error46 instanceof APIError ? String(error46.status) : undefined; - const errorType = classifyAPIError(error46); - const connectionDetails = extractConnectionErrorDetails(error46); + const errStr = getErrorMessage2(error42); + const status = error42 instanceof APIError ? String(error42.status) : undefined; + const errorType = classifyAPIError(error42); + const connectionDetails = extractConnectionErrorDetails(error42); if (connectionDetails) { const sslLabel = connectionDetails.isSSLError ? " (SSL error)" : ""; logForDebugging(`Connection error details: code=${connectionDetails.code}${sslLabel}, message=${connectionDetails.message}`, { level: "error" }); @@ -552418,7 +479832,7 @@ function logAPIError({ if (clientRequestId) { logForDebugging(`API error x-client-request-id=${clientRequestId} (give this to the API team for server-log lookup)`, { level: "error" }); } - logError2(error46); + logError2(error42); logEvent("tengu_api_error", { model, error: errStr, @@ -552428,7 +479842,7 @@ function logAPIError({ messageTokens, durationMs, durationMsIncludingRetries, - attempt: attempt3, + attempt: attempt2, provider: getAPIProviderForStatsig(), requestId: requestId || undefined, ...invocation ? { @@ -552461,14 +479875,14 @@ function logAPIError({ error: errStr, status_code: String(status), duration_ms: String(durationMs), - attempt: String(attempt3), + attempt: String(attempt2), speed: fastMode ? "fast" : "normal" }); endLLMRequestSpan(llmSpan, { success: false, statusCode: status ? parseInt(status) : undefined, error: errStr, - attempt: attempt3 + attempt: attempt2 }); const teleportInfo = getTeleportedSessionInfo(); if (teleportInfo?.isTeleported && !teleportInfo.hasLoggedFirstMessage) { @@ -552487,7 +479901,7 @@ function logAPISuccess({ usage, durationMs, durationMsIncludingRetries, - attempt: attempt3, + attempt: attempt2, ttftMs, requestId, stopReason, @@ -552509,9 +479923,9 @@ function logAPISuccess({ const isNonInteractiveSession = getIsNonInteractiveSession(); const isPostCompaction = consumePostCompaction(); const hasPrintFlag = process.argv.includes("-p") || process.argv.includes("--print"); - const now3 = Date.now(); + const now2 = Date.now(); const lastCompletion = getLastApiCompletionTimestamp(); - const timeSinceLastApiCallMs = lastCompletion !== null ? now3 - lastCompletion : undefined; + const timeSinceLastApiCallMs = lastCompletion !== null ? now2 - lastCompletion : undefined; const invocation = consumeInvokingRequestId(); logEvent("tengu_api_success", { model, @@ -552529,7 +479943,7 @@ function logAPISuccess({ uncachedInputTokens: usage.cache_creation_input_tokens ?? 0, durationMs, durationMsIncludingRetries, - attempt: attempt3, + attempt: attempt2, ttftMs: ttftMs ?? undefined, buildAgeMins: getBuildAgeMinutes(), provider: getAPIProviderForStatsig(), @@ -552579,7 +479993,7 @@ function logAPISuccess({ ...getAnthropicEnvMetadata(), timeSinceLastApiCallMs }); - setLastApiCompletionTimestamp(now3); + setLastApiCompletionTimestamp(now2); } function logAPISuccessAndDuration({ model, @@ -552588,7 +480002,7 @@ function logAPISuccessAndDuration({ startIncludingRetries, ttftMs, usage, - attempt: attempt3, + attempt: attempt2, messageCount, messageTokens, requestId, @@ -552654,7 +480068,7 @@ function logAPISuccessAndDuration({ usage, durationMs, durationMsIncludingRetries, - attempt: attempt3, + attempt: attempt2, ttftMs, requestId, stopReason, @@ -552701,7 +480115,7 @@ function logAPISuccessAndDuration({ outputTokens: usage.output_tokens, cacheReadTokens: usage.cache_read_input_tokens, cacheCreationTokens: usage.cache_creation_input_tokens, - attempt: attempt3, + attempt: attempt2, modelOutput, thinkingOutput, hasToolCall, @@ -552732,7 +480146,7 @@ var init_logging = __esm(() => { init_analytics(); init_metadata(); init_emptyUsage(); - init_errors7(); + init_errors6(); init_errorUtils(); GATEWAY_FINGERPRINTS = { litellm: { @@ -552943,7 +480357,7 @@ async function runForkedAgent({ const agentId = skipTranscript ? undefined : createAgentId(forkLabel); let lastRecordedUuid = null; if (agentId) { - await recordSidechainTranscript(initialMessages, agentId).catch((err3) => logForDebugging(`Forked agent [${forkLabel}] failed to record initial transcript: ${err3}`)); + await recordSidechainTranscript(initialMessages, agentId).catch((err2) => logForDebugging(`Forked agent [${forkLabel}] failed to record initial transcript: ${err2}`)); lastRecordedUuid = initialMessages.length > 0 ? initialMessages[initialMessages.length - 1].uuid : null; } try { @@ -552974,7 +480388,7 @@ async function runForkedAgent({ onMessage2?.(message); const msg = message; if (agentId && (msg.type === "assistant" || msg.type === "user" || msg.type === "progress")) { - await recordSidechainTranscript([msg], agentId, lastRecordedUuid).catch((err3) => logForDebugging(`Forked agent [${forkLabel}] failed to record transcript: ${err3}`)); + await recordSidechainTranscript([msg], agentId, lastRecordedUuid).catch((err2) => logForDebugging(`Forked agent [${forkLabel}] failed to record transcript: ${err2}`)); if (msg.type !== "progress") { lastRecordedUuid = msg.uuid; } @@ -553037,17 +480451,17 @@ var init_forkedAgent = __esm(() => { init_abortController(); init_debug(); init_fileStateCache(); - init_messages5(); + init_messages3(); init_denialTracking(); init_permissionSetup(); init_sessionStorage(); init_toolResultStorage(); - init_uuid2(); + init_uuid(); }); // src/utils/memory/types.ts var MEMORY_TYPE_VALUES; -var init_types15 = __esm(() => { +var init_types14 = __esm(() => { init_bun_bundle(); MEMORY_TYPE_VALUES = [ "User", @@ -553060,7 +480474,7 @@ var init_types15 = __esm(() => { }); // src/services/internalLogging.ts -import { readFile as readFile33 } from "fs/promises"; +import { readFile as readFile32 } from "fs/promises"; async function logPermissionContextForAnts(toolPermissionContext, moment) { if (process.env.USER_TYPE !== "ant") { return; @@ -553084,7 +480498,7 @@ var init_internalLogging = __esm(() => { const namespacePath = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"; const namespaceNotFound = "namespace not found"; try { - const content = await readFile33(namespacePath, { encoding: "utf8" }); + const content = await readFile32(namespacePath, { encoding: "utf8" }); return content.trim(); } catch { return namespaceNotFound; @@ -553098,7 +480512,7 @@ var init_internalLogging = __esm(() => { const containerIdNotFound = "container ID not found"; const containerIdNotFoundInMountinfo = "container ID not found in mountinfo"; try { - const mountinfo = (await readFile33(containerIdPath, { encoding: "utf8" })).trim(); + const mountinfo = (await readFile32(containerIdPath, { encoding: "utf8" })).trim(); const containerIdPattern = /(?:\/docker\/containers\/|\/sandboxes\/)([0-9a-f]{64})/; const lines = mountinfo.split(` `); @@ -553139,8 +480553,8 @@ function groupMessagesByApiRound(messages) { // src/services/compact/prompt.ts function getPartialCompactPrompt(customInstructions, direction = "from") { - const template3 = direction === "up_to" ? PARTIAL_COMPACT_UP_TO_PROMPT : PARTIAL_COMPACT_PROMPT; - let prompt = NO_TOOLS_PREAMBLE + template3; + const template2 = direction === "up_to" ? PARTIAL_COMPACT_UP_TO_PROMPT : PARTIAL_COMPACT_PROMPT; + let prompt = NO_TOOLS_PREAMBLE + template2; if (customInstructions && customInstructions.trim() !== "") { prompt += ` @@ -553518,8 +480932,8 @@ function stripReinjectedAttachments(messages) { return messages; } function truncateHeadForPTLRetry(messages, ptlResponse) { - const input11 = messages[0]?.type === "user" && messages[0].isMeta && messages[0].message.content === PTL_RETRY_MARKER ? messages.slice(1) : messages; - const groups = groupMessagesByApiRound(input11); + const input = messages[0]?.type === "user" && messages[0].isMeta && messages[0].message.content === PTL_RETRY_MARKER ? messages.slice(1) : messages; + const groups = groupMessagesByApiRound(input); if (groups.length < 2) return null; const tokenGap = getPromptTooLongTokenGap(ptlResponse); @@ -553548,13 +480962,13 @@ function truncateHeadForPTLRetry(messages, ptlResponse) { } return sliced; } -function buildPostCompactMessages(result3) { +function buildPostCompactMessages(result2) { return [ - result3.boundaryMarker, - ...result3.summaryMessages, - ...result3.messagesToKeep ?? [], - ...result3.attachments, - ...result3.hookResults + result2.boundaryMarker, + ...result2.summaryMessages, + ...result2.messagesToKeep ?? [], + ...result2.attachments, + ...result2.hookResults ]; } function annotateBoundaryWithPreservedSegment(boundary, anchorUuid, messagesToKeep) { @@ -553751,8 +481165,8 @@ async function compactConversation(messages, context, cacheSafeParams, suppressF ...(() => { try { return tokenStatsToStatsigMetrics(analyzeContext(messages)); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return {}; } })() @@ -553789,11 +481203,11 @@ async function compactConversation(messages, context, cacheSafeParams, suppressF truePostCompactTokenCount, compactionUsage }; - } catch (error46) { + } catch (error42) { if (!isAutoCompact) { - addErrorNotificationIfNeeded(error46, context); + addErrorNotificationIfNeeded(error42, context); } - throw error46; + throw error42; } finally { context.setStreamMode?.("requesting"); context.setResponseLength?.(() => 0); @@ -553998,9 +481412,9 @@ User context: ${userFeedback}`; postCompactTokenCount, compactionUsage }; - } catch (error46) { - addErrorNotificationIfNeeded(error46, context); - throw error46; + } catch (error42) { + addErrorNotificationIfNeeded(error42, context); + throw error42; } finally { context.setStreamMode?.("requesting"); context.setResponseLength?.(() => 0); @@ -554008,8 +481422,8 @@ User context: ${userFeedback}`; context.setSDKStatus?.(null); } } -function addErrorNotificationIfNeeded(error46, context) { - if (!hasExactErrorMessage(error46, ERROR_MESSAGE_USER_ABORT) && !hasExactErrorMessage(error46, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES)) { +function addErrorNotificationIfNeeded(error42, context) { + if (!hasExactErrorMessage(error42, ERROR_MESSAGE_USER_ABORT) && !hasExactErrorMessage(error42, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES)) { context.addNotification?.({ key: "error-compacting-conversation", text: "Error compacting conversation", @@ -554044,7 +481458,7 @@ async function streamCompactSummary({ try { if (promptCacheSharingEnabled) { try { - const result3 = await runForkedAgent({ + const result2 = await runForkedAgent({ promptMessages: [summaryRequest], cacheSafeParams, canUseTool: createCompactCanUseTool(), @@ -554054,16 +481468,16 @@ async function streamCompactSummary({ skipCacheWrite: true, overrides: { abortController: context.abortController } }); - const assistantMsg = getLastAssistantMessage(result3.messages); + const assistantMsg = getLastAssistantMessage(result2.messages); const assistantText = assistantMsg ? getAssistantMessageText(assistantMsg) : null; if (assistantMsg && assistantText && !assistantMsg.isApiErrorMessage) { if (!assistantText.startsWith(PROMPT_TOO_LONG_ERROR_MESSAGE)) { logEvent("tengu_compact_cache_sharing_success", { preCompactTokenCount, - outputTokens: result3.totalUsage.output_tokens, - cacheReadInputTokens: result3.totalUsage.cache_read_input_tokens, - cacheCreationInputTokens: result3.totalUsage.cache_creation_input_tokens, - cacheHitRate: result3.totalUsage.cache_read_input_tokens > 0 ? result3.totalUsage.cache_read_input_tokens / (result3.totalUsage.cache_read_input_tokens + result3.totalUsage.cache_creation_input_tokens + result3.totalUsage.input_tokens) : 0 + outputTokens: result2.totalUsage.output_tokens, + cacheReadInputTokens: result2.totalUsage.cache_read_input_tokens, + cacheCreationInputTokens: result2.totalUsage.cache_creation_input_tokens, + cacheHitRate: result2.totalUsage.cache_read_input_tokens > 0 ? result2.totalUsage.cache_read_input_tokens / (result2.totalUsage.cache_read_input_tokens + result2.totalUsage.cache_creation_input_tokens + result2.totalUsage.input_tokens) : 0 }); } return assistantMsg; @@ -554073,8 +481487,8 @@ async function streamCompactSummary({ reason: "no_text_response", preCompactTokenCount }); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); logEvent("tengu_compact_cache_sharing_fallback", { reason: "error", preCompactTokenCount @@ -554083,7 +481497,7 @@ async function streamCompactSummary({ } const retryEnabled = getFeatureValue_CACHED_MAY_BE_STALE("tengu_compact_streaming_retry", false); const maxAttempts = retryEnabled ? MAX_COMPACT_STREAMING_RETRIES : 1; - for (let attempt3 = 1;attempt3 <= maxAttempts; attempt3++) { + for (let attempt2 = 1;attempt2 <= maxAttempts; attempt2++) { let hasStartedStreaming = false; let response; context.setResponseLength?.(() => 0); @@ -554140,24 +481554,24 @@ async function streamCompactSummary({ if (response) { return response; } - if (attempt3 < maxAttempts) { + if (attempt2 < maxAttempts) { logEvent("tengu_compact_streaming_retry", { - attempt: attempt3, + attempt: attempt2, preCompactTokenCount, hasStartedStreaming }); - await sleep4(getRetryDelay(attempt3), context.abortController.signal, { + await sleep2(getRetryDelay(attempt2), context.abortController.signal, { abortError: () => new APIUserAbortError }); continue; } - logForDebugging(`Compact streaming failed after ${attempt3} attempts. hasStartedStreaming=${hasStartedStreaming}`, { level: "error" }); + logForDebugging(`Compact streaming failed after ${attempt2} attempts. hasStartedStreaming=${hasStartedStreaming}`, { level: "error" }); logEvent("tengu_compact_failed", { reason: "no_streaming_response", preCompactTokenCount, hasStartedStreaming, retryEnabled, - attempts: attempt3, + attempts: attempt2, promptCacheSharingEnabled }); throw new Error(ERROR_MESSAGE_INCOMPLETE_RESPONSE); @@ -554180,11 +481594,11 @@ async function createPostCompactFileAttachments(readFileState, toolUseContext, m return attachment ? createAttachmentMessage(attachment) : null; })); let usedTokens = 0; - return results.filter((result3) => { - if (result3 === null) { + return results.filter((result2) => { + if (result2 === null) { return false; } - const attachmentTokens = roughTokenCountEstimation(jsonStringify(result3)); + const attachmentTokens = roughTokenCountEstimation(jsonStringify(result2)); if (usedTokens + attachmentTokens <= POST_COMPACT_TOKEN_BUDGET) { usedTokens += attachmentTokens; return true; @@ -554286,9 +481700,9 @@ function collectReadToolFilePaths(messages) { if (block2.type !== "tool_use" || block2.name !== FILE_READ_TOOL_NAME || stubIds.has(block2.id)) { continue; } - const input11 = block2.input; - if (input11 && typeof input11 === "object" && "file_path" in input11 && typeof input11.file_path === "string") { - paths2.add(expandPath(input11.file_path)); + const input = block2.input; + if (input && typeof input === "object" && "file_path" in input && typeof input.file_path === "string") { + paths2.add(expandPath(input.file_path)); } } } @@ -554320,7 +481734,7 @@ function shouldExcludeFromPostCompactRestore(filename, agentId) { var sessionTranscriptModule, POST_COMPACT_MAX_FILES_TO_RESTORE = 5, POST_COMPACT_TOKEN_BUDGET = 50000, POST_COMPACT_MAX_TOKENS_PER_FILE = 5000, POST_COMPACT_MAX_TOKENS_PER_SKILL = 5000, POST_COMPACT_SKILLS_TOKEN_BUDGET = 25000, MAX_COMPACT_STREAMING_RETRIES = 2, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES = "Not enough messages to compact.", MAX_PTL_RETRIES = 3, PTL_RETRY_MARKER = "[earlier conversation truncated for compaction retry]", ERROR_MESSAGE_PROMPT_TOO_LONG = "Conversation too long. Press esc twice to go up a few messages and try again.", ERROR_MESSAGE_USER_ABORT = "API Error: Request was aborted.", ERROR_MESSAGE_INCOMPLETE_RESPONSE = "Compaction interrupted · This may be due to network issues — please try again.", SKILL_TRUNCATION_MARKER = ` [... skill content truncated for compaction; use Read on the skill path if you need the full text]`; -var init_compact3 = __esm(() => { +var init_compact2 = __esm(() => { init_bun_bundle(); init_uniqBy(); init_sdk(); @@ -554339,8 +481753,8 @@ var init_compact3 = __esm(() => { init_forkedAgent(); init_hooks5(); init_log3(); - init_types15(); - init_messages5(); + init_types14(); + init_messages3(); init_path2(); init_plans(); init_sessionActivity(); @@ -554353,7 +481767,7 @@ var init_compact3 = __esm(() => { init_growthbook(); init_analytics(); init_claude(); - init_errors7(); + init_errors6(); init_promptCacheBreakDetection(); init_withRetry(); init_internalLogging(); @@ -554366,9 +481780,9 @@ var init_compact3 = __esm(() => { var exports_attributionHooks = {}; __export(exports_attributionHooks, { default: () => attributionHooks_default, - __stub__: () => __stub__22 + __stub__: () => __stub__28 }); -var attributionHooks_default, __stub__22 = true; +var attributionHooks_default, __stub__28 = true; var init_attributionHooks = __esm(() => { attributionHooks_default = {}; }); @@ -554408,8 +481822,8 @@ var init_postCompactCleanup = __esm(() => { }); // src/services/SessionMemory/prompts.ts -import { readFile as readFile34 } from "fs/promises"; -import { join as join104 } from "path"; +import { readFile as readFile33 } from "fs/promises"; +import { join as join94 } from "path"; function getDefaultUpdatePrompt() { return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content. @@ -554450,9 +481864,9 @@ You ONLY update the actual content that comes AFTER these two preserved lines. T REMEMBER: Use the Edit tool in parallel and stop. Do not continue after the edits. Only include insights from the actual user conversation, never from these note-taking instructions. Do not delete or change section headers or italic _section descriptions_.`; } async function loadSessionMemoryTemplate() { - const templatePath = join104(getClaudeConfigHomeDir(), "session-memory", "config", "template.md"); + const templatePath = join94(getClaudeConfigHomeDir(), "session-memory", "config", "template.md"); try { - return await readFile34(templatePath, { encoding: "utf-8" }); + return await readFile33(templatePath, { encoding: "utf-8" }); } catch (e) { const code = getErrnoCode(e); if (code === "ENOENT") { @@ -554463,9 +481877,9 @@ async function loadSessionMemoryTemplate() { } } async function loadSessionMemoryPrompt() { - const promptPath = join104(getClaudeConfigHomeDir(), "session-memory", "config", "prompt.md"); + const promptPath = join94(getClaudeConfigHomeDir(), "session-memory", "config", "prompt.md"); try { - return await readFile34(promptPath, { encoding: "utf-8" }); + return await readFile33(promptPath, { encoding: "utf-8" }); } catch (e) { const code = getErrnoCode(e); if (code === "ENOENT") { @@ -554522,12 +481936,12 @@ ${oversizedSections.join(` } return parts.join(""); } -function substituteVariables(template3, variables) { - return template3.replace(/\{\{(\w+)\}\}/g, (match, key) => Object.prototype.hasOwnProperty.call(variables, key) ? variables[key] : match); +function substituteVariables(template2, variables) { + return template2.replace(/\{\{(\w+)\}\}/g, (match, key) => Object.prototype.hasOwnProperty.call(variables, key) ? variables[key] : match); } async function isSessionMemoryEmpty(content) { - const template3 = await loadSessionMemoryTemplate(); - return content.trim() === template3.trim(); + const template2 = await loadSessionMemoryTemplate(); + return content.trim() === template2.trim(); } async function buildSessionMemoryUpdatePrompt(currentNotes, notesPath) { const promptTemplate = await loadSessionMemoryPrompt(); @@ -554551,18 +481965,18 @@ function truncateSessionMemoryForCompact(content) { let wasTruncated = false; for (const line of lines) { if (line.startsWith("# ")) { - const result4 = flushSessionSection(currentSectionHeader, currentSectionLines, maxCharsPerSection); - outputLines.push(...result4.lines); - wasTruncated = wasTruncated || result4.wasTruncated; + const result3 = flushSessionSection(currentSectionHeader, currentSectionLines, maxCharsPerSection); + outputLines.push(...result3.lines); + wasTruncated = wasTruncated || result3.wasTruncated; currentSectionHeader = line; currentSectionLines = []; } else { currentSectionLines.push(line); } } - const result3 = flushSessionSection(currentSectionHeader, currentSectionLines, maxCharsPerSection); - outputLines.push(...result3.lines); - wasTruncated = wasTruncated || result3.wasTruncated; + const result2 = flushSessionSection(currentSectionHeader, currentSectionLines, maxCharsPerSection); + outputLines.push(...result2.lines); + wasTruncated = wasTruncated || result2.wasTruncated; return { truncatedContent: outputLines.join(` `), @@ -554622,7 +482036,7 @@ _If the user asked a specific output such as an answer to a question, a table, o # Worklog _Step by step, what was attempted, done? Very terse summary for each step_ `; -var init_prompts3 = __esm(() => { +var init_prompts2 = __esm(() => { init_tokenEstimation(); init_envUtils(); init_errors(); @@ -554630,10 +482044,10 @@ var init_prompts3 = __esm(() => { }); // src/services/compact/sessionMemoryCompact.ts -function setSessionMemoryCompactConfig(config5) { +function setSessionMemoryCompactConfig(config3) { smCompactConfig = { ...smCompactConfig, - ...config5 + ...config3 }; } function getSessionMemoryCompactConfig() { @@ -554645,12 +482059,12 @@ async function initSessionMemoryCompactConfig() { } configInitialized = true; const remoteConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_sm_compact_config", {}); - const config5 = { + const config3 = { minTokens: remoteConfig.minTokens && remoteConfig.minTokens > 0 ? remoteConfig.minTokens : DEFAULT_SM_COMPACT_CONFIG.minTokens, minTextBlockMessages: remoteConfig.minTextBlockMessages && remoteConfig.minTextBlockMessages > 0 ? remoteConfig.minTextBlockMessages : DEFAULT_SM_COMPACT_CONFIG.minTextBlockMessages, maxTokens: remoteConfig.maxTokens && remoteConfig.maxTokens > 0 ? remoteConfig.maxTokens : DEFAULT_SM_COMPACT_CONFIG.maxTokens }; - setSessionMemoryCompactConfig(config5); + setSessionMemoryCompactConfig(config3); } function hasTextBlocks(message) { if (message.type === "assistant") { @@ -554700,13 +482114,13 @@ function adjustIndexToPreserveAPIInvariants(messages, startIndex) { } let adjustedIndex = startIndex; const allToolResultIds = []; - for (let i4 = startIndex;i4 < messages.length; i4++) { - allToolResultIds.push(...getToolResultIds(messages[i4])); + for (let i3 = startIndex;i3 < messages.length; i3++) { + allToolResultIds.push(...getToolResultIds(messages[i3])); } if (allToolResultIds.length > 0) { const toolUseIdsInKeptRange = new Set; - for (let i4 = adjustedIndex;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = adjustedIndex;i3 < messages.length; i3++) { + const msg = messages[i3]; if (msg.type === "assistant" && Array.isArray(msg.message.content)) { for (const block2 of msg.message.content) { if (block2.type === "tool_use") { @@ -554716,10 +482130,10 @@ function adjustIndexToPreserveAPIInvariants(messages, startIndex) { } } const neededToolUseIds = new Set(allToolResultIds.filter((id) => !toolUseIdsInKeptRange.has(id))); - for (let i4 = adjustedIndex - 1;i4 >= 0 && neededToolUseIds.size > 0; i4--) { - const message = messages[i4]; + for (let i3 = adjustedIndex - 1;i3 >= 0 && neededToolUseIds.size > 0; i3--) { + const message = messages[i3]; if (hasToolUseWithIds(message, neededToolUseIds)) { - adjustedIndex = i4; + adjustedIndex = i3; if (message.type === "assistant" && Array.isArray(message.message.content)) { for (const block2 of message.message.content) { if (block2.type === "tool_use" && neededToolUseIds.has(block2.id)) { @@ -554731,16 +482145,16 @@ function adjustIndexToPreserveAPIInvariants(messages, startIndex) { } } const messageIdsInKeptRange = new Set; - for (let i4 = adjustedIndex;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = adjustedIndex;i3 < messages.length; i3++) { + const msg = messages[i3]; if (msg.type === "assistant" && msg.message.id) { messageIdsInKeptRange.add(msg.message.id); } } - for (let i4 = adjustedIndex - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = adjustedIndex - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message.type === "assistant" && message.message.id && messageIdsInKeptRange.has(message.message.id)) { - adjustedIndex = i4; + adjustedIndex = i3; } } return adjustedIndex; @@ -554749,37 +482163,37 @@ function calculateMessagesToKeepIndex(messages, lastSummarizedIndex) { if (messages.length === 0) { return 0; } - const config5 = getSessionMemoryCompactConfig(); + const config3 = getSessionMemoryCompactConfig(); let startIndex = lastSummarizedIndex >= 0 ? lastSummarizedIndex + 1 : messages.length; let totalTokens = 0; let textBlockMessageCount = 0; - for (let i4 = startIndex;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = startIndex;i3 < messages.length; i3++) { + const msg = messages[i3]; totalTokens += estimateMessageTokens([msg]); if (hasTextBlocks(msg)) { textBlockMessageCount++; } } - if (totalTokens >= config5.maxTokens) { + if (totalTokens >= config3.maxTokens) { return adjustIndexToPreserveAPIInvariants(messages, startIndex); } - if (totalTokens >= config5.minTokens && textBlockMessageCount >= config5.minTextBlockMessages) { + if (totalTokens >= config3.minTokens && textBlockMessageCount >= config3.minTextBlockMessages) { return adjustIndexToPreserveAPIInvariants(messages, startIndex); } const idx = messages.findLastIndex((m) => isCompactBoundaryMessage(m)); - const floor3 = idx === -1 ? 0 : idx + 1; - for (let i4 = startIndex - 1;i4 >= floor3; i4--) { - const msg = messages[i4]; + const floor2 = idx === -1 ? 0 : idx + 1; + for (let i3 = startIndex - 1;i3 >= floor2; i3--) { + const msg = messages[i3]; const msgTokens = estimateMessageTokens([msg]); totalTokens += msgTokens; if (hasTextBlocks(msg)) { textBlockMessageCount++; } - startIndex = i4; - if (totalTokens >= config5.maxTokens) { + startIndex = i3; + if (totalTokens >= config3.maxTokens) { break; } - if (totalTokens >= config5.minTokens && textBlockMessageCount >= config5.minTextBlockMessages) { + if (totalTokens >= config3.minTokens && textBlockMessageCount >= config3.minTextBlockMessages) { break; } } @@ -554890,10 +482304,10 @@ async function trySessionMemoryCompaction(messages, agentId, autoCompactThreshol postCompactTokenCount, truePostCompactTokenCount: postCompactTokenCount }; - } catch (error46) { + } catch (error42) { logEvent("tengu_sm_compact_error", {}); if (process.env.USER_TYPE === "ant") { - logForDebugging(`Session memory compaction error: ${errorMessage(error46)}`); + logForDebugging(`Session memory compaction error: ${errorMessage(error42)}`); } return null; } @@ -554903,7 +482317,7 @@ var init_sessionMemoryCompact = __esm(() => { init_debug(); init_envUtils(); init_errors(); - init_messages5(); + init_messages3(); init_model(); init_filesystem(); init_sessionStart(); @@ -554912,9 +482326,9 @@ var init_sessionMemoryCompact = __esm(() => { init_toolSearch(); init_growthbook(); init_analytics(); - init_prompts3(); + init_prompts2(); init_sessionMemoryUtils(); - init_compact3(); + init_compact2(); init_microCompact(); init_prompt25(); DEFAULT_SM_COMPACT_CONFIG = { @@ -555057,9 +482471,9 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu compactionResult, consecutiveFailures: 0 }; - } catch (error46) { - if (!hasExactErrorMessage(error46, ERROR_MESSAGE_USER_ABORT)) { - logError2(error46); + } catch (error42) { + if (!hasExactErrorMessage(error42, ERROR_MESSAGE_USER_ABORT)) { + logError2(error42); } const prevFailures = tracking?.consecutiveFailures ?? 0; const nextFailures = prevFailures + 1; @@ -555085,7 +482499,7 @@ var init_autoCompact = __esm(() => { init_claude(); init_promptCacheBreakDetection(); init_sessionMemoryUtils(); - init_compact3(); + init_compact2(); init_postCompactCleanup(); init_sessionMemoryCompact(); }); @@ -555093,14 +482507,14 @@ var init_autoCompact = __esm(() => { // src/utils/analyzeContext.ts async function countTokensWithFallback(messages, tools) { try { - const result3 = await countMessagesTokensWithAPI(messages, tools); - if (result3 !== null) { - return result3; + const result2 = await countMessagesTokensWithAPI(messages, tools); + if (result2 !== null) { + return result2; } logForDebugging(`countTokensWithFallback: API returned null, trying haiku fallback (${tools.length} tools)`); - } catch (err3) { - logForDebugging(`countTokensWithFallback: API failed: ${errorMessage(err3)}`); - logError2(err3); + } catch (err2) { + logForDebugging(`countTokensWithFallback: API failed: ${errorMessage(err2)}`); + logError2(err2); } try { const fallbackResult = await countTokensViaHaikuFallback(messages, tools); @@ -555108,9 +482522,9 @@ async function countTokensWithFallback(messages, tools) { logForDebugging(`countTokensWithFallback: haiku fallback also returned null (${tools.length} tools)`); } return fallbackResult; - } catch (err3) { - logForDebugging(`countTokensWithFallback: haiku fallback failed: ${errorMessage(err3)}`); - logError2(err3); + } catch (err2) { + logForDebugging(`countTokensWithFallback: haiku fallback failed: ${errorMessage(err2)}`); + logError2(err2); return null; } } @@ -555121,12 +482535,12 @@ async function countToolDefinitionTokens(tools, getToolPermissionContext, agentI agents: agentInfo?.activeAgents ?? [], model }))); - const result3 = await countTokensWithFallback([], toolSchemas); - if (result3 === null || result3 === 0) { + const result2 = await countTokensWithFallback([], toolSchemas); + if (result2 === null || result2 === 0) { const toolNames = tools.map((t) => t.name).join(", "); - logForDebugging(`countToolDefinitionTokens returned ${result3} for ${tools.length} tools: ${toolNames.slice(0, 100)}${toolNames.length > 100 ? "..." : ""}`); + logForDebugging(`countToolDefinitionTokens returned ${result2} for ${tools.length} tools: ${toolNames.slice(0, 100)}${toolNames.length > 100 ? "..." : ""}`); } - return result3 ?? 0; + return result2 ?? 0; } function extractSectionName(content) { const headingMatch = content.match(/^#+\s+(.+)$/m); @@ -555147,11 +482561,11 @@ async function countSystemTokens(effectiveSystemPrompt) { return { systemPromptTokens: 0, systemPromptSections: [] }; } const systemTokenCounts = await Promise.all(namedEntries.map(({ content }) => countTokensWithFallback([{ role: "user", content }], []))); - const systemPromptSections = namedEntries.map((entry, i4) => ({ + const systemPromptSections = namedEntries.map((entry, i3) => ({ name: entry.name, - tokens: systemTokenCounts[i4] || 0 + tokens: systemTokenCounts[i3] || 0 })); - const systemPromptTokens = systemTokenCounts.reduce((sum3, tokens) => sum3 + (tokens || 0), 0); + const systemPromptTokens = systemTokenCounts.reduce((sum2, tokens) => sum2 + (tokens || 0), 0); return { systemPromptTokens, systemPromptSections }; } async function countMemoryFileTokens() { @@ -555204,9 +482618,9 @@ async function countBuiltInToolTokens(tools, getToolPermissionContext, agentInfo const estimates = toolsForBreakdown.map((t) => roughTokenCountEstimation(jsonStringify(t.inputSchema ?? {}))); const estimateTotal = estimates.reduce((s, e) => s + e, 0) || 1; const distributable = Math.max(0, alwaysLoadedTokens - TOOL_TOKEN_COUNT_OVERHEAD); - systemToolDetails = toolsForBreakdown.map((t, i4) => ({ + systemToolDetails = toolsForBreakdown.map((t, i3) => ({ name: t.name, - tokens: Math.round(estimates[i4] / estimateTotal * distributable) + tokens: Math.round(estimates[i3] / estimateTotal * distributable) })).sort((a2, b) => b.tokens - a2.tokens); } } @@ -555228,8 +482642,8 @@ async function countBuiltInToolTokens(tools, getToolPermissionContext, agentInfo } } const tokensByTool = await Promise.all(deferredBuiltinTools.map((t) => countToolDefinitionTokens([t], getToolPermissionContext, agentInfo, model))); - for (const [i4, tool] of deferredBuiltinTools.entries()) { - const tokens = Math.max(0, (tokensByTool[i4] || 0) - TOOL_TOKEN_COUNT_OVERHEAD); + for (const [i3, tool] of deferredBuiltinTools.entries()) { + const tokens = Math.max(0, (tokensByTool[i3] || 0) - TOOL_TOKEN_COUNT_OVERHEAD); const isLoaded = loadedToolNames.has(tool.name); deferredBuiltinDetails.push({ name: tool.name, @@ -555302,8 +482716,8 @@ async function countSkillTokens(tools, getToolPermissionContext, agentInfo) { skillFrontmatter } }; - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); return { skillTokens: 0, skillInfo: { totalSkills: 0, includedSkills: 0, skillFrontmatter: [] } @@ -555342,11 +482756,11 @@ async function countMcpToolTokens(tools, getToolPermissionContext, agentInfo, mo } } } - for (const [i4, tool] of mcpTools.entries()) { + for (const [i3, tool] of mcpTools.entries()) { mcpToolDetails.push({ name: tool.name, serverName: tool.name.split("__")[1] || "unknown", - tokens: mcpToolTokensByTool[i4], + tokens: mcpToolTokensByTool[i3], isLoaded: loadedMcpToolNames.has(tool.name) || !isDeferredTool2(tool) }); } @@ -555376,8 +482790,8 @@ async function countCustomAgentTokens(agentDefinitions) { content: [agent.agentType, agent.whenToUse].join(" ") } ], []))); - for (const [i4, agent] of customAgents.entries()) { - const tokens = tokenCounts[i4] || 0; + for (const [i3, agent] of customAgents.entries()) { + const tokens = tokenCounts[i3] || 0; agentTokens += tokens || 0; agentDetails.push({ agentType: agent.agentType, @@ -555514,7 +482928,7 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to ]); const skillResult = await countSkillTokens(tools, getToolPermissionContext, agentDefinitions); const skillInfo = skillResult.skillInfo; - const skillFrontmatterTokens = skillInfo.skillFrontmatter.reduce((sum3, skill) => sum3 + skill.tokens, 0); + const skillFrontmatterTokens = skillInfo.skillFrontmatter.reduce((sum2, skill) => sum2 + skill.tokens, 0); const messageTokens = messageBreakdown.totalTokens; const isAutoCompact = isAutoCompactEnabled(); const autoCompactThreshold = isAutoCompact ? getEffectiveContextWindowSize(model) - AUTOCOMPACT_BUFFER_TOKENS : undefined; @@ -555585,7 +482999,7 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to color: "purple_FOR_SUBAGENTS_ONLY" }); } - const actualUsage = cats.reduce((sum3, cat2) => sum3 + (cat2.isDeferred ? 0 : cat2.tokens), 0); + const actualUsage = cats.reduce((sum2, cat2) => sum2 + (cat2.isDeferred ? 0 : cat2.tokens), 0); let reservedTokens = 0; let skipReservedBuffer = false; if (feature("REACTIVE_COMPACT")) { @@ -555639,9 +483053,9 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to const exactSquares = category.tokens / contextWindow * TOTAL_SQUARES; const wholeSquares = Math.floor(exactSquares); const fractionalPart = exactSquares - wholeSquares; - for (let i4 = 0;i4 < category.squares; i4++) { + for (let i3 = 0;i3 < category.squares; i3++) { let squareFullness = 1; - if (i4 === wholeSquares && fractionalPart > 0) { + if (i3 === wholeSquares && fractionalPart > 0) { squareFullness = fractionalPart; } squares.push({ @@ -555688,8 +483102,8 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to } } const gridRows = []; - for (let i4 = 0;i4 < GRID_HEIGHT; i4++) { - gridRows.push(gridSquares.slice(i4 * GRID_WIDTH, (i4 + 1) * GRID_WIDTH)); + for (let i3 = 0;i3 < GRID_HEIGHT; i3++) { + gridRows.push(gridSquares.slice(i3 * GRID_WIDTH, (i3 + 1) * GRID_WIDTH)); } const toolsMap = new Map; for (const [name, tokens] of messageBreakdown.toolCallsByType.entries()) { @@ -555749,7 +483163,7 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to var RESERVED_CATEGORY_NAME = "Autocompact buffer", MANUAL_COMPACT_BUFFER_NAME = "Compact buffer", TOOL_TOKEN_COUNT_OVERHEAD = 500; var init_analyzeContext = __esm(() => { init_bun_bundle(); - init_prompts5(); + init_prompts4(); init_microCompact(); init_state(); init_commands2(); @@ -555768,7 +483182,7 @@ var init_analyzeContext = __esm(() => { init_envUtils(); init_errors(); init_log3(); - init_messages5(); + init_messages3(); init_model(); init_slowOperations(); init_systemPrompt(); @@ -555780,9 +483194,9 @@ function zodToJsonSchema5(schema) { const hit = cache3.get(schema); if (hit) return hit; - const result3 = toJSONSchema(schema); - cache3.set(schema, result3); - return result3; + const result2 = toJSONSchema(schema); + cache3.set(schema, result2); + return result2; } var cache3; var init_zodToJsonSchema3 = __esm(() => { @@ -555916,7 +483330,7 @@ async function calculateDeferredToolDescriptionChars(tools, getToolPermissionCon const inputSchema39 = tool.inputJSONSchema ? jsonStringify(tool.inputJSONSchema) : tool.inputSchema ? jsonStringify(zodToJsonSchema5(tool.inputSchema)) : ""; return tool.name.length + description.length + inputSchema39.length; })); - return sizes.reduce((total, size3) => total + size3, 0); + return sizes.reduce((total, size2) => total + size2, 0); } async function isToolSearchEnabled(model, tools, getToolPermissionContext, agents, source) { const mcpToolCount = count2(tools, (t) => t.isMcp); @@ -556105,9 +483519,9 @@ var init_toolSearch = __esm(() => { }); // src/services/vcr.ts -import { createHash as createHash20, randomUUID as randomUUID23 } from "crypto"; -import { mkdir as mkdir29, readFile as readFile35, writeFile as writeFile31 } from "fs/promises"; -import { dirname as dirname40, join as join105 } from "path"; +import { createHash as createHash19, randomUUID as randomUUID23 } from "crypto"; +import { mkdir as mkdir29, readFile as readFile34, writeFile as writeFile29 } from "fs/promises"; +import { dirname as dirname37, join as join95 } from "path"; function shouldUseVCR() { if (false) {} if (process.env.USER_TYPE === "ant" && isEnvTruthy(process.env.FORCE_VCR)) { @@ -556115,14 +483529,14 @@ function shouldUseVCR() { } return false; } -async function withFixture(input11, fixtureName, f) { +async function withFixture(input, fixtureName, f) { if (!shouldUseVCR()) { return await f(); } - const hash2 = createHash20("sha1").update(jsonStringify(input11)).digest("hex").slice(0, 12); - const filename = join105(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${fixtureName}-${hash2}.json`); + const hash2 = createHash19("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12); + const filename = join95(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${fixtureName}-${hash2}.json`); try { - const cached6 = jsonParse(await readFile35(filename, { encoding: "utf8" })); + const cached6 = jsonParse(await readFile34(filename, { encoding: "utf8" })); return cached6; } catch (e) { const code = getErrnoCode(e); @@ -556133,12 +483547,12 @@ async function withFixture(input11, fixtureName, f) { if ((env3.isCI || process.env.CI) && !isEnvTruthy(process.env.VCR_RECORD)) { throw new Error(`Fixture missing: ${filename}. Re-run tests with VCR_RECORD=1, then commit the result.`); } - const result3 = await f(); - await mkdir29(dirname40(filename), { recursive: true }); - await writeFile31(filename, jsonStringify(result3, null, 2), { + const result2 = await f(); + await mkdir29(dirname37(filename), { recursive: true }); + await writeFile29(filename, jsonStringify(result2, null, 2), { encoding: "utf8" }); - return result3; + return result2; } async function withVCR(messages, f) { if (!shouldUseVCR()) { @@ -556154,9 +483568,9 @@ async function withVCR(messages, f) { return true; })); const dehydratedInput = mapMessages(messagesForAPI.map((_) => _.message.content), dehydrateValue); - const filename = join105(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_) => createHash20("sha1").update(jsonStringify(_)).digest("hex").slice(0, 6)).join("-")}.json`); + const filename = join95(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_) => createHash19("sha1").update(jsonStringify(_)).digest("hex").slice(0, 6)).join("-")}.json`); try { - const cached6 = jsonParse(await readFile35(filename, { encoding: "utf8" })); + const cached6 = jsonParse(await readFile34(filename, { encoding: "utf8" })); cached6.output.forEach(addCachedCostToTotalSessionCost); return cached6.output.map((message, index) => mapMessage(message, hydrateValue, index, randomUUID23())); } catch (e) { @@ -556173,8 +483587,8 @@ ${jsonStringify(dehydratedInput, null, 2)}`); if (env3.isCI && !isEnvTruthy(process.env.VCR_RECORD)) { return results; } - await mkdir29(dirname40(filename), { recursive: true }); - await writeFile31(filename, jsonStringify({ + await mkdir29(dirname37(filename), { recursive: true }); + await writeFile29(filename, jsonStringify({ input: dehydratedInput, output: results.map((message, index) => mapMessage(message, dehydrateValue, index)) }, null, 2), { encoding: "utf8" }); @@ -556242,9 +483656,9 @@ function mapValuesDeep(obj, f) { return f(val, key, obj); }); } -function mapAssistantMessage(message, f, index, uuid8) { +function mapAssistantMessage(message, f, index, uuid5) { return { - uuid: uuid8 ?? `UUID-${index}`, + uuid: uuid5 ?? `UUID-${index}`, requestId: "REQUEST_ID", timestamp: message.timestamp, message: { @@ -556270,9 +483684,9 @@ function mapAssistantMessage(message, f, index, uuid8) { type: "assistant" }; } -function mapMessage(message, f, index, uuid8) { +function mapMessage(message, f, index, uuid5) { if (message.type === "assistant") { - return mapAssistantMessage(message, f, index, uuid8); + return mapAssistantMessage(message, f, index, uuid5); } else { return message; } @@ -556323,10 +483737,10 @@ async function* withStreamingVCR(messages, f) { async function withTokenCountVCR(messages, tools, f) { const cwdSlug = getCwd().replace(/[^a-zA-Z0-9]/g, "-"); const dehydrated = dehydrateValue(jsonStringify({ messages, tools })).replaceAll(cwdSlug, "[CWD_SLUG]").replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, "[UUID]").replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z?/g, "[TIMESTAMP]"); - const result3 = await withFixture(dehydrated, "token-count", async () => ({ + const result2 = await withFixture(dehydrated, "token-count", async () => ({ tokenCount: await f() })); - return result3.tokenCount; + return result2.tokenCount; } var init_vcr = __esm(() => { init_isPlainObject(); @@ -556337,7 +483751,7 @@ var init_vcr = __esm(() => { init_env(); init_envUtils(); init_errors(); - init_messages5(); + init_messages3(); init_slowOperations(); }); @@ -556442,8 +483856,8 @@ async function countMessagesTokensWithAPI(messages, tools) { return null; } return response.input_tokens; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return null; } }); @@ -556566,7 +483980,7 @@ async function countTokensWithBedrock({ containsThinking }) { try { - const client5 = await createBedrockRuntimeClient(); + const client2 = await createBedrockRuntimeClient(); const modelId = isFoundationModel(model) ? model : await getInferenceProfileBackingModel(model); if (!modelId) { return null; @@ -556584,8 +483998,8 @@ async function countTokensWithBedrock({ } } }; - const { CountTokensCommand } = await Promise.resolve().then(() => __toESM(require_dist_cjs122(), 1)); - const input11 = { + const { CountTokensCommand } = await Promise.resolve().then(() => (init_client_bedrock_runtime(), exports_client_bedrock_runtime)); + const input = { modelId, input: { invokeModel: { @@ -556593,11 +484007,11 @@ async function countTokensWithBedrock({ } } }; - const response = await client5.send(new CountTokensCommand(input11)); + const response = await client2.send(new CountTokensCommand(input)); const tokenCount = response.inputTokens ?? null; return tokenCount; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return null; } } @@ -556608,24 +484022,24 @@ var init_tokenEstimation = __esm(() => { init_betas2(); init_envUtils(); init_log3(); - init_messages5(); + init_messages3(); init_bedrock(); init_model(); init_slowOperations(); init_toolSearch(); init_claude(); - init_client7(); + init_client3(); init_vcr(); }); // src/utils/pdf.ts import { randomUUID as randomUUID24 } from "crypto"; -import { mkdir as mkdir30, readdir as readdir20, readFile as readFile36 } from "fs/promises"; -import { join as join106 } from "path"; +import { mkdir as mkdir30, readdir as readdir20, readFile as readFile35 } from "fs/promises"; +import { join as join96 } from "path"; async function readPDF(filePath) { try { - const fs11 = getFsImplementation(); - const stats = await fs11.stat(filePath); + const fs5 = getFsImplementation(); + const stats = await fs5.stat(filePath); const originalSize = stats.size; if (originalSize === 0) { return { @@ -556642,7 +484056,7 @@ async function readPDF(filePath) { } }; } - const fileBuffer = await readFile36(filePath); + const fileBuffer = await readFile35(filePath); const header = fileBuffer.subarray(0, 5).toString("ascii"); if (!header.startsWith("%PDF-")) { return { @@ -556653,14 +484067,14 @@ async function readPDF(filePath) { } }; } - const base645 = fileBuffer.toString("base64"); + const base644 = fileBuffer.toString("base64"); return { success: true, data: { type: "pdf", file: { filePath, - base64: base645, + base64: base644, originalSize } } @@ -556702,8 +484116,8 @@ async function isPdftoppmAvailable() { } async function extractPDFPages(filePath, options2) { try { - const fs11 = getFsImplementation(); - const stats = await fs11.stat(filePath); + const fs5 = getFsImplementation(); + const stats = await fs5.stat(filePath); const originalSize = stats.size; if (originalSize === 0) { return { @@ -556730,10 +484144,10 @@ async function extractPDFPages(filePath, options2) { } }; } - const uuid8 = randomUUID24(); - const outputDir = join106(getToolResultsDir(), `pdf-${uuid8}`); + const uuid5 = randomUUID24(); + const outputDir = join96(getToolResultsDir(), `pdf-${uuid5}`); await mkdir30(outputDir, { recursive: true }); - const prefix = join106(outputDir, "page"); + const prefix = join96(outputDir, "page"); const args = ["-jpeg", "-r", "100"]; if (options2?.firstPage) { args.push("-f", String(options2.firstPage)); @@ -557025,11 +484439,11 @@ function renderToolResultMessage24(output) { } } } -function renderToolUseErrorMessage11(result3, { +function renderToolUseErrorMessage11(result2, { verbose }) { - if (!verbose && typeof result3 === "string") { - if (result3.includes(FILE_NOT_FOUND_CWD_NOTE)) { + if (!verbose && typeof result2 === "string") { + if (result2.includes(FILE_NOT_FOUND_CWD_NOTE)) { return /* @__PURE__ */ jsx_dev_runtime151.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime151.jsxDEV(ThemedText, { color: "error", @@ -557037,7 +484451,7 @@ function renderToolUseErrorMessage11(result3, { }, undefined, false, undefined, this) }, undefined, false, undefined, this); } - if (extractTag(result3, "tool_use_error")) { + if (extractTag(result2, "tool_use_error")) { return /* @__PURE__ */ jsx_dev_runtime151.jsxDEV(MessageResponse, { children: /* @__PURE__ */ jsx_dev_runtime151.jsxDEV(ThemedText, { color: "error", @@ -557047,32 +484461,32 @@ function renderToolUseErrorMessage11(result3, { } } return /* @__PURE__ */ jsx_dev_runtime151.jsxDEV(FallbackToolUseErrorMessage, { - result: result3, + result: result2, verbose }, undefined, false, undefined, this); } -function userFacingName7(input11) { - if (input11?.file_path?.startsWith(getPlansDirectory())) { +function userFacingName7(input) { + if (input?.file_path?.startsWith(getPlansDirectory())) { return "Reading Plan"; } - if (input11?.file_path && getAgentOutputTaskId(input11.file_path)) { + if (input?.file_path && getAgentOutputTaskId(input.file_path)) { return "Read agent output"; } return "Read"; } -function getToolUseSummary8(input11) { - if (!input11?.file_path) { +function getToolUseSummary8(input) { + if (!input?.file_path) { return null; } - const agentTaskId = getAgentOutputTaskId(input11.file_path); + const agentTaskId = getAgentOutputTaskId(input.file_path); if (agentTaskId) { return agentTaskId; } - return getDisplayPath(input11.file_path); + return getDisplayPath(input.file_path); } var jsx_dev_runtime151; var init_UI25 = __esm(() => { - init_messages5(); + init_messages3(); init_FallbackToolUseErrorMessage(); init_FilePathLink(); init_MessageResponse(); @@ -557086,7 +484500,7 @@ var init_UI25 = __esm(() => { // src/tools/FileReadTool/FileReadTool.ts import { readdir as readdir21, readFile as readFileAsync } from "fs/promises"; -import * as path21 from "path"; +import * as path16 from "path"; import { posix as posix7, win32 as win323 } from "path"; function isBlockedDevicePath(filePath) { if (BLOCKED_DEVICE_PATHS.has(filePath)) @@ -557096,7 +484510,7 @@ function isBlockedDevicePath(filePath) { return false; } function getAlternateScreenshotPath(filePath) { - const filename = path21.basename(filePath); + const filename = path16.basename(filePath); const amPmPattern = /^(.+)([ \u202F])(AM|PM)(\.png)$/; const match = filename.match(amPmPattern); if (!match) @@ -557108,9 +484522,9 @@ function getAlternateScreenshotPath(filePath) { function registerFileReadListener(listener2) { fileReadListeners.push(listener2); return () => { - const i4 = fileReadListeners.indexOf(listener2); - if (i4 >= 0) - fileReadListeners.splice(i4, 1); + const i3 = fileReadListeners.indexOf(listener2); + if (i3 >= 0) + fileReadListeners.splice(i3, 1); }; } function detectSessionFileType2(filePath) { @@ -557239,7 +484653,7 @@ async function callInner(file_path, fullFilePath, resolvedFilePath, ext, offset, const entries = await readdir21(extractResult.data.file.outputDir); const imageFiles = entries.filter((f) => f.endsWith(".jpg")).sort(); const imageBlocks = await Promise.all(imageFiles.map(async (f) => { - const imgPath = path21.join(extractResult.data.file.outputDir, f); + const imgPath = path16.join(extractResult.data.file.outputDir, f); const imgBuffer = await readFileAsync(imgPath); const resized = await maybeResizeAndDownsampleImageBuffer(imgBuffer, imgBuffer.length, "jpeg"); return { @@ -557264,8 +484678,8 @@ async function callInner(file_path, fullFilePath, resolvedFilePath, ext, offset, if (pageCount !== null && pageCount > PDF_AT_MENTION_INLINE_THRESHOLD) { throw new Error(`This PDF has ${pageCount} pages, which is too many to read at once. ` + `Use the pages parameter to read specific page ranges (e.g., pages: "1-5"). ` + `Maximum ${PDF_MAX_PAGES_PER_READ} pages per request.`); } - const fs11 = getFsImplementation(); - const stats = await fs11.stat(resolvedFilePath); + const fs5 = getFsImplementation(); + const stats = await fs5.stat(resolvedFilePath); const shouldExtractPages = !isPDFSupported() || stats.size > PDF_EXTRACT_SIZE_THRESHOLD; if (shouldExtractPages) { const extractResult = await extractPDFPages(resolvedFilePath); @@ -557374,17 +484788,17 @@ async function readImageWithTokenBudget(filePath, maxTokens = getDefaultFileRead } const detectedMediaType = detectImageFormatFromBuffer(imageBuffer); const detectedFormat = detectedMediaType.split("/")[1] || "png"; - let result3; + let result2; try { const resized = await maybeResizeAndDownsampleImageBuffer(imageBuffer, originalSize, detectedFormat); - result3 = createImageResponse(resized.buffer, resized.mediaType, originalSize, resized.dimensions); + result2 = createImageResponse(resized.buffer, resized.mediaType, originalSize, resized.dimensions); } catch (e) { if (e instanceof ImageResizeError) throw e; logError2(e); - result3 = createImageResponse(imageBuffer, detectedFormat, originalSize); + result2 = createImageResponse(imageBuffer, detectedFormat, originalSize); } - const estimatedTokens = Math.ceil(result3.file.base64.length * 0.125); + const estimatedTokens = Math.ceil(result2.file.base64.length * 0.125); if (estimatedTokens > maxTokens) { try { const compressed = await compressImageBufferWithTokenLimit(imageBuffer, maxTokens, detectedMediaType); @@ -557406,13 +484820,13 @@ async function readImageWithTokenBudget(filePath, maxTokens = getDefaultFileRead withoutEnlargement: true }).jpeg({ quality: 20 }).toBuffer(); return createImageResponse(fallbackBuffer, "jpeg", originalSize); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return createImageResponse(imageBuffer, detectedFormat, originalSize); } } } - return result3; + return result2; } var BLOCKED_DEVICE_PATHS, THIN_SPACE, fileReadListeners, MaxFileReadTokenExceededError, IMAGE_EXTENSIONS, inputSchema39, outputSchema33, FileReadTool, CYBER_RISK_MITIGATION_REMINDER = ` @@ -557440,7 +484854,7 @@ var init_FileReadTool = __esm(() => { init_imageResizer(); init_log3(); init_memoryFileDetection(); - init_messages5(); + init_messages3(); init_model(); init_notebook(); init_path2(); @@ -557573,8 +484987,8 @@ var init_FileReadTool = __esm(() => { }, userFacingName: userFacingName7, getToolUseSummary: getToolUseSummary8, - getActivityDescription(input11) { - const summary = getToolUseSummary8(input11); + getActivityDescription(input) { + const summary = getToolUseSummary8(input); return summary ? `Reading ${summary}` : "Reading file"; }, isConcurrencySafe() { @@ -557583,8 +484997,8 @@ var init_FileReadTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.file_path; + toAutoClassifierInput(input) { + return input.file_path; }, isSearchOrReadCommand() { return { isSearch: false, isRead: true }; @@ -557592,17 +485006,17 @@ var init_FileReadTool = __esm(() => { getPath({ file_path }) { return file_path || getCwd(); }, - backfillObservableInput(input11) { - if (typeof input11.file_path === "string") { - input11.file_path = expandPath(input11.file_path); + backfillObservableInput(input) { + if (typeof input.file_path === "string") { + input.file_path = expandPath(input.file_path); } }, async preparePermissionMatcher({ file_path }) { return (pattern) => matchWildcardPattern(pattern, file_path); }, - async checkPermissions(input11, context) { + async checkPermissions(input, context) { const appState = context.getAppState(); - return checkReadPermissionForTool(FileReadTool, input11, appState.toolPermissionContext); + return checkReadPermissionForTool(FileReadTool, input, appState.toolPermissionContext); }, renderToolUseMessage: renderToolUseMessage26, renderToolUseTag: renderToolUseTag2, @@ -557644,7 +485058,7 @@ var init_FileReadTool = __esm(() => { if (isUncPath) { return { result: true }; } - const ext = path21.extname(fullFilePath).toLowerCase(); + const ext = path16.extname(fullFilePath).toLowerCase(); if (hasBinaryExtension(fullFilePath) && !isPDFExtension(ext) && !IMAGE_EXTENSIONS.has(ext.slice(1))) { return { result: false, @@ -557663,16 +485077,16 @@ var init_FileReadTool = __esm(() => { }, async call({ file_path, offset = 1, limit = undefined, pages }, context, _canUseTool, parentMessage) { const { readFileState, fileReadingLimits } = context; - const defaults4 = getDefaultFileReadingLimits(); - const maxSizeBytes = fileReadingLimits?.maxSizeBytes ?? defaults4.maxSizeBytes; - const maxTokens = fileReadingLimits?.maxTokens ?? defaults4.maxTokens; + const defaults3 = getDefaultFileReadingLimits(); + const maxSizeBytes = fileReadingLimits?.maxSizeBytes ?? defaults3.maxSizeBytes; + const maxTokens = fileReadingLimits?.maxTokens ?? defaults3.maxTokens; if (fileReadingLimits !== undefined) { logEvent("tengu_file_read_limits_override", { hasMaxTokens: fileReadingLimits.maxTokens !== undefined, hasMaxSizeBytes: fileReadingLimits.maxSizeBytes !== undefined }); } - const ext = path21.extname(file_path).toLowerCase().slice(1); + const ext = path16.extname(file_path).toLowerCase().slice(1); const fullFilePath = expandPath(file_path); const dedupKillswitch = getFeatureValue_CACHED_MAY_BE_STALE("tengu_read_dedup_killswitch", false); const existingState = dedupKillswitch ? undefined : readFileState.get(fullFilePath); @@ -557709,8 +485123,8 @@ var init_FileReadTool = __esm(() => { } try { return await callInner(file_path, fullFilePath, fullFilePath, ext, offset, limit, pages, maxSizeBytes, maxTokens, readFileState, context, parentMessage?.message.id); - } catch (error46) { - const code = getErrnoCode(error46); + } catch (error42) { + const code = getErrnoCode(error42); if (code === "ENOENT") { const altPath = getAlternateScreenshotPath(fullFilePath); if (altPath) { @@ -557732,7 +485146,7 @@ var init_FileReadTool = __esm(() => { } throw new Error(message); } - throw error46; + throw error42; } }, mapToolResultToToolResultBlockParam(data, toolUseID) { @@ -557940,11 +485354,11 @@ For example, to get tab context: 2. Then: Call mcp__claude-in-chrome__tabs_context_mcp`, CLAUDE_IN_CHROME_SKILL_HINT = `**Browser Automation**: Chrome browser tools are available via the "claude-in-chrome" skill. CRITICAL: Before using any mcp__claude-in-chrome__* tools, invoke the skill by calling the Skill tool with skill: "claude-in-chrome". The skill provides browser automation instructions and enables the tools.`, CLAUDE_IN_CHROME_SKILL_HINT_WITH_WEBBROWSER = `**Browser Automation**: Use WebBrowser for development (dev servers, JS eval, console, screenshots). Use claude-in-chrome for the user's real Chrome when you need logged-in sessions, OAuth, or computer-use — invoke Skill(skill: "claude-in-chrome") before any mcp__claude-in-chrome__* tool.`; // src/utils/hooks/hookEvents.ts -function registerHookEventHandler(handler14) { - eventHandler = handler14; - if (handler14 && pendingEvents.length > 0) { +function registerHookEventHandler(handler18) { + eventHandler = handler18; + if (handler18 && pendingEvents.length > 0) { for (const event of pendingEvents.splice(0)) { - handler14(event); + handler18(event); } } } @@ -558194,8 +485608,8 @@ async function finalizePendingAsyncHooks() { const hooks = Array.from(pendingHooks.values()); await Promise.all(hooks.map(async (hook) => { if (hook.shellCommand?.status === "completed") { - const result3 = await hook.shellCommand.result; - await finalizeHook(hook, result3.code, result3.code === 0 ? "success" : "error"); + const result2 = await hook.shellCommand.result; + await finalizeHook(hook, result2.code, result2.code === 0 ? "success" : "error"); } else { if (hook.shellCommand && hook.shellCommand.status !== "killed") { hook.shellCommand.kill(); @@ -558241,7 +485655,7 @@ async function selectRelevantMemories(query2, memories, signal, recentTools) { Recently used tools: ${recentTools.join(", ")}` : ""; try { - const result3 = await sideQuery({ + const result2 = await sideQuery({ model: getDefaultSonnetModel(), system: SELECT_MEMORIES_SYSTEM_PROMPT, skipSystemPromptPrefix: true, @@ -558269,7 +485683,7 @@ ${manifest}${toolsSection}` signal, querySource: "memdir_relevance" }); - const textBlock = result3.content.find((block2) => block2.type === "text"); + const textBlock = result2.content.find((block2) => block2.type === "text"); if (!textBlock || textBlock.type !== "text") { return []; } @@ -558301,10 +485715,10 @@ var init_findRelevantMemories = __esm(() => { }); // src/utils/attachments.ts -import { readdir as readdir22, stat as stat35 } from "fs/promises"; -import { dirname as dirname41, parse as parse15, relative as relative22, resolve as resolve36 } from "path"; +import { readdir as readdir22, stat as stat34 } from "fs/promises"; +import { dirname as dirname38, parse as parse15, relative as relative20, resolve as resolve30 } from "path"; import { randomUUID as randomUUID25 } from "crypto"; -async function getAttachments(input11, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2) { +async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2) { if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) { return getQueuedCommandAttachments(queuedCommands); } @@ -558312,19 +485726,19 @@ async function getAttachments(input11, toolUseContext, ideSelection, queuedComma const timeoutId = setTimeout((ac) => ac.abort(), 1000, abortController); const context = { ...toolUseContext, abortController }; const isMainThread = !toolUseContext.agentId; - const userInputAttachments = input11 ? [ - maybe("at_mentioned_files", () => processAtMentionedFiles(input11, context)), - maybe("mcp_resources", () => processMcpResourceAttachments(input11, context)), - maybe("agent_mentions", () => Promise.resolve(processAgentMentions(input11, toolUseContext.options.agentDefinitions.activeAgents))), + const userInputAttachments = input ? [ + maybe("at_mentioned_files", () => processAtMentionedFiles(input, context)), + maybe("mcp_resources", () => processMcpResourceAttachments(input, context)), + maybe("agent_mentions", () => Promise.resolve(processAgentMentions(input, toolUseContext.options.agentDefinitions.activeAgents))), ...feature("EXPERIMENTAL_SKILL_SEARCH") && skillSearchModules && !options2?.skipSkillDiscovery ? [ - maybe("skill_discovery", () => skillSearchModules.prefetch.getTurnZeroSkillDiscovery(input11, messages ?? [], context)) + maybe("skill_discovery", () => skillSearchModules.prefetch.getTurnZeroSkillDiscovery(input, messages ?? [], context)) ] : [] ] : []; const userAttachmentResults = await Promise.all(userInputAttachments); const allThreadAttachments = [ maybe("queued_commands", () => getQueuedCommandAttachments(queuedCommands)), maybe("date_change", () => Promise.resolve(getDateChangeAttachments(messages))), - maybe("ultrathink_effort", () => Promise.resolve(getUltrathinkEffortAttachment(input11))), + maybe("ultrathink_effort", () => Promise.resolve(getUltrathinkEffortAttachment(input))), maybe("deferred_tools_delta", () => Promise.resolve(getDeferredToolsDeltaAttachment(toolUseContext.options.tools, toolUseContext.options.mainLoopModel, messages, { callSite: isMainThread ? "attachments_main" : "attachments_subagent", querySource @@ -558387,20 +485801,20 @@ async function getAttachments(input11, toolUseContext, ideSelection, queuedComma async function maybe(label, f) { const startTime = Date.now(); try { - const result3 = await f(); + const result2 = await f(); const duration5 = Date.now() - startTime; if (Math.random() < 0.05) { - const attachmentSizeBytes = result3.filter((a2) => a2 !== undefined && a2 !== null).reduce((total, attachment) => { + const attachmentSizeBytes = result2.filter((a2) => a2 !== undefined && a2 !== null).reduce((total, attachment) => { return total + jsonStringify(attachment).length; }, 0); logEvent("tengu_attachment_compute_duration", { label, duration_ms: duration5, attachment_size_bytes: attachmentSizeBytes, - attachment_count: result3.length + attachment_count: result2.length }); } - return result3; + return result2; } catch (e) { const duration5 = Date.now() - startTime; if (Math.random() < 0.05) { @@ -558476,8 +485890,8 @@ async function buildImageContentBlocks(pastedContents) { function getPlanModeAttachmentTurnCount(messages) { let turnsSinceLastAttachment = 0; let foundPlanModeAttachment = false; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message?.type === "user" && !message.isMeta && !hasToolResultContent(message.message.content)) { turnsSinceLastAttachment++; } else if (message?.type === "attachment" && (message.attachment.type === "plan_mode" || message.attachment.type === "plan_mode_reentry")) { @@ -558489,8 +485903,8 @@ function getPlanModeAttachmentTurnCount(messages) { } function countPlanModeAttachmentsSinceLastExit(messages) { let count4 = 0; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message?.type === "attachment") { if (message.attachment.type === "plan_mode_exit") { break; @@ -558549,8 +485963,8 @@ async function getPlanModeExitAttachment(toolUseContext) { function getAutoModeAttachmentTurnCount(messages) { let turnsSinceLastAttachment = 0; let foundAutoModeAttachment = false; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message?.type === "user" && !message.isMeta && !hasToolResultContent(message.message.content)) { turnsSinceLastAttachment++; } else if (message?.type === "attachment" && message.attachment.type === "auto_mode") { @@ -558564,8 +485978,8 @@ function getAutoModeAttachmentTurnCount(messages) { } function countAutoModeAttachmentsSinceLastExit(messages) { let count4 = 0; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message?.type === "attachment") { if (message.attachment.type === "auto_mode_exit") { break; @@ -558625,8 +486039,8 @@ function getDateChangeAttachments(messages) { } return [{ type: "date_change", newDate: currentDate }]; } -function getUltrathinkEffortAttachment(input11) { - if (!isUltrathinkEnabled() || !input11 || !hasUltrathinkKeyword(input11)) { +function getUltrathinkEffortAttachment(input) { + if (!isUltrathinkEnabled() || !input || !hasUltrathinkKeyword(input)) { return []; } logEvent("tengu_ultrathink", {}); @@ -558749,26 +486163,26 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) { lineEnd: ideSelection.lineStart + ideSelection.lineCount - 1, filename: ideSelection.filePath, content: ideSelection.text, - displayPath: relative22(getCwd(), ideSelection.filePath) + displayPath: relative20(getCwd(), ideSelection.filePath) } ]; } function getDirectoriesToProcess(targetPath, originalCwd) { - const targetDir = dirname41(resolve36(targetPath)); + const targetDir = dirname38(resolve30(targetPath)); const nestedDirs = []; let currentDir = targetDir; while (currentDir !== originalCwd && currentDir !== parse15(currentDir).root) { if (currentDir.startsWith(originalCwd)) { nestedDirs.push(currentDir); } - currentDir = dirname41(currentDir); + currentDir = dirname38(currentDir); } nestedDirs.reverse(); const cwdLevelDirs = []; currentDir = originalCwd; while (currentDir !== parse15(currentDir).root) { cwdLevelDirs.push(currentDir); - currentDir = dirname41(currentDir); + currentDir = dirname38(currentDir); } cwdLevelDirs.reverse(); return { nestedDirs, cwdLevelDirs }; @@ -558788,7 +486202,7 @@ function memoryFilesToAttachments(memoryFiles, toolUseContext, triggerFilePath) type: "nested_memory", path: memoryFile.path, content: memoryFile, - displayPath: relative22(getCwd(), memoryFile.path) + displayPath: relative20(getCwd(), memoryFile.path) }); toolUseContext.loadedNestedMemoryPaths?.add(memoryFile.path); toolUseContext.readFileState.set(memoryFile.path, { @@ -558830,8 +486244,8 @@ async function getNestedMemoryAttachmentsForFile(filePath, toolUseContext, appSt const conditionalRules = (await getConditionalRulesForCwdLevelDirectory(dir, filePath, processedPaths)).filter((f) => !skipProjectLevel || f.type !== "Project" && f.type !== "Local"); attachments.push(...memoryFilesToAttachments(conditionalRules, toolUseContext, filePath)); } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } return attachments; } @@ -558852,12 +486266,12 @@ async function getOpenedFileFromIDE(ideSelection, toolUseContext) { } ]; } -async function processAtMentionedFiles(input11, toolUseContext) { - const files2 = extractAtMentionedFiles(input11); - if (files2.length === 0) +async function processAtMentionedFiles(input, toolUseContext) { + const files = extractAtMentionedFiles(input); + if (files.length === 0) return []; const appState = toolUseContext.getAppState(); - const results = await Promise.all(files2.map(async (file2) => { + const results = await Promise.all(files.map(async (file2) => { try { const { filename, lineStart, lineEnd } = parseAtMentionedFileLines(file2); const absoluteFilename = expandPath(filename); @@ -558865,7 +486279,7 @@ async function processAtMentionedFiles(input11, toolUseContext) { return null; } try { - const stats = await stat35(absoluteFilename); + const stats = await stat34(absoluteFilename); if (stats.isDirectory()) { try { const entries = await readdir22(absoluteFilename, { @@ -558884,7 +486298,7 @@ async function processAtMentionedFiles(input11, toolUseContext) { type: "directory", path: absoluteFilename, content: stdout, - displayPath: relative22(getCwd(), absoluteFilename) + displayPath: relative20(getCwd(), absoluteFilename) }; } catch { return null; @@ -558901,8 +486315,8 @@ async function processAtMentionedFiles(input11, toolUseContext) { })); return results.filter(Boolean); } -function processAgentMentions(input11, agents) { - const agentMentions = extractAgentMentions(input11); +function processAgentMentions(input, agents) { + const agentMentions = extractAgentMentions(input); if (agentMentions.length === 0) return []; const results = agentMentions.map((mention) => { @@ -558918,10 +486332,10 @@ function processAgentMentions(input11, agents) { agentType: agentDef.agentType }; }); - return results.filter((result3) => result3 !== null); + return results.filter((result2) => result2 !== null); } -async function processMcpResourceAttachments(input11, toolUseContext) { - const resourceMentions = extractMcpResourceMentions(input11); +async function processMcpResourceAttachments(input, toolUseContext) { + const resourceMentions = extractMcpResourceMentions(input); if (resourceMentions.length === 0) return []; const mcpClients = toolUseContext.options.mcpClients || []; @@ -558933,8 +486347,8 @@ async function processMcpResourceAttachments(input11, toolUseContext) { logEvent("tengu_at_mention_mcp_resource_error", {}); return null; } - const client5 = mcpClients.find((c6) => c6.name === serverName); - if (!client5 || client5.type !== "connected") { + const client2 = mcpClients.find((c6) => c6.name === serverName); + if (!client2 || client2.type !== "connected") { logEvent("tengu_at_mention_mcp_resource_error", {}); return null; } @@ -558945,7 +486359,7 @@ async function processMcpResourceAttachments(input11, toolUseContext) { return null; } try { - const result3 = await client5.client.readResource({ + const result2 = await client2.client.readResource({ uri }); logEvent("tengu_at_mention_mcp_resource_success", {}); @@ -558955,11 +486369,11 @@ async function processMcpResourceAttachments(input11, toolUseContext) { uri, name: resourceInfo.name || uri, description: resourceInfo.description, - content: result3 + content: result2 }; - } catch (error46) { + } catch (error42) { logEvent("tengu_at_mention_mcp_resource_error", {}); - logError2(error46); + logError2(error42); return null; } } catch { @@ -558967,7 +486381,7 @@ async function processMcpResourceAttachments(input11, toolUseContext) { return null; } })); - return results.filter((result3) => result3 !== null); + return results.filter((result2) => result2 !== null); } async function getChangedFiles2(toolUseContext) { const filePaths = cacheKeys(toolUseContext.readFileState); @@ -558995,9 +486409,9 @@ async function getChangedFiles2(toolUseContext) { if (!isValid3.result) { return null; } - const result3 = await FileReadTool.call(fileInput, toolUseContext); - if (result3.data.type === "text") { - const snippet = getSnippetForTwoFileDiff(fileState.content, result3.data.file.content); + const result2 = await FileReadTool.call(fileInput, toolUseContext); + if (result2.data.type === "text") { + const snippet = getSnippetForTwoFileDiff(fileState.content, result2.data.file.content); if (snippet === "") { return null; } @@ -559007,7 +486421,7 @@ async function getChangedFiles2(toolUseContext) { snippet }; } - if (result3.data.type === "image") { + if (result2.data.type === "image") { try { const data = await readImageWithTokenBudget(normalizedPath); return { @@ -559024,14 +486438,14 @@ async function getChangedFiles2(toolUseContext) { } } return null; - } catch (err3) { - if (isENOENT(err3)) { + } catch (err2) { + if (isENOENT(err2)) { toolUseContext.readFileState.delete(filePath); } return null; } })); - return results.filter((result3) => result3 != null); + return results.filter((result2) => result2 != null); } async function getNestedMemoryAttachments(toolUseContext) { if (!toolUseContext.nestedMemoryAttachmentTriggers || toolUseContext.nestedMemoryAttachmentTriggers.size === 0) { @@ -559046,14 +486460,14 @@ async function getNestedMemoryAttachments(toolUseContext) { toolUseContext.nestedMemoryAttachmentTriggers.clear(); return attachments; } -async function getRelevantMemoryAttachments(input11, agents, readFileState, recentTools, signal, alreadySurfaced) { - const memoryDirs = extractAgentMentions(input11).flatMap((mention) => { +async function getRelevantMemoryAttachments(input, agents, readFileState, recentTools, signal, alreadySurfaced) { + const memoryDirs = extractAgentMentions(input).flatMap((mention) => { const agentType = mention.replace("agent-", ""); const agentDef = agents.find((def2) => def2.agentType === agentType); return agentDef?.memory ? [getAgentMemoryDir(agentType, agentDef.memory)] : []; }); const dirs = memoryDirs.length > 0 ? memoryDirs : [getAutoMemPath()]; - const allResults = await Promise.all(dirs.map((dir) => findRelevantMemories(input11, dir, signal, recentTools, alreadySurfaced).catch(() => []))); + const allResults = await Promise.all(dirs.map((dir) => findRelevantMemories(input, dir, signal, recentTools, alreadySurfaced).catch(() => []))); const selected = allResults.flat().filter((m) => !readFileState.has(m.path) && !alreadySurfaced.has(m.path)).slice(0, 5); const memories = await readMemoriesForSurfacing(selected, signal); if (memories.length === 0) { @@ -559077,17 +486491,17 @@ function collectSurfacedMemories(messages) { async function readMemoriesForSurfacing(selected, signal) { const results = await Promise.all(selected.map(async ({ path: filePath, mtimeMs }) => { try { - const result3 = await readFileInRange(filePath, 0, MAX_MEMORY_LINES, MAX_MEMORY_BYTES, signal, { truncateOnByteLimit: true }); - const truncated = result3.totalLines > MAX_MEMORY_LINES || result3.truncatedByBytes; - const content = truncated ? result3.content + ` + const result2 = await readFileInRange(filePath, 0, MAX_MEMORY_LINES, MAX_MEMORY_BYTES, signal, { truncateOnByteLimit: true }); + const truncated = result2.totalLines > MAX_MEMORY_LINES || result2.truncatedByBytes; + const content = truncated ? result2.content + ` -> This memory file was truncated (${result3.truncatedByBytes ? `${MAX_MEMORY_BYTES} byte limit` : `first ${MAX_MEMORY_LINES} lines`}). Use the ${FILE_READ_TOOL_NAME} tool to view the complete file at: ${filePath}` : result3.content; +> This memory file was truncated (${result2.truncatedByBytes ? `${MAX_MEMORY_BYTES} byte limit` : `first ${MAX_MEMORY_LINES} lines`}). Use the ${FILE_READ_TOOL_NAME} tool to view the complete file at: ${filePath}` : result2.content; return { path: filePath, content, mtimeMs, header: memoryHeader(filePath, mtimeMs), - limit: truncated ? result3.lineCount : undefined + limit: truncated ? result2.lineCount : undefined }; } catch { return null; @@ -559095,11 +486509,11 @@ async function readMemoriesForSurfacing(selected, signal) { })); return results.filter((r) => r !== null); } -function memoryHeader(path22, mtimeMs) { +function memoryHeader(path17, mtimeMs) { const staleness = memoryFreshnessText(mtimeMs); return staleness ? `${staleness} -Memory: ${path22}:` : `Memory (saved ${memoryAge(mtimeMs)}): ${path22}:`; +Memory: ${path17}:` : `Memory (saved ${memoryAge(mtimeMs)}): ${path17}:`; } function startRelevantMemoryPrefetch(messages, toolUseContext) { if (!isAutoMemoryEnabled() || !getFeatureValue_CACHED_MAY_BE_STALE("tengu_moth_copse", false)) { @@ -559109,8 +486523,8 @@ function startRelevantMemoryPrefetch(messages, toolUseContext) { if (!lastUserMessage) { return; } - const input11 = getUserMessageText(lastUserMessage); - if (!input11 || !/\s/.test(input11.trim())) { + const input = getUserMessageText(lastUserMessage); + if (!input || !/\s/.test(input.trim())) { return; } const surfaced = collectSurfacedMemories(messages); @@ -559119,7 +486533,7 @@ function startRelevantMemoryPrefetch(messages, toolUseContext) { } const controller = createChildAbortController(toolUseContext.abortController); const firedAt = Date.now(); - const promise4 = getRelevantMemoryAttachments(input11, toolUseContext.options.agentDefinitions.activeAgents, toolUseContext.readFileState, collectRecentSuccessfulTools(messages, lastUserMessage), controller.signal, surfaced.paths).catch((e) => { + const promise4 = getRelevantMemoryAttachments(input, toolUseContext.options.agentDefinitions.activeAgents, toolUseContext.readFileState, collectRecentSuccessfulTools(messages, lastUserMessage), controller.signal, surfaced.paths).catch((e) => { if (!isAbortError2(e)) { logError2(e); } @@ -559152,8 +486566,8 @@ function hasToolResultContent(content) { function collectRecentSuccessfulTools(messages, lastUserMessage) { const useIdToName = new Map; const resultByUseId = new Map; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const m = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const m = messages[i3]; if (!m) continue; if (isHumanTurn(m) && m !== lastUserMessage) @@ -559210,7 +486624,7 @@ async function getDynamicSkillAttachments(toolUseContext) { const candidates = entries.filter((e) => e.isDirectory() || e.isSymbolicLink()).map((e) => e.name); const checked = await Promise.all(candidates.map(async (name) => { try { - await stat35(resolve36(skillDir, name, "SKILL.md")); + await stat34(resolve30(skillDir, name, "SKILL.md")); return name; } catch { return null; @@ -559230,7 +486644,7 @@ async function getDynamicSkillAttachments(toolUseContext) { type: "dynamic_skill", skillDir, skillNames, - displayPath: relative22(getCwd(), skillDir) + displayPath: relative20(getCwd(), skillDir) }); } } @@ -559319,8 +486733,8 @@ function extractAtMentionedFiles(content) { } function extractMcpResourceMentions(content) { const atMentionRegex = /(^|\s)@([^\s]+:[^\s]+)\b/g; - const matches3 = content.match(atMentionRegex) || []; - return uniq2(matches3.map((match) => match.slice(match.indexOf("@") + 1))); + const matches2 = content.match(atMentionRegex) || []; + return uniq2(matches2.map((match) => match.slice(match.indexOf("@") + 1))); } function extractAgentMentions(content) { const results = []; @@ -559375,9 +486789,9 @@ async function getLSPDiagnosticAttachments(toolUseContext) { return []; } logForDebugging(`LSP Diagnostics: Found ${diagnosticSets.length} pending diagnostic set(s)`); - const attachments = diagnosticSets.map(({ files: files2 }) => ({ + const attachments = diagnosticSets.map(({ files }) => ({ type: "diagnostics", - files: files2, + files, isNew: true })); if (diagnosticSets.length > 0) { @@ -559386,14 +486800,14 @@ async function getLSPDiagnosticAttachments(toolUseContext) { } logForDebugging(`LSP Diagnostics: Returning ${attachments.length} diagnostic attachment(s)`); return attachments; - } catch (error46) { - const err3 = toError(error46); - logError2(new Error(`Failed to get LSP diagnostic attachments: ${err3.message}`)); + } catch (error42) { + const err2 = toError(error42); + logError2(new Error(`Failed to get LSP diagnostic attachments: ${err2.message}`)); return []; } } -async function* getAttachmentMessages(input11, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2) { - const attachments = await getAttachments(input11, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2); +async function* getAttachmentMessages(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2) { + const attachments = await getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2); if (attachments.length === 0) { return; } @@ -559426,7 +486840,7 @@ async function tryGetPDFReference(filename) { filename, pageCount: effectivePageCount, fileSize: stats.size, - displayPath: relative22(getCwd(), filename) + displayPath: relative20(getCwd(), filename) }; } } catch {} @@ -559466,7 +486880,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName return { type: "already_read_file", filename, - displayPath: relative22(getCwd(), filename), + displayPath: relative20(getCwd(), filename), content: { type: "text", file: { @@ -559494,7 +486908,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName return { type: "compact_file_reference", filename, - displayPath: relative22(getCwd(), filename) + displayPath: relative20(getCwd(), filename) }; } const appState2 = toolUseContext.getAppState(); @@ -559507,14 +486921,14 @@ async function generateFileAttachment(filename, toolUseContext, successEventName offset: offset ?? 1, limit: MAX_LINES_TO_READ }; - const result3 = await FileReadTool.call(truncatedInput, toolUseContext); + const result2 = await FileReadTool.call(truncatedInput, toolUseContext); logEvent(successEventName, {}); return { type: "file", filename, - content: result3.data, + content: result2.data, truncated: true, - displayPath: relative22(getCwd(), filename) + displayPath: relative20(getCwd(), filename) }; } catch { logEvent(errorEventName, {}); @@ -559526,19 +486940,19 @@ async function generateFileAttachment(filename, toolUseContext, successEventName return null; } try { - const result3 = await FileReadTool.call(fileInput, toolUseContext); + const result2 = await FileReadTool.call(fileInput, toolUseContext); logEvent(successEventName, {}); return { type: "file", filename, - content: result3.data, - displayPath: relative22(getCwd(), filename) + content: result2.data, + displayPath: relative20(getCwd(), filename) }; - } catch (error46) { - if (error46 instanceof MaxFileReadTokenExceededError || error46 instanceof FileTooLargeError) { + } catch (error42) { + if (error42 instanceof MaxFileReadTokenExceededError || error42 instanceof FileTooLargeError) { return await readTruncatedFile(); } - throw error46; + throw error42; } } catch { logEvent(errorEventName, {}); @@ -559558,21 +486972,21 @@ function getTodoReminderTurnCounts(messages) { let lastReminderIndex = -1; let assistantTurnsSinceWrite = 0; let assistantTurnsSinceReminder = 0; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message?.type === "assistant") { if (isThinkingMessage(message)) { continue; } if (lastTodoWriteIndex === -1 && "message" in message && Array.isArray(message.message?.content) && message.message.content.some((block2) => block2.type === "tool_use" && block2.name === "TodoWrite")) { - lastTodoWriteIndex = i4; + lastTodoWriteIndex = i3; } if (lastTodoWriteIndex === -1) assistantTurnsSinceWrite++; if (lastReminderIndex === -1) assistantTurnsSinceReminder++; } else if (lastReminderIndex === -1 && message?.type === "attachment" && message.attachment.type === "todo_reminder") { - lastReminderIndex = i4; + lastReminderIndex = i3; } if (lastTodoWriteIndex !== -1 && lastReminderIndex !== -1) { break; @@ -559613,21 +487027,21 @@ function getTaskReminderTurnCounts(messages) { let lastReminderIndex = -1; let assistantTurnsSinceTaskManagement = 0; let assistantTurnsSinceReminder = 0; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message?.type === "assistant") { if (isThinkingMessage(message)) { continue; } if (lastTaskManagementIndex === -1 && "message" in message && Array.isArray(message.message?.content) && message.message.content.some((block2) => block2.type === "tool_use" && (block2.name === TASK_CREATE_TOOL_NAME || block2.name === TASK_UPDATE_TOOL_NAME))) { - lastTaskManagementIndex = i4; + lastTaskManagementIndex = i3; } if (lastTaskManagementIndex === -1) assistantTurnsSinceTaskManagement++; if (lastReminderIndex === -1) assistantTurnsSinceReminder++; } else if (lastReminderIndex === -1 && message?.type === "attachment" && message.attachment.type === "task_reminder") { - lastReminderIndex = i4; + lastReminderIndex = i3; } if (lastTaskManagementIndex !== -1 && lastReminderIndex !== -1) { break; @@ -559764,20 +487178,20 @@ async function getTeammateMailboxAttachments(toolUseContext) { } const idleAgentByIndex = new Map; const latestIdleByAgent = new Map; - for (let i4 = 0;i4 < allMessages.length; i4++) { - const idle = isIdleNotification(allMessages[i4].text); + for (let i3 = 0;i3 < allMessages.length; i3++) { + const idle = isIdleNotification(allMessages[i3].text); if (idle) { - idleAgentByIndex.set(i4, idle.from); - latestIdleByAgent.set(idle.from, i4); + idleAgentByIndex.set(i3, idle.from); + latestIdleByAgent.set(idle.from, i3); } } if (idleAgentByIndex.size > latestIdleByAgent.size) { const beforeCount = allMessages.length; - allMessages = allMessages.filter((_m, i4) => { - const agent = idleAgentByIndex.get(i4); + allMessages = allMessages.filter((_m, i3) => { + const agent = idleAgentByIndex.get(i3); if (agent === undefined) return true; - return latestIdleByAgent.get(agent) === i4; + return latestIdleByAgent.get(agent) === i3; }); logForDebugging(`[SwarmMailbox] Collapsed ${beforeCount - allMessages.length} duplicate idle notification(s)`); } @@ -559913,8 +487327,8 @@ function getMaxBudgetUsdAttachment(maxBudgetUsd) { } function getVerifyPlanReminderTurnCount(messages) { let turnCount = 0; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message && isHumanTurn(message)) { turnCount++; } @@ -559996,7 +487410,7 @@ var init_attachments2 = __esm(() => { init_errors(); init_diagnosticTracking(); init_settings2(); - init_utils9(); + init_utils8(); init_imageResizer(); init_commands2(); init_uniqBy(); @@ -560013,7 +487427,7 @@ var init_attachments2 = __esm(() => { init_constants3(); init_prompt22(); init_permissions2(); - init_auth2(); + init_auth(); init_mcpStringUtils(); init_filesystem(); init_framework(); @@ -560026,7 +487440,7 @@ var init_attachments2 = __esm(() => { init_AsyncHookRegistry(); init_LSPDiagnosticRegistry(); init_debug(); - init_messages5(); + init_messages3(); init_envUtils(); init_bun_bundle(); init_thinking(); @@ -560079,81 +487493,81 @@ var init_attachments2 = __esm(() => { }); // src/utils/plugins/loadPluginCommands.ts -import { basename as basename31, dirname as dirname42, join as join108 } from "path"; +import { basename as basename29, dirname as dirname39, join as join98 } from "path"; function isSkillFile2(filePath) { - return /^skill\.md$/i.test(basename31(filePath)); + return /^skill\.md$/i.test(basename29(filePath)); } function getCommandNameFromFile(filePath, baseDir, pluginName) { const isSkill = isSkillFile2(filePath); if (isSkill) { - const skillDirectory = dirname42(filePath); - const parentOfSkillDir = dirname42(skillDirectory); - const commandBaseName = basename31(skillDirectory); + const skillDirectory = dirname39(filePath); + const parentOfSkillDir = dirname39(skillDirectory); + const commandBaseName = basename29(skillDirectory); const relativePath = parentOfSkillDir.startsWith(baseDir) ? parentOfSkillDir.slice(baseDir.length).replace(/^\//, "") : ""; const namespace = relativePath ? relativePath.split("/").join(":") : ""; return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`; } else { - const fileDirectory = dirname42(filePath); - const commandBaseName = basename31(filePath).replace(/\.md$/, ""); + const fileDirectory = dirname39(filePath); + const commandBaseName = basename29(filePath).replace(/\.md$/, ""); const relativePath = fileDirectory.startsWith(baseDir) ? fileDirectory.slice(baseDir.length).replace(/^\//, "") : ""; const namespace = relativePath ? relativePath.split("/").join(":") : ""; return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`; } } async function collectMarkdownFiles(dirPath, baseDir, loadedPaths) { - const files2 = []; - const fs11 = getFsImplementation(); + const files = []; + const fs5 = getFsImplementation(); await walkPluginMarkdown(dirPath, async (fullPath) => { - if (isDuplicatePath(fs11, fullPath, loadedPaths)) + if (isDuplicatePath(fs5, fullPath, loadedPaths)) return; - const content = await fs11.readFile(fullPath, { encoding: "utf-8" }); + const content = await fs5.readFile(fullPath, { encoding: "utf-8" }); const { frontmatter, content: markdownContent } = parseFrontmatter(content, fullPath); - files2.push({ + files.push({ filePath: fullPath, baseDir, frontmatter, content: markdownContent }); }, { stopAtSkillDir: true, logLabel: "commands" }); - return files2; + return files; } -function transformPluginSkillFiles(files2) { +function transformPluginSkillFiles(files) { const filesByDir = new Map; - for (const file2 of files2) { - const dir = dirname42(file2.filePath); + for (const file2 of files) { + const dir = dirname39(file2.filePath); const dirFiles = filesByDir.get(dir) ?? []; dirFiles.push(file2); filesByDir.set(dir, dirFiles); } - const result3 = []; + const result2 = []; for (const [dir, dirFiles] of filesByDir) { const skillFiles = dirFiles.filter((f) => isSkillFile2(f.filePath)); if (skillFiles.length > 0) { const skillFile = skillFiles[0]; if (skillFiles.length > 1) { - logForDebugging(`Multiple skill files found in ${dir}, using ${basename31(skillFile.filePath)}`); + logForDebugging(`Multiple skill files found in ${dir}, using ${basename29(skillFile.filePath)}`); } - result3.push(skillFile); + result2.push(skillFile); } else { - result3.push(...dirFiles); + result2.push(...dirFiles); } } - return result3; + return result2; } -async function loadCommandsFromDirectory(commandsPath, pluginName, sourceName, pluginManifest, pluginPath, config5 = { isSkillMode: false }, loadedPaths = new Set) { +async function loadCommandsFromDirectory(commandsPath, pluginName, sourceName, pluginManifest, pluginPath, config3 = { isSkillMode: false }, loadedPaths = new Set) { const markdownFiles = await collectMarkdownFiles(commandsPath, commandsPath, loadedPaths); const processedFiles = transformPluginSkillFiles(markdownFiles); const commands = []; for (const file2 of processedFiles) { const commandName = getCommandNameFromFile(file2.filePath, file2.baseDir, pluginName); - const command = createPluginCommand(commandName, file2, sourceName, pluginManifest, pluginPath, isSkillFile2(file2.filePath), config5); + const command = createPluginCommand(commandName, file2, sourceName, pluginManifest, pluginPath, isSkillFile2(file2.filePath), config3); if (command) { commands.push(command); } } return commands; } -function createPluginCommand(commandName, file2, sourceName, pluginManifest, pluginPath, isSkill, config5 = { isSkillMode: false }) { +function createPluginCommand(commandName, file2, sourceName, pluginManifest, pluginPath, isSkill, config3 = { isSkillMode: false }) { try { const { frontmatter, content } = file2; const validatedDescription = coerceDescriptionToString(frontmatter.description, commandName); @@ -560198,18 +487612,18 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu userInvocable, contentLength: content.length, source: "plugin", - loadedFrom: isSkill || config5.isSkillMode ? "plugin" : undefined, + loadedFrom: isSkill || config3.isSkillMode ? "plugin" : undefined, pluginInfo: { pluginManifest, repository: sourceName }, isHidden: !userInvocable, - progressMessage: isSkill || config5.isSkillMode ? "loading" : "running", + progressMessage: isSkill || config3.isSkillMode ? "loading" : "running", userFacingName() { return displayName || commandName; }, async getPromptForCommand(args, context) { - let finalContent = config5.isSkillMode ? `Base directory for this skill: ${dirname42(file2.filePath)} + let finalContent = config3.isSkillMode ? `Base directory for this skill: ${dirname39(file2.filePath)} ${content}` : content; finalContent = substituteArguments(finalContent, args, true, argumentNames); @@ -560220,8 +487634,8 @@ ${content}` : content; if (pluginManifest.userConfig) { finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig); } - if (config5.isSkillMode) { - const rawSkillDir = dirname42(file2.filePath); + if (config3.isSkillMode) { + const rawSkillDir = dirname39(file2.filePath); const skillDir = process.platform === "win32" ? rawSkillDir.replace(/\\/g, "/") : rawSkillDir; finalContent = finalContent.replace(/\$\{CLAUDE_SKILL_DIR\}/g, skillDir); } @@ -560245,8 +487659,8 @@ ${content}` : content; return [{ type: "text", text: finalContent }]; } }; - } catch (error46) { - logForDebugging(`Failed to create command from ${file2.filePath}: ${error46}`, { + } catch (error42) { + logForDebugging(`Failed to create command from ${file2.filePath}: ${error42}`, { level: "error" }); return null; @@ -560256,12 +487670,12 @@ function clearPluginCommandCache() { getPluginCommands.cache?.clear?.(); } async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, pluginManifest, pluginPath, loadedPaths) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const skills = []; - const directSkillPath = join108(skillsPath, "SKILL.md"); + const directSkillPath = join98(skillsPath, "SKILL.md"); let directSkillContent = null; try { - directSkillContent = await fs11.readFile(directSkillPath, { + directSkillContent = await fs5.readFile(directSkillPath, { encoding: "utf-8" }); } catch (e) { @@ -560273,15 +487687,15 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi } } if (directSkillContent !== null) { - if (isDuplicatePath(fs11, directSkillPath, loadedPaths)) { + if (isDuplicatePath(fs5, directSkillPath, loadedPaths)) { return skills; } try { const { frontmatter, content: markdownContent } = parseFrontmatter(directSkillContent, directSkillPath); - const skillName = `${pluginName}:${basename31(skillsPath)}`; + const skillName = `${pluginName}:${basename29(skillsPath)}`; const file2 = { filePath: directSkillPath, - baseDir: dirname42(directSkillPath), + baseDir: dirname39(directSkillPath), frontmatter, content: markdownContent }; @@ -560289,8 +487703,8 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi if (skill) { skills.push(skill); } - } catch (error46) { - logForDebugging(`Failed to load skill from ${directSkillPath}: ${error46}`, { + } catch (error42) { + logForDebugging(`Failed to load skill from ${directSkillPath}: ${error42}`, { level: "error" }); } @@ -560298,7 +487712,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi } let entries; try { - entries = await fs11.readdir(skillsPath); + entries = await fs5.readdir(skillsPath); } catch (e) { if (!isENOENT(e)) { logForDebugging(`Failed to load skills from directory ${skillsPath}: ${e}`, { level: "error" }); @@ -560309,11 +487723,11 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi if (!entry.isDirectory() && !entry.isSymbolicLink()) { return; } - const skillDirPath = join108(skillsPath, entry.name); - const skillFilePath = join108(skillDirPath, "SKILL.md"); + const skillDirPath = join98(skillsPath, entry.name); + const skillFilePath = join98(skillDirPath, "SKILL.md"); let content; try { - content = await fs11.readFile(skillFilePath, { encoding: "utf-8" }); + content = await fs5.readFile(skillFilePath, { encoding: "utf-8" }); } catch (e) { if (!isENOENT(e)) { logForDebugging(`Failed to load skill from ${skillFilePath}: ${e}`, { @@ -560322,7 +487736,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi } return; } - if (isDuplicatePath(fs11, skillFilePath, loadedPaths)) { + if (isDuplicatePath(fs5, skillFilePath, loadedPaths)) { return; } try { @@ -560330,7 +487744,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi const skillName = `${pluginName}:${entry.name}`; const file2 = { filePath: skillFilePath, - baseDir: dirname42(skillFilePath), + baseDir: dirname39(skillFilePath), frontmatter, content: markdownContent }; @@ -560338,8 +487752,8 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi if (skill) { skills.push(skill); } - } catch (error46) { - logForDebugging(`Failed to load skill from ${skillFilePath}: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to load skill from ${skillFilePath}: ${error42}`, { level: "error" }); } })); return skills; @@ -560382,16 +487796,16 @@ var init_loadPluginCommands = __esm(() => { if (commands.length > 0) { logForDebugging(`Loaded ${commands.length} commands from plugin ${plugin.name} default directory`); } - } catch (error46) { - logForDebugging(`Failed to load commands from plugin ${plugin.name} default directory: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to load commands from plugin ${plugin.name} default directory: ${error42}`, { level: "error" }); } } if (plugin.commandsPaths) { logForDebugging(`Plugin ${plugin.name} has commandsPaths: ${plugin.commandsPaths.join(", ")}`); const pathResults = await Promise.all(plugin.commandsPaths.map(async (commandPath) => { try { - const fs11 = getFsImplementation(); - const stats = await fs11.stat(commandPath); + const fs5 = getFsImplementation(); + const stats = await fs5.stat(commandPath); logForDebugging(`Checking commandPath ${commandPath} - isDirectory: ${stats.isDirectory()}, isFile: ${stats.isFile()}`); if (stats.isDirectory()) { const commands = await loadCommandsFromDirectory(commandPath, plugin.name, plugin.source, plugin.manifest, plugin.path, { isSkillMode: false }, loadedPaths); @@ -560402,10 +487816,10 @@ var init_loadPluginCommands = __esm(() => { } return commands; } else if (stats.isFile() && commandPath.endsWith(".md")) { - if (isDuplicatePath(fs11, commandPath, loadedPaths)) { + if (isDuplicatePath(fs5, commandPath, loadedPaths)) { return []; } - const content = await fs11.readFile(commandPath, { + const content = await fs5.readFile(commandPath, { encoding: "utf-8" }); const { frontmatter, content: markdownContent } = parseFrontmatter(content, commandPath); @@ -560414,7 +487828,7 @@ var init_loadPluginCommands = __esm(() => { if (plugin.commandsMetadata) { for (const [name, metadata] of Object.entries(plugin.commandsMetadata)) { if (metadata.source) { - const fullMetadataPath = join108(plugin.path, metadata.source); + const fullMetadataPath = join98(plugin.path, metadata.source); if (commandPath === fullMetadataPath) { commandName = `${plugin.name}:${name}`; metadataOverride = metadata; @@ -560424,7 +487838,7 @@ var init_loadPluginCommands = __esm(() => { } } if (!commandName) { - commandName = `${plugin.name}:${basename31(commandPath).replace(/\.md$/, "")}`; + commandName = `${plugin.name}:${basename29(commandPath).replace(/\.md$/, "")}`; } const finalFrontmatter = metadataOverride ? { ...frontmatter, @@ -560443,7 +487857,7 @@ var init_loadPluginCommands = __esm(() => { } : frontmatter; const file2 = { filePath: commandPath, - baseDir: dirname42(commandPath), + baseDir: dirname39(commandPath), frontmatter: finalFrontmatter, content: markdownContent }; @@ -560454,8 +487868,8 @@ var init_loadPluginCommands = __esm(() => { } } return []; - } catch (error46) { - logForDebugging(`Failed to load commands from plugin ${plugin.name} custom path ${commandPath}: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to load commands from plugin ${plugin.name} custom path ${commandPath}: ${error42}`, { level: "error" }); return []; } })); @@ -560495,8 +487909,8 @@ var init_loadPluginCommands = __esm(() => { pluginCommands.push(command); logForDebugging(`Loaded inline content command from plugin ${plugin.name}: ${commandName}`); } - } catch (error46) { - logForDebugging(`Failed to load inline content command ${name} from plugin ${plugin.name}: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to load inline content command ${name} from plugin ${plugin.name}: ${error42}`, { level: "error" }); } } } @@ -560526,8 +487940,8 @@ var init_loadPluginCommands = __esm(() => { const skills = await loadSkillsFromDirectory(plugin.skillsPath, plugin.name, plugin.source, plugin.manifest, plugin.path, loadedPaths); pluginSkills.push(...skills); logForDebugging(`Loaded ${skills.length} skills from plugin ${plugin.name} default directory`); - } catch (error46) { - logForDebugging(`Failed to load skills from plugin ${plugin.name} default directory: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to load skills from plugin ${plugin.name} default directory: ${error42}`, { level: "error" }); } } if (plugin.skillsPaths) { @@ -560538,8 +487952,8 @@ var init_loadPluginCommands = __esm(() => { const skills = await loadSkillsFromDirectory(skillPath, plugin.name, plugin.source, plugin.manifest, plugin.path, loadedPaths); logForDebugging(`Loaded ${skills.length} skills from plugin ${plugin.name} custom path: ${skillPath}`); return skills; - } catch (error46) { - logForDebugging(`Failed to load skills from plugin ${plugin.name} custom path ${skillPath}: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to load skills from plugin ${plugin.name} custom path ${skillPath}: ${error42}`, { level: "error" }); return []; } })); @@ -560556,19 +487970,19 @@ var init_loadPluginCommands = __esm(() => { }); // src/utils/plugins/zipCache.ts -import { randomBytes as randomBytes10 } from "crypto"; +import { randomBytes as randomBytes9 } from "crypto"; import { chmod as chmod8, lstat as lstat7, readdir as readdir23, - readFile as readFile37, + readFile as readFile36, rename as rename3, - rm as rm7, - stat as stat36, - writeFile as writeFile32 + rm as rm5, + stat as stat35, + writeFile as writeFile30 } from "fs/promises"; -import { tmpdir as tmpdir9 } from "os"; -import { basename as basename32, dirname as dirname43, join as join109 } from "path"; +import { tmpdir as tmpdir6 } from "os"; +import { basename as basename30, dirname as dirname40, join as join99 } from "path"; function isPluginZipCacheEnabled() { return isEnvTruthy(process.env.CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE); } @@ -560584,21 +487998,21 @@ function getZipCacheKnownMarketplacesPath() { if (!cachePath) { throw new Error("Plugin zip cache is not enabled"); } - return join109(cachePath, "known_marketplaces.json"); + return join99(cachePath, "known_marketplaces.json"); } function getZipCacheMarketplacesDir() { const cachePath = getPluginZipCachePath(); if (!cachePath) { throw new Error("Plugin zip cache is not enabled"); } - return join109(cachePath, "marketplaces"); + return join99(cachePath, "marketplaces"); } function getZipCachePluginsDir() { const cachePath = getPluginZipCachePath(); if (!cachePath) { throw new Error("Plugin zip cache is not enabled"); } - return join109(cachePath, "plugins"); + return join99(cachePath, "plugins"); } async function getSessionPluginCachePath() { if (sessionPluginCachePath) { @@ -560606,8 +488020,8 @@ async function getSessionPluginCachePath() { } if (!sessionPluginCachePromise) { sessionPluginCachePromise = (async () => { - const suffix = randomBytes10(8).toString("hex"); - const dir = join109(tmpdir9(), `claude-plugin-session-${suffix}`); + const suffix = randomBytes9(8).toString("hex"); + const dir = join99(tmpdir6(), `claude-plugin-session-${suffix}`); await getFsImplementation().mkdir(dir); sessionPluginCachePath = dir; logForDebugging(`Created session plugin cache at ${dir}`); @@ -560621,45 +488035,45 @@ async function cleanupSessionPluginCache() { return; } try { - await rm7(sessionPluginCachePath, { recursive: true, force: true }); + await rm5(sessionPluginCachePath, { recursive: true, force: true }); logForDebugging(`Cleaned up session plugin cache at ${sessionPluginCachePath}`); - } catch (error46) { - logForDebugging(`Failed to clean up session plugin cache: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to clean up session plugin cache: ${error42}`); } finally { sessionPluginCachePath = null; sessionPluginCachePromise = null; } } async function atomicWriteToZipCache(targetPath, data) { - const dir = dirname43(targetPath); + const dir = dirname40(targetPath); await getFsImplementation().mkdir(dir); - const tmpName = `.${basename32(targetPath)}.tmp.${randomBytes10(4).toString("hex")}`; - const tmpPath = join109(dir, tmpName); + const tmpName = `.${basename30(targetPath)}.tmp.${randomBytes9(4).toString("hex")}`; + const tmpPath = join99(dir, tmpName); try { if (typeof data === "string") { - await writeFile32(tmpPath, data, { encoding: "utf-8" }); + await writeFile30(tmpPath, data, { encoding: "utf-8" }); } else { - await writeFile32(tmpPath, data); + await writeFile30(tmpPath, data); } await rename3(tmpPath, targetPath); - } catch (error46) { + } catch (error42) { try { - await rm7(tmpPath, { force: true }); + await rm5(tmpPath, { force: true }); } catch {} - throw error46; + throw error42; } } async function createZipFromDirectory(sourceDir) { - const files2 = {}; + const files = {}; const visited = new Set; - await collectFilesForZip(sourceDir, "", files2, visited); - const { zipSync: zipSync3 } = await Promise.resolve().then(() => (init_esm6(), exports_esm2)); - const zipData = zipSync3(files2, { level: 6 }); - logForDebugging(`Created ZIP from ${sourceDir}: ${Object.keys(files2).length} files, ${zipData.length} bytes`); + await collectFilesForZip(sourceDir, "", files, visited); + const { zipSync: zipSync2 } = await Promise.resolve().then(() => (init_esm5(), exports_esm2)); + const zipData = zipSync2(files, { level: 6 }); + logForDebugging(`Created ZIP from ${sourceDir}: ${Object.keys(files).length} files, ${zipData.length} bytes`); return zipData; } -async function collectFilesForZip(baseDir, relativePath, files2, visited) { - const currentDir = relativePath ? join109(baseDir, relativePath) : baseDir; +async function collectFilesForZip(baseDir, relativePath, files, visited) { + const currentDir = relativePath ? join99(baseDir, relativePath) : baseDir; let entries; try { entries = await readdir23(currentDir); @@ -560667,7 +488081,7 @@ async function collectFilesForZip(baseDir, relativePath, files2, visited) { return; } try { - const dirStat = await stat36(currentDir, { bigint: true }); + const dirStat = await stat35(currentDir, { bigint: true }); if (dirStat.dev !== 0n || dirStat.ino !== 0n) { const key = `${dirStat.dev}:${dirStat.ino}`; if (visited.has(key)) { @@ -560683,7 +488097,7 @@ async function collectFilesForZip(baseDir, relativePath, files2, visited) { if (entry === ".git") { continue; } - const fullPath = join109(currentDir, entry); + const fullPath = join99(currentDir, entry); const relPath = relativePath ? `${relativePath}/${entry}` : entry; let fileStat; try { @@ -560693,7 +488107,7 @@ async function collectFilesForZip(baseDir, relativePath, files2, visited) { } if (fileStat.isSymbolicLink()) { try { - const targetStat = await stat36(fullPath); + const targetStat = await stat35(fullPath); if (targetStat.isDirectory()) { continue; } @@ -560703,48 +488117,48 @@ async function collectFilesForZip(baseDir, relativePath, files2, visited) { } } if (fileStat.isDirectory()) { - await collectFilesForZip(baseDir, relPath, files2, visited); + await collectFilesForZip(baseDir, relPath, files, visited); } else if (fileStat.isFile()) { try { - const content = await readFile37(fullPath); - files2[relPath] = [ + const content = await readFile36(fullPath); + files[relPath] = [ new Uint8Array(content), { os: 3, attrs: (fileStat.mode & 65535) << 16 } ]; - } catch (error46) { - logForDebugging(`Failed to read file for zip: ${relPath}: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to read file for zip: ${relPath}: ${error42}`); } } } } async function extractZipToDirectory(zipPath, targetDir) { const zipBuf = await getFsImplementation().readFileBytes(zipPath); - const files2 = await unzipFile(zipBuf); + const files = await unzipFile(zipBuf); const modes = parseZipModes(zipBuf); await getFsImplementation().mkdir(targetDir); - for (const [relPath, data] of Object.entries(files2)) { + for (const [relPath, data] of Object.entries(files)) { if (relPath.endsWith("/")) { - await getFsImplementation().mkdir(join109(targetDir, relPath)); + await getFsImplementation().mkdir(join99(targetDir, relPath)); continue; } - const fullPath = join109(targetDir, relPath); - await getFsImplementation().mkdir(dirname43(fullPath)); - await writeFile32(fullPath, data); + const fullPath = join99(targetDir, relPath); + await getFsImplementation().mkdir(dirname40(fullPath)); + await writeFile30(fullPath, data); const mode = modes[relPath]; if (mode && mode & 73) { await chmod8(fullPath, mode & 511).catch(() => {}); } } - logForDebugging(`Extracted ZIP to ${targetDir}: ${Object.keys(files2).length} entries`); + logForDebugging(`Extracted ZIP to ${targetDir}: ${Object.keys(files).length} entries`); } async function convertDirectoryToZipInPlace(dirPath, zipPath) { const zipData = await createZipFromDirectory(dirPath); await atomicWriteToZipCache(zipPath, zipData); - await rm7(dirPath, { recursive: true, force: true }); + await rm5(dirPath, { recursive: true, force: true }); } function getMarketplaceJsonRelativePath(marketplaceName) { const sanitized = marketplaceName.replace(/[^a-zA-Z0-9\-_]/g, "-"); - return join109("marketplaces", `${sanitized}.json`); + return join99("marketplaces", `${sanitized}.json`); } function isMarketplaceSourceSupportedByZipCache(source) { return ["github", "git", "url", "settings"].includes(source.source); @@ -560752,15 +488166,15 @@ function isMarketplaceSourceSupportedByZipCache(source) { var sessionPluginCachePath = null, sessionPluginCachePromise = null; var init_zipCache = __esm(() => { init_debug(); - init_zip3(); + init_zip2(); init_envUtils(); init_fsOperations(); init_pathValidation(); }); // src/utils/plugins/cacheUtils.ts -import { readdir as readdir24, rm as rm8, stat as stat37, unlink as unlink16, writeFile as writeFile33 } from "fs/promises"; -import { join as join110 } from "path"; +import { readdir as readdir24, rm as rm6, stat as stat36, unlink as unlink16, writeFile as writeFile31 } from "fs/promises"; +import { join as join100 } from "path"; function clearAllPluginCaches() { clearPluginCache(); clearPluginCommandCache(); @@ -560780,9 +488194,9 @@ function clearAllCaches() { } async function markPluginVersionOrphaned(versionPath) { try { - await writeFile33(getOrphanedAtPath(versionPath), `${Date.now()}`, "utf-8"); - } catch (error46) { - logForDebugging(`Failed to write .orphaned_at: ${versionPath}: ${error46}`); + await writeFile31(getOrphanedAtPath(versionPath), `${Date.now()}`, "utf-8"); + } catch (error42) { + logForDebugging(`Failed to write .orphaned_at: ${versionPath}: ${error42}`); } } async function cleanupOrphanedPluginVersionsInBackground() { @@ -560794,38 +488208,38 @@ async function cleanupOrphanedPluginVersionsInBackground() { if (!installedVersions) return; const cachePath = getPluginCachePath(); - const now3 = Date.now(); + const now2 = Date.now(); await Promise.all([...installedVersions].map((p) => removeOrphanedAtMarker(p))); for (const marketplace of await readSubdirs(cachePath)) { - const marketplacePath = join110(cachePath, marketplace); + const marketplacePath = join100(cachePath, marketplace); for (const plugin of await readSubdirs(marketplacePath)) { - const pluginPath = join110(marketplacePath, plugin); + const pluginPath = join100(marketplacePath, plugin); for (const version3 of await readSubdirs(pluginPath)) { - const versionPath = join110(pluginPath, version3); + const versionPath = join100(pluginPath, version3); if (installedVersions.has(versionPath)) continue; - await processOrphanedPluginVersion(versionPath, now3); + await processOrphanedPluginVersion(versionPath, now2); } await removeIfEmpty(pluginPath); } await removeIfEmpty(marketplacePath); } - } catch (error46) { - logForDebugging(`Plugin cache cleanup failed: ${error46}`); + } catch (error42) { + logForDebugging(`Plugin cache cleanup failed: ${error42}`); } } function getOrphanedAtPath(versionPath) { - return join110(versionPath, ORPHANED_AT_FILENAME2); + return join100(versionPath, ORPHANED_AT_FILENAME2); } async function removeOrphanedAtMarker(versionPath) { const orphanedAtPath = getOrphanedAtPath(versionPath); try { await unlink16(orphanedAtPath); - } catch (error46) { - const code = getErrnoCode(error46); + } catch (error42) { + const code = getErrnoCode(error42); if (code === "ENOENT") return; - logForDebugging(`Failed to remove .orphaned_at: ${versionPath}: ${error46}`); + logForDebugging(`Failed to remove .orphaned_at: ${versionPath}: ${error42}`); } } function getInstalledVersionPaths() { @@ -560838,39 +488252,39 @@ function getInstalledVersionPaths() { } } return paths2; - } catch (error46) { - logForDebugging(`Failed to load installed plugins: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to load installed plugins: ${error42}`); return null; } } -async function processOrphanedPluginVersion(versionPath, now3) { +async function processOrphanedPluginVersion(versionPath, now2) { const orphanedAtPath = getOrphanedAtPath(versionPath); let orphanedAt; try { - orphanedAt = (await stat37(orphanedAtPath)).mtimeMs; - } catch (error46) { - const code = getErrnoCode(error46); + orphanedAt = (await stat36(orphanedAtPath)).mtimeMs; + } catch (error42) { + const code = getErrnoCode(error42); if (code === "ENOENT") { await markPluginVersionOrphaned(versionPath); return; } - logForDebugging(`Failed to stat orphaned marker: ${versionPath}: ${error46}`); + logForDebugging(`Failed to stat orphaned marker: ${versionPath}: ${error42}`); return; } - if (now3 - orphanedAt > CLEANUP_AGE_MS) { + if (now2 - orphanedAt > CLEANUP_AGE_MS) { try { - await rm8(versionPath, { recursive: true, force: true }); - } catch (error46) { - logForDebugging(`Failed to delete orphaned version: ${versionPath}: ${error46}`); + await rm6(versionPath, { recursive: true, force: true }); + } catch (error42) { + logForDebugging(`Failed to delete orphaned version: ${versionPath}: ${error42}`); } } } async function removeIfEmpty(dirPath) { if ((await readSubdirs(dirPath)).length === 0) { try { - await rm8(dirPath, { recursive: true, force: true }); - } catch (error46) { - logForDebugging(`Failed to remove empty dir: ${dirPath}: ${error46}`); + await rm6(dirPath, { recursive: true, force: true }); + } catch (error42) { + logForDebugging(`Failed to remove empty dir: ${dirPath}: ${error42}`); } } } @@ -560935,20 +488349,20 @@ function getMarketplaceSourceDisplay(source) { function createPluginId(pluginName, marketplaceName) { return `${pluginName}@${marketplaceName}`; } -async function loadMarketplacesWithGracefulDegradation(config5) { +async function loadMarketplacesWithGracefulDegradation(config3) { const marketplaces = []; const failures = []; - for (const [name, marketplaceConfig] of Object.entries(config5)) { + for (const [name, marketplaceConfig] of Object.entries(config3)) { if (!isSourceAllowedByPolicy(marketplaceConfig.source)) { continue; } let data = null; try { data = await getMarketplace(name); - } catch (err3) { - const errorMessage2 = err3 instanceof Error ? err3.message : String(err3); + } catch (err2) { + const errorMessage2 = err2 instanceof Error ? err2.message : String(err2); failures.push({ name, error: errorMessage2 }); - logError2(toError(err3)); + logError2(toError(err2)); } marketplaces.push({ name, @@ -561217,12 +488631,12 @@ var init_marketplaceHelpers = __esm(() => { }); // src/utils/plugins/officialMarketplaceGcs.ts -import { chmod as chmod9, mkdir as mkdir31, readFile as readFile38, rename as rename4, rm as rm9, writeFile as writeFile34 } from "fs/promises"; -import { dirname as dirname44, join as join111, resolve as resolve37, sep as sep26 } from "path"; +import { chmod as chmod9, mkdir as mkdir31, readFile as readFile37, rename as rename4, rm as rm7, writeFile as writeFile32 } from "fs/promises"; +import { dirname as dirname41, join as join101, resolve as resolve31, sep as sep23 } from "path"; async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) { - const cacheDir = resolve37(marketplacesCacheDir); - const resolvedLoc = resolve37(installLocation); - if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep26)) { + const cacheDir = resolve31(marketplacesCacheDir); + const resolvedLoc = resolve31(installLocation); + if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep23)) { logForDebugging(`fetchOfficialMarketplaceFromGcs: refusing path outside cache dir: ${installLocation}`, { level: "error" }); return null; } @@ -561241,8 +488655,8 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach if (!sha) { throw new Error("latest pointer returned empty body"); } - const sentinelPath = join111(installLocation, ".gcs-sha"); - const currentSha = await readFile38(sentinelPath, "utf8").then((s) => s.trim(), () => null); + const sentinelPath = join101(installLocation, ".gcs-sha"); + const currentSha = await readFile37(sentinelPath, "utf8").then((s) => s.trim(), () => null); if (currentSha === sha) { outcome = "noop"; return sha; @@ -561253,27 +488667,27 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach }); const zipBuf = Buffer.from(zipResp.data); bytes = zipBuf.length; - const files2 = await unzipFile(zipBuf); + const files = await unzipFile(zipBuf); const modes = parseZipModes(zipBuf); const staging = `${installLocation}.staging`; - await rm9(staging, { recursive: true, force: true }); + await rm7(staging, { recursive: true, force: true }); await mkdir31(staging, { recursive: true }); - for (const [arcPath, data] of Object.entries(files2)) { + for (const [arcPath, data] of Object.entries(files)) { if (!arcPath.startsWith(ARC_PREFIX)) continue; const rel = arcPath.slice(ARC_PREFIX.length); if (!rel || rel.endsWith("/")) continue; - const dest = join111(staging, rel); - await mkdir31(dirname44(dest), { recursive: true }); - await writeFile34(dest, data); + const dest = join101(staging, rel); + await mkdir31(dirname41(dest), { recursive: true }); + await writeFile32(dest, data); const mode = modes[arcPath]; if (mode && mode & 73) { await chmod9(dest, mode & 511).catch(() => {}); } } - await writeFile34(join111(staging, ".gcs-sha"), sha); - await rm9(installLocation, { recursive: true, force: true }); + await writeFile32(join101(staging, ".gcs-sha"), sha); + await rm7(installLocation, { recursive: true, force: true }); await rename4(staging, installLocation); outcome = "updated"; return sha; @@ -561321,7 +488735,7 @@ var init_officialMarketplaceGcs = __esm(() => { init_state(); init_analytics(); init_debug(); - init_zip3(); + init_zip2(); init_errors(); KNOWN_FS_CODES = new Set([ "ENOSPC", @@ -561338,13 +488752,13 @@ var init_officialMarketplaceGcs = __esm(() => { }); // src/utils/plugins/marketplaceManager.ts -import { writeFile as writeFile35 } from "fs/promises"; -import { basename as basename33, dirname as dirname45, isAbsolute as isAbsolute24, join as join112, resolve as resolve38, sep as sep27 } from "path"; +import { writeFile as writeFile33 } from "fs/promises"; +import { basename as basename31, dirname as dirname42, isAbsolute as isAbsolute23, join as join102, resolve as resolve32, sep as sep24 } from "path"; function getKnownMarketplacesFile() { - return join112(getPluginsDirectory(), "known_marketplaces.json"); + return join102(getPluginsDirectory(), "known_marketplaces.json"); } function getMarketplacesCacheDir() { - return join112(getPluginsDirectory(), "marketplaces"); + return join102(getPluginsDirectory(), "marketplaces"); } function clearMarketplacesCache() { getMarketplace.cache?.clear?.(); @@ -561387,10 +488801,10 @@ function saveMarketplaceToSettings(name, entry, settingSource = "userSettings") updateSettingsForSource(settingSource, { extraKnownMarketplaces: current }); } async function loadKnownMarketplacesConfig() { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const configFile = getKnownMarketplacesFile(); try { - const content = await fs11.readFile(configFile, { + const content = await fs5.readFile(configFile, { encoding: "utf-8" }); const data = jsonParse(content); @@ -561403,14 +488817,14 @@ async function loadKnownMarketplacesConfig() { throw new ConfigParseError(errorMsg, configFile, data); } return parsed.data; - } catch (error46) { - if (isENOENT(error46)) { + } catch (error42) { + if (isENOENT(error42)) { return {}; } - if (error46 instanceof ConfigParseError) { - throw error46; + if (error42 instanceof ConfigParseError) { + throw error42; } - const errorMsg = `Failed to load marketplace configuration: ${errorMessage(error46)}`; + const errorMsg = `Failed to load marketplace configuration: ${errorMessage(error42)}`; logForDebugging(errorMsg, { level: "error" }); @@ -561424,15 +488838,15 @@ async function loadKnownMarketplacesConfigSafe() { return {}; } } -async function saveKnownMarketplacesConfig(config5) { - const parsed = KnownMarketplacesFileSchema().safeParse(config5); +async function saveKnownMarketplacesConfig(config3) { + const parsed = KnownMarketplacesFileSchema().safeParse(config3); const configFile = getKnownMarketplacesFile(); if (!parsed.success) { - throw new ConfigParseError(`Invalid marketplace config: ${parsed.error.message}`, configFile, config5); + throw new ConfigParseError(`Invalid marketplace config: ${parsed.error.message}`, configFile, config3); } - const fs11 = getFsImplementation(); - const dir = join112(configFile, ".."); - await fs11.mkdir(dir); + const fs5 = getFsImplementation(); + const dir = join102(configFile, ".."); + await fs5.mkdir(dir); writeFileSync_DEPRECATED(configFile, jsonStringify(parsed.data, null, 2), { encoding: "utf-8", flush: true @@ -561478,7 +488892,7 @@ async function registerSeedMarketplaces() { return false; } async function readSeedKnownMarketplaces(seedDir) { - const seedJsonPath = join112(seedDir, "known_marketplaces.json"); + const seedJsonPath = join102(seedDir, "known_marketplaces.json"); try { const content = await getFsImplementation().readFile(seedJsonPath, { encoding: "utf-8" @@ -561497,8 +488911,8 @@ async function readSeedKnownMarketplaces(seedDir) { } } async function findSeedMarketplaceLocation(seedDir, name) { - const dirCandidate = join112(seedDir, "marketplaces", name); - const jsonCandidate = join112(seedDir, "marketplaces", `${name}.json`); + const dirCandidate = join102(seedDir, "marketplaces", name); + const jsonCandidate = join102(seedDir, "marketplaces", `${name}.json`); for (const candidate of [dirCandidate, jsonCandidate]) { try { await readCachedMarketplace(candidate); @@ -561508,7 +488922,7 @@ async function findSeedMarketplaceLocation(seedDir, name) { return null; } function seedDirFor(installLocation) { - return getPluginSeedDirs().find((d) => installLocation === d || installLocation.startsWith(d + sep27)); + return getPluginSeedDirs().find((d) => installLocation === d || installLocation.startsWith(d + sep24)); } function getPluginGitTimeoutMs() { const envValue = process.env.CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS; @@ -561522,38 +488936,38 @@ function getPluginGitTimeoutMs() { } async function gitPull(cwd2, ref, options2) { logForDebugging(`git pull: cwd=${cwd2} ref=${ref ?? "default"}`); - const env5 = { ...process.env, ...GIT_NO_PROMPT_ENV }; + const env4 = { ...process.env, ...GIT_NO_PROMPT_ENV }; const credentialArgs = options2?.disableCredentialHelper ? ["-c", "credential.helper="] : []; if (ref) { - const fetchResult = await execFileNoThrowWithCwd(gitExe(), [...credentialArgs, "fetch", "origin", ref], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env5 }); + const fetchResult = await execFileNoThrowWithCwd(gitExe(), [...credentialArgs, "fetch", "origin", ref], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env4 }); if (fetchResult.code !== 0) { return enhanceGitPullErrorMessages(fetchResult); } - const checkoutResult = await execFileNoThrowWithCwd(gitExe(), [...credentialArgs, "checkout", ref], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env5 }); + const checkoutResult = await execFileNoThrowWithCwd(gitExe(), [...credentialArgs, "checkout", ref], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env4 }); if (checkoutResult.code !== 0) { return enhanceGitPullErrorMessages(checkoutResult); } - const pullResult = await execFileNoThrowWithCwd(gitExe(), [...credentialArgs, "pull", "origin", ref], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env5 }); + const pullResult = await execFileNoThrowWithCwd(gitExe(), [...credentialArgs, "pull", "origin", ref], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env4 }); if (pullResult.code !== 0) { return enhanceGitPullErrorMessages(pullResult); } - await gitSubmoduleUpdate(cwd2, credentialArgs, env5, options2?.sparsePaths); + await gitSubmoduleUpdate(cwd2, credentialArgs, env4, options2?.sparsePaths); return pullResult; } - const result3 = await execFileNoThrowWithCwd(gitExe(), [...credentialArgs, "pull", "origin", "HEAD"], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env5 }); - if (result3.code !== 0) { - return enhanceGitPullErrorMessages(result3); + const result2 = await execFileNoThrowWithCwd(gitExe(), [...credentialArgs, "pull", "origin", "HEAD"], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env4 }); + if (result2.code !== 0) { + return enhanceGitPullErrorMessages(result2); } - await gitSubmoduleUpdate(cwd2, credentialArgs, env5, options2?.sparsePaths); - return result3; + await gitSubmoduleUpdate(cwd2, credentialArgs, env4, options2?.sparsePaths); + return result2; } -async function gitSubmoduleUpdate(cwd2, credentialArgs, env5, sparsePaths) { +async function gitSubmoduleUpdate(cwd2, credentialArgs, env4, sparsePaths) { if (sparsePaths && sparsePaths.length > 0) return; - const hasGitmodules = await getFsImplementation().stat(join112(cwd2, ".gitmodules")).then(() => true, () => false); + const hasGitmodules = await getFsImplementation().stat(join102(cwd2, ".gitmodules")).then(() => true, () => false); if (!hasGitmodules) return; - const result3 = await execFileNoThrowWithCwd(gitExe(), [ + const result2 = await execFileNoThrowWithCwd(gitExe(), [ "-c", "core.sshCommand=ssh -o BatchMode=yes -o StrictHostKeyChecking=yes", ...credentialArgs, @@ -561563,62 +488977,62 @@ async function gitSubmoduleUpdate(cwd2, credentialArgs, env5, sparsePaths) { "--recursive", "--depth", "1" - ], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env5 }); - if (result3.code !== 0) { - logForDebugging(`git submodule update failed (non-fatal): ${result3.stderr}`, { level: "warn" }); + ], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env4 }); + if (result2.code !== 0) { + logForDebugging(`git submodule update failed (non-fatal): ${result2.stderr}`, { level: "warn" }); } } -function enhanceGitPullErrorMessages(result3) { - if (result3.code === 0) { - return result3; +function enhanceGitPullErrorMessages(result2) { + if (result2.code === 0) { + return result2; } - if (result3.error?.includes("timed out")) { + if (result2.error?.includes("timed out")) { const timeoutSec = Math.round(getPluginGitTimeoutMs() / 1000); return { - ...result3, + ...result2, stderr: `Git pull timed out after ${timeoutSec}s. Try increasing the timeout via CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS environment variable. -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (result3.stderr.includes("REMOTE HOST IDENTIFICATION HAS CHANGED")) { + if (result2.stderr.includes("REMOTE HOST IDENTIFICATION HAS CHANGED")) { return { - ...result3, + ...result2, stderr: `SSH host key for this marketplace's git host has changed (server key rotation or possible MITM). Remove the stale entry with: ssh-keygen -R Then connect once manually to accept the new key. -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (result3.stderr.includes("Host key verification failed")) { + if (result2.stderr.includes("Host key verification failed")) { return { - ...result3, + ...result2, stderr: `SSH host key verification failed while updating marketplace. The host key is not in your known_hosts file. Connect once manually to add it (e.g., ssh -T git@), or remove and re-add the marketplace with an HTTPS URL. -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (result3.stderr.includes("Permission denied (publickey)") || result3.stderr.includes("Could not read from remote repository")) { + if (result2.stderr.includes("Permission denied (publickey)") || result2.stderr.includes("Could not read from remote repository")) { return { - ...result3, + ...result2, stderr: `SSH authentication failed while updating marketplace. Please ensure your SSH keys are configured. -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (result3.stderr.includes("timed out") || result3.stderr.includes("Could not resolve host")) { + if (result2.stderr.includes("timed out") || result2.stderr.includes("Could not resolve host")) { return { - ...result3, + ...result2, stderr: `Network error while updating marketplace. Please check your internet connection. -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - return result3; + return result2; } async function isGitHubSshLikelyConfigured() { try { - const result3 = await execFileNoThrow("ssh", [ + const result2 = await execFileNoThrow("ssh", [ "-T", "-o", "BatchMode=yes", @@ -561630,11 +489044,11 @@ async function isGitHubSshLikelyConfigured() { ], { timeout: 3000 }); - const configured = result3.code === 1 && (result3.stderr?.includes("successfully authenticated") || result3.stdout?.includes("successfully authenticated")); - logForDebugging(`SSH config check: code=${result3.code} configured=${configured}`); + const configured = result2.code === 1 && (result2.stderr?.includes("successfully authenticated") || result2.stdout?.includes("successfully authenticated")); + logForDebugging(`SSH config check: code=${result2.code} configured=${configured}`); return configured; - } catch (error46) { - logForDebugging(`SSH configuration check failed: ${errorMessage(error46)}`, { + } catch (error42) { + logForDebugging(`SSH configuration check failed: ${errorMessage(error42)}`, { level: "warn" }); return false; @@ -561667,19 +489081,19 @@ async function gitClone(gitUrl, targetPath, ref, sparsePaths) { args.push(gitUrl, targetPath); const timeoutMs = getPluginGitTimeoutMs(); logForDebugging(`git clone: url=${redactUrlCredentials(gitUrl)} ref=${ref ?? "default"} timeout=${timeoutMs}ms`); - const result3 = await execFileNoThrowWithCwd(gitExe(), args, { + const result2 = await execFileNoThrowWithCwd(gitExe(), args, { timeout: timeoutMs, stdin: "ignore", env: { ...process.env, ...GIT_NO_PROMPT_ENV } }); const redacted = redactUrlCredentials(gitUrl); if (gitUrl !== redacted) { - if (result3.error) - result3.error = result3.error.replaceAll(gitUrl, redacted); - if (result3.stderr) - result3.stderr = result3.stderr.replaceAll(gitUrl, redacted); + if (result2.error) + result2.error = result2.error.replaceAll(gitUrl, redacted); + if (result2.stderr) + result2.stderr = result2.stderr.replaceAll(gitUrl, redacted); } - if (result3.code === 0) { + if (result2.code === 0) { if (useSparse) { const sparseResult = await execFileNoThrowWithCwd(gitExe(), ["sparse-checkout", "set", "--cone", "--", ...sparsePaths], { cwd: targetPath, @@ -561707,75 +489121,75 @@ async function gitClone(gitUrl, targetPath, ref, sparsePaths) { } } logForDebugging(`git clone succeeded: ${redactUrlCredentials(gitUrl)}`); - return result3; + return result2; } - logForDebugging(`git clone failed: url=${redactUrlCredentials(gitUrl)} code=${result3.code} error=${result3.error ?? "none"} stderr=${result3.stderr}`, { level: "warn" }); - if (result3.error?.includes("timed out")) { + logForDebugging(`git clone failed: url=${redactUrlCredentials(gitUrl)} code=${result2.code} error=${result2.error ?? "none"} stderr=${result2.stderr}`, { level: "warn" }); + if (result2.error?.includes("timed out")) { return { - ...result3, + ...result2, stderr: `Git clone timed out after ${Math.round(timeoutMs / 1000)}s. The repository may be too large for the current timeout. Set CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS to increase it (e.g., 300000 for 5 minutes). -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (result3.stderr) { - if (result3.stderr.includes("REMOTE HOST IDENTIFICATION HAS CHANGED")) { + if (result2.stderr) { + if (result2.stderr.includes("REMOTE HOST IDENTIFICATION HAS CHANGED")) { const host = extractSshHost(gitUrl); const removeHint = host ? `ssh-keygen -R ${host}` : "ssh-keygen -R "; return { - ...result3, + ...result2, stderr: `SSH host key has changed (server key rotation or possible MITM). Remove the stale known_hosts entry: ${removeHint} Then connect once manually to verify and accept the new key. -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (result3.stderr.includes("Host key verification failed")) { + if (result2.stderr.includes("Host key verification failed")) { const host = extractSshHost(gitUrl); const connectHint = host ? `ssh -T git@${host}` : "ssh -T git@"; return { - ...result3, + ...result2, stderr: `SSH host key is not in your known_hosts file. To add it, connect once manually (this will show the fingerprint for you to verify): ${connectHint} Or use an HTTPS URL instead (recommended for public repos). -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (result3.stderr.includes("Permission denied (publickey)") || result3.stderr.includes("Could not read from remote repository")) { + if (result2.stderr.includes("Permission denied (publickey)") || result2.stderr.includes("Could not read from remote repository")) { return { - ...result3, + ...result2, stderr: `SSH authentication failed. Please ensure your SSH keys are configured for GitHub, or use an HTTPS URL instead. -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (isAuthenticationError(result3.stderr)) { + if (isAuthenticationError(result2.stderr)) { return { - ...result3, + ...result2, stderr: `HTTPS authentication failed. Please ensure your credential helper is configured (e.g., gh auth login). -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } - if (result3.stderr.includes("timed out") || result3.stderr.includes("timeout") || result3.stderr.includes("Could not resolve host")) { + if (result2.stderr.includes("timed out") || result2.stderr.includes("timeout") || result2.stderr.includes("Could not resolve host")) { return { - ...result3, + ...result2, stderr: `Network error or timeout while cloning repository. Please check your internet connection and try again. -Original error: ${result3.stderr}` +Original error: ${result2.stderr}` }; } } - if (!result3.stderr) { + if (!result2.stderr) { return { - code: result3.code, - stderr: result3.error || `git clone exited with code ${result3.code} (no stderr output). Run with --debug to see the full command.` + code: result2.code, + stderr: result2.error || `git clone exited with code ${result2.code} (no stderr output). Run with --debug to see the full command.` }; } - return result3; + return result2; } function safeCallProgress(onProgress, message) { if (!onProgress) @@ -561789,11 +489203,11 @@ function safeCallProgress(onProgress, message) { } } async function reconcileSparseCheckout(cwd2, sparsePaths) { - const env5 = { ...process.env, ...GIT_NO_PROMPT_ENV }; + const env4 = { ...process.env, ...GIT_NO_PROMPT_ENV }; if (sparsePaths && sparsePaths.length > 0) { - return execFileNoThrowWithCwd(gitExe(), ["sparse-checkout", "set", "--cone", "--", ...sparsePaths], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env5 }); + return execFileNoThrowWithCwd(gitExe(), ["sparse-checkout", "set", "--cone", "--", ...sparsePaths], { cwd: cwd2, timeout: getPluginGitTimeoutMs(), stdin: "ignore", env: env4 }); } - const check4 = await execFileNoThrowWithCwd(gitExe(), ["config", "--get", "core.sparseCheckout"], { cwd: cwd2, stdin: "ignore", env: env5 }); + const check4 = await execFileNoThrowWithCwd(gitExe(), ["config", "--get", "core.sparseCheckout"], { cwd: cwd2, stdin: "ignore", env: env4 }); if (check4.code === 0 && check4.stdout.trim() === "true") { return { code: 1, @@ -561803,7 +489217,7 @@ async function reconcileSparseCheckout(cwd2, sparsePaths) { return { code: 0, stderr: "" }; } async function cacheMarketplaceFromGit(gitUrl, cachePath, ref, sparsePaths, onProgress, options2) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const timeoutSec = Math.round(getPluginGitTimeoutMs() / 1000); safeCallProgress(onProgress, `Refreshing marketplace cache (timeout: ${timeoutSec}s)…`); const reconcileResult = await reconcileSparseCheckout(cachePath, sparsePaths); @@ -561823,7 +489237,7 @@ async function cacheMarketplaceFromGit(gitUrl, cachePath, ref, sparsePaths, onPr logForDebugging(`sparse-checkout reconcile requires re-clone: ${reconcileResult.stderr}`); } try { - await fs11.rm(cachePath, { recursive: true }); + await fs5.rm(cachePath, { recursive: true }); logForDebugging(`Found stale marketplace directory at ${cachePath}, cleaning up to allow re-clone`, { level: "warn" }); safeCallProgress(onProgress, "Found stale directory, cleaning up and re-cloning…"); } catch (rmError) { @@ -561837,13 +489251,13 @@ Technical details: ${rmErrorMsg}`); const refMessage = ref ? ` (ref: ${ref})` : ""; safeCallProgress(onProgress, `Cloning repository (timeout: ${timeoutSec}s): ${redactUrlCredentials(gitUrl)}${refMessage}`); const cloneStarted = performance.now(); - const result3 = await gitClone(gitUrl, cachePath, ref, sparsePaths); - logPluginFetch("marketplace_clone", gitUrl, result3.code === 0 ? "success" : "failure", performance.now() - cloneStarted, result3.code === 0 ? undefined : classifyFetchError(result3.stderr)); - if (result3.code !== 0) { + const result2 = await gitClone(gitUrl, cachePath, ref, sparsePaths); + logPluginFetch("marketplace_clone", gitUrl, result2.code === 0 ? "success" : "failure", performance.now() - cloneStarted, result2.code === 0 ? undefined : classifyFetchError(result2.stderr)); + if (result2.code !== 0) { try { - await fs11.rm(cachePath, { recursive: true, force: true }); + await fs5.rm(cachePath, { recursive: true, force: true }); } catch {} - throw new Error(`Failed to clone marketplace repository: ${result3.stderr}`); + throw new Error(`Failed to clone marketplace repository: ${result2.stderr}`); } safeCallProgress(onProgress, "Clone complete, validating marketplace…"); } @@ -561865,7 +489279,7 @@ function redactUrlCredentials(urlString) { return urlString; } async function cacheMarketplaceFromUrl(url3, cachePath, customHeaders, onProgress) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const redactedUrl = redactUrlCredentials(url3); safeCallProgress(onProgress, `Downloading marketplace from ${redactedUrl}`); logForDebugging(`Downloading marketplace from URL: ${redactedUrl}`); @@ -561883,65 +489297,65 @@ async function cacheMarketplaceFromUrl(url3, cachePath, customHeaders, onProgres timeout: 1e4, headers }); - } catch (error46) { - logPluginFetch("marketplace_url", url3, "failure", performance.now() - fetchStarted, classifyFetchError(error46)); - if (axios_default.isAxiosError(error46)) { - if (error46.code === "ECONNREFUSED" || error46.code === "ENOTFOUND") { + } catch (error42) { + logPluginFetch("marketplace_url", url3, "failure", performance.now() - fetchStarted, classifyFetchError(error42)); + if (axios_default.isAxiosError(error42)) { + if (error42.code === "ECONNREFUSED" || error42.code === "ENOTFOUND") { throw new Error(`Could not connect to ${redactedUrl}. Please check your internet connection and verify the URL is correct. -Technical details: ${error46.message}`); +Technical details: ${error42.message}`); } - if (error46.code === "ETIMEDOUT") { + if (error42.code === "ETIMEDOUT") { throw new Error(`Request timed out while downloading marketplace from ${redactedUrl}. The server may be slow or unreachable. -Technical details: ${error46.message}`); +Technical details: ${error42.message}`); } - if (error46.response) { - throw new Error(`HTTP ${error46.response.status} error while downloading marketplace from ${redactedUrl}. The marketplace file may not exist at this URL. + if (error42.response) { + throw new Error(`HTTP ${error42.response.status} error while downloading marketplace from ${redactedUrl}. The marketplace file may not exist at this URL. -Technical details: ${error46.message}`); +Technical details: ${error42.message}`); } } - throw new Error(`Failed to download marketplace from ${redactedUrl}: ${errorMessage(error46)}`); + throw new Error(`Failed to download marketplace from ${redactedUrl}: ${errorMessage(error42)}`); } safeCallProgress(onProgress, "Validating marketplace data"); - const result3 = PluginMarketplaceSchema().safeParse(response.data); - if (!result3.success) { + const result2 = PluginMarketplaceSchema().safeParse(response.data); + if (!result2.success) { logPluginFetch("marketplace_url", url3, "failure", performance.now() - fetchStarted, "invalid_schema"); - throw new ConfigParseError(`Invalid marketplace schema from URL: ${result3.error.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join(", ")}`, redactedUrl, response.data); + throw new ConfigParseError(`Invalid marketplace schema from URL: ${result2.error.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join(", ")}`, redactedUrl, response.data); } logPluginFetch("marketplace_url", url3, "success", performance.now() - fetchStarted); safeCallProgress(onProgress, "Saving marketplace to cache"); - const cacheDir = join112(cachePath, ".."); - await fs11.mkdir(cacheDir); - writeFileSync_DEPRECATED(cachePath, jsonStringify(result3.data, null, 2), { + const cacheDir = join102(cachePath, ".."); + await fs5.mkdir(cacheDir); + writeFileSync_DEPRECATED(cachePath, jsonStringify(result2.data, null, 2), { encoding: "utf-8", flush: true }); } function getCachePathForSource(source) { - const tempName = source.source === "github" ? source.repo.replace("/", "-") : source.source === "npm" ? source.package.replace("@", "").replace("/", "-") : source.source === "file" ? basename33(source.path).replace(".json", "") : source.source === "directory" ? basename33(source.path) : "temp_" + Date.now(); + const tempName = source.source === "github" ? source.repo.replace("/", "-") : source.source === "npm" ? source.package.replace("@", "").replace("/", "-") : source.source === "file" ? basename31(source.path).replace(".json", "") : source.source === "directory" ? basename31(source.path) : "temp_" + Date.now(); return tempName; } async function parseFileWithSchema(filePath, schema) { - const fs11 = getFsImplementation(); - const content = await fs11.readFile(filePath, { encoding: "utf-8" }); + const fs5 = getFsImplementation(); + const content = await fs5.readFile(filePath, { encoding: "utf-8" }); let data; try { data = jsonParse(content); - } catch (error46) { - throw new ConfigParseError(`Invalid JSON in ${filePath}: ${errorMessage(error46)}`, filePath, content); + } catch (error42) { + throw new ConfigParseError(`Invalid JSON in ${filePath}: ${errorMessage(error42)}`, filePath, content); } - const result3 = schema.safeParse(data); - if (!result3.success) { - throw new ConfigParseError(`Invalid schema: ${filePath} ${result3.error?.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join(", ")}`, filePath, data); + const result2 = schema.safeParse(data); + if (!result2.success) { + throw new ConfigParseError(`Invalid schema: ${filePath} ${result2.error?.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join(", ")}`, filePath, data); } - return result3.data; + return result2.data; } async function loadAndCacheMarketplace(source, onProgress) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const cacheDir = getMarketplacesCacheDir(); - await fs11.mkdir(cacheDir); + await fs5.mkdir(cacheDir); let temporaryCachePath; let marketplacePath; let cleanupNeeded = false; @@ -561949,7 +489363,7 @@ async function loadAndCacheMarketplace(source, onProgress) { try { switch (source.source) { case "url": { - temporaryCachePath = join112(cacheDir, `${tempName}.json`); + temporaryCachePath = join102(cacheDir, `${tempName}.json`); cleanupNeeded = true; await cacheMarketplaceFromUrl(source.url, temporaryCachePath, source.headers, onProgress); marketplacePath = temporaryCachePath; @@ -561958,7 +489372,7 @@ async function loadAndCacheMarketplace(source, onProgress) { case "github": { const sshUrl = `git@github.com:${source.repo}.git`; const httpsUrl = `https://github.com/${source.repo}.git`; - temporaryCachePath = join112(cacheDir, tempName); + temporaryCachePath = join102(cacheDir, tempName); cleanupNeeded = true; let lastError = null; const sshConfigured = await isGitHubSshLikelyConfigured(); @@ -561966,12 +489380,12 @@ async function loadAndCacheMarketplace(source, onProgress) { safeCallProgress(onProgress, `Cloning via SSH: ${sshUrl}`); try { await cacheMarketplaceFromGit(sshUrl, temporaryCachePath, source.ref, source.sparsePaths, onProgress); - } catch (err3) { - lastError = toError(err3); + } catch (err2) { + lastError = toError(err2); logError2(lastError); safeCallProgress(onProgress, `SSH clone failed, retrying with HTTPS: ${httpsUrl}`); logForDebugging(`SSH clone failed for ${source.repo} despite SSH being configured, falling back to HTTPS`, { level: "info" }); - await fs11.rm(temporaryCachePath, { recursive: true, force: true }); + await fs5.rm(temporaryCachePath, { recursive: true, force: true }); try { await cacheMarketplaceFromGit(httpsUrl, temporaryCachePath, source.ref, source.sparsePaths, onProgress); lastError = null; @@ -561985,12 +489399,12 @@ async function loadAndCacheMarketplace(source, onProgress) { logForDebugging(`SSH not configured for GitHub, using HTTPS for ${source.repo}`, { level: "info" }); try { await cacheMarketplaceFromGit(httpsUrl, temporaryCachePath, source.ref, source.sparsePaths, onProgress); - } catch (err3) { - lastError = toError(err3); + } catch (err2) { + lastError = toError(err2); logError2(lastError); safeCallProgress(onProgress, `HTTPS clone failed, retrying with SSH: ${sshUrl}`); logForDebugging(`HTTPS clone failed for ${source.repo} (${lastError.message}), falling back to SSH`, { level: "info" }); - await fs11.rm(temporaryCachePath, { recursive: true, force: true }); + await fs5.rm(temporaryCachePath, { recursive: true, force: true }); try { await cacheMarketplaceFromGit(sshUrl, temporaryCachePath, source.ref, source.sparsePaths, onProgress); lastError = null; @@ -562003,39 +489417,39 @@ async function loadAndCacheMarketplace(source, onProgress) { if (lastError) { throw lastError; } - marketplacePath = join112(temporaryCachePath, source.path || ".claude-plugin/marketplace.json"); + marketplacePath = join102(temporaryCachePath, source.path || ".claude-plugin/marketplace.json"); break; } case "git": { - temporaryCachePath = join112(cacheDir, tempName); + temporaryCachePath = join102(cacheDir, tempName); cleanupNeeded = true; await cacheMarketplaceFromGit(source.url, temporaryCachePath, source.ref, source.sparsePaths, onProgress); - marketplacePath = join112(temporaryCachePath, source.path || ".claude-plugin/marketplace.json"); + marketplacePath = join102(temporaryCachePath, source.path || ".claude-plugin/marketplace.json"); break; } case "npm": { throw new Error("NPM marketplace sources not yet implemented"); } case "file": { - const absPath = resolve38(source.path); + const absPath = resolve32(source.path); marketplacePath = absPath; - temporaryCachePath = dirname45(dirname45(absPath)); + temporaryCachePath = dirname42(dirname42(absPath)); cleanupNeeded = false; break; } case "directory": { - const absPath = resolve38(source.path); - marketplacePath = join112(absPath, ".claude-plugin", "marketplace.json"); + const absPath = resolve32(source.path); + marketplacePath = join102(absPath, ".claude-plugin", "marketplace.json"); temporaryCachePath = absPath; cleanupNeeded = false; break; } case "settings": { - temporaryCachePath = join112(cacheDir, source.name); - marketplacePath = join112(temporaryCachePath, ".claude-plugin", "marketplace.json"); + temporaryCachePath = join102(cacheDir, source.name); + marketplacePath = join102(temporaryCachePath, ".claude-plugin", "marketplace.json"); cleanupNeeded = false; - await fs11.mkdir(dirname45(marketplacePath)); - await writeFile35(marketplacePath, jsonStringify({ + await fs5.mkdir(dirname42(marketplacePath)); + await writeFile33(marketplacePath, jsonStringify({ name: source.name, owner: source.owner ?? { name: "settings" }, plugins: source.plugins @@ -562055,10 +489469,10 @@ async function loadAndCacheMarketplace(source, onProgress) { } throw new Error(`Failed to parse marketplace file at ${marketplacePath}: ${errorMessage(e)}`); } - const finalCachePath = join112(cacheDir, marketplace.name); - const resolvedFinal = resolve38(finalCachePath); - const resolvedCacheDir = resolve38(cacheDir); - if (!resolvedFinal.startsWith(resolvedCacheDir + sep27)) { + const finalCachePath = join102(cacheDir, marketplace.name); + const resolvedFinal = resolve32(finalCachePath); + const resolvedCacheDir = resolve32(cacheDir); + if (!resolvedFinal.startsWith(resolvedCacheDir + sep24)) { throw new Error(`Marketplace name '${marketplace.name}' resolves to a path outside the cache directory`); } if (temporaryCachePath !== finalCachePath && !isLocalMarketplaceSource(source)) { @@ -562068,33 +489482,33 @@ async function loadAndCacheMarketplace(source, onProgress) { } catch (callbackError) { logForDebugging(`Progress callback error: ${errorMessage(callbackError)}`, { level: "warn" }); } - await fs11.rm(finalCachePath, { recursive: true, force: true }); - await fs11.rename(temporaryCachePath, finalCachePath); + await fs5.rm(finalCachePath, { recursive: true, force: true }); + await fs5.rename(temporaryCachePath, finalCachePath); temporaryCachePath = finalCachePath; cleanupNeeded = false; - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); throw new Error(`Failed to finalize marketplace cache. Please manually delete the directory at ${finalCachePath} if it exists and try again. Technical details: ${errorMsg}`); } } return { marketplace, cachePath: temporaryCachePath }; - } catch (error46) { + } catch (error42) { if (cleanupNeeded && temporaryCachePath && !isLocalMarketplaceSource(source)) { try { - await fs11.rm(temporaryCachePath, { recursive: true, force: true }); + await fs5.rm(temporaryCachePath, { recursive: true, force: true }); } catch (cleanupError) { logForDebugging(`Warning: Failed to clean up temporary marketplace cache at ${temporaryCachePath}: ${errorMessage(cleanupError)}`, { level: "warn" }); } } - throw error46; + throw error42; } } async function addMarketplaceSource(source, onProgress) { let resolvedSource = source; - if (isLocalMarketplaceSource(source) && !isAbsolute24(source.path)) { - resolvedSource = { ...source, path: resolve38(source.path) }; + if (isLocalMarketplaceSource(source) && !isAbsolute23(source.path)) { + resolvedSource = { ...source, path: resolve32(source.path) }; } if (!isSourceAllowedByPolicy(resolvedSource)) { if (isSourceInBlocklist(resolvedSource)) { @@ -562133,8 +489547,8 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna if (sourceValidationError) { throw new Error(sourceValidationError); } - const config5 = await loadKnownMarketplacesConfig(); - const oldEntry = config5[marketplace.name]; + const config3 = await loadKnownMarketplacesConfig(); + const oldEntry = config3[marketplace.name]; if (oldEntry) { const seedDir = seedDirFor(oldEntry.installLocation); if (seedDir) { @@ -562142,44 +489556,44 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna } logForDebugging(`Marketplace '${marketplace.name}' exists with different source — overwriting`); if (!isLocalMarketplaceSource(oldEntry.source)) { - const cacheDir = resolve38(getMarketplacesCacheDir()); - const resolvedOld = resolve38(oldEntry.installLocation); - const resolvedNew = resolve38(cachePath); - if (resolvedOld === resolvedNew) {} else if (resolvedOld === cacheDir || resolvedOld.startsWith(cacheDir + sep27)) { - const fs11 = getFsImplementation(); - await fs11.rm(oldEntry.installLocation, { recursive: true, force: true }); + const cacheDir = resolve32(getMarketplacesCacheDir()); + const resolvedOld = resolve32(oldEntry.installLocation); + const resolvedNew = resolve32(cachePath); + if (resolvedOld === resolvedNew) {} else if (resolvedOld === cacheDir || resolvedOld.startsWith(cacheDir + sep24)) { + const fs5 = getFsImplementation(); + await fs5.rm(oldEntry.installLocation, { recursive: true, force: true }); } else { logForDebugging(`Skipping cleanup of old installLocation (${oldEntry.installLocation}) — ` + `outside ${cacheDir}. The path is corrupted; leaving it alone and ` + `overwriting the config entry.`, { level: "warn" }); } } } - config5[marketplace.name] = { + config3[marketplace.name] = { source: resolvedSource, installLocation: cachePath, lastUpdated: new Date().toISOString() }; - await saveKnownMarketplacesConfig(config5); + await saveKnownMarketplacesConfig(config3); logForDebugging(`Added marketplace source: ${marketplace.name}`); return { name: marketplace.name, alreadyMaterialized: false, resolvedSource }; } async function removeMarketplaceSource(name) { - const config5 = await loadKnownMarketplacesConfig(); - if (!config5[name]) { + const config3 = await loadKnownMarketplacesConfig(); + if (!config3[name]) { throw new Error(`Marketplace '${name}' not found`); } - const entry = config5[name]; + const entry = config3[name]; const seedDir = seedDirFor(entry.installLocation); if (seedDir) { throw new Error(`Marketplace '${name}' is registered from the read-only seed directory ` + `(${seedDir}) and will be re-registered on next startup. ` + `To stop using its plugins: claude plugin disable @${name}`); } - delete config5[name]; - await saveKnownMarketplacesConfig(config5); - const fs11 = getFsImplementation(); + delete config3[name]; + await saveKnownMarketplacesConfig(config3); + const fs5 = getFsImplementation(); const cacheDir = getMarketplacesCacheDir(); - const cachePath = join112(cacheDir, name); - await fs11.rm(cachePath, { recursive: true, force: true }); - const jsonCachePath = join112(cacheDir, `${name}.json`); - await fs11.rm(jsonCachePath, { force: true }); + const cachePath = join102(cacheDir, name); + await fs5.rm(cachePath, { recursive: true, force: true }); + const jsonCachePath = join102(cacheDir, `${name}.json`); + await fs5.rm(jsonCachePath, { force: true }); const editableSources = ["userSettings", "projectSettings", "localSettings"]; for (const source of editableSources) { const settings = getSettingsForSource(source); @@ -562209,10 +489623,10 @@ async function removeMarketplaceSource(name) { } } if (needsUpdate) { - const result3 = updateSettingsForSource(source, updates); - if (result3.error) { - logError2(result3.error); - logForDebugging(`Failed to clean up marketplace '${name}' from ${source} settings: ${result3.error.message}`); + const result2 = updateSettingsForSource(source, updates); + if (result2.error) { + logError2(result2.error); + logForDebugging(`Failed to clean up marketplace '${name}' from ${source} settings: ${result2.error.message}`); } else { logForDebugging(`Cleaned up marketplace '${name}' from ${source} settings`); } @@ -562229,7 +489643,7 @@ async function removeMarketplaceSource(name) { logForDebugging(`Removed marketplace source: ${name}`); } async function readCachedMarketplace(installLocation) { - const nestedPath = join112(installLocation, ".claude-plugin", "marketplace.json"); + const nestedPath = join102(installLocation, ".claude-plugin", "marketplace.json"); try { return await parseFileWithSchema(nestedPath, PluginMarketplaceSchema()); } catch (e) { @@ -562242,21 +489656,21 @@ async function readCachedMarketplace(installLocation) { return await parseFileWithSchema(installLocation, PluginMarketplaceSchema()); } async function getMarketplaceCacheOnly(name) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const configFile = getKnownMarketplacesFile(); try { - const content = await fs11.readFile(configFile, { encoding: "utf-8" }); - const config5 = jsonParse(content); - const entry = config5[name]; + const content = await fs5.readFile(configFile, { encoding: "utf-8" }); + const config3 = jsonParse(content); + const entry = config3[name]; if (!entry) { return null; } return await readCachedMarketplace(entry.installLocation); - } catch (error46) { - if (isENOENT(error46)) { + } catch (error42) { + if (isENOENT(error42)) { return null; } - logForDebugging(`Failed to read cached marketplace ${name}: ${errorMessage(error46)}`, { level: "warn" }); + logForDebugging(`Failed to read cached marketplace ${name}: ${errorMessage(error42)}`, { level: "warn" }); return null; } } @@ -562265,12 +489679,12 @@ async function getPluginByIdCacheOnly(pluginId) { if (!pluginName || !marketplaceName) { return null; } - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const configFile = getKnownMarketplacesFile(); try { - const content = await fs11.readFile(configFile, { encoding: "utf-8" }); - const config5 = jsonParse(content); - const marketplaceConfig = config5[marketplaceName]; + const content = await fs5.readFile(configFile, { encoding: "utf-8" }); + const config3 = jsonParse(content); + const marketplaceConfig = config3[marketplaceName]; if (!marketplaceConfig) { return null; } @@ -562300,8 +489714,8 @@ async function getPluginById(pluginId) { return null; } try { - const config5 = await loadKnownMarketplacesConfig(); - const marketplaceConfig = config5[marketplaceName]; + const config3 = await loadKnownMarketplacesConfig(); + const marketplaceConfig = config3[marketplaceName]; if (!marketplaceConfig) { return null; } @@ -562314,14 +489728,14 @@ async function getPluginById(pluginId) { entry: plugin, marketplaceInstallLocation: marketplaceConfig.installLocation }; - } catch (error46) { - logForDebugging(`Could not find plugin ${pluginId}: ${errorMessage(error46)}`, { level: "debug" }); + } catch (error42) { + logForDebugging(`Could not find plugin ${pluginId}: ${errorMessage(error42)}`, { level: "debug" }); return null; } } async function refreshAllMarketplaces() { - const config5 = await loadKnownMarketplacesConfig(); - for (const [name, entry] of Object.entries(config5)) { + const config3 = await loadKnownMarketplacesConfig(); + for (const [name, entry] of Object.entries(config3)) { if (seedDirFor(entry.installLocation)) { logForDebugging(`Skipping seed-managed marketplace '${name}' in bulk refresh`); continue; @@ -562332,7 +489746,7 @@ async function refreshAllMarketplaces() { if (name === OFFICIAL_MARKETPLACE_NAME) { const sha = await fetchOfficialMarketplaceFromGcs(entry.installLocation, getMarketplacesCacheDir()); if (sha !== null) { - config5[name].lastUpdated = new Date().toISOString(); + config3[name].lastUpdated = new Date().toISOString(); continue; } if (!getFeatureValue_CACHED_MAY_BE_STALE("tengu_plugin_official_mkt_git_fallback", true)) { @@ -562342,21 +489756,21 @@ async function refreshAllMarketplaces() { } try { const { cachePath } = await loadAndCacheMarketplace(entry.source); - config5[name].lastUpdated = new Date().toISOString(); - config5[name].installLocation = cachePath; - } catch (error46) { - logForDebugging(`Failed to refresh marketplace ${name}: ${errorMessage(error46)}`, { + config3[name].lastUpdated = new Date().toISOString(); + config3[name].installLocation = cachePath; + } catch (error42) { + logForDebugging(`Failed to refresh marketplace ${name}: ${errorMessage(error42)}`, { level: "error" }); } } - await saveKnownMarketplacesConfig(config5); + await saveKnownMarketplacesConfig(config3); } async function refreshMarketplace(name, onProgress, options2) { - const config5 = await loadKnownMarketplacesConfig(); - const entry = config5[name]; + const config3 = await loadKnownMarketplacesConfig(); + const entry = config3[name]; if (!entry) { - throw new Error(`Marketplace '${name}' not found. Available marketplaces: ${Object.keys(config5).join(", ")}`); + throw new Error(`Marketplace '${name}' not found. Available marketplaces: ${Object.keys(config3).join(", ")}`); } getMarketplace.cache?.delete?.(name); if (entry.source.source === "settings") { @@ -562371,17 +489785,17 @@ async function refreshMarketplace(name, onProgress, options2) { throw new Error(`Marketplace '${name}' is seed-managed (${seedDir}) and its content is ` + `controlled by the seed image. To update: ask your admin to update the seed.`); } if (!isLocalMarketplaceSource(source)) { - const cacheDir = resolve38(getMarketplacesCacheDir()); - const resolvedLoc = resolve38(installLocation); - if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep27)) { + const cacheDir = resolve32(getMarketplacesCacheDir()); + const resolvedLoc = resolve32(installLocation); + if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep24)) { throw new Error(`Marketplace '${name}' has a corrupted installLocation ` + `(${installLocation}) — expected a path inside ${cacheDir}. ` + `This can happen after cross-platform path writes or manual edits ` + `to known_marketplaces.json. ` + `Run: claude plugin marketplace remove "${name}" and re-add it.`); } } if (name === OFFICIAL_MARKETPLACE_NAME) { const sha = await fetchOfficialMarketplaceFromGcs(installLocation, getMarketplacesCacheDir()); if (sha !== null) { - config5[name] = { ...entry, lastUpdated: new Date().toISOString() }; - await saveKnownMarketplacesConfig(config5); + config3[name] = { ...entry, lastUpdated: new Date().toISOString() }; + await saveKnownMarketplacesConfig(config3); return; } if (!getFeatureValue_CACHED_MAY_BE_STALE("tengu_plugin_official_mkt_git_fallback", true)) { @@ -562431,11 +489845,11 @@ async function refreshMarketplace(name, onProgress, options2) { } else { throw new Error(`Unsupported marketplace source type for refresh`); } - config5[name].lastUpdated = new Date().toISOString(); - await saveKnownMarketplacesConfig(config5); + config3[name].lastUpdated = new Date().toISOString(); + await saveKnownMarketplacesConfig(config3); logForDebugging(`Successfully refreshed marketplace: ${name}`); - } catch (error46) { - const errorMessage2 = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + const errorMessage2 = error42 instanceof Error ? error42.message : String(error42); logForDebugging(`Failed to refresh marketplace ${name}: ${errorMessage2}`, { level: "error" }); @@ -562443,10 +489857,10 @@ async function refreshMarketplace(name, onProgress, options2) { } } async function setMarketplaceAutoUpdate(name, autoUpdate) { - const config5 = await loadKnownMarketplacesConfig(); - const entry = config5[name]; + const config3 = await loadKnownMarketplacesConfig(); + const entry = config3[name]; if (!entry) { - throw new Error(`Marketplace '${name}' not found. Available marketplaces: ${Object.keys(config5).join(", ")}`); + throw new Error(`Marketplace '${name}' not found. Available marketplaces: ${Object.keys(config3).join(", ")}`); } const seedDir = seedDirFor(entry.installLocation); if (seedDir) { @@ -562455,11 +489869,11 @@ async function setMarketplaceAutoUpdate(name, autoUpdate) { if (entry.autoUpdate === autoUpdate) { return; } - config5[name] = { + config3[name] = { ...entry, autoUpdate }; - await saveKnownMarketplacesConfig(config5); + await saveKnownMarketplacesConfig(config3); const declaringSource = getMarketplaceDeclaringSource(name); if (declaringSource) { const declared = getSettingsForSource(declaringSource)?.extraKnownMarketplaces?.[name]; @@ -562501,51 +489915,51 @@ var init_marketplaceManager = __esm(() => { }; DEFAULT_PLUGIN_GIT_TIMEOUT_MS = 120 * 1000; getMarketplace = memoize_default(async (name) => { - const config5 = await loadKnownMarketplacesConfig(); - const entry = config5[name]; + const config3 = await loadKnownMarketplacesConfig(); + const entry = config3[name]; if (!entry) { - throw new Error(`Marketplace '${name}' not found in configuration. Available marketplaces: ${Object.keys(config5).join(", ")}`); + throw new Error(`Marketplace '${name}' not found in configuration. Available marketplaces: ${Object.keys(config3).join(", ")}`); } - if (isLocalMarketplaceSource(entry.source) && !isAbsolute24(entry.source.path)) { + if (isLocalMarketplaceSource(entry.source) && !isAbsolute23(entry.source.path)) { throw new Error(`Marketplace "${name}" has a relative source path (${entry.source.path}) ` + `in known_marketplaces.json — this is stale state from an older ` + `Claude Code version. Run 'claude marketplace remove ${name}' and ` + `re-add it from the original project directory.`); } try { return await readCachedMarketplace(entry.installLocation); - } catch (error46) { - logForDebugging(`Cache corrupted or missing for marketplace ${name}, re-fetching from source: ${errorMessage(error46)}`, { + } catch (error42) { + logForDebugging(`Cache corrupted or missing for marketplace ${name}, re-fetching from source: ${errorMessage(error42)}`, { level: "warn" }); } let marketplace; try { ({ marketplace } = await loadAndCacheMarketplace(entry.source)); - } catch (error46) { - throw new Error(`Failed to load marketplace "${name}" from source (${entry.source.source}): ${errorMessage(error46)}`); + } catch (error42) { + throw new Error(`Failed to load marketplace "${name}" from source (${entry.source.source}): ${errorMessage(error42)}`); } - config5[name].lastUpdated = new Date().toISOString(); - await saveKnownMarketplacesConfig(config5); + config3[name].lastUpdated = new Date().toISOString(); + await saveKnownMarketplacesConfig(config3); return marketplace; }); }); // src/utils/plugins/installedPluginsManager.ts -import { dirname as dirname46, join as join113 } from "path"; +import { dirname as dirname43, join as join103 } from "path"; function getInstalledPluginsFilePath() { - return join113(getPluginsDirectory(), "installed_plugins.json"); + return join103(getPluginsDirectory(), "installed_plugins.json"); } function getInstalledPluginsV2FilePath() { - return join113(getPluginsDirectory(), "installed_plugins_v2.json"); + return join103(getPluginsDirectory(), "installed_plugins_v2.json"); } function migrateToSinglePluginFile() { if (migrationCompleted) { return; } - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const mainFilePath = getInstalledPluginsFilePath(); const v2FilePath = getInstalledPluginsV2FilePath(); try { try { - fs11.renameSync(v2FilePath, mainFilePath); + fs5.renameSync(v2FilePath, mainFilePath); logForDebugging(`Renamed installed_plugins_v2.json to installed_plugins.json`); const v2Data = loadInstalledPluginsV2(); cleanupLegacyCache(v2Data); @@ -562557,7 +489971,7 @@ function migrateToSinglePluginFile() { } let mainContent; try { - mainContent = fs11.readFileSync(mainFilePath, { encoding: "utf-8" }); + mainContent = fs5.readFileSync(mainFilePath, { encoding: "utf-8" }); } catch (e) { if (!isENOENT(e)) throw e; @@ -562577,17 +489991,17 @@ function migrateToSinglePluginFile() { cleanupLegacyCache(v2Data); } migrationCompleted = true; - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to migrate plugin files: ${errorMsg}`, { level: "error" }); - logError2(toError(error46)); + logError2(toError(error42)); migrationCompleted = true; } } function cleanupLegacyCache(v2Data) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const cachePath = getPluginCachePath(); try { const referencedPaths = new Set; @@ -562596,42 +490010,42 @@ function cleanupLegacyCache(v2Data) { referencedPaths.add(entry.installPath); } } - const entries = fs11.readdirSync(cachePath); + const entries = fs5.readdirSync(cachePath); for (const dirent of entries) { if (!dirent.isDirectory()) { continue; } const entry = dirent.name; - const entryPath = join113(cachePath, entry); - const subEntries = fs11.readdirSync(entryPath); + const entryPath = join103(cachePath, entry); + const subEntries = fs5.readdirSync(entryPath); const hasVersionedStructure = subEntries.some((subDirent) => { if (!subDirent.isDirectory()) return false; - const subPath = join113(entryPath, subDirent.name); - const versionEntries = fs11.readdirSync(subPath); + const subPath = join103(entryPath, subDirent.name); + const versionEntries = fs5.readdirSync(subPath); return versionEntries.some((vDirent) => vDirent.isDirectory()); }); if (hasVersionedStructure) { continue; } if (!referencedPaths.has(entryPath)) { - fs11.rmSync(entryPath, { recursive: true, force: true }); + fs5.rmSync(entryPath, { recursive: true, force: true }); logForDebugging(`Cleaned up legacy cache directory: ${entry}`); } } - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to clean up legacy cache: ${errorMsg}`, { level: "warn" }); } } function readInstalledPluginsFileRaw() { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const filePath = getInstalledPluginsFilePath(); let fileContent; try { - fileContent = fs11.readFileSync(filePath, { encoding: "utf-8" }); + fileContent = fs5.readFileSync(filePath, { encoding: "utf-8" }); } catch (e) { if (isENOENT(e)) { return null; @@ -562682,19 +490096,19 @@ function loadInstalledPluginsV2() { logForDebugging(`installed_plugins.json doesn't exist, returning empty V2 object`); installedPluginsCacheV2 = { version: 2, plugins: {} }; return installedPluginsCacheV2; - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to load installed_plugins.json: ${errorMsg}. Starting with empty state.`, { level: "error" }); - logError2(toError(error46)); + logError2(toError(error42)); installedPluginsCacheV2 = { version: 2, plugins: {} }; return installedPluginsCacheV2; } } function saveInstalledPluginsV2(data) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const filePath = getInstalledPluginsFilePath(); try { - fs11.mkdirSync(getPluginsDirectory()); + fs5.mkdirSync(getPluginsDirectory()); const jsonContent = jsonStringify(data, null, 2); writeFileSync_DEPRECATED(filePath, jsonContent, { encoding: "utf-8", @@ -562702,10 +490116,10 @@ function saveInstalledPluginsV2(data) { }); installedPluginsCacheV2 = data; logForDebugging(`Saved ${Object.keys(data.plugins).length} installed plugins to ${filePath}`); - } catch (error46) { - const _errorMsg = errorMessage(error46); - logError2(toError(error46)); - throw error46; + } catch (error42) { + const _errorMsg = errorMessage(error42); + logError2(toError(error42)); + throw error42; } } function removePluginInstallation(pluginId, scope, projectPath) { @@ -562738,8 +490152,8 @@ function loadInstalledPluginsFromDisk() { return migrateV1ToV2(v1Data); } return { version: 2, plugins: {} }; - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to load installed plugins from disk: ${errorMsg}`, { level: "error" }); @@ -562776,8 +490190,8 @@ async function initializeVersionedPlugins() { migrateToSinglePluginFile(); try { await migrateFromEnabledPlugins(); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } const data = getInMemoryInstalledPlugins(); logForDebugging(`Initialized versioned plugins system with ${Object.keys(data.plugins).length} plugins`); @@ -562861,10 +490275,10 @@ async function getGitCommitSha(dirPath) { return sha ?? undefined; } function getPluginVersionFromManifest(pluginCachePath, pluginId) { - const fs11 = getFsImplementation(); - const manifestPath = join113(pluginCachePath, ".claude-plugin", "plugin.json"); + const fs5 = getFsImplementation(); + const manifestPath = join103(pluginCachePath, ".claude-plugin", "plugin.json"); try { - const manifestContent = fs11.readFileSync(manifestPath, { encoding: "utf-8" }); + const manifestContent = fs5.readFileSync(manifestPath, { encoding: "utf-8" }); const manifest = jsonParse(manifestContent); return manifest.version || "unknown"; } catch { @@ -562896,7 +490310,7 @@ async function migrateFromEnabledPlugins() { } } logForDebugging(fileExists ? "Syncing installed_plugins.json with enabledPlugins from all settings.json files" : "Creating installed_plugins.json from settings.json files"); - const now3 = new Date().toISOString(); + const now2 = new Date().toISOString(); const projectPath = getCwd(); const pluginScopeFromSettings = new Map; const settingSources = [ @@ -562935,7 +490349,7 @@ async function migrateFromEnabledPlugins() { } else { delete existingEntry.projectPath; } - existingEntry.lastUpdated = now3; + existingEntry.lastUpdated = now2; updatedCount++; logForDebugging(`Updated ${pluginId} scope to ${scopeInfo.scope} (settings.json is source of truth)`); } @@ -562956,13 +490370,13 @@ async function migrateFromEnabledPlugins() { let version3 = "unknown"; let gitCommitSha = undefined; if (typeof entry.source === "string") { - installPath = join113(marketplaceInstallLocation, entry.source); + installPath = join103(marketplaceInstallLocation, entry.source); version3 = getPluginVersionFromManifest(installPath, pluginId); gitCommitSha = await getGitCommitSha(installPath); } else { const cachePath = getPluginCachePath(); const sanitizedName = pluginName.replace(/[^a-zA-Z0-9-_]/g, "-"); - const pluginCachePath = join113(cachePath, sanitizedName); + const pluginCachePath = join103(cachePath, sanitizedName); let dirEntries; try { dirEntries = (await getFsImplementation().readdir(pluginCachePath)).map((e) => typeof e === "string" ? e : e.name); @@ -562989,8 +490403,8 @@ async function migrateFromEnabledPlugins() { scope: scopeInfo.scope, installPath: getVersionedCachePath(pluginId, version3), version: version3, - installedAt: now3, - lastUpdated: now3, + installedAt: now2, + lastUpdated: now2, gitCommitSha, ...scopeInfo.projectPath && { projectPath: scopeInfo.projectPath @@ -562999,8 +490413,8 @@ async function migrateFromEnabledPlugins() { ]; addedCount++; logForDebugging(`Added ${pluginId} with scope ${scopeInfo.scope}`); - } catch (error46) { - logForDebugging(`Failed to add plugin ${pluginId}: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to add plugin ${pluginId}: ${error42}`); } } } @@ -563051,7 +490465,7 @@ var init_managedPlugins = __esm(() => { }); // src/utils/plugins/pluginVersioning.ts -import { createHash as createHash21 } from "crypto"; +import { createHash as createHash20 } from "crypto"; async function calculatePluginVersion(pluginId, source, manifest, installPath, providedVersion, gitCommitSha) { if (manifest?.version) { logForDebugging(`Using manifest version for ${pluginId}: ${manifest.version}`); @@ -563065,7 +490479,7 @@ async function calculatePluginVersion(pluginId, source, manifest, installPath, p const shortSha = gitCommitSha.substring(0, 12); if (typeof source === "object" && source.source === "git-subdir") { const normPath = source.path.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, ""); - const pathHash = createHash21("sha256").update(normPath).digest("hex").substring(0, 8); + const pathHash = createHash20("sha256").update(normPath).digest("hex").substring(0, 8); const v = `${shortSha}-${pathHash}`; logForDebugging(`Using git-subdir SHA+path version for ${pluginId}: ${v} (path=${normPath})`); return v; @@ -563093,16 +490507,16 @@ var init_pluginVersioning = __esm(() => { }); // src/utils/plugins/pluginInstallationHelpers.ts -import { randomBytes as randomBytes11 } from "crypto"; -import { rename as rename5, rm as rm10 } from "fs/promises"; -import { dirname as dirname47, join as join114, resolve as resolve39, sep as sep28 } from "path"; +import { randomBytes as randomBytes10 } from "crypto"; +import { rename as rename5, rm as rm8 } from "fs/promises"; +import { dirname as dirname44, join as join104, resolve as resolve33, sep as sep25 } from "path"; function getCurrentTimestamp() { return new Date().toISOString(); } function validatePathWithinBase(basePath, relativePath) { - const resolvedPath = resolve39(basePath, relativePath); - const normalizedBase = resolve39(basePath) + sep28; - if (!resolvedPath.startsWith(normalizedBase) && resolvedPath !== resolve39(basePath)) { + const resolvedPath = resolve33(basePath, relativePath); + const normalizedBase = resolve33(basePath) + sep25; + if (!resolvedPath.startsWith(normalizedBase) && resolvedPath !== resolve33(basePath)) { throw new Error(`Path traversal detected: "${relativePath}" would escape the base directory`); } return resolvedPath; @@ -563114,19 +490528,19 @@ async function cacheAndRegisterPlugin(pluginId, entry, scope = "user", projectPa }); const pathForGitSha = localSourcePath || cacheResult.path; const gitCommitSha = cacheResult.gitCommitSha ?? await getGitCommitSha(pathForGitSha); - const now3 = getCurrentTimestamp(); + const now2 = getCurrentTimestamp(); const version3 = await calculatePluginVersion(pluginId, entry.source, cacheResult.manifest, pathForGitSha, entry.version, cacheResult.gitCommitSha); const versionedPath = getVersionedCachePath(pluginId, version3); let finalPath = cacheResult.path; if (cacheResult.path !== versionedPath) { - await getFsImplementation().mkdir(dirname47(versionedPath)); - await rm10(versionedPath, { recursive: true, force: true }); - const normalizedCachePath = cacheResult.path.endsWith(sep28) ? cacheResult.path : cacheResult.path + sep28; + await getFsImplementation().mkdir(dirname44(versionedPath)); + await rm8(versionedPath, { recursive: true, force: true }); + const normalizedCachePath = cacheResult.path.endsWith(sep25) ? cacheResult.path : cacheResult.path + sep25; const isSubdirectory = versionedPath.startsWith(normalizedCachePath); if (isSubdirectory) { - const tempPath = join114(dirname47(cacheResult.path), `.claude-plugin-temp-${Date.now()}-${randomBytes11(4).toString("hex")}`); + const tempPath = join104(dirname44(cacheResult.path), `.claude-plugin-temp-${Date.now()}-${randomBytes10(4).toString("hex")}`); await rename5(cacheResult.path, tempPath); - await getFsImplementation().mkdir(dirname47(versionedPath)); + await getFsImplementation().mkdir(dirname44(versionedPath)); await rename5(tempPath, versionedPath); } else { await rename5(cacheResult.path, versionedPath); @@ -563140,19 +490554,19 @@ async function cacheAndRegisterPlugin(pluginId, entry, scope = "user", projectPa } addInstalledPlugin(pluginId, { version: version3, - installedAt: now3, - lastUpdated: now3, + installedAt: now2, + lastUpdated: now2, installPath: finalPath, gitCommitSha }, scope, projectPath); return finalPath; } function registerPluginInstallation(info, scope = "user", projectPath) { - const now3 = getCurrentTimestamp(); + const now2 = getCurrentTimestamp(); addInstalledPlugin(info.pluginId, { version: info.version || "unknown", - installedAt: now3, - lastUpdated: now3, + installedAt: now2, + lastUpdated: now2, installPath: info.installPath }, scope, projectPath); } @@ -563221,17 +490635,17 @@ async function installResolvedPlugin({ const closureEnabled = {}; for (const id of resolution.closure) closureEnabled[id] = true; - const { error: error46 } = updateSettingsForSource(settingSource, { + const { error: error42 } = updateSettingsForSource(settingSource, { enabledPlugins: { ...getSettingsForSource(settingSource)?.enabledPlugins, ...closureEnabled } }); - if (error46) { + if (error42) { return { ok: false, reason: "settings-write-failed", - message: error46.message + message: error42.message }; } const projectPath = scope !== "user" ? getCwd() : undefined; @@ -563265,38 +490679,38 @@ async function installPluginFromMarketplace({ try { const pluginInfo = await getPluginById(pluginId); const marketplaceInstallLocation = pluginInfo?.marketplaceInstallLocation; - const result3 = await installResolvedPlugin({ + const result2 = await installResolvedPlugin({ pluginId, entry, scope, marketplaceInstallLocation }); - if (!result3.ok) { - switch (result3.reason) { + if (!result2.ok) { + switch (result2.reason) { case "local-source-no-location": return { success: false, - error: `Cannot install local plugin "${result3.pluginName}" without marketplace install location` + error: `Cannot install local plugin "${result2.pluginName}" without marketplace install location` }; case "settings-write-failed": return { success: false, - error: `Failed to update settings: ${result3.message}` + error: `Failed to update settings: ${result2.message}` }; case "resolution-failed": return { success: false, - error: formatResolutionError(result3.resolution) + error: formatResolutionError(result2.resolution) }; case "blocked-by-policy": return { success: false, - error: `Plugin "${result3.pluginName}" is blocked by your organization's policy and cannot be installed` + error: `Plugin "${result2.pluginName}" is blocked by your organization's policy and cannot be installed` }; case "dependency-blocked-by-policy": return { success: false, - error: `Cannot install "${result3.pluginName}": dependency "${result3.blockedDependency}" is blocked by your organization's policy` + error: `Cannot install "${result2.pluginName}": dependency "${result2.blockedDependency}" is blocked by your organization's policy` }; } } @@ -563313,11 +490727,11 @@ async function installPluginFromMarketplace({ }); return { success: true, - message: `✓ Installed ${entry.name}${result3.depNote}. Run /reload-plugins to activate.` + message: `✓ Installed ${entry.name}${result2.depNote}. Run /reload-plugins to activate.` }; - } catch (err3) { - const errorMessage2 = err3 instanceof Error ? err3.message : String(err3); - logError2(toError(err3)); + } catch (err2) { + const errorMessage2 = err2 instanceof Error ? err2.message : String(err2); + logError2(toError(err2)); return { success: false, error: `Failed to install: ${errorMessage2}` }; } } @@ -563344,27 +490758,27 @@ var init_pluginInstallationHelpers = __esm(() => { // src/utils/plugins/pluginLoader.ts import { - copyFile as copyFile8, + copyFile as copyFile7, readdir as readdir25, - readFile as readFile39, + readFile as readFile38, readlink as readlink2, realpath as realpath12, rename as rename6, - rm as rm11, + rm as rm9, rmdir as rmdir2, - stat as stat38, + stat as stat37, symlink as symlink3 } from "fs/promises"; -import { basename as basename34, dirname as dirname48, join as join115, relative as relative23, resolve as resolve40, sep as sep29 } from "path"; +import { basename as basename32, dirname as dirname45, join as join105, relative as relative21, resolve as resolve34, sep as sep26 } from "path"; function getPluginCachePath() { - return join115(getPluginsDirectory(), "cache"); + return join105(getPluginsDirectory(), "cache"); } function getVersionedCachePathIn(baseDir, pluginId, version3) { const { name: pluginName, marketplace } = parsePluginIdentifier(pluginId); const sanitizedMarketplace = (marketplace || "unknown").replace(/[^a-zA-Z0-9\-_]/g, "-"); const sanitizedPlugin = (pluginName || pluginId).replace(/[^a-zA-Z0-9\-_]/g, "-"); const sanitizedVersion = version3.replace(/[^a-zA-Z0-9\-_.]/g, "-"); - return join115(baseDir, "cache", sanitizedMarketplace, sanitizedPlugin, sanitizedVersion); + return join105(baseDir, "cache", sanitizedMarketplace, sanitizedPlugin, sanitizedVersion); } function getVersionedCachePath(pluginId, version3) { return getVersionedCachePathIn(getPluginsDirectory(), pluginId, version3); @@ -563385,12 +490799,12 @@ async function probeSeedCache(pluginId, version3) { } async function probeSeedCacheAnyVersion(pluginId) { for (const seedDir of getPluginSeedDirs()) { - const pluginDir = dirname48(getVersionedCachePathIn(seedDir, pluginId, "_")); + const pluginDir = dirname45(getVersionedCachePathIn(seedDir, pluginId, "_")); try { const versions3 = await readdir25(pluginDir); if (versions3.length !== 1) continue; - const versionDir = join115(pluginDir, versions3[0]); + const versionDir = join105(pluginDir, versions3[0]); const entries = await readdir25(versionDir); if (entries.length > 0) return versionDir; @@ -563402,12 +490816,12 @@ async function copyDir(src, dest) { await getFsImplementation().mkdir(dest); const entries = await readdir25(src, { withFileTypes: true }); for (const entry of entries) { - const srcPath = join115(src, entry.name); - const destPath = join115(dest, entry.name); + const srcPath = join105(src, entry.name); + const destPath = join105(dest, entry.name); if (entry.isDirectory()) { await copyDir(srcPath, destPath); } else if (entry.isFile()) { - await copyFile8(srcPath, destPath); + await copyFile7(srcPath, destPath); } else if (entry.isSymbolicLink()) { const linkTarget = await readlink2(srcPath); let resolvedTarget; @@ -563423,11 +490837,11 @@ async function copyDir(src, dest) { } catch { resolvedSrc = src; } - const srcPrefix = resolvedSrc.endsWith(sep29) ? resolvedSrc : resolvedSrc + sep29; + const srcPrefix = resolvedSrc.endsWith(sep26) ? resolvedSrc : resolvedSrc + sep26; if (resolvedTarget.startsWith(srcPrefix) || resolvedTarget === resolvedSrc) { - const targetRelativeToSrc = relative23(resolvedSrc, resolvedTarget); - const destTargetPath = join115(dest, targetRelativeToSrc); - const relativeLinkPath = relative23(dirname48(destPath), destTargetPath); + const targetRelativeToSrc = relative21(resolvedSrc, resolvedTarget); + const destTargetPath = join105(dest, targetRelativeToSrc); + const relativeLinkPath = relative21(dirname45(destPath), destTargetPath); await symlink3(relativeLinkPath, destPath); } else { await symlink3(resolvedTarget, destPath); @@ -563458,7 +490872,7 @@ async function copyPluginToVersionedCache(sourcePath, pluginId, version3, entry, logForDebugging(`Using seed cache for ${pluginId}@${version3} at ${seedPath}`); return seedPath; } - await getFsImplementation().mkdir(dirname48(cachePath)); + await getFsImplementation().mkdir(dirname45(cachePath)); if (entry && typeof entry.source === "string" && marketplaceDir) { const sourceDir = validatePathWithinBase(marketplaceDir, entry.source); logForDebugging(`Copying source directory ${entry.source} for plugin ${pluginId}`); @@ -563474,8 +490888,8 @@ async function copyPluginToVersionedCache(sourcePath, pluginId, version3, entry, logForDebugging(`Copying plugin ${pluginId} to versioned cache (fallback to full copy)`); await copyDir(sourcePath, cachePath); } - const gitPath = join115(cachePath, ".git"); - await rm11(gitPath, { recursive: true, force: true }); + const gitPath = join105(cachePath, ".git"); + await rm9(gitPath, { recursive: true, force: true }); const cacheEntries = await readdir25(cachePath); if (cacheEntries.length === 0) { throw new Error(`Failed to copy plugin ${pluginId} to versioned cache: destination is empty after copy`); @@ -563505,10 +490919,10 @@ function validateGitUrl(url3) { } } async function installFromNpm(packageName, targetPath, options2 = {}) { - const npmCachePath = join115(getPluginsDirectory(), "npm-cache"); + const npmCachePath = join105(getPluginsDirectory(), "npm-cache"); await getFsImplementation().mkdir(npmCachePath); const packageSpec = options2.version ? `${packageName}@${options2.version}` : packageName; - const packagePath = join115(npmCachePath, "node_modules", packageName); + const packagePath = join105(npmCachePath, "node_modules", packageName); const needsInstall = !await pathExists(packagePath); if (needsInstall) { logForDebugging(`Installing npm package ${packageSpec} to cache`); @@ -563516,9 +490930,9 @@ async function installFromNpm(packageName, targetPath, options2 = {}) { if (options2.registry) { args.push("--registry", options2.registry); } - const result3 = await execFileNoThrow("npm", args, { useCwd: false }); - if (result3.code !== 0) { - throw new Error(`Failed to install npm package: ${result3.stderr}`); + const result2 = await execFileNoThrow("npm", args, { useCwd: false }); + if (result2.code !== 0) { + throw new Error(`Failed to install npm package: ${result2.stderr}`); } } await copyDir(packagePath, targetPath); @@ -563653,7 +491067,7 @@ async function installFromGitSubdir(url3, targetPath, subdirPath, ref, sha) { logForDebugging(`Extracted subdir ${subdirPath} from ${gitUrl}${refMsg}${shaMsg} to ${targetPath}`); return resolvedSha; } finally { - await rm11(cloneDir, { recursive: true, force: true }); + await rm9(cloneDir, { recursive: true, force: true }); } } async function installFromLocal(sourcePath, targetPath) { @@ -563661,12 +491075,12 @@ async function installFromLocal(sourcePath, targetPath) { throw new Error(`Source path does not exist: ${sourcePath}`); } await copyDir(sourcePath, targetPath); - const gitPath = join115(targetPath, ".git"); - await rm11(gitPath, { recursive: true, force: true }); + const gitPath = join105(targetPath, ".git"); + await rm9(gitPath, { recursive: true, force: true }); } function generateTemporaryCacheNameForPlugin(source) { const timestamp2 = Date.now(); - const random4 = Math.random().toString(36).substring(2, 8); + const random3 = Math.random().toString(36).substring(2, 8); let prefix; if (typeof source === "string") { prefix = "local"; @@ -563691,13 +491105,13 @@ function generateTemporaryCacheNameForPlugin(source) { prefix = "unknown"; } } - return `temp_${prefix}_${timestamp2}_${random4}`; + return `temp_${prefix}_${timestamp2}_${random3}`; } async function cachePlugin(source, options2) { const cachePath = getPluginCachePath(); await getFsImplementation().mkdir(cachePath); const tempName = generateTemporaryCacheNameForPlugin(source); - const tempPath = join115(cachePath, tempName); + const tempPath = join105(cachePath, tempName); let shouldCleanup = false; let gitCommitSha; try { @@ -563728,41 +491142,41 @@ async function cachePlugin(source, options2) { throw new Error(`Unsupported plugin source type`); } } - } catch (error46) { + } catch (error42) { if (shouldCleanup && await pathExists(tempPath)) { logForDebugging(`Cleaning up failed installation at ${tempPath}`); try { - await rm11(tempPath, { recursive: true, force: true }); + await rm9(tempPath, { recursive: true, force: true }); } catch (cleanupError) { logForDebugging(`Failed to clean up installation: ${cleanupError}`, { level: "error" }); } } - throw error46; + throw error42; } - const manifestPath = join115(tempPath, ".claude-plugin", "plugin.json"); - const legacyManifestPath = join115(tempPath, "plugin.json"); + const manifestPath = join105(tempPath, ".claude-plugin", "plugin.json"); + const legacyManifestPath = join105(tempPath, "plugin.json"); let manifest; if (await pathExists(manifestPath)) { try { - const content = await readFile39(manifestPath, { encoding: "utf-8" }); + const content = await readFile38(manifestPath, { encoding: "utf-8" }); const parsed = jsonParse(content); - const result3 = PluginManifestSchema().safeParse(parsed); - if (result3.success) { - manifest = result3.data; + const result2 = PluginManifestSchema().safeParse(parsed); + if (result2.success) { + manifest = result2.data; } else { - const errors7 = result3.error.issues.map((err3) => `${err3.path.join(".")}: ${err3.message}`).join(", "); + const errors7 = result2.error.issues.map((err2) => `${err2.path.join(".")}: ${err2.message}`).join(", "); logForDebugging(`Invalid manifest at ${manifestPath}: ${errors7}`, { level: "error" }); throw new Error(`Plugin has an invalid manifest file at ${manifestPath}. Validation errors: ${errors7}`); } - } catch (error46) { - if (error46 instanceof Error && error46.message.includes("invalid manifest file")) { - throw error46; + } catch (error42) { + if (error42 instanceof Error && error42.message.includes("invalid manifest file")) { + throw error42; } - const errorMsg = errorMessage(error46); + const errorMsg = errorMessage(error42); logForDebugging(`Failed to parse manifest at ${manifestPath}: ${errorMsg}`, { level: "error" }); @@ -563770,23 +491184,23 @@ async function cachePlugin(source, options2) { } } else if (await pathExists(legacyManifestPath)) { try { - const content = await readFile39(legacyManifestPath, { + const content = await readFile38(legacyManifestPath, { encoding: "utf-8" }); const parsed = jsonParse(content); - const result3 = PluginManifestSchema().safeParse(parsed); - if (result3.success) { - manifest = result3.data; + const result2 = PluginManifestSchema().safeParse(parsed); + if (result2.success) { + manifest = result2.data; } else { - const errors7 = result3.error.issues.map((err3) => `${err3.path.join(".")}: ${err3.message}`).join(", "); + const errors7 = result2.error.issues.map((err2) => `${err2.path.join(".")}: ${err2.message}`).join(", "); logForDebugging(`Invalid legacy manifest at ${legacyManifestPath}: ${errors7}`, { level: "error" }); throw new Error(`Plugin has an invalid manifest file at ${legacyManifestPath}. Validation errors: ${errors7}`); } - } catch (error46) { - if (error46 instanceof Error && error46.message.includes("invalid manifest file")) { - throw error46; + } catch (error42) { + if (error42 instanceof Error && error42.message.includes("invalid manifest file")) { + throw error42; } - const errorMsg = errorMessage(error46); + const errorMsg = errorMessage(error42); logForDebugging(`Failed to parse legacy manifest at ${legacyManifestPath}: ${errorMsg}`, { level: "error" }); @@ -563799,10 +491213,10 @@ async function cachePlugin(source, options2) { }; } const finalName = manifest.name.replace(/[^a-zA-Z0-9-_]/g, "-"); - const finalPath = join115(cachePath, finalName); + const finalPath = join105(cachePath, finalName); if (await pathExists(finalPath)) { logForDebugging(`Removing old cached version at ${finalPath}`); - await rm11(finalPath, { recursive: true, force: true }); + await rm9(finalPath, { recursive: true, force: true }); } await rename6(tempPath, finalPath); logForDebugging(`Successfully cached plugin ${manifest.name} to ${finalPath}`); @@ -563820,22 +491234,22 @@ async function loadPluginManifest(manifestPath, pluginName, source) { }; } try { - const content = await readFile39(manifestPath, { encoding: "utf-8" }); + const content = await readFile38(manifestPath, { encoding: "utf-8" }); const parsedJson = jsonParse(content); - const result3 = PluginManifestSchema().safeParse(parsedJson); - if (result3.success) { - return result3.data; + const result2 = PluginManifestSchema().safeParse(parsedJson); + if (result2.success) { + return result2.data; } - const errors7 = result3.error.issues.map((err3) => err3.path.length > 0 ? `${err3.path.join(".")}: ${err3.message}` : err3.message).join(", "); + const errors7 = result2.error.issues.map((err2) => err2.path.length > 0 ? `${err2.path.join(".")}: ${err2.message}` : err2.message).join(", "); logForDebugging(`Plugin ${pluginName} has an invalid manifest file at ${manifestPath}. Validation errors: ${errors7}`, { level: "error" }); throw new Error(`Plugin ${pluginName} has an invalid manifest file at ${manifestPath}. Validation errors: ${errors7}`); - } catch (error46) { - if (error46 instanceof Error && error46.message.includes("invalid manifest file")) { - throw error46; + } catch (error42) { + if (error42 instanceof Error && error42.message.includes("invalid manifest file")) { + throw error42; } - const errorMsg = errorMessage(error46); + const errorMsg = errorMessage(error42); logForDebugging(`Plugin ${pluginName} has a corrupt manifest file at ${manifestPath}. Parse error: ${errorMsg}`, { level: "error" }); throw new Error(`Plugin ${pluginName} has a corrupt manifest file at ${manifestPath}. @@ -563846,14 +491260,14 @@ async function loadPluginHooks2(hooksConfigPath, pluginName) { if (!await pathExists(hooksConfigPath)) { throw new Error(`Hooks file not found at ${hooksConfigPath} for plugin ${pluginName}. If the manifest declares hooks, the file must exist.`); } - const content = await readFile39(hooksConfigPath, { encoding: "utf-8" }); + const content = await readFile38(hooksConfigPath, { encoding: "utf-8" }); const rawHooksConfig = jsonParse(content); const validatedPluginHooks = PluginHooksSchema().parse(rawHooksConfig); return validatedPluginHooks.hooks; } async function validatePluginPaths(relPaths, pluginPath, pluginName, source, component, componentLabel, contextLabel, errors7) { const checks7 = await Promise.all(relPaths.map(async (relPath) => { - const fullPath = join115(pluginPath, relPath); + const fullPath = join105(pluginPath, relPath); return { relPath, fullPath, exists: await pathExists(fullPath) }; })); const validPaths = []; @@ -563876,7 +491290,7 @@ async function validatePluginPaths(relPaths, pluginPath, pluginName, source, com } async function createPluginFromPath(pluginPath, source, enabled, fallbackName, strict = true) { const errors7 = []; - const manifestPath = join115(pluginPath, ".claude-plugin", "plugin.json"); + const manifestPath = join105(pluginPath, ".claude-plugin", "plugin.json"); const manifest = await loadPluginManifest(manifestPath, fallbackName, source); const plugin = { name: manifest.name, @@ -563892,12 +491306,12 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s skillsDirExists, outputStylesDirExists ] = await Promise.all([ - !manifest.commands ? pathExists(join115(pluginPath, "commands")) : false, - !manifest.agents ? pathExists(join115(pluginPath, "agents")) : false, - !manifest.skills ? pathExists(join115(pluginPath, "skills")) : false, - !manifest.outputStyles ? pathExists(join115(pluginPath, "output-styles")) : false + !manifest.commands ? pathExists(join105(pluginPath, "commands")) : false, + !manifest.agents ? pathExists(join105(pluginPath, "agents")) : false, + !manifest.skills ? pathExists(join105(pluginPath, "skills")) : false, + !manifest.outputStyles ? pathExists(join105(pluginPath, "output-styles")) : false ]); - const commandsPath = join115(pluginPath, "commands"); + const commandsPath = join105(pluginPath, "commands"); if (commandsDirExists) { plugin.commandsPath = commandsPath; } @@ -563912,7 +491326,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s return { commandName, metadata, kind: "skip" }; } if (metadata.source) { - const fullPath = join115(pluginPath, metadata.source); + const fullPath = join105(pluginPath, metadata.source); return { commandName, metadata, @@ -563960,7 +491374,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s if (typeof cmdPath !== "string") { return { cmdPath, kind: "invalid" }; } - const fullPath = join115(pluginPath, cmdPath); + const fullPath = join105(pluginPath, cmdPath); return { cmdPath, kind: "path", @@ -563993,7 +491407,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s } } } - const agentsPath = join115(pluginPath, "agents"); + const agentsPath = join105(pluginPath, "agents"); if (agentsDirExists) { plugin.agentsPath = agentsPath; } @@ -564004,7 +491418,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s plugin.agentsPaths = validPaths; } } - const skillsPath = join115(pluginPath, "skills"); + const skillsPath = join105(pluginPath, "skills"); if (skillsDirExists) { plugin.skillsPath = skillsPath; } @@ -564015,7 +491429,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s plugin.skillsPaths = validPaths; } } - const outputStylesPath = join115(pluginPath, "output-styles"); + const outputStylesPath = join105(pluginPath, "output-styles"); if (outputStylesDirExists) { plugin.outputStylesPath = outputStylesPath; } @@ -564028,7 +491442,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s } let mergedHooks; const loadedHookPaths = new Set; - const standardHooksPath = join115(pluginPath, "hooks", "hooks.json"); + const standardHooksPath = join105(pluginPath, "hooks", "hooks.json"); if (await pathExists(standardHooksPath)) { try { mergedHooks = await loadPluginHooks2(standardHooksPath, manifest.name); @@ -564038,12 +491452,12 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s loadedHookPaths.add(standardHooksPath); } logForDebugging(`Loaded hooks from standard location for plugin ${manifest.name}: ${standardHooksPath}`); - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to load hooks for ${manifest.name}: ${errorMsg}`, { level: "error" }); - logError2(toError(error46)); + logError2(toError(error42)); errors7.push({ type: "hook-load-failed", source, @@ -564057,7 +491471,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s const manifestHooksArray = Array.isArray(manifest.hooks) ? manifest.hooks : [manifest.hooks]; for (const hookSpec of manifestHooksArray) { if (typeof hookSpec === "string") { - const hookFilePath = join115(pluginPath, hookSpec); + const hookFilePath = join105(pluginPath, hookSpec); if (!await pathExists(hookFilePath)) { logForDebugging(`Hooks file ${hookSpec} specified in manifest but not found at ${hookFilePath} for ${manifest.name}`, { level: "error" }); logError2(new Error(`Plugin component file not found: ${hookFilePath} for ${manifest.name}`)); @@ -564109,10 +491523,10 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s reason: `Failed to merge: ${mergeErrorMsg}` }); } - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to load hooks from ${hookSpec} for ${manifest.name}: ${errorMsg}`, { level: "error" }); - logError2(toError(error46)); + logError2(toError(error42)); errors7.push({ type: "hook-load-failed", source, @@ -564136,20 +491550,20 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s return { plugin, errors: errors7 }; } function parsePluginSettings(raw) { - const result3 = PluginSettingsSchema().safeParse(raw); - if (!result3.success) { + const result2 = PluginSettingsSchema().safeParse(raw); + if (!result2.success) { return; } - const data = result3.data; + const data = result2.data; if (Object.keys(data).length === 0) { return; } return data; } async function loadPluginSettings(pluginPath, manifest) { - const settingsJsonPath = join115(pluginPath, "settings.json"); + const settingsJsonPath = join105(pluginPath, "settings.json"); try { - const content = await readFile39(settingsJsonPath, { encoding: "utf-8" }); + const content = await readFile38(settingsJsonPath, { encoding: "utf-8" }); const parsed = jsonParse(content); if (isRecord(parsed)) { const filtered = parsePluginSettings(parsed); @@ -564243,20 +491657,20 @@ async function loadPluginsFromMarketplaces({ }); return null; } - let result3 = null; + let result2 = null; const marketplace = marketplaceCatalogs.get(marketplaceName); if (marketplace && marketplaceConfig) { const entry = marketplace.plugins.find((p) => p.name === pluginName); if (entry) { - result3 = { + result2 = { entry, marketplaceInstallLocation: marketplaceConfig.installLocation }; } } else { - result3 = await getPluginByIdCacheOnly(pluginId); + result2 = await getPluginByIdCacheOnly(pluginId); } - if (!result3) { + if (!result2) { errors7.push({ type: "plugin-not-found", source: pluginId, @@ -564266,20 +491680,20 @@ async function loadPluginsFromMarketplaces({ return null; } const installEntry = installedPluginsData.plugins[pluginId]?.[0]; - return cacheOnly ? loadPluginFromMarketplaceEntryCacheOnly(result3.entry, result3.marketplaceInstallLocation, pluginId, enabledValue === true, errors7, installEntry?.installPath) : loadPluginFromMarketplaceEntry(result3.entry, result3.marketplaceInstallLocation, pluginId, enabledValue === true, errors7, installEntry?.version); + return cacheOnly ? loadPluginFromMarketplaceEntryCacheOnly(result2.entry, result2.marketplaceInstallLocation, pluginId, enabledValue === true, errors7, installEntry?.installPath) : loadPluginFromMarketplaceEntry(result2.entry, result2.marketplaceInstallLocation, pluginId, enabledValue === true, errors7, installEntry?.version); })); - for (const [i4, result3] of results.entries()) { - if (result3.status === "fulfilled" && result3.value) { - plugins.push(result3.value); - } else if (result3.status === "rejected") { - const err3 = toError(result3.reason); - logError2(err3); - const pluginId = marketplacePluginEntries[i4][0]; + for (const [i3, result2] of results.entries()) { + if (result2.status === "fulfilled" && result2.value) { + plugins.push(result2.value); + } else if (result2.status === "rejected") { + const err2 = toError(result2.reason); + logError2(err2); + const pluginId = marketplacePluginEntries[i3][0]; errors7.push({ type: "generic-error", source: pluginId, plugin: pluginId.split("@")[0], - error: err3.message + error: err2.message }); } } @@ -564290,7 +491704,7 @@ async function loadPluginFromMarketplaceEntryCacheOnly(entry, marketplaceInstall if (typeof entry.source === "string") { let marketplaceDir; try { - marketplaceDir = (await stat38(marketplaceInstallLocation)).isDirectory() ? marketplaceInstallLocation : join115(marketplaceInstallLocation, ".."); + marketplaceDir = (await stat37(marketplaceInstallLocation)).isDirectory() ? marketplaceInstallLocation : join105(marketplaceInstallLocation, ".."); } catch { errorsOut.push({ type: "plugin-cache-miss", @@ -564300,7 +491714,7 @@ async function loadPluginFromMarketplaceEntryCacheOnly(entry, marketplaceInstall }); return null; } - pluginPath = join115(marketplaceDir, entry.source); + pluginPath = join105(marketplaceDir, entry.source); } else { if (!installPath || !await pathExists(installPath)) { errorsOut.push({ @@ -564315,12 +491729,12 @@ async function loadPluginFromMarketplaceEntryCacheOnly(entry, marketplaceInstall } if (isPluginZipCacheEnabled() && pluginPath.endsWith(".zip")) { const sessionDir = await getSessionPluginCachePath(); - const extractDir = join115(sessionDir, pluginId.replace(/[^a-zA-Z0-9@\-_]/g, "-")); + const extractDir = join105(sessionDir, pluginId.replace(/[^a-zA-Z0-9@\-_]/g, "-")); try { await extractZipToDirectory(pluginPath, extractDir); pluginPath = extractDir; - } catch (error46) { - logForDebugging(`Failed to extract plugin ZIP ${pluginPath}: ${error46}`, { + } catch (error42) { + logForDebugging(`Failed to extract plugin ZIP ${pluginPath}: ${error42}`, { level: "error" }); errorsOut.push({ @@ -564338,14 +491752,14 @@ async function loadPluginFromMarketplaceEntry(entry, marketplaceInstallLocation, logForDebugging(`Loading plugin ${entry.name} from source: ${jsonStringify(entry.source)}`); let pluginPath; if (typeof entry.source === "string") { - const marketplaceDir = (await stat38(marketplaceInstallLocation)).isDirectory() ? marketplaceInstallLocation : join115(marketplaceInstallLocation, ".."); - const sourcePluginPath = join115(marketplaceDir, entry.source); + const marketplaceDir = (await stat37(marketplaceInstallLocation)).isDirectory() ? marketplaceInstallLocation : join105(marketplaceInstallLocation, ".."); + const sourcePluginPath = join105(marketplaceDir, entry.source); if (!await pathExists(sourcePluginPath)) { - const error46 = new Error(`Plugin path not found: ${sourcePluginPath}`); + const error42 = new Error(`Plugin path not found: ${sourcePluginPath}`); logForDebugging(`Plugin path not found: ${sourcePluginPath}`, { level: "error" }); - logError2(error46); + logError2(error42); errorsOut.push({ type: "generic-error", source: pluginId, @@ -564354,7 +491768,7 @@ async function loadPluginFromMarketplaceEntry(entry, marketplaceInstallLocation, return null; } try { - const manifestPath = join115(sourcePluginPath, ".claude-plugin", "plugin.json"); + const manifestPath = join105(sourcePluginPath, ".claude-plugin", "plugin.json"); let pluginManifest; try { pluginManifest = await loadPluginManifest(manifestPath, entry.name, entry.source); @@ -564362,8 +491776,8 @@ async function loadPluginFromMarketplaceEntry(entry, marketplaceInstallLocation, const version3 = await calculatePluginVersion(pluginId, entry.source, pluginManifest, marketplaceDir, entry.version); pluginPath = await copyPluginToVersionedCache(sourcePluginPath, pluginId, version3, entry, marketplaceDir); logForDebugging(`Resolved local plugin ${entry.name} to versioned cache: ${pluginPath}`); - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to copy plugin ${entry.name} to versioned cache: ${errorMsg}. Using marketplace path.`, { level: "warn" }); pluginPath = sourcePluginPath; } @@ -564390,16 +491804,16 @@ async function loadPluginFromMarketplaceEntry(entry, marketplaceInstallLocation, const actualVersion = version3 !== "unknown" ? version3 : await calculatePluginVersion(pluginId, entry.source, cached6.manifest, cached6.path, installedVersion ?? entry.version, cached6.gitCommitSha); pluginPath = await copyPluginToVersionedCache(cached6.path, pluginId, actualVersion, entry, undefined); if (cached6.path !== pluginPath) { - await rm11(cached6.path, { recursive: true, force: true }); + await rm9(cached6.path, { recursive: true, force: true }); } } } - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to cache plugin ${entry.name}: ${errorMsg}`, { level: "error" }); - logError2(toError(error46)); + logError2(toError(error42)); errorsOut.push({ type: "generic-error", source: pluginId, @@ -564410,22 +491824,22 @@ async function loadPluginFromMarketplaceEntry(entry, marketplaceInstallLocation, } if (isPluginZipCacheEnabled() && pluginPath.endsWith(".zip")) { const sessionDir = await getSessionPluginCachePath(); - const extractDir = join115(sessionDir, pluginId.replace(/[^a-zA-Z0-9@\-_]/g, "-")); + const extractDir = join105(sessionDir, pluginId.replace(/[^a-zA-Z0-9@\-_]/g, "-")); try { await extractZipToDirectory(pluginPath, extractDir); logForDebugging(`Extracted plugin ZIP to session dir: ${extractDir}`); pluginPath = extractDir; - } catch (error46) { - logForDebugging(`Failed to extract plugin ZIP ${pluginPath}, deleting corrupt file: ${error46}`); - await rm11(pluginPath, { force: true }).catch(() => {}); - throw error46; + } catch (error42) { + logForDebugging(`Failed to extract plugin ZIP ${pluginPath}, deleting corrupt file: ${error42}`); + await rm9(pluginPath, { force: true }).catch(() => {}); + throw error42; } } return finishLoadingPluginFromPath(entry, pluginId, enabled, errorsOut, pluginPath); } async function finishLoadingPluginFromPath(entry, pluginId, enabled, errorsOut, pluginPath) { const errors7 = []; - const manifestPath = join115(pluginPath, ".claude-plugin", "plugin.json"); + const manifestPath = join105(pluginPath, ".claude-plugin", "plugin.json"); const hasManifest = await pathExists(manifestPath); const { plugin, errors: pluginErrors } = await createPluginFromPath(pluginPath, pluginId, enabled, entry.name, entry.strict ?? true); errors7.push(...pluginErrors); @@ -564450,7 +491864,7 @@ async function finishLoadingPluginFromPath(entry, pluginId, enabled, errorsOut, if (!metadata || typeof metadata !== "object" || !metadata.source) { return { commandName, metadata, skip: true }; } - const fullPath = join115(pluginPath, metadata.source); + const fullPath = join105(pluginPath, metadata.source); return { commandName, metadata, @@ -564487,7 +491901,7 @@ async function finishLoadingPluginFromPath(entry, pluginId, enabled, errorsOut, if (typeof cmdPath !== "string") { return { cmdPath, kind: "invalid" }; } - const fullPath = join115(pluginPath, cmdPath); + const fullPath = join105(pluginPath, cmdPath); return { cmdPath, kind: "path", @@ -564531,7 +491945,7 @@ async function finishLoadingPluginFromPath(entry, pluginId, enabled, errorsOut, logForDebugging(`Processing ${Array.isArray(entry.skills) ? entry.skills.length : 1} skill paths for plugin ${entry.name}`); const skillPaths = Array.isArray(entry.skills) ? entry.skills : [entry.skills]; const checks7 = await Promise.all(skillPaths.map(async (skillPath) => { - const fullPath = join115(pluginPath, skillPath); + const fullPath = join105(pluginPath, skillPath); return { skillPath, fullPath, exists: await pathExists(fullPath) }; })); const validPaths = []; @@ -564569,9 +491983,9 @@ async function finishLoadingPluginFromPath(entry, pluginId, enabled, errorsOut, plugin.hooksConfig = entry.hooks; } } else if (!entry.strict && hasManifest && (entry.commands || entry.agents || entry.skills || entry.hooks || entry.outputStyles)) { - const error46 = new Error(`Plugin ${entry.name} has both plugin.json and marketplace manifest entries for commands/agents/skills/hooks/outputStyles. This is a conflict.`); + const error42 = new Error(`Plugin ${entry.name} has both plugin.json and marketplace manifest entries for commands/agents/skills/hooks/outputStyles. This is a conflict.`); logForDebugging(`Plugin ${entry.name} has both plugin.json and marketplace manifest entries for commands/agents/skills/hooks/outputStyles. This is a conflict.`, { level: "error" }); - logError2(error46); + logError2(error42); errorsOut.push({ type: "generic-error", source: pluginId, @@ -564591,7 +492005,7 @@ async function finishLoadingPluginFromPath(entry, pluginId, enabled, errorsOut, if (!metadata || typeof metadata !== "object" || !metadata.source) { return { commandName, metadata, skip: true }; } - const fullPath = join115(pluginPath, metadata.source); + const fullPath = join105(pluginPath, metadata.source); return { commandName, metadata, @@ -564631,7 +492045,7 @@ async function finishLoadingPluginFromPath(entry, pluginId, enabled, errorsOut, if (typeof cmdPath !== "string") { return { cmdPath, kind: "invalid" }; } - const fullPath = join115(pluginPath, cmdPath); + const fullPath = join105(pluginPath, cmdPath); return { cmdPath, kind: "path", @@ -564709,7 +492123,7 @@ async function loadSessionOnlyPlugins(sessionPluginPaths) { const errors7 = []; for (const [index, pluginPath] of sessionPluginPaths.entries()) { try { - const resolvedPath = resolve40(pluginPath); + const resolvedPath = resolve34(pluginPath); if (!await pathExists(resolvedPath)) { logForDebugging(`Plugin path does not exist: ${resolvedPath}, skipping`, { level: "warn" }); errors7.push({ @@ -564720,15 +492134,15 @@ async function loadSessionOnlyPlugins(sessionPluginPaths) { }); continue; } - const dirName = basename34(resolvedPath); + const dirName = basename32(resolvedPath); const { plugin, errors: pluginErrors } = await createPluginFromPath(resolvedPath, `${dirName}@inline`, true, dirName); plugin.source = `${plugin.name}@inline`; plugin.repository = `${plugin.name}@inline`; plugins.push(plugin); errors7.push(...pluginErrors); logForDebugging(`Loaded inline plugin from path: ${plugin.name}`); - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to load session plugin from ${pluginPath}: ${errorMsg}`, { level: "warn" }); errors7.push({ type: "generic-error", @@ -564879,9 +492293,9 @@ var init_pluginLoader = __esm(() => { agent: true }).strip()); loadAllPlugins = memoize_default(async () => { - const result3 = await assemblePluginLoadResult(() => loadPluginsFromMarketplaces({ cacheOnly: false })); - loadAllPluginsCacheOnly.cache?.set(undefined, Promise.resolve(result3)); - return result3; + const result2 = await assemblePluginLoadResult(() => loadPluginsFromMarketplaces({ cacheOnly: false })); + loadAllPluginsCacheOnly.cache?.set(undefined, Promise.resolve(result2)); + return result2; }); loadAllPluginsCacheOnly = memoize_default(async () => { if (isEnvTruthy(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)) { @@ -564892,7 +492306,7 @@ var init_pluginLoader = __esm(() => { }); // src/utils/plugins/loadPluginOutputStyles.ts -import { basename as basename35 } from "path"; +import { basename as basename33 } from "path"; async function loadOutputStylesFromDirectory(outputStylesPath, pluginName, loadedPaths) { const styles5 = []; await walkPluginMarkdown(outputStylesPath, async (fullPath) => { @@ -564903,14 +492317,14 @@ async function loadOutputStylesFromDirectory(outputStylesPath, pluginName, loade return styles5; } async function loadOutputStyleFromFile(filePath, pluginName, loadedPaths) { - const fs11 = getFsImplementation(); - if (isDuplicatePath(fs11, filePath, loadedPaths)) { + const fs5 = getFsImplementation(); + if (isDuplicatePath(fs5, filePath, loadedPaths)) { return null; } try { - const content = await fs11.readFile(filePath, { encoding: "utf-8" }); + const content = await fs5.readFile(filePath, { encoding: "utf-8" }); const { frontmatter, content: markdownContent } = parseFrontmatter(content, filePath); - const fileName = basename35(filePath, ".md"); + const fileName = basename33(filePath, ".md"); const baseStyleName = frontmatter.name || fileName; const name = `${pluginName}:${baseStyleName}`; const description = coerceDescriptionToString(frontmatter.description, name) ?? extractDescriptionFromMarkdown(markdownContent, `Output style from ${pluginName} plugin`); @@ -564923,8 +492337,8 @@ async function loadOutputStyleFromFile(filePath, pluginName, loadedPaths) { source: "plugin", forceForPlugin }; - } catch (error46) { - logForDebugging(`Failed to load output style from ${filePath}: ${error46}`, { + } catch (error42) { + logForDebugging(`Failed to load output style from ${filePath}: ${error42}`, { level: "error" }); return null; @@ -564957,15 +492371,15 @@ var init_loadPluginOutputStyles = __esm(() => { if (styles5.length > 0) { logForDebugging(`Loaded ${styles5.length} output styles from plugin ${plugin.name} default directory`); } - } catch (error46) { - logForDebugging(`Failed to load output styles from plugin ${plugin.name} default directory: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to load output styles from plugin ${plugin.name} default directory: ${error42}`, { level: "error" }); } } if (plugin.outputStylesPaths) { for (const stylePath of plugin.outputStylesPaths) { try { - const fs11 = getFsImplementation(); - const stats = await fs11.stat(stylePath); + const fs5 = getFsImplementation(); + const stats = await fs5.stat(stylePath); if (stats.isDirectory()) { const styles5 = await loadOutputStylesFromDirectory(stylePath, plugin.name, loadedPaths); allStyles.push(...styles5); @@ -564979,8 +492393,8 @@ var init_loadPluginOutputStyles = __esm(() => { logForDebugging(`Loaded output style from plugin ${plugin.name} custom file: ${stylePath}`); } } - } catch (error46) { - logForDebugging(`Failed to load output styles from plugin ${plugin.name} custom path ${stylePath}: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to load output styles from plugin ${plugin.name} custom path ${stylePath}: ${error42}`, { level: "error" }); } } } @@ -564991,7 +492405,7 @@ var init_loadPluginOutputStyles = __esm(() => { }); // src/outputStyles/loadOutputStylesDir.ts -import { basename as basename36 } from "path"; +import { basename as basename34 } from "path"; var getOutputStyleDirStyles; var init_loadOutputStylesDir = __esm(() => { init_memoize(); @@ -565005,7 +492419,7 @@ var init_loadOutputStylesDir = __esm(() => { const markdownFiles = await loadMarkdownFilesForSubdir("output-styles", cwd2); const styles5 = markdownFiles.map(({ filePath, frontmatter, content, source }) => { try { - const fileName = basename36(filePath); + const fileName = basename34(filePath); const styleName = fileName.replace(/\.md$/, ""); const name = frontmatter["name"] || styleName; const description = coerceDescriptionToString(frontmatter["description"], styleName) ?? extractDescriptionFromMarkdown(content, `Custom ${styleName} output style`); @@ -565021,14 +492435,14 @@ var init_loadOutputStylesDir = __esm(() => { source, keepCodingInstructions }; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return null; } }).filter((style) => style !== null); return styles5; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return []; } }); @@ -565200,8 +492614,8 @@ function withMemoryCorrectionHint(message) { } return message; } -function deriveShortMessageId(uuid8) { - const hex = uuid8.replace(/-/g, "").slice(0, 10); +function deriveShortMessageId(uuid5) { + const hex = uuid5.replace(/-/g, "").slice(0, 10); return parseInt(hex, 16).toString(36).slice(0, 6); } function AUTO_REJECT_MESSAGE(toolName) { @@ -565231,8 +492645,8 @@ function getLastAssistantMessage(messages) { return messages.findLast((msg) => msg.type === "assistant"); } function hasToolCallsInLastAssistantTurn(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message && message.type === "assistant") { const assistantMessage = message; const content = assistantMessage.message.content; @@ -565247,7 +492661,7 @@ function baseCreateAssistantMessage({ content, isApiErrorMessage = false, apiError, - error: error46, + error: error42, errorDetails, isVirtual, usage = { @@ -565284,7 +492698,7 @@ function baseCreateAssistantMessage({ }, requestId: undefined, apiError, - error: error46, + error: error42, errorDetails, isApiErrorMessage, isVirtual @@ -565309,7 +492723,7 @@ function createAssistantMessage({ function createAssistantAPIErrorMessage({ content, apiError, - error: error46, + error: error42, errorDetails }) { return baseCreateAssistantMessage({ @@ -565321,7 +492735,7 @@ function createAssistantAPIErrorMessage({ ], isApiErrorMessage: true, apiError, - error: error46, + error: error42, errorDetails }); } @@ -565334,7 +492748,7 @@ function createUserMessage({ summarizeMetadata, toolUseResult, mcpMeta, - uuid: uuid8, + uuid: uuid5, timestamp: timestamp2, imagePasteIds, sourceToolAssistantUUID, @@ -565352,7 +492766,7 @@ function createUserMessage({ isVirtual, isCompactSummary, summarizeMetadata, - uuid: uuid8 || randomUUID26(), + uuid: uuid5 || randomUUID26(), timestamp: timestamp2 ?? new Date().toISOString(), toolUseResult, mcpMeta, @@ -565492,7 +492906,7 @@ function normalizeMessages(messages) { case "assistant": { isNewChain = isNewChain || message.message.content.length > 1; return message.message.content.map((_, index) => { - const uuid8 = isNewChain ? deriveUUID(message.uuid, index) : message.uuid; + const uuid5 = isNewChain ? deriveUUID(message.uuid, index) : message.uuid; return { type: "assistant", timestamp: message.timestamp, @@ -565504,7 +492918,7 @@ function normalizeMessages(messages) { isMeta: message.isMeta, isVirtual: message.isVirtual, requestId: message.requestId, - uuid: uuid8, + uuid: uuid5, error: message.error, isApiErrorMessage: message.isApiErrorMessage, advisorModel: message.advisorModel @@ -565519,11 +492933,11 @@ function normalizeMessages(messages) { return [message]; case "user": { if (typeof message.message.content === "string") { - const uuid8 = isNewChain ? deriveUUID(message.uuid, 0) : message.uuid; + const uuid5 = isNewChain ? deriveUUID(message.uuid, 0) : message.uuid; return [ { ...message, - uuid: uuid8, + uuid: uuid5, message: { ...message.message, content: [{ type: "text", text: message.message.content }] @@ -565621,7 +493035,7 @@ function reorderMessagesInUI(messages, syntheticStreamingToolUseMessages) { continue; } } - const result3 = []; + const result2 = []; const processedToolUses = new Set; for (const message of messages) { if (isToolUseRequestMessage(message)) { @@ -565630,12 +493044,12 @@ function reorderMessagesInUI(messages, syntheticStreamingToolUseMessages) { processedToolUses.add(toolUseID); const group = toolUseGroups.get(toolUseID); if (group && group.toolUse) { - result3.push(group.toolUse); - result3.push(...group.preHooks); + result2.push(group.toolUse); + result2.push(...group.preHooks); if (group.toolResult) { - result3.push(group.toolResult); + result2.push(group.toolResult); } - result3.push(...group.postHooks); + result2.push(...group.postHooks); } } continue; @@ -565647,21 +493061,21 @@ function reorderMessagesInUI(messages, syntheticStreamingToolUseMessages) { continue; } if (message.type === "system" && message.subtype === "api_error") { - const last4 = result3.at(-1); - if (last4?.type === "system" && last4.subtype === "api_error") { - result3[result3.length - 1] = message; + const last3 = result2.at(-1); + if (last3?.type === "system" && last3.subtype === "api_error") { + result2[result2.length - 1] = message; } else { - result3.push(message); + result2.push(message); } continue; } - result3.push(message); + result2.push(message); } for (const message of syntheticStreamingToolUseMessages) { - result3.push(message); + result2.push(message); } - const last3 = result3.at(-1); - return result3.filter((_) => _.type !== "system" || _.subtype !== "api_error" || _ === last3); + const last2 = result2.at(-1); + return result2.filter((_) => _.type !== "system" || _.subtype !== "api_error" || _ === last2); } function isHookAttachmentMessage(message) { return message.type === "attachment" && (message.attachment.type === "hook_blocking_error" || message.attachment.type === "hook_cancelled" || message.attachment.type === "hook_error_during_execution" || message.attachment.type === "hook_non_blocking_error" || message.attachment.type === "hook_success" || message.attachment.type === "hook_system_message" || message.attachment.type === "hook_additional_context" || message.attachment.type === "hook_stopped_continuation"); @@ -565733,9 +493147,9 @@ function buildMessageLookups(normalizedMessages, messages) { resolvedToolUseIDs.add(content.tool_use_id); } if (content.type === "advisor_tool_result") { - const result3 = content; - if (result3.content.type === "advisor_tool_result_error") { - erroredToolUseIDs.add(result3.tool_use_id); + const result2 = content; + if (result2.content.type === "advisor_tool_result_error") { + erroredToolUseIDs.add(result2.tool_use_id); } } } @@ -565853,30 +493267,30 @@ function getToolUseIDs(normalizedMessages) { return new Set(normalizedMessages.filter((_) => _.type === "assistant" && Array.isArray(_.message.content) && _.message.content[0]?.type === "tool_use").map((_) => _.message.content[0].id)); } function reorderAttachmentsForAPI(messages) { - const result3 = []; + const result2 = []; const pendingAttachments = []; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message.type === "attachment") { pendingAttachments.push(message); } else { const isStoppingPoint = message.type === "assistant" || message.type === "user" && Array.isArray(message.message.content) && message.message.content[0]?.type === "tool_result"; if (isStoppingPoint && pendingAttachments.length > 0) { for (let j = 0;j < pendingAttachments.length; j++) { - result3.push(pendingAttachments[j]); + result2.push(pendingAttachments[j]); } - result3.push(message); + result2.push(message); pendingAttachments.length = 0; } else { - result3.push(message); + result2.push(message); } } } for (let j = 0;j < pendingAttachments.length; j++) { - result3.push(pendingAttachments[j]); + result2.push(pendingAttachments[j]); } - result3.reverse(); - return result3; + result2.reverse(); + return result2; } function isSystemLocalCommandMessage(message) { return message.type === "system" && message.subtype === "local_command"; @@ -565955,9 +493369,9 @@ function appendMessageTagToUserMessage2(message) { return message; } let lastTextIdx = -1; - for (let i4 = content.length - 1;i4 >= 0; i4--) { - if (content[i4].type === "text") { - lastTextIdx = i4; + for (let i3 = content.length - 1;i3 >= 0; i3--) { + if (content[i3].type === "text") { + lastTextIdx = i3; break; } } @@ -566127,9 +493541,9 @@ function sanitizeErrorToolResultContent(messages) { }); } function relocateToolReferenceSiblings(messages) { - const result3 = [...messages]; - for (let i4 = 0;i4 < result3.length; i4++) { - const msg = result3[i4]; + const result2 = [...messages]; + for (let i3 = 0;i3 < result2.length; i3++) { + const msg = result2[i3]; if (msg.type !== "user") continue; const content = msg.message.content; @@ -566141,8 +493555,8 @@ function relocateToolReferenceSiblings(messages) { if (textSiblings.length === 0) continue; let targetIdx = -1; - for (let j = i4 + 1;j < result3.length; j++) { - const cand = result3[j]; + for (let j = i3 + 1;j < result2.length; j++) { + const cand = result2[j]; if (cand.type !== "user") continue; const cc = cand.message.content; @@ -566157,15 +493571,15 @@ function relocateToolReferenceSiblings(messages) { } if (targetIdx === -1) continue; - result3[i4] = { + result2[i3] = { ...msg, message: { ...msg.message, content: content.filter((b) => b.type !== "text") } }; - const target = result3[targetIdx]; - result3[targetIdx] = { + const target = result2[targetIdx]; + result2[targetIdx] = { ...target, message: { ...target.message, @@ -566176,7 +493590,7 @@ function relocateToolReferenceSiblings(messages) { } }; } - return result3; + return result2; } function normalizeMessagesForAPI(messages, tools = []) { const availableToolNames = new Set(tools.map((t) => t.name)); @@ -566189,8 +493603,8 @@ function normalizeMessagesForAPI(messages, tools = []) { [getRequestTooLargeErrorMessage()]: new Set(["document", "image"]) }; const stripTargets = new Map; - for (let i4 = 0;i4 < reorderedMessages.length; i4++) { - const msg = reorderedMessages[i4]; + for (let i3 = 0;i3 < reorderedMessages.length; i3++) { + const msg = reorderedMessages[i3]; if (!isSyntheticApiErrorMessage(msg)) { continue; } @@ -566202,7 +493616,7 @@ function normalizeMessagesForAPI(messages, tools = []) { if (!blockTypesToStrip) { continue; } - for (let j = i4 - 1;j >= 0; j--) { + for (let j = i3 - 1;j >= 0; j--) { const candidate = reorderedMessages[j]; if (candidate.type === "user" && candidate.isMeta) { const existing = stripTargets.get(candidate.uuid); @@ -566221,7 +493635,7 @@ function normalizeMessagesForAPI(messages, tools = []) { break; } } - const result3 = []; + const result2 = []; reorderedMessages.filter((_) => { if (_.type === "progress" || _.type === "system" && !isSystemLocalCommandMessage(_) || isSyntheticApiErrorMessage(_)) { return false; @@ -566235,12 +493649,12 @@ function normalizeMessagesForAPI(messages, tools = []) { uuid: message.uuid, timestamp: message.timestamp }); - const lastMessage = last_default(result3); + const lastMessage = last_default(result2); if (lastMessage?.type === "user") { - result3[result3.length - 1] = mergeUserMessages(lastMessage, userMsg); + result2[result2.length - 1] = mergeUserMessages(lastMessage, userMsg); return; } - result3.push(userMsg); + result2.push(userMsg); return; } case "user": { @@ -566284,12 +493698,12 @@ function normalizeMessagesForAPI(messages, tools = []) { }; } } - const lastMessage = last_default(result3); + const lastMessage = last_default(result2); if (lastMessage?.type === "user") { - result3[result3.length - 1] = mergeUserMessages(lastMessage, normalizedMessage); + result2[result2.length - 1] = mergeUserMessages(lastMessage, normalizedMessage); return; } - result3.push(normalizedMessage); + result2.push(normalizedMessage); return; } case "assistant": { @@ -566321,36 +493735,36 @@ function normalizeMessagesForAPI(messages, tools = []) { }) } }; - for (let i4 = result3.length - 1;i4 >= 0; i4--) { - const msg = result3[i4]; + for (let i3 = result2.length - 1;i3 >= 0; i3--) { + const msg = result2[i3]; if (msg.type !== "assistant" && !isToolResultMessage(msg)) { break; } if (msg.type === "assistant") { if (msg.message.id === normalizedMessage.message.id) { - result3[i4] = mergeAssistantMessages(msg, normalizedMessage); + result2[i3] = mergeAssistantMessages(msg, normalizedMessage); return; } continue; } } - result3.push(normalizedMessage); + result2.push(normalizedMessage); return; } case "attachment": { const rawAttachmentMessage = normalizeAttachmentForAPI(message.attachment); const attachmentMessage = checkStatsigFeatureGate_CACHED_MAY_BE_STALE("tengu_chair_sermon") ? rawAttachmentMessage.map(ensureSystemReminderWrap) : rawAttachmentMessage; - const lastMessage = last_default(result3); + const lastMessage = last_default(result2); if (lastMessage?.type === "user") { - result3[result3.length - 1] = attachmentMessage.reduce((p, c6) => mergeUserMessagesAndToolResults(p, c6), lastMessage); + result2[result2.length - 1] = attachmentMessage.reduce((p, c6) => mergeUserMessagesAndToolResults(p, c6), lastMessage); return; } - result3.push(...attachmentMessage); + result2.push(...attachmentMessage); return; } } }); - const relocated = checkStatsigFeatureGate_CACHED_MAY_BE_STALE("tengu_toolref_defer_j8m") ? relocateToolReferenceSiblings(result3) : result3; + const relocated = checkStatsigFeatureGate_CACHED_MAY_BE_STALE("tengu_toolref_defer_j8m") ? relocateToolReferenceSiblings(result2) : result2; const withFilteredOrphans = filterOrphanedThinkingOnlyMessages(relocated); const withFilteredThinking = filterTrailingThinkingFromLastAssistant(withFilteredOrphans); const withFilteredWhitespace = filterWhitespaceOnlyAssistantMessages(withFilteredThinking); @@ -566360,9 +493774,9 @@ function normalizeMessagesForAPI(messages, tools = []) { if (feature("HISTORY_SNIP") && true) { const { isSnipRuntimeEnabled: isSnipRuntimeEnabled2 } = (init_snipCompact(), __toCommonJS(exports_snipCompact)); if (isSnipRuntimeEnabled2()) { - for (let i4 = 0;i4 < sanitized.length; i4++) { - if (sanitized[i4].type === "user") { - sanitized[i4] = appendMessageTagToUserMessage2(sanitized[i4]); + for (let i3 = 0;i3 < sanitized.length; i3++) { + if (sanitized[i3].type === "user") { + sanitized[i3] = appendMessageTagToUserMessage2(sanitized[i3]); } } } @@ -566513,15 +493927,15 @@ function mergeUserContentBlocks(a2, b) { return [...a2, ...b]; } if (!checkStatsigFeatureGate_CACHED_MAY_BE_STALE("tengu_chair_sermon")) { - if (typeof lastBlock.content === "string" && b.every((x4) => x4.type === "text")) { + if (typeof lastBlock.content === "string" && b.every((x3) => x3.type === "text")) { const copy = a2.slice(); copy[copy.length - 1] = smooshIntoToolResult(lastBlock, b); return copy; } return [...a2, ...b]; } - const toSmoosh = b.filter((x4) => x4.type !== "tool_result"); - const toolResults = b.filter((x4) => x4.type === "tool_result"); + const toSmoosh = b.filter((x3) => x3.type !== "tool_result"); + const toolResults = b.filter((x3) => x3.type === "tool_result"); if (toSmoosh.length === 0) { return [...a2, ...b]; } @@ -566562,8 +493976,8 @@ function normalizeContentFromAPI(contentBlocks, tools, agentId) { if (tool) { try { normalizedInput = normalizeToolInput(tool, normalizedInput, agentId); - } catch (error46) { - logError2(new Error("Error normalizing tool input: " + error46)); + } catch (error42) { + logError2(new Error("Error normalizing tool input: " + error42)); } } } @@ -566597,8 +494011,8 @@ function normalizeContentFromAPI(contentBlocks, tools, agentId) { } }); } -function isEmptyMessageText(text2) { - return stripPromptXMLTags(text2).trim() === "" || text2.trim() === NO_CONTENT_MESSAGE; +function isEmptyMessageText(text) { + return stripPromptXMLTags(text).trim() === "" || text.trim() === NO_CONTENT_MESSAGE; } function stripPromptXMLTags(content) { return content.replace(STRIPPED_TAGS_RE, "").trim(); @@ -566798,7 +494212,7 @@ function handleMessageFromStream(message, onMessage2, onUpdateLength, onSetStrea case "text_delta": { const deltaText = message.event.delta.text; onUpdateLength(deltaText); - onStreamingText?.((text2) => (text2 ?? "") + deltaText); + onStreamingText?.((text) => (text ?? "") + deltaText); return; } case "input_json_delta": { @@ -567788,14 +495202,14 @@ ${attachment.removedNames.join(` } function createToolResultMessage(tool, toolUseResult) { try { - const result3 = tool.mapToolResultToToolResultBlockParam(toolUseResult, "1"); - if (Array.isArray(result3.content) && result3.content.some((block2) => block2.type === "image")) { + const result2 = tool.mapToolResultToToolResultBlockParam(toolUseResult, "1"); + if (Array.isArray(result2.content) && result2.content.some((block2) => block2.type === "image")) { return createUserMessage({ - content: result3.content, + content: result2.content, isMeta: true }); } - const contentStr = typeof result3.content === "string" ? result3.content : jsonStringify(result3.content); + const contentStr = typeof result2.content === "string" ? result2.content : jsonStringify(result2.content); return createUserMessage({ content: `Result of calling the ${tool.name} tool: ${contentStr}`, @@ -567808,9 +495222,9 @@ ${contentStr}`, }); } } -function createToolUseMessage(toolName, input11) { +function createToolUseMessage(toolName, input) { return createUserMessage({ - content: `Called the ${toolName} tool with the following input: ${jsonStringify(input11)}`, + content: `Called the ${toolName} tool with the following input: ${jsonStringify(input)}`, isMeta: true }); } @@ -567972,13 +495386,13 @@ function createMicrocompactBoundaryMessage(trigger, preTokens, tokensSaved, comp } }; } -function createSystemAPIErrorMessage(error46, retryInMs, retryAttempt, maxRetries) { +function createSystemAPIErrorMessage(error42, retryInMs, retryAttempt, maxRetries) { return { type: "system", subtype: "api_error", level: "error", - cause: error46.cause instanceof Error ? error46.cause : undefined, - error: error46, + cause: error42.cause instanceof Error ? error42.cause : undefined, + error: error42, retryInMs, retryAttempt, maxRetries, @@ -567990,10 +495404,10 @@ function isCompactBoundaryMessage(message) { return message?.type === "system" && message.subtype === "compact_boundary"; } function findLastCompactBoundaryIndex(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const message = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const message = messages[i3]; if (message && isCompactBoundaryMessage(message)) { - return i4; + return i3; } } return -1; @@ -568045,8 +495459,8 @@ function countToolCalls(messages, toolName, maxCount) { } function hasSuccessfulToolCall(messages, toolName) { let mostRecentToolUseId; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const msg = messages[i3]; if (!msg) continue; if (msg.type === "assistant" && Array.isArray(msg.message.content)) { @@ -568059,8 +495473,8 @@ function hasSuccessfulToolCall(messages, toolName) { } if (!mostRecentToolUseId) return false; - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const msg = messages[i3]; if (!msg) continue; if (msg.type === "user" && Array.isArray(msg.message.content)) { @@ -568099,15 +495513,15 @@ function filterTrailingThinkingFromLastAssistant(messages) { remainingBlocks: lastValidIndex + 1 }); const filteredContent = lastValidIndex < 0 ? [{ type: "text", text: "[No message content]", citations: [] }] : content.slice(0, lastValidIndex + 1); - const result3 = [...messages]; - result3[messages.length - 1] = { + const result2 = [...messages]; + result2[messages.length - 1] = { ...lastMessage, message: { ...lastMessage.message, content: filteredContent } }; - return result3; + return result2; } function hasOnlyWhitespaceTextContent(content) { if (content.length === 0) { @@ -568161,7 +495575,7 @@ function ensureNonEmptyAssistantContent(messages) { return messages; } let hasChanges = false; - const result3 = messages.map((message, index) => { + const result2 = messages.map((message, index) => { if (message.type !== "assistant") { return message; } @@ -568187,7 +495601,7 @@ function ensureNonEmptyAssistantContent(messages) { } return message; }); - return hasChanges ? result3 : messages; + return hasChanges ? result2 : messages; } function filterOrphanedThinkingOnlyMessages(messages) { const messageIdsWithNonThinkingContent = new Set; @@ -568228,7 +495642,7 @@ function filterOrphanedThinkingOnlyMessages(messages) { } function stripSignatureBlocks(messages) { let changed = false; - const result3 = messages.map((msg) => { + const result2 = messages.map((msg) => { if (msg.type !== "assistant") return msg; const content = msg.message.content; @@ -568251,7 +495665,7 @@ function stripSignatureBlocks(messages) { message: { ...msg.message, content: filtered } }; }); - return changed ? result3 : messages; + return changed ? result2 : messages; } function createToolUseSummaryMessage(summary, precedingToolUseIds) { return { @@ -568263,24 +495677,24 @@ function createToolUseSummaryMessage(summary, precedingToolUseIds) { }; } function ensureToolResultPairing(messages) { - const result3 = []; + const result2 = []; let repaired = false; const allSeenToolUseIds = new Set; - for (let i4 = 0;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = 0;i3 < messages.length; i3++) { + const msg = messages[i3]; if (msg.type !== "assistant") { - if (msg.type === "user" && Array.isArray(msg.message.content) && result3.at(-1)?.type !== "assistant") { + if (msg.type === "user" && Array.isArray(msg.message.content) && result2.at(-1)?.type !== "assistant") { const stripped = msg.message.content.filter((block2) => !(typeof block2 === "object" && ("type" in block2) && block2.type === "tool_result")); if (stripped.length !== msg.message.content.length) { repaired = true; - const content = stripped.length > 0 ? stripped : result3.length === 0 ? [ + const content = stripped.length > 0 ? stripped : result2.length === 0 ? [ { type: "text", text: "[Orphaned tool result removed due to conversation resume]" } ] : null; if (content !== null) { - result3.push({ + result2.push({ ...msg, message: { ...msg.message, content } }); @@ -568288,7 +495702,7 @@ function ensureToolResultPairing(messages) { continue; } } - result3.push(msg); + result2.push(msg); continue; } const serverResultIds = new Set; @@ -568325,9 +495739,9 @@ function ensureToolResultPairing(messages) { ...msg, message: { ...msg.message, content: finalContent } } : msg; - result3.push(assistantMsg); + result2.push(assistantMsg); const toolUseIds = [...seenToolUseIds]; - const nextMsg = messages[i4 + 1]; + const nextMsg = messages[i3 + 1]; const existingToolResultIds = new Set; let hasDuplicateToolResults = false; if (nextMsg?.type === "user") { @@ -568383,18 +495797,18 @@ function ensureToolResultPairing(messages) { content: patchedContent } }; - i4++; - result3.push(checkStatsigFeatureGate_CACHED_MAY_BE_STALE("tengu_chair_sermon") ? smooshSystemReminderSiblings([patchedNext])[0] : patchedNext); + i3++; + result2.push(checkStatsigFeatureGate_CACHED_MAY_BE_STALE("tengu_chair_sermon") ? smooshSystemReminderSiblings([patchedNext])[0] : patchedNext); } else { - i4++; - result3.push(createUserMessage({ + i3++; + result2.push(createUserMessage({ content: NO_CONTENT_MESSAGE, isMeta: true })); } } else { if (syntheticBlocks.length > 0) { - result3.push(createUserMessage({ + result2.push(createUserMessage({ content: syntheticBlocks, isMeta: true })); @@ -568428,16 +495842,16 @@ function ensureToolResultPairing(messages) { } logEvent("tengu_tool_result_pairing_repaired", { messageCount: messages.length, - repairedMessageCount: result3.length, + repairedMessageCount: result2.length, messageTypes: messageTypes.join("; ") }); - logError2(new Error(`ensureToolResultPairing: repaired missing tool_result blocks (${messages.length} -> ${result3.length} messages). Message structure: ${messageTypes.join("; ")}`)); + logError2(new Error(`ensureToolResultPairing: repaired missing tool_result blocks (${messages.length} -> ${result2.length} messages). Message structure: ${messageTypes.join("; ")}`)); } - return result3; + return result2; } function stripAdvisorBlocks(messages) { let changed = false; - const result3 = messages.map((msg) => { + const result2 = messages.map((msg) => { if (msg.type !== "assistant") return msg; const content = msg.message.content; @@ -568454,7 +495868,7 @@ function stripAdvisorBlocks(messages) { } return { ...msg, message: { ...msg.message, content: filtered } }; }); - return changed ? result3 : messages; + return changed ? result2 : messages; } function wrapCommandText(raw, origin2) { switch (origin2?.kind) { @@ -568514,7 +495928,7 @@ Goal: Write your final plan to the plan file (the only file you can edit). - Reference existing functions to reuse, with file:line - End with the single verification command - **Hard limit: 40 lines.** If the plan is longer, delete prose — not file paths.`; -var init_messages5 = __esm(() => { +var init_messages3 = __esm(() => { init_bun_bundle(); init_isObject(); init_last(); @@ -568524,7 +495938,7 @@ var init_messages5 = __esm(() => { init_outputStyles(); init_paths(); init_growthbook(); - init_errors7(); + init_errors6(); init_advisor(); init_agentSwarmsEnabled(); init_attachments2(); @@ -568766,11 +496180,11 @@ function MessageActionsBar(t0) { T0 = ThemedBox_default; t1 = 2; t2 = 1; - t3 = applicable.map((a_0, i4) => { + t3 = applicable.map((a_0, i3) => { const label = typeof a_0.label === "function" ? a_0.label(cursor) : a_0.label; return /* @__PURE__ */ jsx_dev_runtime152.jsxDEV(import_react82.default.Fragment, { children: [ - i4 > 0 && /* @__PURE__ */ jsx_dev_runtime152.jsxDEV(ThemedText, { + i3 > 0 && /* @__PURE__ */ jsx_dev_runtime152.jsxDEV(ThemedText, { dimColor: true, children: " · " }, undefined, false, undefined, this), @@ -568898,9 +496312,9 @@ function MessageActionsBar(t0) { } return t14; } -function stripSystemReminders(text2) { +function stripSystemReminders(text) { const CLOSE = ""; - let t = text2.trimStart(); + let t = text.trimStart(); while (t.startsWith("")) { const end = t.indexOf(CLOSE); if (end < 0) @@ -568956,10 +496370,10 @@ function toolResultText(r) { return c6; if (!c6) return ""; - return c6.flatMap((x4) => x4.type === "text" ? [x4.text] : []).join(` + return c6.flatMap((x3) => x3.type === "text" ? [x3.text] : []).join(` `); } -var import_compiler_runtime120, import_react82, jsx_dev_runtime152, NAVIGABLE_TYPES, str = (k) => (i4) => typeof i4[k] === "string" ? i4[k] : undefined, PRIMARY_INPUT, MESSAGE_ACTIONS, MessageActionsSelectedContext, InVirtualListContext; +var import_compiler_runtime120, import_react82, jsx_dev_runtime152, NAVIGABLE_TYPES, str = (k) => (i3) => typeof i3[k] === "string" ? i3[k] : undefined, PRIMARY_INPUT, MESSAGE_ACTIONS, MessageActionsSelectedContext, InVirtualListContext; var init_messageActions = __esm(() => { import_compiler_runtime120 = __toESM(require_compiler_runtime(), 1); init_figures(); @@ -568967,7 +496381,7 @@ var init_messageActions = __esm(() => { init_ink2(); init_useKeybinding(); init_analytics(); - init_messages5(); + init_messages3(); jsx_dev_runtime152 = __toESM(require_jsx_dev_runtime(), 1); NAVIGABLE_TYPES = ["user", "assistant", "grouped_tool_use", "collapsed_read_search", "system", "attachment"]; PRIMARY_INPUT = { @@ -569017,7 +496431,7 @@ var init_messageActions = __esm(() => { }, Tmux: { label: "command", - extract: (i4) => Array.isArray(i4.args) ? `tmux ${i4.args.join(" ")}` : undefined + extract: (i3) => Array.isArray(i3.args) ? `tmux ${i3.args.join(" ")}` : undefined } }; MESSAGE_ACTIONS = [action({ @@ -569117,8 +496531,8 @@ var init_CtrlOToExpand = __esm(() => { }); // src/utils/terminal.ts -function wrapText5(text2, wrapWidth) { - const lines = text2.split(` +function wrapText5(text, wrapWidth) { + const lines = text.split(` `); const wrappedLines = []; for (const line of lines) { @@ -569128,8 +496542,8 @@ function wrapText5(text2, wrapWidth) { } else { let position = 0; while (position < visibleWidth) { - const chunk3 = sliceAnsi(line, position, position + wrapWidth); - wrappedLines.push(chunk3.trimEnd()); + const chunk2 = sliceAnsi(line, position, position + wrapWidth); + wrappedLines.push(chunk2.trimEnd()); position += wrapWidth; } } @@ -569167,7 +496581,7 @@ function renderTruncatedContent(content, terminalWidth, suppressExpandHint = fal } function isOutputLineTruncated(content) { let pos = 0; - for (let i4 = 0;i4 <= MAX_LINES_TO_SHOW; i4++) { + for (let i3 = 0;i3 <= MAX_LINES_TO_SHOW; i3++) { pos = content.indexOf(` `, pos); if (pos === -1) @@ -569203,8 +496617,8 @@ Parameters: `; // src/tools/ListMcpResourcesTool/UI.tsx -function renderToolUseMessage27(input11) { - return input11.server ? `List MCP resources from server "${input11.server}"` : `List all MCP resources`; +function renderToolUseMessage27(input) { + return input.server ? `List MCP resources from server "${input.server}"` : `List all MCP resources`; } function renderToolResultMessage25(output, _progressMessagesForMessage, { verbose @@ -569237,7 +496651,7 @@ var init_UI26 = __esm(() => { var inputSchema40, outputSchema34, ListMcpResourcesTool; var init_ListMcpResourcesTool = __esm(() => { init_v4(); - init_client10(); + init_client6(); init_Tool(); init_errors(); init_log3(); @@ -569261,8 +496675,8 @@ var init_ListMcpResourcesTool = __esm(() => { isReadOnly() { return true; }, - toAutoClassifierInput(input11) { - return input11.server ?? ""; + toAutoClassifierInput(input) { + return input.server ?? ""; }, shouldDefer: true, name: LIST_MCP_RESOURCES_TOOL_NAME, @@ -569280,20 +496694,20 @@ var init_ListMcpResourcesTool = __esm(() => { get outputSchema() { return outputSchema34(); }, - async call(input11, { options: { mcpClients } }) { - const { server: targetServer } = input11; - const clientsToProcess = targetServer ? mcpClients.filter((client5) => client5.name === targetServer) : mcpClients; + async call(input, { options: { mcpClients } }) { + const { server: targetServer } = input; + const clientsToProcess = targetServer ? mcpClients.filter((client2) => client2.name === targetServer) : mcpClients; if (targetServer && clientsToProcess.length === 0) { throw new Error(`Server "${targetServer}" not found. Available servers: ${mcpClients.map((c6) => c6.name).join(", ")}`); } - const results = await Promise.all(clientsToProcess.map(async (client5) => { - if (client5.type !== "connected") + const results = await Promise.all(clientsToProcess.map(async (client2) => { + if (client2.type !== "connected") return []; try { - const fresh = await ensureConnectedClient(client5); + const fresh = await ensureConnectedClient(client2); return await fetchResourcesForClient(fresh); - } catch (error46) { - logMCPError(client5.name, errorMessage(error46)); + } catch (error42) { + logMCPError(client2.name, errorMessage(error42)); return []; } })); @@ -569453,7 +496867,7 @@ function truncateString(content, maxChars) { return content.slice(0, maxChars); } async function truncateContentBlocks(blocks, maxChars) { - const result3 = []; + const result2 = []; let currentChars = 0; for (const block2 of blocks) { if (isTextBlock(block2)) { @@ -569461,16 +496875,16 @@ async function truncateContentBlocks(blocks, maxChars) { if (remainingChars <= 0) break; if (block2.text.length <= remainingChars) { - result3.push(block2); + result2.push(block2); currentChars += block2.text.length; } else { - result3.push({ type: "text", text: block2.text.slice(0, remainingChars) }); + result2.push({ type: "text", text: block2.text.slice(0, remainingChars) }); break; } } else if (isImageBlock(block2)) { const imageChars = IMAGE_TOKEN_ESTIMATE * 4; if (currentChars + imageChars <= maxChars) { - result3.push(block2); + result2.push(block2); currentChars += imageChars; } else { const remainingChars = maxChars - currentChars; @@ -569478,7 +496892,7 @@ async function truncateContentBlocks(blocks, maxChars) { const remainingBytes = Math.floor(remainingChars * 0.75); try { const compressedBlock = await compressImageBlock(block2, remainingBytes); - result3.push(compressedBlock); + result2.push(compressedBlock); if (compressedBlock.source.type === "base64") { currentChars += compressedBlock.source.data.length; } else { @@ -569488,10 +496902,10 @@ async function truncateContentBlocks(blocks, maxChars) { } } } else { - result3.push(block2); + result2.push(block2); } } - return result3; + return result2; } async function mcpContentNeedsTruncation(content) { if (!content) @@ -569504,8 +496918,8 @@ async function mcpContentNeedsTruncation(content) { const messages = typeof content === "string" ? [{ role: "user", content }] : [{ role: "user", content }]; const tokenCount = await countMessagesTokensWithAPI(messages, []); return !!(tokenCount && tokenCount > getMaxMcpOutputTokens()); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return false; } } @@ -569537,13 +496951,13 @@ var init_mcpValidation = __esm(() => { }); // src/tools/MCPTool/UI.tsx -function renderToolUseMessage28(input11, { +function renderToolUseMessage28(input, { verbose }) { - if (Object.keys(input11).length === 0) { + if (Object.keys(input).length === 0) { return ""; } - return Object.entries(input11).map(([key, value]) => { + return Object.entries(input).map(([key, value]) => { let rendered = jsonStringify(value); if (feature("MCP_RICH_OUTPUT") && !verbose && rendered.length > MAX_INPUT_VALUE_CHARS) { rendered = rendered.slice(0, MAX_INPUT_VALUE_CHARS).trimEnd() + "…"; @@ -569618,11 +497032,11 @@ function renderToolUseProgressMessage8(progressMessagesForMessage) { } function renderToolResultMessage26(output, _progressMessagesForMessage, { verbose, - input: input11 + input }) { const mcpOutput = output; if (!verbose) { - const slackSend = trySlackSendCompact(mcpOutput, input11); + const slackSend = trySlackSendCompact(mcpOutput, input); if (slackSend !== null) { return /* @__PURE__ */ jsx_dev_runtime156.jsxDEV(MessageResponse, { height: 1, @@ -569643,7 +497057,7 @@ function renderToolResultMessage26(output, _progressMessagesForMessage, { const warningMessage = showWarning ? `${figures_default.warning} Large MCP response (~${formatNumber(estimatedTokens)} tokens), this can fill up context quickly` : null; let contentElement; if (Array.isArray(mcpOutput)) { - const contentBlocks = mcpOutput.map((item, i4) => { + const contentBlocks = mcpOutput.map((item, i3) => { if (item.type === "image") { return /* @__PURE__ */ jsx_dev_runtime156.jsxDEV(ThemedBox_default, { justifyContent: "space-between", @@ -569655,16 +497069,16 @@ function renderToolResultMessage26(output, _progressMessagesForMessage, { children: "[Image]" }, undefined, false, undefined, this) }, undefined, false, undefined, this) - }, i4, false, undefined, this); + }, i3, false, undefined, this); } const textContent = item.type === "text" && "text" in item && item.text !== null && item.text !== undefined ? String(item.text) : ""; return feature("MCP_RICH_OUTPUT") ? /* @__PURE__ */ jsx_dev_runtime156.jsxDEV(MCPTextOutput, { content: textContent, verbose - }, i4, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime156.jsxDEV(OutputLine, { + }, i3, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime156.jsxDEV(OutputLine, { content: textContent, verbose - }, i4, false, undefined, this); + }, i3, false, undefined, this); }); contentElement = /* @__PURE__ */ jsx_dev_runtime156.jsxDEV(ThemedBox_default, { flexDirection: "column", @@ -569778,7 +497192,7 @@ function MCPTextOutput(t0) { const maxKeyWidth = Math.max(...flat.map(_temp212)); let t32; if ($2[11] !== maxKeyWidth) { - t32 = (t42, i4) => { + t32 = (t42, i3) => { const [key, value] = t42; return /* @__PURE__ */ jsx_dev_runtime156.jsxDEV(ThemedText, { children: [ @@ -569793,7 +497207,7 @@ function MCPTextOutput(t0) { children: linkifyUrlsInText(value) }, undefined, false, undefined, this) ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); }; $2[11] = maxKeyWidth; $2[12] = t32; @@ -569879,22 +497293,22 @@ function tryFlattenJson(content) { }); if (entries === null) return null; - const result3 = []; + const result2 = []; for (const [key, value] of entries) { if (typeof value === "string") { - result3.push([key, value]); + result2.push([key, value]); } else if (value === null || typeof value === "number" || typeof value === "boolean") { - result3.push([key, String(value)]); + result2.push([key, String(value)]); } else if (typeof value === "object") { - const compact3 = jsonStringify(value); - if (compact3.length > 120) + const compact2 = jsonStringify(value); + if (compact2.length > 120) return null; - result3.push([key, compact3]); + result2.push([key, compact2]); } else { return null; } } - return result3; + return result2; } function tryUnwrapTextPayload(content) { const entries = parseJsonEntries(content, { @@ -569932,16 +497346,16 @@ function tryUnwrapTextPayload(content) { extras }; } -function trySlackSendCompact(output, input11) { - let text2 = output; +function trySlackSendCompact(output, input) { + let text = output; if (Array.isArray(output)) { const block2 = output.find((b) => b.type === "text"); - text2 = block2 && "text" in block2 ? block2.text : undefined; + text = block2 && "text" in block2 ? block2.text : undefined; } - if (typeof text2 !== "string" || !text2.includes('"message_link"')) { + if (typeof text !== "string" || !text.includes('"message_link"')) { return null; } - const entries = parseJsonEntries(text2, { + const entries = parseJsonEntries(text, { maxChars: 2000, maxKeys: 6 }); @@ -569951,7 +497365,7 @@ function trySlackSendCompact(output, input11) { const m = SLACK_ARCHIVES_RE.exec(url3); if (!m) return null; - const inp = input11; + const inp = input; const raw = inp?.channel_id ?? inp?.channel ?? m[1]; const label = typeof raw === "string" && raw ? raw : "slack"; return { @@ -570390,27 +497804,27 @@ var require_default2 = __commonJS((exports) => { }); // node_modules/cssfilter/lib/util.js -var require_util16 = __commonJS((exports, module) => { +var require_util14 = __commonJS((exports, module) => { module.exports = { indexOf: function(arr, item) { - var i4, j; + var i3, j; if (Array.prototype.indexOf) { return arr.indexOf(item); } - for (i4 = 0, j = arr.length;i4 < j; i4++) { - if (arr[i4] === item) { - return i4; + for (i3 = 0, j = arr.length;i3 < j; i3++) { + if (arr[i3] === item) { + return i3; } } return -1; }, forEach: function(arr, fn, scope) { - var i4, j; + var i3, j; if (Array.prototype.forEach) { return arr.forEach(fn, scope); } - for (i4 = 0, j = arr.length;i4 < j; i4++) { - fn.call(scope, arr[i4], i4, arr); + for (i3 = 0, j = arr.length;i3 < j; i3++) { + fn.call(scope, arr[i3], i3, arr); } }, trim: function(str2) { @@ -570430,7 +497844,7 @@ var require_util16 = __commonJS((exports, module) => { // node_modules/cssfilter/lib/parser.js var require_parser4 = __commonJS((exports, module) => { - var _ = require_util16(); + var _ = require_util14(); function parseStyle(css, onAttr) { css = _.trimRight(css); if (css[css.length - 1] !== ";") @@ -570438,11 +497852,11 @@ var require_parser4 = __commonJS((exports, module) => { var cssLength = css.length; var isParenthesisOpen = false; var lastPos = 0; - var i4 = 0; + var i3 = 0; var retCSS = ""; function addNewAttr() { if (!isParenthesisOpen) { - var source = _.trim(css.slice(lastPos, i4)); + var source = _.trim(css.slice(lastPos, i3)); var j2 = source.indexOf(":"); if (j2 !== -1) { var name = _.trim(source.slice(0, j2)); @@ -570454,16 +497868,16 @@ var require_parser4 = __commonJS((exports, module) => { } } } - lastPos = i4 + 1; + lastPos = i3 + 1; } - for (;i4 < cssLength; i4++) { - var c6 = css[i4]; - if (c6 === "/" && css[i4 + 1] === "*") { - var j = css.indexOf("*/", i4 + 2); + for (;i3 < cssLength; i3++) { + var c6 = css[i3]; + if (c6 === "/" && css[i3 + 1] === "*") { + var j = css.indexOf("*/", i3 + 2); if (j === -1) break; - i4 = j + 1; - lastPos = i4 + 1; + i3 = j + 1; + lastPos = i3 + 1; isParenthesisOpen = false; } else if (c6 === "(") { isParenthesisOpen = true; @@ -570487,14 +497901,14 @@ var require_parser4 = __commonJS((exports, module) => { var require_css3 = __commonJS((exports, module) => { var DEFAULT = require_default2(); var parseStyle = require_parser4(); - var _ = require_util16(); - function isNull3(obj) { + var _ = require_util14(); + function isNull2(obj) { return obj === undefined || obj === null; } function shallowCopyObject(obj) { var ret = {}; - for (var i4 in obj) { - ret[i4] = obj[i4]; + for (var i3 in obj) { + ret[i3] = obj[i3]; } return ret; } @@ -570539,14 +497953,14 @@ var require_css3 = __commonJS((exports, module) => { }; if (isWhite) { var ret = onAttr(name, value, opts); - if (isNull3(ret)) { + if (isNull2(ret)) { return name + ":" + value; } else { return ret; } } else { var ret = onIgnoreAttr(name, value, opts); - if (!isNull3(ret)) { + if (!isNull2(ret)) { return ret; } } @@ -570557,7 +497971,7 @@ var require_css3 = __commonJS((exports, module) => { }); // node_modules/cssfilter/lib/index.js -var require_lib12 = __commonJS((exports, module) => { +var require_lib10 = __commonJS((exports, module) => { var DEFAULT = require_default2(); var FilterCSS = require_css3(); function filterCSS(html2, options2) { @@ -570566,36 +497980,36 @@ var require_lib12 = __commonJS((exports, module) => { } exports = module.exports = filterCSS; exports.FilterCSS = FilterCSS; - for (i4 in DEFAULT) - exports[i4] = DEFAULT[i4]; - var i4; + for (i3 in DEFAULT) + exports[i3] = DEFAULT[i3]; + var i3; if (typeof window !== "undefined") { window.filterCSS = module.exports; } }); // node_modules/xss/lib/util.js -var require_util17 = __commonJS((exports, module) => { +var require_util15 = __commonJS((exports, module) => { module.exports = { indexOf: function(arr, item) { - var i4, j; + var i3, j; if (Array.prototype.indexOf) { return arr.indexOf(item); } - for (i4 = 0, j = arr.length;i4 < j; i4++) { - if (arr[i4] === item) { - return i4; + for (i3 = 0, j = arr.length;i3 < j; i3++) { + if (arr[i3] === item) { + return i3; } } return -1; }, forEach: function(arr, fn, scope) { - var i4, j; + var i3, j; if (Array.prototype.forEach) { return arr.forEach(fn, scope); } - for (i4 = 0, j = arr.length;i4 < j; i4++) { - fn.call(scope, arr[i4], i4, arr); + for (i3 = 0, j = arr.length;i3 < j; i3++) { + fn.call(scope, arr[i3], i3, arr); } }, trim: function(str2) { @@ -570614,9 +498028,9 @@ var require_util17 = __commonJS((exports, module) => { // node_modules/xss/lib/default.js var require_default3 = __commonJS((exports) => { - var FilterCSS = require_lib12().FilterCSS; - var getDefaultCSSWhiteList = require_lib12().getDefaultWhiteList; - var _ = require_util17(); + var FilterCSS = require_lib10().FilterCSS; + var getDefaultCSSWhiteList = require_lib10().getDefaultWhiteList; + var _ = require_util15(); function getDefaultWhiteList() { return { a: ["target", "href", "title"], @@ -570777,8 +498191,8 @@ var require_default3 = __commonJS((exports) => { } function clearNonPrintableCharacter(str2) { var str22 = ""; - for (var i4 = 0, len = str2.length;i4 < len; i4++) { - str22 += str2.charCodeAt(i4) < 32 ? " " : str2.charAt(i4); + for (var i3 = 0, len = str2.length;i3 < len; i3++) { + str22 += str2.charCodeAt(i3) < 32 ? " " : str2.charAt(i3); } return _.trim(str22); } @@ -570847,13 +498261,13 @@ var require_default3 = __commonJS((exports) => { var retHtml = ""; var lastPos = 0; while (lastPos < html2.length) { - var i4 = html2.indexOf("", i4); + retHtml += html2.slice(lastPos, i3); + var j = html2.indexOf("-->", i3); if (j === -1) { break; } @@ -570902,14 +498316,14 @@ var require_default3 = __commonJS((exports) => { // node_modules/xss/lib/parser.js var require_parser6 = __commonJS((exports) => { - var _ = require_util17(); + var _ = require_util15(); function getTagName(html2) { - var i4 = _.spaceIndex(html2); + var i3 = _.spaceIndex(html2); var tagName; - if (i4 === -1) { + if (i3 === -1) { tagName = html2.slice(1, -1); } else { - tagName = html2.slice(1, i4 + 1); + tagName = html2.slice(1, i3 + 1); } tagName = _.trim(tagName).toLowerCase(); if (tagName.slice(0, 1) === "/") @@ -570956,14 +498370,14 @@ var require_parser6 = __commonJS((exports) => { continue; } if (c6 === '"' || c6 === "'") { - var i4 = 1; - var ic = html2.charAt(currentPos - i4); + var i3 = 1; + var ic = html2.charAt(currentPos - i3); while (ic.trim() === "" || ic === "=") { if (ic === "=") { quoteStart = c6; continue chariterator; } - ic = html2.charAt(currentPos - ++i4); + ic = html2.charAt(currentPos - ++i3); } } } else { @@ -570995,26 +498409,26 @@ var require_parser6 = __commonJS((exports) => { if (ret) retAttrs.push(ret); } - for (var i4 = 0;i4 < len; i4++) { - var c6 = html2.charAt(i4); + for (var i3 = 0;i3 < len; i3++) { + var c6 = html2.charAt(i3); var v, j; if (tmpName === false && c6 === "=") { - tmpName = html2.slice(lastPos, i4); - lastPos = i4 + 1; - lastMarkPos = html2.charAt(lastPos) === '"' || html2.charAt(lastPos) === "'" ? lastPos : findNextQuotationMark(html2, i4 + 1); + tmpName = html2.slice(lastPos, i3); + lastPos = i3 + 1; + lastMarkPos = html2.charAt(lastPos) === '"' || html2.charAt(lastPos) === "'" ? lastPos : findNextQuotationMark(html2, i3 + 1); continue; } if (tmpName !== false) { - if (i4 === lastMarkPos) { - j = html2.indexOf(c6, i4 + 1); + if (i3 === lastMarkPos) { + j = html2.indexOf(c6, i3 + 1); if (j === -1) { break; } else { v = _.trim(html2.slice(lastMarkPos + 1, j)); addAttr(tmpName, v); tmpName = false; - i4 = j; - lastPos = i4 + 1; + i3 = j; + lastPos = i3 + 1; continue; } } @@ -571022,25 +498436,25 @@ var require_parser6 = __commonJS((exports) => { if (/\s|\n|\t/.test(c6)) { html2 = html2.replace(/\s|\n|\t/g, " "); if (tmpName === false) { - j = findNextEqual(html2, i4); + j = findNextEqual(html2, i3); if (j === -1) { - v = _.trim(html2.slice(lastPos, i4)); + v = _.trim(html2.slice(lastPos, i3)); addAttr(v); tmpName = false; - lastPos = i4 + 1; + lastPos = i3 + 1; continue; } else { - i4 = j - 1; + i3 = j - 1; continue; } } else { - j = findBeforeEqual(html2, i4 - 1); + j = findBeforeEqual(html2, i3 - 1); if (j === -1) { - v = _.trim(html2.slice(lastPos, i4)); + v = _.trim(html2.slice(lastPos, i3)); v = stripQuoteWrap(v); addAttr(tmpName, v); tmpName = false; - lastPos = i4 + 1; + lastPos = i3 + 1; continue; } else { continue; @@ -571057,48 +498471,48 @@ var require_parser6 = __commonJS((exports) => { } return _.trim(retAttrs.join(" ")); } - function findNextEqual(str2, i4) { - for (;i4 < str2.length; i4++) { - var c6 = str2[i4]; + function findNextEqual(str2, i3) { + for (;i3 < str2.length; i3++) { + var c6 = str2[i3]; if (c6 === " ") continue; if (c6 === "=") - return i4; + return i3; return -1; } } - function findNextQuotationMark(str2, i4) { - for (;i4 < str2.length; i4++) { - var c6 = str2[i4]; + function findNextQuotationMark(str2, i3) { + for (;i3 < str2.length; i3++) { + var c6 = str2[i3]; if (c6 === " ") continue; if (c6 === "'" || c6 === '"') - return i4; + return i3; return -1; } } - function findBeforeEqual(str2, i4) { - for (;i4 > 0; i4--) { - var c6 = str2[i4]; + function findBeforeEqual(str2, i3) { + for (;i3 > 0; i3--) { + var c6 = str2[i3]; if (c6 === " ") continue; if (c6 === "=") - return i4; + return i3; return -1; } } - function isQuoteWrapString(text2) { - if (text2[0] === '"' && text2[text2.length - 1] === '"' || text2[0] === "'" && text2[text2.length - 1] === "'") { + function isQuoteWrapString(text) { + if (text[0] === '"' && text[text.length - 1] === '"' || text[0] === "'" && text[text.length - 1] === "'") { return true; } else { return false; } } - function stripQuoteWrap(text2) { - if (isQuoteWrapString(text2)) { - return text2.substr(1, text2.length - 2); + function stripQuoteWrap(text) { + if (isQuoteWrapString(text)) { + return text.substr(1, text.length - 2); } else { - return text2; + return text; } } exports.parseTag = parseTag; @@ -571107,24 +498521,24 @@ var require_parser6 = __commonJS((exports) => { // node_modules/xss/lib/xss.js var require_xss = __commonJS((exports, module) => { - var FilterCSS = require_lib12().FilterCSS; + var FilterCSS = require_lib10().FilterCSS; var DEFAULT = require_default3(); var parser2 = require_parser6(); var parseTag = parser2.parseTag; var parseAttr = parser2.parseAttr; - var _ = require_util17(); - function isNull3(obj) { + var _ = require_util15(); + function isNull2(obj) { return obj === undefined || obj === null; } function getAttrs(html2) { - var i4 = _.spaceIndex(html2); - if (i4 === -1) { + var i3 = _.spaceIndex(html2); + if (i3 === -1) { return { html: "", closing: html2[html2.length - 2] === "/" }; } - html2 = _.trim(html2.slice(i4 + 1, -1)); + html2 = _.trim(html2.slice(i3 + 1, -1)); var isClosing = html2[html2.length - 1] === "/"; if (isClosing) html2 = _.trim(html2.slice(0, -1)); @@ -571135,20 +498549,20 @@ var require_xss = __commonJS((exports, module) => { } function shallowCopyObject(obj) { var ret = {}; - for (var i4 in obj) { - ret[i4] = obj[i4]; + for (var i3 in obj) { + ret[i3] = obj[i3]; } return ret; } function keysToLowerCase(obj) { var ret = {}; - for (var i4 in obj) { - if (Array.isArray(obj[i4])) { - ret[i4.toLowerCase()] = obj[i4].map(function(item) { + for (var i3 in obj) { + if (Array.isArray(obj[i3])) { + ret[i3.toLowerCase()] = obj[i3].map(function(item) { return item.toLowerCase(); }); } else { - ret[i4.toLowerCase()] = obj[i4]; + ret[i3.toLowerCase()] = obj[i3]; } } return ret; @@ -571216,7 +498630,7 @@ var require_xss = __commonJS((exports, module) => { isWhite: Object.prototype.hasOwnProperty.call(whiteList, tag2) }; var ret = onTag(tag2, html3, info); - if (!isNull3(ret)) + if (!isNull2(ret)) return ret; if (info.isWhite) { if (info.isClosing) { @@ -571227,7 +498641,7 @@ var require_xss = __commonJS((exports, module) => { var attrsHtml = parseAttr(attrs.html, function(name, value) { var isWhiteAttr = _.indexOf(whiteAttrList, name) !== -1; var ret2 = onTagAttr(tag2, name, value, isWhiteAttr); - if (!isNull3(ret2)) + if (!isNull2(ret2)) return ret2; if (isWhiteAttr) { value = safeAttrValue(tag2, name, value, cssFilter); @@ -571238,7 +498652,7 @@ var require_xss = __commonJS((exports, module) => { } } else { ret2 = onIgnoreTagAttr(tag2, name, value, isWhiteAttr); - if (!isNull3(ret2)) + if (!isNull2(ret2)) return ret2; return; } @@ -571252,7 +498666,7 @@ var require_xss = __commonJS((exports, module) => { return html3; } else { ret = onIgnoreTag(tag2, html3, info); - if (!isNull3(ret)) + if (!isNull2(ret)) return ret; return escapeHtml(html3); } @@ -571266,7 +498680,7 @@ var require_xss = __commonJS((exports, module) => { }); // node_modules/xss/lib/index.js -var require_lib13 = __commonJS((exports, module) => { +var require_lib11 = __commonJS((exports, module) => { var DEFAULT = require_default3(); var parser2 = require_parser6(); var FilterXSS = require_xss(); @@ -571278,8 +498692,8 @@ var require_lib13 = __commonJS((exports, module) => { exports.filterXSS = filterXSS; exports.FilterXSS = FilterXSS; (function() { - for (var i4 in DEFAULT) { - exports[i4] = DEFAULT[i4]; + for (var i3 in DEFAULT) { + exports[i3] = DEFAULT[i3]; } for (var j in parser2) { exports[j] = parser2[j]; @@ -571297,7 +498711,7 @@ var require_lib13 = __commonJS((exports, module) => { }); // src/services/mcp/oauthPort.ts -import { createServer as createServer4 } from "http"; +import { createServer as createServer2 } from "http"; function buildRedirectUri(port = REDIRECT_PORT_FALLBACK) { return `http://localhost:${port}/callback`; } @@ -571310,17 +498724,17 @@ async function findAvailablePort() { if (configuredPort) { return configuredPort; } - const { min: min3, max: max5 } = REDIRECT_PORT_RANGE; - const range3 = max5 - min3 + 1; - const maxAttempts = Math.min(range3, 100); - for (let attempt3 = 0;attempt3 < maxAttempts; attempt3++) { - const port = min3 + Math.floor(Math.random() * range3); + const { min: min2, max: max3 } = REDIRECT_PORT_RANGE; + const range2 = max3 - min2 + 1; + const maxAttempts = Math.min(range2, 100); + for (let attempt2 = 0;attempt2 < maxAttempts; attempt2++) { + const port = min2 + Math.floor(Math.random() * range2); try { - await new Promise((resolve41, reject3) => { - const testServer = createServer4(); - testServer.once("error", reject3); + await new Promise((resolve35, reject2) => { + const testServer = createServer2(); + testServer.once("error", reject2); testServer.listen(port, () => { - testServer.close(() => resolve41()); + testServer.close(() => resolve35()); }); }); return port; @@ -571329,11 +498743,11 @@ async function findAvailablePort() { } } try { - await new Promise((resolve41, reject3) => { - const testServer = createServer4(); - testServer.once("error", reject3); + await new Promise((resolve35, reject2) => { + const testServer = createServer2(); + testServer.once("error", reject2); testServer.listen(REDIRECT_PORT_FALLBACK, () => { - testServer.close(() => resolve41()); + testServer.close(() => resolve35()); }); }); return REDIRECT_PORT_FALLBACK; @@ -571349,10 +498763,10 @@ var init_oauthPort = __esm(() => { // src/services/mcp/xaa.ts function makeXaaFetch(abortSignal) { - return (url3, init2) => { + return (url3, init) => { const timeout = AbortSignal.timeout(XAA_REQUEST_TIMEOUT_MS); const signal = abortSignal ? AbortSignal.any([timeout, abortSignal]) : timeout; - return fetch(url3, { ...init2, signal }); + return fetch(url3, { ...init, signal }); }; } function normalizeUrl2(url3) { @@ -571441,17 +498855,17 @@ async function requestJwtAuthorizationGrant(opts) { if (!exchangeParsed.success) { throw new XaaTokenExchangeError(`XAA: token exchange response did not match expected shape: ${redactTokens(rawExchange)}`, true); } - const result3 = exchangeParsed.data; - if (!result3.access_token) { - throw new XaaTokenExchangeError(`XAA: token exchange response missing access_token: ${redactTokens(result3)}`, true); + const result2 = exchangeParsed.data; + if (!result2.access_token) { + throw new XaaTokenExchangeError(`XAA: token exchange response missing access_token: ${redactTokens(result2)}`, true); } - if (result3.issued_token_type !== ID_JAG_TOKEN_TYPE) { - throw new XaaTokenExchangeError(`XAA: token exchange returned unexpected issued_token_type: ${result3.issued_token_type}`, true); + if (result2.issued_token_type !== ID_JAG_TOKEN_TYPE) { + throw new XaaTokenExchangeError(`XAA: token exchange returned unexpected issued_token_type: ${result2.issued_token_type}`, true); } return { - jwtAuthGrant: result3.access_token, - expiresIn: result3.expires_in, - scope: result3.scope + jwtAuthGrant: result2.access_token, + expiresIn: result2.expires_in, + scope: result2.scope }; } async function exchangeJwtAuthGrant(opts) { @@ -571495,7 +498909,7 @@ async function exchangeJwtAuthGrant(opts) { } return tokensParsed.data; } -async function performCrossAppAccess(serverUrl, config5, serverName = "xaa", abortSignal) { +async function performCrossAppAccess(serverUrl, config3, serverName = "xaa", abortSignal) { const fetchFn = makeXaaFetch(abortSignal); logMCPDebug(serverName, `XAA: discovering PRM for ${serverUrl}`); const prm = await discoverProtectedResource(serverUrl, { fetchFn }); @@ -571527,12 +498941,12 @@ async function performCrossAppAccess(serverUrl, config5, serverName = "xaa", abo logMCPDebug(serverName, `XAA: AS issuer=${asMeta.issuer} token_endpoint=${asMeta.token_endpoint} auth_method=${authMethod}`); logMCPDebug(serverName, `XAA: exchanging id_token for ID-JAG at IdP`); const jag = await requestJwtAuthorizationGrant({ - tokenEndpoint: config5.idpTokenEndpoint, + tokenEndpoint: config3.idpTokenEndpoint, audience: asMeta.issuer, resource: prm.resource, - idToken: config5.idpIdToken, - clientId: config5.idpClientId, - clientSecret: config5.idpClientSecret, + idToken: config3.idpIdToken, + clientId: config3.idpClientId, + clientSecret: config3.idpClientSecret, fetchFn }); logMCPDebug(serverName, `XAA: ID-JAG obtained`); @@ -571540,8 +498954,8 @@ async function performCrossAppAccess(serverUrl, config5, serverName = "xaa", abo const tokens = await exchangeJwtAuthGrant({ tokenEndpoint: asMeta.token_endpoint, assertion: jag.jwtAuthGrant, - clientId: config5.clientId, - clientSecret: config5.clientSecret, + clientId: config3.clientId, + clientSecret: config3.clientSecret, authMethod, fetchFn }); @@ -571550,7 +498964,7 @@ async function performCrossAppAccess(serverUrl, config5, serverName = "xaa", abo } var XAA_REQUEST_TIMEOUT_MS = 30000, TOKEN_EXCHANGE_GRANT = "urn:ietf:params:oauth:grant-type:token-exchange", JWT_BEARER_GRANT = "urn:ietf:params:oauth:grant-type:jwt-bearer", ID_JAG_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:id-jag", ID_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:id_token", defaultFetch, XaaTokenExchangeError, SENSITIVE_TOKEN_RE, TokenExchangeResponseSchema, JwtBearerResponseSchema; var init_xaa = __esm(() => { - init_auth5(); + init_auth4(); init_v4(); init_log3(); init_slowOperations(); @@ -571580,8 +498994,8 @@ var init_xaa = __esm(() => { }); // src/services/mcp/xaaIdpLogin.ts -import { randomBytes as randomBytes12 } from "crypto"; -import { createServer as createServer5 } from "http"; +import { randomBytes as randomBytes11 } from "crypto"; +import { createServer as createServer3 } from "http"; import { parse as parse16 } from "url"; function isXaaEnabled() { return isEnvTruthy(process.env.CLAUDE_CODE_ENABLE_XAA); @@ -571715,21 +499129,21 @@ function waitForCallback(port, expectedState, abortSignal, onListening) { abortHandler = null; } }; - return new Promise((resolve41, reject3) => { + return new Promise((resolve35, reject2) => { let resolved = false; const resolveOnce = (v) => { if (resolved) return; resolved = true; cleanup(); - resolve41(v); + resolve35(v); }; const rejectOnce = (e) => { if (resolved) return; resolved = true; cleanup(); - reject3(e); + reject2(e); }; if (abortSignal) { abortHandler = () => rejectOnce(new Error("XAA IdP: login cancelled")); @@ -571739,7 +499153,7 @@ function waitForCallback(port, expectedState, abortSignal, onListening) { } abortSignal.addEventListener("abort", abortHandler, { once: true }); } - server = createServer5((req, res) => { + server = createServer3((req, res) => { const parsed = parse16(req.url || "", true); if (parsed.pathname !== "/callback") { res.writeHead(404); @@ -571748,14 +499162,14 @@ function waitForCallback(port, expectedState, abortSignal, onListening) { } const code = parsed.query.code; const state = parsed.query.state; - const err3 = parsed.query.error; - if (err3) { + const err2 = parsed.query.error; + if (err2) { const desc = parsed.query.error_description; - const safeErr = import_xss.default(err3); + const safeErr = import_xss.default(err2); const safeDesc = desc ? import_xss.default(desc) : ""; res.writeHead(400, { "Content-Type": "text/html" }); res.end(`

IdP login failed

${safeErr}

${safeDesc}

`); - rejectOnce(new Error(`XAA IdP: ${err3}${desc ? ` — ${desc}` : ""}`)); + rejectOnce(new Error(`XAA IdP: ${err2}${desc ? ` — ${desc}` : ""}`)); return; } if (state !== expectedState) { @@ -571774,12 +499188,12 @@ function waitForCallback(port, expectedState, abortSignal, onListening) { res.end("

IdP login complete — you can close this window.

"); resolveOnce(code); }); - server.on("error", (err3) => { - if (err3.code === "EADDRINUSE") { + server.on("error", (err2) => { + if (err2.code === "EADDRINUSE") { const findCmd = getPlatform() === "windows" ? `netstat -ano | findstr :${port}` : `lsof -ti:${port} -sTCP:LISTEN`; rejectOnce(new Error(`XAA IdP: callback port ${port} is already in use. Run \`${findCmd}\` to find the holder.`)); } else { - rejectOnce(new Error(`XAA IdP: callback server failed: ${err3.message}`)); + rejectOnce(new Error(`XAA IdP: callback server failed: ${err2.message}`)); } }); server.listen(port, "127.0.0.1", () => { @@ -571805,7 +499219,7 @@ async function acquireIdpIdToken(opts) { const metadata = await discoverOidc(idpIssuer); const port = opts.callbackPort ?? await findAvailablePort(); const redirectUri = buildRedirectUri(port); - const state = randomBytes12(32).toString("base64url"); + const state = randomBytes11(32).toString("base64url"); const clientInformation = { client_id: idpClientId, ...opts.idpClientSecret ? { client_secret: opts.idpClientSecret } : {} @@ -571832,8 +499246,8 @@ async function acquireIdpIdToken(opts) { authorizationCode, codeVerifier, redirectUri, - fetchFn: (url3, init2) => fetch(url3, { - ...init2, + fetchFn: (url3, init) => fetch(url3, { + ...init, signal: AbortSignal.timeout(IDP_REQUEST_TIMEOUT_MS) }) }); @@ -571848,9 +499262,9 @@ async function acquireIdpIdToken(opts) { } var import_xss, IDP_LOGIN_TIMEOUT_MS, IDP_REQUEST_TIMEOUT_MS = 30000, ID_TOKEN_EXPIRY_BUFFER_S = 60; var init_xaaIdpLogin = __esm(() => { - init_auth5(); init_auth4(); - import_xss = __toESM(require_lib13(), 1); + init_auth3(); + import_xss = __toESM(require_lib11(), 1); init_browser(); init_envUtils(); init_errors(); @@ -571864,10 +499278,10 @@ var init_xaaIdpLogin = __esm(() => { }); // src/services/mcp/auth.ts -import { createHash as createHash22, randomBytes as randomBytes13, randomUUID as randomUUID27 } from "crypto"; +import { createHash as createHash21, randomBytes as randomBytes12, randomUUID as randomUUID27 } from "crypto"; import { mkdir as mkdir32 } from "fs/promises"; -import { createServer as createServer6 } from "http"; -import { join as join116 } from "path"; +import { createServer as createServer4 } from "http"; +import { join as join106 } from "path"; import { parse as parse17 } from "url"; function redactSensitiveUrlParams(url3) { try { @@ -571886,24 +499300,24 @@ async function normalizeOAuthErrorBody(response) { if (!response.ok) { return response; } - const text2 = await response.text(); + const text = await response.text(); let parsed; try { - parsed = jsonParse(text2); + parsed = jsonParse(text); } catch { - return new Response(text2, response); + return new Response(text, response); } if (OAuthTokensSchema.safeParse(parsed).success) { - return new Response(text2, response); + return new Response(text, response); } - const result3 = OAuthErrorResponseSchema.safeParse(parsed); - if (!result3.success) { - return new Response(text2, response); + const result2 = OAuthErrorResponseSchema.safeParse(parsed); + if (!result2.success) { + return new Response(text, response); } - const normalized = NONSTANDARD_INVALID_GRANT_ALIASES.has(result3.data.error) ? { + const normalized = NONSTANDARD_INVALID_GRANT_ALIASES.has(result2.data.error) ? { error: "invalid_grant", - error_description: result3.data.error_description ?? `Server returned non-standard error code: ${result3.data.error}` - } : result3.data; + error_description: result2.data.error_description ?? `Server returned non-standard error code: ${result2.data.error}` + } : result2.data; return new Response(jsonStringify(normalized), { status: 400, statusText: "Bad Request", @@ -571911,31 +499325,31 @@ async function normalizeOAuthErrorBody(response) { }); } function createAuthFetch() { - return async (url3, init2) => { + return async (url3, init) => { const timeoutSignal = AbortSignal.timeout(AUTH_REQUEST_TIMEOUT_MS); - const isPost = init2?.method?.toUpperCase() === "POST"; - if (!init2?.signal) { - const response = await fetch(url3, { ...init2, signal: timeoutSignal }); + const isPost = init?.method?.toUpperCase() === "POST"; + if (!init?.signal) { + const response = await fetch(url3, { ...init, signal: timeoutSignal }); return isPost ? normalizeOAuthErrorBody(response) : response; } const controller = new AbortController; const abort = () => controller.abort(); - init2.signal.addEventListener("abort", abort); + init.signal.addEventListener("abort", abort); timeoutSignal.addEventListener("abort", abort); const cleanup = () => { - init2.signal?.removeEventListener("abort", abort); + init.signal?.removeEventListener("abort", abort); timeoutSignal.removeEventListener("abort", abort); }; - if (init2.signal.aborted) { + if (init.signal.aborted) { controller.abort(); } try { - const response = await fetch(url3, { ...init2, signal: controller.signal }); + const response = await fetch(url3, { ...init, signal: controller.signal }); cleanup(); return isPost ? normalizeOAuthErrorBody(response) : response; - } catch (error46) { + } catch (error42) { cleanup(); - throw error46; + throw error42; } }; } @@ -571961,8 +499375,8 @@ async function fetchAuthServerMetadata(serverName, serverUrl, configuredMetadata if (authorizationServerMetadata) { return authorizationServerMetadata; } - } catch (err3) { - logMCPDebug(serverName, `RFC 9728 discovery failed, falling back: ${errorMessage(err3)}`); + } catch (err2) { + logMCPDebug(serverName, `RFC 9728 discovery failed, falling back: ${errorMessage(err2)}`); } const url3 = new URL(serverUrl); if (url3.pathname === "/") { @@ -571978,7 +499392,7 @@ function getServerKey(serverName, serverConfig) { url: serverConfig.url, headers: serverConfig.headers || {} }); - const hash2 = createHash22("sha256").update(configJson).digest("hex").substring(0, 16); + const hash2 = createHash21("sha256").update(configJson).digest("hex").substring(0, 16); return `${serverName}|${hash2}`; } function hasMcpDiscoveryButNoToken(serverName, serverConfig) { @@ -572021,8 +499435,8 @@ async function revokeToken({ try { await axios_default.post(endpoint, params, { headers }); logMCPDebug(serverName, `Successfully revoked ${tokenTypeHint}`); - } catch (error46) { - if (axios_default.isAxiosError(error46) && error46.response?.status === 401 && accessToken) { + } catch (error42) { + if (axios_default.isAxiosError(error42) && error42.response?.status === 401 && accessToken) { logMCPDebug(serverName, `Got 401, retrying ${tokenTypeHint} revocation with Bearer auth`); params.delete("client_id"); params.delete("client_secret"); @@ -572031,7 +499445,7 @@ async function revokeToken({ }); logMCPDebug(serverName, `Successfully revoked ${tokenTypeHint} with Bearer auth`); } else { - throw error46; + throw error42; } } } @@ -572069,8 +499483,8 @@ async function revokeServerTokens(serverName, serverConfig, { preserveStepUpStat accessToken: tokenData.accessToken, authMethod }); - } catch (error46) { - logMCPDebug(serverName, `Failed to revoke refresh token: ${errorMessage(error46)}`); + } catch (error42) { + logMCPDebug(serverName, `Failed to revoke refresh token: ${errorMessage(error42)}`); } } if (tokenData.accessToken) { @@ -572085,14 +499499,14 @@ async function revokeServerTokens(serverName, serverConfig, { preserveStepUpStat accessToken: tokenData.accessToken, authMethod }); - } catch (error46) { - logMCPDebug(serverName, `Failed to revoke access token: ${errorMessage(error46)}`); + } catch (error42) { + logMCPDebug(serverName, `Failed to revoke access token: ${errorMessage(error42)}`); } } } } - } catch (error46) { - logMCPDebug(serverName, `Failed to revoke tokens: ${errorMessage(error46)}`); + } catch (error42) { + logMCPDebug(serverName, `Failed to revoke tokens: ${errorMessage(error42)}`); } } else { logMCPDebug(serverName, "No tokens to revoke"); @@ -572304,8 +499718,8 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, provider.setMetadata(metadata); logMCPDebug(serverName, `Fetched OAuth metadata with scope: ${getScopeFromMetadata(metadata) || "NONE"}`); } - } catch (error46) { - logMCPDebug(serverName, `Failed to fetch OAuth metadata: ${errorMessage(error46)}`); + } catch (error42) { + logMCPDebug(serverName, `Failed to fetch OAuth metadata: ${errorMessage(error42)}`); } const oauthState = await provider.state(); let server = null; @@ -572328,19 +499742,19 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, } logMCPDebug(serverName, `MCP OAuth server cleaned up`); }; - const authorizationCode = await new Promise((resolve41, reject3) => { + const authorizationCode = await new Promise((resolve35, reject2) => { let resolved = false; const resolveOnce = (code) => { if (resolved) return; resolved = true; - resolve41(code); + resolve35(code); }; - const rejectOnce = (error46) => { + const rejectOnce = (error42) => { if (resolved) return; resolved = true; - reject3(error46); + reject2(error42); }; if (abortSignal) { abortHandler = () => { @@ -572359,11 +499773,11 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, const parsed = new URL(callbackUrl); const code = parsed.searchParams.get("code"); const state = parsed.searchParams.get("state"); - const error46 = parsed.searchParams.get("error"); - if (error46) { + const error42 = parsed.searchParams.get("error"); + if (error42) { const errorDescription = parsed.searchParams.get("error_description") || ""; cleanup(); - rejectOnce(new Error(`OAuth error: ${error46} - ${errorDescription}`)); + rejectOnce(new Error(`OAuth error: ${error42} - ${errorDescription}`)); return; } if (!code) { @@ -572380,28 +499794,28 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, } catch {} }); } - server = createServer6((req, res) => { + server = createServer4((req, res) => { const parsedUrl = parse17(req.url || "", true); if (parsedUrl.pathname === "/callback") { const code = parsedUrl.query.code; const state = parsedUrl.query.state; - const error46 = parsedUrl.query.error; + const error42 = parsedUrl.query.error; const errorDescription = parsedUrl.query.error_description; const errorUri = parsedUrl.query.error_uri; - if (!error46 && state !== oauthState) { + if (!error42 && state !== oauthState) { res.writeHead(400, { "Content-Type": "text/html" }); res.end(`

Authentication Error

Invalid state parameter. Please try again.

You can close this window.

`); cleanup(); rejectOnce(new Error("OAuth state mismatch - possible CSRF attack")); return; } - if (error46) { + if (error42) { res.writeHead(200, { "Content-Type": "text/html" }); - const sanitizedError = import_xss2.default(String(error46)); + const sanitizedError = import_xss2.default(String(error42)); const sanitizedErrorDescription = errorDescription ? import_xss2.default(String(errorDescription)) : ""; res.end(`

Authentication Error

${sanitizedError}: ${sanitizedErrorDescription}

You can close this window.

`); cleanup(); - let errorMessage2 = `OAuth error: ${error46}`; + let errorMessage2 = `OAuth error: ${error42}`; if (errorDescription) { errorMessage2 += ` - ${errorDescription}`; } @@ -572419,32 +499833,32 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, } } }); - server.on("error", (err3) => { + server.on("error", (err2) => { cleanup(); - if (err3.code === "EADDRINUSE") { + if (err2.code === "EADDRINUSE") { const findCmd = getPlatform() === "windows" ? `netstat -ano | findstr :${port}` : `lsof -ti:${port} -sTCP:LISTEN`; rejectOnce(new Error(`OAuth callback port ${port} is already in use — another process may be holding it. ` + `Run \`${findCmd}\` to find it.`)); } else { - rejectOnce(new Error(`OAuth callback server failed: ${err3.message}`)); + rejectOnce(new Error(`OAuth callback server failed: ${err2.message}`)); } }); server.listen(port, "127.0.0.1", async () => { try { logMCPDebug(serverName, `Starting SDK auth`); logMCPDebug(serverName, `Server URL: ${serverConfig.url}`); - const result4 = await auth(provider, { + const result3 = await auth(provider, { serverUrl: serverConfig.url, scope: wwwAuthParams.scope, resourceMetadataUrl: wwwAuthParams.resourceMetadataUrl }); - logMCPDebug(serverName, `Initial auth result: ${result4}`); - if (result4 !== "REDIRECT") { - logMCPDebug(serverName, `Unexpected auth result, expected REDIRECT: ${result4}`); + logMCPDebug(serverName, `Initial auth result: ${result3}`); + if (result3 !== "REDIRECT") { + logMCPDebug(serverName, `Unexpected auth result, expected REDIRECT: ${result3}`); } - } catch (error46) { - logMCPDebug(serverName, `SDK auth error: ${error46}`); + } catch (error42) { + logMCPDebug(serverName, `SDK auth error: ${error42}`); cleanup(); - rejectOnce(new Error(`SDK auth failed: ${errorMessage(error46)}`)); + rejectOnce(new Error(`SDK auth failed: ${errorMessage(error42)}`)); } }); server.unref(); @@ -572456,13 +499870,13 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, }); authorizationCodeObtained = true; logMCPDebug(serverName, `Completing auth flow with authorization code`); - const result3 = await auth(provider, { + const result2 = await auth(provider, { serverUrl: serverConfig.url, authorizationCode, resourceMetadataUrl: wwwAuthParams.resourceMetadataUrl }); - logMCPDebug(serverName, `Auth result: ${result3}`); - if (result3 === "AUTHORIZED") { + logMCPDebug(serverName, `Auth result: ${result2}`); + if (result2 === "AUTHORIZED") { const savedTokens = await provider.tokens(); logMCPDebug(serverName, `Tokens after auth: ${savedTokens ? "Present" : "Missing"}`); if (savedTokens) { @@ -572477,19 +499891,19 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, } : {} }); } else { - throw new Error("Unexpected auth result: " + result3); + throw new Error("Unexpected auth result: " + result2); } - } catch (error46) { - logMCPDebug(serverName, `Error during auth completion: ${error46}`); + } catch (error42) { + logMCPDebug(serverName, `Error during auth completion: ${error42}`); let reason = "unknown"; let oauthErrorCode; let httpStatus; - if (error46 instanceof AuthenticationCancelledError) { + if (error42 instanceof AuthenticationCancelledError) { reason = "cancelled"; } else if (authorizationCodeObtained) { reason = "token_exchange_failed"; } else { - const msg = errorMessage(error46); + const msg = errorMessage(error42); if (msg.includes("Authentication timeout")) { reason = "timeout"; } else if (msg.includes("OAuth state mismatch")) { @@ -572502,13 +499916,13 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, reason = "sdk_auth_failed"; } } - if (error46 instanceof OAuthError) { - oauthErrorCode = error46.errorCode; - const statusMatch = error46.message.match(/^HTTP (\d{3}):/); + if (error42 instanceof OAuthError) { + oauthErrorCode = error42.errorCode; + const statusMatch = error42.message.match(/^HTTP (\d{3}):/); if (statusMatch) { httpStatus = Number(statusMatch[1]); } - if (error46.errorCode === "invalid_client" && error46.message.includes("Client not found")) { + if (error42.errorCode === "invalid_client" && error42.message.includes("Client not found")) { const storage2 = getSecureStorage(); const existingData = storage2.read() || {}; const serverKey2 = getServerKey(serverName, serverConfig); @@ -572529,12 +499943,12 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl, mcpServerBaseUrl: getLoggingSafeMcpBaseUrl(serverConfig) } : {} }); - throw error46; + throw error42; } } function wrapFetchWithStepUpDetection(baseFetch, provider) { - return async (url3, init2) => { - const response = await baseFetch(url3, init2); + return async (url3, init) => { + const response = await baseFetch(url3, init); if (response.status === 403) { const wwwAuth = response.headers.get("WWW-Authenticate"); if (wwwAuth?.includes("insufficient_scope")) { @@ -572609,7 +500023,7 @@ class ClaudeAuthProvider { } async state() { if (!this._state) { - this._state = randomBytes13(32).toString("base64url"); + this._state = randomBytes12(32).toString("base64url"); logMCPDebug(this.serverName, "Generated new OAuth state"); } return this._state; @@ -572709,8 +500123,8 @@ class ClaudeAuthProvider { return refreshed2; } logMCPDebug(this.serverName, `Token refresh failed, returning current tokens`); - } catch (error46) { - logMCPDebug(this.serverName, `Token refresh error: ${errorMessage(error46)}`); + } catch (error42) { + logMCPDebug(this.serverName, `Token refresh error: ${errorMessage(error42)}`); } } const tokens = { @@ -572968,8 +500382,8 @@ class ClaudeAuthProvider { authorizationServerMetadata: metadata }; } - } catch (error46) { - logMCPDebug(this.serverName, `Failed to fetch from configured metadata URL: ${errorMessage(error46)}`); + } catch (error42) { + logMCPDebug(this.serverName, `Failed to fetch from configured metadata URL: ${errorMessage(error42)}`); } } return; @@ -572979,7 +500393,7 @@ class ClaudeAuthProvider { const claudeDir = getClaudeConfigHomeDir(); await mkdir32(claudeDir, { recursive: true }); const sanitizedKey = serverKey.replace(/[^a-zA-Z0-9]/g, "_"); - const lockfilePath = join116(claudeDir, `mcp-refresh-${sanitizedKey}.lock`); + const lockfilePath = join106(claudeDir, `mcp-refresh-${sanitizedKey}.lock`); let release2; for (let retry = 0;retry < MAX_LOCK_RETRIES; retry++) { try { @@ -572996,7 +500410,7 @@ class ClaudeAuthProvider { const code = getErrnoCode(e); if (code === "ELOCKED") { logMCPDebug(this.serverName, `Refresh lock held by another process, waiting (attempt ${retry + 1}/${MAX_LOCK_RETRIES})`); - await sleep4(1000 + Math.random() * 1000); + await sleep2(1000 + Math.random() * 1000); continue; } logMCPDebug(this.serverName, `Failed to acquire refresh lock: ${code}, proceeding without lock`); @@ -573053,7 +500467,7 @@ class ClaudeAuthProvider { } : {} }); }; - for (let attempt3 = 1;attempt3 <= MAX_ATTEMPTS; attempt3++) { + for (let attempt2 = 1;attempt2 <= MAX_ATTEMPTS; attempt2++) { try { logMCPDebug(this.serverName, `Starting token refresh`); const authFetch = createAuthFetch(); @@ -573099,9 +500513,9 @@ class ClaudeAuthProvider { logMCPDebug(this.serverName, `Token refresh returned no tokens`); emitRefreshEvent("failure", "no_tokens_returned"); return; - } catch (error46) { - if (error46 instanceof InvalidGrantError) { - logMCPDebug(this.serverName, `Token refresh failed with invalid_grant: ${error46.message}`); + } catch (error42) { + if (error42 instanceof InvalidGrantError) { + logMCPDebug(this.serverName, `Token refresh failed with invalid_grant: ${error42.message}`); clearKeychainCache(); const storage = getSecureStorage(); const data = storage.read(); @@ -573125,17 +500539,17 @@ class ClaudeAuthProvider { emitRefreshEvent("failure", "invalid_grant"); return; } - const isTimeoutError = error46 instanceof Error && /timeout|timed out|etimedout|econnreset/i.test(error46.message); - const isTransientServerError = error46 instanceof ServerError || error46 instanceof TemporarilyUnavailableError || error46 instanceof TooManyRequestsError; + const isTimeoutError = error42 instanceof Error && /timeout|timed out|etimedout|econnreset/i.test(error42.message); + const isTransientServerError = error42 instanceof ServerError || error42 instanceof TemporarilyUnavailableError || error42 instanceof TooManyRequestsError; const isRetryable = isTimeoutError || isTransientServerError; - if (!isRetryable || attempt3 >= MAX_ATTEMPTS) { - logMCPDebug(this.serverName, `Token refresh failed: ${errorMessage(error46)}`); + if (!isRetryable || attempt2 >= MAX_ATTEMPTS) { + logMCPDebug(this.serverName, `Token refresh failed: ${errorMessage(error42)}`); emitRefreshEvent("failure", isRetryable ? "transient_retries_exhausted" : "request_failed"); return; } - const delayMs = 1000 * Math.pow(2, attempt3 - 1); - logMCPDebug(this.serverName, `Token refresh failed, retrying in ${delayMs}ms (attempt ${attempt3}/${MAX_ATTEMPTS})`); - await sleep4(delayMs); + const delayMs = 1000 * Math.pow(2, attempt2 - 1); + logMCPDebug(this.serverName, `Token refresh failed, retrying in ${delayMs}ms (attempt ${attempt2}/${MAX_ATTEMPTS})`); + await sleep2(delayMs); } } return; @@ -573149,7 +500563,7 @@ async function readClientSecret() { if (!process.stdin.isTTY) { throw new Error("No TTY available to prompt for client secret. Set MCP_CLIENT_SECRET env var instead."); } - return new Promise((resolve41, reject3) => { + return new Promise((resolve35, reject2) => { process.stderr.write("Enter OAuth client secret: "); process.stdin.setRawMode?.(true); let secret = ""; @@ -573161,11 +500575,11 @@ async function readClientSecret() { process.stdin.removeListener("data", onData); process.stderr.write(` `); - resolve41(secret); + resolve35(secret); } else if (c6 === "\x03") { process.stdin.setRawMode?.(false); process.stdin.removeListener("data", onData); - reject3(new Error("Cancelled")); + reject2(new Error("Cancelled")); } else if (c6 === "" || c6 === "\b") { secret = secret.slice(0, -1); } else { @@ -573219,12 +500633,12 @@ function getScopeFromMetadata(metadata) { return; } var import_xss2, AUTH_REQUEST_TIMEOUT_MS = 30000, MAX_LOCK_RETRIES = 5, SENSITIVE_OAUTH_PARAMS, NONSTANDARD_INVALID_GRANT_ALIASES, AuthenticationCancelledError; -var init_auth7 = __esm(() => { - init_auth5(); - init_errors5(); +var init_auth6 = __esm(() => { init_auth4(); + init_errors5(); + init_auth3(); init_axios2(); - import_xss2 = __toESM(require_lib13(), 1); + import_xss2 = __toESM(require_lib11(), 1); init_oauth(); init_browser(); init_envUtils(); @@ -573236,7 +500650,7 @@ var init_auth7 = __esm(() => { init_slowOperations(); init_analytics(); init_oauthPort(); - init_utils4(); + init_utils3(); init_xaa(); init_xaaIdpLogin(); SENSITIVE_OAUTH_PARAMS = [ @@ -573260,14 +500674,14 @@ var init_auth7 = __esm(() => { }); // src/tools/McpAuthTool/McpAuthTool.ts -function getConfigUrl(config5) { - if ("url" in config5) - return config5.url; +function getConfigUrl(config3) { + if ("url" in config3) + return config3.url; return; } -function createMcpAuthTool(serverName, config5) { - const url3 = getConfigUrl(config5); - const transport = config5.type ?? "stdio"; +function createMcpAuthTool(serverName, config3) { + const url3 = getConfigUrl(config3); + const transport = config3.type ?? "stdio"; const location = url3 ? `${transport} at ${url3}` : transport; const description = `The \`${serverName}\` MCP server (${location}) is installed but requires authentication. ` + `Call this tool to start the OAuth flow — you'll receive an authorization URL to share with the user. ` + `Once the user completes authorization in their browser, the server's real tools will become available automatically.`; return { @@ -573290,11 +500704,11 @@ function createMcpAuthTool(serverName, config5) { get inputSchema() { return inputSchema42(); }, - async checkPermissions(input11) { - return { behavior: "allow", updatedInput: input11 }; + async checkPermissions(input) { + return { behavior: "allow", updatedInput: input }; }, async call(_input, context) { - if (config5.type === "claudeai-proxy") { + if (config3.type === "claudeai-proxy") { return { data: { status: "unsupported", @@ -573302,7 +500716,7 @@ function createMcpAuthTool(serverName, config5) { } }; } - if (config5.type !== "sse" && config5.type !== "http") { + if (config3.type !== "sse" && config3.type !== "http") { return { data: { status: "unsupported", @@ -573310,37 +500724,37 @@ function createMcpAuthTool(serverName, config5) { } }; } - const sseOrHttpConfig = config5; + const sseOrHttpConfig = config3; let resolveAuthUrl; - const authUrlPromise = new Promise((resolve41) => { - resolveAuthUrl = resolve41; + const authUrlPromise = new Promise((resolve35) => { + resolveAuthUrl = resolve35; }); const controller = new AbortController; const { setAppState } = context; const oauthPromise = performMCPOAuthFlow(serverName, sseOrHttpConfig, (u2) => resolveAuthUrl?.(u2), controller.signal, { skipBrowserOpen: true }); oauthPromise.then(async () => { clearMcpAuthCache(); - const result3 = await reconnectMcpServerImpl(serverName, config5); + const result2 = await reconnectMcpServerImpl(serverName, config3); const prefix = getMcpPrefix(serverName); setAppState((prev) => ({ ...prev, mcp: { ...prev.mcp, - clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result3.client : c6), + clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result2.client : c6), tools: [ ...reject_default(prev.mcp.tools, (t) => t.name?.startsWith(prefix)), - ...result3.tools + ...result2.tools ], commands: [ ...reject_default(prev.mcp.commands, (c6) => c6.name?.startsWith(prefix)), - ...result3.commands + ...result2.commands ], - resources: result3.resources ? { ...prev.mcp.resources, [serverName]: result3.resources } : prev.mcp.resources + resources: result2.resources ? { ...prev.mcp.resources, [serverName]: result2.resources } : prev.mcp.resources } })); - logMCPDebug(serverName, `OAuth complete, reconnected with ${result3.tools.length} tool(s)`); - }).catch((err3) => { - logMCPError(serverName, `OAuth flow failed after tool-triggered start: ${errorMessage(err3)}`); + logMCPDebug(serverName, `OAuth complete, reconnected with ${result2.tools.length} tool(s)`); + }).catch((err2) => { + logMCPError(serverName, `OAuth flow failed after tool-triggered start: ${errorMessage(err2)}`); }); try { const authUrl = await Promise.race([ @@ -573366,11 +500780,11 @@ Once they complete the flow, the server's tools will become available automatica message: `Authentication completed silently for ${serverName}. The server's tools should now be available.` } }; - } catch (err3) { + } catch (err2) { return { data: { status: "error", - message: `Failed to start OAuth flow for ${serverName}: ${errorMessage(err3)}. Ask the user to run /mcp and authenticate manually.` + message: `Failed to start OAuth flow for ${serverName}: ${errorMessage(err2)}. Ask the user to run /mcp and authenticate manually.` } }; } @@ -573388,8 +500802,8 @@ var inputSchema42; var init_McpAuthTool = __esm(() => { init_reject(); init_v4(); - init_auth7(); - init_client10(); + init_auth6(); + init_client6(); init_mcpStringUtils(); init_errors(); init_log3(); @@ -573404,32 +500818,32 @@ class WebSocketTransport { isBun = typeof Bun !== "undefined"; constructor(ws) { this.ws = ws; - this.opened = new Promise((resolve41, reject3) => { + this.opened = new Promise((resolve35, reject2) => { if (this.ws.readyState === WS_OPEN) { - resolve41(); + resolve35(); } else if (this.isBun) { const nws = this.ws; const onOpen = () => { nws.removeEventListener("open", onOpen); nws.removeEventListener("error", onError); - resolve41(); + resolve35(); }; const onError = (event) => { nws.removeEventListener("open", onOpen); nws.removeEventListener("error", onError); logForDiagnosticsNoPII("error", "mcp_websocket_connect_fail"); - reject3(event); + reject2(event); }; nws.addEventListener("open", onOpen); nws.addEventListener("error", onError); } else { const nws = this.ws; nws.on("open", () => { - resolve41(); + resolve35(); }); - nws.on("error", (error46) => { + nws.on("error", (error42) => { logForDiagnosticsNoPII("error", "mcp_websocket_connect_fail"); - reject3(error46); + reject2(error42); }); } }); @@ -573454,8 +500868,8 @@ class WebSocketTransport { const messageObj = jsonParse(data); const message = JSONRPCMessageSchema.parse(messageObj); this.onmessage?.(message); - } catch (error46) { - this.handleError(error46); + } catch (error42) { + this.handleError(error42); } }; onBunError = () => { @@ -573469,19 +500883,19 @@ class WebSocketTransport { const messageObj = jsonParse(data.toString("utf-8")); const message = JSONRPCMessageSchema.parse(messageObj); this.onmessage?.(message); - } catch (error46) { - this.handleError(error46); + } catch (error42) { + this.handleError(error42); } }; - onNodeError = (error46) => { - this.handleError(error46); + onNodeError = (error42) => { + this.handleError(error42); }; onNodeClose = () => { this.handleCloseCleanup(); }; - handleError(error46) { + handleError(error42) { logForDiagnosticsNoPII("error", "mcp_websocket_message_fail"); - this.onerror?.(toError(error46)); + this.onerror?.(toError(error42)); } handleCloseCleanup() { this.onclose?.(); @@ -573524,19 +500938,19 @@ class WebSocketTransport { if (this.isBun) { this.ws.send(json2); } else { - await new Promise((resolve41, reject3) => { - this.ws.send(json2, (error46) => { - if (error46) { - reject3(error46); + await new Promise((resolve35, reject2) => { + this.ws.send(json2, (error42) => { + if (error42) { + reject2(error42); } else { - resolve41(); + resolve35(); } }); }); } - } catch (error46) { - this.handleError(error46); - throw error46; + } catch (error42) { + this.handleError(error42); + throw error42; } } } @@ -573590,9 +501004,9 @@ function getElicitationMode(params) { function findElicitationInQueue(queue2, serverName, elicitationId) { return queue2.findIndex((e) => e.serverName === serverName && e.params.mode === "url" && ("elicitationId" in e.params) && e.params.elicitationId === elicitationId); } -function registerElicitationHandler(client5, serverName, setAppState) { +function registerElicitationHandler(client2, serverName, setAppState) { try { - client5.setRequestHandler(ElicitRequestSchema, async (request, extra) => { + client2.setRequestHandler(ElicitRequestSchema, async (request, extra) => { logMCPDebug(serverName, `Received elicitation request: ${jsonStringify(request)}`); const mode = getElicitationMode(request.params); logEvent("tengu_mcp_elicitation_shown", { @@ -573609,9 +501023,9 @@ function registerElicitationHandler(client5, serverName, setAppState) { return hookResponse; } const elicitationId = mode === "url" && "elicitationId" in request.params ? request.params.elicitationId : undefined; - const response = new Promise((resolve41) => { + const response = new Promise((resolve35) => { const onAbort = () => { - resolve41({ action: "cancel" }); + resolve35({ action: "cancel" }); }; if (extra.signal.aborted) { onAbort(); @@ -573629,13 +501043,13 @@ function registerElicitationHandler(client5, serverName, setAppState) { params: request.params, signal: extra.signal, waitingState, - respond: (result4) => { + respond: (result3) => { extra.signal.removeEventListener("abort", onAbort); logEvent("tengu_mcp_elicitation_response", { mode, - action: result4.action + action: result3.action }); - resolve41(result4); + resolve35(result3); } } ] @@ -573645,14 +501059,14 @@ function registerElicitationHandler(client5, serverName, setAppState) { }); const rawResult = await response; logMCPDebug(serverName, `Elicitation response: ${jsonStringify(rawResult)}`); - const result3 = await runElicitationResultHooks(serverName, rawResult, extra.signal, mode, elicitationId); - return result3; - } catch (error46) { - logMCPError(serverName, `Elicitation error: ${error46}`); + const result2 = await runElicitationResultHooks(serverName, rawResult, extra.signal, mode, elicitationId); + return result2; + } catch (error42) { + logMCPError(serverName, `Elicitation error: ${error42}`); return { action: "cancel" }; } }); - client5.setNotificationHandler(ElicitationCompleteNotificationSchema, (notification) => { + client2.setNotificationHandler(ElicitationCompleteNotificationSchema, (notification) => { const { elicitationId } = notification.params; logMCPDebug(serverName, `Received elicitation completion notification: ${elicitationId}`); executeNotificationHooks({ @@ -573701,17 +501115,17 @@ async function runElicitationHooks(serverName, params, signal) { }; } return; - } catch (error46) { - logMCPError(serverName, `Elicitation hook error: ${error46}`); + } catch (error42) { + logMCPError(serverName, `Elicitation hook error: ${error42}`); return; } } -async function runElicitationResultHooks(serverName, result3, signal, mode, elicitationId) { +async function runElicitationResultHooks(serverName, result2, signal, mode, elicitationId) { try { const { elicitationResultResponse, blockingError } = await executeElicitationResultHooks({ serverName, - action: result3.action, - content: result3.content, + action: result2.action, + content: result2.content, signal, mode, elicitationId @@ -573725,20 +501139,20 @@ async function runElicitationResultHooks(serverName, result3, signal, mode, elic } const finalResult = elicitationResultResponse ? { action: elicitationResultResponse.action, - content: elicitationResultResponse.content ?? result3.content - } : result3; + content: elicitationResultResponse.content ?? result2.content + } : result2; executeNotificationHooks({ message: `Elicitation response for server "${serverName}": ${finalResult.action}`, notificationType: "elicitation_response" }); return finalResult; - } catch (error46) { - logMCPError(serverName, `ElicitationResult hook error: ${error46}`); + } catch (error42) { + logMCPError(serverName, `ElicitationResult hook error: ${error42}`); executeNotificationHooks({ - message: `Elicitation response for server "${serverName}": ${result3.action}`, + message: `Elicitation response for server "${serverName}": ${result2.action}`, notificationType: "elicitation_response" }); - return result3; + return result2; } } var init_elicitationHandler = __esm(() => { @@ -573750,11 +501164,11 @@ var init_elicitationHandler = __esm(() => { }); // src/tools/MCPTool/classifyForCollapse.ts -function normalize12(name) { +function normalize11(name) { return name.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/-/g, "_").toLowerCase(); } function classifyMcpToolForCollapse(_serverName, toolName) { - const normalized = normalize12(toolName); + const normalized = normalize11(toolName); return { isSearch: SEARCH_TOOLS.has(normalized), isRead: READ_TOOLS.has(normalized) @@ -574264,38 +501678,38 @@ var init_classifyForCollapse = __esm(() => { }); // src/services/mcp/headersHelper.ts -function isMcpServerFromProjectOrLocalSettings(config5) { - return config5.scope === "project" || config5.scope === "local"; +function isMcpServerFromProjectOrLocalSettings(config3) { + return config3.scope === "project" || config3.scope === "local"; } -async function getMcpHeadersFromHelper(serverName, config5) { - if (!config5.headersHelper) { +async function getMcpHeadersFromHelper(serverName, config3) { + if (!config3.headersHelper) { return null; } - if ("scope" in config5 && isMcpServerFromProjectOrLocalSettings(config5) && !getIsNonInteractiveSession()) { + if ("scope" in config3 && isMcpServerFromProjectOrLocalSettings(config3) && !getIsNonInteractiveSession()) { const hasTrust = checkHasTrustDialogAccepted(); if (!hasTrust) { - const error46 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${"https://github.com/anthropics/claude-code/issues"}.`); - logAntError("MCP headersHelper invoked before trust check", error46); + const error42 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${"https://github.com/anthropics/claude-code/issues"}.`); + logAntError("MCP headersHelper invoked before trust check", error42); logEvent("tengu_mcp_headersHelper_missing_trust", {}); return null; } } try { logMCPDebug(serverName, "Executing headersHelper to get dynamic headers"); - const execResult = await execFileNoThrowWithCwd(config5.headersHelper, [], { + const execResult = await execFileNoThrowWithCwd(config3.headersHelper, [], { shell: true, timeout: 1e4, env: { ...process.env, CLAUDE_CODE_MCP_SERVER_NAME: serverName, - CLAUDE_CODE_MCP_SERVER_URL: config5.url + CLAUDE_CODE_MCP_SERVER_URL: config3.url } }); if (execResult.code !== 0 || !execResult.stdout) { throw new Error(`headersHelper for MCP server '${serverName}' did not return a valid value`); } - const result3 = execResult.stdout.trim(); - const headers = jsonParse(result3); + const result2 = execResult.stdout.trim(); + const headers = jsonParse(result2); if (typeof headers !== "object" || headers === null || Array.isArray(headers)) { throw new Error(`headersHelper for MCP server '${serverName}' must return a JSON object with string key-value pairs`); } @@ -574306,15 +501720,15 @@ async function getMcpHeadersFromHelper(serverName, config5) { } logMCPDebug(serverName, `Successfully retrieved ${Object.keys(headers).length} headers from headersHelper`); return headers; - } catch (error46) { - logMCPError(serverName, `Error getting headers from headersHelper: ${errorMessage(error46)}`); - logError2(new Error(`Error getting MCP headers from headersHelper for server '${serverName}': ${errorMessage(error46)}`)); + } catch (error42) { + logMCPError(serverName, `Error getting headers from headersHelper: ${errorMessage(error42)}`); + logError2(new Error(`Error getting MCP headers from headersHelper for server '${serverName}': ${errorMessage(error42)}`)); return null; } } -async function getMcpServerHeaders(serverName, config5) { - const staticHeaders = config5.headers || {}; - const dynamicHeaders = await getMcpHeadersFromHelper(serverName, config5) || {}; +async function getMcpServerHeaders(serverName, config3) { + const staticHeaders = config3.headers || {}; + const dynamicHeaders = await getMcpHeadersFromHelper(serverName, config3) || {}; return { ...staticHeaders, ...dynamicHeaders @@ -574380,47 +501794,47 @@ __export(exports_toolRendering, { renderChromeToolResultMessage: () => renderChromeToolResultMessage, getClaudeInChromeMCPToolOverrides: () => getClaudeInChromeMCPToolOverrides }); -function renderChromeToolUseMessage(input11, toolName, verbose) { - const tabId = input11.tabId; +function renderChromeToolUseMessage(input, toolName, verbose) { + const tabId = input.tabId; if (typeof tabId === "number") { trackClaudeInChromeTabId(tabId); } const secondaryInfo = []; switch (toolName) { case "navigate": - if (typeof input11.url === "string") { + if (typeof input.url === "string") { try { - const url3 = new URL(input11.url); + const url3 = new URL(input.url); secondaryInfo.push(url3.hostname); } catch { - secondaryInfo.push(truncateToWidth(input11.url, 30)); + secondaryInfo.push(truncateToWidth(input.url, 30)); } } break; case "find": - if (typeof input11.query === "string") { - secondaryInfo.push(`pattern: ${truncateToWidth(input11.query, 30)}`); + if (typeof input.query === "string") { + secondaryInfo.push(`pattern: ${truncateToWidth(input.query, 30)}`); } break; case "computer": - if (typeof input11.action === "string") { - const action2 = input11.action; + if (typeof input.action === "string") { + const action2 = input.action; if (action2 === "left_click" || action2 === "right_click" || action2 === "double_click" || action2 === "middle_click") { - if (typeof input11.ref === "string") { - secondaryInfo.push(`${action2} on ${input11.ref}`); - } else if (Array.isArray(input11.coordinate)) { - secondaryInfo.push(`${action2} at (${input11.coordinate.join(", ")})`); + if (typeof input.ref === "string") { + secondaryInfo.push(`${action2} on ${input.ref}`); + } else if (Array.isArray(input.coordinate)) { + secondaryInfo.push(`${action2} at (${input.coordinate.join(", ")})`); } else { secondaryInfo.push(action2); } - } else if (action2 === "type" && typeof input11.text === "string") { - secondaryInfo.push(`type "${truncateToWidth(input11.text, 15)}"`); - } else if (action2 === "key" && typeof input11.text === "string") { - secondaryInfo.push(`key ${input11.text}`); - } else if (action2 === "scroll" && typeof input11.scroll_direction === "string") { - secondaryInfo.push(`scroll ${input11.scroll_direction}`); - } else if (action2 === "wait" && typeof input11.duration === "number") { - secondaryInfo.push(`wait ${input11.duration}s`); + } else if (action2 === "type" && typeof input.text === "string") { + secondaryInfo.push(`type "${truncateToWidth(input.text, 15)}"`); + } else if (action2 === "key" && typeof input.text === "string") { + secondaryInfo.push(`key ${input.text}`); + } else if (action2 === "scroll" && typeof input.scroll_direction === "string") { + secondaryInfo.push(`scroll ${input.scroll_direction}`); + } else if (action2 === "wait" && typeof input.duration === "number") { + secondaryInfo.push(`wait ${input.duration}s`); } else if (action2 === "left_click_drag") { secondaryInfo.push("drag"); } else { @@ -574429,36 +501843,36 @@ function renderChromeToolUseMessage(input11, toolName, verbose) { } break; case "gif_creator": - if (typeof input11.action === "string") { - secondaryInfo.push(`${input11.action}`); + if (typeof input.action === "string") { + secondaryInfo.push(`${input.action}`); } break; case "resize_window": - if (typeof input11.width === "number" && typeof input11.height === "number") { - secondaryInfo.push(`${input11.width}x${input11.height}`); + if (typeof input.width === "number" && typeof input.height === "number") { + secondaryInfo.push(`${input.width}x${input.height}`); } break; case "read_console_messages": - if (typeof input11.pattern === "string") { - secondaryInfo.push(`pattern: ${truncateToWidth(input11.pattern, 20)}`); + if (typeof input.pattern === "string") { + secondaryInfo.push(`pattern: ${truncateToWidth(input.pattern, 20)}`); } - if (input11.onlyErrors === true) { + if (input.onlyErrors === true) { secondaryInfo.push("errors only"); } break; case "read_network_requests": - if (typeof input11.urlPattern === "string") { - secondaryInfo.push(`pattern: ${truncateToWidth(input11.urlPattern, 20)}`); + if (typeof input.urlPattern === "string") { + secondaryInfo.push(`pattern: ${truncateToWidth(input.urlPattern, 20)}`); } break; case "shortcuts_execute": - if (typeof input11.shortcutId === "string") { - secondaryInfo.push(`shortcut_id: ${input11.shortcutId}`); + if (typeof input.shortcutId === "string") { + secondaryInfo.push(`shortcut_id: ${input.shortcutId}`); } break; case "javascript_tool": - if (verbose && typeof input11.text === "string") { - return input11.text; + if (verbose && typeof input.text === "string") { + return input.text; } return ""; case "tabs_create_mcp": @@ -574473,14 +501887,14 @@ function renderChromeToolUseMessage(input11, toolName, verbose) { } return secondaryInfo.join(", ") || null; } -function renderChromeViewTabLink(input11) { +function renderChromeViewTabLink(input) { if (!supportsHyperlinks()) { return null; } - if (typeof input11 !== "object" || input11 === null || !("tabId" in input11)) { + if (typeof input !== "object" || input === null || !("tabId" in input)) { return null; } - const tabId = typeof input11.tabId === "number" ? input11.tabId : typeof input11.tabId === "string" ? parseInt(input11.tabId, 10) : NaN; + const tabId = typeof input.tabId === "number" ? input.tabId : typeof input.tabId === "string" ? parseInt(input.tabId, 10) : NaN; if (isNaN(tabId)) { return null; } @@ -574575,13 +501989,13 @@ function getClaudeInChromeMCPToolOverrides(toolName) { const displayName = toolName.replace(/_mcp$/, ""); return `Claude in Chrome[${displayName}]`; }, - renderToolUseMessage(input11, { + renderToolUseMessage(input, { verbose }) { - return renderChromeToolUseMessage(input11, toolName, verbose); + return renderChromeToolUseMessage(input, toolName, verbose); }, - renderToolUseTag(input11) { - return renderChromeViewTabLink(input11); + renderToolUseTag(input) { + return renderChromeViewTabLink(input); }, renderToolResultMessage(output, _progressMessagesForMessage, { verbose @@ -574902,11 +502316,11 @@ function ComputerUseAppListPanel(t0) { onDone(DENY_ALL_RESPONSE); return; } - const now3 = Date.now(); + const now2 = Date.now(); const granted = request.apps.flatMap((a_0) => a_0.resolved && checked.has(a_0.resolved.bundleId) ? [{ bundleId: a_0.resolved.bundleId, displayName: a_0.resolved.displayName, - grantedAt: now3 + grantedAt: now2 }] : []); const denied = request.apps.filter((a_1) => !a_1.resolved || !checked.has(a_1.resolved.bundleId)).map(_temp213); const flags = { @@ -575158,7 +502572,7 @@ var import_compiler_runtime124, import_react84, jsx_dev_runtime158, DENY_ALL_RES var init_ComputerUseApproval = __esm(() => { import_compiler_runtime124 = __toESM(require_compiler_runtime(), 1); init_sentinelApps(); - init_types13(); + init_types11(); init_figures(); import_react84 = __toESM(require_react(), 1); init_ink2(); @@ -575215,7 +502629,7 @@ function getChicagoCoordinateMode() { var DEFAULTS2, frozenCoordinateMode; var init_gates = __esm(() => { init_growthbook(); - init_auth2(); + init_auth(); init_envUtils(); DEFAULTS2 = { enabled: false, @@ -575289,7 +502703,7 @@ function getComputerUseMCPRenderingOverrides(toolName) { userFacingName() { return `Computer Use[${toolName}]`; }, - renderToolUseMessage(input11) { + renderToolUseMessage(input) { switch (toolName) { case "screenshot": case "left_mouse_down": @@ -575304,35 +502718,35 @@ function getComputerUseMCPRenderingOverrides(toolName) { case "double_click": case "triple_click": case "mouse_move": - return fmtCoord(input11.coordinate); + return fmtCoord(input.coordinate); case "left_click_drag": - return input11.start_coordinate ? `${fmtCoord(input11.start_coordinate)} → ${fmtCoord(input11.coordinate)}` : `to ${fmtCoord(input11.coordinate)}`; + return input.start_coordinate ? `${fmtCoord(input.start_coordinate)} → ${fmtCoord(input.coordinate)}` : `to ${fmtCoord(input.coordinate)}`; case "type": - return typeof input11.text === "string" ? `"${truncateToWidth(input11.text, 40)}"` : ""; + return typeof input.text === "string" ? `"${truncateToWidth(input.text, 40)}"` : ""; case "key": case "hold_key": - return typeof input11.text === "string" ? input11.text : ""; + return typeof input.text === "string" ? input.text : ""; case "scroll": - return [input11.direction, input11.amount && `×${input11.amount}`, input11.coordinate && `at ${fmtCoord(input11.coordinate)}`].filter(Boolean).join(" "); + return [input.direction, input.amount && `×${input.amount}`, input.coordinate && `at ${fmtCoord(input.coordinate)}`].filter(Boolean).join(" "); case "zoom": { - const r = input11.region; + const r = input.region; return Array.isArray(r) && r.length === 4 ? `[${r[0]}, ${r[1]}, ${r[2]}, ${r[3]}]` : ""; } case "wait": - return typeof input11.duration === "number" ? `${input11.duration}s` : ""; + return typeof input.duration === "number" ? `${input.duration}s` : ""; case "write_clipboard": - return typeof input11.text === "string" ? `"${truncateToWidth(input11.text, 40)}"` : ""; + return typeof input.text === "string" ? `"${truncateToWidth(input.text, 40)}"` : ""; case "open_application": - return typeof input11.bundle_id === "string" ? String(input11.bundle_id) : ""; + return typeof input.bundle_id === "string" ? String(input.bundle_id) : ""; case "request_access": { - const apps = input11.apps; + const apps = input.apps; if (!Array.isArray(apps)) return ""; const names = apps.map((a2) => typeof a2?.displayName === "string" ? a2.displayName : "").filter(Boolean); return names.join(", "); } case "computer_batch": { - const actions = input11.actions; + const actions = input.actions; return Array.isArray(actions) ? `${actions.length} actions` : ""; } default: @@ -575415,7 +502829,7 @@ function buildSessionContext() { const cu = prev.computerUseMcpState; const prevApps = cu?.allowedApps; const prevFlags = cu?.grantFlags; - const sameApps = prevApps?.length === apps.length && apps.every((a2, i4) => prevApps[i4]?.bundleId === a2.bundleId); + const sameApps = prevApps?.length === apps.length && apps.every((a2, i3) => prevApps[i3]?.bundleId === a2.bundleId); const sameFlags = prevFlags?.clipboardRead === flags.clipboardRead && prevFlags?.clipboardWrite === flags.clipboardWrite && prevFlags?.systemKeyCombos === flags.systemKeyCombos; return sameApps && sameFlags ? prev : { ...prev, @@ -575555,12 +502969,12 @@ function getComputerUseMCPToolOverrides(toolName) { } = getOrBind(); const { telemetry, - ...result3 + ...result2 } = await dispatch(toolName, args); if (telemetry?.error_kind) { logForDebugging(`[Computer Use MCP] ${toolName} error_kind=${telemetry.error_kind}`); } - const data = Array.isArray(result3.content) ? result3.content.map((item) => item.type === "image" ? { + const data = Array.isArray(result2.content) ? result2.content.map((item) => item.type === "image" ? { type: "image", source: { type: "base64", @@ -575570,7 +502984,7 @@ function getComputerUseMCPToolOverrides(toolName) { } : { type: "text", text: item.type === "text" ? item.text : "" - }) : result3.content; + }) : result2.content; return { data }; @@ -575591,15 +503005,15 @@ async function runPermissionDialog(req) { }; } try { - return await new Promise((resolve41, reject3) => { + return await new Promise((resolve35, reject2) => { const signal = context.abortController.signal; if (signal.aborted) { - reject3(new Error("Computer Use permission dialog aborted")); + reject2(new Error("Computer Use permission dialog aborted")); return; } const onAbort = () => { signal.removeEventListener("abort", onAbort); - reject3(new Error("Computer Use permission dialog aborted")); + reject2(new Error("Computer Use permission dialog aborted")); }; signal.addEventListener("abort", onAbort); setToolJSX({ @@ -575607,7 +503021,7 @@ async function runPermissionDialog(req) { request: req, onDone: (resp) => { signal.removeEventListener("abort", onAbort); - resolve41(resp); + resolve35(resp); } }), shouldHidePromptInput: true @@ -575631,4869 +503045,21 @@ var init_wrapper2 = __esm(() => { init_toolRendering2(); }); -// ../node_modules/ws/lib/constants.js -var require_constants12 = __commonJS((exports, module) => { - var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"]; - var hasBlob = typeof Blob !== "undefined"; - if (hasBlob) - BINARY_TYPES.push("blob"); - module.exports = { - BINARY_TYPES, - CLOSE_TIMEOUT: 30000, - EMPTY_BUFFER: Buffer.alloc(0), - GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11", - hasBlob, - kForOnEventAttribute: Symbol("kIsForOnEventAttribute"), - kListener: Symbol("kListener"), - kStatusCode: Symbol("status-code"), - kWebSocket: Symbol("websocket"), - NOOP: () => {} - }; -}); - -// ../node_modules/ws/lib/buffer-util.js -var require_buffer_util2 = __commonJS((exports, module) => { - var { EMPTY_BUFFER } = require_constants12(); - var FastBuffer = Buffer[Symbol.species]; - function concat3(list2, totalLength) { - if (list2.length === 0) - return EMPTY_BUFFER; - if (list2.length === 1) - return list2[0]; - const target = Buffer.allocUnsafe(totalLength); - let offset = 0; - for (let i4 = 0;i4 < list2.length; i4++) { - const buf = list2[i4]; - target.set(buf, offset); - offset += buf.length; - } - if (offset < totalLength) { - return new FastBuffer(target.buffer, target.byteOffset, offset); - } - return target; - } - function _mask(source, mask, output, offset, length) { - for (let i4 = 0;i4 < length; i4++) { - output[offset + i4] = source[i4] ^ mask[i4 & 3]; - } - } - function _unmask(buffer, mask) { - for (let i4 = 0;i4 < buffer.length; i4++) { - buffer[i4] ^= mask[i4 & 3]; - } - } - function toArrayBuffer(buf) { - if (buf.length === buf.buffer.byteLength) { - return buf.buffer; - } - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length); - } - function toBuffer(data) { - toBuffer.readOnly = true; - if (Buffer.isBuffer(data)) - return data; - let buf; - if (data instanceof ArrayBuffer) { - buf = new FastBuffer(data); - } else if (ArrayBuffer.isView(data)) { - buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength); - } else { - buf = Buffer.from(data); - toBuffer.readOnly = false; - } - return buf; - } - module.exports = { - concat: concat3, - mask: _mask, - toArrayBuffer, - toBuffer, - unmask: _unmask - }; - if (!process.env.WS_NO_BUFFER_UTIL) { - try { - const bufferUtil = (()=>{throw new Error("Cannot require module "+"bufferutil");})(); - module.exports.mask = function(source, mask, output, offset, length) { - if (length < 48) - _mask(source, mask, output, offset, length); - else - bufferUtil.mask(source, mask, output, offset, length); - }; - module.exports.unmask = function(buffer, mask) { - if (buffer.length < 32) - _unmask(buffer, mask); - else - bufferUtil.unmask(buffer, mask); - }; - } catch (e) {} - } -}); - -// ../node_modules/ws/lib/limiter.js -var require_limiter2 = __commonJS((exports, module) => { - var kDone = Symbol("kDone"); - var kRun = Symbol("kRun"); - - class Limiter { - constructor(concurrency) { - this[kDone] = () => { - this.pending--; - this[kRun](); - }; - this.concurrency = concurrency || Infinity; - this.jobs = []; - this.pending = 0; - } - add(job) { - this.jobs.push(job); - this[kRun](); - } - [kRun]() { - if (this.pending === this.concurrency) - return; - if (this.jobs.length) { - const job = this.jobs.shift(); - this.pending++; - job(this[kDone]); - } - } - } - module.exports = Limiter; -}); - -// ../node_modules/ws/lib/permessage-deflate.js -var require_permessage_deflate3 = __commonJS((exports, module) => { - var zlib3 = __require("zlib"); - var bufferUtil = require_buffer_util2(); - var Limiter = require_limiter2(); - var { kStatusCode } = require_constants12(); - var FastBuffer = Buffer[Symbol.species]; - var TRAILER = Buffer.from([0, 0, 255, 255]); - var kPerMessageDeflate = Symbol("permessage-deflate"); - var kTotalLength = Symbol("total-length"); - var kCallback = Symbol("callback"); - var kBuffers = Symbol("buffers"); - var kError = Symbol("error"); - var zlibLimiter; - - class PerMessageDeflate2 { - constructor(options2) { - this._options = options2 || {}; - this._threshold = this._options.threshold !== undefined ? this._options.threshold : 1024; - this._maxPayload = this._options.maxPayload | 0; - this._isServer = !!this._options.isServer; - this._deflate = null; - this._inflate = null; - this.params = null; - if (!zlibLimiter) { - const concurrency = this._options.concurrencyLimit !== undefined ? this._options.concurrencyLimit : 10; - zlibLimiter = new Limiter(concurrency); - } - } - static get extensionName() { - return "permessage-deflate"; - } - offer() { - const params = {}; - if (this._options.serverNoContextTakeover) { - params.server_no_context_takeover = true; - } - if (this._options.clientNoContextTakeover) { - params.client_no_context_takeover = true; - } - if (this._options.serverMaxWindowBits) { - params.server_max_window_bits = this._options.serverMaxWindowBits; - } - if (this._options.clientMaxWindowBits) { - params.client_max_window_bits = this._options.clientMaxWindowBits; - } else if (this._options.clientMaxWindowBits == null) { - params.client_max_window_bits = true; - } - return params; - } - accept(configurations) { - configurations = this.normalizeParams(configurations); - this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations); - return this.params; - } - cleanup() { - if (this._inflate) { - this._inflate.close(); - this._inflate = null; - } - if (this._deflate) { - const callback = this._deflate[kCallback]; - this._deflate.close(); - this._deflate = null; - if (callback) { - callback(new Error("The deflate stream was closed while data was being processed")); - } - } - } - acceptAsServer(offers) { - const opts = this._options; - const accepted = offers.find((params) => { - if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) { - return false; - } - return true; - }); - if (!accepted) { - throw new Error("None of the extension offers can be accepted"); - } - if (opts.serverNoContextTakeover) { - accepted.server_no_context_takeover = true; - } - if (opts.clientNoContextTakeover) { - accepted.client_no_context_takeover = true; - } - if (typeof opts.serverMaxWindowBits === "number") { - accepted.server_max_window_bits = opts.serverMaxWindowBits; - } - if (typeof opts.clientMaxWindowBits === "number") { - accepted.client_max_window_bits = opts.clientMaxWindowBits; - } else if (accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false) { - delete accepted.client_max_window_bits; - } - return accepted; - } - acceptAsClient(response) { - const params = response[0]; - if (this._options.clientNoContextTakeover === false && params.client_no_context_takeover) { - throw new Error('Unexpected parameter "client_no_context_takeover"'); - } - if (!params.client_max_window_bits) { - if (typeof this._options.clientMaxWindowBits === "number") { - params.client_max_window_bits = this._options.clientMaxWindowBits; - } - } else if (this._options.clientMaxWindowBits === false || typeof this._options.clientMaxWindowBits === "number" && params.client_max_window_bits > this._options.clientMaxWindowBits) { - throw new Error('Unexpected or invalid parameter "client_max_window_bits"'); - } - return params; - } - normalizeParams(configurations) { - configurations.forEach((params) => { - Object.keys(params).forEach((key) => { - let value = params[key]; - if (value.length > 1) { - throw new Error(`Parameter "${key}" must have only a single value`); - } - value = value[0]; - if (key === "client_max_window_bits") { - if (value !== true) { - const num = +value; - if (!Number.isInteger(num) || num < 8 || num > 15) { - throw new TypeError(`Invalid value for parameter "${key}": ${value}`); - } - value = num; - } else if (!this._isServer) { - throw new TypeError(`Invalid value for parameter "${key}": ${value}`); - } - } else if (key === "server_max_window_bits") { - const num = +value; - if (!Number.isInteger(num) || num < 8 || num > 15) { - throw new TypeError(`Invalid value for parameter "${key}": ${value}`); - } - value = num; - } else if (key === "client_no_context_takeover" || key === "server_no_context_takeover") { - if (value !== true) { - throw new TypeError(`Invalid value for parameter "${key}": ${value}`); - } - } else { - throw new Error(`Unknown parameter "${key}"`); - } - params[key] = value; - }); - }); - return configurations; - } - decompress(data, fin, callback) { - zlibLimiter.add((done) => { - this._decompress(data, fin, (err3, result3) => { - done(); - callback(err3, result3); - }); - }); - } - compress(data, fin, callback) { - zlibLimiter.add((done) => { - this._compress(data, fin, (err3, result3) => { - done(); - callback(err3, result3); - }); - }); - } - _decompress(data, fin, callback) { - const endpoint = this._isServer ? "client" : "server"; - if (!this._inflate) { - const key = `${endpoint}_max_window_bits`; - const windowBits = typeof this.params[key] !== "number" ? zlib3.Z_DEFAULT_WINDOWBITS : this.params[key]; - this._inflate = zlib3.createInflateRaw({ - ...this._options.zlibInflateOptions, - windowBits - }); - this._inflate[kPerMessageDeflate] = this; - this._inflate[kTotalLength] = 0; - this._inflate[kBuffers] = []; - this._inflate.on("error", inflateOnError); - this._inflate.on("data", inflateOnData); - } - this._inflate[kCallback] = callback; - this._inflate.write(data); - if (fin) - this._inflate.write(TRAILER); - this._inflate.flush(() => { - const err3 = this._inflate[kError]; - if (err3) { - this._inflate.close(); - this._inflate = null; - callback(err3); - return; - } - const data2 = bufferUtil.concat(this._inflate[kBuffers], this._inflate[kTotalLength]); - if (this._inflate._readableState.endEmitted) { - this._inflate.close(); - this._inflate = null; - } else { - this._inflate[kTotalLength] = 0; - this._inflate[kBuffers] = []; - if (fin && this.params[`${endpoint}_no_context_takeover`]) { - this._inflate.reset(); - } - } - callback(null, data2); - }); - } - _compress(data, fin, callback) { - const endpoint = this._isServer ? "server" : "client"; - if (!this._deflate) { - const key = `${endpoint}_max_window_bits`; - const windowBits = typeof this.params[key] !== "number" ? zlib3.Z_DEFAULT_WINDOWBITS : this.params[key]; - this._deflate = zlib3.createDeflateRaw({ - ...this._options.zlibDeflateOptions, - windowBits - }); - this._deflate[kTotalLength] = 0; - this._deflate[kBuffers] = []; - this._deflate.on("data", deflateOnData); - } - this._deflate[kCallback] = callback; - this._deflate.write(data); - this._deflate.flush(zlib3.Z_SYNC_FLUSH, () => { - if (!this._deflate) { - return; - } - let data2 = bufferUtil.concat(this._deflate[kBuffers], this._deflate[kTotalLength]); - if (fin) { - data2 = new FastBuffer(data2.buffer, data2.byteOffset, data2.length - 4); - } - this._deflate[kCallback] = null; - this._deflate[kTotalLength] = 0; - this._deflate[kBuffers] = []; - if (fin && this.params[`${endpoint}_no_context_takeover`]) { - this._deflate.reset(); - } - callback(null, data2); - }); - } - } - module.exports = PerMessageDeflate2; - function deflateOnData(chunk3) { - this[kBuffers].push(chunk3); - this[kTotalLength] += chunk3.length; - } - function inflateOnData(chunk3) { - this[kTotalLength] += chunk3.length; - if (this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload) { - this[kBuffers].push(chunk3); - return; - } - this[kError] = new RangeError("Max payload size exceeded"); - this[kError].code = "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"; - this[kError][kStatusCode] = 1009; - this.removeListener("data", inflateOnData); - this.reset(); - } - function inflateOnError(err3) { - this[kPerMessageDeflate]._inflate = null; - if (this[kError]) { - this[kCallback](this[kError]); - return; - } - err3[kStatusCode] = 1007; - this[kCallback](err3); - } -}); - -// ../node_modules/ws/lib/validation.js -var require_validation4 = __commonJS((exports, module) => { - var { isUtf8 } = __require("buffer"); - var { hasBlob } = require_constants12(); - var tokenChars = [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0 - ]; - function isValidStatusCode(code) { - return code >= 1000 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006 || code >= 3000 && code <= 4999; - } - function _isValidUTF8(buf) { - const len = buf.length; - let i4 = 0; - while (i4 < len) { - if ((buf[i4] & 128) === 0) { - i4++; - } else if ((buf[i4] & 224) === 192) { - if (i4 + 1 === len || (buf[i4 + 1] & 192) !== 128 || (buf[i4] & 254) === 192) { - return false; - } - i4 += 2; - } else if ((buf[i4] & 240) === 224) { - if (i4 + 2 >= len || (buf[i4 + 1] & 192) !== 128 || (buf[i4 + 2] & 192) !== 128 || buf[i4] === 224 && (buf[i4 + 1] & 224) === 128 || buf[i4] === 237 && (buf[i4 + 1] & 224) === 160) { - return false; - } - i4 += 3; - } else if ((buf[i4] & 248) === 240) { - if (i4 + 3 >= len || (buf[i4 + 1] & 192) !== 128 || (buf[i4 + 2] & 192) !== 128 || (buf[i4 + 3] & 192) !== 128 || buf[i4] === 240 && (buf[i4 + 1] & 240) === 128 || buf[i4] === 244 && buf[i4 + 1] > 143 || buf[i4] > 244) { - return false; - } - i4 += 4; - } else { - return false; - } - } - return true; - } - function isBlob2(value) { - return hasBlob && typeof value === "object" && typeof value.arrayBuffer === "function" && typeof value.type === "string" && typeof value.stream === "function" && (value[Symbol.toStringTag] === "Blob" || value[Symbol.toStringTag] === "File"); - } - module.exports = { - isBlob: isBlob2, - isValidStatusCode, - isValidUTF8: _isValidUTF8, - tokenChars - }; - if (isUtf8) { - module.exports.isValidUTF8 = function(buf) { - return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf); - }; - } else if (!process.env.WS_NO_UTF_8_VALIDATE) { - try { - const isValidUTF8 = (()=>{throw new Error("Cannot require module "+"utf-8-validate");})(); - module.exports.isValidUTF8 = function(buf) { - return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf); - }; - } catch (e) {} - } -}); - -// ../node_modules/ws/lib/receiver.js -var require_receiver3 = __commonJS((exports, module) => { - var { Writable: Writable4 } = __require("stream"); - var PerMessageDeflate2 = require_permessage_deflate3(); - var { - BINARY_TYPES, - EMPTY_BUFFER, - kStatusCode, - kWebSocket - } = require_constants12(); - var { concat: concat3, toArrayBuffer, unmask } = require_buffer_util2(); - var { isValidStatusCode, isValidUTF8 } = require_validation4(); - var FastBuffer = Buffer[Symbol.species]; - var GET_INFO = 0; - var GET_PAYLOAD_LENGTH_16 = 1; - var GET_PAYLOAD_LENGTH_64 = 2; - var GET_MASK = 3; - var GET_DATA = 4; - var INFLATING = 5; - var DEFER_EVENT = 6; - - class Receiver2 extends Writable4 { - constructor(options2 = {}) { - super(); - this._allowSynchronousEvents = options2.allowSynchronousEvents !== undefined ? options2.allowSynchronousEvents : true; - this._binaryType = options2.binaryType || BINARY_TYPES[0]; - this._extensions = options2.extensions || {}; - this._isServer = !!options2.isServer; - this._maxPayload = options2.maxPayload | 0; - this._skipUTF8Validation = !!options2.skipUTF8Validation; - this[kWebSocket] = undefined; - this._bufferedBytes = 0; - this._buffers = []; - this._compressed = false; - this._payloadLength = 0; - this._mask = undefined; - this._fragmented = 0; - this._masked = false; - this._fin = false; - this._opcode = 0; - this._totalPayloadLength = 0; - this._messageLength = 0; - this._fragments = []; - this._errored = false; - this._loop = false; - this._state = GET_INFO; - } - _write(chunk3, encoding, cb) { - if (this._opcode === 8 && this._state == GET_INFO) - return cb(); - this._bufferedBytes += chunk3.length; - this._buffers.push(chunk3); - this.startLoop(cb); - } - consume(n2) { - this._bufferedBytes -= n2; - if (n2 === this._buffers[0].length) - return this._buffers.shift(); - if (n2 < this._buffers[0].length) { - const buf = this._buffers[0]; - this._buffers[0] = new FastBuffer(buf.buffer, buf.byteOffset + n2, buf.length - n2); - return new FastBuffer(buf.buffer, buf.byteOffset, n2); - } - const dst = Buffer.allocUnsafe(n2); - do { - const buf = this._buffers[0]; - const offset = dst.length - n2; - if (n2 >= buf.length) { - dst.set(this._buffers.shift(), offset); - } else { - dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n2), offset); - this._buffers[0] = new FastBuffer(buf.buffer, buf.byteOffset + n2, buf.length - n2); - } - n2 -= buf.length; - } while (n2 > 0); - return dst; - } - startLoop(cb) { - this._loop = true; - do { - switch (this._state) { - case GET_INFO: - this.getInfo(cb); - break; - case GET_PAYLOAD_LENGTH_16: - this.getPayloadLength16(cb); - break; - case GET_PAYLOAD_LENGTH_64: - this.getPayloadLength64(cb); - break; - case GET_MASK: - this.getMask(); - break; - case GET_DATA: - this.getData(cb); - break; - case INFLATING: - case DEFER_EVENT: - this._loop = false; - return; - } - } while (this._loop); - if (!this._errored) - cb(); - } - getInfo(cb) { - if (this._bufferedBytes < 2) { - this._loop = false; - return; - } - const buf = this.consume(2); - if ((buf[0] & 48) !== 0) { - const error46 = this.createError(RangeError, "RSV2 and RSV3 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_2_3"); - cb(error46); - return; - } - const compressed = (buf[0] & 64) === 64; - if (compressed && !this._extensions[PerMessageDeflate2.extensionName]) { - const error46 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); - cb(error46); - return; - } - this._fin = (buf[0] & 128) === 128; - this._opcode = buf[0] & 15; - this._payloadLength = buf[1] & 127; - if (this._opcode === 0) { - if (compressed) { - const error46 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); - cb(error46); - return; - } - if (!this._fragmented) { - const error46 = this.createError(RangeError, "invalid opcode 0", true, 1002, "WS_ERR_INVALID_OPCODE"); - cb(error46); - return; - } - this._opcode = this._fragmented; - } else if (this._opcode === 1 || this._opcode === 2) { - if (this._fragmented) { - const error46 = this.createError(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); - cb(error46); - return; - } - this._compressed = compressed; - } else if (this._opcode > 7 && this._opcode < 11) { - if (!this._fin) { - const error46 = this.createError(RangeError, "FIN must be set", true, 1002, "WS_ERR_EXPECTED_FIN"); - cb(error46); - return; - } - if (compressed) { - const error46 = this.createError(RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1"); - cb(error46); - return; - } - if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) { - const error46 = this.createError(RangeError, `invalid payload length ${this._payloadLength}`, true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"); - cb(error46); - return; - } - } else { - const error46 = this.createError(RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE"); - cb(error46); - return; - } - if (!this._fin && !this._fragmented) - this._fragmented = this._opcode; - this._masked = (buf[1] & 128) === 128; - if (this._isServer) { - if (!this._masked) { - const error46 = this.createError(RangeError, "MASK must be set", true, 1002, "WS_ERR_EXPECTED_MASK"); - cb(error46); - return; - } - } else if (this._masked) { - const error46 = this.createError(RangeError, "MASK must be clear", true, 1002, "WS_ERR_UNEXPECTED_MASK"); - cb(error46); - return; - } - if (this._payloadLength === 126) - this._state = GET_PAYLOAD_LENGTH_16; - else if (this._payloadLength === 127) - this._state = GET_PAYLOAD_LENGTH_64; - else - this.haveLength(cb); - } - getPayloadLength16(cb) { - if (this._bufferedBytes < 2) { - this._loop = false; - return; - } - this._payloadLength = this.consume(2).readUInt16BE(0); - this.haveLength(cb); - } - getPayloadLength64(cb) { - if (this._bufferedBytes < 8) { - this._loop = false; - return; - } - const buf = this.consume(8); - const num = buf.readUInt32BE(0); - if (num > Math.pow(2, 53 - 32) - 1) { - const error46 = this.createError(RangeError, "Unsupported WebSocket frame: payload length > 2^53 - 1", false, 1009, "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"); - cb(error46); - return; - } - this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); - this.haveLength(cb); - } - haveLength(cb) { - if (this._payloadLength && this._opcode < 8) { - this._totalPayloadLength += this._payloadLength; - if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { - const error46 = this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"); - cb(error46); - return; - } - } - if (this._masked) - this._state = GET_MASK; - else - this._state = GET_DATA; - } - getMask() { - if (this._bufferedBytes < 4) { - this._loop = false; - return; - } - this._mask = this.consume(4); - this._state = GET_DATA; - } - getData(cb) { - let data = EMPTY_BUFFER; - if (this._payloadLength) { - if (this._bufferedBytes < this._payloadLength) { - this._loop = false; - return; - } - data = this.consume(this._payloadLength); - if (this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0) { - unmask(data, this._mask); - } - } - if (this._opcode > 7) { - this.controlMessage(data, cb); - return; - } - if (this._compressed) { - this._state = INFLATING; - this.decompress(data, cb); - return; - } - if (data.length) { - this._messageLength = this._totalPayloadLength; - this._fragments.push(data); - } - this.dataMessage(cb); - } - decompress(data, cb) { - const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName]; - perMessageDeflate.decompress(data, this._fin, (err3, buf) => { - if (err3) - return cb(err3); - if (buf.length) { - this._messageLength += buf.length; - if (this._messageLength > this._maxPayload && this._maxPayload > 0) { - const error46 = this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"); - cb(error46); - return; - } - this._fragments.push(buf); - } - this.dataMessage(cb); - if (this._state === GET_INFO) - this.startLoop(cb); - }); - } - dataMessage(cb) { - if (!this._fin) { - this._state = GET_INFO; - return; - } - const messageLength = this._messageLength; - const fragments = this._fragments; - this._totalPayloadLength = 0; - this._messageLength = 0; - this._fragmented = 0; - this._fragments = []; - if (this._opcode === 2) { - let data; - if (this._binaryType === "nodebuffer") { - data = concat3(fragments, messageLength); - } else if (this._binaryType === "arraybuffer") { - data = toArrayBuffer(concat3(fragments, messageLength)); - } else if (this._binaryType === "blob") { - data = new Blob(fragments); - } else { - data = fragments; - } - if (this._allowSynchronousEvents) { - this.emit("message", data, true); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit("message", data, true); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } else { - const buf = concat3(fragments, messageLength); - if (!this._skipUTF8Validation && !isValidUTF8(buf)) { - const error46 = this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); - cb(error46); - return; - } - if (this._state === INFLATING || this._allowSynchronousEvents) { - this.emit("message", buf, false); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit("message", buf, false); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } - } - controlMessage(data, cb) { - if (this._opcode === 8) { - if (data.length === 0) { - this._loop = false; - this.emit("conclude", 1005, EMPTY_BUFFER); - this.end(); - } else { - const code = data.readUInt16BE(0); - if (!isValidStatusCode(code)) { - const error46 = this.createError(RangeError, `invalid status code ${code}`, true, 1002, "WS_ERR_INVALID_CLOSE_CODE"); - cb(error46); - return; - } - const buf = new FastBuffer(data.buffer, data.byteOffset + 2, data.length - 2); - if (!this._skipUTF8Validation && !isValidUTF8(buf)) { - const error46 = this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8"); - cb(error46); - return; - } - this._loop = false; - this.emit("conclude", code, buf); - this.end(); - } - this._state = GET_INFO; - return; - } - if (this._allowSynchronousEvents) { - this.emit(this._opcode === 9 ? "ping" : "pong", data); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit(this._opcode === 9 ? "ping" : "pong", data); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } - createError(ErrorCtor, message, prefix, statusCode, errorCode) { - this._loop = false; - this._errored = true; - const err3 = new ErrorCtor(prefix ? `Invalid WebSocket frame: ${message}` : message); - Error.captureStackTrace(err3, this.createError); - err3.code = errorCode; - err3[kStatusCode] = statusCode; - return err3; - } - } - module.exports = Receiver2; -}); - -// ../node_modules/ws/lib/sender.js -var require_sender3 = __commonJS((exports, module) => { - var { Duplex: Duplex4 } = __require("stream"); - var { randomFillSync } = __require("crypto"); - var PerMessageDeflate2 = require_permessage_deflate3(); - var { EMPTY_BUFFER, kWebSocket, NOOP: NOOP2 } = require_constants12(); - var { isBlob: isBlob2, isValidStatusCode } = require_validation4(); - var { mask: applyMask, toBuffer } = require_buffer_util2(); - var kByteLength = Symbol("kByteLength"); - var maskBuffer = Buffer.alloc(4); - var RANDOM_POOL_SIZE = 8 * 1024; - var randomPool; - var randomPoolPointer = RANDOM_POOL_SIZE; - var DEFAULT = 0; - var DEFLATING = 1; - var GET_BLOB_DATA = 2; - - class Sender2 { - constructor(socket, extensions, generateMask) { - this._extensions = extensions || {}; - if (generateMask) { - this._generateMask = generateMask; - this._maskBuffer = Buffer.alloc(4); - } - this._socket = socket; - this._firstFragment = true; - this._compress = false; - this._bufferedBytes = 0; - this._queue = []; - this._state = DEFAULT; - this.onerror = NOOP2; - this[kWebSocket] = undefined; - } - static frame(data, options2) { - let mask; - let merge6 = false; - let offset = 2; - let skipMasking = false; - if (options2.mask) { - mask = options2.maskBuffer || maskBuffer; - if (options2.generateMask) { - options2.generateMask(mask); - } else { - if (randomPoolPointer === RANDOM_POOL_SIZE) { - if (randomPool === undefined) { - randomPool = Buffer.alloc(RANDOM_POOL_SIZE); - } - randomFillSync(randomPool, 0, RANDOM_POOL_SIZE); - randomPoolPointer = 0; - } - mask[0] = randomPool[randomPoolPointer++]; - mask[1] = randomPool[randomPoolPointer++]; - mask[2] = randomPool[randomPoolPointer++]; - mask[3] = randomPool[randomPoolPointer++]; - } - skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0; - offset = 6; - } - let dataLength; - if (typeof data === "string") { - if ((!options2.mask || skipMasking) && options2[kByteLength] !== undefined) { - dataLength = options2[kByteLength]; - } else { - data = Buffer.from(data); - dataLength = data.length; - } - } else { - dataLength = data.length; - merge6 = options2.mask && options2.readOnly && !skipMasking; - } - let payloadLength = dataLength; - if (dataLength >= 65536) { - offset += 8; - payloadLength = 127; - } else if (dataLength > 125) { - offset += 2; - payloadLength = 126; - } - const target = Buffer.allocUnsafe(merge6 ? dataLength + offset : offset); - target[0] = options2.fin ? options2.opcode | 128 : options2.opcode; - if (options2.rsv1) - target[0] |= 64; - target[1] = payloadLength; - if (payloadLength === 126) { - target.writeUInt16BE(dataLength, 2); - } else if (payloadLength === 127) { - target[2] = target[3] = 0; - target.writeUIntBE(dataLength, 4, 6); - } - if (!options2.mask) - return [target, data]; - target[1] |= 128; - target[offset - 4] = mask[0]; - target[offset - 3] = mask[1]; - target[offset - 2] = mask[2]; - target[offset - 1] = mask[3]; - if (skipMasking) - return [target, data]; - if (merge6) { - applyMask(data, mask, target, offset, dataLength); - return [target]; - } - applyMask(data, mask, data, 0, dataLength); - return [target, data]; - } - close(code, data, mask, cb) { - let buf; - if (code === undefined) { - buf = EMPTY_BUFFER; - } else if (typeof code !== "number" || !isValidStatusCode(code)) { - throw new TypeError("First argument must be a valid error code number"); - } else if (data === undefined || !data.length) { - buf = Buffer.allocUnsafe(2); - buf.writeUInt16BE(code, 0); - } else { - const length = Buffer.byteLength(data); - if (length > 123) { - throw new RangeError("The message must not be greater than 123 bytes"); - } - buf = Buffer.allocUnsafe(2 + length); - buf.writeUInt16BE(code, 0); - if (typeof data === "string") { - buf.write(data, 2); - } else { - buf.set(data, 2); - } - } - const options2 = { - [kByteLength]: buf.length, - fin: true, - generateMask: this._generateMask, - mask, - maskBuffer: this._maskBuffer, - opcode: 8, - readOnly: false, - rsv1: false - }; - if (this._state !== DEFAULT) { - this.enqueue([this.dispatch, buf, false, options2, cb]); - } else { - this.sendFrame(Sender2.frame(buf, options2), cb); - } - } - ping(data, mask, cb) { - let byteLength; - let readOnly; - if (typeof data === "string") { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else if (isBlob2(data)) { - byteLength = data.size; - readOnly = false; - } else { - data = toBuffer(data); - byteLength = data.length; - readOnly = toBuffer.readOnly; - } - if (byteLength > 125) { - throw new RangeError("The data size must not be greater than 125 bytes"); - } - const options2 = { - [kByteLength]: byteLength, - fin: true, - generateMask: this._generateMask, - mask, - maskBuffer: this._maskBuffer, - opcode: 9, - readOnly, - rsv1: false - }; - if (isBlob2(data)) { - if (this._state !== DEFAULT) { - this.enqueue([this.getBlobData, data, false, options2, cb]); - } else { - this.getBlobData(data, false, options2, cb); - } - } else if (this._state !== DEFAULT) { - this.enqueue([this.dispatch, data, false, options2, cb]); - } else { - this.sendFrame(Sender2.frame(data, options2), cb); - } - } - pong(data, mask, cb) { - let byteLength; - let readOnly; - if (typeof data === "string") { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else if (isBlob2(data)) { - byteLength = data.size; - readOnly = false; - } else { - data = toBuffer(data); - byteLength = data.length; - readOnly = toBuffer.readOnly; - } - if (byteLength > 125) { - throw new RangeError("The data size must not be greater than 125 bytes"); - } - const options2 = { - [kByteLength]: byteLength, - fin: true, - generateMask: this._generateMask, - mask, - maskBuffer: this._maskBuffer, - opcode: 10, - readOnly, - rsv1: false - }; - if (isBlob2(data)) { - if (this._state !== DEFAULT) { - this.enqueue([this.getBlobData, data, false, options2, cb]); - } else { - this.getBlobData(data, false, options2, cb); - } - } else if (this._state !== DEFAULT) { - this.enqueue([this.dispatch, data, false, options2, cb]); - } else { - this.sendFrame(Sender2.frame(data, options2), cb); - } - } - send(data, options2, cb) { - const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName]; - let opcode = options2.binary ? 2 : 1; - let rsv1 = options2.compress; - let byteLength; - let readOnly; - if (typeof data === "string") { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else if (isBlob2(data)) { - byteLength = data.size; - readOnly = false; - } else { - data = toBuffer(data); - byteLength = data.length; - readOnly = toBuffer.readOnly; - } - if (this._firstFragment) { - this._firstFragment = false; - if (rsv1 && perMessageDeflate && perMessageDeflate.params[perMessageDeflate._isServer ? "server_no_context_takeover" : "client_no_context_takeover"]) { - rsv1 = byteLength >= perMessageDeflate._threshold; - } - this._compress = rsv1; - } else { - rsv1 = false; - opcode = 0; - } - if (options2.fin) - this._firstFragment = true; - const opts = { - [kByteLength]: byteLength, - fin: options2.fin, - generateMask: this._generateMask, - mask: options2.mask, - maskBuffer: this._maskBuffer, - opcode, - readOnly, - rsv1 - }; - if (isBlob2(data)) { - if (this._state !== DEFAULT) { - this.enqueue([this.getBlobData, data, this._compress, opts, cb]); - } else { - this.getBlobData(data, this._compress, opts, cb); - } - } else if (this._state !== DEFAULT) { - this.enqueue([this.dispatch, data, this._compress, opts, cb]); - } else { - this.dispatch(data, this._compress, opts, cb); - } - } - getBlobData(blob2, compress, options2, cb) { - this._bufferedBytes += options2[kByteLength]; - this._state = GET_BLOB_DATA; - blob2.arrayBuffer().then((arrayBuffer) => { - if (this._socket.destroyed) { - const err3 = new Error("The socket was closed while the blob was being read"); - process.nextTick(callCallbacks, this, err3, cb); - return; - } - this._bufferedBytes -= options2[kByteLength]; - const data = toBuffer(arrayBuffer); - if (!compress) { - this._state = DEFAULT; - this.sendFrame(Sender2.frame(data, options2), cb); - this.dequeue(); - } else { - this.dispatch(data, compress, options2, cb); - } - }).catch((err3) => { - process.nextTick(onError, this, err3, cb); - }); - } - dispatch(data, compress, options2, cb) { - if (!compress) { - this.sendFrame(Sender2.frame(data, options2), cb); - return; - } - const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName]; - this._bufferedBytes += options2[kByteLength]; - this._state = DEFLATING; - perMessageDeflate.compress(data, options2.fin, (_, buf) => { - if (this._socket.destroyed) { - const err3 = new Error("The socket was closed while data was being compressed"); - callCallbacks(this, err3, cb); - return; - } - this._bufferedBytes -= options2[kByteLength]; - this._state = DEFAULT; - options2.readOnly = false; - this.sendFrame(Sender2.frame(buf, options2), cb); - this.dequeue(); - }); - } - dequeue() { - while (this._state === DEFAULT && this._queue.length) { - const params = this._queue.shift(); - this._bufferedBytes -= params[3][kByteLength]; - Reflect.apply(params[0], this, params.slice(1)); - } - } - enqueue(params) { - this._bufferedBytes += params[3][kByteLength]; - this._queue.push(params); - } - sendFrame(list2, cb) { - if (list2.length === 2) { - this._socket.cork(); - this._socket.write(list2[0]); - this._socket.write(list2[1], cb); - this._socket.uncork(); - } else { - this._socket.write(list2[0], cb); - } - } - } - module.exports = Sender2; - function callCallbacks(sender, err3, cb) { - if (typeof cb === "function") - cb(err3); - for (let i4 = 0;i4 < sender._queue.length; i4++) { - const params = sender._queue[i4]; - const callback = params[params.length - 1]; - if (typeof callback === "function") - callback(err3); - } - } - function onError(sender, err3, cb) { - callCallbacks(sender, err3, cb); - sender.onerror(err3); - } -}); - -// ../node_modules/ws/lib/event-target.js -var require_event_target2 = __commonJS((exports, module) => { - var { kForOnEventAttribute, kListener } = require_constants12(); - var kCode = Symbol("kCode"); - var kData = Symbol("kData"); - var kError = Symbol("kError"); - var kMessage = Symbol("kMessage"); - var kReason = Symbol("kReason"); - var kTarget = Symbol("kTarget"); - var kType = Symbol("kType"); - var kWasClean = Symbol("kWasClean"); - - class Event3 { - constructor(type) { - this[kTarget] = null; - this[kType] = type; - } - get target() { - return this[kTarget]; - } - get type() { - return this[kType]; - } - } - Object.defineProperty(Event3.prototype, "target", { enumerable: true }); - Object.defineProperty(Event3.prototype, "type", { enumerable: true }); - - class CloseEvent extends Event3 { - constructor(type, options2 = {}) { - super(type); - this[kCode] = options2.code === undefined ? 0 : options2.code; - this[kReason] = options2.reason === undefined ? "" : options2.reason; - this[kWasClean] = options2.wasClean === undefined ? false : options2.wasClean; - } - get code() { - return this[kCode]; - } - get reason() { - return this[kReason]; - } - get wasClean() { - return this[kWasClean]; - } - } - Object.defineProperty(CloseEvent.prototype, "code", { enumerable: true }); - Object.defineProperty(CloseEvent.prototype, "reason", { enumerable: true }); - Object.defineProperty(CloseEvent.prototype, "wasClean", { enumerable: true }); - - class ErrorEvent2 extends Event3 { - constructor(type, options2 = {}) { - super(type); - this[kError] = options2.error === undefined ? null : options2.error; - this[kMessage] = options2.message === undefined ? "" : options2.message; - } - get error() { - return this[kError]; - } - get message() { - return this[kMessage]; - } - } - Object.defineProperty(ErrorEvent2.prototype, "error", { enumerable: true }); - Object.defineProperty(ErrorEvent2.prototype, "message", { enumerable: true }); - - class MessageEvent2 extends Event3 { - constructor(type, options2 = {}) { - super(type); - this[kData] = options2.data === undefined ? null : options2.data; - } - get data() { - return this[kData]; - } - } - Object.defineProperty(MessageEvent2.prototype, "data", { enumerable: true }); - var EventTarget2 = { - addEventListener(type, handler14, options2 = {}) { - for (const listener2 of this.listeners(type)) { - if (!options2[kForOnEventAttribute] && listener2[kListener] === handler14 && !listener2[kForOnEventAttribute]) { - return; - } - } - let wrapper; - if (type === "message") { - wrapper = function onMessage(data, isBinary) { - const event = new MessageEvent2("message", { - data: isBinary ? data : data.toString() - }); - event[kTarget] = this; - callListener(handler14, this, event); - }; - } else if (type === "close") { - wrapper = function onClose(code, message) { - const event = new CloseEvent("close", { - code, - reason: message.toString(), - wasClean: this._closeFrameReceived && this._closeFrameSent - }); - event[kTarget] = this; - callListener(handler14, this, event); - }; - } else if (type === "error") { - wrapper = function onError(error46) { - const event = new ErrorEvent2("error", { - error: error46, - message: error46.message - }); - event[kTarget] = this; - callListener(handler14, this, event); - }; - } else if (type === "open") { - wrapper = function onOpen() { - const event = new Event3("open"); - event[kTarget] = this; - callListener(handler14, this, event); - }; - } else { - return; - } - wrapper[kForOnEventAttribute] = !!options2[kForOnEventAttribute]; - wrapper[kListener] = handler14; - if (options2.once) { - this.once(type, wrapper); - } else { - this.on(type, wrapper); - } - }, - removeEventListener(type, handler14) { - for (const listener2 of this.listeners(type)) { - if (listener2[kListener] === handler14 && !listener2[kForOnEventAttribute]) { - this.removeListener(type, listener2); - break; - } - } - } - }; - module.exports = { - CloseEvent, - ErrorEvent: ErrorEvent2, - Event: Event3, - EventTarget: EventTarget2, - MessageEvent: MessageEvent2 - }; - function callListener(listener2, thisArg, event) { - if (typeof listener2 === "object" && listener2.handleEvent) { - listener2.handleEvent.call(listener2, event); - } else { - listener2.call(thisArg, event); - } - } -}); - -// ../node_modules/ws/lib/extension.js -var require_extension2 = __commonJS((exports, module) => { - var { tokenChars } = require_validation4(); - function push(dest, name, elem) { - if (dest[name] === undefined) - dest[name] = [elem]; - else - dest[name].push(elem); - } - function parse18(header) { - const offers = Object.create(null); - let params = Object.create(null); - let mustUnescape = false; - let isEscaping = false; - let inQuotes = false; - let extensionName; - let paramName; - let start = -1; - let code = -1; - let end = -1; - let i4 = 0; - for (;i4 < header.length; i4++) { - code = header.charCodeAt(i4); - if (extensionName === undefined) { - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) - start = i4; - } else if (i4 !== 0 && (code === 32 || code === 9)) { - if (end === -1 && start !== -1) - end = i4; - } else if (code === 59 || code === 44) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - if (end === -1) - end = i4; - const name = header.slice(start, end); - if (code === 44) { - push(offers, name, params); - params = Object.create(null); - } else { - extensionName = name; - } - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - } else if (paramName === undefined) { - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) - start = i4; - } else if (code === 32 || code === 9) { - if (end === -1 && start !== -1) - end = i4; - } else if (code === 59 || code === 44) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - if (end === -1) - end = i4; - push(params, header.slice(start, end), true); - if (code === 44) { - push(offers, extensionName, params); - params = Object.create(null); - extensionName = undefined; - } - start = end = -1; - } else if (code === 61 && start !== -1 && end === -1) { - paramName = header.slice(start, i4); - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - } else { - if (isEscaping) { - if (tokenChars[code] !== 1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - if (start === -1) - start = i4; - else if (!mustUnescape) - mustUnescape = true; - isEscaping = false; - } else if (inQuotes) { - if (tokenChars[code] === 1) { - if (start === -1) - start = i4; - } else if (code === 34 && start !== -1) { - inQuotes = false; - end = i4; - } else if (code === 92) { - isEscaping = true; - } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - } else if (code === 34 && header.charCodeAt(i4 - 1) === 61) { - inQuotes = true; - } else if (end === -1 && tokenChars[code] === 1) { - if (start === -1) - start = i4; - } else if (start !== -1 && (code === 32 || code === 9)) { - if (end === -1) - end = i4; - } else if (code === 59 || code === 44) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - if (end === -1) - end = i4; - let value = header.slice(start, end); - if (mustUnescape) { - value = value.replace(/\\/g, ""); - mustUnescape = false; - } - push(params, paramName, value); - if (code === 44) { - push(offers, extensionName, params); - params = Object.create(null); - extensionName = undefined; - } - paramName = undefined; - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - } - } - if (start === -1 || inQuotes || code === 32 || code === 9) { - throw new SyntaxError("Unexpected end of input"); - } - if (end === -1) - end = i4; - const token = header.slice(start, end); - if (extensionName === undefined) { - push(offers, token, params); - } else { - if (paramName === undefined) { - push(params, token, true); - } else if (mustUnescape) { - push(params, paramName, token.replace(/\\/g, "")); - } else { - push(params, paramName, token); - } - push(offers, extensionName, params); - } - return offers; - } - function format5(extensions) { - return Object.keys(extensions).map((extension2) => { - let configurations = extensions[extension2]; - if (!Array.isArray(configurations)) - configurations = [configurations]; - return configurations.map((params) => { - return [extension2].concat(Object.keys(params).map((k) => { - let values4 = params[k]; - if (!Array.isArray(values4)) - values4 = [values4]; - return values4.map((v) => v === true ? k : `${k}=${v}`).join("; "); - })).join("; "); - }).join(", "); - }).join(", "); - } - module.exports = { format: format5, parse: parse18 }; -}); - -// ../node_modules/ws/lib/websocket.js -var require_websocket3 = __commonJS((exports, module) => { - var EventEmitter5 = __require("events"); - var https2 = __require("https"); - var http3 = __require("http"); - var net = __require("net"); - var tls = __require("tls"); - var { randomBytes: randomBytes14, createHash: createHash23 } = __require("crypto"); - var { Duplex: Duplex4, Readable: Readable6 } = __require("stream"); - var { URL: URL3 } = __require("url"); - var PerMessageDeflate2 = require_permessage_deflate3(); - var Receiver2 = require_receiver3(); - var Sender2 = require_sender3(); - var { isBlob: isBlob2 } = require_validation4(); - var { - BINARY_TYPES, - CLOSE_TIMEOUT, - EMPTY_BUFFER, - GUID, - kForOnEventAttribute, - kListener, - kStatusCode, - kWebSocket, - NOOP: NOOP2 - } = require_constants12(); - var { - EventTarget: { addEventListener, removeEventListener } - } = require_event_target2(); - var { format: format5, parse: parse18 } = require_extension2(); - var { toBuffer } = require_buffer_util2(); - var kAborted = Symbol("kAborted"); - var protocolVersions = [8, 13]; - var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"]; - var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/; - - class WebSocket3 extends EventEmitter5 { - constructor(address, protocols, options2) { - super(); - this._binaryType = BINARY_TYPES[0]; - this._closeCode = 1006; - this._closeFrameReceived = false; - this._closeFrameSent = false; - this._closeMessage = EMPTY_BUFFER; - this._closeTimer = null; - this._errorEmitted = false; - this._extensions = {}; - this._paused = false; - this._protocol = ""; - this._readyState = WebSocket3.CONNECTING; - this._receiver = null; - this._sender = null; - this._socket = null; - if (address !== null) { - this._bufferedAmount = 0; - this._isServer = false; - this._redirects = 0; - if (protocols === undefined) { - protocols = []; - } else if (!Array.isArray(protocols)) { - if (typeof protocols === "object" && protocols !== null) { - options2 = protocols; - protocols = []; - } else { - protocols = [protocols]; - } - } - initAsClient(this, address, protocols, options2); - } else { - this._autoPong = options2.autoPong; - this._closeTimeout = options2.closeTimeout; - this._isServer = true; - } - } - get binaryType() { - return this._binaryType; - } - set binaryType(type) { - if (!BINARY_TYPES.includes(type)) - return; - this._binaryType = type; - if (this._receiver) - this._receiver._binaryType = type; - } - get bufferedAmount() { - if (!this._socket) - return this._bufferedAmount; - return this._socket._writableState.length + this._sender._bufferedBytes; - } - get extensions() { - return Object.keys(this._extensions).join(); - } - get isPaused() { - return this._paused; - } - get onclose() { - return null; - } - get onerror() { - return null; - } - get onopen() { - return null; - } - get onmessage() { - return null; - } - get protocol() { - return this._protocol; - } - get readyState() { - return this._readyState; - } - get url() { - return this._url; - } - setSocket(socket, head3, options2) { - const receiver = new Receiver2({ - allowSynchronousEvents: options2.allowSynchronousEvents, - binaryType: this.binaryType, - extensions: this._extensions, - isServer: this._isServer, - maxPayload: options2.maxPayload, - skipUTF8Validation: options2.skipUTF8Validation - }); - const sender = new Sender2(socket, this._extensions, options2.generateMask); - this._receiver = receiver; - this._sender = sender; - this._socket = socket; - receiver[kWebSocket] = this; - sender[kWebSocket] = this; - socket[kWebSocket] = this; - receiver.on("conclude", receiverOnConclude); - receiver.on("drain", receiverOnDrain); - receiver.on("error", receiverOnError); - receiver.on("message", receiverOnMessage); - receiver.on("ping", receiverOnPing); - receiver.on("pong", receiverOnPong); - sender.onerror = senderOnError; - if (socket.setTimeout) - socket.setTimeout(0); - if (socket.setNoDelay) - socket.setNoDelay(); - if (head3.length > 0) - socket.unshift(head3); - socket.on("close", socketOnClose); - socket.on("data", socketOnData); - socket.on("end", socketOnEnd); - socket.on("error", socketOnError); - this._readyState = WebSocket3.OPEN; - this.emit("open"); - } - emitClose() { - if (!this._socket) { - this._readyState = WebSocket3.CLOSED; - this.emit("close", this._closeCode, this._closeMessage); - return; - } - if (this._extensions[PerMessageDeflate2.extensionName]) { - this._extensions[PerMessageDeflate2.extensionName].cleanup(); - } - this._receiver.removeAllListeners(); - this._readyState = WebSocket3.CLOSED; - this.emit("close", this._closeCode, this._closeMessage); - } - close(code, data) { - if (this.readyState === WebSocket3.CLOSED) - return; - if (this.readyState === WebSocket3.CONNECTING) { - const msg = "WebSocket was closed before the connection was established"; - abortHandshake(this, this._req, msg); - return; - } - if (this.readyState === WebSocket3.CLOSING) { - if (this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted)) { - this._socket.end(); - } - return; - } - this._readyState = WebSocket3.CLOSING; - this._sender.close(code, data, !this._isServer, (err3) => { - if (err3) - return; - this._closeFrameSent = true; - if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) { - this._socket.end(); - } - }); - setCloseTimer(this); - } - pause() { - if (this.readyState === WebSocket3.CONNECTING || this.readyState === WebSocket3.CLOSED) { - return; - } - this._paused = true; - this._socket.pause(); - } - ping(data, mask, cb) { - if (this.readyState === WebSocket3.CONNECTING) { - throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - } - if (typeof data === "function") { - cb = data; - data = mask = undefined; - } else if (typeof mask === "function") { - cb = mask; - mask = undefined; - } - if (typeof data === "number") - data = data.toString(); - if (this.readyState !== WebSocket3.OPEN) { - sendAfterClose(this, data, cb); - return; - } - if (mask === undefined) - mask = !this._isServer; - this._sender.ping(data || EMPTY_BUFFER, mask, cb); - } - pong(data, mask, cb) { - if (this.readyState === WebSocket3.CONNECTING) { - throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - } - if (typeof data === "function") { - cb = data; - data = mask = undefined; - } else if (typeof mask === "function") { - cb = mask; - mask = undefined; - } - if (typeof data === "number") - data = data.toString(); - if (this.readyState !== WebSocket3.OPEN) { - sendAfterClose(this, data, cb); - return; - } - if (mask === undefined) - mask = !this._isServer; - this._sender.pong(data || EMPTY_BUFFER, mask, cb); - } - resume() { - if (this.readyState === WebSocket3.CONNECTING || this.readyState === WebSocket3.CLOSED) { - return; - } - this._paused = false; - if (!this._receiver._writableState.needDrain) - this._socket.resume(); - } - send(data, options2, cb) { - if (this.readyState === WebSocket3.CONNECTING) { - throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - } - if (typeof options2 === "function") { - cb = options2; - options2 = {}; - } - if (typeof data === "number") - data = data.toString(); - if (this.readyState !== WebSocket3.OPEN) { - sendAfterClose(this, data, cb); - return; - } - const opts = { - binary: typeof data !== "string", - mask: !this._isServer, - compress: true, - fin: true, - ...options2 - }; - if (!this._extensions[PerMessageDeflate2.extensionName]) { - opts.compress = false; - } - this._sender.send(data || EMPTY_BUFFER, opts, cb); - } - terminate() { - if (this.readyState === WebSocket3.CLOSED) - return; - if (this.readyState === WebSocket3.CONNECTING) { - const msg = "WebSocket was closed before the connection was established"; - abortHandshake(this, this._req, msg); - return; - } - if (this._socket) { - this._readyState = WebSocket3.CLOSING; - this._socket.destroy(); - } - } - } - Object.defineProperty(WebSocket3, "CONNECTING", { - enumerable: true, - value: readyStates.indexOf("CONNECTING") - }); - Object.defineProperty(WebSocket3.prototype, "CONNECTING", { - enumerable: true, - value: readyStates.indexOf("CONNECTING") - }); - Object.defineProperty(WebSocket3, "OPEN", { - enumerable: true, - value: readyStates.indexOf("OPEN") - }); - Object.defineProperty(WebSocket3.prototype, "OPEN", { - enumerable: true, - value: readyStates.indexOf("OPEN") - }); - Object.defineProperty(WebSocket3, "CLOSING", { - enumerable: true, - value: readyStates.indexOf("CLOSING") - }); - Object.defineProperty(WebSocket3.prototype, "CLOSING", { - enumerable: true, - value: readyStates.indexOf("CLOSING") - }); - Object.defineProperty(WebSocket3, "CLOSED", { - enumerable: true, - value: readyStates.indexOf("CLOSED") - }); - Object.defineProperty(WebSocket3.prototype, "CLOSED", { - enumerable: true, - value: readyStates.indexOf("CLOSED") - }); - [ - "binaryType", - "bufferedAmount", - "extensions", - "isPaused", - "protocol", - "readyState", - "url" - ].forEach((property3) => { - Object.defineProperty(WebSocket3.prototype, property3, { enumerable: true }); - }); - ["open", "error", "close", "message"].forEach((method3) => { - Object.defineProperty(WebSocket3.prototype, `on${method3}`, { - enumerable: true, - get() { - for (const listener2 of this.listeners(method3)) { - if (listener2[kForOnEventAttribute]) - return listener2[kListener]; - } - return null; - }, - set(handler14) { - for (const listener2 of this.listeners(method3)) { - if (listener2[kForOnEventAttribute]) { - this.removeListener(method3, listener2); - break; - } - } - if (typeof handler14 !== "function") - return; - this.addEventListener(method3, handler14, { - [kForOnEventAttribute]: true - }); - } - }); - }); - WebSocket3.prototype.addEventListener = addEventListener; - WebSocket3.prototype.removeEventListener = removeEventListener; - module.exports = WebSocket3; - function initAsClient(websocket, address, protocols, options2) { - const opts = { - allowSynchronousEvents: true, - autoPong: true, - closeTimeout: CLOSE_TIMEOUT, - protocolVersion: protocolVersions[1], - maxPayload: 100 * 1024 * 1024, - skipUTF8Validation: false, - perMessageDeflate: true, - followRedirects: false, - maxRedirects: 10, - ...options2, - socketPath: undefined, - hostname: undefined, - protocol: undefined, - timeout: undefined, - method: "GET", - host: undefined, - path: undefined, - port: undefined - }; - websocket._autoPong = opts.autoPong; - websocket._closeTimeout = opts.closeTimeout; - if (!protocolVersions.includes(opts.protocolVersion)) { - throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} ` + `(supported versions: ${protocolVersions.join(", ")})`); - } - let parsedUrl; - if (address instanceof URL3) { - parsedUrl = address; - } else { - try { - parsedUrl = new URL3(address); - } catch { - throw new SyntaxError(`Invalid URL: ${address}`); - } - } - if (parsedUrl.protocol === "http:") { - parsedUrl.protocol = "ws:"; - } else if (parsedUrl.protocol === "https:") { - parsedUrl.protocol = "wss:"; - } - websocket._url = parsedUrl.href; - const isSecure = parsedUrl.protocol === "wss:"; - const isIpcUrl = parsedUrl.protocol === "ws+unix:"; - let invalidUrlMessage; - if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) { - invalidUrlMessage = `The URL's protocol must be one of "ws:", "wss:", ` + '"http:", "https:", or "ws+unix:"'; - } else if (isIpcUrl && !parsedUrl.pathname) { - invalidUrlMessage = "The URL's pathname is empty"; - } else if (parsedUrl.hash) { - invalidUrlMessage = "The URL contains a fragment identifier"; - } - if (invalidUrlMessage) { - const err3 = new SyntaxError(invalidUrlMessage); - if (websocket._redirects === 0) { - throw err3; - } else { - emitErrorAndClose(websocket, err3); - return; - } - } - const defaultPort = isSecure ? 443 : 80; - const key = randomBytes14(16).toString("base64"); - const request = isSecure ? https2.request : http3.request; - const protocolSet = new Set; - let perMessageDeflate; - opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect); - opts.defaultPort = opts.defaultPort || defaultPort; - opts.port = parsedUrl.port || defaultPort; - opts.host = parsedUrl.hostname.startsWith("[") ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname; - opts.headers = { - ...opts.headers, - "Sec-WebSocket-Version": opts.protocolVersion, - "Sec-WebSocket-Key": key, - Connection: "Upgrade", - Upgrade: "websocket" - }; - opts.path = parsedUrl.pathname + parsedUrl.search; - opts.timeout = opts.handshakeTimeout; - if (opts.perMessageDeflate) { - perMessageDeflate = new PerMessageDeflate2({ - ...opts.perMessageDeflate, - isServer: false, - maxPayload: opts.maxPayload - }); - opts.headers["Sec-WebSocket-Extensions"] = format5({ - [PerMessageDeflate2.extensionName]: perMessageDeflate.offer() - }); - } - if (protocols.length) { - for (const protocol of protocols) { - if (typeof protocol !== "string" || !subprotocolRegex.test(protocol) || protocolSet.has(protocol)) { - throw new SyntaxError("An invalid or duplicated subprotocol was specified"); - } - protocolSet.add(protocol); - } - opts.headers["Sec-WebSocket-Protocol"] = protocols.join(","); - } - if (opts.origin) { - if (opts.protocolVersion < 13) { - opts.headers["Sec-WebSocket-Origin"] = opts.origin; - } else { - opts.headers.Origin = opts.origin; - } - } - if (parsedUrl.username || parsedUrl.password) { - opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; - } - if (isIpcUrl) { - const parts = opts.path.split(":"); - opts.socketPath = parts[0]; - opts.path = parts[1]; - } - let req; - if (opts.followRedirects) { - if (websocket._redirects === 0) { - websocket._originalIpc = isIpcUrl; - websocket._originalSecure = isSecure; - websocket._originalHostOrSocketPath = isIpcUrl ? opts.socketPath : parsedUrl.host; - const headers = options2 && options2.headers; - options2 = { ...options2, headers: {} }; - if (headers) { - for (const [key2, value] of Object.entries(headers)) { - options2.headers[key2.toLowerCase()] = value; - } - } - } else if (websocket.listenerCount("redirect") === 0) { - const isSameHost = isIpcUrl ? websocket._originalIpc ? opts.socketPath === websocket._originalHostOrSocketPath : false : websocket._originalIpc ? false : parsedUrl.host === websocket._originalHostOrSocketPath; - if (!isSameHost || websocket._originalSecure && !isSecure) { - delete opts.headers.authorization; - delete opts.headers.cookie; - if (!isSameHost) - delete opts.headers.host; - opts.auth = undefined; - } - } - if (opts.auth && !options2.headers.authorization) { - options2.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64"); - } - req = websocket._req = request(opts); - if (websocket._redirects) { - websocket.emit("redirect", websocket.url, req); - } - } else { - req = websocket._req = request(opts); - } - if (opts.timeout) { - req.on("timeout", () => { - abortHandshake(websocket, req, "Opening handshake has timed out"); - }); - } - req.on("error", (err3) => { - if (req === null || req[kAborted]) - return; - req = websocket._req = null; - emitErrorAndClose(websocket, err3); - }); - req.on("response", (res) => { - const location = res.headers.location; - const statusCode = res.statusCode; - if (location && opts.followRedirects && statusCode >= 300 && statusCode < 400) { - if (++websocket._redirects > opts.maxRedirects) { - abortHandshake(websocket, req, "Maximum redirects exceeded"); - return; - } - req.abort(); - let addr; - try { - addr = new URL3(location, address); - } catch (e) { - const err3 = new SyntaxError(`Invalid URL: ${location}`); - emitErrorAndClose(websocket, err3); - return; - } - initAsClient(websocket, addr, protocols, options2); - } else if (!websocket.emit("unexpected-response", req, res)) { - abortHandshake(websocket, req, `Unexpected server response: ${res.statusCode}`); - } - }); - req.on("upgrade", (res, socket, head3) => { - websocket.emit("upgrade", res); - if (websocket.readyState !== WebSocket3.CONNECTING) - return; - req = websocket._req = null; - const upgrade = res.headers.upgrade; - if (upgrade === undefined || upgrade.toLowerCase() !== "websocket") { - abortHandshake(websocket, socket, "Invalid Upgrade header"); - return; - } - const digest = createHash23("sha1").update(key + GUID).digest("base64"); - if (res.headers["sec-websocket-accept"] !== digest) { - abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header"); - return; - } - const serverProt = res.headers["sec-websocket-protocol"]; - let protError; - if (serverProt !== undefined) { - if (!protocolSet.size) { - protError = "Server sent a subprotocol but none was requested"; - } else if (!protocolSet.has(serverProt)) { - protError = "Server sent an invalid subprotocol"; - } - } else if (protocolSet.size) { - protError = "Server sent no subprotocol"; - } - if (protError) { - abortHandshake(websocket, socket, protError); - return; - } - if (serverProt) - websocket._protocol = serverProt; - const secWebSocketExtensions = res.headers["sec-websocket-extensions"]; - if (secWebSocketExtensions !== undefined) { - if (!perMessageDeflate) { - const message = "Server sent a Sec-WebSocket-Extensions header but no extension " + "was requested"; - abortHandshake(websocket, socket, message); - return; - } - let extensions; - try { - extensions = parse18(secWebSocketExtensions); - } catch (err3) { - const message = "Invalid Sec-WebSocket-Extensions header"; - abortHandshake(websocket, socket, message); - return; - } - const extensionNames = Object.keys(extensions); - if (extensionNames.length !== 1 || extensionNames[0] !== PerMessageDeflate2.extensionName) { - const message = "Server indicated an extension that was not requested"; - abortHandshake(websocket, socket, message); - return; - } - try { - perMessageDeflate.accept(extensions[PerMessageDeflate2.extensionName]); - } catch (err3) { - const message = "Invalid Sec-WebSocket-Extensions header"; - abortHandshake(websocket, socket, message); - return; - } - websocket._extensions[PerMessageDeflate2.extensionName] = perMessageDeflate; - } - websocket.setSocket(socket, head3, { - allowSynchronousEvents: opts.allowSynchronousEvents, - generateMask: opts.generateMask, - maxPayload: opts.maxPayload, - skipUTF8Validation: opts.skipUTF8Validation - }); - }); - if (opts.finishRequest) { - opts.finishRequest(req, websocket); - } else { - req.end(); - } - } - function emitErrorAndClose(websocket, err3) { - websocket._readyState = WebSocket3.CLOSING; - websocket._errorEmitted = true; - websocket.emit("error", err3); - websocket.emitClose(); - } - function netConnect(options2) { - options2.path = options2.socketPath; - return net.connect(options2); - } - function tlsConnect(options2) { - options2.path = undefined; - if (!options2.servername && options2.servername !== "") { - options2.servername = net.isIP(options2.host) ? "" : options2.host; - } - return tls.connect(options2); - } - function abortHandshake(websocket, stream4, message) { - websocket._readyState = WebSocket3.CLOSING; - const err3 = new Error(message); - Error.captureStackTrace(err3, abortHandshake); - if (stream4.setHeader) { - stream4[kAborted] = true; - stream4.abort(); - if (stream4.socket && !stream4.socket.destroyed) { - stream4.socket.destroy(); - } - process.nextTick(emitErrorAndClose, websocket, err3); - } else { - stream4.destroy(err3); - stream4.once("error", websocket.emit.bind(websocket, "error")); - stream4.once("close", websocket.emitClose.bind(websocket)); - } - } - function sendAfterClose(websocket, data, cb) { - if (data) { - const length = isBlob2(data) ? data.size : toBuffer(data).length; - if (websocket._socket) - websocket._sender._bufferedBytes += length; - else - websocket._bufferedAmount += length; - } - if (cb) { - const err3 = new Error(`WebSocket is not open: readyState ${websocket.readyState} ` + `(${readyStates[websocket.readyState]})`); - process.nextTick(cb, err3); - } - } - function receiverOnConclude(code, reason) { - const websocket = this[kWebSocket]; - websocket._closeFrameReceived = true; - websocket._closeMessage = reason; - websocket._closeCode = code; - if (websocket._socket[kWebSocket] === undefined) - return; - websocket._socket.removeListener("data", socketOnData); - process.nextTick(resume, websocket._socket); - if (code === 1005) - websocket.close(); - else - websocket.close(code, reason); - } - function receiverOnDrain() { - const websocket = this[kWebSocket]; - if (!websocket.isPaused) - websocket._socket.resume(); - } - function receiverOnError(err3) { - const websocket = this[kWebSocket]; - if (websocket._socket[kWebSocket] !== undefined) { - websocket._socket.removeListener("data", socketOnData); - process.nextTick(resume, websocket._socket); - websocket.close(err3[kStatusCode]); - } - if (!websocket._errorEmitted) { - websocket._errorEmitted = true; - websocket.emit("error", err3); - } - } - function receiverOnFinish() { - this[kWebSocket].emitClose(); - } - function receiverOnMessage(data, isBinary) { - this[kWebSocket].emit("message", data, isBinary); - } - function receiverOnPing(data) { - const websocket = this[kWebSocket]; - if (websocket._autoPong) - websocket.pong(data, !this._isServer, NOOP2); - websocket.emit("ping", data); - } - function receiverOnPong(data) { - this[kWebSocket].emit("pong", data); - } - function resume(stream4) { - stream4.resume(); - } - function senderOnError(err3) { - const websocket = this[kWebSocket]; - if (websocket.readyState === WebSocket3.CLOSED) - return; - if (websocket.readyState === WebSocket3.OPEN) { - websocket._readyState = WebSocket3.CLOSING; - setCloseTimer(websocket); - } - this._socket.end(); - if (!websocket._errorEmitted) { - websocket._errorEmitted = true; - websocket.emit("error", err3); - } - } - function setCloseTimer(websocket) { - websocket._closeTimer = setTimeout(websocket._socket.destroy.bind(websocket._socket), websocket._closeTimeout); - } - function socketOnClose() { - const websocket = this[kWebSocket]; - this.removeListener("close", socketOnClose); - this.removeListener("data", socketOnData); - this.removeListener("end", socketOnEnd); - websocket._readyState = WebSocket3.CLOSING; - if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) { - const chunk3 = this.read(this._readableState.length); - websocket._receiver.write(chunk3); - } - websocket._receiver.end(); - this[kWebSocket] = undefined; - clearTimeout(websocket._closeTimer); - if (websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted) { - websocket.emitClose(); - } else { - websocket._receiver.on("error", receiverOnFinish); - websocket._receiver.on("finish", receiverOnFinish); - } - } - function socketOnData(chunk3) { - if (!this[kWebSocket]._receiver.write(chunk3)) { - this.pause(); - } - } - function socketOnEnd() { - const websocket = this[kWebSocket]; - websocket._readyState = WebSocket3.CLOSING; - websocket._receiver.end(); - this.end(); - } - function socketOnError() { - const websocket = this[kWebSocket]; - this.removeListener("error", socketOnError); - this.on("error", NOOP2); - if (websocket) { - websocket._readyState = WebSocket3.CLOSING; - this.destroy(); - } - } -}); - -// ../node_modules/ws/lib/stream.js -var require_stream2 = __commonJS((exports, module) => { - var WebSocket3 = require_websocket3(); - var { Duplex: Duplex4 } = __require("stream"); - function emitClose(stream4) { - stream4.emit("close"); - } - function duplexOnEnd() { - if (!this.destroyed && this._writableState.finished) { - this.destroy(); - } - } - function duplexOnError(err3) { - this.removeListener("error", duplexOnError); - this.destroy(); - if (this.listenerCount("error") === 0) { - this.emit("error", err3); - } - } - function createWebSocketStream2(ws, options2) { - let terminateOnDestroy = true; - const duplex2 = new Duplex4({ - ...options2, - autoDestroy: false, - emitClose: false, - objectMode: false, - writableObjectMode: false - }); - ws.on("message", function message(msg, isBinary) { - const data = !isBinary && duplex2._readableState.objectMode ? msg.toString() : msg; - if (!duplex2.push(data)) - ws.pause(); - }); - ws.once("error", function error(err3) { - if (duplex2.destroyed) - return; - terminateOnDestroy = false; - duplex2.destroy(err3); - }); - ws.once("close", function close() { - if (duplex2.destroyed) - return; - duplex2.push(null); - }); - duplex2._destroy = function(err3, callback) { - if (ws.readyState === ws.CLOSED) { - callback(err3); - process.nextTick(emitClose, duplex2); - return; - } - let called = false; - ws.once("error", function error(err4) { - called = true; - callback(err4); - }); - ws.once("close", function close() { - if (!called) - callback(err3); - process.nextTick(emitClose, duplex2); - }); - if (terminateOnDestroy) - ws.terminate(); - }; - duplex2._final = function(callback) { - if (ws.readyState === ws.CONNECTING) { - ws.once("open", function open() { - duplex2._final(callback); - }); - return; - } - if (ws._socket === null) - return; - if (ws._socket._writableState.finished) { - callback(); - if (duplex2._readableState.endEmitted) - duplex2.destroy(); - } else { - ws._socket.once("finish", function finish() { - callback(); - }); - ws.close(); - } - }; - duplex2._read = function() { - if (ws.isPaused) - ws.resume(); - }; - duplex2._write = function(chunk3, encoding, callback) { - if (ws.readyState === ws.CONNECTING) { - ws.once("open", function open() { - duplex2._write(chunk3, encoding, callback); - }); - return; - } - ws.send(chunk3, callback); - }; - duplex2.on("end", duplexOnEnd); - duplex2.on("error", duplexOnError); - return duplex2; - } - module.exports = createWebSocketStream2; -}); - -// ../node_modules/ws/lib/subprotocol.js -var require_subprotocol2 = __commonJS((exports, module) => { - var { tokenChars } = require_validation4(); - function parse18(header) { - const protocols = new Set; - let start = -1; - let end = -1; - let i4 = 0; - for (i4;i4 < header.length; i4++) { - const code = header.charCodeAt(i4); - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) - start = i4; - } else if (i4 !== 0 && (code === 32 || code === 9)) { - if (end === -1 && start !== -1) - end = i4; - } else if (code === 44) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - if (end === -1) - end = i4; - const protocol2 = header.slice(start, end); - if (protocols.has(protocol2)) { - throw new SyntaxError(`The "${protocol2}" subprotocol is duplicated`); - } - protocols.add(protocol2); - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i4}`); - } - } - if (start === -1 || end !== -1) { - throw new SyntaxError("Unexpected end of input"); - } - const protocol = header.slice(start, i4); - if (protocols.has(protocol)) { - throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`); - } - protocols.add(protocol); - return protocols; - } - module.exports = { parse: parse18 }; -}); - -// ../node_modules/ws/lib/websocket-server.js -var require_websocket_server2 = __commonJS((exports, module) => { - var EventEmitter5 = __require("events"); - var http3 = __require("http"); - var { Duplex: Duplex4 } = __require("stream"); - var { createHash: createHash23 } = __require("crypto"); - var extension2 = require_extension2(); - var PerMessageDeflate2 = require_permessage_deflate3(); - var subprotocol2 = require_subprotocol2(); - var WebSocket3 = require_websocket3(); - var { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants12(); - var keyRegex = /^[+/0-9A-Za-z]{22}==$/; - var RUNNING = 0; - var CLOSING = 1; - var CLOSED = 2; - - class WebSocketServer2 extends EventEmitter5 { - constructor(options2, callback) { - super(); - options2 = { - allowSynchronousEvents: true, - autoPong: true, - maxPayload: 100 * 1024 * 1024, - skipUTF8Validation: false, - perMessageDeflate: false, - handleProtocols: null, - clientTracking: true, - closeTimeout: CLOSE_TIMEOUT, - verifyClient: null, - noServer: false, - backlog: null, - server: null, - host: null, - path: null, - port: null, - WebSocket: WebSocket3, - ...options2 - }; - if (options2.port == null && !options2.server && !options2.noServer || options2.port != null && (options2.server || options2.noServer) || options2.server && options2.noServer) { - throw new TypeError('One and only one of the "port", "server", or "noServer" options ' + "must be specified"); - } - if (options2.port != null) { - this._server = http3.createServer((req, res) => { - const body = http3.STATUS_CODES[426]; - res.writeHead(426, { - "Content-Length": body.length, - "Content-Type": "text/plain" - }); - res.end(body); - }); - this._server.listen(options2.port, options2.host, options2.backlog, callback); - } else if (options2.server) { - this._server = options2.server; - } - if (this._server) { - const emitConnection = this.emit.bind(this, "connection"); - this._removeListeners = addListeners(this._server, { - listening: this.emit.bind(this, "listening"), - error: this.emit.bind(this, "error"), - upgrade: (req, socket, head3) => { - this.handleUpgrade(req, socket, head3, emitConnection); - } - }); - } - if (options2.perMessageDeflate === true) - options2.perMessageDeflate = {}; - if (options2.clientTracking) { - this.clients = new Set; - this._shouldEmitClose = false; - } - this.options = options2; - this._state = RUNNING; - } - address() { - if (this.options.noServer) { - throw new Error('The server is operating in "noServer" mode'); - } - if (!this._server) - return null; - return this._server.address(); - } - close(cb) { - if (this._state === CLOSED) { - if (cb) { - this.once("close", () => { - cb(new Error("The server is not running")); - }); - } - process.nextTick(emitClose, this); - return; - } - if (cb) - this.once("close", cb); - if (this._state === CLOSING) - return; - this._state = CLOSING; - if (this.options.noServer || this.options.server) { - if (this._server) { - this._removeListeners(); - this._removeListeners = this._server = null; - } - if (this.clients) { - if (!this.clients.size) { - process.nextTick(emitClose, this); - } else { - this._shouldEmitClose = true; - } - } else { - process.nextTick(emitClose, this); - } - } else { - const server = this._server; - this._removeListeners(); - this._removeListeners = this._server = null; - server.close(() => { - emitClose(this); - }); - } - } - shouldHandle(req) { - if (this.options.path) { - const index = req.url.indexOf("?"); - const pathname = index !== -1 ? req.url.slice(0, index) : req.url; - if (pathname !== this.options.path) - return false; - } - return true; - } - handleUpgrade(req, socket, head3, cb) { - socket.on("error", socketOnError); - const key = req.headers["sec-websocket-key"]; - const upgrade = req.headers.upgrade; - const version3 = +req.headers["sec-websocket-version"]; - if (req.method !== "GET") { - const message = "Invalid HTTP method"; - abortHandshakeOrEmitwsClientError(this, req, socket, 405, message); - return; - } - if (upgrade === undefined || upgrade.toLowerCase() !== "websocket") { - const message = "Invalid Upgrade header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - if (key === undefined || !keyRegex.test(key)) { - const message = "Missing or invalid Sec-WebSocket-Key header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - if (version3 !== 13 && version3 !== 8) { - const message = "Missing or invalid Sec-WebSocket-Version header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, { - "Sec-WebSocket-Version": "13, 8" - }); - return; - } - if (!this.shouldHandle(req)) { - abortHandshake(socket, 400); - return; - } - const secWebSocketProtocol = req.headers["sec-websocket-protocol"]; - let protocols = new Set; - if (secWebSocketProtocol !== undefined) { - try { - protocols = subprotocol2.parse(secWebSocketProtocol); - } catch (err3) { - const message = "Invalid Sec-WebSocket-Protocol header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - } - const secWebSocketExtensions = req.headers["sec-websocket-extensions"]; - const extensions = {}; - if (this.options.perMessageDeflate && secWebSocketExtensions !== undefined) { - const perMessageDeflate = new PerMessageDeflate2({ - ...this.options.perMessageDeflate, - isServer: true, - maxPayload: this.options.maxPayload - }); - try { - const offers = extension2.parse(secWebSocketExtensions); - if (offers[PerMessageDeflate2.extensionName]) { - perMessageDeflate.accept(offers[PerMessageDeflate2.extensionName]); - extensions[PerMessageDeflate2.extensionName] = perMessageDeflate; - } - } catch (err3) { - const message = "Invalid or unacceptable Sec-WebSocket-Extensions header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - } - if (this.options.verifyClient) { - const info = { - origin: req.headers[`${version3 === 8 ? "sec-websocket-origin" : "origin"}`], - secure: !!(req.socket.authorized || req.socket.encrypted), - req - }; - if (this.options.verifyClient.length === 2) { - this.options.verifyClient(info, (verified, code, message, headers) => { - if (!verified) { - return abortHandshake(socket, code || 401, message, headers); - } - this.completeUpgrade(extensions, key, protocols, req, socket, head3, cb); - }); - return; - } - if (!this.options.verifyClient(info)) - return abortHandshake(socket, 401); - } - this.completeUpgrade(extensions, key, protocols, req, socket, head3, cb); - } - completeUpgrade(extensions, key, protocols, req, socket, head3, cb) { - if (!socket.readable || !socket.writable) - return socket.destroy(); - if (socket[kWebSocket]) { - throw new Error("server.handleUpgrade() was called more than once with the same " + "socket, possibly due to a misconfiguration"); - } - if (this._state > RUNNING) - return abortHandshake(socket, 503); - const digest = createHash23("sha1").update(key + GUID).digest("base64"); - const headers = [ - "HTTP/1.1 101 Switching Protocols", - "Upgrade: websocket", - "Connection: Upgrade", - `Sec-WebSocket-Accept: ${digest}` - ]; - const ws = new this.options.WebSocket(null, undefined, this.options); - if (protocols.size) { - const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value; - if (protocol) { - headers.push(`Sec-WebSocket-Protocol: ${protocol}`); - ws._protocol = protocol; - } - } - if (extensions[PerMessageDeflate2.extensionName]) { - const params = extensions[PerMessageDeflate2.extensionName].params; - const value = extension2.format({ - [PerMessageDeflate2.extensionName]: [params] - }); - headers.push(`Sec-WebSocket-Extensions: ${value}`); - ws._extensions = extensions; - } - this.emit("headers", headers, req); - socket.write(headers.concat(`\r -`).join(`\r -`)); - socket.removeListener("error", socketOnError); - ws.setSocket(socket, head3, { - allowSynchronousEvents: this.options.allowSynchronousEvents, - maxPayload: this.options.maxPayload, - skipUTF8Validation: this.options.skipUTF8Validation - }); - if (this.clients) { - this.clients.add(ws); - ws.on("close", () => { - this.clients.delete(ws); - if (this._shouldEmitClose && !this.clients.size) { - process.nextTick(emitClose, this); - } - }); - } - cb(ws, req); - } - } - module.exports = WebSocketServer2; - function addListeners(server, map7) { - for (const event of Object.keys(map7)) - server.on(event, map7[event]); - return function removeListeners() { - for (const event of Object.keys(map7)) { - server.removeListener(event, map7[event]); - } - }; - } - function emitClose(server) { - server._state = CLOSED; - server.emit("close"); - } - function socketOnError() { - this.destroy(); - } - function abortHandshake(socket, code, message, headers) { - message = message || http3.STATUS_CODES[code]; - headers = { - Connection: "close", - "Content-Type": "text/html", - "Content-Length": Buffer.byteLength(message), - ...headers - }; - socket.once("finish", socket.destroy); - socket.end(`HTTP/1.1 ${code} ${http3.STATUS_CODES[code]}\r -` + Object.keys(headers).map((h2) => `${h2}: ${headers[h2]}`).join(`\r -`) + `\r -\r -` + message); - } - function abortHandshakeOrEmitwsClientError(server, req, socket, code, message, headers) { - if (server.listenerCount("wsClientError")) { - const err3 = new Error(message); - Error.captureStackTrace(err3, abortHandshakeOrEmitwsClientError); - server.emit("wsClientError", err3, socket, req); - } else { - abortHandshake(socket, code, message, headers); - } - } -}); - -// ../node_modules/ws/wrapper.mjs -var import_stream11, import_extension2, import_permessage_deflate2, import_receiver2, import_sender2, import_subprotocol2, import_websocket2, import_websocket_server2, wrapper_default2; -var init_wrapper3 = __esm(() => { - import_stream11 = __toESM(require_stream2(), 1); - import_extension2 = __toESM(require_extension2(), 1); - import_permessage_deflate2 = __toESM(require_permessage_deflate3(), 1); - import_receiver2 = __toESM(require_receiver3(), 1); - import_sender2 = __toESM(require_sender3(), 1); - import_subprotocol2 = __toESM(require_subprotocol2(), 1); - import_websocket2 = __toESM(require_websocket3(), 1); - import_websocket_server2 = __toESM(require_websocket_server2(), 1); - wrapper_default2 = import_websocket2.default; -}); - -// ../node_modules/@ant/claude-for-chrome-mcp/src/mcpSocketClient.ts -import { promises as fsPromises } from "fs"; -import { createConnection as createConnection2 } from "net"; -import { platform as platform4 } from "os"; -import { dirname as dirname49 } from "path"; -function isToolResponse(message) { - return "result" in message || "error" in message; -} -function isNotification(message) { - return "method" in message && typeof message.method === "string"; -} - -class McpSocketClient { - socket = null; - connected = false; - connecting = false; - responseCallback = null; - notificationHandler = null; - responseBuffer = Buffer.alloc(0); - reconnectAttempts = 0; - maxReconnectAttempts = 10; - reconnectDelay = 1000; - reconnectTimer = null; - context; - disableAutoReconnect = false; - constructor(context) { - this.context = context; - } - async connect() { - const { serverName, logger } = this.context; - if (this.connecting) { - logger.info(`[${serverName}] Already connecting, skipping duplicate attempt`); - return; - } - this.closeSocket(); - this.connecting = true; - const socketPath2 = this.context.getSocketPath?.() ?? this.context.socketPath; - logger.info(`[${serverName}] Attempting to connect to: ${socketPath2}`); - try { - await this.validateSocketSecurity(socketPath2); - } catch (error46) { - this.connecting = false; - logger.info(`[${serverName}] Security validation failed:`, error46); - return; - } - this.socket = createConnection2(socketPath2); - const connectTimeout = setTimeout(() => { - if (!this.connected) { - logger.info(`[${serverName}] Connection attempt timed out after 5000ms`); - this.closeSocket(); - this.scheduleReconnect(); - } - }, 5000); - this.socket.on("connect", () => { - clearTimeout(connectTimeout); - this.connected = true; - this.connecting = false; - this.reconnectAttempts = 0; - logger.info(`[${serverName}] Successfully connected to bridge server`); - }); - this.socket.on("data", (data) => { - this.responseBuffer = Buffer.concat([this.responseBuffer, data]); - while (this.responseBuffer.length >= 4) { - const length = this.responseBuffer.readUInt32LE(0); - if (this.responseBuffer.length < 4 + length) { - break; - } - const messageBytes = this.responseBuffer.slice(4, 4 + length); - this.responseBuffer = this.responseBuffer.slice(4 + length); - try { - const message = JSON.parse(messageBytes.toString("utf-8")); - if (isNotification(message)) { - logger.info(`[${serverName}] Received notification: ${message.method}`); - if (this.notificationHandler) { - this.notificationHandler(message); - } - } else if (isToolResponse(message)) { - logger.info(`[${serverName}] Received tool response: ${message}`); - this.handleResponse(message); - } else { - logger.info(`[${serverName}] Received unknown message: ${message}`); - } - } catch (error46) { - logger.info(`[${serverName}] Failed to parse message:`, error46); - } - } - }); - this.socket.on("error", (error46) => { - clearTimeout(connectTimeout); - logger.info(`[${serverName}] Socket error (code: ${error46.code}):`, error46); - this.connected = false; - this.connecting = false; - if (error46.code && [ - "ECONNREFUSED", - "ECONNRESET", - "EPIPE", - "ENOENT", - "EOPNOTSUPP", - "ECONNABORTED" - ].includes(error46.code)) { - this.scheduleReconnect(); - } - }); - this.socket.on("close", () => { - clearTimeout(connectTimeout); - this.connected = false; - this.connecting = false; - this.scheduleReconnect(); - }); - } - scheduleReconnect() { - const { serverName, logger } = this.context; - if (this.disableAutoReconnect) { - return; - } - if (this.reconnectTimer) { - logger.info(`[${serverName}] Reconnect already scheduled, skipping`); - return; - } - this.reconnectAttempts++; - const maxTotalAttempts = 100; - if (this.reconnectAttempts > maxTotalAttempts) { - logger.info(`[${serverName}] Giving up after ${maxTotalAttempts} attempts. Will retry on next tool call.`); - this.reconnectAttempts = 0; - return; - } - const delay3 = Math.min(this.reconnectDelay * Math.pow(1.5, this.reconnectAttempts - 1), 30000); - if (this.reconnectAttempts <= this.maxReconnectAttempts) { - logger.info(`[${serverName}] Reconnecting in ${Math.round(delay3)}ms (attempt ${this.reconnectAttempts})`); - } else if (this.reconnectAttempts % 10 === 0) { - logger.info(`[${serverName}] Still polling for native host (attempt ${this.reconnectAttempts})`); - } - this.reconnectTimer = setTimeout(() => { - this.reconnectTimer = null; - this.connect(); - }, delay3); - } - handleResponse(response) { - if (this.responseCallback) { - const callback = this.responseCallback; - this.responseCallback = null; - callback(response); - } - } - setNotificationHandler(handler14) { - this.notificationHandler = handler14; - } - async ensureConnected() { - const { serverName } = this.context; - if (this.connected && this.socket) { - return true; - } - if (!this.socket && !this.connecting) { - await this.connect(); - } - return new Promise((resolve41, reject3) => { - let checkTimeoutId = null; - const timeout = setTimeout(() => { - if (checkTimeoutId) { - clearTimeout(checkTimeoutId); - } - reject3(new SocketConnectionError(`[${serverName}] Connection attempt timed out after 5000ms`)); - }, 5000); - const checkConnection = () => { - if (this.connected) { - clearTimeout(timeout); - resolve41(true); - } else { - checkTimeoutId = setTimeout(checkConnection, 500); - } - }; - checkConnection(); - }); - } - async sendRequest(request, timeoutMs = 30000) { - const { serverName } = this.context; - if (!this.socket) { - throw new SocketConnectionError(`[${serverName}] Cannot send request: not connected`); - } - const socket = this.socket; - return new Promise((resolve41, reject3) => { - const timeout = setTimeout(() => { - this.responseCallback = null; - reject3(new SocketConnectionError(`[${serverName}] Tool request timed out after ${timeoutMs}ms`)); - }, timeoutMs); - this.responseCallback = (response) => { - clearTimeout(timeout); - resolve41(response); - }; - const requestJson = JSON.stringify(request); - const requestBytes = Buffer.from(requestJson, "utf-8"); - const lengthPrefix = Buffer.allocUnsafe(4); - lengthPrefix.writeUInt32LE(requestBytes.length, 0); - const message = Buffer.concat([lengthPrefix, requestBytes]); - socket.write(message); - }); - } - async callTool(name, args, _permissionOverrides) { - const request = { - method: "execute_tool", - params: { - client_id: this.context.clientTypeId, - tool: name, - args - } - }; - return this.sendRequestWithRetry(request); - } - async sendRequestWithRetry(request) { - const { serverName, logger } = this.context; - try { - return await this.sendRequest(request); - } catch (error46) { - if (!(error46 instanceof SocketConnectionError)) { - throw error46; - } - logger.info(`[${serverName}] Connection error, forcing reconnect and retrying: ${error46.message}`); - this.closeSocket(); - await this.ensureConnected(); - return await this.sendRequest(request); - } - } - async setPermissionMode(_mode, _allowedDomains) {} - isConnected() { - return this.connected; - } - closeSocket() { - if (this.socket) { - this.socket.removeAllListeners(); - this.socket.end(); - this.socket.destroy(); - this.socket = null; - } - this.connected = false; - this.connecting = false; - } - cleanup() { - if (this.reconnectTimer) { - clearTimeout(this.reconnectTimer); - this.reconnectTimer = null; - } - this.closeSocket(); - this.reconnectAttempts = 0; - this.responseBuffer = Buffer.alloc(0); - this.responseCallback = null; - } - disconnect() { - this.cleanup(); - } - async validateSocketSecurity(socketPath2) { - const { serverName, logger } = this.context; - if (platform4() === "win32") { - return; - } - try { - const dirPath = dirname49(socketPath2); - const dirBasename = dirPath.split("/").pop() || ""; - const isSocketDir = dirBasename.startsWith("claude-mcp-browser-bridge-"); - if (isSocketDir) { - try { - const dirStats = await fsPromises.stat(dirPath); - if (dirStats.isDirectory()) { - const dirMode = dirStats.mode & 511; - if (dirMode !== 448) { - throw new Error(`[${serverName}] Insecure socket directory permissions: ${dirMode.toString(8)} (expected 0700). Directory may have been tampered with.`); - } - const currentUid2 = process.getuid?.(); - if (currentUid2 !== undefined && dirStats.uid !== currentUid2) { - throw new Error(`Socket directory not owned by current user (uid: ${currentUid2}, dir uid: ${dirStats.uid}). ` + `Potential security risk.`); - } - } - } catch (dirError) { - if (dirError.code !== "ENOENT") { - throw dirError; - } - } - } - const stats = await fsPromises.stat(socketPath2); - if (!stats.isSocket()) { - throw new Error(`[${serverName}] Path exists but it's not a socket: ${socketPath2}`); - } - const mode = stats.mode & 511; - if (mode !== 384) { - throw new Error(`[${serverName}] Insecure socket permissions: ${mode.toString(8)} (expected 0600). Socket may have been tampered with.`); - } - const currentUid = process.getuid?.(); - if (currentUid !== undefined && stats.uid !== currentUid) { - throw new Error(`Socket not owned by current user (uid: ${currentUid}, socket uid: ${stats.uid}). ` + `Potential security risk.`); - } - logger.info(`[${serverName}] Socket security validation passed`); - } catch (error46) { - if (error46.code === "ENOENT") { - logger.info(`[${serverName}] Socket not found, will be created by server`); - return; - } - throw error46; - } - } -} -function createMcpSocketClient(context) { - return new McpSocketClient(context); -} -var SocketConnectionError; -var init_mcpSocketClient = __esm(() => { - SocketConnectionError = class SocketConnectionError extends Error { - constructor(message) { - super(message); - this.name = "SocketConnectionError"; - } - }; -}); - -// ../node_modules/@ant/claude-for-chrome-mcp/src/types.ts -function localPlatformLabel() { - return process.platform === "darwin" ? "macOS" : process.platform === "win32" ? "Windows" : "Linux"; -} - -// ../node_modules/@ant/claude-for-chrome-mcp/src/bridgeClient.ts -class BridgeClient { - ws = null; - connected = false; - authenticated = false; - connecting = false; - reconnectTimer = null; - reconnectAttempts = 0; - pendingCalls = new Map; - notificationHandler = null; - context; - permissionMode = "ask"; - allowedDomains; - tabsContextCollectionTimeoutMs = 2000; - toolCallTimeoutMs = 120000; - connectionStartTime = null; - connectionEstablishedTime = null; - selectedDeviceId; - discoveryComplete = false; - discoveryPromise = null; - pendingDiscovery = null; - previousSelectedDeviceId; - peerConnectedWaiters = []; - pendingPairingRequestId; - pairingInProgress = false; - persistedDeviceId; - pendingSwitchResolve = null; - constructor(context) { - this.context = context; - if (context.initialPermissionMode) { - this.permissionMode = context.initialPermissionMode; - } - } - async ensureConnected() { - const { logger, serverName } = this.context; - logger.info(`[${serverName}] ensureConnected called, connected=${this.connected}, authenticated=${this.authenticated}, wsState=${this.ws?.readyState}`); - if (this.connected && this.authenticated && this.ws?.readyState === wrapper_default2.OPEN) { - logger.info(`[${serverName}] Already connected and authenticated`); - return true; - } - if (!this.connecting) { - logger.info(`[${serverName}] Not connecting, starting connection...`); - await this.connect(); - } else { - logger.info(`[${serverName}] Already connecting, waiting...`); - } - return new Promise((resolve41) => { - const timeout = setTimeout(() => { - logger.info(`[${serverName}] Connection timeout, connected=${this.connected}, authenticated=${this.authenticated}`); - resolve41(false); - }, 1e4); - const check4 = () => { - if (this.connected && this.authenticated) { - logger.info(`[${serverName}] Connection successful`); - clearTimeout(timeout); - resolve41(true); - } else if (!this.connecting) { - logger.info(`[${serverName}] No longer connecting, giving up`); - clearTimeout(timeout); - resolve41(false); - } else { - setTimeout(check4, 200); - } - }; - check4(); - }); - } - async callTool(name, args, permissionOverrides) { - const { logger, serverName, trackEvent } = this.context; - if (!this.ws || this.ws.readyState !== wrapper_default2.OPEN) { - throw new SocketConnectionError(`[${serverName}] Bridge not connected`); - } - if (!this.selectedDeviceId && !this.discoveryComplete) { - this.discoveryPromise ??= this.discoverAndSelectExtension().finally(() => { - this.discoveryPromise = null; - }); - await this.discoveryPromise; - } - const toolUseId = crypto.randomUUID(); - const isTabsContext = name === "tabs_context_mcp"; - const startTime = Date.now(); - const timeoutMs = isTabsContext ? this.tabsContextCollectionTimeoutMs : this.toolCallTimeoutMs; - trackEvent?.("chrome_bridge_tool_call_started", { - tool_name: name, - tool_use_id: toolUseId - }); - const effectivePermissionMode = permissionOverrides?.permissionMode ?? this.permissionMode; - const effectiveAllowedDomains = permissionOverrides?.allowedDomains ?? this.allowedDomains; - return new Promise((resolve41, reject3) => { - const timer = setTimeout(() => { - const pending2 = this.pendingCalls.get(toolUseId); - if (pending2) { - this.pendingCalls.delete(toolUseId); - const durationMs = Date.now() - pending2.startTime; - if (isTabsContext && pending2.results.length > 0) { - trackEvent?.("chrome_bridge_tool_call_completed", { - tool_name: name, - tool_use_id: toolUseId, - duration_ms: durationMs - }); - resolve41(this.mergeTabsResults(pending2.results)); - } else { - logger.warn(`[${serverName}] Tool call timeout: ${name} (${toolUseId.slice(0, 8)}) after ${durationMs}ms, pending calls: ${this.pendingCalls.size}`); - trackEvent?.("chrome_bridge_tool_call_timeout", { - tool_name: name, - tool_use_id: toolUseId, - duration_ms: durationMs, - timeout_ms: timeoutMs - }); - reject3(new SocketConnectionError(`[${serverName}] Tool call timed out: ${name}`)); - } - } - }, timeoutMs); - this.pendingCalls.set(toolUseId, { - resolve: resolve41, - reject: reject3, - timer, - results: [], - isTabsContext, - onPermissionRequest: permissionOverrides?.onPermissionRequest, - startTime, - toolName: name - }); - const message = { - type: "tool_call", - tool_use_id: toolUseId, - client_type: this.context.clientTypeId, - tool: name, - args - }; - if (this.selectedDeviceId) { - message.target_device_id = this.selectedDeviceId; - } - if (effectivePermissionMode) { - message.permission_mode = effectivePermissionMode; - } - if (effectiveAllowedDomains?.length) { - message.allowed_domains = effectiveAllowedDomains; - } - if (permissionOverrides?.onPermissionRequest) { - message.handle_permission_prompts = true; - } - logger.debug(`[${serverName}] Sending tool_call: ${name} (${toolUseId.slice(0, 8)})`); - this.ws.send(JSON.stringify(message)); - }); - } - isConnected() { - return this.connected && this.authenticated && this.ws?.readyState === wrapper_default2.OPEN; - } - disconnect() { - this.cleanup(); - } - setNotificationHandler(handler14) { - this.notificationHandler = handler14; - } - async setPermissionMode(mode, allowedDomains) { - this.permissionMode = mode; - this.allowedDomains = allowedDomains; - } - async discoverAndSelectExtension() { - const { logger, serverName } = this.context; - this.persistedDeviceId ??= this.context.getPersistedDeviceId?.(); - let extensions = await this.queryBridgeExtensions(); - if (extensions.length === 0) { - logger.info(`[${serverName}] No extensions connected, waiting up to ${PEER_WAIT_TIMEOUT_MS}ms for peer_connected`); - const peerArrived = await this.waitForPeerConnected(PEER_WAIT_TIMEOUT_MS); - if (peerArrived) { - extensions = await this.queryBridgeExtensions(); - } - } - this.discoveryComplete = true; - if (extensions.length === 0) { - logger.info(`[${serverName}] No extensions found after waiting`); - return; - } - if (extensions.length === 1) { - const ext = extensions[0]; - if (!this.isLocalExtension(ext)) { - this.context.onRemoteExtensionWarning?.(ext); - } - this.selectExtension(ext.deviceId); - return; - } - if (this.persistedDeviceId) { - const persisted = extensions.find((e) => e.deviceId === this.persistedDeviceId); - if (persisted) { - logger.info(`[${serverName}] Auto-connecting to persisted extension: ${persisted.name || persisted.deviceId.slice(0, 8)}`); - this.selectExtension(persisted.deviceId); - return; - } - } - this.broadcastPairingRequest(); - this.pairingInProgress = true; - } - async queryBridgeExtensions() { - const raw = await new Promise((resolve41) => { - const timeout = setTimeout(() => { - this.pendingDiscovery = null; - resolve41([]); - }, DISCOVERY_TIMEOUT_MS); - this.pendingDiscovery = { resolve: resolve41, timeout }; - this.ws?.send(JSON.stringify({ type: "list_extensions" })); - }); - const byDeviceId = new Map; - for (const ext of raw) { - const existing = byDeviceId.get(ext.deviceId); - if (!existing || ext.connectedAt > existing.connectedAt) { - byDeviceId.set(ext.deviceId, ext); - } - } - return [...byDeviceId.values()]; - } - selectExtension(deviceId) { - const { logger, serverName } = this.context; - this.selectedDeviceId = deviceId; - this.previousSelectedDeviceId = undefined; - logger.info(`[${serverName}] Selected Chrome extension: ${deviceId.slice(0, 8)}...`); - } - isLocalExtension(ext) { - if (!ext.osPlatform) - return false; - return ext.osPlatform === localPlatformLabel(); - } - waitForPeerConnected(timeoutMs) { - return new Promise((resolve41) => { - const timer = setTimeout(() => { - this.peerConnectedWaiters = this.peerConnectedWaiters.filter((w) => w !== onPeer); - resolve41(false); - }, timeoutMs); - const onPeer = (arrived) => { - clearTimeout(timer); - resolve41(arrived); - }; - this.peerConnectedWaiters.push(onPeer); - }); - } - broadcastPairingRequest() { - const requestId = crypto.randomUUID(); - this.pendingPairingRequestId = requestId; - this.ws?.send(JSON.stringify({ - type: "pairing_request", - request_id: requestId, - client_type: this.context.clientTypeId - })); - } - async switchBrowser() { - const extensions = await this.queryBridgeExtensions(); - const currentDeviceId = this.selectedDeviceId ?? this.previousSelectedDeviceId; - if (extensions.length === 0 || extensions.length === 1 && (!currentDeviceId || extensions[0].deviceId === currentDeviceId)) { - return "no_other_browsers"; - } - this.previousSelectedDeviceId = this.selectedDeviceId; - this.selectedDeviceId = undefined; - this.discoveryComplete = false; - this.pairingInProgress = false; - const requestId = crypto.randomUUID(); - this.pendingPairingRequestId = requestId; - if (this.ws?.readyState !== wrapper_default2.OPEN) { - return null; - } - this.ws.send(JSON.stringify({ - type: "pairing_request", - request_id: requestId, - client_type: this.context.clientTypeId - })); - if (this.pendingSwitchResolve) { - this.pendingSwitchResolve(null); - } - return new Promise((resolve41) => { - const timer = setTimeout(() => { - if (this.pendingPairingRequestId === requestId) { - this.pendingPairingRequestId = undefined; - } - this.pendingSwitchResolve = null; - resolve41(null); - }, 120000); - this.pendingSwitchResolve = (result3) => { - clearTimeout(timer); - this.pendingSwitchResolve = null; - resolve41(result3); - }; - }); - } - async connect() { - const { logger, serverName, bridgeConfig, trackEvent } = this.context; - if (!bridgeConfig) { - logger.error(`[${serverName}] No bridge config provided`); - return; - } - if (this.connecting) { - return; - } - this.connecting = true; - this.authenticated = false; - this.connectionStartTime = Date.now(); - this.closeSocket(); - let userId; - let token; - if (bridgeConfig.devUserId) { - userId = bridgeConfig.devUserId; - logger.debug(`[${serverName}] Using dev user ID for bridge connection`); - } else { - logger.debug(`[${serverName}] Fetching user ID for bridge connection`); - const fetchedUserId = await bridgeConfig.getUserId(); - if (!fetchedUserId) { - const durationMs = Date.now() - this.connectionStartTime; - logger.error(`[${serverName}] No user ID available after ${durationMs}ms`); - trackEvent?.("chrome_bridge_connection_failed", { - duration_ms: durationMs, - error_type: "no_user_id", - reconnect_attempt: this.reconnectAttempts - }); - this.connecting = false; - this.context.onAuthenticationError?.(); - return; - } - userId = fetchedUserId; - logger.debug(`[${serverName}] Fetching OAuth token for bridge connection`); - token = await bridgeConfig.getOAuthToken(); - if (!token) { - const durationMs = Date.now() - this.connectionStartTime; - logger.error(`[${serverName}] No OAuth token available after ${durationMs}ms`); - trackEvent?.("chrome_bridge_connection_failed", { - duration_ms: durationMs, - error_type: "no_oauth_token", - reconnect_attempt: this.reconnectAttempts - }); - this.connecting = false; - this.context.onAuthenticationError?.(); - return; - } - } - const wsUrl = `${bridgeConfig.url}/chrome/${userId}`; - logger.info(`[${serverName}] Connecting to bridge: ${wsUrl}`); - trackEvent?.("chrome_bridge_connection_started", { - bridge_url: wsUrl - }); - try { - this.ws = new wrapper_default2(wsUrl); - } catch (error46) { - const durationMs = Date.now() - this.connectionStartTime; - logger.error(`[${serverName}] Failed to create WebSocket after ${durationMs}ms:`, error46); - trackEvent?.("chrome_bridge_connection_failed", { - duration_ms: durationMs, - error_type: "websocket_error", - reconnect_attempt: this.reconnectAttempts - }); - this.connecting = false; - this.scheduleReconnect(); - return; - } - this.ws.on("open", () => { - logger.info(`[${serverName}] WebSocket connected, sending connect message`); - const connectMessage = { - type: "connect", - client_type: this.context.clientTypeId - }; - if (bridgeConfig.devUserId) { - connectMessage.dev_user_id = bridgeConfig.devUserId; - } else { - connectMessage.oauth_token = token; - } - this.ws?.send(JSON.stringify(connectMessage)); - }); - this.ws.on("message", (data) => { - try { - const message = JSON.parse(data.toString()); - logger.debug(`[${serverName}] Bridge received: ${JSON.stringify(message)}`); - this.handleMessage(message); - } catch (error46) { - logger.error(`[${serverName}] Failed to parse bridge message:`, error46); - } - }); - this.ws.on("close", (code) => { - const durationSinceConnect = this.connectionEstablishedTime ? Date.now() - this.connectionEstablishedTime : 0; - logger.info(`[${serverName}] Bridge connection closed (code: ${code}, duration: ${durationSinceConnect}ms)`); - trackEvent?.("chrome_bridge_disconnected", { - close_code: code, - duration_since_connect_ms: durationSinceConnect, - reconnect_attempt: this.reconnectAttempts + 1 - }); - this.connected = false; - this.authenticated = false; - this.connecting = false; - this.connectionEstablishedTime = null; - this.scheduleReconnect(); - }); - this.ws.on("error", (error46) => { - const durationMs = this.connectionStartTime ? Date.now() - this.connectionStartTime : 0; - logger.error(`[${serverName}] Bridge WebSocket error after ${durationMs}ms: ${error46.message}`); - trackEvent?.("chrome_bridge_connection_failed", { - duration_ms: durationMs, - error_type: "websocket_error", - reconnect_attempt: this.reconnectAttempts - }); - this.connected = false; - this.authenticated = false; - this.connecting = false; - }); - } - handleMessage(message) { - const { logger, serverName, trackEvent } = this.context; - switch (message.type) { - case "paired": { - const durationMs = this.connectionStartTime ? Date.now() - this.connectionStartTime : 0; - logger.info(`[${serverName}] Paired with Chrome extension (duration: ${durationMs}ms)`); - this.connected = true; - this.authenticated = true; - this.connecting = false; - this.reconnectAttempts = 0; - this.connectionEstablishedTime = Date.now(); - trackEvent?.("chrome_bridge_connection_succeeded", { - duration_ms: durationMs, - status: "paired" - }); - break; - } - case "waiting": { - const durationMs = this.connectionStartTime ? Date.now() - this.connectionStartTime : 0; - logger.info(`[${serverName}] Waiting for Chrome extension to connect (duration: ${durationMs}ms)`); - this.connected = true; - this.authenticated = true; - this.connecting = false; - this.reconnectAttempts = 0; - this.connectionEstablishedTime = Date.now(); - trackEvent?.("chrome_bridge_connection_succeeded", { - duration_ms: durationMs, - status: "waiting" - }); - break; - } - case "peer_connected": - logger.info(`[${serverName}] Chrome extension connected to bridge`); - trackEvent?.("chrome_bridge_peer_connected", null); - if (!this.selectedDeviceId) { - this.discoveryComplete = false; - } - if (this.previousSelectedDeviceId && message.deviceId === this.previousSelectedDeviceId && !this.pendingSwitchResolve) { - logger.info(`[${serverName}] Previously selected extension reconnected, auto-reselecting`); - this.selectExtension(this.previousSelectedDeviceId); - this.previousSelectedDeviceId = undefined; - } - if (this.peerConnectedWaiters.length > 0) { - const waiters = this.peerConnectedWaiters; - this.peerConnectedWaiters = []; - for (const waiter of waiters) { - waiter(true); - } - } - break; - case "peer_disconnected": - logger.info(`[${serverName}] Chrome extension disconnected from bridge`); - trackEvent?.("chrome_bridge_peer_disconnected", null); - if (message.deviceId && message.deviceId === this.selectedDeviceId) { - logger.info(`[${serverName}] Selected extension disconnected, clearing selection`); - this.previousSelectedDeviceId = this.selectedDeviceId; - this.selectedDeviceId = undefined; - this.discoveryComplete = false; - } - break; - case "extensions_list": - if (this.pendingDiscovery) { - clearTimeout(this.pendingDiscovery.timeout); - this.pendingDiscovery.resolve(message.extensions ?? []); - this.pendingDiscovery = null; - } - break; - case "pairing_response": { - const requestId = message.request_id; - const responseDeviceId = message.device_id; - const responseName = message.name; - if (this.pendingPairingRequestId === requestId && responseDeviceId && responseName) { - this.pendingPairingRequestId = undefined; - this.pairingInProgress = false; - this.selectExtension(responseDeviceId); - this.context.onExtensionPaired?.(responseDeviceId, responseName); - logger.info(`[${serverName}] Paired with "${responseName}" (${responseDeviceId.slice(0, 8)})`); - if (this.pendingSwitchResolve) { - this.pendingSwitchResolve({ - deviceId: responseDeviceId, - name: responseName - }); - this.pendingSwitchResolve = null; - } - } - break; - } - case "ping": - this.ws?.send(JSON.stringify({ type: "pong" })); - break; - case "pong": - break; - case "tool_result": - this.handleToolResult(message); - break; - case "permission_request": - this.handlePermissionRequest(message); - break; - case "notification": - if (this.notificationHandler) { - this.notificationHandler({ - method: message.method, - params: message.params - }); - } - break; - case "error": - logger.warn(`[${serverName}] Bridge error: ${message.error}`); - if (this.selectedDeviceId) { - this.selectedDeviceId = undefined; - this.discoveryComplete = false; - } - break; - default: - logger.warn(`[${serverName}] Unrecognized bridge message type: ${message.type}`); - } - } - async handlePermissionRequest(message) { - const { logger, serverName } = this.context; - const toolUseId = message.tool_use_id; - const requestId = message.request_id; - if (!toolUseId || !requestId) { - logger.warn(`[${serverName}] permission_request missing tool_use_id or request_id`); - return; - } - const pending2 = this.pendingCalls.get(toolUseId); - if (!pending2?.onPermissionRequest) { - logger.debug(`[${serverName}] Ignoring permission_request for unknown tool_use_id ${toolUseId.slice(0, 8)} (not our call)`); - return; - } - const request = { - toolUseId, - requestId, - toolType: message.tool_type ?? "unknown", - url: message.url ?? "", - actionData: message.action_data - }; - try { - const allowed = await pending2.onPermissionRequest(request); - this.sendPermissionResponse(requestId, allowed); - } catch (error46) { - logger.error(`[${serverName}] Error handling permission request:`, error46); - this.sendPermissionResponse(requestId, false); - } - } - sendPermissionResponse(requestId, allowed) { - if (this.ws?.readyState === wrapper_default2.OPEN) { - const message = { - type: "permission_response", - request_id: requestId, - allowed - }; - if (this.selectedDeviceId) { - message.target_device_id = this.selectedDeviceId; - } - this.ws.send(JSON.stringify(message)); - } - } - handleToolResult(message) { - const { logger, serverName, trackEvent } = this.context; - const toolUseId = message.tool_use_id; - if (!toolUseId) { - logger.warn(`[${serverName}] Received tool_result without tool_use_id`); - return; - } - const pending2 = this.pendingCalls.get(toolUseId); - if (!pending2) { - logger.debug(`[${serverName}] Received tool_result for unknown call: ${toolUseId.slice(0, 8)}`); - return; - } - const durationMs = Date.now() - pending2.startTime; - const normalized = this.normalizeBridgeResponse(message); - const isError3 = Boolean(message.is_error) || "error" in normalized; - if (pending2.isTabsContext && !this.selectedDeviceId) { - pending2.results.push(normalized); - } else { - clearTimeout(pending2.timer); - this.pendingCalls.delete(toolUseId); - if (isError3) { - const errorContent = normalized.error?.content; - let errorMessage2 = "Unknown error"; - if (Array.isArray(errorContent)) { - const textItem = errorContent.find((item) => typeof item === "object" && item !== null && ("text" in item)); - if (textItem?.text) { - errorMessage2 = textItem.text.slice(0, 200); - } - } - logger.warn(`[${serverName}] Tool call error: ${pending2.toolName} (${toolUseId.slice(0, 8)}) after ${durationMs}ms`); - trackEvent?.("chrome_bridge_tool_call_error", { - tool_name: pending2.toolName, - tool_use_id: toolUseId, - duration_ms: durationMs, - error_message: errorMessage2 - }); - } else { - logger.debug(`[${serverName}] Tool call completed: ${pending2.toolName} (${toolUseId.slice(0, 8)}) in ${durationMs}ms`); - trackEvent?.("chrome_bridge_tool_call_completed", { - tool_name: pending2.toolName, - tool_use_id: toolUseId, - duration_ms: durationMs - }); - } - pending2.resolve(normalized); - } - } - normalizeBridgeResponse(message) { - if (message.result || message.error) { - return message; - } - if (message.content) { - if (message.is_error) { - return { error: { content: message.content } }; - } - return { result: { content: message.content } }; - } - return message; - } - mergeTabsResults(results) { - const mergedTabs = []; - for (const result3 of results) { - const msg = result3; - const resultData = msg.result; - const content = resultData?.content; - if (!content || !Array.isArray(content)) - continue; - for (const item of content) { - if (item.type === "text" && item.text) { - try { - const parsed = JSON.parse(item.text); - if (Array.isArray(parsed)) { - mergedTabs.push(...parsed); - } else if (parsed?.availableTabs && Array.isArray(parsed.availableTabs)) { - mergedTabs.push(...parsed.availableTabs); - } - } catch {} - } - } - } - if (mergedTabs.length > 0) { - const tabListText = mergedTabs.map((t) => { - const tab = t; - return ` • tabId ${tab.tabId}: "${tab.title}" (${tab.url})`; - }).join(` -`); - return { - result: { - content: [ - { - type: "text", - text: JSON.stringify({ availableTabs: mergedTabs }) - }, - { - type: "text", - text: ` - -Tab Context: -- Available tabs: -${tabListText}` - } - ] - } - }; - } - return results[0]; - } - scheduleReconnect() { - const { logger, serverName, trackEvent } = this.context; - if (this.reconnectTimer) - return; - this.reconnectAttempts++; - if (this.reconnectAttempts > 100) { - logger.warn(`[${serverName}] Giving up bridge reconnection after 100 attempts`); - trackEvent?.("chrome_bridge_reconnect_exhausted", { - total_attempts: 100 - }); - this.reconnectAttempts = 0; - return; - } - const delay3 = Math.min(2000 * Math.pow(1.5, this.reconnectAttempts - 1), 30000); - if (this.reconnectAttempts <= 10 || this.reconnectAttempts % 10 === 0) { - logger.info(`[${serverName}] Bridge reconnecting in ${Math.round(delay3)}ms (attempt ${this.reconnectAttempts})`); - } - this.reconnectTimer = setTimeout(() => { - this.reconnectTimer = null; - this.connect(); - }, delay3); - } - closeSocket() { - if (this.ws) { - this.ws.removeAllListeners(); - this.ws.close(); - this.ws = null; - } - this.connected = false; - this.authenticated = false; - this.selectedDeviceId = undefined; - this.discoveryComplete = false; - this.pendingPairingRequestId = undefined; - this.pairingInProgress = false; - if (this.pendingSwitchResolve) { - this.pendingSwitchResolve(null); - this.pendingSwitchResolve = null; - } - if (this.pendingDiscovery) { - clearTimeout(this.pendingDiscovery.timeout); - this.pendingDiscovery.resolve([]); - this.pendingDiscovery = null; - } - if (this.peerConnectedWaiters.length > 0) { - const waiters = this.peerConnectedWaiters; - this.peerConnectedWaiters = []; - for (const waiter of waiters) { - waiter(false); - } - } - } - cleanup() { - if (this.reconnectTimer) { - clearTimeout(this.reconnectTimer); - this.reconnectTimer = null; - } - for (const [id, pending2] of this.pendingCalls) { - clearTimeout(pending2.timer); - pending2.reject(new SocketConnectionError("Bridge client disconnected")); - this.pendingCalls.delete(id); - } - this.closeSocket(); - this.reconnectAttempts = 0; - } -} -function createBridgeClient(context) { - return new BridgeClient(context); -} -var DISCOVERY_TIMEOUT_MS = 5000, PEER_WAIT_TIMEOUT_MS = 1e4; -var init_bridgeClient = __esm(() => { - init_wrapper3(); - init_mcpSocketClient(); -}); - -// ../node_modules/@ant/claude-for-chrome-mcp/src/browserTools.ts -var BROWSER_TOOLS; -var init_browserTools = __esm(() => { - BROWSER_TOOLS = [ - { - name: "javascript_tool", - description: "Execute JavaScript code in the context of the current page. The code runs in the page's context and can interact with the DOM, window object, and page variables. Returns the result of the last expression or any thrown errors. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.", - inputSchema: { - type: "object", - properties: { - action: { - type: "string", - description: "Must be set to 'javascript_exec'" - }, - text: { - type: "string", - description: "The JavaScript code to execute. The code will be evaluated in the page context. The result of the last expression will be returned automatically. Do NOT use 'return' statements - just write the expression you want to evaluate (e.g., 'window.myData.value' not 'return window.myData.value'). You can access and modify the DOM, call page functions, and interact with page variables." - }, - tabId: { - type: "number", - description: "Tab ID to execute the code in. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - } - }, - required: ["action", "text", "tabId"] - } - }, - { - name: "read_page", - description: "Get an accessibility tree representation of elements on the page. By default returns all elements including non-visible ones. Output is limited to 50000 characters by default. If the output exceeds this limit, you will receive an error asking you to specify a smaller depth or focus on a specific element using ref_id. Optionally filter for only interactive elements. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.", - inputSchema: { - type: "object", - properties: { - filter: { - type: "string", - enum: ["interactive", "all"], - description: 'Filter elements: "interactive" for buttons/links/inputs only, "all" for all elements including non-visible ones (default: all elements)' - }, - tabId: { - type: "number", - description: "Tab ID to read from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - }, - depth: { - type: "number", - description: "Maximum depth of the tree to traverse (default: 15). Use a smaller depth if output is too large." - }, - ref_id: { - type: "string", - description: "Reference ID of a parent element to read. Will return the specified element and all its children. Use this to focus on a specific part of the page when output is too large." - }, - max_chars: { - type: "number", - description: "Maximum characters for output (default: 50000). Set to a higher value if your client can handle large outputs." - } - }, - required: ["tabId"] - } - }, - { - name: "find", - description: `Find elements on the page using natural language. Can search for elements by their purpose (e.g., "search bar", "login button") or by text content (e.g., "organic mango product"). Returns up to 20 matching elements with references that can be used with other tools. If more than 20 matches exist, you'll be notified to use a more specific query. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.`, - inputSchema: { - type: "object", - properties: { - query: { - type: "string", - description: 'Natural language description of what to find (e.g., "search bar", "add to cart button", "product title containing organic")' - }, - tabId: { - type: "number", - description: "Tab ID to search in. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - } - }, - required: ["query", "tabId"] - } - }, - { - name: "form_input", - description: "Set values in form elements using element reference ID from the read_page tool. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.", - inputSchema: { - type: "object", - properties: { - ref: { - type: "string", - description: 'Element reference ID from the read_page tool (e.g., "ref_1", "ref_2")' - }, - value: { - type: ["string", "boolean", "number"], - description: "The value to set. For checkboxes use boolean, for selects use option value or text, for other inputs use appropriate string/number" - }, - tabId: { - type: "number", - description: "Tab ID to set form value in. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - } - }, - required: ["ref", "value", "tabId"] - } - }, - { - name: "computer", - description: `Use a mouse and keyboard to interact with a web browser, and take screenshots. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs. -* Whenever you intend to click on an element like an icon, you should consult a screenshot to determine the coordinates of the element before moving the cursor. -* If you tried clicking on a program or link but it failed to load, even after waiting, try adjusting your click location so that the tip of the cursor visually falls on the element that you want to click. -* Make sure to click any buttons, links, icons, etc with the cursor tip in the center of the element. Don't click boxes on their edges unless asked.`, - inputSchema: { - type: "object", - properties: { - action: { - type: "string", - enum: [ - "left_click", - "right_click", - "type", - "screenshot", - "wait", - "scroll", - "key", - "left_click_drag", - "double_click", - "triple_click", - "zoom", - "scroll_to", - "hover" - ], - description: "The action to perform:\n* `left_click`: Click the left mouse button at the specified coordinates.\n* `right_click`: Click the right mouse button at the specified coordinates to open context menus.\n* `double_click`: Double-click the left mouse button at the specified coordinates.\n* `triple_click`: Triple-click the left mouse button at the specified coordinates.\n* `type`: Type a string of text.\n* `screenshot`: Take a screenshot of the screen.\n* `wait`: Wait for a specified number of seconds.\n* `scroll`: Scroll up, down, left, or right at the specified coordinates.\n* `key`: Press a specific keyboard key.\n* `left_click_drag`: Drag from start_coordinate to coordinate.\n* `zoom`: Take a screenshot of a specific region for closer inspection.\n* `scroll_to`: Scroll an element into view using its element reference ID from read_page or find tools.\n* `hover`: Move the mouse cursor to the specified coordinates or element without clicking. Useful for revealing tooltips, dropdown menus, or triggering hover states." - }, - coordinate: { - type: "array", - items: { type: "number" }, - minItems: 2, - maxItems: 2, - description: "(x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates. Required for `left_click`, `right_click`, `double_click`, `triple_click`, and `scroll`. For `left_click_drag`, this is the end position." - }, - text: { - type: "string", - description: 'The text to type (for `type` action) or the key(s) to press (for `key` action). For `key` action: Provide space-separated keys (e.g., "Backspace Backspace Delete"). Supports keyboard shortcuts using the platform\'s modifier key (use "cmd" on Mac, "ctrl" on Windows/Linux, e.g., "cmd+a" or "ctrl+a" for select all).' - }, - duration: { - type: "number", - minimum: 0, - maximum: 30, - description: "The number of seconds to wait. Required for `wait`. Maximum 30 seconds." - }, - scroll_direction: { - type: "string", - enum: ["up", "down", "left", "right"], - description: "The direction to scroll. Required for `scroll`." - }, - scroll_amount: { - type: "number", - minimum: 1, - maximum: 10, - description: "The number of scroll wheel ticks. Optional for `scroll`, defaults to 3." - }, - start_coordinate: { - type: "array", - items: { type: "number" }, - minItems: 2, - maxItems: 2, - description: "(x, y): The starting coordinates for `left_click_drag`." - }, - region: { - type: "array", - items: { type: "number" }, - minItems: 4, - maxItems: 4, - description: "(x0, y0, x1, y1): The rectangular region to capture for `zoom`. Coordinates define a rectangle from top-left (x0, y0) to bottom-right (x1, y1) in pixels from the viewport origin. Required for `zoom` action. Useful for inspecting small UI elements like icons, buttons, or text." - }, - repeat: { - type: "number", - minimum: 1, - maximum: 100, - description: "Number of times to repeat the key sequence. Only applicable for `key` action. Must be a positive integer between 1 and 100. Default is 1. Useful for navigation tasks like pressing arrow keys multiple times." - }, - ref: { - type: "string", - description: 'Element reference ID from read_page or find tools (e.g., "ref_1", "ref_2"). Required for `scroll_to` action. Can be used as alternative to `coordinate` for click actions.' - }, - modifiers: { - type: "string", - description: 'Modifier keys for click actions. Supports: "ctrl", "shift", "alt", "cmd" (or "meta"), "win" (or "windows"). Can be combined with "+" (e.g., "ctrl+shift", "cmd+alt"). Optional.' - }, - tabId: { - type: "number", - description: "Tab ID to execute the action on. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - } - }, - required: ["action", "tabId"] - } - }, - { - name: "navigate", - description: "Navigate to a URL, or go forward/back in browser history. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.", - inputSchema: { - type: "object", - properties: { - url: { - type: "string", - description: 'The URL to navigate to. Can be provided with or without protocol (defaults to https://). Use "forward" to go forward in history or "back" to go back in history.' - }, - tabId: { - type: "number", - description: "Tab ID to navigate. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - } - }, - required: ["url", "tabId"] - } - }, - { - name: "resize_window", - description: "Resize the current browser window to specified dimensions. Useful for testing responsive designs or setting up specific screen sizes. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.", - inputSchema: { - type: "object", - properties: { - width: { - type: "number", - description: "Target window width in pixels" - }, - height: { - type: "number", - description: "Target window height in pixels" - }, - tabId: { - type: "number", - description: "Tab ID to get the window for. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - } - }, - required: ["width", "height", "tabId"] - } - }, - { - name: "gif_creator", - description: "Manage GIF recording and export for browser automation sessions. Control when to start/stop recording browser actions (clicks, scrolls, navigation), then export as an animated GIF with visual overlays (click indicators, action labels, progress bar, watermark). All operations are scoped to the tab's group. When starting recording, take a screenshot immediately after to capture the initial state as the first frame. When stopping recording, take a screenshot immediately before to capture the final state as the last frame. For export, either provide 'coordinate' to drag/drop upload to a page element, or set 'download: true' to download the GIF.", - inputSchema: { - type: "object", - properties: { - action: { - type: "string", - enum: ["start_recording", "stop_recording", "export", "clear"], - description: "Action to perform: 'start_recording' (begin capturing), 'stop_recording' (stop capturing but keep frames), 'export' (generate and export GIF), 'clear' (discard frames)" - }, - tabId: { - type: "number", - description: "Tab ID to identify which tab group this operation applies to" - }, - download: { - type: "boolean", - description: "Always set this to true for the 'export' action only. This causes the gif to be downloaded in the browser." - }, - filename: { - type: "string", - description: "Optional filename for exported GIF (default: 'recording-[timestamp].gif'). For 'export' action only." - }, - options: { - type: "object", - description: "Optional GIF enhancement options for 'export' action. Properties: showClickIndicators (bool), showDragPaths (bool), showActionLabels (bool), showProgressBar (bool), showWatermark (bool), quality (number 1-30). All default to true except quality (default: 10).", - properties: { - showClickIndicators: { - type: "boolean", - description: "Show orange circles at click locations (default: true)" - }, - showDragPaths: { - type: "boolean", - description: "Show red arrows for drag actions (default: true)" - }, - showActionLabels: { - type: "boolean", - description: "Show black labels describing actions (default: true)" - }, - showProgressBar: { - type: "boolean", - description: "Show orange progress bar at bottom (default: true)" - }, - showWatermark: { - type: "boolean", - description: "Show Claude logo watermark (default: true)" - }, - quality: { - type: "number", - description: "GIF compression quality, 1-30 (lower = better quality, slower encoding). Default: 10" - } - } - } - }, - required: ["action", "tabId"] - } - }, - { - name: "upload_image", - description: "Upload a previously captured screenshot or user-uploaded image to a file input or drag & drop target. Supports two approaches: (1) ref - for targeting specific elements, especially hidden file inputs, (2) coordinate - for drag & drop to visible locations like Google Docs. Provide either ref or coordinate, not both.", - inputSchema: { - type: "object", - properties: { - imageId: { - type: "string", - description: "ID of a previously captured screenshot (from the computer tool's screenshot action) or a user-uploaded image" - }, - ref: { - type: "string", - description: 'Element reference ID from read_page or find tools (e.g., "ref_1", "ref_2"). Use this for file inputs (especially hidden ones) or specific elements. Provide either ref or coordinate, not both.' - }, - coordinate: { - type: "array", - items: { - type: "number" - }, - description: "Viewport coordinates [x, y] for drag & drop to a visible location. Use this for drag & drop targets like Google Docs. Provide either ref or coordinate, not both." - }, - tabId: { - type: "number", - description: "Tab ID where the target element is located. This is where the image will be uploaded to." - }, - filename: { - type: "string", - description: 'Optional filename for the uploaded file (default: "image.png")' - } - }, - required: ["imageId", "tabId"] - } - }, - { - name: "get_page_text", - description: "Extract raw text content from the page, prioritizing article content. Ideal for reading articles, blog posts, or other text-heavy pages. Returns plain text without HTML formatting. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.", - inputSchema: { - type: "object", - properties: { - tabId: { - type: "number", - description: "Tab ID to extract text from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - } - }, - required: ["tabId"] - } - }, - { - name: "tabs_context_mcp", - title: "Tabs Context", - description: "Get context information about the current MCP tab group. Returns all tab IDs inside the group if it exists. CRITICAL: You must get the context at least once before using other browser automation tools so you know what tabs exist. Each new conversation should create its own new tab (using tabs_create_mcp) rather than reusing existing tabs, unless the user explicitly asks to use an existing tab.", - inputSchema: { - type: "object", - properties: { - createIfEmpty: { - type: "boolean", - description: "Creates a new MCP tab group if none exists, creates a new Window with a new tab group containing an empty tab (which can be used for this conversation). If a MCP tab group already exists, this parameter has no effect." - } - }, - required: [] - } - }, - { - name: "tabs_create_mcp", - title: "Tabs Create", - description: "Creates a new empty tab in the MCP tab group. CRITICAL: You must get the context using tabs_context_mcp at least once before using other browser automation tools so you know what tabs exist.", - inputSchema: { - type: "object", - properties: {}, - required: [] - } - }, - { - name: "update_plan", - description: "Present a plan to the user for approval before taking actions. The user will see the domains you intend to visit and your approach. Once approved, you can proceed with actions on the approved domains without additional permission prompts.", - inputSchema: { - type: "object", - properties: { - domains: { - type: "array", - items: { type: "string" }, - description: "List of domains you will visit (e.g., ['github.com', 'stackoverflow.com']). These domains will be approved for the session when the user accepts the plan." - }, - approach: { - type: "array", - items: { type: "string" }, - description: "High-level description of what you will do. Focus on outcomes and key actions, not implementation details. Be concise - aim for 3-7 items." - } - }, - required: ["domains", "approach"] - } - }, - { - name: "read_console_messages", - description: "Read browser console messages (console.log, console.error, console.warn, etc.) from a specific tab. Useful for debugging JavaScript errors, viewing application logs, or understanding what's happening in the browser console. Returns console messages from the current domain only. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs. IMPORTANT: Always provide a pattern to filter messages - without a pattern, you may get too many irrelevant messages.", - inputSchema: { - type: "object", - properties: { - tabId: { - type: "number", - description: "Tab ID to read console messages from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - }, - onlyErrors: { - type: "boolean", - description: "If true, only return error and exception messages. Default is false (return all message types)." - }, - clear: { - type: "boolean", - description: "If true, clear the console messages after reading to avoid duplicates on subsequent calls. Default is false." - }, - pattern: { - type: "string", - description: "Regex pattern to filter console messages. Only messages matching this pattern will be returned (e.g., 'error|warning' to find errors and warnings, 'MyApp' to filter app-specific logs). You should always provide a pattern to avoid getting too many irrelevant messages." - }, - limit: { - type: "number", - description: "Maximum number of messages to return. Defaults to 100. Increase only if you need more results." - } - }, - required: ["tabId"] - } - }, - { - name: "read_network_requests", - description: "Read HTTP network requests (XHR, Fetch, documents, images, etc.) from a specific tab. Useful for debugging API calls, monitoring network activity, or understanding what requests a page is making. Returns all network requests made by the current page, including cross-origin requests. Requests are automatically cleared when the page navigates to a different domain. If you don't have a valid tab ID, use tabs_context_mcp first to get available tabs.", - inputSchema: { - type: "object", - properties: { - tabId: { - type: "number", - description: "Tab ID to read network requests from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - }, - urlPattern: { - type: "string", - description: "Optional URL pattern to filter requests. Only requests whose URL contains this string will be returned (e.g., '/api/' to filter API calls, 'example.com' to filter by domain)." - }, - clear: { - type: "boolean", - description: "If true, clear the network requests after reading to avoid duplicates on subsequent calls. Default is false." - }, - limit: { - type: "number", - description: "Maximum number of requests to return. Defaults to 100. Increase only if you need more results." - } - }, - required: ["tabId"] - } - }, - { - name: "shortcuts_list", - description: "List all available shortcuts and workflows (shortcuts and workflows are interchangeable). Returns shortcuts with their commands, descriptions, and whether they are workflows. Use shortcuts_execute to run a shortcut or workflow.", - inputSchema: { - type: "object", - properties: { - tabId: { - type: "number", - description: "Tab ID to list shortcuts from. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - } - }, - required: ["tabId"] - } - }, - { - name: "shortcuts_execute", - description: "Execute a shortcut or workflow by running it in a new sidepanel window using the current tab (shortcuts and workflows are interchangeable). Use shortcuts_list first to see available shortcuts. This starts the execution and returns immediately - it does not wait for completion.", - inputSchema: { - type: "object", - properties: { - tabId: { - type: "number", - description: "Tab ID to execute the shortcut on. Must be a tab in the current group. Use tabs_context_mcp first if you don't have a valid tab ID." - }, - shortcutId: { - type: "string", - description: "The ID of the shortcut to execute" - }, - command: { - type: "string", - description: "The command name of the shortcut to execute (e.g., 'debug', 'summarize'). Do not include the leading slash." - } - }, - required: ["tabId"] - } - }, - { - name: "switch_browser", - description: "Switch which Chrome browser is used for browser automation. Call this when the user wants to connect to a different Chrome browser. Broadcasts a connection request to all Chrome browsers with the extension installed — the user clicks 'Connect' in the desired browser.", - inputSchema: { - type: "object", - properties: {}, - required: [] - } - } - ]; -}); - -// ../node_modules/@ant/claude-for-chrome-mcp/src/mcpSocketPool.ts -class McpSocketPool { - clients = new Map; - tabRoutes = new Map; - context; - notificationHandler = null; - constructor(context) { - this.context = context; - } - setNotificationHandler(handler14) { - this.notificationHandler = handler14; - for (const client5 of this.clients.values()) { - client5.setNotificationHandler(handler14); - } - } - async ensureConnected() { - const { logger, serverName } = this.context; - this.refreshClients(); - const connectPromises = []; - for (const client5 of this.clients.values()) { - if (!client5.isConnected()) { - connectPromises.push(client5.ensureConnected().catch(() => false)); - } - } - if (connectPromises.length > 0) { - await Promise.all(connectPromises); - } - const connectedCount = this.getConnectedClients().length; - if (connectedCount === 0) { - logger.info(`[${serverName}] No connected sockets in pool`); - return false; - } - logger.info(`[${serverName}] Socket pool: ${connectedCount} connected`); - return true; - } - async callTool(name, args, _permissionOverrides) { - if (name === "tabs_context_mcp") { - return this.callTabsContext(args); - } - const tabId = args.tabId; - if (tabId !== undefined) { - const socketPath2 = this.tabRoutes.get(tabId); - if (socketPath2) { - const client5 = this.clients.get(socketPath2); - if (client5?.isConnected()) { - return client5.callTool(name, args); - } - } - } - const connected = this.getConnectedClients(); - if (connected.length === 0) { - throw new SocketConnectionError(`[${this.context.serverName}] No connected sockets available`); - } - return connected[0].callTool(name, args); - } - async setPermissionMode(mode, allowedDomains) { - const connected = this.getConnectedClients(); - await Promise.all(connected.map((client5) => client5.setPermissionMode(mode, allowedDomains))); - } - isConnected() { - return this.getConnectedClients().length > 0; - } - disconnect() { - for (const client5 of this.clients.values()) { - client5.disconnect(); - } - this.clients.clear(); - this.tabRoutes.clear(); - } - getConnectedClients() { - return [...this.clients.values()].filter((c6) => c6.isConnected()); - } - async callTabsContext(args) { - const { logger, serverName } = this.context; - const connected = this.getConnectedClients(); - if (connected.length === 0) { - throw new SocketConnectionError(`[${serverName}] No connected sockets available`); - } - if (connected.length === 1) { - const result3 = await connected[0].callTool("tabs_context_mcp", args); - this.updateTabRoutes(result3, this.getSocketPathForClient(connected[0])); - return result3; - } - const results = await Promise.allSettled(connected.map(async (client5) => { - const result3 = await client5.callTool("tabs_context_mcp", args); - const socketPath2 = this.getSocketPathForClient(client5); - return { result: result3, socketPath: socketPath2 }; - })); - const mergedTabs = []; - this.tabRoutes.clear(); - for (const settledResult of results) { - if (settledResult.status !== "fulfilled") { - logger.info(`[${serverName}] tabs_context_mcp failed on one socket: ${settledResult.reason}`); - continue; - } - const { result: result3, socketPath: socketPath2 } = settledResult.value; - this.updateTabRoutes(result3, socketPath2); - const tabs = this.extractTabs(result3); - if (tabs) { - mergedTabs.push(...tabs); - } - } - if (mergedTabs.length > 0) { - const tabListText = mergedTabs.map((t) => { - const tab = t; - return ` • tabId ${tab.tabId}: "${tab.title}" (${tab.url})`; - }).join(` -`); - return { - result: { - content: [ - { - type: "text", - text: JSON.stringify({ availableTabs: mergedTabs }) - }, - { - type: "text", - text: ` - -Tab Context: -- Available tabs: -${tabListText}` - } - ] - } - }; - } - for (const settledResult of results) { - if (settledResult.status === "fulfilled") { - return settledResult.value.result; - } - } - throw new SocketConnectionError(`[${serverName}] All sockets failed for tabs_context_mcp`); - } - updateTabRoutes(result3, socketPath2) { - const tabs = this.extractTabs(result3); - if (!tabs) - return; - for (const tab of tabs) { - if (typeof tab === "object" && tab !== null && "tabId" in tab) { - const tabId = tab.tabId; - this.tabRoutes.set(tabId, socketPath2); - } - } - } - extractTabs(result3) { - if (!result3 || typeof result3 !== "object") - return null; - const asResponse = result3; - const content = asResponse.result?.content; - if (!content || !Array.isArray(content)) - return null; - for (const item of content) { - if (item.type === "text" && item.text) { - try { - const parsed = JSON.parse(item.text); - if (Array.isArray(parsed)) - return parsed; - if (parsed && Array.isArray(parsed.availableTabs)) { - return parsed.availableTabs; - } - } catch {} - } - } - return null; - } - getSocketPathForClient(client5) { - for (const [path22, c6] of this.clients.entries()) { - if (c6 === client5) - return path22; - } - return ""; - } - refreshClients() { - const socketPaths = this.getAvailableSocketPaths(); - const { logger, serverName } = this.context; - for (const path22 of socketPaths) { - if (!this.clients.has(path22)) { - logger.info(`[${serverName}] Adding socket to pool: ${path22}`); - const clientContext = { - ...this.context, - socketPath: path22, - getSocketPath: undefined, - getSocketPaths: undefined - }; - const client5 = createMcpSocketClient(clientContext); - client5.disableAutoReconnect = true; - if (this.notificationHandler) { - client5.setNotificationHandler(this.notificationHandler); - } - this.clients.set(path22, client5); - } - } - for (const [path22, client5] of this.clients.entries()) { - if (!socketPaths.includes(path22)) { - logger.info(`[${serverName}] Removing stale socket from pool: ${path22}`); - client5.disconnect(); - this.clients.delete(path22); - for (const [tabId, socketPath2] of this.tabRoutes.entries()) { - if (socketPath2 === path22) { - this.tabRoutes.delete(tabId); - } - } - } - } - } - getAvailableSocketPaths() { - return this.context.getSocketPaths?.() ?? []; - } -} -function createMcpSocketPool(context) { - return new McpSocketPool(context); -} -var init_mcpSocketPool = __esm(() => { - init_mcpSocketClient(); -}); - -// ../node_modules/@ant/claude-for-chrome-mcp/src/toolCalls.ts -async function handleToolCallConnected(context, socketClient, name, args, permissionOverrides) { - const response = await socketClient.callTool(name, args, permissionOverrides); - context.logger.silly(`[${context.serverName}] Received result from socket bridge: ${JSON.stringify(response)}`); - if (response === null || response === undefined) { - return { - content: [{ type: "text", text: "Tool execution completed" }] - }; - } - const { result: result3, error: error46 } = response; - const contentData = error46 || result3; - const isError3 = !!error46; - if (!contentData) { - return { - content: [{ type: "text", text: "Tool execution completed" }] - }; - } - if (isError3 && isAuthenticationError2(contentData.content)) { - context.onAuthenticationError(); - } - const { content } = contentData; - if (content && Array.isArray(content)) { - if (isError3) { - return { - content: content.map((item) => { - if (typeof item === "object" && item !== null && "type" in item) { - return item; - } - return { type: "text", text: String(item) }; - }), - isError: true - }; - } - const convertedContent = content.map((item) => { - if (typeof item === "object" && item !== null && "type" in item && "source" in item) { - const typedItem = item; - if (typedItem.type === "image" && typeof typedItem.source === "object" && typedItem.source !== null && "data" in typedItem.source) { - return { - type: "image", - data: typedItem.source.data, - mimeType: "media_type" in typedItem.source ? typedItem.source.media_type || "image/png" : "image/png" - }; - } - } - if (typeof item === "object" && item !== null && "type" in item) { - return item; - } - return { type: "text", text: String(item) }; - }); - return { - content: convertedContent, - isError: isError3 - }; - } - if (typeof content === "string") { - return { - content: [{ type: "text", text: content }], - isError: isError3 - }; - } - context.logger.warn(`[${context.serverName}] Unexpected result format from socket bridge`, response); - return { - content: [{ type: "text", text: JSON.stringify(response) }], - isError: isError3 - }; -} -function handleToolCallDisconnected(context) { - const text2 = context.onToolCallDisconnected(); - return { - content: [{ type: "text", text: text2 }] - }; -} -async function handleSetPermissionMode(socketClient, args) { - const validModes = [ - "ask", - "skip_all_permission_checks", - "follow_a_plan" - ]; - const mode = args.mode; - const permissionMode = mode && validModes.includes(mode) ? mode : "ask"; - if (socketClient.setPermissionMode) { - await socketClient.setPermissionMode(permissionMode, args.allowed_domains); - } - return { - content: [ - { type: "text", text: `Permission mode set to: ${permissionMode}` } - ] - }; -} -async function handleSwitchBrowser(context, socketClient) { - if (!context.bridgeConfig) { - return { - content: [ - { - type: "text", - text: "Browser switching is only available with bridge connections." - } - ], - isError: true - }; - } - const isConnected2 = await socketClient.ensureConnected(); - if (!isConnected2) { - return handleToolCallDisconnected(context); - } - const result3 = await socketClient.switchBrowser?.() ?? null; - if (result3 === "no_other_browsers") { - return { - content: [ - { - type: "text", - text: "No other browsers available to switch to. Open Chrome with the Claude extension in another browser to switch." - } - ], - isError: true - }; - } - if (result3) { - return { - content: [ - { type: "text", text: `Connected to browser "${result3.name}".` } - ] - }; - } - return { - content: [ - { - type: "text", - text: "No browser responded within the timeout. Make sure Chrome is open with the Claude extension installed, then try again." - } - ], - isError: true - }; -} -function isAuthenticationError2(content) { - const errorText = Array.isArray(content) ? content.map((item) => { - if (typeof item === "string") - return item; - if (typeof item === "object" && item !== null && "text" in item && typeof item.text === "string") { - return item.text; - } - return ""; - }).join(" ") : String(content); - return errorText.toLowerCase().includes("re-authenticated"); -} -var handleToolCall2 = async (context, socketClient, name, args, permissionOverrides) => { - if (name === "set_permission_mode") { - return handleSetPermissionMode(socketClient, args); - } - if (name === "switch_browser") { - return handleSwitchBrowser(context, socketClient); - } - try { - const isConnected2 = await socketClient.ensureConnected(); - context.logger.silly(`[${context.serverName}] Server is connected: ${isConnected2}. Received tool call: ${name} with args: ${JSON.stringify(args)}.`); - if (isConnected2) { - return await handleToolCallConnected(context, socketClient, name, args, permissionOverrides); - } - return handleToolCallDisconnected(context); - } catch (error46) { - context.logger.info(`[${context.serverName}] Error calling tool:`, error46); - if (error46 instanceof SocketConnectionError) { - return handleToolCallDisconnected(context); - } - return { - content: [ - { - type: "text", - text: `Error calling tool, please try again. : ${error46 instanceof Error ? error46.message : String(error46)}` - } - ], - isError: true - }; - } -}; -var init_toolCalls2 = __esm(() => { - init_mcpSocketClient(); -}); - -// ../node_modules/@ant/claude-for-chrome-mcp/src/mcpServer.ts -function createChromeSocketClient(context) { - return context.bridgeConfig ? createBridgeClient(context) : context.getSocketPaths ? createMcpSocketPool(context) : createMcpSocketClient(context); -} -function createClaudeForChromeMcpServer(context, existingSocketClient) { - const { serverName, logger } = context; - const socketClient = existingSocketClient ?? createChromeSocketClient(context); - const server = new Server({ - name: serverName, - version: "1.0.0" - }, { - capabilities: { - tools: {}, - logging: {} - } - }); - server.setRequestHandler(ListToolsRequestSchema2, async () => { - if (context.isDisabled?.()) { - return { tools: [] }; - } - return { - tools: context.bridgeConfig ? BROWSER_TOOLS : BROWSER_TOOLS.filter((t) => t.name !== "switch_browser") - }; - }); - server.setRequestHandler(CallToolRequestSchema2, async (request) => { - logger.info(`[${serverName}] Executing tool: ${request.params.name}`); - return handleToolCall2(context, socketClient, request.params.name, request.params.arguments || {}); - }); - socketClient.setNotificationHandler((notification) => { - logger.info(`[${serverName}] Forwarding MCP notification: ${notification.method}`); - server.notification({ - method: notification.method, - params: notification.params - }).catch((error46) => { - logger.info(`[${serverName}] Failed to forward MCP notification: ${error46.message}`); - }); - }); - return server; -} -var init_mcpServer2 = __esm(() => { - init_server2(); - init_types14(); - init_bridgeClient(); - init_browserTools(); - init_mcpSocketClient(); - init_mcpSocketPool(); - init_toolCalls2(); -}); - -// ../node_modules/@ant/claude-for-chrome-mcp/src/index.ts -var exports_src = {}; -__export(exports_src, { - localPlatformLabel: () => localPlatformLabel, +// stub-npm:@ant/claude-for-chrome-mcp +var exports_claude_for_chrome_mcp = {}; +__export(exports_claude_for_chrome_mcp, { + default: () => claude_for_chrome_mcp_default, createClaudeForChromeMcpServer: () => createClaudeForChromeMcpServer, - createChromeSocketClient: () => createChromeSocketClient, - createBridgeClient: () => createBridgeClient, - BridgeClient: () => BridgeClient, + __stub__: () => __stub__29, BROWSER_TOOLS: () => BROWSER_TOOLS }); -var init_src2 = __esm(() => { - init_bridgeClient(); - init_browserTools(); - init_mcpServer2(); +var handler18, stub18, claude_for_chrome_mcp_default, __stub__29 = true, createClaudeForChromeMcpServer, BROWSER_TOOLS; +var init_claude_for_chrome_mcp = __esm(() => { + handler18 = { get: (t, p) => p === "__esModule" ? true : () => {} }; + stub18 = new Proxy({}, handler18); + claude_for_chrome_mcp_default = stub18; + createClaudeForChromeMcpServer = new Proxy(function() {}, { get: (t, p) => typeof p === "string" ? () => {} : t[p], apply: () => ({}) }); + BROWSER_TOOLS = new Proxy(function() {}, { get: (t, p) => typeof p === "string" ? () => {} : t[p], apply: () => ({}) }); }); // node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js @@ -580505,12 +503071,12 @@ class StdioServerTransport { this._stdout = _stdout; this._readBuffer = new ReadBuffer; this._started = false; - this._ondata = (chunk3) => { - this._readBuffer.append(chunk3); + this._ondata = (chunk2) => { + this._readBuffer.append(chunk2); this.processReadBuffer(); }; - this._onerror = (error46) => { - this.onerror?.(error46); + this._onerror = (error42) => { + this.onerror?.(error42); }; } async start() { @@ -580529,8 +503095,8 @@ class StdioServerTransport { break; } this.onmessage?.(message); - } catch (error46) { - this.onerror?.(error46); + } catch (error42) { + this.onerror?.(error42); } } } @@ -580545,12 +503111,12 @@ class StdioServerTransport { this.onclose?.(); } send(message) { - return new Promise((resolve41) => { + return new Promise((resolve35) => { const json2 = serializeMessage(message); if (this._stdout.write(json2)) { - resolve41(); + resolve35(); } else { - this._stdout.once("drain", resolve41); + this._stdout.once("drain", resolve35); } }); } @@ -580632,11 +503198,11 @@ function getChromeBridgeUrl() { function isLocalBridge() { return isEnvTruthy(process.env.USE_LOCAL_OAUTH) || isEnvTruthy(process.env.LOCAL_BRIDGE); } -function createChromeContext(env5) { +function createChromeContext(env4) { const logger = new DebugLogger2; const chromeBridgeUrl = getChromeBridgeUrl(); logger.info(`Bridge URL: ${chromeBridgeUrl ?? "none (using native socket)"}`); - const rawPermissionMode = env5?.CLAUDE_CHROME_PERMISSION_MODE ?? process.env.CLAUDE_CHROME_PERMISSION_MODE; + const rawPermissionMode = env4?.CLAUDE_CHROME_PERMISSION_MODE ?? process.env.CLAUDE_CHROME_PERMISSION_MODE; let initialPermissionMode; if (rawPermissionMode) { if (isPermissionMode(rawPermissionMode)) { @@ -580658,12 +503224,12 @@ function createChromeContext(env5) { return `Browser extension is not connected. Please ensure the Claude browser extension is installed and running (${EXTENSION_DOWNLOAD_URL}), and that you are logged into claude.ai with the same account as Claude Code. If this is your first time connecting to Chrome, you may need to restart Chrome for the installation to take effect. If you continue to experience issues, please report a bug: ${BUG_REPORT_URL}`; }, onExtensionPaired: (deviceId, name) => { - saveGlobalConfig((config5) => { - if (config5.chromeExtension?.pairedDeviceId === deviceId && config5.chromeExtension?.pairedDeviceName === name) { - return config5; + saveGlobalConfig((config3) => { + if (config3.chromeExtension?.pairedDeviceId === deviceId && config3.chromeExtension?.pairedDeviceName === name) { + return config3; } return { - ...config5, + ...config3, chromeExtension: { pairedDeviceId: deviceId, pairedDeviceName: name @@ -580774,15 +503340,15 @@ class DebugLogger2 { } } var EXTENSION_DOWNLOAD_URL = "https://claude.ai/chrome", BUG_REPORT_URL = "https://github.com/anthropics/claude-code/issues/new?labels=bug,claude-in-chrome", SAFE_BRIDGE_STRING_KEYS, PERMISSION_MODES2; -var init_mcpServer3 = __esm(() => { - init_src2(); +var init_mcpServer2 = __esm(() => { + init_claude_for_chrome_mcp(); init_stdio4(); init_datadog(); init_firstPartyEventLogger(); init_growthbook(); init_analytics(); init_sink(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_envUtils(); @@ -580845,12 +503411,12 @@ function createLinkedTransportPair() { } // src/utils/computerUse/appNames.ts -function isUserFacingPath(path22, homeDir) { - if (PATH_ALLOWLIST.some((root3) => path22.startsWith(root3))) +function isUserFacingPath(path17, homeDir) { + if (PATH_ALLOWLIST.some((root2) => path17.startsWith(root2))) return true; if (homeDir) { const userApps = homeDir.endsWith("/") ? `${homeDir}Applications/` : `${homeDir}/Applications/`; - if (path22.startsWith(userApps)) + if (path17.startsWith(userApps)) return true; } return false; @@ -580886,7 +503452,7 @@ function sanitizeTrustedNames(raw) { return sanitizeCore(raw, false); } function filterAppsForDescription(installed, homeDir) { - const { alwaysKept, rest: rest3 } = installed.reduce((acc, app) => { + const { alwaysKept, rest: rest2 } = installed.reduce((acc, app) => { if (ALWAYS_KEEP_BUNDLE_IDS.has(app.bundleId)) { acc.alwaysKept.push(app.displayName); } else if (isUserFacingPath(app.path, homeDir) && !isNoisyName(app.displayName)) { @@ -580898,7 +503464,7 @@ function filterAppsForDescription(installed, homeDir) { const alwaysSet = new Set(sanitizedAlways); return [ ...sanitizedAlways, - ...sanitizeAppNames(rest3).filter((n2) => !alwaysSet.has(n2)) + ...sanitizeAppNames(rest2).filter((n2) => !alwaysSet.has(n2)) ]; } var PATH_ALLOWLIST, NAME_PATTERN_BLOCKLIST, ALWAYS_KEEP_BUNDLE_IDS, APP_NAME_ALLOWED, APP_NAME_MAX_LEN = 40, APP_NAME_MAX_COUNT = 50; @@ -580957,13 +503523,13 @@ __export(exports_mcpServer2, { runComputerUseMcpServer: () => runComputerUseMcpServer, createComputerUseMcpServerForCli: () => createComputerUseMcpServerForCli }); -import { homedir as homedir26 } from "os"; +import { homedir as homedir24 } from "os"; async function tryGetInstalledAppNames() { const adapter2 = getComputerUseHostAdapter(); const enumP = adapter2.executor.listInstalledApps(); let timer; - const timeoutP = new Promise((resolve41) => { - timer = setTimeout(resolve41, APP_ENUM_TIMEOUT_MS, undefined); + const timeoutP = new Promise((resolve35) => { + timer = setTimeout(resolve35, APP_ENUM_TIMEOUT_MS, undefined); }); const installed = await Promise.race([enumP, timeoutP]).catch(() => { return; @@ -580973,7 +503539,7 @@ async function tryGetInstalledAppNames() { logForDebugging(`[Computer Use MCP] app enumeration exceeded ${APP_ENUM_TIMEOUT_MS}ms or failed; tool description omits list`); return; } - return filterAppsForDescription(installed, homedir26()); + return filterAppsForDescription(installed, homedir24()); } async function createComputerUseMcpServerForCli() { const adapter2 = getComputerUseHostAdapter(); @@ -581004,7 +503570,7 @@ async function runComputerUseMcpServer() { logForDebugging("[Computer Use MCP] MCP server started"); } var APP_ENUM_TIMEOUT_MS = 1000; -var init_mcpServer4 = __esm(() => { +var init_mcpServer3 = __esm(() => { init_src(); init_stdio4(); init_types4(); @@ -581019,24 +503585,24 @@ var init_mcpServer4 = __esm(() => { }); // src/services/mcp/client.ts -import { mkdir as mkdir33, readFile as readFile40, unlink as unlink17, writeFile as writeFile36 } from "fs/promises"; -import { dirname as dirname50, join as join117 } from "path"; -function isMcpSessionExpiredError(error46) { - const httpStatus = "code" in error46 ? error46.code : undefined; +import { mkdir as mkdir33, readFile as readFile39, unlink as unlink17, writeFile as writeFile34 } from "fs/promises"; +import { dirname as dirname46, join as join107 } from "path"; +function isMcpSessionExpiredError(error42) { + const httpStatus = "code" in error42 ? error42.code : undefined; if (httpStatus !== 404) { return false; } - return error46.message.includes('"code":-32001') || error46.message.includes('"code": -32001'); + return error42.message.includes('"code":-32001') || error42.message.includes('"code": -32001'); } function getMcpToolTimeoutMs() { return parseInt(process.env.MCP_TOOL_TIMEOUT || "", 10) || DEFAULT_MCP_TOOL_TIMEOUT_MS; } function getMcpAuthCachePath() { - return join117(getClaudeConfigHomeDir(), "mcp-needs-auth-cache.json"); + return join107(getClaudeConfigHomeDir(), "mcp-needs-auth-cache.json"); } function getMcpAuthCache() { if (!authCachePromise) { - authCachePromise = readFile40(getMcpAuthCachePath(), "utf-8").then((data) => jsonParse(data)).catch(() => ({})); + authCachePromise = readFile39(getMcpAuthCachePath(), "utf-8").then((data) => jsonParse(data)).catch(() => ({})); } return authCachePromise; } @@ -581053,8 +503619,8 @@ function setMcpAuthCacheEntry(serverId) { const cache4 = await getMcpAuthCache(); cache4[serverId] = { timestamp: Date.now() }; const cachePath = getMcpAuthCachePath(); - await mkdir33(dirname50(cachePath), { recursive: true }); - await writeFile36(cachePath, jsonStringify(cache4)); + await mkdir33(dirname46(cachePath), { recursive: true }); + await writeFile34(cachePath, jsonStringify(cache4)); authCachePromise = null; }).catch(() => {}); } @@ -581083,16 +503649,16 @@ function handleRemoteAuthFailure(name, serverRef, transportType) { return { name, type: "needs-auth", config: serverRef }; } function createClaudeAiProxyFetch(innerFetch) { - return async (url3, init2) => { + return async (url3, init) => { const doRequest = async () => { await checkAndRefreshOAuthTokenIfNeeded(); const currentTokens = getClaudeAIOAuthTokens(); if (!currentTokens) { throw new Error("No claude.ai OAuth token available"); } - const headers = new Headers(init2?.headers); + const headers = new Headers(init?.headers); headers.set("Authorization", `Bearer ${currentTokens.accessToken}`); - const response2 = await innerFetch(url3, { ...init2, headers }); + const response2 = await innerFetch(url3, { ...init, headers }); return { response: response2, sentToken: currentTokens.accessToken }; }; const { response, sentToken } = await doRequest(); @@ -581104,8 +503670,8 @@ function createClaudeAiProxyFetch(innerFetch) { tokenChanged }); if (!tokenChanged) { - const now3 = getClaudeAIOAuthTokens()?.accessToken; - if (!now3 || now3 === sentToken) { + const now2 = getClaudeAIOAuthTokens()?.accessToken; + if (!now2 || now2 === sentToken) { return response; } } @@ -581125,19 +503691,19 @@ function getConnectionTimeoutMs() { return parseInt(process.env.MCP_TIMEOUT || "", 10) || 30000; } function wrapFetchWithTimeout(baseFetch) { - return async (url3, init2) => { - const method3 = (init2?.method ?? "GET").toUpperCase(); - if (method3 === "GET") { - return baseFetch(url3, init2); + return async (url3, init) => { + const method2 = (init?.method ?? "GET").toUpperCase(); + if (method2 === "GET") { + return baseFetch(url3, init); } - const headers = new Headers(init2?.headers); + const headers = new Headers(init?.headers); if (!headers.has("accept")) { headers.set("accept", MCP_STREAMABLE_HTTP_ACCEPT); } const controller = new AbortController; const timer = setTimeout((c6) => c6.abort(new DOMException("The operation timed out.", "TimeoutError")), MCP_REQUEST_TIMEOUT_MS, controller); timer.unref?.(); - const parentSignal = init2?.signal; + const parentSignal = init?.signal; const abort = () => controller.abort(parentSignal?.reason); parentSignal?.addEventListener("abort", abort); if (parentSignal?.aborted) { @@ -581149,15 +503715,15 @@ function wrapFetchWithTimeout(baseFetch) { }; try { const response = await baseFetch(url3, { - ...init2, + ...init, headers, signal: controller.signal }); cleanup(); return response; - } catch (error46) { + } catch (error42) { cleanup(); - throw error46; + throw error42; } }; } @@ -581167,8 +503733,8 @@ function getMcpServerConnectionBatchSize() { function getRemoteMcpServerConnectionBatchSize() { return parseInt(process.env.MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE || "", 10) || 20; } -function isLocalMcpServer(config5) { - return !config5.type || config5.type === "stdio" || config5.type === "sdk"; +function isLocalMcpServer(config3) { + return !config3.type || config3.type === "stdio" || config3.type === "sdk"; } function isIncludedMcpTool(tool) { return !tool.name.startsWith("mcp__ide__") || ALLOWED_IDE_TOOLS.includes(tool.name); @@ -581192,13 +503758,13 @@ async function clearServerCache(name, serverRef) { fetchMcpSkillsForClient2.cache.delete(name); } } -async function ensureConnectedClient(client5) { - if (client5.config.type === "sdk") { - return client5; +async function ensureConnectedClient(client2) { + if (client2.config.type === "sdk") { + return client2; } - const connectedClient = await connectToServer(client5.name, client5.config); + const connectedClient = await connectToServer(client2.name, client2.config); if (connectedClient.type !== "connected") { - throw new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${client5.name}" is not connected`, "MCP server not connected"); + throw new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${client2.name}" is not connected`, "MCP server not connected"); } return connectedClient; } @@ -581209,40 +503775,40 @@ function areMcpConfigsEqual(a2, b) { const { scope: _scopeB, ...configB } = b; return jsonStringify(configA) === jsonStringify(configB); } -function mcpToolInputToAutoClassifierInput(input11, toolName) { - const keys3 = Object.keys(input11); - return keys3.length > 0 ? keys3.map((k) => `${k}=${String(input11[k])}`).join(" ") : toolName; +function mcpToolInputToAutoClassifierInput(input, toolName) { + const keys2 = Object.keys(input); + return keys2.length > 0 ? keys2.map((k) => `${k}=${String(input[k])}`).join(" ") : toolName; } -async function callIdeRpc(toolName, args, client5) { - const result3 = await callMCPTool({ - client: client5, +async function callIdeRpc(toolName, args, client2) { + const result2 = await callMCPTool({ + client: client2, tool: toolName, args, signal: createAbortController().signal }); - return result3.content; + return result2.content; } -async function reconnectMcpServerImpl(name, config5) { +async function reconnectMcpServerImpl(name, config3) { try { clearKeychainCache(); - await clearServerCache(name, config5); - const client5 = await connectToServer(name, config5); - if (client5.type !== "connected") { + await clearServerCache(name, config3); + const client2 = await connectToServer(name, config3); + if (client2.type !== "connected") { return { - client: client5, + client: client2, tools: [], commands: [] }; } - if (config5.type === "claudeai-proxy") { + if (config3.type === "claudeai-proxy") { markClaudeAiMcpConnected(name); } - const supportsResources = !!client5.capabilities?.resources; + const supportsResources = !!client2.capabilities?.resources; const [tools, mcpCommands, mcpSkills, resources] = await Promise.all([ - fetchToolsForClient(client5), - fetchCommandsForClient(client5), - feature("MCP_SKILLS") && supportsResources ? fetchMcpSkillsForClient2(client5) : Promise.resolve([]), - supportsResources ? fetchResourcesForClient(client5) : Promise.resolve([]) + fetchToolsForClient(client2), + fetchCommandsForClient(client2), + feature("MCP_SKILLS") && supportsResources ? fetchMcpSkillsForClient2(client2) : Promise.resolve([]), + supportsResources ? fetchResourcesForClient(client2) : Promise.resolve([]) ]); const commands = [...mcpCommands, ...mcpSkills]; const resourceTools = []; @@ -581253,15 +503819,15 @@ async function reconnectMcpServerImpl(name, config5) { } } return { - client: client5, + client: client2, tools: [...tools, ...resourceTools], commands, resources: resources.length > 0 ? resources : undefined }; - } catch (error46) { - logMCPError(name, `Error during reconnection: ${errorMessage(error46)}`); + } catch (error42) { + logMCPError(name, `Error during reconnection: ${errorMessage(error42)}`); return { - client: { name, type: "failed", config: config5 }, + client: { name, type: "failed", config: config3 }, tools: [], commands: [] }; @@ -581291,8 +503857,8 @@ async function getMcpToolsCommandsAndResources(onConnectionAttempt, mcpConfigs) const httpCount = count2(configEntries, ([_, c6]) => c6.type === "http"); const sseIdeCount = count2(configEntries, ([_, c6]) => c6.type === "sse-ide"); const wsIdeCount = count2(configEntries, ([_, c6]) => c6.type === "ws-ide"); - const localServers = configEntries.filter(([_, config5]) => isLocalMcpServer(config5)); - const remoteServers = configEntries.filter(([_, config5]) => !isLocalMcpServer(config5)); + const localServers = configEntries.filter(([_, config3]) => isLocalMcpServer(config3)); + const remoteServers = configEntries.filter(([_, config3]) => !isLocalMcpServer(config3)); const serverStats = { totalServers, stdioCount, @@ -581301,47 +503867,47 @@ async function getMcpToolsCommandsAndResources(onConnectionAttempt, mcpConfigs) sseIdeCount, wsIdeCount }; - const processServer = async ([name, config5]) => { + const processServer = async ([name, config3]) => { try { if (isMcpServerDisabled(name)) { onConnectionAttempt({ client: { name, type: "disabled", - config: config5 + config: config3 }, tools: [], commands: [] }); return; } - if ((config5.type === "claudeai-proxy" || config5.type === "http" || config5.type === "sse") && (await isMcpAuthCached(name) || (config5.type === "http" || config5.type === "sse") && hasMcpDiscoveryButNoToken(name, config5))) { + if ((config3.type === "claudeai-proxy" || config3.type === "http" || config3.type === "sse") && (await isMcpAuthCached(name) || (config3.type === "http" || config3.type === "sse") && hasMcpDiscoveryButNoToken(name, config3))) { logMCPDebug(name, `Skipping connection (cached needs-auth)`); onConnectionAttempt({ - client: { name, type: "needs-auth", config: config5 }, - tools: [createMcpAuthTool(name, config5)], + client: { name, type: "needs-auth", config: config3 }, + tools: [createMcpAuthTool(name, config3)], commands: [] }); return; } - const client5 = await connectToServer(name, config5, serverStats); - if (client5.type !== "connected") { + const client2 = await connectToServer(name, config3, serverStats); + if (client2.type !== "connected") { onConnectionAttempt({ - client: client5, - tools: client5.type === "needs-auth" ? [createMcpAuthTool(name, config5)] : [], + client: client2, + tools: client2.type === "needs-auth" ? [createMcpAuthTool(name, config3)] : [], commands: [] }); return; } - if (config5.type === "claudeai-proxy") { + if (config3.type === "claudeai-proxy") { markClaudeAiMcpConnected(name); } - const supportsResources = !!client5.capabilities?.resources; + const supportsResources = !!client2.capabilities?.resources; const [tools, mcpCommands, mcpSkills, resources] = await Promise.all([ - fetchToolsForClient(client5), - fetchCommandsForClient(client5), - feature("MCP_SKILLS") && supportsResources ? fetchMcpSkillsForClient2(client5) : Promise.resolve([]), - supportsResources ? fetchResourcesForClient(client5) : Promise.resolve([]) + fetchToolsForClient(client2), + fetchCommandsForClient(client2), + feature("MCP_SKILLS") && supportsResources ? fetchMcpSkillsForClient2(client2) : Promise.resolve([]), + supportsResources ? fetchResourcesForClient(client2) : Promise.resolve([]) ]); const commands = [...mcpCommands, ...mcpSkills]; const resourceTools = []; @@ -581350,15 +503916,15 @@ async function getMcpToolsCommandsAndResources(onConnectionAttempt, mcpConfigs) resourceTools.push(ListMcpResourcesTool, ReadMcpResourceTool); } onConnectionAttempt({ - client: client5, + client: client2, tools: [...tools, ...resourceTools], commands, resources: resources.length > 0 ? resources : undefined }); - } catch (error46) { - logMCPError(name, `Error fetching tools/commands/resources: ${errorMessage(error46)}`); + } catch (error42) { + logMCPError(name, `Error fetching tools/commands/resources: ${errorMessage(error42)}`); onConnectionAttempt({ - client: { name, type: "failed", config: config5 }, + client: { name, type: "failed", config: config3 }, tools: [], commands: [] }); @@ -581370,12 +503936,12 @@ async function getMcpToolsCommandsAndResources(onConnectionAttempt, mcpConfigs) ]); } function prefetchAllMcpResources(mcpConfigs) { - return new Promise((resolve41) => { + return new Promise((resolve35) => { let pendingCount = 0; let completedCount = 0; pendingCount = Object.keys(mcpConfigs).length; if (pendingCount === 0) { - resolve41({ + resolve35({ clients: [], tools: [], commands: [] @@ -581385,30 +503951,30 @@ function prefetchAllMcpResources(mcpConfigs) { const clients = []; const tools = []; const commands = []; - getMcpToolsCommandsAndResources((result3) => { - clients.push(result3.client); - tools.push(...result3.tools); - commands.push(...result3.commands); + getMcpToolsCommandsAndResources((result2) => { + clients.push(result2.client); + tools.push(...result2.tools); + commands.push(...result2.commands); completedCount++; if (completedCount >= pendingCount) { - const commandsMetadataLength = commands.reduce((sum3, command) => { + const commandsMetadataLength = commands.reduce((sum2, command) => { const commandMetadataLength = command.name.length + (command.description ?? "").length + (command.argumentHint ?? "").length; - return sum3 + commandMetadataLength; + return sum2 + commandMetadataLength; }, 0); logEvent("tengu_mcp_tools_commands_loaded", { tools_count: tools.length, commands_count: commands.length, commands_metadata_length: commandsMetadataLength }); - resolve41({ + resolve35({ clients, tools, commands }); } - }, mcpConfigs).catch((error46) => { - logMCPError("prefetchAllMcpResources", `Failed to get MCP resources: ${errorMessage(error46)}`); - resolve41({ + }, mcpConfigs).catch((error42) => { + logMCPError("prefetchAllMcpResources", `Failed to get MCP resources: ${errorMessage(error42)}`); + resolve35({ clients: [], tools: [], commands: [] @@ -581484,14 +504050,14 @@ async function transformResultContent(resultContent, serverName) { } case "resource_link": { const resourceLink = resultContent; - let text2 = `[Resource link: ${resourceLink.name}] ${resourceLink.uri}`; + let text = `[Resource link: ${resourceLink.name}] ${resourceLink.uri}`; if (resourceLink.description) { - text2 += ` (${resourceLink.description})`; + text += ` (${resourceLink.description})`; } return [ { type: "text", - text: text2 + text } ]; } @@ -581501,19 +504067,19 @@ async function transformResultContent(resultContent, serverName) { } async function persistBlobToTextBlock(bytes, mimeType, serverName, sourceDescription) { const persistId = `mcp-${normalizeNameForMCP(serverName)}-blob-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; - const result3 = await persistBinaryContent(bytes, mimeType, persistId); - if ("error" in result3) { + const result2 = await persistBinaryContent(bytes, mimeType, persistId); + if ("error" in result2) { return [ { type: "text", - text: `${sourceDescription}Binary content (${mimeType || "unknown type"}, ${bytes.length} bytes) could not be saved to disk: ${result3.error}` + text: `${sourceDescription}Binary content (${mimeType || "unknown type"}, ${bytes.length} bytes) could not be saved to disk: ${result2.error}` } ]; } return [ { type: "text", - text: getBinaryBlobSavedMessage(result3.filepath, mimeType, result3.size, sourceDescription) + text: getBinaryBlobSavedMessage(result2.filepath, mimeType, result2.size, sourceDescription) } ]; } @@ -581535,23 +504101,23 @@ function inferCompactSchema(value, depth = 2) { } return typeof value; } -async function transformMCPResult(result3, tool, name) { - if (result3 && typeof result3 === "object") { - if ("toolResult" in result3) { +async function transformMCPResult(result2, tool, name) { + if (result2 && typeof result2 === "object") { + if ("toolResult" in result2) { return { - content: String(result3.toolResult), + content: String(result2.toolResult), type: "toolResult" }; } - if ("structuredContent" in result3 && result3.structuredContent !== undefined) { + if ("structuredContent" in result2 && result2.structuredContent !== undefined) { return { - content: jsonStringify(result3.structuredContent), + content: jsonStringify(result2.structuredContent), type: "structuredContent", - schema: inferCompactSchema(result3.structuredContent) + schema: inferCompactSchema(result2.structuredContent) }; } - if ("content" in result3 && Array.isArray(result3.content)) { - const transformedContent = (await Promise.all(result3.content.map((item) => transformResultContent(item, name)))).flat(); + if ("content" in result2 && Array.isArray(result2.content)) { + const transformedContent = (await Promise.all(result2.content.map((item) => transformResultContent(item, name)))).flat(); return { content: transformedContent, type: "contentArray", @@ -581569,8 +504135,8 @@ function contentContainsImages(content) { } return content.some((block2) => block2.type === "image"); } -async function processMCPResult(result3, tool, name) { - const { content, type, schema } = await transformMCPResult(result3, tool, name); +async function processMCPResult(result2, tool, name) { + const { content, type, schema } = await transformMCPResult(result2, tool, name); if (name === "ide") { return content; } @@ -581632,7 +504198,7 @@ async function callMCPToolWithUrlElicitationRetry({ handleElicitation }) { const MAX_URL_ELICITATION_RETRIES = 3; - for (let attempt3 = 0;; attempt3++) { + for (let attempt2 = 0;; attempt2++) { try { return await callToolFn({ client: connectedClient, @@ -581642,14 +504208,14 @@ async function callMCPToolWithUrlElicitationRetry({ signal, onProgress }); - } catch (error46) { - if (!(error46 instanceof McpError) || error46.code !== ErrorCode.UrlElicitationRequired) { - throw error46; + } catch (error42) { + if (!(error42 instanceof McpError) || error42.code !== ErrorCode.UrlElicitationRequired) { + throw error42; } - if (attempt3 >= MAX_URL_ELICITATION_RETRIES) { - throw error46; + if (attempt2 >= MAX_URL_ELICITATION_RETRIES) { + throw error42; } - const errorData = error46.data; + const errorData = error42.data; const rawElicitations = errorData != null && typeof errorData === "object" && "elicitations" in errorData && Array.isArray(errorData.elicitations) ? errorData.elicitations : []; const elicitations = rawElicitations.filter((e) => { if (e == null || typeof e !== "object") @@ -581660,9 +504226,9 @@ async function callMCPToolWithUrlElicitationRetry({ const serverName = clientConnection.type === "connected" ? clientConnection.name : "unknown"; if (elicitations.length === 0) { logMCPDebug(serverName, `Tool '${tool}' returned -32042 but no valid elicitations in error data`); - throw error46; + throw error42; } - logMCPDebug(serverName, `Tool '${tool}' requires URL elicitation (error -32042, attempt ${attempt3 + 1}), processing ${elicitations.length} elicitation(s)`); + logMCPDebug(serverName, `Tool '${tool}' requires URL elicitation (error -32042, attempt ${attempt2 + 1}), processing ${elicitations.length} elicitation(s)`); for (const elicitation of elicitations) { const { elicitationId } = elicitation; const hookResponse = await runElicitationHooks(serverName, elicitation, signal); @@ -581683,9 +504249,9 @@ async function callMCPToolWithUrlElicitationRetry({ actionLabel: "Retry now", showCancel: true }; - userResult = await new Promise((resolve41) => { + userResult = await new Promise((resolve35) => { const onAbort = () => { - resolve41({ action: "cancel" }); + resolve35({ action: "cancel" }); }; if (signal.aborted) { onAbort(); @@ -581703,19 +504269,19 @@ async function callMCPToolWithUrlElicitationRetry({ params: elicitation, signal, waitingState, - respond: (result3) => { - if (result3.action === "accept") { + respond: (result2) => { + if (result2.action === "accept") { return; } signal.removeEventListener("abort", onAbort); - resolve41(result3); + resolve35(result2); }, onWaitingDismiss: (action2) => { signal.removeEventListener("abort", onAbort); if (action2 === "retry") { - resolve41({ action: "accept" }); + resolve35({ action: "accept" }); } else { - resolve41({ action: "cancel" }); + resolve35({ action: "cancel" }); } } } @@ -581737,7 +504303,7 @@ async function callMCPToolWithUrlElicitationRetry({ } } async function callMCPTool({ - client: { client: client5, name, config: config5 }, + client: { client: client2, name, config: config3 }, tool, args, meta, @@ -581756,13 +504322,13 @@ async function callMCPTool({ }, 30000, toolStartTime, name, tool); const timeoutMs = getMcpToolTimeoutMs(); let timeoutId; - const timeoutPromise = new Promise((_, reject3) => { - timeoutId = setTimeout((reject4, name2, tool2, timeoutMs2) => { - reject4(new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${name2}" tool "${tool2}" timed out after ${Math.floor(timeoutMs2 / 1000)}s`, "MCP tool timeout")); - }, timeoutMs, reject3, name, tool, timeoutMs); + const timeoutPromise = new Promise((_, reject2) => { + timeoutId = setTimeout((reject3, name2, tool2, timeoutMs2) => { + reject3(new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${name2}" tool "${tool2}" timed out after ${Math.floor(timeoutMs2 / 1000)}s`, "MCP tool timeout")); + }, timeoutMs, reject2, name, tool, timeoutMs); }); - const result3 = await Promise.race([ - client5.callTool({ + const result2 = await Promise.race([ + client2.callTool({ name: tool, arguments: args, _meta: meta @@ -581787,18 +504353,18 @@ async function callMCPTool({ clearTimeout(timeoutId); } }); - if ("isError" in result3 && result3.isError) { + if ("isError" in result2 && result2.isError) { let errorDetails = "Unknown error"; - if ("content" in result3 && Array.isArray(result3.content) && result3.content.length > 0) { - const firstContent = result3.content[0]; + if ("content" in result2 && Array.isArray(result2.content) && result2.content.length > 0) { + const firstContent = result2.content[0]; if (firstContent && typeof firstContent === "object" && "text" in firstContent) { errorDetails = firstContent.text; } - } else if ("error" in result3) { - errorDetails = String(result3.error); + } else if ("error" in result2) { + errorDetails = String(result2.error); } logMCPError(name, errorDetails); - throw new McpToolCallError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(errorDetails, "MCP tool returned error", "_meta" in result3 && result3._meta ? { _meta: result3._meta } : undefined); + throw new McpToolCallError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(errorDetails, "MCP tool returned error", "_meta" in result2 && result2._meta ? { _meta: result2._meta } : undefined); } const elapsed = Date.now() - toolStartTime; const duration5 = elapsed < 1000 ? `${elapsed}ms` : elapsed < 60000 ? `${Math.floor(elapsed / 1000)}s` : `${Math.floor(elapsed / 60000)}m ${Math.floor(elapsed % 60000 / 1000)}s`; @@ -581811,11 +504377,11 @@ async function callMCPTool({ success: true }); } - const content = await processMCPResult(result3, tool, name); + const content = await processMCPResult(result2, tool, name); return { content, - _meta: result3._meta, - structuredContent: result3.structuredContent + _meta: result2._meta, + structuredContent: result2.structuredContent }; } catch (e) { if (progressInterval !== undefined) { @@ -581833,11 +504399,11 @@ async function callMCPTool({ throw new McpAuthError(name, `MCP server "${name}" requires re-authorization (token expired)`); } const isSessionExpired = isMcpSessionExpiredError(e); - const isConnectionClosedOnHttp = "code" in e && e.code === -32000 && e.message.includes("Connection closed") && (config5.type === "http" || config5.type === "claudeai-proxy"); + const isConnectionClosedOnHttp = "code" in e && e.code === -32000 && e.message.includes("Connection closed") && (config3.type === "http" || config3.type === "claudeai-proxy"); if (isSessionExpired || isConnectionClosedOnHttp) { logMCPDebug(name, `MCP session expired during tool call (${isSessionExpired ? "404/-32001" : "connection closed"}), clearing connection cache for re-initialization`); logEvent("tengu_mcp_session_expired", {}); - await clearServerCache(name, config5); + await clearServerCache(name, config3); throw new McpSessionExpiredError(name); } } @@ -581860,9 +504426,9 @@ function extractToolUseId(message) { async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) { const clients = []; const tools = []; - const results = await Promise.allSettled(Object.entries(sdkMcpConfigs).map(async ([name, config5]) => { + const results = await Promise.allSettled(Object.entries(sdkMcpConfigs).map(async ([name, config3]) => { const transport = new SdkControlClientTransport(name, sendMcpMessage); - const client5 = new Client({ + const client2 = new Client({ name: "claude-code", title: "Claude Code", version: "2.1.88-custom", @@ -581872,16 +504438,16 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) { capabilities: {} }); try { - await client5.connect(transport); - const capabilities = client5.getServerCapabilities(); + await client2.connect(transport); + const capabilities = client2.getServerCapabilities(); const connectedClient = { type: "connected", name, capabilities: capabilities || {}, - client: client5, - config: { ...config5, scope: "dynamic" }, + client: client2, + config: { ...config3, scope: "dynamic" }, cleanup: async () => { - await client5.close(); + await client2.close(); } }; const serverTools = []; @@ -581893,30 +504459,30 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) { client: connectedClient, tools: serverTools }; - } catch (error46) { - logMCPError(name, `Failed to connect SDK MCP server: ${error46}`); + } catch (error42) { + logMCPError(name, `Failed to connect SDK MCP server: ${error42}`); return { client: { type: "failed", name, - config: { ...config5, scope: "user" } + config: { ...config3, scope: "user" } }, tools: [] }; } })); - for (const result3 of results) { - if (result3.status === "fulfilled") { - clients.push(result3.value.client); - tools.push(...result3.value.tools); + for (const result2 of results) { + if (result2.status === "fulfilled") { + clients.push(result2.value.client); + tools.push(...result2.value.tools); } } return { clients, tools }; } var fetchMcpSkillsForClient2, McpAuthError, McpSessionExpiredError, McpToolCallError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, DEFAULT_MCP_TOOL_TIMEOUT_MS = 1e8, MAX_MCP_DESCRIPTION_LENGTH = 2048, claudeInChromeToolRendering = () => (init_toolRendering(), __toCommonJS(exports_toolRendering)), computerUseWrapper, isComputerUseMCPServer2, MCP_AUTH_CACHE_TTL_MS, authCachePromise = null, writeChain, IMAGE_MIME_TYPES, MCP_REQUEST_TIMEOUT_MS = 60000, MCP_STREAMABLE_HTTP_ACCEPT = "application/json, text/event-stream", ALLOWED_IDE_TOOLS, connectToServer, MCP_FETCH_CACHE_SIZE = 20, fetchToolsForClient, fetchResourcesForClient, fetchCommandsForClient; -var init_client10 = __esm(() => { +var init_client6 = __esm(() => { init_bun_bundle(); - init_client9(); + init_client5(); init_sse(); init_stdio3(); init_streamableHttp(); @@ -581933,7 +504499,7 @@ var init_client10 = __esm(() => { init_McpAuthTool(); init_ReadMcpResourceTool(); init_abortController(); - init_auth2(); + init_auth(); init_cleanupRegistry(); init_codeIndexing(); init_debug(); @@ -581955,11 +504521,11 @@ var init_client10 = __esm(() => { init_analytics(); init_elicitationHandler(); init_mcpStringUtils(); - init_utils4(); - init_auth5(); + init_utils3(); + init_auth4(); init_classifyForCollapse(); init_macOsKeychainHelpers(); - init_auth7(); + init_auth6(); init_claudeai(); init_config3(); init_headersHelper(); @@ -582020,7 +504586,7 @@ var init_client10 = __esm(() => { } }; transportOptions.eventSourceInit = { - fetch: async (url3, init2) => { + fetch: async (url3, init) => { const authHeaders = {}; const tokens = await authProvider.tokens(); if (tokens) { @@ -582028,12 +504594,12 @@ var init_client10 = __esm(() => { } const proxyOptions = getProxyFetchOptions(); return fetch(url3, { - ...init2, + ...init, ...proxyOptions, headers: { "User-Agent": getMCPUserAgent(), ...authHeaders, - ...init2?.headers, + ...init?.headers, ...combinedHeaders, Accept: "text/event-stream" } @@ -582047,13 +504613,13 @@ var init_client10 = __esm(() => { const proxyOptions = getProxyFetchOptions(); const transportOptions = proxyOptions.dispatcher ? { eventSourceInit: { - fetch: async (url3, init2) => { + fetch: async (url3, init) => { return fetch(url3, { - ...init2, + ...init, ...proxyOptions, headers: { "User-Agent": getMCPUserAgent(), - ...init2?.headers + ...init?.headers } }); } @@ -582181,8 +504747,8 @@ var init_client10 = __esm(() => { transport = new StreamableHTTPClientTransport(new URL(proxyUrl), transportOptions); logMCPDebug(name, `claude.ai proxy transport created successfully`); } else if ((serverRef.type === "stdio" || !serverRef.type) && isClaudeInChromeMCPServer(name)) { - const { createChromeContext: createChromeContext2 } = await Promise.resolve().then(() => (init_mcpServer3(), exports_mcpServer)); - const { createClaudeForChromeMcpServer: createClaudeForChromeMcpServer2 } = await Promise.resolve().then(() => (init_src2(), exports_src)); + const { createChromeContext: createChromeContext2 } = await Promise.resolve().then(() => (init_mcpServer2(), exports_mcpServer)); + const { createClaudeForChromeMcpServer: createClaudeForChromeMcpServer2 } = await Promise.resolve().then(() => (init_claude_for_chrome_mcp(), exports_claude_for_chrome_mcp)); const { createLinkedTransportPair: createLinkedTransportPair2 } = await Promise.resolve().then(() => exports_InProcessTransport); const context = createChromeContext2(serverRef.env); inProcessServer = createClaudeForChromeMcpServer2(context); @@ -582191,7 +504757,7 @@ var init_client10 = __esm(() => { transport = clientTransport; logMCPDebug(name, `In-process Chrome MCP server started`); } else if (feature("CHICAGO_MCP") && (serverRef.type === "stdio" || !serverRef.type) && isComputerUseMCPServer2(name)) { - const { createComputerUseMcpServerForCli: createComputerUseMcpServerForCli2 } = await Promise.resolve().then(() => (init_mcpServer4(), exports_mcpServer2)); + const { createComputerUseMcpServerForCli: createComputerUseMcpServerForCli2 } = await Promise.resolve().then(() => (init_mcpServer3(), exports_mcpServer2)); const { createLinkedTransportPair: createLinkedTransportPair2 } = await Promise.resolve().then(() => exports_InProcessTransport); inProcessServer = await createComputerUseMcpServerForCli2(); const [clientTransport, serverTransport] = createLinkedTransportPair2(); @@ -582228,7 +504794,7 @@ var init_client10 = __esm(() => { stdioTransport.stderr.on("data", stderrHandler); } } - const client5 = new Client({ + const client2 = new Client({ name: "claude-code", title: "Claude Code", version: "2.1.88-custom", @@ -582243,7 +504809,7 @@ var init_client10 = __esm(() => { if (serverRef.type === "http") { logMCPDebug(name, `Client created, setting up request handler`); } - client5.setRequestHandler(ListRootsRequestSchema, async () => { + client2.setRequestHandler(ListRootsRequestSchema, async () => { logMCPDebug(name, `Received ListRoots request from server`); return { roots: [ @@ -582266,8 +504832,8 @@ var init_client10 = __esm(() => { logMCPDebug(name, `Failed to parse URL: ${urlError}`); } } - const connectPromise = client5.connect(transport); - const timeoutPromise = new Promise((_, reject3) => { + const connectPromise = client2.connect(transport); + const timeoutPromise = new Promise((_, reject2) => { const timeoutId = setTimeout(() => { const elapsed = Date.now() - connectStartTime; logMCPDebug(name, `Connection timeout triggered after ${elapsed}ms (limit: ${getConnectionTimeoutMs()}ms)`); @@ -582275,7 +504841,7 @@ var init_client10 = __esm(() => { inProcessServer.close().catch(() => {}); } transport.close().catch(() => {}); - reject3(new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${name}" connection timed out after ${getConnectionTimeoutMs()}ms`, "MCP connection timeout")); + reject2(new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${name}" connection timed out after ${getConnectionTimeoutMs()}ms`, "MCP connection timeout")); }, getConnectionTimeoutMs()); connectPromise.then(() => { clearTimeout(timeoutId); @@ -582291,30 +504857,30 @@ var init_client10 = __esm(() => { } const elapsed = Date.now() - connectStartTime; logMCPDebug(name, `Successfully connected (transport: ${serverRef.type || "stdio"}) in ${elapsed}ms`); - } catch (error46) { + } catch (error42) { const elapsed = Date.now() - connectStartTime; - if (serverRef.type === "sse" && error46 instanceof Error) { + if (serverRef.type === "sse" && error42 instanceof Error) { logMCPDebug(name, `SSE Connection failed after ${elapsed}ms: ${jsonStringify({ url: serverRef.url, - error: error46.message, - errorType: error46.constructor.name, - stack: error46.stack + error: error42.message, + errorType: error42.constructor.name, + stack: error42.stack })}`); - logMCPError(name, error46); - if (error46 instanceof UnauthorizedError) { + logMCPError(name, error42); + if (error42 instanceof UnauthorizedError) { return handleRemoteAuthFailure(name, serverRef, "sse"); } - } else if (serverRef.type === "http" && error46 instanceof Error) { - const errorObj = error46; - logMCPDebug(name, `HTTP Connection failed after ${elapsed}ms: ${error46.message} (code: ${errorObj.code || "none"}, errno: ${errorObj.errno || "none"})`); - logMCPError(name, error46); - if (error46 instanceof UnauthorizedError) { + } else if (serverRef.type === "http" && error42 instanceof Error) { + const errorObj = error42; + logMCPDebug(name, `HTTP Connection failed after ${elapsed}ms: ${error42.message} (code: ${errorObj.code || "none"}, errno: ${errorObj.errno || "none"})`); + logMCPError(name, error42); + if (error42 instanceof UnauthorizedError) { return handleRemoteAuthFailure(name, serverRef, "http"); } - } else if (serverRef.type === "claudeai-proxy" && error46 instanceof Error) { - logMCPDebug(name, `claude.ai proxy connection failed after ${elapsed}ms: ${error46.message}`); - logMCPError(name, error46); - const errorCode = error46.code; + } else if (serverRef.type === "claudeai-proxy" && error42 instanceof Error) { + logMCPDebug(name, `claude.ai proxy connection failed after ${elapsed}ms: ${error42.message}`); + logMCPError(name, error42); + const errorCode = error42.code; if (errorCode === 401) { return handleRemoteAuthFailure(name, serverRef, "claudeai-proxy"); } @@ -582330,11 +504896,11 @@ var init_client10 = __esm(() => { if (stderrOutput) { logMCPError(name, `Server stderr: ${stderrOutput}`); } - throw error46; + throw error42; } - const capabilities = client5.getServerCapabilities(); - const serverVersion = client5.getServerVersion(); - const rawInstructions = client5.getInstructions(); + const capabilities = client2.getServerCapabilities(); + const serverVersion = client2.getServerVersion(); + const rawInstructions = client2.getInstructions(); let instructions = rawInstructions; if (rawInstructions && rawInstructions.length > MAX_MCP_DESCRIPTION_LENGTH) { instructions = rawInstructions.slice(0, MAX_MCP_DESCRIPTION_LENGTH) + "… [truncated]"; @@ -582348,7 +504914,7 @@ var init_client10 = __esm(() => { serverVersion: serverVersion || "unknown" })}`); logForDebugging(`[MCP] Server "${name}" connected with subscribe=${!!capabilities?.resources?.subscribe}`); - client5.setRequestHandler(ElicitRequestSchema, async (request) => { + client2.setRequestHandler(ElicitRequestSchema, async (request) => { logMCPDebug(name, `Elicitation request received during initialization: ${jsonStringify(request)}`); return { action: "cancel" }; }); @@ -582359,15 +504925,15 @@ var init_client10 = __esm(() => { serverVersion }); try { - maybeNotifyIDEConnected(client5); - } catch (error46) { - logMCPError(name, `Failed to send ide_connected notification: ${error46}`); + maybeNotifyIDEConnected(client2); + } catch (error42) { + logMCPError(name, `Failed to send ide_connected notification: ${error42}`); } } const connectionStartTime = Date.now(); let hasErrorOccurred = false; - const originalOnerror = client5.onerror; - const originalOnclose = client5.onclose; + const originalOnerror = client2.onerror; + const originalOnclose = client2.onclose; let consecutiveConnectionErrors = 0; const MAX_ERRORS_BEFORE_RECONNECT = 3; let hasTriggeredClose = false; @@ -582376,54 +504942,54 @@ var init_client10 = __esm(() => { return; hasTriggeredClose = true; logMCPDebug(name, `Closing transport (${reason})`); - client5.close().catch((e) => { + client2.close().catch((e) => { logMCPDebug(name, `Error during close: ${errorMessage(e)}`); }); }; const isTerminalConnectionError = (msg) => { return msg.includes("ECONNRESET") || msg.includes("ETIMEDOUT") || msg.includes("EPIPE") || msg.includes("EHOSTUNREACH") || msg.includes("ECONNREFUSED") || msg.includes("Body Timeout Error") || msg.includes("terminated") || msg.includes("SSE stream disconnected") || msg.includes("Failed to reconnect SSE stream"); }; - client5.onerror = (error46) => { + client2.onerror = (error42) => { const uptime = Date.now() - connectionStartTime; hasErrorOccurred = true; const transportType = serverRef.type || "stdio"; logMCPDebug(name, `${transportType.toUpperCase()} connection dropped after ${Math.floor(uptime / 1000)}s uptime`); - if (error46.message) { - if (error46.message.includes("ECONNRESET")) { + if (error42.message) { + if (error42.message.includes("ECONNRESET")) { logMCPDebug(name, `Connection reset - server may have crashed or restarted`); - } else if (error46.message.includes("ETIMEDOUT")) { + } else if (error42.message.includes("ETIMEDOUT")) { logMCPDebug(name, `Connection timeout - network issue or server unresponsive`); - } else if (error46.message.includes("ECONNREFUSED")) { + } else if (error42.message.includes("ECONNREFUSED")) { logMCPDebug(name, `Connection refused - server may be down`); - } else if (error46.message.includes("EPIPE")) { + } else if (error42.message.includes("EPIPE")) { logMCPDebug(name, `Broken pipe - server closed connection unexpectedly`); - } else if (error46.message.includes("EHOSTUNREACH")) { + } else if (error42.message.includes("EHOSTUNREACH")) { logMCPDebug(name, `Host unreachable - network connectivity issue`); - } else if (error46.message.includes("ESRCH")) { + } else if (error42.message.includes("ESRCH")) { logMCPDebug(name, `Process not found - stdio server process terminated`); - } else if (error46.message.includes("spawn")) { + } else if (error42.message.includes("spawn")) { logMCPDebug(name, `Failed to spawn process - check command and permissions`); } else { - logMCPDebug(name, `Connection error: ${error46.message}`); + logMCPDebug(name, `Connection error: ${error42.message}`); } } - if ((transportType === "http" || transportType === "claudeai-proxy") && isMcpSessionExpiredError(error46)) { + if ((transportType === "http" || transportType === "claudeai-proxy") && isMcpSessionExpiredError(error42)) { logMCPDebug(name, `MCP session expired (server returned 404 with session-not-found), triggering reconnection`); closeTransportAndRejectPending("session expired"); if (originalOnerror) { - originalOnerror(error46); + originalOnerror(error42); } return; } if (transportType === "sse" || transportType === "http" || transportType === "claudeai-proxy") { - if (error46.message.includes("Maximum reconnection attempts")) { + if (error42.message.includes("Maximum reconnection attempts")) { closeTransportAndRejectPending("SSE reconnection exhausted"); if (originalOnerror) { - originalOnerror(error46); + originalOnerror(error42); } return; } - if (isTerminalConnectionError(error46.message)) { + if (isTerminalConnectionError(error42.message)) { consecutiveConnectionErrors++; logMCPDebug(name, `Terminal connection error ${consecutiveConnectionErrors}/${MAX_ERRORS_BEFORE_RECONNECT}`); if (consecutiveConnectionErrors >= MAX_ERRORS_BEFORE_RECONNECT) { @@ -582435,10 +505001,10 @@ var init_client10 = __esm(() => { } } if (originalOnerror) { - originalOnerror(error46); + originalOnerror(error42); } }; - client5.onclose = () => { + client2.onclose = () => { const uptime = Date.now() - connectionStartTime; const transportType = serverRef.type ?? "unknown"; logMCPDebug(name, `${transportType.toUpperCase()} connection closed after ${Math.floor(uptime / 1000)}s (${hasErrorOccurred ? "with errors" : "cleanly"})`); @@ -582459,13 +505025,13 @@ var init_client10 = __esm(() => { if (inProcessServer) { try { await inProcessServer.close(); - } catch (error46) { - logMCPDebug(name, `Error closing in-process server: ${error46}`); + } catch (error42) { + logMCPDebug(name, `Error closing in-process server: ${error42}`); } try { - await client5.close(); - } catch (error46) { - logMCPDebug(name, `Error closing client: ${error46}`); + await client2.close(); + } catch (error42) { + logMCPDebug(name, `Error closing client: ${error42}`); } return; } @@ -582481,11 +505047,11 @@ var init_client10 = __esm(() => { logMCPDebug(name, "Sending SIGINT to MCP server process"); try { process.kill(childPid, "SIGINT"); - } catch (error46) { - logMCPDebug(name, `Error sending SIGINT: ${error46}`); + } catch (error42) { + logMCPDebug(name, `Error sending SIGINT: ${error42}`); return; } - await new Promise(async (resolve41) => { + await new Promise(async (resolve35) => { let resolved = false; const checkInterval = setInterval(() => { try { @@ -582496,7 +505062,7 @@ var init_client10 = __esm(() => { clearInterval(checkInterval); clearTimeout(failsafeTimeout); logMCPDebug(name, "MCP server process exited cleanly"); - resolve41(); + resolve35(); } } }, 50); @@ -582505,11 +505071,11 @@ var init_client10 = __esm(() => { resolved = true; clearInterval(checkInterval); logMCPDebug(name, "Cleanup timeout reached, stopping process monitoring"); - resolve41(); + resolve35(); } }, 600); try { - await sleep4(100); + await sleep2(100); if (!resolved) { try { process.kill(childPid, 0); @@ -582521,17 +505087,17 @@ var init_client10 = __esm(() => { resolved = true; clearInterval(checkInterval); clearTimeout(failsafeTimeout); - resolve41(); + resolve35(); return; } } catch { resolved = true; clearInterval(checkInterval); clearTimeout(failsafeTimeout); - resolve41(); + resolve35(); return; } - await sleep4(400); + await sleep2(400); if (!resolved) { try { process.kill(childPid, 0); @@ -582545,7 +505111,7 @@ var init_client10 = __esm(() => { resolved = true; clearInterval(checkInterval); clearTimeout(failsafeTimeout); - resolve41(); + resolve35(); } } } @@ -582553,14 +505119,14 @@ var init_client10 = __esm(() => { resolved = true; clearInterval(checkInterval); clearTimeout(failsafeTimeout); - resolve41(); + resolve35(); } } catch { if (!resolved) { resolved = true; clearInterval(checkInterval); clearTimeout(failsafeTimeout); - resolve41(); + resolve35(); } } }); @@ -582570,9 +505136,9 @@ var init_client10 = __esm(() => { } } try { - await client5.close(); - } catch (error46) { - logMCPDebug(name, `Error closing client: ${error46}`); + await client2.close(); + } catch (error42) { + logMCPDebug(name, `Error closing client: ${error42}`); } }; const cleanupUnregister = registerCleanup(cleanup); @@ -582594,7 +505160,7 @@ var init_client10 = __esm(() => { }); return { name, - client: client5, + client: client2, type: "connected", capabilities: capabilities ?? {}, serverInfo: serverVersion, @@ -582602,7 +505168,7 @@ var init_client10 = __esm(() => { config: serverRef, cleanup: wrappedCleanup }; - } catch (error46) { + } catch (error42) { const connectionDurationMs = Date.now() - connectStartTime; logEvent("tengu_mcp_server_connection_failed", { connectionDurationMs, @@ -582615,8 +505181,8 @@ var init_client10 = __esm(() => { transportType: serverRef.type ?? "stdio", ...mcpBaseUrlAnalytics(serverRef) }); - logMCPDebug(name, `Connection failed after ${connectionDurationMs}ms: ${errorMessage(error46)}`); - logMCPError(name, `Connection failed: ${errorMessage(error46)}`); + logMCPDebug(name, `Connection failed after ${connectionDurationMs}ms: ${errorMessage(error42)}`); + logMCPError(name, `Connection failed: ${errorMessage(error42)}`); if (inProcessServer) { inProcessServer.close().catch(() => {}); } @@ -582624,26 +505190,26 @@ var init_client10 = __esm(() => { name, type: "failed", config: serverRef, - error: errorMessage(error46) + error: errorMessage(error42) }; } }, getServerCacheKey); - fetchToolsForClient = memoizeWithLRU(async (client5) => { - if (client5.type !== "connected") + fetchToolsForClient = memoizeWithLRU(async (client2) => { + if (client2.type !== "connected") return []; try { - if (!client5.capabilities?.tools) { + if (!client2.capabilities?.tools) { return []; } - const result3 = await client5.client.request({ method: "tools/list" }, ListToolsResultSchema); - const toolsToProcess = recursivelySanitizeUnicode(result3.tools); - const skipPrefix = client5.config.type === "sdk" && isEnvTruthy(process.env.CLAUDE_AGENT_SDK_MCP_NO_PREFIX); + const result2 = await client2.client.request({ method: "tools/list" }, ListToolsResultSchema); + const toolsToProcess = recursivelySanitizeUnicode(result2.tools); + const skipPrefix = client2.config.type === "sdk" && isEnvTruthy(process.env.CLAUDE_AGENT_SDK_MCP_NO_PREFIX); return toolsToProcess.map((tool) => { - const fullyQualifiedName = buildMcpToolName(client5.name, tool.name); + const fullyQualifiedName = buildMcpToolName(client2.name, tool.name); return { ...MCPTool, name: skipPrefix ? tool.name : fullyQualifiedName, - mcpInfo: { serverName: client5.name, toolName: tool.name }, + mcpInfo: { serverName: client2.name, toolName: tool.name }, isMcp: true, searchHint: typeof tool._meta?.["anthropic/searchHint"] === "string" ? tool._meta["anthropic/searchHint"].replace(/\s+/g, " ").trim() || undefined : undefined, alwaysLoad: tool._meta?.["anthropic/alwaysLoad"] === true, @@ -582660,8 +505226,8 @@ var init_client10 = __esm(() => { isReadOnly() { return tool.annotations?.readOnlyHint ?? false; }, - toAutoClassifierInput(input11) { - return mcpToolInputToAutoClassifierInput(input11, tool.name); + toAutoClassifierInput(input) { + return mcpToolInputToAutoClassifierInput(input, tool.name); }, isDestructive() { return tool.annotations?.destructiveHint ?? false; @@ -582670,7 +505236,7 @@ var init_client10 = __esm(() => { return tool.annotations?.openWorldHint ?? false; }, isSearchOrReadCommand() { - return classifyMcpToolForCollapse(client5.name, tool.name); + return classifyMcpToolForCollapse(client2.name, tool.name); }, inputJSONSchema: tool.inputSchema, async checkPermissions() { @@ -582701,19 +505267,19 @@ var init_client10 = __esm(() => { data: { type: "mcp_progress", status: "started", - serverName: client5.name, + serverName: client2.name, toolName: tool.name } }); } const startTime = Date.now(); const MAX_SESSION_RETRIES = 1; - for (let attempt3 = 0;; attempt3++) { + for (let attempt2 = 0;; attempt2++) { try { - const connectedClient = await ensureConnectedClient(client5); + const connectedClient = await ensureConnectedClient(client2); const mcpResult = await callMCPToolWithUrlElicitationRetry({ client: connectedClient, - clientConnection: client5, + clientConnection: client2, tool: tool.name, args, meta, @@ -582733,7 +505299,7 @@ var init_client10 = __esm(() => { data: { type: "mcp_progress", status: "completed", - serverName: client5.name, + serverName: client2.name, toolName: tool.name, elapsedTimeMs: Date.now() - startTime } @@ -582752,9 +505318,9 @@ var init_client10 = __esm(() => { } } }; - } catch (error46) { - if (error46 instanceof McpSessionExpiredError && attempt3 < MAX_SESSION_RETRIES) { - logMCPDebug(client5.name, `Retrying tool '${tool.name}' after session recovery`); + } catch (error42) { + if (error42 instanceof McpSessionExpiredError && attempt2 < MAX_SESSION_RETRIES) { + logMCPDebug(client2.name, `Retrying tool '${tool.name}' after session recovery`); continue; } if (onProgress && toolUseId) { @@ -582763,73 +505329,73 @@ var init_client10 = __esm(() => { data: { type: "mcp_progress", status: "failed", - serverName: client5.name, + serverName: client2.name, toolName: tool.name, elapsedTimeMs: Date.now() - startTime } }); } - if (error46 instanceof Error && !(error46 instanceof TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS)) { - const name = error46.constructor.name; + if (error42 instanceof Error && !(error42 instanceof TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS)) { + const name = error42.constructor.name; if (name === "Error") { - throw new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(error46.message, error46.message.slice(0, 200)); + throw new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(error42.message, error42.message.slice(0, 200)); } - if (name === "McpError" && "code" in error46 && typeof error46.code === "number") { - throw new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(error46.message, `McpError ${error46.code}`); + if (name === "McpError" && "code" in error42 && typeof error42.code === "number") { + throw new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(error42.message, `McpError ${error42.code}`); } } - throw error46; + throw error42; } } }, userFacingName() { const displayName = tool.annotations?.title || tool.name; - return `${client5.name} - ${displayName} (MCP)`; + return `${client2.name} - ${displayName} (MCP)`; }, - ...isClaudeInChromeMCPServer(client5.name) && (client5.config.type === "stdio" || !client5.config.type) ? claudeInChromeToolRendering().getClaudeInChromeMCPToolOverrides(tool.name) : {}, - ...feature("CHICAGO_MCP") && (client5.config.type === "stdio" || !client5.config.type) && isComputerUseMCPServer2(client5.name) ? computerUseWrapper().getComputerUseMCPToolOverrides(tool.name) : {} + ...isClaudeInChromeMCPServer(client2.name) && (client2.config.type === "stdio" || !client2.config.type) ? claudeInChromeToolRendering().getClaudeInChromeMCPToolOverrides(tool.name) : {}, + ...feature("CHICAGO_MCP") && (client2.config.type === "stdio" || !client2.config.type) && isComputerUseMCPServer2(client2.name) ? computerUseWrapper().getComputerUseMCPToolOverrides(tool.name) : {} }; }).filter(isIncludedMcpTool); - } catch (error46) { - logMCPError(client5.name, `Failed to fetch tools: ${errorMessage(error46)}`); + } catch (error42) { + logMCPError(client2.name, `Failed to fetch tools: ${errorMessage(error42)}`); return []; } - }, (client5) => client5.name, MCP_FETCH_CACHE_SIZE); - fetchResourcesForClient = memoizeWithLRU(async (client5) => { - if (client5.type !== "connected") + }, (client2) => client2.name, MCP_FETCH_CACHE_SIZE); + fetchResourcesForClient = memoizeWithLRU(async (client2) => { + if (client2.type !== "connected") return []; try { - if (!client5.capabilities?.resources) { + if (!client2.capabilities?.resources) { return []; } - const result3 = await client5.client.request({ method: "resources/list" }, ListResourcesResultSchema); - if (!result3.resources) + const result2 = await client2.client.request({ method: "resources/list" }, ListResourcesResultSchema); + if (!result2.resources) return []; - return result3.resources.map((resource) => ({ + return result2.resources.map((resource) => ({ ...resource, - server: client5.name + server: client2.name })); - } catch (error46) { - logMCPError(client5.name, `Failed to fetch resources: ${errorMessage(error46)}`); + } catch (error42) { + logMCPError(client2.name, `Failed to fetch resources: ${errorMessage(error42)}`); return []; } - }, (client5) => client5.name, MCP_FETCH_CACHE_SIZE); - fetchCommandsForClient = memoizeWithLRU(async (client5) => { - if (client5.type !== "connected") + }, (client2) => client2.name, MCP_FETCH_CACHE_SIZE); + fetchCommandsForClient = memoizeWithLRU(async (client2) => { + if (client2.type !== "connected") return []; try { - if (!client5.capabilities?.prompts) { + if (!client2.capabilities?.prompts) { return []; } - const result3 = await client5.client.request({ method: "prompts/list" }, ListPromptsResultSchema); - if (!result3.prompts) + const result2 = await client2.client.request({ method: "prompts/list" }, ListPromptsResultSchema); + if (!result2.prompts) return []; - const promptsToProcess = recursivelySanitizeUnicode(result3.prompts); + const promptsToProcess = recursivelySanitizeUnicode(result2.prompts); return promptsToProcess.map((prompt) => { const argNames = Object.values(prompt.arguments ?? {}).map((k) => k.name); return { type: "prompt", - name: "mcp__" + normalizeNameForMCP(client5.name) + "__" + prompt.name, + name: "mcp__" + normalizeNameForMCP(client2.name) + "__" + prompt.name, description: prompt.description ?? "", hasUserSpecifiedDescription: !!prompt.description, contentLength: 0, @@ -582838,36 +505404,36 @@ var init_client10 = __esm(() => { isMcp: true, progressMessage: "running", userFacingName() { - return `${client5.name}:${prompt.name} (MCP)`; + return `${client2.name}:${prompt.name} (MCP)`; }, argNames, source: "mcp", async getPromptForCommand(args) { const argsArray = args.split(" "); try { - const connectedClient = await ensureConnectedClient(client5); - const result4 = await connectedClient.client.getPrompt({ + const connectedClient = await ensureConnectedClient(client2); + const result3 = await connectedClient.client.getPrompt({ name: prompt.name, arguments: zipObject_default(argNames, argsArray) }); - const transformed = await Promise.all(result4.messages.map((message) => transformResultContent(message.content, connectedClient.name))); + const transformed = await Promise.all(result3.messages.map((message) => transformResultContent(message.content, connectedClient.name))); return transformed.flat(); - } catch (error46) { - logMCPError(client5.name, `Error running command '${prompt.name}': ${errorMessage(error46)}`); - throw error46; + } catch (error42) { + logMCPError(client2.name, `Error running command '${prompt.name}': ${errorMessage(error42)}`); + throw error42; } } }; }); - } catch (error46) { - logMCPError(client5.name, `Failed to fetch commands: ${errorMessage(error46)}`); + } catch (error42) { + logMCPError(client2.name, `Failed to fetch commands: ${errorMessage(error42)}`); return []; } - }, (client5) => client5.name, MCP_FETCH_CACHE_SIZE); + }, (client2) => client2.name, MCP_FETCH_CACHE_SIZE); }); // src/utils/api.ts -import { createHash as createHash23 } from "crypto"; +import { createHash as createHash22 } from "crypto"; function filterSwarmFieldsFromSchema(toolName, schema) { const fieldsToRemove = SWARM_FIELDS_BY_TOOL[toolName]; if (!fieldsToRemove || fieldsToRemove.length === 0) { @@ -582957,7 +505523,7 @@ function logAPIPrefix(systemPrompt) { logEvent("tengu_sysprompt_block", { snippet: firstSystemPrompt?.slice(0, 20), length: firstSystemPrompt?.length ?? 0, - hash: firstSystemPrompt ? createHash23("sha256").update(firstSystemPrompt).digest("hex") : "" + hash: firstSystemPrompt ? createHash22("sha256").update(firstSystemPrompt).digest("hex") : "" }); } function splitSysPromptPrefix(systemPrompt, options2) { @@ -582968,7 +505534,7 @@ function splitSysPromptPrefix(systemPrompt, options2) { }); let attributionHeader2; let systemPromptPrefix2; - const rest4 = []; + const rest3 = []; for (const prompt of systemPrompt) { if (!prompt) continue; @@ -582979,23 +505545,23 @@ function splitSysPromptPrefix(systemPrompt, options2) { } else if (CLI_SYSPROMPT_PREFIXES.has(prompt)) { systemPromptPrefix2 = prompt; } else { - rest4.push(prompt); + rest3.push(prompt); } } - const result4 = []; + const result3 = []; if (attributionHeader2) { - result4.push({ text: attributionHeader2, cacheScope: null }); + result3.push({ text: attributionHeader2, cacheScope: null }); } if (systemPromptPrefix2) { - result4.push({ text: systemPromptPrefix2, cacheScope: "org" }); + result3.push({ text: systemPromptPrefix2, cacheScope: "org" }); } - const restJoined2 = rest4.join(` + const restJoined2 = rest3.join(` `); if (restJoined2) { - result4.push({ text: restJoined2, cacheScope: "org" }); + result3.push({ text: restJoined2, cacheScope: "org" }); } - return result4; + return result3; } if (useGlobalCacheFeature) { const boundaryIndex = systemPrompt.findIndex((s) => s === SYSTEM_PROMPT_DYNAMIC_BOUNDARY); @@ -583004,41 +505570,41 @@ function splitSysPromptPrefix(systemPrompt, options2) { let systemPromptPrefix2; const staticBlocks = []; const dynamicBlocks = []; - for (let i4 = 0;i4 < systemPrompt.length; i4++) { - const block2 = systemPrompt[i4]; + for (let i3 = 0;i3 < systemPrompt.length; i3++) { + const block2 = systemPrompt[i3]; if (!block2 || block2 === SYSTEM_PROMPT_DYNAMIC_BOUNDARY) continue; if (block2.startsWith("x-anthropic-billing-header")) { attributionHeader2 = block2; } else if (CLI_SYSPROMPT_PREFIXES.has(block2)) { systemPromptPrefix2 = block2; - } else if (i4 < boundaryIndex) { + } else if (i3 < boundaryIndex) { staticBlocks.push(block2); } else { dynamicBlocks.push(block2); } } - const result4 = []; + const result3 = []; if (attributionHeader2) - result4.push({ text: attributionHeader2, cacheScope: null }); + result3.push({ text: attributionHeader2, cacheScope: null }); if (systemPromptPrefix2) - result4.push({ text: systemPromptPrefix2, cacheScope: null }); + result3.push({ text: systemPromptPrefix2, cacheScope: null }); const staticJoined = staticBlocks.join(` `); if (staticJoined) - result4.push({ text: staticJoined, cacheScope: "global" }); + result3.push({ text: staticJoined, cacheScope: "global" }); const dynamicJoined = dynamicBlocks.join(` `); if (dynamicJoined) - result4.push({ text: dynamicJoined, cacheScope: null }); + result3.push({ text: dynamicJoined, cacheScope: null }); logEvent("tengu_sysprompt_boundary_found", { - blockCount: result4.length, + blockCount: result3.length, staticBlockLength: staticJoined.length, dynamicBlockLength: dynamicJoined.length }); - return result4; + return result3; } else { logEvent("tengu_sysprompt_missing_boundary_marker", { promptBlockCount: systemPrompt.length @@ -583047,7 +505613,7 @@ function splitSysPromptPrefix(systemPrompt, options2) { } let attributionHeader; let systemPromptPrefix; - const rest3 = []; + const rest2 = []; for (const block2 of systemPrompt) { if (!block2) continue; @@ -583056,20 +505622,20 @@ function splitSysPromptPrefix(systemPrompt, options2) { } else if (CLI_SYSPROMPT_PREFIXES.has(block2)) { systemPromptPrefix = block2; } else { - rest3.push(block2); + rest2.push(block2); } } - const result3 = []; + const result2 = []; if (attributionHeader) - result3.push({ text: attributionHeader, cacheScope: null }); + result2.push({ text: attributionHeader, cacheScope: null }); if (systemPromptPrefix) - result3.push({ text: systemPromptPrefix, cacheScope: "org" }); - const restJoined = rest3.join(` + result2.push({ text: systemPromptPrefix, cacheScope: "org" }); + const restJoined = rest2.join(` `); if (restJoined) - result3.push({ text: restJoined, cacheScope: "org" }); - return result3; + result2.push({ text: restJoined, cacheScope: "org" }); + return result2; } function appendSystemContext(systemPrompt, context) { return [ @@ -583152,16 +505718,16 @@ async function logContextMetrics(mcpConfigs, toolPermissionContext) { non_mcp_tools_tokens: nonMcpToolsTokens }); } -function normalizeToolInput(tool, input11, agentId) { +function normalizeToolInput(tool, input, agentId) { switch (tool.name) { case EXIT_PLAN_MODE_V2_TOOL_NAME: { const plan = getPlan(agentId); const planFilePath = getPlanFilePath(agentId); persistFileSnapshotIfRemote(); - return plan !== null ? { ...input11, plan, planFilePath } : input11; + return plan !== null ? { ...input, plan, planFilePath } : input; } case BashTool.name: { - const parsed = BashTool.inputSchema.parse(input11); + const parsed = BashTool.inputSchema.parse(input); const { command, timeout, description } = parsed; const cwd2 = getCwd(); let normalizedCommand = command.replace(`cd ${cwd2} && `, ""); @@ -583185,7 +505751,7 @@ function normalizeToolInput(tool, input11, agentId) { }; } case FileEditTool.name: { - const parsedInput = FileEditTool.inputSchema.parse(input11); + const parsedInput = FileEditTool.inputSchema.parse(input); const { file_path, edits } = normalizeFileEditInput({ file_path: parsedInput.file_path, edits: [ @@ -583204,7 +505770,7 @@ function normalizeToolInput(tool, input11, agentId) { }; } case FileWriteTool.name: { - const parsedInput = FileWriteTool.inputSchema.parse(input11); + const parsedInput = FileWriteTool.inputSchema.parse(input); const isMarkdown = /\.(md|mdx)$/i.test(parsedInput.file_path); return { file_path: parsedInput.file_path, @@ -583212,7 +505778,7 @@ function normalizeToolInput(tool, input11, agentId) { }; } case TASK_OUTPUT_TOOL_NAME: { - const legacyInput = input11; + const legacyInput = input; const taskId = legacyInput.task_id ?? legacyInput.agentId ?? legacyInput.bash_id; const timeout = legacyInput.timeout ?? (typeof legacyInput.wait_up_to === "number" ? legacyInput.wait_up_to * 1000 : undefined); return { @@ -583222,40 +505788,40 @@ function normalizeToolInput(tool, input11, agentId) { }; } default: - return input11; + return input; } } -function normalizeToolInputForAPI(tool, input11) { +function normalizeToolInputForAPI(tool, input) { switch (tool.name) { case EXIT_PLAN_MODE_V2_TOOL_NAME: { - if (input11 && typeof input11 === "object" && (("plan" in input11) || ("planFilePath" in input11))) { - const { plan, planFilePath, ...rest3 } = input11; - return rest3; + if (input && typeof input === "object" && (("plan" in input) || ("planFilePath" in input))) { + const { plan, planFilePath, ...rest2 } = input; + return rest2; } - return input11; + return input; } case FileEditTool.name: { - if (input11 && typeof input11 === "object" && "edits" in input11) { - const { old_string, new_string, replace_all, ...rest3 } = input11; - return rest3; + if (input && typeof input === "object" && "edits" in input) { + const { old_string, new_string, replace_all, ...rest2 } = input; + return rest2; } - return input11; + return input; } default: - return input11; + return input; } } var SWARM_FIELDS_BY_TOOL, loggedStrip = false; var init_api4 = __esm(() => { - init_prompts5(); + init_prompts4(); init_context2(); init_config(); init_growthbook(); init_analytics(); - init_client10(); + init_client6(); init_BashTool(); init_FileEditTool(); - init_utils9(); + init_utils8(); init_FileWriteTool(); init_tools2(); init_system(); @@ -583266,7 +505832,7 @@ var init_api4 = __esm(() => { init_cwd2(); init_debug(); init_envUtils(); - init_messages5(); + init_messages3(); init_providers(); init_filesystem(); init_plans(); @@ -583366,10 +505932,10 @@ var init_apiMicrocompact = __esm(() => { // src/utils/contentArray.ts function insertBlockAfterToolResults(content, block2) { let lastToolResultIndex = -1; - for (let i4 = 0;i4 < content.length; i4++) { - const item = content[i4]; + for (let i3 = 0;i3 < content.length; i3++) { + const item = content[i3]; if (item && typeof item === "object" && "type" in item && item.type === "tool_result") { - lastToolResultIndex = i4; + lastToolResultIndex = i3; } } if (lastToolResultIndex >= 0) { @@ -583388,32 +505954,32 @@ function insertBlockAfterToolResults(content, block2) { import { randomUUID as randomUUID28 } from "crypto"; function getExtraBodyParams(betaHeaders) { const extraBodyStr = process.env.CLAUDE_CODE_EXTRA_BODY; - let result3 = {}; + let result2 = {}; if (extraBodyStr) { try { const parsed = safeParseJSON(extraBodyStr); if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) { - result3 = { ...parsed }; + result2 = { ...parsed }; } else { logForDebugging(`CLAUDE_CODE_EXTRA_BODY env var must be a JSON object, but was given ${extraBodyStr}`, { level: "error" }); } - } catch (error46) { - logForDebugging(`Error parsing CLAUDE_CODE_EXTRA_BODY: ${errorMessage(error46)}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Error parsing CLAUDE_CODE_EXTRA_BODY: ${errorMessage(error42)}`, { level: "error" }); } } if (feature("ANTI_DISTILLATION_CC") ? process.env.CLAUDE_CODE_ENTRYPOINT === "cli" && shouldIncludeFirstPartyOnlyBetas() && getFeatureValue_CACHED_MAY_BE_STALE("tengu_anti_distill_fake_tool_injection", false) : false) { - result3.anti_distillation = ["fake_tools"]; + result2.anti_distillation = ["fake_tools"]; } if (betaHeaders && betaHeaders.length > 0) { - if (result3.anthropic_beta && Array.isArray(result3.anthropic_beta)) { - const existingHeaders = result3.anthropic_beta; + if (result2.anthropic_beta && Array.isArray(result2.anthropic_beta)) { + const existingHeaders = result2.anthropic_beta; const newHeaders = betaHeaders.filter((header) => !existingHeaders.includes(header)); - result3.anthropic_beta = [...existingHeaders, ...newHeaders]; + result2.anthropic_beta = [...existingHeaders, ...newHeaders]; } else { - result3.anthropic_beta = betaHeaders; + result2.anthropic_beta = betaHeaders; } } - return result3; + return result2; } function getPromptCachingEnabled(model) { if (isEnvTruthy(process.env.DISABLE_PROMPT_CACHING)) @@ -583458,8 +506024,8 @@ function should1hCacheTTL(querySource) { return false; let allowlist = getPromptCache1hAllowlist(); if (allowlist === null) { - const config5 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_prompt_cache_1h_config", {}); - allowlist = config5.allowlist ?? []; + const config3 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_prompt_cache_1h_config", {}); + allowlist = config3.allowlist ?? []; setPromptCache1hAllowlist(allowlist); } return querySource !== undefined && allowlist.some((pattern) => pattern.endsWith("*") ? querySource.startsWith(pattern.slice(0, -1)) : querySource === pattern); @@ -583542,15 +506108,15 @@ async function verifyApiKey(apiKey, isNonInteractiveSession) { return true; }, { maxRetries: 2, model, thinkingConfig: { type: "disabled" } })); } catch (errorFromRetry) { - let error46 = errorFromRetry; + let error42 = errorFromRetry; if (errorFromRetry instanceof CannotRetryError) { - error46 = errorFromRetry.originalError; + error42 = errorFromRetry.originalError; } - logError2(error46); - if (error46 instanceof Error && error46.message.includes('{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}')) { + logError2(error42); + if (error42 instanceof Error && error42.message.includes('{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}')) { return false; } - throw error46; + throw error42; } } function userMessageToMessageParam(message, addCache = false, enablePromptCaching, querySource) { @@ -583571,9 +506137,9 @@ function userMessageToMessageParam(message, addCache = false, enablePromptCachin } else { return { role: "user", - content: message.message.content.map((_, i4) => ({ + content: message.message.content.map((_, i3) => ({ ..._, - ...i4 === message.message.content.length - 1 ? enablePromptCaching ? { cache_control: getCacheControl({ querySource }) } : {} : {} + ...i3 === message.message.content.length - 1 ? enablePromptCaching ? { cache_control: getCacheControl({ querySource }) } : {} : {} })) }; } @@ -583601,9 +506167,9 @@ function assistantMessageToMessageParam(message, addCache = false, enablePromptC } else { return { role: "assistant", - content: message.message.content.map((_, i4) => ({ + content: message.message.content.map((_, i3) => ({ ..._, - ...i4 === message.message.content.length - 1 && _.type !== "thinking" && _.type !== "redacted_thinking" && (feature("CONNECTOR_TEXT") ? !isConnectorTextBlock(_) : true) ? enablePromptCaching ? { cache_control: getCacheControl({ querySource }) } : {} : {} + ...i3 === message.message.content.length - 1 && _.type !== "thinking" && _.type !== "redacted_thinking" && (feature("CONNECTOR_TEXT") ? !isConnectorTextBlock(_) : true) ? enablePromptCaching ? { cache_control: getCacheControl({ querySource }) } : {} : {} })) }; } @@ -583669,11 +506235,11 @@ async function* executeNonStreamingRequest(clientOptions, retryOptions, paramsFr model: clientOptions.model, fetchOverride: clientOptions.fetchOverride, source: clientOptions.source - }), async (anthropic, attempt3, context) => { + }), async (anthropic, attempt2, context) => { const start = Date.now(); const retryParams = paramsFromContext(context); captureRequest(retryParams); - onAttempt(attempt3, start, retryParams.max_tokens); + onAttempt(attempt2, start, retryParams.max_tokens); const adjustedParams = adjustParamsForNonStreaming(retryParams, MAX_NON_STREAMING_TOKENS); try { return await anthropic.beta.messages.create({ @@ -583683,18 +506249,18 @@ async function* executeNonStreamingRequest(clientOptions, retryOptions, paramsFr signal: retryOptions.signal, timeout: fallbackTimeoutMs }); - } catch (err3) { - if (err3 instanceof APIUserAbortError) - throw err3; + } catch (err2) { + if (err2 instanceof APIUserAbortError) + throw err2; logForDiagnosticsNoPII("error", "cli_nonstreaming_fallback_error"); logEvent("tengu_nonstreaming_fallback_error", { model: clientOptions.model, - error: err3 instanceof Error ? err3.name : "unknown", - attempt: attempt3, + error: err2 instanceof Error ? err2.name : "unknown", + attempt: attempt2, timeout_ms: fallbackTimeoutMs, request_id: originatingRequestId ?? "unknown" }); - throw err3; + throw err2; } }, { model: retryOptions.model, @@ -583715,8 +506281,8 @@ async function* executeNonStreamingRequest(clientOptions, retryOptions, paramsFr return e.value; } function getPreviousRequestIdFromMessages(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const msg = messages[i3]; if (msg.type === "assistant" && msg.requestId) { return msg.requestId; } @@ -583754,7 +506320,7 @@ function stripExcessMediaItems(messages, limit) { const content = msg.message.content; if (!Array.isArray(content)) return msg; - const before3 = toRemove; + const before2 = toRemove; const stripped = content.map((block2) => { if (toRemove <= 0 || !isToolResult(block2) || !Array.isArray(block2.content)) return block2; @@ -583773,7 +506339,7 @@ function stripExcessMediaItems(messages, limit) { } return true; }); - return before3 === toRemove ? msg : { + return before2 === toRemove ? msg : { ...msg, message: { ...msg.message, content: stripped } }; @@ -583860,8 +506426,8 @@ async function* queryModel(messages, systemPrompt, thinkingConfig, tools, signal const featureEnabled = isCachedMicrocompactEnabled(); const modelSupported = isModelSupportedForCacheEditing(options2.model); cachedMCEnabled = featureEnabled && modelSupported; - const config5 = getCachedMCConfig(); - logForDebugging(`Cached MC gate: enabled=${featureEnabled} modelSupported=${modelSupported} model=${options2.model} supportedModels=${jsonStringify(config5.supportedModels)}`); + const config3 = getCachedMCConfig(); + logForDebugging(`Cached MC gate: enabled=${featureEnabled} modelSupported=${modelSupported} model=${options2.model} supportedModels=${jsonStringify(config3.supportedModels)}`); } const useGlobalCacheFeature = shouldUseGlobalCacheScope(); const willDefer = (t) => useToolSearch && (deferredToolNames.has(t.name) || shouldDeferLspTool(t)); @@ -584192,8 +506758,8 @@ ${deferredToolList} model: options2.model, fetchOverride: options2.fetchOverride, source: options2.querySource - }), async (anthropic, attempt3, context) => { - attemptNumber = attempt3; + }), async (anthropic, attempt2, context) => { + attemptNumber = attempt2; isFastModeRequest = context.fastMode ?? false; start = Date.now(); attemptStartTimes.push(start); @@ -584206,16 +506772,16 @@ ${deferredToolList} headlessProfilerCheckpoint("api_request_sent"); } clientRequestId = getAPIProvider() === "firstParty" && isFirstPartyAnthropicBaseUrl() ? randomUUID28() : undefined; - const result3 = await anthropic.beta.messages.create({ ...params, stream: true }, { + const result2 = await anthropic.beta.messages.create({ ...params, stream: true }, { signal, ...clientRequestId && { headers: { [CLIENT_REQUEST_ID_HEADER]: clientRequestId } } }).withResponse(); queryCheckpoint("query_response_headers_received"); - streamRequestId = result3.request_id; - streamResponse = result3.response; - return result3.data; + streamRequestId = result2.request_id; + streamResponse = result2.response; + return result2.data; }, { model: options2.model, fallbackModel: options2.fallbackModel, @@ -584256,9 +506822,9 @@ ${deferredToolList} let stallCount = 0; for await (const part of stream4) { resetStreamIdleTimer(); - const now3 = Date.now(); + const now2 = Date.now(); if (lastEventTime !== null) { - const timeSinceLastEvent = now3 - lastEventTime; + const timeSinceLastEvent = now2 - lastEventTime; if (timeSinceLastEvent > STALL_THRESHOLD_MS2) { stallCount++; totalStallTime += timeSinceLastEvent; @@ -584273,7 +506839,7 @@ ${deferredToolList} }); } } - lastEventTime = now3; + lastEventTime = now2; if (isFirstChunk) { logForDebugging("Stream started - received first chunk"); queryCheckpoint("query_first_chunk_received"); @@ -584611,7 +507177,7 @@ ${deferredToolList} model: options2.model, fallback_cause: streamIdleAborted ? "watchdog" : "other" }); - const result3 = yield* executeNonStreamingRequest({ model: options2.model, source: options2.querySource }, { + const result2 = yield* executeNonStreamingRequest({ model: options2.model, source: options2.querySource }, { model: options2.model, fallbackModel: options2.fallbackModel, thinkingConfig, @@ -584619,14 +507185,14 @@ ${deferredToolList} signal, initialConsecutive529Errors: is529Error(streamingError) ? 1 : 0, querySource: options2.querySource - }, paramsFromContext, (attempt3, _startTime, tokens) => { - attemptNumber = attempt3; + }, paramsFromContext, (attempt2, _startTime, tokens) => { + attemptNumber = attempt2; maxOutputTokens = tokens; }, (params) => captureAPIRequest(params, options2.querySource), streamRequestId); const m = { message: { - ...result3, - content: normalizeContentFromAPI(result3.content, tools, options2.agentId) + ...result2, + content: normalizeContentFromAPI(result2.content, tools, options2.agentId) }, requestId: streamRequestId ?? undefined, type: "assistant", @@ -584667,20 +507233,20 @@ ${deferredToolList} fallback_cause: "404_stream_creation" }); try { - const result3 = yield* executeNonStreamingRequest({ model: options2.model, source: options2.querySource }, { + const result2 = yield* executeNonStreamingRequest({ model: options2.model, source: options2.querySource }, { model: options2.model, fallbackModel: options2.fallbackModel, thinkingConfig, ...isFastModeEnabled() && { fastMode: isFastMode }, signal - }, paramsFromContext, (attempt3, _startTime, tokens) => { - attemptNumber = attempt3; + }, paramsFromContext, (attempt2, _startTime, tokens) => { + attemptNumber = attempt2; maxOutputTokens = tokens; }, (params) => captureAPIRequest(params, options2.querySource), failedRequestId); const m = { message: { - ...result3, - content: normalizeContentFromAPI(result3.content, tools, options2.agentId) + ...result2, + content: normalizeContentFromAPI(result2.content, tools, options2.agentId) }, requestId: streamRequestId ?? undefined, type: "assistant", @@ -584697,18 +507263,18 @@ ${deferredToolList} throw fallbackError; } logForDebugging(`Non-streaming fallback also failed: ${errorMessage(fallbackError)}`, { level: "error" }); - let error46 = fallbackError; + let error42 = fallbackError; let errorModel = options2.model; if (fallbackError instanceof CannotRetryError) { - error46 = fallbackError.originalError; + error42 = fallbackError.originalError; errorModel = fallbackError.retryContext.model; } - if (error46 instanceof APIError) { - extractQuotaStatusFromError(error46); + if (error42 instanceof APIError) { + extractQuotaStatusFromError(error42); } - const requestId = streamRequestId || (error46 instanceof APIError ? error46.requestID : undefined) || (error46 instanceof APIError ? error46.error?.request_id : undefined); + const requestId = streamRequestId || (error42 instanceof APIError ? error42.requestID : undefined) || (error42 instanceof APIError ? error42.error?.request_id : undefined); logAPIError({ - error: error46, + error: error42, model: errorModel, messageCount: messagesForAPI.length, messageTokens: tokenCountFromLastAPIResponse(messagesForAPI), @@ -584724,11 +507290,11 @@ ${deferredToolList} fastMode: isFastModeRequest, previousRequestId }); - if (error46 instanceof APIUserAbortError) { + if (error42 instanceof APIUserAbortError) { releaseStreamResources(); return; } - yield getAssistantMessageFromError(error46, errorModel, { + yield getAssistantMessageFromError(error42, errorModel, { messages, messagesForAPI }); @@ -584739,18 +507305,18 @@ ${deferredToolList} logForDebugging(`Error in API request: ${errorMessage(errorFromRetry)}`, { level: "error" }); - let error46 = errorFromRetry; + let error42 = errorFromRetry; let errorModel = options2.model; if (errorFromRetry instanceof CannotRetryError) { - error46 = errorFromRetry.originalError; + error42 = errorFromRetry.originalError; errorModel = errorFromRetry.retryContext.model; } - if (error46 instanceof APIError) { - extractQuotaStatusFromError(error46); + if (error42 instanceof APIError) { + extractQuotaStatusFromError(error42); } - const requestId = streamRequestId || (error46 instanceof APIError ? error46.requestID : undefined) || (error46 instanceof APIError ? error46.error?.request_id : undefined); + const requestId = streamRequestId || (error42 instanceof APIError ? error42.requestID : undefined) || (error42 instanceof APIError ? error42.error?.request_id : undefined); logAPIError({ - error: error46, + error: error42, model: errorModel, messageCount: messagesForAPI.length, messageTokens: tokenCountFromLastAPIResponse(messagesForAPI), @@ -584766,11 +507332,11 @@ ${deferredToolList} fastMode: isFastModeRequest, previousRequestId }); - if (error46 instanceof APIUserAbortError) { + if (error42 instanceof APIUserAbortError) { releaseStreamResources(); return; } - yield getAssistantMessageFromError(error46, errorModel, { + yield getAssistantMessageFromError(error42, errorModel, { messages, messagesForAPI }); @@ -584896,7 +507462,7 @@ function addCacheBreakpoints(messages, enablePromptCaching, querySource, useCach skipCacheWrite }); const markerIndex = skipCacheWrite ? messages.length - 2 : messages.length - 1; - const result3 = messages.map((msg, index) => { + const result2 = messages.map((msg, index) => { const addCache = index === markerIndex; if (msg.type === "user") { return userMessageToMessageParam(msg, addCache, enablePromptCaching, querySource); @@ -584904,7 +507470,7 @@ function addCacheBreakpoints(messages, enablePromptCaching, querySource, useCach return assistantMessageToMessageParam(msg, addCache, enablePromptCaching, querySource); }); if (!useCachedMC) { - return result3; + return result2; } const seenDeleteRefs = new Set; const deduplicateEdits = (block2) => { @@ -584918,7 +507484,7 @@ function addCacheBreakpoints(messages, enablePromptCaching, querySource, useCach return { ...block2, edits: uniqueEdits }; }; for (const pinned of pinnedEdits ?? []) { - const msg = result3[pinned.userMessageIndex]; + const msg = result2[pinned.userMessageIndex]; if (msg && msg.role === "user") { if (!Array.isArray(msg.content)) { msg.content = [{ type: "text", text: msg.content }]; @@ -584929,18 +507495,18 @@ function addCacheBreakpoints(messages, enablePromptCaching, querySource, useCach } } } - if (newCacheEdits && result3.length > 0) { + if (newCacheEdits && result2.length > 0) { const dedupedNewEdits = deduplicateEdits(newCacheEdits); if (dedupedNewEdits.edits.length > 0) { - for (let i4 = result3.length - 1;i4 >= 0; i4--) { - const msg = result3[i4]; + for (let i3 = result2.length - 1;i3 >= 0; i3--) { + const msg = result2[i3]; if (msg && msg.role === "user") { if (!Array.isArray(msg.content)) { msg.content = [{ type: "text", text: msg.content }]; } insertBlockAfterToolResults(msg.content, dedupedNewEdits); - pinCacheEdits(i4, newCacheEdits); - logForDebugging(`Added cache_edits block with ${dedupedNewEdits.edits.length} deletion(s) to message[${i4}]: ${dedupedNewEdits.edits.map((e) => e.cache_reference).join(", ")}`); + pinCacheEdits(i3, newCacheEdits); + logForDebugging(`Added cache_edits block with ${dedupedNewEdits.edits.length} deletion(s) to message[${i3}]: ${dedupedNewEdits.edits.map((e) => e.cache_reference).join(", ")}`); break; } } @@ -584948,19 +507514,19 @@ function addCacheBreakpoints(messages, enablePromptCaching, querySource, useCach } if (enablePromptCaching) { let lastCCMsg = -1; - for (let i4 = 0;i4 < result3.length; i4++) { - const msg = result3[i4]; + for (let i3 = 0;i3 < result2.length; i3++) { + const msg = result2[i3]; if (Array.isArray(msg.content)) { for (const block2 of msg.content) { if (block2 && typeof block2 === "object" && "cache_control" in block2) { - lastCCMsg = i4; + lastCCMsg = i3; } } } } if (lastCCMsg >= 0) { - for (let i4 = 0;i4 < lastCCMsg; i4++) { - const msg = result3[i4]; + for (let i3 = 0;i3 < lastCCMsg; i3++) { + const msg = result2[i3]; if (msg.role !== "user" || !Array.isArray(msg.content)) { continue; } @@ -584980,7 +507546,7 @@ function addCacheBreakpoints(messages, enablePromptCaching, querySource, useCach } } } - return result3; + return result2; } function buildSystemPromptBlocks(systemPrompt, enablePromptCaching, options2) { return splitSysPromptPrefix(systemPrompt, { @@ -585005,9 +507571,9 @@ async function queryHaiku({ signal, options: options2 }) { - const result3 = await withVCR([ + const result2 = await withVCR([ createUserMessage({ - content: systemPrompt.map((text2) => ({ type: "text", text: text2 })) + content: systemPrompt.map((text) => ({ type: "text", text })) }), createUserMessage({ content: userPrompt @@ -585018,7 +507584,7 @@ async function queryHaiku({ content: userPrompt }) ]; - const result4 = await queryModelWithoutStreaming({ + const result3 = await queryModelWithoutStreaming({ messages, systemPrompt, thinkingConfig: { type: "disabled" }, @@ -585034,9 +507600,9 @@ async function queryHaiku({ } } }); - return [result4]; + return [result3]; }); - return result3[0]; + return result2[0]; } async function queryWithModel({ systemPrompt = asSystemPrompt([]), @@ -585045,9 +507611,9 @@ async function queryWithModel({ signal, options: options2 }) { - const result3 = await withVCR([ + const result2 = await withVCR([ createUserMessage({ - content: systemPrompt.map((text2) => ({ type: "text", text: text2 })) + content: systemPrompt.map((text) => ({ type: "text", text })) }), createUserMessage({ content: userPrompt @@ -585058,7 +507624,7 @@ async function queryWithModel({ content: userPrompt }) ]; - const result4 = await queryModelWithoutStreaming({ + const result3 = await queryModelWithoutStreaming({ messages, systemPrompt, thinkingConfig: { type: "disabled" }, @@ -585073,9 +507639,9 @@ async function queryWithModel({ } } }); - return [result4]; + return [result3]; }); - return result3[0]; + return result2[0]; } function adjustParamsForNonStreaming(params, maxTokensCap) { const cappedMaxTokens = Math.min(params.max_tokens, maxTokensCap); @@ -585097,8 +507663,8 @@ function isMaxTokensCapEnabled() { function getMaxOutputTokensForModel(model) { const maxOutputTokens = getModelMaxOutputTokens(model); const defaultTokens = isMaxTokensCapEnabled() ? Math.min(maxOutputTokens.default, CAPPED_DEFAULT_MAX_TOKENS) : maxOutputTokens.default; - const result3 = validateBoundedIntEnvVar("CLAUDE_CODE_MAX_OUTPUT_TOKENS", process.env.CLAUDE_CODE_MAX_OUTPUT_TOKENS, defaultTokens, maxOutputTokens.upperLimit); - return result3.effective; + const result2 = validateBoundedIntEnvVar("CLAUDE_CODE_MAX_OUTPUT_TOKENS", process.env.CLAUDE_CODE_MAX_OUTPUT_TOKENS, defaultTokens, maxOutputTokens.upperLimit); + return result2.effective; } var autoModeStateModule3, MAX_NON_STREAMING_TOKENS = 64000; var init_claude = __esm(() => { @@ -585106,7 +507672,7 @@ var init_claude = __esm(() => { init_system(); init_Tool(); init_api4(); - init_auth2(); + init_auth(); init_betas2(); init_config2(); init_context(); @@ -585115,7 +507681,7 @@ var init_claude = __esm(() => { init_errors(); init_fingerprint(); init_log3(); - init_messages5(); + init_messages3(); init_model(); init_tokens(); init_growthbook(); @@ -585129,7 +507695,7 @@ var init_claude = __esm(() => { init_growthbook(); init_advisor(); init_agentContext(); - init_auth2(); + init_auth(); init_betas2(); init_common3(); init_context(); @@ -585157,10 +507723,10 @@ var init_claude = __esm(() => { init_analytics(); init_microCompact(); init_manager(); - init_utils4(); + init_utils3(); init_vcr(); - init_client7(); - init_errors7(); + init_client3(); + init_errors6(); init_logging(); init_promptCacheBreakDetection(); init_withRetry(); @@ -585168,8 +507734,8 @@ var init_claude = __esm(() => { }); // src/utils/shell/prefix.ts -function createCommandPrefixExtractor(config5) { - const { toolName, policySpec, eventName, querySource, preCheck } = config5; +function createCommandPrefixExtractor(config3) { + const { toolName, policySpec, eventName, querySource, preCheck } = config3; const memoized = memoizeWithLRU((command, abortSignal, isNonInteractiveSession) => { const promise4 = getCommandPrefixImpl(command, abortSignal, isNonInteractiveSession, toolName, policySpec, eventName, querySource, preCheck); promise4.catch(() => { @@ -585203,7 +507769,7 @@ async function getCommandPrefixImpl(command, abortSignal, isNonInteractiveSessio } let preflightCheckTimeoutId; const startTime = Date.now(); - let result3 = null; + let result2 = null; try { preflightCheckTimeoutId = setTimeout((tn, nonInteractive) => { const message = `[${tn}Tool] Pre-flight check is taking longer than expected. Run with ANTHROPIC_LOG=debug to check for failed or slow API requests.`; @@ -585247,14 +507813,14 @@ Command: ${command}`, error: "API error", durationMs }); - result3 = null; + result2 = null; } else if (prefix === "command_injection_detected") { logEvent(eventName, { success: false, error: "command_injection_detected", durationMs }); - result3 = { + result2 = { commandPrefix: null }; } else if (prefix === "git" || DANGEROUS_SHELL_PREFIXES.has(prefix.toLowerCase())) { @@ -585263,7 +507829,7 @@ Command: ${command}`, error: "dangerous_shell_prefix", durationMs }); - result3 = { + result2 = { commandPrefix: null }; } else if (prefix === "none") { @@ -585272,7 +507838,7 @@ Command: ${command}`, error: 'prefix "none"', durationMs }); - result3 = { + result2 = { commandPrefix: null }; } else { @@ -585282,7 +507848,7 @@ Command: ${command}`, error: "command did not start with prefix", durationMs }); - result3 = { + result2 = { commandPrefix: null }; } else { @@ -585290,15 +507856,15 @@ Command: ${command}`, success: true, durationMs }); - result3 = { + result2 = { commandPrefix: prefix }; } } - return result3; - } catch (error46) { + return result2; + } catch (error42) { clearTimeout(preflightCheckTimeoutId); - throw error46; + throw error42; } } async function getCommandSubcommandPrefixImpl(command, abortSignal, isNonInteractiveSession, getPrefix, splitCommandFn) { @@ -585330,7 +507896,7 @@ var init_prefix = __esm(() => { init_growthbook(); init_analytics(); init_claude(); - init_errors7(); + init_errors6(); init_memoize2(); init_slowOperations(); DANGEROUS_SHELL_PREFIXES = new Set([ @@ -585353,9 +507919,9 @@ var init_prefix = __esm(() => { }); // src/utils/bash/commands.ts -import { randomBytes as randomBytes14 } from "crypto"; +import { randomBytes as randomBytes13 } from "crypto"; function generatePlaceholders() { - const salt = randomBytes14(8).toString("hex"); + const salt = randomBytes13(8).toString("hex"); return { SINGLE_QUOTE: `__SINGLE_QUOTE_${salt}__`, DOUBLE_QUOTE: `__DOUBLE_QUOTE_${salt}__`, @@ -585457,15 +508023,15 @@ function filterControlOperators(commandsAndOperators) { } function splitCommand_DEPRECATED(command) { const parts = splitCommandWithOperators(command); - for (let i4 = 0;i4 < parts.length; i4++) { - const part = parts[i4]; + for (let i3 = 0;i3 < parts.length; i3++) { + const part = parts[i3]; if (part === undefined) { continue; } if (part === ">&" || part === ">" || part === ">>") { - const prevPart = parts[i4 - 1]?.trim(); - const nextPart = parts[i4 + 1]?.trim(); - const afterNextPart = parts[i4 + 2]?.trim(); + const prevPart = parts[i3 - 1]?.trim(); + const nextPart = parts[i3 + 1]?.trim(); + const afterNextPart = parts[i3 + 2]?.trim(); if (nextPart === undefined) { continue; } @@ -585487,12 +508053,12 @@ function splitCommand_DEPRECATED(command) { } if (shouldStrip) { if (prevPart && prevPart.length >= 3 && ALLOWED_FILE_DESCRIPTORS.has(prevPart.charAt(prevPart.length - 1)) && prevPart.charAt(prevPart.length - 2) === " ") { - parts[i4 - 1] = prevPart.slice(0, -2); + parts[i3 - 1] = prevPart.slice(0, -2); } - parts[i4] = undefined; - parts[i4 + 1] = undefined; + parts[i3] = undefined; + parts[i3 + 1] = undefined; if (stripThirdToken) { - parts[i4 + 2] = undefined; + parts[i3 + 2] = undefined; } } } @@ -585544,9 +508110,9 @@ function isCommandList(command) { return false; } const parts = parseResult.tokens; - for (let i4 = 0;i4 < parts.length; i4++) { - const part = parts[i4]; - const nextPart = parts[i4 + 1]; + for (let i3 = 0;i3 < parts.length; i3++) { + const part = parts[i3]; + const nextPart = parts[i3 + 1]; if (part === undefined) { continue; } @@ -585594,7 +508160,7 @@ function extractOutputRedirections(cmd) { } return match; }); - const parseResult = tryParseShellCommand(processedCommand, (env5) => `$${env5}`); + const parseResult = tryParseShellCommand(processedCommand, (env4) => `$${env4}`); if (!parseResult.success) { return { commandWithoutRedirections: cmd, @@ -585605,27 +508171,27 @@ function extractOutputRedirections(cmd) { const parsed = parseResult.tokens; const redirectedSubshells = new Set; const parenStack = []; - parsed.forEach((part, i4) => { + parsed.forEach((part, i3) => { if (isOperator2(part, "(")) { - const prev = parsed[i4 - 1]; - const isStart = i4 === 0 || prev && typeof prev === "object" && "op" in prev && ["&&", "||", ";", "|"].includes(prev.op); - parenStack.push({ index: i4, isStart: !!isStart }); + const prev = parsed[i3 - 1]; + const isStart = i3 === 0 || prev && typeof prev === "object" && "op" in prev && ["&&", "||", ";", "|"].includes(prev.op); + parenStack.push({ index: i3, isStart: !!isStart }); } else if (isOperator2(part, ")") && parenStack.length > 0) { const opening = parenStack.pop(); - const next = parsed[i4 + 1]; + const next = parsed[i3 + 1]; if (opening.isStart && (isOperator2(next, ">") || isOperator2(next, ">>"))) { - redirectedSubshells.add(opening.index).add(i4); + redirectedSubshells.add(opening.index).add(i3); } } }); const kept = []; let cmdSubDepth = 0; - for (let i4 = 0;i4 < parsed.length; i4++) { - const part = parsed[i4]; + for (let i3 = 0;i3 < parsed.length; i3++) { + const part = parsed[i3]; if (!part) continue; - const [prev, next] = [parsed[i4 - 1], parsed[i4 + 1]]; - if ((isOperator2(part, "(") || isOperator2(part, ")")) && redirectedSubshells.has(i4)) { + const [prev, next] = [parsed[i3 - 1], parsed[i3 + 1]]; + if ((isOperator2(part, "(") || isOperator2(part, ")")) && redirectedSubshells.has(i3)) { continue; } if (isOperator2(part, "(") && prev && typeof prev === "string" && prev.endsWith("$")) { @@ -585634,12 +508200,12 @@ function extractOutputRedirections(cmd) { cmdSubDepth--; } if (cmdSubDepth === 0) { - const { skip, dangerous } = handleRedirection(part, prev, next, parsed[i4 + 2], parsed[i4 + 3], redirections, kept); + const { skip, dangerous } = handleRedirection(part, prev, next, parsed[i3 + 2], parsed[i3 + 3], redirections, kept); if (dangerous) { hasDangerousRedirection = true; } if (skip > 0) { - i4 += skip; + i3 += skip; continue; } } @@ -585778,8 +508344,8 @@ function handleRedirection(part, prev, next, nextNext, nextNextNext, redirection } return { skip: 0, dangerous: false }; } -function handleFileDescriptorRedirection(fd3, operator, target, redirections, kept, skipCount = 1) { - const isStdout = fd3 === "1"; +function handleFileDescriptorRedirection(fd2, operator, target, redirections, kept, skipCount = 1) { + const isStdout = fd2 === "1"; const isFileTarget = target && isSimpleTarget(target) && typeof target === "string" && !/^\d+$/.test(target); const isFdTarget = typeof target === "string" && /^\d+$/.test(target.trim()); if (kept.length > 0) @@ -585790,12 +508356,12 @@ function handleFileDescriptorRedirection(fd3, operator, target, redirections, ke if (isFileTarget) { redirections.push({ target, operator }); if (!isStdout) { - kept.push(fd3 + operator, target); + kept.push(fd2 + operator, target); } return { skip: skipCount, dangerous: false }; } if (!isStdout) { - kept.push(fd3 + operator); + kept.push(fd2 + operator); if (target) { kept.push(target); return { skip: 1, dangerous: false }; @@ -585817,8 +508383,8 @@ function detectCommandSubstitution(prev, kept, index) { if (isOperator2(kept[j], "(")) depth++; if (isOperator2(kept[j], ")") && --depth === 0) { - const after3 = kept[j + 1]; - return !!(after3 && typeof after3 === "string" && !after3.startsWith(" ")); + const after2 = kept[j + 1]; + return !!(after2 && typeof after2 === "string" && !after2.startsWith(" ")); } } } @@ -585833,31 +508399,31 @@ function needsQuoting(str2) { return true; return false; } -function addToken(result3, token, noSpace = false) { - if (!result3 || noSpace) - return result3 + token; - return result3 + " " + token; +function addToken(result2, token, noSpace = false) { + if (!result2 || noSpace) + return result2 + token; + return result2 + " " + token; } function reconstructCommand(kept, originalCmd) { if (!kept.length) return originalCmd; - let result3 = ""; + let result2 = ""; let cmdSubDepth = 0; let inProcessSub = false; - for (let i4 = 0;i4 < kept.length; i4++) { - const part = kept[i4]; - const prev = kept[i4 - 1]; - const next = kept[i4 + 1]; + for (let i3 = 0;i3 < kept.length; i3++) { + const part = kept[i3]; + const prev = kept[i3 - 1]; + const next = kept[i3 + 1]; if (typeof part === "string") { const hasCommandSeparator = /[|&;]/.test(part); const str2 = hasCommandSeparator ? `"${part}"` : needsQuoting(part) ? quote([part]) : part; const endsWithDollar = str2.endsWith("$"); const nextIsParen = next && typeof next === "object" && "op" in next && next.op === "("; - const noSpace = result3.endsWith("(") || prev === "$" || typeof prev === "object" && prev && "op" in prev && prev.op === ")"; - if (result3.endsWith("<(")) { - result3 += " " + str2; + const noSpace = result2.endsWith("(") || prev === "$" || typeof prev === "object" && prev && "op" in prev && prev.op === ")"; + if (result2.endsWith("<(")) { + result2 += " " + str2; } else { - result3 = addToken(result3, str2, noSpace); + result2 = addToken(result2, str2, noSpace); } if (endsWithDollar && nextIsParen) {} continue; @@ -585866,69 +508432,69 @@ function reconstructCommand(kept, originalCmd) { continue; const op = part.op; if (op === "glob" && "pattern" in part) { - result3 = addToken(result3, part.pattern); + result2 = addToken(result2, part.pattern); continue; } if (op === ">&" && typeof prev === "string" && /^\d+$/.test(prev) && typeof next === "string" && /^\d+$/.test(next)) { - const lastIndex = result3.lastIndexOf(prev); - result3 = result3.slice(0, lastIndex) + prev + op + next; - i4++; + const lastIndex = result2.lastIndexOf(prev); + result2 = result2.slice(0, lastIndex) + prev + op + next; + i3++; continue; } if (op === "<" && isOperator2(next, "<")) { - const delimiter4 = kept[i4 + 2]; + const delimiter4 = kept[i3 + 2]; if (delimiter4 && typeof delimiter4 === "string") { - result3 = addToken(result3, delimiter4); - i4 += 2; + result2 = addToken(result2, delimiter4); + i3 += 2; continue; } } if (op === "<<<") { - result3 = addToken(result3, op); + result2 = addToken(result2, op); continue; } if (op === "(") { - const isCmdSub = detectCommandSubstitution(prev, kept, i4); + const isCmdSub = detectCommandSubstitution(prev, kept, i3); if (isCmdSub || cmdSubDepth > 0) { cmdSubDepth++; - if (result3.endsWith(" ")) { - result3 = result3.slice(0, -1); + if (result2.endsWith(" ")) { + result2 = result2.slice(0, -1); } - result3 += "("; - } else if (result3.endsWith("$")) { - if (detectCommandSubstitution(prev, kept, i4)) { + result2 += "("; + } else if (result2.endsWith("$")) { + if (detectCommandSubstitution(prev, kept, i3)) { cmdSubDepth++; - result3 += "("; + result2 += "("; } else { - result3 = addToken(result3, "("); + result2 = addToken(result2, "("); } } else { - const noSpace = result3.endsWith("<(") || result3.endsWith("("); - result3 = addToken(result3, "(", noSpace); + const noSpace = result2.endsWith("<(") || result2.endsWith("("); + result2 = addToken(result2, "(", noSpace); } continue; } if (op === ")") { if (inProcessSub) { inProcessSub = false; - result3 += ")"; + result2 += ")"; continue; } if (cmdSubDepth > 0) cmdSubDepth--; - result3 += ")"; + result2 += ")"; continue; } if (op === "<(") { inProcessSub = true; - result3 = addToken(result3, op); + result2 = addToken(result2, op); continue; } if (["&&", "||", "|", ";", ">", ">>", "<"].includes(op)) { - result3 = addToken(result3, op); + result2 = addToken(result2, op); } } - return result3.trim() || originalCmd; + return result2.trim() || originalCmd; } var ALLOWED_FILE_DESCRIPTORS, BASH_POLICY_SPEC = ` # Claude Code Code Bash command prefix detection @@ -586058,8 +508624,8 @@ function containsExcludedCommand(command) { let startIdx = 0; while (startIdx < candidates.length) { const endIdx = candidates.length; - for (let i4 = startIdx;i4 < endIdx; i4++) { - const cmd = candidates[i4]; + for (let i3 = startIdx;i3 < endIdx; i3++) { + const cmd = candidates[i3]; const envStripped = stripAllLeadingEnvVars(cmd, BINARY_HIJACK_VARS); if (!seen.has(envStripped)) { candidates.push(envStripped); @@ -586098,17 +508664,17 @@ function containsExcludedCommand(command) { } return false; } -function shouldUseSandbox(input11) { +function shouldUseSandbox(input) { if (!SandboxManager2.isSandboxingEnabled()) { return false; } - if (input11.dangerouslyDisableSandbox && SandboxManager2.areUnsandboxedCommandsAllowed()) { + if (input.dangerouslyDisableSandbox && SandboxManager2.areUnsandboxedCommandsAllowed()) { return false; } - if (!input11.command) { + if (!input.command) { return false; } - if (containsExcludedCommand(input11.command)) { + if (containsExcludedCommand(input.command)) { return false; } return true; @@ -586139,7 +508705,7 @@ __export(exports_constants2, { VERIFY_PLAN_EXECUTION_TOOL_NAME: () => VERIFY_PLAN_EXECUTION_TOOL_NAME }); var VERIFY_PLAN_EXECUTION_TOOL_NAME = "VerifyPlanExecutionTool", constants_default; -var init_constants7 = __esm(() => { +var init_constants6 = __esm(() => { constants_default = {}; }); @@ -586162,7 +508728,7 @@ var init_classifierDecision = __esm(() => { init_yoloClassifier(); TERMINAL_CAPTURE_TOOL_NAME2 = feature("TERMINAL_PANEL") ? (init_prompt26(), __toCommonJS(exports_prompt7)).TERMINAL_CAPTURE_TOOL_NAME : null; OVERFLOW_TEST_TOOL_NAME2 = feature("OVERFLOW_TEST_TOOL") ? (init_OverflowTestTool(), __toCommonJS(exports_OverflowTestTool)).OVERFLOW_TEST_TOOL_NAME : null; - VERIFY_PLAN_EXECUTION_TOOL_NAME2 = process.env.USER_TYPE === "ant" ? (init_constants7(), __toCommonJS(exports_constants2)).VERIFY_PLAN_EXECUTION_TOOL_NAME : null; + VERIFY_PLAN_EXECUTION_TOOL_NAME2 = process.env.USER_TYPE === "ant" ? (init_constants6(), __toCommonJS(exports_constants2)).VERIFY_PLAN_EXECUTION_TOOL_NAME : null; WORKFLOW_TOOL_NAME2 = feature("WORKFLOW_SCRIPTS") ? __toCommonJS(exports_constants).WORKFLOW_TOOL_NAME : null; SAFE_YOLO_ALLOWLISTED_TOOLS = new Set([ FILE_READ_TOOL_NAME, @@ -586222,8 +508788,8 @@ function createPermissionRequestMessage2(toolName, decisionReason) { } case "subcommandResults": { const needsApproval = []; - for (const [cmd, result3] of decisionReason.reasons) { - if (result3.behavior === "ask" || result3.behavior === "passthrough") { + for (const [cmd, result2] of decisionReason.reasons) { + if (result2.behavior === "ask" || result2.behavior === "passthrough") { if (toolName === "Bash") { const { commandWithoutRedirections, redirections } = extractOutputRedirections(cmd); const displayCmd = redirections.length > 0 ? commandWithoutRedirections : cmd; @@ -586330,15 +508896,15 @@ function getRuleByContentsForToolName(context, toolName, behavior) { } return ruleByContents; } -async function runPermissionRequestHooksForHeadlessAgent(tool, input11, toolUseID, context, permissionMode, suggestions) { +async function runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID, context, permissionMode, suggestions) { try { - for await (const hookResult of executePermissionRequestHooks(tool.name, toolUseID, input11, context, permissionMode, suggestions, context.abortController.signal)) { + for await (const hookResult of executePermissionRequestHooks(tool.name, toolUseID, input, context, permissionMode, suggestions, context.abortController.signal)) { if (!hookResult.permissionRequestResult) { continue; } const decision = hookResult.permissionRequestResult; if (decision.behavior === "allow") { - const finalInput = decision.updatedInput ?? input11; + const finalInput = decision.updatedInput ?? input; if (decision.updatedPermissions?.length) { persistPermissionUpdates(decision.updatedPermissions); context.setAppState((prev) => ({ @@ -586371,9 +508937,9 @@ async function runPermissionRequestHooksForHeadlessAgent(tool, input11, toolUseI }; } } - } catch (error46) { + } catch (error42) { logError2(new Error("PermissionRequest hook failed for headless agent", { - cause: toError(error46) + cause: toError(error42) })); } return null; @@ -586389,7 +508955,7 @@ function persistDenialState(context, newState) { }); } } -function handleDenialLimitExceeded(denialState, appState, classifierReason, assistantMessage, tool, result3, context) { +function handleDenialLimitExceeded(denialState, appState, classifierReason, assistantMessage, tool, result2, context) { if (!shouldFallbackToPrompting(denialState)) { return null; } @@ -586417,9 +508983,9 @@ function handleDenialLimitExceeded(denialState, appState, classifierReason, assi consecutiveDenials: 0 }); } - const originalClassifier = result3.decisionReason?.type === "classifier" ? result3.decisionReason.classifier : "auto-mode"; + const originalClassifier = result2.decisionReason?.type === "classifier" ? result2.decisionReason.classifier : "auto-mode"; return { - ...result3, + ...result2, decisionReason: { type: "classifier", classifier: originalClassifier, @@ -586429,7 +508995,7 @@ Latest blocked action: ${classifierReason}` } }; } -async function checkRuleBasedPermissions(tool, input11, context) { +async function checkRuleBasedPermissions(tool, input, context) { const appState = context.getAppState(); const denyRule = getDenyRuleForTool(appState.toolPermissionContext, tool); if (denyRule) { @@ -586444,7 +509010,7 @@ async function checkRuleBasedPermissions(tool, input11, context) { } const askRule = getAskRuleForTool(appState.toolPermissionContext, tool); if (askRule) { - const canSandboxAutoAllow = tool.name === BASH_TOOL_NAME && SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input11); + const canSandboxAutoAllow = tool.name === BASH_TOOL_NAME && SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input); if (!canSandboxAutoAllow) { return { behavior: "ask", @@ -586461,7 +509027,7 @@ async function checkRuleBasedPermissions(tool, input11, context) { message: createPermissionRequestMessage2(tool.name) }; try { - const parsedInput = tool.inputSchema.parse(input11); + const parsedInput = tool.inputSchema.parse(input); toolPermissionResult = await tool.checkPermissions(parsedInput, context); } catch (e) { if (e instanceof AbortError || e instanceof APIUserAbortError) { @@ -586480,7 +509046,7 @@ async function checkRuleBasedPermissions(tool, input11, context) { } return null; } -async function hasPermissionsToUseToolInner(tool, input11, context) { +async function hasPermissionsToUseToolInner(tool, input, context) { if (context.abortController.signal.aborted) { throw new AbortError; } @@ -586498,7 +509064,7 @@ async function hasPermissionsToUseToolInner(tool, input11, context) { } const askRule = getAskRuleForTool(appState.toolPermissionContext, tool); if (askRule) { - const canSandboxAutoAllow = tool.name === BASH_TOOL_NAME && SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input11); + const canSandboxAutoAllow = tool.name === BASH_TOOL_NAME && SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input); if (!canSandboxAutoAllow) { return { behavior: "ask", @@ -586515,7 +509081,7 @@ async function hasPermissionsToUseToolInner(tool, input11, context) { message: createPermissionRequestMessage2(tool.name) }; try { - const parsedInput = tool.inputSchema.parse(input11); + const parsedInput = tool.inputSchema.parse(input); toolPermissionResult = await tool.checkPermissions(parsedInput, context); } catch (e) { if (e instanceof AbortError || e instanceof APIUserAbortError) { @@ -586540,7 +509106,7 @@ async function hasPermissionsToUseToolInner(tool, input11, context) { if (shouldBypassPermissions) { return { behavior: "allow", - updatedInput: getUpdatedInputOrFallback(toolPermissionResult, input11), + updatedInput: getUpdatedInputOrFallback(toolPermissionResult, input), decisionReason: { type: "mode", mode: appState.toolPermissionContext.mode @@ -586551,22 +509117,22 @@ async function hasPermissionsToUseToolInner(tool, input11, context) { if (alwaysAllowedRule) { return { behavior: "allow", - updatedInput: getUpdatedInputOrFallback(toolPermissionResult, input11), + updatedInput: getUpdatedInputOrFallback(toolPermissionResult, input), decisionReason: { type: "rule", rule: alwaysAllowedRule } }; } - const result3 = toolPermissionResult.behavior === "passthrough" ? { + const result2 = toolPermissionResult.behavior === "passthrough" ? { ...toolPermissionResult, behavior: "ask", message: createPermissionRequestMessage2(tool.name, toolPermissionResult.decisionReason) } : toolPermissionResult; - if (result3.behavior === "ask" && result3.suggestions) { - logForDebugging(`Permission suggestions for ${tool.name}: ${jsonStringify(result3.suggestions, null, 2)}`); + if (result2.behavior === "ask" && result2.suggestions) { + logForDebugging(`Permission suggestions for ${tool.name}: ${jsonStringify(result2.suggestions, null, 2)}`); } - return result3; + return result2; } async function deletePermissionRule({ rule, @@ -586665,9 +509231,9 @@ function syncPermissionRulesFromDisk(toolPermissionContext, rules) { function getUpdatedInputOrFallback(permissionResult, fallback) { return ("updatedInput" in permissionResult ? permissionResult.updatedInput : undefined) ?? fallback; } -var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRESH_MS, PERMISSION_RULE_SOURCES, hasPermissionsToUseTool = async (tool, input11, context, assistantMessage, toolUseID) => { - const result3 = await hasPermissionsToUseToolInner(tool, input11, context); - if (result3.behavior === "allow") { +var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRESH_MS, PERMISSION_RULE_SOURCES, hasPermissionsToUseTool = async (tool, input, context, assistantMessage, toolUseID) => { + const result2 = await hasPermissionsToUseToolInner(tool, input, context); + if (result2.behavior === "allow") { const appState = context.getAppState(); if (feature("TRANSCRIPT_CLASSIFIER")) { const currentDenialState = context.localDenialTracking ?? appState.denialTracking; @@ -586676,9 +509242,9 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE persistDenialState(context, newDenialState); } } - return result3; + return result2; } - if (result3.behavior === "ask") { + if (result2.behavior === "ask") { const appState = context.getAppState(); if (appState.toolPermissionContext.mode === "dontAsk") { return { @@ -586691,21 +509257,21 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE }; } if (feature("TRANSCRIPT_CLASSIFIER") && (appState.toolPermissionContext.mode === "auto" || appState.toolPermissionContext.mode === "plan" && (autoModeStateModule4?.isAutoModeActive() ?? false))) { - if (result3.decisionReason?.type === "safetyCheck" && !result3.decisionReason.classifierApprovable) { + if (result2.decisionReason?.type === "safetyCheck" && !result2.decisionReason.classifierApprovable) { if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) { return { behavior: "deny", - message: result3.message, + message: result2.message, decisionReason: { type: "asyncAgent", reason: "Safety check requires interactive approval and permission prompts are not available in this context" } }; } - return result3; + return result2; } - if (tool.requiresUserInteraction?.() && result3.behavior === "ask") { - return result3; + if (tool.requiresUserInteraction?.() && result2.behavior === "ask") { + return result2; } const denialState = context.localDenialTracking ?? appState.denialTracking ?? createDenialTrackingState(); if (tool.name === POWERSHELL_TOOL_NAME && !feature("POWERSHELL_AUTO_MODE")) { @@ -586720,11 +509286,11 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE }; } logForDebugging(`Skipping auto mode classifier for ${tool.name}: tool requires explicit user permission`); - return result3; + return result2; } - if (result3.behavior === "ask" && tool.name !== AGENT_TOOL_NAME && tool.name !== REPL_TOOL_NAME) { + if (result2.behavior === "ask" && tool.name !== AGENT_TOOL_NAME && tool.name !== REPL_TOOL_NAME) { try { - const parsedInput = tool.inputSchema.parse(input11); + const parsedInput = tool.inputSchema.parse(input); const acceptEditsResult = await tool.checkPermissions(parsedInput, { ...context, getAppState: () => { @@ -586752,7 +509318,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE }); return { behavior: "allow", - updatedInput: acceptEditsResult.updatedInput ?? input11, + updatedInput: acceptEditsResult.updatedInput ?? input, decisionReason: { type: "mode", mode: "auto" @@ -586779,14 +509345,14 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE }); return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "mode", mode: "auto" } }; } - const action2 = formatActionForClassifier(tool.name, input11); + const action2 = formatActionForClassifier(tool.name, input); setClassifierChecking(toolUseID); let classifierResult; try { @@ -586853,7 +509419,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE } logForDebugging("Auto mode classifier transcript too long, falling back to normal permission handling", { level: "warn" }); return { - ...result3, + ...result2, decisionReason: { type: "other", reason: "Auto mode classifier transcript exceeded context window — falling back to manual approval" @@ -586874,12 +509440,12 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE }; } logForDebugging("Auto mode classifier unavailable, falling back to normal permission handling (fail open)", { level: "warn" }); - return result3; + return result2; } const newDenialState2 = recordDenial(denialState); persistDenialState(context, newDenialState2); logForDebugging(`Auto mode classifier blocked action: ${classifierResult.reason}`, { level: "warn" }); - const denialLimitResult = handleDenialLimitExceeded(newDenialState2, appState, classifierResult.reason, assistantMessage, tool, result3, context); + const denialLimitResult = handleDenialLimitExceeded(newDenialState2, appState, classifierResult.reason, assistantMessage, tool, result2, context); if (denialLimitResult) { return denialLimitResult; } @@ -586897,7 +509463,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE persistDenialState(context, newDenialState); return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "classifier", classifier: "auto-mode", @@ -586906,7 +509472,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE }; } if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) { - const hookDecision = await runPermissionRequestHooksForHeadlessAgent(tool, input11, toolUseID, context, appState.toolPermissionContext.mode, result3.suggestions); + const hookDecision = await runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID, context, appState.toolPermissionContext.mode, result2.suggestions); if (hookDecision) { return hookDecision; } @@ -586920,7 +509486,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE }; } } - return result3; + return result2; }; var init_permissions2 = __esm(() => { init_bun_bundle(); @@ -586928,7 +509494,7 @@ var init_permissions2 = __esm(() => { init_mcpStringUtils(); init_constants3(); init_shouldUseSandbox(); - init_constants6(); + init_constants5(); init_commands(); init_debug(); init_errors(); @@ -586947,7 +509513,7 @@ var init_permissions2 = __esm(() => { init_classifierApprovals(); init_envUtils(); init_hooks5(); - init_messages5(); + init_messages3(); init_modelCost(); init_slowOperations(); init_denialTracking(); @@ -586998,8 +509564,8 @@ __export(exports_permissionSetup, { createDisabledBypassPermissionsContext: () => createDisabledBypassPermissionsContext, checkAndDisableBypassPermissions: () => checkAndDisableBypassPermissions }); -import { relative as relative24 } from "path"; -import { resolve as resolve41 } from "path"; +import { relative as relative22 } from "path"; +import { resolve as resolve35 } from "path"; function isDangerousBashPermission(toolName, ruleContent) { if (toolName !== BASH_TOOL_NAME) { return false; @@ -587102,7 +509668,7 @@ function formatPermissionSource(source) { if (SETTING_SOURCES.includes(source)) { const filePath = getSettingsFilePathForSource(source); if (filePath) { - const relativePath = relative24(getCwd(), filePath); + const relativePath = relative22(getCwd(), filePath); return relativePath.length < filePath.length ? relativePath : filePath; } } @@ -587273,18 +509839,18 @@ function restoreDangerousPermissions(context) { if (!stash) { return context; } - let result3 = context; + let result2 = context; for (const [source, ruleStrings] of Object.entries(stash)) { if (!ruleStrings || ruleStrings.length === 0) continue; - result3 = applyPermissionUpdate(result3, { + result2 = applyPermissionUpdate(result2, { type: "addRules", rules: ruleStrings.map(permissionRuleValueFromString), behavior: "allow", destination: source }); } - return { ...result3, strippedDangerousRules: undefined }; + return { ...result2, strippedDangerousRules: undefined }; } function transitionPermissionMode(fromMode, toMode, context) { if (fromMode === toMode) @@ -587331,7 +509897,7 @@ function isSymlinkTo({ originalCwd }) { const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath(getFsImplementation(), processPwd); - return isProcessPwdSymlink ? resolvedProcessPwd === resolve41(originalCwd) : false; + return isProcessPwdSymlink ? resolvedProcessPwd === resolve35(originalCwd) : false; } function initialPermissionModeFromCLI({ permissionModeCli, @@ -587376,7 +509942,7 @@ function initialPermissionModeFromCLI({ orderedModes.push(settingsMode); } } - let result3; + let result2; for (const mode of orderedModes) { if (mode === "bypassPermissions" && disableBypassPermissionsMode) { if (growthBookDisableBypassPermissionsMode) { @@ -587392,25 +509958,25 @@ function initialPermissionModeFromCLI({ } continue; } - result3 = { mode, notification }; + result2 = { mode, notification }; break; } - if (!result3) { - result3 = { mode: "default", notification }; + if (!result2) { + result2 = { mode: "default", notification }; } - if (!result3) { - result3 = { mode: "default", notification }; + if (!result2) { + result2 = { mode: "default", notification }; } - if (feature("TRANSCRIPT_CLASSIFIER") && result3.mode === "auto") { + if (feature("TRANSCRIPT_CLASSIFIER") && result2.mode === "auto") { autoModeStateModule5?.setAutoModeActive(true); } - return result3; + return result2; } function parseToolListFromCLI(tools) { if (tools.length === 0) { return []; } - const result3 = []; + const result2 = []; for (const toolString of tools) { if (!toolString) continue; @@ -587431,7 +509997,7 @@ function parseToolListFromCLI(tools) { current += char; } else { if (current.trim()) { - result3.push(current.trim()); + result2.push(current.trim()); } current = ""; } @@ -587440,7 +510006,7 @@ function parseToolListFromCLI(tools) { if (isInParens) { current += char; } else if (current.trim()) { - result3.push(current.trim()); + result2.push(current.trim()); current = ""; } break; @@ -587449,10 +510015,10 @@ function parseToolListFromCLI(tools) { } } if (current.trim()) { - result3.push(current.trim()); + result2.push(current.trim()); } } - return result3; + return result2; } async function initializeToolPermissionContext({ allowedToolsCli, @@ -587510,15 +510076,15 @@ async function initializeToolPermissionContext({ ...addDirs ]; const validationResults = await Promise.all(allAdditionalDirectories.map((dir) => validateDirectoryForWorkspace(dir, toolPermissionContext))); - for (const result3 of validationResults) { - if (result3.resultType === "success") { + for (const result2 of validationResults) { + if (result2.resultType === "success") { toolPermissionContext = applyPermissionUpdate(toolPermissionContext, { type: "addDirectories", - directories: [result3.absolutePath], + directories: [result2.absolutePath], destination: "cliArg" }); - } else if (result3.resultType !== "alreadyInWorkingDirectory" && result3.resultType !== "pathNotFound") { - warnings.push(addDirHelpMessage(result3)); + } else if (result2.resultType !== "alreadyInWorkingDirectory" && result2.resultType !== "pathNotFound") { + warnings.push(addDirHelpMessage(result2)); } } return { @@ -587655,14 +510221,14 @@ function parseAutoModeEnabledState(value) { return AUTO_MODE_ENABLED_DEFAULT; } function getAutoModeEnabledState() { - const config5 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); - return parseAutoModeEnabledState(config5?.enabled); + const config3 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", {}); + return parseAutoModeEnabledState(config3?.enabled); } function getAutoModeEnabledStateIfCached() { - const config5 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", NO_CACHED_AUTO_MODE_CONFIG); - if (config5 === NO_CACHED_AUTO_MODE_CONFIG) + const config3 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_auto_mode_config", NO_CACHED_AUTO_MODE_CONFIG); + if (config3 === NO_CACHED_AUTO_MODE_CONFIG) return; - return parseAutoModeEnabledState(config5?.enabled); + return parseAutoModeEnabledState(config3?.enabled); } function hasAutoModeOptInAnySource() { if (autoModeStateModule5?.getAutoModeFlagCli() ?? false) @@ -587946,8 +510512,8 @@ function useAppState(selector) { } else { t0 = $2[2]; } - const get3 = t0; - return import_react85.useSyncExternalStore(store.subscribe, get3, get3); + const get2 = t0; + return import_react85.useSyncExternalStore(store.subscribe, get2, get2); } function useSetAppState() { return useAppStore().setState; @@ -588154,7 +510720,7 @@ function useNotifications() { function getNext(queue2) { if (queue2.length === 0) return; - return queue2.reduce((min3, n2) => PRIORITIES[n2.priority] < PRIORITIES[min3.priority] ? n2 : min3); + return queue2.reduce((min2, n2) => PRIORITIES[n2.priority] < PRIORITIES[min2.priority] ? n2 : min2); } var import_react86, DEFAULT_TIMEOUT_MS2 = 8000, currentTimeoutId = null, PRIORITIES; var init_notifications = __esm(() => { @@ -588185,12 +510751,12 @@ function useClipboardImageHint(isFocused, enabled) { } checkTimeoutRef.current = setTimeout(async (checkTimeoutRef2, lastHintTimeRef2, addNotification2) => { checkTimeoutRef2.current = null; - const now3 = Date.now(); - if (now3 - lastHintTimeRef2.current < HINT_COOLDOWN_MS) { + const now2 = Date.now(); + if (now2 - lastHintTimeRef2.current < HINT_COOLDOWN_MS) { return; } if (await hasImageInClipboard()) { - lastHintTimeRef2.current = now3; + lastHintTimeRef2.current = now2; addNotification2({ key: NOTIFICATION_KEY, text: `Image in clipboard · ${getShortcutDisplay("chat:imagePaste", "Chat", "ctrl+v")} to paste`, @@ -588216,35 +510782,35 @@ var init_useClipboardImageHint = __esm(() => { }); // src/components/PromptInput/inputModes.ts -function prependModeCharacterToInput(input11, mode) { +function prependModeCharacterToInput(input, mode) { switch (mode) { case "bash": - return `!${input11}`; + return `!${input}`; default: - return input11; + return input; } } -function getModeFromInput(input11) { - if (input11.startsWith("!")) { +function getModeFromInput(input) { + if (input.startsWith("!")) { return "bash"; } return "prompt"; } -function getValueFromInput(input11) { - const mode = getModeFromInput(input11); +function getValueFromInput(input) { + const mode = getModeFromInput(input); if (mode === "prompt") { - return input11; + return input; } - return input11.slice(1); + return input.slice(1); } -function isInputModeCharacter(input11) { - return input11 === "!"; +function isInputModeCharacter(input) { + return input === "!"; } // src/projectOnboardingState.ts -import { join as join118 } from "path"; +import { join as join108 } from "path"; function getSteps() { - const hasClaudeMd = getFsImplementation().existsSync(join118(getCwd(), "CLAUDE.md")); + const hasClaudeMd = getFsImplementation().existsSync(join108(getCwd(), "CLAUDE.md")); const isWorkspaceDirEmpty = isDirEmpty(getCwd()); return [ { @@ -588300,9 +510866,9 @@ var init_projectOnboardingState = __esm(() => { }); // src/utils/appleTerminalBackup.ts -import { stat as stat39 } from "fs/promises"; -import { homedir as homedir27 } from "os"; -import { join as join119 } from "path"; +import { stat as stat38 } from "fs/promises"; +import { homedir as homedir25 } from "os"; +import { join as join109 } from "path"; function markTerminalSetupInProgress(backupPath) { saveGlobalConfig((current) => ({ ...current, @@ -588317,14 +510883,14 @@ function markTerminalSetupComplete() { })); } function getTerminalRecoveryInfo() { - const config5 = getGlobalConfig(); + const config3 = getGlobalConfig(); return { - inProgress: config5.appleTerminalSetupInProgress ?? false, - backupPath: config5.appleTerminalBackupPath || null + inProgress: config3.appleTerminalSetupInProgress ?? false, + backupPath: config3.appleTerminalBackupPath || null }; } function getTerminalPlistPath() { - return join119(homedir27(), "Library", "Preferences", "com.apple.Terminal.plist"); + return join109(homedir25(), "Library", "Preferences", "com.apple.Terminal.plist"); } async function backupTerminalPreferences() { const terminalPlistPath = getTerminalPlistPath(); @@ -588339,7 +510905,7 @@ async function backupTerminalPreferences() { return null; } try { - await stat39(terminalPlistPath); + await stat38(terminalPlistPath); } catch { return null; } @@ -588350,8 +510916,8 @@ async function backupTerminalPreferences() { ]); markTerminalSetupInProgress(backupPath); return backupPath; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return null; } } @@ -588365,7 +510931,7 @@ async function checkAndRestoreTerminalBackup() { return { status: "no_backup" }; } try { - await stat39(backupPath); + await stat38(backupPath); } catch { markTerminalSetupComplete(); return { status: "no_backup" }; @@ -588395,40 +510961,40 @@ var init_appleTerminalBackup = __esm(() => { }); // src/utils/completionCache.ts -import { mkdir as mkdir34, readFile as readFile41, writeFile as writeFile37 } from "fs/promises"; -import { homedir as homedir28 } from "os"; -import { dirname as dirname51, join as join120 } from "path"; +import { mkdir as mkdir34, readFile as readFile40, writeFile as writeFile35 } from "fs/promises"; +import { homedir as homedir26 } from "os"; +import { dirname as dirname47, join as join110 } from "path"; import { pathToFileURL as pathToFileURL7 } from "url"; function detectShell() { const shell = process.env.SHELL || ""; - const home = homedir28(); - const claudeDir = join120(home, ".claude"); + const home = homedir26(); + const claudeDir = join110(home, ".claude"); if (shell.endsWith("/zsh") || shell.endsWith("/zsh.exe")) { - const cacheFile = join120(claudeDir, "completion.zsh"); + const cacheFile = join110(claudeDir, "completion.zsh"); return { name: "zsh", - rcFile: join120(home, ".zshrc"), + rcFile: join110(home, ".zshrc"), cacheFile, completionLine: `[[ -f "${cacheFile}" ]] && source "${cacheFile}"`, shellFlag: "zsh" }; } if (shell.endsWith("/bash") || shell.endsWith("/bash.exe")) { - const cacheFile = join120(claudeDir, "completion.bash"); + const cacheFile = join110(claudeDir, "completion.bash"); return { name: "bash", - rcFile: join120(home, ".bashrc"), + rcFile: join110(home, ".bashrc"), cacheFile, completionLine: `[ -f "${cacheFile}" ] && source "${cacheFile}"`, shellFlag: "bash" }; } if (shell.endsWith("/fish") || shell.endsWith("/fish.exe")) { - const xdg = process.env.XDG_CONFIG_HOME || join120(home, ".config"); - const cacheFile = join120(claudeDir, "completion.fish"); + const xdg = process.env.XDG_CONFIG_HOME || join110(home, ".config"); + const cacheFile = join110(claudeDir, "completion.fish"); return { name: "fish", - rcFile: join120(xdg, "fish", "config.fish"), + rcFile: join110(xdg, "fish", "config.fish"), cacheFile, completionLine: `[ -f "${cacheFile}" ] && source "${cacheFile}"`, shellFlag: "fish" @@ -588443,13 +511009,13 @@ async function regenerateCompletionCache() { } logForDebugging(`update: Regenerating ${shell.name} completion cache`); const claudeBin = process.argv[1] || "claude"; - const result3 = await execFileNoThrow(claudeBin, [ + const result2 = await execFileNoThrow(claudeBin, [ "completion", shell.shellFlag, "--output", shell.cacheFile ]); - if (result3.code !== 0) { + if (result2.code !== 0) { logForDebugging(`update: Failed to regenerate ${shell.name} completion cache`); return; } @@ -588476,15 +511042,15 @@ __export(exports_terminalSetup, { getNativeCSIuTerminalDisplayName: () => getNativeCSIuTerminalDisplayName, call: () => call5 }); -import { randomBytes as randomBytes15 } from "crypto"; -import { copyFile as copyFile9, mkdir as mkdir35, readFile as readFile42, writeFile as writeFile38 } from "fs/promises"; -import { homedir as homedir29, platform as platform5 } from "os"; -import { dirname as dirname52, join as join121 } from "path"; +import { randomBytes as randomBytes14 } from "crypto"; +import { copyFile as copyFile8, mkdir as mkdir35, readFile as readFile41, writeFile as writeFile36 } from "fs/promises"; +import { homedir as homedir27, platform as platform4 } from "os"; +import { dirname as dirname48, join as join111 } from "path"; import { pathToFileURL as pathToFileURL8 } from "url"; function isVSCodeRemoteSSH() { const askpassMain = process.env.VSCODE_GIT_ASKPASS_MAIN ?? ""; - const path22 = process.env.PATH ?? ""; - return askpassMain.includes(".vscode-server") || askpassMain.includes(".cursor-server") || askpassMain.includes(".windsurf-server") || path22.includes(".vscode-server") || path22.includes(".cursor-server") || path22.includes(".windsurf-server"); + const path17 = process.env.PATH ?? ""; + return askpassMain.includes(".vscode-server") || askpassMain.includes(".cursor-server") || askpassMain.includes(".windsurf-server") || path17.includes(".vscode-server") || path17.includes(".cursor-server") || path17.includes(".windsurf-server"); } function getNativeCSIuTerminalDisplayName() { if (!env3.terminal || !(env3.terminal in NATIVE_CSIU_TERMINALS)) { @@ -588500,28 +511066,28 @@ function formatPathLink(filePath) { return `\x1B]8;;${fileUrl}\x07${filePath}\x1B]8;;\x07`; } function shouldOfferTerminalSetup() { - return platform5() === "darwin" && env3.terminal === "Apple_Terminal" || env3.terminal === "vscode" || env3.terminal === "cursor" || env3.terminal === "windsurf" || env3.terminal === "alacritty" || env3.terminal === "zed"; + return platform4() === "darwin" && env3.terminal === "Apple_Terminal" || env3.terminal === "vscode" || env3.terminal === "cursor" || env3.terminal === "windsurf" || env3.terminal === "alacritty" || env3.terminal === "zed"; } async function setupTerminal(theme) { - let result3 = ""; + let result2 = ""; switch (env3.terminal) { case "Apple_Terminal": - result3 = await enableOptionAsMetaForTerminal(theme); + result2 = await enableOptionAsMetaForTerminal(theme); break; case "vscode": - result3 = await installBindingsForVSCodeTerminal("VSCode", theme); + result2 = await installBindingsForVSCodeTerminal("VSCode", theme); break; case "cursor": - result3 = await installBindingsForVSCodeTerminal("Cursor", theme); + result2 = await installBindingsForVSCodeTerminal("Cursor", theme); break; case "windsurf": - result3 = await installBindingsForVSCodeTerminal("Windsurf", theme); + result2 = await installBindingsForVSCodeTerminal("Windsurf", theme); break; case "alacritty": - result3 = await installBindingsForAlacritty(theme); + result2 = await installBindingsForAlacritty(theme); break; case "zed": - result3 = await installBindingsForZed(theme); + result2 = await installBindingsForZed(theme); break; case null: break; @@ -588546,7 +511112,7 @@ async function setupTerminal(theme) { }); maybeMarkProjectOnboardingComplete(); if (false) {} - return result3; + return result2; } function isShiftEnterKeyBindingInstalled() { return getGlobalConfig().shiftEnterKeyBindingInstalled === true; @@ -588555,8 +511121,8 @@ function hasUsedBackslashReturn() { return getGlobalConfig().hasUsedBackslashReturn === true; } function markBackslashReturnUsed() { - const config5 = getGlobalConfig(); - if (!config5.hasUsedBackslashReturn) { + const config3 = getGlobalConfig(); + if (!config3.hasUsedBackslashReturn) { saveGlobalConfig((current) => ({ ...current, hasUsedBackslashReturn: true @@ -588598,24 +511164,24 @@ ${source_default.dim("Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Sh onDone(message); return null; } - const result3 = await setupTerminal(context.options.theme); - onDone(result3); + const result2 = await setupTerminal(context.options.theme); + onDone(result2); return null; } async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) { if (isVSCodeRemoteSSH()) { - return `${color("warning", theme)(`Cannot install keybindings from a remote ${editor} session.`)}${EOL6}${EOL6}${editor} keybindings must be installed on your local machine, not the remote server.${EOL6}${EOL6}To install the Shift+Enter keybinding:${EOL6}1. Open ${editor} on your local machine (not connected to remote)${EOL6}2. Open the Command Palette (Cmd/Ctrl+Shift+P) → "Preferences: Open Keyboard Shortcuts (JSON)"${EOL6}3. Add this keybinding (the file must be a JSON array):${EOL6}${EOL6}${source_default.dim(`[ + return `${color("warning", theme)(`Cannot install keybindings from a remote ${editor} session.`)}${EOL5}${EOL5}${editor} keybindings must be installed on your local machine, not the remote server.${EOL5}${EOL5}To install the Shift+Enter keybinding:${EOL5}1. Open ${editor} on your local machine (not connected to remote)${EOL5}2. Open the Command Palette (Cmd/Ctrl+Shift+P) → "Preferences: Open Keyboard Shortcuts (JSON)"${EOL5}3. Add this keybinding (the file must be a JSON array):${EOL5}${EOL5}${source_default.dim(`[ { "key": "shift+enter", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\\u001b\\r" }, "when": "terminalFocus" } -]`)}${EOL6}`; +]`)}${EOL5}`; } const editorDir = editor === "VSCode" ? "Code" : editor; - const userDirPath = join121(homedir29(), platform5() === "win32" ? join121("AppData", "Roaming", editorDir, "User") : platform5() === "darwin" ? join121("Library", "Application Support", editorDir, "User") : join121(".config", editorDir, "User")); - const keybindingsPath = join121(userDirPath, "keybindings.json"); + const userDirPath = join111(homedir27(), platform4() === "win32" ? join111("AppData", "Roaming", editorDir, "User") : platform4() === "darwin" ? join111("Library", "Application Support", editorDir, "User") : join111(".config", editorDir, "User")); + const keybindingsPath = join111(userDirPath, "keybindings.json"); try { await mkdir35(userDirPath, { recursive: true @@ -588624,7 +511190,7 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) { let keybindings = []; let fileExists = false; try { - content = await readFile42(keybindingsPath, { + content = await readFile41(keybindingsPath, { encoding: "utf-8" }); fileExists = true; @@ -588634,17 +511200,17 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) { throw e; } if (fileExists) { - const randomSha = randomBytes15(4).toString("hex"); + const randomSha = randomBytes14(4).toString("hex"); const backupPath = `${keybindingsPath}.${randomSha}.bak`; try { - await copyFile9(keybindingsPath, backupPath); + await copyFile8(keybindingsPath, backupPath); } catch { - return `${color("warning", theme)(`Error backing up existing ${editor} terminal keybindings. Bailing out.`)}${EOL6}${source_default.dim(`See ${formatPathLink(keybindingsPath)}`)}${EOL6}${source_default.dim(`Backup path: ${formatPathLink(backupPath)}`)}${EOL6}`; + return `${color("warning", theme)(`Error backing up existing ${editor} terminal keybindings. Bailing out.`)}${EOL5}${source_default.dim(`See ${formatPathLink(keybindingsPath)}`)}${EOL5}${source_default.dim(`Backup path: ${formatPathLink(backupPath)}`)}${EOL5}`; } } const existingBinding = keybindings.find((binding2) => binding2.key === "shift+enter" && binding2.command === "workbench.action.terminal.sendSequence" && binding2.when === "terminalFocus"); if (existingBinding) { - return `${color("warning", theme)(`Found existing ${editor} terminal Shift+Enter key binding. Remove it to continue.`)}${EOL6}${source_default.dim(`See ${formatPathLink(keybindingsPath)}`)}${EOL6}`; + return `${color("warning", theme)(`Found existing ${editor} terminal Shift+Enter key binding. Remove it to continue.`)}${EOL5}${source_default.dim(`See ${formatPathLink(keybindingsPath)}`)}${EOL5}`; } const newKeybinding = { key: "shift+enter", @@ -588655,12 +511221,12 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) { when: "terminalFocus" }; const updatedContent = addItemToJSONCArray(content, newKeybinding); - await writeFile38(keybindingsPath, updatedContent, { + await writeFile36(keybindingsPath, updatedContent, { encoding: "utf-8" }); - return `${color("success", theme)(`Installed ${editor} terminal Shift+Enter key binding`)}${EOL6}${source_default.dim(`See ${formatPathLink(keybindingsPath)}`)}${EOL6}`; - } catch (error46) { - logError2(error46); + return `${color("success", theme)(`Installed ${editor} terminal Shift+Enter key binding`)}${EOL5}${source_default.dim(`See ${formatPathLink(keybindingsPath)}`)}${EOL5}`; + } catch (error42) { + logError2(error42); throw new Error(`Failed to install ${editor} terminal Shift+Enter key binding`); } } @@ -588734,9 +511300,9 @@ async function enableOptionAsMetaForTerminal(theme) { } await execFileNoThrow("killall", ["cfprefsd"]); markTerminalSetupComplete(); - return `${color("success", theme)(`Configured Terminal.app settings:`)}${EOL6}${color("success", theme)('- Enabled "Use Option as Meta key"')}${EOL6}${color("success", theme)("- Switched to visual bell")}${EOL6}${source_default.dim("Option+Enter will now enter a newline.")}${EOL6}${source_default.dim("You must restart Terminal.app for changes to take effect.", theme)}${EOL6}`; - } catch (error46) { - logError2(error46); + return `${color("success", theme)(`Configured Terminal.app settings:`)}${EOL5}${color("success", theme)('- Enabled "Use Option as Meta key"')}${EOL5}${color("success", theme)("- Switched to visual bell")}${EOL5}${source_default.dim("Option+Enter will now enter a newline.")}${EOL5}${source_default.dim("You must restart Terminal.app for changes to take effect.", theme)}${EOL5}`; + } catch (error42) { + logError2(error42); const restoreResult = await checkAndRestoreTerminalBackup(); const errorMessage2 = "Failed to enable Option as Meta key for Terminal.app."; if (restoreResult.status === "restored") { @@ -588756,25 +511322,25 @@ chars = "\\u001B\\r"`; const configPaths = []; const xdgConfigHome = process.env.XDG_CONFIG_HOME; if (xdgConfigHome) { - configPaths.push(join121(xdgConfigHome, "alacritty", "alacritty.toml")); + configPaths.push(join111(xdgConfigHome, "alacritty", "alacritty.toml")); } else { - configPaths.push(join121(homedir29(), ".config", "alacritty", "alacritty.toml")); + configPaths.push(join111(homedir27(), ".config", "alacritty", "alacritty.toml")); } - if (platform5() === "win32") { + if (platform4() === "win32") { const appData = process.env.APPDATA; if (appData) { - configPaths.push(join121(appData, "alacritty", "alacritty.toml")); + configPaths.push(join111(appData, "alacritty", "alacritty.toml")); } } let configPath = null; let configContent = ""; let configExists = false; - for (const path22 of configPaths) { + for (const path17 of configPaths) { try { - configContent = await readFile42(path22, { + configContent = await readFile41(path17, { encoding: "utf-8" }); - configPath = path22; + configPath = path17; configExists = true; break; } catch (e) { @@ -588791,17 +511357,17 @@ chars = "\\u001B\\r"`; try { if (configExists) { if (configContent.includes('mods = "Shift"') && configContent.includes('key = "Return"')) { - return `${color("warning", theme)("Found existing Alacritty Shift+Enter key binding. Remove it to continue.")}${EOL6}${source_default.dim(`See ${formatPathLink(configPath)}`)}${EOL6}`; + return `${color("warning", theme)("Found existing Alacritty Shift+Enter key binding. Remove it to continue.")}${EOL5}${source_default.dim(`See ${formatPathLink(configPath)}`)}${EOL5}`; } - const randomSha = randomBytes15(4).toString("hex"); + const randomSha = randomBytes14(4).toString("hex"); const backupPath = `${configPath}.${randomSha}.bak`; try { - await copyFile9(configPath, backupPath); + await copyFile8(configPath, backupPath); } catch { - return `${color("warning", theme)("Error backing up existing Alacritty config. Bailing out.")}${EOL6}${source_default.dim(`See ${formatPathLink(configPath)}`)}${EOL6}${source_default.dim(`Backup path: ${formatPathLink(backupPath)}`)}${EOL6}`; + return `${color("warning", theme)("Error backing up existing Alacritty config. Bailing out.")}${EOL5}${source_default.dim(`See ${formatPathLink(configPath)}`)}${EOL5}${source_default.dim(`Backup path: ${formatPathLink(backupPath)}`)}${EOL5}`; } } else { - await mkdir35(dirname52(configPath), { + await mkdir35(dirname48(configPath), { recursive: true }); } @@ -588814,18 +511380,18 @@ chars = "\\u001B\\r"`; updatedContent += ` ` + ALACRITTY_KEYBINDING + ` `; - await writeFile38(configPath, updatedContent, { + await writeFile36(configPath, updatedContent, { encoding: "utf-8" }); - return `${color("success", theme)("Installed Alacritty Shift+Enter key binding")}${EOL6}${color("success", theme)("You may need to restart Alacritty for changes to take effect")}${EOL6}${source_default.dim(`See ${formatPathLink(configPath)}`)}${EOL6}`; - } catch (error46) { - logError2(error46); + return `${color("success", theme)("Installed Alacritty Shift+Enter key binding")}${EOL5}${color("success", theme)("You may need to restart Alacritty for changes to take effect")}${EOL5}${source_default.dim(`See ${formatPathLink(configPath)}`)}${EOL5}`; + } catch (error42) { + logError2(error42); throw new Error("Failed to install Alacritty Shift+Enter key binding"); } } async function installBindingsForZed(theme) { - const zedDir = join121(homedir29(), ".config", "zed"); - const keymapPath = join121(zedDir, "keymap.json"); + const zedDir = join111(homedir27(), ".config", "zed"); + const keymapPath = join111(zedDir, "keymap.json"); try { await mkdir35(zedDir, { recursive: true @@ -588833,7 +511399,7 @@ async function installBindingsForZed(theme) { let keymapContent = "[]"; let fileExists = false; try { - keymapContent = await readFile42(keymapPath, { + keymapContent = await readFile41(keymapPath, { encoding: "utf-8" }); fileExists = true; @@ -588843,14 +511409,14 @@ async function installBindingsForZed(theme) { } if (fileExists) { if (keymapContent.includes("shift-enter")) { - return `${color("warning", theme)("Found existing Zed Shift+Enter key binding. Remove it to continue.")}${EOL6}${source_default.dim(`See ${formatPathLink(keymapPath)}`)}${EOL6}`; + return `${color("warning", theme)("Found existing Zed Shift+Enter key binding. Remove it to continue.")}${EOL5}${source_default.dim(`See ${formatPathLink(keymapPath)}`)}${EOL5}`; } - const randomSha = randomBytes15(4).toString("hex"); + const randomSha = randomBytes14(4).toString("hex"); const backupPath = `${keymapPath}.${randomSha}.bak`; try { - await copyFile9(keymapPath, backupPath); + await copyFile8(keymapPath, backupPath); } catch { - return `${color("warning", theme)("Error backing up existing Zed keymap. Bailing out.")}${EOL6}${source_default.dim(`See ${formatPathLink(keymapPath)}`)}${EOL6}${source_default.dim(`Backup path: ${formatPathLink(backupPath)}`)}${EOL6}`; + return `${color("warning", theme)("Error backing up existing Zed keymap. Bailing out.")}${EOL5}${source_default.dim(`See ${formatPathLink(keymapPath)}`)}${EOL5}${source_default.dim(`Backup path: ${formatPathLink(backupPath)}`)}${EOL5}`; } } let keymap; @@ -588868,17 +511434,17 @@ async function installBindingsForZed(theme) { "shift-enter": ["terminal::SendText", "\x1B\r"] } }); - await writeFile38(keymapPath, jsonStringify(keymap, null, 2) + ` + await writeFile36(keymapPath, jsonStringify(keymap, null, 2) + ` `, { encoding: "utf-8" }); - return `${color("success", theme)("Installed Zed Shift+Enter key binding")}${EOL6}${source_default.dim(`See ${formatPathLink(keymapPath)}`)}${EOL6}`; - } catch (error46) { - logError2(error46); + return `${color("success", theme)("Installed Zed Shift+Enter key binding")}${EOL5}${source_default.dim(`See ${formatPathLink(keymapPath)}`)}${EOL5}`; + } catch (error42) { + logError2(error42); throw new Error("Failed to install Zed Shift+Enter key binding"); } } -var EOL6 = ` +var EOL5 = ` `, NATIVE_CSIU_TERMINALS; var init_terminalSetup = __esm(() => { init_source(); @@ -588905,56 +511471,56 @@ var init_terminalSetup = __esm(() => { }); // src/utils/pasteStore.ts -import { createHash as createHash24 } from "crypto"; -import { mkdir as mkdir36, readdir as readdir26, readFile as readFile43, stat as stat40, unlink as unlink18, writeFile as writeFile39 } from "fs/promises"; -import { join as join122 } from "path"; +import { createHash as createHash23 } from "crypto"; +import { mkdir as mkdir36, readdir as readdir26, readFile as readFile42, stat as stat39, unlink as unlink18, writeFile as writeFile37 } from "fs/promises"; +import { join as join112 } from "path"; function getPasteStoreDir() { - return join122(getClaudeConfigHomeDir(), PASTE_STORE_DIR); + return join112(getClaudeConfigHomeDir(), PASTE_STORE_DIR); } function hashPastedText(content) { - return createHash24("sha256").update(content).digest("hex").slice(0, 16); + return createHash23("sha256").update(content).digest("hex").slice(0, 16); } function getPastePath(hash2) { - return join122(getPasteStoreDir(), `${hash2}.txt`); + return join112(getPasteStoreDir(), `${hash2}.txt`); } async function storePastedText(hash2, content) { try { const dir = getPasteStoreDir(); await mkdir36(dir, { recursive: true }); const pastePath = getPastePath(hash2); - await writeFile39(pastePath, content, { encoding: "utf8", mode: 384 }); + await writeFile37(pastePath, content, { encoding: "utf8", mode: 384 }); logForDebugging(`Stored paste ${hash2} to ${pastePath}`); - } catch (error46) { - logForDebugging(`Failed to store paste: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to store paste: ${error42}`); } } async function retrievePastedText(hash2) { try { const pastePath = getPastePath(hash2); - return await readFile43(pastePath, { encoding: "utf8" }); - } catch (error46) { - if (!isENOENT(error46)) { - logForDebugging(`Failed to retrieve paste ${hash2}: ${error46}`); + return await readFile42(pastePath, { encoding: "utf8" }); + } catch (error42) { + if (!isENOENT(error42)) { + logForDebugging(`Failed to retrieve paste ${hash2}: ${error42}`); } return null; } } async function cleanupOldPastes(cutoffDate) { const pasteDir = getPasteStoreDir(); - let files2; + let files; try { - files2 = await readdir26(pasteDir); + files = await readdir26(pasteDir); } catch { return; } const cutoffTime = cutoffDate.getTime(); - for (const file2 of files2) { + for (const file2 of files) { if (!file2.endsWith(".txt")) { continue; } - const filePath = join122(pasteDir, file2); + const filePath = join112(pasteDir, file2); try { - const stats = await stat40(filePath); + const stats = await stat39(filePath); if (stats.mtimeMs < cutoffTime) { await unlink18(filePath); logForDebugging(`Cleaned up old paste: ${filePath}`); @@ -588970,10 +511536,10 @@ var init_pasteStore = __esm(() => { }); // src/history.ts -import { appendFile as appendFile5, writeFile as writeFile40 } from "fs/promises"; -import { join as join123 } from "path"; -function getPastedTextRefNumLines(text2) { - return (text2.match(/\r\n|\r|\n/g) || []).length; +import { appendFile as appendFile5, writeFile as writeFile38 } from "fs/promises"; +import { join as join113 } from "path"; +function getPastedTextRefNumLines(text) { + return (text.match(/\r\n|\r|\n/g) || []).length; } function formatPastedTextRef(id, numLines) { if (numLines === 0) { @@ -588984,20 +511550,20 @@ function formatPastedTextRef(id, numLines) { function formatImageRef(id) { return `[Image #${id}]`; } -function parseReferences(input11) { +function parseReferences(input) { const referencePattern = /\[(Pasted text|Image|\.\.\.Truncated text) #(\d+)(?: \+\d+ lines)?(\.)*\]/g; - const matches3 = [...input11.matchAll(referencePattern)]; - return matches3.map((match) => ({ + const matches2 = [...input.matchAll(referencePattern)]; + return matches2.map((match) => ({ id: parseInt(match[2] || "0"), match: match[0], index: match.index })).filter((match) => match.id > 0); } -function expandPastedTextRefs(input11, pastedContents) { - const refs = parseReferences(input11); - let expanded = input11; - for (let i4 = refs.length - 1;i4 >= 0; i4--) { - const ref = refs[i4]; +function expandPastedTextRefs(input, pastedContents) { + const refs = parseReferences(input); + let expanded = input; + for (let i3 = refs.length - 1;i3 >= 0; i3--) { + const ref = refs[i3]; const content = pastedContents[ref.id]; if (content?.type !== "text") continue; @@ -589010,10 +511576,10 @@ function deserializeLogEntry(line) { } async function* makeLogEntryReader() { const currentSession = getSessionId(); - for (let i4 = pendingEntries.length - 1;i4 >= 0; i4--) { - yield pendingEntries[i4]; + for (let i3 = pendingEntries.length - 1;i3 >= 0; i3--) { + yield pendingEntries[i3]; } - const historyPath = join123(getClaudeConfigHomeDir(), "history.jsonl"); + const historyPath = join113(getClaudeConfigHomeDir(), "history.jsonl"); try { for await (const line of readLinesReverse(historyPath)) { try { @@ -589022,8 +511588,8 @@ async function* makeLogEntryReader() { continue; } yield entry; - } catch (error46) { - logForDebugging(`Failed to parse history line: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to parse history line: ${error42}`); } } } catch (e) { @@ -589128,8 +511694,8 @@ async function immediateFlushHistory() { } let release2; try { - const historyPath = join123(getClaudeConfigHomeDir(), "history.jsonl"); - await writeFile40(historyPath, "", { + const historyPath = join113(getClaudeConfigHomeDir(), "history.jsonl"); + await writeFile38(historyPath, "", { encoding: "utf8", mode: 384, flag: "a" @@ -589145,8 +511711,8 @@ async function immediateFlushHistory() { `); pendingEntries = []; await appendFile5(historyPath, jsonLines.join(""), { mode: 384 }); - } catch (error46) { - logForDebugging(`Failed to write prompt history: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to write prompt history: ${error42}`); } finally { if (release2) { await release2(); @@ -589166,7 +511732,7 @@ async function flushPromptHistory(retries) { } finally { isWriting = false; if (pendingEntries.length > 0) { - await sleep4(500); + await sleep2(500); flushPromptHistory(retries + 1); } } @@ -589215,8 +511781,8 @@ function addToHistory(command) { if (isEnvTruthy(process.env.CLAUDE_CODE_SKIP_PROMPT_HISTORY)) { return; } - if (!cleanupRegistered4) { - cleanupRegistered4 = true; + if (!cleanupRegistered3) { + cleanupRegistered3 = true; registerCleanup(async () => { if (currentFlushPromise) { await currentFlushPromise; @@ -589240,7 +511806,7 @@ function removeLastFromHistory() { skippedTimestamps.add(entry.timestamp); } } -var MAX_HISTORY_ITEMS = 100, MAX_PASTED_CONTENT_LENGTH = 1024, pendingEntries, isWriting = false, currentFlushPromise = null, cleanupRegistered4 = false, lastAddedEntry = null, skippedTimestamps; +var MAX_HISTORY_ITEMS = 100, MAX_PASTED_CONTENT_LENGTH = 1024, pendingEntries, isWriting = false, currentFlushPromise = null, cleanupRegistered3 = false, lastAddedEntry = null, skippedTimestamps; var init_history = __esm(() => { init_state(); init_cleanupRegistry(); @@ -589255,16 +511821,16 @@ var init_history = __esm(() => { }); // src/utils/Cursor.ts -function pushToKillRing(text2, direction = "append") { - if (text2.length > 0) { +function pushToKillRing(text, direction = "append") { + if (text.length > 0) { if (lastActionWasKill && killRing.length > 0) { if (direction === "prepend") { - killRing[0] = text2 + killRing[0]; + killRing[0] = text + killRing[0]; } else { - killRing[0] = killRing[0] + text2; + killRing[0] = killRing[0] + text; } } else { - killRing.unshift(text2); + killRing.unshift(text); if (killRing.length > KILL_RING_MAX_SIZE) { killRing.pop(); } @@ -589290,8 +511856,8 @@ function yankPop() { return null; } killRingIndex = (killRingIndex + 1) % killRing.length; - const text2 = killRing[killRingIndex] ?? ""; - return { text: text2, start: lastYankStart, length: lastYankLength }; + const text = killRing[killRingIndex] ?? ""; + return { text, start: lastYankStart, length: lastYankLength }; } function updateYankLength(length) { lastYankLength = length; @@ -589309,8 +511875,8 @@ class Cursor { this.selection = selection; this.offset = Math.max(0, Math.min(this.text.length, offset)); } - static fromText(text2, columns, offset = 0, selection = 0) { - return new Cursor(new MeasuredText(text2, columns - 1), offset, selection); + static fromText(text, columns, offset = 0, selection = 0) { + return new Cursor(new MeasuredText(text, columns - 1), offset, selection); } getViewportStartLine(maxVisibleLines) { if (maxVisibleLines === undefined || maxVisibleLines <= 0) @@ -589344,21 +511910,21 @@ class Cursor { return this.text.length; return allLines[endLine]?.startOffset ?? this.text.length; } - render(cursorChar, mask, invert3, ghostText, maxVisibleLines) { + render(cursorChar, mask, invert2, ghostText, maxVisibleLines) { const { line, column } = this.getPosition(); const allLines = this.measuredText.getWrappedText(); const startLine = this.getViewportStartLine(maxVisibleLines); const endLine = maxVisibleLines !== undefined && maxVisibleLines > 0 ? Math.min(allLines.length, startLine + maxVisibleLines) : allLines.length; - return allLines.slice(startLine, endLine).map((text2, i4) => { - const currentLine = i4 + startLine; - let displayText = text2; + return allLines.slice(startLine, endLine).map((text, i3) => { + const currentLine = i3 + startLine; + let displayText = text; if (mask) { - const graphemes = Array.from(getGraphemeSegmenter().segment(text2)); + const graphemes = Array.from(getGraphemeSegmenter().segment(text)); if (currentLine === allLines.length - 1) { const visibleCount = Math.min(6, graphemes.length); const maskCount = graphemes.length - visibleCount; const splitOffset = graphemes.length > visibleCount ? graphemes[maskCount].index : 0; - displayText = mask.repeat(maskCount) + text2.slice(splitOffset); + displayText = mask.repeat(maskCount) + text.slice(splitOffset); } else { displayText = mask.repeat(graphemes.length); } @@ -589388,13 +511954,13 @@ class Cursor { let ghostSuffix = ""; if (ghostText && currentLine === allLines.length - 1 && this.isAtEnd() && ghostText.text.length > 0) { const firstGhostChar = firstGrapheme(ghostText.text) || ghostText.text[0]; - renderedCursor = cursorChar ? invert3(firstGhostChar) : firstGhostChar; + renderedCursor = cursorChar ? invert2(firstGhostChar) : firstGhostChar; const ghostRest = ghostText.text.slice(firstGhostChar.length); if (ghostRest.length > 0) { ghostSuffix = ghostText.dim(ghostRest); } } else { - renderedCursor = cursorChar ? invert3(atCursor) : atCursor; + renderedCursor = cursorChar ? invert2(atCursor) : atCursor; } return beforeCursor + renderedCursor + ghostSuffix + afterCursor.trimEnd(); }).join(` @@ -589656,31 +512222,31 @@ class Cursor { if (this.isAtEnd()) { return this; } - const text2 = this.text; + const text = this.text; let pos = this.offset; const advance2 = (p) => this.measuredText.nextOffset(p); if (this.graphemeAt(pos) === "") { return this; } pos = advance2(pos); - while (pos < text2.length && WHITESPACE_REGEX2.test(this.graphemeAt(pos))) { + while (pos < text.length && WHITESPACE_REGEX2.test(this.graphemeAt(pos))) { pos = advance2(pos); } - if (pos >= text2.length) { - return new Cursor(this.measuredText, text2.length); + if (pos >= text.length) { + return new Cursor(this.measuredText, text.length); } const charAtPos = this.graphemeAt(pos); if (isVimWordChar(charAtPos)) { - while (pos < text2.length) { + while (pos < text.length) { const nextPos = advance2(pos); - if (nextPos >= text2.length || !isVimWordChar(this.graphemeAt(nextPos))) + if (nextPos >= text.length || !isVimWordChar(this.graphemeAt(nextPos))) break; pos = nextPos; } } else if (isVimPunctuation(charAtPos)) { - while (pos < text2.length) { + while (pos < text.length) { const nextPos = advance2(pos); - if (nextPos >= text2.length || !isVimPunctuation(this.graphemeAt(nextPos))) + if (nextPos >= text.length || !isVimPunctuation(this.graphemeAt(nextPos))) break; pos = nextPos; } @@ -589882,8 +512448,8 @@ class Cursor { `); const targetLine = Math.min(Math.max(0, lineNumber - 1), lines.length - 1); let offset = 0; - for (let i4 = 0;i4 < targetLine; i4++) { - offset += (lines[i4]?.length ?? 0) + 1; + for (let i3 = 0;i3 < targetLine; i3++) { + offset += (lines[i3]?.length ?? 0) + 1; } return new Cursor(this.measuredText, offset, 0); } @@ -589903,13 +512469,13 @@ class Cursor { return this.measuredText.getOffsetFromPosition(position); } findCharacter(char, type, count4 = 1) { - const text2 = this.text; + const text = this.text; const forward = type === "f" || type === "t"; const till = type === "t" || type === "T"; let found = 0; if (forward) { let pos = this.measuredText.nextOffset(this.offset); - while (pos < text2.length) { + while (pos < text.length) { const grapheme = this.graphemeAt(pos); if (grapheme === char) { found++; @@ -589945,8 +512511,8 @@ class WrappedLine { startOffset; isPrecededByNewline; endsWithNewline; - constructor(text2, startOffset, isPrecededByNewline, endsWithNewline = false) { - this.text = text2; + constructor(text, startOffset, isPrecededByNewline, endsWithNewline = false) { + this.text = text; this.startOffset = startOffset; this.isPrecededByNewline = isPrecededByNewline; this.endsWithNewline = endsWithNewline; @@ -589965,9 +512531,9 @@ class MeasuredText { text; navigationCache; graphemeBoundaries; - constructor(text2, columns) { + constructor(text, columns) { this.columns = columns; - this.text = text2.normalize("NFC"); + this.text = text.normalize("NFC"); this.navigationCache = new Map; } get wrappedLines() { @@ -590003,7 +512569,7 @@ class MeasuredText { binarySearchBoundary(boundaries, target, findNext) { let left = 0; let right = boundaries.length - 1; - let result3 = findNext ? this.text.length : 0; + let result2 = findNext ? this.text.length : 0; while (left <= right) { const mid = Math.floor((left + right) / 2); const boundary = boundaries[mid]; @@ -590011,40 +512577,40 @@ class MeasuredText { break; if (findNext) { if (boundary > target) { - result3 = boundary; + result2 = boundary; right = mid - 1; } else { left = mid + 1; } } else { if (boundary < target) { - result3 = boundary; + result2 = boundary; left = mid + 1; } else { right = mid - 1; } } } - return result3; + return result2; } - stringIndexToDisplayWidth(text2, index) { + stringIndexToDisplayWidth(text, index) { if (index <= 0) return 0; - if (index >= text2.length) - return stringWidth(text2); - return stringWidth(text2.substring(0, index)); + if (index >= text.length) + return stringWidth(text); + return stringWidth(text.substring(0, index)); } - displayWidthToStringIndex(text2, targetWidth) { + displayWidthToStringIndex(text, targetWidth) { if (targetWidth <= 0) return 0; - if (!text2) + if (!text) return 0; - if (text2 === this.text) { + if (text === this.text) { return this.offsetAtDisplayWidth(targetWidth); } let currentWidth = 0; let currentOffset = 0; - for (const { segment, index } of getGraphemeSegmenter().segment(text2)) { + for (const { segment, index } of getGraphemeSegmenter().segment(text)) { const segmentWidth = stringWidth(segment); if (currentWidth + segmentWidth > targetWidth) { break; @@ -590059,9 +512625,9 @@ class MeasuredText { return 0; let currentWidth = 0; const boundaries = this.getGraphemeBoundaries(); - for (let i4 = 0;i4 < boundaries.length - 1; i4++) { - const start = boundaries[i4]; - const end = boundaries[i4 + 1]; + for (let i3 = 0;i3 < boundaries.length - 1; i3++) { + const start = boundaries[i3]; + const end = boundaries[i3 + 1]; if (start === undefined || end === undefined) continue; const segment = this.text.substring(start, end); @@ -590083,34 +512649,34 @@ class MeasuredText { let lastNewLinePos = -1; const lines = wrappedText.split(` `); - for (let i4 = 0;i4 < lines.length; i4++) { - const text2 = lines[i4]; - const isPrecededByNewline = (startOffset) => i4 === 0 || startOffset > 0 && this.text[startOffset - 1] === ` + for (let i3 = 0;i3 < lines.length; i3++) { + const text = lines[i3]; + const isPrecededByNewline = (startOffset) => i3 === 0 || startOffset > 0 && this.text[startOffset - 1] === ` `; - if (text2.length === 0) { + if (text.length === 0) { lastNewLinePos = this.text.indexOf(` `, lastNewLinePos + 1); if (lastNewLinePos !== -1) { const startOffset = lastNewLinePos; const endsWithNewline = true; - wrappedLines.push(new WrappedLine(text2, startOffset, isPrecededByNewline(startOffset), endsWithNewline)); + wrappedLines.push(new WrappedLine(text, startOffset, isPrecededByNewline(startOffset), endsWithNewline)); } else { const startOffset = this.text.length; - wrappedLines.push(new WrappedLine(text2, startOffset, isPrecededByNewline(startOffset), false)); + wrappedLines.push(new WrappedLine(text, startOffset, isPrecededByNewline(startOffset), false)); } } else { - const startOffset = this.text.indexOf(text2, searchOffset); + const startOffset = this.text.indexOf(text, searchOffset); if (startOffset === -1) { throw new Error("Failed to find wrapped line in text"); } - searchOffset = startOffset + text2.length; - const potentialNewlinePos = startOffset + text2.length; + searchOffset = startOffset + text.length; + const potentialNewlinePos = startOffset + text.length; const endsWithNewline = potentialNewlinePos < this.text.length && this.text[potentialNewlinePos] === ` `; if (endsWithNewline) { lastNewLinePos = potentialNewlinePos; } - wrappedLines.push(new WrappedLine(text2, startOffset, isPrecededByNewline(startOffset), endsWithNewline)); + wrappedLines.push(new WrappedLine(text, startOffset, isPrecededByNewline(startOffset), endsWithNewline)); } } return wrappedLines; @@ -590186,9 +512752,9 @@ class MeasuredText { const cached7 = this.navigationCache.get(key); if (cached7 !== undefined) return cached7; - const result3 = compute(); - this.navigationCache.set(key, result3); - return result3; + const result2 = compute(); + this.navigationCache.set(key, result2); + return result2; } nextOffset(offset) { return this.withCache(`next:${offset}`, () => { @@ -590254,9 +512820,9 @@ var prewarmed = false; // src/hooks/useTextInput.ts function mapInput(input_map) { - const map7 = new Map(input_map); - return function(input11) { - return (map7.get(input11) ?? NOOP_HANDLER)(input11); + const map5 = new Map(input_map); + return function(input) { + return (map5.get(input) ?? NOOP_HANDLER)(input); }; } function useTextInput({ @@ -590272,7 +512838,7 @@ function useTextInput({ mask = "", multiline = false, cursorChar, - invert: invert3, + invert: invert2, columns, onImagePaste: _onImagePaste, disableCursorMovementForUpDownKeys = false, @@ -590356,11 +512922,11 @@ function useTextInput({ return newCursor; } function yank() { - const text2 = getLastKill(); - if (text2.length > 0) { + const text = getLastKill(); + if (text.length > 0) { const startOffset = cursor.offset; - const newCursor = cursor.insert(text2); - recordYank(startOffset, text2.length); + const newCursor = cursor.insert(text); + recordYank(startOffset, text.length); return newCursor; } return cursor; @@ -590370,12 +512936,12 @@ function useTextInput({ if (!popResult) { return cursor; } - const { text: text2, start, length } = popResult; - const before3 = cursor.text.slice(0, start); - const after3 = cursor.text.slice(start + length); - const newText = before3 + text2 + after3; - const newOffset = start + text2.length; - updateYankLength(text2.length); + const { text, start, length } = popResult; + const before2 = cursor.text.slice(0, start); + const after2 = cursor.text.slice(start + length); + const newText = before2 + text + after2; + const newOffset = start + text.length; + updateYankLength(text.length); return Cursor.fromText(newText, columns, newOffset); } const handleCtrl = mapInput([ @@ -590502,27 +513068,27 @@ function useTextInput({ case key.rightArrow: return () => cursor.right(); default: { - return function(input11) { + return function(input) { switch (true) { - case (input11 === "\x1B[H" || input11 === "\x1B[1~"): + case (input === "\x1B[H" || input === "\x1B[1~"): return cursor.startOfLine(); - case (input11 === "\x1B[F" || input11 === "\x1B[4~"): + case (input === "\x1B[F" || input === "\x1B[4~"): return cursor.endOfLine(); default: { - const text2 = stripAnsi(input11).replace(/(?<=[^\\\r\n])\r$/, "").replace(/\r/g, ` + const text = stripAnsi(input).replace(/(?<=[^\\\r\n])\r$/, "").replace(/\r/g, ` `); - if (cursor.isAtStart() && isInputModeCharacter(input11)) { - return cursor.insert(text2).left(); + if (cursor.isAtStart() && isInputModeCharacter(input)) { + return cursor.insert(text).left(); } - return cursor.insert(text2); + return cursor.insert(text); } } }; } } } - function isKillKey(key, input11) { - if (key.ctrl && (input11 === "k" || input11 === "u" || input11 === "w")) { + function isKillKey(key, input) { + if (key.ctrl && (input === "k" || input === "u" || input === "w")) { return true; } if (key.meta && (key.backspace || key.delete)) { @@ -590530,18 +513096,18 @@ function useTextInput({ } return false; } - function isYankKey(key, input11) { - return (key.ctrl || key.meta) && input11 === "y"; + function isYankKey(key, input) { + return (key.ctrl || key.meta) && input === "y"; } - function onInput(input11, key) { - const filteredInput = inputFilter ? inputFilter(input11, key) : input11; - if (filteredInput === "" && input11 !== "") { + function onInput(input, key) { + const filteredInput = inputFilter ? inputFilter(input, key) : input; + if (filteredInput === "" && input !== "") { return; } - if (!key.backspace && !key.delete && input11.includes("")) { - const delCount = (input11.match(/\x7f/g) || []).length; + if (!key.backspace && !key.delete && input.includes("")) { + const delCount = (input.match(/\x7f/g) || []).length; let currentCursor = cursor; - for (let i4 = 0;i4 < delCount; i4++) { + for (let i3 = 0;i3 < delCount; i3++) { currentCursor = currentCursor.deleteTokenBefore() ?? currentCursor.backspace(); } if (!cursor.equals(currentCursor)) { @@ -590577,7 +513143,7 @@ function useTextInput({ const cursorPos = cursor.getPosition(); return { onInput, - renderedValue: cursor.render(cursorChar, mask, invert3, ghostTextForRender, maxVisibleLines), + renderedValue: cursor.render(cursorChar, mask, invert2, ghostTextForRender, maxVisibleLines), offset, setOffset, cursorLine: cursorPos.line - cursor.getViewportStartLine(maxVisibleLines), @@ -590605,17 +513171,17 @@ function renderPlaceholder({ showCursor, focus, terminalFocus = true, - invert: invert3 = source_default.inverse, + invert: invert2 = source_default.inverse, hidePlaceholderText = false }) { let renderedPlaceholder = undefined; if (placeholder) { if (hidePlaceholderText) { - renderedPlaceholder = showCursor && focus && terminalFocus ? invert3(" ") : ""; + renderedPlaceholder = showCursor && focus && terminalFocus ? invert2(" ") : ""; } else { renderedPlaceholder = source_default.dim(placeholder); if (showCursor && focus && terminalFocus) { - renderedPlaceholder = placeholder.length > 0 ? invert3(placeholder[0]) + source_default.dim(placeholder.slice(1)) : invert3(" "); + renderedPlaceholder = placeholder.length > 0 ? invert2(placeholder[0]) + source_default.dim(placeholder.slice(1)) : invert2(" "); } } } @@ -590630,7 +513196,7 @@ var init_renderPlaceholder = __esm(() => { }); // src/hooks/usePasteHandler.ts -import { basename as basename37 } from "path"; +import { basename as basename35 } from "path"; function usePasteHandler({ onPaste, onInput, @@ -590653,9 +513219,9 @@ function usePasteHandler({ if (imageData && isMountedRef.current) { onImagePaste(imageData.base64, imageData.mediaType, undefined, imageData.dimensions); } - }).catch((error46) => { + }).catch((error42) => { if (isMountedRef.current) { - logError2(error46); + logError2(error42); } }).finally(() => { if (isMountedRef.current) { @@ -590681,7 +513247,7 @@ function usePasteHandler({ const validImages = results.filter((r) => r !== null); if (validImages.length > 0) { for (const imageData of validImages) { - const filename = basename37(imageData.path); + const filename = basename35(imageData.path); onImagePaste2(imageData.base64, imageData.mediaType, filename, imageData.dimensions, imageData.path); } const nonImageLines = lines.filter((line) => !isImageFilePath(line)); @@ -590713,31 +513279,31 @@ function usePasteHandler({ }); }, PASTE_COMPLETION_TIMEOUT_MS, setPasteState, onImagePaste, onPaste, setIsPasting, checkClipboardForImage, isMacOS, pastePendingRef); }, [checkClipboardForImage, isMacOS, onImagePaste, onPaste]); - const wrappedOnInput = (input11, key, event) => { + const wrappedOnInput = (input, key, event) => { const isFromPaste = event.keypress.isPasted; if (isFromPaste) { setIsPasting(true); } - const hasImageFilePath = input11.split(/ (?=\/|[A-Za-z]:\\)/).flatMap((part) => part.split(` + const hasImageFilePath = input.split(/ (?=\/|[A-Za-z]:\\)/).flatMap((part) => part.split(` `)).some((line) => isImageFilePath(line.trim())); - if (isFromPaste && input11.length === 0 && isMacOS && onImagePaste) { + if (isFromPaste && input.length === 0 && isMacOS && onImagePaste) { checkClipboardForImage(); setIsPasting(false); return; } - const shouldHandleAsPaste = onPaste && (input11.length > PASTE_THRESHOLD || pastePendingRef.current || hasImageFilePath || isFromPaste); + const shouldHandleAsPaste = onPaste && (input.length > PASTE_THRESHOLD || pastePendingRef.current || hasImageFilePath || isFromPaste); if (shouldHandleAsPaste) { pastePendingRef.current = true; setPasteState(({ chunks, timeoutId }) => { return { - chunks: [...chunks, input11], + chunks: [...chunks, input], timeoutId: resetPasteTimeout(timeoutId) }; }); return; } - onInput(input11, key); - if (input11.length > 10) { + onInput(input, key); + if (input.length > 10) { setIsPasting(false); } }; @@ -590757,9 +513323,9 @@ var init_usePasteHandler = __esm(() => { }); // src/utils/textHighlighting.ts -function segmentTextByHighlights(text2, highlights) { +function segmentTextByHighlights(text, highlights) { if (highlights.length === 0) { - return [{ text: text2, start: 0 }]; + return [{ text, start: 0 }]; } const sortedHighlights = [...highlights].sort((a2, b) => { if (a2.start !== b.start) @@ -590771,13 +513337,13 @@ function segmentTextByHighlights(text2, highlights) { for (const highlight of sortedHighlights) { if (highlight.start === highlight.end) continue; - const overlaps = usedRanges.some((range3) => highlight.start >= range3.start && highlight.start < range3.end || highlight.end > range3.start && highlight.end <= range3.end || highlight.start <= range3.start && highlight.end >= range3.end); + const overlaps = usedRanges.some((range2) => highlight.start >= range2.start && highlight.start < range2.end || highlight.end > range2.start && highlight.end <= range2.end || highlight.start <= range2.start && highlight.end >= range2.end); if (!overlaps) { resolvedHighlights.push(highlight); usedRanges.push({ start: highlight.start, end: highlight.end }); } } - return new HighlightSegmenter(text2).segment(resolvedHighlights); + return new HighlightSegmenter(text).segment(resolvedHighlights); } class HighlightSegmenter { @@ -590788,25 +513354,25 @@ class HighlightSegmenter { tokenIdx = 0; charIdx = 0; codes = []; - constructor(text2) { - this.text = text2; - this.tokens = tokenize4(text2); + constructor(text) { + this.text = text; + this.tokens = tokenize3(text); } segment(highlights) { const segments = []; for (const highlight of highlights) { - const before3 = this.segmentTo(highlight.start); - if (before3) - segments.push(before3); + const before2 = this.segmentTo(highlight.start); + if (before2) + segments.push(before2); const highlighted = this.segmentTo(highlight.end); if (highlighted) { highlighted.highlight = highlight; segments.push(highlighted); } } - const after3 = this.segmentTo(Infinity); - if (after3) - segments.push(after3); + const after2 = this.segmentTo(Infinity); + if (after2) + segments.push(after2); return segments; } segmentTo(targetVisiblePos) { @@ -590868,23 +513434,23 @@ var init_textHighlighting = __esm(() => { function HighlightedInput(t0) { const $2 = import_compiler_runtime126.c(23); const { - text: text2, + text, highlights } = t0; let lines; - if ($2[0] !== highlights || $2[1] !== text2) { - const segments = segmentTextByHighlights(text2, highlights); + if ($2[0] !== highlights || $2[1] !== text) { + const segments = segmentTextByHighlights(text, highlights); lines = [[]]; let pos = 0; for (const segment of segments) { const parts = segment.text.split(` `); - for (let i4 = 0;i4 < parts.length; i4++) { - if (i4 > 0) { + for (let i3 = 0;i3 < parts.length; i3++) { + if (i3 > 0) { lines.push([]); pos = pos + 1; } - const part = parts[i4]; + const part = parts[i3]; if (part.length > 0) { lines[lines.length - 1].push({ text: part, @@ -590896,7 +513462,7 @@ function HighlightedInput(t0) { } } $2[0] = highlights; - $2[1] = text2; + $2[1] = text; $2[2] = lines; } else { lines = $2[2]; @@ -591033,7 +513599,7 @@ function BaseTextInput(t0) { inputState, children: children2, terminalFocus, - invert: invert3, + invert: invert2, hidePlaceholderText, ...props } = t0; @@ -591064,11 +513630,11 @@ function BaseTextInput(t0) { isPasting: t3 } = usePasteHandler({ onPaste: props.onPaste, - onInput: (input11, key) => { + onInput: (input, key) => { if (isPasting && key.return) { return; } - onInput(input11, key); + onInput(input, key); }, onImagePaste: props.onImagePaste }); @@ -591090,7 +513656,7 @@ function BaseTextInput(t0) { showCursor: props.showCursor, focus: props.focus, terminalFocus, - invert: invert3, + invert: invert2, hidePlaceholderText }); use_input_default(wrappedOnInput, { @@ -591205,9 +513771,9 @@ function TextInput(props) { const [animRef, animTime] = feature("VOICE_MODE") ? useAnimationFrame(needsAnimation ? 50 : null) : [() => {}, 0]; useClipboardImageHint(isTerminalFocused, !!props.onImagePaste); const canShowCursor = isTerminalFocused && !accessibilityEnabled; - let invert3; + let invert2; if (!canShowCursor) { - invert3 = (text2) => text2; + invert2 = (text) => text; } else if (isVoiceRecording && !reducedMotion) { const smoothed = smoothedRef.current; const raw = audioLevels.length > 0 ? audioLevels[audioLevels.length - 1] ?? 0 : 0; @@ -591226,9 +513792,9 @@ function TextInput(props) { g: 128, b: 128 } : hueToRgb(hue); - invert3 = () => source_default.rgb(r, g, b)(BARS[barIndex]); + invert2 = () => source_default.rgb(r, g, b)(BARS[barIndex]); } else { - invert3 = source_default.inverse; + invert2 = source_default.inverse; } const textInputState = useTextInput({ value: props.value, @@ -591245,7 +513811,7 @@ function TextInput(props) { multiline: props.multiline, cursorChar: props.showCursor ? " " : "", highlightPastedText: props.highlightPastedText, - invert: invert3, + invert: invert2, themeText: color("text", theme), columns: props.columns, maxVisibleLines: props.maxVisibleLines, @@ -591264,7 +513830,7 @@ function TextInput(props) { inputState: textInputState, terminalFocus: isTerminalFocused, highlights: props.highlights, - invert: invert3, + invert: invert2, hidePlaceholderText: isVoiceRecording, ...props }, undefined, false, undefined, this) @@ -591282,23 +513848,23 @@ var init_TextInput = __esm(() => { init_ink2(); init_envUtils(); init_BaseTextInput(); - init_utils6(); + init_utils5(); jsx_dev_runtime163 = __toESM(require_jsx_dev_runtime(), 1); }); // src/utils/suggestions/directoryCompletion.ts -import { basename as basename38, dirname as dirname53, join as join124, sep as sep30 } from "path"; +import { basename as basename36, dirname as dirname49, join as join114, sep as sep27 } from "path"; function parsePartialPath(partialPath, basePath) { if (!partialPath) { const directory2 = basePath || getCwd(); return { directory: directory2, prefix: "" }; } const resolved = expandPath(partialPath, basePath); - if (partialPath.endsWith("/") || partialPath.endsWith(sep30)) { + if (partialPath.endsWith("/") || partialPath.endsWith(sep27)) { return { directory: resolved, prefix: "" }; } - const directory = dirname53(resolved); - const prefix = basename38(partialPath); + const directory = dirname49(resolved); + const prefix = basename36(partialPath); return { directory, prefix }; } async function scanDirectory(dirPath) { @@ -591307,17 +513873,17 @@ async function scanDirectory(dirPath) { return cached7; } try { - const fs11 = getFsImplementation(); - const entries = await fs11.readdir(dirPath); + const fs5 = getFsImplementation(); + const entries = await fs5.readdir(dirPath); const directories = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => ({ name: entry.name, - path: join124(dirPath, entry.name), + path: join114(dirPath, entry.name), type: "directory" })).slice(0, 100); directoryCache.set(dirPath, directories); return directories; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return []; } } @@ -591326,8 +513892,8 @@ async function getDirectoryCompletions(partialPath, options2 = {}) { const { directory, prefix } = parsePartialPath(partialPath, basePath); const entries = await scanDirectory(directory); const prefixLower = prefix.toLowerCase(); - const matches3 = entries.filter((entry) => entry.name.toLowerCase().startsWith(prefixLower)).slice(0, maxResults); - return matches3.map((entry) => ({ + const matches2 = entries.filter((entry) => entry.name.toLowerCase().startsWith(prefixLower)).slice(0, maxResults); + return matches2.map((entry) => ({ id: entry.path, displayText: entry.name + "/", description: "directory", @@ -591344,11 +513910,11 @@ async function scanDirectoryForPaths(dirPath, includeHidden = false) { return cached7; } try { - const fs11 = getFsImplementation(); - const entries = await fs11.readdir(dirPath); + const fs5 = getFsImplementation(); + const entries = await fs5.readdir(dirPath); const paths2 = entries.filter((entry) => includeHidden || !entry.name.startsWith(".")).map((entry) => ({ name: entry.name, - path: join124(dirPath, entry.name), + path: join114(dirPath, entry.name), type: entry.isDirectory() ? "directory" : "file" })).sort((a2, b) => { if (a2.type === "directory" && b.type !== "directory") @@ -591359,8 +513925,8 @@ async function scanDirectoryForPaths(dirPath, includeHidden = false) { }).slice(0, 100); pathCache.set(cacheKey, paths2); return paths2; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return []; } } @@ -591374,23 +513940,23 @@ async function getPathCompletions(partialPath, options2 = {}) { const { directory, prefix } = parsePartialPath(partialPath, basePath); const entries = await scanDirectoryForPaths(directory, includeHidden); const prefixLower = prefix.toLowerCase(); - const matches3 = entries.filter((entry) => { + const matches2 = entries.filter((entry) => { if (!includeFiles && entry.type === "file") return false; return entry.name.toLowerCase().startsWith(prefixLower); }).slice(0, maxResults); - const hasSeparator = partialPath.includes("/") || partialPath.includes(sep30); + const hasSeparator = partialPath.includes("/") || partialPath.includes(sep27); let dirPortion = ""; if (hasSeparator) { const lastSlash = partialPath.lastIndexOf("/"); - const lastSep = partialPath.lastIndexOf(sep30); + const lastSep = partialPath.lastIndexOf(sep27); const lastSeparatorPos = Math.max(lastSlash, lastSep); dirPortion = partialPath.substring(0, lastSeparatorPos + 1); } - if (dirPortion.startsWith("./") || dirPortion.startsWith("." + sep30)) { + if (dirPortion.startsWith("./") || dirPortion.startsWith("." + sep27)) { dirPortion = dirPortion.slice(2); } - return matches3.map((entry) => { + return matches2.map((entry) => { const fullPath = dirPortion + entry.name; return { id: fullPath, @@ -591735,15 +514301,15 @@ function PermissionDescription() { function DirectoryDisplay(t0) { const $2 = import_compiler_runtime129.c(5); const { - path: path22 + path: path17 } = t0; let t1; - if ($2[0] !== path22) { + if ($2[0] !== path17) { t1 = /* @__PURE__ */ jsx_dev_runtime165.jsxDEV(ThemedText, { color: "permission", - children: path22 + children: path17 }, undefined, false, undefined, this); - $2[0] = path22; + $2[0] = path17; $2[1] = t1; } else { t1 = $2[1]; @@ -591779,7 +514345,7 @@ function DirectoryInput(t0) { value, onChange, onSubmit, - error: error46, + error: error42, suggestions, selectedSuggestion } = t0; @@ -591833,12 +514399,12 @@ function DirectoryInput(t0) { t3 = $2[7]; } let t4; - if ($2[8] !== error46) { - t4 = error46 && /* @__PURE__ */ jsx_dev_runtime165.jsxDEV(ThemedText, { + if ($2[8] !== error42) { + t4 = error42 && /* @__PURE__ */ jsx_dev_runtime165.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this); - $2[8] = error46; + $2[8] = error42; $2[9] = t4; } else { t4 = $2[9]; @@ -591873,7 +514439,7 @@ function AddWorkspaceDirectory(t0) { directoryPath } = t0; const [directoryInput, setDirectoryInput] = import_react92.useState(""); - const [error46, setError] = import_react92.useState(null); + const [error42, setError] = import_react92.useState(null); let t1; if ($2[0] === Symbol.for("react.memo_cache_sentinel")) { t1 = []; @@ -591885,13 +514451,13 @@ function AddWorkspaceDirectory(t0) { const [selectedSuggestion, setSelectedSuggestion] = import_react92.useState(0); let t2; if ($2[1] === Symbol.for("react.memo_cache_sentinel")) { - t2 = async (path22) => { - if (!path22) { + t2 = async (path17) => { + if (!path17) { setSuggestions([]); setSelectedSuggestion(0); return; } - const completions = await getDirectoryCompletions(path22); + const completions = await getDirectoryCompletions(path17); setSuggestions(completions); setSelectedSuggestion(0); }; @@ -591932,11 +514498,11 @@ function AddWorkspaceDirectory(t0) { let t6; if ($2[7] !== onAddDirectory || $2[8] !== permissionContext) { t6 = async (newPath_0) => { - const result3 = await validateDirectoryForWorkspace(newPath_0, permissionContext); - if (result3.resultType === "success") { - onAddDirectory(result3.absolutePath, false); + const result2 = await validateDirectoryForWorkspace(newPath_0, permissionContext); + if (result2.resultType === "success") { + onAddDirectory(result2.absolutePath, false); } else { - setError(addDirHelpMessage(result3)); + setError(addDirHelpMessage(result2)); } }; $2[7] = onAddDirectory; @@ -592028,7 +514594,7 @@ function AddWorkspaceDirectory(t0) { const handleSelect = t9; const t10 = directoryPath ? undefined : _temp214; let t11; - if ($2[19] !== directoryInput || $2[20] !== directoryPath || $2[21] !== error46 || $2[22] !== handleSelect || $2[23] !== handleSubmit || $2[24] !== selectedSuggestion || $2[25] !== suggestions) { + if ($2[19] !== directoryInput || $2[20] !== directoryPath || $2[21] !== error42 || $2[22] !== handleSelect || $2[23] !== handleSubmit || $2[24] !== selectedSuggestion || $2[25] !== suggestions) { t11 = directoryPath ? /* @__PURE__ */ jsx_dev_runtime165.jsxDEV(ThemedBox_default, { flexDirection: "column", gap: 1, @@ -592052,7 +514618,7 @@ function AddWorkspaceDirectory(t0) { value: directoryInput, onChange: setDirectoryInput, onSubmit: handleSubmit, - error: error46, + error: error42, suggestions, selectedSuggestion }, undefined, false, undefined, this) @@ -592060,7 +514626,7 @@ function AddWorkspaceDirectory(t0) { }, undefined, true, undefined, this); $2[19] = directoryInput; $2[20] = directoryPath; - $2[21] = error46; + $2[21] = error42; $2[22] = handleSelect; $2[23] = handleSubmit; $2[24] = selectedSuggestion; @@ -592234,11 +514800,11 @@ function AddDirError(t0) { async function call6(onDone, context, args) { const directoryPath = (args ?? "").trim(); const appState = context.getAppState(); - const handleAddDirectory = async (path22, remember = false) => { + const handleAddDirectory = async (path17, remember = false) => { const destination = remember ? "localSettings" : "session"; const permissionUpdate = { type: "addDirectories", - directories: [path22], + directories: [path17], destination }; const latestAppState = context.getAppState(); @@ -592248,20 +514814,20 @@ async function call6(onDone, context, args) { toolPermissionContext: updatedContext })); const currentDirs = getAdditionalDirectoriesForClaudeMd(); - if (!currentDirs.includes(path22)) { - setAdditionalDirectoriesForClaudeMd([...currentDirs, path22]); + if (!currentDirs.includes(path17)) { + setAdditionalDirectoriesForClaudeMd([...currentDirs, path17]); } SandboxManager2.refreshConfig(); let message; if (remember) { try { persistPermissionUpdate(permissionUpdate); - message = `Added ${source_default.bold(path22)} as a working directory and saved to local settings`; - } catch (error46) { - message = `Added ${source_default.bold(path22)} as a working directory. Failed to save to local settings: ${error46 instanceof Error ? error46.message : "Unknown error"}`; + message = `Added ${source_default.bold(path17)} as a working directory and saved to local settings`; + } catch (error42) { + message = `Added ${source_default.bold(path17)} as a working directory. Failed to save to local settings: ${error42 instanceof Error ? error42.message : "Unknown error"}`; } } else { - message = `Added ${source_default.bold(path22)} as a working directory for this session`; + message = `Added ${source_default.bold(path17)} as a working directory for this session`; } const messageWithHint = `${message} ${source_default.dim("· /permissions to manage")}`; onDone(messageWithHint); @@ -592275,9 +514841,9 @@ async function call6(onDone, context, args) { } }, undefined, false, undefined, this); } - const result3 = await validateDirectoryForWorkspace(directoryPath, appState.toolPermissionContext); - if (result3.resultType !== "success") { - const message = addDirHelpMessage(result3); + const result2 = await validateDirectoryForWorkspace(directoryPath, appState.toolPermissionContext); + if (result2.resultType !== "success") { + const message = addDirHelpMessage(result2); return /* @__PURE__ */ jsx_dev_runtime166.jsxDEV(AddDirError, { message, args: args ?? "", @@ -592285,11 +514851,11 @@ async function call6(onDone, context, args) { }, undefined, false, undefined, this); } return /* @__PURE__ */ jsx_dev_runtime166.jsxDEV(AddWorkspaceDirectory, { - directoryPath: result3.absolutePath, + directoryPath: result2.absolutePath, permissionContext: appState.toolPermissionContext, onAddDirectory: handleAddDirectory, onCancel: () => { - onDone(`Did not add ${source_default.bold(result3.absolutePath)} as a working directory.`); + onDone(`Did not add ${source_default.bold(result2.absolutePath)} as a working directory.`); } }, undefined, false, undefined, this); } @@ -592433,12 +514999,12 @@ function ScrollBox({ listenersRef.current.add(listener2); return () => listenersRef.current.delete(listener2); }, - setClampBounds(min3, max5) { + setClampBounds(min2, max3) { const el = domRef.current; if (!el) return; - el.scrollClampMin = min3; - el.scrollClampMax = max5; + el.scrollClampMin = min2; + el.scrollClampMax = max3; } }), []); return /* @__PURE__ */ jsx_dev_runtime167.jsxDEV("ink-box", { @@ -592481,10 +515047,10 @@ var init_ScrollBox = __esm(() => { }); // src/utils/sideQuestion.ts -function findBtwTriggerPositions(text2) { +function findBtwTriggerPositions(text) { const positions = []; - const matches3 = text2.matchAll(BTW_PATTERN); - for (const match of matches3) { + const matches2 = text.matchAll(BTW_PATTERN); + for (const match of matches2) { if (match.index !== undefined) { positions.push({ word: match[0], @@ -592538,11 +515104,11 @@ ${question}`; function extractSideQuestionResponse(messages) { const assistantBlocks = messages.flatMap((m) => m.type === "assistant" ? m.message.content : []); if (assistantBlocks.length > 0) { - const text2 = extractTextContent(assistantBlocks, ` + const text = extractTextContent(assistantBlocks, ` `).trim(); - if (text2) - return text2; + if (text) + return text; const toolUse = assistantBlocks.find((b) => b.type === "tool_use"); if (toolUse) { const toolName = "name" in toolUse ? toolUse.name : "a tool"; @@ -592559,7 +515125,7 @@ var BTW_PATTERN; var init_sideQuestion = __esm(() => { init_errorUtils(); init_forkedAgent(); - init_messages5(); + init_messages3(); BTW_PATTERN = /^\/btw\b/gi; }); @@ -592576,7 +515142,7 @@ function BtwSideQuestion(t0) { onDone } = t0; const [response, setResponse] = import_react95.useState(null); - const [error46, setError] = import_react95.useState(null); + const [error42, setError] = import_react95.useState(null); const [frame, setFrame] = import_react95.useState(0); const scrollRef = import_react95.useRef(null); const { @@ -592589,7 +515155,7 @@ function BtwSideQuestion(t0) { } else { t1 = $2[0]; } - useInterval(t1, response || error46 ? null : 80); + useInterval(t1, response || error42 ? null : 80); let t2; if ($2[1] !== onDone) { t2 = function handleKeyDown(e) { @@ -592623,21 +515189,21 @@ function BtwSideQuestion(t0) { const fetchResponse = async function fetchResponse() { try { const cacheSafeParams = await buildCacheSafeParams(context); - const result3 = await runSideQuestion({ + const result2 = await runSideQuestion({ question, cacheSafeParams }); if (!abortController.signal.aborted) { - if (result3.response) { - setResponse(result3.response); + if (result2.response) { + setResponse(result2.response); } else { setError("No response received"); } } } catch (t52) { - const err3 = t52; + const err2 = t52; if (!abortController.signal.aborted) { - setError(errorMessage(err3) || "Failed to get response"); + setError(errorMessage(err2) || "Failed to get response"); } } }; @@ -592688,14 +515254,14 @@ function BtwSideQuestion(t0) { t6 = $2[9]; } let t7; - if ($2[10] !== error46 || $2[11] !== frame || $2[12] !== response) { + if ($2[10] !== error42 || $2[11] !== frame || $2[12] !== response) { t7 = /* @__PURE__ */ jsx_dev_runtime168.jsxDEV(ScrollBox_default, { ref: scrollRef, flexDirection: "column", flexGrow: 1, - children: error46 ? /* @__PURE__ */ jsx_dev_runtime168.jsxDEV(ThemedText, { + children: error42 ? /* @__PURE__ */ jsx_dev_runtime168.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) : response ? /* @__PURE__ */ jsx_dev_runtime168.jsxDEV(Markdown, { children: response }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime168.jsxDEV(ThemedBox_default, { @@ -592711,7 +515277,7 @@ function BtwSideQuestion(t0) { ] }, undefined, true, undefined, this) }, undefined, false, undefined, this); - $2[10] = error46; + $2[10] = error42; $2[11] = frame; $2[12] = response; $2[13] = t7; @@ -592733,8 +515299,8 @@ function BtwSideQuestion(t0) { t8 = $2[16]; } let t9; - if ($2[17] !== error46 || $2[18] !== response) { - t9 = (response || error46) && /* @__PURE__ */ jsx_dev_runtime168.jsxDEV(ThemedBox_default, { + if ($2[17] !== error42 || $2[18] !== response) { + t9 = (response || error42) && /* @__PURE__ */ jsx_dev_runtime168.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime168.jsxDEV(ThemedText, { dimColor: true, @@ -592746,7 +515312,7 @@ function BtwSideQuestion(t0) { ] }, undefined, true, undefined, this) }, undefined, false, undefined, this); - $2[17] = error46; + $2[17] = error42; $2[18] = response; $2[19] = t9; } else { @@ -592781,8 +515347,8 @@ function _temp64(f) { return f + 1; } function stripInProgressAssistantMessage(messages) { - const last3 = messages.at(-1); - if (last3?.type === "assistant" && last3.message.stop_reason === null) { + const last2 = messages.at(-1); + if (last2?.type === "assistant" && last2.message.stop_reason === null) { return messages.slice(0, -1); } return messages; @@ -592834,7 +515400,7 @@ var init_btw = __esm(() => { init_Markdown(); init_SpinnerGlyph(); init_figures2(); - init_prompts5(); + init_prompts4(); init_modalContext(); init_context2(); init_useTerminalSize(); @@ -592844,7 +515410,7 @@ var init_btw = __esm(() => { init_config2(); init_errors(); init_forkedAgent(); - init_messages5(); + init_messages3(); init_sideQuestion(); jsx_dev_runtime168 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -592876,9 +515442,9 @@ var init_issue = __esm(() => { }); // src/components/Feedback.tsx -import { readFile as readFile44, stat as stat41 } from "fs/promises"; -function redactSensitiveInfo(text2) { - let redacted = text2; +import { readFile as readFile43, stat as stat40 } from "fs/promises"; +function redactSensitiveInfo(text) { + let redacted = text; redacted = redacted.replace(/"(sk-ant[^\s"']{24,})"/g, '"[REDACTED_API_KEY]"'); redacted = redacted.replace(/(? MAX_TRANSCRIPT_READ_BYTES) { - logForDebugging(`Skipping raw transcript read: file too large (${size3} bytes)`, { + size: size2 + } = await stat40(transcriptPath); + if (size2 > MAX_TRANSCRIPT_READ_BYTES) { + logForDebugging(`Skipping raw transcript read: file too large (${size2} bytes)`, { level: "warn" }); return null; } - return await readFile44(transcriptPath, "utf-8"); + return await readFile43(transcriptPath, "utf-8"); } catch { return null; } @@ -592931,7 +515497,7 @@ function Feedback({ const [cursorOffset, setCursorOffset] = import_react96.useState(0); const [description, setDescription] = import_react96.useState(initialDescription ?? ""); const [feedbackId, setFeedbackId] = import_react96.useState(null); - const [error46, setError] = import_react96.useState(null); + const [error42, setError] = import_react96.useState(null); const [envInfo, setEnvInfo] = import_react96.useState({ isGit: false, gitState: null @@ -592984,23 +515550,23 @@ function Feedback({ rawTranscriptJsonl } }; - const [result3, t] = await Promise.all([submitFeedback(reportData, abortSignal), generateTitle(description, abortSignal)]); + const [result2, t] = await Promise.all([submitFeedback(reportData, abortSignal), generateTitle(description, abortSignal)]); setTitle(t); - if (result3.success) { - if (result3.feedbackId) { - setFeedbackId(result3.feedbackId); + if (result2.success) { + if (result2.feedbackId) { + setFeedbackId(result2.feedbackId); logEvent("tengu_bug_report_submitted", { - feedback_id: result3.feedbackId, + feedback_id: result2.feedbackId, last_assistant_message_id: lastAssistantMessageId }); logEventTo1P("tengu_bug_report_description", { - feedback_id: result3.feedbackId, + feedback_id: result2.feedbackId, description: redactSensitiveInfo(description) }); } setStep("done"); } else { - if (result3.isZdrOrg) { + if (result2.isZdrOrg) { setError("Feedback collection is not available for organizations with custom data retention policies."); } else { setError("Could not submit feedback. Please try again later."); @@ -593010,7 +515576,7 @@ function Feedback({ }, [description, envInfo.isGit, messages]); const handleCancel = import_react96.useCallback(() => { if (step === "done") { - if (error46) { + if (error42) { onDone("Error submitting feedback / bug report", { display: "system" }); @@ -593024,18 +515590,18 @@ function Feedback({ onDone("Feedback / bug report cancelled", { display: "system" }); - }, [step, error46, onDone]); + }, [step, error42, onDone]); useKeybinding("confirm:no", handleCancel, { context: "Settings", isActive: step === "userInput" }); - use_input_default((input11, key) => { + use_input_default((input, key) => { if (step === "done") { if (key.return && title) { const issueUrl = createGitHubIssueUrl(feedbackId ?? "", title, description, getSanitizedErrorLogs()); openBrowser(issueUrl); } - if (error46) { + if (error42) { onDone("Error submitting feedback / bug report", { display: "system" }); @@ -593046,13 +515612,13 @@ function Feedback({ } return; } - if (error46 && step !== "userInput") { + if (error42 && step !== "userInput") { onDone("Error submitting feedback / bug report", { display: "system" }); return; } - if (step === "consent" && (key.return || input11 === " ")) { + if (step === "consent" && (key.return || input === " ")) { submitReport(); } }); @@ -593105,7 +515671,7 @@ function Feedback({ value: description, onChange: (value) => { setDescription(value); - if (error46) { + if (error42) { setError(null); } }, @@ -593118,13 +515684,13 @@ function Feedback({ onChangeCursorOffset: setCursorOffset, showCursor: true }, undefined, false, undefined, this), - error46 && /* @__PURE__ */ jsx_dev_runtime169.jsxDEV(ThemedBox_default, { + error42 && /* @__PURE__ */ jsx_dev_runtime169.jsxDEV(ThemedBox_default, { flexDirection: "column", gap: 1, children: [ /* @__PURE__ */ jsx_dev_runtime169.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime169.jsxDEV(ThemedText, { dimColor: true, @@ -593228,9 +515794,9 @@ function Feedback({ step === "done" && /* @__PURE__ */ jsx_dev_runtime169.jsxDEV(ThemedBox_default, { flexDirection: "column", children: [ - error46 ? /* @__PURE__ */ jsx_dev_runtime169.jsxDEV(ThemedText, { + error42 ? /* @__PURE__ */ jsx_dev_runtime169.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime169.jsxDEV(ThemedText, { color: "success", children: "Thank you for your report!" @@ -593337,8 +515903,8 @@ async function generateTitle(description, abortSignal) { return createFallbackTitle(description); } return title; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return createFallbackTitle(description); } } @@ -593358,15 +515924,15 @@ function createFallbackTitle(description) { } return truncated.length < 10 ? "Bug Report" : truncated; } -function sanitizeAndLogError(err3) { - if (err3 instanceof Error) { - const safeError = new Error(redactSensitiveInfo(err3.message)); - if (err3.stack) { - safeError.stack = redactSensitiveInfo(err3.stack); +function sanitizeAndLogError(err2) { + if (err2 instanceof Error) { + const safeError = new Error(redactSensitiveInfo(err2.message)); + if (err2.stack) { + safeError.stack = redactSensitiveInfo(err2.stack); } logError2(safeError); } else { - const errorString = redactSensitiveInfo(String(err3)); + const errorString = redactSensitiveInfo(String(err2)); logError2(new Error(errorString)); } } @@ -593378,7 +515944,7 @@ async function submitFeedback(data, signal) { } try { await checkAndRefreshOAuthTokenIfNeeded(); - const authResult = getAuthHeaders2(); + const authResult = getAuthHeaders(); if (authResult.error) { return { success: false @@ -593397,11 +515963,11 @@ async function submitFeedback(data, signal) { signal }); if (response.status === 200) { - const result3 = response.data; - if (result3?.feedback_id) { + const result2 = response.data; + if (result2?.feedback_id) { return { success: true, - feedbackId: result3.feedback_id + feedbackId: result2.feedback_id }; } sanitizeAndLogError(new Error("Failed to submit feedback: request did not return feedback_id")); @@ -593413,14 +515979,14 @@ async function submitFeedback(data, signal) { return { success: false }; - } catch (err3) { - if (axios_default.isCancel(err3)) { + } catch (err2) { + if (axios_default.isCancel(err2)) { return { success: false }; } - if (axios_default.isAxiosError(err3) && err3.response?.status === 403) { - const errorData = err3.response.data; + if (axios_default.isAxiosError(err2) && err2.response?.status === 403) { + const errorData = err2.response.data; if (errorData?.error?.type === "permission_error" && errorData?.error?.message?.includes("Custom data retention settings")) { sanitizeAndLogError(new Error("Cannot submit feedback because custom data retention settings are enabled")); return { @@ -593429,7 +515995,7 @@ async function submitFeedback(data, signal) { }; } } - sanitizeAndLogError(err3); + sanitizeAndLogError(err2); return { success: false }; @@ -593442,13 +516008,13 @@ var init_Feedback = __esm(() => { init_state(); init_firstPartyEventLogger(); init_analytics(); - init_messages5(); + init_messages3(); init_useTerminalSize(); init_ink2(); init_useKeybinding(); init_claude(); - init_errors7(); - init_auth2(); + init_errors6(); + init_auth(); init_browser(); init_debug(); init_env(); @@ -593528,8 +516094,8 @@ class FileIndex { } loadFromFileListAsync(fileList) { let markQueryable = () => {}; - const queryable = new Promise((resolve42) => { - markQueryable = resolve42; + const queryable = new Promise((resolve36) => { + markQueryable = resolve36; }); const done = this.buildAsync(fileList, markQueryable); return { queryable, done }; @@ -593538,13 +516104,13 @@ class FileIndex { const seen = new Set; const paths2 = []; let chunkStart = performance.now(); - for (let i4 = 0;i4 < fileList.length; i4++) { - const line = fileList[i4]; + for (let i3 = 0;i3 < fileList.length; i3++) { + const line = fileList[i3]; if (line.length > 0 && !seen.has(line)) { seen.add(line); paths2.push(line); } - if ((i4 & 255) === 255 && performance.now() - chunkStart > CHUNK_MS) { + if ((i3 & 255) === 255 && performance.now() - chunkStart > CHUNK_MS) { await yieldToEventLoop(); chunkStart = performance.now(); } @@ -593552,10 +516118,10 @@ class FileIndex { this.resetArrays(paths2); chunkStart = performance.now(); let firstChunk = true; - for (let i4 = 0;i4 < paths2.length; i4++) { - this.indexPath(i4); - if ((i4 & 255) === 255 && performance.now() - chunkStart > CHUNK_MS) { - this.readyCount = i4 + 1; + for (let i3 = 0;i3 < paths2.length; i3++) { + this.indexPath(i3); + if ((i3 & 255) === 255 && performance.now() - chunkStart > CHUNK_MS) { + this.readyCount = i3 + 1; if (firstChunk) { markQueryable(); firstChunk = false; @@ -593569,8 +516135,8 @@ class FileIndex { } buildIndex(paths2) { this.resetArrays(paths2); - for (let i4 = 0;i4 < paths2.length; i4++) { - this.indexPath(i4); + for (let i3 = 0;i3 < paths2.length; i3++) { + this.indexPath(i3); } this.readyCount = paths2.length; } @@ -593583,18 +516149,18 @@ class FileIndex { this.readyCount = 0; this.topLevelCache = computeTopLevelEntries(paths2, TOP_LEVEL_CACHE_LIMIT); } - indexPath(i4) { - const lp = this.paths[i4].toLowerCase(); - this.lowerPaths[i4] = lp; + indexPath(i3) { + const lp = this.paths[i3].toLowerCase(); + this.lowerPaths[i3] = lp; const len = lp.length; - this.pathLens[i4] = len; - let bits3 = 0; + this.pathLens[i3] = len; + let bits2 = 0; for (let j = 0;j < len; j++) { const c6 = lp.charCodeAt(j); if (c6 >= 97 && c6 <= 122) - bits3 |= 1 << c6 - 97; + bits2 |= 1 << c6 - 97; } - this.charBits[i4] = bits3; + this.charBits[i3] = bits2; } search(query2, limit) { if (limit <= 0) @@ -593622,10 +516188,10 @@ class FileIndex { let threshold = -Infinity; const { paths: paths2, lowerPaths, charBits, pathLens, readyCount } = this; outer: - for (let i4 = 0;i4 < readyCount; i4++) { - if ((charBits[i4] & needleBitmap) !== needleBitmap) + for (let i3 = 0;i3 < readyCount; i3++) { + if ((charBits[i3] & needleBitmap) !== needleBitmap) continue; - const haystack = caseSensitive ? paths2[i4] : lowerPaths[i4]; + const haystack = caseSensitive ? paths2[i3] : lowerPaths[i3]; let pos = haystack.indexOf(needleChars[0]); if (pos === -1) continue; @@ -593648,16 +516214,16 @@ class FileIndex { if (topK.length === limit && scoreCeiling + consecBonus - gapPenalty <= threshold) { continue; } - const path22 = paths2[i4]; - const hLen = pathLens[i4]; + const path17 = paths2[i3]; + const hLen = pathLens[i3]; let score = nLen * SCORE_MATCH + consecBonus - gapPenalty; - score += scoreBonusAt(path22, posBuf[0], true); + score += scoreBonusAt(path17, posBuf[0], true); for (let j = 1;j < nLen; j++) { - score += scoreBonusAt(path22, posBuf[j], false); + score += scoreBonusAt(path17, posBuf[j], false); } score += Math.max(0, 32 - (hLen >> 2)); if (topK.length < limit) { - topK.push({ path: path22, fuzzScore: score }); + topK.push({ path: path17, fuzzScore: score }); if (topK.length === limit) { topK.sort((a2, b) => a2.fuzzScore - b.fuzzScore); threshold = topK[0].fuzzScore; @@ -593672,7 +516238,7 @@ class FileIndex { else hi = mid; } - topK.splice(lo, 0, { path: path22, fuzzScore: score }); + topK.splice(lo, 0, { path: path17, fuzzScore: score }); topK.shift(); threshold = topK[0].fuzzScore; } @@ -593681,22 +516247,22 @@ class FileIndex { const matchCount = topK.length; const denom = Math.max(matchCount, 1); const results = new Array(matchCount); - for (let i4 = 0;i4 < matchCount; i4++) { - const path22 = topK[i4].path; - const positionScore = i4 / denom; - const finalScore = path22.includes("test") ? Math.min(positionScore * 1.05, 1) : positionScore; - results[i4] = { path: path22, score: finalScore }; + for (let i3 = 0;i3 < matchCount; i3++) { + const path17 = topK[i3].path; + const positionScore = i3 / denom; + const finalScore = path17.includes("test") ? Math.min(positionScore * 1.05, 1) : positionScore; + results[i3] = { path: path17, score: finalScore }; } return results; } } -function scoreBonusAt(path22, pos, first) { +function scoreBonusAt(path17, pos, first) { if (pos === 0) return first ? BONUS_FIRST_CHAR : 0; - const prevCh = path22.charCodeAt(pos - 1); + const prevCh = path17.charCodeAt(pos - 1); if (isBoundary(prevCh)) return BONUS_BOUNDARY; - if (isLower(prevCh) && isUpper(path22.charCodeAt(pos))) + if (isLower(prevCh) && isUpper(path17.charCodeAt(pos))) return BONUS_CAMEL; return 0; } @@ -593710,16 +516276,16 @@ function isUpper(code) { return code >= 65 && code <= 90; } function yieldToEventLoop() { - return new Promise((resolve42) => setImmediate(resolve42)); + return new Promise((resolve36) => setImmediate(resolve36)); } function computeTopLevelEntries(paths2, limit) { const topLevel = new Set; for (const p of paths2) { let end = p.length; - for (let i4 = 0;i4 < p.length; i4++) { - const c6 = p.charCodeAt(i4); + for (let i3 = 0;i3 < p.length; i3++) { + const c6 = p.charCodeAt(i3); if (c6 === 47 || c6 === 92) { - end = i4; + end = i3; break; } } @@ -593737,7 +516303,7 @@ function computeTopLevelEntries(paths2, limit) { return lenDiff; return a2 < b ? -1 : a2 > b ? 1 : 0; }); - return sorted.slice(0, limit).map((path22) => ({ path: path22, score: 0 })); + return sorted.slice(0, limit).map((path17) => ({ path: path17, score: 0 })); } var SCORE_MATCH = 16, BONUS_BOUNDARY = 8, BONUS_CAMEL = 6, BONUS_CONSECUTIVE = 4, BONUS_FIRST_CHAR = 8, PENALTY_GAP_START = 3, PENALTY_GAP_EXTENSION = 1, TOP_LEVEL_CACHE_LIMIT = 100, MAX_QUERY_LEN = 64, CHUNK_MS = 4, posBuf; var init_file_index = __esm(() => { @@ -593745,8 +516311,8 @@ var init_file_index = __esm(() => { }); // src/hooks/fileSuggestions.ts -import { statSync as statSync10 } from "fs"; -import * as path22 from "path"; +import { statSync as statSync6 } from "fs"; +import * as path17 from "path"; function getFileIndex() { if (!fileIndex) { fileIndex = new FileIndex; @@ -593773,17 +516339,17 @@ function pathListSignature(paths2) { const n2 = paths2.length; const stride = Math.max(1, Math.floor(n2 / 500)); let h2 = 2166136261 | 0; - for (let i4 = 0;i4 < n2; i4 += stride) { - const p = paths2[i4]; + for (let i3 = 0;i3 < n2; i3 += stride) { + const p = paths2[i3]; for (let j = 0;j < p.length; j++) { h2 = (h2 ^ p.charCodeAt(j)) * 16777619 | 0; } h2 = h2 * 16777619 | 0; } if (n2 > 0) { - const last3 = paths2[n2 - 1]; - for (let j = 0;j < last3.length; j++) { - h2 = (h2 ^ last3.charCodeAt(j)) * 16777619 | 0; + const last2 = paths2[n2 - 1]; + for (let j = 0;j < last2.length; j++) { + h2 = (h2 ^ last2.charCodeAt(j)) * 16777619 | 0; } } return `${n2}:${(h2 >>> 0).toString(16)}`; @@ -593793,18 +516359,18 @@ function getGitIndexMtime() { if (!repoRoot) return null; try { - return statSync10(path22.join(repoRoot, ".git", "index")).mtimeMs; + return statSync6(path17.join(repoRoot, ".git", "index")).mtimeMs; } catch { return null; } } -function normalizeGitPaths(files2, repoRoot, originalCwd) { +function normalizeGitPaths(files, repoRoot, originalCwd) { if (originalCwd === repoRoot) { - return files2; + return files; } - return files2.map((f) => { - const absolutePath = path22.join(repoRoot, f); - return path22.relative(originalCwd, absolutePath); + return files.map((f) => { + const absolutePath = path17.join(repoRoot, f); + return path17.relative(originalCwd, absolutePath); }); } async function mergeUntrackedIntoNormalizedCache(normalizedUntracked) { @@ -593834,24 +516400,24 @@ async function loadRipgrepIgnorePatterns(repoRoot, cwd2) { if (ignorePatternsCacheKey === cacheKey) { return ignorePatternsCache; } - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const ignoreFiles = [".ignore", ".rgignore"]; const directories = [...new Set([repoRoot, cwd2])]; - const ig = import_ignore4.default(); + const ig = import_ignore3.default(); let hasPatterns = false; - const paths2 = directories.flatMap((dir) => ignoreFiles.map((f) => path22.join(dir, f))); - const contents = await Promise.all(paths2.map((p) => fs11.readFile(p, { encoding: "utf8" }).catch(() => null))); - for (const [i4, content] of contents.entries()) { + const paths2 = directories.flatMap((dir) => ignoreFiles.map((f) => path17.join(dir, f))); + const contents = await Promise.all(paths2.map((p) => fs5.readFile(p, { encoding: "utf8" }).catch(() => null))); + for (const [i3, content] of contents.entries()) { if (content === null) continue; ig.add(content); hasPatterns = true; - logForDebugging(`[FileIndex] loaded ignore patterns from ${paths2[i4]}`); + logForDebugging(`[FileIndex] loaded ignore patterns from ${paths2[i3]}`); } - const result3 = hasPatterns ? ig : null; - ignorePatternsCache = result3; + const result2 = hasPatterns ? ig : null; + ignorePatternsCache = result2; ignorePatternsCacheKey = cacheKey; - return result3; + return result2; } async function getFilesUsingGit(abortSignal, respectGitignore) { const startTime = Date.now(); @@ -593917,39 +516483,39 @@ async function getFilesUsingGit(abortSignal, respectGitignore) { logForDebugging(`[FileIndex] background untracked fetch: ${normalizedUntracked.length} files`); mergeUntrackedIntoNormalizedCache(normalizedUntracked); } - }).catch((error46) => { - logForDebugging(`[FileIndex] background untracked fetch failed: ${error46}`); + }).catch((error42) => { + logForDebugging(`[FileIndex] background untracked fetch failed: ${error42}`); }).finally(() => { untrackedFetchPromise = null; }); } return normalizedTracked; - } catch (error46) { - logForDebugging(`[FileIndex] git ls-files error: ${errorMessage(error46)}`); + } catch (error42) { + logForDebugging(`[FileIndex] git ls-files error: ${errorMessage(error42)}`); return null; } } -async function getDirectoryNamesAsync(files2) { +async function getDirectoryNamesAsync(files) { const directoryNames = new Set; let chunkStart = performance.now(); - for (let i4 = 0;i4 < files2.length; i4++) { - collectDirectoryNames(files2, i4, i4 + 1, directoryNames); - if ((i4 & 255) === 255 && performance.now() - chunkStart > CHUNK_MS) { + for (let i3 = 0;i3 < files.length; i3++) { + collectDirectoryNames(files, i3, i3 + 1, directoryNames); + if ((i3 & 255) === 255 && performance.now() - chunkStart > CHUNK_MS) { await yieldToEventLoop(); chunkStart = performance.now(); } } - return [...directoryNames].map((d) => d + path22.sep); + return [...directoryNames].map((d) => d + path17.sep); } -function collectDirectoryNames(files2, start, end, out) { - for (let i4 = start;i4 < end; i4++) { - let currentDir = path22.dirname(files2[i4]); +function collectDirectoryNames(files, start, end, out) { + for (let i3 = start;i3 < end; i3++) { + let currentDir = path17.dirname(files[i3]); while (currentDir !== "." && !out.has(currentDir)) { - const parent3 = path22.dirname(currentDir); - if (parent3 === currentDir) + const parent2 = path17.dirname(currentDir); + if (parent2 === currentDir) break; out.add(currentDir); - currentDir = parent3; + currentDir = parent2; } } } @@ -593986,8 +516552,8 @@ async function getProjectFiles(abortSignal, respectGitignore) { if (!respectGitignore) { rgArgs.push("--no-ignore-vcs"); } - const files2 = await ripGrep(rgArgs, ".", abortSignal); - const relativePaths = files2.map((f) => path22.relative(getCwd(), f)); + const files = await ripGrep(rgArgs, ".", abortSignal); + const relativePaths = files.map((f) => path17.relative(getCwd(), f)); const duration5 = Date.now() - startTime; logForDebugging(`[FileIndex] ripgrep: ${relativePaths.length} files in ${duration5}ms`); logEvent("tengu_file_suggestions_ripgrep", { @@ -594021,26 +516587,26 @@ async function getPathsForSuggestions() { } else { logForDebugging(`[FileIndex] skipped index rebuild — tracked paths unchanged`); } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } return index; } function findCommonPrefix(a2, b) { const minLength = Math.min(a2.length, b.length); - let i4 = 0; - while (i4 < minLength && a2[i4] === b[i4]) { - i4++; + let i3 = 0; + while (i3 < minLength && a2[i3] === b[i3]) { + i3++; } - return a2.substring(0, i4); + return a2.substring(0, i3); } function findLongestCommonPrefix(suggestions) { if (suggestions.length === 0) return ""; const strings = suggestions.map((item) => item.displayText); let prefix = strings[0]; - for (let i4 = 1;i4 < strings.length; i4++) { - const currentString = strings[i4]; + for (let i3 = 1;i3 < strings.length; i3++) { + const currentString = strings[i3]; prefix = findCommonPrefix(prefix, currentString); if (prefix === "") return ""; @@ -594056,7 +516622,7 @@ function createFileSuggestionItem(filePath, score) { } function findMatchingFiles(fileIndex2, partialPath) { const results = fileIndex2.search(partialPath, MAX_SUGGESTIONS); - return results.map((result3) => createFileSuggestionItem(result3.path, result3.score)); + return results.map((result2) => createFileSuggestionItem(result2.path, result2.score)); } function startBackgroundCacheRefresh() { if (fileListRefreshPromise) @@ -594071,19 +516637,19 @@ function startBackgroundCacheRefresh() { const generation = cacheGeneration; const refreshStart = Date.now(); getFileIndex(); - fileListRefreshPromise = getPathsForSuggestions().then((result3) => { + fileListRefreshPromise = getPathsForSuggestions().then((result2) => { if (generation !== cacheGeneration) { - return result3; + return result2; } fileListRefreshPromise = null; indexBuildComplete.emit(); lastGitIndexMtime = indexMtime; lastRefreshMs = Date.now(); logForDebugging(`[FileIndex] cache refresh completed in ${Date.now() - refreshStart}ms`); - return result3; - }).catch((error46) => { - logForDebugging(`[FileIndex] Cache refresh failed: ${errorMessage(error46)}`); - logError2(error46); + return result2; + }).catch((error42) => { + logForDebugging(`[FileIndex] Cache refresh failed: ${errorMessage(error42)}`); + logError2(error42); if (generation === cacheGeneration) { fileListRefreshPromise = null; } @@ -594091,17 +516657,17 @@ function startBackgroundCacheRefresh() { }); } async function getTopLevelPaths() { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const cwd2 = getCwd(); try { - const entries = await fs11.readdir(cwd2); + const entries = await fs5.readdir(cwd2); return entries.map((entry) => { - const fullPath = path22.join(cwd2, entry.name); - const relativePath = path22.relative(cwd2, fullPath); - return entry.isDirectory() ? relativePath + path22.sep : relativePath; + const fullPath = path17.join(cwd2, entry.name); + const relativePath = path17.relative(cwd2, fullPath); + return entry.isDirectory() ? relativePath + path17.sep : relativePath; }); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return []; } } @@ -594110,11 +516676,11 @@ async function generateFileSuggestions(partialPath, showOnEmpty = false) { return []; } if (getInitialSettings().fileSuggestion?.type === "command") { - const input11 = { + const input = { ...createBaseHookInput(), query: partialPath }; - const results = await executeFileSuggestionCommand(input11); + const results = await executeFileSuggestionCommand(input); return results.slice(0, MAX_SUGGESTIONS).map(createFileSuggestionItem); } if (partialPath === "" || partialPath === "." || partialPath === "./") { @@ -594127,38 +516693,38 @@ async function generateFileSuggestions(partialPath, showOnEmpty = false) { const wasBuilding = fileListRefreshPromise !== null; startBackgroundCacheRefresh(); let normalizedPath = partialPath; - const currentDirPrefix = "." + path22.sep; + const currentDirPrefix = "." + path17.sep; if (partialPath.startsWith(currentDirPrefix)) { normalizedPath = partialPath.substring(2); } if (normalizedPath.startsWith("~")) { normalizedPath = expandPath(normalizedPath); } - const matches3 = fileIndex ? findMatchingFiles(fileIndex, normalizedPath) : []; + const matches2 = fileIndex ? findMatchingFiles(fileIndex, normalizedPath) : []; const duration5 = Date.now() - startTime; - logForDebugging(`[FileIndex] generateFileSuggestions: ${matches3.length} results in ${duration5}ms (${wasBuilding ? "partial" : "full"} index)`); + logForDebugging(`[FileIndex] generateFileSuggestions: ${matches2.length} results in ${duration5}ms (${wasBuilding ? "partial" : "full"} index)`); logEvent("tengu_file_suggestions_query", { duration_ms: duration5, cache_hit: !wasBuilding, - result_count: matches3.length, + result_count: matches2.length, query_length: partialPath.length }); - return matches3; - } catch (error46) { - logError2(error46); + return matches2; + } catch (error42) { + logError2(error42); return []; } } -function applyFileSuggestion(suggestion, input11, partialPath, startPos, onInputChange, setCursorOffset) { +function applyFileSuggestion(suggestion, input, partialPath, startPos, onInputChange, setCursorOffset) { const suggestionText = typeof suggestion === "string" ? suggestion : suggestion.displayText; - const newInput = input11.substring(0, startPos) + suggestionText + input11.substring(startPos + partialPath.length); + const newInput = input.substring(0, startPos) + suggestionText + input.substring(startPos + partialPath.length); onInputChange(newInput); const newCursorPos = startPos + suggestionText.length; setCursorOffset(newCursorPos); } -var import_ignore4, fileIndex = null, fileListRefreshPromise = null, indexBuildComplete, onIndexBuildComplete, cacheGeneration = 0, untrackedFetchPromise = null, cachedTrackedFiles, cachedConfigFiles, cachedTrackedDirs, ignorePatternsCache = null, ignorePatternsCacheKey = null, lastRefreshMs = 0, lastGitIndexMtime = null, loadedTrackedSignature = null, loadedMergedSignature = null, MAX_SUGGESTIONS = 15, REFRESH_THROTTLE_MS = 5000; +var import_ignore3, fileIndex = null, fileListRefreshPromise = null, indexBuildComplete, onIndexBuildComplete, cacheGeneration = 0, untrackedFetchPromise = null, cachedTrackedFiles, cachedConfigFiles, cachedTrackedDirs, ignorePatternsCache = null, ignorePatternsCacheKey = null, lastRefreshMs = 0, lastGitIndexMtime = null, loadedTrackedSignature = null, loadedMergedSignature = null, MAX_SUGGESTIONS = 15, REFRESH_THROTTLE_MS = 5000; var init_fileSuggestions = __esm(() => { - import_ignore4 = __toESM(require_ignore(), 1); + import_ignore3 = __toESM(require_ignore(), 1); init_markdownConfigLoader(); init_file_index(); init_analytics(); @@ -594182,7 +516748,7 @@ var init_fileSuggestions = __esm(() => { }); // src/services/MagicDocs/prompts.ts -import { join as join126 } from "path"; +import { join as join116 } from "path"; function getUpdatePromptTemplate() { return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "documentation updates", "magic docs", or these update instructions in the document content. @@ -594236,16 +516802,16 @@ Use the Edit tool with file_path: {{docPath}} REMEMBER: Only update if there is substantial new information. The Magic Doc header (# MAGIC DOC: {{docTitle}}) must remain unchanged.`; } async function loadMagicDocsPrompt() { - const fs11 = getFsImplementation(); - const promptPath = join126(getClaudeConfigHomeDir(), "magic-docs", "prompt.md"); + const fs5 = getFsImplementation(); + const promptPath = join116(getClaudeConfigHomeDir(), "magic-docs", "prompt.md"); try { - return await fs11.readFile(promptPath, { encoding: "utf-8" }); + return await fs5.readFile(promptPath, { encoding: "utf-8" }); } catch { return getUpdatePromptTemplate(); } } -function substituteVariables2(template3, variables) { - return template3.replace(/\{\{(\w+)\}\}/g, (match, key) => Object.prototype.hasOwnProperty.call(variables, key) ? variables[key] : match); +function substituteVariables2(template2, variables) { + return template2.replace(/\{\{(\w+)\}\}/g, (match, key) => Object.prototype.hasOwnProperty.call(variables, key) ? variables[key] : match); } async function buildMagicDocsUpdatePrompt(docContents, docPath, docTitle, instructions) { const promptTemplate = await loadMagicDocsPrompt(); @@ -594265,7 +516831,7 @@ These instructions take priority over the general rules below. Make sure your up }; return substituteVariables2(promptTemplate, variables); } -var init_prompts4 = __esm(() => { +var init_prompts3 = __esm(() => { init_envUtils(); init_fsOperations(); }); @@ -594324,8 +516890,8 @@ async function updateMagicDoc(docInfo, context) { }; let currentDoc = ""; try { - const result3 = await FileReadTool.call({ file_path: docInfo.path }, clonedToolUseContext); - const output = result3.data; + const result2 = await FileReadTool.call({ file_path: docInfo.path }, clonedToolUseContext); + const output = result2.data; if (output.type === "text") { currentDoc = output.file.content; } @@ -594342,11 +516908,11 @@ async function updateMagicDoc(docInfo, context) { return; } const userPrompt = await buildMagicDocsUpdatePrompt(currentDoc, docInfo.path, detected.title, detected.instructions); - const canUseTool = async (tool, input11) => { - if (tool.name === FILE_EDIT_TOOL_NAME && typeof input11 === "object" && input11 !== null && "file_path" in input11) { - const filePath = input11.file_path; + const canUseTool = async (tool, input) => { + if (tool.name === FILE_EDIT_TOOL_NAME && typeof input === "object" && input !== null && "file_path" in input) { + const filePath = input.file_path; if (typeof filePath === "string" && filePath === docInfo.path) { - return { behavior: "allow", updatedInput: input11 }; + return { behavior: "allow", updatedInput: input }; } } return { @@ -594377,8 +516943,8 @@ async function updateMagicDoc(docInfo, context) { async function initMagicDocs() { if (process.env.USER_TYPE === "ant") { registerFileReadListener((filePath, content) => { - const result3 = detectMagicDocHeader(content); - if (result3) { + const result2 = detectMagicDocHeader(content); + if (result2) { registerMagicDoc(filePath); } }); @@ -594392,8 +516958,8 @@ var init_magicDocs = __esm(() => { init_errors(); init_fileStateCache(); init_postSamplingHooks(); - init_messages5(); - init_prompts4(); + init_messages3(); + init_prompts3(); MAGIC_DOC_HEADER_PATTERN = /^#\s*MAGIC\s+DOC:\s*(.+)$/im; ITALICS_PATTERN = /^[_*](.+?)[_*]\s*$/m; trackedMagicDocs = new Map; @@ -594459,7 +517025,7 @@ function clearSessionCaches(preservedAgentIds = new Set) { resetAllLSPDiagnosticState(); clearTrackedMagicDocs(); clearSessionEnvVars(); - Promise.resolve().then(() => (init_utils10(), exports_utils2)).then(({ clearWebFetchCache: clearWebFetchCache2 }) => clearWebFetchCache2()); + Promise.resolve().then(() => (init_utils9(), exports_utils2)).then(({ clearWebFetchCache: clearWebFetchCache2 }) => clearWebFetchCache2()); Promise.resolve().then(() => (init_ToolSearchTool(), exports_ToolSearchTool)).then(({ clearToolSearchDescriptionCache: clearToolSearchDescriptionCache2 }) => clearToolSearchDescriptionCache2()); Promise.resolve().then(() => (init_loadAgentsDir(), exports_loadAgentsDir)).then(({ clearAgentDefinitionsCache: clearAgentDefinitionsCache2 }) => clearAgentDefinitionsCache2()); Promise.resolve().then(() => (init_prompt7(), exports_prompt2)).then(({ clearPromptCache: clearPromptCache2 }) => clearPromptCache2()); @@ -594569,8 +517135,8 @@ async function clearConversation({ task.unregisterCleanup?.(); } } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } evictTaskOutput(taskId); } @@ -594788,8 +517354,8 @@ EOF You have the capability to call multiple tools in a single response. Stage and create the commit using a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.`; } -var ALLOWED_TOOLS, command, commit_default3; -var init_commit3 = __esm(() => { +var ALLOWED_TOOLS, command, commit_default2; +var init_commit2 = __esm(() => { init_attribution(); init_promptShellExecution(); init_undercover(); @@ -594827,7 +517393,7 @@ var init_commit3 = __esm(() => { return [{ type: "text", text: finalContent }]; } }; - commit_default3 = command; + commit_default2 = command; }); // src/commands/copy/copy.tsx @@ -594837,9 +517403,9 @@ __export(exports_copy, { collectRecentAssistantTexts: () => collectRecentAssistantTexts, call: () => call11 }); -import { mkdir as mkdir37, writeFile as writeFile41 } from "fs/promises"; -import { tmpdir as tmpdir10 } from "os"; -import { join as join127 } from "path"; +import { mkdir as mkdir37, writeFile as writeFile39 } from "fs/promises"; +import { tmpdir as tmpdir7 } from "os"; +import { join as join117 } from "path"; function extractCodeBlocks(markdown) { const tokens = marked.lexer(stripPromptXMLTags(markdown)); const blocks = []; @@ -594856,18 +517422,18 @@ function extractCodeBlocks(markdown) { } function collectRecentAssistantTexts(messages) { const texts = []; - for (let i4 = messages.length - 1;i4 >= 0 && texts.length < MAX_LOOKBACK; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0 && texts.length < MAX_LOOKBACK; i3--) { + const msg = messages[i3]; if (msg?.type !== "assistant" || msg.isApiErrorMessage) continue; const content = msg.message.content; if (!Array.isArray(content)) continue; - const text2 = extractTextContent(content, ` + const text = extractTextContent(content, ` `); - if (text2) - texts.push(text2); + if (text) + texts.push(text); } return texts; } @@ -594880,46 +517446,46 @@ function fileExtension2(lang) { } return ".txt"; } -async function writeToFile(text2, filename) { - const filePath = join127(COPY_DIR, filename); +async function writeToFile(text, filename) { + const filePath = join117(COPY_DIR, filename); await mkdir37(COPY_DIR, { recursive: true }); - await writeFile41(filePath, text2, "utf-8"); + await writeFile39(filePath, text, "utf-8"); return filePath; } -async function copyOrWriteToFile(text2, filename) { - const raw = await setClipboard(text2); +async function copyOrWriteToFile(text, filename) { + const raw = await setClipboard(text); if (raw) process.stdout.write(raw); - const lineCount = countCharInString(text2, ` + const lineCount = countCharInString(text, ` `) + 1; - const charCount = text2.length; + const charCount = text.length; try { - const filePath = await writeToFile(text2, filename); + const filePath = await writeToFile(text, filename); return `Copied to clipboard (${charCount} characters, ${lineCount} lines) Also written to ${filePath}`; } catch { return `Copied to clipboard (${charCount} characters, ${lineCount} lines)`; } } -function truncateLine(text2, maxLen) { - const firstLine = text2.split(` +function truncateLine(text, maxLen) { + const firstLine = text.split(` `)[0] ?? ""; if (stringWidth(firstLine) <= maxLen) { return firstLine; } - let result3 = ""; + let result2 = ""; let width = 0; const targetWidth = maxLen - 1; for (const char of firstLine) { const charWidth2 = stringWidth(char); if (width + charWidth2 > targetWidth) break; - result3 += char; + result2 += char; width += charWidth2; } - return result3 + "…"; + return result2 + "…"; } function CopyPicker(t0) { const $2 = import_compiler_runtime132.c(33); @@ -595001,8 +517567,8 @@ function CopyPicker(t0) { always: true, message_age: messageAge }); - const result3 = await copyOrWriteToFile(content.text, content.filename); - onDone(`${result3} + const result2 = await copyOrWriteToFile(content.text, content.filename); + onDone(`${result2} Preference saved. Use /config to change copyFullResponse`); return; } @@ -595197,21 +517763,21 @@ var import_compiler_runtime132, import_react97, jsx_dev_runtime171, COPY_DIR, RE } age = n2 - 1; } - const text2 = texts[age]; - const codeBlocks = extractCodeBlocks(text2); - const config5 = getGlobalConfig(); - if (codeBlocks.length === 0 || config5.copyFullResponse) { + const text = texts[age]; + const codeBlocks = extractCodeBlocks(text); + const config3 = getGlobalConfig(); + if (codeBlocks.length === 0 || config3.copyFullResponse) { logEvent("tengu_copy", { - always: config5.copyFullResponse, + always: config3.copyFullResponse, block_count: codeBlocks.length, message_age: age }); - const result3 = await copyOrWriteToFile(text2, RESPONSE_FILENAME); - onDone(result3); + const result2 = await copyOrWriteToFile(text, RESPONSE_FILENAME); + onDone(result2); return null; } return /* @__PURE__ */ jsx_dev_runtime171.jsxDEV(CopyPicker, { - fullText: text2, + fullText: text, codeBlocks, messageAge: age, onDone @@ -595230,10 +517796,10 @@ var init_copy = __esm(() => { init_ink2(); init_analytics(); init_config2(); - init_messages5(); + init_messages3(); init_stringUtils(); jsx_dev_runtime171 = __toESM(require_jsx_dev_runtime(), 1); - COPY_DIR = join127(tmpdir10(), "claude"); + COPY_DIR = join117(tmpdir7(), "claude"); }); // src/commands/copy/index.ts @@ -595250,7 +517816,7 @@ var init_copy2 = __esm(() => { // src/utils/desktopDeepLink.ts import { readdir as readdir27 } from "fs/promises"; -import { join as join128 } from "path"; +import { join as join118 } from "path"; function isDevMode() { if (true) { return true; @@ -595275,17 +517841,17 @@ async function isDesktopInstalled() { if (isDevMode()) { return true; } - const platform6 = process.platform; - if (platform6 === "darwin") { + const platform5 = process.platform; + if (platform5 === "darwin") { return pathExists("/Applications/Claude.app"); - } else if (platform6 === "linux") { + } else if (platform5 === "linux") { const { code, stdout } = await execFileNoThrow("xdg-mime", [ "query", "default", "x-scheme-handler/claude" ]); return code === 0 && stdout.trim().length > 0; - } else if (platform6 === "win32") { + } else if (platform5 === "win32") { const { code } = await execFileNoThrow("reg", [ "query", "HKEY_CLASSES_ROOT\\claude", @@ -595296,8 +517862,8 @@ async function isDesktopInstalled() { return false; } async function getDesktopVersion() { - const platform6 = process.platform; - if (platform6 === "darwin") { + const platform5 = process.platform; + if (platform5 === "darwin") { const { code, stdout } = await execFileNoThrow("defaults", [ "read", "/Applications/Claude.app/Contents/Info.plist", @@ -595308,12 +517874,12 @@ async function getDesktopVersion() { } const version3 = stdout.trim(); return version3.length > 0 ? version3 : null; - } else if (platform6 === "win32") { + } else if (platform5 === "win32") { const localAppData = process.env.LOCALAPPDATA; if (!localAppData) { return null; } - const installDir = join128(localAppData, "AnthropicClaude"); + const installDir = join118(localAppData, "AnthropicClaude"); try { const entries = await readdir27(installDir); const versions3 = entries.filter((e) => e.startsWith("app-")).map((e) => e.slice(4)).filter((v) => import_semver8.coerce(v) !== null).sort((a2, b) => { @@ -595349,9 +517915,9 @@ async function getDesktopInstallStatus() { return { status: "ready", version: version3 }; } async function openDeepLink(deepLinkUrl) { - const platform6 = process.platform; + const platform5 = process.platform; logForDebugging(`Opening deep link: ${deepLinkUrl}`); - if (platform6 === "darwin") { + if (platform5 === "darwin") { if (isDevMode()) { const { code: code2 } = await execFileNoThrow("osascript", [ "-e", @@ -595361,10 +517927,10 @@ async function openDeepLink(deepLinkUrl) { } const { code } = await execFileNoThrow("open", [deepLinkUrl]); return code === 0; - } else if (platform6 === "linux") { + } else if (platform5 === "linux") { const { code } = await execFileNoThrow("xdg-open", [deepLinkUrl]); return code === 0; - } else if (platform6 === "win32") { + } else if (platform5 === "win32") { const { code } = await execFileNoThrow("cmd", [ "/c", "start", @@ -595497,26 +518063,26 @@ function DesktopHandoff(t0) { onDone } = t0; const [state, setState] = import_react98.useState("checking"); - const [error46, setError] = import_react98.useState(null); + const [error42, setError] = import_react98.useState(null); const [downloadMessage, setDownloadMessage] = import_react98.useState(""); let t1; - if ($2[0] !== error46 || $2[1] !== onDone || $2[2] !== state) { - t1 = (input11) => { + if ($2[0] !== error42 || $2[1] !== onDone || $2[2] !== state) { + t1 = (input) => { if (state === "error") { - onDone(error46 ?? "Unknown error", { + onDone(error42 ?? "Unknown error", { display: "system" }); return; } if (state === "prompt-download") { - if (input11 === "y" || input11 === "Y") { + if (input === "y" || input === "Y") { openBrowser(getDownloadUrl()).catch(_temp67); onDone(`Starting download. Re-run /desktop once you’ve installed the app. Learn more at ${DESKTOP_DOCS_URL}`, { display: "system" }); } else { - if (input11 === "n" || input11 === "N") { + if (input === "n" || input === "N") { onDone(`The desktop app is required for /desktop. Learn more at ${DESKTOP_DOCS_URL}`, { display: "system" }); @@ -595524,7 +518090,7 @@ Learn more at ${DESKTOP_DOCS_URL}`, { } } }; - $2[0] = error46; + $2[0] = error42; $2[1] = onDone; $2[2] = state; $2[3] = t1; @@ -595552,17 +518118,17 @@ Learn more at ${DESKTOP_DOCS_URL}`, { setState("flushing"); await flushSessionStorage(); setState("opening"); - const result3 = await openCurrentSessionInDesktop(); - if (!result3.success) { - setError(result3.error ?? "Failed to open Claude Desktop"); + const result2 = await openCurrentSessionInDesktop(); + if (!result2.success) { + setError(result2.error ?? "Failed to open Claude Desktop"); setState("error"); return; } setState("success"); setTimeout(_temp216, 500, onDone); }; - performHandoff().catch((err3) => { - setError(errorMessage(err3)); + performHandoff().catch((err2) => { + setError(errorMessage(err2)); setState("error"); }); }; @@ -595577,15 +518143,15 @@ Learn more at ${DESKTOP_DOCS_URL}`, { import_react98.useEffect(t2, t3); if (state === "error") { let t42; - if ($2[7] !== error46) { + if ($2[7] !== error42) { t42 = /* @__PURE__ */ jsx_dev_runtime173.jsxDEV(ThemedText, { color: "error", children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this); - $2[7] = error46; + $2[7] = error42; $2[8] = t42; } else { t42 = $2[8]; @@ -595718,7 +518284,7 @@ var init_desktop = __esm(() => { }); // src/commands/desktop/index.ts -function isSupportedPlatform3() { +function isSupportedPlatform2() { if (process.platform === "darwin") { return true; } @@ -595735,9 +518301,9 @@ var init_desktop2 = __esm(() => { aliases: ["app"], description: "Continue the current session in Claude Desktop", availability: ["claude-ai"], - isEnabled: isSupportedPlatform3, + isEnabled: isSupportedPlatform2, get isHidden() { - return !isSupportedPlatform3(); + return !isSupportedPlatform2(); }, load: () => Promise.resolve().then(() => (init_desktop(), exports_desktop)) }; @@ -596009,38 +518575,38 @@ var reactiveCompact2, call13 = async (args, context) => { } const microcompactResult = await microcompactMessages(messages, context); const messagesForCompact = microcompactResult.messages; - const result3 = await compactConversation(messagesForCompact, context, await getCacheSharingParams(context, messagesForCompact), false, customInstructions, false); + const result2 = await compactConversation(messagesForCompact, context, await getCacheSharingParams(context, messagesForCompact), false, customInstructions, false); setLastSummarizedMessageId(undefined); suppressCompactWarning(); getUserContext.cache.clear?.(); runPostCompactCleanup(); return { type: "compact", - compactionResult: result3, - displayText: buildDisplayText(context, result3.userDisplayMessage) + compactionResult: result2, + displayText: buildDisplayText(context, result2.userDisplayMessage) }; - } catch (error46) { + } catch (error42) { if (abortController.signal.aborted) { throw new Error("Compaction canceled."); - } else if (hasExactErrorMessage(error46, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES)) { + } else if (hasExactErrorMessage(error42, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES)) { throw new Error(ERROR_MESSAGE_NOT_ENOUGH_MESSAGES); - } else if (hasExactErrorMessage(error46, ERROR_MESSAGE_INCOMPLETE_RESPONSE)) { + } else if (hasExactErrorMessage(error42, ERROR_MESSAGE_INCOMPLETE_RESPONSE)) { throw new Error(ERROR_MESSAGE_INCOMPLETE_RESPONSE); } else { - logError2(error46); - throw new Error(`Error during compaction: ${error46}`); + logError2(error42); + throw new Error(`Error during compaction: ${error42}`); } } }; -var init_compact4 = __esm(() => { +var init_compact3 = __esm(() => { init_bun_bundle(); init_source(); init_state(); - init_prompts5(); + init_prompts4(); init_context2(); init_shortcutFormat(); init_promptCacheBreakDetection(); - init_compact3(); + init_compact2(); init_compactWarningState(); init_microCompact(); init_postCompactCleanup(); @@ -596049,26 +518615,26 @@ var init_compact4 = __esm(() => { init_errors(); init_hooks5(); init_log3(); - init_messages5(); + init_messages3(); init_contextWindowUpgradeCheck(); init_systemPrompt(); reactiveCompact2 = feature("REACTIVE_COMPACT") ? (init_reactiveCompact(), __toCommonJS(exports_reactiveCompact)) : null; }); // src/commands/compact/index.ts -var compact3, compact_default3; -var init_compact5 = __esm(() => { +var compact2, compact_default2; +var init_compact4 = __esm(() => { init_envUtils(); - compact3 = { + compact2 = { type: "local", name: "compact", description: "Clear conversation history but keep a summary in context. Optional: /compact [instructions for summarization]", isEnabled: () => !isEnvTruthy(process.env.DISABLE_COMPACT), supportsNonInteractive: true, argumentHint: "", - load: () => Promise.resolve().then(() => (init_compact4(), exports_compact)) + load: () => Promise.resolve().then(() => (init_compact3(), exports_compact)) }; - compact_default3 = compact3; + compact_default2 = compact2; }); // src/components/design-system/Tabs.tsx @@ -596218,9 +518784,9 @@ function Tabs(t0) { color: color3, children: title }, undefined, false, undefined, this), - tabs.map((t16, i4) => { + tabs.map((t16, i3) => { const [id, title_0] = t16; - const isCurrent = selectedTabIndex === i4; + const isCurrent = selectedTabIndex === i3; const hasColorCursor = color3 && isCurrent && headerFocused; return /* @__PURE__ */ jsx_dev_runtime175.jsxDEV(ThemedText, { backgroundColor: hasColorCursor ? color3 : undefined, @@ -596304,9 +518870,9 @@ function Tabs(t0) { children: t18 }, undefined, false, undefined, this); } -function _temp412(sum3, t0) { +function _temp412(sum2, t0) { const [, tabTitle] = t0; - return sum3 + (tabTitle ? stringWidth(tabTitle) : 0) + 2 + 1; + return sum2 + (tabTitle ? stringWidth(tabTitle) : 0) + 2 + 1; } function _temp313(n_0) { return n_0 - 1; @@ -596456,12 +519022,12 @@ function PropertyValue(t0) { if ($2[0] !== value) { let t22; if ($2[2] !== value.length) { - t22 = (item, i4) => /* @__PURE__ */ jsx_dev_runtime176.jsxDEV(ThemedText, { + t22 = (item, i3) => /* @__PURE__ */ jsx_dev_runtime176.jsxDEV(ThemedText, { children: [ item, - i4 < value.length - 1 ? "," : "" + i3 < value.length - 1 ? "," : "" ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); $2[2] = value.length; $2[3] = t22; } else { @@ -596617,11 +519183,11 @@ function Status(t0) { } return t8; } -function _temp413(properties, i4) { +function _temp413(properties, i3) { return properties.length > 0 && /* @__PURE__ */ jsx_dev_runtime176.jsxDEV(ThemedBox_default, { flexDirection: "column", children: properties.map(_temp314) - }, i4, false, undefined, this); + }, i3, false, undefined, this); } function _temp314(t0, j) { const { @@ -596696,7 +519262,7 @@ function Diagnostics(t0) { } return t3; } -function _temp56(diagnostic, i4) { +function _temp56(diagnostic, i3) { return /* @__PURE__ */ jsx_dev_runtime176.jsxDEV(ThemedBox_default, { flexDirection: "row", gap: 1, @@ -596711,7 +519277,7 @@ function _temp56(diagnostic, i4) { children: diagnostic }, undefined, false, undefined, this) : diagnostic ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } var import_compiler_runtime136, import_react100, jsx_dev_runtime176; var init_Status = __esm(() => { @@ -597196,7 +519762,7 @@ var init_EffortIndicator = __esm(() => { function ModelPicker(t0) { const $2 = import_compiler_runtime138.c(82); const { - initial: initial3, + initial: initial2, sessionModel, onSelect, onCancel, @@ -597207,7 +519773,7 @@ function ModelPicker(t0) { } = t0; const setAppState = useSetAppState(); const exitState = useExitOnCtrlCDWithKeybindings(); - const initialValue = initial3 === null ? NO_PREFERENCE : initial3; + const initialValue = initial2 === null ? NO_PREFERENCE : initial2; const [focusedValue, setFocusedValue] = import_react101.useState(initialValue); const isFastMode = useAppState(_temp71); const [hasToggledEffort, setHasToggledEffort] = import_react101.useState(false); @@ -597233,23 +519799,23 @@ function ModelPicker(t0) { const modelOptions = t3; let t4; bb0: { - if (initial3 !== null && !modelOptions.some((opt) => opt.value === initial3)) { + if (initial2 !== null && !modelOptions.some((opt) => opt.value === initial2)) { let t52; - if ($2[4] !== initial3) { - t52 = modelDisplayString(initial3); - $2[4] = initial3; + if ($2[4] !== initial2) { + t52 = modelDisplayString(initial2); + $2[4] = initial2; $2[5] = t52; } else { t52 = $2[5]; } let t62; - if ($2[6] !== initial3 || $2[7] !== t52) { + if ($2[6] !== initial2 || $2[7] !== t52) { t62 = { - value: initial3, + value: initial2, label: t52, description: "Current model" }; - $2[6] = initial3; + $2[6] = initial2; $2[7] = t52; $2[8] = t62; } else { @@ -597794,7 +520360,7 @@ function isBilledAsExtraUsage(model, isFastMode, isOpus1mMerged) { return isOpus46 || isSonnet46; } var init_extraUsage = __esm(() => { - init_auth2(); + init_auth(); init_context(); }); @@ -597942,14 +520508,14 @@ function ClaudeMdExternalIncludesDialog(t0) { } return t11; } -function _temp415(include, i4) { +function _temp415(include, i3) { return /* @__PURE__ */ jsx_dev_runtime179.jsxDEV(ThemedText, { dimColor: true, children: [ " ", include.path ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } function _temp316(current_0) { return { @@ -598101,10 +520667,10 @@ var init_ChannelDowngradeDialog = __esm(() => { // src/components/OutputStylePicker.tsx function mapConfigsToOptions(styles5) { - return Object.entries(styles5).map(([style, config5]) => ({ - label: config5?.name ?? DEFAULT_OUTPUT_STYLE_LABEL, + return Object.entries(styles5).map(([style, config3]) => ({ + label: config3?.name ?? DEFAULT_OUTPUT_STYLE_LABEL, value: style, - description: config5?.description ?? DEFAULT_OUTPUT_STYLE_DESCRIPTION + description: config3?.description ?? DEFAULT_OUTPUT_STYLE_DESCRIPTION })); } function OutputStylePicker(t0) { @@ -598650,11 +521216,11 @@ function useSearchInput({ return; } case "y": { - const text2 = getLastKill(); - if (text2.length > 0) { + const text = getLastKill(); + if (text.length > 0) { const startOffset = cursor.offset; - const newCursor = cursor.insert(text2); - recordYank(startOffset, text2.length); + const newCursor = cursor.insert(text); + recordYank(startOffset, text.length); setQueryState(newCursor.text); setCursorOffset(newCursor.offset); } @@ -598687,12 +521253,12 @@ function useSearchInput({ case "y": { const popResult = yankPop(); if (popResult) { - const { text: text2, start, length } = popResult; - const before3 = query2.slice(0, start); - const after3 = query2.slice(start + length); - const newText = before3 + text2 + after3; - const newOffset = start + text2.length; - updateYankLength(text2.length); + const { text, start, length } = popResult; + const before2 = query2.slice(0, start); + const after2 = query2.slice(start + length); + const newText = before2 + text + after2; + const newOffset = start + text.length; + updateYankLength(text.length); setQueryState(newText); setCursorOffset(newOffset); } @@ -598845,10 +521411,10 @@ function Config({ if ("model" in prev_0) { const { model, - ...rest3 + ...rest2 } = prev_0; return { - ...rest3, + ...rest2, model: valStr }; } @@ -599116,14 +521682,14 @@ function Config({ onChange(mode) { const parsedMode = permissionModeFromString(mode); const validatedMode = isExternalPermissionMode(parsedMode) ? toExternalPermissionMode(parsedMode) : parsedMode; - const result3 = updateSettingsForSource("userSettings", { + const result2 = updateSettingsForSource("userSettings", { permissions: { ...settingsData?.permissions, defaultMode: validatedMode } }); - if (result3.error) { - logError2(result3.error); + if (result2.error) { + logError2(result2.error); return; } setSettingsData((prev_12) => ({ @@ -600331,8 +522897,8 @@ function Config({ " more above" ] }, undefined, true, undefined, this), - filteredSettingsItems.slice(scrollOffset, scrollOffset + maxVisible).map((setting_2, i4) => { - const actualIndex = scrollOffset + i4; + filteredSettingsItems.slice(scrollOffset, scrollOffset + maxVisible).map((setting_2, i3) => { + const actualIndex = scrollOffset + i3; const isSelected = actualIndex === selectedIndex && !headerFocused && !isSearchMode; return /* @__PURE__ */ jsx_dev_runtime184.jsxDEV(React53.Fragment, { children: /* @__PURE__ */ jsx_dev_runtime184.jsxDEV(ThemedBox_default, { @@ -600661,10 +523227,10 @@ function isEligibleForOverageCreditGrant() { function shouldShowOverageCreditUpsell() { if (!isEligibleForOverageCreditGrant()) return false; - const config5 = getGlobalConfig(); - if (config5.hasVisitedExtraUsage) + const config3 = getGlobalConfig(); + if (config3.hasVisitedExtraUsage) return false; - if ((config5.overageCreditUpsellSeenCount ?? 0) >= MAX_IMPRESSIONS) + if ((config3.overageCreditUpsellSeenCount ?? 0) >= MAX_IMPRESSIONS) return false; return true; } @@ -600753,8 +523319,8 @@ function OverageCreditUpsell(t0) { }, undefined, true, undefined, this); break bb0; } - const text2 = getUsageText(amount); - const display = maxWidth ? truncate(text2, maxWidth) : text2; + const text = getUsageText(amount); + const display = maxWidth ? truncate(text, maxWidth) : text; const highlightLen = Math.min(getFeedTitle(amount).length, display.length); t1 = /* @__PURE__ */ jsx_dev_runtime185.jsxDEV(ThemedText, { dimColor: true, @@ -601022,7 +523588,7 @@ function LimitBar(t0) { } function Usage() { const [utilization, setUtilization] = import_react108.useState(null); - const [error46, setError] = import_react108.useState(null); + const [error42, setError] = import_react108.useState(null); const [isLoading, setIsLoading] = import_react108.useState(true); const { columns @@ -601035,9 +523601,9 @@ function Usage() { try { const data = await fetchUtilization(); setUtilization(data); - } catch (err3) { - logError2(err3); - const axiosError = err3; + } catch (err2) { + logError2(err2); + const axiosError = err2; const responseBody = axiosError.response?.data ? jsonStringify(axiosError.response.data) : undefined; setError(responseBody ? `Failed to load usage data: ${responseBody}` : "Failed to load usage data"); } finally { @@ -601051,9 +523617,9 @@ function Usage() { loadUtilization(); }, { context: "Settings", - isActive: !!error46 && !isLoading + isActive: !!error42 && !isLoading }); - if (error46) { + if (error42) { return /* @__PURE__ */ jsx_dev_runtime186.jsxDEV(ThemedBox_default, { flexDirection: "column", gap: 1, @@ -601062,7 +523628,7 @@ function Usage() { color: "error", children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this), /* @__PURE__ */ jsx_dev_runtime186.jsxDEV(ThemedText, { @@ -601244,8 +523810,8 @@ function ExtraUsageSection(t0) { let t6; let t7; if ($2[6] !== extraUsage2.utilization) { - const now3 = new Date; - const oneMonthReset = new Date(now3.getFullYear(), now3.getMonth() + 1, 1); + const now2 = new Date; + const oneMonthReset = new Date(now2.getFullYear(), now2.getMonth() + 1, 1); T0 = LimitBar; t7 = EXTRA_USAGE_SECTION_TITLE; t5 = extraUsage2.utilization; @@ -601301,7 +523867,7 @@ var init_Usage = __esm(() => { import_react108 = __toESM(require_react(), 1); init_extra_usage2(); init_cost_tracker(); - init_auth2(); + init_auth(); init_useTerminalSize(); init_ink2(); init_useKeybinding(); @@ -601498,16 +524064,16 @@ var init_config7 = __esm(() => { }); // src/commands/config/index.ts -var config5, config_default; +var config3, config_default; var init_config8 = __esm(() => { - config5 = { + config3 = { aliases: ["settings"], type: "local-jsx", name: "config", description: "Open config panel", load: () => Promise.resolve().then(() => (init_config7(), exports_config2)) }; - config_default = config5; + config_default = config3; }); // src/utils/contextSuggestions.ts @@ -601616,7 +524182,7 @@ function checkReadResultBloat(data, suggestions) { } } function checkMemoryBloat(data, suggestions) { - const totalMemoryTokens = data.memoryFiles.reduce((sum3, f) => sum3 + f.tokens, 0); + const totalMemoryTokens = data.memoryFiles.reduce((sum2, f) => sum2 + f.tokens, 0); const memoryPercent = totalMemoryTokens / data.rawMaxTokens * 100; if (memoryPercent >= MEMORY_HIGH_PERCENT && totalMemoryTokens >= MEMORY_HIGH_TOKENS) { const largestFiles = [...data.memoryFiles].sort((a2, b) => b.tokens - a2.tokens).slice(0, 3).map((f) => { @@ -601656,21 +524222,21 @@ function StatusIcon(t0) { withSpace: t1 } = t0; const withSpace = t1 === undefined ? false : t1; - const config6 = STATUS_CONFIG[status]; - const t2 = !config6.color; + const config4 = STATUS_CONFIG[status]; + const t2 = !config4.color; const t3 = withSpace && " "; let t4; - if ($2[0] !== config6.color || $2[1] !== config6.icon || $2[2] !== t2 || $2[3] !== t3) { + if ($2[0] !== config4.color || $2[1] !== config4.icon || $2[2] !== t2 || $2[3] !== t3) { t4 = /* @__PURE__ */ jsx_dev_runtime189.jsxDEV(ThemedText, { - color: config6.color, + color: config4.color, dimColor: t2, children: [ - config6.icon, + config4.icon, t3 ] }, undefined, true, undefined, this); - $2[0] = config6.color; - $2[1] = config6.icon; + $2[0] = config4.color; + $2[1] = config4.icon; $2[2] = t2; $2[3] = t3; $2[4] = t4; @@ -601757,10 +524323,10 @@ function ContextSuggestions(t0) { } return t3; } -function _temp78(suggestion, i4) { +function _temp78(suggestion, i3) { return /* @__PURE__ */ jsx_dev_runtime190.jsxDEV(ThemedBox_default, { flexDirection: "column", - marginTop: i4 === 0 ? 0 : 1, + marginTop: i3 === 0 ? 0 : 1, children: [ /* @__PURE__ */ jsx_dev_runtime190.jsxDEV(ThemedBox_default, { children: [ @@ -601791,7 +524357,7 @@ function _temp78(suggestion, i4) { }, undefined, false, undefined, this) }, undefined, false, undefined, this) ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } var import_compiler_runtime149, jsx_dev_runtime190; var init_ContextSuggestions = __esm(() => { @@ -602552,7 +525118,7 @@ function _temp11(t_1) { function _temp102(t_2) { return !t_2.isLoaded; } -function _temp1(tool, i4) { +function _temp1(tool, i3) { return /* @__PURE__ */ jsx_dev_runtime191.jsxDEV(ThemedBox_default, { children: [ /* @__PURE__ */ jsx_dev_runtime191.jsxDEV(ThemedText, { @@ -602570,7 +525136,7 @@ function _temp1(tool, i4) { ] }, undefined, true, undefined, this) ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } function _temp0(t) { return t.isLoaded; @@ -602685,14 +525251,14 @@ function extractFirstFrame(output) { return output.slice(contentStart, endIndex); } function renderToAnsiString(node, columns) { - return new Promise(async (resolve42) => { + return new Promise(async (resolve36) => { let output = ""; const stream4 = new PassThrough3; if (columns !== undefined) { stream4.columns = columns; } - stream4.on("data", (chunk3) => { - output += chunk3.toString(); + stream4.on("data", (chunk2) => { + output += chunk2.toString(); }); const instance = await render(/* @__PURE__ */ jsx_dev_runtime192.jsxDEV(RenderOnceAndExit, { children: node @@ -602701,7 +525267,7 @@ function renderToAnsiString(node, columns) { patchConsole: false }); await instance.waitUntilExit(); - await resolve42(extractFirstFrame(output)); + await resolve36(extractFirstFrame(output)); }); } async function renderToString(node, columns) { @@ -602771,7 +525337,7 @@ var init_context3 = __esm(() => { init_ContextVisualization(); init_microCompact(); init_analyzeContext(); - init_messages5(); + init_messages3(); init_staticRender(); jsx_dev_runtime193 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -603064,7 +525630,7 @@ var init_context_noninteractive = __esm(() => { init_microCompact(); init_analyzeContext(); init_format(); - init_messages5(); + init_messages3(); init_constants2(); init_stringUtils(); }); @@ -603121,13 +525687,13 @@ var call17 = async () => { var init_cost = __esm(() => { init_cost_tracker(); init_claudeAiLimits(); - init_auth2(); + init_auth(); }); // src/commands/cost/index.ts var cost, cost_default; var init_cost2 = __esm(() => { - init_auth2(); + init_auth(); cost = { type: "local", name: "cost", @@ -603180,15 +525746,15 @@ function useDiffData() { return { stats: null, files: [], hunks: new Map, loading }; } const { stats, perFileStats } = diffResult; - const files2 = []; - for (const [path23, fileStats] of perFileStats) { - const fileHunks = hunks.get(path23); + const files = []; + for (const [path18, fileStats] of perFileStats) { + const fileHunks = hunks.get(path18); const isUntracked = fileStats.isUntracked ?? false; const isLargeFile = !fileStats.isBinary && !isUntracked && !fileHunks; const totalLines = fileStats.added + fileStats.removed; const isTruncated = !isLargeFile && !fileStats.isBinary && totalLines > MAX_LINES_PER_FILE2; - files2.push({ - path: path23, + files.push({ + path: path18, linesAdded: fileStats.added, linesRemoved: fileStats.removed, isBinary: fileStats.isBinary, @@ -603197,8 +525763,8 @@ function useDiffData() { isUntracked }); } - files2.sort((a2, b) => a2.path.localeCompare(b.path)); - return { stats, files: files2, hunks, loading: false }; + files.sort((a2, b) => a2.path.localeCompare(b.path)); + return { stats, files, hunks, loading: false }; }, [diffResult, hunks, loading]); } var import_react111, MAX_LINES_PER_FILE2 = 400; @@ -603208,17 +525774,17 @@ var init_useDiffData = __esm(() => { }); // src/hooks/useTurnDiffs.ts -function isFileEditResult(result3) { - if (!result3 || typeof result3 !== "object") +function isFileEditResult(result2) { + if (!result2 || typeof result2 !== "object") return false; - const r = result3; + const r = result2; const hasFilePath = typeof r.filePath === "string"; const hasStructuredPatch = Array.isArray(r.structuredPatch) && r.structuredPatch.length > 0; const isNewFile = r.type === "create" && typeof r.content === "string"; return hasFilePath && (hasStructuredPatch || isNewFile); } -function isFileWriteOutput(result3) { - return "type" in result3 && (result3.type === "create" || result3.type === "update"); +function isFileWriteOutput(result2) { + return "type" in result2 && (result2.type === "create" || result2.type === "update"); } function countHunkLines(hunks) { let added = 0; @@ -603237,10 +525803,10 @@ function getUserPromptPreview(message) { if (message.type !== "user") return ""; const content = message.message.content; - const text2 = typeof content === "string" ? content : ""; - if (text2.length <= 30) - return text2; - return text2.slice(0, 29) + "…"; + const text = typeof content === "string" ? content : ""; + if (text.length <= 30) + return text; + return text.slice(0, 29) + "…"; } function computeTurnStats(turn) { let totalAdded = 0; @@ -603270,8 +525836,8 @@ function useTurnDiffs(messages) { c6.lastProcessedIndex = 0; c6.lastTurnIndex = 0; } - for (let i4 = c6.lastProcessedIndex;i4 < messages.length; i4++) { - const message = messages[i4]; + for (let i3 = c6.lastProcessedIndex;i3 < messages.length; i3++) { + const message = messages[i3]; if (!message || message.type !== "user") continue; const isToolResult2 = message.toolUseResult || Array.isArray(message.message.content) && message.message.content[0]?.type === "tool_result"; @@ -603289,10 +525855,10 @@ function useTurnDiffs(messages) { stats: { filesChanged: 0, linesAdded: 0, linesRemoved: 0 } }; } else if (c6.currentTurn && message.toolUseResult) { - const result4 = message.toolUseResult; - if (isFileEditResult(result4)) { - const { filePath, structuredPatch: structuredPatch2 } = result4; - const isNewFile = "type" in result4 && result4.type === "create"; + const result3 = message.toolUseResult; + if (isFileEditResult(result3)) { + const { filePath, structuredPatch: structuredPatch2 } = result3; + const isNewFile = "type" in result3 && result3.type === "create"; let fileEntry = c6.currentTurn.files.get(filePath); if (!fileEntry) { fileEntry = { @@ -603304,8 +525870,8 @@ function useTurnDiffs(messages) { }; c6.currentTurn.files.set(filePath, fileEntry); } - if (isNewFile && structuredPatch2.length === 0 && isFileWriteOutput(result4)) { - const content = result4.content; + if (isNewFile && structuredPatch2.length === 0 && isFileWriteOutput(result3)) { + const content = result3.content; const lines = content.split(` `); const syntheticHunk = { @@ -603330,12 +525896,12 @@ function useTurnDiffs(messages) { } } c6.lastProcessedIndex = messages.length; - const result3 = [...c6.completedTurns]; + const result2 = [...c6.completedTurns]; if (c6.currentTurn && c6.currentTurn.files.size > 0) { computeTurnStats(c6.currentTurn); - result3.push(c6.currentTurn); + result2.push(c6.currentTurn); } - return result3.reverse(); + return result2.reverse(); }, [messages]); } var import_react112; @@ -603344,7 +525910,7 @@ var init_useTurnDiffs = __esm(() => { }); // src/components/diff/DiffDetailView.tsx -import { resolve as resolve42 } from "path"; +import { resolve as resolve36 } from "path"; function DiffDetailView(t0) { const $2 = import_compiler_runtime152.c(53); const { @@ -603377,7 +525943,7 @@ function DiffDetailView(t0) { let content; let t22; if ($2[1] !== filePath) { - const fullPath = resolve42(getCwd(), filePath); + const fullPath = resolve36(getCwd(), filePath); content = readFileSafe(fullPath); t22 = content?.split(` `)[0] ?? null; @@ -603740,7 +526306,7 @@ var init_DiffDetailView = __esm(() => { function DiffFileList(t0) { const $2 = import_compiler_runtime153.c(36); const { - files: files2, + files, selectedIndex } = t0; const { @@ -603748,14 +526314,14 @@ function DiffFileList(t0) { } = useTerminalSize(); let t1; bb0: { - if (files2.length === 0 || files2.length <= MAX_VISIBLE_FILES) { + if (files.length === 0 || files.length <= MAX_VISIBLE_FILES) { let t23; - if ($2[0] !== files2.length) { + if ($2[0] !== files.length) { t23 = { startIndex: 0, - endIndex: files2.length + endIndex: files.length }; - $2[0] = files2.length; + $2[0] = files.length; $2[1] = t23; } else { t23 = $2[1]; @@ -603765,8 +526331,8 @@ function DiffFileList(t0) { } let start = Math.max(0, selectedIndex - Math.floor(MAX_VISIBLE_FILES / 2)); let end = start + MAX_VISIBLE_FILES; - if (end > files2.length) { - end = files2.length; + if (end > files.length) { + end = files.length; start = Math.max(0, end - MAX_VISIBLE_FILES); } let t22; @@ -603787,7 +526353,7 @@ function DiffFileList(t0) { startIndex, endIndex } = t1; - if (files2.length === 0) { + if (files.length === 0) { let t22; if ($2[5] === Symbol.for("react.memo_cache_sentinel")) { t22 = /* @__PURE__ */ jsx_dev_runtime195.jsxDEV(ThemedText, { @@ -603806,11 +526372,11 @@ function DiffFileList(t0) { let t2; let t3; let t4; - if ($2[6] !== columns || $2[7] !== endIndex || $2[8] !== files2 || $2[9] !== selectedIndex || $2[10] !== startIndex) { - const visibleFiles = files2.slice(startIndex, endIndex); + if ($2[6] !== columns || $2[7] !== endIndex || $2[8] !== files || $2[9] !== selectedIndex || $2[10] !== startIndex) { + const visibleFiles = files.slice(startIndex, endIndex); const hasMoreAbove = startIndex > 0; - hasMoreBelow = endIndex < files2.length; - needsPagination = files2.length > MAX_VISIBLE_FILES; + hasMoreBelow = endIndex < files.length; + needsPagination = files.length > MAX_VISIBLE_FILES; const maxPathWidth = Math.max(20, columns - 16 - 3 - 4); T0 = ThemedBox_default; t2 = "column"; @@ -603843,7 +526409,7 @@ function DiffFileList(t0) { t4 = visibleFiles.map(t52); $2[6] = columns; $2[7] = endIndex; - $2[8] = files2; + $2[8] = files; $2[9] = selectedIndex; $2[10] = startIndex; $2[11] = T0; @@ -603861,13 +526427,13 @@ function DiffFileList(t0) { t4 = $2[16]; } let t5; - if ($2[25] !== endIndex || $2[26] !== files2.length || $2[27] !== hasMoreBelow || $2[28] !== needsPagination) { + if ($2[25] !== endIndex || $2[26] !== files.length || $2[27] !== hasMoreBelow || $2[28] !== needsPagination) { t5 = needsPagination && /* @__PURE__ */ jsx_dev_runtime195.jsxDEV(ThemedText, { dimColor: true, - children: hasMoreBelow ? ` ↓ ${files2.length - endIndex} more ${plural(files2.length - endIndex, "file")}` : " " + children: hasMoreBelow ? ` ↓ ${files.length - endIndex} more ${plural(files.length - endIndex, "file")}` : " " }, undefined, false, undefined, this); $2[25] = endIndex; - $2[26] = files2.length; + $2[26] = files.length; $2[27] = hasMoreBelow; $2[28] = needsPagination; $2[29] = t5; @@ -604105,7 +526671,7 @@ __export(exports_DiffDialog, { DiffDialog: () => DiffDialog }); function turnDiffToDiffData(turn) { - const files2 = Array.from(turn.files.values()).map((f) => ({ + const files = Array.from(turn.files.values()).map((f) => ({ path: f.filePath, linesAdded: f.linesAdded, linesRemoved: f.linesRemoved, @@ -604124,7 +526690,7 @@ function turnDiffToDiffData(turn) { linesAdded: turn.stats.linesAdded, linesRemoved: turn.stats.linesRemoved }, - files: files2, + files, hunks, loading: false }; @@ -604366,17 +526932,17 @@ function DiffDialog(t0) { dimColor: true, children: "◀ " }, undefined, false, undefined, this), - sources.map((source, i4) => { - const isSelected = i4 === sourceIndex; + sources.map((source, i3) => { + const isSelected = i3 === sourceIndex; const label = source.type === "current" ? "Current" : `T${source.turn.turnIndex}`; return /* @__PURE__ */ jsx_dev_runtime196.jsxDEV(ThemedText, { dimColor: !isSelected, bold: isSelected, children: [ - i4 > 0 ? " · " : "", + i3 > 0 ? " · " : "", label ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); }), sourceIndex < sources.length - 1 && /* @__PURE__ */ jsx_dev_runtime196.jsxDEV(ThemedText, { dimColor: true, @@ -604732,7 +527298,7 @@ function _temp417(warning, i_0) { ] }, `warning-${i_0}`, true, undefined, this); } -function _temp319(error46, i4) { +function _temp319(error42, i3) { return /* @__PURE__ */ jsx_dev_runtime198.jsxDEV(ThemedBox_default, { flexDirection: "column", children: [ @@ -604750,23 +527316,23 @@ function _temp319(error46, i4) { dimColor: true, children: [ " ", - error46.message + error42.message ] }, undefined, true, undefined, this) ] }, undefined, true, undefined, this), - error46.suggestion && /* @__PURE__ */ jsx_dev_runtime198.jsxDEV(ThemedBox_default, { + error42.suggestion && /* @__PURE__ */ jsx_dev_runtime198.jsxDEV(ThemedBox_default, { marginLeft: 3, children: /* @__PURE__ */ jsx_dev_runtime198.jsxDEV(ThemedText, { dimColor: true, children: [ "→ ", - error46.suggestion + error42.suggestion ] }, undefined, true, undefined, this) }, undefined, false, undefined, this) ] - }, `error-${i4}`, true, undefined, this); + }, `error-${i3}`, true, undefined, this); } function _temp227(w_0) { return w_0.severity === "warning"; @@ -604956,8 +527522,8 @@ function _temp228(warning, i_0) { }, undefined, true, undefined, this) }, `warning-${i_0}`, false, undefined, this); } -function _temp85(error46, i4) { - const serverName = error46.mcpErrorMetadata?.serverName; +function _temp85(error42, i3) { + const serverName = error42.mcpErrorMetadata?.serverName; return /* @__PURE__ */ jsx_dev_runtime199.jsxDEV(ThemedBox_default, { children: /* @__PURE__ */ jsx_dev_runtime199.jsxDEV(ThemedText, { children: [ @@ -604974,13 +527540,13 @@ function _temp85(error46, i4) { children: [ " ", serverName && `[${serverName}] `, - error46.path && error46.path !== "" ? `${error46.path}: ` : "", - error46.message + error42.path && error42.path !== "" ? `${error42.path}: ` : "", + error42.message ] }, undefined, true, undefined, this) ] }, undefined, true, undefined, this) - }, `error-${i4}`, false, undefined, this); + }, `error-${i3}`, false, undefined, this); } function McpParsingWarnings() { const $2 = import_compiler_runtime156.c(6); @@ -605090,9 +527656,9 @@ function _temp418(t0) { } function _temp320(t0) { const { - config: config6 + config: config4 } = t0; - return filterErrors(config6.errors, "fatal").length > 0; + return filterErrors(config4.errors, "fatal").length > 0; } function filterErrors(errors7, severity) { return errors7.filter((e) => e.mcpErrorMetadata?.severity === severity); @@ -605101,7 +527667,7 @@ var import_compiler_runtime156, jsx_dev_runtime199; var init_McpParsingWarnings = __esm(() => { import_compiler_runtime156 = __toESM(require_compiler_runtime(), 1); init_config3(); - init_utils4(); + init_utils3(); init_ink2(); jsx_dev_runtime199 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -605203,14 +527769,14 @@ function _temp229(w, i_0) { ] }, i_0, true, undefined, this); } -function _temp87(e, i4) { +function _temp87(e, i3) { return /* @__PURE__ */ jsx_dev_runtime201.jsxDEV(ThemedText, { color: "error", children: [ "└ ", e ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } var import_compiler_runtime158, jsx_dev_runtime201; var init_SandboxDoctorSection = __esm(() => { @@ -605230,10 +527796,10 @@ function treeify(obj, options2 = {}) { } = options2; const lines = []; const visited = new WeakSet; - function colorize2(text2, colorKey) { + function colorize2(text, colorKey) { if (!colorKey) - return text2; - return color(colorKey, themeName)(text2); + return text; + return color(colorKey, themeName)(text); } function growBranch(node, prefix, _isLast, depth = 0) { if (typeof node === "string") { @@ -605252,15 +527818,15 @@ function treeify(obj, options2 = {}) { return; } visited.add(node); - const keys4 = Object.keys(node).filter((key) => { + const keys3 = Object.keys(node).filter((key) => { const value = node[key]; if (hideFunctions && typeof value === "function") return false; return true; }); - keys4.forEach((key, index) => { + keys3.forEach((key, index) => { const value = node[key]; - const isLastKey = index === keys4.length - 1; + const isLastKey = index === keys3.length - 1; const nodePrefix = depth === 0 && index === 0 ? "" : prefix; const treeChar = isLastKey ? DEFAULT_TREE_CHARS.lastBranch : DEFAULT_TREE_CHARS.branch; const coloredTreeChar = colorize2(treeChar, treeCharColors.treeChar); @@ -605288,12 +527854,12 @@ function treeify(obj, options2 = {}) { } }); } - const keys3 = Object.keys(obj); - if (keys3.length === 0) { + const keys2 = Object.keys(obj); + if (keys2.length === 0) { return colorize2("(empty)", treeCharColors.value); } - if (keys3.length === 1 && keys3[0] !== undefined && keys3[0].trim() === "" && typeof obj[keys3[0]] === "string") { - const firstKey = keys3[0]; + if (keys2.length === 1 && keys2[0] !== undefined && keys2[0].trim() === "" && typeof obj[keys2[0]] === "string") { + const firstKey = keys2[0]; const coloredTreeChar = colorize2(DEFAULT_TREE_CHARS.lastBranch, treeCharColors.treeChar); const coloredValue = colorize2(obj[firstKey], treeCharColors.value); return coloredTreeChar + " " + coloredValue; @@ -605317,30 +527883,30 @@ var init_treeify = __esm(() => { // src/components/ValidationErrorsList.tsx function buildNestedTree(errors7) { const tree = {}; - errors7.forEach((error46) => { - if (!error46.path) { - tree[""] = error46.message; + errors7.forEach((error42) => { + if (!error42.path) { + tree[""] = error42.message; return; } - const pathParts = error46.path.split("."); - let modifiedPath = error46.path; - if (error46.invalidValue !== null && error46.invalidValue !== undefined && pathParts.length > 0) { + const pathParts = error42.path.split("."); + let modifiedPath = error42.path; + if (error42.invalidValue !== null && error42.invalidValue !== undefined && pathParts.length > 0) { const newPathParts = []; - for (let i4 = 0;i4 < pathParts.length; i4++) { - const part = pathParts[i4]; + for (let i3 = 0;i3 < pathParts.length; i3++) { + const part = pathParts[i3]; if (!part) continue; const numericPart = parseInt(part, 10); - if (!isNaN(numericPart) && i4 === pathParts.length - 1) { + if (!isNaN(numericPart) && i3 === pathParts.length - 1) { let displayValue; - if (typeof error46.invalidValue === "string") { - displayValue = `"${error46.invalidValue}"`; - } else if (error46.invalidValue === null) { + if (typeof error42.invalidValue === "string") { + displayValue = `"${error42.invalidValue}"`; + } else if (error42.invalidValue === null) { displayValue = "null"; - } else if (error46.invalidValue === undefined) { + } else if (error42.invalidValue === undefined) { displayValue = "undefined"; } else { - displayValue = String(error46.invalidValue); + displayValue = String(error42.invalidValue); } newPathParts.push(displayValue); } else { @@ -605349,7 +527915,7 @@ function buildNestedTree(errors7) { } modifiedPath = newPathParts.join("."); } - setWith_default(tree, modifiedPath, error46.message, Object); + setWith_default(tree, modifiedPath, error42.message, Object); }); return tree; } @@ -605471,12 +528037,12 @@ function _temp230(a2, b) { } return (a2.path || "").localeCompare(b.path || ""); } -function _temp88(acc, error46) { - const file2 = error46.file || "(file not specified)"; +function _temp88(acc, error42) { + const file2 = error42.file || "(file not specified)"; if (!acc[file2]) { acc[file2] = []; } - acc[file2].push(error46); + acc[file2].push(error42); return acc; } var import_compiler_runtime159, jsx_dev_runtime202; @@ -605805,7 +528371,7 @@ var exports_Doctor = {}; __export(exports_Doctor, { Doctor: () => Doctor }); -import { join as join129 } from "path"; +import { join as join119 } from "path"; function DistTagsDisplay(t0) { const $2 = import_compiler_runtime161.c(8); const { @@ -605935,8 +528501,8 @@ function Doctor(t0) { t5 = () => { getDoctorDiagnostic().then(setDiagnostic); (async () => { - const userAgentsDir = join129(getClaudeConfigHomeDir(), "agents"); - const projectAgentsDir = join129(getOriginalCwd(), ".claude", "agents"); + const userAgentsDir = join119(getClaudeConfigHomeDir(), "agents"); + const projectAgentsDir = join119(getOriginalCwd(), ".claude", "agents"); const { activeAgents, allAgents, @@ -605959,7 +528525,7 @@ function Doctor(t0) { }, async () => toolPermissionContext); setContextWarnings(warnings); if (isPidBasedLockingEnabled()) { - const locksDir = join129(getXDGStateHome(), "claude", "locks"); + const locksDir = join119(getXDGStateHome(), "claude", "locks"); const staleLocksCleaned = cleanupStaleLocks(locksDir); const locks = getAllLockInfo(locksDir); setVersionLockInfo({ @@ -606713,7 +529279,7 @@ function _temp103(warning, i_0) { ] }, i_0, true, undefined, this); } -function _temp110(install, i4) { +function _temp110(install, i3) { return /* @__PURE__ */ jsx_dev_runtime203.jsxDEV(ThemedText, { children: [ "└ ", @@ -606721,7 +529287,7 @@ function _temp110(install, i4) { " at ", install.path ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } function _temp02(a2) { return { @@ -606734,14 +529300,14 @@ function _temp93(v_0) { } function _temp86(v) { const value = process.env[v.name]; - const result3 = validateBoundedIntEnvVar(v.name, value, v.default, v.upperLimit); + const result2 = validateBoundedIntEnvVar(v.name, value, v.default, v.upperLimit); return { name: v.name, - ...result3 + ...result2 }; } -function _temp710(error46) { - return error46.mcpErrorMetadata === undefined; +function _temp710(error42) { + return error42.mcpErrorMetadata === undefined; } function _temp610(diag2) { const fetchDistTags = diag2.installationType === "native" ? getGcsDistTags : getNpmDistTags; @@ -606836,7 +529402,7 @@ var init_versions3 = __esm(() => { // src/components/memory/MemoryFileSelector.tsx import { mkdir as mkdir38 } from "fs/promises"; -import { join as join130 } from "path"; +import { join as join120 } from "path"; function MemoryFileSelector(t0) { const $2 = import_compiler_runtime162.c(58); const { @@ -606844,8 +529410,8 @@ function MemoryFileSelector(t0) { onCancel } = t0; const existingMemoryFiles = import_react116.use(getMemoryFiles()); - const userMemoryPath = join130(getClaudeConfigHomeDir(), "CLAUDE.md"); - const projectMemoryPath = join130(getOriginalCwd(), "CLAUDE.md"); + const userMemoryPath = join120(getClaudeConfigHomeDir(), "CLAUDE.md"); + const projectMemoryPath = join120(getOriginalCwd(), "CLAUDE.md"); const hasUserMemory = existingMemoryFiles.some((f) => f.path === userMemoryPath); const hasProjectMemory = existingMemoryFiles.some((f_0) => f_0.path === projectMemoryPath); const allMemoryFiles = [...existingMemoryFiles.filter(_temp91).map(_temp233), ...hasUserMemory ? [] : [{ @@ -607311,17 +529877,17 @@ var init_MemoryFileSelector = __esm(() => { }); // src/components/memory/MemoryUpdateNotification.tsx -import { homedir as homedir30 } from "os"; -import { relative as relative26 } from "path"; -function getRelativeMemoryPath(path23) { - const homeDir = homedir30(); +import { homedir as homedir28 } from "os"; +import { relative as relative24 } from "path"; +function getRelativeMemoryPath(path18) { + const homeDir = homedir28(); const cwd2 = getCwd(); - const relativeToHome = path23.startsWith(homeDir) ? "~" + path23.slice(homeDir.length) : null; - const relativeToCwd = path23.startsWith(cwd2) ? "./" + relative26(cwd2, path23) : null; + const relativeToHome = path18.startsWith(homeDir) ? "~" + path18.slice(homeDir.length) : null; + const relativeToCwd = path18.startsWith(cwd2) ? "./" + relative24(cwd2, path18) : null; if (relativeToHome && relativeToCwd) { return relativeToHome.length <= relativeToCwd.length ? relativeToHome : relativeToCwd; } - return relativeToHome || relativeToCwd || path23; + return relativeToHome || relativeToCwd || path18; } var import_compiler_runtime163, jsx_dev_runtime206; var init_MemoryUpdateNotification = __esm(() => { @@ -607333,15 +529899,15 @@ var init_MemoryUpdateNotification = __esm(() => { // src/utils/editor.ts import { - spawn as spawn10, - spawnSync as spawnSync5 + spawn as spawn7, + spawnSync as spawnSync4 } from "child_process"; -import { basename as basename39 } from "path"; +import { basename as basename37 } from "path"; function isCommandAvailable3(command3) { return !!whichSync(command3); } function classifyGuiEditor(editor) { - const base2 = basename39(editor.split(" ")[0] ?? ""); + const base2 = basename37(editor.split(" ")[0] ?? ""); return GUI_EDITORS.find((g) => base2.includes(g)); } function guiGotoArgv(guiFamily, filePath, line) { @@ -607367,9 +529933,9 @@ function openFileInExternalEditor(filePath, line) { let child; if (process.platform === "win32") { const gotoStr = gotoArgv.map((a2) => `"${a2}"`).join(" "); - child = spawn10(`${editor} ${gotoStr}`, { ...detachedOpts, shell: true }); + child = spawn7(`${editor} ${gotoStr}`, { ...detachedOpts, shell: true }); } else { - child = spawn10(base2, [...editorArgs, ...gotoArgv], detachedOpts); + child = spawn7(base2, [...editorArgs, ...gotoArgv], detachedOpts); } child.on("error", (e) => logForDebugging(`editor spawn failed: ${e}`, { level: "error" })); child.unref(); @@ -607378,14 +529944,14 @@ function openFileInExternalEditor(filePath, line) { const inkInstance = instances_default.get(process.stdout); if (!inkInstance) return false; - const useGotoLine = line && PLUS_N_EDITORS.test(basename39(base2)); + const useGotoLine = line && PLUS_N_EDITORS.test(basename37(base2)); inkInstance.enterAlternateScreen(); try { const syncOpts = { stdio: "inherit" }; - let result3; + let result2; if (process.platform === "win32") { const lineArg = useGotoLine ? `+${line} ` : ""; - result3 = spawnSync5(`${editor} ${lineArg}"${filePath}"`, { + result2 = spawnSync4(`${editor} ${lineArg}"${filePath}"`, { ...syncOpts, shell: true }); @@ -607394,10 +529960,10 @@ function openFileInExternalEditor(filePath, line) { ...editorArgs, ...useGotoLine ? [`+${line}`, filePath] : [filePath] ]; - result3 = spawnSync5(base2, args, syncOpts); + result2 = spawnSync4(base2, args, syncOpts); } - if (result3.error) { - logForDebugging(`editor spawn failed: ${result3.error}`, { + if (result2.error) { + logForDebugging(`editor spawn failed: ${result2.error}`, { level: "error" }); return false; @@ -607446,7 +530012,7 @@ function isGuiEditor(editor) { return classifyGuiEditor(editor) !== undefined; } function editFileInEditor(filePath) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const inkInstance = instances_default.get(process.stdout); if (!inkInstance) { throw new Error("Ink instance not found - cannot pause rendering"); @@ -607456,7 +530022,7 @@ function editFileInEditor(filePath) { return { content: null }; } try { - fs11.statSync(filePath); + fs5.statSync(filePath); } catch { return { content: null }; } @@ -607472,11 +530038,11 @@ function editFileInEditor(filePath) { execSync_DEPRECATED(`${editorCommand} "${filePath}"`, { stdio: "inherit" }); - const editedContent = fs11.readFileSync(filePath, { encoding: "utf-8" }); + const editedContent = fs5.readFileSync(filePath, { encoding: "utf-8" }); return { content: editedContent }; - } catch (err3) { - if (typeof err3 === "object" && err3 !== null && "status" in err3 && typeof err3.status === "number") { - const status = err3.status; + } catch (err2) { + if (typeof err2 === "object" && err2 !== null && "status" in err2 && typeof err2.status === "number") { + const status = err2.status; if (status !== 0) { const editorName = toIDEDisplayName(editor); return { @@ -607512,7 +530078,7 @@ function recollapsePastedContent(editedPrompt, originalPrompt, pastedContents) { return collapsed; } function editPromptInEditor(currentPrompt, pastedContents) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const tempFile = generateTempFilePath(); try { const expandedPrompt = pastedContents ? expandPastedTextRefs(currentPrompt, pastedContents) : currentPrompt; @@ -607520,11 +530086,11 @@ function editPromptInEditor(currentPrompt, pastedContents) { encoding: "utf-8", flush: true }); - const result3 = editFileInEditor(tempFile); - if (result3.content === null) { - return result3; + const result2 = editFileInEditor(tempFile); + if (result2.content === null) { + return result2; } - let finalContent = result3.content; + let finalContent = result2.content; if (finalContent.endsWith(` `) && !finalContent.endsWith(` @@ -607537,7 +530103,7 @@ function editPromptInEditor(currentPrompt, pastedContents) { return { content: finalContent }; } finally { try { - fs11.unlinkSync(tempFile); + fs5.unlinkSync(tempFile); } catch {} } } @@ -607562,7 +530128,7 @@ var exports_memory = {}; __export(exports_memory, { call: () => call20 }); -import { mkdir as mkdir39, writeFile as writeFile42 } from "fs/promises"; +import { mkdir as mkdir39, writeFile as writeFile40 } from "fs/promises"; function MemoryCommand({ onDone }) { @@ -607574,7 +530140,7 @@ function MemoryCommand({ }); } try { - await writeFile42(memoryPath, "", { + await writeFile40(memoryPath, "", { encoding: "utf8", flag: "wx" }); @@ -607600,9 +530166,9 @@ function MemoryCommand({ ${editorHint}`, { display: "system" }); - } catch (error46) { - logError2(error46); - onDone(`Error opening memory file: ${error46}`); + } catch (error42) { + logError2(error42); + onDone(`Error opening memory file: ${error42}`); } }; const handleCancel = () => { @@ -607778,8 +530344,8 @@ var init_Commands = __esm(() => { // src/components/PromptInput/utils.ts function isVimModeEnabled() { - const config6 = getGlobalConfig(); - return config6.editorMode === "vim"; + const config4 = getGlobalConfig(); + return config4.editorMode === "vim"; } function getNewlineInstructions() { if (env3.terminal === "Apple_Terminal" && process.platform === "darwin") { @@ -607790,13 +530356,13 @@ function getNewlineInstructions() { } return hasUsedBackslashReturn() ? "\\⏎ for newline" : "backslash (\\) + return (⏎) for newline"; } -function isNonSpacePrintable(input11, key) { +function isNonSpacePrintable(input, key) { if (key.ctrl || key.meta || key.escape || key.return || key.tab || key.backspace || key.delete || key.upArrow || key.downArrow || key.leftArrow || key.rightArrow || key.pageUp || key.pageDown || key.home || key.end) { return false; } - return input11.length > 0 && !/^\s/.test(input11) && !input11.startsWith("\x1B"); + return input.length > 0 && !/^\s/.test(input) && !input.startsWith("\x1B"); } -var init_utils11 = __esm(() => { +var init_utils10 = __esm(() => { init_terminalSetup(); init_config2(); init_env(); @@ -608320,7 +530886,7 @@ var init_PromptInputHelpMenu = __esm(() => { init_useShortcutDisplay(); init_growthbook(); init_fastMode(); - init_utils11(); + init_utils10(); jsx_dev_runtime209 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -608724,8 +531290,8 @@ function IdeAutoConnectDialog(t0) { return t5; } function shouldShowAutoConnectDialog() { - const config6 = getGlobalConfig(); - return !isSupportedTerminal() && config6.autoConnectIde !== true && config6.hasIdeAutoConnectDialogBeenShown !== true; + const config4 = getGlobalConfig(); + return !isSupportedTerminal() && config4.autoConnectIde !== true && config4.hasIdeAutoConnectDialogBeenShown !== true; } function IdeDisableAutoConnectDialog(t0) { const $2 = import_compiler_runtime168.c(10); @@ -608808,8 +531374,8 @@ function _temp96(current) { }; } function shouldShowDisableAutoConnectDialog() { - const config6 = getGlobalConfig(); - return !isSupportedTerminal() && config6.autoConnectIde === true; + const config4 = getGlobalConfig(); + return !isSupportedTerminal() && config4.autoConnectIde === true; } var import_compiler_runtime168, jsx_dev_runtime213; var init_IdeAutoConnectDialog = __esm(() => { @@ -608828,7 +531394,7 @@ __export(exports_ide, { formatWorkspaceFolders: () => formatWorkspaceFolders, call: () => call22 }); -import * as path23 from "path"; +import * as path18 from "path"; function IDEScreen(t0) { const $2 = import_compiler_runtime169.c(39); const { @@ -609501,7 +532067,7 @@ function formatWorkspaceFolders(folders, maxLength = 100) { const cwdNFC = cwd2.normalize("NFC"); const formattedFolders = foldersToShow.map((folder) => { const folderNFC = folder.normalize("NFC"); - if (folderNFC.startsWith(cwdNFC + path23.sep)) { + if (folderNFC.startsWith(cwdNFC + path18.sep)) { folder = folderNFC.slice(cwdNFC.length + 1); } if (folder.length <= maxLengthPerPath) { @@ -609509,11 +532075,11 @@ function formatWorkspaceFolders(folders, maxLength = 100) { } return "…" + folder.slice(-(maxLengthPerPath - 1)); }); - let result3 = formattedFolders.join(", "); + let result2 = formattedFolders.join(", "); if (hasMore) { - result3 += ", …"; + result2 += ", …"; } - return result3; + return result2; } var import_compiler_runtime169, import_react117, jsx_dev_runtime214, IDE_CONNECTION_TIMEOUT_MS = 35000; var init_ide2 = __esm(() => { @@ -609525,7 +532091,7 @@ var init_ide2 = __esm(() => { init_Dialog(); init_IdeAutoConnectDialog(); init_ink2(); - init_client10(); + init_client6(); init_AppState(); init_cwd2(); init_execFileNoThrow(); @@ -609765,7 +532331,7 @@ When building the list, work through these checks and include only what applies: - If tests are missing or sparse: suggest setting up a test framework so Claude can verify its own changes. - To help you create skills and optimize existing skills using evals, Claude Code has an official skill-creator plugin you can install. Install it with \`/plugin install skill-creator@claude-plugins-official\`, then run \`/skill-creator \` to create new skills or refine any existing skill. (Always include this one.) - Browse official plugins with \`/plugin\` — these bundle skills, agents, hooks, and MCP servers that you may find helpful. You can also create your own custom plugins to share them with others. (Always include this one.)`, command3, init_default4; -var init_init2 = __esm(() => { +var init_init = __esm(() => { init_bun_bundle(); init_projectOnboardingState(); init_envUtils(); @@ -610069,15 +532635,15 @@ function filterReservedShortcuts(blocks) { } function generateKeybindingsTemplate() { const bindings = filterReservedShortcuts(DEFAULT_BINDINGS); - const config6 = { + const config4 = { $schema: "https://www.schemastore.org/claude-code-keybindings.json", $docs: "https://code.claude.com/docs/en/keybindings", bindings }; - return jsonStringify(config6, null, 2) + ` + return jsonStringify(config4, null, 2) + ` `; } -var init_template4 = __esm(() => { +var init_template3 = __esm(() => { init_slowOperations(); init_defaultBindings(); init_reservedShortcuts(); @@ -610088,8 +532654,8 @@ var exports_keybindings = {}; __export(exports_keybindings, { call: () => call23 }); -import { mkdir as mkdir40, writeFile as writeFile43 } from "fs/promises"; -import { dirname as dirname55 } from "path"; +import { mkdir as mkdir40, writeFile as writeFile41 } from "fs/promises"; +import { dirname as dirname51 } from "path"; async function call23() { if (!isKeybindingCustomizationEnabled()) { return { @@ -610099,9 +532665,9 @@ async function call23() { } const keybindingsPath = getKeybindingsPath(); let fileExists = false; - await mkdir40(dirname55(keybindingsPath), { recursive: true }); + await mkdir40(dirname51(keybindingsPath), { recursive: true }); try { - await writeFile43(keybindingsPath, generateKeybindingsTemplate(), { + await writeFile41(keybindingsPath, generateKeybindingsTemplate(), { encoding: "utf-8", flag: "wx" }); @@ -610112,11 +532678,11 @@ async function call23() { throw e; } } - const result3 = await editFileInEditor(keybindingsPath); - if (result3.error) { + const result2 = await editFileInEditor(keybindingsPath); + if (result2.error) { return { type: "text", - value: `${fileExists ? "Opened" : "Created"} ${keybindingsPath}. Could not open in editor: ${result3.error}` + value: `${fileExists ? "Opened" : "Created"} ${keybindingsPath}. Could not open in editor: ${result2.error}` }; } return { @@ -610126,7 +532692,7 @@ async function call23() { } var init_keybindings = __esm(() => { init_loadUserBindings(); - init_template4(); + init_template3(); init_errors(); init_promptEditor(); }); @@ -610155,7 +532721,7 @@ var login_default = () => ({ load: () => Promise.resolve().then(() => (init_login(), exports_login)) }); var init_login2 = __esm(() => { - init_auth2(); + init_auth(); init_envUtils(); }); @@ -611460,7 +534026,7 @@ var init_CreatingStep = __esm(() => { function ErrorStep(t0) { const $2 = import_compiler_runtime176.c(15); const { - error: error46, + error: error42, errorReason, errorInstructions } = t0; @@ -611479,15 +534045,15 @@ function ErrorStep(t0) { t1 = $2[0]; } let t2; - if ($2[1] !== error46) { + if ($2[1] !== error42) { t2 = /* @__PURE__ */ jsx_dev_runtime221.jsxDEV(ThemedText, { color: "error", children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this); - $2[1] = error46; + $2[1] = error42; $2[2] = t2; } else { t2 = $2[2]; @@ -612007,11 +534573,11 @@ function OAuthFlowStep({ authorizationCode, state }); - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); setOAuthStatus({ state: "error", - message: err3.message, + message: err2.message, toRetry: { state: "waiting_for_login", url: url3 @@ -612023,7 +534589,7 @@ function OAuthFlowStep({ timersRef.current.forEach((timer) => clearTimeout(timer)); timersRef.current.clear(); try { - const result3 = await oauthService.startOAuthFlow(async (url_0) => { + const result2 = await oauthService.startOAuthFlow(async (url_0) => { setOAuthStatus({ state: "waiting_for_login", url: url_0 @@ -612038,7 +534604,7 @@ function OAuthFlowStep({ setOAuthStatus({ state: "processing" }); - saveOAuthTokensIfNeeded(result3); + saveOAuthTokensIfNeeded(result2); const timer1 = setTimeout((setOAuthStatus_0, accessToken, onSuccess_0, timersRef_0) => { setOAuthStatus_0({ state: "success", @@ -612046,7 +534612,7 @@ function OAuthFlowStep({ }); const timer2 = setTimeout(onSuccess_0, 1000, accessToken); timersRef_0.current.add(timer2); - }, 100, setOAuthStatus, result3.accessToken, onSuccess, timersRef); + }, 100, setOAuthStatus, result2.accessToken, onSuccess, timersRef); timersRef.current.add(timer1); } catch (err_0) { const errorMessage2 = err_0.message; @@ -612291,7 +534857,7 @@ var init_OAuthFlowStep = __esm(() => { init_osc(); init_ink2(); init_oauth2(); - init_auth2(); + init_auth(); init_log3(); jsx_dev_runtime224 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -612672,17 +535238,17 @@ Need help? Common issues: ...current, githubActionSetupCount: (current.githubActionSetupCount ?? 0) + 1 })); - } catch (error46) { - if (!error46 || !(error46 instanceof Error) || !error46.message.includes("Failed to")) { + } catch (error42) { + if (!error42 || !(error42 instanceof Error) || !error42.message.includes("Failed to")) { logEvent("tengu_setup_github_actions_failed", { reason: "unexpected_error", ...context2 }); } - if (error46 instanceof Error) { - logError2(error46); + if (error42 instanceof Error) { + logError2(error42); } - throw error46; + throw error42; } } var init_setupGitHubActions = __esm(() => { @@ -612819,14 +535385,14 @@ function _temp236(warning, index) { ] }, index, true, undefined, this); } -function _temp100(instruction, i4) { +function _temp100(instruction, i3) { return /* @__PURE__ */ jsx_dev_runtime226.jsxDEV(ThemedText, { dimColor: true, children: [ "• ", instruction ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } var import_compiler_runtime180, jsx_dev_runtime226; var init_WarningsStep = __esm(() => { @@ -612941,8 +535507,8 @@ function InstallGitHubApp(props) { ...prev_5, step: "success" })); - } catch (error46) { - const errorMessage2 = error46 instanceof Error ? error46.message : "Failed to set up GitHub Actions"; + } catch (error42) { + const errorMessage2 = error42 instanceof Error ? error42.message : "Failed to set up GitHub Actions"; if (errorMessage2.includes("workflow file already exists")) { logEvent("tengu_install_github_app_error", { reason: "workflow_file_exists" @@ -612974,14 +535540,14 @@ function InstallGitHubApp(props) { } async function checkRepositoryPermissions(repoName) { try { - const result3 = await execFileNoThrow("gh", ["api", `repos/${repoName}`, "--jq", ".permissions.admin"]); - if (result3.code === 0) { - const hasAdmin = result3.stdout.trim() === "true"; + const result2 = await execFileNoThrow("gh", ["api", `repos/${repoName}`, "--jq", ".permissions.admin"]); + if (result2.code === 0) { + const hasAdmin = result2.stdout.trim() === "true"; return { hasAccess: hasAdmin }; } - if (result3.stderr.includes("404") || result3.stderr.includes("Not Found")) { + if (result2.stderr.includes("404") || result2.stderr.includes("Not Found")) { return { hasAccess: false, error: "repository_not_found" @@ -613421,7 +535987,7 @@ var init_install_github_app = __esm(() => { init_WorkflowMultiselectDialog(); init_useExitOnCtrlCDWithKeybindings(); init_ink2(); - init_auth2(); + init_auth(); init_browser(); init_execFileNoThrow(); init_git(); @@ -613532,7 +536098,7 @@ function MCPAgentServerMenu({ }) { const [theme] = useTheme(); const [isAuthenticating, setIsAuthenticating] = import_react124.useState(false); - const [error46, setError] = import_react124.useState(null); + const [error42, setError] = import_react124.useState(null); const [authorizationUrl, setAuthorizationUrl] = import_react124.useState(null); const authAbortControllerRef = import_react124.useRef(null); import_react124.useEffect(() => () => authAbortControllerRef.current?.abort(), []); @@ -613563,9 +536129,9 @@ function MCPAgentServerMenu({ }; await performMCPOAuthFlow(agentServer.name, tempConfig, setAuthorizationUrl, controller.signal); onComplete?.(`Authentication successful for ${agentServer.name}. The server will connect when the agent runs.`); - } catch (err3) { - if (err3 instanceof Error && !(err3 instanceof AuthenticationCancelledError)) { - setError(err3.message); + } catch (err2) { + if (err2 instanceof Error && !(err2 instanceof AuthenticationCancelledError)) { + setError(err2.message); } } finally { setIsAuthenticating(false); @@ -613760,12 +536326,12 @@ function MCPAgentServerMenu({ children: "This server connects only when running the agent." }, undefined, false, undefined, this) }, undefined, false, undefined, this), - error46 && /* @__PURE__ */ jsx_dev_runtime228.jsxDEV(ThemedBox_default, { + error42 && /* @__PURE__ */ jsx_dev_runtime228.jsxDEV(ThemedBox_default, { children: /* @__PURE__ */ jsx_dev_runtime228.jsxDEV(ThemedText, { color: "error", children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this) }, undefined, false, undefined, this), @@ -613794,7 +536360,7 @@ var init_MCPAgentServerMenu = __esm(() => { import_react124 = __toESM(require_react(), 1); init_ink2(); init_useKeybinding(); - init_auth7(); + init_auth6(); init_stringUtils(); init_ConfigurableShortcutHint(); init_CustomSelect(); @@ -614470,7 +537036,7 @@ var init_MCPListPanel = __esm(() => { import_react125 = __toESM(require_react(), 1); init_ink2(); init_useKeybinding(); - init_utils4(); + init_utils3(); init_debug(); init_stringUtils(); init_ConfigurableShortcutHint(); @@ -614608,7 +537174,7 @@ var init_channelNotification = __esm(() => { init_v4(); init_state(); init_xml(); - init_auth2(); + init_auth(); init_pluginIdentifier(); init_settings2(); init_channelAllowlist(); @@ -614633,15 +537199,15 @@ var init_channelNotification = __esm(() => { function isChannelPermissionRelayEnabled() { return getFeatureValue_CACHED_MAY_BE_STALE("tengu_harbor_permissions", false); } -function hashToId(input11) { +function hashToId(input) { let h2 = 2166136261; - for (let i4 = 0;i4 < input11.length; i4++) { - h2 ^= input11.charCodeAt(i4); + for (let i3 = 0;i3 < input.length; i3++) { + h2 ^= input.charCodeAt(i3); h2 = Math.imul(h2, 16777619); } h2 = h2 >>> 0; let s = ""; - for (let i4 = 0;i4 < 5; i4++) { + for (let i3 = 0;i3 < 5; i3++) { s += ID_ALPHABET[h2 % 25]; h2 = Math.floor(h2 / 25); } @@ -614657,9 +537223,9 @@ function shortRequestId(toolUseID) { } return candidate; } -function truncateForPreview(input11) { +function truncateForPreview(input) { try { - const s = jsonStringify(input11); + const s = jsonStringify(input); return s.length > 200 ? s.slice(0, 200) + "…" : s; } catch { return "(unserializable)"; @@ -614671,9 +537237,9 @@ function filterPermissionRelayClients(clients, isInAllowlist) { function createChannelPermissionCallbacks() { const pending2 = new Map; return { - onResponse(requestId, handler14) { + onResponse(requestId, handler19) { const key = requestId.toLowerCase(); - pending2.set(key, handler14); + pending2.set(key, handler19); return () => { pending2.delete(key); }; @@ -614725,25 +537291,25 @@ var init_channelPermissions = __esm(() => { var exports_localSearch = {}; __export(exports_localSearch, { default: () => localSearch_default, - __stub__: () => __stub__23 + __stub__: () => __stub__30 }); -var localSearch_default, __stub__23 = true; +var localSearch_default, __stub__30 = true; var init_localSearch = __esm(() => { localSearch_default = {}; }); // src/services/mcp/useManageMCPConnections.ts -import { basename as basename40 } from "path"; -function getErrorKey(error46) { - const plugin = "plugin" in error46 ? error46.plugin : "no-plugin"; - return `${error46.type}:${error46.source}:${plugin}`; +import { basename as basename38 } from "path"; +function getErrorKey(error42) { + const plugin = "plugin" in error42 ? error42.plugin : "no-plugin"; + return `${error42.type}:${error42.source}:${plugin}`; } function addErrorsToAppState(setAppState, newErrors) { if (newErrors.length === 0) return; setAppState((prevState) => { const existingKeys = new Set(prevState.plugins.errors.map((e) => getErrorKey(e))); - const uniqueNewErrors = newErrors.filter((error46) => !existingKeys.has(getErrorKey(error46))); + const uniqueNewErrors = newErrors.filter((error42) => !existingKeys.has(getErrorKey(error42))); if (uniqueNewErrors.length === 0) { return prevState; } @@ -614800,27 +537366,27 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { pendingUpdatesRef.current = []; setAppState((prevState) => { let mcp = prevState.mcp; - for (const update3 of updates) { + for (const update2 of updates) { const { tools: rawTools, commands: rawCmds, resources: rawRes, - ...client5 - } = update3; - const tools = client5.type === "disabled" || client5.type === "failed" ? rawTools ?? [] : rawTools; - const commands = client5.type === "disabled" || client5.type === "failed" ? rawCmds ?? [] : rawCmds; - const resources = client5.type === "disabled" || client5.type === "failed" ? rawRes ?? [] : rawRes; - const prefix = getMcpPrefix(client5.name); - const existingClientIndex = mcp.clients.findIndex((c6) => c6.name === client5.name); - const updatedClients = existingClientIndex === -1 ? [...mcp.clients, client5] : mcp.clients.map((c6) => c6.name === client5.name ? client5 : c6); + ...client2 + } = update2; + const tools = client2.type === "disabled" || client2.type === "failed" ? rawTools ?? [] : rawTools; + const commands = client2.type === "disabled" || client2.type === "failed" ? rawCmds ?? [] : rawCmds; + const resources = client2.type === "disabled" || client2.type === "failed" ? rawRes ?? [] : rawRes; + const prefix = getMcpPrefix(client2.name); + const existingClientIndex = mcp.clients.findIndex((c6) => c6.name === client2.name); + const updatedClients = existingClientIndex === -1 ? [...mcp.clients, client2] : mcp.clients.map((c6) => c6.name === client2.name ? client2 : c6); const updatedTools = tools === undefined ? mcp.tools : [...reject_default(mcp.tools, (t) => t.name?.startsWith(prefix)), ...tools]; const updatedCommands = commands === undefined ? mcp.commands : [ - ...reject_default(mcp.commands, (c6) => commandBelongsToServer(c6, client5.name)), + ...reject_default(mcp.commands, (c6) => commandBelongsToServer(c6, client2.name)), ...commands ]; const updatedResources = resources === undefined ? mcp.resources : { ...mcp.resources, - ...resources.length > 0 ? { [client5.name]: resources } : omit_default(mcp.resources, client5.name) + ...resources.length > 0 ? { [client2.name]: resources } : omit_default(mcp.resources, client2.name) }; mcp = { ...mcp, @@ -614833,95 +537399,95 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { return { ...prevState, mcp }; }); }, [setAppState]); - const updateServer = import_react126.useCallback((update3) => { - pendingUpdatesRef.current.push(update3); + const updateServer = import_react126.useCallback((update2) => { + pendingUpdatesRef.current.push(update2); if (flushTimerRef.current === null) { flushTimerRef.current = setTimeout(flushPendingUpdates, MCP_BATCH_FLUSH_MS); } }, [flushPendingUpdates]); const onConnectionAttempt = import_react126.useCallback(({ - client: client5, + client: client2, tools, commands, resources }) => { - updateServer({ ...client5, tools, commands, resources }); - switch (client5.type) { + updateServer({ ...client2, tools, commands, resources }); + switch (client2.type) { case "connected": { - registerElicitationHandler(client5.client, client5.name, setAppState); - client5.client.onclose = () => { - const configType = client5.config.type ?? "stdio"; - clearServerCache(client5.name, client5.config).catch(() => { - logForDebugging(`Failed to invalidate the server cache: ${client5.name}`); + registerElicitationHandler(client2.client, client2.name, setAppState); + client2.client.onclose = () => { + const configType = client2.config.type ?? "stdio"; + clearServerCache(client2.name, client2.config).catch(() => { + logForDebugging(`Failed to invalidate the server cache: ${client2.name}`); }); - if (isMcpServerDisabled(client5.name)) { - logMCPDebug(client5.name, `Server is disabled, skipping automatic reconnection`); + if (isMcpServerDisabled(client2.name)) { + logMCPDebug(client2.name, `Server is disabled, skipping automatic reconnection`); return; } if (configType !== "stdio" && configType !== "sdk") { const transportType = getTransportDisplayName(configType); - logMCPDebug(client5.name, `${transportType} transport closed/disconnected, attempting automatic reconnection`); - const existingTimer = reconnectTimersRef.current.get(client5.name); + logMCPDebug(client2.name, `${transportType} transport closed/disconnected, attempting automatic reconnection`); + const existingTimer = reconnectTimersRef.current.get(client2.name); if (existingTimer) { clearTimeout(existingTimer); - reconnectTimersRef.current.delete(client5.name); + reconnectTimersRef.current.delete(client2.name); } const reconnectWithBackoff = async () => { - for (let attempt3 = 1;attempt3 <= MAX_RECONNECT_ATTEMPTS; attempt3++) { - if (isMcpServerDisabled(client5.name)) { - logMCPDebug(client5.name, `Server disabled during reconnection, stopping retry`); - reconnectTimersRef.current.delete(client5.name); + for (let attempt2 = 1;attempt2 <= MAX_RECONNECT_ATTEMPTS; attempt2++) { + if (isMcpServerDisabled(client2.name)) { + logMCPDebug(client2.name, `Server disabled during reconnection, stopping retry`); + reconnectTimersRef.current.delete(client2.name); return; } updateServer({ - ...client5, + ...client2, type: "pending", - reconnectAttempt: attempt3, + reconnectAttempt: attempt2, maxReconnectAttempts: MAX_RECONNECT_ATTEMPTS }); const reconnectStartTime = Date.now(); try { - const result3 = await reconnectMcpServerImpl(client5.name, client5.config); + const result2 = await reconnectMcpServerImpl(client2.name, client2.config); const elapsed = Date.now() - reconnectStartTime; - if (result3.client.type === "connected") { - logMCPDebug(client5.name, `${transportType} reconnection successful after ${elapsed}ms (attempt ${attempt3})`); - reconnectTimersRef.current.delete(client5.name); - onConnectionAttempt(result3); + if (result2.client.type === "connected") { + logMCPDebug(client2.name, `${transportType} reconnection successful after ${elapsed}ms (attempt ${attempt2})`); + reconnectTimersRef.current.delete(client2.name); + onConnectionAttempt(result2); return; } - logMCPDebug(client5.name, `${transportType} reconnection attempt ${attempt3} completed with status: ${result3.client.type}`); - if (attempt3 === MAX_RECONNECT_ATTEMPTS) { - logMCPDebug(client5.name, `Max reconnection attempts (${MAX_RECONNECT_ATTEMPTS}) reached, giving up`); - reconnectTimersRef.current.delete(client5.name); - onConnectionAttempt(result3); + logMCPDebug(client2.name, `${transportType} reconnection attempt ${attempt2} completed with status: ${result2.client.type}`); + if (attempt2 === MAX_RECONNECT_ATTEMPTS) { + logMCPDebug(client2.name, `Max reconnection attempts (${MAX_RECONNECT_ATTEMPTS}) reached, giving up`); + reconnectTimersRef.current.delete(client2.name); + onConnectionAttempt(result2); return; } - } catch (error46) { + } catch (error42) { const elapsed = Date.now() - reconnectStartTime; - logMCPError(client5.name, `${transportType} reconnection attempt ${attempt3} failed after ${elapsed}ms: ${error46}`); - if (attempt3 === MAX_RECONNECT_ATTEMPTS) { - logMCPDebug(client5.name, `Max reconnection attempts (${MAX_RECONNECT_ATTEMPTS}) reached, giving up`); - reconnectTimersRef.current.delete(client5.name); - updateServer({ ...client5, type: "failed" }); + logMCPError(client2.name, `${transportType} reconnection attempt ${attempt2} failed after ${elapsed}ms: ${error42}`); + if (attempt2 === MAX_RECONNECT_ATTEMPTS) { + logMCPDebug(client2.name, `Max reconnection attempts (${MAX_RECONNECT_ATTEMPTS}) reached, giving up`); + reconnectTimersRef.current.delete(client2.name); + updateServer({ ...client2, type: "failed" }); return; } } - const backoffMs = Math.min(INITIAL_BACKOFF_MS * Math.pow(2, attempt3 - 1), MAX_BACKOFF_MS); - logMCPDebug(client5.name, `Scheduling reconnection attempt ${attempt3 + 1} in ${backoffMs}ms`); - await new Promise((resolve43) => { - const timer = setTimeout(resolve43, backoffMs); - reconnectTimersRef.current.set(client5.name, timer); + const backoffMs = Math.min(INITIAL_BACKOFF_MS * Math.pow(2, attempt2 - 1), MAX_BACKOFF_MS); + logMCPDebug(client2.name, `Scheduling reconnection attempt ${attempt2 + 1} in ${backoffMs}ms`); + await new Promise((resolve37) => { + const timer = setTimeout(resolve37, backoffMs); + reconnectTimersRef.current.set(client2.name, timer); }); } }; reconnectWithBackoff(); } else { - updateServer({ ...client5, type: "failed" }); + updateServer({ ...client2, type: "failed" }); } }; if (feature("KAIROS") || feature("KAIROS_CHANNELS")) { - const gate = gateChannelServer(client5.name, client5.capabilities, client5.config.pluginSource); - const entry = findChannelEntry(client5.name, getAllowedChannels()); + const gate = gateChannelServer(client2.name, client2.capabilities, client2.config.pluginSource); + const entry = findChannelEntry(client2.name, getAllowedChannels()); const pluginId = entry?.kind === "plugin" ? `${entry.name}@${entry.marketplace}` : undefined; if (gate.action === "register" || gate.kind !== "capability") { logEvent("tengu_mcp_channel_gate", { @@ -614934,10 +537500,10 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { } switch (gate.action) { case "register": - logMCPDebug(client5.name, "Channel notifications registered"); - client5.client.setNotificationHandler(ChannelMessageNotificationSchema(), async (notification) => { + logMCPDebug(client2.name, "Channel notifications registered"); + client2.client.setNotificationHandler(ChannelMessageNotificationSchema(), async (notification) => { const { content, meta } = notification.params; - logMCPDebug(client5.name, `notifications/claude/channel: ${content.slice(0, 80)}`); + logMCPDebug(client2.name, `notifications/claude/channel: ${content.slice(0, 80)}`); logEvent("tengu_mcp_channel_message", { content_length: content.length, meta_key_count: Object.keys(meta ?? {}).length, @@ -614947,32 +537513,32 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { }); enqueue({ mode: "prompt", - value: wrapChannelMessage(client5.name, content, meta), + value: wrapChannelMessage(client2.name, content, meta), priority: "next", isMeta: true, - origin: { kind: "channel", server: client5.name }, + origin: { kind: "channel", server: client2.name }, skipSlashCommands: true }); }); - if (client5.capabilities?.experimental?.["claude/channel/permission"] !== undefined) { - client5.client.setNotificationHandler(ChannelPermissionNotificationSchema(), async (notification) => { + if (client2.capabilities?.experimental?.["claude/channel/permission"] !== undefined) { + client2.client.setNotificationHandler(ChannelPermissionNotificationSchema(), async (notification) => { const { request_id, behavior } = notification.params; - const resolved = channelPermCallbacksRef.current?.resolve(request_id, behavior, client5.name) ?? false; - logMCPDebug(client5.name, `notifications/claude/channel/permission: ${request_id} → ${behavior} (${resolved ? "matched pending" : "no pending entry — stale or unknown ID"})`); + const resolved = channelPermCallbacksRef.current?.resolve(request_id, behavior, client2.name) ?? false; + logMCPDebug(client2.name, `notifications/claude/channel/permission: ${request_id} → ${behavior} (${resolved ? "matched pending" : "no pending entry — stale or unknown ID"})`); }); } break; case "skip": - client5.client.removeNotificationHandler("notifications/claude/channel"); - client5.client.removeNotificationHandler(CHANNEL_PERMISSION_METHOD); - logMCPDebug(client5.name, `Channel notifications skipped: ${gate.reason}`); + client2.client.removeNotificationHandler("notifications/claude/channel"); + client2.client.removeNotificationHandler(CHANNEL_PERMISSION_METHOD); + logMCPDebug(client2.name, `Channel notifications skipped: ${gate.reason}`); if (gate.kind !== "capability" && gate.kind !== "session" && !channelWarnedKindsRef.current.has(gate.kind) && (gate.kind === "marketplace" || gate.kind === "allowlist" || entry !== undefined)) { channelWarnedKindsRef.current.add(gate.kind); - const text2 = gate.kind === "disabled" ? "Channels are not currently available" : gate.kind === "auth" ? "Channels require claude.ai authentication · run /login" : gate.kind === "policy" ? "Channels are not enabled for your org · have an administrator set channelsEnabled: true in managed settings" : gate.reason; + const text = gate.kind === "disabled" ? "Channels are not currently available" : gate.kind === "auth" ? "Channels require claude.ai authentication · run /login" : gate.kind === "policy" ? "Channels are not enabled for your org · have an administrator set channelsEnabled: true in managed settings" : gate.reason; addNotification({ key: `channels-blocked-${gate.kind}`, priority: "high", - text: text2, + text, color: "warning", timeoutMs: 12000 }); @@ -614980,13 +537546,13 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { break; } } - if (client5.capabilities?.tools?.listChanged) { - client5.client.setNotificationHandler(ToolListChangedNotificationSchema, async () => { - logMCPDebug(client5.name, `Received tools/list_changed notification, refreshing tools`); + if (client2.capabilities?.tools?.listChanged) { + client2.client.setNotificationHandler(ToolListChangedNotificationSchema, async () => { + logMCPDebug(client2.name, `Received tools/list_changed notification, refreshing tools`); try { - const previousToolsPromise = fetchToolsForClient.cache.get(client5.name); - fetchToolsForClient.cache.delete(client5.name); - const newTools = await fetchToolsForClient(client5); + const previousToolsPromise = fetchToolsForClient.cache.get(client2.name); + fetchToolsForClient.cache.delete(client2.name); + const newTools = await fetchToolsForClient(client2); const newCount = newTools.length; if (previousToolsPromise) { previousToolsPromise.then((previousTools) => { @@ -615007,62 +537573,62 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { newCount }); } - updateServer({ ...client5, tools: newTools }); - } catch (error46) { - logMCPError(client5.name, `Failed to refresh tools after list_changed notification: ${errorMessage(error46)}`); + updateServer({ ...client2, tools: newTools }); + } catch (error42) { + logMCPError(client2.name, `Failed to refresh tools after list_changed notification: ${errorMessage(error42)}`); } }); } - if (client5.capabilities?.prompts?.listChanged) { - client5.client.setNotificationHandler(PromptListChangedNotificationSchema, async () => { - logMCPDebug(client5.name, `Received prompts/list_changed notification, refreshing prompts`); + if (client2.capabilities?.prompts?.listChanged) { + client2.client.setNotificationHandler(PromptListChangedNotificationSchema, async () => { + logMCPDebug(client2.name, `Received prompts/list_changed notification, refreshing prompts`); logEvent("tengu_mcp_list_changed", { type: "prompts" }); try { - fetchCommandsForClient.cache.delete(client5.name); + fetchCommandsForClient.cache.delete(client2.name); const [mcpPrompts, mcpSkills] = await Promise.all([ - fetchCommandsForClient(client5), - feature("MCP_SKILLS") ? fetchMcpSkillsForClient3(client5) : Promise.resolve([]) + fetchCommandsForClient(client2), + feature("MCP_SKILLS") ? fetchMcpSkillsForClient3(client2) : Promise.resolve([]) ]); updateServer({ - ...client5, + ...client2, commands: [...mcpPrompts, ...mcpSkills] }); clearSkillIndexCache2?.(); - } catch (error46) { - logMCPError(client5.name, `Failed to refresh prompts after list_changed notification: ${errorMessage(error46)}`); + } catch (error42) { + logMCPError(client2.name, `Failed to refresh prompts after list_changed notification: ${errorMessage(error42)}`); } }); } - if (client5.capabilities?.resources?.listChanged) { - client5.client.setNotificationHandler(ResourceListChangedNotificationSchema, async () => { - logMCPDebug(client5.name, `Received resources/list_changed notification, refreshing resources`); + if (client2.capabilities?.resources?.listChanged) { + client2.client.setNotificationHandler(ResourceListChangedNotificationSchema, async () => { + logMCPDebug(client2.name, `Received resources/list_changed notification, refreshing resources`); logEvent("tengu_mcp_list_changed", { type: "resources" }); try { - fetchResourcesForClient.cache.delete(client5.name); + fetchResourcesForClient.cache.delete(client2.name); if (feature("MCP_SKILLS")) { - fetchMcpSkillsForClient3.cache.delete(client5.name); - fetchCommandsForClient.cache.delete(client5.name); + fetchMcpSkillsForClient3.cache.delete(client2.name); + fetchCommandsForClient.cache.delete(client2.name); const [newResources, mcpPrompts, mcpSkills] = await Promise.all([ - fetchResourcesForClient(client5), - fetchCommandsForClient(client5), - fetchMcpSkillsForClient3(client5) + fetchResourcesForClient(client2), + fetchCommandsForClient(client2), + fetchMcpSkillsForClient3(client2) ]); updateServer({ - ...client5, + ...client2, resources: newResources, commands: [...mcpPrompts, ...mcpSkills] }); clearSkillIndexCache2?.(); } else { - const newResources = await fetchResourcesForClient(client5); - updateServer({ ...client5, resources: newResources }); + const newResources = await fetchResourcesForClient(client2); + updateServer({ ...client2, resources: newResources }); } - } catch (error46) { - logMCPError(client5.name, `Failed to refresh resources after list_changed notification: ${errorMessage(error46)}`); + } catch (error42) { + logMCPError(client2.name, `Failed to refresh resources after list_changed notification: ${errorMessage(error42)}`); } }); } @@ -615095,10 +537661,10 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { } } const existingServerNames = new Set(mcpWithoutStale.clients.map((c6) => c6.name)); - const newClients = Object.entries(configs).filter(([name]) => !existingServerNames.has(name)).map(([name, config6]) => ({ + const newClients = Object.entries(configs).filter(([name]) => !existingServerNames.has(name)).map(([name, config4]) => ({ name, type: isMcpServerDisabled(name) ? "disabled" : "pending", - config: config6 + config: config4 })); if (newClients.length === 0 && stale.length === 0) { return prevState; @@ -615113,8 +537679,8 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { }; }); } - initializeServersAsPending().catch((error46) => { - logMCPError("useManageMCPConnections", `Failed to initialize servers as pending: ${errorMessage(error46)}`); + initializeServersAsPending().catch((error42) => { + logMCPError("useManageMCPConnections", `Failed to initialize servers as pending: ${errorMessage(error42)}`); }); }, [ isStrictMcpConfig, @@ -615139,8 +537705,8 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { addErrorsToAppState(setAppState, mcpErrors); const configs = { ...claudeCodeConfigs, ...dynamicMcpConfig }; const enabledConfigs = Object.fromEntries(Object.entries(configs).filter(([name]) => !isMcpServerDisabled(name))); - getMcpToolsCommandsAndResources(onConnectionAttempt, enabledConfigs).catch((error46) => { - logMCPError("useManageMcpConnections", `Failed to get MCP resources: ${errorMessage(error46)}`); + getMcpToolsCommandsAndResources(onConnectionAttempt, enabledConfigs).catch((error42) => { + logMCPError("useManageMcpConnections", `Failed to get MCP resources: ${errorMessage(error42)}`); }); let claudeaiConfigs = {}; if (!isStrictMcpConfig) { @@ -615154,10 +537720,10 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { if (Object.keys(claudeaiConfigs).length > 0) { setAppState((prevState) => { const existingServerNames = new Set(prevState.mcp.clients.map((c6) => c6.name)); - const newClients = Object.entries(claudeaiConfigs).filter(([name]) => !existingServerNames.has(name)).map(([name, config6]) => ({ + const newClients = Object.entries(claudeaiConfigs).filter(([name]) => !existingServerNames.has(name)).map(([name, config4]) => ({ name, type: isMcpServerDisabled(name) ? "disabled" : "pending", - config: config6 + config: config4 })); if (newClients.length === 0) return prevState; @@ -615170,8 +537736,8 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { }; }); const enabledClaudeaiConfigs = Object.fromEntries(Object.entries(claudeaiConfigs).filter(([name]) => !isMcpServerDisabled(name))); - getMcpToolsCommandsAndResources(onConnectionAttempt, enabledClaudeaiConfigs).catch((error46) => { - logMCPError("useManageMcpConnections", `Failed to get claude.ai MCP resources: ${errorMessage(error46)}`); + getMcpToolsCommandsAndResources(onConnectionAttempt, enabledClaudeaiConfigs).catch((error42) => { + logMCPError("useManageMcpConnections", `Failed to get claude.ai MCP resources: ${errorMessage(error42)}`); }); } } @@ -615199,7 +537765,7 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { else if (serverConfig.scope === "claudeai") counts.claudeai++; if (process.env.USER_TYPE === "ant" && !isMcpServerDisabled(name) && (serverConfig.type === undefined || serverConfig.type === "stdio") && "command" in serverConfig) { - stdioCommands.push(basename40(serverConfig.command)); + stdioCommands.push(basename38(serverConfig.command)); } } logEvent("tengu_mcp_servers", { @@ -615237,8 +537803,8 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { }; }, [flushPendingUpdates]); const reconnectMcpServer = import_react126.useCallback(async (serverName) => { - const client5 = store.getState().mcp.clients.find((c6) => c6.name === serverName); - if (!client5) { + const client2 = store.getState().mcp.clients.find((c6) => c6.name === serverName); + if (!client2) { throw new Error(`MCP server ${serverName} not found`); } const existingTimer = reconnectTimersRef.current.get(serverName); @@ -615246,16 +537812,16 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { clearTimeout(existingTimer); reconnectTimersRef.current.delete(serverName); } - const result3 = await reconnectMcpServerImpl(serverName, client5.config); - onConnectionAttempt(result3); - return result3; + const result2 = await reconnectMcpServerImpl(serverName, client2.config); + onConnectionAttempt(result2); + return result2; }, [store, onConnectionAttempt]); const toggleMcpServer = import_react126.useCallback(async (serverName) => { - const client5 = store.getState().mcp.clients.find((c6) => c6.name === serverName); - if (!client5) { + const client2 = store.getState().mcp.clients.find((c6) => c6.name === serverName); + if (!client2) { throw new Error(`MCP server ${serverName} not found`); } - const isCurrentlyDisabled = client5.type === "disabled"; + const isCurrentlyDisabled = client2.type === "disabled"; if (!isCurrentlyDisabled) { const existingTimer = reconnectTimersRef.current.get(serverName); if (existingTimer) { @@ -615263,23 +537829,23 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) { reconnectTimersRef.current.delete(serverName); } setMcpServerEnabled(serverName, false); - if (client5.type === "connected") { - await clearServerCache(serverName, client5.config); + if (client2.type === "connected") { + await clearServerCache(serverName, client2.config); } updateServer({ name: serverName, type: "disabled", - config: client5.config + config: client2.config }); } else { setMcpServerEnabled(serverName, true); updateServer({ name: serverName, type: "pending", - config: client5.config + config: client2.config }); - const result3 = await reconnectMcpServerImpl(serverName, client5.config); - onConnectionAttempt(result3); + const result2 = await reconnectMcpServerImpl(serverName, client2.config); + onConnectionAttempt(result2); } }, [store, updateServer, onConnectionAttempt]); return { reconnectMcpServer, toggleMcpServer }; @@ -615300,7 +537866,7 @@ var init_useManageMCPConnections = __esm(() => { init_bun_bundle(); import_react126 = __toESM(require_react(), 1); init_state(); - init_client10(); + init_client6(); init_types4(); init_omit(); init_reject(); @@ -615318,7 +537884,7 @@ var init_useManageMCPConnections = __esm(() => { init_claudeai(); init_elicitationHandler(); init_mcpStringUtils(); - init_utils4(); + init_utils3(); fetchMcpSkillsForClient3 = feature("MCP_SKILLS") ? (init_mcpSkills(), __toCommonJS(exports_mcpSkills)).fetchMcpSkillsForClient : null; clearSkillIndexCache2 = feature("EXPERIMENTAL_SKILL_SEARCH") ? (init_localSearch(), __toCommonJS(exports_localSearch)).clearSkillIndexCache : null; }); @@ -615396,7 +537962,7 @@ function MCPReconnect(t0) { const store = useAppStateStore(); const reconnectMcpServer = useMcpReconnect(); const [isReconnecting, setIsReconnecting] = import_react128.useState(true); - const [error46, setError] = import_react128.useState(null); + const [error42, setError] = import_react128.useState(null); let t1; let t2; if ($2[0] !== onComplete || $2[1] !== reconnectMcpServer || $2[2] !== serverName || $2[3] !== store) { @@ -615410,9 +537976,9 @@ function MCPReconnect(t0) { onComplete(`MCP server "${serverName}" not found`); return; } - const result3 = await reconnectMcpServer(serverName); + const result2 = await reconnectMcpServer(serverName); bb43: - switch (result3.client.type) { + switch (result2.client.type) { case "connected": { setIsReconnecting(false); onComplete(`Successfully reconnected to ${serverName}`); @@ -615433,8 +537999,8 @@ function MCPReconnect(t0) { } } } catch (t3) { - const err3 = t3; - const errorMessage2 = err3 instanceof Error ? err3.message : String(err3); + const err2 = t3; + const errorMessage2 = err2 instanceof Error ? err2.message : String(err2); setError(errorMessage2); setIsReconnecting(false); onComplete(`Error: ${errorMessage2}`); @@ -615504,7 +538070,7 @@ function MCPReconnect(t0) { } return t5; } - if (error46) { + if (error42) { let t3; if ($2[11] !== theme) { t3 = color("error", theme)(figures_default.cross); @@ -615555,15 +538121,15 @@ function MCPReconnect(t0) { t6 = $2[19]; } let t7; - if ($2[20] !== error46) { + if ($2[20] !== error42) { t7 = /* @__PURE__ */ jsx_dev_runtime231.jsxDEV(ThemedText, { dimColor: true, children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this); - $2[20] = error46; + $2[20] = error42; $2[21] = t7; } else { t7 = $2[21]; @@ -615675,8 +538241,8 @@ var init_CapabilitiesSection = __esm(() => { }); // src/components/mcp/utils/reconnectHelpers.tsx -function handleReconnectResult(result3, serverName) { - switch (result3.client.type) { +function handleReconnectResult(result2, serverName) { + switch (result2.client.type) { case "connected": return { message: `Reconnected to ${serverName}.`, @@ -615699,8 +538265,8 @@ function handleReconnectResult(result3, serverName) { }; } } -function handleReconnectError(error46, serverName) { - const errorMessage2 = error46 instanceof Error ? error46.message : String(error46); +function handleReconnectError(error42, serverName) { + const errorMessage2 = error42 instanceof Error ? error42.message : String(error42); return `Error reconnecting to ${serverName}: ${errorMessage2}`; } @@ -615719,7 +538285,7 @@ function MCPRemoteServerMenu({ columns: terminalColumns } = useTerminalSize(); const [isAuthenticating, setIsAuthenticating] = import_react129.default.useState(false); - const [error46, setError] = import_react129.default.useState(null); + const [error42, setError] = import_react129.default.useState(null); const mcp = useAppState((s) => s.mcp); const setAppState = useSetAppState(); const [authorizationUrl, setAuthorizationUrl] = import_react129.default.useState(null); @@ -615750,23 +538316,23 @@ function MCPRemoteServerMenu({ setClaudeAIAuthUrl(null); setIsReconnecting(true); try { - const result3 = await reconnectMcpServer(server.name); - const success2 = result3.client.type === "connected"; + const result2 = await reconnectMcpServer(server.name); + const success2 = result2.client.type === "connected"; logEvent("tengu_claudeai_mcp_auth_completed", { success: success2 }); if (success2) { onComplete?.(`Authentication successful. Connected to ${server.name}.`); - } else if (result3.client.type === "needs-auth") { + } else if (result2.client.type === "needs-auth") { onComplete?.("Authentication successful, but server still requires authentication. You may need to manually restart Claude Code."); } else { onComplete?.("Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect."); } - } catch (err3) { + } catch (err2) { logEvent("tengu_claudeai_mcp_auth_completed", { success: false }); - onComplete?.(handleReconnectError(err3, server.name)); + onComplete?.(handleReconnectError(err2, server.name)); } finally { setIsReconnecting(false); } @@ -615825,7 +538391,7 @@ function MCPRemoteServerMenu({ context: "Confirmation", isActive: isClaudeAIClearingAuth }); - use_input_default((input11, key) => { + use_input_default((input, key) => { if (key.return && isClaudeAIAuthenticating) { handleClaudeAIAuthComplete(); } @@ -615839,7 +538405,7 @@ function MCPRemoteServerMenu({ openBrowser(connectorsUrl); } } - if (input11 === "c" && !urlCopied) { + if (input === "c" && !urlCopied) { const urlToCopy = authorizationUrl || claudeAIAuthUrl || claudeAIClearAuthUrl; if (urlToCopy) { setClipboard(urlToCopy).then((raw) => { @@ -616481,13 +539047,13 @@ function MCPRemoteServerMenu({ }, undefined, true, undefined, this) ] }, undefined, true, undefined, this), - error46 && /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedBox_default, { + error42 && /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, { color: "error", children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this) }, undefined, false, undefined, this), @@ -616595,12 +539161,12 @@ var init_MCPRemoteServerMenu = __esm(() => { init_osc(); init_ink2(); init_useKeybinding(); - init_auth7(); - init_client10(); + init_auth6(); + init_client6(); init_MCPConnectionManager(); - init_utils4(); + init_utils3(); init_AppState(); - init_auth2(); + init_auth(); init_browser(); init_errors(); init_log3(); @@ -616635,9 +539201,9 @@ function MCPStdioServerMenu({ try { await toggleMcpServer(server.name); onCancel(); - } catch (err3) { + } catch (err2) { const action2 = wasEnabled ? "disable" : "enable"; - onComplete(`Failed to ${action2} MCP server '${server.name}': ${errorMessage(err3)}`); + onComplete(`Failed to ${action2} MCP server '${server.name}': ${errorMessage(err2)}`); } }, [server.client.type, server.name, toggleMcpServer, onCancel, onComplete]); const capitalizedServerName = capitalize2(String(server.name)); @@ -616820,10 +539386,10 @@ function MCPStdioServerMenu({ } else if (value === "reconnectMcpServer") { setIsReconnecting(true); try { - const result3 = await reconnectMcpServer(server.name); + const result2 = await reconnectMcpServer(server.name); const { message - } = handleReconnectResult(result3, server.name); + } = handleReconnectResult(result2, server.name); onComplete?.(message); } catch (err_0) { onComplete?.(handleReconnectError(err_0, server.name)); @@ -616883,7 +539449,7 @@ var init_MCPStdioServerMenu = __esm(() => { init_ink2(); init_config3(); init_MCPConnectionManager(); - init_utils4(); + init_utils3(); init_AppState(); init_errors(); init_stringUtils(); @@ -617381,7 +539947,7 @@ var init_MCPToolListView = __esm(() => { import_compiler_runtime186 = __toESM(require_compiler_runtime(), 1); init_ink2(); init_mcpStringUtils(); - init_utils4(); + init_utils3(); init_AppState(); init_stringUtils(); init_ConfigurableShortcutHint(); @@ -617787,8 +540353,8 @@ function MCPSettings(t0) { function _temp423(a2, b) { return a2.name.localeCompare(b.name); } -function _temp326(client5) { - return client5.name !== "ide"; +function _temp326(client2) { + return client2.name !== "ide"; } function _temp239(s_0) { return s_0.agentDefinitions; @@ -617800,8 +540366,8 @@ var import_compiler_runtime187, import_react132, jsx_dev_runtime237; var init_MCPSettings = __esm(() => { import_compiler_runtime187 = __toESM(require_compiler_runtime(), 1); import_react132 = __toESM(require_react(), 1); - init_auth7(); - init_utils4(); + init_auth6(); + init_utils3(); init_AppState(); init_sessionIngressAuth(); init_MCPAgentServerMenu(); @@ -617836,7 +540402,7 @@ __export(exports_pluginStartupCheck, { findMissingPlugins: () => findMissingPlugins, checkEnabledPlugins: () => checkEnabledPlugins }); -import { join as join131 } from "path"; +import { join as join121 } from "path"; async function checkEnabledPlugins() { const settings = getInitialSettings(); const enabledPlugins = []; @@ -617866,16 +540432,16 @@ async function checkEnabledPlugins() { return enabledPlugins; } function getPluginEditableScopes() { - const result3 = new Map; + const result2 = new Map; const addDirPlugins = getAddDirEnabledPlugins(); for (const [pluginId, value] of Object.entries(addDirPlugins)) { if (!pluginId.includes("@")) { continue; } if (value === true) { - result3.set(pluginId, "flag"); + result2.set(pluginId, "flag"); } else if (value === false) { - result3.delete(pluginId); + result2.delete(pluginId); } } const scopeSources = [ @@ -617898,14 +540464,14 @@ function getPluginEditableScopes() { logForDebugging(`Plugin ${pluginId} from --add-dir (${addDirPlugins[pluginId]}) overridden by ${source} (${value})`); } if (value === true) { - result3.set(pluginId, scope); + result2.set(pluginId, scope); } else if (value === false) { - result3.delete(pluginId); + result2.delete(pluginId); } } } - logForDebugging(`Found ${result3.size} enabled plugins with scopes: ${Array.from(result3.entries()).map(([id, scope]) => `${id}(${scope})`).join(", ")}`); - return result3; + logForDebugging(`Found ${result2.size} enabled plugins with scopes: ${Array.from(result2.entries()).map(([id, scope]) => `${id}(${scope})`).join(", ")}`); + return result2; } function isPersistableScope(scope) { return scope !== "flag"; @@ -617914,8 +540480,8 @@ function settingSourceToScope2(source) { return SETTING_SOURCE_TO_SCOPE[source]; } async function getInstalledPlugins() { - migrateFromEnabledPlugins().catch((error46) => { - logError2(error46); + migrateFromEnabledPlugins().catch((error42) => { + logError2(error42); }); const v2Data = getInMemoryInstalledPlugins(); const installed = Object.keys(v2Data.plugins); @@ -617930,15 +540496,15 @@ async function findMissingPlugins(enabledPlugins) { try { const plugin = await getPluginById(pluginId); return { pluginId, found: plugin !== null && plugin !== undefined }; - } catch (error46) { - logForDebugging(`Failed to check plugin ${pluginId} in marketplace: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to check plugin ${pluginId} in marketplace: ${error42}`); return { pluginId, found: false }; } })); const missing = lookups.filter(({ found }) => found).map(({ pluginId }) => pluginId); return missing; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return []; } } @@ -617949,12 +540515,12 @@ async function installSelectedPlugins(pluginsToInstall, onProgress, scope = "use const updatedEnabledPlugins = { ...settings?.enabledPlugins }; const installed = []; const failed = []; - for (let i4 = 0;i4 < pluginsToInstall.length; i4++) { - const pluginId = pluginsToInstall[i4]; + for (let i3 = 0;i3 < pluginsToInstall.length; i3++) { + const pluginId = pluginsToInstall[i3]; if (!pluginId) continue; if (onProgress) { - onProgress(pluginId, i4 + 1, pluginsToInstall.length); + onProgress(pluginId, i3 + 1, pluginsToInstall.length); } try { const pluginInfo = await getPluginById(pluginId); @@ -617971,16 +540537,16 @@ async function installSelectedPlugins(pluginsToInstall, onProgress, scope = "use } else { registerPluginInstallation({ pluginId, - installPath: join131(marketplaceInstallLocation, entry.source), + installPath: join121(marketplaceInstallLocation, entry.source), version: entry.version }, scope, projectPath); } updatedEnabledPlugins[pluginId] = true; installed.push(pluginId); - } catch (error46) { - const errorMessage2 = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + const errorMessage2 = error42 instanceof Error ? error42.message : String(error42); failed.push({ name: pluginId, error: errorMessage2 }); - logError2(error46); + logError2(error42); } } updateSettingsForSource(settingSource, { @@ -618003,11 +540569,11 @@ var init_pluginStartupCheck = __esm(() => { }); // src/utils/plugins/parseMarketplaceInput.ts -import { homedir as homedir31 } from "os"; -import { resolve as resolve43 } from "path"; -async function parseMarketplaceInput(input11) { - const trimmed = input11.trim(); - const fs11 = getFsImplementation(); +import { homedir as homedir29 } from "os"; +import { resolve as resolve37 } from "path"; +async function parseMarketplaceInput(input) { + const trimmed = input.trim(); + const fs5 = getFsImplementation(); const sshMatch = trimmed.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/); if (sshMatch?.[1]) { const url3 = sshMatch[1]; @@ -618039,10 +540605,10 @@ async function parseMarketplaceInput(input11) { const isWindows2 = process.platform === "win32"; const isWindowsPath = isWindows2 && (trimmed.startsWith(".\\") || trimmed.startsWith("..\\") || /^[a-zA-Z]:[/\\]/.test(trimmed)); if (trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~") || isWindowsPath) { - const resolvedPath = resolve43(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir31()) : trimmed); + const resolvedPath = resolve37(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir29()) : trimmed); let stats; try { - stats = await fs11.stat(resolvedPath); + stats = await fs5.stat(resolvedPath); } catch (e) { const code = getErrnoCode(e); return { @@ -618087,9 +540653,9 @@ function AddMarketplace({ setInputValue, cursorOffset, setCursorOffset, - error: error46, + error: error42, setError, - result: result3, + result: result2, setResult, setViewState, onAddComplete, @@ -618099,12 +540665,12 @@ function AddMarketplace({ const [isLoading, setLoading] = import_react133.useState(false); const [progressMessage, setProgressMessage] = import_react133.useState(""); const handleAdd2 = async () => { - const input11 = inputValue.trim(); - if (!input11) { + const input = inputValue.trim(); + if (!input) { setError("Please enter a marketplace source"); return; } - const parsed = await parseMarketplaceInput(input11); + const parsed = await parseMarketplaceInput(input); if (!parsed) { setError("Invalid marketplace source format. Try: owner/repo, https://..., or ./path"); return; @@ -618147,21 +540713,21 @@ function AddMarketplace({ targetMarketplace: name }); } - } catch (err3) { - const error47 = toError(err3); - logError2(error47); - setError(error47.message); + } catch (err2) { + const error43 = toError(err2); + logError2(error43); + setError(error43.message); setProgressMessage(""); setLoading(false); if (cliMode) { - setResult(`Error: ${error47.message}`); + setResult(`Error: ${error43.message}`); } else { setResult(null); } } }; import_react133.useEffect(() => { - if (inputValue && !hasAttemptedAutoAdd.current && !error46 && !result3) { + if (inputValue && !hasAttemptedAutoAdd.current && !error42 && !result2) { hasAttemptedAutoAdd.current = true; handleAdd2(); } @@ -618231,17 +540797,17 @@ function AddMarketplace({ }, undefined, false, undefined, this) ] }, undefined, true, undefined, this), - error46 && /* @__PURE__ */ jsx_dev_runtime238.jsxDEV(ThemedBox_default, { + error42 && /* @__PURE__ */ jsx_dev_runtime238.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime238.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) }, undefined, false, undefined, this), - result3 && /* @__PURE__ */ jsx_dev_runtime238.jsxDEV(ThemedBox_default, { + result2 && /* @__PURE__ */ jsx_dev_runtime238.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime238.jsxDEV(ThemedText, { - children: result3 + children: result2 }, undefined, false, undefined, this) }, undefined, false, undefined, this) ] @@ -618289,16 +540855,16 @@ var init_AddMarketplace = __esm(() => { }); // src/utils/plugins/installCounts.ts -import { randomBytes as randomBytes16 } from "crypto"; -import { readFile as readFile45, rename as rename7, unlink as unlink19, writeFile as writeFile44 } from "fs/promises"; -import { join as join132 } from "path"; +import { randomBytes as randomBytes15 } from "crypto"; +import { readFile as readFile44, rename as rename7, unlink as unlink19, writeFile as writeFile42 } from "fs/promises"; +import { join as join122 } from "path"; function getInstallCountsCachePath() { - return join132(getPluginsDirectory(), INSTALL_COUNTS_CACHE_FILENAME); + return join122(getPluginsDirectory(), INSTALL_COUNTS_CACHE_FILENAME); } async function loadInstallCountsCache() { const cachePath = getInstallCountsCachePath(); try { - const content = await readFile45(cachePath, { encoding: "utf-8" }); + const content = await readFile44(cachePath, { encoding: "utf-8" }); const parsed = jsonParse(content); if (typeof parsed !== "object" || parsed === null || !("version" in parsed) || !("fetchedAt" in parsed) || !("counts" in parsed)) { logForDebugging("Install counts cache has invalid structure"); @@ -618323,8 +540889,8 @@ async function loadInstallCountsCache() { logForDebugging("Install counts cache has malformed entries"); return null; } - const now3 = Date.now(); - if (now3 - fetchedAt > CACHE_TTL_MS4) { + const now2 = Date.now(); + if (now2 - fetchedAt > CACHE_TTL_MS4) { logForDebugging("Install counts cache is stale (>24h old)"); return null; } @@ -618333,29 +540899,29 @@ async function loadInstallCountsCache() { fetchedAt: cache4.fetchedAt, counts: cache4.counts }; - } catch (error46) { - const code = getErrnoCode(error46); + } catch (error42) { + const code = getErrnoCode(error42); if (code !== "ENOENT") { - logForDebugging(`Failed to load install counts cache: ${errorMessage(error46)}`); + logForDebugging(`Failed to load install counts cache: ${errorMessage(error42)}`); } return null; } } async function saveInstallCountsCache(cache4) { const cachePath = getInstallCountsCachePath(); - const tempPath = `${cachePath}.${randomBytes16(8).toString("hex")}.tmp`; + const tempPath = `${cachePath}.${randomBytes15(8).toString("hex")}.tmp`; try { const pluginsDir = getPluginsDirectory(); await getFsImplementation().mkdir(pluginsDir); const content = jsonStringify(cache4, null, 2); - await writeFile44(tempPath, content, { + await writeFile42(tempPath, content, { encoding: "utf-8", mode: 384 }); await rename7(tempPath, cachePath); logForDebugging("Install counts cache saved successfully"); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); try { await unlink19(tempPath); } catch {} @@ -618373,9 +540939,9 @@ async function fetchInstallCountsFromGitHub() { } logPluginFetch("install_counts", INSTALL_COUNTS_URL, "success", performance.now() - started); return response.data.plugins; - } catch (error46) { - logPluginFetch("install_counts", INSTALL_COUNTS_URL, "failure", performance.now() - started, classifyFetchError(error46)); - throw error46; + } catch (error42) { + logPluginFetch("install_counts", INSTALL_COUNTS_URL, "failure", performance.now() - started, classifyFetchError(error42)); + throw error42; } } async function getInstallCounts() { @@ -618383,11 +540949,11 @@ async function getInstallCounts() { if (cache4) { logForDebugging("Using cached install counts"); logPluginFetch("install_counts", INSTALL_COUNTS_URL, "cache_hit", 0); - const map7 = new Map; + const map5 = new Map; for (const entry of cache4.counts) { - map7.set(entry.plugin, entry.unique_installs); + map5.set(entry.plugin, entry.unique_installs); } - return map7; + return map5; } try { const counts = await fetchInstallCountsFromGitHub(); @@ -618397,14 +540963,14 @@ async function getInstallCounts() { counts }; await saveInstallCountsCache(newCache); - const map7 = new Map; + const map5 = new Map; for (const entry of counts) { - map7.set(entry.plugin, entry.unique_installs); + map5.set(entry.plugin, entry.unique_installs); } - return map7; - } catch (error46) { - logError2(error46); - logForDebugging(`Failed to fetch install counts: ${errorMessage(error46)}`); + return map5; + } catch (error42) { + logError2(error42); + logForDebugging(`Failed to fetch install counts: ${errorMessage(error42)}`); return null; } } @@ -618499,7 +541065,7 @@ function PluginOptionsDialog(t0) { } else { t3 = $2[5]; } - const [values4, setValues] = import_react134.useState(t3); + const [values2, setValues] = import_react134.useState(t3); let t4; if ($2[6] !== fields[0] || $2[7] !== initialFor) { t4 = () => fields[0] ? initialFor(fields[0]) : ""; @@ -618546,13 +541112,13 @@ function PluginOptionsDialog(t0) { } const handleNextField = t6; let t7; - if ($2[16] !== configSchema || $2[17] !== currentField || $2[18] !== currentFieldIndex || $2[19] !== currentInput || $2[20] !== fields || $2[21] !== initialFor || $2[22] !== initialValues || $2[23] !== onSave || $2[24] !== values4) { + if ($2[16] !== configSchema || $2[17] !== currentField || $2[18] !== currentFieldIndex || $2[19] !== currentInput || $2[20] !== fields || $2[21] !== initialFor || $2[22] !== initialValues || $2[23] !== onSave || $2[24] !== values2) { t7 = () => { if (!currentField) { return; } const newValues = { - ...values4, + ...values2, [currentField]: currentInput }; if (currentFieldIndex === fields.length - 1) { @@ -618572,7 +541138,7 @@ function PluginOptionsDialog(t0) { $2[21] = initialFor; $2[22] = initialValues; $2[23] = onSave; - $2[24] = values4; + $2[24] = values2; $2[25] = t7; } else { t7 = $2[25]; @@ -618850,21 +541416,21 @@ function PluginOptionsFlow({ onDone }) { const [steps] = React74.useState(() => { - const result3 = []; + const result2 = []; const unconfigured = getUnconfiguredOptions(plugin); if (Object.keys(unconfigured).length > 0) { - result3.push({ + result2.push({ key: "top-level", title: `Configure ${plugin.name}`, subtitle: "Plugin options", schema: unconfigured, load: () => loadPluginOptions(pluginId), - save: (values4) => savePluginOptions(pluginId, values4, plugin.manifest.userConfig) + save: (values2) => savePluginOptions(pluginId, values2, plugin.manifest.userConfig) }); } const channels = getUnconfiguredChannels(plugin); for (const channel of channels) { - result3.push({ + result2.push({ key: `channel:${channel.server}`, title: `Configure ${channel.displayName}`, subtitle: `Plugin: ${plugin.name}`, @@ -618873,7 +541439,7 @@ function PluginOptionsFlow({ save: (values_0) => saveMcpServerUserConfig(pluginId, channel.server, values_0, channel.configSchema) }); } - return result3; + return result2; }); const [index, setIndex] = React74.useState(0); const onDoneRef = React74.useRef(onDone); @@ -618890,8 +541456,8 @@ function PluginOptionsFlow({ function handleSave(values_1) { try { current.save(values_1); - } catch (err3) { - onDone("error", errorMessage(err3)); + } catch (err2) { + onDone("error", errorMessage(err2)); return; } const next = index + 1; @@ -619177,7 +541743,7 @@ var init_usePagination = __esm(() => { // src/commands/plugin/BrowseMarketplace.tsx function BrowseMarketplace({ - error: error46, + error: error42, setError, result: _result, setResult, @@ -619235,11 +541801,11 @@ function BrowseMarketplace({ import_react136.useEffect(() => { async function loadMarketplaceData() { try { - const config6 = await loadKnownMarketplacesConfig(); + const config4 = await loadKnownMarketplacesConfig(); const { marketplaces: marketplaces_0, failures - } = await loadMarketplacesWithGracefulDegradation(config6); + } = await loadMarketplacesWithGracefulDegradation(config4); const marketplaceInfos = []; for (const { name, @@ -619283,7 +541849,7 @@ function BrowseMarketplace({ if (targetPlugin) { let foundPlugin = null; let foundMarketplace = null; - for (const [name_0] of Object.entries(config6)) { + for (const [name_0] of Object.entries(config4)) { const marketplace_0 = await getMarketplace(name_0); if (marketplace_0) { const plugin_0 = marketplace_0.plugins.find((p) => p.name === targetPlugin); @@ -619322,8 +541888,8 @@ function BrowseMarketplace({ setError(`Marketplace "${targetMarketplace}" not found`); } } - } catch (err3) { - setError(err3 instanceof Error ? err3.message : "Failed to load marketplaces"); + } catch (err2) { + setError(err2 instanceof Error ? err2.message : "Failed to load marketplaces"); } finally { setLoading(false); } @@ -619402,19 +541968,19 @@ function BrowseMarketplace({ let failureCount = 0; const newFailedPlugins = []; for (const plugin_1 of pluginsToInstall) { - const result3 = await installPluginFromMarketplace({ + const result2 = await installPluginFromMarketplace({ pluginId: plugin_1.pluginId, entry: plugin_1.entry, marketplaceName: plugin_1.marketplaceName, scope: "user" }); - if (result3.success) { + if (result2.success) { successCount_0++; } else { failureCount++; newFailedPlugins.push({ name: plugin_1.entry.name, - reason: result3.error + reason: result2.error }); } } @@ -619472,10 +542038,10 @@ function BrowseMarketplace({ } }; import_react136.useEffect(() => { - if (error46) { - setResult(error46); + if (error42) { + setResult(error42); } - }, [error46, setResult]); + }, [error42, setResult]); useKeybindings({ "select:previous": () => { if (selectedIndex > 0) { @@ -619638,10 +542204,10 @@ function BrowseMarketplace({ children: "Loading…" }, undefined, false, undefined, this); } - if (error46) { + if (error42) { return /* @__PURE__ */ jsx_dev_runtime243.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this); } if (viewState === "marketplace-list") { @@ -619977,7 +542543,7 @@ function BrowseMarketplace({ const isLast = visibleIndex === visiblePlugins.length - 1; return /* @__PURE__ */ jsx_dev_runtime243.jsxDEV(ThemedBox_default, { flexDirection: "column", - marginBottom: isLast && !error46 ? 0 : 1, + marginBottom: isLast && !error42 ? 0 : 1, children: [ /* @__PURE__ */ jsx_dev_runtime243.jsxDEV(ThemedBox_default, { children: [ @@ -620052,14 +542618,14 @@ function BrowseMarketplace({ ] }, undefined, true, undefined, this) }, undefined, false, undefined, this), - error46 && /* @__PURE__ */ jsx_dev_runtime243.jsxDEV(ThemedBox_default, { + error42 && /* @__PURE__ */ jsx_dev_runtime243.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime243.jsxDEV(ThemedText, { color: "error", children: [ figures_default.cross, " ", - error46 + error42 ] }, undefined, true, undefined, this) }, undefined, false, undefined, this), @@ -620100,7 +542666,7 @@ var init_BrowseMarketplace = __esm(() => { // src/commands/plugin/DiscoverPlugins.tsx function DiscoverPlugins({ - error: error46, + error: error42, setError, result: _result, setResult, @@ -620157,11 +542723,11 @@ function DiscoverPlugins({ import_react137.useEffect(() => { async function loadAllPlugins2() { try { - const config6 = await loadKnownMarketplacesConfig(); + const config4 = await loadKnownMarketplacesConfig(); const { marketplaces, failures - } = await loadMarketplacesWithGracefulDegradation(config6); + } = await loadMarketplacesWithGracefulDegradation(config4); const allPlugins = []; for (const { name, @@ -620199,7 +542765,7 @@ function DiscoverPlugins({ uninstalledPlugins.sort((a2, b) => a2.entry.name.localeCompare(b.entry.name)); } setAvailablePlugins(uninstalledPlugins); - const configuredCount = Object.keys(config6).length; + const configuredCount = Object.keys(config4).length; if (uninstalledPlugins.length === 0) { const reason = await detectEmptyMarketplaceReason({ configuredMarketplaceCount: configuredCount, @@ -620229,8 +542795,8 @@ function DiscoverPlugins({ setError(`Plugin "${targetPlugin}" not found in any marketplace`); } } - } catch (err3) { - setError(err3 instanceof Error ? err3.message : "Failed to load plugins"); + } catch (err2) { + setError(err2 instanceof Error ? err2.message : "Failed to load plugins"); } finally { setLoading(false); } @@ -620246,19 +542812,19 @@ function DiscoverPlugins({ let failureCount = 0; const newFailedPlugins = []; for (const plugin_0 of pluginsToInstall) { - const result3 = await installPluginFromMarketplace({ + const result2 = await installPluginFromMarketplace({ pluginId: plugin_0.pluginId, entry: plugin_0.entry, marketplaceName: plugin_0.marketplaceName, scope: "user" }); - if (result3.success) { + if (result2.success) { successCount_0++; } else { failureCount++; newFailedPlugins.push({ name: plugin_0.entry.name, - reason: result3.error + reason: result2.error }); } } @@ -620316,10 +542882,10 @@ function DiscoverPlugins({ } }; import_react137.useEffect(() => { - if (error46) { - setResult(error46); + if (error42) { + setResult(error42); } - }, [error46, setResult]); + }, [error42, setResult]); useKeybinding("confirm:no", () => { setViewState("plugin-list"); setSelectedPlugin(null); @@ -620335,15 +542901,15 @@ function DiscoverPlugins({ context: "Confirmation", isActive: viewState === "plugin-list" && !isSearchMode }); - use_input_default((input11, _key) => { + use_input_default((input, _key) => { const keyIsNotCtrlOrMeta = !_key.ctrl && !_key.meta; if (!isSearchMode) { - if (input11 === "/" && keyIsNotCtrlOrMeta) { + if (input === "/" && keyIsNotCtrlOrMeta) { setIsSearchMode(true); setSearchQuery(""); - } else if (keyIsNotCtrlOrMeta && input11.length > 0 && !/^\s+$/.test(input11) && input11 !== "j" && input11 !== "k" && input11 !== "i") { + } else if (keyIsNotCtrlOrMeta && input.length > 0 && !/^\s+$/.test(input) && input !== "j" && input !== "k" && input !== "i") { setIsSearchMode(true); - setSearchQuery(input11); + setSearchQuery(input); } } }, { @@ -620491,10 +543057,10 @@ function DiscoverPlugins({ children: "Loading…" }, undefined, false, undefined, this); } - if (error46) { + if (error42) { return /* @__PURE__ */ jsx_dev_runtime244.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this); } if (viewState === "plugin-details" && selectedPlugin) { @@ -620703,7 +543269,7 @@ function DiscoverPlugins({ const isLast = visibleIndex === visiblePlugins.length - 1; return /* @__PURE__ */ jsx_dev_runtime244.jsxDEV(ThemedBox_default, { flexDirection: "column", - marginBottom: isLast && !error46 ? 0 : 1, + marginBottom: isLast && !error42 ? 0 : 1, children: [ /* @__PURE__ */ jsx_dev_runtime244.jsxDEV(ThemedBox_default, { children: [ @@ -620763,14 +543329,14 @@ function DiscoverPlugins({ ] }, undefined, true, undefined, this) }, undefined, false, undefined, this), - error46 && /* @__PURE__ */ jsx_dev_runtime244.jsxDEV(ThemedBox_default, { + error42 && /* @__PURE__ */ jsx_dev_runtime244.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime244.jsxDEV(ThemedText, { color: "error", children: [ figures_default.cross, " ", - error46 + error42 ] }, undefined, true, undefined, this) }, undefined, false, undefined, this), @@ -621039,7 +543605,7 @@ var init_DiscoverPlugins = __esm(() => { }); // src/services/plugins/pluginOperations.ts -import { dirname as dirname56, join as join133 } from "path"; +import { dirname as dirname52, join as join123 } from "path"; function assertInstallableScope(scope) { if (!VALID_INSTALLABLE_SCOPES.includes(scope)) { throw new Error(`Invalid scope "${scope}". Must be one of: ${VALID_INSTALLABLE_SCOPES.join(", ")}`); @@ -621147,8 +543713,8 @@ async function installPluginOp(plugin, scope = "user") { marketplaceInstallLocation = mktConfig.installLocation; break; } - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); continue; } } @@ -621162,44 +543728,44 @@ async function installPluginOp(plugin, scope = "user") { } const entry = foundPlugin; const pluginId = `${entry.name}@${foundMarketplace}`; - const result3 = await installResolvedPlugin({ + const result2 = await installResolvedPlugin({ pluginId, entry, scope, marketplaceInstallLocation }); - if (!result3.ok) { - switch (result3.reason) { + if (!result2.ok) { + switch (result2.reason) { case "local-source-no-location": return { success: false, - message: `Cannot install local plugin "${result3.pluginName}" without marketplace install location` + message: `Cannot install local plugin "${result2.pluginName}" without marketplace install location` }; case "settings-write-failed": return { success: false, - message: `Failed to update settings: ${result3.message}` + message: `Failed to update settings: ${result2.message}` }; case "resolution-failed": return { success: false, - message: formatResolutionError(result3.resolution) + message: formatResolutionError(result2.resolution) }; case "blocked-by-policy": return { success: false, - message: `Plugin "${result3.pluginName}" is blocked by your organization's policy and cannot be installed` + message: `Plugin "${result2.pluginName}" is blocked by your organization's policy and cannot be installed` }; case "dependency-blocked-by-policy": return { success: false, - message: `Plugin "${result3.pluginName}" depends on "${result3.blockedDependency}", which is blocked by your organization's policy` + message: `Plugin "${result2.pluginName}" depends on "${result2.blockedDependency}", which is blocked by your organization's policy` }; } } return { success: true, - message: `Successfully installed plugin: ${pluginId} (scope: ${scope})${result3.depNote}`, + message: `Successfully installed plugin: ${pluginId} (scope: ${scope})${result2.depNote}`, pluginId, pluginName: entry.name, scope @@ -621231,7 +543797,7 @@ async function uninstallPluginOp(plugin, scope = "user", deleteDataDir = true) { const projectPath = getProjectPathForScope(scope); const installedData = loadInstalledPluginsV2(); const installations = installedData.plugins[pluginId]; - const scopeInstallation = installations?.find((i4) => i4.scope === scope && i4.projectPath === projectPath); + const scopeInstallation = installations?.find((i3) => i3.scope === scope && i3.projectPath === projectPath); if (!scopeInstallation) { const { scope: actualScope } = getPluginInstallationFromV2(pluginId); if (actualScope !== scope && installations && installations.length > 0) { @@ -621287,16 +543853,16 @@ async function uninstallPluginOp(plugin, scope = "user", deleteDataDir = true) { async function setPluginEnabledOp(plugin, enabled, scope) { const operation = enabled ? "enable" : "disable"; if (isBuiltinPluginId(plugin)) { - const { error: error47 } = updateSettingsForSource("userSettings", { + const { error: error43 } = updateSettingsForSource("userSettings", { enabledPlugins: { ...getSettingsForSource("userSettings")?.enabledPlugins, [plugin]: enabled } }); - if (error47) { + if (error43) { return { success: false, - message: `Failed to ${operation} built-in plugin: ${error47.message}` + message: `Failed to ${operation} built-in plugin: ${error43.message}` }; } clearAllCaches(); @@ -621376,16 +543942,16 @@ async function setPluginEnabledOp(plugin, enabled, scope) { if (rdeps.length > 0) reverseDependents = rdeps; } - const { error: error46 } = updateSettingsForSource(settingSource, { + const { error: error42 } = updateSettingsForSource(settingSource, { enabledPlugins: { ...getSettingsForSource(settingSource)?.enabledPlugins, [pluginId]: enabled } }); - if (error46) { + if (error42) { return { success: false, - message: `Failed to ${operation} plugin: ${error46.message}` + message: `Failed to ${operation} plugin: ${error42.message}` }; } clearAllCaches(); @@ -621414,11 +543980,11 @@ async function disableAllPluginsOp() { const disabled = []; const errors7 = []; for (const [pluginId] of enabledPlugins) { - const result3 = await setPluginEnabledOp(pluginId, false); - if (result3.success) { + const result2 = await setPluginEnabledOp(pluginId, false); + if (result2.success) { disabled.push(pluginId); } else { - errors7.push(`${pluginId}: ${result3.message}`); + errors7.push(`${pluginId}: ${result2.message}`); } } if (errors7.length > 0) { @@ -621487,7 +544053,7 @@ async function performPluginUpdate({ scope, projectPath }) { - const fs11 = getFsImplementation(); + const fs5 = getFsImplementation(); const oldVersion = installation.version; let sourcePath; let newVersion; @@ -621504,7 +544070,7 @@ async function performPluginUpdate({ } else { let marketplaceStats; try { - marketplaceStats = await fs11.stat(marketplaceInstallLocation); + marketplaceStats = await fs5.stat(marketplaceInstallLocation); } catch (e) { if (isENOENT(e)) { return { @@ -621516,10 +544082,10 @@ async function performPluginUpdate({ } throw e; } - const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname56(marketplaceInstallLocation); - sourcePath = join133(marketplaceDir, entry.source); + const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname52(marketplaceInstallLocation); + sourcePath = join123(marketplaceDir, entry.source); try { - await fs11.stat(sourcePath); + await fs5.stat(sourcePath); } catch (e) { if (isENOENT(e)) { return { @@ -621532,7 +544098,7 @@ async function performPluginUpdate({ throw e; } let pluginManifest; - const manifestPath = join133(sourcePath, ".claude-plugin", "plugin.json"); + const manifestPath = join123(sourcePath, ".claude-plugin", "plugin.json"); try { pluginManifest = await loadPluginManifest(manifestPath, entry.name, entry.source); } catch {} @@ -621575,7 +544141,7 @@ async function performPluginUpdate({ }; } finally { if (shouldCleanupSource && sourcePath !== getVersionedCachePath(pluginId, newVersion)) { - await fs11.rm(sourcePath, { recursive: true, force: true }); + await fs5.rm(sourcePath, { recursive: true, force: true }); } } } @@ -621621,10 +544187,10 @@ function onPluginsAutoUpdated(callback) { }; } async function getAutoUpdateEnabledMarketplaces() { - const config6 = await loadKnownMarketplacesConfig(); + const config4 = await loadKnownMarketplacesConfig(); const declared = getDeclaredMarketplaces(); const enabled = new Set; - for (const [name, entry] of Object.entries(config6)) { + for (const [name, entry] of Object.entries(config4)) { const declaredAutoUpdate = declared[name]?.autoUpdate; const autoUpdate = declaredAutoUpdate !== undefined ? declaredAutoUpdate : isMarketplaceAutoUpdate(name, entry); if (autoUpdate) { @@ -621637,15 +544203,15 @@ async function updatePlugin(pluginId, installations) { let wasUpdated = false; for (const { scope } of installations) { try { - const result3 = await updatePluginOp(pluginId, scope); - if (result3.success && !result3.alreadyUpToDate) { + const result2 = await updatePluginOp(pluginId, scope); + if (result2.success && !result2.alreadyUpToDate) { wasUpdated = true; - logForDebugging(`Plugin autoupdate: updated ${pluginId} from ${result3.oldVersion} to ${result3.newVersion}`); - } else if (!result3.alreadyUpToDate) { - logForDebugging(`Plugin autoupdate: failed to update ${pluginId}: ${result3.message}`, { level: "warn" }); + logForDebugging(`Plugin autoupdate: updated ${pluginId} from ${result2.oldVersion} to ${result2.newVersion}`); + } else if (!result2.alreadyUpToDate) { + logForDebugging(`Plugin autoupdate: failed to update ${pluginId}: ${result2.message}`, { level: "warn" }); } - } catch (error46) { - logForDebugging(`Plugin autoupdate: error updating ${pluginId}: ${errorMessage(error46)}`, { level: "warn" }); + } catch (error42) { + logForDebugging(`Plugin autoupdate: error updating ${pluginId}: ${errorMessage(error42)}`, { level: "warn" }); } } return wasUpdated ? pluginId : null; @@ -621692,8 +544258,8 @@ function autoUpdateMarketplacesAndPluginsInBackground() { await refreshMarketplace(name, undefined, { disableCredentialHelper: true }); - } catch (error46) { - logForDebugging(`Plugin autoupdate: failed to refresh marketplace ${name}: ${errorMessage(error46)}`, { level: "warn" }); + } catch (error42) { + logForDebugging(`Plugin autoupdate: failed to refresh marketplace ${name}: ${errorMessage(error42)}`, { level: "warn" }); } })); const failures = refreshResults.filter((r) => r.status === "rejected"); @@ -621709,8 +544275,8 @@ function autoUpdateMarketplacesAndPluginsInBackground() { pendingNotification = updatedPlugins; } } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } })(); } @@ -621730,7 +544296,7 @@ var init_pluginAutoupdate = __esm(() => { // src/commands/plugin/ManageMarketplaces.tsx function ManageMarketplaces({ setViewState, - error: error46, + error: error42, setError, setResult, exitState, @@ -621752,7 +544318,7 @@ function ManageMarketplaces({ import_react138.useEffect(() => { async function loadMarketplaces() { try { - const config6 = await loadKnownMarketplacesConfig(); + const config4 = await loadKnownMarketplacesConfig(); const { enabled, disabled @@ -621761,7 +544327,7 @@ function ManageMarketplaces({ const { marketplaces, failures - } = await loadMarketplacesWithGracefulDegradation(config6); + } = await loadMarketplacesWithGracefulDegradation(config4); const states = []; for (const { name, @@ -621797,7 +544363,7 @@ function ManageMarketplaces({ throw new Error(errorResult2.message); } } - if (targetMarketplace && !hasAttemptedAutoAction.current && !error46) { + if (targetMarketplace && !hasAttemptedAutoAction.current && !error42) { hasAttemptedAutoAction.current = true; const targetIndex = states.findIndex((s) => s.name === targetMarketplace); if (targetIndex >= 0) { @@ -621821,17 +544387,17 @@ function ManageMarketplaces({ setError(`Marketplace not found: ${targetMarketplace}`); } } - } catch (err3) { + } catch (err2) { if (setError) { - setError(err3 instanceof Error ? err3.message : "Failed to load marketplaces"); + setError(err2 instanceof Error ? err2.message : "Failed to load marketplaces"); } - setProcessError(err3 instanceof Error ? err3.message : "Failed to load marketplaces"); + setProcessError(err2 instanceof Error ? err2.message : "Failed to load marketplaces"); } finally { setLoading(false); } } loadMarketplaces(); - }, [targetMarketplace, action2, error46]); + }, [targetMarketplace, action2, error42]); const hasPendingChanges2 = () => { return marketplaceStates.some((state) => state.pendingUpdate || state.pendingRemove); }; @@ -621897,7 +544463,7 @@ function ManageMarketplaces({ if (onManageComplete) { await onManageComplete(); } - const config6 = await loadKnownMarketplacesConfig(); + const config4 = await loadKnownMarketplacesConfig(); const { enabled, disabled @@ -621905,7 +544471,7 @@ function ManageMarketplaces({ const allPlugins = [...enabled, ...disabled]; const { marketplaces - } = await loadMarketplacesWithGracefulDegradation(config6); + } = await loadMarketplacesWithGracefulDegradation(config4); const newStates = []; for (const { name, @@ -621961,8 +544527,8 @@ function ManageMarketplaces({ type: "menu" }); } - } catch (err3) { - const errorMsg = errorMessage(err3); + } catch (err2) { + const errorMsg = errorMessage(err2); setProcessError(errorMsg); if (setError) { setError(errorMsg); @@ -622017,8 +544583,8 @@ function ManageMarketplaces({ ...prev, autoUpdate: newAutoUpdate } : prev); - } catch (err3) { - setProcessError(err3 instanceof Error ? err3.message : "Failed to update setting"); + } catch (err2) { + setProcessError(err2 instanceof Error ? err2.message : "Failed to update setting"); } }; useKeybinding("confirm:no", () => { @@ -622074,15 +544640,15 @@ function ManageMarketplaces({ context: "Select", isActive: !isProcessing && internalView === "list" }); - use_input_default((input11) => { + use_input_default((input) => { const marketplaceIndex = selectedIndex - 1; - if ((input11 === "u" || input11 === "U") && marketplaceIndex >= 0) { + if ((input === "u" || input === "U") && marketplaceIndex >= 0) { setMarketplaceStates((prev) => prev.map((state, idx) => idx === marketplaceIndex ? { ...state, pendingUpdate: !state.pendingUpdate, pendingRemove: state.pendingUpdate ? state.pendingRemove : false } : state)); - } else if ((input11 === "r" || input11 === "R") && marketplaceIndex >= 0) { + } else if ((input === "r" || input === "R") && marketplaceIndex >= 0) { const marketplace = marketplaceStates[marketplaceIndex]; if (marketplace) { setSelectedMarketplace(marketplace); @@ -622125,10 +544691,10 @@ function ManageMarketplaces({ context: "Select", isActive: !isProcessing && internalView === "details" }); - use_input_default((input11) => { - if (input11 === "y" || input11 === "Y") { + use_input_default((input) => { + if (input === "y" || input === "Y") { confirmRemove(); - } else if (input11 === "n" || input11 === "N") { + } else if (input === "n" || input === "N") { setInternalView("list"); setSelectedMarketplace(null); } @@ -622750,11 +545316,11 @@ var init_ManageMarketplaces = __esm(() => { }); // src/utils/plugins/pluginFlagging.ts -import { randomBytes as randomBytes17 } from "crypto"; -import { readFile as readFile46, rename as rename8, unlink as unlink20, writeFile as writeFile45 } from "fs/promises"; -import { join as join134 } from "path"; +import { randomBytes as randomBytes16 } from "crypto"; +import { readFile as readFile45, rename as rename8, unlink as unlink20, writeFile as writeFile43 } from "fs/promises"; +import { join as join124 } from "path"; function getFlaggedPluginsPath() { - return join134(getPluginsDirectory(), FLAGGED_PLUGINS_FILENAME); + return join124(getPluginsDirectory(), FLAGGED_PLUGINS_FILENAME); } function parsePluginsData(content) { const parsed = jsonParse(content); @@ -622762,7 +545328,7 @@ function parsePluginsData(content) { return {}; } const plugins = parsed.plugins; - const result3 = {}; + const result2 = {}; for (const [id, entry] of Object.entries(plugins)) { if (entry && typeof entry === "object" && "flaggedAt" in entry && typeof entry.flaggedAt === "string") { const parsed2 = { @@ -622771,14 +545337,14 @@ function parsePluginsData(content) { if ("seenAt" in entry && typeof entry.seenAt === "string") { parsed2.seenAt = entry.seenAt; } - result3[id] = parsed2; + result2[id] = parsed2; } } - return result3; + return result2; } async function readFromDisk() { try { - const content = await readFile46(getFlaggedPluginsPath(), { + const content = await readFile45(getFlaggedPluginsPath(), { encoding: "utf-8" }); return parsePluginsData(content); @@ -622788,18 +545354,18 @@ async function readFromDisk() { } async function writeToDisk(plugins) { const filePath = getFlaggedPluginsPath(); - const tempPath = `${filePath}.${randomBytes17(8).toString("hex")}.tmp`; + const tempPath = `${filePath}.${randomBytes16(8).toString("hex")}.tmp`; try { await getFsImplementation().mkdir(getPluginsDirectory()); const content = jsonStringify({ plugins }, null, 2); - await writeFile45(tempPath, content, { + await writeFile43(tempPath, content, { encoding: "utf-8", mode: 384 }); await rename8(tempPath, filePath); cache4 = plugins; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); try { await unlink20(tempPath); } catch {} @@ -622807,10 +545373,10 @@ async function writeToDisk(plugins) { } async function loadFlaggedPlugins() { const all4 = await readFromDisk(); - const now3 = Date.now(); + const now2 = Date.now(); let changed = false; for (const [id, entry] of Object.entries(all4)) { - if (entry.seenAt && now3 - new Date(entry.seenAt).getTime() >= SEEN_EXPIRY_MS) { + if (entry.seenAt && now2 - new Date(entry.seenAt).getTime() >= SEEN_EXPIRY_MS) { delete all4[id]; changed = true; } @@ -622840,13 +545406,13 @@ async function markFlaggedPluginsSeen(pluginIds) { if (cache4 === null) { cache4 = await readFromDisk(); } - const now3 = new Date().toISOString(); + const now2 = new Date().toISOString(); let changed = false; const updated = { ...cache4 }; for (const id of pluginIds) { const entry = updated[id]; if (entry && !entry.seenAt) { - updated[id] = { ...entry, seenAt: now3 }; + updated[id] = { ...entry, seenAt: now2 }; changed = true; } } @@ -622860,9 +545426,9 @@ async function removeFlaggedPlugin(pluginId) { } if (!(pluginId in cache4)) return; - const { [pluginId]: _, ...rest3 } = cache4; - cache4 = rest3; - await writeToDisk(rest3); + const { [pluginId]: _, ...rest2 } = cache4; + cache4 = rest2; + await writeToDisk(rest2); } var FLAGGED_PLUGINS_FILENAME = "flagged-plugins.json", SEEN_EXPIRY_MS, cache4 = null; var init_pluginFlagging = __esm(() => { @@ -622875,70 +545441,70 @@ var init_pluginFlagging = __esm(() => { }); // src/commands/plugin/PluginErrors.tsx -function formatErrorMessage(error46) { - switch (error46.type) { +function formatErrorMessage(error42) { + switch (error42.type) { case "path-not-found": - return `${error46.component} path not found: ${error46.path}`; + return `${error42.component} path not found: ${error42.path}`; case "git-auth-failed": - return `Git ${error46.authType.toUpperCase()} authentication failed for ${error46.gitUrl}`; + return `Git ${error42.authType.toUpperCase()} authentication failed for ${error42.gitUrl}`; case "git-timeout": - return `Git ${error46.operation} timed out for ${error46.gitUrl}`; + return `Git ${error42.operation} timed out for ${error42.gitUrl}`; case "network-error": - return `Network error accessing ${error46.url}${error46.details ? `: ${error46.details}` : ""}`; + return `Network error accessing ${error42.url}${error42.details ? `: ${error42.details}` : ""}`; case "manifest-parse-error": - return `Failed to parse manifest at ${error46.manifestPath}: ${error46.parseError}`; + return `Failed to parse manifest at ${error42.manifestPath}: ${error42.parseError}`; case "manifest-validation-error": - return `Invalid manifest at ${error46.manifestPath}: ${error46.validationErrors.join(", ")}`; + return `Invalid manifest at ${error42.manifestPath}: ${error42.validationErrors.join(", ")}`; case "plugin-not-found": - return `Plugin "${error46.pluginId}" not found in marketplace "${error46.marketplace}"`; + return `Plugin "${error42.pluginId}" not found in marketplace "${error42.marketplace}"`; case "marketplace-not-found": - return `Marketplace "${error46.marketplace}" not found`; + return `Marketplace "${error42.marketplace}" not found`; case "marketplace-load-failed": - return `Failed to load marketplace "${error46.marketplace}": ${error46.reason}`; + return `Failed to load marketplace "${error42.marketplace}": ${error42.reason}`; case "mcp-config-invalid": - return `Invalid MCP server config for "${error46.serverName}": ${error46.validationError}`; + return `Invalid MCP server config for "${error42.serverName}": ${error42.validationError}`; case "mcp-server-suppressed-duplicate": { - const dup = error46.duplicateOf.startsWith("plugin:") ? `server provided by plugin "${error46.duplicateOf.split(":")[1] ?? "?"}"` : `already-configured "${error46.duplicateOf}"`; - return `MCP server "${error46.serverName}" skipped — same command/URL as ${dup}`; + const dup = error42.duplicateOf.startsWith("plugin:") ? `server provided by plugin "${error42.duplicateOf.split(":")[1] ?? "?"}"` : `already-configured "${error42.duplicateOf}"`; + return `MCP server "${error42.serverName}" skipped — same command/URL as ${dup}`; } case "hook-load-failed": - return `Failed to load hooks from ${error46.hookPath}: ${error46.reason}`; + return `Failed to load hooks from ${error42.hookPath}: ${error42.reason}`; case "component-load-failed": - return `Failed to load ${error46.component} from ${error46.path}: ${error46.reason}`; + return `Failed to load ${error42.component} from ${error42.path}: ${error42.reason}`; case "mcpb-download-failed": - return `Failed to download MCPB from ${error46.url}: ${error46.reason}`; + return `Failed to download MCPB from ${error42.url}: ${error42.reason}`; case "mcpb-extract-failed": - return `Failed to extract MCPB ${error46.mcpbPath}: ${error46.reason}`; + return `Failed to extract MCPB ${error42.mcpbPath}: ${error42.reason}`; case "mcpb-invalid-manifest": - return `MCPB manifest invalid at ${error46.mcpbPath}: ${error46.validationError}`; + return `MCPB manifest invalid at ${error42.mcpbPath}: ${error42.validationError}`; case "marketplace-blocked-by-policy": - return error46.blockedByBlocklist ? `Marketplace "${error46.marketplace}" is blocked by enterprise policy` : `Marketplace "${error46.marketplace}" is not in the allowed marketplace list`; + return error42.blockedByBlocklist ? `Marketplace "${error42.marketplace}" is blocked by enterprise policy` : `Marketplace "${error42.marketplace}" is not in the allowed marketplace list`; case "dependency-unsatisfied": - return error46.reason === "not-enabled" ? `Dependency "${error46.dependency}" is disabled` : `Dependency "${error46.dependency}" is not installed`; + return error42.reason === "not-enabled" ? `Dependency "${error42.dependency}" is disabled` : `Dependency "${error42.dependency}" is not installed`; case "lsp-config-invalid": - return `Invalid LSP server config for "${error46.serverName}": ${error46.validationError}`; + return `Invalid LSP server config for "${error42.serverName}": ${error42.validationError}`; case "lsp-server-start-failed": - return `LSP server "${error46.serverName}" failed to start: ${error46.reason}`; + return `LSP server "${error42.serverName}" failed to start: ${error42.reason}`; case "lsp-server-crashed": - return error46.signal ? `LSP server "${error46.serverName}" crashed with signal ${error46.signal}` : `LSP server "${error46.serverName}" crashed with exit code ${error46.exitCode ?? "unknown"}`; + return error42.signal ? `LSP server "${error42.serverName}" crashed with signal ${error42.signal}` : `LSP server "${error42.serverName}" crashed with exit code ${error42.exitCode ?? "unknown"}`; case "lsp-request-timeout": - return `LSP server "${error46.serverName}" timed out on ${error46.method} after ${error46.timeoutMs}ms`; + return `LSP server "${error42.serverName}" timed out on ${error42.method} after ${error42.timeoutMs}ms`; case "lsp-request-failed": - return `LSP server "${error46.serverName}" ${error46.method} failed: ${error46.error}`; + return `LSP server "${error42.serverName}" ${error42.method} failed: ${error42.error}`; case "plugin-cache-miss": - return `Plugin "${error46.plugin}" not cached at ${error46.installPath}`; + return `Plugin "${error42.plugin}" not cached at ${error42.installPath}`; case "generic-error": - return error46.error; + return error42.error; } - const _exhaustive = error46; + const _exhaustive = error42; return getPluginErrorMessage(_exhaustive); } -function getErrorGuidance(error46) { - switch (error46.type) { +function getErrorGuidance(error42) { + switch (error42.type) { case "path-not-found": return "Check that the path in your manifest or marketplace config is correct"; case "git-auth-failed": - return error46.authType === "ssh" ? "Configure SSH keys or use HTTPS URL instead" : "Configure credentials or use SSH URL instead"; + return error42.authType === "ssh" ? "Configure SSH keys or use HTTPS URL instead" : "Configure credentials or use SSH URL instead"; case "git-timeout": case "network-error": return "Check your internet connection and try again"; @@ -622947,22 +545513,22 @@ function getErrorGuidance(error46) { case "manifest-validation-error": return "Check manifest file follows the required schema"; case "plugin-not-found": - return `Plugin may not exist in marketplace "${error46.marketplace}"`; + return `Plugin may not exist in marketplace "${error42.marketplace}"`; case "marketplace-not-found": - return error46.availableMarketplaces.length > 0 ? `Available marketplaces: ${error46.availableMarketplaces.join(", ")}` : "Add the marketplace first using /plugin marketplace add"; + return error42.availableMarketplaces.length > 0 ? `Available marketplaces: ${error42.availableMarketplaces.join(", ")}` : "Add the marketplace first using /plugin marketplace add"; case "mcp-config-invalid": return "Check MCP server configuration in .mcp.json or manifest"; case "mcp-server-suppressed-duplicate": { - if (error46.duplicateOf.startsWith("plugin:")) { - const winningPlugin = error46.duplicateOf.split(":")[1] ?? "the other plugin"; + if (error42.duplicateOf.startsWith("plugin:")) { + const winningPlugin = error42.duplicateOf.split(":")[1] ?? "the other plugin"; return `Disable plugin "${winningPlugin}" if you want this plugin's version instead`; } - return `Remove "${error46.duplicateOf}" from your MCP config if you want the plugin's version instead`; + return `Remove "${error42.duplicateOf}" from your MCP config if you want the plugin's version instead`; } case "hook-load-failed": return "Check hooks.json file syntax and structure"; case "component-load-failed": - return `Check ${error46.component} directory structure and file permissions`; + return `Check ${error42.component} directory structure and file permissions`; case "mcpb-download-failed": return "Check your internet connection and URL accessibility"; case "mcpb-extract-failed": @@ -622970,12 +545536,12 @@ function getErrorGuidance(error46) { case "mcpb-invalid-manifest": return "Contact the plugin author about the invalid manifest"; case "marketplace-blocked-by-policy": - if (error46.blockedByBlocklist) { + if (error42.blockedByBlocklist) { return "This marketplace source is explicitly blocked by your administrator"; } - return error46.allowedSources.length > 0 ? `Allowed sources: ${error46.allowedSources.join(", ")}` : "Contact your administrator to configure allowed marketplace sources"; + return error42.allowedSources.length > 0 ? `Allowed sources: ${error42.allowedSources.join(", ")}` : "Contact your administrator to configure allowed marketplace sources"; case "dependency-unsatisfied": - return error46.reason === "not-enabled" ? `Enable "${error46.dependency}" or uninstall "${error46.plugin}"` : `Install "${error46.dependency}" or uninstall "${error46.plugin}"`; + return error42.reason === "not-enabled" ? `Enable "${error42.dependency}" or uninstall "${error42.plugin}"` : `Install "${error42.dependency}" or uninstall "${error42.plugin}"`; case "lsp-config-invalid": return "Check LSP server configuration in the plugin manifest"; case "lsp-server-start-failed": @@ -622989,7 +545555,7 @@ function getErrorGuidance(error46) { case "generic-error": return null; } - const _exhaustive = error46; + const _exhaustive = error42; return null; } var init_PluginErrors = () => {}; @@ -623749,37 +546315,37 @@ var init_UnifiedInstalledCell = __esm(() => { }); // src/commands/plugin/ManagePlugins.tsx -import * as fs11 from "fs/promises"; -import * as path24 from "path"; +import * as fs5 from "fs/promises"; +import * as path19 from "path"; async function getBaseFileNames(dirPath) { try { - const entries = await fs11.readdir(dirPath, { + const entries = await fs5.readdir(dirPath, { withFileTypes: true }); return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => { - const baseName = path24.basename(entry.name, ".md"); + const baseName = path19.basename(entry.name, ".md"); return baseName; }); - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to read plugin components from ${dirPath}: ${errorMsg}`, { level: "error" }); - logError2(toError(error46)); + logError2(toError(error42)); return []; } } async function getSkillDirNames(dirPath) { try { - const entries = await fs11.readdir(dirPath, { + const entries = await fs5.readdir(dirPath, { withFileTypes: true }); const skillNames = []; for (const entry of entries) { if (entry.isDirectory() || entry.isSymbolicLink()) { - const skillFilePath = path24.join(dirPath, entry.name, "SKILL.md"); + const skillFilePath = path19.join(dirPath, entry.name, "SKILL.md"); try { - const st = await fs11.stat(skillFilePath); + const st = await fs5.stat(skillFilePath); if (st.isFile()) { skillNames.push(entry.name); } @@ -623787,12 +546353,12 @@ async function getSkillDirNames(dirPath) { } } return skillNames; - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Failed to read skill directories from ${dirPath}: ${errorMsg}`, { level: "error" }); - logError2(toError(error46)); + logError2(toError(error42)); return []; } } @@ -623802,7 +546368,7 @@ function PluginComponentsDisplay({ }) { const [components, setComponents] = import_react139.useState(null); const [loading, setLoading] = import_react139.useState(true); - const [error46, setError] = import_react139.useState(null); + const [error42, setError] = import_react139.useState(null); import_react139.useEffect(() => { async function loadComponents() { try { @@ -623894,8 +546460,8 @@ function PluginComponentsDisplay({ } else { setError(`Plugin ${plugin.name} not found in marketplace`); } - } catch (err3) { - setError(err3 instanceof Error ? err3.message : "Failed to load components"); + } catch (err2) { + setError(err2 instanceof Error ? err2.message : "Failed to load components"); } finally { setLoading(false); } @@ -623905,7 +546471,7 @@ function PluginComponentsDisplay({ if (loading) { return null; } - if (error46) { + if (error42) { return /* @__PURE__ */ jsx_dev_runtime247.jsxDEV(ThemedBox_default, { flexDirection: "column", marginBottom: 1, @@ -623918,7 +546484,7 @@ function PluginComponentsDisplay({ dimColor: true, children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this) ] @@ -624085,14 +546651,14 @@ function ManagePlugins({ context: "Confirmation", isActive: (viewState !== "plugin-list" || !isSearchMode) && viewState !== "confirm-project-uninstall" && !(typeof viewState === "object" && viewState.type === "confirm-data-cleanup") }); - const getMcpStatus = (client5) => { - if (client5.type === "connected") + const getMcpStatus = (client2) => { + if (client2.type === "connected") return "connected"; - if (client5.type === "disabled") + if (client2.type === "disabled") return "disabled"; - if (client5.type === "pending") + if (client2.type === "pending") return "pending"; - if (client5.type === "needs-auth") + if (client2.type === "needs-auth") return "needs-auth"; return "failed"; }; @@ -624147,13 +546713,13 @@ function ManagePlugins({ item: item_0 }) => item_0.name)); const orphanErrorsBySource = new Map; - for (const error46 of pluginErrors) { - if (matchedPluginIds.has(error46.source) || "plugin" in error46 && typeof error46.plugin === "string" && matchedPluginNames.has(error46.plugin)) { + for (const error42 of pluginErrors) { + if (matchedPluginIds.has(error42.source) || "plugin" in error42 && typeof error42.plugin === "string" && matchedPluginNames.has(error42.plugin)) { continue; } - const existing_0 = orphanErrorsBySource.get(error46.source) || []; - existing_0.push(error46); - orphanErrorsBySource.set(error46.source, existing_0); + const existing_0 = orphanErrorsBySource.get(error42.source) || []; + existing_0.push(error42); + orphanErrorsBySource.set(error42.source, existing_0); } const pluginScopes = getPluginEditableScopes(); const failedPluginItems = []; @@ -624270,24 +546836,24 @@ function ManagePlugins({ const items = itemsByScope.get(scope_3); const pluginGroups = []; const standaloneMcpsInScope = []; - let i4 = 0; - while (i4 < items.length) { - const item_2 = items[i4]; + let i3 = 0; + while (i3 < items.length) { + const item_2 = items[i3]; if (item_2.type === "plugin" || item_2.type === "failed-plugin" || item_2.type === "flagged-plugin") { const group = [item_2]; - i4++; - let nextItem = items[i4]; + i3++; + let nextItem = items[i3]; while (nextItem?.type === "mcp" && nextItem.indented) { group.push(nextItem); - i4++; - nextItem = items[i4]; + i3++; + nextItem = items[i3]; } pluginGroups.push(group); } else if (item_2.type === "mcp" && !item_2.indented) { standaloneMcpsInScope.push(item_2); - i4++; + i3++; } else { - i4++; + i3++; } } pluginGroups.sort((a_0, b_0) => a_0[0].name.localeCompare(b_0[0].name)); @@ -624336,17 +546902,17 @@ function ManagePlugins({ } if (!hasMcpb) { try { - const marketplaceDir = path24.join(selectedPlugin.plugin.path, ".."); - const marketplaceJsonPath = path24.join(marketplaceDir, ".claude-plugin", "marketplace.json"); - const content = await fs11.readFile(marketplaceJsonPath, "utf-8"); + const marketplaceDir = path19.join(selectedPlugin.plugin.path, ".."); + const marketplaceJsonPath = path19.join(marketplaceDir, ".claude-plugin", "marketplace.json"); + const content = await fs5.readFile(marketplaceJsonPath, "utf-8"); const marketplace_1 = jsonParse(content); const entry_0 = marketplace_1.plugins?.find((p) => p.name === selectedPlugin.plugin.name); if (entry_0?.mcpServers) { const spec = entry_0.mcpServers; hasMcpb = typeof spec === "string" && isMcpbSource(spec) || Array.isArray(spec) && spec.some((s_3) => typeof s_3 === "string" && isMcpbSource(s_3)); } - } catch (err3) { - logForDebugging(`Failed to read raw marketplace.json: ${err3}`); + } catch (err2) { + logForDebugging(`Failed to read raw marketplace.json: ${err2}`); } } setSelectedPluginHasMcpb(hasMcpb); @@ -624531,12 +547097,12 @@ function ManagePlugins({ case "update": { if (isBuiltin) break; - const result3 = await updatePluginOp(pluginId_3, pluginScope); - if (!result3.success) { - throw new Error(result3.message); + const result2 = await updatePluginOp(pluginId_3, pluginScope); + if (!result2.success) { + throw new Error(result2.message); } - if (result3.alreadyUpToDate) { - setResult(`${selectedPlugin.plugin.name} is already at the latest version (${result3.newVersion}).`); + if (result2.alreadyUpToDate) { + setResult(`${selectedPlugin.plugin.name} is already at the latest version (${result2.newVersion}).`); if (onManageComplete) { await onManageComplete(); } @@ -624935,7 +547501,7 @@ function ManagePlugins({ context: "Confirmation", isActive: viewState === "confirm-project-uninstall" && !!selectedPlugin && !isProcessing }); - use_input_default((input11, key) => { + use_input_default((input, key) => { if (!selectedPlugin) return; const pluginId_9 = `${selectedPlugin.plugin.name}@${selectedPlugin.marketplace}`; @@ -624962,9 +547528,9 @@ function ManagePlugins({ setProcessError(e_0 instanceof Error ? e_0.message : String(e_0)); } }; - if (input11 === "y" || input11 === "Y") { + if (input === "y" || input === "Y") { doUninstall(true); - } else if (input11 === "n" || input11 === "N") { + } else if (input === "n" || input === "N") { doUninstall(false); } else if (key.escape) { setViewState("plugin-details"); @@ -625058,9 +547624,9 @@ function ManagePlugins({ subtitle: "Plugin options", configSchema: viewState.schema, initialValues: loadPluginOptions(pluginId_11), - onSave: (values4) => { + onSave: (values2) => { try { - savePluginOptions(pluginId_11, values4, viewState.schema); + savePluginOptions(pluginId_11, values2, viewState.schema); clearAllCaches(); setResult("Configuration saved. Run /reload-plugins for changes to take effect."); } catch (err_3) { @@ -625077,7 +547643,7 @@ function ManagePlugins({ setViewState("plugin-details"); }; const pluginId_12 = `${selectedPlugin.plugin.name}@${selectedPlugin.marketplace}`; - async function handleSave(config6) { + async function handleSave(config4) { if (!configNeeded || !selectedPlugin) return; try { @@ -625098,7 +547664,7 @@ function ManagePlugins({ setViewState("plugin-details"); return; } - await loadMcpbFile(mcpbPath_0, selectedPlugin.plugin.path, pluginId_12, undefined, config6); + await loadMcpbFile(mcpbPath_0, selectedPlugin.plugin.path, pluginId_12, undefined, config4); setProcessError(null); setConfigNeeded(null); setViewState("plugin-details"); @@ -625954,7 +548520,7 @@ var init_ManagePlugins = __esm(() => { init_useKeybinding(); init_builtinPlugins(); init_MCPConnectionManager(); - init_utils4(); + init_utils3(); init_pluginOperations(); init_AppState(); init_browser(); @@ -626047,11 +548613,11 @@ function parsePluginArgs(args) { } // src/utils/plugins/validatePlugin.ts -import { readdir as readdir29, readFile as readFile48, stat as stat43 } from "fs/promises"; -import * as path25 from "path"; +import { readdir as readdir29, readFile as readFile47, stat as stat42 } from "fs/promises"; +import * as path20 from "path"; function detectManifestType(filePath) { - const fileName = path25.basename(filePath); - const dirName = path25.basename(path25.dirname(filePath)); + const fileName = path20.basename(filePath); + const dirName = path20.basename(path20.dirname(filePath)); if (fileName === "plugin.json") return "plugin"; if (fileName === "marketplace.json") @@ -626062,10 +548628,10 @@ function detectManifestType(filePath) { return "unknown"; } function formatZodErrors(zodError) { - return zodError.issues.map((error46) => ({ - path: error46.path.join(".") || "root", - message: error46.message, - code: error46.code + return zodError.issues.map((error42) => ({ + path: error42.path.join(".") || "root", + message: error42.message, + code: error42.code })); } function checkPathTraversal(p, field, errors7, hint) { @@ -626084,19 +548650,19 @@ function marketplaceSourceHint(p) { async function validatePluginManifest(filePath) { const errors7 = []; const warnings = []; - const absolutePath = path25.resolve(filePath); + const absolutePath = path20.resolve(filePath); let content; try { - content = await readFile48(absolutePath, { encoding: "utf-8" }); - } catch (error46) { - const code = getErrnoCode(error46); + content = await readFile47(absolutePath, { encoding: "utf-8" }); + } catch (error42) { + const code = getErrnoCode(error42); let message; if (code === "ENOENT") { message = `File not found: ${absolutePath}`; } else if (code === "EISDIR") { message = `Path is not a file: ${absolutePath}`; } else { - message = `Failed to read file: ${errorMessage(error46)}`; + message = `Failed to read file: ${errorMessage(error42)}`; } return { success: false, @@ -626109,13 +548675,13 @@ async function validatePluginManifest(filePath) { let parsed; try { parsed = jsonParse(content); - } catch (error46) { + } catch (error42) { return { success: false, errors: [ { path: "json", - message: `Invalid JSON syntax: ${errorMessage(error46)}` + message: `Invalid JSON syntax: ${errorMessage(error42)}` } ], warnings: [], @@ -626127,25 +548693,25 @@ async function validatePluginManifest(filePath) { const obj = parsed; if (obj.commands) { const commands = Array.isArray(obj.commands) ? obj.commands : [obj.commands]; - commands.forEach((cmd, i4) => { + commands.forEach((cmd, i3) => { if (typeof cmd === "string") { - checkPathTraversal(cmd, `commands[${i4}]`, errors7); + checkPathTraversal(cmd, `commands[${i3}]`, errors7); } }); } if (obj.agents) { const agents = Array.isArray(obj.agents) ? obj.agents : [obj.agents]; - agents.forEach((agent, i4) => { + agents.forEach((agent, i3) => { if (typeof agent === "string") { - checkPathTraversal(agent, `agents[${i4}]`, errors7); + checkPathTraversal(agent, `agents[${i3}]`, errors7); } }); } if (obj.skills) { const skills = Array.isArray(obj.skills) ? obj.skills : [obj.skills]; - skills.forEach((skill, i4) => { + skills.forEach((skill, i3) => { if (typeof skill === "string") { - checkPathTraversal(skill, `skills[${i4}]`, errors7); + checkPathTraversal(skill, `skills[${i3}]`, errors7); } }); } @@ -626166,12 +548732,12 @@ async function validatePluginManifest(filePath) { toValidate = stripped; } } - const result3 = PluginManifestSchema().strict().safeParse(toValidate); - if (!result3.success) { - errors7.push(...formatZodErrors(result3.error)); + const result2 = PluginManifestSchema().strict().safeParse(toValidate); + if (!result2.success) { + errors7.push(...formatZodErrors(result2.error)); } - if (result3.success) { - const manifest = result3.data; + if (result2.success) { + const manifest = result2.data; if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(manifest.name)) { warnings.push({ path: "name", @@ -626208,19 +548774,19 @@ async function validatePluginManifest(filePath) { async function validateMarketplaceManifest(filePath) { const errors7 = []; const warnings = []; - const absolutePath = path25.resolve(filePath); + const absolutePath = path20.resolve(filePath); let content; try { - content = await readFile48(absolutePath, { encoding: "utf-8" }); - } catch (error46) { - const code = getErrnoCode(error46); + content = await readFile47(absolutePath, { encoding: "utf-8" }); + } catch (error42) { + const code = getErrnoCode(error42); let message; if (code === "ENOENT") { message = `File not found: ${absolutePath}`; } else if (code === "EISDIR") { message = `Path is not a file: ${absolutePath}`; } else { - message = `Failed to read file: ${errorMessage(error46)}`; + message = `Failed to read file: ${errorMessage(error42)}`; } return { success: false, @@ -626233,13 +548799,13 @@ async function validateMarketplaceManifest(filePath) { let parsed; try { parsed = jsonParse(content); - } catch (error46) { + } catch (error42) { return { success: false, errors: [ { path: "json", - message: `Invalid JSON syntax: ${errorMessage(error46)}` + message: `Invalid JSON syntax: ${errorMessage(error42)}` } ], warnings: [], @@ -626250,14 +548816,14 @@ async function validateMarketplaceManifest(filePath) { if (parsed && typeof parsed === "object") { const obj = parsed; if (Array.isArray(obj.plugins)) { - obj.plugins.forEach((plugin, i4) => { + obj.plugins.forEach((plugin, i3) => { if (plugin && typeof plugin === "object" && "source" in plugin) { const source = plugin.source; if (typeof source === "string") { - checkPathTraversal(source, `plugins[${i4}].source`, errors7, marketplaceSourceHint(source)); + checkPathTraversal(source, `plugins[${i3}].source`, errors7, marketplaceSourceHint(source)); } if (source && typeof source === "object" && "path" in source && typeof source.path === "string") { - checkPathTraversal(source.path, `plugins[${i4}].source.path`, errors7); + checkPathTraversal(source.path, `plugins[${i3}].source.path`, errors7); } } }); @@ -626266,12 +548832,12 @@ async function validateMarketplaceManifest(filePath) { const strictMarketplaceSchema = PluginMarketplaceSchema().extend({ plugins: exports_external.array(PluginMarketplaceEntrySchema().strict()) }).strict(); - const result3 = strictMarketplaceSchema.safeParse(parsed); - if (!result3.success) { - errors7.push(...formatZodErrors(result3.error)); + const result2 = strictMarketplaceSchema.safeParse(parsed); + if (!result2.success) { + errors7.push(...formatZodErrors(result2.error)); } - if (result3.success) { - const marketplace = result3.data; + if (result2.success) { + const marketplace = result2.data; if (!marketplace.plugins || marketplace.plugins.length === 0) { warnings.push({ path: "plugins", @@ -626279,25 +548845,25 @@ async function validateMarketplaceManifest(filePath) { }); } if (marketplace.plugins) { - marketplace.plugins.forEach((plugin, i4) => { + marketplace.plugins.forEach((plugin, i3) => { const duplicates = marketplace.plugins.filter((p) => p.name === plugin.name); if (duplicates.length > 1) { errors7.push({ - path: `plugins[${i4}].name`, + path: `plugins[${i3}].name`, message: `Duplicate plugin name "${plugin.name}" found in marketplace` }); } }); - const manifestDir = path25.dirname(absolutePath); - const marketplaceRoot = path25.basename(manifestDir) === ".claude-plugin" ? path25.dirname(manifestDir) : manifestDir; - for (const [i4, entry] of marketplace.plugins.entries()) { + const manifestDir = path20.dirname(absolutePath); + const marketplaceRoot = path20.basename(manifestDir) === ".claude-plugin" ? path20.dirname(manifestDir) : manifestDir; + for (const [i3, entry] of marketplace.plugins.entries()) { if (!entry.version || typeof entry.source !== "string" || !entry.source.startsWith("./")) { continue; } - const pluginJsonPath = path25.join(marketplaceRoot, entry.source, ".claude-plugin", "plugin.json"); + const pluginJsonPath = path20.join(marketplaceRoot, entry.source, ".claude-plugin", "plugin.json"); let manifestVersion; try { - const raw = await readFile48(pluginJsonPath, { encoding: "utf-8" }); + const raw = await readFile47(pluginJsonPath, { encoding: "utf-8" }); const parsed2 = jsonParse(raw); if (typeof parsed2.version === "string") { manifestVersion = parsed2.version; @@ -626307,7 +548873,7 @@ async function validateMarketplaceManifest(filePath) { } if (manifestVersion && manifestVersion !== entry.version) { warnings.push({ - path: `plugins[${i4}].version`, + path: `plugins[${i3}].version`, message: `Entry declares version "${entry.version}" but ${entry.source}/.claude-plugin/plugin.json says "${manifestVersion}". ` + `At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. ` + `Update this entry to "${manifestVersion}" to match.` }); } @@ -626378,14 +548944,14 @@ function validateComponentFile(filePath, content, fileType) { message: `name must be a string, got ${typeof fm.name}.` }); } - const at3 = fm["allowed-tools"]; - if (at3 !== undefined && at3 !== null) { - if (typeof at3 !== "string" && !Array.isArray(at3)) { + const at2 = fm["allowed-tools"]; + if (at2 !== undefined && at2 !== null) { + if (typeof at2 !== "string" && !Array.isArray(at2)) { errors7.push({ path: "allowed-tools", - message: `allowed-tools must be a string or array of strings, got ${typeof at3}.` + message: `allowed-tools must be a string or array of strings, got ${typeof at2}.` }); - } else if (Array.isArray(at3) && at3.some((t) => typeof t !== "string")) { + } else if (Array.isArray(at2) && at2.some((t) => typeof t !== "string")) { errors7.push({ path: "allowed-tools", message: "allowed-tools array must contain only strings." @@ -626414,7 +548980,7 @@ function validateComponentFile(filePath, content, fileType) { async function validateHooksJson(filePath) { let content; try { - content = await readFile48(filePath, { encoding: "utf-8" }); + content = await readFile47(filePath, { encoding: "utf-8" }); } catch (e) { const code = getErrnoCode(e); if (code === "ENOENT") { @@ -626453,11 +549019,11 @@ async function validateHooksJson(filePath) { fileType: "hooks" }; } - const result3 = PluginHooksSchema().safeParse(parsed); - if (!result3.success) { + const result2 = PluginHooksSchema().safeParse(parsed); + if (!result2.success) { return { success: false, - errors: formatZodErrors(result3.error), + errors: formatZodErrors(result2.error), warnings: [], filePath, fileType: "hooks" @@ -626482,11 +549048,11 @@ async function collectMarkdown(dir, isSkillsDir) { throw e; } if (isSkillsDir) { - return entries.filter((e) => e.isDirectory()).map((e) => path25.join(dir, e.name, "SKILL.md")); + return entries.filter((e) => e.isDirectory()).map((e) => path20.join(dir, e.name, "SKILL.md")); } const out = []; for (const entry of entries) { - const full = path25.join(dir, entry.name); + const full = path20.join(dir, entry.name); if (entry.isDirectory()) { out.push(...await collectMarkdown(full, false)); } else if (entry.isFile() && entry.name.toLowerCase().endsWith(".md")) { @@ -626498,16 +549064,16 @@ async function collectMarkdown(dir, isSkillsDir) { async function validatePluginContents(pluginDir) { const results = []; const dirs = [ - ["skill", path25.join(pluginDir, "skills")], - ["agent", path25.join(pluginDir, "agents")], - ["command", path25.join(pluginDir, "commands")] + ["skill", path20.join(pluginDir, "skills")], + ["agent", path20.join(pluginDir, "agents")], + ["command", path20.join(pluginDir, "commands")] ]; for (const [fileType, dir] of dirs) { - const files2 = await collectMarkdown(dir, fileType === "skill"); - for (const filePath of files2) { + const files = await collectMarkdown(dir, fileType === "skill"); + for (const filePath of files) { let content; try { - content = await readFile48(filePath, { encoding: "utf-8" }); + content = await readFile47(filePath, { encoding: "utf-8" }); } catch (e) { if (isENOENT(e)) continue; @@ -626528,29 +549094,29 @@ async function validatePluginContents(pluginDir) { } } } - const hooksResult = await validateHooksJson(path25.join(pluginDir, "hooks", "hooks.json")); + const hooksResult = await validateHooksJson(path20.join(pluginDir, "hooks", "hooks.json")); if (hooksResult.errors.length > 0 || hooksResult.warnings.length > 0) { results.push(hooksResult); } return results; } -async function validateManifest3(filePath) { - const absolutePath = path25.resolve(filePath); +async function validateManifest2(filePath) { + const absolutePath = path20.resolve(filePath); let stats = null; try { - stats = await stat43(absolutePath); + stats = await stat42(absolutePath); } catch (e) { if (!isENOENT(e)) { throw e; } } if (stats?.isDirectory()) { - const marketplacePath = path25.join(absolutePath, ".claude-plugin", "marketplace.json"); + const marketplacePath = path20.join(absolutePath, ".claude-plugin", "marketplace.json"); const marketplaceResult = await validateMarketplaceManifest(marketplacePath); if (marketplaceResult.errors[0]?.code !== "ENOENT") { return marketplaceResult; } - const pluginPath = path25.join(absolutePath, ".claude-plugin", "plugin.json"); + const pluginPath = path20.join(absolutePath, ".claude-plugin", "plugin.json"); const pluginResult = await validatePluginManifest(pluginPath); if (pluginResult.errors[0]?.code !== "ENOENT") { return pluginResult; @@ -626576,7 +549142,7 @@ async function validateManifest3(filePath) { return validateMarketplaceManifest(filePath); case "unknown": { try { - const content = await readFile48(absolutePath, { encoding: "utf-8" }); + const content = await readFile47(absolutePath, { encoding: "utf-8" }); const parsed = jsonParse(content); if (Array.isArray(parsed.plugins)) { return validateMarketplaceManifest(filePath); @@ -626623,14 +549189,14 @@ function ValidatePlugin(t0) { const $2 = import_compiler_runtime194.c(5); const { onComplete, - path: path26 + path: path21 } = t0; let t1; let t2; - if ($2[0] !== onComplete || $2[1] !== path26) { + if ($2[0] !== onComplete || $2[1] !== path21) { t1 = () => { const runValidation = async function runValidation() { - if (!path26) { + if (!path21) { onComplete(`Usage: /plugin validate Validate a plugin or marketplace manifest file or directory. @@ -626648,35 +549214,35 @@ Or from the command line: return; } try { - const result3 = await validateManifest3(path26); + const result2 = await validateManifest2(path21); let output = ""; - output = output + `Validating ${result3.fileType} manifest: ${result3.filePath} + output = output + `Validating ${result2.fileType} manifest: ${result2.filePath} `; - if (result3.errors.length > 0) { - output = output + `${figures_default.cross} Found ${result3.errors.length} ${plural(result3.errors.length, "error")}: + if (result2.errors.length > 0) { + output = output + `${figures_default.cross} Found ${result2.errors.length} ${plural(result2.errors.length, "error")}: `; - result3.errors.forEach((error_0) => { + result2.errors.forEach((error_0) => { output = output + ` ${figures_default.pointer} ${error_0.path}: ${error_0.message} `; }); output = output + ` `; } - if (result3.warnings.length > 0) { - output = output + `${figures_default.warning} Found ${result3.warnings.length} ${plural(result3.warnings.length, "warning")}: + if (result2.warnings.length > 0) { + output = output + `${figures_default.warning} Found ${result2.warnings.length} ${plural(result2.warnings.length, "warning")}: `; - result3.warnings.forEach((warning) => { + result2.warnings.forEach((warning) => { output = output + ` ${figures_default.pointer} ${warning.path}: ${warning.message} `; }); output = output + ` `; } - if (result3.success) { - if (result3.warnings.length > 0) { + if (result2.success) { + if (result2.warnings.length > 0) { output = output + `${figures_default.tick} Validation passed with warnings `; } else { @@ -626691,17 +549257,17 @@ Or from the command line: } onComplete(output); } catch (t32) { - const error46 = t32; + const error42 = t32; process.exitCode = 2; - logError2(error46); - onComplete(`${figures_default.cross} Unexpected error during validation: ${errorMessage(error46)}`); + logError2(error42); + onComplete(`${figures_default.cross} Unexpected error during validation: ${errorMessage(error42)}`); } }; runValidation(); }; - t2 = [onComplete, path26]; + t2 = [onComplete, path21]; $2[0] = onComplete; - $2[1] = path26; + $2[1] = path21; $2[2] = t1; $2[3] = t2; } else { @@ -626748,8 +549314,8 @@ function MarketplaceList(t0) { t1 = () => { const loadList = async function loadList() { try { - const config6 = await loadKnownMarketplacesConfig(); - const names = Object.keys(config6); + const config4 = await loadKnownMarketplacesConfig(); + const names = Object.keys(config4); if (names.length === 0) { onComplete("No marketplaces configured"); } else { @@ -626758,8 +549324,8 @@ ${names.map(_temp109).join(` `)}`); } } catch (t32) { - const err3 = t32; - onComplete(`Error loading marketplaces: ${errorMessage(err3)}`); + const err2 = t32; + onComplete(`Error loading marketplaces: ${errorMessage(err2)}`); } }; loadList(); @@ -626860,25 +549426,25 @@ function buildPluginAction(pluginName) { } }; } -function isTransientError(error46) { - return TRANSIENT_ERROR_TYPES.has(error46.type); +function isTransientError(error42) { + return TRANSIENT_ERROR_TYPES.has(error42.type); } -function getPluginNameFromError(error46) { - if ("pluginId" in error46 && error46.pluginId) - return error46.pluginId; - if ("plugin" in error46 && error46.plugin) - return error46.plugin; - if (error46.source.includes("@")) - return error46.source.split("@")[0]; +function getPluginNameFromError(error42) { + if ("pluginId" in error42 && error42.pluginId) + return error42.pluginId; + if ("plugin" in error42 && error42.plugin) + return error42.plugin; + if (error42.source.includes("@")) + return error42.source.split("@")[0]; return; } function buildErrorRows(failedMarketplaces, extraMarketplaceErrors, pluginLoadingErrors, otherErrors, brokenInstalledMarketplaces, transientErrors, pluginScopes) { const rows = []; - for (const error46 of transientErrors) { - const pluginName = "pluginId" in error46 ? error46.pluginId : ("plugin" in error46) ? error46.plugin : undefined; + for (const error42 of transientErrors) { + const pluginName = "pluginId" in error42 ? error42.pluginId : ("plugin" in error42) ? error42.plugin : undefined; rows.push({ - label: pluginName ?? error46.source, - message: formatErrorMessage(error46), + label: pluginName ?? error42.source, + message: formatErrorMessage(error42), guidance: "Restart to retry loading plugins", action: { kind: "none" @@ -626929,29 +549495,29 @@ function buildErrorRows(failedMarketplaces, extraMarketplaceErrors, pluginLoadin }); } const shownPluginNames = new Set; - for (const error46 of pluginLoadingErrors) { - const pluginName = getPluginNameFromError(error46); + for (const error42 of pluginLoadingErrors) { + const pluginName = getPluginNameFromError(error42); if (pluginName && shownPluginNames.has(pluginName)) continue; if (pluginName) shownPluginNames.add(pluginName); - const marketplace = "marketplace" in error46 ? error46.marketplace : undefined; - const scope = pluginName ? pluginScopes.get(error46.source) ?? pluginScopes.get(pluginName) : undefined; + const marketplace = "marketplace" in error42 ? error42.marketplace : undefined; + const scope = pluginName ? pluginScopes.get(error42.source) ?? pluginScopes.get(pluginName) : undefined; rows.push({ - label: pluginName ? marketplace ? `${pluginName} @ ${marketplace}` : pluginName : error46.source, - message: formatErrorMessage(error46), - guidance: getErrorGuidance(error46), + label: pluginName ? marketplace ? `${pluginName} @ ${marketplace}` : pluginName : error42.source, + message: formatErrorMessage(error42), + guidance: getErrorGuidance(error42), action: pluginName ? buildPluginAction(pluginName) : { kind: "none" }, scope }); } - for (const error46 of otherErrors) { + for (const error42 of otherErrors) { rows.push({ - label: error46.source, - message: formatErrorMessage(error46), - guidance: getErrorGuidance(error46), + label: error42.source, + message: formatErrorMessage(error42), + guidance: getErrorGuidance(error42), action: { kind: "none" } @@ -627020,10 +549586,10 @@ function ErrorsTabContent(t0) { t2 = () => { (async () => { try { - const config6 = await loadKnownMarketplacesConfig(); + const config4 = await loadKnownMarketplacesConfig(); const { failures - } = await loadMarketplacesWithGracefulDegradation(config6); + } = await loadMarketplacesWithGracefulDegradation(config4); setMarketplaceLoadFailures(failures); } catch {} })(); @@ -627109,8 +549675,8 @@ function ErrorsTabContent(t0) { setActionMessage(`${figures_default.tick} Removed marketplace "${action2.name}"`); markPluginsChanged(); } catch (t6) { - const err3 = t6; - setActionMessage(`Failed to remove "${action2.name}": ${err3 instanceof Error ? err3.message : String(err3)}`); + const err2 = t6; + setActionMessage(`Failed to remove "${action2.name}": ${err2 instanceof Error ? err2.message : String(err2)}`); } })(); break bb77; @@ -627504,8 +550070,8 @@ function PluginSettings(t0) { const [activeTab, setActiveTab] = import_react141.useState(t2); const [inputValue, setInputValue] = import_react141.useState(viewState.type === "add-marketplace" ? viewState.initialValue || "" : ""); const [cursorOffset, setCursorOffset] = import_react141.useState(0); - const [error46, setError] = import_react141.useState(null); - const [result3, setResult] = import_react141.useState(null); + const [error42, setError] = import_react141.useState(null); + const [result2, setResult] = import_react141.useState(null); const [childSearchActive, setChildSearchActive] = import_react141.useState(false); const setAppState = useSetAppState(); const pluginErrorCount = useAppState(_temp03); @@ -627559,15 +550125,15 @@ function PluginSettings(t0) { const handleTabChange = t4; let t5; let t6; - if ($2[8] !== onComplete || $2[9] !== result3 || $2[10] !== viewState.type) { + if ($2[8] !== onComplete || $2[9] !== result2 || $2[10] !== viewState.type) { t5 = () => { - if (viewState.type === "menu" && !result3) { + if (viewState.type === "menu" && !result2) { onComplete(); } }; - t6 = [viewState.type, result3, onComplete]; + t6 = [viewState.type, result2, onComplete]; $2[8] = onComplete; - $2[9] = result3; + $2[9] = result2; $2[10] = viewState.type; $2[11] = t5; $2[12] = t6; @@ -627624,15 +550190,15 @@ function PluginSettings(t0) { useKeybinding("confirm:no", handleAddMarketplaceEscape, t11); let t12; let t13; - if ($2[20] !== onComplete || $2[21] !== result3) { + if ($2[20] !== onComplete || $2[21] !== result2) { t12 = () => { - if (result3) { - onComplete(result3); + if (result2) { + onComplete(result2); } }; - t13 = [result3, onComplete]; + t13 = [result2, onComplete]; $2[20] = onComplete; - $2[21] = result3; + $2[21] = result2; $2[22] = t12; $2[23] = t13; } else { @@ -627825,15 +550391,15 @@ function PluginSettings(t0) { } if (viewState.type === "add-marketplace") { let t162; - if ($2[34] !== cliMode || $2[35] !== cursorOffset || $2[36] !== error46 || $2[37] !== inputValue || $2[38] !== markPluginsChanged || $2[39] !== result3) { + if ($2[34] !== cliMode || $2[35] !== cursorOffset || $2[36] !== error42 || $2[37] !== inputValue || $2[38] !== markPluginsChanged || $2[39] !== result2) { t162 = /* @__PURE__ */ jsx_dev_runtime249.jsxDEV(AddMarketplace, { inputValue, setInputValue, cursorOffset, setCursorOffset, - error: error46, + error: error42, setError, - result: result3, + result: result2, setResult, setViewState, onAddComplete: markPluginsChanged, @@ -627841,10 +550407,10 @@ function PluginSettings(t0) { }, undefined, false, undefined, this); $2[34] = cliMode; $2[35] = cursorOffset; - $2[36] = error46; + $2[36] = error42; $2[37] = inputValue; $2[38] = markPluginsChanged; - $2[39] = result3; + $2[39] = result2; $2[40] = t162; } else { t162 = $2[40]; @@ -627861,23 +550427,23 @@ function PluginSettings(t0) { t16 = $2[43]; } let t17; - if ($2[44] !== error46 || $2[45] !== markPluginsChanged || $2[46] !== result3 || $2[47] !== viewState.targetMarketplace || $2[48] !== viewState.targetPlugin || $2[49] !== viewState.type) { + if ($2[44] !== error42 || $2[45] !== markPluginsChanged || $2[46] !== result2 || $2[47] !== viewState.targetMarketplace || $2[48] !== viewState.targetPlugin || $2[49] !== viewState.type) { t17 = /* @__PURE__ */ jsx_dev_runtime249.jsxDEV(Tab, { id: "discover", title: "Discover", children: viewState.type === "browse-marketplace" ? /* @__PURE__ */ jsx_dev_runtime249.jsxDEV(BrowseMarketplace, { - error: error46, + error: error42, setError, - result: result3, + result: result2, setResult, setViewState, onInstallComplete: markPluginsChanged, targetMarketplace: viewState.targetMarketplace, targetPlugin: viewState.targetPlugin }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime249.jsxDEV(DiscoverPlugins, { - error: error46, + error: error42, setError, - result: result3, + result: result2, setResult, setViewState, onInstallComplete: markPluginsChanged, @@ -627885,9 +550451,9 @@ function PluginSettings(t0) { targetPlugin: viewState.type === "discover-plugins" ? viewState.targetPlugin : undefined }, undefined, false, undefined, this) }, undefined, false, undefined, this); - $2[44] = error46; + $2[44] = error42; $2[45] = markPluginsChanged; - $2[46] = result3; + $2[46] = result2; $2[47] = viewState.targetMarketplace; $2[48] = viewState.targetPlugin; $2[49] = viewState.type; @@ -627924,13 +550490,13 @@ function PluginSettings(t0) { const t22 = viewState.type === "manage-marketplaces" ? viewState.targetMarketplace : undefined; const t23 = viewState.type === "manage-marketplaces" ? viewState.action : undefined; let t24; - if ($2[56] !== error46 || $2[57] !== exitState || $2[58] !== markPluginsChanged || $2[59] !== t22 || $2[60] !== t23) { + if ($2[56] !== error42 || $2[57] !== exitState || $2[58] !== markPluginsChanged || $2[59] !== t22 || $2[60] !== t23) { t24 = /* @__PURE__ */ jsx_dev_runtime249.jsxDEV(Tab, { id: "marketplaces", title: "Marketplaces", children: /* @__PURE__ */ jsx_dev_runtime249.jsxDEV(ManageMarketplaces, { setViewState, - error: error46, + error: error42, setError, setResult, exitState, @@ -627939,7 +550505,7 @@ function PluginSettings(t0) { action: t23 }, undefined, false, undefined, this) }, undefined, false, undefined, this); - $2[56] = error46; + $2[56] = error42; $2[57] = exitState; $2[58] = markPluginsChanged; $2[59] = t22; @@ -628170,7 +550736,7 @@ var require_can_promise = __commonJS((exports, module) => { }); // node_modules/qrcode/lib/core/utils.js -var require_utils19 = __commonJS((exports) => { +var require_utils18 = __commonJS((exports) => { var toSJISFunction; var CODEWORDS_COUNT = [ 0, @@ -628302,8 +550868,8 @@ var require_bit_buffer = __commonJS((exports, module) => { return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1; }, put: function(num, length) { - for (let i4 = 0;i4 < length; i4++) { - this.putBit((num >>> length - i4 - 1 & 1) === 1); + for (let i3 = 0;i3 < length; i3++) { + this.putBit((num >>> length - i3 - 1 & 1) === 1); } }, getLengthInBits: function() { @@ -628325,13 +550891,13 @@ var require_bit_buffer = __commonJS((exports, module) => { // node_modules/qrcode/lib/core/bit-matrix.js var require_bit_matrix = __commonJS((exports, module) => { - function BitMatrix(size3) { - if (!size3 || size3 < 1) { + function BitMatrix(size2) { + if (!size2 || size2 < 1) { throw new Error("BitMatrix size must be defined and greater than 0"); } - this.size = size3; - this.data = new Uint8Array(size3 * size3); - this.reservedBit = new Uint8Array(size3 * size3); + this.size = size2; + this.data = new Uint8Array(size2 * size2); + this.reservedBit = new Uint8Array(size2 * size2); } BitMatrix.prototype.set = function(row, col, value, reserved) { const index = row * this.size + col; @@ -628353,16 +550919,16 @@ var require_bit_matrix = __commonJS((exports, module) => { // node_modules/qrcode/lib/core/alignment-pattern.js var require_alignment_pattern = __commonJS((exports) => { - var getSymbolSize = require_utils19().getSymbolSize; + var getSymbolSize = require_utils18().getSymbolSize; exports.getRowColCoords = function getRowColCoords(version3) { if (version3 === 1) return []; const posCount = Math.floor(version3 / 7) + 2; - const size3 = getSymbolSize(version3); - const intervals = size3 === 145 ? 26 : Math.ceil((size3 - 13) / (2 * posCount - 2)) * 2; - const positions = [size3 - 7]; - for (let i4 = 1;i4 < posCount - 1; i4++) { - positions[i4] = positions[i4 - 1] - intervals; + const size2 = getSymbolSize(version3); + const intervals = size2 === 145 ? 26 : Math.ceil((size2 - 13) / (2 * posCount - 2)) * 2; + const positions = [size2 - 7]; + for (let i3 = 1;i3 < posCount - 1; i3++) { + positions[i3] = positions[i3 - 1] - intervals; } positions.push(6); return positions.reverse(); @@ -628371,12 +550937,12 @@ var require_alignment_pattern = __commonJS((exports) => { const coords = []; const pos = exports.getRowColCoords(version3); const posLength = pos.length; - for (let i4 = 0;i4 < posLength; i4++) { + for (let i3 = 0;i3 < posLength; i3++) { for (let j = 0;j < posLength; j++) { - if (i4 === 0 && j === 0 || i4 === 0 && j === posLength - 1 || i4 === posLength - 1 && j === 0) { + if (i3 === 0 && j === 0 || i3 === 0 && j === posLength - 1 || i3 === posLength - 1 && j === 0) { continue; } - coords.push([pos[i4], pos[j]]); + coords.push([pos[i3], pos[j]]); } } return coords; @@ -628385,14 +550951,14 @@ var require_alignment_pattern = __commonJS((exports) => { // node_modules/qrcode/lib/core/finder-pattern.js var require_finder_pattern = __commonJS((exports) => { - var getSymbolSize = require_utils19().getSymbolSize; + var getSymbolSize = require_utils18().getSymbolSize; var FINDER_PATTERN_SIZE = 7; exports.getPositions = function getPositions(version3) { - const size3 = getSymbolSize(version3); + const size2 = getSymbolSize(version3); return [ [0, 0], - [size3 - FINDER_PATTERN_SIZE, 0], - [0, size3 - FINDER_PATTERN_SIZE] + [size2 - FINDER_PATTERN_SIZE, 0], + [0, size2 - FINDER_PATTERN_SIZE] ]; }; }); @@ -628422,16 +550988,16 @@ var require_mask_pattern = __commonJS((exports) => { return exports.isValid(value) ? parseInt(value, 10) : undefined; }; exports.getPenaltyN1 = function getPenaltyN1(data) { - const size3 = data.size; + const size2 = data.size; let points = 0; let sameCountCol = 0; let sameCountRow = 0; let lastCol = null; let lastRow = null; - for (let row = 0;row < size3; row++) { + for (let row = 0;row < size2; row++) { sameCountCol = sameCountRow = 0; lastCol = lastRow = null; - for (let col = 0;col < size3; col++) { + for (let col = 0;col < size2; col++) { let module2 = data.get(row, col); if (module2 === lastCol) { sameCountCol++; @@ -628459,25 +551025,25 @@ var require_mask_pattern = __commonJS((exports) => { return points; }; exports.getPenaltyN2 = function getPenaltyN2(data) { - const size3 = data.size; + const size2 = data.size; let points = 0; - for (let row = 0;row < size3 - 1; row++) { - for (let col = 0;col < size3 - 1; col++) { - const last3 = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1); - if (last3 === 4 || last3 === 0) + for (let row = 0;row < size2 - 1; row++) { + for (let col = 0;col < size2 - 1; col++) { + const last2 = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1); + if (last2 === 4 || last2 === 0) points++; } } return points * PenaltyScores.N2; }; exports.getPenaltyN3 = function getPenaltyN3(data) { - const size3 = data.size; + const size2 = data.size; let points = 0; let bitsCol = 0; let bitsRow = 0; - for (let row = 0;row < size3; row++) { + for (let row = 0;row < size2; row++) { bitsCol = bitsRow = 0; - for (let col = 0;col < size3; col++) { + for (let col = 0;col < size2; col++) { bitsCol = bitsCol << 1 & 2047 | data.get(row, col); if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++; @@ -628491,37 +551057,37 @@ var require_mask_pattern = __commonJS((exports) => { exports.getPenaltyN4 = function getPenaltyN4(data) { let darkCount = 0; const modulesCount = data.data.length; - for (let i4 = 0;i4 < modulesCount; i4++) - darkCount += data.data[i4]; + for (let i3 = 0;i3 < modulesCount; i3++) + darkCount += data.data[i3]; const k = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10); return k * PenaltyScores.N4; }; - function getMaskAt(maskPattern, i4, j) { + function getMaskAt(maskPattern, i3, j) { switch (maskPattern) { case exports.Patterns.PATTERN000: - return (i4 + j) % 2 === 0; + return (i3 + j) % 2 === 0; case exports.Patterns.PATTERN001: - return i4 % 2 === 0; + return i3 % 2 === 0; case exports.Patterns.PATTERN010: return j % 3 === 0; case exports.Patterns.PATTERN011: - return (i4 + j) % 3 === 0; + return (i3 + j) % 3 === 0; case exports.Patterns.PATTERN100: - return (Math.floor(i4 / 2) + Math.floor(j / 3)) % 2 === 0; + return (Math.floor(i3 / 2) + Math.floor(j / 3)) % 2 === 0; case exports.Patterns.PATTERN101: - return i4 * j % 2 + i4 * j % 3 === 0; + return i3 * j % 2 + i3 * j % 3 === 0; case exports.Patterns.PATTERN110: - return (i4 * j % 2 + i4 * j % 3) % 2 === 0; + return (i3 * j % 2 + i3 * j % 3) % 2 === 0; case exports.Patterns.PATTERN111: - return (i4 * j % 3 + (i4 + j) % 2) % 2 === 0; + return (i3 * j % 3 + (i3 + j) % 2) % 2 === 0; default: throw new Error("bad maskPattern:" + maskPattern); } } exports.applyMask = function applyMask(pattern, data) { - const size3 = data.size; - for (let col = 0;col < size3; col++) { - for (let row = 0;row < size3; row++) { + const size2 = data.size; + for (let col = 0;col < size2; col++) { + for (let row = 0;row < size2; row++) { if (data.isReserved(row, col)) continue; data.xor(row, col, getMaskAt(pattern, row, col)); @@ -628908,17 +551474,17 @@ var require_galois_field = __commonJS((exports) => { var EXP_TABLE = new Uint8Array(512); var LOG_TABLE = new Uint8Array(256); (function initTables() { - let x4 = 1; - for (let i4 = 0;i4 < 255; i4++) { - EXP_TABLE[i4] = x4; - LOG_TABLE[x4] = i4; - x4 <<= 1; - if (x4 & 256) { - x4 ^= 285; + let x3 = 1; + for (let i3 = 0;i3 < 255; i3++) { + EXP_TABLE[i3] = x3; + LOG_TABLE[x3] = i3; + x3 <<= 1; + if (x3 & 256) { + x3 ^= 285; } } - for (let i4 = 255;i4 < 512; i4++) { - EXP_TABLE[i4] = EXP_TABLE[i4 - 255]; + for (let i3 = 255;i3 < 512; i3++) { + EXP_TABLE[i3] = EXP_TABLE[i3 - 255]; } })(); exports.log = function log(n2) { @@ -628929,10 +551495,10 @@ var require_galois_field = __commonJS((exports) => { exports.exp = function exp(n2) { return EXP_TABLE[n2]; }; - exports.mul = function mul(x4, y2) { - if (x4 === 0 || y2 === 0) + exports.mul = function mul(x3, y2) { + if (x3 === 0 || y2 === 0) return 0; - return EXP_TABLE[LOG_TABLE[x4] + LOG_TABLE[y2]]; + return EXP_TABLE[LOG_TABLE[x3] + LOG_TABLE[y2]]; }; }); @@ -628941,31 +551507,31 @@ var require_polynomial = __commonJS((exports) => { var GF = require_galois_field(); exports.mul = function mul(p1, p2) { const coeff = new Uint8Array(p1.length + p2.length - 1); - for (let i4 = 0;i4 < p1.length; i4++) { + for (let i3 = 0;i3 < p1.length; i3++) { for (let j = 0;j < p2.length; j++) { - coeff[i4 + j] ^= GF.mul(p1[i4], p2[j]); + coeff[i3 + j] ^= GF.mul(p1[i3], p2[j]); } } return coeff; }; exports.mod = function mod(divident, divisor) { - let result3 = new Uint8Array(divident); - while (result3.length - divisor.length >= 0) { - const coeff = result3[0]; - for (let i4 = 0;i4 < divisor.length; i4++) { - result3[i4] ^= GF.mul(divisor[i4], coeff); + let result2 = new Uint8Array(divident); + while (result2.length - divisor.length >= 0) { + const coeff = result2[0]; + for (let i3 = 0;i3 < divisor.length; i3++) { + result2[i3] ^= GF.mul(divisor[i3], coeff); } let offset = 0; - while (offset < result3.length && result3[offset] === 0) + while (offset < result2.length && result2[offset] === 0) offset++; - result3 = result3.slice(offset); + result2 = result2.slice(offset); } - return result3; + return result2; }; exports.generateECPolynomial = function generateECPolynomial(degree) { let poly = new Uint8Array([1]); - for (let i4 = 0;i4 < degree; i4++) { - poly = exports.mul(poly, new Uint8Array([1, GF.exp(i4)])); + for (let i3 = 0;i3 < degree; i3++) { + poly = exports.mul(poly, new Uint8Array([1, GF.exp(i3)])); } return poly; }; @@ -629010,7 +551576,7 @@ var require_version_check = __commonJS((exports) => { }); // node_modules/qrcode/lib/core/regex.js -var require_regex3 = __commonJS((exports) => { +var require_regex2 = __commonJS((exports) => { var numeric = "[0-9]+"; var alphanumeric = "[A-Z $%*+\\-./:]+"; var kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|" + "[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|" + "[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|" + "[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+"; @@ -629039,7 +551605,7 @@ var require_regex3 = __commonJS((exports) => { // node_modules/qrcode/lib/core/mode.js var require_mode2 = __commonJS((exports) => { var VersionCheck = require_version_check(); - var Regex = require_regex3(); + var Regex = require_regex2(); exports.NUMERIC = { id: "Numeric", bit: 1 << 0, @@ -629124,8 +551690,8 @@ var require_mode2 = __commonJS((exports) => { }); // node_modules/qrcode/lib/core/version.js -var require_version7 = __commonJS((exports) => { - var Utils = require_utils19(); +var require_version6 = __commonJS((exports) => { + var Utils = require_utils18(); var ECCode = require_error_correction_code(); var ECLevel = require_error_correction_level(); var Mode = require_mode2(); @@ -629220,7 +551786,7 @@ var require_version7 = __commonJS((exports) => { // node_modules/qrcode/lib/core/format-info.js var require_format_info = __commonJS((exports) => { - var Utils = require_utils19(); + var Utils = require_utils18(); var G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0; var G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1; var G15_BCH = Utils.getBCHDigit(G15); @@ -629251,15 +551817,15 @@ var require_numeric_data = __commonJS((exports, module) => { return NumericData.getBitsLength(this.data.length); }; NumericData.prototype.write = function write(bitBuffer) { - let i4, group, value; - for (i4 = 0;i4 + 3 <= this.data.length; i4 += 3) { - group = this.data.substr(i4, 3); + let i3, group, value; + for (i3 = 0;i3 + 3 <= this.data.length; i3 += 3) { + group = this.data.substr(i3, 3); value = parseInt(group, 10); bitBuffer.put(value, 10); } - const remainingNum = this.data.length - i4; + const remainingNum = this.data.length - i3; if (remainingNum > 0) { - group = this.data.substr(i4); + group = this.data.substr(i3); value = parseInt(group, 10); bitBuffer.put(value, remainingNum * 3 + 1); } @@ -629331,14 +551897,14 @@ var require_alphanumeric_data = __commonJS((exports, module) => { return AlphanumericData.getBitsLength(this.data.length); }; AlphanumericData.prototype.write = function write(bitBuffer) { - let i4; - for (i4 = 0;i4 + 2 <= this.data.length; i4 += 2) { - let value = ALPHA_NUM_CHARS.indexOf(this.data[i4]) * 45; - value += ALPHA_NUM_CHARS.indexOf(this.data[i4 + 1]); + let i3; + for (i3 = 0;i3 + 2 <= this.data.length; i3 += 2) { + let value = ALPHA_NUM_CHARS.indexOf(this.data[i3]) * 45; + value += ALPHA_NUM_CHARS.indexOf(this.data[i3 + 1]); bitBuffer.put(value, 11); } if (this.data.length % 2) { - bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i4]), 6); + bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i3]), 6); } }; module.exports = AlphanumericData; @@ -629365,8 +551931,8 @@ var require_byte_data = __commonJS((exports, module) => { return ByteData.getBitsLength(this.data.length); }; ByteData.prototype.write = function(bitBuffer) { - for (let i4 = 0, l = this.data.length;i4 < l; i4++) { - bitBuffer.put(this.data[i4], 8); + for (let i3 = 0, l = this.data.length;i3 < l; i3++) { + bitBuffer.put(this.data[i3], 8); } }; module.exports = ByteData; @@ -629375,7 +551941,7 @@ var require_byte_data = __commonJS((exports, module) => { // node_modules/qrcode/lib/core/kanji-data.js var require_kanji_data = __commonJS((exports, module) => { var Mode = require_mode2(); - var Utils = require_utils19(); + var Utils = require_utils18(); function KanjiData(data) { this.mode = Mode.KANJI; this.data = data; @@ -629390,15 +551956,15 @@ var require_kanji_data = __commonJS((exports, module) => { return KanjiData.getBitsLength(this.data.length); }; KanjiData.prototype.write = function(bitBuffer) { - let i4; - for (i4 = 0;i4 < this.data.length; i4++) { - let value = Utils.toSJIS(this.data[i4]); + let i3; + for (i3 = 0;i3 < this.data.length; i3++) { + let value = Utils.toSJIS(this.data[i3]); if (value >= 33088 && value <= 40956) { value -= 33088; } else if (value >= 57408 && value <= 60351) { value -= 49472; } else { - throw new Error("Invalid SJIS character: " + this.data[i4] + ` + throw new Error("Invalid SJIS character: " + this.data[i3] + ` ` + "Make sure your charset is UTF-8"); } value = (value >>> 8 & 255) * 192 + (value & 255); @@ -629500,21 +552066,21 @@ var require_segments = __commonJS((exports) => { var AlphanumericData = require_alphanumeric_data(); var ByteData = require_byte_data(); var KanjiData = require_kanji_data(); - var Regex = require_regex3(); - var Utils = require_utils19(); + var Regex = require_regex2(); + var Utils = require_utils18(); var dijkstra = require_dijkstra(); function getStringByteLength(str2) { return unescape(encodeURIComponent(str2)).length; } function getSegments(regex2, mode, str2) { const segments = []; - let result3; - while ((result3 = regex2.exec(str2)) !== null) { + let result2; + while ((result2 = regex2.exec(str2)) !== null) { segments.push({ - data: result3[0], - index: result3.index, + data: result2[0], + index: result2.index, mode, - length: result3[0].length + length: result2[0].length }); } return segments; @@ -629567,8 +552133,8 @@ var require_segments = __commonJS((exports) => { } function buildNodes(segs) { const nodes = []; - for (let i4 = 0;i4 < segs.length; i4++) { - const seg = segs[i4]; + for (let i3 = 0;i3 < segs.length; i3++) { + const seg = segs[i3]; switch (seg.mode) { case Mode.NUMERIC: nodes.push([ @@ -629601,12 +552167,12 @@ var require_segments = __commonJS((exports) => { const table = {}; const graph = { start: {} }; let prevNodeIds = ["start"]; - for (let i4 = 0;i4 < nodes.length; i4++) { - const nodeGroup = nodes[i4]; + for (let i3 = 0;i3 < nodes.length; i3++) { + const nodeGroup = nodes[i3]; const currentNodeIds = []; for (let j = 0;j < nodeGroup.length; j++) { const node = nodeGroup[j]; - const key = "" + i4 + j; + const key = "" + i3 + j; currentNodeIds.push(key); table[key] = { node, lastCount: 0 }; graph[key] = {}; @@ -629665,10 +552231,10 @@ var require_segments = __commonJS((exports) => { const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled()); const nodes = buildNodes(segs); const graph = buildGraph(nodes, version3); - const path26 = dijkstra.find_path(graph.map, "start", "end"); + const path21 = dijkstra.find_path(graph.map, "start", "end"); const optimizedSegs = []; - for (let i4 = 1;i4 < path26.length - 1; i4++) { - optimizedSegs.push(graph.table[path26[i4]].node); + for (let i3 = 1;i3 < path21.length - 1; i3++) { + optimizedSegs.push(graph.table[path21[i3]].node); } return exports.fromArray(mergeSegments(optimizedSegs)); }; @@ -629679,7 +552245,7 @@ var require_segments = __commonJS((exports) => { // node_modules/qrcode/lib/core/qrcode.js var require_qrcode = __commonJS((exports) => { - var Utils = require_utils19(); + var Utils = require_utils18(); var ECLevel = require_error_correction_level(); var BitBuffer = require_bit_buffer(); var BitMatrix = require_bit_matrix(); @@ -629688,21 +552254,21 @@ var require_qrcode = __commonJS((exports) => { var MaskPattern = require_mask_pattern(); var ECCode = require_error_correction_code(); var ReedSolomonEncoder = require_reed_solomon_encoder(); - var Version = require_version7(); + var Version = require_version6(); var FormatInfo = require_format_info(); var Mode = require_mode2(); var Segments = require_segments(); function setupFinderPattern(matrix, version3) { - const size3 = matrix.size; + const size2 = matrix.size; const pos = FinderPattern.getPositions(version3); - for (let i4 = 0;i4 < pos.length; i4++) { - const row = pos[i4][0]; - const col = pos[i4][1]; + for (let i3 = 0;i3 < pos.length; i3++) { + const row = pos[i3][0]; + const col = pos[i3][1]; for (let r = -1;r <= 7; r++) { - if (row + r <= -1 || size3 <= row + r) + if (row + r <= -1 || size2 <= row + r) continue; for (let c6 = -1;c6 <= 7; c6++) { - if (col + c6 <= -1 || size3 <= col + c6) + if (col + c6 <= -1 || size2 <= col + c6) continue; if (r >= 0 && r <= 6 && (c6 === 0 || c6 === 6) || c6 >= 0 && c6 <= 6 && (r === 0 || r === 6) || r >= 2 && r <= 4 && c6 >= 2 && c6 <= 4) { matrix.set(row + r, col + c6, true, true); @@ -629714,8 +552280,8 @@ var require_qrcode = __commonJS((exports) => { } } function setupTimingPattern(matrix) { - const size3 = matrix.size; - for (let r = 8;r < size3 - 8; r++) { + const size2 = matrix.size; + for (let r = 8;r < size2 - 8; r++) { const value = r % 2 === 0; matrix.set(r, 6, value, true); matrix.set(6, r, value, true); @@ -629723,9 +552289,9 @@ var require_qrcode = __commonJS((exports) => { } function setupAlignmentPattern(matrix, version3) { const pos = AlignmentPattern.getPositions(version3); - for (let i4 = 0;i4 < pos.length; i4++) { - const row = pos[i4][0]; - const col = pos[i4][1]; + for (let i3 = 0;i3 < pos.length; i3++) { + const row = pos[i3][0]; + const col = pos[i3][1]; for (let r = -2;r <= 2; r++) { for (let c6 = -2;c6 <= 2; c6++) { if (r === -2 || r === 2 || c6 === -2 || c6 === 2 || r === 0 && c6 === 0) { @@ -629738,47 +552304,47 @@ var require_qrcode = __commonJS((exports) => { } } function setupVersionInfo(matrix, version3) { - const size3 = matrix.size; - const bits3 = Version.getEncodedBits(version3); + const size2 = matrix.size; + const bits2 = Version.getEncodedBits(version3); let row, col, mod2; - for (let i4 = 0;i4 < 18; i4++) { - row = Math.floor(i4 / 3); - col = i4 % 3 + size3 - 8 - 3; - mod2 = (bits3 >> i4 & 1) === 1; + for (let i3 = 0;i3 < 18; i3++) { + row = Math.floor(i3 / 3); + col = i3 % 3 + size2 - 8 - 3; + mod2 = (bits2 >> i3 & 1) === 1; matrix.set(row, col, mod2, true); matrix.set(col, row, mod2, true); } } function setupFormatInfo(matrix, errorCorrectionLevel, maskPattern) { - const size3 = matrix.size; - const bits3 = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern); - let i4, mod2; - for (i4 = 0;i4 < 15; i4++) { - mod2 = (bits3 >> i4 & 1) === 1; - if (i4 < 6) { - matrix.set(i4, 8, mod2, true); - } else if (i4 < 8) { - matrix.set(i4 + 1, 8, mod2, true); + const size2 = matrix.size; + const bits2 = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern); + let i3, mod2; + for (i3 = 0;i3 < 15; i3++) { + mod2 = (bits2 >> i3 & 1) === 1; + if (i3 < 6) { + matrix.set(i3, 8, mod2, true); + } else if (i3 < 8) { + matrix.set(i3 + 1, 8, mod2, true); } else { - matrix.set(size3 - 15 + i4, 8, mod2, true); + matrix.set(size2 - 15 + i3, 8, mod2, true); } - if (i4 < 8) { - matrix.set(8, size3 - i4 - 1, mod2, true); - } else if (i4 < 9) { - matrix.set(8, 15 - i4 - 1 + 1, mod2, true); + if (i3 < 8) { + matrix.set(8, size2 - i3 - 1, mod2, true); + } else if (i3 < 9) { + matrix.set(8, 15 - i3 - 1 + 1, mod2, true); } else { - matrix.set(8, 15 - i4 - 1, mod2, true); + matrix.set(8, 15 - i3 - 1, mod2, true); } } - matrix.set(size3 - 8, 8, 1, true); + matrix.set(size2 - 8, 8, 1, true); } function setupData(matrix, data) { - const size3 = matrix.size; + const size2 = matrix.size; let inc = -1; - let row = size3 - 1; + let row = size2 - 1; let bitIndex = 7; let byteIndex = 0; - for (let col = size3 - 1;col > 0; col -= 2) { + for (let col = size2 - 1;col > 0; col -= 2) { if (col === 6) col--; while (true) { @@ -629797,7 +552363,7 @@ var require_qrcode = __commonJS((exports) => { } } row += inc; - if (row < 0 || size3 <= row) { + if (row < 0 || size2 <= row) { row -= inc; inc = -inc; break; @@ -629822,8 +552388,8 @@ var require_qrcode = __commonJS((exports) => { buffer.putBit(0); } const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8; - for (let i4 = 0;i4 < remainingByte; i4++) { - buffer.put(i4 % 2 ? 17 : 236, 8); + for (let i3 = 0;i3 < remainingByte; i3++) { + buffer.put(i3 % 2 ? 17 : 236, 8); } return createCodewords(buffer, version3, errorCorrectionLevel); } @@ -629853,17 +552419,17 @@ var require_qrcode = __commonJS((exports) => { } const data = new Uint8Array(totalCodewords); let index = 0; - let i4, r; - for (i4 = 0;i4 < maxDataSize; i4++) { + let i3, r; + for (i3 = 0;i3 < maxDataSize; i3++) { for (r = 0;r < ecTotalBlocks; r++) { - if (i4 < dcData[r].length) { - data[index++] = dcData[r][i4]; + if (i3 < dcData[r].length) { + data[index++] = dcData[r][i3]; } } } - for (i4 = 0;i4 < ecCount; i4++) { + for (i3 = 0;i3 < ecCount; i3++) { for (r = 0;r < ecTotalBlocks; r++) { - data[index++] = ecData[r][i4]; + data[index++] = ecData[r][i3]; } } return data; @@ -629940,9 +552506,9 @@ var require_qrcode = __commonJS((exports) => { // node_modules/pngjs/lib/chunkstream.js var require_chunkstream = __commonJS((exports, module) => { var util7 = __require("util"); - var Stream6 = __require("stream"); + var Stream4 = __require("stream"); var ChunkStream = module.exports = function() { - Stream6.call(this); + Stream4.call(this); this._buffers = []; this._buffered = 0; this._reads = []; @@ -629950,7 +552516,7 @@ var require_chunkstream = __commonJS((exports, module) => { this._encoding = "utf8"; this.writable = true; }; - util7.inherits(ChunkStream, Stream6); + util7.inherits(ChunkStream, Stream4); ChunkStream.prototype.read = function(length, callback) { this._reads.push({ length: Math.abs(length), @@ -630107,8 +552673,8 @@ var require_interlace = __commonJS((exports) => { let yLeftOver = height % 8; let xRepeats = (width - xLeftOver) / 8; let yRepeats = (height - yLeftOver) / 8; - for (let i4 = 0;i4 < imagePasses.length; i4++) { - let pass = imagePasses[i4]; + for (let i3 = 0;i3 < imagePasses.length; i3++) { + let pass = imagePasses[i3]; let passWidth = xRepeats * pass.x.length; let passHeight = yRepeats * pass.y.length; for (let j = 0;j < pass.x.length; j++) { @@ -630126,15 +552692,15 @@ var require_interlace = __commonJS((exports) => { } } if (passWidth > 0 && passHeight > 0) { - images.push({ width: passWidth, height: passHeight, index: i4 }); + images.push({ width: passWidth, height: passHeight, index: i3 }); } } return images; }; exports.getInterlaceIterator = function(width) { - return function(x4, y2, pass) { - let outerXLeftOver = x4 % imagePasses[pass].x.length; - let outerX = (x4 - outerXLeftOver) / imagePasses[pass].x.length * 8 + imagePasses[pass].x[outerXLeftOver]; + return function(x3, y2, pass) { + let outerXLeftOver = x3 % imagePasses[pass].x.length; + let outerX = (x3 - outerXLeftOver) / imagePasses[pass].x.length * 8 + imagePasses[pass].x[outerXLeftOver]; let outerYLeftOver = y2 % imagePasses[pass].y.length; let outerY = (y2 - outerYLeftOver) / imagePasses[pass].y.length * 8 + imagePasses[pass].y[outerYLeftOver]; return outerX * 4 + outerY * width * 4; @@ -630183,10 +552749,10 @@ var require_filter_parse = __commonJS((exports, module) => { this._images = []; if (interlace) { let passes = interlaceUtils.getImagePasses(width, height); - for (let i4 = 0;i4 < passes.length; i4++) { + for (let i3 = 0;i3 < passes.length; i3++) { this._images.push({ - byteWidth: getByteWidth(passes[i4].width, bpp, depth), - height: passes[i4].height, + byteWidth: getByteWidth(passes[i3].width, bpp, depth), + height: passes[i3].height, lineIndex: 0 }); } @@ -630211,55 +552777,55 @@ var require_filter_parse = __commonJS((exports, module) => { Filter.prototype._unFilterType1 = function(rawData, unfilteredLine, byteWidth) { let xComparison = this._xComparison; let xBiggerThan = xComparison - 1; - for (let x4 = 0;x4 < byteWidth; x4++) { - let rawByte = rawData[1 + x4]; - let f1Left = x4 > xBiggerThan ? unfilteredLine[x4 - xComparison] : 0; - unfilteredLine[x4] = rawByte + f1Left; + for (let x3 = 0;x3 < byteWidth; x3++) { + let rawByte = rawData[1 + x3]; + let f1Left = x3 > xBiggerThan ? unfilteredLine[x3 - xComparison] : 0; + unfilteredLine[x3] = rawByte + f1Left; } }; Filter.prototype._unFilterType2 = function(rawData, unfilteredLine, byteWidth) { let lastLine = this._lastLine; - for (let x4 = 0;x4 < byteWidth; x4++) { - let rawByte = rawData[1 + x4]; - let f2Up = lastLine ? lastLine[x4] : 0; - unfilteredLine[x4] = rawByte + f2Up; + for (let x3 = 0;x3 < byteWidth; x3++) { + let rawByte = rawData[1 + x3]; + let f2Up = lastLine ? lastLine[x3] : 0; + unfilteredLine[x3] = rawByte + f2Up; } }; Filter.prototype._unFilterType3 = function(rawData, unfilteredLine, byteWidth) { let xComparison = this._xComparison; let xBiggerThan = xComparison - 1; let lastLine = this._lastLine; - for (let x4 = 0;x4 < byteWidth; x4++) { - let rawByte = rawData[1 + x4]; - let f3Up = lastLine ? lastLine[x4] : 0; - let f3Left = x4 > xBiggerThan ? unfilteredLine[x4 - xComparison] : 0; + for (let x3 = 0;x3 < byteWidth; x3++) { + let rawByte = rawData[1 + x3]; + let f3Up = lastLine ? lastLine[x3] : 0; + let f3Left = x3 > xBiggerThan ? unfilteredLine[x3 - xComparison] : 0; let f3Add = Math.floor((f3Left + f3Up) / 2); - unfilteredLine[x4] = rawByte + f3Add; + unfilteredLine[x3] = rawByte + f3Add; } }; Filter.prototype._unFilterType4 = function(rawData, unfilteredLine, byteWidth) { let xComparison = this._xComparison; let xBiggerThan = xComparison - 1; let lastLine = this._lastLine; - for (let x4 = 0;x4 < byteWidth; x4++) { - let rawByte = rawData[1 + x4]; - let f4Up = lastLine ? lastLine[x4] : 0; - let f4Left = x4 > xBiggerThan ? unfilteredLine[x4 - xComparison] : 0; - let f4UpLeft = x4 > xBiggerThan && lastLine ? lastLine[x4 - xComparison] : 0; + for (let x3 = 0;x3 < byteWidth; x3++) { + let rawByte = rawData[1 + x3]; + let f4Up = lastLine ? lastLine[x3] : 0; + let f4Left = x3 > xBiggerThan ? unfilteredLine[x3 - xComparison] : 0; + let f4UpLeft = x3 > xBiggerThan && lastLine ? lastLine[x3 - xComparison] : 0; let f4Add = paethPredictor(f4Left, f4Up, f4UpLeft); - unfilteredLine[x4] = rawByte + f4Add; + unfilteredLine[x3] = rawByte + f4Add; } }; Filter.prototype._reverseFilterLine = function(rawData) { - let filter4 = rawData[0]; + let filter3 = rawData[0]; let unfilteredLine; let currentImage = this._images[this._imageIndex]; let byteWidth = currentImage.byteWidth; - if (filter4 === 0) { + if (filter3 === 0) { unfilteredLine = rawData.slice(1, byteWidth + 1); } else { unfilteredLine = Buffer.alloc(byteWidth); - switch (filter4) { + switch (filter3) { case 1: this._unFilterType1(rawData, unfilteredLine, byteWidth); break; @@ -630273,7 +552839,7 @@ var require_filter_parse = __commonJS((exports, module) => { this._unFilterType4(rawData, unfilteredLine, byteWidth); break; default: - throw new Error("Unrecognised filter type - " + filter4); + throw new Error("Unrecognised filter type - " + filter3); } } this.write(unfilteredLine); @@ -630318,7 +552884,7 @@ var require_filter_parse_async = __commonJS((exports, module) => { }); // node_modules/pngjs/lib/constants.js -var require_constants13 = __commonJS((exports, module) => { +var require_constants11 = __commonJS((exports, module) => { module.exports = { PNG_SIGNATURE: [137, 80, 78, 71, 13, 10, 26, 10], TYPE_IHDR: 1229472850, @@ -630348,8 +552914,8 @@ var require_constants13 = __commonJS((exports, module) => { var require_crc = __commonJS((exports, module) => { var crcTable = []; (function() { - for (let i4 = 0;i4 < 256; i4++) { - let currentCrc = i4; + for (let i3 = 0;i3 < 256; i3++) { + let currentCrc = i3; for (let j = 0;j < 8; j++) { if (currentCrc & 1) { currentCrc = 3988292384 ^ currentCrc >>> 1; @@ -630357,15 +552923,15 @@ var require_crc = __commonJS((exports, module) => { currentCrc = currentCrc >>> 1; } } - crcTable[i4] = currentCrc; + crcTable[i3] = currentCrc; } })(); var CrcCalculator = module.exports = function() { this._crc = -1; }; CrcCalculator.prototype.write = function(data) { - for (let i4 = 0;i4 < data.length; i4++) { - this._crc = crcTable[(this._crc ^ data[i4]) & 255] ^ this._crc >>> 8; + for (let i3 = 0;i3 < data.length; i3++) { + this._crc = crcTable[(this._crc ^ data[i3]) & 255] ^ this._crc >>> 8; } return true; }; @@ -630373,17 +552939,17 @@ var require_crc = __commonJS((exports, module) => { return this._crc ^ -1; }; CrcCalculator.crc32 = function(buf) { - let crc3 = -1; - for (let i4 = 0;i4 < buf.length; i4++) { - crc3 = crcTable[(crc3 ^ buf[i4]) & 255] ^ crc3 >>> 8; + let crc2 = -1; + for (let i3 = 0;i3 < buf.length; i3++) { + crc2 = crcTable[(crc2 ^ buf[i3]) & 255] ^ crc2 >>> 8; } - return crc3 ^ -1; + return crc2 ^ -1; }; }); // node_modules/pngjs/lib/parser.js var require_parser7 = __commonJS((exports, module) => { - var constants5 = require_constants13(); + var constants5 = require_constants11(); var CrcCalculator = require_crc(); var Parser2 = module.exports = function(options2, dependencies) { this._options = options2; @@ -630417,8 +552983,8 @@ var require_parser7 = __commonJS((exports, module) => { }; Parser2.prototype._parseSignature = function(data) { let signature = constants5.PNG_SIGNATURE; - for (let i4 = 0;i4 < signature.length; i4++) { - if (data[i4] !== signature[i4]) { + for (let i3 = 0;i3 < signature.length; i3++) { + if (data[i3] !== signature[i3]) { this.error(new Error("Invalid file signature")); return; } @@ -630429,8 +552995,8 @@ var require_parser7 = __commonJS((exports, module) => { let length = data.readUInt32BE(0); let type = data.readUInt32BE(4); let name = ""; - for (let i4 = 4;i4 < 8; i4++) { - name += String.fromCharCode(data[i4]); + for (let i3 = 4;i3 < 8; i3++) { + name += String.fromCharCode(data[i3]); } let ancillary = Boolean(data[4] & 32); if (!this._hasIHDR && type !== constants5.TYPE_IHDR) { @@ -630475,7 +553041,7 @@ var require_parser7 = __commonJS((exports, module) => { let depth = data[8]; let colorType = data[9]; let compr = data[10]; - let filter4 = data[11]; + let filter3 = data[11]; let interlace = data[12]; if (depth !== 8 && depth !== 4 && depth !== 2 && depth !== 1 && depth !== 16) { this.error(new Error("Unsupported bit depth " + depth)); @@ -630489,7 +553055,7 @@ var require_parser7 = __commonJS((exports, module) => { this.error(new Error("Unsupported compression method")); return; } - if (filter4 !== 0) { + if (filter3 !== 0) { this.error(new Error("Unsupported filter method")); return; } @@ -630519,8 +553085,8 @@ var require_parser7 = __commonJS((exports, module) => { Parser2.prototype._parsePLTE = function(data) { this._crc.write(data); let entries = Math.floor(data.length / 3); - for (let i4 = 0;i4 < entries; i4++) { - this._palette.push([data[i4 * 3], data[i4 * 3 + 1], data[i4 * 3 + 2], 255]); + for (let i3 = 0;i3 < entries; i3++) { + this._palette.push([data[i3 * 3], data[i3 * 3 + 1], data[i3 * 3 + 2], 255]); } this.palette(this._palette); this._handleChunkEnd(); @@ -630540,8 +553106,8 @@ var require_parser7 = __commonJS((exports, module) => { this.error(new Error("More transparent colors than palette size")); return; } - for (let i4 = 0;i4 < data.length; i4++) { - this._palette[i4][3] = data[i4]; + for (let i3 = 0;i3 < data.length; i3++) { + this._palette[i3][3] = data[i3]; } this.palette(this._palette); } @@ -630673,20 +553239,20 @@ var require_bitmapper = __commonJS((exports) => { ]; function bitRetriever(data, depth) { let leftOver = []; - let i4 = 0; - function split3() { - if (i4 === data.length) { + let i3 = 0; + function split2() { + if (i3 === data.length) { throw new Error("Ran out of data"); } - let byte = data[i4]; - i4++; + let byte = data[i3]; + i3++; let byte8, byte7, byte6, byte5, byte4, byte3, byte2, byte1; switch (depth) { default: throw new Error("unrecognised depth"); case 16: - byte2 = data[i4]; - i4++; + byte2 = data[i3]; + i3++; leftOver.push((byte << 8) + byte2); break; case 4: @@ -630717,7 +553283,7 @@ var require_bitmapper = __commonJS((exports) => { return { get: function(count4) { while (leftOver.length < count4) { - split3(); + split2(); } let returner = leftOver.slice(0, count4); leftOver = leftOver.slice(count4); @@ -630727,7 +553293,7 @@ var require_bitmapper = __commonJS((exports) => { leftOver.length = 0; }, end: function() { - if (i4 !== data.length) { + if (i3 !== data.length) { throw new Error("extra data found"); } } @@ -630738,25 +553304,25 @@ var require_bitmapper = __commonJS((exports) => { let imageHeight = image.height; let imagePass = image.index; for (let y2 = 0;y2 < imageHeight; y2++) { - for (let x4 = 0;x4 < imageWidth; x4++) { - let pxPos = getPxPos(x4, y2, imagePass); + for (let x3 = 0;x3 < imageWidth; x3++) { + let pxPos = getPxPos(x3, y2, imagePass); pixelBppMapper[bpp](pxData, data, pxPos, rawPos); rawPos += bpp; } } return rawPos; } - function mapImageCustomBit(image, pxData, getPxPos, bpp, bits3, maxBit) { + function mapImageCustomBit(image, pxData, getPxPos, bpp, bits2, maxBit) { let imageWidth = image.width; let imageHeight = image.height; let imagePass = image.index; for (let y2 = 0;y2 < imageHeight; y2++) { - for (let x4 = 0;x4 < imageWidth; x4++) { - let pixelData = bits3.get(bpp); - let pxPos = getPxPos(x4, y2, imagePass); + for (let x3 = 0;x3 < imageWidth; x3++) { + let pixelData = bits2.get(bpp); + let pxPos = getPxPos(x3, y2, imagePass); pixelBppCustomMapper[bpp](pxData, pixelData, pxPos, maxBit); } - bits3.resetAfterLine(); + bits2.resetAfterLine(); } } exports.dataToBitMap = function(data, bitmapInfo) { @@ -630765,9 +553331,9 @@ var require_bitmapper = __commonJS((exports) => { let depth = bitmapInfo.depth; let bpp = bitmapInfo.bpp; let interlace = bitmapInfo.interlace; - let bits3; + let bits2; if (depth !== 8) { - bits3 = bitRetriever(data, depth); + bits2 = bitRetriever(data, depth); } let pxData; if (depth <= 8) { @@ -630795,7 +553361,7 @@ var require_bitmapper = __commonJS((exports) => { if (depth === 8) { rawPos = mapImage8Bit(images[imageIndex], pxData, getPxPos, bpp, data, rawPos); } else { - mapImageCustomBit(images[imageIndex], pxData, getPxPos, bpp, bits3, maxBit); + mapImageCustomBit(images[imageIndex], pxData, getPxPos, bpp, bits2, maxBit); } } if (depth === 8) { @@ -630803,7 +553369,7 @@ var require_bitmapper = __commonJS((exports) => { throw new Error("extra data found"); } } else { - bits3.end(); + bits2.end(); } return pxData; }; @@ -630814,13 +553380,13 @@ var require_format_normaliser = __commonJS((exports, module) => { function dePalette(indata, outdata, width, height, palette) { let pxPos = 0; for (let y2 = 0;y2 < height; y2++) { - for (let x4 = 0;x4 < width; x4++) { + for (let x3 = 0;x3 < width; x3++) { let color3 = palette[indata[pxPos]]; if (!color3) { throw new Error("index " + indata[pxPos] + " not in palette"); } - for (let i4 = 0;i4 < 4; i4++) { - outdata[pxPos + i4] = color3[i4]; + for (let i3 = 0;i3 < 4; i3++) { + outdata[pxPos + i3] = color3[i3]; } pxPos += 4; } @@ -630829,7 +553395,7 @@ var require_format_normaliser = __commonJS((exports, module) => { function replaceTransparentColor(indata, outdata, width, height, transColor) { let pxPos = 0; for (let y2 = 0;y2 < height; y2++) { - for (let x4 = 0;x4 < width; x4++) { + for (let x3 = 0;x3 < width; x3++) { let makeTrans = false; if (transColor.length === 1) { if (transColor[0] === indata[pxPos]) { @@ -630839,8 +553405,8 @@ var require_format_normaliser = __commonJS((exports, module) => { makeTrans = true; } if (makeTrans) { - for (let i4 = 0;i4 < 4; i4++) { - outdata[pxPos + i4] = 0; + for (let i3 = 0;i3 < 4; i3++) { + outdata[pxPos + i3] = 0; } } pxPos += 4; @@ -630852,9 +553418,9 @@ var require_format_normaliser = __commonJS((exports, module) => { let maxInSample = Math.pow(2, depth) - 1; let pxPos = 0; for (let y2 = 0;y2 < height; y2++) { - for (let x4 = 0;x4 < width; x4++) { - for (let i4 = 0;i4 < 4; i4++) { - outdata[pxPos + i4] = Math.floor(indata[pxPos + i4] * maxOutSample / maxInSample + 0.5); + for (let x3 = 0;x3 < width; x3++) { + for (let i3 = 0;i3 < 4; i3++) { + outdata[pxPos + i3] = Math.floor(indata[pxPos + i3] * maxOutSample / maxInSample + 0.5); } pxPos += 4; } @@ -630913,8 +553479,8 @@ var require_parser_async = __commonJS((exports, module) => { this._parser.start(); }; util7.inherits(ParserAsync, ChunkStream); - ParserAsync.prototype._handleError = function(err3) { - this.emit("error", err3); + ParserAsync.prototype._handleError = function(err2) { + this.emit("error", err2); this.writable = false; this.destroy(); if (this._inflate && this._inflate.destroy) { @@ -630940,23 +553506,23 @@ var require_parser_async = __commonJS((exports, module) => { this._inflate = zlib3.createInflate({ chunkSize }); let leftToInflate = imageSize; let emitError = this.emit.bind(this, "error"); - this._inflate.on("error", function(err3) { + this._inflate.on("error", function(err2) { if (!leftToInflate) { return; } - emitError(err3); + emitError(err2); }); this._filter.on("complete", this._complete.bind(this)); let filterWrite = this._filter.write.bind(this._filter); - this._inflate.on("data", function(chunk3) { + this._inflate.on("data", function(chunk2) { if (!leftToInflate) { return; } - if (chunk3.length > leftToInflate) { - chunk3 = chunk3.slice(0, leftToInflate); + if (chunk2.length > leftToInflate) { + chunk2 = chunk2.slice(0, leftToInflate); } - leftToInflate -= chunk3.length; - filterWrite(chunk3); + leftToInflate -= chunk2.length; + filterWrite(chunk2); }); this._inflate.on("end", this._filter.end.bind(this._filter)); } @@ -631009,7 +553575,7 @@ var require_parser_async = __commonJS((exports, module) => { // node_modules/pngjs/lib/bitpacker.js var require_bitpacker = __commonJS((exports, module) => { - var constants5 = require_constants13(); + var constants5 = require_constants11(); module.exports = function(dataIn, width, height, options2) { let outHasAlpha = [constants5.COLORTYPE_COLOR_ALPHA, constants5.COLORTYPE_ALPHA].indexOf(options2.colorType) !== -1; if (options2.colorType === options2.inputColorType) { @@ -631088,7 +553654,7 @@ var require_bitpacker = __commonJS((exports, module) => { return { red: red2, green: green2, blue: blue2, alpha }; } for (let y2 = 0;y2 < height; y2++) { - for (let x4 = 0;x4 < width; x4++) { + for (let x3 = 0;x3 < width; x3++) { let rgba = getRGBA(data, inIndex); switch (options2.colorType) { case constants5.COLORTYPE_COLOR_ALPHA: @@ -631140,88 +553706,88 @@ var require_bitpacker = __commonJS((exports, module) => { var require_filter_pack = __commonJS((exports, module) => { var paethPredictor = require_paeth_predictor(); function filterNone(pxData, pxPos, byteWidth, rawData, rawPos) { - for (let x4 = 0;x4 < byteWidth; x4++) { - rawData[rawPos + x4] = pxData[pxPos + x4]; + for (let x3 = 0;x3 < byteWidth; x3++) { + rawData[rawPos + x3] = pxData[pxPos + x3]; } } function filterSumNone(pxData, pxPos, byteWidth) { - let sum3 = 0; + let sum2 = 0; let length = pxPos + byteWidth; - for (let i4 = pxPos;i4 < length; i4++) { - sum3 += Math.abs(pxData[i4]); + for (let i3 = pxPos;i3 < length; i3++) { + sum2 += Math.abs(pxData[i3]); } - return sum3; + return sum2; } function filterSub(pxData, pxPos, byteWidth, rawData, rawPos, bpp) { - for (let x4 = 0;x4 < byteWidth; x4++) { - let left = x4 >= bpp ? pxData[pxPos + x4 - bpp] : 0; - let val = pxData[pxPos + x4] - left; - rawData[rawPos + x4] = val; + for (let x3 = 0;x3 < byteWidth; x3++) { + let left = x3 >= bpp ? pxData[pxPos + x3 - bpp] : 0; + let val = pxData[pxPos + x3] - left; + rawData[rawPos + x3] = val; } } function filterSumSub(pxData, pxPos, byteWidth, bpp) { - let sum3 = 0; - for (let x4 = 0;x4 < byteWidth; x4++) { - let left = x4 >= bpp ? pxData[pxPos + x4 - bpp] : 0; - let val = pxData[pxPos + x4] - left; - sum3 += Math.abs(val); + let sum2 = 0; + for (let x3 = 0;x3 < byteWidth; x3++) { + let left = x3 >= bpp ? pxData[pxPos + x3 - bpp] : 0; + let val = pxData[pxPos + x3] - left; + sum2 += Math.abs(val); } - return sum3; + return sum2; } function filterUp(pxData, pxPos, byteWidth, rawData, rawPos) { - for (let x4 = 0;x4 < byteWidth; x4++) { - let up = pxPos > 0 ? pxData[pxPos + x4 - byteWidth] : 0; - let val = pxData[pxPos + x4] - up; - rawData[rawPos + x4] = val; + for (let x3 = 0;x3 < byteWidth; x3++) { + let up = pxPos > 0 ? pxData[pxPos + x3 - byteWidth] : 0; + let val = pxData[pxPos + x3] - up; + rawData[rawPos + x3] = val; } } function filterSumUp(pxData, pxPos, byteWidth) { - let sum3 = 0; + let sum2 = 0; let length = pxPos + byteWidth; - for (let x4 = pxPos;x4 < length; x4++) { - let up = pxPos > 0 ? pxData[x4 - byteWidth] : 0; - let val = pxData[x4] - up; - sum3 += Math.abs(val); + for (let x3 = pxPos;x3 < length; x3++) { + let up = pxPos > 0 ? pxData[x3 - byteWidth] : 0; + let val = pxData[x3] - up; + sum2 += Math.abs(val); } - return sum3; + return sum2; } function filterAvg(pxData, pxPos, byteWidth, rawData, rawPos, bpp) { - for (let x4 = 0;x4 < byteWidth; x4++) { - let left = x4 >= bpp ? pxData[pxPos + x4 - bpp] : 0; - let up = pxPos > 0 ? pxData[pxPos + x4 - byteWidth] : 0; - let val = pxData[pxPos + x4] - (left + up >> 1); - rawData[rawPos + x4] = val; + for (let x3 = 0;x3 < byteWidth; x3++) { + let left = x3 >= bpp ? pxData[pxPos + x3 - bpp] : 0; + let up = pxPos > 0 ? pxData[pxPos + x3 - byteWidth] : 0; + let val = pxData[pxPos + x3] - (left + up >> 1); + rawData[rawPos + x3] = val; } } function filterSumAvg(pxData, pxPos, byteWidth, bpp) { - let sum3 = 0; - for (let x4 = 0;x4 < byteWidth; x4++) { - let left = x4 >= bpp ? pxData[pxPos + x4 - bpp] : 0; - let up = pxPos > 0 ? pxData[pxPos + x4 - byteWidth] : 0; - let val = pxData[pxPos + x4] - (left + up >> 1); - sum3 += Math.abs(val); + let sum2 = 0; + for (let x3 = 0;x3 < byteWidth; x3++) { + let left = x3 >= bpp ? pxData[pxPos + x3 - bpp] : 0; + let up = pxPos > 0 ? pxData[pxPos + x3 - byteWidth] : 0; + let val = pxData[pxPos + x3] - (left + up >> 1); + sum2 += Math.abs(val); } - return sum3; + return sum2; } function filterPaeth(pxData, pxPos, byteWidth, rawData, rawPos, bpp) { - for (let x4 = 0;x4 < byteWidth; x4++) { - let left = x4 >= bpp ? pxData[pxPos + x4 - bpp] : 0; - let up = pxPos > 0 ? pxData[pxPos + x4 - byteWidth] : 0; - let upleft = pxPos > 0 && x4 >= bpp ? pxData[pxPos + x4 - (byteWidth + bpp)] : 0; - let val = pxData[pxPos + x4] - paethPredictor(left, up, upleft); - rawData[rawPos + x4] = val; + for (let x3 = 0;x3 < byteWidth; x3++) { + let left = x3 >= bpp ? pxData[pxPos + x3 - bpp] : 0; + let up = pxPos > 0 ? pxData[pxPos + x3 - byteWidth] : 0; + let upleft = pxPos > 0 && x3 >= bpp ? pxData[pxPos + x3 - (byteWidth + bpp)] : 0; + let val = pxData[pxPos + x3] - paethPredictor(left, up, upleft); + rawData[rawPos + x3] = val; } } function filterSumPaeth(pxData, pxPos, byteWidth, bpp) { - let sum3 = 0; - for (let x4 = 0;x4 < byteWidth; x4++) { - let left = x4 >= bpp ? pxData[pxPos + x4 - bpp] : 0; - let up = pxPos > 0 ? pxData[pxPos + x4 - byteWidth] : 0; - let upleft = pxPos > 0 && x4 >= bpp ? pxData[pxPos + x4 - (byteWidth + bpp)] : 0; - let val = pxData[pxPos + x4] - paethPredictor(left, up, upleft); - sum3 += Math.abs(val); + let sum2 = 0; + for (let x3 = 0;x3 < byteWidth; x3++) { + let left = x3 >= bpp ? pxData[pxPos + x3 - bpp] : 0; + let up = pxPos > 0 ? pxData[pxPos + x3 - byteWidth] : 0; + let upleft = pxPos > 0 && x3 >= bpp ? pxData[pxPos + x3 - (byteWidth + bpp)] : 0; + let val = pxData[pxPos + x3] - paethPredictor(left, up, upleft); + sum2 += Math.abs(val); } - return sum3; + return sum2; } var filters = { 0: filterNone, @@ -631256,12 +553822,12 @@ var require_filter_pack = __commonJS((exports, module) => { let sel = filterTypes[0]; for (let y2 = 0;y2 < height; y2++) { if (filterTypes.length > 1) { - let min3 = Infinity; - for (let i4 = 0;i4 < filterTypes.length; i4++) { - let sum3 = filterSums[filterTypes[i4]](pxData, pxPos, byteWidth, bpp); - if (sum3 < min3) { - sel = filterTypes[i4]; - min3 = sum3; + let min2 = Infinity; + for (let i3 = 0;i3 < filterTypes.length; i3++) { + let sum2 = filterSums[filterTypes[i3]](pxData, pxPos, byteWidth, bpp); + if (sum2 < min2) { + sel = filterTypes[i3]; + min2 = sum2; } } } @@ -631277,10 +553843,10 @@ var require_filter_pack = __commonJS((exports, module) => { // node_modules/pngjs/lib/packer.js var require_packer = __commonJS((exports, module) => { - var constants5 = require_constants13(); + var constants5 = require_constants11(); var CrcStream = require_crc(); var bitPacker = require_bitpacker(); - var filter4 = require_filter_pack(); + var filter3 = require_filter_pack(); var zlib3 = __require("zlib"); var Packer = module.exports = function(options2) { this._options = options2; @@ -631325,7 +553891,7 @@ var require_packer = __commonJS((exports, module) => { Packer.prototype.filterData = function(data, width, height) { let packedData = bitPacker(data, width, height, this._options); let bpp = constants5.COLORTYPE_TO_BPP_MAP[this._options.colorType]; - let filteredData = filter4(packedData, width, height, this._options, bpp); + let filteredData = filter3(packedData, width, height, this._options, bpp); return filteredData; }; Packer.prototype._packChunk = function(type, data) { @@ -631366,17 +553932,17 @@ var require_packer = __commonJS((exports, module) => { // node_modules/pngjs/lib/packer-async.js var require_packer_async = __commonJS((exports, module) => { var util7 = __require("util"); - var Stream6 = __require("stream"); - var constants5 = require_constants13(); + var Stream4 = __require("stream"); + var constants5 = require_constants11(); var Packer = require_packer(); var PackerAsync = module.exports = function(opt) { - Stream6.call(this); + Stream4.call(this); let options2 = opt || {}; this._packer = new Packer(options2); this._deflate = this._packer.createDeflate(); this.readable = true; }; - util7.inherits(PackerAsync, Stream6); + util7.inherits(PackerAsync, Stream4); PackerAsync.prototype.pack = function(data, width, height, gamma) { this.emit("data", Buffer.from(constants5.PNG_SIGNATURE)); this.emit("data", this._packer.packIHDR(width, height)); @@ -631398,7 +553964,7 @@ var require_packer_async = __commonJS((exports, module) => { // node_modules/pngjs/lib/sync-inflate.js var require_sync_inflate = __commonJS((exports, module) => { - var assert4 = __require("assert").ok; + var assert3 = __require("assert").ok; var zlib3 = __require("zlib"); var util7 = __require("util"); var kMaxLength = __require("buffer").kMaxLength; @@ -631429,27 +553995,27 @@ var require_sync_inflate = __commonJS((exports, module) => { engine._handle.close(); engine._handle = null; } - Inflate2.prototype._processChunk = function(chunk3, flushFlag, asyncCb) { + Inflate2.prototype._processChunk = function(chunk2, flushFlag, asyncCb) { if (typeof asyncCb === "function") { - return zlib3.Inflate._processChunk.call(this, chunk3, flushFlag, asyncCb); + return zlib3.Inflate._processChunk.call(this, chunk2, flushFlag, asyncCb); } let self2 = this; - let availInBefore = chunk3 && chunk3.length; + let availInBefore = chunk2 && chunk2.length; let availOutBefore = this._chunkSize - this._offset; let leftToInflate = this._maxLength; let inOff = 0; let buffers = []; let nread = 0; - let error46; - this.on("error", function(err3) { - error46 = err3; + let error42; + this.on("error", function(err2) { + error42 = err2; }); function handleChunk(availInAfter, availOutAfter) { if (self2._hadError) { return; } let have = availOutBefore - availOutAfter; - assert4(have >= 0, "have should not go down"); + assert3(have >= 0, "have should not go down"); if (have > 0) { let out = self2._buffer.slice(self2._offset, self2._offset + have); self2._offset += have; @@ -631475,14 +554041,14 @@ var require_sync_inflate = __commonJS((exports, module) => { } return false; } - assert4(this._handle, "zlib binding closed"); + assert3(this._handle, "zlib binding closed"); let res; do { - res = this._handle.writeSync(flushFlag, chunk3, inOff, availInBefore, this._buffer, this._offset, availOutBefore); + res = this._handle.writeSync(flushFlag, chunk2, inOff, availInBefore, this._buffer, this._offset, availOutBefore); res = res || this._writeState; } while (!this._hadError && handleChunk(res[0], res[1])); if (this._hadError) { - throw error46; + throw error42; } if (nread >= kMaxLength) { _close(this); @@ -631506,13 +554072,13 @@ var require_sync_inflate = __commonJS((exports, module) => { } return engine._processChunk(buffer, flushFlag); } - function inflateSync3(buffer, opts) { + function inflateSync2(buffer, opts) { return zlibBufferSync(new Inflate2(opts), buffer); } - module.exports = exports = inflateSync3; + module.exports = exports = inflateSync2; exports.Inflate = Inflate2; exports.createInflate = createInflate; - exports.inflateSync = inflateSync3; + exports.inflateSync = inflateSync2; }); // node_modules/pngjs/lib/sync-reader.js @@ -631556,14 +554122,14 @@ var require_filter_parse_sync = __commonJS((exports) => { exports.process = function(inBuffer, bitmapInfo) { let outBuffers = []; let reader = new SyncReader(inBuffer); - let filter4 = new Filter(bitmapInfo, { + let filter3 = new Filter(bitmapInfo, { read: reader.read.bind(reader), write: function(bufferPart) { outBuffers.push(bufferPart); }, complete: function() {} }); - filter4.start(); + filter3.start(); reader.process(); return Buffer.concat(outBuffers); }; @@ -631573,7 +554139,7 @@ var require_filter_parse_sync = __commonJS((exports) => { var require_parser_sync = __commonJS((exports, module) => { var hasSyncZlib = true; var zlib3 = __require("zlib"); - var inflateSync3 = require_sync_inflate(); + var inflateSync2 = require_sync_inflate(); if (!zlib3.deflateSync) { hasSyncZlib = false; } @@ -631586,9 +554152,9 @@ var require_parser_sync = __commonJS((exports, module) => { if (!hasSyncZlib) { throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0"); } - let err3; + let err2; function handleError(_err_) { - err3 = _err_; + err2 = _err_; } let metaData; function handleMetaData(_metaData_) { @@ -631624,8 +554190,8 @@ var require_parser_sync = __commonJS((exports, module) => { }); parser2.start(); reader.process(); - if (err3) { - throw err3; + if (err2) { + throw err2; } let inflateData = Buffer.concat(inflateDataList); inflateDataList.length = 0; @@ -631635,7 +554201,7 @@ var require_parser_sync = __commonJS((exports, module) => { } else { let rowSize = (metaData.width * metaData.bpp * metaData.depth + 7 >> 3) + 1; let imageSize = rowSize * metaData.height; - inflatedData = inflateSync3(inflateData, { + inflatedData = inflateSync2(inflateData, { chunkSize: imageSize, maxLength: imageSize }); @@ -631662,7 +554228,7 @@ var require_packer_sync = __commonJS((exports, module) => { if (!zlib3.deflateSync) { hasSyncZlib = false; } - var constants5 = require_constants13(); + var constants5 = require_constants11(); var Packer = require_packer(); module.exports = function(metaData, opt) { if (!hasSyncZlib) { @@ -631691,24 +554257,24 @@ var require_packer_sync = __commonJS((exports, module) => { // node_modules/pngjs/lib/png-sync.js var require_png_sync = __commonJS((exports) => { var parse18 = require_parser_sync(); - var pack2 = require_packer_sync(); + var pack = require_packer_sync(); exports.read = function(buffer, options2) { return parse18(buffer, options2 || {}); }; exports.write = function(png, options2) { - return pack2(png, options2); + return pack(png, options2); }; }); // node_modules/pngjs/lib/png.js var require_png = __commonJS((exports) => { var util7 = __require("util"); - var Stream6 = __require("stream"); + var Stream4 = __require("stream"); var Parser2 = require_parser_async(); var Packer = require_packer_async(); var PNGSync = require_png_sync(); var PNG = exports.PNG = function(options2) { - Stream6.call(this); + Stream4.call(this); options2 = options2 || {}; this.width = options2.width | 0; this.height = options2.height | 0; @@ -631733,7 +554299,7 @@ var require_png = __commonJS((exports) => { this._parser.on("close", this._handleClose.bind(this)); this._packer.on("error", this.emit.bind(this, "error")); }; - util7.inherits(PNG, Stream6); + util7.inherits(PNG, Stream4); PNG.sync = PNGSync; PNG.prototype.pack = function() { if (!this.data || !this.data.length) { @@ -631753,9 +554319,9 @@ var require_png = __commonJS((exports) => { this.data = parsedData; callback(null, this); }.bind(this); - onError = function(err3) { + onError = function(err2) { this.removeListener("parsed", onParsed); - callback(err3, null); + callback(err2, null); }.bind(this); this.once("parsed", onParsed); this.once("error", onError); @@ -631807,12 +554373,12 @@ var require_png = __commonJS((exports) => { PNG.adjustGamma = function(src) { if (src.gamma) { for (let y2 = 0;y2 < src.height; y2++) { - for (let x4 = 0;x4 < src.width; x4++) { - let idx = src.width * y2 + x4 << 2; - for (let i4 = 0;i4 < 3; i4++) { - let sample3 = src.data[idx + i4] / 255; - sample3 = Math.pow(sample3, 1 / 2.2 / src.gamma); - src.data[idx + i4] = Math.round(sample3 * 255); + for (let x3 = 0;x3 < src.width; x3++) { + let idx = src.width * y2 + x3 << 2; + for (let i3 = 0;i3 < 3; i3++) { + let sample2 = src.data[idx + i3] / 255; + sample2 = Math.pow(sample2, 1 / 2.2 / src.gamma); + src.data[idx + i3] = Math.round(sample2 * 255); } } } @@ -631825,7 +554391,7 @@ var require_png = __commonJS((exports) => { }); // node_modules/qrcode/lib/renderer/utils.js -var require_utils20 = __commonJS((exports) => { +var require_utils19 = __commonJS((exports) => { function hex2rgba(hex) { if (typeof hex === "number") { hex = hex.toString(); @@ -631881,20 +554447,20 @@ var require_utils20 = __commonJS((exports) => { return Math.floor((qrSize + opts.margin * 2) * scale); }; exports.qrToImageData = function qrToImageData(imgData, qr, opts) { - const size3 = qr.modules.size; + const size2 = qr.modules.size; const data = qr.modules.data; - const scale = exports.getScale(size3, opts); - const symbolSize = Math.floor((size3 + opts.margin * 2) * scale); + const scale = exports.getScale(size2, opts); + const symbolSize = Math.floor((size2 + opts.margin * 2) * scale); const scaledMargin = opts.margin * scale; const palette = [opts.color.light, opts.color.dark]; - for (let i4 = 0;i4 < symbolSize; i4++) { + for (let i3 = 0;i3 < symbolSize; i3++) { for (let j = 0;j < symbolSize; j++) { - let posDst = (i4 * symbolSize + j) * 4; + let posDst = (i3 * symbolSize + j) * 4; let pxColor = opts.color.light; - if (i4 >= scaledMargin && j >= scaledMargin && i4 < symbolSize - scaledMargin && j < symbolSize - scaledMargin) { - const iSrc = Math.floor((i4 - scaledMargin) / scale); + if (i3 >= scaledMargin && j >= scaledMargin && i3 < symbolSize - scaledMargin && j < symbolSize - scaledMargin) { + const iSrc = Math.floor((i3 - scaledMargin) / scale); const jSrc = Math.floor((j - scaledMargin) / scale); - pxColor = palette[data[iSrc * size3 + jSrc] ? 1 : 0]; + pxColor = palette[data[iSrc * size2 + jSrc] ? 1 : 0]; } imgData[posDst++] = pxColor.r; imgData[posDst++] = pxColor.g; @@ -631907,15 +554473,15 @@ var require_utils20 = __commonJS((exports) => { // node_modules/qrcode/lib/renderer/png.js var require_png2 = __commonJS((exports) => { - var fs12 = __require("fs"); + var fs6 = __require("fs"); var PNG = require_png().PNG; - var Utils = require_utils20(); + var Utils = require_utils19(); exports.render = function render(qrData, options2) { const opts = Utils.getOptions(options2); const pngOpts = opts.rendererOpts; - const size3 = Utils.getImageWidth(qrData.modules.size, opts); - pngOpts.width = size3; - pngOpts.height = size3; + const size2 = Utils.getImageWidth(qrData.modules.size, opts); + pngOpts.width = size2; + pngOpts.height = size2; const pngImage = new PNG(pngOpts); Utils.qrToImageData(pngImage.data, qrData, opts); return pngImage; @@ -631925,9 +554491,9 @@ var require_png2 = __commonJS((exports) => { cb = options2; options2 = undefined; } - exports.renderToBuffer(qrData, options2, function(err3, output) { - if (err3) - cb(err3); + exports.renderToBuffer(qrData, options2, function(err2, output) { + if (err2) + cb(err2); let url3 = "data:image/png;base64,"; url3 += output.toString("base64"); cb(null, url3); @@ -631949,7 +554515,7 @@ var require_png2 = __commonJS((exports) => { }); png.pack(); }; - exports.renderToFile = function renderToFile(path26, qrData, options2, cb) { + exports.renderToFile = function renderToFile(path21, qrData, options2, cb) { if (typeof cb === "undefined") { cb = options2; options2 = undefined; @@ -631961,7 +554527,7 @@ var require_png2 = __commonJS((exports) => { called = true; cb.apply(null, args); }; - const stream4 = fs12.createWriteStream(path26); + const stream4 = fs6.createWriteStream(path21); stream4.on("error", done); stream4.on("close", done); exports.renderToFileStream(stream4, qrData, options2); @@ -631974,7 +554540,7 @@ var require_png2 = __commonJS((exports) => { // node_modules/qrcode/lib/renderer/utf8.js var require_utf82 = __commonJS((exports) => { - var Utils = require_utils20(); + var Utils = require_utils19(); var BLOCK_CHAR = { WW: " ", WB: "▄", @@ -632002,19 +554568,19 @@ var require_utf82 = __commonJS((exports) => { if (opts.color.dark.hex === "#ffffff" || opts.color.light.hex === "#000000") { blocks = INVERTED_BLOCK_CHAR; } - const size3 = qrData.modules.size; + const size2 = qrData.modules.size; const data = qrData.modules.data; let output = ""; - let hMargin = Array(size3 + opts.margin * 2 + 1).join(blocks.WW); + let hMargin = Array(size2 + opts.margin * 2 + 1).join(blocks.WW); hMargin = Array(opts.margin / 2 + 1).join(hMargin + ` `); const vMargin = Array(opts.margin + 1).join(blocks.WW); output += hMargin; - for (let i4 = 0;i4 < size3; i4 += 2) { + for (let i3 = 0;i3 < size2; i3 += 2) { output += vMargin; - for (let j = 0;j < size3; j++) { - const topModule = data[i4 * size3 + j]; - const bottomModule = data[(i4 + 1) * size3 + j]; + for (let j = 0;j < size2; j++) { + const topModule = data[i3 * size2 + j]; + const bottomModule = data[(i3 + 1) * size2 + j]; output += getBlockChar(topModule, bottomModule, blocks); } output += vMargin + ` @@ -632026,33 +554592,33 @@ var require_utf82 = __commonJS((exports) => { } return output; }; - exports.renderToFile = function renderToFile(path26, qrData, options2, cb) { + exports.renderToFile = function renderToFile(path21, qrData, options2, cb) { if (typeof cb === "undefined") { cb = options2; options2 = undefined; } - const fs12 = __require("fs"); + const fs6 = __require("fs"); const utf8 = exports.render(qrData, options2); - fs12.writeFile(path26, utf8, cb); + fs6.writeFile(path21, utf8, cb); }; }); // node_modules/qrcode/lib/renderer/terminal/terminal.js var require_terminal = __commonJS((exports) => { exports.render = function(qrData, options2, cb) { - const size3 = qrData.modules.size; + const size2 = qrData.modules.size; const data = qrData.modules.data; const black2 = "\x1B[40m \x1B[0m"; const white2 = "\x1B[47m \x1B[0m"; let output = ""; - const hMargin = Array(size3 + 3).join(white2); + const hMargin = Array(size2 + 3).join(white2); const vMargin = Array(2).join(white2); output += hMargin + ` `; - for (let i4 = 0;i4 < size3; ++i4) { + for (let i3 = 0;i3 < size2; ++i3) { output += white2; - for (let j = 0;j < size3; j++) { - output += data[i4 * size3 + j] ? black2 : white2; + for (let j = 0;j < size2; j++) { + output += data[i3 * size2 + j] ? black2 : white2; } output += vMargin + ` `; @@ -632072,52 +554638,52 @@ var require_terminal_small = __commonJS((exports) => { var backgroundBlack = "\x1B[40m"; var foregroundWhite = "\x1B[37m"; var foregroundBlack = "\x1B[30m"; - var reset4 = "\x1B[0m"; + var reset3 = "\x1B[0m"; var lineSetupNormal = backgroundWhite + foregroundBlack; var lineSetupInverse = backgroundBlack + foregroundWhite; var createPalette = function(lineSetup, foregroundWhite2, foregroundBlack2) { return { - "00": reset4 + " " + lineSetup, - "01": reset4 + foregroundWhite2 + "▄" + lineSetup, - "02": reset4 + foregroundBlack2 + "▄" + lineSetup, - 10: reset4 + foregroundWhite2 + "▀" + lineSetup, + "00": reset3 + " " + lineSetup, + "01": reset3 + foregroundWhite2 + "▄" + lineSetup, + "02": reset3 + foregroundBlack2 + "▄" + lineSetup, + 10: reset3 + foregroundWhite2 + "▀" + lineSetup, 11: " ", 12: "▄", - 20: reset4 + foregroundBlack2 + "▀" + lineSetup, + 20: reset3 + foregroundBlack2 + "▀" + lineSetup, 21: "▀", 22: "█" }; }; - var mkCodePixel = function(modules, size3, x4, y2) { - const sizePlus = size3 + 1; - if (x4 >= sizePlus || y2 >= sizePlus || y2 < -1 || x4 < -1) + var mkCodePixel = function(modules, size2, x3, y2) { + const sizePlus = size2 + 1; + if (x3 >= sizePlus || y2 >= sizePlus || y2 < -1 || x3 < -1) return "0"; - if (x4 >= size3 || y2 >= size3 || y2 < 0 || x4 < 0) + if (x3 >= size2 || y2 >= size2 || y2 < 0 || x3 < 0) return "1"; - const idx = y2 * size3 + x4; + const idx = y2 * size2 + x3; return modules[idx] ? "2" : "1"; }; - var mkCode = function(modules, size3, x4, y2) { - return mkCodePixel(modules, size3, x4, y2) + mkCodePixel(modules, size3, x4, y2 + 1); + var mkCode = function(modules, size2, x3, y2) { + return mkCodePixel(modules, size2, x3, y2) + mkCodePixel(modules, size2, x3, y2 + 1); }; exports.render = function(qrData, options2, cb) { - const size3 = qrData.modules.size; + const size2 = qrData.modules.size; const data = qrData.modules.data; const inverse2 = !!(options2 && options2.inverse); const lineSetup = options2 && options2.inverse ? lineSetupInverse : lineSetupNormal; const white2 = inverse2 ? foregroundBlack : foregroundWhite; const black2 = inverse2 ? foregroundWhite : foregroundBlack; const palette = createPalette(lineSetup, white2, black2); - const newLine = reset4 + ` + const newLine = reset3 + ` ` + lineSetup; let output = lineSetup; - for (let y2 = -1;y2 < size3 + 1; y2 += 2) { - for (let x4 = -1;x4 < size3; x4++) { - output += palette[mkCode(data, size3, x4, y2)]; + for (let y2 = -1;y2 < size2 + 1; y2 += 2) { + for (let x3 = -1;x3 < size2; x3++) { + output += palette[mkCode(data, size2, x3, y2)]; } - output += palette[mkCode(data, size3, size3, y2)] + newLine; + output += palette[mkCode(data, size2, size2, y2)] + newLine; } - output += reset4; + output += reset3; if (typeof cb === "function") { cb(null, output); } @@ -632139,55 +554705,55 @@ var require_terminal2 = __commonJS((exports) => { // node_modules/qrcode/lib/renderer/svg-tag.js var require_svg_tag = __commonJS((exports) => { - var Utils = require_utils20(); + var Utils = require_utils19(); function getColorAttrib(color3, attrib) { const alpha = color3.a / 255; const str2 = attrib + '="' + color3.hex + '"'; return alpha < 1 ? str2 + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str2; } - function svgCmd(cmd, x4, y2) { - let str2 = cmd + x4; + function svgCmd(cmd, x3, y2) { + let str2 = cmd + x3; if (typeof y2 !== "undefined") str2 += " " + y2; return str2; } - function qrToPath(data, size3, margin) { - let path26 = ""; + function qrToPath(data, size2, margin) { + let path21 = ""; let moveBy = 0; let newRow = false; let lineLength = 0; - for (let i4 = 0;i4 < data.length; i4++) { - const col = Math.floor(i4 % size3); - const row = Math.floor(i4 / size3); + for (let i3 = 0;i3 < data.length; i3++) { + const col = Math.floor(i3 % size2); + const row = Math.floor(i3 / size2); if (!col && !newRow) newRow = true; - if (data[i4]) { + if (data[i3]) { lineLength++; - if (!(i4 > 0 && col > 0 && data[i4 - 1])) { - path26 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0); + if (!(i3 > 0 && col > 0 && data[i3 - 1])) { + path21 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0); moveBy = 0; newRow = false; } - if (!(col + 1 < size3 && data[i4 + 1])) { - path26 += svgCmd("h", lineLength); + if (!(col + 1 < size2 && data[i3 + 1])) { + path21 += svgCmd("h", lineLength); lineLength = 0; } } else { moveBy++; } } - return path26; + return path21; } exports.render = function render(qrData, options2, cb) { const opts = Utils.getOptions(options2); - const size3 = qrData.modules.size; + const size2 = qrData.modules.size; const data = qrData.modules.data; - const qrcodesize = size3 + opts.margin * 2; + const qrcodesize = size2 + opts.margin * 2; const bg = !opts.color.light.a ? "" : "'; - const path26 = "'; + const path21 = "'; const viewBox = 'viewBox="' + "0 0 " + qrcodesize + " " + qrcodesize + '"'; const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" '; - const svgTag = '' + bg + path26 + ` + const svgTag = '' + bg + path21 + ` `; if (typeof cb === "function") { cb(null, svgTag); @@ -632200,29 +554766,29 @@ var require_svg_tag = __commonJS((exports) => { var require_svg2 = __commonJS((exports) => { var svgTagRenderer = require_svg_tag(); exports.render = svgTagRenderer.render; - exports.renderToFile = function renderToFile(path26, qrData, options2, cb) { + exports.renderToFile = function renderToFile(path21, qrData, options2, cb) { if (typeof cb === "undefined") { cb = options2; options2 = undefined; } - const fs12 = __require("fs"); + const fs6 = __require("fs"); const svgTag = exports.render(qrData, options2); const xmlStr = '' + '' + svgTag; - fs12.writeFile(path26, xmlStr, cb); + fs6.writeFile(path21, xmlStr, cb); }; }); // node_modules/qrcode/lib/renderer/canvas.js var require_canvas = __commonJS((exports) => { - var Utils = require_utils20(); - function clearCanvas(ctx, canvas, size3) { + var Utils = require_utils19(); + function clearCanvas(ctx, canvas, size2) { ctx.clearRect(0, 0, canvas.width, canvas.height); if (!canvas.style) canvas.style = {}; - canvas.height = size3; - canvas.width = size3; - canvas.style.height = size3 + "px"; - canvas.style.width = size3 + "px"; + canvas.height = size2; + canvas.width = size2; + canvas.style.height = size2 + "px"; + canvas.style.width = size2 + "px"; } function getCanvasElement() { try { @@ -632242,11 +554808,11 @@ var require_canvas = __commonJS((exports) => { canvasEl = getCanvasElement(); } opts = Utils.getOptions(opts); - const size3 = Utils.getImageWidth(qrData.modules.size, opts); + const size2 = Utils.getImageWidth(qrData.modules.size, opts); const ctx = canvasEl.getContext("2d"); - const image = ctx.createImageData(size3, size3); + const image = ctx.createImageData(size2, size2); Utils.qrToImageData(image.data, qrData, opts); - clearCanvas(ctx, canvasEl, size3); + clearCanvas(ctx, canvasEl, size2); ctx.putImageData(image, 0, 0); return canvasEl; }; @@ -632266,12 +554832,12 @@ var require_canvas = __commonJS((exports) => { }); // node_modules/qrcode/lib/browser.js -var require_browser3 = __commonJS((exports) => { +var require_browser2 = __commonJS((exports) => { var canPromise = require_can_promise(); var QRCode = require_qrcode(); var CanvasRenderer = require_canvas(); var SvgRenderer = require_svg_tag(); - function renderCanvas(renderFunc, canvas, text2, opts, cb) { + function renderCanvas(renderFunc, canvas, text, opts, cb) { const args = [].slice.call(arguments, 1); const argsNum = args.length; const isLastArgCb = typeof args[argsNum - 1] === "function"; @@ -632283,8 +554849,8 @@ var require_browser3 = __commonJS((exports) => { throw new Error("Too few arguments provided"); } if (argsNum === 2) { - cb = text2; - text2 = canvas; + cb = text; + text = canvas; canvas = opts = undefined; } else if (argsNum === 3) { if (canvas.getContext && typeof cb === "undefined") { @@ -632292,8 +554858,8 @@ var require_browser3 = __commonJS((exports) => { opts = undefined; } else { cb = opts; - opts = text2; - text2 = canvas; + opts = text; + text = canvas; canvas = undefined; } } @@ -632302,24 +554868,24 @@ var require_browser3 = __commonJS((exports) => { throw new Error("Too few arguments provided"); } if (argsNum === 1) { - text2 = canvas; + text = canvas; canvas = opts = undefined; } else if (argsNum === 2 && !canvas.getContext) { - opts = text2; - text2 = canvas; + opts = text; + text = canvas; canvas = undefined; } - return new Promise(function(resolve45, reject3) { + return new Promise(function(resolve39, reject2) { try { - const data = QRCode.create(text2, opts); - resolve45(renderFunc(data, canvas, opts)); + const data = QRCode.create(text, opts); + resolve39(renderFunc(data, canvas, opts)); } catch (e) { - reject3(e); + reject2(e); } }); } try { - const data = QRCode.create(text2, opts); + const data = QRCode.create(text, opts); cb(null, renderFunc(data, canvas, opts)); } catch (e) { cb(e); @@ -632334,8 +554900,8 @@ var require_browser3 = __commonJS((exports) => { }); // node_modules/qrcode/lib/server.js -function checkParams(text2, opts, cb) { - if (typeof text2 === "undefined") { +function checkParams(text, opts, cb) { + if (typeof text === "undefined") { throw new Error("String required as first argument"); } if (typeof cb === "undefined") { @@ -632366,31 +554932,31 @@ function getStringRendererFromType(type) { return Utf8Renderer; } } -function render2(renderFunc, text2, params) { +function render2(renderFunc, text, params) { if (!params.cb) { - return new Promise(function(resolve45, reject3) { + return new Promise(function(resolve39, reject2) { try { - const data = QRCode.create(text2, params.opts); - return renderFunc(data, params.opts, function(err3, data2) { - return err3 ? reject3(err3) : resolve45(data2); + const data = QRCode.create(text, params.opts); + return renderFunc(data, params.opts, function(err2, data2) { + return err2 ? reject2(err2) : resolve39(data2); }); } catch (e) { - reject3(e); + reject2(e); } }); } try { - const data = QRCode.create(text2, params.opts); + const data = QRCode.create(text, params.opts); return renderFunc(data, params.opts, params.cb); } catch (e) { params.cb(e); } } -var canPromise, QRCode, PngRenderer, Utf8Renderer, TerminalRenderer, SvgRenderer, $create, $toCanvas, $toString = function toString7(text2, opts, cb) { - const params = checkParams(text2, opts, cb); +var canPromise, QRCode, PngRenderer, Utf8Renderer, TerminalRenderer, SvgRenderer, $create, $toCanvas, $toString = function toString6(text, opts, cb) { + const params = checkParams(text, opts, cb); const type = params.opts ? params.opts.type : undefined; const renderer = getStringRendererFromType(type); - return render2(renderer.render, text2, params); + return render2(renderer.render, text, params); }; var init_server3 = __esm(() => { canPromise = require_can_promise(); @@ -632400,7 +554966,7 @@ var init_server3 = __esm(() => { TerminalRenderer = require_terminal2(); SvgRenderer = require_svg2(); $create = QRCode.create; - $toCanvas = require_browser3().toCanvas; + $toCanvas = require_browser2().toCanvas; }); // src/commands/mobile/mobile.tsx @@ -632413,7 +554979,7 @@ function MobileQRCode(t0) { const { onDone } = t0; - const [platform6, setPlatform] = import_react143.useState("ios"); + const [platform5, setPlatform] = import_react143.useState("ios"); let t1; if ($2[0] === Symbol.for("react.memo_cache_sentinel")) { t1 = { @@ -632427,8 +554993,8 @@ function MobileQRCode(t0) { const [qrCodes, setQrCodes] = import_react143.useState(t1); const { url: url3 - } = PLATFORMS[platform6]; - const qrCode = qrCodes[platform6]; + } = PLATFORMS[platform5]; + const qrCode = qrCodes[platform5]; let t2; let t3; if ($2[1] === Symbol.for("react.memo_cache_sentinel")) { @@ -632565,8 +555131,8 @@ function MobileQRCode(t0) { t14 = $2[21]; t15 = $2[22]; } - const t16 = platform6 === "ios"; - const t17 = platform6 === "ios"; + const t16 = platform5 === "ios"; + const t17 = platform5 === "ios"; let t18; if ($2[23] !== t16 || $2[24] !== t17) { t18 = /* @__PURE__ */ jsx_dev_runtime251.jsxDEV(ThemedText, { @@ -632590,8 +555156,8 @@ function MobileQRCode(t0) { } else { t19 = $2[26]; } - const t20 = platform6 === "android"; - const t21 = platform6 === "android"; + const t20 = platform5 === "android"; + const t21 = platform5 === "android"; let t22; if ($2[27] !== t20 || $2[28] !== t21) { t22 = /* @__PURE__ */ jsx_dev_runtime251.jsxDEV(ThemedText, { @@ -632700,10 +555266,10 @@ function MobileQRCode(t0) { } return t28; } -function _temp425(line_0, i4) { +function _temp425(line_0, i3) { return /* @__PURE__ */ jsx_dev_runtime251.jsxDEV(ThemedText, { children: line_0 - }, i4, false, undefined, this); + }, i3, false, undefined, this); } function _temp329(line) { return line.length > 0; @@ -632851,25 +555417,25 @@ ${args ? "Additional user input: " + args : ""} }); // src/utils/releaseNotes.ts -import { mkdir as mkdir41, readFile as readFile49, writeFile as writeFile46 } from "fs/promises"; -import { dirname as dirname58, join as join137 } from "path"; +import { mkdir as mkdir41, readFile as readFile48, writeFile as writeFile44 } from "fs/promises"; +import { dirname as dirname54, join as join127 } from "path"; function getChangelogCachePath() { - return join137(getClaudeConfigHomeDir(), "cache", "changelog.md"); + return join127(getClaudeConfigHomeDir(), "cache", "changelog.md"); } async function migrateChangelogFromConfig() { - const config6 = getGlobalConfig(); - if (!config6.cachedChangelog) { + const config4 = getGlobalConfig(); + if (!config4.cachedChangelog) { return; } const cachePath = getChangelogCachePath(); try { - await mkdir41(dirname58(cachePath), { recursive: true }); - await writeFile46(cachePath, config6.cachedChangelog, { + await mkdir41(dirname54(cachePath), { recursive: true }); + await writeFile44(cachePath, config4.cachedChangelog, { encoding: "utf-8", flag: "wx" }); } catch {} - saveGlobalConfig(({ cachedChangelog: _, ...rest3 }) => rest3); + saveGlobalConfig(({ cachedChangelog: _, ...rest2 }) => rest2); } async function fetchAndStoreChangelog() { if (getIsNonInteractiveSession()) { @@ -632885,8 +555451,8 @@ async function fetchAndStoreChangelog() { return; } const cachePath = getChangelogCachePath(); - await mkdir41(dirname58(cachePath), { recursive: true }); - await writeFile46(cachePath, changelogContent, { encoding: "utf-8" }); + await mkdir41(dirname54(cachePath), { recursive: true }); + await writeFile44(cachePath, changelogContent, { encoding: "utf-8" }); changelogMemoryCache = changelogContent; const changelogLastFetched = Date.now(); saveGlobalConfig((current) => ({ @@ -632901,7 +555467,7 @@ async function getStoredChangelog() { } const cachePath = getChangelogCachePath(); try { - const content = await readFile49(cachePath, "utf-8"); + const content = await readFile48(cachePath, "utf-8"); changelogMemoryCache = content; return content; } catch { @@ -632935,8 +555501,8 @@ function parseChangelog(content) { } } return releaseNotes; - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); return {}; } } @@ -632948,8 +555514,8 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent if (!basePreviousVersion || baseCurrentVersion && gt2(baseCurrentVersion.version, basePreviousVersion.version)) { return Object.entries(releaseNotes).filter(([version3]) => !basePreviousVersion || gt2(version3, basePreviousVersion.version)).sort(([versionA], [versionB]) => gt2(versionA, versionB) ? -1 : 1).flatMap(([_, notes]) => notes).filter(Boolean).slice(0, MAX_RELEASE_NOTES_SHOWN); } - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); return []; } return []; @@ -632967,8 +555533,8 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) { return null; return [version3, notes]; }).filter((item) => item !== null); - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); return []; } } @@ -632990,7 +555556,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "2.1.88-cu } const cachedChangelog = await getStoredChangelog(); if (lastSeenVersion !== currentVersion || !cachedChangelog) { - fetchAndStoreChangelog().catch((error46) => logError2(toError(error46))); + fetchAndStoreChangelog().catch((error42) => logError2(toError(error42))); } const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion, cachedChangelog); const hasReleaseNotes = releaseNotes.length > 0; @@ -633051,8 +555617,8 @@ ${bulletPoints}`; async function call28() { let freshNotes = []; try { - const timeoutPromise = new Promise((_, reject3) => { - setTimeout((rej) => rej(new Error("Timeout")), 500, reject3); + const timeoutPromise = new Promise((_, reject2) => { + setTimeout((rej) => rej(new Error("Timeout")), 500, reject2); }); await Promise.race([fetchAndStoreChangelog(), timeoutPromise]); freshNotes = getAllReleaseNotes(await getStoredChangelog()); @@ -633107,16 +555673,16 @@ function extractConversationText(messages) { } } } - const text2 = parts.join(` + const text = parts.join(` `); - return text2.length > MAX_CONVERSATION_TEXT ? text2.slice(-MAX_CONVERSATION_TEXT) : text2; + return text.length > MAX_CONVERSATION_TEXT ? text.slice(-MAX_CONVERSATION_TEXT) : text; } async function generateSessionTitle(description, signal) { const trimmed = description.trim(); if (!trimmed) return null; try { - const result3 = await queryHaiku({ + const result2 = await queryHaiku({ systemPrompt: asSystemPrompt([SESSION_TITLE_PROMPT]), userPrompt: trimmed, outputFormat: { @@ -633139,13 +555705,13 @@ async function generateSessionTitle(description, signal) { mcpTools: [] } }); - const text2 = extractTextContent(result3.message.content); - const parsed = titleSchema().safeParse(safeParseJSON(text2)); + const text = extractTextContent(result2.message.content); + const parsed = titleSchema().safeParse(safeParseJSON(text)); const title = parsed.success ? parsed.data.title.trim() || null : null; logEvent("tengu_session_title_generated", { success: title !== null }); return title; - } catch (error46) { - logForDebugging(`generateSessionTitle failed: ${error46}`, { + } catch (error42) { + logForDebugging(`generateSessionTitle failed: ${error42}`, { level: "error" }); logEvent("tengu_session_title_generated", { success: false }); @@ -633172,7 +555738,7 @@ var init_sessionTitle = __esm(() => { init_claude(); init_debug(); init_json(); - init_messages5(); + init_messages3(); titleSchema = lazySchema(() => exports_external.object({ title: exports_external.string() })); }); @@ -633183,7 +555749,7 @@ async function generateSessionName(messages, signal) { return null; } try { - const result3 = await queryHaiku({ + const result2 = await queryHaiku({ systemPrompt: asSystemPrompt([ 'Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.' ]), @@ -633208,14 +555774,14 @@ async function generateSessionName(messages, signal) { mcpTools: [] } }); - const content = extractTextContent(result3.message.content); + const content = extractTextContent(result2.message.content); const response = safeParseJSON(content); if (response && typeof response === "object" && "name" in response && typeof response.name === "string") { return response.name; } return null; - } catch (error46) { - logForDebugging(`generateSessionName failed: ${errorMessage(error46)}`, { + } catch (error42) { + logForDebugging(`generateSessionName failed: ${errorMessage(error42)}`, { level: "error" }); return null; @@ -633226,7 +555792,7 @@ var init_generateSessionName = __esm(() => { init_debug(); init_errors(); init_json(); - init_messages5(); + init_messages3(); init_sessionTitle(); }); @@ -633255,10 +555821,10 @@ function debugBody(data) { } return s.slice(0, DEBUG_MSG_LIMIT) + `... (${s.length} chars)`; } -function describeAxiosError(err3) { - const msg = errorMessage(err3); - if (err3 && typeof err3 === "object" && "response" in err3) { - const response = err3.response; +function describeAxiosError(err2) { + const msg = errorMessage(err2); + if (err2 && typeof err2 === "object" && "response" in err2) { + const response = err2.response; if (response?.data && typeof response.data === "object") { const data = response.data; const detail = typeof data.message === "string" ? data.message : typeof data.error === "object" && data.error && ("message" in data.error) && typeof data.error.message === "string" ? data.error.message : undefined; @@ -633269,9 +555835,9 @@ function describeAxiosError(err3) { } return msg; } -function extractHttpStatus(err3) { - if (err3 && typeof err3 === "object" && "response" in err3 && err3.response && typeof err3.response.status === "number") { - return err3.response.status; +function extractHttpStatus(err2) { + if (err2 && typeof err2 === "object" && "response" in err2 && err2.response && typeof err2.response.status === "number") { + return err2.response.status; } return; } @@ -633330,7 +555896,7 @@ async function createBridgeSession({ getAccessToken, permissionMode }) { - const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = await Promise.resolve().then(() => (init_auth(), exports_auth)); const { getOrganizationUUID: getOrganizationUUID2 } = await Promise.resolve().then(() => (init_client2(), exports_client)); const { getOauthConfig: getOauthConfig2 } = await Promise.resolve().then(() => (init_oauth(), exports_oauth)); const { getOAuthHeaders: getOAuthHeaders2 } = await Promise.resolve().then(() => (init_api2(), exports_api)); @@ -633417,8 +555983,8 @@ async function createBridgeSession({ signal, validateStatus: (s) => s < 500 }); - } catch (err3) { - logForDebugging(`[bridge] Session creation request failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge] Session creation request failed: ${errorMessage(err2)}`); return null; } const isSuccess = response.status === 200 || response.status === 201; @@ -633435,7 +556001,7 @@ async function createBridgeSession({ return sessionData.id; } async function getBridgeSession(sessionId, opts) { - const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = await Promise.resolve().then(() => (init_auth(), exports_auth)); const { getOrganizationUUID: getOrganizationUUID2 } = await Promise.resolve().then(() => (init_client2(), exports_client)); const { getOauthConfig: getOauthConfig2 } = await Promise.resolve().then(() => (init_oauth(), exports_oauth)); const { getOAuthHeaders: getOAuthHeaders2 } = await Promise.resolve().then(() => (init_api2(), exports_api)); @@ -633460,8 +556026,8 @@ async function getBridgeSession(sessionId, opts) { let response; try { response = await axios2.get(url3, { headers, timeout: 1e4, validateStatus: (s) => s < 500 }); - } catch (err3) { - logForDebugging(`[bridge] Session fetch request failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge] Session fetch request failed: ${errorMessage(err2)}`); return null; } if (response.status !== 200) { @@ -633472,7 +556038,7 @@ async function getBridgeSession(sessionId, opts) { return response.data; } async function archiveBridgeSession(sessionId, opts) { - const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = await Promise.resolve().then(() => (init_auth(), exports_auth)); const { getOrganizationUUID: getOrganizationUUID2 } = await Promise.resolve().then(() => (init_client2(), exports_client)); const { getOauthConfig: getOauthConfig2 } = await Promise.resolve().then(() => (init_oauth(), exports_oauth)); const { getOAuthHeaders: getOAuthHeaders2 } = await Promise.resolve().then(() => (init_api2(), exports_api)); @@ -633507,7 +556073,7 @@ async function archiveBridgeSession(sessionId, opts) { } } async function updateBridgeSessionTitle(sessionId, title, opts) { - const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 } = await Promise.resolve().then(() => (init_auth(), exports_auth)); const { getOrganizationUUID: getOrganizationUUID2 } = await Promise.resolve().then(() => (init_client2(), exports_client)); const { getOauthConfig: getOauthConfig2 } = await Promise.resolve().then(() => (init_oauth(), exports_oauth)); const { getOAuthHeaders: getOAuthHeaders2 } = await Promise.resolve().then(() => (init_api2(), exports_api)); @@ -633538,8 +556104,8 @@ async function updateBridgeSessionTitle(sessionId, title, opts) { const detail = extractErrorDetail(response.data); logForDebugging(`[bridge] Session title update failed with status ${response.status}${detail ? `: ${detail}` : ""}`); } - } catch (err3) { - logForDebugging(`[bridge] Session title update request failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge] Session title update request failed: ${errorMessage(err2)}`); } } var init_createSession = __esm(() => { @@ -633595,7 +556161,7 @@ async function call29(onDone, context2, args) { var init_rename = __esm(() => { init_state(); init_bridgeConfig(); - init_messages5(); + init_messages3(); init_sessionStorage(); init_teammate(); init_generateSessionName(); @@ -633616,7 +556182,7 @@ var init_rename2 = __esm(() => { }); // src/utils/getWorktreePaths.ts -import { sep as sep33 } from "path"; +import { sep as sep30 } from "path"; async function getWorktreePaths(cwd2) { const startTime = Date.now(); const { stdout, code } = await execFileNoThrowWithCwd(gitExe(), ["worktree", "list", "--porcelain"], { @@ -633639,8 +556205,8 @@ async function getWorktreePaths(cwd2) { worktree_count: worktreePaths.length, success: true }); - const currentWorktree = worktreePaths.find((path26) => cwd2 === path26 || cwd2.startsWith(path26 + sep33)); - const otherWorktrees = worktreePaths.filter((path26) => path26 !== currentWorktree).sort((a2, b) => a2.localeCompare(b)); + const currentWorktree = worktreePaths.find((path21) => cwd2 === path21 || cwd2.startsWith(path21 + sep30)); + const otherWorktrees = worktreePaths.filter((path21) => path21 !== currentWorktree).sort((a2, b) => a2.localeCompare(b)); return currentWorktree ? [currentWorktree, ...otherWorktrees] : otherWorktrees; } var init_getWorktreePaths = __esm(() => { @@ -633650,7 +556216,7 @@ var init_getWorktreePaths = __esm(() => { }); // src/utils/set.ts -function every3(a2, b) { +function every2(a2, b) { for (const item of a2) { if (!b.has(item)) { return false; @@ -633677,20 +556243,20 @@ function collapseBackgroundBashNotifications(messages, verbose) { return messages; if (verbose) return messages; - const result3 = []; - let i4 = 0; - while (i4 < messages.length) { - const msg = messages[i4]; + const result2 = []; + let i3 = 0; + while (i3 < messages.length) { + const msg = messages[i3]; if (isCompletedBackgroundBash(msg)) { let count4 = 0; - while (i4 < messages.length && isCompletedBackgroundBash(messages[i4])) { + while (i3 < messages.length && isCompletedBackgroundBash(messages[i3])) { count4++; - i4++; + i3++; } if (count4 === 1) { - result3.push(msg); + result2.push(msg); } else { - result3.push({ + result2.push({ ...msg, message: { role: "user", @@ -633704,17 +556270,17 @@ function collapseBackgroundBashNotifications(messages, verbose) { }); } } else { - result3.push(msg); - i4++; + result2.push(msg); + i3++; } } - return result3; + return result2; } var init_collapseBackgroundBashNotifications = __esm(() => { init_xml(); init_LocalShellTask(); init_fullscreen(); - init_messages5(); + init_messages3(); }); // src/utils/collapseHookSummaries.ts @@ -633722,26 +556288,26 @@ function isLabeledHookSummary(msg) { return msg.type === "system" && msg.subtype === "stop_hook_summary" && msg.hookLabel !== undefined; } function collapseHookSummaries(messages) { - const result3 = []; - let i4 = 0; - while (i4 < messages.length) { - const msg = messages[i4]; + const result2 = []; + let i3 = 0; + while (i3 < messages.length) { + const msg = messages[i3]; if (isLabeledHookSummary(msg)) { const label = msg.hookLabel; const group = []; - while (i4 < messages.length) { - const next = messages[i4]; + while (i3 < messages.length) { + const next = messages[i3]; if (!isLabeledHookSummary(next) || next.hookLabel !== label) break; group.push(next); - i4++; + i3++; } if (group.length === 1) { - result3.push(msg); + result2.push(msg); } else { - result3.push({ + result2.push({ ...msg, - hookCount: group.reduce((sum3, m) => sum3 + m.hookCount, 0), + hookCount: group.reduce((sum2, m) => sum2 + m.hookCount, 0), hookInfos: group.flatMap((m) => m.hookInfos), hookErrors: group.flatMap((m) => m.hookErrors), preventedContinuation: group.some((m) => m.preventedContinuation), @@ -633750,11 +556316,11 @@ function collapseHookSummaries(messages) { }); } } else { - result3.push(msg); - i4++; + result2.push(msg); + i3++; } } - return result3; + return result2; } // src/utils/collapseTeammateShutdowns.ts @@ -633762,20 +556328,20 @@ function isTeammateShutdownAttachment(msg) { return msg.type === "attachment" && msg.attachment.type === "task_status" && msg.attachment.taskType === "in_process_teammate" && msg.attachment.status === "completed"; } function collapseTeammateShutdowns(messages) { - const result3 = []; - let i4 = 0; - while (i4 < messages.length) { - const msg = messages[i4]; + const result2 = []; + let i3 = 0; + while (i3 < messages.length) { + const msg = messages[i3]; if (isTeammateShutdownAttachment(msg)) { let count4 = 0; - while (i4 < messages.length && isTeammateShutdownAttachment(messages[i4])) { + while (i3 < messages.length && isTeammateShutdownAttachment(messages[i3])) { count4++; - i4++; + i3++; } if (count4 === 1) { - result3.push(msg); + result2.push(msg); } else { - result3.push({ + result2.push({ type: "attachment", uuid: msg.uuid, timestamp: msg.timestamp, @@ -633786,11 +556352,11 @@ function collapseTeammateShutdowns(messages) { }); } } else { - result3.push(msg); - i4++; + result2.push(msg); + i3++; } } - return result3; + return result2; } // src/utils/groupToolUses.ts @@ -633853,7 +556419,7 @@ function applyGrouping(messages, tools, verbose = false) { } } } - const result3 = []; + const result2 = []; const emittedGroups = new Set; for (const msg of messages) { const info = getToolUseInfo(msg); @@ -633882,7 +556448,7 @@ function applyGrouping(messages, tools, verbose = false) { timestamp: firstMsg.timestamp, messageId: info.messageId }; - result3.push(groupedMessage); + result2.push(groupedMessage); } continue; } @@ -633896,9 +556462,9 @@ function applyGrouping(messages, tools, verbose = false) { } } } - result3.push(msg); + result2.push(msg); } - return { messages: result3 }; + return { messages: result2 }; } var GROUPING_CACHE; var init_groupToolUses = __esm(() => { @@ -633910,9 +556476,9 @@ function renderableSearchText(msg) { const cached7 = searchTextCache.get(msg); if (cached7 !== undefined) return cached7; - const result3 = computeSearchText(msg).toLowerCase(); - searchTextCache.set(msg, result3); - return result3; + const result2 = computeSearchText(msg).toLowerCase(); + searchTextCache.set(msg, result2); + return result2; } function computeSearchText(msg) { let raw = ""; @@ -633982,10 +556548,10 @@ function computeSearchText(msg) { } return t; } -function toolUseSearchText(input11) { - if (!input11 || typeof input11 !== "object") +function toolUseSearchText(input) { + if (!input || typeof input !== "object") return ""; - const o2 = input11; + const o2 = input; const parts = []; for (const k of [ "command", @@ -634004,7 +556570,7 @@ function toolUseSearchText(input11) { } for (const k of ["args", "files"]) { const v = o2[k]; - if (Array.isArray(v) && v.every((x4) => typeof x4 === "string")) { + if (Array.isArray(v) && v.every((x3) => typeof x3 === "string")) { parts.push(v.join(" ")); } } @@ -634016,9 +556582,9 @@ function toolResultSearchText(r) { return typeof r === "string" ? r : ""; const o2 = r; if (typeof o2.stdout === "string") { - const err3 = typeof o2.stderr === "string" ? o2.stderr : ""; - return o2.stdout + (err3 ? ` -` + err3 : ""); + const err2 = typeof o2.stderr === "string" ? o2.stderr : ""; + return o2.stdout + (err2 ? ` +` + err2 : ""); } if (o2.file && typeof o2.file === "object" && typeof o2.file.content === "string") { return o2.file.content; @@ -634031,7 +556597,7 @@ function toolResultSearchText(r) { } for (const k of ["filenames", "lines", "results"]) { const v = o2[k]; - if (Array.isArray(v) && v.every((x4) => typeof x4 === "string")) { + if (Array.isArray(v) && v.every((x3) => typeof x3 === "string")) { parts.push(v.join(` `)); } @@ -634041,7 +556607,7 @@ function toolResultSearchText(r) { } var SYSTEM_REMINDER_CLOSE = "
", RENDERED_AS_SENTINEL, searchTextCache; var init_transcriptSearch = __esm(() => { - init_messages5(); + init_messages3(); RENDERED_AS_SENTINEL = new Set([ INTERRUPT_MESSAGE, INTERRUPT_MESSAGE_FOR_TOOL_USE @@ -634084,40 +556650,40 @@ function formatWelcomeMessage(username) { } return `Welcome back ${username}!`; } -function truncatePath(path26, maxLength) { - if (stringWidth(path26) <= maxLength) - return path26; +function truncatePath(path21, maxLength) { + if (stringWidth(path21) <= maxLength) + return path21; const separator = "/"; const ellipsis = "…"; const ellipsisWidth = 1; const separatorWidth = 1; - const parts = path26.split(separator); + const parts = path21.split(separator); const first = parts[0] || ""; - const last3 = parts[parts.length - 1] || ""; + const last2 = parts[parts.length - 1] || ""; const firstWidth = stringWidth(first); - const lastWidth = stringWidth(last3); + const lastWidth = stringWidth(last2); if (parts.length === 1) { - return truncateToWidth(path26, maxLength); + return truncateToWidth(path21, maxLength); } if (first === "" && ellipsisWidth + separatorWidth + lastWidth >= maxLength) { - return `${separator}${truncateToWidth(last3, Math.max(1, maxLength - separatorWidth))}`; + return `${separator}${truncateToWidth(last2, Math.max(1, maxLength - separatorWidth))}`; } if (first !== "" && ellipsisWidth * 2 + separatorWidth + lastWidth >= maxLength) { - return `${ellipsis}${separator}${truncateToWidth(last3, Math.max(1, maxLength - ellipsisWidth - separatorWidth))}`; + return `${ellipsis}${separator}${truncateToWidth(last2, Math.max(1, maxLength - ellipsisWidth - separatorWidth))}`; } if (parts.length === 2) { const availableForFirst = maxLength - ellipsisWidth - separatorWidth - lastWidth; - return `${truncateToWidthNoEllipsis(first, availableForFirst)}${ellipsis}${separator}${last3}`; + return `${truncateToWidthNoEllipsis(first, availableForFirst)}${ellipsis}${separator}${last2}`; } let available = maxLength - firstWidth - lastWidth - ellipsisWidth - 2 * separatorWidth; if (available <= 0) { const availableForFirst = Math.max(0, maxLength - lastWidth - ellipsisWidth - 2 * separatorWidth); const truncatedFirst = truncateToWidthNoEllipsis(first, availableForFirst); - return `${truncatedFirst}${separator}${ellipsis}${separator}${last3}`; + return `${truncatedFirst}${separator}${ellipsis}${separator}${last2}`; } const middleParts = []; - for (let i4 = parts.length - 2;i4 > 0; i4--) { - const part = parts[i4]; + for (let i3 = parts.length - 2;i3 > 0; i3--) { + const part = parts[i3]; if (part && stringWidth(part) + separatorWidth <= available) { middleParts.unshift(part); available -= stringWidth(part) + separatorWidth; @@ -634126,9 +556692,9 @@ function truncatePath(path26, maxLength) { } } if (middleParts.length === 0) { - return `${first}${separator}${ellipsis}${separator}${last3}`; + return `${first}${separator}${ellipsis}${separator}${last2}`; } - return `${first}${separator}${ellipsis}${separator}${middleParts.join(separator)}${separator}${last3}`; + return `${first}${separator}${ellipsis}${separator}${middleParts.join(separator)}${separator}${last2}`; } async function getRecentActivity() { if (cachePromise) { @@ -634136,15 +556702,15 @@ async function getRecentActivity() { } const currentSessionId = getSessionId(); cachePromise = loadMessageLogs(10).then((logs2) => { - cachedActivity = logs2.filter((log2) => { - if (log2.isSidechain) + cachedActivity = logs2.filter((log) => { + if (log.isSidechain) return false; - if (log2.sessionId === currentSessionId) + if (log.sessionId === currentSessionId) return false; - if (log2.summary?.includes("I apologize")) + if (log.summary?.includes("I apologize")) return false; - const hasSummary = log2.summary && log2.summary !== "No prompt"; - const hasFirstPrompt = log2.firstPrompt && log2.firstPrompt !== "No prompt"; + const hasSummary = log.summary && log.summary !== "No prompt"; + const hasFirstPrompt = log.firstPrompt && log.firstPrompt !== "No prompt"; return hasSummary || hasFirstPrompt; }).slice(0, 3); return cachedActivity; @@ -634222,7 +556788,7 @@ var MAX_LEFT_WIDTH = 50, MAX_USERNAME_LENGTH = 20, BORDER_PADDING = 4, DIVIDER_W var init_logoV2Utils = __esm(() => { init_state(); init_stringWidth(); - init_auth2(); + init_auth(); init_cwd2(); init_file(); init_format(); @@ -634523,14 +557089,14 @@ var init_Clawd = __esm(() => { }); // src/components/LogoV2/Feed.tsx -function calculateFeedWidth(config6) { +function calculateFeedWidth(config4) { const { title, lines, footer, emptyMessage, customContent - } = config6; + } = config4; let maxWidth = stringWidth(title); if (customContent !== undefined) { maxWidth = Math.max(maxWidth, customContent.width); @@ -634553,7 +557119,7 @@ function calculateFeedWidth(config6) { function Feed(t0) { const $2 = import_compiler_runtime199.c(15); const { - config: config6, + config: config4, actualWidth } = t0; const { @@ -634562,7 +557128,7 @@ function Feed(t0) { footer, emptyMessage, customContent - } = config6; + } = config4; let t1; if ($2[0] !== lines) { t1 = Math.max(0, ...lines.map(_temp116)); @@ -634788,8 +557354,8 @@ function checkCachedPassesEligibility() { hasCache: false }; } - const config6 = getGlobalConfig(); - const cachedEntry = config6.passesEligibilityCache?.[orgId]; + const config4 = getGlobalConfig(); + const cachedEntry = config4.passesEligibilityCache?.[orgId]; if (!cachedEntry) { return { eligible: false, @@ -634798,8 +557364,8 @@ function checkCachedPassesEligibility() { }; } const { eligible: eligible2, timestamp: timestamp2 } = cachedEntry; - const now3 = Date.now(); - const needsRefresh = now3 - timestamp2 > CACHE_EXPIRATION_MS; + const now2 = Date.now(); + const needsRefresh = now2 - timestamp2 > CACHE_EXPIRATION_MS; return { eligible: eligible2, needsRefresh, @@ -634816,16 +557382,16 @@ function getCachedReferrerReward() { const orgId = getOauthAccountInfo()?.organizationUuid; if (!orgId) return null; - const config6 = getGlobalConfig(); - const cachedEntry = config6.passesEligibilityCache?.[orgId]; + const config4 = getGlobalConfig(); + const cachedEntry = config4.passesEligibilityCache?.[orgId]; return cachedEntry?.referrer_reward ?? null; } function getCachedRemainingPasses() { const orgId = getOauthAccountInfo()?.organizationUuid; if (!orgId) return null; - const config6 = getGlobalConfig(); - const cachedEntry = config6.passesEligibilityCache?.[orgId]; + const config4 = getGlobalConfig(); + const cachedEntry = config4.passesEligibilityCache?.[orgId]; return cachedEntry?.remaining_passes ?? null; } async function fetchAndStorePassesEligibility() { @@ -634853,9 +557419,9 @@ async function fetchAndStorePassesEligibility() { })); logForDebugging(`Passes eligibility cached for org ${orgId}: ${response.eligible}`); return response; - } catch (error46) { + } catch (error42) { logForDebugging("Failed to fetch and cache passes eligibility"); - logError2(error46); + logError2(error42); return null; } finally { fetchInProgress = null; @@ -634871,15 +557437,15 @@ async function getCachedOrFetchPassesEligibility() { if (!orgId) { return null; } - const config6 = getGlobalConfig(); - const cachedEntry = config6.passesEligibilityCache?.[orgId]; - const now3 = Date.now(); + const config4 = getGlobalConfig(); + const cachedEntry = config4.passesEligibilityCache?.[orgId]; + const now2 = Date.now(); if (!cachedEntry) { logForDebugging("Passes: No cache, fetching eligibility in background (command unavailable this session)"); fetchAndStorePassesEligibility(); return null; } - if (now3 - cachedEntry.timestamp > CACHE_EXPIRATION_MS) { + if (now2 - cachedEntry.timestamp > CACHE_EXPIRATION_MS) { logForDebugging("Passes: Cache stale, returning cached data and refreshing in background"); fetchAndStorePassesEligibility(); const { timestamp: timestamp3, ...response2 } = cachedEntry; @@ -634899,7 +557465,7 @@ var CACHE_EXPIRATION_MS, fetchInProgress = null, CURRENCY_SYMBOLS; var init_referral = __esm(() => { init_axios2(); init_oauth(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_log3(); @@ -634918,11 +557484,11 @@ var init_referral = __esm(() => { }); // src/components/LogoV2/feedConfigs.tsx -import { homedir as homedir32 } from "os"; +import { homedir as homedir30 } from "os"; function createRecentActivityFeed(activities) { - const lines = activities.map((log2) => { - const time5 = formatRelativeTimeAgo(log2.modified); - const description = log2.summary && log2.summary !== "No prompt" ? log2.summary : log2.firstPrompt; + const lines = activities.map((log) => { + const time5 = formatRelativeTimeAgo(log.modified); + const description = log.summary && log.summary !== "No prompt" ? log.summary : log.firstPrompt; return { text: description || "", timestamp: time5 @@ -634955,15 +557521,15 @@ function createProjectOnboardingFeed(steps) { isEnabled: isEnabled2 }) => isEnabled2).sort((a2, b) => Number(a2.isComplete) - Number(b.isComplete)); const lines = enabledSteps.map(({ - text: text2, + text, isComplete }) => { const checkmark = isComplete ? `${figures_default.tick} ` : ""; return { - text: `${checkmark}${text2}` + text: `${checkmark}${text}` }; }); - const warningText = getCwd() === homedir32() ? "Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead." : undefined; + const warningText = getCwd() === homedir30() ? "Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead." : undefined; if (warningText) { lines.push({ text: warningText @@ -635094,7 +557660,7 @@ function useClawdAnimation() { onClick }; } -var import_compiler_runtime201, import_react144, jsx_dev_runtime256, JUMP_WAVE, LOOK_AROUND, CLICK_ANIMATIONS, IDLE, FRAME_MS = 60, incrementFrame = (i4) => i4 + 1, CLAWD_HEIGHT = 3; +var import_compiler_runtime201, import_react144, jsx_dev_runtime256, JUMP_WAVE, LOOK_AROUND, CLICK_ANIMATIONS, IDLE, FRAME_MS = 60, incrementFrame = (i3) => i3 + 1, CLAWD_HEIGHT = 3; var init_AnimatedClawd = __esm(() => { import_compiler_runtime201 = __toESM(require_compiler_runtime(), 1); import_react144 = __toESM(require_react(), 1); @@ -635123,8 +557689,8 @@ function resetIfPassesRefreshed() { const remaining = getCachedRemainingPasses(); if (remaining == null || remaining <= 0) return; - const config6 = getGlobalConfig(); - const lastSeen = config6.passesLastSeenRemaining ?? 0; + const config4 = getGlobalConfig(); + const lastSeen = config4.passesLastSeenRemaining ?? 0; if (remaining > lastSeen) { saveGlobalConfig((prev) => ({ ...prev, @@ -635142,10 +557708,10 @@ function shouldShowGuestPassesUpsell() { if (!eligible2 || !hasCache) return false; resetIfPassesRefreshed(); - const config6 = getGlobalConfig(); - if ((config6.passesUpsellSeenCount ?? 0) >= 3) + const config4 = getGlobalConfig(); + if ((config4.passesUpsellSeenCount ?? 0) >= 3) return false; - if (config6.hasVisitedPasses) + if (config4.hasVisitedPasses) return false; return true; } @@ -635529,7 +558095,7 @@ var init_AnimatedAsterisk = __esm(() => { init_figures2(); init_ink2(); init_settings2(); - init_utils6(); + init_utils5(); jsx_dev_runtime260 = __toESM(require_jsx_dev_runtime(), 1); TOTAL_ANIMATION_MS = SWEEP_DURATION_MS * SWEEP_COUNT; SETTLED_GREY = toRGBColor({ @@ -636028,7 +558594,7 @@ var init_ChannelsNotice = __esm(() => { init_channelAllowlist(); init_channelNotification(); init_config3(); - init_auth2(); + init_auth(); init_installedPluginsManager(); init_settings2(); jsx_dev_runtime263 = __toESM(require_jsx_dev_runtime(), 1); @@ -636062,7 +558628,7 @@ function LogoV2() { const showOverageCreditUpsell = useShowOverageCreditUpsell(); const agent = useAppState(_temp124); const effortValue = useAppState(_temp248); - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); let changelog; try { changelog = getRecentReleaseNotesSync(3); @@ -636074,11 +558640,11 @@ function LogoV2() { if (!announcements || announcements.length === 0) { return; } - return config6.numStartups === 1 ? announcements[0] : announcements[Math.floor(Math.random() * announcements.length)]; + return config4.numStartups === 1 ? announcements[0] : announcements[Math.floor(Math.random() * announcements.length)]; }); const { hasReleaseNotes - } = checkForReleaseNotesSync(config6.lastReleaseNotesSeen); + } = checkForReleaseNotesSync(config4.lastReleaseNotesSeen); let t2; if ($2[2] === Symbol.for("react.memo_cache_sentinel")) { t2 = () => { @@ -636096,9 +558662,9 @@ function LogoV2() { t2 = $2[2]; } let t3; - if ($2[3] !== config6) { - t3 = [config6, showOnboarding]; - $2[3] = config6; + if ($2[3] !== config4) { + t3 = [config4, showOnboarding]; + $2[3] = config4; $2[4] = t3; } else { t3 = $2[4]; @@ -636232,16 +558798,16 @@ function LogoV2() { t172 = $2[21]; } let t182; - if ($2[22] !== announcement || $2[23] !== config6) { + if ($2[22] !== announcement || $2[23] !== config4) { t182 = announcement && /* @__PURE__ */ jsx_dev_runtime264.jsxDEV(ThemedBox_default, { paddingLeft: 2, flexDirection: "column", children: [ - !process.env.IS_DEMO && config6.oauthAccount?.organizationName && /* @__PURE__ */ jsx_dev_runtime264.jsxDEV(ThemedText, { + !process.env.IS_DEMO && config4.oauthAccount?.organizationName && /* @__PURE__ */ jsx_dev_runtime264.jsxDEV(ThemedText, { dimColor: true, children: [ "Message from ", - config6.oauthAccount.organizationName, + config4.oauthAccount.organizationName, ":" ] }, undefined, true, undefined, this), @@ -636251,7 +558817,7 @@ function LogoV2() { ] }, undefined, true, undefined, this); $2[22] = announcement; - $2[23] = config6; + $2[23] = config4; $2[24] = t182; } else { t182 = $2[24]; @@ -636433,7 +558999,7 @@ function LogoV2() { }, undefined, true, undefined, this); } const welcomeMessage_0 = formatWelcomeMessage(username); - const modelLine = !process.env.IS_DEMO && config6.oauthAccount?.organizationName ? `${modelDisplayName} · ${billingType} · ${config6.oauthAccount.organizationName}` : `${modelDisplayName} · ${billingType}`; + const modelLine = !process.env.IS_DEMO && config4.oauthAccount?.organizationName ? `${modelDisplayName} · ${billingType} · ${config4.oauthAccount.organizationName}` : `${modelDisplayName} · ${billingType}`; const cwdAvailableWidth_0 = agentName ? LEFT_PANEL_MAX_WIDTH - 1 - stringWidth(agentName) - 3 : LEFT_PANEL_MAX_WIDTH; const truncatedCwd_0 = truncatePath(cwd2, Math.max(cwdAvailableWidth_0, 10)); const cwdLine = agentName ? `@${agentName} · ${truncatedCwd_0}` : truncatedCwd_0; @@ -636672,16 +559238,16 @@ function LogoV2() { t34 = $2[80]; } let t35; - if ($2[81] !== announcement || $2[82] !== config6) { + if ($2[81] !== announcement || $2[82] !== config4) { t35 = announcement && /* @__PURE__ */ jsx_dev_runtime264.jsxDEV(ThemedBox_default, { paddingLeft: 2, flexDirection: "column", children: [ - !process.env.IS_DEMO && config6.oauthAccount?.organizationName && /* @__PURE__ */ jsx_dev_runtime264.jsxDEV(ThemedText, { + !process.env.IS_DEMO && config4.oauthAccount?.organizationName && /* @__PURE__ */ jsx_dev_runtime264.jsxDEV(ThemedText, { dimColor: true, children: [ "Message from ", - config6.oauthAccount.organizationName, + config4.oauthAccount.organizationName, ":" ] }, undefined, true, undefined, this), @@ -636691,7 +559257,7 @@ function LogoV2() { ] }, undefined, true, undefined, this); $2[81] = announcement; - $2[82] = config6; + $2[82] = config4; $2[83] = t35; } else { t35 = $2[83]; @@ -636929,8 +559495,8 @@ var init_MessageTimestamp = __esm(() => { // src/components/MessageRow.tsx function hasContentAfterIndex(messages, index, tools, streamingToolUseIDs) { - for (let i4 = index + 1;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = index + 1;i3 < messages.length; i3++) { + const msg = messages[i3]; if (msg?.type === "assistant") { const content = msg.message.content[0]; if (content?.type === "thinking" || content?.type === "redacted_thinking") { @@ -637273,7 +559839,7 @@ var init_MessageRow = __esm(() => { React80 = __toESM(require_react(), 1); init_ink2(); init_collapseReadSearch(); - init_messages5(); + init_messages3(); init_Message(); init_MessageModel(); init_Messages(); @@ -637329,7 +559895,7 @@ var init_nullRenderingAttachments = __esm(() => { }); // src/utils/statusNoticeDefinitions.tsx -import { relative as relative27 } from "path"; +import { relative as relative25 } from "path"; function getActiveNotices(context2) { return statusNoticeDefinitions.filter((notice) => notice.isActive(context2)); } @@ -637340,7 +559906,7 @@ var init_statusNoticeDefinitions = __esm(() => { init_figures(); init_cwd2(); init_format(); - init_auth2(); + init_auth(); init_statusNoticeHelpers(); init_ide(); init_jetbrains(); @@ -637353,7 +559919,7 @@ var init_statusNoticeDefinitions = __esm(() => { const largeMemoryFiles = getLargeMemoryFiles(ctx.memoryFiles); return /* @__PURE__ */ jsx_dev_runtime268.jsxDEV(jsx_dev_runtime268.Fragment, { children: largeMemoryFiles.map((file2) => { - const displayPath = file2.path.startsWith(getCwd()) ? relative27(getCwd(), file2.path) : file2.path; + const displayPath = file2.path.startsWith(getCwd()) ? relative25(getCwd(), file2.path) : file2.path; return /* @__PURE__ */ jsx_dev_runtime268.jsxDEV(ThemedBox_default, { flexDirection: "row", children: [ @@ -637731,8 +560297,8 @@ function useVirtualScroll(scrollRef, itemKeys, columns) { if (offsetsRef.current.version !== offsetVersionRef.current || offsetsRef.current.n !== n2) { const arr = offsetsRef.current.arr.length >= n2 + 1 ? offsetsRef.current.arr : new Float64Array(n2 + 1); arr[0] = 0; - for (let i4 = 0;i4 < n2; i4++) { - arr[i4 + 1] = arr[i4] + (heightCache.current.get(itemKeys[i4]) ?? DEFAULT_ESTIMATE); + for (let i3 = 0;i3 < n2; i3++) { + arr[i3 + 1] = arr[i3] + (heightCache.current.get(itemKeys[i3]) ?? DEFAULT_ESTIMATE); } offsetsRef.current = { arr, version: offsetVersionRef.current, n: n2 }; } @@ -637781,10 +560347,10 @@ function useVirtualScroll(scrollRef, itemKeys, columns) { { const p = prevRangeRef.current; if (p && p[0] < start) { - for (let i4 = p[0];i4 < Math.min(start, p[1]); i4++) { - const k = itemKeys[i4]; + for (let i3 = p[0];i3 < Math.min(start, p[1]); i3++) { + const k = itemKeys[i3]; if (itemRefs.current.has(k) && !heightCache.current.has(k)) { - start = i4; + start = i3; break; } } @@ -637802,8 +560368,8 @@ function useVirtualScroll(scrollRef, itemKeys, columns) { const needed = viewportH + 2 * OVERSCAN_ROWS; const minStart = Math.max(0, end - MAX_MOUNTED_ITEMS); let coverage = 0; - for (let i4 = start;i4 < end; i4++) { - coverage += heightCache.current.get(itemKeys[i4]) ?? PESSIMISTIC_HEIGHT; + for (let i3 = start;i3 < end; i3++) { + coverage += heightCache.current.get(itemKeys[i3]) ?? PESSIMISTIC_HEIGHT; } while (start > minStart && coverage < needed) { start--; @@ -637916,11 +560482,11 @@ function useVirtualScroll(scrollRef, itemKeys, columns) { }, [itemKeys]); const getItemElement = import_react154.useCallback((index) => itemRefs.current.get(itemKeys[index]) ?? null, [itemKeys]); const getItemHeight = import_react154.useCallback((index) => heightCache.current.get(itemKeys[index]), [itemKeys]); - const scrollToIndex = import_react154.useCallback((i4) => { + const scrollToIndex = import_react154.useCallback((i3) => { const o2 = offsetsRef.current; - if (i4 < 0 || i4 >= o2.n) + if (i3 < 0 || i3 >= o2.n) return; - scrollRef.current?.scrollTo(o2.arr[i4] + listOriginRef.current); + scrollRef.current?.scrollTo(o2.arr[i3] + listOriginRef.current); }, [scrollRef]); const effBottomSpacer = totalHeight - offsets[effEnd]; return { @@ -637948,7 +560514,7 @@ function PromptOverlayProvider(t0) { const { children: children2 } = t0; - const [data, setData3] = import_react155.useState(null); + const [data, setData2] = import_react155.useState(null); const [dialog, setDialog] = import_react155.useState(null); let t1; if ($2[0] !== children2 || $2[1] !== dialog) { @@ -637965,7 +560531,7 @@ function PromptOverlayProvider(t0) { let t2; if ($2[3] !== data || $2[4] !== t1) { t2 = /* @__PURE__ */ jsx_dev_runtime270.jsxDEV(SetContext.Provider, { - value: setData3, + value: setData2, children: /* @__PURE__ */ jsx_dev_runtime270.jsxDEV(SetDialogContext.Provider, { value: setDialog, children: /* @__PURE__ */ jsx_dev_runtime270.jsxDEV(DataContext.Provider, { @@ -637990,20 +560556,20 @@ function usePromptOverlayDialog() { } function useSetPromptOverlay(data) { const $2 = import_compiler_runtime212.c(4); - const set6 = import_react155.useContext(SetContext); + const set5 = import_react155.useContext(SetContext); let t0; let t1; - if ($2[0] !== data || $2[1] !== set6) { + if ($2[0] !== data || $2[1] !== set5) { t0 = () => { - if (!set6) { + if (!set5) { return; } - set6(data); - return () => set6(null); + set5(data); + return () => set5(null); }; - t1 = [set6, data]; + t1 = [set5, data]; $2[0] = data; - $2[1] = set6; + $2[1] = set5; $2[2] = t0; $2[3] = t1; } else { @@ -638014,20 +560580,20 @@ function useSetPromptOverlay(data) { } function useSetPromptOverlayDialog(node) { const $2 = import_compiler_runtime212.c(4); - const set6 = import_react155.useContext(SetDialogContext); + const set5 = import_react155.useContext(SetDialogContext); let t0; let t1; - if ($2[0] !== node || $2[1] !== set6) { + if ($2[0] !== node || $2[1] !== set5) { t0 = () => { - if (!set6) { + if (!set5) { return; } - set6(node); - return () => set6(null); + set5(node); + return () => set5(null); }; - t1 = [set6, node]; + t1 = [set5, node]; $2[0] = node; - $2[1] = set6; + $2[1] = set5; $2[2] = t0; $2[3] = t1; } else { @@ -638048,7 +560614,7 @@ var init_promptOverlayContext = __esm(() => { }); // src/components/FullscreenLayout.tsx -import { fileURLToPath as fileURLToPath6 } from "url"; +import { fileURLToPath as fileURLToPath5 } from "url"; function useUnseenDivider(messageCount) { const [dividerIndex, setDividerIndex] = import_react156.useState(null); const countRef = import_react156.useRef(messageCount); @@ -638058,8 +560624,8 @@ function useUnseenDivider(messageCount) { setDividerIndex(null); }, []); const onScrollAway = import_react156.useCallback((handle2) => { - const max5 = Math.max(0, handle2.getScrollHeight() - handle2.getViewportHeight()); - if (handle2.getScrollTop() + handle2.getPendingDelta() >= max5) + const max3 = Math.max(0, handle2.getScrollHeight() - handle2.getViewportHeight()); + if (handle2.getScrollTop() + handle2.getPendingDelta() >= max3) return; if (dividerYRef.current === null) { dividerYRef.current = handle2.getScrollHeight(); @@ -638097,8 +560663,8 @@ function useUnseenDivider(messageCount) { function countUnseenAssistantTurns(messages, dividerIndex) { let count4 = 0; let prevWasAssistant = false; - for (let i4 = dividerIndex;i4 < messages.length; i4++) { - const m = messages[i4]; + for (let i3 = dividerIndex;i3 < messages.length; i3++) { + const m = messages[i3]; if (m.type === "progress") continue; if (m.type === "assistant" && !assistantHasVisibleText(m)) @@ -638126,12 +560692,12 @@ function computeUnseenDivider(messages, dividerIndex) { while (anchorIdx < messages.length && (messages[anchorIdx]?.type === "progress" || isNullRenderingAttachment(messages[anchorIdx]))) { anchorIdx++; } - const uuid8 = messages[anchorIdx]?.uuid; - if (!uuid8) + const uuid5 = messages[anchorIdx]?.uuid; + if (!uuid5) return; const count4 = countUnseenAssistantTurns(messages, dividerIndex); return { - firstUnseenUuid: uuid8, + firstUnseenUuid: uuid5, count: Math.max(1, count4) }; } @@ -638433,7 +560999,7 @@ function _temp332() { function _temp249(url3) { if (url3.startsWith("file:")) { try { - openPath(fileURLToPath6(url3)); + openPath(fileURLToPath5(url3)); } catch {} } else { openBrowser(url3); @@ -638512,7 +561078,7 @@ function NewMessagesPill(t0) { function StickyPromptHeader(t0) { const $2 = import_compiler_runtime213.c(8); const { - text: text2, + text, onClick } = t0; const [hover, setHover] = import_react156.useState(false); @@ -638529,17 +561095,17 @@ function StickyPromptHeader(t0) { t3 = $2[1]; } let t4; - if ($2[2] !== text2) { + if ($2[2] !== text) { t4 = /* @__PURE__ */ jsx_dev_runtime271.jsxDEV(ThemedText, { color: "subtle", wrap: "truncate-end", children: [ figures_default.pointer, " ", - text2 + text ] }, undefined, true, undefined, this); - $2[2] = text2; + $2[2] = text; $2[3] = t4; } else { t4 = $2[3]; @@ -638657,9 +561223,9 @@ function stickyPromptText(msg) { const cached7 = promptTextCache.get(msg); if (cached7 !== undefined) return cached7; - const result3 = computeStickyPromptText(msg); - promptTextCache.set(msg, result3); - return result3; + const result2 = computeStickyPromptText(msg); + promptTextCache.set(msg, result2); + return result2; } function computeStickyPromptText(msg) { let raw = null; @@ -638811,15 +561377,15 @@ function VirtualMessageList({ if (prevItemKeyRef.current !== itemKey || messages.length < keysRef.current.length || messages[0] !== prevMessagesRef.current[0]) { keysRef.current = messages.map((m) => itemKey(m)); } else { - for (let i4 = keysRef.current.length;i4 < messages.length; i4++) { - keysRef.current.push(itemKey(messages[i4])); + for (let i3 = keysRef.current.length;i3 < messages.length; i3++) { + keysRef.current.push(itemKey(messages[i3])); } } prevMessagesRef.current = messages; prevItemKeyRef.current = itemKey; - const keys3 = keysRef.current; + const keys2 = keysRef.current; const { - range: range3, + range: range2, topSpacer, bottomSpacer, measureRef, @@ -638829,16 +561395,16 @@ function VirtualMessageList({ getItemElement, getItemHeight, scrollToIndex - } = useVirtualScroll(scrollRef, keys3, columns); - const [start, end] = range3; - const isVisible = import_react157.useCallback((i4) => { - const h2 = getItemHeight(i4); + } = useVirtualScroll(scrollRef, keys2, columns); + const [start, end] = range2; + const isVisible = import_react157.useCallback((i3) => { + const h2 = getItemHeight(i3); if (h2 === 0) return false; - return isNavigableMessage(messages[i4]); + return isNavigableMessage(messages[i3]); }, [getItemHeight, messages]); import_react157.useImperativeHandle(cursorNavRef, () => { - const select12 = (m) => setCursor?.({ + const select2 = (m) => setCursor?.({ uuid: m.uuid, msgType: m.type, expanded: false, @@ -638846,15 +561412,15 @@ function VirtualMessageList({ }); const selIdx = selectedIndex ?? -1; const scan = (from, dir, pred = isVisible) => { - for (let i4 = from;i4 >= 0 && i4 < messages.length; i4 += dir) { - if (pred(i4)) { - select12(messages[i4]); + for (let i3 = from;i3 >= 0 && i3 < messages.length; i3 += dir) { + if (pred(i3)) { + select2(messages[i3]); return true; } } return false; }; - const isUser = (i4) => isVisible(i4) && messages[i4].type === "user"; + const isUser = (i3) => isVisible(i3) && messages[i3].type === "user"; return { enterCursor: () => scan(messages.length - 1, -1, isUser), navigatePrev: () => scan(selIdx - 1, -1), @@ -638916,8 +561482,8 @@ function VirtualMessageList({ }); const searchAnchor = import_react157.useRef(-1); const indexWarmed = import_react157.useRef(false); - function targetFor(i4) { - const top = jumpState.current.getItemTop(i4); + function targetFor(i3) { + const top = jumpState.current.getItemTop(i3); return Math.max(0, top - HEADROOM); } function highlight(ord) { @@ -639018,7 +561584,7 @@ function VirtualMessageList({ stepRef.current(pending2); } }, [seekGen]); - function jump(i4, wantLast) { + function jump(i3, wantLast) { const s = scrollRef.current; if (!s) return; @@ -639027,7 +561593,7 @@ function VirtualMessageList({ getItemElement: getItemElement2, scrollToIndex: scrollToIndex2 } = js; - if (i4 < 0 || i4 >= js.messages.length) + if (i3 < 0 || i3 >= js.messages.length) return; setPositions?.(null); elementPositions.current = { @@ -639035,27 +561601,27 @@ function VirtualMessageList({ positions: [] }; scanRequestRef.current = { - idx: i4, + idx: i3, wantLast, tries: 0 }; - const el = getItemElement2(i4); + const el = getItemElement2(i3); const h2 = el?.yogaNode?.getComputedHeight() ?? 0; if (el && h2 > 0) { - s.scrollTo(targetFor(i4)); + s.scrollTo(targetFor(i3)); } else { - scrollToIndex2(i4); + scrollToIndex2(i3); } bumpSeek(); } function step(delta) { const st = searchState.current; const { - matches: matches3, + matches: matches2, prefixSum } = st; const total = prefixSum.at(-1) ?? 0; - if (matches3.length === 0) + if (matches2.length === 0) return; if (scanRequestRef.current) { pendingStepRef.current = delta; @@ -639073,25 +561639,25 @@ function VirtualMessageList({ startPtrRef.current = -1; return; } - const ptr = (st.ptr + delta + matches3.length) % matches3.length; + const ptr = (st.ptr + delta + matches2.length) % matches2.length; if (ptr === startPtrRef.current) { setPositions?.(null); startPtrRef.current = -1; - logForDebugging(`step: wraparound at ptr=${ptr}, all ${matches3.length} msgs phantoms`); + logForDebugging(`step: wraparound at ptr=${ptr}, all ${matches2.length} msgs phantoms`); return; } st.ptr = ptr; st.screenOrd = 0; - jump(matches3[ptr], delta < 0); + jump(matches2[ptr], delta < 0); const placeholder = delta < 0 ? prefixSum[ptr + 1] ?? total : prefixSum[ptr] + 1; onSearchMatchesChange?.(total, placeholder); } stepRef.current = step; import_react157.useImperativeHandle(jumpRef, () => ({ - jumpToIndex: (i4) => { + jumpToIndex: (i3) => { const s = scrollRef.current; if (s) - s.scrollTo(targetFor(i4)); + s.scrollTo(targetFor(i3)); }, setSearchQuery: (q) => { scanRequestRef.current = null; @@ -639102,20 +561668,20 @@ function VirtualMessageList({ startPtrRef.current = -1; setPositions?.(null); const lq = q.toLowerCase(); - const matches3 = []; + const matches2 = []; const prefixSum = [0]; if (lq) { const msgs = jumpState.current.messages; - for (let i4 = 0;i4 < msgs.length; i4++) { - const text2 = extractSearchText(msgs[i4]); - let pos = text2.indexOf(lq); + for (let i3 = 0;i3 < msgs.length; i3++) { + const text = extractSearchText(msgs[i3]); + let pos = text.indexOf(lq); let cnt = 0; while (pos >= 0) { cnt++; - pos = text2.indexOf(lq, pos + lq.length); + pos = text.indexOf(lq, pos + lq.length); } if (cnt > 0) { - matches3.push(i4); + matches2.push(i3); prefixSum.push(prefixSum.at(-1) + cnt); } } @@ -639130,30 +561696,30 @@ function VirtualMessageList({ } = jumpState.current; const firstTop = getItemTop2(start2); const origin2 = firstTop >= 0 ? firstTop - offsets2[start2] : 0; - if (matches3.length > 0 && s) { + if (matches2.length > 0 && s) { const curTop = searchAnchor.current >= 0 ? searchAnchor.current : s.getScrollTop(); let best = Infinity; - for (let k = 0;k < matches3.length; k++) { - const d = Math.abs(origin2 + offsets2[matches3[k]] - curTop); + for (let k = 0;k < matches2.length; k++) { + const d = Math.abs(origin2 + offsets2[matches2[k]] - curTop); if (d <= best) { best = d; ptr = k; } } - logForDebugging(`setSearchQuery('${q}'): ${matches3.length} msgs · ptr=${ptr} ` + `msgIdx=${matches3[ptr]} curTop=${curTop} origin=${origin2}`); + logForDebugging(`setSearchQuery('${q}'): ${matches2.length} msgs · ptr=${ptr} ` + `msgIdx=${matches2[ptr]} curTop=${curTop} origin=${origin2}`); } searchState.current = { - matches: matches3, + matches: matches2, ptr, screenOrd: 0, prefixSum }; - if (matches3.length > 0) { - jump(matches3[ptr], true); + if (matches2.length > 0) { + jump(matches2[ptr], true); } else if (searchAnchor.current >= 0 && s) { s.scrollTo(searchAnchor.current); } - onSearchMatchesChange?.(total, matches3.length > 0 ? prefixSum[ptr + 1] ?? total : 0); + onSearchMatchesChange?.(total, matches2.length > 0 ? prefixSum[ptr + 1] ?? total : 0); }, nextMatch: () => step(1), prevMatch: () => step(-1), @@ -639178,11 +561744,11 @@ function VirtualMessageList({ const CHUNK = 500; let workMs = 0; const wallStart = performance.now(); - for (let i4 = 0;i4 < msgs.length; i4 += CHUNK) { - await sleep4(0); + for (let i3 = 0;i3 < msgs.length; i3 += CHUNK) { + await sleep2(0); const t0 = performance.now(); - const end2 = Math.min(i4 + CHUNK, msgs.length); - for (let j = i4;j < end2; j++) { + const end2 = Math.min(i3 + CHUNK, msgs.length); + for (let j = i3;j < end2; j++) { extractSearchText(msgs[j]); } workMs += performance.now() - t0; @@ -639220,9 +561786,9 @@ function VirtualMessageList({ height: topSpacer, flexShrink: 0 }, undefined, false, undefined, this), - messages.slice(start, end).map((msg, i4) => { - const idx = start + i4; - const k = keys3[idx]; + messages.slice(start, end).map((msg, i3) => { + const idx = start + i3; + const k = keys2[idx]; const clickable = !!onItemClick && (isItemClickable?.(msg) ?? true); const hovered = clickable && hoveredKey === k; const expanded = isItemExpanded?.(msg); @@ -639280,27 +561846,27 @@ function StickyTracker({ const target = Math.max(0, (scrollRef.current?.getScrollTop() ?? 0) + (scrollRef.current?.getPendingDelta() ?? 0)); let firstVisible = start; let firstVisibleTop = -1; - for (let i4 = end - 1;i4 >= start; i4--) { - const top = getItemTop(i4); + for (let i3 = end - 1;i3 >= start; i3--) { + const top = getItemTop(i3); if (top >= 0) { if (top < target) break; firstVisibleTop = top; } - firstVisible = i4; + firstVisible = i3; } let idx = -1; - let text2 = null; + let text = null; if (firstVisible > 0 && !isSticky) { - for (let i4 = firstVisible - 1;i4 >= 0; i4--) { - const t = stickyPromptText(messages[i4]); + for (let i3 = firstVisible - 1;i3 >= 0; i3--) { + const t = stickyPromptText(messages[i3]); if (t === null) continue; - const top = getItemTop(i4); + const top = getItemTop(i3); if (top >= 0 && top + 1 >= target) continue; - idx = i4; - text2 = t; + idx = i3; + text = t; break; } } @@ -639324,11 +561890,11 @@ function StickyTracker({ if (!force && lastIdx.current === idx) return; lastIdx.current = idx; - if (text2 === null) { + if (text === null) { setStickyPrompt(null); return; } - const trimmed = text2.trimStart(); + const trimmed = text.trimStart(); const paraEnd = trimmed.search(/\n\s*\n/); const collapsed = (paraEnd >= 0 ? trimmed.slice(0, paraEnd) : trimmed).slice(0, STICKY_TEXT_CAP).replace(/\s+/g, " ").trim(); if (collapsed === "") { @@ -639427,8 +561993,8 @@ function dropTextInBriefTurns(messages, briefToolNames) { const turnsWithBrief = new Set; const textIndexToTurn = []; let turn = 0; - for (let i4 = 0;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = 0;i3 < messages.length; i3++) { + const msg = messages[i3]; const block2 = msg.message?.content[0]; if (msg.type === "user" && block2?.type !== "tool_result" && !msg.isMeta) { turn++; @@ -639436,7 +562002,7 @@ function dropTextInBriefTurns(messages, briefToolNames) { } if (msg.type === "assistant") { if (block2?.type === "text") { - textIndexToTurn[i4] = turn; + textIndexToTurn[i3] = turn; } else if (block2?.type === "tool_use" && block2.name && nameSet.has(block2.name)) { turnsWithBrief.add(turn); } @@ -639444,8 +562010,8 @@ function dropTextInBriefTurns(messages, briefToolNames) { } if (turnsWithBrief.size === 0) return messages; - return messages.filter((_, i4) => { - const t = textIndexToTurn[i4]; + return messages.filter((_, i3) => { + const t = textIndexToTurn[i3]; return t === undefined || !turnsWithBrief.has(t); }); } @@ -639506,7 +562072,7 @@ function shouldRenderStatically(message, streamingToolUseIDs, inProgressToolUseI if (hasUnresolvedHooksFromLookup(toolUseID, "PostToolUse", lookups)) { return false; } - return every3(siblingToolUseIDs, lookups.resolvedToolUseIDs); + return every2(siblingToolUseIDs, lookups.resolvedToolUseIDs); } case "system": { return message.subtype !== "api_error"; @@ -639577,8 +562143,8 @@ var import_compiler_runtime215, React84, import_react158, jsx_dev_runtime273, Lo return null; if (isStreamingThinkingVisible) return "streaming"; - for (let i4 = normalizedMessages.length - 1;i4 >= 0; i4--) { - const msg = normalizedMessages[i4]; + for (let i3 = normalizedMessages.length - 1;i3 >= 0; i3--) { + const msg = normalizedMessages[i3]; if (msg?.type === "assistant") { const content = msg.message.content; for (let j = content.length - 1;j >= 0; j--) { @@ -639602,8 +562168,8 @@ var import_compiler_runtime215, React84, import_react158, jsx_dev_runtime273, Lo const content_0 = msg_0.message.content; for (const block_0 of content_0) { if (block_0.type === "text") { - const text2 = block_0.text; - if (text2.startsWith(" { import_compiler_runtime215 = __toESM(require_compiler_runtime(), 1); init_bun_bundle(); @@ -639874,7 +562440,7 @@ var init_Messages = __esm(() => { init_envUtils(); init_fullscreen(); init_groupToolUses(); - init_messages5(); + init_messages3(); init_stringUtils(); init_transcriptSearch(); init_Divider(); @@ -639927,16 +562493,16 @@ var init_Messages = __esm(() => { proactiveModule4 = feature("PROACTIVE") || feature("KAIROS") ? (init_proactive(), __toCommonJS(exports_proactive)) : null; BRIEF_TOOL_NAME6 = feature("KAIROS") || feature("KAIROS_BRIEF") ? (init_prompt(), __toCommonJS(exports_prompt)).BRIEF_TOOL_NAME : null; SEND_USER_FILE_TOOL_NAME4 = feature("KAIROS") ? (init_prompt8(), __toCommonJS(exports_prompt3)).SEND_USER_FILE_TOOL_NAME : null; - Messages5 = React84.memo(MessagesImpl, (prev, next) => { - const keys3 = Object.keys(prev); - for (const key of keys3) { + Messages3 = React84.memo(MessagesImpl, (prev, next) => { + const keys2 = Object.keys(prev); + for (const key of keys2) { if (key === "onOpenRateLimitOptions" || key === "scrollRef" || key === "trackStickyPrompt" || key === "setCursor" || key === "cursorNavRef" || key === "jumpRef" || key === "onSearchMatchesChange" || key === "scanElement" || key === "setPositions") continue; if (prev[key] !== next[key]) { if (key === "streamingToolUses") { const p = prev.streamingToolUses; const n2 = next.streamingToolUses; - if (p.length === n2.length && p.every((item, i4) => item.contentBlock === n2[i4]?.contentBlock)) { + if (p.length === n2.length && p.every((item, i3) => item.contentBlock === n2[i3]?.contentBlock)) { continue; } } @@ -639955,7 +562521,7 @@ var init_Messages = __esm(() => { if (key === "tools") { const p = prev.tools; const n2 = next.tools; - if (p.length === n2.length && p.every((tool, i4) => tool.name === n2[i4]?.name)) { + if (p.length === n2.length && p.every((tool, i3) => tool.name === n2[i3]?.name)) { continue; } } @@ -639970,22 +562536,22 @@ var init_Messages = __esm(() => { function SessionPreview(t0) { const $2 = import_compiler_runtime216.c(33); const { - log: log2, + log, onExit: onExit2, onSelect } = t0; const [fullLog, setFullLog] = import_react159.default.useState(null); let t1; let t2; - if ($2[0] !== log2) { + if ($2[0] !== log) { t1 = () => { setFullLog(null); - if (isLiteLog(log2)) { - loadFullLog(log2).then(setFullLog); + if (isLiteLog(log)) { + loadFullLog(log).then(setFullLog); } }; - t2 = [log2]; - $2[0] = log2; + t2 = [log]; + $2[0] = log; $2[1] = t1; $2[2] = t2; } else { @@ -639993,8 +562559,8 @@ function SessionPreview(t0) { t2 = $2[2]; } import_react159.default.useEffect(t1, t2); - const isLoading = isLiteLog(log2) && fullLog === null; - const displayLog = fullLog ?? log2; + const isLoading = isLiteLog(log) && fullLog === null; + const displayLog = fullLog ?? log; let t3; if ($2[3] !== displayLog) { t3 = getSessionIdFromLog(displayLog) || ""; @@ -640023,12 +562589,12 @@ function SessionPreview(t0) { } useKeybinding("confirm:no", onExit2, t5); let t6; - if ($2[7] !== fullLog || $2[8] !== log2 || $2[9] !== onSelect) { + if ($2[7] !== fullLog || $2[8] !== log || $2[9] !== onSelect) { t6 = () => { - onSelect(fullLog ?? log2); + onSelect(fullLog ?? log); }; $2[7] = fullLog; - $2[8] = log2; + $2[8] = log; $2[9] = onSelect; $2[10] = t6; } else { @@ -640108,7 +562674,7 @@ function SessionPreview(t0) { } let t12; if ($2[18] !== conversationId || $2[19] !== displayLog.messages) { - t12 = /* @__PURE__ */ jsx_dev_runtime274.jsxDEV(Messages5, { + t12 = /* @__PURE__ */ jsx_dev_runtime274.jsxDEV(Messages3, { messages: displayLog.messages, tools, commands: t8, @@ -640269,7 +562835,7 @@ function TagTabs({ const tabWidths = tabs.map((tab) => getTabWidth(tab, maxSingleTabWidth)); let startIndex = 0; let endIndex = tabs.length; - const totalTabsWidth = tabWidths.reduce((sum3, w, i4) => sum3 + w + (i4 < tabWidths.length - 1 ? 1 : 0), 0); + const totalTabsWidth = tabWidths.reduce((sum2, w, i3) => sum2 + w + (i3 < tabWidths.length - 1 ? 1 : 0), 0); if (totalTabsWidth > maxTabsWidth) { const effectiveMaxWidth = maxTabsWidth - LEFT_ARROW_WIDTH; let windowWidth = tabWidths[safeSelectedIndex] ?? 0; @@ -640404,12 +562970,12 @@ function TreeSelect(t0) { t5 = $2[3]; } const isExpanded = t5; - let result3; + let result2; if ($2[4] !== isExpanded || $2[5] !== nodes) { let traverse = function(node, depth, parentId) { const hasChildren = !!node.children && node.children.length > 0; const nodeIsExpanded = isExpanded(node.id); - result3.push({ + result2.push({ node, depth, isExpanded: nodeIsExpanded, @@ -640422,17 +562988,17 @@ function TreeSelect(t0) { } } }; - result3 = []; + result2 = []; for (const node_0 of nodes) { traverse(node_0, 0); } $2[4] = isExpanded; $2[5] = nodes; - $2[6] = result3; + $2[6] = result2; } else { - result3 = $2[6]; + result2 = $2[6]; } - const flattenedNodes = result3; + const flattenedNodes = result2; const defaultGetParentPrefix = _temp130; const defaultGetChildPrefix = _temp250; const parentPrefixFn = getParentPrefix ?? defaultGetParentPrefix; @@ -640472,16 +563038,16 @@ function TreeSelect(t0) { t7 = $2[12]; } const options2 = t7; - let map7; + let map5; if ($2[13] !== flattenedNodes) { - map7 = new Map; - flattenedNodes.forEach((fn) => map7.set(fn.node.id, fn.node)); + map5 = new Map; + flattenedNodes.forEach((fn) => map5.set(fn.node.id, fn.node)); $2[13] = flattenedNodes; - $2[14] = map7; + $2[14] = map5; } else { - map7 = $2[14]; + map5 = $2[14]; } - const nodeMap = map7; + const nodeMap = map5; let t8; if ($2[15] !== flattenedNodes) { t8 = (nodeId_0) => flattenedNodes.find((fn_0) => fn_0.node.id === nodeId_0); @@ -640670,34 +563236,34 @@ var init_TreeSelect = __esm(() => { }); // src/components/LogSelector.tsx -function normalizeAndTruncateToWidth(text2, maxWidth) { - const normalized = text2.replace(/\s+/g, " ").trim(); +function normalizeAndTruncateToWidth(text, maxWidth) { + const normalized = text.replace(/\s+/g, " ").trim(); return truncateToWidth(normalized, maxWidth); } function formatSnippet({ - before: before3, + before: before2, match, - after: after3 + after: after2 }, highlightColor) { - return source_default.dim(before3) + highlightColor(match) + source_default.dim(after3); + return source_default.dim(before2) + highlightColor(match) + source_default.dim(after2); } -function extractSnippet(text2, query2, contextChars) { - const matchIndex = text2.toLowerCase().indexOf(query2.toLowerCase()); +function extractSnippet(text, query2, contextChars) { + const matchIndex = text.toLowerCase().indexOf(query2.toLowerCase()); if (matchIndex === -1) return null; const matchEnd = matchIndex + query2.length; const snippetStart = Math.max(0, matchIndex - contextChars); - const snippetEnd = Math.min(text2.length, matchEnd + contextChars); - const beforeRaw = text2.slice(snippetStart, matchIndex); - const matchText = text2.slice(matchIndex, matchEnd); - const afterRaw = text2.slice(matchEnd, snippetEnd); + const snippetEnd = Math.min(text.length, matchEnd + contextChars); + const beforeRaw = text.slice(snippetStart, matchIndex); + const matchText = text.slice(matchIndex, matchEnd); + const afterRaw = text.slice(matchEnd, snippetEnd); return { before: (snippetStart > 0 ? "…" : "") + beforeRaw.replace(/\s+/g, " ").trimStart(), match: matchText.trim(), - after: afterRaw.replace(/\s+/g, " ").trimEnd() + (snippetEnd < text2.length ? "…" : "") + after: afterRaw.replace(/\s+/g, " ").trimEnd() + (snippetEnd < text.length ? "…" : "") }; } -function buildLogLabel(log2, maxLabelWidth, options2) { +function buildLogLabel(log, maxLabelWidth, options2) { const { isGroupHeader = false, isChild = false, @@ -640705,19 +563271,19 @@ function buildLogLabel(log2, maxLabelWidth, options2) { } = options2 || {}; const prefixWidth = isGroupHeader && forkCount > 0 ? PARENT_PREFIX_WIDTH : isChild ? CHILD_PREFIX_WIDTH : 0; const sessionCountSuffix = isGroupHeader && forkCount > 0 ? ` (+${forkCount} other ${forkCount === 1 ? "session" : "sessions"})` : ""; - const sidechainSuffix = log2.isSidechain ? " (sidechain)" : ""; + const sidechainSuffix = log.isSidechain ? " (sidechain)" : ""; const maxSummaryWidth = maxLabelWidth - prefixWidth - sidechainSuffix.length - sessionCountSuffix.length; - const truncatedSummary = normalizeAndTruncateToWidth(getLogDisplayTitle(log2), maxSummaryWidth); + const truncatedSummary = normalizeAndTruncateToWidth(getLogDisplayTitle(log), maxSummaryWidth); return `${truncatedSummary}${sidechainSuffix}${sessionCountSuffix}`; } -function buildLogMetadata(log2, options2) { +function buildLogMetadata(log, options2) { const { isChild = false, showProjectPath = false } = options2 || {}; const childPadding = isChild ? " " : ""; - const baseMetadata2 = formatLogMetadata(log2); - const projectSuffix = showProjectPath && log2.projectPath ? ` · ${log2.projectPath}` : ""; + const baseMetadata2 = formatLogMetadata(log); + const projectSuffix = showProjectPath && log.projectPath ? ` · ${log.projectPath}` : ""; return childPadding + baseMetadata2 + projectSuffix; } function LogSelector(t0) { @@ -640762,7 +563328,7 @@ function LogSelector(t0) { const theme = t4; let t5; if ($2[3] !== theme.warning) { - t5 = (text2) => applyColor(text2, theme.warning); + t5 = (text) => applyColor(text, theme.warning); $2[3] = theme.warning; $2[4] = t5; } else { @@ -641066,11 +563632,11 @@ function LogSelector(t0) { snippetMap = new Map; filtered_0 = titleFilteredLogs; if (deepSearchResults && debouncedDeepSearchQuery && deepSearchResults.query === debouncedDeepSearchQuery) { - for (const result3 of deepSearchResults.results) { - if (result3.searchableText) { - const snippet = extractSnippet(result3.searchableText, debouncedDeepSearchQuery, SNIPPET_CONTEXT_CHARS); + for (const result2 of deepSearchResults.results) { + if (result2.searchableText) { + const snippet = extractSnippet(result2.searchableText, debouncedDeepSearchQuery, SNIPPET_CONTEXT_CHARS); if (snippet) { - snippetMap.set(result3.log, snippet); + snippetMap.set(result2.log, snippet); } } } @@ -641398,13 +563964,13 @@ function LogSelector(t0) { results_count: results_0.length }); } catch (t362) { - const error46 = t362; + const error42 = t362; if (abortController.signal.aborted) { return; } setAgenticSearchState({ status: "error", - message: error46 instanceof Error ? error46.message : "Search failed" + message: error42 instanceof Error ? error42.message : "Search failed" }); logEvent("tengu_agentic_search_error", { query_length: searchQuery.length @@ -641621,7 +564187,7 @@ function LogSelector(t0) { useKeybinding("confirm:no", t50, t52); let t53; if ($2[131] !== agenticSearchState.status || $2[132] !== branchFilterEnabled || $2[133] !== focusedLog || $2[134] !== handleAgenticSearch || $2[135] !== hasMultipleWorktrees || $2[136] !== hasTags || $2[137] !== isAgenticSearchOptionFocused || $2[138] !== onAgenticSearch || $2[139] !== onToggleAllProjects || $2[140] !== searchQuery || $2[141] !== setSearchQuery || $2[142] !== showAllProjects || $2[143] !== showAllWorktrees || $2[144] !== tagTabs || $2[145] !== uniqueTags || $2[146] !== viewMode) { - t53 = (input11, key) => { + t53 = (input, key) => { if (viewMode === "preview") { return; } @@ -641630,7 +564196,7 @@ function LogSelector(t0) { } if (viewMode === "rename") {} else { if (viewMode === "search") { - if (input11.toLowerCase() === "n" && key.ctrl) { + if (input.toLowerCase() === "n" && key.ctrl) { exitSearchMode(); } else { if (key.return || key.downArrow) { @@ -641671,7 +564237,7 @@ function LogSelector(t0) { return; } const keyIsNotCtrlOrMeta = !key.ctrl && !key.meta; - const lowerInput = input11.toLowerCase(); + const lowerInput = input.toLowerCase(); if (lowerInput === "a" && key.ctrl && onToggleAllProjects) { onToggleAllProjects(); logEvent("tengu_session_all_projects_toggled", { @@ -641710,9 +564276,9 @@ function LogSelector(t0) { messageCount: focusedLog.messageCount }); } else { - if (focusedLog && keyIsNotCtrlOrMeta && input11.length > 0 && !/^\s+$/.test(input11)) { + if (focusedLog && keyIsNotCtrlOrMeta && input.length > 0 && !/^\s+$/.test(input)) { setViewMode("search"); - setSearchQuery(input11); + setSearchQuery(input); logEvent("tengu_session_search_toggled", { enabled: true }); @@ -642351,8 +564917,8 @@ function _temp251(log_1) { } return false; } -function _temp131(log2) { - return [log2, buildSearchableText(log2)]; +function _temp131(log) { + return [log, buildSearchableText(log)]; } function extractSearchableText(message) { if (message.type !== "user" && message.type !== "assistant") { @@ -642375,23 +564941,23 @@ function extractSearchableText(message) { } return ""; } -function buildSearchableText(log2) { - const searchableMessages = log2.messages.length <= DEEP_SEARCH_MAX_MESSAGES ? log2.messages : [...log2.messages.slice(0, DEEP_SEARCH_CROP_SIZE), ...log2.messages.slice(-DEEP_SEARCH_CROP_SIZE)]; +function buildSearchableText(log) { + const searchableMessages = log.messages.length <= DEEP_SEARCH_MAX_MESSAGES ? log.messages : [...log.messages.slice(0, DEEP_SEARCH_CROP_SIZE), ...log.messages.slice(-DEEP_SEARCH_CROP_SIZE)]; const messageText = searchableMessages.map(extractSearchableText).filter(Boolean).join(" "); - const metadata = [log2.customTitle, log2.summary, log2.firstPrompt, log2.gitBranch, log2.tag, log2.prNumber ? `PR #${log2.prNumber}` : undefined, log2.prRepository].filter(Boolean).join(" "); + const metadata = [log.customTitle, log.summary, log.firstPrompt, log.gitBranch, log.tag, log.prNumber ? `PR #${log.prNumber}` : undefined, log.prRepository].filter(Boolean).join(" "); const fullText = `${metadata} ${messageText}`.trim(); return fullText.length > DEEP_SEARCH_MAX_TEXT_LENGTH ? fullText.slice(0, DEEP_SEARCH_MAX_TEXT_LENGTH) : fullText; } function groupLogsBySessionId(filteredLogs) { const groups = new Map; - for (const log2 of filteredLogs) { - const sessionId = getSessionIdFromLog(log2); + for (const log of filteredLogs) { + const sessionId = getSessionIdFromLog(log); if (sessionId) { const existing = groups.get(sessionId); if (existing) { - existing.push(log2); + existing.push(log); } else { - groups.set(sessionId, [log2]); + groups.set(sessionId, [log]); } } } @@ -642400,9 +564966,9 @@ function groupLogsBySessionId(filteredLogs) { } function getUniqueTags(logs2) { const tags = new Set; - for (const log2 of logs2) { - if (log2.tag) { - tags.add(log2.tag); + for (const log of logs2) { + if (log.tag) { + tags.add(log.tag); } } return Array.from(tags).sort((a2, b) => a2.localeCompare(b)); @@ -642471,25 +565037,25 @@ function extractTranscript(messages) { ...messages.slice(0, MAX_MESSAGES_TO_SCAN / 2), ...messages.slice(-MAX_MESSAGES_TO_SCAN / 2) ]; - const text2 = messagesToScan.map(extractMessageText).filter(Boolean).join(" ").replace(/\s+/g, " ").trim(); - return text2.length > MAX_TRANSCRIPT_CHARS ? text2.slice(0, MAX_TRANSCRIPT_CHARS) + "…" : text2; + const text = messagesToScan.map(extractMessageText).filter(Boolean).join(" ").replace(/\s+/g, " ").trim(); + return text.length > MAX_TRANSCRIPT_CHARS ? text.slice(0, MAX_TRANSCRIPT_CHARS) + "…" : text; } -function logContainsQuery(log2, queryLower) { - const title = getLogDisplayTitle(log2).toLowerCase(); +function logContainsQuery(log, queryLower) { + const title = getLogDisplayTitle(log).toLowerCase(); if (title.includes(queryLower)) return true; - if (log2.customTitle?.toLowerCase().includes(queryLower)) + if (log.customTitle?.toLowerCase().includes(queryLower)) return true; - if (log2.tag?.toLowerCase().includes(queryLower)) + if (log.tag?.toLowerCase().includes(queryLower)) return true; - if (log2.gitBranch?.toLowerCase().includes(queryLower)) + if (log.gitBranch?.toLowerCase().includes(queryLower)) return true; - if (log2.summary?.toLowerCase().includes(queryLower)) + if (log.summary?.toLowerCase().includes(queryLower)) return true; - if (log2.firstPrompt?.toLowerCase().includes(queryLower)) + if (log.firstPrompt?.toLowerCase().includes(queryLower)) return true; - if (log2.messages && log2.messages.length > 0) { - const transcript = extractTranscript(log2.messages).toLowerCase(); + if (log.messages && log.messages.length > 0) { + const transcript = extractTranscript(log.messages).toLowerCase(); if (transcript.includes(queryLower)) return true; } @@ -642500,12 +565066,12 @@ async function agenticSessionSearch(query2, logs2, signal) { return []; } const queryLower = query2.toLowerCase(); - const matchingLogs = logs2.filter((log2) => logContainsQuery(log2, queryLower)); + const matchingLogs = logs2.filter((log) => logContainsQuery(log, queryLower)); let logsToSearch; if (matchingLogs.length >= MAX_SESSIONS_TO_SEARCH) { logsToSearch = matchingLogs.slice(0, MAX_SESSIONS_TO_SEARCH); } else { - const nonMatchingLogs = logs2.filter((log2) => !logContainsQuery(log2, queryLower)); + const nonMatchingLogs = logs2.filter((log) => !logContainsQuery(log, queryLower)); const remainingSlots = MAX_SESSIONS_TO_SEARCH - matchingLogs.length; logsToSearch = [ ...matchingLogs, @@ -642513,40 +565079,40 @@ async function agenticSessionSearch(query2, logs2, signal) { ]; } logForDebugging(`Agentic search: ${logsToSearch.length}/${logs2.length} logs, query="${query2}", ` + `matching: ${matchingLogs.length}, with messages: ${count2(logsToSearch, (l) => l.messages?.length > 0)}`); - const logsWithTranscriptsPromises = logsToSearch.map(async (log2) => { - if (isLiteLog(log2)) { + const logsWithTranscriptsPromises = logsToSearch.map(async (log) => { + if (isLiteLog(log)) { try { - return await loadFullLog(log2); - } catch (error46) { - logError2(error46); - return log2; + return await loadFullLog(log); + } catch (error42) { + logError2(error42); + return log; } } - return log2; + return log; }); const logsWithTranscripts = await Promise.all(logsWithTranscriptsPromises); logForDebugging(`Agentic search: loaded ${count2(logsWithTranscripts, (l) => l.messages?.length > 0)}/${logsToSearch.length} logs with transcripts`); - const sessionList = logsWithTranscripts.map((log2, index) => { + const sessionList = logsWithTranscripts.map((log, index) => { const parts = [`${index}:`]; - const displayTitle = getLogDisplayTitle(log2); + const displayTitle = getLogDisplayTitle(log); parts.push(displayTitle); - if (log2.customTitle && log2.customTitle !== displayTitle) { - parts.push(`[custom title: ${log2.customTitle}]`); + if (log.customTitle && log.customTitle !== displayTitle) { + parts.push(`[custom title: ${log.customTitle}]`); } - if (log2.tag) { - parts.push(`[tag: ${log2.tag}]`); + if (log.tag) { + parts.push(`[tag: ${log.tag}]`); } - if (log2.gitBranch) { - parts.push(`[branch: ${log2.gitBranch}]`); + if (log.gitBranch) { + parts.push(`[branch: ${log.gitBranch}]`); } - if (log2.summary) { - parts.push(`- Summary: ${log2.summary}`); + if (log.summary) { + parts.push(`- Summary: ${log.summary}`); } - if (log2.firstPrompt && log2.firstPrompt !== "No prompt") { - parts.push(`- First message: ${log2.firstPrompt.slice(0, 300)}`); + if (log.firstPrompt && log.firstPrompt !== "No prompt") { + parts.push(`- First message: ${log.firstPrompt.slice(0, 300)}`); } - if (log2.messages && log2.messages.length > 0) { - const transcript = extractTranscript(log2.messages); + if (log.messages && log.messages.length > 0) { + const transcript = extractTranscript(log.messages); if (transcript) { parts.push(`- Transcript: ${transcript}`); } @@ -642582,14 +565148,14 @@ Find the sessions that are most relevant to this query.`; logForDebugging("Could not find JSON in agentic search response"); return []; } - const result3 = jsonParse(jsonMatch[0]); - const relevantIndices = result3.relevant_indices || []; + const result2 = jsonParse(jsonMatch[0]); + const relevantIndices = result2.relevant_indices || []; const relevantLogs = relevantIndices.filter((index) => index >= 0 && index < logsWithTranscripts.length).map((index) => logsWithTranscripts[index]); logForDebugging(`Agentic search found ${relevantLogs.length} relevant sessions`); return relevantLogs; - } catch (error46) { - logError2(error46); - logForDebugging(`Agentic search error: ${error46}`); + } catch (error42) { + logError2(error42); + logForDebugging(`Agentic search error: ${error42}`); return []; } } @@ -642637,37 +565203,37 @@ var init_agenticSessionSearch = __esm(() => { }); // src/utils/crossProjectResume.ts -import { sep as sep34 } from "path"; -function checkCrossProjectResume(log2, showAllProjects, worktreePaths) { +import { sep as sep31 } from "path"; +function checkCrossProjectResume(log, showAllProjects, worktreePaths) { const currentCwd2 = getOriginalCwd(); - if (!showAllProjects || !log2.projectPath || log2.projectPath === currentCwd2) { + if (!showAllProjects || !log.projectPath || log.projectPath === currentCwd2) { return { isCrossProject: false }; } if (process.env.USER_TYPE !== "ant") { - const sessionId2 = getSessionIdFromLog(log2); - const command6 = `cd ${quote([log2.projectPath])} && claude --resume ${sessionId2}`; + const sessionId2 = getSessionIdFromLog(log); + const command6 = `cd ${quote([log.projectPath])} && claude --resume ${sessionId2}`; return { isCrossProject: true, isSameRepoWorktree: false, command: command6, - projectPath: log2.projectPath + projectPath: log.projectPath }; } - const isSameRepo = worktreePaths.some((wt) => log2.projectPath === wt || log2.projectPath.startsWith(wt + sep34)); + const isSameRepo = worktreePaths.some((wt) => log.projectPath === wt || log.projectPath.startsWith(wt + sep31)); if (isSameRepo) { return { isCrossProject: true, isSameRepoWorktree: true, - projectPath: log2.projectPath + projectPath: log.projectPath }; } - const sessionId = getSessionIdFromLog(log2); - const command5 = `cd ${quote([log2.projectPath])} && claude --resume ${sessionId}`; + const sessionId = getSessionIdFromLog(log); + const command5 = `cd ${quote([log.projectPath])} && claude --resume ${sessionId}`; return { isCrossProject: true, isSameRepoWorktree: false, command: command5, - projectPath: log2.projectPath + projectPath: log.projectPath }; } var init_crossProjectResume = __esm(() => { @@ -642682,12 +565248,12 @@ __export(exports_resume, { filterResumableSessions: () => filterResumableSessions, call: () => call30 }); -function resumeHelpMessage(result3) { - switch (result3.resultType) { +function resumeHelpMessage(result2) { + switch (result2.resultType) { case "sessionNotFound": - return `Session ${source_default.bold(result3.arg)} was not found.`; + return `Session ${source_default.bold(result2.arg)} was not found.`; case "multipleMatches": - return `Found ${result3.count} sessions matching ${source_default.bold(result3.arg)}. Please use /resume to pick a specific session.`; + return `Found ${result2.count} sessions matching ${source_default.bold(result2.arg)}. Please use /resume to pick a specific session.`; } } function ResumeError(t0) { @@ -642787,25 +565353,25 @@ function ResumeCommand({ } }, [onDone]); React88.useEffect(() => { - async function init2() { + async function init() { const paths_0 = await getWorktreePaths(getOriginalCwd()); setWorktreePaths(paths_0); loadLogs(false, paths_0); } - init2(); + init(); }, [loadLogs]); const handleToggleAllProjects = React88.useCallback(() => { const newValue = !showAllProjects; setShowAllProjects(newValue); loadLogs(newValue, worktreePaths); }, [showAllProjects, loadLogs, worktreePaths]); - async function handleSelect(log2) { - const sessionId = validateUuid2(getSessionIdFromLog(log2)); + async function handleSelect(log) { + const sessionId = validateUuid2(getSessionIdFromLog(log)); if (!sessionId) { onDone("Failed to resume conversation"); return; } - const fullLog = isLiteLog(log2) ? await loadFullLog(log2) : log2; + const fullLog = isLiteLog(log) ? await loadFullLog(log) : log; const crossProjectCheck = checkCrossProjectResume(fullLog, showAllProjects, worktreePaths); if (crossProjectCheck.isCrossProject) { if (crossProjectCheck.isSameRepoWorktree) { @@ -642866,15 +565432,15 @@ function filterResumableSessions(logs2, currentSessionId) { return logs2.filter((l) => !l.isSidechain && getSessionIdFromLog(l) !== currentSessionId); } var import_compiler_runtime219, React88, jsx_dev_runtime278, call30 = async (onDone, context2, args) => { - const onResume = async (sessionId, log2, entrypoint) => { + const onResume = async (sessionId, log, entrypoint) => { try { - await context2.resume?.(sessionId, log2, entrypoint); + await context2.resume?.(sessionId, log, entrypoint); onDone(undefined, { display: "skip" }); - } catch (error46) { - logError2(error46); - onDone(`Failed to resume: ${error46.message}`); + } catch (error42) { + logError2(error42); + onDone(`Failed to resume: ${error42.message}`); } }; const arg = args?.trim(); @@ -642898,8 +565464,8 @@ var import_compiler_runtime219, React88, jsx_dev_runtime278, call30 = async (onD if (maybeSessionId) { const matchingLogs = logs2.filter((l) => getSessionIdFromLog(l) === maybeSessionId).sort((a2, b) => b.modified.getTime() - a2.modified.getTime()); if (matchingLogs.length > 0) { - const log2 = matchingLogs[0]; - const fullLog = isLiteLog(log2) ? await loadFullLog(log2) : log2; + const log = matchingLogs[0]; + const fullLog = isLiteLog(log) ? await loadFullLog(log) : log; onResume(maybeSessionId, fullLog, "slash_command_session_id"); return null; } @@ -642914,10 +565480,10 @@ var import_compiler_runtime219, React88, jsx_dev_runtime278, call30 = async (onD exact: true }); if (titleMatches.length === 1) { - const log2 = titleMatches[0]; - const sessionId = getSessionIdFromLog(log2); + const log = titleMatches[0]; + const sessionId = getSessionIdFromLog(log); if (sessionId) { - const fullLog = isLiteLog(log2) ? await loadFullLog(log2) : log2; + const fullLog = isLiteLog(log) ? await loadFullLog(log) : log; onResume(sessionId, fullLog, "slash_command_title"); return null; } @@ -642963,7 +565529,7 @@ var init_resume = __esm(() => { init_getWorktreePaths(); init_log3(); init_sessionStorage(); - init_uuid2(); + init_uuid(); jsx_dev_runtime278 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -643004,15 +565570,15 @@ async function fetchUltrareviewQuota() { timeout: 5000 }); return response.data; - } catch (error46) { - logForDebugging(`fetchUltrareviewQuota failed: ${error46}`); + } catch (error42) { + logForDebugging(`fetchUltrareviewQuota failed: ${error42}`); return null; } } var init_ultrareviewQuota = __esm(() => { init_axios2(); init_oauth(); - init_auth2(); + init_auth(); init_debug(); init_api2(); }); @@ -643086,13 +565652,13 @@ ${reasons}` const isPrNumber = /^\d+$/.test(prNumber); const CODE_REVIEW_ENV_ID = "env_011111111111111111111113"; const raw = getFeatureValue_CACHED_MAY_BE_STALE("tengu_review_bughunter_config", null); - const posInt = (v, fallback, max5) => { + const posInt = (v, fallback, max3) => { if (typeof v !== "number" || !Number.isFinite(v)) return fallback; const n2 = Math.floor(v); if (n2 <= 0) return fallback; - return max5 !== undefined && n2 > max5 ? fallback : n2; + return max3 !== undefined && n2 > max3 ? fallback : n2; }; const commonEnvVars = { BUGHUNTER_DRY_RUN: "1", @@ -643200,7 +565766,7 @@ var init_reviewRemote = __esm(() => { init_ultrareviewQuota(); init_usage(); init_RemoteAgentTask(); - init_auth2(); + init_auth(); init_detectRepository(); init_execFileNoThrow(); init_git(); @@ -643335,11 +565901,11 @@ function contentBlocksToString(blocks) { `); } async function launchAndDone(args, context2, onDone, billingNote, signal) { - const result3 = await launchRemoteReview(args, context2, billingNote); + const result2 = await launchRemoteReview(args, context2, billingNote); if (signal?.aborted) return; - if (result3) { - onDone(contentBlocksToString(result3), { + if (result2) { + onDone(contentBlocksToString(result2), { shouldQuery: true }); } else { @@ -643592,10 +566158,10 @@ function SessionInfo(t0) { } return t9; } -function _temp428(line_0, i4) { +function _temp428(line_0, i3) { return /* @__PURE__ */ jsx_dev_runtime281.jsxDEV(ThemedText, { children: line_0 - }, i4, false, undefined, this); + }, i3, false, undefined, this); } function _temp334(line) { return line.length > 0; @@ -644123,7 +566689,7 @@ __export(exports_types, { BRIDGE_LOGIN_ERROR: () => BRIDGE_LOGIN_ERROR }); var DEFAULT_SESSION_TIMEOUT_MS, BRIDGE_LOGIN_INSTRUCTION = "Remote Control is only available with claude.ai subscriptions. Please use `/login` to sign in with your claude.ai account.", BRIDGE_LOGIN_ERROR, REMOTE_CONTROL_DISCONNECTED_MSG = "Remote Control disconnected."; -var init_types16 = __esm(() => { +var init_types15 = __esm(() => { DEFAULT_SESSION_TIMEOUT_MS = 24 * 60 * 60 * 1000; BRIDGE_LOGIN_ERROR = `Error: You must be logged in to use Remote Control. @@ -644173,8 +566739,8 @@ class ExitPlanModeScanner { this.rescanAfterRejection = false; let found = null; if (shouldScan) { - for (let i4 = this.exitPlanCalls.length - 1;i4 >= 0; i4--) { - const id = this.exitPlanCalls[i4]; + for (let i3 = this.exitPlanCalls.length - 1;i3 >= 0; i3--) { + const id = this.exitPlanCalls[i3]; if (this.rejectedIds.has(id)) continue; const tr = this.results.get(id); @@ -644231,31 +566797,31 @@ async function pollForApprovedExitPlanMode(sessionId, timeoutMs, onPhaseChange, if (!transient || ++failures >= MAX_CONSECUTIVE_FAILURES) { throw new UltraplanPollError(e instanceof Error ? e.message : String(e), "network_or_unknown", scanner.rejectCount, { cause: e }); } - await sleep4(POLL_INTERVAL_MS2); + await sleep2(POLL_INTERVAL_MS2); continue; } - let result3; + let result2; try { - result3 = scanner.ingest(newEvents); + result2 = scanner.ingest(newEvents); } catch (e) { throw new UltraplanPollError(e instanceof Error ? e.message : String(e), "extract_marker_missing", scanner.rejectCount); } - if (result3.kind === "approved") { + if (result2.kind === "approved") { return { - plan: result3.plan, + plan: result2.plan, rejectCount: scanner.rejectCount, executionTarget: "remote" }; } - if (result3.kind === "teleport") { + if (result2.kind === "teleport") { return { - plan: result3.plan, + plan: result2.plan, rejectCount: scanner.rejectCount, executionTarget: "local" }; } - if (result3.kind === "terminated") { - throw new UltraplanPollError(`remote session ended (${result3.subtype}) before plan approval`, "terminated", scanner.rejectCount); + if (result2.kind === "terminated") { + throw new UltraplanPollError(`remote session ended (${result2.subtype}) before plan approval`, "terminated", scanner.rejectCount); } const quietIdle = (sessionStatus === "idle" || sessionStatus === "requires_action") && newEvents.length === 0; const phase = scanner.hasPendingPlan ? "plan_ready" : quietIdle ? "needs_input" : "running"; @@ -644264,7 +566830,7 @@ async function pollForApprovedExitPlanMode(sessionId, timeoutMs, onPhaseChange, lastPhase = phase; onPhaseChange?.(phase); } - await sleep4(POLL_INTERVAL_MS2); + await sleep2(POLL_INTERVAL_MS2); } throw new UltraplanPollError(scanner.everSeenPending ? `no approval after ${timeoutMs / 1000}s` : `ExitPlanMode never reached after ${timeoutMs / 1000}s (the remote container failed to start, or session ID mismatch?)`, scanner.everSeenPending ? "timeout_pending" : "timeout_no_plan", scanner.rejectCount); } @@ -644272,16 +566838,16 @@ function contentToText(content) { return typeof content === "string" ? content : Array.isArray(content) ? content.map((b) => ("text" in b) ? b.text : "").join("") : ""; } function extractTeleportPlan(content) { - const text2 = contentToText(content); + const text = contentToText(content); const marker = `${ULTRAPLAN_TELEPORT_SENTINEL} `; - const idx = text2.indexOf(marker); + const idx = text.indexOf(marker); if (idx === -1) return null; - return text2.slice(idx + marker.length).trimEnd(); + return text.slice(idx + marker.length).trimEnd(); } function extractApprovedPlan(content) { - const text2 = contentToText(content); + const text = contentToText(content); const markers = [ `## Approved Plan (edited by user): `, @@ -644289,12 +566855,12 @@ function extractApprovedPlan(content) { ` ]; for (const marker of markers) { - const idx = text2.indexOf(marker); + const idx = text.indexOf(marker); if (idx !== -1) { - return text2.slice(idx + marker.length).trimEnd(); + return text.slice(idx + marker.length).trimEnd(); } } - throw new Error(`ExitPlanMode approved but tool_result has no "## Approved Plan:" marker — remote may have hit the empty-plan or isAgent branch. Content preview: ${text2.slice(0, 200)}`); + throw new Error(`ExitPlanMode approved but tool_result has no "## Approved Plan:" marker — remote may have hit the empty-plan or isAgent branch. Content preview: ${text.slice(0, 200)}`); } var POLL_INTERVAL_MS2 = 3000, MAX_CONSECUTIVE_FAILURES = 5, UltraplanPollError, ULTRAPLAN_TELEPORT_SENTINEL = "__ULTRAPLAN_TELEPORT_LOCAL__"; var init_ccrSession = __esm(() => { @@ -644610,7 +567176,7 @@ ${reasons}`, mode: "task-notification" }); if (sessionId) { - archiveRemoteSession(sessionId).catch((err3) => logForDebugging("ultraplan: failed to archive orphaned session", err3)); + archiveRemoteSession(sessionId).catch((err2) => logForDebugging("ultraplan: failed to archive orphaned session", err2)); setAppState((prev) => prev.ultraplanSessionUrl ? { ...prev, ultraplanSessionUrl: undefined @@ -644662,7 +567228,7 @@ var ULTRAPLAN_TIMEOUT_MS, CCR_TERMS_URL2 = "https://code.claude.com/docs/en/clau return null; }, ultraplan_default; var init_ultraplan = __esm(() => { - init_types16(); + init_types15(); init_figures2(); init_growthbook(); init_analytics(); @@ -645023,14 +567589,14 @@ function AsyncAgentDetailDialog(t0) { dimColor: true, children: "Progress" }, undefined, false, undefined, this), - agent.progress.recentActivities.map((activity, i4) => /* @__PURE__ */ jsx_dev_runtime286.jsxDEV(ThemedText, { - dimColor: i4 < agent.progress.recentActivities.length - 1, + agent.progress.recentActivities.map((activity, i3) => /* @__PURE__ */ jsx_dev_runtime286.jsxDEV(ThemedText, { + dimColor: i3 < agent.progress.recentActivities.length - 1, wrap: "truncate-end", children: [ - i4 === agent.progress.recentActivities.length - 1 ? "› " : " ", + i3 === agent.progress.recentActivities.length - 1 ? "› " : " ", renderToolActivity(activity, tools, theme) ] - }, i4, true, undefined, this)) + }, i3, true, undefined, this)) ] }, undefined, true, undefined, this); $2[31] = agent.progress; @@ -645155,7 +567721,7 @@ var init_AsyncAgentDetailDialog = __esm(() => { init_Tool(); init_tools2(); init_format(); - init_messages5(); + init_messages3(); init_Byline(); init_Dialog(); init_KeyboardShortcutHint(); @@ -645187,14 +567753,14 @@ function formatReviewStageCounts(stage, found, verified, refuted) { function RainbowText(t0) { const $2 = import_compiler_runtime224.c(5); const { - text: text2, + text, phase: t1 } = t0; const phase = t1 === undefined ? 0 : t1; let t2; - if ($2[0] !== text2) { - t2 = [...text2]; - $2[0] = text2; + if ($2[0] !== text) { + t2 = [...text]; + $2[0] = text; $2[1] = t2; } else { t2 = $2[1]; @@ -645202,10 +567768,10 @@ function RainbowText(t0) { let t3; if ($2[2] !== phase || $2[3] !== t2) { t3 = /* @__PURE__ */ jsx_dev_runtime287.jsxDEV(jsx_dev_runtime287.Fragment, { - children: t2.map((ch2, i4) => /* @__PURE__ */ jsx_dev_runtime287.jsxDEV(ThemedText, { - color: getRainbowColor(i4 + phase), + children: t2.map((ch2, i3) => /* @__PURE__ */ jsx_dev_runtime287.jsxDEV(ThemedText, { + color: getRainbowColor(i3 + phase), children: ch2 - }, i4, false, undefined, this)) + }, i3, false, undefined, this)) }, undefined, false, undefined, this); $2[2] = phase; $2[3] = t2; @@ -645315,7 +567881,7 @@ function ReviewRainbowLine(t0) { } else { t1 = $2[6]; } - const tail3 = t1; + const tail2 = t1; let t2; if ($2[7] === Symbol.for("react.memo_cache_sentinel")) { t2 = /* @__PURE__ */ jsx_dev_runtime287.jsxDEV(ThemedText, { @@ -645342,15 +567908,15 @@ function ReviewRainbowLine(t0) { t4 = $2[9]; } let t5; - if ($2[10] !== tail3) { + if ($2[10] !== tail2) { t5 = /* @__PURE__ */ jsx_dev_runtime287.jsxDEV(ThemedText, { dimColor: true, children: [ " · ", - tail3 + tail2 ] }, undefined, true, undefined, this); - $2[10] = tail3; + $2[10] = tail2; $2[11] = t5; } else { t5 = $2[11]; @@ -646329,7 +568895,7 @@ function DreamDetailDialog(t0) { } return t19; } -function _temp256(turn, i4) { +function _temp256(turn, i3) { return /* @__PURE__ */ jsx_dev_runtime290.jsxDEV(ThemedBox_default, { flexDirection: "column", children: [ @@ -646349,7 +568915,7 @@ function _temp256(turn, i4) { ] }, undefined, true, undefined, this) ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } function _temp138(t) { return t.text !== ""; @@ -646635,14 +569201,14 @@ function InProcessTeammateDetailDialog(t0) { dimColor: true, children: "Progress" }, undefined, false, undefined, this), - teammate.progress.recentActivities.map((activity_0, i4) => /* @__PURE__ */ jsx_dev_runtime291.jsxDEV(ThemedText, { - dimColor: i4 < teammate.progress.recentActivities.length - 1, + teammate.progress.recentActivities.map((activity_0, i3) => /* @__PURE__ */ jsx_dev_runtime291.jsxDEV(ThemedText, { + dimColor: i3 < teammate.progress.recentActivities.length - 1, wrap: "truncate-end", children: [ - i4 === teammate.progress.recentActivities.length - 1 ? "› " : " ", + i3 === teammate.progress.recentActivities.length - 1 ? "› " : " ", renderToolActivity(activity_0, tools, theme) ] - }, i4, true, undefined, this)) + }, i3, true, undefined, this)) ] }, undefined, true, undefined, this); $2[42] = teammate.progress; @@ -646889,7 +569455,7 @@ function toSDKMessages(messages) { } }); } -function localCommandOutputToSDKAssistantMessage(rawContent, uuid8) { +function localCommandOutputToSDKAssistantMessage(rawContent, uuid5) { const cleanContent = stripAnsi(rawContent).replace(/([\s\S]*?)<\/local-command-stdout>/, "$1").replace(/([\s\S]*?)<\/local-command-stderr>/, "$1").trim(); const synthetic = createAssistantMessage({ content: cleanContent }); return { @@ -646897,7 +569463,7 @@ function localCommandOutputToSDKAssistantMessage(rawContent, uuid8) { message: synthetic.message, parent_tool_use_id: null, session_id: getSessionId(), - uuid: uuid8 + uuid: uuid5 }; } function toSDKRateLimitInfo(limits) { @@ -646959,19 +569525,19 @@ var init_mappers = __esm(() => { init_state(); init_xml(); init_strip_ansi(); - init_messages5(); + init_messages3(); init_plans(); }); // src/components/tasks/RemoteSessionDetailDialog.tsx -function formatToolUseSummary(name, input11) { +function formatToolUseSummary(name, input) { if (name === EXIT_PLAN_MODE_V2_TOOL_NAME) { return "Review the plan in Claude Code on the web"; } - if (!input11 || typeof input11 !== "object") + if (!input || typeof input !== "object") return name; - if (name === ASK_USER_QUESTION_TOOL_NAME && "questions" in input11) { - const qs = input11.questions; + if (name === ASK_USER_QUESTION_TOOL_NAME && "questions" in input) { + const qs = input.questions; if (Array.isArray(qs) && qs[0] && typeof qs[0] === "object") { const q = "question" in qs[0] && typeof qs[0].question === "string" && qs[0].question ? qs[0].question : ("header" in qs[0]) && typeof qs[0].header === "string" ? qs[0].header : null; if (q) { @@ -646980,7 +569546,7 @@ function formatToolUseSummary(name, input11) { } } } - for (const v of Object.values(input11)) { + for (const v of Object.values(input)) { if (typeof v === "string" && v.trim()) { const oneLine = v.replace(/\s+/g, " ").trim(); return `${name} ${truncateToWidth(oneLine, 60)}`; @@ -647446,11 +570012,11 @@ function StagePipeline(t0) { } let t4; if ($2[5] !== completed || $2[6] !== currentIdx || $2[7] !== inSetup) { - t4 = STAGES.map((s, i4) => { - const isCurrent = !completed && !inSetup && i4 === currentIdx; + t4 = STAGES.map((s, i3) => { + const isCurrent = !completed && !inSetup && i3 === currentIdx; return /* @__PURE__ */ jsx_dev_runtime292.jsxDEV(import_react165.default.Fragment, { children: [ - i4 > 0 && /* @__PURE__ */ jsx_dev_runtime292.jsxDEV(ThemedText, { + i3 > 0 && /* @__PURE__ */ jsx_dev_runtime292.jsxDEV(ThemedText, { dimColor: true, children: " → " }, undefined, false, undefined, this), @@ -647930,8 +570496,8 @@ function RemoteSessionDetailDialog({ setTeleportError(null); try { await teleportResumeCodeSession(session2.sessionId); - } catch (err3) { - setTeleportError(errorMessage(err3)); + } catch (err2) { + setTeleportError(errorMessage(err2)); } finally { setIsTeleporting(false); } @@ -648064,10 +570630,10 @@ function RemoteSessionDetailDialog({ flexDirection: "column", height: 10, overflowY: "hidden", - children: lastMessages.map((msg, i4) => /* @__PURE__ */ jsx_dev_runtime292.jsxDEV(Message, { + children: lastMessages.map((msg, i3) => /* @__PURE__ */ jsx_dev_runtime292.jsxDEV(Message, { message: msg, lookups: EMPTY_LOOKUPS, - addMargin: i4 > 0, + addMargin: i3 > 0, tools: toolUseContext.options.tools, commands: toolUseContext.options.commands, verbose: toolUseContext.options.verbose, @@ -648078,7 +570644,7 @@ function RemoteSessionDetailDialog({ style: "condensed", isTranscriptMode: false, isStatic: true - }, i4, false, undefined, this)) + }, i3, false, undefined, this)) }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime292.jsxDEV(ThemedBox_default, { marginTop: 1, @@ -648130,7 +570696,7 @@ var init_RemoteSessionDetailDialog = __esm(() => { init_errors(); init_format(); init_mappers(); - init_messages5(); + init_messages3(); init_stringUtils(); init_teleport(); init_select(); @@ -648158,12 +570724,12 @@ var init_RemoteSessionDetailDialog = __esm(() => { // src/components/tasks/ShellDetailDialog.tsx async function getTaskOutput2(shell) { - const path26 = getTaskOutputPath(shell.id); + const path21 = getTaskOutputPath(shell.id); try { - const result3 = await tailFile(path26, SHELL_DETAIL_TAIL_BYTES); + const result2 = await tailFile(path21, SHELL_DETAIL_TAIL_BYTES); return { - content: result3.content, - bytesTotal: result3.bytesTotal + content: result2.content, + bytesTotal: result2.bytesTotal }; } catch { return { @@ -648558,7 +571124,7 @@ function ShellOutputContent(t0) { if ($2[1] !== bytesTotal || $2[2] !== content) { const starts = []; let pos = content.length; - for (let i4 = 0;i4 < 10 && pos > 0; i4++) { + for (let i3 = 0;i3 < 10 && pos > 0; i3++) { const prev = content.lastIndexOf(` `, pos - 1); starts.push(prev + 1); @@ -648676,9 +571242,9 @@ var init_ShellDetailDialog = __esm(() => { var exports_WorkflowDetailDialog = {}; __export(exports_WorkflowDetailDialog, { default: () => WorkflowDetailDialog_default, - __stub__: () => __stub__24 + __stub__: () => __stub__31 }); -var WorkflowDetailDialog_default, __stub__24 = true; +var WorkflowDetailDialog_default, __stub__31 = true; var init_WorkflowDetailDialog = __esm(() => { WorkflowDetailDialog_default = {}; }); @@ -648687,9 +571253,9 @@ var init_WorkflowDetailDialog = __esm(() => { var exports_MonitorMcpDetailDialog = {}; __export(exports_MonitorMcpDetailDialog, { default: () => MonitorMcpDetailDialog_default, - __stub__: () => __stub__25 + __stub__: () => __stub__32 }); -var MonitorMcpDetailDialog_default, __stub__25 = true; +var MonitorMcpDetailDialog_default, __stub__32 = true; var init_MonitorMcpDetailDialog = __esm(() => { MonitorMcpDetailDialog_default = {}; }); @@ -649067,7 +571633,7 @@ function BackgroundTasksDialog({ ] }, undefined, true, undefined, this), " (", - count2(teammateTasks, (i4) => i4.type !== "leader"), + count2(teammateTasks, (i3) => i3.type !== "leader"), ")" ] }, undefined, true, undefined, this), @@ -649438,8 +572004,8 @@ function TeammateTaskGroups(t0) { function _temp258(i_0) { return i_0.type === "in_process_teammate"; } -function _temp141(i4) { - return i4.type === "leader"; +function _temp141(i3) { + return i3.type === "leader"; } var import_compiler_runtime231, import_react167, jsx_dev_runtime294, WorkflowDetailDialog, workflowTaskModule, killWorkflowTask, skipWorkflowAgent, retryWorkflowAgent, monitorMcpModule, killMonitorMcp, MonitorMcpDetailDialog; var init_BackgroundTasksDialog = __esm(() => { @@ -649887,8 +572453,8 @@ __export(exports_vim, { call: () => call39 }); var call39 = async () => { - const config6 = getGlobalConfig(); - let currentMode = config6.editorMode || "normal"; + const config4 = getGlobalConfig(); + let currentMode = config4.editorMode || "normal"; if (currentMode === "emacs") { currentMode = "normal"; } @@ -649930,8 +572496,8 @@ __export(exports_thinkback, { playAnimation: () => playAnimation, call: () => call40 }); -import { readFile as readFile50 } from "fs/promises"; -import { join as join138 } from "path"; +import { readFile as readFile49 } from "fs/promises"; +import { join as join128 } from "path"; function getMarketplaceName() { return OFFICIAL_MARKETPLACE_NAME; } @@ -649949,17 +572515,17 @@ async function getThinkbackSkillDir() { if (!thinkbackPlugin) { return null; } - const skillDir = join138(thinkbackPlugin.path, "skills", SKILL_NAME); + const skillDir = join128(thinkbackPlugin.path, "skills", SKILL_NAME); if (await pathExists(skillDir)) { return skillDir; } return null; } async function playAnimation(skillDir) { - const dataPath = join138(skillDir, "year_in_review.js"); - const playerPath = join138(skillDir, "player.js"); + const dataPath = join128(skillDir, "year_in_review.js"); + const playerPath = join128(skillDir, "player.js"); try { - await readFile50(dataPath); + await readFile49(dataPath); } catch (e) { if (isENOENT(e)) { return { @@ -649974,7 +572540,7 @@ async function playAnimation(skillDir) { }; } try { - await readFile50(playerPath); + await readFile49(playerPath); } catch (e) { if (isENOENT(e)) { return { @@ -650005,10 +572571,10 @@ async function playAnimation(skillDir) { } catch {} finally { inkInstance.exitAlternateScreen(); } - const htmlPath = join138(skillDir, "year_in_review.html"); + const htmlPath = join128(skillDir, "year_in_review.html"); if (await pathExists(htmlPath)) { - const platform6 = getPlatform(); - const openCmd = platform6 === "macos" ? "open" : platform6 === "windows" ? "start" : "xdg-open"; + const platform5 = getPlatform(); + const openCmd = platform5 === "macos" ? "open" : platform5 === "windows" ? "start" : "xdg-open"; execFileNoThrow(openCmd, [htmlPath]); } return { @@ -650064,9 +572630,9 @@ function ThinkbackInstaller({ phase: "installing-plugin" }); logForDebugging(`Installing plugin ${pluginId}`); - const result3 = await installSelectedPlugins([pluginId]); - if (result3.failed.length > 0) { - const errorMsg = result3.failed.map((f) => `${f.name}: ${f.error}`).join(", "); + const result2 = await installSelectedPlugins([pluginId]); + if (result2.failed.length > 0) { + const errorMsg = result2.failed.map((f) => `${f.name}: ${f.error}`).join(", "); throw new Error(`Failed to install plugin: ${errorMsg}`); } clearAllCaches(); @@ -650093,14 +572659,14 @@ function ThinkbackInstaller({ phase: "ready" }); onReady(); - } catch (error46) { - const err3 = toError(error46); - logError2(err3); + } catch (error42) { + const err2 = toError(error42); + logError2(err2); setState({ phase: "error", - message: err3.message + message: err2.message }); - onError(err3.message); + onError(err2.message); } } checkAndInstall(); @@ -650341,7 +572907,7 @@ function ThinkbackFlow(t0) { if (!skillDir) { return; } - const dataPath = join138(skillDir, "year_in_review.js"); + const dataPath = join128(skillDir, "year_in_review.js"); pathExists(dataPath).then((exists) => { logForDebugging(`Checking for ${dataPath}: ${exists ? "found" : "not found"}`); setHasGenerated(exists); @@ -650515,7 +573081,7 @@ var exports_thinkback_play = {}; __export(exports_thinkback_play, { call: () => call41 }); -import { join as join139 } from "path"; +import { join as join129 } from "path"; function getPluginId2() { const marketplaceName = process.env.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_NAME : OFFICIAL_MARKETPLACE_NAME; return `thinkback@${marketplaceName}`; @@ -650537,9 +573103,9 @@ async function call41() { value: "Thinkback plugin installation path not found." }; } - const skillDir = join139(firstInstall.installPath, "skills", SKILL_NAME2); - const result3 = await playAnimation(skillDir); - return { type: "text", value: result3.message }; + const skillDir = join129(firstInstall.installPath, "skills", SKILL_NAME2); + const result2 = await playAnimation(skillDir); + return { type: "text", value: result2.message }; } var INTERNAL_MARKETPLACE_NAME = "claude-code-marketplace", SKILL_NAME2 = "thinkback"; var init_thinkback_play = __esm(() => { @@ -651189,8 +573755,8 @@ function RecentDenialsTab(t0) { const handleFocus = t6; let t7; if ($2[12] !== focusedIdx) { - t7 = (input11, _key) => { - if (input11 === "r") { + t7 = (input, _key) => { + if (input === "r") { setRetry((prev_0) => { const next_0 = new Set(prev_0); if (next_0.has(focusedIdx)) { @@ -651613,9 +574179,9 @@ function _temp260(dir) { value: dir.path }; } -function _temp146(path26) { +function _temp146(path21) { return { - path: path26, + path: path21, isCurrent: false, isDeletable: true }; @@ -652237,18 +574803,18 @@ function PermissionRuleList(t0) { t5 = $2[4]; } const handleHeaderFocusChange = t5; - let map7; + let map5; if ($2[5] !== toolPermissionContext) { - map7 = new Map; + map5 = new Map; getAllowRules(toolPermissionContext).forEach((rule) => { - map7.set(jsonStringify(rule), rule); + map5.set(jsonStringify(rule), rule); }); $2[5] = toolPermissionContext; - $2[6] = map7; + $2[6] = map5; } else { - map7 = $2[6]; + map5 = $2[6]; } - const allowRulesByKey = map7; + const allowRulesByKey = map5; let map_0; if ($2[7] !== toolPermissionContext) { map_0 = new Map; @@ -652481,7 +575047,7 @@ function PermissionRuleList(t0) { const handleRequestAddDirectory = t16; let t17; if ($2[29] === Symbol.for("react.memo_cache_sentinel")) { - t17 = (path26) => setRemovingDirectory(path26); + t17 = (path21) => setRemovingDirectory(path21); $2[29] = t17; } else { t17 = $2[29]; @@ -652491,7 +575057,7 @@ function PermissionRuleList(t0) { if ($2[30] !== changes || $2[31] !== onExit2 || $2[32] !== onRetryDenials) { t18 = () => { const s_1 = denialStateRef.current; - const denialsFor = (set6) => Array.from(set6).map((idx) => s_1.denials[idx]).filter(_temp261); + const denialsFor = (set5) => Array.from(set5).map((idx) => s_1.denials[idx]).filter(_temp261); const retryDenials = denialsFor(s_1.retry); if (retryDenials.length > 0) { const commands = retryDenials.map(_temp337); @@ -653034,7 +575600,7 @@ var jsx_dev_runtime306, call42 = async (onDone, context2) => { }; var init_permissions3 = __esm(() => { init_PermissionRuleList(); - init_messages5(); + init_messages3(); jsx_dev_runtime306 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -653177,9 +575743,9 @@ async function call43(onDone, context2, args) { } const argList = args.trim().split(/\s+/); if (argList[0] === "open") { - const result3 = await editFileInEditor(planPath); - if (result3.error) { - onDone(`Failed to open plan in editor: ${result3.error}`); + const result2 = await editFileInEditor(planPath); + if (result2.error) { + onDone(`Failed to open plan in editor: ${result2.error}`); } else { onDone(`Opened plan in editor: ${planPath}`); } @@ -653610,8 +576176,8 @@ async function call44(onDone, context2, args) { await prefetchFastModeStatus(); const arg = args?.trim().toLowerCase(); if (arg === "on" || arg === "off") { - const result3 = await handleFastModeShortcut(arg === "on", context2.getAppState, context2.setAppState); - onDone(result3); + const result2 = await handleFastModeShortcut(arg === "on", context2.getAppState, context2.setAppState); + onDone(result2); return null; } const unavailableReason = getFastModeUnavailableReason(); @@ -653722,17 +576288,17 @@ function Passes({ const redemptions = redemptionsData.redemptions || []; const maxRedemptions = redemptionsData.limit || 3; const statuses = []; - for (let i4 = 0;i4 < maxRedemptions; i4++) { - const redemption = redemptions[i4]; + for (let i3 = 0;i3 < maxRedemptions; i3++) { + const redemption = redemptions[i3]; statuses.push({ - passNumber: i4 + 1, + passNumber: i3 + 1, isAvailable: !redemption }); } setPassStatuses(statuses); setLoading(false); - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); setIsAvailable(false); setLoading(false); } @@ -653917,8 +576483,8 @@ __export(exports_passes, { call: () => call45 }); async function call45(onDone) { - const config6 = getGlobalConfig(); - const isFirstVisit = !config6.hasVisitedPasses; + const config4 = getGlobalConfig(); + const isFirstVisit = !config4.hasVisitedPasses; if (isFirstVisit) { const remaining = getCachedRemainingPasses(); saveGlobalConfig((current) => ({ @@ -654241,8 +576807,8 @@ function GroveDialog(t0) { t1 = () => { const checkGroveSettings = async function checkGroveSettings() { const [settingsResult, configResult] = await Promise.all([getGroveSettings(), getGroveNoticeConfig()]); - const config6 = configResult.success ? configResult.data : null; - setGroveConfig(config6); + const config4 = configResult.success ? configResult.data : null; + setGroveConfig(config4); const shouldShow = calculateShouldShowGrove(settingsResult, configResult, showIfAlreadyViewed); setShouldShowDialog(shouldShow); if (!shouldShow) { @@ -654252,7 +576818,7 @@ function GroveDialog(t0) { markGroveNoticeViewed(); logEvent("tengu_grove_policy_viewed", { location, - dismissable: config6?.notice_is_grace_period + dismissable: config4?.notice_is_grace_period }); }; checkGroveSettings(); @@ -654514,8 +577080,8 @@ function PrivacySettingsDialog(t0) { import_react175.default.useEffect(_temp263, t1); let t2; if ($2[1] !== domainExcluded || $2[2] !== groveEnabled) { - t2 = async (input11, key) => { - if (!domainExcluded && (key.tab || key.return || input11 === " ")) { + t2 = async (input, key) => { + if (!domainExcluded && (key.tab || key.return || input === " ")) { const newValue = !groveEnabled; setGroveEnabled(newValue); await updateGroveSettings(newValue); @@ -654702,7 +577268,7 @@ async function call46(onDone) { return null; } const settings = settingsResult.data; - const config6 = configResult.success ? configResult.data : null; + const config4 = configResult.success ? configResult.data : null; async function onDoneWithDecision(decision) { if (decision === "escape" || decision === "defer") { onDone("Privacy settings dialog dismissed", { @@ -654733,7 +577299,7 @@ async function call46(onDone) { if (settings.grove_enabled !== null) { return /* @__PURE__ */ jsx_dev_runtime313.jsxDEV(PrivacySettingsDialog, { settings, - domainExcluded: config6?.domain_excluded, + domainExcluded: config4?.domain_excluded, onDone: onDoneWithSettingsCheck }, undefined, false, undefined, this); } @@ -654754,7 +577320,7 @@ var init_privacy_settings = __esm(() => { // src/commands/privacy-settings/index.ts var privacySettings, privacy_settings_default; var init_privacy_settings2 = __esm(() => { - init_auth2(); + init_auth(); privacySettings = { type: "local-jsx", name: "privacy-settings", @@ -655869,8 +578435,8 @@ function _temp153() { children: "Esc to go back" }, undefined, false, undefined, this); } -function getContentFieldLabel(config6) { - switch (config6.type) { +function getContentFieldLabel(config4) { + switch (config4.type) { case "command": return "Command"; case "prompt": @@ -655881,16 +578447,16 @@ function getContentFieldLabel(config6) { return "URL"; } } -function getContentFieldValue(config6) { - switch (config6.type) { +function getContentFieldValue(config4) { + switch (config4.type) { case "command": - return config6.command; + return config4.command; case "prompt": - return config6.prompt; + return config4.prompt; case "agent": - return config6.prompt; + return config4.prompt; case "http": - return config6.url; + return config4.url; } } var import_compiler_runtime248, jsx_dev_runtime317; @@ -656497,8 +579063,8 @@ function _temp617() { children: "Esc to close" }, undefined, false, undefined, this); } -function _temp520(sum3, hooks) { - return sum3 + hooks.length; +function _temp520(sum2, hooks) { + return sum2 + hooks.length; } function _temp431(tool) { return tool.name; @@ -656569,38 +579135,38 @@ var init_hooks3 = __esm(() => { }); // src/commands/files/files.ts -var exports_files3 = {}; -__export(exports_files3, { +var exports_files2 = {}; +__export(exports_files2, { call: () => call48 }); -import { relative as relative28 } from "path"; +import { relative as relative26 } from "path"; async function call48(_args, context2) { - const files2 = context2.readFileState ? cacheKeys(context2.readFileState) : []; - if (files2.length === 0) { + const files = context2.readFileState ? cacheKeys(context2.readFileState) : []; + if (files.length === 0) { return { type: "text", value: "No files in context" }; } - const fileList = files2.map((file2) => relative28(getCwd(), file2)).join(` + const fileList = files.map((file2) => relative26(getCwd(), file2)).join(` `); return { type: "text", value: `Files in context: ${fileList}` }; } -var init_files5 = __esm(() => { +var init_files3 = __esm(() => { init_cwd2(); init_fileStateCache(); }); // src/commands/files/index.ts -var files2, files_default; -var init_files6 = __esm(() => { - files2 = { +var files, files_default; +var init_files4 = __esm(() => { + files = { type: "local", name: "files", description: "List all files currently in context", isEnabled: () => process.env.USER_TYPE === "ant", supportsNonInteractive: true, - load: () => Promise.resolve().then(() => (init_files5(), exports_files3)) + load: () => Promise.resolve().then(() => (init_files3(), exports_files2)) }; - files_default = files2; + files_default = files; }); // src/commands/branch/branch.ts @@ -656610,7 +579176,7 @@ __export(exports_branch, { call: () => call49 }); import { randomUUID as randomUUID31 } from "crypto"; -import { mkdir as mkdir42, readFile as readFile51, writeFile as writeFile47 } from "fs/promises"; +import { mkdir as mkdir42, readFile as readFile50, writeFile as writeFile45 } from "fs/promises"; function deriveFirstPrompt(firstUserMessage) { const content = firstUserMessage?.message?.content; if (!content) @@ -656629,7 +579195,7 @@ async function createFork(customTitle) { await mkdir42(projectDir, { recursive: true, mode: 448 }); let transcriptContent; try { - transcriptContent = await readFile51(currentTranscriptPath); + transcriptContent = await readFile50(currentTranscriptPath); } catch { throw new Error("No conversation to branch"); } @@ -656674,7 +579240,7 @@ async function createFork(customTitle) { }; lines.push(jsonStringify(forkedReplacementEntry)); } - await writeFile47(forkSessionPath, lines.join(` + await writeFile45(forkSessionPath, lines.join(` `) + ` `, { encoding: "utf8", @@ -656724,7 +579290,7 @@ async function call49(onDone, context2, args) { serializedMessages, contentReplacementRecords } = await createFork(customTitle); - const now3 = new Date; + const now2 = new Date; const firstPrompt = deriveFirstPrompt(serializedMessages.find((m) => m.type === "user")); const baseName = title ?? firstPrompt; const effectiveTitle = await getUniqueForkName(baseName); @@ -656734,12 +579300,12 @@ async function call49(onDone, context2, args) { has_custom_title: !!title }); const forkLog = { - date: now3.toISOString().split("T")[0], + date: now2.toISOString().split("T")[0], messages: serializedMessages, fullPath: forkPath, - value: now3.getTime(), - created: now3, - modified: now3, + value: now2.getTime(), + created: now2, + modified: now2, firstPrompt, messageCount: serializedMessages.length, isSidechain: false, @@ -656758,8 +579324,8 @@ To resume the original: claude -r ${originalSessionId}`; onDone(`Branched conversation${titleInfo}. Resume with: /resume ${sessionId}`); } return null; - } catch (error46) { - const message = error46 instanceof Error ? error46.message : "Unknown error occurred"; + } catch (error42) { + const message = error42 instanceof Error ? error42.message : "Unknown error occurred"; onDone(`Failed to branch conversation: ${message}`); return null; } @@ -656818,7 +579384,7 @@ var init_toolPool = __esm(() => { init_partition(); init_uniqBy(); init_tools(); - init_utils4(); + init_utils3(); PR_ACTIVITY_TOOL_SUFFIXES = [ "subscribe_pr_activity", "unsubscribe_pr_activity" @@ -656898,7 +579464,7 @@ var init_agentDisplay = __esm(() => { // src/components/agents/types.ts var AGENT_PATHS; -var init_types17 = __esm(() => { +var init_types16 = __esm(() => { AGENT_PATHS = { FOLDER_NAME: ".claude", AGENTS_DIR: "agents" @@ -656907,7 +579473,7 @@ var init_types17 = __esm(() => { // src/components/agents/agentFileUtils.ts import { mkdir as mkdir43, open as open12, unlink as unlink21 } from "fs/promises"; -import { join as join140 } from "path"; +import { join as join130 } from "path"; function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color3, model, memory2, effort) { const escapedWhenToUse = whenToUse.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\\\n"); const isAllTools = tools === undefined || tools.length === 1 && tools[0] === "*"; @@ -656934,26 +579500,26 @@ function getAgentDirectoryPath(location) { case "flagSettings": throw new Error(`Cannot get directory path for ${location} agents`); case "userSettings": - return join140(getClaudeConfigHomeDir(), AGENT_PATHS.AGENTS_DIR); + return join130(getClaudeConfigHomeDir(), AGENT_PATHS.AGENTS_DIR); case "projectSettings": - return join140(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR); + return join130(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR); case "policySettings": - return join140(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR); + return join130(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR); case "localSettings": - return join140(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR); + return join130(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR); } } function getRelativeAgentDirectoryPath(location) { switch (location) { case "projectSettings": - return join140(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR); + return join130(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR); default: return getAgentDirectoryPath(location); } } function getNewAgentFilePath(agent) { const dirPath = getAgentDirectoryPath(agent.source); - return join140(dirPath, `${agent.agentType}.md`); + return join130(dirPath, `${agent.agentType}.md`); } function getActualAgentFilePath(agent) { if (agent.source === "built-in") { @@ -656964,14 +579530,14 @@ function getActualAgentFilePath(agent) { } const dirPath = getAgentDirectoryPath(agent.source); const filename = agent.filename || agent.agentType; - return join140(dirPath, `${filename}.md`); + return join130(dirPath, `${filename}.md`); } function getNewRelativeAgentFilePath(agent) { if (agent.source === "built-in") { return "Built-in"; } const dirPath = getRelativeAgentDirectoryPath(agent.source); - return join140(dirPath, `${agent.agentType}.md`); + return join130(dirPath, `${agent.agentType}.md`); } function getActualRelativeAgentFilePath(agent) { if (isBuiltInAgent(agent)) { @@ -656985,7 +579551,7 @@ function getActualRelativeAgentFilePath(agent) { } const dirPath = getRelativeAgentDirectoryPath(agent.source); const filename = agent.filename || agent.agentType; - return join140(dirPath, `${filename}.md`); + return join130(dirPath, `${filename}.md`); } async function ensureAgentDirectoryExists(source) { const dirPath = getAgentDirectoryPath(source); @@ -657045,7 +579611,7 @@ var init_agentFileUtils = __esm(() => { init_cwd2(); init_envUtils(); init_errors(); - init_types17(); + init_types16(); }); // src/components/agents/AgentDetail.tsx @@ -657813,9 +580379,9 @@ function ToolSelector(t0) { const handleToggleTool = t6; let t7; if ($2[15] === Symbol.for("react.memo_cache_sentinel")) { - t7 = (toolNames_0, select12) => { + t7 = (toolNames_0, select2) => { setSelectedTools((current_0) => { - if (select12) { + if (select2) { const toolsToAdd = toolNames_0.filter((t_2) => !current_0.includes(t_2)); return [...current_0, ...toolsToAdd]; } else { @@ -658244,7 +580810,7 @@ var init_ToolSelector = __esm(() => { init_figures(); import_react179 = __toESM(require_react(), 1); init_mcpStringUtils(); - init_utils4(); + init_utils3(); init_agentToolUtils(); init_constants3(); init_BashTool(); @@ -658283,7 +580849,7 @@ function getAgentSourceDisplayName(source) { } return capitalize_default(getSettingSourceName(source)); } -var init_utils12 = __esm(() => { +var init_utils11 = __esm(() => { init_capitalize(); init_constants2(); }); @@ -658298,13 +580864,13 @@ function AgentEditor({ const setAppState = useSetAppState(); const [editMode, setEditMode] = import_react180.useState("menu"); const [selectedMenuIndex, setSelectedMenuIndex] = import_react180.useState(0); - const [error46, setError] = import_react180.useState(null); + const [error42, setError] = import_react180.useState(null); const [selectedColor, setSelectedColor] = import_react180.useState(agent.color); const handleOpenInEditor = import_react180.useCallback(async () => { const filePath = getActualAgentFilePath(agent); - const result3 = await editFileInEditor(filePath); - if (result3.error) { - setError(result3.error); + const result2 = await editFileInEditor(filePath); + if (result2.error) { + setError(result2.error); } else { onSaved(`Opened ${agent.agentType} in editor. If you made edits, restart to load the latest version.`); } @@ -658348,8 +580914,8 @@ function AgentEditor({ }); onSaved(`Updated agent: ${source_default.bold(agent.agentType)}`); return true; - } catch (err3) { - setError(err3 instanceof Error ? err3.message : "Failed to save agent"); + } catch (err2) { + setError(err2 instanceof Error ? err2.message : "Failed to save agent"); return false; } }, [agent, selectedColor, onSaved, setAppState]); @@ -658416,11 +580982,11 @@ function AgentEditor({ ] }, item.label, true, undefined, this)) }, undefined, false, undefined, this), - error46 && /* @__PURE__ */ jsx_dev_runtime324.jsxDEV(ThemedBox_default, { + error42 && /* @__PURE__ */ jsx_dev_runtime324.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime324.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) }, undefined, false, undefined, this) ] @@ -658480,7 +581046,7 @@ var init_AgentEditor = __esm(() => { init_ColorPicker(); init_ModelSelector(); init_ToolSelector(); - init_utils12(); + init_utils11(); jsx_dev_runtime324 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -659141,7 +581707,7 @@ var init_AgentsList = __esm(() => { init_agentDisplay(); init_Dialog(); init_Divider(); - init_utils12(); + init_utils11(); jsx_dev_runtime326 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -659681,7 +582247,7 @@ function validateAgent(agent, availableTools, existingAgents) { } var init_validateAgent = __esm(() => { init_agentToolUtils(); - init_utils12(); + init_utils11(); }); // src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx @@ -659692,7 +582258,7 @@ function ConfirmStep(t0) { existingAgents, onSave, onSaveAndEdit, - error: error46 + error: error42 } = t0; const { goBack, @@ -660067,15 +582633,15 @@ function ConfirmStep(t0) { t9 = $2[27]; } let t20; - if ($2[60] !== error46) { - t20 = error46 && /* @__PURE__ */ jsx_dev_runtime331.jsxDEV(ThemedBox_default, { + if ($2[60] !== error42) { + t20 = error42 && /* @__PURE__ */ jsx_dev_runtime331.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime331.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) }, undefined, false, undefined, this); - $2[60] = error46; + $2[60] = error42; $2[61] = t20; } else { t20 = $2[61]; @@ -660186,17 +582752,17 @@ function ConfirmStep(t0) { } return t25; } -function _temp344(err3, i_0) { +function _temp344(err2, i_0) { return /* @__PURE__ */ jsx_dev_runtime331.jsxDEV(ThemedText, { color: "error", children: [ " ", "• ", - err3 + err2 ] }, i_0, true, undefined, this); } -function _temp271(warning, i4) { +function _temp271(warning, i3) { return /* @__PURE__ */ jsx_dev_runtime331.jsxDEV(ThemedText, { dimColor: true, children: [ @@ -660204,7 +582770,7 @@ function _temp271(warning, i4) { "• ", warning ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } function _temp160(toolNames) { if (toolNames === undefined) { @@ -660291,8 +582857,8 @@ function ConfirmStepWrapper({ }); const message = openInEditor ? `Created agent: ${source_default.bold(wizardData.finalAgent.agentType)} and opened in editor. ` + `If you made edits, restart to load the latest version.` : `Created agent: ${source_default.bold(wizardData.finalAgent.agentType)}`; onComplete(message); - } catch (err3) { - setSaveError(err3 instanceof Error ? err3.message : "Failed to save agent"); + } catch (err2) { + setSaveError(err2 instanceof Error ? err2.message : "Failed to save agent"); } }, [wizardData, onComplete, setAppState]); const handleSave = import_react183.useCallback(() => saveAgent(false), [saveAgent]); @@ -660330,7 +582896,7 @@ function DescriptionStep() { } = useWizard(); const [whenToUse, setWhenToUse] = import_react184.useState(wizardData.whenToUse || ""); const [cursorOffset, setCursorOffset] = import_react184.useState(whenToUse.length); - const [error46, setError] = import_react184.useState(null); + const [error42, setError] = import_react184.useState(null); let t0; if ($2[0] === Symbol.for("react.memo_cache_sentinel")) { t0 = { @@ -660344,10 +582910,10 @@ function DescriptionStep() { let t1; if ($2[1] !== whenToUse) { t1 = async () => { - const result3 = await editPromptInEditor(whenToUse); - if (result3.content !== null) { - setWhenToUse(result3.content); - setCursorOffset(result3.content.length); + const result2 = await editPromptInEditor(whenToUse); + if (result2.content !== null) { + setWhenToUse(result2.content); + setCursorOffset(result2.content.length); } }; $2[1] = whenToUse; @@ -660450,15 +583016,15 @@ function DescriptionStep() { t6 = $2[12]; } let t7; - if ($2[13] !== error46) { - t7 = error46 && /* @__PURE__ */ jsx_dev_runtime333.jsxDEV(ThemedBox_default, { + if ($2[13] !== error42) { + t7 = error42 && /* @__PURE__ */ jsx_dev_runtime333.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime333.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) }, undefined, false, undefined, this); - $2[13] = error46; + $2[13] = error42; $2[14] = t7; } else { t7 = $2[14]; @@ -660581,7 +583147,7 @@ var init_generateAgent = __esm(() => { init_Tool(); init_constants3(); init_api4(); - init_messages5(); + init_messages3(); init_paths(); init_analytics(); init_slowOperations(); @@ -660669,7 +583235,7 @@ function GenerateStep() { } = useWizard(); const [prompt, setPrompt] = import_react185.useState(wizardData.generationPrompt || ""); const [isGenerating, setIsGenerating] = import_react185.useState(false); - const [error46, setError] = import_react185.useState(null); + const [error42, setError] = import_react185.useState(null); const [cursorOffset, setCursorOffset] = import_react185.useState(prompt.length); const model = useMainLoopModel(); const abortControllerRef = import_react185.useRef(null); @@ -660686,10 +583252,10 @@ function GenerateStep() { isActive: isGenerating }); const handleExternalEditor = import_react185.useCallback(async () => { - const result3 = await editPromptInEditor(prompt); - if (result3.content !== null) { - setPrompt(result3.content); - setCursorOffset(result3.content.length); + const result2 = await editPromptInEditor(prompt); + if (result2.content !== null) { + setPrompt(result2.content); + setCursorOffset(result2.content.length); } }, [prompt]); useKeybinding("chat:externalEditor", handleExternalEditor, { @@ -660738,9 +583304,9 @@ function GenerateStep() { wasGenerated: true }); goToStep(6); - } catch (err3) { - if (err3 instanceof APIUserAbortError) {} else if (err3 instanceof Error && !err3.message.includes("No assistant message found")) { - setError(err3.message || "Failed to generate agent"); + } catch (err2) { + if (err2 instanceof APIUserAbortError) {} else if (err2 instanceof Error && !err2.message.includes("No assistant message found")) { + setError(err2.message || "Failed to generate agent"); } updateWizardData({ isGenerating: false @@ -660800,11 +583366,11 @@ function GenerateStep() { children: /* @__PURE__ */ jsx_dev_runtime334.jsxDEV(ThemedBox_default, { flexDirection: "column", children: [ - error46 && /* @__PURE__ */ jsx_dev_runtime334.jsxDEV(ThemedBox_default, { + error42 && /* @__PURE__ */ jsx_dev_runtime334.jsxDEV(ThemedBox_default, { marginBottom: 1, children: /* @__PURE__ */ jsx_dev_runtime334.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime334.jsxDEV(TextInput, { @@ -661141,12 +583707,12 @@ function MethodStep() { let t2; if ($2[2] !== goNext || $2[3] !== goToStep || $2[4] !== updateWizardData) { t2 = (value) => { - const method3 = value; + const method2 = value; updateWizardData({ - method: method3, - wasGenerated: method3 === "generate" + method: method2, + wasGenerated: method2 === "generate" }); - if (method3 === "generate") { + if (method2 === "generate") { goNext(); } else { goToStep(3); @@ -661292,7 +583858,7 @@ function PromptStep() { } = useWizard(); const [systemPrompt, setSystemPrompt] = import_react186.useState(wizardData.systemPrompt || ""); const [cursorOffset, setCursorOffset] = import_react186.useState(systemPrompt.length); - const [error46, setError] = import_react186.useState(null); + const [error42, setError] = import_react186.useState(null); let t0; if ($2[0] === Symbol.for("react.memo_cache_sentinel")) { t0 = { @@ -661306,10 +583872,10 @@ function PromptStep() { let t1; if ($2[1] !== systemPrompt) { t1 = async () => { - const result3 = await editPromptInEditor(systemPrompt); - if (result3.content !== null) { - setSystemPrompt(result3.content); - setCursorOffset(result3.content.length); + const result2 = await editPromptInEditor(systemPrompt); + if (result2.content !== null) { + setSystemPrompt(result2.content); + setCursorOffset(result2.content.length); } }; $2[1] = systemPrompt; @@ -661420,15 +583986,15 @@ function PromptStep() { t7 = $2[14]; } let t8; - if ($2[15] !== error46) { - t8 = error46 && /* @__PURE__ */ jsx_dev_runtime339.jsxDEV(ThemedBox_default, { + if ($2[15] !== error42) { + t8 = error42 && /* @__PURE__ */ jsx_dev_runtime339.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime339.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) }, undefined, false, undefined, this); - $2[15] = error46; + $2[15] = error42; $2[16] = t8; } else { t8 = $2[16]; @@ -661568,7 +584134,7 @@ function TypeStep(_props) { wizardData } = useWizard(); const [agentType, setAgentType] = import_react187.useState(wizardData.agentType || ""); - const [error46, setError] = import_react187.useState(null); + const [error42, setError] = import_react187.useState(null); const [cursorOffset, setCursorOffset] = import_react187.useState(agentType.length); let t0; if ($2[0] === Symbol.for("react.memo_cache_sentinel")) { @@ -661659,15 +584225,15 @@ function TypeStep(_props) { t4 = $2[9]; } let t5; - if ($2[10] !== error46) { - t5 = error46 && /* @__PURE__ */ jsx_dev_runtime341.jsxDEV(ThemedBox_default, { + if ($2[10] !== error42) { + t5 = error42 && /* @__PURE__ */ jsx_dev_runtime341.jsxDEV(ThemedBox_default, { marginTop: 1, children: /* @__PURE__ */ jsx_dev_runtime341.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this) }, undefined, false, undefined, this); - $2[10] = error46; + $2[10] = error42; $2[11] = t5; } else { t5 = $2[11]; @@ -661969,8 +584535,8 @@ function AgentsMenu(t0) { source: "all" }); } catch (t13) { - const error46 = t13; - logError2(toError(error46)); + const error42 = t13; + logError2(toError(error42)); } }; $2[26] = setAppState; @@ -662784,7 +585350,7 @@ var init_plugin2 = __esm(() => { // src/services/settingsSync/types.ts var UserSyncContentSchema, UserSyncDataSchema, SYNC_KEYS; -var init_types18 = __esm(() => { +var init_types17 = __esm(() => { init_v4(); UserSyncContentSchema = lazySchema(() => exports_external.object({ entries: exports_external.record(exports_external.string(), exports_external.string()) @@ -662812,8 +585378,8 @@ __export(exports_settingsSync, { downloadUserSettings: () => downloadUserSettings, _resetDownloadPromiseForTesting: () => _resetDownloadPromiseForTesting }); -import { mkdir as mkdir44, readFile as readFile52, stat as stat44, writeFile as writeFile48 } from "fs/promises"; -import { dirname as dirname59 } from "path"; +import { mkdir as mkdir44, readFile as readFile51, stat as stat43, writeFile as writeFile46 } from "fs/promises"; +import { dirname as dirname55 } from "path"; async function uploadUserSettingsInBackground() { try { if (!feature("UPLOAD_USER_SETTINGS") || !getFeatureValue_CACHED_MAY_BE_STALE("tengu_enable_settings_sync_push", false) || !getIsInteractive() || !isUsingOAuth2()) { @@ -662822,15 +585388,15 @@ async function uploadUserSettingsInBackground() { return; } logForDiagnosticsNoPII("info", "settings_sync_upload_starting"); - const result3 = await fetchUserSettings(); - if (!result3.success) { + const result2 = await fetchUserSettings(); + if (!result2.success) { logForDiagnosticsNoPII("warn", "settings_sync_upload_fetch_failed"); logEvent("tengu_settings_sync_upload_fetch_failed", {}); return; } const projectId = await getRepoRemoteHash(); const localEntries = await buildEntriesFromLocalFiles(projectId); - const remoteEntries = result3.isEmpty ? {} : result3.data.content.entries; + const remoteEntries = result2.isEmpty ? {} : result2.data.content.entries; const changedEntries = pickBy_default(localEntries, (value, key) => remoteEntries[key] !== value); const entryCount = Object.keys(changedEntries).length; if (entryCount === 0) { @@ -662873,18 +585439,18 @@ async function doDownloadUserSettings(maxRetries = DEFAULT_MAX_RETRIES4) { return false; } logForDiagnosticsNoPII("info", "settings_sync_download_starting"); - const result3 = await fetchUserSettings(maxRetries); - if (!result3.success) { + const result2 = await fetchUserSettings(maxRetries); + if (!result2.success) { logForDiagnosticsNoPII("warn", "settings_sync_download_fetch_failed"); logEvent("tengu_settings_sync_download_fetch_failed", {}); return false; } - if (result3.isEmpty) { + if (result2.isEmpty) { logForDiagnosticsNoPII("info", "settings_sync_download_empty"); logEvent("tengu_settings_sync_download_empty", {}); return false; } - const entries = result3.data.content.entries; + const entries = result2.data.content.entries; const projectId = await getRepoRemoteHash(); const entryCount = Object.keys(entries).length; logForDiagnosticsNoPII("info", "settings_sync_download_applying", { @@ -662968,8 +585534,8 @@ async function fetchUserSettingsOnce() { data: parsed.data, isEmpty: false }; - } catch (error46) { - const { kind, message } = classifyAxiosError(error46); + } catch (error42) { + const { kind, message } = classifyAxiosError(error42); switch (kind) { case "auth": return { @@ -662988,7 +585554,7 @@ async function fetchUserSettingsOnce() { } async function fetchUserSettings(maxRetries = DEFAULT_MAX_RETRIES4) { let lastResult2 = null; - for (let attempt3 = 1;attempt3 <= maxRetries + 1; attempt3++) { + for (let attempt2 = 1;attempt2 <= maxRetries + 1; attempt2++) { lastResult2 = await fetchUserSettingsOnce(); if (lastResult2.success) { return lastResult2; @@ -662996,16 +585562,16 @@ async function fetchUserSettings(maxRetries = DEFAULT_MAX_RETRIES4) { if (lastResult2.skipRetry) { return lastResult2; } - if (attempt3 > maxRetries) { + if (attempt2 > maxRetries) { return lastResult2; } - const delayMs = getRetryDelay(attempt3); + const delayMs = getRetryDelay(attempt2); logForDiagnosticsNoPII("info", "settings_sync_retry", { - attempt: attempt3, + attempt: attempt2, maxRetries, delayMs }); - await sleep4(delayMs); + await sleep2(delayMs); } return lastResult2; } @@ -663037,22 +585603,22 @@ async function uploadUserSettings(entries) { checksum: response.data?.checksum, lastModified: response.data?.lastModified }; - } catch (error46) { + } catch (error42) { logForDiagnosticsNoPII("warn", "settings_sync_upload_error"); return { success: false, - error: error46 instanceof Error ? error46.message : "Unknown error" + error: error42 instanceof Error ? error42.message : "Unknown error" }; } } async function tryReadFileForSync(filePath) { try { - const stats = await stat44(filePath); + const stats = await stat43(filePath); if (stats.size > MAX_FILE_SIZE_BYTES4) { logForDiagnosticsNoPII("info", "settings_sync_file_too_large"); return null; } - const content = await readFile52(filePath, "utf8"); + const content = await readFile51(filePath, "utf8"); if (!content || /^\s*$/.test(content)) { return null; } @@ -663093,11 +585659,11 @@ async function buildEntriesFromLocalFiles(projectId) { } async function writeFileForSync(filePath, content) { try { - const parentDir = dirname59(filePath); + const parentDir = dirname55(filePath); if (parentDir) { await mkdir44(parentDir, { recursive: true }); } - await writeFile48(filePath, content, "utf8"); + await writeFile46(filePath, content, "utf8"); logForDiagnosticsNoPII("info", "settings_sync_file_written"); return true; } catch { @@ -663183,7 +585749,7 @@ var init_settingsSync = __esm(() => { init_pickBy(); init_state(); init_oauth(); - init_auth2(); + init_auth(); init_claudemd(); init_config2(); init_diagLogs(); @@ -663196,7 +585762,7 @@ var init_settingsSync = __esm(() => { init_growthbook(); init_analytics(); init_withRetry(); - init_types18(); + init_types17(); MAX_FILE_SIZE_BYTES4 = 500 * 1024; }); @@ -663229,8 +585795,8 @@ async function refreshActivePlugins(setAppState) { return servers ? Object.keys(servers).length : 0; })) ]); - const mcp_count = mcpCounts.reduce((sum3, n2) => sum3 + n2, 0); - const lsp_count = lspCounts.reduce((sum3, n2) => sum3 + n2, 0); + const mcp_count = mcpCounts.reduce((sum2, n2) => sum2 + n2, 0); + const lsp_count = lspCounts.reduce((sum2, n2) => sum2 + n2, 0); setAppState((prev) => ({ ...prev, plugins: { @@ -663256,10 +585822,10 @@ async function refreshActivePlugins(setAppState) { logError2(e); logForDebugging(`refreshActivePlugins: loadPluginHooks failed: ${errorMessage(e)}`); } - const hook_count = enabled.reduce((sum3, p) => { + const hook_count = enabled.reduce((sum2, p) => { if (!p.hooksConfig) - return sum3; - return sum3 + Object.values(p.hooksConfig).reduce((s, matchers) => s + (matchers?.reduce((h2, m) => h2 + m.hooks.length, 0) ?? 0), 0); + return sum2; + return sum2 + Object.values(p.hooksConfig).reduce((s, matchers) => s + (matchers?.reduce((h2, m) => h2 + m.hooks.length, 0) ?? 0), 0); }, 0); logForDebugging(`refreshActivePlugins: ${enabled.length} enabled, ${pluginCommands.length} commands, ${agentDefinitions.allAgents.length} agents, ${hook_count} hooks, ${mcp_count} MCP, ${lsp_count} LSP`); return { @@ -663382,9 +585948,9 @@ var init_rewind = __esm(() => { }); // src/utils/heapDumpService.ts -import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync9 } from "fs"; -import { readdir as readdir30, readFile as readFile53, writeFile as writeFile49 } from "fs/promises"; -import { join as join141 } from "path"; +import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync5 } from "fs"; +import { readdir as readdir30, readFile as readFile52, writeFile as writeFile47 } from "fs/promises"; +import { join as join131 } from "path"; import { pipeline as pipeline3 } from "stream/promises"; import { getHeapSnapshot, @@ -663408,7 +585974,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) { } catch {} let smapsRollup; try { - smapsRollup = await readFile53("/proc/self/smaps_rollup", "utf8"); + smapsRollup = await readFile52("/proc/self/smaps_rollup", "utf8"); } catch {} const nativeMemory = usage.rss - usage.heapUsed; const bytesPerSecond = uptimeSeconds > 0 ? usage.rss / uptimeSeconds : 0; @@ -663492,9 +586058,9 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) { const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : ""; const heapFilename = `${sessionId}${suffix}.heapsnapshot`; const diagFilename = `${sessionId}${suffix}-diagnostics.json`; - const heapPath = join141(dumpDir, heapFilename); - const diagPath = join141(dumpDir, diagFilename); - await writeFile49(diagPath, jsonStringify(diagnostics, null, 2), { + const heapPath = join131(dumpDir, heapFilename); + const diagPath = join131(dumpDir, diagFilename); + await writeFile47(diagPath, jsonStringify(diagnostics, null, 2), { mode: 384 }); logForDebugging(`[HeapDump] Diagnostics written to ${diagPath}`); @@ -663507,21 +586073,21 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) { success: true }); return { success: true, heapPath, diagPath }; - } catch (err3) { - const error46 = toError(err3); - logError2(error46); + } catch (err2) { + const error42 = toError(err2); + logError2(error42); logEvent("tengu_heap_dump", { triggerManual: trigger === "manual", triggerAuto15GB: trigger === "auto-1.5GB", dumpNumber, success: false }); - return { success: false, error: error46.message }; + return { success: false, error: error42.message }; } } async function writeHeapSnapshot(filepath) { if (typeof Bun !== "undefined") { - writeFileSync9(filepath, Bun.generateHeapSnapshot("v8", "arraybuffer"), { + writeFileSync5(filepath, Bun.generateHeapSnapshot("v8", "arraybuffer"), { mode: 384 }); Bun.gc(true); @@ -663548,17 +586114,17 @@ __export(exports_heapdump, { call: () => call54 }); async function call54() { - const result3 = await performHeapDump(); - if (!result3.success) { + const result2 = await performHeapDump(); + if (!result2.success) { return { type: "text", - value: `Failed to create heap dump: ${result3.error}` + value: `Failed to create heap dump: ${result2.error}` }; } return { type: "text", - value: `${result3.heapPath} -${result3.diagPath}` + value: `${result2.heapPath} +${result2.diagPath}` }; } var init_heapdump = __esm(() => { @@ -663645,17 +586211,17 @@ function createBridgeApiClient(deps) { return response; } return { - async registerBridgeEnvironment(config6) { - debug2(`[bridge:api] POST /v1/environments/bridge bridgeId=${config6.bridgeId}`); + async registerBridgeEnvironment(config4) { + debug2(`[bridge:api] POST /v1/environments/bridge bridgeId=${config4.bridgeId}`); const response = await withOAuthRetry((token) => axios_default.post(`${deps.baseUrl}/v1/environments/bridge`, { - machine_name: config6.machineName, - directory: config6.dir, - branch: config6.branch, - git_repo_url: config6.gitRepoUrl, - max_sessions: config6.maxSessions, - metadata: { worker_type: config6.workerType }, - ...config6.reuseEnvironmentId && { - environment_id: config6.reuseEnvironmentId + machine_name: config4.machineName, + directory: config4.dir, + branch: config4.branch, + git_repo_url: config4.gitRepoUrl, + max_sessions: config4.maxSessions, + metadata: { worker_type: config4.workerType }, + ...config4.reuseEnvironmentId && { + environment_id: config4.reuseEnvironmentId } }, { headers: getHeaders(token), @@ -663664,7 +586230,7 @@ function createBridgeApiClient(deps) { }), "Registration"); handleErrorStatus(response.status, response.data, "Registration"); debug2(`[bridge:api] POST /v1/environments/bridge -> ${response.status} environment_id=${response.data.environment_id}`); - debug2(`[bridge:api] >>> ${debugBody({ machine_name: config6.machineName, directory: config6.dir, branch: config6.branch, git_repo_url: config6.gitRepoUrl, max_sessions: config6.maxSessions, metadata: { worker_type: config6.workerType } })}`); + debug2(`[bridge:api] >>> ${debugBody({ machine_name: config4.machineName, directory: config4.dir, branch: config4.branch, git_repo_url: config4.gitRepoUrl, max_sessions: config4.maxSessions, metadata: { worker_type: config4.workerType } })}`); debug2(`[bridge:api] <<< ${debugBody(response.data)}`); return response.data; }, @@ -663808,11 +586374,11 @@ function isExpiredErrorType(errorType) { } return errorType.includes("expired") || errorType.includes("lifetime"); } -function isSuppressible403(err3) { - if (err3.status !== 403) { +function isSuppressible403(err2) { + if (err2.status !== 403) { return false; } - return err3.message.includes("external_poll_sessions") || err3.message.includes("environments:manage"); + return err2.message.includes("external_poll_sessions") || err2.message.includes("environments:manage"); } function extractErrorTypeFromData(data) { if (data && typeof data === "object") { @@ -663826,7 +586392,7 @@ var BETA_HEADER = "environments-2025-11-01", SAFE_ID_PATTERN, BridgeFatalError; var init_bridgeApi = __esm(() => { init_axios2(); init_debugUtils(); - init_types16(); + init_types15(); SAFE_ID_PATTERN = /^[a-zA-Z0-9_-]+$/; BridgeFatalError = class BridgeFatalError extends Error { status; @@ -663856,8 +586422,8 @@ function injectBridgeFault(fault) { logForDebugging(`[bridge:debug] Queued fault: ${fault.method} ${fault.kind}/${fault.status}${fault.errorType ? `/${fault.errorType}` : ""} ×${fault.count}`); } function wrapApiForFaultInjection(api3) { - function consume(method3) { - const idx = faultQueue.findIndex((f) => f.method === method3); + function consume(method2) { + const idx = faultQueue.findIndex((f) => f.method === method2); if (idx === -1) return null; const fault = faultQueue[idx]; @@ -663881,11 +586447,11 @@ function wrapApiForFaultInjection(api3) { throwFault(f, "Poll"); return api3.pollForWork(envId, secret, signal, reclaimMs); }, - async registerBridgeEnvironment(config6) { + async registerBridgeEnvironment(config4) { const f = consume("registerBridgeEnvironment"); if (f) throwFault(f, "Registration"); - return api3.registerBridgeEnvironment(config6); + return api3.registerBridgeEnvironment(config4); }, async reconnectSession(envId, sessionId) { const f = consume("reconnectSession"); @@ -664060,7 +586626,7 @@ var init_bridge_kick = __esm(() => { var call56 = async () => { return { type: "text", - value: `${"2.1.88-custom"} (built ${"2026-04-01T09:59:54.268Z"})` + value: `${"2.1.88-custom"} (built ${"2026-04-03T01:33:36.988Z"})` }; }, version3, version_default; var init_version = __esm(() => { @@ -664082,11 +586648,11 @@ var init_summary = __esm(() => { }); // src/commands/reset-limits/index.js -var stub14, resetLimits, resetLimitsNonInteractive; +var stub19, resetLimits, resetLimitsNonInteractive; var init_reset_limits = __esm(() => { - stub14 = { isEnabled: () => false, isHidden: true, name: "stub" }; - resetLimits = stub14; - resetLimitsNonInteractive = stub14; + stub19 = { isEnabled: () => false, isHidden: true, name: "stub" }; + resetLimits = stub19; + resetLimitsNonInteractive = stub19; }); // src/commands/ant-trace/index.js @@ -664287,11 +586853,11 @@ function SandboxConfigTab() { } return t1; } -function _temp165(w, i4) { +function _temp165(w, i3) { return /* @__PURE__ */ jsx_dev_runtime346.jsxDEV(ThemedText, { dimColor: true, children: w - }, i4, false, undefined, this); + }, i3, false, undefined, this); } var import_compiler_runtime270, jsx_dev_runtime346; var init_SandboxConfigTab = __esm(() => { @@ -664314,8 +586880,8 @@ function SandboxDependenciesTab(t0) { } else { t1 = $2[0]; } - const platform6 = t1; - const isMac = platform6 === "macos"; + const platform5 = t1; + const isMac = platform5 === "macos"; let t2; if ($2[1] !== depCheck.errors) { t2 = depCheck.errors.some(_temp166); @@ -664545,11 +587111,11 @@ function SandboxDependenciesTab(t0) { } return t5; } -function _temp524(err3) { +function _temp524(err2) { return /* @__PURE__ */ jsx_dev_runtime347.jsxDEV(ThemedText, { color: "error", - children: err3 - }, err3, false, undefined, this); + children: err2 + }, err2, false, undefined, this); } function _temp435(e_2) { return !e_2.includes("ripgrep") && !e_2.includes("bwrap") && !e_2.includes("socat"); @@ -665232,20 +587798,20 @@ var exports_sandbox_toggle = {}; __export(exports_sandbox_toggle, { call: () => call57 }); -import { relative as relative29 } from "path"; +import { relative as relative27 } from "path"; async function call57(onDone, _context, args) { const settings = getSettings_DEPRECATED(); const themeName = settings.theme || "light"; - const platform6 = getPlatform(); + const platform5 = getPlatform(); if (!SandboxManager2.isSupportedPlatform()) { - const errorMessage2 = platform6 === "wsl" ? "Error: Sandboxing requires WSL2. WSL1 is not supported." : "Error: Sandboxing is currently only supported on macOS, Linux, and WSL2."; + const errorMessage2 = platform5 === "wsl" ? "Error: Sandboxing requires WSL2. WSL1 is not supported." : "Error: Sandboxing is currently only supported on macOS, Linux, and WSL2."; const message = color("error", themeName)(errorMessage2); onDone(message); return null; } const depCheck = SandboxManager2.checkDependencies(); if (!SandboxManager2.isPlatformInEnabledList()) { - const message = color("error", themeName)(`Error: Sandboxing is disabled for this platform (${platform6}) via the enabledPlatforms setting.`); + const message = color("error", themeName)(`Error: Sandboxing is disabled for this platform (${platform5}) via the enabledPlatforms setting.`); onDone(message); return null; } @@ -665274,7 +587840,7 @@ async function call57(onDone, _context, args) { const cleanPattern = commandPattern.replace(/^["']|["']$/g, ""); addToExcludedCommands(cleanPattern); const localSettingsPath = getSettingsFilePathForSource("localSettings"); - const relativePath = localSettingsPath ? relative29(getCwdState(), localSettingsPath) : ".claude/settings.local.json"; + const relativePath = localSettingsPath ? relative27(getCwdState(), localSettingsPath) : ".claude/settings.local.json"; const message = color("success", themeName)(`Added "${cleanPattern}" to excluded commands in ${relativePath}`); onDone(message); return null; @@ -665339,14 +587905,14 @@ var init_sandbox_toggle2 = __esm(() => { // src/utils/claudeInChrome/setupPortable.ts import { readdir as readdir31 } from "fs/promises"; -import { homedir as homedir33 } from "os"; -import { join as join142 } from "path"; +import { homedir as homedir31 } from "os"; +import { join as join132 } from "path"; function getExtensionIds() { return process.env.USER_TYPE === "ant" ? [PROD_EXTENSION_ID, DEV_EXTENSION_ID, ANT_EXTENSION_ID] : [PROD_EXTENSION_ID]; } -async function detectExtensionInstallationPortable(browserPaths, log2) { +async function detectExtensionInstallationPortable(browserPaths, log) { if (browserPaths.length === 0) { - log2?.(`[Claude in Chrome] No browser paths to check`); + log?.(`[Claude in Chrome] No browser paths to check`); return { isInstalled: false, browser: null }; } const extensionIds = getExtensionIds(); @@ -665363,25 +587929,25 @@ async function detectExtensionInstallationPortable(browserPaths, log2) { } const profileDirs = browserProfileEntries.filter((entry) => entry.isDirectory()).filter((entry) => entry.name === "Default" || entry.name.startsWith("Profile ")).map((entry) => entry.name); if (profileDirs.length > 0) { - log2?.(`[Claude in Chrome] Found ${browser} profiles: ${profileDirs.join(", ")}`); + log?.(`[Claude in Chrome] Found ${browser} profiles: ${profileDirs.join(", ")}`); } for (const profile of profileDirs) { for (const extensionId of extensionIds) { - const extensionPath = join142(browserBasePath, profile, "Extensions", extensionId); + const extensionPath = join132(browserBasePath, profile, "Extensions", extensionId); try { await readdir31(extensionPath); - log2?.(`[Claude in Chrome] Extension ${extensionId} found in ${browser} ${profile}`); + log?.(`[Claude in Chrome] Extension ${extensionId} found in ${browser} ${profile}`); return { isInstalled: true, browser }; } catch {} } } } - log2?.(`[Claude in Chrome] Extension not found in any browser`); + log?.(`[Claude in Chrome] Extension not found in any browser`); return { isInstalled: false, browser: null }; } -async function isChromeExtensionInstalledPortable(browserPaths, log2) { - const result3 = await detectExtensionInstallationPortable(browserPaths, log2); - return result3.isInstalled; +async function isChromeExtensionInstalledPortable(browserPaths, log) { + const result2 = await detectExtensionInstallationPortable(browserPaths, log); + return result2.isInstalled; } var PROD_EXTENSION_ID = "fcoeoabgfenejglbffodgkkbkcdhcgfn", DEV_EXTENSION_ID = "dihbgbndebgnbjfmelmegjepbnkhlgni", ANT_EXTENSION_ID = "dngcpimnedloihjnnfngkgjoidhnaolf"; var init_setupPortable = __esm(() => { @@ -665389,10 +587955,10 @@ var init_setupPortable = __esm(() => { }); // src/utils/claudeInChrome/setup.ts -import { chmod as chmod10, mkdir as mkdir45, readFile as readFile54, writeFile as writeFile50 } from "fs/promises"; -import { homedir as homedir34 } from "os"; -import { join as join143 } from "path"; -import { fileURLToPath as fileURLToPath7 } from "url"; +import { chmod as chmod10, mkdir as mkdir45, readFile as readFile53, writeFile as writeFile48 } from "fs/promises"; +import { homedir as homedir32 } from "os"; +import { join as join133 } from "path"; +import { fileURLToPath as fileURLToPath6 } from "url"; function shouldEnableClaudeInChrome(chromeFlag) { if (getIsNonInteractiveSession() && chromeFlag !== true) { return false; @@ -665409,9 +587975,9 @@ function shouldEnableClaudeInChrome(chromeFlag) { if (isEnvDefinedFalsy(process.env.CLAUDE_CODE_ENABLE_CFC)) { return false; } - const config6 = getGlobalConfig(); - if (config6.claudeInChromeDefaultEnabled !== undefined) { - return config6.claudeInChromeDefaultEnabled; + const config4 = getGlobalConfig(); + if (config4.claudeInChromeDefaultEnabled !== undefined) { + return config4.claudeInChromeDefaultEnabled; } return false; } @@ -665425,11 +587991,11 @@ function shouldAutoEnableClaudeInChrome() { function setupClaudeInChrome() { const isNativeBuild = isInBundledMode(); const allowedTools = BROWSER_TOOLS.map((tool) => `mcp__claude-in-chrome__${tool.name}`); - const env5 = {}; + const env4 = {}; if (getSessionBypassPermissionsMode()) { - env5.CLAUDE_CHROME_PERMISSION_MODE = "skip_all_permission_checks"; + env4.CLAUDE_CHROME_PERMISSION_MODE = "skip_all_permission_checks"; } - const hasEnv = Object.keys(env5).length > 0; + const hasEnv = Object.keys(env4).length > 0; if (isNativeBuild) { const execCommand = `"${process.execPath}" --chrome-native-host`; createWrapperScript(execCommand).then((manifestBinaryPath) => installChromeNativeHostManifest(manifestBinaryPath)).catch((e) => logForDebugging(`[Claude in Chrome] Failed to install native host: ${e}`, { level: "error" })); @@ -665440,16 +588006,16 @@ function setupClaudeInChrome() { command: process.execPath, args: ["--claude-in-chrome-mcp"], scope: "dynamic", - ...hasEnv && { env: env5 } + ...hasEnv && { env: env4 } } }, allowedTools, systemPrompt: getChromeSystemPrompt() }; } else { - const __filename3 = fileURLToPath7(import.meta.url); - const __dirname3 = join143(__filename3, ".."); - const cliPath = join143(__dirname3, "cli.js"); + const __filename3 = fileURLToPath6(import.meta.url); + const __dirname3 = join133(__filename3, ".."); + const cliPath = join133(__dirname3, "cli.js"); createWrapperScript(`"${process.execPath}" "${cliPath}" --chrome-native-host`).then((manifestBinaryPath) => installChromeNativeHostManifest(manifestBinaryPath)).catch((e) => logForDebugging(`[Claude in Chrome] Failed to install native host: ${e}`, { level: "error" })); const mcpConfig = { [CLAUDE_IN_CHROME_MCP_SERVER_NAME]: { @@ -665457,7 +588023,7 @@ function setupClaudeInChrome() { command: process.execPath, args: [`${cliPath}`, "--claude-in-chrome-mcp"], scope: "dynamic", - ...hasEnv && { env: env5 } + ...hasEnv && { env: env4 } } }; return { @@ -665468,13 +588034,13 @@ function setupClaudeInChrome() { } } function getNativeMessagingHostsDirs() { - const platform6 = getPlatform(); - if (platform6 === "windows") { - const home = homedir34(); - const appData = process.env.APPDATA || join143(home, "AppData", "Local"); - return [join143(appData, "Claude Code", "ChromeNativeHost")]; + const platform5 = getPlatform(); + if (platform5 === "windows") { + const home = homedir32(); + const appData = process.env.APPDATA || join133(home, "AppData", "Local"); + return [join133(appData, "Claude Code", "ChromeNativeHost")]; } - return getAllNativeMessagingHostsDirs().map(({ path: path26 }) => path26); + return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21); } async function installChromeNativeHostManifest(manifestBinaryPath) { const manifestDirs = getNativeMessagingHostsDirs(); @@ -665497,22 +588063,22 @@ async function installChromeNativeHostManifest(manifestBinaryPath) { const manifestContent = jsonStringify(manifest, null, 2); let anyManifestUpdated = false; for (const manifestDir of manifestDirs) { - const manifestPath = join143(manifestDir, NATIVE_HOST_MANIFEST_NAME); - const existingContent = await readFile54(manifestPath, "utf-8").catch(() => null); + const manifestPath = join133(manifestDir, NATIVE_HOST_MANIFEST_NAME); + const existingContent = await readFile53(manifestPath, "utf-8").catch(() => null); if (existingContent === manifestContent) { continue; } try { await mkdir45(manifestDir, { recursive: true }); - await writeFile50(manifestPath, manifestContent); + await writeFile48(manifestPath, manifestContent); logForDebugging(`[Claude in Chrome] Installed native host manifest at: ${manifestPath}`); anyManifestUpdated = true; - } catch (error46) { - logForDebugging(`[Claude in Chrome] Failed to install manifest at ${manifestPath}: ${error46}`); + } catch (error42) { + logForDebugging(`[Claude in Chrome] Failed to install manifest at ${manifestPath}: ${error42}`); } } if (getPlatform() === "windows") { - const manifestPath = join143(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME); + const manifestPath = join133(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME); registerWindowsNativeHosts(manifestPath); } if (anyManifestUpdated) { @@ -665539,20 +588105,20 @@ function registerWindowsNativeHosts(manifestPath) { "/d", manifestPath, "/f" - ]).then((result3) => { - if (result3.code === 0) { + ]).then((result2) => { + if (result2.code === 0) { logForDebugging(`[Claude in Chrome] Registered native host for ${browser} in Windows registry: ${fullKey}`); } else { - logForDebugging(`[Claude in Chrome] Failed to register native host for ${browser} in Windows registry: ${result3.stderr}`); + logForDebugging(`[Claude in Chrome] Failed to register native host for ${browser} in Windows registry: ${result2.stderr}`); } }); } } async function createWrapperScript(command7) { - const platform6 = getPlatform(); - const chromeDir = join143(getClaudeConfigHomeDir(), "chrome"); - const wrapperPath = platform6 === "windows" ? join143(chromeDir, "chrome-native-host.bat") : join143(chromeDir, "chrome-native-host"); - const scriptContent = platform6 === "windows" ? `@echo off + const platform5 = getPlatform(); + const chromeDir = join133(getClaudeConfigHomeDir(), "chrome"); + const wrapperPath = platform5 === "windows" ? join133(chromeDir, "chrome-native-host.bat") : join133(chromeDir, "chrome-native-host"); + const scriptContent = platform5 === "windows" ? `@echo off REM Chrome native host wrapper script REM Generated by Claude Code - do not edit manually ${command7} @@ -665561,13 +588127,13 @@ ${command7} # Generated by Claude Code - do not edit manually exec ${command7} `; - const existingContent = await readFile54(wrapperPath, "utf-8").catch(() => null); + const existingContent = await readFile53(wrapperPath, "utf-8").catch(() => null); if (existingContent === scriptContent) { return wrapperPath; } await mkdir45(chromeDir, { recursive: true }); - await writeFile50(wrapperPath, scriptContent); - if (platform6 !== "windows") { + await writeFile48(wrapperPath, scriptContent); + if (platform5 !== "windows") { await chmod10(wrapperPath, 493); } logForDebugging(`[Claude in Chrome] Created Chrome native host wrapper script: ${wrapperPath}`); @@ -665578,8 +588144,8 @@ function isChromeExtensionInstalled_CACHED_MAY_BE_STALE() { if (!isInstalled) { return; } - const config6 = getGlobalConfig(); - if (config6.cachedChromeExtensionInstalled !== isInstalled) { + const config4 = getGlobalConfig(); + if (config4.cachedChromeExtensionInstalled !== isInstalled) { saveGlobalConfig((prev) => ({ ...prev, cachedChromeExtensionInstalled: isInstalled @@ -665599,7 +588165,7 @@ async function isChromeExtensionInstalled() { } var CHROME_EXTENSION_RECONNECT_URL = "https://clau.de/chrome/reconnect", NATIVE_HOST_IDENTIFIER = "com.anthropic.claude_code_browser_extension", NATIVE_HOST_MANIFEST_NAME, shouldAutoEnable = undefined; var init_setup2 = __esm(() => { - init_src2(); + init_claude_for_chrome_mcp(); init_state(); init_growthbook(); init_config2(); @@ -665985,13 +588551,13 @@ function _temp167(s) { } var import_compiler_runtime274, import_react189, jsx_dev_runtime351, CHROME_EXTENSION_URL = "https://claude.ai/chrome", CHROME_PERMISSIONS_URL = "https://clau.de/chrome/permissions", CHROME_RECONNECT_URL = "https://clau.de/chrome/reconnect", call58 = async function(onDone) { const isExtensionInstalled = await isChromeExtensionInstalled(); - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); const isSubscriber = isClaudeAISubscriber(); const isWSL = env3.isWslEnvironment(); return /* @__PURE__ */ jsx_dev_runtime351.jsxDEV(ClaudeInChromeMenu, { onDone, isExtensionInstalled, - configEnabled: config6.claudeInChromeDefaultEnabled, + configEnabled: config4.claudeInChromeDefaultEnabled, isClaudeAISubscriber: isSubscriber, isWSL }, undefined, false, undefined, this); @@ -666003,7 +588569,7 @@ var init_chrome = __esm(() => { init_Dialog(); init_ink2(); init_AppState(); - init_auth2(); + init_auth(); init_browser(); init_common3(); init_setup2(); @@ -666103,11 +588669,11 @@ Use "/advisor unset" to disable or "/advisor " to change.` } const normalizedModel = normalizeModelStringForAPI(arg); const resolvedModel = parseUserSpecifiedModel(arg); - const { valid, error: error46 } = await validateModel(resolvedModel); + const { valid, error: error42 } = await validateModel(resolvedModel); if (!valid) { return { type: "text", - value: error46 ? `Invalid advisor model: ${error46}` : `Unknown model: ${arg} (${resolvedModel})` + value: error42 ? `Invalid advisor model: ${error42}` : `Unknown model: ${arg} (${resolvedModel})` }; } if (!isValidAdvisorModel(resolvedModel)) { @@ -666157,17 +588723,17 @@ var init_advisor2 = __esm(() => { // src/skills/bundledSkills.ts import { constants as fsConstants5 } from "fs"; import { mkdir as mkdir46, open as open13 } from "fs/promises"; -import { dirname as dirname60, isAbsolute as isAbsolute25, join as join144, normalize as normalize13, sep as pathSep2 } from "path"; +import { dirname as dirname56, isAbsolute as isAbsolute24, join as join134, normalize as normalize12, sep as pathSep2 } from "path"; function registerBundledSkill(definition) { - const { files: files3 } = definition; + const { files: files2 } = definition; let skillRoot; let getPromptForCommand = definition.getPromptForCommand; - if (files3 && Object.keys(files3).length > 0) { + if (files2 && Object.keys(files2).length > 0) { skillRoot = getBundledSkillExtractDir(definition.name); let extractionPromise; const inner = definition.getPromptForCommand; getPromptForCommand = async (args, ctx) => { - extractionPromise ??= extractBundledSkillFiles(definition.name, files3); + extractionPromise ??= extractBundledSkillFiles(definition.name, files2); const extractedDir = await extractionPromise; const blocks = await inner(args, ctx); if (extractedDir === null) @@ -666205,32 +588771,32 @@ function getBundledSkills() { return [...bundledSkills]; } function getBundledSkillExtractDir(skillName) { - return join144(getBundledSkillsRoot(), skillName); + return join134(getBundledSkillsRoot(), skillName); } -async function extractBundledSkillFiles(skillName, files3) { +async function extractBundledSkillFiles(skillName, files2) { const dir = getBundledSkillExtractDir(skillName); try { - await writeSkillFiles(dir, files3); + await writeSkillFiles(dir, files2); return dir; } catch (e) { logForDebugging(`Failed to extract bundled skill '${skillName}' to ${dir}: ${e instanceof Error ? e.message : String(e)}`); return null; } } -async function writeSkillFiles(dir, files3) { +async function writeSkillFiles(dir, files2) { const byParent = new Map; - for (const [relPath, content] of Object.entries(files3)) { + for (const [relPath, content] of Object.entries(files2)) { const target = resolveSkillFilePath(dir, relPath); - const parent3 = dirname60(target); + const parent2 = dirname56(target); const entry = [target, content]; - const group = byParent.get(parent3); + const group = byParent.get(parent2); if (group) group.push(entry); else - byParent.set(parent3, [entry]); + byParent.set(parent2, [entry]); } - await Promise.all([...byParent].map(async ([parent3, entries]) => { - await mkdir46(parent3, { recursive: true, mode: 448 }); + await Promise.all([...byParent].map(async ([parent2, entries]) => { + await mkdir46(parent2, { recursive: true, mode: 448 }); await Promise.all(entries.map(([p, c6]) => safeWriteFile(p, c6))); })); } @@ -666243,11 +588809,11 @@ async function safeWriteFile(p, content) { } } function resolveSkillFilePath(baseDir, relPath) { - const normalized = normalize13(relPath); - if (isAbsolute25(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) { + const normalized = normalize12(relPath); + if (isAbsolute24(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) { throw new Error(`bundled skill file path escapes skill dir: ${relPath}`); } - return join144(baseDir, normalized); + return join134(baseDir, normalized); } function prependBaseDir(blocks, baseDir) { const prefix = `Base directory for this skill: ${baseDir} @@ -666312,8 +588878,8 @@ function WorktreeExitDialog({ recordWorktreeExit(); getPlansDirectory.cache.clear?.(); setResultMessage("Worktree removed (no changes)"); - }).catch((error46) => { - logForDebugging(`Failed to clean up worktree: ${error46}`, { + }).catch((error42) => { + logForDebugging(`Failed to clean up worktree: ${error42}`, { level: "error" }); setResultMessage("Worktree cleanup failed, exiting anyway"); @@ -666394,8 +588960,8 @@ function WorktreeExitDialog({ setCwd(worktreeSession.originalCwd); recordWorktreeExit(); getPlansDirectory.cache.clear?.(); - } catch (error46) { - logForDebugging(`Failed to clean up worktree: ${error46}`, { + } catch (error42) { + logForDebugging(`Failed to clean up worktree: ${error42}`, { level: "error" }); setResultMessage("Worktree cleanup failed, exiting anyway"); @@ -666565,14 +589131,14 @@ var exports_exit = {}; __export(exports_exit, { call: () => call61 }); -import { spawnSync as spawnSync6 } from "child_process"; +import { spawnSync as spawnSync5 } from "child_process"; function getRandomGoodbyeMessage2() { return sample_default(GOODBYE_MESSAGES2) ?? "Goodbye!"; } async function call61(onDone) { if (feature("BG_SESSIONS") && isBgSession()) { onDone(); - spawnSync6("tmux", ["detach-client"], { + spawnSync5("tmux", ["detach-client"], { stdio: "ignore" }); return null; @@ -666616,7 +589182,7 @@ var init_exit2 = __esm(() => { }); // src/components/ExportDialog.tsx -import { join as join145 } from "path"; +import { join as join135 } from "path"; function ExportDialog({ content, defaultFilename, @@ -666649,7 +589215,7 @@ function ExportDialog({ }; const handleFilenameSubmit = () => { const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt"; - const filepath = join145(getCwd(), finalFilename); + const filepath = join135(getCwd(), finalFilename); try { writeFileSync_DEPRECATED(filepath, content, { encoding: "utf-8", @@ -666659,10 +589225,10 @@ function ExportDialog({ success: true, message: `Conversation exported to: ${filepath}` }); - } catch (error46) { + } catch (error42) { onDone({ success: false, - message: `Failed to export conversation: ${error46 instanceof Error ? error46.message : "Unknown error"}` + message: `Failed to export conversation: ${error42 instanceof Error ? error42.message : "Unknown error"}` }); } }; @@ -666815,9 +589381,9 @@ async function streamRenderedMessages(messages, tools, sink2, { chunkSize = 40, onProgress } = {}) { - const renderChunk = (range3) => renderToAnsiString(/* @__PURE__ */ jsx_dev_runtime356.jsxDEV(AppStateProvider, { + const renderChunk = (range2) => renderToAnsiString(/* @__PURE__ */ jsx_dev_runtime356.jsxDEV(AppStateProvider, { children: /* @__PURE__ */ jsx_dev_runtime356.jsxDEV(StaticKeybindingProvider, { - children: /* @__PURE__ */ jsx_dev_runtime356.jsxDEV(Messages5, { + children: /* @__PURE__ */ jsx_dev_runtime356.jsxDEV(Messages3, { messages, tools, commands: [], @@ -666831,7 +589397,7 @@ async function streamRenderedMessages(messages, tools, sink2, { streamingToolUses: [], showAllInTranscript: true, isLoading: false, - renderRange: range3 + renderRange: range2 }, undefined, false, undefined, this) }, undefined, false, undefined, this) }, undefined, false, undefined, this), columns); @@ -666848,7 +589414,7 @@ async function streamRenderedMessages(messages, tools, sink2, { } async function renderMessagesToPlainText(messages, tools = [], columns) { const parts = []; - await streamRenderedMessages(messages, tools, (chunk3) => void parts.push(stripAnsi(chunk3)), { + await streamRenderedMessages(messages, tools, (chunk2) => void parts.push(stripAnsi(chunk2)), { columns }); return parts.join(""); @@ -666872,7 +589438,7 @@ __export(exports_export, { extractFirstPrompt: () => extractFirstPrompt, call: () => call62 }); -import { join as join146 } from "path"; +import { join as join136 } from "path"; function formatTimestamp(date9) { const year = date9.getFullYear(); const month = String(date9.getMonth() + 1).padStart(2, "0"); @@ -666888,24 +589454,24 @@ function extractFirstPrompt(messages) { return ""; } const content = firstUserMessage.message?.content; - let result3 = ""; + let result2 = ""; if (typeof content === "string") { - result3 = content.trim(); + result2 = content.trim(); } else if (Array.isArray(content)) { const textContent = content.find((item) => item.type === "text"); if (textContent && "text" in textContent) { - result3 = textContent.text.trim(); + result2 = textContent.text.trim(); } } - result3 = result3.split(` + result2 = result2.split(` `)[0] || ""; - if (result3.length > 50) { - result3 = result3.substring(0, 49) + "…"; + if (result2.length > 50) { + result2 = result2.substring(0, 49) + "…"; } - return result3; + return result2; } -function sanitizeFilename(text2) { - return text2.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, ""); +function sanitizeFilename(text) { + return text.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, ""); } async function exportWithReactRenderer(context2) { const tools = context2.options.tools || []; @@ -666916,7 +589482,7 @@ async function call62(onDone, context2, args) { const filename = args.trim(); if (filename) { const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt"; - const filepath = join146(getCwd(), finalFilename); + const filepath = join136(getCwd(), finalFilename); try { writeFileSync_DEPRECATED(filepath, content, { encoding: "utf-8", @@ -666924,8 +589490,8 @@ async function call62(onDone, context2, args) { }); onDone(`Conversation exported to: ${filepath}`); return null; - } catch (error46) { - onDone(`Failed to export conversation: ${error46 instanceof Error ? error46.message : "Unknown error"}`); + } catch (error42) { + onDone(`Failed to export conversation: ${error42 instanceof Error ? error42.message : "Unknown error"}`); return null; } } @@ -666941,8 +589507,8 @@ async function call62(onDone, context2, args) { return /* @__PURE__ */ jsx_dev_runtime357.jsxDEV(ExportDialog, { content, defaultFilename, - onDone: (result3) => { - onDone(result3.message); + onDone: (result2) => { + onDone(result2.message); } }, undefined, false, undefined, this); } @@ -667139,8 +589705,8 @@ function SetModelAndClose({ display: "system" }); } - } catch (error46) { - onDone(`Failed to validate model: ${error46.message}`, { + } catch (error42) { + onDone(`Failed to validate model: ${error42.message}`, { display: "system" }); } @@ -667594,14 +590160,14 @@ async function getEnvironmentSelectionInfo() { } const mergedSettings = getSettings_DEPRECATED(); const defaultEnvironmentId = mergedSettings?.remote?.defaultEnvironmentId; - let selectedEnvironment = environments.find((env5) => env5.kind !== "bridge") ?? environments[0]; + let selectedEnvironment = environments.find((env4) => env4.kind !== "bridge") ?? environments[0]; let selectedEnvironmentSource = null; if (defaultEnvironmentId) { - const matchingEnvironment = environments.find((env5) => env5.environment_id === defaultEnvironmentId); + const matchingEnvironment = environments.find((env4) => env4.environment_id === defaultEnvironmentId); if (matchingEnvironment) { selectedEnvironment = matchingEnvironment; - for (let i4 = SETTING_SOURCES.length - 1;i4 >= 0; i4--) { - const source = SETTING_SOURCES[i4]; + for (let i3 = SETTING_SOURCES.length - 1;i3 >= 0; i3--) { + const source = SETTING_SOURCES[i3]; if (!source || source === "flagSettings") { continue; } @@ -667642,7 +590208,7 @@ function RemoteEnvironmentDialog(t0) { const [environments, setEnvironments] = import_react193.useState(t1); const [selectedEnvironment, setSelectedEnvironment] = import_react193.useState(null); const [selectedEnvironmentSource, setSelectedEnvironmentSource] = import_react193.useState(null); - const [error46, setError] = import_react193.useState(null); + const [error42, setError] = import_react193.useState(null); let t2; let t3; if ($2[1] === Symbol.for("react.memo_cache_sentinel")) { @@ -667650,20 +590216,20 @@ function RemoteEnvironmentDialog(t0) { let cancelled = false; const fetchInfo = async function fetchInfo() { try { - const result3 = await getEnvironmentSelectionInfo(); + const result2 = await getEnvironmentSelectionInfo(); if (cancelled) { return; } - setEnvironments(result3.availableEnvironments); - setSelectedEnvironment(result3.selectedEnvironment); - setSelectedEnvironmentSource(result3.selectedEnvironmentSource); + setEnvironments(result2.availableEnvironments); + setSelectedEnvironment(result2.selectedEnvironment); + setSelectedEnvironmentSource(result2.selectedEnvironmentSource); setLoadingState(null); } catch (t42) { - const err3 = t42; + const err2 = t42; if (cancelled) { return; } - const fetchError = toError(err3); + const fetchError = toError(err2); logError2(fetchError); setError(fetchError.message); setLoadingState(null); @@ -667690,7 +590256,7 @@ function RemoteEnvironmentDialog(t0) { return; } setLoadingState("updating"); - const selectedEnv = environments.find((env5) => env5.environment_id === value); + const selectedEnv = environments.find((env4) => env4.environment_id === value); if (!selectedEnv) { onDone("Error: Selected environment not found"); return; @@ -667734,17 +590300,17 @@ function RemoteEnvironmentDialog(t0) { } return t6; } - if (error46) { + if (error42) { let t52; - if ($2[9] !== error46) { + if ($2[9] !== error42) { t52 = /* @__PURE__ */ jsx_dev_runtime360.jsxDEV(ThemedText, { color: "error", children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this); - $2[9] = error46; + $2[9] = error42; $2[10] = t52; } else { t52 = $2[10]; @@ -668038,23 +590604,23 @@ function MultipleEnvironmentsContent(t0) { } return t7; } -function _temp169(env5) { +function _temp169(env4) { return { label: /* @__PURE__ */ jsx_dev_runtime360.jsxDEV(ThemedText, { children: [ - env5.name, + env4.name, " ", /* @__PURE__ */ jsx_dev_runtime360.jsxDEV(ThemedText, { dimColor: true, children: [ "(", - env5.environment_id, + env4.environment_id, ")" ] }, undefined, true, undefined, this) ] }, undefined, true, undefined, this), - value: env5.environment_id + value: env4.environment_id }; } var import_compiler_runtime278, import_react193, jsx_dev_runtime360, DIALOG_TITLE = "Select Remote Environment", SETUP_HINT = `Configure environments at: https://claude.ai/code`; @@ -668099,7 +590665,7 @@ var init_remote_env = __esm(() => { var remote_env_default; var init_remote_env2 = __esm(() => { init_policyLimits(); - init_auth2(); + init_auth(); remote_env_default = { type: "local-jsx", name: "remote-env", @@ -668142,8 +590708,8 @@ async function call67(onDone, context2) { onDone(success2 ? "Login successful" : "Login interrupted"); } }, undefined, false, undefined, this); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); setTimeout(onDone, 0, "Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade."); } return null; @@ -668151,7 +590717,7 @@ async function call67(onDone, context2) { var jsx_dev_runtime362; var init_upgrade = __esm(() => { init_getOauthProfile(); - init_auth2(); + init_auth(); init_browser(); init_log3(); init_login(); @@ -668161,7 +590727,7 @@ var init_upgrade = __esm(() => { // src/commands/upgrade/index.ts var upgrade, upgrade_default; var init_upgrade2 = __esm(() => { - init_auth2(); + init_auth(); init_envUtils(); upgrade = { type: "local-jsx", @@ -668386,7 +590952,7 @@ var init_rate_limit_options = __esm(() => { init_growthbook(); init_analytics(); init_claudeAiLimitsHook(); - init_auth2(); + init_auth(); init_billing(); init_extra_usage(); init_extra_usage2(); @@ -668398,7 +590964,7 @@ var init_rate_limit_options = __esm(() => { // src/commands/rate-limit-options/index.ts var rateLimitOptions, rate_limit_options_default; var init_rate_limit_options2 = __esm(() => { - init_auth2(); + init_auth(); rateLimitOptions = { type: "local-jsx", name: "rate-limit-options", @@ -668450,12 +591016,12 @@ __export(exports_effort, { function setEffortValue(effortValue) { const persistable = toPersistableEffort(effortValue); if (persistable !== undefined) { - const result3 = updateSettingsForSource("userSettings", { + const result2 = updateSettingsForSource("userSettings", { effortLevel: persistable }); - if (result3.error) { + if (result2.error) { return { - message: `Failed to set effort level: ${result3.error.message}` + message: `Failed to set effort level: ${result2.error.message}` }; } } @@ -668504,12 +591070,12 @@ function showCurrentEffort(appStateEffort, model) { }; } function unsetEffortLevel() { - const result3 = updateSettingsForSource("userSettings", { + const result2 = updateSettingsForSource("userSettings", { effortLevel: undefined }); - if (result3.error) { + if (result2.error) { return { - message: `Failed to set effort level: ${result3.error.message}` + message: `Failed to set effort level: ${result2.error.message}` }; } logEvent("tengu_effort_command", { @@ -668562,14 +591128,14 @@ function _temp170(s) { function ApplyEffortAndClose(t0) { const $2 = import_compiler_runtime280.c(6); const { - result: result3, + result: result2, onDone } = t0; const setAppState = useSetAppState(); const { effortUpdate, message - } = result3; + } = result2; let t1; let t2; if ($2[0] !== effortUpdate || $2[1] !== message || $2[2] !== onDone || $2[3] !== setAppState) { @@ -668614,9 +591180,9 @@ Effort levels: onDone }, undefined, false, undefined, this); } - const result3 = executeEffort(args); + const result2 = executeEffort(args); return /* @__PURE__ */ jsx_dev_runtime364.jsxDEV(ApplyEffortAndClose, { - result: result3, + result: result2, onDone }, undefined, false, undefined, this); } @@ -668679,67 +591245,67 @@ var require_asciichart = __commonJS((exports) => { series = [series]; } cfg = typeof cfg !== "undefined" ? cfg : {}; - let min3 = typeof cfg.min !== "undefined" ? cfg.min : series[0][0]; - let max5 = typeof cfg.max !== "undefined" ? cfg.max : series[0][0]; + let min2 = typeof cfg.min !== "undefined" ? cfg.min : series[0][0]; + let max3 = typeof cfg.max !== "undefined" ? cfg.max : series[0][0]; for (let j = 0;j < series.length; j++) { - for (let i4 = 0;i4 < series[j].length; i4++) { - min3 = Math.min(min3, series[j][i4]); - max5 = Math.max(max5, series[j][i4]); + for (let i3 = 0;i3 < series[j].length; i3++) { + min2 = Math.min(min2, series[j][i3]); + max3 = Math.max(max3, series[j][i3]); } } let defaultSymbols = ["┼", "┤", "╶", "╴", "─", "╰", "╭", "╮", "╯", "│"]; - let range3 = Math.abs(max5 - min3); + let range2 = Math.abs(max3 - min2); let offset = typeof cfg.offset !== "undefined" ? cfg.offset : 3; let padding = typeof cfg.padding !== "undefined" ? cfg.padding : " "; - let height = typeof cfg.height !== "undefined" ? cfg.height : range3; + let height = typeof cfg.height !== "undefined" ? cfg.height : range2; let colors = typeof cfg.colors !== "undefined" ? cfg.colors : []; - let ratio = range3 !== 0 ? height / range3 : 1; - let min22 = Math.round(min3 * ratio); - let max22 = Math.round(max5 * ratio); + let ratio = range2 !== 0 ? height / range2 : 1; + let min22 = Math.round(min2 * ratio); + let max22 = Math.round(max3 * ratio); let rows = Math.abs(max22 - min22); let width = 0; - for (let i4 = 0;i4 < series.length; i4++) { - width = Math.max(width, series[i4].length); + for (let i3 = 0;i3 < series.length; i3++) { + width = Math.max(width, series[i3].length); } width = width + offset; let symbols = typeof cfg.symbols !== "undefined" ? cfg.symbols : defaultSymbols; - let format6 = typeof cfg.format !== "undefined" ? cfg.format : function(x4) { - return (padding + x4.toFixed(2)).slice(-padding.length); + let format6 = typeof cfg.format !== "undefined" ? cfg.format : function(x3) { + return (padding + x3.toFixed(2)).slice(-padding.length); }; - let result3 = new Array(rows + 1); - for (let i4 = 0;i4 <= rows; i4++) { - result3[i4] = new Array(width); + let result2 = new Array(rows + 1); + for (let i3 = 0;i3 <= rows; i3++) { + result2[i3] = new Array(width); for (let j = 0;j < width; j++) { - result3[i4][j] = " "; + result2[i3][j] = " "; } } for (let y2 = min22;y2 <= max22; ++y2) { - let label = format6(rows > 0 ? max5 - (y2 - min22) * range3 / rows : y2, y2 - min22); - result3[y2 - min22][Math.max(offset - label.length, 0)] = label; - result3[y2 - min22][offset - 1] = y2 == 0 ? symbols[0] : symbols[1]; + let label = format6(rows > 0 ? max3 - (y2 - min22) * range2 / rows : y2, y2 - min22); + result2[y2 - min22][Math.max(offset - label.length, 0)] = label; + result2[y2 - min22][offset - 1] = y2 == 0 ? symbols[0] : symbols[1]; } for (let j = 0;j < series.length; j++) { let currentColor = colors[j % colors.length]; let y0 = Math.round(series[j][0] * ratio) - min22; - result3[rows - y0][offset - 1] = colored(symbols[0], currentColor); - for (let x4 = 0;x4 < series[j].length - 1; x4++) { - let y02 = Math.round(series[j][x4 + 0] * ratio) - min22; - let y1 = Math.round(series[j][x4 + 1] * ratio) - min22; + result2[rows - y0][offset - 1] = colored(symbols[0], currentColor); + for (let x3 = 0;x3 < series[j].length - 1; x3++) { + let y02 = Math.round(series[j][x3 + 0] * ratio) - min22; + let y1 = Math.round(series[j][x3 + 1] * ratio) - min22; if (y02 == y1) { - result3[rows - y02][x4 + offset] = colored(symbols[4], currentColor); + result2[rows - y02][x3 + offset] = colored(symbols[4], currentColor); } else { - result3[rows - y1][x4 + offset] = colored(y02 > y1 ? symbols[5] : symbols[6], currentColor); - result3[rows - y02][x4 + offset] = colored(y02 > y1 ? symbols[7] : symbols[8], currentColor); + result2[rows - y1][x3 + offset] = colored(y02 > y1 ? symbols[5] : symbols[6], currentColor); + result2[rows - y02][x3 + offset] = colored(y02 > y1 ? symbols[7] : symbols[8], currentColor); let from = Math.min(y02, y1); let to = Math.max(y02, y1); for (let y2 = from + 1;y2 < to; y2++) { - result3[rows - y2][x4 + offset] = colored(symbols[9], currentColor); + result2[rows - y2][x3 + offset] = colored(symbols[9], currentColor); } } } } - return result3.map(function(x4) { - return x4.join(""); + return result2.map(function(x3) { + return x3.join(""); }).join(` `); }; @@ -668747,16 +591313,16 @@ var require_asciichart = __commonJS((exports) => { }); // src/utils/statsCache.ts -import { randomBytes as randomBytes18 } from "crypto"; +import { randomBytes as randomBytes17 } from "crypto"; import { open as open14 } from "fs/promises"; -import { join as join147 } from "path"; +import { join as join137 } from "path"; async function withStatsCacheLock(fn) { while (statsCacheLockPromise) { await statsCacheLockPromise; } let releaseLock2; - statsCacheLockPromise = new Promise((resolve45) => { - releaseLock2 = resolve45; + statsCacheLockPromise = new Promise((resolve39) => { + releaseLock2 = resolve39; }); try { return await fn(); @@ -668766,7 +591332,7 @@ async function withStatsCacheLock(fn) { } } function getStatsCachePath() { - return join147(getClaudeConfigHomeDir(), STATS_CACHE_FILENAME); + return join137(getClaudeConfigHomeDir(), STATS_CACHE_FILENAME); } function getEmptyCache() { return { @@ -668807,10 +591373,10 @@ function migrateStatsCache(parsed) { }; } async function loadStatsCache() { - const fs12 = getFsImplementation(); + const fs6 = getFsImplementation(); const cachePath = getStatsCachePath(); try { - const content = await fs12.readFile(cachePath, { encoding: "utf-8" }); + const content = await fs6.readFile(cachePath, { encoding: "utf-8" }); const parsed = jsonParse(content); if (parsed.version !== STATS_CACHE_VERSION) { const migrated = migrateStatsCache(parsed); @@ -668835,19 +591401,19 @@ async function loadStatsCache() { return getEmptyCache(); } return parsed; - } catch (error46) { - logForDebugging(`Failed to load stats cache: ${errorMessage(error46)}`); + } catch (error42) { + logForDebugging(`Failed to load stats cache: ${errorMessage(error42)}`); return getEmptyCache(); } } async function saveStatsCache(cache5) { - const fs12 = getFsImplementation(); + const fs6 = getFsImplementation(); const cachePath = getStatsCachePath(); - const tempPath = `${cachePath}.${randomBytes18(8).toString("hex")}.tmp`; + const tempPath = `${cachePath}.${randomBytes17(8).toString("hex")}.tmp`; try { const configDir = getClaudeConfigHomeDir(); try { - await fs12.mkdir(configDir); + await fs6.mkdir(configDir); } catch {} const content = jsonStringify(cache5, null, 2); const handle2 = await open14(tempPath, "w", 384); @@ -668857,12 +591423,12 @@ async function saveStatsCache(cache5) { } finally { await handle2.close(); } - await fs12.rename(tempPath, cachePath); + await fs6.rename(tempPath, cachePath); logForDebugging(`Stats cache saved successfully (lastComputedDate: ${cache5.lastComputedDate})`); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); try { - await fs12.unlink(tempPath); + await fs6.unlink(tempPath); } catch {} } } @@ -668918,7 +591484,7 @@ function mergeCacheWithNewStats(existingCache, newStats, newLastComputedDate) { hourCounts[hourNum] = (hourCounts[hourNum] || 0) + count4; } const totalSessions = existingCache.totalSessions + newStats.sessionStats.length; - const totalMessages = existingCache.totalMessages + newStats.sessionStats.reduce((sum3, s) => sum3 + s.messageCount, 0); + const totalMessages = existingCache.totalMessages + newStats.sessionStats.reduce((sum2, s) => sum2 + s.messageCount, 0); let longestSession = existingCache.longestSession; for (const session2 of newStats.sessionStats) { if (!longestSession || session2.duration > longestSession.duration) { @@ -668931,7 +591497,7 @@ function mergeCacheWithNewStats(existingCache, newStats, newLastComputedDate) { firstSessionDate = session2.timestamp; } } - const result3 = { + const result2 = { version: STATS_CACHE_VERSION, lastComputedDate: newLastComputedDate, dailyActivity: Array.from(dailyActivityMap.values()).sort((a2, b) => a2.date.localeCompare(b.date)), @@ -668952,9 +591518,9 @@ function mergeCacheWithNewStats(existingCache, newStats, newLastComputedDate) { const key = parseInt(count4, 10); shotDistribution[key] = (shotDistribution[key] || 0) + sessions; } - result3.shotDistribution = shotDistribution; + result2.shotDistribution = shotDistribution; } - return result3; + return result2; } function toDateString(date9) { const parts = date9.toISOString().split("T"); @@ -669110,23 +591676,23 @@ var init_heatmap = __esm(() => { }); // src/utils/ansiToSvg.ts -function parseAnsi(text2) { +function parseAnsi(text) { const lines = []; - const rawLines = text2.split(` + const rawLines = text.split(` `); for (const line of rawLines) { const spans = []; let currentColor = DEFAULT_FG; let bold2 = false; - let i4 = 0; - while (i4 < line.length) { - if (line[i4] === "\x1B" && line[i4 + 1] === "[") { - let j = i4 + 2; + let i3 = 0; + while (i3 < line.length) { + if (line[i3] === "\x1B" && line[i3 + 1] === "[") { + let j = i3 + 2; while (j < line.length && !/[A-Za-z]/.test(line[j])) { j++; } if (line[j] === "m") { - const codes = line.slice(i4 + 2, j).split(";").map(Number); + const codes = line.slice(i3 + 2, j).split(";").map(Number); let k = 0; while (k < codes.length) { const code = codes[k]; @@ -669158,14 +591724,14 @@ function parseAnsi(text2) { k++; } } - i4 = j + 1; + i3 = j + 1; continue; } - const textStart = i4; - while (i4 < line.length && line[i4] !== "\x1B") { - i4++; + const textStart = i3; + while (i3 < line.length && line[i3] !== "\x1B") { + i3++; } - const spanText = line.slice(textStart, i4); + const spanText = line.slice(textStart, i3); if (spanText) { spans.push({ text: spanText, color: currentColor, bold: bold2 }); } @@ -669200,10 +591766,10 @@ function get256Color(index) { return standardColors[index] || DEFAULT_FG; } if (index < 232) { - const i4 = index - 16; - const r = Math.floor(i4 / 36); - const g = Math.floor(i4 % 36 / 6); - const b = i4 % 6; + const i3 = index - 16; + const r = Math.floor(i3 / 36); + const g = Math.floor(i3 % 36 / 6); + const b = i3 % 6; return { r: r === 0 ? 0 : 55 + r * 40, g: g === 0 ? 0 : 55 + g * 40, @@ -669238,14 +591804,14 @@ var init_ansiToSvg = __esm(() => { }); // src/utils/ansiToPng.ts -import { deflateSync as deflateSync3 } from "zlib"; +import { deflateSync as deflateSync2 } from "zlib"; function makeFallbackGlyph() { const g = new Uint8Array(GLYPH_BYTES); for (let y2 = 2;y2 < GLYPH_H - 4; y2++) { - for (let x4 = 1;x4 < GLYPH_W - 1; x4++) { - const onBorder = y2 === 2 || y2 === GLYPH_H - 5 || x4 === 1 || x4 === GLYPH_W - 2; - if (onBorder && (x4 + y2) % 2 === 0) - g[y2 * GLYPH_W + x4] = 255; + for (let x3 = 1;x3 < GLYPH_W - 1; x3++) { + const onBorder = y2 === 2 || y2 === GLYPH_H - 5 || x3 === 1 || x3 === GLYPH_W - 2; + if (onBorder && (x3 + y2) % 2 === 0) + g[y2 * GLYPH_W + x3] = 255; } } return g; @@ -669253,15 +591819,15 @@ function makeFallbackGlyph() { function decodeFont() { const buf = Buffer.from(FONT_B64, "base64"); const count4 = buf.readUInt16LE(0); - const map7 = new Map; + const map5 = new Map; let off = 2; - for (let i4 = 0;i4 < count4; i4++) { + for (let i3 = 0;i3 < count4; i3++) { const cp = buf.readUInt32LE(off); off += 4; - map7.set(cp, buf.subarray(off, off + GLYPH_BYTES)); + map5.set(cp, buf.subarray(off, off + GLYPH_BYTES)); off += GLYPH_BYTES; } - return map7; + return map5; } function ansiToPng(ansiText, options2 = {}) { const { @@ -669297,14 +591863,14 @@ function ansiToPng(ansiText, options2 = {}) { const cellW = stringWidth(ch2); if (cellW === 0) continue; - const x4 = padX + col * GLYPH_W * scale; + const x3 = padX + col * GLYPH_W * scale; const y2 = padY + row * GLYPH_H * scale; const shade = SHADE_ALPHA[cp]; if (shade !== undefined) { - blitShade(px, width, x4, y2, span.color, background, shade, scale); + blitShade(px, width, x3, y2, span.color, background, shade, scale); } else { const glyph = FONT.get(cp) ?? FALLBACK_GLYPH; - blitGlyph(px, width, x4, y2, glyph, span.color, span.bold, scale); + blitGlyph(px, width, x3, y2, glyph, span.color, span.bold, scale); } col += cellW; } @@ -669319,30 +591885,30 @@ function lineWidthCells(line) { return w; } function fillBackground(px, bg) { - for (let i4 = 0;i4 < px.length; i4 += 4) { - px[i4] = bg.r; - px[i4 + 1] = bg.g; - px[i4 + 2] = bg.b; - px[i4 + 3] = 255; + for (let i3 = 0;i3 < px.length; i3 += 4) { + px[i3] = bg.r; + px[i3 + 1] = bg.g; + px[i3 + 2] = bg.b; + px[i3 + 3] = 255; } } -function blitShade(px, width, x4, y2, fg, bg, alpha, scale) { +function blitShade(px, width, x3, y2, fg, bg, alpha, scale) { const r = Math.round(fg.r * alpha + bg.r * (1 - alpha)); const g = Math.round(fg.g * alpha + bg.g * (1 - alpha)); const b = Math.round(fg.b * alpha + bg.b * (1 - alpha)); const cellW = GLYPH_W * scale; const cellH = GLYPH_H * scale; for (let dy = 0;dy < cellH; dy++) { - const rowBase = ((y2 + dy) * width + x4) * 4; + const rowBase = ((y2 + dy) * width + x3) * 4; for (let dx = 0;dx < cellW; dx++) { - const i4 = rowBase + dx * 4; - px[i4] = r; - px[i4 + 1] = g; - px[i4 + 2] = b; + const i3 = rowBase + dx * 4; + px[i3] = r; + px[i3 + 1] = g; + px[i3 + 2] = b; } } } -function blitGlyph(px, width, x4, y2, glyph, color3, bold2, scale) { +function blitGlyph(px, width, x3, y2, glyph, color3, bold2, scale) { for (let gy = 0;gy < GLYPH_H; gy++) { for (let gx = 0;gx < GLYPH_W; gx++) { let a2 = glyph[gy * GLYPH_W + gx]; @@ -669352,12 +591918,12 @@ function blitGlyph(px, width, x4, y2, glyph, color3, bold2, scale) { a2 = Math.min(255, a2 * 1.4); const inv = 255 - a2; for (let sy = 0;sy < scale; sy++) { - const rowBase = ((y2 + gy * scale + sy) * width + x4 + gx * scale) * 4; + const rowBase = ((y2 + gy * scale + sy) * width + x3 + gx * scale) * 4; for (let sx = 0;sx < scale; sx++) { - const i4 = rowBase + sx * 4; - px[i4] = color3.r * a2 + px[i4] * inv >> 8; - px[i4 + 1] = color3.g * a2 + px[i4 + 1] * inv >> 8; - px[i4 + 2] = color3.b * a2 + px[i4 + 2] * inv >> 8; + const i3 = rowBase + sx * 4; + px[i3] = color3.r * a2 + px[i3] * inv >> 8; + px[i3 + 1] = color3.g * a2 + px[i3 + 1] * inv >> 8; + px[i3 + 2] = color3.b * a2 + px[i3 + 2] * inv >> 8; } } } @@ -669391,12 +591957,12 @@ function makeCrcTable() { } function crc32(data) { let c6 = 4294967295; - for (let i4 = 0;i4 < data.length; i4++) { - c6 = CRC_TABLE[(c6 ^ data[i4]) & 255] ^ c6 >>> 8; + for (let i3 = 0;i3 < data.length; i3++) { + c6 = CRC_TABLE[(c6 ^ data[i3]) & 255] ^ c6 >>> 8; } return (c6 ^ 4294967295) >>> 0; } -function chunk3(type, data) { +function chunk2(type, data) { const body = Buffer.alloc(4 + data.length); body.write(type, 0, "ascii"); body.set(data, 4); @@ -669422,12 +591988,12 @@ function encodePng(px, width, height) { raw[dst] = 0; raw.set(px.subarray(y2 * stride, (y2 + 1) * stride), dst + 1); } - const idat = deflateSync3(raw); + const idat = deflateSync2(raw); return Buffer.concat([ PNG_SIG, - chunk3("IHDR", ihdr), - chunk3("IDAT", idat), - chunk3("IEND", new Uint8Array(0)) + chunk2("IHDR", ihdr), + chunk2("IDAT", idat), + chunk2("IEND", new Uint8Array(0)) ]); } var GLYPH_W = 24, GLYPH_H = 48, GLYPH_BYTES, FONT_B64 = "hQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwQEBAEAAAAAAAAAAAAAAAAAAAAAAAAAC/////EAAAAAAAAAAAAAAAAAAAAAAAAAC/////AAAAAAAAAAAAAAAAAAAAAAAAAAC/////AAAAAAAAAAAAAAAAAAAAAAAAAAC/////AAAAAAAAAAAAAAAAAAAAAAAAAACP////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA///vAAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAABw//+/AAAAAAAAAAAAAAAAAAAAAAAAAABA//+/AAAAAAAAAAAAAAAAAAAAAAAAAABA//+/AAAAAAAAAAAAAAAAAAAAAAAAAAAwv7+PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABg7/+/EAAAAAAAAAAAAAAAAAAAAAAAADD/////vwAAAAAAAAAAAAAAAAAAAAAAAID//////wAAAAAAAAAAAAAAAAAAAAAAAGD/////7wAAAAAAAAAAAAAAAAAAAAAAAADP////YAAAAAAAAAAAAAAAAAAAAAAAAAAAYIAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQEBAQAAAIEBAQEAAAAAAAAAAAAAAAABA/////wAAUP///88AAAAAAAAAAAAAAABA/////wAAQP///78AAAAAAAAAAAAAAAAg////3wAAQP///78AAAAAAAAAAAAAAAAA////vwAAQP///78AAAAAAAAAAAAAAAAA////vwAAIP///48AAAAAAAAAAAAAAAAA////vwAAAP///4AAAAAAAAAAAAAAAAAA3///nwAAAP///4AAAAAAAAAAAAAAAAAAv///gAAAAP///4AAAAAAAAAAAAAAAAAAv///gAAAAO///1AAAAAAAAAAAAAAAAAAv///gAAAAL///0AAAAAAAAAAAAAAAAAAMEBAIAAAADBAQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwQEAQAAAAAAAwQEAAAAAAAAAAAAAAAADP//8gAAAAAAD///8AAAAAAAAAAAAAAAD///8AAAAAAAD//98AAAAAAAAAAAAAABD//88AAAAAAED//78AAAAAAAAAAAAAAED//78AAAAAAED//48AAAAAAAAAAAAAAGD//4AAAAAAAID//4AAAAAAAAAAAAAAAID//3AAAAAAAI///0AAAAAAAAAAIICAgL///5+AgICAgN///5+AgEAAAAAAQP///////////////////////4AAAAAAQP///////////////////////4AAAAAAEEBAQP//30BAQEBAYP//z0BAQCAAAAAAAAAAMP//vwAAAAAAQP//rwAAAAAAAAAAAAAAQP//nwAAAAAAYP//gAAAAAAAAAAAAAAAcP//gAAAAAAAgP//YAAAAAAAAAAAAAAAgP//UAAAAAAAr///QAAAAAAAAAAAAAAAv///QAAAAAAAv///IAAAAAAAAAAAAAAAz///EAAAAAAA////AAAAAAAAAAAAAAAA////AAAAAAAQ///PAAAAAAAAAAAAAAAg//+/AAAAAABA//+/AAAAAAAAAABggICf///fgICAgICf///PgICAAAAAAAC/////////////////////////AAAAAAC/////////////////////////AAAAAAAAAACv//9AAAAAAAC///8wAAAAAAAAAAAAAAC///8wAAAAAADf//8AAAAAAAAAAAAAAADv//8AAAAAAAD//+8AAAAAAAAAAAAAAAD//+8AAAAAACD//78AAAAAAAAAAAAAAED//78AAAAAAED//68AAAAAAAAAAAAAAED//58AAAAAAHD//4AAAAAAAAAAAAAAAID//4AAAAAAAID//3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYL+/MAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAFCAz///n3AwAAAAAAAAAAAAAAAAABCA7///////////34AQAAAAAAAAAAAAEM/////////////////fUAAAAAAAAAAAz////++Pn///cIDf/////3AAAAAAAABg////rxAAgP//QAAAQN//zxAAAAAAAADP///vEAAAgP//QAAAABCfEAAAAAAAAAD///+fAAAAgP//QAAAAAAAAAAAAAAAAAD///+AAAAAgP//QAAAAAAAAAAAAAAAAAD///+/AAAAgP//QAAAAAAAAAAAAAAAAADP////MAAAgP//QAAAAAAAAAAAAAAAAABg////70AAgP//QAAAAAAAAAAAAAAAAAAAn/////+/r///QAAAAAAAAAAAAAAAAAAAAJ//////////cAAAAAAAAAAAAAAAAAAAAABQ3////////++AEAAAAAAAAAAAAAAAAAAAEGDf////////73AAAAAAAAAAAAAAAAAAAAAAj/////////+fAAAAAAAAAAAAAAAAAAAAgP//gL//////jwAAAAAAAAAAAAAAAAAAgP//QABw/////0AAAAAAAAAAAAAAAAAAgP//QAAAcP///58AAAAAAAAAAAAAAAAAgP//QAAAAO///+8AAAAAAAAAAAAAAAAAgP//QAAAAL////8AAAAAAAAAAAAAAAAAgP//QAAAAL////8AAAAAAAAAAAAAAAAAgP//QAAAAL////8AAAAAAABgMAAAAAAAgP//QAAAEP///68AAAAAADDv71AAAAAAgP//QAAAn////2AAAAAAAN////+vIAAAgP//QCCv////zwAAAAAAADDf/////8+Pv///z//////vIAAAAAAAAAAQj////////////////88gAAAAAAAAAAAAACCf7//////////PYAAAAAAAAAAAAAAAAAAAADBQv///cBAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//QAAAAAAAAAAAAAAAAAAAAAAAAAAAIEBAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQI+/r4AgAAAAAAAAAAAAAK+AAAAAABC/////////cAAAAAAAAAAAUP//nwAAAM////+/3////3AAAAAAAAAQ7///MAAAgP//7zAAAGD//+8QAAAAAACv//+AAAAA3///YAAAAACv//9wAAAAAGD//88AAAAg////AAAAAACA//+/AAAAIO//7zAAAABA////AAAAAABA//+/AAAAv///cAAAAABA////AAAAAABQ//+/AABw//+/AAAAAAAQ////EAAAAACA//+vACDv/+8gAAAAAAAAz///gAAAAADP//9gAL///3AAAAAAAAAAUP//71AAEJ///98AgP//rwAAAAAAAAAAAJ///////////0Aw///vEAAAAAAAAAAAAACA///////fQADP//9QAAAAAAAAAAAAAAAAEGCAgEAAAID//68AAAAAAAAAAAAAAAAAAAAAAAAAMP//7xAAAAAAAAAAAAAAAAAAAAAAAAAQz///QAAAAAAAAAAAAAAAAAAAAAAAAACP//+PABCAz///v2AAAAAAAAAAAAAAAED//98QMO/////////PEAAAAAAAAAAAEN///0AQ3///34+P7///rwAAAAAAAAAAj///jwCA///PEAAAMO///0AAAAAAAABA///PAADf//9QAAAAAI///58AAAAAABDv//8wABD///8AAAAAAFD//78AAAAAAK///4AAAED///8AAAAAAED///8AAAAAUP//zwAAACD///8AAAAAAED//88AAAAQ7//vMAAAAADv//9AAAAAAID//68AAACv//9wAAAAAACf//+vAAAAAN///2AAAHD//78AAAAAAAAg7///r0BAv///zwAAIO//7yAAAAAAAAAAYP/////////vMAAAYP//cAAAAAAAAAAAAEC//////68gAAAAADCAAAAAAAAAAAAAAAAAIEBAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwgI+/j3AwAAAAAAAAAAAAAAAAAAAAQM//////////z0AAAAAAAAAAAAAAAABg//////////////9gAAAAAAAAAAAAADD////PQAAAAFC////vEAAAAAAAAAAAAL///88QAAAAAAAAn+8wAAAAAAAAAAAAIP///1AAAAAAAAAAACAAAAAAAAAAAAAAQP///xAAAAAAAAAAAAAAAAAAAAAAAAAAQP///xAAAAAAAAAAAAAAAAAAAAAAAAAAIP///1AAAAAAAAAAAAAAAAAAAAAAAAAAAN///88AAAAAAAAAAAAAAAAAAAAAAAAAAFD///+fEAAAAAAAAAAAAAAAAAAAAAAAAACP////33BAQEBAQEBAQEBAQEAgAAAAAAAAQK////////////////////+AAAAAAAAAII/P//////////////////+AAAAAABCf////z4+AgICAgJ///9+AgIBAAAAAEM///+9AAAAAAAAAAED//78AAAAAAAAAn///7zAAAAAAAAAAAED//78AAAAAAAAg////cAAAAAAAAAAAAED//78AAAAAAACA////EAAAAAAAAAAAAED//78AAAAAAAC///+/AAAAAAAAAAAAAED//78AAAAAAAC///+AAAAAAAAAAAAAAED//78AAAAAAAC///+PAAAAAAAAAAAAAED//78AAAAAAACv//+/AAAAAAAAAAAAAED//78AAAAAAABw////IAAAAAAAAAAAAED//78AAAAAAAAg////rwAAAAAAAAAAAGD//78AAAAAAAAAn////58AAAAAAAAAcO///78AAAAAAAAAEM/////fj2BAYI/f////7zAAAAAAAAAAABDP///////////////PIAAAAAAAAAAAAAAAgN//////////z2AAAAAAAAAAAAAAAAAAAAAwUICAgEAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwQEBAIAAAAAAAAAAAAAAAAAAAAAAAAAC/////gAAAAAAAAAAAAAAAAAAAAAAAAAC/////UAAAAAAAAAAAAAAAAAAAAAAAAAC/////QAAAAAAAAAAAAAAAAAAAAAAAAACf////QAAAAAAAAAAAAAAAAAAAAAAAAACA////QAAAAAAAAAAAAAAAAAAAAAAAAACA////EAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAABg////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA///fAAAAAAAAAAAAAAAAAAAAAAAAAAAQQEAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABCv/2AAAAAAAAAAAAAAAAAAAAAAAAAAEM///+8QAAAAAAAAAAAAAAAAAAAAAAAQz///7zAAAAAAAAAAAAAAAAAAAAAAABDP///vIAAAAAAAAAAAAAAAAAAAAAAAAM///+8wAAAAAAAAAAAAAAAAAAAAAAAAn///7zAAAAAAAAAAAAAAAAAAAAAAAABQ////YAAAAAAAAAAAAAAAAAAAAAAAABDv//+vAAAAAAAAAAAAAAAAAAAAAAAAAJ///+8QAAAAAAAAAAAAAAAAAAAAAAAAIP///4AAAAAAAAAAAAAAAAAAAAAAAAAAj///7xAAAAAAAAAAAAAAAAAAAAAAAAAA7///nwAAAAAAAAAAAAAAAAAAAAAAAABA////UAAAAAAAAAAAAAAAAAAAAAAAAACA////EAAAAAAAAAAAAAAAAAAAAAAAAAC////PAAAAAAAAAAAAAAAAAAAAAAAAAADv//+/AAAAAAAAAAAAAAAAAAAAAAAAAAD///+AAAAAAAAAAAAAAAAAAAAAAAAAACD///+AAAAAAAAAAAAAAAAAAAAAAAAAAED///+AAAAAAAAAAAAAAAAAAAAAAAAAAED///+AAAAAAAAAAAAAAAAAAAAAAAAAAED///+AAAAAAAAAAAAAAAAAAAAAAAAAADD///+AAAAAAAAAAAAAAAAAAAAAAAAAAAD///+AAAAAAAAAAAAAAAAAAAAAAAAAAAD///+vAAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAACP////AAAAAAAAAAAAAAAAAAAAAAAAAABg////QAAAAAAAAAAAAAAAAAAAAAAAAAAQ////jwAAAAAAAAAAAAAAAAAAAAAAAAAAr///3wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///2AAAAAAAAAAAAAAAAAAAAAAAAAAAL///98AAAAAAAAAAAAAAAAAAAAAAAAAADD///+AAAAAAAAAAAAAAAAAAAAAAAAAAACP////MAAAAAAAAAAAAAAAAAAAAAAAAAAAz///3xAAAAAAAAAAAAAAAAAAAAAAAAAAIO///88QAAAAAAAAAAAAAAAAAAAAAAAAADDv//+fAAAAAAAAAAAAAAAAAAAAAAAAAAAw7///nwAAAAAAAAAAAAAAAAAAAAAAAAAAMO///88QAAAAAAAAAAAAAAAAAAAAAAAAADDv/58AAAAAAAAAAAAAAAAAAAAAAAAAAAAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwEAAAAAAAAAAAAAAAAAAAAAAAAAAAABDv7zAAAAAAAAAAAAAAAAAAAAAAAAAAAJ///+8wAAAAAAAAAAAAAAAAAAAAAAAAAACf///vMAAAAAAAAAAAAAAAAAAAAAAAAAAAn///7zAAAAAAAAAAAAAAAAAAAAAAAAAAAK///+8wAAAAAAAAAAAAAAAAAAAAAAAAABDP///fEAAAAAAAAAAAAAAAAAAAAAAAAAAg7///rwAAAAAAAAAAAAAAAAAAAAAAAAAAUP///1AAAAAAAAAAAAAAAAAAAAAAAAAAAL///98AAAAAAAAAAAAAAAAAAAAAAAAAACD///9gAAAAAAAAAAAAAAAAAAAAAAAAAACv///fAAAAAAAAAAAAAAAAAAAAAAAAAABQ////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////jwAAAAAAAAAAAAAAAAAAAAAAAAAAv///zwAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAYP///0AAAAAAAAAAAAAAAAAAAAAAAAAAQP///1AAAAAAAAAAAAAAAAAAAAAAAAAAQP///4AAAAAAAAAAAAAAAAAAAAAAAAAAIP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAEP///4AAAAAAAAAAAAAAAAAAAAAAAAAAQP///4AAAAAAAAAAAAAAAAAAAAAAAAAAQP///2AAAAAAAAAAAAAAAAAAAAAAAAAAUP///0AAAAAAAAAAAAAAAAAAAAAAAAAAgP///yAAAAAAAAAAAAAAAAAAAAAAAAAAr///7wAAAAAAAAAAAAAAAAAAAAAAAAAA7///rwAAAAAAAAAAAAAAAAAAAAAAAAAw////YAAAAAAAAAAAAAAAAAAAAAAAAACf///vEAAAAAAAAAAAAAAAAAAAAAAAABDv//+PAAAAAAAAAAAAAAAAAAAAAAAAAI///+8gAAAAAAAAAAAAAAAAAAAAAAAAMP///4AAAAAAAAAAAAAAAAAAAAAAAAAQz///zwAAAAAAAAAAAAAAAAAAAAAAAACf///vMAAAAAAAAAAAAAAAAAAAAAAAAHD///9gAAAAAAAAAAAAAAAAAAAAAAAAYP///2AAAAAAAAAAAAAAAAAAAAAAAABg////jwAAAAAAAAAAAAAAAAAAAAAAAGD///9wAAAAAAAAAAAAAAAAAAAAAAAAAGD//2AAAAAAAAAAAAAAAAAAAAAAAAAAAABgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgv7+/AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAABQ////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAABAAAAAAAABA///vAAAAAAAAAAAAAAAAMP+vUAAAAABA//+/AAAAACBwz88AAAAAj////++fQABA//+/ABBgv/////8gAAAAz////////9+v///fr/////////9wAAAAMIDP///////////////////vr2AQAAAAAAAAEGCv7//////////fj0AAAAAAAAAAAAAAAAAAAHD/////3yAAAAAAAAAAAAAAAAAAAAAAEN///////48AAAAAAAAAAAAAAAAAAAAAr///74D///9QAAAAAAAAAAAAAAAAAACA////UAC////vMAAAAAAAAAAAAAAAAED///+vAAAg7///zxAAAAAAAAAAAAAAEO///+8QAAAAUP///58AAAAAAAAAAAAAz////1AAAAAAAK////9gAAAAAAAAAAAAcO//jwAAAAAAABDv/88wAAAAAAAAAAAAADCvEAAAAAAAAABQjxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIICAYAAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAABBAQEBAQEBAcP//z0BAQEBAQEBAAAAAAED/////////////////////////AAAAAED/////////////////////////AAAAADC/v7+/v7+/z///77+/v7+/v7+/AAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAML+/jwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECvv48QAAAAAAAAAAAAAAAAAAAAAAAAQP/////PEAAAAAAAAAAAAAAAAAAAAAAAz///////cAAAAAAAAAAAAAAAAAAAAAAA////////jwAAAAAAAAAAAAAAAAAAAAAA3///////gAAAAAAAAAAAAAAAAAAAAAAAYP//////UAAAAAAAAAAAAAAAAAAAAAAAAL/////vAAAAAAAAAAAAAAAAAAAAAAAAAO////+AAAAAAAAAAAAAAAAAAAAAAAAAMP////8QAAAAAAAAAAAAAAAAAAAAAAAAcP///58AAAAAAAAAAAAAAAAAAAAAAAAAr////zAAAAAAAAAAAAAAAAAAAAAAAAAA7///vwAAAAAAAAAAAAAAAAAAAAAAAAAw////YAAAAAAAAAAAAAAAAAAAAAAAAABg///fAAAAAAAAAAAAAAAAAAAAAAAAAAAgQEAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAIAAAAAAAAAD/////////////////////gAAAAAAAAAD/////////////////////gAAAAAAAAAC/v7+/v7+/v7+/v7+/v7+/YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUK+/jxAAAAAAAAAAAAAAAAAAAAAAAABg/////+8gAAAAAAAAAAAAAAAAAAAAABD///////+fAAAAAAAAAAAAAAAAAAAAAED////////fAAAAAAAAAAAAAAAAAAAAAED////////PAAAAAAAAAAAAAAAAAAAAAADv//////+AAAAAAAAAAAAAAAAAAAAAAAAw7////78AAAAAAAAAAAAAAAAAAAAAAAAAEGCAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJ/fYAAAAAAAAAAAAAAAAAAAAAAAAAAAIP///0AAAAAAAAAAAAAAAAAAAAAAAAAAn///vwAAAAAAAAAAAAAAAAAAAAAAAAAg////YAAAAAAAAAAAAAAAAAAAAAAAAACf///fAAAAAAAAAAAAAAAAAAAAAAAAABDv//9gAAAAAAAAAAAAAAAAAAAAAAAAAID//98AAAAAAAAAAAAAAAAAAAAAAAAAEO///2AAAAAAAAAAAAAAAAAAAAAAAAAAgP//3wAAAAAAAAAAAAAAAAAAAAAAAAAQ7///YAAAAAAAAAAAAAAAAAAAAAAAAACA///fAAAAAAAAAAAAAAAAAAAAAAAAABDv//9gAAAAAAAAAAAAAAAAAAAAAAAAAID//+8QAAAAAAAAAAAAAAAAAAAAAAAAAO///4AAAAAAAAAAAAAAAAAAAAAAAAAAYP//7xAAAAAAAAAAAAAAAAAAAAAAAAAA3///gAAAAAAAAAAAAAAAAAAAAAAAAABg///vEAAAAAAAAAAAAAAAAAAAAAAAAADf//+AAAAAAAAAAAAAAAAAAAAAAAAAAGD//+8QAAAAAAAAAAAAAAAAAAAAAAAAAN///4AAAAAAAAAAAAAAAAAAAAAAAAAAYP///xAAAAAAAAAAAAAAAAAAAAAAAAAA3///nwAAAAAAAAAAAAAAAAAAAAAAAABA////IAAAAAAAAAAAAAAAAAAAAAAAAAC///+fAAAAAAAAAAAAAAAAAAAAAAAAAED///8gAAAAAAAAAAAAAAAAAAAAAAAAAL///58AAAAAAAAAAAAAAAAAAAAAAAAAQP///yAAAAAAAAAAAAAAAAAAAAAAAAAAv///nwAAAAAAAAAAAAAAAAAAAAAAAABA////IAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAACD///9AAAAAAAAAAAAAAAAAAAAAAAAAAJ///78AAAAAAAAAAAAAAAAAAAAAAAAAIP///0AAAAAAAAAAAAAAAAAAAAAAAAAAn///vwAAAAAAAAAAAAAAAAAAAAAAAAAg////QAAAAAAAAAAAAAAAAAAAAAAAAACf//+/AAAAAAAAAAAAAAAAAAAAAAAAAAAgn+9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECAv7+fcCAAAAAAAAAAAAAAAAAAAABA3/////////+fEAAAAAAAAAAAAAAAAGD/////////////zxAAAAAAAAAAAAAAMP///++AMABAj////88AAAAAAAAAAAAAz///7zAAAAAAAGD///+AAAAAAAAAAABg////cAAAAAAAAED////vAAAAAAAAAACv///fAAAAAAAAAL//////YAAAAAAAABD///+PAAAAAAAAQP//3///rwAAAAAAAFD///9AAAAAAAAAv/+fj///7wAAAAAAAID///8QAAAAAABA//8gcP///yAAAAAAAK////8AAAAAAAC//78AQP///0AAAAAAAL///88AAAAAAED//0AAQP///3AAAAAAAM///78AAAAAAL//vwAAIP///4AAAAAAAP///78AAAAAQP//QAAAAP///4AAAAAAAP///78AAAAAv/+/AAAAAP///4AAAAAAAP///78AAABA//9AAAAAAP///4AAAAAAAP///78AAAC//78AAAAAAP///4AAAAAAAL///78AAED//0AAAAAAQP///4AAAAAAAL///78AAL//vwAAAAAAQP///2AAAAAAAJ////8AQP//QAAAAAAAUP///0AAAAAAAID///8Qv/+/AAAAAAAAgP///xAAAAAAAED///+A//9AAAAAAAAAr///3wAAAAAAAADv/////78AAAAAAAAA7///nwAAAAAAAACf/////0AAAAAAAABg////QAAAAAAAAABA////vwAAAAAAABDf///fAAAAAAAAAAAAv///7zAAAAAAEM////9QAAAAAAAAAAAAEO////+fYECA3////58AAAAAAAAAAAAAADDv////////////nwAAAAAAAAAAAAAAAAAQn////////99gAAAAAAAAAAAAAAAAAAAAABBAgIBwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAQAAAAAAAAAAAAAAAAAAAAAAAAIL////9AAAAAAAAAAAAAAAAAAAAAAACA//////9AAAAAAAAAAAAAAAAAAAAAQN////////9AAAAAAAAAAAAAAAAAABCv/////7////9AAAAAAAAAAAAAAAAAcO/////fUAD///9AAAAAAAAAAAAAAAAAv////4AQAAD///9AAAAAAAAAAAAAAAAAMP+/IAAAAAD///9AAAAAAAAAAAAAAAAAAEAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAL+/v7+/v7/////Pv7+/v78wAAAAAAAAAP////////////////////9AAAAAAAAAAP////////////////////9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBQgK+/v4BgEAAAAAAAAAAAAAAAAAAQgO///////////4AQAAAAAAAAAAAAADDf///////////////PEAAAAAAAAAAAMO////+/YEBAQHDf////zwAAAAAAAAAAj///71AAAAAAAAAQz////2AAAAAAAAAAAHDvMAAAAAAAAAAAEO///88AAAAAAAAAAAAAAAAAAAAAAAAAAJ////8QAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///8wAAAAAAAAAAAAAAAAAAAAAAAAAJ////8AAAAAAAAAAAAAAAAAAAAAAAAAAN///68AAAAAAAAAAAAAAAAAAAAAAAAAQP///2AAAAAAAAAAAAAAAAAAAAAAAAAAv///3wAAAAAAAAAAAAAAAAAAAAAAAABw////UAAAAAAAAAAAAAAAAAAAAAAAADDv//+vAAAAAAAAAAAAAAAAAAAAAAAAEM///98QAAAAAAAAAAAAAAAAAAAAAAAAz///7zAAAAAAAAAAAAAAAAAAAAAAAACf////UAAAAAAAAAAAAAAAAAAAAAAAAJ////9gAAAAAAAAAAAAAAAAAAAAAAAAn////2AAAAAAAAAAAAAAAAAAAAAAAACf////YAAAAAAAAAAAAAAAAAAAAAAAAJ////9gAAAAAAAAAAAAAAAAAAAAAAAAn////2AAAAAAAAAAAAAAAAAAAAAAAACf////YAAAAAAAAAAAAAAAAAAAAAAAAJ///+8wAAAAAAAAAAAAAAAAAAAAAAAAQP/////////////////////PAAAAAAAAQP////////////////////+/AAAAAAAAQP////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQICfv7+AYBAAAAAAAAAAAAAAAAAAEIDv//////////+fEAAAAAAAAAAAAAAw3///////////////7zAAAAAAAAAAACD/////n1AQACBQv////+8gAAAAAAAAAACA/88wAAAAAAAAAHD///+fAAAAAAAAAAAAYBAAAAAAAAAAAACv////EAAAAAAAAAAAAAAAAAAAAAAAAABQ////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABg///vAAAAAAAAAAAAAAAAAAAAAAAAAADP//+PAAAAAAAAAAAAAAAAAAAAAAAAEJ///88QAAAAAAAAAAAAAAAAABBAQECP7///zxAAAAAAAAAAAAAAAAAAAED//////89gAAAAAAAAAAAAAAAAAAAAAID///////+vYAAAAAAAAAAAAAAAAAAAAECAgICv7////78QAAAAAAAAAAAAAAAAAAAAAAAAAGDv///PEAAAAAAAAAAAAAAAAAAAAAAAAABA////gAAAAAAAAAAAAAAAAAAAAAAAAAAAr///3wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///yAAAAAAAAAAAAAAAAAAAAAAAAAAcP///0AAAAAAAAAAAAAAAAAAAAAAAAAAgP///0AAAAAAAAAAAAAAAAAAAAAAAAAAj////xAAAAAAAAAAEAAAAAAAAAAAAAAA3///zwAAAAAAABCvrxAAAAAAAAAAAACA////YAAAAAAAEM///99AAAAAAAAAEI/////PAAAAAAAAAHD/////34+AgICf7////+8wAAAAAAAAAABQ7///////////////zyAAAAAAAAAAAAAAEIDf/////////89gAAAAAAAAAAAAAAAAAAAAIECAgIBAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI8gAAAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAr///rwAAAAAAAAAAAAAAAAAAAAAAAAAg////QAAAAAAAAAAAAAAAAAAAAAAAAACP///fAAAAAAAAAAAAAAAAAAAAAAAAABDv//9wAAAAAAAAAAAAAAAAAAAAAAAAAGD//+8QAAAAAAAAAAAAAAAAAAAAAAAAAN///58AAAAAAAAAAAAAAAAAAAAAAAAAQP///yAAAAAAAAAAAAAAAAAAAAAAAAAAr///vwAAAAAAAAAAAAAAAAAAAAAAAAAg////YAAAAAAAAAAAAAAAAAAAAAAAAACP///fAAAAAACPv78AAAAAAAAAAAAAABDv//+AAAAAAAD///8AAAAAAAAAAAAAAGD///8gAAAAAAD///8AAAAAAAAAAAAAAN///58AAAAAAAD///8AAAAAAAAAAAAAQP///0AAAAAAAAD///8AAAAAAAAAAAAAr///zwAAAAAAACD///8AAAAAAAAAAAAg////YAAAAAAAAED///8AAAAAAAAAAACP///vEAAAAAAAAED///8AAAAAAAAAAADv///PgICAgICAgJ////+AgIBgAAAAAAD///////////////////////+/AAAAAAD///////////////////////+/AAAAAABAQEBAQEBAQEBAQHD///9AQEAwAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAD//////////////////88AAAAAAAAAAAD//////////////////68AAAAAAAAAAAD///+fgICAgICAgICAgEAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AIHCvv7+/gCAAAAAAAAAAAAAAAAD////P//////////+PAAAAAAAAAAAAAAD/////////////////rwAAAAAAAAAAAAC/v7+fUBAAABBg3////4AAAAAAAAAAAAAAAAAAAAAAAAAAEN///+8QAAAAAAAAAAAAAAAAAAAAAAAAAGD///9wAAAAAAAAAAAAAAAAAAAAAAAAAAD///+vAAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC////vAAAAAAAAAAAAAAAAAAAAAAAAAAC////vAAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAD///+fAAAAAAAAAAAAAAAAAAAAAAAAAGD///9gAAAAAAAAADC/EAAAAAAAAAAAEN///+8QAAAAAAAAUO//32AAAAAAAAAgz////3AAAAAAAAAAYP/////fj4CAgK//////nwAAAAAAAAAAADDf//////////////+PAAAAAAAAAAAAAAAAYN//////////r0AAAAAAAAAAAAAAAAAAAAAgUICAgEAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgcJ+/v4BgEAAAAAAAAAAAAAAAAAAAIL//////////748QAAAAAAAAAAAAAABQ7////////////+8QAAAAAAAAAAAAAED////vj0AQIFCP73AAAAAAAAAAAAAAEO///88gAAAAAAAAEAAAAAAAAAAAAAAAn///7zAAAAAAAAAAAAAAAAAAAAAAAAAg////gAAAAAAAAAAAAAAAAAAAAAAAAABw///vEAAAAAAAAAAAAAAAAAAAAAAAAADP//+fAAAAAAAAAAAAAAAAAAAAAAAAABD///9QAAAAAAAAAAAAAAAAAAAAAAAAAED///8gAAAAMECAUDAAAAAAAAAAAAAAAID///8AAFDf///////fYAAAAAAAAAAAAID//78An////////////88QAAAAAAAAAL///7+f///fn4CAn+////+/AAAAAAAAAL///+///4AAAAAAABCf////YAAAAAAAAL//////QAAAAAAAAAAA3///3wAAAAAAAL////9gAAAAAAAAAAAAYP///zAAAAAAAL///88AAAAAAAAAAAAAMP///2AAAAAAAJ///78AAAAAAAAAAAAAAP///4AAAAAAAID//98AAAAAAAAAAAAAAP///4AAAAAAAGD///8AAAAAAAAAAAAAAP///4AAAAAAADD///8wAAAAAAAAAAAAMP///2AAAAAAAADv//9gAAAAAAAAAAAAUP///zAAAAAAAACf//+/AAAAAAAAAAAAn///3wAAAAAAAABA////QAAAAAAAAAAw////gAAAAAAAAAAAv///7zAAAAAAACDf///fEAAAAAAAAAAAIO////+fcEBgn////+8wAAAAAAAAAAAAADDv////////////7zAAAAAAAAAAAAAAAAAQn////////++fEAAAAAAAAAAAAAAAAAAAABBAgICAQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQDAAAAAAAAAA/////////////////////78AAAAAAAAA/////////////////////78AAAAAAAAAv7+/v7+/v7+/v7+/v+///58AAAAAAAAAAAAAAAAAAAAAAAAAIP///0AAAAAAAAAAAAAAAAAAAAAAAAAAn///zwAAAAAAAAAAAAAAAAAAAAAAAAAQ7///YAAAAAAAAAAAAAAAAAAAAAAAAACA///vAAAAAAAAAAAAAAAAAAAAAAAAAADf//+AAAAAAAAAAAAAAAAAAAAAAAAAAGD///8gAAAAAAAAAAAAAAAAAAAAAAAAAM///58AAAAAAAAAAAAAAAAAAAAAAAAAQP///zAAAAAAAAAAAAAAAAAAAAAAAAAAr///vwAAAAAAAAAAAAAAAAAAAAAAAAAg////YAAAAAAAAAAAAAAAAAAAAAAAAACf///fAAAAAAAAAAAAAAAAAAAAAAAAABDv//+AAAAAAAAAAAAAAAAAAAAAAAAAAID///8QAAAAAAAAAAAAAAAAAAAAAAAAAN///58AAAAAAAAAAAAAAAAAAAAAAAAAYP///yAAAAAAAAAAAAAAAAAAAAAAAAAAz///vwAAAAAAAAAAAAAAAAAAAAAAAABA////UAAAAAAAAAAAAAAAAAAAAAAAAACv///fAAAAAAAAAAAAAAAAAAAAAAAAACD///9wAAAAAAAAAAAAAAAAAAAAAAAAAJ///+8QAAAAAAAAAAAAAAAAAAAAAAAAEO///58AAAAAAAAAAAAAAAAAAAAAAAAAgP///yAAAAAAAAAAAAAAAAAAAAAAAAAA3///rwAAAAAAAAAAAAAAAAAAAAAAAABg////QAAAAAAAAAAAAAAAAAAAAAAAAABgz//fAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUICvv5+AMAAAAAAAAAAAAAAAAAAAAIDv/////////99gAAAAAAAAAAAAAAAQz///////////////nwAAAAAAAAAAAADP////nzAAABBQz////48AAAAAAAAAAID///9gAAAAAAAAAK////8wAAAAAAAAAN///58AAAAAAAAAABD///+PAAAAAAAAEP///2AAAAAAAAAAAAC///+/AAAAAAAAQP///0AAAAAAAAAAAAC///+/AAAAAAAAIP///0AAAAAAAAAAAAC///+vAAAAAAAAAO///48AAAAAAAAAAADv//9gAAAAAAAAAJ////8wAAAAAAAAAHD//98QAAAAAAAAACDv////gBAAAAAAYP//7zAAAAAAAAAAAAAw7/////+vUCCv///PIAAAAAAAAAAAAAAAEK///////////4AAAAAAAAAAAAAAAAAAAHDv/////////99gAAAAAAAAAAAAAAAwz///z1Bgv///////rxAAAAAAAAAAADDv//+fAAAAACCP7////88QAAAAAAAAIO///58AAAAAAAAAEK////+/AAAAAAAAn///3wAAAAAAAAAAAACf////QAAAAAAQ////jwAAAAAAAAAAAAAQ////rwAAAABA////YAAAAAAAAAAAAAAAv///3wAAAABA////QAAAAAAAAAAAAAAAv////wAAAABA////cAAAAAAAAAAAAAAAz///zwAAAAAQ////nwAAAAAAAAAAAAAg////rwAAAAAAv////zAAAAAAAAAAAACv////UAAAAAAAQP///+8wAAAAAAAAEJ////+/AAAAAAAAAGD/////r4BQQHCf7////+8QAAAAAAAAAABg7///////////////vxAAAAAAAAAAAAAAIJ/v/////////89gAAAAAAAAAAAAAAAAAAAAQGCAgIBAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGCAr6+AYBAAAAAAAAAAAAAAAAAAACCf//////////+fEAAAAAAAAAAAAAAAYO//////////////3zAAAAAAAAAAAABA/////59QQEBQv////88QAAAAAAAAABDf///vMAAAAAAAAGD///+AAAAAAAAAAHD///9QAAAAAAAAAACv///vEAAAAAAAAM///98AAAAAAAAAAAAw////YAAAAAAAAP///58AAAAAAAAAAAAA7///rwAAAAAAIP///4AAAAAAAAAAAAAAv///7wAAAAAAQP///4AAAAAAAAAAAAAAgP///wAAAAAAMP///4AAAAAAAAAAAAAAgP///yAAAAAAAP///4AAAAAAAAAAAAAAgP///0AAAAAAAN///78AAAAAAAAAAAAAr////0AAAAAAAI////8gAAAAAAAAAABw/////0AAAAAAACD////PEAAAAAAAAI///////wAAAAAAAACA////33BAAEBg3///z////wAAAAAAAAAAn/////////////9gn///3wAAAAAAAAAAAHDv////////vzAAv///rwAAAAAAAAAAAAAAUICvn4AwAAAQ////gAAAAAAAAAAAAAAAAAAAAAAAAABg////MAAAAAAAAAAAAAAAAAAAAAAAAADf///fAAAAAAAAAAAAAAAAAAAAAAAAAID///9gAAAAAAAAAAAAAAAAAAAAAAAAYP///88AAAAAAAAAAAAAAAAAAAAAAABw////7zAAAAAAAAAAAAAAAAAAAAAAIL/////vMAAAAAAAAAAAAAAAAAAAADCf/////98wAAAAAAAAAAAAAAAAACBwz///////jxAAAAAAAAAAAAAAAAAAgP///////58gAAAAAAAAAAAAAAAAAAAAUP///89wEAAAAAAAAAAAAAAAAAAAAAAAAL9wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgN//rzAAAAAAAAAAAAAAAAAAAAAAAACA/////+8gAAAAAAAAAAAAAAAAAAAAAADv//////+AAAAAAAAAAAAAAAAAAAAAAAD///////+AAAAAAAAAAAAAAAAAAAAAAADf//////9gAAAAAAAAAAAAAAAAAAAAAABA/////88AAAAAAAAAAAAAAAAAAAAAAAAAMI+/cBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAwAAAAAAAAAAAAAAAAAAAAAAAAAAAQr///72AAAAAAAAAAAAAAAAAAAAAAAACP//////8gAAAAAAAAAAAAAAAAAAAAAAD///////+AAAAAAAAAAAAAAAAAAAAAAAD///////+AAAAAAAAAAAAAAAAAAAAAAAC///////9gAAAAAAAAAAAAAAAAAAAAAAAw7////58AAAAAAAAAAAAAAAAAAAAAAAAAEGCAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDf/68wAAAAAAAAAAAAAAAAAAAAAAAAgP/////vIAAAAAAAAAAAAAAAAAAAAAAA7///////gAAAAAAAAAAAAAAAAAAAAAAA////////jwAAAAAAAAAAAAAAAAAAAAAAz///////cAAAAAAAAAAAAAAAAAAAAAAAQO/////PEAAAAAAAAAAAAAAAAAAAAAAAACCPv3AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECvv58QAAAAAAAAAAAAAAAAAAAAAAAAUP/////PEAAAAAAAAAAAAAAAAAAAAAAA3///////cAAAAAAAAAAAAAAAAAAAAAAA////////nwAAAAAAAAAAAAAAAAAAAAAA3///////gAAAAAAAAAAAAAAAAAAAAAAAYP//////UAAAAAAAAAAAAAAAAAAAAAAAAL/////fAAAAAAAAAAAAAAAAAAAAAAAAAP////+AAAAAAAAAAAAAAAAAAAAAAAAAMP////8QAAAAAAAAAAAAAAAAAAAAAAAAcP///58AAAAAAAAAAAAAAAAAAAAAAAAAr////yAAAAAAAAAAAAAAAAAAAAAAAAAA7///vwAAAAAAAAAAAAAAAAAAAAAAAAAw////UAAAAAAAAAAAAAAAAAAAAAAAAABw///fAAAAAAAAAAAAAAAAAAAAAAAAAABQgIBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAQM/fEAAAAAAAAAAAAAAAAAAAAAAAABCP////jwAAAAAAAAAAAAAAAAAAAAAAUO//////nwAAAAAAAAAAAAAAAAAAACC//////89AAAAAAAAAAAAAAAAAAAAAgP/////vgAAAAAAAAAAAAAAAAAAAAEDf/////68gAAAAAAAAAAAAAAAAAAAQr//////fQAAAAAAAAAAAAAAAAAAAAHDv/////4AQAAAAAAAAAAAAAAAAAAAwv/////+/IAAAAAAAAAAAAAAAAAAAAGD/////72AAAAAAAAAAAAAAAAAAAAAAAID///+PEAAAAAAAAAAAAAAAAAAAAAAAAID//99AAAAAAAAAAAAAAAAAAAAAAAAAAID/////nxAAAAAAAAAAAAAAAAAAAAAAAACA7////+9wAAAAAAAAAAAAAAAAAAAAAAAAIL//////vzAAAAAAAAAAAAAAAAAAAAAAAABQ7/////+PEAAAAAAAAAAAAAAAAAAAAAAAEI//////31AAAAAAAAAAAAAAAAAAAAAAAABAz/////+vIAAAAAAAAAAAAAAAAAAAAAAAAIDv////74AAAAAAAAAAAAAAAAAAAAAAAAAgv//////PQAAAAAAAAAAAAAAAAAAAAAAAAFDv////vwAAAAAAAAAAAAAAAAAAAAAAAAAQj//vIAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEBAQEBAQEBAQEBAQEBAQBAAAAAAAAAAv////////////////////0AAAAAAAAAAv////////////////////0AAAAAAAAAAj7+/v7+/v7+/v7+/v7+/vzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEBAQEBAQEBAQEBAQEBAQBAAAAAAAAAAv////////////////////0AAAAAAAAAAv////////////////////0AAAAAAAAAAj7+/v7+/v7+/v7+/v7+/vzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAED/nxAAAAAAAAAAAAAAAAAAAAAAAAAAEN///+9gAAAAAAAAAAAAAAAAAAAAAAAAIL//////vyAAAAAAAAAAAAAAAAAAAAAAAABw7/////+AEAAAAAAAAAAAAAAAAAAAAAAAEJ//////30AAAAAAAAAAAAAAAAAAAAAAAABA3/////+vIAAAAAAAAAAAAAAAAAAAAAAAAIDv////73AAAAAAAAAAAAAAAAAAAAAAAAAgv//////PMAAAAAAAAAAAAAAAAAAAAAAAAFDf/////48QAAAAAAAAAAAAAAAAAAAAAAAQj//////vAAAAAAAAAAAAAAAAAAAAAAAAADC/////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAQN//////AAAAAAAAAAAAAAAAAAAAABCf/////99AAAAAAAAAAAAAAAAAAAAAYO//////gAAAAAAAAAAAAAAAAAAAADC//////78gAAAAAAAAAAAAAAAAAAAQgP/////vYAAAAAAAAAAAAAAAAAAAAFDf/////58QAAAAAAAAAAAAAAAAAAAgr//////fQAAAAAAAAAAAAAAAAAAAAHDv/////4AAAAAAAAAAAAAAAAAAAAAAIO////+/IAAAAAAAAAAAAAAAAAAAAAAAAGD/72AAAAAAAAAAAAAAAAAAAAAAAAAAAABwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEGCAv7+vgDAAAAAAAAAAAAAAAAAAACCf///////////fQAAAAAAAAAAAAAAAYP///////////////4AAAAAAAAAAAACf/////59QQEBQn/////9QAAAAAAAAABDv///PIAAAAAAAADDv///fAAAAAAAAAAAQr68AAAAAAAAAAACA////QAAAAAAAAAAAABAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAACP////MAAAAAAAAAAAAAAAAAAAAAAAAGD///+/AAAAAAAAAAAAAAAAAAAAAAAAYP////8wAAAAAAAAAAAAAAAAAAAAABCf////72AAAAAAAAAAAAAAAAAAAAAAEM/////fMAAAAAAAAAAAAAAAAAAAAAAQz////68QAAAAAAAAAAAAAAAAAAAAAACP////nwAAAAAAAAAAAAAAAAAAAAAAACD///+/AAAAAAAAAAAAAAAAAAAAAAAAAFD///9QAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAGC/v78AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFDf/78wAAAAAAAAAAAAAAAAAAAAAAAAIO/////fAAAAAAAAAAAAAAAAAAAAAAAAQP//////IAAAAAAAAAAAAAAAAAAAAAAAMP//////AAAAAAAAAAAAAAAAAAAAAAAAAJ////9gAAAAAAAAAAAAAAAAAAAAAAAAAABggDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGCAr7+/j4BAAAAAAAAAAAAAAAAAEHDP////////////74AQAAAAAAAAAACA7//////////////////fMAAAAAAAMM//////76+AUEBAgJ/v////7zAAAABQ7////99gAAAAAAAAAAAQj////+8gAAAQ7//vcAAAAAAAAAAAAAAAAGD///+vAAAAMM8wAAAAAAAAAAAAAAAAAACP////QAAAAAAAAAAAAAAAAAAAAAAAAAAQ7///nwAAAAAAAAAAAAAAAAAAAAAAAAAAn///7wAAAAAAAAAAAAAAAAAAAAAAAAAAUP///0AAAAAAAAAAAAAAAAAAAAAAAAAAEP///3AAAAAAAECv7////++vUAAAAAAAAN///58AAAAAn////////////98AAAAAAL///78AAACf////z4CAgM////8AAAAAAL///88AAFD///9gAAAAAAD///8AAAAAAID///8AAM///58AAAAAAAD///8AAAAAAID///8AMP///zAAAAAAAAD///8AAAAAAID///8AcP//7wAAAAAAAAD///8AAAAAAID///8Aj///vwAAAAAAAAD///8AAAAAAID///8Av///nwAAAAAAAAD///8AAAAAAID///8Av///gAAAAAAAAAD///8AAAAAAID///8Av///gAAAAAAAAAD///8AAAAAAID///8Av///gAAAAAAAAAD///8AAAAAAID//98Av///rwAAAAAAAAD///8AAAAAAID//78AgP//vwAAAAAAAAD///8AAAAAAL///78AYP///wAAAAAAAGD///8AAAAAAL///48AIP///1AAAAAAEN////8gAAAAAM///4AAAL///88QAAAQv/+/v/9QAAAAEP///0AAADD////vv7///+8gn/+fAAAAYP//7wAAAABg////////70AAQP//gBAg3///nwAAAAAAIJ+/v7+PIAAAAL/////////vIAAAAAAAAAAAAAAAAAAAABDP//////9gAAAAAAAAAAAAAAAAAAAAAAAQcL+/gCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEAgAAAAAAAAAAAAAAAAAAAAAAAAMP/////PAAAAAAAAAAAAAAAAAAAAAAAAj///////IAAAAAAAAAAAAAAAAAAAAAAA3///////cAAAAAAAAAAAAAAAAAAAAAAw////j///zwAAAAAAAAAAAAAAAAAAAACP//+vMP///yAAAAAAAAAAAAAAAAAAAADf//9gAO///3AAAAAAAAAAAAAAAAAAACD///8QAJ///88AAAAAAAAAAAAAAAAAAHD//78AAFD///8gAAAAAAAAAAAAAAAAAM///3AAAAD///9wAAAAAAAAAAAAAAAAIP///yAAAACv///PAAAAAAAAAAAAAAAAcP//zwAAAABg////EAAAAAAAAAAAAAAAz///gAAAAAAg////YAAAAAAAAAAAAAAg////MAAAAAAAz///rwAAAAAAAAAAAABw///fAAAAAAAAcP///xAAAAAAAAAAAADP//+PAAAAAAAAMP///2AAAAAAAAAAACD///9AAAAAAAAAAN///68AAAAAAAAAAHD//+8AAAAAAAAAAI////8QAAAAAAAAAK///79AQEBAQEBAQHD///9gAAAAAAAAEP////////////////////+vAAAAAAAAYP//////////////////////EAAAAAAAr///37+/v7+/v7+/v7/P////UAAAAAAQ////YAAAAAAAAAAAAAAA////nwAAAABg////EAAAAAAAAAAAAAAAr///7wAAAACv///PAAAAAAAAAAAAAAAAYP///1AAABD///9wAAAAAAAAAAAAAAAAEP///58AAGD///8gAAAAAAAAAAAAAAAAAK///+8AAK///88AAAAAAAAAAAAAAAAAAHD///9QAO///4AAAAAAAAAAAAAAAAAAACD///+fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAD/////////////769gAAAAAAAAAAAAAAD/////////////////30AAAAAAAAAAAAD////fv7+/v7+///////9gAAAAAAAAAAD///+AAAAAAAAAEID////vIAAAAAAAAAD///+AAAAAAAAAAABw////jwAAAAAAAAD///+AAAAAAAAAAAAA7///vwAAAAAAAAD///+AAAAAAAAAAAAAv///7wAAAAAAAAD///+AAAAAAAAAAAAAv///3wAAAAAAAAD///+AAAAAAAAAAAAA3///vwAAAAAAAAD///+AAAAAAAAAAABA////YAAAAAAAAAD///+AAAAAAAAAACDP///PAAAAAAAAAAD///+fQEBAQEBQj+///78QAAAAAAAAAAD////////////////PYAAAAAAAAAAAAAD///////////////+/cCAAAAAAAAAAAAD////fv7+/v7+/7/////+AAAAAAAAAAAD///+AAAAAAAAAADC/////nwAAAAAAAAD///+AAAAAAAAAAAAAr////2AAAAAAAAD///+AAAAAAAAAAAAAEP///88AAAAAAAD///+AAAAAAAAAAAAAAL////8AAAAAAAD///+AAAAAAAAAAAAAAL////8gAAAAAAD///+AAAAAAAAAAAAAAK////8QAAAAAAD///+AAAAAAAAAAAAAAL////8AAAAAAAD///+AAAAAAAAAAAAAIP///88AAAAAAAD///+AAAAAAAAAAAAQz////2AAAAAAAAD///+AAAAAAAAAMIDv////vwAAAAAAAAD///////////////////+/EAAAAAAAAAD/////////////////73AAAAAAAAAAAAD////////////vv49QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECAn7+/j4BAAAAAAAAAAAAAAAAAABCA7///////////74AQAAAAAAAAAAAAQN/////////////////fQAAAAAAAAABg/////++fcEBAcJ/f////gAAAAAAAAED/////gBAAAAAAAAAAYO+fAAAAAAAAEO///+8wAAAAAAAAAAAAACAAAAAAAAAAgP///2AAAAAAAAAAAAAAAAAAAAAAAAAQ7///vwAAAAAAAAAAAAAAAAAAAAAAAABw////UAAAAAAAAAAAAAAAAAAAAAAAAAC////vAAAAAAAAAAAAAAAAAAAAAAAAAAD///+vAAAAAAAAAAAAAAAAAAAAAAAAADD///+AAAAAAAAAAAAAAAAAAAAAAAAAAED///9wAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAHD///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///+AAAAAAAAAAAAAAAAAAAAAAAAAACD///+AAAAAAAAAAAAAAAAAAAAAAAAAAADv//+/AAAAAAAAAAAAAAAAAAAAAAAAAACv////EAAAAAAAAAAAAAAAAAAAAAAAAABg////YAAAAAAAAAAAAAAAAAAAAAAAAAAA7///3wAAAAAAAAAAAAAAAAAAAAAAAAAAcP///48AAAAAAAAAAAAAAAAAAAAAAAAAAM////9wAAAAAAAAAAAAAEC/AAAAAAAAACDv////v0AAAAAAAAAwn///jwAAAAAAAAAw7//////fv4CAv9//////7xAAAAAAAAAAEL////////////////+/IAAAAAAAAAAAAABAr///////////r0AAAAAAAAAAAAAAAAAAABBAcICAcEAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIEBAQEBAQEAwAAAAAAAAAAAAAAAAAAAAgP///////////9+fYAAAAAAAAAAAAAAAgP///////////////99gAAAAAAAAAAAAgP///7+/v7+/3///////nxAAAAAAAAAAgP///wAAAAAAACCA7////68AAAAAAAAAgP///wAAAAAAAAAAMM////+AAAAAAAAAgP///wAAAAAAAAAAACDv///vEAAAAAAAgP///wAAAAAAAAAAAACA////gAAAAAAAgP///wAAAAAAAAAAAAAQ////3wAAAAAAgP///wAAAAAAAAAAAAAAr////yAAAAAAgP///wAAAAAAAAAAAAAAgP///1AAAAAAgP///wAAAAAAAAAAAAAAQP///4AAAAAAgP///wAAAAAAAAAAAAAAQP///4AAAAAAgP///wAAAAAAAAAAAAAAQP///68AAAAAgP///wAAAAAAAAAAAAAAQP///78AAAAAgP///wAAAAAAAAAAAAAAQP///78AAAAAgP///wAAAAAAAAAAAAAAQP///48AAAAAgP///wAAAAAAAAAAAAAAQP///4AAAAAAgP///wAAAAAAAAAAAAAAcP///3AAAAAAgP///wAAAAAAAAAAAAAAn////0AAAAAAgP///wAAAAAAAAAAAAAA3////wAAAAAAgP///wAAAAAAAAAAAABA////rwAAAAAAgP///wAAAAAAAAAAAAC/////QAAAAAAAgP///wAAAAAAAAAAAHD///+/AAAAAAAAgP///wAAAAAAAAAAgP///+8wAAAAAAAAgP///wAAAAAAEGDf/////2AAAAAAAAAAgP///7+/v7/////////vUAAAAAAAAAAAgP///////////////58QAAAAAAAAAAAAgP//////////v59gEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEBAQEBAQEBAQEBAQEBAQBAAAAAAAAAAv////////////////////xAAAAAAAAAAv////////////////////wAAAAAAAAAAv///77+/v7+/v7+/v7+/jwAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///77+/v7+/v7+/v78wAAAAAAAAAAAAv/////////////////9AAAAAAAAAAAAAv/////////////////9AAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///77+/v7+/v7+/v7+/v2AAAAAAAAAAv////////////////////4AAAAAAAAAAv////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAQEBAQEBAQEBAQEBAQEBAEAAAAAAAAED/////////////////////QAAAAAAAAED/////////////////////AAAAAAAAAED////Pv7+/v7+/v7+/v7+/AAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///+fgICAgICAgICAgCAAAAAAAAAAAED//////////////////0AAAAAAAAAAAED//////////////////0AAAAAAAAAAAED///+fgICAgICAgICAgCAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCAn7+/j3AwAAAAAAAAAAAAAAAAAABg3///////////z0AAAAAAAAAAAAAAEM////////////////+fEAAAAAAAAAAw7////++fYEBAgK//////gAAAAAAAABDf////jxAAAAAAAAAgv/+fAAAAAAAAAK////9gAAAAAAAAAAAAAIAAAAAAAAAAQP///68AAAAAAAAAAAAAAAAAAAAAAAAAv////yAAAAAAAAAAAAAAAAAAAAAAAAAg////nwAAAAAAAAAAAAAAAAAAAAAAAABw////UAAAAAAAAAAAAAAAAAAAAAAAAACv////EAAAAAAAAAAAAAAAAAAAAAAAAADf///vAAAAAAAAAAAAAAAAAAAAAAAAAAD///+/AAAAAAAAAAAAAAAAAAAAAAAAAAD///+/AAAAAAAAMICAgICAgICAgAAAAAD///+/AAAAAAAAQP///////////wAAAAD///+/AAAAAAAAIP///////////wAAAAD///+/AAAAAAAAAICAgICAv////wAAAAD///+/AAAAAAAAAAAAAAAAgP///wAAAADv///vAAAAAAAAAAAAAAAAgP///wAAAAC/////EAAAAAAAAAAAAAAAgP///wAAAACP////QAAAAAAAAAAAAAAAgP///wAAAABQ////jwAAAAAAAAAAAAAAgP///wAAAAAA7///3wAAAAAAAAAAAAAAgP///wAAAAAAj////4AAAAAAAAAAAAAAgP///wAAAAAAEO////8wAAAAAAAAAAAAgP///wAAAAAAAGD/////gBAAAAAAABBg3////wAAAAAAAACP/////++/gICPv////////wAAAAAAAAAAYO/////////////////PYAAAAAAAAAAAACCf7//////////vn0AAAAAAAAAAAAAAAAAAAEBggICAQDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBAQEAAAAAAAAAAAAAAEEBAQBAAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///9AQEBAQEBAQEBAcP///0AAAAAAAID//////////////////////0AAAAAAAID//////////////////////0AAAAAAAID///+AgICAgICAgICAn////0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAID///8AAAAAAAAAAAAAQP///0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEBAQEBAQEBAQEBAQEBAQCAAAAAAAAAAv////////////////////4AAAAAAAAAAv////////////////////4AAAAAAAAAAYICAgICAv////4CAgICAgEAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAj7+/v7+/3////7+/v7+/v2AAAAAAAAAAv////////////////////4AAAAAAAAAAv////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQEBAQEBAQEBAQEAwAAAAAAAAAAAAAABA//////////////+/AAAAAAAAAAAAAABA//////////////+/AAAAAAAAAAAAAAAwv7+/v7+/v7/v//+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAADv//+/AAAAAAAAAAAAAAAAAAAAAAAAAAD///+AAAAAAAAAAAAAAAAAAAAAAAAAAFD///9gAAAAAAAAAAAAAAAAAAAAAAAAAL////8gAAAAAAAAACAgAAAAAAAAAAAAYP///78AAAAAAAAAAL/vgCAAAAAAAACA/////0AAAAAAAAAAcP/////Pn4CAn+//////gAAAAAAAAAAAIL////////////////+AAAAAAAAAAAAAAABAn///////////r0AAAAAAAAAAAAAAAAAAAABAYICAcEAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwQEAwAAAAAAAAAAAAAABAQEBAEAAAAAC///+/AAAAAAAAAAAAAHD///+fAAAAAAC///+/AAAAAAAAAAAAUP///88AAAAAAAC///+/AAAAAAAAAAAw7///zxAAAAAAAAC///+/AAAAAAAAABDv///vMAAAAAAAAAC///+/AAAAAAAAEM////9AAAAAAAAAAAC///+/AAAAAAAAn////2AAAAAAAAAAAAC///+/AAAAAACA////jwAAAAAAAAAAAAC///+/AAAAAGD///+fAAAAAAAAAAAAAAC///+/AAAAMP///88QAAAAAAAAAAAAAAC///+/AAAg7///3xAAAAAAAAAAAAAAAAC///+/ABDP///vMAAAAAAAAAAAAAAAAAC///+/AL////9AAAAAAAAAAAAAAAAAAAC///+/n////4AAAAAAAAAAAAAAAAAAAAC///+/gP///88QAAAAAAAAAAAAAAAAAAC///+/AL////+fAAAAAAAAAAAAAAAAAAC///+/ABDf////YAAAAAAAAAAAAAAAAAC///+/AAAw/////zAAAAAAAAAAAAAAAAC///+/AAAAcP///98QAAAAAAAAAAAAAAC///+/AAAAAJ////+/AAAAAAAAAAAAAAC///+/AAAAABDP////gAAAAAAAAAAAAAC///+/AAAAAAAw7////0AAAAAAAAAAAAC///+/AAAAAAAAYP///+8gAAAAAAAAAAC///+/AAAAAAAAAJ/////PAAAAAAAAAAC///+/AAAAAAAAAADP////nwAAAAAAAAC///+/AAAAAAAAAAAg7////2AAAAAAAAC///+/AAAAAAAAAAAAUP///+8wAAAAAAC///+/AAAAAAAAAAAAAID////PEAAAAAC///+/AAAAAAAAAAAAAAC/////rwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBAQEAQAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9AAAAAAAAAAAAAAAAAAAAAAAAAAID///9wQEBAQEBAQEBAQEBAAAAAAAAAAID////////////////////vAAAAAAAAAID///////////////////+/AAAAAAAAAID///////////////////+vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQEBAQDAAAAAAAAAAABBAQEBAMAAAAABA//////8AAAAAAAAAAHD/////vwAAAABA//////9AAAAAAAAAAJ//////zwAAAABA//////+AAAAAAAAAAN///////wAAAABQ//////+vAAAAAAAAEP///////wAAAACA//+////vAAAAAAAAUP//v////wAAAACA//+A7///MAAAAAAAgP//gP///wAAAACA//+Ar///cAAAAAAAv///QP///zAAAACA//+AcP//nwAAAAAA//+/QP///0AAAACv//+AMP//3wAAAABA//+AAP///0AAAAC///+AAO///yAAAABw//9AAP///0AAAAC///+AAK///2AAAACv//8QAP///2AAAAC///+AAHD//48AAADf/88AAP///4AAAADf//9wADD//88AACD//48AAP///4AAAAD///9AAADv//8QAFD//1AAAP///4AAAAD///9AAACv//9QAI///xAAAN///4AAAAD///9AAABg//+PAM//3wAAAL///78AAAD///9AAAAg//+/AP//nwAAAL///78AAED///8wAAAA3///QP//YAAAAL///78AAED///8AAAAAn///v///IAAAAJ///78AAED///8AAAAAYP/////fAAAAAID//+8AAED///8AAAAAIP////+fAAAAAID///8AAGD///8AAAAAAN////9wAAAAAID///8AAID//98AAAAAAJ////8wAAAAAHD///8AAID//78AAAAAAAAAAAAAAAAAAED///8QAID//78AAAAAAAAAAAAAAAAAAED///9AAI///78AAAAAAAAAAAAAAAAAAED///9AAL///78AAAAAAAAAAAAAAAAAAED///9AAL///58AAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBAQEBAEAAAAAAAAAAAAEBAQBAAAAAAAID/////jwAAAAAAAAAAAP///0AAAAAAAID/////7wAAAAAAAAAAAP///0AAAAAAAID//////2AAAAAAAAAAAP///0AAAAAAAID//9///78AAAAAAAAAAP///0AAAAAAAID//3D///8gAAAAAAAAAP///0AAAAAAAID//3DP//+fAAAAAAAAAP///0AAAAAAAID//4Bg///vEAAAAAAAAP///0AAAAAAAID//4AQ7///YAAAAAAAAP///0AAAAAAAID//4AAn///zwAAAAAAAP///0AAAAAAAID//58AMP///zAAAAAAAP///0AAAAAAAID//78AAM///58AAAAAAP///0AAAAAAAID//78AAGD//+8QAAAAAP///0AAAAAAAID//78AABDv//9gAAAAAP///0AAAAAAAID//78AAACf///PAAAAAP///0AAAAAAAID//78AAAAw////QAAAAP///0AAAAAAAID//78AAAAAz///nwAAAP///0AAAAAAAID//78AAAAAYP///xAAAP///0AAAAAAAID//78AAAAAEO///3AAAP///0AAAAAAAID//78AAAAAAJ///98AAP///0AAAAAAAID//78AAAAAADD///9AAP///0AAAAAAAID//78AAAAAAADP//+fAP///0AAAAAAAID//78AAAAAAABg////EM///0AAAAAAAID//78AAAAAAAAQ7///cL///0AAAAAAAID//78AAAAAAAAAn///37///0AAAAAAAID//78AAAAAAAAAMP///////0AAAAAAAID//78AAAAAAAAAAM///////0AAAAAAAID//78AAAAAAAAAAGD//////0AAAAAAAID//78AAAAAAAAAABDv/////0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBQgL+/n4AwAAAAAAAAAAAAAAAAAAAAgO//////////30AAAAAAAAAAAAAAABC///////////////+AAAAAAAAAAAAAAM/////fj1BAYJ//////cAAAAAAAAAAAgP///58AAAAAAAAgz////zAAAAAAAAAg////rwAAAAAAAAAAIO///78AAAAAAACf////IAAAAAAAAAAAAID///9AAAAAAADv//+vAAAAAAAAAAAAABD///+fAAAAAFD///9gAAAAAAAAAAAAAAC////vAAAAAID///8gAAAAAAAAAAAAAACA////MAAAAL////8AAAAAAAAAAAAAAABQ////YAAAAN///78AAAAAAAAAAAAAAABA////gAAAAP///78AAAAAAAAAAAAAAAAQ////jwAAAP///78AAAAAAAAAAAAAAAAA////vwAAAP///78AAAAAAAAAAAAAAAAA////vwAAAP///78AAAAAAAAAAAAAAAAA////vwAAAP///78AAAAAAAAAAAAAAAAA////vwAAAP///78AAAAAAAAAAAAAAAAg////gAAAAN///88AAAAAAAAAAAAAAABA////gAAAAL////8AAAAAAAAAAAAAAABQ////UAAAAID///8wAAAAAAAAAAAAAACA////IAAAAED///9wAAAAAAAAAAAAAADP///fAAAAAADv///PAAAAAAAAAAAAACD///+PAAAAAACP////QAAAAAAAAAAAAJ////8gAAAAAAAg7///zxAAAAAAAAAAQP///58AAAAAAAAAcP///88wAAAAAABg7///7xAAAAAAAAAAAJ//////z4+An9/////vMAAAAAAAAAAAAACf/////////////+8wAAAAAAAAAAAAAAAAQL/////////vnxAAAAAAAAAAAAAAAAAAAAAgUICAcEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAQEBAQEBAQEAQAAAAAAAAAAAAAAAAAED/////////////769gEAAAAAAAAAAAAED/////////////////73AAAAAAAAAAAED///+fgICAgK+///////+fAAAAAAAAAED///9AAAAAAAAAEID/////gAAAAAAAAED///9AAAAAAAAAAAAw/////yAAAAAAAED///9AAAAAAAAAAAAAj////3AAAAAAAED///9AAAAAAAAAAAAAMP///68AAAAAAED///9AAAAAAAAAAAAAAP///78AAAAAAED///9AAAAAAAAAAAAAAP///78AAAAAAED///9AAAAAAAAAAAAAAP///78AAAAAAED///9AAAAAAAAAAAAAMP///68AAAAAAED///9AAAAAAAAAAAAAgP///3AAAAAAAED///9AAAAAAAAAAAAQ7////yAAAAAAAED///9AAAAAAAAAAEDP////jwAAAAAAAED///9wQEBAQICPz//////PEAAAAAAAAED//////////////////48QAAAAAAAAAED//////////////++fQAAAAAAAAAAAAED///+fgICAgIBQMAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAED///9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEFCAv7+fgDAAAAAAAAAAAAAAAAAAAACA7//////////fQAAAAAAAAAAAAAAAEM///////////////4AAAAAAAAAAAAAAz////9+AUEBgn/////9wAAAAAAAAAACA////nwAAAAAAADDP////MAAAAAAAACD///+vAAAAAAAAAAAg7///vwAAAAAAAJ///+8QAAAAAAAAAAAAgP///0AAAAAAAO///58AAAAAAAAAAAAAEP///58AAAAAUP///1AAAAAAAAAAAAAAAK///+8AAAAAj////xAAAAAAAAAAAAAAAID///8wAAAAv///3wAAAAAAAAAAAAAAAED///9gAAAA7///vwAAAAAAAAAAAAAAADD///+AAAAA////rwAAAAAAAAAAAAAAAAD///+PAAAA////gAAAAAAAAAAAAAAAAAD///+/AAAg////gAAAAAAAAAAAAAAAAAD///+/AAAg////gAAAAAAAAAAAAAAAAAD///+/AAAA////gAAAAAAAAAAAAAAAAAD///+/AAAA////vwAAAAAAAAAAAAAAAAD///+AAAAA7///vwAAAAAAAAAAAAAAAED///+AAAAAv///7wAAAAAAAAAAAAAAAFD///9QAAAAj////xAAAAAAAAAAAAAAAID///8gAAAAUP///2AAAAAAAAAAAAAAAM///88AAAAAAO///68AAAAAAAAAAAAAIP///4AAAAAAAJ////8wAAAAAAAAAAAAn////yAAAAAAACD////PEAAAAAAAAABA////gAAAAAAAAACA////zyAAAAAAAGDv///PAAAAAAAAAAAAn//////Pj4Cf3////88QAAAAAAAAAAAAAJ//////////////gAAAAAAAAAAAAAAAAABQz///////////759AAAAAAAAAAAAAAAAAACBAYICAr+//////vyAAAAAAAAAAAAAAAAAAAAAAABCA/////+8wAAAAAAAAAAAAAAAAAAAAAAAAMO/////PAAAAAAAAAAAAAAAAAAAAAAAAAFD/////YAAAAAAAAAAAAAAAAAAAAAAAAACv////3wAAAAAAAAAAAAAAAAAAAAAAAAAg////7wAAAAAAAAAAAAAAAAAAAAAAAAAAr69gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEBAQEBAQEBAMAAAAAAAAAAAAAAAAAAAv//////////////fn0AAAAAAAAAAAAAAv/////////////////+/MAAAAAAAAAAAv///34CAgICAv8//////7zAAAAAAAAAAv///vwAAAAAAAAAgr////+8QAAAAAAAAv///vwAAAAAAAAAAAK////9wAAAAAAAAv///vwAAAAAAAAAAACD////PAAAAAAAAv///vwAAAAAAAAAAAADP////AAAAAAAAv///vwAAAAAAAAAAAAC/////AAAAAAAAv///vwAAAAAAAAAAAAC/////AAAAAAAAv///vwAAAAAAAAAAAAD////fAAAAAAAAv///vwAAAAAAAAAAAGD///+PAAAAAAAAv///vwAAAAAAAAAAMO///+8gAAAAAAAAv///vwAAAAAAAECP7////2AAAAAAAAAAv//////////////////vUAAAAAAAAAAAv////////////////58gAAAAAAAAAAAAv/////////////+PEAAAAAAAAAAAAAAAv///vwAAACDv///PAAAAAAAAAAAAAAAAv///vwAAAABw////gAAAAAAAAAAAAAAAv///vwAAAAAAv////zAAAAAAAAAAAAAAv///vwAAAAAAMP///88AAAAAAAAAAAAAv///vwAAAAAAAID///+AAAAAAAAAAAAAv///vwAAAAAAAADf////MAAAAAAAAAAAv///vwAAAAAAAABA////zwAAAAAAAAAAv///vwAAAAAAAAAAj////4AAAAAAAAAAv///vwAAAAAAAAAAEO////8wAAAAAAAAv///vwAAAAAAAAAAAFD////PAAAAAAAAv///vwAAAAAAAAAAAACv////gAAAAAAAv///vwAAAAAAAAAAAAAg7////zAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgcI+/v7+AYCAAAAAAAAAAAAAAAAAAQL/////////////PYAAAAAAAAAAAAACA/////////////////88wAAAAAAAAAHD/////z4BAQFCAv//////vEAAAAAAAIP///+9AAAAAAAAAACCf//9gAAAAAAAAj////0AAAAAAAAAAAAAAQHAAAAAAAAAAv///3wAAAAAAAAAAAAAAAAAAAAAAAAAA3///vwAAAAAAAAAAAAAAAAAAAAAAAAAAv///3wAAAAAAAAAAAAAAAAAAAAAAAAAAn////3AAAAAAAAAAAAAAAAAAAAAAAAAAQP////+AAAAAAAAAAAAAAAAAAAAAAAAAAJ//////33AgAAAAAAAAAAAAAAAAAAAAAACf////////v3AgAAAAAAAAAAAAAAAAAAAAUN//////////z2AQAAAAAAAAAAAAAAAAAABgz//////////vcAAAAAAAAAAAAAAAAAAAADCAz////////68QAAAAAAAAAAAAAAAAAAAAACCA7/////+vAAAAAAAAAAAAAAAAAAAAAAAAEID/////YAAAAAAAAAAAAAAAAAAAAAAAAABw////vwAAAAAAAAAAAAAAAAAAAAAAAAAA3////wAAAAAAAAAAAAAAAAAAAAAAAAAAn////wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAv////wAAAAAAIDAAAAAAAAAAAAAAAAAg////zwAAAAAQz+9QAAAAAAAAAAAAABDP////cAAAAADP////v1AAAAAAAAAAQM/////fAAAAAABg///////vv4+AgK/f/////+8wAAAAAAAAML//////////////////zzAAAAAAAAAAAABAn+///////////89gAAAAAAAAAAAAAAAAAAAwQICAgHBAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQEBAQEBAQEBAQEBAQEBAQEBAQEBAAABA///////////////////////////fAABA//////////////////////////+/AAAwv7+/v7+/v7/f////v7+/v7+/v7+AAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAACA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAgAAAAAAAAAAAAAABAQEAwAAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+/AAAAAAD///+AAAAAAAAAAAAAAAD///+fAAAAAADv//+PAAAAAAAAAAAAAAD///+AAAAAAAC////PAAAAAAAAAAAAAED///9gAAAAAABw////IAAAAAAAAAAAAJ////8QAAAAAAAg////vwAAAAAAAAAAMP///58AAAAAAAAAj////78gAAAAAABw7////yAAAAAAAAAAEM//////z6+Pv+//////YAAAAAAAAAAAABC//////////////+9gAAAAAAAAAAAAAAAAYN//////////nyAAAAAAAAAAAAAAAAAAAAAgUICAcEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEAAAAAAAAAAAAAAAAAAAABAQEAgAK////8QAAAAAAAAAAAAAAAAADD///9gAGD///9gAAAAAAAAAAAAAAAAAI////8QABD///+vAAAAAAAAAAAAAAAAAN///68AAACv////EAAAAAAAAAAAAAAAIP///2AAAABg////UAAAAAAAAAAAAAAAcP///xAAAAAQ////nwAAAAAAAAAAAAAAz///rwAAAAAAr///7wAAAAAAAAAAAAAg////YAAAAAAAYP///0AAAAAAAAAAAABw////EAAAAAAAEP///48AAAAAAAAAAACv//+vAAAAAAAAAK///98AAAAAAAAAABD///9gAAAAAAAAAGD///8wAAAAAAAAAGD///8QAAAAAAAAABD///+AAAAAAAAAAK///68AAAAAAAAAAACv///PAAAAAAAAAP///2AAAAAAAAAAAABg////IAAAAAAAUP///xAAAAAAAAAAAAAQ////cAAAAAAAn///rwAAAAAAAAAAAAAAr///vwAAAAAA7///YAAAAAAAAAAAAAAAYP///xAAAABQ////EAAAAAAAAAAAAAAAEP///2AAAACP//+vAAAAAAAAAAAAAAAAAK///68AAADf//9gAAAAAAAAAAAAAAAAAGD///8AADD//+8QAAAAAAAAAAAAAAAAABD///9QAI///58AAAAAAAAAAAAAAAAAAACv//+fAM///1AAAAAAAAAAAAAAAAAAAABg///vIP//7wAAAAAAAAAAAAAAAAAAAAAQ////r///nwAAAAAAAAAAAAAAAAAAAAAAr///////UAAAAAAAAAAAAAAAAAAAAAAAYP/////vAAAAAAAAAAAAAAAAAAAAAAAAEP////+fAAAAAAAAAAAAAAAAAAAAAAAAAK////9QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADBAQDAAAAAAAAAAAAAAAAAAAAAAAEBAQL///88AAAAAAAAAAAAAAAAAAAAAAP///4D///8AAAAAAAAAAAAAAAAAAAAAIP///4D///8QAAAAAAAAAAAAAAAAAAAAQP///0D///9AAAAAAADv////jwAAAAAAcP//3zD///9QAAAAABD/////vwAAAAAAgP//vwD///+AAAAAAED/////7wAAAAAAr///gADf//+PAAAAAHD//////wAAAAAAv///cAC///+/AAAAAID//7///0AAAAAA////QACP///PAAAAAL//74D//2AAAAAQ////EACA////AAAAAN//v2D//4AAAABA////AABA////EAAAAP//n0D//68AAABg//+/AAAw////QAAAQP//gAD//88AAACA//+fAAAA////UAAAYP//QADv//8AAACv//+AAAAA3///gAAAgP//MAC///8gAAC///9QAAAAv///jwAAv///AACf//9AAADv//8wAAAAj///vwAAz//fAACA//9wAAD///8AAAAAgP//zwAA//+/AABA//+PAED//98AAAAAQP///wAw//+AAAAw//+/AFD//78AAAAAMP///wBQ//9wAAAA///fAID//48AAAAAAP///0CA//9AAAAAz///AJ///3AAAAAAAN///0Cv//8QAAAAv///QL///0AAAAAAAL///4DP//8AAAAAgP//UO///yAAAAAAAJ///4D//78AAAAAYP//gP///wAAAAAAAID//9///58AAAAAQP//3///vwAAAAAAAFD//////4AAAAAAEP//////rwAAAAAAAED//////1AAAAAAAP//////gAAAAAAAAAD//////zAAAAAAAL//////UAAAAAAAAADv/////wAAAAAAAJ//////QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEAQAAAAAAAAAAAAAAAgQEBAEAAAAID///+AAAAAAAAAAAAAAADf///fEAAAABDf////IAAAAAAAAAAAAID///9QAAAAAABA////rwAAAAAAAAAAEO///68AAAAAAAAAr////0AAAAAAAAAAn///7yAAAAAAAAAAIO///88AAAAAAAAw////gAAAAAAAAAAAAHD///9gAAAAAAC////PAAAAAAAAAAAAAADP///vEAAAAGD///9AAAAAAAAAAAAAAABA////gAAAEN///48AAAAAAAAAAAAAAAAAj////yAAgP//7xAAAAAAAAAAAAAAAAAAEO///68g7///YAAAAAAAAAAAAAAAAAAAAGD////P//+/AAAAAAAAAAAAAAAAAAAAAAC///////8gAAAAAAAAAAAAAAAAAAAAAAAg/////48AAAAAAAAAAAAAAAAAAAAAAAAw/////78AAAAAAAAAAAAAAAAAAAAAAAC///////9gAAAAAAAAAAAAAAAAAAAAAGD//++////vEAAAAAAAAAAAAAAAAAAAEO///4Ag7///jwAAAAAAAAAAAAAAAAAAgP//7xAAgP///yAAAAAAAAAAAAAAAAAg////YAAAEO///78AAAAAAAAAAAAAAAC////fAAAAAHD///9QAAAAAAAAAAAAAFD///9AAAAAAADf///fEAAAAAAAAAAAAN///78AAAAAAABQ////gAAAAAAAAAAAgP///zAAAAAAAAAAv////yAAAAAAAAAg7///nwAAAAAAAAAAQP///68AAAAAAACv///vIAAAAAAAAAAAAK////9AAAAAAED///+AAAAAAAAAAAAAACD////fAAAAAM///98QAAAAAAAAAAAAAACP////gAAAcP///2AAAAAAAAAAAAAAAAAQ7///7xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEAAAAAAAAAAAAAAAAAAAABAQEAgAJ////9AAAAAAAAAAAAAAAAAAHD///9AACDv///fAAAAAAAAAAAAAAAAEO///68AAACA////YAAAAAAAAAAAAAAAgP///yAAAAAQ7///3wAAAAAAAAAAAAAQ7///nwAAAAAAcP///2AAAAAAAAAAAACf///vEAAAAAAAAN///+8QAAAAAAAAACD///+AAAAAAAAAAGD///+AAAAAAAAAAJ///98QAAAAAAAAAAC////vEAAAAAAAMP///2AAAAAAAAAAAABA////gAAAAAAAv///3wAAAAAAAAAAAAAAr///7xAAAABA////QAAAAAAAAAAAAAAAIP///58AAAC///+/AAAAAAAAAAAAAAAAAJ////8gAFD///9AAAAAAAAAAAAAAAAAABDv//+fAN///58AAAAAAAAAAAAAAAAAAACA////gP///yAAAAAAAAAAAAAAAAAAAAAQ7///////gAAAAAAAAAAAAAAAAAAAAAAAYP/////vEAAAAAAAAAAAAAAAAAAAAAAAAN////+AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgQEBAQEBAQEBAQEBAQEBAQDAAAAAAAACA/////////////////////78AAAAAAACA/////////////////////78AAAAAAABgv7+/v7+/v7+/v7+/z////68AAAAAAAAAAAAAAAAAAAAAAAAAj////zAAAAAAAAAAAAAAAAAAAAAAAABA////gAAAAAAAAAAAAAAAAAAAAAAAABDf///PAAAAAAAAAAAAAAAAAAAAAAAAAI////8wAAAAAAAAAAAAAAAAAAAAAAAAQP///4AAAAAAAAAAAAAAAAAAAAAAAAAQ3///zwAAAAAAAAAAAAAAAAAAAAAAAACP////MAAAAAAAAAAAAAAAAAAAAAAAAFD///+AAAAAAAAAAAAAAAAAAAAAAAAAEO///88AAAAAAAAAAAAAAAAAAAAAAAAAr////zAAAAAAAAAAAAAAAAAAAAAAAABQ////gAAAAAAAAAAAAAAAAAAAAAAAABDv///PAAAAAAAAAAAAAAAAAAAAAAAAAK////8wAAAAAAAAAAAAAAAAAAAAAAAAUP///4AAAAAAAAAAAAAAAAAAAAAAAAAQ7///zwAAAAAAAAAAAAAAAAAAAAAAAACv////MAAAAAAAAAAAAAAAAAAAAAAAAFD///+AAAAAAAAAAAAAAAAAAAAAAAAAEO///88AAAAAAAAAAAAAAAAAAAAAAAAAr////zAAAAAAAAAAAAAAAAAAAAAAAABQ////gAAAAAAAAAAAAAAAAAAAAAAAABDv///PAAAAAAAAAAAAAAAAAAAAAAAAAK////8wAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////4AAAAAAAP///////////////////////3AAAAAAAP///////////////////////0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQICAgICAgICAgGAAAAAAAAAAAAAAAAAAgP///////////78AAAAAAAAAAAAAAAAAgP///////////78AAAAAAAAAAAAAAAAAgP//34CAgICAgGAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//z0BAQEBAQDAAAAAAAAAAAAAAAAAAgP///////////78AAAAAAAAAAAAAAAAAgP///////////78AAAAAAAAAAAAAAAAAYL+/v7+/v7+/v48AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQgO9AAAAAAAAAAAAAAAAAAAAAAAAAAACf//+/AAAAAAAAAAAAAAAAAAAAAAAAAAAw////QAAAAAAAAAAAAAAAAAAAAAAAAAAAv///vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP///zAAAAAAAAAAAAAAAAAAAAAAAAAAAL///58AAAAAAAAAAAAAAAAAAAAAAAAAAED///8gAAAAAAAAAAAAAAAAAAAAAAAAAAC///+fAAAAAAAAAAAAAAAAAAAAAAAAAABA////IAAAAAAAAAAAAAAAAAAAAAAAAAAAv///nwAAAAAAAAAAAAAAAAAAAAAAAAAAQP///yAAAAAAAAAAAAAAAAAAAAAAAAAAAN///58AAAAAAAAAAAAAAAAAAAAAAAAAAGD///8gAAAAAAAAAAAAAAAAAAAAAAAAAADf//+AAAAAAAAAAAAAAAAAAAAAAAAAAABg///vEAAAAAAAAAAAAAAAAAAAAAAAAAAA3///gAAAAAAAAAAAAAAAAAAAAAAAAAAAYP//7xAAAAAAAAAAAAAAAAAAAAAAAAAAAN///4AAAAAAAAAAAAAAAAAAAAAAAAAAAGD//+8QAAAAAAAAAAAAAAAAAAAAAAAAAADf//+AAAAAAAAAAAAAAAAAAAAAAAAAAACA///vEAAAAAAAAAAAAAAAAAAAAAAAAAAQ7///YAAAAAAAAAAAAAAAAAAAAAAAAAAAgP//3wAAAAAAAAAAAAAAAAAAAAAAAAAAEO///2AAAAAAAAAAAAAAAAAAAAAAAAAAAID//98AAAAAAAAAAAAAAAAAAAAAAAAAABDv//9gAAAAAAAAAAAAAAAAAAAAAAAAAACA///fAAAAAAAAAAAAAAAAAAAAAAAAAAAQ7///YAAAAAAAAAAAAAAAAAAAAAAAAAAAn///3wAAAAAAAAAAAAAAAAAAAAAAAAAAIP///1AAAAAAAAAAAAAAAAAAAAAAAAAAAJ///78AAAAAAAAAAAAAAAAAAAAAAAAAACD///9AAAAAAAAAAAAAAAAAAAAAAAAAAACf//+/AAAAAAAAAAAAAAAAAAAAAAAAAAAg////QAAAAAAAAAAAAAAAAAAAAAAAAAAAn///vwAAAAAAAAAAAAAAAAAAAAAAAAAAIP///0AAAAAAAAAAAAAAAAAAAAAAAAAAAJ/fYBAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCAgICAgICAgICAIAAAAAAAAAAAAAAAAED/////////////QAAAAAAAAAAAAAAAAED/////////////QAAAAAAAAAAAAAAAACCAgICAgICA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAABBAQEBAQEBA////QAAAAAAAAAAAAAAAAED/////////////QAAAAAAAAAAAAAAAAED/////////////QAAAAAAAAAAAAAAAADC/v7+/v7+/v7+/MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAz////3AAAAAAAAAAAAAAAAAAAAAAAABw/////+8QAAAAAAAAAAAAAAAAAAAAABDv///v//+fAAAAAAAAAAAAAAAAAAAAAJ///79A////QAAAAAAAAAAAAAAAAAAAQP///0AAr///zwAAAAAAAAAAAAAAAAAAz///nwAAIP///3AAAAAAAAAAAAAAAABw///vIAAAAID//+8QAAAAAAAAAAAAABDv//+AAAAAABDv//+vAAAAAAAAAAAAAJ///98QAAAAAABg////QAAAAAAAAAAAQP///2AAAAAAAAAAz///3wAAAAAAAAAAz///vwAAAAAAAAAAQP///4AAAAAAAACA////QAAAAAAAAAAAAJ///+8gAAAAAABwgIBgAAAAAAAAAAAAACCAgIBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAgICAgICAgICAgICAgICAgICAgEAAAAD//////////////////////////4AAAAD//////////////////////////4AAAACAgICAgICAgICAgICAgICAgICAgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIO+PEAAAAAAAAAAAAAAAAAAAAAAAAAAAr///30AAAAAAAAAAAAAAAAAAAAAAAAAw//////+vEAAAAAAAAAAAAAAAAAAAAAAAII/v////72AAAAAAAAAAAAAAAAAAAAAAAAAQgO////+vAAAAAAAAAAAAAAAAAAAAAAAAAABg3/9wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBgn7//////769gEAAAAAAAAAAAAAAAUP//////////////3zAAAAAAAAAAAAAAIP/////vv7/v/////+8wAAAAAAAAAAAAAK+PQAAAAAAAIJ/////PAAAAAAAAAAAAAAAAAAAAAAAAAACP////MAAAAAAAAAAAAAAAAAAAAAAAAAAQ////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAYJ/P////////////gAAAAAAAAAAAAFDf////////////////gAAAAAAAAAAAn/////+vcEBAQEBA////gAAAAAAAAABQ////zyAAAAAAAAAA////gAAAAAAAAADP////IAAAAAAAAAAA////gAAAAAAAABD///+vAAAAAAAAAAAA////gAAAAAAAAED///+AAAAAAAAAAAAA////gAAAAAAAADD///+AAAAAAAAAAAAA////gAAAAAAAAAD////PAAAAAAAAAABg////gAAAAAAAAACv////UAAAAAAAAID/////vwAAAAAAAABA/////49AQEBw3///3////3AAAAAAAAAAYP////////////+PEN////8wAAAAAAAAAFDf////////v0AAADDP/98AAAAAAAAAAAAAMGCAgFAgAAAAAAAAMFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCAj2AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAECv////359AAAAAAAAAAAAAAP///4AQr///////////jwAAAAAAAAAAAP///4/P///vv7/v/////48AAAAAAAAAAP///+//72AAAAAAcP////9AAAAAAAAAAP/////PIAAAAAAAAHD///+vAAAAAAAAAP///+8wAAAAAAAAAADf////EAAAAAAAAP///4AAAAAAAAAAAACA////UAAAAAAAAP///4AAAAAAAAAAAABA////gAAAAAAAAP///4AAAAAAAAAAAAAQ////vwAAAAAAAP///4AAAAAAAAAAAAAA////vwAAAAAAAP///4AAAAAAAAAAAAAA////vwAAAAAAAP///4AAAAAAAAAAAAAA////vwAAAAAAAP///4AAAAAAAAAAAAAA////vwAAAAAAAP///4AAAAAAAAAAAAAA////vwAAAAAAAP///4AAAAAAAAAAAABA////gAAAAAAAAP///4AAAAAAAAAAAABw////UAAAAAAAAP///4AAAAAAAAAAAADP////EAAAAAAAAP///+8QAAAAAAAAAFD///+fAAAAAAAAAP/////fMAAAAAAAQO////8gAAAAAAAAAP///+///69wQHCv/////4AAAAAAAAAAAP///1DP////////////nwAAAAAAAAAAAP///0AQj+///////99QAAAAAAAAAAAAAAAAAAAAABBAgIBwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCPz/////+/jyAAAAAAAAAAAAAAAAAQj/////////////+fEAAAAAAAAAAAABDP//////+/z///////3wAAAAAAAAAAAM/////PUAAAAABQn///YAAAAAAAAAAAgP///58AAAAAAAAAACCAAAAAAAAAAAAQ7///3xAAAAAAAAAAAAAAAAAAAAAAAABw////YAAAAAAAAAAAAAAAAAAAAAAAAAC////vAAAAAAAAAAAAAAAAAAAAAAAAAAD///+/AAAAAAAAAAAAAAAAAAAAAAAAADD///+PAAAAAAAAAAAAAAAAAAAAAAAAAED///+AAAAAAAAAAAAAAAAAAAAAAAAAAED///+AAAAAAAAAAAAAAAAAAAAAAAAAAED///+AAAAAAAAAAAAAAAAAAAAAAAAAABD///+fAAAAAAAAAAAAAAAAAAAAAAAAAADv///PAAAAAAAAAAAAAAAAAAAAAAAAAACv////IAAAAAAAAAAAAAAAAAAAAAAAAABg////gAAAAAAAAAAAAAAAAAAAAAAAAAAA3////0AAAAAAAAAAAAAwAAAAAAAAAAAAUP////9wAAAAAAAAQL//MAAAAAAAAAAAAI//////75+AgJ/f////3xAAAAAAAAAAAABw///////////////vYAAAAAAAAAAAAAAAIJ//////////34AQAAAAAAAAAAAAAAAAAAAAQHCAgFAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGCPgEAAAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAHC/////348gAID//78AAAAAAAAAAAAw3//////////vYID//78AAAAAAAAAADDv/////8+/z////8///78AAAAAAAAAAM////+vIAAAACCP/////78AAAAAAAAAYP///58AAAAAAAAAYP///78AAAAAAAAA3///7xAAAAAAAAAAAJ///78AAAAAAAAw////jwAAAAAAAAAAAID//78AAAAAAACA////QAAAAAAAAAAAAID//78AAAAAAACv////EAAAAAAAAAAAAID//78AAAAAAAC/////AAAAAAAAAAAAAID//78AAAAAAAC/////AAAAAAAAAAAAAID//78AAAAAAAC/////AAAAAAAAAAAAAID//78AAAAAAAC/////AAAAAAAAAAAAAID//78AAAAAAAC/////AAAAAAAAAAAAAID//78AAAAAAACf////MAAAAAAAAAAAAID//78AAAAAAABw////YAAAAAAAAAAAAID//78AAAAAAAAg////rwAAAAAAAAAAAL///78AAAAAAAAAz////zAAAAAAAAAAn////78AAAAAAAAAYP///98gAAAAAACf/////78AAAAAAAAAAL/////vn2BAgN///7///78AAAAAAAAAABDP////////////YFD//78AAAAAAAAAAAAQj+///////78wAED//78AAAAAAAAAAAAAABBAgIBgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgj8/////fn0AAAAAAAAAAAAAAAAAAAID///////////+vEAAAAAAAAAAAAAAAn//////fv8//////zxAAAAAAAAAAAACA////v0AAAAAQj////48AAAAAAAAAACD///+fAAAAAAAAAHD///8wAAAAAAAAAJ///98QAAAAAAAAAAC///+fAAAAAAAAEP///3AAAAAAAAAAAABg///vAAAAAAAAUP///zAAAAAAAAAAAAAg////MAAAAAAAgP///wAAAAAAAAAAAAAA////QAAAAAAAv///70BAQEBAQEBAQEBA////gAAAAAAAv///////////////////////gAAAAAAAv///////////////////////gAAAAAAAv///34CAgICAgICAgICAgICAIAAAAAAAn////wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///xAAAAAAAAAAAAAAAAAAAAAAAAAAMP///2AAAAAAAAAAAAAAAAAAAAAAAAAAAN///78AAAAAAAAAAAAAAAAAAAAAAAAAAGD///9wAAAAAAAAAAAAIAAAAAAAAAAAAADP////jxAAAAAAABCA74AAAAAAAAAAAAAw7////++fgICAr/////9AAAAAAAAAAAAAMM///////////////58QAAAAAAAAAAAAABCA3////////++fQAAAAAAAAAAAAAAAAAAAADBggIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwgK+/v6+AUBAAAAAAAAAAAAAAAAAAML////////////9wAAAAAAAAAAAAAABQ7/////////////9AAAAAAAAAAAAAACDv///vgEAgEEBgn88AAAAAAAAAAAAAAJ////8wAAAAAAAAAAAAAAAAAAAAAAAAAN///58AAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAED///////////////////+/AAAAAAAAAED///////////////////+PAAAAAAAAADC/v7+/v////9+/v7+/v79gAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEGCfAAAAAAAAAAAAAAAAAAAAADBAUIC/////IAAAAAAAAAAAII/P////////////////cAAAAAAAABCP////////////////77+vYAAAAAAAEM/////fj4CAr+//73AAAAAAAAAAAAAAr////3AAAAAAABDP//+fAAAAAAAAAAAw////gAAAAAAAAAAQ7///cAAAAAAAAACP////EAAAAAAAAAAAn///3wAAAAAAAAC////PAAAAAAAAAAAAgP///yAAAAAAAAC///+/AAAAAAAAAAAAgP///0AAAAAAAAC////PAAAAAAAAAAAAgP///yAAAAAAAABw////IAAAAAAAAAAAr///7wAAAAAAAAAg////jwAAAAAAAAAw////nwAAAAAAAAAAgP///4AAAAAAADDP///vEAAAAAAAAAAAAID////vr4CAv////+8wAAAAAAAAAAAAAACA////////////vzAAAAAAAAAAAAAAAGD//5+Av7+/v4AwAAAAAAAAAAAAAAAAIP//3wAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//7zAAAAAAAAAAAAAAAAAAAAAAAAAAQP/////Pv7+/v7+/j1AAAAAAAAAAAAAAAJ/////////////////fUAAAAAAAAAAAAACA7////////////////58AAAAAAAAAAAAAADBAQEBAQEBwr/////9gAAAAAAAAAAAAAAAAAAAAAAAAADDv///fAAAAAAAAAAAAAAAAAAAAAAAAAACP////AAAAADC/v48AAAAAAAAAAAAAAABQ////EAAAAED///8AAAAAAAAAAAAAAACf////AAAAAAD///9wAAAAAAAAAAAAAGD///+fAAAAAACf////v3BAQAAgQECAz////+8gAAAAAAAQz///////////////////3zAAAAAAAAAAEJ///////////////9+AEAAAAAAAAAAAAAAQUICPv7+/r4BwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBwgEAAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///4AAACCPz////8+AEAAAAAAAAAAAAP///4AAgP//////////zxAAAAAAAAAAAP///4Cf///vv7+//////58AAAAAAAAAAP///+///4AQAAAAIM////8gAAAAAAAAAP/////vMAAAAAAAAED///9gAAAAAAAAAP///+8wAAAAAAAAAAD///+AAAAAAAAAAP///48AAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQn79wAAAAAAAAAAAAAAAAAAAAAAAAAADP////gAAAAAAAAAAAAAAAAAAAAAAAADD/////vwAAAAAAAAAAAAAAAAAAAAAAABD/////rwAAAAAAAAAAAAAAAAAAAAAAAABg///fMAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYICAgICAgICAgAAAAAAAAAAAAAAAAAAAv////////////wAAAAAAAAAAAAAAAAAAv////////////wAAAAAAAAAAAAAAAAAAMEBAQEBAn////wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAv7+/v7+/3////7+/v7+/vzAAAAAAAAAA/////////////////////0AAAAAAAAAA/////////////////////0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCvr0AAAAAAAAAAAAAAAAAAAAAAAAAAQP////8gAAAAAAAAAAAAAAAAAAAAAAAAgP////+AAAAAAAAAAAAAAAAAAAAAAAAAYP////9gAAAAAAAAAAAAAAAAAAAAAAAAAL///58AAAAAAAAAAAAAAAAAAAAAAAAAAAAgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAggICAgICAgICAgICAIAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAAAQQEBAQEBAQEBw////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////MAAAAAAAAAAAAAAAAAAAAAAAAABw////AAAAAAAAAAAAAAAAAAAAAAAAAACf///PAAAAAAAAAAAAAAAAAAAAAAAAABD///+PAAAAAAAAAAAAAAAAAAAAAAAAAK////8gAAAAAAAAAAAAAAAAAAAAAAAAn////48AAAAAAAAAAAAAAAAAAAAAACCv////zxAAAAAAAAAAAAAAAAAAAAAwn+/////PEAAAAAAAAAAAAAAAABBQj8///////48AAAAAAAAAAAAAAAAAEP////////+fIAAAAAAAAAAAAAAAAAAAAN////+/cBAAAAAAAAAAAAAAAAAAAAAAAHCAQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABrAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCAgI8AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAAAAAAAAAAAAAAAAAL///78AAAAAAAAAAABQgICAcAAAAAAAAL///78AAAAAAAAAAGD////vMAAAAAAAAL///78AAAAAAAAAYP///+8wAAAAAAAAAL///78AAAAAAABg////7zAAAAAAAAAAAL///78AAAAAAFD////vMAAAAAAAAAAAAL///78AAAAAMO///+8wAAAAAAAAAAAAAL///78AAAAw7///7zAAAAAAAAAAAAAAAL///78AADDv///vMAAAAAAAAAAAAAAAAL///78AMO///+8wAAAAAAAAAAAAAAAAAL///78w7///7zAAAAAAAAAAAAAAAAAAAL///7+P////zxAAAAAAAAAAAAAAAAAAAL///78An////78AAAAAAAAAAAAAAAAAAL///78AAL////+fAAAAAAAAAAAAAAAAAL///78AABDP////nwAAAAAAAAAAAAAAAL///78AAAAQz////4AAAAAAAAAAAAAAAL///78AAAAAMO////9gAAAAAAAAAAAAAL///78AAAAAADDv////YAAAAAAAAAAAAL///78AAAAAAABA/////zAAAAAAAAAAAL///78AAAAAAAAAYP///+8wAAAAAAAAAL///78AAAAAAAAAAGD////vMAAAAAAAAL///78AAAAAAAAAAACf////3xAAAAAAAL///78AAAAAAAAAAAAAn////88QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAP////////////8AAAAAAAAAAAAAAAAAAP////////////8AAAAAAAAAAAAAAAAAAICAgICAgL////8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8AAAAAAAAAAAAAAAAAAAAAAAAAAHD///8QAAAAAAAAAAAAAAAAAAAAAAAAADD///+PAAAAAAAAEAAAAAAAAAAAAAAAAAC/////z4CAgJ/fYAAAAAAAAAAAAAAAAAAw7///////////zwAAAAAAAAAAAAAAAAAAIL/////////vnwAAAAAAAAAAAAAAAAAAAAAgYICAYEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICAYAAQgO///68wAAAwr///34AAAAAAAP//3xDP///////vEGD///////+PAAAAAP///6//77+/////n///37/P////EAAAAP////+vEAAAj/////9wAAAA7///UAAAAP///78AAAAAcP///3AAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAP///0AAAAAAQP///wAAAAAAv///gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICAgAAAACCPz////8+AEAAAAAAAAAAAAP///zAQj///////////zxAAAAAAAAAAAP///1DP///vv7+//////58AAAAAAAAAAP///+///4AQAAAAIN////8gAAAAAAAAAP/////vMAAAAAAAAGD///9gAAAAAAAAAP///+8wAAAAAAAAACD///+AAAAAAAAAAP///48AAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAP///4AAAAAAAAAAAAD///+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUK/v////359AAAAAAAAAAAAAAAAAACC/////////////rxAAAAAAAAAAAAAAMO//////z7/f/////88QAAAAAAAAAAAQ3////4AQAAAAIL////+PAAAAAAAAAACA////YAAAAAAAAAC/////QAAAAAAAAADv//+/AAAAAAAAAAAg////nwAAAAAAAFD///9gAAAAAAAAAAAAr///7wAAAAAAAI////8QAAAAAAAAAAAAcP///0AAAAAAAL///98AAAAAAAAAAAAAQP///3AAAAAAAO///78AAAAAAAAAAAAAQP///4AAAAAAAP///78AAAAAAAAAAAAAAP///4AAAAAAAP///78AAAAAAAAAAAAAAP///4AAAAAAAP///78AAAAAAAAAAAAAIP///4AAAAAAAM///78AAAAAAAAAAAAAQP///4AAAAAAAL////8AAAAAAAAAAAAAYP///0AAAAAAAHD///8wAAAAAAAAAAAAj////xAAAAAAACD///+PAAAAAAAAAAAA7///rwAAAAAAAAC////vIAAAAAAAAACA////YAAAAAAAAABA////zyAAAAAAAGD///+/AAAAAAAAAAAAj////++fgFCAz////+8gAAAAAAAAAAAAAI//////////////3zAAAAAAAAAAAAAAAABAv////////++AEAAAAAAAAAAAAAAAAAAAACBQgIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICAAAAAUK/v///vn0AAAAAAAAAAAAAA////QBC///////////+PAAAAAAAAAAAA////UM///++/v+//////gAAAAAAAAAAA////7//vYAAAABCP/////yAAAAAAAAAA/////88gAAAAAAAAj////48AAAAAAAAA////7zAAAAAAAAAAEO///98AAAAAAAAA////gAAAAAAAAAAAAK////8gAAAAAAAA////gAAAAAAAAAAAAHD///9QAAAAAAAA////gAAAAAAAAAAAAED///+AAAAAAAAA////gAAAAAAAAAAAAED///+AAAAAAAAA////gAAAAAAAAAAAABD///+AAAAAAAAA////gAAAAAAAAAAAAAD///+AAAAAAAAA////gAAAAAAAAAAAACD///+AAAAAAAAA////gAAAAAAAAAAAAED///+AAAAAAAAA////gAAAAAAAAAAAAGD///9QAAAAAAAA////gAAAAAAAAAAAAI////8gAAAAAAAA////gAAAAAAAAAAAAN///98AAAAAAAAA////7zAAAAAAAAAAcP///4AAAAAAAAAA/////+9AAAAAAABg////7xAAAAAAAAAA////////z4CAgM//////YAAAAAAAAAAA////j8////////////+AAAAAAAAAAAAA////gBCA7///////31AAAAAAAAAAAAAA////gAAAEECAgHAwAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAAr4BwIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCAz////8+AEAAggIBgAAAAAAAAAAAAMN//////////71BA//+/AAAAAAAAAAAw7/////+/v8/////P//+/AAAAAAAAAADP////jxAAAAAgr/////+/AAAAAAAAAGD///+fAAAAAAAAAID///+/AAAAAAAAAM///+8QAAAAAAAAAADP//+/AAAAAAAAIP///48AAAAAAAAAAAC///+/AAAAAAAAYP///1AAAAAAAAAAAAC///+/AAAAAAAAgP///zAAAAAAAAAAAAC///+/AAAAAAAAv////wAAAAAAAAAAAAC///+/AAAAAAAAv////wAAAAAAAAAAAAC///+/AAAAAAAAv////wAAAAAAAAAAAAC///+/AAAAAAAAv////wAAAAAAAAAAAAC///+/AAAAAAAAr////xAAAAAAAAAAAAC///+/AAAAAAAAgP///0AAAAAAAAAAAAC///+/AAAAAAAAYP///3AAAAAAAAAAAAC///+/AAAAAAAAIP///78AAAAAAAAAABDf//+/AAAAAAAAAN////9AAAAAAAAAAJ////+/AAAAAAAAAGD////fMAAAAAAQv/////+/AAAAAAAAAADP/////5+AgJ/v/+/f//+/AAAAAAAAAAAw7///////////7zC///+/AAAAAAAAAAAAEJ////////+/IAC///+/AAAAAAAAAAAAAAAgUICAYCAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAAwcICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABggICAgIAwAAAAEIDP////748AAAAAAAC///////+AAAAw7////////78AAAAAAAC///////+PADDv/////////58AAAAAAAAAAABA//+/EN///79gQID//4AAAAAAAAAAAABA///PgP//cAAAAID//4AAAAAAAAAAAABA////7/9wAAAAAID//4AAAAAAAAAAAABA/////78AAAAAAID//1AAAAAAAAAAAABA/////0AAAAAAAGC/vzAAAAAAAAAAAABA////vwAAAAAAAAAAAAAAAAAAAAAAAABA////YAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAAAAAABA////QAAAAAAAAAAAAAAAAAAAAACPv7/P////z7+/v2AAAAAAAAAAAAAAAAC//////////////4AAAAAAAAAAAAAAAAC//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGCv3/////+/j0AAAAAAAAAAAAAAAABQ3//////////////fUAAAAAAAAAAAAGD/////77+/v8///////1AAAAAAAAAAEO///+9QAAAAAAAQYM//vwAAAAAAAAAAYP///0AAAAAAAAAAAABgIAAAAAAAAAAAgP///wAAAAAAAAAAAAAAAAAAAAAAAAAAgP///zAAAAAAAAAAAAAAAAAAAAAAAAAAUP///88gAAAAAAAAAAAAAAAAAAAAAAAAAN//////n1AAAAAAAAAAAAAAAAAAAAAAADDf////////r3AgAAAAAAAAAAAAAAAAAAAQj+//////////r0AAAAAAAAAAAAAAAAAAABBgr+////////+fEAAAAAAAAAAAAAAAAAAAAABAj9//////rwAAAAAAAAAAAAAAAAAAAAAAAABg7////1AAAAAAAAAAAAAAAAAAAAAAAAAAYP///58AAAAAAAAAAAAAAAAAAAAAAAAAAP///78AAAAAAAAAAAAAAAAAAAAAAAAAAP///78AAAAAAAAAEIAAAAAAAAAAAAAAQP///58AAAAAAAAQz//PQAAAAAAAAABA7////0AAAAAAAACP/////9+fgICAgM//////nwAAAAAAAAAAgO////////////////+fAAAAAAAAAAAAACCP3///////////r0AAAAAAAAAAAAAAAAAAADBQgICAYEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgr7+vAAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAYICAgIDf///fgICAgICAgAAAAAAAAAAAv////////////////////wAAAAAAAAAAv///////////////////vwAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAAC///+/AAAAAAAAAAAAAAAAAAAAAAAAAACf///fAAAAAAAAAAAAAAAAAAAAAAAAAABQ////jwAAAAAAAEAAAAAAAAAAAAAAAAAAz////8+AgICPz/+AAAAAAAAAAAAAAAAAIN/////////////vEAAAAAAAAAAAAAAAABCf/////////89gAAAAAAAAAAAAAAAAAAAAEECAgIBAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAgIBAAAAAAAAAAAAAgICAQAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAAD///+AAAAAAAAAAAAA////gAAAAAAAAADP//+PAAAAAAAAAAAg////gAAAAAAAAAC////PAAAAAAAAABDP////gAAAAAAAAACP////QAAAAAAAQN//////gAAAAAAAAAAw////749AQHC////Pz///gAAAAAAAAAAAj////////////88Qj///gAAAAAAAAAAAAIDv///////fYAAAgP//gAAAAAAAAAAAAAAQQICAYDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCAgIAgAAAAAAAAAAAAAABAgICAAAAAACD///+PAAAAAAAAAAAAAADP//+vAAAAAAC////fAAAAAAAAAAAAACD///9gAAAAAABg////MAAAAAAAAAAAAHD//+8QAAAAAAAQ////jwAAAAAAAAAAAM///58AAAAAAAAAr///3wAAAAAAAAAAIP///1AAAAAAAAAAUP///zAAAAAAAAAAcP//3wAAAAAAAAAAAO///48AAAAAAAAAz///jwAAAAAAAAAAAJ///98AAAAAAAAg////MAAAAAAAAAAAADD///8wAAAAAABw///PAAAAAAAAAAAAAADf//+PAAAAAADP//9wAAAAAAAAAAAAAACP///fAAAAACD///8gAAAAAAAAAAAAAAAg////MAAAAHD//68AAAAAAAAAAAAAAAAAz///jwAAAM///2AAAAAAAAAAAAAAAAAAcP//3wAAIP//7xAAAAAAAAAAAAAAAAAAEP///0AAcP//nwAAAAAAAAAAAAAAAAAAAK///58Az///UAAAAAAAAAAAAAAAAAAAAGD//+8g///fAAAAAAAAAAAAAAAAAAAAAADv//+///+PAAAAAAAAAAAAAAAAAAAAAACf//////8wAAAAAAAAAAAAAAAAAAAAAABQ/////88AAAAAAAAAAAAAAAAAAAAAAAAA3////3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIICAgCAAAAAAAAAAAAAAAAAAAABAgIBgEP///3AAAAAAAAAAAAAAAAAAAACf//+/AO///4AAAAAAAAAAAAAAAAAAAAC///+AAL///78AAAAAAIC/v79wAAAAAADv//9gAID//88AAAAAAM////+/AAAAAAD///8wAFD///8AAAAAAP//////AAAAAED///8AADD///8gAAAAQP//3///MAAAAFD//88AAAD///9AAAAAgP//gP//YAAAAID//68AAAC///9gAAAAr///IP//jwAAAJ///4AAAACf//+AAAAA3//PAP//vwAAAL///0AAAABw//+vAAAQ//+fAL///wAAAO///yAAAABA//+/AABA//9wAJ///zAAAP///wAAAAAQ////AACA//9AAHD//1AAMP//vwAAAAAA3///EACv//8AAED//4AAQP//nwAAAAAAv///QADf/98AABD//78AgP//cAAAAAAAgP//YCD//68AAADv/+8Aj///QAAAAAAAUP//gFD//4AAAAC///8gv///EAAAAAAAMP//r4D//0AAAACA//9Q3//vAAAAAAAAAP//v7///xAAAABg//+A//+/AAAAAAAAAL///+//3wAAAABA///v//+PAAAAAAAAAJ//////vwAAAAAA//////9gAAAAAAAAAHD/////gAAAAAAAz/////9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECAgIBQAAAAAAAAAAAAcICAgBAAAAAAABDv///vEAAAAAAAAABA////jwAAAAAAAABQ////rwAAAAAAABDf///fEAAAAAAAAAAAj////0AAAAAAAID///8wAAAAAAAAAAAAEN///98QAAAAMP///4AAAAAAAAAAAAAAAED///+AAAAAz///zwAAAAAAAAAAAAAAAACP////IABw///vMAAAAAAAAAAAAAAAAAAAz///vyDv//9wAAAAAAAAAAAAAAAAAAAAMP///9///78AAAAAAAAAAAAAAAAAAAAAAID/////7yAAAAAAAAAAAAAAAAAAAAAAAADv////jwAAAAAAAAAAAAAAAAAAAAAAAGD/////7yAAAAAAAAAAAAAAAAAAAAAAIO///+///88AAAAAAAAAAAAAAAAAAAAAv///v1D///+AAAAAAAAAAAAAAAAAAACA///vIACv////MAAAAAAAAAAAAAAAADD///9wAAAQ7///zwAAAAAAAAAAAAAAEM///78AAAAAcP///48AAAAAAAAAAAAAj////yAAAAAAAL////9AAAAAAAAAAABA////gAAAAAAAACD////fEAAAAAAAABDv///PAAAAAAAAAACA////jwAAAAAAAK////8wAAAAAAAAAAAAz////1AAAAAAYP///4AAAAAAAAAAAAAAQP///+8QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCAgIAgAAAAAAAAAAAAAABQgICAAAAAACD///+PAAAAAAAAAAAAAADP//+vAAAAAACv///fAAAAAAAAAAAAACD///9gAAAAAABg////MAAAAAAAAAAAAHD///8QAAAAAAAQ////jwAAAAAAAAAAAM///58AAAAAAAAAr///3wAAAAAAAAAAIP///1AAAAAAAAAAYP///zAAAAAAAAAAcP//7wAAAAAAAAAAEO///48AAAAAAAAAz///nwAAAAAAAAAAAJ///98AAAAAAAAg////UAAAAAAAAAAAAFD///8wAAAAAABg///fAAAAAAAAAAAAAADv//+PAAAAAACv//+PAAAAAAAAAAAAAACf///fAAAAABD///8wAAAAAAAAAAAAAABA////MAAAAGD//98AAAAAAAAAAAAAAAAA3///cAAAAK///48AAAAAAAAAAAAAAAAAj///zwAAEP///zAAAAAAAAAAAAAAAAAAMP///yAAYP//zwAAAAAAAAAAAAAAAAAAAN///3AAn///cAAAAAAAAAAAAAAAAAAAAID//88A7///IAAAAAAAAAAAAAAAAAAAACD///9w///PAAAAAAAAAAAAAAAAAAAAAADP///v//9wAAAAAAAAAAAAAAAAAAAAAABw//////8QAAAAAAAAAAAAAAAAAAAAAAAg/////68AAAAAAAAAAAAAAAAAAAAAAAAAAO///2AAAAAAAAAAAAAAAAAAAAAAAAAAYP//7xAAAAAAAAAAAAAAAAAAAAAAAAAA3///gAAAAAAAAAAAAAAAAAAAAAAAAACf///vEAAAAAAAAAAAAAAAAAAAAAAAEJ////9QAAAAAAAAAAAAAAAAAAAAIFCf7////58AAAAAAAAAAAAAAAAAAAAAj///////gAAAAAAAAAAAAAAAAAAAAAAAYP///79AAAAAAAAAAAAAAAAAAAAAAAAAMI9wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABggICAgICAgICAgICAgIAgAAAAAAAAAAC///////////////////9AAAAAAAAAAAC///////////////////9AAAAAAAAAAABggICAgICAgICAj////+8QAAAAAAAAAAAAAAAAAAAAAAAAn////0AAAAAAAAAAAAAAAAAAAAAAAABg////gAAAAAAAAAAAAAAAAAAAAAAAADDv//+/AAAAAAAAAAAAAAAAAAAAAAAAEM///+8QAAAAAAAAAAAAAAAAAAAAAAAAn////1AAAAAAAAAAAAAAAAAAAAAAAABg////jwAAAAAAAAAAAAAAAAAAAAAAADDv///PAAAAAAAAAAAAAAAAAAAAAAAAEM///+8gAAAAAAAAAAAAAAAAAAAAAAAAn////1AAAAAAAAAAAAAAAAAAAAAAAABg////jwAAAAAAAAAAAAAAAAAAAAAAADDv///PAAAAAAAAAAAAAAAAAAAAAAAAEM///+8gAAAAAAAAAAAAAAAAAAAAAAAAn////1AAAAAAAAAAAAAAAAAAAAAAAABg////jwAAAAAAAAAAAAAAAAAAAAAAADDv///PEAAAAAAAAAAAAAAAAAAAAAAAAK////////////////////9gAAAAAAAAAL////////////////////9AAAAAAAAAAL////////////////////8QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgQDAAAAAAAAAAAAAAAAAAAAAAAABgr+///78AAAAAAAAAAAAAAAAAAAAAEM///////78AAAAAAAAAAAAAAAAAAAAAz////++fgGAAAAAAAAAAAAAAAAAAAABQ////jwAAAAAAAAAAAAAAAAAAAAAAAACA///PAAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAABA///fAAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAAAg////AAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAA7///QAAAAAAAAAAAAAAAAAAAAAAAAAAAv///YAAAAAAAAAAAAAAAAAAAAAAAAAAAv///gAAAAAAAAAAAAAAAAAAAAAAAAAAAj///gAAAAAAAAAAAAAAAAAAAAAAAAAAAv///gAAAAAAAAAAAAAAAAAAAAAAAAAAQ7///cAAAAAAAAAAAAAAAAAAAAAAAAFDf////IAAAAAAAAAAAAAAAAAAAj7/P/////+9gAAAAAAAAAAAAAAAAAAAAv//////vnxAAAAAAAAAAAAAAAAAAAAAAv////////78wAAAAAAAAAAAAAAAAAAAAAAAgUJ/////vEAAAAAAAAAAAAAAAAAAAAAAAAAAw////cAAAAAAAAAAAAAAAAAAAAAAAAAAAv///gAAAAAAAAAAAAAAAAAAAAAAAAAAAj///gAAAAAAAAAAAAAAAAAAAAAAAAAAAv///gAAAAAAAAAAAAAAAAAAAAAAAAAAAv///cAAAAAAAAAAAAAAAAAAAAAAAAAAA3///QAAAAAAAAAAAAAAAAAAAAAAAAAAA////QAAAAAAAAAAAAAAAAAAAAAAAAAAQ////EAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA///vAAAAAAAAAAAAAAAAAAAAAAAAAABw//+/AAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAABg////MAAAAAAAAAAAAAAAAAAAAAAAAAAQ7////59gQDAAAAAAAAAAAAAAAAAAAAAAMO///////78AAAAAAAAAAAAAAAAAAAAAACCf/////78AAAAAAAAAAAAAAAAAAAAAAAAAAEBwgGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAQP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAEEBAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAgAAAAAAAAAAAAAAAAAAAAAAAAAAAA////769gAAAAAAAAAAAAAAAAAAAAAAAA////////vxAAAAAAAAAAAAAAAAAAAAAAgICv7////78AAAAAAAAAAAAAAAAAAAAAAAAAAJ////8wAAAAAAAAAAAAAAAAAAAAAAAAAADf//+AAAAAAAAAAAAAAAAAAAAAAAAAAAC///+AAAAAAAAAAAAAAAAAAAAAAAAAAAC///9gAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAACD///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED//88AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//68AAAAAAAAAAAAAAAAAAAAAAAAAAJ///4AAAAAAAAAAAAAAAAAAAAAAAAAAAK///68AAAAAAAAAAAAAAAAAAAAAAAAAAID///8wAAAAAAAAAAAAAAAAAAAAAAAAACD////vYBAAAAAAAAAAAAAAAAAAAAAAAABQ7//////fv48AAAAAAAAAAAAAAAAAAAAAEHDf/////78AAAAAAAAAAAAAAAAAAAAwr////////78AAAAAAAAAAAAAAAAAABDv////n1AwAAAAAAAAAAAAAAAAAAAAAHD///9gAAAAAAAAAAAAAAAAAAAAAAAAAK///88AAAAAAAAAAAAAAAAAAAAAAAAAAK///4AAAAAAAAAAAAAAAAAAAAAAAAAAAID//58AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAFD//78AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAADD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAD///8wAAAAAAAAAAAAAAAAAAAAAAAAAAD///9AAAAAAAAAAAAAAAAAAAAAAAAAAADP//9QAAAAAAAAAAAAAAAAAAAAAAAAAAC///+AAAAAAAAAAAAAAAAAAAAAAAAAAAC///+AAAAAAAAAAAAAAAAAAAAAAAAAAFD///9QAAAAAAAAAAAAAAAAAAAAQEBgn////98AAAAAAAAAAAAAAAAAAAAA////////7zAAAAAAAAAAAAAAAAAAAAAA/////++fEAAAAAAAAAAAAAAAAAAAAAAAgIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBggFAQAAAAAAAAAAAAAAAAAAAAAAAQv///////gAAAAAAAAAAAn0AAAAAAACDv/////////88QAAAAAABw//+PAAAAAM////+fgM/////PEAAAAGD///9AAAAAgP//7zAAAACA////73BQn////48AAAAA7///MAAAAAAAYP//////////zxAAAAAAIJ+AAAAAAAAAAEDf//////+vEAAAAAAAAAAAAAAAAAAAAAAQYI+vgDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIICAcBAAAAAAAAAAAAAAAAAAAAAAAABg/////88QAAAAAAAAAAAAAAAAAAAAABDv//////+fAAAAAAAAAAAAAAAAAAAAAED////////fAAAAAAAAAAAAAAAAAAAAAED////////fAAAAAAAAAAAAAAAAAAAAABDv//////+fAAAAAAAAAAAAAAAAAAAAAABg/////88QAAAAAAAAAAAAAAAAAAAAAAAAIICAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADXAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMI8AAAAAAAAAABCPAAAAAAAAAAAAAAAw7/+fAAAAAAAAEM//nwAAAAAAAAAAAACf////nwAAAAAQz////0AAAAAAAAAAAAAQz////58AABDP////YAAAAAAAAAAAAAAAEM////+fEM////9gAAAAAAAAAAAAAAAAABDP////7////2AAAAAAAAAAAAAAAAAAAAAQz///////YAAAAAAAAAAAAAAAAAAAAAAAIP////+/AAAAAAAAAAAAAAAAAAAAAAAQz///////nwAAAAAAAAAAAAAAAAAAABDP////3////58AAAAAAAAAAAAAAAAAEM////9gEM////+fAAAAAAAAAAAAAAAQz////2AAABDP////nwAAAAAAAAAAAACf////YAAAAAAQz////0AAAAAAAAAAAAAQz/9gAAAAAAAAEM//YAAAAAAAAAAAAAAAEFAAAAAAAAAAABBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBAAAAAAAAAAAAAAAAAAAAAAAAAAAAwv//PAAAAAAAAAAAAAAAAAAAAAAAAEJ//////YAAAAAAAAAAAAAAAAAAAAACA7/////+/UAAAAAAAAAAAAAAAAAAAUN/////vnzAAAAAAAAAAAAAAAAAAAAAAgP//z2AQAAAAAAAAAAAAAAAAAAAAAAAAEJ8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAII/P////359AAAAAAAAAAAAAAAAAAACA////////////rxAAAAAAAAAAAAAAAJ//////37/P/////88QAAAAAAAAAAAAgP///79AAAAAEI////+PAAAAAAAAAAAg////nwAAAAAAAABw////MAAAAAAAAACf///fEAAAAAAAAAAAv///nwAAAAAAABD///9wAAAAAAAAAAAAYP//7wAAAAAAAFD///8wAAAAAAAAAAAAIP///zAAAAAAAID///8AAAAAAAAAAAAAAP///0AAAAAAAL///+9AQEBAQEBAQEBAQP///4AAAAAAAL///////////////////////4AAAAAAAL///////////////////////4AAAAAAAL///9+AgICAgICAgICAgICAgCAAAAAAAJ////8AAAAAAAAAAAAAAAAAAAAAAAAAAID///8QAAAAAAAAAAAAAAAAAAAAAAAAADD///9gAAAAAAAAAAAAAAAAAAAAAAAAAADf//+/AAAAAAAAAAAAAAAAAAAAAAAAAABg////cAAAAAAAAAAAACAAAAAAAAAAAAAAz////48QAAAAAAAQgO+AAAAAAAAAAAAAMO/////vn4CAgK//////QAAAAAAAAAAAADDP//////////////+fEAAAAAAAAAAAAAAQgN/////////vn0AAAAAAAAAAAAAAAAAAAAAwYICAcEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEBAQEBAQEBAQEBAQEBAQEBAQEBAQBAAv////////////////////////////0AAv////////////////////////////0AAj7+/v7+/v7+/v7+/v7+/v7+/v7+/vzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA////////////////////////////////////////////////////////////////v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQDAAAAAAAAAAAAAAAAAAAAAAAAAAAGD//4AAAAAAAAAAAAAAAAAAAAAAAAAAAN///0AAAAAAAAAAAAAAAAAAAAAAAAAAYP///xAAAAAAAAAAAAAAAAAAAAAAAAAA3///zwAAAAAAAAAAAAAAAAAAAAAAAABA////nwAAAAAAAAAAAAAAAAAAAAAAAAC/////YAAAAAAAAAAAAAAAAAAAAAAAAED/////MAAAAAAAAAAAAAAAAAAAAAAAAK//////YAAAAAAAAAAAAAAAAAAAAAAAAP//////7wAAAAAAAAAAAAAAAAAAAAAAAP///////wAAAAAAAAAAAAAAAAAAAAAAAN//////3wAAAAAAAAAAAAAAAAAAAAAAADDv///vMAAAAAAAAAAAAAAAAAAAAAAAAAAQYGAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADBAMAAAAAAAAAAAAAAAAAAAAAAAAAAAn////78AAAAAAAAAAAAAAAAAAAAAAABA//////9wAAAAAAAAAAAAAAAAAAAAAACA//////+/AAAAAAAAAAAAAAAAAAAAAABw//////+fAAAAAAAAAAAAAAAAAAAAAAAQz/////9QAAAAAAAAAAAAAAAAAAAAAAAAj////98AAAAAAAAAAAAAAAAAAAAAAAAAz////2AAAAAAAAAAAAAAAAAAAAAAAAAA////3wAAAAAAAAAAAAAAAAAAAAAAAABA////YAAAAAAAAAAAAAAAAAAAAAAAAACA///vAAAAAAAAAAAAAAAAAAAAAAAAAACv//+AAAAAAAAAAAAAAAAAAAAAAAAAAADv/+8QAAAAAAAAAAAAAAAAAAAAAAAAAACAgFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgQEAQAAAAAAAwQEAAAAAAAAAAAAAAAADf//8QAAAAABDv/+8AAAAAAAAAAAAAAGD//88AAAAAAHD//78AAAAAAAAAAAAAAM///58AAAAAAN///4AAAAAAAAAAAAAAQP///2AAAAAAYP///0AAAAAAAAAAAAAAv////zAAAAAA3////xAAAAAAAAAAAABA////7wAAAABg////zwAAAAAAAAAAAACv////vwAAAADf////nwAAAAAAAAAAACD/////zxAAAED/////zxAAAAAAAAAAAHD//////48AAID//////3AAAAAAAAAAAID//////78AAK///////4AAAAAAAAAAAFD//////3AAAHD//////2AAAAAAAAAAAACf////vxAAAAC/////nwAAAAAAAAAAAAAAMIBAAAAAAAAAQIAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQBAAAAAAAABAQBAAAAAAAAAAAAAAIM///+9gAAAAMO///+8wAAAAAAAAAAAAr//////vEAAA3//////fAAAAAAAAAAAA////////QAAA////////AAAAAAAAAAAA3///////MAAA////////AAAAAAAAAAAAYP/////fAAAAYP////+/AAAAAAAAAAAAEP////9gAAAAMP////9QAAAAAAAAAAAAQP///98AAAAAYP///98AAAAAAAAAAAAAgP///3AAAAAAj////2AAAAAAAAAAAAAAr///7xAAAAAAz///3wAAAAAAAAAAAAAA7///gAAAAAAA////YAAAAAAAAAAAAAAg///vEAAAAABA///fAAAAAAAAAAAAAABQ//+PAAAAAACA//+AAAAAAAAAAAAAAABAgIAgAAAAAABQgIAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwr+//z4AQAAAAAAAAAAAAAAAAAAAAAGD////////PEAAAAAAAAAAAAAAAAAAAIO//////////nwAAAAAAAAAAAAAAAAAAcP///////////xAAAAAAAAAAAAAAAAAAr////////////0AAAAAAAAAAAAAAAAAAr////////////0AAAAAAAAAAAAAAAAAAcP///////////xAAAAAAAAAAAAAAAAAAEO//////////nwAAAAAAAAAAAAAAAAAAAFD////////PEAAAAAAAAAAAAAAAAAAAAAAwn+//z4AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP//+/EAAAAGDv/88wAAAAMN//71AAAHD/////nwAAMP////+/AAAQ7////+8QAL//////vwAAgP//////AABA//////9AAI//////rwAAYP/////vAAAg//////8wACDv///vMAAAAM////9gAAAAj////58AAAAQYHAgAAAAAABQgDAAAAAAAECAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////////////////////////////////////////////////////////////0BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIlAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAMJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAED/////////////////AAAAAAAAAAAAAED/////////////////AAAAAAAAAAAAAED/////////////////AAAAAAAAAAAAAED///9AQEBAQEBAQEBAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAECUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////8AAAAAAAAAAAAA//////////////////8AAAAAAAAAAAAA//////////////////8AAAAAAAAAAAAAQEBAQEBAQEBAQHD///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAABQlAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP////////////////8AAAAAAAAAAAAAQP////////////////8AAAAAAAAAAAAAQP////////////////8AAAAAAAAAAAAAEEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYJQAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAD//////////////////wAAAAAAAAAAAAD//////////////////wAAAAAAAAAAAAD//////////////////wAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHCUAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA/////////////////wAAAAAAAAAAAABA/////////////////wAAAAAAAAAAAABA/////////////////wAAAAAAAAAAAABA////QEBAQEBAQEBAQAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAACQlAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAP//////////////////AAAAAAAAAAAAAP//////////////////AAAAAAAAAAAAAP//////////////////AAAAAAAAAAAAAEBAQEBAQEBAQEBw////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAsJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////////////////////////////////////QEBAQEBAQEBAQHD///9AQEBAQEBAQEBAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAAAAAAAAAAAAAAAED///8AAAAAAAAAAAAANCUAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAAAAAAAAAAAAAABA////AAAAAAAAAAAAAP///////////////////////////////////////////////////////////////////////////////////////////////0BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwlAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////////9AQEBAQEBAQEBAcP///0BAQEBAQEBAQEAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAQP///wAAAAAAAAAAAABQJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/////////////////////////////////////////////////////////////////gICAgICAgICAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUSUAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAFQlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAgP////////////////////8AAAAAAAAAgP////////////////////8AAAAAAAAAgP////////////////////8AAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAAAAAAAAAAAAAAAAAAAAAAAAgP//vwAAAL+/v7+/v7+/v78AAAAAAAAAgP//vwAAAP////////////8AAAAAAAAAgP//vwAAAP////////////8AAAAAAAAAgP//vwAAAP///5+AgICAgIAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAAAAAAAAAAAAgP//vwAAAP///0AAAAAAAABXJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEBAQEBAQEBAQEBAQEBAQEAwAAAAAAAAv/////////////////////+/AAAAAAAAv/////////////////////+/AAAAAAAAv/////////////////////+/AAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAj7+/v7+/v7+/v78wAACA//+/AAAAAAAAv/////////////9AAACA//+/AAAAAAAAv/////////////9AAACA//+/AAAAAAAAYICAgICAgJ////9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAAAAAAAAAAAAAAED///9AAACA//+/AAAAWiUAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////QAAAAAAAAAAAAAAAAACA//+/AAAA////cEBAQEBAQAAAAAAAAACA//+/AAAA/////////////wAAAAAAAACA//+/AAAA/////////////wAAAAAAAACA//+/AAAA/////////////wAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAACA//+/AAAAAAAAAAAAAAAAAAAAAAAAAACA///vv7+/v7+/v7+/v7+/vwAAAAAAAACA/////////////////////wAAAAAAAACA/////////////////////wAAAAAAAABAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF0lAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAAAAAAAAAAQP///0AAAID//78AAAAAAAAwQEBAQEBAcP///0AAAID//78AAAAAAAC//////////////0AAAID//78AAAAAAAC//////////////0AAAID//78AAAAAAAC//////////////0AAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAAAAAAAAAAAAAAAAAAAAAID//78AAAAAAACPv7+/v7+/v7+/v7+/v9///78AAAAAAAC//////////////////////78AAAAAAAC//////////////////////78AAAAAAABggICAgICAgICAgICAgICAgGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAJQAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhCUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////4glAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+MJQAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAAAAAAABA////////////////QAAAAAAAkCUAAAAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////wAAAAAAAAAAAAAAAL///////////////5ElAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+/AACPvzAAj78wAI+/YABgv2AAYL8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAEBAAAAwQBAAMEAQADBAIAAgQCAAIEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+/AACPvzAAj78wAI+/YABgv2AAYL8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAICAAABggCAAYIAgAGCAQABAgEAAQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICAAABggCAAYIAgAGCAQABAgEAAQIAAAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAICAAABggCAAYIAgAGCAQABAgEAAQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICAAABggCAAYIAgAGCAQABAgEAAQIAAAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAL+/AACPvzAAj78wAI+/YABgv2AAYL8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAwQBAAMEAQADBAIAAgQCAAIEAAAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAL+/AACPvzAAj78wAI+/YABgv2AAYL8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAEBAAAAwQBAAMEAQADBAIAAgQCAAIEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+/AACPvzAAj78wAI+/YABgv2AAYL8AAP//AAC//0AAv/9AAL//gACA/4AAgP8AAP//AAC//0AAv/9AAL//gACA/4AAgP+SJQAA//8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AAQEC/v0BAn79gQJ+/YECfv4BAgL+AQIC/AAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/v79AQL+/YECfv2BAn79gQIC/gECAv4BA//8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AAQEC/v0BAn79gQJ+/YECfv4BAgL+AQIC/AAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/gICAgICAgICAgICAgICAgICAgICAgICA//8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AAgICAgICAgICAgICAgICAgICAgICAgICAAAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/gICAgICAgICAgICAgICAgICAgICAgICA//8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AAgICAgICAgICAgICAgICAgICAgICAgICAAAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/QEC/v0BAn79gQJ+/YECfv4BAgL+AQIC///8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AAv79AQL+/YECfv2BAn79gQIC/gECAv4BAAAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/QEC/v0BAn79gQJ+/YECfv4BAgL+AQIC///8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AAAAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID///8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AAAAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/v79AQL+/YECfv2BAn79gQIC/gECAv4BA//8AAP//QAC//0AAv/9AAID/gACA/4AA//8AAP//QAC//0AAv/9AAID/gACA/4AAQEC/v0BAn79gQJ+/YECfv4BAgL+AQIC/AAD//wAAv/9AAL//QAC//4AAgP+AAID/AAD//wAAv/9AAL//QAC//4AAgP+AAID/kyUAAP//////////////////////////////////////////////////////////////////QED//3BAz/9wQM//cECf/59An/+fQP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//v7///8+/7//Pv+//z7/f/9+/3//fv///////////////////////////////////////////////////////////////////QED//3BAz/9wQM//cECf/59An/+fQP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//gID//5+A3/+fgN//n4C//7+Av/+/gP//////////////////////////////////////////////////////////////////gID//5+A3/+fgN//n4C//7+Av/+/gP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//gID//5+A3/+fgN//n4C//7+Av/+/gP//////////////////////////////////////////////////////////////////gID//5+A3/+fgN//n4C//7+Av/+/gP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//QED//3BAz/9wQM//cECf/59An/+fQP//////////////////////////////////////////////////////////////////v7///8+/7//Pv+//z7/f/9+/3//fv///AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//QED//3BAz/9wQM//cECf/59An/+fQP//////////////////////////////////////////////////////////////////////////////////////////////////AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//////////////////////////////////////////////////////////////////////////////////////////////////AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//v7///8+/7//Pv+//z7/f/9+/3//fv///////////////////////////////////////////////////////////////////QED//3BAz/9wQM//cECf/59An/+fQP//AAD//0AAv/9AAL//QACA/4AAgP+AAP//AAD//0AAv/9AAL//QACA/4AAgP+AAKAlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEBAQEBAQEBAQEBAQEBAQEBAQEBAQCAAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAv////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADPJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgQAAAAAAAAAAAAAAAAAAAAAAAABBwz//////vr2AAAAAAAAAAAAAAAAAAgO/////////////fQAAAAAAAAAAAABDP/////////////////4AAAAAAAAAAEM////////////////////+AAAAAAAAAv///////////////////////UAAAAABg////////////////////////7xAAAADf/////////////////////////3AAADD//////////////////////////98AAID///////////////////////////8gAL////////////////////////////9AAL////////////////////////////9gAL////////////////////////////9QAK////////////////////////////9AAID///////////////////////////8QADD//////////////////////////88AAAC//////////////////////////2AAAABA////////////////////////3wAAAAAAn///////////////////////QAAAAAAAEM////////////////////9gAAAAAAAAABCv////////////////72AAAAAAAAAAAAAAYN////////////+/IAAAAAAAAAAAAAAAAABgn9////+/jzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", FALLBACK_GLYPH, FONT, SHADE_ALPHA, PNG_SIG, CRC_TABLE; @@ -669448,46 +592014,46 @@ var init_ansiToPng = __esm(() => { }); // src/utils/screenshotClipboard.ts -import { mkdir as mkdir47, unlink as unlink22, writeFile as writeFile51 } from "fs/promises"; -import { tmpdir as tmpdir11 } from "os"; -import { join as join148 } from "path"; +import { mkdir as mkdir47, unlink as unlink22, writeFile as writeFile49 } from "fs/promises"; +import { tmpdir as tmpdir8 } from "os"; +import { join as join138 } from "path"; async function copyAnsiToClipboard(ansiText, options2) { try { - const tempDir = join148(tmpdir11(), "claude-code-screenshots"); + const tempDir = join138(tmpdir8(), "claude-code-screenshots"); await mkdir47(tempDir, { recursive: true }); - const pngPath = join148(tempDir, `screenshot-${Date.now()}.png`); + const pngPath = join138(tempDir, `screenshot-${Date.now()}.png`); const pngBuffer = ansiToPng(ansiText, options2); - await writeFile51(pngPath, pngBuffer); - const result3 = await copyPngToClipboard(pngPath); + await writeFile49(pngPath, pngBuffer); + const result2 = await copyPngToClipboard(pngPath); try { await unlink22(pngPath); } catch {} - return result3; - } catch (error46) { - logError2(error46); + return result2; + } catch (error42) { + logError2(error42); return { success: false, - message: `Failed to copy screenshot: ${error46 instanceof Error ? error46.message : "Unknown error"}` + message: `Failed to copy screenshot: ${error42 instanceof Error ? error42.message : "Unknown error"}` }; } } async function copyPngToClipboard(pngPath) { - const platform6 = getPlatform(); - if (platform6 === "macos") { + const platform5 = getPlatform(); + if (platform5 === "macos") { const escapedPath = pngPath.replace(/\\/g, "\\\\").replace(/"/g, "\\\""); const script = `set the clipboard to (read (POSIX file "${escapedPath}") as «class PNGf»)`; - const result3 = await execFileNoThrowWithCwd("osascript", ["-e", script], { + const result2 = await execFileNoThrowWithCwd("osascript", ["-e", script], { timeout: 5000 }); - if (result3.code === 0) { + if (result2.code === 0) { return { success: true, message: "Screenshot copied to clipboard" }; } return { success: false, - message: `Failed to copy to clipboard: ${result3.stderr}` + message: `Failed to copy to clipboard: ${result2.stderr}` }; } - if (platform6 === "linux") { + if (platform5 === "linux") { const xclipResult = await execFileNoThrowWithCwd("xclip", ["-selection", "clipboard", "-t", "image/png", "-i", pngPath], { timeout: 5000 }); if (xclipResult.code === 0) { return { success: true, message: "Screenshot copied to clipboard" }; @@ -669501,20 +592067,20 @@ async function copyPngToClipboard(pngPath) { message: "Failed to copy to clipboard. Please install xclip or xsel: sudo apt install xclip" }; } - if (platform6 === "windows") { + if (platform5 === "windows") { const psScript = `Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::SetImage([System.Drawing.Image]::FromFile('${pngPath.replace(/'/g, "''")}'))`; - const result3 = await execFileNoThrowWithCwd("powershell", ["-NoProfile", "-Command", psScript], { timeout: 5000 }); - if (result3.code === 0) { + const result2 = await execFileNoThrowWithCwd("powershell", ["-NoProfile", "-Command", psScript], { timeout: 5000 }); + if (result2.code === 0) { return { success: true, message: "Screenshot copied to clipboard" }; } return { success: false, - message: `Failed to copy to clipboard: ${result3.stderr}` + message: `Failed to copy to clipboard: ${result2.stderr}` }; } return { success: false, - message: `Screenshot to clipboard is not supported on ${platform6}` + message: `Screenshot to clipboard is not supported on ${platform5}` }; } var init_screenshotClipboard = __esm(() => { @@ -669526,10 +592092,10 @@ var init_screenshotClipboard = __esm(() => { // src/utils/stats.ts import { open as open15 } from "fs/promises"; -import { basename as basename43, dirname as dirname61, join as join149, sep as sep35 } from "path"; +import { basename as basename41, dirname as dirname57, join as join139, sep as sep32 } from "path"; async function processSessionFiles(sessionFiles, options2 = {}) { const { fromDate, toDate } = options2; - const fs12 = getFsImplementation(); + const fs6 = getFsImplementation(); const dailyActivityMap = new Map; const dailyModelTokensMap = new Map; const sessions = []; @@ -669540,14 +592106,14 @@ async function processSessionFiles(sessionFiles, options2 = {}) { const shotDistributionMap = feature("SHOT_STATS") ? new Map : undefined; const sessionsWithShotCount = new Set; const BATCH_SIZE = 20; - for (let i4 = 0;i4 < sessionFiles.length; i4 += BATCH_SIZE) { - const batch = sessionFiles.slice(i4, i4 + BATCH_SIZE); + for (let i3 = 0;i3 < sessionFiles.length; i3 += BATCH_SIZE) { + const batch = sessionFiles.slice(i3, i3 + BATCH_SIZE); const results = await Promise.all(batch.map(async (sessionFile) => { try { if (fromDate) { let fileSize = 0; try { - const fileStat = await fs12.stat(sessionFile); + const fileStat = await fs6.stat(sessionFile); const fileModifiedDate = toDateString(fileStat.mtime); if (isDateBefore(fileModifiedDate, fromDate)) { return { @@ -669573,18 +592139,18 @@ async function processSessionFiles(sessionFiles, options2 = {}) { } const entries = await readJSONLFile(sessionFile); return { sessionFile, entries, error: null, skipped: false }; - } catch (error46) { - return { sessionFile, entries: null, error: error46, skipped: false }; + } catch (error42) { + return { sessionFile, entries: null, error: error42, skipped: false }; } })); - for (const { sessionFile, entries, error: error46, skipped } of results) { + for (const { sessionFile, entries, error: error42, skipped } of results) { if (skipped) continue; - if (error46 || !entries) { - logForDebugging(`Failed to read session file ${sessionFile}: ${errorMessage(error46)}`); + if (error42 || !entries) { + logForDebugging(`Failed to read session file ${sessionFile}: ${errorMessage(error42)}`); continue; } - const sessionId = basename43(sessionFile, ".jsonl"); + const sessionId = basename41(sessionFile, ".jsonl"); const messages = []; for (const entry of entries) { if (isTranscriptMessage(entry)) { @@ -669595,9 +592161,9 @@ async function processSessionFiles(sessionFiles, options2 = {}) { } if (messages.length === 0) continue; - const isSubagentFile = sessionFile.includes(`${sep35}subagents${sep35}`); + const isSubagentFile = sessionFile.includes(`${sep32}subagents${sep32}`); if (feature("SHOT_STATS") && shotDistributionMap) { - const parentSessionId = isSubagentFile ? basename43(dirname61(dirname61(sessionFile))) : sessionId; + const parentSessionId = isSubagentFile ? basename41(dirname57(dirname57(sessionFile))) : sessionId; if (!sessionsWithShotCount.has(parentSessionId)) { const shotCount = extractShotCountFromMessages(messages); if (shotCount !== null) { @@ -669704,33 +592270,33 @@ async function processSessionFiles(sessionFiles, options2 = {}) { } async function getAllSessionFiles() { const projectsDir = getProjectsDir2(); - const fs12 = getFsImplementation(); + const fs6 = getFsImplementation(); let allEntries; try { - allEntries = await fs12.readdir(projectsDir); + allEntries = await fs6.readdir(projectsDir); } catch (e) { if (isENOENT(e)) return []; throw e; } - const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join149(projectsDir, dirent.name)); + const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join139(projectsDir, dirent.name)); const projectResults = await Promise.all(projectDirs.map(async (projectDir) => { try { - const entries = await fs12.readdir(projectDir); - const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join149(projectDir, dirent.name)); + const entries = await fs6.readdir(projectDir); + const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join139(projectDir, dirent.name)); const sessionDirs = entries.filter((dirent) => dirent.isDirectory()); const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => { - const subagentsDir = join149(projectDir, sessionDir.name, "subagents"); + const subagentsDir = join139(projectDir, sessionDir.name, "subagents"); try { - const subagentEntries = await fs12.readdir(subagentsDir); - return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join149(subagentsDir, dirent.name)); + const subagentEntries = await fs6.readdir(subagentsDir); + return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join139(subagentsDir, dirent.name)); } catch { return []; } })); return [...mainFiles, ...subagentResults.flat()]; - } catch (error46) { - logForDebugging(`Failed to read project directory ${projectDir}: ${errorMessage(error46)}`); + } catch (error42) { + logForDebugging(`Failed to read project directory ${projectDir}: ${errorMessage(error42)}`); return []; } })); @@ -669826,11 +592392,11 @@ function cacheToStats(cache5, todayStats) { if (!lastSessionDate && dailyActivityArray.length > 0) { lastSessionDate = dailyActivityArray.at(-1).date; } - const peakActivityDay = dailyActivityArray.length > 0 ? dailyActivityArray.reduce((max5, d) => d.messageCount > max5.messageCount ? d : max5).date : null; - const peakActivityHour = hourCountsMap.size > 0 ? Array.from(hourCountsMap.entries()).reduce((max5, [hour, count4]) => count4 > max5[1] ? [hour, count4] : max5)[0] : null; + const peakActivityDay = dailyActivityArray.length > 0 ? dailyActivityArray.reduce((max3, d) => d.messageCount > max3.messageCount ? d : max3).date : null; + const peakActivityHour = hourCountsMap.size > 0 ? Array.from(hourCountsMap.entries()).reduce((max3, [hour, count4]) => count4 > max3[1] ? [hour, count4] : max3)[0] : null; const totalDays = firstSessionDate && lastSessionDate ? Math.ceil((new Date(lastSessionDate).getTime() - new Date(firstSessionDate).getTime()) / (1000 * 60 * 60 * 24)) + 1 : 0; const totalSpeculationTimeSavedMs = cache5.totalSpeculationTimeSavedMs + (todayStats?.totalSpeculationTimeSavedMs || 0); - const result3 = { + const result2 = { totalSessions, totalMessages, totalDays, @@ -669856,11 +592422,11 @@ function cacheToStats(cache5, todayStats) { shotDistribution[key] = (shotDistribution[key] || 0) + sessions; } } - result3.shotDistribution = shotDistribution; - const totalWithShots = Object.values(shotDistribution).reduce((sum3, n3) => sum3 + n3, 0); - result3.oneShotRate = totalWithShots > 0 ? Math.round((shotDistribution[1] || 0) / totalWithShots * 100) : 0; + result2.shotDistribution = shotDistribution; + const totalWithShots = Object.values(shotDistribution).reduce((sum2, n3) => sum2 + n3, 0); + result2.oneShotRate = totalWithShots > 0 ? Math.round((shotDistribution[1] || 0) / totalWithShots * 100) : 0; } - return result3; + return result2; } async function aggregateClaudeCodeStats() { const allSessionFiles = await getAllSessionFiles(); @@ -669870,15 +592436,15 @@ async function aggregateClaudeCodeStats() { const updatedCache = await withStatsCacheLock(async () => { const cache5 = await loadStatsCache(); const yesterday = getYesterdayDateString(); - let result3 = cache5; + let result2 = cache5; if (!cache5.lastComputedDate) { logForDebugging("Stats cache empty, processing all historical data"); const historicalStats = await processSessionFiles(allSessionFiles, { toDate: yesterday }); if (historicalStats.sessionStats.length > 0 || historicalStats.dailyActivity.length > 0) { - result3 = mergeCacheWithNewStats(cache5, historicalStats, yesterday); - await saveStatsCache(result3); + result2 = mergeCacheWithNewStats(cache5, historicalStats, yesterday); + await saveStatsCache(result2); } } else if (isDateBefore(cache5.lastComputedDate, yesterday)) { const nextDay = getNextDay(cache5.lastComputedDate); @@ -669888,14 +592454,14 @@ async function aggregateClaudeCodeStats() { toDate: yesterday }); if (newStats.sessionStats.length > 0 || newStats.dailyActivity.length > 0) { - result3 = mergeCacheWithNewStats(cache5, newStats, yesterday); - await saveStatsCache(result3); + result2 = mergeCacheWithNewStats(cache5, newStats, yesterday); + await saveStatsCache(result2); } else { - result3 = { ...cache5, lastComputedDate: yesterday }; - await saveStatsCache(result3); + result2 = { ...cache5, lastComputedDate: yesterday }; + await saveStatsCache(result2); } } - return result3; + return result2; }); const today = getTodayDateString(); const todayStats = await processSessionFiles(allSessionFiles, { @@ -669904,8 +592470,8 @@ async function aggregateClaudeCodeStats() { }); return cacheToStats(updatedCache, todayStats); } -async function aggregateClaudeCodeStatsForRange(range3) { - if (range3 === "all") { +async function aggregateClaudeCodeStatsForRange(range2) { + if (range2 === "all") { return aggregateClaudeCodeStats(); } const allSessionFiles = await getAllSessionFiles(); @@ -669913,7 +592479,7 @@ async function aggregateClaudeCodeStatsForRange(range3) { return getEmptyStats(); } const today = new Date; - const daysBack = range3 === "7d" ? 7 : 30; + const daysBack = range2 === "7d" ? 7 : 30; const fromDate = new Date(today); fromDate.setDate(today.getDate() - daysBack + 1); const fromDateStr = toDateString(fromDate); @@ -669942,11 +592508,11 @@ function processedStatsToClaudeCodeStats(stats) { lastSessionDate = session2.timestamp; } } - const peakActivityDay = dailyActivitySorted.length > 0 ? dailyActivitySorted.reduce((max5, d) => d.messageCount > max5.messageCount ? d : max5).date : null; + const peakActivityDay = dailyActivitySorted.length > 0 ? dailyActivitySorted.reduce((max3, d) => d.messageCount > max3.messageCount ? d : max3).date : null; const hourEntries = Object.entries(stats.hourCounts); - const peakActivityHour = hourEntries.length > 0 ? parseInt(hourEntries.reduce((max5, [hour, count4]) => count4 > parseInt(max5[1].toString()) ? [hour, count4] : max5)[0], 10) : null; + const peakActivityHour = hourEntries.length > 0 ? parseInt(hourEntries.reduce((max3, [hour, count4]) => count4 > parseInt(max3[1].toString()) ? [hour, count4] : max3)[0], 10) : null; const totalDays = firstSessionDate && lastSessionDate ? Math.ceil((new Date(lastSessionDate).getTime() - new Date(firstSessionDate).getTime()) / (1000 * 60 * 60 * 24)) + 1 : 0; - const result3 = { + const result2 = { totalSessions: stats.sessionStats.length, totalMessages: stats.totalMessages, totalDays, @@ -669963,11 +592529,11 @@ function processedStatsToClaudeCodeStats(stats) { totalSpeculationTimeSavedMs: stats.totalSpeculationTimeSavedMs }; if (feature("SHOT_STATS") && stats.shotDistribution) { - result3.shotDistribution = stats.shotDistribution; - const totalWithShots = Object.values(stats.shotDistribution).reduce((sum3, n3) => sum3 + n3, 0); - result3.oneShotRate = totalWithShots > 0 ? Math.round((stats.shotDistribution[1] || 0) / totalWithShots * 100) : 0; + result2.shotDistribution = stats.shotDistribution; + const totalWithShots = Object.values(stats.shotDistribution).reduce((sum2, n3) => sum2 + n3, 0); + result2.oneShotRate = totalWithShots > 0 ? Math.round((stats.shotDistribution[1] || 0) / totalWithShots * 100) : 0; } - return result3; + return result2; } function getNextDay(dateStr) { const date9 = new Date(dateStr); @@ -670006,9 +592572,9 @@ function calculateStreaks(dailyActivity) { const sortedDates = Array.from(activeDates).sort(); let tempStreak = 1; let tempStart = sortedDates[0]; - for (let i4 = 1;i4 < sortedDates.length; i4++) { - const prevDate = new Date(sortedDates[i4 - 1]); - const currDate = new Date(sortedDates[i4]); + for (let i3 = 1;i3 < sortedDates.length; i3++) { + const prevDate = new Date(sortedDates[i3 - 1]); + const currDate = new Date(sortedDates[i3]); const dayDiff = Math.round((currDate.getTime() - prevDate.getTime()) / (1000 * 60 * 60 * 24)); if (dayDiff === 1) { tempStreak++; @@ -670016,10 +592582,10 @@ function calculateStreaks(dailyActivity) { if (tempStreak > longestStreak) { longestStreak = tempStreak; longestStreakStart = tempStart; - longestStreakEnd = sortedDates[i4 - 1]; + longestStreakEnd = sortedDates[i3 - 1]; } tempStreak = 1; - tempStart = sortedDates[i4]; + tempStart = sortedDates[i3]; } } if (tempStreak > longestStreak) { @@ -670057,18 +592623,18 @@ function extractShotCountFromMessages(messages) { } async function readSessionStartDate(filePath) { try { - const fd3 = await open15(filePath, "r"); + const fd2 = await open15(filePath, "r"); try { const buf = Buffer.allocUnsafe(4096); - const { bytesRead } = await fd3.read(buf, 0, buf.length, 0); + const { bytesRead } = await fd2.read(buf, 0, buf.length, 0); if (bytesRead === 0) return null; - const head3 = buf.toString("utf8", 0, bytesRead); - const lastNewline = head3.lastIndexOf(` + const head2 = buf.toString("utf8", 0, bytesRead); + const lastNewline = head2.lastIndexOf(` `); if (lastNewline < 0) return null; - for (const line of head3.slice(0, lastNewline).split(` + for (const line of head2.slice(0, lastNewline).split(` `)) { if (!line) continue; @@ -670093,7 +592659,7 @@ async function readSessionStartDate(filePath) { } return null; } finally { - await fd3.close(); + await fd2.close(); } } catch { return null; @@ -670130,7 +592696,7 @@ var init_stats = __esm(() => { init_errors(); init_fsOperations(); init_json(); - init_messages5(); + init_messages3(); init_sessionStorage(); init_shellToolUtils(); init_slowOperations(); @@ -670168,8 +592734,8 @@ function createAllTimeStatsPromise() { type: "success", data }; - }).catch((err3) => { - const message = err3 instanceof Error ? err3.message : "Failed to load stats"; + }).catch((err2) => { + const message = err2 instanceof Error ? err2.message : "Failed to load stats"; return { type: "error", message @@ -670305,8 +592871,8 @@ function StatsContent(t0) { useKeybinding("confirm:no", handleClose, t5); let t6; if ($2[8] !== activeTab || $2[9] !== dateRange || $2[10] !== displayStats || $2[11] !== onClose) { - t6 = (input11, key) => { - if (key.ctrl && (input11 === "c" || input11 === "d")) { + t6 = (input, key) => { + if (key.ctrl && (input === "c" || input === "d")) { onClose("Stats dialog dismissed", { display: "system" }); @@ -670314,10 +592880,10 @@ function StatsContent(t0) { if (key.tab) { setActiveTab(_temp171); } - if (input11 === "r" && !key.ctrl && !key.meta) { + if (input === "r" && !key.ctrl && !key.meta) { setDateRange(getNextDateRange(dateRange)); } - if (key.ctrl && input11 === "s" && displayStats) { + if (key.ctrl && input === "s" && displayStats) { handleScreenshot2(displayStats, activeTab, setCopyStatus); } }; @@ -670488,22 +593054,22 @@ function DateRangeSelector(t0) { } = t0; let t1; if ($2[0] !== dateRange) { - t1 = DATE_RANGE_ORDER.map((range3, i4) => /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(ThemedText, { + t1 = DATE_RANGE_ORDER.map((range2, i3) => /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(ThemedText, { children: [ - i4 > 0 && /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(ThemedText, { + i3 > 0 && /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(ThemedText, { dimColor: true, children: " · " }, undefined, false, undefined, this), - range3 === dateRange ? /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(ThemedText, { + range2 === dateRange ? /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(ThemedText, { bold: true, color: "claude", - children: DATE_RANGE_LABELS[range3] + children: DATE_RANGE_LABELS[range2] }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(ThemedText, { dimColor: true, - children: DATE_RANGE_LABELS[range3] + children: DATE_RANGE_LABELS[range2] }, undefined, false, undefined, this) ] - }, range3, true, undefined, this)); + }, range2, true, undefined, this)); $2[0] = dateRange; $2[1] = t1; } else { @@ -670556,7 +593122,7 @@ function OverviewTab({ } = useTerminalSize(); const modelEntries = Object.entries(stats.modelUsage).sort(([, a2], [, b]) => b.inputTokens + b.outputTokens - (a2.inputTokens + a2.outputTokens)); const favoriteModel = modelEntries[0]; - const totalTokens = modelEntries.reduce((sum3, [, usage]) => sum3 + usage.inputTokens + usage.outputTokens, 0); + const totalTokens = modelEntries.reduce((sum2, [, usage]) => sum2 + usage.inputTokens + usage.outputTokens, 0); const factoid = import_react195.useMemo(() => generateFunFactoid(stats, totalTokens), [stats, totalTokens]); const rangeDays = dateRange === "7d" ? 7 : dateRange === "30d" ? 30 : stats.totalDays; let shotStatsData = null; @@ -670565,9 +593131,9 @@ function OverviewTab({ const total = Object.values(dist).reduce((s, n3) => s + n3, 0); if (total > 0) { const totalShots = Object.entries(dist).reduce((s_0, [count4, sessions]) => s_0 + parseInt(count4, 10) * sessions, 0); - const bucket = (min3, max5) => Object.entries(dist).filter(([k]) => { + const bucket = (min2, max3) => Object.entries(dist).filter(([k]) => { const n_0 = parseInt(k, 10); - return n_0 >= min3 && (max5 === undefined || n_0 <= max5); + return n_0 >= min2 && (max3 === undefined || n_0 <= max3); }).reduce((s_1, [, v]) => s_1 + v, 0); const pct = (n_1) => Math.round(n_1 / total * 100); const b1 = bucket(1, 1); @@ -670924,9 +593490,9 @@ function generateFunFactoid(stats, totalTokens) { if (totalTokens > 0) { const matchingBooks = BOOK_COMPARISONS.filter((book) => totalTokens >= book.tokens); for (const book of matchingBooks) { - const times3 = totalTokens / book.tokens; - if (times3 >= 2) { - factoids.push(`You've used ~${Math.floor(times3)}x more tokens than ${book.name}`); + const times2 = totalTokens / book.tokens; + if (times2 >= 2) { + factoids.push(`You've used ~${Math.floor(times2)}x more tokens than ${book.name}`); } else { factoids.push(`You've used the same number of tokens as ${book.name}`); } @@ -671124,10 +593690,10 @@ function ModelsTab(t0) { ] }, undefined, true, undefined, this); } -function _temp125(item, i4) { +function _temp125(item, i3) { return /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(ThemedText, { children: [ - i4 > 0 ? " · " : "", + i3 > 0 ? " · " : "", /* @__PURE__ */ jsx_dev_runtime365.jsxDEV(Ansi, { children: item.coloredBullet }, undefined, false, undefined, this), @@ -671140,9 +593706,9 @@ function _temp06(t0) { const [model] = t0; return model; } -function _temp914(sum3, t0) { +function _temp914(sum2, t0) { const [, usage] = t0; - return sum3 + usage.inputTokens + usage.outputTokens; + return sum2 + usage.inputTokens + usage.outputTokens; } function _temp817(prev_0) { return Math.max(prev_0 - 2, 0); @@ -671287,7 +593853,7 @@ function generateTokenChart(dailyTokens, models, terminalWidth) { const repeatCount = Math.floor(chartWidth / dailyTokens.length); recentData = []; for (const day of dailyTokens) { - for (let i4 = 0;i4 < repeatCount; i4++) { + for (let i3 = 0;i3 < repeatCount; i3++) { recentData.push(day); } } @@ -671297,15 +593863,15 @@ function generateTokenChart(dailyTokens, models, terminalWidth) { const series = []; const legend = []; const topModels = models.slice(0, 3); - for (let i4 = 0;i4 < topModels.length; i4++) { - const model = topModels[i4]; + for (let i3 = 0;i3 < topModels.length; i3++) { + const model = topModels[i3]; const data = recentData.map((day) => day.tokensByModel[model] || 0); if (data.some((v) => v > 0)) { series.push(data); const bulletColors = [theme2.suggestion, theme2.success, theme2.warning]; legend.push({ model: renderModelName(model), - coloredBullet: applyColor(figures_default.bullet, bulletColors[i4 % bulletColors.length]) + coloredBullet: applyColor(figures_default.bullet, bulletColors[i3 % bulletColors.length]) }); } } @@ -671315,14 +593881,14 @@ function generateTokenChart(dailyTokens, models, terminalWidth) { const chart = import_asciichart.plot(series, { height: 8, colors: colors.slice(0, series.length), - format: (x4) => { + format: (x3) => { let label; - if (x4 >= 1e6) { - label = (x4 / 1e6).toFixed(1) + "M"; - } else if (x4 >= 1000) { - label = (x4 / 1000).toFixed(0) + "k"; + if (x3 >= 1e6) { + label = (x3 / 1e6).toFixed(1) + "M"; + } else if (x3 >= 1000) { + label = (x3 / 1000).toFixed(0) + "k"; } else { - label = x4.toFixed(0); + label = x3.toFixed(0); } return label.padStart(6); } @@ -671341,8 +593907,8 @@ function generateXAxisLabels(data, _chartWidth, yAxisOffset) { const usableLength = data.length - 6; const step = Math.floor(usableLength / (numLabels - 1)) || 1; const labelPositions = []; - for (let i4 = 0;i4 < numLabels; i4++) { - const idx = Math.min(i4 * step, data.length - 1); + for (let i3 = 0;i3 < numLabels; i3++) { + const idx = Math.min(i3 * step, data.length - 1); const date9 = new Date(data[idx].date); const label = date9.toLocaleDateString("en-US", { month: "short", @@ -671353,23 +593919,23 @@ function generateXAxisLabels(data, _chartWidth, yAxisOffset) { label }); } - let result3 = " ".repeat(yAxisOffset); + let result2 = " ".repeat(yAxisOffset); let currentPos = 0; for (const { pos, label } of labelPositions) { const spaces = Math.max(1, pos - currentPos); - result3 += " ".repeat(spaces) + label; + result2 += " ".repeat(spaces) + label; currentPos = pos + label.length; } - return result3; + return result2; } async function handleScreenshot2(stats, activeTab, setStatus) { setStatus("copying…"); const ansiText = renderStatsToAnsi(stats, activeTab); - const result3 = await copyAnsiToClipboard(ansiText); - setStatus(result3.success ? "copied!" : "copy failed"); + const result2 = await copyAnsiToClipboard(ansiText); + setStatus(result2.success ? "copied!" : "copy failed"); setTimeout(setStatus, 2000, null); } function renderStatsToAnsi(stats, activeTab) { @@ -671396,7 +593962,7 @@ function renderStatsToAnsi(stats, activeTab) { function renderOverviewToAnsi(stats) { const lines = []; const theme2 = getTheme(resolveThemeSetting(getGlobalConfig().theme)); - const h2 = (text2) => applyColor(text2, theme2.claude); + const h2 = (text) => applyColor(text, theme2.claude); const COL1_LABEL_WIDTH = 18; const COL2_START = 40; const COL2_LABEL_WIDTH = 18; @@ -671415,7 +593981,7 @@ function renderOverviewToAnsi(stats) { } const modelEntries = Object.entries(stats.modelUsage).sort(([, a2], [, b]) => b.inputTokens + b.outputTokens - (a2.inputTokens + a2.outputTokens)); const favoriteModel = modelEntries[0]; - const totalTokens = modelEntries.reduce((sum3, [, usage]) => sum3 + usage.inputTokens + usage.outputTokens, 0); + const totalTokens = modelEntries.reduce((sum2, [, usage]) => sum2 + usage.inputTokens + usage.outputTokens, 0); if (favoriteModel) { lines.push(row("Favorite model", renderModelName(favoriteModel[0]), "Total tokens", formatNumber(totalTokens))); } @@ -671434,9 +594000,9 @@ function renderOverviewToAnsi(stats) { if (totalWithShots > 0) { const totalShots = Object.entries(dist).reduce((s, [count4, sessions]) => s + parseInt(count4, 10) * sessions, 0); const avgShots = (totalShots / totalWithShots).toFixed(1); - const bucket = (min3, max5) => Object.entries(dist).filter(([k]) => { + const bucket = (min2, max3) => Object.entries(dist).filter(([k]) => { const n3 = parseInt(k, 10); - return n3 >= min3 && (max5 === undefined || n3 <= max5); + return n3 >= min2 && (max3 === undefined || n3 <= max3); }).reduce((s, [, v]) => s + v, 0); const pct = (n3) => Math.round(n3 / totalWithShots * 100); const fmtBucket = (count4, p) => `${count4} (${p}%)`; @@ -671465,7 +594031,7 @@ function renderModelsToAnsi(stats) { return lines; } const favoriteModel = modelEntries[0]; - const totalTokens = modelEntries.reduce((sum3, [, usage]) => sum3 + usage.inputTokens + usage.outputTokens, 0); + const totalTokens = modelEntries.reduce((sum2, [, usage]) => sum2 + usage.inputTokens + usage.outputTokens, 0); const chartOutput = generateTokenChart(stats.dailyModelTokens, modelEntries.map(([model]) => model), 80); if (chartOutput) { lines.push(source_default.bold("Tokens per Day")); @@ -671902,8 +594468,8 @@ function RemoteCallout({ }, undefined, false, undefined, this); } function shouldShowRemoteCallout() { - const config6 = getGlobalConfig(); - if (config6.remoteDialogSeen) + const config4 = getGlobalConfig(); + if (config4.remoteDialogSeen) return false; if (!isBridgeEnabled()) return false; @@ -671917,7 +594483,7 @@ var init_RemoteCallout = __esm(() => { import_react196 = __toESM(require_react(), 1); init_bridgeEnabled(); init_ink2(); - init_auth2(); + init_auth(); init_config2(); init_select(); init_PermissionDialog(); @@ -671964,15 +594530,15 @@ function BridgeToggle(t0) { } let cancelled = false; (async () => { - const error46 = await checkBridgePrerequisites(); + const error42 = await checkBridgePrerequisites(); if (cancelled) { return; } - if (error46) { + if (error42) { logEvent("tengu_bridge_command", { action: "preflight_failed" }); - onDone(error46, { + onDone(error42, { display: "system" }); return; @@ -672388,8 +594954,8 @@ function _temp135(l) { function _temp07(i_0) { return (i_0 - 1 + 3) % 3; } -function _temp915(i4) { - return (i4 + 1) % 3; +function _temp915(i3) { + return (i3 + 1) % 3; } function _temp818(prev_0) { return !prev_0; @@ -672462,7 +595028,7 @@ var init_bridge = __esm(() => { init_bridgeConfig(); init_bridgeEnabled(); init_envLessBridgeConfig(); - init_types16(); + init_types15(); init_Dialog(); init_ListItem(); init_RemoteCallout(); @@ -672514,12 +595080,12 @@ __export(exports_remoteControlServer, { var remoteControlServer_default = undefined; // src/services/voiceKeyterms.ts -import { basename as basename44 } from "path"; +import { basename as basename42 } from "path"; function splitIdentifier(name) { return name.replace(/([a-z])([A-Z])/g, "$1 $2").split(/[-_./\s]+/).map((w) => w.trim()).filter((w) => w.length > 2 && w.length <= 20); } function fileNameWords(filePath) { - const stem = basename44(filePath).replace(/\.[^.]+$/, ""); + const stem = basename42(filePath).replace(/\.[^.]+$/, ""); return splitIdentifier(stem); } async function getVoiceKeyterms(recentFiles) { @@ -672527,7 +595093,7 @@ async function getVoiceKeyterms(recentFiles) { try { const projectRoot = getProjectRoot(); if (projectRoot) { - const name = basename44(projectRoot); + const name = basename42(projectRoot); if (name.length > 2 && name.length <= 50) { terms.add(name); } @@ -672598,14 +595164,14 @@ function normalizeLanguageForSTT(language) { return { code: base2 }; return { code: DEFAULT_STT_LANGUAGE, fellBackFrom: language }; } -function computeLevel(chunk4) { - const samples = chunk4.length >> 1; +function computeLevel(chunk3) { + const samples = chunk3.length >> 1; if (samples === 0) return 0; let sumSq = 0; - for (let i4 = 0;i4 < chunk4.length - 1; i4 += 2) { - const sample3 = (chunk4[i4] | chunk4[i4 + 1] << 8) << 16 >> 16; - sumSq += sample3 * sample3; + for (let i3 = 0;i3 < chunk3.length - 1; i3 += 2) { + const sample2 = (chunk3[i3] | chunk3[i3 + 1] << 8) << 16 >> 16; + sumSq += sample2 * sample2; } const rms = Math.sqrt(sumSq / samples); const normalized = Math.min(rms / 2000, 1); @@ -672717,14 +595283,14 @@ function useVoice({ connectionRef.current = null; } const replayBuffer = fullAudioRef.current; - await sleep4(250); + await sleep2(250); if (isStale()) return; const stt = normalizeLanguageForSTT(getInitialSettings().language); const keyterms = await getVoiceKeyterms(); if (isStale()) return; - await new Promise((resolve45) => { + await new Promise((resolve39) => { connectVoiceStream({ onTranscript: (t, isFinal) => { if (isStale()) @@ -672735,47 +595301,47 @@ function useVoice({ accumulatedRef.current += t.trim(); } }, - onError: () => resolve45(), + onError: () => resolve39(), onClose: () => {}, onReady: (conn) => { if (isStale()) { conn.close(); - resolve45(); + resolve39(); return; } connectionRef.current = conn; const SLICE = 32000; - let slice3 = []; + let slice2 = []; let bytes = 0; for (const c6 of replayBuffer) { if (bytes > 0 && bytes + c6.length > SLICE) { - conn.send(Buffer.concat(slice3)); - slice3 = []; + conn.send(Buffer.concat(slice2)); + slice2 = []; bytes = 0; } - slice3.push(c6); + slice2.push(c6); bytes += c6.length; } - if (slice3.length) - conn.send(Buffer.concat(slice3)); + if (slice2.length) + conn.send(Buffer.concat(slice2)); conn.finalize().then(() => { conn.close(); - resolve45(); + resolve39(); }); } }, { language: stt.code, keyterms }).then((c6) => { if (!c6) - resolve45(); - }, () => resolve45()); + resolve39(); + }, () => resolve39()); }); if (isStale()) return; } fullAudioRef.current = []; - const text2 = accumulatedRef.current.trim(); - logForDebugging(`[voice] Final transcript assembled (${String(text2.length)} chars): "${text2.slice(0, 200)}"`); + const text = accumulatedRef.current.trim(); + logForDebugging(`[voice] Final transcript assembled (${String(text.length)} chars): "${text.slice(0, 200)}"`); logEvent("tengu_voice_recording_completed", { - transcriptChars: text2.length + focusFlushedChars, + transcriptChars: text.length + focusFlushedChars, recordingDurationMs, hadAudioSignal, retried, @@ -672787,9 +595353,9 @@ function useVoice({ connectionRef.current.close(); connectionRef.current = null; } - if (text2) { - logForDebugging(`[voice] Injecting transcript (${String(text2.length)} chars)`); - onTranscriptRef.current(text2); + if (text) { + logForDebugging(`[voice] Injecting transcript (${String(text.length)} chars)`); + onTranscriptRef.current(text); } else if (focusFlushedChars === 0 && recordingDurationMs > 2000) { if (!wsConnected) { onErrorRef.current?.("Voice connection failed. Check your network and try again."); @@ -672806,8 +595372,8 @@ function useVoice({ return { ...prev, voiceInterimTranscript: "" }; }); updateState("idle"); - }).catch((err3) => { - logError2(toError(err3)); + }).catch((err2) => { + logError2(toError(err2)); if (!isStale()) updateState("idle"); }); @@ -672902,8 +595468,8 @@ function useVoice({ const audioBuffer = []; logForDebugging("[voice] startRecording: buffering audio while WebSocket connects"); audioLevelsRef.current = []; - const started = await voiceModule.startRecording((chunk4) => { - const owned = Buffer.from(chunk4); + const started = await voiceModule.startRecording((chunk3) => { + const owned = Buffer.from(chunk3); if (!focusTriggeredRef.current) { fullAudioRef.current.push(owned); } @@ -672912,7 +595478,7 @@ function useVoice({ } else { audioBuffer.push(owned); } - const level = computeLevel(chunk4); + const level = computeLevel(chunk3); if (!hasAudioSignalRef.current && level > 0.01) { hasAudioSignalRef.current = true; } @@ -672954,16 +595520,16 @@ function useVoice({ const attemptConnect = (keyterms) => { const myAttemptGen = attemptGenRef.current; connectVoiceStream({ - onTranscript: (text2, isFinal) => { + onTranscript: (text, isFinal) => { if (isStale()) return; sawTranscript = true; - logForDebugging(`[voice] onTranscript: isFinal=${String(isFinal)} text="${text2}"`); - if (isFinal && text2.trim()) { + logForDebugging(`[voice] onTranscript: isFinal=${String(isFinal)} text="${text}"`); + if (isFinal && text.trim()) { if (focusTriggeredRef.current) { - logForDebugging(`[voice] Focus mode: flushing final transcript immediately: "${text2.trim()}"`); - onTranscriptRef.current(text2.trim()); - focusFlushedCharsRef.current += text2.trim().length; + logForDebugging(`[voice] Focus mode: flushing final transcript immediately: "${text.trim()}"`); + onTranscriptRef.current(text.trim()); + focusFlushedCharsRef.current += text.trim().length; setVoiceState((prev) => { if (prev.voiceInterimTranscript === "") return prev; @@ -672975,7 +595541,7 @@ function useVoice({ if (accumulatedRef.current) { accumulatedRef.current += " "; } - accumulatedRef.current += text2.trim(); + accumulatedRef.current += text.trim(); logForDebugging(`[voice] Accumulated final transcript: "${accumulatedRef.current}"`); setVoiceState((prev) => { const preview = accumulatedRef.current; @@ -672988,7 +595554,7 @@ function useVoice({ if (focusTriggeredRef.current) { armFocusSilenceTimer(); } - const interim = text2.trim(); + const interim = text.trim(); const preview = accumulatedRef.current ? accumulatedRef.current + (interim ? " " + interim : "") : interim; setVoiceState((prev) => { if (prev.voiceInterimTranscript === preview) @@ -672997,19 +595563,19 @@ function useVoice({ }); } }, - onError: (error46, opts) => { + onError: (error42, opts) => { if (isStale()) { - logForDebugging(`[voice] ignoring onError from stale session: ${error46}`); + logForDebugging(`[voice] ignoring onError from stale session: ${error42}`); return; } if (attemptGenRef.current !== myAttemptGen) { - logForDebugging(`[voice] ignoring stale onError from superseded attempt: ${error46}`); + logForDebugging(`[voice] ignoring stale onError from superseded attempt: ${error42}`); return; } if (!opts?.fatal && !sawTranscript && stateRef.current === "recording") { if (!retryUsedRef.current) { retryUsedRef.current = true; - logForDebugging(`[voice] early voice_stream error (pre-transcript), retrying once: ${error46}`); + logForDebugging(`[voice] early voice_stream error (pre-transcript), retrying once: ${error42}`); logEvent("tengu_voice_stream_early_retry", {}); connectionRef.current = null; attemptGenRef.current++; @@ -673022,8 +595588,8 @@ function useVoice({ } } attemptGenRef.current++; - logError2(new Error(`[voice] voice_stream error: ${error46}`)); - onErrorRef.current?.(`Voice stream error: ${error46}`); + logError2(new Error(`[voice] voice_stream error: ${error42}`)); + onErrorRef.current?.(`Voice stream error: ${error42}`); audioBuffer.length = 0; focusTriggeredRef.current = false; cleanup(); @@ -673044,17 +595610,17 @@ function useVoice({ totalBytes += c6.length; const slices = [[]]; let sliceBytes2 = 0; - for (const chunk4 of audioBuffer) { - if (sliceBytes2 > 0 && sliceBytes2 + chunk4.length > SLICE_TARGET_BYTES) { + for (const chunk3 of audioBuffer) { + if (sliceBytes2 > 0 && sliceBytes2 + chunk3.length > SLICE_TARGET_BYTES) { slices.push([]); sliceBytes2 = 0; } - slices[slices.length - 1].push(chunk4); - sliceBytes2 += chunk4.length; + slices[slices.length - 1].push(chunk3); + sliceBytes2 += chunk3.length; } logForDebugging(`[voice] onReady: flushing ${String(audioBuffer.length)} buffered chunks (${String(totalBytes)} bytes) as ${String(slices.length)} coalesced frame(s)`); - for (const slice3 of slices) { - conn.send(Buffer.concat(slice3)); + for (const slice2 of slices) { + conn.send(Buffer.concat(slice2)); } } audioBuffer.length = 0; @@ -673269,10 +595835,10 @@ var LANG_HINT_MAX_SHOWS = 2, call72 = async () => { const currentSettings = getInitialSettings(); const isCurrentlyEnabled = currentSettings.voiceEnabled === true; if (isCurrentlyEnabled) { - const result4 = updateSettingsForSource("userSettings", { + const result3 = updateSettingsForSource("userSettings", { voiceEnabled: false }); - if (result4.error) { + if (result3.error) { return { type: "text", value: "Failed to update settings. Check your settings file for syntax errors." @@ -673325,8 +595891,8 @@ Install SoX manually for audio recording.`; value: `Microphone access is denied. To enable it, go to ${guidance}, then run /voice again.` }; } - const result3 = updateSettingsForSource("userSettings", { voiceEnabled: true }); - if (result3.error) { + const result2 = updateSettingsForSource("userSettings", { voiceEnabled: true }); + if (result2.error) { return { type: "text", value: "Failed to update settings. Check your settings file for syntax errors." @@ -673362,7 +595928,7 @@ var init_voice3 = __esm(() => { init_useVoice(); init_shortcutFormat(); init_analytics(); - init_auth2(); + init_auth(); init_config2(); init_changeDetector(); init_settings2(); @@ -673454,9 +596020,9 @@ async function importGithubToken(token) { level: "error" }); return { ok: false, error: { kind: "server", status: response.status } }; - } catch (err3) { - if (axios_default.isAxiosError(err3)) { - logForDebugging(`import-token network error: ${err3.code ?? "unknown"}`, { + } catch (err2) { + if (axios_default.isAxiosError(err2)) { + logForDebugging(`import-token network error: ${err2.code ?? "unknown"}`, { level: "error" }); } @@ -673590,14 +596156,14 @@ async function checkLoginState() { token: new RedactedGithubToken(trimmed) }; } -function errorMessage2(err3, codeUrl) { - switch (err3.kind) { +function errorMessage2(err2, codeUrl) { + switch (err2.kind) { case "not_signed_in": return `Login failed. Please visit ${codeUrl} and login using the GitHub App`; case "invalid_token": return "GitHub rejected that token. Run `gh auth login` and try again."; case "server": - return `Server error (${err3.status}). Try again in a moment.`; + return `Server error (${err2.status}). Try again in a moment.`; case "network": return "Couldn't reach the server. Check your connection."; } @@ -673610,8 +596176,8 @@ function Web({ }); import_react199.useEffect(() => { logEvent("tengu_remote_setup_started", {}); - checkLoginState().then(async (result3) => { - switch (result3.status) { + checkLoginState().then(async (result2) => { + switch (result2.status) { case "not_signed_in": logEvent("tengu_remote_setup_result", { result: "not_signed_in" @@ -673623,15 +596189,15 @@ function Web({ const url3 = `${getCodeWebUrl()}/onboarding?step=alt-auth`; await openBrowser(url3); logEvent("tengu_remote_setup_result", { - result: result3.status + result: result2.status }); - onDone(result3.status === "gh_not_installed" ? `GitHub CLI not found. Install it via https://cli.github.com/, then run \`gh auth login\`, or connect GitHub on the web: ${url3}` : `GitHub CLI not authenticated. Run \`gh auth login\` and try again, or connect GitHub on the web: ${url3}`); + onDone(result2.status === "gh_not_installed" ? `GitHub CLI not found. Install it via https://cli.github.com/, then run \`gh auth login\`, or connect GitHub on the web: ${url3}` : `GitHub CLI not authenticated. Run \`gh auth login\` and try again, or connect GitHub on the web: ${url3}`); return; } case "has_gh_token": setStep({ name: "confirm", - token: result3.token + token: result2.token }); } }); @@ -673646,13 +596212,13 @@ function Web({ setStep({ name: "uploading" }); - const result3 = await importGithubToken(token2); - if (!result3.ok) { + const result2 = await importGithubToken(token2); + if (!result2.ok) { logEvent("tengu_remote_setup_result", { result: "import_failed", - error_kind: result3.error.kind + error_kind: result2.error.kind }); - onDone(errorMessage2(result3.error, getCodeWebUrl())); + onDone(errorMessage2(result2.error, getCodeWebUrl())); return; } await createDefaultEnvironment(); @@ -673661,7 +596227,7 @@ function Web({ logEvent("tengu_remote_setup_result", { result: "success" }); - onDone(`Connected as ${result3.result.github_username}. Opened ${url3}`); + onDone(`Connected as ${result2.result.github_username}. Opened ${url3}`); }; if (step.name === "checking") { return /* @__PURE__ */ jsx_dev_runtime369.jsxDEV(LoadingState, { @@ -673801,17 +596367,17 @@ __export(exports_insights, { import { execFileSync as execFileSync3 } from "child_process"; import { constants as fsConstants6 } from "fs"; import { - copyFile as copyFile10, + copyFile as copyFile9, mkdir as mkdir48, - mkdtemp as mkdtemp3, + mkdtemp, readdir as readdir32, - readFile as readFile55, - rm as rm12, + readFile as readFile54, + rm as rm10, unlink as unlink23, - writeFile as writeFile52 + writeFile as writeFile50 } from "fs/promises"; -import { tmpdir as tmpdir12 } from "os"; -import { extname as extname15, join as join150 } from "path"; +import { tmpdir as tmpdir9 } from "os"; +import { extname as extname15, join as join140 } from "path"; function getAnalysisModel() { return getDefaultOpusModel(); } @@ -673819,19 +596385,19 @@ function getInsightsModel() { return getDefaultOpusModel(); } function getDataDir() { - return join150(getClaudeConfigHomeDir(), "usage-data"); + return join140(getClaudeConfigHomeDir(), "usage-data"); } function getFacetsDir() { - return join150(getDataDir(), "facets"); + return join140(getDataDir(), "facets"); } function getSessionMetaDir() { - return join150(getDataDir(), "session-meta"); + return join140(getDataDir(), "session-meta"); } function getLanguageFromPath(filePath) { const ext = extname15(filePath).toLowerCase(); return EXTENSION_TO_LANGUAGE[ext] || null; } -function extractToolStats(log2) { +function extractToolStats(log) { const toolCounts = {}; const languages = {}; let gitCommits = 0; @@ -673852,7 +596418,7 @@ function extractToolStats(log2) { let usesWebSearch = false; let usesWebFetch = false; let lastAssistantTimestamp = null; - for (const msg of log2.messages) { + for (const msg of log.messages) { const msgTimestamp = msg.timestamp; if (msg.type === "assistant" && msg.message) { if (msgTimestamp) { @@ -673877,9 +596443,9 @@ function extractToolStats(log2) { usesWebSearch = true; if (toolName === "WebFetch") usesWebFetch = true; - const input11 = block2.input; - if (input11) { - const filePath = input11.file_path || ""; + const input = block2.input; + if (input) { + const filePath = input.file_path || ""; if (filePath) { const lang = getLanguageFromPath(filePath); if (lang) { @@ -673890,8 +596456,8 @@ function extractToolStats(log2) { } } if (toolName === "Edit") { - const oldString = input11.old_string || ""; - const newString = input11.new_string || ""; + const oldString = input.old_string || ""; + const newString = input.new_string || ""; for (const change of diffLines(oldString, newString)) { if (change.added) linesAdded += change.count || 0; @@ -673900,13 +596466,13 @@ function extractToolStats(log2) { } } if (toolName === "Write") { - const writeContent = input11.content || ""; + const writeContent = input.content || ""; if (writeContent) { linesAdded += countCharInString(writeContent, ` `) + 1; } } - const command8 = input11.command || ""; + const command8 = input.command || ""; if (command8.includes("git commit")) gitCommits++; if (command8.includes("git push")) @@ -673950,8 +596516,8 @@ function extractToolStats(log2) { if (Array.isArray(content)) { for (const block2 of content) { if (block2.type === "tool_result" && "content" in block2) { - const isError3 = block2.is_error; - if (isError3) { + const isError2 = block2.is_error; + if (isError2) { toolErrors++; const resultContent = block2.content; let category = "Other"; @@ -674012,17 +596578,17 @@ function extractToolStats(log2) { userMessageTimestamps }; } -function hasValidDates(log2) { - return !Number.isNaN(log2.created.getTime()) && !Number.isNaN(log2.modified.getTime()); +function hasValidDates(log) { + return !Number.isNaN(log.created.getTime()) && !Number.isNaN(log.modified.getTime()); } -function logToSessionMeta(log2) { - const stats2 = extractToolStats(log2); - const sessionId = getSessionIdFromLog(log2) || "unknown"; - const startTime = log2.created.toISOString(); - const durationMinutes = Math.round((log2.modified.getTime() - log2.created.getTime()) / 1000 / 60); +function logToSessionMeta(log) { + const stats2 = extractToolStats(log); + const sessionId = getSessionIdFromLog(log) || "unknown"; + const startTime = log.created.toISOString(); + const durationMinutes = Math.round((log.modified.getTime() - log.created.getTime()) / 1000 / 60); let userMessageCount = 0; let assistantMessageCount = 0; - for (const msg of log2.messages) { + for (const msg of log.messages) { if (msg.type === "assistant") assistantMessageCount++; if (msg.type === "user" && msg.message) { @@ -674045,7 +596611,7 @@ function logToSessionMeta(log2) { } return { session_id: sessionId, - project_path: log2.projectPath || "", + project_path: log.projectPath || "", start_time: startTime, duration_minutes: durationMinutes, user_message_count: userMessageCount, @@ -674056,8 +596622,8 @@ function logToSessionMeta(log2) { git_pushes: stats2.gitPushes, input_tokens: stats2.inputTokens, output_tokens: stats2.outputTokens, - first_prompt: log2.firstPrompt || "", - summary: log2.summary, + first_prompt: log.firstPrompt || "", + summary: log.summary, user_interruptions: stats2.userInterruptions, user_response_times: stats2.userResponseTimes, tool_errors: stats2.toolErrors, @@ -674084,15 +596650,15 @@ function deduplicateSessionBranches(entries) { } return [...bestBySession.values()]; } -function formatTranscriptForFacets(log2) { +function formatTranscriptForFacets(log) { const lines = []; - const meta = logToSessionMeta(log2); + const meta = logToSessionMeta(log); lines.push(`Session: ${meta.session_id.slice(0, 8)}`); lines.push(`Date: ${meta.start_time}`); lines.push(`Project: ${meta.project_path}`); lines.push(`Duration: ${meta.duration_minutes} min`); lines.push(""); - for (const msg of log2.messages) { + for (const msg of log.messages) { if (msg.type === "user" && msg.message) { const content = msg.message.content; if (typeof content === "string") { @@ -674120,11 +596686,11 @@ function formatTranscriptForFacets(log2) { return lines.join(` `); } -async function summarizeTranscriptChunk(chunk4) { +async function summarizeTranscriptChunk(chunk3) { try { - const result3 = await queryWithModel({ + const result2 = await queryWithModel({ systemPrompt: asSystemPrompt([]), - userPrompt: SUMMARIZE_CHUNK_PROMPT + chunk4, + userPrompt: SUMMARIZE_CHUNK_PROMPT + chunk3, signal: new AbortController().signal, options: { model: getAnalysisModel(), @@ -674136,24 +596702,24 @@ async function summarizeTranscriptChunk(chunk4) { maxOutputTokensOverride: 500 } }); - const text2 = extractTextContent(result3.message.content); - return text2 || chunk4.slice(0, 2000); + const text = extractTextContent(result2.message.content); + return text || chunk3.slice(0, 2000); } catch { - return chunk4.slice(0, 2000); + return chunk3.slice(0, 2000); } } -async function formatTranscriptWithSummarization(log2) { - const fullTranscript = formatTranscriptForFacets(log2); +async function formatTranscriptWithSummarization(log) { + const fullTranscript = formatTranscriptForFacets(log); if (fullTranscript.length <= 30000) { return fullTranscript; } const CHUNK_SIZE2 = 25000; const chunks = []; - for (let i4 = 0;i4 < fullTranscript.length; i4 += CHUNK_SIZE2) { - chunks.push(fullTranscript.slice(i4, i4 + CHUNK_SIZE2)); + for (let i3 = 0;i3 < fullTranscript.length; i3 += CHUNK_SIZE2) { + chunks.push(fullTranscript.slice(i3, i3 + CHUNK_SIZE2)); } const summaries = await Promise.all(chunks.map(summarizeTranscriptChunk)); - const meta = logToSessionMeta(log2); + const meta = logToSessionMeta(log); const header = [ `Session: ${meta.session_id.slice(0, 8)}`, `Date: ${meta.start_time}`, @@ -674170,9 +596736,9 @@ async function formatTranscriptWithSummarization(log2) { `); } async function loadCachedFacets(sessionId) { - const facetPath = join150(getFacetsDir(), `${sessionId}.json`); + const facetPath = join140(getFacetsDir(), `${sessionId}.json`); try { - const content = await readFile55(facetPath, { encoding: "utf-8" }); + const content = await readFile54(facetPath, { encoding: "utf-8" }); const parsed = jsonParse(content); if (!isValidSessionFacets(parsed)) { try { @@ -674189,16 +596755,16 @@ async function saveFacets(facets) { try { await mkdir48(getFacetsDir(), { recursive: true }); } catch {} - const facetPath = join150(getFacetsDir(), `${facets.session_id}.json`); - await writeFile52(facetPath, jsonStringify(facets, null, 2), { + const facetPath = join140(getFacetsDir(), `${facets.session_id}.json`); + await writeFile50(facetPath, jsonStringify(facets, null, 2), { encoding: "utf-8", mode: 384 }); } async function loadCachedSessionMeta(sessionId) { - const metaPath = join150(getSessionMetaDir(), `${sessionId}.json`); + const metaPath = join140(getSessionMetaDir(), `${sessionId}.json`); try { - const content = await readFile55(metaPath, { encoding: "utf-8" }); + const content = await readFile54(metaPath, { encoding: "utf-8" }); return jsonParse(content); } catch { return null; @@ -674208,15 +596774,15 @@ async function saveSessionMeta(meta) { try { await mkdir48(getSessionMetaDir(), { recursive: true }); } catch {} - const metaPath = join150(getSessionMetaDir(), `${meta.session_id}.json`); - await writeFile52(metaPath, jsonStringify(meta, null, 2), { + const metaPath = join140(getSessionMetaDir(), `${meta.session_id}.json`); + await writeFile50(metaPath, jsonStringify(meta, null, 2), { encoding: "utf-8", mode: 384 }); } -async function extractFacetsFromAPI(log2, sessionId) { +async function extractFacetsFromAPI(log, sessionId) { try { - const transcript = await formatTranscriptWithSummarization(log2); + const transcript = await formatTranscriptWithSummarization(log); const jsonPrompt = `${FACET_EXTRACTION_PROMPT}${transcript} RESPOND WITH ONLY A VALID JSON OBJECT matching this schema: @@ -674232,7 +596798,7 @@ RESPOND WITH ONLY A VALID JSON OBJECT matching this schema: "primary_success": "none|fast_accurate_search|correct_code_edits|good_explanations|proactive_help|multi_file_changes|good_debugging", "brief_summary": "One sentence: what user wanted and whether they got it" }`; - const result3 = await queryWithModel({ + const result2 = await queryWithModel({ systemPrompt: asSystemPrompt([]), userPrompt: jsonPrompt, signal: new AbortController().signal, @@ -674246,8 +596812,8 @@ RESPOND WITH ONLY A VALID JSON OBJECT matching this schema: maxOutputTokensOverride: 4096 } }); - const text2 = extractTextContent(result3.message.content); - const jsonMatch = text2.match(/\{[\s\S]*\}/); + const text = extractTextContent(result2.message.content); + const jsonMatch = text.match(/\{[\s\S]*\}/); if (!jsonMatch) return null; const parsed = jsonParse(jsonMatch[0]); @@ -674255,8 +596821,8 @@ RESPOND WITH ONLY A VALID JSON OBJECT matching this schema: return null; const facets = { ...parsed, session_id: sessionId }; return facets; - } catch (err3) { - logError2(new Error(`Facet extraction failed: ${toError(err3).message}`)); + } catch (err2) { + logError2(new Error(`Facet extraction failed: ${toError(err2).message}`)); return null; } } @@ -674276,9 +596842,9 @@ function detectMultiClauding(sessions) { const messagesDuringMulticlaude = new Set; let windowStart = 0; const sessionLastIndex = new Map; - for (let i4 = 0;i4 < allSessionMessages.length; i4++) { - const msg = allSessionMessages[i4]; - while (windowStart < i4 && msg.ts - allSessionMessages[windowStart].ts > OVERLAP_WINDOW_MS) { + for (let i3 = 0;i3 < allSessionMessages.length; i3++) { + const msg = allSessionMessages[i3]; + while (windowStart < i3 && msg.ts - allSessionMessages[windowStart].ts > OVERLAP_WINDOW_MS) { const expiring = allSessionMessages[windowStart]; if (sessionLastIndex.get(expiring.sessionId) === windowStart) { sessionLastIndex.delete(expiring.sessionId); @@ -674287,7 +596853,7 @@ function detectMultiClauding(sessions) { } const prevIndex = sessionLastIndex.get(msg.sessionId); if (prevIndex !== undefined) { - for (let j = prevIndex + 1;j < i4; j++) { + for (let j = prevIndex + 1;j < i3; j++) { const between = allSessionMessages[j]; if (between.sessionId !== msg.sessionId) { const pair = [msg.sessionId, between.sessionId].sort().join(":"); @@ -674299,7 +596865,7 @@ function detectMultiClauding(sessions) { } } } - sessionLastIndex.set(msg.sessionId, i4); + sessionLastIndex.set(msg.sessionId, i3); } const sessionsWithOverlaps = new Set; for (const pair of multiClaudeSessionPairs) { @@ -674316,7 +596882,7 @@ function detectMultiClauding(sessions) { }; } function aggregateData(sessions, facets) { - const result3 = { + const result2 = { total_sessions: sessions.length, sessions_with_facets: facets.size, date_range: { start: "", end: "" }, @@ -674364,65 +596930,65 @@ function aggregateData(sessions, facets) { const allMessageHours = []; for (const session2 of sessions) { dates.push(session2.start_time); - result3.total_messages += session2.user_message_count; - result3.total_duration_hours += session2.duration_minutes / 60; - result3.total_input_tokens += session2.input_tokens; - result3.total_output_tokens += session2.output_tokens; - result3.git_commits += session2.git_commits; - result3.git_pushes += session2.git_pushes; - result3.total_interruptions += session2.user_interruptions; - result3.total_tool_errors += session2.tool_errors; + result2.total_messages += session2.user_message_count; + result2.total_duration_hours += session2.duration_minutes / 60; + result2.total_input_tokens += session2.input_tokens; + result2.total_output_tokens += session2.output_tokens; + result2.git_commits += session2.git_commits; + result2.git_pushes += session2.git_pushes; + result2.total_interruptions += session2.user_interruptions; + result2.total_tool_errors += session2.tool_errors; for (const [cat2, count4] of Object.entries(session2.tool_error_categories)) { - result3.tool_error_categories[cat2] = (result3.tool_error_categories[cat2] || 0) + count4; + result2.tool_error_categories[cat2] = (result2.tool_error_categories[cat2] || 0) + count4; } allResponseTimes.push(...session2.user_response_times); if (session2.uses_task_agent) - result3.sessions_using_task_agent++; + result2.sessions_using_task_agent++; if (session2.uses_mcp) - result3.sessions_using_mcp++; + result2.sessions_using_mcp++; if (session2.uses_web_search) - result3.sessions_using_web_search++; + result2.sessions_using_web_search++; if (session2.uses_web_fetch) - result3.sessions_using_web_fetch++; - result3.total_lines_added += session2.lines_added; - result3.total_lines_removed += session2.lines_removed; - result3.total_files_modified += session2.files_modified; + result2.sessions_using_web_fetch++; + result2.total_lines_added += session2.lines_added; + result2.total_lines_removed += session2.lines_removed; + result2.total_files_modified += session2.files_modified; allMessageHours.push(...session2.message_hours); for (const [tool, count4] of Object.entries(session2.tool_counts)) { - result3.tool_counts[tool] = (result3.tool_counts[tool] || 0) + count4; + result2.tool_counts[tool] = (result2.tool_counts[tool] || 0) + count4; } for (const [lang, count4] of Object.entries(session2.languages)) { - result3.languages[lang] = (result3.languages[lang] || 0) + count4; + result2.languages[lang] = (result2.languages[lang] || 0) + count4; } if (session2.project_path) { - result3.projects[session2.project_path] = (result3.projects[session2.project_path] || 0) + 1; + result2.projects[session2.project_path] = (result2.projects[session2.project_path] || 0) + 1; } const sessionFacets = facets.get(session2.session_id); if (sessionFacets) { for (const [cat2, count4] of safeEntries(sessionFacets.goal_categories)) { if (count4 > 0) { - result3.goal_categories[cat2] = (result3.goal_categories[cat2] || 0) + count4; + result2.goal_categories[cat2] = (result2.goal_categories[cat2] || 0) + count4; } } - result3.outcomes[sessionFacets.outcome] = (result3.outcomes[sessionFacets.outcome] || 0) + 1; + result2.outcomes[sessionFacets.outcome] = (result2.outcomes[sessionFacets.outcome] || 0) + 1; for (const [level, count4] of safeEntries(sessionFacets.user_satisfaction_counts)) { if (count4 > 0) { - result3.satisfaction[level] = (result3.satisfaction[level] || 0) + count4; + result2.satisfaction[level] = (result2.satisfaction[level] || 0) + count4; } } - result3.helpfulness[sessionFacets.claude_helpfulness] = (result3.helpfulness[sessionFacets.claude_helpfulness] || 0) + 1; - result3.session_types[sessionFacets.session_type] = (result3.session_types[sessionFacets.session_type] || 0) + 1; + result2.helpfulness[sessionFacets.claude_helpfulness] = (result2.helpfulness[sessionFacets.claude_helpfulness] || 0) + 1; + result2.session_types[sessionFacets.session_type] = (result2.session_types[sessionFacets.session_type] || 0) + 1; for (const [type, count4] of safeEntries(sessionFacets.friction_counts)) { if (count4 > 0) { - result3.friction[type] = (result3.friction[type] || 0) + count4; + result2.friction[type] = (result2.friction[type] || 0) + count4; } } if (sessionFacets.primary_success !== "none") { - result3.success[sessionFacets.primary_success] = (result3.success[sessionFacets.primary_success] || 0) + 1; + result2.success[sessionFacets.primary_success] = (result2.success[sessionFacets.primary_success] || 0) + 1; } } - if (result3.session_summaries.length < 50) { - result3.session_summaries.push({ + if (result2.session_summaries.length < 50) { + result2.session_summaries.push({ id: session2.session_id.slice(0, 8), date: session2.start_time.split("T")[0] || "", summary: session2.summary || session2.first_prompt.slice(0, 100), @@ -674431,24 +596997,24 @@ function aggregateData(sessions, facets) { } } dates.sort(); - result3.date_range.start = dates[0]?.split("T")[0] || ""; - result3.date_range.end = dates[dates.length - 1]?.split("T")[0] || ""; - result3.user_response_times = allResponseTimes; + result2.date_range.start = dates[0]?.split("T")[0] || ""; + result2.date_range.end = dates[dates.length - 1]?.split("T")[0] || ""; + result2.user_response_times = allResponseTimes; if (allResponseTimes.length > 0) { const sorted = [...allResponseTimes].sort((a2, b) => a2 - b); - result3.median_response_time = sorted[Math.floor(sorted.length / 2)] || 0; - result3.avg_response_time = allResponseTimes.reduce((a2, b) => a2 + b, 0) / allResponseTimes.length; + result2.median_response_time = sorted[Math.floor(sorted.length / 2)] || 0; + result2.avg_response_time = allResponseTimes.reduce((a2, b) => a2 + b, 0) / allResponseTimes.length; } const uniqueDays = new Set(dates.map((d) => d.split("T")[0])); - result3.days_active = uniqueDays.size; - result3.messages_per_day = result3.days_active > 0 ? Math.round(result3.total_messages / result3.days_active * 10) / 10 : 0; - result3.message_hours = allMessageHours; - result3.multi_clauding = detectMultiClauding(sessions); - return result3; + result2.days_active = uniqueDays.size; + result2.messages_per_day = result2.days_active > 0 ? Math.round(result2.total_messages / result2.days_active * 10) / 10 : 0; + result2.message_hours = allMessageHours; + result2.multi_clauding = detectMultiClauding(sessions); + return result2; } async function generateSectionInsight(section, dataContext) { try { - const result3 = await queryWithModel({ + const result2 = await queryWithModel({ systemPrompt: asSystemPrompt([]), userPrompt: section.prompt + ` @@ -674465,9 +597031,9 @@ DATA: maxOutputTokensOverride: section.maxTokens } }); - const text2 = extractTextContent(result3.message.content); - if (text2) { - const jsonMatch = text2.match(/\{[\s\S]*\}/); + const text = extractTextContent(result2.message.content); + if (text) { + const jsonMatch = text.match(/\{[\s\S]*\}/); if (jsonMatch) { try { return { name: section.name, result: jsonParse(jsonMatch[0]) }; @@ -674477,8 +597043,8 @@ DATA: } } return { name: section.name, result: null }; - } catch (err3) { - logError2(new Error(`${section.name} failed: ${toError(err3).message}`)); + } catch (err2) { + logError2(new Error(`${section.name} failed: ${toError(err2).message}`)); return { name: section.name, result: null }; } } @@ -674487,7 +597053,7 @@ async function generateParallelInsights(data, facets) { `); const frictionDetails = Array.from(facets.values()).filter((f) => f.friction_detail).slice(0, 20).map((f) => `- ${f.friction_detail}`).join(` `); - const userInstructions = Array.from(facets.values()).flatMap((f) => f.user_instructions_to_claude || []).slice(0, 15).map((i4) => `- ${i4}`).join(` + const userInstructions = Array.from(facets.values()).flatMap((f) => f.user_instructions_to_claude || []).slice(0, 15).map((i3) => `- ${i3}`).join(` `); const dataContext = jsonStringify({ sessions: data.total_sessions, @@ -674516,9 +597082,9 @@ USER INSTRUCTIONS TO CLAUDE: ` + (userInstructions || "None captured"); const results = await Promise.all(INSIGHT_SECTIONS.map((section) => generateSectionInsight(section, fullContext))); const insights = {}; - for (const { name, result: result3 } of results) { - if (result3) { - insights[name] = result3; + for (const { name, result: result2 } of results) { + if (result2) { + insights[name] = result2; } } const projectAreasText = insights.project_areas?.areas?.map((a2) => `- ${a2.name}: ${a2.description}`).join(` @@ -674586,8 +597152,8 @@ ${horizonText}`; } return insights; } -function escapeHtmlWithBold(text2) { - const escaped = escapeXmlAttr(text2); +function escapeHtmlWithBold(text) { + const escaped = escapeXmlAttr(text); return escaped.replace(/\*\*(.+?)\*\*/g, "$1"); } function generateBarChart(data, color3, maxItems = 6, fixedOrder) { @@ -674611,8 +597177,8 @@ function generateBarChart(data, color3, maxItems = 6, fixedOrder) { }).join(` `); } -function generateResponseTimeHistogram(times3) { - if (times3.length === 0) +function generateResponseTimeHistogram(times2) { + if (times2.length === 0) return '

No response time data

'; const buckets = { "2-10s": 0, @@ -674623,7 +597189,7 @@ function generateResponseTimeHistogram(times3) { "5-15m": 0, ">15m": 0 }; - for (const t of times3) { + for (const t of times2) { if (t < 10) buckets["2-10s"] = (buckets["2-10s"] ?? 0) + 1; else if (t < 30) @@ -674667,7 +597233,7 @@ function generateTimeOfDayChart(messageHours) { } const periodCounts = periods.map((p) => ({ label: p.label, - count: p.range.reduce((sum3, h2) => sum3 + (hourCounts[h2] || 0), 0) + count: p.range.reduce((sum2, h2) => sum2 + (hourCounts[h2] || 0), 0) })); const maxVal = Math.max(...periodCounts.map((p) => p.count)) || 1; const barsHtml = periodCounts.map((p) => ` @@ -674773,14 +597339,14 @@ function generateHtmlReport(data, insights) {
- ${suggestions.claude_md_additions.map((add3, i4) => ` + ${suggestions.claude_md_additions.map((add2, i3) => `
- -
`).join("")} @@ -675316,10 +597882,10 @@ async function scanAllSessions() { } catch { return []; } - const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join150(projectsDir, dirent.name)); + const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join140(projectsDir, dirent.name)); const allSessions = []; - for (let i4 = 0;i4 < projectDirs.length; i4++) { - const sessionFiles = await getSessionFilesWithMtime(projectDirs[i4]); + for (let i3 = 0;i3 < projectDirs.length; i3++) { + const sessionFiles = await getSessionFilesWithMtime(projectDirs[i3]); for (const [sessionId, fileInfo] of sessionFiles) { allSessions.push({ sessionId, @@ -675328,8 +597894,8 @@ async function scanAllSessions() { size: fileInfo.size }); } - if (i4 % 10 === 9) { - await new Promise((resolve45) => setImmediate(resolve45)); + if (i3 % 10 === 9) { + await new Promise((resolve39) => setImmediate(resolve39)); } } allSessions.sort((a2, b) => b.mtime - a2.mtime); @@ -675338,7 +597904,7 @@ async function scanAllSessions() { async function generateUsageReport(options2) { let remoteStats; if (process.env.USER_TYPE === "ant" && options2?.collectRemote) { - const destDir = join150(getClaudeConfigHomeDir(), "projects"); + const destDir = join140(getClaudeConfigHomeDir(), "projects"); const { hosts, totalCopied } = await collectAllRemoteHostData(destDir); remoteStats = { hosts, totalCopied }; } @@ -675348,8 +597914,8 @@ async function generateUsageReport(options2) { const MAX_SESSIONS_TO_LOAD = 200; let allMetas = []; const uncachedSessions = []; - for (let i4 = 0;i4 < allScannedSessions.length; i4 += META_BATCH_SIZE) { - const batch = allScannedSessions.slice(i4, i4 + META_BATCH_SIZE); + for (let i3 = 0;i3 < allScannedSessions.length; i3 += META_BATCH_SIZE) { + const batch = allScannedSessions.slice(i3, i3 + META_BATCH_SIZE); const results = await Promise.all(batch.map(async (sessionInfo) => ({ sessionInfo, cached: await loadCachedSessionMeta(sessionInfo.sessionId) @@ -675363,8 +597929,8 @@ async function generateUsageReport(options2) { } } const logsForFacets = new Map; - const isMetaSession = (log2) => { - for (const msg of log2.messages.slice(0, 5)) { + const isMetaSession = (log) => { + for (const msg of log.messages.slice(0, 5)) { if (msg.type === "user" && msg.message) { const content = msg.message.content; if (typeof content === "string") { @@ -675377,8 +597943,8 @@ async function generateUsageReport(options2) { return false; }; const LOAD_BATCH_SIZE = 10; - for (let i4 = 0;i4 < uncachedSessions.length; i4 += LOAD_BATCH_SIZE) { - const batch = uncachedSessions.slice(i4, i4 + LOAD_BATCH_SIZE); + for (let i3 = 0;i3 < uncachedSessions.length; i3 += LOAD_BATCH_SIZE) { + const batch = uncachedSessions.slice(i3, i3 + LOAD_BATCH_SIZE); const batchResults = await Promise.all(batch.map(async (sessionInfo) => { try { return await loadAllLogsFromSessionFile(sessionInfo.path); @@ -675388,13 +597954,13 @@ async function generateUsageReport(options2) { })); const metasToSave = []; for (const logs2 of batchResults) { - for (const log2 of logs2) { - if (isMetaSession(log2) || !hasValidDates(log2)) + for (const log of logs2) { + if (isMetaSession(log) || !hasValidDates(log)) continue; - const meta = logToSessionMeta(log2); + const meta = logToSessionMeta(log); allMetas.push(meta); metasToSave.push(meta); - logsForFacets.set(meta.session_id, log2); + logsForFacets.set(meta.session_id, log); } } await Promise.all(metasToSave.map((meta) => saveSessionMeta(meta))); @@ -675433,17 +597999,17 @@ async function generateUsageReport(options2) { if (cached7) { facets.set(sessionId, cached7); } else { - const log2 = logsForFacets.get(sessionId); - if (log2 && toExtract.length < MAX_FACET_EXTRACTIONS) { - toExtract.push({ log: log2, sessionId }); + const log = logsForFacets.get(sessionId); + if (log && toExtract.length < MAX_FACET_EXTRACTIONS) { + toExtract.push({ log, sessionId }); } } } const CONCURRENCY = 50; - for (let i4 = 0;i4 < toExtract.length; i4 += CONCURRENCY) { - const batch = toExtract.slice(i4, i4 + CONCURRENCY); - const results = await Promise.all(batch.map(async ({ log: log2, sessionId }) => { - const newFacets = await extractFacetsFromAPI(log2, sessionId); + for (let i3 = 0;i3 < toExtract.length; i3 += CONCURRENCY) { + const batch = toExtract.slice(i3, i3 + CONCURRENCY); + const results = await Promise.all(batch.map(async ({ log, sessionId }) => { + const newFacets = await extractFacetsFromAPI(log, sessionId); return { sessionId, newFacets }; })); const facetsToSave = []; @@ -675477,8 +598043,8 @@ async function generateUsageReport(options2) { try { await mkdir48(getDataDir(), { recursive: true }); } catch {} - const htmlPath = join150(getDataDir(), "report.html"); - await writeFile52(htmlPath, htmlReport, { + const htmlPath = join140(getDataDir(), "report.html"); + await writeFile50(htmlPath, htmlReport, { encoding: "utf-8", mode: 384 }); @@ -675546,7 +598112,7 @@ var init_insights = __esm(() => { init_errors(); init_execFileNoThrow(); init_log3(); - init_messages5(); + init_messages3(); init_model(); init_sessionStorage(); init_slowOperations(); @@ -675572,60 +598138,60 @@ var init_insights = __esm(() => { return parseInt(stdout.trim(), 10) || 0; } : async () => 0; collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => { - const result3 = { copied: 0, skipped: 0 }; - const tempDir = await mkdtemp3(join150(tmpdir12(), "claude-hs-")); + const result2 = { copied: 0, skipped: 0 }; + const tempDir = await mkdtemp(join140(tmpdir9(), "claude-hs-")); try { const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.claude/projects/`, tempDir], { timeout: 300000 }); if (scpResult.code !== 0) { - return result3; + return result2; } - const projectsDir = join150(tempDir, "projects"); + const projectsDir = join140(tempDir, "projects"); let projectDirents; try { projectDirents = await readdir32(projectsDir, { withFileTypes: true }); } catch { - return result3; + return result2; } await Promise.all(projectDirents.map(async (dirent) => { const projectName = dirent.name; - const projectPath = join150(projectsDir, projectName); + const projectPath = join140(projectsDir, projectName); if (!dirent.isDirectory()) return; const destProjectName = `${projectName}__${homespace}`; - const destProjectPath = join150(destDir, destProjectName); + const destProjectPath = join140(destDir, destProjectName); try { await mkdir48(destProjectPath, { recursive: true }); } catch {} - let files3; + let files2; try { - files3 = await readdir32(projectPath, { withFileTypes: true }); + files2 = await readdir32(projectPath, { withFileTypes: true }); } catch { return; } - await Promise.all(files3.map(async (fileDirent) => { + await Promise.all(files2.map(async (fileDirent) => { const fileName = fileDirent.name; if (!fileName.endsWith(".jsonl")) return; - const srcFile = join150(projectPath, fileName); - const destFile = join150(destProjectPath, fileName); + const srcFile = join140(projectPath, fileName); + const destFile = join140(destProjectPath, fileName); try { - await copyFile10(srcFile, destFile, fsConstants6.COPYFILE_EXCL); - result3.copied++; + await copyFile9(srcFile, destFile, fsConstants6.COPYFILE_EXCL); + result2.copied++; } catch { - result3.skipped++; + result2.skipped++; } })); })); } finally { try { - await rm12(tempDir, { recursive: true, force: true }); + await rm10(tempDir, { recursive: true, force: true }); } catch {} } - return result3; + return result2; } : async () => ({ copied: 0, skipped: 0 }); collectAllRemoteHostData = process.env.USER_TYPE === "ant" ? async (destDir) => { const rHosts = await getRunningRemoteHosts(); - const result3 = []; + const result2 = []; let totalCopied = 0; let totalSkipped = 0; const hostResults = await Promise.all(rHosts.map(async (hs) => { @@ -675637,11 +598203,11 @@ var init_insights = __esm(() => { return { name: hs, sessionCount, copied: 0, skipped: 0 }; })); for (const hr2 of hostResults) { - result3.push({ name: hr2.name, sessionCount: hr2.sessionCount }); + result2.push({ name: hr2.name, sessionCount: hr2.sessionCount }); totalCopied += hr2.copied; totalSkipped += hr2.skipped; } - return { hosts: result3, totalCopied, totalSkipped }; + return { hosts: result2, totalCopied, totalSkipped }; } : async () => ({ hosts: [], totalCopied: 0, totalSkipped: 0 }); EXTENSION_TO_LANGUAGE = { ".ts": "TypeScript", @@ -676017,13 +598583,13 @@ var init_createWorkflowCommand = __esm(() => { async function getSkills(cwd2) { try { const [skillDirCommands, pluginSkills] = await Promise.all([ - getSkillDirCommands(cwd2).catch((err3) => { - logError2(toError(err3)); + getSkillDirCommands(cwd2).catch((err2) => { + logError2(toError(err2)); logForDebugging("Skill directory commands failed to load, continuing without them"); return []; }), - getPluginSkills().catch((err3) => { - logError2(toError(err3)); + getPluginSkills().catch((err2) => { + logError2(toError(err2)); logForDebugging("Plugin skills failed to load, continuing without them"); return []; }) @@ -676037,8 +598603,8 @@ async function getSkills(cwd2) { bundledSkills: bundledSkills2, builtinPluginSkills }; - } catch (err3) { - logError2(toError(err3)); + } catch (err2) { + logError2(toError(err2)); logForDebugging("Unexpected error in getSkills, returning empty"); return { skillDirCommands: [], @@ -676169,11 +598735,11 @@ var init_commands2 = __esm(() => { init_feedback2(); init_clear2(); init_color3(); - init_commit3(); + init_commit2(); init_copy2(); init_desktop2(); init_commit_push_pr(); - init_compact5(); + init_compact4(); init_config8(); init_context4(); init_cost2(); @@ -676183,7 +598749,7 @@ var init_commands2 = __esm(() => { init_memory2(); init_help2(); init_ide3(); - init_init2(); + init_init(); init_init_verifiers(); init_keybindings2(); init_login2(); @@ -676220,7 +598786,7 @@ var init_commands2 = __esm(() => { init_passes2(); init_privacy_settings2(); init_hooks3(); - init_files6(); + init_files4(); init_branch2(); init_agents2(); init_plugin2(); @@ -676246,7 +598812,7 @@ var init_commands2 = __esm(() => { init_builtinPlugins(); init_loadPluginCommands(); init_memoize(); - init_auth2(); + init_auth(); init_providers(); init_env2(); init_exit2(); @@ -676299,7 +598865,7 @@ var init_commands2 = __esm(() => { backfill_sessions_default, break_cache_default, bughunter_default, - commit_default3, + commit_default2, commit_push_pr_default, ctx_viz_default, good_claude_default, @@ -676334,7 +598900,7 @@ var init_commands2 = __esm(() => { chrome_default, clear_default, color_default, - compact_default3, + compact_default2, config_default, copy_default, desktop_default, @@ -676442,8 +599008,8 @@ var init_commands2 = __esm(() => { try { const allCommands = await getCommands(cwd2); return allCommands.filter((cmd) => cmd.type === "prompt" && cmd.source !== "builtin" && (cmd.hasUserSpecifiedDescription || cmd.whenToUse) && (cmd.loadedFrom === "skills" || cmd.loadedFrom === "plugin" || cmd.loadedFrom === "bundled" || cmd.disableModelInvocation)); - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); logForDebugging("Returning empty skills array due to load failure"); return []; } @@ -676468,7 +599034,7 @@ var init_commands2 = __esm(() => { mobile_default ]); BRIDGE_SAFE_COMMANDS = new Set([ - compact_default3, + compact_default2, clear_default, cost_default, summary_default, @@ -676577,12 +599143,12 @@ import { open as fsOpen2, mkdir as mkdir49, readdir as readdir33, - readFile as readFile56, - stat as stat45, + readFile as readFile55, + stat as stat44, unlink as unlink24, - writeFile as writeFile53 + writeFile as writeFile51 } from "fs/promises"; -import { basename as basename45, dirname as dirname62, join as join151 } from "path"; +import { basename as basename43, dirname as dirname58, join as join141 } from "path"; function isTranscriptMessage(entry) { return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system"; } @@ -676596,18 +599162,18 @@ function isEphemeralToolProgress(dataType) { return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType); } function getProjectsDir2() { - return join151(getClaudeConfigHomeDir(), "projects"); + return join141(getClaudeConfigHomeDir(), "projects"); } function getTranscriptPath() { const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()); - return join151(projectDir, `${getSessionId()}.jsonl`); + return join141(projectDir, `${getSessionId()}.jsonl`); } function getTranscriptPathForSession(sessionId) { if (sessionId === getSessionId()) { return getTranscriptPath(); } const projectDir = getProjectDir2(getOriginalCwd()); - return join151(projectDir, `${sessionId}.jsonl`); + return join141(projectDir, `${sessionId}.jsonl`); } function setAgentTranscriptSubdir(agentId, subdir) { agentTranscriptSubdirs.set(agentId, subdir); @@ -676619,21 +599185,21 @@ function getAgentTranscriptPath(agentId) { const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()); const sessionId = getSessionId(); const subdir = agentTranscriptSubdirs.get(agentId); - const base2 = subdir ? join151(projectDir, sessionId, "subagents", subdir) : join151(projectDir, sessionId, "subagents"); - return join151(base2, `agent-${agentId}.jsonl`); + const base2 = subdir ? join141(projectDir, sessionId, "subagents", subdir) : join141(projectDir, sessionId, "subagents"); + return join141(base2, `agent-${agentId}.jsonl`); } function getAgentMetadataPath(agentId) { return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json"); } async function writeAgentMetadata(agentId, metadata) { - const path26 = getAgentMetadataPath(agentId); - await mkdir49(dirname62(path26), { recursive: true }); - await writeFile53(path26, JSON.stringify(metadata)); + const path21 = getAgentMetadataPath(agentId); + await mkdir49(dirname58(path21), { recursive: true }); + await writeFile51(path21, JSON.stringify(metadata)); } async function readAgentMetadata(agentId) { - const path26 = getAgentMetadataPath(agentId); + const path21 = getAgentMetadataPath(agentId); try { - const raw = await readFile56(path26, "utf-8"); + const raw = await readFile55(path21, "utf-8"); return JSON.parse(raw); } catch (e) { if (isFsInaccessible(e)) @@ -676643,20 +599209,20 @@ async function readAgentMetadata(agentId) { } function getRemoteAgentsDir() { const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()); - return join151(projectDir, getSessionId(), "remote-agents"); + return join141(projectDir, getSessionId(), "remote-agents"); } function getRemoteAgentMetadataPath(taskId) { - return join151(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`); + return join141(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`); } async function writeRemoteAgentMetadata(taskId, metadata) { - const path26 = getRemoteAgentMetadataPath(taskId); - await mkdir49(dirname62(path26), { recursive: true }); - await writeFile53(path26, JSON.stringify(metadata)); + const path21 = getRemoteAgentMetadataPath(taskId); + await mkdir49(dirname58(path21), { recursive: true }); + await writeFile51(path21, JSON.stringify(metadata)); } async function readRemoteAgentMetadata(taskId) { - const path26 = getRemoteAgentMetadataPath(taskId); + const path21 = getRemoteAgentMetadataPath(taskId); try { - const raw = await readFile56(path26, "utf-8"); + const raw = await readFile55(path21, "utf-8"); return JSON.parse(raw); } catch (e) { if (isFsInaccessible(e)) @@ -676665,9 +599231,9 @@ async function readRemoteAgentMetadata(taskId) { } } async function deleteRemoteAgentMetadata(taskId) { - const path26 = getRemoteAgentMetadataPath(taskId); + const path21 = getRemoteAgentMetadataPath(taskId); try { - await unlink24(path26); + await unlink24(path21); } catch (e) { if (isFsInaccessible(e)) return; @@ -676689,7 +599255,7 @@ async function listRemoteAgentMetadata() { if (!entry.isFile() || !entry.name.endsWith(".meta.json")) continue; try { - const raw = await readFile56(join151(dir, entry.name), "utf-8"); + const raw = await readFile55(join141(dir, entry.name), "utf-8"); results.push(JSON.parse(raw)); } catch (e) { logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`); @@ -676699,10 +599265,10 @@ async function listRemoteAgentMetadata() { } function sessionIdExists(sessionId) { const projectDir = getProjectDir2(getOriginalCwd()); - const sessionFile = join151(projectDir, `${sessionId}.jsonl`); - const fs12 = getFsImplementation(); + const sessionFile = join141(projectDir, `${sessionId}.jsonl`); + const fs6 = getFsImplementation(); try { - fs12.statSync(sessionFile); + fs6.statSync(sessionFile); return true; } catch { return false; @@ -676723,14 +599289,14 @@ function isCustomTitleEnabled() { function getProject() { if (!project) { project = new Project; - if (!cleanupRegistered5) { + if (!cleanupRegistered4) { registerCleanup(async () => { await project?.flush(); try { project?.reAppendSessionMetadata(); } catch {} }); - cleanupRegistered5 = true; + cleanupRegistered4 = true; } } return project; @@ -676741,8 +599307,8 @@ function resetProjectFlushStateForTesting() { function resetProjectForTesting() { project = null; } -function setSessionFileForTesting(path26) { - getProject().sessionFile = path26; +function setSessionFileForTesting(path21) { + getProject().sessionFile = path21; } function setInternalEventWriter(writer) { getProject().setInternalEventWriter(writer); @@ -676796,8 +599362,8 @@ class Project { decrementPendingWrites() { this.pendingWriteCount--; if (this.pendingWriteCount === 0) { - for (const resolve45 of this.flushResolvers) { - resolve45(); + for (const resolve39 of this.flushResolvers) { + resolve39(); } this.flushResolvers = []; } @@ -676811,13 +599377,13 @@ class Project { } } enqueueWrite(filePath, entry) { - return new Promise((resolve45) => { + return new Promise((resolve39) => { let queue2 = this.writeQueues.get(filePath); if (!queue2) { queue2 = []; this.writeQueues.set(filePath, queue2); } - queue2.push({ entry, resolve: resolve45 }); + queue2.push({ entry, resolve: resolve39 }); this.scheduleDrain(); }); } @@ -676839,7 +599405,7 @@ class Project { try { await fsAppendFile(filePath, data, { mode: 384 }); } catch { - await mkdir49(dirname62(filePath), { recursive: true, mode: 448 }); + await mkdir49(dirname58(filePath), { recursive: true, mode: 448 }); await fsAppendFile(filePath, data, { mode: 384 }); } } @@ -676851,7 +599417,7 @@ class Project { const batch = queue2.splice(0); let content = ""; const resolvers2 = []; - for (const { entry, resolve: resolve45 } of batch) { + for (const { entry, resolve: resolve39 } of batch) { const line = jsonStringify(entry) + ` `; if (content.length + line.length >= this.MAX_CHUNK_BYTES) { @@ -676863,7 +599429,7 @@ class Project { content = ""; } content += line; - resolvers2.push(resolve45); + resolvers2.push(resolve39); } if (content.length > 0) { await this.appendToFile(filePath, content); @@ -676888,8 +599454,8 @@ class Project { const sessionId = getSessionId(); if (!sessionId) return; - const tail3 = readFileTailSync(this.sessionFile); - const tailLines = tail3.split(` + const tail2 = readFileTailSync(this.sessionFile); + const tailLines = tail2.split(` `); if (!skipTitleRefresh) { const titleLine = tailLines.findLast((l) => l.startsWith('{"type":"custom-title"')); @@ -676986,8 +599552,8 @@ class Project { if (this.pendingWriteCount === 0) { return; } - return new Promise((resolve45) => { - this.flushResolvers.push(resolve45); + return new Promise((resolve39) => { + this.flushResolvers.push(resolve39); }); } async removeMessageByUuid(targetUuid) { @@ -676998,28 +599564,28 @@ class Project { let fileSize = 0; const fh = await fsOpen2(this.sessionFile, "r+"); try { - const { size: size3 } = await fh.stat(); - fileSize = size3; - if (size3 === 0) + const { size: size2 } = await fh.stat(); + fileSize = size2; + if (size2 === 0) return; - const chunkLen = Math.min(size3, LITE_READ_BUF_SIZE); - const tailStart = size3 - chunkLen; + const chunkLen = Math.min(size2, LITE_READ_BUF_SIZE); + const tailStart = size2 - chunkLen; const buf = Buffer.allocUnsafe(chunkLen); const { bytesRead } = await fh.read(buf, 0, chunkLen, tailStart); - const tail3 = buf.subarray(0, bytesRead); + const tail2 = buf.subarray(0, bytesRead); const needle = `"uuid":"${targetUuid}"`; - const matchIdx = tail3.lastIndexOf(needle); + const matchIdx = tail2.lastIndexOf(needle); if (matchIdx >= 0) { - const prevNl = tail3.lastIndexOf(10, matchIdx); + const prevNl = tail2.lastIndexOf(10, matchIdx); if (prevNl >= 0 || tailStart === 0) { const lineStart = prevNl + 1; - const nextNl = tail3.indexOf(10, matchIdx + needle.length); + const nextNl = tail2.indexOf(10, matchIdx + needle.length); const lineEnd = nextNl >= 0 ? nextNl + 1 : bytesRead; const absLineStart = tailStart + lineStart; const afterLen = bytesRead - lineEnd; await fh.truncate(absLineStart); if (afterLen > 0) { - await fh.write(tail3, lineEnd, afterLen, absLineStart); + await fh.write(tail2, lineEnd, afterLen, absLineStart); } return; } @@ -677031,7 +599597,7 @@ class Project { logForDebugging(`Skipping tombstone removal: session file too large (${formatFileSize(fileSize)})`, { level: "warn" }); return; } - const content = await readFile56(this.sessionFile, { encoding: "utf-8" }); + const content = await readFile55(this.sessionFile, { encoding: "utf-8" }); const lines = content.split(` `).filter((line) => { if (!line.trim()) @@ -677043,7 +599609,7 @@ class Project { return true; } }); - await writeFile53(this.sessionFile, lines.join(` + await writeFile51(this.sessionFile, lines.join(` `), { encoding: "utf8" }); @@ -677100,7 +599666,7 @@ class Project { entrypoint: getEntrypoint(), cwd: getCwd(), sessionId, - version: VERSION8, + version: VERSION6, gitBranch, slug }; @@ -677110,9 +599676,9 @@ class Project { } } if (!isSidechain) { - const text2 = getFirstMeaningfulUserMessageTextContent(messages); - if (text2) { - const flat = text2.replace(/\n/g, " ").trim(); + const text = getFirstMeaningfulUserMessageTextContent(messages); + if (text) { + const flat = text.replace(/\n/g, " ").trim(); this.currentSessionLastPrompt = flat.length > 200 ? flat.slice(0, 200).trim() + "…" : flat; } } @@ -677241,7 +599807,7 @@ class Project { return cached7; const targetFile = getTranscriptPathForSession(sessionId); try { - await stat45(targetFile); + await stat44(targetFile); this.existingSessionFiles.set(sessionId, targetFile); return targetFile; } catch (e) { @@ -677384,11 +599950,11 @@ async function hydrateRemoteSession(sessionId, ingressUrl) { const sessionFile = getTranscriptPathForSession(sessionId); const content = remoteLogs.map((e) => jsonStringify(e) + ` `).join(""); - await writeFile53(sessionFile, content, { encoding: "utf8", mode: 384 }); + await writeFile51(sessionFile, content, { encoding: "utf8", mode: 384 }); logForDebugging(`Hydrated ${remoteLogs.length} entries from remote`); return remoteLogs.length > 0; - } catch (error46) { - logForDebugging(`Error hydrating session from remote: ${error46}`); + } catch (error42) { + logForDebugging(`Error hydrating session from remote: ${error42}`); logForDiagnosticsNoPII("error", "hydrate_remote_session_fail"); return false; } finally { @@ -677416,7 +599982,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) { const sessionFile = getTranscriptPathForSession(sessionId); const fgContent = events2.map((e) => jsonStringify(e.payload) + ` `).join(""); - await writeFile53(sessionFile, fgContent, { encoding: "utf8", mode: 384 }); + await writeFile51(sessionFile, fgContent, { encoding: "utf8", mode: 384 }); logForDebugging(`Hydrated ${events2.length} foreground entries from CCR v2 internal events`); let subagentEventCount = 0; const subagentReader = project2.getInternalSubagentEventReader(); @@ -677438,10 +600004,10 @@ async function hydrateFromCCRv2InternalEvents(sessionId) { } for (const [agentId, entries] of byAgent) { const agentFile = getAgentTranscriptPath(asAgentId(agentId)); - await mkdir49(dirname62(agentFile), { recursive: true, mode: 448 }); + await mkdir49(dirname58(agentFile), { recursive: true, mode: 448 }); const agentContent = entries.map((p) => jsonStringify(p) + ` `).join(""); - await writeFile53(agentFile, agentContent, { + await writeFile51(agentFile, agentContent, { encoding: "utf8", mode: 384 }); @@ -677455,11 +600021,11 @@ async function hydrateFromCCRv2InternalEvents(sessionId) { subagent_event_count: subagentEventCount }); return events2.length > 0; - } catch (error46) { - if (error46 instanceof Error && error46.message === "CCRClient: Epoch mismatch (409)") { - throw error46; + } catch (error42) { + if (error42 instanceof Error && error42.message === "CCRClient: Epoch mismatch (409)") { + throw error42; } - logForDebugging(`Error hydrating session from CCR v2: ${error46}`); + logForDebugging(`Error hydrating session from CCR v2: ${error42}`); logForDiagnosticsNoPII("error", "hydrate_ccr_v2_fail"); return false; } @@ -677467,11 +600033,11 @@ async function hydrateFromCCRv2InternalEvents(sessionId) { function extractFirstPrompt2(transcript) { const textContent = getFirstMeaningfulUserMessageTextContent(transcript); if (textContent) { - let result3 = textContent.replace(/\n/g, " ").trim(); - if (result3.length > 200) { - result3 = result3.slice(0, 200).trim() + "…"; + let result2 = textContent.replace(/\n/g, " ").trim(); + if (result2.length > 200) { + result2 = result2.slice(0, 200).trim() + "…"; } - return result3; + return result2; } return "No prompt"; } @@ -677533,18 +600099,18 @@ function applyPreservedSegmentRelinks(messages) { let lastSegBoundaryIdx = -1; let absoluteLastBoundaryIdx = -1; const entryIndex = new Map; - let i4 = 0; + let i3 = 0; for (const entry of messages.values()) { - entryIndex.set(entry.uuid, i4); + entryIndex.set(entry.uuid, i3); if (isCompactBoundaryMessage(entry)) { - absoluteLastBoundaryIdx = i4; + absoluteLastBoundaryIdx = i3; const seg = entry.compactMetadata?.preservedSegment; if (seg) { lastSeg = seg; - lastSegBoundaryIdx = i4; + lastSegBoundaryIdx = i3; } } - i4++; + i3++; } if (!lastSeg) return; @@ -677575,23 +600141,23 @@ function applyPreservedSegmentRelinks(messages) { } } if (segIsLive) { - const head3 = messages.get(lastSeg.headUuid); - if (head3) { + const head2 = messages.get(lastSeg.headUuid); + if (head2) { messages.set(lastSeg.headUuid, { - ...head3, + ...head2, parentUuid: lastSeg.anchorUuid }); } - for (const [uuid8, msg] of messages) { - if (msg.parentUuid === lastSeg.anchorUuid && uuid8 !== lastSeg.headUuid) { - messages.set(uuid8, { ...msg, parentUuid: lastSeg.tailUuid }); + for (const [uuid5, msg] of messages) { + if (msg.parentUuid === lastSeg.anchorUuid && uuid5 !== lastSeg.headUuid) { + messages.set(uuid5, { ...msg, parentUuid: lastSeg.tailUuid }); } } - for (const uuid8 of preservedUuids) { - const msg = messages.get(uuid8); + for (const uuid5 of preservedUuids) { + const msg = messages.get(uuid5); if (msg?.type !== "assistant") continue; - messages.set(uuid8, { + messages.set(uuid5, { ...msg, message: { ...msg.message, @@ -677607,14 +600173,14 @@ function applyPreservedSegmentRelinks(messages) { } } const toDelete = []; - for (const [uuid8] of messages) { - const idx = entryIndex.get(uuid8); - if (idx !== undefined && idx < absoluteLastBoundaryIdx && !preservedUuids.has(uuid8)) { - toDelete.push(uuid8); + for (const [uuid5] of messages) { + const idx = entryIndex.get(uuid5); + if (idx !== undefined && idx < absoluteLastBoundaryIdx && !preservedUuids.has(uuid5)) { + toDelete.push(uuid5); } } - for (const uuid8 of toDelete) - messages.delete(uuid8); + for (const uuid5 of toDelete) + messages.delete(uuid5); } function applySnipRemovals(messages) { const toDelete = new Set; @@ -677622,41 +600188,41 @@ function applySnipRemovals(messages) { const removedUuids = entry.snipMetadata?.removedUuids; if (!removedUuids) continue; - for (const uuid8 of removedUuids) - toDelete.add(uuid8); + for (const uuid5 of removedUuids) + toDelete.add(uuid5); } if (toDelete.size === 0) return; const deletedParent = new Map; let removedCount = 0; - for (const uuid8 of toDelete) { - const entry = messages.get(uuid8); + for (const uuid5 of toDelete) { + const entry = messages.get(uuid5); if (!entry) continue; - deletedParent.set(uuid8, entry.parentUuid); - messages.delete(uuid8); + deletedParent.set(uuid5, entry.parentUuid); + messages.delete(uuid5); removedCount++; } - const resolve45 = (start) => { - const path26 = []; + const resolve39 = (start) => { + const path21 = []; let cur = start; while (cur && toDelete.has(cur)) { - path26.push(cur); + path21.push(cur); cur = deletedParent.get(cur); if (cur === undefined) { cur = null; break; } } - for (const p of path26) + for (const p of path21) deletedParent.set(p, cur); return cur; }; let relinkedCount = 0; - for (const [uuid8, msg] of messages) { + for (const [uuid5, msg] of messages) { if (!msg.parentUuid || !toDelete.has(msg.parentUuid)) continue; - messages.set(uuid8, { ...msg, parentUuid: resolve45(msg.parentUuid) }); + messages.set(uuid5, { ...msg, parentUuid: resolve39(msg.parentUuid) }); relinkedCount++; } logEvent("tengu_snip_resume_filtered", { @@ -677695,10 +600261,10 @@ function buildConversationChain(messages, leafMessage) { transcript.reverse(); return recoverOrphanedParallelToolResults(messages, transcript, seen); } -function recoverOrphanedParallelToolResults(messages, chain3, seen) { - const chainAssistants = chain3.filter((m) => m.type === "assistant"); +function recoverOrphanedParallelToolResults(messages, chain2, seen) { + const chainAssistants = chain2.filter((m) => m.type === "assistant"); if (chainAssistants.length === 0) - return chain3; + return chain2; const anchorByMsgId = new Map; for (const a2 of chainAssistants) { if (a2.message.id) @@ -677753,34 +600319,34 @@ function recoverOrphanedParallelToolResults(messages, chain3, seen) { inserts.set(anchor.uuid, recovered); } if (recoveredCount === 0) - return chain3; + return chain2; logEvent("tengu_chain_parallel_tr_recovered", { recovered_count: recoveredCount }); - const result3 = []; - for (const m of chain3) { - result3.push(m); + const result2 = []; + for (const m of chain2) { + result2.push(m); const toInsert = inserts.get(m.uuid); if (toInsert) - result3.push(...toInsert); + result2.push(...toInsert); } - return result3; + return result2; } -function checkResumeConsistency(chain3) { - for (let i4 = chain3.length - 1;i4 >= 0; i4--) { - const m = chain3[i4]; +function checkResumeConsistency(chain2) { + for (let i3 = chain2.length - 1;i3 >= 0; i3--) { + const m = chain2[i3]; if (m.type !== "system" || m.subtype !== "turn_duration") continue; const expected = m.messageCount; if (expected === undefined) return; - const actual = i4; + const actual = i3; logEvent("tengu_resume_consistency_delta", { expected, actual, delta: actual - expected, - chain_length: chain3.length, - checkpoint_age_entries: chain3.length - 1 - i4 + chain_length: chain2.length, + checkpoint_age_entries: chain2.length - 1 - i3 }); return; } @@ -677841,12 +600407,12 @@ async function loadTranscriptFromFile(filePath) { worktreeSession: worktreeStates.has(sessionId) ? worktreeStates.get(sessionId) : undefined }; } - const content = await readFile56(filePath, { encoding: "utf-8" }); + const content = await readFile55(filePath, { encoding: "utf-8" }); let parsed; try { parsed = jsonParse(content); - } catch (error46) { - throw new Error(`Invalid JSON in transcript file: ${error46}`); + } catch (error42) { + throw new Error(`Invalid JSON in transcript file: ${error42}`); } let messages; if (Array.isArray(parsed)) { @@ -677940,8 +600506,8 @@ function convertToLogOption(transcript, value = 0, summary, customTitle, fileHis async function trackSessionBranchingAnalytics(logs2) { const sessionIdCounts = new Map; let maxCount = 0; - for (const log2 of logs2) { - const sessionId = getSessionIdFromLog(log2); + for (const log of logs2) { + const sessionId = getSessionIdFromLog(log); if (sessionId) { const newCount = (sessionIdCounts.get(sessionId) || 0) + 1; sessionIdCounts.set(sessionId, newCount); @@ -677953,7 +600519,7 @@ async function trackSessionBranchingAnalytics(logs2) { } const branchCounts = Array.from(sessionIdCounts.values()).filter((c6) => c6 > 1); const sessionsWithBranches = branchCounts.length; - const totalBranches = branchCounts.reduce((sum3, count4) => sum3 + count4, 0); + const totalBranches = branchCounts.reduce((sum2, count4) => sum2 + count4, 0); logEvent("tengu_session_forked_branches_fetched", { total_sessions: sessionIdCounts.size, sessions_with_branches: sessionsWithBranches, @@ -677969,31 +600535,31 @@ async function fetchLogs(limit) { return logs2; } function appendEntryToFile(fullPath, entry) { - const fs12 = getFsImplementation(); + const fs6 = getFsImplementation(); const line = jsonStringify(entry) + ` `; try { - fs12.appendFileSync(fullPath, line, { mode: 384 }); + fs6.appendFileSync(fullPath, line, { mode: 384 }); } catch { - fs12.mkdirSync(dirname62(fullPath), { mode: 448 }); - fs12.appendFileSync(fullPath, line, { mode: 384 }); + fs6.mkdirSync(dirname58(fullPath), { mode: 448 }); + fs6.appendFileSync(fullPath, line, { mode: 384 }); } } function readFileTailSync(fullPath) { - let fd3; + let fd2; try { - fd3 = openSync5(fullPath, "r"); - const st = fstatSync(fd3); + fd2 = openSync5(fullPath, "r"); + const st = fstatSync(fd2); const tailOffset = Math.max(0, st.size - LITE_READ_BUF_SIZE); const buf = Buffer.allocUnsafe(Math.min(LITE_READ_BUF_SIZE, st.size - tailOffset)); - const bytesRead = readSync3(fd3, buf, 0, buf.length, tailOffset); + const bytesRead = readSync3(fd2, buf, 0, buf.length, tailOffset); return buf.toString("utf8", 0, bytesRead); } catch { return ""; } finally { - if (fd3 !== undefined) { + if (fd2 !== undefined) { try { - closeSync4(fd3); + closeSync4(fd2); } catch {} } } @@ -678162,22 +600728,22 @@ function saveWorktreeState(worktreeSession) { }); } } -function getSessionIdFromLog(log2) { - if (log2.sessionId) { - return log2.sessionId; +function getSessionIdFromLog(log) { + if (log.sessionId) { + return log.sessionId; } - return log2.messages[0]?.sessionId; + return log.messages[0]?.sessionId; } -function isLiteLog(log2) { - return log2.messages.length === 0 && log2.sessionId !== undefined; +function isLiteLog(log) { + return log.messages.length === 0 && log.sessionId !== undefined; } -async function loadFullLog(log2) { - if (!isLiteLog(log2)) { - return log2; +async function loadFullLog(log) { + if (!isLiteLog(log)) { + return log; } - const sessionFile = log2.fullPath; + const sessionFile = log.fullPath; if (!sessionFile) { - return log2; + return log; } try { const { @@ -678201,42 +600767,42 @@ async function loadFullLog(log2) { leafUuids } = await loadTranscriptFile(sessionFile); if (messages.size === 0) { - return log2; + return log; } const mostRecentLeaf = findLatestMessage(messages.values(), (msg) => leafUuids.has(msg.uuid) && (msg.type === "user" || msg.type === "assistant")); if (!mostRecentLeaf) { - return log2; + return log; } const transcript = buildConversationChain(messages, mostRecentLeaf); const sessionId = mostRecentLeaf.sessionId; return { - ...log2, + ...log, messages: removeExtraFields(transcript), firstPrompt: extractFirstPrompt2(transcript), messageCount: countVisibleMessages(transcript), - summary: mostRecentLeaf ? summaries.get(mostRecentLeaf.uuid) : log2.summary, - customTitle: sessionId ? customTitles.get(sessionId) : log2.customTitle, - tag: sessionId ? tags.get(sessionId) : log2.tag, - agentName: sessionId ? agentNames.get(sessionId) : log2.agentName, - agentColor: sessionId ? agentColors.get(sessionId) : log2.agentColor, - agentSetting: sessionId ? agentSettings.get(sessionId) : log2.agentSetting, - mode: sessionId ? modes.get(sessionId) : log2.mode, - worktreeSession: sessionId && worktreeStates.has(sessionId) ? worktreeStates.get(sessionId) : log2.worktreeSession, - prNumber: sessionId ? prNumbers.get(sessionId) : log2.prNumber, - prUrl: sessionId ? prUrls.get(sessionId) : log2.prUrl, - prRepository: sessionId ? prRepositories.get(sessionId) : log2.prRepository, - gitBranch: mostRecentLeaf?.gitBranch ?? log2.gitBranch, - isSidechain: transcript[0]?.isSidechain ?? log2.isSidechain, - teamName: transcript[0]?.teamName ?? log2.teamName, - leafUuid: mostRecentLeaf?.uuid ?? log2.leafUuid, + summary: mostRecentLeaf ? summaries.get(mostRecentLeaf.uuid) : log.summary, + customTitle: sessionId ? customTitles.get(sessionId) : log.customTitle, + tag: sessionId ? tags.get(sessionId) : log.tag, + agentName: sessionId ? agentNames.get(sessionId) : log.agentName, + agentColor: sessionId ? agentColors.get(sessionId) : log.agentColor, + agentSetting: sessionId ? agentSettings.get(sessionId) : log.agentSetting, + mode: sessionId ? modes.get(sessionId) : log.mode, + worktreeSession: sessionId && worktreeStates.has(sessionId) ? worktreeStates.get(sessionId) : log.worktreeSession, + prNumber: sessionId ? prNumbers.get(sessionId) : log.prNumber, + prUrl: sessionId ? prUrls.get(sessionId) : log.prUrl, + prRepository: sessionId ? prRepositories.get(sessionId) : log.prRepository, + gitBranch: mostRecentLeaf?.gitBranch ?? log.gitBranch, + isSidechain: transcript[0]?.isSidechain ?? log.isSidechain, + teamName: transcript[0]?.teamName ?? log.teamName, + leafUuid: mostRecentLeaf?.uuid ?? log.leafUuid, fileHistorySnapshots: buildFileHistorySnapshotChain(fileHistorySnapshots, transcript), attributionSnapshots: buildAttributionSnapshotChain(attributionSnapshots, transcript), - contentReplacements: sessionId ? contentReplacements.get(sessionId) ?? [] : log2.contentReplacements, + contentReplacements: sessionId ? contentReplacements.get(sessionId) ?? [] : log.contentReplacements, contextCollapseCommits: sessionId ? contextCollapseCommits.filter((e) => e.sessionId === sessionId) : undefined, contextCollapseSnapshot: sessionId && contextCollapseSnapshot?.sessionId === sessionId ? contextCollapseSnapshot : undefined }; } catch { - return log2; + return log; } } async function searchSessionsByCustomTitle(query2, options2) { @@ -678245,19 +600811,19 @@ async function searchSessionsByCustomTitle(query2, options2) { const allStatLogs = await getStatOnlyLogsForWorktrees(worktreePaths); const { logs: logs2 } = await enrichLogs(allStatLogs, 0, allStatLogs.length); const normalizedQuery = query2.toLowerCase().trim(); - const matchingLogs = logs2.filter((log2) => { - const title = log2.customTitle?.toLowerCase().trim(); + const matchingLogs = logs2.filter((log) => { + const title = log.customTitle?.toLowerCase().trim(); if (!title) return false; return exact ? title === normalizedQuery : title.includes(normalizedQuery); }); const sessionIdToLog = new Map; - for (const log2 of matchingLogs) { - const sessionId = getSessionIdFromLog(log2); + for (const log of matchingLogs) { + const sessionId = getSessionIdFromLog(log); if (sessionId) { const existing = sessionIdToLog.get(sessionId); - if (!existing || log2.modified > existing.modified) { - sessionIdToLog.set(sessionId, log2); + if (!existing || log.modified > existing.modified) { + sessionIdToLog.set(sessionId, log); } } } @@ -678290,8 +600856,8 @@ async function scanPreBoundaryMetadata(filePath, endOffset) { const stream4 = createReadStream3(filePath, { end: endOffset - 1 }); const metadataLines = []; let carry = null; - for await (const chunk4 of stream4) { - const chunkBuf = chunk4; + for await (const chunk3 of stream4) { + const chunkBuf = chunk3; const buf = resolveMetadataBuf(carry, chunkBuf); if (buf === null) { carry = null; @@ -678345,13 +600911,13 @@ function pickDepthOneUuidCandidate(buf, lineStart, candidates) { let inString = false; let escapeNext = false; let ci = 0; - for (let i4 = lineStart;ci < candidates.length; i4++) { - if (i4 === candidates[ci]) { + for (let i3 = lineStart;ci < candidates.length; i3++) { + if (i3 === candidates[ci]) { if (depth === 1 && !inString) return candidates[ci]; ci++; } - const b = buf[i4]; + const b = buf[i3]; if (escapeNext) { escapeNext = false; } else if (inString) { @@ -678400,8 +600966,8 @@ function walkChainBeforeParse(buf) { break; if (firstAny < 0) firstAny = next; - const after3 = next + KEY_LEN + UUID_LEN; - if (after3 + TS_SUFFIX_LEN <= lineEnd && buf.compare(TS_SUFFIX, 0, TS_SUFFIX_LEN, after3, after3 + TS_SUFFIX_LEN) === 0) { + const after2 = next + KEY_LEN + UUID_LEN; + if (after2 + TS_SUFFIX_LEN <= lineEnd && buf.compare(TS_SUFFIX, 0, TS_SUFFIX_LEN, after2, after2 + TS_SUFFIX_LEN) === 0) { if (suffix0 < 0) suffix0 = next; else @@ -678412,8 +600978,8 @@ function walkChainBeforeParse(buf) { const uk = suffixN ? pickDepthOneUuidCandidate(buf, pos, suffixN) : suffix0 >= 0 ? suffix0 : firstAny; if (uk >= 0) { const uuidStart = uk + KEY_LEN; - const uuid8 = buf.toString("latin1", uuidStart, uuidStart + UUID_LEN); - uuidToSlot.set(uuid8, msgIdx.length); + const uuid5 = buf.toString("latin1", uuidStart, uuidStart + UUID_LEN); + uuidToSlot.set(uuid5, msgIdx.length); msgIdx.push(pos, lineEnd, parentStart); } else { metaRanges.push(pos, lineEnd); @@ -678424,43 +600990,43 @@ function walkChainBeforeParse(buf) { pos = lineEnd; } let leafSlot = -1; - for (let i4 = msgIdx.length - 3;i4 >= 0; i4 -= 3) { - const sc = buf.indexOf(SIDECHAIN_TRUE, msgIdx[i4]); - if (sc === -1 || sc >= msgIdx[i4 + 1]) { - leafSlot = i4; + for (let i3 = msgIdx.length - 3;i3 >= 0; i3 -= 3) { + const sc = buf.indexOf(SIDECHAIN_TRUE, msgIdx[i3]); + if (sc === -1 || sc >= msgIdx[i3 + 1]) { + leafSlot = i3; break; } } if (leafSlot < 0) return buf; const seen = new Set; - const chain3 = new Set; + const chain2 = new Set; let chainBytes = 0; let slot = leafSlot; while (slot !== undefined) { if (seen.has(slot)) break; seen.add(slot); - chain3.add(msgIdx[slot]); + chain2.add(msgIdx[slot]); chainBytes += msgIdx[slot + 1] - msgIdx[slot]; const parentStart = msgIdx[slot + 2]; if (parentStart < 0) break; - const parent3 = buf.toString("latin1", parentStart, parentStart + UUID_LEN); - slot = uuidToSlot.get(parent3); + const parent2 = buf.toString("latin1", parentStart, parentStart + UUID_LEN); + slot = uuidToSlot.get(parent2); } if (len - chainBytes < len >> 1) return buf; const parts = []; let m = 0; - for (let i4 = 0;i4 < msgIdx.length; i4 += 3) { - const start = msgIdx[i4]; + for (let i3 = 0;i3 < msgIdx.length; i3 += 3) { + const start = msgIdx[i3]; while (m < metaRanges.length && metaRanges[m] < start) { parts.push(buf.subarray(metaRanges[m], metaRanges[m + 1])); m += 2; } - if (chain3.has(start)) { - parts.push(buf.subarray(start, msgIdx[i4 + 1])); + if (chain2.has(start)) { + parts.push(buf.subarray(start, msgIdx[i3 + 1])); } } while (m < metaRanges.length) { @@ -678493,9 +601059,9 @@ async function loadTranscriptFile(filePath, opts) { let metadataLines = null; let hasPreservedSegment = false; if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)) { - const { size: size3 } = await stat45(filePath); - if (size3 > SKIP_PRECOMPACT_THRESHOLD) { - const scan = await readTranscriptForLoad(filePath, size3); + const { size: size2 } = await stat44(filePath); + if (size2 > SKIP_PRECOMPACT_THRESHOLD) { + const scan = await readTranscriptForLoad(filePath, size2); buf = scan.postBoundaryBuf; hasPreservedSegment = scan.hasPreservedSegment; if (scan.boundaryStartOffset > 0) { @@ -678503,7 +601069,7 @@ async function loadTranscriptFile(filePath, opts) { } } } - buf ??= await readFile56(filePath); + buf ??= await readFile55(filePath); if (!opts?.keepAllLeaves && !hasPreservedSegment && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP) && buf.length > SKIP_PRECOMPACT_THRESHOLD) { buf = walkChainBeforeParse(buf); } @@ -678538,8 +601104,8 @@ async function loadTranscriptFile(filePath, opts) { const progressBridge = new Map; for (const entry of entries) { if (isLegacyProgressEntry(entry)) { - const parent3 = entry.parentUuid; - progressBridge.set(entry.uuid, parent3 && progressBridge.has(parent3) ? progressBridge.get(parent3) ?? null : parent3); + const parent2 = entry.parentUuid; + progressBridge.set(entry.uuid, parent2 && progressBridge.has(parent2) ? progressBridge.get(parent2) ?? null : parent2); continue; } if (isTranscriptMessage(entry)) { @@ -678595,7 +601161,7 @@ async function loadTranscriptFile(filePath, opts) { applyPreservedSegmentRelinks(messages); applySnipRemovals(messages); const allMessages = [...messages.values()]; - const parentUuids = new Set(allMessages.map((msg) => msg.parentUuid).filter((uuid8) => uuid8 !== null)); + const parentUuids = new Set(allMessages.map((msg) => msg.parentUuid).filter((uuid5) => uuid5 !== null)); const terminalMessages = allMessages.filter((msg) => !parentUuids.has(msg.uuid)); const leafUuids = new Set; let hasCycle = false; @@ -678668,7 +601234,7 @@ async function loadTranscriptFile(filePath, opts) { }; } async function loadSessionFile(sessionId) { - const sessionFile = join151(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`); + const sessionFile = join141(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`); return loadTranscriptFile(sessionFile); } function clearSessionMessagesCache() { @@ -678716,8 +601282,8 @@ async function loadMessageLogs(limit) { const sessionLogs = await fetchLogs(limit); const { logs: enriched } = await enrichLogs(sessionLogs, 0, sessionLogs.length); const sorted = sortLogs(enriched); - sorted.forEach((log2, i4) => { - log2.value = i4; + sorted.forEach((log, i3) => { + log.value = i3; }); return sorted; } @@ -678725,8 +601291,8 @@ async function loadAllProjectsMessageLogs(limit, options2) { if (options2?.skipIndex) { return loadAllProjectsMessageLogsFull(limit); } - const result3 = await loadAllProjectsMessageLogsProgressive(limit, options2?.initialEnrichCount ?? INITIAL_ENRICH_COUNT); - return result3.logs; + const result2 = await loadAllProjectsMessageLogsProgressive(limit, options2?.initialEnrichCount ?? INITIAL_ENRICH_COUNT); + return result2.logs; } async function loadAllProjectsMessageLogsFull(limit) { const projectsDir = getProjectsDir2(); @@ -678736,20 +601302,20 @@ async function loadAllProjectsMessageLogsFull(limit) { } catch { return []; } - const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join151(projectsDir, dirent.name)); + const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join141(projectsDir, dirent.name)); const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit))); const allLogs = logsPerProject.flat(); const deduped = new Map; - for (const log2 of allLogs) { - const key = `${log2.sessionId ?? ""}:${log2.leafUuid ?? ""}`; + for (const log of allLogs) { + const key = `${log.sessionId ?? ""}:${log.leafUuid ?? ""}`; const existing = deduped.get(key); - if (!existing || log2.modified.getTime() > existing.modified.getTime()) { - deduped.set(key, log2); + if (!existing || log.modified.getTime() > existing.modified.getTime()) { + deduped.set(key, log); } } const sorted = sortLogs([...deduped.values()]); - sorted.forEach((log2, i4) => { - log2.value = i4; + sorted.forEach((log, i3) => { + log.value = i3; }); return sorted; } @@ -678761,29 +601327,29 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount = } catch { return { logs: [], allStatLogs: [], nextIndex: 0 }; } - const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join151(projectsDir, dirent.name)); + const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join141(projectsDir, dirent.name)); const rawLogs = []; for (const projectDir of projectDirs) { rawLogs.push(...await getSessionFilesLite(projectDir, limit)); } const sorted = deduplicateLogsBySessionId(rawLogs); const { logs: logs2, nextIndex } = await enrichLogs(sorted, 0, initialEnrichCount); - logs2.forEach((log2, i4) => { - log2.value = i4; + logs2.forEach((log, i3) => { + log.value = i3; }); return { logs: logs2, allStatLogs: sorted, nextIndex }; } async function loadSameRepoMessageLogs(worktreePaths, limit, initialEnrichCount = INITIAL_ENRICH_COUNT) { - const result3 = await loadSameRepoMessageLogsProgressive(worktreePaths, limit, initialEnrichCount); - return result3.logs; + const result2 = await loadSameRepoMessageLogsProgressive(worktreePaths, limit, initialEnrichCount); + return result2.logs; } async function loadSameRepoMessageLogsProgressive(worktreePaths, limit, initialEnrichCount = INITIAL_ENRICH_COUNT) { logForDebugging(`/resume: loading sessions for cwd=${getOriginalCwd()}, worktrees=[${worktreePaths.join(", ")}]`); const allStatLogs = await getStatOnlyLogsForWorktrees(worktreePaths, limit); logForDebugging(`/resume: found ${allStatLogs.length} session files on disk`); const { logs: logs2, nextIndex } = await enrichLogs(allStatLogs, 0, initialEnrichCount); - logs2.forEach((log2, i4) => { - log2.value = i4; + logs2.forEach((log, i3) => { + log.value = i3; }); return { logs: logs2, allStatLogs, nextIndex }; } @@ -678822,7 +601388,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) { for (const { path: wtPath, prefix } of indexed) { if (dirName === prefix || dirName.startsWith(prefix + "-")) { seenDirs.add(dirName); - allLogs.push(...await getSessionFilesLite(join151(projectsDir, dirent.name), undefined, wtPath)); + allLogs.push(...await getSessionFilesLite(join141(projectsDir, dirent.name), undefined, wtPath)); break; } } @@ -678873,9 +601439,9 @@ function extractTeammateTranscriptsFromTasks(tasks2) { async function loadSubagentTranscripts(agentIds) { const results = await Promise.all(agentIds.map(async (agentId) => { try { - const result3 = await getAgentTranscript(asAgentId(agentId)); - if (result3 && result3.messages.length > 0) { - return { agentId, transcript: result3.messages }; + const result2 = await getAgentTranscript(asAgentId(agentId)); + if (result2 && result2.messages.length > 0) { + return { agentId, transcript: result2.messages }; } return null; } catch { @@ -678883,15 +601449,15 @@ async function loadSubagentTranscripts(agentIds) { } })); const transcripts = {}; - for (const result3 of results) { - if (result3) { - transcripts[result3.agentId] = result3.transcript; + for (const result2 of results) { + if (result2) { + transcripts[result2.agentId] = result2.transcript; } } return transcripts; } async function loadAllSubagentTranscriptsFromDisk() { - const subagentsDir = join151(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents"); + const subagentsDir = join141(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents"); let entries; try { entries = await readdir33(subagentsDir, { withFileTypes: true }); @@ -678934,8 +601500,8 @@ function transformMessagesForExternalTranscript(messages, replIds) { if (filtered.length === 0) return []; if (m.isVirtual) { - const { isVirtual: _omit, ...rest3 } = m; - return [{ ...rest3, message: { ...m.message, content: filtered } }]; + const { isVirtual: _omit, ...rest2 } = m; + return [{ ...rest2, message: { ...m.message, content: filtered } }]; } if (filtered !== content) { return [{ ...m, message: { ...m.message, content: filtered } }]; @@ -678949,8 +601515,8 @@ function transformMessagesForExternalTranscript(messages, replIds) { if (filtered.length === 0) return []; if (m.isVirtual) { - const { isVirtual: _omit, ...rest3 } = m; - return [{ ...rest3, message: { ...m.message, content: filtered } }]; + const { isVirtual: _omit, ...rest2 } = m; + return [{ ...rest2, message: { ...m.message, content: filtered } }]; } if (filtered !== content) { return [{ ...m, message: { ...m.message, content: filtered } }]; @@ -678958,8 +601524,8 @@ function transformMessagesForExternalTranscript(messages, replIds) { return [m]; } if ("isVirtual" in m && m.isVirtual) { - const { isVirtual: _omit, ...rest3 } = m; - return [rest3]; + const { isVirtual: _omit, ...rest2 } = m; + return [rest2]; } return [m]; }); @@ -679016,14 +601582,14 @@ async function getSessionFilesWithMtime(projectDir) { for (const dirent of dirents) { if (!dirent.isFile() || !dirent.name.endsWith(".jsonl")) continue; - const sessionId = validateUuid2(basename45(dirent.name, ".jsonl")); + const sessionId = validateUuid2(basename43(dirent.name, ".jsonl")); if (!sessionId) continue; - candidates.push({ sessionId, filePath: join151(projectDir, dirent.name) }); + candidates.push({ sessionId, filePath: join141(projectDir, dirent.name) }); } await Promise.all(candidates.map(async ({ sessionId, filePath }) => { try { - const st = await stat45(filePath); + const st = await stat44(filePath); sessionFilesMap.set(sessionId, { path: filePath, mtime: st.mtime.getTime(), @@ -679072,25 +601638,25 @@ async function loadAllLogsFromSessionFile(sessionFile, projectPathOverride) { } const logs2 = []; for (const leafMessage of leafMessages) { - const chain3 = buildConversationChain(messages, leafMessage); - if (chain3.length === 0) + const chain2 = buildConversationChain(messages, leafMessage); + if (chain2.length === 0) continue; const trailingMessages = childrenByParent.get(leafMessage.uuid); if (trailingMessages) { trailingMessages.sort((a2, b) => a2.timestamp < b.timestamp ? -1 : a2.timestamp > b.timestamp ? 1 : 0); - chain3.push(...trailingMessages); + chain2.push(...trailingMessages); } - const firstMessage = chain3[0]; + const firstMessage = chain2[0]; const sessionId = leafMessage.sessionId; logs2.push({ date: leafMessage.timestamp, - messages: removeExtraFields(chain3), + messages: removeExtraFields(chain2), fullPath: sessionFile, value: 0, created: new Date(firstMessage.timestamp), modified: new Date(leafMessage.timestamp), - firstPrompt: extractFirstPrompt2(chain3), - messageCount: countVisibleMessages(chain3), + firstPrompt: extractFirstPrompt2(chain2), + messageCount: countVisibleMessages(chain2), isSidechain: firstMessage.isSidechain ?? false, sessionId, leafUuid: leafMessage.uuid, @@ -679106,8 +601672,8 @@ async function loadAllLogsFromSessionFile(sessionFile, projectPathOverride) { prRepository: prRepositories.get(sessionId), gitBranch: leafMessage.gitBranch, projectPath: projectPathOverride ?? firstMessage.cwd, - fileHistorySnapshots: buildFileHistorySnapshotChain(fileHistorySnapshots, chain3), - attributionSnapshots: buildAttributionSnapshotChain(attributionSnapshots, chain3), + fileHistorySnapshots: buildFileHistorySnapshotChain(fileHistorySnapshots, chain2), + attributionSnapshots: buildAttributionSnapshotChain(attributionSnapshots, chain2), contentReplacements: contentReplacements.get(sessionId) ?? [] }); } @@ -679135,29 +601701,29 @@ async function getLogsWithoutIndex(projectDir, limit) { return logs2; } async function readLiteMetadata(filePath, fileSize, buf) { - const { head: head3, tail: tail3 } = await readHeadAndTail(filePath, fileSize, buf); - if (!head3) + const { head: head2, tail: tail2 } = await readHeadAndTail(filePath, fileSize, buf); + if (!head2) return { firstPrompt: "", isSidechain: false }; - const isSidechain = head3.includes('"isSidechain":true') || head3.includes('"isSidechain": true'); - const projectPath = extractJsonStringField(head3, "cwd"); - const teamName = extractJsonStringField(head3, "teamName"); - const agentSetting = extractJsonStringField(head3, "agentSetting"); - const firstPrompt = extractLastJsonStringField(tail3, "lastPrompt") || extractFirstPromptFromChunk(head3) || extractJsonStringFieldPrefix(head3, "content", 200) || extractJsonStringFieldPrefix(head3, "text", 200) || ""; - const customTitle = extractLastJsonStringField(tail3, "customTitle") ?? extractLastJsonStringField(head3, "customTitle") ?? extractLastJsonStringField(tail3, "aiTitle") ?? extractLastJsonStringField(head3, "aiTitle"); - const summary = extractLastJsonStringField(tail3, "summary"); - const tag3 = extractLastJsonStringField(tail3, "tag"); - const gitBranch = extractLastJsonStringField(tail3, "gitBranch") ?? extractJsonStringField(head3, "gitBranch"); - const prUrl = extractLastJsonStringField(tail3, "prUrl"); - const prRepository = extractLastJsonStringField(tail3, "prRepository"); + const isSidechain = head2.includes('"isSidechain":true') || head2.includes('"isSidechain": true'); + const projectPath = extractJsonStringField(head2, "cwd"); + const teamName = extractJsonStringField(head2, "teamName"); + const agentSetting = extractJsonStringField(head2, "agentSetting"); + const firstPrompt = extractLastJsonStringField(tail2, "lastPrompt") || extractFirstPromptFromChunk(head2) || extractJsonStringFieldPrefix(head2, "content", 200) || extractJsonStringFieldPrefix(head2, "text", 200) || ""; + const customTitle = extractLastJsonStringField(tail2, "customTitle") ?? extractLastJsonStringField(head2, "customTitle") ?? extractLastJsonStringField(tail2, "aiTitle") ?? extractLastJsonStringField(head2, "aiTitle"); + const summary = extractLastJsonStringField(tail2, "summary"); + const tag3 = extractLastJsonStringField(tail2, "tag"); + const gitBranch = extractLastJsonStringField(tail2, "gitBranch") ?? extractJsonStringField(head2, "gitBranch"); + const prUrl = extractLastJsonStringField(tail2, "prUrl"); + const prRepository = extractLastJsonStringField(tail2, "prRepository"); let prNumber; - const prNumStr = extractLastJsonStringField(tail3, "prNumber"); + const prNumStr = extractLastJsonStringField(tail2, "prNumber"); if (prNumStr) { prNumber = parseInt(prNumStr, 10) || undefined; } if (!prNumber) { - const prNumMatch = tail3.lastIndexOf('"prNumber":'); + const prNumMatch = tail2.lastIndexOf('"prNumber":'); if (prNumMatch >= 0) { - const afterColon = tail3.slice(prNumMatch + 11, prNumMatch + 25); + const afterColon = tail2.slice(prNumMatch + 11, prNumMatch + 25); const num = parseInt(afterColon.trim(), 10); if (num > 0) prNumber = num; @@ -679178,15 +601744,15 @@ async function readLiteMetadata(filePath, fileSize, buf) { prRepository }; } -function extractFirstPromptFromChunk(chunk4) { +function extractFirstPromptFromChunk(chunk3) { let start = 0; let hasTickMessages = false; let firstCommandFallback = ""; - while (start < chunk4.length) { - const newlineIdx = chunk4.indexOf(` + while (start < chunk3.length) { + const newlineIdx = chunk3.indexOf(` `, start); - const line = newlineIdx >= 0 ? chunk4.slice(start, newlineIdx) : chunk4.slice(start); - start = newlineIdx >= 0 ? newlineIdx + 1 : chunk4.length; + const line = newlineIdx >= 0 ? chunk3.slice(start, newlineIdx) : chunk3.slice(start); + start = newlineIdx >= 0 ? newlineIdx + 1 : chunk3.length; if (!line.includes('"type":"user"') && !line.includes('"type": "user"')) { continue; } @@ -679213,14 +601779,14 @@ function extractFirstPromptFromChunk(chunk4) { } } } - for (const text2 of texts) { - if (!text2) + for (const text of texts) { + if (!text) continue; - let result3 = text2.replace(/\n/g, " ").trim(); - const commandNameTag = extractTag(result3, COMMAND_NAME_TAG); + let result2 = text.replace(/\n/g, " ").trim(); + const commandNameTag = extractTag(result2, COMMAND_NAME_TAG); if (commandNameTag) { const name = commandNameTag.replace(/^\//, ""); - const commandArgs = extractTag(result3, "command-args")?.trim() || ""; + const commandArgs = extractTag(result2, "command-args")?.trim() || ""; if (builtInCommandNames().has(name) || !commandArgs) { if (!firstCommandFallback) { firstCommandFallback = commandNameTag; @@ -679229,18 +601795,18 @@ function extractFirstPromptFromChunk(chunk4) { } return commandArgs ? `${commandNameTag} ${commandArgs}` : commandNameTag; } - const bashInput = extractTag(result3, "bash-input"); + const bashInput = extractTag(result2, "bash-input"); if (bashInput) return `! ${bashInput}`; - if (SKIP_FIRST_PROMPT_PATTERN.test(result3)) { - if ((feature("PROACTIVE") || feature("KAIROS")) && result3.startsWith(`<${TICK_TAG}>`)) + if (SKIP_FIRST_PROMPT_PATTERN.test(result2)) { + if ((feature("PROACTIVE") || feature("KAIROS")) && result2.startsWith(`<${TICK_TAG}>`)) hasTickMessages = true; continue; } - if (result3.length > 200) { - result3 = result3.slice(0, 200).trim() + "…"; + if (result2.length > 200) { + result2 = result2.slice(0, 200).trim() + "…"; } - return result3; + return result2; } } catch { continue; @@ -679252,44 +601818,44 @@ function extractFirstPromptFromChunk(chunk4) { return "Proactive session"; return ""; } -function extractJsonStringFieldPrefix(text2, key, maxLen) { +function extractJsonStringFieldPrefix(text, key, maxLen) { const patterns = [`"${key}":"`, `"${key}": "`]; for (const pattern of patterns) { - const idx = text2.indexOf(pattern); + const idx = text.indexOf(pattern); if (idx < 0) continue; const valueStart = idx + pattern.length; - let i4 = valueStart; + let i3 = valueStart; let collected = 0; - while (i4 < text2.length && collected < maxLen) { - if (text2[i4] === "\\") { - i4 += 2; + while (i3 < text.length && collected < maxLen) { + if (text[i3] === "\\") { + i3 += 2; collected++; continue; } - if (text2[i4] === '"') + if (text[i3] === '"') break; - i4++; + i3++; collected++; } - const raw = text2.slice(valueStart, i4); + const raw = text.slice(valueStart, i3); return raw.replace(/\\n/g, " ").replace(/\\t/g, " ").trim(); } return ""; } function deduplicateLogsBySessionId(logs2) { const deduped = new Map; - for (const log2 of logs2) { - if (!log2.sessionId) + for (const log of logs2) { + if (!log.sessionId) continue; - const existing = deduped.get(log2.sessionId); - if (!existing || log2.modified.getTime() > existing.modified.getTime()) { - deduped.set(log2.sessionId, log2); + const existing = deduped.get(log.sessionId); + if (!existing || log.modified.getTime() > existing.modified.getTime()) { + deduped.set(log.sessionId, log); } } - return sortLogs([...deduped.values()]).map((log2, i4) => ({ - ...log2, - value: i4 + return sortLogs([...deduped.values()]).map((log, i3) => ({ + ...log, + value: i3 })); } async function getSessionFilesLite(projectDir, limit, projectPath) { @@ -679317,17 +601883,17 @@ async function getSessionFilesLite(projectDir, limit, projectPath) { }); } const sorted = sortLogs(logs2); - sorted.forEach((log2, i4) => { - log2.value = i4; + sorted.forEach((log, i3) => { + log.value = i3; }); return sorted; } -async function enrichLog(log2, readBuf) { - if (!log2.isLite || !log2.fullPath) - return log2; - const meta = await readLiteMetadata(log2.fullPath, log2.fileSize ?? 0, readBuf); +async function enrichLog(log, readBuf) { + if (!log.isLite || !log.fullPath) + return log; + const meta = await readLiteMetadata(log.fullPath, log.fileSize ?? 0, readBuf); const enriched = { - ...log2, + ...log, isLite: false, firstPrompt: meta.firstPrompt, gitBranch: meta.gitBranch, @@ -679340,41 +601906,41 @@ async function enrichLog(log2, readBuf) { prNumber: meta.prNumber, prUrl: meta.prUrl, prRepository: meta.prRepository, - projectPath: meta.projectPath ?? log2.projectPath + projectPath: meta.projectPath ?? log.projectPath }; if (!enriched.firstPrompt && !enriched.customTitle) { enriched.firstPrompt = "(session)"; } if (enriched.isSidechain) { - logForDebugging(`Session ${log2.sessionId} filtered from /resume: isSidechain=true`); + logForDebugging(`Session ${log.sessionId} filtered from /resume: isSidechain=true`); return null; } if (enriched.teamName) { - logForDebugging(`Session ${log2.sessionId} filtered from /resume: teamName=${enriched.teamName}`); + logForDebugging(`Session ${log.sessionId} filtered from /resume: teamName=${enriched.teamName}`); return null; } return enriched; } async function enrichLogs(allLogs, startIndex, count4) { - const result3 = []; + const result2 = []; const readBuf = Buffer.alloc(LITE_READ_BUF_SIZE); - let i4 = startIndex; - while (i4 < allLogs.length && result3.length < count4) { - const log2 = allLogs[i4]; - i4++; - const enriched = await enrichLog(log2, readBuf); + let i3 = startIndex; + while (i3 < allLogs.length && result2.length < count4) { + const log = allLogs[i3]; + i3++; + const enriched = await enrichLog(log, readBuf); if (enriched) { - result3.push(enriched); + result2.push(enriched); } } - const scanned = i4 - startIndex; - const filtered = scanned - result3.length; + const scanned = i3 - startIndex; + const filtered = scanned - result2.length; if (filtered > 0) { - logForDebugging(`/resume: enriched ${scanned} sessions, ${filtered} filtered out, ${result3.length} visible (${allLogs.length - i4} remaining on disk)`); + logForDebugging(`/resume: enriched ${scanned} sessions, ${filtered} filtered out, ${result2.length} visible (${allLogs.length - i3} remaining on disk)`); } - return { logs: result3, nextIndex: i4 }; + return { logs: result2, nextIndex: i3 }; } -var VERSION8, MAX_TOMBSTONE_REWRITE_BYTES, SKIP_FIRST_PROMPT_PATTERN, EPHEMERAL_PROGRESS_TYPES, MAX_TRANSCRIPT_READ_BYTES, agentTranscriptSubdirs, getProjectDir2, project = null, cleanupRegistered5 = false, REMOTE_FLUSH_INTERVAL_MS = 10, METADATA_TYPE_MARKERS, METADATA_MARKER_BUFS, METADATA_PREFIX_BOUND = 25, getSessionMessages, INITIAL_ENRICH_COUNT = 50; +var VERSION6, MAX_TOMBSTONE_REWRITE_BYTES, SKIP_FIRST_PROMPT_PATTERN, EPHEMERAL_PROGRESS_TYPES, MAX_TRANSCRIPT_READ_BYTES, agentTranscriptSubdirs, getProjectDir2, project = null, cleanupRegistered4 = false, REMOTE_FLUSH_INTERVAL_MS = 10, METADATA_TYPE_MARKERS, METADATA_MARKER_BUFS, METADATA_PREFIX_BOUND = 25, getSessionMessages, INITIAL_ENRICH_COUNT = 50; var init_sessionStorage = __esm(() => { init_bun_bundle(); init_memoize(); @@ -679384,7 +601950,7 @@ var init_sessionStorage = __esm(() => { init_xml(); init_growthbook(); init_sessionIngress(); - init_constants6(); + init_constants5(); init_ids(); init_cleanupRegistry(); init_concurrentSessions(); @@ -679400,13 +601966,13 @@ var init_sessionStorage = __esm(() => { init_gracefulShutdown(); init_json(); init_log3(); - init_messages5(); + init_messages3(); init_path2(); init_sessionStoragePortable(); init_settings2(); init_slowOperations(); - init_uuid2(); - VERSION8 = typeof MACRO !== "undefined" ? "2.1.88-custom" : "unknown"; + init_uuid(); + VERSION6 = typeof MACRO !== "undefined" ? "2.1.88-custom" : "unknown"; MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024; SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/; EPHEMERAL_PROGRESS_TYPES = new Set([ @@ -679418,7 +601984,7 @@ var init_sessionStorage = __esm(() => { MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024; agentTranscriptSubdirs = new Map; getProjectDir2 = memoize_default((projectDir) => { - return join151(getProjectsDir2(), sanitizePath2(projectDir)); + return join141(getProjectsDir2(), sanitizePath2(projectDir)); }); METADATA_TYPE_MARKERS = [ '"type":"summary"', @@ -679523,7 +602089,7 @@ var init_teamMemPrompts = __esm(() => { }); // src/memdir/memdir.ts -import { join as join152 } from "path"; +import { join as join142 } from "path"; function truncateEntrypointContent(raw) { const trimmed = raw.trim(); const contentLines = trimmed.split(` @@ -679560,17 +602126,17 @@ function truncateEntrypointContent(raw) { }; } async function ensureMemoryDirExists(memoryDir) { - const fs12 = getFsImplementation(); + const fs6 = getFsImplementation(); try { - await fs12.mkdir(memoryDir); + await fs6.mkdir(memoryDir); } catch (e) { const code = e instanceof Error && "code" in e && typeof e.code === "string" ? e.code : undefined; logForDebugging(`ensureMemoryDirExists failed for ${memoryDir}: ${code ?? String(e)}`, { level: "debug" }); } } function logMemoryDirCounts(memoryDir, baseMetadata2) { - const fs12 = getFsImplementation(); - fs12.readdir(memoryDir).then((dirents) => { + const fs6 = getFsImplementation(); + fs6.readdir(memoryDir).then((dirents) => { let fileCount = 0; let subdirCount = 0; for (const d of dirents) { @@ -679649,11 +602215,11 @@ function buildMemoryLines(displayName, memoryDir, extraGuidelines, skipIndex = f } function buildMemoryPrompt(params) { const { displayName, memoryDir, extraGuidelines } = params; - const fs12 = getFsImplementation(); + const fs6 = getFsImplementation(); const entrypoint = memoryDir + ENTRYPOINT_NAME; let entrypointContent = ""; try { - entrypointContent = fs12.readFileSync(entrypoint, { encoding: "utf-8" }); + entrypointContent = fs6.readFileSync(entrypoint, { encoding: "utf-8" }); } catch {} const lines = buildMemoryLines(displayName, memoryDir, extraGuidelines); if (entrypointContent.trim()) { @@ -679675,7 +602241,7 @@ function buildMemoryPrompt(params) { } function buildAssistantDailyLogPrompt(skipIndex = false) { const memoryDir = getAutoMemPath(); - const logPathPattern = join152(memoryDir, "logs", "YYYY", "MM", "YYYY-MM-DD.md"); + const logPathPattern = join142(memoryDir, "logs", "YYYY", "MM", "YYYY-MM-DD.md"); const lines = [ "# auto memory", "", @@ -679784,7 +602350,7 @@ var init_memdir = __esm(() => { init_growthbook(); init_analytics(); init_prompt2(); - init_constants6(); + init_constants5(); init_debug(); init_embeddedTools(); init_envUtils(); @@ -679797,41 +602363,41 @@ var init_memdir = __esm(() => { }); // src/tools/AgentTool/agentMemory.ts -import { join as join153, normalize as normalize14, sep as sep36 } from "path"; +import { join as join143, normalize as normalize13, sep as sep33 } from "path"; function sanitizeAgentTypeForPath(agentType) { return agentType.replace(/:/g, "-"); } function getLocalAgentMemoryDir(dirName) { if (process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR) { - return join153(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep36; + return join143(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep33; } - return join153(getCwd(), ".claude", "agent-memory-local", dirName) + sep36; + return join143(getCwd(), ".claude", "agent-memory-local", dirName) + sep33; } function getAgentMemoryDir(agentType, scope) { const dirName = sanitizeAgentTypeForPath(agentType); switch (scope) { case "project": - return join153(getCwd(), ".claude", "agent-memory", dirName) + sep36; + return join143(getCwd(), ".claude", "agent-memory", dirName) + sep33; case "local": return getLocalAgentMemoryDir(dirName); case "user": - return join153(getMemoryBaseDir(), "agent-memory", dirName) + sep36; + return join143(getMemoryBaseDir(), "agent-memory", dirName) + sep33; } } function isAgentMemoryPath(absolutePath) { - const normalizedPath = normalize14(absolutePath); + const normalizedPath = normalize13(absolutePath); const memoryBase = getMemoryBaseDir(); - if (normalizedPath.startsWith(join153(memoryBase, "agent-memory") + sep36)) { + if (normalizedPath.startsWith(join143(memoryBase, "agent-memory") + sep33)) { return true; } - if (normalizedPath.startsWith(join153(getCwd(), ".claude", "agent-memory") + sep36)) { + if (normalizedPath.startsWith(join143(getCwd(), ".claude", "agent-memory") + sep33)) { return true; } if (process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR) { - if (normalizedPath.includes(sep36 + "agent-memory-local" + sep36) && normalizedPath.startsWith(join153(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects") + sep36)) { + if (normalizedPath.includes(sep33 + "agent-memory-local" + sep33) && normalizedPath.startsWith(join143(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects") + sep33)) { return true; } - } else if (normalizedPath.startsWith(join153(getCwd(), ".claude", "agent-memory-local") + sep36)) { + } else if (normalizedPath.startsWith(join143(getCwd(), ".claude", "agent-memory-local") + sep33)) { return true; } return false; @@ -679839,7 +602405,7 @@ function isAgentMemoryPath(absolutePath) { function getMemoryScopeDisplay(memory2) { switch (memory2) { case "user": - return `User (${join153(getMemoryBaseDir(), "agent-memory")}/)`; + return `User (${join143(getMemoryBaseDir(), "agent-memory")}/)`; case "project": return "Project (.claude/agent-memory/)"; case "local": @@ -679880,36 +602446,36 @@ var init_agentMemory = __esm(() => { }); // src/utils/permissions/filesystem.ts -import { randomBytes as randomBytes19 } from "crypto"; -import { homedir as homedir35, tmpdir as tmpdir13 } from "os"; -import { join as join154, normalize as normalize15, posix as posix8, sep as sep37 } from "path"; -function normalizeCaseForComparison2(path26) { - return path26.toLowerCase(); +import { randomBytes as randomBytes18 } from "crypto"; +import { homedir as homedir33, tmpdir as tmpdir10 } from "os"; +import { join as join144, normalize as normalize14, posix as posix8, sep as sep34 } from "path"; +function normalizeCaseForComparison(path21) { + return path21.toLowerCase(); } function getClaudeSkillScope(filePath) { const absolutePath = expandPath(filePath); - const absolutePathLower = normalizeCaseForComparison2(absolutePath); + const absolutePathLower = normalizeCaseForComparison(absolutePath); const bases = [ { - dir: expandPath(join154(getOriginalCwd(), ".claude", "skills")), + dir: expandPath(join144(getOriginalCwd(), ".claude", "skills")), prefix: "/.claude/skills/" }, { - dir: expandPath(join154(homedir35(), ".claude", "skills")), + dir: expandPath(join144(homedir33(), ".claude", "skills")), prefix: "~/.claude/skills/" } ]; for (const { dir, prefix } of bases) { - const dirLower = normalizeCaseForComparison2(dir); - for (const s of [sep37, "/"]) { + const dirLower = normalizeCaseForComparison(dir); + for (const s of [sep34, "/"]) { if (absolutePathLower.startsWith(dirLower + s.toLowerCase())) { - const rest3 = absolutePath.slice(dir.length + s.length); - const slash = rest3.indexOf("/"); - const bslash = sep37 === "\\" ? rest3.indexOf("\\") : -1; + const rest2 = absolutePath.slice(dir.length + s.length); + const slash = rest2.indexOf("/"); + const bslash = sep34 === "\\" ? rest2.indexOf("\\") : -1; const cut = slash === -1 ? bslash : bslash === -1 ? slash : Math.min(slash, bslash); if (cut <= 0) return null; - const skillName = rest3.slice(0, cut); + const skillName = rest2.slice(0, cut); if (!skillName || skillName === "." || skillName.includes("..")) { return null; } @@ -679929,51 +602495,51 @@ function relativePath(from, to) { } return posix8.relative(from, to); } -function toPosixPath(path26) { +function toPosixPath(path21) { if (getPlatform() === "windows") { - return windowsPathToPosixPath(path26); + return windowsPathToPosixPath(path21); } - return path26; + return path21; } function getSettingsPaths() { - return SETTING_SOURCES.map((source) => getSettingsFilePathForSource(source)).filter((path26) => path26 !== undefined); + return SETTING_SOURCES.map((source) => getSettingsFilePathForSource(source)).filter((path21) => path21 !== undefined); } function isClaudeSettingsPath(filePath) { const expandedPath = expandPath(filePath); - const normalizedPath = normalizeCaseForComparison2(expandedPath); - if (normalizedPath.endsWith(`${sep37}.claude${sep37}settings.json`) || normalizedPath.endsWith(`${sep37}.claude${sep37}settings.local.json`)) { + const normalizedPath = normalizeCaseForComparison(expandedPath); + if (normalizedPath.endsWith(`${sep34}.claude${sep34}settings.json`) || normalizedPath.endsWith(`${sep34}.claude${sep34}settings.local.json`)) { return true; } - return getSettingsPaths().some((settingsPath) => normalizeCaseForComparison2(settingsPath) === normalizedPath); + return getSettingsPaths().some((settingsPath) => normalizeCaseForComparison(settingsPath) === normalizedPath); } function isClaudeConfigFilePath(filePath) { if (isClaudeSettingsPath(filePath)) { return true; } - const commandsDir = join154(getOriginalCwd(), ".claude", "commands"); - const agentsDir = join154(getOriginalCwd(), ".claude", "agents"); - const skillsDir = join154(getOriginalCwd(), ".claude", "skills"); + const commandsDir = join144(getOriginalCwd(), ".claude", "commands"); + const agentsDir = join144(getOriginalCwd(), ".claude", "agents"); + const skillsDir = join144(getOriginalCwd(), ".claude", "skills"); return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir); } function isSessionPlanFile(absolutePath) { - const expectedPrefix = join154(getPlansDirectory(), getPlanSlug()); - const normalizedPath = normalize15(absolutePath); + const expectedPrefix = join144(getPlansDirectory(), getPlanSlug()); + const normalizedPath = normalize14(absolutePath); return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md"); } function getSessionMemoryDir() { - return join154(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep37; + return join144(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep34; } function getSessionMemoryPath() { - return join154(getSessionMemoryDir(), "summary.md"); + return join144(getSessionMemoryDir(), "summary.md"); } function isSessionMemoryPath(absolutePath) { - const normalizedPath = normalize15(absolutePath); + const normalizedPath = normalize14(absolutePath); return normalizedPath.startsWith(getSessionMemoryDir()); } function isProjectDirPath(absolutePath) { const projectDir = getProjectDir2(getCwd()); - const normalizedPath = normalize15(absolutePath); - return normalizedPath === projectDir || normalizedPath.startsWith(projectDir + sep37); + const normalizedPath = normalize14(absolutePath); + return normalizedPath === projectDir || normalizedPath.startsWith(projectDir + sep34); } function isScratchpadEnabled() { return checkStatsigFeatureGate_CACHED_MAY_BE_STALE("tengu_scratch"); @@ -679986,18 +602552,18 @@ function getClaudeTempDirName() { return `claude-${uid}`; } function getProjectTempDir() { - return join154(getClaudeTempDir(), sanitizePath2(getOriginalCwd())) + sep37; + return join144(getClaudeTempDir(), sanitizePath2(getOriginalCwd())) + sep34; } function getScratchpadDir() { - return join154(getProjectTempDir(), getSessionId(), "scratchpad"); + return join144(getProjectTempDir(), getSessionId(), "scratchpad"); } async function ensureScratchpadDir() { if (!isScratchpadEnabled()) { throw new Error("Scratchpad directory feature is not enabled"); } - const fs12 = getFsImplementation(); + const fs6 = getFsImplementation(); const scratchpadDir = getScratchpadDir(); - await fs12.mkdir(scratchpadDir, { mode: 448 }); + await fs6.mkdir(scratchpadDir, { mode: 448 }); return scratchpadDir; } function isScratchpadPath(absolutePath) { @@ -680005,26 +602571,26 @@ function isScratchpadPath(absolutePath) { return false; } const scratchpadDir = getScratchpadDir(); - const normalizedPath = normalize15(absolutePath); - return normalizedPath === scratchpadDir || normalizedPath.startsWith(scratchpadDir + sep37); + const normalizedPath = normalize14(absolutePath); + return normalizedPath === scratchpadDir || normalizedPath.startsWith(scratchpadDir + sep34); } -function isDangerousFilePathToAutoEdit(path26) { - const absolutePath = expandPath(path26); - const pathSegments = absolutePath.split(sep37); +function isDangerousFilePathToAutoEdit(path21) { + const absolutePath = expandPath(path21); + const pathSegments = absolutePath.split(sep34); const fileName = pathSegments.at(-1); - if (path26.startsWith("\\\\") || path26.startsWith("//")) { + if (path21.startsWith("\\\\") || path21.startsWith("//")) { return true; } - for (let i4 = 0;i4 < pathSegments.length; i4++) { - const segment = pathSegments[i4]; - const normalizedSegment = normalizeCaseForComparison2(segment); - for (const dir of DANGEROUS_DIRECTORIES2) { - if (normalizedSegment !== normalizeCaseForComparison2(dir)) { + for (let i3 = 0;i3 < pathSegments.length; i3++) { + const segment = pathSegments[i3]; + const normalizedSegment = normalizeCaseForComparison(segment); + for (const dir of DANGEROUS_DIRECTORIES) { + if (normalizedSegment !== normalizeCaseForComparison(dir)) { continue; } if (dir === ".claude") { - const nextSegment = pathSegments[i4 + 1]; - if (nextSegment && normalizeCaseForComparison2(nextSegment) === "worktrees") { + const nextSegment = pathSegments[i3 + 1]; + if (nextSegment && normalizeCaseForComparison(nextSegment) === "worktrees") { break; } } @@ -680032,47 +602598,47 @@ function isDangerousFilePathToAutoEdit(path26) { } } if (fileName) { - const normalizedFileName = normalizeCaseForComparison2(fileName); - if (DANGEROUS_FILES2.some((dangerousFile) => normalizeCaseForComparison2(dangerousFile) === normalizedFileName)) { + const normalizedFileName = normalizeCaseForComparison(fileName); + if (DANGEROUS_FILES.some((dangerousFile) => normalizeCaseForComparison(dangerousFile) === normalizedFileName)) { return true; } } return false; } -function hasSuspiciousWindowsPathPattern(path26) { +function hasSuspiciousWindowsPathPattern(path21) { if (getPlatform() === "windows" || getPlatform() === "wsl") { - const colonIndex = path26.indexOf(":", 2); + const colonIndex = path21.indexOf(":", 2); if (colonIndex !== -1) { return true; } } - if (/~\d/.test(path26)) { + if (/~\d/.test(path21)) { return true; } - if (path26.startsWith("\\\\?\\") || path26.startsWith("\\\\.\\") || path26.startsWith("//?/") || path26.startsWith("//./")) { + if (path21.startsWith("\\\\?\\") || path21.startsWith("\\\\.\\") || path21.startsWith("//?/") || path21.startsWith("//./")) { return true; } - if (/[.\s]+$/.test(path26)) { + if (/[.\s]+$/.test(path21)) { return true; } - if (/\.(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i.test(path26)) { + if (/\.(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i.test(path21)) { return true; } - if (/(^|\/|\\)\.{3,}(\/|\\|$)/.test(path26)) { + if (/(^|\/|\\)\.{3,}(\/|\\|$)/.test(path21)) { return true; } - if (containsVulnerableUncPath(path26)) { + if (containsVulnerableUncPath(path21)) { return true; } return false; } -function checkPathSafetyForAutoEdit(path26, precomputedPathsToCheck) { - const pathsToCheck = precomputedPathsToCheck ?? getPathsForPermissionCheck(path26); +function checkPathSafetyForAutoEdit(path21, precomputedPathsToCheck) { + const pathsToCheck = precomputedPathsToCheck ?? getPathsForPermissionCheck(path21); for (const pathToCheck of pathsToCheck) { if (hasSuspiciousWindowsPathPattern(pathToCheck)) { return { safe: false, - message: `Claude requested permissions to write to ${path26}, which contains a suspicious Windows path pattern that requires manual approval.`, + message: `Claude requested permissions to write to ${path21}, which contains a suspicious Windows path pattern that requires manual approval.`, classifierApprovable: false }; } @@ -680081,7 +602647,7 @@ function checkPathSafetyForAutoEdit(path26, precomputedPathsToCheck) { if (isClaudeConfigFilePath(pathToCheck)) { return { safe: false, - message: `Claude requested permissions to write to ${path26}, but you haven't granted it yet.`, + message: `Claude requested permissions to write to ${path21}, but you haven't granted it yet.`, classifierApprovable: true }; } @@ -680090,7 +602656,7 @@ function checkPathSafetyForAutoEdit(path26, precomputedPathsToCheck) { if (isDangerousFilePathToAutoEdit(pathToCheck)) { return { safe: false, - message: `Claude requested permissions to edit ${path26} which is a sensitive file.`, + message: `Claude requested permissions to edit ${path21} which is a sensitive file.`, classifierApprovable: true }; } @@ -680103,26 +602669,26 @@ function allWorkingDirectories(context2) { ...context2.additionalWorkingDirectories.keys() ]); } -function pathInAllowedWorkingPath(path26, toolPermissionContext, precomputedPathsToCheck) { - const pathsToCheck = precomputedPathsToCheck ?? getPathsForPermissionCheck(path26); +function pathInAllowedWorkingPath(path21, toolPermissionContext, precomputedPathsToCheck) { + const pathsToCheck = precomputedPathsToCheck ?? getPathsForPermissionCheck(path21); const workingPaths = Array.from(allWorkingDirectories(toolPermissionContext)).flatMap((wp) => getResolvedWorkingDirPaths(wp)); return pathsToCheck.every((pathToCheck) => workingPaths.some((workingPath) => pathInWorkingPath(pathToCheck, workingPath))); } -function pathInWorkingPath(path26, workingPath) { - const absolutePath = expandPath(path26); +function pathInWorkingPath(path21, workingPath) { + const absolutePath = expandPath(path21); const absoluteWorkingPath = expandPath(workingPath); const normalizedPath = absolutePath.replace(/^\/private\/var\//, "/var/").replace(/^\/private\/tmp(\/|$)/, "/tmp$1"); const normalizedWorkingPath = absoluteWorkingPath.replace(/^\/private\/var\//, "/var/").replace(/^\/private\/tmp(\/|$)/, "/tmp$1"); - const caseNormalizedPath = normalizeCaseForComparison2(normalizedPath); - const caseNormalizedWorkingPath = normalizeCaseForComparison2(normalizedWorkingPath); - const relative30 = relativePath(caseNormalizedWorkingPath, caseNormalizedPath); - if (relative30 === "") { + const caseNormalizedPath = normalizeCaseForComparison(normalizedPath); + const caseNormalizedWorkingPath = normalizeCaseForComparison(normalizedWorkingPath); + const relative28 = relativePath(caseNormalizedWorkingPath, caseNormalizedPath); + if (relative28 === "") { return true; } - if (containsPathTraversal(relative30)) { + if (containsPathTraversal(relative28)) { return false; } - return !posix8.isAbsolute(relative30); + return !posix8.isAbsolute(relative28); } function rootPathForSource(source) { switch (source) { @@ -680138,8 +602704,8 @@ function rootPathForSource(source) { return getSettingsRootPathForSource(source); } } -function prependDirSep(path26) { - return posix8.join(DIR_SEP, path26); +function prependDirSep(path21) { + return posix8.join(DIR_SEP, path21); } function normalizePatternToPath({ patternRoot, @@ -680162,8 +602728,8 @@ function normalizePatternToPath({ } } } -function normalizePatternsToPath(patternsByRoot, root3) { - const result3 = new Set(patternsByRoot.get(null) ?? []); +function normalizePatternsToPath(patternsByRoot, root2) { + const result2 = new Set(patternsByRoot.get(null) ?? []); for (const [patternRoot, patterns] of patternsByRoot.entries()) { if (patternRoot === null) { continue; @@ -680172,22 +602738,22 @@ function normalizePatternsToPath(patternsByRoot, root3) { const normalizedPattern = normalizePatternToPath({ patternRoot, pattern, - rootPath: root3 + rootPath: root2 }); if (normalizedPattern) { - result3.add(normalizedPattern); + result2.add(normalizedPattern); } } } - return Array.from(result3); + return Array.from(result2); } function getFileReadIgnorePatterns(toolPermissionContext) { const patternsByRoot = getPatternsByRoot(toolPermissionContext, "read", "deny"); - const result3 = new Map; + const result2 = new Map; for (const [patternRoot, patternMap] of patternsByRoot.entries()) { - result3.set(patternRoot, Array.from(patternMap.keys())); + result2.set(patternRoot, Array.from(patternMap.keys())); } - return result3; + return result2; } function patternWithRoot(pattern, source) { if (pattern.startsWith(`${DIR_SEP}${DIR_SEP}`)) { @@ -680209,7 +602775,7 @@ function patternWithRoot(pattern, source) { } else if (pattern.startsWith(`~${DIR_SEP}`)) { return { relativePattern: pattern.slice(1), - root: homedir35().normalize("NFC") + root: homedir33().normalize("NFC") }; } else if (pattern.startsWith(DIR_SEP)) { return { @@ -680238,23 +602804,23 @@ function getPatternsByRoot(toolPermissionContext, toolType, behavior) { const rules = getRuleByContentsForToolName(toolPermissionContext, toolName, behavior); const patternsByRoot = new Map; for (const [pattern, rule] of rules.entries()) { - const { relativePattern, root: root3 } = patternWithRoot(pattern, rule.source); - let patternsForRoot = patternsByRoot.get(root3); + const { relativePattern, root: root2 } = patternWithRoot(pattern, rule.source); + let patternsForRoot = patternsByRoot.get(root2); if (patternsForRoot === undefined) { patternsForRoot = new Map; - patternsByRoot.set(root3, patternsForRoot); + patternsByRoot.set(root2, patternsForRoot); } patternsForRoot.set(relativePattern, rule); } return patternsByRoot; } -function matchingRuleForInput(path26, toolPermissionContext, toolType, behavior) { - let fileAbsolutePath = expandPath(path26); +function matchingRuleForInput(path21, toolPermissionContext, toolType, behavior) { + let fileAbsolutePath = expandPath(path21); if (getPlatform() === "windows" && fileAbsolutePath.includes("\\")) { fileAbsolutePath = windowsPathToPosixPath(fileAbsolutePath); } const patternsByRoot = getPatternsByRoot(toolPermissionContext, toolType, behavior); - for (const [root3, patternMap] of patternsByRoot.entries()) { + for (const [root2, patternMap] of patternsByRoot.entries()) { const patterns = Array.from(patternMap.keys()).map((pattern) => { let adjustedPattern = pattern; if (adjustedPattern.endsWith("/**")) { @@ -680262,8 +602828,8 @@ function matchingRuleForInput(path26, toolPermissionContext, toolType, behavior) } return adjustedPattern; }); - const ig = import_ignore5.default().add(patterns); - const relativePathStr = relativePath(root3 ?? getCwd(), fileAbsolutePath ?? getCwd()); + const ig = import_ignore4.default().add(patterns); + const relativePathStr = relativePath(root2 ?? getCwd(), fileAbsolutePath ?? getCwd()); if (relativePathStr.startsWith(`..${DIR_SEP}`)) { continue; } @@ -680282,20 +602848,20 @@ function matchingRuleForInput(path26, toolPermissionContext, toolType, behavior) } return null; } -function checkReadPermissionForTool(tool, input11, toolPermissionContext) { +function checkReadPermissionForTool(tool, input, toolPermissionContext) { if (typeof tool.getPath !== "function") { return { behavior: "ask", message: `Claude requested permissions to use ${tool.name}, but you haven't granted it yet.` }; } - const path26 = tool.getPath(input11); - const pathsToCheck = getPathsForPermissionCheck(path26); + const path21 = tool.getPath(input); + const pathsToCheck = getPathsForPermissionCheck(path21); for (const pathToCheck of pathsToCheck) { if (pathToCheck.startsWith("\\\\") || pathToCheck.startsWith("//")) { return { behavior: "ask", - message: `Claude requested permissions to read from ${path26}, which appears to be a UNC path that could access network resources.`, + message: `Claude requested permissions to read from ${path21}, which appears to be a UNC path that could access network resources.`, decisionReason: { type: "other", reason: "UNC path detected (defense-in-depth check)" @@ -680307,7 +602873,7 @@ function checkReadPermissionForTool(tool, input11, toolPermissionContext) { if (hasSuspiciousWindowsPathPattern(pathToCheck)) { return { behavior: "ask", - message: `Claude requested permissions to read from ${path26}, which contains a suspicious Windows path pattern that requires manual approval.`, + message: `Claude requested permissions to read from ${path21}, which contains a suspicious Windows path pattern that requires manual approval.`, decisionReason: { type: "other", reason: "Path contains suspicious Windows-specific patterns (alternate data streams, short names, long path prefixes, or three or more consecutive dots) that require manual verification" @@ -680320,7 +602886,7 @@ function checkReadPermissionForTool(tool, input11, toolPermissionContext) { if (denyRule) { return { behavior: "deny", - message: `Permission to read ${path26} has been denied.`, + message: `Permission to read ${path21} has been denied.`, decisionReason: { type: "rule", rule: denyRule @@ -680333,7 +602899,7 @@ function checkReadPermissionForTool(tool, input11, toolPermissionContext) { if (askRule) { return { behavior: "ask", - message: `Claude requested permissions to read from ${path26}, but you haven't granted it yet.`, + message: `Claude requested permissions to read from ${path21}, but you haven't granted it yet.`, decisionReason: { type: "rule", rule: askRule @@ -680341,31 +602907,31 @@ function checkReadPermissionForTool(tool, input11, toolPermissionContext) { }; } } - const editResult = checkWritePermissionForTool(tool, input11, toolPermissionContext, pathsToCheck); + const editResult = checkWritePermissionForTool(tool, input, toolPermissionContext, pathsToCheck); if (editResult.behavior === "allow") { return editResult; } - const isInWorkingDir = pathInAllowedWorkingPath(path26, toolPermissionContext, pathsToCheck); + const isInWorkingDir = pathInAllowedWorkingPath(path21, toolPermissionContext, pathsToCheck); if (isInWorkingDir) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "mode", mode: "default" } }; } - const absolutePath = expandPath(path26); - const internalReadResult = checkReadableInternalPath(absolutePath, input11); + const absolutePath = expandPath(path21); + const internalReadResult = checkReadableInternalPath(absolutePath, input); if (internalReadResult.behavior !== "passthrough") { return internalReadResult; } - const allowRule = matchingRuleForInput(path26, toolPermissionContext, "read", "allow"); + const allowRule = matchingRuleForInput(path21, toolPermissionContext, "read", "allow"); if (allowRule) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "rule", rule: allowRule @@ -680374,29 +602940,29 @@ function checkReadPermissionForTool(tool, input11, toolPermissionContext) { } return { behavior: "ask", - message: `Claude requested permissions to read from ${path26}, but you haven't granted it yet.`, - suggestions: generateSuggestions(path26, "read", toolPermissionContext, pathsToCheck), + message: `Claude requested permissions to read from ${path21}, but you haven't granted it yet.`, + suggestions: generateSuggestions(path21, "read", toolPermissionContext, pathsToCheck), decisionReason: { type: "workingDir", reason: "Path is outside allowed working directories" } }; } -function checkWritePermissionForTool(tool, input11, toolPermissionContext, precomputedPathsToCheck) { +function checkWritePermissionForTool(tool, input, toolPermissionContext, precomputedPathsToCheck) { if (typeof tool.getPath !== "function") { return { behavior: "ask", message: `Claude requested permissions to use ${tool.name}, but you haven't granted it yet.` }; } - const path26 = tool.getPath(input11); - const pathsToCheck = precomputedPathsToCheck ?? getPathsForPermissionCheck(path26); + const path21 = tool.getPath(input); + const pathsToCheck = precomputedPathsToCheck ?? getPathsForPermissionCheck(path21); for (const pathToCheck of pathsToCheck) { const denyRule = matchingRuleForInput(pathToCheck, toolPermissionContext, "edit", "deny"); if (denyRule) { return { behavior: "deny", - message: `Permission to edit ${path26} has been denied.`, + message: `Permission to edit ${path21} has been denied.`, decisionReason: { type: "rule", rule: denyRule @@ -680404,12 +602970,12 @@ function checkWritePermissionForTool(tool, input11, toolPermissionContext, preco }; } } - const absolutePathForEdit = expandPath(path26); - const internalEditResult = checkEditableInternalPath(absolutePathForEdit, input11); + const absolutePathForEdit = expandPath(path21); + const internalEditResult = checkEditableInternalPath(absolutePathForEdit, input); if (internalEditResult.behavior !== "passthrough") { return internalEditResult; } - const claudeFolderAllowRule = matchingRuleForInput(path26, { + const claudeFolderAllowRule = matchingRuleForInput(path21, { ...toolPermissionContext, alwaysAllowRules: { session: toolPermissionContext.alwaysAllowRules.session ?? [] @@ -680420,7 +602986,7 @@ function checkWritePermissionForTool(tool, input11, toolPermissionContext, preco if (ruleContent && (ruleContent.startsWith(CLAUDE_FOLDER_PERMISSION_PATTERN.slice(0, -2)) || ruleContent.startsWith(GLOBAL_CLAUDE_FOLDER_PERMISSION_PATTERN.slice(0, -2))) && !ruleContent.includes("..") && ruleContent.endsWith("/**")) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "rule", rule: claudeFolderAllowRule @@ -680428,9 +602994,9 @@ function checkWritePermissionForTool(tool, input11, toolPermissionContext, preco }; } } - const safetyCheck = checkPathSafetyForAutoEdit(path26, pathsToCheck); + const safetyCheck = checkPathSafetyForAutoEdit(path21, pathsToCheck); if (!safetyCheck.safe) { - const skillScope = getClaudeSkillScope(path26); + const skillScope = getClaudeSkillScope(path21); const safetySuggestions = skillScope ? [ { type: "addRules", @@ -680443,7 +603009,7 @@ function checkWritePermissionForTool(tool, input11, toolPermissionContext, preco behavior: "allow", destination: "session" } - ] : generateSuggestions(path26, "write", toolPermissionContext, pathsToCheck); + ] : generateSuggestions(path21, "write", toolPermissionContext, pathsToCheck); return { behavior: "ask", message: safetyCheck.message, @@ -680460,7 +603026,7 @@ function checkWritePermissionForTool(tool, input11, toolPermissionContext, preco if (askRule) { return { behavior: "ask", - message: `Claude requested permissions to write to ${path26}, but you haven't granted it yet.`, + message: `Claude requested permissions to write to ${path21}, but you haven't granted it yet.`, decisionReason: { type: "rule", rule: askRule @@ -680468,22 +603034,22 @@ function checkWritePermissionForTool(tool, input11, toolPermissionContext, preco }; } } - const isInWorkingDir = pathInAllowedWorkingPath(path26, toolPermissionContext, pathsToCheck); + const isInWorkingDir = pathInAllowedWorkingPath(path21, toolPermissionContext, pathsToCheck); if (toolPermissionContext.mode === "acceptEdits" && isInWorkingDir) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "mode", mode: toolPermissionContext.mode } }; } - const allowRule = matchingRuleForInput(path26, toolPermissionContext, "edit", "allow"); + const allowRule = matchingRuleForInput(path21, toolPermissionContext, "edit", "allow"); if (allowRule) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "rule", rule: allowRule @@ -680492,8 +603058,8 @@ function checkWritePermissionForTool(tool, input11, toolPermissionContext, preco } return { behavior: "ask", - message: `Claude requested permissions to write to ${path26}, but you haven't granted it yet.`, - suggestions: generateSuggestions(path26, "write", toolPermissionContext, pathsToCheck), + message: `Claude requested permissions to write to ${path21}, but you haven't granted it yet.`, + suggestions: generateSuggestions(path21, "write", toolPermissionContext, pathsToCheck), decisionReason: !isInWorkingDir ? { type: "workingDir", reason: "Path is outside allowed working directories" @@ -680524,12 +603090,12 @@ function generateSuggestions(filePath, operationType, toolPermissionContext, pre } return shouldSuggestAcceptEdits ? [{ type: "setMode", mode: "acceptEdits", destination: "session" }] : []; } -function checkEditableInternalPath(absolutePath, input11) { - const normalizedPath = normalize15(absolutePath); +function checkEditableInternalPath(absolutePath, input) { + const normalizedPath = normalize14(absolutePath); if (isSessionPlanFile(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Plan files for current session are allowed for writing" @@ -680539,7 +603105,7 @@ function checkEditableInternalPath(absolutePath, input11) { if (isScratchpadPath(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Scratchpad files for current session are allowed for writing" @@ -680549,20 +603115,20 @@ function checkEditableInternalPath(absolutePath, input11) { if (feature("TEMPLATES")) { const jobDir = process.env.CLAUDE_JOB_DIR; if (jobDir) { - const jobsRoot = join154(getClaudeConfigHomeDir(), "jobs"); - const jobDirForms = getPathsForPermissionCheck(jobDir).map(normalize15); - const jobsRootForms = getPathsForPermissionCheck(jobsRoot).map(normalize15); - const isUnderJobsRoot = jobDirForms.every((jd) => jobsRootForms.some((jr) => jd.startsWith(jr + sep37))); + const jobsRoot = join144(getClaudeConfigHomeDir(), "jobs"); + const jobDirForms = getPathsForPermissionCheck(jobDir).map(normalize14); + const jobsRootForms = getPathsForPermissionCheck(jobsRoot).map(normalize14); + const isUnderJobsRoot = jobDirForms.every((jd) => jobsRootForms.some((jr) => jd.startsWith(jr + sep34))); if (isUnderJobsRoot) { const targetForms = getPathsForPermissionCheck(absolutePath); const allInsideJobDir = targetForms.every((p) => { - const np = normalize15(p); - return jobDirForms.some((jd) => np === jd || np.startsWith(jd + sep37)); + const np = normalize14(p); + return jobDirForms.some((jd) => np === jd || np.startsWith(jd + sep34)); }); if (allInsideJobDir) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Job directory files for current job are allowed for writing" @@ -680575,7 +603141,7 @@ function checkEditableInternalPath(absolutePath, input11) { if (isAgentMemoryPath(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Agent memory files are allowed for writing" @@ -680585,17 +603151,17 @@ function checkEditableInternalPath(absolutePath, input11) { if (!hasAutoMemPathOverride() && isAutoMemPath(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "auto memory files are allowed for writing" } }; } - if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(join154(getOriginalCwd(), ".claude", "launch.json"))) { + if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(join144(getOriginalCwd(), ".claude", "launch.json"))) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Preview launch config is allowed for writing" @@ -680604,12 +603170,12 @@ function checkEditableInternalPath(absolutePath, input11) { } return { behavior: "passthrough", message: "" }; } -function checkReadableInternalPath(absolutePath, input11) { - const normalizedPath = normalize15(absolutePath); +function checkReadableInternalPath(absolutePath, input) { + const normalizedPath = normalize14(absolutePath); if (isSessionMemoryPath(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Session memory files are allowed for reading" @@ -680619,7 +603185,7 @@ function checkReadableInternalPath(absolutePath, input11) { if (isProjectDirPath(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Project directory files are allowed for reading" @@ -680629,7 +603195,7 @@ function checkReadableInternalPath(absolutePath, input11) { if (isSessionPlanFile(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Plan files for current session are allowed for reading" @@ -680637,11 +603203,11 @@ function checkReadableInternalPath(absolutePath, input11) { }; } const toolResultsDir = getToolResultsDir(); - const toolResultsDirWithSep = toolResultsDir.endsWith(sep37) ? toolResultsDir : toolResultsDir + sep37; + const toolResultsDirWithSep = toolResultsDir.endsWith(sep34) ? toolResultsDir : toolResultsDir + sep34; if (normalizedPath === toolResultsDir || normalizedPath.startsWith(toolResultsDirWithSep)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Tool result files are allowed for reading" @@ -680651,7 +603217,7 @@ function checkReadableInternalPath(absolutePath, input11) { if (isScratchpadPath(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Scratchpad files for current session are allowed for reading" @@ -680662,7 +603228,7 @@ function checkReadableInternalPath(absolutePath, input11) { if (normalizedPath.startsWith(projectTempDir)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Project temp directory files are allowed for reading" @@ -680672,7 +603238,7 @@ function checkReadableInternalPath(absolutePath, input11) { if (isAgentMemoryPath(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Agent memory files are allowed for reading" @@ -680682,40 +603248,40 @@ function checkReadableInternalPath(absolutePath, input11) { if (isAutoMemPath(normalizedPath)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "auto memory files are allowed for reading" } }; } - const tasksDir = join154(getClaudeConfigHomeDir(), "tasks") + sep37; + const tasksDir = join144(getClaudeConfigHomeDir(), "tasks") + sep34; if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Task files are allowed for reading" } }; } - const teamsReadDir = join154(getClaudeConfigHomeDir(), "teams") + sep37; + const teamsReadDir = join144(getClaudeConfigHomeDir(), "teams") + sep34; if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Team files are allowed for reading" } }; } - const bundledSkillsRoot = getBundledSkillsRoot() + sep37; + const bundledSkillsRoot = getBundledSkillsRoot() + sep34; if (normalizedPath.startsWith(bundledSkillsRoot)) { return { behavior: "allow", - updatedInput: input11, + updatedInput: input, decisionReason: { type: "other", reason: "Bundled skill reference files are allowed for reading" @@ -680724,10 +603290,10 @@ function checkReadableInternalPath(absolutePath, input11) { } return { behavior: "passthrough", message: "" }; } -var import_ignore5, DANGEROUS_FILES2, DANGEROUS_DIRECTORIES2, DIR_SEP, getClaudeTempDir, getBundledSkillsRoot, getResolvedWorkingDirPaths; +var import_ignore4, DANGEROUS_FILES, DANGEROUS_DIRECTORIES, DIR_SEP, getClaudeTempDir, getBundledSkillsRoot, getResolvedWorkingDirPaths; var init_filesystem = __esm(() => { init_bun_bundle(); - import_ignore5 = __toESM(require_ignore(), 1); + import_ignore4 = __toESM(require_ignore(), 1); init_memoize(); init_paths(); init_agentMemory(); @@ -680748,7 +603314,7 @@ var init_filesystem = __esm(() => { init_windowsPaths(); init_PermissionUpdate(); init_permissions2(); - DANGEROUS_FILES2 = [ + DANGEROUS_FILES = [ ".gitconfig", ".gitmodules", ".bashrc", @@ -680760,7 +603326,7 @@ var init_filesystem = __esm(() => { ".mcp.json", ".claude.json" ]; - DANGEROUS_DIRECTORIES2 = [ + DANGEROUS_DIRECTORIES = [ ".git", ".vscode", ".idea", @@ -680768,17 +603334,17 @@ var init_filesystem = __esm(() => { ]; DIR_SEP = posix8.sep; getClaudeTempDir = memoize_default(function getClaudeTempDir2() { - const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir13() : "/tmp"); - const fs12 = getFsImplementation(); + const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir10() : "/tmp"); + const fs6 = getFsImplementation(); let resolvedBaseTmpDir = baseTmpDir; try { - resolvedBaseTmpDir = fs12.realpathSync(baseTmpDir); + resolvedBaseTmpDir = fs6.realpathSync(baseTmpDir); } catch {} - return join154(resolvedBaseTmpDir, getClaudeTempDirName()) + sep37; + return join144(resolvedBaseTmpDir, getClaudeTempDirName()) + sep34; }); getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() { - const nonce = randomBytes19(16).toString("hex"); - return join154(getClaudeTempDir(), "bundled-skills", "2.1.88-custom", nonce); + const nonce = randomBytes18(16).toString("hex"); + return join144(getClaudeTempDir(), "bundled-skills", "2.1.88-custom", nonce); }); getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck); }); @@ -680788,14 +603354,14 @@ import { constants as fsConstants7 } from "fs"; import { mkdir as mkdir50, open as open16, - stat as stat46, + stat as stat45, symlink as symlink4, unlink as unlink25 } from "fs/promises"; -import { join as join155 } from "path"; +import { join as join145 } from "path"; function getTaskOutputDir() { if (_taskOutputDir === undefined) { - _taskOutputDir = join155(getProjectTempDir(), getSessionId(), "tasks"); + _taskOutputDir = join145(getProjectTempDir(), getSessionId(), "tasks"); } return _taskOutputDir; } @@ -680803,7 +603369,7 @@ async function ensureOutputDir() { await mkdir50(getTaskOutputDir(), { recursive: true }); } function getTaskOutputPath(taskId) { - return join155(getTaskOutputDir(), `${taskId}.output`); + return join145(getTaskOutputDir(), `${taskId}.output`); } function track(p) { _pendingOps.add(p); @@ -680836,8 +603402,8 @@ class DiskTaskOutput { this.#queue.push(content); } if (!this.#flushPromise) { - this.#flushPromise = new Promise((resolve45) => { - this.#flushResolve = resolve45; + this.#flushPromise = new Promise((resolve39) => { + this.#flushResolve = resolve39; }); track(this.#drain()); } @@ -680903,10 +603469,10 @@ class DiskTaskOutput { } } } finally { - const resolve45 = this.#flushResolve; + const resolve39 = this.#flushResolve; this.#flushPromise = null; this.#flushResolve = null; - resolve45(); + resolve39(); } } } @@ -680932,13 +603498,13 @@ function evictTaskOutput(taskId) { } async function getTaskOutputDelta(taskId, fromOffset, maxBytes = DEFAULT_MAX_READ_BYTES) { try { - const result3 = await readFileRange(getTaskOutputPath(taskId), fromOffset, maxBytes); - if (!result3) { + const result2 = await readFileRange(getTaskOutputPath(taskId), fromOffset, maxBytes); + if (!result2) { return { content: "", newOffset: fromOffset }; } return { - content: result3.content, - newOffset: fromOffset + result3.bytesRead + content: result2.content, + newOffset: fromOffset + result2.bytesRead }; } catch (e) { const code = getErrnoCode(e); @@ -680987,8 +603553,8 @@ function initTaskOutputAsSymlink(taskId, targetPath) { await symlink4(targetPath, outputPath); } return outputPath; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return initTaskOutput(taskId); } })()); @@ -681008,7 +603574,7 @@ var init_diskOutput = __esm(() => { }); // src/Task.ts -import { randomBytes as randomBytes20 } from "crypto"; +import { randomBytes as randomBytes19 } from "crypto"; function isTerminalTaskStatus(status2) { return status2 === "completed" || status2 === "failed" || status2 === "killed"; } @@ -681017,10 +603583,10 @@ function getTaskIdPrefix(type) { } function generateTaskId(type) { const prefix = getTaskIdPrefix(type); - const bytes = randomBytes20(8); + const bytes = randomBytes19(8); let id = prefix; - for (let i4 = 0;i4 < 8; i4++) { - id += TASK_ID_ALPHABET2[bytes[i4] % TASK_ID_ALPHABET2.length]; + for (let i3 = 0;i3 < 8; i3++) { + id += TASK_ID_ALPHABET2[bytes[i3] % TASK_ID_ALPHABET2.length]; } return id; } @@ -681052,7 +603618,7 @@ var init_Task = __esm(() => { }); // src/utils/ShellCommand.ts -import { stat as stat47 } from "fs/promises"; +import { stat as stat46 } from "fs/promises"; function prependStderr(prefix, stderr) { return stderr ? `${prefix} ${stderr}` : prefix; } @@ -681176,7 +603742,7 @@ class ShellCommandImpl { } #startSizeWatchdog() { this.#sizeWatchdog = setInterval(() => { - stat47(this.taskOutput.path).then((s) => { + stat46(this.taskOutput.path).then((s) => { if (s.size > this.#maxOutputBytes && this.#status === "backgrounded" && this.#sizeWatchdog !== null) { this.#killedForSize = true; this.#clearSizeWatchdog(); @@ -681194,11 +603760,11 @@ class ShellCommandImpl { this.#childProcess.once("exit", this.#exitHandler.bind(this)); this.#childProcess.once("error", this.#errorHandler.bind(this)); this.#timeoutId = setTimeout(ShellCommandImpl.#handleTimeout, this.#timeout, this); - const exitPromise = new Promise((resolve45) => { - this.#exitCodeResolver = resolve45; + const exitPromise = new Promise((resolve39) => { + this.#exitCodeResolver = resolve39; }); - return new Promise((resolve45) => { - this.#resultResolver = resolve45; + return new Promise((resolve39) => { + this.#resultResolver = resolve39; exitPromise.then(this.#handleExit.bind(this)); }); } @@ -681208,7 +603774,7 @@ class ShellCommandImpl { this.#status = "completed"; } const stdout = await this.taskOutput.getStdout(); - const result3 = { + const result2 = { code, stdout, stderr: this.taskOutput.getStderr(), @@ -681219,20 +603785,20 @@ class ShellCommandImpl { if (this.taskOutput.outputFileRedundant) { this.taskOutput.deleteOutputFile(); } else { - result3.outputFilePath = this.taskOutput.path; - result3.outputFileSize = this.taskOutput.outputFileSize; - result3.outputTaskId = this.taskOutput.taskId; + result2.outputFilePath = this.taskOutput.path; + result2.outputFileSize = this.taskOutput.outputFileSize; + result2.outputTaskId = this.taskOutput.taskId; } } if (this.#killedForSize) { - result3.stderr = prependStderr(`Background command killed: output file exceeded ${MAX_TASK_OUTPUT_BYTES_DISPLAY}`, result3.stderr); + result2.stderr = prependStderr(`Background command killed: output file exceeded ${MAX_TASK_OUTPUT_BYTES_DISPLAY}`, result2.stderr); } else if (code === SIGTERM) { - result3.stderr = prependStderr(`Command timed out after ${formatDuration(this.#timeout)}`, result3.stderr); + result2.stderr = prependStderr(`Command timed out after ${formatDuration(this.#timeout)}`, result2.stderr); } const resultResolver = this.#resultResolver; if (resultResolver) { this.#resultResolver = null; - resultResolver(result3); + resultResolver(result2); } } #doKill(code) { @@ -681515,7 +604081,7 @@ var init_hookHelpers = __esm(() => { init_v4(); init_SyntheticOutputTool(); init_argumentSubstitution(); - init_messages5(); + init_messages3(); init_sessionHooks(); hookResponseSchema = lazySchema(() => exports_external.object({ ok: exports_external.boolean().describe("Whether the condition was met"), @@ -681639,7 +604205,7 @@ Your response must be a JSON object matching one of the following schemas: content: "" }) }; - } catch (error46) { + } catch (error42) { cleanupSignal(); if (combinedSignal.aborted) { return { @@ -681647,10 +604213,10 @@ Your response must be a JSON object matching one of the following schemas: outcome: "cancelled" }; } - throw error46; + throw error42; } - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Hooks: Prompt hook error: ${errorMsg}`); return { hook, @@ -681674,7 +604240,7 @@ var init_execPromptHook = __esm(() => { init_debug(); init_errors(); init_json(); - init_messages5(); + init_messages3(); init_model(); init_hookHelpers(); }); @@ -681838,7 +604404,7 @@ When done, return your result using the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool with: content: "" }) }; - } catch (error46) { + } catch (error42) { parentTimeoutSignal.removeEventListener("abort", onParentTimeout); cleanupCombinedSignal(); if (combinedSignal.aborted) { @@ -681847,10 +604413,10 @@ When done, return your result using the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool with: outcome: "cancelled" }; } - throw error46; + throw error42; } - } catch (error46) { - const errorMsg = errorMessage(error46); + } catch (error42) { + const errorMsg = errorMessage(error42); logForDebugging(`Hooks: Agent hook error: ${errorMsg}`); logEvent("tengu_agent_stop_hook_error", { durationMs: Date.now() - hookStartTime, @@ -681884,7 +604450,7 @@ var init_execAgentHook = __esm(() => { init_combinedAbortSignal(); init_debug(); init_errors(); - init_messages5(); + init_messages3(); init_model(); init_permissions2(); init_sessionStorage(); @@ -681963,22 +604529,22 @@ function expandIPv6Groups(addr) { ]; } const dbl = addr.indexOf("::"); - let head3; - let tail3; + let head2; + let tail2; if (dbl === -1) { - head3 = addr.split(":"); - tail3 = []; + head2 = addr.split(":"); + tail2 = []; } else { const headStr = addr.slice(0, dbl); const tailStr = addr.slice(dbl + 2); - head3 = headStr === "" ? [] : headStr.split(":"); - tail3 = tailStr === "" ? [] : tailStr.split(":"); + head2 = headStr === "" ? [] : headStr.split(":"); + tail2 = tailStr === "" ? [] : tailStr.split(":"); } const target = 8 - tailHextets.length; - const fill3 = target - head3.length - tail3.length; - if (fill3 < 0) + const fill2 = target - head2.length - tail2.length; + if (fill2 < 0) return null; - const hex = [...head3, ...new Array(fill3).fill("0"), ...tail3]; + const hex = [...head2, ...new Array(fill2).fill("0"), ...tail2]; const nums = hex.map((h2) => parseInt(h2, 16)); if (nums.some((n3) => Number.isNaN(n3) || n3 < 0 || n3 > 65535)) { return null; @@ -682013,9 +604579,9 @@ function ssrfGuardedLookup(hostname4, options2, callback) { } return; } - dnsLookup(hostname4, { all: true }, (err3, addresses) => { - if (err3) { - callback(err3, ""); + dnsLookup(hostname4, { all: true }, (err2, addresses) => { + if (err2) { + callback(err2, ""); return; } for (const { address } of addresses) { @@ -682044,8 +604610,8 @@ function ssrfGuardedLookup(hostname4, options2, callback) { }); } function ssrfError(hostname4, address) { - const err3 = new Error(`HTTP hook blocked: ${hostname4} resolves to ${address} (private/link-local address). Loopback (127.0.0.1, ::1) is allowed for local dev.`); - return Object.assign(err3, { + const err2 = new Error(`HTTP hook blocked: ${hostname4} resolves to ${address} (private/link-local address). Loopback (127.0.0.1, ::1) is allowed for local dev.`); + return Object.assign(err2, { code: "ERR_HTTP_HOOK_BLOCKED_ADDRESS", hostname: hostname4, address @@ -682142,12 +604708,12 @@ async function execHttpHook(hook, _hookEvent, jsonInput, signal) { statusCode: response.status, body }; - } catch (error46) { + } catch (error42) { cleanup(); if (combinedSignal.aborted) { return { ok: false, body: "", aborted: true }; } - const errorMsg = errorMessage(error46); + const errorMsg = errorMessage(error42); logForDebugging(`Hooks: HTTP hook error: ${errorMsg}`, { level: "error" }); return { ok: false, body: "", error: errorMsg }; } @@ -682209,8 +604775,8 @@ __export(exports_hooks2, { executeConfigChangeHooks: () => executeConfigChangeHooks, createBaseHookInput: () => createBaseHookInput }); -import { basename as basename46 } from "path"; -import { spawn as spawn11 } from "child_process"; +import { basename as basename44 } from "path"; +import { spawn as spawn8 } from "child_process"; import { randomUUID as randomUUID34 } from "crypto"; function getSessionEndHookTimeoutMs() { const raw = process.env.CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS; @@ -682229,8 +604795,8 @@ function executeInBackground({ pluginId }) { if (asyncRewake) { - shellCommand.result.then(async (result3) => { - await new Promise((resolve45) => setImmediate(resolve45)); + shellCommand.result.then(async (result2) => { + await new Promise((resolve39) => setImmediate(resolve39)); const stdout = await shellCommand.taskOutput.getStdout(); const stderr = shellCommand.taskOutput.getStderr(); shellCommand.cleanup(); @@ -682241,10 +604807,10 @@ function executeInBackground({ output: stdout + stderr, stdout, stderr, - exitCode: result3.code, - outcome: result3.code === 0 ? "success" : "error" + exitCode: result2.code, + outcome: result2.code === 0 ? "success" : "error" }); - if (result3.code === 2) { + if (result2.code === 2) { enqueuePendingNotification({ value: wrapInSystemReminder(`Stop hook blocking error from command "${hookName}": ${stderr || stdout}`), mode: "task-notification" @@ -682295,7 +604861,7 @@ function validateHookJson(jsonString) { logForDebugging("Successfully parsed and validated hook JSON output"); return { json: validation.data }; } - const errors7 = validation.error.issues.map((err3) => ` - ${err3.path.join(".")}: ${err3.message}`).join(` + const errors7 = validation.error.issues.map((err2) => ` - ${err2.path.join(".")}: ${err2.message}`).join(` `); return { validationError: `Hook JSON output validation failed: @@ -682311,11 +604877,11 @@ function parseHookOutput(stdout) { return { plainText: stdout }; } try { - const result3 = validateHookJson(trimmed); - if ("json" in result3) { - return result3; + const result2 = validateHookJson(trimmed); + if ("json" in result2) { + return result2; } - const errorMessage3 = `${result3.validationError} + const errorMessage3 = `${result2.validationError} Expected schema: ${jsonStringify({ @@ -682365,12 +604931,12 @@ function parseHttpHookOutput(body) { return { validationError }; } try { - const result3 = validateHookJson(trimmed); - if ("json" in result3) { - return result3; + const result2 = validateHookJson(trimmed); + if ("json" in result2) { + return result2; } - logForDebugging(result3.validationError); - return result3; + logForDebugging(result2.validationError); + return result2; } catch (e) { const validationError = `HTTP hook must return valid JSON, but parsing failed: ${e}`; logForDebugging(validationError); @@ -682389,22 +604955,22 @@ function processHookJSONOutput({ exitCode, durationMs }) { - const result3 = {}; + const result2 = {}; const syncJson = json2; if (syncJson.continue === false) { - result3.preventContinuation = true; + result2.preventContinuation = true; if (syncJson.stopReason) { - result3.stopReason = syncJson.stopReason; + result2.stopReason = syncJson.stopReason; } } if (json2.decision) { switch (json2.decision) { case "approve": - result3.permissionBehavior = "allow"; + result2.permissionBehavior = "allow"; break; case "block": - result3.permissionBehavior = "deny"; - result3.blockingError = { + result2.permissionBehavior = "deny"; + result2.blockingError = { blockingError: json2.reason || "Blocked by hook", command: command8 }; @@ -682414,29 +604980,29 @@ function processHookJSONOutput({ } } if (json2.systemMessage) { - result3.systemMessage = json2.systemMessage; + result2.systemMessage = json2.systemMessage; } if (json2.hookSpecificOutput?.hookEventName === "PreToolUse" && json2.hookSpecificOutput.permissionDecision) { switch (json2.hookSpecificOutput.permissionDecision) { case "allow": - result3.permissionBehavior = "allow"; + result2.permissionBehavior = "allow"; break; case "deny": - result3.permissionBehavior = "deny"; - result3.blockingError = { + result2.permissionBehavior = "deny"; + result2.blockingError = { blockingError: json2.reason || "Blocked by hook", command: command8 }; break; case "ask": - result3.permissionBehavior = "ask"; + result2.permissionBehavior = "ask"; break; default: throw new Error(`Unknown hook permissionDecision type: ${json2.hookSpecificOutput.permissionDecision}. Valid types are: allow, deny, ask`); } } - if (result3.permissionBehavior !== undefined && json2.reason !== undefined) { - result3.hookPermissionDecisionReason = json2.reason; + if (result2.permissionBehavior !== undefined && json2.reason !== undefined) { + result2.hookPermissionDecisionReason = json2.reason; } if (json2.hookSpecificOutput) { if (expectedHookEvent && json2.hookSpecificOutput.hookEventName !== expectedHookEvent) { @@ -682447,71 +605013,71 @@ function processHookJSONOutput({ if (json2.hookSpecificOutput.permissionDecision) { switch (json2.hookSpecificOutput.permissionDecision) { case "allow": - result3.permissionBehavior = "allow"; + result2.permissionBehavior = "allow"; break; case "deny": - result3.permissionBehavior = "deny"; - result3.blockingError = { + result2.permissionBehavior = "deny"; + result2.blockingError = { blockingError: json2.hookSpecificOutput.permissionDecisionReason || json2.reason || "Blocked by hook", command: command8 }; break; case "ask": - result3.permissionBehavior = "ask"; + result2.permissionBehavior = "ask"; break; } } - result3.hookPermissionDecisionReason = json2.hookSpecificOutput.permissionDecisionReason; + result2.hookPermissionDecisionReason = json2.hookSpecificOutput.permissionDecisionReason; if (json2.hookSpecificOutput.updatedInput) { - result3.updatedInput = json2.hookSpecificOutput.updatedInput; + result2.updatedInput = json2.hookSpecificOutput.updatedInput; } - result3.additionalContext = json2.hookSpecificOutput.additionalContext; + result2.additionalContext = json2.hookSpecificOutput.additionalContext; break; case "UserPromptSubmit": - result3.additionalContext = json2.hookSpecificOutput.additionalContext; + result2.additionalContext = json2.hookSpecificOutput.additionalContext; break; case "SessionStart": - result3.additionalContext = json2.hookSpecificOutput.additionalContext; - result3.initialUserMessage = json2.hookSpecificOutput.initialUserMessage; + result2.additionalContext = json2.hookSpecificOutput.additionalContext; + result2.initialUserMessage = json2.hookSpecificOutput.initialUserMessage; if ("watchPaths" in json2.hookSpecificOutput && json2.hookSpecificOutput.watchPaths) { - result3.watchPaths = json2.hookSpecificOutput.watchPaths; + result2.watchPaths = json2.hookSpecificOutput.watchPaths; } break; case "Setup": - result3.additionalContext = json2.hookSpecificOutput.additionalContext; + result2.additionalContext = json2.hookSpecificOutput.additionalContext; break; case "SubagentStart": - result3.additionalContext = json2.hookSpecificOutput.additionalContext; + result2.additionalContext = json2.hookSpecificOutput.additionalContext; break; case "PostToolUse": - result3.additionalContext = json2.hookSpecificOutput.additionalContext; + result2.additionalContext = json2.hookSpecificOutput.additionalContext; if (json2.hookSpecificOutput.updatedMCPToolOutput) { - result3.updatedMCPToolOutput = json2.hookSpecificOutput.updatedMCPToolOutput; + result2.updatedMCPToolOutput = json2.hookSpecificOutput.updatedMCPToolOutput; } break; case "PostToolUseFailure": - result3.additionalContext = json2.hookSpecificOutput.additionalContext; + result2.additionalContext = json2.hookSpecificOutput.additionalContext; break; case "PermissionDenied": - result3.retry = json2.hookSpecificOutput.retry; + result2.retry = json2.hookSpecificOutput.retry; break; case "PermissionRequest": if (json2.hookSpecificOutput.decision) { - result3.permissionRequestResult = json2.hookSpecificOutput.decision; - result3.permissionBehavior = json2.hookSpecificOutput.decision.behavior === "allow" ? "allow" : "deny"; + result2.permissionRequestResult = json2.hookSpecificOutput.decision; + result2.permissionBehavior = json2.hookSpecificOutput.decision.behavior === "allow" ? "allow" : "deny"; if (json2.hookSpecificOutput.decision.behavior === "allow" && json2.hookSpecificOutput.decision.updatedInput) { - result3.updatedInput = json2.hookSpecificOutput.decision.updatedInput; + result2.updatedInput = json2.hookSpecificOutput.decision.updatedInput; } } break; case "Elicitation": if (json2.hookSpecificOutput.action) { - result3.elicitationResponse = { + result2.elicitationResponse = { action: json2.hookSpecificOutput.action, content: json2.hookSpecificOutput.content }; if (json2.hookSpecificOutput.action === "decline") { - result3.blockingError = { + result2.blockingError = { blockingError: json2.reason || "Elicitation denied by hook", command: command8 }; @@ -682520,12 +605086,12 @@ function processHookJSONOutput({ break; case "ElicitationResult": if (json2.hookSpecificOutput.action) { - result3.elicitationResultResponse = { + result2.elicitationResultResponse = { action: json2.hookSpecificOutput.action, content: json2.hookSpecificOutput.content }; if (json2.hookSpecificOutput.action === "decline") { - result3.blockingError = { + result2.blockingError = { blockingError: json2.reason || "Elicitation result blocked by hook", command: command8 }; @@ -682535,13 +605101,13 @@ function processHookJSONOutput({ } } return { - ...result3, - message: result3.blockingError ? createAttachmentMessage({ + ...result2, + message: result2.blockingError ? createAttachmentMessage({ type: "hook_blocking_error", hookName, toolUseID, hookEvent, - blockingError: result3.blockingError + blockingError: result2.blockingError }) : createAttachmentMessage({ type: "hook_success", hookName, @@ -682623,14 +605189,14 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo if (!pwshPath) { throw new Error(`Hook "${hook.command}" has shell: 'powershell' but no PowerShell ` + `executable (pwsh or powershell) was found on PATH. Install ` + `PowerShell, or remove "shell": "powershell" to use bash.`); } - child = spawn11(pwshPath, buildPowerShellArgs(finalCommand), { + child = spawn8(pwshPath, buildPowerShellArgs(finalCommand), { env: envVars, cwd: safeCwd, windowsHide: true }); } else { const shell = isWindows2 ? findGitBashPath() : true; - child = spawn11(finalCommand, [], { + child = spawn8(finalCommand, [], { env: envVars, cwd: safeCwd, shell, @@ -682676,8 +605242,8 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo child.stderr.setEncoding("utf8"); let initialResponseChecked = false; let asyncResolve = null; - const childIsAsyncPromise = new Promise((resolve45) => { - asyncResolve = resolve45; + const childIsAsyncPromise = new Promise((resolve39) => { + asyncResolve = resolve39; }); const processedPromptLines = new Set; let promptChain = Promise.resolve(); @@ -682707,8 +605273,8 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo const response = await reqPrompt(promptReq); child.stdin.write(jsonStringify(response) + ` `, "utf8"); - } catch (err3) { - logForDebugging(`Hooks: Prompt request handling failed: ${err3}`); + } catch (err2) { + logForDebugging(`Hooks: Prompt request handling failed: ${err2}`); child.stdin.destroy(); } }); @@ -682768,18 +605334,18 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo hookEvent, getOutput: async () => ({ stdout, stderr, output }) }); - const stdoutEndPromise = new Promise((resolve45) => { - child.stdout.on("end", () => resolve45()); + const stdoutEndPromise = new Promise((resolve39) => { + child.stdout.on("end", () => resolve39()); }); - const stderrEndPromise = new Promise((resolve45) => { - child.stderr.on("end", () => resolve45()); + const stderrEndPromise = new Promise((resolve39) => { + child.stderr.on("end", () => resolve39()); }); - const stdinWritePromise = stdinWritten ? Promise.resolve() : new Promise((resolve45, reject3) => { - child.stdin.on("error", (err3) => { + const stdinWritePromise = stdinWritten ? Promise.resolve() : new Promise((resolve39, reject2) => { + child.stdin.on("error", (err2) => { if (!requestPrompt) { - reject3(err3); + reject2(err2); } else { - logForDebugging(`Hooks: stdin error during prompt flow (likely process exited): ${err3}`); + logForDebugging(`Hooks: stdin error during prompt flow (likely process exited): ${err2}`); } }); child.stdin.write(jsonInput + ` @@ -682787,12 +605353,12 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo if (!requestPrompt) { child.stdin.end(); } - resolve45(); + resolve39(); }); - const childErrorPromise = new Promise((_, reject3) => { - child.on("error", reject3); + const childErrorPromise = new Promise((_, reject2) => { + child.on("error", reject2); }); - const childClosePromise = new Promise((resolve45) => { + const childClosePromise = new Promise((resolve39) => { let exitCode = null; child.on("close", (code) => { exitCode = code ?? 1; @@ -682800,7 +605366,7 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo const finalStdout = processedPromptLines.size === 0 ? stdout : stdout.split(` `).filter((line) => !processedPromptLines.has(line.trim())).join(` `); - resolve45({ + resolve39({ stdout: finalStdout, stderr, output, @@ -682818,17 +605384,17 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo }); } await Promise.race([stdinWritePromise, childErrorPromise]); - const result3 = await Promise.race([ + const result2 = await Promise.race([ childIsAsyncPromise, childClosePromise, childErrorPromise ]); await promptChain; - diagExitCode = result3.status; - diagAborted = result3.aborted ?? false; - return result3; - } catch (error46) { - const code = getErrnoCode(error46); + diagExitCode = result2.status; + diagAborted = result2.aborted ?? false; + return result2; + } catch (error42) { + const code = getErrnoCode(error42); diagExitCode = 1; if (code === "EPIPE") { logForDebugging("EPIPE error while writing to hook stdin (hook command likely closed early)"); @@ -682849,7 +605415,7 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo aborted: true }; } else { - const errorMsg = errorMessage(error46); + const errorMsg = errorMessage(error42); const errOutput = `Error occurred while executing hook command: ${errorMsg}`; return { stdout: "", @@ -682907,8 +605473,8 @@ async function prepareIfConditionMatcher(hookInput, tools) { } const toolName = normalizeLegacyToolName(hookInput.tool_name); const tool = tools && findToolByName(tools, hookInput.tool_name); - const input11 = tool?.inputSchema.safeParse(hookInput.tool_input); - const patternMatcher = input11?.success && tool?.preparePermissionMatcher ? await tool.preparePermissionMatcher(input11.data) : undefined; + const input = tool?.inputSchema.safeParse(hookInput.tool_input); + const patternMatcher = input?.success && tool?.preparePermissionMatcher ? await tool.preparePermissionMatcher(input.data) : undefined; return (ifCondition) => { const parsed = permissionRuleValueFromString(ifCondition); if (normalizeLegacyToolName(parsed.toolName) !== toolName) { @@ -683040,7 +605606,7 @@ async function getMatchingHooks(appState, sessionId, hookEvent, hookInput, tools matchQuery = hookInput.load_reason; break; case "FileChanged": - matchQuery = basename46(hookInput.file_path); + matchQuery = basename44(hookInput.file_path); break; default: break; @@ -683201,9 +605767,9 @@ async function* executeHooks({ getAppState: toolUseContext.getAppState, updateAttributionState: toolUseContext.updateAttributionState } : undefined; - for (const [i4, { hook }] of matchingHooks.entries()) { + for (const [i3, { hook }] of matchingHooks.entries()) { if (hook.type === "callback") { - await hook.callback(hookInput, toolUseID, signal, i4, context2); + await hook.callback(hookInput, toolUseID, signal, i3, context2); } } const totalDurationMs2 = Date.now() - batchStartTime2; @@ -683261,9 +605827,9 @@ async function* executeHooks({ } try { return jsonInputResult = { ok: true, value: jsonStringify(hookInput) }; - } catch (error46) { - logError2(Error(`Failed to stringify hook ${hookName} input`, { cause: error46 })); - return jsonInputResult = { ok: false, error: error46 }; + } catch (error42) { + logError2(Error(`Failed to stringify hook ${hookName} input`, { cause: error42 })); + return jsonInputResult = { ok: false, error: error42 }; } } const hookPromises = matchingHooks.map(async function* ({ hook, pluginRoot, pluginId, skillRoot }, hookIndex) { @@ -683499,25 +606065,25 @@ async function* executeHooks({ return; } emitHookStarted(hookId, hookName, hookEvent); - const result3 = await execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal, hookId, hookIndex, pluginRoot, pluginId, skillRoot, forceSyncExecution, boundRequestPrompt); + const result2 = await execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal, hookId, hookIndex, pluginRoot, pluginId, skillRoot, forceSyncExecution, boundRequestPrompt); cleanup?.(); const durationMs = Date.now() - hookStartMs; - if (result3.backgrounded) { + if (result2.backgrounded) { yield { outcome: "success", hook }; return; } - if (result3.aborted) { + if (result2.aborted) { emitHookResponse({ hookId, hookName, hookEvent, - output: result3.output, - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, + output: result2.output, + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, outcome: "cancelled" }); yield { @@ -683534,14 +606100,14 @@ async function* executeHooks({ }; return; } - const { json: json2, plainText, validationError } = parseHookOutput(result3.stdout); + const { json: json2, plainText, validationError } = parseHookOutput(result2.stdout); if (validationError) { emitHookResponse({ hookId, hookName, hookEvent, - output: result3.output, - stdout: result3.stdout, + output: result2.output, + stdout: result2.stdout, stderr: `JSON validation failed: ${validationError}`, exitCode: 1, outcome: "error" @@ -683553,7 +606119,7 @@ async function* executeHooks({ toolUseID, hookEvent, stderr: `JSON validation failed: ${validationError}`, - stdout: result3.stdout, + stdout: result2.stdout, exitCode: 1, command: hookCommand, durationMs @@ -683578,21 +606144,21 @@ async function* executeHooks({ toolUseID, hookEvent, expectedHookEvent: hookEvent, - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, durationMs }); - if (isSyncHookJSONOutput(json2) && !json2.suppressOutput && plainText && result3.status === 0) { + if (isSyncHookJSONOutput(json2) && !json2.suppressOutput && plainText && result2.status === 0) { const content = `${source_default.bold(hookName)} completed`; emitHookResponse({ hookId, hookName, hookEvent, - output: result3.output, - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, + output: result2.output, + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, outcome: "success" }); yield { @@ -683603,9 +606169,9 @@ async function* executeHooks({ toolUseID, hookEvent, content, - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, command: hookCommand, durationMs }), @@ -683618,11 +606184,11 @@ async function* executeHooks({ hookId, hookName, hookEvent, - output: result3.output, - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, - outcome: result3.status === 0 ? "success" : "error" + output: result2.output, + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, + outcome: result2.status === 0 ? "success" : "error" }); yield { ...processed, @@ -683631,15 +606197,15 @@ async function* executeHooks({ }; return; } - if (result3.status === 0) { + if (result2.status === 0) { emitHookResponse({ hookId, hookName, hookEvent, - output: result3.output, - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, + output: result2.output, + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, outcome: "success" }); yield { @@ -683648,10 +606214,10 @@ async function* executeHooks({ hookName, toolUseID, hookEvent, - content: result3.stdout.trim(), - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, + content: result2.stdout.trim(), + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, command: hookCommand, durationMs }), @@ -683660,20 +606226,20 @@ async function* executeHooks({ }; return; } - if (result3.status === 2) { + if (result2.status === 2) { emitHookResponse({ hookId, hookName, hookEvent, - output: result3.output, - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, + output: result2.output, + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, outcome: "error" }); yield { blockingError: { - blockingError: `[${hook.command}]: ${result3.stderr || "No stderr output"}`, + blockingError: `[${hook.command}]: ${result2.stderr || "No stderr output"}`, command: hook.command }, outcome: "blocking", @@ -683685,10 +606251,10 @@ async function* executeHooks({ hookId, hookName, hookEvent, - output: result3.output, - stdout: result3.stdout, - stderr: result3.stderr, - exitCode: result3.status, + output: result2.output, + stdout: result2.stdout, + stderr: result2.stderr, + exitCode: result2.status, outcome: "error" }); yield { @@ -683697,9 +606263,9 @@ async function* executeHooks({ hookName, toolUseID, hookEvent, - stderr: `Failed with non-blocking status code: ${result3.stderr.trim() || "No stderr output"}`, - stdout: result3.stdout, - exitCode: result3.status, + stderr: `Failed with non-blocking status code: ${result2.stderr.trim() || "No stderr output"}`, + stdout: result2.stdout, + exitCode: result2.status, command: hookCommand, durationMs }), @@ -683707,9 +606273,9 @@ async function* executeHooks({ hook }; return; - } catch (error46) { + } catch (error42) { cleanup?.(); - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); emitHookResponse({ hookId, hookName, @@ -683745,61 +606311,61 @@ async function* executeHooks({ cancelled: 0 }; let permissionBehavior; - for await (const result3 of all3(hookPromises)) { - outcomes[result3.outcome]++; - if (result3.preventContinuation) { - logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result3.hook)}) requested preventContinuation`); + for await (const result2 of all3(hookPromises)) { + outcomes[result2.outcome]++; + if (result2.preventContinuation) { + logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result2.hook)}) requested preventContinuation`); yield { preventContinuation: true, - stopReason: result3.stopReason + stopReason: result2.stopReason }; } - if (result3.blockingError) { + if (result2.blockingError) { yield { - blockingError: result3.blockingError + blockingError: result2.blockingError }; } - if (result3.message) { - yield { message: result3.message }; + if (result2.message) { + yield { message: result2.message }; } - if (result3.systemMessage) { + if (result2.systemMessage) { yield { message: createAttachmentMessage({ type: "hook_system_message", - content: result3.systemMessage, + content: result2.systemMessage, hookName, toolUseID, hookEvent }) }; } - if (result3.additionalContext) { - logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result3.hook)}) provided additionalContext (${result3.additionalContext.length} chars)`); + if (result2.additionalContext) { + logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result2.hook)}) provided additionalContext (${result2.additionalContext.length} chars)`); yield { - additionalContexts: [result3.additionalContext] + additionalContexts: [result2.additionalContext] }; } - if (result3.initialUserMessage) { - logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result3.hook)}) provided initialUserMessage (${result3.initialUserMessage.length} chars)`); + if (result2.initialUserMessage) { + logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result2.hook)}) provided initialUserMessage (${result2.initialUserMessage.length} chars)`); yield { - initialUserMessage: result3.initialUserMessage + initialUserMessage: result2.initialUserMessage }; } - if (result3.watchPaths && result3.watchPaths.length > 0) { - logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result3.hook)}) provided ${result3.watchPaths.length} watchPaths`); + if (result2.watchPaths && result2.watchPaths.length > 0) { + logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result2.hook)}) provided ${result2.watchPaths.length} watchPaths`); yield { - watchPaths: result3.watchPaths + watchPaths: result2.watchPaths }; } - if (result3.updatedMCPToolOutput) { - logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result3.hook)}) replaced MCP tool output`); + if (result2.updatedMCPToolOutput) { + logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result2.hook)}) replaced MCP tool output`); yield { - updatedMCPToolOutput: result3.updatedMCPToolOutput + updatedMCPToolOutput: result2.updatedMCPToolOutput }; } - if (result3.permissionBehavior) { - logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result3.hook)}) returned permissionDecision: ${result3.permissionBehavior}${result3.hookPermissionDecisionReason ? ` (reason: ${result3.hookPermissionDecisionReason})` : ""}`); - switch (result3.permissionBehavior) { + if (result2.permissionBehavior) { + logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result2.hook)}) returned permissionDecision: ${result2.permissionBehavior}${result2.hookPermissionDecisionReason ? ` (reason: ${result2.hookPermissionDecisionReason})` : ""}`); + switch (result2.permissionBehavior) { case "deny": permissionBehavior = "deny"; break; @@ -683818,52 +606384,52 @@ async function* executeHooks({ } } if (permissionBehavior !== undefined) { - const updatedInput = result3.updatedInput && (result3.permissionBehavior === "allow" || result3.permissionBehavior === "ask") ? result3.updatedInput : undefined; + const updatedInput = result2.updatedInput && (result2.permissionBehavior === "allow" || result2.permissionBehavior === "ask") ? result2.updatedInput : undefined; if (updatedInput) { - logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result3.hook)}) modified tool input keys: [${Object.keys(updatedInput).join(", ")}]`); + logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result2.hook)}) modified tool input keys: [${Object.keys(updatedInput).join(", ")}]`); } yield { permissionBehavior, - hookPermissionDecisionReason: result3.hookPermissionDecisionReason, - hookSource: matchingHooks.find((m) => m.hook === result3.hook)?.hookSource, + hookPermissionDecisionReason: result2.hookPermissionDecisionReason, + hookSource: matchingHooks.find((m) => m.hook === result2.hook)?.hookSource, updatedInput }; } - if (result3.updatedInput && result3.permissionBehavior === undefined) { - logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result3.hook)}) modified tool input keys: [${Object.keys(result3.updatedInput).join(", ")}]`); + if (result2.updatedInput && result2.permissionBehavior === undefined) { + logForDebugging(`Hook ${hookEvent} (${getHookDisplayText(result2.hook)}) modified tool input keys: [${Object.keys(result2.updatedInput).join(", ")}]`); yield { - updatedInput: result3.updatedInput + updatedInput: result2.updatedInput }; } - if (result3.permissionRequestResult) { + if (result2.permissionRequestResult) { yield { - permissionRequestResult: result3.permissionRequestResult + permissionRequestResult: result2.permissionRequestResult }; } - if (result3.retry) { + if (result2.retry) { yield { - retry: result3.retry + retry: result2.retry }; } - if (result3.elicitationResponse) { + if (result2.elicitationResponse) { yield { - elicitationResponse: result3.elicitationResponse + elicitationResponse: result2.elicitationResponse }; } - if (result3.elicitationResultResponse) { + if (result2.elicitationResultResponse) { yield { - elicitationResultResponse: result3.elicitationResultResponse + elicitationResultResponse: result2.elicitationResultResponse }; } - if (appState && result3.hook.type !== "callback") { + if (appState && result2.hook.type !== "callback") { const sessionId2 = getSessionId(); const matcher = matchQuery ?? ""; - const hookEntry = getSessionHookCallback(appState, sessionId2, hookEvent, matcher, result3.hook); - if (hookEntry?.onHookSuccess && result3.outcome === "success") { + const hookEntry = getSessionHookCallback(appState, sessionId2, hookEvent, matcher, result2.hook); + if (hookEntry?.onHookSuccess && result2.outcome === "success") { try { - hookEntry.onHookSuccess(result3.hook, result3); - } catch (error46) { - logError2(Error("Session hook success callback failed", { cause: error46 })); + hookEntry.onHookSuccess(result2.hook, result2); + } catch (error42) { + logError2(Error("Session hook success callback failed", { cause: error42 })); } } } @@ -683950,8 +606516,8 @@ async function executeHooksOutsideREPL({ let jsonInput; try { jsonInput = jsonStringify(hookInput); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return []; } const hookPromises = matchingHooks.map(async ({ hook, pluginRoot, pluginId }, hookIndex) => { @@ -683980,9 +606546,9 @@ async function executeHooksOutsideREPL({ output, blocked }; - } catch (error46) { + } catch (error42) { cleanup2?.(); - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); logForDebugging(`${hookName} [callback] failed to run: ${errorMessage3}`, { level: "error" }); return { command: "callback", @@ -684056,8 +606622,8 @@ async function executeHooksOutsideREPL({ output, blocked: !!jsonBlocked }; - } catch (error46) { - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); logForDebugging(`${hookName} [${hook.url}] failed to run: ${errorMessage3}`, { level: "error" }); return { command: hook.url, @@ -684070,9 +606636,9 @@ async function executeHooksOutsideREPL({ const commandTimeoutMs = hook.timeout ? hook.timeout * 1000 : timeoutMs; const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, { timeoutMs: commandTimeoutMs }); try { - const result3 = await execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal, randomUUID34(), hookIndex, pluginRoot, pluginId); + const result2 = await execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal, randomUUID34(), hookIndex, pluginRoot, pluginId); cleanup?.(); - if (result3.aborted) { + if (result2.aborted) { logForDebugging(`${hookName} [${hook.command}] cancelled`); return { command: hook.command, @@ -684081,8 +606647,8 @@ async function executeHooksOutsideREPL({ blocked: false }; } - logForDebugging(`${hookName} [${hook.command}] completed with status ${result3.status}`); - const { json: json2, validationError } = parseHookOutput(result3.stdout); + logForDebugging(`${hookName} [${hook.command}] completed with status ${result2.status}`); + const { json: json2, validationError } = parseHookOutput(result2.stdout); if (validationError) { throw new Error(validationError); } @@ -684090,21 +606656,21 @@ async function executeHooksOutsideREPL({ logForDebugging(`Parsed JSON output from hook: ${jsonStringify(json2)}`, { level: "verbose" }); } const jsonBlocked = json2 && !isAsyncHookJSONOutput(json2) && isSyncHookJSONOutput(json2) && json2.decision === "block"; - const blocked = result3.status === 2 || !!jsonBlocked; - const output = result3.status === 0 ? result3.stdout || "" : result3.stderr || ""; + const blocked = result2.status === 2 || !!jsonBlocked; + const output = result2.status === 0 ? result2.stdout || "" : result2.stderr || ""; const watchPaths = json2 && isSyncHookJSONOutput(json2) && json2.hookSpecificOutput && "watchPaths" in json2.hookSpecificOutput ? json2.hookSpecificOutput.watchPaths : undefined; const systemMessage = json2 && isSyncHookJSONOutput(json2) ? json2.systemMessage : undefined; return { command: hook.command, - succeeded: result3.status === 0, + succeeded: result2.status === 0, output, blocked, watchPaths, systemMessage }; - } catch (error46) { + } catch (error42) { cleanup?.(); - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); logForDebugging(`${hookName} [${hook.command}] failed to run: ${errorMessage3}`, { level: "error" }); return { command: hook.command, @@ -684161,7 +606727,7 @@ async function* executePostToolHooks(toolName, toolUseID, toolInput, toolRespons toolUseContext }); } -async function* executePostToolUseFailureHooks(toolName, toolUseID, toolInput, error46, toolUseContext, isInterrupt, permissionMode, signal, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS) { +async function* executePostToolUseFailureHooks(toolName, toolUseID, toolInput, error42, toolUseContext, isInterrupt, permissionMode, signal, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS) { const appState = toolUseContext.getAppState(); const sessionId = toolUseContext.agentId ?? getSessionId(); if (!hasHookForEvent("PostToolUseFailure", appState, sessionId)) { @@ -684173,7 +606739,7 @@ async function* executePostToolUseFailureHooks(toolName, toolUseID, toolInput, e tool_name: toolName, tool_input: toolInput, tool_use_id: toolUseID, - error: error46, + error: error42, is_interrupt: isInterrupt }; yield* executeHooks({ @@ -684230,11 +606796,11 @@ async function executeStopFailureHooks(lastMessage, toolUseContext, timeoutMs = return; const lastAssistantText = extractTextContent(lastMessage.message.content, ` `).trim() || undefined; - const error46 = lastMessage.error ?? "unknown"; + const error42 = lastMessage.error ?? "unknown"; const hookInput = { ...createBaseHookInput(undefined, undefined, toolUseContext), hook_event_name: "StopFailure", - error: error46, + error: error42, error_details: lastMessage.errorDetails, last_assistant_message: lastAssistantText }; @@ -684242,7 +606808,7 @@ async function executeStopFailureHooks(lastMessage, toolUseContext, timeoutMs = getAppState: toolUseContext?.getAppState, hookInput, timeoutMs, - matchQuery: error46 + matchQuery: error42 }); } async function* executeStopHooks(permissionMode, signal, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS, stopHookActive = false, subagentId, toolUseContext, messages, agentType, requestPrompt) { @@ -684412,20 +606978,20 @@ async function executePreCompactHooks(compactData, signal, timeoutMs = TOOL_HOOK if (results.length === 0) { return {}; } - const successfulOutputs = results.filter((result3) => result3.succeeded && result3.output.trim().length > 0).map((result3) => result3.output.trim()); + const successfulOutputs = results.filter((result2) => result2.succeeded && result2.output.trim().length > 0).map((result2) => result2.output.trim()); const displayMessages = []; - for (const result3 of results) { - if (result3.succeeded) { - if (result3.output.trim()) { - displayMessages.push(`PreCompact [${result3.command}] completed successfully: ${result3.output.trim()}`); + for (const result2 of results) { + if (result2.succeeded) { + if (result2.output.trim()) { + displayMessages.push(`PreCompact [${result2.command}] completed successfully: ${result2.output.trim()}`); } else { - displayMessages.push(`PreCompact [${result3.command}] completed successfully`); + displayMessages.push(`PreCompact [${result2.command}] completed successfully`); } } else { - if (result3.output.trim()) { - displayMessages.push(`PreCompact [${result3.command}] failed: ${result3.output.trim()}`); + if (result2.output.trim()) { + displayMessages.push(`PreCompact [${result2.command}] failed: ${result2.output.trim()}`); } else { - displayMessages.push(`PreCompact [${result3.command}] failed`); + displayMessages.push(`PreCompact [${result2.command}] failed`); } } } @@ -684454,18 +607020,18 @@ async function executePostCompactHooks(compactData, signal, timeoutMs = TOOL_HOO return {}; } const displayMessages = []; - for (const result3 of results) { - if (result3.succeeded) { - if (result3.output.trim()) { - displayMessages.push(`PostCompact [${result3.command}] completed successfully: ${result3.output.trim()}`); + for (const result2 of results) { + if (result2.succeeded) { + if (result2.output.trim()) { + displayMessages.push(`PostCompact [${result2.command}] completed successfully: ${result2.output.trim()}`); } else { - displayMessages.push(`PostCompact [${result3.command}] completed successfully`); + displayMessages.push(`PostCompact [${result2.command}] completed successfully`); } } else { - if (result3.output.trim()) { - displayMessages.push(`PostCompact [${result3.command}] failed: ${result3.output.trim()}`); + if (result2.output.trim()) { + displayMessages.push(`PostCompact [${result2.command}] failed: ${result2.output.trim()}`); } else { - displayMessages.push(`PostCompact [${result3.command}] failed`); + displayMessages.push(`PostCompact [${result2.command}] failed`); } } } @@ -684493,9 +607059,9 @@ async function executeSessionEndHooks(reason, options2) { signal, timeoutMs }); - for (const result3 of results) { - if (!result3.succeeded && result3.output) { - process.stderr.write(`SessionEnd hook [${result3.command}] failed: ${result3.output} + for (const result2 of results) { + if (!result2.succeeded && result2.output) { + process.stderr.write(`SessionEnd hook [${result2.command}] failed: ${result2.output} `); } } @@ -684600,19 +607166,19 @@ async function executeInstructionsLoadedHooks(filePath, memoryType, loadReason, matchQuery: loadReason }); } -function parseElicitationHookOutput(result3, expectedEventName) { - if (result3.blocked && !result3.succeeded) { +function parseElicitationHookOutput(result2, expectedEventName) { + if (result2.blocked && !result2.succeeded) { return { blockingError: { - blockingError: result3.output || `Elicitation blocked by hook`, - command: result3.command + blockingError: result2.output || `Elicitation blocked by hook`, + command: result2.command } }; } - if (!result3.output.trim()) { + if (!result2.output.trim()) { return {}; } - const trimmed = result3.output.trim(); + const trimmed = result2.output.trim(); if (!trimmed.startsWith("{")) { return {}; } @@ -684624,11 +607190,11 @@ function parseElicitationHookOutput(result3, expectedEventName) { if (!isSyncHookJSONOutput(parsed)) { return {}; } - if (parsed.decision === "block" || result3.blocked) { + if (parsed.decision === "block" || result2.blocked) { return { blockingError: { blockingError: parsed.reason || "Elicitation blocked by hook", - command: result3.command + command: result2.command } }; } @@ -684647,7 +607213,7 @@ function parseElicitationHookOutput(result3, expectedEventName) { if (specific.action === "decline") { out.blockingError = { blockingError: parsed.reason || (expectedEventName === "Elicitation" ? "Elicitation denied by hook" : "Elicitation result blocked by hook"), - command: result3.command + command: result2.command }; } return out; @@ -684684,8 +607250,8 @@ async function executeElicitationHooks({ }); let elicitationResponse; let blockingError; - for (const result3 of results) { - const parsed = parseElicitationHookOutput(result3, "Elicitation"); + for (const result2 of results) { + const parsed = parseElicitationHookOutput(result2, "Elicitation"); if (parsed.blockingError) { blockingError = parsed.blockingError; } @@ -684722,8 +607288,8 @@ async function executeElicitationResultHooks({ }); let elicitationResultResponse; let blockingError; - for (const result3 of results) { - const parsed = parseElicitationHookOutput(result3, "ElicitationResult"); + for (const result2 of results) { + const parsed = parseElicitationHookOutput(result2, "ElicitationResult"); if (parsed.blockingError) { blockingError = parsed.blockingError; } @@ -684753,26 +607319,26 @@ async function executeStatusLineCommand(statusLineInput, signal, timeoutMs = 500 const abortSignal = signal || AbortSignal.timeout(timeoutMs); try { const jsonInput = jsonStringify(statusLineInput); - const result3 = await execCommandHook(statusLine, "StatusLine", "statusLine", jsonInput, abortSignal, randomUUID34()); - if (result3.aborted) { + const result2 = await execCommandHook(statusLine, "StatusLine", "statusLine", jsonInput, abortSignal, randomUUID34()); + if (result2.aborted) { return; } - if (result3.status === 0) { - const output = result3.stdout.trim().split(` + if (result2.status === 0) { + const output = result2.stdout.trim().split(` `).flatMap((line) => line.trim() || []).join(` `); if (output) { if (logResult2) { - logForDebugging(`StatusLine [${statusLine.command}] completed with status ${result3.status}`); + logForDebugging(`StatusLine [${statusLine.command}] completed with status ${result2.status}`); } return output; } } else if (logResult2) { - logForDebugging(`StatusLine [${statusLine.command}] completed with status ${result3.status}`, { level: "warn" }); + logForDebugging(`StatusLine [${statusLine.command}] completed with status ${result2.status}`, { level: "warn" }); } return; - } catch (error46) { - logForDebugging(`Status hook failed: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Status hook failed: ${error42}`, { level: "error" }); return; } } @@ -684797,14 +607363,14 @@ async function executeFileSuggestionCommand(fileSuggestionInput, signal, timeout try { const jsonInput = jsonStringify(fileSuggestionInput); const hook = { type: "command", command: fileSuggestion.command }; - const result3 = await execCommandHook(hook, "FileSuggestion", "FileSuggestion", jsonInput, abortSignal, randomUUID34()); - if (result3.aborted || result3.status !== 0) { + const result2 = await execCommandHook(hook, "FileSuggestion", "FileSuggestion", jsonInput, abortSignal, randomUUID34()); + if (result2.aborted || result2.status !== 0) { return []; } - return result3.stdout.split(` + return result2.stdout.split(` `).map((line) => line.trim()).filter(Boolean); - } catch (error46) { - logForDebugging(`File suggestion helper failed: ${error46}`, { + } catch (error42) { + logForDebugging(`File suggestion helper failed: ${error42}`, { level: "error" }); return []; @@ -684831,15 +607397,15 @@ async function executeFunctionHook({ hook }; } - const passed = await new Promise((resolve45, reject3) => { - const onAbort = () => reject3(new Error("Function hook cancelled")); + const passed = await new Promise((resolve39, reject2) => { + const onAbort = () => reject2(new Error("Function hook cancelled")); abortSignal.addEventListener("abort", onAbort); - Promise.resolve(hook.callback(messages, abortSignal)).then((result3) => { + Promise.resolve(hook.callback(messages, abortSignal)).then((result2) => { abortSignal.removeEventListener("abort", onAbort); - resolve45(result3); - }).catch((error46) => { + resolve39(result2); + }).catch((error42) => { abortSignal.removeEventListener("abort", onAbort); - reject3(error46); + reject2(error42); }); }); cleanup(); @@ -684857,22 +607423,22 @@ async function executeFunctionHook({ outcome: "blocking", hook }; - } catch (error46) { + } catch (error42) { cleanup(); - if (error46 instanceof Error && (error46.message === "Function hook cancelled" || error46.name === "AbortError")) { + if (error42 instanceof Error && (error42.message === "Function hook cancelled" || error42.name === "AbortError")) { return { outcome: "cancelled", hook }; } - logError2(error46); + logError2(error42); return { message: createAttachmentMessage({ type: "hook_error_during_execution", hookName, toolUseID, hookEvent, - content: error46 instanceof Error ? error46.message : "Function hook execution error" + content: error42 instanceof Error ? error42.message : "Function hook execution error" }), outcome: "non_blocking_error", hook @@ -684964,9 +607530,9 @@ async function executeWorktreeRemoveHook(worktreePath) { if (results.length === 0) { return false; } - for (const result3 of results) { - if (!result3.succeeded) { - logForDebugging(`WorktreeRemove hook failed [${result3.command}]: ${result3.output.trim()}`, { level: "error" }); + for (const result2 of results) { + if (!result2.succeeded) { + logForDebugging(`WorktreeRemove hook failed [${result2.command}]: ${result2.output.trim()}`, { level: "error" }); } } return true; @@ -685023,7 +607589,7 @@ var init_hooks5 = __esm(() => { init_combinedAbortSignal(); init_AsyncHookRegistry(); init_messageQueueManager(); - init_messages5(); + init_messages3(); init_hookEvents(); init_attachments2(); init_generators(); @@ -685042,9 +607608,9 @@ var init_hooks5 = __esm(() => { var exports_postCommitAttribution = {}; __export(exports_postCommitAttribution, { default: () => postCommitAttribution_default, - __stub__: () => __stub__26 + __stub__: () => __stub__33 }); -var postCommitAttribution_default, __stub__26 = true; +var postCommitAttribution_default, __stub__33 = true; var init_postCommitAttribution = __esm(() => { postCommitAttribution_default = {}; }); @@ -685072,17 +607638,17 @@ __export(exports_worktree, { cleanupWorktree: () => cleanupWorktree, cleanupStaleAgentWorktrees: () => cleanupStaleAgentWorktrees }); -import { spawnSync as spawnSync7 } from "child_process"; +import { spawnSync as spawnSync6 } from "child_process"; import { - copyFile as copyFile11, + copyFile as copyFile10, mkdir as mkdir51, readdir as readdir34, - readFile as readFile57, - stat as stat48, + readFile as readFile56, + stat as stat47, symlink as symlink5, utimes as utimes2 } from "fs/promises"; -import { basename as basename47, dirname as dirname63, join as join156 } from "path"; +import { basename as basename45, dirname as dirname59, join as join146 } from "path"; function validateWorktreeSlug(slug) { if (slug.length > MAX_WORKTREE_SLUG_LENGTH) { throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`); @@ -685105,15 +607671,15 @@ async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) { logForDebugging(`Skipping symlink for "${dir}": path traversal detected`, { level: "warn" }); continue; } - const sourcePath = join156(repoRootPath, dir); - const destPath = join156(worktreePath, dir); + const sourcePath = join146(repoRootPath, dir); + const destPath = join146(worktreePath, dir); try { await symlink5(sourcePath, destPath, "dir"); logForDebugging(`Symlinked ${dir} from main repository to worktree to avoid disk bloat`); - } catch (error46) { - const code = getErrnoCode(error46); + } catch (error42) { + const code = getErrnoCode(error42); if (code !== "ENOENT" && code !== "EEXIST") { - logForDebugging(`Failed to symlink ${dir} (${code ?? "unknown"}): ${errorMessage(error46)}`, { level: "warn" }); + logForDebugging(`Failed to symlink ${dir} (${code ?? "unknown"}): ${errorMessage(error42)}`, { level: "warn" }); } } } @@ -685125,12 +607691,12 @@ function restoreWorktreeSession(session2) { currentWorktreeSession = session2; } function generateTmuxSessionName(repoPath, branch2) { - const repoName = basename47(repoPath); + const repoName = basename45(repoPath); const combined = `${repoName}_${branch2}`; return combined.replace(/[/.]/g, "_"); } function worktreesDir(repoRoot) { - return join156(repoRoot, ".claude", "worktrees"); + return join146(repoRoot, ".claude", "worktrees"); } function flattenSlug(slug) { return slug.replaceAll("/", "+"); @@ -685139,7 +607705,7 @@ function worktreeBranchName(slug) { return `worktree-${flattenSlug(slug)}`; } function worktreePathFor(repoRoot, slug) { - return join156(worktreesDir(repoRoot), flattenSlug(slug)); + return join146(worktreesDir(repoRoot), flattenSlug(slug)); } async function getOrCreateWorktree(repoRoot, slug, options2) { const worktreePath = worktreePathFor(repoRoot, slug); @@ -685220,7 +607786,7 @@ async function getOrCreateWorktree(repoRoot, slug, options2) { async function copyWorktreeIncludeFiles(repoRoot, worktreePath) { let includeContent; try { - includeContent = await readFile57(join156(repoRoot, ".worktreeinclude"), "utf-8"); + includeContent = await readFile56(join146(repoRoot, ".worktreeinclude"), "utf-8"); } catch { return []; } @@ -685234,9 +607800,9 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) { } const entries = gitignored.stdout.trim().split(` `).filter(Boolean); - const matcher = import_ignore6.default().add(includeContent); + const matcher = import_ignore5.default().add(includeContent); const collapsedDirs = entries.filter((e) => e.endsWith("/")); - const files3 = entries.filter((e) => !e.endsWith("/") && matcher.ignores(e)); + const files2 = entries.filter((e) => !e.endsWith("/") && matcher.ignores(e)); const dirsToExpand = collapsedDirs.filter((dir) => { if (patterns.some((p) => { const normalized = p.startsWith("/") ? p.slice(1) : p; @@ -685268,18 +607834,18 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) { for (const f of expanded.stdout.trim().split(` `).filter(Boolean)) { if (matcher.ignores(f)) { - files3.push(f); + files2.push(f); } } } } const copied = []; - for (const relativePath2 of files3) { - const srcPath = join156(repoRoot, relativePath2); - const destPath = join156(worktreePath, relativePath2); + for (const relativePath2 of files2) { + const srcPath = join146(repoRoot, relativePath2); + const destPath = join146(worktreePath, relativePath2); try { - await mkdir51(dirname63(destPath), { recursive: true }); - await copyFile11(srcPath, destPath); + await mkdir51(dirname59(destPath), { recursive: true }); + await copyFile10(srcPath, destPath); copied.push(relativePath2); } catch (e) { logForDebugging(`Failed to copy ${relativePath2} to worktree: ${e.message}`, { level: "warn" }); @@ -685292,11 +607858,11 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) { } async function performPostCreationSetup(repoRoot, worktreePath) { const localSettingsRelativePath = getRelativeSettingsFilePathForSource("localSettings"); - const sourceSettingsLocal = join156(repoRoot, localSettingsRelativePath); + const sourceSettingsLocal = join146(repoRoot, localSettingsRelativePath); try { - const destSettingsLocal = join156(worktreePath, localSettingsRelativePath); - await mkdirRecursive(dirname63(destSettingsLocal)); - await copyFile11(sourceSettingsLocal, destSettingsLocal); + const destSettingsLocal = join146(worktreePath, localSettingsRelativePath); + await mkdirRecursive(dirname59(destSettingsLocal)); + await copyFile10(sourceSettingsLocal, destSettingsLocal); logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`); } catch (e) { const code = getErrnoCode(e); @@ -685304,12 +607870,12 @@ async function performPostCreationSetup(repoRoot, worktreePath) { logForDebugging(`Failed to copy settings.local.json: ${e.message}`, { level: "warn" }); } } - const huskyPath = join156(repoRoot, ".husky"); - const gitHooksPath = join156(repoRoot, ".git", "hooks"); + const huskyPath = join146(repoRoot, ".husky"); + const gitHooksPath = join146(repoRoot, ".git", "hooks"); let hooksPath = null; for (const candidatePath of [huskyPath, gitHooksPath]) { try { - const s = await stat48(candidatePath); + const s = await stat47(candidatePath); if (s.isDirectory()) { hooksPath = candidatePath; break; @@ -685338,20 +607904,20 @@ async function performPostCreationSetup(repoRoot, worktreePath) { } await copyWorktreeIncludeFiles(repoRoot, worktreePath); if (feature("COMMIT_ATTRIBUTION")) { - const worktreeHooksDir = hooksPath === huskyPath ? join156(worktreePath, ".husky") : undefined; - Promise.resolve().then(() => (init_postCommitAttribution(), exports_postCommitAttribution)).then((m) => m.installPrepareCommitMsgHook(worktreePath, worktreeHooksDir).catch((error46) => { - logForDebugging(`Failed to install attribution hook in worktree: ${error46}`); - })).catch((error46) => { - logForDebugging(`Failed to load postCommitAttribution module: ${error46}`); + const worktreeHooksDir = hooksPath === huskyPath ? join146(worktreePath, ".husky") : undefined; + Promise.resolve().then(() => (init_postCommitAttribution(), exports_postCommitAttribution)).then((m) => m.installPrepareCommitMsgHook(worktreePath, worktreeHooksDir).catch((error42) => { + logForDebugging(`Failed to install attribution hook in worktree: ${error42}`); + })).catch((error42) => { + logForDebugging(`Failed to load postCommitAttribution module: ${error42}`); }); } } -function parsePRReference(input11) { - const urlMatch = input11.match(/^https?:\/\/[^/]+\/[^/]+\/[^/]+\/pull\/(\d+)\/?(?:[?#].*)?$/i); +function parsePRReference(input) { + const urlMatch = input.match(/^https?:\/\/[^/]+\/[^/]+\/[^/]+\/pull\/(\d+)\/?(?:[?#].*)?$/i); if (urlMatch?.[1]) { return parseInt(urlMatch[1], 10); } - const hashMatch = input11.match(/^#(\d+)$/); + const hashMatch = input.match(/^#(\d+)$/); if (hashMatch?.[1]) { return parseInt(hashMatch[1], 10); } @@ -685362,8 +607928,8 @@ async function isTmuxAvailable2() { return code === 0; } function getTmuxInstallInstructions2() { - const platform6 = getPlatform(); - switch (platform6) { + const platform5 = getPlatform(); + switch (platform5) { case "macos": return "Install tmux with: brew install tmux"; case "linux": @@ -685460,8 +608026,8 @@ async function keepWorktree() { })); logForDebugging(`Linked worktree preserved at: ${worktreePath}${worktreeBranch ? ` on branch: ${worktreeBranch}` : ""}`); logForDebugging(`You can continue working there by running: cd ${worktreePath}`); - } catch (error46) { - logForDebugging(`Error keeping worktree: ${error46}`, { + } catch (error42) { + logForDebugging(`Error keeping worktree: ${error42}`, { level: "error" }); } @@ -685496,7 +608062,7 @@ async function cleanupWorktree() { activeWorktreeSession: undefined })); if (!hookBased && worktreeBranch) { - await sleep4(100); + await sleep2(100); const { code: deleteBranchCode, stderr: deleteBranchError } = await execFileNoThrowWithCwd(gitExe(), ["branch", "-D", worktreeBranch], { cwd: originalCwd }); if (deleteBranchCode !== 0) { logForDebugging(`Could not delete worktree branch: ${deleteBranchError}`, { level: "error" }); @@ -685505,8 +608071,8 @@ async function cleanupWorktree() { } } logForDebugging("Linked worktree cleaned up completely"); - } catch (error46) { - logForDebugging(`Error cleaning up worktree: ${error46}`, { + } catch (error42) { + logForDebugging(`Error cleaning up worktree: ${error42}`, { level: "error" }); } @@ -685527,8 +608093,8 @@ async function createAgentWorktree(slug) { logForDebugging(`Created agent worktree at: ${worktreePath} on branch: ${worktreeBranch}`); await performPostCreationSetup(gitRoot, worktreePath); } else { - const now3 = new Date; - await utimes2(worktreePath, now3, now3); + const now2 = new Date; + await utimes2(worktreePath, now2, now2); logForDebugging(`Resuming existing agent worktree at: ${worktreePath}`); } return { worktreePath, worktreeBranch, headCommit, gitRoot }; @@ -685587,13 +608153,13 @@ async function cleanupStaleAgentWorktrees(cutoffDate) { if (!EPHEMERAL_WORKTREE_PATTERNS.some((p) => p.test(slug))) { continue; } - const worktreePath = join156(dir, slug); + const worktreePath = join146(dir, slug); if (currentPath === worktreePath) { continue; } let mtimeMs; try { - mtimeMs = (await stat48(worktreePath)).mtimeMs; + mtimeMs = (await stat47(worktreePath)).mtimeMs; } catch { continue; } @@ -685648,7 +608214,7 @@ async function execIntoTmuxWorktree(args) { error: "Error: --tmux is not supported on Windows" }; } - const tmuxCheck = spawnSync7("tmux", ["-V"], { encoding: "utf-8" }); + const tmuxCheck = spawnSync6("tmux", ["-V"], { encoding: "utf-8" }); if (tmuxCheck.status !== 0) { const installHint = process.platform === "darwin" ? "Install tmux with: brew install tmux" : "Install tmux with: sudo apt install tmux"; return { @@ -685658,12 +608224,12 @@ async function execIntoTmuxWorktree(args) { } let worktreeName; let forceClassicTmux = false; - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (!arg) continue; if (arg === "-w" || arg === "--worktree") { - const next = args[i4 + 1]; + const next = args[i3 + 1]; if (next && !next.startsWith("-")) { worktreeName = next; } @@ -685702,13 +608268,13 @@ async function execIntoTmuxWorktree(args) { try { const hookResult = await executeWorktreeCreateHook(worktreeName); worktreeDir = hookResult.worktreePath; - } catch (error46) { + } catch (error42) { return { handled: false, - error: `Error: ${errorMessage(error46)}` + error: `Error: ${errorMessage(error42)}` }; } - repoName = basename47(findCanonicalGitRoot(getCwd()) ?? getCwd()); + repoName = basename45(findCanonicalGitRoot(getCwd()) ?? getCwd()); console.log(`Using worktree via hook: ${worktreeDir}`); } else { const repoRoot = findCanonicalGitRoot(getCwd()); @@ -685718,33 +608284,33 @@ async function execIntoTmuxWorktree(args) { error: "Error: --worktree requires a git repository" }; } - repoName = basename47(repoRoot); + repoName = basename45(repoRoot); worktreeDir = worktreePathFor(repoRoot, worktreeName); try { - const result3 = await getOrCreateWorktree(repoRoot, worktreeName, prNumber !== null ? { prNumber } : undefined); - if (!result3.existed) { - console.log(`Created worktree: ${worktreeDir} (based on ${result3.baseBranch})`); + const result2 = await getOrCreateWorktree(repoRoot, worktreeName, prNumber !== null ? { prNumber } : undefined); + if (!result2.existed) { + console.log(`Created worktree: ${worktreeDir} (based on ${result2.baseBranch})`); await performPostCreationSetup(repoRoot, worktreeDir); } - } catch (error46) { + } catch (error42) { return { handled: false, - error: `Error: ${errorMessage(error46)}` + error: `Error: ${errorMessage(error42)}` }; } } const tmuxSessionName = `${repoName}_${worktreeBranchName(worktreeName)}`.replace(/[/.]/g, "_"); const newArgs = []; - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (!arg) continue; if (arg === "--tmux" || arg === "--tmux=classic") continue; if (arg === "-w" || arg === "--worktree") { - const next = args[i4 + 1]; + const next = args[i3 + 1]; if (next && !next.startsWith("-")) { - i4++; + i3++; } continue; } @@ -685753,7 +608319,7 @@ async function execIntoTmuxWorktree(args) { newArgs.push(arg); } let tmuxPrefix = "C-b"; - const prefixResult = spawnSync7("tmux", ["show-options", "-g", "prefix"], { + const prefixResult = spawnSync6("tmux", ["show-options", "-g", "prefix"], { encoding: "utf-8" }); if (prefixResult.status === 0 && prefixResult.stdout) { @@ -685780,7 +608346,7 @@ async function execIntoTmuxWorktree(args) { CLAUDE_CODE_TMUX_PREFIX: tmuxPrefix, CLAUDE_CODE_TMUX_PREFIX_CONFLICTS: prefixConflicts ? "1" : "" }; - const hasSessionResult = spawnSync7("tmux", ["has-session", "-t", tmuxSessionName], { encoding: "utf-8" }); + const hasSessionResult = spawnSync6("tmux", ["has-session", "-t", tmuxSessionName], { encoding: "utf-8" }); const sessionExists = hasSessionResult.status === 0; const isAlreadyInTmux = Boolean(process.env.TMUX); const useControlMode = isInITerm2() && !forceClassicTmux && !isAlreadyInTmux; @@ -685798,7 +608364,7 @@ ${y2("╰─────────────────────── const isClaudeCliInternal = repoName === "claude-cli-internal"; const shouldSetupDevPanes = isAnt && isClaudeCliInternal && !sessionExists; if (shouldSetupDevPanes) { - spawnSync7("tmux", [ + spawnSync6("tmux", [ "new-session", "-d", "-s", @@ -685809,21 +608375,21 @@ ${y2("╰─────────────────────── process.execPath, ...newArgs ], { cwd: worktreeDir, env: tmuxEnv }); - spawnSync7("tmux", ["split-window", "-h", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir }); - spawnSync7("tmux", ["send-keys", "-t", tmuxSessionName, "bun run watch", "Enter"], { cwd: worktreeDir }); - spawnSync7("tmux", ["split-window", "-v", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir }); - spawnSync7("tmux", ["send-keys", "-t", tmuxSessionName, "bun run start"], { + spawnSync6("tmux", ["split-window", "-h", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir }); + spawnSync6("tmux", ["send-keys", "-t", tmuxSessionName, "bun run watch", "Enter"], { cwd: worktreeDir }); + spawnSync6("tmux", ["split-window", "-v", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir }); + spawnSync6("tmux", ["send-keys", "-t", tmuxSessionName, "bun run start"], { cwd: worktreeDir }); - spawnSync7("tmux", ["select-pane", "-t", `${tmuxSessionName}:0.0`], { + spawnSync6("tmux", ["select-pane", "-t", `${tmuxSessionName}:0.0`], { cwd: worktreeDir }); if (isAlreadyInTmux) { - spawnSync7("tmux", ["switch-client", "-t", tmuxSessionName], { + spawnSync6("tmux", ["switch-client", "-t", tmuxSessionName], { stdio: "inherit" }); } else { - spawnSync7("tmux", [...tmuxGlobalArgs, "attach-session", "-t", tmuxSessionName], { + spawnSync6("tmux", [...tmuxGlobalArgs, "attach-session", "-t", tmuxSessionName], { stdio: "inherit", cwd: worktreeDir }); @@ -685831,11 +608397,11 @@ ${y2("╰─────────────────────── } else { if (isAlreadyInTmux) { if (sessionExists) { - spawnSync7("tmux", ["switch-client", "-t", tmuxSessionName], { + spawnSync6("tmux", ["switch-client", "-t", tmuxSessionName], { stdio: "inherit" }); } else { - spawnSync7("tmux", [ + spawnSync6("tmux", [ "new-session", "-d", "-s", @@ -685846,7 +608412,7 @@ ${y2("╰─────────────────────── process.execPath, ...newArgs ], { cwd: worktreeDir, env: tmuxEnv }); - spawnSync7("tmux", ["switch-client", "-t", tmuxSessionName], { + spawnSync6("tmux", ["switch-client", "-t", tmuxSessionName], { stdio: "inherit" }); } @@ -685863,7 +608429,7 @@ ${y2("╰─────────────────────── process.execPath, ...newArgs ]; - spawnSync7("tmux", tmuxArgs, { + spawnSync6("tmux", tmuxArgs, { stdio: "inherit", cwd: worktreeDir, env: tmuxEnv @@ -685872,11 +608438,11 @@ ${y2("╰─────────────────────── } return { handled: true }; } -var import_ignore6, VALID_WORKTREE_SLUG_SEGMENT, MAX_WORKTREE_SLUG_LENGTH = 64, currentWorktreeSession = null, GIT_NO_PROMPT_ENV2, EPHEMERAL_WORKTREE_PATTERNS; +var import_ignore5, VALID_WORKTREE_SLUG_SEGMENT, MAX_WORKTREE_SLUG_LENGTH = 64, currentWorktreeSession = null, GIT_NO_PROMPT_ENV2, EPHEMERAL_WORKTREE_PATTERNS; var init_worktree = __esm(() => { init_bun_bundle(); init_source(); - import_ignore6 = __toESM(require_ignore(), 1); + import_ignore5 = __toESM(require_ignore(), 1); init_config2(); init_cwd2(); init_debug(); @@ -686218,14 +608784,14 @@ ${CYBER_RISK_INSTRUCTION}`, ].filter((s) => s !== null); } function getMcpInstructions(mcpClients) { - const connectedClients = mcpClients.filter((client5) => client5.type === "connected"); - const clientsWithInstructions = connectedClients.filter((client5) => client5.instructions); + const connectedClients = mcpClients.filter((client2) => client2.type === "connected"); + const clientsWithInstructions = connectedClients.filter((client2) => client2.instructions); if (clientsWithInstructions.length === 0) { return null; } - const instructionBlocks = clientsWithInstructions.map((client5) => { - return `## ${client5.name} -${client5.instructions}`; + const instructionBlocks = clientsWithInstructions.map((client2) => { + return `## ${client2.name} +${client2.instructions}`; }).join(` `); @@ -686360,14 +608926,14 @@ function getFunctionResultClearingSection(model) { if (!feature("CACHED_MICROCOMPACT") || !getCachedMCConfigForFRC) { return null; } - const config6 = getCachedMCConfigForFRC(); - const isModelSupported = config6.supportedModels?.some((pattern) => model.includes(pattern)); - if (!config6.enabled || !config6.systemPromptSuggestSummaries || !isModelSupported) { + const config4 = getCachedMCConfigForFRC(); + const isModelSupported = config4.supportedModels?.some((pattern) => model.includes(pattern)); + if (!config4.enabled || !config4.systemPromptSuggestSummaries || !isModelSupported) { return null; } return `# Function Result Clearing -Old tool results will be automatically cleared from context to free up space. The ${config6.keepRecent} most recent results are always kept.`; +Old tool results will be automatically cleared from context to free up space. The ${config4.keepRecent} most recent results are always kept.`; } function getBriefSection() { if (!(feature("KAIROS") || feature("KAIROS_BRIEF"))) @@ -686439,7 +609005,7 @@ The user context may include a \`terminalFocus\` field indicating whether the us ${BRIEF_PROACTIVE_SECTION2}` : ""}`; } var getCachedMCConfigForFRC, proactiveModule5, BRIEF_PROACTIVE_SECTION2, briefToolModule, DISCOVER_SKILLS_TOOL_NAME2, skillSearchFeatureCheck, CLAUDE_CODE_DOCS_MAP_URL2 = "https://code.claude.com/docs/en/claude_code_docs_map.md", SYSTEM_PROMPT_DYNAMIC_BOUNDARY = "__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__", FRONTIER_MODEL_NAME = "Claude Opus 4.6", CLAUDE_4_5_OR_4_6_MODEL_IDS, DEFAULT_AGENT_PROMPT = `You are an agent for Claude Code, Anthropic's official CLI for Claude. Given the user's message, you should use the tools available to complete the task. Complete the task fully—don't gold-plate, but don't leave it half-done. When you complete the task, respond with a concise report covering what was done and any key findings — the caller will relay this to the user, so it only needs the essentials.`, SUMMARIZE_TOOL_RESULTS_SECTION = `When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.`; -var init_prompts5 = __esm(() => { +var init_prompts4 = __esm(() => { init_env(); init_git(); init_cwd2(); @@ -686460,7 +609026,7 @@ var init_prompts5 = __esm(() => { init_builtInAgents(); init_filesystem(); init_envUtils(); - init_constants6(); + init_constants5(); init_bun_bundle(); init_growthbook(); init_betas2(); @@ -686486,7 +609052,7 @@ var init_prompts5 = __esm(() => { }); // node_modules/zod/index.js -var init_zod2 = __esm(() => { +var init_zod = __esm(() => { init_external2(); init_external2(); }); @@ -686503,13 +609069,13 @@ import { mkdir as mkdir52, readdir as readdir35, rmdir as rmdir3, - stat as stat49, + stat as stat48, unlink as unlink26 } from "fs/promises"; -import { createServer as createServer7 } from "net"; -import { homedir as homedir36, platform as platform6 } from "os"; -import { join as join157 } from "path"; -function log2(message, ...args) { +import { createServer as createServer5 } from "net"; +import { homedir as homedir34, platform as platform5 } from "os"; +import { join as join147 } from "path"; +function log(message, ...args) { if (LOG_FILE) { const timestamp2 = new Date().toISOString(); const formattedArgs = args.length > 0 ? " " + jsonStringify(args) : ""; @@ -686527,7 +609093,7 @@ function sendChromeMessage(message) { process.stdout.write(jsonBytes); } async function runChromeNativeHost() { - log2("Initializing..."); + log("Initializing..."); const host = new ChromeNativeHost; const messageReader = new ChromeMessageReader; await host.start(); @@ -686552,10 +609118,10 @@ class ChromeNativeHost { return; } this.socketPath = getSecureSocketPath(); - if (platform6() !== "win32") { + if (platform5() !== "win32") { const socketDir = getSocketDir(); try { - const dirStats = await stat49(socketDir); + const dirStats = await stat48(socketDir); if (!dirStats.isDirectory()) { await unlink26(socketDir); } @@ -686563,8 +609129,8 @@ class ChromeNativeHost { await mkdir52(socketDir, { recursive: true, mode: 448 }); await chmod11(socketDir, 448).catch(() => {}); try { - const files3 = await readdir35(socketDir); - for (const file2 of files3) { + const files2 = await readdir35(socketDir); + for (const file2 of files2) { if (!file2.endsWith(".sock")) { continue; } @@ -686575,31 +609141,31 @@ class ChromeNativeHost { try { process.kill(pid, 0); } catch { - await unlink26(join157(socketDir, file2)).catch(() => {}); - log2(`Removed stale socket for PID ${pid}`); + await unlink26(join147(socketDir, file2)).catch(() => {}); + log(`Removed stale socket for PID ${pid}`); } } } catch {} } - log2(`Creating socket listener: ${this.socketPath}`); - this.server = createServer7((socket) => this.handleMcpClient(socket)); - await new Promise((resolve45, reject3) => { + log(`Creating socket listener: ${this.socketPath}`); + this.server = createServer5((socket) => this.handleMcpClient(socket)); + await new Promise((resolve39, reject2) => { this.server.listen(this.socketPath, () => { - log2("Socket server listening for connections"); + log("Socket server listening for connections"); this.running = true; - resolve45(); + resolve39(); }); - this.server.on("error", (err3) => { - log2("Socket server error:", err3); - reject3(err3); + this.server.on("error", (err2) => { + log("Socket server error:", err2); + reject2(err2); }); }); - if (platform6() !== "win32") { + if (platform5() !== "win32") { try { await chmod11(this.socketPath, 384); - log2("Socket permissions set to 0600"); + log("Socket permissions set to 0600"); } catch (e) { - log2("Failed to set socket permissions:", e); + log("Failed to set socket permissions:", e); } } } @@ -686607,27 +609173,27 @@ class ChromeNativeHost { if (!this.running) { return; } - for (const [, client5] of this.mcpClients) { - client5.socket.destroy(); + for (const [, client2] of this.mcpClients) { + client2.socket.destroy(); } this.mcpClients.clear(); if (this.server) { - await new Promise((resolve45) => { - this.server.close(() => resolve45()); + await new Promise((resolve39) => { + this.server.close(() => resolve39()); }); this.server = null; } - if (platform6() !== "win32" && this.socketPath) { + if (platform5() !== "win32" && this.socketPath) { try { await unlink26(this.socketPath); - log2("Cleaned up socket file"); + log("Cleaned up socket file"); } catch {} try { const socketDir = getSocketDir(); const remaining = await readdir35(socketDir); if (remaining.length === 0) { await rmdir3(socketDir); - log2("Removed empty socket directory"); + log("Removed empty socket directory"); } } catch {} } @@ -686644,7 +609210,7 @@ class ChromeNativeHost { try { rawMessage = jsonParse(messageJson); } catch (e) { - log2("Invalid JSON from Chrome:", e.message); + log("Invalid JSON from Chrome:", e.message); sendChromeMessage(jsonStringify({ type: "error", error: "Invalid message format" @@ -686653,7 +609219,7 @@ class ChromeNativeHost { } const parsed = messageSchema().safeParse(rawMessage); if (!parsed.success) { - log2("Invalid message from Chrome:", parsed.error.message); + log("Invalid message from Chrome:", parsed.error.message); sendChromeMessage(jsonStringify({ type: "error", error: "Invalid message format" @@ -686661,10 +609227,10 @@ class ChromeNativeHost { return; } const message = parsed.data; - log2(`Handling Chrome message type: ${message.type}`); + log(`Handling Chrome message type: ${message.type}`); switch (message.type) { case "ping": - log2("Responding to ping"); + log("Responding to ping"); sendChromeMessage(jsonStringify({ type: "pong", timestamp: Date.now() @@ -686673,22 +609239,22 @@ class ChromeNativeHost { case "get_status": sendChromeMessage(jsonStringify({ type: "status_response", - native_host_version: VERSION9 + native_host_version: VERSION7 })); break; case "tool_response": { if (this.mcpClients.size > 0) { - log2(`Forwarding tool response to ${this.mcpClients.size} MCP clients`); + log(`Forwarding tool response to ${this.mcpClients.size} MCP clients`); const { type: _, ...data } = message; const responseData = Buffer.from(jsonStringify(data), "utf-8"); const lengthBuffer = Buffer.alloc(4); lengthBuffer.writeUInt32LE(responseData.length, 0); const responseMsg = Buffer.concat([lengthBuffer, responseData]); - for (const [id, client5] of this.mcpClients) { + for (const [id, client2] of this.mcpClients) { try { - client5.socket.write(responseMsg); + client2.socket.write(responseMsg); } catch (e) { - log2(`Failed to send to MCP client ${id}:`, e); + log(`Failed to send to MCP client ${id}:`, e); } } } @@ -686696,7 +609262,7 @@ class ChromeNativeHost { } case "notification": { if (this.mcpClients.size > 0) { - log2(`Forwarding notification to ${this.mcpClients.size} MCP clients`); + log(`Forwarding notification to ${this.mcpClients.size} MCP clients`); const { type: _, ...data } = message; const notificationData = Buffer.from(jsonStringify(data), "utf-8"); const lengthBuffer = Buffer.alloc(4); @@ -686705,18 +609271,18 @@ class ChromeNativeHost { lengthBuffer, notificationData ]); - for (const [id, client5] of this.mcpClients) { + for (const [id, client2] of this.mcpClients) { try { - client5.socket.write(notificationMsg); + client2.socket.write(notificationMsg); } catch (e) { - log2(`Failed to send notification to MCP client ${id}:`, e); + log(`Failed to send notification to MCP client ${id}:`, e); } } } break; } default: - log2(`Unknown message type: ${message.type}`); + log(`Unknown message type: ${message.type}`); sendChromeMessage(jsonStringify({ type: "error", error: `Unknown message type: ${message.type}` @@ -686725,48 +609291,48 @@ class ChromeNativeHost { } handleMcpClient(socket) { const clientId = this.nextClientId++; - const client5 = { + const client2 = { id: clientId, socket, buffer: Buffer.alloc(0) }; - this.mcpClients.set(clientId, client5); - log2(`MCP client ${clientId} connected. Total clients: ${this.mcpClients.size}`); + this.mcpClients.set(clientId, client2); + log(`MCP client ${clientId} connected. Total clients: ${this.mcpClients.size}`); sendChromeMessage(jsonStringify({ type: "mcp_connected" })); socket.on("data", (data) => { - client5.buffer = Buffer.concat([client5.buffer, data]); - while (client5.buffer.length >= 4) { - const length = client5.buffer.readUInt32LE(0); + client2.buffer = Buffer.concat([client2.buffer, data]); + while (client2.buffer.length >= 4) { + const length = client2.buffer.readUInt32LE(0); if (length === 0 || length > MAX_MESSAGE_SIZE) { - log2(`Invalid message length from MCP client ${clientId}: ${length}`); + log(`Invalid message length from MCP client ${clientId}: ${length}`); socket.destroy(); return; } - if (client5.buffer.length < 4 + length) { + if (client2.buffer.length < 4 + length) { break; } - const messageBytes = client5.buffer.slice(4, 4 + length); - client5.buffer = client5.buffer.slice(4 + length); + const messageBytes = client2.buffer.slice(4, 4 + length); + client2.buffer = client2.buffer.slice(4 + length); try { const request = jsonParse(messageBytes.toString("utf-8")); - log2(`Forwarding tool request from MCP client ${clientId}: ${request.method}`); + log(`Forwarding tool request from MCP client ${clientId}: ${request.method}`); sendChromeMessage(jsonStringify({ type: "tool_request", method: request.method, params: request.params })); } catch (e) { - log2(`Failed to parse tool request from MCP client ${clientId}:`, e); + log(`Failed to parse tool request from MCP client ${clientId}:`, e); } } }); - socket.on("error", (err3) => { - log2(`MCP client ${clientId} error: ${err3}`); + socket.on("error", (err2) => { + log(`MCP client ${clientId} error: ${err2}`); }); socket.on("close", () => { - log2(`MCP client ${clientId} disconnected. Remaining clients: ${this.mcpClients.size - 1}`); + log(`MCP client ${clientId} disconnected. Remaining clients: ${this.mcpClients.size - 1}`); this.mcpClients.delete(clientId); sendChromeMessage(jsonStringify({ type: "mcp_disconnected" @@ -686780,8 +609346,8 @@ class ChromeMessageReader { pendingResolve = null; closed = false; constructor() { - process.stdin.on("data", (chunk4) => { - this.buffer = Buffer.concat([this.buffer, chunk4]); + process.stdin.on("data", (chunk3) => { + this.buffer = Buffer.concat([this.buffer, chunk3]); this.tryProcessMessage(); }); process.stdin.on("end", () => { @@ -686808,7 +609374,7 @@ class ChromeMessageReader { } const length = this.buffer.readUInt32LE(0); if (length === 0 || length > MAX_MESSAGE_SIZE) { - log2(`Invalid message length: ${length}`); + log(`Invalid message length: ${length}`); this.pendingResolve(null); this.pendingResolve = null; return; @@ -686834,19 +609400,19 @@ class ChromeMessageReader { return messageBytes.toString("utf-8"); } } - return new Promise((resolve45) => { - this.pendingResolve = resolve45; + return new Promise((resolve39) => { + this.pendingResolve = resolve39; this.tryProcessMessage(); }); } } -var VERSION9 = "1.0.0", MAX_MESSAGE_SIZE, LOG_FILE, messageSchema; +var VERSION7 = "1.0.0", MAX_MESSAGE_SIZE, LOG_FILE, messageSchema; var init_chromeNativeHost = __esm(() => { - init_zod2(); + init_zod(); init_slowOperations(); init_common3(); MAX_MESSAGE_SIZE = 1024 * 1024; - LOG_FILE = process.env.USER_TYPE === "ant" ? join157(homedir36(), ".claude", "debug", "chrome-native-host.txt") : undefined; + LOG_FILE = process.env.USER_TYPE === "ant" ? join147(homedir34(), ".claude", "debug", "chrome-native-host.txt") : undefined; messageSchema = lazySchema(() => exports_external2.object({ type: exports_external2.string() }).passthrough()); @@ -686891,10 +609457,10 @@ function createBridgeLogger(options2) { const sessionDisplayInfo = new Map; let connectingTimer = null; let connectingTick = 0; - function countVisualLines(text2) { + function countVisualLines(text) { const cols = process.stdout.columns || 80; let count4 = 0; - for (const logical of text2.split(` + for (const logical of text.split(` `)) { if (logical.length === 0) { count4++; @@ -686903,15 +609469,15 @@ function createBridgeLogger(options2) { const width = stringWidth(logical); count4 += Math.max(1, Math.ceil(width / cols)); } - if (text2.endsWith(` + if (text.endsWith(` `)) { count4--; } return count4; } - function writeStatus(text2) { - write(text2); - statusLineCount += countVisualLines(text2); + function writeStatus(text) { + write(text); + statusLineCount += countVisualLines(text); } function clearStatusLines() { if (statusLineCount <= 0) @@ -687026,8 +609592,8 @@ function createBridgeLogger(options2) { } } return { - printBanner(config6, environmentId) { - cachedIngressUrl = config6.sessionIngressUrl; + printBanner(config4, environmentId) { + cachedIngressUrl = config4.sessionIngressUrl; cachedEnvironmentId = environmentId; connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl); regenerateQr(connectUrl); @@ -687036,16 +609602,16 @@ function createBridgeLogger(options2) { `); } if (verbose) { - if (config6.spawnMode !== "single-session") { - write(source_default.dim(`Spawn mode: `) + `${config6.spawnMode} + if (config4.spawnMode !== "single-session") { + write(source_default.dim(`Spawn mode: `) + `${config4.spawnMode} `); - write(source_default.dim(`Max concurrent sessions: `) + `${config6.maxSessions} + write(source_default.dim(`Max concurrent sessions: `) + `${config4.maxSessions} `); } write(source_default.dim(`Environment ID: `) + `${environmentId} `); } - if (config6.sandbox) { + if (config4.sandbox) { write(source_default.dim(`Sandbox: `) + `${source_default.green("Enabled")} `); } @@ -687064,8 +609630,8 @@ function createBridgeLogger(options2) { printLog(source_default.dim(`[${timestamp()}]`) + ` Session ${source_default.green("completed")} (${formatDuration(durationMs)}) ${source_default.dim(sessionId)} `); }, - logSessionFailed(sessionId, error46) { - printLog(source_default.dim(`[${timestamp()}]`) + ` Session ${source_default.red("failed")}: ${error46} ${source_default.dim(sessionId)} + logSessionFailed(sessionId, error42) { + printLog(source_default.dim(`[${timestamp()}]`) + ` Session ${source_default.red("failed")}: ${error42} ${source_default.dim(sessionId)} `); }, logStatus(message) { @@ -687090,8 +609656,8 @@ function createBridgeLogger(options2) { repoName = repo; branch2 = branchName; }, - setDebugLogPath(path26) { - debugLogPath = path26; + setDebugLogPath(path21) { + debugLogPath = path21; }, updateIdleStatus() { stopConnecting(); @@ -687130,7 +609696,7 @@ function createBridgeLogger(options2) { writeStatus(`${source_default.yellow(frame)} ${source_default.yellow("Reconnecting")} ${source_default.dim("·")} ${source_default.dim(`retrying in ${delayStr}`)} ${source_default.dim("·")} ${source_default.dim(`disconnected ${elapsedStr}`)} `); }, - updateFailedStatus(error46) { + updateFailedStatus(error42) { stopConnecting(); clearStatusLines(); currentState = "failed"; @@ -687145,8 +609711,8 @@ function createBridgeLogger(options2) { `); writeStatus(`${source_default.dim(FAILED_FOOTER_TEXT)} `); - if (error46) { - writeStatus(`${source_default.red(error46)} + if (error42) { + writeStatus(`${source_default.red(error42)} `); } }, @@ -687165,11 +609731,11 @@ function createBridgeLogger(options2) { qrVisible = !qrVisible; renderStatusLine(); }, - updateSessionCount(active, max5, mode) { - if (sessionActive === active && sessionMax === max5 && spawnMode === mode) + updateSessionCount(active, max3, mode) { + if (sessionActive === active && sessionMax === max3 && spawnMode === mode) return; sessionActive = active; - sessionMax = max5; + sessionMax = max3; spawnMode = mode; }, setSpawnModeDisplay(mode) { @@ -687330,8 +609896,8 @@ function createTokenRefreshScheduler({ let oauthToken; try { oauthToken = await getAccessToken(); - } catch (err3) { - logForDebugging(`[${label}:token] getAccessToken threw for sessionId=${sessionId}: ${errorMessage(err3)}`, { level: "error" }); + } catch (err2) { + logForDebugging(`[${label}:token] getAccessToken threw for sessionId=${sessionId}: ${errorMessage(err2)}`, { level: "error" }); } if (generations.get(sessionId) !== gen) { logForDebugging(`[${label}:token] doRefresh for sessionId=${sessionId} stale (gen ${gen} vs ${generations.get(sessionId)}), skipping`); @@ -687437,17 +610003,17 @@ var init_pollConfig = __esm(() => { }); // src/bridge/sessionRunner.ts -import { spawn as spawn12 } from "child_process"; +import { spawn as spawn9 } from "child_process"; import { createWriteStream as createWriteStream4 } from "fs"; -import { tmpdir as tmpdir14 } from "os"; -import { dirname as dirname64, join as join158 } from "path"; +import { tmpdir as tmpdir11 } from "os"; +import { dirname as dirname60, join as join148 } from "path"; import { createInterface } from "readline"; function safeFilenameId(id) { return id.replace(/[^a-zA-Z0-9_-]/g, "_"); } -function toolSummary(name, input11) { +function toolSummary(name, input) { const verb = TOOL_VERBS[name] ?? name; - const target = input11.file_path ?? input11.filePath ?? input11.pattern ?? input11.command?.slice(0, 60) ?? input11.url ?? input11.query ?? ""; + const target = input.file_path ?? input.filePath ?? input.pattern ?? input.command?.slice(0, 60) ?? input.url ?? input.query ?? ""; if (target) { return `${verb} ${target}`; } @@ -687465,7 +610031,7 @@ function extractActivities(line, sessionId, onDebug) { } const msg = parsed; const activities = []; - const now3 = Date.now(); + const now2 = Date.now(); switch (msg.type) { case "assistant": { const message = msg.message; @@ -687480,23 +610046,23 @@ function extractActivities(line, sessionId, onDebug) { const b = block2; if (b.type === "tool_use") { const name = b.name ?? "Tool"; - const input11 = b.input ?? {}; - const summary = toolSummary(name, input11); + const input = b.input ?? {}; + const summary = toolSummary(name, input); activities.push({ type: "tool_start", summary, - timestamp: now3 + timestamp: now2 }); - onDebug(`[bridge:activity] sessionId=${sessionId} tool_use name=${name} ${inputPreview(input11)}`); + onDebug(`[bridge:activity] sessionId=${sessionId} tool_use name=${name} ${inputPreview(input)}`); } else if (b.type === "text") { - const text2 = b.text ?? ""; - if (text2.length > 0) { + const text = b.text ?? ""; + if (text.length > 0) { activities.push({ type: "text", - summary: text2.slice(0, 80), - timestamp: now3 + summary: text.slice(0, 80), + timestamp: now2 }); - onDebug(`[bridge:activity] sessionId=${sessionId} text "${text2.slice(0, 100)}"`); + onDebug(`[bridge:activity] sessionId=${sessionId} text "${text.slice(0, 100)}"`); } } } @@ -687508,7 +610074,7 @@ function extractActivities(line, sessionId, onDebug) { activities.push({ type: "result", summary: "Session completed", - timestamp: now3 + timestamp: now2 }); onDebug(`[bridge:activity] sessionId=${sessionId} result subtype=success`); } else if (subtype) { @@ -687517,7 +610083,7 @@ function extractActivities(line, sessionId, onDebug) { activities.push({ type: "error", summary: errorSummary, - timestamp: now3 + timestamp: now2 }); onDebug(`[bridge:activity] sessionId=${sessionId} result subtype=${subtype} error="${errorSummary}"`); } else { @@ -687535,23 +610101,23 @@ function extractUserMessageText(msg) { return; const message = msg.message; const content = message?.content; - let text2; + let text; if (typeof content === "string") { - text2 = content; + text = content; } else if (Array.isArray(content)) { for (const block2 of content) { if (block2 && typeof block2 === "object" && block2.type === "text") { - text2 = block2.text; + text = block2.text; break; } } } - text2 = text2?.trim(); - return text2 ? text2 : undefined; + text = text?.trim(); + return text ? text : undefined; } -function inputPreview(input11) { +function inputPreview(input) { const parts = []; - for (const [key, val] of Object.entries(input11)) { + for (const [key, val] of Object.entries(input)) { if (typeof val === "string") { parts.push(`${key}="${val.slice(0, 100)}"`); } @@ -687573,15 +610139,15 @@ function createSessionSpawner(deps) { debugFile = `${deps.debugFile}-${safeId}`; } } else if (deps.verbose || process.env.USER_TYPE === "ant") { - debugFile = join158(tmpdir14(), "claude", `bridge-session-${safeId}.log`); + debugFile = join148(tmpdir11(), "claude", `bridge-session-${safeId}.log`); } let transcriptStream = null; let transcriptPath; if (deps.debugFile) { - transcriptPath = join158(dirname64(deps.debugFile), `bridge-transcript-${safeId}.jsonl`); + transcriptPath = join148(dirname60(deps.debugFile), `bridge-transcript-${safeId}.jsonl`); transcriptStream = createWriteStream4(transcriptPath, { flags: "a" }); - transcriptStream.on("error", (err3) => { - deps.onDebug(`[bridge:session] Transcript write error: ${err3.message}`); + transcriptStream.on("error", (err2) => { + deps.onDebug(`[bridge:session] Transcript write error: ${err2.message}`); transcriptStream = null; }); deps.onDebug(`[bridge:session] Transcript log: ${transcriptPath}`); @@ -687602,7 +610168,7 @@ function createSessionSpawner(deps) { ...debugFile ? ["--debug-file", debugFile] : [], ...deps.permissionMode ? ["--permission-mode", deps.permissionMode] : [] ]; - const env5 = { + const env4 = { ...deps.env, CLAUDE_CODE_OAUTH_TOKEN: undefined, CLAUDE_CODE_ENVIRONMENT_KIND: "bridge", @@ -687619,10 +610185,10 @@ function createSessionSpawner(deps) { if (debugFile) { deps.onDebug(`[bridge:session] Debug log: ${debugFile}`); } - const child = spawn12(deps.execPath, args, { + const child = spawn9(deps.execPath, args, { cwd: dir, stdio: ["pipe", "pipe", "pipe"], - env: env5, + env: env4, windowsHide: true }); deps.onDebug(`[bridge:session] sessionId=${opts.sessionId} pid=${child.pid}`); @@ -687678,17 +610244,17 @@ function createSessionSpawner(deps) { deps.onPermissionRequest(opts.sessionId, parsed, opts.accessToken); } } else if (msg.type === "user" && !firstUserMessageSeen && opts.onFirstUserMessage) { - const text2 = extractUserMessageText(msg); - if (text2) { + const text = extractUserMessageText(msg); + if (text) { firstUserMessageSeen = true; - opts.onFirstUserMessage(text2); + opts.onFirstUserMessage(text); } } } } }); } - const done = new Promise((resolve45) => { + const done = new Promise((resolve39) => { child.on("close", (code, signal) => { if (transcriptStream) { transcriptStream.end(); @@ -687696,18 +610262,18 @@ function createSessionSpawner(deps) { } if (signal === "SIGTERM" || signal === "SIGINT") { deps.onDebug(`[bridge:session] sessionId=${opts.sessionId} interrupted signal=${signal} pid=${child.pid}`); - resolve45("interrupted"); + resolve39("interrupted"); } else if (code === 0) { deps.onDebug(`[bridge:session] sessionId=${opts.sessionId} completed exit_code=0 pid=${child.pid}`); - resolve45("completed"); + resolve39("completed"); } else { deps.onDebug(`[bridge:session] sessionId=${opts.sessionId} failed exit_code=${code} pid=${child.pid}`); - resolve45("failed"); + resolve39("failed"); } }); - child.on("error", (err3) => { - deps.onDebug(`[bridge:session] sessionId=${opts.sessionId} spawn error: ${err3.message}`); - resolve45("failed"); + child.on("error", (err2) => { + deps.onDebug(`[bridge:session] sessionId=${opts.sessionId} spawn error: ${err2.message}`); + resolve39("failed"); }); }); const handle2 = { @@ -687851,40 +610417,40 @@ __export(exports_bridgePointer, { clearBridgePointer: () => clearBridgePointer, BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS }); -import { mkdir as mkdir53, readFile as readFile58, stat as stat50, unlink as unlink27, writeFile as writeFile54 } from "fs/promises"; -import { dirname as dirname65, join as join159 } from "path"; +import { mkdir as mkdir53, readFile as readFile57, stat as stat49, unlink as unlink27, writeFile as writeFile52 } from "fs/promises"; +import { dirname as dirname61, join as join149 } from "path"; function getBridgePointerPath(dir) { - return join159(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json"); + return join149(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json"); } async function writeBridgePointer(dir, pointer) { - const path26 = getBridgePointerPath(dir); + const path21 = getBridgePointerPath(dir); try { - await mkdir53(dirname65(path26), { recursive: true }); - await writeFile54(path26, jsonStringify(pointer), "utf8"); - logForDebugging(`[bridge:pointer] wrote ${path26}`); - } catch (err3) { - logForDebugging(`[bridge:pointer] write failed: ${err3}`, { level: "warn" }); + await mkdir53(dirname61(path21), { recursive: true }); + await writeFile52(path21, jsonStringify(pointer), "utf8"); + logForDebugging(`[bridge:pointer] wrote ${path21}`); + } catch (err2) { + logForDebugging(`[bridge:pointer] write failed: ${err2}`, { level: "warn" }); } } async function readBridgePointer(dir) { - const path26 = getBridgePointerPath(dir); + const path21 = getBridgePointerPath(dir); let raw; let mtimeMs; try { - mtimeMs = (await stat50(path26)).mtimeMs; - raw = await readFile58(path26, "utf8"); + mtimeMs = (await stat49(path21)).mtimeMs; + raw = await readFile57(path21, "utf8"); } catch { return null; } const parsed = BridgePointerSchema().safeParse(safeJsonParse(raw)); if (!parsed.success) { - logForDebugging(`[bridge:pointer] invalid schema, clearing: ${path26}`); + logForDebugging(`[bridge:pointer] invalid schema, clearing: ${path21}`); await clearBridgePointer(dir); return null; } const ageMs = Math.max(0, Date.now() - mtimeMs); if (ageMs > BRIDGE_POINTER_TTL_MS) { - logForDebugging(`[bridge:pointer] stale (>4h mtime), clearing: ${path26}`); + logForDebugging(`[bridge:pointer] stale (>4h mtime), clearing: ${path21}`); await clearBridgePointer(dir); return null; } @@ -687920,13 +610486,13 @@ async function readBridgePointerAcrossWorktrees(dir) { return freshest; } async function clearBridgePointer(dir) { - const path26 = getBridgePointerPath(dir); + const path21 = getBridgePointerPath(dir); try { - await unlink27(path26); - logForDebugging(`[bridge:pointer] cleared ${path26}`); - } catch (err3) { - if (!isENOENT(err3)) { - logForDebugging(`[bridge:pointer] clear failed: ${err3}`, { + await unlink27(path21); + logForDebugging(`[bridge:pointer] cleared ${path21}`); + } catch (err2) { + if (!isENOENT(err2)) { + logForDebugging(`[bridge:pointer] clear failed: ${err2}`, { level: "warn" }); } @@ -687956,12 +610522,12 @@ var init_bridgePointer = __esm(() => { }); // src/utils/errorLogSink.ts -import { dirname as dirname66, join as join160 } from "path"; +import { dirname as dirname62, join as join150 } from "path"; function getErrorsPath() { - return join160(CACHE_PATHS.errors(), DATE + ".jsonl"); + return join150(CACHE_PATHS.errors(), DATE + ".jsonl"); } function getMCPLogsPath(serverName) { - return join160(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl"); + return join150(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl"); } function createJsonlWriter(options2) { const writer = createBufferedWriter(options2); @@ -687974,28 +610540,28 @@ function createJsonlWriter(options2) { dispose: writer.dispose }; } -function getLogWriter(path26) { - let writer = logWriters.get(path26); +function getLogWriter(path21) { + let writer = logWriters.get(path21); if (!writer) { - const dir = dirname66(path26); + const dir = dirname62(path21); writer = createJsonlWriter({ writeFn: (content) => { try { - getFsImplementation().appendFileSync(path26, content); + getFsImplementation().appendFileSync(path21, content); } catch { getFsImplementation().mkdirSync(dir); - getFsImplementation().appendFileSync(path26, content); + getFsImplementation().appendFileSync(path21, content); } }, flushIntervalMs: 1000, maxBufferSize: 50 }); - logWriters.set(path26, writer); + logWriters.set(path21, writer); registerCleanup(async () => writer?.dispose()); } return writer; } -function appendToLog(path26, message) { +function appendToLog(path21, message) { if (process.env.USER_TYPE !== "ant") { return; } @@ -688007,7 +610573,7 @@ function appendToLog(path26, message) { sessionId: getSessionId(), version: "2.1.88-custom" }; - getLogWriter(path26).write(messageWithTimestamp); + getLogWriter(path21).write(messageWithTimestamp); } function extractServerMessage(data) { if (typeof data === "string") { @@ -688024,29 +610590,29 @@ function extractServerMessage(data) { } return; } -function logErrorImpl(error46) { - const errorStr = error46.stack || error46.message; +function logErrorImpl(error42) { + const errorStr = error42.stack || error42.message; let context2 = ""; - if (axios_default.isAxiosError(error46) && error46.config?.url) { - const parts = [`url=${error46.config.url}`]; - if (error46.response?.status !== undefined) { - parts.push(`status=${error46.response.status}`); + if (axios_default.isAxiosError(error42) && error42.config?.url) { + const parts = [`url=${error42.config.url}`]; + if (error42.response?.status !== undefined) { + parts.push(`status=${error42.response.status}`); } - const serverMessage = extractServerMessage(error46.response?.data); + const serverMessage = extractServerMessage(error42.response?.data); if (serverMessage) { parts.push(`body=${serverMessage}`); } context2 = `[${parts.join(",")}] `; } - logForDebugging(`${error46.name}: ${context2}${errorStr}`, { level: "error" }); + logForDebugging(`${error42.name}: ${context2}${errorStr}`, { level: "error" }); appendToLog(getErrorsPath(), { error: `${context2}${errorStr}` }); } -function logMCPErrorImpl(serverName, error46) { - logForDebugging(`MCP server "${serverName}" ${error46}`, { level: "error" }); +function logMCPErrorImpl(serverName, error42) { + logForDebugging(`MCP server "${serverName}" ${error42}`, { level: "error" }); const logFile = getMCPLogsPath(serverName); - const errorStr = error46 instanceof Error ? error46.stack || error46.message : String(error46); + const errorStr = error42 instanceof Error ? error42.stack || error42.message : String(error42); const errorInfo = { error: errorStr, timestamp: new Date().toISOString(), @@ -688116,8 +610682,8 @@ __export(exports_bridgeMain, { BridgeHeadlessPermanentError: () => BridgeHeadlessPermanentError }); import { randomUUID as randomUUID35 } from "crypto"; -import { hostname as hostname4, tmpdir as tmpdir15 } from "os"; -import { basename as basename48, join as join161, resolve as resolve45 } from "path"; +import { hostname as hostname4, tmpdir as tmpdir12 } from "os"; +import { basename as basename46, join as join151, resolve as resolve39 } from "path"; async function isMultiSessionSpawnEnabled() { return checkGate_CACHED_OR_BLOCKING("tengu_ccr_bridge_multi_session"); } @@ -688133,13 +610699,13 @@ function spawnScriptArgs() { function safeSpawn(spawner, opts, dir) { try { return spawner.spawn(opts, dir); - } catch (err3) { - const errMsg = errorMessage(err3); + } catch (err2) { + const errMsg = errorMessage(err2); logError2(new Error(`Session spawn failed: ${errMsg}`)); return errMsg; } } -async function runBridgeLoop(config6, environmentId, environmentSecret, api3, spawner, logger, signal, backoffConfig = DEFAULT_BACKOFF, initialSessionId, getAccessToken) { +async function runBridgeLoop(config4, environmentId, environmentSecret, api3, spawner, logger, signal, backoffConfig = DEFAULT_BACKOFF, initialSessionId, getAccessToken) { const controller = new AbortController; if (signal.aborted) { controller.abort(); @@ -688171,14 +610737,14 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp try { await api3.heartbeatWork(environmentId, workId, ingressToken); anySuccess = true; - } catch (err3) { - logForDebugging(`[bridge:heartbeat] Failed for sessionId=${sessionId} workId=${workId}: ${errorMessage(err3)}`); - if (err3 instanceof BridgeFatalError) { + } catch (err2) { + logForDebugging(`[bridge:heartbeat] Failed for sessionId=${sessionId} workId=${workId}: ${errorMessage(err2)}`); + if (err2 instanceof BridgeFatalError) { logEvent("tengu_bridge_heartbeat_error", { - status: err3.status, - error_type: err3.status === 401 || err3.status === 403 ? "auth_failed" : "fatal" + status: err2.status, + error_type: err2.status === 401 || err2.status === 403 ? "auth_failed" : "fatal" }); - if (err3.status === 401 || err3.status === 403) { + if (err2.status === 401 || err2.status === 403) { authFailedSessions.push(sessionId); } else { anyFatal = true; @@ -688191,9 +610757,9 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp try { await api3.reconnectSession(environmentId, sessionId); logForDebugging(`[bridge:heartbeat] Re-queued sessionId=${sessionId} via bridge/reconnect`); - } catch (err3) { - logger.logError(`Failed to refresh session ${sessionId} token: ${errorMessage(err3)}`); - logForDebugging(`[bridge:heartbeat] reconnectSession(${sessionId}) failed: ${errorMessage(err3)}`, { level: "error" }); + } catch (err2) { + logger.logError(`Failed to refresh session ${sessionId} token: ${errorMessage(err2)}`); + logForDebugging(`[bridge:heartbeat] reconnectSession(${sessionId}) failed: ${errorMessage(err2)}`, { level: "error" }); } } if (anyFatal) { @@ -688214,9 +610780,9 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp } if (v2Sessions.has(sessionId)) { logger.logVerbose(`Refreshing session ${sessionId} token via bridge/reconnect`); - api3.reconnectSession(environmentId, sessionId).catch((err3) => { - logger.logError(`Failed to refresh session ${sessionId} token: ${errorMessage(err3)}`); - logForDebugging(`[bridge:token] reconnectSession(${sessionId}) failed: ${errorMessage(err3)}`, { level: "error" }); + api3.reconnectSession(environmentId, sessionId).catch((err2) => { + logger.logError(`Failed to refresh session ${sessionId} token: ${errorMessage(err2)}`); + logForDebugging(`[bridge:token] reconnectSession(${sessionId}) failed: ${errorMessage(err2)}`, { level: "error" }); }); } else { handle2.updateAccessToken(oauthToken); @@ -688237,28 +610803,28 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp let lastPollErrorTime = null; let statusUpdateTimer = null; let fatalExit = false; - logForDebugging(`[bridge:work] Starting poll loop spawnMode=${config6.spawnMode} maxSessions=${config6.maxSessions} environmentId=${environmentId}`); + logForDebugging(`[bridge:work] Starting poll loop spawnMode=${config4.spawnMode} maxSessions=${config4.maxSessions} environmentId=${environmentId}`); logForDiagnosticsNoPII("info", "bridge_loop_started", { - max_sessions: config6.maxSessions, - spawn_mode: config6.spawnMode + max_sessions: config4.maxSessions, + spawn_mode: config4.spawnMode }); if (process.env.USER_TYPE === "ant") { let debugGlob; - if (config6.debugFile) { - const ext = config6.debugFile.lastIndexOf("."); - debugGlob = ext > 0 ? `${config6.debugFile.slice(0, ext)}-*${config6.debugFile.slice(ext)}` : `${config6.debugFile}-*`; + if (config4.debugFile) { + const ext = config4.debugFile.lastIndexOf("."); + debugGlob = ext > 0 ? `${config4.debugFile.slice(0, ext)}-*${config4.debugFile.slice(ext)}` : `${config4.debugFile}-*`; } else { - debugGlob = join161(tmpdir15(), "claude", "bridge-session-*.log"); + debugGlob = join151(tmpdir12(), "claude", "bridge-session-*.log"); } logger.setDebugLogPath(debugGlob); } - logger.printBanner(config6, environmentId); - logger.updateSessionCount(0, config6.maxSessions, config6.spawnMode); + logger.printBanner(config4, environmentId); + logger.updateSessionCount(0, config4.maxSessions, config4.spawnMode); if (initialSessionId) { logger.setAttached(initialSessionId); } function updateStatusDisplay() { - logger.updateSessionCount(activeSessions.size, config6.maxSessions, config6.spawnMode); + logger.updateSessionCount(activeSessions.size, config4.maxSessions, config4.spawnMode); for (const [sid, handle3] of activeSessions) { const act = handle3.currentActivity; if (act) { @@ -688275,7 +610841,7 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp return; const activity = handle2.currentActivity; if (!activity || activity.type === "result" || activity.type === "error") { - if (config6.maxSessions > 1) + if (config4.maxSessions > 1) logger.refreshDisplay(); return; } @@ -688352,11 +610918,11 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp const wt = sessionWorktrees.get(sessionId); if (wt) { sessionWorktrees.delete(sessionId); - trackCleanup(removeAgentWorktree(wt.worktreePath, wt.worktreeBranch, wt.gitRoot, wt.hookBased).catch((err3) => logger.logVerbose(`Failed to remove worktree ${wt.worktreePath}: ${errorMessage(err3)}`))); + trackCleanup(removeAgentWorktree(wt.worktreePath, wt.worktreeBranch, wt.gitRoot, wt.hookBased).catch((err2) => logger.logVerbose(`Failed to remove worktree ${wt.worktreePath}: ${errorMessage(err2)}`))); } if (status2 !== "interrupted" && !loopSignal.aborted) { - if (config6.spawnMode !== "single-session") { - trackCleanup(api3.archiveSession(compatId).catch((err3) => logger.logVerbose(`Failed to archive session ${sessionId}: ${errorMessage(err3)}`))); + if (config4.spawnMode !== "single-session") { + trackCleanup(api3.archiveSession(compatId).catch((err2) => logger.logVerbose(`Failed to archive session ${sessionId}: ${errorMessage(err2)}`))); logForDebugging(`[bridge:session] Session ${status2}, returning to idle (multi-session mode)`); } else { logForDebugging(`[bridge:session] Session ${status2}, aborting poll loop to tear down environment`); @@ -688391,7 +610957,7 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp generalErrorStart = null; lastPollErrorTime = null; if (!work) { - const atCap = activeSessions.size >= config6.maxSessions; + const atCap = activeSessions.size >= config4.maxSessions; if (atCap) { const atCapMs = pollConfig.multisession_poll_interval_ms_at_capacity; if (pollConfig.non_exclusive_heartbeat_interval_ms > 0) { @@ -688402,7 +610968,7 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp const pollDeadline = atCapMs > 0 ? Date.now() + atCapMs : null; let hbResult = "ok"; let hbCycles = 0; - while (!loopSignal.aborted && activeSessions.size >= config6.maxSessions && (pollDeadline === null || Date.now() < pollDeadline)) { + while (!loopSignal.aborted && activeSessions.size >= config4.maxSessions && (pollDeadline === null || Date.now() < pollDeadline)) { const hbConfig = getPollIntervalConfig(); if (hbConfig.non_exclusive_heartbeat_interval_ms <= 0) break; @@ -688413,10 +610979,10 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp break; } hbCycles++; - await sleep4(hbConfig.non_exclusive_heartbeat_interval_ms, cap.signal); + await sleep2(hbConfig.non_exclusive_heartbeat_interval_ms, cap.signal); cap.cleanup(); } - const exitReason = hbResult === "auth_failed" || hbResult === "fatal" ? hbResult : loopSignal.aborted ? "shutdown" : activeSessions.size < config6.maxSessions ? "capacity_changed" : pollDeadline !== null && Date.now() >= pollDeadline ? "poll_due" : "config_disabled"; + const exitReason = hbResult === "auth_failed" || hbResult === "fatal" ? hbResult : loopSignal.aborted ? "shutdown" : activeSessions.size < config4.maxSessions ? "capacity_changed" : pollDeadline !== null && Date.now() >= pollDeadline ? "poll_due" : "config_disabled"; logEvent("tengu_bridge_heartbeat_mode_exited", { reason: exitReason, heartbeat_cycles: hbCycles, @@ -688427,42 +610993,42 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp } if (hbResult === "auth_failed" || hbResult === "fatal") { const cap = capacityWake.signal(); - await sleep4(atCapMs > 0 ? atCapMs : pollConfig.non_exclusive_heartbeat_interval_ms, cap.signal); + await sleep2(atCapMs > 0 ? atCapMs : pollConfig.non_exclusive_heartbeat_interval_ms, cap.signal); cap.cleanup(); } } else if (atCapMs > 0) { const cap = capacityWake.signal(); - await sleep4(atCapMs, cap.signal); + await sleep2(atCapMs, cap.signal); cap.cleanup(); } } else { const interval = activeSessions.size > 0 ? pollConfig.multisession_poll_interval_ms_partial_capacity : pollConfig.multisession_poll_interval_ms_not_at_capacity; - await sleep4(interval, loopSignal); + await sleep2(interval, loopSignal); } continue; } - const atCapacityBeforeSwitch = activeSessions.size >= config6.maxSessions; + const atCapacityBeforeSwitch = activeSessions.size >= config4.maxSessions; if (completedWorkIds.has(work.id)) { logForDebugging(`[bridge:work] Skipping already-completed workId=${work.id}`); if (atCapacityBeforeSwitch) { const cap = capacityWake.signal(); if (pollConfig.non_exclusive_heartbeat_interval_ms > 0) { await heartbeatActiveWorkItems(); - await sleep4(pollConfig.non_exclusive_heartbeat_interval_ms, cap.signal); + await sleep2(pollConfig.non_exclusive_heartbeat_interval_ms, cap.signal); } else if (pollConfig.multisession_poll_interval_ms_at_capacity > 0) { - await sleep4(pollConfig.multisession_poll_interval_ms_at_capacity, cap.signal); + await sleep2(pollConfig.multisession_poll_interval_ms_at_capacity, cap.signal); } cap.cleanup(); } else { - await sleep4(1000, loopSignal); + await sleep2(1000, loopSignal); } continue; } let secret; try { secret = decodeWorkSecret(work.secret); - } catch (err3) { - const errMsg = errorMessage(err3); + } catch (err2) { + const errMsg = errorMessage(err2); logger.logError(`Failed to decode work secret for workId=${work.id}: ${errMsg}`); logEvent("tengu_bridge_work_secret_failed", {}); completedWorkIds.add(work.id); @@ -688471,9 +611037,9 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp const cap = capacityWake.signal(); if (pollConfig.non_exclusive_heartbeat_interval_ms > 0) { await heartbeatActiveWorkItems(); - await sleep4(pollConfig.non_exclusive_heartbeat_interval_ms, cap.signal); + await sleep2(pollConfig.non_exclusive_heartbeat_interval_ms, cap.signal); } else if (pollConfig.multisession_poll_interval_ms_at_capacity > 0) { - await sleep4(pollConfig.multisession_poll_interval_ms_at_capacity, cap.signal); + await sleep2(pollConfig.multisession_poll_interval_ms_at_capacity, cap.signal); } cap.cleanup(); } @@ -688483,8 +611049,8 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp logForDebugging(`[bridge:work] Acknowledging workId=${work.id}`); try { await api3.acknowledgeWork(environmentId, work.id, secret.session_ingress_token); - } catch (err3) { - logForDebugging(`[bridge:work] Acknowledge failed workId=${work.id}: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge:work] Acknowledge failed workId=${work.id}: ${errorMessage(err2)}`); } }; const workType = work.data.type; @@ -688513,8 +611079,8 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp await ackWork(); break; } - if (activeSessions.size >= config6.maxSessions) { - logForDebugging(`[bridge:work] At capacity (${activeSessions.size}/${config6.maxSessions}), cannot spawn new session for workId=${work.id}`); + if (activeSessions.size >= config4.maxSessions) { + logForDebugging(`[bridge:work] At capacity (${activeSessions.size}/${config4.maxSessions}), cannot spawn new session for workId=${work.id}`); break; } await ackWork(); @@ -688523,18 +611089,18 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp let useCcrV2 = false; let workerEpoch; if (secret.use_code_sessions === true || isEnvTruthy(process.env.CLAUDE_BRIDGE_USE_CCR_V2)) { - sdkUrl = buildCCRv2SdkUrl(config6.apiBaseUrl, sessionId); - for (let attempt3 = 1;attempt3 <= 2; attempt3++) { + sdkUrl = buildCCRv2SdkUrl(config4.apiBaseUrl, sessionId); + for (let attempt2 = 1;attempt2 <= 2; attempt2++) { try { workerEpoch = await registerWorker(sdkUrl, secret.session_ingress_token); useCcrV2 = true; - logForDebugging(`[bridge:session] CCR v2: registered worker sessionId=${sessionId} epoch=${workerEpoch} attempt=${attempt3}`); + logForDebugging(`[bridge:session] CCR v2: registered worker sessionId=${sessionId} epoch=${workerEpoch} attempt=${attempt2}`); break; - } catch (err3) { - const errMsg = errorMessage(err3); - if (attempt3 < 2) { - logForDebugging(`[bridge:session] CCR v2: registerWorker attempt ${attempt3} failed, retrying: ${errMsg}`); - await sleep4(2000, loopSignal); + } catch (err2) { + const errMsg = errorMessage(err2); + if (attempt2 < 2) { + logForDebugging(`[bridge:session] CCR v2: registerWorker attempt ${attempt2} failed, retrying: ${errMsg}`); + await sleep2(2000, loopSignal); if (loopSignal.aborted) break; continue; @@ -688548,10 +611114,10 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp if (!useCcrV2) break; } else { - sdkUrl = buildSdkUrl(config6.sessionIngressUrl, sessionId); + sdkUrl = buildSdkUrl(config4.sessionIngressUrl, sessionId); } - const spawnModeAtDecision = config6.spawnMode; - let sessionDir = config6.dir; + const spawnModeAtDecision = config4.spawnMode; + let sessionDir = config4.dir; let worktreeCreateMs = 0; if (spawnModeAtDecision === "worktree" && (initialSessionId === undefined || !sameSessionId(sessionId, initialSessionId))) { const wtStart = Date.now(); @@ -688566,8 +611132,8 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp }); sessionDir = wt.worktreePath; logForDebugging(`[bridge:session] Created worktree for sessionId=${sessionId} at ${wt.worktreePath}`); - } catch (err3) { - const errMsg = errorMessage(err3); + } catch (err2) { + const errMsg = errorMessage(err2); logger.logError(`Failed to create worktree for session ${sessionId}: ${errMsg}`); logError2(new Error(`Worktree creation failed: ${errMsg}`)); completedWorkIds.add(work.id); @@ -688583,16 +611149,16 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp accessToken: secret.session_ingress_token, useCcrV2, workerEpoch, - onFirstUserMessage: (text2) => { + onFirstUserMessage: (text) => { if (titledSessions.has(compatSessionId)) return; titledSessions.add(compatSessionId); - const title = deriveSessionTitle(text2); + const title = deriveSessionTitle(text); logger.setSessionTitle(compatSessionId, title); logForDebugging(`[bridge:title] derived title for ${compatSessionId}: ${title}`); Promise.resolve().then(() => (init_createSession(), exports_createSession)).then(({ updateBridgeSessionTitle: updateBridgeSessionTitle2 }) => updateBridgeSessionTitle2(compatSessionId, title, { - baseUrl: config6.apiBaseUrl - })).catch((err3) => logForDebugging(`[bridge:title] failed to update title for ${compatSessionId}: ${err3}`, { level: "error" })); + baseUrl: config4.apiBaseUrl + })).catch((err2) => logForDebugging(`[bridge:title] failed to update title for ${compatSessionId}: ${err2}`, { level: "error" })); } }, sessionDir); if (typeof spawnResult === "string") { @@ -688600,7 +611166,7 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp const wt = sessionWorktrees.get(sessionId); if (wt) { sessionWorktrees.delete(sessionId); - trackCleanup(removeAgentWorktree(wt.worktreePath, wt.worktreeBranch, wt.gitRoot, wt.hookBased).catch((err3) => logger.logVerbose(`Failed to remove worktree ${wt.worktreePath}: ${errorMessage(err3)}`))); + trackCleanup(removeAgentWorktree(wt.worktreePath, wt.worktreeBranch, wt.gitRoot, wt.hookBased).catch((err2) => logger.logVerbose(`Failed to remove worktree ${wt.worktreePath}: ${errorMessage(err2)}`))); } completedWorkIds.add(work.id); trackCleanup(stopWorkWithRetry(api3, environmentId, work.id, logger, backoffConfig.stopWorkBaseDelayMs)); @@ -688631,30 +611197,30 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp logger.logSessionStart(sessionId, `Session ${sessionId}`); const safeId = safeFilenameId(sessionId); let sessionDebugFile; - if (config6.debugFile) { - const ext = config6.debugFile.lastIndexOf("."); + if (config4.debugFile) { + const ext = config4.debugFile.lastIndexOf("."); if (ext > 0) { - sessionDebugFile = `${config6.debugFile.slice(0, ext)}-${safeId}${config6.debugFile.slice(ext)}`; + sessionDebugFile = `${config4.debugFile.slice(0, ext)}-${safeId}${config4.debugFile.slice(ext)}`; } else { - sessionDebugFile = `${config6.debugFile}-${safeId}`; + sessionDebugFile = `${config4.debugFile}-${safeId}`; } - } else if (config6.verbose || process.env.USER_TYPE === "ant") { - sessionDebugFile = join161(tmpdir15(), "claude", `bridge-session-${safeId}.log`); + } else if (config4.verbose || process.env.USER_TYPE === "ant") { + sessionDebugFile = join151(tmpdir12(), "claude", `bridge-session-${safeId}.log`); } if (sessionDebugFile) { logger.logVerbose(`Debug log: ${sessionDebugFile}`); } - logger.addSession(compatSessionId, getRemoteSessionUrl(compatSessionId, config6.sessionIngressUrl)); + logger.addSession(compatSessionId, getRemoteSessionUrl(compatSessionId, config4.sessionIngressUrl)); startStatusUpdates(); logger.setAttached(compatSessionId); - fetchSessionTitle(compatSessionId, config6.apiBaseUrl).then((title) => { + fetchSessionTitle(compatSessionId, config4.apiBaseUrl).then((title) => { if (title && activeSessions.has(sessionId)) { titledSessions.add(compatSessionId); logger.setSessionTitle(compatSessionId, title); logForDebugging(`[bridge:title] server title for ${compatSessionId}: ${title}`); } - }).catch((err3) => logForDebugging(`[bridge:title] failed to fetch title for ${compatSessionId}: ${err3}`, { level: "error" })); - const timeoutMs = config6.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS; + }).catch((err2) => logForDebugging(`[bridge:title] failed to fetch title for ${compatSessionId}: ${err2}`, { level: "error" })); + const timeoutMs = config4.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS; if (timeoutMs > 0) { const timer = setTimeout(onSessionTimeout, timeoutMs, sessionId, timeoutMs, logger, timedOutSessions, handle2); sessionTimers.set(sessionId, timer); @@ -688675,51 +611241,51 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp const cap = capacityWake.signal(); if (pollConfig.non_exclusive_heartbeat_interval_ms > 0) { await heartbeatActiveWorkItems(); - await sleep4(pollConfig.non_exclusive_heartbeat_interval_ms, cap.signal); + await sleep2(pollConfig.non_exclusive_heartbeat_interval_ms, cap.signal); } else if (pollConfig.multisession_poll_interval_ms_at_capacity > 0) { - await sleep4(pollConfig.multisession_poll_interval_ms_at_capacity, cap.signal); + await sleep2(pollConfig.multisession_poll_interval_ms_at_capacity, cap.signal); } cap.cleanup(); } - } catch (err3) { + } catch (err2) { if (loopSignal.aborted) { break; } - if (err3 instanceof BridgeFatalError) { + if (err2 instanceof BridgeFatalError) { fatalExit = true; - if (isExpiredErrorType(err3.errorType)) { - logger.logStatus(err3.message); - } else if (isSuppressible403(err3)) { - logForDebugging(`[bridge:work] Suppressed 403 error: ${err3.message}`); + if (isExpiredErrorType(err2.errorType)) { + logger.logStatus(err2.message); + } else if (isSuppressible403(err2)) { + logForDebugging(`[bridge:work] Suppressed 403 error: ${err2.message}`); } else { - logger.logError(err3.message); - logError2(err3); + logger.logError(err2.message); + logError2(err2); } logEvent("tengu_bridge_fatal_error", { - status: err3.status, - error_type: err3.errorType + status: err2.status, + error_type: err2.errorType }); - logForDiagnosticsNoPII(isExpiredErrorType(err3.errorType) ? "info" : "error", "bridge_fatal_error", { status: err3.status, error_type: err3.errorType }); + logForDiagnosticsNoPII(isExpiredErrorType(err2.errorType) ? "info" : "error", "bridge_fatal_error", { status: err2.status, error_type: err2.errorType }); break; } - const errMsg = describeAxiosError(err3); - if (isConnectionError(err3) || isServerError(err3)) { - const now3 = Date.now(); - if (lastPollErrorTime !== null && now3 - lastPollErrorTime > pollSleepDetectionThresholdMs(backoffConfig)) { - logForDebugging(`[bridge:work] Detected system sleep (${Math.round((now3 - lastPollErrorTime) / 1000)}s gap), resetting error budget`); + const errMsg = describeAxiosError(err2); + if (isConnectionError(err2) || isServerError(err2)) { + const now2 = Date.now(); + if (lastPollErrorTime !== null && now2 - lastPollErrorTime > pollSleepDetectionThresholdMs(backoffConfig)) { + logForDebugging(`[bridge:work] Detected system sleep (${Math.round((now2 - lastPollErrorTime) / 1000)}s gap), resetting error budget`); logForDiagnosticsNoPII("info", "bridge_poll_sleep_detected", { - gapMs: now3 - lastPollErrorTime + gapMs: now2 - lastPollErrorTime }); connErrorStart = null; connBackoff = 0; generalErrorStart = null; generalBackoff = 0; } - lastPollErrorTime = now3; + lastPollErrorTime = now2; if (!connErrorStart) { - connErrorStart = now3; + connErrorStart = now2; } - const elapsed = now3 - connErrorStart; + const elapsed = now2 - connErrorStart; if (elapsed >= backoffConfig.connGiveUpMs) { logger.logError(`Server unreachable for ${Math.round(elapsed / 60000)} minutes, giving up.`); logEvent("tengu_bridge_poll_give_up", { @@ -688736,30 +611302,30 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp generalErrorStart = null; generalBackoff = 0; connBackoff = connBackoff ? Math.min(connBackoff * 2, backoffConfig.connCapMs) : backoffConfig.connInitialMs; - const delay3 = addJitter(connBackoff); - logger.logVerbose(`Connection error, retrying in ${formatDelay(delay3)} (${Math.round(elapsed / 1000)}s elapsed): ${errMsg}`); - logger.updateReconnectingStatus(formatDelay(delay3), formatDuration(elapsed)); + const delay2 = addJitter(connBackoff); + logger.logVerbose(`Connection error, retrying in ${formatDelay(delay2)} (${Math.round(elapsed / 1000)}s elapsed): ${errMsg}`); + logger.updateReconnectingStatus(formatDelay(delay2), formatDuration(elapsed)); if (getPollIntervalConfig().non_exclusive_heartbeat_interval_ms > 0) { await heartbeatActiveWorkItems(); } - await sleep4(delay3, loopSignal); + await sleep2(delay2, loopSignal); } else { - const now3 = Date.now(); - if (lastPollErrorTime !== null && now3 - lastPollErrorTime > pollSleepDetectionThresholdMs(backoffConfig)) { - logForDebugging(`[bridge:work] Detected system sleep (${Math.round((now3 - lastPollErrorTime) / 1000)}s gap), resetting error budget`); + const now2 = Date.now(); + if (lastPollErrorTime !== null && now2 - lastPollErrorTime > pollSleepDetectionThresholdMs(backoffConfig)) { + logForDebugging(`[bridge:work] Detected system sleep (${Math.round((now2 - lastPollErrorTime) / 1000)}s gap), resetting error budget`); logForDiagnosticsNoPII("info", "bridge_poll_sleep_detected", { - gapMs: now3 - lastPollErrorTime + gapMs: now2 - lastPollErrorTime }); connErrorStart = null; connBackoff = 0; generalErrorStart = null; generalBackoff = 0; } - lastPollErrorTime = now3; + lastPollErrorTime = now2; if (!generalErrorStart) { - generalErrorStart = now3; + generalErrorStart = now2; } - const elapsed = now3 - generalErrorStart; + const elapsed = now2 - generalErrorStart; if (elapsed >= backoffConfig.generalGiveUpMs) { logger.logError(`Persistent errors for ${Math.round(elapsed / 60000)} minutes, giving up.`); logEvent("tengu_bridge_poll_give_up", { @@ -688776,13 +611342,13 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp connErrorStart = null; connBackoff = 0; generalBackoff = generalBackoff ? Math.min(generalBackoff * 2, backoffConfig.generalCapMs) : backoffConfig.generalInitialMs; - const delay3 = addJitter(generalBackoff); - logger.logVerbose(`Poll failed, retrying in ${formatDelay(delay3)} (${Math.round(elapsed / 1000)}s elapsed): ${errMsg}`); - logger.updateReconnectingStatus(formatDelay(delay3), formatDuration(elapsed)); + const delay2 = addJitter(generalBackoff); + logger.logVerbose(`Poll failed, retrying in ${formatDelay(delay2)} (${Math.round(elapsed / 1000)}s elapsed): ${errMsg}`); + logger.updateReconnectingStatus(formatDelay(delay2), formatDuration(elapsed)); if (getPollIntervalConfig().non_exclusive_heartbeat_interval_ms > 0) { await heartbeatActiveWorkItems(); } - await sleep4(delay3, loopSignal); + await sleep2(delay2, loopSignal); } } } @@ -688813,7 +611379,7 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp const timeout = new AbortController; await Promise.race([ Promise.allSettled([...activeSessions.values()].map((h2) => h2.done)), - sleep4(backoffConfig.shutdownGraceMs ?? 30000, timeout.signal) + sleep2(backoffConfig.shutdownGraceMs ?? 30000, timeout.signal) ]); timeout.abort(); for (const [sid, handle2] of activeSessions.entries()) { @@ -688832,40 +611398,40 @@ async function runBridgeLoop(config6, environmentId, environmentSecret, api3, sp await Promise.allSettled(remainingWorktrees.map((wt) => removeAgentWorktree(wt.worktreePath, wt.worktreeBranch, wt.gitRoot, wt.hookBased))); } await Promise.allSettled([...shutdownWorkIds.entries()].map(([sessionId, workId]) => { - return api3.stopWork(environmentId, workId, true).catch((err3) => logger.logVerbose(`Failed to stop work ${workId} for session ${sessionId}: ${errorMessage(err3)}`)); + return api3.stopWork(environmentId, workId, true).catch((err2) => logger.logVerbose(`Failed to stop work ${workId} for session ${sessionId}: ${errorMessage(err2)}`)); })); } if (pendingCleanups.size > 0) { await Promise.allSettled([...pendingCleanups]); } - if (feature("KAIROS") && config6.spawnMode === "single-session" && initialSessionId && !fatalExit) { + if (feature("KAIROS") && config4.spawnMode === "single-session" && initialSessionId && !fatalExit) { logger.logStatus(`Resume this session by running \`claude remote-control --continue\``); logForDebugging(`[bridge:shutdown] Skipping archive+deregister to allow resume of session ${initialSessionId}`); return; } if (sessionsToArchive.size > 0) { logForDebugging(`[bridge:shutdown] Archiving ${sessionsToArchive.size} session(s)`); - await Promise.allSettled([...sessionsToArchive].map((sessionId) => api3.archiveSession(compatIdSnapshot.get(sessionId) ?? toCompatSessionId(sessionId)).catch((err3) => logger.logVerbose(`Failed to archive session ${sessionId}: ${errorMessage(err3)}`)))); + await Promise.allSettled([...sessionsToArchive].map((sessionId) => api3.archiveSession(compatIdSnapshot.get(sessionId) ?? toCompatSessionId(sessionId)).catch((err2) => logger.logVerbose(`Failed to archive session ${sessionId}: ${errorMessage(err2)}`)))); } try { await api3.deregisterEnvironment(environmentId); logForDebugging(`[bridge:shutdown] Environment deregistered, bridge offline`); logger.logVerbose("Environment deregistered."); - } catch (err3) { - logger.logVerbose(`Failed to deregister environment: ${errorMessage(err3)}`); + } catch (err2) { + logger.logVerbose(`Failed to deregister environment: ${errorMessage(err2)}`); } const { clearBridgePointer: clearBridgePointer2 } = await Promise.resolve().then(() => (init_bridgePointer(), exports_bridgePointer)); - await clearBridgePointer2(config6.dir); + await clearBridgePointer2(config4.dir); logger.logVerbose("Environment offline."); } -function isConnectionError(err3) { - if (err3 && typeof err3 === "object" && "code" in err3 && typeof err3.code === "string" && CONNECTION_ERROR_CODES.has(err3.code)) { +function isConnectionError(err2) { + if (err2 && typeof err2 === "object" && "code" in err2 && typeof err2.code === "string" && CONNECTION_ERROR_CODES.has(err2.code)) { return true; } return false; } -function isServerError(err3) { - return !!err3 && typeof err3 === "object" && "code" in err3 && typeof err3.code === "string" && err3.code === "ERR_BAD_RESPONSE"; +function isServerError(err2) { + return !!err2 && typeof err2 === "object" && "code" in err2 && typeof err2.code === "string" && err2.code === "ERR_BAD_RESPONSE"; } function addJitter(ms) { return Math.max(0, ms + ms * 0.25 * (2 * Math.random() - 1)); @@ -688875,29 +611441,29 @@ function formatDelay(ms) { } async function stopWorkWithRetry(api3, environmentId, workId, logger, baseDelayMs = 1000) { const MAX_ATTEMPTS = 3; - for (let attempt3 = 1;attempt3 <= MAX_ATTEMPTS; attempt3++) { + for (let attempt2 = 1;attempt2 <= MAX_ATTEMPTS; attempt2++) { try { await api3.stopWork(environmentId, workId, false); - logForDebugging(`[bridge:work] stopWork succeeded for workId=${workId} on attempt ${attempt3}/${MAX_ATTEMPTS}`); + logForDebugging(`[bridge:work] stopWork succeeded for workId=${workId} on attempt ${attempt2}/${MAX_ATTEMPTS}`); return; - } catch (err3) { - if (err3 instanceof BridgeFatalError) { - if (isSuppressible403(err3)) { - logForDebugging(`[bridge:work] Suppressed stopWork 403 for ${workId}: ${err3.message}`); + } catch (err2) { + if (err2 instanceof BridgeFatalError) { + if (isSuppressible403(err2)) { + logForDebugging(`[bridge:work] Suppressed stopWork 403 for ${workId}: ${err2.message}`); } else { - logger.logError(`Failed to stop work ${workId}: ${err3.message}`); + logger.logError(`Failed to stop work ${workId}: ${err2.message}`); } logForDiagnosticsNoPII("error", "bridge_stop_work_failed", { - attempts: attempt3, + attempts: attempt2, fatal: true }); return; } - const errMsg = errorMessage(err3); - if (attempt3 < MAX_ATTEMPTS) { - const delay3 = addJitter(baseDelayMs * Math.pow(2, attempt3 - 1)); - logger.logVerbose(`Failed to stop work ${workId} (attempt ${attempt3}/${MAX_ATTEMPTS}), retrying in ${formatDelay(delay3)}: ${errMsg}`); - await sleep4(delay3); + const errMsg = errorMessage(err2); + if (attempt2 < MAX_ATTEMPTS) { + const delay2 = addJitter(baseDelayMs * Math.pow(2, attempt2 - 1)); + logger.logVerbose(`Failed to stop work ${workId} (attempt ${attempt2}/${MAX_ATTEMPTS}), retrying in ${formatDelay(delay2)}: ${errMsg}`); + await sleep2(delay2); } else { logger.logError(`Failed to stop work ${workId} after ${MAX_ATTEMPTS} attempts: ${errMsg}`); logForDiagnosticsNoPII("error", "bridge_stop_work_failed", { @@ -688945,8 +611511,8 @@ function parseArgs(args) { let createSessionInDir; let sessionId; let continueSession = false; - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (arg === "--help" || arg === "-h") { help2 = true; } else if (arg === "--verbose" || arg === "-v") { @@ -688955,24 +611521,24 @@ function parseArgs(args) { sandbox = true; } else if (arg === "--no-sandbox") { sandbox = false; - } else if (arg === "--debug-file" && i4 + 1 < args.length) { - debugFile = resolve45(args[++i4]); + } else if (arg === "--debug-file" && i3 + 1 < args.length) { + debugFile = resolve39(args[++i3]); } else if (arg.startsWith("--debug-file=")) { - debugFile = resolve45(arg.slice("--debug-file=".length)); - } else if (arg === "--session-timeout" && i4 + 1 < args.length) { - sessionTimeoutMs = parseInt(args[++i4], 10) * 1000; + debugFile = resolve39(arg.slice("--debug-file=".length)); + } else if (arg === "--session-timeout" && i3 + 1 < args.length) { + sessionTimeoutMs = parseInt(args[++i3], 10) * 1000; } else if (arg.startsWith("--session-timeout=")) { sessionTimeoutMs = parseInt(arg.slice("--session-timeout=".length), 10) * 1000; - } else if (arg === "--permission-mode" && i4 + 1 < args.length) { - permissionMode = args[++i4]; + } else if (arg === "--permission-mode" && i3 + 1 < args.length) { + permissionMode = args[++i3]; } else if (arg.startsWith("--permission-mode=")) { permissionMode = arg.slice("--permission-mode=".length); - } else if (arg === "--name" && i4 + 1 < args.length) { - name = args[++i4]; + } else if (arg === "--name" && i3 + 1 < args.length) { + name = args[++i3]; } else if (arg.startsWith("--name=")) { name = arg.slice("--name=".length); - } else if (feature("KAIROS") && arg === "--session-id" && i4 + 1 < args.length) { - sessionId = args[++i4]; + } else if (feature("KAIROS") && arg === "--session-id" && i3 + 1 < args.length) { + sessionId = args[++i3]; if (!sessionId) { return makeError2("--session-id requires a value"); } @@ -688987,7 +611553,7 @@ function parseArgs(args) { if (spawnMode !== undefined) { return makeError2("--spawn may only be specified once"); } - const raw = arg.startsWith("--spawn=") ? arg.slice("--spawn=".length) : args[++i4]; + const raw = arg.startsWith("--spawn=") ? arg.slice("--spawn=".length) : args[++i3]; const v = parseSpawnValue(raw); if (v === "single-session" || v === "same-dir" || v === "worktree") { spawnMode = v; @@ -688998,7 +611564,7 @@ function parseArgs(args) { if (capacity !== undefined) { return makeError2("--capacity may only be specified once"); } - const raw = arg.startsWith("--capacity=") ? arg.slice("--capacity=".length) : args[++i4]; + const raw = arg.startsWith("--capacity=") ? arg.slice("--capacity=".length) : args[++i3]; const v = parseCapacityValue(raw); if (typeof v === "number") capacity = v; @@ -689036,7 +611602,7 @@ Run 'claude remote-control --help' for usage.`); continueSession, help: help2 }; - function makeError2(error46) { + function makeError2(error42) { return { verbose, sandbox, @@ -689050,7 +611616,7 @@ Run 'claude remote-control --help' for usage.`); sessionId, continueSession, help: help2, - error: error46 + error: error42 }; } } @@ -689104,8 +611670,8 @@ NOTES ${serverNote}`; console.log(help2); } -function deriveSessionTitle(text2) { - const flat = text2.replace(/\s+/g, " ").trim(); +function deriveSessionTitle(text) { + const flat = text.replace(/\s+/g, " ").trim(); return truncateToWidth(flat, TITLE_MAX_LEN); } async function fetchSessionTitle(compatSessionId, baseUrl) { @@ -689147,7 +611713,7 @@ async function bridgeMain(args) { process.exit(1); } } - const dir = resolve45("."); + const dir = resolve39("."); const { enableConfigs: enableConfigs2, checkHasTrustDialogAccepted: checkHasTrustDialogAccepted2 } = await Promise.resolve().then(() => (init_config2(), exports_config)); enableConfigs2(); const { initSinks: initSinks2 } = await Promise.resolve().then(() => (init_sinks(), exports_sinks)); @@ -689161,7 +611727,7 @@ async function bridgeMain(args) { }); await Promise.race([ Promise.all([shutdown1PEventLogging(), shutdownDatadog()]), - sleep4(500, undefined, { unref: true }) + sleep2(500, undefined, { unref: true }) ]).catch(() => {}); console.error("Error: Multi-session Remote Control is not enabled for your account yet."); process.exit(1); @@ -689173,7 +611739,7 @@ async function bridgeMain(args) { console.error(`Error: Workspace not trusted. Please run \`claude\` in ${dir} first to review and accept the workspace trust dialog.`); process.exit(1); } - const { clearOAuthTokenCache: clearOAuthTokenCache2, checkAndRefreshOAuthTokenIfNeeded: checkAndRefreshOAuthTokenIfNeeded2 } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + const { clearOAuthTokenCache: clearOAuthTokenCache2, checkAndRefreshOAuthTokenIfNeeded: checkAndRefreshOAuthTokenIfNeeded2 } = await Promise.resolve().then(() => (init_auth(), exports_auth)); const { getBridgeAccessToken: getBridgeAccessToken2, getBridgeBaseUrl: getBridgeBaseUrl3 } = await Promise.resolve().then(() => (init_bridgeConfig(), exports_bridgeConfig)); const bridgeToken = getBridgeAccessToken2(); if (!bridgeToken) { @@ -689198,8 +611764,8 @@ or the Claude app, so you can pick up where you left off on any device. You can disconnect remote access anytime by running /remote-control again. `); - const answer = await new Promise((resolve46) => { - rl.question("Enable Remote Control? (y/n) ", resolve46); + const answer = await new Promise((resolve40) => { + rl.question("Enable Remote Control? (y/n) ", resolve40); }); rl.close(); saveGlobalConfig2((current) => { @@ -689260,8 +611826,8 @@ Spawn mode for this project: ` + `This can be changed later or explicitly set with --spawn=same-dir or --spawn=worktree. `); - const answer = await new Promise((resolve46) => { - rl.question("Choose [1/2] (default: 1): ", resolve46); + const answer = await new Promise((resolve40) => { + rl.question("Choose [1/2] (default: 1): ", resolve40); }); rl.close(); const chosen = answer.trim() === "2" ? "worktree" : "same-dir"; @@ -689304,7 +611870,7 @@ Spawn mode for this project: const gitRepoUrl = await getRemoteUrl2(); const machineName = hostname4(); const bridgeId = randomUUID35(); - const { handleOAuth401Error: handleOAuth401Error2 } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + const { handleOAuth401Error: handleOAuth401Error2 } = await Promise.resolve().then(() => (init_auth(), exports_auth)); const api3 = createBridgeApiClient({ baseUrl, getAccessToken: getBridgeAccessToken2, @@ -689347,7 +611913,7 @@ Spawn mode for this project: reuseEnvironmentId = session2.environment_id; logForDebugging(`[bridge:init] Resuming session ${resumeSessionId} on environment ${reuseEnvironmentId}`); } - const config6 = { + const config4 = { dir, machineName, branch: branch2, @@ -689371,14 +611937,14 @@ Spawn mode for this project: let environmentId; let environmentSecret; try { - const reg = await api3.registerBridgeEnvironment(config6); + const reg = await api3.registerBridgeEnvironment(config4); environmentId = reg.environment_id; environmentSecret = reg.environment_secret; - } catch (err3) { + } catch (err2) { logEvent("tengu_bridge_registration_failed", { - status: err3 instanceof BridgeFatalError ? err3.status : undefined + status: err2 instanceof BridgeFatalError ? err2.status : undefined }); - console.error(err3 instanceof BridgeFatalError && err3.status === 404 ? "Remote Control environments are not available for your account." : `Error: ${errorMessage(err3)}`); + console.error(err2 instanceof BridgeFatalError && err2.status === 404 ? "Remote Control environments are not available for your account." : `Error: ${errorMessage(err2)}`); process.exit(1); } let effectiveResumeSessionId; @@ -689398,19 +611964,19 @@ Spawn mode for this project: effectiveResumeSessionId = resumeSessionId; reconnected = true; break; - } catch (err3) { - lastReconnectErr = err3; - logForDebugging(`[bridge:init] reconnectSession(${candidateId}) failed: ${errorMessage(err3)}`); + } catch (err2) { + lastReconnectErr = err2; + logForDebugging(`[bridge:init] reconnectSession(${candidateId}) failed: ${errorMessage(err2)}`); } } if (!reconnected) { - const err3 = lastReconnectErr; - const isFatal = err3 instanceof BridgeFatalError; + const err2 = lastReconnectErr; + const isFatal = err2 instanceof BridgeFatalError; if (resumePointerDir && isFatal) { const { clearBridgePointer: clearBridgePointer2 } = await Promise.resolve().then(() => (init_bridgePointer(), exports_bridgePointer)); await clearBridgePointer2(resumePointerDir); } - console.error(isFatal ? `Error: ${errorMessage(err3)}` : `Error: Failed to reconnect session ${resumeSessionId}: ${errorMessage(err3)} + console.error(isFatal ? `Error: ${errorMessage(err2)}` : `Error: Failed to reconnect session ${resumeSessionId}: ${errorMessage(err2)} The session may still be resumable — try running the same command again.`); process.exit(1); } @@ -689419,21 +611985,21 @@ The session may still be resumable — try running the same command again.`); logForDebugging(`[bridge:init] Registered, server environmentId=${environmentId}`); const startupPollConfig = getPollIntervalConfig(); logEvent("tengu_bridge_started", { - max_sessions: config6.maxSessions, - has_debug_file: !!config6.debugFile, - sandbox: config6.sandbox, - verbose: config6.verbose, + max_sessions: config4.maxSessions, + has_debug_file: !!config4.debugFile, + sandbox: config4.sandbox, + verbose: config4.verbose, heartbeat_interval_ms: startupPollConfig.non_exclusive_heartbeat_interval_ms, - spawn_mode: config6.spawnMode, + spawn_mode: config4.spawnMode, spawn_mode_source: spawnModeSource, multi_session_gate: multiSessionEnabled, pre_create_session: preCreateSession, worktree_available: worktreeAvailable }); logForDiagnosticsNoPII("info", "bridge_started", { - max_sessions: config6.maxSessions, - sandbox: config6.sandbox, - spawn_mode: config6.spawnMode + max_sessions: config4.maxSessions, + sandbox: config4.sandbox, + spawn_mode: config4.spawnMode }); const spawner = createSessionSpawner({ execPath: process.execPath, @@ -689454,7 +612020,7 @@ The session may still be resumable — try running the same command again.`); const logger = createBridgeLogger({ verbose }); const { parseGitHubRepository: parseGitHubRepository2 } = await Promise.resolve().then(() => (init_detectRepository(), exports_detectRepository)); const ownerRepo = gitRepoUrl ? parseGitHubRepository2(gitRepoUrl) : null; - const repoName = ownerRepo ? ownerRepo.split("/").pop() : basename48(dir); + const repoName = ownerRepo ? ownerRepo.split("/").pop() : basename46(dir); logger.setRepoInfo(repoName, branch2); const toggleAvailable = spawnMode !== "single-session" && worktreeAvailable; if (toggleAvailable) { @@ -689472,8 +612038,8 @@ The session may still be resumable — try running the same command again.`); if (data[0] === 119) { if (!toggleAvailable) return; - const newMode = config6.spawnMode === "same-dir" ? "worktree" : "same-dir"; - config6.spawnMode = newMode; + const newMode = config4.spawnMode === "same-dir" ? "worktree" : "same-dir"; + config4.spawnMode = newMode; logEvent("tengu_bridge_spawn_mode_toggled", { spawn_mode: newMode }); @@ -689522,8 +612088,8 @@ The session may still be resumable — try running the same command again.`); if (initialSessionId) { logForDebugging(`[bridge:init] Created initial session ${initialSessionId}`); } - } catch (err3) { - logForDebugging(`[bridge:init] Session creation failed (non-fatal): ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge:init] Session creation failed (non-fatal): ${errorMessage(err2)}`); } } let pointerRefreshTimer = null; @@ -689534,12 +612100,12 @@ The session may still be resumable — try running the same command again.`); environmentId, source: "standalone" }; - await writeBridgePointer2(config6.dir, pointerPayload); - pointerRefreshTimer = setInterval(writeBridgePointer2, 3600000, config6.dir, pointerPayload); + await writeBridgePointer2(config4.dir, pointerPayload); + pointerRefreshTimer = setInterval(writeBridgePointer2, 3600000, config4.dir, pointerPayload); pointerRefreshTimer.unref?.(); } try { - await runBridgeLoop(config6, environmentId, environmentSecret, api3, spawner, logger, controller.signal, undefined, initialSessionId ?? undefined, async () => { + await runBridgeLoop(config4, environmentId, environmentSecret, api3, spawner, logger, controller.signal, undefined, initialSessionId ?? undefined, async () => { clearOAuthTokenCache2(); await checkAndRefreshOAuthTokenIfNeeded2(); return getBridgeAccessToken2(); @@ -689559,7 +612125,7 @@ The session may still be resumable — try running the same command again.`); process.exit(0); } async function runBridgeHeadless(opts, signal) { - const { dir, log: log3 } = opts; + const { dir, log: log2 } = opts; process.chdir(dir); const { setOriginalCwd: setOriginalCwd2, setCwdState: setCwdState2 } = await Promise.resolve().then(() => (init_state(), exports_state)); setOriginalCwd2(dir); @@ -689592,7 +612158,7 @@ async function runBridgeHeadless(opts, signal) { const gitRepoUrl = await getRemoteUrl2(); const machineName = hostname4(); const bridgeId = randomUUID35(); - const config6 = { + const config4 = { dir, machineName, branch: branch2, @@ -689612,18 +612178,18 @@ async function runBridgeHeadless(opts, signal) { baseUrl, getAccessToken: opts.getAccessToken, runnerVersion: "2.1.88-custom", - onDebug: log3, + onDebug: log2, onAuth401: opts.onAuth401, getTrustedDeviceToken }); let environmentId; let environmentSecret; try { - const reg = await api3.registerBridgeEnvironment(config6); + const reg = await api3.registerBridgeEnvironment(config4); environmentId = reg.environment_id; environmentSecret = reg.environment_secret; - } catch (err3) { - throw new Error(`Bridge registration failed: ${errorMessage(err3)}`); + } catch (err2) { + throw new Error(`Bridge registration failed: ${errorMessage(err2)}`); } const spawner = createSessionSpawner({ execPath: process.execPath, @@ -689632,10 +612198,10 @@ async function runBridgeHeadless(opts, signal) { verbose: false, sandbox: opts.sandbox, permissionMode: opts.permissionMode, - onDebug: log3 + onDebug: log2 }); - const logger = createHeadlessBridgeLogger(log3); - logger.printBanner(config6, environmentId); + const logger = createHeadlessBridgeLogger(log2); + logger.printBanner(config4, environmentId); let initialSessionId; if (opts.createSessionOnStart) { const { createBridgeSession: createBridgeSession2 } = await Promise.resolve().then(() => (init_createSession(), exports_createSession)); @@ -689653,41 +612219,41 @@ async function runBridgeHeadless(opts, signal) { }); if (sid) { initialSessionId = sid; - log3(`created initial session ${sid}`); + log2(`created initial session ${sid}`); } - } catch (err3) { - log3(`session pre-creation failed (non-fatal): ${errorMessage(err3)}`); + } catch (err2) { + log2(`session pre-creation failed (non-fatal): ${errorMessage(err2)}`); } } - await runBridgeLoop(config6, environmentId, environmentSecret, api3, spawner, logger, signal, undefined, initialSessionId, async () => opts.getAccessToken()); + await runBridgeLoop(config4, environmentId, environmentSecret, api3, spawner, logger, signal, undefined, initialSessionId, async () => opts.getAccessToken()); } -function createHeadlessBridgeLogger(log3) { - const noop11 = () => {}; +function createHeadlessBridgeLogger(log2) { + const noop8 = () => {}; return { - printBanner: (cfg, envId) => log3(`registered environmentId=${envId} dir=${cfg.dir} spawnMode=${cfg.spawnMode} capacity=${cfg.maxSessions}`), - logSessionStart: (id, _prompt) => log3(`session start ${id}`), - logSessionComplete: (id, ms) => log3(`session complete ${id} (${ms}ms)`), - logSessionFailed: (id, err3) => log3(`session failed ${id}: ${err3}`), - logStatus: log3, - logVerbose: log3, - logError: (s) => log3(`error: ${s}`), - logReconnected: (ms) => log3(`reconnected after ${ms}ms`), - addSession: (id, _url4) => log3(`session attached ${id}`), - removeSession: (id) => log3(`session detached ${id}`), - updateIdleStatus: noop11, - updateReconnectingStatus: noop11, - updateSessionStatus: noop11, - updateSessionActivity: noop11, - updateSessionCount: noop11, - updateFailedStatus: noop11, - setSpawnModeDisplay: noop11, - setRepoInfo: noop11, - setDebugLogPath: noop11, - setAttached: noop11, - setSessionTitle: noop11, - clearStatus: noop11, - toggleQr: noop11, - refreshDisplay: noop11 + printBanner: (cfg, envId) => log2(`registered environmentId=${envId} dir=${cfg.dir} spawnMode=${cfg.spawnMode} capacity=${cfg.maxSessions}`), + logSessionStart: (id, _prompt) => log2(`session start ${id}`), + logSessionComplete: (id, ms) => log2(`session complete ${id} (${ms}ms)`), + logSessionFailed: (id, err2) => log2(`session failed ${id}: ${err2}`), + logStatus: log2, + logVerbose: log2, + logError: (s) => log2(`error: ${s}`), + logReconnected: (ms) => log2(`reconnected after ${ms}ms`), + addSession: (id, _url4) => log2(`session attached ${id}`), + removeSession: (id) => log2(`session detached ${id}`), + updateIdleStatus: noop8, + updateReconnectingStatus: noop8, + updateSessionStatus: noop8, + updateSessionActivity: noop8, + updateSessionCount: noop8, + updateFailedStatus: noop8, + setSpawnModeDisplay: noop8, + setRepoInfo: noop8, + setDebugLogPath: noop8, + setAttached: noop8, + setSessionTitle: noop8, + clearStatus: noop8, + toggleQr: noop8, + refreshDisplay: noop8 }; } var DEFAULT_BACKOFF, STATUS_UPDATE_INTERVAL_MS = 1000, SPAWN_SESSIONS_DEFAULT = 32, CONNECTION_ERROR_CODES, SPAWN_FLAG_VALUES, TITLE_MAX_LEN = 80, BridgeHeadlessPermanentError; @@ -689712,7 +612278,7 @@ var init_bridgeMain = __esm(() => { init_pollConfig(); init_sessionRunner(); init_trustedDevice(); - init_types16(); + init_types15(); init_workSecret(); DEFAULT_BACKOFF = { connInitialMs: 2000, @@ -689872,8 +612438,8 @@ var require_argument = __commonJS((exports) => { this.parseArg = fn; return this; } - choices(values4) { - this.argChoices = values4.slice(); + choices(values2) { + this.argChoices = values2.slice(); this.parseArg = (arg, previous) => { if (!this.argChoices.includes(arg)) { throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`); @@ -689986,23 +612552,23 @@ var require_help = __commonJS((exports) => { return argument.name(); } longestSubcommandTermLength(cmd, helper) { - return helper.visibleCommands(cmd).reduce((max5, command8) => { - return Math.max(max5, helper.subcommandTerm(command8).length); + return helper.visibleCommands(cmd).reduce((max3, command8) => { + return Math.max(max3, helper.subcommandTerm(command8).length); }, 0); } longestOptionTermLength(cmd, helper) { - return helper.visibleOptions(cmd).reduce((max5, option) => { - return Math.max(max5, helper.optionTerm(option).length); + return helper.visibleOptions(cmd).reduce((max3, option) => { + return Math.max(max3, helper.optionTerm(option).length); }, 0); } longestGlobalOptionTermLength(cmd, helper) { - return helper.visibleGlobalOptions(cmd).reduce((max5, option) => { - return Math.max(max5, helper.optionTerm(option).length); + return helper.visibleGlobalOptions(cmd).reduce((max3, option) => { + return Math.max(max3, helper.optionTerm(option).length); }, 0); } longestArgumentTermLength(cmd, helper) { - return helper.visibleArguments(cmd).reduce((max5, argument) => { - return Math.max(max5, helper.argumentTerm(argument).length); + return helper.visibleArguments(cmd).reduce((max3, argument) => { + return Math.max(max3, helper.argumentTerm(argument).length); }, 0); } commandUsage(cmd) { @@ -690139,11 +612705,11 @@ var require_help = __commonJS((exports) => { const regex2 = new RegExp(` |.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, "g"); const lines = columnText.match(regex2) || []; - return leadingStr + lines.map((line, i4) => { + return leadingStr + lines.map((line, i3) => { if (line === ` `) return ""; - return (i4 > 0 ? indentString2 : "") + line.trimEnd(); + return (i3 > 0 ? indentString2 : "") + line.trimEnd(); }).join(` `); } @@ -690223,8 +612789,8 @@ var require_option = __commonJS((exports) => { } return previous.concat(value); } - choices(values4) { - this.argChoices = values4.slice(); + choices(values2) { + this.argChoices = values2.slice(); this.parseArg = (arg, previous) => { if (!this.argChoices.includes(arg)) { throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`); @@ -690309,23 +612875,23 @@ var require_suggestSimilar = __commonJS((exports) => { if (Math.abs(a2.length - b.length) > maxDistance) return Math.max(a2.length, b.length); const d = []; - for (let i4 = 0;i4 <= a2.length; i4++) { - d[i4] = [i4]; + for (let i3 = 0;i3 <= a2.length; i3++) { + d[i3] = [i3]; } for (let j = 0;j <= b.length; j++) { d[0][j] = j; } for (let j = 1;j <= b.length; j++) { - for (let i4 = 1;i4 <= a2.length; i4++) { + for (let i3 = 1;i3 <= a2.length; i3++) { let cost2 = 1; - if (a2[i4 - 1] === b[j - 1]) { + if (a2[i3 - 1] === b[j - 1]) { cost2 = 0; } else { cost2 = 1; } - d[i4][j] = Math.min(d[i4 - 1][j] + 1, d[i4][j - 1] + 1, d[i4 - 1][j - 1] + cost2); - if (i4 > 1 && j > 1 && a2[i4 - 1] === b[j - 2] && a2[i4 - 2] === b[j - 1]) { - d[i4][j] = Math.min(d[i4][j], d[i4 - 2][j - 2] + 1); + d[i3][j] = Math.min(d[i3 - 1][j] + 1, d[i3][j - 1] + 1, d[i3 - 1][j - 1] + cost2); + if (i3 > 1 && j > 1 && a2[i3 - 1] === b[j - 2] && a2[i3 - 2] === b[j - 1]) { + d[i3][j] = Math.min(d[i3][j], d[i3 - 2][j - 2] + 1); } } } @@ -690379,8 +612945,8 @@ var require_suggestSimilar = __commonJS((exports) => { var require_command = __commonJS((exports) => { var EventEmitter5 = __require("node:events").EventEmitter; var childProcess = __require("node:child_process"); - var path26 = __require("node:path"); - var fs12 = __require("node:fs"); + var path21 = __require("node:path"); + var fs6 = __require("node:fs"); var process14 = __require("node:process"); var { Argument, humanReadableArgName } = require_argument(); var { CommanderError } = require_error(); @@ -690450,11 +613016,11 @@ var require_command = __commonJS((exports) => { return this; } _getCommandAndAncestors() { - const result3 = []; + const result2 = []; for (let command8 = this;command8; command8 = command8.parent) { - result3.push(command8); + result2.push(command8); } - return result3; + return result2; } command(nameAndArgs, actionOptsOrExecDesc, execOpts) { let desc = actionOptsOrExecDesc; @@ -690610,9 +613176,9 @@ Expecting one of '${allowedValues.join("', '")}'`); if (fn) { this._exitCallback = fn; } else { - this._exitCallback = (err3) => { - if (err3.code !== "commander.executeSubCommandAsync") { - throw err3; + this._exitCallback = (err2) => { + if (err2.code !== "commander.executeSubCommandAsync") { + throw err2; } else {} }; } @@ -690645,12 +613211,12 @@ Expecting one of '${allowedValues.join("', '")}'`); _callParseArg(target, value, previous, invalidArgumentMessage) { try { return target.parseArg(value, previous); - } catch (err3) { - if (err3.code === "commander.invalidArgument") { - const message = `${invalidArgumentMessage} ${err3.message}`; - this.error(message, { exitCode: err3.exitCode, code: err3.code }); + } catch (err2) { + if (err2.code === "commander.invalidArgument") { + const message = `${invalidArgumentMessage} ${err2.message}`; + this.error(message, { exitCode: err2.exitCode, code: err2.code }); } - throw err3; + throw err2; } } _registerOption(option) { @@ -690719,12 +613285,12 @@ Expecting one of '${allowedValues.join("', '")}'`); } return this; } - _optionEx(config6, flags, description, fn, defaultValue) { + _optionEx(config4, flags, description, fn, defaultValue) { if (typeof flags === "object" && flags instanceof Option) { throw new Error("To add an Option object use addOption() instead of option() or requiredOption()"); } const option = this.createOption(flags, description); - option.makeOptionMandatory(!!config6.mandatory); + option.makeOptionMandatory(!!config4.mandatory); if (typeof fn === "function") { option.default(defaultValue).argParser(fn); } else if (fn instanceof RegExp) { @@ -690873,12 +613439,12 @@ Expecting one of '${allowedValues.join("', '")}'`); let launchWithNode = false; const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"]; function findFile(baseDir, baseName) { - const localBin = path26.resolve(baseDir, baseName); - if (fs12.existsSync(localBin)) + const localBin = path21.resolve(baseDir, baseName); + if (fs6.existsSync(localBin)) return localBin; - if (sourceExt.includes(path26.extname(baseName))) + if (sourceExt.includes(path21.extname(baseName))) return; - const foundExt = sourceExt.find((ext) => fs12.existsSync(`${localBin}${ext}`)); + const foundExt = sourceExt.find((ext) => fs6.existsSync(`${localBin}${ext}`)); if (foundExt) return `${localBin}${foundExt}`; return; @@ -690890,23 +613456,23 @@ Expecting one of '${allowedValues.join("', '")}'`); if (this._scriptPath) { let resolvedScriptPath; try { - resolvedScriptPath = fs12.realpathSync(this._scriptPath); - } catch (err3) { + resolvedScriptPath = fs6.realpathSync(this._scriptPath); + } catch (err2) { resolvedScriptPath = this._scriptPath; } - executableDir = path26.resolve(path26.dirname(resolvedScriptPath), executableDir); + executableDir = path21.resolve(path21.dirname(resolvedScriptPath), executableDir); } if (executableDir) { let localFile = findFile(executableDir, executableFile); if (!localFile && !subcommand._executableFile && this._scriptPath) { - const legacyName = path26.basename(this._scriptPath, path26.extname(this._scriptPath)); + const legacyName = path21.basename(this._scriptPath, path21.extname(this._scriptPath)); if (legacyName !== this._name) { localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`); } } executableFile = localFile || executableFile; } - launchWithNode = sourceExt.includes(path26.extname(executableFile)); + launchWithNode = sourceExt.includes(path21.extname(executableFile)); let proc; if (process14.platform !== "win32") { if (launchWithNode) { @@ -690940,22 +613506,22 @@ Expecting one of '${allowedValues.join("', '")}'`); exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)")); } }); - proc.on("error", (err3) => { - if (err3.code === "ENOENT") { + proc.on("error", (err2) => { + if (err2.code === "ENOENT") { const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory"; const executableMissing = `'${executableFile}' does not exist - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name or path - ${executableDirMessage}`; throw new Error(executableMissing); - } else if (err3.code === "EACCES") { + } else if (err2.code === "EACCES") { throw new Error(`'${executableFile}' not executable`); } if (!exitCallback) { process14.exit(1); } else { const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)"); - wrappedError.nestedError = err3; + wrappedError.nestedError = err2; exitCallback(wrappedError); } }); @@ -690987,8 +613553,8 @@ Expecting one of '${allowedValues.join("', '")}'`); return this._dispatchSubcommand(subcommandName, [], [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? "--help"]); } _checkNumberOfArguments() { - this.registeredArguments.forEach((arg, i4) => { - if (arg.required && this.args[i4] == null) { + this.registeredArguments.forEach((arg, i3) => { + if (arg.required && this.args[i3] == null) { this.missingArgument(arg.name()); } }); @@ -691040,7 +613606,7 @@ Expecting one of '${allowedValues.join("', '")}'`); return fn(); } _chainOrCallHooks(promise4, event) { - let result3 = promise4; + let result2 = promise4; const hooks2 = []; this._getCommandAndAncestors().reverse().filter((cmd) => cmd._lifeCycleHooks[event] !== undefined).forEach((hookedCommand) => { hookedCommand._lifeCycleHooks[event].forEach((callback) => { @@ -691051,22 +613617,22 @@ Expecting one of '${allowedValues.join("', '")}'`); hooks2.reverse(); } hooks2.forEach((hookDetail) => { - result3 = this._chainOrCall(result3, () => { + result2 = this._chainOrCall(result2, () => { return hookDetail.callback(hookDetail.hookedCommand, this); }); }); - return result3; + return result2; } _chainOrCallSubCommandHook(promise4, subCommand, event) { - let result3 = promise4; + let result2 = promise4; if (this._lifeCycleHooks[event] !== undefined) { this._lifeCycleHooks[event].forEach((hook) => { - result3 = this._chainOrCall(result3, () => { + result2 = this._chainOrCall(result2, () => { return hook(this, subCommand); }); }); } - return result3; + return result2; } _parseCommand(operands, unknown5) { const parsed = this.parseOptions(unknown5); @@ -691269,13 +613835,13 @@ Expecting one of '${allowedValues.join("', '")}'`); } opts() { if (this._storeOptionsAsProperties) { - const result3 = {}; + const result2 = {}; const len = this.options.length; - for (let i4 = 0;i4 < len; i4++) { - const key = this.options[i4].attributeName(); - result3[key] = key === this._versionOptionName ? this._version : this[key]; + for (let i3 = 0;i3 < len; i3++) { + const key = this.options[i3].attributeName(); + result2[key] = key === this._versionOptionName ? this._version : this[key]; } - return result3; + return result2; } return this._optionValues; } @@ -691293,9 +613859,9 @@ Expecting one of '${allowedValues.join("', '")}'`); `); this.outputHelp({ error: true }); } - const config6 = errorOptions || {}; - const exitCode = config6.exitCode || 1; - const code = config6.code || "commander.error"; + const config4 = errorOptions || {}; + const exitCode = config4.exitCode || 1; + const code = config4.code || "commander.error"; this._exit(exitCode, code, message); } _parseOptionsEnv() { @@ -691472,13 +614038,13 @@ Expecting one of '${allowedValues.join("', '")}'`); return this; } nameFromFilename(filename) { - this._name = path26.basename(filename, path26.extname(filename)); + this._name = path21.basename(filename, path21.extname(filename)); return this; } - executableDir(path27) { - if (path27 === undefined) + executableDir(path22) { + if (path22 === undefined) return this._executableDir; - this._executableDir = path27; + this._executableDir = path22; return this; } helpInformation(contextOptions) { @@ -691556,7 +614122,7 @@ Expecting one of '${allowedValues.join("', '")}'`); } this._exit(exitCode, "commander.help", "(outputHelp)"); } - addHelpText(position, text2) { + addHelpText(position, text) { const allowedValues = ["beforeAll", "before", "after", "afterAll"]; if (!allowedValues.includes(position)) { throw new Error(`Unexpected value for position to addHelpText. @@ -691565,10 +614131,10 @@ Expecting one of '${allowedValues.join("', '")}'`); const helpEvent = `${position}Help`; this.on(helpEvent, (context2) => { let helpStr; - if (typeof text2 === "function") { - helpStr = text2({ error: context2.error, command: context2.command }); + if (typeof text === "function") { + helpStr = text({ error: context2.error, command: context2.command }); } else { - helpStr = text2; + helpStr = text; } if (helpStr) { context2.write(`${helpStr} @@ -691657,7 +614223,7 @@ var require_extra_typings = __commonJS((exports, module) => { // node_modules/@commander-js/extra-typings/esm.mjs var import__6, program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help; -var init_esm8 = __esm(() => { +var init_esm7 = __esm(() => { import__6 = __toESM(require_extra_typings(), 1); ({ program, @@ -691715,13 +614281,13 @@ function getExtraCertsPathFromConfig() { const settings = getSettingsForSource("userSettings"); const settingsEnv = settings?.env; logForDebugging(`CA certs: Config fallback - globalEnv keys: ${globalEnv ? Object.keys(globalEnv).join(",") : "none"}, settingsEnv keys: ${settingsEnv ? Object.keys(settingsEnv).join(",") : "none"}`); - const path26 = settingsEnv?.NODE_EXTRA_CA_CERTS || globalEnv?.NODE_EXTRA_CA_CERTS; - if (path26) { - logForDebugging(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${path26}`); + const path21 = settingsEnv?.NODE_EXTRA_CA_CERTS || globalEnv?.NODE_EXTRA_CA_CERTS; + if (path21) { + logForDebugging(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${path21}`); } - return path26; - } catch (error46) { - logForDebugging(`CA certs: Config fallback failed: ${error46}`, { + return path21; + } catch (error42) { + logForDebugging(`CA certs: Config fallback failed: ${error42}`, { level: "error" }); return; @@ -691734,45 +614300,45 @@ var init_caCertsConfig = __esm(() => { }); // src/utils/managedEnv.ts -function withoutSSHTunnelVars(env5) { - if (!env5 || !process.env.ANTHROPIC_UNIX_SOCKET) - return env5 || {}; +function withoutSSHTunnelVars(env4) { + if (!env4 || !process.env.ANTHROPIC_UNIX_SOCKET) + return env4 || {}; const { ANTHROPIC_UNIX_SOCKET: _1, ANTHROPIC_BASE_URL: _2, ANTHROPIC_API_KEY: _3, ANTHROPIC_AUTH_TOKEN: _4, CLAUDE_CODE_OAUTH_TOKEN: _5, - ...rest3 - } = env5; - return rest3; + ...rest2 + } = env4; + return rest2; } -function withoutHostManagedProviderVars(env5) { - if (!env5) +function withoutHostManagedProviderVars(env4) { + if (!env4) return {}; if (!isEnvTruthy(process.env.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST)) { - return env5; + return env4; } const out = {}; - for (const [key, value] of Object.entries(env5)) { + for (const [key, value] of Object.entries(env4)) { if (!isProviderManagedEnvVar(key)) { out[key] = value; } } return out; } -function withoutCcdSpawnEnvKeys(env5) { - if (!env5 || !ccdSpawnEnvKeys) - return env5 || {}; +function withoutCcdSpawnEnvKeys(env4) { + if (!env4 || !ccdSpawnEnvKeys) + return env4 || {}; const out = {}; - for (const [key, value] of Object.entries(env5)) { + for (const [key, value] of Object.entries(env4)) { if (!ccdSpawnEnvKeys.has(key)) out[key] = value; } return out; } -function filterSettingsEnv(env5) { - return withoutCcdSpawnEnvKeys(withoutHostManagedProviderVars(withoutSSHTunnelVars(env5))); +function filterSettingsEnv(env4) { + return withoutCcdSpawnEnvKeys(withoutHostManagedProviderVars(withoutSSHTunnelVars(env4))); } function applySafeConfigEnvironmentVariables() { if (ccdSpawnEnvKeys === undefined) { @@ -691822,7 +614388,7 @@ var init_managedEnv = __esm(() => { }); // src/upstreamproxy/relay.ts -import { createServer as createServer8 } from "node:net"; +import { createServer as createServer6 } from "node:net"; function encodeChunk(data) { const len = data.length; const varint = []; @@ -691845,20 +614411,20 @@ function decodeChunk(buf) { return null; let len = 0; let shift = 0; - let i4 = 1; - while (i4 < buf.length) { - const b = buf[i4]; + let i3 = 1; + while (i3 < buf.length) { + const b = buf[i3]; len |= (b & 127) << shift; - i4++; + i3++; if ((b & 128) === 0) break; shift += 7; if (shift > 28) return null; } - if (i4 + len > buf.length) + if (i3 + len > buf.length) return null; - return buf.subarray(i4, i4 + len); + return buf.subarray(i3, i3 + len); } function newConnState() { return { @@ -691904,10 +614470,10 @@ function startBunRelay(wsUrl, authHeader, wsAuthHeader) { drain(sock) { const st = sock.data; while (st.writeBuf.length > 0) { - const chunk4 = st.writeBuf[0]; - const n3 = sock.write(chunk4); - if (n3 < chunk4.length) { - st.writeBuf[0] = chunk4.subarray(n3); + const chunk3 = st.writeBuf[0]; + const n3 = sock.write(chunk3); + if (n3 < chunk3.length) { + st.writeBuf[0] = chunk3.subarray(n3); return; } st.writeBuf.shift(); @@ -691916,8 +614482,8 @@ function startBunRelay(wsUrl, authHeader, wsAuthHeader) { close(sock) { cleanupConn(sock.data); }, - error(sock, err3) { - logForDebugging(`[upstreamproxy] client socket error: ${err3.message}`); + error(sock, err2) { + logForDebugging(`[upstreamproxy] client socket error: ${err2.message}`); cleanupConn(sock.data); } } @@ -691930,7 +614496,7 @@ function startBunRelay(wsUrl, authHeader, wsAuthHeader) { async function startNodeRelay(wsUrl, authHeader, wsAuthHeader) { nodeWSCtor = (await Promise.resolve().then(() => (init_wrapper(), exports_wrapper))).default; const states = new WeakMap; - const server = createServer8((sock) => { + const server = createServer6((sock) => { const st = newConnState(); states.set(sock, st); const adapter2 = { @@ -691941,20 +614507,20 @@ async function startNodeRelay(wsUrl, authHeader, wsAuthHeader) { }; sock.on("data", (data) => handleData(adapter2, st, data, wsUrl, authHeader, wsAuthHeader)); sock.on("close", () => cleanupConn(states.get(sock))); - sock.on("error", (err3) => { - logForDebugging(`[upstreamproxy] client socket error: ${err3.message}`); + sock.on("error", (err2) => { + logForDebugging(`[upstreamproxy] client socket error: ${err2.message}`); cleanupConn(states.get(sock)); }); }); - return new Promise((resolve46, reject3) => { - server.once("error", reject3); + return new Promise((resolve40, reject2) => { + server.once("error", reject2); server.listen(0, "127.0.0.1", () => { const addr = server.address(); if (addr === null || typeof addr === "string") { - reject3(new Error("upstreamproxy: server has no TCP address")); + reject2(new Error("upstreamproxy: server has no TCP address")); return; } - resolve46({ + resolve40({ port: addr.port, stop: () => server.close() }); @@ -692023,11 +614589,11 @@ function openTunnel(sock, st, connectLine, wsUrl, authHeader, wsAuthHeader) { ws.binaryType = "arraybuffer"; st.ws = ws; ws.onopen = () => { - const head3 = `${connectLine}\r + const head2 = `${connectLine}\r Proxy-Authorization: ${authHeader}\r \r `; - ws.send(encodeChunk(Buffer.from(head3, "utf8"))); + ws.send(encodeChunk(Buffer.from(head2, "utf8"))); st.wsOpen = true; for (const buf of st.pending) { forwardToWs(ws, buf); @@ -692074,8 +614640,8 @@ function forwardToWs(ws, data) { if (ws.readyState !== WebSocket.OPEN) return; for (let off = 0;off < data.length; off += MAX_CHUNK_BYTES) { - const slice3 = data.subarray(off, off + MAX_CHUNK_BYTES); - ws.send(encodeChunk(slice3)); + const slice2 = data.subarray(off, off + MAX_CHUNK_BYTES); + ws.send(encodeChunk(slice2)); } } function cleanupConn(st) { @@ -692106,9 +614672,9 @@ __export(exports_upstreamproxy, { getUpstreamProxyEnv: () => getUpstreamProxyEnv, SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH }); -import { mkdir as mkdir54, readFile as readFile59, unlink as unlink28, writeFile as writeFile55 } from "fs/promises"; -import { homedir as homedir37 } from "os"; -import { join as join162 } from "path"; +import { mkdir as mkdir54, readFile as readFile58, unlink as unlink28, writeFile as writeFile53 } from "fs/promises"; +import { homedir as homedir35 } from "os"; +import { join as join152 } from "path"; async function initUpstreamProxy(opts) { if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) { return state; @@ -692129,7 +614695,7 @@ async function initUpstreamProxy(opts) { } setNonDumpable(); const baseUrl = opts?.ccrBaseUrl ?? process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com"; - const caBundlePath = opts?.caBundlePath ?? join162(homedir37(), ".ccr", "ca-bundle.crt"); + const caBundlePath = opts?.caBundlePath ?? join152(homedir35(), ".ccr", "ca-bundle.crt"); const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath); if (!caOk) return state; @@ -692144,8 +614710,8 @@ async function initUpstreamProxy(opts) { level: "warn" }); }); - } catch (err3) { - logForDebugging(`[upstreamproxy] relay start failed: ${err3 instanceof Error ? err3.message : String(err3)}; proxy disabled`, { level: "warn" }); + } catch (err2) { + logForDebugging(`[upstreamproxy] relay start failed: ${err2 instanceof Error ? err2.message : String(err2)}; proxy disabled`, { level: "warn" }); } return state; } @@ -692185,14 +614751,14 @@ function getUpstreamProxyEnv() { function resetUpstreamProxyForTests() { state = { enabled: false }; } -async function readToken(path26) { +async function readToken(path21) { try { - const raw = await readFile59(path26, "utf8"); + const raw = await readFile58(path21, "utf8"); return raw.trim() || null; - } catch (err3) { - if (isENOENT(err3)) + } catch (err2) { + if (isENOENT(err2)) return null; - logForDebugging(`[upstreamproxy] token read failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" }); + logForDebugging(`[upstreamproxy] token read failed: ${err2 instanceof Error ? err2.message : String(err2)}`, { level: "warn" }); return null; } } @@ -692214,8 +614780,8 @@ function setNonDumpable() { level: "warn" }); } - } catch (err3) { - logForDebugging(`[upstreamproxy] prctl unavailable: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" }); + } catch (err2) { + logForDebugging(`[upstreamproxy] prctl unavailable: ${err2 instanceof Error ? err2.message : String(err2)}`, { level: "warn" }); } } async function downloadCaBundle(baseUrl, systemCaPath, outPath) { @@ -692228,13 +614794,13 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) { return false; } const ccrCa = await resp.text(); - const systemCa = await readFile59(systemCaPath, "utf8").catch(() => ""); - await mkdir54(join162(outPath, ".."), { recursive: true }); - await writeFile55(outPath, systemCa + ` + const systemCa = await readFile58(systemCaPath, "utf8").catch(() => ""); + await mkdir54(join152(outPath, ".."), { recursive: true }); + await writeFile53(outPath, systemCa + ` ` + ccrCa, "utf8"); return true; - } catch (err3) { - logForDebugging(`[upstreamproxy] ca-cert download failed: ${err3 instanceof Error ? err3.message : String(err3)}; proxy disabled`, { level: "warn" }); + } catch (err2) { + logForDebugging(`[upstreamproxy] ca-cert download failed: ${err2 instanceof Error ? err2.message : String(err2)}; proxy disabled`, { level: "warn" }); return false; } } @@ -692404,32 +614970,32 @@ function InvalidConfigDialog(t0) { return t8; } async function showInvalidConfigDialog({ - error: error46 + error: error42 }) { const renderOptions = { ...getBaseRenderOptions(false), theme: SAFE_ERROR_THEME_NAME }; - await new Promise(async (resolve46) => { + await new Promise(async (resolve40) => { const { unmount } = await render(/* @__PURE__ */ jsx_dev_runtime370.jsxDEV(AppStateProvider, { children: /* @__PURE__ */ jsx_dev_runtime370.jsxDEV(KeybindingSetup, { children: /* @__PURE__ */ jsx_dev_runtime370.jsxDEV(InvalidConfigDialog, { - filePath: error46.filePath, - errorDescription: error46.message, + filePath: error42.filePath, + errorDescription: error42.message, onExit: () => { unmount(); - resolve46(); + resolve40(); process.exit(1); }, onReset: () => { - writeFileSync_DEPRECATED(error46.filePath, jsonStringify(error46.defaultConfig, null, 2), { + writeFileSync_DEPRECATED(error42.filePath, jsonStringify(error42.defaultConfig, null, 2), { flush: false, encoding: "utf8" }); unmount(); - resolve46(); + resolve40(); process.exit(0); } }, undefined, false, undefined, this) @@ -692454,8 +615020,8 @@ var init_InvalidConfigDialog = __esm(() => { function initializeTelemetryAfterTrust() { if (isEligibleForRemoteManagedSettings()) { if (getIsNonInteractiveSession() && isBetaTracingEnabled()) { - doInitializeTelemetry().catch((error46) => { - logForDebugging(`[3P telemetry] Eager telemetry init failed (beta tracing): ${errorMessage(error46)}`, { level: "error" }); + doInitializeTelemetry().catch((error42) => { + logForDebugging(`[3P telemetry] Eager telemetry init failed (beta tracing): ${errorMessage(error42)}`, { level: "error" }); }); } logForDebugging("[3P telemetry] Waiting for remote managed settings before telemetry init"); @@ -692463,12 +615029,12 @@ function initializeTelemetryAfterTrust() { logForDebugging("[3P telemetry] Remote managed settings loaded, initializing telemetry"); applyConfigEnvironmentVariables(); await doInitializeTelemetry(); - }).catch((error46) => { - logForDebugging(`[3P telemetry] Telemetry init failed (remote settings path): ${errorMessage(error46)}`, { level: "error" }); + }).catch((error42) => { + logForDebugging(`[3P telemetry] Telemetry init failed (remote settings path): ${errorMessage(error42)}`, { level: "error" }); }); } else { - doInitializeTelemetry().catch((error46) => { - logForDebugging(`[3P telemetry] Telemetry init failed: ${errorMessage(error46)}`, { level: "error" }); + doInitializeTelemetry().catch((error42) => { + logForDebugging(`[3P telemetry] Telemetry init failed: ${errorMessage(error42)}`, { level: "error" }); }); } } @@ -692479,9 +615045,9 @@ async function doInitializeTelemetry() { telemetryInitialized = true; try { await setMeterState(); - } catch (error46) { + } catch (error42) { telemetryInitialized = false; - throw error46; + throw error42; } } async function setMeterState() { @@ -692505,8 +615071,8 @@ async function setMeterState() { getSessionCounter()?.add(1); } } -var telemetryInitialized = false, init2; -var init_init3 = __esm(() => { +var telemetryInitialized = false, init; +var init_init2 = __esm(() => { init_startupProfiler(); init_state(); init_config2(); @@ -692535,7 +615101,7 @@ var init_init3 = __esm(() => { init_betaSessionTracing(); init_telemetryAttributes(); init_windowsPaths(); - init2 = memoize_default(async () => { + init = memoize_default(async () => { const initStartTime = Date.now(); logForDiagnosticsNoPII("info", "init_started"); profileCheckpoint("init_function_start"); @@ -692600,8 +615166,8 @@ var init_init3 = __esm(() => { const { registerUpstreamProxyEnvFn: registerUpstreamProxyEnvFn2 } = await Promise.resolve().then(() => (init_subprocessEnv(), exports_subprocessEnv)); registerUpstreamProxyEnvFn2(getUpstreamProxyEnv2); await initUpstreamProxy2(); - } catch (err3) { - logForDebugging(`[init] upstreamproxy init failed: ${err3 instanceof Error ? err3.message : String(err3)}; continuing without proxy`, { level: "warn" }); + } catch (err2) { + logForDebugging(`[init] upstreamproxy init failed: ${err2 instanceof Error ? err2.message : String(err2)}; continuing without proxy`, { level: "warn" }); } } setShellIfWindows(); @@ -692621,17 +615187,17 @@ var init_init3 = __esm(() => { duration_ms: Date.now() - initStartTime }); profileCheckpoint("init_function_end"); - } catch (error46) { - if (error46 instanceof ConfigParseError) { + } catch (error42) { + if (error42 instanceof ConfigParseError) { if (getIsNonInteractiveSession()) { - process.stderr.write(`Configuration error in ${error46.filePath}: ${error46.message} + process.stderr.write(`Configuration error in ${error42.filePath}: ${error42.message} `); gracefulShutdownSync(1); return; } - return Promise.resolve().then(() => (init_InvalidConfigDialog(), exports_InvalidConfigDialog)).then((m) => m.showInvalidConfigDialog({ error: error46 })); + return Promise.resolve().then(() => (init_InvalidConfigDialog(), exports_InvalidConfigDialog)).then((m) => m.showInvalidConfigDialog({ error: error42 })); } else { - throw error46; + throw error42; } } }); @@ -692728,24 +615294,24 @@ function createStatsStore() { s.add(value); }, getAll() { - const result3 = Object.fromEntries(metrics); + const result2 = Object.fromEntries(metrics); for (const [name, h2] of histograms) { if (h2.count === 0) { continue; } - result3[`${name}_count`] = h2.count; - result3[`${name}_min`] = h2.min; - result3[`${name}_max`] = h2.max; - result3[`${name}_avg`] = h2.sum / h2.count; + result2[`${name}_count`] = h2.count; + result2[`${name}_min`] = h2.min; + result2[`${name}_max`] = h2.max; + result2[`${name}_avg`] = h2.sum / h2.count; const sorted = [...h2.reservoir].sort((a2, b) => a2 - b); - result3[`${name}_p50`] = percentile(sorted, 50); - result3[`${name}_p95`] = percentile(sorted, 95); - result3[`${name}_p99`] = percentile(sorted, 99); + result2[`${name}_p50`] = percentile(sorted, 50); + result2[`${name}_p95`] = percentile(sorted, 95); + result2[`${name}_p99`] = percentile(sorted, 99); } for (const [name, s] of sets) { - result3[name] = s.size; + result2[name] = s.size; } - return result3; + return result2; } }; } @@ -692933,14 +615499,14 @@ function onChangeAppState({ if (newState.settings.env !== oldState.settings.env) { applyConfigEnvironmentVariables(); } - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); } } } var init_onChangeAppState = __esm(() => { init_state(); - init_auth2(); + init_auth(); init_config2(); init_errors(); init_log3(); @@ -693241,7 +615807,7 @@ var init_IdleReturnDialog = __esm(() => { }); // src/services/preventSleep.ts -import { spawn as spawn13 } from "child_process"; +import { spawn as spawn10 } from "child_process"; function startPreventSleep() { refCount++; if (refCount === 1) { @@ -693292,20 +615858,20 @@ function spawnCaffeinate() { if (caffeinateProcess !== null) { return; } - if (!cleanupRegistered6) { - cleanupRegistered6 = true; + if (!cleanupRegistered5) { + cleanupRegistered5 = true; registerCleanup(async () => { forceStopPreventSleep(); }); } try { - caffeinateProcess = spawn13("caffeinate", ["-i", "-t", String(CAFFEINATE_TIMEOUT_SECONDS)], { + caffeinateProcess = spawn10("caffeinate", ["-i", "-t", String(CAFFEINATE_TIMEOUT_SECONDS)], { stdio: "ignore" }); caffeinateProcess.unref(); const thisProc = caffeinateProcess; - caffeinateProcess.on("error", (err3) => { - logForDebugging(`caffeinate spawn error: ${err3.message}`); + caffeinateProcess.on("error", (err2) => { + logForDebugging(`caffeinate spawn error: ${err2.message}`); if (caffeinateProcess === thisProc) caffeinateProcess = null; }); @@ -693328,7 +615894,7 @@ function killCaffeinate() { } catch {} } } -var CAFFEINATE_TIMEOUT_SECONDS = 300, RESTART_INTERVAL_MS, caffeinateProcess = null, restartInterval = null, refCount = 0, cleanupRegistered6 = false; +var CAFFEINATE_TIMEOUT_SECONDS = 300, RESTART_INTERVAL_MS, caffeinateProcess = null, restartInterval = null, refCount = 0, cleanupRegistered5 = false; var init_preventSleep = __esm(() => { init_cleanupRegistry(); init_debug(); @@ -693618,14 +616184,14 @@ var init_WorkerPendingPermission = __esm(() => { }); // src/hooks/useLogMessages.ts -function useLogMessages(messages, ignore7 = false) { +function useLogMessages(messages, ignore6 = false) { const teamContext = useAppState((s) => s.teamContext); const lastRecordedLengthRef = import_react203.useRef(0); const lastParentUuidRef = import_react203.useRef(undefined); const firstMessageUuidRef = import_react203.useRef(undefined); const callSeqRef = import_react203.useRef(0); import_react203.useEffect(() => { - if (ignore7) + if (ignore6) return; const currentFirstUuid = messages[0]?.uuid; const prevLength = lastRecordedLengthRef.current; @@ -693635,10 +616201,10 @@ function useLogMessages(messages, ignore7 = false) { const startIndex = isIncremental ? prevLength : 0; if (startIndex === messages.length) return; - const slice3 = startIndex === 0 ? messages : messages.slice(startIndex); + const slice2 = startIndex === 0 ? messages : messages.slice(startIndex); const parentHint = isIncremental ? lastParentUuidRef.current : undefined; const seq = ++callSeqRef.current; - recordTranscript(slice3, isAgentSwarmsEnabled() ? { + recordTranscript(slice2, isAgentSwarmsEnabled() ? { teamName: teamContext?.teamName, agentName: teamContext?.selfAgentName } : {}, parentHint, messages).then((lastRecordedUuid) => { @@ -693649,13 +616215,13 @@ function useLogMessages(messages, ignore7 = false) { } }); if (isIncremental || wasFirstRender || isSameHeadShrink) { - const last3 = cleanMessagesForLogging(slice3, messages).findLast(isChainParticipant); - if (last3) - lastParentUuidRef.current = last3.uuid; + const last2 = cleanMessagesForLogging(slice2, messages).findLast(isChainParticipant); + if (last2) + lastParentUuidRef.current = last2.uuid; } lastRecordedLengthRef.current = messages.length; firstMessageUuidRef.current = currentFirstUuid; - }, [messages, ignore7, teamContext?.teamName, teamContext?.selfAgentName]); + }, [messages, ignore6, teamContext?.teamName, teamContext?.selfAgentName]); } var import_react203; var init_useLogMessages = __esm(() => { @@ -693682,10 +616248,10 @@ function extractInboundMessageFields(msg) { return; if (Array.isArray(content) && content.length === 0) return; - const uuid8 = "uuid" in msg && typeof msg.uuid === "string" ? msg.uuid : undefined; + const uuid5 = "uuid" in msg && typeof msg.uuid === "string" ? msg.uuid : undefined; return { content: Array.isArray(content) ? normalizeImageBlocks(content) : content, - uuid: uuid8 + uuid: uuid5 }; } function normalizeImageBlocks(blocks) { @@ -693719,9 +616285,9 @@ var init_inboundMessages = __esm(() => { var exports_udsMessaging = {}; __export(exports_udsMessaging, { default: () => udsMessaging_default, - __stub__: () => __stub__27 + __stub__: () => __stub__34 }); -var udsMessaging_default, __stub__27 = true; +var udsMessaging_default, __stub__34 = true; var init_udsMessaging = __esm(() => { udsMessaging_default = {}; }); @@ -693740,9 +616306,9 @@ function buildSystemInitMessage(inputs) { cwd: getCwd(), session_id: getSessionId(), tools: inputs.tools.map((tool) => sdkCompatToolName(tool.name)), - mcp_servers: inputs.mcpClients.map((client5) => ({ - name: client5.name, - status: client5.type + mcp_servers: inputs.mcpClients.map((client2) => ({ + name: client2.name, + status: client2.type })), model: inputs.model, permissionMode: inputs.permissionMode, @@ -693771,7 +616337,7 @@ var init_systemInit = __esm(() => { init_state(); init_outputStyles(); init_constants3(); - init_auth2(); + init_auth(); init_cwd2(); init_fastMode(); init_settings2(); @@ -693850,19 +616416,19 @@ function handleIngressMessage(data, recentPostedUUIDs, recentInboundUUIDs, onInb } if (!isSDKMessage(parsed)) return; - const uuid8 = "uuid" in parsed && typeof parsed.uuid === "string" ? parsed.uuid : undefined; - if (uuid8 && recentPostedUUIDs.has(uuid8)) { - logForDebugging(`[bridge:repl] Ignoring echo: type=${parsed.type} uuid=${uuid8}`); + const uuid5 = "uuid" in parsed && typeof parsed.uuid === "string" ? parsed.uuid : undefined; + if (uuid5 && recentPostedUUIDs.has(uuid5)) { + logForDebugging(`[bridge:repl] Ignoring echo: type=${parsed.type} uuid=${uuid5}`); return; } - if (uuid8 && recentInboundUUIDs.has(uuid8)) { - logForDebugging(`[bridge:repl] Ignoring re-delivered inbound: type=${parsed.type} uuid=${uuid8}`); + if (uuid5 && recentInboundUUIDs.has(uuid5)) { + logForDebugging(`[bridge:repl] Ignoring re-delivered inbound: type=${parsed.type} uuid=${uuid5}`); return; } - logForDebugging(`[bridge:repl] Ingress message type=${parsed.type}${uuid8 ? ` uuid=${uuid8}` : ""}`); + logForDebugging(`[bridge:repl] Ingress message type=${parsed.type}${uuid5 ? ` uuid=${uuid5}` : ""}`); if (parsed.type === "user") { - if (uuid8) - recentInboundUUIDs.add(uuid8); + if (uuid5) + recentInboundUUIDs.add(uuid5); logEvent("tengu_bridge_message_received", { is_repl: true }); @@ -693870,8 +616436,8 @@ function handleIngressMessage(data, recentPostedUUIDs, recentInboundUUIDs, onInb } else { logForDebugging(`[bridge:repl] Ignoring non-user inbound message: type=${parsed.type}`); } - } catch (err3) { - logForDebugging(`[bridge:repl] Failed to parse ingress message: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge:repl] Failed to parse ingress message: ${errorMessage(err2)}`); } } function handleServerControlRequest(request, handlers) { @@ -694018,19 +616584,19 @@ class BoundedUUIDSet { this.capacity = capacity; this.ring = new Array(capacity); } - add(uuid8) { - if (this.set.has(uuid8)) + add(uuid5) { + if (this.set.has(uuid5)) return; const evicted = this.ring[this.writeIdx]; if (evicted !== undefined) { this.set.delete(evicted); } - this.ring[this.writeIdx] = uuid8; - this.set.add(uuid8); + this.ring[this.writeIdx] = uuid5; + this.set.add(uuid5); this.writeIdx = (this.writeIdx + 1) % this.capacity; } - has(uuid8) { - return this.set.has(uuid8); + has(uuid5) { + return this.set.has(uuid5); } clear() { this.set.clear(); @@ -694059,8 +616625,8 @@ class SerialBatchEventUploader { flushResolvers = []; droppedBatches = 0; config; - constructor(config6) { - this.config = config6; + constructor(config4) { + this.config = config4; } get droppedBatchCount() { return this.droppedBatches; @@ -694075,8 +616641,8 @@ class SerialBatchEventUploader { if (items.length === 0) return; while (this.pending.length + items.length > this.config.maxQueueSize && !this.closed) { - await new Promise((resolve46) => { - this.backpressureResolvers.push(resolve46); + await new Promise((resolve40) => { + this.backpressureResolvers.push(resolve40); }); } if (this.closed) @@ -694089,8 +616655,8 @@ class SerialBatchEventUploader { return Promise.resolve(); } this.drain(); - return new Promise((resolve46) => { - this.flushResolvers.push(resolve46); + return new Promise((resolve40) => { + this.flushResolvers.push(resolve40); }); } close() { @@ -694101,11 +616667,11 @@ class SerialBatchEventUploader { this.pending = []; this.sleepResolve?.(); this.sleepResolve = null; - for (const resolve46 of this.backpressureResolvers) - resolve46(); + for (const resolve40 of this.backpressureResolvers) + resolve40(); this.backpressureResolvers = []; - for (const resolve46 of this.flushResolvers) - resolve46(); + for (const resolve40 of this.flushResolvers) + resolve40(); this.flushResolvers = []; } async drain() { @@ -694121,7 +616687,7 @@ class SerialBatchEventUploader { try { await this.config.send(batch); failures = 0; - } catch (err3) { + } catch (err2) { failures++; if (this.config.maxConsecutiveFailures !== undefined && failures >= this.config.maxConsecutiveFailures) { this.droppedBatches++; @@ -694131,7 +616697,7 @@ class SerialBatchEventUploader { continue; } this.pending = batch.concat(this.pending); - const retryAfterMs = err3 instanceof RetryableError ? err3.retryAfterMs : undefined; + const retryAfterMs = err2 instanceof RetryableError ? err2.retryAfterMs : undefined; await this.sleep(this.retryDelay(failures, retryAfterMs)); continue; } @@ -694140,8 +616706,8 @@ class SerialBatchEventUploader { } finally { this.draining = false; if (this.pending.length === 0) { - for (const resolve46 of this.flushResolvers) - resolve46(); + for (const resolve40 of this.flushResolvers) + resolve40(); this.flushResolvers = []; } } @@ -694180,16 +616746,16 @@ class SerialBatchEventUploader { releaseBackpressure() { const resolvers2 = this.backpressureResolvers; this.backpressureResolvers = []; - for (const resolve46 of resolvers2) - resolve46(); + for (const resolve40 of resolvers2) + resolve40(); } sleep(ms) { - return new Promise((resolve46) => { - this.sleepResolve = resolve46; - setTimeout((self2, resolve47) => { + return new Promise((resolve40) => { + this.sleepResolve = resolve40; + setTimeout((self2, resolve41) => { self2.sleepResolve = null; - resolve47(); - }, ms, this, resolve46); + resolve41(); + }, ms, this, resolve40); }); } } @@ -694333,8 +616899,8 @@ class WebSocketTransport2 { this.onData(message); } }; - onNodeError = (err3) => { - logForDebugging(`WebSocketTransport: Error: ${err3.message}`, { + onNodeError = (err2) => { + logForDebugging(`WebSocketTransport: Error: ${err2.message}`, { level: "error" }); logForDiagnosticsNoPII("error", "cli_websocket_connect_error"); @@ -694382,8 +616948,8 @@ class WebSocketTransport2 { this.ws.send(line); this.lastActivityTime = Date.now(); return true; - } catch (error46) { - logForDebugging(`WebSocketTransport: Failed to send: ${error46}`, { + } catch (error42) { + logForDebugging(`WebSocketTransport: Failed to send: ${error42}`, { level: "error" }); logForDiagnosticsNoPII("error", "cli_websocket_send_error"); @@ -694456,20 +617022,20 @@ class WebSocketTransport2 { this.onCloseCallback?.(closeCode); return; } - const now3 = Date.now(); + const now2 = Date.now(); if (!this.reconnectStartTime) { - this.reconnectStartTime = now3; + this.reconnectStartTime = now2; } - if (this.lastReconnectAttemptTime !== null && now3 - this.lastReconnectAttemptTime > SLEEP_DETECTION_THRESHOLD_MS) { - logForDebugging(`WebSocketTransport: Detected system sleep (${Math.round((now3 - this.lastReconnectAttemptTime) / 1000)}s gap), resetting reconnection budget`); + if (this.lastReconnectAttemptTime !== null && now2 - this.lastReconnectAttemptTime > SLEEP_DETECTION_THRESHOLD_MS) { + logForDebugging(`WebSocketTransport: Detected system sleep (${Math.round((now2 - this.lastReconnectAttemptTime) / 1000)}s gap), resetting reconnection budget`); logForDiagnosticsNoPII("info", "cli_websocket_sleep_detected", { - gapMs: now3 - this.lastReconnectAttemptTime + gapMs: now2 - this.lastReconnectAttemptTime }); - this.reconnectStartTime = now3; + this.reconnectStartTime = now2; this.reconnectAttempts = 0; } - this.lastReconnectAttemptTime = now3; - const elapsed = now3 - this.reconnectStartTime; + this.lastReconnectAttemptTime = now2; + const elapsed = now2 - this.reconnectStartTime; if (elapsed < DEFAULT_RECONNECT_GIVE_UP_MS) { if (this.reconnectTimer) { clearTimeout(this.reconnectTimer); @@ -694482,9 +617048,9 @@ class WebSocketTransport2 { } this.state = "reconnecting"; this.reconnectAttempts++; - const baseDelay3 = Math.min(DEFAULT_BASE_RECONNECT_DELAY * Math.pow(2, this.reconnectAttempts - 1), DEFAULT_MAX_RECONNECT_DELAY); - const delay3 = Math.max(0, baseDelay3 + baseDelay3 * 0.25 * (2 * Math.random() - 1)); - logForDebugging(`WebSocketTransport: Reconnecting in ${Math.round(delay3)}ms (attempt ${this.reconnectAttempts}, ${Math.round(elapsed / 1000)}s elapsed)`); + const baseDelay2 = Math.min(DEFAULT_BASE_RECONNECT_DELAY * Math.pow(2, this.reconnectAttempts - 1), DEFAULT_MAX_RECONNECT_DELAY); + const delay2 = Math.max(0, baseDelay2 + baseDelay2 * 0.25 * (2 * Math.random() - 1)); + logForDebugging(`WebSocketTransport: Reconnecting in ${Math.round(delay2)}ms (attempt ${this.reconnectAttempts}, ${Math.round(elapsed / 1000)}s elapsed)`); logForDiagnosticsNoPII("error", "cli_websocket_reconnect_attempt", { reconnectAttempts: this.reconnectAttempts }); @@ -694492,13 +617058,13 @@ class WebSocketTransport2 { logEvent("tengu_ws_transport_reconnecting", { attempt: this.reconnectAttempts, elapsedMs: elapsed, - delayMs: Math.round(delay3) + delayMs: Math.round(delay2) }); } this.reconnectTimer = setTimeout(() => { this.reconnectTimer = null; this.connect(); - }, delay3); + }, delay2); } else { logForDebugging(`WebSocketTransport: Reconnection time budget exhausted after ${Math.round(elapsed / 1000)}s for ${this.url.href}`, { level: "error" }); logForDiagnosticsNoPII("error", "cli_websocket_reconnect_exhausted", { @@ -694615,9 +617181,9 @@ class WebSocketTransport2 { let lastTickTime = Date.now(); this.pingInterval = setInterval(() => { if (this.state === "connected" && this.ws) { - const now3 = Date.now(); - const gap = now3 - lastTickTime; - lastTickTime = now3; + const now2 = Date.now(); + const gap = now2 - lastTickTime; + lastTickTime = now2; if (gap > SLEEP_DETECTION_THRESHOLD_MS) { logForDebugging(`WebSocketTransport: ${Math.round(gap / 1000)}s tick gap detected — process was suspended, forcing reconnect`); logForDiagnosticsNoPII("info", "cli_websocket_sleep_detected_on_ping", { gapMs: gap }); @@ -694633,8 +617199,8 @@ class WebSocketTransport2 { this.pongReceived = false; try { this.ws.ping?.(); - } catch (error46) { - logForDebugging(`WebSocketTransport: Ping failed: ${error46}`, { + } catch (error42) { + logForDebugging(`WebSocketTransport: Ping failed: ${error42}`, { level: "error" }); logForDiagnosticsNoPII("error", "cli_websocket_ping_failed"); @@ -694659,8 +617225,8 @@ class WebSocketTransport2 { this.ws.send(KEEP_ALIVE_FRAME); this.lastActivityTime = Date.now(); logForDebugging("WebSocketTransport: Sent periodic keep_alive data frame"); - } catch (error46) { - logForDebugging(`WebSocketTransport: Periodic keep_alive failed: ${error46}`, { level: "error" }); + } catch (error42) { + logForDebugging(`WebSocketTransport: Periodic keep_alive failed: ${error42}`, { level: "error" }); logForDiagnosticsNoPII("error", "cli_websocket_keepalive_failed"); } } @@ -694810,11 +617376,11 @@ var init_HybridTransport = __esm(() => { validateStatus: () => true, timeout: POST_TIMEOUT_MS }); - } catch (error46) { - const axiosError = error46; + } catch (error42) { + const axiosError = error42; logForDebugging(`HybridTransport: POST error: ${axiosError.message}`); logForDiagnosticsNoPII("warn", "cli_hybrid_post_network_error"); - throw error46; + throw error42; } if (response.status >= 200 && response.status < 300) { logForDebugging(`HybridTransport: POST success count=${events2.length}`); @@ -694842,8 +617408,8 @@ class WorkerStateUploader { pending = null; closed = false; config; - constructor(config6) { - this.config = config6; + constructor(config4) { + this.config = config4; } enqueue(patch) { if (this.closed) @@ -694877,7 +617443,7 @@ class WorkerStateUploader { if (ok) return; failures++; - await sleep4(this.retryDelay(failures)); + await sleep2(this.retryDelay(failures)); if (this.pending && !this.closed) { current = coalescePatches(current, this.pending); this.pending = null; @@ -695024,9 +617590,9 @@ class CCRClient { maxBatchBytes: 10 * 1024 * 1024, maxQueueSize: 1e5, send: async (batch) => { - const result3 = await this.request("post", "/worker/events", { worker_epoch: this.workerEpoch, events: batch }, "client events"); - if (!result3.ok) { - throw new RetryableError("client event POST failed", result3.retryAfterMs); + const result2 = await this.request("post", "/worker/events", { worker_epoch: this.workerEpoch, events: batch }, "client events"); + if (!result2.ok) { + throw new RetryableError("client event POST failed", result2.retryAfterMs); } }, baseDelayMs: 500, @@ -695038,9 +617604,9 @@ class CCRClient { maxBatchBytes: 10 * 1024 * 1024, maxQueueSize: 200, send: async (batch) => { - const result3 = await this.request("post", "/worker/internal-events", { worker_epoch: this.workerEpoch, events: batch }, "internal events"); - if (!result3.ok) { - throw new RetryableError("internal event POST failed", result3.retryAfterMs); + const result2 = await this.request("post", "/worker/internal-events", { worker_epoch: this.workerEpoch, events: batch }, "internal events"); + if (!result2.ok) { + throw new RetryableError("internal event POST failed", result2.retryAfterMs); } }, baseDelayMs: 500, @@ -695051,15 +617617,15 @@ class CCRClient { maxBatchSize: 64, maxQueueSize: 64, send: async (batch) => { - const result3 = await this.request("post", "/worker/events/delivery", { + const result2 = await this.request("post", "/worker/events/delivery", { worker_epoch: this.workerEpoch, updates: batch.map((d) => ({ event_id: d.eventId, status: d.status })) }, "delivery batch"); - if (!result3.ok) { - throw new RetryableError("delivery POST failed", result3.retryAfterMs); + if (!result2.ok) { + throw new RetryableError("delivery POST failed", result2.retryAfterMs); } }, baseDelayMs: 500, @@ -695084,7 +617650,7 @@ class CCRClient { } this.workerEpoch = epoch; const restoredPromise = this.getWorkerState(); - const result3 = await this.request("put", "/worker", { + const result2 = await this.request("put", "/worker", { worker_status: "idle", worker_epoch: this.workerEpoch, external_metadata: { @@ -695092,7 +617658,7 @@ class CCRClient { task_summary: null } }, "PUT worker (init)"); - if (!result3.ok) { + if (!result2.ok) { throw new CCRInitError("worker_register_failed"); } this.currentState = "idle"; @@ -695126,12 +617692,12 @@ class CCRClient { durationMs: Date.now() - startMs }; } - async request(method3, path26, body, label, { timeout = 1e4 } = {}) { + async request(method2, path21, body, label, { timeout = 1e4 } = {}) { const authHeaders = this.getAuthHeaders(); if (Object.keys(authHeaders).length === 0) return { ok: false }; try { - const response = await this.http[method3](`${this.sessionBaseUrl}${path26}`, body, { + const response = await this.http[method2](`${this.sessionBaseUrl}${path21}`, body, { headers: { ...authHeaders, "Content-Type": "application/json", @@ -695167,8 +617733,8 @@ class CCRClient { level: "warn" }); logForDiagnosticsNoPII("warn", "cli_worker_request_failed", { - method: method3, - path: path26, + method: method2, + path: path21, status: response.status }); if (response.status === 429) { @@ -695179,14 +617745,14 @@ class CCRClient { } } return { ok: false }; - } catch (error46) { - logForDebugging(`CCRClient: ${label} failed: ${errorMessage(error46)}`, { + } catch (error42) { + logForDebugging(`CCRClient: ${label} failed: ${errorMessage(error42)}`, { level: "warn" }); logForDiagnosticsNoPII("warn", "cli_worker_request_error", { - method: method3, - path: path26, - error_code: getErrnoCode(error46) + method: method2, + path: path21, + error_code: getErrnoCode(error42) }); return { ok: false }; } @@ -695239,8 +617805,8 @@ class CCRClient { return; this.heartbeatInFlight = true; try { - const result3 = await this.request("post", "/worker/heartbeat", { session_id: this.sessionId, worker_epoch: this.workerEpoch }, "Heartbeat", { timeout: 5000 }); - if (result3.ok) { + const result2 = await this.request("post", "/worker/heartbeat", { session_id: this.sessionId, worker_epoch: this.workerEpoch }, "Heartbeat", { timeout: 5000 }); + if (result2.ok) { logForDebugging("CCRClient: Heartbeat sent"); } } finally { @@ -695310,14 +617876,14 @@ class CCRClient { async readSubagentInternalEvents() { return this.paginatedGet("/worker/internal-events", { subagents: "true" }, "subagent_events"); } - async paginatedGet(path26, params, context2) { + async paginatedGet(path21, params, context2) { const authHeaders = this.getAuthHeaders(); if (Object.keys(authHeaders).length === 0) return null; const allEvents = []; let cursor; do { - const url3 = new URL(`${this.sessionBaseUrl}${path26}`); + const url3 = new URL(`${this.sessionBaseUrl}${path21}`); for (const [k, v] of Object.entries(params)) { url3.searchParams.set(k, v); } @@ -695330,11 +617896,11 @@ class CCRClient { allEvents.push(...page.data ?? []); cursor = page.next_cursor; } while (cursor); - logForDebugging(`CCRClient: Read ${allEvents.length} internal events from ${path26}${params.subagents ? " (subagents)" : ""}`); + logForDebugging(`CCRClient: Read ${allEvents.length} internal events from ${path21}${params.subagents ? " (subagents)" : ""}`); return allEvents; } async getWithRetry(url3, authHeaders, context2) { - for (let attempt3 = 1;attempt3 <= 10; attempt3++) { + for (let attempt2 = 1;attempt2 <= 10; attempt2++) { let response; try { response = await this.http.get(url3, { @@ -695346,11 +617912,11 @@ class CCRClient { validateStatus: alwaysValidStatus, timeout: 30000 }); - } catch (error46) { - logForDebugging(`CCRClient: GET ${url3} failed (attempt ${attempt3}/10): ${errorMessage(error46)}`, { level: "warn" }); - if (attempt3 < 10) { - const delay3 = Math.min(500 * 2 ** (attempt3 - 1), 30000) + Math.random() * 500; - await sleep4(delay3); + } catch (error42) { + logForDebugging(`CCRClient: GET ${url3} failed (attempt ${attempt2}/10): ${errorMessage(error42)}`, { level: "warn" }); + if (attempt2 < 10) { + const delay2 = Math.min(500 * 2 ** (attempt2 - 1), 30000) + Math.random() * 500; + await sleep2(delay2); } continue; } @@ -695360,10 +617926,10 @@ class CCRClient { if (response.status === 409) { this.handleEpochMismatch(); } - logForDebugging(`CCRClient: GET ${url3} returned ${response.status} (attempt ${attempt3}/10)`, { level: "warn" }); - if (attempt3 < 10) { - const delay3 = Math.min(500 * 2 ** (attempt3 - 1), 30000) + Math.random() * 500; - await sleep4(delay3); + logForDebugging(`CCRClient: GET ${url3} returned ${response.status} (attempt ${attempt2}/10)`, { level: "warn" }); + if (attempt2 < 10) { + const delay2 = Math.min(500 * 2 ** (attempt2 - 1), 30000) + Math.random() * 500; + await sleep2(delay2); } } logForDebugging("CCRClient: GET retries exhausted", { level: "error" }); @@ -695484,12 +618050,12 @@ class SSETransport { reconnectTimer = null; livenessTimer = null; postUrl; - constructor(url3, headers = {}, sessionId, refreshHeaders, initialSequenceNum, getAuthHeaders5) { + constructor(url3, headers = {}, sessionId, refreshHeaders, initialSequenceNum, getAuthHeaders4) { this.url = url3; this.headers = headers; this.sessionId = sessionId; this.refreshHeaders = refreshHeaders; - this.getAuthHeaders = getAuthHeaders5 ?? getSessionIngressAuthHeaders; + this.getAuthHeaders = getAuthHeaders4 ?? getSessionIngressAuthHeaders; this.postUrl = convertSSEUrlToPostUrl(url3); if (initialSequenceNum !== undefined && initialSequenceNum > 0) { this.lastSequenceNum = initialSequenceNum; @@ -695564,11 +618130,11 @@ class SSETransport { this.reconnectStartTime = null; this.resetLivenessTimer(); await this.readStream(response.body); - } catch (error46) { + } catch (error42) { if (this.abortController?.signal.aborted) { return; } - logForDebugging(`SSETransport: Connection error: ${errorMessage(error46)}`, { level: "error" }); + logForDebugging(`SSETransport: Connection error: ${errorMessage(error42)}`, { level: "error" }); logForDiagnosticsNoPII("error", "cli_sse_connect_error"); this.handleConnectionError(); } @@ -695617,10 +618183,10 @@ class SSETransport { } } } - } catch (error46) { + } catch (error42) { if (this.abortController?.signal.aborted) return; - logForDebugging(`SSETransport: Stream read error: ${errorMessage(error46)}`, { level: "error" }); + logForDebugging(`SSETransport: Stream read error: ${errorMessage(error42)}`, { level: "error" }); logForDiagnosticsNoPII("error", "cli_sse_stream_read_error"); } finally { reader.releaseLock(); @@ -695641,8 +618207,8 @@ class SSETransport { let ev; try { ev = jsonParse(data); - } catch (error46) { - logForDebugging(`SSETransport: Failed to parse client_event data: ${errorMessage(error46)}`, { level: "error" }); + } catch (error42) { + logForDebugging(`SSETransport: Failed to parse client_event data: ${errorMessage(error42)}`, { level: "error" }); return; } const payload = ev.payload; @@ -695663,11 +618229,11 @@ class SSETransport { return; this.abortController?.abort(); this.abortController = null; - const now3 = Date.now(); + const now2 = Date.now(); if (!this.reconnectStartTime) { - this.reconnectStartTime = now3; + this.reconnectStartTime = now2; } - const elapsed = now3 - this.reconnectStartTime; + const elapsed = now2 - this.reconnectStartTime; if (elapsed < RECONNECT_GIVE_UP_MS) { if (this.reconnectTimer) { clearTimeout(this.reconnectTimer); @@ -695680,16 +618246,16 @@ class SSETransport { } this.state = "reconnecting"; this.reconnectAttempts++; - const baseDelay3 = Math.min(RECONNECT_BASE_DELAY_MS * Math.pow(2, this.reconnectAttempts - 1), RECONNECT_MAX_DELAY_MS); - const delay3 = Math.max(0, baseDelay3 + baseDelay3 * 0.25 * (2 * Math.random() - 1)); - logForDebugging(`SSETransport: Reconnecting in ${Math.round(delay3)}ms (attempt ${this.reconnectAttempts}, ${Math.round(elapsed / 1000)}s elapsed)`); + const baseDelay2 = Math.min(RECONNECT_BASE_DELAY_MS * Math.pow(2, this.reconnectAttempts - 1), RECONNECT_MAX_DELAY_MS); + const delay2 = Math.max(0, baseDelay2 + baseDelay2 * 0.25 * (2 * Math.random() - 1)); + logForDebugging(`SSETransport: Reconnecting in ${Math.round(delay2)}ms (attempt ${this.reconnectAttempts}, ${Math.round(elapsed / 1000)}s elapsed)`); logForDiagnosticsNoPII("error", "cli_sse_reconnect_attempt", { reconnectAttempts: this.reconnectAttempts }); this.reconnectTimer = setTimeout(() => { this.reconnectTimer = null; this.connect(); - }, delay3); + }, delay2); } else { logForDebugging(`SSETransport: Reconnection time budget exhausted after ${Math.round(elapsed / 1000)}s`, { level: "error" }); logForDiagnosticsNoPII("error", "cli_sse_reconnect_exhausted", { @@ -695733,7 +618299,7 @@ class SSETransport { "User-Agent": getClaudeCodeUserAgent() }; logForDebugging(`SSETransport: POST body keys=${Object.keys(message).join(",")}`); - for (let attempt3 = 1;attempt3 <= POST_MAX_RETRIES; attempt3++) { + for (let attempt2 = 1;attempt2 <= POST_MAX_RETRIES; attempt2++) { try { const response = await axios_default.post(this.postUrl, message, { headers, @@ -695751,25 +618317,25 @@ class SSETransport { }); return; } - logForDebugging(`SSETransport: POST returned ${response.status}, attempt ${attempt3}/${POST_MAX_RETRIES}`); + logForDebugging(`SSETransport: POST returned ${response.status}, attempt ${attempt2}/${POST_MAX_RETRIES}`); logForDiagnosticsNoPII("warn", "cli_sse_post_retryable_error", { status: response.status, - attempt: attempt3 + attempt: attempt2 }); - } catch (error46) { - const axiosError = error46; - logForDebugging(`SSETransport: POST error: ${axiosError.message}, attempt ${attempt3}/${POST_MAX_RETRIES}`); + } catch (error42) { + const axiosError = error42; + logForDebugging(`SSETransport: POST error: ${axiosError.message}, attempt ${attempt2}/${POST_MAX_RETRIES}`); logForDiagnosticsNoPII("warn", "cli_sse_post_network_error", { - attempt: attempt3 + attempt: attempt2 }); } - if (attempt3 === POST_MAX_RETRIES) { + if (attempt2 === POST_MAX_RETRIES) { logForDebugging(`SSETransport: POST failed after ${POST_MAX_RETRIES} attempts, continuing`); logForDiagnosticsNoPII("warn", "cli_sse_post_retries_exhausted"); return; } - const delayMs = Math.min(POST_BASE_DELAY_MS * Math.pow(2, attempt3 - 1), POST_MAX_DELAY_MS); - await sleep4(delayMs); + const delayMs = Math.min(POST_BASE_DELAY_MS * Math.pow(2, attempt2 - 1), POST_MAX_DELAY_MS); + await sleep2(delayMs); } } isConnectedStatus() { @@ -695847,9 +618413,9 @@ async function createV2ReplTransport(opts) { initialSequenceNum, getAuthToken } = opts; - let getAuthHeaders5; + let getAuthHeaders4; if (getAuthToken) { - getAuthHeaders5 = () => { + getAuthHeaders4 = () => { const token = getAuthToken(); if (!token) return {}; @@ -695862,10 +618428,10 @@ async function createV2ReplTransport(opts) { logForDebugging(`[bridge:repl] CCR v2: worker sessionId=${sessionId} epoch=${epoch}${opts.epoch !== undefined ? " (from /bridge)" : " (via registerWorker)"}`); const sseUrl = new URL(sessionUrl); sseUrl.pathname = sseUrl.pathname.replace(/\/$/, "") + "/worker/events/stream"; - const sse = new SSETransport(sseUrl, {}, sessionId, undefined, initialSequenceNum, getAuthHeaders5); + const sse = new SSETransport(sseUrl, {}, sessionId, undefined, initialSequenceNum, getAuthHeaders4); let onCloseCb; const ccr = new CCRClient(sse, new URL(sessionUrl), { - getAuthHeaders: getAuthHeaders5, + getAuthHeaders: getAuthHeaders4, heartbeatIntervalMs: opts.heartbeatIntervalMs, heartbeatJitterFraction: opts.heartbeatJitterFraction, onEpochMismatch: () => { @@ -695950,8 +618516,8 @@ async function createV2ReplTransport(opts) { ccrInitialized = true; logForDebugging(`[bridge:repl] v2 transport ready for writes (epoch=${epoch}, sse=${sse.isConnectedStatus() ? "open" : "opening"})`); onConnectCb?.(); - }, (err3) => { - logForDebugging(`[bridge:repl] CCR v2 initialize failed: ${errorMessage(err3)}`, { level: "error" }); + }, (err2) => { + logForDebugging(`[bridge:repl] CCR v2 initialize failed: ${errorMessage(err2)}`, { level: "error" }); ccr.close(); sse.close(); onCloseCb?.(4091); @@ -696073,12 +618639,12 @@ async function initBridgeCore(params) { const reg = await api3.registerBridgeEnvironment(bridgeConfig); environmentId = reg.environment_id; environmentSecret = reg.environment_secret; - } catch (err3) { - logBridgeSkip("registration_failed", `[bridge:repl] Environment registration failed: ${errorMessage(err3)}`); + } catch (err2) { + logBridgeSkip("registration_failed", `[bridge:repl] Environment registration failed: ${errorMessage(err2)}`); if (prior) { await clearBridgePointer2(dir); } - onStateChange?.("failed", errorMessage(err3)); + onStateChange?.("failed", errorMessage(err2)); return null; } logForDebugging(`[bridge:repl] Environment registered: ${environmentId}`); @@ -696096,8 +618662,8 @@ async function initBridgeCore(params) { await api3.reconnectSession(environmentId, id); logForDebugging(`[bridge:repl] Reconnected session ${id} in place on env ${environmentId}`); return true; - } catch (err3) { - logForDebugging(`[bridge:repl] reconnectSession(${id}) failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge:repl] reconnectSession(${id}) failed: ${errorMessage(err2)}`); } } logForDebugging("[bridge:repl] reconnectSession exhausted — falling through to fresh session"); @@ -696151,8 +618717,8 @@ async function initBridgeCore(params) { } } const recentPostedUUIDs = new BoundedUUIDSet(2000); - for (const uuid8 of initialMessageUUIDs) { - recentPostedUUIDs.add(uuid8); + for (const uuid5 of initialMessageUUIDs) { + recentPostedUUIDs.add(uuid5); } const recentInboundUUIDs = new BoundedUUIDSet(2000); const pollController = new AbortController; @@ -696219,9 +618785,9 @@ async function initBridgeCore(params) { const reg = await api3.registerBridgeEnvironment(bridgeConfig); environmentId = reg.environment_id; environmentSecret = reg.environment_secret; - } catch (err3) { + } catch (err2) { bridgeConfig.reuseEnvironmentId = undefined; - logForDebugging(`[bridge:repl] Environment re-registration failed: ${errorMessage(err3)}`); + logForDebugging(`[bridge:repl] Environment re-registration failed: ${errorMessage(err2)}`); return false; } bridgeConfig.reuseEnvironmentId = undefined; @@ -696394,8 +618960,8 @@ async function initBridgeCore(params) { sessionToken: currentIngressToken }; }, - onHeartbeatFatal: (err3) => { - logForDebugging(`[bridge:repl] heartbeatWork fatal (status=${err3.status}) — tearing down work item for fast re-dispatch`); + onHeartbeatFatal: (err2) => { + logForDebugging(`[bridge:repl] heartbeatWork fatal (status=${err2.status}) — tearing down work item for fast re-dispatch`); if (transport) { const seq2 = transport.getLastSequenceNum(); if (seq2 > lastTransportSequenceNum) { @@ -696563,8 +619129,8 @@ async function initBridgeCore(params) { return; } wireTransport(t); - }, (err3) => { - logForDebugging(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${errorMessage(err3)}`, { level: "error" }); + }, (err2) => { + logForDebugging(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${errorMessage(err2)}`, { level: "error" }); logEvent("tengu_bridge_repl_ccr_v2_init_failed", {}); if (thisGen !== v2Generation) return; @@ -696615,8 +619181,8 @@ async function initBridgeCore(params) { if (!transport) return; logForDebugging("[bridge:repl] keep_alive sent"); - transport.write({ type: "keep_alive" }).catch((err3) => { - logForDebugging(`[bridge:repl] keep_alive write failed: ${errorMessage(err3)}`); + transport.write({ type: "keep_alive" }).catch((err2) => { + logForDebugging(`[bridge:repl] keep_alive write failed: ${errorMessage(err2)}`); }); }, keepAliveIntervalMs) : null; keepAliveTimer?.unref?.(); @@ -696669,14 +619235,14 @@ async function initBridgeCore(params) { } const stopWorkP = currentWorkId ? api3.stopWork(environmentId, currentWorkId, true).then(() => { logForDebugging("[bridge:repl] Teardown: stopWork completed"); - }).catch((err3) => { - logForDebugging(`[bridge:repl] Teardown stopWork failed: ${errorMessage(err3)}`); + }).catch((err2) => { + logForDebugging(`[bridge:repl] Teardown stopWork failed: ${errorMessage(err2)}`); }) : Promise.resolve(); await Promise.all([stopWorkP, archiveSession(currentSessionId)]); teardownTransport?.close(); logForDebugging("[bridge:repl] Teardown: transport closed"); - await api3.deregisterEnvironment(environmentId).catch((err3) => { - logForDebugging(`[bridge:repl] Teardown deregister failed: ${errorMessage(err3)}`); + await api3.deregisterEnvironment(environmentId).catch((err2) => { + logForDebugging(`[bridge:repl] Teardown deregister failed: ${errorMessage(err2)}`); }); await clearBridgePointer2(dir); logForDebugging(`[bridge:repl] Teardown complete: env=${environmentId} duration=${Date.now() - teardownStart}ms`); @@ -696702,8 +619268,8 @@ async function initBridgeCore(params) { return; if (!userMessageCallbackDone) { for (const m of filtered) { - const text2 = extractTitleText(m); - if (text2 !== undefined && onUserMessage?.(text2, currentSessionId)) { + const text = extractTitleText(m); + if (text !== undefined && onUserMessage?.(text, currentSessionId)) { userMessageCallbackDone = true; break; } @@ -696714,8 +619280,8 @@ async function initBridgeCore(params) { return; } if (!transport) { - const types4 = filtered.map((m) => m.type).join(","); - logForDebugging(`[bridge:repl] Transport not configured, dropping ${filtered.length} message(s) [${types4}] for session=${currentSessionId}`, { level: "warn" }); + const types3 = filtered.map((m) => m.type).join(","); + logForDebugging(`[bridge:repl] Transport not configured, dropping ${filtered.length} message(s) [${types3}] for session=${currentSessionId}`, { level: "warn" }); return; } for (const msg of filtered) { @@ -696848,17 +619414,17 @@ async function startWorkPollLoop({ const cap = capacitySignal(); try { await api3.heartbeatWork(info.environmentId, info.workId, info.sessionToken); - } catch (err3) { - logForDebugging(`[bridge:repl:heartbeat] Failed: ${errorMessage(err3)}`); - if (err3 instanceof BridgeFatalError) { + } catch (err2) { + logForDebugging(`[bridge:repl:heartbeat] Failed: ${errorMessage(err2)}`); + if (err2 instanceof BridgeFatalError) { cap.cleanup(); logEvent("tengu_bridge_heartbeat_error", { - status: err3.status, - error_type: err3.status === 401 || err3.status === 403 ? "auth_failed" : "fatal" + status: err2.status, + error_type: err2.status === 401 || err2.status === 403 ? "auth_failed" : "fatal" }); if (onHeartbeatFatal) { - onHeartbeatFatal(err3); - logForDebugging(`[bridge:repl:heartbeat] Fatal (status=${err3.status}), work state cleared — fast-polling for re-dispatch`); + onHeartbeatFatal(err2); + logForDebugging(`[bridge:repl:heartbeat] Fatal (status=${err2.status}), work state cleared — fast-polling for re-dispatch`); } else { needsBackoff = true; } @@ -696866,7 +619432,7 @@ async function startWorkPollLoop({ } } hbCycles++; - await sleep4(hbConfig.non_exclusive_heartbeat_interval_ms, cap.signal); + await sleep2(hbConfig.non_exclusive_heartbeat_interval_ms, cap.signal); cap.cleanup(); } const exitReason = needsBackoff ? "error" : signal.aborted ? "shutdown" : !isAtCapacity() ? "capacity_changed" : pollDeadline !== null && Date.now() >= pollDeadline ? "poll_due" : "config_disabled"; @@ -696885,7 +619451,7 @@ async function startWorkPollLoop({ if (sleepMs > 0) { const cap = capacitySignal(); const sleepStart = Date.now(); - await sleep4(sleepMs, cap.signal); + await sleep2(sleepMs, cap.signal); cap.cleanup(); const overrun = Date.now() - sleepStart - sleepMs; if (overrun > 60000) { @@ -696897,15 +619463,15 @@ async function startWorkPollLoop({ } } } else { - await sleep4(pollConfig.poll_interval_ms_not_at_capacity, signal); + await sleep2(pollConfig.poll_interval_ms_not_at_capacity, signal); } continue; } let secret; try { secret = decodeWorkSecret(work.secret); - } catch (err3) { - logForDebugging(`[bridge:repl] Failed to decode work secret: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge:repl] Failed to decode work secret: ${errorMessage(err2)}`); logEvent("tengu_bridge_repl_work_secret_failed", {}); await api3.stopWork(envId, work.id, false).catch(() => {}); continue; @@ -696913,8 +619479,8 @@ async function startWorkPollLoop({ logForDebugging(`[bridge:repl] Acknowledging workId=${work.id}`); try { await api3.acknowledgeWork(envId, work.id, secret.session_ingress_token); - } catch (err3) { - logForDebugging(`[bridge:repl] Acknowledge failed workId=${work.id}: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[bridge:repl] Acknowledge failed workId=${work.id}: ${errorMessage(err2)}`); } if (work.data.type === "healthcheck") { logForDebugging("[bridge:repl] Healthcheck received"); @@ -696931,10 +619497,10 @@ async function startWorkPollLoop({ onWorkReceived(workSessionId, secret.session_ingress_token, work.id, secret.use_code_sessions === true); logForDebugging("[bridge:repl] Work accepted, continuing poll loop"); } - } catch (err3) { + } catch (err2) { if (signal.aborted) break; - if (err3 instanceof BridgeFatalError && err3.status === 404 && onEnvironmentLost) { + if (err2 instanceof BridgeFatalError && err2.status === 404 && onEnvironmentLost) { const currentEnvId = getCredentials().environmentId; if (envId !== currentEnvId) { logForDebugging(`[bridge:repl] Stale poll error for old env=${envId}, current env=${currentEnvId} — skipping onEnvironmentLost`); @@ -696968,38 +619534,38 @@ async function startWorkPollLoop({ onFatalError?.(); break; } - if (err3 instanceof BridgeFatalError) { - const isExpiry = isExpiredErrorType(err3.errorType); - const isSuppressible = isSuppressible403(err3); - logForDebugging(`[bridge:repl] Fatal poll error: ${err3.message} (status=${err3.status}, type=${err3.errorType ?? "unknown"})${isSuppressible ? " (suppressed)" : ""}`); + if (err2 instanceof BridgeFatalError) { + const isExpiry = isExpiredErrorType(err2.errorType); + const isSuppressible = isSuppressible403(err2); + logForDebugging(`[bridge:repl] Fatal poll error: ${err2.message} (status=${err2.status}, type=${err2.errorType ?? "unknown"})${isSuppressible ? " (suppressed)" : ""}`); logEvent("tengu_bridge_repl_fatal_error", { - status: err3.status, - error_type: err3.errorType + status: err2.status, + error_type: err2.errorType }); - logForDiagnosticsNoPII(isExpiry ? "info" : "error", "bridge_repl_fatal_error", { status: err3.status, error_type: err3.errorType }); + logForDiagnosticsNoPII(isExpiry ? "info" : "error", "bridge_repl_fatal_error", { status: err2.status, error_type: err2.errorType }); if (!isSuppressible) { - onStateChange?.("failed", isExpiry ? "session expired · /remote-control to reconnect" : err3.message); + onStateChange?.("failed", isExpiry ? "session expired · /remote-control to reconnect" : err2.message); } onFatalError?.(); break; } - const now3 = Date.now(); - if (lastPollErrorTime !== null && now3 - lastPollErrorTime > POLL_ERROR_MAX_DELAY_MS * 2) { - logForDebugging(`[bridge:repl] Detected system sleep (${Math.round((now3 - lastPollErrorTime) / 1000)}s gap), resetting poll error budget`); + const now2 = Date.now(); + if (lastPollErrorTime !== null && now2 - lastPollErrorTime > POLL_ERROR_MAX_DELAY_MS * 2) { + logForDebugging(`[bridge:repl] Detected system sleep (${Math.round((now2 - lastPollErrorTime) / 1000)}s gap), resetting poll error budget`); logForDiagnosticsNoPII("info", "bridge_repl_poll_sleep_detected", { - gapMs: now3 - lastPollErrorTime + gapMs: now2 - lastPollErrorTime }); consecutiveErrors = 0; firstErrorTime = null; } - lastPollErrorTime = now3; + lastPollErrorTime = now2; consecutiveErrors++; if (firstErrorTime === null) { - firstErrorTime = now3; + firstErrorTime = now2; } - const elapsed = now3 - firstErrorTime; - const httpStatus = extractHttpStatus(err3); - const errMsg = describeAxiosError(err3); + const elapsed = now2 - firstErrorTime; + const httpStatus = extractHttpStatus(err2); + const errMsg = describeAxiosError(err2); const wsLabel = getWsState?.() ?? "unknown"; logForDebugging(`[bridge:repl] Poll error (attempt ${consecutiveErrors}, elapsed ${Math.round(elapsed / 1000)}s, ws=${wsLabel}): ${errMsg}`); logEvent("tengu_bridge_repl_poll_error", { @@ -697030,7 +619596,7 @@ async function startWorkPollLoop({ } catch {} } } - await sleep4(backoff, signal); + await sleep2(backoff, signal); } } logForDebugging(`[bridge:repl] Work poll loop ended (aborted=${signal.aborted}) env=${getCredentials().environmentId}`); @@ -697075,8 +619641,8 @@ async function createCodeSession(baseUrl, accessToken, title, timeoutMs, tags) { timeout: timeoutMs, validateStatus: (s) => s < 500 }); - } catch (err3) { - logForDebugging(`[code-session] Session create request failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[code-session] Session create request failed: ${errorMessage(err2)}`); return null; } if (response.status !== 200 && response.status !== 201) { @@ -697104,8 +619670,8 @@ async function fetchRemoteCredentials(sessionId, baseUrl, accessToken, timeoutMs timeout: timeoutMs, validateStatus: (s) => s < 500 }); - } catch (err3) { - logForDebugging(`[code-session] /bridge request failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[code-session] /bridge request failed: ${errorMessage(err2)}`); return null; } if (response.status !== 200) { @@ -697212,9 +619778,9 @@ async function initEnvLessBridgeCore(params) { getAuthToken: () => credentials.worker_jwt, outboundOnly }); - } catch (err3) { - logForDebugging(`[remote-bridge] v2 transport setup failed: ${errorMessage(err3)}`, { level: "error" }); - onStateChange?.("failed", `Transport setup failed: ${errorMessage(err3)}`); + } catch (err2) { + logForDebugging(`[remote-bridge] v2 transport setup failed: ${errorMessage(err2)}`, { level: "error" }); + onStateChange?.("failed", `Transport setup failed: ${errorMessage(err2)}`); logBridgeSkip("v2_transport_setup_failed", undefined, true); archiveSession(sessionId, baseUrl, accessToken, orgUUID, cfg.http_timeout_ms); return null; @@ -697267,11 +619833,11 @@ async function initEnvLessBridgeCore(params) { return; await rebuildTransport(fresh, "proactive_refresh"); logForDebugging("[remote-bridge] Transport rebuilt (proactive refresh)"); - } catch (err3) { - logForDebugging(`[remote-bridge] Proactive refresh rebuild failed: ${errorMessage(err3)}`, { level: "error" }); + } catch (err2) { + logForDebugging(`[remote-bridge] Proactive refresh rebuild failed: ${errorMessage(err2)}`, { level: "error" }); logForDiagnosticsNoPII("error", "bridge_repl_v2_proactive_refresh_failed"); if (!tornDown) { - onStateChange?.("failed", `Refresh failed: ${errorMessage(err3)}`); + onStateChange?.("failed", `Refresh failed: ${errorMessage(err2)}`); } } finally { authRecoveryInFlight = false; @@ -697388,11 +619954,11 @@ async function initEnvLessBridgeCore(params) { initialFlushDone = false; await rebuildTransport(fresh, "auth_401_recovery"); logForDebugging("[remote-bridge] Transport rebuilt after 401"); - } catch (err3) { - logForDebugging(`[remote-bridge] 401 recovery failed: ${errorMessage(err3)}`, { level: "error" }); + } catch (err2) { + logForDebugging(`[remote-bridge] 401 recovery failed: ${errorMessage(err2)}`, { level: "error" }); logForDiagnosticsNoPII("error", "bridge_repl_v2_jwt_refresh_failed"); if (!tornDown) { - onStateChange?.("failed", `JWT refresh failed: ${errorMessage(err3)}`); + onStateChange?.("failed", `JWT refresh failed: ${errorMessage(err2)}`); } } finally { authRecoveryInFlight = false; @@ -697454,8 +620020,8 @@ async function initEnvLessBridgeCore(params) { await onAuth401(token ?? ""); token = getAccessToken(); status2 = await archiveSession(sessionId, baseUrl, token, orgUUID, cfg.teardown_archive_timeout_ms); - } catch (err3) { - logForDebugging(`[remote-bridge] Teardown 401 retry threw: ${errorMessage(err3)}`, { level: "error" }); + } catch (err2) { + logForDebugging(`[remote-bridge] Teardown 401 retry threw: ${errorMessage(err2)}`, { level: "error" }); } } transport.close(); @@ -697495,8 +620061,8 @@ async function initEnvLessBridgeCore(params) { return; if (!userMessageCallbackDone) { for (const m of filtered) { - const text2 = extractTitleText(m); - if (text2 !== undefined && onUserMessage?.(text2, sessionId)) { + const text = extractTitleText(m); + if (text !== undefined && onUserMessage?.(text, sessionId)) { userMessageCallbackDone = true; break; } @@ -697581,17 +620147,17 @@ async function initEnvLessBridgeCore(params) { }; } async function withRetry2(fn, label, cfg) { - const max5 = cfg.init_retry_max_attempts; - for (let attempt3 = 1;attempt3 <= max5; attempt3++) { - const result3 = await fn(); - if (result3 !== null) - return result3; - if (attempt3 < max5) { - const base2 = cfg.init_retry_base_delay_ms * 2 ** (attempt3 - 1); + const max3 = cfg.init_retry_max_attempts; + for (let attempt2 = 1;attempt2 <= max3; attempt2++) { + const result2 = await fn(); + if (result2 !== null) + return result2; + if (attempt2 < max3) { + const base2 = cfg.init_retry_base_delay_ms * 2 ** (attempt2 - 1); const jitter = base2 * cfg.init_retry_jitter_fraction * (2 * Math.random() - 1); - const delay3 = Math.min(base2 + jitter, cfg.init_retry_max_delay_ms); - logForDebugging(`[remote-bridge] ${label} failed (attempt ${attempt3}/${max5}), retrying in ${Math.round(delay3)}ms`); - await sleep4(delay3); + const delay2 = Math.min(base2 + jitter, cfg.init_retry_max_delay_ms); + logForDebugging(`[remote-bridge] ${label} failed (attempt ${attempt2}/${max3}), retrying in ${Math.round(delay2)}ms`); + await sleep2(delay2); } } return null; @@ -697618,10 +620184,10 @@ async function archiveSession(sessionId, baseUrl, accessToken, orgUUID, timeoutM }); logForDebugging(`[remote-bridge] Archive ${compatId} status=${response.status}`); return response.status; - } catch (err3) { - const msg = errorMessage(err3); + } catch (err2) { + const msg = errorMessage(err2); logForDebugging(`[remote-bridge] Archive failed: ${msg}`); - return axios_default.isAxiosError(err3) && err3.code === "ECONNABORTED" ? "timeout" : "error"; + return axios_default.isAxiosError(err2) && err2.code === "ECONNABORTED" ? "timeout" : "error"; } } var ANTHROPIC_VERSION3 = "2023-06-01"; @@ -697721,8 +620287,8 @@ async function initReplBridge(options2) { hasTitle = true; hasExplicitTitle = true; } else if (initialMessages && initialMessages.length > 0) { - for (let i4 = initialMessages.length - 1;i4 >= 0; i4--) { - const msg = initialMessages[i4]; + for (let i3 = initialMessages.length - 1;i3 >= 0; i3--) { + const msg = initialMessages[i3]; if (msg.type !== "user" || msg.isMeta || msg.toolUseResult || msg.isCompactSummary || msg.origin && msg.origin.kind !== "human" || isSyntheticMessage(msg)) continue; const rawContent = getContentText(msg.message.content); @@ -697749,16 +620315,16 @@ async function initReplBridge(options2) { getAccessToken: getBridgeAccessToken }).catch(() => {}); }; - const generateAndPatch = (input11, bridgeSessionId) => { + const generateAndPatch = (input, bridgeSessionId) => { const gen = ++genSeq; const atCount = userMessageCount; - generateSessionTitle(input11, AbortSignal.timeout(15000)).then((generated) => { + generateSessionTitle(input, AbortSignal.timeout(15000)).then((generated) => { if (generated && gen === genSeq && lastBridgeSessionId === bridgeSessionId && !getCurrentSessionTitle(getSessionId())) { patch(generated, bridgeSessionId, atCount); } }); }; - const onUserMessage = (text2, bridgeSessionId) => { + const onUserMessage = (text, bridgeSessionId) => { if (hasExplicitTitle || getCurrentSessionTitle(getSessionId())) { return true; } @@ -697768,14 +620334,14 @@ async function initReplBridge(options2) { lastBridgeSessionId = bridgeSessionId; userMessageCount++; if (userMessageCount === 1 && !hasTitle) { - const placeholder = deriveTitle(text2); + const placeholder = deriveTitle(text); if (placeholder) patch(placeholder, bridgeSessionId, userMessageCount); - generateAndPatch(text2, bridgeSessionId); + generateAndPatch(text, bridgeSessionId); } else if (userMessageCount === 3) { const msgs = getMessages?.(); - const input11 = msgs ? extractConversationText(getMessagesAfterCompactBoundary(msgs)) : text2; - generateAndPatch(input11, bridgeSessionId); + const input = msgs ? extractConversationText(getMessagesAfterCompactBoundary(msgs)) : text; + generateAndPatch(input, bridgeSessionId); } return userMessageCount >= 3; }; @@ -697852,8 +620418,8 @@ async function initReplBridge(options2) { baseUrl, getAccessToken: getBridgeAccessToken, timeoutMs: 1500 - }).catch((err3) => { - logForDebugging(`[bridge:repl] archiveBridgeSession threw: ${errorMessage(err3)}`, { level: "error" }); + }).catch((err2) => { + logForDebugging(`[bridge:repl] archiveBridgeSession threw: ${errorMessage(err2)}`, { level: "error" }); }), getCurrentTitle: () => getCurrentSessionTitle(getSessionId()) ?? title, onUserMessage, @@ -697888,17 +620454,17 @@ var init_initReplBridge = __esm(() => { init_growthbook(); init_client2(); init_policyLimits(); - init_auth2(); + init_auth(); init_config2(); init_debug(); init_displayTags(); init_errors(); init_git(); init_mappers(); - init_messages5(); + init_messages3(); init_sessionStorage(); init_sessionTitle(); - init_words3(); + init_words2(); init_bridgeConfig(); init_bridgeEnabled(); init_createSession(); @@ -697917,8 +620483,8 @@ __export(exports_inboundAttachments, { extractInboundAttachments: () => extractInboundAttachments }); import { randomUUID as randomUUID40 } from "crypto"; -import { mkdir as mkdir55, writeFile as writeFile56 } from "fs/promises"; -import { basename as basename49, join as join163 } from "path"; +import { mkdir as mkdir55, writeFile as writeFile54 } from "fs/promises"; +import { basename as basename47, join as join153 } from "path"; function debug2(msg) { logForDebugging(`[bridge:inbound-attach] ${msg}`); } @@ -697930,11 +620496,11 @@ function extractInboundAttachments(msg) { return parsed.success ? parsed.data : []; } function sanitizeFileName(name) { - const base2 = basename49(name).replace(/[^a-zA-Z0-9._-]/g, "_"); + const base2 = basename47(name).replace(/[^a-zA-Z0-9._-]/g, "_"); return base2 || "attachment"; } function uploadsDir() { - return join163(getClaudeConfigHomeDir(), "uploads", getSessionId()); + return join153(getClaudeConfigHomeDir(), "uploads", getSessionId()); } async function resolveOne(att) { const token = getBridgeAccessToken(); @@ -697963,10 +620529,10 @@ async function resolveOne(att) { const safeName = sanitizeFileName(att.file_name); const prefix = (att.file_uuid.slice(0, 8) || randomUUID40().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_"); const dir = uploadsDir(); - const outPath = join163(dir, `${prefix}-${safeName}`); + const outPath = join153(dir, `${prefix}-${safeName}`); try { await mkdir55(dir, { recursive: true }); - await writeFile56(outPath, data); + await writeFile54(outPath, data); } catch (e) { debug2(`write ${outPath} failed: ${e}`); return; @@ -697989,14 +620555,14 @@ function prependPathRefs(content, prefix) { return content; if (typeof content === "string") return prefix + content; - const i4 = content.findLastIndex((b) => b.type === "text"); - if (i4 !== -1) { - const b = content[i4]; + const i3 = content.findLastIndex((b) => b.type === "text"); + if (i3 !== -1) { + const b = content[i3]; if (b.type === "text") { return [ - ...content.slice(0, i4), + ...content.slice(0, i3), { ...b, text: prefix + b.text }, - ...content.slice(i4 + 1) + ...content.slice(i3 + 1) ]; } } @@ -698028,9 +620594,9 @@ var init_inboundAttachments = __esm(() => { var exports_webhookSanitizer = {}; __export(exports_webhookSanitizer, { default: () => webhookSanitizer_default, - __stub__: () => __stub__28 + __stub__: () => __stub__35 }); -var webhookSanitizer_default, __stub__28 = true; +var webhookSanitizer_default, __stub__35 = true; var init_webhookSanitizer = __esm(() => { webhookSanitizer_default = {}; }); @@ -698235,15 +620801,15 @@ function useReplBridge(messages, setMessages, abortControllerRef, commands, main const requestId = msg_0.response?.request_id; if (!requestId) return; - const handler14 = pendingPermissionHandlers.get(requestId); - if (!handler14) { + const handler19 = pendingPermissionHandlers.get(requestId); + if (!handler19) { logForDebugging(`[bridge:repl] No handler for control_response request_id=${requestId}`); return; } pendingPermissionHandlers.delete(requestId); const inner = msg_0.response; if (inner.subtype === "success" && inner.response && isBridgePermissionResponse(inner.response)) { - handler14(inner.response); + handler19(inner.response); } }; if (teardownPromiseRef.current) { @@ -698273,7 +620839,7 @@ function useReplBridge(messages, setMessages, abortControllerRef, commands, main if (!fields) return; const { - uuid: uuid8 + uuid: uuid5 } = fields; const { resolveAndPrepend: resolveAndPrepend2 @@ -698287,11 +620853,11 @@ function useReplBridge(messages, setMessages, abortControllerRef, commands, main } const content = await resolveAndPrepend2(msg, sanitized); const preview = typeof content === "string" ? content.slice(0, 80) : `[${content.length} content blocks]`; - logForDebugging(`[bridge:repl] Injecting inbound user message: ${preview}${uuid8 ? ` uuid=${uuid8}` : ""}`); + logForDebugging(`[bridge:repl] Injecting inbound user message: ${preview}${uuid5 ? ` uuid=${uuid5}` : ""}`); enqueue({ value: content, mode: "prompt", - uuid: uuid8, + uuid: uuid5, skipSlashCommands: true, bridgeOrigin: true }); @@ -698438,14 +621004,14 @@ function useReplBridge(messages, setMessages, abortControllerRef, commands, main logForDebugging(`[bridge:repl] Mirror initialized, session=${handle_0.bridgeSessionId}`); } else { const permissionCallbacks = { - sendRequest(requestId_0, toolName, input11, toolUseId, description, permissionSuggestions, blockedPath) { + sendRequest(requestId_0, toolName, input, toolUseId, description, permissionSuggestions, blockedPath) { handle_0.sendControlRequest({ type: "control_request", request_id: requestId_0, request: { subtype: "can_use_tool", tool_name: toolName, - input: input11, + input, tool_use_id: toolUseId, description, ...permissionSuggestions ? { @@ -698507,11 +621073,11 @@ function useReplBridge(messages, setMessages, abortControllerRef, commands, main setMessages((prev_18) => [...prev_18, createBridgeStatusMessage(url3, upgradeNudge ? "Please upgrade to the latest version of the Claude mobile app to see your Remote Control sessions." : undefined)]); logForDebugging(`[bridge:repl] Hook initialized, session=${handle_0.bridgeSessionId}`); } - } catch (err3) { + } catch (err2) { if (cancelled) return; consecutiveFailuresRef.current++; - const errMsg = errorMessage(err3); + const errMsg = errorMessage(err2); logForDebugging(`[bridge:repl] Init failed: ${errMsg}; consecutive failures: ${consecutiveFailuresRef.current}`); clearTimeout(failureTimeoutRef.current); notifyBridgeFailed(errMsg); @@ -698581,8 +621147,8 @@ function useReplBridge(messages, setMessages, abortControllerRef, commands, main } const startIndex = Math.min(lastWrittenIndexRef.current, messages.length); const newMessages = []; - for (let i4 = startIndex;i4 < messages.length; i4++) { - const msg_1 = messages[i4]; + for (let i3 = startIndex;i3 < messages.length; i3++) { + const msg_1 = messages[i3]; if (msg_1 && (msg_1.type === "user" || msg_1.type === "assistant" || msg_1.type === "system" && msg_1.subtype === "local_command")) { newMessages.push(msg_1); } @@ -698621,7 +621187,7 @@ var init_useReplBridge = __esm(() => { init_errors(); init_messageQueueManager(); init_systemInit(); - init_messages5(); + init_messages3(); init_permissionSetup(); jsx_dev_runtime378 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -698634,7 +621200,7 @@ __export(exports_MessageSelector, { MessageSelector: () => MessageSelector }); import { randomUUID as randomUUID41 } from "crypto"; -import * as path26 from "path"; +import * as path21 from "path"; function isTextBlock2(block2) { return block2.type === "text"; } @@ -698651,7 +621217,7 @@ function MessageSelector({ preselectedMessage }) { const fileHistory = useAppState((s) => s.fileHistory); - const [error46, setError] = import_react205.useState(undefined); + const [error42, setError] = import_react205.useState(undefined); const isFileHistoryEnabled = fileHistoryEnabled(); const currentUUID = import_react205.useMemo(randomUUID41, []); const messageOptions = import_react205.useMemo(() => [...messages.filter(selectableUserMessagesFilter), { @@ -698860,7 +621426,7 @@ ${codeError}`); "messageSelector:select": handleSelectCurrent }, { context: "MessageSelector", - isActive: !isRestoring && !error46 && !messageToRestore && hasMessagesToSelect + isActive: !isRestoring && !error42 && !messageToRestore && hasMessagesToSelect }); const [fileHistoryMetadata, setFileHistoryMetadata] = import_react205.useState({}); import_react205.useEffect(() => { @@ -698890,7 +621456,7 @@ ${codeError}`); loadFileHistoryMetadata(); }, [messageOptions, messages, currentUUID, fileHistory, isFileHistoryEnabled]); const canRestoreCode_0 = isFileHistoryEnabled && diffStatsForRestore?.filesChanged && diffStatsForRestore.filesChanged.length > 0; - const showPickList = !error46 && !messageToRestore && !preselectedMessage && hasMessagesToSelect; + const showPickList = !error42 && !messageToRestore && !preselectedMessage && hasMessagesToSelect; return /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedBox_default, { flexDirection: "column", width: "100%", @@ -698908,12 +621474,12 @@ ${codeError}`); color: "suggestion", children: "Rewind" }, undefined, false, undefined, this), - error46 && /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(jsx_dev_runtime379.Fragment, { + error42 && /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(jsx_dev_runtime379.Fragment, { children: /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedText, { color: "error", children: [ "Error: ", - error46 + error42 ] }, undefined, true, undefined, this) }, undefined, false, undefined, this), @@ -698922,7 +621488,7 @@ ${codeError}`); children: "Nothing to rewind to yet." }, undefined, false, undefined, this) }, undefined, false, undefined, this), - !error46 && messageToRestore && hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(jsx_dev_runtime379.Fragment, { + !error42 && messageToRestore && hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(jsx_dev_runtime379.Fragment, { children: [ /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedText, { children: [ @@ -699051,7 +621617,7 @@ ${codeError}`); color: "inactive", children: numFilesChanged ? /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(jsx_dev_runtime379.Fragment, { children: [ - numFilesChanged === 1 && metadata.filesChanged[0] ? `${path26.basename(metadata.filesChanged[0])} ` : `${numFilesChanged} files changed `, + numFilesChanged === 1 && metadata.filesChanged[0] ? `${path21.basename(metadata.filesChanged[0])} ` : `${numFilesChanged} files changed `, /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(DiffStatsText, { diffStats: metadata }, undefined, false, undefined, this) @@ -699088,7 +621654,7 @@ ${codeError}`); ] }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(jsx_dev_runtime379.Fragment, { children: [ - !error46 && hasMessagesToSelect && "Enter to continue · ", + !error42 && hasMessagesToSelect && "Enter to continue · ", "Esc to exit" ] }, undefined, true, undefined, this) @@ -699197,7 +621763,7 @@ function RestoreCodeConfirmation(t0) { if (numFilesChanged === 1) { let t12; if ($2[1] !== diffStatsForRestore.filesChanged[0]) { - t12 = path26.basename(diffStatsForRestore.filesChanged[0] || ""); + t12 = path21.basename(diffStatsForRestore.filesChanged[0] || ""); $2[1] = diffStatsForRestore.filesChanged[0]; $2[2] = t12; } else { @@ -699208,7 +621774,7 @@ function RestoreCodeConfirmation(t0) { if (numFilesChanged === 2) { let t12; if ($2[3] !== diffStatsForRestore.filesChanged[0]) { - t12 = path26.basename(diffStatsForRestore.filesChanged[0] || ""); + t12 = path21.basename(diffStatsForRestore.filesChanged[0] || ""); $2[3] = diffStatsForRestore.filesChanged[0]; $2[4] = t12; } else { @@ -699217,7 +621783,7 @@ function RestoreCodeConfirmation(t0) { const file1 = t12; let t22; if ($2[5] !== diffStatsForRestore.filesChanged[1]) { - t22 = path26.basename(diffStatsForRestore.filesChanged[1] || ""); + t22 = path21.basename(diffStatsForRestore.filesChanged[1] || ""); $2[5] = diffStatsForRestore.filesChanged[1]; $2[6] = t22; } else { @@ -699228,7 +621794,7 @@ function RestoreCodeConfirmation(t0) { } else { let t12; if ($2[7] !== diffStatsForRestore.filesChanged[0]) { - t12 = path26.basename(diffStatsForRestore.filesChanged[0] || ""); + t12 = path21.basename(diffStatsForRestore.filesChanged[0] || ""); $2[7] = diffStatsForRestore.filesChanged[0]; $2[8] = t12; } else { @@ -699394,8 +621960,8 @@ function UserMessageOption(t0) { break bb0; } if (messageText.includes("")) { - const input11 = extractTag(messageText, "bash-input"); - if (input11) { + const input = extractTag(messageText, "bash-input"); + if (input) { let t72; if ($2[20] === Symbol.for("react.memo_cache_sentinel")) { t72 = /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedText, { @@ -699416,7 +621982,7 @@ function UserMessageOption(t0) { dimColor, children: [ " ", - input11 + input ] }, undefined, true, undefined, this) ] @@ -699544,23 +622110,23 @@ function computeDiffStatsBetweenMessages(messages, fromMessageId, toMessageId) { const filesChanged = []; let insertions = 0; let deletions = 0; - for (let i4 = startIndex + 1;i4 < endIndex; i4++) { - const msg = messages[i4]; + for (let i3 = startIndex + 1;i3 < endIndex; i3++) { + const msg = messages[i3]; if (!msg || !isToolUseResultMessage(msg)) { continue; } - const result3 = msg.toolUseResult; - if (!result3 || !result3.filePath || !result3.structuredPatch) { + const result2 = msg.toolUseResult; + if (!result2 || !result2.filePath || !result2.structuredPatch) { continue; } - if (!filesChanged.includes(result3.filePath)) { - filesChanged.push(result3.filePath); + if (!filesChanged.includes(result2.filePath)) { + filesChanged.push(result2.filePath); } try { - if ("type" in result3 && result3.type === "create") { - insertions += result3.content.split(/\r?\n/).length; + if ("type" in result2 && result2.type === "create") { + insertions += result2.content.split(/\r?\n/).length; } else { - for (const hunk of result3.structuredPatch) { + for (const hunk of result2.structuredPatch) { const additions = count2(hunk.lines, (line) => line.startsWith("+")); const removals = count2(hunk.lines, (line) => line.startsWith("-")); insertions += additions; @@ -699602,8 +622168,8 @@ function selectableUserMessagesFilter(message) { return true; } function messagesAfterAreOnlySynthetic(messages, fromIndex) { - for (let i4 = fromIndex + 1;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = fromIndex + 1;i3 < messages.length; i3++) { + const msg = messages[i3]; if (!msg) continue; if (isSyntheticMessage(msg)) @@ -699646,7 +622212,7 @@ var init_MessageSelector = __esm(() => { init_ink2(); init_useKeybinding(); init_displayTags(); - init_messages5(); + init_messages3(); init_select(); init_Spinner2(); init_useTerminalSize(); @@ -700203,8 +622769,8 @@ function QuestionNavigationBar(t0) { } return t7; } -function _temp350(sum3, w) { - return sum3 + w; +function _temp350(sum2, w) { + return sum2 + w; } function _temp277(header_0) { return 4 + stringWidth(header_0); @@ -700290,10 +622856,10 @@ function PreviewQuestionView({ }, [focusedIndex, allOptions.length, isInNotesInput]); useKeybinding("chat:externalEditor", async () => { const currentValue = questionState?.textInputValue || ""; - const result3 = await editPromptInEditor(currentValue); - if (result3.content !== null && result3.content !== currentValue) { + const result2 = await editPromptInEditor(currentValue); + if (result2.content !== null && result2.content !== currentValue) { onUpdateQuestionState(questionText, { - textInputValue: result3.content + textInputValue: result2.content }, false); } }, { @@ -700743,11 +623309,11 @@ function QuestionView(t0) { let t82; if ($2[18] !== onUpdateQuestionState || $2[19] !== question.multiSelect || $2[20] !== questionText) { t82 = async (currentValue, setValue) => { - const result3 = await editPromptInEditor(currentValue); - if (result3.content !== null && result3.content !== currentValue) { - setValue(result3.content); + const result2 = await editPromptInEditor(currentValue); + if (result2.content !== null && result2.content !== currentValue) { + setValue(result2.content); onUpdateQuestionState(questionText, { - textInputValue: result3.content + textInputValue: result2.content }, question.multiSelect ?? false); } }; @@ -700922,12 +623488,12 @@ function QuestionView(t0) { children: question.multiSelect ? /* @__PURE__ */ jsx_dev_runtime383.jsxDEV(SelectMulti, { options: options2, defaultValue: questionStates[question.question]?.selectedValue, - onChange: (values4) => { + onChange: (values2) => { onUpdateQuestionState(questionText, { - selectedValue: values4 + selectedValue: values2 }, true); - const textInput = values4.includes("__other__") ? questionStates[questionText]?.textInputValue : undefined; - const finalValues = values4.filter(_temp439).concat(textInput ? [textInput] : []); + const textInput = values2.includes("__other__") ? questionStates[questionText]?.textInputValue : undefined; + const finalValues = values2.filter(_temp439).concat(textInput ? [textInput] : []); onAnswer(questionText, finalValues, undefined, false); }, onFocus: handleFocus, @@ -701764,12 +624330,12 @@ function AskUserQuestionPermissionRequestBody(t0) { } else { t1 = $2[1]; } - const result3 = t1; + const result2 = t1; let t2; - if ($2[2] !== result3.data || $2[3] !== result3.success) { - t2 = result3.success ? result3.data.questions || [] : []; - $2[2] = result3.data; - $2[3] = result3.success; + if ($2[2] !== result2.data || $2[3] !== result2.success) { + t2 = result2.success ? result2.data.questions || [] : []; + $2[2] = result2.data; + $2[3] = result2.success; $2[4] = t2; } else { t2 = $2[4]; @@ -701837,7 +624403,7 @@ function AskUserQuestionPermissionRequestBody(t0) { globalContentHeight, globalContentWidth } = t5; - const metadataSource = result3.success ? result3.data.metadata?.source : undefined; + const metadataSource = result2.success ? result2.data.metadata?.source : undefined; let t6; if ($2[15] === Symbol.for("react.memo_cache_sentinel")) { t6 = {}; @@ -702222,7 +624788,7 @@ ${questionsWithAnswers_0}`; if (currentQuestion) { let t23; if ($2[78] !== currentQuestion.question) { - t23 = (base645, mediaType_0, filename_0, dims, path27) => onImagePaste(currentQuestion.question, base645, mediaType_0, filename_0, dims, path27); + t23 = (base644, mediaType_0, filename_0, dims, path22) => onImagePaste(currentQuestion.question, base644, mediaType_0, filename_0, dims, path22); $2[78] = currentQuestion.question; $2[79] = t23; } else { @@ -702485,13 +625051,13 @@ function flagTakesArg(flag, nextArg, spec) { return false; } function findFirstSubcommand(args, spec) { - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (!arg) continue; if (arg.startsWith("-")) { - if (flagTakesArg(arg, args[i4 + 1], spec)) - i4++; + if (flagTakesArg(arg, args[i3 + 1], spec)) + i3++; continue; } if (!spec?.subcommands?.length) @@ -702506,8 +625072,8 @@ async function buildPrefix(command8, args, spec) { const parts = [command8]; const hasSubcommands = !!spec?.subcommands?.length; let foundSubcommand = false; - for (let i4 = 0;i4 < args.length; i4++) { - const arg = args[i4]; + for (let i3 = 0;i3 < args.length; i3++) { + const arg = args[i3]; if (!arg || parts.length >= maxDepth) break; if (arg.startsWith("-")) { @@ -702515,19 +625081,19 @@ async function buildPrefix(command8, args, spec) { break; if (spec?.options) { const option = spec.options.find((opt) => Array.isArray(opt.name) ? opt.name.includes(arg) : opt.name === arg); - if (option?.args && toArray5(option.args).some((a2) => a2?.isCommand || a2?.isModule)) { + if (option?.args && toArray4(option.args).some((a2) => a2?.isCommand || a2?.isModule)) { parts.push(arg); continue; } } if (hasSubcommands && !foundSubcommand) { - if (flagTakesArg(arg, args[i4 + 1], spec)) - i4++; + if (flagTakesArg(arg, args[i3 + 1], spec)) + i3++; continue; } break; } - if (await shouldStopAtArg(arg, args.slice(0, i4), spec)) + if (await shouldStopAtArg(arg, args.slice(0, i3), spec)) break; if (hasSubcommands && !foundSubcommand) { foundSubcommand = isKnownSubcommand(arg, spec); @@ -702551,7 +625117,7 @@ async function calculateDepth(command8, args, spec) { if (!arg?.startsWith("-")) continue; const option = spec.options.find((opt) => Array.isArray(opt.name) ? opt.name.includes(arg) : opt.name === arg); - if (option?.args && toArray5(option.args).some((arg2) => arg2?.isCommand || arg2?.isModule)) + if (option?.args && toArray4(option.args).some((arg2) => arg2?.isCommand || arg2?.isModule)) return 3; } } @@ -702560,7 +625126,7 @@ async function calculateDepth(command8, args, spec) { const subcommand = spec.subcommands.find((sub) => Array.isArray(sub.name) ? sub.name.some((n3) => n3.toLowerCase() === firstSubLower) : sub.name.toLowerCase() === firstSubLower); if (subcommand) { if (subcommand.args) { - const subArgs = toArray5(subcommand.args); + const subArgs = toArray4(subcommand.args); if (subArgs.some((arg) => arg?.isCommand)) return 3; if (subArgs.some((arg) => arg?.isVariadic)) @@ -702574,7 +625140,7 @@ async function calculateDepth(command8, args, spec) { } } if (spec.args) { - const argsArray = toArray5(spec.args); + const argsArray = toArray4(spec.args); if (argsArray.some((arg) => arg?.isCommand)) { return !Array.isArray(spec.args) && spec.args.isCommand ? 2 : Math.min(2 + argsArray.findIndex((arg) => arg?.isCommand), 3); } @@ -702585,7 +625151,7 @@ async function calculateDepth(command8, args, spec) { return 2; } } - return spec.args && toArray5(spec.args).some((arg) => arg?.isDangerous) ? 3 : 2; + return spec.args && toArray4(spec.args).some((arg) => arg?.isDangerous) ? 3 : 2; } async function shouldStopAtArg(arg, args, spec) { if (arg.startsWith("-")) @@ -702598,13 +625164,13 @@ async function shouldStopAtArg(arg, args, spec) { return false; if (spec?.options && args.length > 0 && args[args.length - 1] === "-m") { const option = spec.options.find((opt) => Array.isArray(opt.name) ? opt.name.includes("-m") : opt.name === "-m"); - if (option?.args && toArray5(option.args).some((arg2) => arg2?.isModule)) { + if (option?.args && toArray4(option.args).some((arg2) => arg2?.isModule)) { return false; } } return true; } -var URL_PROTOCOLS, DEPTH_RULES, toArray5 = (val) => Array.isArray(val) ? val : [val]; +var URL_PROTOCOLS, DEPTH_RULES, toArray4 = (val) => Array.isArray(val) ? val : [val]; var init_specPrefix = __esm(() => { URL_PROTOCOLS = ["http://", "https://", "ftp://"]; DEPTH_RULES = { @@ -702747,9 +625313,9 @@ var init_pyright = __esm(() => { }); // src/utils/bash/specs/sleep.ts -var sleep6, sleep_default; -var init_sleep2 = __esm(() => { - sleep6 = { +var sleep4, sleep_default; +var init_sleep = __esm(() => { + sleep4 = { name: "sleep", description: "Delay for a specified amount of time", args: { @@ -702758,7 +625324,7 @@ var init_sleep2 = __esm(() => { isOptional: false } }; - sleep_default = sleep6; + sleep_default = sleep4; }); // src/utils/bash/specs/srun.ts @@ -702837,7 +625403,7 @@ var init_specs = __esm(() => { init_alias(); init_nohup(); init_pyright(); - init_sleep2(); + init_sleep(); init_srun(); init_time(); init_timeout2(); @@ -702898,7 +625464,7 @@ async function getCommandPrefixStatic(command8, recursionDepth = 0, wrapperCount if (!cmd) return { commandPrefix: null }; const spec = await getCommandSpec(cmd); - let isWrapper = WRAPPER_COMMANDS.has(cmd) || spec?.args && toArray6(spec.args).some((arg) => arg?.isCommand); + let isWrapper = WRAPPER_COMMANDS.has(cmd) || spec?.args && toArray5(spec.args).some((arg) => arg?.isCommand); if (isWrapper && args[0] && isKnownSubcommand2(args[0], spec)) { isWrapper = false; } @@ -702912,19 +625478,19 @@ async function getCommandPrefixStatic(command8, recursionDepth = 0, wrapperCount async function handleWrapper(command8, args, recursionDepth, wrapperCount) { const spec = await getCommandSpec(command8); if (spec?.args) { - const commandArgIndex = toArray6(spec.args).findIndex((arg) => arg?.isCommand); + const commandArgIndex = toArray5(spec.args).findIndex((arg) => arg?.isCommand); if (commandArgIndex !== -1) { const parts = [command8]; - for (let i4 = 0;i4 < args.length && i4 <= commandArgIndex; i4++) { - if (i4 === commandArgIndex) { - const result4 = await getCommandPrefixStatic(args.slice(i4).join(" "), recursionDepth + 1, wrapperCount + 1); - if (result4?.commandPrefix) { - parts.push(...result4.commandPrefix.split(" ")); + for (let i3 = 0;i3 < args.length && i3 <= commandArgIndex; i3++) { + if (i3 === commandArgIndex) { + const result3 = await getCommandPrefixStatic(args.slice(i3).join(" "), recursionDepth + 1, wrapperCount + 1); + if (result3?.commandPrefix) { + parts.push(...result3.commandPrefix.split(" ")); return parts.join(" "); } break; - } else if (args[i4] && !args[i4].startsWith("-") && !ENV_VAR.test(args[i4])) { - parts.push(args[i4]); + } else if (args[i3] && !args[i3].startsWith("-") && !ENV_VAR.test(args[i3])) { + parts.push(args[i3]); } } } @@ -702932,35 +625498,35 @@ async function handleWrapper(command8, args, recursionDepth, wrapperCount) { const wrapped = args.find((arg) => !arg.startsWith("-") && !NUMERIC.test(arg) && !ENV_VAR.test(arg)); if (!wrapped) return command8; - const result3 = await getCommandPrefixStatic(args.slice(args.indexOf(wrapped)).join(" "), recursionDepth + 1, wrapperCount + 1); - return !result3?.commandPrefix ? null : `${command8} ${result3.commandPrefix}`; + const result2 = await getCommandPrefixStatic(args.slice(args.indexOf(wrapped)).join(" "), recursionDepth + 1, wrapperCount + 1); + return !result2?.commandPrefix ? null : `${command8} ${result2.commandPrefix}`; } async function getCompoundCommandPrefixesStatic(command8, excludeSubcommand) { const subcommands = splitCommand_DEPRECATED(command8); if (subcommands.length <= 1) { - const result3 = await getCommandPrefixStatic(command8); - return result3?.commandPrefix ? [result3.commandPrefix] : []; + const result2 = await getCommandPrefixStatic(command8); + return result2?.commandPrefix ? [result2.commandPrefix] : []; } const prefixes = []; for (const subcmd of subcommands) { const trimmed = subcmd.trim(); if (excludeSubcommand?.(trimmed)) continue; - const result3 = await getCommandPrefixStatic(trimmed); - if (result3?.commandPrefix) { - prefixes.push(result3.commandPrefix); + const result2 = await getCommandPrefixStatic(trimmed); + if (result2?.commandPrefix) { + prefixes.push(result2.commandPrefix); } } if (prefixes.length === 0) return []; const groups = new Map; for (const prefix of prefixes) { - const root3 = prefix.split(" ")[0]; - const group = groups.get(root3); + const root2 = prefix.split(" ")[0]; + const group = groups.get(root2); if (group) { group.push(prefix); } else { - groups.set(root3, [prefix]); + groups.set(root2, [prefix]); } } const collapsed = []; @@ -702975,23 +625541,23 @@ function longestCommonPrefix2(strings) { if (strings.length === 1) return strings[0]; const first = strings[0]; - const words3 = first.split(" "); - let commonWords = words3.length; - for (let i4 = 1;i4 < strings.length; i4++) { - const otherWords = strings[i4].split(" "); - let shared3 = 0; - while (shared3 < commonWords && shared3 < otherWords.length && words3[shared3] === otherWords[shared3]) { - shared3++; + const words2 = first.split(" "); + let commonWords = words2.length; + for (let i3 = 1;i3 < strings.length; i3++) { + const otherWords = strings[i3].split(" "); + let shared2 = 0; + while (shared2 < commonWords && shared2 < otherWords.length && words2[shared2] === otherWords[shared2]) { + shared2++; } - commonWords = shared3; + commonWords = shared2; } - return words3.slice(0, Math.max(1, commonWords)).join(" "); + return words2.slice(0, Math.max(1, commonWords)).join(" "); } -var NUMERIC, ENV_VAR, WRAPPER_COMMANDS, toArray6 = (val) => Array.isArray(val) ? val : [val]; +var NUMERIC, ENV_VAR, WRAPPER_COMMANDS, toArray5 = (val) => Array.isArray(val) ? val : [val]; var init_prefix2 = __esm(() => { init_specPrefix(); init_commands(); - init_parser5(); + init_parser4(); init_registry2(); NUMERIC = /^\d+$/; ENV_VAR = /^[A-Za-z_][A-Za-z0-9_]*=/; @@ -703108,12 +625674,12 @@ function usePermissionRequestLogging(toolUseConfirm, unaryEvent) { if (process.env.USER_TYPE === "ant") { const parsedInput = BashTool.inputSchema.safeParse(toolUseConfirm.input); if (toolUseConfirm.tool.name === BashTool.name && toolUseConfirm.permissionResult.behavior === "ask" && parsedInput.success) { - let split3 = [parsedInput.data.command]; + let split2 = [parsedInput.data.command]; try { - split3 = splitCommand_DEPRECATED(parsedInput.data.command); + split2 = splitCommand_DEPRECATED(parsedInput.data.command); } catch {} logEvent("tengu_internal_bash_tool_use_permission_request", { - parts: jsonStringify(split3), + parts: jsonStringify(split2), input: jsonStringify(toolUseConfirm.input), decisionReasonType: toolUseConfirm.permissionResult.decisionReason?.type, decisionReason: decisionReasonToString(toolUseConfirm.permissionResult.decisionReason) @@ -703190,8 +625756,8 @@ function PermissionDecisionInfoItem(t0) { return /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(ThemedBox_default, { flexDirection: "column", children: Array.from(decisionReason.reasons.entries()).map((t22) => { - const [subcommand, result3] = t22; - const icon = result3.behavior === "allow" ? color("success", theme2)(figures_default.tick) : color("error", theme2)(figures_default.cross); + const [subcommand, result2] = t22; + const icon = result2.behavior === "allow" ? color("success", theme2)(figures_default.tick) : color("error", theme2)(figures_default.cross); return /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(ThemedBox_default, { flexDirection: "column", children: [ @@ -703202,7 +625768,7 @@ function PermissionDecisionInfoItem(t0) { subcommand ] }, undefined, true, undefined, this), - result3.decisionReason !== undefined && result3.decisionReason.type !== "subcommandResults" && /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(ThemedText, { + result2.decisionReason !== undefined && result2.decisionReason.type !== "subcommandResults" && /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(ThemedText, { children: [ /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(ThemedText, { dimColor: true, @@ -703213,12 +625779,12 @@ function PermissionDecisionInfoItem(t0) { ] }, undefined, true, undefined, this), /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(Ansi, { - children: decisionReasonDisplayString(result3.decisionReason) + children: decisionReasonDisplayString(result2.decisionReason) }, undefined, false, undefined, this) ] }, undefined, true, undefined, this), - result3.behavior === "ask" && /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(SuggestedRules, { - suggestions: result3.suggestions + result2.behavior === "ask" && /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(SuggestedRules, { + suggestions: result2.suggestions }, undefined, false, undefined, this) ] }, subcommand, true, undefined, this); @@ -703373,10 +625939,10 @@ function _temp180(rule) { function extractDirectories(updates) { if (!updates) return []; - return updates.flatMap((update3) => { - switch (update3.type) { + return updates.flatMap((update2) => { + switch (update2.type) { case "addDirectories": - return update3.directories; + return update2.directories; default: return []; } @@ -703385,8 +625951,8 @@ function extractDirectories(updates) { function extractMode(updates) { if (!updates) return; - const update3 = updates.findLast((u2) => u2.type === "setMode"); - return update3?.type === "setMode" ? update3.mode : undefined; + const update2 = updates.findLast((u2) => u2.type === "setMode"); + return update2?.type === "setMode" ? update2.mode : undefined; } function SuggestionDisplay(t0) { const $2 = import_compiler_runtime298.c(22); @@ -703818,7 +626384,7 @@ function PermissionDecisionDebugInfo(t0) { } return t9; } -function _temp528(u_1, i4) { +function _temp528(u_1, i3) { return /* @__PURE__ */ jsx_dev_runtime387.jsxDEV(ThemedBox_default, { flexDirection: "column", marginLeft: 2, @@ -703843,7 +626409,7 @@ function _temp528(u_1, i4) { ] }, undefined, true, undefined, this) ] - }, i4, true, undefined, this); + }, i3, true, undefined, this); } function _temp441(s) { return s.toolPermissionContext; @@ -703866,14 +626432,14 @@ var init_PermissionDecisionDebugInfo = __esm(() => { }); // src/utils/permissions/permissionExplainer.ts -function formatToolInput(input11) { - if (typeof input11 === "string") { - return input11; +function formatToolInput(input) { + if (typeof input === "string") { + return input; } try { - return jsonStringify(input11, null, 2); + return jsonStringify(input, null, 2); } catch { - return String(input11); + return String(input); } } function extractConversationContext(messages, maxChars = 1000) { @@ -703935,13 +626501,13 @@ Explain this command in context.`; const toolUseBlock = response.content.find((c6) => c6.type === "tool_use"); if (toolUseBlock && toolUseBlock.type === "tool_use") { logForDebugging(`Permission explainer: tool input: ${jsonStringify(toolUseBlock.input).slice(0, 500)}`); - const result3 = RiskAssessmentSchema().safeParse(toolUseBlock.input); - if (result3.success) { + const result2 = RiskAssessmentSchema().safeParse(toolUseBlock.input); + if (result2.success) { const explanation = { - riskLevel: result3.data.riskLevel, - explanation: result3.data.explanation, - reasoning: result3.data.reasoning, - risk: result3.data.risk + riskLevel: result2.data.riskLevel, + explanation: result2.data.explanation, + reasoning: result2.data.reasoning, + risk: result2.data.risk }; logEvent("tengu_permission_explainer_generated", { tool_name: sanitizeToolNameForAnalytics(toolName), @@ -703959,17 +626525,17 @@ Explain this command in context.`; }); logForDebugging(`Permission explainer: no parsed output in response`); return null; - } catch (error46) { + } catch (error42) { const latencyMs = Date.now() - startTime; if (signal.aborted) { logForDebugging(`Permission explainer: request aborted for ${toolName}`); return null; } - logForDebugging(`Permission explainer error: ${errorMessage(error46)}`); - logError2(error46); + logForDebugging(`Permission explainer error: ${errorMessage(error42)}`); + logError2(error42); logEvent("tengu_permission_explainer_error", { tool_name: sanitizeToolNameForAnalytics(toolName), - error_type: error46 instanceof Error && error46.name === "AbortError" ? ERROR_TYPE_NETWORK : ERROR_TYPE_UNKNOWN2, + error_type: error42 instanceof Error && error42.name === "AbortError" ? ERROR_TYPE_NETWORK : ERROR_TYPE_UNKNOWN2, latency_ms: latencyMs }); return null; @@ -704519,7 +627085,7 @@ var init_FileEditToolDiff = __esm(() => { import_react215 = __toESM(require_react(), 1); init_useTerminalSize(); init_ink2(); - init_utils9(); + init_utils8(); init_diff2(); init_log3(); init_readEditContext(); @@ -704530,7 +627096,7 @@ var init_FileEditToolDiff = __esm(() => { // src/hooks/useDiffInIDE.ts import { randomUUID as randomUUID42 } from "crypto"; -import { basename as basename51 } from "path"; +import { basename as basename49 } from "path"; function useDiffInIDE({ onChange, toolUseContext, @@ -704541,7 +627107,7 @@ function useDiffInIDE({ const isUnmounted = import_react216.useRef(false); const [hasError, setHasError] = import_react216.useState(false); const sha = import_react216.useMemo(() => randomUUID42().slice(0, 6), []); - const tabName = import_react216.useMemo(() => `✻ [Claude Code] ${basename51(filePath)} (${sha}) ⧉`, [filePath, sha]); + const tabName = import_react216.useMemo(() => `✻ [Claude Code] ${basename49(filePath)} (${sha}) ⧉`, [filePath, sha]); const shouldShowDiffInIDE = hasAccessToIDEExtensionDiffFeature(toolUseContext.options.mcpClients) && getGlobalConfig().diffTool === "auto" && !filePath.endsWith(".ipynb"); const ideName = getConnectedIdeName(toolUseContext.options.mcpClients) ?? "IDE"; async function showDiff() { @@ -704572,8 +627138,8 @@ function useDiffInIDE({ file_path: filePath, edits: newEdits }); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); setHasError(true); } } @@ -704681,10 +627247,10 @@ async function showDiffInIDE(file_path, edits, toolUseContext, tabName) { }; } throw new Error("Not accepted"); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); cleanup(); - throw error46; + throw error42; } } async function closeTabInIDE(tabName, ideClient) { @@ -704693,8 +627259,8 @@ async function closeTabInIDE(tabName, ideClient) { throw new Error("IDE client not available"); } await callIdeRpc("close_tab", { tab_name: tabName }, ideClient); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } function isClosedMessage(data) { @@ -704712,7 +627278,7 @@ var init_useDiffInIDE = __esm(() => { init_analytics(); init_fileRead(); init_path2(); - init_utils9(); + init_utils8(); init_config2(); init_diff2(); init_errors(); @@ -704723,13 +627289,13 @@ var init_useDiffInIDE = __esm(() => { }); // src/components/ShowInIDEPrompt.tsx -import { basename as basename52, relative as relative30 } from "path"; +import { basename as basename50, relative as relative28 } from "path"; function ShowInIDEPrompt(t0) { const $2 = import_compiler_runtime301.c(36); const { onChange, options: options2, - input: input11, + input, filePath, ideName, symlinkTarget, @@ -704761,7 +627327,7 @@ function ShowInIDEPrompt(t0) { if ($2[2] !== symlinkTarget) { t2 = symlinkTarget && /* @__PURE__ */ jsx_dev_runtime390.jsxDEV(ThemedText, { color: "warning", - children: relative30(getCwd(), symlinkTarget).startsWith("..") ? `This will modify ${symlinkTarget} (outside working directory) via a symlink` : `Symlink target: ${symlinkTarget}` + children: relative28(getCwd(), symlinkTarget).startsWith("..") ? `This will modify ${symlinkTarget} (outside working directory) via a symlink` : `Symlink target: ${symlinkTarget}` }, undefined, false, undefined, this); $2[2] = symlinkTarget; $2[3] = t2; @@ -704780,7 +627346,7 @@ function ShowInIDEPrompt(t0) { } let t4; if ($2[5] !== filePath) { - t4 = basename52(filePath); + t4 = basename50(filePath); $2[5] = filePath; $2[6] = t4; } else { @@ -704805,25 +627371,25 @@ function ShowInIDEPrompt(t0) { t5 = $2[8]; } let t6; - if ($2[9] !== acceptFeedback || $2[10] !== input11 || $2[11] !== onChange || $2[12] !== options2 || $2[13] !== rejectFeedback) { + if ($2[9] !== acceptFeedback || $2[10] !== input || $2[11] !== onChange || $2[12] !== options2 || $2[13] !== rejectFeedback) { t6 = (value) => { const selected = options2.find((opt) => opt.value === value); if (selected) { if (selected.option.type === "reject") { const trimmedFeedback = rejectFeedback.trim(); - onChange(selected.option, input11, trimmedFeedback || undefined); + onChange(selected.option, input, trimmedFeedback || undefined); return; } if (selected.option.type === "accept-once") { const trimmedFeedback_0 = acceptFeedback.trim(); - onChange(selected.option, input11, trimmedFeedback_0 || undefined); + onChange(selected.option, input, trimmedFeedback_0 || undefined); return; } - onChange(selected.option, input11); + onChange(selected.option, input); } }; $2[9] = acceptFeedback; - $2[10] = input11; + $2[10] = input; $2[11] = onChange; $2[12] = options2; $2[13] = rejectFeedback; @@ -704832,11 +627398,11 @@ function ShowInIDEPrompt(t0) { t6 = $2[14]; } let t7; - if ($2[15] !== input11 || $2[16] !== onChange) { + if ($2[15] !== input || $2[16] !== onChange) { t7 = () => onChange({ type: "reject" - }, input11); - $2[15] = input11; + }, input); + $2[15] = input; $2[16] = onChange; $2[17] = t7; } else { @@ -704940,21 +627506,21 @@ var init_ShowInIDEPrompt = __esm(() => { }); // src/components/permissions/FilePermissionDialog/permissionOptions.tsx -import { homedir as homedir38 } from "os"; -import { basename as basename53, join as join164, sep as sep38 } from "path"; +import { homedir as homedir36 } from "os"; +import { basename as basename51, join as join154, sep as sep35 } from "path"; function isInClaudeFolder(filePath) { const absolutePath = expandPath(filePath); const claudeFolderPath = expandPath(`${getOriginalCwd()}/.claude`); - const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath); - const normalizedClaudeFolderPath = normalizeCaseForComparison2(claudeFolderPath); - return normalizedAbsolutePath.startsWith(normalizedClaudeFolderPath + sep38.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedClaudeFolderPath + "/"); + const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath); + const normalizedClaudeFolderPath = normalizeCaseForComparison(claudeFolderPath); + return normalizedAbsolutePath.startsWith(normalizedClaudeFolderPath + sep35.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedClaudeFolderPath + "/"); } function isInGlobalClaudeFolder(filePath) { const absolutePath = expandPath(filePath); - const globalClaudeFolderPath = join164(homedir38(), ".claude"); - const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath); - const normalizedGlobalClaudeFolderPath = normalizeCaseForComparison2(globalClaudeFolderPath); - return normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + sep38.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + "/"); + const globalClaudeFolderPath = join154(homedir36(), ".claude"); + const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath); + const normalizedGlobalClaudeFolderPath = normalizeCaseForComparison(globalClaudeFolderPath); + return normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + sep35.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + "/"); } function getFilePermissionOptions({ filePath, @@ -705023,7 +627589,7 @@ function getFilePermissionOptions({ } } else { const dirPath = getDirectoryForPath(filePath); - const dirName = basename53(dirPath) || "this directory"; + const dirName = basename51(dirPath) || "this directory"; if (operationType === "read") { sessionLabel = /* @__PURE__ */ jsx_dev_runtime391.jsxDEV(ThemedText, { children: [ @@ -705132,7 +627698,7 @@ function handleAcceptOnce(params, options2) { function handleAcceptSession(params, options2) { const { messageId, - path: path27, + path: path22, toolUseConfirm, toolPermissionContext, onDone, @@ -705160,7 +627726,7 @@ function handleAcceptSession(params, options2) { toolUseConfirm.onAllow(toolUseConfirm.input, suggestions2); return; } - const suggestions = path27 ? generateSuggestions(path27, operationType, toolPermissionContext) : []; + const suggestions = path22 ? generateSuggestions(path22, operationType, toolPermissionContext) : []; onDone(); toolUseConfirm.onAllow(toolUseConfirm.input, suggestions); } @@ -705227,7 +627793,7 @@ function useFilePermissionDialog({ yesInputMode, noInputMode }), [filePath, toolPermissionContext, operationType, yesInputMode, noInputMode]); - const onChange = import_react217.useCallback((option, input11, feedback2) => { + const onChange = import_react217.useCallback((option, input, feedback2) => { const params = { messageId: toolUseConfirm.assistantMessage.message.id, path: filePath, @@ -705241,10 +627807,10 @@ function useFilePermissionDialog({ }; const originalOnAllow = toolUseConfirm.onAllow; toolUseConfirm.onAllow = (_input, permissionUpdates, feedback3) => { - originalOnAllow(input11, permissionUpdates, feedback3); + originalOnAllow(input, permissionUpdates, feedback3); }; - const handler14 = PERMISSION_HANDLERS[option.type]; - handler14(params, { + const handler19 = PERMISSION_HANDLERS[option.type]; + handler19(params, { feedback: feedback2, hasFeedback: !!feedback2, enteredFeedbackMode: option.type === "accept-once" ? yesFeedbackModeEntered : noFeedbackModeEntered, @@ -705328,7 +627894,7 @@ var init_useFilePermissionDialog = __esm(() => { }); // src/components/permissions/FilePermissionDialog/FilePermissionDialog.tsx -import { relative as relative31 } from "path"; +import { relative as relative29 } from "path"; function FilePermissionDialog({ toolUseConfirm, toolUseContext, @@ -705339,36 +627905,36 @@ function FilePermissionDialog({ question = "Do you want to proceed?", content, completionType = "tool_use_single", - path: path27, + path: path22, parseInput, operationType = "write", ideDiffSupport, workerBadge, languageName: languageNameOverride }) { - const languageName = import_react218.useMemo(() => languageNameOverride ?? (path27 ? getLanguageName(path27) : "none"), [languageNameOverride, path27]); + const languageName = import_react218.useMemo(() => languageNameOverride ?? (path22 ? getLanguageName(path22) : "none"), [languageNameOverride, path22]); const unaryEvent = import_react218.useMemo(() => ({ completion_type: completionType, language_name: languageName }), [completionType, languageName]); usePermissionRequestLogging(toolUseConfirm, unaryEvent); const symlinkTarget = import_react218.useMemo(() => { - if (!path27 || operationType === "read") { + if (!path22 || operationType === "read") { return null; } - const expandedPath = expandPath(path27); - const fs12 = getFsImplementation(); + const expandedPath = expandPath(path22); + const fs6 = getFsImplementation(); const { resolvedPath, isSymlink - } = safeResolvePath(fs12, expandedPath); + } = safeResolvePath(fs6, expandedPath); if (isSymlink) { return resolvedPath; } return null; - }, [path27, operationType]); + }, [path22, operationType]); const fileDialogResult = useFilePermissionDialog({ - filePath: path27 || "", + filePath: path22 || "", completionType, languageName, toolUseConfirm, @@ -705390,8 +627956,8 @@ function FilePermissionDialog({ const parsedInput = parseInput(toolUseConfirm.input); const ideDiffConfig = import_react218.useMemo(() => ideDiffSupport ? ideDiffSupport.getConfig(parseInput(toolUseConfirm.input)) : null, [ideDiffSupport, toolUseConfirm.input]); const diffParams = ideDiffConfig ? { - onChange: (option, input11) => { - const transformedInput = ideDiffSupport.applyChanges(parsedInput, input11.edits); + onChange: (option, input) => { + const transformedInput = ideDiffSupport.applyChanges(parsedInput, input.edits); fileDialogResult.onChange(option, transformedInput); }, toolUseContext, @@ -705418,11 +627984,11 @@ function FilePermissionDialog({ closeTabInIDE2?.(); fileDialogResult.onChange(option_0, parsedInput, feedback2?.trim()); }; - if (showingDiffInIDE && ideDiffConfig && path27) { + if (showingDiffInIDE && ideDiffConfig && path22) { return /* @__PURE__ */ jsx_dev_runtime392.jsxDEV(ShowInIDEPrompt, { onChange: (option_1, _input, feedback_0) => onChange(option_1, feedback_0), options: options2, - filePath: path27, + filePath: path22, input: parsedInput, ideName, symlinkTarget, @@ -705435,7 +628001,7 @@ function FilePermissionDialog({ noInputMode }, undefined, false, undefined, this); } - const isSymlinkOutsideCwd = symlinkTarget != null && relative31(getCwd(), symlinkTarget).startsWith(".."); + const isSymlinkOutsideCwd = symlinkTarget != null && relative29(getCwd(), symlinkTarget).startsWith(".."); const symlinkWarning = symlinkTarget ? /* @__PURE__ */ jsx_dev_runtime392.jsxDEV(ThemedBox_default, { paddingX: 1, marginBottom: 1, @@ -705522,7 +628088,7 @@ var init_FilePermissionDialog = __esm(() => { }); // src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx -import { basename as basename54, relative as relative32 } from "path"; +import { basename as basename52, relative as relative30 } from "path"; function SedEditPermissionRequest(t0) { const $2 = import_compiler_runtime302.c(9); let props; @@ -705667,8 +628233,8 @@ function SedEditPermissionRequestInner(t0) { const noChangesMessage = t3; let t4; if ($2[11] !== filePath || $2[12] !== newContent) { - t4 = (input11) => { - const parsed = BashTool.inputSchema.parse(input11); + t4 = (input) => { + const parsed = BashTool.inputSchema.parse(input); return { ...parsed, _simulatedSedEdit: { @@ -705690,7 +628256,7 @@ function SedEditPermissionRequestInner(t0) { const t8 = props.onReject; let t9; if ($2[14] !== filePath) { - t9 = relative32(getCwd(), filePath); + t9 = relative30(getCwd(), filePath); $2[14] = filePath; $2[15] = t9; } else { @@ -705698,7 +628264,7 @@ function SedEditPermissionRequestInner(t0) { } let t10; if ($2[16] !== filePath) { - t10 = basename54(filePath); + t10 = basename52(filePath); $2[16] = filePath; $2[17] = t10; } else { @@ -705803,7 +628369,7 @@ function logUnaryPermissionEvent(completion_type, { } }); } -var init_utils13 = __esm(() => { +var init_utils12 = __esm(() => { init_env(); init_unaryLogging(); }); @@ -705906,11 +628472,11 @@ var init_useShellPermissionFeedback = __esm(() => { init_analytics(); init_metadata(); init_AppState(); - init_utils13(); + init_utils12(); }); // src/components/permissions/shellPermissionHelpers.tsx -import { basename as basename55, sep as sep39 } from "path"; +import { basename as basename53, sep as sep36 } from "path"; function commandListDisplay(commands) { switch (commands.length) { case 0: @@ -705961,7 +628527,7 @@ function commandListDisplayTruncated(commands) { function formatPathList(paths2) { if (paths2.length === 0) return ""; - const names = paths2.map((p) => basename55(p) || p); + const names = paths2.map((p) => basename53(p) || p); if (names.length === 1) { return /* @__PURE__ */ jsx_dev_runtime394.jsxDEV(ThemedText, { children: [ @@ -705969,7 +628535,7 @@ function formatPathList(paths2) { bold: true, children: names[0] }, undefined, false, undefined, this), - sep39 + sep36 ] }, undefined, true, undefined, this); } @@ -705980,13 +628546,13 @@ function formatPathList(paths2) { bold: true, children: names[0] }, undefined, false, undefined, this), - sep39, + sep36, " and ", /* @__PURE__ */ jsx_dev_runtime394.jsxDEV(ThemedText, { bold: true, children: names[1] }, undefined, false, undefined, this), - sep39 + sep36 ] }, undefined, true, undefined, this); } @@ -705996,13 +628562,13 @@ function formatPathList(paths2) { bold: true, children: names[0] }, undefined, false, undefined, this), - sep39, + sep36, ", ", /* @__PURE__ */ jsx_dev_runtime394.jsxDEV(ThemedText, { bold: true, children: names[1] }, undefined, false, undefined, this), - sep39, + sep36, " and ", paths2.length - 2, " more" @@ -706027,7 +628593,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf if (hasReadPaths && !hasDirectories && !hasCommands) { if (readPaths.length === 1) { const firstPath = readPaths[0]; - const dirName = basename55(firstPath) || firstPath; + const dirName = basename53(firstPath) || firstPath; return /* @__PURE__ */ jsx_dev_runtime394.jsxDEV(ThemedText, { children: [ "Yes, allow reading from ", @@ -706035,7 +628601,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf bold: true, children: dirName }, undefined, false, undefined, this), - sep39, + sep36, " from this project" ] }, undefined, true, undefined, this); @@ -706051,7 +628617,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf if (hasDirectories && !hasReadPaths && !hasCommands) { if (directories.length === 1) { const firstDir = directories[0]; - const dirName = basename55(firstDir) || firstDir; + const dirName = basename53(firstDir) || firstDir; return /* @__PURE__ */ jsx_dev_runtime394.jsxDEV(ThemedText, { children: [ "Yes, and always allow access to ", @@ -706059,7 +628625,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf bold: true, children: dirName }, undefined, false, undefined, this), - sep39, + sep36, " from this project" ] }, undefined, true, undefined, this); @@ -706235,13 +628801,13 @@ function ClassifierCheckingSubtitle() { let t1; if ($2[1] !== glimmerIndex) { t1 = /* @__PURE__ */ jsx_dev_runtime395.jsxDEV(ThemedText, { - children: t0.map((char, i4) => /* @__PURE__ */ jsx_dev_runtime395.jsxDEV(ShimmerChar, { + children: t0.map((char, i3) => /* @__PURE__ */ jsx_dev_runtime395.jsxDEV(ShimmerChar, { char, - index: i4, + index: i3, glimmerIndex, messageColor: "inactive", shimmerColor: "subtle" - }, i4, false, undefined, this)) + }, i3, false, undefined, this)) }, undefined, false, undefined, this); $2[1] = glimmerIndex; $2[2] = t1; @@ -706730,7 +629296,7 @@ var init_BashPermissionRequest = __esm(() => { init_PermissionRuleExplanation(); init_SedEditPermissionRequest(); init_useShellPermissionFeedback(); - init_utils13(); + init_utils12(); init_bashToolUseOptions(); jsx_dev_runtime395 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -707030,7 +629596,7 @@ function ExitPlanModePermissionRequest({ const planFilePath = isV2 ? getPlanFilePath() : undefined; const allowedPrompts = toolUseConfirm.input.allowedPrompts; const rawPlan = inputPlan ?? getPlan(); - const isEmpty3 = !rawPlan || rawPlan.trim() === ""; + const isEmpty2 = !rawPlan || rawPlan.trim() === ""; const [planStructureVariant] = import_react222.useState(() => getPewterLedgerVariant() ?? undefined); const [currentPlan, setCurrentPlan] = import_react222.useState(() => { if (inputPlan) @@ -707052,33 +629618,33 @@ function ExitPlanModePermissionRequest({ logEvent("tengu_plan_external_editor_used", {}); (async () => { if (isV2 && planFilePath) { - const result3 = await editFileInEditor(planFilePath); - if (result3.error) { + const result2 = await editFileInEditor(planFilePath); + if (result2.error) { addNotification({ key: "external-editor-error", - text: result3.error, + text: result2.error, color: "warning", priority: "high" }); } - if (result3.content !== null) { - if (result3.content !== currentPlan) + if (result2.content !== null) { + if (result2.content !== currentPlan) setPlanEditedLocally(true); - setCurrentPlan(result3.content); + setCurrentPlan(result2.content); setShowSaveMessage(true); } } else { - const result3 = await editPromptInEditor(currentPlan); - if (result3.error) { + const result2 = await editPromptInEditor(currentPlan); + if (result2.error) { addNotification({ key: "external-editor-error", - text: result3.error, + text: result2.error, color: "warning", priority: "high" }); } - if (result3.content !== null && result3.content !== currentPlan) { - setCurrentPlan(result3.content); + if (result2.content !== null && result2.content !== currentPlan) { + setCurrentPlan(result2.content); setShowSaveMessage(true); } } @@ -707302,7 +629868,7 @@ ${currentPlan}${verificationInstruction}${transcriptHint}${teamHint}${feedbackSu onReject(); toolUseConfirm.onReject(); }; - const useStickyFooter = !isEmpty3 && !!setStickyFooter; + const useStickyFooter = !isEmpty2 && !!setStickyFooter; import_react222.useLayoutEffect(() => { if (!useStickyFooter) return; @@ -707372,7 +629938,7 @@ ${currentPlan}${verificationInstruction}${transcriptHint}${teamHint}${feedbackSu }, undefined, true, undefined, this)); return () => setStickyFooter(null); }, [useStickyFooter, setStickyFooter, options2, pastedContents, editorName, isV2, planFilePath, showSaveMessage]); - if (isEmpty3) { + if (isEmpty2) { let handleEmptyPlanResponse = function(value) { if (value === "yes") { logEvent("tengu_plan_exit", { @@ -707506,7 +630072,7 @@ ${currentPlan}${verificationInstruction}${transcriptHint}${teamHint}${feedbackSu bold: true, children: "Requested permissions:" }, undefined, false, undefined, this), - allowedPrompts.map((p, i4) => /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedText, { + allowedPrompts.map((p, i3) => /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedText, { dimColor: true, children: [ " ", @@ -707518,7 +630084,7 @@ ${currentPlan}${verificationInstruction}${transcriptHint}${teamHint}${feedbackSu p.prompt, ")" ] - }, i4, true, undefined, this)) + }, i3, true, undefined, this)) ] }, undefined, true, undefined, this), !useStickyFooter && /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(jsx_dev_runtime397.Fragment, { @@ -707693,7 +630259,7 @@ var init_ExitPlanModePermissionRequest = __esm(() => { init_ide(); init_log3(); init_messageQueueManager(); - init_messages5(); + init_messages3(); init_model(); init_PermissionMode(); init_permissionSetup(); @@ -708198,9 +630764,9 @@ function FallbackPermissionRequest(t0) { } else { t7 = $2[15]; } - let result3; + let result2; if ($2[16] !== userFacingName8) { - result3 = [t7]; + result2 = [t7]; if (showAlwaysAllowOptions) { const t83 = /* @__PURE__ */ jsx_dev_runtime399.jsxDEV(ThemedText, { bold: true, @@ -708235,7 +630801,7 @@ function FallbackPermissionRequest(t0) { } else { t102 = $2[20]; } - result3.push(t102); + result2.push(t102); } let t82; if ($2[21] === Symbol.for("react.memo_cache_sentinel")) { @@ -708250,13 +630816,13 @@ function FallbackPermissionRequest(t0) { } else { t82 = $2[21]; } - result3.push(t82); + result2.push(t82); $2[16] = userFacingName8; - $2[17] = result3; + $2[17] = result2; } else { - result3 = $2[17]; + result2 = $2[17]; } - const options2 = result3; + const options2 = result2; let t8; if ($2[22] !== toolUseConfirm.tool.name) { t8 = sanitizeToolNameForAnalytics(toolUseConfirm.tool.name); @@ -708451,7 +631017,7 @@ function createSingleEditDiffConfig(filePath, oldString, newString, replaceAll) } // src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx -import { basename as basename56, relative as relative33 } from "path"; +import { basename as basename54, relative as relative31 } from "path"; function FileEditPermissionRequest(props) { const $2 = import_compiler_runtime307.c(51); const parseInput = _temp187; @@ -708488,13 +631054,13 @@ function FileEditPermissionRequest(props) { t7 = props.onReject; t8 = props.workerBadge; t9 = "Edit file"; - t10 = relative33(getCwd(), file_path); + t10 = relative31(getCwd(), file_path); T1 = ThemedText; t2 = "Do you want to make this edit to"; t3 = " "; T0 = ThemedText; t0 = true; - t1 = basename56(file_path); + t1 = basename54(file_path); $2[0] = props.onDone; $2[1] = props.onReject; $2[2] = props.toolUseConfirm; @@ -708630,8 +631196,8 @@ function FileEditPermissionRequest(props) { } return t16; } -function _temp187(input11) { - return FileEditTool.inputSchema.parse(input11); +function _temp187(input) { + return FileEditTool.inputSchema.parse(input); } var import_compiler_runtime307, jsx_dev_runtime400, ideDiffSupport; var init_FileEditPermissionRequest = __esm(() => { @@ -708643,18 +631209,18 @@ var init_FileEditPermissionRequest = __esm(() => { init_FilePermissionDialog(); jsx_dev_runtime400 = __toESM(require_jsx_dev_runtime(), 1); ideDiffSupport = { - getConfig: (input11) => createSingleEditDiffConfig(input11.file_path, input11.old_string, input11.new_string, input11.replace_all), - applyChanges: (input11, modifiedEdits) => { + getConfig: (input) => createSingleEditDiffConfig(input.file_path, input.old_string, input.new_string, input.replace_all), + applyChanges: (input, modifiedEdits) => { const firstEdit = modifiedEdits[0]; if (firstEdit) { return { - ...input11, + ...input, old_string: firstEdit.old_string, new_string: firstEdit.new_string, replace_all: firstEdit.replace_all }; } - return input11; + return input; } }; }); @@ -708690,7 +631256,7 @@ function FilesystemPermissionRequest(t0) { } else { t1 = $2[1]; } - const path27 = t1; + const path22 = t1; let t2; if ($2[2] !== toolUseConfirm.input || $2[3] !== toolUseConfirm.tool) { t2 = toolUseConfirm.tool.userFacingName(toolUseConfirm.input); @@ -708705,7 +631271,7 @@ function FilesystemPermissionRequest(t0) { const userFacingReadOrEdit = isReadOnly ? "Read" : "Edit"; const title = `${userFacingReadOrEdit} file`; const parseInput = _temp188; - if (!path27) { + if (!path22) { let t32; if ($2[5] !== onDone || $2[6] !== onReject || $2[7] !== toolUseConfirm || $2[8] !== toolUseContext || $2[9] !== verbose || $2[10] !== workerBadge) { t32 = /* @__PURE__ */ jsx_dev_runtime401.jsxDEV(FallbackPermissionRequest, { @@ -708766,7 +631332,7 @@ function FilesystemPermissionRequest(t0) { const content = t4; const t5 = isReadOnly ? "read" : "write"; let t6; - if ($2[20] !== content || $2[21] !== onDone || $2[22] !== onReject || $2[23] !== path27 || $2[24] !== t5 || $2[25] !== title || $2[26] !== toolUseConfirm || $2[27] !== toolUseContext || $2[28] !== workerBadge) { + if ($2[20] !== content || $2[21] !== onDone || $2[22] !== onReject || $2[23] !== path22 || $2[24] !== t5 || $2[25] !== title || $2[26] !== toolUseConfirm || $2[27] !== toolUseContext || $2[28] !== workerBadge) { t6 = /* @__PURE__ */ jsx_dev_runtime401.jsxDEV(FilePermissionDialog, { toolUseConfirm, toolUseContext, @@ -708775,7 +631341,7 @@ function FilesystemPermissionRequest(t0) { workerBadge, title, content, - path: path27, + path: path22, parseInput, operationType: t5, completionType: "tool_use_single" @@ -708783,7 +631349,7 @@ function FilesystemPermissionRequest(t0) { $2[20] = content; $2[21] = onDone; $2[22] = onReject; - $2[23] = path27; + $2[23] = path22; $2[24] = t5; $2[25] = title; $2[26] = toolUseConfirm; @@ -708795,8 +631361,8 @@ function FilesystemPermissionRequest(t0) { } return t6; } -function _temp188(input11) { - return input11; +function _temp188(input) { + return input; } var import_compiler_runtime308, jsx_dev_runtime401; var init_FilesystemPermissionRequest = __esm(() => { @@ -708900,14 +631466,14 @@ function FileWriteToolDiff(t0) { } return t4; } -function _temp189(i4) { +function _temp189(i3) { return /* @__PURE__ */ jsx_dev_runtime402.jsxDEV(NoSelect, { fromLeftEdge: true, children: /* @__PURE__ */ jsx_dev_runtime402.jsxDEV(ThemedText, { dimColor: true, children: "..." }, undefined, false, undefined, this) - }, `ellipsis-${i4}`, false, undefined, this); + }, `ellipsis-${i3}`, false, undefined, this); } var import_compiler_runtime309, jsx_dev_runtime402; var init_FileWriteToolDiff = __esm(() => { @@ -708921,7 +631487,7 @@ var init_FileWriteToolDiff = __esm(() => { }); // src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx -import { basename as basename57, relative as relative34 } from "path"; +import { basename as basename55, relative as relative32 } from "path"; function FileWritePermissionRequest(props) { const $2 = import_compiler_runtime310.c(30); const parseInput = _temp190; @@ -708980,7 +631546,7 @@ function FileWritePermissionRequest(props) { const t7 = fileExists ? "Overwrite file" : "Create file"; let t8; if ($2[5] !== file_path) { - t8 = relative34(getCwd(), file_path); + t8 = relative32(getCwd(), file_path); $2[5] = file_path; $2[6] = t8; } else { @@ -708988,7 +631554,7 @@ function FileWritePermissionRequest(props) { } let t9; if ($2[7] !== file_path) { - t9 = basename57(file_path); + t9 = basename55(file_path); $2[7] = file_path; $2[8] = t9; } else { @@ -709071,8 +631637,8 @@ function FileWritePermissionRequest(props) { } return t13; } -function _temp190(input11) { - return FileWriteTool.inputSchema.parse(input11); +function _temp190(input) { + return FileWriteTool.inputSchema.parse(input); } var import_compiler_runtime310, jsx_dev_runtime403, ideDiffSupport2; var init_FileWritePermissionRequest = __esm(() => { @@ -709086,32 +631652,32 @@ var init_FileWritePermissionRequest = __esm(() => { init_FileWriteToolDiff(); jsx_dev_runtime403 = __toESM(require_jsx_dev_runtime(), 1); ideDiffSupport2 = { - getConfig: (input11) => { + getConfig: (input) => { let oldContent; try { - oldContent = readFileSync4(input11.file_path); + oldContent = readFileSync4(input.file_path); } catch (e) { if (!isENOENT(e)) throw e; oldContent = ""; } - return createSingleEditDiffConfig(input11.file_path, oldContent, input11.content, false); + return createSingleEditDiffConfig(input.file_path, oldContent, input.content, false); }, - applyChanges: (input11, modifiedEdits) => { + applyChanges: (input, modifiedEdits) => { const firstEdit = modifiedEdits[0]; if (firstEdit) { return { - ...input11, + ...input, content: firstEdit.new_string }; } - return input11; + return input; } }; }); // src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx -import { relative as relative35 } from "path"; +import { relative as relative33 } from "path"; function NotebookEditToolDiff(props) { const $2 = import_compiler_runtime311.c(5); let t0; @@ -709254,7 +631820,7 @@ function NotebookEditToolDiffInner(t0) { } let t4; if ($2[11] !== notebook_path || $2[12] !== verbose) { - t4 = verbose ? notebook_path : relative35(getCwd(), notebook_path); + t4 = verbose ? notebook_path : relative33(getCwd(), notebook_path); $2[11] = notebook_path; $2[12] = verbose; $2[13] = t4; @@ -709368,14 +631934,14 @@ function NotebookEditToolDiffInner(t0) { } return t10; } -function _temp354(i4) { +function _temp354(i3) { return /* @__PURE__ */ jsx_dev_runtime404.jsxDEV(NoSelect, { fromLeftEdge: true, children: /* @__PURE__ */ jsx_dev_runtime404.jsxDEV(ThemedText, { dimColor: true, children: "..." }, undefined, false, undefined, this) - }, `ellipsis-${i4}`, false, undefined, this); + }, `ellipsis-${i3}`, false, undefined, this); } var import_compiler_runtime311, import_react224, jsx_dev_runtime404; var init_NotebookEditToolDiff = __esm(() => { @@ -709393,7 +631959,7 @@ var init_NotebookEditToolDiff = __esm(() => { }); // src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.tsx -import { basename as basename58 } from "path"; +import { basename as basename56 } from "path"; function NotebookEditPermissionRequest(props) { const $2 = import_compiler_runtime312.c(52); const parseInput = _temp192; @@ -709437,7 +632003,7 @@ function NotebookEditPermissionRequest(props) { t4 = " "; T0 = ThemedText; t0 = true; - t1 = basename58(notebook_path); + t1 = basename56(notebook_path); $2[0] = props.onDone; $2[1] = props.onReject; $2[2] = props.toolUseConfirm; @@ -709568,17 +632134,17 @@ function NotebookEditPermissionRequest(props) { } return t15; } -function _temp192(input11) { - const result3 = NotebookEditTool.inputSchema.safeParse(input11); - if (!result3.success) { - logError2(new Error(`Failed to parse notebook edit input: ${result3.error.message}`)); +function _temp192(input) { + const result2 = NotebookEditTool.inputSchema.safeParse(input); + if (!result2.success) { + logError2(new Error(`Failed to parse notebook edit input: ${result2.error.message}`)); return { notebook_path: "", new_source: "", cell_id: "" }; } - return result3.data; + return result2.data; } var import_compiler_runtime312, jsx_dev_runtime405; var init_NotebookEditPermissionRequest = __esm(() => { @@ -709684,8 +632250,8 @@ async function extractPrefixFromElement(cmd) { if (cmd.elementTypes?.[0] !== "StringConstant") { return null; } - for (let i4 = 0;i4 < cmd.args.length; i4++) { - const t = cmd.elementTypes[i4 + 1]; + for (let i3 = 0;i3 < cmd.args.length; i3++) { + const t = cmd.elementTypes[i3 + 1]; if (t !== "StringConstant" && t !== "Parameter") { return null; } @@ -709748,8 +632314,8 @@ async function getCompoundCommandPrefixesStatic2(command8, excludeSubcommand) { } const groups = new Map; for (const prefix of prefixes) { - const root3 = prefix.split(" ")[0]; - const key = root3.toLowerCase(); + const root2 = prefix.split(" ")[0]; + const key = root2.toLowerCase(); const group = groups.get(key); if (group) { group.push(prefix); @@ -709778,10 +632344,10 @@ function wordAlignedLCP(strings) { return strings[0]; const firstWords = strings[0].split(" "); let commonWordCount = firstWords.length; - for (let i4 = 1;i4 < strings.length; i4++) { - const words3 = strings[i4].split(" "); + for (let i3 = 1;i3 < strings.length; i3++) { + const words2 = strings[i3].split(" "); let matchCount = 0; - while (matchCount < commonWordCount && matchCount < words3.length && words3[matchCount].toLowerCase() === firstWords[matchCount].toLowerCase()) { + while (matchCount < commonWordCount && matchCount < words2.length && words2[matchCount].toLowerCase() === firstWords[matchCount].toLowerCase()) { matchCount++; } commonWordCount = matchCount; @@ -709795,7 +632361,7 @@ var init_staticPrefix = __esm(() => { init_specPrefix(); init_stringUtils(); init_dangerousCmdlets(); - init_parser6(); + init_parser5(); }); // src/components/permissions/PowerShellPermissionRequest/powershellToolUseOptions.tsx @@ -710135,7 +632701,7 @@ var init_PowerShellPermissionRequest = __esm(() => { init_PermissionExplanation(); init_PermissionRuleExplanation(); init_useShellPermissionFeedback(); - init_utils13(); + init_utils12(); init_powershellToolUseOptions(); jsx_dev_runtime406 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -710542,13 +633108,13 @@ function SkillPermissionRequest(props) { } return t19; } -function _temp193(input11) { - const result3 = SkillTool.inputSchema.safeParse(input11); - if (!result3.success) { - logError2(new Error(`Failed to parse skill tool input: ${result3.error.message}`)); +function _temp193(input) { + const result2 = SkillTool.inputSchema.safeParse(input); + if (!result2.success) { + logError2(new Error(`Failed to parse skill tool input: ${result2.error.message}`)); return ""; } - return result3.data.skill; + return result2.data.skill; } var import_compiler_runtime313, jsx_dev_runtime407; var init_SkillPermissionRequest = __esm(() => { @@ -710569,11 +633135,11 @@ var init_SkillPermissionRequest = __esm(() => { }); // src/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.tsx -function inputToPermissionRuleContent(input11) { +function inputToPermissionRuleContent(input) { try { - const parsedInput = WebFetchTool.inputSchema.safeParse(input11); + const parsedInput = WebFetchTool.inputSchema.safeParse(input); if (!parsedInput.success) { - return `input:${input11.toString()}`; + return `input:${input.toString()}`; } const { url: url3 @@ -710581,7 +633147,7 @@ function inputToPermissionRuleContent(input11) { const hostname6 = new URL(url3).hostname; return `domain:${hostname6}`; } catch { - return `input:${input11.toString()}`; + return `input:${input.toString()}`; } } function WebFetchPermissionRequest(t0) { @@ -710636,9 +633202,9 @@ function WebFetchPermissionRequest(t0) { } else { t4 = $2[4]; } - let result3; + let result2; if ($2[5] !== hostname6) { - result3 = [t4]; + result2 = [t4]; if (showAlwaysAllowOptions) { const t53 = /* @__PURE__ */ jsx_dev_runtime408.jsxDEV(ThemedText, { bold: true, @@ -710660,7 +633226,7 @@ function WebFetchPermissionRequest(t0) { } else { t62 = $2[8]; } - result3.push(t62); + result2.push(t62); } let t52; if ($2[9] === Symbol.for("react.memo_cache_sentinel")) { @@ -710680,13 +633246,13 @@ function WebFetchPermissionRequest(t0) { } else { t52 = $2[9]; } - result3.push(t52); + result2.push(t52); $2[5] = hostname6; - $2[6] = result3; + $2[6] = result2; } else { - result3 = $2[6]; + result2 = $2[6]; } - const options2 = result3; + const options2 = result2; let t5; if ($2[10] !== onDone || $2[11] !== onReject || $2[12] !== toolUseConfirm) { t5 = function onChange(newValue) { @@ -710868,7 +633434,7 @@ var init_WebFetchPermissionRequest = __esm(() => { init_hooks6(); init_PermissionDialog(); init_PermissionRuleExplanation(); - init_utils13(); + init_utils12(); jsx_dev_runtime408 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -710876,9 +633442,9 @@ var init_WebFetchPermissionRequest = __esm(() => { var exports_ReviewArtifactTool = {}; __export(exports_ReviewArtifactTool, { default: () => ReviewArtifactTool_default, - __stub__: () => __stub__29 + __stub__: () => __stub__36 }); -var ReviewArtifactTool_default, __stub__29 = true; +var ReviewArtifactTool_default, __stub__36 = true; var init_ReviewArtifactTool = __esm(() => { ReviewArtifactTool_default = {}; }); @@ -710887,9 +633453,9 @@ var init_ReviewArtifactTool = __esm(() => { var exports_ReviewArtifactPermissionRequest = {}; __export(exports_ReviewArtifactPermissionRequest, { default: () => ReviewArtifactPermissionRequest_default, - __stub__: () => __stub__30 + __stub__: () => __stub__37 }); -var ReviewArtifactPermissionRequest_default, __stub__30 = true; +var ReviewArtifactPermissionRequest_default, __stub__37 = true; var init_ReviewArtifactPermissionRequest = __esm(() => { ReviewArtifactPermissionRequest_default = {}; }); @@ -710909,9 +633475,9 @@ var init_WorkflowPermissionRequest = __esm(() => { var exports_MonitorPermissionRequest = {}; __export(exports_MonitorPermissionRequest, { default: () => MonitorPermissionRequest_default, - __stub__: () => __stub__31 + __stub__: () => __stub__38 }); -var MonitorPermissionRequest_default, __stub__31 = true; +var MonitorPermissionRequest_default, __stub__38 = true; var init_MonitorPermissionRequest = __esm(() => { MonitorPermissionRequest_default = {}; }); @@ -711089,15 +633655,15 @@ var init_PermissionRequest = __esm(() => { }); // src/utils/mcp/dateTimeParser.ts -async function parseNaturalLanguageDateTime(input11, format6, signal) { - const now3 = new Date; - const currentDateTime = now3.toISOString(); - const timezoneOffset = -now3.getTimezoneOffset(); +async function parseNaturalLanguageDateTime(input, format6, signal) { + const now2 = new Date; + const currentDateTime = now2.toISOString(); + const timezoneOffset = -now2.getTimezoneOffset(); const tzHours = Math.floor(Math.abs(timezoneOffset) / 60); const tzMinutes = Math.abs(timezoneOffset) % 60; const tzSign = timezoneOffset >= 0 ? "+" : "-"; const timezone = `${tzSign}${String(tzHours).padStart(2, "0")}:${String(tzMinutes).padStart(2, "0")}`; - const dayOfWeek = now3.toLocaleDateString("en-US", { weekday: "long" }); + const dayOfWeek = now2.toLocaleDateString("en-US", { weekday: "long" }); const systemPrompt = asSystemPrompt([ "You are a date/time parser that converts natural language into ISO 8601 format.", "You MUST respond with ONLY the ISO 8601 formatted string, with no explanation or additional text.", @@ -711114,13 +633680,13 @@ async function parseNaturalLanguageDateTime(input11, format6, signal) { - Local timezone: ${timezone} - Day of week: ${dayOfWeek} -User input: "${input11}" +User input: "${input}" Output format: ${formatDescription} Parse the user's input into ISO 8601 format. Return ONLY the formatted string, or "INVALID" if the input is incomplete or unparseable.`; try { - const result3 = await queryHaiku({ + const result2 = await queryHaiku({ systemPrompt, userPrompt, signal, @@ -711133,7 +633699,7 @@ Parse the user's input into ISO 8601 format. Return ONLY the formatted string, o enablePromptCaching: false } }); - const parsedText = extractTextContent(result3.message.content).trim(); + const parsedText = extractTextContent(result2.message.content).trim(); if (!parsedText || parsedText === "INVALID") { return { success: false, @@ -711147,21 +633713,21 @@ Parse the user's input into ISO 8601 format. Return ONLY the formatted string, o }; } return { success: true, value: parsedText }; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return { success: false, error: "Unable to parse date/time. Please enter in ISO 8601 format manually." }; } } -function looksLikeISO8601(input11) { - return /^\d{4}-\d{2}-\d{2}(T|$)/.test(input11.trim()); +function looksLikeISO8601(input) { + return /^\d{4}-\d{2}-\d{2}(T|$)/.test(input.trim()); } var init_dateTimeParser = __esm(() => { init_claude(); init_log3(); - init_messages5(); + init_messages3(); }); // src/utils/mcp/elicitationValidation.ts @@ -711214,11 +633780,11 @@ function getEnumLabel(schema, value) { } function getZodSchema(schema) { if (isEnumSchema(schema)) { - const [first, ...rest3] = getEnumValues3(schema); + const [first, ...rest2] = getEnumValues3(schema); if (!first) { return exports_external.never(); } - return exports_external.enum([first, ...rest3]); + return exports_external.enum([first, ...rest2]); } if (schema.type === "string") { let stringSchema = exports_external.string(); @@ -711259,8 +633825,8 @@ function getZodSchema(schema) { } if (schema.type === "number" || schema.type === "integer") { const typeLabel = schema.type === "integer" ? "an integer" : "a number"; - const isInteger3 = schema.type === "integer"; - const formatNum = (n3) => Number.isInteger(n3) && !isInteger3 ? `${n3}.0` : String(n3); + const isInteger2 = schema.type === "integer"; + const formatNum = (n3) => Number.isInteger(n3) && !isInteger2 ? `${n3}.0` : String(n3); const rangeMsg = schema.minimum !== undefined && schema.maximum !== undefined ? `Must be ${typeLabel} between ${formatNum(schema.minimum)} and ${formatNum(schema.maximum)}` : schema.minimum !== undefined ? `Must be ${typeLabel} >= ${formatNum(schema.minimum)}` : schema.maximum !== undefined ? `Must be ${typeLabel} <= ${formatNum(schema.maximum)}` : `Must be ${typeLabel}`; let numberSchema = exports_external.coerce.number({ error: rangeMsg @@ -711550,9 +634116,9 @@ function ElicitationFormDialog({ const field = schemaFields[fieldIndex]; if (field && isTextField(field.schema) && !isEnumSchema(field.schema)) { const val_0 = formValues[field.name]; - const text2 = val_0 !== undefined ? String(val_0) : ""; - setTextInputValue(text2); - setTextInputCursorOffset(text2.length); + const text = val_0 !== undefined ? String(val_0) : ""; + setTextInputValue(text); + setTextInputCursorOffset(text.length); } }, [schemaFields, formValues]); function validateMultiSelect(fieldName, schema_0) { @@ -711560,12 +634126,12 @@ function ElicitationFormDialog({ return; const selected = formValues[fieldName] ?? []; const fieldRequired = schemaFields.find((f) => f.name === fieldName)?.isRequired ?? false; - const min3 = schema_0.minItems; - const max5 = schema_0.maxItems; - if (min3 !== undefined && selected.length < min3 && (selected.length > 0 || fieldRequired)) { - updateValidationError(fieldName, `Select at least ${min3} ${plural(min3, "item")}`); - } else if (max5 !== undefined && selected.length > max5) { - updateValidationError(fieldName, `Select at most ${max5} ${plural(max5, "item")}`); + const min2 = schema_0.minItems; + const max3 = schema_0.maxItems; + if (min2 !== undefined && selected.length < min2 && (selected.length > 0 || fieldRequired)) { + updateValidationError(fieldName, `Select at least ${min2} ${plural(min2, "item")}`); + } else if (max3 !== undefined && selected.length > max3) { + updateValidationError(fieldName, `Select at most ${max3} ${plural(max3, "item")}`); } else { updateValidationError(fieldName); } @@ -711616,13 +634182,13 @@ function ElicitationFormDialog({ updateValidationError(fieldName_0); } } - function updateValidationError(fieldName_1, error46) { + function updateValidationError(fieldName_1, error42) { setValidationErrors((prev_0) => { const next_0 = { ...prev_0 }; - if (error46) { - next_0[fieldName_1] = error46; + if (error42) { + next_0[fieldName_1] = error42; } else { delete next_0[fieldName_1]; } @@ -711663,7 +634229,7 @@ function ElicitationFormDialog({ const controller_0 = new AbortController; resolveAbortRef.current.set(fieldName_4, controller_0); setResolvingFields((prev_1) => new Set(prev_1).add(fieldName_4)); - validateElicitationInputAsync(rawValue, schema_2, controller_0.signal).then((result3) => { + validateElicitationInputAsync(rawValue, schema_2, controller_0.signal).then((result2) => { resolveAbortRef.current.delete(fieldName_4); setResolvingFields((prev_2) => { const next_1 = new Set(prev_2); @@ -711672,10 +634238,10 @@ function ElicitationFormDialog({ }); if (controller_0.signal.aborted) return; - if (result3.isValid) { - setField(fieldName_4, result3.value); + if (result2.isValid) { + setField(fieldName_4, result2.value); updateValidationError(fieldName_4); - const isoText = String(result3.value); + const isoText = String(result2.value); setTextInputValue((prev_3) => { if (prev_3 === rawValue) { setTextInputCursorOffset(isoText.length); @@ -711684,7 +634250,7 @@ function ElicitationFormDialog({ return prev_3; }); } else { - updateValidationError(fieldName_4, result3.error); + updateValidationError(fieldName_4, result2.error); } }, () => { resolveAbortRef.current.delete(fieldName_4); @@ -711908,7 +634474,7 @@ function ElicitationFormDialog({ return; } if (_input && !key.return) { - runTypeahead(_input, ["yes", "no"], (i4) => setField(name_0, i4 === 0)); + runTypeahead(_input, ["yes", "no"], (i3) => setField(name_0, i3 === 0)); return; } return; @@ -712794,8 +635360,8 @@ function useIdeAtMentioned(mcpClients, onAtMentioned) { lineStart, lineEnd }); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } }); } @@ -713304,11 +635870,11 @@ var init_sprites = __esm(() => { }); // src/buddy/CompanionSprite.tsx -function wrap3(text2, width) { - const words3 = text2.split(" "); +function wrap2(text, width) { + const words2 = text.split(" "); const lines = []; let cur = ""; - for (const w of words3) { + for (const w of words2) { if (cur.length + w.length + 1 > width && cur) { lines.push(cur); cur = w; @@ -713323,10 +635889,10 @@ function wrap3(text2, width) { function SpeechBubble(t0) { const $2 = import_compiler_runtime318.c(31); const { - text: text2, + text, color: color3, fading, - tail: tail3 + tail: tail2 } = t0; let T0; let borderColor; @@ -713336,8 +635902,8 @@ function SpeechBubble(t0) { let t4; let t5; let t6; - if ($2[0] !== color3 || $2[1] !== fading || $2[2] !== text2) { - const lines = wrap3(text2, 30); + if ($2[0] !== color3 || $2[1] !== fading || $2[2] !== text) { + const lines = wrap2(text, 30); borderColor = fading ? "inactive" : color3; T0 = ThemedBox_default; t1 = "column"; @@ -713347,12 +635913,12 @@ function SpeechBubble(t0) { t5 = 34; let t72; if ($2[11] !== fading) { - t72 = (l, i4) => /* @__PURE__ */ jsx_dev_runtime412.jsxDEV(ThemedText, { + t72 = (l, i3) => /* @__PURE__ */ jsx_dev_runtime412.jsxDEV(ThemedText, { italic: true, dimColor: !fading, color: fading ? "inactive" : undefined, children: l - }, i4, false, undefined, this); + }, i3, false, undefined, this); $2[11] = fading; $2[12] = t72; } else { @@ -713361,7 +635927,7 @@ function SpeechBubble(t0) { t6 = lines.map(t72); $2[0] = color3; $2[1] = fading; - $2[2] = text2; + $2[2] = text; $2[3] = T0; $2[4] = borderColor; $2[5] = t1; @@ -713402,7 +635968,7 @@ function SpeechBubble(t0) { t7 = $2[20]; } const bubble = t7; - if (tail3 === "right") { + if (tail2 === "right") { let t82; if ($2[21] !== borderColor) { t82 = /* @__PURE__ */ jsx_dev_runtime412.jsxDEV(ThemedText, { @@ -713592,10 +636158,10 @@ function CompanionSprite() { alignItems: "center", width: colWidth, children: [ - sprite.map((line, i4) => /* @__PURE__ */ jsx_dev_runtime412.jsxDEV(ThemedText, { - color: i4 === 0 && heartFrame ? "autoAccept" : color3, + sprite.map((line, i3) => /* @__PURE__ */ jsx_dev_runtime412.jsxDEV(ThemedText, { + color: i3 === 0 && heartFrame ? "autoAccept" : color3, children: line - }, i4, false, undefined, this)), + }, i3, false, undefined, this)), /* @__PURE__ */ jsx_dev_runtime412.jsxDEV(ThemedText, { italic: true, bold: focused, @@ -713702,8 +636268,8 @@ function CompanionFloatingBubble() { } return t5; } -function _temp355(set6) { - return set6(_temp282); +function _temp355(set5) { + return set5(_temp282); } function _temp282(s_0) { return { @@ -713745,25 +636311,25 @@ function isBuddyTeaserWindow() { function RainbowText2(t0) { const $2 = import_compiler_runtime319.c(2); const { - text: text2 + text } = t0; let t1; - if ($2[0] !== text2) { + if ($2[0] !== text) { t1 = /* @__PURE__ */ jsx_dev_runtime413.jsxDEV(jsx_dev_runtime413.Fragment, { - children: [...text2].map(_temp196) + children: [...text].map(_temp196) }, undefined, false, undefined, this); - $2[0] = text2; + $2[0] = text; $2[1] = t1; } else { t1 = $2[1]; } return t1; } -function _temp196(ch2, i4) { +function _temp196(ch2, i3) { return /* @__PURE__ */ jsx_dev_runtime413.jsxDEV(ThemedText, { - color: getRainbowColor(i4), + color: getRainbowColor(i3), children: ch2 - }, i4, false, undefined, this); + }, i3, false, undefined, this); } function useBuddyNotification() { const $2 = import_compiler_runtime319.c(4); @@ -713778,8 +636344,8 @@ function useBuddyNotification() { if (!feature("BUDDY")) { return; } - const config6 = getGlobalConfig(); - if (config6.companion || !isBuddyTeaserWindow()) { + const config4 = getGlobalConfig(); + if (config4.companion || !isBuddyTeaserWindow()) { return; } addNotification({ @@ -713803,13 +636369,13 @@ function useBuddyNotification() { } import_react230.useEffect(t0, t1); } -function findBuddyTriggerPositions(text2) { +function findBuddyTriggerPositions(text) { if (!feature("BUDDY")) return []; const triggers = []; const re = /\/buddy\b/g; let m; - while ((m = re.exec(text2)) !== null) { + while ((m = re.exec(text)) !== null) { triggers.push({ start: m.index, end: m.index + m[0].length @@ -713832,12 +636398,12 @@ var init_useBuddyNotification = __esm(() => { // src/hooks/useIdeConnectionStatus.ts function useIdeConnectionStatus(mcpClients) { return import_react231.useMemo(() => { - const ideClient = mcpClients?.find((client5) => client5.name === "ide"); + const ideClient = mcpClients?.find((client2) => client2.name === "ide"); if (!ideClient) { return { status: null, ideName: null }; } - const config6 = ideClient.config; - const ideName = config6.type === "sse-ide" || config6.type === "ws-ide" ? config6.ideName : null; + const config4 = ideClient.config; + const ideName = config4.type === "sse-ide" || config4.type === "ws-ide" ? config4.ideName : null; if (ideClient.type === "connected") { return { status: "connected", ideName }; } @@ -713934,8 +636500,8 @@ function AutoUpdater({ if (!isDisabled && currentVersion && latestVersion && !gte2(currentVersion, latestVersion) && !shouldSkipVersion(latestVersion)) { const startTime = Date.now(); onChangeIsUpdating(true); - const config6 = getGlobalConfig(); - if (config6.installMethod !== "native") { + const config4 = getGlobalConfig(); + if (config4.installMethod !== "native") { await removeInstalledSymlink(); } const installationType = await getCurrentInstallationType(); @@ -713961,7 +636527,7 @@ function AutoUpdater({ return; } else { logForDebugging(`AutoUpdater: Unknown installation type, falling back to config`); - const isMigrated = config6.installMethod === "local"; + const isMigrated = config4.installMethod === "local"; updateMethod = isMigrated ? "local" : "global"; if (isMigrated) { installStatus = await installOrUpdateClaudePackage(channel); @@ -714127,10 +636693,10 @@ function NativeAutoUpdater({ const msg = await getMaxVersionMessage(); setMaxVersionIssue(msg ?? "affects your version"); } - const result3 = await installLatest(channel); + const result2 = await installLatest(channel); const currentVersion = "2.1.88-custom"; const latencyMs = Date.now() - startTime; - if (result3.lockFailed) { + if (result2.lockFailed) { logEvent("tengu_native_auto_updater_lock_contention", { latency_ms: latencyMs }); @@ -714138,14 +636704,14 @@ function NativeAutoUpdater({ } setVersions({ current: currentVersion, - latest: result3.latestVersion + latest: result2.latestVersion }); - if (result3.wasUpdated) { + if (result2.wasUpdated) { logEvent("tengu_native_auto_updater_success", { latency_ms: latencyMs }); onAutoUpdaterResult({ - version: result3.latestVersion, + version: result2.latestVersion, status: "success" }); } else { @@ -714153,10 +636719,10 @@ function NativeAutoUpdater({ latency_ms: latencyMs }); } - } catch (error46) { + } catch (error42) { const latencyMs = Date.now() - startTime; - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); - logError2(error46); + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); + logError2(error42); const errorType = getErrorType(errorMessage3); logEvent("tengu_native_auto_updater_fail", { latency_ms: latencyMs, @@ -714468,7 +637034,7 @@ var init_AutoUpdaterWrapper = __esm(() => { }); // src/components/IdeStatusIndicator.tsx -import { basename as basename59 } from "path"; +import { basename as basename57 } from "path"; function IdeStatusIndicator(t0) { const $2 = import_compiler_runtime322.c(7); const { @@ -714508,7 +637074,7 @@ function IdeStatusIndicator(t0) { if (ideSelection.filePath) { let t1; if ($2[3] !== ideSelection.filePath) { - t1 = basename59(ideSelection.filePath); + t1 = basename57(ideSelection.filePath); $2[3] = ideSelection.filePath; $2[4] = t1; } else { @@ -715025,7 +637591,7 @@ var init_VoiceIndicator = __esm(() => { init_bun_bundle(); init_useSettings(); init_ink2(); - init_utils6(); + init_utils5(); jsx_dev_runtime422 = __toESM(require_jsx_dev_runtime(), 1); PROCESSING_DIM = { r: 153, @@ -715092,13 +637658,13 @@ function Notifications(t0) { let t6; if ($2[5] !== addNotification) { t5 = () => { - setEnvHookNotifier((text2, isError3) => { + setEnvHookNotifier((text, isError2) => { addNotification({ key: "env-hook", - text: text2, - color: isError3 ? "error" : undefined, - priority: isError3 ? "medium" : "low", - timeoutMs: isError3 ? 8000 : 5000 + text, + color: isError2 ? "error" : undefined, + priority: isError2 ? "medium" : "low", + timeoutMs: isError2 ? 8000 : 5000 }); }); return _temp283; @@ -715378,13 +637944,13 @@ var init_Notifications = __esm(() => { init_ink2(); init_claudeAiLimitsHook(); init_autoCompact(); - init_auth2(); + init_auth(); init_editor(); init_envUtils(); init_format(); init_fileChangedWatcher(); init_ide(); - init_messages5(); + init_messages3(); init_tokens(); init_AutoUpdaterWrapper(); init_ConfigurableShortcutHint(); @@ -715455,12 +638021,12 @@ function useArrowKeyHistory(onSetInput, currentInput, pastedContents, setCursorO onSetInput(value, mode, contents); setCursorOffset?.(cursorToStart ? 0 : value.length); }, [onSetInput, setCursorOffset]); - const updateInput = import_react242.useCallback((input11, cursorToStart_0 = false) => { - if (!input11 || !input11.display) + const updateInput = import_react242.useCallback((input, cursorToStart_0 = false) => { + if (!input || !input.display) return; - const mode_0 = getModeFromInput(input11.display); - const value_0 = mode_0 === "bash" ? input11.display.slice(1) : input11.display; - setInputWithCursor(value_0, mode_0, input11.pastedContents ?? {}, cursorToStart_0); + const mode_0 = getModeFromInput(input.display); + const value_0 = mode_0 === "bash" ? input.display.slice(1) : input.display; + setInputWithCursor(value_0, mode_0, input.pastedContents ?? {}, cursorToStart_0); }, [setInputWithCursor]); const showSearchHint = import_react242.useCallback(() => { addNotification({ @@ -715592,7 +638158,7 @@ function useHistorySearch(onAcceptHistory, currentInput, onInputChange, onCursor historyReader.current = undefined; } }, []); - const reset4 = import_react243.useCallback(() => { + const reset3 = import_react243.useCallback(() => { setIsSearching(false); setHistoryQuery(""); setHistoryFailedMatch(false); @@ -715693,20 +638259,20 @@ function useHistorySearch(onAcceptHistory, currentInput, onInputChange, onCursor } else { setPastedContents(originalPastedContents); } - reset4(); + reset3(); }, [ historyMatch, onInputChange, onModeChange, setPastedContents, originalPastedContents, - reset4 + reset3 ]); const handleCancel = import_react243.useCallback(() => { onInputChange(originalInput); onCursorChange(originalCursorOffset); setPastedContents(originalPastedContents); - reset4(); + reset3(); }, [ onInputChange, onCursorChange, @@ -715714,7 +638280,7 @@ function useHistorySearch(onAcceptHistory, currentInput, onInputChange, onCursor originalInput, originalCursorOffset, originalPastedContents, - reset4 + reset3 ]); const handleExecute = import_react243.useCallback(() => { if (historyQuery.length === 0) { @@ -715731,7 +638297,7 @@ function useHistorySearch(onAcceptHistory, currentInput, onInputChange, onCursor pastedContents: historyMatch.pastedContents }); } - reset4(); + reset3(); }, [ historyQuery, historyMatch, @@ -715739,7 +638305,7 @@ function useHistorySearch(onAcceptHistory, currentInput, onInputChange, onCursor onModeChange, originalInput, originalPastedContents, - reset4 + reset3 ]); useKeybinding("history:search", handleStartSearch, { context: "Global", @@ -715804,26 +638370,26 @@ function useInputBuffer({ const [currentIndex, setCurrentIndex] = import_react244.useState(-1); const lastPushTime = import_react244.useRef(0); const pendingPush = import_react244.useRef(null); - const pushToBuffer = import_react244.useCallback((text2, cursorOffset, pastedContents = {}) => { - const now3 = Date.now(); + const pushToBuffer = import_react244.useCallback((text, cursorOffset, pastedContents = {}) => { + const now2 = Date.now(); if (pendingPush.current) { clearTimeout(pendingPush.current); pendingPush.current = null; } - if (now3 - lastPushTime.current < debounceMs) { - pendingPush.current = setTimeout(pushToBuffer, debounceMs, text2, cursorOffset, pastedContents); + if (now2 - lastPushTime.current < debounceMs) { + pendingPush.current = setTimeout(pushToBuffer, debounceMs, text, cursorOffset, pastedContents); return; } - lastPushTime.current = now3; + lastPushTime.current = now2; setBuffer((prevBuffer) => { const newBuffer = currentIndex >= 0 ? prevBuffer.slice(0, currentIndex + 1) : prevBuffer; const lastEntry = newBuffer[newBuffer.length - 1]; - if (lastEntry && lastEntry.text === text2) { + if (lastEntry && lastEntry.text === text) { return newBuffer; } const updatedBuffer = [ ...newBuffer, - { text: text2, cursorOffset, pastedContents, timestamp: now3 } + { text, cursorOffset, pastedContents, timestamp: now2 } ]; if (updatedBuffer.length > maxBufferSize) { return updatedBuffer.slice(-maxBufferSize); @@ -716010,8 +638576,8 @@ function getCompletionTypeFromPrefix(prefix) { return "command"; } function findLastStringToken(tokens) { - const i4 = tokens.findLastIndex((t) => typeof t === "string"); - return i4 !== -1 ? { token: tokens[i4], index: i4 } : null; + const i3 = tokens.findLastIndex((t) => typeof t === "string"); + return i3 !== -1 ? { token: tokens[i3], index: i3 } : null; } function isNewCommandContext(tokens, currentTokenIndex) { if (currentTokenIndex === 0) { @@ -716020,8 +638586,8 @@ function isNewCommandContext(tokens, currentTokenIndex) { const prevToken = tokens[currentTokenIndex - 1]; return prevToken !== undefined && isCommandOperator(prevToken); } -function parseInputContext(input11, cursorOffset) { - const beforeCursor = input11.slice(0, cursorOffset); +function parseInputContext(input, cursorOffset) { + const beforeCursor = input.slice(0, cursorOffset); const varMatch = beforeCursor.match(/\$[a-zA-Z_][a-zA-Z0-9_]*$/); if (varMatch) { return { prefix: varMatch[0], completionType: "variable" }; @@ -716082,22 +638648,22 @@ async function getCompletionsForShell(shellType, prefix, completionType, abortSi const shellCommand = await exec2(command8, abortSignal, "bash", { timeout: SHELL_COMPLETION_TIMEOUT_MS }); - const result3 = await shellCommand.result; - return result3.stdout.split(` -`).filter((line) => line.trim()).slice(0, MAX_SHELL_COMPLETIONS).map((text2) => ({ - id: text2, - displayText: text2, + const result2 = await shellCommand.result; + return result2.stdout.split(` +`).filter((line) => line.trim()).slice(0, MAX_SHELL_COMPLETIONS).map((text) => ({ + id: text, + displayText: text, description: undefined, metadata: { completionType } })); } -async function getShellCompletions(input11, cursorOffset, abortSignal) { +async function getShellCompletions(input, cursorOffset, abortSignal) { const shellType = getShellType(); if (shellType !== "bash" && shellType !== "zsh") { return []; } try { - const { prefix, completionType } = parseInputContext(input11, cursorOffset); + const { prefix, completionType } = parseInputContext(input, cursorOffset); if (!prefix) { return []; } @@ -716106,11 +638672,11 @@ async function getShellCompletions(input11, cursorOffset, abortSignal) { ...suggestion, metadata: { ...suggestion.metadata, - inputSnapshot: input11 + inputSnapshot: input } })); - } catch (error46) { - logForDebugging(`Shell completion failed: ${error46}`); + } catch (error42) { + logForDebugging(`Shell completion failed: ${error42}`); return []; } } @@ -716124,33 +638690,33 @@ var init_shellCompletion = __esm(() => { }); // node_modules/fuse.js/dist/fuse.mjs -function isArray9(value) { - return !Array.isArray ? getTag3(value) === "[object Array]" : Array.isArray(value); +function isArray4(value) { + return !Array.isArray ? getTag2(value) === "[object Array]" : Array.isArray(value); } -function baseToString3(value) { +function baseToString2(value) { if (typeof value == "string") { return value; } - let result3 = value + ""; - return result3 == "0" && 1 / value == -INFINITY13 ? "-0" : result3; + let result2 = value + ""; + return result2 == "0" && 1 / value == -INFINITY7 ? "-0" : result2; } -function toString8(value) { - return value == null ? "" : baseToString3(value); +function toString7(value) { + return value == null ? "" : baseToString2(value); } -function isString4(value) { +function isString3(value) { return typeof value === "string"; } -function isNumber4(value) { +function isNumber3(value) { return typeof value === "number"; } -function isBoolean4(value) { - return value === true || value === false || isObjectLike3(value) && getTag3(value) == "[object Boolean]"; +function isBoolean3(value) { + return value === true || value === false || isObjectLike2(value) && getTag2(value) == "[object Boolean]"; } -function isObject7(value) { +function isObject6(value) { return typeof value === "object"; } -function isObjectLike3(value) { - return isObject7(value) && value !== null; +function isObjectLike2(value) { + return isObject6(value) && value !== null; } function isDefined2(value) { return value !== undefined && value !== null; @@ -716158,16 +638724,16 @@ function isDefined2(value) { function isBlank(value) { return !value.trim().length; } -function getTag3(value) { +function getTag2(value) { return value == null ? value === undefined ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value); } class KeyStore { - constructor(keys3) { + constructor(keys2) { this._keys = []; this._keyMap = {}; let totalWeight = 0; - keys3.forEach((key) => { + keys2.forEach((key) => { let obj = createKey(key); this._keys.push(obj); this._keyMap[obj.id] = obj; @@ -716188,67 +638754,67 @@ class KeyStore { } } function createKey(key) { - let path27 = null; + let path22 = null; let id = null; let src = null; let weight = 1; let getFn = null; - if (isString4(key) || isArray9(key)) { + if (isString3(key) || isArray4(key)) { src = key; - path27 = createKeyPath(key); + path22 = createKeyPath(key); id = createKeyId(key); } else { - if (!hasOwn5.call(key, "name")) { + if (!hasOwn2.call(key, "name")) { throw new Error(MISSING_KEY_PROPERTY("name")); } const name = key.name; src = name; - if (hasOwn5.call(key, "weight")) { + if (hasOwn2.call(key, "weight")) { weight = key.weight; if (weight <= 0) { throw new Error(INVALID_KEY_WEIGHT_VALUE(name)); } } - path27 = createKeyPath(name); + path22 = createKeyPath(name); id = createKeyId(name); getFn = key.getFn; } - return { path: path27, id, weight, src, getFn }; + return { path: path22, id, weight, src, getFn }; } function createKeyPath(key) { - return isArray9(key) ? key : key.split("."); + return isArray4(key) ? key : key.split("."); } function createKeyId(key) { - return isArray9(key) ? key.join(".") : key; + return isArray4(key) ? key.join(".") : key; } -function get3(obj, path27) { +function get2(obj, path22) { let list2 = []; let arr = false; - const deepGet = (obj2, path28, index) => { + const deepGet = (obj2, path23, index) => { if (!isDefined2(obj2)) { return; } - if (!path28[index]) { + if (!path23[index]) { list2.push(obj2); } else { - let key = path28[index]; + let key = path23[index]; const value = obj2[key]; if (!isDefined2(value)) { return; } - if (index === path28.length - 1 && (isString4(value) || isNumber4(value) || isBoolean4(value))) { - list2.push(toString8(value)); - } else if (isArray9(value)) { + if (index === path23.length - 1 && (isString3(value) || isNumber3(value) || isBoolean3(value))) { + list2.push(toString7(value)); + } else if (isArray4(value)) { arr = true; - for (let i4 = 0, len = value.length;i4 < len; i4 += 1) { - deepGet(value[i4], path28, index + 1); + for (let i3 = 0, len = value.length;i3 < len; i3 += 1) { + deepGet(value[i3], path23, index + 1); } - } else if (path28.length) { - deepGet(value, path28, index + 1); + } else if (path23.length) { + deepGet(value, path23, index + 1); } } }; - deepGet(obj, isString4(path27) ? path27.split(".") : path27, 0); + deepGet(obj, isString3(path22) ? path22.split(".") : path22, 0); return arr ? list2 : list2[0]; } function norm(weight = 1, mantissa = 3) { @@ -716287,10 +638853,10 @@ class FuseIndex { setIndexRecords(records = []) { this.records = records; } - setKeys(keys3 = []) { - this.keys = keys3; + setKeys(keys2 = []) { + this.keys = keys2; this._keysMap = {}; - keys3.forEach((key, idx) => { + keys2.forEach((key, idx) => { this._keysMap[key.id] = idx; }); } @@ -716299,7 +638865,7 @@ class FuseIndex { return; } this.isCreated = true; - if (isString4(this.docs[0])) { + if (isString3(this.docs[0])) { this.docs.forEach((doc3, docIndex) => { this._addString(doc3, docIndex); }); @@ -716312,7 +638878,7 @@ class FuseIndex { } add(doc3) { const idx = this.size(); - if (isString4(doc3)) { + if (isString3(doc3)) { this._addString(doc3, idx); } else { this._addObject(doc3, idx); @@ -716320,8 +638886,8 @@ class FuseIndex { } removeAt(idx) { this.records.splice(idx, 1); - for (let i4 = idx, len = this.size();i4 < len; i4 += 1) { - this.records[i4].i -= 1; + for (let i3 = idx, len = this.size();i3 < len; i3 += 1) { + this.records[i3].i -= 1; } } getValueForItemAtKeyId(item, keyId) { @@ -716348,7 +638914,7 @@ class FuseIndex { if (!isDefined2(value)) { return; } - if (isArray9(value)) { + if (isArray4(value)) { let subRecords = []; const stack = [{ nestedArrIndex: -1, value }]; while (stack.length) { @@ -716356,14 +638922,14 @@ class FuseIndex { if (!isDefined2(value2)) { continue; } - if (isString4(value2) && !isBlank(value2)) { + if (isString3(value2) && !isBlank(value2)) { let subRecord = { v: value2, i: nestedArrIndex, n: this.norm.get(value2) }; subRecords.push(subRecord); - } else if (isArray9(value2)) { + } else if (isArray4(value2)) { value2.forEach((item, k) => { stack.push({ nestedArrIndex: k, @@ -716374,7 +638940,7 @@ class FuseIndex { ; } record5.$[keyIndex] = subRecords; - } else if (isString4(value) && !isBlank(value)) { + } else if (isString3(value) && !isBlank(value)) { let subRecord = { v: value, n: this.norm.get(value) @@ -716391,17 +638957,17 @@ class FuseIndex { }; } } -function createIndex(keys3, docs, { getFn = Config2.getFn, fieldNormWeight = Config2.fieldNormWeight } = {}) { +function createIndex(keys2, docs, { getFn = Config2.getFn, fieldNormWeight = Config2.fieldNormWeight } = {}) { const myIndex = new FuseIndex({ getFn, fieldNormWeight }); - myIndex.setKeys(keys3.map(createKey)); + myIndex.setKeys(keys2.map(createKey)); myIndex.setSources(docs); myIndex.create(); return myIndex; } function parseIndex(data, { getFn = Config2.getFn, fieldNormWeight = Config2.fieldNormWeight } = {}) { - const { keys: keys3, records } = data; + const { keys: keys2, records } = data; const myIndex = new FuseIndex({ getFn, fieldNormWeight }); - myIndex.setKeys(keys3); + myIndex.setKeys(keys2); myIndex.setIndexRecords(records); return myIndex; } @@ -716426,25 +638992,25 @@ function convertMaskToIndices(matchmask = [], minMatchCharLength = Config2.minMa let indices = []; let start = -1; let end = -1; - let i4 = 0; - for (let len = matchmask.length;i4 < len; i4 += 1) { - let match = matchmask[i4]; + let i3 = 0; + for (let len = matchmask.length;i3 < len; i3 += 1) { + let match = matchmask[i3]; if (match && start === -1) { - start = i4; + start = i3; } else if (!match && start !== -1) { - end = i4 - 1; + end = i3 - 1; if (end - start + 1 >= minMatchCharLength) { indices.push([start, end]); } start = -1; } } - if (matchmask[i4 - 1] && i4 - start >= minMatchCharLength) { - indices.push([start, i4 - 1]); + if (matchmask[i3 - 1] && i3 - start >= minMatchCharLength) { + indices.push([start, i3 - 1]); } return indices; } -function search(text2, pattern, patternAlphabet, { +function search(text, pattern, patternAlphabet, { location = Config2.location, distance = Config2.distance, threshold = Config2.threshold, @@ -716457,14 +639023,14 @@ function search(text2, pattern, patternAlphabet, { throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS)); } const patternLen = pattern.length; - const textLen = text2.length; + const textLen = text.length; const expectedLocation = Math.max(0, Math.min(location, textLen)); let currentThreshold = threshold; let bestLocation = expectedLocation; const computeMatches = minMatchCharLength > 1 || includeMatches; const matchMask = computeMatches ? Array(textLen) : []; let index; - while ((index = text2.indexOf(pattern, bestLocation)) > -1) { + while ((index = text.indexOf(pattern, bestLocation)) > -1) { let score = computeScore$1(pattern, { currentLocation: index, expectedLocation, @@ -716474,10 +639040,10 @@ function search(text2, pattern, patternAlphabet, { currentThreshold = Math.min(score, currentThreshold); bestLocation = index + patternLen; if (computeMatches) { - let i4 = 0; - while (i4 < patternLen) { - matchMask[index + i4] = 1; - i4 += 1; + let i3 = 0; + while (i3 < patternLen) { + matchMask[index + i3] = 1; + i3 += 1; } } } @@ -716486,12 +639052,12 @@ function search(text2, pattern, patternAlphabet, { let finalScore = 1; let binMax = patternLen + textLen; const mask = 1 << patternLen - 1; - for (let i4 = 0;i4 < patternLen; i4 += 1) { + for (let i3 = 0;i3 < patternLen; i3 += 1) { let binMin = 0; let binMid = binMax; while (binMin < binMid) { const score2 = computeScore$1(pattern, { - errors: i4, + errors: i3, currentLocation: expectedLocation + binMid, expectedLocation, distance, @@ -716508,20 +639074,20 @@ function search(text2, pattern, patternAlphabet, { let start = Math.max(1, expectedLocation - binMid + 1); let finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen; let bitArr = Array(finish + 2); - bitArr[finish + 1] = (1 << i4) - 1; + bitArr[finish + 1] = (1 << i3) - 1; for (let j = finish;j >= start; j -= 1) { let currentLocation = j - 1; - let charMatch = patternAlphabet[text2.charAt(currentLocation)]; + let charMatch = patternAlphabet[text.charAt(currentLocation)]; if (computeMatches) { matchMask[currentLocation] = +!!charMatch; } bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch; - if (i4) { + if (i3) { bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1]; } if (bitArr[j] & mask) { finalScore = computeScore$1(pattern, { - errors: i4, + errors: i3, currentLocation, expectedLocation, distance, @@ -716538,7 +639104,7 @@ function search(text2, pattern, patternAlphabet, { } } const score = computeScore$1(pattern, { - errors: i4 + 1, + errors: i3 + 1, currentLocation: expectedLocation, expectedLocation, distance, @@ -716549,25 +639115,25 @@ function search(text2, pattern, patternAlphabet, { } lastBitArr = bitArr; } - const result3 = { + const result2 = { isMatch: bestLocation >= 0, score: Math.max(0.001, finalScore) }; if (computeMatches) { const indices = convertMaskToIndices(matchMask, minMatchCharLength); if (!indices.length) { - result3.isMatch = false; + result2.isMatch = false; } else if (includeMatches) { - result3.indices = indices; + result2.indices = indices; } } - return result3; + return result2; } function createPatternAlphabet(pattern) { let mask = {}; - for (let i4 = 0, len = pattern.length;i4 < len; i4 += 1) { - const char = pattern.charAt(i4); - mask[char] = (mask[char] || 0) | 1 << len - i4 - 1; + for (let i3 = 0, len = pattern.length;i3 < len; i3 += 1) { + const char = pattern.charAt(i3); + mask[char] = (mask[char] || 0) | 1 << len - i3 - 1; } return mask; } @@ -716611,12 +639177,12 @@ class BitapSearch { }; const len = this.pattern.length; if (len > MAX_BITS) { - let i4 = 0; + let i3 = 0; const remainder = len % MAX_BITS; const end = len - remainder; - while (i4 < end) { - addChunk(this.pattern.substr(i4, MAX_BITS), i4); - i4 += MAX_BITS; + while (i3 < end) { + addChunk(this.pattern.substr(i3, MAX_BITS), i3); + i3 += MAX_BITS; } if (remainder) { const startIndex = len - MAX_BITS; @@ -716626,19 +639192,19 @@ class BitapSearch { addChunk(this.pattern, 0); } } - searchIn(text2) { + searchIn(text) { const { isCaseSensitive, ignoreDiacritics, includeMatches } = this.options; - text2 = isCaseSensitive ? text2 : text2.toLowerCase(); - text2 = ignoreDiacritics ? stripDiacritics(text2) : text2; - if (this.pattern === text2) { - let result4 = { + text = isCaseSensitive ? text : text.toLowerCase(); + text = ignoreDiacritics ? stripDiacritics(text) : text; + if (this.pattern === text) { + let result3 = { isMatch: true, score: 0 }; if (includeMatches) { - result4.indices = [[0, text2.length - 1]]; + result3.indices = [[0, text.length - 1]]; } - return result4; + return result3; } const { location, @@ -716652,7 +639218,7 @@ class BitapSearch { let totalScore = 0; let hasMatches = false; this.chunks.forEach(({ pattern, alphabet, startIndex }) => { - const { isMatch: isMatch3, score, indices } = search(text2, pattern, alphabet, { + const { isMatch: isMatch2, score, indices } = search(text, pattern, alphabet, { location: location + startIndex, distance, threshold, @@ -716661,22 +639227,22 @@ class BitapSearch { includeMatches, ignoreLocation }); - if (isMatch3) { + if (isMatch2) { hasMatches = true; } totalScore += score; - if (isMatch3 && indices) { + if (isMatch2 && indices) { allIndices = [...allIndices, ...indices]; } }); - let result3 = { + let result2 = { isMatch: hasMatches, score: hasMatches ? totalScore / this.chunks.length : 1 }; if (hasMatches && includeMatches) { - result3.indices = allIndices; + result2.indices = allIndices; } - return result3; + return result2; } } @@ -716693,15 +639259,15 @@ class BaseMatch { search() {} } function getMatch(pattern, exp) { - const matches3 = pattern.match(exp); - return matches3 ? matches3[1] : null; + const matches2 = pattern.match(exp); + return matches2 ? matches2[1] : null; } function parseQuery(pattern, options2 = {}) { return pattern.split(OR_TOKEN).map((item) => { let query2 = item.trim().split(SPACE_RE).filter((item2) => item2 && !!item2.trim()); let results = []; - for (let i4 = 0, len = query2.length;i4 < len; i4 += 1) { - const queryItem = query2[i4]; + for (let i3 = 0, len = query2.length;i3 < len; i3 += 1) { + const queryItem = query2[i3]; let found = false; let idx = -1; while (!found && ++idx < searchersLen) { @@ -716761,7 +639327,7 @@ class ExtendedSearch { static condition(_, options2) { return options2.useExtendedSearch; } - searchIn(text2) { + searchIn(text) { const query2 = this.query; if (!query2) { return { @@ -716770,19 +639336,19 @@ class ExtendedSearch { }; } const { includeMatches, isCaseSensitive, ignoreDiacritics } = this.options; - text2 = isCaseSensitive ? text2 : text2.toLowerCase(); - text2 = ignoreDiacritics ? stripDiacritics(text2) : text2; + text = isCaseSensitive ? text : text.toLowerCase(); + text = ignoreDiacritics ? stripDiacritics(text) : text; let numMatches = 0; let allIndices = []; let totalScore = 0; - for (let i4 = 0, qLen = query2.length;i4 < qLen; i4 += 1) { - const searchers2 = query2[i4]; + for (let i3 = 0, qLen = query2.length;i3 < qLen; i3 += 1) { + const searchers2 = query2[i3]; allIndices.length = 0; numMatches = 0; for (let j = 0, pLen = searchers2.length;j < pLen; j += 1) { const searcher = searchers2[j]; - const { isMatch: isMatch3, indices, score } = searcher.search(text2); - if (isMatch3) { + const { isMatch: isMatch2, indices, score } = searcher.search(text); + if (isMatch2) { numMatches += 1; totalScore += score; if (includeMatches) { @@ -716801,14 +639367,14 @@ class ExtendedSearch { } } if (numMatches) { - let result3 = { + let result2 = { isMatch: true, score: totalScore / numMatches }; if (includeMatches) { - result3.indices = allIndices; + result2.indices = allIndices; } - return result3; + return result2; } } return { @@ -716821,8 +639387,8 @@ function register(...args) { registeredSearchers.push(...args); } function createSearcher(pattern, options2) { - for (let i4 = 0, len = registeredSearchers.length;i4 < len; i4 += 1) { - let searcherClass = registeredSearchers[i4]; + for (let i3 = 0, len = registeredSearchers.length;i3 < len; i3 += 1) { + let searcherClass = registeredSearchers[i3]; if (searcherClass.condition(pattern, options2)) { return new searcherClass(pattern, options2); } @@ -716831,15 +639397,15 @@ function createSearcher(pattern, options2) { } function parse18(query2, options2, { auto = true } = {}) { const next = (query3) => { - let keys3 = Object.keys(query3); + let keys2 = Object.keys(query3); const isQueryPath = isPath(query3); - if (!isQueryPath && keys3.length > 1 && !isExpression(query3)) { + if (!isQueryPath && keys2.length > 1 && !isExpression(query3)) { return next(convertToExplicit(query3)); } if (isLeaf(query3)) { - const key = isQueryPath ? query3[KeyType.PATH] : keys3[0]; + const key = isQueryPath ? query3[KeyType.PATH] : keys2[0]; const pattern = isQueryPath ? query3[KeyType.PATTERN] : query3[key]; - if (!isString4(pattern)) { + if (!isString3(pattern)) { throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key)); } const obj = { @@ -716853,11 +639419,11 @@ function parse18(query2, options2, { auto = true } = {}) { } let node = { children: [], - operator: keys3[0] + operator: keys2[0] }; - keys3.forEach((key) => { + keys2.forEach((key) => { const value = query3[key]; - if (isArray9(value)) { + if (isArray4(value)) { value.forEach((item) => { node.children.push(next(item)); }); @@ -716871,22 +639437,22 @@ function parse18(query2, options2, { auto = true } = {}) { return next(query2); } function computeScore(results, { ignoreFieldNorm = Config2.ignoreFieldNorm }) { - results.forEach((result3) => { + results.forEach((result2) => { let totalScore = 1; - result3.matches.forEach(({ key, norm: norm2, score }) => { + result2.matches.forEach(({ key, norm: norm2, score }) => { const weight = key ? key.weight : null; totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm2)); }); - result3.score = totalScore; + result2.score = totalScore; }); } -function transformMatches(result3, data) { - const matches3 = result3.matches; +function transformMatches(result2, data) { + const matches2 = result2.matches; data.matches = []; - if (!isDefined2(matches3)) { + if (!isDefined2(matches2)) { return; } - matches3.forEach((match) => { + matches2.forEach((match) => { if (!isDefined2(match.indices) || !match.indices.length) { return; } @@ -716904,8 +639470,8 @@ function transformMatches(result3, data) { data.matches.push(obj); }); } -function transformScore(result3, data) { - data.score = result3.score; +function transformScore(result2, data) { + data.score = result2.score; } function format6(results, docs, { includeMatches = Config2.includeMatches, @@ -716916,15 +639482,15 @@ function format6(results, docs, { transformers.push(transformMatches); if (includeScore) transformers.push(transformScore); - return results.map((result3) => { - const { idx } = result3; + return results.map((result2) => { + const { idx } = result2; const data = { item: docs[idx], refIndex: idx }; if (transformers.length) { transformers.forEach((transformer) => { - transformer(result3, data); + transformer(result2, data); }); } return data; @@ -716957,11 +639523,11 @@ class Fuse { } remove(predicate = () => false) { const results = []; - for (let i4 = 0, len = this._docs.length;i4 < len; i4 += 1) { - const doc3 = this._docs[i4]; - if (predicate(doc3, i4)) { - this.removeAt(i4); - i4 -= 1; + for (let i3 = 0, len = this._docs.length;i3 < len; i3 += 1) { + const doc3 = this._docs[i3]; + if (predicate(doc3, i3)) { + this.removeAt(i3); + i3 -= 1; len -= 1; results.push(doc3); } @@ -716983,12 +639549,12 @@ class Fuse { sortFn, ignoreFieldNorm } = this.options; - let results = isString4(query2) ? isString4(this._docs[0]) ? this._searchStringList(query2) : this._searchObjectList(query2) : this._searchLogical(query2); + let results = isString3(query2) ? isString3(this._docs[0]) ? this._searchStringList(query2) : this._searchObjectList(query2) : this._searchLogical(query2); computeScore(results, { ignoreFieldNorm }); if (shouldSort) { results.sort(sortFn); } - if (isNumber4(limit) && limit > -1) { + if (isNumber3(limit) && limit > -1) { results = results.slice(0, limit); } return format6(results, this._docs, { @@ -717000,16 +639566,16 @@ class Fuse { const searcher = createSearcher(query2, this.options); const { records } = this._myIndex; const results = []; - records.forEach(({ v: text2, i: idx, n: norm2 }) => { - if (!isDefined2(text2)) { + records.forEach(({ v: text, i: idx, n: norm2 }) => { + if (!isDefined2(text)) { return; } - const { isMatch: isMatch3, score, indices } = searcher.searchIn(text2); - if (isMatch3) { + const { isMatch: isMatch2, score, indices } = searcher.searchIn(text); + if (isMatch2) { results.push({ - item: text2, + item: text, idx, - matches: [{ score, value: text2, norm: norm2, indices }] + matches: [{ score, value: text, norm: norm2, indices }] }); } }); @@ -717020,28 +639586,28 @@ class Fuse { const evaluate = (node, item, idx) => { if (!node.children) { const { keyId, searcher } = node; - const matches3 = this._findMatches({ + const matches2 = this._findMatches({ key: this._keyStore.get(keyId), value: this._myIndex.getValueForItemAtKeyId(item, keyId), searcher }); - if (matches3 && matches3.length) { + if (matches2 && matches2.length) { return [ { idx, item, - matches: matches3 + matches: matches2 } ]; } return []; } const res = []; - for (let i4 = 0, len = node.children.length;i4 < len; i4 += 1) { - const child = node.children[i4]; - const result3 = evaluate(child, item, idx); - if (result3.length) { - res.push(...result3); + for (let i3 = 0, len = node.children.length;i3 < len; i3 += 1) { + const child = node.children[i3]; + const result2 = evaluate(child, item, idx); + if (result2.length) { + res.push(...result2); } else if (node.operator === LogicalOperator.AND) { return []; } @@ -717059,8 +639625,8 @@ class Fuse { resultMap[idx] = { idx, item, matches: [] }; results.push(resultMap[idx]); } - expResults.forEach(({ matches: matches3 }) => { - resultMap[idx].matches.push(...matches3); + expResults.forEach(({ matches: matches2 }) => { + resultMap[idx].matches.push(...matches2); }); } } @@ -717069,25 +639635,25 @@ class Fuse { } _searchObjectList(query2) { const searcher = createSearcher(query2, this.options); - const { keys: keys3, records } = this._myIndex; + const { keys: keys2, records } = this._myIndex; const results = []; records.forEach(({ $: item, i: idx }) => { if (!isDefined2(item)) { return; } - let matches3 = []; - keys3.forEach((key, keyIndex) => { - matches3.push(...this._findMatches({ + let matches2 = []; + keys2.forEach((key, keyIndex) => { + matches2.push(...this._findMatches({ key, value: item[keyIndex], searcher })); }); - if (matches3.length) { + if (matches2.length) { results.push({ idx, item, - matches: matches3 + matches: matches2 }); } }); @@ -717097,18 +639663,18 @@ class Fuse { if (!isDefined2(value)) { return []; } - let matches3 = []; - if (isArray9(value)) { - value.forEach(({ v: text2, i: idx, n: norm2 }) => { - if (!isDefined2(text2)) { + let matches2 = []; + if (isArray4(value)) { + value.forEach(({ v: text, i: idx, n: norm2 }) => { + if (!isDefined2(text)) { return; } - const { isMatch: isMatch3, score, indices } = searcher.searchIn(text2); - if (isMatch3) { - matches3.push({ + const { isMatch: isMatch2, score, indices } = searcher.searchIn(text); + if (isMatch2) { + matches2.push({ score, key, - value: text2, + value: text, idx, norm: norm2, indices @@ -717116,23 +639682,23 @@ class Fuse { } }); } else { - const { v: text2, n: norm2 } = value; - const { isMatch: isMatch3, score, indices } = searcher.searchIn(text2); - if (isMatch3) { - matches3.push({ score, key, value: text2, norm: norm2, indices }); + const { v: text, n: norm2 } = value; + const { isMatch: isMatch2, score, indices } = searcher.searchIn(text); + if (isMatch2) { + matches2.push({ score, key, value: text, norm: norm2, indices }); } } - return matches3; + return matches2; } } -var INFINITY13, INCORRECT_INDEX_TYPE = "Incorrect 'index' type", LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) => `Invalid value for key ${key}`, PATTERN_LENGTH_TOO_LARGE = (max5) => `Pattern length exceeds max of ${max5}.`, MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`, INVALID_KEY_WEIGHT_VALUE = (key) => `Property 'weight' in key '${key}' must be a positive integer`, hasOwn5, MatchOptions, BasicOptions, FuzzyOptions, AdvancedOptions, Config2, SPACE, MAX_BITS = 32, stripDiacritics, ExactMatch, InverseExactMatch, PrefixExactMatch, InversePrefixExactMatch, SuffixExactMatch, InverseSuffixExactMatch, FuzzyMatch, IncludeMatch, searchers, searchersLen, SPACE_RE, OR_TOKEN = "|", MultiMatchSet, registeredSearchers, LogicalOperator, KeyType, isExpression = (query2) => !!(query2[LogicalOperator.AND] || query2[LogicalOperator.OR]), isPath = (query2) => !!query2[KeyType.PATH], isLeaf = (query2) => !isArray9(query2) && isObject7(query2) && !isExpression(query2), convertToExplicit = (query2) => ({ +var INFINITY7, INCORRECT_INDEX_TYPE = "Incorrect 'index' type", LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) => `Invalid value for key ${key}`, PATTERN_LENGTH_TOO_LARGE = (max3) => `Pattern length exceeds max of ${max3}.`, MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`, INVALID_KEY_WEIGHT_VALUE = (key) => `Property 'weight' in key '${key}' must be a positive integer`, hasOwn2, MatchOptions, BasicOptions, FuzzyOptions, AdvancedOptions, Config2, SPACE, MAX_BITS = 32, stripDiacritics, ExactMatch, InverseExactMatch, PrefixExactMatch, InversePrefixExactMatch, SuffixExactMatch, InverseSuffixExactMatch, FuzzyMatch, IncludeMatch, searchers, searchersLen, SPACE_RE, OR_TOKEN = "|", MultiMatchSet, registeredSearchers, LogicalOperator, KeyType, isExpression = (query2) => !!(query2[LogicalOperator.AND] || query2[LogicalOperator.OR]), isPath = (query2) => !!query2[KeyType.PATH], isLeaf = (query2) => !isArray4(query2) && isObject6(query2) && !isExpression(query2), convertToExplicit = (query2) => ({ [LogicalOperator.AND]: Object.keys(query2).map((key) => ({ [key]: query2[key] })) }); var init_fuse = __esm(() => { - INFINITY13 = 1 / 0; - hasOwn5 = Object.prototype.hasOwnProperty; + INFINITY7 = 1 / 0; + hasOwn2 = Object.prototype.hasOwnProperty; MatchOptions = { includeMatches: false, findAllMatches: false, @@ -717153,7 +639719,7 @@ var init_fuse = __esm(() => { }; AdvancedOptions = { useExtendedSearch: false, - getFn: get3, + getFn: get2, ignoreLocation: false, ignoreFieldNorm: false, fieldNormWeight: 1 @@ -717179,11 +639745,11 @@ var init_fuse = __esm(() => { static get singleRegex() { return /^=(.*)$/; } - search(text2) { - const isMatch3 = text2 === this.pattern; + search(text) { + const isMatch2 = text === this.pattern; return { - isMatch: isMatch3, - score: isMatch3 ? 0 : 1, + isMatch: isMatch2, + score: isMatch2 ? 0 : 1, indices: [0, this.pattern.length - 1] }; } @@ -717201,13 +639767,13 @@ var init_fuse = __esm(() => { static get singleRegex() { return /^!(.*)$/; } - search(text2) { - const index = text2.indexOf(this.pattern); - const isMatch3 = index === -1; + search(text) { + const index = text.indexOf(this.pattern); + const isMatch2 = index === -1; return { - isMatch: isMatch3, - score: isMatch3 ? 0 : 1, - indices: [0, text2.length - 1] + isMatch: isMatch2, + score: isMatch2 ? 0 : 1, + indices: [0, text.length - 1] }; } }; @@ -717224,11 +639790,11 @@ var init_fuse = __esm(() => { static get singleRegex() { return /^\^(.*)$/; } - search(text2) { - const isMatch3 = text2.startsWith(this.pattern); + search(text) { + const isMatch2 = text.startsWith(this.pattern); return { - isMatch: isMatch3, - score: isMatch3 ? 0 : 1, + isMatch: isMatch2, + score: isMatch2 ? 0 : 1, indices: [0, this.pattern.length - 1] }; } @@ -717246,12 +639812,12 @@ var init_fuse = __esm(() => { static get singleRegex() { return /^!\^(.*)$/; } - search(text2) { - const isMatch3 = !text2.startsWith(this.pattern); + search(text) { + const isMatch2 = !text.startsWith(this.pattern); return { - isMatch: isMatch3, - score: isMatch3 ? 0 : 1, - indices: [0, text2.length - 1] + isMatch: isMatch2, + score: isMatch2 ? 0 : 1, + indices: [0, text.length - 1] }; } }; @@ -717268,12 +639834,12 @@ var init_fuse = __esm(() => { static get singleRegex() { return /^(.*)\$$/; } - search(text2) { - const isMatch3 = text2.endsWith(this.pattern); + search(text) { + const isMatch2 = text.endsWith(this.pattern); return { - isMatch: isMatch3, - score: isMatch3 ? 0 : 1, - indices: [text2.length - this.pattern.length, text2.length - 1] + isMatch: isMatch2, + score: isMatch2 ? 0 : 1, + indices: [text.length - this.pattern.length, text.length - 1] }; } }; @@ -717290,12 +639856,12 @@ var init_fuse = __esm(() => { static get singleRegex() { return /^!(.*)\$$/; } - search(text2) { - const isMatch3 = !text2.endsWith(this.pattern); + search(text) { + const isMatch2 = !text.endsWith(this.pattern); return { - isMatch: isMatch3, - score: isMatch3 ? 0 : 1, - indices: [0, text2.length - 1] + isMatch: isMatch2, + score: isMatch2 ? 0 : 1, + indices: [0, text.length - 1] }; } }; @@ -717333,8 +639899,8 @@ var init_fuse = __esm(() => { static get singleRegex() { return /^(.*)$/; } - search(text2) { - return this._bitapSearch.searchIn(text2); + search(text) { + return this._bitapSearch.searchIn(text); } }; IncludeMatch = class IncludeMatch extends BaseMatch { @@ -717350,19 +639916,19 @@ var init_fuse = __esm(() => { static get singleRegex() { return /^'(.*)$/; } - search(text2) { + search(text) { let location = 0; let index; const indices = []; const patternLen = this.pattern.length; - while ((index = text2.indexOf(this.pattern, location)) > -1) { + while ((index = text.indexOf(this.pattern, location)) > -1) { location = index + patternLen; indices.push([index, location - 1]); } - const isMatch3 = !!indices.length; + const isMatch2 = !!indices.length; return { - isMatch: isMatch3, - score: isMatch3 ? 0 : 1, + isMatch: isMatch2, + score: isMatch2 ? 0 : 1, indices }; } @@ -717447,17 +640013,17 @@ function getCommandFuse(commands) { function isCommandMetadata(metadata) { return typeof metadata === "object" && metadata !== null && "name" in metadata && typeof metadata.name === "string" && "type" in metadata; } -function findMidInputSlashCommand(input11, cursorOffset) { - if (input11.startsWith("/")) { +function findMidInputSlashCommand(input, cursorOffset) { + if (input.startsWith("/")) { return null; } - const beforeCursor = input11.slice(0, cursorOffset); + const beforeCursor = input.slice(0, cursorOffset); const match = beforeCursor.match(/\s\/([a-zA-Z0-9_:-]*)$/); if (!match || match.index === undefined) { return null; } const slashPos = match.index + 1; - const textAfterSlash = input11.slice(slashPos + 1); + const textAfterSlash = input.slice(slashPos + 1); const commandMatch = textAfterSlash.match(/^[a-zA-Z0-9_:-]*/); const fullCommand = commandMatch ? commandMatch[0] : ""; if (cursorOffset > slashPos + 1 + fullCommand.length) { @@ -717492,15 +640058,15 @@ function getBestCommandMatch(partialCommand, commands) { } return null; } -function isCommandInput(input11) { - return input11.startsWith("/"); +function isCommandInput(input) { + return input.startsWith("/"); } -function hasCommandArgs(input11) { - if (!isCommandInput(input11)) +function hasCommandArgs(input) { + if (!isCommandInput(input)) return false; - if (!input11.includes(" ")) + if (!input.includes(" ")) return false; - if (input11.endsWith(" ")) + if (input.endsWith(" ")) return false; return true; } @@ -717536,14 +640102,14 @@ function createCommandSuggestionItem(cmd, matchedAlias) { metadata: cmd }; } -function generateCommandSuggestions(input11, commands) { - if (!isCommandInput(input11)) { +function generateCommandSuggestions(input, commands) { + if (!isCommandInput(input)) { return []; } - if (hasCommandArgs(input11)) { + if (hasCommandArgs(input)) { return []; } - const query2 = input11.slice(1).toLowerCase().trim(); + const query2 = input.slice(1).toLowerCase().trim(); if (query2 === "") { const visibleCommands = commands.filter((cmd) => !cmd.isHidden); const recentlyUsed = []; @@ -717644,8 +640210,8 @@ function generateCommandSuggestions(input11, commands) { } return b.usage - a2.usage; }); - const fuseSuggestions = sortedResults.map((result3) => { - const cmd = result3.r.item.command; + const fuseSuggestions = sortedResults.map((result2) => { + const cmd = result2.r.item.command; const matchedAlias = findMatchedAlias(query2, cmd.aliases); return createCommandSuggestionItem(cmd, matchedAlias); }); @@ -717682,11 +640248,11 @@ function applyCommandSuggestion(suggestion, shouldExecute, commands, onInputChan function cleanWord(word) { return word.toLowerCase().replace(/[^a-z0-9]/g, ""); } -function findSlashCommandPositions(text2) { +function findSlashCommandPositions(text) { const positions = []; const regex2 = /(^|[\s])(\/[a-zA-Z][a-zA-Z0-9:\-_]*)/g; let match = null; - while ((match = regex2.exec(text2)) !== null) { + while ((match = regex2.exec(text)) !== null) { const precedingChar = match[1] ?? ""; const commandName = match[2] ?? ""; const start = match.index + precedingChar.length; @@ -717704,8 +640270,8 @@ var init_commandSuggestions = __esm(() => { // src/utils/suggestions/shellHistoryCompletion.ts async function getShellHistoryCommands() { - const now3 = Date.now(); - if (shellHistoryCache && now3 - shellHistoryCacheTimestamp < CACHE_TTL_MS5) { + const now2 = Date.now(); + if (shellHistoryCache && now2 - shellHistoryCacheTimestamp < CACHE_TTL_MS5) { return shellHistoryCache; } const commands = []; @@ -717723,11 +640289,11 @@ async function getShellHistoryCommands() { break; } } - } catch (error46) { - logForDebugging(`Failed to read shell history: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to read shell history: ${error42}`); } shellHistoryCache = commands; - shellHistoryCacheTimestamp = now3; + shellHistoryCacheTimestamp = now2; return commands; } function prependToShellHistoryCache(command8) { @@ -717740,20 +640306,20 @@ function prependToShellHistoryCache(command8) { } shellHistoryCache.unshift(command8); } -async function getShellHistoryCompletion(input11) { - if (!input11 || input11.length < 2) { +async function getShellHistoryCompletion(input) { + if (!input || input.length < 2) { return null; } - const trimmedInput = input11.trim(); + const trimmedInput = input.trim(); if (!trimmedInput) { return null; } const commands = await getShellHistoryCommands(); for (const command8 of commands) { - if (command8.startsWith(input11) && command8 !== input11) { + if (command8.startsWith(input) && command8 !== input) { return { fullCommand: command8, - suffix: command8.slice(input11.length) + suffix: command8.slice(input.length) }; } } @@ -717775,7 +640341,7 @@ async function fetchChannels(clients, query2) { return []; } try { - const result3 = await slackClient.client.callTool({ + const result2 = await slackClient.client.callTool({ name: SLACK_SEARCH_TOOL, arguments: { query: query2, @@ -717783,32 +640349,32 @@ async function fetchChannels(clients, query2) { channel_types: "public_channel,private_channel" } }, undefined, { timeout: 5000 }); - const content = result3.content; + const content = result2.content; if (!Array.isArray(content)) return []; const rawText = content.filter((c6) => c6.type === "text").map((c6) => c6.text).join(` `); return parseChannels(unwrapResults(rawText)); - } catch (error46) { - logForDebugging(`Failed to fetch Slack channels: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to fetch Slack channels: ${error42}`); return []; } } -function unwrapResults(text2) { - const trimmed = text2.trim(); +function unwrapResults(text) { + const trimmed = text.trim(); if (!trimmed.startsWith("{")) - return text2; + return text; try { const parsed = resultsEnvelopeSchema().safeParse(jsonParse(trimmed)); if (parsed.success) return parsed.data.results; } catch {} - return text2; + return text; } -function parseChannels(text2) { +function parseChannels(text) { const channels = []; const seen = new Set; - for (const line of text2.split(` + for (const line of text.split(` `)) { const m = line.match(/^Name:\s*#?([a-z0-9][a-z0-9_-]{0,79})\s*$/); if (m && !seen.has(m[1])) { @@ -717824,11 +640390,11 @@ function hasSlackMcpServer(clients) { function getKnownChannelsVersion() { return knownChannelsVersion; } -function findSlackChannelPositions(text2) { +function findSlackChannelPositions(text) { const positions = []; const re = /(^|\s)#([a-z0-9][a-z0-9_-]{0,79})(?=\s|$)/g; let m; - while ((m = re.exec(text2)) !== null) { + while ((m = re.exec(text)) !== null) { if (!knownChannels.has(m[2])) continue; const start = m.index + m[1].length; @@ -717865,10 +640431,10 @@ async function getSlackChannelSuggestions(clients, searchToken) { inflightPromise = fetchChannels(clients, mcpQuery); channels = await inflightPromise; cache5.set(mcpQuery, channels); - const before3 = knownChannels.size; + const before2 = knownChannels.size; for (const c6 of channels) knownChannels.add(c6); - if (knownChannels.size !== before3) { + if (knownChannels.size !== before2) { knownChannelsVersion++; knownChannelsChanged.emit(); } @@ -717888,7 +640454,7 @@ async function getSlackChannelSuggestions(clients, searchToken) { } var SLACK_SEARCH_TOOL = "slack_search_channels", cache5, knownChannels, knownChannelsVersion = 0, knownChannelsChanged, subscribeKnownChannels, inflightQuery = null, inflightPromise = null, resultsEnvelopeSchema; var init_slackChannelSuggestions = __esm(() => { - init_zod2(); + init_zod(); init_debug(); init_slowOperations(); cache5 = new Map; @@ -717899,7 +640465,7 @@ var init_slackChannelSuggestions = __esm(() => { }); // src/hooks/unifiedSuggestions.ts -import { basename as basename60 } from "path"; +import { basename as basename58 } from "path"; function createSuggestionFromSource(source) { switch (source.type) { case "file": @@ -717943,8 +640509,8 @@ function generateAgentSuggestions(agents2, query2, showOnEmpty = false) { } const queryLower = query2.toLowerCase(); return agentSources.filter((agent) => agent.agentType.toLowerCase().includes(queryLower) || agent.displayText.toLowerCase().includes(queryLower)); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return []; } } @@ -717961,7 +640527,7 @@ async function generateUnifiedSuggestions(query2, mcpResources, agents2, showOnE displayText: suggestion.displayText, description: suggestion.description, path: suggestion.displayText, - filename: basename60(suggestion.displayText), + filename: basename58(suggestion.displayText), score: suggestion.metadata?.score })); const mcpSources = Object.values(mcpResources).flat().map((resource) => ({ @@ -717997,10 +640563,10 @@ async function generateUnifiedSuggestions(query2, mcpResources, agents2, showOnE ] }); const fuseResults = fuse.search(query2, { limit: MAX_UNIFIED_SUGGESTIONS }); - for (const result3 of fuseResults) { + for (const result2 of fuseResults) { scoredResults.push({ - source: result3.item, - score: result3.score ?? 0.5 + source: result2.item, + score: result2.score ?? 0.5 }); } } @@ -718065,8 +640631,8 @@ function formatReplacementValue(options2) { return displayText; } } -function applyShellSuggestion(suggestion, input11, cursorOffset, onInputChange, setCursorOffset, completionType) { - const beforeCursor = input11.slice(0, cursorOffset); +function applyShellSuggestion(suggestion, input, cursorOffset, onInputChange, setCursorOffset, completionType) { + const beforeCursor = input.slice(0, cursorOffset); const lastSpaceIndex = beforeCursor.lastIndexOf(" "); const wordStart = lastSpaceIndex + 1; let replacementText; @@ -718077,53 +640643,53 @@ function applyShellSuggestion(suggestion, input11, cursorOffset, onInputChange, } else { replacementText = suggestion.displayText; } - const newInput = input11.slice(0, wordStart) + replacementText + input11.slice(cursorOffset); + const newInput = input.slice(0, wordStart) + replacementText + input.slice(cursorOffset); onInputChange(newInput); setCursorOffset(wordStart + replacementText.length); } -function applyTriggerSuggestion(suggestion, input11, cursorOffset, triggerRe, onInputChange, setCursorOffset) { - const m = input11.slice(0, cursorOffset).match(triggerRe); +function applyTriggerSuggestion(suggestion, input, cursorOffset, triggerRe, onInputChange, setCursorOffset) { + const m = input.slice(0, cursorOffset).match(triggerRe); if (!m || m.index === undefined) return; const prefixStart = m.index + (m[1]?.length ?? 0); - const before3 = input11.slice(0, prefixStart); - const newInput = before3 + suggestion.displayText + " " + input11.slice(cursorOffset); + const before2 = input.slice(0, prefixStart); + const newInput = before2 + suggestion.displayText + " " + input.slice(cursorOffset); onInputChange(newInput); - setCursorOffset(before3.length + suggestion.displayText.length + 1); + setCursorOffset(before2.length + suggestion.displayText.length + 1); } -async function generateBashSuggestions(input11, cursorOffset) { +async function generateBashSuggestions(input, cursorOffset) { try { if (currentShellCompletionAbortController) { currentShellCompletionAbortController.abort(); } currentShellCompletionAbortController = new AbortController; - const suggestions = await getShellCompletions(input11, cursorOffset, currentShellCompletionAbortController.signal); + const suggestions = await getShellCompletions(input, cursorOffset, currentShellCompletionAbortController.signal); return suggestions; } catch { logEvent("tengu_shell_completion_failed", {}); return []; } } -function applyDirectorySuggestion(input11, suggestionId, tokenStartPos, tokenLength, isDirectory) { +function applyDirectorySuggestion(input, suggestionId, tokenStartPos, tokenLength, isDirectory) { const suffix = isDirectory ? "/" : " "; - const before3 = input11.slice(0, tokenStartPos); - const after3 = input11.slice(tokenStartPos + tokenLength); + const before2 = input.slice(0, tokenStartPos); + const after2 = input.slice(tokenStartPos + tokenLength); const replacement = "@" + suggestionId + suffix; - const newInput = before3 + replacement + after3; + const newInput = before2 + replacement + after2; return { newInput, - cursorPos: before3.length + replacement.length + cursorPos: before2.length + replacement.length }; } -function extractCompletionToken(text2, cursorPos, includeAtSymbol = false) { - if (!text2) +function extractCompletionToken(text, cursorPos, includeAtSymbol = false) { + if (!text) return null; - const textBeforeCursor = text2.substring(0, cursorPos); + const textBeforeCursor = text.substring(0, cursorPos); if (includeAtSymbol) { const quotedAtRegex = /@"([^"]*)"?$/; const quotedMatch = textBeforeCursor.match(quotedAtRegex); if (quotedMatch && quotedMatch.index !== undefined) { - const textAfterCursor2 = text2.substring(cursorPos); + const textAfterCursor2 = text.substring(cursorPos); const afterQuotedMatch = textAfterCursor2.match(/^[^"]*"?/); const quotedSuffix = afterQuotedMatch ? afterQuotedMatch[0] : ""; return { @@ -718139,7 +640705,7 @@ function extractCompletionToken(text2, cursorPos, includeAtSymbol = false) { const fromAt = textBeforeCursor.substring(atIdx); const atHeadMatch = fromAt.match(AT_TOKEN_HEAD_RE); if (atHeadMatch && atHeadMatch[0].length === fromAt.length) { - const textAfterCursor2 = text2.substring(cursorPos); + const textAfterCursor2 = text.substring(cursorPos); const afterMatch2 = textAfterCursor2.match(PATH_CHAR_HEAD_RE); const tokenSuffix2 = afterMatch2 ? afterMatch2[0] : ""; return { @@ -718155,7 +640721,7 @@ function extractCompletionToken(text2, cursorPos, includeAtSymbol = false) { if (!match || match.index === undefined) { return null; } - const textAfterCursor = text2.substring(cursorPos); + const textAfterCursor = text.substring(cursorPos); const afterMatch = textAfterCursor.match(PATH_CHAR_HEAD_RE); const tokenSuffix = afterMatch ? afterMatch[0] : ""; return { @@ -718187,7 +640753,7 @@ function useTypeahead({ onInputChange, onSubmit, setCursorOffset, - input: input11, + input, cursorOffset, mode, agents: agents2, @@ -718223,7 +640789,7 @@ function useTypeahead({ const syncPromptGhostText = import_react246.useMemo(() => { if (mode !== "prompt" || suppressSuggestions) return; - const midInputCommand = findMidInputSlashCommand(input11, cursorOffset); + const midInputCommand = findMidInputSlashCommand(input, cursorOffset); if (!midInputCommand) return; const match = getBestCommandMatch(midInputCommand.partialCommand, commands); @@ -718234,7 +640800,7 @@ function useTypeahead({ fullCommand: match.fullCommand, insertPosition: midInputCommand.startPos + 1 + midInputCommand.partialCommand.length }; - }, [input11, cursorOffset, mode, commands, suppressSuggestions]); + }, [input, cursorOffset, mode, commands, suppressSuggestions]); const effectiveGhostText = suppressSuggestions ? undefined : mode === "prompt" ? syncPromptGhostText : inlineGhostText; const cursorOffsetRef = import_react246.useRef(cursorOffset); cursorOffsetRef.current = cursorOffset; @@ -718293,10 +640859,10 @@ function useTypeahead({ }); }, [fetchFileSuggestions]); const debouncedFetchFileSuggestions = useDebounceCallback(fetchFileSuggestions, 50); - const fetchSlackChannels = import_react246.useCallback(async (partial5) => { - latestSlackTokenRef.current = partial5; - const channels = await getSlackChannelSuggestions(store.getState().mcp.clients, partial5); - if (latestSlackTokenRef.current !== partial5) + const fetchSlackChannels = import_react246.useCallback(async (partial4) => { + latestSlackTokenRef.current = partial4; + const channels = await getSlackChannelSuggestions(store.getState().mcp.clients, partial4); + if (latestSlackTokenRef.current !== partial4) return; setSuggestionsState((prev) => ({ commandArgumentHint: undefined, @@ -718439,15 +641005,15 @@ function useTypeahead({ const { args } = parsedCommand; - const matches3 = await searchSessionsByCustomTitle(args, { + const matches2 = await searchSessionsByCustomTitle(args, { limit: 10 }); - const suggestions2 = matches3.map((log3) => { - const sessionId = getSessionIdFromLog(log3); + const suggestions2 = matches2.map((log2) => { + const sessionId = getSessionIdFromLog(log2); return { id: `resume-title-${sessionId}`, - displayText: log3.customTitle, - description: formatLogMetadata(log3), + displayText: log2.customTitle, + description: formatLogMetadata(log2), metadata: { sessionId } @@ -718585,16 +641151,16 @@ function useTypeahead({ allCommandsMaxWidth ]); import_react246.useEffect(() => { - if (dismissedForInputRef.current === input11) { + if (dismissedForInputRef.current === input) { return; } - if (prevInputRef.current !== input11) { - prevInputRef.current = input11; + if (prevInputRef.current !== input) { + prevInputRef.current = input; latestSearchTokenRef.current = null; } dismissedForInputRef.current = null; - updateSuggestions(input11); - }, [input11, updateSuggestions]); + updateSuggestions(input); + }, [input, updateSuggestions]); const handleTab = import_react246.useCallback(async () => { if (effectiveGhostText) { if (mode === "bash") { @@ -718603,11 +641169,11 @@ function useTypeahead({ setInlineGhostText(undefined); return; } - const midInputCommand = findMidInputSlashCommand(input11, cursorOffset); + const midInputCommand = findMidInputSlashCommand(input, cursorOffset); if (midInputCommand) { - const before3 = input11.slice(0, midInputCommand.startPos); - const after3 = input11.slice(midInputCommand.startPos + midInputCommand.token.length); - const newInput = before3 + "/" + effectiveGhostText.fullCommand + " " + after3; + const before2 = input.slice(0, midInputCommand.startPos); + const after2 = input.slice(midInputCommand.startPos + midInputCommand.token.length); + const newInput = before2 + "/" + effectiveGhostText.fullCommand + " " + after2; const newCursorOffset = midInputCommand.startPos + 1 + effectiveGhostText.fullCommand.length + 1; onInputChange(newInput); setCursorOffset(newCursorOffset); @@ -718634,11 +641200,11 @@ function useTypeahead({ } else if (suggestionType === "directory" && suggestions.length > 0) { const suggestion2 = suggestions[index]; if (suggestion2) { - const isInCommandContext = isCommandInput(input11); + const isInCommandContext = isCommandInput(input); let newInput; if (isInCommandContext) { - const spaceIndex = input11.indexOf(" "); - const commandPart = input11.slice(0, spaceIndex + 1); + const spaceIndex = input.indexOf(" "); + const commandPart = input.slice(0, spaceIndex + 1); const cmdSuffix = isPathMetadata(suggestion2.metadata) && suggestion2.metadata.type === "directory" ? "/" : " "; newInput = commandPart + suggestion2.id + cmdSuffix; onInputChange(newInput); @@ -718653,20 +641219,20 @@ function useTypeahead({ clearSuggestions(); } } else { - const completionTokenWithAt = extractCompletionToken(input11, cursorOffset, true); - const completionToken = completionTokenWithAt ?? extractCompletionToken(input11, cursorOffset, false); + const completionTokenWithAt = extractCompletionToken(input, cursorOffset, true); + const completionToken = completionTokenWithAt ?? extractCompletionToken(input, cursorOffset, false); if (completionToken) { const isDir = isPathMetadata(suggestion2.metadata) && suggestion2.metadata.type === "directory"; - const result3 = applyDirectorySuggestion(input11, suggestion2.id, completionToken.startPos, completionToken.token.length, isDir); - newInput = result3.newInput; + const result2 = applyDirectorySuggestion(input, suggestion2.id, completionToken.startPos, completionToken.token.length, isDir); + newInput = result2.newInput; onInputChange(newInput); - setCursorOffset(result3.cursorPos); + setCursorOffset(result2.cursorPos); if (isDir) { setSuggestionsState((prev) => ({ ...prev, commandArgumentHint: undefined })); - updateSuggestions(newInput, result3.cursorPos); + updateSuggestions(newInput, result2.cursorPos); } else { clearSuggestions(); } @@ -718679,23 +641245,23 @@ function useTypeahead({ const suggestion2 = suggestions[index]; if (suggestion2) { const metadata = suggestion2.metadata; - applyShellSuggestion(suggestion2, input11, cursorOffset, onInputChange, setCursorOffset, metadata?.completionType); + applyShellSuggestion(suggestion2, input, cursorOffset, onInputChange, setCursorOffset, metadata?.completionType); clearSuggestions(); } } else if (suggestionType === "agent" && suggestions.length > 0 && suggestions[index]?.id?.startsWith("dm-")) { const suggestion2 = suggestions[index]; if (suggestion2) { - applyTriggerSuggestion(suggestion2, input11, cursorOffset, DM_MEMBER_RE, onInputChange, setCursorOffset); + applyTriggerSuggestion(suggestion2, input, cursorOffset, DM_MEMBER_RE, onInputChange, setCursorOffset); clearSuggestions(); } } else if (suggestionType === "slack-channel" && suggestions.length > 0) { const suggestion2 = suggestions[index]; if (suggestion2) { - applyTriggerSuggestion(suggestion2, input11, cursorOffset, HASH_CHANNEL_RE, onInputChange, setCursorOffset); + applyTriggerSuggestion(suggestion2, input, cursorOffset, HASH_CHANNEL_RE, onInputChange, setCursorOffset); clearSuggestions(); } } else if (suggestionType === "file" && suggestions.length > 0) { - const completionToken = extractCompletionToken(input11, cursorOffset, true); + const completionToken = extractCompletionToken(input, cursorOffset, true); if (!completionToken) { clearSuggestions(); return; @@ -718719,8 +641285,8 @@ function useTypeahead({ isQuoted: completionToken.isQuoted, isComplete: false }); - applyFileSuggestion(replacementValue, input11, completionToken.token, completionToken.startPos, onInputChange, setCursorOffset); - updateSuggestions(input11.replace(completionToken.token, replacementValue), cursorOffset); + applyFileSuggestion(replacementValue, input, completionToken.token, completionToken.startPos, onInputChange, setCursorOffset); + updateSuggestions(input.replace(completionToken.token, replacementValue), cursorOffset); } else if (index < suggestions.length) { const suggestion2 = suggestions[index]; if (suggestion2) { @@ -718733,22 +641299,22 @@ function useTypeahead({ isQuoted: completionToken.isQuoted, isComplete: true }); - applyFileSuggestion(replacementValue, input11, completionToken.token, completionToken.startPos, onInputChange, setCursorOffset); + applyFileSuggestion(replacementValue, input, completionToken.token, completionToken.startPos, onInputChange, setCursorOffset); clearSuggestions(); } } } - } else if (input11.trim() !== "") { + } else if (input.trim() !== "") { let suggestionType2; let suggestionItems; if (mode === "bash") { suggestionType2 = "shell"; - const bashSuggestions = await generateBashSuggestions(input11, cursorOffset); + const bashSuggestions = await generateBashSuggestions(input, cursorOffset); if (bashSuggestions.length === 1) { const suggestion = bashSuggestions[0]; if (suggestion) { const metadata = suggestion.metadata; - applyShellSuggestion(suggestion, input11, cursorOffset, onInputChange, setCursorOffset, metadata?.completionType); + applyShellSuggestion(suggestion, input, cursorOffset, onInputChange, setCursorOffset, metadata?.completionType); } suggestionItems = []; } else { @@ -718756,7 +641322,7 @@ function useTypeahead({ } } else { suggestionType2 = "file"; - const completionInfo = extractCompletionToken(input11, cursorOffset, true); + const completionInfo = extractCompletionToken(input, cursorOffset, true); if (completionInfo) { const isAtSymbol = completionInfo.token.startsWith("@"); const searchToken = isAtSymbol ? completionInfo.token.substring(1) : completionInfo.token; @@ -718775,7 +641341,7 @@ function useTypeahead({ setMaxColumnWidth(undefined); } } - }, [suggestions, selectedSuggestion, input11, suggestionType, commands, mode, onInputChange, setCursorOffset, onSubmit, clearSuggestions, cursorOffset, updateSuggestions, mcpResources, setSuggestionsState, agents2, debouncedFetchFileSuggestions, debouncedFetchSlackChannels, effectiveGhostText]); + }, [suggestions, selectedSuggestion, input, suggestionType, commands, mode, onInputChange, setCursorOffset, onSubmit, clearSuggestions, cursorOffset, updateSuggestions, mcpResources, setSuggestionsState, agents2, debouncedFetchFileSuggestions, debouncedFetchSlackChannels, effectiveGhostText]); const handleEnter = import_react246.useCallback(() => { if (selectedSuggestion < 0 || suggestions.length === 0) return; @@ -718799,22 +641365,22 @@ function useTypeahead({ const suggestion2 = suggestions[selectedSuggestion]; if (suggestion2) { const metadata = suggestion2.metadata; - applyShellSuggestion(suggestion2, input11, cursorOffset, onInputChange, setCursorOffset, metadata?.completionType); + applyShellSuggestion(suggestion2, input, cursorOffset, onInputChange, setCursorOffset, metadata?.completionType); debouncedFetchFileSuggestions.cancel(); clearSuggestions(); } } else if (suggestionType === "agent" && selectedSuggestion < suggestions.length && suggestion?.id?.startsWith("dm-")) { - applyTriggerSuggestion(suggestion, input11, cursorOffset, DM_MEMBER_RE, onInputChange, setCursorOffset); + applyTriggerSuggestion(suggestion, input, cursorOffset, DM_MEMBER_RE, onInputChange, setCursorOffset); debouncedFetchFileSuggestions.cancel(); clearSuggestions(); } else if (suggestionType === "slack-channel" && selectedSuggestion < suggestions.length) { if (suggestion) { - applyTriggerSuggestion(suggestion, input11, cursorOffset, HASH_CHANNEL_RE, onInputChange, setCursorOffset); + applyTriggerSuggestion(suggestion, input, cursorOffset, HASH_CHANNEL_RE, onInputChange, setCursorOffset); debouncedFetchSlackChannels.cancel(); clearSuggestions(); } } else if (suggestionType === "file" && selectedSuggestion < suggestions.length) { - const completionInfo = extractCompletionToken(input11, cursorOffset, true); + const completionInfo = extractCompletionToken(input, cursorOffset, true); if (completionInfo) { if (suggestion) { const hasAtPrefix = completionInfo.token.startsWith("@"); @@ -718827,31 +641393,31 @@ function useTypeahead({ isQuoted: completionInfo.isQuoted, isComplete: true }); - applyFileSuggestion(replacementValue, input11, completionInfo.token, completionInfo.startPos, onInputChange, setCursorOffset); + applyFileSuggestion(replacementValue, input, completionInfo.token, completionInfo.startPos, onInputChange, setCursorOffset); debouncedFetchFileSuggestions.cancel(); clearSuggestions(); } } } else if (suggestionType === "directory" && selectedSuggestion < suggestions.length) { if (suggestion) { - if (isCommandInput(input11)) { + if (isCommandInput(input)) { debouncedFetchFileSuggestions.cancel(); clearSuggestions(); return; } - const completionTokenWithAt = extractCompletionToken(input11, cursorOffset, true); - const completionToken = completionTokenWithAt ?? extractCompletionToken(input11, cursorOffset, false); + const completionTokenWithAt = extractCompletionToken(input, cursorOffset, true); + const completionToken = completionTokenWithAt ?? extractCompletionToken(input, cursorOffset, false); if (completionToken) { const isDir = isPathMetadata(suggestion.metadata) && suggestion.metadata.type === "directory"; - const result3 = applyDirectorySuggestion(input11, suggestion.id, completionToken.startPos, completionToken.token.length, isDir); - onInputChange(result3.newInput); - setCursorOffset(result3.cursorPos); + const result2 = applyDirectorySuggestion(input, suggestion.id, completionToken.startPos, completionToken.token.length, isDir); + onInputChange(result2.newInput); + setCursorOffset(result2.cursorPos); } debouncedFetchFileSuggestions.cancel(); clearSuggestions(); } } - }, [suggestions, selectedSuggestion, suggestionType, commands, input11, cursorOffset, mode, onInputChange, setCursorOffset, onSubmit, clearSuggestions, debouncedFetchFileSuggestions, debouncedFetchSlackChannels]); + }, [suggestions, selectedSuggestion, suggestionType, commands, input, cursorOffset, mode, onInputChange, setCursorOffset, onSubmit, clearSuggestions, debouncedFetchFileSuggestions, debouncedFetchSlackChannels]); const handleAutocompleteAccept = import_react246.useCallback(() => { handleTab(); }, [handleTab]); @@ -718859,8 +641425,8 @@ function useTypeahead({ debouncedFetchFileSuggestions.cancel(); debouncedFetchSlackChannels.cancel(); clearSuggestions(); - dismissedForInputRef.current = input11; - }, [debouncedFetchFileSuggestions, debouncedFetchSlackChannels, clearSuggestions, input11]); + dismissedForInputRef.current = input; + }, [debouncedFetchFileSuggestions, debouncedFetchSlackChannels, clearSuggestions, input]); const handleAutocompletePrevious = import_react246.useCallback(() => { setSuggestionsState((prev) => ({ ...prev, @@ -718887,23 +641453,23 @@ function useTypeahead({ context: "Autocomplete", isActive: isAutocompleteActive && !isModalOverlayActive }); - function acceptSuggestionText(text2) { - const detectedMode = getModeFromInput(text2); + function acceptSuggestionText(text) { + const detectedMode = getModeFromInput(text); if (detectedMode !== "prompt" && onModeChange) { onModeChange(detectedMode); - const stripped = getValueFromInput(text2); + const stripped = getValueFromInput(text); onInputChange(stripped); setCursorOffset(stripped.length); } else { - onInputChange(text2); - setCursorOffset(text2.length); + onInputChange(text); + setCursorOffset(text.length); } } const handleKeyDown = (e) => { if (e.key === "right" && !isViewingTeammate) { const suggestionText = promptSuggestion.text; const suggestionShownAt = promptSuggestion.shownAt; - if (suggestionText && suggestionShownAt > 0 && input11 === "") { + if (suggestionText && suggestionShownAt > 0 && input === "") { markAccepted(); acceptSuggestionText(suggestionText); e.stopImmediatePropagation(); @@ -718916,13 +641482,13 @@ function useTypeahead({ } const suggestionText = promptSuggestion.text; const suggestionShownAt = promptSuggestion.shownAt; - if (suggestionText && suggestionShownAt > 0 && input11 === "" && !isViewingTeammate) { + if (suggestionText && suggestionShownAt > 0 && input === "" && !isViewingTeammate) { e.preventDefault(); markAccepted(); acceptSuggestionText(suggestionText); return; } - if (input11.trim() === "") { + if (input.trim() === "") { e.preventDefault(); addNotification({ key: "thinking-toggle-hint", @@ -719012,8 +641578,8 @@ var init_useTypeahead = __esm(() => { }); // src/utils/directMemberMessage.ts -function parseDirectMemberMessage(input11) { - const match = input11.match(/^@([\w-]+)\s+(.+)$/s); +function parseDirectMemberMessage(input) { + const match = input.match(/^@([\w-]+)\s+(.+)$/s); if (!match) return null; const [, recipientName, message] = match; @@ -719113,74 +641679,74 @@ var init_getNextPermissionMode = __esm(() => { }); // src/utils/ultraplan/keyword.ts -function findKeywordTriggerPositions(text2, keyword) { +function findKeywordTriggerPositions(text, keyword) { const re = new RegExp(keyword, "i"); - if (!re.test(text2)) + if (!re.test(text)) return []; - if (text2.startsWith("/")) + if (text.startsWith("/")) return []; const quotedRanges = []; let openQuote = null; let openAt = 0; const isWord = (ch2) => !!ch2 && /[\p{L}\p{N}_]/u.test(ch2); - for (let i4 = 0;i4 < text2.length; i4++) { - const ch2 = text2[i4]; + for (let i3 = 0;i3 < text.length; i3++) { + const ch2 = text[i3]; if (openQuote) { if (openQuote === "[" && ch2 === "[") { - openAt = i4; + openAt = i3; continue; } if (ch2 !== OPEN_TO_CLOSE[openQuote]) continue; - if (openQuote === "'" && isWord(text2[i4 + 1])) + if (openQuote === "'" && isWord(text[i3 + 1])) continue; - quotedRanges.push({ start: openAt, end: i4 + 1 }); + quotedRanges.push({ start: openAt, end: i3 + 1 }); openQuote = null; - } else if (ch2 === "<" && i4 + 1 < text2.length && /[a-zA-Z/]/.test(text2[i4 + 1]) || ch2 === "'" && !isWord(text2[i4 - 1]) || ch2 !== "<" && ch2 !== "'" && ch2 in OPEN_TO_CLOSE) { + } else if (ch2 === "<" && i3 + 1 < text.length && /[a-zA-Z/]/.test(text[i3 + 1]) || ch2 === "'" && !isWord(text[i3 - 1]) || ch2 !== "<" && ch2 !== "'" && ch2 in OPEN_TO_CLOSE) { openQuote = ch2; - openAt = i4; + openAt = i3; } } const positions = []; const wordRe = new RegExp(`\\b${keyword}\\b`, "gi"); - const matches3 = text2.matchAll(wordRe); - for (const match of matches3) { + const matches2 = text.matchAll(wordRe); + for (const match of matches2) { if (match.index === undefined) continue; const start = match.index; const end = start + match[0].length; if (quotedRanges.some((r) => start >= r.start && start < r.end)) continue; - const before3 = text2[start - 1]; - const after3 = text2[end]; - if (before3 === "/" || before3 === "\\" || before3 === "-") + const before2 = text[start - 1]; + const after2 = text[end]; + if (before2 === "/" || before2 === "\\" || before2 === "-") continue; - if (after3 === "/" || after3 === "\\" || after3 === "-" || after3 === "?") + if (after2 === "/" || after2 === "\\" || after2 === "-" || after2 === "?") continue; - if (after3 === "." && isWord(text2[end + 1])) + if (after2 === "." && isWord(text[end + 1])) continue; positions.push({ word: match[0], start, end }); } return positions; } -function findUltraplanTriggerPositions(text2) { - return findKeywordTriggerPositions(text2, "ultraplan"); +function findUltraplanTriggerPositions(text) { + return findKeywordTriggerPositions(text, "ultraplan"); } -function findUltrareviewTriggerPositions(text2) { - return findKeywordTriggerPositions(text2, "ultrareview"); +function findUltrareviewTriggerPositions(text) { + return findKeywordTriggerPositions(text, "ultrareview"); } -function hasUltraplanKeyword(text2) { - return findUltraplanTriggerPositions(text2).length > 0; +function hasUltraplanKeyword(text) { + return findUltraplanTriggerPositions(text).length > 0; } -function replaceUltraplanKeyword(text2) { - const [trigger] = findUltraplanTriggerPositions(text2); +function replaceUltraplanKeyword(text) { + const [trigger] = findUltraplanTriggerPositions(text); if (!trigger) - return text2; - const before3 = text2.slice(0, trigger.start); - const after3 = text2.slice(trigger.end); - if (!(before3 + after3).trim()) + return text; + const before2 = text.slice(0, trigger.start); + const after2 = text.slice(trigger.end); + if (!(before2 + after2).trim()) return ""; - return before3 + trigger.word.slice("ultra".length) + after3; + return before2 + trigger.word.slice("ultra".length) + after2; } var OPEN_TO_CLOSE; var init_keyword = __esm(() => { @@ -719360,7 +641926,7 @@ var init_AutoModeOptInDialog = __esm(() => { }); // src/components/BridgeDialog.tsx -import { basename as basename61 } from "path"; +import { basename as basename59 } from "path"; function BridgeDialog(t0) { const $2 = import_compiler_runtime328.c(87); const { @@ -719372,7 +641938,7 @@ function BridgeDialog(t0) { const reconnecting = useAppState(_temp356); const connectUrl = useAppState(_temp442); const sessionUrl = useAppState(_temp529); - const error46 = useAppState(_temp623); + const error42 = useAppState(_temp623); const explicit = useAppState(_temp721); const environmentId = useAppState(_temp819); const sessionId = useAppState(_temp916); @@ -719383,7 +641949,7 @@ function BridgeDialog(t0) { const [branchName, setBranchName] = import_react248.useState(""); let t1; if ($2[0] === Symbol.for("react.memo_cache_sentinel")) { - t1 = basename61(getOriginalCwd()); + t1 = basename59(getOriginalCwd()); $2[0] = t1; } else { t1 = $2[0]; @@ -719460,8 +642026,8 @@ function BridgeDialog(t0) { useKeybindings(t7, t8); let t9; if ($2[11] !== explicit || $2[12] !== onDone || $2[13] !== setAppState) { - t9 = (input11) => { - if (input11 === "d") { + t9 = (input) => { + if (input === "d") { if (explicit) { saveGlobalConfig(_temp1110); } @@ -719478,15 +642044,15 @@ function BridgeDialog(t0) { } use_input_default(t9); let t10; - if ($2[15] !== connected || $2[16] !== error46 || $2[17] !== reconnecting || $2[18] !== sessionActive) { + if ($2[15] !== connected || $2[16] !== error42 || $2[17] !== reconnecting || $2[18] !== sessionActive) { t10 = getBridgeStatus({ - error: error46, + error: error42, connected, sessionActive, reconnecting }); $2[15] = connected; - $2[16] = error46; + $2[16] = error42; $2[17] = reconnecting; $2[18] = sessionActive; $2[19] = t10; @@ -719497,7 +642063,7 @@ function BridgeDialog(t0) { label: statusLabel, color: statusColor } = t10; - const indicator = error46 ? BRIDGE_FAILED_INDICATOR : BRIDGE_READY_INDICATOR; + const indicator = error42 ? BRIDGE_FAILED_INDICATOR : BRIDGE_READY_INDICATOR; let T0; let T1; let footerText; @@ -719508,7 +642074,7 @@ function BridgeDialog(t0) { let t15; let t16; let t17; - if ($2[20] !== branchName || $2[21] !== displayUrl || $2[22] !== environmentId || $2[23] !== error46 || $2[24] !== indicator || $2[25] !== onDone || $2[26] !== qrText || $2[27] !== sessionActive || $2[28] !== sessionId || $2[29] !== showQR || $2[30] !== statusColor || $2[31] !== statusLabel || $2[32] !== verbose) { + if ($2[20] !== branchName || $2[21] !== displayUrl || $2[22] !== environmentId || $2[23] !== error42 || $2[24] !== indicator || $2[25] !== onDone || $2[26] !== qrText || $2[27] !== sessionActive || $2[28] !== sessionId || $2[29] !== showQR || $2[30] !== statusColor || $2[31] !== statusLabel || $2[32] !== verbose) { const qrLines = qrText ? qrText.split(` `).filter(_temp1310) : []; let contextParts; @@ -719527,10 +642093,10 @@ function BridgeDialog(t0) { } const contextSuffix = contextParts.length > 0 ? " · " + contextParts.join(" · ") : ""; let t182; - if ($2[45] !== displayUrl || $2[46] !== error46 || $2[47] !== sessionActive) { - t182 = error46 ? FAILED_FOOTER_TEXT : displayUrl ? sessionActive ? buildActiveFooterText(displayUrl) : buildIdleFooterText(displayUrl) : undefined; + if ($2[45] !== displayUrl || $2[46] !== error42 || $2[47] !== sessionActive) { + t182 = error42 ? FAILED_FOOTER_TEXT : displayUrl ? sessionActive ? buildActiveFooterText(displayUrl) : buildIdleFooterText(displayUrl) : undefined; $2[45] = displayUrl; - $2[46] = error46; + $2[46] = error42; $2[47] = sessionActive; $2[48] = t182; } else { @@ -719587,12 +642153,12 @@ function BridgeDialog(t0) { t212 = $2[57]; } let t22; - if ($2[58] !== error46) { - t22 = error46 && /* @__PURE__ */ jsx_dev_runtime427.jsxDEV(ThemedText, { + if ($2[58] !== error42) { + t22 = error42 && /* @__PURE__ */ jsx_dev_runtime427.jsxDEV(ThemedText, { color: "error", - children: error46 + children: error42 }, undefined, false, undefined, this); - $2[58] = error46; + $2[58] = error42; $2[59] = t22; } else { t22 = $2[59]; @@ -719652,7 +642218,7 @@ function BridgeDialog(t0) { $2[20] = branchName; $2[21] = displayUrl; $2[22] = environmentId; - $2[23] = error46; + $2[23] = error42; $2[24] = indicator; $2[25] = onDone; $2[26] = qrText; @@ -719746,10 +642312,10 @@ function BridgeDialog(t0) { } return t21; } -function _temp144(line, i4) { +function _temp144(line, i3) { return /* @__PURE__ */ jsx_dev_runtime427.jsxDEV(ThemedText, { children: line - }, i4, false, undefined, this); + }, i3, false, undefined, this); } function _temp1310(l) { return l.length > 0; @@ -719856,28 +642422,28 @@ var init_CoordinatorAgentStatus = __esm(() => { }); // src/utils/highlightMatch.tsx -function highlightMatch(text2, query2) { +function highlightMatch(text, query2) { if (!query2) - return text2; + return text; const queryLower = query2.toLowerCase(); - const textLower = text2.toLowerCase(); + const textLower = text.toLowerCase(); const parts = []; let offset = 0; let idx = textLower.indexOf(queryLower, offset); if (idx === -1) - return text2; + return text; while (idx !== -1) { if (idx > offset) - parts.push(text2.slice(offset, idx)); + parts.push(text.slice(offset, idx)); parts.push(/* @__PURE__ */ jsx_dev_runtime429.jsxDEV(ThemedText, { inverse: true, - children: text2.slice(idx, idx + query2.length) + children: text.slice(idx, idx + query2.length) }, idx, false, undefined, this)); offset = idx + query2.length; idx = textLower.indexOf(queryLower, offset); } - if (offset < text2.length) - parts.push(text2.slice(offset)); + if (offset < text.length) + parts.push(text.slice(offset)); return /* @__PURE__ */ jsx_dev_runtime429.jsxDEV(jsx_dev_runtime429.Fragment, { children: parts }, undefined, false, undefined, this); @@ -719918,9 +642484,9 @@ function FuzzyPicker({ } = useTerminalSize(); const [focusedIndex, setFocusedIndex] = import_react249.useState(0); const visibleCount = Math.max(MIN_VISIBLE, Math.min(requestedVisible, rows - CHROME_ROWS2 - (matchLabel ? 1 : 0))); - const compact4 = columns < 120; + const compact3 = columns < 120; const step = (delta) => { - setFocusedIndex((i4) => clamp2(i4 + delta, 0, items.length - 1)); + setFocusedIndex((i3) => clamp2(i3 + delta, 0, items.length - 1)); }; const { query: query2, @@ -719972,7 +642538,7 @@ function FuzzyPicker({ setFocusedIndex(0); }, [query2]); import_react249.useEffect(() => { - setFocusedIndex((i4) => clamp2(i4, 0, items.length - 1)); + setFocusedIndex((i3) => clamp2(i3, 0, items.length - 1)); }, [items.length]); const focused = items[focusedIndex]; import_react249.useEffect(() => { @@ -720059,17 +642625,17 @@ function FuzzyPicker({ children: [ /* @__PURE__ */ jsx_dev_runtime430.jsxDEV(KeyboardShortcutHint, { shortcut: "↑/↓", - action: compact4 ? "nav" : "navigate" + action: compact3 ? "nav" : "navigate" }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime430.jsxDEV(KeyboardShortcutHint, { shortcut: "Enter", - action: compact4 ? firstWord(selectAction) : selectAction + action: compact3 ? firstWord(selectAction) : selectAction }, undefined, false, undefined, this), onTab && /* @__PURE__ */ jsx_dev_runtime430.jsxDEV(KeyboardShortcutHint, { shortcut: "Tab", action: onTab.action }, undefined, false, undefined, this), - onShiftTab && !compact4 && /* @__PURE__ */ jsx_dev_runtime430.jsxDEV(KeyboardShortcutHint, { + onShiftTab && !compact3 && /* @__PURE__ */ jsx_dev_runtime430.jsxDEV(KeyboardShortcutHint, { shortcut: "shift+tab", action: onShiftTab.action }, undefined, false, undefined, this), @@ -720129,11 +642695,11 @@ function List(t0) { if ($2[5] !== direction || $2[6] !== focusedIndex || $2[7] !== getKey2 || $2[8] !== renderItem || $2[9] !== total || $2[10] !== visible || $2[11] !== visibleCount || $2[12] !== windowStart) { let t22; if ($2[14] !== direction || $2[15] !== focusedIndex || $2[16] !== getKey2 || $2[17] !== renderItem || $2[18] !== total || $2[19] !== visible.length || $2[20] !== visibleCount || $2[21] !== windowStart) { - t22 = (item, i4) => { - const actualIndex = windowStart + i4; + t22 = (item, i3) => { + const actualIndex = windowStart + i3; const isFocused = actualIndex === focusedIndex; - const atLowEdge = i4 === 0 && windowStart > 0; - const atHighEdge = i4 === visible.length - 1 && windowStart + visibleCount < total; + const atLowEdge = i3 === 0 && windowStart > 0; + const atHighEdge = i3 === visible.length - 1 && windowStart + visibleCount < total; return /* @__PURE__ */ jsx_dev_runtime430.jsxDEV(ListItem, { isFocused, showScrollUp: direction === "up" ? atHighEdge : atLowEdge, @@ -720187,8 +642753,8 @@ function List(t0) { return t3; } function firstWord(s) { - const i4 = s.indexOf(" "); - return i4 === -1 ? s : s.slice(0, i4); + const i3 = s.indexOf(" "); + return i3 === -1 ? s : s.slice(0, i3); } var import_compiler_runtime330, import_react249, jsx_dev_runtime430, DEFAULT_VISIBLE = 8, CHROME_ROWS2 = 10, MIN_VISIBLE = 2; var init_FuzzyPicker = __esm(() => { @@ -720228,7 +642794,7 @@ function GlobalSearchDialog(t0) { } else { t1 = $2[0]; } - const [matches3, setMatches] = import_react250.useState(t1); + const [matches2, setMatches] = import_react250.useState(t1); const [truncated, setTruncated] = import_react250.useState(false); const [isSearching, setIsSearching] = import_react250.useState(false); const [query2, setQuery] = import_react250.useState(""); @@ -720329,16 +642895,16 @@ function GlobalSearchDialog(t0) { const maxTextWidth = Math.max(20, listWidth - maxPathWidth - 4); const previewWidth = previewOnRight ? Math.max(40, columns - listWidth - 14) : columns - 6; let t7; - if ($2[7] !== matches3.length || $2[8] !== onDone) { + if ($2[7] !== matches2.length || $2[8] !== onDone) { t7 = (m_3) => { const opened = openFileInExternalEditor(resolvePath(getCwd(), m_3.file), m_3.line); logEvent("tengu_global_search_select", { - result_count: matches3.length, + result_count: matches2.length, opened_editor: opened }); onDone(); }; - $2[7] = matches3.length; + $2[7] = matches2.length; $2[8] = onDone; $2[9] = t7; } else { @@ -720346,16 +642912,16 @@ function GlobalSearchDialog(t0) { } const handleOpen = t7; let t8; - if ($2[10] !== matches3.length || $2[11] !== onDone || $2[12] !== onInsert) { + if ($2[10] !== matches2.length || $2[11] !== onDone || $2[12] !== onInsert) { t8 = (m_4, mention) => { onInsert(mention ? `@${m_4.file}#L${m_4.line} ` : `${m_4.file}:${m_4.line} `); logEvent("tengu_global_search_insert", { - result_count: matches3.length, + result_count: matches2.length, mention }); onDone(); }; - $2[10] = matches3.length; + $2[10] = matches2.length; $2[11] = onDone; $2[12] = onInsert; $2[13] = t8; @@ -720363,7 +642929,7 @@ function GlobalSearchDialog(t0) { t8 = $2[13]; } const handleInsert = t8; - const matchLabel = matches3.length > 0 ? `${matches3.length}${truncated ? "+" : ""} matches${isSearching ? "…" : ""}` : " "; + const matchLabel = matches2.length > 0 ? `${matches2.length}${truncated ? "+" : ""} matches${isSearching ? "…" : ""}` : " "; const t9 = previewOnRight ? "right" : "bottom"; let t10; if ($2[14] !== handleInsert) { @@ -720432,9 +642998,9 @@ function GlobalSearchDialog(t0) { ] }, undefined, true, undefined, this), preview.content.split(` -`).map((line_0, i4) => /* @__PURE__ */ jsx_dev_runtime431.jsxDEV(ThemedText, { +`).map((line_0, i3) => /* @__PURE__ */ jsx_dev_runtime431.jsxDEV(ThemedText, { children: highlightMatch(truncateToWidth(line_0, previewWidth), query2) - }, i4, false, undefined, this)) + }, i3, false, undefined, this)) ] }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime431.jsxDEV(LoadingState, { message: "Loading…", @@ -720448,11 +643014,11 @@ function GlobalSearchDialog(t0) { t14 = $2[27]; } let t15; - if ($2[28] !== handleOpen || $2[29] !== matchLabel || $2[30] !== matches3 || $2[31] !== onDone || $2[32] !== t10 || $2[33] !== t11 || $2[34] !== t12 || $2[35] !== t13 || $2[36] !== t14 || $2[37] !== t9 || $2[38] !== visibleResults) { + if ($2[28] !== handleOpen || $2[29] !== matchLabel || $2[30] !== matches2 || $2[31] !== onDone || $2[32] !== t10 || $2[33] !== t11 || $2[34] !== t12 || $2[35] !== t13 || $2[36] !== t14 || $2[37] !== t9 || $2[38] !== visibleResults) { t15 = /* @__PURE__ */ jsx_dev_runtime431.jsxDEV(FuzzyPicker, { title: "Global Search", placeholder: "Type to search…", - items: matches3, + items: matches2, getKey: matchKey, visibleCount: visibleResults, direction: "up", @@ -720471,7 +643037,7 @@ function GlobalSearchDialog(t0) { }, undefined, false, undefined, this); $2[28] = handleOpen; $2[29] = matchLabel; - $2[30] = matches3; + $2[30] = matches2; $2[31] = onDone; $2[32] = t10; $2[33] = t11; @@ -720547,14 +643113,14 @@ function parseRipgrepLine(line) { const m = /^(.*?):(\d+):(.*)$/.exec(line); if (!m) return null; - const [, file2, lineStr, text2] = m; + const [, file2, lineStr, text] = m; const lineNum = Number(lineStr); if (!file2 || !Number.isFinite(lineNum)) return null; return { file: file2, line: lineNum, - text: text2 ?? "" + text: text ?? "" }; } var import_compiler_runtime331, import_react250, jsx_dev_runtime431, VISIBLE_RESULTS = 12, DEBOUNCE_MS3 = 100, PREVIEW_CONTEXT_LINES = 4, MAX_MATCHES_PER_FILE = 10, MAX_TOTAL_MATCHES = 500; @@ -720688,10 +643254,10 @@ function HistorySearchDialog({ paddingX: 1, height: PREVIEW_ROWS + 2, children: [ - shown.map((row, i4) => /* @__PURE__ */ jsx_dev_runtime432.jsxDEV(ThemedText, { + shown.map((row, i3) => /* @__PURE__ */ jsx_dev_runtime432.jsxDEV(ThemedText, { dimColor: true, children: row - }, i4, false, undefined, this)), + }, i3, false, undefined, this)), more > 0 && /* @__PURE__ */ jsx_dev_runtime432.jsxDEV(ThemedText, { dimColor: true, children: `… +${more} more lines` @@ -720701,10 +643267,10 @@ function HistorySearchDialog({ } }, undefined, false, undefined, this); } -function isSubsequence(text2, query2) { +function isSubsequence(text, query2) { let j = 0; - for (let i4 = 0;i4 < text2.length && j < query2.length; i4++) { - if (text2[i4] === query2[j]) + for (let i3 = 0;i3 < text.length && j < query2.length; i3++) { + if (text[i3] === query2[j]) j++; } return j === query2.length; @@ -720725,7 +643291,7 @@ var init_HistorySearchDialog = __esm(() => { }); // src/components/QuickOpenDialog.tsx -import * as path27 from "path"; +import * as path22 from "path"; function QuickOpenDialog(t0) { const $2 = import_compiler_runtime332.c(35); const { @@ -720798,7 +643364,7 @@ function QuickOpenDialog(t0) { return; } const controller = new AbortController; - const absolute = path27.resolve(getCwd(), focusedPath); + const absolute = path22.resolve(getCwd(), focusedPath); readFileInRange(absolute, 0, effectivePreviewLines, undefined, controller.signal).then((r) => { if (controller.signal.aborted) { return; @@ -720833,7 +643399,7 @@ function QuickOpenDialog(t0) { let t7; if ($2[8] !== onDone || $2[9] !== results.length) { t7 = (p_1) => { - const opened = openFileInExternalEditor(path27.resolve(getCwd(), p_1)); + const opened = openFileInExternalEditor(path22.resolve(getCwd(), p_1)); logEvent("tengu_quick_open_select", { result_count: results.length, opened_editor: opened @@ -720969,16 +643535,16 @@ function _temp530(p_3) { return p_3; } function _temp444(p_0) { - return p_0.split(path27.sep).join("/"); + return p_0.split(path22.sep).join("/"); } function _temp358(p) { - return !p.endsWith(path27.sep); + return !p.endsWith(path22.sep); } function _temp286(i_0) { return i_0.displayText; } -function _temp202(i4) { - return i4.id.startsWith("file-"); +function _temp202(i3) { + return i3.id.startsWith("file-"); } var import_compiler_runtime332, import_react252, jsx_dev_runtime433, VISIBLE_RESULTS2 = 8, PREVIEW_LINES = 20; var init_QuickOpenDialog = __esm(() => { @@ -721321,7 +643887,7 @@ function TeamsDialog({ }, { context: "Confirmation" }); - use_input_default((input11, key) => { + use_input_default((input, key) => { if (key.leftArrow) { if (dialogLevel.type === "teammateDetail") { goBackToList(); @@ -721350,7 +643916,7 @@ function TeamsDialog({ } return; } - if (input11 === "k") { + if (input === "k") { if (dialogLevel.type === "teammateList" && teammateStatuses[selectedIndex]) { killTeammate(teammateStatuses[selectedIndex].tmuxPaneId, teammateStatuses[selectedIndex].backendType, dialogLevel.teamName, teammateStatuses[selectedIndex].agentId, teammateStatuses[selectedIndex].name, setAppState).then(() => { setRefreshKey((k) => k + 1); @@ -721362,7 +643928,7 @@ function TeamsDialog({ } return; } - if (input11 === "s") { + if (input === "s") { if (dialogLevel.type === "teammateList" && teammateStatuses[selectedIndex]) { const teammate = teammateStatuses[selectedIndex]; sendShutdownRequestToMailbox(teammate.name, dialogLevel.teamName, "Graceful shutdown requested by team lead"); @@ -721372,7 +643938,7 @@ function TeamsDialog({ } return; } - if (input11 === "h") { + if (input === "h") { const backend = getCachedBackend(); const teammate = dialogLevel.type === "teammateList" ? teammateStatuses[selectedIndex] : dialogLevel.type === "teammateDetail" ? currentTeammate : null; if (teammate && backend?.supportsHideShow) { @@ -721385,7 +643951,7 @@ function TeamsDialog({ } return; } - if (input11 === "H" && dialogLevel.type === "teammateList") { + if (input === "H" && dialogLevel.type === "teammateList") { const backend = getCachedBackend(); if (backend?.supportsHideShow && teammateStatuses.length > 0) { const anyVisible = teammateStatuses.some((t) => !t.isHidden); @@ -721395,7 +643961,7 @@ function TeamsDialog({ } return; } - if (input11 === "p" && dialogLevel.type === "teammateList") { + if (input === "p" && dialogLevel.type === "teammateList") { const idleTeammates = teammateStatuses.filter((t) => t.status === "idle"); if (idleTeammates.length > 0) { Promise.all(idleTeammates.map((t) => killTeammate(t.tmuxPaneId, t.backendType, dialogLevel.teamName, t.agentId, t.name, setAppState))).then(() => { @@ -721667,8 +644233,8 @@ function TeammateDetailView(t0) { import_react254.useEffect(t2, t3); let t4; if ($2[6] === Symbol.for("react.memo_cache_sentinel")) { - t4 = (input11) => { - if (input11 === "p") { + t4 = (input) => { + if (input === "p") { setPromptExpanded(_temp204); } }; @@ -721871,8 +644437,8 @@ async function killTeammate(paneId, backendType, teamName, teammateId, teammateN try { await ensureBackendsRegistered(); await getBackendByType(backendType).killPane(paneId, !isInsideTmuxSync()); - } catch (error46) { - logForDebugging(`[TeamsDialog] Failed to kill pane ${paneId}: ${error46}`); + } catch (error42) { + logForDebugging(`[TeamsDialog] Failed to kill pane ${paneId}: ${error42}`); } } else { logForDebugging(`[TeamsDialog] Skipping pane kill for ${paneId}: no backendType recorded`); @@ -722013,14 +644579,14 @@ var init_TeamsDialog = __esm(() => { // src/vim/motions.ts function resolveMotion(key, cursor, count4) { - let result3 = cursor; - for (let i4 = 0;i4 < count4; i4++) { - const next = applySingleMotion(key, result3); - if (next.equals(result3)) + let result2 = cursor; + for (let i3 = 0;i3 < count4; i3++) { + const next = applySingleMotion(key, result2); + if (next.equals(result2)) break; - result3 = next; + result2 = next; } - return result3; + return result2; } function applySingleMotion(key, cursor) { switch (key) { @@ -722068,34 +644634,34 @@ function isLinewiseMotion(key) { } // src/vim/textObjects.ts -function findTextObject(text2, offset, objectType3, isInner) { +function findTextObject(text, offset, objectType3, isInner) { if (objectType3 === "w") - return findWordObject(text2, offset, isInner, isVimWordChar); + return findWordObject(text, offset, isInner, isVimWordChar); if (objectType3 === "W") - return findWordObject(text2, offset, isInner, (ch2) => !isVimWhitespace(ch2)); + return findWordObject(text, offset, isInner, (ch2) => !isVimWhitespace(ch2)); const pair = PAIRS[objectType3]; if (pair) { const [open17, close] = pair; - return open17 === close ? findQuoteObject(text2, offset, open17, isInner) : findBracketObject(text2, offset, open17, close, isInner); + return open17 === close ? findQuoteObject(text, offset, open17, isInner) : findBracketObject(text, offset, open17, close, isInner); } return null; } -function findWordObject(text2, offset, isInner, isWordChar2) { +function findWordObject(text, offset, isInner, isWordChar2) { const graphemes = []; - for (const { segment, index } of getGraphemeSegmenter().segment(text2)) { + for (const { segment, index } of getGraphemeSegmenter().segment(text)) { graphemes.push({ segment, index }); } let graphemeIdx = graphemes.length - 1; - for (let i4 = 0;i4 < graphemes.length; i4++) { - const g = graphemes[i4]; - const nextStart = i4 + 1 < graphemes.length ? graphemes[i4 + 1].index : text2.length; + for (let i3 = 0;i3 < graphemes.length; i3++) { + const g = graphemes[i3]; + const nextStart = i3 + 1 < graphemes.length ? graphemes[i3 + 1].index : text.length; if (offset >= g.index && offset < nextStart) { - graphemeIdx = i4; + graphemeIdx = i3; break; } } const graphemeAt = (idx) => graphemes[idx]?.segment ?? ""; - const offsetAt = (idx) => idx < graphemes.length ? graphemes[idx].index : text2.length; + const offsetAt = (idx) => idx < graphemes.length ? graphemes[idx].index : text.length; const isWs = (idx) => isVimWhitespace(graphemeAt(idx)); const isWord = (idx) => isWordChar2(graphemeAt(idx)); const isPunct = (idx) => isVimPunctuation(graphemeAt(idx)); @@ -722129,37 +644695,37 @@ function findWordObject(text2, offset, isInner, isWordChar2) { } return { start: offsetAt(startIdx), end: offsetAt(endIdx) }; } -function findQuoteObject(text2, offset, quote2, isInner) { - const lineStart = text2.lastIndexOf(` +function findQuoteObject(text, offset, quote2, isInner) { + const lineStart = text.lastIndexOf(` `, offset - 1) + 1; - const lineEnd = text2.indexOf(` + const lineEnd = text.indexOf(` `, offset); - const effectiveEnd = lineEnd === -1 ? text2.length : lineEnd; - const line = text2.slice(lineStart, effectiveEnd); + const effectiveEnd = lineEnd === -1 ? text.length : lineEnd; + const line = text.slice(lineStart, effectiveEnd); const posInLine = offset - lineStart; const positions = []; - for (let i4 = 0;i4 < line.length; i4++) { - if (line[i4] === quote2) - positions.push(i4); + for (let i3 = 0;i3 < line.length; i3++) { + if (line[i3] === quote2) + positions.push(i3); } - for (let i4 = 0;i4 < positions.length - 1; i4 += 2) { - const qs = positions[i4]; - const qe = positions[i4 + 1]; + for (let i3 = 0;i3 < positions.length - 1; i3 += 2) { + const qs = positions[i3]; + const qe = positions[i3 + 1]; if (qs <= posInLine && posInLine <= qe) { return isInner ? { start: lineStart + qs + 1, end: lineStart + qe } : { start: lineStart + qs, end: lineStart + qe + 1 }; } } return null; } -function findBracketObject(text2, offset, open17, close, isInner) { +function findBracketObject(text, offset, open17, close, isInner) { let depth = 0; let start = -1; - for (let i4 = offset;i4 >= 0; i4--) { - if (text2[i4] === close && i4 !== offset) + for (let i3 = offset;i3 >= 0; i3--) { + if (text[i3] === close && i3 !== offset) depth++; - else if (text2[i4] === open17) { + else if (text[i3] === open17) { if (depth === 0) { - start = i4; + start = i3; break; } depth--; @@ -722169,12 +644735,12 @@ function findBracketObject(text2, offset, open17, close, isInner) { return null; depth = 0; let end = -1; - for (let i4 = start + 1;i4 < text2.length; i4++) { - if (text2[i4] === open17) + for (let i3 = start + 1;i3 < text.length; i3++) { + if (text[i3] === open17) depth++; - else if (text2[i4] === close) { + else if (text[i3] === close) { if (depth === 0) { - end = i4; + end = i3; break; } depth--; @@ -722210,8 +644776,8 @@ function executeOperatorMotion(op, motion, count4, ctx) { const target = resolveMotion(motion, ctx.cursor, count4); if (target.equals(ctx.cursor)) return; - const range3 = getOperatorRange(ctx.cursor, target, motion, op, count4); - applyOperator(op, range3.from, range3.to, ctx, range3.linewise); + const range2 = getOperatorRange(ctx.cursor, target, motion, op, count4); + applyOperator(op, range2.from, range2.to, ctx, range2.linewise); ctx.recordChange({ type: "operator", op, motion, count: count4 }); } function executeOperatorFind(op, findType, char, count4, ctx) { @@ -722219,33 +644785,33 @@ function executeOperatorFind(op, findType, char, count4, ctx) { if (targetOffset === null) return; const target = new Cursor(ctx.cursor.measuredText, targetOffset); - const range3 = getOperatorRangeForFind(ctx.cursor, target, findType); - applyOperator(op, range3.from, range3.to, ctx); + const range2 = getOperatorRangeForFind(ctx.cursor, target, findType); + applyOperator(op, range2.from, range2.to, ctx); ctx.setLastFind(findType, char); ctx.recordChange({ type: "operatorFind", op, find: findType, char, count: count4 }); } function executeOperatorTextObj(op, scope, objType, count4, ctx) { - const range3 = findTextObject(ctx.text, ctx.cursor.offset, objType, scope === "inner"); - if (!range3) + const range2 = findTextObject(ctx.text, ctx.cursor.offset, objType, scope === "inner"); + if (!range2) return; - applyOperator(op, range3.start, range3.end, ctx); + applyOperator(op, range2.start, range2.end, ctx); ctx.recordChange({ type: "operatorTextObj", op, objType, scope, count: count4 }); } function executeLineOp(op, count4, ctx) { - const text2 = ctx.text; - const lines = text2.split(` + const text = ctx.text; + const lines = text.split(` `); - const currentLine = countCharInString(text2.slice(0, ctx.cursor.offset), ` + const currentLine = countCharInString(text.slice(0, ctx.cursor.offset), ` `); const linesToAffect = Math.min(count4, lines.length - currentLine); const lineStart = ctx.cursor.startOfLogicalLine().offset; let lineEnd = lineStart; - for (let i4 = 0;i4 < linesToAffect; i4++) { - const nextNewline = text2.indexOf(` + for (let i3 = 0;i3 < linesToAffect; i3++) { + const nextNewline = text.indexOf(` `, lineEnd); - lineEnd = nextNewline === -1 ? text2.length : nextNewline + 1; + lineEnd = nextNewline === -1 ? text.length : nextNewline + 1; } - let content = text2.slice(lineStart, lineEnd); + let content = text.slice(lineStart, lineEnd); if (!content.endsWith(` `)) { content = content + ` @@ -722257,11 +644823,11 @@ function executeLineOp(op, count4, ctx) { } else if (op === "delete") { let deleteStart = lineStart; const deleteEnd = lineEnd; - if (deleteEnd === text2.length && deleteStart > 0 && text2[deleteStart - 1] === ` + if (deleteEnd === text.length && deleteStart > 0 && text[deleteStart - 1] === ` `) { deleteStart -= 1; } - const newText = text2.slice(0, deleteStart) + text2.slice(deleteEnd); + const newText = text.slice(0, deleteStart) + text.slice(deleteEnd); ctx.setText(newText || ""); const maxOff = Math.max(0, newText.length - (lastGrapheme(newText).length || 1)); ctx.setOffset(Math.min(deleteStart, maxOff)); @@ -722285,7 +644851,7 @@ function executeX(count4, ctx) { if (from >= ctx.text.length) return; let endCursor = ctx.cursor; - for (let i4 = 0;i4 < count4 && !endCursor.isAtEnd(); i4++) { + for (let i3 = 0;i3 < count4 && !endCursor.isAtEnd(); i3++) { endCursor = endCursor.right(); } const to = endCursor.offset; @@ -722300,7 +644866,7 @@ function executeX(count4, ctx) { function executeReplace(char, count4, ctx) { let offset = ctx.cursor.offset; let newText = ctx.text; - for (let i4 = 0;i4 < count4 && offset < newText.length; i4++) { + for (let i3 = 0;i3 < count4 && offset < newText.length; i3++) { const graphemeLen = firstGrapheme(newText.slice(offset)).length || 1; newText = newText.slice(0, offset) + char + newText.slice(offset + graphemeLen); offset += char.length; @@ -722329,8 +644895,8 @@ function executeToggleCase(count4, ctx) { ctx.recordChange({ type: "toggleCase", count: count4 }); } function executeJoin(count4, ctx) { - const text2 = ctx.text; - const lines = text2.split(` + const text = ctx.text; + const lines = text.split(` `); const { line: currentLine } = ctx.cursor.getPosition(); if (currentLine >= lines.length - 1) @@ -722338,8 +644904,8 @@ function executeJoin(count4, ctx) { const linesToJoin = Math.min(count4, lines.length - currentLine - 1); let joinedLine = lines[currentLine]; const cursorPos = joinedLine.length; - for (let i4 = 1;i4 <= linesToJoin; i4++) { - const nextLine = (lines[currentLine + i4] ?? "").trimStart(); + for (let i3 = 1;i3 <= linesToJoin; i3++) { + const nextLine = (lines[currentLine + i3] ?? "").trimStart(); if (nextLine.length > 0) { if (!joinedLine.endsWith(" ") && joinedLine.length > 0) { joinedLine += " "; @@ -722358,7 +644924,7 @@ function executeJoin(count4, ctx) { ctx.setOffset(getLineStartOffset(newLines, currentLine) + cursorPos); ctx.recordChange({ type: "join", count: count4 }); } -function executePaste(after3, count4, ctx) { +function executePaste(after2, count4, ctx) { const register2 = ctx.getRegister(); if (!register2) return; @@ -722366,15 +644932,15 @@ function executePaste(after3, count4, ctx) { `); const content = isLinewise ? register2.slice(0, -1) : register2; if (isLinewise) { - const text2 = ctx.text; - const lines = text2.split(` + const text = ctx.text; + const lines = text.split(` `); const { line: currentLine } = ctx.cursor.getPosition(); - const insertLine = after3 ? currentLine + 1 : currentLine; + const insertLine = after2 ? currentLine + 1 : currentLine; const contentLines = content.split(` `); const repeatedLines = []; - for (let i4 = 0;i4 < count4; i4++) { + for (let i3 = 0;i3 < count4; i3++) { repeatedLines.push(...contentLines); } const newLines = [ @@ -722388,7 +644954,7 @@ function executePaste(after3, count4, ctx) { ctx.setOffset(getLineStartOffset(newLines, insertLine)); } else { const textToInsert = content.repeat(count4); - const insertPoint = after3 && ctx.cursor.offset < ctx.text.length ? ctx.cursor.measuredText.nextOffset(ctx.cursor.offset) : ctx.cursor.offset; + const insertPoint = after2 && ctx.cursor.offset < ctx.text.length ? ctx.cursor.measuredText.nextOffset(ctx.cursor.offset) : ctx.cursor.offset; const newText = ctx.text.slice(0, insertPoint) + textToInsert + ctx.text.slice(insertPoint); const lastGr = lastGrapheme(textToInsert); const newOffset = insertPoint + textToInsert.length - (lastGr.length || 1); @@ -722397,14 +644963,14 @@ function executePaste(after3, count4, ctx) { } } function executeIndent(dir, count4, ctx) { - const text2 = ctx.text; - const lines = text2.split(` + const text = ctx.text; + const lines = text.split(` `); const { line: currentLine } = ctx.cursor.getPosition(); const linesToAffect = Math.min(count4, lines.length - currentLine); const indent = " "; - for (let i4 = 0;i4 < linesToAffect; i4++) { - const lineIdx = currentLine + i4; + for (let i3 = 0;i3 < linesToAffect; i3++) { + const lineIdx = currentLine + i3; const line = lines[lineIdx] ?? ""; if (dir === ">") { lines[lineIdx] = indent + line; @@ -722431,8 +644997,8 @@ function executeIndent(dir, count4, ctx) { ctx.recordChange({ type: "indent", dir, count: count4 }); } function executeOpenLine(direction, ctx) { - const text2 = ctx.text; - const lines = text2.split(` + const text = ctx.text; + const lines = text.split(` `); const { line: currentLine } = ctx.cursor.getPosition(); const insertLine = direction === "below" ? currentLine + 1 : currentLine; @@ -722457,19 +645023,19 @@ function getOperatorRange(cursor, target, motion, op, count4) { let linewise = false; if (op === "change" && (motion === "w" || motion === "W")) { let wordCursor = cursor; - for (let i4 = 0;i4 < count4 - 1; i4++) { + for (let i3 = 0;i3 < count4 - 1; i3++) { wordCursor = motion === "w" ? wordCursor.nextVimWord() : wordCursor.nextWORD(); } const wordEnd = motion === "w" ? wordCursor.endOfVimWord() : wordCursor.endOfWORD(); to = cursor.measuredText.nextOffset(wordEnd.offset); } else if (isLinewiseMotion(motion)) { linewise = true; - const text2 = cursor.text; - const nextNewline = text2.indexOf(` + const text = cursor.text; + const nextNewline = text.indexOf(` `, to); if (nextNewline === -1) { - to = text2.length; - if (from > 0 && text2[from - 1] === ` + to = text.length; + if (from > 0 && text[from - 1] === ` `) { from -= 1; } @@ -722514,16 +645080,16 @@ function executeOperatorG(op, count4, ctx) { const target = count4 === 1 ? ctx.cursor.startOfLastLine() : ctx.cursor.goToLine(count4); if (target.equals(ctx.cursor)) return; - const range3 = getOperatorRange(ctx.cursor, target, "G", op, count4); - applyOperator(op, range3.from, range3.to, ctx, range3.linewise); + const range2 = getOperatorRange(ctx.cursor, target, "G", op, count4); + applyOperator(op, range2.from, range2.to, ctx, range2.linewise); ctx.recordChange({ type: "operator", op, motion: "G", count: count4 }); } function executeOperatorGg(op, count4, ctx) { const target = count4 === 1 ? ctx.cursor.startOfFirstLine() : ctx.cursor.goToLine(count4); if (target.equals(ctx.cursor)) return; - const range3 = getOperatorRange(ctx.cursor, target, "gg", op, count4); - applyOperator(op, range3.from, range3.to, ctx, range3.linewise); + const range2 = getOperatorRange(ctx.cursor, target, "gg", op, count4); + applyOperator(op, range2.from, range2.to, ctx, range2.linewise); ctx.recordChange({ type: "operator", op, motion: "gg", count: count4 }); } var init_operators = __esm(() => { @@ -722552,7 +645118,7 @@ function createInitialPersistentState() { }; } var OPERATORS, SIMPLE_MOTIONS, FIND_KEYS, TEXT_OBJ_SCOPES, TEXT_OBJ_TYPES, MAX_VIM_COUNT = 1e4; -var init_types19 = __esm(() => { +var init_types18 = __esm(() => { OPERATORS = { d: "delete", c: "change", @@ -722598,76 +645164,76 @@ var init_types19 = __esm(() => { }); // src/vim/transitions.ts -function transition(state2, input11, ctx) { +function transition(state2, input, ctx) { switch (state2.type) { case "idle": - return fromIdle(input11, ctx); + return fromIdle(input, ctx); case "count": - return fromCount(state2, input11, ctx); + return fromCount(state2, input, ctx); case "operator": - return fromOperator(state2, input11, ctx); + return fromOperator(state2, input, ctx); case "operatorCount": - return fromOperatorCount(state2, input11, ctx); + return fromOperatorCount(state2, input, ctx); case "operatorFind": - return fromOperatorFind(state2, input11, ctx); + return fromOperatorFind(state2, input, ctx); case "operatorTextObj": - return fromOperatorTextObj(state2, input11, ctx); + return fromOperatorTextObj(state2, input, ctx); case "find": - return fromFind(state2, input11, ctx); + return fromFind(state2, input, ctx); case "g": - return fromG(state2, input11, ctx); + return fromG(state2, input, ctx); case "operatorG": - return fromOperatorG(state2, input11, ctx); + return fromOperatorG(state2, input, ctx); case "replace": - return fromReplace(state2, input11, ctx); + return fromReplace(state2, input, ctx); case "indent": - return fromIndent(state2, input11, ctx); + return fromIndent(state2, input, ctx); } } -function handleNormalInput(input11, count4, ctx) { - if (isOperatorKey(input11)) { - return { next: { type: "operator", op: OPERATORS[input11], count: count4 } }; +function handleNormalInput(input, count4, ctx) { + if (isOperatorKey(input)) { + return { next: { type: "operator", op: OPERATORS[input], count: count4 } }; } - if (SIMPLE_MOTIONS.has(input11)) { + if (SIMPLE_MOTIONS.has(input)) { return { execute: () => { - const target = resolveMotion(input11, ctx.cursor, count4); + const target = resolveMotion(input, ctx.cursor, count4); ctx.setOffset(target.offset); } }; } - if (FIND_KEYS.has(input11)) { - return { next: { type: "find", find: input11, count: count4 } }; + if (FIND_KEYS.has(input)) { + return { next: { type: "find", find: input, count: count4 } }; } - if (input11 === "g") + if (input === "g") return { next: { type: "g", count: count4 } }; - if (input11 === "r") + if (input === "r") return { next: { type: "replace", count: count4 } }; - if (input11 === ">" || input11 === "<") { - return { next: { type: "indent", dir: input11, count: count4 } }; + if (input === ">" || input === "<") { + return { next: { type: "indent", dir: input, count: count4 } }; } - if (input11 === "~") { + if (input === "~") { return { execute: () => executeToggleCase(count4, ctx) }; } - if (input11 === "x") { + if (input === "x") { return { execute: () => executeX(count4, ctx) }; } - if (input11 === "J") { + if (input === "J") { return { execute: () => executeJoin(count4, ctx) }; } - if (input11 === "p" || input11 === "P") { - return { execute: () => executePaste(input11 === "p", count4, ctx) }; + if (input === "p" || input === "P") { + return { execute: () => executePaste(input === "p", count4, ctx) }; } - if (input11 === "D") { + if (input === "D") { return { execute: () => executeOperatorMotion("delete", "$", 1, ctx) }; } - if (input11 === "C") { + if (input === "C") { return { execute: () => executeOperatorMotion("change", "$", 1, ctx) }; } - if (input11 === "Y") { + if (input === "Y") { return { execute: () => executeLineOp("yank", count4, ctx) }; } - if (input11 === "G") { + if (input === "G") { return { execute: () => { if (count4 === 1) { @@ -722678,24 +645244,24 @@ function handleNormalInput(input11, count4, ctx) { } }; } - if (input11 === ".") { + if (input === ".") { return { execute: () => ctx.onDotRepeat?.() }; } - if (input11 === ";" || input11 === ",") { - return { execute: () => executeRepeatFind(input11 === ",", count4, ctx) }; + if (input === ";" || input === ",") { + return { execute: () => executeRepeatFind(input === ",", count4, ctx) }; } - if (input11 === "u") { + if (input === "u") { return { execute: () => ctx.onUndo?.() }; } - if (input11 === "i") { + if (input === "i") { return { execute: () => ctx.enterInsert(ctx.cursor.offset) }; } - if (input11 === "I") { + if (input === "I") { return { execute: () => ctx.enterInsert(ctx.cursor.firstNonBlankInLogicalLine().offset) }; } - if (input11 === "a") { + if (input === "a") { return { execute: () => { const newOffset = ctx.cursor.isAtEnd() ? ctx.cursor.offset : ctx.cursor.right().offset; @@ -722703,138 +645269,138 @@ function handleNormalInput(input11, count4, ctx) { } }; } - if (input11 === "A") { + if (input === "A") { return { execute: () => ctx.enterInsert(ctx.cursor.endOfLogicalLine().offset) }; } - if (input11 === "o") { + if (input === "o") { return { execute: () => executeOpenLine("below", ctx) }; } - if (input11 === "O") { + if (input === "O") { return { execute: () => executeOpenLine("above", ctx) }; } return null; } -function handleOperatorInput(op, count4, input11, ctx) { - if (isTextObjScopeKey(input11)) { +function handleOperatorInput(op, count4, input, ctx) { + if (isTextObjScopeKey(input)) { return { next: { type: "operatorTextObj", op, count: count4, - scope: TEXT_OBJ_SCOPES[input11] + scope: TEXT_OBJ_SCOPES[input] } }; } - if (FIND_KEYS.has(input11)) { + if (FIND_KEYS.has(input)) { return { - next: { type: "operatorFind", op, count: count4, find: input11 } + next: { type: "operatorFind", op, count: count4, find: input } }; } - if (SIMPLE_MOTIONS.has(input11)) { - return { execute: () => executeOperatorMotion(op, input11, count4, ctx) }; + if (SIMPLE_MOTIONS.has(input)) { + return { execute: () => executeOperatorMotion(op, input, count4, ctx) }; } - if (input11 === "G") { + if (input === "G") { return { execute: () => executeOperatorG(op, count4, ctx) }; } - if (input11 === "g") { + if (input === "g") { return { next: { type: "operatorG", op, count: count4 } }; } return null; } -function fromIdle(input11, ctx) { - if (/[1-9]/.test(input11)) { - return { next: { type: "count", digits: input11 } }; +function fromIdle(input, ctx) { + if (/[1-9]/.test(input)) { + return { next: { type: "count", digits: input } }; } - if (input11 === "0") { + if (input === "0") { return { execute: () => ctx.setOffset(ctx.cursor.startOfLogicalLine().offset) }; } - const result3 = handleNormalInput(input11, 1, ctx); - if (result3) - return result3; + const result2 = handleNormalInput(input, 1, ctx); + if (result2) + return result2; return {}; } -function fromCount(state2, input11, ctx) { - if (/[0-9]/.test(input11)) { - const newDigits = state2.digits + input11; +function fromCount(state2, input, ctx) { + if (/[0-9]/.test(input)) { + const newDigits = state2.digits + input; const count5 = Math.min(parseInt(newDigits, 10), MAX_VIM_COUNT); return { next: { type: "count", digits: String(count5) } }; } const count4 = parseInt(state2.digits, 10); - const result3 = handleNormalInput(input11, count4, ctx); - if (result3) - return result3; + const result2 = handleNormalInput(input, count4, ctx); + if (result2) + return result2; return { next: { type: "idle" } }; } -function fromOperator(state2, input11, ctx) { - if (input11 === state2.op[0]) { +function fromOperator(state2, input, ctx) { + if (input === state2.op[0]) { return { execute: () => executeLineOp(state2.op, state2.count, ctx) }; } - if (/[0-9]/.test(input11)) { + if (/[0-9]/.test(input)) { return { next: { type: "operatorCount", op: state2.op, count: state2.count, - digits: input11 + digits: input } }; } - const result3 = handleOperatorInput(state2.op, state2.count, input11, ctx); - if (result3) - return result3; + const result2 = handleOperatorInput(state2.op, state2.count, input, ctx); + if (result2) + return result2; return { next: { type: "idle" } }; } -function fromOperatorCount(state2, input11, ctx) { - if (/[0-9]/.test(input11)) { - const newDigits = state2.digits + input11; +function fromOperatorCount(state2, input, ctx) { + if (/[0-9]/.test(input)) { + const newDigits = state2.digits + input; const parsedDigits = Math.min(parseInt(newDigits, 10), MAX_VIM_COUNT); return { next: { ...state2, digits: String(parsedDigits) } }; } const motionCount = parseInt(state2.digits, 10); const effectiveCount = state2.count * motionCount; - const result3 = handleOperatorInput(state2.op, effectiveCount, input11, ctx); - if (result3) - return result3; + const result2 = handleOperatorInput(state2.op, effectiveCount, input, ctx); + if (result2) + return result2; return { next: { type: "idle" } }; } -function fromOperatorFind(state2, input11, ctx) { +function fromOperatorFind(state2, input, ctx) { return { - execute: () => executeOperatorFind(state2.op, state2.find, input11, state2.count, ctx) + execute: () => executeOperatorFind(state2.op, state2.find, input, state2.count, ctx) }; } -function fromOperatorTextObj(state2, input11, ctx) { - if (TEXT_OBJ_TYPES.has(input11)) { +function fromOperatorTextObj(state2, input, ctx) { + if (TEXT_OBJ_TYPES.has(input)) { return { - execute: () => executeOperatorTextObj(state2.op, state2.scope, input11, state2.count, ctx) + execute: () => executeOperatorTextObj(state2.op, state2.scope, input, state2.count, ctx) }; } return { next: { type: "idle" } }; } -function fromFind(state2, input11, ctx) { +function fromFind(state2, input, ctx) { return { execute: () => { - const result3 = ctx.cursor.findCharacter(input11, state2.find, state2.count); - if (result3 !== null) { - ctx.setOffset(result3); - ctx.setLastFind(state2.find, input11); + const result2 = ctx.cursor.findCharacter(input, state2.find, state2.count); + if (result2 !== null) { + ctx.setOffset(result2); + ctx.setLastFind(state2.find, input); } } }; } -function fromG(state2, input11, ctx) { - if (input11 === "j" || input11 === "k") { +function fromG(state2, input, ctx) { + if (input === "j" || input === "k") { return { execute: () => { - const target = resolveMotion(`g${input11}`, ctx.cursor, state2.count); + const target = resolveMotion(`g${input}`, ctx.cursor, state2.count); ctx.setOffset(target.offset); } }; } - if (input11 === "g") { + if (input === "g") { if (state2.count > 1) { return { execute: () => { @@ -722842,8 +645408,8 @@ function fromG(state2, input11, ctx) { `); const targetLine = Math.min(state2.count - 1, lines.length - 1); let offset = 0; - for (let i4 = 0;i4 < targetLine; i4++) { - offset += (lines[i4]?.length ?? 0) + 1; + for (let i3 = 0;i3 < targetLine; i3++) { + offset += (lines[i3]?.length ?? 0) + 1; } ctx.setOffset(offset); } @@ -722855,34 +645421,34 @@ function fromG(state2, input11, ctx) { } return { next: { type: "idle" } }; } -function fromOperatorG(state2, input11, ctx) { - if (input11 === "j" || input11 === "k") { +function fromOperatorG(state2, input, ctx) { + if (input === "j" || input === "k") { return { - execute: () => executeOperatorMotion(state2.op, `g${input11}`, state2.count, ctx) + execute: () => executeOperatorMotion(state2.op, `g${input}`, state2.count, ctx) }; } - if (input11 === "g") { + if (input === "g") { return { execute: () => executeOperatorGg(state2.op, state2.count, ctx) }; } return { next: { type: "idle" } }; } -function fromReplace(state2, input11, ctx) { - if (input11 === "") +function fromReplace(state2, input, ctx) { + if (input === "") return { next: { type: "idle" } }; - return { execute: () => executeReplace(input11, state2.count, ctx) }; + return { execute: () => executeReplace(input, state2.count, ctx) }; } -function fromIndent(state2, input11, ctx) { - if (input11 === state2.dir) { +function fromIndent(state2, input, ctx) { + if (input === state2.dir) { return { execute: () => executeIndent(state2.dir, state2.count, ctx) }; } return { next: { type: "idle" } }; } -function executeRepeatFind(reverse3, count4, ctx) { +function executeRepeatFind(reverse2, count4, ctx) { const lastFind = ctx.getLastFind(); if (!lastFind) return; let findType = lastFind.type; - if (reverse3) { + if (reverse2) { const flipMap = { f: "F", F: "f", @@ -722891,14 +645457,14 @@ function executeRepeatFind(reverse3, count4, ctx) { }; findType = flipMap[findType]; } - const result3 = ctx.cursor.findCharacter(lastFind.char, findType, count4); - if (result3 !== null) { - ctx.setOffset(result3); + const result2 = ctx.cursor.findCharacter(lastFind.char, findType, count4); + if (result2 !== null) { + ctx.setOffset(result2); } } var init_transitions = __esm(() => { init_operators(); - init_types19(); + init_types18(); }); // src/hooks/useVimInput.ts @@ -723000,10 +645566,10 @@ function useVimInput(props) { function handleVimInput(rawInput, key) { const state2 = vimStateRef.current; const filtered = inputFilter ? inputFilter(rawInput, key) : rawInput; - const input11 = state2.mode === "INSERT" ? filtered : rawInput; + const input = state2.mode === "INSERT" ? filtered : rawInput; const cursor = Cursor.fromText(props.value, props.columns, textInput.offset); if (key.ctrl) { - textInput.onInput(input11, key); + textInput.onInput(input, key); return; } if (key.escape && state2.mode === "INSERT") { @@ -723015,7 +645581,7 @@ function useVimInput(props) { return; } if (key.return) { - textInput.onInput(input11, key); + textInput.onInput(input, key); return; } if (state2.mode === "INSERT") { @@ -723029,17 +645595,17 @@ function useVimInput(props) { } else { vimStateRef.current = { mode: "INSERT", - insertedText: state2.insertedText + input11 + insertedText: state2.insertedText + input }; } - textInput.onInput(input11, key); + textInput.onInput(input, key); return; } if (state2.mode !== "NORMAL") { return; } if (state2.command.type === "idle" && (key.upArrow || key.downArrow || key.leftArrow || key.rightArrow)) { - textInput.onInput(input11, key); + textInput.onInput(input, key); return; } const ctx = { @@ -723048,7 +645614,7 @@ function useVimInput(props) { onDotRepeat: replayLastChange }; const expectsMotion = state2.command.type === "idle" || state2.command.type === "count" || state2.command.type === "operator" || state2.command.type === "operatorCount"; - let vimInput = input11; + let vimInput = input; if (key.leftArrow) vimInput = "h"; else if (key.rightArrow) @@ -723061,18 +645627,18 @@ function useVimInput(props) { vimInput = "h"; else if (expectsMotion && state2.command.type !== "count" && key.delete) vimInput = "x"; - const result3 = transition(state2.command, vimInput, ctx); - if (result3.execute) { - result3.execute(); + const result2 = transition(state2.command, vimInput, ctx); + if (result2.execute) { + result2.execute(); } if (vimStateRef.current.mode === "NORMAL") { - if (result3.next) { - vimStateRef.current = { mode: "NORMAL", command: result3.next }; - } else if (result3.execute) { + if (result2.next) { + vimStateRef.current = { mode: "NORMAL", command: result2.next }; + } else if (result2.execute) { vimStateRef.current = { mode: "NORMAL", command: { type: "idle" } }; } } - if (input11 === "?" && state2.mode === "NORMAL" && state2.command.type === "idle") { + if (input === "?" && state2.mode === "NORMAL" && state2.command.type === "idle") { props.onChange("?"); } } @@ -723099,7 +645665,7 @@ var init_useVimInput = __esm(() => { init_intl(); init_operators(); init_transitions(); - init_types19(); + init_types18(); init_useTextInput(); }); @@ -723236,8 +645802,8 @@ function VimTextInput(props) { } return t19; } -function _temp205(text2) { - return text2; +function _temp205(text) { + return text; } var import_compiler_runtime335, import_react256, jsx_dev_runtime436; var init_VimTextInput = __esm(() => { @@ -723402,14 +645968,14 @@ function StatusLineInner({ previousStateRef.current.exceeds200kTokens = exceeds200kTokens; } const statusInput = buildStatusLineCommandInput(permissionModeRef.current, exceeds200kTokens, settingsRef.current, msgs, Array.from(addedDirsRef.current.keys()), mainLoopModelRef.current, vimModeRef.current); - const text2 = await executeStatusLineCommand(statusInput, controller.signal, undefined, logResult2); + const text = await executeStatusLineCommand(statusInput, controller.signal, undefined, logResult2); if (!controller.signal.aborted) { setAppState((prev) => { - if (prev.statusLineText === text2) + if (prev.statusLineText === text) return prev; return { ...prev, - statusLineText: text2 + statusLineText: text }; }); } @@ -723511,12 +646077,12 @@ var init_StatusLine = __esm(() => { init_debug(); init_fullscreen(); init_hooks5(); - init_messages5(); + init_messages3(); init_model(); init_sessionStorage(); init_tokens(); init_worktree(); - init_utils11(); + init_utils10(); jsx_dev_runtime437 = __toESM(require_jsx_dev_runtime(), 1); StatusLine = import_react257.memo(StatusLineInner); }); @@ -723533,7 +646099,7 @@ function calculateHorizontalScrollWindow(itemWidths, availableWidth, arrowWidth, }; } const clampedSelected = Math.max(0, Math.min(selectedIdx, totalItems - 1)); - const totalWidth = itemWidths.reduce((sum3, w) => sum3 + w, 0); + const totalWidth = itemWidths.reduce((sum2, w) => sum2 + w, 0); if (totalWidth <= availableWidth) { return { startIndex: 0, @@ -723543,8 +646109,8 @@ function calculateHorizontalScrollWindow(itemWidths, availableWidth, arrowWidth, }; } const cumulativeWidths = [0]; - for (let i4 = 0;i4 < totalItems; i4++) { - cumulativeWidths.push(cumulativeWidths[i4] + itemWidths[i4]); + for (let i3 = 0;i3 < totalItems; i3++) { + cumulativeWidths.push(cumulativeWidths[i3] + itemWidths[i3]); } function rangeWidth(start, end) { const baseWidth = cumulativeWidths[end] - cumulativeWidths[start]; @@ -723868,10 +646434,10 @@ function _temp164(pill_0, i_0) { const pillText = `@${pill_0.name}`; return stringWidth(pillText) + (i_0 > 0 ? 1 : 0); } -function _temp09(pill, i4) { +function _temp09(pill, i3) { return { ...pill, - idx: i4 + idx: i3 }; } function _temp917(a_0, b_0) { @@ -724370,19 +646936,19 @@ function usePrStatus(isLoading, enabled = true) { return; } const start = Date.now(); - const result3 = await fetchPrStatus(); + const result2 = await fetchPrStatus(); if (cancelled) return; lastFetchRef.current = start; setPrStatus((prev) => { - const newNumber = result3?.number ?? null; - const newReviewState = result3?.reviewState ?? null; + const newNumber = result2?.number ?? null; + const newReviewState = result2?.reviewState ?? null; if (prev.number === newNumber && prev.reviewState === newReviewState) { return prev; } return { number: newNumber, - url: result3?.url ?? null, + url: result2?.url ?? null, reviewState: newReviewState, lastUpdated: Date.now() }; @@ -724438,12 +647004,12 @@ function ProactiveCountdown() { setRemainingSeconds(null); return; } - const update3 = function update() { + const update2 = function update() { const remaining = Math.max(0, Math.ceil((nextTickAt - Date.now()) / 1000)); setRemainingSeconds(remaining); }; - update3(); - const interval = setInterval(update3, 1000); + update2(); + const interval = setInterval(update2, 1000); return () => clearInterval(interval); }; t1 = [nextTickAt]; @@ -724926,7 +647492,7 @@ var init_PromptInputFooterLeftSide = __esm(() => { init_ink2(); init_figures(); import_react260 = __toESM(require_react(), 1); - init_utils11(); + init_utils10(); init_useShortcutDisplay(); init_PermissionMode(); init_BackgroundTaskStatus(); @@ -725311,8 +647877,8 @@ function PromptInputQueuedCommandsImpl() { return /* @__PURE__ */ jsx_dev_runtime444.jsxDEV(ThemedBox_default, { marginTop: 1, flexDirection: "column", - children: messages.map((message, i4) => /* @__PURE__ */ jsx_dev_runtime444.jsxDEV(QueuedMessageProvider, { - isFirst: i4 === 0, + children: messages.map((message, i3) => /* @__PURE__ */ jsx_dev_runtime444.jsxDEV(QueuedMessageProvider, { + isFirst: i3 === 0, useBriefLayout, children: /* @__PURE__ */ jsx_dev_runtime444.jsxDEV(Message, { message, @@ -725328,7 +647894,7 @@ function PromptInputQueuedCommandsImpl() { isTranscriptMode: false, isStatic: true }, undefined, false, undefined, this) - }, i4, false, undefined, this)) + }, i3, false, undefined, this)) }, undefined, false, undefined, this); } var React141, import_react262, jsx_dev_runtime444, EMPTY_SET2, MAX_VISIBLE_NOTIFICATIONS = 3, PromptInputQueuedCommands; @@ -725342,7 +647908,7 @@ var init_PromptInputQueuedCommands = __esm(() => { init_QueuedMessageContext(); init_useCommandQueue(); init_messageQueueManager(); - init_messages5(); + init_messages3(); init_slowOperations(); init_Message(); jsx_dev_runtime444 = __toESM(require_jsx_dev_runtime(), 1); @@ -725386,18 +647952,18 @@ var init_PromptInputStashNotice = __esm(() => { }); // src/components/PromptInput/inputPaste.ts -function maybeTruncateMessageForInput(text2, nextPasteId) { - if (text2.length <= TRUNCATION_THRESHOLD) { +function maybeTruncateMessageForInput(text, nextPasteId) { + if (text.length <= TRUNCATION_THRESHOLD) { return { - truncatedText: text2, + truncatedText: text, placeholderContent: "" }; } const startLength = Math.floor(PREVIEW_LENGTH / 2); const endLength = Math.floor(PREVIEW_LENGTH / 2); - const startText = text2.slice(0, startLength); - const endText = text2.slice(-endLength); - const placeholderContent = text2.slice(startLength, -endLength); + const startText = text.slice(0, startLength); + const endText = text.slice(-endLength); + const placeholderContent = text.slice(startLength, -endLength); const truncatedLines = getPastedTextRefNumLines(placeholderContent); const placeholderId = nextPasteId; const placeholderRef = formatTruncatedTextRef(placeholderId, truncatedLines); @@ -725410,12 +647976,12 @@ function maybeTruncateMessageForInput(text2, nextPasteId) { function formatTruncatedTextRef(id, numLines) { return `[...Truncated text #${id} +${numLines} lines...]`; } -function maybeTruncateInput(input11, pastedContents) { +function maybeTruncateInput(input, pastedContents) { const existingIds = Object.keys(pastedContents).map(Number); const nextPasteId = existingIds.length > 0 ? Math.max(...existingIds) + 1 : 1; - const { truncatedText, placeholderContent } = maybeTruncateMessageForInput(input11, nextPasteId); + const { truncatedText, placeholderContent } = maybeTruncateMessageForInput(input, nextPasteId); if (!placeholderContent) { - return { newInput: input11, newPastedContents: pastedContents }; + return { newInput: input, newPastedContents: pastedContents }; } return { newInput: truncatedText, @@ -725436,7 +648002,7 @@ var init_inputPaste = __esm(() => { // src/components/PromptInput/useMaybeTruncateInput.ts function useMaybeTruncateInput({ - input: input11, + input, pastedContents, onInputChange, setCursorOffset, @@ -725447,16 +648013,16 @@ function useMaybeTruncateInput({ if (hasAppliedTruncationToInput) { return; } - if (input11.length <= 1e4) { + if (input.length <= 1e4) { return; } - const { newInput, newPastedContents } = maybeTruncateInput(input11, pastedContents); + const { newInput, newPastedContents } = maybeTruncateInput(input, pastedContents); onInputChange(newInput); setCursorOffset(newInput.length); setPastedContents(newPastedContents); setHasAppliedTruncationToInput(true); }, [ - input11, + input, hasAppliedTruncationToInput, pastedContents, onInputChange, @@ -725464,10 +648030,10 @@ function useMaybeTruncateInput({ setCursorOffset ]); import_react263.useEffect(() => { - if (input11 === "") { + if (input === "") { setHasAppliedTruncationToInput(false); } - }, [input11]); + }, [input]); } var import_react263; var init_useMaybeTruncateInput = __esm(() => { @@ -725476,8 +648042,8 @@ var init_useMaybeTruncateInput = __esm(() => { }); // src/utils/exampleCommands.ts -function isCoreFile(path28) { - return !NON_CORE_PATTERNS.some((p) => p.test(path28)); +function isCoreFile(path23) { + return !NON_CORE_PATTERNS.some((p) => p.test(path23)); } function pickDiverseCoreFiles(sortedPaths, want) { const picked = []; @@ -725541,8 +648107,8 @@ async function getFrequentlyModifiedFiles() { } const sorted = Array.from(counts.entries()).sort((a2, b) => b[1] - a2[1]).map(([p]) => p); return pickDiverseCoreFiles(sorted, 5); - } catch (err3) { - logError2(err3); + } catch (err2) { + logError2(err2); return []; } } @@ -725586,17 +648152,17 @@ var init_exampleCommands = __esm(() => { }); refreshExampleCommands = memoize_default(async () => { const projectConfig = getCurrentProjectConfig(); - const now3 = Date.now(); + const now2 = Date.now(); const lastGenerated = projectConfig.exampleFilesGeneratedAt ?? 0; - if (now3 - lastGenerated > ONE_WEEK_IN_MS) { + if (now2 - lastGenerated > ONE_WEEK_IN_MS) { projectConfig.exampleFiles = []; } if (!projectConfig.exampleFiles?.length) { - getFrequentlyModifiedFiles().then((files3) => { - if (files3.length) { + getFrequentlyModifiedFiles().then((files2) => { + if (files2.length) { saveCurrentProjectConfig((current) => ({ ...current, - exampleFiles: files3, + exampleFiles: files2, exampleFilesGeneratedAt: Date.now() })); } @@ -725607,14 +648173,14 @@ var init_exampleCommands = __esm(() => { // src/components/PromptInput/usePromptInputPlaceholder.ts function usePromptInputPlaceholder({ - input: input11, + input, submitCount, viewingAgentName }) { const queuedCommands = useCommandQueue(); const promptSuggestionEnabled = useAppState((s) => s.promptSuggestionEnabled); const placeholder = import_react264.useMemo(() => { - if (input11 !== "") { + if (input !== "") { return; } if (viewingAgentName) { @@ -725628,7 +648194,7 @@ function usePromptInputPlaceholder({ return getExampleCommandFromCache(); } }, [ - input11, + input, queuedCommands, submitCount, promptSuggestionEnabled, @@ -725770,7 +648336,7 @@ var init_useSwarmBanner = __esm(() => { }); // src/components/PromptInput/PromptInput.tsx -import * as path28 from "path"; +import * as path23 from "path"; function PromptInput({ debug: debug3, ideSelection, @@ -725784,7 +648350,7 @@ function PromptInput({ messages, onAutoUpdaterResult, autoUpdaterResult, - input: input11, + input, onInputChange, mode, onModeChange, @@ -725821,11 +648387,11 @@ function PromptInput({ const [exitMessage, setExitMessage] = import_react266.useState({ show: false }); - const [cursorOffset, setCursorOffset] = import_react266.useState(input11.length); - const lastInternalInputRef = React143.useRef(input11); - if (input11 !== lastInternalInputRef.current) { - setCursorOffset(input11.length); - lastInternalInputRef.current = input11; + const [cursorOffset, setCursorOffset] = import_react266.useState(input.length); + const lastInternalInputRef = React143.useRef(input); + if (input !== lastInternalInputRef.current) { + setCursorOffset(input.length); + lastInternalInputRef.current = input; } const trackAndSetInput = React143.useCallback((value) => { lastInternalInputRef.current = value; @@ -725834,10 +648400,10 @@ function PromptInput({ if (insertTextRef) { insertTextRef.current = { cursorOffset, - insert: (text2) => { - const needsSpace = cursorOffset === input11.length && input11.length > 0 && !/\s$/.test(input11); - const insertText = needsSpace ? " " + text2 : text2; - const newValue = input11.slice(0, cursorOffset) + insertText + input11.slice(cursorOffset); + insert: (text) => { + const needsSpace = cursorOffset === input.length && input.length > 0 && !/\s$/.test(input); + const insertText = needsSpace ? " " + text : text; + const newValue = input.slice(0, cursorOffset) + insertText + input.slice(cursorOffset); lastInternalInputRef.current = newValue; onInputChange(newValue); setCursorOffset(cursorOffset + insertText.length); @@ -725903,7 +648469,7 @@ function PromptInput({ } = useHistorySearch((entry) => { setPastedContents(entry.pastedContents); onSubmit(entry.display); - }, input11, trackAndSetInput, setCursorOffset, cursorOffset, onModeChange, mode, isSearchingHistory, setIsSearchingHistory, setPastedContents, pastedContents); + }, input, trackAndSetInput, setCursorOffset, cursorOffset, onModeChange, mode, isSearchingHistory, setIsSearchingHistory, setPastedContents, pastedContents); const nextPasteIdRef = import_react266.useRef(-1); if (nextPasteIdRef.current === -1) { nextPasteIdRef.current = getInitialPasteId(messages); @@ -725944,21 +648510,21 @@ function PromptInput({ const [previousModeBeforeAuto, setPreviousModeBeforeAuto] = import_react266.useState(null); const autoModeOptInTimeoutRef = import_react266.useRef(null); const isCursorOnFirstLine = import_react266.useMemo(() => { - const firstNewlineIndex = input11.indexOf(` + const firstNewlineIndex = input.indexOf(` `); if (firstNewlineIndex === -1) { return true; } return cursorOffset <= firstNewlineIndex; - }, [input11, cursorOffset]); + }, [input, cursorOffset]); const isCursorOnLastLine = import_react266.useMemo(() => { - const lastNewlineIndex = input11.lastIndexOf(` + const lastNewlineIndex = input.lastIndexOf(` `); if (lastNewlineIndex === -1) { return true; } return cursorOffset > lastNewlineIndex; - }, [input11, cursorOffset]); + }, [input, cursorOffset]); const cachedTeams = import_react266.useMemo(() => { if (!isAgentSwarmsEnabled()) return []; @@ -726023,10 +648589,10 @@ function PromptInput({ logOutcomeAtSubmission, markShown } = usePromptSuggestion({ - inputValue: input11, + inputValue: input, isAssistantResponding: isLoading }); - const displayedValue = import_react266.useMemo(() => isSearchingHistory && historyMatch ? getValueFromInput(typeof historyMatch === "string" ? historyMatch : historyMatch.display) : input11, [isSearchingHistory, historyMatch, input11]); + const displayedValue = import_react266.useMemo(() => isSearchingHistory && historyMatch ? getValueFromInput(typeof historyMatch === "string" ? historyMatch : historyMatch.display) : input, [isSearchingHistory, historyMatch, input]); const thinkTriggers = import_react266.useMemo(() => findThinkingTriggerPositions(displayedValue), [displayedValue]); const ultraplanSessionUrl = useAppState((s) => s.ultraplanSessionUrl); const ultraplanLaunching = useAppState((s) => s.ultraplanLaunching); @@ -726159,12 +648725,12 @@ function PromptInput({ } if (isUltrathinkEnabled()) { for (const trigger of thinkTriggers) { - for (let i4 = trigger.start;i4 < trigger.end; i4++) { + for (let i3 = trigger.start;i3 < trigger.end; i3++) { highlights.push({ - start: i4, - end: i4 + 1, - color: getRainbowColor(i4 - trigger.start), - shimmerColor: getRainbowColor(i4 - trigger.start, true), + start: i3, + end: i3 + 1, + color: getRainbowColor(i3 - trigger.start), + shimmerColor: getRainbowColor(i3 - trigger.start, true), priority: 10 }); } @@ -726172,35 +648738,35 @@ function PromptInput({ } if (feature("ULTRAPLAN")) { for (const trigger of ultraplanTriggers) { - for (let i4 = trigger.start;i4 < trigger.end; i4++) { + for (let i3 = trigger.start;i3 < trigger.end; i3++) { highlights.push({ - start: i4, - end: i4 + 1, - color: getRainbowColor(i4 - trigger.start), - shimmerColor: getRainbowColor(i4 - trigger.start, true), + start: i3, + end: i3 + 1, + color: getRainbowColor(i3 - trigger.start), + shimmerColor: getRainbowColor(i3 - trigger.start, true), priority: 10 }); } } } for (const trigger of ultrareviewTriggers) { - for (let i4 = trigger.start;i4 < trigger.end; i4++) { + for (let i3 = trigger.start;i3 < trigger.end; i3++) { highlights.push({ - start: i4, - end: i4 + 1, - color: getRainbowColor(i4 - trigger.start), - shimmerColor: getRainbowColor(i4 - trigger.start, true), + start: i3, + end: i3 + 1, + color: getRainbowColor(i3 - trigger.start), + shimmerColor: getRainbowColor(i3 - trigger.start, true), priority: 10 }); } } for (const trigger of buddyTriggers) { - for (let i4 = trigger.start;i4 < trigger.end; i4++) { + for (let i3 = trigger.start;i3 < trigger.end; i3++) { highlights.push({ - start: i4, - end: i4 + 1, - color: getRainbowColor(i4 - trigger.start), - shimmerColor: getRainbowColor(i4 - trigger.start, true), + start: i3, + end: i3 + 1, + color: getRainbowColor(i3 - trigger.start), + shimmerColor: getRainbowColor(i3 - trigger.start, true), priority: 10 }); } @@ -726245,15 +648811,15 @@ function PromptInput({ }); } }, [addNotification, ultrareviewTriggers.length]); - const prevInputLengthRef = import_react266.useRef(input11.length); - const peakInputLengthRef = import_react266.useRef(input11.length); + const prevInputLengthRef = import_react266.useRef(input.length); + const peakInputLengthRef = import_react266.useRef(input.length); const dismissStashHint = import_react266.useCallback(() => { removeNotification("stash-hint"); }, [removeNotification]); import_react266.useEffect(() => { const prevLength = prevInputLengthRef.current; const peakLength = peakInputLengthRef.current; - const currentLength = input11.length; + const currentLength = input.length; prevInputLengthRef.current = currentLength; if (currentLength > peakLength) { peakInputLengthRef.current = currentLength; @@ -726266,8 +648832,8 @@ function PromptInput({ const clearedSubstantialInput = peakLength >= 20 && currentLength <= 5; const wasRapidClear = prevLength >= 20 && currentLength <= 5; if (clearedSubstantialInput && !wasRapidClear) { - const config6 = getGlobalConfig(); - if (!config6.hasUsedStash) { + const config4 = getGlobalConfig(); + if (!config4.hasUsedStash) { addNotification({ key: "stash-hint", jsx: /* @__PURE__ */ jsx_dev_runtime446.jsxDEV(ThemedText, { @@ -726289,7 +648855,7 @@ function PromptInput({ } peakInputLengthRef.current = currentLength; } - }, [input11.length, addNotification]); + }, [input.length, addNotification]); const { pushToBuffer, undo, @@ -726300,14 +648866,14 @@ function PromptInput({ debounceMs: 1000 }); useMaybeTruncateInput({ - input: input11, + input, pastedContents, onInputChange: trackAndSetInput, setCursorOffset, setPastedContents }); const defaultPlaceholder = usePromptInputPlaceholder({ - input: input11, + input, submitCount, viewingAgentName }); @@ -726321,7 +648887,7 @@ function PromptInput({ dismissStashHint(); abortPromptSuggestion(); abortSpeculation(setAppState); - const isSingleCharInsertion = value.length === input11.length + 1; + const isSingleCharInsertion = value.length === input.length + 1; const insertedAtStart = cursorOffset === 0; const mode2 = getModeFromInput(value); if (insertedAtStart && mode2 !== "prompt") { @@ -726329,25 +648895,25 @@ function PromptInput({ onModeChange(mode2); return; } - if (input11.length === 0) { + if (input.length === 0) { onModeChange(mode2); const valueWithoutMode = getValueFromInput(value).replaceAll("\t", " "); - pushToBuffer(input11, cursorOffset, pastedContents); + pushToBuffer(input, cursorOffset, pastedContents); trackAndSetInput(valueWithoutMode); setCursorOffset(valueWithoutMode.length); return; } } const processedValue = value.replaceAll("\t", " "); - if (input11 !== processedValue) { - pushToBuffer(input11, cursorOffset, pastedContents); + if (input !== processedValue) { + pushToBuffer(input, cursorOffset, pastedContents); } setAppState((prev) => prev.footerSelection === null ? prev : { ...prev, footerSelection: null }); trackAndSetInput(processedValue); - }, [trackAndSetInput, onModeChange, input11, cursorOffset, pushToBuffer, pastedContents, dismissStashHint, setAppState]); + }, [trackAndSetInput, onModeChange, input, cursorOffset, pushToBuffer, pastedContents, dismissStashHint, setAppState]); const { resetHistory, onHistoryUp, @@ -726358,7 +648924,7 @@ function PromptInput({ onChange(value); onModeChange(historyMode); setPastedContents(pastedContents2); - }, input11, pastedContents, setCursorOffset, mode); + }, input, pastedContents, setCursorOffset, mode); import_react266.useEffect(() => { if (isSearchingHistory) { dismissSearchHint(); @@ -726441,11 +649007,11 @@ function PromptInput({ if (isAgentSwarmsEnabled()) { const directMessage = parseDirectMemberMessage(inputParam); if (directMessage) { - const result3 = await sendDirectMemberMessage(directMessage.recipientName, directMessage.message, teamContext, writeToMailbox); - if (result3.success) { + const result2 = await sendDirectMemberMessage(directMessage.recipientName, directMessage.message, teamContext, writeToMailbox); + if (result2.success) { addNotification({ key: "direct-message-sent", - text: `Sent to @${result3.recipientName}`, + text: `Sent to @${result2.recipientName}`, priority: "immediate", timeoutMs: 3000 }); @@ -726454,7 +649020,7 @@ function PromptInput({ clearBuffer(); resetHistory(); return; - } else if (result3.error === "no_team_context") {} else {} + } else if (result2.error === "no_team_context") {} else {} } } if (inputParam.trim() === "" && !hasImages) { @@ -726496,7 +649062,7 @@ function PromptInput({ onInputChange: trackAndSetInput, onSubmit, setCursorOffset, - input: input11, + input, cursorOffset, mode, agents: agents2, @@ -726547,7 +649113,7 @@ function PromptInput({ pendingSpaceAfterPillRef.current = true; } import_react266.useEffect(() => { - const referencedIds = new Set(parseReferences(input11).map((r) => r.id)); + const referencedIds = new Set(parseReferences(input).map((r) => r.id)); setPastedContents((prev) => { const orphaned = Object.values(prev).filter((c6) => c6.type === "image" && !referencedIds.has(c6.id)); if (orphaned.length === 0) @@ -726559,26 +649125,26 @@ function PromptInput({ delete next[img.id]; return next; }); - }, [input11, setPastedContents]); + }, [input, setPastedContents]); function onTextPaste(rawText) { pendingSpaceAfterPillRef.current = false; - let text2 = stripAnsi(rawText).replace(/\r/g, ` + let text = stripAnsi(rawText).replace(/\r/g, ` `).replaceAll("\t", " "); - if (input11.length === 0) { - const pastedMode = getModeFromInput(text2); + if (input.length === 0) { + const pastedMode = getModeFromInput(text); if (pastedMode !== "prompt") { onModeChange(pastedMode); - text2 = getValueFromInput(text2); + text = getValueFromInput(text); } } - const numLines = getPastedTextRefNumLines(text2); + const numLines = getPastedTextRefNumLines(text); const maxLines = Math.min(rows - 10, 2); - if (text2.length > PASTE_THRESHOLD || numLines > maxLines) { + if (text.length > PASTE_THRESHOLD || numLines > maxLines) { const pasteId = nextPasteIdRef.current++; const newContent = { id: pasteId, type: "text", - content: text2 + content: text }; setPastedContents((prev) => ({ ...prev, @@ -726586,55 +649152,55 @@ function PromptInput({ })); insertTextAtCursor(formatPastedTextRef(pasteId, numLines)); } else { - insertTextAtCursor(text2); + insertTextAtCursor(text); } } - const lazySpaceInputFilter = import_react266.useCallback((input12, key) => { + const lazySpaceInputFilter = import_react266.useCallback((input2, key) => { if (!pendingSpaceAfterPillRef.current) - return input12; + return input2; pendingSpaceAfterPillRef.current = false; - if (isNonSpacePrintable(input12, key)) - return " " + input12; - return input12; + if (isNonSpacePrintable(input2, key)) + return " " + input2; + return input2; }, []); - function insertTextAtCursor(text2) { - pushToBuffer(input11, cursorOffset, pastedContents); - const newInput = input11.slice(0, cursorOffset) + text2 + input11.slice(cursorOffset); + function insertTextAtCursor(text) { + pushToBuffer(input, cursorOffset, pastedContents); + const newInput = input.slice(0, cursorOffset) + text + input.slice(cursorOffset); trackAndSetInput(newInput); - setCursorOffset(cursorOffset + text2.length); + setCursorOffset(cursorOffset + text.length); } const doublePressEscFromEmpty = useDoublePress(() => {}, () => onShowMessageSelector()); const popAllCommandsFromQueue = import_react266.useCallback(() => { - const result3 = popAllEditable(input11, cursorOffset); - if (!result3) { + const result2 = popAllEditable(input, cursorOffset); + if (!result2) { return false; } - trackAndSetInput(result3.text); + trackAndSetInput(result2.text); onModeChange("prompt"); - setCursorOffset(result3.cursorOffset); - if (result3.images.length > 0) { + setCursorOffset(result2.cursorOffset); + if (result2.images.length > 0) { setPastedContents((prev) => { const newContents = { ...prev }; - for (const image of result3.images) { + for (const image of result2.images) { newContents[image.id] = image; } return newContents; }); } return true; - }, [trackAndSetInput, onModeChange, input11, cursorOffset, setPastedContents]); + }, [trackAndSetInput, onModeChange, input, cursorOffset, setPastedContents]); const onIdeAtMentioned = function(atMentioned) { logEvent("tengu_ext_at_mentioned", {}); let atMentionedText; - const relativePath2 = path28.relative(getCwd(), atMentioned.filePath); + const relativePath2 = path23.relative(getCwd(), atMentioned.filePath); if (atMentioned.lineStart && atMentioned.lineEnd) { atMentionedText = atMentioned.lineStart === atMentioned.lineEnd ? `@${relativePath2}#L${atMentioned.lineStart} ` : `@${relativePath2}#L${atMentioned.lineStart}-${atMentioned.lineEnd} `; } else { atMentionedText = `@${relativePath2} `; } - const cursorChar = input11[cursorOffset - 1] ?? " "; + const cursorChar = input[cursorOffset - 1] ?? " "; if (!/\s/.test(cursorChar)) { atMentionedText = ` ${atMentionedText}`; } @@ -726652,53 +649218,53 @@ function PromptInput({ } }, [canUndo, undo, trackAndSetInput, setPastedContents]); const handleNewline = import_react266.useCallback(() => { - pushToBuffer(input11, cursorOffset, pastedContents); - const newInput = input11.slice(0, cursorOffset) + ` -` + input11.slice(cursorOffset); + pushToBuffer(input, cursorOffset, pastedContents); + const newInput = input.slice(0, cursorOffset) + ` +` + input.slice(cursorOffset); trackAndSetInput(newInput); setCursorOffset(cursorOffset + 1); - }, [input11, cursorOffset, trackAndSetInput, setCursorOffset, pushToBuffer, pastedContents]); + }, [input, cursorOffset, trackAndSetInput, setCursorOffset, pushToBuffer, pastedContents]); const handleExternalEditor = import_react266.useCallback(async () => { logEvent("tengu_external_editor_used", {}); setIsExternalEditorActive(true); try { - const result3 = await editPromptInEditor(input11, pastedContents); - if (result3.error) { + const result2 = await editPromptInEditor(input, pastedContents); + if (result2.error) { addNotification({ key: "external-editor-error", - text: result3.error, + text: result2.error, color: "warning", priority: "high" }); } - if (result3.content !== null && result3.content !== input11) { - pushToBuffer(input11, cursorOffset, pastedContents); - trackAndSetInput(result3.content); - setCursorOffset(result3.content.length); + if (result2.content !== null && result2.content !== input) { + pushToBuffer(input, cursorOffset, pastedContents); + trackAndSetInput(result2.content); + setCursorOffset(result2.content.length); } - } catch (err3) { - if (err3 instanceof Error) { - logError2(err3); + } catch (err2) { + if (err2 instanceof Error) { + logError2(err2); } addNotification({ key: "external-editor-error", - text: `External editor failed: ${errorMessage(err3)}`, + text: `External editor failed: ${errorMessage(err2)}`, color: "warning", priority: "high" }); } finally { setIsExternalEditorActive(false); } - }, [input11, cursorOffset, pastedContents, pushToBuffer, trackAndSetInput, addNotification]); + }, [input, cursorOffset, pastedContents, pushToBuffer, trackAndSetInput, addNotification]); const handleStash = import_react266.useCallback(() => { - if (input11.trim() === "" && stashedPrompt !== undefined) { + if (input.trim() === "" && stashedPrompt !== undefined) { trackAndSetInput(stashedPrompt.text); setCursorOffset(stashedPrompt.cursorOffset); setPastedContents(stashedPrompt.pastedContents); setStashedPrompt(undefined); - } else if (input11.trim() !== "") { + } else if (input.trim() !== "") { setStashedPrompt({ - text: input11, + text: input, cursorOffset, pastedContents }); @@ -726714,7 +649280,7 @@ function PromptInput({ }; }); } - }, [input11, cursorOffset, stashedPrompt, trackAndSetInput, setStashedPrompt, pastedContents, setPastedContents]); + }, [input, cursorOffset, stashedPrompt, trackAndSetInput, setStashedPrompt, pastedContents, setPastedContents]); const handleModelPicker = import_react266.useCallback(() => { setShowModelPicker((prev) => !prev); if (helpOpen) { @@ -726914,10 +649480,10 @@ function PromptInput({ action: "chat:submit", context: "Chat", handler: () => { - onSubmit(input11); + onSubmit(input); } }); - }, [keybindingContext, isModalOverlayActive, onSubmit, input11]); + }, [keybindingContext, isModalOverlayActive, onSubmit, input]); const chatHandlers = import_react266.useMemo(() => ({ "chat:undo": handleUndo, "chat:newline": handleNewline, @@ -727066,13 +649632,13 @@ function PromptInput({ if (!task) return false; if (viewSelectionMode === "viewing-agent" && task.id === viewingAgentTaskId) { - onChange(input11.slice(0, cursorOffset) + "x" + input11.slice(cursorOffset)); + onChange(input.slice(0, cursorOffset) + "x" + input.slice(cursorOffset)); setCursorOffset(cursorOffset + 1); return; } stopOrDismissAgent(task.id, setAppState); if (task.status !== "running") { - setCoordinatorTaskIndex((i4) => Math.max(minCoordinatorIndex, i4 - 1)); + setCoordinatorTaskIndex((i3) => Math.max(minCoordinatorIndex, i3 - 1)); } return; } @@ -727120,7 +649686,7 @@ function PromptInput({ }); } if (footerItemSelected && char && !key.ctrl && !key.meta && !key.escape && !key.return) { - onChange(input11.slice(0, cursorOffset) + char + input11.slice(cursorOffset)); + onChange(input.slice(0, cursorOffset) + char + input.slice(cursorOffset)); setCursorOffset(cursorOffset + char.length); return; } @@ -727128,7 +649694,7 @@ function PromptInput({ onModeChange("prompt"); setHelpOpen(false); } - if (helpOpen && input11 === "" && (key.backspace || key.delete)) { + if (helpOpen && input === "" && (key.backspace || key.delete)) { setHelpOpen(false); } if (key.escape) { @@ -727152,7 +649718,7 @@ function PromptInput({ popAllCommandsFromQueue(); return; } - if (messages.length > 0 && !input11 && !isLoading) { + if (messages.length > 0 && !input && !isLoading) { doublePressEscFromEmpty(); } } @@ -727186,20 +649752,20 @@ function PromptInput({ const textInputColumns = columns - 3 - companionReservedColumns(columns, companionSpeaking); const maxVisibleLines = isFullscreenEnvEnabled() ? Math.max(MIN_INPUT_VIEWPORT_LINES, Math.floor(rows / 2) - PROMPT_FOOTER_LINES) : undefined; const handleInputClick = import_react266.useCallback((e) => { - if (!input11 || isSearchingHistory) + if (!input || isSearchingHistory) return; - const c6 = Cursor.fromText(input11, textInputColumns, cursorOffset); + const c6 = Cursor.fromText(input, textInputColumns, cursorOffset); const viewportStart = c6.getViewportStartLine(maxVisibleLines); const offset = c6.measuredText.getOffsetFromPosition({ line: e.localRow + viewportStart, column: e.localCol }); setCursorOffset(offset); - }, [input11, textInputColumns, isSearchingHistory, cursorOffset, maxVisibleLines]); + }, [input, textInputColumns, isSearchingHistory, cursorOffset, maxVisibleLines]); const handleOpenTasksDialog = import_react266.useCallback((taskId) => setShowBashesDialog(taskId ?? true), [setShowBashesDialog]); const placeholder = showPromptSuggestion && promptSuggestion ? promptSuggestion : defaultPlaceholder; - const isInputWrapped = import_react266.useMemo(() => input11.includes(` -`), [input11]); + const isInputWrapped = import_react266.useMemo(() => input.includes(` +`), [input]); const handleModelSelect = import_react266.useCallback((model, _effort) => { let wasFastModeDisabled = false; setAppState((prev) => { @@ -727253,13 +649819,13 @@ function PromptInput({ }, undefined, false, undefined, this) }, undefined, false, undefined, this); }, [showModelPicker, mainLoopModel_, mainLoopModelForSession, handleModelSelect, handleModelCancel]); - const handleFastModeSelect = import_react266.useCallback((result3) => { + const handleFastModeSelect = import_react266.useCallback((result2) => { setShowFastModePicker(false); - if (result3) { + if (result2) { addNotification({ key: "fast-mode-toggled", jsx: /* @__PURE__ */ jsx_dev_runtime446.jsxDEV(ThemedText, { - children: result3 + children: result2 }, undefined, false, undefined, this), priority: "immediate", timeoutMs: 3000 @@ -727339,9 +649905,9 @@ function PromptInput({ }, undefined, false, undefined, this); } if (feature("QUICK_SEARCH")) { - const insertWithSpacing = (text2) => { - const cursorChar = input11[cursorOffset - 1] ?? " "; - insertTextAtCursor(/\s/.test(cursorChar) ? text2 : ` ${text2}`); + const insertWithSpacing = (text) => { + const cursorChar = input[cursorOffset - 1] ?? " "; + insertTextAtCursor(/\s/.test(cursorChar) ? text : ` ${text}`); }; if (showQuickOpen) { return /* @__PURE__ */ jsx_dev_runtime446.jsxDEV(QuickOpenDialog, { @@ -727358,7 +649924,7 @@ function PromptInput({ } if (feature("HISTORY_PICKER") && showHistoryPicker) { return /* @__PURE__ */ jsx_dev_runtime446.jsxDEV(HistorySearchDialog, { - initialQuery: input11, + initialQuery: input, onSelect: (entry) => { const entryMode = getModeFromInput(entry.display); const value = getValueFromInput(entry.display); @@ -727392,7 +649958,7 @@ function PromptInput({ multiline: true, onSubmit, onChange, - value: historyMatch ? getValueFromInput(typeof historyMatch === "string" ? historyMatch : historyMatch.display) : input11, + value: historyMatch ? getValueFromInput(typeof historyMatch === "string" ? historyMatch : historyMatch.display) : input, onHistoryUp: handleHistoryUp, onHistoryDown: handleHistoryDown, onHistoryReset: resetHistory, @@ -727568,7 +650134,7 @@ function PromptInput({ maxColumnWidth, toolPermissionContext: effectiveToolPermissionContext, helpOpen, - suppressHint: input11.length > 0, + suppressHint: input.length > 0, isLoading, tasksSelected, teamsSelected, @@ -727748,7 +650314,7 @@ var init_PromptInput = __esm(() => { init_usePromptInputPlaceholder(); init_useShowFastIconHint(); init_useSwarmBanner(); - init_utils11(); + init_utils10(); jsx_dev_runtime446 = __toESM(require_jsx_dev_runtime(), 1); PromptInput_default = React143.memo(PromptInput); }); @@ -727813,9 +650379,9 @@ class SessionsWebSocket { this.handleMessage(data); }); ws.addEventListener("error", () => { - const err3 = new Error("[SessionsWebSocket] WebSocket error"); - logError2(err3); - this.callbacks.onError?.(err3); + const err2 = new Error("[SessionsWebSocket] WebSocket error"); + logError2(err2); + this.callbacks.onError?.(err2); }); ws.addEventListener("close", (event) => { logForDebugging(`[SessionsWebSocket] Closed: code=${event.code} reason=${event.reason}`); @@ -727843,9 +650409,9 @@ class SessionsWebSocket { ws.on("message", (data) => { this.handleMessage(data.toString()); }); - ws.on("error", (err3) => { - logError2(new Error(`[SessionsWebSocket] Error: ${err3.message}`)); - this.callbacks.onError?.(err3); + ws.on("error", (err2) => { + logError2(new Error(`[SessionsWebSocket] Error: ${err2.message}`)); + this.callbacks.onError?.(err2); }); ws.on("close", (code, reason) => { logForDebugging(`[SessionsWebSocket] Closed: code=${code} reason=${reason.toString()}`); @@ -727864,8 +650430,8 @@ class SessionsWebSocket { } else { logForDebugging(`[SessionsWebSocket] Ignoring message type: ${typeof message === "object" && message !== null && "type" in message ? String(message.type) : "unknown"}`); } - } catch (error46) { - logError2(new Error(`[SessionsWebSocket] Failed to parse message: ${errorMessage(error46)}`)); + } catch (error42) { + logError2(new Error(`[SessionsWebSocket] Failed to parse message: ${errorMessage(error42)}`)); } } handleClose(closeCode) { @@ -727899,13 +650465,13 @@ class SessionsWebSocket { this.callbacks.onClose?.(); } } - scheduleReconnect(delay3, label) { + scheduleReconnect(delay2, label) { this.callbacks.onReconnecting?.(); - logForDebugging(`[SessionsWebSocket] Scheduling reconnect (${label}) in ${delay3}ms`); + logForDebugging(`[SessionsWebSocket] Scheduling reconnect (${label}) in ${delay2}ms`); this.reconnectTimer = setTimeout(() => { this.reconnectTimer = null; this.connect(); - }, delay3); + }, delay2); } startPingInterval() { this.stopPingInterval(); @@ -727995,8 +650561,8 @@ class RemoteSessionManager { callbacks; websocket = null; pendingPermissionRequests = new Map; - constructor(config6, callbacks) { - this.config = config6; + constructor(config4, callbacks) { + this.config = config4; this.callbacks = callbacks; } connect() { @@ -728015,9 +650581,9 @@ class RemoteSessionManager { logForDebugging("[RemoteSessionManager] Reconnecting"); this.callbacks.onReconnecting?.(); }, - onError: (error46) => { - logError2(error46); - this.callbacks.onError?.(error46); + onError: (error42) => { + logError2(error42); + this.callbacks.onError?.(error42); } }; this.websocket = new SessionsWebSocket(this.config.sessionId, this.config.orgUuid, this.config.getAccessToken, wsCallbacks); @@ -728071,7 +650637,7 @@ class RemoteSessionManager { } return success2; } - respondToPermissionRequest(requestId, result3) { + respondToPermissionRequest(requestId, result2) { const pendingRequest = this.pendingPermissionRequests.get(requestId); if (!pendingRequest) { logError2(new Error(`[RemoteSessionManager] No pending permission request with ID: ${requestId}`)); @@ -728084,12 +650650,12 @@ class RemoteSessionManager { subtype: "success", request_id: requestId, response: { - behavior: result3.behavior, - ...result3.behavior === "allow" ? { updatedInput: result3.updatedInput } : { message: result3.message } + behavior: result2.behavior, + ...result2.behavior === "allow" ? { updatedInput: result2.updatedInput } : { message: result2.message } } } }; - logForDebugging(`[RemoteSessionManager] Sending permission response: ${result3.behavior}`); + logForDebugging(`[RemoteSessionManager] Sending permission response: ${result2.behavior}`); this.websocket?.sendControlResponse(response); } isConnected() { @@ -728169,8 +650735,8 @@ function createToolStub(toolName) { inputSchema: {}, isEnabled: () => true, userFacingName: () => toolName, - renderToolUseMessage: (input11) => { - const entries = Object.entries(input11); + renderToolUseMessage: (input) => { + const entries = Object.entries(input); if (entries.length === 0) return ""; return entries.slice(0, 3).map(([key, value]) => { @@ -728208,13 +650774,13 @@ function convertStreamEvent(msg) { }; } function convertResultMessage(msg) { - const isError3 = msg.subtype !== "success"; - const content = isError3 ? msg.errors?.join(", ") || "Unknown error" : "Session completed successfully"; + const isError2 = msg.subtype !== "success"; + const content = isError2 ? msg.errors?.join(", ") || "Unknown error" : "Session completed successfully"; return { type: "system", subtype: "informational", content, - level: isError3 ? "warning" : "info", + level: isError2 ? "warning" : "info", uuid: msg.uuid, timestamp: new Date().toISOString() }; @@ -728343,12 +650909,12 @@ function isSessionEndMessage(msg) { var init_sdkMessageAdapter = __esm(() => { init_debug(); init_mappers(); - init_messages5(); + init_messages3(); }); // src/hooks/useRemoteSession.ts function useRemoteSession({ - config: config6, + config: config4, setMessages, setIsLoading, onInit, @@ -728358,7 +650924,7 @@ function useRemoteSession({ setStreamMode, setInProgressToolUseIDs }) { - const isRemoteMode = !!config6; + const isRemoteMode = !!config4; const setAppState = useSetAppState(); const setConnStatus = import_react267.useCallback((s) => setAppState((prev) => prev.remoteConnectionStatus === s ? prev : { ...prev, remoteConnectionStatus: s }), [setAppState]); const runningTaskIdsRef = import_react267.useRef(new Set); @@ -728376,11 +650942,11 @@ function useRemoteSession({ toolsRef.current = tools; }, [tools]); import_react267.useEffect(() => { - if (!config6) { + if (!config4) { return; } - logForDebugging(`[useRemoteSession] Initializing for session ${config6.sessionId}`); - const manager = new RemoteSessionManager(config6, { + logForDebugging(`[useRemoteSession] Initializing for session ${config4.sessionId}`); + const manager = new RemoteSessionManager(config4, { onMessage: (sdkMessage) => { const parts = [`type=${sdkMessage.type}`]; if ("subtype" in sdkMessage) @@ -728450,7 +651016,7 @@ function useRemoteSession({ } } } - const converted = convertSDKMessage(sdkMessage, config6.viewerOnly ? { convertToolResults: true, convertUserTextMessages: true } : undefined); + const converted = convertSDKMessage(sdkMessage, config4.viewerOnly ? { convertToolResults: true, convertUserTextMessages: true } : undefined); if (converted.type === "message") { setStreamingToolUses?.((prev) => prev.length > 0 ? [] : prev); if (setInProgressToolUseIDs && converted.message.type === "assistant") { @@ -728549,8 +651115,8 @@ function useRemoteSession({ writeTaskCount(); setInProgressToolUseIDs?.((prev) => prev.size > 0 ? new Set : prev); }, - onError: (error46) => { - logForDebugging(`[useRemoteSession] Error: ${error46.message}`); + onError: (error42) => { + logForDebugging(`[useRemoteSession] Error: ${error42.message}`); } }); managerRef.current = manager; @@ -728565,7 +651131,7 @@ function useRemoteSession({ managerRef.current = null; }; }, [ - config6, + config4, setMessages, setIsLoading, onInit, @@ -728593,9 +651159,9 @@ function useRemoteSession({ setIsLoading(false); return false; } - if (!hasUpdatedTitleRef.current && config6 && !config6.hasInitialPrompt && !config6.viewerOnly) { + if (!hasUpdatedTitleRef.current && config4 && !config4.hasInitialPrompt && !config4.viewerOnly) { hasUpdatedTitleRef.current = true; - const sessionId = config6.sessionId; + const sessionId = config4.sessionId; const description = typeof content === "string" ? content : extractTextContent(content, " "); if (description) { generateSessionTitle(description, new AbortController().signal).then((title) => { @@ -728603,7 +651169,7 @@ function useRemoteSession({ }); } } - if (!config6?.viewerOnly) { + if (!config4?.viewerOnly) { const timeoutMs = isCompactingRef.current ? COMPACTION_TIMEOUT_MS : RESPONSE_TIMEOUT_MS; responseTimeoutRef.current = setTimeout((setMessages2, manager2) => { logForDebugging("[useRemoteSession] Response timeout - attempting reconnect"); @@ -728613,17 +651179,17 @@ function useRemoteSession({ }, timeoutMs, setMessages, manager); } return success2; - }, [config6, setIsLoading, setMessages]); + }, [config4, setIsLoading, setMessages]); const cancelRequest = import_react267.useCallback(() => { if (responseTimeoutRef.current) { clearTimeout(responseTimeoutRef.current); responseTimeoutRef.current = null; } - if (!config6?.viewerOnly) { + if (!config4?.viewerOnly) { managerRef.current?.cancelSession(); } setIsLoading(false); - }, [config6, setIsLoading]); + }, [config4, setIsLoading]); const disconnect2 = import_react267.useCallback(() => { if (responseTimeoutRef.current) { clearTimeout(responseTimeoutRef.current); @@ -728645,7 +651211,7 @@ var init_useRemoteSession = __esm(() => { init_Tool(); init_debug(); init_format(); - init_messages5(); + init_messages3(); init_sessionTitle(); init_api2(); }); @@ -728659,8 +651225,8 @@ class DirectConnectSessionManager { ws = null; config; callbacks; - constructor(config6, callbacks) { - this.config = config6; + constructor(config4, callbacks) { + this.config = config4; this.callbacks = callbacks; } connect() { @@ -728726,7 +651292,7 @@ class DirectConnectSessionManager { this.ws.send(message); return true; } - respondToPermissionRequest(requestId, result3) { + respondToPermissionRequest(requestId, result2) { if (!this.ws || this.ws.readyState !== WebSocket.OPEN) { return; } @@ -728736,8 +651302,8 @@ class DirectConnectSessionManager { subtype: "success", request_id: requestId, response: { - behavior: result3.behavior, - ...result3.behavior === "allow" ? { updatedInput: result3.updatedInput } : { message: result3.message } + behavior: result2.behavior, + ...result2.behavior === "allow" ? { updatedInput: result2.updatedInput } : { message: result2.message } } } }); @@ -728756,7 +651322,7 @@ class DirectConnectSessionManager { }); this.ws.send(request); } - sendErrorResponse(requestId, error46) { + sendErrorResponse(requestId, error42) { if (!this.ws || this.ws.readyState !== WebSocket.OPEN) { return; } @@ -728765,7 +651331,7 @@ class DirectConnectSessionManager { response: { subtype: "error", request_id: requestId, - error: error46 + error: error42 } }); this.ws.send(response); @@ -728787,13 +651353,13 @@ var init_directConnectManager = __esm(() => { // src/hooks/useDirectConnect.ts function useDirectConnect({ - config: config6, + config: config4, setMessages, setIsLoading, setToolUseConfirmQueue, tools }) { - const isRemoteMode = !!config6; + const isRemoteMode = !!config4; const managerRef = import_react268.useRef(null); const hasReceivedInitRef = import_react268.useRef(false); const isConnectedRef = import_react268.useRef(false); @@ -728802,12 +651368,12 @@ function useDirectConnect({ toolsRef.current = tools; }, [tools]); import_react268.useEffect(() => { - if (!config6) { + if (!config4) { return; } hasReceivedInitRef.current = false; - logForDebugging(`[useDirectConnect] Connecting to ${config6.wsUrl}`); - const manager = new DirectConnectSessionManager(config6, { + logForDebugging(`[useDirectConnect] Connecting to ${config4.wsUrl}`); + const manager = new DirectConnectSessionManager(config4, { onMessage: (sdkMessage) => { if (isSessionEndMessage(sdkMessage)) { setIsLoading(false); @@ -728883,7 +651449,7 @@ function useDirectConnect({ logForDebugging("[useDirectConnect] Disconnected"); if (!isConnectedRef.current) { process.stderr.write(` -Failed to connect to server at ${config6.wsUrl} +Failed to connect to server at ${config4.wsUrl} `); } else { process.stderr.write(` @@ -728894,8 +651460,8 @@ Server disconnected. gracefulShutdown(1); setIsLoading(false); }, - onError: (error46) => { - logForDebugging(`[useDirectConnect] Error: ${error46.message}`); + onError: (error42) => { + logForDebugging(`[useDirectConnect] Error: ${error42.message}`); } }); managerRef.current = manager; @@ -728905,7 +651471,7 @@ Server disconnected. manager.disconnect(); managerRef.current = null; }; - }, [config6, setMessages, setIsLoading, setToolUseConfirmQueue]); + }, [config4, setMessages, setIsLoading, setToolUseConfirmQueue]); const sendMessage3 = import_react268.useCallback(async (content) => { const manager = managerRef.current; if (!manager) { @@ -729000,14 +651566,14 @@ function useSSHSession({ behavior: "deny", message: "User aborted" }); - setToolUseConfirmQueue((q) => q.filter((i4) => i4.toolUseID !== request.tool_use_id)); + setToolUseConfirmQueue((q) => q.filter((i3) => i3.toolUseID !== request.tool_use_id)); }, onAllow(updatedInput) { manager.respondToPermissionRequest(requestId, { behavior: "allow", updatedInput }); - setToolUseConfirmQueue((q) => q.filter((i4) => i4.toolUseID !== request.tool_use_id)); + setToolUseConfirmQueue((q) => q.filter((i3) => i3.toolUseID !== request.tool_use_id)); setIsLoading(true); }, onReject(feedback2) { @@ -729015,7 +651581,7 @@ function useSSHSession({ behavior: "deny", message: feedback2 ?? "User denied permission" }); - setToolUseConfirmQueue((q) => q.filter((i4) => i4.toolUseID !== request.tool_use_id)); + setToolUseConfirmQueue((q) => q.filter((i3) => i3.toolUseID !== request.tool_use_id)); }, async recheckPermission() {} }; @@ -729026,14 +651592,14 @@ function useSSHSession({ logForDebugging("[useSSHSession] connected"); isConnectedRef.current = true; }, - onReconnecting: (attempt3, max5) => { - logForDebugging(`[useSSHSession] ssh dropped, reconnecting (${attempt3}/${max5})`); + onReconnecting: (attempt2, max3) => { + logForDebugging(`[useSSHSession] ssh dropped, reconnecting (${attempt2}/${max3})`); isConnectedRef.current = false; setIsLoading(false); const msg = { type: "system", subtype: "informational", - content: `SSH connection dropped — reconnecting (attempt ${attempt3}/${max5})...`, + content: `SSH connection dropped — reconnecting (attempt ${attempt2}/${max3})...`, timestamp: new Date().toISOString(), uuid: randomUUID46(), level: "warning" @@ -729055,8 +651621,8 @@ ${stderr}`; } gracefulShutdown(1, "other", { finalMessage: msg }); }, - onError: (error46) => { - logForDebugging(`[useSSHSession] error: ${error46.message}`); + onError: (error42) => { + logForDebugging(`[useSSHSession] error: ${error42.message}`); } }); managerRef.current = manager; @@ -729154,23 +651720,23 @@ function pageToMessages(page) { return out; } function useAssistantHistory({ - config: config6, + config: config4, setMessages, scrollRef, onPrepend }) { - const enabled = config6?.viewerOnly === true; + const enabled = config4?.viewerOnly === true; const cursorRef = import_react270.useRef(undefined); const ctxRef = import_react270.useRef(null); const inflightRef = import_react270.useRef(false); const anchorRef = import_react270.useRef(null); const fillBudgetRef = import_react270.useRef(0); const sentinelUuidRef = import_react270.useRef(randomUUID47()); - function mkSentinel(text2) { + function mkSentinel(text) { return { type: "system", subtype: "informational", - content: text2, + content: text, isMeta: false, timestamp: new Date().toISOString(), uuid: sentinelUuidRef.current, @@ -729192,11 +651758,11 @@ function useAssistantHistory({ logForDebugging(`[useAssistantHistory] ${isInitial ? "initial" : "older"} page: ${msgs.length} msgs (raw ${page.events.length}), hasMore=${page.hasMore}`); }, [setMessages]); import_react270.useEffect(() => { - if (!enabled || !config6) + if (!enabled || !config4) return; let cancelled = false; (async () => { - const ctx = await createHistoryAuthCtx(config6.sessionId).catch(() => null); + const ctx = await createHistoryAuthCtx(config4.sessionId).catch(() => null); if (!ctx || cancelled) return; ctxRef.current = ctx; @@ -729287,7 +651853,7 @@ function useDebouncedDigitInput({ isValidDigit, onDigit, enabled = true, - once: once11 = false, + once: once10 = false, debounceMs = DEFAULT_DEBOUNCE_MS }) { const initialInputValue = import_react271.useRef(inputValue); @@ -729296,7 +651862,7 @@ function useDebouncedDigitInput({ const callbacksRef = import_react271.useRef({ setInputValue, isValidDigit, onDigit }); callbacksRef.current = { setInputValue, isValidDigit, onDigit }; import_react271.useEffect(() => { - if (!enabled || once11 && hasTriggeredRef.current) { + if (!enabled || once10 && hasTriggeredRef.current) { return; } if (debounceRef.current !== null) { @@ -729321,7 +651887,7 @@ function useDebouncedDigitInput({ debounceRef.current = null; } }; - }, [inputValue, enabled, once11, debounceMs]); + }, [inputValue, enabled, once10, debounceMs]); } var import_react271, DEFAULT_DEBOUNCE_MS = 400; var init_useDebouncedDigitInput = __esm(() => { @@ -729485,7 +652051,7 @@ function FeedbackSurveyView(t0) { } return t10; } -var import_compiler_runtime342, jsx_dev_runtime447, RESPONSE_INPUTS, inputToResponse, isValidResponseInput = (input11) => RESPONSE_INPUTS.includes(input11), DEFAULT_MESSAGE = "How is Claude doing this session? (optional)"; +var import_compiler_runtime342, jsx_dev_runtime447, RESPONSE_INPUTS, inputToResponse, isValidResponseInput = (input) => RESPONSE_INPUTS.includes(input), DEFAULT_MESSAGE = "How is Claude doing this session? (optional)"; var init_FeedbackSurveyView = __esm(() => { import_compiler_runtime342 = __toESM(require_compiler_runtime(), 1); init_ink2(); @@ -729514,20 +652080,20 @@ var init_SkillImprovementSurvey = __esm(() => { // src/utils/hooks/apiQueryHookHelper.ts import { randomUUID as randomUUID48 } from "crypto"; -function createApiQueryHook(config6) { +function createApiQueryHook(config4) { return async (context2) => { try { - const shouldRun = await config6.shouldRun(context2); + const shouldRun = await config4.shouldRun(context2); if (!shouldRun) { return; } - const uuid8 = randomUUID48(); - const messages = config6.buildMessages(context2); + const uuid5 = randomUUID48(); + const messages = config4.buildMessages(context2); context2.queryMessageCount = messages.length; - const systemPrompt = config6.systemPrompt ? asSystemPrompt([config6.systemPrompt]) : context2.systemPrompt; - const useTools = config6.useTools ?? true; + const systemPrompt = config4.systemPrompt ? asSystemPrompt([config4.systemPrompt]) : context2.systemPrompt; + const useTools = config4.useTools ?? true; const tools = useTools ? context2.toolUseContext.options.tools : []; - const model = config6.getModel(context2); + const model = config4.getModel(context2); const response = await queryModelWithoutStreaming({ messages, systemPrompt, @@ -729545,32 +652111,32 @@ function createApiQueryHook(config6) { hasAppendSystemPrompt: !!context2.toolUseContext.options.appendSystemPrompt, temperatureOverride: 0, agents: context2.toolUseContext.options.agentDefinitions.activeAgents, - querySource: config6.name, + querySource: config4.name, mcpTools: [], agentId: context2.toolUseContext.agentId } }); const content = extractTextContent(response.message.content).trim(); try { - const result3 = config6.parseResponse(content, context2); - config6.logResult({ + const result2 = config4.parseResponse(content, context2); + config4.logResult({ type: "success", - queryName: config6.name, - result: result3, + queryName: config4.name, + result: result2, messageId: response.message.id, model, - uuid: uuid8 + uuid: uuid5 }, context2); - } catch (error46) { - config6.logResult({ + } catch (error42) { + config4.logResult({ type: "error", - queryName: config6.name, - error: error46, - uuid: uuid8 + queryName: config4.name, + error: error42, + uuid: uuid5 }, context2); } - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); } }; } @@ -729579,7 +652145,7 @@ var init_apiQueryHookHelper = __esm(() => { init_abortController(); init_log3(); init_errors(); - init_messages5(); + init_messages3(); }); // src/utils/hooks/skillImprovement.ts @@ -729589,9 +652155,9 @@ function formatRecentMessages(messages) { const content = m.message.content; if (typeof content === "string") return `${role}: ${content.slice(0, 500)}`; - const text2 = content.filter((b) => b.type === "text").map((b) => b.text).join(` + const text = content.filter((b) => b.type === "text").map((b) => b.text).join(` `); - return `${role}: ${text2.slice(0, 500)}`; + return `${role}: ${text.slice(0, 500)}`; }).join(` `); @@ -729608,7 +652174,7 @@ function findProjectSkill() { function createSkillImprovementHook() { let lastAnalyzedCount = 0; let lastAnalyzedIndex = 0; - const config6 = { + const config4 = { name: "skill_improvement", async shouldRun(context2) { if (context2.querySource !== "repl_main_thread") { @@ -729668,26 +652234,26 @@ Output [] if no updates are needed.` return []; } }, - logResult(result3, context2) { - if (result3.type === "success" && result3.result.length > 0) { + logResult(result2, context2) { + if (result2.type === "success" && result2.result.length > 0) { const projectSkill = findProjectSkill(); const skillName = projectSkill?.skillName ?? "unknown"; logEvent("tengu_skill_improvement_detected", { - updateCount: result3.result.length, - uuid: result3.uuid, + updateCount: result2.result.length, + uuid: result2.uuid, _PROTO_skill_name: skillName }); context2.toolUseContext.setAppState((prev) => ({ ...prev, skillImprovement: { - suggestion: { skillName, updates: result3.result } + suggestion: { skillName, updates: result2.result } } })); } }, getModel: getSmallFastModel }; - return createApiQueryHook(config6); + return createApiQueryHook(config4); } function initSkillImprovement() { if (feature("SKILL_IMPROVEMENT") && getFeatureValue_CACHED_MAY_BE_STALE("tengu_copper_panda", false)) { @@ -729697,12 +652263,12 @@ function initSkillImprovement() { async function applySkillImprovement(skillName, updates) { if (!skillName) return; - const { join: join165 } = await import("path"); - const fs12 = await import("fs/promises"); - const filePath = join165(getCwd(), ".claude", "skills", skillName, "SKILL.md"); + const { join: join155 } = await import("path"); + const fs6 = await import("fs/promises"); + const filePath = join155(getCwd(), ".claude", "skills", skillName, "SKILL.md"); let currentContent; try { - currentContent = await fs12.readFile(filePath, "utf-8"); + currentContent = await fs6.readFile(filePath, "utf-8"); } catch { logError2(new Error(`Failed to read skill file for improvement: ${filePath}`)); return; @@ -729755,7 +652321,7 @@ Rules: return; } try { - await fs12.writeFile(filePath, updatedContent, "utf-8"); + await fs6.writeFile(filePath, updatedContent, "utf-8"); } catch (e) { logError2(toError(e)); } @@ -729772,7 +652338,7 @@ var init_skillImprovement = __esm(() => { init_cwd2(); init_errors(); init_log3(); - init_messages5(); + init_messages3(); init_model(); init_slowOperations(); init_apiQueryHookHelper(); @@ -729840,7 +652406,7 @@ var init_useSkillImprovementSurvey = __esm(() => { init_analytics(); init_AppState(); init_skillImprovement(); - init_messages5(); + init_messages3(); }); // src/moreright/useMoreRight.tsx @@ -729903,7 +652469,7 @@ var require_commonjs = __commonJS((exports) => { var SIGNAL = Symbol("signal"); var DATALISTENERS = Symbol("dataListeners"); var DISCARDED = Symbol("discarded"); - var defer3 = (fn) => Promise.resolve().then(fn); + var defer2 = (fn) => Promise.resolve().then(fn); var nodefer = (fn) => fn(); var isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; var isArrayBufferLike = (b) => b instanceof ArrayBuffer || !!b && typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; @@ -730035,7 +652601,7 @@ var require_commonjs = __commonJS((exports) => { return this[ABORTED]; } set aborted(_) {} - write(chunk4, encoding, cb) { + write(chunk3, encoding, cb) { if (this[ABORTED]) return false; if (this[EOF]) @@ -730050,13 +652616,13 @@ var require_commonjs = __commonJS((exports) => { } if (!encoding) encoding = "utf8"; - const fn = this[ASYNC] ? defer3 : nodefer; - if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk4)) { - if (isArrayBufferView2(chunk4)) { - chunk4 = Buffer.from(chunk4.buffer, chunk4.byteOffset, chunk4.byteLength); - } else if (isArrayBufferLike(chunk4)) { - chunk4 = Buffer.from(chunk4); - } else if (typeof chunk4 !== "string") { + const fn = this[ASYNC] ? defer2 : nodefer; + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk3)) { + if (isArrayBufferView2(chunk3)) { + chunk3 = Buffer.from(chunk3.buffer, chunk3.byteOffset, chunk3.byteLength); + } else if (isArrayBufferLike(chunk3)) { + chunk3 = Buffer.from(chunk3); + } else if (typeof chunk3 !== "string") { throw new Error("Non-contiguous data written to non-objectMode stream"); } } @@ -730064,34 +652630,34 @@ var require_commonjs = __commonJS((exports) => { if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true); if (this[FLOWING]) - this.emit("data", chunk4); + this.emit("data", chunk3); else - this[BUFFERPUSH](chunk4); + this[BUFFERPUSH](chunk3); if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) fn(cb); return this[FLOWING]; } - if (!chunk4.length) { + if (!chunk3.length) { if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) fn(cb); return this[FLOWING]; } - if (typeof chunk4 === "string" && !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) { - chunk4 = Buffer.from(chunk4, encoding); + if (typeof chunk3 === "string" && !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) { + chunk3 = Buffer.from(chunk3, encoding); } - if (Buffer.isBuffer(chunk4) && this[ENCODING]) { - chunk4 = this[DECODER].write(chunk4); + if (Buffer.isBuffer(chunk3) && this[ENCODING]) { + chunk3 = this[DECODER].write(chunk3); } if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true); if (this[FLOWING]) - this.emit("data", chunk4); + this.emit("data", chunk3); else - this[BUFFERPUSH](chunk4); + this[BUFFERPUSH](chunk3); if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) @@ -730117,39 +652683,39 @@ var require_commonjs = __commonJS((exports) => { this[MAYBE_EMIT_END](); return ret; } - [READ](n3, chunk4) { + [READ](n3, chunk3) { if (this[OBJECTMODE]) this[BUFFERSHIFT](); else { - const c6 = chunk4; + const c6 = chunk3; if (n3 === c6.length || n3 === null) this[BUFFERSHIFT](); else if (typeof c6 === "string") { this[BUFFER][0] = c6.slice(n3); - chunk4 = c6.slice(0, n3); + chunk3 = c6.slice(0, n3); this[BUFFERLENGTH] -= n3; } else { this[BUFFER][0] = c6.subarray(n3); - chunk4 = c6.subarray(0, n3); + chunk3 = c6.subarray(0, n3); this[BUFFERLENGTH] -= n3; } } - this.emit("data", chunk4); + this.emit("data", chunk3); if (!this[BUFFER].length && !this[EOF]) this.emit("drain"); - return chunk4; + return chunk3; } - end(chunk4, encoding, cb) { - if (typeof chunk4 === "function") { - cb = chunk4; - chunk4 = undefined; + end(chunk3, encoding, cb) { + if (typeof chunk3 === "function") { + cb = chunk3; + chunk3 = undefined; } if (typeof encoding === "function") { cb = encoding; encoding = "utf8"; } - if (chunk4 !== undefined) - this.write(chunk4, encoding); + if (chunk3 !== undefined) + this.write(chunk3, encoding); if (cb) this.once("end", cb); this[EOF] = true; @@ -730191,12 +652757,12 @@ var require_commonjs = __commonJS((exports) => { get paused() { return this[PAUSED]; } - [BUFFERPUSH](chunk4) { + [BUFFERPUSH](chunk3) { if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1; else - this[BUFFERLENGTH] += chunk4.length; - this[BUFFER].push(chunk4); + this[BUFFERLENGTH] += chunk3.length; + this[BUFFER].push(chunk3); } [BUFFERSHIFT]() { if (this[OBJECTMODE]) @@ -730210,8 +652776,8 @@ var require_commonjs = __commonJS((exports) => { if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit("drain"); } - [FLUSHCHUNK](chunk4) { - this.emit("data", chunk4); + [FLUSHCHUNK](chunk3) { + this.emit("data", chunk3); return this[FLOWING]; } pipe(dest, opts) { @@ -730231,7 +652797,7 @@ var require_commonjs = __commonJS((exports) => { } else { this[PIPES].push(!opts.proxyErrors ? new Pipe(this, dest, opts) : new PipeProxyErrors(this, dest, opts)); if (this[ASYNC]) - defer3(() => this[RESUME]()); + defer2(() => this[RESUME]()); else this[RESUME](); } @@ -730250,11 +652816,11 @@ var require_commonjs = __commonJS((exports) => { p.unpipe(); } } - addListener(ev, handler14) { - return this.on(ev, handler14); + addListener(ev, handler19) { + return this.on(ev, handler19); } - on(ev, handler14) { - const ret = super.on(ev, handler14); + on(ev, handler19) { + const ret = super.on(ev, handler19); if (ev === "data") { this[DISCARDED] = false; this[DATALISTENERS]++; @@ -730267,19 +652833,19 @@ var require_commonjs = __commonJS((exports) => { super.emit(ev); this.removeAllListeners(ev); } else if (ev === "error" && this[EMITTED_ERROR]) { - const h2 = handler14; + const h2 = handler19; if (this[ASYNC]) - defer3(() => h2.call(this, this[EMITTED_ERROR])); + defer2(() => h2.call(this, this[EMITTED_ERROR])); else h2.call(this, this[EMITTED_ERROR]); } return ret; } - removeListener(ev, handler14) { - return this.off(ev, handler14); + removeListener(ev, handler19) { + return this.off(ev, handler19); } - off(ev, handler14) { - const ret = super.off(ev, handler14); + off(ev, handler19) { + const ret = super.off(ev, handler19); if (ev === "data") { this[DATALISTENERS] = this.listeners("data").length; if (this[DATALISTENERS] === 0 && !this[DISCARDED] && !this[PIPES].length) { @@ -730317,7 +652883,7 @@ var require_commonjs = __commonJS((exports) => { if (ev !== "error" && ev !== "close" && ev !== DESTROYED && this[DESTROYED]) { return false; } else if (ev === "data") { - return !this[OBJECTMODE] && !data ? false : this[ASYNC] ? (defer3(() => this[EMITDATA](data)), true) : this[EMITDATA](data); + return !this[OBJECTMODE] && !data ? false : this[ASYNC] ? (defer2(() => this[EMITDATA](data)), true) : this[EMITDATA](data); } else if (ev === "end") { return this[EMITEND](); } else if (ev === "close") { @@ -730360,7 +652926,7 @@ var require_commonjs = __commonJS((exports) => { return false; this[EMITTED_END] = true; this.readable = false; - return this[ASYNC] ? (defer3(() => this[EMITEND2]()), true) : this[EMITEND2](); + return this[ASYNC] ? (defer2(() => this[EMITEND2]()), true) : this[EMITEND2](); } [EMITEND2]() { if (this[DECODER]) { @@ -730403,10 +652969,10 @@ var require_commonjs = __commonJS((exports) => { return this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength); } async promise() { - return new Promise((resolve47, reject3) => { - this.on(DESTROYED, () => reject3(new Error("stream destroyed"))); - this.on("error", (er) => reject3(er)); - this.on("end", () => resolve47()); + return new Promise((resolve41, reject2) => { + this.on(DESTROYED, () => reject2(new Error("stream destroyed"))); + this.on("error", (er) => reject2(er)); + this.on("end", () => resolve41()); }); } [Symbol.asyncIterator]() { @@ -730425,33 +652991,33 @@ var require_commonjs = __commonJS((exports) => { return Promise.resolve({ done: false, value: res }); if (this[EOF]) return stop(); - let resolve47; - let reject3; + let resolve41; + let reject2; const onerr = (er) => { this.off("data", ondata); this.off("end", onend); this.off(DESTROYED, ondestroy); stop(); - reject3(er); + reject2(er); }; const ondata = (value) => { this.off("error", onerr); this.off("end", onend); this.off(DESTROYED, ondestroy); this.pause(); - resolve47({ value, done: !!this[EOF] }); + resolve41({ value, done: !!this[EOF] }); }; const onend = () => { this.off("error", onerr); this.off("data", ondata); this.off(DESTROYED, ondestroy); stop(); - resolve47({ done: true, value: undefined }); + resolve41({ done: true, value: undefined }); }; const ondestroy = () => onerr(new Error("stream destroyed")); return new Promise((res2, rej) => { - reject3 = rej; - resolve47 = res2; + reject2 = rej; + resolve41 = res2; this.once(DESTROYED, ondestroy); this.once("error", onerr); this.once("end", onend); @@ -730538,27 +653104,27 @@ var require_minipass_collect = __commonJS((exports, module) => { this[_data] = []; this[_length3] = 0; } - write(chunk4, encoding, cb) { + write(chunk3, encoding, cb) { if (typeof encoding === "function") cb = encoding, encoding = "utf8"; if (!encoding) encoding = "utf8"; - const c6 = Buffer.isBuffer(chunk4) ? chunk4 : Buffer.from(chunk4, encoding); + const c6 = Buffer.isBuffer(chunk3) ? chunk3 : Buffer.from(chunk3, encoding); this[_data].push(c6); this[_length3] += c6.length; if (cb) cb(); return true; } - end(chunk4, encoding, cb) { - if (typeof chunk4 === "function") - cb = chunk4, chunk4 = null; + end(chunk3, encoding, cb) { + if (typeof chunk3 === "function") + cb = chunk3, chunk3 = null; if (typeof encoding === "function") cb = encoding, encoding = "utf8"; - if (chunk4) - this.write(chunk4, encoding); - const result3 = Buffer.concat(this[_data], this[_length3]); - super.write(result3); + if (chunk3) + this.write(chunk3, encoding); + const result2 = Buffer.concat(this[_data], this[_length3]); + super.write(result2); return super.end(cb); } } @@ -730570,25 +653136,25 @@ var require_minipass_collect = __commonJS((exports, module) => { this[_data] = []; this[_length3] = 0; } - write(chunk4, encoding, cb) { + write(chunk3, encoding, cb) { if (typeof encoding === "function") cb = encoding, encoding = "utf8"; if (!encoding) encoding = "utf8"; - const c6 = Buffer.isBuffer(chunk4) ? chunk4 : Buffer.from(chunk4, encoding); + const c6 = Buffer.isBuffer(chunk3) ? chunk3 : Buffer.from(chunk3, encoding); this[_data].push(c6); this[_length3] += c6.length; - return super.write(chunk4, encoding, cb); + return super.write(chunk3, encoding, cb); } - end(chunk4, encoding, cb) { - if (typeof chunk4 === "function") - cb = chunk4, chunk4 = null; + end(chunk3, encoding, cb) { + if (typeof chunk3 === "function") + cb = chunk3, chunk3 = null; if (typeof encoding === "function") cb = encoding, encoding = "utf8"; - if (chunk4) - this.write(chunk4, encoding); - const result3 = Buffer.concat(this[_data], this[_length3]); - this.emit("collect", result3); + if (chunk3) + this.write(chunk3, encoding); + const result2 = Buffer.concat(this[_data], this[_length3]); + this.emit("collect", result2); return super.end(cb); } } @@ -730602,7 +653168,7 @@ var require_minipass = __commonJS((exports, module) => { stderr: null }; var EE = __require("events"); - var Stream6 = __require("stream"); + var Stream4 = __require("stream"); var SD = __require("string_decoder").StringDecoder; var EOF = Symbol("EOF"); var MAYBE_EMIT_END = Symbol("maybeEmitEnd"); @@ -730627,12 +653193,12 @@ var require_minipass = __commonJS((exports, module) => { var EMITEND = Symbol("emitEnd"); var EMITEND2 = Symbol("emitEnd2"); var ASYNC = Symbol("async"); - var defer3 = (fn) => Promise.resolve().then(fn); + var defer2 = (fn) => Promise.resolve().then(fn); var doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== "1"; var ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented"); var ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented"); var isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; - var isArrayBuffer5 = (b) => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; + var isArrayBuffer4 = (b) => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; var isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); class Pipe { @@ -730665,7 +653231,7 @@ var require_minipass = __commonJS((exports, module) => { src.on("error", this.proxyErrors); } } - module.exports = class Minipass extends Stream6 { + module.exports = class Minipass extends Stream4 { constructor(options2) { super(); this[FLOWING] = false; @@ -730705,7 +653271,7 @@ var require_minipass = __commonJS((exports, module) => { if (this[ENCODING] !== enc) { this[DECODER] = enc ? new SD(enc) : null; if (this.buffer.length) - this.buffer = this.buffer.map((chunk4) => this[DECODER].write(chunk4)); + this.buffer = this.buffer.map((chunk3) => this[DECODER].write(chunk3)); } this[ENCODING] = enc; } @@ -730724,7 +653290,7 @@ var require_minipass = __commonJS((exports, module) => { set ["async"](a2) { this[ASYNC] = this[ASYNC] || !!a2; } - write(chunk4, encoding, cb) { + write(chunk3, encoding, cb) { if (this[EOF]) throw new Error("write after end"); if (this[DESTROYED]) { @@ -730735,46 +653301,46 @@ var require_minipass = __commonJS((exports, module) => { cb = encoding, encoding = "utf8"; if (!encoding) encoding = "utf8"; - const fn = this[ASYNC] ? defer3 : (f) => f(); - if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk4)) { - if (isArrayBufferView2(chunk4)) - chunk4 = Buffer.from(chunk4.buffer, chunk4.byteOffset, chunk4.byteLength); - else if (isArrayBuffer5(chunk4)) - chunk4 = Buffer.from(chunk4); - else if (typeof chunk4 !== "string") + const fn = this[ASYNC] ? defer2 : (f) => f(); + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk3)) { + if (isArrayBufferView2(chunk3)) + chunk3 = Buffer.from(chunk3.buffer, chunk3.byteOffset, chunk3.byteLength); + else if (isArrayBuffer4(chunk3)) + chunk3 = Buffer.from(chunk3); + else if (typeof chunk3 !== "string") this.objectMode = true; } if (this[OBJECTMODE]) { if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true); if (this.flowing) - this.emit("data", chunk4); + this.emit("data", chunk3); else - this[BUFFERPUSH](chunk4); + this[BUFFERPUSH](chunk3); if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) fn(cb); return this.flowing; } - if (!chunk4.length) { + if (!chunk3.length) { if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) fn(cb); return this.flowing; } - if (typeof chunk4 === "string" && !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { - chunk4 = Buffer.from(chunk4, encoding); + if (typeof chunk3 === "string" && !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { + chunk3 = Buffer.from(chunk3, encoding); } - if (Buffer.isBuffer(chunk4) && this[ENCODING]) - chunk4 = this[DECODER].write(chunk4); + if (Buffer.isBuffer(chunk3) && this[ENCODING]) + chunk3 = this[DECODER].write(chunk3); if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true); if (this.flowing) - this.emit("data", chunk4); + this.emit("data", chunk3); else - this[BUFFERPUSH](chunk4); + this[BUFFERPUSH](chunk3); if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) @@ -730800,26 +653366,26 @@ var require_minipass = __commonJS((exports, module) => { this[MAYBE_EMIT_END](); return ret; } - [READ](n3, chunk4) { - if (n3 === chunk4.length || n3 === null) + [READ](n3, chunk3) { + if (n3 === chunk3.length || n3 === null) this[BUFFERSHIFT](); else { - this.buffer[0] = chunk4.slice(n3); - chunk4 = chunk4.slice(0, n3); + this.buffer[0] = chunk3.slice(n3); + chunk3 = chunk3.slice(0, n3); this[BUFFERLENGTH] -= n3; } - this.emit("data", chunk4); + this.emit("data", chunk3); if (!this.buffer.length && !this[EOF]) this.emit("drain"); - return chunk4; + return chunk3; } - end(chunk4, encoding, cb) { - if (typeof chunk4 === "function") - cb = chunk4, chunk4 = null; + end(chunk3, encoding, cb) { + if (typeof chunk3 === "function") + cb = chunk3, chunk3 = null; if (typeof encoding === "function") cb = encoding, encoding = "utf8"; - if (chunk4) - this.write(chunk4, encoding); + if (chunk3) + this.write(chunk3, encoding); if (cb) this.once("end", cb); this[EOF] = true; @@ -730857,12 +653423,12 @@ var require_minipass = __commonJS((exports, module) => { get paused() { return this[PAUSED]; } - [BUFFERPUSH](chunk4) { + [BUFFERPUSH](chunk3) { if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1; else - this[BUFFERLENGTH] += chunk4.length; - this.buffer.push(chunk4); + this[BUFFERLENGTH] += chunk3.length; + this.buffer.push(chunk3); } [BUFFERSHIFT]() { if (this.buffer.length) { @@ -730878,8 +653444,8 @@ var require_minipass = __commonJS((exports, module) => { if (!noDrain && !this.buffer.length && !this[EOF]) this.emit("drain"); } - [FLUSHCHUNK](chunk4) { - return chunk4 ? (this.emit("data", chunk4), this.flowing) : false; + [FLUSHCHUNK](chunk3) { + return chunk3 ? (this.emit("data", chunk3), this.flowing) : false; } pipe(dest, opts) { if (this[DESTROYED]) @@ -730897,7 +653463,7 @@ var require_minipass = __commonJS((exports, module) => { } else { this.pipes.push(!opts.proxyErrors ? new Pipe(this, dest, opts) : new PipeProxyErrors(this, dest, opts)); if (this[ASYNC]) - defer3(() => this[RESUME]()); + defer2(() => this[RESUME]()); else this[RESUME](); } @@ -730924,7 +653490,7 @@ var require_minipass = __commonJS((exports, module) => { this.removeAllListeners(ev); } else if (ev === "error" && this[EMITTED_ERROR]) { if (this[ASYNC]) - defer3(() => fn.call(this, this[EMITTED_ERROR])); + defer2(() => fn.call(this, this[EMITTED_ERROR])); else fn.call(this, this[EMITTED_ERROR]); } @@ -730948,7 +653514,7 @@ var require_minipass = __commonJS((exports, module) => { if (ev !== "error" && ev !== "close" && ev !== DESTROYED && this[DESTROYED]) return; else if (ev === "data") { - return !data ? false : this[ASYNC] ? defer3(() => this[EMITDATA](data)) : this[EMITDATA](data); + return !data ? false : this[ASYNC] ? defer2(() => this[EMITDATA](data)) : this[EMITDATA](data); } else if (ev === "end") { return this[EMITEND](); } else if (ev === "close") { @@ -730991,7 +653557,7 @@ var require_minipass = __commonJS((exports, module) => { this[EMITTED_END] = true; this.readable = false; if (this[ASYNC]) - defer3(() => this[EMITEND2]()); + defer2(() => this[EMITEND2]()); else this[EMITEND2](); } @@ -731028,10 +653594,10 @@ var require_minipass = __commonJS((exports, module) => { return this[OBJECTMODE] ? Promise.reject(new Error("cannot concat in objectMode")) : this.collect().then((buf) => this[OBJECTMODE] ? Promise.reject(new Error("cannot concat in objectMode")) : this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength)); } promise() { - return new Promise((resolve47, reject3) => { - this.on(DESTROYED, () => reject3(new Error("stream destroyed"))); - this.on("error", (er) => reject3(er)); - this.on("end", () => resolve47()); + return new Promise((resolve41, reject2) => { + this.on(DESTROYED, () => reject2(new Error("stream destroyed"))); + this.on("error", (er) => reject2(er)); + this.on("end", () => resolve41()); }); } [ASYNCITERATOR]() { @@ -731041,28 +653607,28 @@ var require_minipass = __commonJS((exports, module) => { return Promise.resolve({ done: false, value: res }); if (this[EOF]) return Promise.resolve({ done: true }); - let resolve47 = null; - let reject3 = null; + let resolve41 = null; + let reject2 = null; const onerr = (er) => { this.removeListener("data", ondata); this.removeListener("end", onend); - reject3(er); + reject2(er); }; const ondata = (value) => { this.removeListener("error", onerr); this.removeListener("end", onend); this.pause(); - resolve47({ value, done: !!this[EOF] }); + resolve41({ value, done: !!this[EOF] }); }; const onend = () => { this.removeListener("error", onerr); this.removeListener("data", ondata); - resolve47({ done: true }); + resolve41({ done: true }); }; const ondestroy = () => onerr(new Error("stream destroyed")); return new Promise((res2, rej) => { - reject3 = rej; - resolve47 = res2; + reject2 = rej; + resolve41 = res2; this.once(DESTROYED, ondestroy); this.once("error", onerr); this.once("end", onend); @@ -731099,7 +653665,7 @@ var require_minipass = __commonJS((exports, module) => { return this; } static isStream(s) { - return !!s && (s instanceof Minipass || s instanceof Stream6 || s instanceof EE && (typeof s.pipe === "function" || typeof s.write === "function" && typeof s.end === "function")); + return !!s && (s instanceof Minipass || s instanceof Stream4 || s instanceof EE && (typeof s.pipe === "function" || typeof s.write === "function" && typeof s.end === "function")); } }; }); @@ -731163,7 +653729,7 @@ var require_minipass_pipeline = __commonJS((exports, module) => { [_setTail](stream4) { this[_tail] = stream4; stream4.on("error", (er) => this[_onError2](stream4, er)); - stream4.on("data", (chunk4) => this[_onData](stream4, chunk4)); + stream4.on("data", (chunk3) => this[_onData](stream4, chunk3)); stream4.on("end", () => this[_onEnd](stream4)); stream4.on("finish", () => this[_onEnd](stream4)); } @@ -731171,9 +653737,9 @@ var require_minipass_pipeline = __commonJS((exports, module) => { if (stream4 === this[_tail]) this.emit("error", er); } - [_onData](stream4, chunk4) { + [_onData](stream4, chunk3) { if (stream4 === this[_tail]) - super.write(chunk4); + super.write(chunk3); } [_onEnd](stream4) { if (stream4 === this[_tail]) @@ -731196,11 +653762,11 @@ var require_minipass_pipeline = __commonJS((exports, module) => { if (stream4 === this[_head]) this.emit("drain"); } - write(chunk4, enc, cb) { - return this[_head].write(chunk4, enc, cb) && (this.flowing || this.buffer.length === 0); + write(chunk3, enc, cb) { + return this[_head].write(chunk3, enc, cb) && (this.flowing || this.buffer.length === 0); } - end(chunk4, enc, cb) { - this[_head].end(chunk4, enc, cb); + end(chunk3, enc, cb) { + this[_head].end(chunk3, enc, cb); return this; } } @@ -731208,7 +653774,7 @@ var require_minipass_pipeline = __commonJS((exports, module) => { }); // node_modules/ssri/lib/index.js -var require_lib14 = __commonJS((exports, module) => { +var require_lib12 = __commonJS((exports, module) => { var crypto4 = __require("crypto"); var { Minipass } = require_commonjs(); var SPEC_ALGORITHMS = ["sha512", "sha384", "sha256"]; @@ -731253,17 +653819,17 @@ var require_lib14 = __commonJS((exports, module) => { this.digests = this.goodSri ? this.sri[this.algorithm] : null; this.optString = getOptString(this.opts?.options); } - on(ev, handler14) { + on(ev, handler19) { if (ev === "size" && this.#emittedSize) { - return handler14(this.#emittedSize); + return handler19(this.#emittedSize); } if (ev === "integrity" && this.#emittedIntegrity) { - return handler14(this.#emittedIntegrity); + return handler19(this.#emittedIntegrity); } if (ev === "verified" && this.#emittedVerified) { - return handler14(this.#emittedVerified); + return handler19(this.#emittedVerified); } - return super.on(ev, handler14); + return super.on(ev, handler19); } emit(ev, data) { if (ev === "end") { @@ -731280,27 +653846,27 @@ var require_lib14 = __commonJS((exports, module) => { if (!this.goodSri) { this.#getOptions(); } - const newSri = parse19(this.hashes.map((h2, i4) => { - return `${this.algorithms[i4]}-${h2.digest("base64")}${this.optString}`; + const newSri = parse19(this.hashes.map((h2, i3) => { + return `${this.algorithms[i3]}-${h2.digest("base64")}${this.optString}`; }).join(" "), this.opts); const match = this.goodSri && newSri.match(this.sri, this.opts); if (typeof this.expectedSize === "number" && this.size !== this.expectedSize) { - const err3 = new Error(`stream size mismatch when checking ${this.sri}. + const err2 = new Error(`stream size mismatch when checking ${this.sri}. Wanted: ${this.expectedSize} Found: ${this.size}`); - err3.code = "EBADSIZE"; - err3.found = this.size; - err3.expected = this.expectedSize; - err3.sri = this.sri; - this.emit("error", err3); + err2.code = "EBADSIZE"; + err2.found = this.size; + err2.expected = this.expectedSize; + err2.sri = this.sri; + this.emit("error", err2); } else if (this.sri && !match) { - const err3 = new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${newSri}. (${this.size} bytes)`); - err3.code = "EINTEGRITY"; - err3.found = newSri; - err3.expected = this.digests; - err3.algorithm = this.algorithm; - err3.sri = this.sri; - this.emit("error", err3); + const err2 = new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${newSri}. (${this.size} bytes)`); + err2.code = "EINTEGRITY"; + err2.found = newSri; + err2.expected = this.digests; + err2.algorithm = this.algorithm; + err2.sri = this.sri; + this.emit("error", err2); } else { this.#emittedSize = this.size; this.emit("size", this.size); @@ -731314,7 +653880,7 @@ var require_lib14 = __commonJS((exports, module) => { } } - class Hash3 { + class Hash2 { get isHash() { return true; } @@ -731371,28 +653937,28 @@ var require_lib14 = __commonJS((exports, module) => { return `${this.algorithm}-${this.digest}${getOptString(this.options)}`; } } - function integrityHashToString(toString9, sep41, opts, hashes) { - const toStringIsNotEmpty = toString9 !== ""; + function integrityHashToString(toString8, sep38, opts, hashes) { + const toStringIsNotEmpty = toString8 !== ""; let shouldAddFirstSep = false; let complement = ""; const lastIndex = hashes.length - 1; - for (let i4 = 0;i4 < lastIndex; i4++) { - const hashString4 = Hash3.prototype.toString.call(hashes[i4], opts); + for (let i3 = 0;i3 < lastIndex; i3++) { + const hashString4 = Hash2.prototype.toString.call(hashes[i3], opts); if (hashString4) { shouldAddFirstSep = true; complement += hashString4; - complement += sep41; + complement += sep38; } } - const finalHashString = Hash3.prototype.toString.call(hashes[lastIndex], opts); + const finalHashString = Hash2.prototype.toString.call(hashes[lastIndex], opts); if (finalHashString) { shouldAddFirstSep = true; complement += finalHashString; } if (toStringIsNotEmpty && shouldAddFirstSep) { - return toString9 + sep41 + complement; + return toString8 + sep38 + complement; } - return toString9 + complement; + return toString8 + complement; } class Integrity { @@ -731406,21 +653972,21 @@ var require_lib14 = __commonJS((exports, module) => { return Object.keys(this).length === 0; } toString(opts) { - let sep41 = opts?.sep || " "; - let toString9 = ""; + let sep38 = opts?.sep || " "; + let toString8 = ""; if (opts?.strict) { - sep41 = sep41.replace(/\S+/g, " "); + sep38 = sep38.replace(/\S+/g, " "); for (const hash2 of SPEC_ALGORITHMS) { if (this[hash2]) { - toString9 = integrityHashToString(toString9, sep41, opts, this[hash2]); + toString8 = integrityHashToString(toString8, sep38, opts, this[hash2]); } } } else { for (const hash2 of Object.keys(this)) { - toString9 = integrityHashToString(toString9, sep41, opts, this[hash2]); + toString8 = integrityHashToString(toString8, sep38, opts, this[hash2]); } } - return toString9; + return toString8; } concat(integrity, opts) { const other2 = typeof integrity === "string" ? integrity : stringify(integrity, opts); @@ -731451,14 +654017,14 @@ var require_lib14 = __commonJS((exports, module) => { } pickAlgorithm(opts, hashes) { const pickAlgorithm = opts?.pickAlgorithm || getPrioritizedHash; - const keys3 = Object.keys(this).filter((k) => { + const keys2 = Object.keys(this).filter((k) => { if (hashes?.length) { return hashes.includes(k); } return true; }); - if (keys3.length) { - return keys3.reduce((acc, algo) => pickAlgorithm(acc, algo) || acc); + if (keys2.length) { + return keys2.reduce((acc, algo) => pickAlgorithm(acc, algo) || acc); } return null; } @@ -731480,10 +654046,10 @@ var require_lib14 = __commonJS((exports, module) => { } function _parse3(integrity, opts) { if (opts?.single) { - return new Hash3(integrity, opts); + return new Hash2(integrity, opts); } const hashes = integrity.trim().split(/\s+/).reduce((acc, string8) => { - const hash2 = new Hash3(string8, opts); + const hash2 = new Hash2(string8, opts); if (hash2.algorithm && hash2.digest) { const algo = hash2.algorithm; if (!acc[algo]) { @@ -731498,7 +654064,7 @@ var require_lib14 = __commonJS((exports, module) => { exports.stringify = stringify; function stringify(obj, opts) { if (obj.algorithm && obj.digest) { - return Hash3.prototype.toString.call(obj, opts); + return Hash2.prototype.toString.call(obj, opts); } else if (typeof obj === "string") { return stringify(parse19(obj, opts), opts); } else { @@ -731516,7 +654082,7 @@ var require_lib14 = __commonJS((exports, module) => { const optString = getOptString(opts?.options); return algorithms.reduce((acc, algo) => { const digest = crypto4.createHash(algo).update(data).digest("base64"); - const hash2 = new Hash3(`${algo}-${digest}${optString}`, opts); + const hash2 = new Hash2(`${algo}-${digest}${optString}`, opts); if (hash2.algorithm && hash2.digest) { const hashAlgo = hash2.algorithm; if (!acc[hashAlgo]) { @@ -731530,15 +654096,15 @@ var require_lib14 = __commonJS((exports, module) => { exports.fromStream = fromStream; function fromStream(stream4, opts) { const istream = integrityStream(opts); - return new Promise((resolve47, reject3) => { + return new Promise((resolve41, reject2) => { stream4.pipe(istream); - stream4.on("error", reject3); - istream.on("error", reject3); + stream4.on("error", reject2); + istream.on("error", reject2); let sri; istream.on("integrity", (s) => { sri = s; }); - istream.on("end", () => resolve47(sri)); + istream.on("end", () => resolve41(sri)); istream.resume(); }); } @@ -731562,22 +654128,22 @@ var require_lib14 = __commonJS((exports, module) => { if (match || !opts.error) { return match; } else if (typeof opts.size === "number" && data.length !== opts.size) { - const err3 = new Error(`data size mismatch when checking ${sri}. + const err2 = new Error(`data size mismatch when checking ${sri}. Wanted: ${opts.size} Found: ${data.length}`); - err3.code = "EBADSIZE"; - err3.found = data.length; - err3.expected = opts.size; - err3.sri = sri; - throw err3; + err2.code = "EBADSIZE"; + err2.found = data.length; + err2.expected = opts.size; + err2.sri = sri; + throw err2; } else { - const err3 = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`); - err3.code = "EINTEGRITY"; - err3.found = newSri; - err3.expected = sri; - err3.algorithm = algorithm; - err3.sri = sri; - throw err3; + const err2 = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`); + err2.code = "EINTEGRITY"; + err2.found = newSri; + err2.expected = sri; + err2.algorithm = algorithm; + err2.sri = sri; + throw err2; } } exports.checkStream = checkStream; @@ -731591,15 +654157,15 @@ var require_lib14 = __commonJS((exports, module) => { })); } const checker = integrityStream(opts); - return new Promise((resolve47, reject3) => { + return new Promise((resolve41, reject2) => { stream4.pipe(checker); - stream4.on("error", reject3); - checker.on("error", reject3); + stream4.on("error", reject2); + checker.on("error", reject2); let verified; checker.on("verified", (s) => { verified = s; }); - checker.on("end", () => resolve47(verified)); + checker.on("end", () => resolve41(verified)); checker.resume(); }); } @@ -731613,14 +654179,14 @@ var require_lib14 = __commonJS((exports, module) => { const optString = getOptString(opts?.options); const hashes = algorithms.map(crypto4.createHash); return { - update: function(chunk4, enc) { - hashes.forEach((h2) => h2.update(chunk4, enc)); + update: function(chunk3, enc) { + hashes.forEach((h2) => h2.update(chunk3, enc)); return this; }, digest: function() { const integrity = algorithms.reduce((acc, algo) => { const digest = hashes.shift().digest("base64"); - const hash2 = new Hash3(`${algo}-${digest}${optString}`, opts); + const hash2 = new Hash2(`${algo}-${digest}${optString}`, opts); if (hash2.algorithm && hash2.digest) { const hashAlgo = hash2.algorithm; if (!acc[hashAlgo]) { @@ -731671,21 +654237,21 @@ var require_imurmurhash = __commonJS((exports, module) => { } } MurmurHash3.prototype.hash = function(key) { - var h1, k1, i4, top, len; + var h1, k1, i3, top, len; len = key.length; this.len += len; k1 = this.k1; - i4 = 0; + i3 = 0; switch (this.rem) { case 0: - k1 ^= len > i4 ? key.charCodeAt(i4++) & 65535 : 0; + k1 ^= len > i3 ? key.charCodeAt(i3++) & 65535 : 0; case 1: - k1 ^= len > i4 ? (key.charCodeAt(i4++) & 65535) << 8 : 0; + k1 ^= len > i3 ? (key.charCodeAt(i3++) & 65535) << 8 : 0; case 2: - k1 ^= len > i4 ? (key.charCodeAt(i4++) & 65535) << 16 : 0; + k1 ^= len > i3 ? (key.charCodeAt(i3++) & 65535) << 16 : 0; case 3: - k1 ^= len > i4 ? (key.charCodeAt(i4) & 255) << 24 : 0; - k1 ^= len > i4 ? (key.charCodeAt(i4++) & 65280) >> 8 : 0; + k1 ^= len > i3 ? (key.charCodeAt(i3) & 255) << 24 : 0; + k1 ^= len > i3 ? (key.charCodeAt(i3++) & 65280) >> 8 : 0; } this.rem = len + this.rem & 3; len -= this.rem; @@ -731698,21 +654264,21 @@ var require_imurmurhash = __commonJS((exports, module) => { h1 ^= k1; h1 = h1 << 13 | h1 >>> 19; h1 = h1 * 5 + 3864292196 & 4294967295; - if (i4 >= len) { + if (i3 >= len) { break; } - k1 = key.charCodeAt(i4++) & 65535 ^ (key.charCodeAt(i4++) & 65535) << 8 ^ (key.charCodeAt(i4++) & 65535) << 16; - top = key.charCodeAt(i4++); + k1 = key.charCodeAt(i3++) & 65535 ^ (key.charCodeAt(i3++) & 65535) << 8 ^ (key.charCodeAt(i3++) & 65535) << 16; + top = key.charCodeAt(i3++); k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8; } k1 = 0; switch (this.rem) { case 3: - k1 ^= (key.charCodeAt(i4 + 2) & 65535) << 16; + k1 ^= (key.charCodeAt(i3 + 2) & 65535) << 16; case 2: - k1 ^= (key.charCodeAt(i4 + 1) & 65535) << 8; + k1 ^= (key.charCodeAt(i3 + 1) & 65535) << 8; case 1: - k1 ^= key.charCodeAt(i4) & 65535; + k1 ^= key.charCodeAt(i3) & 65535; } this.h1 = h1; } @@ -731752,11 +654318,11 @@ var require_imurmurhash = __commonJS((exports, module) => { }); // node_modules/unique-slug/lib/index.js -var require_lib15 = __commonJS((exports, module) => { +var require_lib13 = __commonJS((exports, module) => { var MurmurHash3 = require_imurmurhash(); - module.exports = function(uniq4) { - if (uniq4) { - var hash2 = new MurmurHash3(uniq4); + module.exports = function(uniq3) { + if (uniq3) { + var hash2 = new MurmurHash3(uniq3); return ("00000000" + hash2.result().toString(16)).slice(-8); } else { return (Math.random().toString(16) + "0000000").slice(2, 10); @@ -731765,16 +654331,16 @@ var require_lib15 = __commonJS((exports, module) => { }); // node_modules/unique-filename/lib/index.js -var require_lib16 = __commonJS((exports, module) => { - var path29 = __require("path"); - var uniqueSlug = require_lib15(); - module.exports = function(filepath, prefix, uniq4) { - return path29.join(filepath, (prefix ? prefix + "-" : "") + uniqueSlug(uniq4)); +var require_lib14 = __commonJS((exports, module) => { + var path24 = __require("path"); + var uniqueSlug = require_lib13(); + module.exports = function(filepath, prefix, uniq3) { + return path24.join(filepath, (prefix ? prefix + "-" : "") + uniqueSlug(uniq3)); }; }); // node_modules/cacache/package.json -var require_package12 = __commonJS((exports, module) => { +var require_package4 = __commonJS((exports, module) => { module.exports = { name: "cacache", version: "19.0.1", @@ -731870,44 +654436,44 @@ var require_hash_to_segments = __commonJS((exports, module) => { // node_modules/cacache/lib/content/path.js var require_path = __commonJS((exports, module) => { - var contentVer = require_package12()["cache-version"].content; + var contentVer = require_package4()["cache-version"].content; var hashToSegments = require_hash_to_segments(); - var path29 = __require("path"); - var ssri = require_lib14(); + var path24 = __require("path"); + var ssri = require_lib12(); module.exports = contentPath; function contentPath(cache6, integrity) { const sri = ssri.parse(integrity, { single: true }); - return path29.join(contentDir(cache6), sri.algorithm, ...hashToSegments(sri.hexDigest())); + return path24.join(contentDir(cache6), sri.algorithm, ...hashToSegments(sri.hexDigest())); } module.exports.contentDir = contentDir; function contentDir(cache6) { - return path29.join(cache6, `content-v${contentVer}`); + return path24.join(cache6, `content-v${contentVer}`); } }); // node_modules/@npmcli/fs/lib/common/get-options.js var require_get_options = __commonJS((exports, module) => { - var getOptions2 = (input11, { copy: copy2, wrap: wrap4 }) => { - const result3 = {}; - if (input11 && typeof input11 === "object") { + var getOptions2 = (input, { copy: copy2, wrap: wrap3 }) => { + const result2 = {}; + if (input && typeof input === "object") { for (const prop of copy2) { - if (input11[prop] !== undefined) { - result3[prop] = input11[prop]; + if (input[prop] !== undefined) { + result2[prop] = input[prop]; } } } else { - result3[wrap4] = input11; + result2[wrap3] = input; } - return result3; + return result2; }; module.exports = getOptions2; }); // node_modules/@npmcli/fs/lib/common/node.js -var require_node11 = __commonJS((exports, module) => { +var require_node10 = __commonJS((exports, module) => { var semver = require_semver3(); - var satisfies2 = (range3) => { - return semver.satisfies(process.version, range3, { includePrerelease: true }); + var satisfies2 = (range2) => { + return semver.satisfies(process.version, range2, { includePrerelease: true }); }; module.exports = { satisfies: satisfies2 @@ -732055,26 +654621,26 @@ var require_polyfill = __commonJS((exports, module) => { } = __require("os"); var { chmod: chmod12, - copyFile: copyFile12, + copyFile: copyFile11, lstat: lstat8, mkdir: mkdir56, readdir: readdir36, readlink: readlink3, - stat: stat51, + stat: stat50, symlink: symlink6, unlink: unlink29, utimes: utimes3 } = __require("fs/promises"); var { - dirname: dirname67, - isAbsolute: isAbsolute26, - join: join165, + dirname: dirname63, + isAbsolute: isAbsolute25, + join: join155, parse: parse19, - resolve: resolve47, - sep: sep41, + resolve: resolve41, + sep: sep38, toNamespacedPath } = __require("path"); - var { fileURLToPath: fileURLToPath8 } = __require("url"); + var { fileURLToPath: fileURLToPath7 } = __require("url"); var defaultOptions2 = { dereference: false, errorOnExist: false, @@ -732090,8 +654656,8 @@ var require_polyfill = __commonJS((exports, module) => { return cpFn(toNamespacedPath(getValidatedPath(src)), toNamespacedPath(getValidatedPath(dest)), { ...defaultOptions2, ...opts }); } function getValidatedPath(fileURLOrPath) { - const path29 = fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin ? fileURLToPath8(fileURLOrPath) : fileURLOrPath; - return path29; + const path24 = fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin ? fileURLToPath7(fileURLOrPath) : fileURLOrPath; + return path24; } async function cpFn(src, dest, opts) { if (opts.preserveTimestamps && process.arch === "ia32") { @@ -732148,19 +654714,19 @@ var require_polyfill = __commonJS((exports, module) => { return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev; } function getStats2(src, dest, opts) { - const statFunc = opts.dereference ? (file2) => stat51(file2, { bigint: true }) : (file2) => lstat8(file2, { bigint: true }); + const statFunc = opts.dereference ? (file2) => stat50(file2, { bigint: true }) : (file2) => lstat8(file2, { bigint: true }); return Promise.all([ statFunc(src), - statFunc(dest).catch((err3) => { - if (err3.code === "ENOENT") { + statFunc(dest).catch((err2) => { + if (err2.code === "ENOENT") { return null; } - throw err3; + throw err2; }) ]); } async function checkParentDir(destStat, src, dest, opts) { - const destParent = dirname67(dest); + const destParent = dirname63(dest); const dirExists = await pathExists2(destParent); if (dirExists) { return getStatsForCopy(destStat, src, dest, opts); @@ -732169,22 +654735,22 @@ var require_polyfill = __commonJS((exports, module) => { return getStatsForCopy(destStat, src, dest, opts); } function pathExists2(dest) { - return stat51(dest).then(() => true, (err3) => err3.code === "ENOENT" ? false : Promise.reject(err3)); + return stat50(dest).then(() => true, (err2) => err2.code === "ENOENT" ? false : Promise.reject(err2)); } async function checkParentPaths(src, srcStat, dest) { - const srcParent = resolve47(dirname67(src)); - const destParent = resolve47(dirname67(dest)); + const srcParent = resolve41(dirname63(src)); + const destParent = resolve41(dirname63(dest)); if (destParent === srcParent || destParent === parse19(destParent).root) { return; } let destStat; try { - destStat = await stat51(destParent, { bigint: true }); - } catch (err3) { - if (err3.code === "ENOENT") { + destStat = await stat50(destParent, { bigint: true }); + } catch (err2) { + if (err2.code === "ENOENT") { return; } - throw err3; + throw err2; } if (areIdentical(srcStat, destStat)) { throw new ERR_FS_CP_EINVAL({ @@ -732196,11 +654762,11 @@ var require_polyfill = __commonJS((exports, module) => { } return checkParentPaths(src, srcStat, destParent); } - var normalizePathToArray = (path29) => resolve47(path29).split(sep41).filter(Boolean); + var normalizePathToArray = (path24) => resolve41(path24).split(sep38).filter(Boolean); function isSrcSubdir(src, dest) { const srcArr = normalizePathToArray(src); const destArr = normalizePathToArray(dest); - return srcArr.every((cur, i4) => destArr[i4] === cur); + return srcArr.every((cur, i3) => destArr[i3] === cur); } async function handleFilter(onInclude, destStat, src, dest, opts, cb) { const include = await opts.filter(src, dest); @@ -732215,7 +654781,7 @@ var require_polyfill = __commonJS((exports, module) => { return getStatsForCopy(destStat, src, dest, opts); } async function getStatsForCopy(destStat, src, dest, opts) { - const statFn = opts.dereference ? stat51 : lstat8; + const statFn = opts.dereference ? stat50 : lstat8; const srcStat = await statFn(src); if (srcStat.isDirectory() && opts.recursive) { return onDir(srcStat, destStat, src, dest, opts); @@ -732272,7 +654838,7 @@ var require_polyfill = __commonJS((exports, module) => { } } async function _copyFile(srcStat, src, dest, opts) { - await copyFile12(src, dest); + await copyFile11(src, dest); if (opts.preserveTimestamps) { return handleTimestampsAndMode(srcStat.mode, src, dest); } @@ -732299,7 +654865,7 @@ var require_polyfill = __commonJS((exports, module) => { return chmod12(dest, srcMode); } async function setDestTimestamps(src, dest) { - const updatedSrcStat = await stat51(src); + const updatedSrcStat = await stat50(src); return utimes3(dest, updatedSrcStat.atime, updatedSrcStat.mtime); } function onDir(srcStat, destStat, src, dest, opts) { @@ -732315,18 +654881,18 @@ var require_polyfill = __commonJS((exports, module) => { } async function copyDir2(src, dest, opts) { const dir = await readdir36(src); - for (let i4 = 0;i4 < dir.length; i4++) { - const item = dir[i4]; - const srcItem = join165(src, item); - const destItem = join165(dest, item); + for (let i3 = 0;i3 < dir.length; i3++) { + const item = dir[i3]; + const srcItem = join155(src, item); + const destItem = join155(dest, item); const { destStat } = await checkPaths(srcItem, destItem, opts); await startCopy(destStat, srcItem, destItem, opts); } } async function onLink(destStat, src, dest) { let resolvedSrc = await readlink3(src); - if (!isAbsolute26(resolvedSrc)) { - resolvedSrc = resolve47(dirname67(src), resolvedSrc); + if (!isAbsolute25(resolvedSrc)) { + resolvedSrc = resolve41(dirname63(src), resolvedSrc); } if (!destStat) { return symlink6(resolvedSrc, dest); @@ -732334,14 +654900,14 @@ var require_polyfill = __commonJS((exports, module) => { let resolvedDest; try { resolvedDest = await readlink3(dest); - } catch (err3) { - if (err3.code === "EINVAL" || err3.code === "UNKNOWN") { + } catch (err2) { + if (err2.code === "EINVAL" || err2.code === "UNKNOWN") { return symlink6(resolvedSrc, dest); } - throw err3; + throw err2; } - if (!isAbsolute26(resolvedDest)) { - resolvedDest = resolve47(dirname67(dest), resolvedDest); + if (!isAbsolute25(resolvedDest)) { + resolvedDest = resolve41(dirname63(dest), resolvedDest); } if (isSrcSubdir(resolvedSrc, resolvedDest)) { throw new ERR_FS_CP_EINVAL({ @@ -732351,7 +654917,7 @@ var require_polyfill = __commonJS((exports, module) => { errno: EINVAL }); } - const srcStat = await stat51(src); + const srcStat = await stat50(src); if (srcStat.isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) { throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({ message: `cannot overwrite ${resolvedDest} with ${resolvedSrc}`, @@ -732371,45 +654937,45 @@ var require_polyfill = __commonJS((exports, module) => { // node_modules/@npmcli/fs/lib/cp/index.js var require_cp = __commonJS((exports, module) => { - var fs12 = __require("fs/promises"); + var fs6 = __require("fs/promises"); var getOptions2 = require_get_options(); - var node = require_node11(); + var node = require_node10(); var polyfill = require_polyfill(); var useNative = node.satisfies(">=16.7.0"); var cp = async (src, dest, opts) => { const options2 = getOptions2(opts, { copy: ["dereference", "errorOnExist", "filter", "force", "preserveTimestamps", "recursive"] }); - return useNative ? fs12.cp(src, dest, options2) : polyfill(src, dest, options2); + return useNative ? fs6.cp(src, dest, options2) : polyfill(src, dest, options2); }; module.exports = cp; }); // node_modules/@npmcli/fs/lib/with-temp-dir.js var require_with_temp_dir = __commonJS((exports, module) => { - var { join: join165, sep: sep41 } = __require("path"); + var { join: join155, sep: sep38 } = __require("path"); var getOptions2 = require_get_options(); - var { mkdir: mkdir56, mkdtemp: mkdtemp4, rm: rm13 } = __require("fs/promises"); - var withTempDir = async (root3, fn, opts) => { + var { mkdir: mkdir56, mkdtemp: mkdtemp2, rm: rm11 } = __require("fs/promises"); + var withTempDir = async (root2, fn, opts) => { const options2 = getOptions2(opts, { copy: ["tmpPrefix"] }); - await mkdir56(root3, { recursive: true }); - const target = await mkdtemp4(join165(`${root3}${sep41}`, options2.tmpPrefix || "")); - let err3; - let result3; + await mkdir56(root2, { recursive: true }); + const target = await mkdtemp2(join155(`${root2}${sep38}`, options2.tmpPrefix || "")); + let err2; + let result2; try { - result3 = await fn(target); + result2 = await fn(target); } catch (_err) { - err3 = _err; + err2 = _err; } try { - await rm13(target, { force: true, recursive: true }); + await rm11(target, { force: true, recursive: true }); } catch {} - if (err3) { - throw err3; + if (err2) { + throw err2; } - return result3; + return result2; }; module.exports = withTempDir; }); @@ -732417,13 +654983,13 @@ var require_with_temp_dir = __commonJS((exports, module) => { // node_modules/@npmcli/fs/lib/readdir-scoped.js var require_readdir_scoped = __commonJS((exports, module) => { var { readdir: readdir36 } = __require("fs/promises"); - var { join: join165 } = __require("path"); + var { join: join155 } = __require("path"); var readdirScoped = async (dir) => { const results = []; for (const item of await readdir36(dir)) { if (item.startsWith("@")) { - for (const scopedItem of await readdir36(join165(dir, item))) { - results.push(join165(item, scopedItem)); + for (const scopedItem of await readdir36(join155(dir, item))) { + results.push(join155(item, scopedItem)); } } else { results.push(item); @@ -732436,17 +655002,17 @@ var require_readdir_scoped = __commonJS((exports, module) => { // node_modules/@npmcli/fs/lib/move-file.js var require_move_file = __commonJS((exports, module) => { - var { dirname: dirname67, join: join165, resolve: resolve47, relative: relative37, isAbsolute: isAbsolute26 } = __require("path"); - var fs12 = __require("fs/promises"); - var pathExists2 = async (path29) => { + var { dirname: dirname63, join: join155, resolve: resolve41, relative: relative35, isAbsolute: isAbsolute25 } = __require("path"); + var fs6 = __require("fs/promises"); + var pathExists2 = async (path24) => { try { - await fs12.access(path29); + await fs6.access(path24); return true; } catch (er) { return er.code !== "ENOENT"; } }; - var moveFile = async (source, destination, options2 = {}, root3 = true, symlinks = []) => { + var moveFile = async (source, destination, options2 = {}, root2 = true, symlinks = []) => { if (!source || !destination) { throw new TypeError("`source` and `destination` file required"); } @@ -732457,47 +655023,47 @@ var require_move_file = __commonJS((exports, module) => { if (!options2.overwrite && await pathExists2(destination)) { throw new Error(`The destination file exists: ${destination}`); } - await fs12.mkdir(dirname67(destination), { recursive: true }); + await fs6.mkdir(dirname63(destination), { recursive: true }); try { - await fs12.rename(source, destination); - } catch (error46) { - if (error46.code === "EXDEV" || error46.code === "EPERM") { - const sourceStat = await fs12.lstat(source); + await fs6.rename(source, destination); + } catch (error42) { + if (error42.code === "EXDEV" || error42.code === "EPERM") { + const sourceStat = await fs6.lstat(source); if (sourceStat.isDirectory()) { - const files3 = await fs12.readdir(source); - await Promise.all(files3.map((file2) => moveFile(join165(source, file2), join165(destination, file2), options2, false, symlinks))); + const files2 = await fs6.readdir(source); + await Promise.all(files2.map((file2) => moveFile(join155(source, file2), join155(destination, file2), options2, false, symlinks))); } else if (sourceStat.isSymbolicLink()) { symlinks.push({ source, destination }); } else { - await fs12.copyFile(source, destination); + await fs6.copyFile(source, destination); } } else { - throw error46; + throw error42; } } - if (root3) { + if (root2) { await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => { - let target = await fs12.readlink(symSource); - if (isAbsolute26(target)) { - target = resolve47(symDestination, relative37(symSource, target)); + let target = await fs6.readlink(symSource); + if (isAbsolute25(target)) { + target = resolve41(symDestination, relative35(symSource, target)); } let targetStat = "file"; try { - targetStat = await fs12.stat(resolve47(dirname67(symSource), target)); + targetStat = await fs6.stat(resolve41(dirname63(symSource), target)); if (targetStat.isDirectory()) { targetStat = "junction"; } } catch {} - await fs12.symlink(target, symDestination, targetStat); + await fs6.symlink(target, symDestination, targetStat); })); - await fs12.rm(source, { recursive: true, force: true }); + await fs6.rm(source, { recursive: true, force: true }); } }; module.exports = moveFile; }); // node_modules/@npmcli/fs/lib/index.js -var require_lib17 = __commonJS((exports, module) => { +var require_lib15 = __commonJS((exports, module) => { var cp = require_cp(); var withTempDir = require_with_temp_dir(); var readdirScoped = require_readdir_scoped(); @@ -732516,21 +655082,21 @@ var require_entry_index = __commonJS((exports, module) => { var { appendFile: appendFile7, mkdir: mkdir56, - readFile: readFile60, + readFile: readFile59, readdir: readdir36, - rm: rm13, - writeFile: writeFile57 + rm: rm11, + writeFile: writeFile55 } = __require("fs/promises"); var { Minipass } = require_commonjs(); - var path29 = __require("path"); - var ssri = require_lib14(); - var uniqueFilename = require_lib16(); + var path24 = __require("path"); + var ssri = require_lib12(); + var uniqueFilename = require_lib14(); var contentPath = require_path(); var hashToSegments = require_hash_to_segments(); - var indexV = require_package12()["cache-version"].index; - var { moveFile } = require_lib17(); + var indexV = require_package4()["cache-version"].index; + var { moveFile } = require_lib15(); var lsStreamConcurrency = 5; - exports.NotFoundError = class NotFoundError3 extends Error { + exports.NotFoundError = class NotFoundError2 extends Error { constructor(cache6, key) { super(`No cache entry for ${key} found in ${cache6}`); this.code = "ENOENT"; @@ -732538,13 +655104,13 @@ var require_entry_index = __commonJS((exports, module) => { this.key = key; } }; - exports.compact = compact4; - async function compact4(cache6, key, matchFn, opts = {}) { + exports.compact = compact3; + async function compact3(cache6, key, matchFn, opts = {}) { const bucket = bucketPath(cache6, key); const entries = await bucketEntries(bucket); const newEntries = []; - for (let i4 = entries.length - 1;i4 >= 0; --i4) { - const entry = entries[i4]; + for (let i3 = entries.length - 1;i3 >= 0; --i3) { + const entry = entries[i3]; if (entry.integrity === null && !opts.validateEntry) { break; } @@ -732560,8 +655126,8 @@ var require_entry_index = __commonJS((exports, module) => { }).join(` `); const setup = async () => { - const target = uniqueFilename(path29.join(cache6, "tmp"), opts.tmpPrefix); - await mkdir56(path29.dirname(target), { recursive: true }); + const target = uniqueFilename(path24.join(cache6, "tmp"), opts.tmpPrefix); + await mkdir56(path24.dirname(target), { recursive: true }); return { target, moved: false @@ -732569,12 +655135,12 @@ var require_entry_index = __commonJS((exports, module) => { }; const teardown = async (tmp2) => { if (!tmp2.moved) { - return rm13(tmp2.target, { recursive: true, force: true }); + return rm11(tmp2.target, { recursive: true, force: true }); } }; const write = async (tmp2) => { - await writeFile57(tmp2.target, newIndex, { flag: "wx" }); - await mkdir56(path29.dirname(bucket), { recursive: true }); + await writeFile55(tmp2.target, newIndex, { flag: "wx" }); + await mkdir56(path24.dirname(bucket), { recursive: true }); await moveFile(tmp2.target, bucket); tmp2.moved = true; }; @@ -732588,30 +655154,30 @@ var require_entry_index = __commonJS((exports, module) => { } exports.insert = insert; async function insert(cache6, key, integrity, opts = {}) { - const { metadata, size: size3, time: time6 } = opts; + const { metadata, size: size2, time: time6 } = opts; const bucket = bucketPath(cache6, key); const entry = { key, integrity: integrity && ssri.stringify(integrity), time: time6 || Date.now(), - size: size3, + size: size2, metadata }; try { - await mkdir56(path29.dirname(bucket), { recursive: true }); + await mkdir56(path24.dirname(bucket), { recursive: true }); const stringified = JSON.stringify(entry); await appendFile7(bucket, ` ${hashEntry(stringified)} ${stringified}`); - } catch (err3) { - if (err3.code === "ENOENT") { + } catch (err2) { + if (err2.code === "ENOENT") { return; } - throw err3; + throw err2; } return formatEntry2(cache6, entry); } - exports.find = find3; - async function find3(cache6, key) { + exports.find = find2; + async function find2(cache6, key) { const bucket = bucketPath(cache6, key); try { const entries = await bucketEntries(bucket); @@ -732622,11 +655188,11 @@ ${hashEntry(stringified)} ${stringified}`); return latest; } }, null); - } catch (err3) { - if (err3.code === "ENOENT") { + } catch (err2) { + if (err2.code === "ENOENT") { return null; } else { - throw err3; + throw err2; } } } @@ -732636,7 +655202,7 @@ ${hashEntry(stringified)} ${stringified}`); return insert(cache6, key, null, opts); } const bucket = bucketPath(cache6, key); - return rm13(bucket, { recursive: true, force: true }); + return rm11(bucket, { recursive: true, force: true }); } exports.lsStream = lsStream; function lsStream(cache6) { @@ -732646,13 +655212,13 @@ ${hashEntry(stringified)} ${stringified}`); const { default: pMap2 } = await Promise.resolve().then(() => (init_p_map(), exports_p_map)); const buckets = await readdirOrEmpty(indexDir); await pMap2(buckets, async (bucket) => { - const bucketPath2 = path29.join(indexDir, bucket); + const bucketPath2 = path24.join(indexDir, bucket); const subbuckets = await readdirOrEmpty(bucketPath2); await pMap2(subbuckets, async (subbucket) => { - const subbucketPath = path29.join(bucketPath2, subbucket); + const subbucketPath = path24.join(bucketPath2, subbucket); const subbucketEntries = await readdirOrEmpty(subbucketPath); await pMap2(subbucketEntries, async (entry) => { - const entryPath = path29.join(subbucketPath, entry); + const entryPath = path24.join(subbucketPath, entry); try { const entries = await bucketEntries(entryPath); const reduced = entries.reduce((acc, entry2) => { @@ -732665,18 +655231,18 @@ ${hashEntry(stringified)} ${stringified}`); stream4.write(formatted); } } - } catch (err3) { - if (err3.code === "ENOENT") { + } catch (err2) { + if (err2.code === "ENOENT") { return; } - throw err3; + throw err2; } }, { concurrency: lsStreamConcurrency }); }, { concurrency: lsStreamConcurrency }); }, { concurrency: lsStreamConcurrency }); stream4.end(); return stream4; - }).catch((err3) => stream4.emit("error", err3)); + }).catch((err2) => stream4.emit("error", err2)); return stream4; } exports.ls = ls; @@ -732688,9 +655254,9 @@ ${hashEntry(stringified)} ${stringified}`); }, {}); } exports.bucketEntries = bucketEntries; - async function bucketEntries(bucket, filter4) { - const data = await readFile60(bucket, "utf8"); - return _bucketEntries(data, filter4); + async function bucketEntries(bucket, filter3) { + const data = await readFile59(bucket, "utf8"); + return _bucketEntries(data, filter3); } function _bucketEntries(data) { const entries = []; @@ -732715,12 +655281,12 @@ ${hashEntry(stringified)} ${stringified}`); } exports.bucketDir = bucketDir; function bucketDir(cache6) { - return path29.join(cache6, `index-v${indexV}`); + return path24.join(cache6, `index-v${indexV}`); } exports.bucketPath = bucketPath; function bucketPath(cache6, key) { const hashed = hashKey(key); - return path29.join.apply(path29, [bucketDir(cache6)].concat(hashToSegments(hashed))); + return path24.join.apply(path24, [bucketDir(cache6)].concat(hashToSegments(hashed))); } exports.hashKey = hashKey; function hashKey(key) { @@ -732747,11 +655313,11 @@ ${hashEntry(stringified)} ${stringified}`); }; } function readdirOrEmpty(dir) { - return readdir36(dir).catch((err3) => { - if (err3.code === "ENOENT" || err3.code === "ENOTDIR") { + return readdir36(dir).catch((err2) => { + if (err2.code === "ENOENT" || err2.code === "ENOTDIR") { return []; } - throw err3; + throw err2; }); } }); @@ -732805,33 +655371,33 @@ var require_commonjs2 = __commonJS((exports) => { var shouldWarn = (code) => !warned.has(code); var TYPE = Symbol("type"); var isPosInt = (n3) => n3 && n3 === Math.floor(n3) && n3 > 0 && isFinite(n3); - var getUintArray = (max5) => !isPosInt(max5) ? null : max5 <= Math.pow(2, 8) ? Uint8Array : max5 <= Math.pow(2, 16) ? Uint16Array : max5 <= Math.pow(2, 32) ? Uint32Array : max5 <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; + var getUintArray = (max3) => !isPosInt(max3) ? null : max3 <= Math.pow(2, 8) ? Uint8Array : max3 <= Math.pow(2, 16) ? Uint16Array : max3 <= Math.pow(2, 32) ? Uint32Array : max3 <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; class ZeroArray extends Array { - constructor(size3) { - super(size3); + constructor(size2) { + super(size2); this.fill(0); } } - class Stack3 { + class Stack2 { heap; length; static #constructing = false; - static create(max5) { - const HeapCls = getUintArray(max5); + static create(max3) { + const HeapCls = getUintArray(max3); if (!HeapCls) return []; - Stack3.#constructing = true; - const s = new Stack3(max5, HeapCls); - Stack3.#constructing = false; + Stack2.#constructing = true; + const s = new Stack2(max3, HeapCls); + Stack2.#constructing = false; return s; } - constructor(max5, HeapCls) { - if (!Stack3.#constructing) { + constructor(max3, HeapCls) { + if (!Stack2.#constructing) { throw new TypeError("instantiate Stack using Stack.create(n)"); } - this.heap = new HeapCls(max5); + this.heap = new HeapCls(max3); this.length = 0; } push(n3) { @@ -732931,15 +655497,15 @@ var require_commonjs2 = __commonJS((exports) => { return this.#disposeAfter; } constructor(options2) { - const { max: max5 = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose: dispose3, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options2; - if (max5 !== 0 && !isPosInt(max5)) { + const { max: max3 = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose: dispose3, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options2; + if (max3 !== 0 && !isPosInt(max3)) { throw new TypeError("max option must be a nonnegative integer"); } - const UintArray = max5 ? getUintArray(max5) : Array; + const UintArray = max3 ? getUintArray(max3) : Array; if (!UintArray) { - throw new Error("invalid max value: " + max5); + throw new Error("invalid max value: " + max3); } - this.#max = max5; + this.#max = max3; this.#maxSize = maxSize; this.maxEntrySize = maxEntrySize || this.#maxSize; this.sizeCalculation = sizeCalculation; @@ -732961,13 +655527,13 @@ var require_commonjs2 = __commonJS((exports) => { this.#fetchMethod = fetchMethod; this.#hasFetchMethod = !!fetchMethod; this.#keyMap = new Map; - this.#keyList = new Array(max5).fill(undefined); - this.#valList = new Array(max5).fill(undefined); - this.#next = new UintArray(max5); - this.#prev = new UintArray(max5); + this.#keyList = new Array(max3).fill(undefined); + this.#valList = new Array(max3).fill(undefined); + this.#next = new UintArray(max3); + this.#prev = new UintArray(max3); this.#head = 0; this.#tail = 0; - this.#free = Stack3.create(max5); + this.#free = Stack2.create(max3); this.#size = 0; this.#calculatedSize = 0; if (typeof dispose3 === "function") { @@ -733105,27 +655671,27 @@ var require_commonjs2 = __commonJS((exports) => { this.#calculatedSize -= sizes[index]; sizes[index] = 0; }; - this.#requireSize = (k, v, size3, sizeCalculation) => { + this.#requireSize = (k, v, size2, sizeCalculation) => { if (this.#isBackgroundFetch(v)) { return 0; } - if (!isPosInt(size3)) { + if (!isPosInt(size2)) { if (sizeCalculation) { if (typeof sizeCalculation !== "function") { throw new TypeError("sizeCalculation must be a function"); } - size3 = sizeCalculation(v, k); - if (!isPosInt(size3)) { + size2 = sizeCalculation(v, k); + if (!isPosInt(size2)) { 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 size3; + return size2; }; - this.#addItemSize = (index, size3, status2) => { - sizes[index] = size3; + this.#addItemSize = (index, size2, status2) => { + sizes[index] = size2; if (this.#maxSize) { const maxSize = this.#maxSize - sizes[index]; while (this.#calculatedSize > maxSize) { @@ -733134,49 +655700,49 @@ var require_commonjs2 = __commonJS((exports) => { } this.#calculatedSize += sizes[index]; if (status2) { - status2.entrySize = size3; + status2.entrySize = size2; status2.totalCalculatedSize = this.#calculatedSize; } }; } #removeItemSize = (_i) => {}; #addItemSize = (_i, _s, _st) => {}; - #requireSize = (_k, _v, size3, sizeCalculation) => { - if (size3 || sizeCalculation) { + #requireSize = (_k, _v, size2, sizeCalculation) => { + if (size2 || sizeCalculation) { throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache"); } return 0; }; *#indexes({ allowStale = this.allowStale } = {}) { if (this.#size) { - for (let i4 = this.#tail;; ) { - if (!this.#isValidIndex(i4)) { + for (let i3 = this.#tail;; ) { + if (!this.#isValidIndex(i3)) { break; } - if (allowStale || !this.#isStale(i4)) { - yield i4; + if (allowStale || !this.#isStale(i3)) { + yield i3; } - if (i4 === this.#head) { + if (i3 === this.#head) { break; } else { - i4 = this.#prev[i4]; + i3 = this.#prev[i3]; } } } } *#rindexes({ allowStale = this.allowStale } = {}) { if (this.#size) { - for (let i4 = this.#head;; ) { - if (!this.#isValidIndex(i4)) { + for (let i3 = this.#head;; ) { + if (!this.#isValidIndex(i3)) { break; } - if (allowStale || !this.#isStale(i4)) { - yield i4; + if (allowStale || !this.#isStale(i3)) { + yield i3; } - if (i4 === this.#tail) { + if (i3 === this.#tail) { break; } else { - i4 = this.#next[i4]; + i3 = this.#next[i3]; } } } @@ -733185,48 +655751,48 @@ var require_commonjs2 = __commonJS((exports) => { return index !== undefined && this.#keyMap.get(this.#keyList[index]) === index; } *entries() { - for (const i4 of this.#indexes()) { - if (this.#valList[i4] !== undefined && this.#keyList[i4] !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { - yield [this.#keyList[i4], this.#valList[i4]]; + for (const i3 of this.#indexes()) { + if (this.#valList[i3] !== undefined && this.#keyList[i3] !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { + yield [this.#keyList[i3], this.#valList[i3]]; } } } *rentries() { - for (const i4 of this.#rindexes()) { - if (this.#valList[i4] !== undefined && this.#keyList[i4] !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { - yield [this.#keyList[i4], this.#valList[i4]]; + for (const i3 of this.#rindexes()) { + if (this.#valList[i3] !== undefined && this.#keyList[i3] !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { + yield [this.#keyList[i3], this.#valList[i3]]; } } } *keys() { - for (const i4 of this.#indexes()) { - const k = this.#keyList[i4]; - if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { + for (const i3 of this.#indexes()) { + const k = this.#keyList[i3]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { yield k; } } } *rkeys() { - for (const i4 of this.#rindexes()) { - const k = this.#keyList[i4]; - if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { + for (const i3 of this.#rindexes()) { + const k = this.#keyList[i3]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { yield k; } } } *values() { - for (const i4 of this.#indexes()) { - const v = this.#valList[i4]; - if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { - yield this.#valList[i4]; + for (const i3 of this.#indexes()) { + const v = this.#valList[i3]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { + yield this.#valList[i3]; } } } *rvalues() { - for (const i4 of this.#rindexes()) { - const v = this.#valList[i4]; - if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { - yield this.#valList[i4]; + for (const i3 of this.#rindexes()) { + const v = this.#valList[i3]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { + yield this.#valList[i3]; } } } @@ -733235,56 +655801,56 @@ var require_commonjs2 = __commonJS((exports) => { } [Symbol.toStringTag] = "LRUCache"; find(fn, getOptions2 = {}) { - for (const i4 of this.#indexes()) { - const v = this.#valList[i4]; + for (const i3 of this.#indexes()) { + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined) continue; - if (fn(value, this.#keyList[i4], this)) { - return this.get(this.#keyList[i4], getOptions2); + if (fn(value, this.#keyList[i3], this)) { + return this.get(this.#keyList[i3], getOptions2); } } } forEach(fn, thisp = this) { - for (const i4 of this.#indexes()) { - const v = this.#valList[i4]; + for (const i3 of this.#indexes()) { + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined) continue; - fn.call(thisp, value, this.#keyList[i4], this); + fn.call(thisp, value, this.#keyList[i3], this); } } rforEach(fn, thisp = this) { - for (const i4 of this.#rindexes()) { - const v = this.#valList[i4]; + for (const i3 of this.#rindexes()) { + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined) continue; - fn.call(thisp, value, this.#keyList[i4], this); + fn.call(thisp, value, this.#keyList[i3], this); } } purgeStale() { let deleted = false; - for (const i4 of this.#rindexes({ allowStale: true })) { - if (this.#isStale(i4)) { - this.#delete(this.#keyList[i4], "expire"); + for (const i3 of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i3)) { + this.#delete(this.#keyList[i3], "expire"); deleted = true; } } return deleted; } info(key) { - const i4 = this.#keyMap.get(key); - if (i4 === undefined) + const i3 = this.#keyMap.get(key); + if (i3 === undefined) return; - const v = this.#valList[i4]; + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined) return; const entry = { value }; if (this.#ttls && this.#starts) { - const ttl = this.#ttls[i4]; - const start = this.#starts[i4]; + const ttl = this.#ttls[i3]; + const start = this.#starts[i3]; if (ttl && start) { const remain = ttl - (perf.now() - start); entry.ttl = remain; @@ -733292,26 +655858,26 @@ var require_commonjs2 = __commonJS((exports) => { } } if (this.#sizes) { - entry.size = this.#sizes[i4]; + entry.size = this.#sizes[i3]; } return entry; } dump() { const arr = []; - for (const i4 of this.#indexes({ allowStale: true })) { - const key = this.#keyList[i4]; - const v = this.#valList[i4]; + for (const i3 of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i3]; + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined || key === undefined) continue; const entry = { value }; if (this.#ttls && this.#starts) { - entry.ttl = this.#ttls[i4]; - const age = perf.now() - this.#starts[i4]; + entry.ttl = this.#ttls[i3]; + const age = perf.now() - this.#starts[i3]; entry.start = Math.floor(Date.now() - age); } if (this.#sizes) { - entry.size = this.#sizes[i4]; + entry.size = this.#sizes[i3]; } arr.unshift([key, entry]); } @@ -733334,8 +655900,8 @@ var require_commonjs2 = __commonJS((exports) => { } const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status: status2 } = setOptions2; let { noUpdateTTL = this.noUpdateTTL } = setOptions2; - const size3 = this.#requireSize(k, v, setOptions2.size || 0, sizeCalculation); - if (this.maxEntrySize && size3 > this.maxEntrySize) { + const size2 = this.#requireSize(k, v, setOptions2.size || 0, sizeCalculation); + if (this.maxEntrySize && size2 > this.maxEntrySize) { if (status2) { status2.set = "miss"; status2.maxEntrySizeExceeded = true; @@ -733353,7 +655919,7 @@ var require_commonjs2 = __commonJS((exports) => { this.#prev[index] = this.#tail; this.#tail = index; this.#size++; - this.#addItemSize(index, size3, status2); + this.#addItemSize(index, size2, status2); if (status2) status2.set = "add"; noUpdateTTL = false; @@ -733381,7 +655947,7 @@ var require_commonjs2 = __commonJS((exports) => { } } this.#removeItemSize(index); - this.#addItemSize(index, size3, status2); + this.#addItemSize(index, size2, status2); this.#valList[index] = v; if (status2) { status2.set = "replace"; @@ -733436,9 +656002,9 @@ var require_commonjs2 = __commonJS((exports) => { } } #evict(free) { - const head3 = this.#head; - const k = this.#keyList[head3]; - const v = this.#valList[head3]; + const head2 = this.#head; + const k = this.#keyList[head2]; + const v = this.#valList[head2]; if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) { v.__abortController.abort(new Error("evicted")); } else if (this.#hasDispose || this.#hasDisposeAfter) { @@ -733449,21 +656015,21 @@ var require_commonjs2 = __commonJS((exports) => { this.#disposed?.push([v, k, "evict"]); } } - this.#removeItemSize(head3); + this.#removeItemSize(head2); if (free) { - this.#keyList[head3] = undefined; - this.#valList[head3] = undefined; - this.#free.push(head3); + this.#keyList[head2] = undefined; + this.#valList[head2] = undefined; + this.#free.push(head2); } if (this.#size === 1) { this.#head = this.#tail = 0; this.#free.length = 0; } else { - this.#head = this.#next[head3]; + this.#head = this.#next[head2]; } this.#keyMap.delete(k); this.#size--; - return head3; + return head2; } has(k, hasOptions = {}) { const { updateAgeOnHas = this.updateAgeOnHas, status: status2 } = hasOptions; @@ -733620,7 +656186,7 @@ var require_commonjs2 = __commonJS((exports) => { noDeleteOnStaleGet = this.noDeleteOnStaleGet, ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, - size: size3 = 0, + size: size2 = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, @@ -733648,7 +656214,7 @@ var require_commonjs2 = __commonJS((exports) => { noDeleteOnStaleGet, ttl, noDisposeOnSet, - size: size3, + size: size2, sizeCalculation, noUpdateTTL, noDeleteOnFetchRejection, @@ -733898,8 +656464,8 @@ var require_memoization = __commonJS((exports, module) => { function putDigest(cache6, integrity, data, opts) { pickMem(opts).set(`digest:${cache6}:${integrity}`, data); } - exports.get = get4; - function get4(cache6, key, opts) { + exports.get = get3; + function get3(cache6, key, opts) { return pickMem(opts).get(`key:${cache6}:${key}`); } exports.get.byDigest = getDigest; @@ -733932,11 +656498,11 @@ var require_memoization = __commonJS((exports, module) => { }); // node_modules/fs-minipass/lib/index.js -var require_lib18 = __commonJS((exports) => { +var require_lib16 = __commonJS((exports) => { var { Minipass } = require_commonjs(); var EE = __require("events").EventEmitter; - var fs12 = __require("fs"); - var writev = fs12.writev; + var fs6 = __require("fs"); + var writev = fs6.writev; var _autoClose = Symbol("_autoClose"); var _close = Symbol("_close"); var _ended = Symbol("_ended"); @@ -733967,17 +656533,17 @@ var require_lib18 = __commonJS((exports) => { var _errored = Symbol("_errored"); class ReadStream2 extends Minipass { - constructor(path29, opt) { + constructor(path24, opt) { opt = opt || {}; super(opt); this.readable = true; this.writable = false; - if (typeof path29 !== "string") { + if (typeof path24 !== "string") { throw new TypeError("path must be a string"); } this[_errored] = false; this[_fd] = typeof opt.fd === "number" ? opt.fd : null; - this[_path] = path29; + this[_path] = path24; this[_readSize] = opt.readSize || 16 * 1024 * 1024; this[_reading] = false; this[_size3] = typeof opt.size === "number" ? opt.size : Infinity; @@ -734002,14 +656568,14 @@ var require_lib18 = __commonJS((exports) => { throw new TypeError("this is a readable stream"); } [_open]() { - fs12.open(this[_path], "r", (er, fd3) => this[_onopen](er, fd3)); + fs6.open(this[_path], "r", (er, fd2) => this[_onopen](er, fd2)); } - [_onopen](er, fd3) { + [_onopen](er, fd2) { if (er) { this[_onerror](er); } else { - this[_fd] = fd3; - this.emit("open", fd3); + this[_fd] = fd2; + this.emit("open", fd2); this[_read](); } } @@ -734023,7 +656589,7 @@ var require_lib18 = __commonJS((exports) => { if (buf.length === 0) { return process.nextTick(() => this[_onread](null, 0, buf)); } - fs12.read(this[_fd], buf, 0, buf.length, null, (er, br2, b) => this[_onread](er, br2, b)); + fs6.read(this[_fd], buf, 0, buf.length, null, (er, br2, b) => this[_onread](er, br2, b)); } } [_onread](er, br2, buf) { @@ -734036,9 +656602,9 @@ var require_lib18 = __commonJS((exports) => { } [_close]() { if (this[_autoClose] && typeof this[_fd] === "number") { - const fd3 = this[_fd]; + const fd2 = this[_fd]; this[_fd] = null; - fs12.close(fd3, (er) => er ? this.emit("error", er) : this.emit("close")); + fs6.close(fd2, (er) => er ? this.emit("error", er) : this.emit("close")); } } [_onerror](er) { @@ -734085,7 +656651,7 @@ var require_lib18 = __commonJS((exports) => { [_open]() { let threw = true; try { - this[_onopen](null, fs12.openSync(this[_path], "r")); + this[_onopen](null, fs6.openSync(this[_path], "r")); threw = false; } finally { if (threw) { @@ -734100,7 +656666,7 @@ var require_lib18 = __commonJS((exports) => { this[_reading] = true; do { const buf = this[_makeBuf](); - const br2 = buf.length === 0 ? 0 : fs12.readSync(this[_fd], buf, 0, buf.length, null); + const br2 = buf.length === 0 ? 0 : fs6.readSync(this[_fd], buf, 0, buf.length, null); if (!this[_handleChunk](br2, buf)) { break; } @@ -734116,16 +656682,16 @@ var require_lib18 = __commonJS((exports) => { } [_close]() { if (this[_autoClose] && typeof this[_fd] === "number") { - const fd3 = this[_fd]; + const fd2 = this[_fd]; this[_fd] = null; - fs12.closeSync(fd3); + fs6.closeSync(fd2); this.emit("close"); } } } class WriteStream extends EE { - constructor(path29, opt) { + constructor(path24, opt) { opt = opt || {}; super(opt); this.readable = false; @@ -734135,7 +656701,7 @@ var require_lib18 = __commonJS((exports) => { this[_ended] = false; this[_needDrain] = false; this[_queue] = []; - this[_path] = path29; + this[_path] = path24; this[_fd] = typeof opt.fd === "number" ? opt.fd : null; this[_mode] = opt.mode === undefined ? 438 : opt.mode; this[_pos] = typeof opt.start === "number" ? opt.start : null; @@ -734168,17 +656734,17 @@ var require_lib18 = __commonJS((exports) => { this.emit("error", er); } [_open]() { - fs12.open(this[_path], this[_flags], this[_mode], (er, fd3) => this[_onopen](er, fd3)); + fs6.open(this[_path], this[_flags], this[_mode], (er, fd2) => this[_onopen](er, fd2)); } - [_onopen](er, fd3) { + [_onopen](er, fd2) { if (this[_defaultFlag] && this[_flags] === "r+" && er && er.code === "ENOENT") { this[_flags] = "w"; this[_open](); } else if (er) { this[_onerror](er); } else { - this[_fd] = fd3; - this.emit("open", fd3); + this[_fd] = fd2; + this.emit("open", fd2); if (!this[_writing]) { this[_flush](); } @@ -734212,7 +656778,7 @@ var require_lib18 = __commonJS((exports) => { return true; } [_write](buf) { - fs12.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); + fs6.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); } [_onwrite](er, bw) { if (er) { @@ -734251,19 +656817,19 @@ var require_lib18 = __commonJS((exports) => { } [_close]() { if (this[_autoClose] && typeof this[_fd] === "number") { - const fd3 = this[_fd]; + const fd2 = this[_fd]; this[_fd] = null; - fs12.close(fd3, (er) => er ? this.emit("error", er) : this.emit("close")); + fs6.close(fd2, (er) => er ? this.emit("error", er) : this.emit("close")); } } } class WriteStreamSync extends WriteStream { [_open]() { - let fd3; + let fd2; if (this[_defaultFlag] && this[_flags] === "r+") { try { - fd3 = fs12.openSync(this[_path], this[_flags], this[_mode]); + fd2 = fs6.openSync(this[_path], this[_flags], this[_mode]); } catch (er) { if (er.code === "ENOENT") { this[_flags] = "w"; @@ -734273,22 +656839,22 @@ var require_lib18 = __commonJS((exports) => { } } } else { - fd3 = fs12.openSync(this[_path], this[_flags], this[_mode]); + fd2 = fs6.openSync(this[_path], this[_flags], this[_mode]); } - this[_onopen](null, fd3); + this[_onopen](null, fd2); } [_close]() { if (this[_autoClose] && typeof this[_fd] === "number") { - const fd3 = this[_fd]; + const fd2 = this[_fd]; this[_fd] = null; - fs12.closeSync(fd3); + fs6.closeSync(fd2); this.emit("close"); } } [_write](buf) { let threw = true; try { - this[_onwrite](null, fs12.writeSync(this[_fd], buf, 0, buf.length, this[_pos])); + this[_onwrite](null, fs6.writeSync(this[_fd], buf, 0, buf.length, this[_pos])); threw = false; } finally { if (threw) { @@ -734307,59 +656873,59 @@ var require_lib18 = __commonJS((exports) => { // node_modules/cacache/lib/content/read.js var require_read = __commonJS((exports, module) => { - var fs12 = __require("fs/promises"); - var fsm = require_lib18(); - var ssri = require_lib14(); + var fs6 = __require("fs/promises"); + var fsm = require_lib16(); + var ssri = require_lib12(); var contentPath = require_path(); var Pipeline = require_minipass_pipeline(); module.exports = read; var MAX_SINGLE_READ_SIZE = 64 * 1024 * 1024; async function read(cache6, integrity, opts = {}) { - const { size: size3 } = opts; - const { stat: stat51, cpath, sri } = await withContentSri(cache6, integrity, async (cpath2, sri2) => { - const stat52 = size3 ? { size: size3 } : await fs12.stat(cpath2); - return { stat: stat52, cpath: cpath2, sri: sri2 }; + const { size: size2 } = opts; + const { stat: stat50, cpath, sri } = await withContentSri(cache6, integrity, async (cpath2, sri2) => { + const stat51 = size2 ? { size: size2 } : await fs6.stat(cpath2); + return { stat: stat51, cpath: cpath2, sri: sri2 }; }); - if (stat51.size > MAX_SINGLE_READ_SIZE) { - return readPipeline(cpath, stat51.size, sri, new Pipeline).concat(); + if (stat50.size > MAX_SINGLE_READ_SIZE) { + return readPipeline(cpath, stat50.size, sri, new Pipeline).concat(); } - const data = await fs12.readFile(cpath, { encoding: null }); - if (stat51.size !== data.length) { - throw sizeError(stat51.size, data.length); + const data = await fs6.readFile(cpath, { encoding: null }); + if (stat50.size !== data.length) { + throw sizeError(stat50.size, data.length); } if (!ssri.checkData(data, sri)) { throw integrityError(sri, cpath); } return data; } - var readPipeline = (cpath, size3, sri, stream4) => { + var readPipeline = (cpath, size2, sri, stream4) => { stream4.push(new fsm.ReadStream(cpath, { - size: size3, + size: size2, readSize: MAX_SINGLE_READ_SIZE }), ssri.integrityStream({ integrity: sri, - size: size3 + size: size2 })); return stream4; }; module.exports.stream = readStream2; module.exports.readStream = readStream2; function readStream2(cache6, integrity, opts = {}) { - const { size: size3 } = opts; + const { size: size2 } = opts; const stream4 = new Pipeline; Promise.resolve().then(async () => { - const { stat: stat51, cpath, sri } = await withContentSri(cache6, integrity, async (cpath2, sri2) => { - const stat52 = size3 ? { size: size3 } : await fs12.stat(cpath2); - return { stat: stat52, cpath: cpath2, sri: sri2 }; + const { stat: stat50, cpath, sri } = await withContentSri(cache6, integrity, async (cpath2, sri2) => { + const stat51 = size2 ? { size: size2 } : await fs6.stat(cpath2); + return { stat: stat51, cpath: cpath2, sri: sri2 }; }); - return readPipeline(cpath, stat51.size, sri, stream4); - }).catch((err3) => stream4.emit("error", err3)); + return readPipeline(cpath, stat50.size, sri, stream4); + }).catch((err2) => stream4.emit("error", err2)); return stream4; } module.exports.copy = copy2; function copy2(cache6, integrity, dest) { return withContentSri(cache6, integrity, (cpath) => { - return fs12.copyFile(cpath, dest); + return fs6.copyFile(cpath, dest); }); } module.exports.hasContent = hasContent; @@ -734369,16 +656935,16 @@ var require_read = __commonJS((exports, module) => { } try { return await withContentSri(cache6, integrity, async (cpath, sri) => { - const stat51 = await fs12.stat(cpath); - return { size: stat51.size, sri, stat: stat51 }; + const stat50 = await fs6.stat(cpath); + return { size: stat50.size, sri, stat: stat50 }; }); - } catch (err3) { - if (err3.code === "ENOENT") { + } catch (err2) { + if (err2.code === "ENOENT") { return false; } - if (err3.code === "EPERM") { + if (err2.code === "EPERM") { if (process.platform !== "win32") { - throw err3; + throw err2; } else { return false; } @@ -734396,16 +656962,16 @@ var require_read = __commonJS((exports, module) => { const results = await Promise.all(digests.map(async (meta) => { try { return await withContentSri(cache6, meta, fn); - } catch (err3) { - if (err3.code === "ENOENT") { + } catch (err2) { + if (err2.code === "ENOENT") { return Object.assign(new Error("No matching content found for " + sri.toString()), { code: "ENOENT" }); } - return err3; + return err2; } })); - const result3 = results.find((r) => !(r instanceof Error)); - if (result3) { - return result3; + const result2 = results.find((r) => !(r instanceof Error)); + if (result2) { + return result2; } const enoentError = results.find((r) => r.code === "ENOENT"); if (enoentError) { @@ -734415,18 +656981,18 @@ var require_read = __commonJS((exports, module) => { } } function sizeError(expected, found) { - const err3 = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`); - err3.expected = expected; - err3.found = found; - err3.code = "EBADSIZE"; - return err3; + const err2 = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`); + err2.expected = expected; + err2.found = found; + err2.code = "EBADSIZE"; + return err2; } - function integrityError(sri, path29) { - const err3 = new Error(`Integrity verification failed for ${sri} (${path29})`); - err3.code = "EINTEGRITY"; - err3.sri = sri; - err3.path = path29; - return err3; + function integrityError(sri, path24) { + const err2 = new Error(`Integrity verification failed for ${sri} (${path24})`); + err2.code = "EINTEGRITY"; + err2.sri = sri; + err2.path = path24; + return err2; } }); @@ -734438,10 +657004,10 @@ var require_get2 = __commonJS((exports, module) => { var index = require_entry_index(); var memo11 = require_memoization(); var read = require_read(); - async function getData3(cache6, key, opts = {}) { - const { integrity, memoize: memoize3, size: size3 } = opts; + async function getData2(cache6, key, opts = {}) { + const { integrity, memoize: memoize2, size: size2 } = opts; const memoized = memo11.get(cache6, key, opts); - if (memoized && memoize3 !== false) { + if (memoized && memoize2 !== false) { return { metadata: memoized.entry.metadata, data: memoized.data, @@ -734453,8 +657019,8 @@ var require_get2 = __commonJS((exports, module) => { if (!entry) { throw new index.NotFoundError(cache6, key); } - const data = await read(cache6, entry.integrity, { integrity, size: size3 }); - if (memoize3) { + const data = await read(cache6, entry.integrity, { integrity, size: size2 }); + if (memoize2) { memo11.put(cache6, entry, data, opts); } return { @@ -734464,15 +657030,15 @@ var require_get2 = __commonJS((exports, module) => { integrity: entry.integrity }; } - module.exports = getData3; + module.exports = getData2; async function getDataByDigest(cache6, key, opts = {}) { - const { integrity, memoize: memoize3, size: size3 } = opts; + const { integrity, memoize: memoize2, size: size2 } = opts; const memoized = memo11.get.byDigest(cache6, key, opts); - if (memoized && memoize3 !== false) { + if (memoized && memoize2 !== false) { return memoized; } - const res = await read(cache6, key, { integrity, size: size3 }); - if (memoize3) { + const res = await read(cache6, key, { integrity, size: size2 }); + if (memoize2) { memo11.put.byDigest(cache6, key, res, opts); } return res; @@ -734489,9 +657055,9 @@ var require_get2 = __commonJS((exports, module) => { return stream4; }; function getStream(cache6, key, opts = {}) { - const { memoize: memoize3, size: size3 } = opts; + const { memoize: memoize2, size: size2 } = opts; const memoized = memo11.get(cache6, key, opts); - if (memoized && memoize3 !== false) { + if (memoized && memoize2 !== false) { return getMemoizedStream(memoized); } const stream4 = new Pipeline; @@ -734508,28 +657074,28 @@ var require_get2 = __commonJS((exports, module) => { ev === "integrity" && cb(entry.integrity); ev === "size" && cb(entry.size); }); - const src = read.readStream(cache6, entry.integrity, { ...opts, size: typeof size3 !== "number" ? entry.size : size3 }); - if (memoize3) { + const src = read.readStream(cache6, entry.integrity, { ...opts, size: typeof size2 !== "number" ? entry.size : size2 }); + if (memoize2) { const memoStream = new Collect.PassThrough; memoStream.on("collect", (data) => memo11.put(cache6, entry, data, opts)); stream4.unshift(memoStream); } stream4.unshift(src); return stream4; - }).catch((err3) => stream4.emit("error", err3)); + }).catch((err2) => stream4.emit("error", err2)); return stream4; } module.exports.stream = getStream; function getStreamDigest(cache6, integrity, opts = {}) { - const { memoize: memoize3 } = opts; + const { memoize: memoize2 } = opts; const memoized = memo11.get.byDigest(cache6, integrity, opts); - if (memoized && memoize3 !== false) { + if (memoized && memoize2 !== false) { const stream4 = new Minipass; stream4.end(memoized); return stream4; } else { const stream4 = read.readStream(cache6, integrity, opts); - if (!memoize3) { + if (!memoize2) { return stream4; } const memoStream = new Collect.PassThrough; @@ -734539,9 +657105,9 @@ var require_get2 = __commonJS((exports, module) => { } module.exports.stream.byDigest = getStreamDigest; function info(cache6, key, opts = {}) { - const { memoize: memoize3 } = opts; + const { memoize: memoize2 } = opts; const memoized = memo11.get(cache6, key, opts); - if (memoized && memoize3 !== false) { + if (memoized && memoize2 !== false) { return Promise.resolve(memoized.entry); } else { return index.find(cache6, key); @@ -734576,7 +657142,7 @@ var require_minipass2 = __commonJS((exports, module) => { stderr: null }; var EE = __require("events"); - var Stream6 = __require("stream"); + var Stream4 = __require("stream"); var SD = __require("string_decoder").StringDecoder; var EOF = Symbol("EOF"); var MAYBE_EMIT_END = Symbol("maybeEmitEnd"); @@ -734601,12 +657167,12 @@ var require_minipass2 = __commonJS((exports, module) => { var EMITEND = Symbol("emitEnd"); var EMITEND2 = Symbol("emitEnd2"); var ASYNC = Symbol("async"); - var defer3 = (fn) => Promise.resolve().then(fn); + var defer2 = (fn) => Promise.resolve().then(fn); var doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== "1"; var ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented"); var ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented"); var isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; - var isArrayBuffer5 = (b) => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; + var isArrayBuffer4 = (b) => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0; var isArrayBufferView2 = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); class Pipe { @@ -734639,7 +657205,7 @@ var require_minipass2 = __commonJS((exports, module) => { src.on("error", this.proxyErrors); } } - module.exports = class Minipass extends Stream6 { + module.exports = class Minipass extends Stream4 { constructor(options2) { super(); this[FLOWING] = false; @@ -734679,7 +657245,7 @@ var require_minipass2 = __commonJS((exports, module) => { if (this[ENCODING] !== enc) { this[DECODER] = enc ? new SD(enc) : null; if (this.buffer.length) - this.buffer = this.buffer.map((chunk4) => this[DECODER].write(chunk4)); + this.buffer = this.buffer.map((chunk3) => this[DECODER].write(chunk3)); } this[ENCODING] = enc; } @@ -734698,7 +657264,7 @@ var require_minipass2 = __commonJS((exports, module) => { set ["async"](a2) { this[ASYNC] = this[ASYNC] || !!a2; } - write(chunk4, encoding, cb) { + write(chunk3, encoding, cb) { if (this[EOF]) throw new Error("write after end"); if (this[DESTROYED]) { @@ -734709,46 +657275,46 @@ var require_minipass2 = __commonJS((exports, module) => { cb = encoding, encoding = "utf8"; if (!encoding) encoding = "utf8"; - const fn = this[ASYNC] ? defer3 : (f) => f(); - if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk4)) { - if (isArrayBufferView2(chunk4)) - chunk4 = Buffer.from(chunk4.buffer, chunk4.byteOffset, chunk4.byteLength); - else if (isArrayBuffer5(chunk4)) - chunk4 = Buffer.from(chunk4); - else if (typeof chunk4 !== "string") + const fn = this[ASYNC] ? defer2 : (f) => f(); + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk3)) { + if (isArrayBufferView2(chunk3)) + chunk3 = Buffer.from(chunk3.buffer, chunk3.byteOffset, chunk3.byteLength); + else if (isArrayBuffer4(chunk3)) + chunk3 = Buffer.from(chunk3); + else if (typeof chunk3 !== "string") this.objectMode = true; } if (this[OBJECTMODE]) { if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true); if (this.flowing) - this.emit("data", chunk4); + this.emit("data", chunk3); else - this[BUFFERPUSH](chunk4); + this[BUFFERPUSH](chunk3); if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) fn(cb); return this.flowing; } - if (!chunk4.length) { + if (!chunk3.length) { if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) fn(cb); return this.flowing; } - if (typeof chunk4 === "string" && !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { - chunk4 = Buffer.from(chunk4, encoding); + if (typeof chunk3 === "string" && !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { + chunk3 = Buffer.from(chunk3, encoding); } - if (Buffer.isBuffer(chunk4) && this[ENCODING]) - chunk4 = this[DECODER].write(chunk4); + if (Buffer.isBuffer(chunk3) && this[ENCODING]) + chunk3 = this[DECODER].write(chunk3); if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true); if (this.flowing) - this.emit("data", chunk4); + this.emit("data", chunk3); else - this[BUFFERPUSH](chunk4); + this[BUFFERPUSH](chunk3); if (this[BUFFERLENGTH] !== 0) this.emit("readable"); if (cb) @@ -734774,26 +657340,26 @@ var require_minipass2 = __commonJS((exports, module) => { this[MAYBE_EMIT_END](); return ret; } - [READ](n3, chunk4) { - if (n3 === chunk4.length || n3 === null) + [READ](n3, chunk3) { + if (n3 === chunk3.length || n3 === null) this[BUFFERSHIFT](); else { - this.buffer[0] = chunk4.slice(n3); - chunk4 = chunk4.slice(0, n3); + this.buffer[0] = chunk3.slice(n3); + chunk3 = chunk3.slice(0, n3); this[BUFFERLENGTH] -= n3; } - this.emit("data", chunk4); + this.emit("data", chunk3); if (!this.buffer.length && !this[EOF]) this.emit("drain"); - return chunk4; + return chunk3; } - end(chunk4, encoding, cb) { - if (typeof chunk4 === "function") - cb = chunk4, chunk4 = null; + end(chunk3, encoding, cb) { + if (typeof chunk3 === "function") + cb = chunk3, chunk3 = null; if (typeof encoding === "function") cb = encoding, encoding = "utf8"; - if (chunk4) - this.write(chunk4, encoding); + if (chunk3) + this.write(chunk3, encoding); if (cb) this.once("end", cb); this[EOF] = true; @@ -734831,12 +657397,12 @@ var require_minipass2 = __commonJS((exports, module) => { get paused() { return this[PAUSED]; } - [BUFFERPUSH](chunk4) { + [BUFFERPUSH](chunk3) { if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1; else - this[BUFFERLENGTH] += chunk4.length; - this.buffer.push(chunk4); + this[BUFFERLENGTH] += chunk3.length; + this.buffer.push(chunk3); } [BUFFERSHIFT]() { if (this.buffer.length) { @@ -734852,8 +657418,8 @@ var require_minipass2 = __commonJS((exports, module) => { if (!noDrain && !this.buffer.length && !this[EOF]) this.emit("drain"); } - [FLUSHCHUNK](chunk4) { - return chunk4 ? (this.emit("data", chunk4), this.flowing) : false; + [FLUSHCHUNK](chunk3) { + return chunk3 ? (this.emit("data", chunk3), this.flowing) : false; } pipe(dest, opts) { if (this[DESTROYED]) @@ -734871,7 +657437,7 @@ var require_minipass2 = __commonJS((exports, module) => { } else { this.pipes.push(!opts.proxyErrors ? new Pipe(this, dest, opts) : new PipeProxyErrors(this, dest, opts)); if (this[ASYNC]) - defer3(() => this[RESUME]()); + defer2(() => this[RESUME]()); else this[RESUME](); } @@ -734898,7 +657464,7 @@ var require_minipass2 = __commonJS((exports, module) => { this.removeAllListeners(ev); } else if (ev === "error" && this[EMITTED_ERROR]) { if (this[ASYNC]) - defer3(() => fn.call(this, this[EMITTED_ERROR])); + defer2(() => fn.call(this, this[EMITTED_ERROR])); else fn.call(this, this[EMITTED_ERROR]); } @@ -734922,7 +657488,7 @@ var require_minipass2 = __commonJS((exports, module) => { if (ev !== "error" && ev !== "close" && ev !== DESTROYED && this[DESTROYED]) return; else if (ev === "data") { - return !data ? false : this[ASYNC] ? defer3(() => this[EMITDATA](data)) : this[EMITDATA](data); + return !data ? false : this[ASYNC] ? defer2(() => this[EMITDATA](data)) : this[EMITDATA](data); } else if (ev === "end") { return this[EMITEND](); } else if (ev === "close") { @@ -734965,7 +657531,7 @@ var require_minipass2 = __commonJS((exports, module) => { this[EMITTED_END] = true; this.readable = false; if (this[ASYNC]) - defer3(() => this[EMITEND2]()); + defer2(() => this[EMITEND2]()); else this[EMITEND2](); } @@ -735002,10 +657568,10 @@ var require_minipass2 = __commonJS((exports, module) => { return this[OBJECTMODE] ? Promise.reject(new Error("cannot concat in objectMode")) : this.collect().then((buf) => this[OBJECTMODE] ? Promise.reject(new Error("cannot concat in objectMode")) : this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength)); } promise() { - return new Promise((resolve47, reject3) => { - this.on(DESTROYED, () => reject3(new Error("stream destroyed"))); - this.on("error", (er) => reject3(er)); - this.on("end", () => resolve47()); + return new Promise((resolve41, reject2) => { + this.on(DESTROYED, () => reject2(new Error("stream destroyed"))); + this.on("error", (er) => reject2(er)); + this.on("end", () => resolve41()); }); } [ASYNCITERATOR]() { @@ -735015,28 +657581,28 @@ var require_minipass2 = __commonJS((exports, module) => { return Promise.resolve({ done: false, value: res }); if (this[EOF]) return Promise.resolve({ done: true }); - let resolve47 = null; - let reject3 = null; + let resolve41 = null; + let reject2 = null; const onerr = (er) => { this.removeListener("data", ondata); this.removeListener("end", onend); - reject3(er); + reject2(er); }; const ondata = (value) => { this.removeListener("error", onerr); this.removeListener("end", onend); this.pause(); - resolve47({ value, done: !!this[EOF] }); + resolve41({ value, done: !!this[EOF] }); }; const onend = () => { this.removeListener("error", onerr); this.removeListener("data", ondata); - resolve47({ done: true }); + resolve41({ done: true }); }; const ondestroy = () => onerr(new Error("stream destroyed")); return new Promise((res2, rej) => { - reject3 = rej; - resolve47 = res2; + reject2 = rej; + resolve41 = res2; this.once(DESTROYED, ondestroy); this.once("error", onerr); this.once("end", onend); @@ -735073,7 +657639,7 @@ var require_minipass2 = __commonJS((exports, module) => { return this; } static isStream(s) { - return !!s && (s instanceof Minipass || s instanceof Stream6 || s instanceof EE && (typeof s.pipe === "function" || typeof s.write === "function" && typeof s.end === "function")); + return !!s && (s instanceof Minipass || s instanceof Stream4 || s instanceof EE && (typeof s.pipe === "function" || typeof s.write === "function" && typeof s.end === "function")); } }; }); @@ -735116,21 +657682,21 @@ var require_minipass_flush = __commonJS((exports, module) => { var require_write = __commonJS((exports, module) => { var events2 = __require("events"); var contentPath = require_path(); - var fs12 = __require("fs/promises"); - var { moveFile } = require_lib17(); + var fs6 = __require("fs/promises"); + var { moveFile } = require_lib15(); var { Minipass } = require_commonjs(); var Pipeline = require_minipass_pipeline(); var Flush = require_minipass_flush(); - var path29 = __require("path"); - var ssri = require_lib14(); - var uniqueFilename = require_lib16(); - var fsm = require_lib18(); + var path24 = __require("path"); + var ssri = require_lib12(); + var uniqueFilename = require_lib14(); + var fsm = require_lib16(); module.exports = write; var moveOperations = new Map; async function write(cache6, data, opts = {}) { - const { algorithms, size: size3, integrity } = opts; - if (typeof size3 === "number" && data.length !== size3) { - throw sizeError(size3, data.length); + const { algorithms, size: size2, integrity } = opts; + if (typeof size2 === "number" && data.length !== size2) { + throw sizeError(size2, data.length); } const sri = ssri.fromData(data, algorithms ? { algorithms } : {}); if (integrity && !ssri.checkData(data, integrity, opts)) { @@ -735140,11 +657706,11 @@ var require_write = __commonJS((exports, module) => { const tmp = await makeTmp(cache6, opts); const hash2 = sri[algo].toString(); try { - await fs12.writeFile(tmp.target, data, { flag: "wx" }); + await fs6.writeFile(tmp.target, data, { flag: "wx" }); await moveToDestination(tmp, cache6, hash2, opts); } finally { if (!tmp.moved) { - await fs12.rm(tmp.target, { recursive: true, force: true }); + await fs6.rm(tmp.target, { recursive: true, force: true }); } } } @@ -735162,12 +657728,12 @@ var require_write = __commonJS((exports, module) => { this.inputStream.on("drain", () => this.emit("drain")); this.handleContentP = null; } - write(chunk4, encoding, cb) { + write(chunk3, encoding, cb) { if (!this.handleContentP) { this.handleContentP = handleContent(this.inputStream, this.cache, this.opts); - this.handleContentP.catch((error46) => this.emit("error", error46)); + this.handleContentP.catch((error42) => this.emit("error", error42)); } - return this.inputStream.write(chunk4, encoding, cb); + return this.inputStream.write(chunk3, encoding, cb); } flush(cb) { this.inputStream.end(() => { @@ -735195,7 +657761,7 @@ var require_write = __commonJS((exports, module) => { return res; } finally { if (!tmp.moved) { - await fs12.rm(tmp.target, { recursive: true, force: true }); + await fs6.rm(tmp.target, { recursive: true, force: true }); } } } @@ -735204,33 +657770,33 @@ var require_write = __commonJS((exports, module) => { flags: "wx" }); if (opts.integrityEmitter) { - const [integrity2, size4] = await Promise.all([ + const [integrity2, size3] = await Promise.all([ events2.once(opts.integrityEmitter, "integrity").then((res) => res[0]), events2.once(opts.integrityEmitter, "size").then((res) => res[0]), new Pipeline(inputStream, outStream).promise() ]); - return { integrity: integrity2, size: size4 }; + return { integrity: integrity2, size: size3 }; } let integrity; - let size3; + let size2; const hashStream = ssri.integrityStream({ integrity: opts.integrity, algorithms: opts.algorithms, size: opts.size }); - hashStream.on("integrity", (i4) => { - integrity = i4; + hashStream.on("integrity", (i3) => { + integrity = i3; }); hashStream.on("size", (s) => { - size3 = s; + size2 = s; }); const pipeline4 = new Pipeline(inputStream, hashStream, outStream); await pipeline4.promise(); - return { integrity, size: size3 }; + return { integrity, size: size2 }; } async function makeTmp(cache6, opts) { - const tmpTarget = uniqueFilename(path29.join(cache6, "tmp"), opts.tmpPrefix); - await fs12.mkdir(path29.dirname(tmpTarget), { recursive: true }); + const tmpTarget = uniqueFilename(path24.join(cache6, "tmp"), opts.tmpPrefix); + await fs6.mkdir(path24.dirname(tmpTarget), { recursive: true }); return { target: tmpTarget, moved: false @@ -735238,17 +657804,17 @@ var require_write = __commonJS((exports, module) => { } async function moveToDestination(tmp, cache6, sri) { const destination = contentPath(cache6, sri); - const destDir = path29.dirname(destination); + const destDir = path24.dirname(destination); if (moveOperations.has(destination)) { return moveOperations.get(destination); } - moveOperations.set(destination, fs12.mkdir(destDir, { recursive: true }).then(async () => { + moveOperations.set(destination, fs6.mkdir(destDir, { recursive: true }).then(async () => { await moveFile(tmp.target, destination, { overwrite: false }); tmp.moved = true; return tmp.moved; - }).catch((err3) => { - if (!err3.message.startsWith("The destination file exists")) { - throw Object.assign(err3, { code: "EEXIST" }); + }).catch((err2) => { + if (!err2.message.startsWith("The destination file exists")) { + throw Object.assign(err2, { code: "EEXIST" }); } }).finally(() => { moveOperations.delete(destination); @@ -735256,20 +657822,20 @@ var require_write = __commonJS((exports, module) => { return moveOperations.get(destination); } function sizeError(expected, found) { - const err3 = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`); - err3.expected = expected; - err3.found = found; - err3.code = "EBADSIZE"; - return err3; + const err2 = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`); + err2.expected = expected; + err2.found = found; + err2.code = "EBADSIZE"; + return err2; } function checksumError(expected, found) { - const err3 = new Error(`Integrity check failed: + const err2 = new Error(`Integrity check failed: Wanted: ${expected} Found: ${found}`); - err3.code = "EINTEGRITY"; - err3.expected = expected; - err3.found = found; - return err3; + err2.code = "EINTEGRITY"; + err2.expected = expected; + err2.found = found; + return err2; } }); @@ -735287,25 +657853,25 @@ var require_put = __commonJS((exports, module) => { }); module.exports = putData; async function putData(cache6, key, data, opts = {}) { - const { memoize: memoize3 } = opts; + const { memoize: memoize2 } = opts; opts = putOpts(opts); const res = await write(cache6, data, opts); const entry = await index.insert(cache6, key, res.integrity, { ...opts, size: res.size }); - if (memoize3) { + if (memoize2) { memo11.put(cache6, entry, data, opts); } return res.integrity; } module.exports.stream = putStream; function putStream(cache6, key, opts = {}) { - const { memoize: memoize3 } = opts; + const { memoize: memoize2 } = opts; opts = putOpts(opts); let integrity; - let size3; - let error46; + let size2; + let error42; let memoData; const pipeline4 = new Pipeline; - if (memoize3) { + if (memoize2) { const memoizer = new PassThrough4().on("collect", (data) => { memoData = data; }); @@ -735314,20 +657880,20 @@ var require_put = __commonJS((exports, module) => { const contentStream = write.stream(cache6, opts).on("integrity", (int3) => { integrity = int3; }).on("size", (s) => { - size3 = s; - }).on("error", (err3) => { - error46 = err3; + size2 = s; + }).on("error", (err2) => { + error42 = err2; }); pipeline4.push(contentStream); pipeline4.push(new Flush({ async flush() { - if (!error46) { - const entry = await index.insert(cache6, key, integrity, { ...opts, size: size3 }); - if (memoize3 && memoData) { + if (!error42) { + const entry = await index.insert(cache6, key, integrity, { ...opts, size: size2 }); + if (memoize2 && memoData) { memo11.put(cache6, entry, memoData, opts); } pipeline4.emit("integrity", integrity); - pipeline4.emit("size", size3); + pipeline4.emit("size", size2); } } })); @@ -735343,7 +657909,7 @@ var require_balanced_match = __commonJS((exports, module) => { a2 = maybeMatch(a2, str2); if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range3(a2, b, str2); + var r = range2(a2, b, str2); return r && { start: r[0], end: r[1], @@ -735356,39 +657922,39 @@ var require_balanced_match = __commonJS((exports, module) => { var m = str2.match(reg); return m ? m[0] : null; } - balanced.range = range3; - function range3(a2, b, str2) { - var begs, beg, left, right, result3; + balanced.range = range2; + function range2(a2, b, str2) { + var begs, beg, left, right, result2; var ai = str2.indexOf(a2); var bi = str2.indexOf(b, ai + 1); - var i4 = ai; + var i3 = ai; if (ai >= 0 && bi > 0) { if (a2 === b) { return [ai, bi]; } begs = []; left = str2.length; - while (i4 >= 0 && !result3) { - if (i4 == ai) { - begs.push(i4); - ai = str2.indexOf(a2, i4 + 1); + while (i3 >= 0 && !result2) { + if (i3 == ai) { + begs.push(i3); + ai = str2.indexOf(a2, i3 + 1); } else if (begs.length == 1) { - result3 = [begs.pop(), bi]; + result2 = [begs.pop(), bi]; } else { beg = begs.pop(); if (beg < left) { left = beg; right = bi; } - bi = str2.indexOf(b, i4 + 1); + bi = str2.indexOf(b, i3 + 1); } - i4 = ai < bi && ai >= 0 ? ai : bi; + i3 = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { - result3 = [left, right]; + result2 = [left, right]; } } - return result3; + return result2; } }); @@ -735444,11 +658010,11 @@ var require_brace_expansion = __commonJS((exports, module) => { function isPadded(el) { return /^-?0\d/.test(el); } - function lte3(i4, y2) { - return i4 <= y2; + function lte2(i3, y2) { + return i3 <= y2; } - function gte4(i4, y2) { - return i4 >= y2; + function gte3(i3, y2) { + return i3 >= y2; } function expand(str2, isTop) { var expansions = []; @@ -735490,31 +658056,31 @@ var require_brace_expansion = __commonJS((exports, module) => { } var N; if (isSequence) { - var x4 = numeric(n3[0]); + var x3 = numeric(n3[0]); var y2 = numeric(n3[1]); var width = Math.max(n3[0].length, n3[1].length); var incr = n3.length == 3 ? Math.max(Math.abs(numeric(n3[2])), 1) : 1; - var test2 = lte3; - var reverse3 = y2 < x4; - if (reverse3) { + var test2 = lte2; + var reverse2 = y2 < x3; + if (reverse2) { incr *= -1; - test2 = gte4; + test2 = gte3; } - var pad3 = n3.some(isPadded); + var pad2 = n3.some(isPadded); N = []; - for (var i4 = x4;test2(i4, y2); i4 += incr) { + for (var i3 = x3;test2(i3, y2); i3 += incr) { var c6; if (isAlphaSequence) { - c6 = String.fromCharCode(i4); + c6 = String.fromCharCode(i3); if (c6 === "\\") c6 = ""; } else { - c6 = String(i4); - if (pad3) { + c6 = String(i3); + if (pad2) { var need = width - c6.length; if (need > 0) { var z2 = new Array(need + 1).join("0"); - if (i4 < 0) + if (i3 < 0) c6 = "-" + z2 + c6.slice(1); else c6 = z2 + c6; @@ -735587,40 +658153,40 @@ var require_brace_expressions = __commonJS((exports) => { } const ranges = []; const negs = []; - let i4 = pos + 1; + let i3 = pos + 1; let sawStart = false; let uflag = false; let escaping = false; - let negate3 = false; + let negate2 = false; let endPos = pos; let rangeStart = ""; WHILE: - while (i4 < glob2.length) { - const c6 = glob2.charAt(i4); - if ((c6 === "!" || c6 === "^") && i4 === pos + 1) { - negate3 = true; - i4++; + while (i3 < glob2.length) { + const c6 = glob2.charAt(i3); + if ((c6 === "!" || c6 === "^") && i3 === pos + 1) { + negate2 = true; + i3++; continue; } if (c6 === "]" && sawStart && !escaping) { - endPos = i4 + 1; + endPos = i3 + 1; break; } sawStart = true; if (c6 === "\\") { if (!escaping) { escaping = true; - i4++; + i3++; continue; } } if (c6 === "[" && !escaping) { for (const [cls, [unip, u2, neg]] of Object.entries(posixClasses)) { - if (glob2.startsWith(cls, i4)) { + if (glob2.startsWith(cls, i3)) { if (rangeStart) { return ["$.", false, glob2.length - pos, true]; } - i4 += cls.length; + i3 += cls.length; if (neg) negs.push(unip); else @@ -735638,34 +658204,34 @@ var require_brace_expressions = __commonJS((exports) => { ranges.push(braceEscape(c6)); } rangeStart = ""; - i4++; + i3++; continue; } - if (glob2.startsWith("-]", i4 + 1)) { + if (glob2.startsWith("-]", i3 + 1)) { ranges.push(braceEscape(c6 + "-")); - i4 += 2; + i3 += 2; continue; } - if (glob2.startsWith("-", i4 + 1)) { + if (glob2.startsWith("-", i3 + 1)) { rangeStart = c6; - i4 += 2; + i3 += 2; continue; } ranges.push(braceEscape(c6)); - i4++; + i3++; } - if (endPos < i4) { + if (endPos < i3) { return ["", false, 0, false]; } if (!ranges.length && !negs.length) { return ["$.", false, glob2.length - pos, true]; } - if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate3) { + if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate2) { const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; return [regexpEscape(r), false, endPos - pos, false]; } - const sranges = "[" + (negate3 ? "^" : "") + rangesToString(ranges) + "]"; - const snegs = "[" + (negate3 ? "" : "^") + rangesToString(negs) + "]"; + const sranges = "[" + (negate2 ? "^" : "") + rangesToString(ranges) + "]"; + const snegs = "[" + (negate2 ? "" : "^") + rangesToString(negs) + "]"; const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs; return [comb, uflag, endPos - pos, true]; }; @@ -735676,21 +658242,21 @@ var require_brace_expressions = __commonJS((exports) => { var require_unescape = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.unescape = undefined; - var unescape4 = (s, { windowsPathsNoEscape = false } = {}) => { + var unescape3 = (s, { windowsPathsNoEscape = false } = {}) => { return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"); }; - exports.unescape = unescape4; + exports.unescape = unescape3; }); // node_modules/minimatch/dist/commonjs/ast.js var require_ast = __commonJS((exports) => { - var _a5; + var _a3; Object.defineProperty(exports, "__esModule", { value: true }); exports.AST = undefined; var brace_expressions_js_1 = require_brace_expressions(); var unescape_js_1 = require_unescape(); - var types4 = new Set(["!", "?", "+", "*", "@"]); - var isExtglobType = (c6) => types4.has(c6); + var types3 = new Set(["!", "?", "+", "*", "@"]); + var isExtglobType = (c6) => types3.has(c6); var isExtglobAST = (c6) => isExtglobType(c6.type); var adoptionMap = new Map([ ["!", ["@"]], @@ -735740,11 +658306,11 @@ var require_ast = __commonJS((exports) => { #options; #toString; #emptyExt = false; - constructor(type, parent3, options2 = {}) { + constructor(type, parent2, options2 = {}) { this.type = type; if (type) this.#hasMagic = true; - this.#parent = parent3; + this.#parent = parent2; this.#root = this.#parent ? this.#parent.#root : this; this.#options = this.#root === this ? options2 : this.#root.#options; this.#negs = this.#root === this ? [] : this.#root.#negs; @@ -735786,12 +658352,12 @@ var require_ast = __commonJS((exports) => { let p = n3; let pp = p.#parent; while (pp) { - for (let i4 = p.#parentIndex + 1;!pp.type && i4 < pp.#parts.length; i4++) { + for (let i3 = p.#parentIndex + 1;!pp.type && i3 < pp.#parts.length; i3++) { for (const part of n3.#parts) { if (typeof part === "string") { throw new Error("string part in extglob AST??"); } - part.copyIn(pp.#parts[i4]); + part.copyIn(pp.#parts[i3]); } } p = pp; @@ -735804,7 +658370,7 @@ var require_ast = __commonJS((exports) => { for (const p of parts) { if (p === "") continue; - if (typeof p !== "string" && !(p instanceof _a5 && p.#parent === this)) { + if (typeof p !== "string" && !(p instanceof _a3 && p.#parent === this)) { throw new Error("invalid part: " + p); } this.#parts.push(p); @@ -735827,9 +658393,9 @@ var require_ast = __commonJS((exports) => { if (this.#parentIndex === 0) return true; const p = this.#parent; - for (let i4 = 0;i4 < this.#parentIndex; i4++) { - const pp = p.#parts[i4]; - if (!(pp instanceof _a5 && pp.type === "!")) { + for (let i3 = 0;i3 < this.#parentIndex; i3++) { + const pp = p.#parts[i3]; + if (!(pp instanceof _a3 && pp.type === "!")) { return false; } } @@ -735853,8 +658419,8 @@ var require_ast = __commonJS((exports) => { else this.push(part.clone(this)); } - clone(parent3) { - const c6 = new _a5(this.type, parent3); + clone(parent2) { + const c6 = new _a3(this.type, parent2); for (const p of this.#parts) { c6.copyIn(p); } @@ -735867,89 +658433,89 @@ var require_ast = __commonJS((exports) => { let braceStart = -1; let braceNeg = false; if (ast.type === null) { - let i5 = pos; + let i4 = pos; let acc2 = ""; - while (i5 < str2.length) { - const c6 = str2.charAt(i5++); + while (i4 < str2.length) { + const c6 = str2.charAt(i4++); if (escaping || c6 === "\\") { escaping = !escaping; acc2 += c6; continue; } if (inBrace) { - if (i5 === braceStart + 1) { + if (i4 === braceStart + 1) { if (c6 === "^" || c6 === "!") { braceNeg = true; } - } else if (c6 === "]" && !(i5 === braceStart + 2 && braceNeg)) { + } else if (c6 === "]" && !(i4 === braceStart + 2 && braceNeg)) { inBrace = false; } acc2 += c6; continue; } else if (c6 === "[") { inBrace = true; - braceStart = i5; + braceStart = i4; braceNeg = false; acc2 += c6; continue; } - const doRecurse = !opt.noext && isExtglobType(c6) && str2.charAt(i5) === "(" && extDepth <= maxDepth; + const doRecurse = !opt.noext && isExtglobType(c6) && str2.charAt(i4) === "(" && extDepth <= maxDepth; if (doRecurse) { ast.push(acc2); acc2 = ""; - const ext = new _a5(c6, ast); - i5 = _a5.#parseAST(str2, ext, i5, opt, extDepth + 1); + const ext = new _a3(c6, ast); + i4 = _a3.#parseAST(str2, ext, i4, opt, extDepth + 1); ast.push(ext); continue; } acc2 += c6; } ast.push(acc2); - return i5; + return i4; } - let i4 = pos + 1; - let part = new _a5(null, ast); + let i3 = pos + 1; + let part = new _a3(null, ast); const parts = []; let acc = ""; - while (i4 < str2.length) { - const c6 = str2.charAt(i4++); + while (i3 < str2.length) { + const c6 = str2.charAt(i3++); if (escaping || c6 === "\\") { escaping = !escaping; acc += c6; continue; } if (inBrace) { - if (i4 === braceStart + 1) { + if (i3 === braceStart + 1) { if (c6 === "^" || c6 === "!") { braceNeg = true; } - } else if (c6 === "]" && !(i4 === braceStart + 2 && braceNeg)) { + } else if (c6 === "]" && !(i3 === braceStart + 2 && braceNeg)) { inBrace = false; } acc += c6; continue; } else if (c6 === "[") { inBrace = true; - braceStart = i4; + braceStart = i3; braceNeg = false; acc += c6; continue; } - const doRecurse = isExtglobType(c6) && str2.charAt(i4) === "(" && (extDepth <= maxDepth || ast && ast.#canAdoptType(c6)); + const doRecurse = isExtglobType(c6) && str2.charAt(i3) === "(" && (extDepth <= maxDepth || ast && ast.#canAdoptType(c6)); if (doRecurse) { const depthAdd = ast && ast.#canAdoptType(c6) ? 0 : 1; part.push(acc); acc = ""; - const ext = new _a5(c6, part); + const ext = new _a3(c6, part); part.push(ext); - i4 = _a5.#parseAST(str2, ext, i4, opt, extDepth + depthAdd); + i3 = _a3.#parseAST(str2, ext, i3, opt, extDepth + depthAdd); continue; } if (c6 === "|") { part.push(acc); acc = ""; parts.push(part); - part = new _a5(null, ast); + part = new _a3(null, ast); continue; } if (c6 === ")") { @@ -735959,19 +658525,19 @@ var require_ast = __commonJS((exports) => { part.push(acc); acc = ""; ast.push(...parts, part); - return i4; + return i3; } acc += c6; } ast.type = null; ast.#hasMagic = undefined; ast.#parts = [str2.substring(pos - 1)]; - return i4; + return i3; } #canAdoptWithSpace(child) { return this.#canAdopt(child, adoptionWithSpaceMap); } - #canAdopt(child, map7 = adoptionMap) { + #canAdopt(child, map5 = adoptionMap) { if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) { return false; } @@ -735979,14 +658545,14 @@ var require_ast = __commonJS((exports) => { if (!gc || typeof gc !== "object" || gc.type === null) { return false; } - return this.#canAdoptType(gc.type, map7); + return this.#canAdoptType(gc.type, map5); } - #canAdoptType(c6, map7 = adoptionAnyMap) { - return !!map7.get(this.type)?.includes(c6); + #canAdoptType(c6, map5 = adoptionAnyMap) { + return !!map5.get(this.type)?.includes(c6); } #adoptWithSpace(child, index) { const gc = child.#parts[0]; - const blank = new _a5(null, gc, this.options); + const blank = new _a3(null, gc, this.options); blank.#parts.push(""); gc.push(blank); this.#adopt(child, index); @@ -736040,16 +658606,16 @@ var require_ast = __commonJS((exports) => { let done = false; do { done = true; - for (let i4 = 0;i4 < this.#parts.length; i4++) { - const c6 = this.#parts[i4]; + for (let i3 = 0;i3 < this.#parts.length; i3++) { + const c6 = this.#parts[i3]; if (typeof c6 === "object") { c6.#flatten(); if (this.#canAdopt(c6)) { done = false; - this.#adopt(c6, i4); + this.#adopt(c6, i3); } else if (this.#canAdoptWithSpace(c6)) { done = false; - this.#adoptWithSpace(c6, i4); + this.#adoptWithSpace(c6, i3); } else if (this.#canUsurp(c6)) { done = false; this.#usurp(c6); @@ -736061,8 +658627,8 @@ var require_ast = __commonJS((exports) => { this.#toString = undefined; } static fromGlob(pattern, options2 = {}) { - const ast = new _a5(null, undefined, options2); - _a5.#parseAST(pattern, ast, 0, options2, 0); + const ast = new _a3(null, undefined, options2); + _a3.#parseAST(pattern, ast, 0, options2, 0); return ast; } toMMPattern() { @@ -736092,7 +658658,7 @@ var require_ast = __commonJS((exports) => { if (!isExtglobAST(this)) { const noEmpty = this.isStart() && this.isEnd(); const src = this.#parts.map((p) => { - const [re, _, hasMagic, uflag] = typeof p === "string" ? _a5.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); + const [re, _, hasMagic, uflag] = typeof p === "string" ? _a3.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; this.#uflag = this.#uflag || uflag; return re; @@ -736168,8 +658734,8 @@ var require_ast = __commonJS((exports) => { let re = ""; let uflag = false; let inStar = false; - for (let i4 = 0;i4 < glob2.length; i4++) { - const c6 = glob2.charAt(i4); + for (let i3 = 0;i3 < glob2.length; i3++) { + const c6 = glob2.charAt(i3); if (escaping) { escaping = false; re += (reSpecials.has(c6) ? "\\" : "") + c6; @@ -736177,7 +658743,7 @@ var require_ast = __commonJS((exports) => { continue; } if (c6 === "\\") { - if (i4 === glob2.length - 1) { + if (i3 === glob2.length - 1) { re += "\\\\"; } else { escaping = true; @@ -736185,11 +658751,11 @@ var require_ast = __commonJS((exports) => { continue; } if (c6 === "[") { - const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob2, i4); + const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob2, i3); if (consumed) { re += src; uflag = uflag || needUflag; - i4 += consumed - 1; + i3 += consumed - 1; hasMagic = hasMagic || magic; inStar = false; continue; @@ -736216,17 +658782,17 @@ var require_ast = __commonJS((exports) => { } } exports.AST = AST; - _a5 = AST; + _a3 = AST; }); // node_modules/minimatch/dist/commonjs/escape.js var require_escape2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.escape = undefined; - var escape5 = (s, { windowsPathsNoEscape = false } = {}) => { + var escape4 = (s, { windowsPathsNoEscape = false } = {}) => { return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); }; - exports.escape = escape5; + exports.escape = escape4; }); // node_modules/minimatch/dist/commonjs/index.js @@ -736300,11 +658866,11 @@ var require_commonjs3 = __commonJS((exports) => { return (f) => f.length === len && f !== "." && f !== ".."; }; var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix"; - var path29 = { + var path24 = { win32: { sep: "\\" }, posix: { sep: "/" } }; - exports.sep = defaultPlatform === "win32" ? path29.win32.sep : path29.posix.sep; + exports.sep = defaultPlatform === "win32" ? path24.win32.sep : path24.posix.sep; exports.minimatch.sep = exports.sep; exports.GLOBSTAR = Symbol("globstar **"); exports.minimatch.GLOBSTAR = exports.GLOBSTAR; @@ -736312,11 +658878,11 @@ var require_commonjs3 = __commonJS((exports) => { var star = qmark + "*?"; var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var filter4 = (pattern, options2 = {}) => (p) => (0, exports.minimatch)(p, pattern, options2); - exports.filter = filter4; + var filter3 = (pattern, options2 = {}) => (p) => (0, exports.minimatch)(p, pattern, options2); + exports.filter = filter3; exports.minimatch.filter = exports.filter; var ext = (a2, b = {}) => Object.assign({}, a2, b); - var defaults4 = (def2) => { + var defaults3 = (def2) => { if (!def2 || typeof def2 !== "object" || !Object.keys(def2).length) { return exports.minimatch; } @@ -736332,8 +658898,8 @@ var require_commonjs3 = __commonJS((exports) => { } }, AST: class AST extends orig.AST { - constructor(type, parent3, options2 = {}) { - super(type, parent3, ext(def2, options2)); + constructor(type, parent2, options2 = {}) { + super(type, parent2, ext(def2, options2)); } static fromGlob(pattern, options2 = {}) { return orig.AST.fromGlob(pattern, ext(def2, options2)); @@ -736350,7 +658916,7 @@ var require_commonjs3 = __commonJS((exports) => { GLOBSTAR: exports.GLOBSTAR }); }; - exports.defaults = defaults4; + exports.defaults = defaults3; exports.minimatch.defaults = exports.defaults; var braceExpand = (pattern, options2 = {}) => { (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); @@ -736455,7 +659021,7 @@ var require_commonjs3 = __commonJS((exports) => { const rawGlobParts = this.globSet.map((s) => this.slashSplit(s)); this.globParts = this.preprocess(rawGlobParts); this.debug(this.pattern, this.globParts); - let set6 = this.globParts.map((s, _, __) => { + let set5 = this.globParts.map((s, _, __) => { if (this.isWindows && this.windowsNoMagicRoot) { const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]); const isDrive = /^[a-z]:/i.test(s[0]); @@ -736467,12 +659033,12 @@ var require_commonjs3 = __commonJS((exports) => { } return s.map((ss) => this.parse(ss)); }); - this.debug(this.pattern, set6); - this.set = set6.filter((s) => s.indexOf(false) === -1); + this.debug(this.pattern, set5); + this.set = set5.filter((s) => s.indexOf(false) === -1); if (this.isWindows) { - for (let i4 = 0;i4 < this.set.length; i4++) { - const p = this.set[i4]; - if (p[0] === "" && p[1] === "" && this.globParts[i4][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) { + for (let i3 = 0;i3 < this.set.length; i3++) { + const p = this.set[i3]; + if (p[0] === "" && p[1] === "" && this.globParts[i3][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) { p[2] = "?"; } } @@ -736481,10 +659047,10 @@ var require_commonjs3 = __commonJS((exports) => { } preprocess(globParts) { if (this.options.noglobstar) { - for (let i4 = 0;i4 < globParts.length; i4++) { - for (let j = 0;j < globParts[i4].length; j++) { - if (globParts[i4][j] === "**") { - globParts[i4][j] = "*"; + for (let i3 = 0;i3 < globParts.length; i3++) { + for (let j = 0;j < globParts[i3].length; j++) { + if (globParts[i3][j] === "**") { + globParts[i3][j] = "*"; } } } @@ -736504,12 +659070,12 @@ var require_commonjs3 = __commonJS((exports) => { return globParts.map((parts) => { let gs = -1; while ((gs = parts.indexOf("**", gs + 1)) !== -1) { - let i4 = gs; - while (parts[i4 + 1] === "**") { - i4++; + let i3 = gs; + while (parts[i3 + 1] === "**") { + i3++; } - if (i4 !== gs) { - parts.splice(gs, i4 - gs); + if (i3 !== gs) { + parts.splice(gs, i3 - gs); } } return parts; @@ -736517,19 +659083,19 @@ var require_commonjs3 = __commonJS((exports) => { } levelOneOptimize(globParts) { return globParts.map((parts) => { - parts = parts.reduce((set6, part) => { - const prev = set6[set6.length - 1]; + parts = parts.reduce((set5, part) => { + const prev = set5[set5.length - 1]; if (part === "**" && prev === "**") { - return set6; + return set5; } if (part === "..") { if (prev && prev !== ".." && prev !== "." && prev !== "**") { - set6.pop(); - return set6; + set5.pop(); + return set5; } } - set6.push(part); - return set6; + set5.push(part); + return set5; }, []); return parts.length === 0 ? [""] : parts; }); @@ -736542,14 +659108,14 @@ var require_commonjs3 = __commonJS((exports) => { do { didSomething = false; if (!this.preserveMultipleSlashes) { - for (let i4 = 1;i4 < parts.length - 1; i4++) { - const p = parts[i4]; - if (i4 === 1 && p === "" && parts[0] === "") + for (let i3 = 1;i3 < parts.length - 1; i3++) { + const p = parts[i3]; + if (i3 === 1 && p === "" && parts[0] === "") continue; if (p === "." || p === "") { didSomething = true; - parts.splice(i4, 1); - i4--; + parts.splice(i3, 1); + i3--; } } if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) { @@ -736599,14 +659165,14 @@ var require_commonjs3 = __commonJS((exports) => { gs--; } if (!this.preserveMultipleSlashes) { - for (let i4 = 1;i4 < parts.length - 1; i4++) { - const p = parts[i4]; - if (i4 === 1 && p === "" && parts[0] === "") + for (let i3 = 1;i3 < parts.length - 1; i3++) { + const p = parts[i3]; + if (i3 === 1 && p === "" && parts[0] === "") continue; if (p === "." || p === "") { didSomething = true; - parts.splice(i4, 1); - i4--; + parts.splice(i3, 1); + i3--; } } if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) { @@ -736632,11 +659198,11 @@ var require_commonjs3 = __commonJS((exports) => { return globParts; } secondPhasePreProcess(globParts) { - for (let i4 = 0;i4 < globParts.length - 1; i4++) { - for (let j = i4 + 1;j < globParts.length; j++) { - const matched = this.partsMatch(globParts[i4], globParts[j], !this.preserveMultipleSlashes); + for (let i3 = 0;i3 < globParts.length - 1; i3++) { + for (let j = i3 + 1;j < globParts.length; j++) { + const matched = this.partsMatch(globParts[i3], globParts[j], !this.preserveMultipleSlashes); if (matched) { - globParts[i4] = []; + globParts[i3] = []; globParts[j] = matched; break; } @@ -736647,54 +659213,54 @@ var require_commonjs3 = __commonJS((exports) => { partsMatch(a2, b, emptyGSMatch = false) { let ai = 0; let bi = 0; - let result3 = []; + let result2 = []; let which2 = ""; while (ai < a2.length && bi < b.length) { if (a2[ai] === b[bi]) { - result3.push(which2 === "b" ? b[bi] : a2[ai]); + result2.push(which2 === "b" ? b[bi] : a2[ai]); ai++; bi++; } else if (emptyGSMatch && a2[ai] === "**" && b[bi] === a2[ai + 1]) { - result3.push(a2[ai]); + result2.push(a2[ai]); ai++; } else if (emptyGSMatch && b[bi] === "**" && a2[ai] === b[bi + 1]) { - result3.push(b[bi]); + result2.push(b[bi]); bi++; } else if (a2[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") { if (which2 === "b") return false; which2 = "a"; - result3.push(a2[ai]); + result2.push(a2[ai]); ai++; bi++; } else if (b[bi] === "*" && a2[ai] && (this.options.dot || !a2[ai].startsWith(".")) && a2[ai] !== "**") { if (which2 === "a") return false; which2 = "b"; - result3.push(b[bi]); + result2.push(b[bi]); ai++; bi++; } else { return false; } } - return a2.length === b.length && result3; + return a2.length === b.length && result2; } parseNegate() { if (this.nonegate) return; const pattern = this.pattern; - let negate3 = false; + let negate2 = false; let negateOffset = 0; - for (let i4 = 0;i4 < pattern.length && pattern.charAt(i4) === "!"; i4++) { - negate3 = !negate3; + for (let i3 = 0;i3 < pattern.length && pattern.charAt(i3) === "!"; i3++) { + negate2 = !negate2; negateOffset++; } if (negateOffset) this.pattern = pattern.slice(negateOffset); - this.negate = negate3; + this.negate = negate2; } - matchOne(file2, pattern, partial5 = false) { + matchOne(file2, pattern, partial4 = false) { let fileStartIndex = 0; let patternStartIndex = 0; if (this.isWindows) { @@ -736705,12 +659271,12 @@ var require_commonjs3 = __commonJS((exports) => { const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined; const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined; if (typeof fdi === "number" && typeof pdi === "number") { - const [fd3, pd] = [ + const [fd2, pd] = [ file2[fdi], pattern[pdi] ]; - if (fd3.toLowerCase() === pd.toLowerCase()) { - pattern[pdi] = fd3; + if (fd2.toLowerCase() === pd.toLowerCase()) { + pattern[pdi] = fd2; patternStartIndex = pdi; fileStartIndex = fdi; } @@ -736721,14 +659287,14 @@ var require_commonjs3 = __commonJS((exports) => { file2 = this.levelTwoFileOptimize(file2); } if (pattern.includes(exports.GLOBSTAR)) { - return this.#matchGlobstar(file2, pattern, partial5, fileStartIndex, patternStartIndex); + return this.#matchGlobstar(file2, pattern, partial4, fileStartIndex, patternStartIndex); } - return this.#matchOne(file2, pattern, partial5, fileStartIndex, patternStartIndex); + return this.#matchOne(file2, pattern, partial4, fileStartIndex, patternStartIndex); } - #matchGlobstar(file2, pattern, partial5, fileIndex2, patternIndex) { + #matchGlobstar(file2, pattern, partial4, fileIndex2, patternIndex) { const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex); const lastgs = pattern.lastIndexOf(exports.GLOBSTAR); - const [head3, body, tail3] = partial5 ? [ + const [head2, body, tail2] = partial4 ? [ pattern.slice(patternIndex, firstgs), pattern.slice(firstgs + 1), [] @@ -736737,39 +659303,39 @@ var require_commonjs3 = __commonJS((exports) => { pattern.slice(firstgs + 1, lastgs), pattern.slice(lastgs + 1) ]; - if (head3.length) { - const fileHead = file2.slice(fileIndex2, fileIndex2 + head3.length); - if (!this.#matchOne(fileHead, head3, partial5, 0, 0)) + if (head2.length) { + const fileHead = file2.slice(fileIndex2, fileIndex2 + head2.length); + if (!this.#matchOne(fileHead, head2, partial4, 0, 0)) return false; - fileIndex2 += head3.length; + fileIndex2 += head2.length; } let fileTailMatch = 0; - if (tail3.length) { - if (tail3.length + fileIndex2 > file2.length) + if (tail2.length) { + if (tail2.length + fileIndex2 > file2.length) return false; - let tailStart = file2.length - tail3.length; - if (this.#matchOne(file2, tail3, partial5, tailStart, 0)) { - fileTailMatch = tail3.length; + let tailStart = file2.length - tail2.length; + if (this.#matchOne(file2, tail2, partial4, tailStart, 0)) { + fileTailMatch = tail2.length; } else { - if (file2[file2.length - 1] !== "" || fileIndex2 + tail3.length === file2.length) { + if (file2[file2.length - 1] !== "" || fileIndex2 + tail2.length === file2.length) { return false; } tailStart--; - if (!this.#matchOne(file2, tail3, partial5, tailStart, 0)) + if (!this.#matchOne(file2, tail2, partial4, tailStart, 0)) return false; - fileTailMatch = tail3.length + 1; + fileTailMatch = tail2.length + 1; } } if (!body.length) { let sawSome = !!fileTailMatch; - for (let i5 = fileIndex2;i5 < file2.length - fileTailMatch; i5++) { - const f = String(file2[i5]); + for (let i4 = fileIndex2;i4 < file2.length - fileTailMatch; i4++) { + const f = String(file2[i4]); sawSome = true; if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { return false; } } - return partial5 || sawSome; + return partial4 || sawSome; } const bodySegments = [[[], 0]]; let currentBody = bodySegments[0]; @@ -736785,30 +659351,30 @@ var require_commonjs3 = __commonJS((exports) => { nonGsParts++; } } - let i4 = bodySegments.length - 1; + let i3 = bodySegments.length - 1; const fileLength = file2.length - fileTailMatch; for (const b of bodySegments) { - b[1] = fileLength - (nonGsPartsSums[i4--] + b[0].length); + b[1] = fileLength - (nonGsPartsSums[i3--] + b[0].length); } - return !!this.#matchGlobStarBodySections(file2, bodySegments, fileIndex2, 0, partial5, 0, !!fileTailMatch); + return !!this.#matchGlobStarBodySections(file2, bodySegments, fileIndex2, 0, partial4, 0, !!fileTailMatch); } - #matchGlobStarBodySections(file2, bodySegments, fileIndex2, bodyIndex, partial5, globStarDepth, sawTail) { + #matchGlobStarBodySections(file2, bodySegments, fileIndex2, bodyIndex, partial4, globStarDepth, sawTail) { const bs = bodySegments[bodyIndex]; if (!bs) { - for (let i4 = fileIndex2;i4 < file2.length; i4++) { + for (let i3 = fileIndex2;i3 < file2.length; i3++) { sawTail = true; - const f = file2[i4]; + const f = file2[i3]; if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) { return false; } } return sawTail; } - const [body, after3] = bs; - while (fileIndex2 <= after3) { - const m = this.#matchOne(file2.slice(0, fileIndex2 + body.length), body, partial5, fileIndex2, 0); + const [body, after2] = bs; + while (fileIndex2 <= after2) { + const m = this.#matchOne(file2.slice(0, fileIndex2 + body.length), body, partial4, fileIndex2, 0); if (m && globStarDepth < this.maxGlobstarRecursion) { - const sub = this.#matchGlobStarBodySections(file2, bodySegments, fileIndex2 + body.length, bodyIndex + 1, partial5, globStarDepth + 1, sawTail); + const sub = this.#matchGlobStarBodySections(file2, bodySegments, fileIndex2 + body.length, bodyIndex + 1, partial4, globStarDepth + 1, sawTail); if (sub !== false) return sub; } @@ -736818,14 +659384,14 @@ var require_commonjs3 = __commonJS((exports) => { } fileIndex2++; } - return partial5 || null; + return partial4 || null; } - #matchOne(file2, pattern, partial5, fileIndex2, patternIndex) { + #matchOne(file2, pattern, partial4, fileIndex2, patternIndex) { let fi; let pi; let pl2; - let fl3; - for (fi = fileIndex2, pi = patternIndex, fl3 = file2.length, pl2 = pattern.length;fi < fl3 && pi < pl2; fi++, pi++) { + let fl2; + for (fi = fileIndex2, pi = patternIndex, fl2 = file2.length, pl2 = pattern.length;fi < fl2 && pi < pl2; fi++, pi++) { this.debug("matchOne loop"); let p = pattern[pi]; let f = file2[fi]; @@ -736843,12 +659409,12 @@ var require_commonjs3 = __commonJS((exports) => { if (!hit) return false; } - if (fi === fl3 && pi === pl2) { + if (fi === fl2 && pi === pl2) { return true; - } else if (fi === fl3) { - return partial5; + } else if (fi === fl2) { + return partial4; } else if (pi === pl2) { - return fi === fl3 - 1 && file2[fi] === ""; + return fi === fl2 - 1 && file2[fi] === ""; } else { throw new Error("wtf?"); } @@ -736885,15 +659451,15 @@ var require_commonjs3 = __commonJS((exports) => { makeRe() { if (this.regexp || this.regexp === false) return this.regexp; - const set6 = this.set; - if (!set6.length) { + const set5 = this.set; + if (!set5.length) { this.regexp = false; return this.regexp; } const options2 = this.options; const twoStar = options2.noglobstar ? star : options2.dot ? twoStarDot : twoStarNoDot; const flags = new Set(options2.nocase ? ["i"] : []); - let re = set6.map((pattern) => { + let re = set5.map((pattern) => { const pp = pattern.map((p) => { if (p instanceof RegExp) { for (const f of p.flags.split("")) @@ -736901,28 +659467,28 @@ var require_commonjs3 = __commonJS((exports) => { } return typeof p === "string" ? regExpEscape(p) : p === exports.GLOBSTAR ? exports.GLOBSTAR : p._src; }); - pp.forEach((p, i4) => { - const next = pp[i4 + 1]; - const prev = pp[i4 - 1]; + pp.forEach((p, i3) => { + const next = pp[i3 + 1]; + const prev = pp[i3 - 1]; if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) { return; } if (prev === undefined) { if (next !== undefined && next !== exports.GLOBSTAR) { - pp[i4 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next; + pp[i3 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next; } else { - pp[i4] = twoStar; + pp[i3] = twoStar; } } else if (next === undefined) { - pp[i4 - 1] = prev + "(?:\\/|" + twoStar + ")?"; + pp[i3 - 1] = prev + "(?:\\/|" + twoStar + ")?"; } else if (next !== exports.GLOBSTAR) { - pp[i4 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next; - pp[i4 + 1] = exports.GLOBSTAR; + pp[i3 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next; + pp[i3 + 1] = exports.GLOBSTAR; } }); return pp.filter((p) => p !== exports.GLOBSTAR).join("/"); }).join("|"); - const [open17, close] = set6.length > 1 ? ["(?:", ")"] : ["", ""]; + const [open17, close] = set5.length > 1 ? ["(?:", ")"] : ["", ""]; re = "^" + open17 + re + close + "$"; if (this.negate) re = "^(?!" + re + ").+$"; @@ -736942,7 +659508,7 @@ var require_commonjs3 = __commonJS((exports) => { return p.split(/\/+/); } } - match(f, partial5 = this.partial) { + match(f, partial4 = this.partial) { this.debug("match", f, this.pattern); if (this.comment) { return false; @@ -736950,7 +659516,7 @@ var require_commonjs3 = __commonJS((exports) => { if (this.empty) { return f === ""; } - if (f === "/" && partial5) { + if (f === "/" && partial4) { return true; } const options2 = this.options; @@ -736959,21 +659525,21 @@ var require_commonjs3 = __commonJS((exports) => { } const ff = this.slashSplit(f); this.debug(this.pattern, "split", ff); - const set6 = this.set; - this.debug(this.pattern, "set", set6); + const set5 = this.set; + this.debug(this.pattern, "set", set5); let filename = ff[ff.length - 1]; if (!filename) { - for (let i4 = ff.length - 2;!filename && i4 >= 0; i4--) { - filename = ff[i4]; + for (let i3 = ff.length - 2;!filename && i3 >= 0; i3--) { + filename = ff[i3]; } } - for (let i4 = 0;i4 < set6.length; i4++) { - const pattern = set6[i4]; + for (let i3 = 0;i3 < set5.length; i3++) { + const pattern = set5[i3]; let file2 = ff; if (options2.matchBase && pattern.length === 1) { file2 = [filename]; } - const hit = this.matchOne(file2, pattern, partial5); + const hit = this.matchOne(file2, pattern, partial4); if (hit) { if (options2.flipNegate) { return true; @@ -737058,33 +659624,33 @@ var require_commonjs4 = __commonJS((exports) => { var shouldWarn = (code) => !warned.has(code); var TYPE = Symbol("type"); var isPosInt = (n3) => n3 && n3 === Math.floor(n3) && n3 > 0 && isFinite(n3); - var getUintArray = (max5) => !isPosInt(max5) ? null : max5 <= Math.pow(2, 8) ? Uint8Array : max5 <= Math.pow(2, 16) ? Uint16Array : max5 <= Math.pow(2, 32) ? Uint32Array : max5 <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; + var getUintArray = (max3) => !isPosInt(max3) ? null : max3 <= Math.pow(2, 8) ? Uint8Array : max3 <= Math.pow(2, 16) ? Uint16Array : max3 <= Math.pow(2, 32) ? Uint32Array : max3 <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; class ZeroArray extends Array { - constructor(size3) { - super(size3); + constructor(size2) { + super(size2); this.fill(0); } } - class Stack3 { + class Stack2 { heap; length; static #constructing = false; - static create(max5) { - const HeapCls = getUintArray(max5); + static create(max3) { + const HeapCls = getUintArray(max3); if (!HeapCls) return []; - Stack3.#constructing = true; - const s = new Stack3(max5, HeapCls); - Stack3.#constructing = false; + Stack2.#constructing = true; + const s = new Stack2(max3, HeapCls); + Stack2.#constructing = false; return s; } - constructor(max5, HeapCls) { - if (!Stack3.#constructing) { + constructor(max3, HeapCls) { + if (!Stack2.#constructing) { throw new TypeError("instantiate Stack using Stack.create(n)"); } - this.heap = new HeapCls(max5); + this.heap = new HeapCls(max3); this.length = 0; } push(n3) { @@ -737184,15 +659750,15 @@ var require_commonjs4 = __commonJS((exports) => { return this.#disposeAfter; } constructor(options2) { - const { max: max5 = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose: dispose3, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options2; - if (max5 !== 0 && !isPosInt(max5)) { + const { max: max3 = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose: dispose3, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options2; + if (max3 !== 0 && !isPosInt(max3)) { throw new TypeError("max option must be a nonnegative integer"); } - const UintArray = max5 ? getUintArray(max5) : Array; + const UintArray = max3 ? getUintArray(max3) : Array; if (!UintArray) { - throw new Error("invalid max value: " + max5); + throw new Error("invalid max value: " + max3); } - this.#max = max5; + this.#max = max3; this.#maxSize = maxSize; this.maxEntrySize = maxEntrySize || this.#maxSize; this.sizeCalculation = sizeCalculation; @@ -737214,13 +659780,13 @@ var require_commonjs4 = __commonJS((exports) => { this.#fetchMethod = fetchMethod; this.#hasFetchMethod = !!fetchMethod; this.#keyMap = new Map; - this.#keyList = new Array(max5).fill(undefined); - this.#valList = new Array(max5).fill(undefined); - this.#next = new UintArray(max5); - this.#prev = new UintArray(max5); + this.#keyList = new Array(max3).fill(undefined); + this.#valList = new Array(max3).fill(undefined); + this.#next = new UintArray(max3); + this.#prev = new UintArray(max3); this.#head = 0; this.#tail = 0; - this.#free = Stack3.create(max5); + this.#free = Stack2.create(max3); this.#size = 0; this.#calculatedSize = 0; if (typeof dispose3 === "function") { @@ -737358,27 +659924,27 @@ var require_commonjs4 = __commonJS((exports) => { this.#calculatedSize -= sizes[index]; sizes[index] = 0; }; - this.#requireSize = (k, v, size3, sizeCalculation) => { + this.#requireSize = (k, v, size2, sizeCalculation) => { if (this.#isBackgroundFetch(v)) { return 0; } - if (!isPosInt(size3)) { + if (!isPosInt(size2)) { if (sizeCalculation) { if (typeof sizeCalculation !== "function") { throw new TypeError("sizeCalculation must be a function"); } - size3 = sizeCalculation(v, k); - if (!isPosInt(size3)) { + size2 = sizeCalculation(v, k); + if (!isPosInt(size2)) { 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 size3; + return size2; }; - this.#addItemSize = (index, size3, status2) => { - sizes[index] = size3; + this.#addItemSize = (index, size2, status2) => { + sizes[index] = size2; if (this.#maxSize) { const maxSize = this.#maxSize - sizes[index]; while (this.#calculatedSize > maxSize) { @@ -737387,49 +659953,49 @@ var require_commonjs4 = __commonJS((exports) => { } this.#calculatedSize += sizes[index]; if (status2) { - status2.entrySize = size3; + status2.entrySize = size2; status2.totalCalculatedSize = this.#calculatedSize; } }; } #removeItemSize = (_i) => {}; #addItemSize = (_i, _s, _st) => {}; - #requireSize = (_k, _v, size3, sizeCalculation) => { - if (size3 || sizeCalculation) { + #requireSize = (_k, _v, size2, sizeCalculation) => { + if (size2 || sizeCalculation) { throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache"); } return 0; }; *#indexes({ allowStale = this.allowStale } = {}) { if (this.#size) { - for (let i4 = this.#tail;; ) { - if (!this.#isValidIndex(i4)) { + for (let i3 = this.#tail;; ) { + if (!this.#isValidIndex(i3)) { break; } - if (allowStale || !this.#isStale(i4)) { - yield i4; + if (allowStale || !this.#isStale(i3)) { + yield i3; } - if (i4 === this.#head) { + if (i3 === this.#head) { break; } else { - i4 = this.#prev[i4]; + i3 = this.#prev[i3]; } } } } *#rindexes({ allowStale = this.allowStale } = {}) { if (this.#size) { - for (let i4 = this.#head;; ) { - if (!this.#isValidIndex(i4)) { + for (let i3 = this.#head;; ) { + if (!this.#isValidIndex(i3)) { break; } - if (allowStale || !this.#isStale(i4)) { - yield i4; + if (allowStale || !this.#isStale(i3)) { + yield i3; } - if (i4 === this.#tail) { + if (i3 === this.#tail) { break; } else { - i4 = this.#next[i4]; + i3 = this.#next[i3]; } } } @@ -737438,48 +660004,48 @@ var require_commonjs4 = __commonJS((exports) => { return index !== undefined && this.#keyMap.get(this.#keyList[index]) === index; } *entries() { - for (const i4 of this.#indexes()) { - if (this.#valList[i4] !== undefined && this.#keyList[i4] !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { - yield [this.#keyList[i4], this.#valList[i4]]; + for (const i3 of this.#indexes()) { + if (this.#valList[i3] !== undefined && this.#keyList[i3] !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { + yield [this.#keyList[i3], this.#valList[i3]]; } } } *rentries() { - for (const i4 of this.#rindexes()) { - if (this.#valList[i4] !== undefined && this.#keyList[i4] !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { - yield [this.#keyList[i4], this.#valList[i4]]; + for (const i3 of this.#rindexes()) { + if (this.#valList[i3] !== undefined && this.#keyList[i3] !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { + yield [this.#keyList[i3], this.#valList[i3]]; } } } *keys() { - for (const i4 of this.#indexes()) { - const k = this.#keyList[i4]; - if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { + for (const i3 of this.#indexes()) { + const k = this.#keyList[i3]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { yield k; } } } *rkeys() { - for (const i4 of this.#rindexes()) { - const k = this.#keyList[i4]; - if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { + for (const i3 of this.#rindexes()) { + const k = this.#keyList[i3]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { yield k; } } } *values() { - for (const i4 of this.#indexes()) { - const v = this.#valList[i4]; - if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { - yield this.#valList[i4]; + for (const i3 of this.#indexes()) { + const v = this.#valList[i3]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { + yield this.#valList[i3]; } } } *rvalues() { - for (const i4 of this.#rindexes()) { - const v = this.#valList[i4]; - if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i4])) { - yield this.#valList[i4]; + for (const i3 of this.#rindexes()) { + const v = this.#valList[i3]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i3])) { + yield this.#valList[i3]; } } } @@ -737488,56 +660054,56 @@ var require_commonjs4 = __commonJS((exports) => { } [Symbol.toStringTag] = "LRUCache"; find(fn, getOptions2 = {}) { - for (const i4 of this.#indexes()) { - const v = this.#valList[i4]; + for (const i3 of this.#indexes()) { + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined) continue; - if (fn(value, this.#keyList[i4], this)) { - return this.get(this.#keyList[i4], getOptions2); + if (fn(value, this.#keyList[i3], this)) { + return this.get(this.#keyList[i3], getOptions2); } } } forEach(fn, thisp = this) { - for (const i4 of this.#indexes()) { - const v = this.#valList[i4]; + for (const i3 of this.#indexes()) { + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined) continue; - fn.call(thisp, value, this.#keyList[i4], this); + fn.call(thisp, value, this.#keyList[i3], this); } } rforEach(fn, thisp = this) { - for (const i4 of this.#rindexes()) { - const v = this.#valList[i4]; + for (const i3 of this.#rindexes()) { + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined) continue; - fn.call(thisp, value, this.#keyList[i4], this); + fn.call(thisp, value, this.#keyList[i3], this); } } purgeStale() { let deleted = false; - for (const i4 of this.#rindexes({ allowStale: true })) { - if (this.#isStale(i4)) { - this.#delete(this.#keyList[i4], "expire"); + for (const i3 of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i3)) { + this.#delete(this.#keyList[i3], "expire"); deleted = true; } } return deleted; } info(key) { - const i4 = this.#keyMap.get(key); - if (i4 === undefined) + const i3 = this.#keyMap.get(key); + if (i3 === undefined) return; - const v = this.#valList[i4]; + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined) return; const entry = { value }; if (this.#ttls && this.#starts) { - const ttl = this.#ttls[i4]; - const start = this.#starts[i4]; + const ttl = this.#ttls[i3]; + const start = this.#starts[i3]; if (ttl && start) { const remain = ttl - (perf.now() - start); entry.ttl = remain; @@ -737545,26 +660111,26 @@ var require_commonjs4 = __commonJS((exports) => { } } if (this.#sizes) { - entry.size = this.#sizes[i4]; + entry.size = this.#sizes[i3]; } return entry; } dump() { const arr = []; - for (const i4 of this.#indexes({ allowStale: true })) { - const key = this.#keyList[i4]; - const v = this.#valList[i4]; + for (const i3 of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i3]; + const v = this.#valList[i3]; const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === undefined || key === undefined) continue; const entry = { value }; if (this.#ttls && this.#starts) { - entry.ttl = this.#ttls[i4]; - const age = perf.now() - this.#starts[i4]; + entry.ttl = this.#ttls[i3]; + const age = perf.now() - this.#starts[i3]; entry.start = Math.floor(Date.now() - age); } if (this.#sizes) { - entry.size = this.#sizes[i4]; + entry.size = this.#sizes[i3]; } arr.unshift([key, entry]); } @@ -737587,8 +660153,8 @@ var require_commonjs4 = __commonJS((exports) => { } const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status: status2 } = setOptions2; let { noUpdateTTL = this.noUpdateTTL } = setOptions2; - const size3 = this.#requireSize(k, v, setOptions2.size || 0, sizeCalculation); - if (this.maxEntrySize && size3 > this.maxEntrySize) { + const size2 = this.#requireSize(k, v, setOptions2.size || 0, sizeCalculation); + if (this.maxEntrySize && size2 > this.maxEntrySize) { if (status2) { status2.set = "miss"; status2.maxEntrySizeExceeded = true; @@ -737606,7 +660172,7 @@ var require_commonjs4 = __commonJS((exports) => { this.#prev[index] = this.#tail; this.#tail = index; this.#size++; - this.#addItemSize(index, size3, status2); + this.#addItemSize(index, size2, status2); if (status2) status2.set = "add"; noUpdateTTL = false; @@ -737634,7 +660200,7 @@ var require_commonjs4 = __commonJS((exports) => { } } this.#removeItemSize(index); - this.#addItemSize(index, size3, status2); + this.#addItemSize(index, size2, status2); this.#valList[index] = v; if (status2) { status2.set = "replace"; @@ -737689,9 +660255,9 @@ var require_commonjs4 = __commonJS((exports) => { } } #evict(free) { - const head3 = this.#head; - const k = this.#keyList[head3]; - const v = this.#valList[head3]; + const head2 = this.#head; + const k = this.#keyList[head2]; + const v = this.#valList[head2]; if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) { v.__abortController.abort(new Error("evicted")); } else if (this.#hasDispose || this.#hasDisposeAfter) { @@ -737702,21 +660268,21 @@ var require_commonjs4 = __commonJS((exports) => { this.#disposed?.push([v, k, "evict"]); } } - this.#removeItemSize(head3); + this.#removeItemSize(head2); if (free) { - this.#keyList[head3] = undefined; - this.#valList[head3] = undefined; - this.#free.push(head3); + this.#keyList[head2] = undefined; + this.#valList[head2] = undefined; + this.#free.push(head2); } if (this.#size === 1) { this.#head = this.#tail = 0; this.#free.length = 0; } else { - this.#head = this.#next[head3]; + this.#head = this.#next[head2]; } this.#keyMap.delete(k); this.#size--; - return head3; + return head2; } has(k, hasOptions = {}) { const { updateAgeOnHas = this.updateAgeOnHas, status: status2 } = hasOptions; @@ -737873,7 +660439,7 @@ var require_commonjs4 = __commonJS((exports) => { noDeleteOnStaleGet = this.noDeleteOnStaleGet, ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, - size: size3 = 0, + size: size2 = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, @@ -737901,7 +660467,7 @@ var require_commonjs4 = __commonJS((exports) => { noDeleteOnStaleGet, ttl, noDisposeOnSet, - size: size3, + size: size2, sizeCalculation, noUpdateTTL, noDeleteOnFetchRejection, @@ -738149,14 +660715,14 @@ var require_commonjs5 = __commonJS((exports) => { var __importStar = exports && exports.__importStar || function(mod2) { if (mod2 && mod2.__esModule) return mod2; - var result3 = {}; + var result2 = {}; if (mod2 != null) { for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result3, mod2, k); + __createBinding(result2, mod2, k); } - __setModuleDefault(result3, mod2); - return result3; + __setModuleDefault(result2, mod2); + return result2; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = undefined; @@ -738165,7 +660731,7 @@ var require_commonjs5 = __commonJS((exports) => { var node_url_1 = __require("node:url"); var fs_1 = __require("fs"); var actualFS = __importStar(__require("node:fs")); - var realpathSync6 = fs_1.realpathSync.native; + var realpathSync4 = fs_1.realpathSync.native; var promises_1 = __require("node:fs/promises"); var minipass_1 = require_commonjs(); var defaultFS = { @@ -738173,7 +660739,7 @@ var require_commonjs5 = __commonJS((exports) => { readdir: fs_1.readdir, readdirSync: fs_1.readdirSync, readlinkSync: fs_1.readlinkSync, - realpathSync: realpathSync6, + realpathSync: realpathSync4, promises: { lstat: promises_1.lstat, readdir: promises_1.readdir, @@ -738212,7 +660778,7 @@ var require_commonjs5 = __commonJS((exports) => { var TYPEMASK = 1023; 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 Map; - var normalize16 = (s) => { + var normalize15 = (s) => { const c6 = normalizeCache.get(s); if (c6) return c6; @@ -738225,7 +660791,7 @@ var require_commonjs5 = __commonJS((exports) => { const c6 = normalizeNocaseCache.get(s); if (c6) return c6; - const n3 = normalize16(s.toLowerCase()); + const n3 = normalize15(s.toLowerCase()); normalizeNocaseCache.set(s, n3); return n3; }; @@ -738344,13 +660910,13 @@ var require_commonjs5 = __commonJS((exports) => { get path() { return this.parentPath; } - constructor(name, type = UNKNOWN, root3, roots, nocase, children2, opts) { + constructor(name, type = UNKNOWN, root2, roots, nocase, children2, opts) { this.name = name; - this.#matchName = nocase ? normalizeNocase(name) : normalize16(name); + this.#matchName = nocase ? normalizeNocase(name) : normalize15(name); this.#type = type & TYPEMASK; this.nocase = nocase; this.roots = roots; - this.root = root3 || this; + this.root = root2 || this; this.#children = children2; this.#fullpath = opts.fullpath; this.#relative = opts.relative; @@ -738372,15 +660938,15 @@ var require_commonjs5 = __commonJS((exports) => { childrenCache() { return this.#children; } - resolve(path29) { - if (!path29) { + resolve(path24) { + if (!path24) { return this; } - const rootPath = this.getRootString(path29); - const dir = path29.substring(rootPath.length); + const rootPath = this.getRootString(path24); + const dir = path24.substring(rootPath.length); const dirParts = dir.split(this.splitSep); - const result3 = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts); - return result3; + const result2 = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts); + return result2; } #resolveParts(dirParts) { let p = this; @@ -738407,7 +660973,7 @@ var require_commonjs5 = __commonJS((exports) => { return this.parent || this; } const children2 = this.children(); - const name = this.nocase ? normalizeNocase(pathPart) : normalize16(pathPart); + const name = this.nocase ? normalizeNocase(pathPart) : normalize15(pathPart); for (const p of children2) { if (p.#matchName === name) { return p; @@ -738544,7 +661110,7 @@ var require_commonjs5 = __commonJS((exports) => { return !!(this.#type & ENOENT); } isNamed(n3) { - return !this.nocase ? this.#matchName === normalize16(n3) : this.#matchName === normalizeNocase(n3); + return !this.nocase ? this.#matchName === normalize15(n3) : this.#matchName === normalizeNocase(n3); } async readlink() { const target = this.#linkTarget; @@ -738671,7 +661237,7 @@ var require_commonjs5 = __commonJS((exports) => { #readdirMaybePromoteChild(e, c6) { for (let p = c6.provisional;p < c6.length; p++) { const pchild = c6[p]; - const name = this.nocase ? normalizeNocase(e.name) : normalize16(e.name); + const name = this.nocase ? normalizeNocase(e.name) : normalize15(e.name); if (name !== pchild.#matchName) { continue; } @@ -738714,7 +661280,7 @@ var require_commonjs5 = __commonJS((exports) => { } } #applyStat(st) { - const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size: size3, uid } = st; + const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size: size2, uid } = st; this.#atime = atime; this.#atimeMs = atimeMs; this.#birthtime = birthtime; @@ -738731,7 +661297,7 @@ var require_commonjs5 = __commonJS((exports) => { this.#mtimeMs = mtimeMs; this.#nlink = nlink; this.#rdev = rdev; - this.#size = size3; + this.#size = size2; this.#uid = uid; const ifmt = entToType(st); this.#type = this.#type & IFMT_UNKNOWN | ifmt | LSTAT_CALLED; @@ -738797,8 +661363,8 @@ var require_commonjs5 = __commonJS((exports) => { if (this.#asyncReaddirInFlight) { await this.#asyncReaddirInFlight; } else { - let resolve47 = () => {}; - this.#asyncReaddirInFlight = new Promise((res) => resolve47 = res); + let resolve41 = () => {}; + this.#asyncReaddirInFlight = new Promise((res) => resolve41 = res); try { for (const e of await this.#fs.promises.readdir(fullpath, { withFileTypes: true @@ -738811,7 +661377,7 @@ var require_commonjs5 = __commonJS((exports) => { children2.provisional = 0; } this.#asyncReaddirInFlight = undefined; - resolve47(); + resolve41(); } return children2.slice(0, children2.provisional); } @@ -738901,23 +661467,23 @@ var require_commonjs5 = __commonJS((exports) => { class PathWin32 extends PathBase { sep = "\\"; splitSep = eitherSep; - constructor(name, type = UNKNOWN, root3, roots, nocase, children2, opts) { - super(name, type, root3, roots, nocase, children2, opts); + constructor(name, type = UNKNOWN, root2, roots, nocase, children2, opts) { + super(name, type, root2, roots, nocase, children2, opts); } newChild(name, type = UNKNOWN, opts = {}) { return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); } - getRootString(path29) { - return node_path_1.win32.parse(path29).root; + getRootString(path24) { + return node_path_1.win32.parse(path24).root; } getRoot(rootPath) { rootPath = uncToDrive(rootPath.toUpperCase()); if (rootPath === this.root.name) { return this.root; } - for (const [compare, root3] of Object.entries(this.roots)) { + for (const [compare, root2] of Object.entries(this.roots)) { if (this.sameRoot(rootPath, compare)) { - return this.roots[rootPath] = root3; + return this.roots[rootPath] = root2; } } return this.roots[rootPath] = new PathScurryWin32(rootPath, this).root; @@ -738932,11 +661498,11 @@ var require_commonjs5 = __commonJS((exports) => { class PathPosix extends PathBase { splitSep = "/"; sep = "/"; - constructor(name, type = UNKNOWN, root3, roots, nocase, children2, opts) { - super(name, type, root3, roots, nocase, children2, opts); + constructor(name, type = UNKNOWN, root2, roots, nocase, children2, opts) { + super(name, type, root2, roots, nocase, children2, opts); } - getRootString(path29) { - return path29.startsWith("/") ? "/" : ""; + getRootString(path24) { + return path24.startsWith("/") ? "/" : ""; } getRoot(_rootPath) { return this.root; @@ -738957,8 +661523,8 @@ var require_commonjs5 = __commonJS((exports) => { #children; nocase; #fs; - constructor(cwd2 = process.cwd(), pathImpl, sep41, { nocase, childrenCacheSize = 16 * 1024, fs: fs12 = defaultFS } = {}) { - this.#fs = fsFromOption(fs12); + constructor(cwd2 = process.cwd(), pathImpl, sep38, { nocase, childrenCacheSize = 16 * 1024, fs: fs6 = defaultFS } = {}) { + this.#fs = fsFromOption(fs6); if (cwd2 instanceof URL || cwd2.startsWith("file://")) { cwd2 = (0, node_url_1.fileURLToPath)(cwd2); } @@ -738968,9 +661534,9 @@ var require_commonjs5 = __commonJS((exports) => { this.#resolveCache = new ResolveCache; this.#resolvePosixCache = new ResolveCache; this.#children = new ChildrenCache(childrenCacheSize); - const split3 = cwdPath.substring(this.rootPath.length).split(sep41); - if (split3.length === 1 && !split3[0]) { - split3.pop(); + const split2 = cwdPath.substring(this.rootPath.length).split(sep38); + if (split2.length === 1 && !split2[0]) { + split2.pop(); } if (nocase === undefined) { throw new TypeError("must provide nocase setting to PathScurryBase ctor"); @@ -738979,11 +661545,11 @@ var require_commonjs5 = __commonJS((exports) => { this.root = this.newRoot(this.#fs); this.roots[this.rootPath] = this.root; let prev = this.root; - let len = split3.length - 1; + let len = split2.length - 1; const joinSep = pathImpl.sep; let abs = this.rootPath; let sawFirst = false; - for (const part of split3) { + for (const part of split2) { const l = len--; prev = prev.child(part, { relative: new Array(l).fill("..").join(joinSep), @@ -738994,19 +661560,19 @@ var require_commonjs5 = __commonJS((exports) => { } this.cwd = prev; } - depth(path29 = this.cwd) { - if (typeof path29 === "string") { - path29 = this.cwd.resolve(path29); + depth(path24 = this.cwd) { + if (typeof path24 === "string") { + path24 = this.cwd.resolve(path24); } - return path29.depth(); + return path24.depth(); } childrenCache() { return this.#children; } resolve(...paths2) { let r = ""; - for (let i4 = paths2.length - 1;i4 >= 0; i4--) { - const p = paths2[i4]; + for (let i3 = paths2.length - 1;i3 >= 0; i3--) { + const p = paths2[i3]; if (!p || p === ".") continue; r = r ? `${p}/${r}` : p; @@ -739018,14 +661584,14 @@ var require_commonjs5 = __commonJS((exports) => { if (cached7 !== undefined) { return cached7; } - const result3 = this.cwd.resolve(r).fullpath(); - this.#resolveCache.set(r, result3); - return result3; + const result2 = this.cwd.resolve(r).fullpath(); + this.#resolveCache.set(r, result2); + return result2; } resolvePosix(...paths2) { let r = ""; - for (let i4 = paths2.length - 1;i4 >= 0; i4--) { - const p = paths2[i4]; + for (let i3 = paths2.length - 1;i3 >= 0; i3--) { + const p = paths2[i3]; if (!p || p === ".") continue; r = r ? `${p}/${r}` : p; @@ -739037,9 +661603,9 @@ var require_commonjs5 = __commonJS((exports) => { if (cached7 !== undefined) { return cached7; } - const result3 = this.cwd.resolve(r).fullpathPosix(); - this.#resolvePosixCache.set(r, result3); - return result3; + const result2 = this.cwd.resolve(r).fullpathPosix(); + this.#resolvePosixCache.set(r, result2); + return result2; } relative(entry = this.cwd) { if (typeof entry === "string") { @@ -739167,9 +661733,9 @@ var require_commonjs5 = __commonJS((exports) => { opts = entry; entry = this.cwd; } - const { withFileTypes = true, follow = false, filter: filter4, walkFilter } = opts; + const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts; const results = []; - if (!filter4 || filter4(entry)) { + if (!filter3 || filter3(entry)) { results.push(withFileTypes ? entry : entry.fullpath()); } const dirs = new Set; @@ -739188,7 +661754,7 @@ var require_commonjs5 = __commonJS((exports) => { } }; for (const e of entries) { - if (!filter4 || filter4(e)) { + if (!filter3 || filter3(e)) { results.push(withFileTypes ? e : e.fullpath()); } if (follow && e.isSymbolicLink()) { @@ -739219,16 +661785,16 @@ var require_commonjs5 = __commonJS((exports) => { opts = entry; entry = this.cwd; } - const { withFileTypes = true, follow = false, filter: filter4, walkFilter } = opts; + const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts; const results = []; - if (!filter4 || filter4(entry)) { + if (!filter3 || filter3(entry)) { results.push(withFileTypes ? entry : entry.fullpath()); } const dirs = new Set([entry]); for (const dir of dirs) { const entries = dir.readdirSync(); for (const e of entries) { - if (!filter4 || filter4(e)) { + if (!filter3 || filter3(e)) { results.push(withFileTypes ? e : e.fullpath()); } let r = e; @@ -739267,15 +661833,15 @@ var require_commonjs5 = __commonJS((exports) => { opts = entry; entry = this.cwd; } - const { withFileTypes = true, follow = false, filter: filter4, walkFilter } = opts; - if (!filter4 || filter4(entry)) { + const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts; + if (!filter3 || filter3(entry)) { yield withFileTypes ? entry : entry.fullpath(); } const dirs = new Set([entry]); for (const dir of dirs) { const entries = dir.readdirSync(); for (const e of entries) { - if (!filter4 || filter4(e)) { + if (!filter3 || filter3(e)) { yield withFileTypes ? e : e.fullpath(); } let r = e; @@ -739298,9 +661864,9 @@ var require_commonjs5 = __commonJS((exports) => { opts = entry; entry = this.cwd; } - const { withFileTypes = true, follow = false, filter: filter4, walkFilter } = opts; + const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts; const results = new minipass_1.Minipass({ objectMode: true }); - if (!filter4 || filter4(entry)) { + if (!filter3 || filter3(entry)) { results.write(withFileTypes ? entry : entry.fullpath()); } const dirs = new Set; @@ -739333,7 +661899,7 @@ var require_commonjs5 = __commonJS((exports) => { } } for (const e of entries) { - if (e && (!filter4 || filter4(e))) { + if (e && (!filter3 || filter3(e))) { if (!results.write(withFileTypes ? e : e.fullpath())) { paused = true; } @@ -739367,10 +661933,10 @@ var require_commonjs5 = __commonJS((exports) => { opts = entry; entry = this.cwd; } - const { withFileTypes = true, follow = false, filter: filter4, walkFilter } = opts; + const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts; const results = new minipass_1.Minipass({ objectMode: true }); const dirs = new Set; - if (!filter4 || filter4(entry)) { + if (!filter3 || filter3(entry)) { results.write(withFileTypes ? entry : entry.fullpath()); } const queue2 = [entry]; @@ -739388,7 +661954,7 @@ var require_commonjs5 = __commonJS((exports) => { dirs.add(dir); const entries = dir.readdirSync(); for (const e of entries) { - if (!filter4 || filter4(e)) { + if (!filter3 || filter3(e)) { if (!results.write(withFileTypes ? e : e.fullpath())) { paused = true; } @@ -739414,9 +661980,9 @@ var require_commonjs5 = __commonJS((exports) => { process14(); return results; } - chdir(path29 = this.cwd) { + chdir(path24 = this.cwd) { const oldCwd = this.cwd; - this.cwd = typeof path29 === "string" ? this.cwd.resolve(path29) : path29; + this.cwd = typeof path24 === "string" ? this.cwd.resolve(path24) : path24; this.cwd[setAsCwd](oldCwd); } } @@ -739435,8 +662001,8 @@ var require_commonjs5 = __commonJS((exports) => { parseRootPath(dir) { return node_path_1.win32.parse(dir).root.toUpperCase(); } - newRoot(fs12) { - return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs12 }); + newRoot(fs6) { + return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs6 }); } isAbsolute(p) { return p.startsWith("/") || p.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p); @@ -739454,8 +662020,8 @@ var require_commonjs5 = __commonJS((exports) => { parseRootPath(_dir) { return "/"; } - newRoot(fs12) { - return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs12 }); + newRoot(fs6) { + return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs6 }); } isAbsolute(p) { return p.startsWith("/"); @@ -739494,7 +662060,7 @@ var require_pattern3 = __commonJS((exports) => { #isUNC; #isAbsolute; #followGlobstar = true; - constructor(patternList, globList, index, platform7) { + constructor(patternList, globList, index, platform6) { if (!isPatternList(patternList)) { throw new TypeError("empty pattern list"); } @@ -739511,7 +662077,7 @@ var require_pattern3 = __commonJS((exports) => { this.#patternList = patternList; this.#globList = globList; this.#index = index; - this.#platform = platform7; + this.#platform = platform6; if (this.#index === 0) { if (this.isUNC()) { const [p0, p1, p2, p3, ...prest] = this.#patternList; @@ -739599,7 +662165,7 @@ var require_pattern3 = __commonJS((exports) => { }); // node_modules/glob/dist/commonjs/ignore.js -var require_ignore3 = __commonJS((exports) => { +var require_ignore2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Ignore = undefined; var minimatch_1 = require_commonjs3(); @@ -739613,12 +662179,12 @@ var require_ignore3 = __commonJS((exports) => { absoluteChildren; platform; mmopts; - constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform7 = defaultPlatform }) { + constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform6 = defaultPlatform }) { this.relative = []; this.absolute = []; this.relativeChildren = []; this.absoluteChildren = []; - this.platform = platform7; + this.platform = platform6; this.mmopts = { dot: true, nobrace, @@ -739626,7 +662192,7 @@ var require_ignore3 = __commonJS((exports) => { noext, noglobstar, optimizationLevel: 2, - platform: platform7, + platform: platform6, nocomment: true, nonegate: true }; @@ -739635,9 +662201,9 @@ var require_ignore3 = __commonJS((exports) => { } add(ign) { const mm = new minimatch_1.Minimatch(ign, this.mmopts); - for (let i4 = 0;i4 < mm.set.length; i4++) { - const parsed = mm.set[i4]; - const globParts = mm.globParts[i4]; + for (let i3 = 0;i3 < mm.set.length; i3++) { + const parsed = mm.set[i3]; + const globParts = mm.globParts[i3]; if (!parsed || !globParts) { throw new Error("invalid pattern object"); } @@ -739664,10 +662230,10 @@ var require_ignore3 = __commonJS((exports) => { ignored(p) { const fullpath = p.fullpath(); const fullpaths = `${fullpath}/`; - const relative37 = p.relative() || "."; - const relatives = `${relative37}/`; + const relative35 = p.relative() || "."; + const relatives = `${relative35}/`; for (const m of this.relative) { - if (m.match(relative37) || m.match(relatives)) + if (m.match(relative35) || m.match(relatives)) return true; } for (const m of this.absolute) { @@ -739678,9 +662244,9 @@ var require_ignore3 = __commonJS((exports) => { } childrenIgnored(p) { const fullpath = p.fullpath() + "/"; - const relative37 = (p.relative() || ".") + "/"; + const relative35 = (p.relative() || ".") + "/"; for (const m of this.relativeChildren) { - if (m.match(relative37)) + if (m.match(relative35)) return true; } for (const m of this.absoluteChildren) { @@ -739729,8 +662295,8 @@ var require_processor = __commonJS((exports) => { this.store.set(target, current === undefined ? n3 : n3 & current); } entries() { - return [...this.store.entries()].map(([path29, n3]) => [ - path29, + return [...this.store.entries()].map(([path24, n3]) => [ + path24, !!(n3 & 2), !!(n3 & 1) ]); @@ -739787,31 +662353,31 @@ var require_processor = __commonJS((exports) => { const processingSet = patterns.map((p) => [target, p]); for (let [t, pattern] of processingSet) { this.hasWalkedCache.storeWalked(t, pattern); - const root3 = pattern.root(); + const root2 = pattern.root(); const absolute = pattern.isAbsolute() && this.opts.absolute !== false; - if (root3) { - t = t.resolve(root3 === "/" && this.opts.root !== undefined ? this.opts.root : root3); - const rest4 = pattern.rest(); - if (!rest4) { + if (root2) { + t = t.resolve(root2 === "/" && this.opts.root !== undefined ? this.opts.root : root2); + const rest3 = pattern.rest(); + if (!rest3) { this.matches.add(t, true, false); continue; } else { - pattern = rest4; + pattern = rest3; } } if (t.isENOENT()) continue; let p; - let rest3; + let rest2; let changed = false; - while (typeof (p = pattern.pattern()) === "string" && (rest3 = pattern.rest())) { + while (typeof (p = pattern.pattern()) === "string" && (rest2 = pattern.rest())) { const c6 = t.resolve(p); t = c6; - pattern = rest3; + pattern = rest2; changed = true; } p = pattern.pattern(); - rest3 = pattern.rest(); + rest2 = pattern.rest(); if (changed) { if (this.hasWalkedCache.hasWalked(t, pattern)) continue; @@ -739825,9 +662391,9 @@ var require_processor = __commonJS((exports) => { if (!t.isSymbolicLink() || this.follow || pattern.checkFollowGlobstar()) { this.subwalks.add(t, pattern); } - const rp = rest3?.pattern(); - const rrest = rest3?.rest(); - if (!rest3 || (rp === "" || rp === ".") && !rrest) { + const rp = rest2?.pattern(); + const rrest = rest2?.rest(); + if (!rest2 || (rp === "" || rp === ".") && !rrest) { this.matches.add(t, absolute, rp === "" || rp === "."); } else { if (rp === "..") { @@ -739851,26 +662417,26 @@ var require_processor = __commonJS((exports) => { child() { return new Processor(this.opts, this.hasWalkedCache); } - filterEntries(parent3, entries) { - const patterns = this.subwalks.get(parent3); + filterEntries(parent2, entries) { + const patterns = this.subwalks.get(parent2); const results = this.child(); for (const e of entries) { for (const pattern of patterns) { const absolute = pattern.isAbsolute(); const p = pattern.pattern(); - const rest3 = pattern.rest(); + const rest2 = pattern.rest(); if (p === minimatch_1.GLOBSTAR) { - results.testGlobstar(e, pattern, rest3, absolute); + results.testGlobstar(e, pattern, rest2, absolute); } else if (p instanceof RegExp) { - results.testRegExp(e, p, rest3, absolute); + results.testRegExp(e, p, rest2, absolute); } else { - results.testString(e, p, rest3, absolute); + results.testString(e, p, rest2, absolute); } } } return results; } - testGlobstar(e, pattern, rest3, absolute) { + testGlobstar(e, pattern, rest2, absolute) { if (this.dot || !e.name.startsWith(".")) { if (!pattern.hasMore()) { this.matches.add(e, absolute, false); @@ -739879,42 +662445,42 @@ var require_processor = __commonJS((exports) => { if (this.follow || !e.isSymbolicLink()) { this.subwalks.add(e, pattern); } else if (e.isSymbolicLink()) { - if (rest3 && pattern.checkFollowGlobstar()) { - this.subwalks.add(e, rest3); + if (rest2 && pattern.checkFollowGlobstar()) { + this.subwalks.add(e, rest2); } else if (pattern.markFollowGlobstar()) { this.subwalks.add(e, pattern); } } } } - if (rest3) { - const rp = rest3.pattern(); + if (rest2) { + const rp = rest2.pattern(); if (typeof rp === "string" && rp !== ".." && rp !== "" && rp !== ".") { - this.testString(e, rp, rest3.rest(), absolute); + this.testString(e, rp, rest2.rest(), absolute); } else if (rp === "..") { const ep = e.parent || e; - this.subwalks.add(ep, rest3); + this.subwalks.add(ep, rest2); } else if (rp instanceof RegExp) { - this.testRegExp(e, rp, rest3.rest(), absolute); + this.testRegExp(e, rp, rest2.rest(), absolute); } } } - testRegExp(e, p, rest3, absolute) { + testRegExp(e, p, rest2, absolute) { if (!p.test(e.name)) return; - if (!rest3) { + if (!rest2) { this.matches.add(e, absolute, false); } else { - this.subwalks.add(e, rest3); + this.subwalks.add(e, rest2); } } - testString(e, p, rest3, absolute) { + testString(e, p, rest2, absolute) { if (!e.isNamed(p)) return; - if (!rest3) { + if (!rest2) { this.matches.add(e, absolute, false); } else { - this.subwalks.add(e, rest3); + this.subwalks.add(e, rest2); } } } @@ -739926,9 +662492,9 @@ var require_walker = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.GlobStream = exports.GlobWalker = exports.GlobUtil = undefined; var minipass_1 = require_commonjs(); - var ignore_js_1 = require_ignore3(); + var ignore_js_1 = require_ignore2(); var processor_js_1 = require_processor(); - var makeIgnore = (ignore7, opts) => typeof ignore7 === "string" ? new ignore_js_1.Ignore([ignore7], opts) : Array.isArray(ignore7) ? new ignore_js_1.Ignore(ignore7, opts) : ignore7; + var makeIgnore = (ignore6, opts) => typeof ignore6 === "string" ? new ignore_js_1.Ignore([ignore6], opts) : Array.isArray(ignore6) ? new ignore_js_1.Ignore(ignore6, opts) : ignore6; class GlobUtil { path; @@ -739943,9 +662509,9 @@ var require_walker = __commonJS((exports) => { signal; maxDepth; includeChildMatches; - constructor(patterns, path29, opts) { + constructor(patterns, path24, opts) { this.patterns = patterns; - this.path = path29; + this.path = path24; this.opts = opts; this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/"; this.includeChildMatches = opts.includeChildMatches !== false; @@ -739964,11 +662530,11 @@ var require_walker = __commonJS((exports) => { }); } } - #ignored(path29) { - return this.seen.has(path29) || !!this.#ignore?.ignored?.(path29); + #ignored(path24) { + return this.seen.has(path24) || !!this.#ignore?.ignored?.(path24); } - #childrenIgnored(path29) { - return !!this.#ignore?.childrenIgnored?.(path29); + #childrenIgnored(path24) { + return !!this.#ignore?.childrenIgnored?.(path24); } pause() { this.paused = true; @@ -740182,8 +662748,8 @@ var require_walker = __commonJS((exports) => { class GlobWalker extends GlobUtil { matches = new Set; - constructor(patterns, path29, opts) { - super(patterns, path29, opts); + constructor(patterns, path24, opts) { + super(patterns, path24, opts); } matchEmit(e) { this.matches.add(e); @@ -740222,8 +662788,8 @@ var require_walker = __commonJS((exports) => { class GlobStream extends GlobUtil { results; - constructor(patterns, path29, opts) { - super(patterns, path29, opts); + constructor(patterns, path24, opts) { + super(patterns, path24, opts); this.results = new minipass_1.Minipass({ signal: this.signal, objectMode: true @@ -740374,16 +662940,16 @@ var require_glob = __commonJS((exports) => { debug: !!this.opts.debug }; const mms = this.pattern.map((p) => new minimatch_1.Minimatch(p, mmo)); - const [matchSet, globParts] = mms.reduce((set6, m) => { - set6[0].push(...m.set); - set6[1].push(...m.globParts); - return set6; + const [matchSet, globParts] = mms.reduce((set5, m) => { + set5[0].push(...m.set); + set5[1].push(...m.globParts); + return set5; }, [[], []]); - this.patterns = matchSet.map((set6, i4) => { - const g = globParts[i4]; + this.patterns = matchSet.map((set5, i3) => { + const g = globParts[i3]; if (!g) throw new Error("invalid pattern object"); - return new pattern_js_1.Pattern(set6, g, 0, this.platform); + return new pattern_js_1.Pattern(set5, g, 0, this.platform); }); } async walk() { @@ -740487,7 +663053,7 @@ var require_commonjs6 = __commonJS((exports) => { Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function() { return has_magic_js_2.hasMagic; } }); - var ignore_js_1 = require_ignore3(); + var ignore_js_1 = require_ignore2(); Object.defineProperty(exports, "Ignore", { enumerable: true, get: function() { return ignore_js_1.Ignore; } }); @@ -740542,21 +663108,21 @@ var require_commonjs6 = __commonJS((exports) => { // node_modules/cacache/lib/util/glob.js var require_glob2 = __commonJS((exports, module) => { var { glob: glob2 } = require_commonjs6(); - var path29 = __require("path"); - var globify = (pattern) => pattern.split(path29.win32.sep).join(path29.posix.sep); - module.exports = (path30, options2) => glob2(globify(path30), options2); + var path24 = __require("path"); + var globify = (pattern) => pattern.split(path24.win32.sep).join(path24.posix.sep); + module.exports = (path25, options2) => glob2(globify(path25), options2); }); // node_modules/cacache/lib/content/rm.js var require_rm = __commonJS((exports, module) => { - var fs12 = __require("fs/promises"); + var fs6 = __require("fs/promises"); var contentPath = require_path(); var { hasContent } = require_read(); - module.exports = rm13; - async function rm13(cache6, integrity) { + module.exports = rm11; + async function rm11(cache6, integrity) { const content = await hasContent(cache6, integrity); if (content && content.sri) { - await fs12.rm(contentPath(cache6, content.sri), { recursive: true, force: true }); + await fs6.rm(contentPath(cache6, content.sri), { recursive: true, force: true }); return true; } else { return false; @@ -740566,11 +663132,11 @@ var require_rm = __commonJS((exports, module) => { // node_modules/cacache/lib/rm.js var require_rm2 = __commonJS((exports, module) => { - var { rm: rm13 } = __require("fs/promises"); + var { rm: rm11 } = __require("fs/promises"); var glob2 = require_glob2(); var index = require_entry_index(); var memo11 = require_memoization(); - var path29 = __require("path"); + var path24 = __require("path"); var rmContent = require_rm(); module.exports = entry; module.exports.entry = entry; @@ -740586,8 +663152,8 @@ var require_rm2 = __commonJS((exports, module) => { module.exports.all = all4; async function all4(cache6) { memo11.clearMemoized(); - const paths2 = await glob2(path29.join(cache6, "*(content-*|index-*)"), { silent: true, nosort: true }); - return Promise.all(paths2.map((p) => rm13(p, { recursive: true, force: true }))); + const paths2 = await glob2(path24.join(cache6, "*(content-*|index-*)"), { silent: true, nosort: true }); + return Promise.all(paths2.map((p) => rm11(p, { recursive: true, force: true }))); } }); @@ -740595,19 +663161,19 @@ var require_rm2 = __commonJS((exports, module) => { var require_verify = __commonJS((exports, module) => { var { mkdir: mkdir56, - readFile: readFile60, - rm: rm13, - stat: stat51, - truncate: truncate5, - writeFile: writeFile57 + readFile: readFile59, + rm: rm11, + stat: stat50, + truncate: truncate4, + writeFile: writeFile55 } = __require("fs/promises"); var contentPath = require_path(); - var fsm = require_lib18(); + var fsm = require_lib16(); var glob2 = require_glob2(); var index = require_entry_index(); - var path29 = __require("path"); - var ssri = require_lib14(); - var hasOwnProperty54 = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key); + var path24 = __require("path"); + var ssri = require_lib12(); + var hasOwnProperty28 = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key); var verifyOpts = (opts) => ({ concurrency: 20, log: { silly() {} }, @@ -740671,11 +663237,11 @@ var require_verify = __commonJS((exports, module) => { liveContent.add(integrity[algo].toString()); } }); - await new Promise((resolve47, reject3) => { - indexStream.on("end", resolve47).on("error", reject3); + await new Promise((resolve41, reject2) => { + indexStream.on("end", resolve41).on("error", reject2); }); const contentDir = contentPath.contentDir(cache6); - const files3 = await glob2(path29.join(contentDir, "**"), { + const files2 = await glob2(path24.join(contentDir, "**"), { follow: false, nodir: true, nosort: true @@ -740687,10 +663253,10 @@ var require_verify = __commonJS((exports, module) => { badContentCount: 0, keptSize: 0 }; - await pMap2(files3, async (f) => { - const split3 = f.split(/[/\\]/); - const digest = split3.slice(split3.length - 3).join(""); - const algo = split3[split3.length - 4]; + await pMap2(files2, async (f) => { + const split2 = f.split(/[/\\]/); + const digest = split2.slice(split2.length - 3).join(""); + const algo = split2[split2.length - 4]; const integrity = ssri.fromHex(digest, algo); if (liveContent.has(integrity.toString())) { const info = await verifyContent(f, integrity); @@ -740704,8 +663270,8 @@ var require_verify = __commonJS((exports, module) => { } } else { stats2.reclaimedCount++; - const s = await stat51(f); - await rm13(f, { recursive: true, force: true }); + const s = await stat50(f); + await rm11(f, { recursive: true, force: true }); stats2.reclaimedSize += s.size; } return stats2; @@ -740715,18 +663281,18 @@ var require_verify = __commonJS((exports, module) => { async function verifyContent(filepath, sri) { const contentInfo = {}; try { - const { size: size3 } = await stat51(filepath); - contentInfo.size = size3; + const { size: size2 } = await stat50(filepath); + contentInfo.size = size2; contentInfo.valid = true; await ssri.checkStream(new fsm.ReadStream(filepath), sri); - } catch (err3) { - if (err3.code === "ENOENT") { + } catch (err2) { + if (err2.code === "ENOENT") { return { size: 0, valid: false }; } - if (err3.code !== "EINTEGRITY") { - throw err3; + if (err2.code !== "EINTEGRITY") { + throw err2; } - await rm13(filepath, { recursive: true, force: true }); + await rm11(filepath, { recursive: true, force: true }); contentInfo.valid = false; } return contentInfo; @@ -740742,7 +663308,7 @@ var require_verify = __commonJS((exports, module) => { }; const buckets = {}; for (const k in entries) { - if (hasOwnProperty54(entries, k)) { + if (hasOwnProperty28(entries, k)) { const hashed = index.hashKey(k); const entry = entries[k]; const excluded = opts.filter && !opts.filter(entry); @@ -740764,55 +663330,55 @@ var require_verify = __commonJS((exports, module) => { return stats2; } async function rebuildBucket(cache6, bucket, stats2) { - await truncate5(bucket._path); + await truncate4(bucket._path); for (const entry of bucket) { const content = contentPath(cache6, entry.integrity); try { - await stat51(content); + await stat50(content); await index.insert(cache6, entry.key, entry.integrity, { metadata: entry.metadata, size: entry.size, time: entry.time }); stats2.totalEntries++; - } catch (err3) { - if (err3.code === "ENOENT") { + } catch (err2) { + if (err2.code === "ENOENT") { stats2.rejectedEntries++; stats2.missingContent++; } else { - throw err3; + throw err2; } } } } function cleanTmp(cache6, opts) { opts.log.silly("verify", "cleaning tmp directory"); - return rm13(path29.join(cache6, "tmp"), { recursive: true, force: true }); + return rm11(path24.join(cache6, "tmp"), { recursive: true, force: true }); } async function writeVerifile(cache6, opts) { - const verifile = path29.join(cache6, "_lastverified"); + const verifile = path24.join(cache6, "_lastverified"); opts.log.silly("verify", "writing verifile to " + verifile); - return writeFile57(verifile, `${Date.now()}`); + return writeFile55(verifile, `${Date.now()}`); } module.exports.lastRun = lastRun; async function lastRun(cache6) { - const data = await readFile60(path29.join(cache6, "_lastverified"), { encoding: "utf8" }); + const data = await readFile59(path24.join(cache6, "_lastverified"), { encoding: "utf8" }); return new Date(+data); } }); // node_modules/cacache/lib/util/tmp.js var require_tmp = __commonJS((exports, module) => { - var { withTempDir } = require_lib17(); - var fs12 = __require("fs/promises"); - var path29 = __require("path"); + var { withTempDir } = require_lib15(); + var fs6 = __require("fs/promises"); + var path24 = __require("path"); exports.mkdir = mktmpdir; async function mktmpdir(cache6, opts = {}) { const { tmpPrefix } = opts; - const tmpDir = path29.join(cache6, "tmp"); - await fs12.mkdir(tmpDir, { recursive: true, owner: "inherit" }); - const target = `${tmpDir}${path29.sep}${tmpPrefix || ""}`; - return fs12.mkdtemp(target, { owner: "inherit" }); + const tmpDir = path24.join(cache6, "tmp"); + await fs6.mkdir(tmpDir, { recursive: true, owner: "inherit" }); + const target = `${tmpDir}${path24.sep}${tmpPrefix || ""}`; + return fs6.mkdtemp(target, { owner: "inherit" }); } exports.withTmp = withTmp; function withTmp(cache6, opts, cb) { @@ -740820,15 +663386,15 @@ var require_tmp = __commonJS((exports, module) => { cb = opts; opts = {}; } - return withTempDir(path29.join(cache6, "tmp"), cb, opts); + return withTempDir(path24.join(cache6, "tmp"), cb, opts); } }); // node_modules/cacache/lib/index.js -var require_lib19 = __commonJS((exports, module) => { - var get4 = require_get2(); +var require_lib17 = __commonJS((exports, module) => { + var get3 = require_get2(); var put = require_put(); - var rm13 = require_rm2(); + var rm11 = require_rm2(); var verify = require_verify(); var { clearMemoized } = require_memoization(); var tmp = require_tmp(); @@ -740838,20 +663404,20 @@ var require_lib19 = __commonJS((exports, module) => { exports.index.insert = index.insert; exports.ls = index.ls; exports.ls.stream = index.lsStream; - exports.get = get4; - exports.get.byDigest = get4.byDigest; - exports.get.stream = get4.stream; - exports.get.stream.byDigest = get4.stream.byDigest; - exports.get.copy = get4.copy; - exports.get.copy.byDigest = get4.copy.byDigest; - exports.get.info = get4.info; - exports.get.hasContent = get4.hasContent; + exports.get = get3; + exports.get.byDigest = get3.byDigest; + exports.get.stream = get3.stream; + exports.get.stream.byDigest = get3.stream.byDigest; + exports.get.copy = get3.copy; + exports.get.copy.byDigest = get3.copy.byDigest; + exports.get.info = get3.info; + exports.get.hasContent = get3.hasContent; exports.put = put; exports.put.stream = put.stream; - exports.rm = rm13.entry; - exports.rm.all = rm13.all; + exports.rm = rm11.entry; + exports.rm.all = rm11.all; exports.rm.entry = exports.rm; - exports.rm.content = rm13.content; + exports.rm.content = rm11.content; exports.clearMemoized = clearMemoized; exports.tmp = {}; exports.tmp.mkdir = tmp.mkdir; @@ -740861,9 +663427,9 @@ var require_lib19 = __commonJS((exports, module) => { }); // src/utils/cleanup.ts -import * as fs12 from "fs/promises"; -import { homedir as homedir39 } from "os"; -import { join as join165 } from "path"; +import * as fs6 from "fs/promises"; +import { homedir as homedir37 } from "os"; +import { join as join155 } from "path"; function getCutoffDate() { const settings = getSettings_DEPRECATED() || {}; const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS; @@ -740881,55 +663447,55 @@ function convertFileNameToDate(filename) { return new Date(isoStr); } async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) { - const result3 = { messages: 0, errors: 0 }; + const result2 = { messages: 0, errors: 0 }; try { - const files3 = await getFsImplementation().readdir(dirPath); - for (const file2 of files3) { + const files2 = await getFsImplementation().readdir(dirPath); + for (const file2 of files2) { try { const timestamp2 = convertFileNameToDate(file2.name); if (timestamp2 < cutoffDate) { - await getFsImplementation().unlink(join165(dirPath, file2.name)); + await getFsImplementation().unlink(join155(dirPath, file2.name)); if (isMessagePath) { - result3.messages++; + result2.messages++; } else { - result3.errors++; + result2.errors++; } } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } - } catch (error46) { - if (error46 instanceof Error && "code" in error46 && error46.code !== "ENOENT") { - logError2(error46); + } catch (error42) { + if (error42 instanceof Error && "code" in error42 && error42.code !== "ENOENT") { + logError2(error42); } } - return result3; + return result2; } async function cleanupOldMessageFiles() { const fsImpl = getFsImplementation(); const cutoffDate = getCutoffDate(); const errorPath = CACHE_PATHS.errors(); const baseCachePath = CACHE_PATHS.baseLogs(); - let result3 = await cleanupOldFilesInDirectory(errorPath, cutoffDate, false); + let result2 = await cleanupOldFilesInDirectory(errorPath, cutoffDate, false); try { let dirents; try { dirents = await fsImpl.readdir(baseCachePath); } catch { - return result3; + return result2; } - const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join165(baseCachePath, dirent.name)); + const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join155(baseCachePath, dirent.name)); for (const mcpLogDir of mcpLogDirs) { - result3 = addCleanupResults(result3, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true)); + result2 = addCleanupResults(result2, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true)); await tryRmdir(mcpLogDir, fsImpl); } - } catch (error46) { - if (error46 instanceof Error && "code" in error46 && error46.code !== "ENOENT") { - logError2(error46); + } catch (error42) { + if (error42 instanceof Error && "code" in error42 && error42.code !== "ENOENT") { + logError2(error42); } } - return result3; + return result2; } async function unlinkIfOld(filePath, cutoffDate, fsImpl) { const stats2 = await fsImpl.stat(filePath); @@ -740946,24 +663512,24 @@ async function tryRmdir(dirPath, fsImpl) { } async function cleanupOldSessionFiles() { const cutoffDate = getCutoffDate(); - const result3 = { messages: 0, errors: 0 }; + const result2 = { messages: 0, errors: 0 }; const projectsDir = getProjectsDir2(); const fsImpl = getFsImplementation(); let projectDirents; try { projectDirents = await fsImpl.readdir(projectsDir); } catch { - return result3; + return result2; } for (const projectDirent of projectDirents) { if (!projectDirent.isDirectory()) continue; - const projectDir = join165(projectsDir, projectDirent.name); + const projectDir = join155(projectsDir, projectDirent.name); let entries; try { entries = await fsImpl.readdir(projectDir); } catch { - result3.errors++; + result2.errors++; continue; } for (const entry of entries) { @@ -740972,15 +663538,15 @@ async function cleanupOldSessionFiles() { continue; } try { - if (await unlinkIfOld(join165(projectDir, entry.name), cutoffDate, fsImpl)) { - result3.messages++; + if (await unlinkIfOld(join155(projectDir, entry.name), cutoffDate, fsImpl)) { + result2.messages++; } } catch { - result3.errors++; + result2.errors++; } } else if (entry.isDirectory()) { - const sessionDir = join165(projectDir, entry.name); - const toolResultsDir = join165(sessionDir, TOOL_RESULTS_SUBDIR); + const sessionDir = join155(projectDir, entry.name); + const toolResultsDir = join155(sessionDir, TOOL_RESULTS_SUBDIR); let toolDirs; try { toolDirs = await fsImpl.readdir(toolResultsDir); @@ -740991,14 +663557,14 @@ async function cleanupOldSessionFiles() { for (const toolEntry of toolDirs) { if (toolEntry.isFile()) { try { - if (await unlinkIfOld(join165(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) { - result3.messages++; + if (await unlinkIfOld(join155(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) { + result2.messages++; } } catch { - result3.errors++; + result2.errors++; } } else if (toolEntry.isDirectory()) { - const toolDirPath = join165(toolResultsDir, toolEntry.name); + const toolDirPath = join155(toolResultsDir, toolEntry.name); let toolFiles; try { toolFiles = await fsImpl.readdir(toolDirPath); @@ -741009,11 +663575,11 @@ async function cleanupOldSessionFiles() { if (!tf.isFile()) continue; try { - if (await unlinkIfOld(join165(toolDirPath, tf.name), cutoffDate, fsImpl)) { - result3.messages++; + if (await unlinkIfOld(join155(toolDirPath, tf.name), cutoffDate, fsImpl)) { + result2.messages++; } } catch { - result3.errors++; + result2.errors++; } } await tryRmdir(toolDirPath, fsImpl); @@ -741025,52 +663591,52 @@ async function cleanupOldSessionFiles() { } await tryRmdir(projectDir, fsImpl); } - return result3; + return result2; } -async function cleanupSingleDirectory(dirPath, extension3, removeEmptyDir = true) { +async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true) { const cutoffDate = getCutoffDate(); - const result3 = { messages: 0, errors: 0 }; + const result2 = { messages: 0, errors: 0 }; const fsImpl = getFsImplementation(); let dirents; try { dirents = await fsImpl.readdir(dirPath); } catch { - return result3; + return result2; } for (const dirent of dirents) { - if (!dirent.isFile() || !dirent.name.endsWith(extension3)) + if (!dirent.isFile() || !dirent.name.endsWith(extension2)) continue; try { - if (await unlinkIfOld(join165(dirPath, dirent.name), cutoffDate, fsImpl)) { - result3.messages++; + if (await unlinkIfOld(join155(dirPath, dirent.name), cutoffDate, fsImpl)) { + result2.messages++; } } catch { - result3.errors++; + result2.errors++; } } if (removeEmptyDir) { await tryRmdir(dirPath, fsImpl); } - return result3; + return result2; } function cleanupOldPlanFiles() { - const plansDir = join165(getClaudeConfigHomeDir(), "plans"); + const plansDir = join155(getClaudeConfigHomeDir(), "plans"); return cleanupSingleDirectory(plansDir, ".md"); } async function cleanupOldFileHistoryBackups() { const cutoffDate = getCutoffDate(); - const result3 = { messages: 0, errors: 0 }; + const result2 = { messages: 0, errors: 0 }; const fsImpl = getFsImplementation(); try { const configDir = getClaudeConfigHomeDir(); - const fileHistoryStorageDir = join165(configDir, "file-history"); + const fileHistoryStorageDir = join155(configDir, "file-history"); let dirents; try { dirents = await fsImpl.readdir(fileHistoryStorageDir); } catch { - return result3; + return result2; } - const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join165(fileHistoryStorageDir, dirent.name)); + const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join155(fileHistoryStorageDir, dirent.name)); await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => { try { const stats2 = await fsImpl.stat(fileHistorySessionDir); @@ -741079,79 +663645,79 @@ async function cleanupOldFileHistoryBackups() { recursive: true, force: true }); - result3.messages++; + result2.messages++; } } catch { - result3.errors++; + result2.errors++; } })); await tryRmdir(fileHistoryStorageDir, fsImpl); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } - return result3; + return result2; } async function cleanupOldSessionEnvDirs() { const cutoffDate = getCutoffDate(); - const result3 = { messages: 0, errors: 0 }; + const result2 = { messages: 0, errors: 0 }; const fsImpl = getFsImplementation(); try { const configDir = getClaudeConfigHomeDir(); - const sessionEnvBaseDir = join165(configDir, "session-env"); + const sessionEnvBaseDir = join155(configDir, "session-env"); let dirents; try { dirents = await fsImpl.readdir(sessionEnvBaseDir); } catch { - return result3; + return result2; } - const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join165(sessionEnvBaseDir, dirent.name)); + const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join155(sessionEnvBaseDir, dirent.name)); for (const sessionEnvDir of sessionEnvDirs) { try { const stats2 = await fsImpl.stat(sessionEnvDir); if (stats2.mtime < cutoffDate) { await fsImpl.rm(sessionEnvDir, { recursive: true, force: true }); - result3.messages++; + result2.messages++; } } catch { - result3.errors++; + result2.errors++; } } await tryRmdir(sessionEnvBaseDir, fsImpl); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } - return result3; + return result2; } async function cleanupOldDebugLogs() { const cutoffDate = getCutoffDate(); - const result3 = { messages: 0, errors: 0 }; + const result2 = { messages: 0, errors: 0 }; const fsImpl = getFsImplementation(); - const debugDir = join165(getClaudeConfigHomeDir(), "debug"); + const debugDir = join155(getClaudeConfigHomeDir(), "debug"); let dirents; try { dirents = await fsImpl.readdir(debugDir); } catch { - return result3; + return result2; } for (const dirent of dirents) { if (!dirent.isFile() || !dirent.name.endsWith(".txt") || dirent.name === "latest") { continue; } try { - if (await unlinkIfOld(join165(debugDir, dirent.name), cutoffDate, fsImpl)) { - result3.messages++; + if (await unlinkIfOld(join155(debugDir, dirent.name), cutoffDate, fsImpl)) { + result2.messages++; } } catch { - result3.errors++; + result2.errors++; } } - return result3; + return result2; } async function cleanupNpmCacheForAnthropicPackages() { - const markerPath = join165(getClaudeConfigHomeDir(), ".npm-cache-cleanup"); + const markerPath = join155(getClaudeConfigHomeDir(), ".npm-cache-cleanup"); try { - const stat52 = await fs12.stat(markerPath); - if (Date.now() - stat52.mtimeMs < ONE_DAY_MS) { + const stat51 = await fs6.stat(markerPath); + if (Date.now() - stat51.mtimeMs < ONE_DAY_MS) { logForDebugging("npm cache cleanup: skipping, ran recently"); return; } @@ -741163,11 +663729,11 @@ async function cleanupNpmCacheForAnthropicPackages() { return; } logForDebugging("npm cache cleanup: starting"); - const npmCachePath = join165(homedir39(), ".npm", "_cacache"); + const npmCachePath = join155(homedir37(), ".npm", "_cacache"); const NPM_CACHE_RETENTION_COUNT = 5; const startTime = Date.now(); try { - const cacache = await Promise.resolve().then(() => __toESM(require_lib19(), 1)); + const cacache = await Promise.resolve().then(() => __toESM(require_lib17(), 1)); const cutoff = startTime - ONE_DAY_MS; const stream4 = cacache.ls.stream(npmCachePath); const anthropicEntries = []; @@ -741187,15 +663753,15 @@ async function cleanupNpmCacheForAnthropicPackages() { const keysToRemove = []; for (const [, entries] of byPackage) { entries.sort((a2, b) => b.time - a2.time); - for (let i4 = 0;i4 < entries.length; i4++) { - const entry = entries[i4]; - if (entry.time < cutoff || i4 >= NPM_CACHE_RETENTION_COUNT) { + for (let i3 = 0;i3 < entries.length; i3++) { + const entry = entries[i3]; + if (entry.time < cutoff || i3 >= NPM_CACHE_RETENTION_COUNT) { keysToRemove.push(entry.key); } } } await Promise.all(keysToRemove.map((key) => cacache.rm.entry(npmCachePath, key))); - await fs12.writeFile(markerPath, new Date().toISOString()); + await fs6.writeFile(markerPath, new Date().toISOString()); const durationMs = Date.now() - startTime; if (keysToRemove.length > 0) { logForDebugging(`npm cache cleanup: Removed ${keysToRemove.length} old @anthropic-ai entries in ${durationMs}ms`); @@ -741207,8 +663773,8 @@ async function cleanupNpmCacheForAnthropicPackages() { durationMs, entriesRemoved: keysToRemove.length }); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); logEvent("tengu_npm_cache_cleanup", { success: false, durationMs: Date.now() - startTime @@ -741218,10 +663784,10 @@ async function cleanupNpmCacheForAnthropicPackages() { } } async function cleanupOldVersionsThrottled() { - const markerPath = join165(getClaudeConfigHomeDir(), ".version-cleanup"); + const markerPath = join155(getClaudeConfigHomeDir(), ".version-cleanup"); try { - const stat52 = await fs12.stat(markerPath); - if (Date.now() - stat52.mtimeMs < ONE_DAY_MS) { + const stat51 = await fs6.stat(markerPath); + if (Date.now() - stat51.mtimeMs < ONE_DAY_MS) { logForDebugging("version cleanup: skipping, ran recently"); return; } @@ -741235,9 +663801,9 @@ async function cleanupOldVersionsThrottled() { logForDebugging("version cleanup: starting (throttled)"); try { await cleanupOldVersions(); - await fs12.writeFile(markerPath, new Date().toISOString()); - } catch (error46) { - logError2(error46); + await fs6.writeFile(markerPath, new Date().toISOString()); + } catch (error42) { + logError2(error42); } finally { await unlock(markerPath, { realpath: false }).catch(() => {}); } @@ -741285,8 +663851,8 @@ var init_cleanup3 = __esm(() => { // src/utils/deepLink/parseDeepLink.ts function containsControlChars(s) { - for (let i4 = 0;i4 < s.length; i4++) { - const code = s.charCodeAt(i4); + for (let i3 = 0;i3 < s.length; i3++) { + const code = s.charCodeAt(i3); if (code <= 31 || code === 127) { return true; } @@ -741347,11 +663913,11 @@ __export(exports_registerProtocol, { ensureDeepLinkProtocolRegistered: () => ensureDeepLinkProtocolRegistered, MACOS_BUNDLE_ID: () => MACOS_BUNDLE_ID }); -import { promises as fs13 } from "fs"; -import * as os6 from "os"; -import * as path29 from "path"; +import { promises as fs7 } from "fs"; +import * as os5 from "os"; +import * as path24 from "path"; function linuxDesktopPath() { - return path29.join(getXDGDataHome(), "applications", DESKTOP_FILE_NAME); + return path24.join(getXDGDataHome(), "applications", DESKTOP_FILE_NAME); } function linuxExecLine(claudePath) { return `Exec="${claudePath}" --handle-uri %u`; @@ -741360,16 +663926,16 @@ function windowsCommandValue(claudePath) { return `"${claudePath}" --handle-uri "%1"`; } async function registerMacos(claudePath) { - const contentsDir = path29.join(MACOS_APP_DIR, "Contents"); + const contentsDir = path24.join(MACOS_APP_DIR, "Contents"); try { - await fs13.rm(MACOS_APP_DIR, { recursive: true }); + await fs7.rm(MACOS_APP_DIR, { recursive: true }); } catch (e) { const code = getErrnoCode(e); if (code !== "ENOENT") { throw e; } } - await fs13.mkdir(path29.dirname(MACOS_SYMLINK_PATH), { recursive: true }); + await fs7.mkdir(path24.dirname(MACOS_SYMLINK_PATH), { recursive: true }); const infoPlist = ` @@ -741399,14 +663965,14 @@ async function registerMacos(claudePath) {
`; - await fs13.writeFile(path29.join(contentsDir, "Info.plist"), infoPlist); - await fs13.symlink(claudePath, MACOS_SYMLINK_PATH); + await fs7.writeFile(path24.join(contentsDir, "Info.plist"), infoPlist); + await fs7.symlink(claudePath, MACOS_SYMLINK_PATH); const lsregister = "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister"; await execFileNoThrow(lsregister, ["-R", MACOS_APP_DIR], { useCwd: false }); logForDebugging(`Registered ${DEEP_LINK_PROTOCOL}:// protocol handler at ${MACOS_APP_DIR}`); } async function registerLinux(claudePath) { - await fs13.mkdir(path29.dirname(linuxDesktopPath()), { recursive: true }); + await fs7.mkdir(path24.dirname(linuxDesktopPath()), { recursive: true }); const desktopEntry = `[Desktop Entry] Name=${APP_NAME} Comment=Handle ${DEEP_LINK_PROTOCOL}:// deep links for Claude Code @@ -741415,7 +663981,7 @@ Type=Application NoDisplay=true MimeType=x-scheme-handler/${DEEP_LINK_PROTOCOL}; `; - await fs13.writeFile(linuxDesktopPath(), desktopEntry); + await fs7.writeFile(linuxDesktopPath(), desktopEntry); const xdgMime = await which("xdg-mime"); if (xdgMime) { const { code } = await execFileNoThrow(xdgMime, ["default", DESKTOP_FILE_NAME, `x-scheme-handler/${DEEP_LINK_PROTOCOL}`], { useCwd: false }); @@ -741467,9 +664033,9 @@ async function registerProtocolHandler(claudePath) { } async function resolveClaudePath() { const binaryName = process.platform === "win32" ? "claude.exe" : "claude"; - const stablePath = path29.join(getUserBinDir(), binaryName); + const stablePath = path24.join(getUserBinDir(), binaryName); try { - await fs13.realpath(stablePath); + await fs7.realpath(stablePath); return stablePath; } catch { return process.execPath; @@ -741479,11 +664045,11 @@ async function isProtocolHandlerCurrent(claudePath) { try { switch (process.platform) { case "darwin": { - const target = await fs13.readlink(MACOS_SYMLINK_PATH); + const target = await fs7.readlink(MACOS_SYMLINK_PATH); return target === claudePath; } case "linux": { - const content = await fs13.readFile(linuxDesktopPath(), "utf8"); + const content = await fs7.readFile(linuxDesktopPath(), "utf8"); return content.includes(linuxExecLine(claudePath)); } case "win32": { @@ -741508,10 +664074,10 @@ async function ensureDeepLinkProtocolRegistered() { if (await isProtocolHandlerCurrent(claudePath)) { return; } - const failureMarkerPath = path29.join(getClaudeConfigHomeDir(), ".deep-link-register-failed"); + const failureMarkerPath = path24.join(getClaudeConfigHomeDir(), ".deep-link-register-failed"); try { - const stat52 = await fs13.stat(failureMarkerPath); - if (Date.now() - stat52.mtimeMs < FAILURE_BACKOFF_MS) { + const stat51 = await fs7.stat(failureMarkerPath); + if (Date.now() - stat51.mtimeMs < FAILURE_BACKOFF_MS) { return; } } catch {} @@ -741519,16 +664085,16 @@ async function ensureDeepLinkProtocolRegistered() { await registerProtocolHandler(claudePath); logEvent("tengu_deep_link_registered", { success: true }); logForDebugging("Auto-registered claude-cli:// deep link protocol handler"); - await fs13.rm(failureMarkerPath, { force: true }).catch(() => {}); - } catch (error46) { - const code = getErrnoCode(error46); + await fs7.rm(failureMarkerPath, { force: true }).catch(() => {}); + } catch (error42) { + const code = getErrnoCode(error42); logEvent("tengu_deep_link_registered", { success: false, error_code: code }); - logForDebugging(`Failed to auto-register deep link protocol handler: ${error46 instanceof Error ? error46.message : String(error46)}`, { level: "warn" }); + logForDebugging(`Failed to auto-register deep link protocol handler: ${error42 instanceof Error ? error42.message : String(error42)}`, { level: "warn" }); if (code === "EACCES" || code === "ENOSPC") { - await fs13.writeFile(failureMarkerPath, "").catch(() => {}); + await fs7.writeFile(failureMarkerPath, "").catch(() => {}); } } } @@ -741544,8 +664110,8 @@ var init_registerProtocol = __esm(() => { init_which(); init_xdg(); init_parseDeepLink(); - MACOS_APP_DIR = path29.join(os6.homedir(), "Applications", MACOS_APP_NAME); - MACOS_SYMLINK_PATH = path29.join(MACOS_APP_DIR, "Contents", "MacOS", "claude"); + MACOS_APP_DIR = path24.join(os5.homedir(), "Applications", MACOS_APP_NAME); + MACOS_SYMLINK_PATH = path24.join(MACOS_APP_DIR, "Contents", "MacOS", "claude"); WINDOWS_REG_KEY = `HKEY_CURRENT_USER\\Software\\Classes\\${DEEP_LINK_PROTOCOL}`; WINDOWS_COMMAND_KEY = `${WINDOWS_REG_KEY}\\shell\\open\\command`; FAILURE_BACKOFF_MS = 24 * 60 * 60 * 1000; @@ -741703,7 +664269,7 @@ function useApiKeyVerification() { } return "missing"; }); - const [error46, setError] = import_react277.useState(null); + const [error42, setError] = import_react277.useState(null); const verify = import_react277.useCallback(async () => { if (!isAnthropicAuthEnabled() || isClaudeAISubscriber()) { setStatus("valid"); @@ -741726,8 +664292,8 @@ function useApiKeyVerification() { const newStatus = isValid3 ? "valid" : "invalid"; setStatus(newStatus); return; - } catch (error47) { - setError(error47); + } catch (error43) { + setError(error43); const newStatus = "error"; setStatus(newStatus); return; @@ -741736,7 +664302,7 @@ function useApiKeyVerification() { return { status: status2, reverify: verify, - error: error46 + error: error42 }; } var import_react277; @@ -741744,11 +664310,11 @@ var init_useApiKeyVerification = __esm(() => { import_react277 = __toESM(require_react(), 1); init_state(); init_claude(); - init_auth2(); + init_auth(); }); // src/utils/terminalPanel.ts -import { spawn as spawn14, spawnSync as spawnSync8 } from "child_process"; +import { spawn as spawn11, spawnSync as spawnSync7 } from "child_process"; function getTerminalPanelSocket() { const sessionId = getSessionId(); return `claude-panel-${sessionId.slice(0, 8)}`; @@ -741769,22 +664335,22 @@ class TerminalPanel { checkTmux() { if (this.hasTmux !== undefined) return this.hasTmux; - const result3 = spawnSync8("tmux", ["-V"], { encoding: "utf-8" }); - this.hasTmux = result3.status === 0; + const result2 = spawnSync7("tmux", ["-V"], { encoding: "utf-8" }); + this.hasTmux = result2.status === 0; if (!this.hasTmux) { logForDebugging("Terminal panel: tmux not found, falling back to non-persistent shell"); } return this.hasTmux; } hasSession() { - const result3 = spawnSync8("tmux", ["-L", getTerminalPanelSocket(), "has-session", "-t", TMUX_SESSION], { encoding: "utf-8" }); - return result3.status === 0; + const result2 = spawnSync7("tmux", ["-L", getTerminalPanelSocket(), "has-session", "-t", TMUX_SESSION], { encoding: "utf-8" }); + return result2.status === 0; } createSession() { const shell = process.env.SHELL || "/bin/bash"; const cwd2 = pwd(); const socket = getTerminalPanelSocket(); - const result3 = spawnSync8("tmux", [ + const result2 = spawnSync7("tmux", [ "-L", socket, "new-session", @@ -741796,11 +664362,11 @@ class TerminalPanel { shell, "-l" ], { encoding: "utf-8" }); - if (result3.status !== 0) { - logForDebugging(`Terminal panel: failed to create tmux session: ${result3.stderr}`); + if (result2.status !== 0) { + logForDebugging(`Terminal panel: failed to create tmux session: ${result2.stderr}`); return false; } - spawnSync8("tmux", [ + spawnSync7("tmux", [ "-L", socket, "bind-key", @@ -741831,7 +664397,7 @@ class TerminalPanel { if (!this.cleanupRegistered) { this.cleanupRegistered = true; registerCleanup(async () => { - spawn14("tmux", ["-L", socket, "kill-server"], { + spawn11("tmux", ["-L", socket, "kill-server"], { detached: true, stdio: "ignore" }).on("error", () => {}).unref(); @@ -741840,7 +664406,7 @@ class TerminalPanel { return true; } attachSession() { - spawnSync8("tmux", ["-L", getTerminalPanelSocket(), "attach-session", "-t", TMUX_SESSION], { stdio: "inherit" }); + spawnSync7("tmux", ["-L", getTerminalPanelSocket(), "attach-session", "-t", TMUX_SESSION], { stdio: "inherit" }); } showShell() { const inkInstance = instances_default.get(process.stdout); @@ -741867,7 +664433,7 @@ class TerminalPanel { runShellDirect() { const shell = process.env.SHELL || "/bin/bash"; const cwd2 = pwd(); - spawnSync8(shell, ["-i", "-l"], { + spawnSync7(shell, ["-i", "-l"], { stdio: "inherit", cwd: cwd2, env: process.env @@ -742103,12 +664669,12 @@ function CommandKeybindingHandlers(t0) { t2 = actions; } const commandActions = t2; - let map7; + let map5; if ($2[3] !== commandActions || $2[4] !== onSubmit) { - map7 = {}; + map5 = {}; for (const action2 of commandActions) { const commandName = action2.slice(8); - map7[action2] = () => { + map5[action2] = () => { onSubmit(`/${commandName}`, NOOP_HELPERS, undefined, { fromKeybinding: true }); @@ -742116,11 +664682,11 @@ function CommandKeybindingHandlers(t0) { } $2[3] = commandActions; $2[4] = onSubmit; - $2[5] = map7; + $2[5] = map5; } else { - map7 = $2[5]; + map5 = $2[5]; } - const handlers = map7; + const handlers = map5; const t3 = isActive && !isModalOverlayActive; let t4; if ($2[6] !== t3) { @@ -742264,8 +664830,8 @@ function CancelRequestHandler(props) { }); return; } - const now3 = Date.now(); - const elapsed = now3 - lastKillAgentsPressRef.current; + const now2 = Date.now(); + const elapsed = now2 - lastKillAgentsPressRef.current; if (elapsed <= KILL_AGENTS_CONFIRM_WINDOW_MS) { lastKillAgentsPressRef.current = 0; removeNotification("kill-agents-confirm"); @@ -742276,7 +664842,7 @@ function CancelRequestHandler(props) { killAllAgentsAndNotify(); return; } - lastKillAgentsPressRef.current = now3; + lastKillAgentsPressRef.current = now2; const shortcut = getShortcutDisplay("chat:killAgents", "Chat", "ctrl+x ctrl+k"); addNotification({ key: "kill-agents-confirm", @@ -742295,7 +664861,7 @@ var init_useCancelRequest = __esm(() => { import_react279 = __toESM(require_react(), 1); init_analytics(); init_AppState(); - init_utils11(); + init_utils10(); init_notifications(); init_overlayContext(); init_useCommandQueue(); @@ -742680,11 +665246,11 @@ async function handleCoordinatorPermission(params) { if (classifierResult) { return classifierResult; } - } catch (error46) { - if (error46 instanceof Error) { - logError2(error46); + } catch (error42) { + if (error42 instanceof Error) { + logError2(error42); } else { - logError2(new Error(`Automated permission check failed: ${String(error46)}`)); + logError2(new Error(`Automated permission check failed: ${String(error42)}`)); } } return null; @@ -742695,7 +665261,7 @@ var init_coordinatorHandler = __esm(() => { }); // src/hooks/toolPermission/PermissionContext.ts -function createResolveOnce(resolve47) { +function createResolveOnce(resolve41) { let claimed = false; let delivered = false; return { @@ -742704,7 +665270,7 @@ function createResolveOnce(resolve47) { return; delivered = true; claimed = true; - resolve47(value); + resolve41(value); }, isResolved() { return claimed; @@ -742717,11 +665283,11 @@ function createResolveOnce(resolve47) { } }; } -function createPermissionContext(tool, input11, toolUseContext, assistantMessage, toolUseID, setToolPermissionContext, queueOps) { +function createPermissionContext(tool, input, toolUseContext, assistantMessage, toolUseID, setToolPermissionContext, queueOps) { const messageId = assistantMessage.message.id; const ctx = { tool, - input: input11, + input, toolUseContext, assistantMessage, messageId, @@ -742729,7 +665295,7 @@ function createPermissionContext(tool, input11, toolUseContext, assistantMessage logDecision(args, opts) { logPermissionDecision({ tool, - input: opts?.input ?? input11, + input: opts?.input ?? input, toolUseContext, messageId, toolUseID @@ -742747,13 +665313,13 @@ function createPermissionContext(tool, input11, toolUseContext, assistantMessage persistPermissionUpdates(updates); const appState = toolUseContext.getAppState(); setToolPermissionContext(applyPermissionUpdates(appState.toolPermissionContext, updates)); - return updates.some((update3) => supportsPersistence(update3.destination)); + return updates.some((update2) => supportsPersistence(update2.destination)); }, - resolveIfAborted(resolve47) { + resolveIfAborted(resolve41) { if (!toolUseContext.abortController.signal.aborted) return false; this.logCancelled(); - resolve47(this.cancelAndAbort(undefined, true)); + resolve41(this.cancelAndAbort(undefined, true)); return true; }, cancelAndAbort(feedback2, isAbort, contentBlocks) { @@ -742781,21 +665347,21 @@ function createPermissionContext(tool, input11, toolUseContext, assistantMessage setClassifierApproval(toolUseID, matchedRule); } } - logPermissionDecision({ tool, input: input11, toolUseContext, messageId, toolUseID }, { decision: "accept", source: { type: "classifier" } }, undefined); + logPermissionDecision({ tool, input, toolUseContext, messageId, toolUseID }, { decision: "accept", source: { type: "classifier" } }, undefined); return { behavior: "allow", - updatedInput: updatedInput ?? input11, + updatedInput: updatedInput ?? input, userModified: false, decisionReason: classifierDecision }; } } : {}, async runHooks(permissionMode, suggestions, updatedInput, permissionPromptStartTimeMs) { - for await (const hookResult of executePermissionRequestHooks(tool.name, toolUseID, input11, toolUseContext, permissionMode, suggestions, toolUseContext.abortController.signal)) { + for await (const hookResult of executePermissionRequestHooks(tool.name, toolUseID, input, toolUseContext, permissionMode, suggestions, toolUseContext.abortController.signal)) { if (hookResult.permissionRequestResult) { const decision = hookResult.permissionRequestResult; if (decision.behavior === "allow") { - const finalInput = decision.updatedInput ?? updatedInput ?? input11; + const finalInput = decision.updatedInput ?? updatedInput ?? input; return await this.handleHookAllow(finalInput, decision.updatedPermissions ?? [], permissionPromptStartTimeMs); } else if (decision.behavior === "deny") { this.logDecision({ decision: "reject", source: { type: "hook" } }, { permissionPromptStartTimeMs }); @@ -742834,7 +665400,7 @@ function createPermissionContext(tool, input11, toolUseContext, assistantMessage decision: "accept", source: { type: "user", permanent: acceptedPermanentUpdates } }, { input: updatedInput, permissionPromptStartTimeMs }); - const userModified = tool.inputsEquivalent ? !tool.inputsEquivalent(input11, updatedInput) : false; + const userModified = tool.inputsEquivalent ? !tool.inputsEquivalent(input, updatedInput) : false; const trimmedFeedback = feedback2?.trim(); return this.buildAllow(updatedInput, { userModified, @@ -742886,30 +665452,30 @@ var init_PermissionContext = __esm(() => { init_classifierApprovals(); init_debug(); init_hooks5(); - init_messages5(); + init_messages3(); init_PermissionUpdate(); init_permissionLogging(); }); // src/hooks/toolPermission/handlers/interactiveHandler.ts import { randomUUID as randomUUID49 } from "crypto"; -function handleInteractivePermission(params, resolve47) { +function handleInteractivePermission(params, resolve41) { const { ctx, description, - result: result3, + result: result2, awaitAutomatedChecksBeforeDialog, bridgeCallbacks, channelCallbacks } = params; - const { resolve: resolveOnce, isResolved, claim } = createResolveOnce(resolve47); + const { resolve: resolveOnce, isResolved, claim } = createResolveOnce(resolve41); let userInteracted = false; let checkmarkTransitionTimer; let checkmarkAbortHandler; const bridgeRequestId = bridgeCallbacks ? randomUUID49() : undefined; let channelUnsubscribe; const permissionPromptStartTimeMs = Date.now(); - const displayInput = result3.updatedInput ?? ctx.input; + const displayInput = result2.updatedInput ?? ctx.input; function clearClassifierIndicator() { if (feature("BASH_CLASSIFIER")) { ctx.updateQueueItem({ classifierCheckInProgress: false }); @@ -742922,10 +665488,10 @@ function handleInteractivePermission(params, resolve47) { input: displayInput, toolUseContext: ctx.toolUseContext, toolUseID: ctx.toolUseID, - permissionResult: result3, + permissionResult: result2, permissionPromptStartTimeMs, ...feature("BASH_CLASSIFIER") ? { - classifierCheckInProgress: !!result3.pendingClassifierCheck && !awaitAutomatedChecksBeforeDialog + classifierCheckInProgress: !!result2.pendingClassifierCheck && !awaitAutomatedChecksBeforeDialog } : {}, onUserInteraction() { const GRACE_PERIOD_MS = 200; @@ -742974,7 +665540,7 @@ function handleInteractivePermission(params, resolve47) { bridgeCallbacks.cancelRequest(bridgeRequestId); } channelUnsubscribe?.(); - resolveOnce(await ctx.handleUserAllow(updatedInput, permissionUpdates, feedback2, permissionPromptStartTimeMs, contentBlocks, result3.decisionReason)); + resolveOnce(await ctx.handleUserAllow(updatedInput, permissionUpdates, feedback2, permissionPromptStartTimeMs, contentBlocks, result2.decisionReason)); }, onReject(feedback2, contentBlocks) { if (!claim()) @@ -743011,7 +665577,7 @@ function handleInteractivePermission(params, resolve47) { } }); if (bridgeCallbacks && bridgeRequestId) { - bridgeCallbacks.sendRequest(bridgeRequestId, ctx.tool.name, displayInput, ctx.toolUseID, description, result3.suggestions, result3.blockedPath); + bridgeCallbacks.sendRequest(bridgeRequestId, ctx.tool.name, displayInput, ctx.toolUseID, description, result2.suggestions, result2.blockedPath); const signal = ctx.toolUseContext.abortController.signal; const unsubscribe2 = bridgeCallbacks.onResponse(bridgeRequestId, (response) => { if (!claim()) @@ -743057,14 +665623,14 @@ function handleInteractivePermission(params, resolve47) { description, input_preview: truncateForPreview(displayInput) }; - for (const client5 of channelClients) { - if (client5.type !== "connected") + for (const client2 of channelClients) { + if (client2.type !== "connected") continue; - client5.client.notification({ + client2.client.notification({ method: CHANNEL_PERMISSION_REQUEST_METHOD, params: params2 }).catch((e) => { - logForDebugging(`Channel permission_request failed for ${client5.name}: ${errorMessage(e)}`, { level: "error" }); + logForDebugging(`Channel permission_request failed for ${client2.name}: ${errorMessage(e)}`, { level: "error" }); }); } const channelSignal = ctx.toolUseContext.abortController.signal; @@ -743106,7 +665672,7 @@ function handleInteractivePermission(params, resolve47) { if (isResolved()) return; const currentAppState = ctx.toolUseContext.getAppState(); - const hookDecision = await ctx.runHooks(currentAppState.toolPermissionContext.mode, result3.suggestions, result3.updatedInput, permissionPromptStartTimeMs); + const hookDecision = await ctx.runHooks(currentAppState.toolPermissionContext.mode, result2.suggestions, result2.updatedInput, permissionPromptStartTimeMs); if (!hookDecision || !claim()) return; if (bridgeCallbacks && bridgeRequestId) { @@ -743117,9 +665683,9 @@ function handleInteractivePermission(params, resolve47) { resolveOnce(hookDecision); })(); } - if (feature("BASH_CLASSIFIER") && result3.pendingClassifierCheck && ctx.tool.name === BASH_TOOL_NAME && !awaitAutomatedChecksBeforeDialog) { + if (feature("BASH_CLASSIFIER") && result2.pendingClassifierCheck && ctx.tool.name === BASH_TOOL_NAME && !awaitAutomatedChecksBeforeDialog) { setClassifierChecking(ctx.toolUseID); - executeAsyncClassifierCheck(result3.pendingClassifierCheck, ctx.toolUseContext.abortController.signal, ctx.toolUseContext.options.isNonInteractiveSession, { + executeAsyncClassifierCheck(result2.pendingClassifierCheck, ctx.toolUseContext.abortController.signal, ctx.toolUseContext.options.isNonInteractiveSession, { shouldContinue: () => !isResolved() && !userInteracted, onComplete: () => { clearClassifierChecking(ctx.toolUseID); @@ -743171,8 +665737,8 @@ function handleInteractivePermission(params, resolve47) { once: true }); } - }).catch((error46) => { - logForDebugging(`Async classifier check failed: ${errorMessage(error46)}`, { + }).catch((error42) => { + logForDebugging(`Async classifier check failed: ${errorMessage(error42)}`, { level: "error" }); }); @@ -743207,8 +665773,8 @@ async function handleSwarmWorkerPermission(params) { ...prev, pendingWorkerRequest: null })); - const decision = await new Promise((resolve47) => { - const { resolve: resolveOnce, claim } = createResolveOnce(resolve47); + const decision = await new Promise((resolve41) => { + const { resolve: resolveOnce, claim } = createResolveOnce(resolve41); const request = createPermissionRequest({ toolName: ctx.tool.name, toolUseId: ctx.toolUseID, @@ -743255,8 +665821,8 @@ async function handleSwarmWorkerPermission(params) { }, { once: true }); }); return decision; - } catch (error46) { - logError2(toError(error46)); + } catch (error42) { + logError2(toError(error42)); return null; } } @@ -743275,43 +665841,43 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) { const $2 = import_compiler_runtime345.c(3); let t0; if ($2[0] !== setToolPermissionContext || $2[1] !== setToolUseConfirmQueue) { - t0 = async (tool, input11, toolUseContext, assistantMessage, toolUseID, forceDecision) => new Promise((resolve47) => { - const ctx = createPermissionContext(tool, input11, toolUseContext, assistantMessage, toolUseID, setToolPermissionContext, createPermissionQueueOps(setToolUseConfirmQueue)); - if (ctx.resolveIfAborted(resolve47)) { + t0 = async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => new Promise((resolve41) => { + const ctx = createPermissionContext(tool, input, toolUseContext, assistantMessage, toolUseID, setToolPermissionContext, createPermissionQueueOps(setToolUseConfirmQueue)); + if (ctx.resolveIfAborted(resolve41)) { return; } - const decisionPromise = forceDecision !== undefined ? Promise.resolve(forceDecision) : hasPermissionsToUseTool(tool, input11, toolUseContext, assistantMessage, toolUseID); - return decisionPromise.then(async (result3) => { - if (result3.behavior === "allow") { - if (ctx.resolveIfAborted(resolve47)) { + const decisionPromise = forceDecision !== undefined ? Promise.resolve(forceDecision) : hasPermissionsToUseTool(tool, input, toolUseContext, assistantMessage, toolUseID); + return decisionPromise.then(async (result2) => { + if (result2.behavior === "allow") { + if (ctx.resolveIfAborted(resolve41)) { return; } - if (feature("TRANSCRIPT_CLASSIFIER") && result3.decisionReason?.type === "classifier" && result3.decisionReason.classifier === "auto-mode") { - setYoloClassifierApproval(toolUseID, result3.decisionReason.reason); + if (feature("TRANSCRIPT_CLASSIFIER") && result2.decisionReason?.type === "classifier" && result2.decisionReason.classifier === "auto-mode") { + setYoloClassifierApproval(toolUseID, result2.decisionReason.reason); } ctx.logDecision({ decision: "accept", source: "config" }); - resolve47(ctx.buildAllow(result3.updatedInput ?? input11, { - decisionReason: result3.decisionReason + resolve41(ctx.buildAllow(result2.updatedInput ?? input, { + decisionReason: result2.decisionReason })); return; } const appState = toolUseContext.getAppState(); - const description = await tool.description(input11, { + const description = await tool.description(input, { isNonInteractiveSession: toolUseContext.options.isNonInteractiveSession, toolPermissionContext: appState.toolPermissionContext, tools: toolUseContext.options.tools }); - if (ctx.resolveIfAborted(resolve47)) { + if (ctx.resolveIfAborted(resolve41)) { return; } - switch (result3.behavior) { + switch (result2.behavior) { case "deny": { logPermissionDecision({ tool, - input: input11, + input, toolUseContext, messageId: ctx.messageId, toolUseID @@ -743319,11 +665885,11 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) { decision: "reject", source: "config" }); - if (feature("TRANSCRIPT_CLASSIFIER") && result3.decisionReason?.type === "classifier" && result3.decisionReason.classifier === "auto-mode") { + if (feature("TRANSCRIPT_CLASSIFIER") && result2.decisionReason?.type === "classifier" && result2.decisionReason.classifier === "auto-mode") { recordAutoModeDenial({ toolName: tool.name, display: description, - reason: result3.decisionReason.reason ?? "", + reason: result2.decisionReason.reason ?? "", timestamp: Date.now() }); toolUseContext.addNotification?.({ @@ -743334,7 +665900,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) { /* @__PURE__ */ jsx_dev_runtime449.jsxDEV(ThemedText, { color: "error", children: [ - tool.userFacingName(input11).toLowerCase(), + tool.userFacingName(input).toLowerCase(), " denied by auto mode" ] }, undefined, true, undefined, this), @@ -743346,7 +665912,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) { }, undefined, true, undefined, this) }); } - resolve47(result3); + resolve41(result2); return; } case "ask": { @@ -743354,42 +665920,42 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) { const coordinatorDecision = await handleCoordinatorPermission({ ctx, ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: result3.pendingClassifierCheck + pendingClassifierCheck: result2.pendingClassifierCheck } : {}, - updatedInput: result3.updatedInput, - suggestions: result3.suggestions, + updatedInput: result2.updatedInput, + suggestions: result2.suggestions, permissionMode: appState.toolPermissionContext.mode }); if (coordinatorDecision) { - resolve47(coordinatorDecision); + resolve41(coordinatorDecision); return; } } - if (ctx.resolveIfAborted(resolve47)) { + if (ctx.resolveIfAborted(resolve41)) { return; } const swarmDecision = await handleSwarmWorkerPermission({ ctx, description, ...feature("BASH_CLASSIFIER") ? { - pendingClassifierCheck: result3.pendingClassifierCheck + pendingClassifierCheck: result2.pendingClassifierCheck } : {}, - updatedInput: result3.updatedInput, - suggestions: result3.suggestions + updatedInput: result2.updatedInput, + suggestions: result2.suggestions }); if (swarmDecision) { - resolve47(swarmDecision); + resolve41(swarmDecision); return; } - if (feature("BASH_CLASSIFIER") && result3.pendingClassifierCheck && tool.name === BASH_TOOL_NAME && !appState.toolPermissionContext.awaitAutomatedChecksBeforeDialog) { - const speculativePromise = peekSpeculativeClassifierCheck(input11.command); + if (feature("BASH_CLASSIFIER") && result2.pendingClassifierCheck && tool.name === BASH_TOOL_NAME && !appState.toolPermissionContext.awaitAutomatedChecksBeforeDialog) { + const speculativePromise = peekSpeculativeClassifierCheck(input.command); if (speculativePromise) { const raceResult = await Promise.race([speculativePromise.then(_temp209), new Promise(_temp290)]); - if (ctx.resolveIfAborted(resolve47)) { + if (ctx.resolveIfAborted(resolve41)) { return; } if (raceResult.type === "result" && raceResult.result.matches && raceResult.result.confidence === "high" && feature("BASH_CLASSIFIER")) { - consumeSpeculativeClassifierCheck(input11.command); + consumeSpeculativeClassifierCheck(input.command); const matchedRule = raceResult.result.matchedDescription ?? undefined; if (matchedRule) { setClassifierApproval(toolUseID, matchedRule); @@ -743400,7 +665966,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) { type: "classifier" } }); - resolve47(ctx.buildAllow(result3.updatedInput ?? input11, { + resolve41(ctx.buildAllow(result2.updatedInput ?? input, { decisionReason: { type: "classifier", classifier: "bash_allow", @@ -743414,22 +665980,22 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) { handleInteractivePermission({ ctx, description, - result: result3, + result: result2, awaitAutomatedChecksBeforeDialog: appState.toolPermissionContext.awaitAutomatedChecksBeforeDialog, bridgeCallbacks: feature("BRIDGE_MODE") ? appState.replBridgePermissionCallbacks : undefined, channelCallbacks: feature("KAIROS") || feature("KAIROS_CHANNELS") ? appState.channelPermissionCallbacks : undefined - }, resolve47); + }, resolve41); return; } } - }).catch((error46) => { - if (error46 instanceof AbortError || error46 instanceof APIUserAbortError) { - logForDebugging(`Permission check threw ${error46.constructor.name} for tool=${tool.name}: ${error46.message}`); + }).catch((error42) => { + if (error42 instanceof AbortError || error42 instanceof APIUserAbortError) { + logForDebugging(`Permission check threw ${error42.constructor.name} for tool=${tool.name}: ${error42.message}`); ctx.logCancelled(); - resolve47(ctx.cancelAndAbort(undefined, true)); + resolve41(ctx.cancelAndAbort(undefined, true)); } else { - logError2(error46); - resolve47(ctx.cancelAndAbort(undefined, true)); + logError2(error42); + resolve41(ctx.cancelAndAbort(undefined, true)); } }).finally(() => { clearClassifierChecking(toolUseID); @@ -743477,13 +666043,13 @@ var init_useCanUseTool = __esm(() => { }); // src/utils/userPromptKeywords.ts -function matchesNegativeKeyword(input11) { - const lowerInput = input11.toLowerCase(); +function matchesNegativeKeyword(input) { + const lowerInput = input.toLowerCase(); const negativePattern = /\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/; return negativePattern.test(lowerInput); } -function matchesKeepGoingKeyword(input11) { - const lowerInput = input11.toLowerCase().trim(); +function matchesKeepGoingKeyword(input) { + const lowerInput = input.toLowerCase().trim(); if (lowerInput === "continue") { return true; } @@ -743493,12 +666059,12 @@ function matchesKeepGoingKeyword(input11) { // src/utils/processUserInput/processTextPrompt.ts import { randomUUID as randomUUID50 } from "crypto"; -function processTextPrompt(input11, imageContentBlocks, imagePasteIds, attachmentMessages, uuid8, permissionMode, isMeta) { +function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid5, permissionMode, isMeta) { const promptId = randomUUID50(); setPromptId(promptId); - const userPromptText = typeof input11 === "string" ? input11 : input11.find((block2) => block2.type === "text")?.text || ""; + const userPromptText = typeof input === "string" ? input : input.find((block2) => block2.type === "text")?.text || ""; startInteractionSpan(userPromptText); - const otelPromptText = typeof input11 === "string" ? input11 : input11.findLast((block2) => block2.type === "text")?.text || ""; + const otelPromptText = typeof input === "string" ? input : input.findLast((block2) => block2.type === "text")?.text || ""; if (otelPromptText) { logOTelEvent("user_prompt", { prompt_length: String(otelPromptText.length), @@ -743513,10 +666079,10 @@ function processTextPrompt(input11, imageContentBlocks, imagePasteIds, attachmen is_keep_going: isKeepGoing }); if (imageContentBlocks.length > 0) { - const textContent = typeof input11 === "string" ? input11.trim() ? [{ type: "text", text: input11 }] : [] : input11; + const textContent = typeof input === "string" ? input.trim() ? [{ type: "text", text: input }] : [] : input; const userMessage2 = createUserMessage({ content: [...textContent, ...imageContentBlocks], - uuid: uuid8, + uuid: uuid5, imagePasteIds: imagePasteIds.length > 0 ? imagePasteIds : undefined, permissionMode, isMeta: isMeta || undefined @@ -743527,8 +666093,8 @@ function processTextPrompt(input11, imageContentBlocks, imagePasteIds, attachmen }; } const userMessage = createUserMessage({ - content: input11, - uuid: uuid8, + content: input, + uuid: uuid5, permissionMode, isMeta: isMeta || undefined }); @@ -743540,7 +666106,7 @@ function processTextPrompt(input11, imageContentBlocks, imagePasteIds, attachmen var init_processTextPrompt = __esm(() => { init_state(); init_analytics(); - init_messages5(); + init_messages3(); init_events(); init_sessionTracing(); }); @@ -743549,11 +666115,11 @@ var init_processTextPrompt = __esm(() => { function BashModeProgress(t0) { const $2 = import_compiler_runtime346.c(8); const { - input: input11, + input, progress, verbose } = t0; - const t1 = `${input11}`; + const t1 = `${input}`; let t2; if ($2[0] !== t1) { t2 = /* @__PURE__ */ jsx_dev_runtime450.jsxDEV(UserBashInputMessage, { @@ -743733,7 +666299,7 @@ var init_processBashCommand = __esm(() => { init_BashTool(); init_analytics(); init_errors(); - init_messages5(); + init_messages3(); init_resolveDefaultShell(); init_shellToolUtils(); init_toolResultStorage(); @@ -743743,7 +666309,7 @@ var init_processBashCommand = __esm(() => { // src/utils/processUserInput/processUserInput.ts import { randomUUID as randomUUID52 } from "crypto"; async function processUserInput({ - input: input11, + input, preExpansionInput, mode, setToolJSX, @@ -743752,7 +666318,7 @@ async function processUserInput({ ideSelection, messages, setUserInputOnProcessing, - uuid: uuid8, + uuid: uuid5, isAlreadyProcessing, querySource, canUseTool, @@ -743761,19 +666327,19 @@ async function processUserInput({ isMeta, skipAttachments }) { - const inputString = typeof input11 === "string" ? input11 : null; + const inputString = typeof input === "string" ? input : null; if (mode === "prompt" && inputString !== null && !isMeta) { setUserInputOnProcessing?.(inputString); } queryCheckpoint("query_process_user_input_base_start"); const appState = context2.getAppState(); - const result3 = await processUserInputBase(input11, mode, setToolJSX, context2, pastedContents, ideSelection, messages, uuid8, isAlreadyProcessing, querySource, canUseTool, appState.toolPermissionContext.mode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput); + const result2 = await processUserInputBase(input, mode, setToolJSX, context2, pastedContents, ideSelection, messages, uuid5, isAlreadyProcessing, querySource, canUseTool, appState.toolPermissionContext.mode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput); queryCheckpoint("query_process_user_input_base_end"); - if (!result3.shouldQuery) { - return result3; + if (!result2.shouldQuery) { + return result2; } queryCheckpoint("query_hooks_start"); - const inputMessage = getContentText(input11) || ""; + const inputMessage = getContentText(input) || ""; for await (const hookResult of executeUserPromptSubmitHooks(inputMessage, appState.toolPermissionContext.mode, context2, context2.requestPrompt)) { if (hookResult.message?.type === "progress") { continue; @@ -743784,22 +666350,22 @@ async function processUserInput({ messages: [ createSystemMessage(`${blockingMessage} -Original prompt: ${input11}`, "warning") +Original prompt: ${input}`, "warning") ], shouldQuery: false, - allowedTools: result3.allowedTools + allowedTools: result2.allowedTools }; } if (hookResult.preventContinuation) { const message = hookResult.stopReason ? `Operation stopped by hook: ${hookResult.stopReason}` : "Operation stopped by hook"; - result3.messages.push(createUserMessage({ + result2.messages.push(createUserMessage({ content: message })); - result3.shouldQuery = false; - return result3; + result2.shouldQuery = false; + return result2; } if (hookResult.additionalContexts && hookResult.additionalContexts.length > 0) { - result3.messages.push(createAttachmentMessage({ + result2.messages.push(createAttachmentMessage({ type: "hook_additional_context", content: hookResult.additionalContexts.map(applyTruncation), hookName: "UserPromptSubmit", @@ -743813,7 +666379,7 @@ Original prompt: ${input11}`, "warning") if (!hookResult.message.attachment.content) { break; } - result3.messages.push({ + result2.messages.push({ ...hookResult.message, attachment: { ...hookResult.message.attachment, @@ -743822,13 +666388,13 @@ Original prompt: ${input11}`, "warning") }); break; default: - result3.messages.push(hookResult.message); + result2.messages.push(hookResult.message); break; } } } queryCheckpoint("query_hooks_end"); - return result3; + return result2; } function applyTruncation(content) { if (content.length > MAX_HOOK_OUTPUT_LENGTH) { @@ -743836,17 +666402,17 @@ function applyTruncation(content) { } return content; } -async function processUserInputBase(input11, mode, setToolJSX, context2, pastedContents, ideSelection, messages, uuid8, isAlreadyProcessing, querySource, canUseTool, permissionMode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput) { +async function processUserInputBase(input, mode, setToolJSX, context2, pastedContents, ideSelection, messages, uuid5, isAlreadyProcessing, querySource, canUseTool, permissionMode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput) { let inputString = null; let precedingInputBlocks = []; const imageMetadataTexts = []; - let normalizedInput = input11; - if (typeof input11 === "string") { - inputString = input11; - } else if (input11.length > 0) { + let normalizedInput = input; + if (typeof input === "string") { + inputString = input; + } else if (input.length > 0) { queryCheckpoint("query_image_processing_start"); const processedBlocks = []; - for (const block2 of input11) { + for (const block2 of input) { if (block2.type === "image") { const resized = await maybeResizeAndDownsampleImageBlock(block2); if (resized.dimensions) { @@ -743929,7 +666495,7 @@ async function processUserInputBase(input11, mode, setToolJSX, context2, pastedC const msg = `/${getCommandName(cmd)} isn't available over Remote Control.`; return { messages: [ - createUserMessage({ content: inputString, uuid: uuid8 }), + createUserMessage({ content: inputString, uuid: uuid5 }), createCommandInputMessage(`${msg}`) ], shouldQuery: false, @@ -743942,12 +666508,12 @@ async function processUserInputBase(input11, mode, setToolJSX, context2, pastedC logEvent("tengu_ultraplan_keyword", {}); const rewritten = replaceUltraplanKeyword(inputString).trim(); const { processSlashCommand: processSlashCommand2 } = await Promise.resolve().then(() => (init_processSlashCommand(), exports_processSlashCommand)); - const slashResult = await processSlashCommand2(`/ultraplan ${rewritten}`, precedingInputBlocks, imageContentBlocks, [], context2, setToolJSX, uuid8, isAlreadyProcessing, canUseTool); + const slashResult = await processSlashCommand2(`/ultraplan ${rewritten}`, precedingInputBlocks, imageContentBlocks, [], context2, setToolJSX, uuid5, isAlreadyProcessing, canUseTool); return addImageMetadataMessage(slashResult, imageMetadataTexts); } const shouldExtractAttachments = !skipAttachments && inputString !== null && (mode !== "prompt" || effectiveSkipSlash || !inputString.startsWith("/")); queryCheckpoint("query_attachment_loading_start"); - const attachmentMessages = shouldExtractAttachments ? await toArray4(getAttachmentMessages(inputString, context2, ideSelection ?? null, [], messages, querySource)) : []; + const attachmentMessages = shouldExtractAttachments ? await toArray3(getAttachmentMessages(inputString, context2, ideSelection ?? null, [], messages, querySource)) : []; queryCheckpoint("query_attachment_loading_end"); if (inputString !== null && mode === "bash") { const { processBashCommand: processBashCommand2 } = await Promise.resolve().then(() => (init_processBashCommand(), exports_processBashCommand)); @@ -743955,7 +666521,7 @@ async function processUserInputBase(input11, mode, setToolJSX, context2, pastedC } if (inputString !== null && !effectiveSkipSlash && inputString.startsWith("/")) { const { processSlashCommand: processSlashCommand2 } = await Promise.resolve().then(() => (init_processSlashCommand(), exports_processSlashCommand)); - const slashResult = await processSlashCommand2(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context2, setToolJSX, uuid8, isAlreadyProcessing, canUseTool); + const slashResult = await processSlashCommand2(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context2, setToolJSX, uuid5, isAlreadyProcessing, canUseTool); return addImageMetadataMessage(slashResult, imageMetadataTexts); } if (inputString !== null && mode === "prompt") { @@ -743971,29 +666537,29 @@ async function processUserInputBase(input11, mode, setToolJSX, context2, pastedC }); } } - return addImageMetadataMessage(processTextPrompt(normalizedInput, imageContentBlocks, imagePasteIds, attachmentMessages, uuid8, permissionMode, isMeta), imageMetadataTexts); + return addImageMetadataMessage(processTextPrompt(normalizedInput, imageContentBlocks, imagePasteIds, attachmentMessages, uuid5, permissionMode, isMeta), imageMetadataTexts); } -function addImageMetadataMessage(result3, imageMetadataTexts) { +function addImageMetadataMessage(result2, imageMetadataTexts) { if (imageMetadataTexts.length > 0) { - result3.messages.push(createUserMessage({ - content: imageMetadataTexts.map((text2) => ({ type: "text", text: text2 })), + result2.messages.push(createUserMessage({ + content: imageMetadataTexts.map((text) => ({ type: "text", text })), isMeta: true })); } - return result3; + return result2; } var MAX_HOOK_OUTPUT_LENGTH = 1e4; var init_processUserInput = __esm(() => { init_bun_bundle(); init_analytics(); - init_messages5(); + init_messages3(); init_commands2(); init_attachments2(); init_generators(); init_hooks5(); init_imageResizer(); init_imageStore(); - init_messages5(); + init_messages3(); init_queryProfiler(); init_keyword(); init_processTextPrompt(); @@ -744023,7 +666589,7 @@ async function handlePromptSubmit(params) { onBeforeQuery, canUseTool, queuedCommands, - uuid: uuid8, + uuid: uuid5, skipSlashCommands } = params; const { setCursorOffset, clearBuffer, resetHistory } = helpers2; @@ -744050,16 +666616,16 @@ async function handlePromptSubmit(params) { }); return; } - const input11 = params.input ?? ""; + const input = params.input ?? ""; const mode = params.mode ?? "prompt"; const rawPastedContents = params.pastedContents ?? {}; - const referencedIds = new Set(parseReferences(input11).map((r) => r.id)); + const referencedIds = new Set(parseReferences(input).map((r) => r.id)); const pastedContents = Object.fromEntries(Object.entries(rawPastedContents).filter(([, c6]) => c6.type !== "image" || referencedIds.has(c6.id))); const hasImages = Object.values(pastedContents).some(isValidImagePaste); - if (input11.trim() === "") { + if (input.trim() === "") { return; } - if (!skipSlashCommands && ["exit", "quit", ":q", ":q!", ":wq", ":wq!"].includes(input11.trim())) { + if (!skipSlashCommands && ["exit", "quit", ":q", ":q!", ":wq", ":wq!"].includes(input.trim())) { const exitCommand = commands.find((cmd2) => cmd2.name === "exit"); if (exitCommand) { handlePromptSubmit({ @@ -744071,10 +666637,10 @@ async function handlePromptSubmit(params) { } return; } - const finalInput = expandPastedTextRefs(input11, pastedContents); - const pastedTextRefs = parseReferences(input11).filter((r) => pastedContents[r.id]?.type === "text"); + const finalInput = expandPastedTextRefs(input, pastedContents); + const pastedTextRefs = parseReferences(input).filter((r) => pastedContents[r.id]?.type === "text"); const pastedTextCount = pastedTextRefs.length; - const pastedTextBytes = pastedTextRefs.reduce((sum3, r) => sum3 + (pastedContents[r.id]?.content.length ?? 0), 0); + const pastedTextBytes = pastedTextRefs.reduce((sum2, r) => sum2 + (pastedContents[r.id]?.content.length ?? 0), 0); logEvent("tengu_paste_text", { pastedTextCount, pastedTextBytes }); if (!skipSlashCommands && finalInput.trim().startsWith("/")) { const trimmedInput = finalInput.trim(); @@ -744092,17 +666658,17 @@ async function handlePromptSubmit(params) { clearBuffer(); const context2 = getToolUseContext(messages, [], createAbortController(), mainLoopModel); let doneWasCalled = false; - const onDone = (result3, options2) => { + const onDone = (result2, options2) => { doneWasCalled = true; setToolJSX({ jsx: null, shouldHidePromptInput: false, clearLocalJSX: true }); - if (result3 && options2?.display !== "skip" && params.addNotification) { + if (result2 && options2?.display !== "skip" && params.addNotification) { params.addNotification({ key: `immediate-${immediateCommand.name}`, - text: result3, + text: result2, priority: "immediate" }); } @@ -744141,11 +666707,11 @@ async function handlePromptSubmit(params) { } enqueue({ value: finalInput.trim(), - preExpansionValue: input11.trim(), + preExpansionValue: input.trim(), mode, pastedContents: hasImages ? pastedContents : undefined, skipSlashCommands, - uuid: uuid8 + uuid: uuid5 }); onInputChange(""); setCursorOffset(0); @@ -744157,11 +666723,11 @@ async function handlePromptSubmit(params) { startQueryProfile(); const cmd = { value: finalInput, - preExpansionValue: input11, + preExpansionValue: input, mode, pastedContents: hasImages ? pastedContents : undefined, skipSlashCommands, - uuid: uuid8 + uuid: uuid5 }; await executeUserInput({ queuedCommands: [cmd], @@ -744220,10 +666786,10 @@ async function executeUserInput(params) { const firstWorkload = commands[0]?.workload; const turnWorkload = firstWorkload !== undefined && commands.every((c6) => c6.workload === firstWorkload) ? firstWorkload : undefined; await runWithWorkload(turnWorkload, async () => { - for (let i4 = 0;i4 < commands.length; i4++) { - const cmd = commands[i4]; - const isFirst = i4 === 0; - const result3 = await processUserInput({ + for (let i3 = 0;i3 < commands.length; i3++) { + const cmd = commands[i3]; + const isFirst = i3 === 0; + const result2 = await processUserInput({ input: cmd.value, preExpansionInput: cmd.preExpansionValue, mode: cmd.mode, @@ -744244,19 +666810,19 @@ async function executeUserInput(params) { }); const origin2 = cmd.origin ?? (cmd.mode === "task-notification" ? { kind: "task-notification" } : undefined); if (origin2) { - for (const m of result3.messages) { + for (const m of result2.messages) { if (m.type === "user") m.origin = origin2; } } - newMessages.push(...result3.messages); + newMessages.push(...result2.messages); if (isFirst) { - shouldQuery = result3.shouldQuery; - allowedTools = result3.allowedTools; - model = result3.model; - effort = result3.effort; - nextInput = result3.nextInput; - submitNextInput = result3.submitNextInput; + shouldQuery = result2.shouldQuery; + allowedTools = result2.allowedTools; + model = result2.model; + effort = result2.effort; + nextInput = result2.nextInput; + submitNextInput = result2.submitNextInput; } } queryCheckpoint("query_process_user_input_end"); @@ -744444,7 +667010,7 @@ var init_useMergedCommands = __esm(() => { // src/utils/skills/skillChangeDetector.ts import * as platformPath2 from "path"; -async function initialize4() { +async function initialize3() { if (initialized4 || disposed3) return; initialized4 = true; @@ -744467,10 +667033,10 @@ async function initialize4() { stabilityThreshold: testOverrides2?.stabilityThreshold ?? FILE_STABILITY_THRESHOLD_MS3, pollInterval: testOverrides2?.pollInterval ?? FILE_STABILITY_POLL_INTERVAL_MS3 }, - ignored: (path30, stats2) => { + ignored: (path25, stats2) => { if (stats2 && !stats2.isFile() && !stats2.isDirectory()) return true; - return path30.split(platformPath2.sep).some((dir) => dir === ".git"); + return path25.split(platformPath2.sep).some((dir) => dir === ".git"); }, ignorePermissionErrors: true, usePolling: USE_POLLING, @@ -744504,19 +667070,19 @@ function dispose3() { return closePromise; } async function getWatchablePaths() { - const fs14 = getFsImplementation(); + const fs8 = getFsImplementation(); const paths2 = []; const userSkillsPath = getSkillsPath("userSettings", "skills"); if (userSkillsPath) { try { - await fs14.stat(userSkillsPath); + await fs8.stat(userSkillsPath); paths2.push(userSkillsPath); } catch {} } const userCommandsPath = getSkillsPath("userSettings", "commands"); if (userCommandsPath) { try { - await fs14.stat(userCommandsPath); + await fs8.stat(userCommandsPath); paths2.push(userCommandsPath); } catch {} } @@ -744524,7 +667090,7 @@ async function getWatchablePaths() { if (projectSkillsPath) { try { const absolutePath = platformPath2.resolve(projectSkillsPath); - await fs14.stat(absolutePath); + await fs8.stat(absolutePath); paths2.push(absolutePath); } catch {} } @@ -744532,25 +667098,25 @@ async function getWatchablePaths() { if (projectCommandsPath) { try { const absolutePath = platformPath2.resolve(projectCommandsPath); - await fs14.stat(absolutePath); + await fs8.stat(absolutePath); paths2.push(absolutePath); } catch {} } for (const dir of getAdditionalDirectoriesForClaudeMd()) { const additionalSkillsPath = platformPath2.join(dir, ".claude", "skills"); try { - await fs14.stat(additionalSkillsPath); + await fs8.stat(additionalSkillsPath); paths2.push(additionalSkillsPath); } catch {} } return paths2; } -function handleChange3(path30) { - logForDebugging(`Detected skill change: ${path30}`); +function handleChange3(path25) { + logForDebugging(`Detected skill change: ${path25}`); logEvent("tengu_skill_file_changed", { source: "chokidar" }); - scheduleReload(path30); + scheduleReload(path25); } function scheduleReload(changedPath) { pendingChangedPaths.add(changedPath); @@ -744603,7 +667169,7 @@ var init_skillChangeDetector = __esm(() => { skillsChanged = createSignal(); subscribe4 = skillsChanged.subscribe; skillChangeDetector = { - initialize: initialize4, + initialize: initialize3, dispose: dispose3, subscribe: subscribe4, resetForTesting: resetForTesting2 @@ -744619,9 +667185,9 @@ function useSkillsChange(cwd2, onCommandsChange) { clearCommandsCache(); const commands = await getCommands(cwd2); onCommandsChange(commands); - } catch (error46) { - if (error46 instanceof Error) { - logError2(error46); + } catch (error42) { + if (error42 instanceof Error) { + logError2(error42); } } }, [cwd2, onCommandsChange]); @@ -744633,9 +667199,9 @@ function useSkillsChange(cwd2, onCommandsChange) { clearCommandMemoizationCaches(); const commands = await getCommands(cwd2); onCommandsChange(commands); - } catch (error46) { - if (error46 instanceof Error) { - logError2(error46); + } catch (error42) { + if (error42 instanceof Error) { + logError2(error42); } } }, [cwd2, onCommandsChange]); @@ -744681,7 +667247,7 @@ async function detectAndUninstallDelistedPlugins() { if (pluginId in alreadyFlagged) continue; const installations = installedPlugins.plugins[pluginId] ?? []; - const hasUserInstall = installations.some((i4) => i4.scope === "user" || i4.scope === "project" || i4.scope === "local"); + const hasUserInstall = installations.some((i3) => i3.scope === "user" || i3.scope === "project" || i3.scope === "local"); if (!hasUserInstall) continue; for (const installation of installations) { @@ -744691,15 +667257,15 @@ async function detectAndUninstallDelistedPlugins() { } try { await uninstallPluginOp(pluginId, scope); - } catch (error46) { - logForDebugging(`Failed to auto-uninstall delisted plugin ${pluginId} from ${scope}: ${errorMessage(error46)}`, { level: "error" }); + } catch (error42) { + logForDebugging(`Failed to auto-uninstall delisted plugin ${pluginId} from ${scope}: ${errorMessage(error42)}`, { level: "error" }); } } await addFlaggedPlugin(pluginId); newlyFlagged.push(pluginId); } - } catch (error46) { - logForDebugging(`Failed to check for delisted plugins in "${marketplaceName}": ${errorMessage(error46)}`, { level: "warn" }); + } catch (error42) { + logForDebugging(`Failed to check for delisted plugins in "${marketplaceName}": ${errorMessage(error42)}`, { level: "warn" }); } } return newlyFlagged; @@ -744737,8 +667303,8 @@ function useManagePlugins({ let agents2 = []; try { commands = await getPluginCommands(); - } catch (error46) { - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); errors7.push({ type: "generic-error", source: "plugin-commands", @@ -744747,8 +667313,8 @@ function useManagePlugins({ } try { agents2 = await loadPluginAgents(); - } catch (error46) { - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); errors7.push({ type: "generic-error", source: "plugin-agents", @@ -744757,8 +667323,8 @@ function useManagePlugins({ } try { await loadPluginHooks(); - } catch (error46) { - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); errors7.push({ type: "generic-error", source: "plugin-hooks", @@ -744773,7 +667339,7 @@ function useManagePlugins({ p.mcpServers = servers; return servers ? Object.keys(servers).length : 0; })); - const mcp_count = mcpServerCounts.reduce((sum3, n3) => sum3 + n3, 0); + const mcp_count = mcpServerCounts.reduce((sum2, n3) => sum2 + n3, 0); const lspServerCounts = await Promise.all(enabled2.map(async (p) => { if (p.lspServers) return Object.keys(p.lspServers).length; @@ -744782,7 +667348,7 @@ function useManagePlugins({ p.lspServers = servers; return servers ? Object.keys(servers).length : 0; })); - const lsp_count = lspServerCounts.reduce((sum3, n3) => sum3 + n3, 0); + const lsp_count = lspServerCounts.reduce((sum2, n3) => sum2 + n3, 0); reinitializeLspServerManager(); setAppState((prevState) => { const existingLspErrors = prevState.plugins.errors.filter((e) => e.source === "lsp-manager" || e.source.startsWith("plugin:")); @@ -744804,10 +667370,10 @@ function useManagePlugins({ }; }); logForDebugging(`Loaded plugins - Enabled: ${enabled2.length}, Disabled: ${disabled.length}, Commands: ${commands.length}, Agents: ${agents2.length}, Errors: ${errors7.length}`); - const hook_count = enabled2.reduce((sum3, p) => { + const hook_count = enabled2.reduce((sum2, p) => { if (!p.hooksConfig) - return sum3; - return sum3 + Object.values(p.hooksConfig).reduce((s, matchers) => s + (matchers?.reduce((h2, m) => h2 + m.hooks.length, 0) ?? 0), 0); + return sum2; + return sum2 + Object.values(p.hooksConfig).reduce((s, matchers) => s + (matchers?.reduce((h2, m) => h2 + m.hooks.length, 0) ?? 0), 0); }, 0); return { enabled_count: enabled2.length, @@ -744822,10 +667388,10 @@ function useManagePlugins({ lsp_count, ant_enabled_names: process.env.USER_TYPE === "ant" && enabled2.length > 0 ? enabled2.map((p) => p.name).sort().join(",") : undefined }; - } catch (error46) { - const errorObj = toError(error46); + } catch (error42) { + const errorObj = toError(error42); logError2(errorObj); - logForDebugging(`Error loading plugins: ${error46}`); + logForDebugging(`Error loading plugins: ${error42}`); setAppState((prevState) => { const existingLspErrors = prevState.plugins.errors.filter((e) => e.source === "lsp-manager" || e.source.startsWith("plugin:")); const newError = { @@ -745077,8 +667643,8 @@ function useIdeSelection(mcpClients, onSelect) { filePath: selectionData.filePath }); } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } }); handlersRegistered.current = true; @@ -745120,7 +667686,7 @@ __export(exports_asciicast, { _resetRecordingStateForTesting: () => _resetRecordingStateForTesting }); import { appendFile as appendFile7, rename as rename10 } from "fs/promises"; -import { basename as basename62, dirname as dirname68, join as join168 } from "path"; +import { basename as basename60, dirname as dirname64, join as join158 } from "path"; function getRecordFilePath() { if (recordingState.filePath !== null) { return recordingState.filePath; @@ -745131,10 +667697,10 @@ function getRecordFilePath() { if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) { return null; } - const projectsDir = join168(getClaudeConfigHomeDir(), "projects"); - const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd())); + const projectsDir = join158(getClaudeConfigHomeDir(), "projects"); + const projectDir = join158(projectsDir, sanitizePath2(getOriginalCwd())); recordingState.timestamp = Date.now(); - recordingState.filePath = join168(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`); + recordingState.filePath = join158(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`); return recordingState.filePath; } function _resetRecordingStateForTesting() { @@ -745143,13 +667709,13 @@ function _resetRecordingStateForTesting() { } function getSessionRecordingPaths() { const sessionId = getSessionId(); - const projectsDir = join168(getClaudeConfigHomeDir(), "projects"); - const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd())); + const projectsDir = join158(getClaudeConfigHomeDir(), "projects"); + const projectDir = join158(projectsDir, sanitizePath2(getOriginalCwd())); try { const entries = getFsImplementation().readdirSync(projectDir); const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name); - const files3 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort(); - return files3.map((f) => join168(projectDir, f)); + const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort(); + return files2.map((f) => join158(projectDir, f)); } catch { return []; } @@ -745159,15 +667725,15 @@ async function renameRecordingForSession() { if (!oldPath || recordingState.timestamp === 0) { return; } - const projectsDir = join168(getClaudeConfigHomeDir(), "projects"); - const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd())); - const newPath = join168(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`); + const projectsDir = join158(getClaudeConfigHomeDir(), "projects"); + const projectDir = join158(projectsDir, sanitizePath2(getOriginalCwd())); + const newPath = join158(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`); if (oldPath === newPath) { return; } await recorder?.flush(); - const oldName = basename62(oldPath); - const newName = basename62(newPath); + const oldName = basename60(oldPath); + const newName = basename60(newPath); try { await rename10(oldPath, newPath); recordingState.filePath = newPath; @@ -745202,7 +667768,7 @@ function installAsciicastRecorder() { } }); try { - getFsImplementation().mkdirSync(dirname68(filePath)); + getFsImplementation().mkdirSync(dirname64(filePath)); } catch {} getFsImplementation().appendFileSync(filePath, header + ` `, { mode: 384 }); @@ -745220,15 +667786,15 @@ function installAsciicastRecorder() { maxBufferBytes: 10 * 1024 * 1024 }); const originalWrite = process.stdout.write.bind(process.stdout); - process.stdout.write = function(chunk4, encodingOrCb, cb) { + process.stdout.write = function(chunk3, encodingOrCb, cb) { const elapsed = (performance.now() - startTime) / 1000; - const text2 = typeof chunk4 === "string" ? chunk4 : Buffer.from(chunk4).toString("utf-8"); - writer.write(jsonStringify([elapsed, "o", text2]) + ` + const text = typeof chunk3 === "string" ? chunk3 : Buffer.from(chunk3).toString("utf-8"); + writer.write(jsonStringify([elapsed, "o", text]) + ` `); if (typeof encodingOrCb === "function") { - return originalWrite(chunk4, encodingOrCb); + return originalWrite(chunk3, encodingOrCb); } - return originalWrite(chunk4, encodingOrCb, cb); + return originalWrite(chunk3, encodingOrCb, cb); }; function onResize() { const elapsed = (performance.now() - startTime) / 1000; @@ -745282,39 +667848,39 @@ var init_persist = __esm(() => { }); // src/utils/sessionRestore.ts -import { dirname as dirname69 } from "path"; +import { dirname as dirname65 } from "path"; function extractTodosFromTranscript(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const msg = messages[i3]; if (msg?.type !== "assistant") continue; const toolUse = msg.message.content.find((block2) => block2.type === "tool_use" && block2.name === TODO_WRITE_TOOL_NAME); if (!toolUse || toolUse.type !== "tool_use") continue; - const input11 = toolUse.input; - if (input11 === null || typeof input11 !== "object") + const input = toolUse.input; + if (input === null || typeof input !== "object") return []; - const parsed = TodoListSchema().safeParse(input11.todos); + const parsed = TodoListSchema().safeParse(input.todos); return parsed.success ? parsed.data : []; } return []; } -function restoreSessionStateFromLog(result3, setAppState) { - if (result3.fileHistorySnapshots && result3.fileHistorySnapshots.length > 0) { - fileHistoryRestoreStateFromLog(result3.fileHistorySnapshots, (newState) => { +function restoreSessionStateFromLog(result2, setAppState) { + if (result2.fileHistorySnapshots && result2.fileHistorySnapshots.length > 0) { + fileHistoryRestoreStateFromLog(result2.fileHistorySnapshots, (newState) => { setAppState((prev) => ({ ...prev, fileHistory: newState })); }); } - if (feature("COMMIT_ATTRIBUTION") && result3.attributionSnapshots && result3.attributionSnapshots.length > 0) { - attributionRestoreStateFromLog(result3.attributionSnapshots, (newState) => { + if (feature("COMMIT_ATTRIBUTION") && result2.attributionSnapshots && result2.attributionSnapshots.length > 0) { + attributionRestoreStateFromLog(result2.attributionSnapshots, (newState) => { setAppState((prev) => ({ ...prev, attribution: newState })); }); } if (feature("CONTEXT_COLLAPSE")) { - (init_persist(), __toCommonJS(exports_persist)).restoreFromEntries(result3.contextCollapseCommits ?? [], result3.contextCollapseSnapshot); + (init_persist(), __toCommonJS(exports_persist)).restoreFromEntries(result2.contextCollapseCommits ?? [], result2.contextCollapseSnapshot); } - if (!isTodoV2Enabled() && result3.messages && result3.messages.length > 0) { - const todos = extractTodosFromTranscript(result3.messages); + if (!isTodoV2Enabled() && result2.messages && result2.messages.length > 0) { + const todos = extractTodosFromTranscript(result2.messages); if (todos.length > 0) { const agentId = getSessionId(); setAppState((prev) => ({ @@ -745324,9 +667890,9 @@ function restoreSessionStateFromLog(result3, setAppState) { } } } -function computeRestoredAttributionState(result3) { - if (feature("COMMIT_ATTRIBUTION") && result3.attributionSnapshots && result3.attributionSnapshots.length > 0) { - return restoreAttributionStateFromSnapshots(result3.attributionSnapshots); +function computeRestoredAttributionState(result2) { + if (feature("COMMIT_ATTRIBUTION") && result2.attributionSnapshots && result2.attributionSnapshots.length > 0) { + return restoreAttributionStateFromSnapshots(result2.attributionSnapshots); } return; } @@ -745409,47 +667975,47 @@ function exitRestoredWorktree() { setCwd(current.originalCwd); setOriginalCwd(getCwd()); } -async function processResumedConversation(result3, opts, context2) { +async function processResumedConversation(result2, opts, context2) { let modeWarning; if (feature("COORDINATOR_MODE")) { - modeWarning = context2.modeApi?.matchSessionMode(result3.mode); + modeWarning = context2.modeApi?.matchSessionMode(result2.mode); if (modeWarning) { - result3.messages.push(createSystemMessage(modeWarning, "warning")); + result2.messages.push(createSystemMessage(modeWarning, "warning")); } } if (!opts.forkSession) { - const sid = opts.sessionIdOverride ?? result3.sessionId; + const sid = opts.sessionIdOverride ?? result2.sessionId; if (sid) { - switchSession(asSessionId(sid), opts.transcriptPath ? dirname69(opts.transcriptPath) : null); + switchSession(asSessionId(sid), opts.transcriptPath ? dirname65(opts.transcriptPath) : null); await renameRecordingForSession(); await resetSessionFilePointer(); restoreCostStateForSession(sid); } - } else if (result3.contentReplacements?.length) { - await recordContentReplacement(result3.contentReplacements); + } else if (result2.contentReplacements?.length) { + await recordContentReplacement(result2.contentReplacements); } - restoreSessionMetadata(opts.forkSession ? { ...result3, worktreeSession: undefined } : result3); + restoreSessionMetadata(opts.forkSession ? { ...result2, worktreeSession: undefined } : result2); if (!opts.forkSession) { - restoreWorktreeForResume(result3.worktreeSession); + restoreWorktreeForResume(result2.worktreeSession); adoptResumedSessionFile(); } if (feature("CONTEXT_COLLAPSE")) { - (init_persist(), __toCommonJS(exports_persist)).restoreFromEntries(result3.contextCollapseCommits ?? [], result3.contextCollapseSnapshot); + (init_persist(), __toCommonJS(exports_persist)).restoreFromEntries(result2.contextCollapseCommits ?? [], result2.contextCollapseSnapshot); } - const { agentDefinition: restoredAgent, agentType: resumedAgentType } = restoreAgentFromSession(result3.agentSetting, context2.mainThreadAgentDefinition, context2.agentDefinitions); + const { agentDefinition: restoredAgent, agentType: resumedAgentType } = restoreAgentFromSession(result2.agentSetting, context2.mainThreadAgentDefinition, context2.agentDefinitions); if (feature("COORDINATOR_MODE")) { saveMode(context2.modeApi?.isCoordinatorMode() ? "coordinator" : "normal"); } - const restoredAttribution = opts.includeAttribution ? computeRestoredAttributionState(result3) : undefined; - const standaloneAgentContext = computeStandaloneAgentContext(result3.agentName, result3.agentColor); - updateSessionName(result3.agentName); + const restoredAttribution = opts.includeAttribution ? computeRestoredAttributionState(result2) : undefined; + const standaloneAgentContext = computeStandaloneAgentContext(result2.agentName, result2.agentColor); + updateSessionName(result2.agentName); const refreshedAgentDefs = await refreshAgentDefinitionsForModeSwitch(!!modeWarning, context2.currentCwd, context2.cliAgents, context2.agentDefinitions); return { - messages: result3.messages, - fileHistorySnapshots: result3.fileHistorySnapshots, - contentReplacements: result3.contentReplacements, - agentName: result3.agentName, - agentColor: result3.agentColor === "default" ? undefined : result3.agentColor, + messages: result2.messages, + fileHistorySnapshots: result2.fileHistorySnapshots, + contentReplacements: result2.contentReplacements, + agentName: result2.agentName, + agentColor: result2.agentColor === "default" ? undefined : result2.agentColor, restoredAgentDef: restoredAgent, initialState: { ...context2.initialState, @@ -745474,13 +668040,13 @@ var init_sessionRestore = __esm(() => { init_cwd2(); init_debug(); init_fileHistory(); - init_messages5(); + init_messages3(); init_model(); init_plans(); init_Shell(); init_sessionStorage(); init_tasks(); - init_types10(); + init_types8(); init_worktree(); }); @@ -745858,8 +668424,8 @@ function useInboxPoller({ const backend = getBackendByType(parsed.backendType); const success2 = await backend?.killPane(parsed.paneId, !insideTmux); logForDebugging(`[InboxPoller] Killed pane ${parsed.paneId} for ${parsed.from}: ${success2}`); - } catch (error46) { - logForDebugging(`[InboxPoller] Failed to kill pane for ${parsed.from}: ${error46}`); + } catch (error42) { + logForDebugging(`[InboxPoller] Failed to kill pane for ${parsed.from}: ${error42}`); } })(); } @@ -746056,7 +668622,7 @@ var init_useInboxPoller = __esm(() => { init_tools2(); init_debug(); init_inProcessTeammateHelpers(); - init_messages5(); + init_messages3(); init_PermissionMode(); init_PermissionUpdate(); init_slowOperations(); @@ -746605,7 +669171,7 @@ function EffortOptionLabel(t0) { const $2 = import_compiler_runtime350.c(5); const { level, - text: text2 + text } = t0; let t1; if ($2[0] !== level) { @@ -746618,16 +669184,16 @@ function EffortOptionLabel(t0) { t1 = $2[1]; } let t2; - if ($2[2] !== t1 || $2[3] !== text2) { + if ($2[2] !== t1 || $2[3] !== text) { t2 = /* @__PURE__ */ jsx_dev_runtime454.jsxDEV(jsx_dev_runtime454.Fragment, { children: [ t1, " ", - text2 + text ] }, undefined, true, undefined, this); $2[2] = t1; - $2[3] = text2; + $2[3] = text; $2[4] = t2; } else { t2 = $2[4]; @@ -746639,15 +669205,15 @@ function shouldShowEffortCallout(model) { if (!parsed.toLowerCase().includes("opus-4-6")) { return false; } - const config6 = getGlobalConfig(); - if (config6.effortCalloutV2Dismissed) + const config4 = getGlobalConfig(); + if (config4.effortCalloutV2Dismissed) return false; - if (config6.numStartups <= 1) { + if (config4.numStartups <= 1) { markV2Dismissed(); return false; } if (isProSubscriber()) { - if (config6.effortCalloutDismissed) { + if (config4.effortCalloutDismissed) { markV2Dismissed(); return false; } @@ -746674,7 +669240,7 @@ var init_EffortCallout = __esm(() => { import_compiler_runtime350 = __toESM(require_compiler_runtime(), 1); import_react295 = __toESM(require_react(), 1); init_ink2(); - init_auth2(); + init_auth(); init_config2(); init_effort(); init_model(); @@ -746701,7 +669267,7 @@ var init_useDynamicConfig = __esm(() => { }); // src/components/FeedbackSurvey/submitTranscriptShare.ts -import { readFile as readFile60, stat as stat52 } from "fs/promises"; +import { readFile as readFile59, stat as stat51 } from "fs/promises"; async function submitTranscriptShare(messages, trigger, appearanceId) { try { logForDebugging("Collecting transcript for sharing", { level: "info" }); @@ -746711,11 +669277,11 @@ async function submitTranscriptShare(messages, trigger, appearanceId) { let rawTranscriptJsonl; try { const transcriptPath = getTranscriptPath(); - const { size: size3 } = await stat52(transcriptPath); - if (size3 <= MAX_TRANSCRIPT_READ_BYTES) { - rawTranscriptJsonl = await readFile60(transcriptPath, "utf-8"); + const { size: size2 } = await stat51(transcriptPath); + if (size2 <= MAX_TRANSCRIPT_READ_BYTES) { + rawTranscriptJsonl = await readFile59(transcriptPath, "utf-8"); } else { - logForDebugging(`Skipping raw transcript read: file too large (${size3} bytes)`, { level: "warn" }); + logForDebugging(`Skipping raw transcript read: file too large (${size2} bytes)`, { level: "warn" }); } } catch {} const data = { @@ -746728,7 +669294,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) { }; const content = redactSensitiveInfo(jsonStringify(data)); await checkAndRefreshOAuthTokenIfNeeded(); - const authResult = getAuthHeaders2(); + const authResult = getAuthHeaders(); if (authResult.error) { return { success: false }; } @@ -746742,16 +669308,16 @@ async function submitTranscriptShare(messages, trigger, appearanceId) { timeout: 30000 }); if (response.status === 200 || response.status === 201) { - const result3 = response.data; + const result2 = response.data; logForDebugging("Transcript shared successfully", { level: "info" }); return { success: true, - transcriptId: result3?.transcript_id + transcriptId: result2?.transcript_id }; } return { success: false }; - } catch (err3) { - logForDebugging(errorMessage(err3), { + } catch (err2) { + logForDebugging(errorMessage(err2), { level: "error" }); return { success: false }; @@ -746759,11 +669325,11 @@ async function submitTranscriptShare(messages, trigger, appearanceId) { } var init_submitTranscriptShare = __esm(() => { init_axios2(); - init_auth2(); + init_auth(); init_debug(); init_errors(); init_http2(); - init_messages5(); + init_messages3(); init_sessionStorage(); init_slowOperations(); init_Feedback(); @@ -746863,7 +669429,7 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi timeLastShown: null, submitCountAtLastAppearance: null })); - const config6 = useDynamicConfig("tengu_feedback_survey_config", DEFAULT_FEEDBACK_SURVEY_CONFIG); + const config4 = useDynamicConfig("tengu_feedback_survey_config", DEFAULT_FEEDBACK_SURVEY_CONFIG); const badTranscriptAskConfig = useDynamicConfig("tengu_bad_survey_transcript_ask_config", DEFAULT_TRANSCRIPT_ASK_CONFIG); const goodTranscriptAskConfig = useDynamicConfig("tengu_good_survey_transcript_ask_config", DEFAULT_TRANSCRIPT_ASK_CONFIG); const settingsRate = getInitialSettings().feedbackSurveyRate; @@ -746968,13 +669534,13 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi })); } if (selected_1 === "yes") { - const result3 = await submitTranscriptShare(messagesRef.current, trigger_0, appearanceId_2); + const result2 = await submitTranscriptShare(messagesRef.current, trigger_0, appearanceId_2); logEvent("tengu_feedback_survey_event", { - event_type: result3.success ? "transcript_share_submitted" : "transcript_share_failed", + event_type: result2.success ? "transcript_share_submitted" : "transcript_share_failed", appearance_id: appearanceId_2, trigger: trigger_0 }); - return result3.success; + return result2.success; } return false; }, [surveyType]); @@ -746985,7 +669551,7 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi handleSelect, handleTranscriptSelect } = useSurveyState({ - hideThanksAfterMs: config6.hideThanksAfterMs, + hideThanksAfterMs: config4.hideThanksAfterMs, onOpen, onSelect, shouldShowTranscriptPrompt, @@ -746994,14 +669560,14 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi }); const currentModel = getMainLoopModel(); const isModelAllowed2 = import_react298.useMemo(() => { - if (config6.onForModels.length === 0) { + if (config4.onForModels.length === 0) { return false; } - if (config6.onForModels.includes("*")) { + if (config4.onForModels.includes("*")) { return true; } - return config6.onForModels.includes(currentModel); - }, [config6.onForModels, currentModel]); + return config4.onForModels.includes(currentModel); + }, [config4.onForModels, currentModel]); const shouldOpen = import_react298.useMemo(() => { if (state2 !== "closed") { return false; @@ -747029,24 +669595,24 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi } if (feedbackSurvey.timeLastShown) { const timeSinceLastShown = Date.now() - feedbackSurvey.timeLastShown; - if (timeSinceLastShown < config6.minTimeBetweenFeedbackMs) { + if (timeSinceLastShown < config4.minTimeBetweenFeedbackMs) { return false; } - if (feedbackSurvey.submitCountAtLastAppearance !== null && submitCount < feedbackSurvey.submitCountAtLastAppearance + config6.minUserTurnsBetweenFeedback) { + if (feedbackSurvey.submitCountAtLastAppearance !== null && submitCount < feedbackSurvey.submitCountAtLastAppearance + config4.minUserTurnsBetweenFeedback) { return false; } } else { const timeSinceSessionStart = Date.now() - sessionStartTime.current; - if (timeSinceSessionStart < config6.minTimeBeforeFeedbackMs) { + if (timeSinceSessionStart < config4.minTimeBeforeFeedbackMs) { return false; } - if (submitCount < submitCountAtSessionStart.current + config6.minUserTurnsBeforeFeedback) { + if (submitCount < submitCountAtSessionStart.current + config4.minUserTurnsBeforeFeedback) { return false; } } if (lastEligibleSubmitCountRef.current !== submitCount) { lastEligibleSubmitCountRef.current = submitCount; - probabilityPassedRef.current = Math.random() <= (settingsRate ?? config6.probability); + probabilityPassedRef.current = Math.random() <= (settingsRate ?? config4.probability); } if (!probabilityPassedRef.current) { return false; @@ -747054,12 +669620,12 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi const globalFeedbackState = getGlobalConfig().feedbackSurveyState; if (globalFeedbackState?.lastShownTime) { const timeSinceGlobalLastShown = Date.now() - globalFeedbackState.lastShownTime; - if (timeSinceGlobalLastShown < config6.minTimeBetweenGlobalFeedbackMs) { + if (timeSinceGlobalLastShown < config4.minTimeBetweenGlobalFeedbackMs) { return false; } } return true; - }, [state2, isLoading, hasActivePrompt, isModelAllowed2, feedbackSurvey.timeLastShown, feedbackSurvey.submitCountAtLastAppearance, submitCount, config6.minTimeBetweenFeedbackMs, config6.minTimeBetweenGlobalFeedbackMs, config6.minUserTurnsBetweenFeedback, config6.minTimeBeforeFeedbackMs, config6.minUserTurnsBeforeFeedback, config6.probability, settingsRate]); + }, [state2, isLoading, hasActivePrompt, isModelAllowed2, feedbackSurvey.timeLastShown, feedbackSurvey.submitCountAtLastAppearance, submitCount, config4.minTimeBetweenFeedbackMs, config4.minTimeBetweenGlobalFeedbackMs, config4.minUserTurnsBetweenFeedback, config4.minTimeBeforeFeedbackMs, config4.minUserTurnsBeforeFeedback, config4.probability, settingsRate]); import_react298.useEffect(() => { if (shouldOpen) { open17(); @@ -747081,7 +669647,7 @@ var init_useFeedbackSurvey = __esm(() => { init_policyLimits(); init_config2(); init_envUtils(); - init_messages5(); + init_messages3(); init_model(); init_settings2(); init_events(); @@ -747116,8 +669682,8 @@ function hasMemoryFileRead(messages) { if (block2.type !== "tool_use" || block2.name !== FILE_READ_TOOL_NAME) { continue; } - const input11 = block2.input; - if (typeof input11.file_path === "string" && isAutoManagedMemoryFile(input11.file_path)) { + const input = block2.input; + if (typeof input.file_path === "string" && isAutoManagedMemoryFile(input.file_path)) { return true; } } @@ -747195,13 +669761,13 @@ function useMemorySurvey(messages, isLoading, hasActivePrompt = false, { })); } if (selected_1 === "yes") { - const result3 = await submitTranscriptShare(messagesRef.current, TRANSCRIPT_SHARE_TRIGGER, appearanceId_2); + const result2 = await submitTranscriptShare(messagesRef.current, TRANSCRIPT_SHARE_TRIGGER, appearanceId_2); logEvent(MEMORY_SURVEY_EVENT, { - event_type: result3.success ? "transcript_share_submitted" : "transcript_share_failed", + event_type: result2.success ? "transcript_share_submitted" : "transcript_share_failed", appearance_id: appearanceId_2, trigger: TRANSCRIPT_SHARE_TRIGGER }); - return result3.success; + return result2.success; } return false; }, []); @@ -747249,8 +669815,8 @@ function useMemorySurvey(messages, isLoading, hasActivePrompt = false, { if (!lastAssistant || seenAssistantUuids.current.has(lastAssistant.uuid)) { return; } - const text2 = extractTextContent(lastAssistant.message.content, " "); - if (!MEMORY_WORD_RE.test(text2)) { + const text = extractTextContent(lastAssistant.message.content, " "); + if (!MEMORY_WORD_RE.test(text)) { return; } seenAssistantUuids.current.add(lastAssistant.uuid); @@ -747283,7 +669849,7 @@ var init_useMemorySurvey = __esm(() => { init_config2(); init_envUtils(); init_memoryFileDetection(); - init_messages5(); + init_messages3(); init_events(); init_submitTranscriptShare(); init_useSurveyState(); @@ -747296,8 +669862,8 @@ function hasMessageAfterBoundary(messages, boundaryUuid) { if (boundaryIndex === -1) { return false; } - for (let i4 = boundaryIndex + 1;i4 < messages.length; i4++) { - const msg = messages[i4]; + for (let i3 = boundaryIndex + 1;i3 < messages.length; i3++) { + const msg = messages[i3]; if (msg && (msg.type === "user" || msg.type === "assistant")) { return true; } @@ -747406,7 +669972,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) { return; } } - const newBoundaries = Array.from(currentCompactBoundaries).filter((uuid8) => !seenCompactBoundaries.current.has(uuid8)); + const newBoundaries = Array.from(currentCompactBoundaries).filter((uuid5) => !seenCompactBoundaries.current.has(uuid5)); if (newBoundaries.length > 0) { seenCompactBoundaries.current = new Set(currentCompactBoundaries); pendingCompactBoundaryUuid.current = newBoundaries[newBoundaries.length - 1]; @@ -747487,7 +670053,7 @@ var init_usePostCompactSurvey = __esm(() => { init_analytics(); init_sessionMemoryCompact(); init_envUtils(); - init_messages5(); + init_messages3(); init_events(); init_useSurveyState(); }); @@ -747628,7 +670194,7 @@ function TranscriptSharePrompt(t0) { } return t7; } -var import_compiler_runtime352, jsx_dev_runtime455, RESPONSE_INPUTS2, inputToResponse2, isValidResponseInput2 = (input11) => RESPONSE_INPUTS2.includes(input11); +var import_compiler_runtime352, jsx_dev_runtime455, RESPONSE_INPUTS2, inputToResponse2, isValidResponseInput2 = (input) => RESPONSE_INPUTS2.includes(input); var init_TranscriptSharePrompt = __esm(() => { import_compiler_runtime352 = __toESM(require_compiler_runtime(), 1); init_figures2(); @@ -747876,10 +670442,10 @@ function useStartupNotification(compute) { if (getIsRemoteMode() || hasRunRef.current) return; hasRunRef.current = true; - Promise.resolve().then(() => computeRef.current()).then((result3) => { - if (!result3) + Promise.resolve().then(() => computeRef.current()).then((result2) => { + if (!result2) return; - for (const n3 of Array.isArray(result3) ? result3 : [result3]) { + for (const n3 of Array.isArray(result2) ? result2 : [result2]) { addNotification(n3); } }).catch(logError2); @@ -747961,11 +670527,11 @@ async function generateAwaySummary(messages, signal) { return null; } return getAssistantMessageText(response); - } catch (err3) { - if (err3 instanceof APIUserAbortError || signal.aborted) { + } catch (err2) { + if (err2 instanceof APIUserAbortError || signal.aborted) { return null; } - logForDebugging(`[awaySummary] generation failed: ${err3}`); + logForDebugging(`[awaySummary] generation failed: ${err2}`); return null; } } @@ -747974,7 +670540,7 @@ var init_awaySummary = __esm(() => { init_sdk(); init_Tool(); init_debug(); - init_messages5(); + init_messages3(); init_model(); init_claude(); init_sessionMemoryUtils(); @@ -747982,8 +670548,8 @@ var init_awaySummary = __esm(() => { // src/hooks/useAwaySummary.ts function hasSummarySinceLastUserTurn(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const m = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const m = messages[i3]; if (m.type === "user" && !m.isMeta && !m.isCompactSummary) return false; if (m.type === "system" && m.subtype === "away_summary") @@ -748016,17 +670582,17 @@ function useAwaySummary(messages, setMessages, isLoading) { abortRef.current?.abort(); abortRef.current = null; } - async function generate3() { + async function generate2() { pendingRef.current = false; if (hasSummarySinceLastUserTurn(messagesRef.current)) return; abortInFlight(); const controller = new AbortController; abortRef.current = controller; - const text2 = await generateAwaySummary(messagesRef.current, controller.signal); - if (controller.signal.aborted || text2 === null) + const text = await generateAwaySummary(messagesRef.current, controller.signal); + if (controller.signal.aborted || text === null) return; - setMessages((prev) => [...prev, createAwaySummaryMessage(text2)]); + setMessages((prev) => [...prev, createAwaySummaryMessage(text)]); } function onBlurTimerFire() { timerRef.current = null; @@ -748034,7 +670600,7 @@ function useAwaySummary(messages, setMessages, isLoading) { pendingRef.current = true; return; } - generate3(); + generate2(); } function onFocusChange() { const state2 = getTerminalFocusState(); @@ -748049,7 +670615,7 @@ function useAwaySummary(messages, setMessages, isLoading) { } const unsubscribe2 = subscribeTerminalFocus(onFocusChange); onFocusChange(); - generateRef.current = generate3; + generateRef.current = generate2; return () => { unsubscribe2(); clearTimer(); @@ -748074,7 +670640,7 @@ var init_useAwaySummary = __esm(() => { init_terminal_focus_state(); init_growthbook(); init_awaySummary(); - init_messages5(); + init_messages3(); BLUR_DELAY_MS = 5 * 60000; }); @@ -748131,7 +670697,7 @@ async function _temp296() { var jsx_dev_runtime457; var init_useChromeExtensionNotification = __esm(() => { init_ink2(); - init_auth2(); + init_auth(); init_setup2(); init_envUtils(); init_useStartupNotification(); @@ -748139,40 +670705,40 @@ var init_useChromeExtensionNotification = __esm(() => { }); // src/utils/plugins/officialMarketplaceStartupCheck.ts -import { join as join169 } from "path"; +import { join as join159 } from "path"; function isOfficialMarketplaceAutoInstallDisabled() { return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL); } function calculateNextRetryDelay(retryCount) { - const delay3 = RETRY_CONFIG.INITIAL_DELAY_MS * Math.pow(RETRY_CONFIG.BACKOFF_MULTIPLIER, retryCount); - return Math.min(delay3, RETRY_CONFIG.MAX_DELAY_MS); + const delay2 = RETRY_CONFIG.INITIAL_DELAY_MS * Math.pow(RETRY_CONFIG.BACKOFF_MULTIPLIER, retryCount); + return Math.min(delay2, RETRY_CONFIG.MAX_DELAY_MS); } -function shouldRetryInstallation(config6) { - if (!config6.officialMarketplaceAutoInstallAttempted) { +function shouldRetryInstallation(config4) { + if (!config4.officialMarketplaceAutoInstallAttempted) { return true; } - if (config6.officialMarketplaceAutoInstalled) { + if (config4.officialMarketplaceAutoInstalled) { return false; } - const failReason = config6.officialMarketplaceAutoInstallFailReason; - const retryCount = config6.officialMarketplaceAutoInstallRetryCount || 0; - const nextRetryTime = config6.officialMarketplaceAutoInstallNextRetryTime; - const now3 = Date.now(); + const failReason = config4.officialMarketplaceAutoInstallFailReason; + const retryCount = config4.officialMarketplaceAutoInstallRetryCount || 0; + const nextRetryTime = config4.officialMarketplaceAutoInstallNextRetryTime; + const now2 = Date.now(); if (retryCount >= RETRY_CONFIG.MAX_ATTEMPTS) { return false; } if (failReason === "policy_blocked") { return false; } - if (nextRetryTime && now3 < nextRetryTime) { + if (nextRetryTime && now2 < nextRetryTime) { return false; } return failReason === "unknown" || failReason === "git_unavailable" || failReason === "gcs_unavailable" || failReason === undefined; } async function checkAndInstallOfficialMarketplace() { - const config6 = getGlobalConfig(); - if (!shouldRetryInstallation(config6)) { - const reason = config6.officialMarketplaceAutoInstallFailReason ?? "already_attempted"; + const config4 = getGlobalConfig(); + if (!shouldRetryInstallation(config4)) { + const reason = config4.officialMarketplaceAutoInstallFailReason ?? "already_attempted"; logForDebugging(`Official marketplace auto-install skipped: ${reason}`); return { installed: false, @@ -748222,7 +670788,7 @@ async function checkAndInstallOfficialMarketplace() { return { installed: false, skipped: true, reason: "policy_blocked" }; } const cacheDir = getMarketplacesCacheDir(); - const installLocation = join169(cacheDir, OFFICIAL_MARKETPLACE_NAME); + const installLocation = join159(cacheDir, OFFICIAL_MARKETPLACE_NAME); const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir); if (gcsSha !== null) { const known = await loadKnownMarketplacesConfig(); @@ -748250,16 +670816,16 @@ async function checkAndInstallOfficialMarketplace() { } if (!getFeatureValue_CACHED_MAY_BE_STALE("tengu_plugin_official_mkt_git_fallback", true)) { logForDebugging("Official marketplace GCS failed; git fallback disabled by flag — skipping install"); - const retryCount = (config6.officialMarketplaceAutoInstallRetryCount || 0) + 1; - const now3 = Date.now(); - const nextRetryTime = now3 + calculateNextRetryDelay(retryCount); + const retryCount = (config4.officialMarketplaceAutoInstallRetryCount || 0) + 1; + const now2 = Date.now(); + const nextRetryTime = now2 + calculateNextRetryDelay(retryCount); saveGlobalConfig((current) => ({ ...current, officialMarketplaceAutoInstallAttempted: true, officialMarketplaceAutoInstalled: false, officialMarketplaceAutoInstallFailReason: "gcs_unavailable", officialMarketplaceAutoInstallRetryCount: retryCount, - officialMarketplaceAutoInstallLastAttemptTime: now3, + officialMarketplaceAutoInstallLastAttemptTime: now2, officialMarketplaceAutoInstallNextRetryTime: nextRetryTime })); logEvent("tengu_official_marketplace_auto_install", { @@ -748273,10 +670839,10 @@ async function checkAndInstallOfficialMarketplace() { const gitAvailable = await checkGitAvailable(); if (!gitAvailable) { logForDebugging("Git not available, skipping official marketplace auto-install"); - const retryCount = (config6.officialMarketplaceAutoInstallRetryCount || 0) + 1; - const now3 = Date.now(); + const retryCount = (config4.officialMarketplaceAutoInstallRetryCount || 0) + 1; + const now2 = Date.now(); const nextRetryDelay = calculateNextRetryDelay(retryCount); - const nextRetryTime = now3 + nextRetryDelay; + const nextRetryTime = now2 + nextRetryDelay; let configSaveFailed = false; try { saveGlobalConfig((current) => ({ @@ -748285,7 +670851,7 @@ async function checkAndInstallOfficialMarketplace() { officialMarketplaceAutoInstalled: false, officialMarketplaceAutoInstallFailReason: "git_unavailable", officialMarketplaceAutoInstallRetryCount: retryCount, - officialMarketplaceAutoInstallLastAttemptTime: now3, + officialMarketplaceAutoInstallLastAttemptTime: now2, officialMarketplaceAutoInstallNextRetryTime: nextRetryTime })); } catch (saveError) { @@ -748310,7 +670876,7 @@ async function checkAndInstallOfficialMarketplace() { logForDebugging("Attempting to auto-install official marketplace"); await addMarketplaceSource(OFFICIAL_MARKETPLACE_SOURCE); logForDebugging("Successfully auto-installed official marketplace"); - const previousRetryCount = config6.officialMarketplaceAutoInstallRetryCount || 0; + const previousRetryCount = config4.officialMarketplaceAutoInstallRetryCount || 0; saveGlobalConfig((current) => ({ ...current, officialMarketplaceAutoInstallAttempted: true, @@ -748326,8 +670892,8 @@ async function checkAndInstallOfficialMarketplace() { retry_count: previousRetryCount }); return { installed: true, skipped: false }; - } catch (error46) { - const errorMessage3 = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + const errorMessage3 = error42 instanceof Error ? error42.message : String(error42); if (errorMessage3.includes("xcrun: error:")) { markGitUnavailable(); logForDebugging("Official marketplace auto-install: git is a non-functional macOS xcrun shim, treating as git_unavailable"); @@ -748344,11 +670910,11 @@ async function checkAndInstallOfficialMarketplace() { }; } logForDebugging(`Failed to auto-install official marketplace: ${errorMessage3}`, { level: "error" }); - logError2(toError(error46)); - const retryCount = (config6.officialMarketplaceAutoInstallRetryCount || 0) + 1; - const now3 = Date.now(); + logError2(toError(error42)); + const retryCount = (config4.officialMarketplaceAutoInstallRetryCount || 0) + 1; + const now2 = Date.now(); const nextRetryDelay = calculateNextRetryDelay(retryCount); - const nextRetryTime = now3 + nextRetryDelay; + const nextRetryTime = now2 + nextRetryDelay; let configSaveFailed = false; try { saveGlobalConfig((current) => ({ @@ -748357,7 +670923,7 @@ async function checkAndInstallOfficialMarketplace() { officialMarketplaceAutoInstalled: false, officialMarketplaceAutoInstallFailReason: "unknown", officialMarketplaceAutoInstallRetryCount: retryCount, - officialMarketplaceAutoInstallLastAttemptTime: now3, + officialMarketplaceAutoInstallLastAttemptTime: now2, officialMarketplaceAutoInstallNextRetryTime: nextRetryTime })); } catch (saveError) { @@ -748407,9 +670973,9 @@ function useOfficialMarketplaceNotification() { useStartupNotification(_temp297); } async function _temp297() { - const result3 = await checkAndInstallOfficialMarketplace(); + const result2 = await checkAndInstallOfficialMarketplace(); const notifs = []; - if (result3.configSaveFailed) { + if (result2.configSaveFailed) { logForDebugging("Showing marketplace config save failure notification"); notifs.push({ key: "marketplace-config-save-failed", @@ -748421,7 +670987,7 @@ async function _temp297() { timeoutMs: 1e4 }); } - if (result3.installed) { + if (result2.installed) { logForDebugging("Showing marketplace installation success notification"); notifs.push({ key: "marketplace-installed", @@ -748433,7 +670999,7 @@ async function _temp297() { timeoutMs: 7000 }); } else { - if (result3.skipped && result3.reason === "unknown") { + if (result2.skipped && result2.reason === "unknown") { logForDebugging("Showing marketplace installation failure notification"); notifs.push({ key: "marketplace-install-failed", @@ -748496,14 +671062,14 @@ function usePromptsFromClaudeInChrome(mcpClients, toolPermissionMode) { } function _temp298() {} function findChromeClient(clients) { - return clients.find((client5) => client5.type === "connected" && client5.name === CLAUDE_IN_CHROME_MCP_SERVER_NAME); + return clients.find((client2) => client2.type === "connected" && client2.name === CLAUDE_IN_CHROME_MCP_SERVER_NAME); } var import_compiler_runtime354, import_react303, ClaudeInChromePromptNotificationSchema; var init_usePromptsFromClaudeInChrome = __esm(() => { import_compiler_runtime354 = __toESM(require_compiler_runtime(), 1); import_react303 = __toESM(require_react(), 1); init_v4(); - init_client10(); + init_client6(); init_common3(); ClaudeInChromePromptNotificationSchema = lazySchema(() => exports_external.object({ method: exports_external.literal("notifications/message"), @@ -748530,11 +671096,11 @@ function recordTipShown(tipId) { }); } function getSessionsSinceLastShown(tipId) { - const config6 = getGlobalConfig(); - const lastShown = config6.tipsHistory?.[tipId]; + const config4 = getGlobalConfig(); + const lastShown = config4.tipsHistory?.[tipId]; if (!lastShown) return Infinity; - return config6.numStartups - lastShown; + return config4.numStartups - lastShown; } var init_tipHistory = __esm(() => { init_config2(); @@ -748544,18 +671110,18 @@ var init_tipHistory = __esm(() => { function getDesktopUpsellConfig() { return getDynamicConfig_CACHED_MAY_BE_STALE("tengu_desktop_upsell", DESKTOP_UPSELL_DEFAULT); } -function isSupportedPlatform4() { +function isSupportedPlatform3() { return process.platform === "darwin" || process.platform === "win32" && process.arch === "x64"; } function shouldShowDesktopUpsellStartup() { - if (!isSupportedPlatform4()) + if (!isSupportedPlatform3()) return false; if (!getDesktopUpsellConfig().enable_startup_dialog) return false; - const config6 = getGlobalConfig(); - if (config6.desktopUpsellDismissed) + const config4 = getGlobalConfig(); + if (config4.desktopUpsellDismissed) return false; - if ((config6.desktopUpsellSeenCount ?? 0) >= 3) + if ((config4.desktopUpsellSeenCount ?? 0) >= 3) return false; return true; } @@ -748735,8 +671301,8 @@ async function isOfficialMarketplaceInstalled() { if (_isOfficialMarketplaceInstalledCache !== undefined) { return _isOfficialMarketplaceInstalledCache; } - const config6 = await loadKnownMarketplacesConfigSafe(); - _isOfficialMarketplaceInstalledCache = OFFICIAL_MARKETPLACE_NAME in config6; + const config4 = await loadKnownMarketplacesConfigSafe(); + _isOfficialMarketplaceInstalledCache = OFFICIAL_MARKETPLACE_NAME in config4; return _isOfficialMarketplaceInstalledCache; } async function isMarketplacePluginRelevant(pluginName, context2, signals2) { @@ -748765,8 +671331,8 @@ function getCustomTips() { const override = settings.spinnerTipsOverride; if (!override?.tips?.length) return []; - return override.tips.map((content, i4) => ({ - id: `custom-tip-${i4}`, + return override.tips.map((content, i3) => ({ + id: `custom-tip-${i3}`, content: async () => content, cooldownSessions: 0, isRelevant: async () => true @@ -748796,7 +671362,7 @@ var init_tipRegistry = __esm(() => { init_OverageCreditUpsell(); init_shortcutFormat(); init_prompt10(); - init_auth2(); + init_auth(); init_concurrentSessions(); init_config2(); init_effort(); @@ -748820,8 +671386,8 @@ var init_tipRegistry = __esm(() => { content: async () => `Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits`, cooldownSessions: 3, async isRelevant() { - const config6 = getGlobalConfig(); - return config6.numStartups < 10; + const config4 = getGlobalConfig(); + return config4.numStartups < 10; } }, { @@ -748831,8 +671397,8 @@ var init_tipRegistry = __esm(() => { isRelevant: async () => { if (process.env.USER_TYPE === "ant") return false; - const config6 = getGlobalConfig(); - const daysSinceLastUse = config6.lastPlanModeUse ? (Date.now() - config6.lastPlanModeUse) / (1000 * 60 * 60 * 24) : Infinity; + const config4 = getGlobalConfig(); + const daysSinceLastUse = config4.lastPlanModeUse ? (Date.now() - config4.lastPlanModeUse) / (1000 * 60 * 60 * 24) : Infinity; return daysSinceLastUse > 7; } }, @@ -748842,13 +671408,13 @@ var init_tipRegistry = __esm(() => { cooldownSessions: 10, isRelevant: async () => { try { - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); const settings = getSettings_DEPRECATED(); - const hasUsedPlanMode = Boolean(config6.lastPlanModeUse); + const hasUsedPlanMode = Boolean(config4.lastPlanModeUse); const hasDefaultMode = Boolean(settings?.permissions?.defaultMode); return hasUsedPlanMode && !hasDefaultMode; - } catch (error46) { - logForDebugging(`Failed to check default-permission-mode-config tip relevance: ${error46}`, { level: "warn" }); + } catch (error42) { + logForDebugging(`Failed to check default-permission-mode-config tip relevance: ${error42}`, { level: "warn" }); return false; } } @@ -748859,9 +671425,9 @@ var init_tipRegistry = __esm(() => { cooldownSessions: 10, isRelevant: async () => { try { - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); const worktreeCount = await getWorktreeCount(); - return worktreeCount <= 1 && config6.numStartups > 50; + return worktreeCount <= 1 && config4.numStartups > 50; } catch (_) { return false; } @@ -748883,11 +671449,11 @@ var init_tipRegistry = __esm(() => { content: async () => env3.terminal === "Apple_Terminal" ? "Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more" : "Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more", cooldownSessions: 10, async isRelevant() { - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); if (env3.terminal === "Apple_Terminal") { - return !config6.optionAsMetaKeyInstalled; + return !config4.optionAsMetaKeyInstalled; } - return !config6.shiftEnterKeyBindingInstalled; + return !config4.shiftEnterKeyBindingInstalled; } }, { @@ -748895,8 +671461,8 @@ var init_tipRegistry = __esm(() => { content: async () => env3.terminal === "Apple_Terminal" ? "Press Option+Enter to send a multi-line message" : "Press Shift+Enter to send a multi-line message", cooldownSessions: 10, async isRelevant() { - const config6 = getGlobalConfig(); - return Boolean((env3.terminal === "Apple_Terminal" ? config6.optionAsMetaKeyInstalled : config6.shiftEnterKeyBindingInstalled) && config6.numStartups > 3); + const config4 = getGlobalConfig(); + return Boolean((env3.terminal === "Apple_Terminal" ? config4.optionAsMetaKeyInstalled : config4.shiftEnterKeyBindingInstalled) && config4.numStartups > 3); } }, { @@ -748907,8 +671473,8 @@ var init_tipRegistry = __esm(() => { if (!shouldOfferTerminalSetup()) { return false; } - const config6 = getGlobalConfig(); - return !(env3.terminal === "Apple_Terminal" ? config6.optionAsMetaKeyInstalled : config6.shiftEnterKeyBindingInstalled); + const config4 = getGlobalConfig(); + return !(env3.terminal === "Apple_Terminal" ? config4.optionAsMetaKeyInstalled : config4.shiftEnterKeyBindingInstalled); } }, { @@ -748916,8 +671482,8 @@ var init_tipRegistry = __esm(() => { content: async () => "Use /memory to view and manage Claude memory", cooldownSessions: 15, async isRelevant() { - const config6 = getGlobalConfig(); - return config6.memoryUsageCount <= 0; + const config4 = getGlobalConfig(); + return config4.memoryUsageCount <= 0; } }, { @@ -748949,8 +671515,8 @@ var init_tipRegistry = __esm(() => { content: async () => "Hit Enter to queue up additional messages while Claude is working.", cooldownSessions: 5, async isRelevant() { - const config6 = getGlobalConfig(); - return config6.promptQueueUseCount <= 3; + const config4 = getGlobalConfig(); + return config4.promptQueueUseCount <= 3; } }, { @@ -749021,8 +671587,8 @@ var init_tipRegistry = __esm(() => { content: async () => "Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools", cooldownSessions: 10, async isRelevant() { - const config6 = getGlobalConfig(); - return config6.numStartups > 10; + const config4 = getGlobalConfig(); + return config4.numStartups > 10; } }, { @@ -749066,8 +671632,8 @@ var init_tipRegistry = __esm(() => { content: async () => "Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project", cooldownSessions: 15, async isRelevant() { - const config6 = getGlobalConfig(); - return config6.numStartups > 10; + const config4 = getGlobalConfig(); + return config4.numStartups > 10; } }, { @@ -749087,8 +671653,8 @@ var init_tipRegistry = __esm(() => { content: async () => "Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer", cooldownSessions: 15, async isRelevant() { - const config6 = getGlobalConfig(); - return config6.numStartups > 5; + const config4 = getGlobalConfig(); + return config4.numStartups > 5; } }, { @@ -749096,8 +671662,8 @@ var init_tipRegistry = __esm(() => { content: async () => "Use --agent to directly start a conversation with a subagent", cooldownSessions: 15, async isRelevant() { - const config6 = getGlobalConfig(); - return config6.numStartups > 5; + const config4 = getGlobalConfig(); + return config4.numStartups > 5; } }, { @@ -749138,10 +671704,10 @@ var init_tipRegistry = __esm(() => { async isRelevant() { if (process.env.USER_TYPE === "ant") return false; - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); const modelSetting = getUserSpecifiedModelSetting(); const hasOpusPlanMode = modelSetting === "opusplan"; - const daysSinceLastUse = config6.lastPlanModeUse ? (Date.now() - config6.lastPlanModeUse) / (1000 * 60 * 60 * 24) : Infinity; + const daysSinceLastUse = config4.lastPlanModeUse ? (Date.now() - config4.lastPlanModeUse) / (1000 * 60 * 60 * 24) : Infinity; return hasOpusPlanMode && daysSinceLastUse > 3; } }, @@ -749234,8 +671800,8 @@ ${blue2(`/plugin install vercel@${OFFICIAL_MARKETPLACE_NAME}`)}`; }, cooldownSessions: 3, isRelevant: async () => { - const config6 = getGlobalConfig(); - if (config6.hasVisitedPasses) { + const config4 = getGlobalConfig(); + if (config4.hasVisitedPasses) { return false; } const { eligible: eligible2 } = checkCachedPassesEligibility(); @@ -749263,8 +671829,8 @@ ${blue2(`/plugin install vercel@${OFFICIAL_MARKETPLACE_NAME}`)}`; if (process.env.USER_TYPE === "ant") { return false; } - const config6 = getGlobalConfig(); - return config6.numStartups > 5; + const config4 = getGlobalConfig(); + return config4.numStartups > 5; } } ]; @@ -749657,14 +672223,14 @@ var init_controlSchemas = __esm(() => { }); // src/utils/permissions/PermissionPromptToolResultSchema.ts -function permissionPromptToolResultToPermissionDecision(result3, tool, input11, toolUseContext) { +function permissionPromptToolResultToPermissionDecision(result2, tool, input, toolUseContext) { const decisionReason = { type: "permissionPromptTool", permissionPromptToolName: tool.name, - toolResult: result3 + toolResult: result2 }; - if (result3.behavior === "allow") { - const updatedPermissions = result3.updatedPermissions; + if (result2.behavior === "allow") { + const updatedPermissions = result2.updatedPermissions; if (updatedPermissions) { toolUseContext.setAppState((prev) => ({ ...prev, @@ -749672,18 +672238,18 @@ function permissionPromptToolResultToPermissionDecision(result3, tool, input11, })); persistPermissionUpdates(updatedPermissions); } - const updatedInput = Object.keys(result3.updatedInput).length > 0 ? result3.updatedInput : input11; + const updatedInput = Object.keys(result2.updatedInput).length > 0 ? result2.updatedInput : input; return { - ...result3, + ...result2, updatedInput, decisionReason }; - } else if (result3.behavior === "deny" && result3.interrupt) { - logForDebugging(`SDK permission prompt deny+interrupt: tool=${tool.name} message=${result3.message}`); + } else if (result2.behavior === "deny" && result2.interrupt) { + logForDebugging(`SDK permission prompt deny+interrupt: tool=${tool.name} message=${result2.message}`); toolUseContext.abortController.abort(); } return { - ...result3, + ...result2, decisionReason }; } @@ -749756,10 +672322,10 @@ function serializeDecisionReason(reason) { return reason.reason; } } -function buildRequiresActionDetails(tool, input11, toolUseID, requestId) { +function buildRequiresActionDetails(tool, input, toolUseID, requestId) { let description; try { - description = tool.getActivityDescription?.(input11) ?? tool.getToolUseSummary?.(input11) ?? tool.userFacingName(input11); + description = tool.getActivityDescription?.(input) ?? tool.getToolUseSummary?.(input) ?? tool.userFacingName(input); } catch { description = tool.name; } @@ -749768,7 +672334,7 @@ function buildRequiresActionDetails(tool, input11, toolUseID, requestId) { action_description: description, tool_use_id: toolUseID, request_id: requestId, - input: input11 + input }; } @@ -749784,11 +672350,11 @@ class StructuredIO { prependedLines = []; onControlRequestSent; onControlRequestResolved; - outbound = new Stream5; - constructor(input11, replayUserMessages) { - this.input = input11; + outbound = new Stream3; + constructor(input, replayUserMessages) { + this.input = input; this.replayUserMessages = replayUserMessages; - this.input = input11; + this.input = input; this.structuredInput = this.read(); } trackResolvedToolUseId(request) { @@ -749878,12 +672444,12 @@ class StructuredIO { if (response.response.subtype === "error") { request.reject(new Error(response.response.error)); } else { - const result3 = response.response.response; + const result2 = response.response.response; if (request.schema) { try { - request.resolve(request.schema.parse(result3)); - } catch (error46) { - request.reject(error46); + request.resolve(request.schema.parse(result2)); + } catch (error42) { + request.reject(error42); } } else { request.resolve({}); @@ -749906,17 +672472,17 @@ class StructuredIO { return; } if (message.type === "update_environment_variables") { - const keys3 = Object.keys(message.variables); + const keys2 = Object.keys(message.variables); for (const [key, value] of Object.entries(message.variables)) { process.env[key] = value; } - logForDebugging(`[structuredIO] applied update_environment_variables: ${keys3.join(", ")}`); + logForDebugging(`[structuredIO] applied update_environment_variables: ${keys2.join(", ")}`); return; } if (message.type === "control_response") { - const uuid8 = "uuid" in message && typeof message.uuid === "string" ? message.uuid : undefined; - if (uuid8) { - notifyCommandLifecycle(uuid8, "completed"); + const uuid5 = "uuid" in message && typeof message.uuid === "string" ? message.uuid : undefined; + if (uuid5) { + notifyCommandLifecycle(uuid5, "completed"); } const request = this.pendingRequests.get(message.response.request_id); if (!request) { @@ -749940,12 +672506,12 @@ class StructuredIO { request.reject(new Error(message.response.error)); return; } - const result3 = message.response.response; + const result2 = message.response.response; if (request.schema) { try { - request.resolve(request.schema.parse(result3)); - } catch (error46) { - request.reject(error46); + request.resolve(request.schema.parse(result2)); + } catch (error42) { + request.reject(error42); } } else { request.resolve({}); @@ -749974,8 +672540,8 @@ class StructuredIO { exitWithMessage(`Error: Expected message role 'user', got '${message.message.role}'`); } return message; - } catch (error46) { - console.error(`Error parsing streaming input line: ${line}: ${error46}`); + } catch (error42) { + console.error(`Error parsing streaming input line: ${line}: ${error42}`); process.exit(1); } } @@ -750016,17 +672582,17 @@ class StructuredIO { }); } try { - return await new Promise((resolve48, reject3) => { + return await new Promise((resolve42, reject2) => { this.pendingRequests.set(requestId, { request: { type: "control_request", request_id: requestId, request }, - resolve: (result3) => { - resolve48(result3); + resolve: (result2) => { + resolve42(result2); }, - reject: reject3, + reject: reject2, schema }); }); @@ -750038,8 +672604,8 @@ class StructuredIO { } } createCanUseTool(onPermissionPrompt) { - return async (tool, input11, toolUseContext, assistantMessage, toolUseID, forceDecision) => { - const mainPermissionResult = forceDecision ?? await hasPermissionsToUseTool(tool, input11, toolUseContext, assistantMessage, toolUseID); + return async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => { + const mainPermissionResult = forceDecision ?? await hasPermissionsToUseTool(tool, input, toolUseContext, assistantMessage, toolUseID); if (mainPermissionResult.behavior === "allow" || mainPermissionResult.behavior === "deny") { return mainPermissionResult; } @@ -750048,19 +672614,19 @@ class StructuredIO { const onParentAbort = () => hookAbortController.abort(); parentSignal.addEventListener("abort", onParentAbort, { once: true }); try { - const hookPromise = executePermissionRequestHooksForSDK(tool.name, toolUseID, input11, toolUseContext, mainPermissionResult.suggestions).then((decision) => ({ source: "hook", decision })); + const hookPromise = executePermissionRequestHooksForSDK(tool.name, toolUseID, input, toolUseContext, mainPermissionResult.suggestions).then((decision) => ({ source: "hook", decision })); const requestId = randomUUID55(); - onPermissionPrompt?.(buildRequiresActionDetails(tool, input11, toolUseID, requestId)); + onPermissionPrompt?.(buildRequiresActionDetails(tool, input, toolUseID, requestId)); const sdkPromise = this.sendRequest({ subtype: "can_use_tool", tool_name: tool.name, - input: input11, + input, permission_suggestions: mainPermissionResult.suggestions, blocked_path: mainPermissionResult.blockedPath, decision_reason: serializeDecisionReason(mainPermissionResult.decisionReason), tool_use_id: toolUseID, agent_id: toolUseContext.agentId - }, outputSchema36(), hookAbortController.signal, requestId).then((result3) => ({ source: "sdk", result: result3 })); + }, outputSchema36(), hookAbortController.signal, requestId).then((result2) => ({ source: "sdk", result: result2 })); const winner = await Promise.race([hookPromise, sdkPromise]); if (winner.source === "hook") { if (winner.decision) { @@ -750069,15 +672635,15 @@ class StructuredIO { return winner.decision; } const sdkResult = await sdkPromise; - return permissionPromptToolResultToPermissionDecision(sdkResult.result, tool, input11, toolUseContext); + return permissionPromptToolResultToPermissionDecision(sdkResult.result, tool, input, toolUseContext); } - return permissionPromptToolResultToPermissionDecision(winner.result, tool, input11, toolUseContext); - } catch (error46) { + return permissionPromptToolResultToPermissionDecision(winner.result, tool, input, toolUseContext); + } catch (error42) { return permissionPromptToolResultToPermissionDecision({ behavior: "deny", - message: `Tool permission request failed: ${error46}`, + message: `Tool permission request failed: ${error42}`, toolUseID - }, tool, input11, toolUseContext); + }, tool, input, toolUseContext); } finally { if (this.getPendingPermissionRequests().length === 0) { notifySessionStateChanged("running"); @@ -750090,17 +672656,17 @@ class StructuredIO { return { type: "callback", timeout: timeout2, - callback: async (input11, toolUseID, abort) => { + callback: async (input, toolUseID, abort) => { try { - const result3 = await this.sendRequest({ + const result2 = await this.sendRequest({ subtype: "hook_callback", callback_id: callbackId, - input: input11, + input, tool_use_id: toolUseID || undefined }, hookJSONOutputSchema(), abort); - return result3; - } catch (error46) { - console.error(`Error in hook callback ${callbackId}:`, error46); + return result2; + } catch (error42) { + console.error(`Error in hook callback ${callbackId}:`, error42); return {}; } } @@ -750108,7 +672674,7 @@ class StructuredIO { } async handleElicitation(serverName, message, requestedSchema, signal, mode, url3, elicitationId) { try { - const result3 = await this.sendRequest({ + const result2 = await this.sendRequest({ subtype: "elicitation", mcp_server_name: serverName, message, @@ -750117,7 +672683,7 @@ class StructuredIO { elicitation_id: elicitationId, requested_schema: requestedSchema }, SDKControlElicitationResponseSchema(), signal); - return result3; + return result2; } catch { return { action: "cancel" }; } @@ -750125,14 +672691,14 @@ class StructuredIO { createSandboxAskCallback() { return async (hostPattern) => { try { - const result3 = await this.sendRequest({ + const result2 = await this.sendRequest({ subtype: "can_use_tool", tool_name: SANDBOX_NETWORK_ACCESS_TOOL_NAME, input: { host: hostPattern.host }, tool_use_id: randomUUID55(), description: `Allow network connection to ${hostPattern.host}?` }, outputSchema36()); - return result3.behavior === "allow"; + return result2.behavior === "allow"; } catch { return false; } @@ -750153,15 +672719,15 @@ function exitWithMessage(message) { console.error(message); process.exit(1); } -async function executePermissionRequestHooksForSDK(toolName, toolUseID, input11, toolUseContext, suggestions) { +async function executePermissionRequestHooksForSDK(toolName, toolUseID, input, toolUseContext, suggestions) { const appState = toolUseContext.getAppState(); const permissionMode = appState.toolPermissionContext.mode; - const hookGenerator = executePermissionRequestHooks(toolName, toolUseID, input11, toolUseContext, permissionMode, suggestions, toolUseContext.abortController.signal); + const hookGenerator = executePermissionRequestHooks(toolName, toolUseID, input, toolUseContext, permissionMode, suggestions, toolUseContext.abortController.signal); for await (const hookResult of hookGenerator) { if (hookResult.permissionRequestResult && (hookResult.permissionRequestResult.behavior === "allow" || hookResult.permissionRequestResult.behavior === "deny")) { const decision = hookResult.permissionRequestResult; if (decision.behavior === "allow") { - const finalInput = decision.updatedInput || input11; + const finalInput = decision.updatedInput || input; const permissionUpdates = decision.updatedPermissions ?? []; if (permissionUpdates.length > 0) { persistPermissionUpdates(permissionUpdates); @@ -750559,7 +673125,7 @@ function SandboxViolationExpandedView() { } return t8; } -function _temp300(v, i4) { +function _temp300(v, i3) { return /* @__PURE__ */ jsx_dev_runtime461.jsxDEV(ThemedBox_default, { paddingLeft: 2, children: /* @__PURE__ */ jsx_dev_runtime461.jsxDEV(ThemedText, { @@ -750571,7 +673137,7 @@ function _temp300(v, i4) { v.line ] }, undefined, true, undefined, this) - }, `${v.timestamp.getTime()}-${i4}`, false, undefined, this); + }, `${v.timestamp.getTime()}-${i3}`, false, undefined, this); } var import_compiler_runtime357, import_react306, jsx_dev_runtime461; var init_SandboxViolationExpandedView = __esm(() => { @@ -750727,8 +673293,8 @@ function _temp361(client_1) { function _temp2100(client_0) { return client_0.type === "failed" && client_0.config.type === "claudeai-proxy" && hasClaudeAiMcpEverConnected(client_0.name); } -function _temp301(client5) { - return client5.type === "failed" && client5.config.type !== "sse-ide" && client5.config.type !== "ws-ide" && client5.config.type !== "claudeai-proxy"; +function _temp301(client2) { + return client2.type === "failed" && client2.config.type !== "sse-ide" && client2.config.type !== "ws-ide" && client2.config.type !== "claudeai-proxy"; } var import_compiler_runtime358, import_react307, jsx_dev_runtime462, EMPTY_MCP_CLIENTS; var init_useMcpConnectivityStatus = __esm(() => { @@ -750996,14 +673562,14 @@ function isRecord2(value) { function extractFromServerConfigRecord(serverConfigs) { const extensions = new Set; let command8 = null; - for (const [_serverName, config6] of Object.entries(serverConfigs)) { - if (!isRecord2(config6)) { + for (const [_serverName, config4] of Object.entries(serverConfigs)) { + if (!isRecord2(config4)) { continue; } - if (!command8 && typeof config6.command === "string") { - command8 = config6.command; + if (!command8 && typeof config4.command === "string") { + command8 = config4.command; } - const extMapping = config6.extensionToLanguage; + const extMapping = config4.extensionToLanguage; if (isRecord2(extMapping)) { for (const ext of Object.keys(extMapping)) { extensions.add(ext.toLowerCase()); @@ -751016,10 +673582,10 @@ function extractFromServerConfigRecord(serverConfigs) { return { extensions, command: command8 }; } async function getLspPluginsFromMarketplaces() { - const result3 = new Map; + const result2 = new Map; try { - const config6 = await loadKnownMarketplacesConfig(); - for (const marketplaceName of Object.keys(config6)) { + const config4 = await loadKnownMarketplacesConfig(); + for (const marketplaceName of Object.keys(config4)) { try { const marketplace = await getMarketplace(marketplaceName); const isOfficial = isOfficialMarketplace(marketplaceName); @@ -751032,7 +673598,7 @@ async function getLspPluginsFromMarketplaces() { continue; } const pluginId = `${entry.name}@${marketplaceName}`; - result3.set(pluginId, { + result2.set(pluginId, { entry, marketplaceName, extensions: lspInfo.extensions, @@ -751040,14 +673606,14 @@ async function getLspPluginsFromMarketplaces() { isOfficial }); } - } catch (error46) { - logForDebugging(`[lspRecommendation] Failed to load marketplace ${marketplaceName}: ${error46}`); + } catch (error42) { + logForDebugging(`[lspRecommendation] Failed to load marketplace ${marketplaceName}: ${error42}`); } } - } catch (error46) { - logForDebugging(`[lspRecommendation] Failed to load marketplaces config: ${error46}`); + } catch (error42) { + logForDebugging(`[lspRecommendation] Failed to load marketplaces config: ${error42}`); } - return result3; + return result2; } async function getMatchingLspPlugins(filePath) { if (isLspRecommendationsDisabled()) { @@ -751061,8 +673627,8 @@ async function getMatchingLspPlugins(filePath) { } logForDebugging(`[lspRecommendation] Looking for LSP plugins for ${ext}`); const allLspPlugins = await getLspPluginsFromMarketplaces(); - const config6 = getGlobalConfig(); - const neverPlugins = config6.lspRecommendationNeverPlugins ?? []; + const config4 = getGlobalConfig(); + const neverPlugins = config4.lspRecommendationNeverPlugins ?? []; const matchingPlugins = []; for (const [pluginId, info] of allLspPlugins) { if (!info.extensions.has(ext)) { @@ -751129,8 +673695,8 @@ function incrementIgnoredCount() { logForDebugging("[lspRecommendation] Incremented ignored count"); } function isLspRecommendationsDisabled() { - const config6 = getGlobalConfig(); - return config6.lspRecommendationDisabled === true || (config6.lspRecommendationIgnoredCount ?? 0) >= MAX_IGNORED_COUNT; + const config4 = getGlobalConfig(); + return config4.lspRecommendationDisabled === true || (config4.lspRecommendationIgnoredCount ?? 0) >= MAX_IGNORED_COUNT; } var MAX_IGNORED_COUNT = 5; var init_lspRecommendation = __esm(() => { @@ -751149,7 +673715,7 @@ function usePluginRecommendationBase() { const isCheckingRef = React148.useRef(false); let t0; if ($2[0] !== recommendation) { - t0 = (resolve48) => { + t0 = (resolve42) => { if (getIsRemoteMode()) { return; } @@ -751160,7 +673726,7 @@ function usePluginRecommendationBase() { return; } isCheckingRef.current = true; - resolve48().then((rec) => { + resolve42().then((rec) => { if (rec) { setRecommendation(rec); } @@ -751218,8 +673784,8 @@ async function installPluginAndNotify(pluginId, pluginName, keyPrefix, addNotifi priority: "immediate", timeoutMs: 5000 }); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); addNotification({ key: `${keyPrefix}-install-failed`, jsx: /* @__PURE__ */ jsx_dev_runtime464.jsxDEV(ThemedText, { @@ -751247,7 +673813,7 @@ var init_usePluginRecommendationBase = __esm(() => { }); // src/hooks/useLspPluginRecommendation.tsx -import { extname as extname17, join as join170 } from "path"; +import { extname as extname17, join as join160 } from "path"; function useLspPluginRecommendation() { const $2 = import_compiler_runtime361.c(12); const trackedFiles = useAppState(_temp303); @@ -751284,8 +673850,8 @@ function useLspPluginRecommendation() { } for (const filePath of newFiles) { try { - const matches3 = await getMatchingLspPlugins(filePath); - const match = matches3[0]; + const matches2 = await getMatchingLspPlugins(filePath); + const match = matches2[0]; if (match) { logForDebugging(`[useLspPluginRecommendation] Found match: ${match.pluginName} for ${filePath}`); setLspRecommendationShownThisSession(true); @@ -751298,8 +673864,8 @@ function useLspPluginRecommendation() { }; } } catch (t32) { - const error46 = t32; - logError2(error46); + const error42 = t32; + logError2(error42); } } return null; @@ -751332,7 +673898,7 @@ function useLspPluginRecommendation() { case "yes": { installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => { logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`); - const localSourcePath = typeof pluginData.entry.source === "string" ? join170(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined; + const localSourcePath = typeof pluginData.entry.source === "string" ? join160(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined; await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath); const settings = getSettingsForSource("userSettings"); updateSettingsForSource("userSettings", { @@ -751608,15 +674174,15 @@ function useClaudeCodeHintRecommendation() { marketplaceName } = recommendation; installPluginAndNotify(pluginId, pluginName, "hint-plugin", addNotification, async (pluginData) => { - const result3 = await installPluginFromMarketplace({ + const result2 = await installPluginFromMarketplace({ pluginId, entry: pluginData.entry, marketplaceName, scope: "user", trigger: "hint" }); - if (!result3.success) { - throw new Error(result3.error); + if (!result2.success) { + throw new Error(result2.error); } }); break bb15; @@ -752036,7 +674602,7 @@ var init_usePluginAutoupdateNotification = __esm(() => { }); // src/utils/plugins/reconciler.ts -import { isAbsolute as isAbsolute26, resolve as resolve48 } from "path"; +import { isAbsolute as isAbsolute25, resolve as resolve42 } from "path"; function diffMarketplaces(declared, materialized, opts) { const missing = []; const sourceChanged = []; @@ -752114,17 +674680,17 @@ async function reconcileMarketplaces(opts) { const installed = []; const updated = []; const failed = []; - for (let i4 = 0;i4 < toProcess.length; i4++) { - const { name, source, action: action2 } = toProcess[i4]; + for (let i3 = 0;i3 < toProcess.length; i3++) { + const { name, source, action: action2 } = toProcess[i3]; opts?.onProgress?.({ type: "installing", name, action: action2, - index: i4 + 1, + index: i3 + 1, total: toProcess.length }); try { - const result3 = await addMarketplaceSource(source); + const result2 = await addMarketplaceSource(source); if (action2 === "install") installed.push(name); else @@ -752132,24 +674698,24 @@ async function reconcileMarketplaces(opts) { opts?.onProgress?.({ type: "installed", name, - alreadyMaterialized: result3.alreadyMaterialized + alreadyMaterialized: result2.alreadyMaterialized }); } catch (e) { - const error46 = errorMessage(e); - failed.push({ name, error: error46 }); - opts?.onProgress?.({ type: "failed", name, error: error46 }); + const error42 = errorMessage(e); + failed.push({ name, error: error42 }); + opts?.onProgress?.({ type: "failed", name, error: error42 }); logError2(e); } } return { installed, updated, failed, upToDate: diff3.upToDate, skipped }; } function normalizeSource(source, projectRoot) { - if ((source.source === "directory" || source.source === "file") && !isAbsolute26(source.path)) { + if ((source.source === "directory" || source.source === "file") && !isAbsolute25(source.path)) { const base2 = projectRoot ?? getOriginalCwd(); const canonicalRoot = findCanonicalGitRoot(base2); return { ...source, - path: resolve48(canonicalRoot ?? base2, source.path) + path: resolve42(canonicalRoot ?? base2, source.path) }; } return source; @@ -752167,14 +674733,14 @@ var init_reconciler2 = __esm(() => { }); // src/services/plugins/PluginInstallationManager.ts -function updateMarketplaceStatus(setAppState, name, status2, error46) { +function updateMarketplaceStatus(setAppState, name, status2, error42) { setAppState((prevState) => ({ ...prevState, plugins: { ...prevState.plugins, installationStatus: { ...prevState.plugins.installationStatus, - marketplaces: prevState.plugins.installationStatus.marketplaces.map((m) => m.name === name ? { ...m, status: status2, error: error46 } : m) + marketplaces: prevState.plugins.installationStatus.marketplaces.map((m) => m.name === name ? { ...m, status: status2, error: error42 } : m) } } })); @@ -752206,7 +674772,7 @@ async function performBackgroundPluginInstallations(setAppState) { return; } logForDebugging(`Installing ${pendingNames.length} marketplace(s) in background`); - const result3 = await reconcileMarketplaces({ + const result2 = await reconcileMarketplaces({ onProgress: (event) => { switch (event.type) { case "installing": @@ -752222,16 +674788,16 @@ async function performBackgroundPluginInstallations(setAppState) { } }); const metrics = { - installed_count: result3.installed.length, - updated_count: result3.updated.length, - failed_count: result3.failed.length, - up_to_date_count: result3.upToDate.length + installed_count: result2.installed.length, + updated_count: result2.updated.length, + failed_count: result2.failed.length, + up_to_date_count: result2.upToDate.length }; logEvent("tengu_marketplace_background_install", metrics); logForDiagnosticsNoPII("info", "tengu_marketplace_background_install", metrics); - if (result3.installed.length > 0) { + if (result2.installed.length > 0) { clearMarketplacesCache(); - logForDebugging(`Auto-refreshing plugins after ${result3.installed.length} new marketplace(s) installed`); + logForDebugging(`Auto-refreshing plugins after ${result2.installed.length} new marketplace(s) installed`); try { await refreshActivePlugins(setAppState); } catch (refreshError) { @@ -752247,7 +674813,7 @@ async function performBackgroundPluginInstallations(setAppState) { }; }); } - } else if (result3.updated.length > 0) { + } else if (result2.updated.length > 0) { clearMarketplacesCache(); clearPluginCache("performBackgroundPluginInstallations: marketplaces reconciled"); setAppState((prev) => { @@ -752259,8 +674825,8 @@ async function performBackgroundPluginInstallations(setAppState) { }; }); } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } var init_PluginInstallationManager = __esm(() => { @@ -752300,8 +674866,8 @@ async function performStartupChecks(setAppState) { }); } await performBackgroundPluginInstallations(setAppState); - } catch (error46) { - logForDebugging(`Error initiating background plugin installations: ${error46}`); + } catch (error42) { + logForDebugging(`Error initiating background plugin installations: ${error42}`); } } var init_performStartupChecks = __esm(() => { @@ -752413,17 +674979,17 @@ function _temp306(line, index) { } const url3 = m[0]; const start = m.index ?? 0; - const before3 = line.slice(0, start); - const after3 = line.slice(start + url3.length); + const before2 = line.slice(0, start); + const after2 = line.slice(start + url3.length); return /* @__PURE__ */ jsx_dev_runtime469.jsxDEV(ThemedText, { dimColor: true, children: [ - before3, + before2, /* @__PURE__ */ jsx_dev_runtime469.jsxDEV(Link, { url: url3, children: url3 }, undefined, false, undefined, this), - after3 + after2 ] }, index, true, undefined, this); } @@ -752554,7 +675120,7 @@ var init_useRateLimitWarningNotification = __esm(() => { init_ink2(); init_claudeAiLimits(); init_claudeAiLimitsHook(); - init_auth2(); + init_auth(); init_billing(); init_state(); jsx_dev_runtime470 = __toESM(require_jsx_dev_runtime(), 1); @@ -752564,7 +675130,7 @@ var init_useRateLimitWarningNotification = __esm(() => { function getDeprecatedModelInfo(modelId) { const lowercaseModelId = modelId.toLowerCase(); const provider = getAPIProvider(); - for (const [key, value] of Object.entries(DEPRECATED_MODELS5)) { + for (const [key, value] of Object.entries(DEPRECATED_MODELS3)) { const retirementDate = value.retirementDates[provider]; if (!lowercaseModelId.includes(key) || !retirementDate) { continue; @@ -752587,10 +675153,10 @@ function getModelDeprecationWarning(modelId) { } return `⚠ ${info.modelName} will be retired on ${info.retirementDate}. Consider switching to a newer model.`; } -var DEPRECATED_MODELS5; +var DEPRECATED_MODELS3; var init_deprecation = __esm(() => { init_providers(); - DEPRECATED_MODELS5 = { + DEPRECATED_MODELS3 = { "claude-3-opus": { modelName: "Claude 3 Opus", retirementDates: { @@ -752893,10 +675459,10 @@ function useModelMigrationNotifications() { useStartupNotification(_temp309); } function _temp309() { - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); const notifs = []; for (const migration of MIGRATIONS) { - const notif = migration(config6); + const notif = migration(config4); if (notif) { notifs.push(notif); } @@ -752998,7 +675564,7 @@ async function getExistingClaudeSubscription() { var jsx_dev_runtime472, MAX_SHOW_COUNT3 = 3; var init_useCanSwitchToExistingSubscription = __esm(() => { init_getOauthProfile(); - init_auth2(); + init_auth(); init_ink2(); init_analytics(); init_config2(); @@ -753389,8 +675955,8 @@ function isSessionContainerCompatible(messages) { return false; } if (toolName === BASH_TOOL_NAME) { - const input11 = block2.input; - const command8 = input11?.command || ""; + const input = block2.input; + const command8 = input?.command || ""; if (EXTERNAL_COMMAND_PATTERNS.some((p) => p.test(command8))) { return false; } @@ -753400,16 +675966,16 @@ function isSessionContainerCompatible(messages) { return true; } function hasFrictionSignal(messages) { - for (let i4 = messages.length - 1;i4 >= 0; i4--) { - const msg = messages[i4]; + for (let i3 = messages.length - 1;i3 >= 0; i3--) { + const msg = messages[i3]; if (msg.type !== "user") { continue; } - const text2 = getUserMessageText(msg); - if (!text2) { + const text = getUserMessageText(msg); + if (!text) { continue; } - return FRICTION_PATTERNS.some((p) => p.test(text2)); + return FRICTION_PATTERNS.some((p) => p.test(text)); } return false; } @@ -753439,7 +676005,7 @@ function useIssueFlagBanner(messages, submitCount) { var import_react318, EXTERNAL_COMMAND_PATTERNS, FRICTION_PATTERNS, MIN_SUBMIT_COUNT = 3, COOLDOWN_MS; var init_useIssueFlagBanner = __esm(() => { import_react318 = __toESM(require_react(), 1); - init_messages5(); + init_messages3(); EXTERNAL_COMMAND_PATTERNS = [ /\bcurl\b/, /\bwget\b/, @@ -753492,7 +676058,7 @@ function AlternateScreen(t0) { mouseTracking: t1 } = t0; const mouseTracking = t1 === undefined ? true : t1; - const size3 = import_react320.useContext(TerminalSizeContext); + const size2 = import_react320.useContext(TerminalSizeContext); const writeRaw = import_react320.useContext(TerminalWriteContext); let t2; let t3; @@ -753520,7 +676086,7 @@ function AlternateScreen(t0) { t3 = $2[3]; } import_react320.useInsertionEffect(t2, t3); - const t4 = size3?.rows ?? 24; + const t4 = size2?.rows ?? 24; let t5; if ($2[4] !== children2 || $2[5] !== t4) { t5 = /* @__PURE__ */ jsx_dev_runtime475.jsxDEV(Box_default, { @@ -753560,12 +676126,12 @@ function useCopyOnSelect(selection, isActive, onCopied) { return; const unsubscribe2 = selection.subscribe(() => { const sel = selection.getState(); - const has3 = selection.hasSelection(); + const has2 = selection.hasSelection(); if (sel?.isDragging) { copiedRef.current = false; return; } - if (!has3) { + if (!has2) { copiedRef.current = false; return; } @@ -753574,13 +676140,13 @@ function useCopyOnSelect(selection, isActive, onCopied) { const enabled = getGlobalConfig().copyOnSelect ?? true; if (!enabled) return; - const text2 = selection.copySelectionNoClear(); - if (!text2 || !text2.trim()) { + const text = selection.copySelectionNoClear(); + if (!text || !text.trim()) { copiedRef.current = true; return; } copiedRef.current = true; - onCopiedRef.current?.(text2); + onCopiedRef.current?.(text); }); return unsubscribe2; }, [isActive, selection]); @@ -753625,31 +676191,31 @@ function selectionFocusMoveForKey(key) { return "lineEnd"; return null; } -function computeWheelStep(state2, dir, now3) { +function computeWheelStep(state2, dir, now2) { if (!state2.xtermJs) { - if (state2.wheelMode && now3 - state2.time > WHEEL_MODE_IDLE_DISENGAGE_MS) { + if (state2.wheelMode && now2 - state2.time > WHEEL_MODE_IDLE_DISENGAGE_MS) { state2.wheelMode = false; state2.burstCount = 0; state2.mult = state2.base; } if (state2.pendingFlip) { state2.pendingFlip = false; - if (dir !== state2.dir || now3 - state2.time > WHEEL_BOUNCE_GAP_MAX_MS) { + if (dir !== state2.dir || now2 - state2.time > WHEEL_BOUNCE_GAP_MAX_MS) { state2.dir = dir; - state2.time = now3; + state2.time = now2; state2.mult = state2.base; return Math.floor(state2.mult); } state2.wheelMode = true; } - const gap2 = now3 - state2.time; + const gap2 = now2 - state2.time; if (dir !== state2.dir && state2.dir !== 0) { state2.pendingFlip = true; - state2.time = now3; + state2.time = now2; return 0; } state2.dir = dir; - state2.time = now3; + state2.time = now2; if (state2.wheelMode) { if (gap2 < WHEEL_BURST_MS) { if (++state2.burstCount >= 5) { @@ -753678,9 +676244,9 @@ function computeWheelStep(state2, dir, now3) { } return Math.floor(state2.mult); } - const gap = now3 - state2.time; + const gap = now2 - state2.time; const sameDir = dir === state2.dir; - state2.time = now3; + state2.time = now2; state2.dir = dir; if (sameDir && gap < WHEEL_BURST_MS) return 1; @@ -753734,11 +676300,11 @@ function ScrollKeybindingHandler({ addNotification } = useNotifications(); const wheelAccel = import_react322.useRef(null); - function showCopiedToast(text2) { - const path30 = getClipboardPath(); - const n3 = text2.length; + function showCopiedToast(text) { + const path25 = getClipboardPath(); + const n3 = text.length; let msg; - switch (path30) { + switch (path25) { case "native": msg = `copied ${n3} chars to clipboard`; break; @@ -753754,7 +676320,7 @@ function ScrollKeybindingHandler({ text: msg, color: "suggestion", priority: "immediate", - timeoutMs: path30 === "native" ? 2000 : 4000 + timeoutMs: path25 === "native" ? 2000 : 4000 }); } function copyAndToast() { @@ -753772,9 +676338,9 @@ function ScrollKeybindingHandler({ return; if (sel.focus.row < top || sel.focus.row > bottom) return; - const max5 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); + const max3 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); const cur = s.getScrollTop() + s.getPendingDelta(); - const actual = Math.max(0, Math.min(max5, cur + delta)) - cur; + const actual = Math.max(0, Math.min(max3, cur + delta)) - cur; if (actual === 0) return; if (actual > 0) { @@ -753888,11 +676454,11 @@ function ScrollKeybindingHandler({ context: "Scroll", isActive }); - use_input_default((input11, key, event) => { + use_input_default((input, key, event) => { const s_10 = scrollRef.current; if (!s_10) return; - const sticky_5 = applyModalPagerAction(s_10, modalPagerAction(input11, key), (d_5) => translateSelectionForJump(s_10, d_5)); + const sticky_5 = applyModalPagerAction(s_10, modalPagerAction(input, key), (d_5) => translateSelectionForJump(s_10, d_5)); if (sticky_5 === null) return; onScroll?.(sticky_5, s_10); @@ -753969,12 +676535,12 @@ function useDragToScroll(scrollRef, selection, isActive, onScroll) { selection.shiftAnchor(actual, 0, bottom); s.scrollBy(-AUTOSCROLL_LINES); } else { - const max5 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); - if (s.getScrollTop() >= max5) { + const max3 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); + if (s.getScrollTop() >= max3) { stop(); return; } - const actual_0 = Math.min(AUTOSCROLL_LINES, max5 - s.getScrollTop()); + const actual_0 = Math.min(AUTOSCROLL_LINES, max3 - s.getScrollTop()); selection.captureScrolledRows(top, top + actual_0 - 1, "above"); selection.shiftAnchor(-actual_0, top, bottom); s.scrollBy(AUTOSCROLL_LINES); @@ -754042,10 +676608,10 @@ function dragScrollDirection(sel, top, bottom, alreadyScrollingDir = 0) { return want; } function jumpBy(s, delta) { - const max5 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); + const max3 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); const target = s.getScrollTop() + s.getPendingDelta() + delta; - if (target >= max5) { - s.scrollTo(max5); + if (target >= max3) { + s.scrollTo(max3); s.scrollToBottom(); return true; } @@ -754053,9 +676619,9 @@ function jumpBy(s, delta) { return false; } function scrollDown2(s, amount) { - const max5 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); + const max3 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); const effectiveTop = s.getScrollTop() + s.getPendingDelta(); - if (effectiveTop + amount >= max5) { + if (effectiveTop + amount >= max3) { s.scrollToBottom(); return true; } @@ -754070,7 +676636,7 @@ function scrollUp2(s, amount) { } s.scrollBy(-amount); } -function modalPagerAction(input11, key) { +function modalPagerAction(input, key) { if (key.meta) return null; if (!key.ctrl && !key.shift) { @@ -754086,7 +676652,7 @@ function modalPagerAction(input11, key) { if (key.ctrl) { if (key.shift) return null; - switch (input11) { + switch (input) { case "u": return "halfPageUp"; case "d": @@ -754103,8 +676669,8 @@ function modalPagerAction(input11, key) { return null; } } - const c6 = input11[0]; - if (!c6 || input11 !== c6.repeat(input11.length)) + const c6 = input[0]; + if (!c6 || input !== c6.repeat(input.length)) return null; if (c6 === "G" || c6 === "g" && key.shift) return "bottom"; @@ -754154,9 +676720,9 @@ function applyModalPagerAction(s, act, onBeforeJump) { s.scrollTo(0); return false; case "bottom": { - const max5 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); - onBeforeJump(max5 - (s.getScrollTop() + s.getPendingDelta())); - s.scrollTo(max5); + const max3 = Math.max(0, s.getScrollHeight() - s.getViewportHeight()); + onBeforeJump(max3 - (s.getScrollTop() + s.getPendingDelta())); + s.scrollTo(max3); s.scrollToBottom(); return true; } @@ -754210,7 +676776,7 @@ function useVoiceIntegration({ const stripTrailing = import_react323.useCallback((maxStrip, { char = " ", anchor = false, - floor: floor3 = 0 + floor: floor2 = 0 } = {}) => { const prev = inputValueRef.current; const offset = insertTextRef.current?.cursorOffset ?? prev.length; @@ -754221,7 +676787,7 @@ function useVoiceIntegration({ while (trailing < scan.length && scan[scan.length - 1 - trailing] === char) { trailing++; } - const stripCount = Math.max(0, Math.min(trailing - floor3, maxStrip)); + const stripCount = Math.max(0, Math.min(trailing - floor2, maxStrip)); const remaining = trailing - stripCount; const stripped = beforeCursor.slice(0, beforeCursor.length - stripCount); let gap = ""; @@ -754265,11 +676831,11 @@ function useVoiceIntegration({ if (!feature("VOICE_MODE")) return; if (voiceState === "recording" && voicePrefixRef.current === null) { - const input11 = inputValueRef.current; - const offset_0 = insertTextRef.current?.cursorOffset ?? input11.length; - voicePrefixRef.current = input11.slice(0, offset_0); - voiceSuffixRef.current = input11.slice(offset_0); - lastSetInputRef.current = input11; + const input = inputValueRef.current; + const offset_0 = insertTextRef.current?.cursorOffset ?? input.length; + voicePrefixRef.current = input.slice(0, offset_0); + voiceSuffixRef.current = input.slice(offset_0); + lastSetInputRef.current = input; } if (voiceState === "idle") { voicePrefixRef.current = null; @@ -754299,7 +676865,7 @@ function useVoiceIntegration({ } lastSetInputRef.current = newValue_0; }, [voiceInterimTranscript, setInputValueRaw, inputValueRef, insertTextRef]); - const handleVoiceTranscript = import_react323.useCallback((text2) => { + const handleVoiceTranscript = import_react323.useCallback((text) => { if (!feature("VOICE_MODE")) return; const prefix_1 = voicePrefixRef.current; @@ -754308,19 +676874,19 @@ function useVoiceIntegration({ const suffix_1 = voiceSuffixRef.current; if (inputValueRef.current !== lastSetInputRef.current) return; - const needsSpace_0 = prefix_1.length > 0 && !/\s$/.test(prefix_1) && text2.length > 0; - const needsTrailingSpace_0 = suffix_1.length > 0 && !/^\s/.test(suffix_1) && text2.length > 0; + const needsSpace_0 = prefix_1.length > 0 && !/\s$/.test(prefix_1) && text.length > 0; + const needsTrailingSpace_0 = suffix_1.length > 0 && !/^\s/.test(suffix_1) && text.length > 0; const leadingSpace_0 = needsSpace_0 ? " " : ""; const trailingSpace_0 = needsTrailingSpace_0 ? " " : ""; - const newInput = prefix_1 + leadingSpace_0 + text2 + trailingSpace_0 + suffix_1; - const cursorPos_0 = prefix_1.length + leadingSpace_0.length + text2.length; + const newInput = prefix_1 + leadingSpace_0 + text + trailingSpace_0 + suffix_1; + const cursorPos_0 = prefix_1.length + leadingSpace_0.length + text.length; if (insertTextRef.current) { insertTextRef.current.setInputWithCursor(newInput, cursorPos_0); } else { setInputValueRaw(newInput); } lastSetInputRef.current = newInput; - voicePrefixRef.current = prefix_1 + leadingSpace_0 + text2; + voicePrefixRef.current = prefix_1 + leadingSpace_0 + text; }, [setInputValueRaw, inputValueRef, insertTextRef]); const voice2 = voiceNs.useVoice({ onTranscript: handleVoiceTranscript, @@ -754374,7 +676940,7 @@ function useVoiceKeybindingHandler({ const voiceKeystroke = import_react323.useMemo(() => { if (!keybindingContext) return DEFAULT_VOICE_KEYSTROKE; - let result3 = null; + let result2 = null; for (const binding2 of keybindingContext.bindings) { if (binding2.context !== "Chat") continue; @@ -754384,12 +676950,12 @@ function useVoiceKeybindingHandler({ if (!ks) continue; if (binding2.action === "voice:pushToTalk") { - result3 = ks; - } else if (result3 !== null && keystrokesEqual(ks, result3)) { - result3 = null; + result2 = ks; + } else if (result2 !== null && keystrokesEqual(ks, result2)) { + result2 = null; } } - return result3; + return result2; }, [keybindingContext]); const bareChar = voiceKeystroke !== null && voiceKeystroke.key.length === 1 && !voiceKeystroke.ctrl && !voiceKeystroke.alt && !voiceKeystroke.shift && !voiceKeystroke.meta && !voiceKeystroke.super ? voiceKeystroke.key : null; const rapidCountRef = import_react323.useRef(0); @@ -754613,35 +677179,35 @@ var init_cronJitterConfig = __esm(() => { }); // src/utils/cronTasksLock.ts -import { mkdir as mkdir56, readFile as readFile61, unlink as unlink29, writeFile as writeFile58 } from "fs/promises"; -import { dirname as dirname70, join as join171 } from "path"; +import { mkdir as mkdir56, readFile as readFile60, unlink as unlink29, writeFile as writeFile56 } from "fs/promises"; +import { dirname as dirname66, join as join161 } from "path"; function getLockPath2(dir) { - return join171(dir ?? getProjectRoot(), LOCK_FILE_REL); + return join161(dir ?? getProjectRoot(), LOCK_FILE_REL); } async function readLock2(dir) { let raw; try { - raw = await readFile61(getLockPath2(dir), "utf8"); + raw = await readFile60(getLockPath2(dir), "utf8"); } catch { return; } - const result3 = schedulerLockSchema().safeParse(safeParseJSON(raw, false)); - return result3.success ? result3.data : undefined; + const result2 = schedulerLockSchema().safeParse(safeParseJSON(raw, false)); + return result2.success ? result2.data : undefined; } async function tryCreateExclusive2(lock2, dir) { - const path30 = getLockPath2(dir); + const path25 = getLockPath2(dir); const body = jsonStringify(lock2); try { - await writeFile58(path30, body, { flag: "wx" }); + await writeFile56(path25, body, { flag: "wx" }); return true; } catch (e) { const code = getErrnoCode(e); if (code === "EEXIST") return false; if (code === "ENOENT") { - await mkdir56(dirname70(path30), { recursive: true }); + await mkdir56(dirname66(path25), { recursive: true }); try { - await writeFile58(path30, body, { flag: "wx" }); + await writeFile56(path25, body, { flag: "wx" }); return true; } catch (retryErr) { if (getErrnoCode(retryErr) === "EEXIST") @@ -754675,7 +677241,7 @@ async function tryAcquireSchedulerLock(opts) { const existing = await readLock2(dir); if (existing?.sessionId === sessionId) { if (existing.pid !== process.pid) { - await writeFile58(getLockPath2(dir), jsonStringify(lock2)); + await writeFile56(getLockPath2(dir), jsonStringify(lock2)); registerLockCleanup2(opts); } return true; @@ -754722,7 +677288,7 @@ var init_cronTasksLock = __esm(() => { init_genericProcessUtils(); init_json(); init_slowOperations(); - LOCK_FILE_REL = join171(".claude", "scheduled_tasks.lock"); + LOCK_FILE_REL = join161(".claude", "scheduled_tasks.lock"); schedulerLockSchema = lazySchema(() => exports_external.object({ sessionId: exports_external.string(), pid: exports_external.number(), @@ -754753,7 +677319,7 @@ function createCronScheduler(options2) { lockIdentity, getJitterConfig, isKilled, - filter: filter4 + filter: filter3 } = options2; const lockOpts = dir || lockIdentity ? { dir, lockIdentity } : undefined; let tasks2 = []; @@ -754766,15 +677332,15 @@ function createCronScheduler(options2) { let watcher6 = null; let stopped = false; let isOwner = false; - async function load2(initial3) { + async function load2(initial2) { const next = await readCronTasks(dir); if (stopped) return; tasks2 = next; - if (!initial3) + if (!initial2) return; - const now3 = Date.now(); - const missed = findMissedTasks(next, now3).filter((t) => !t.recurring && !missedAsked.has(t.id) && (!filter4 || filter4(t))); + const now2 = Date.now(); + const missed = findMissedTasks(next, now2).filter((t) => !t.recurring && !missedAsked.has(t.id) && (!filter3 || filter3(t))); if (missed.length > 0) { for (const t of missed) { missedAsked.add(t.id); @@ -754798,12 +677364,12 @@ function createCronScheduler(options2) { return; if (isLoading() && !assistantMode) return; - const now3 = Date.now(); + const now2 = Date.now(); const seen = new Set; const firedFileRecurring = []; const jitterCfg = getJitterConfig?.() ?? DEFAULT_CRON_JITTER_CONFIG; function process14(t, isSession) { - if (filter4 && !filter4(t)) + if (filter3 && !filter3(t)) return; seen.add(t.id); if (inFlight.has(t.id)) @@ -754814,7 +677380,7 @@ function createCronScheduler(options2) { nextFireAt.set(t.id, next); logForDebugging(`[ScheduledTasks] scheduled ${t.id} for ${next === Infinity ? "never" : new Date(next).toISOString()}`); } - if (now3 < next) + if (now2 < next) return; logForDebugging(`[ScheduledTasks] firing ${t.id}${t.recurring ? " (recurring)" : ""}`); logEvent("tengu_scheduled_task_fire", { @@ -754826,9 +677392,9 @@ function createCronScheduler(options2) { } else { onFire(t.prompt); } - const aged = isRecurringTaskAged(t, now3, jitterCfg.recurringMaxAgeMs); + const aged = isRecurringTaskAged(t, now2, jitterCfg.recurringMaxAgeMs); if (aged) { - const ageHours = Math.floor((now3 - t.createdAt) / 1000 / 60 / 60); + const ageHours = Math.floor((now2 - t.createdAt) / 1000 / 60 / 60); logForDebugging(`[ScheduledTasks] recurring task ${t.id} aged out (${ageHours}h since creation), deleting after final fire`); logEvent("tengu_scheduled_task_expired", { taskId: t.id, @@ -754836,7 +677402,7 @@ function createCronScheduler(options2) { }); } if (t.recurring && !aged) { - const newNext = jitteredNextCronRunMs(t.cron, now3, t.id, jitterCfg) ?? Infinity; + const newNext = jitteredNextCronRunMs(t.cron, now2, t.id, jitterCfg) ?? Infinity; nextFireAt.set(t.id, newNext); if (!isSession) firedFileRecurring.push(t.id); @@ -754855,7 +677421,7 @@ function createCronScheduler(options2) { if (firedFileRecurring.length > 0) { for (const id of firedFileRecurring) inFlight.add(id); - markCronTasksFired(firedFileRecurring, now3, dir).catch((e) => logForDebugging(`[ScheduledTasks] failed to persist lastFiredAt: ${e}`)).finally(() => { + markCronTasksFired(firedFileRecurring, now2, dir).catch((e) => logForDebugging(`[ScheduledTasks] failed to persist lastFiredAt: ${e}`)).finally(() => { for (const id of firedFileRecurring) inFlight.delete(id); }); @@ -754912,8 +677478,8 @@ function createCronScheduler(options2) { lockProbeTimer.unref?.(); } load2(true); - const path30 = getCronFilePath(dir); - watcher6 = chokidar.watch(path30, { + const path25 = getCronFilePath(dir); + watcher6 = chokidar.watch(path25, { persistent: false, ignoreInitial: true, awaitWriteFinish: { stabilityThreshold: FILE_STABILITY_MS }, @@ -754974,12 +677540,12 @@ function createCronScheduler(options2) { } }, getNextFireTime() { - let min3 = Infinity; + let min2 = Infinity; for (const t of nextFireAt.values()) { - if (t < min3) - min3 = t; + if (t < min2) + min2 = t; } - return min3 === Infinity ? null : min3; + return min2 === Infinity ? null : min2; } }; } @@ -754990,7 +677556,7 @@ function buildMissedTaskNotification(missed) { Do NOT execute ${plural2 ? "these prompts" : "this prompt"} yet. First use the AskUserQuestion tool to ask whether to run ${plural2 ? "each one" : "it"} now. Only execute if the user confirms.`; const blocks = missed.map((t) => { const meta = `[${cronToHuman(t.cron)}, created ${new Date(t.createdAt).toLocaleString()}]`; - const longestRun = (t.prompt.match(/`+/g) ?? []).reduce((max5, run) => Math.max(max5, run.length), 0); + const longestRun = (t.prompt.match(/`+/g) ?? []).reduce((max3, run) => Math.max(max3, run.length), 0); const fence = "`".repeat(Math.max(3, longestRun + 1)); return `${meta} ${fence} @@ -755083,7 +677649,7 @@ var init_useScheduledTasks = __esm(() => { init_cronTasks(); init_debug(); init_messageQueueManager(); - init_messages5(); + init_messages3(); init_workloadContext(); }); @@ -755103,10 +677669,10 @@ var exports_REPL = {}; __export(exports_REPL, { REPL: () => REPL }); -import { spawnSync as spawnSync9 } from "child_process"; -import { dirname as dirname71, join as join172 } from "path"; -import { tmpdir as tmpdir16 } from "os"; -import { writeFile as writeFile59 } from "fs/promises"; +import { spawnSync as spawnSync8 } from "child_process"; +import { dirname as dirname67, join as join162 } from "path"; +import { tmpdir as tmpdir13 } from "os"; +import { writeFile as writeFile57 } from "fs/promises"; import { randomUUID as randomUUID56 } from "crypto"; function TranscriptModeFooter(t0) { const $2 = import_compiler_runtime373.c(9); @@ -755410,14 +677976,14 @@ function REPL({ if (!viewingAgentTaskId || !needsBootstrap) return; const taskId = viewingAgentTaskId; - getAgentTranscript(asAgentId(taskId)).then((result3) => { + getAgentTranscript(asAgentId(taskId)).then((result2) => { setAppState((prev) => { const t = prev.tasks[taskId]; if (!isLocalAgentTask(t) || t.diskLoaded || !t.retain) return prev; const live = t.messages ?? []; const liveUuids = new Set(live.map((m) => m.uuid)); - const diskOnly = result3 ? result3.messages.filter((m) => !liveUuids.has(m.uuid)) : []; + const diskOnly = result2 ? result2.messages.filter((m) => !liveUuids.has(m.uuid)) : []; return { ...prev, tasks: { @@ -755443,8 +678009,8 @@ function REPL({ useKickOffCheckAndDisableBypassPermissionsIfNeeded(); useKickOffCheckAndDisableAutoModeIfNeeded(); const [dynamicMcpConfig, setDynamicMcpConfig] = import_react325.useState(initialDynamicMcpConfig); - const onChangeDynamicMcpConfig = import_react325.useCallback((config6) => { - setDynamicMcpConfig(config6); + const onChangeDynamicMcpConfig = import_react325.useCallback((config4) => { + setDynamicMcpConfig(config4); }, [setDynamicMcpConfig]); const [screen, setScreen] = import_react325.useState("prompt"); const [showAllInTranscript, setShowAllInTranscript] = import_react325.useState(false); @@ -755630,13 +678196,13 @@ function REPL({ if (args?.isLocalJSXCommand) { const { clearLocalJSX: _, - ...rest3 + ...rest2 } = args; localJSXCommandRef.current = { - ...rest3, + ...rest2, isLocalJSXCommand: true }; - setToolJSXInternal(rest3); + setToolJSXInternal(rest2); return; } if (localJSXCommandRef.current) { @@ -755710,14 +678276,14 @@ function REPL({ } rawSetMessages(next); }, []); - const setUserInputOnProcessing = import_react325.useCallback((input11) => { - if (input11 !== undefined) { + const setUserInputOnProcessing = import_react325.useCallback((input) => { + if (input !== undefined) { userInputBaselineRef.current = messagesRef.current.length; userMessagePendingRef.current = true; } else { userMessagePendingRef.current = false; } - setUserInputOnProcessingRaw(input11); + setUserInputOnProcessingRaw(input); }, []); const { dividerIndex, @@ -755954,8 +678520,8 @@ function REPL({ } if (safeYoloMessageShownRef.current) return; - const config6 = getGlobalConfig(); - const count4 = config6.autoPermissionsNotificationCount ?? 0; + const config4 = getGlobalConfig(); + const count4 = config4.autoPermissionsNotificationCount ?? 0; if (count4 >= 3) return; const timer = setTimeout((ref, setMessages2) => { @@ -756039,13 +678605,13 @@ function REPL({ ...prev, fileHistory: fileHistoryState }))); - const resume2 = import_react325.useCallback(async (sessionId, log3, entrypoint) => { + const resume2 = import_react325.useCallback(async (sessionId, log2, entrypoint) => { const resumeStart = performance.now(); try { - const messages2 = deserializeMessages(log3.messages); + const messages2 = deserializeMessages(log2.messages); if (feature("COORDINATOR_MODE")) { const coordinatorModule2 = (init_coordinatorMode(), __toCommonJS(exports_coordinatorMode)); - const warning = coordinatorModule2.matchSessionMode(log3.mode); + const warning = coordinatorModule2.matchSessionMode(log2.mode); if (warning) { const { getAgentDefinitionsWithOverrides: getAgentDefinitionsWithOverrides2, @@ -756078,17 +678644,17 @@ function REPL({ }); messages2.push(...hookMessages); if (entrypoint === "fork") { - copyPlanForFork(log3, asSessionId(sessionId)); + copyPlanForFork(log2, asSessionId(sessionId)); } else { - copyPlanForResume(log3, asSessionId(sessionId)); + copyPlanForResume(log2, asSessionId(sessionId)); } - restoreSessionStateFromLog(log3, setAppState); - if (log3.fileHistorySnapshots) { - copyFileHistoryForResume(log3); + restoreSessionStateFromLog(log2, setAppState); + if (log2.fileHistorySnapshots) { + copyFileHistoryForResume(log2); } const { agentDefinition: restoredAgent - } = restoreAgentFromSession(log3.agentSetting, initialMainThreadAgentDefinition, agentDefinitions); + } = restoreAgentFromSession(log2.agentSetting, initialMainThreadAgentDefinition, agentDefinitions); setMainThreadAgentDefinition(restoredAgent); setAppState((prev) => ({ ...prev, @@ -756096,29 +678662,29 @@ function REPL({ })); setAppState((prev) => ({ ...prev, - standaloneAgentContext: computeStandaloneAgentContext(log3.agentName, log3.agentColor) + standaloneAgentContext: computeStandaloneAgentContext(log2.agentName, log2.agentColor) })); - updateSessionName(log3.agentName); - restoreReadFileState(messages2, log3.projectPath ?? getOriginalCwd()); + updateSessionName(log2.agentName); + restoreReadFileState(messages2, log2.projectPath ?? getOriginalCwd()); resetLoadingState(); setAbortController(null); setConversationId(sessionId); const targetSessionCosts = getStoredSessionCosts(sessionId); saveCurrentSessionCosts(); resetCostState(); - switchSession(asSessionId(sessionId), log3.fullPath ? dirname71(log3.fullPath) : null); + switchSession(asSessionId(sessionId), log2.fullPath ? dirname67(log2.fullPath) : null); const { renameRecordingForSession: renameRecordingForSession2 } = await Promise.resolve().then(() => (init_asciicast(), exports_asciicast)); await renameRecordingForSession2(); await resetSessionFilePointer(); clearSessionMetadata(); - restoreSessionMetadata(log3); + restoreSessionMetadata(log2); haikuTitleAttemptedRef.current = true; setHaikuTitle(undefined); if (entrypoint !== "fork") { exitRestoredWorktree(); - restoreWorktreeForResume(log3.worktreeSession); + restoreWorktreeForResume(log2.worktreeSession); adoptResumedSessionFile(); restoreRemoteAgentTasks({ abortController: new AbortController, @@ -756143,7 +678709,7 @@ function REPL({ setCostStateForRestore(targetSessionCosts); } if (contentReplacementStateRef.current && entrypoint !== "fork") { - contentReplacementStateRef.current = reconstructContentReplacementState(messages2, log3.contentReplacements ?? []); + contentReplacementStateRef.current = reconstructContentReplacementState(messages2, log2.contentReplacements ?? []); } setMessages(() => messages2); setToolJSX(null); @@ -756153,12 +678719,12 @@ function REPL({ success: true, resume_duration_ms: Math.round(performance.now() - resumeStart) }); - } catch (error46) { + } catch (error42) { logEvent("tengu_session_resumed", { entrypoint, success: false }); - throw error46; + throw error42; } }, [resetLoadingState, setAppState]); const [initialReadFileState] = import_react325.useState(() => createFileStateCacheWithSizeLimit(READ_FILE_STATE_CACHE_SIZE)); @@ -756244,19 +678810,19 @@ function REPL({ if (!isLoading) return; const isPaused = focusedInputDialog === "tool-permission"; - const now3 = Date.now(); + const now2 = Date.now(); if (isPaused && pauseStartTimeRef.current === null) { - pauseStartTimeRef.current = now3; + pauseStartTimeRef.current = now2; } else if (!isPaused && pauseStartTimeRef.current !== null) { - totalPausedMsRef.current += now3 - pauseStartTimeRef.current; + totalPausedMsRef.current += now2 - pauseStartTimeRef.current; pauseStartTimeRef.current = null; } }, [focusedInputDialog, isLoading]); const prevDialogRef = import_react325.useRef(focusedInputDialog); import_react325.useLayoutEffect(() => { const was = prevDialogRef.current === "tool-permission"; - const now3 = focusedInputDialog === "tool-permission"; - if (was !== now3) + const now2 = focusedInputDialog === "tool-permission"; + if (was !== now2) repinScroll(); prevDialogRef.current = focusedInputDialog; }, [focusedInputDialog, repinScroll]); @@ -756297,17 +678863,17 @@ function REPL({ mrOnTurnComplete(messagesRef.current, true); } const handleQueuedCommandOnCancel = import_react325.useCallback(() => { - const result3 = popAllEditable(inputValue, 0); - if (!result3) + const result2 = popAllEditable(inputValue, 0); + if (!result2) return; - setInputValue(result3.text); + setInputValue(result2.text); setInputMode("prompt"); - if (result3.images.length > 0) { + if (result2.images.length > 0) { setPastedContents((prev) => { const newContents = { ...prev }; - for (const image of result3.images) { + for (const image of result2.images) { newContents[image.id] = image; } return newContents; @@ -756445,9 +679011,9 @@ Error: sandbox required but unavailable: ${reason} }); }, [addNotification]); if (SandboxManager2.isSandboxingEnabled()) { - SandboxManager2.initialize(sandboxAskCallback).catch((err3) => { + SandboxManager2.initialize(sandboxAskCallback).catch((err2) => { process.stderr.write(` -❌ Sandbox Error: ${errorMessage(err3)} +❌ Sandbox Error: ${errorMessage(err2)} `); gracefulShutdownSync(1, "other"); }); @@ -756474,13 +679040,13 @@ Error: sandbox required but unavailable: ${reason} return () => unregisterLeaderSetToolPermissionContext(); }, [setToolPermissionContext]); const canUseTool = useCanUseTool_default(setToolUseConfirmQueue, setToolPermissionContext); - const requestPrompt = import_react325.useCallback((title, toolInputSummary) => (request) => new Promise((resolve49, reject3) => { + const requestPrompt = import_react325.useCallback((title, toolInputSummary) => (request) => new Promise((resolve43, reject2) => { setPromptQueue((prev) => [...prev, { request, title, toolInputSummary, - resolve: resolve49, - reject: reject3 + resolve: resolve43, + reject: reject2 }]); }), []); const getToolUseContext = import_react325.useCallback((messages2, newMessages, abortController2, mainLoopModel2) => { @@ -756657,8 +679223,8 @@ Error: sandbox required but unavailable: ${reason} } } else if (newMessage.type === "progress" && isEphemeralToolProgress(newMessage.data.type)) { setMessages((oldMessages) => { - const last3 = oldMessages.at(-1); - if (last3?.type === "progress" && last3.parentToolUseID === newMessage.parentToolUseID && last3.data.type === newMessage.data.type) { + const last2 = oldMessages.at(-1); + if (last2?.type === "progress" && last2.parentToolUseID === newMessage.parentToolUseID && last2.data.type === newMessage.data.type) { const copy2 = oldMessages.slice(); copy2[copy2.length - 1] = newMessage; return copy2; @@ -756681,12 +679247,12 @@ Error: sandbox required but unavailable: ${reason} setMessages((oldMessages) => oldMessages.filter((m) => m !== tombstonedMessage)); removeTranscriptMessage(tombstonedMessage.uuid); }, setStreamingThinking, (metrics) => { - const now3 = Date.now(); + const now2 = Date.now(); const baseline = responseLengthRef.current; apiMetricsRef2.current.push({ ...metrics, - firstTokenTime: now3, - lastTokenTime: now3, + firstTokenTime: now2, + lastTokenTime: now2, responseLengthBaseline: baseline, endResponseLength: baseline }); @@ -756704,10 +679270,10 @@ Error: sandbox required but unavailable: ${reason} maybeMarkProjectOnboardingComplete(); if (!titleDisabled && !sessionTitle && !agentTitle && !haikuTitleAttemptedRef.current) { const firstUserMessage = newMessages.find((m) => m.type === "user" && !m.isMeta); - const text2 = firstUserMessage?.type === "user" ? getContentText(firstUserMessage.message.content) : null; - if (text2 && !text2.startsWith(`<${LOCAL_COMMAND_STDOUT_TAG}>`) && !text2.startsWith(`<${COMMAND_MESSAGE_TAG}>`) && !text2.startsWith(`<${COMMAND_NAME_TAG}>`) && !text2.startsWith(`<${BASH_INPUT_TAG}>`)) { + const text = firstUserMessage?.type === "user" ? getContentText(firstUserMessage.message.content) : null; + if (text && !text.startsWith(`<${LOCAL_COMMAND_STDOUT_TAG}>`) && !text.startsWith(`<${COMMAND_MESSAGE_TAG}>`) && !text.startsWith(`<${COMMAND_NAME_TAG}>`) && !text.startsWith(`<${BASH_INPUT_TAG}>`)) { haikuTitleAttemptedRef.current = true; - generateSessionTitle(text2, new AbortController().signal).then((title) => { + generateSessionTitle(text, new AbortController().signal).then((title) => { if (title) setHaikuTitle(title); else @@ -756719,7 +679285,7 @@ Error: sandbox required but unavailable: ${reason} } store.setState((prev) => { const cur = prev.toolPermissionContext.alwaysAllowRules.command; - if (cur === additionalAllowedTools || cur?.length === additionalAllowedTools.length && cur.every((v, i4) => v === additionalAllowedTools[i4])) { + if (cur === additionalAllowedTools || cur?.length === additionalAllowedTools.length && cur.every((v, i3) => v === additionalAllowedTools[i3])) { return prev; } return { @@ -756807,7 +679373,7 @@ Error: sandbox required but unavailable: ${reason} logQueryProfileReport(); await onTurnComplete?.(messagesRef.current); }, [initialMcpClients, resetLoadingState, getToolUseContext, toolPermissionContext, setAppState, customSystemPrompt, onTurnComplete, appendSystemPrompt, canUseTool, mainThreadAgentDefinition, onQueryEvent, sessionTitle, titleDisabled]); - const onQuery = import_react325.useCallback(async (newMessages, abortController2, shouldQuery, additionalAllowedTools, mainLoopModelParam, onBeforeQueryCallback, input11, effort) => { + const onQuery = import_react325.useCallback(async (newMessages, abortController2, shouldQuery, additionalAllowedTools, mainLoopModelParam, onBeforeQueryCallback, input, effort) => { if (isAgentSwarmsEnabled()) { const teamName = getTeamName(); const agentName = getAgentName(); @@ -756818,12 +679384,12 @@ Error: sandbox required but unavailable: ${reason} const thisGeneration = queryGuard.tryStart(); if (thisGeneration === null) { logEvent("tengu_concurrent_onquery_detected", {}); - newMessages.filter((m) => m.type === "user" && !m.isMeta).map((_) => getContentText(_.message.content)).filter((_) => _ !== null).forEach((msg, i4) => { + newMessages.filter((m) => m.type === "user" && !m.isMeta).map((_) => getContentText(_.message.content)).filter((_) => _ !== null).forEach((msg, i3) => { enqueue({ value: msg, mode: "prompt" }); - if (i4 === 0) { + if (i3 === 0) { logEvent("tengu_concurrent_onquery_enqueued", {}); } }); @@ -756834,18 +679400,18 @@ Error: sandbox required but unavailable: ${reason} setMessages((oldMessages) => [...oldMessages, ...newMessages]); responseLengthRef.current = 0; if (feature("TOKEN_BUDGET")) { - const parsedBudget = input11 ? parseTokenBudget(input11) : null; + const parsedBudget = input ? parseTokenBudget(input) : null; snapshotOutputTokensForTurn(parsedBudget ?? getCurrentTurnTokenBudget()); } apiMetricsRef2.current = []; setStreamingToolUses([]); setStreamingText(null); const latestMessages = messagesRef.current; - if (input11) { - await mrOnBeforeQuery(input11, latestMessages, newMessages.length); + if (input) { + await mrOnBeforeQuery(input, latestMessages, newMessages.length); } - if (onBeforeQueryCallback && input11) { - const shouldProceed = await onBeforeQueryCallback(input11, latestMessages); + if (onBeforeQueryCallback && input) { + const shouldProceed = await onBeforeQueryCallback(input, latestMessages); if (!shouldProceed) { return; } @@ -756978,13 +679544,13 @@ Error: sandbox required but unavailable: ${reason} } processInitialMessage(pending2); }, [initialMessage, isLoading, setMessages, setAppState, onQuery, mainLoopModel, tools]); - const onSubmit = import_react325.useCallback(async (input11, helpers2, speculationAccept, options2) => { + const onSubmit = import_react325.useCallback(async (input, helpers2, speculationAccept, options2) => { repinScroll(); if (feature("PROACTIVE") || feature("KAIROS")) { proactiveModule8?.resumeProactive(); } - if (!speculationAccept && input11.trim().startsWith("/")) { - const trimmedInput = expandPastedTextRefs(input11, pastedContents).trim(); + if (!speculationAccept && input.trim().startsWith("/")) { + const trimmedInput = expandPastedTextRefs(input, pastedContents).trim(); const spaceIndex = trimmedInput.indexOf(" "); const commandName = spaceIndex === -1 ? trimmedInput.slice(1) : trimmedInput.slice(1, spaceIndex); const commandArgs = spaceIndex === -1 ? "" : trimmedInput.slice(spaceIndex + 1).trim(); @@ -757001,15 +679567,15 @@ Error: sandbox required but unavailable: ${reason} } const shouldTreatAsImmediate = queryGuard.isActive && (matchingCommand?.immediate || options2?.fromKeybinding); if (matchingCommand && shouldTreatAsImmediate && matchingCommand.type === "local-jsx") { - if (input11.trim() === inputValueRef.current.trim()) { + if (input.trim() === inputValueRef.current.trim()) { setInputValue(""); helpers2.setCursorOffset(0); helpers2.clearBuffer(); setPastedContents({}); } - const pastedTextRefs = parseReferences(input11).filter((r) => pastedContents[r.id]?.type === "text"); + const pastedTextRefs = parseReferences(input).filter((r) => pastedContents[r.id]?.type === "text"); const pastedTextCount = pastedTextRefs.length; - const pastedTextBytes = pastedTextRefs.reduce((sum3, r) => sum3 + (pastedContents[r.id]?.content.length ?? 0), 0); + const pastedTextBytes = pastedTextRefs.reduce((sum2, r) => sum2 + (pastedContents[r.id]?.content.length ?? 0), 0); logEvent("tengu_paste_text", { pastedTextCount, pastedTextBytes @@ -757020,7 +679586,7 @@ Error: sandbox required but unavailable: ${reason} }); const executeImmediateCommand = async () => { let doneWasCalled = false; - const onDone = (result3, doneOptions) => { + const onDone = (result2, doneOptions) => { doneWasCalled = true; setToolJSX({ jsx: null, @@ -757028,14 +679594,14 @@ Error: sandbox required but unavailable: ${reason} clearLocalJSX: true }); const newMessages = []; - if (result3 && doneOptions?.display !== "skip") { + if (result2 && doneOptions?.display !== "skip") { addNotification({ key: `immediate-${matchingCommand.name}`, - text: result3, + text: result2, priority: "immediate" }); if (!isFullscreenEnvEnabled()) { - newMessages.push(createCommandInputMessage(formatCommandInputTags(getCommandName(matchingCommand), commandArgs)), createCommandInputMessage(`<${LOCAL_COMMAND_STDOUT_TAG}>${escapeXml(result3)}`)); + newMessages.push(createCommandInputMessage(formatCommandInputTags(getCommandName(matchingCommand), commandArgs)), createCommandInputMessage(`<${LOCAL_COMMAND_STDOUT_TAG}>${escapeXml(result2)}`)); } } if (doneOptions?.metaMessages?.length) { @@ -757069,19 +679635,19 @@ Error: sandbox required but unavailable: ${reason} return; } } - if (activeRemote.isRemoteMode && !input11.trim()) { + if (activeRemote.isRemoteMode && !input.trim()) { return; } { const willowMode = getFeatureValue_CACHED_MAY_BE_STALE("tengu_willow_mode", "off"); const idleThresholdMin = Number(process.env.CLAUDE_CODE_IDLE_THRESHOLD_MINUTES ?? 75); const tokenThreshold = Number(process.env.CLAUDE_CODE_IDLE_TOKEN_THRESHOLD ?? 1e5); - if (willowMode !== "off" && !getGlobalConfig().idleReturnDismissed && !skipIdleCheckRef.current && !speculationAccept && !input11.trim().startsWith("/") && lastQueryCompletionTimeRef.current > 0 && getTotalInputTokens() >= tokenThreshold) { + if (willowMode !== "off" && !getGlobalConfig().idleReturnDismissed && !skipIdleCheckRef.current && !speculationAccept && !input.trim().startsWith("/") && lastQueryCompletionTimeRef.current > 0 && getTotalInputTokens() >= tokenThreshold) { const idleMs = Date.now() - lastQueryCompletionTimeRef.current; const idleMinutes = idleMs / 60000; if (idleMinutes >= idleThresholdMin && willowMode === "dialog") { setIdleReturnPending({ - input: input11, + input, idleMinutes }); setInputValue(""); @@ -757093,14 +679659,14 @@ Error: sandbox required but unavailable: ${reason} } if (!options2?.fromKeybinding) { addToHistory({ - display: speculationAccept ? input11 : prependModeCharacterToInput(input11, inputMode), + display: speculationAccept ? input : prependModeCharacterToInput(input, inputMode), pastedContents: speculationAccept ? {} : pastedContents }); if (inputMode === "bash") { - prependToShellHistoryCache(input11.trim()); + prependToShellHistoryCache(input.trim()); } } - const isSlashCommand3 = !speculationAccept && input11.trim().startsWith("/"); + const isSlashCommand3 = !speculationAccept && input.trim().startsWith("/"); const submitsNow = !isLoading || speculationAccept || activeRemote.isRemoteMode; if (stashedPrompt !== undefined && !isSlashCommand3 && submitsNow) { setInputValue(stashedPrompt.text); @@ -757121,15 +679687,15 @@ Error: sandbox required but unavailable: ${reason} helpers2.clearBuffer(); tipPickedThisTurnRef.current = false; if (!isSlashCommand3 && inputMode === "prompt" && !speculationAccept && !activeRemote.isRemoteMode) { - setUserInputOnProcessing(input11); + setUserInputOnProcessing(input); resetTimingRefs(); } if (feature("COMMIT_ATTRIBUTION")) { setAppState((prev) => ({ ...prev, attribution: incrementPromptCount(prev.attribution, (snapshot2) => { - recordAttributionSnapshot(snapshot2).catch((error46) => { - logForDebugging(`Attribution: Failed to save snapshot: ${error46}`); + recordAttributionSnapshot(snapshot2).catch((error42) => { + logForDebugging(`Attribution: Failed to save snapshot: ${error42}`); }); }) })); @@ -757138,7 +679704,7 @@ Error: sandbox required but unavailable: ${reason} if (speculationAccept) { const { queryRequired - } = await handleSpeculationAccept(speculationAccept.state, speculationAccept.speculationSessionTimeSavedMs, speculationAccept.setAppState, input11, { + } = await handleSpeculationAccept(speculationAccept.state, speculationAccept.speculationSessionTimeSavedMs, speculationAccept.setAppState, input, { setMessages, readFileState, cwd: getOriginalCwd() @@ -757151,18 +679717,18 @@ Error: sandbox required but unavailable: ${reason} return; } if (activeRemote.isRemoteMode && !(isSlashCommand3 && commands.find((c6) => { - const name = input11.trim().slice(1).split(/\s/)[0]; + const name = input.trim().slice(1).split(/\s/)[0]; return isCommandEnabled(c6) && (c6.name === name || c6.aliases?.includes(name) || getCommandName(c6) === name); })?.type === "local-jsx")) { const pastedValues = Object.values(pastedContents); const imageContents = pastedValues.filter((c6) => c6.type === "image"); const imagePasteIds = imageContents.length > 0 ? imageContents.map((c6) => c6.id) : undefined; - let messageContent = input11.trim(); - let remoteContent = input11.trim(); + let messageContent = input.trim(); + let remoteContent = input.trim(); if (pastedValues.length > 0) { const contentBlocks = []; const remoteBlocks = []; - const trimmedInput = input11.trim(); + const trimmedInput = input.trim(); if (trimmedInput) { contentBlocks.push({ type: "text", @@ -757214,7 +679780,7 @@ Error: sandbox required but unavailable: ${reason} } await awaitPendingHooks(); await handlePromptSubmit({ - input: input11, + input, helpers: helpers2, queryGuard, isExternalLoading, @@ -757277,28 +679843,28 @@ Error: sandbox required but unavailable: ${reason} awaitPendingHooks, repinScroll ]); - const onAgentSubmit = import_react325.useCallback(async (input11, task, helpers2) => { + const onAgentSubmit = import_react325.useCallback(async (input, task, helpers2) => { if (isLocalAgentTask(task)) { appendMessageToLocalAgent(task.id, createUserMessage({ - content: input11 + content: input }), setAppState); if (task.status === "running") { - queuePendingMessage(task.id, input11, setAppState); + queuePendingMessage(task.id, input, setAppState); } else { resumeAgentBackground({ agentId: task.id, - prompt: input11, + prompt: input, toolUseContext: getToolUseContext(messagesRef.current, [], new AbortController, mainLoopModel), canUseTool - }).catch((err3) => { - logForDebugging(`resumeAgentBackground failed: ${errorMessage(err3)}`); + }).catch((err2) => { + logForDebugging(`resumeAgentBackground failed: ${errorMessage(err2)}`); addNotification({ key: `resume-agent-failed-${task.id}`, jsx: /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(ThemedText, { color: "error", children: [ "Failed to resume agent: ", - errorMessage(err3) + errorMessage(err2) ] }, undefined, true, undefined, this), priority: "low" @@ -757306,7 +679872,7 @@ Error: sandbox required but unavailable: ${reason} }); } } else { - injectUserMessageToTeammate(task.id, input11, setAppState); + injectUserMessageToTeammate(task.id, input, setAppState); } setInputValue(""); helpers2.setCursorOffset(0); @@ -757319,8 +679885,8 @@ Error: sandbox required but unavailable: ${reason} setCursorOffset: () => {}, clearBuffer: () => {}, resetHistory: () => {} - }).catch((err3) => { - logForDebugging(`Auto-run ${command8} failed: ${errorMessage(err3)}`); + }).catch((err2) => { + logForDebugging(`Auto-run ${command8} failed: ${errorMessage(err2)}`); }); }, [onSubmit, autoRunIssueReason]); const handleCancelAutoRunIssue = import_react325.useCallback(() => { @@ -757332,8 +679898,8 @@ Error: sandbox required but unavailable: ${reason} setCursorOffset: () => {}, clearBuffer: () => {}, resetHistory: () => {} - }).catch((err3) => { - logForDebugging(`Survey feedback request failed: ${err3 instanceof Error ? err3.message : String(err3)}`); + }).catch((err2) => { + logForDebugging(`Survey feedback request failed: ${err2 instanceof Error ? err2.message : String(err2)}`); }); }, [onSubmit]); const onSubmitRef = import_react325.useRef(onSubmit); @@ -757348,7 +679914,7 @@ Error: sandbox required but unavailable: ${reason} const handleExit = import_react325.useCallback(async () => { setIsExiting(true); if (feature("BG_SESSIONS") && isBgSession()) { - spawnSync9("tmux", ["detach-client"], { + spawnSync8("tmux", ["detach-client"], { stdio: "ignore" }); setIsExiting(false); @@ -757438,12 +680004,12 @@ Error: sandbox required but unavailable: ${reason} const handleRestoreMessage = import_react325.useCallback(async (message) => { setImmediate((restore, message2) => restore(message2), restoreMessageSync, message); }, [restoreMessageSync]); - const findRawIndex = (uuid8) => { - const prefix = uuid8.slice(0, 24); + const findRawIndex = (uuid5) => { + const prefix = uuid5.slice(0, 24); return messages.findIndex((m) => m.uuid.slice(0, 24) === prefix); }; const messageActionCaps = { - copy: (text2) => void setClipboard(text2).then((raw) => { + copy: (text) => void setClipboard(text).then((raw) => { if (raw) process.stdout.write(raw); addNotification({ @@ -757775,20 +680341,20 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. setSearchCount(count4); setSearchCurrent(current); }, []); - use_input_default((input11, key, event) => { + use_input_default((input, key, event) => { if (key.ctrl || key.meta) return; - if (input11 === "/") { + if (input === "/") { jumpRef.current?.setAnchor(); setSearchOpen(true); event.stopImmediatePropagation(); return; } - const c6 = input11[0]; - if ((c6 === "n" || c6 === "N") && input11 === c6.repeat(input11.length) && searchCount > 0) { + const c6 = input[0]; + if ((c6 === "n" || c6 === "N") && input === c6.repeat(input.length) && searchCount > 0) { const fn = c6 === "n" ? jumpRef.current?.nextMatch : jumpRef.current?.prevMatch; if (fn) - for (let i4 = 0;i4 < input11.length; i4++) + for (let i3 = 0;i3 < input.length; i3++) fn(); event.stopImmediatePropagation(); } @@ -757815,19 +680381,19 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. } } }, [transcriptCols, searchQuery, searchOpen, setHighlight]); - use_input_default((input11, key, event) => { + use_input_default((input, key, event) => { if (key.ctrl || key.meta) return; - if (input11 === "q") { + if (input === "q") { handleExitTranscript(); event.stopImmediatePropagation(); return; } - if (input11 === "[" && !dumpMode) { + if (input === "[" && !dumpMode) { setDumpMode(true); setShowAllInTranscript(true); event.stopImmediatePropagation(); - } else if (input11 === "v") { + } else if (input === "v") { event.stopImmediatePropagation(); if (editorRenderingRef.current) return; @@ -757844,11 +680410,11 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. try { const w = Math.max(80, (process.stdout.columns ?? 80) - 6); const raw = await renderMessagesToPlainText(deferredMessages, tools, w); - const text2 = raw.replace(/[ \t]+$/gm, ""); - const path30 = join172(tmpdir16(), `cc-transcript-${Date.now()}.txt`); - await writeFile59(path30, text2); - const opened = openFileInExternalEditor(path30); - setStatus(opened ? `opening ${path30}` : `wrote ${path30} · no $VISUAL/$EDITOR set`); + const text = raw.replace(/[ \t]+$/gm, ""); + const path25 = join162(tmpdir13(), `cc-transcript-${Date.now()}.txt`); + await writeFile57(path25, text); + const opened = openFileInExternalEditor(path25); + setStatus(opened ? `opening ${path25}` : `wrote ${path25} · no $VISUAL/$EDITOR set`); } catch (e) { setStatus(`render failed: ${e instanceof Error ? e.message : String(e)}`); } @@ -757898,7 +680464,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. useTeammateViewAutoExit(); if (screen === "transcript") { const transcriptScrollRef = isFullscreenEnvEnabled() && !disableVirtualScroll && !dumpMode ? scrollRef : undefined; - const transcriptMessagesElement = /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(Messages5, { + const transcriptMessagesElement = /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(Messages3, { messages: transcriptMessages, tools, commands, @@ -758027,7 +680593,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. const displayedMessages = viewedAgentTask ? viewedAgentTask.messages ?? [] : usesSyncMessages ? messages : deferredMessages; const placeholderText = userInputOnProcessing && !viewedAgentTask && displayedMessages.length <= userInputBaselineRef.current ? userInputOnProcessing : undefined; const toolPermissionOverlay = focusedInputDialog === "tool-permission" ? /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(PermissionRequest, { - onDone: () => setToolUseConfirmQueue(([_, ...tail3]) => tail3), + onDone: () => setToolUseConfirmQueue(([_, ...tail2]) => tail2), onReject: handleQueuedCommandOnCancel, toolUseConfirm: toolUseConfirmQueue[0], toolUseContext: getToolUseContext(messages, messages, abortController ?? createAbortController(), mainLoopModel), @@ -758092,7 +680658,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. scrollable: /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(jsx_dev_runtime476.Fragment, { children: [ /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(TeammateViewHeader, {}, undefined, false, undefined, this), - /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(Messages5, { + /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(Messages3, { messages: displayedMessages, tools, commands, @@ -758192,7 +680758,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. return; const approvedHost = currentRequest.hostPattern.host; if (persistToSettings) { - const update3 = { + const update2 = { type: "addRules", rules: [{ toolName: WEB_FETCH_TOOL_NAME, @@ -758203,9 +680769,9 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. }; setAppState((prev) => ({ ...prev, - toolPermissionContext: applyPermissionUpdate(prev.toolPermissionContext, update3) + toolPermissionContext: applyPermissionUpdate(prev.toolPermissionContext, update2) })); - persistPermissionUpdate(update3); + persistPermissionUpdate(update2); SandboxManager2.refreshConfig(); } setSandboxPermissionRequestQueue((queue2) => { @@ -758233,14 +680799,14 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. prompt_response: item.request.prompt, selected: selectedKey }); - setPromptQueue(([, ...tail3]) => tail3); + setPromptQueue(([, ...tail2]) => tail2); }, onAbort: () => { const item = promptQueue[0]; if (!item) return; item.reject(new Error("Prompt cancelled by user")); - setPromptQueue(([, ...tail3]) => tail3); + setPromptQueue(([, ...tail2]) => tail2); } }, promptQueue[0].request.prompt, false, undefined, this), pendingWorkerRequest && /* @__PURE__ */ jsx_dev_runtime476.jsxDEV(WorkerPendingPermission, { @@ -758267,7 +680833,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. const approvedHost = currentRequest.host; sendSandboxPermissionResponseViaMailbox(currentRequest.workerName, currentRequest.requestId, approvedHost, allow, teamContext?.teamName); if (persistToSettings && allow) { - const update3 = { + const update2 = { type: "addRules", rules: [{ toolName: WEB_FETCH_TOOL_NAME, @@ -758278,9 +680844,9 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. }; setAppState((prev) => ({ ...prev, - toolPermissionContext: applyPermissionUpdate(prev.toolPermissionContext, update3) + toolPermissionContext: applyPermissionUpdate(prev.toolPermissionContext, update2) })); - persistPermissionUpdate(update3); + persistPermissionUpdate(update2); SandboxManager2.refreshConfig(); } setAppState((prev) => ({ @@ -758607,16 +681173,16 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input. appendSystemPrompt: context2.options.appendSystemPrompt }); const [userContext, systemContext] = await Promise.all([getUserContext(), getSystemContext()]); - const result3 = await partialCompactConversation(compactMessages, messageIndex, context2, { + const result2 = await partialCompactConversation(compactMessages, messageIndex, context2, { systemPrompt, userContext, systemContext, toolUseContext: context2, forkContextMessages: compactMessages }, feedback2, direction); - const kept = result3.messagesToKeep ?? []; - const ordered = direction === "up_to" ? [...result3.summaryMessages, ...kept] : [...kept, ...result3.summaryMessages]; - const postCompact = [result3.boundaryMarker, ...ordered, ...result3.attachments, ...result3.hookResults]; + const kept = result2.messagesToKeep ?? []; + const ordered = direction === "up_to" ? [...result2.summaryMessages, ...kept] : [...kept, ...result2.summaryMessages]; + const postCompact = [result2.boundaryMarker, ...ordered, ...result2.attachments, ...result2.hookResults]; if (isFullscreenEnvEnabled() && direction === "from") { setMessages((old) => { const rawIdx = old.findIndex((m) => m.uuid === message.uuid); @@ -758728,7 +681294,7 @@ var init_REPL = __esm(() => { init_SkillImprovementSurvey(); init_useSkillImprovementSurvey(); init_Spinner2(); - init_prompts5(); + init_prompts4(); init_systemPrompt(); init_context2(); init_claudemd(); @@ -758763,7 +681329,7 @@ var init_REPL = __esm(() => { init_billing(); init_analytics(); init_growthbook(); - init_messages5(); + init_messages3(); init_sessionTitle(); init_xml(); init_gracefulShutdown(); @@ -758799,7 +681365,7 @@ var init_REPL = __esm(() => { init_microCompact(); init_postCompactCleanup(); init_toolResultStorage(); - init_compact3(); + init_compact2(); init_fileHistory(); init_commitAttribution(); init_sessionStorage(); @@ -758899,14 +681465,14 @@ var init_REPL = __esm(() => { }); // src/replLauncher.tsx -async function launchRepl(root3, appProps, replProps, renderAndRun) { +async function launchRepl(root2, appProps, replProps, renderAndRun) { const { App: App3 } = await Promise.resolve().then(() => (init_App2(), exports_App)); const { REPL: REPL2 } = await Promise.resolve().then(() => (init_REPL(), exports_REPL)); - await renderAndRun(root3, /* @__PURE__ */ jsx_dev_runtime477.jsxDEV(App3, { + await renderAndRun(root2, /* @__PURE__ */ jsx_dev_runtime477.jsxDEV(App3, { ...appProps, children: /* @__PURE__ */ jsx_dev_runtime477.jsxDEV(REPL2, { ...replProps @@ -758967,9 +681533,9 @@ async function fetchBootstrapAPI() { logForDebugging("[Bootstrap] Fetch ok"); return parsed.data; }); - } catch (error46) { - logForDebugging(`[Bootstrap] Fetch failed: ${axios_default.isAxiosError(error46) ? error46.response?.status ?? error46.code : "unknown"}`); - throw error46; + } catch (error42) { + logForDebugging(`[Bootstrap] Fetch failed: ${axios_default.isAxiosError(error42) ? error42.response?.status ?? error42.code : "unknown"}`); + throw error42; } } async function fetchBootstrapData() { @@ -758979,8 +681545,8 @@ async function fetchBootstrapData() { return; const clientData = response.client_data ?? null; const additionalModelOptions = response.additional_model_options ?? []; - const config6 = getGlobalConfig(); - if (isEqual_default(config6.clientDataCache, clientData) && isEqual_default(config6.additionalModelOptionsCache, additionalModelOptions)) { + const config4 = getGlobalConfig(); + if (isEqual_default(config4.clientDataCache, clientData) && isEqual_default(config4.additionalModelOptionsCache, additionalModelOptions)) { logForDebugging("[Bootstrap] Cache unchanged, skipping write"); return; } @@ -758990,16 +681556,16 @@ async function fetchBootstrapData() { clientDataCache: clientData, additionalModelOptionsCache: additionalModelOptions })); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } var bootstrapResponseSchema; var init_bootstrap = __esm(() => { init_axios2(); init_isEqual(); - init_auth2(); - init_zod2(); + init_auth(); + init_zod(); init_oauth(); init_config2(); init_debug(); @@ -759406,7 +681972,7 @@ var init_MCPServerMultiselectDialog = __esm(() => { }); // src/services/mcpServerApproval.tsx -async function handleMcpjsonServerApprovals(root3) { +async function handleMcpjsonServerApprovals(root2) { const { servers: projectServers } = getMcpConfigsByScope("project"); @@ -759414,11 +681980,11 @@ async function handleMcpjsonServerApprovals(root3) { if (pendingServers.length === 0) { return; } - await new Promise((resolve49) => { - const done = () => void resolve49(); + await new Promise((resolve43) => { + const done = () => void resolve43(); if (pendingServers.length === 1 && pendingServers[0] !== undefined) { const serverName = pendingServers[0]; - root3.render(/* @__PURE__ */ jsx_dev_runtime481.jsxDEV(AppStateProvider, { + root2.render(/* @__PURE__ */ jsx_dev_runtime481.jsxDEV(AppStateProvider, { children: /* @__PURE__ */ jsx_dev_runtime481.jsxDEV(KeybindingSetup, { children: /* @__PURE__ */ jsx_dev_runtime481.jsxDEV(MCPServerApprovalDialog, { serverName, @@ -759427,7 +681993,7 @@ async function handleMcpjsonServerApprovals(root3) { }, undefined, false, undefined, this) }, undefined, false, undefined, this)); } else { - root3.render(/* @__PURE__ */ jsx_dev_runtime481.jsxDEV(AppStateProvider, { + root2.render(/* @__PURE__ */ jsx_dev_runtime481.jsxDEV(AppStateProvider, { children: /* @__PURE__ */ jsx_dev_runtime481.jsxDEV(KeybindingSetup, { children: /* @__PURE__ */ jsx_dev_runtime481.jsxDEV(MCPServerMultiselectDialog, { serverNames: pendingServers, @@ -759445,7 +682011,7 @@ var init_mcpServerApproval = __esm(() => { init_KeybindingProviderSetup(); init_AppState(); init_config3(); - init_utils4(); + init_utils3(); jsx_dev_runtime481 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -759459,8 +682025,8 @@ function updateDeepLinkTerminalPreference() { const app = TERM_PROGRAM_TO_APP[termProgram.toLowerCase()]; if (!app) return; - const config6 = getGlobalConfig(); - if (config6.deepLinkTerminal === app) + const config4 = getGlobalConfig(); + if (config4.deepLinkTerminal === app) return; saveGlobalConfig((current) => ({ ...current, deepLinkTerminal: app })); logForDebugging(`Stored deep link terminal preference: ${app}`); @@ -759486,11 +682052,11 @@ class FpsTracker { firstRenderTime; lastRenderTime; record(durationMs) { - const now3 = performance.now(); + const now2 = performance.now(); if (this.firstRenderTime === undefined) { - this.firstRenderTime = now3; + this.firstRenderTime = now2; } - this.lastRenderTime = now3; + this.lastRenderTime = now2; this.frameDurations.push(durationMs); } getMetrics() { @@ -759533,8 +682099,8 @@ async function updateGithubRepoPathMapping() { currentPath = basePath; } const repoKey = repo.toLowerCase(); - const config6 = getGlobalConfig(); - const existingPaths = config6.githubRepoPaths?.[repoKey] ?? []; + const config4 = getGlobalConfig(); + const existingPaths = config4.githubRepoPaths?.[repoKey] ?? []; if (existingPaths[0] === currentPath) { logForDebugging(`Path ${currentPath} already tracked for repo ${repoKey}`); return; @@ -759549,22 +682115,22 @@ async function updateGithubRepoPathMapping() { } })); logForDebugging(`Added ${currentPath} to tracked paths for repo ${repoKey}`); - } catch (error46) { - logForDebugging(`Error updating repo path mapping: ${error46}`); + } catch (error42) { + logForDebugging(`Error updating repo path mapping: ${error42}`); } } function getKnownPathsForRepo(repo) { - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); const repoKey = repo.toLowerCase(); - return config6.githubRepoPaths?.[repoKey] ?? []; + return config4.githubRepoPaths?.[repoKey] ?? []; } async function filterExistingPaths(paths2) { const results = await Promise.all(paths2.map(pathExists)); - return paths2.filter((_, i4) => results[i4]); + return paths2.filter((_, i3) => results[i3]); } -async function validateRepoAtPath(path30, expectedRepo) { +async function validateRepoAtPath(path25, expectedRepo) { try { - const remoteUrl = await getRemoteUrlForDir(path30); + const remoteUrl = await getRemoteUrlForDir(path25); if (!remoteUrl) { return false; } @@ -759578,14 +682144,14 @@ async function validateRepoAtPath(path30, expectedRepo) { } } function removePathFromRepo(repo, pathToRemove) { - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); const repoKey = repo.toLowerCase(); - const existingPaths = config6.githubRepoPaths?.[repoKey] ?? []; - const updatedPaths = existingPaths.filter((path30) => path30 !== pathToRemove); + const existingPaths = config4.githubRepoPaths?.[repoKey] ?? []; + const updatedPaths = existingPaths.filter((path25) => path25 !== pathToRemove); if (updatedPaths.length === existingPaths.length) { return; } - const updatedMapping = { ...config6.githubRepoPaths }; + const updatedMapping = { ...config4.githubRepoPaths }; if (updatedPaths.length === 0) { delete updatedMapping[repoKey]; } else { @@ -759608,13 +682174,13 @@ var init_githubRepoPathMapping = __esm(() => { }); // src/hooks/useTimeout.ts -function useTimeout(delay3, resetTrigger) { +function useTimeout(delay2, resetTrigger) { const [isElapsed, setIsElapsed] = import_react326.useState(false); import_react326.useEffect(() => { setIsElapsed(false); - const timer = setTimeout(setIsElapsed, delay3, true); + const timer = setTimeout(setIsElapsed, delay2, true); return () => clearTimeout(timer); - }, [delay3, resetTrigger]); + }, [delay2, resetTrigger]); return isElapsed; } var import_react326; @@ -759645,18 +682211,18 @@ async function checkEndpoints() { return { success: true }; - } catch (error46) { + } catch (error42) { const hostname6 = new URL(url3).hostname; - const sslHint = getSSLErrorHint(error46); + const sslHint = getSSLErrorHint(error42); return { success: false, - error: `Failed to connect to ${hostname6}: ${error46 instanceof Error ? error46.code || error46.message : String(error46)}`, + error: `Failed to connect to ${hostname6}: ${error42 instanceof Error ? error42.code || error42.message : String(error42)}`, sslHint: sslHint ?? undefined }; } }; const results = await Promise.all(endpoints.map(checkEndpoint)); - const failedResult = results.find((result3) => !result3.success); + const failedResult = results.find((result2) => !result2.success); if (failedResult) { logEvent("tengu_preflight_check_failed", { isConnectivityError: false, @@ -759667,14 +682233,14 @@ async function checkEndpoints() { return failedResult || { success: true }; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); logEvent("tengu_preflight_check_failed", { isConnectivityError: true }); return { success: false, - error: `Connectivity check error: ${error46 instanceof Error ? error46.code || error46.message : String(error46)}` + error: `Connectivity check error: ${error42 instanceof Error ? error42.code || error42.message : String(error42)}` }; } } @@ -759683,7 +682249,7 @@ function PreflightStep(t0) { const { onSuccess } = t0; - const [result3, setResult] = import_react327.useState(null); + const [result2, setResult] = import_react327.useState(null); const [isChecking, setIsChecking] = import_react327.useState(true); const showSpinner = useTimeout(1000) && isChecking; let t1; @@ -759707,20 +682273,20 @@ function PreflightStep(t0) { import_react327.useEffect(t1, t2); let t3; let t4; - if ($2[2] !== onSuccess || $2[3] !== result3) { + if ($2[2] !== onSuccess || $2[3] !== result2) { t3 = () => { - if (result3?.success) { + if (result2?.success) { onSuccess(); } else { - if (result3 && !result3.success) { + if (result2 && !result2.success) { const timer = setTimeout(_temp368, 100); return () => clearTimeout(timer); } } }; - t4 = [result3, onSuccess]; + t4 = [result2, onSuccess]; $2[2] = onSuccess; - $2[3] = result3; + $2[3] = result2; $2[4] = t3; $2[5] = t4; } else { @@ -759729,7 +682295,7 @@ function PreflightStep(t0) { } import_react327.useEffect(t3, t4); let t5; - if ($2[6] !== isChecking || $2[7] !== result3 || $2[8] !== showSpinner) { + if ($2[6] !== isChecking || $2[7] !== result2 || $2[8] !== showSpinner) { t5 = isChecking && showSpinner ? /* @__PURE__ */ jsx_dev_runtime482.jsxDEV(ThemedBox_default, { paddingLeft: 1, children: [ @@ -759738,7 +682304,7 @@ function PreflightStep(t0) { children: "Checking connectivity..." }, undefined, false, undefined, this) ] - }, undefined, true, undefined, this) : !result3?.success && !isChecking && /* @__PURE__ */ jsx_dev_runtime482.jsxDEV(ThemedBox_default, { + }, undefined, true, undefined, this) : !result2?.success && !isChecking && /* @__PURE__ */ jsx_dev_runtime482.jsxDEV(ThemedBox_default, { flexDirection: "column", gap: 1, children: [ @@ -759748,14 +682314,14 @@ function PreflightStep(t0) { }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime482.jsxDEV(ThemedText, { color: "error", - children: result3?.error + children: result2?.error }, undefined, false, undefined, this), - result3?.sslHint ? /* @__PURE__ */ jsx_dev_runtime482.jsxDEV(ThemedBox_default, { + result2?.sslHint ? /* @__PURE__ */ jsx_dev_runtime482.jsxDEV(ThemedBox_default, { flexDirection: "column", gap: 1, children: [ /* @__PURE__ */ jsx_dev_runtime482.jsxDEV(ThemedText, { - children: result3.sslHint + children: result2.sslHint }, undefined, false, undefined, this), /* @__PURE__ */ jsx_dev_runtime482.jsxDEV(ThemedText, { color: "suggestion", @@ -759784,7 +682350,7 @@ function PreflightStep(t0) { ] }, undefined, true, undefined, this); $2[6] = isChecking; - $2[7] = result3; + $2[7] = result2; $2[8] = showSpinner; $2[9] = t5; } else { @@ -761410,7 +683976,7 @@ var init_Onboarding = __esm(() => { init_useExitOnCtrlCDWithKeybindings(); init_ink2(); init_useKeybinding(); - init_auth2(); + init_auth(); init_authPortable(); init_config2(); init_env(); @@ -761552,7 +684118,7 @@ function getDangerousEnvVarsSources() { } return sources; } -var init_utils14 = __esm(() => { +var init_utils13 = __esm(() => { init_settings2(); init_managedEnvConstants(); init_permissionsLoader(); @@ -761563,7 +684129,7 @@ var exports_TrustDialog = {}; __export(exports_TrustDialog, { TrustDialog: () => TrustDialog }); -import { homedir as homedir41 } from "os"; +import { homedir as homedir39 } from "os"; function TrustDialog(t0) { const $2 = import_compiler_runtime383.c(33); const { @@ -761674,7 +684240,7 @@ function TrustDialog(t0) { let t13; if ($2[13] !== hasAnyBashExecution) { t12 = () => { - const isHomeDir = homedir41() === getCwd(); + const isHomeDir = homedir39() === getCwd(); logEvent("tengu_trust_dialog_shown", { isHomeDir, hasMcpServers, @@ -761703,7 +684269,7 @@ function TrustDialog(t0) { gracefulShutdownSync(1); return; } - const isHomeDir_0 = homedir41() === getCwd(); + const isHomeDir_0 = homedir39() === getCwd(); logEvent("tengu_trust_dialog_accept", { isHomeDir: isHomeDir_0, hasMcpServers, @@ -761900,7 +684466,7 @@ var init_TrustDialog = __esm(() => { init_gracefulShutdown(); init_CustomSelect(); init_PermissionDialog(); - init_utils14(); + init_utils13(); jsx_dev_runtime488 = __toESM(require_jsx_dev_runtime(), 1); }); @@ -762355,60 +684921,60 @@ function completeOnboarding() { lastOnboardingVersion: "2.1.88-custom" })); } -function showDialog(root3, renderer) { - return new Promise((resolve49) => { - const done = (result3) => void resolve49(result3); - root3.render(renderer(done)); +function showDialog(root2, renderer) { + return new Promise((resolve43) => { + const done = (result2) => void resolve43(result2); + root2.render(renderer(done)); }); } -async function exitWithError2(root3, message, beforeExit) { - return exitWithMessage2(root3, message, { +async function exitWithError2(root2, message, beforeExit) { + return exitWithMessage2(root2, message, { color: "error", beforeExit }); } -async function exitWithMessage2(root3, message, options2) { +async function exitWithMessage2(root2, message, options2) { const { Text: Text2 } = await Promise.resolve().then(() => (init_ink2(), exports_ink)); const color3 = options2?.color; const exitCode = options2?.exitCode ?? 1; - root3.render(color3 ? /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(Text2, { + root2.render(color3 ? /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(Text2, { color: color3, children: message }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(Text2, { children: message }, undefined, false, undefined, this)); - root3.unmount(); + root2.unmount(); await options2?.beforeExit?.(); process.exit(exitCode); } -function showSetupDialog(root3, renderer, options2) { - return showDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(AppStateProvider, { +function showSetupDialog(root2, renderer, options2) { + return showDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(AppStateProvider, { onChangeAppState: options2?.onChangeAppState, children: /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(KeybindingSetup, { children: renderer(done) }, undefined, false, undefined, this) }, undefined, false, undefined, this)); } -async function renderAndRun(root3, element) { - root3.render(element); +async function renderAndRun(root2, element) { + root2.render(element); startDeferredPrefetches(); - await root3.waitUntilExit(); + await root2.waitUntilExit(); await gracefulShutdown(0); } -async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermissions, commands, claudeInChrome, devChannels) { +async function showSetupScreens(root2, permissionMode, allowDangerouslySkipPermissions, commands, claudeInChrome, devChannels) { if (isEnvTruthy(false) || process.env.IS_DEMO) { return false; } - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); let onboardingShown = false; - if (!config6.theme || !config6.hasCompletedOnboarding) { + if (!config4.theme || !config4.hasCompletedOnboarding) { onboardingShown = true; const { Onboarding: Onboarding2 } = await Promise.resolve().then(() => (init_Onboarding(), exports_Onboarding)); - await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(Onboarding2, { + await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(Onboarding2, { onDone: () => { completeOnboarding(); done(); @@ -762422,7 +684988,7 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi const { TrustDialog: TrustDialog2 } = await Promise.resolve().then(() => (init_TrustDialog(), exports_TrustDialog)); - await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(TrustDialog2, { + await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(TrustDialog2, { commands, onDone: done }, undefined, false, undefined, this)); @@ -762435,14 +685001,14 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi errors: allErrors } = getSettingsWithAllErrors(); if (allErrors.length === 0) { - await handleMcpjsonServerApprovals(root3); + await handleMcpjsonServerApprovals(root2); } if (await shouldShowClaudeMdExternalIncludesWarning()) { const externalIncludes = getExternalClaudeMdIncludes(await getMemoryFiles(true)); const { ClaudeMdExternalIncludesDialog: ClaudeMdExternalIncludesDialog2 } = await Promise.resolve().then(() => (init_ClaudeMdExternalIncludesDialog(), exports_ClaudeMdExternalIncludesDialog)); - await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(ClaudeMdExternalIncludesDialog2, { + await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(ClaudeMdExternalIncludesDialog2, { onDone: done, isStandaloneDialog: true, externalIncludes @@ -762459,7 +685025,7 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi const { GroveDialog: GroveDialog2 } = await Promise.resolve().then(() => (init_Grove(), exports_Grove)); - const decision = await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(GroveDialog2, { + const decision = await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(GroveDialog2, { showIfAlreadyViewed: false, location: onboardingShown ? "onboarding" : "policy_update_modal", onDone: done @@ -762477,7 +685043,7 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi const { ApproveApiKey: ApproveApiKey2 } = await Promise.resolve().then(() => (init_ApproveApiKey(), exports_ApproveApiKey)); - await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(ApproveApiKey2, { + await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(ApproveApiKey2, { customApiKeyTruncated, onDone: done }, undefined, false, undefined, this), { @@ -762489,7 +685055,7 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi const { BypassPermissionsModeDialog: BypassPermissionsModeDialog2 } = await Promise.resolve().then(() => (init_BypassPermissionsModeDialog(), exports_BypassPermissionsModeDialog)); - await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(BypassPermissionsModeDialog2, { + await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(BypassPermissionsModeDialog2, { onAccept: done }, undefined, false, undefined, this)); } @@ -762498,7 +685064,7 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi const { AutoModeOptInDialog: AutoModeOptInDialog2 } = await Promise.resolve().then(() => (init_AutoModeOptInDialog(), exports_AutoModeOptInDialog)); - await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(AutoModeOptInDialog2, { + await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(AutoModeOptInDialog2, { onAccept: done, onDecline: () => gracefulShutdownSync(1), declineExits: true @@ -762514,7 +685080,7 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi isChannelsEnabled: isChannelsEnabled2 }, { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 - }] = await Promise.all([Promise.resolve().then(() => (init_channelAllowlist(), exports_channelAllowlist)), Promise.resolve().then(() => (init_auth2(), exports_auth))]); + }] = await Promise.all([Promise.resolve().then(() => (init_channelAllowlist(), exports_channelAllowlist)), Promise.resolve().then(() => (init_auth(), exports_auth))]); if (!isChannelsEnabled2() || !getClaudeAIOAuthTokens2()?.accessToken) { setAllowedChannels([...getAllowedChannels(), ...devChannels.map((c6) => ({ ...c6, @@ -762525,7 +685091,7 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi const { DevChannelsDialog: DevChannelsDialog2 } = await Promise.resolve().then(() => (init_DevChannelsDialog(), exports_DevChannelsDialog)); - await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(DevChannelsDialog2, { + await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(DevChannelsDialog2, { channels: devChannels, onAccept: () => { setAllowedChannels([...getAllowedChannels(), ...devChannels.map((c6) => ({ @@ -762543,7 +685109,7 @@ async function showSetupScreens(root3, permissionMode, allowDangerouslySkipPermi const { ClaudeInChromeOnboarding: ClaudeInChromeOnboarding2 } = await Promise.resolve().then(() => (init_ClaudeInChromeOnboarding(), exports_ClaudeInChromeOnboarding)); - await showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(ClaudeInChromeOnboarding2, { + await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime492.jsxDEV(ClaudeInChromeOnboarding2, { onDone: done }, undefined, false, undefined, this)); } @@ -762584,15 +685150,15 @@ function getRenderContext(exitOnCtrlC) { if (flicker.reason === "resize") { continue; } - const now3 = Date.now(); - if (now3 - lastFlickerTime < 1000) { + const now2 = Date.now(); + if (now2 - lastFlickerTime < 1000) { logEvent("tengu_flicker", { desiredHeight: flicker.desiredHeight, actualHeight: flicker.availableHeight, reason: flicker.reason }); } - lastFlickerTime = now3; + lastFlickerTime = now2; } } } @@ -762606,7 +685172,7 @@ var init_interactiveHelpers = __esm(() => { init_state(); init_stats4(); init_context2(); - init_init3(); + init_init2(); init_terminal(); init_KeybindingProviderSetup(); init_main3(); @@ -762747,9 +685313,9 @@ var init_InvalidSettingsDialog = __esm(() => { var exports_AssistantSessionChooser = {}; __export(exports_AssistantSessionChooser, { default: () => AssistantSessionChooser_default, - __stub__: () => __stub__32 + __stub__: () => __stub__39 }); -var AssistantSessionChooser_default, __stub__32 = true; +var AssistantSessionChooser_default, __stub__39 = true; var init_AssistantSessionChooser = __esm(() => { AssistantSessionChooser_default = {}; }); @@ -762758,9 +685324,9 @@ var init_AssistantSessionChooser = __esm(() => { var exports_assistant3 = {}; __export(exports_assistant3, { default: () => assistant_default3, - __stub__: () => __stub__33 + __stub__: () => __stub__40 }); -var assistant_default3, __stub__33 = true; +var assistant_default3, __stub__40 = true; var init_assistant2 = __esm(() => { assistant_default3 = {}; }); @@ -762769,7 +685335,7 @@ var init_assistant2 = __esm(() => { function useTeleportResume(source) { const $2 = import_compiler_runtime388.c(8); const [isResuming, setIsResuming] = import_react334.useState(false); - const [error46, setError] = import_react334.useState(null); + const [error42, setError] = import_react334.useState(null); const [selectedSession, setSelectedSession] = import_react334.useState(null); let t0; if ($2[0] !== source) { @@ -762782,18 +685348,18 @@ function useTeleportResume(source) { session_id: session2.id }); try { - const result3 = await teleportResumeCodeSession(session2.id); + const result2 = await teleportResumeCodeSession(session2.id); setTeleportedSessionInfo({ sessionId: session2.id }); setIsResuming(false); - return result3; + return result2; } catch (t12) { - const err3 = t12; + const err2 = t12; const teleportError = { - message: err3 instanceof TeleportOperationError ? err3.message : errorMessage(err3), - formattedMessage: err3 instanceof TeleportOperationError ? err3.formattedMessage : undefined, - isOperationError: err3 instanceof TeleportOperationError + message: err2 instanceof TeleportOperationError ? err2.message : errorMessage(err2), + formattedMessage: err2 instanceof TeleportOperationError ? err2.formattedMessage : undefined, + isOperationError: err2 instanceof TeleportOperationError }; setError(teleportError); setIsResuming(false); @@ -762817,15 +685383,15 @@ function useTeleportResume(source) { } const clearError = t1; let t2; - if ($2[3] !== error46 || $2[4] !== isResuming || $2[5] !== resumeSession || $2[6] !== selectedSession) { + if ($2[3] !== error42 || $2[4] !== isResuming || $2[5] !== resumeSession || $2[6] !== selectedSession) { t2 = { resumeSession, isResuming, - error: error46, + error: error42, selectedSession, clearError }; - $2[3] = error46; + $2[3] = error42; $2[4] = isResuming; $2[5] = resumeSession; $2[6] = selectedSession; @@ -762886,8 +685452,8 @@ function ResumeTask({ return dateB.getTime() - dateA.getTime(); }); setSessions(sortedSessions); - } catch (err3) { - const errorMessage3 = err3 instanceof Error ? err3.message : String(err3); + } catch (err2) { + const errorMessage3 = err2 instanceof Error ? err2.message : String(err2); logForDebugging(`Error loading code sessions: ${errorMessage3}`); setLoadErrorType(determineErrorType(errorMessage3)); } finally { @@ -762902,12 +685468,12 @@ function ResumeTask({ useKeybinding("confirm:no", onCancel, { context: "Confirmation" }); - use_input_default((input11, key) => { - if (key.ctrl && input11 === "c") { + use_input_default((input, key) => { + if (key.ctrl && input === "c") { onCancel(); return; } - if (key.ctrl && input11 === "r" && loadErrorType) { + if (key.ctrl && input === "r" && loadErrorType) { handleRetry(); return; } @@ -763228,7 +685794,7 @@ function TeleportResumeWrapper(t0) { const { resumeSession, isResuming, - error: error46, + error: error42, selectedSession } = useTeleportResume(source); let t2; @@ -763249,20 +685815,20 @@ function TeleportResumeWrapper(t0) { } import_react336.useEffect(t2, t3); let t4; - if ($2[3] !== error46 || $2[4] !== onComplete || $2[5] !== onError || $2[6] !== resumeSession) { + if ($2[3] !== error42 || $2[4] !== onComplete || $2[5] !== onError || $2[6] !== resumeSession) { t4 = async (session2) => { - const result3 = await resumeSession(session2); - if (result3) { - onComplete(result3); + const result2 = await resumeSession(session2); + if (result2) { + onComplete(result2); } else { - if (error46) { + if (error42) { if (onError) { - onError(error46.message, error46.formattedMessage); + onError(error42.message, error42.formattedMessage); } } } }; - $2[3] = error46; + $2[3] = error42; $2[4] = onComplete; $2[5] = onError; $2[6] = resumeSession; @@ -763283,7 +685849,7 @@ function TeleportResumeWrapper(t0) { t5 = $2[9]; } const handleCancel = t5; - const t6 = !!error46 && !onError; + const t6 = !!error42 && !onError; let t7; if ($2[10] !== t6) { t7 = { @@ -763337,7 +685903,7 @@ function TeleportResumeWrapper(t0) { } return t9; } - if (error46 && !onError) { + if (error42 && !onError) { let t82; if ($2[15] === Symbol.for("react.memo_cache_sentinel")) { t82 = /* @__PURE__ */ jsx_dev_runtime495.jsxDEV(ThemedText, { @@ -763350,12 +685916,12 @@ function TeleportResumeWrapper(t0) { t82 = $2[15]; } let t9; - if ($2[16] !== error46.message) { + if ($2[16] !== error42.message) { t9 = /* @__PURE__ */ jsx_dev_runtime495.jsxDEV(ThemedText, { dimColor: true, - children: error46.message + children: error42.message }, undefined, false, undefined, this); - $2[16] = error46.message; + $2[16] = error42.message; $2[17] = t9; } else { t9 = $2[17]; @@ -763570,18 +686136,18 @@ function TeleportRepoMismatchDialog(t0) { } return t4; } -function _temp373(path30) { +function _temp373(path25) { return { label: /* @__PURE__ */ jsx_dev_runtime496.jsxDEV(ThemedText, { children: [ "Use ", /* @__PURE__ */ jsx_dev_runtime496.jsxDEV(ThemedText, { bold: true, - children: getDisplayPath(path30) + children: getDisplayPath(path25) }, undefined, false, undefined, this) ] }, undefined, true, undefined, this), - value: path30 + value: path25 }; } var import_compiler_runtime390, import_react337, jsx_dev_runtime496; @@ -763602,7 +686168,7 @@ var exports_ResumeConversation = {}; __export(exports_ResumeConversation, { ResumeConversation: () => ResumeConversation }); -import { dirname as dirname72 } from "path"; +import { dirname as dirname68 } from "path"; function parsePrIdentifier(value) { const directNumber = parseInt(value, 10); if (!isNaN(directNumber) && directNumber > 0) { @@ -763648,20 +686214,20 @@ function ResumeConversation({ const sessionLogResultRef = import_react338.default.useRef(null); const logCountRef = import_react338.default.useRef(0); const filteredLogs = import_react338.default.useMemo(() => { - let result3 = logs2.filter((l) => !l.isSidechain); + let result2 = logs2.filter((l) => !l.isSidechain); if (filterByPr !== undefined) { if (filterByPr === true) { - result3 = result3.filter((l_0) => l_0.prNumber !== undefined); + result2 = result2.filter((l_0) => l_0.prNumber !== undefined); } else if (typeof filterByPr === "number") { - result3 = result3.filter((l_1) => l_1.prNumber === filterByPr); + result2 = result2.filter((l_1) => l_1.prNumber === filterByPr); } else if (typeof filterByPr === "string") { const prNumber = parsePrIdentifier(filterByPr); if (prNumber !== null) { - result3 = result3.filter((l_2) => l_2.prNumber === prNumber); + result2 = result2.filter((l_2) => l_2.prNumber === prNumber); } } } - return result3; + return result2; }, [logs2, filterByPr]); const isResumeWithRenameEnabled = isCustomTitleEnabled(); import_react338.default.useEffect(() => { @@ -763670,8 +686236,8 @@ function ResumeConversation({ logCountRef.current = result_0.logs.length; setLogs(result_0.logs); setLoading(false); - }).catch((error46) => { - logError2(error46); + }).catch((error42) => { + logError2(error42); setLoading(false); }); }, [worktreePaths]); @@ -763683,8 +686249,8 @@ function ResumeConversation({ ref.nextIndex = result_1.nextIndex; if (result_1.logs.length > 0) { const offset = logCountRef.current; - result_1.logs.forEach((log3, i4) => { - log3.value = offset + i4; + result_1.logs.forEach((log2, i3) => { + log2.value = offset + i3; }); setLogs((prev) => prev.concat(result_1.logs)); logCountRef.current += result_1.logs.length; @@ -763754,7 +686320,7 @@ function ResumeConversation({ } } if (result_3.sessionId && !forkSession) { - switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname72(log_0.fullPath) : null); + switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname68(log_0.fullPath) : null); await renameRecordingForSession(); await resetSessionFilePointer(); restoreCostStateForSession(result_3.sessionId); @@ -764027,7 +686593,7 @@ var init_ResumeConversation = __esm(() => { init_conversationRecovery(); init_crossProjectResume(); init_log3(); - init_messages5(); + init_messages3(); init_sessionRestore(); init_sessionStorage(); init_REPL(); @@ -764035,11 +686601,11 @@ var init_ResumeConversation = __esm(() => { }); // src/dialogLaunchers.tsx -async function launchSnapshotUpdateDialog(root3, props) { +async function launchSnapshotUpdateDialog(root2, props) { const { SnapshotUpdateDialog: SnapshotUpdateDialog2 } = await Promise.resolve().then(() => (init_SnapshotUpdateDialog(), exports_SnapshotUpdateDialog)); - return showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(SnapshotUpdateDialog2, { + return showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(SnapshotUpdateDialog2, { agentType: props.agentType, scope: props.scope, snapshotTimestamp: props.snapshotTimestamp, @@ -764047,37 +686613,37 @@ async function launchSnapshotUpdateDialog(root3, props) { onCancel: () => done("keep") }, undefined, false, undefined, this)); } -async function launchInvalidSettingsDialog(root3, props) { +async function launchInvalidSettingsDialog(root2, props) { const { InvalidSettingsDialog: InvalidSettingsDialog2 } = await Promise.resolve().then(() => (init_InvalidSettingsDialog(), exports_InvalidSettingsDialog)); - return showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(InvalidSettingsDialog2, { + return showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(InvalidSettingsDialog2, { settingsErrors: props.settingsErrors, onContinue: done, onExit: props.onExit }, undefined, false, undefined, this)); } -async function launchAssistantSessionChooser(root3, props) { +async function launchAssistantSessionChooser(root2, props) { const { AssistantSessionChooser } = await Promise.resolve().then(() => (init_AssistantSessionChooser(), exports_AssistantSessionChooser)); - return showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(AssistantSessionChooser, { + return showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(AssistantSessionChooser, { sessions: props.sessions, onSelect: (id) => done(id), onCancel: () => done(null) }, undefined, false, undefined, this)); } -async function launchAssistantInstallWizard(root3) { +async function launchAssistantInstallWizard(root2) { const { NewInstallWizard, computeDefaultInstallDir } = await Promise.resolve().then(() => (init_assistant2(), exports_assistant3)); const defaultDir = await computeDefaultInstallDir(); let rejectWithError; - const errorPromise = new Promise((_, reject3) => { - rejectWithError = reject3; + const errorPromise = new Promise((_, reject2) => { + rejectWithError = reject2; }); - const resultPromise = showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(NewInstallWizard, { + const resultPromise = showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(NewInstallWizard, { defaultDir, onInstalled: (dir) => done(dir), onCancel: () => done(null), @@ -764085,34 +686651,34 @@ async function launchAssistantInstallWizard(root3) { }, undefined, false, undefined, this)); return Promise.race([resultPromise, errorPromise]); } -async function launchTeleportResumeWrapper(root3) { +async function launchTeleportResumeWrapper(root2) { const { TeleportResumeWrapper: TeleportResumeWrapper2 } = await Promise.resolve().then(() => (init_TeleportResumeWrapper(), exports_TeleportResumeWrapper)); - return showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(TeleportResumeWrapper2, { + return showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(TeleportResumeWrapper2, { onComplete: done, onCancel: () => done(null), source: "cliArg" }, undefined, false, undefined, this)); } -async function launchTeleportRepoMismatchDialog(root3, props) { +async function launchTeleportRepoMismatchDialog(root2, props) { const { TeleportRepoMismatchDialog: TeleportRepoMismatchDialog2 } = await Promise.resolve().then(() => (init_TeleportRepoMismatchDialog(), exports_TeleportRepoMismatchDialog)); - return showSetupDialog(root3, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(TeleportRepoMismatchDialog2, { + return showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(TeleportRepoMismatchDialog2, { targetRepo: props.targetRepo, initialPaths: props.initialPaths, onSelectPath: done, onCancel: () => done(null) }, undefined, false, undefined, this)); } -async function launchResumeChooser(root3, appProps, worktreePathsPromise, resumeProps) { +async function launchResumeChooser(root2, appProps, worktreePathsPromise, resumeProps) { const [worktreePaths, { ResumeConversation: ResumeConversation2 }, { App: App3 }] = await Promise.all([worktreePathsPromise, Promise.resolve().then(() => (init_ResumeConversation(), exports_ResumeConversation)), Promise.resolve().then(() => (init_App2(), exports_App))]); - await renderAndRun(root3, /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(App3, { + await renderAndRun(root2, /* @__PURE__ */ jsx_dev_runtime498.jsxDEV(App3, { getFpsMetrics: appProps.getFpsMetrics, stats: appProps.stats, initialState: appProps.initialState, @@ -764135,10 +686701,10 @@ var init_dialogLaunchers = __esm(() => { function initBuiltinPlugins() {} // src/services/plugins/pluginCliCommands.ts -function handlePluginCommandError(error46, command8, plugin2) { - logError2(error46); +function handlePluginCommandError(error42, command8, plugin2) { + logError2(error42); const operation = plugin2 ? `${command8} plugin "${plugin2}"` : command8 === "disable-all" ? "disable all plugins" : `${command8} plugins`; - console.error(`${figures_default.cross} Failed to ${operation}: ${errorMessage(error46)}`); + console.error(`${figures_default.cross} Failed to ${operation}: ${errorMessage(error42)}`); const telemetryFields = plugin2 ? (() => { const { name, marketplace } = parsePluginIdentifier(plugin2); return { @@ -764151,7 +686717,7 @@ function handlePluginCommandError(error46, command8, plugin2) { })() : {}; logEvent("tengu_plugin_command_failed", { command: command8, - error_category: classifyPluginCommandError(error46), + error_category: classifyPluginCommandError(error42), ...telemetryFields }); process.exit(1); @@ -764159,127 +686725,127 @@ function handlePluginCommandError(error46, command8, plugin2) { async function installPlugin(plugin2, scope = "user") { try { console.log(`Installing plugin "${plugin2}"...`); - const result3 = await installPluginOp(plugin2, scope); - if (!result3.success) { - throw new Error(result3.message); + const result2 = await installPluginOp(plugin2, scope); + if (!result2.success) { + throw new Error(result2.message); } - console.log(`${figures_default.tick} ${result3.message}`); - const { name, marketplace } = parsePluginIdentifier(result3.pluginId || plugin2); + console.log(`${figures_default.tick} ${result2.message}`); + const { name, marketplace } = parsePluginIdentifier(result2.pluginId || plugin2); logEvent("tengu_plugin_installed_cli", { _PROTO_plugin_name: name, ...marketplace && { _PROTO_marketplace_name: marketplace }, - scope: result3.scope || scope, + scope: result2.scope || scope, install_source: "cli-explicit", ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()) }); process.exit(0); - } catch (error46) { - handlePluginCommandError(error46, "install", plugin2); + } catch (error42) { + handlePluginCommandError(error42, "install", plugin2); } } async function uninstallPlugin(plugin2, scope = "user", keepData = false) { try { - const result3 = await uninstallPluginOp(plugin2, scope, !keepData); - if (!result3.success) { - throw new Error(result3.message); + const result2 = await uninstallPluginOp(plugin2, scope, !keepData); + if (!result2.success) { + throw new Error(result2.message); } - console.log(`${figures_default.tick} ${result3.message}`); - const { name, marketplace } = parsePluginIdentifier(result3.pluginId || plugin2); + console.log(`${figures_default.tick} ${result2.message}`); + const { name, marketplace } = parsePluginIdentifier(result2.pluginId || plugin2); logEvent("tengu_plugin_uninstalled_cli", { _PROTO_plugin_name: name, ...marketplace && { _PROTO_marketplace_name: marketplace }, - scope: result3.scope || scope, + scope: result2.scope || scope, ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()) }); process.exit(0); - } catch (error46) { - handlePluginCommandError(error46, "uninstall", plugin2); + } catch (error42) { + handlePluginCommandError(error42, "uninstall", plugin2); } } async function enablePlugin(plugin2, scope) { try { - const result3 = await enablePluginOp(plugin2, scope); - if (!result3.success) { - throw new Error(result3.message); + const result2 = await enablePluginOp(plugin2, scope); + if (!result2.success) { + throw new Error(result2.message); } - console.log(`${figures_default.tick} ${result3.message}`); - const { name, marketplace } = parsePluginIdentifier(result3.pluginId || plugin2); + console.log(`${figures_default.tick} ${result2.message}`); + const { name, marketplace } = parsePluginIdentifier(result2.pluginId || plugin2); logEvent("tengu_plugin_enabled_cli", { _PROTO_plugin_name: name, ...marketplace && { _PROTO_marketplace_name: marketplace }, - scope: result3.scope, + scope: result2.scope, ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()) }); process.exit(0); - } catch (error46) { - handlePluginCommandError(error46, "enable", plugin2); + } catch (error42) { + handlePluginCommandError(error42, "enable", plugin2); } } async function disablePlugin(plugin2, scope) { try { - const result3 = await disablePluginOp(plugin2, scope); - if (!result3.success) { - throw new Error(result3.message); + const result2 = await disablePluginOp(plugin2, scope); + if (!result2.success) { + throw new Error(result2.message); } - console.log(`${figures_default.tick} ${result3.message}`); - const { name, marketplace } = parsePluginIdentifier(result3.pluginId || plugin2); + console.log(`${figures_default.tick} ${result2.message}`); + const { name, marketplace } = parsePluginIdentifier(result2.pluginId || plugin2); logEvent("tengu_plugin_disabled_cli", { _PROTO_plugin_name: name, ...marketplace && { _PROTO_marketplace_name: marketplace }, - scope: result3.scope, + scope: result2.scope, ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()) }); process.exit(0); - } catch (error46) { - handlePluginCommandError(error46, "disable", plugin2); + } catch (error42) { + handlePluginCommandError(error42, "disable", plugin2); } } async function disableAllPlugins() { try { - const result3 = await disableAllPluginsOp(); - if (!result3.success) { - throw new Error(result3.message); + const result2 = await disableAllPluginsOp(); + if (!result2.success) { + throw new Error(result2.message); } - console.log(`${figures_default.tick} ${result3.message}`); + console.log(`${figures_default.tick} ${result2.message}`); logEvent("tengu_plugin_disabled_all_cli", {}); process.exit(0); - } catch (error46) { - handlePluginCommandError(error46, "disable-all"); + } catch (error42) { + handlePluginCommandError(error42, "disable-all"); } } async function updatePluginCli(plugin2, scope) { try { writeToStdout(`Checking for updates for plugin "${plugin2}" at ${scope} scope… `); - const result3 = await updatePluginOp(plugin2, scope); - if (!result3.success) { - throw new Error(result3.message); + const result2 = await updatePluginOp(plugin2, scope); + if (!result2.success) { + throw new Error(result2.message); } - writeToStdout(`${figures_default.tick} ${result3.message} + writeToStdout(`${figures_default.tick} ${result2.message} `); - if (!result3.alreadyUpToDate) { - const { name, marketplace } = parsePluginIdentifier(result3.pluginId || plugin2); + if (!result2.alreadyUpToDate) { + const { name, marketplace } = parsePluginIdentifier(result2.pluginId || plugin2); logEvent("tengu_plugin_updated_cli", { _PROTO_plugin_name: name, ...marketplace && { _PROTO_marketplace_name: marketplace }, - old_version: result3.oldVersion || "unknown", - new_version: result3.newVersion || "unknown", + old_version: result2.oldVersion || "unknown", + new_version: result2.newVersion || "unknown", ...buildPluginTelemetryFields(name, marketplace, getManagedPluginNames()) }); } await gracefulShutdown(0); - } catch (error46) { - handlePluginCommandError(error46, "update", plugin2); + } catch (error42) { + handlePluginCommandError(error42, "update", plugin2); } } var init_pluginCliCommands = __esm(() => { @@ -764434,14 +687000,14 @@ Now that this skill is invoked, you have access to Chrome browser automation too IMPORTANT: Start by calling mcp__claude-in-chrome__tabs_context_mcp to get information about the user's current browser tabs. `; var init_claudeInChrome = __esm(() => { - init_src2(); + init_claude_for_chrome_mcp(); init_setup2(); init_bundledSkills(); CLAUDE_IN_CHROME_MCP_TOOLS = BROWSER_TOOLS.map((tool) => `mcp__claude-in-chrome__${tool.name}`); }); // src/skills/bundled/debug.ts -import { open as open17, stat as stat53 } from "fs/promises"; +import { open as open17, stat as stat52 } from "fs/promises"; function registerDebugSkill() { registerBundledSkill({ name: "debug", @@ -764455,16 +687021,16 @@ function registerDebugSkill() { const debugLogPath = getDebugLogPath(); let logInfo; try { - const stats2 = await stat53(debugLogPath); + const stats2 = await stat52(debugLogPath); const readSize = Math.min(stats2.size, TAIL_READ_BYTES); const startOffset = stats2.size - readSize; - const fd3 = await open17(debugLogPath, "r"); + const fd2 = await open17(debugLogPath, "r"); try { - const { buffer, bytesRead } = await fd3.read({ + const { buffer, bytesRead } = await fd2.read({ buffer: Buffer.alloc(readSize), position: startOffset }); - const tail3 = buffer.toString("utf-8", 0, bytesRead).split(` + const tail2 = buffer.toString("utf-8", 0, bytesRead).split(` `).slice(-DEFAULT_DEBUG_LINES_READ).join(` `); logInfo = `Log size: ${formatFileSize(stats2.size)} @@ -764472,10 +687038,10 @@ function registerDebugSkill() { ### Last ${DEFAULT_DEBUG_LINES_READ} lines \`\`\` -${tail3} +${tail2} \`\`\``; } finally { - await fd3.close(); + await fd2.close(); } } catch (e) { logInfo = isENOENT(e) ? "No debug log exists yet — logging was just enabled." : `Failed to read last ${DEFAULT_DEBUG_LINES_READ} lines of debug log: ${errorMessage(e)}`; @@ -764701,9 +687267,9 @@ function generateActionsTable() { } return markdownTable(["Action", "Default Key(s)", "Context"], KEYBINDING_ACTIONS.map((action2) => { const info = actionInfo[action2]; - const keys3 = info ? info.keys.map((k) => `\`${k}\``).join(", ") : "(none)"; + const keys2 = info ? info.keys.map((k) => `\`${k}\``).join(", ") : "(none)"; const context2 = info ? info.context : inferContextFromAction(action2); - return [`\`${action2}\``, keys3, context2]; + return [`\`${action2}\``, keys2, context2]; })); } function inferContextFromAction(action2) { @@ -764983,28 +687549,28 @@ var init_keybindings3 = __esm(() => { // src/skills/bundled/loremIpsum.ts function generateLoremIpsum(targetTokens) { let tokens = 0; - let result3 = ""; + let result2 = ""; while (tokens < targetTokens) { const sentenceLength = 10 + Math.floor(Math.random() * 11); let wordsInSentence = 0; - for (let i4 = 0;i4 < sentenceLength && tokens < targetTokens; i4++) { + for (let i3 = 0;i3 < sentenceLength && tokens < targetTokens; i3++) { const word = ONE_TOKEN_WORDS[Math.floor(Math.random() * ONE_TOKEN_WORDS.length)]; - result3 += word; + result2 += word; tokens++; wordsInSentence++; - if (i4 === sentenceLength - 1 || tokens >= targetTokens) { - result3 += ". "; + if (i3 === sentenceLength - 1 || tokens >= targetTokens) { + result2 += ". "; } else { - result3 += " "; + result2 += " "; } } if (wordsInSentence > 0 && Math.random() < 0.2 && tokens < targetTokens) { - result3 += ` + result2 += ` `; } } - return result3.trim(); + return result2.trim(); } function registerLoremIpsumSkill() { if (process.env.USER_TYPE !== "ant") { @@ -765407,7 +687973,7 @@ function extractUserMessages(messages) { return content; return content.filter((b) => b.type === "text").map((b) => b.text).join(` `); - }).filter((text2) => text2.trim().length > 0); + }).filter((text) => text.trim().length > 0); } function registerSkillifySkill() { if (process.env.USER_TYPE !== "ant") { @@ -765578,7 +688144,7 @@ After writing, tell the user: `; var init_skillify = __esm(() => { init_sessionMemoryUtils(); - init_messages5(); + init_messages3(); init_bundledSkills(); }); @@ -766190,9 +688756,9 @@ var init_verify = __esm(() => { var exports_dream = {}; __export(exports_dream, { default: () => dream_default, - __stub__: () => __stub__34 + __stub__: () => __stub__41 }); -var dream_default, __stub__34 = true; +var dream_default, __stub__41 = true; var init_dream = __esm(() => { dream_default = {}; }); @@ -766201,9 +688767,9 @@ var init_dream = __esm(() => { var exports_hunter = {}; __export(exports_hunter, { default: () => hunter_default, - __stub__: () => __stub__35 + __stub__: () => __stub__42 }); -var hunter_default, __stub__35 = true; +var hunter_default, __stub__42 = true; var init_hunter = __esm(() => { hunter_default = {}; }); @@ -766307,8 +688873,8 @@ function taggedIdToUUID(taggedId) { if (!taggedId.startsWith(prefix)) { return null; } - const rest3 = taggedId.slice(prefix.length); - const base58Data = rest3.slice(2); + const rest2 = taggedId.slice(prefix.length); + const base58Data = rest2.slice(2); let n3 = 0n; for (const c6 of base58Data) { const idx = BASE58.indexOf(c6); @@ -766322,21 +688888,21 @@ function taggedIdToUUID(taggedId) { } function getConnectedClaudeAIConnectors(mcpClients) { const connectors = []; - for (const client5 of mcpClients) { - if (client5.type !== "connected") { + for (const client2 of mcpClients) { + if (client2.type !== "connected") { continue; } - if (client5.config.type !== "claudeai-proxy") { + if (client2.config.type !== "claudeai-proxy") { continue; } - const uuid8 = taggedIdToUUID(client5.config.id); - if (!uuid8) { + const uuid5 = taggedIdToUUID(client2.config.id); + if (!uuid5) { continue; } connectors.push({ - uuid: uuid8, - name: client5.name, - url: client5.config.url + uuid: uuid5, + name: client2.name, + url: client2.config.url }); } return connectors; @@ -766573,8 +689139,8 @@ function registerScheduleRemoteAgentsSkill() { let environments; try { environments = await fetchEnvironments(); - } catch (err3) { - logForDebugging(`[schedule] Failed to fetch environments: ${err3}`, { + } catch (err2) { + logForDebugging(`[schedule] Failed to fetch environments: ${err2}`, { level: "warn" }); return [ @@ -766589,8 +689155,8 @@ function registerScheduleRemoteAgentsSkill() { try { createdEnvironment = await createDefaultCloudEnvironment("claude-code-default"); environments = [createdEnvironment]; - } catch (err3) { - logForDebugging(`[schedule] Failed to create environment: ${err3}`, { + } catch (err2) { + logForDebugging(`[schedule] Failed to create environment: ${err2}`, { level: "warn" }); return [ @@ -766623,8 +689189,8 @@ function registerScheduleRemoteAgentsSkill() { const connectorsInfo = formatConnectorsInfo(connectors); const gitRepoUrl = await getCurrentRepoHttpsUrl(); const lines = ["Available environments:"]; - for (const env5 of environments) { - lines.push(`- ${env5.name} (id: ${env5.environment_id}, kind: ${env5.kind})`); + for (const env4 of environments) { + lines.push(`- ${env4.name} (id: ${env4.environment_id}, kind: ${env4.kind})`); } const environmentsInfo = lines.join(` `); @@ -766647,7 +689213,7 @@ var init_scheduleRemoteAgents = __esm(() => { init_growthbook(); init_policyLimits(); init_prompt9(); - init_auth2(); + init_auth(); init_preconditions(); init_debug(); init_detectRepository(); @@ -766813,7 +689379,7 @@ async function detectLanguage2() { return null; } function getFilesForLanguage(lang, content) { - return Object.keys(content.SKILL_FILES).filter((path30) => path30.startsWith(`${lang}/`) || path30.startsWith("shared/")); + return Object.keys(content.SKILL_FILES).filter((path25) => path25.startsWith(`${lang}/`) || path25.startsWith("shared/")); } function processContent(md, content) { let out = md; @@ -766944,9 +689510,9 @@ var init_claudeApi = __esm(() => { var exports_runSkillGenerator = {}; __export(exports_runSkillGenerator, { default: () => runSkillGenerator_default, - __stub__: () => __stub__36 + __stub__: () => __stub__43 }); -var runSkillGenerator_default, __stub__36 = true; +var runSkillGenerator_default, __stub__43 = true; var init_runSkillGenerator = __esm(() => { runSkillGenerator_default = {}; }); @@ -767010,9 +689576,9 @@ var init_bundled2 = __esm(() => { }); // src/utils/deepLink/banner.ts -import { stat as stat54 } from "fs/promises"; -import { homedir as homedir42 } from "os"; -import { join as join173, sep as sep42 } from "path"; +import { stat as stat53 } from "fs/promises"; +import { homedir as homedir40 } from "os"; +import { join as join163, sep as sep39 } from "path"; function buildDeepLinkBanner(info) { const lines = [ `This session was opened by an external deep link in ${tildify(info.cwd)}` @@ -767034,8 +689600,8 @@ async function readLastFetchTime(cwd2) { return; const commonDir = await getCommonDir(gitDir); const [local, common2] = await Promise.all([ - mtimeOrUndefined(join173(gitDir, "FETCH_HEAD")), - commonDir ? mtimeOrUndefined(join173(commonDir, "FETCH_HEAD")) : Promise.resolve(undefined) + mtimeOrUndefined(join163(gitDir, "FETCH_HEAD")), + commonDir ? mtimeOrUndefined(join163(commonDir, "FETCH_HEAD")) : Promise.resolve(undefined) ]); if (local && common2) return local > common2 ? local : common2; @@ -767043,17 +689609,17 @@ async function readLastFetchTime(cwd2) { } async function mtimeOrUndefined(p) { try { - const { mtime } = await stat54(p); + const { mtime } = await stat53(p); return mtime; } catch { return; } } function tildify(p) { - const home = homedir42(); + const home = homedir40(); if (p === home) return "~"; - if (p.startsWith(home + sep42)) + if (p.startsWith(home + sep39)) return "~" + p.slice(home.length); return p; } @@ -767229,23 +689795,23 @@ Warning: The command "${actualCommand}" looks like a URL, but is being interpret process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${name} ${actualCommand} `); } - const env5 = parseEnvVars(options2.env); - await addMcpConfig(name, { type: "stdio", command: actualCommand, args: actualArgs, env: env5 }, scope); + const env4 = parseEnvVars(options2.env); + await addMcpConfig(name, { type: "stdio", command: actualCommand, args: actualArgs, env: env4 }, scope); process.stdout.write(`Added stdio MCP server ${name} with command: ${actualCommand} ${actualArgs.join(" ")} to ${scope} config `); } cliOk(`File modified: ${describeMcpConfigFilePath(scope)}`); - } catch (error46) { - cliError(error46.message); + } catch (error42) { + cliError(error42.message); } }); } var init_addCommand = __esm(() => { - init_esm8(); + init_esm7(); init_analytics(); - init_auth7(); + init_auth6(); init_config3(); - init_utils4(); + init_utils3(); init_xaaIdpLogin(); init_envUtils(); init_slowOperations(); @@ -767275,15 +689841,15 @@ function registerMcpXaaIdpCommand(mcp2) { const old = getXaaIdpSettings(); const oldIssuer = old?.issuer; const oldClientId = old?.clientId; - const { error: error46 } = updateSettingsForSource("userSettings", { + const { error: error42 } = updateSettingsForSource("userSettings", { xaaIdp: { issuer: options2.issuer, clientId: options2.clientId, callbackPort } }); - if (error46) { - return cliError(`Error writing settings: ${error46.message}`); + if (error42) { + return cliError(`Error writing settings: ${error42.message}`); } if (oldIssuer) { if (issuerKey(oldIssuer) !== issuerKey(options2.issuer)) { @@ -767360,11 +689926,11 @@ function registerMcpXaaIdpCommand(mcp2) { }); xaaIdp.command("clear").description("Clear the IdP connection config and cached id_token").action(() => { const idp = getXaaIdpSettings(); - const { error: error46 } = updateSettingsForSource("userSettings", { + const { error: error42 } = updateSettingsForSource("userSettings", { xaaIdp: undefined }); - if (error46) { - return cliError(`Error writing settings: ${error46.message}`); + if (error42) { + return cliError(`Error writing settings: ${error42.message}`); } if (idp) { clearIdpIdToken(idp.issuer); @@ -767381,13 +689947,13 @@ var init_xaaIdpCommand = __esm(() => { // src/utils/cliArgs.ts function eagerParseCliFlag(flagName, argv = process.argv) { - for (let i4 = 0;i4 < argv.length; i4++) { - const arg = argv[i4]; + for (let i3 = 0;i3 < argv.length; i3++) { + const arg = argv[i3]; if (arg?.startsWith(`${flagName}=`)) { return arg.slice(flagName.length + 1); } - if (arg === flagName && i4 + 1 < argv.length) { - return argv[i4 + 1]; + if (arg === flagName && i3 + 1 < argv.length) { + return argv[i3 + 1]; } } return; @@ -767421,8 +689987,8 @@ function migrateAutoUpdatesToSettings() { } = current; return updatedConfig; }); - } catch (error46) { - logError2(new Error(`Failed to migrate auto-updates: ${error46}`)); + } catch (error42) { + logError2(new Error(`Failed to migrate auto-updates: ${error42}`)); logEvent("tengu_migrate_autoupdates_error", { has_error: true }); @@ -767454,8 +690020,8 @@ function migrateBypassPermissionsAcceptedToSettings() { const { bypassPermissionsModeAccepted: _, ...updatedConfig } = current; return updatedConfig; }); - } catch (error46) { - logError2(new Error(`Failed to migrate bypass permissions accepted: ${error46}`)); + } catch (error42) { + logError2(new Error(`Failed to migrate bypass permissions accepted: ${error42}`)); } } var init_migrateBypassPermissionsAcceptedToSettings = __esm(() => { @@ -767606,8 +690172,8 @@ var init_migrateReplBridgeEnabledToRemoteControlAtStartup = __esm(() => { // src/migrations/migrateSonnet1mToSonnet45.ts function migrateSonnet1mToSonnet45() { - const config6 = getGlobalConfig(); - if (config6.sonnet1m45MigrationComplete) { + const config4 = getGlobalConfig(); + if (config4.sonnet1m45MigrationComplete) { return; } const model = getSettingsForSource("userSettings")?.model; @@ -767647,8 +690213,8 @@ function migrateSonnet45ToSonnet46() { updateSettingsForSource("userSettings", { model: has1m ? "sonnet[1m]" : "sonnet" }); - const config6 = getGlobalConfig(); - if (config6.numStartups > 1) { + const config4 = getGlobalConfig(); + if (config4.numStartups > 1) { saveGlobalConfig((current) => ({ ...current, sonnet45To46MigrationTimestamp: Date.now() @@ -767661,7 +690227,7 @@ function migrateSonnet45ToSonnet46() { } var init_migrateSonnet45ToSonnet46 = __esm(() => { init_analytics(); - init_auth2(); + init_auth(); init_config2(); init_providers(); init_settings2(); @@ -767670,8 +690236,8 @@ var init_migrateSonnet45ToSonnet46 = __esm(() => { // src/migrations/resetAutoModeOptInForDefaultOffer.ts function resetAutoModeOptInForDefaultOffer() { if (feature("TRANSCRIPT_CLASSIFIER")) { - const config6 = getGlobalConfig(); - if (config6.hasResetAutoModeOptInForDefaultOffer) + const config4 = getGlobalConfig(); + if (config4.hasResetAutoModeOptInForDefaultOffer) return; if (getAutoModeEnabledState() !== "enabled") return; @@ -767688,8 +690254,8 @@ function resetAutoModeOptInForDefaultOffer() { return c6; return { ...c6, hasResetAutoModeOptInForDefaultOffer: true }; }); - } catch (error46) { - logError2(new Error(`Failed to reset auto mode opt-in: ${error46}`)); + } catch (error42) { + logError2(new Error(`Failed to reset auto mode opt-in: ${error42}`)); } } } @@ -767704,8 +690270,8 @@ var init_resetAutoModeOptInForDefaultOffer = __esm(() => { // src/migrations/resetProToOpusDefault.ts function resetProToOpusDefault() { - const config6 = getGlobalConfig(); - if (config6.opusProMigrationComplete) { + const config4 = getGlobalConfig(); + if (config4.opusProMigrationComplete) { return; } const apiProvider = getAPIProvider(); @@ -767742,7 +690308,7 @@ function resetProToOpusDefault() { } var init_resetProToOpusDefault = __esm(() => { init_analytics(); - init_auth2(); + init_auth(); init_config2(); init_providers(); init_settings2(); @@ -767750,7 +690316,7 @@ var init_resetProToOpusDefault = __esm(() => { // src/server/types.ts var connectResponseSchema; -var init_types20 = __esm(() => { +var init_types19 = __esm(() => { init_v4(); connectResponseSchema = lazySchema(() => exports_external.object({ session_id: exports_external.string(), @@ -767784,17 +690350,17 @@ async function createDirectConnectSession({ } }) }); - } catch (err3) { - throw new DirectConnectError(`Failed to connect to server at ${serverUrl}: ${errorMessage(err3)}`); + } catch (err2) { + throw new DirectConnectError(`Failed to connect to server at ${serverUrl}: ${errorMessage(err2)}`); } if (!resp.ok) { throw new DirectConnectError(`Failed to create session: ${resp.status} ${resp.statusText}`); } - const result3 = connectResponseSchema().safeParse(await resp.json()); - if (!result3.success) { - throw new DirectConnectError(`Invalid session response: ${result3.error.message}`); + const result2 = connectResponseSchema().safeParse(await resp.json()); + if (!result2.success) { + throw new DirectConnectError(`Invalid session response: ${result2.error.message}`); } - const data = result3.data; + const data = result2.data; return { config: { serverUrl, @@ -767809,7 +690375,7 @@ var DirectConnectError; var init_createDirectConnectSession = __esm(() => { init_errors(); init_slowOperations(); - init_types20(); + init_types19(); DirectConnectError = class DirectConnectError extends Error { constructor(message) { super(message); @@ -767833,16 +690399,16 @@ var init_gate = __esm(() => { var exports_parseConnectUrl = {}; __export(exports_parseConnectUrl, { default: () => parseConnectUrl_default, - __stub__: () => __stub__37 + __stub__: () => __stub__44 }); -var parseConnectUrl_default, __stub__37 = true; +var parseConnectUrl_default, __stub__44 = true; var init_parseConnectUrl = __esm(() => { parseConnectUrl_default = {}; }); // src/utils/deepLink/terminalLauncher.ts -import { spawn as spawn15 } from "child_process"; -import { basename as basename63 } from "path"; +import { spawn as spawn12 } from "child_process"; +import { basename as basename61 } from "path"; async function detectMacosTerminal() { const stored = getGlobalConfig().deepLinkTerminal; if (stored) { @@ -767878,7 +690444,7 @@ async function detectLinuxTerminal() { if (termEnv) { const resolved = await which(termEnv); if (resolved) { - return { name: basename63(termEnv), command: resolved }; + return { name: basename61(termEnv), command: resolved }; } } const xte = await which("x-terminal-emulator"); @@ -768097,22 +690663,22 @@ async function launchWindowsTerminal(terminal, claudePath, claudeArgs, cwd2) { }); } function spawnDetached(command8, args, opts = {}) { - return new Promise((resolve49) => { - const child = spawn15(command8, args, { + return new Promise((resolve43) => { + const child = spawn12(command8, args, { detached: true, stdio: "ignore", cwd: opts.cwd, windowsVerbatimArguments: opts.windowsVerbatimArguments }); - child.once("error", (err3) => { - logForDebugging(`Failed to spawn ${command8}: ${err3.message}`, { + child.once("error", (err2) => { + logForDebugging(`Failed to spawn ${command8}: ${err2.message}`, { level: "error" }); - resolve49(false); + resolve43(false); }); child.once("spawn", () => { child.unref(); - resolve49(true); + resolve43(true); }); }); } @@ -768172,14 +690738,14 @@ __export(exports_protocolHandler, { handleUrlSchemeLaunch: () => handleUrlSchemeLaunch, handleDeepLinkUri: () => handleDeepLinkUri }); -import { homedir as homedir43 } from "os"; +import { homedir as homedir41 } from "os"; async function handleDeepLinkUri(uri) { logForDebugging(`Handling deep link URI: ${uri}`); let action2; try { action2 = parseDeepLink(uri); - } catch (error46) { - const message = error46 instanceof Error ? error46.message : String(error46); + } catch (error42) { + const message = error42 instanceof Error ? error42.message : String(error42); console.error(`Deep link error: ${message}`); return 1; } @@ -768226,7 +690792,7 @@ async function resolveCwd(action2) { } logForDebugging(`No local clone found for repo ${action2.repo}, falling back to home`); } - return { cwd: homedir43() }; + return { cwd: homedir41() }; } var init_protocolHandler = __esm(() => { init_debug(); @@ -768243,12 +690809,12 @@ var exports_setup = {}; __export(exports_setup, { setupComputerUseMCP: () => setupComputerUseMCP }); -import { join as join174 } from "path"; -import { fileURLToPath as fileURLToPath8 } from "url"; +import { join as join164 } from "path"; +import { fileURLToPath as fileURLToPath7 } from "url"; function setupComputerUseMCP() { const allowedTools = buildComputerUseTools(CLI_CU_CAPABILITIES, getChicagoCoordinateMode()).map((t) => buildMcpToolName(COMPUTER_USE_MCP_SERVER_NAME, t.name)); const args = isInBundledMode() ? ["--computer-use-mcp"] : [ - join174(fileURLToPath8(import.meta.url), "..", "cli.js"), + join164(fileURLToPath7(import.meta.url), "..", "cli.js"), "--computer-use-mcp" ]; return { @@ -768271,7 +690837,7 @@ var init_setup3 = __esm(() => { }); // src/services/SessionMemory/sessionMemory.ts -import { writeFile as writeFile60 } from "fs/promises"; +import { writeFile as writeFile58 } from "fs/promises"; function isSessionMemoryGateEnabled() { return getFeatureValue_CACHED_MAY_BE_STALE("tengu_session_memory", false); } @@ -768320,18 +690886,18 @@ function shouldExtractMemory(messages) { return false; } async function setupSessionMemoryFile(toolUseContext) { - const fs14 = getFsImplementation(); + const fs8 = getFsImplementation(); const sessionMemoryDir = getSessionMemoryDir(); - await fs14.mkdir(sessionMemoryDir, { mode: 448 }); + await fs8.mkdir(sessionMemoryDir, { mode: 448 }); const memoryPath = getSessionMemoryPath(); try { - await writeFile60(memoryPath, "", { + await writeFile58(memoryPath, "", { encoding: "utf-8", mode: 384, flag: "wx" }); - const template3 = await loadSessionMemoryTemplate(); - await writeFile60(memoryPath, template3, { + const template2 = await loadSessionMemoryTemplate(); + await writeFile58(memoryPath, template2, { encoding: "utf-8", mode: 384 }); @@ -768342,9 +690908,9 @@ async function setupSessionMemoryFile(toolUseContext) { } } toolUseContext.readFileState.delete(memoryPath); - const result3 = await FileReadTool.call({ file_path: memoryPath }, toolUseContext); + const result2 = await FileReadTool.call({ file_path: memoryPath }, toolUseContext); let currentMemory = ""; - const output = result3.data; + const output = result2.data; if (output.type === "text") { currentMemory = output.file.content; } @@ -768368,11 +690934,11 @@ function initSessionMemory() { registerPostSamplingHook(extractSessionMemory); } function createMemoryFileCanUseTool(memoryPath) { - return async (tool, input11) => { - if (tool.name === FILE_EDIT_TOOL_NAME && typeof input11 === "object" && input11 !== null && "file_path" in input11) { - const filePath = input11.file_path; + return async (tool, input) => { + if (tool.name === FILE_EDIT_TOOL_NAME && typeof input === "object" && input !== null && "file_path" in input) { + const filePath = input.file_path; if (typeof filePath === "string" && filePath === memoryPath) { - return { behavior: "allow", updatedInput: input11 }; + return { behavior: "allow", updatedInput: input }; } } return { @@ -768397,29 +690963,29 @@ var lastMemoryMessageUuid, initSessionMemoryConfigIfNeeded, hasLoggedGateFailure var init_sessionMemory = __esm(() => { init_memoize(); init_state(); - init_prompts5(); + init_prompts4(); init_context2(); init_FileReadTool(); init_forkedAgent(); init_fsOperations(); init_postSamplingHooks(); - init_messages5(); + init_messages3(); init_filesystem(); init_tokens(); init_analytics(); init_autoCompact(); - init_prompts3(); + init_prompts2(); init_sessionMemoryUtils(); init_errors(); init_growthbook(); initSessionMemoryConfigIfNeeded = memoize_default(() => { const remoteConfig = getSessionMemoryRemoteConfig(); - const config6 = { + const config4 = { minimumMessageTokensToInit: remoteConfig.minimumMessageTokensToInit && remoteConfig.minimumMessageTokensToInit > 0 ? remoteConfig.minimumMessageTokensToInit : DEFAULT_SESSION_MEMORY_CONFIG.minimumMessageTokensToInit, minimumTokensBetweenUpdate: remoteConfig.minimumTokensBetweenUpdate && remoteConfig.minimumTokensBetweenUpdate > 0 ? remoteConfig.minimumTokensBetweenUpdate : DEFAULT_SESSION_MEMORY_CONFIG.minimumTokensBetweenUpdate, toolCallsBetweenUpdates: remoteConfig.toolCallsBetweenUpdates && remoteConfig.toolCallsBetweenUpdates > 0 ? remoteConfig.toolCallsBetweenUpdates : DEFAULT_SESSION_MEMORY_CONFIG.toolCallsBetweenUpdates }; - setSessionMemoryConfig(config6); + setSessionMemoryConfig(config4); }); extractSessionMemory = sequential(async function(context2) { const { messages, toolUseContext, querySource } = context2; @@ -768451,15 +691017,15 @@ var init_sessionMemory = __esm(() => { }); const lastMessage = messages[messages.length - 1]; const usage = lastMessage ? getTokenUsage(lastMessage) : undefined; - const config6 = getSessionMemoryConfig(); + const config4 = getSessionMemoryConfig(); logEvent("tengu_session_memory_extraction", { input_tokens: usage?.input_tokens, output_tokens: usage?.output_tokens, cache_read_input_tokens: usage?.cache_read_input_tokens ?? undefined, cache_creation_input_tokens: usage?.cache_creation_input_tokens ?? undefined, - config_min_message_tokens_to_init: config6.minimumMessageTokensToInit, - config_min_tokens_between_update: config6.minimumTokensBetweenUpdate, - config_tool_calls_between_updates: config6.toolCallsBetweenUpdates + config_min_message_tokens_to_init: config4.minimumMessageTokensToInit, + config_min_tokens_between_update: config4.minimumTokensBetweenUpdate, + config_tool_calls_between_updates: config4.toolCallsBetweenUpdates }); recordExtractionTokenCount(tokenCountWithEstimation(messages)); updateLastSummarizedMessageIdIfSafe(messages); @@ -768468,9 +691034,9 @@ var init_sessionMemory = __esm(() => { }); // src/utils/iTermBackup.ts -import { copyFile as copyFile12, stat as stat55 } from "fs/promises"; -import { homedir as homedir44 } from "os"; -import { join as join175 } from "path"; +import { copyFile as copyFile11, stat as stat54 } from "fs/promises"; +import { homedir as homedir42 } from "os"; +import { join as join165 } from "path"; function markITerm2SetupComplete() { saveGlobalConfig((current) => ({ ...current, @@ -768478,14 +691044,14 @@ function markITerm2SetupComplete() { })); } function getIterm2RecoveryInfo() { - const config6 = getGlobalConfig(); + const config4 = getGlobalConfig(); return { - inProgress: config6.iterm2SetupInProgress ?? false, - backupPath: config6.iterm2BackupPath || null + inProgress: config4.iterm2SetupInProgress ?? false, + backupPath: config4.iterm2BackupPath || null }; } function getITerm2PlistPath() { - return join175(homedir44(), "Library", "Preferences", "com.googlecode.iterm2.plist"); + return join165(homedir42(), "Library", "Preferences", "com.googlecode.iterm2.plist"); } async function checkAndRestoreITerm2Backup() { const { inProgress, backupPath } = getIterm2RecoveryInfo(); @@ -768497,13 +691063,13 @@ async function checkAndRestoreITerm2Backup() { return { status: "no_backup" }; } try { - await stat55(backupPath); + await stat54(backupPath); } catch { markITerm2SetupComplete(); return { status: "no_backup" }; } try { - await copyFile12(backupPath, getITerm2PlistPath()); + await copyFile11(backupPath, getITerm2PlistPath()); markITerm2SetupComplete(); return { status: "restored" }; } catch (restoreError) { @@ -768558,8 +691124,8 @@ async function setup(cwd2, permissionMode, allowDangerouslySkipPermissions, work } else if (restoredTerminalBackup.status === "failed") { console.error(source_default.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${restoredTerminalBackup.backupPath}.`)); } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } setCwd(cwd2); @@ -768598,8 +691164,8 @@ async function setup(cwd2, permissionMode, allowDangerouslySkipPermissions, work let worktreeSession; try { worktreeSession = await createWorktreeForSession(getSessionId(), slug, tmuxSessionName, worktreePRNumber ? { prNumber: worktreePRNumber } : undefined); - } catch (error46) { - process.stderr.write(source_default.red(`Error creating worktree: ${errorMessage(error46)} + } catch (error42) { + process.stderr.write(source_default.red(`Error creating worktree: ${errorMessage(error42)} `)); process.exit(1); } @@ -768727,7 +691293,7 @@ var init_setup4 = __esm(() => { init_ids(); init_agentSwarmsEnabled(); init_appleTerminalBackup(); - init_auth2(); + init_auth(); init_claudemd(); init_config2(); init_diagLogs(); @@ -768750,10 +691316,10 @@ var init_setup4 = __esm(() => { }); // src/cli/transports/transportUtils.ts -import { URL as URL3 } from "url"; +import { URL as URL2 } from "url"; function getTransportForUrl(url3, headers = {}, sessionId, refreshHeaders) { if (isEnvTruthy(process.env.CLAUDE_CODE_USE_CCR_V2)) { - const sseUrl = new URL3(url3.href); + const sseUrl = new URL2(url3.href); if (sseUrl.protocol === "wss:") { sseUrl.protocol = "https:"; } else if (sseUrl.protocol === "ws:") { @@ -768780,7 +691346,7 @@ var init_transportUtils = __esm(() => { // src/cli/remoteIO.ts import { PassThrough as PassThrough4 } from "stream"; -import { URL as URL4 } from "url"; +import { URL as URL3 } from "url"; var RemoteIO; var init_remoteIO = __esm(() => { init_state(); @@ -768812,7 +691378,7 @@ var init_remoteIO = __esm(() => { const inputStream = new PassThrough4({ encoding: "utf8" }); super(inputStream, replayUserMessages); this.inputStream = inputStream; - this.url = new URL4(streamUrl); + this.url = new URL3(streamUrl); const headers = {}; const sessionToken = getSessionIngressAuthToken(); if (sessionToken) { @@ -768857,13 +691423,13 @@ var init_remoteIO = __esm(() => { throw new Error("CCR v2 requires SSETransport; check getTransportForUrl"); } this.ccrClient = new CCRClient(this.transport, this.url); - const init3 = this.ccrClient.initialize(); - this.restoredWorkerState = init3.catch(() => null); - init3.catch((error46) => { + const init2 = this.ccrClient.initialize(); + this.restoredWorkerState = init2.catch(() => null); + init2.catch((error42) => { logForDiagnosticsNoPII("error", "cli_worker_lifecycle_init_failed", { - reason: error46 instanceof CCRInitError ? error46.reason : "unknown" + reason: error42 instanceof CCRInitError ? error42.reason : "unknown" }); - logError2(new Error(`CCRClient initialization failed: ${errorMessage(error46)}`)); + logError2(new Error(`CCRClient initialization failed: ${errorMessage(error42)}`)); gracefulShutdown(1, "other"); }); registerCleanup(async () => this.ccrClient?.close()); @@ -768873,8 +691439,8 @@ var init_remoteIO = __esm(() => { started: "processing", completed: "processed" }; - setCommandLifecycleListener((uuid8, state2) => { - this.ccrClient?.reportDelivery(uuid8, LIFECYCLE_TO_DELIVERY[state2]); + setCommandLifecycleListener((uuid5, state2) => { + this.ccrClient?.reportDelivery(uuid5, LIFECYCLE_TO_DELIVERY[state2]); }); setSessionStateChangedListener((state2, details) => { this.ccrClient?.reportState(state2, details); @@ -768888,8 +691454,8 @@ var init_remoteIO = __esm(() => { if (this.isBridge && keepAliveIntervalMs > 0) { this.keepAliveTimer = setInterval(() => { logForDebugging("[remote-io] keep_alive sent"); - this.write({ type: "keep_alive" }).catch((err3) => { - logForDebugging(`[remote-io] keep_alive write failed: ${errorMessage(err3)}`); + this.write({ type: "keep_alive" }).catch((err2) => { + logForDebugging(`[remote-io] keep_alive write failed: ${errorMessage(err2)}`); }); }, keepAliveIntervalMs); this.keepAliveTimer.unref?.(); @@ -768898,8 +691464,8 @@ var init_remoteIO = __esm(() => { if (initialPrompt) { const stream4 = this.inputStream; (async () => { - for await (const chunk4 of initialPrompt) { - stream4.write(String(chunk4).replace(/\n$/, "") + ` + for await (const chunk3 of initialPrompt) { + stream4.write(String(chunk3).replace(/\n$/, "") + ` `); } })(); @@ -768996,14 +691562,14 @@ function createStreamlinedTransformer() { switch (message.type) { case "assistant": { const content = message.message.content; - const text2 = Array.isArray(content) ? extractTextContent(content, ` + const text = Array.isArray(content) ? extractTextContent(content, ` `).trim() : ""; accumulateToolUses(message, cumulativeCounts); - if (text2.length > 0) { + if (text.length > 0) { cumulativeCounts = createEmptyToolCounts(); return { type: "streamlined_text", - text: text2, + text, session_id: message.session_id, uuid: message.uuid }; @@ -769043,7 +691609,7 @@ var init_streamlinedTransform = __esm(() => { init_prompt4(); init_prompt2(); init_prompt6(); - init_messages5(); + init_messages3(); init_shellToolUtils(); init_stringUtils(); SEARCH_TOOLS2 = [ @@ -769079,9 +691645,9 @@ function installStreamJsonStdoutGuard() { } installed = true; originalWrite = process.stdout.write.bind(process.stdout); - process.stdout.write = function(chunk4, encodingOrCb, cb) { - const text2 = typeof chunk4 === "string" ? chunk4 : Buffer.from(chunk4).toString("utf-8"); - buffer += text2; + process.stdout.write = function(chunk3, encodingOrCb, cb) { + const text = typeof chunk3 === "string" ? chunk3 : Buffer.from(chunk3).toString("utf-8"); + buffer += text; let newlineIdx; let wrote = true; while ((newlineIdx = buffer.indexOf(` @@ -769168,8 +691734,8 @@ async function buildSideQuestionFallbackParams({ ...customSystemPrompt !== undefined ? [customSystemPrompt] : defaultSystemPrompt, ...appendSystemPrompt ? [appendSystemPrompt] : [] ]); - const last3 = messages.at(-1); - const forkContextMessages = last3?.type === "assistant" && last3.message.stop_reason === null ? messages.slice(0, -1) : messages; + const last2 = messages.at(-1); + const forkContextMessages = last2?.type === "assistant" && last2.message.stop_reason === null ? messages.slice(0, -1) : messages; const toolUseContext = { options: { commands, @@ -769204,7 +691770,7 @@ async function buildSideQuestionFallbackParams({ }; } var init_queryContext = __esm(() => { - init_prompts5(); + init_prompts4(); init_context2(); init_abortController(); init_model(); @@ -769224,12 +691790,12 @@ class QueryEngine { readFileState; discoveredSkillNames = new Set; loadedNestedMemoryPaths = new Set; - constructor(config6) { - this.config = config6; - this.mutableMessages = config6.initialMessages ?? []; - this.abortController = config6.abortController ?? createAbortController(); + constructor(config4) { + this.config = config4; + this.mutableMessages = config4.initialMessages ?? []; + this.abortController = config4.abortController ?? createAbortController(); this.permissionDenials = []; - this.readFileState = config6.readFileCache; + this.readFileState = config4.readFileCache; this.totalUsage = EMPTY_USAGE; } async* submitMessage(prompt, options2) { @@ -769261,16 +691827,16 @@ class QueryEngine { setCwd(cwd2); const persistSession = !isSessionPersistenceDisabled(); const startTime = Date.now(); - const wrappedCanUseTool = async (tool, input11, toolUseContext, assistantMessage, toolUseID, forceDecision) => { - const result4 = await canUseTool(tool, input11, toolUseContext, assistantMessage, toolUseID, forceDecision); - if (result4.behavior !== "allow") { + const wrappedCanUseTool = async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => { + const result3 = await canUseTool(tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision); + if (result3.behavior !== "allow") { this.permissionDenials.push({ tool_name: sdkCompatToolName(tool.name), tool_use_id: toolUseID, - tool_input: input11 + tool_input: input }); } - return result4; + return result3; }; const initialAppState = getAppState(); const initialMainLoopModel = userSpecifiedModel ? parseUserSpecifiedModel(userSpecifiedModel) : getMainLoopModel(); @@ -769787,15 +692353,15 @@ class QueryEngine { } } } - const result3 = messages.findLast((m) => m.type === "assistant" || m.type === "user"); - const edeResultType = result3?.type ?? "undefined"; - const edeLastContentType = result3?.type === "assistant" ? last_default(result3.message.content)?.type ?? "none" : "n/a"; + const result2 = messages.findLast((m) => m.type === "assistant" || m.type === "user"); + const edeResultType = result2?.type ?? "undefined"; + const edeLastContentType = result2?.type === "assistant" ? last_default(result2.message.content)?.type ?? "none" : "n/a"; if (persistSession) { if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) { await flushSessionStorage(); } } - if (!isResultSuccessful(result3, lastStopReason)) { + if (!isResultSuccessful(result2, lastStopReason)) { yield { type: "result", subtype: "error_during_execution", @@ -769824,12 +692390,12 @@ class QueryEngine { } let textResult = ""; let isApiError = false; - if (result3.type === "assistant") { - const lastContent = last_default(result3.message.content); + if (result2.type === "assistant") { + const lastContent = last_default(result2.message.content); if (lastContent?.type === "text" && !SYNTHETIC_MESSAGES.has(lastContent.text)) { textResult = lastContent.text; } - isApiError = Boolean(result3.isApiErrorMessage); + isApiError = Boolean(result2.isApiErrorMessage); } yield { type: "result", @@ -769956,7 +692522,7 @@ var init_QueryEngine = __esm(() => { init_memdir(); init_paths(); init_query(); - init_errors7(); + init_errors6(); init_Tool(); init_SyntheticOutputTool(); init_abortController(); @@ -769969,7 +692535,7 @@ var init_QueryEngine = __esm(() => { init_headlessProfiler(); init_hookHelpers(); init_log3(); - init_messages5(); + init_messages3(); init_model(); init_pluginLoader(); init_processUserInput(); @@ -769988,10 +692554,10 @@ var init_QueryEngine = __esm(() => { // src/utils/filePersistence/types.ts var DEFAULT_UPLOAD_CONCURRENCY = 5, FILE_COUNT_LIMIT = 100, OUTPUTS_SUBDIR = "outputs"; -var init_types21 = () => {}; +var init_types20 = () => {}; // src/utils/filePersistence/filePersistence.ts -import { join as join176, relative as relative37 } from "path"; +import { join as join166, relative as relative35 } from "path"; async function runFilePersistence(turnStartTime, signal) { const environmentKind = getEnvironmentKind(); if (environmentKind !== "byoc") { @@ -770006,11 +692572,11 @@ async function runFilePersistence(turnStartTime, signal) { logError2(new Error("File persistence enabled but CLAUDE_CODE_REMOTE_SESSION_ID is not set")); return null; } - const config6 = { + const config4 = { oauthToken: sessionAccessToken, sessionId }; - const outputsDir = join176(getCwd(), sessionId, OUTPUTS_SUBDIR); + const outputsDir = join166(getCwd(), sessionId, OUTPUTS_SUBDIR); if (signal?.aborted) { logDebug("Persistence aborted before processing"); return null; @@ -770020,26 +692586,26 @@ async function runFilePersistence(turnStartTime, signal) { mode: environmentKind }); try { - let result3; + let result2; if (environmentKind === "byoc") { - result3 = await executeBYOCPersistence(turnStartTime, config6, outputsDir, signal); + result2 = await executeBYOCPersistence(turnStartTime, config4, outputsDir, signal); } else { - result3 = await executeCloudPersistence(); + result2 = await executeCloudPersistence(); } - if (result3.files.length === 0 && result3.failed.length === 0) { + if (result2.files.length === 0 && result2.failed.length === 0) { return null; } const durationMs = Date.now() - startTime; logEvent("tengu_file_persistence_completed", { - success_count: result3.files.length, - failure_count: result3.failed.length, + success_count: result2.files.length, + failure_count: result2.failed.length, duration_ms: durationMs, mode: environmentKind }); - return result3; - } catch (error46) { - logError2(error46); - logDebug(`File persistence failed: ${error46}`); + return result2; + } catch (error42) { + logError2(error42); + logDebug(`File persistence failed: ${error42}`); const durationMs = Date.now() - startTime; logEvent("tengu_file_persistence_completed", { success_count: 0, @@ -770053,13 +692619,13 @@ async function runFilePersistence(turnStartTime, signal) { failed: [ { filename: outputsDir, - error: errorMessage(error46) + error: errorMessage(error42) } ] }; } } -async function executeBYOCPersistence(turnStartTime, config6, outputsDir, signal) { +async function executeBYOCPersistence(turnStartTime, config4, outputsDir, signal) { const modifiedFiles = await findModifiedFiles(turnStartTime, outputsDir); if (modifiedFiles.length === 0) { logDebug("No modified files to persist"); @@ -770087,7 +692653,7 @@ async function executeBYOCPersistence(turnStartTime, config6, outputsDir, signal } const filesToProcess = modifiedFiles.map((filePath) => ({ path: filePath, - relativePath: relative37(outputsDir, filePath) + relativePath: relative35(outputsDir, filePath) })).filter(({ relativePath: relativePath2 }) => { if (relativePath2.startsWith("..")) { logDebug(`Skipping file outside outputs directory: ${relativePath2}`); @@ -770096,19 +692662,19 @@ async function executeBYOCPersistence(turnStartTime, config6, outputsDir, signal return true; }); logDebug(`BYOC mode: uploading ${filesToProcess.length} files`); - const results = await uploadSessionFiles(filesToProcess, config6, DEFAULT_UPLOAD_CONCURRENCY); + const results = await uploadSessionFiles(filesToProcess, config4, DEFAULT_UPLOAD_CONCURRENCY); const persistedFiles = []; const failedFiles = []; - for (const result3 of results) { - if (result3.success) { + for (const result2 of results) { + if (result2.success) { persistedFiles.push({ - filename: result3.path, - file_id: result3.fileId + filename: result2.path, + file_id: result2.fileId }); } else { failedFiles.push({ - filename: result3.path, - error: result3.error + filename: result2.path, + error: result2.error }); } } @@ -770124,12 +692690,12 @@ function executeCloudPersistence() { } async function executeFilePersistence(turnStartTime, signal, onResult) { try { - const result3 = await runFilePersistence(turnStartTime, signal); - if (result3) { - onResult(result3); + const result2 = await runFilePersistence(turnStartTime, signal); + if (result2) { + onResult(result2); } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } var init_filePersistence = __esm(() => { @@ -770141,7 +692707,7 @@ var init_filePersistence = __esm(() => { init_log3(); init_sessionIngressAuth(); init_outputsScanner(); - init_types21(); + init_types20(); }); // src/utils/idleTimeout.ts @@ -770215,15 +692781,15 @@ function parseSessionIdentifier(resumeIdentifier) { return null; } var init_sessionUrl = __esm(() => { - init_uuid2(); + init_uuid(); }); // src/utils/plugins/zipCacheAdapters.ts -import { readFile as readFile62 } from "fs/promises"; -import { join as join177 } from "path"; +import { readFile as readFile61 } from "fs/promises"; +import { join as join167 } from "path"; async function readZipCacheKnownMarketplaces() { try { - const content = await readFile62(getZipCacheKnownMarketplacesPath(), "utf-8"); + const content = await readFile61(getZipCacheKnownMarketplacesPath(), "utf-8"); const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content)); if (!parsed.success) { logForDebugging(`Invalid known_marketplaces.json in zip cache: ${parsed.error.message}`, { level: "error" }); @@ -770245,18 +692811,18 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) { const content = await readMarketplaceJsonContent(installLocation); if (content !== null) { const relPath = getMarketplaceJsonRelativePath(marketplaceName); - await atomicWriteToZipCache(join177(zipCachePath, relPath), content); + await atomicWriteToZipCache(join167(zipCachePath, relPath), content); } } async function readMarketplaceJsonContent(dir) { const candidates = [ - join177(dir, ".claude-plugin", "marketplace.json"), - join177(dir, "marketplace.json"), + join167(dir, ".claude-plugin", "marketplace.json"), + join167(dir, "marketplace.json"), dir ]; for (const candidate of candidates) { try { - return await readFile62(candidate, "utf-8"); + return await readFile61(candidate, "utf-8"); } catch {} } return null; @@ -770268,8 +692834,8 @@ async function syncMarketplacesToZipCache() { continue; try { await saveMarketplaceJsonToZipCache(name, entry.installLocation); - } catch (error46) { - logForDebugging(`Failed to save marketplace JSON for ${name}: ${error46}`); + } catch (error42) { + logForDebugging(`Failed to save marketplace JSON for ${name}: ${error42}`); } } const zipCacheKnownMarketplaces = await readZipCacheKnownMarketplaces(); @@ -770351,8 +692917,8 @@ async function installPluginsForHeadless() { registerCleanup(cleanupSessionPluginCache); } return pluginsChanged; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return false; } finally { logEvent("tengu_headless_plugin_install", metrics); @@ -770386,16 +692952,16 @@ __export(exports_print, { createCanUseToolWithPermissionPrompt: () => createCanUseToolWithPermissionPrompt, canBatchWith: () => canBatchWith }); -import { readFile as readFile63, stat as stat56 } from "fs/promises"; -import { dirname as dirname73 } from "path"; +import { readFile as readFile62, stat as stat55 } from "fs/promises"; +import { dirname as dirname69 } from "path"; import { cwd as cwd2 } from "process"; import { randomUUID as randomUUID59 } from "crypto"; -function trackReceivedMessageUuid(uuid8) { - if (receivedMessageUuids.has(uuid8)) { +function trackReceivedMessageUuid(uuid5) { + if (receivedMessageUuids.has(uuid5)) { return false; } - receivedMessageUuids.add(uuid8); - receivedMessageUuidsOrder.push(uuid8); + receivedMessageUuids.add(uuid5); + receivedMessageUuidsOrder.push(uuid5); if (receivedMessageUuidsOrder.length > MAX_RECEIVED_UUIDS) { const toEvict = receivedMessageUuidsOrder.splice(0, receivedMessageUuidsOrder.length - MAX_RECEIVED_UUIDS); for (const old of toEvict) { @@ -770407,17 +692973,17 @@ function trackReceivedMessageUuid(uuid8) { function toBlocks(v) { return typeof v === "string" ? [{ type: "text", text: v }] : v; } -function joinPromptValues(values4) { - if (values4.length === 1) - return values4[0]; - if (values4.every((v) => typeof v === "string")) { - return values4.join(` +function joinPromptValues(values2) { + if (values2.length === 1) + return values2[0]; + if (values2.every((v) => typeof v === "string")) { + return values2.join(` `); } - return values4.flatMap(toBlocks); + return values2.flatMap(toBlocks); } -function canBatchWith(head3, next) { - return next !== undefined && next.mode === "prompt" && next.workload === head3.workload && next.isMeta === head3.isMeta; +function canBatchWith(head2, next) { + return next !== undefined && next.mode === "prompt" && next.workload === head2.workload && next.isMeta === head2.isMeta; } async function runHeadless(inputPrompt, getAppState, setAppState, commands, tools, sdkMcpConfigs, agents2, options2) { if (process.env.USER_TYPE === "ant" && isEnvTruthy(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)) { @@ -770494,9 +693060,9 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason} } else if (SandboxManager2.isSandboxingEnabled()) { try { await SandboxManager2.initialize(structuredIO.createSandboxAskCallback()); - } catch (err3) { + } catch (err2) { process.stderr.write(` -❌ Sandbox Error: ${errorMessage(err3)} +❌ Sandbox Error: ${errorMessage(err2)} `); gracefulShutdownSync(1, "other"); return; @@ -770597,9 +693163,9 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason} return; } const currentAppState = getAppState(); - const result3 = await handleRewindFiles(options2.rewindFiles, currentAppState, setAppState, false); - if (!result3.canRewind) { - process.stderr.write(`Error: ${result3.error || "Unexpected error"} + const result2 = await handleRewindFiles(options2.rewindFiles, currentAppState, setAppState, false); + if (!result2.canRewind) { + process.stderr.write(`Error: ${result2.error || "Unexpected error"} `); gracefulShutdownSync(1); return; @@ -770870,12 +693436,12 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial const requestedSchema = "requestedSchema" in request.params ? request.params.requestedSchema : undefined; const elicitationId = "elicitationId" in request.params ? request.params.elicitationId : undefined; const rawResult = await structuredIO.handleElicitation(serverName, request.params.message, requestedSchema, extra.signal, mode, url3, elicitationId); - const result3 = await runElicitationResultHooks(serverName, rawResult, extra.signal, mode, elicitationId); + const result2 = await runElicitationResultHooks(serverName, rawResult, extra.signal, mode, elicitationId); logEvent("tengu_mcp_elicitation_response", { mode, - action: result3.action + action: result2.action }); - return result3; + return result2; }); connection.client.setNotificationHandler(ElicitationCompleteNotificationSchema, (notification) => { const { elicitationId } = notification.params; @@ -770906,10 +693472,10 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial const hasFailedSdkClients = sdkClients.some((c6) => c6.type === "failed"); const haveServersChanged = hasNewServers || hasRemovedServers || hasPendingSdkClients || hasFailedSdkClients; if (haveServersChanged) { - for (const client5 of sdkClients) { - if (!currentServerNames.has(client5.name)) { - if (client5.type === "connected") { - await client5.cleanup(); + for (const client2 of sdkClients) { + if (!currentServerNames.has(client2.name)) { + if (client2.type === "connected") { + await client2.cleanup(); } } } @@ -770974,15 +693540,15 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial function applyMcpServerChanges(servers) { const doWork = async () => { const oldSdkClientNames = new Set(sdkClients.map((c6) => c6.name)); - const result3 = await handleMcpSetServers(servers, { configs: sdkMcpConfigs, clients: sdkClients, tools: sdkTools }, dynamicMcpState, setAppState); + const result2 = await handleMcpSetServers(servers, { configs: sdkMcpConfigs, clients: sdkClients, tools: sdkTools }, dynamicMcpState, setAppState); for (const key of Object.keys(sdkMcpConfigs)) { delete sdkMcpConfigs[key]; } - Object.assign(sdkMcpConfigs, result3.newSdkState.configs); - sdkClients = result3.newSdkState.clients; - sdkTools = result3.newSdkState.tools; - dynamicMcpState = result3.newDynamicState; - if (result3.sdkServersChanged) { + Object.assign(sdkMcpConfigs, result2.newSdkState.configs); + sdkClients = result2.newSdkState.clients; + sdkTools = result2.newSdkState.tools; + dynamicMcpState = result2.newDynamicState; + if (result2.sdkServersChanged) { const newSdkClientNames = new Set(sdkClients.map((c6) => c6.name)); const allSdkNames = uniq2([...oldSdkClientNames, ...newSdkClientNames]); setAppState((prev) => ({ @@ -770997,8 +693563,8 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial })); } return { - response: result3.response, - sdkServersChanged: result3.sdkServersChanged + response: result2.response, + sdkServersChanged: result2.sdkServersChanged }; }; mcpChangesPromise = mcpChangesPromise.then(doWork, doWork); @@ -771017,22 +693583,22 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial ...sdkClients, ...dynamicMcpState.clients.filter((c6) => !existingNames.has(c6.name)) ].map((connection) => { - let config6; + let config4; if (connection.config.type === "sse" || connection.config.type === "http") { - config6 = { + config4 = { type: connection.config.type, url: connection.config.url, headers: connection.config.headers, oauth: connection.config.oauth }; } else if (connection.config.type === "claudeai-proxy") { - config6 = { + config4 = { type: "claudeai-proxy", url: connection.config.url, id: connection.config.id }; } else if (connection.config.type === "stdio" || connection.config.type === undefined) { - config6 = { + config4 = { type: "stdio", command: connection.config.command, args: connection.config.args @@ -771061,7 +693627,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial status: connection.type, serverInfo: connection.type === "connected" ? connection.serverInfo : undefined, error: connection.type === "failed" ? connection.error : undefined, - config: config6, + config: config4, scope: connection.config.scope, tools: serverTools, capabilities @@ -771078,8 +693644,8 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial if (pluginsInstalled) { await applyPluginMcpDiff(); } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } let pluginInstallPromise = null; @@ -771102,15 +693668,15 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial async function applyPluginMcpDiff() { const { servers: newConfigs } = await getAllMcpConfigs(); const supportedConfigs = {}; - for (const [name, config6] of Object.entries(newConfigs)) { - const type = config6.type; + for (const [name, config4] of Object.entries(newConfigs)) { + const type = config4.type; if (type === undefined || type === "stdio" || type === "sse" || type === "http" || type === "sdk") { - supportedConfigs[name] = config6; + supportedConfigs[name] = config4; } } - for (const [name, config6] of Object.entries(sdkMcpConfigs)) { - if (config6.type === "sdk" && !(name in supportedConfigs)) { - supportedConfigs[name] = config6; + for (const [name, config4] of Object.entries(sdkMcpConfigs)) { + if (config4.type === "sdk" && !(name in supportedConfigs)) { + supportedConfigs[name] = config4; } } const { response, sdkServersChanged } = await applyMcpServerChanges(supportedConfigs); @@ -771160,9 +693726,9 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial if (pluginInstallPromise) { const timeoutMs = parseInt(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS || "", 10); if (timeoutMs > 0) { - const timeout2 = sleep4(timeoutMs).then(() => "timeout"); - const result3 = await Promise.race([pluginInstallPromise, timeout2]); - if (result3 === "timeout") { + const timeout2 = sleep2(timeoutMs).then(() => "timeout"); + const result2 = await Promise.race([pluginInstallPromise, timeout2]); + if (result2 === "timeout") { logError2(new Error(`CLAUDE_CODE_SYNC_PLUGIN_INSTALL: plugin installation timed out after ${timeoutMs}ms`)); logEvent("tengu_sync_plugin_install_timeout", { timeout_ms: timeoutMs @@ -771220,12 +693786,12 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial ...dynamicMcpState.clients ]; registerElicitationHandlers(allMcpClients); - for (const client5 of allMcpClients) { - reregisterChannelHandlerAfterReconnect(client5); + for (const client2 of allMcpClients) { + reregisterChannelHandlerAfterReconnect(client2); } const allTools = buildAllTools(appState); - for (const uuid8 of batchUuids) { - notifyCommandLifecycle(uuid8, "started"); + for (const uuid5 of batchUuids) { + notifyCommandLifecycle(uuid5, "started"); } if (command8.mode === "task-notification") { const notificationText = typeof command8.value === "string" ? command8.value : ""; @@ -771261,7 +693827,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial }); } } - const input11 = command8.value; + const input = command8.value; if (structuredIO instanceof RemoteIO && command8.mode === "prompt") { logEvent("tengu_bridge_message_received", { is_repl: false @@ -771273,7 +693839,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial suggestionState.pendingLastEmittedEntry = null; if (suggestionState.lastEmitted) { if (command8.mode === "prompt") { - const inputText = typeof input11 === "string" ? input11 : input11.find((b) => b.type === "text")?.text; + const inputText = typeof input === "string" ? input : input.find((b) => b.type === "text")?.text; if (typeof inputText === "string") { logSuggestionOutcome(suggestionState.lastEmitted.text, inputText, suggestionState.lastEmitted.emittedAt, suggestionState.lastEmitted.promptId, suggestionState.lastEmitted.generationRequestId); } @@ -771288,7 +693854,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial await runWithWorkload(cmd.workload ?? options2.workload, async () => { for await (const message of ask({ commands: uniqBy_default([...currentCommands, ...appState.mcp.commands], "name"), - prompt: input11, + prompt: input, promptUuid: cmd.uuid, isMeta: cmd.isMeta, cwd: cwd2(), @@ -771307,10 +693873,10 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial getReadFileCache: () => pendingSeeds.size === 0 ? readFileState : mergeFileStateCaches(readFileState, pendingSeeds), setReadFileCache: (cache6) => { readFileState = cache6; - for (const [path30, seed] of pendingSeeds.entries()) { - const existing = readFileState.get(path30); + for (const [path25, seed] of pendingSeeds.entries()) { + const existing = readFileState.get(path25); if (!existing || seed.timestamp > existing.timestamp) { - readFileState.set(path30, seed); + readFileState.set(path25, seed); } } pendingSeeds.clear(); @@ -771355,18 +693921,18 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial } } }); - for (const uuid8 of batchUuids) { - notifyCommandLifecycle(uuid8, "completed"); + for (const uuid5 of batchUuids) { + notifyCommandLifecycle(uuid5, "completed"); } forwardMessagesToBridge(); bridgeHandle?.sendResult(); if (feature("FILE_PERSISTENCE") && turnStartTime !== undefined) { - executeFilePersistence(turnStartTime, abortController.signal, (result3) => { + executeFilePersistence(turnStartTime, abortController.signal, (result2) => { output.enqueue({ type: "system", subtype: "files_persisted", - files: result3.files, - failed: result3.failed, + files: result2.files, + failed: result2.failed, processed_at: new Date().toISOString(), uuid: randomUUID59(), session_id: getSessionId() @@ -771385,20 +693951,20 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial const ref = { promise: null }; ref.promise = (async () => { try { - const result3 = await tryGenerateSuggestion(localAbort, mutableMessages, getAppState, cacheSafeParams, "sdk"); - if (!result3 || localAbort.signal.aborted) + const result2 = await tryGenerateSuggestion(localAbort, mutableMessages, getAppState, cacheSafeParams, "sdk"); + if (!result2 || localAbort.signal.aborted) return; const suggestionMsg = { type: "prompt_suggestion", - suggestion: result3.suggestion, + suggestion: result2.suggestion, uuid: randomUUID59(), session_id: getSessionId() }; const lastEmittedEntry = { - text: result3.suggestion, + text: result2.suggestion, emittedAt: Date.now(), - promptId: result3.promptId, - generationRequestId: result3.generationRequestId + promptId: result2.promptId, + generationRequestId: result2.generationRequestId }; if (heldBackResult) { suggestionState.pendingSuggestion = suggestionMsg; @@ -771411,12 +693977,12 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial suggestionState.lastEmitted = lastEmittedEntry; output.enqueue(suggestionMsg); } - } catch (error46) { - if (error46 instanceof Error && (error46.name === "AbortError" || error46.name === "APIUserAbortError")) { + } catch (error42) { + if (error42 instanceof Error && (error42.name === "AbortError" || error42.name === "APIUserAbortError")) { logSuggestionSuppressed("aborted", undefined, undefined, "sdk"); return; } - logError2(toError(error46)); + logError2(toError(error42)); } finally { if (suggestionState.inflightPromise === ref.promise) { suggestionState.inflightPromise = null; @@ -771446,7 +694012,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial waitingForAgents = true; if (!hasMainThreadQueued) { runPhase = "waiting_for_agents"; - await sleep4(100); + await sleep2(100); } } } @@ -771466,7 +694032,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial suggestionState.pendingSuggestion = null; } } - } catch (error46) { + } catch (error42) { try { await structuredIO.write({ type: "result", @@ -771483,7 +694049,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial permission_denials: [], uuid: randomUUID59(), errors: [ - errorMessage(error46), + errorMessage(error42), ...getInMemoryErrors().map((_) => _.error) ] }); @@ -771586,7 +694152,7 @@ ${m.text} run(); return; } - await sleep4(POLL_INTERVAL_MS4); + await sleep2(POLL_INTERVAL_MS4); } } } @@ -771610,7 +694176,7 @@ ${m.text} run(); } else { if (suggestionState.inflightPromise) { - await Promise.race([suggestionState.inflightPromise, sleep4(5000)]); + await Promise.race([suggestionState.inflightPromise, sleep2(5000)]); } suggestionState.abortController?.abort(); suggestionState.abortController = null; @@ -771754,7 +694320,7 @@ ${m.text} const m = message.request; setAppState((prev) => ({ ...prev, - toolPermissionContext: handleSetPermissionMode2(m, message.request_id, prev.toolPermissionContext, output), + toolPermissionContext: handleSetPermissionMode(m, message.request_id, prev.toolPermissionContext, output), isUltraplanMode: m.ultraplan ?? prev.isUltraplanMode })); } else if (message.request.subtype === "set_model") { @@ -771796,23 +694362,23 @@ ${m.text} } }); sendControlResponseSuccess(message, { ...data }); - } catch (error46) { - sendControlResponseError(message, errorMessage(error46)); + } catch (error42) { + sendControlResponseError(message, errorMessage(error42)); } } else if (message.request.subtype === "mcp_message") { const mcpRequest = message.request; - const sdkClient = sdkClients.find((client5) => client5.name === mcpRequest.server_name); + const sdkClient = sdkClients.find((client2) => client2.name === mcpRequest.server_name); if (sdkClient && sdkClient.type === "connected" && sdkClient.client?.transport?.onmessage) { sdkClient.client.transport.onmessage(mcpRequest.message); } sendControlResponseSuccess(message); } else if (message.request.subtype === "rewind_files") { const appState = getAppState(); - const result3 = await handleRewindFiles(message.request.user_message_id, appState, setAppState, message.request.dry_run ?? false); - if (result3.canRewind || message.request.dry_run) { - sendControlResponseSuccess(message, result3); + const result2 = await handleRewindFiles(message.request.user_message_id, appState, setAppState, message.request.dry_run ?? false); + if (result2.canRewind || message.request.dry_run) { + sendControlResponseSuccess(message, result2); } else { - sendControlResponseError(message, result3.error ?? "Unexpected error"); + sendControlResponseError(message, result2.error ?? "Unexpected error"); } } else if (message.request.subtype === "cancel_async_message") { const targetUuid = message.request.message_uuid; @@ -771823,9 +694389,9 @@ ${m.text} } else if (message.request.subtype === "seed_read_state") { try { const normalizedPath = expandPath(message.request.path); - const diskMtime = Math.floor((await stat56(normalizedPath)).mtimeMs); + const diskMtime = Math.floor((await stat55(normalizedPath)).mtimeMs); if (diskMtime <= message.request.mtime) { - const raw = await readFile63(normalizedPath, "utf-8"); + const raw = await readFile62(normalizedPath, "utf-8"); const content = (raw.charCodeAt(0) === 65279 ? raw.slice(1) : raw).replaceAll(`\r `, ` `); @@ -771893,52 +694459,52 @@ ${m.text} mcpServers: buildMcpServerStatuses(), error_count: r.error_count }); - } catch (error46) { - sendControlResponseError(message, errorMessage(error46)); + } catch (error42) { + sendControlResponseError(message, errorMessage(error42)); } } else if (message.request.subtype === "mcp_reconnect") { const currentAppState = getAppState(); const { serverName } = message.request; elicitationRegistered.delete(serverName); - const config6 = getMcpConfigByName(serverName) ?? mcpClients.find((c6) => c6.name === serverName)?.config ?? sdkClients.find((c6) => c6.name === serverName)?.config ?? dynamicMcpState.clients.find((c6) => c6.name === serverName)?.config ?? currentAppState.mcp.clients.find((c6) => c6.name === serverName)?.config ?? null; - if (!config6) { + const config4 = getMcpConfigByName(serverName) ?? mcpClients.find((c6) => c6.name === serverName)?.config ?? sdkClients.find((c6) => c6.name === serverName)?.config ?? dynamicMcpState.clients.find((c6) => c6.name === serverName)?.config ?? currentAppState.mcp.clients.find((c6) => c6.name === serverName)?.config ?? null; + if (!config4) { sendControlResponseError(message, `Server not found: ${serverName}`); } else { - const result3 = await reconnectMcpServerImpl(serverName, config6); + const result2 = await reconnectMcpServerImpl(serverName, config4); const prefix = getMcpPrefix(serverName); setAppState((prev) => ({ ...prev, mcp: { ...prev.mcp, - clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result3.client : c6), + clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result2.client : c6), tools: [ ...reject_default(prev.mcp.tools, (t) => t.name?.startsWith(prefix)), - ...result3.tools + ...result2.tools ], commands: [ ...reject_default(prev.mcp.commands, (c6) => commandBelongsToServer(c6, serverName)), - ...result3.commands + ...result2.commands ], - resources: result3.resources && result3.resources.length > 0 ? { ...prev.mcp.resources, [serverName]: result3.resources } : omit_default(prev.mcp.resources, serverName) + resources: result2.resources && result2.resources.length > 0 ? { ...prev.mcp.resources, [serverName]: result2.resources } : omit_default(prev.mcp.resources, serverName) } })); dynamicMcpState = { ...dynamicMcpState, clients: [ ...dynamicMcpState.clients.filter((c6) => c6.name !== serverName), - result3.client + result2.client ], tools: [ ...dynamicMcpState.tools.filter((t) => !t.name?.startsWith(prefix)), - ...result3.tools + ...result2.tools ] }; - if (result3.client.type === "connected") { - registerElicitationHandlers([result3.client]); - reregisterChannelHandlerAfterReconnect(result3.client); + if (result2.client.type === "connected") { + registerElicitationHandlers([result2.client]); + reregisterChannelHandlerAfterReconnect(result2.client); sendControlResponseSuccess(message); } else { - const errorMessage3 = result3.client.type === "failed" ? result3.client.error ?? "Connection failed" : `Server status: ${result3.client.type}`; + const errorMessage3 = result2.client.type === "failed" ? result2.client.error ?? "Connection failed" : `Server status: ${result2.client.type}`; sendControlResponseError(message, errorMessage3); } } @@ -771946,26 +694512,26 @@ ${m.text} const currentAppState = getAppState(); const { serverName, enabled } = message.request; elicitationRegistered.delete(serverName); - const config6 = getMcpConfigByName(serverName) ?? mcpClients.find((c6) => c6.name === serverName)?.config ?? sdkClients.find((c6) => c6.name === serverName)?.config ?? dynamicMcpState.clients.find((c6) => c6.name === serverName)?.config ?? currentAppState.mcp.clients.find((c6) => c6.name === serverName)?.config ?? null; - if (!config6) { + const config4 = getMcpConfigByName(serverName) ?? mcpClients.find((c6) => c6.name === serverName)?.config ?? sdkClients.find((c6) => c6.name === serverName)?.config ?? dynamicMcpState.clients.find((c6) => c6.name === serverName)?.config ?? currentAppState.mcp.clients.find((c6) => c6.name === serverName)?.config ?? null; + if (!config4) { sendControlResponseError(message, `Server not found: ${serverName}`); } else if (!enabled) { setMcpServerEnabled(serverName, false); - const client5 = [ + const client2 = [ ...mcpClients, ...sdkClients, ...dynamicMcpState.clients, ...currentAppState.mcp.clients ].find((c6) => c6.name === serverName); - if (client5 && client5.type === "connected") { - await clearServerCache(serverName, config6); + if (client2 && client2.type === "connected") { + await clearServerCache(serverName, config4); } const prefix = getMcpPrefix(serverName); setAppState((prev) => ({ ...prev, mcp: { ...prev.mcp, - clients: prev.mcp.clients.map((c6) => c6.name === serverName ? { name: serverName, type: "disabled", config: config6 } : c6), + clients: prev.mcp.clients.map((c6) => c6.name === serverName ? { name: serverName, type: "disabled", config: config4 } : c6), tools: reject_default(prev.mcp.tools, (t) => t.name?.startsWith(prefix)), commands: reject_default(prev.mcp.commands, (c6) => commandBelongsToServer(c6, serverName)), resources: omit_default(prev.mcp.resources, serverName) @@ -771974,30 +694540,30 @@ ${m.text} sendControlResponseSuccess(message); } else { setMcpServerEnabled(serverName, true); - const result3 = await reconnectMcpServerImpl(serverName, config6); + const result2 = await reconnectMcpServerImpl(serverName, config4); const prefix = getMcpPrefix(serverName); setAppState((prev) => ({ ...prev, mcp: { ...prev.mcp, - clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result3.client : c6), + clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result2.client : c6), tools: [ ...reject_default(prev.mcp.tools, (t) => t.name?.startsWith(prefix)), - ...result3.tools + ...result2.tools ], commands: [ ...reject_default(prev.mcp.commands, (c6) => commandBelongsToServer(c6, serverName)), - ...result3.commands + ...result2.commands ], - resources: result3.resources && result3.resources.length > 0 ? { ...prev.mcp.resources, [serverName]: result3.resources } : omit_default(prev.mcp.resources, serverName) + resources: result2.resources && result2.resources.length > 0 ? { ...prev.mcp.resources, [serverName]: result2.resources } : omit_default(prev.mcp.resources, serverName) } })); - if (result3.client.type === "connected") { - registerElicitationHandlers([result3.client]); - reregisterChannelHandlerAfterReconnect(result3.client); + if (result2.client.type === "connected") { + registerElicitationHandlers([result2.client]); + reregisterChannelHandlerAfterReconnect(result2.client); sendControlResponseSuccess(message); } else { - const errorMessage3 = result3.client.type === "failed" ? result3.client.error ?? "Connection failed" : `Server status: ${result3.client.type}`; + const errorMessage3 = result2.client.type === "failed" ? result2.client.error ?? "Connection failed" : `Server status: ${result2.client.type}`; sendControlResponseError(message, errorMessage3); } } @@ -772011,21 +694577,21 @@ ${m.text} } else if (message.request.subtype === "mcp_authenticate") { const { serverName } = message.request; const currentAppState = getAppState(); - const config6 = getMcpConfigByName(serverName) ?? mcpClients.find((c6) => c6.name === serverName)?.config ?? currentAppState.mcp.clients.find((c6) => c6.name === serverName)?.config ?? null; - if (!config6) { + const config4 = getMcpConfigByName(serverName) ?? mcpClients.find((c6) => c6.name === serverName)?.config ?? currentAppState.mcp.clients.find((c6) => c6.name === serverName)?.config ?? null; + if (!config4) { sendControlResponseError(message, `Server not found: ${serverName}`); - } else if (config6.type !== "sse" && config6.type !== "http") { - sendControlResponseError(message, `Server type "${config6.type}" does not support OAuth authentication`); + } else if (config4.type !== "sse" && config4.type !== "http") { + sendControlResponseError(message, `Server type "${config4.type}" does not support OAuth authentication`); } else { try { activeOAuthFlows.get(serverName)?.abort(); const controller = new AbortController; activeOAuthFlows.set(serverName, controller); let resolveAuthUrl; - const authUrlPromise = new Promise((resolve49) => { - resolveAuthUrl = resolve49; + const authUrlPromise = new Promise((resolve43) => { + resolveAuthUrl = resolve43; }); - const oauthPromise = performMCPOAuthFlow(serverName, config6, (url3) => resolveAuthUrl(url3), controller.signal, { + const oauthPromise = performMCPOAuthFlow(serverName, config4, (url3) => resolveAuthUrl(url3), controller.signal, { skipBrowserOpen: true, onWaitingForCallback: (submit) => { oauthCallbackSubmitters.set(serverName, submit); @@ -772053,24 +694619,24 @@ ${m.text} if (oauthManualCallbackUsed.has(serverName)) { return; } - const result3 = await reconnectMcpServerImpl(serverName, config6); + const result2 = await reconnectMcpServerImpl(serverName, config4); const prefix = getMcpPrefix(serverName); setAppState((prev) => ({ ...prev, mcp: { ...prev.mcp, - clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result3.client : c6), + clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result2.client : c6), tools: [ ...reject_default(prev.mcp.tools, (t) => t.name?.startsWith(prefix)), - ...result3.tools + ...result2.tools ], commands: [ ...reject_default(prev.mcp.commands, (c6) => commandBelongsToServer(c6, serverName)), - ...result3.commands + ...result2.commands ], - resources: result3.resources && result3.resources.length > 0 ? { + resources: result2.resources && result2.resources.length > 0 ? { ...prev.mcp.resources, - [serverName]: result3.resources + [serverName]: result2.resources } : omit_default(prev.mcp.resources, serverName) } })); @@ -772078,15 +694644,15 @@ ${m.text} ...dynamicMcpState, clients: [ ...dynamicMcpState.clients.filter((c6) => c6.name !== serverName), - result3.client + result2.client ], tools: [ ...dynamicMcpState.tools.filter((t) => !t.name?.startsWith(prefix)), - ...result3.tools + ...result2.tools ] }; - }).catch((error46) => { - logForDebugging(`MCP OAuth failed for ${serverName}: ${error46}`, { level: "error" }); + }).catch((error42) => { + logForDebugging(`MCP OAuth failed for ${serverName}: ${error42}`, { level: "error" }); }).finally(() => { if (activeOAuthFlows.get(serverName) === controller) { activeOAuthFlows.delete(serverName); @@ -772095,8 +694661,8 @@ ${m.text} oauthAuthPromises.delete(serverName); } }); - } catch (error46) { - sendControlResponseError(message, errorMessage(error46)); + } catch (error42) { + sendControlResponseError(message, errorMessage(error42)); } } } else if (message.request.subtype === "mcp_oauth_callback_url") { @@ -772118,8 +694684,8 @@ ${m.text} try { await authPromise; sendControlResponseSuccess(message); - } catch (error46) { - sendControlResponseError(message, error46 instanceof Error ? error46.message : "OAuth authentication failed"); + } catch (error42) { + sendControlResponseError(message, error42 instanceof Error ? error42.message : "OAuth authentication failed"); } } else { sendControlResponseSuccess(message); @@ -772136,10 +694702,10 @@ ${m.text} }); const service = new OAuthService; let urlResolver; - const urlPromise = new Promise((resolve49) => { - urlResolver = resolve49; + const urlPromise = new Promise((resolve43) => { + urlResolver = resolve43; }); - const flow3 = service.startOAuthFlow(async (manualUrl, automaticUrl) => { + const flow2 = service.startOAuthFlow(async (manualUrl, automaticUrl) => { urlResolver({ manualUrl, automaticUrl }); }, { loginWithClaudeAi: loginWithClaudeAi ?? true, @@ -772155,14 +694721,14 @@ ${m.text} claudeOAuth = null; } }); - claudeOAuth = { service, flow: flow3 }; - flow3.catch((err3) => logForDebugging(`claude_authenticate flow ended: ${err3}`, { + claudeOAuth = { service, flow: flow2 }; + flow2.catch((err2) => logForDebugging(`claude_authenticate flow ended: ${err2}`, { level: "info" })); try { const { manualUrl, automaticUrl } = await Promise.race([ urlPromise, - flow3.then(() => { + flow2.then(() => { throw new Error("OAuth flow completed without producing auth URLs"); }) ]); @@ -772170,8 +694736,8 @@ ${m.text} manualUrl, automaticUrl }); - } catch (error46) { - sendControlResponseError(message, errorMessage(error46)); + } catch (error42) { + sendControlResponseError(message, errorMessage(error42)); } } else if (message.request.subtype === "claude_oauth_callback" || message.request.subtype === "claude_oauth_wait_for_completion") { if (!claudeOAuth) { @@ -772183,8 +694749,8 @@ ${m.text} state: message.request.state }); } - const { flow: flow3 } = claudeOAuth; - flow3.then(() => { + const { flow: flow2 } = claudeOAuth; + flow2.then(() => { const accountInfo = getAccountInformation(); sendControlResponseSuccess(message, { account: { @@ -772196,36 +694762,36 @@ ${m.text} apiProvider: getAPIProvider() } }); - }, (error46) => sendControlResponseError(message, errorMessage(error46))); + }, (error42) => sendControlResponseError(message, errorMessage(error42))); } } else if (message.request.subtype === "mcp_clear_auth") { const { serverName } = message.request; const currentAppState = getAppState(); - const config6 = getMcpConfigByName(serverName) ?? mcpClients.find((c6) => c6.name === serverName)?.config ?? currentAppState.mcp.clients.find((c6) => c6.name === serverName)?.config ?? null; - if (!config6) { + const config4 = getMcpConfigByName(serverName) ?? mcpClients.find((c6) => c6.name === serverName)?.config ?? currentAppState.mcp.clients.find((c6) => c6.name === serverName)?.config ?? null; + if (!config4) { sendControlResponseError(message, `Server not found: ${serverName}`); - } else if (config6.type !== "sse" && config6.type !== "http") { - sendControlResponseError(message, `Cannot clear auth for server type "${config6.type}"`); + } else if (config4.type !== "sse" && config4.type !== "http") { + sendControlResponseError(message, `Cannot clear auth for server type "${config4.type}"`); } else { - await revokeServerTokens(serverName, config6); - const result3 = await reconnectMcpServerImpl(serverName, config6); + await revokeServerTokens(serverName, config4); + const result2 = await reconnectMcpServerImpl(serverName, config4); const prefix = getMcpPrefix(serverName); setAppState((prev) => ({ ...prev, mcp: { ...prev.mcp, - clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result3.client : c6), + clients: prev.mcp.clients.map((c6) => c6.name === serverName ? result2.client : c6), tools: [ ...reject_default(prev.mcp.tools, (t) => t.name?.startsWith(prefix)), - ...result3.tools + ...result2.tools ], commands: [ ...reject_default(prev.mcp.commands, (c6) => commandBelongsToServer(c6, serverName)), - ...result3.commands + ...result2.commands ], - resources: result3.resources && result3.resources.length > 0 ? { + resources: result2.resources && result2.resources.length > 0 ? { ...prev.mcp.resources, - [serverName]: result3.resources + [serverName]: result2.resources } : omit_default(prev.mcp.resources, serverName) } })); @@ -772277,8 +694843,8 @@ ${m.text} setAppState }); sendControlResponseSuccess(message, {}); - } catch (error46) { - sendControlResponseError(message, errorMessage(error46)); + } catch (error42) { + sendControlResponseError(message, errorMessage(error42)); } } else if (message.request.subtype === "generate_session_title") { const { description, persist } = message.request; @@ -772326,11 +694892,11 @@ ${m.text} thinkingConfig: options2.thinkingConfig, agents: currentAgents }); - const result3 = await runSideQuestion({ + const result2 = await runSideQuestion({ question, cacheSafeParams }); - sendControlResponseSuccess(message, { response: result3.response }); + sendControlResponseSuccess(message, { response: result2.response }); } catch (e) { sendControlResponseError(message, errorMessage(e)); } @@ -772363,11 +694929,11 @@ ${m.text} const fields = extractInboundMessageFields(msg); if (!fields) return; - const { content, uuid: uuid8 } = fields; + const { content, uuid: uuid5 } = fields; enqueue({ value: content, mode: "prompt", - uuid: uuid8, + uuid: uuid5, skipSlashCommands: true }); run(); @@ -772428,8 +694994,8 @@ ${m.text} environment_id: handle2.environmentId }); } - } catch (err3) { - sendControlResponseError(message, errorMessage(err3)); + } catch (err2) { + sendControlResponseError(message, errorMessage(err2)); } } } else { @@ -772500,8 +695066,8 @@ ${m.text} setAppState((prev) => ({ ...prev, attribution: incrementPromptCount(prev.attribution, (snapshot2) => { - recordAttributionSnapshot(snapshot2).catch((error46) => { - logForDebugging(`Attribution: Failed to save snapshot: ${error46}`); + recordAttributionSnapshot(snapshot2).catch((error42) => { + logForDebugging(`Attribution: Failed to save snapshot: ${error42}`); }); }) })); @@ -772512,7 +695078,7 @@ ${m.text} cronScheduler?.stop(); if (!running) { if (suggestionState.inflightPromise) { - await Promise.race([suggestionState.inflightPromise, sleep4(5000)]); + await Promise.race([suggestionState.inflightPromise, sleep2(5000)]); } suggestionState.abortController?.abort(); suggestionState.abortController = null; @@ -772526,8 +695092,8 @@ ${m.text} return output; } function createCanUseToolWithPermissionPrompt(permissionPromptTool) { - const canUseTool = async (tool, input11, toolUseContext, assistantMessage, toolUseId, forceDecision) => { - const mainPermissionResult = forceDecision ?? await hasPermissionsToUseTool(tool, input11, toolUseContext, assistantMessage, toolUseId); + const canUseTool = async (tool, input, toolUseContext, assistantMessage, toolUseId, forceDecision) => { + const mainPermissionResult = forceDecision ?? await hasPermissionsToUseTool(tool, input, toolUseContext, assistantMessage, toolUseId); if (mainPermissionResult.behavior === "allow" || mainPermissionResult.behavior === "deny") { return mainPermissionResult; } @@ -772544,14 +695110,14 @@ function createCanUseToolWithPermissionPrompt(permissionPromptTool) { } }; } - const abortPromise = new Promise((resolve49) => { - combinedSignal.addEventListener("abort", () => resolve49("aborted"), { + const abortPromise = new Promise((resolve43) => { + combinedSignal.addEventListener("abort", () => resolve43("aborted"), { once: true }); }); const toolCallPromise = permissionPromptTool.call({ tool_name: tool.name, - input: input11, + input, tool_use_id: toolUseId }, toolUseContext, canUseTool, assistantMessage); const raceResult = await Promise.race([toolCallPromise, abortPromise]); @@ -772567,12 +695133,12 @@ function createCanUseToolWithPermissionPrompt(permissionPromptTool) { } }; } - const result3 = raceResult; - const permissionToolResultBlockParam = permissionPromptTool.mapToolResultToToolResultBlockParam(result3.data, "1"); + const result2 = raceResult; + const permissionToolResultBlockParam = permissionPromptTool.mapToolResultToToolResultBlockParam(result2.data, "1"); if (!permissionToolResultBlockParam.content || !Array.isArray(permissionToolResultBlockParam.content) || !permissionToolResultBlockParam.content[0] || permissionToolResultBlockParam.content[0].type !== "text" || typeof permissionToolResultBlockParam.content[0].text !== "string") { throw new Error('Permission prompt tool returned an invalid result. Expected a single text block param with type="text" and a string text value.'); } - return permissionPromptToolResultToPermissionDecision(outputSchema36().parse(safeParseJSON(permissionToolResultBlockParam.content[0].text)), permissionPromptTool, input11, toolUseContext); + return permissionPromptToolResultToPermissionDecision(outputSchema36().parse(safeParseJSON(permissionToolResultBlockParam.content[0].text)), permissionPromptTool, input, toolUseContext); }; return canUseTool; } @@ -772581,30 +695147,30 @@ function getCanUseToolFn(permissionPromptToolName, structuredIO, getMcpTools, on return structuredIO.createCanUseTool(onPermissionPrompt); } if (!permissionPromptToolName) { - return async (tool, input11, toolUseContext, assistantMessage, toolUseId, forceDecision) => forceDecision ?? await hasPermissionsToUseTool(tool, input11, toolUseContext, assistantMessage, toolUseId); + return async (tool, input, toolUseContext, assistantMessage, toolUseId, forceDecision) => forceDecision ?? await hasPermissionsToUseTool(tool, input, toolUseContext, assistantMessage, toolUseId); } let resolved = null; - return async (tool, input11, toolUseContext, assistantMessage, toolUseId, forceDecision) => { + return async (tool, input, toolUseContext, assistantMessage, toolUseId, forceDecision) => { if (!resolved) { const mcpTools = getMcpTools(); const permissionPromptTool = mcpTools.find((t) => toolMatchesName(t, permissionPromptToolName)); if (!permissionPromptTool) { - const error46 = `Error: MCP tool ${permissionPromptToolName} (passed via --permission-prompt-tool) not found. Available MCP tools: ${mcpTools.map((t) => t.name).join(", ") || "none"}`; - process.stderr.write(`${error46} + const error42 = `Error: MCP tool ${permissionPromptToolName} (passed via --permission-prompt-tool) not found. Available MCP tools: ${mcpTools.map((t) => t.name).join(", ") || "none"}`; + process.stderr.write(`${error42} `); gracefulShutdownSync(1); - throw new Error(error46); + throw new Error(error42); } if (!permissionPromptTool.inputJSONSchema) { - const error46 = `Error: tool ${permissionPromptToolName} (passed via --permission-prompt-tool) must be an MCP tool`; - process.stderr.write(`${error46} + const error42 = `Error: tool ${permissionPromptToolName} (passed via --permission-prompt-tool) must be an MCP tool`; + process.stderr.write(`${error42} `); gracefulShutdownSync(1); - throw new Error(error46); + throw new Error(error42); } resolved = createCanUseToolWithPermissionPrompt(permissionPromptTool); } - return resolved(tool, input11, toolUseContext, assistantMessage, toolUseId, forceDecision); + return resolved(tool, input, toolUseContext, assistantMessage, toolUseId, forceDecision); }; } async function handleInitializeRequest(request, requestId, initialized5, output, commands, modelInfos, structuredIO, enableAuthStatus, options2, agents2, getAppState) { @@ -772752,15 +695318,15 @@ async function handleRewindFiles(userMessageId, appState, setAppState, dryRun) { ...prev, fileHistory: updater(prev.fileHistory) })), userMessageId); - } catch (error46) { + } catch (error42) { return { canRewind: false, - error: `Failed to rewind: ${errorMessage(error46)}` + error: `Failed to rewind: ${errorMessage(error42)}` }; } return { canRewind: true }; } -function handleSetPermissionMode2(request, requestId, toolPermissionContext, output) { +function handleSetPermissionMode(request, requestId, toolPermissionContext, output) { if (request.mode === "bypassPermissions") { if (isBypassPermissionsModeDisabled()) { output.enqueue({ @@ -772813,9 +695379,9 @@ function handleSetPermissionMode2(request, requestId, toolPermissionContext, out }; } function handleChannelEnable(requestId, serverName, connectionPool, output) { - const respondError = (error46) => output.enqueue({ + const respondError = (error42) => output.enqueue({ type: "control_response", - response: { subtype: "error", request_id: requestId, error: error46 } + response: { subtype: "error", request_id: requestId, error: error42 } }); if (!(feature("KAIROS") || feature("KAIROS_CHANNELS"))) { return respondError("channels feature not available in this build"); @@ -772942,10 +695508,10 @@ async function loadInitialMessages(setAppState, options2) { if (options2.continue) { try { logEvent("tengu_continue_print", {}); - const result3 = await loadConversationForResume(undefined, undefined); - if (result3) { + const result2 = await loadConversationForResume(undefined, undefined); + if (result2) { if (feature("COORDINATOR_MODE") && coordinatorModeModule3) { - const warning = coordinatorModeModule3.matchSessionMode(result3.mode); + const warning = coordinatorModeModule3.matchSessionMode(result2.mode); if (warning) { process.stderr.write(warning + ` `); @@ -772966,26 +695532,26 @@ async function loadInitialMessages(setAppState, options2) { } } if (!options2.forkSession) { - if (result3.sessionId) { - switchSession(asSessionId(result3.sessionId), result3.fullPath ? dirname73(result3.fullPath) : null); + if (result2.sessionId) { + switchSession(asSessionId(result2.sessionId), result2.fullPath ? dirname69(result2.fullPath) : null); if (persistSession) { await resetSessionFilePointer(); } } } - restoreSessionStateFromLog(result3, setAppState); - restoreSessionMetadata(options2.forkSession ? { ...result3, worktreeSession: undefined } : result3); + restoreSessionStateFromLog(result2, setAppState); + restoreSessionMetadata(options2.forkSession ? { ...result2, worktreeSession: undefined } : result2); if (feature("COORDINATOR_MODE") && coordinatorModeModule3) { saveMode(coordinatorModeModule3.isCoordinatorMode() ? "coordinator" : "normal"); } return { - messages: result3.messages, - turnInterruptionState: result3.turnInterruptionState, - agentSetting: result3.agentSetting + messages: result2.messages, + turnInterruptionState: result2.turnInterruptionState, + agentSetting: result2.agentSetting }; } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); gracefulShutdownSync(1); return { messages: [] }; } @@ -773011,8 +695577,8 @@ async function loadInitialMessages(setAppState, options2) { return { messages: processMessagesForTeleportResume2(teleportResult.log, branchError) }; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); gracefulShutdownSync(1); return { messages: [] }; } @@ -773044,8 +695610,8 @@ async function loadInitialMessages(setAppState, options2) { } else if (parsedSessionId.isUrl && parsedSessionId.ingressUrl && isEnvTruthy(process.env.ENABLE_SESSION_PERSISTENCE)) { await hydrateRemoteSession(parsedSessionId.sessionId, parsedSessionId.ingressUrl); } - const result3 = await loadConversationForResume(parsedSessionId.sessionId, parsedSessionId.jsonlFile || undefined); - if (!result3 || result3.messages.length === 0) { + const result2 = await loadConversationForResume(parsedSessionId.sessionId, parsedSessionId.jsonlFile || undefined); + if (!result2 || result2.messages.length === 0) { if (parsedSessionId.isUrl || isEnvTruthy(process.env.CLAUDE_CODE_USE_CCR_V2)) { return { messages: await (options2.sessionStartHooksPromise ?? processSessionStartHooks("startup")) @@ -773057,16 +695623,16 @@ async function loadInitialMessages(setAppState, options2) { } } if (options2.resumeSessionAt) { - const index = result3.messages.findIndex((m) => m.uuid === options2.resumeSessionAt); + const index = result2.messages.findIndex((m) => m.uuid === options2.resumeSessionAt); if (index < 0) { emitLoadError(`No message found with message.uuid of: ${options2.resumeSessionAt}`, options2.outputFormat); gracefulShutdownSync(1); return { messages: [] }; } - result3.messages = index >= 0 ? result3.messages.slice(0, index + 1) : []; + result2.messages = index >= 0 ? result2.messages.slice(0, index + 1) : []; } if (feature("COORDINATOR_MODE") && coordinatorModeModule3) { - const warning = coordinatorModeModule3.matchSessionMode(result3.mode); + const warning = coordinatorModeModule3.matchSessionMode(result2.mode); if (warning) { process.stderr.write(warning + ` `); @@ -773083,25 +695649,25 @@ async function loadInitialMessages(setAppState, options2) { })); } } - if (!options2.forkSession && result3.sessionId) { - switchSession(asSessionId(result3.sessionId), result3.fullPath ? dirname73(result3.fullPath) : null); + if (!options2.forkSession && result2.sessionId) { + switchSession(asSessionId(result2.sessionId), result2.fullPath ? dirname69(result2.fullPath) : null); if (persistSession) { await resetSessionFilePointer(); } } - restoreSessionStateFromLog(result3, setAppState); - restoreSessionMetadata(options2.forkSession ? { ...result3, worktreeSession: undefined } : result3); + restoreSessionStateFromLog(result2, setAppState); + restoreSessionMetadata(options2.forkSession ? { ...result2, worktreeSession: undefined } : result2); if (feature("COORDINATOR_MODE") && coordinatorModeModule3) { saveMode(coordinatorModeModule3.isCoordinatorMode() ? "coordinator" : "normal"); } return { - messages: result3.messages, - turnInterruptionState: result3.turnInterruptionState, - agentSetting: result3.agentSetting + messages: result2.messages, + turnInterruptionState: result2.turnInterruptionState, + agentSetting: result2.agentSetting }; - } catch (error46) { - logError2(error46); - const errorMessage3 = error46 instanceof Error ? `Failed to resume session: ${error46.message}` : "Failed to resume session with --print mode"; + } catch (error42) { + logError2(error42); + const errorMessage3 = error42 instanceof Error ? `Failed to resume session: ${error42.message}` : "Failed to resume session with --print mode"; emitLoadError(errorMessage3, options2.outputFormat); gracefulShutdownSync(1); return { messages: [] }; @@ -773171,8 +695737,8 @@ async function handleOrphanedPermissionResponse({ } return false; } -function toScopedConfig(config6) { - return { ...config6, scope: "dynamic" }; +function toScopedConfig(config4) { + return { ...config4, scope: "dynamic" }; } async function handleMcpSetServers(servers, sdkState, dynamicState, setAppState) { const { allowed: allowedServers, blocked } = filterMcpServersByPolicy(servers); @@ -773182,11 +695748,11 @@ async function handleMcpSetServers(servers, sdkState, dynamicState, setAppState) } const sdkServers = {}; const processServers = {}; - for (const [name, config6] of Object.entries(allowedServers)) { - if (config6.type === "sdk") { - sdkServers[name] = config6; + for (const [name, config4] of Object.entries(allowedServers)) { + if (config4.type === "sdk") { + sdkServers[name] = config4; } else { - processServers[name] = config6; + processServers[name] = config4; } } const currentSdkNames = new Set(Object.keys(sdkState.configs)); @@ -773198,9 +695764,9 @@ async function handleMcpSetServers(servers, sdkState, dynamicState, setAppState) let newSdkTools = [...sdkState.tools]; for (const name of currentSdkNames) { if (!newSdkNames.has(name)) { - const client5 = newSdkClients.find((c6) => c6.name === name); - if (client5 && client5.type === "connected") { - await client5.cleanup(); + const client2 = newSdkClients.find((c6) => c6.name === name); + if (client2 && client2.type === "connected") { + await client2.cleanup(); } newSdkClients = newSdkClients.filter((c6) => c6.name !== name); const prefix = `mcp__${name}__`; @@ -773209,13 +695775,13 @@ async function handleMcpSetServers(servers, sdkState, dynamicState, setAppState) sdkRemoved.push(name); } } - for (const [name, config6] of Object.entries(sdkServers)) { + for (const [name, config4] of Object.entries(sdkServers)) { if (!currentSdkNames.has(name)) { - newSdkConfigs[name] = config6; + newSdkConfigs[name] = config4; const pendingClient = { type: "pending", name, - config: { ...config6, scope: "dynamic" } + config: { ...config4, scope: "dynamic" } }; newSdkClients = [...newSdkClients, pendingClient]; sdkAdded.push(name); @@ -773257,17 +695823,17 @@ async function reconcileMcpServers(desiredConfigs, currentState2, setAppState) { let newClients = [...currentState2.clients]; let newTools = [...currentState2.tools]; for (const name of [...toRemove, ...toReplace]) { - const client5 = newClients.find((c6) => c6.name === name); - const config6 = currentState2.configs[name]; - if (client5 && config6) { - if (client5.type === "connected") { + const client2 = newClients.find((c6) => c6.name === name); + const config4 = currentState2.configs[name]; + if (client2 && config4) { + if (client2.type === "connected") { try { - await client5.cleanup(); + await client2.cleanup(); } catch (e) { logError2(e); } } - await clearServerCache(name, config6); + await clearServerCache(name, config4); } const prefix = `mcp__${name}__`; newTools = newTools.filter((t) => !t.name.startsWith(prefix)); @@ -773277,35 +695843,35 @@ async function reconcileMcpServers(desiredConfigs, currentState2, setAppState) { } } for (const name of [...toAdd, ...toReplace]) { - const config6 = desiredConfigs[name]; - if (!config6) + const config4 = desiredConfigs[name]; + if (!config4) continue; - const scopedConfig = toScopedConfig(config6); - if (config6.type === "sdk") { + const scopedConfig = toScopedConfig(config4); + if (config4.type === "sdk") { added.push(name); continue; } try { - const client5 = await connectToServer(name, scopedConfig); - newClients.push(client5); - if (client5.type === "connected") { - const serverTools = await fetchToolsForClient(client5); + const client2 = await connectToServer(name, scopedConfig); + newClients.push(client2); + if (client2.type === "connected") { + const serverTools = await fetchToolsForClient(client2); newTools.push(...serverTools); - } else if (client5.type === "failed") { - errors7[name] = client5.error || "Connection failed"; + } else if (client2.type === "failed") { + errors7[name] = client2.error || "Connection failed"; } added.push(name); } catch (e) { - const err3 = toError(e); - errors7[name] = err3.message; - logError2(err3); + const err2 = toError(e); + errors7[name] = err2.message; + logError2(err2); } } const newConfigs = {}; for (const name of desiredNames) { - const config6 = desiredConfigs[name]; - if (config6) { - newConfigs[name] = toScopedConfig(config6); + const config4 = desiredConfigs[name]; + if (config4) { + newConfigs[name] = toScopedConfig(config4); } } const newState = { @@ -773383,7 +695949,7 @@ var init_print = __esm(() => { init_channelNotification(); init_channelAllowlist(); init_pluginIdentifier(); - init_uuid2(); + init_uuid(); init_generators(); init_QueryEngine(); init_fileStateCache(); @@ -773420,9 +695986,9 @@ var init_print = __esm(() => { init_permissionSetup(); init_promptSuggestion(); init_forkedAgent(); - init_auth2(); + init_auth(); init_oauth2(); - init_auth6(); + init_auth5(); init_providers(); init_awsAuthStatusManager(); init_state(); @@ -773430,19 +695996,19 @@ var init_print = __esm(() => { init_sessionUrl(); init_sessionStorage(); init_commitAttribution(); - init_client10(); + init_client6(); init_config3(); - init_auth7(); + init_auth6(); init_elicitationHandler(); init_hooks5(); init_types4(); init_mcpStringUtils(); - init_utils4(); + init_utils3(); init_vscodeSdkMcp(); init_config3(); init_grove(); init_mappers(); - init_messages5(); + init_messages3(); init_context_noninteractive(); init_xml(); init_claudeAiLimits(); @@ -773643,7 +696209,7 @@ function TeleportProgress(t0) { } return t7; } -async function teleportWithProgress(root3, sessionId) { +async function teleportWithProgress(root2, sessionId) { let setStep = () => {}; function TeleportProgressWrapper() { const [step, _setStep] = import_react339.useState("validating"); @@ -773653,17 +696219,17 @@ async function teleportWithProgress(root3, sessionId) { sessionId }, undefined, false, undefined, this); } - root3.render(/* @__PURE__ */ jsx_dev_runtime499.jsxDEV(AppStateProvider, { + root2.render(/* @__PURE__ */ jsx_dev_runtime499.jsxDEV(AppStateProvider, { children: /* @__PURE__ */ jsx_dev_runtime499.jsxDEV(TeleportProgressWrapper, {}, undefined, false, undefined, this) }, undefined, false, undefined, this)); - const result3 = await teleportResumeCodeSession(sessionId, setStep); + const result2 = await teleportResumeCodeSession(sessionId, setStep); setStep("checking_out"); const { branchName, branchError - } = await checkOutTeleportedSessionBranch(result3.branch); + } = await checkOutTeleportedSessionBranch(result2.branch); return { - messages: processMessagesForTeleportResume(result3.log, branchError), + messages: processMessagesForTeleportResume(result2.log, branchError), branchName }; } @@ -774076,7 +696642,7 @@ var init_server5 = __esm(() => { } this._capabilities = mergeCapabilities(this._capabilities, capabilities); } - setRequestHandler(requestSchema, handler14) { + setRequestHandler(requestSchema, handler19) { const shape = getObjectShape(requestSchema); const methodSchema = shape?.method; if (!methodSchema) { @@ -774095,8 +696661,8 @@ var init_server5 = __esm(() => { if (typeof methodValue !== "string") { throw new Error("Schema method literal must be a string"); } - const method3 = methodValue; - if (method3 === "tools/call") { + const method2 = methodValue; + if (method2 === "tools/call") { const wrappedHandler = async (request, extra) => { const validatedRequest = safeParse3(CallToolRequestSchema, request); if (!validatedRequest.success) { @@ -774104,16 +696670,16 @@ var init_server5 = __esm(() => { throw new McpError(ErrorCode.InvalidParams, `Invalid tools/call request: ${errorMessage3}`); } const { params } = validatedRequest.data; - const result3 = await Promise.resolve(handler14(request, extra)); + const result2 = await Promise.resolve(handler19(request, extra)); if (params.task) { - const taskValidationResult = safeParse3(CreateTaskResultSchema, result3); + const taskValidationResult = safeParse3(CreateTaskResultSchema, result2); if (!taskValidationResult.success) { const errorMessage3 = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error); throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage3}`); } return taskValidationResult.data; } - const validationResult = safeParse3(CallToolResultSchema, result3); + const validationResult = safeParse3(CallToolResultSchema, result2); if (!validationResult.success) { const errorMessage3 = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error); throw new McpError(ErrorCode.InvalidParams, `Invalid tools/call result: ${errorMessage3}`); @@ -774122,55 +696688,55 @@ var init_server5 = __esm(() => { }; return super.setRequestHandler(requestSchema, wrappedHandler); } - return super.setRequestHandler(requestSchema, handler14); + return super.setRequestHandler(requestSchema, handler19); } - assertCapabilityForMethod(method3) { - switch (method3) { + assertCapabilityForMethod(method2) { + switch (method2) { case "sampling/createMessage": if (!this._clientCapabilities?.sampling) { - throw new Error(`Client does not support sampling (required for ${method3})`); + throw new Error(`Client does not support sampling (required for ${method2})`); } break; case "elicitation/create": if (!this._clientCapabilities?.elicitation) { - throw new Error(`Client does not support elicitation (required for ${method3})`); + throw new Error(`Client does not support elicitation (required for ${method2})`); } break; case "roots/list": if (!this._clientCapabilities?.roots) { - throw new Error(`Client does not support listing roots (required for ${method3})`); + throw new Error(`Client does not support listing roots (required for ${method2})`); } break; case "ping": break; } } - assertNotificationCapability(method3) { - switch (method3) { + assertNotificationCapability(method2) { + switch (method2) { case "notifications/message": if (!this._capabilities.logging) { - throw new Error(`Server does not support logging (required for ${method3})`); + throw new Error(`Server does not support logging (required for ${method2})`); } break; case "notifications/resources/updated": case "notifications/resources/list_changed": if (!this._capabilities.resources) { - throw new Error(`Server does not support notifying about resources (required for ${method3})`); + throw new Error(`Server does not support notifying about resources (required for ${method2})`); } break; case "notifications/tools/list_changed": if (!this._capabilities.tools) { - throw new Error(`Server does not support notifying of tool list changes (required for ${method3})`); + throw new Error(`Server does not support notifying of tool list changes (required for ${method2})`); } break; case "notifications/prompts/list_changed": if (!this._capabilities.prompts) { - throw new Error(`Server does not support notifying of prompt list changes (required for ${method3})`); + throw new Error(`Server does not support notifying of prompt list changes (required for ${method2})`); } break; case "notifications/elicitation/complete": if (!this._clientCapabilities?.elicitation?.url) { - throw new Error(`Client does not support URL elicitation (required for ${method3})`); + throw new Error(`Client does not support URL elicitation (required for ${method2})`); } break; case "notifications/cancelled": @@ -774179,38 +696745,38 @@ var init_server5 = __esm(() => { break; } } - assertRequestHandlerCapability(method3) { + assertRequestHandlerCapability(method2) { if (!this._capabilities) { return; } - switch (method3) { + switch (method2) { case "completion/complete": if (!this._capabilities.completions) { - throw new Error(`Server does not support completions (required for ${method3})`); + throw new Error(`Server does not support completions (required for ${method2})`); } break; case "logging/setLevel": if (!this._capabilities.logging) { - throw new Error(`Server does not support logging (required for ${method3})`); + throw new Error(`Server does not support logging (required for ${method2})`); } break; case "prompts/get": case "prompts/list": if (!this._capabilities.prompts) { - throw new Error(`Server does not support prompts (required for ${method3})`); + throw new Error(`Server does not support prompts (required for ${method2})`); } break; case "resources/list": case "resources/templates/list": case "resources/read": if (!this._capabilities.resources) { - throw new Error(`Server does not support resources (required for ${method3})`); + throw new Error(`Server does not support resources (required for ${method2})`); } break; case "tools/call": case "tools/list": if (!this._capabilities.tools) { - throw new Error(`Server does not support tools (required for ${method3})`); + throw new Error(`Server does not support tools (required for ${method2})`); } break; case "tasks/get": @@ -774218,7 +696784,7 @@ var init_server5 = __esm(() => { case "tasks/result": case "tasks/cancel": if (!this._capabilities.tasks) { - throw new Error(`Server does not support tasks capability (required for ${method3})`); + throw new Error(`Server does not support tasks capability (required for ${method2})`); } break; case "ping": @@ -774226,14 +696792,14 @@ var init_server5 = __esm(() => { break; } } - assertTaskCapability(method3) { - assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method3, "Client"); + assertTaskCapability(method2) { + assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method2, "Client"); } - assertTaskHandlerCapability(method3) { + assertTaskHandlerCapability(method2) { if (!this._capabilities) { return; } - assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method3, "Server"); + assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method2, "Server"); } async _oninitialize(request) { const requestedVersion = request.params.protocolVersion; @@ -774308,22 +696874,22 @@ var init_server5 = __esm(() => { throw new Error("Client does not support form elicitation."); } const formParams = params.mode === "form" ? params : { ...params, mode: "form" }; - const result3 = await this.request({ method: "elicitation/create", params: formParams }, ElicitResultSchema, options2); - if (result3.action === "accept" && result3.content && formParams.requestedSchema) { + const result2 = await this.request({ method: "elicitation/create", params: formParams }, ElicitResultSchema, options2); + if (result2.action === "accept" && result2.content && formParams.requestedSchema) { try { const validator = this._jsonSchemaValidator.getValidator(formParams.requestedSchema); - const validationResult = validator(result3.content); + const validationResult = validator(result2.content); if (!validationResult.valid) { throw new McpError(ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`); } - } catch (error46) { - if (error46 instanceof McpError) { - throw error46; + } catch (error42) { + if (error42 instanceof McpError) { + throw error42; } - throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error46 instanceof Error ? error46.message : String(error46)}`); + throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error42 instanceof Error ? error42.message : String(error42)}`); } } - return result3; + return result2; } } } @@ -774459,9 +697025,9 @@ async function startMCPServer(cwd3, debug3, verbose) { } ] }; - } catch (error46) { - logError2(error46); - const parts = error46 instanceof Error ? getErrorParts(error46) : [String(error46)]; + } catch (error42) { + logError2(error42); + const parts = error42 instanceof Error ? getErrorParts(error42) : [String(error42)]; const errorText = parts.filter(Boolean).join(` `).trim() || "Error"; return { @@ -774493,7 +697059,7 @@ var init_mcp4 = __esm(() => { init_abortController(); init_fileStateCache(); init_log3(); - init_messages5(); + init_messages3(); init_model(); init_permissions2(); init_Shell(); @@ -774509,23 +697075,23 @@ __export(exports_claudeDesktop, { readClaudeDesktopMcpServers: () => readClaudeDesktopMcpServers, getClaudeDesktopConfigPath: () => getClaudeDesktopConfigPath }); -import { readdir as readdir37, readFile as readFile64, stat as stat57 } from "fs/promises"; -import { homedir as homedir45 } from "os"; -import { join as join178 } from "path"; +import { readdir as readdir37, readFile as readFile63, stat as stat56 } from "fs/promises"; +import { homedir as homedir43 } from "os"; +import { join as join168 } from "path"; async function getClaudeDesktopConfigPath() { - const platform7 = getPlatform(); - if (!SUPPORTED_PLATFORMS.includes(platform7)) { - throw new Error(`Unsupported platform: ${platform7} - Claude Desktop integration only works on macOS and WSL.`); + const platform6 = getPlatform(); + if (!SUPPORTED_PLATFORMS.includes(platform6)) { + throw new Error(`Unsupported platform: ${platform6} - Claude Desktop integration only works on macOS and WSL.`); } - if (platform7 === "macos") { - return join178(homedir45(), "Library", "Application Support", "Claude", "claude_desktop_config.json"); + if (platform6 === "macos") { + return join168(homedir43(), "Library", "Application Support", "Claude", "claude_desktop_config.json"); } const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null; if (windowsHome) { const wslPath = windowsHome.replace(/^[A-Z]:/, ""); const configPath = `/mnt/c${wslPath}/AppData/Roaming/Claude/claude_desktop_config.json`; try { - await stat57(configPath); + await stat56(configPath); return configPath; } catch {} } @@ -774537,9 +697103,9 @@ async function getClaudeDesktopConfigPath() { if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") { continue; } - const potentialConfigPath = join178(usersDir, user.name, "AppData", "Roaming", "Claude", "claude_desktop_config.json"); + const potentialConfigPath = join168(usersDir, user.name, "AppData", "Roaming", "Claude", "claude_desktop_config.json"); try { - await stat57(potentialConfigPath); + await stat56(potentialConfigPath); return potentialConfigPath; } catch {} } @@ -774557,7 +697123,7 @@ async function readClaudeDesktopMcpServers() { const configPath = await getClaudeDesktopConfigPath(); let configContent; try { - configContent = await readFile64(configPath, { encoding: "utf8" }); + configContent = await readFile63(configPath, { encoding: "utf8" }); } catch (e) { const code = getErrnoCode(e); if (code === "ENOENT") { @@ -774565,11 +697131,11 @@ async function readClaudeDesktopMcpServers() { } throw e; } - const config6 = safeParseJSON(configContent); - if (!config6 || typeof config6 !== "object") { + const config4 = safeParseJSON(configContent); + if (!config4 || typeof config4 !== "object") { return {}; } - const mcpServers = config6.mcpServers; + const mcpServers = config4.mcpServers; if (!mcpServers || typeof mcpServers !== "object") { return {}; } @@ -774578,14 +697144,14 @@ async function readClaudeDesktopMcpServers() { if (!serverConfig || typeof serverConfig !== "object") { continue; } - const result3 = McpStdioServerConfigSchema().safeParse(serverConfig); - if (result3.success) { - servers[name] = result3.data; + const result2 = McpStdioServerConfigSchema().safeParse(serverConfig); + if (result2.success) { + servers[name] = result2.data; } } return servers; - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); return {}; } } @@ -774608,14 +697174,14 @@ __export(exports_mcp3, { mcpAddJsonHandler: () => mcpAddJsonHandler, mcpAddFromDesktopHandler: () => mcpAddFromDesktopHandler }); -import { stat as stat58 } from "fs/promises"; +import { stat as stat57 } from "fs/promises"; import { cwd as cwd3 } from "process"; async function checkMcpServerHealth(name, server) { try { - const result3 = await connectToServer(name, server); - if (result3.type === "connected") { + const result2 = await connectToServer(name, server); + if (result2.type === "connected") { return "✓ Connected"; - } else if (result3.type === "needs-auth") { + } else if (result2.type === "needs-auth") { return "! Needs authentication"; } else { return "✗ Failed to connect"; @@ -774631,12 +697197,12 @@ async function mcpServeHandler({ const providedCwd = cwd3(); logEvent("tengu_mcp_start", {}); try { - await stat58(providedCwd); - } catch (error46) { - if (isFsInaccessible(error46)) { + await stat57(providedCwd); + } catch (error42) { + if (isFsInaccessible(error42)) { cliError(`Error: Directory ${providedCwd} does not exist`); } - throw error46; + throw error42; } try { const { @@ -774647,8 +697213,8 @@ async function mcpServeHandler({ startMCPServer: startMCPServer2 } = await Promise.resolve().then(() => (init_mcp4(), exports_mcp2)); await startMCPServer2(providedCwd, debug3 ?? false, verbose ?? false); - } catch (error46) { - cliError(`Error: Failed to start MCP server: ${error46}`); + } catch (error42) { + cliError(`Error: Failed to start MCP server: ${error42}`); } } async function mcpRemoveHandler(name, options2) { @@ -774714,8 +697280,8 @@ To remove from a specific scope, use: }); cliError(); } - } catch (error46) { - cliError(error46.message); + } catch (error42) { + cliError(error42.message); } } async function mcpListHandler() { @@ -774845,17 +697411,17 @@ async function mcpAddJsonHandler(name, json2, options2) { type: transportType }); cliOk(`Added ${transportType} MCP server ${name} to ${scope} config`); - } catch (error46) { - cliError(error46.message); + } catch (error42) { + cliError(error42.message); } } async function mcpAddFromDesktopHandler(options2) { try { const scope = ensureConfigScope(options2.scope); - const platform7 = getPlatform(); + const platform6 = getPlatform(); logEvent("tengu_mcp_add", { scope, - platform: platform7, + platform: platform6, source: "desktop" }); const { @@ -774880,8 +697446,8 @@ async function mcpAddFromDesktopHandler(options2) { }, undefined, false, undefined, this), { exitOnCtrlC: true }); - } catch (error46) { - cliError(error46.message); + } catch (error42) { + cliError(error42.message); } } async function mcpResetChoicesHandler() { @@ -774902,10 +697468,10 @@ var init_mcp5 = __esm(() => { init_ink2(); init_KeybindingProviderSetup(); init_analytics(); - init_auth7(); - init_client10(); + init_auth6(); + init_client6(); init_config3(); - init_utils4(); + init_utils3(); init_AppState(); init_config2(); init_errors(); @@ -774987,9 +697553,9 @@ var init_lockfile = __esm(() => { var exports_connectHeadless = {}; __export(exports_connectHeadless, { default: () => connectHeadless_default, - __stub__: () => __stub__38 + __stub__: () => __stub__45 }); -var connectHeadless_default, __stub__38 = true; +var connectHeadless_default, __stub__45 = true; var init_connectHeadless = __esm(() => { connectHeadless_default = {}; }); @@ -775012,24 +697578,24 @@ __export(exports_plugins, { VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES, VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES }); -import { basename as basename64, dirname as dirname74 } from "path"; -function handleMarketplaceError(error46, action2) { - logError2(error46); - cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error46)}`); +import { basename as basename62, dirname as dirname70 } from "path"; +function handleMarketplaceError(error42, action2) { + logError2(error42); + cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error42)}`); } -function printValidationResult(result3) { - if (result3.errors.length > 0) { - console.log(`${figures_default.cross} Found ${result3.errors.length} ${plural(result3.errors.length, "error")}: +function printValidationResult(result2) { + if (result2.errors.length > 0) { + console.log(`${figures_default.cross} Found ${result2.errors.length} ${plural(result2.errors.length, "error")}: `); - result3.errors.forEach((error46) => { - console.log(` ${figures_default.pointer} ${error46.path}: ${error46.message}`); + result2.errors.forEach((error42) => { + console.log(` ${figures_default.pointer} ${error42.path}: ${error42.message}`); }); console.log(""); } - if (result3.warnings.length > 0) { - console.log(`${figures_default.warning} Found ${result3.warnings.length} ${plural(result3.warnings.length, "warning")}: + if (result2.warnings.length > 0) { + console.log(`${figures_default.warning} Found ${result2.warnings.length} ${plural(result2.warnings.length, "warning")}: `); - result3.warnings.forEach((warning) => { + result2.warnings.forEach((warning) => { console.log(` ${figures_default.pointer} ${warning.path}: ${warning.message}`); }); console.log(""); @@ -775039,15 +697605,15 @@ async function pluginValidateHandler(manifestPath, options2) { if (options2.cowork) setUseCoworkPlugins(true); try { - const result3 = await validateManifest3(manifestPath); - console.log(`Validating ${result3.fileType} manifest: ${result3.filePath} + const result2 = await validateManifest2(manifestPath); + console.log(`Validating ${result2.fileType} manifest: ${result2.filePath} `); - printValidationResult(result3); + printValidationResult(result2); let contentResults = []; - if (result3.fileType === "plugin") { - const manifestDir = dirname74(result3.filePath); - if (basename64(manifestDir) === ".claude-plugin") { - contentResults = await validatePluginContents(dirname74(manifestDir)); + if (result2.fileType === "plugin") { + const manifestDir = dirname70(result2.filePath); + if (basename62(manifestDir) === ".claude-plugin") { + contentResults = await validatePluginContents(dirname70(manifestDir)); for (const r of contentResults) { console.log(`Validating ${r.fileType}: ${r.filePath} `); @@ -775055,17 +697621,17 @@ async function pluginValidateHandler(manifestPath, options2) { } } } - const allSuccess = result3.success && contentResults.every((r) => r.success); - const hasWarnings = result3.warnings.length > 0 || contentResults.some((r) => r.warnings.length > 0); + const allSuccess = result2.success && contentResults.every((r) => r.success); + const hasWarnings = result2.warnings.length > 0 || contentResults.some((r) => r.warnings.length > 0); if (allSuccess) { cliOk(hasWarnings ? `${figures_default.tick} Validation passed with warnings` : `${figures_default.tick} Validation passed`); } else { console.log(`${figures_default.cross} Validation failed`); process.exit(1); } - } catch (error46) { - logError2(error46); - console.error(`${figures_default.cross} Unexpected error during validation: ${errorMessage(error46)}`); + } catch (error42) { + logError2(error42); + console.error(`${figures_default.cross} Unexpected error during validation: ${errorMessage(error42)}`); process.exit(2); } } @@ -775143,11 +697709,11 @@ async function pluginListHandler(options2) { if (options2.available) { const available = []; try { - const [config6, installCounts] = await Promise.all([ + const [config4, installCounts] = await Promise.all([ loadKnownMarketplacesConfig(), getInstallCounts() ]); - const { marketplaces } = await loadMarketplacesWithGracefulDegradation(config6); + const { marketplaces } = await loadMarketplacesWithGracefulDegradation(config4); for (const { name: marketplaceName, data: marketplace @@ -775199,8 +697765,8 @@ async function pluginListHandler(options2) { console.log(` Version: ${version4}`); console.log(` Scope: ${scope}`); console.log(` Status: ${status2}`); - for (const error46 of pluginErrors) { - console.log(` Error: ${getPluginErrorMessage(error46)}`); + for (const error42 of pluginErrors) { + console.log(` Error: ${getPluginErrorMessage(error42)}`); } console.log(""); } @@ -775268,19 +697834,19 @@ async function marketplaceAddHandler(source, options2) { source_type: sourceType }); cliOk(alreadyMaterialized ? `${figures_default.tick} Marketplace '${name}' already on disk — declared in ${scope} settings` : `${figures_default.tick} Successfully added marketplace: ${name} (declared in ${scope} settings)`); - } catch (error46) { - handleMarketplaceError(error46, "add marketplace"); + } catch (error42) { + handleMarketplaceError(error42, "add marketplace"); } } async function marketplaceListHandler(options2) { if (options2.cowork) setUseCoworkPlugins(true); try { - const config6 = await loadKnownMarketplacesConfig(); - const names = Object.keys(config6); + const config4 = await loadKnownMarketplacesConfig(); + const names = Object.keys(config4); if (options2.json) { const marketplaces = names.sort().map((name) => { - const marketplace = config6[name]; + const marketplace = config4[name]; const source = marketplace?.source; return { name, @@ -775301,7 +697867,7 @@ async function marketplaceListHandler(options2) { console.log(`Configured marketplaces: `); names.forEach((name) => { - const marketplace = config6[name]; + const marketplace = config4[name]; console.log(` ${figures_default.pointer} ${name}`); if (marketplace?.source) { const src = marketplace.source; @@ -775320,8 +697886,8 @@ async function marketplaceListHandler(options2) { console.log(""); }); cliOk(); - } catch (error46) { - handleMarketplaceError(error46, "list marketplaces"); + } catch (error42) { + handleMarketplaceError(error42, "list marketplaces"); } } async function marketplaceRemoveHandler(name, options2) { @@ -775334,8 +697900,8 @@ async function marketplaceRemoveHandler(name, options2) { marketplace_name: name }); cliOk(`${figures_default.tick} Successfully removed marketplace: ${name}`); - } catch (error46) { - handleMarketplaceError(error46, "remove marketplace"); + } catch (error42) { + handleMarketplaceError(error42, "remove marketplace"); } } async function marketplaceUpdateHandler(name, options2) { @@ -775353,8 +697919,8 @@ async function marketplaceUpdateHandler(name, options2) { }); cliOk(`${figures_default.tick} Successfully updated marketplace: ${name}`); } else { - const config6 = await loadKnownMarketplacesConfig(); - const marketplaceNames = Object.keys(config6); + const config4 = await loadKnownMarketplacesConfig(); + const marketplaceNames = Object.keys(config4); if (marketplaceNames.length === 0) { cliOk("No marketplaces configured"); } @@ -775366,8 +697932,8 @@ async function marketplaceUpdateHandler(name, options2) { }); cliOk(`${figures_default.tick} Successfully updated ${marketplaceNames.length} marketplace(s)`); } - } catch (error46) { - handleMarketplaceError(error46, "update marketplace(s)"); + } catch (error42) { + handleMarketplaceError(error42, "update marketplace(s)"); } } async function pluginInstallHandler(plugin2, options2) { @@ -775524,13 +698090,13 @@ var exports_install = {}; __export(exports_install, { install: () => install }); -import { homedir as homedir46 } from "node:os"; -import { join as join179 } from "node:path"; +import { homedir as homedir44 } from "node:os"; +import { join as join169 } from "node:path"; function getInstallationPath2() { const isWindows2 = env3.platform === "win32"; - const homeDir = homedir46(); + const homeDir = homedir44(); if (isWindows2) { - const windowsPath = join179(homeDir, ".local", "bin", "claude.exe"); + const windowsPath = join169(homeDir, ".local", "bin", "claude.exe"); return windowsPath.replace(/\//g, "\\"); } return "~/.local/bin/claude"; @@ -775617,17 +698183,17 @@ function Install({ version: channelOrVersion }); logForDebugging(`Install: Calling installLatest(channelOrVersion=${channelOrVersion}, forceReinstall=${force})`); - const result3 = await installLatest(channelOrVersion, force); - logForDebugging(`Install: installLatest returned version=${result3.latestVersion}, wasUpdated=${result3.wasUpdated}, lockFailed=${result3.lockFailed}`); - if (result3.lockFailed) { + const result2 = await installLatest(channelOrVersion, force); + logForDebugging(`Install: installLatest returned version=${result2.latestVersion}, wasUpdated=${result2.wasUpdated}, lockFailed=${result2.lockFailed}`); + if (result2.lockFailed) { throw new Error("Could not install - another process is currently installing Claude. Please try again in a moment."); } - if (!result3.latestVersion) { + if (!result2.latestVersion) { logForDebugging("Install: Failed to retrieve version information during install", { level: "error" }); } - if (!result3.wasUpdated) { + if (!result2.wasUpdated) { logForDebugging("Install: Already up to date"); } setState({ @@ -775655,7 +698221,7 @@ function Install({ logForDebugging(`Shell alias cleanup: ${aliasMessages.map((m) => m.message).join("; ")}`); } logEvent("tengu_claude_install_command", { - has_version: result3.latestVersion ? 1 : 0, + has_version: result2.latestVersion ? 1 : 0, forced: force ? 1 : 0 }); if (target === "latest" || target === "stable") { @@ -775672,24 +698238,24 @@ function Install({ }); setTimeout(setState, 2000, { type: "success", - version: result3.latestVersion || "current", + version: result2.latestVersion || "current", setupMessages: [...setupMessages.map((m_2) => m_2.message), ...allWarnings] }); } else { logForDebugging("Install: Shell PATH already configured"); setState({ type: "success", - version: result3.latestVersion || "current", + version: result2.latestVersion || "current", setupMessages: allWarnings.length > 0 ? allWarnings : undefined }); } - } catch (error46) { - logForDebugging(`Install command failed: ${error46}`, { + } catch (error42) { + logForDebugging(`Install command failed: ${error42}`, { level: "error" }); setState({ type: "error", - message: errorMessage(error46) + message: errorMessage(error42) }); } } @@ -775866,9 +698432,9 @@ var init_install = __esm(() => { const { unmount } = await render(/* @__PURE__ */ jsx_dev_runtime502.jsxDEV(Install, { - onDone: (result3, options2) => { + onDone: (result2, options2) => { unmount(); - onDone(result3, options2); + onDone(result2, options2); }, force, target @@ -775885,14 +698451,14 @@ __export(exports_util3, { doctorHandler: () => doctorHandler }); import { cwd as cwd4 } from "process"; -async function setupTokenHandler(root3) { +async function setupTokenHandler(root2) { logEvent("tengu_setup_token_command", {}); const showAuthWarning = !isAnthropicAuthEnabled(); const { ConsoleOAuthFlow: ConsoleOAuthFlow2 } = await Promise.resolve().then(() => (init_ConsoleOAuthFlow(), exports_ConsoleOAuthFlow)); - await new Promise((resolve49) => { - root3.render(/* @__PURE__ */ jsx_dev_runtime503.jsxDEV(AppStateProvider, { + await new Promise((resolve43) => { + root2.render(/* @__PURE__ */ jsx_dev_runtime503.jsxDEV(AppStateProvider, { onChangeAppState, children: /* @__PURE__ */ jsx_dev_runtime503.jsxDEV(KeybindingSetup, { children: /* @__PURE__ */ jsx_dev_runtime503.jsxDEV(ThemedBox_default, { @@ -775915,7 +698481,7 @@ async function setupTokenHandler(root3) { }, undefined, true, undefined, this), /* @__PURE__ */ jsx_dev_runtime503.jsxDEV(ConsoleOAuthFlow2, { onDone: () => { - resolve49(); + resolve43(); }, mode: "setup-token", startingMessage: "This will guide you through long-lived (1-year) auth token setup for your Claude account. Claude subscription required." @@ -775925,7 +698491,7 @@ async function setupTokenHandler(root3) { }, undefined, false, undefined, this) }, undefined, false, undefined, this)); }); - root3.unmount(); + root2.unmount(); process.exit(0); } function DoctorWithPlugins(t0) { @@ -775949,24 +698515,24 @@ function DoctorWithPlugins(t0) { } return t1; } -async function doctorHandler(root3) { +async function doctorHandler(root2) { logEvent("tengu_doctor_command", {}); - await new Promise((resolve49) => { - root3.render(/* @__PURE__ */ jsx_dev_runtime503.jsxDEV(AppStateProvider, { + await new Promise((resolve43) => { + root2.render(/* @__PURE__ */ jsx_dev_runtime503.jsxDEV(AppStateProvider, { children: /* @__PURE__ */ jsx_dev_runtime503.jsxDEV(KeybindingSetup, { children: /* @__PURE__ */ jsx_dev_runtime503.jsxDEV(MCPConnectionManager, { dynamicMcpConfig: undefined, isStrictMcpConfig: false, children: /* @__PURE__ */ jsx_dev_runtime503.jsxDEV(DoctorWithPlugins, { onDone: () => { - resolve49(); + resolve43(); } }, undefined, false, undefined, this) }, undefined, false, undefined, this) }, undefined, false, undefined, this) }, undefined, false, undefined, this)); }); - root3.unmount(); + root2.unmount(); process.exit(0); } async function installHandler(target, options2) { @@ -775977,20 +698543,20 @@ async function installHandler(target, options2) { const { install: install2 } = await Promise.resolve().then(() => (init_install(), exports_install)); - await new Promise((resolve49) => { + await new Promise((resolve43) => { const args = []; if (target) args.push(target); if (options2.force) args.push("--force"); - install2.call((result3) => { - resolve49(); - process.exit(result3.includes("failed") ? 1 : 0); + install2.call((result2) => { + resolve43(); + process.exit(result2.includes("failed") ? 1 : 0); }, {}, args); }); } var import_compiler_runtime395, import_react342, jsx_dev_runtime503, DoctorLazy; -var init_util8 = __esm(() => { +var init_util7 = __esm(() => { import_compiler_runtime395 = __toESM(require_compiler_runtime(), 1); import_react342 = __toESM(require_react(), 1); init_WelcomeV2(); @@ -776001,7 +698567,7 @@ var init_util8 = __esm(() => { init_MCPConnectionManager(); init_AppState(); init_onChangeAppState(); - init_auth2(); + init_auth(); jsx_dev_runtime503 = __toESM(require_jsx_dev_runtime(), 1); DoctorLazy = import_react342.default.lazy(() => Promise.resolve().then(() => (init_Doctor(), exports_Doctor)).then((m) => ({ default: m.Doctor @@ -776077,17 +698643,17 @@ function autoModeDefaultsHandler() { writeRules(getDefaultExternalAutoModeRules()); } function autoModeConfigHandler() { - const config6 = getAutoModeConfig(); - const defaults4 = getDefaultExternalAutoModeRules(); + const config4 = getAutoModeConfig(); + const defaults3 = getDefaultExternalAutoModeRules(); writeRules({ - allow: config6?.allow?.length ? config6.allow : defaults4.allow, - soft_deny: config6?.soft_deny?.length ? config6.soft_deny : defaults4.soft_deny, - environment: config6?.environment?.length ? config6.environment : defaults4.environment + allow: config4?.allow?.length ? config4.allow : defaults3.allow, + soft_deny: config4?.soft_deny?.length ? config4.soft_deny : defaults3.soft_deny, + environment: config4?.environment?.length ? config4.environment : defaults3.environment }); } async function autoModeCritiqueHandler(options2) { - const config6 = getAutoModeConfig(); - const hasCustomRules = (config6?.allow?.length ?? 0) > 0 || (config6?.soft_deny?.length ?? 0) > 0 || (config6?.environment?.length ?? 0) > 0; + const config4 = getAutoModeConfig(); + const hasCustomRules = (config4?.allow?.length ?? 0) > 0 || (config4?.soft_deny?.length ?? 0) > 0 || (config4?.environment?.length ?? 0) > 0; if (!hasCustomRules) { process.stdout.write(`No custom auto mode rules found. @@ -776096,9 +698662,9 @@ async function autoModeCritiqueHandler(options2) { return; } const model = options2.model ? parseUserSpecifiedModel(options2.model) : getMainLoopModel(); - const defaults4 = getDefaultExternalAutoModeRules(); + const defaults3 = getDefaultExternalAutoModeRules(); const classifierPrompt = buildDefaultExternalSystemPrompt(); - const userRulesSummary = formatRulesForCritique("allow", config6?.allow ?? [], defaults4.allow) + formatRulesForCritique("soft_deny", config6?.soft_deny ?? [], defaults4.soft_deny) + formatRulesForCritique("environment", config6?.environment ?? [], defaults4.environment); + const userRulesSummary = formatRulesForCritique("allow", config4?.allow ?? [], defaults3.allow) + formatRulesForCritique("soft_deny", config4?.soft_deny ?? [], defaults3.soft_deny) + formatRulesForCritique("environment", config4?.environment ?? [], defaults3.environment); process.stdout.write(`Analyzing your auto mode rules… `); @@ -776126,8 +698692,8 @@ Please critique these custom rules.` } ] }); - } catch (error46) { - process.stderr.write("Failed to analyze rules: " + errorMessage(error46) + ` + } catch (error42) { + process.stderr.write("Failed to analyze rules: " + errorMessage(error42) + ` `); process.exitCode = 1; return; @@ -776187,9 +698753,9 @@ var init_autoMode = __esm(() => { // src/cli/update.ts var exports_update = {}; __export(exports_update, { - update: () => update3 + update: () => update2 }); -async function update3() { +async function update2() { logEvent("tengu_update_check", {}); writeToStdout(`Current version: ${"2.1.88-custom"} `); @@ -776224,8 +698790,8 @@ async function update3() { `)); } } - const config6 = getGlobalConfig(); - if (!config6.installMethod && diagnostic.installationType !== "package-manager") { + const config4 = getGlobalConfig(); + if (!config4.installMethod && diagnostic.installationType !== "package-manager") { writeToStdout(` `); writeToStdout(`Updating configuration to track installation method... @@ -776321,7 +698887,7 @@ async function update3() { } await gracefulShutdown(0); } - if (config6.installMethod && diagnostic.configInstallMethod !== "not set" && diagnostic.installationType !== "package-manager") { + if (config4.installMethod && diagnostic.configInstallMethod !== "not set" && diagnostic.installationType !== "package-manager") { const runningType = diagnostic.installationType; const configExpects = diagnostic.configInstallMethod; const typeMapping = { @@ -776354,38 +698920,38 @@ async function update3() { if (diagnostic.installationType === "native") { logForDebugging("update: Detected native installation, using native updater"); try { - const result3 = await installLatest(channel, true); - if (result3.lockFailed) { - const pidInfo = result3.lockHolderPid ? ` (PID ${result3.lockHolderPid})` : ""; + const result2 = await installLatest(channel, true); + if (result2.lockFailed) { + const pidInfo = result2.lockHolderPid ? ` (PID ${result2.lockHolderPid})` : ""; writeToStdout(source_default.yellow(`Another Claude process${pidInfo} is currently running. Please try again in a moment.`) + ` `); await gracefulShutdown(0); } - if (!result3.latestVersion) { + if (!result2.latestVersion) { process.stderr.write(`Failed to check for updates `); await gracefulShutdown(1); } - if (result3.latestVersion === "2.1.88-custom") { + if (result2.latestVersion === "2.1.88-custom") { writeToStdout(source_default.green(`Claude Code is up to date (${"2.1.88-custom"})`) + ` `); } else { - writeToStdout(source_default.green(`Successfully updated from ${"2.1.88-custom"} to version ${result3.latestVersion}`) + ` + writeToStdout(source_default.green(`Successfully updated from ${"2.1.88-custom"} to version ${result2.latestVersion}`) + ` `); await regenerateCompletionCache(); } await gracefulShutdown(0); - } catch (error46) { + } catch (error42) { process.stderr.write(`Error: Failed to install native update `); - process.stderr.write(String(error46) + ` + process.stderr.write(String(error42) + ` `); process.stderr.write(`Try running "claude doctor" for diagnostics `); await gracefulShutdown(1); } } - if (config6.installMethod !== "native") { + if (config4.installMethod !== "native") { await removeInstalledSymlink(); } logForDebugging("update: Checking npm registry for latest version"); @@ -776524,7 +699090,7 @@ async function update3() { } await gracefulShutdown(0); } -var init_update3 = __esm(() => { +var init_update2 = __esm(() => { init_source(); init_analytics(); init_autoUpdater(); @@ -776545,8 +699111,8 @@ __export(exports_main4, { startDeferredPrefetches: () => startDeferredPrefetches, main: () => main }); -import { readFileSync as readFileSync20 } from "fs"; -import { resolve as resolve49 } from "path"; +import { readFileSync as readFileSync13 } from "fs"; +import { resolve as resolve43 } from "path"; function logManagedSettings() { try { const policySettings = getSettingsForSource("policySettings"); @@ -776587,23 +699153,23 @@ function logSessionTelemetry() { const managedNames = getManagedPluginNames(); logPluginsEnabledForSession(enabled, managedNames, getPluginSeedDirs()); logPluginLoadErrors(errors7, managedNames); - }).catch((err3) => logError2(err3)); + }).catch((err2) => logError2(err2)); } function getCertEnvVarTelemetry() { - const result3 = {}; + const result2 = {}; if (process.env.NODE_EXTRA_CA_CERTS) { - result3.has_node_extra_ca_certs = true; + result2.has_node_extra_ca_certs = true; } if (process.env.CLAUDE_CODE_CLIENT_CERT) { - result3.has_client_cert = true; + result2.has_client_cert = true; } if (hasNodeOption("--use-system-ca")) { - result3.has_use_system_ca = true; + result2.has_use_system_ca = true; } if (hasNodeOption("--use-openssl-ca")) { - result3.has_use_openssl_ca = true; + result2.has_use_openssl_ca = true; } - return result3; + return result2; } async function logStartupTelemetry() { if (isAnalyticsDisabled()) @@ -776703,7 +699269,7 @@ function loadSettingsFromFlag(settingsFile) { resolvedPath: resolvedSettingsPath } = safeResolvePath(getFsImplementation(), settingsFile); try { - readFileSync20(resolvedSettingsPath, "utf8"); + readFileSync13(resolvedSettingsPath, "utf8"); } catch (e) { if (isENOENT(e)) { process.stderr.write(source_default.red(`Error: Settings file not found: ${resolvedSettingsPath} @@ -776716,11 +699282,11 @@ function loadSettingsFromFlag(settingsFile) { } setFlagSettingsPath(settingsPath); resetSettingsCache(); - } catch (error46) { - if (error46 instanceof Error) { - logError2(error46); + } catch (error42) { + if (error42 instanceof Error) { + logError2(error42); } - process.stderr.write(source_default.red(`Error processing settings: ${errorMessage(error46)} + process.stderr.write(source_default.red(`Error processing settings: ${errorMessage(error42)} `)); process.exit(1); } @@ -776730,11 +699296,11 @@ function loadSettingSourcesFromFlag(settingSourcesArg) { const sources = parseSettingSourcesFlag(settingSourcesArg); setAllowedSettingSources(sources); resetSettingsCache(); - } catch (error46) { - if (error46 instanceof Error) { - logError2(error46); + } catch (error42) { + if (error42 instanceof Error) { + logError2(error42); } - process.stderr.write(source_default.red(`Error processing --setting-sources: ${errorMessage(error46)} + process.stderr.write(source_default.red(`Error processing --setting-sources: ${errorMessage(error42)} `)); process.exit(1); } @@ -776792,7 +699358,7 @@ async function main() { const parsed = parseConnectUrl(ccUrl); _pendingConnect.dangerouslySkipPermissions = rawCliArgs.includes("--dangerously-skip-permissions"); if (rawCliArgs.includes("-p") || rawCliArgs.includes("--print")) { - const stripped = rawCliArgs.filter((_, i4) => i4 !== ccIdx); + const stripped = rawCliArgs.filter((_, i3) => i3 !== ccIdx); const dspIdx = stripped.indexOf("--dangerously-skip-permissions"); if (dspIdx !== -1) { stripped.splice(dspIdx, 1); @@ -776801,7 +699367,7 @@ async function main() { } else { _pendingConnect.url = parsed.serverUrl; _pendingConnect.authToken = parsed.authToken; - const stripped = rawCliArgs.filter((_, i4) => i4 !== ccIdx); + const stripped = rawCliArgs.filter((_, i3) => i3 !== ccIdx); const dspIdx = stripped.indexOf("--dangerously-skip-permissions"); if (dspIdx !== -1) { stripped.splice(dspIdx, 1); @@ -776875,15 +699441,15 @@ async function main() { rawCliArgs.splice(pmEqIdx, 1); } const extractFlag = (flag, opts = {}) => { - const i4 = rawCliArgs.indexOf(flag); - if (i4 !== -1) { + const i3 = rawCliArgs.indexOf(flag); + if (i3 !== -1) { _pendingSSH.extraCliArgs.push(opts.as ?? flag); - const val = rawCliArgs[i4 + 1]; + const val = rawCliArgs[i3 + 1]; if (opts.hasValue && val && !val.startsWith("-")) { _pendingSSH.extraCliArgs.push(val); - rawCliArgs.splice(i4, 2); + rawCliArgs.splice(i3, 2); } else { - rawCliArgs.splice(i4, 1); + rawCliArgs.splice(i3, 1); } } const eqI = rawCliArgs.findIndex((a2) => a2.startsWith(`${flag}=`)); @@ -776910,14 +699476,14 @@ async function main() { _pendingSSH.cwd = rawCliArgs[2]; consumed = 3; } - const rest3 = rawCliArgs.slice(consumed); - if (rest3.includes("-p") || rest3.includes("--print")) { + const rest2 = rawCliArgs.slice(consumed); + if (rest2.includes("-p") || rest2.includes("--print")) { process.stderr.write(`Error: headless (-p/--print) mode is not supported with claude ssh `); gracefulShutdownSync(1); return; } - process.argv = [process.argv[0], process.argv[1], ...rest3]; + process.argv = [process.argv[0], process.argv[1], ...rest2]; } } const cliArgs = process.argv.slice(2); @@ -776975,8 +699541,8 @@ async function getInputPrompt(prompt, inputFormat) { } process.stdin.setEncoding("utf8"); let data = ""; - const onData = (chunk4) => { - data += chunk4; + const onData = (chunk3) => { + data += chunk3; }; process.stdin.on("data", onData); const timedOut = await peekForStdinData(process.stdin, 3000); @@ -777007,7 +699573,7 @@ async function run() { profileCheckpoint("preAction_start"); await Promise.all([ensureMdmSettingsLoaded(), ensureKeychainPrefetchCompleted()]); profileCheckpoint("preAction_after_mdm"); - await init2(); + await init(); profileCheckpoint("preAction_after_init"); if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)) { process.title = "claude"; @@ -777120,7 +699686,7 @@ async function run() { let inputFormat = options2.inputFormat; let verbose = options2.verbose ?? getGlobalConfig().verbose; let print = options2.print; - const init3 = options2.init ?? false; + const init2 = options2.init ?? false; const initOnly = options2.initOnly ?? false; const maintenance = options2.maintenance ?? false; const disableSlashCommands = options2.disableSlashCommands || false; @@ -777236,14 +699802,14 @@ ${getTmuxInstallInstructions2()} process.exit(1); } const fileSessionId = process.env.CLAUDE_CODE_REMOTE_SESSION_ID || getSessionId(); - const files3 = parseFileSpecs(fileSpecs); - if (files3.length > 0) { - const config6 = { + const files2 = parseFileSpecs(fileSpecs); + if (files2.length > 0) { + const config4 = { baseUrl: process.env.ANTHROPIC_BASE_URL || getOauthConfig().BASE_API_URL, oauthToken: sessionToken, sessionId: fileSessionId }; - fileDownloadPromise = downloadSessionFiles(files3, config6); + fileDownloadPromise = downloadSessionFiles(files2, config4); } } const isNonInteractiveSession = getIsNonInteractiveSession(); @@ -777260,16 +699826,16 @@ ${getTmuxInstallInstructions2()} process.exit(1); } try { - const filePath = resolve49(options2.systemPromptFile); - systemPrompt = readFileSync20(filePath, "utf8"); - } catch (error46) { - const code = getErrnoCode(error46); + const filePath = resolve43(options2.systemPromptFile); + systemPrompt = readFileSync13(filePath, "utf8"); + } catch (error42) { + const code = getErrnoCode(error42); if (code === "ENOENT") { - process.stderr.write(source_default.red(`Error: System prompt file not found: ${resolve49(options2.systemPromptFile)} + process.stderr.write(source_default.red(`Error: System prompt file not found: ${resolve43(options2.systemPromptFile)} `)); process.exit(1); } - process.stderr.write(source_default.red(`Error reading system prompt file: ${errorMessage(error46)} + process.stderr.write(source_default.red(`Error reading system prompt file: ${errorMessage(error42)} `)); process.exit(1); } @@ -777282,16 +699848,16 @@ ${getTmuxInstallInstructions2()} process.exit(1); } try { - const filePath = resolve49(options2.appendSystemPromptFile); - appendSystemPrompt = readFileSync20(filePath, "utf8"); - } catch (error46) { - const code = getErrnoCode(error46); + const filePath = resolve43(options2.appendSystemPromptFile); + appendSystemPrompt = readFileSync13(filePath, "utf8"); + } catch (error42) { + const code = getErrnoCode(error42); if (code === "ENOENT") { - process.stderr.write(source_default.red(`Error: Append system prompt file not found: ${resolve49(options2.appendSystemPromptFile)} + process.stderr.write(source_default.red(`Error: Append system prompt file not found: ${resolve43(options2.appendSystemPromptFile)} `)); process.exit(1); } - process.stderr.write(source_default.red(`Error reading append system prompt file: ${errorMessage(error46)} + process.stderr.write(source_default.red(`Error reading append system prompt file: ${errorMessage(error42)} `)); process.exit(1); } @@ -777317,7 +699883,7 @@ ${addendum}` : addendum; } let dynamicMcpConfig = {}; if (mcpConfig && mcpConfig.length > 0) { - const processedConfigs = mcpConfig.map((config6) => config6.trim()).filter((config6) => config6.length > 0); + const processedConfigs = mcpConfig.map((config4) => config4.trim()).filter((config4) => config4.length > 0); let allConfigs = {}; const allErrors = []; for (const configItem of processedConfigs) { @@ -777325,28 +699891,28 @@ ${addendum}` : addendum; let errors7 = []; const parsedJson = safeParseJSON(configItem); if (parsedJson) { - const result3 = parseMcpConfig({ + const result2 = parseMcpConfig({ configObject: parsedJson, filePath: "command line", expandVars: true, scope: "dynamic" }); - if (result3.config) { - configs = result3.config.mcpServers; + if (result2.config) { + configs = result2.config.mcpServers; } else { - errors7 = result3.errors; + errors7 = result2.errors; } } else { - const configPath = resolve49(configItem); - const result3 = parseMcpConfigFromFilePath({ + const configPath = resolve43(configItem); + const result2 = parseMcpConfigFromFilePath({ filePath: configPath, expandVars: true, scope: "dynamic" }); - if (result3.config) { - configs = result3.config.mcpServers; + if (result2.config) { + configs = result2.config.mcpServers; } else { - errors7 = result3.errors; + errors7 = result2.errors; } } if (errors7.length > 0) { @@ -777359,7 +699925,7 @@ ${addendum}` : addendum; } } if (allErrors.length > 0) { - const formattedErrors = allErrors.map((err3) => `${err3.path ? err3.path + ": " : ""}${err3.message}`).join(` + const formattedErrors = allErrors.map((err2) => `${err2.path ? err2.path + ": " : ""}${err2.message}`).join(` `); logForDebugging(`--mcp-config validation failed (${allErrors.length} errors): ${formattedErrors}`, { level: "error" @@ -777370,7 +699936,7 @@ ${formattedErrors} process.exit(1); } if (Object.keys(allConfigs).length > 0) { - const nonSdkConfigNames = Object.entries(allConfigs).filter(([, config6]) => config6.type !== "sdk").map(([name]) => name); + const nonSdkConfigNames = Object.entries(allConfigs).filter(([, config4]) => config4.type !== "sdk").map(([name]) => name); let reservedNameError = null; if (nonSdkConfigNames.some(isClaudeInChromeMCPServer)) { reservedNameError = `Invalid MCP configuration: "${CLAUDE_IN_CHROME_MCP_SERVER_NAME}" is a reserved MCP name.`; @@ -777388,8 +699954,8 @@ ${formattedErrors} `); process.exit(1); } - const scopedConfigs = mapValues_default(allConfigs, (config6) => ({ - ...config6, + const scopedConfigs = mapValues_default(allConfigs, (config4) => ({ + ...config4, scope: "dynamic" })); const { @@ -777411,10 +699977,10 @@ ${formattedErrors} const enableClaudeInChrome = shouldEnableClaudeInChrome(chromeOpts.chrome) && isClaudeAISubscriber(); const autoEnableClaudeInChrome = !enableClaudeInChrome && shouldAutoEnableClaudeInChrome(); if (enableClaudeInChrome) { - const platform7 = getPlatform(); + const platform6 = getPlatform(); try { logEvent("tengu_claude_in_chrome_setup", { - platform: platform7 + platform: platform6 }); const { mcpConfig: chromeMcpConfig, @@ -777431,12 +699997,12 @@ ${formattedErrors} ${appendSystemPrompt}` : chromeSystemPrompt; } - } catch (error46) { + } catch (error42) { logEvent("tengu_claude_in_chrome_setup_failed", { - platform: platform7 + platform: platform6 }); - logForDebugging(`[Claude in Chrome] Error: ${error46}`); - logError2(error46); + logForDebugging(`[Claude in Chrome] Error: ${error42}`); + logError2(error42); console.error(`Error: Failed to run with Claude in Chrome.`); process.exit(1); } @@ -777453,8 +700019,8 @@ ${appendSystemPrompt}` : chromeSystemPrompt; appendSystemPrompt = appendSystemPrompt ? `${appendSystemPrompt} ${hint}` : hint; - } catch (error46) { - logForDebugging(`[Claude in Chrome] Error (auto-enable): ${error46}`); + } catch (error42) { + logForDebugging(`[Claude in Chrome] Error (auto-enable): ${error42}`); } } const strictMcpConfig = options2.strictMcpConfig || false; @@ -777487,8 +700053,8 @@ ${hint}` : hint; }; allowedTools.push(...cuTools); } - } catch (error46) { - logForDebugging(`[Computer Use MCP] Setup failed: ${errorMessage(error46)}`); + } catch (error42) { + logForDebugging(`[Computer Use MCP] Setup failed: ${errorMessage(error42)}`); } } setAdditionalDirectoriesForClaudeMd(addDir2); @@ -777499,15 +700065,15 @@ ${hint}` : hint; const bad = []; for (const c6 of raw) { if (c6.startsWith("plugin:")) { - const rest3 = c6.slice(7); - const at3 = rest3.indexOf("@"); - if (at3 <= 0 || at3 === rest3.length - 1) { + const rest2 = c6.slice(7); + const at2 = rest2.indexOf("@"); + if (at2 <= 0 || at2 === rest2.length - 1) { bad.push(c6); } else { entries.push({ kind: "plugin", - name: rest3.slice(0, at3), - marketplace: rest3.slice(at3 + 1) + name: rest2.slice(0, at2), + marketplace: rest2.slice(at2 + 1) }); } } else if (c6.startsWith("server:") && c6.length > 7) { @@ -777605,9 +700171,9 @@ ${hint}` : hint; let mcpConfigResolvedMs; const mcpConfigPromise = (strictMcpConfig || isBareMode() ? Promise.resolve({ servers: {} - }) : getClaudeCodeMcpConfigs(dynamicMcpConfig)).then((result3) => { + }) : getClaudeCodeMcpConfigs(dynamicMcpConfig)).then((result2) => { mcpConfigResolvedMs = Date.now() - mcpConfigStart; - return result3; + return result2; }); if (inputFormat && inputFormat !== "text" && inputFormat !== "stream-json") { console.error(`Error: Invalid input format "${inputFormat}".`); @@ -777724,8 +700290,8 @@ ${hint}` : hint; if (parsedAgents) { cliAgents = parseAgentsFromJson(parsedAgents, "flagSettings"); } - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } const allAgents = [...agentDefinitionsResult.allAgents, ...cliAgents]; @@ -777856,7 +700422,7 @@ ${proactivePrompt}` : proactivePrompt; ${assistantAddendum}` : assistantAddendum; } - let root3; + let root2; let getFpsMetrics; let stats2; if (!isNonInteractiveSession) { @@ -777867,14 +700433,14 @@ ${assistantAddendum}` : assistantAddendum; const { createRoot: createRoot3 } = await Promise.resolve().then(() => (init_ink2(), exports_ink)); - root3 = await createRoot3(ctx.renderOptions); + root2 = await createRoot3(ctx.renderOptions); logEvent("tengu_timer", { event: "startup", durationMs: Math.round(process.uptime() * 1000) }); logForDebugging("[STARTUP] Running showSetupScreens()..."); const setupScreensStart = Date.now(); - const onboardingShown = await showSetupScreens(root3, permissionMode, allowDangerouslySkipPermissions, commands, enableClaudeInChrome, devChannels); + const onboardingShown = await showSetupScreens(root2, permissionMode, allowDangerouslySkipPermissions, commands, enableClaudeInChrome, devChannels); logForDebugging(`[STARTUP] showSetupScreens() completed in ${Date.now() - setupScreensStart}ms`); if (feature("BRIDGE_MODE") && remoteControlOption !== undefined) { const { @@ -777890,7 +700456,7 @@ ${assistantAddendum}` : assistantAddendum; } if (feature("AGENT_MEMORY_SNAPSHOT") && mainThreadAgentDefinition && isCustomAgent(mainThreadAgentDefinition) && mainThreadAgentDefinition.memory && mainThreadAgentDefinition.pendingSnapshotUpdate) { const agentDef = mainThreadAgentDefinition; - const choice = await launchSnapshotUpdateDialog(root3, { + const choice = await launchSnapshotUpdateDialog(root2, { agentType: agentDef.agentType, scope: agentDef.memory, snapshotTimestamp: agentDef.pendingSnapshotUpdate.snapshotTimestamp @@ -777921,7 +700487,7 @@ ${inputPrompt}` : mergePrompt; } const orgValidation = await validateForceLoginOrg(); if (!orgValidation.valid) { - await exitWithError2(root3, orgValidation.message); + await exitWithError2(root2, orgValidation.message); } } if (process.exitCode !== undefined) { @@ -777935,7 +700501,7 @@ ${inputPrompt}` : mergePrompt; } = getSettingsWithErrors(); const nonMcpErrors = errors7.filter((e) => !e.mcpErrorMetadata); if (nonMcpErrors.length > 0) { - await launchInvalidSettingsDialog(root3, { + await launchInvalidSettingsDialog(root2, { settingsErrors: nonMcpErrors, onExit: () => gracefulShutdownSync(1) }); @@ -777947,7 +700513,7 @@ ${inputPrompt}` : mergePrompt; if (!skipStartupPrefetches) { const lastPrefetchedInfo = lastPrefetched > 0 ? ` last ran ${Math.round((Date.now() - lastPrefetched) / 1000)}s ago` : ""; logForDebugging(`Starting background startup prefetches${lastPrefetchedInfo}`); - checkQuotaStatus().catch((error46) => logError2(error46)); + checkQuotaStatus().catch((error42) => logError2(error42)); fetchBootstrapData(); prefetchPassesEligibility(); if (!getFeatureValue_CACHED_MAY_BE_STALE("tengu_miraculo_the_bard", false)) { @@ -777978,8 +700544,8 @@ ${inputPrompt}` : mergePrompt; }; const sdkMcpConfigs = {}; const regularMcpConfigs = {}; - for (const [name, config6] of Object.entries(allMcpConfigs)) { - const typedConfig = config6; + for (const [name, config4] of Object.entries(allMcpConfigs)) { + const typedConfig = config4; if (typedConfig.type === "sdk") { sdkMcpConfigs[name] = typedConfig; } else { @@ -778006,7 +700572,7 @@ ${inputPrompt}` : mergePrompt; tools: uniqBy_default([...local.tools, ...claudeai.tools], "name"), commands: uniqBy_default([...local.commands, ...claudeai.commands], "name") })); - const hooksPromise = initOnly || init3 || maintenance || isNonInteractiveSession || options2.continue || options2.resume ? null : processSessionStartHooks("startup", { + const hooksPromise = initOnly || init2 || maintenance || isNonInteractiveSession || options2.continue || options2.resume ? null : processSessionStartHooks("startup", { agentType: mainThreadAgentDefinition?.agentType, model: resolvedInitialModel }); @@ -778107,7 +700673,7 @@ ${inputPrompt}` : mergePrompt; getGlobExclusionsForPluginCache(); }); } - const setupTrigger = initOnly || init3 ? "init" : maintenance ? "maintenance" : null; + const setupTrigger = initOnly || init2 ? "init" : maintenance ? "maintenance" : null; if (initOnly) { applyConfigEnvironmentVariables(); await processSetupHooks("init", { @@ -778186,15 +700752,15 @@ ${inputPrompt}` : mergePrompt; ...prev, mcp: { ...prev.mcp, - clients: [...prev.mcp.clients, ...Object.entries(configs).map(([name, config6]) => ({ + clients: [...prev.mcp.clients, ...Object.entries(configs).map(([name, config4]) => ({ name, type: "pending", - config: config6 + config: config4 }))] } })); return getMcpToolsCommandsAndResources(({ - client: client5, + client: client2, tools: tools2, commands: commands2 }) => { @@ -778202,12 +700768,12 @@ ${inputPrompt}` : mergePrompt; ...prev, mcp: { ...prev.mcp, - clients: prev.mcp.clients.some((c6) => c6.name === client5.name) ? prev.mcp.clients.map((c6) => c6.name === client5.name ? client5 : c6) : [...prev.mcp.clients, client5], + clients: prev.mcp.clients.some((c6) => c6.name === client2.name) ? prev.mcp.clients.map((c6) => c6.name === client2.name ? client2 : c6) : [...prev.mcp.clients, client2], tools: uniqBy_default([...prev.mcp.tools, ...tools2], "name"), commands: uniqBy_default([...prev.mcp.commands, ...commands2], "name") } })); - }, configs).catch((err3) => logForDebugging(`[MCP] ${label} connect error: ${err3}`)); + }, configs).catch((err2) => logForDebugging(`[MCP] ${label} connect error: ${err2}`)); }; profileCheckpoint("before_connectMcp"); await connectMcpBatch(regularMcpConfigs, "regular"); @@ -778216,16 +700782,16 @@ ${inputPrompt}` : mergePrompt; const claudeaiConnect = claudeaiConfigPromise.then((claudeaiConfigs) => { if (Object.keys(claudeaiConfigs).length > 0) { const claudeaiSigs = new Set; - for (const config6 of Object.values(claudeaiConfigs)) { - const sig = getMcpServerSignature(config6); + for (const config4 of Object.values(claudeaiConfigs)) { + const sig = getMcpServerSignature(config4); if (sig) claudeaiSigs.add(sig); } const suppressed = new Set; - for (const [name, config6] of Object.entries(regularMcpConfigs)) { + for (const [name, config4] of Object.entries(regularMcpConfigs)) { if (!name.startsWith("plugin:")) continue; - const sig = getMcpServerSignature(config6); + const sig = getMcpServerSignature(config4); if (sig && claudeaiSigs.has(sig)) suppressed.add(name); } @@ -778270,8 +700836,8 @@ ${inputPrompt}` : mergePrompt; return connectMcpBatch(dedupedClaudeAi, "claudeai"); }); let claudeaiTimer; - const claudeaiTimedOut = await Promise.race([claudeaiConnect.then(() => false), new Promise((resolve50) => { - claudeaiTimer = setTimeout((r) => r(true), CLAUDE_AI_MCP_TIMEOUT_MS, resolve50); + const claudeaiTimedOut = await Promise.race([claudeaiConnect.then(() => false), new Promise((resolve44) => { + claudeaiTimer = setTimeout((r) => r(true), CLAUDE_AI_MCP_TIMEOUT_MS, resolve44); })]); if (claudeaiTimer) clearTimeout(claudeaiTimer); @@ -778528,17 +701094,17 @@ ${inputPrompt}` : mergePrompt; clearSessionCaches: clearSessionCaches2 } = await Promise.resolve().then(() => (init_caches(), exports_caches)); clearSessionCaches2(); - const result3 = await loadConversationForResume(undefined, undefined); - if (!result3) { + const result2 = await loadConversationForResume(undefined, undefined); + if (!result2) { logEvent("tengu_continue", { success: false }); - return await exitWithError2(root3, "No conversation found to continue"); + return await exitWithError2(root2, "No conversation found to continue"); } - const loaded = await processResumedConversation(result3, { + const loaded = await processResumedConversation(result2, { forkSession: !!options2.forkSession, includeAttribution: true, - transcriptPath: result3.fullPath + transcriptPath: result2.fullPath }, resumeContext); if (loaded.restoredAgentDef) { mainThreadAgentDefinition = loaded.restoredAgentDef; @@ -778550,7 +701116,7 @@ ${inputPrompt}` : mergePrompt; resume_duration_ms: Math.round(performance.now() - resumeStart) }); resumeSucceeded = true; - await launchRepl(root3, { + await launchRepl(root2, { getFpsMetrics, stats: stats2, initialState: loaded.initialState @@ -778563,13 +701129,13 @@ ${inputPrompt}` : mergePrompt; initialAgentName: loaded.agentName, initialAgentColor: loaded.agentColor }, renderAndRun); - } catch (error46) { + } catch (error42) { if (!resumeSucceeded) { logEvent("tengu_continue", { success: false }); } - logError2(error46); + logError2(error42); process.exit(1); } } else if (feature("DIRECT_CONNECT") && _pendingConnect?.url) { @@ -778587,12 +701153,12 @@ ${inputPrompt}` : mergePrompt; } setDirectConnectServerUrl(_pendingConnect.url); directConnectConfig = session2.config; - } catch (err3) { - return await exitWithError2(root3, err3 instanceof DirectConnectError ? err3.message : String(err3), () => gracefulShutdown(1)); + } catch (err2) { + return await exitWithError2(root2, err2 instanceof DirectConnectError ? err2.message : String(err2), () => gracefulShutdown(1)); } const connectInfoMessage = createSystemMessage(`Connected to server at ${_pendingConnect.url} Session: ${directConnectConfig.sessionId}`, "info"); - await launchRepl(root3, { + await launchRepl(root2, { getFpsMetrics, stats: stats2, initialState @@ -778650,15 +701216,15 @@ Session: ${directConnectConfig.sessionId}`, "info"); setOriginalCwd(sshSession.remoteCwd); setCwdState(sshSession.remoteCwd); setDirectConnectServerUrl(_pendingSSH.local ? "local" : _pendingSSH.host); - } catch (err3) { - return await exitWithError2(root3, err3 instanceof SSHSessionError ? err3.message : String(err3), () => gracefulShutdown(1)); + } catch (err2) { + return await exitWithError2(root2, err2 instanceof SSHSessionError ? err2.message : String(err2), () => gracefulShutdown(1)); } const sshInfoMessage = createSystemMessage(_pendingSSH.local ? `Local ssh-proxy test session cwd: ${sshSession.remoteCwd} Auth: unix socket → local proxy` : `SSH session to ${_pendingSSH.host} Remote cwd: ${sshSession.remoteCwd} Auth: unix socket -R → local proxy`, "info"); - await launchRepl(root3, { + await launchRepl(root2, { getFpsMetrics, stats: stats2, initialState @@ -778685,20 +701251,20 @@ Auth: unix socket -R → local proxy`, "info"); try { sessions = await discoverAssistantSessions(); } catch (e) { - return await exitWithError2(root3, `Failed to discover sessions: ${e instanceof Error ? e.message : e}`, () => gracefulShutdown(1)); + return await exitWithError2(root2, `Failed to discover sessions: ${e instanceof Error ? e.message : e}`, () => gracefulShutdown(1)); } if (sessions.length === 0) { let installedDir; try { - installedDir = await launchAssistantInstallWizard(root3); + installedDir = await launchAssistantInstallWizard(root2); } catch (e) { - return await exitWithError2(root3, `Assistant installation failed: ${e instanceof Error ? e.message : e}`, () => gracefulShutdown(1)); + return await exitWithError2(root2, `Assistant installation failed: ${e instanceof Error ? e.message : e}`, () => gracefulShutdown(1)); } if (installedDir === null) { await gracefulShutdown(0); process.exit(0); } - return await exitWithMessage2(root3, `Assistant installed in ${installedDir}. The daemon is starting up — run \`claude assistant\` again in a few seconds to connect.`, { + return await exitWithMessage2(root2, `Assistant installed in ${installedDir}. The daemon is starting up — run \`claude assistant\` again in a few seconds to connect.`, { exitCode: 0, beforeExit: () => gracefulShutdown(0) }); @@ -778706,7 +701272,7 @@ Auth: unix socket -R → local proxy`, "info"); if (sessions.length === 1) { targetSessionId = sessions[0].id; } else { - const picked = await launchAssistantSessionChooser(root3, { + const picked = await launchAssistantSessionChooser(root2, { sessions }); if (!picked) { @@ -778719,13 +701285,13 @@ Auth: unix socket -R → local proxy`, "info"); const { checkAndRefreshOAuthTokenIfNeeded: checkAndRefreshOAuthTokenIfNeeded2, getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 - } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + } = await Promise.resolve().then(() => (init_auth(), exports_auth)); await checkAndRefreshOAuthTokenIfNeeded2(); let apiCreds; try { apiCreds = await prepareApiRequest(); } catch (e) { - return await exitWithError2(root3, `Error: ${e instanceof Error ? e.message : "Failed to authenticate"}`, () => gracefulShutdown(1)); + return await exitWithError2(root2, `Error: ${e instanceof Error ? e.message : "Failed to authenticate"}`, () => gracefulShutdown(1)); } const getAccessToken = () => getClaudeAIOAuthTokens2()?.accessToken ?? apiCreds.accessToken; setKairosActive(true); @@ -778740,7 +701306,7 @@ Auth: unix socket -R → local proxy`, "info"); replBridgeEnabled: false }; const remoteCommands = filterCommandsForRemoteMode(commands); - await launchRepl(root3, { + await launchRepl(root2, { getFpsMetrics, stats: stats2, initialState: assistantInitialState @@ -778778,11 +701344,11 @@ Auth: unix socket -R → local proxy`, "info"); if (options2.resume && typeof options2.resume === "string" && !maybeSessionId) { const trimmedValue = options2.resume.trim(); if (trimmedValue) { - const matches3 = await searchSessionsByCustomTitle(trimmedValue, { + const matches2 = await searchSessionsByCustomTitle(trimmedValue, { exact: true }); - if (matches3.length === 1) { - matchedLog = matches3[0]; + if (matches2.length === 1) { + matchedLog = matches2[0]; maybeSessionId = getSessionIdFromLog(matchedLog) ?? null; } else { searchTerm = trimmedValue; @@ -778792,26 +701358,26 @@ Auth: unix socket -R → local proxy`, "info"); if (remote !== null || teleport) { await waitForPolicyLimitsToLoad(); if (!isPolicyAllowed("allow_remote_sessions")) { - return await exitWithError2(root3, "Error: Remote sessions are disabled by your organization's policy.", () => gracefulShutdown(1)); + return await exitWithError2(root2, "Error: Remote sessions are disabled by your organization's policy.", () => gracefulShutdown(1)); } } if (remote !== null) { const hasInitialPrompt = remote.length > 0; const isRemoteTuiEnabled = getFeatureValue_CACHED_MAY_BE_STALE("tengu_remote_backend", false); if (!isRemoteTuiEnabled && !hasInitialPrompt) { - return await exitWithError2(root3, `Error: --remote requires a description. + return await exitWithError2(root2, `Error: --remote requires a description. Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); } logEvent("tengu_remote_create_session", { has_initial_prompt: String(hasInitialPrompt) }); const currentBranch = await getBranch(); - const createdSession = await teleportToRemoteWithErrorHandling(root3, hasInitialPrompt ? remote : null, new AbortController().signal, currentBranch || undefined); + const createdSession = await teleportToRemoteWithErrorHandling(root2, hasInitialPrompt ? remote : null, new AbortController().signal, currentBranch || undefined); if (!createdSession) { logEvent("tengu_remote_create_session_error", { error: "unable_to_create_session" }); - return await exitWithError2(root3, "Error: Unable to create remote session", () => gracefulShutdown(1)); + return await exitWithError2(root2, "Error: Unable to create remote session", () => gracefulShutdown(1)); } logEvent("tengu_remote_create_session_success", { session_id: createdSession.id @@ -778831,13 +701397,13 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); let apiCreds; try { apiCreds = await prepareApiRequest(); - } catch (error46) { - logError2(toError(error46)); - return await exitWithError2(root3, `Error: ${errorMessage(error46) || "Failed to authenticate"}`, () => gracefulShutdown(1)); + } catch (error42) { + logError2(toError(error42)); + return await exitWithError2(root2, `Error: ${errorMessage(error42) || "Failed to authenticate"}`, () => gracefulShutdown(1)); } const { getClaudeAIOAuthTokens: getTokensForRemote - } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + } = await Promise.resolve().then(() => (init_auth(), exports_auth)); const getAccessTokenForRemote = () => getTokensForRemote()?.accessToken ?? apiCreds.accessToken; const remoteSessionConfig = createRemoteSessionConfig(createdSession.id, getAccessTokenForRemote, apiCreds.orgUUID, hasInitialPrompt); const remoteSessionUrl = `${getRemoteSessionUrl(createdSession.id)}?m=0`; @@ -778850,7 +701416,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); remoteSessionUrl }; const remoteCommands = filterCommandsForRemoteMode(commands); - await launchRepl(root3, { + await launchRepl(root2, { getFpsMetrics, stats: stats2, initialState: remoteInitialState @@ -778871,7 +701437,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); if (teleport === true || teleport === "") { logEvent("tengu_teleport_interactive_mode", {}); logForDebugging("selectAndResumeTeleportTask: Starting teleport flow..."); - const teleportResult = await launchTeleportResumeWrapper(root3); + const teleportResult = await launchTeleportResumeWrapper(root2); if (!teleportResult) { await gracefulShutdown(0); process.exit(0); @@ -778893,7 +701459,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); const knownPaths = getKnownPathsForRepo(sessionRepo); const existingPaths = await filterExistingPaths(knownPaths); if (existingPaths.length > 0) { - const selectedPath = await launchTeleportRepoMismatchDialog(root3, { + const selectedPath = await launchTeleportRepoMismatchDialog(root2, { targetRepo: sessionRepo, initialPaths: existingPaths }); @@ -778917,18 +701483,18 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); const { teleportWithProgress: teleportWithProgress2 } = await Promise.resolve().then(() => (init_TeleportProgress(), exports_TeleportProgress)); - const result3 = await teleportWithProgress2(root3, teleport); + const result2 = await teleportWithProgress2(root2, teleport); setTeleportedSessionInfo({ sessionId: teleport }); - messages = result3.messages; - } catch (error46) { - if (error46 instanceof TeleportOperationError) { - process.stderr.write(error46.formattedMessage + ` + messages = result2.messages; + } catch (error42) { + if (error42 instanceof TeleportOperationError) { + process.stderr.write(error42.formattedMessage + ` `); } else { - logError2(error46); - process.stderr.write(source_default.red(`Error: ${errorMessage(error46)} + logError2(error42); + process.stderr.write(source_default.red(`Error: ${errorMessage(error42)} `)); } await gracefulShutdown(1); @@ -778940,16 +701506,16 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); const sessionId2 = maybeSessionId; try { const resumeStart = performance.now(); - const result3 = await loadConversationForResume(matchedLog ?? sessionId2, undefined); - if (!result3) { + const result2 = await loadConversationForResume(matchedLog ?? sessionId2, undefined); + if (!result2) { logEvent("tengu_session_resumed", { entrypoint: "cli_flag", success: false }); - return await exitWithError2(root3, `No conversation found with session ID: ${sessionId2}`); + return await exitWithError2(root2, `No conversation found with session ID: ${sessionId2}`); } - const fullPath = matchedLog?.fullPath ?? result3.fullPath; - processedResume = await processResumedConversation(result3, { + const fullPath = matchedLog?.fullPath ?? result2.fullPath; + processedResume = await processResumedConversation(result2, { forkSession: !!options2.forkSession, sessionIdOverride: sessionId2, transcriptPath: fullPath @@ -778962,13 +701528,13 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); success: true, resume_duration_ms: Math.round(performance.now() - resumeStart) }); - } catch (error46) { + } catch (error42) { logEvent("tengu_session_resumed", { entrypoint: "cli_flag", success: false }); - logError2(error46); - await exitWithError2(root3, `Failed to resume session ${sessionId2}`); + logError2(error42); + await exitWithError2(root2, `Failed to resume session ${sessionId2}`); } } if (fileDownloadPromise) { @@ -778979,8 +701545,8 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); process.stderr.write(source_default.yellow(`Warning: ${failedCount}/${results.length} file(s) failed to download. `)); } - } catch (error46) { - return await exitWithError2(root3, `Error downloading files: ${errorMessage(error46)}`); + } catch (error42) { + return await exitWithError2(root2, `Error downloading files: ${errorMessage(error42)}`); } } const resumeData = processedResume ?? (Array.isArray(messages) ? { @@ -778995,7 +701561,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); if (resumeData) { maybeActivateProactive(options2); maybeActivateBrief(options2); - await launchRepl(root3, { + await launchRepl(root2, { getFpsMetrics, stats: stats2, initialState: resumeData.initialState @@ -779009,7 +701575,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); initialAgentColor: resumeData.agentColor }, renderAndRun); } else { - await launchResumeChooser(root3, { + await launchResumeChooser(root2, { getFpsMetrics, stats: stats2, initialState @@ -779046,7 +701612,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); } } const initialMessages = deepLinkBanner ? [deepLinkBanner, ...hookMessages] : hookMessages.length > 0 ? hookMessages : undefined; - await launchRepl(root3, { + await launchRepl(root2, { getFpsMetrics, stats: stats2, initialState @@ -779165,7 +701731,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); if (feature("DIRECT_CONNECT")) { program2.command("server").description("Start a Claude Code session server").option("--port ", "HTTP port", "0").option("--host ", "Bind address", "0.0.0.0").option("--auth-token ", "Bearer token for auth").option("--unix ", "Listen on a unix domain socket").option("--workspace ", "Default working directory for sessions that do not specify cwd").option("--idle-timeout ", "Idle timeout for detached sessions in ms (0 = never expire)", "600000").option("--max-sessions ", "Maximum concurrent sessions (0 = unlimited)", "32").action(async (opts) => { const { - randomBytes: randomBytes21 + randomBytes: randomBytes20 } = await import("crypto"); const { startServer: startServer2 @@ -779193,8 +701759,8 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); `); process.exit(1); } - const authToken = opts.authToken ?? `sk-ant-cc-${randomBytes21(16).toString("base64url")}`; - const config6 = { + const authToken = opts.authToken ?? `sk-ant-cc-${randomBytes20(16).toString("base64url")}`; + const config4 = { port: parseInt(opts.port, 10), host: opts.host, authToken, @@ -779205,18 +701771,18 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1)); }; const backend = new DangerousBackend2; const sessionManager = new SessionManager2(backend, { - idleTimeoutMs: config6.idleTimeoutMs, - maxSessions: config6.maxSessions + idleTimeoutMs: config4.idleTimeoutMs, + maxSessions: config4.maxSessions }); const logger = createServerLogger2(); - const server = startServer2(config6, sessionManager, logger); - const actualPort = server.port ?? config6.port; - printBanner2(config6, authToken, actualPort); + const server = startServer2(config4, sessionManager, logger); + const actualPort = server.port ?? config4.port; + printBanner2(config4, authToken, actualPort); await writeServerLock2({ pid: process.pid, port: actualPort, - host: config6.host, - httpUrl: config6.unix ? `unix:${config6.unix}` : `http://${config6.host}:${actualPort}`, + host: config4.host, + httpUrl: config4.unix ? `unix:${config4.unix}` : `http://${config4.host}:${actualPort}`, startedAt: Date.now() }); let shuttingDown = false; @@ -779266,8 +701832,8 @@ Runs Claude Code on a remote Linux host. You don't need to install } setDirectConnectServerUrl(serverUrl); connectConfig = session2.config; - } catch (err3) { - console.error(err3 instanceof DirectConnectError ? err3.message : String(err3)); + } catch (err2) { + console.error(err2 instanceof DirectConnectError ? err2.message : String(err2)); process.exit(1); } const { @@ -779287,7 +701853,7 @@ Runs Claude Code on a remote Linux host. You don't need to install }) => { const { authLogin: authLogin2 - } = await Promise.resolve().then(() => (init_auth6(), exports_auth2)); + } = await Promise.resolve().then(() => (init_auth5(), exports_auth2)); await authLogin2({ email: email4, sso, @@ -779298,13 +701864,13 @@ Runs Claude Code on a remote Linux host. You don't need to install auth2.command("status").description("Show authentication status").option("--json", "Output as JSON (default)").option("--text", "Output as human-readable text").action(async (opts) => { const { authStatus: authStatus2 - } = await Promise.resolve().then(() => (init_auth6(), exports_auth2)); + } = await Promise.resolve().then(() => (init_auth5(), exports_auth2)); await authStatus2(opts); }); auth2.command("logout").description("Log out from your Anthropic account").action(async () => { const { authLogout: authLogout2 - } = await Promise.resolve().then(() => (init_auth6(), exports_auth2)); + } = await Promise.resolve().then(() => (init_auth5(), exports_auth2)); await authLogout2(); }); const coworkOption = () => new Option("--cowork", "Use cowork_plugins directory").hideHelp(); @@ -779381,9 +701947,9 @@ Runs Claude Code on a remote Linux host. You don't need to install setupTokenHandler: setupTokenHandler2 }, { createRoot: createRoot3 - }] = await Promise.all([Promise.resolve().then(() => (init_util8(), exports_util3)), Promise.resolve().then(() => (init_ink2(), exports_ink))]); - const root3 = await createRoot3(getBaseRenderOptions(false)); - await setupTokenHandler2(root3); + }] = await Promise.all([Promise.resolve().then(() => (init_util7(), exports_util3)), Promise.resolve().then(() => (init_ink2(), exports_ink))]); + const root2 = await createRoot3(getBaseRenderOptions(false)); + await setupTokenHandler2(root2); }); program2.command("agents").description("List configured agents").option("--setting-sources ", "Comma-separated list of setting sources to load (user, project, local).").action(async () => { const { @@ -779443,22 +702009,22 @@ Omit sessionId to discover and pick from available sessions. doctorHandler: doctorHandler2 }, { createRoot: createRoot3 - }] = await Promise.all([Promise.resolve().then(() => (init_util8(), exports_util3)), Promise.resolve().then(() => (init_ink2(), exports_ink))]); - const root3 = await createRoot3(getBaseRenderOptions(false)); - await doctorHandler2(root3); + }] = await Promise.all([Promise.resolve().then(() => (init_util7(), exports_util3)), Promise.resolve().then(() => (init_ink2(), exports_ink))]); + const root2 = await createRoot3(getBaseRenderOptions(false)); + await doctorHandler2(root2); }); program2.command("update").alias("upgrade").description("Check for updates and install if available").action(async () => { const { - update: update4 - } = await Promise.resolve().then(() => (init_update3(), exports_update)); - await update4(); + update: update3 + } = await Promise.resolve().then(() => (init_update2(), exports_update)); + await update3(); }); if (false) {} if (false) {} program2.command("install [target]").description("Install Claude Code native build. Use [target] to specify version (stable, latest, or specific version)").option("--force", "Force installation even if already installed").action(async (target, options2) => { const { installHandler: installHandler2 - } = await Promise.resolve().then(() => (init_util8(), exports_util3)); + } = await Promise.resolve().then(() => (init_util7(), exports_util3)); await installHandler2(target, options2); }); if (false) {} @@ -779532,8 +702098,8 @@ async function logTenguInit({ autoUpdatesChannel: getInitialSettings().autoUpdatesChannel ?? "latest", ...{} }); - } catch (error46) { - logError2(error46); + } catch (error42) { + logError2(error42); } } function maybeActivateProactive(options2) { @@ -779591,14 +702157,14 @@ var init_main3 = __esm(() => { init_rawRead(); init_keychainPrefetch(); init_bun_bundle(); - init_esm8(); + init_esm7(); init_source(); init_mapValues(); init_pickBy(); init_uniqBy(); init_oauth(); init_context2(); - init_init3(); + init_init2(); init_history(); init_replLauncher(); init_growthbook(); @@ -779613,13 +702179,13 @@ var init_main3 = __esm(() => { init_advisor(); init_agentSwarmsEnabled(); init_asciicast(); - init_auth2(); + init_auth(); init_config2(); init_earlyInput(); init_effort(); init_fastMode(); init_managedEnv(); - init_messages5(); + init_messages3(); init_platform2(); init_renderOptions(); init_sessionIngressAuth(); @@ -779638,7 +702204,7 @@ var init_main3 = __esm(() => { init_dec(); init_interactiveHelpers(); init_claudeAiLimits(); - init_client10(); + init_client6(); init_pluginCliCommands(); init_bundled2(); init_loadAgentsDir(); @@ -779674,14 +702240,14 @@ var init_main3 = __esm(() => { init_pluginTelemetry(); init_skillLoadedEvent(); init_tempfile(); - init_uuid2(); + init_uuid(); init_addCommand(); init_xaaIdpCommand(); init_internalLogging(); init_claudeai(); - init_client10(); + init_client6(); init_config3(); - init_utils4(); + init_utils3(); init_xaaIdpLogin(); init_tipRegistry(); init_api4(); @@ -779795,7 +702361,7 @@ async function main2() { const model = modelIdx !== -1 && args[modelIdx + 1] || getMainLoopModel2(); const { getSystemPrompt: getSystemPrompt2 - } = await Promise.resolve().then(() => (init_prompts5(), exports_prompts)); + } = await Promise.resolve().then(() => (init_prompts4(), exports_prompts)); const prompt = await getSystemPrompt2([], model); console.log(prompt.join(` `)); @@ -779805,7 +702371,7 @@ async function main2() { profileCheckpoint2("cli_claude_in_chrome_mcp_path"); const { runClaudeInChromeMcpServer: runClaudeInChromeMcpServer2 - } = await Promise.resolve().then(() => (init_mcpServer3(), exports_mcpServer)); + } = await Promise.resolve().then(() => (init_mcpServer2(), exports_mcpServer)); await runClaudeInChromeMcpServer2(); return; } else if (process.argv[2] === "--chrome-native-host") { @@ -779819,7 +702385,7 @@ async function main2() { profileCheckpoint2("cli_computer_use_mcp_path"); const { runComputerUseMcpServer: runComputerUseMcpServer2 - } = await Promise.resolve().then(() => (init_mcpServer4(), exports_mcpServer2)); + } = await Promise.resolve().then(() => (init_mcpServer3(), exports_mcpServer2)); await runComputerUseMcpServer2(); return; } @@ -779842,7 +702408,7 @@ async function main2() { } = await Promise.resolve().then(() => (init_bridgeEnabled(), exports_bridgeEnabled)); const { BRIDGE_LOGIN_ERROR: BRIDGE_LOGIN_ERROR2 - } = await Promise.resolve().then(() => (init_types16(), exports_types)); + } = await Promise.resolve().then(() => (init_types15(), exports_types)); const { bridgeMain: bridgeMain2 } = await Promise.resolve().then(() => (init_bridgeMain(), exports_bridgeMain)); @@ -779851,7 +702417,7 @@ async function main2() { } = await Promise.resolve().then(() => exports_process); const { getClaudeAIOAuthTokens: getClaudeAIOAuthTokens2 - } = await Promise.resolve().then(() => (init_auth2(), exports_auth)); + } = await Promise.resolve().then(() => (init_auth(), exports_auth)); if (!getClaudeAIOAuthTokens2()?.accessToken) { exitWithError3(BRIDGE_LOGIN_ERROR2); } @@ -779953,15 +702519,15 @@ async function main2() { const { execIntoTmuxWorktree: execIntoTmuxWorktree2 } = await Promise.resolve().then(() => (init_worktree(), exports_worktree)); - const result3 = await execIntoTmuxWorktree2(args); - if (result3.handled) { + const result2 = await execIntoTmuxWorktree2(args); + if (result2.handled) { return; } - if (result3.error) { + if (result2.error) { const { exitWithError: exitWithError3 } = await Promise.resolve().then(() => exports_process); - exitWithError3(result3.error); + exitWithError3(result2.error); } } } @@ -779985,5 +702551,5 @@ async function main2() { } main2(); -//# debugId=7621D3733A1CB82C64756E2164756E21 +//# debugId=8A17AAEDE470395064756E2164756E21 //# sourceMappingURL=cli.js.map diff --git a/dist/cli.js.map b/dist/cli.js.map index e1cc6e5..cd9c0bb 100644 --- a/dist/cli.js.map +++ b/dist/cli.js.map @@ -1,6 +1,6 @@ { "version": 3, - "sources": ["../shim/bun-bundle.ts", "../node_modules/lodash-es/_listCacheClear.js", "../node_modules/lodash-es/eq.js", "../node_modules/lodash-es/_assocIndexOf.js", "../node_modules/lodash-es/_listCacheDelete.js", "../node_modules/lodash-es/_listCacheGet.js", "../node_modules/lodash-es/_listCacheHas.js", "../node_modules/lodash-es/_listCacheSet.js", "../node_modules/lodash-es/_ListCache.js", "../node_modules/lodash-es/_stackClear.js", "../node_modules/lodash-es/_stackDelete.js", "../node_modules/lodash-es/_stackGet.js", "../node_modules/lodash-es/_stackHas.js", "../node_modules/lodash-es/_freeGlobal.js", "../node_modules/lodash-es/_root.js", "../node_modules/lodash-es/_Symbol.js", "../node_modules/lodash-es/_getRawTag.js", "../node_modules/lodash-es/_objectToString.js", "../node_modules/lodash-es/_baseGetTag.js", "../node_modules/lodash-es/isObject.js", "../node_modules/lodash-es/isFunction.js", "../node_modules/lodash-es/_coreJsData.js", "../node_modules/lodash-es/_isMasked.js", "../node_modules/lodash-es/_toSource.js", "../node_modules/lodash-es/_baseIsNative.js", "../node_modules/lodash-es/_getValue.js", "../node_modules/lodash-es/_getNative.js", "../node_modules/lodash-es/_Map.js", "../node_modules/lodash-es/_nativeCreate.js", "../node_modules/lodash-es/_hashClear.js", "../node_modules/lodash-es/_hashDelete.js", "../node_modules/lodash-es/_hashGet.js", "../node_modules/lodash-es/_hashHas.js", "../node_modules/lodash-es/_hashSet.js", "../node_modules/lodash-es/_Hash.js", "../node_modules/lodash-es/_mapCacheClear.js", "../node_modules/lodash-es/_isKeyable.js", "../node_modules/lodash-es/_getMapData.js", "../node_modules/lodash-es/_mapCacheDelete.js", "../node_modules/lodash-es/_mapCacheGet.js", "../node_modules/lodash-es/_mapCacheHas.js", "../node_modules/lodash-es/_mapCacheSet.js", "../node_modules/lodash-es/_MapCache.js", "../node_modules/lodash-es/_stackSet.js", "../node_modules/lodash-es/_Stack.js", "../node_modules/lodash-es/_setCacheAdd.js", "../node_modules/lodash-es/_setCacheHas.js", "../node_modules/lodash-es/_SetCache.js", "../node_modules/lodash-es/_arraySome.js", "../node_modules/lodash-es/_cacheHas.js", "../node_modules/lodash-es/_equalArrays.js", "../node_modules/lodash-es/_Uint8Array.js", "../node_modules/lodash-es/_mapToArray.js", "../node_modules/lodash-es/_setToArray.js", "../node_modules/lodash-es/_equalByTag.js", "../node_modules/lodash-es/_arrayPush.js", "../node_modules/lodash-es/isArray.js", "../node_modules/lodash-es/_baseGetAllKeys.js", "../node_modules/lodash-es/_arrayFilter.js", "../node_modules/lodash-es/stubArray.js", "../node_modules/lodash-es/_getSymbols.js", "../node_modules/lodash-es/_baseTimes.js", "../node_modules/lodash-es/isObjectLike.js", "../node_modules/lodash-es/_baseIsArguments.js", "../node_modules/lodash-es/isArguments.js", "../node_modules/lodash-es/stubFalse.js", "../node_modules/lodash-es/isBuffer.js", "../node_modules/lodash-es/_isIndex.js", "../node_modules/lodash-es/isLength.js", "../node_modules/lodash-es/_baseIsTypedArray.js", "../node_modules/lodash-es/_baseUnary.js", "../node_modules/lodash-es/_nodeUtil.js", "../node_modules/lodash-es/isTypedArray.js", "../node_modules/lodash-es/_arrayLikeKeys.js", "../node_modules/lodash-es/_isPrototype.js", "../node_modules/lodash-es/_overArg.js", "../node_modules/lodash-es/_nativeKeys.js", "../node_modules/lodash-es/_baseKeys.js", "../node_modules/lodash-es/isArrayLike.js", "../node_modules/lodash-es/keys.js", "../node_modules/lodash-es/_getAllKeys.js", "../node_modules/lodash-es/_equalObjects.js", "../node_modules/lodash-es/_DataView.js", "../node_modules/lodash-es/_Promise.js", "../node_modules/lodash-es/_Set.js", "../node_modules/lodash-es/_WeakMap.js", "../node_modules/lodash-es/_getTag.js", "../node_modules/lodash-es/_baseIsEqualDeep.js", "../node_modules/lodash-es/_baseIsEqual.js", "../node_modules/lodash-es/_baseIsMatch.js", "../node_modules/lodash-es/_isStrictComparable.js", "../node_modules/lodash-es/_getMatchData.js", "../node_modules/lodash-es/_matchesStrictComparable.js", "../node_modules/lodash-es/_baseMatches.js", "../node_modules/lodash-es/isSymbol.js", "../node_modules/lodash-es/_isKey.js", "../node_modules/lodash-es/memoize.js", "../node_modules/lodash-es/_memoizeCapped.js", "../node_modules/lodash-es/_stringToPath.js", "../node_modules/lodash-es/_arrayMap.js", "../node_modules/lodash-es/_baseToString.js", "../node_modules/lodash-es/toString.js", "../node_modules/lodash-es/_castPath.js", "../node_modules/lodash-es/_toKey.js", "../node_modules/lodash-es/_baseGet.js", "../node_modules/lodash-es/get.js", "../node_modules/lodash-es/_baseHasIn.js", "../node_modules/lodash-es/_hasPath.js", "../node_modules/lodash-es/hasIn.js", "../node_modules/lodash-es/_baseMatchesProperty.js", "../node_modules/lodash-es/identity.js", "../node_modules/lodash-es/_baseProperty.js", "../node_modules/lodash-es/_basePropertyDeep.js", "../node_modules/lodash-es/property.js", "../node_modules/lodash-es/_baseIteratee.js", "../node_modules/lodash-es/_baseSum.js", "../node_modules/lodash-es/sumBy.js", "../src/utils/crypto.ts", "../src/utils/settings/settingsCache.ts", "../src/utils/signal.ts", "../src/bootstrap/state.ts", "../src/services/analytics/index.ts", "../src/utils/bufferedWriter.ts", "../src/utils/cleanupRegistry.ts", "../src/utils/debugFilter.ts", "../src/utils/protectedNamespace.ts", "../src/utils/envUtils.ts", "../node_modules/@anthropic-ai/sdk/internal/tslib.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs", "../node_modules/@anthropic-ai/sdk/internal/errors.mjs", "../node_modules/@anthropic-ai/sdk/core/error.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/values.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/log.mjs", "../node_modules/@anthropic-ai/sdk/version.mjs", "../node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs", "../node_modules/@anthropic-ai/sdk/internal/shims.mjs", "../node_modules/@anthropic-ai/sdk/internal/request-options.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs", "../node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs", "../node_modules/@anthropic-ai/sdk/core/streaming.mjs", "../node_modules/@anthropic-ai/sdk/internal/parse.mjs", "../node_modules/@anthropic-ai/sdk/core/api-promise.mjs", "../node_modules/@anthropic-ai/sdk/core/pagination.mjs", "../node_modules/@anthropic-ai/sdk/internal/uploads.mjs", "../node_modules/@anthropic-ai/sdk/internal/to-file.mjs", "../node_modules/@anthropic-ai/sdk/core/uploads.mjs", "../node_modules/@anthropic-ai/sdk/core/resource.mjs", "../node_modules/@anthropic-ai/sdk/internal/headers.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/path.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/files.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/models.mjs", "../node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs", "../node_modules/@anthropic-ai/sdk/error.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs", "../node_modules/@anthropic-ai/sdk/streaming.mjs", "../node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs", "../node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs", "../node_modules/@anthropic-ai/sdk/internal/constants.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs", "../node_modules/@anthropic-ai/sdk/resources/completions.mjs", "../node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs", "../node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs", "../node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs", "../node_modules/@anthropic-ai/sdk/resources/models.mjs", "../node_modules/@anthropic-ai/sdk/resources/index.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/env.mjs", "../node_modules/@anthropic-ai/sdk/client.mjs", "../node_modules/@anthropic-ai/sdk/index.mjs", "../src/utils/errors.ts", "../node_modules/lodash-es/_arrayEach.js", "../node_modules/lodash-es/_defineProperty.js", "../node_modules/lodash-es/_baseAssignValue.js", "../node_modules/lodash-es/_assignValue.js", "../node_modules/lodash-es/_copyObject.js", "../node_modules/lodash-es/_baseAssign.js", "../node_modules/lodash-es/_nativeKeysIn.js", "../node_modules/lodash-es/_baseKeysIn.js", "../node_modules/lodash-es/keysIn.js", "../node_modules/lodash-es/_baseAssignIn.js", "../node_modules/lodash-es/_cloneBuffer.js", "../node_modules/lodash-es/_copyArray.js", "../node_modules/lodash-es/_copySymbols.js", "../node_modules/lodash-es/_getPrototype.js", "../node_modules/lodash-es/_getSymbolsIn.js", "../node_modules/lodash-es/_copySymbolsIn.js", "../node_modules/lodash-es/_getAllKeysIn.js", "../node_modules/lodash-es/_initCloneArray.js", "../node_modules/lodash-es/_cloneArrayBuffer.js", "../node_modules/lodash-es/_cloneDataView.js", "../node_modules/lodash-es/_cloneRegExp.js", "../node_modules/lodash-es/_cloneSymbol.js", "../node_modules/lodash-es/_cloneTypedArray.js", "../node_modules/lodash-es/_initCloneByTag.js", "../node_modules/lodash-es/_baseCreate.js", "../node_modules/lodash-es/_initCloneObject.js", "../node_modules/lodash-es/_baseIsMap.js", "../node_modules/lodash-es/isMap.js", "../node_modules/lodash-es/_baseIsSet.js", "../node_modules/lodash-es/isSet.js", "../node_modules/lodash-es/_baseClone.js", "../node_modules/lodash-es/cloneDeep.js", "../src/utils/slowOperations.ts", "../src/utils/fsOperations.ts", "../src/utils/process.ts", "../src/utils/debug.ts", "../src/utils/intl.ts", "../node_modules/emoji-regex/index.js", "../node_modules/get-east-asian-width/lookup-data.js", "../node_modules/get-east-asian-width/utilities.js", "../node_modules/get-east-asian-width/lookup.js", "../node_modules/get-east-asian-width/index.js", "../node_modules/ansi-regex/index.js", "../node_modules/strip-ansi/index.js", "../src/ink/stringWidth.ts", "../src/utils/truncate.ts", "../src/utils/format.ts", "../src/utils/profilerBase.ts", "../src/utils/startupProfiler.ts", "../node_modules/lodash-es/_baseSet.js", "../node_modules/lodash-es/_basePickBy.js", "../node_modules/lodash-es/pickBy.js", "../node_modules/@growthbook/growthbook/dist/esm/util.mjs", "../node_modules/@growthbook/growthbook/dist/esm/feature-repository.mjs", "../node_modules/dom-mutator/dist/dom-mutator.cjs.development.js", "../node_modules/dom-mutator/dist/index.js", "../node_modules/@growthbook/growthbook/dist/esm/mongrule.mjs", "../node_modules/@growthbook/growthbook/dist/esm/core.mjs", "../node_modules/@growthbook/growthbook/dist/esm/GrowthBook.mjs", "../node_modules/@growthbook/growthbook/dist/esm/GrowthBookClient.mjs", "../node_modules/@growthbook/growthbook/dist/esm/sticky-bucket-service.mjs", "../node_modules/@growthbook/growthbook/dist/esm/index.mjs", "../node_modules/lodash-es/_baseToNumber.js", "../node_modules/lodash-es/_createMathOperation.js", "../node_modules/lodash-es/add.js", "../node_modules/lodash-es/_trimmedEndIndex.js", "../node_modules/lodash-es/_baseTrim.js", "../node_modules/lodash-es/toNumber.js", "../node_modules/lodash-es/toFinite.js", "../node_modules/lodash-es/toInteger.js", "../node_modules/lodash-es/after.js", "../node_modules/lodash-es/_metaMap.js", "../node_modules/lodash-es/_baseSetData.js", "../node_modules/lodash-es/_createCtor.js", "../node_modules/lodash-es/_createBind.js", "../node_modules/lodash-es/_apply.js", "../node_modules/lodash-es/_composeArgs.js", "../node_modules/lodash-es/_composeArgsRight.js", "../node_modules/lodash-es/_countHolders.js", "../node_modules/lodash-es/_baseLodash.js", "../node_modules/lodash-es/_LazyWrapper.js", "../node_modules/lodash-es/noop.js", "../node_modules/lodash-es/_getData.js", "../node_modules/lodash-es/_realNames.js", "../node_modules/lodash-es/_getFuncName.js", "../node_modules/lodash-es/_LodashWrapper.js", "../node_modules/lodash-es/_wrapperClone.js", "../node_modules/lodash-es/wrapperLodash.js", "../node_modules/lodash-es/_isLaziable.js", "../node_modules/lodash-es/_shortOut.js", "../node_modules/lodash-es/_setData.js", "../node_modules/lodash-es/_getWrapDetails.js", "../node_modules/lodash-es/_insertWrapDetails.js", "../node_modules/lodash-es/constant.js", "../node_modules/lodash-es/_baseSetToString.js", "../node_modules/lodash-es/_setToString.js", "../node_modules/lodash-es/_baseFindIndex.js", "../node_modules/lodash-es/_baseIsNaN.js", "../node_modules/lodash-es/_strictIndexOf.js", "../node_modules/lodash-es/_baseIndexOf.js", "../node_modules/lodash-es/_arrayIncludes.js", "../node_modules/lodash-es/_updateWrapDetails.js", "../node_modules/lodash-es/_setWrapToString.js", "../node_modules/lodash-es/_createRecurry.js", "../node_modules/lodash-es/_getHolder.js", "../node_modules/lodash-es/_reorder.js", "../node_modules/lodash-es/_replaceHolders.js", "../node_modules/lodash-es/_createHybrid.js", "../node_modules/lodash-es/_createCurry.js", "../node_modules/lodash-es/_createPartial.js", "../node_modules/lodash-es/_mergeData.js", "../node_modules/lodash-es/_createWrap.js", "../node_modules/lodash-es/ary.js", "../node_modules/lodash-es/_overRest.js", "../node_modules/lodash-es/_baseRest.js", "../node_modules/lodash-es/_isIterateeCall.js", "../node_modules/lodash-es/_createAssigner.js", "../node_modules/lodash-es/assign.js", "../node_modules/lodash-es/assignIn.js", "../node_modules/lodash-es/assignInWith.js", "../node_modules/lodash-es/assignWith.js", "../node_modules/lodash-es/_baseAt.js", "../node_modules/lodash-es/_isFlattenable.js", "../node_modules/lodash-es/_baseFlatten.js", "../node_modules/lodash-es/flatten.js", "../node_modules/lodash-es/_flatRest.js", "../node_modules/lodash-es/at.js", "../node_modules/lodash-es/isPlainObject.js", "../node_modules/lodash-es/isError.js", "../node_modules/lodash-es/attempt.js", "../node_modules/lodash-es/before.js", "../node_modules/lodash-es/bind.js", "../node_modules/lodash-es/bindAll.js", "../node_modules/lodash-es/bindKey.js", "../node_modules/lodash-es/_baseSlice.js", "../node_modules/lodash-es/_castSlice.js", "../node_modules/lodash-es/_hasUnicode.js", "../node_modules/lodash-es/_asciiToArray.js", "../node_modules/lodash-es/_unicodeToArray.js", "../node_modules/lodash-es/_stringToArray.js", "../node_modules/lodash-es/_createCaseFirst.js", "../node_modules/lodash-es/upperFirst.js", "../node_modules/lodash-es/capitalize.js", "../node_modules/lodash-es/_arrayReduce.js", "../node_modules/lodash-es/_basePropertyOf.js", "../node_modules/lodash-es/_deburrLetter.js", "../node_modules/lodash-es/deburr.js", "../node_modules/lodash-es/_asciiWords.js", "../node_modules/lodash-es/_hasUnicodeWord.js", "../node_modules/lodash-es/_unicodeWords.js", "../node_modules/lodash-es/words.js", "../node_modules/lodash-es/_createCompounder.js", "../node_modules/lodash-es/camelCase.js", "../node_modules/lodash-es/castArray.js", "../node_modules/lodash-es/_createRound.js", "../node_modules/lodash-es/ceil.js", "../node_modules/lodash-es/chain.js", "../node_modules/lodash-es/chunk.js", "../node_modules/lodash-es/_baseClamp.js", "../node_modules/lodash-es/clamp.js", "../node_modules/lodash-es/clone.js", "../node_modules/lodash-es/cloneDeepWith.js", "../node_modules/lodash-es/cloneWith.js", "../node_modules/lodash-es/commit.js", "../node_modules/lodash-es/compact.js", "../node_modules/lodash-es/concat.js", "../node_modules/lodash-es/cond.js", "../node_modules/lodash-es/_baseConformsTo.js", "../node_modules/lodash-es/_baseConforms.js", "../node_modules/lodash-es/conforms.js", "../node_modules/lodash-es/conformsTo.js", "../node_modules/lodash-es/_arrayAggregator.js", "../node_modules/lodash-es/_createBaseFor.js", "../node_modules/lodash-es/_baseFor.js", "../node_modules/lodash-es/_baseForOwn.js", "../node_modules/lodash-es/_createBaseEach.js", "../node_modules/lodash-es/_baseEach.js", "../node_modules/lodash-es/_baseAggregator.js", "../node_modules/lodash-es/_createAggregator.js", "../node_modules/lodash-es/countBy.js", "../node_modules/lodash-es/create.js", "../node_modules/lodash-es/curry.js", "../node_modules/lodash-es/curryRight.js", "../node_modules/lodash-es/now.js", "../node_modules/lodash-es/debounce.js", "../node_modules/lodash-es/defaultTo.js", "../node_modules/lodash-es/defaults.js", "../node_modules/lodash-es/_assignMergeValue.js", "../node_modules/lodash-es/isArrayLikeObject.js", "../node_modules/lodash-es/_safeGet.js", "../node_modules/lodash-es/toPlainObject.js", "../node_modules/lodash-es/_baseMergeDeep.js", "../node_modules/lodash-es/_baseMerge.js", "../node_modules/lodash-es/_customDefaultsMerge.js", "../node_modules/lodash-es/mergeWith.js", "../node_modules/lodash-es/defaultsDeep.js", "../node_modules/lodash-es/_baseDelay.js", "../node_modules/lodash-es/defer.js", "../node_modules/lodash-es/delay.js", "../node_modules/lodash-es/_arrayIncludesWith.js", "../node_modules/lodash-es/_baseDifference.js", "../node_modules/lodash-es/difference.js", "../node_modules/lodash-es/last.js", "../node_modules/lodash-es/differenceBy.js", "../node_modules/lodash-es/differenceWith.js", "../node_modules/lodash-es/divide.js", "../node_modules/lodash-es/drop.js", "../node_modules/lodash-es/dropRight.js", "../node_modules/lodash-es/_baseWhile.js", "../node_modules/lodash-es/dropRightWhile.js", "../node_modules/lodash-es/dropWhile.js", "../node_modules/lodash-es/_castFunction.js", "../node_modules/lodash-es/forEach.js", "../node_modules/lodash-es/each.js", "../node_modules/lodash-es/_arrayEachRight.js", "../node_modules/lodash-es/_baseForRight.js", "../node_modules/lodash-es/_baseForOwnRight.js", "../node_modules/lodash-es/_baseEachRight.js", "../node_modules/lodash-es/forEachRight.js", "../node_modules/lodash-es/eachRight.js", "../node_modules/lodash-es/endsWith.js", "../node_modules/lodash-es/_baseToPairs.js", "../node_modules/lodash-es/_setToPairs.js", "../node_modules/lodash-es/_createToPairs.js", "../node_modules/lodash-es/toPairs.js", "../node_modules/lodash-es/entries.js", "../node_modules/lodash-es/toPairsIn.js", "../node_modules/lodash-es/entriesIn.js", "../node_modules/lodash-es/_escapeHtmlChar.js", "../node_modules/lodash-es/escape.js", "../node_modules/lodash-es/escapeRegExp.js", "../node_modules/lodash-es/_arrayEvery.js", "../node_modules/lodash-es/_baseEvery.js", "../node_modules/lodash-es/every.js", "../node_modules/lodash-es/extend.js", "../node_modules/lodash-es/extendWith.js", "../node_modules/lodash-es/toLength.js", "../node_modules/lodash-es/_baseFill.js", "../node_modules/lodash-es/fill.js", "../node_modules/lodash-es/_baseFilter.js", "../node_modules/lodash-es/filter.js", "../node_modules/lodash-es/_createFind.js", "../node_modules/lodash-es/findIndex.js", "../node_modules/lodash-es/find.js", "../node_modules/lodash-es/_baseFindKey.js", "../node_modules/lodash-es/findKey.js", "../node_modules/lodash-es/findLastIndex.js", "../node_modules/lodash-es/findLast.js", "../node_modules/lodash-es/findLastKey.js", "../node_modules/lodash-es/head.js", "../node_modules/lodash-es/first.js", "../node_modules/lodash-es/_baseMap.js", "../node_modules/lodash-es/map.js", "../node_modules/lodash-es/flatMap.js", "../node_modules/lodash-es/flatMapDeep.js", "../node_modules/lodash-es/flatMapDepth.js", "../node_modules/lodash-es/flattenDeep.js", "../node_modules/lodash-es/flattenDepth.js", "../node_modules/lodash-es/flip.js", "../node_modules/lodash-es/floor.js", "../node_modules/lodash-es/_createFlow.js", "../node_modules/lodash-es/flow.js", "../node_modules/lodash-es/flowRight.js", "../node_modules/lodash-es/forIn.js", "../node_modules/lodash-es/forInRight.js", "../node_modules/lodash-es/forOwn.js", "../node_modules/lodash-es/forOwnRight.js", "../node_modules/lodash-es/fromPairs.js", "../node_modules/lodash-es/_baseFunctions.js", "../node_modules/lodash-es/functions.js", "../node_modules/lodash-es/functionsIn.js", "../node_modules/lodash-es/groupBy.js", "../node_modules/lodash-es/_baseGt.js", "../node_modules/lodash-es/_createRelationalOperation.js", "../node_modules/lodash-es/gt.js", "../node_modules/lodash-es/gte.js", "../node_modules/lodash-es/_baseHas.js", "../node_modules/lodash-es/has.js", "../node_modules/lodash-es/_baseInRange.js", "../node_modules/lodash-es/inRange.js", "../node_modules/lodash-es/isString.js", "../node_modules/lodash-es/_baseValues.js", "../node_modules/lodash-es/values.js", "../node_modules/lodash-es/includes.js", "../node_modules/lodash-es/indexOf.js", "../node_modules/lodash-es/initial.js", "../node_modules/lodash-es/_baseIntersection.js", "../node_modules/lodash-es/_castArrayLikeObject.js", "../node_modules/lodash-es/intersection.js", "../node_modules/lodash-es/intersectionBy.js", "../node_modules/lodash-es/intersectionWith.js", "../node_modules/lodash-es/_baseInverter.js", "../node_modules/lodash-es/_createInverter.js", "../node_modules/lodash-es/invert.js", "../node_modules/lodash-es/invertBy.js", "../node_modules/lodash-es/_parent.js", "../node_modules/lodash-es/_baseInvoke.js", "../node_modules/lodash-es/invoke.js", "../node_modules/lodash-es/invokeMap.js", "../node_modules/lodash-es/_baseIsArrayBuffer.js", "../node_modules/lodash-es/isArrayBuffer.js", "../node_modules/lodash-es/isBoolean.js", "../node_modules/lodash-es/_baseIsDate.js", "../node_modules/lodash-es/isDate.js", "../node_modules/lodash-es/isElement.js", "../node_modules/lodash-es/isEmpty.js", "../node_modules/lodash-es/isEqual.js", "../node_modules/lodash-es/isEqualWith.js", "../node_modules/lodash-es/isFinite.js", "../node_modules/lodash-es/isInteger.js", "../node_modules/lodash-es/isMatch.js", "../node_modules/lodash-es/isMatchWith.js", "../node_modules/lodash-es/isNumber.js", "../node_modules/lodash-es/isNaN.js", "../node_modules/lodash-es/_isMaskable.js", "../node_modules/lodash-es/isNative.js", "../node_modules/lodash-es/isNil.js", "../node_modules/lodash-es/isNull.js", "../node_modules/lodash-es/_baseIsRegExp.js", "../node_modules/lodash-es/isRegExp.js", "../node_modules/lodash-es/isSafeInteger.js", "../node_modules/lodash-es/isUndefined.js", "../node_modules/lodash-es/isWeakMap.js", "../node_modules/lodash-es/isWeakSet.js", "../node_modules/lodash-es/iteratee.js", "../node_modules/lodash-es/join.js", "../node_modules/lodash-es/kebabCase.js", "../node_modules/lodash-es/keyBy.js", "../node_modules/lodash-es/_strictLastIndexOf.js", "../node_modules/lodash-es/lastIndexOf.js", "../node_modules/lodash-es/lowerCase.js", "../node_modules/lodash-es/lowerFirst.js", "../node_modules/lodash-es/_baseLt.js", "../node_modules/lodash-es/lt.js", "../node_modules/lodash-es/lte.js", "../node_modules/lodash-es/mapKeys.js", "../node_modules/lodash-es/mapValues.js", "../node_modules/lodash-es/matches.js", "../node_modules/lodash-es/matchesProperty.js", "../node_modules/lodash-es/_baseExtremum.js", "../node_modules/lodash-es/max.js", "../node_modules/lodash-es/maxBy.js", "../node_modules/lodash-es/_baseMean.js", "../node_modules/lodash-es/mean.js", "../node_modules/lodash-es/meanBy.js", "../node_modules/lodash-es/merge.js", "../node_modules/lodash-es/method.js", "../node_modules/lodash-es/methodOf.js", "../node_modules/lodash-es/min.js", "../node_modules/lodash-es/minBy.js", "../node_modules/lodash-es/mixin.js", "../node_modules/lodash-es/multiply.js", "../node_modules/lodash-es/negate.js", "../node_modules/lodash-es/_iteratorToArray.js", "../node_modules/lodash-es/toArray.js", "../node_modules/lodash-es/next.js", "../node_modules/lodash-es/_baseNth.js", "../node_modules/lodash-es/nth.js", "../node_modules/lodash-es/nthArg.js", "../node_modules/lodash-es/_baseUnset.js", "../node_modules/lodash-es/_customOmitClone.js", "../node_modules/lodash-es/omit.js", "../node_modules/lodash-es/omitBy.js", "../node_modules/lodash-es/once.js", "../node_modules/lodash-es/_baseSortBy.js", "../node_modules/lodash-es/_compareAscending.js", "../node_modules/lodash-es/_compareMultiple.js", "../node_modules/lodash-es/_baseOrderBy.js", "../node_modules/lodash-es/orderBy.js", "../node_modules/lodash-es/_createOver.js", "../node_modules/lodash-es/over.js", "../node_modules/lodash-es/_castRest.js", "../node_modules/lodash-es/overArgs.js", "../node_modules/lodash-es/overEvery.js", "../node_modules/lodash-es/overSome.js", "../node_modules/lodash-es/_baseRepeat.js", "../node_modules/lodash-es/_asciiSize.js", "../node_modules/lodash-es/_unicodeSize.js", "../node_modules/lodash-es/_stringSize.js", "../node_modules/lodash-es/_createPadding.js", "../node_modules/lodash-es/pad.js", "../node_modules/lodash-es/padEnd.js", "../node_modules/lodash-es/padStart.js", "../node_modules/lodash-es/parseInt.js", "../node_modules/lodash-es/partial.js", "../node_modules/lodash-es/partialRight.js", "../node_modules/lodash-es/partition.js", "../node_modules/lodash-es/_basePick.js", "../node_modules/lodash-es/pick.js", "../node_modules/lodash-es/plant.js", "../node_modules/lodash-es/propertyOf.js", "../node_modules/lodash-es/_baseIndexOfWith.js", "../node_modules/lodash-es/_basePullAll.js", "../node_modules/lodash-es/pullAll.js", "../node_modules/lodash-es/pull.js", "../node_modules/lodash-es/pullAllBy.js", "../node_modules/lodash-es/pullAllWith.js", "../node_modules/lodash-es/_basePullAt.js", "../node_modules/lodash-es/pullAt.js", "../node_modules/lodash-es/_baseRandom.js", "../node_modules/lodash-es/random.js", "../node_modules/lodash-es/_baseRange.js", "../node_modules/lodash-es/_createRange.js", "../node_modules/lodash-es/range.js", "../node_modules/lodash-es/rangeRight.js", "../node_modules/lodash-es/rearg.js", "../node_modules/lodash-es/_baseReduce.js", "../node_modules/lodash-es/reduce.js", "../node_modules/lodash-es/_arrayReduceRight.js", "../node_modules/lodash-es/reduceRight.js", "../node_modules/lodash-es/reject.js", "../node_modules/lodash-es/remove.js", "../node_modules/lodash-es/repeat.js", "../node_modules/lodash-es/replace.js", "../node_modules/lodash-es/rest.js", "../node_modules/lodash-es/result.js", "../node_modules/lodash-es/reverse.js", "../node_modules/lodash-es/round.js", "../node_modules/lodash-es/_arraySample.js", "../node_modules/lodash-es/_baseSample.js", "../node_modules/lodash-es/sample.js", "../node_modules/lodash-es/_shuffleSelf.js", "../node_modules/lodash-es/_arraySampleSize.js", "../node_modules/lodash-es/_baseSampleSize.js", "../node_modules/lodash-es/sampleSize.js", "../node_modules/lodash-es/set.js", "../node_modules/lodash-es/setWith.js", "../node_modules/lodash-es/_arrayShuffle.js", "../node_modules/lodash-es/_baseShuffle.js", "../node_modules/lodash-es/shuffle.js", "../node_modules/lodash-es/size.js", "../node_modules/lodash-es/slice.js", "../node_modules/lodash-es/snakeCase.js", "../node_modules/lodash-es/_baseSome.js", "../node_modules/lodash-es/some.js", "../node_modules/lodash-es/sortBy.js", "../node_modules/lodash-es/_baseSortedIndexBy.js", "../node_modules/lodash-es/_baseSortedIndex.js", "../node_modules/lodash-es/sortedIndex.js", "../node_modules/lodash-es/sortedIndexBy.js", "../node_modules/lodash-es/sortedIndexOf.js", "../node_modules/lodash-es/sortedLastIndex.js", "../node_modules/lodash-es/sortedLastIndexBy.js", "../node_modules/lodash-es/sortedLastIndexOf.js", "../node_modules/lodash-es/_baseSortedUniq.js", "../node_modules/lodash-es/sortedUniq.js", "../node_modules/lodash-es/sortedUniqBy.js", "../node_modules/lodash-es/split.js", "../node_modules/lodash-es/spread.js", "../node_modules/lodash-es/startCase.js", "../node_modules/lodash-es/startsWith.js", "../node_modules/lodash-es/stubObject.js", "../node_modules/lodash-es/stubString.js", "../node_modules/lodash-es/stubTrue.js", "../node_modules/lodash-es/subtract.js", "../node_modules/lodash-es/sum.js", "../node_modules/lodash-es/tail.js", "../node_modules/lodash-es/take.js", "../node_modules/lodash-es/takeRight.js", "../node_modules/lodash-es/takeRightWhile.js", "../node_modules/lodash-es/takeWhile.js", "../node_modules/lodash-es/tap.js", "../node_modules/lodash-es/_customDefaultsAssignIn.js", "../node_modules/lodash-es/_escapeStringChar.js", "../node_modules/lodash-es/_reInterpolate.js", "../node_modules/lodash-es/_reEscape.js", "../node_modules/lodash-es/_reEvaluate.js", "../node_modules/lodash-es/templateSettings.js", "../node_modules/lodash-es/template.js", "../node_modules/lodash-es/throttle.js", "../node_modules/lodash-es/thru.js", "../node_modules/lodash-es/times.js", "../node_modules/lodash-es/toIterator.js", "../node_modules/lodash-es/_baseWrapperValue.js", "../node_modules/lodash-es/wrapperValue.js", "../node_modules/lodash-es/toJSON.js", "../node_modules/lodash-es/toLower.js", "../node_modules/lodash-es/toPath.js", "../node_modules/lodash-es/toSafeInteger.js", "../node_modules/lodash-es/toUpper.js", "../node_modules/lodash-es/transform.js", "../node_modules/lodash-es/_charsEndIndex.js", "../node_modules/lodash-es/_charsStartIndex.js", "../node_modules/lodash-es/trim.js", "../node_modules/lodash-es/trimEnd.js", "../node_modules/lodash-es/trimStart.js", "../node_modules/lodash-es/truncate.js", "../node_modules/lodash-es/unary.js", "../node_modules/lodash-es/_unescapeHtmlChar.js", "../node_modules/lodash-es/unescape.js", "../node_modules/lodash-es/_createSet.js", "../node_modules/lodash-es/_baseUniq.js", "../node_modules/lodash-es/union.js", "../node_modules/lodash-es/unionBy.js", "../node_modules/lodash-es/unionWith.js", "../node_modules/lodash-es/uniq.js", "../node_modules/lodash-es/uniqBy.js", "../node_modules/lodash-es/uniqWith.js", "../node_modules/lodash-es/uniqueId.js", "../node_modules/lodash-es/unset.js", "../node_modules/lodash-es/unzip.js", "../node_modules/lodash-es/unzipWith.js", "../node_modules/lodash-es/_baseUpdate.js", "../node_modules/lodash-es/update.js", "../node_modules/lodash-es/updateWith.js", "../node_modules/lodash-es/upperCase.js", "../node_modules/lodash-es/value.js", "../node_modules/lodash-es/valueOf.js", "../node_modules/lodash-es/valuesIn.js", "../node_modules/lodash-es/without.js", "../node_modules/lodash-es/wrap.js", "../node_modules/lodash-es/wrapperAt.js", "../node_modules/lodash-es/wrapperChain.js", "../node_modules/lodash-es/wrapperReverse.js", "../node_modules/lodash-es/_baseXor.js", "../node_modules/lodash-es/xor.js", "../node_modules/lodash-es/xorBy.js", "../node_modules/lodash-es/xorWith.js", "../node_modules/lodash-es/zip.js", "../node_modules/lodash-es/_baseZipObject.js", "../node_modules/lodash-es/zipObject.js", "../node_modules/lodash-es/zipObjectDeep.js", "../node_modules/lodash-es/zipWith.js", "../node_modules/lodash-es/array.default.js", "../node_modules/lodash-es/array.js", "../node_modules/lodash-es/collection.default.js", "../node_modules/lodash-es/collection.js", "../node_modules/lodash-es/date.default.js", "../node_modules/lodash-es/date.js", "../node_modules/lodash-es/function.default.js", "../node_modules/lodash-es/function.js", "../node_modules/lodash-es/lang.default.js", "../node_modules/lodash-es/lang.js", "../node_modules/lodash-es/math.default.js", "../node_modules/lodash-es/math.js", "../node_modules/lodash-es/number.default.js", "../node_modules/lodash-es/number.js", "../node_modules/lodash-es/object.default.js", "../node_modules/lodash-es/object.js", "../node_modules/lodash-es/seq.default.js", "../node_modules/lodash-es/seq.js", "../node_modules/lodash-es/string.default.js", "../node_modules/lodash-es/string.js", "../node_modules/lodash-es/util.default.js", "../node_modules/lodash-es/util.js", "../node_modules/lodash-es/_lazyClone.js", "../node_modules/lodash-es/_lazyReverse.js", "../node_modules/lodash-es/_getView.js", "../node_modules/lodash-es/_lazyValue.js", "../node_modules/lodash-es/lodash.default.js", "../node_modules/lodash-es/lodash.js", "../src/constants/keys.ts", "../node_modules/axios/lib/helpers/bind.js", "../node_modules/axios/lib/utils.js", "../node_modules/axios/lib/core/AxiosError.js", "../node_modules/delayed-stream/lib/delayed_stream.js", "../node_modules/combined-stream/lib/combined_stream.js", "../node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js", "../node_modules/form-data/node_modules/mime-types/index.js", "../node_modules/asynckit/lib/defer.js", "../node_modules/asynckit/lib/async.js", "../node_modules/asynckit/lib/abort.js", "../node_modules/asynckit/lib/iterate.js", "../node_modules/asynckit/lib/state.js", "../node_modules/asynckit/lib/terminator.js", "../node_modules/asynckit/parallel.js", "../node_modules/asynckit/serialOrdered.js", "../node_modules/asynckit/serial.js", "../node_modules/asynckit/index.js", "../node_modules/es-object-atoms/index.js", "../node_modules/es-errors/index.js", "../node_modules/es-errors/eval.js", "../node_modules/es-errors/range.js", "../node_modules/es-errors/ref.js", "../node_modules/es-errors/syntax.js", "../node_modules/es-errors/type.js", "../node_modules/es-errors/uri.js", "../node_modules/math-intrinsics/abs.js", "../node_modules/math-intrinsics/floor.js", "../node_modules/math-intrinsics/max.js", "../node_modules/math-intrinsics/min.js", "../node_modules/math-intrinsics/pow.js", "../node_modules/math-intrinsics/round.js", "../node_modules/math-intrinsics/isNaN.js", "../node_modules/math-intrinsics/sign.js", "../node_modules/gopd/gOPD.js", "../node_modules/gopd/index.js", "../node_modules/es-define-property/index.js", "../node_modules/has-symbols/shams.js", "../node_modules/has-symbols/index.js", "../node_modules/get-proto/Reflect.getPrototypeOf.js", "../node_modules/get-proto/Object.getPrototypeOf.js", "../node_modules/function-bind/implementation.js", "../node_modules/function-bind/index.js", "../node_modules/call-bind-apply-helpers/functionCall.js", "../node_modules/call-bind-apply-helpers/functionApply.js", "../node_modules/call-bind-apply-helpers/reflectApply.js", "../node_modules/call-bind-apply-helpers/actualApply.js", "../node_modules/call-bind-apply-helpers/index.js", "../node_modules/dunder-proto/get.js", "../node_modules/get-proto/index.js", "../node_modules/hasown/index.js", "../node_modules/get-intrinsic/index.js", "../node_modules/has-tostringtag/shams.js", "../node_modules/es-set-tostringtag/index.js", "../node_modules/form-data/lib/populate.js", "../node_modules/form-data/lib/form_data.js", "../node_modules/axios/lib/platform/node/classes/FormData.js", "../node_modules/axios/lib/helpers/toFormData.js", "../node_modules/axios/lib/helpers/AxiosURLSearchParams.js", "../node_modules/axios/lib/helpers/buildURL.js", "../node_modules/axios/lib/core/InterceptorManager.js", "../node_modules/axios/lib/defaults/transitional.js", "../node_modules/axios/lib/platform/node/classes/URLSearchParams.js", "../node_modules/axios/lib/platform/node/index.js", "../node_modules/axios/lib/platform/common/utils.js", "../node_modules/axios/lib/platform/index.js", "../node_modules/axios/lib/helpers/toURLEncodedForm.js", "../node_modules/axios/lib/helpers/formDataToJSON.js", "../node_modules/axios/lib/defaults/index.js", "../node_modules/axios/lib/helpers/parseHeaders.js", "../node_modules/axios/lib/core/AxiosHeaders.js", "../node_modules/axios/lib/core/transformData.js", "../node_modules/axios/lib/cancel/isCancel.js", "../node_modules/axios/lib/cancel/CanceledError.js", "../node_modules/axios/lib/core/settle.js", "../node_modules/axios/lib/helpers/isAbsoluteURL.js", "../node_modules/axios/lib/helpers/combineURLs.js", "../node_modules/axios/lib/core/buildFullPath.js", "../node_modules/proxy-from-env/index.js", "../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/follow-redirects/debug.js", "../node_modules/follow-redirects/index.js", "../node_modules/axios/lib/env/data.js", "../node_modules/axios/lib/helpers/parseProtocol.js", "../node_modules/axios/lib/helpers/fromDataURI.js", "../node_modules/axios/lib/helpers/AxiosTransformStream.js", "../node_modules/axios/lib/helpers/readBlob.js", "../node_modules/axios/lib/helpers/formDataToStream.js", "../node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js", "../node_modules/axios/lib/helpers/callbackify.js", "../node_modules/axios/lib/helpers/speedometer.js", "../node_modules/axios/lib/helpers/throttle.js", "../node_modules/axios/lib/helpers/progressEventReducer.js", "../node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js", "../node_modules/axios/lib/adapters/http.js", "../node_modules/axios/lib/helpers/isURLSameOrigin.js", "../node_modules/axios/lib/helpers/cookies.js", "../node_modules/axios/lib/core/mergeConfig.js", "../node_modules/axios/lib/helpers/resolveConfig.js", "../node_modules/axios/lib/adapters/xhr.js", "../node_modules/axios/lib/helpers/composeSignals.js", "../node_modules/axios/lib/helpers/trackStream.js", "../node_modules/axios/lib/adapters/fetch.js", "../node_modules/axios/lib/adapters/adapters.js", "../node_modules/axios/lib/core/dispatchRequest.js", "../node_modules/axios/lib/helpers/validator.js", "../node_modules/axios/lib/core/Axios.js", "../node_modules/axios/lib/cancel/CancelToken.js", "../node_modules/axios/lib/helpers/spread.js", "../node_modules/axios/lib/helpers/isAxiosError.js", "../node_modules/axios/lib/helpers/HttpStatusCode.js", "../node_modules/axios/lib/axios.js", "../node_modules/axios/index.js", "../src/constants/oauth.ts", "../node_modules/chalk/source/vendor/ansi-styles/index.js", "../node_modules/chalk/source/vendor/supports-color/index.js", "../node_modules/chalk/source/utilities.js", "../node_modules/chalk/source/index.js", "../node_modules/is-plain-obj/index.js", "../node_modules/execa/lib/arguments/file-url.js", "../node_modules/execa/lib/methods/parameters.js", "../node_modules/execa/lib/utils/uint-array.js", "../node_modules/execa/lib/methods/template.js", "../node_modules/execa/lib/utils/standard-stream.js", "../node_modules/execa/lib/arguments/specific.js", "../node_modules/execa/lib/verbose/values.js", "../node_modules/execa/lib/arguments/escape.js", "../node_modules/is-unicode-supported/index.js", "../node_modules/figures/index.js", "../node_modules/yoctocolors/base.js", "../node_modules/yoctocolors/index.js", "../node_modules/execa/lib/verbose/default.js", "../node_modules/execa/lib/verbose/custom.js", "../node_modules/execa/lib/verbose/log.js", "../node_modules/execa/lib/verbose/start.js", "../node_modules/execa/lib/verbose/info.js", "../node_modules/execa/lib/return/duration.js", "../node_modules/execa/lib/arguments/command.js", "../node_modules/isexe/windows.js", "../node_modules/isexe/mode.js", "../node_modules/isexe/index.js", "../node_modules/which/which.js", "../node_modules/path-key/index.js", "../node_modules/cross-spawn/lib/util/resolveCommand.js", "../node_modules/cross-spawn/lib/util/escape.js", "../node_modules/shebang-regex/index.js", "../node_modules/shebang-command/index.js", "../node_modules/cross-spawn/lib/util/readShebang.js", "../node_modules/cross-spawn/lib/parse.js", "../node_modules/cross-spawn/lib/enoent.js", "../node_modules/cross-spawn/index.js", "../node_modules/npm-run-path/node_modules/path-key/index.js", "../node_modules/unicorn-magic/node.js", "../node_modules/npm-run-path/index.js", "../node_modules/execa/lib/return/final-error.js", "../node_modules/human-signals/build/src/realtime.js", "../node_modules/human-signals/build/src/core.js", "../node_modules/human-signals/build/src/signals.js", "../node_modules/human-signals/build/src/main.js", "../node_modules/execa/lib/terminate/signal.js", "../node_modules/execa/lib/terminate/kill.js", "../node_modules/execa/lib/utils/abort-signal.js", "../node_modules/execa/lib/terminate/cancel.js", "../node_modules/execa/lib/ipc/validation.js", "../node_modules/execa/lib/utils/deferred.js", "../node_modules/execa/lib/arguments/fd-options.js", "../node_modules/execa/lib/utils/max-listeners.js", "../node_modules/execa/lib/ipc/reference.js", "../node_modules/execa/lib/ipc/incoming.js", "../node_modules/execa/lib/ipc/forward.js", "../node_modules/execa/lib/ipc/strict.js", "../node_modules/execa/lib/ipc/outgoing.js", "../node_modules/execa/lib/ipc/send.js", "../node_modules/execa/lib/ipc/graceful.js", "../node_modules/execa/lib/terminate/graceful.js", "../node_modules/execa/lib/terminate/timeout.js", "../node_modules/execa/lib/methods/node.js", "../node_modules/execa/lib/ipc/ipc-input.js", "../node_modules/execa/lib/arguments/encoding-option.js", "../node_modules/execa/lib/arguments/cwd.js", "../node_modules/execa/lib/arguments/options.js", "../node_modules/execa/lib/arguments/shell.js", "../node_modules/strip-final-newline/index.js", "../node_modules/is-stream/index.js", "../node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js", "../node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js", "../node_modules/get-stream/source/stream.js", "../node_modules/get-stream/source/contents.js", "../node_modules/get-stream/source/utils.js", "../node_modules/get-stream/source/array.js", "../node_modules/get-stream/source/array-buffer.js", "../node_modules/get-stream/source/buffer.js", "../node_modules/get-stream/source/string.js", "../node_modules/get-stream/source/exports.js", "../node_modules/get-stream/source/index.js", "../node_modules/execa/lib/io/max-buffer.js", "../node_modules/execa/lib/return/message.js", "../node_modules/execa/lib/return/result.js", "../node_modules/parse-ms/index.js", "../node_modules/pretty-ms/index.js", "../node_modules/execa/lib/verbose/error.js", "../node_modules/execa/lib/verbose/complete.js", "../node_modules/execa/lib/return/reject.js", "../node_modules/execa/lib/stdio/type.js", "../node_modules/execa/lib/transform/object-mode.js", "../node_modules/execa/lib/transform/normalize.js", "../node_modules/execa/lib/stdio/direction.js", "../node_modules/execa/lib/ipc/array.js", "../node_modules/execa/lib/stdio/stdio-option.js", "../node_modules/execa/lib/stdio/native.js", "../node_modules/execa/lib/stdio/input-option.js", "../node_modules/execa/lib/stdio/duplicate.js", "../node_modules/execa/lib/stdio/handle.js", "../node_modules/execa/lib/stdio/handle-sync.js", "../node_modules/execa/lib/io/strip-newline.js", "../node_modules/execa/lib/transform/split.js", "../node_modules/execa/lib/transform/validate.js", "../node_modules/execa/lib/transform/encoding-transform.js", "../node_modules/execa/lib/transform/run-async.js", "../node_modules/execa/lib/transform/run-sync.js", "../node_modules/execa/lib/transform/generator.js", "../node_modules/execa/lib/io/input-sync.js", "../node_modules/execa/lib/verbose/output.js", "../node_modules/execa/lib/io/output-sync.js", "../node_modules/execa/lib/resolve/all-sync.js", "../node_modules/execa/lib/resolve/exit-async.js", "../node_modules/execa/lib/resolve/exit-sync.js", "../node_modules/execa/lib/methods/main-sync.js", "../node_modules/execa/lib/ipc/get-one.js", "../node_modules/execa/lib/ipc/get-each.js", "../node_modules/execa/lib/ipc/methods.js", "../node_modules/execa/lib/return/early-error.js", "../node_modules/execa/lib/stdio/handle-async.js", "../node_modules/@sindresorhus/merge-streams/index.js", "../node_modules/execa/lib/io/pipeline.js", "../node_modules/execa/lib/io/output-async.js", "../node_modules/signal-exit/dist/mjs/signals.js", "../node_modules/signal-exit/dist/mjs/index.js", "../node_modules/execa/lib/terminate/cleanup.js", "../node_modules/execa/lib/pipe/pipe-arguments.js", "../node_modules/execa/lib/pipe/throw.js", "../node_modules/execa/lib/pipe/sequence.js", "../node_modules/execa/lib/pipe/streaming.js", "../node_modules/execa/lib/pipe/abort.js", "../node_modules/execa/lib/pipe/setup.js", "../node_modules/execa/lib/io/iterate.js", "../node_modules/execa/lib/io/contents.js", "../node_modules/execa/lib/resolve/wait-stream.js", "../node_modules/execa/lib/resolve/stdio.js", "../node_modules/execa/lib/resolve/all-async.js", "../node_modules/execa/lib/verbose/ipc.js", "../node_modules/execa/lib/ipc/buffer-messages.js", "../node_modules/execa/lib/resolve/wait-subprocess.js", "../node_modules/execa/lib/convert/concurrent.js", "../node_modules/execa/lib/convert/shared.js", "../node_modules/execa/lib/convert/readable.js", "../node_modules/execa/lib/convert/writable.js", "../node_modules/execa/lib/convert/duplex.js", "../node_modules/execa/lib/convert/iterable.js", "../node_modules/execa/lib/convert/add.js", "../node_modules/execa/lib/methods/promise.js", "../node_modules/execa/lib/methods/main-async.js", "../node_modules/execa/lib/methods/bind.js", "../node_modules/execa/lib/methods/create.js", "../node_modules/execa/lib/methods/command.js", "../node_modules/execa/lib/methods/script.js", "../node_modules/execa/index.js", "../src/constants/xml.ts", "../src/types/logs.ts", "../node_modules/is-safe-filename/index.js", "../node_modules/env-paths/index.js", "../src/utils/hash.ts", "../src/utils/cachePaths.ts", "../src/utils/displayTags.ts", "../src/utils/privacyLevel.ts", "../src/utils/log.ts", "../src/utils/sequential.ts", "../node_modules/zod/v4/core/core.js", "../node_modules/zod/v4/core/util.js", "../node_modules/zod/v4/core/errors.js", "../node_modules/zod/v4/core/parse.js", "../node_modules/zod/v4/core/regexes.js", "../node_modules/zod/v4/core/checks.js", "../node_modules/zod/v4/core/doc.js", "../node_modules/zod/v4/core/versions.js", "../node_modules/zod/v4/core/schemas.js", "../node_modules/zod/v4/locales/ar.js", "../node_modules/zod/v4/locales/az.js", "../node_modules/zod/v4/locales/be.js", "../node_modules/zod/v4/locales/ca.js", "../node_modules/zod/v4/locales/cs.js", "../node_modules/zod/v4/locales/de.js", "../node_modules/zod/v4/locales/en.js", "../node_modules/zod/v4/locales/eo.js", "../node_modules/zod/v4/locales/es.js", "../node_modules/zod/v4/locales/fa.js", "../node_modules/zod/v4/locales/fi.js", "../node_modules/zod/v4/locales/fr.js", "../node_modules/zod/v4/locales/fr-CA.js", "../node_modules/zod/v4/locales/he.js", "../node_modules/zod/v4/locales/hu.js", "../node_modules/zod/v4/locales/id.js", "../node_modules/zod/v4/locales/it.js", "../node_modules/zod/v4/locales/ja.js", "../node_modules/zod/v4/locales/kh.js", "../node_modules/zod/v4/locales/ko.js", "../node_modules/zod/v4/locales/mk.js", "../node_modules/zod/v4/locales/ms.js", "../node_modules/zod/v4/locales/nl.js", "../node_modules/zod/v4/locales/no.js", "../node_modules/zod/v4/locales/ota.js", "../node_modules/zod/v4/locales/ps.js", "../node_modules/zod/v4/locales/pl.js", "../node_modules/zod/v4/locales/pt.js", "../node_modules/zod/v4/locales/ru.js", "../node_modules/zod/v4/locales/sl.js", "../node_modules/zod/v4/locales/sv.js", "../node_modules/zod/v4/locales/ta.js", "../node_modules/zod/v4/locales/th.js", "../node_modules/zod/v4/locales/tr.js", "../node_modules/zod/v4/locales/ua.js", "../node_modules/zod/v4/locales/ur.js", "../node_modules/zod/v4/locales/vi.js", "../node_modules/zod/v4/locales/zh-CN.js", "../node_modules/zod/v4/locales/zh-TW.js", "../node_modules/zod/v4/locales/index.js", "../node_modules/zod/v4/core/registries.js", "../node_modules/zod/v4/core/api.js", "../node_modules/zod/v4/core/function.js", "../node_modules/zod/v4/core/to-json-schema.js", "../node_modules/zod/v4/core/index.js", "../node_modules/zod/v4/classic/checks.js", "../node_modules/zod/v4/classic/iso.js", "../node_modules/zod/v4/classic/errors.js", "../node_modules/zod/v4/classic/parse.js", "../node_modules/zod/v4/classic/schemas.js", "../node_modules/zod/v4/classic/compat.js", "../node_modules/zod/v4/classic/coerce.js", "../node_modules/zod/v4/classic/external.js", "../node_modules/zod/v4/classic/index.js", "../node_modules/zod/v4/index.js", "../src/utils/fileRead.ts", "../src/utils/jsonRead.ts", "../src/services/remoteManagedSettings/syncCacheState.ts", "../src/utils/array.ts", "../src/utils/diagLogs.ts", "../src/utils/cwd.ts", "../src/utils/fileReadCache.ts", "../src/utils/platform.ts", "../src/utils/execSyncWrapper.ts", "../node_modules/lru-cache/dist/esm/index.min.js", "../src/utils/memoize.ts", "../src/utils/windowsPaths.ts", "../src/utils/getWorktreePathsPortable.ts", "../src/utils/sessionStoragePortable.ts", "../src/utils/path.ts", "../src/utils/file.ts", "../src/utils/execFileNoThrowPortable.ts", "../src/utils/execFileNoThrow.ts", "../src/constants/files.ts", "../src/utils/git/gitConfigParser.ts", "../src/utils/git/gitFilesystem.ts", "../src/utils/which.ts", "../src/utils/detectRepository.ts", "../src/utils/git.ts", "../src/utils/git/gitignore.ts", "../node_modules/jsonc-parser/lib/esm/impl/scanner.js", "../node_modules/jsonc-parser/lib/esm/impl/string-intern.js", "../node_modules/jsonc-parser/lib/esm/impl/format.js", "../node_modules/jsonc-parser/lib/esm/impl/parser.js", "../node_modules/jsonc-parser/lib/esm/impl/edit.js", "../node_modules/jsonc-parser/lib/esm/main.js", "../src/utils/json.ts", "../src/utils/settings/constants.ts", "../src/utils/settings/internalWrites.ts", "../src/utils/settings/managedPath.ts", "../src/utils/lazySchema.ts", "../src/entrypoints/sandboxTypes.ts", "../src/utils/bundledMode.ts", "../src/utils/findExecutable.ts", "../src/utils/env.ts", "../src/constants/figures.ts", "../src/types/permissions.ts", "../src/utils/permissions/PermissionMode.ts", "../src/entrypoints/sdk/coreTypes.ts", "../src/entrypoints/agentSdkTypes.ts", "../src/utils/shell/shellProvider.ts", "../src/schemas/hooks.ts", "../src/services/mcp/types.ts", "../src/utils/plugins/schemas.ts", "../src/services/mcp/normalization.ts", "../src/services/mcp/mcpStringUtils.ts", "../src/tools/AgentTool/constants.ts", "../src/tools/TaskOutputTool/constants.ts", "../src/tools/TaskStopTool/prompt.ts", "../src/tools/BriefTool/prompt.ts", "../src/utils/permissions/permissionRuleParser.ts", "../src/utils/stringUtils.ts", "../src/utils/settings/toolValidationConfig.ts", "../src/utils/settings/permissionValidation.ts", "../src/utils/settings/types.ts", "../src/utils/settings/schemaOutput.ts", "../src/utils/settings/validationTips.ts", "../src/utils/settings/validation.ts", "../src/utils/settings/mdm/constants.ts", "../src/utils/settings/mdm/rawRead.ts", "../src/utils/settings/mdm/settings.ts", "../src/utils/settings/settings.ts", "../node_modules/agent-base/dist/helpers.js", "../node_modules/agent-base/dist/index.js", "../node_modules/https-proxy-agent/dist/parse-proxy-response.js", "../node_modules/https-proxy-agent/dist/index.js", "../src/utils/caCerts.ts", "../node_modules/undici/lib/core/symbols.js", "../node_modules/undici/lib/util/timers.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/util/stats.js", "../node_modules/undici/lib/core/diagnostics.js", "../node_modules/undici/lib/core/request.js", "../node_modules/undici/lib/handler/wrap-handler.js", "../node_modules/undici/lib/dispatcher/dispatcher.js", "../node_modules/undici/lib/handler/unwrap-handler.js", "../node_modules/undici/lib/dispatcher/dispatcher-base.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/encoding/index.js", "../node_modules/undici/lib/web/infra/index.js", "../node_modules/undici/lib/web/fetch/data-url.js", "../node_modules/undici/lib/util/runtime-features.js", "../node_modules/undici/lib/web/webidl/index.js", "../node_modules/undici/lib/web/fetch/util.js", "../node_modules/undici/lib/web/fetch/formdata.js", "../node_modules/undici/lib/web/fetch/formdata-parser.js", "../node_modules/undici/lib/util/promise.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/dispatcher/client.js", "../node_modules/undici/lib/dispatcher/fixed-queue.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/round-robin-pool.js", "../node_modules/undici/lib/dispatcher/agent.js", "../node_modules/undici/lib/core/socks5-utils.js", "../node_modules/undici/lib/core/socks5-client.js", "../node_modules/undici/lib/dispatcher/socks5-proxy-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/dispatcher/h2c-client.js", "../node_modules/undici/lib/api/readable.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-call-history.js", "../node_modules/undici/lib/mock/mock-pool.js", "../node_modules/undici/lib/mock/pending-interceptors-formatter.js", "../node_modules/undici/lib/mock/mock-agent.js", "../node_modules/undici/lib/mock/snapshot-utils.js", "../node_modules/undici/lib/mock/snapshot-recorder.js", "../node_modules/undici/lib/mock/snapshot-agent.js", "../node_modules/undici/lib/global.js", "../node_modules/undici/lib/handler/decorator-handler.js", "../node_modules/undici/lib/handler/redirect-handler.js", "../node_modules/undici/lib/interceptor/redirect.js", "../node_modules/undici/lib/interceptor/response-error.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/util/cache.js", "../node_modules/undici/lib/util/date.js", "../node_modules/undici/lib/handler/cache-handler.js", "../node_modules/undici/lib/cache/memory-cache-store.js", "../node_modules/undici/lib/handler/cache-revalidation-handler.js", "../node_modules/undici/lib/interceptor/cache.js", "../node_modules/undici/lib/interceptor/decompress.js", "../node_modules/undici/lib/handler/deduplication-handler.js", "../node_modules/undici/lib/interceptor/deduplicate.js", "../node_modules/undici/lib/cache/sqlite-cache-store.js", "../node_modules/undici/lib/web/fetch/headers.js", "../node_modules/undici/lib/web/fetch/response.js", "../node_modules/undici/lib/web/fetch/request.js", "../node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js", "../node_modules/undici/lib/web/fetch/index.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/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/websocket/stream/websocketerror.js", "../node_modules/undici/lib/web/websocket/stream/websocketstream.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", "../src/utils/mtls.ts", "../node_modules/@smithy/types/dist-cjs/index.js", "../node_modules/@smithy/protocol-http/dist-cjs/index.js", "../node_modules/@smithy/util-uri-escape/dist-cjs/index.js", "../node_modules/@smithy/querystring-builder/dist-cjs/index.js", "../node_modules/@smithy/node-http-handler/dist-cjs/index.js", "../node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js", "../node_modules/@smithy/property-provider/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js", "../node_modules/@smithy/node-config-provider/dist-cjs/index.js", "../node_modules/@smithy/querystring-parser/dist-cjs/index.js", "../node_modules/@smithy/url-parser/dist-cjs/index.js", "../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js", "../node_modules/tslib/tslib.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js", "../node_modules/@smithy/middleware-stack/dist-cjs/index.js", "../node_modules/@smithy/is-array-buffer/dist-cjs/index.js", "../node_modules/@smithy/util-buffer-from/dist-cjs/index.js", "../node_modules/@smithy/util-base64/dist-cjs/fromBase64.js", "../node_modules/@smithy/util-utf8/dist-cjs/index.js", "../node_modules/@smithy/util-base64/dist-cjs/toBase64.js", "../node_modules/@smithy/util-base64/dist-cjs/index.js", "../node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js", "../node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js", "../node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js", "../node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js", "../node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js", "../node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js", "../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js", "../node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/headStream.js", "../node_modules/@smithy/fetch-http-handler/dist-cjs/index.js", "../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js", "../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js", "../node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/splitStream.js", "../node_modules/@smithy/util-stream/dist-cjs/index.js", "../node_modules/@smithy/util-middleware/dist-cjs/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/schema/index.js", "../node_modules/@smithy/uuid/dist-cjs/randomUUID.js", "../node_modules/@smithy/uuid/dist-cjs/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/serde/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js", "../node_modules/@smithy/smithy-client/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js", "../node_modules/@smithy/core/dist-cjs/index.js", "../node_modules/@smithy/signature-v4/dist-cjs/index.js", "../node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js", "../node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js", "../node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js", "../node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js", "../node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js", "../node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js", "../node_modules/@smithy/util-endpoints/dist-cjs/index.js", "../node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js", "../node_modules/@smithy/service-error-classification/dist-cjs/index.js", "../node_modules/@smithy/util-retry/dist-cjs/index.js", "../node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js", "../node_modules/@smithy/util-config-provider/dist-cjs/index.js", "../node_modules/@smithy/config-resolver/dist-cjs/index.js", "../node_modules/@smithy/middleware-content-length/dist-cjs/index.js", "../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js", "../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js", "../node_modules/@smithy/middleware-serde/dist-cjs/index.js", "../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js", "../node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js", "../node_modules/@smithy/middleware-retry/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js", "../node_modules/@smithy/hash-node/dist-cjs/index.js", "../node_modules/@smithy/util-body-length-node/dist-cjs/index.js", "../node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js", "../node_modules/@smithy/util-body-length-browser/dist-cjs/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js", "../node_modules/fast-xml-parser/lib/fxp.cjs", "../node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js", "../node_modules/@aws-sdk/xml-builder/dist-cjs/index.js", "../node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/models/SSOOIDCServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.js", "../node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js", "../node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js", "../node_modules/@aws-sdk/token-providers/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/SSOServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js", "../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js", "../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/models/SigninServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js", "../node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/EndpointParameters.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/models/STSServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthExtensionConfiguration.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeExtensions.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/STSClient.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js", "../node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js", "../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js", "../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js", "../src/utils/proxy.ts", "../../node_modules/@smithy/types/dist-cjs/index.js", "../../node_modules/@smithy/protocol-http/dist-cjs/index.js", "../../node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js", "../../node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js", "../../node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js", "../../node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js", "../../node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js", "../../node_modules/@smithy/util-middleware/dist-cjs/index.js", "../../node_modules/@smithy/middleware-serde/dist-cjs/index.js", "../../node_modules/@smithy/is-array-buffer/dist-cjs/index.js", "../../node_modules/@smithy/util-buffer-from/dist-cjs/index.js", "../../node_modules/@smithy/util-base64/dist-cjs/fromBase64.js", "../../node_modules/@smithy/util-utf8/dist-cjs/index.js", "../../node_modules/@smithy/util-base64/dist-cjs/toBase64.js", "../../node_modules/@smithy/util-base64/dist-cjs/index.js", "../../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js", "../../node_modules/@smithy/util-uri-escape/dist-cjs/index.js", "../../node_modules/@smithy/querystring-builder/dist-cjs/index.js", "../../node_modules/@smithy/node-http-handler/dist-cjs/index.js", "../../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js", "../../node_modules/@smithy/util-stream/dist-cjs/index.js", "../../node_modules/@smithy/core/dist-cjs/submodules/schema/index.js", "../../node_modules/tslib/tslib.js", "../../node_modules/@smithy/uuid/dist-cjs/randomUUID.js", "../../node_modules/@smithy/uuid/dist-cjs/index.js", "../../node_modules/@smithy/core/dist-cjs/submodules/serde/index.js", "../../node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js", "../../node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js", "../../node_modules/@smithy/core/dist-cjs/index.js", "../../node_modules/@smithy/util-endpoints/dist-cjs/index.js", "../../node_modules/@smithy/querystring-parser/dist-cjs/index.js", "../../node_modules/@smithy/url-parser/dist-cjs/index.js", "../../node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js", "../../node_modules/@smithy/property-provider/dist-cjs/index.js", "../../node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js", "../../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js", "../../node_modules/@smithy/signature-v4/dist-cjs/index.js", "../../node_modules/@smithy/util-body-length-browser/dist-cjs/index.js", "../../node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js", "../../node_modules/@smithy/middleware-stack/dist-cjs/index.js", "../../node_modules/@smithy/smithy-client/dist-cjs/index.js", "../../node_modules/fast-xml-parser/lib/fxp.cjs", "../../node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js", "../../node_modules/@aws-sdk/xml-builder/dist-cjs/index.js", "../../node_modules/@aws-sdk/core/dist-cjs/index.js", "../../node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js", "../../node_modules/@smithy/util-config-provider/dist-cjs/index.js", "../../node_modules/@smithy/config-resolver/dist-cjs/index.js", "../../node_modules/@smithy/middleware-content-length/dist-cjs/index.js", "../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js", "../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js", "../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js", "../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js", "../../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js", "../../node_modules/@smithy/node-config-provider/dist-cjs/index.js", "../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js", "../../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js", "../../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js", "../../node_modules/@smithy/service-error-classification/dist-cjs/index.js", "../../node_modules/@smithy/util-retry/dist-cjs/index.js", "../../node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js", "../../node_modules/@smithy/middleware-retry/dist-cjs/index.js", "../../node_modules/@aws-sdk/client-bedrock/dist-cjs/auth/httpAuthSchemeProvider.js", "../../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js", "../../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js", "../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js", "../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js", "../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js", "../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js", "../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js", "../../node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/auth/httpAuthSchemeProvider.js", "../../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js", "../../node_modules/@smithy/hash-node/dist-cjs/index.js", "../../node_modules/@smithy/util-body-length-node/dist-cjs/index.js", "../../node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/ruleset.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/endpointResolver.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.shared.js", "../../node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.js", "../../node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js", "../../node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js", "../../node_modules/@aws-sdk/token-providers/dist-cjs/index.js", "../../node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js", "../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js", "../../node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js", "../../node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js", "../../node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js", "../../node_modules/@aws-sdk/client-sso/dist-cjs/index.js", "../../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js", "../../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/auth/httpAuthSchemeProvider.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/ruleset.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/endpointResolver.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.shared.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js", "../../node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthSchemeProvider.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/EndpointParameters.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/ruleset.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/endpointResolver.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.shared.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthExtensionConfiguration.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeExtensions.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/STSClient.js", "../../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js", "../../node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js", "../../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js", "../../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js", "../../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js", "../../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js", "../../node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js", "../../node_modules/@aws-sdk/client-bedrock/dist-cjs/endpoint/ruleset.js", "../../node_modules/@aws-sdk/client-bedrock/dist-cjs/endpoint/endpointResolver.js", "../../node_modules/@aws-sdk/client-bedrock/dist-cjs/runtimeConfig.shared.js", "../../node_modules/@aws-sdk/client-bedrock/dist-cjs/runtimeConfig.js", "../../node_modules/@aws-sdk/client-bedrock/dist-cjs/index.js", "../../node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js", "../../node_modules/@aws-sdk/util-utf8-browser/dist-cjs/pureJs.js", "../../node_modules/@aws-sdk/util-utf8-browser/dist-cjs/whatwgEncodingApi.js", "../../node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js", "../../node_modules/@aws-crypto/util/build/convertToBuffer.js", "../../node_modules/@aws-crypto/util/build/isEmptyData.js", "../../node_modules/@aws-crypto/util/build/numToUint8.js", "../../node_modules/@aws-crypto/util/build/uint32ArrayFrom.js", "../../node_modules/@aws-crypto/util/build/index.js", "../../node_modules/@aws-crypto/crc32/build/aws_crc32.js", "../../node_modules/@aws-crypto/crc32/build/index.js", "../../node_modules/@smithy/eventstream-codec/dist-cjs/index.js", "../../node_modules/@aws-sdk/util-format-url/dist-cjs/index.js", "../../node_modules/@smithy/eventstream-serde-universal/dist-cjs/index.js", "../../node_modules/@smithy/eventstream-serde-browser/dist-cjs/index.js", "../../node_modules/@smithy/fetch-http-handler/dist-cjs/index.js", "../../node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js", "../../node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/index.js", "../../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/auth/httpAuthSchemeProvider.js", "../../node_modules/@aws-sdk/eventstream-handler-node/dist-cjs/index.js", "../../node_modules/@smithy/eventstream-serde-node/dist-cjs/index.js", "../../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/ruleset.js", "../../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/endpointResolver.js", "../../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.shared.js", "../../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.js", "../../node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js", "../src/utils/model/bedrock.ts", "../src/utils/model/configs.ts", "../src/utils/model/providers.ts", "../src/utils/model/modelStrings.ts", "../src/utils/billing.ts", "../src/services/mockRateLimits.ts", "../src/services/oauth/getOauthProfile.ts", "../src/services/oauth/client.ts", "../src/utils/authFileDescriptor.ts", "../src/utils/secureStorage/macOsKeychainHelpers.ts", "../src/utils/authPortable.ts", "../../node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js", "../../node_modules/@aws-sdk/client-sts/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/createCredentialChain.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/models/CognitoIdentityServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js", "../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/loadCognitoIdentity-C-kPrLZ4.js", "../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromLoginCredentials.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/loadSts.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.base.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/index.js", "../src/utils/aws.ts", "../src/utils/awsAuthStatusManager.ts", "../src/constants/betas.ts", "../src/utils/fastMode.ts", "../src/utils/modelCost.ts", "../src/utils/model/aliases.ts", "../src/utils/model/modelAllowlist.ts", "../src/utils/model/model.ts", "../../node_modules/@anthropic-ai/sdk/internal/tslib.mjs", "../../node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs", "../../node_modules/@anthropic-ai/sdk/internal/errors.mjs", "../../node_modules/@anthropic-ai/sdk/core/error.mjs", "../../node_modules/@anthropic-ai/sdk/internal/utils/values.mjs", "../../node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs", "../../node_modules/@anthropic-ai/sdk/internal/utils/log.mjs", "../../node_modules/@anthropic-ai/sdk/version.mjs", "../../node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs", "../../node_modules/@anthropic-ai/sdk/internal/shims.mjs", "../../node_modules/@anthropic-ai/sdk/internal/request-options.mjs", "../../node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs", "../../node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs", "../../node_modules/@anthropic-ai/sdk/core/streaming.mjs", "../../node_modules/@anthropic-ai/sdk/internal/parse.mjs", "../../node_modules/@anthropic-ai/sdk/core/api-promise.mjs", "../../node_modules/@anthropic-ai/sdk/core/pagination.mjs", "../../node_modules/@anthropic-ai/sdk/internal/uploads.mjs", "../../node_modules/@anthropic-ai/sdk/internal/to-file.mjs", "../../node_modules/@anthropic-ai/sdk/core/uploads.mjs", "../../node_modules/@anthropic-ai/sdk/core/resource.mjs", "../../node_modules/@anthropic-ai/sdk/internal/headers.mjs", "../../node_modules/@anthropic-ai/sdk/internal/utils/path.mjs", "../../node_modules/@anthropic-ai/sdk/resources/beta/files.mjs", "../../node_modules/@anthropic-ai/sdk/resources/beta/models.mjs", "../../node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs", "../../node_modules/@anthropic-ai/sdk/error.mjs", "../../node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs", "../../node_modules/@anthropic-ai/sdk/streaming.mjs", "../../node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs", "../../node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs", "../../node_modules/@anthropic-ai/sdk/internal/constants.mjs", "../../node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs", "../../node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs", "../../node_modules/@anthropic-ai/sdk/resources/completions.mjs", "../../node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs", "../../node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs", "../../node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs", "../../node_modules/@anthropic-ai/sdk/resources/models.mjs", "../../node_modules/@anthropic-ai/sdk/resources/index.mjs", "../../node_modules/@anthropic-ai/sdk/internal/utils/env.mjs", "../../node_modules/@anthropic-ai/sdk/client.mjs", "../../node_modules/@aws-crypto/sha256-js/build/constants.js", "../../node_modules/@aws-crypto/sha256-js/build/RawSha256.js", "../../node_modules/@aws-crypto/sha256-js/build/jsSha256.js", "../../node_modules/@aws-crypto/sha256-js/build/index.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/createCredentialChain.js", "../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/auth/httpAuthSchemeProvider.js", "../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/ruleset.js", "../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/endpointResolver.js", "../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.shared.js", "../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.js", "../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js", "../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/loadCognitoIdentity-BPNvueUJ.js", "../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromLoginCredentials.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/loadSts.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.base.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js", "../../node_modules/@aws-sdk/credential-providers/dist-cjs/index.js", "../../node_modules/@anthropic-ai/bedrock-sdk/core/auth.mjs", "../../node_modules/@anthropic-ai/sdk/index.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/AWS_restJson1.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/internal/shims.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/core/error.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/internal/utils/values.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/internal/utils/log.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/core/streaming.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/internal/utils/env.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/internal/headers.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/internal/utils/path.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/client.mjs", "../../node_modules/@anthropic-ai/bedrock-sdk/index.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/core/error.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/internal/utils/values.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/internal/headers.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/internal/utils/base64.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/internal/utils/env.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/internal/utils/log.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/internal/utils.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/client.mjs", "../../node_modules/@anthropic-ai/foundry-sdk/index.mjs", "stub-npm:@azure/identity", "../../node_modules/extend/index.js", "../../node_modules/webidl-conversions/lib/index.js", "../../node_modules/whatwg-url/lib/utils.js", "../../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.js", "../../node_modules/gaxios/node_modules/is-stream/index.js", "../../node_modules/gaxios/build/src/util.js", "../../node_modules/gaxios/build/src/common.js", "../../node_modules/gaxios/build/src/retry.js", "../../node_modules/gaxios/node_modules/uuid/dist/rng.js", "../../node_modules/gaxios/node_modules/uuid/dist/regex.js", "../../node_modules/gaxios/node_modules/uuid/dist/validate.js", "../../node_modules/gaxios/node_modules/uuid/dist/stringify.js", "../../node_modules/gaxios/node_modules/uuid/dist/v1.js", "../../node_modules/gaxios/node_modules/uuid/dist/parse.js", "../../node_modules/gaxios/node_modules/uuid/dist/v35.js", "../../node_modules/gaxios/node_modules/uuid/dist/md5.js", "../../node_modules/gaxios/node_modules/uuid/dist/v3.js", "../../node_modules/gaxios/node_modules/uuid/dist/native.js", "../../node_modules/gaxios/node_modules/uuid/dist/v4.js", "../../node_modules/gaxios/node_modules/uuid/dist/sha1.js", "../../node_modules/gaxios/node_modules/uuid/dist/v5.js", "../../node_modules/gaxios/node_modules/uuid/dist/nil.js", "../../node_modules/gaxios/node_modules/uuid/dist/version.js", "../../node_modules/gaxios/node_modules/uuid/dist/index.js", "../../node_modules/gaxios/build/src/interceptor.js", "../../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/dist/helpers.js", "../../node_modules/agent-base/dist/index.js", "../../node_modules/https-proxy-agent/dist/parse-proxy-response.js", "../../node_modules/https-proxy-agent/dist/index.js", "../../node_modules/gaxios/build/src/gaxios.js", "../../node_modules/gaxios/build/src/index.js", "../../node_modules/bignumber.js/bignumber.js", "../../node_modules/json-bigint/lib/stringify.js", "../../node_modules/json-bigint/lib/parse.js", "../../node_modules/json-bigint/index.js", "../../node_modules/gcp-metadata/build/src/gcp-residency.js", "../../node_modules/google-logging-utils/build/src/colours.js", "../../node_modules/google-logging-utils/build/src/logging-utils.js", "../../node_modules/google-logging-utils/build/src/index.js", "../../node_modules/gcp-metadata/build/src/index.js", "../../node_modules/base64-js/index.js", "../../node_modules/google-auth-library/build/src/crypto/browser/crypto.js", "../../node_modules/google-auth-library/build/src/crypto/node/crypto.js", "../../node_modules/google-auth-library/build/src/crypto/crypto.js", "../../node_modules/google-auth-library/build/src/options.js", "../../node_modules/google-auth-library/build/src/transporters.js", "../../node_modules/safe-buffer/index.js", "../../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js", "../../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js", "../../node_modules/google-auth-library/build/src/util.js", "../../node_modules/google-auth-library/build/src/auth/authclient.js", "../../node_modules/google-auth-library/build/src/auth/loginticket.js", "../../node_modules/google-auth-library/build/src/auth/oauth2client.js", "../../node_modules/google-auth-library/build/src/auth/computeclient.js", "../../node_modules/google-auth-library/build/src/auth/idtokenclient.js", "../../node_modules/google-auth-library/build/src/auth/envDetect.js", "../../node_modules/jws/lib/data-stream.js", "../../node_modules/buffer-equal-constant-time/index.js", "../../node_modules/jwa/index.js", "../../node_modules/jws/lib/tostring.js", "../../node_modules/jws/lib/sign-stream.js", "../../node_modules/jws/lib/verify-stream.js", "../../node_modules/jws/index.js", "../../node_modules/gtoken/build/src/index.js", "../../node_modules/google-auth-library/build/src/auth/jwtaccess.js", "../../node_modules/google-auth-library/build/src/auth/jwtclient.js", "../../node_modules/google-auth-library/build/src/auth/refreshclient.js", "../../node_modules/google-auth-library/build/src/auth/impersonated.js", "../../node_modules/google-auth-library/build/src/auth/oauth2common.js", "../../node_modules/google-auth-library/build/src/auth/stscredentials.js", "../../node_modules/google-auth-library/build/src/auth/baseexternalclient.js", "../../node_modules/google-auth-library/build/src/auth/filesubjecttokensupplier.js", "../../node_modules/google-auth-library/build/src/auth/urlsubjecttokensupplier.js", "../../node_modules/google-auth-library/build/src/auth/identitypoolclient.js", "../../node_modules/google-auth-library/build/src/auth/awsrequestsigner.js", "../../node_modules/google-auth-library/build/src/auth/defaultawssecuritycredentialssupplier.js", "../../node_modules/google-auth-library/build/src/auth/awsclient.js", "../../node_modules/google-auth-library/build/src/auth/executable-response.js", "../../node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js", "../../node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js", "../../node_modules/google-auth-library/build/src/auth/externalclient.js", "../../node_modules/google-auth-library/build/src/auth/externalAccountAuthorizedUserClient.js", "../../node_modules/google-auth-library/build/src/auth/googleauth.js", "../../node_modules/google-auth-library/build/src/auth/iam.js", "../../node_modules/google-auth-library/build/src/auth/downscopedclient.js", "../../node_modules/google-auth-library/build/src/auth/passthrough.js", "../../node_modules/google-auth-library/build/src/index.js", "../../node_modules/@anthropic-ai/vertex-sdk/internal/utils/env.mjs", "../../node_modules/@anthropic-ai/vertex-sdk/core/error.mjs", "../../node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.mjs", "../../node_modules/@anthropic-ai/vertex-sdk/internal/headers.mjs", "../../node_modules/@anthropic-ai/vertex-sdk/client.mjs", "../../node_modules/@anthropic-ai/vertex-sdk/index.mjs", "../node_modules/extend/index.js", "../node_modules/webidl-conversions/lib/index.js", "../node_modules/whatwg-url/lib/utils.js", "../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.js", "../node_modules/gaxios/node_modules/is-stream/index.js", "../node_modules/gaxios/build/src/util.js", "../node_modules/gaxios/build/src/common.js", "../node_modules/gaxios/build/src/retry.js", "../node_modules/gaxios/node_modules/uuid/dist/rng.js", "../node_modules/gaxios/node_modules/uuid/dist/regex.js", "../node_modules/gaxios/node_modules/uuid/dist/validate.js", "../node_modules/gaxios/node_modules/uuid/dist/stringify.js", "../node_modules/gaxios/node_modules/uuid/dist/v1.js", "../node_modules/gaxios/node_modules/uuid/dist/parse.js", "../node_modules/gaxios/node_modules/uuid/dist/v35.js", "../node_modules/gaxios/node_modules/uuid/dist/md5.js", "../node_modules/gaxios/node_modules/uuid/dist/v3.js", "../node_modules/gaxios/node_modules/uuid/dist/native.js", "../node_modules/gaxios/node_modules/uuid/dist/v4.js", "../node_modules/gaxios/node_modules/uuid/dist/sha1.js", "../node_modules/gaxios/node_modules/uuid/dist/v5.js", "../node_modules/gaxios/node_modules/uuid/dist/nil.js", "../node_modules/gaxios/node_modules/uuid/dist/version.js", "../node_modules/gaxios/node_modules/uuid/dist/index.js", "../node_modules/gaxios/build/src/interceptor.js", "../node_modules/gaxios/build/src/gaxios.js", "../node_modules/gaxios/build/src/index.js", "../node_modules/bignumber.js/bignumber.js", "../node_modules/json-bigint/lib/stringify.js", "../node_modules/json-bigint/lib/parse.js", "../node_modules/json-bigint/index.js", "../node_modules/gcp-metadata/build/src/gcp-residency.js", "../node_modules/google-logging-utils/build/src/colours.js", "../node_modules/google-logging-utils/build/src/logging-utils.js", "../node_modules/google-logging-utils/build/src/index.js", "../node_modules/gcp-metadata/build/src/index.js", "../node_modules/base64-js/index.js", "../node_modules/google-auth-library/build/src/crypto/browser/crypto.js", "../node_modules/google-auth-library/build/src/crypto/node/crypto.js", "../node_modules/google-auth-library/build/src/crypto/crypto.js", "../node_modules/google-auth-library/build/src/options.js", "../node_modules/google-auth-library/build/src/transporters.js", "../node_modules/safe-buffer/index.js", "../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js", "../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js", "../node_modules/google-auth-library/build/src/util.js", "../node_modules/google-auth-library/build/src/auth/authclient.js", "../node_modules/google-auth-library/build/src/auth/loginticket.js", "../node_modules/google-auth-library/build/src/auth/oauth2client.js", "../node_modules/google-auth-library/build/src/auth/computeclient.js", "../node_modules/google-auth-library/build/src/auth/idtokenclient.js", "../node_modules/google-auth-library/build/src/auth/envDetect.js", "../node_modules/jws/lib/data-stream.js", "../node_modules/buffer-equal-constant-time/index.js", "../node_modules/jwa/index.js", "../node_modules/jws/lib/tostring.js", "../node_modules/jws/lib/sign-stream.js", "../node_modules/jws/lib/verify-stream.js", "../node_modules/jws/index.js", "../node_modules/gtoken/build/src/index.js", "../node_modules/google-auth-library/build/src/auth/jwtaccess.js", "../node_modules/google-auth-library/build/src/auth/jwtclient.js", "../node_modules/google-auth-library/build/src/auth/refreshclient.js", "../node_modules/google-auth-library/build/src/auth/impersonated.js", "../node_modules/google-auth-library/build/src/auth/oauth2common.js", "../node_modules/google-auth-library/build/src/auth/stscredentials.js", "../node_modules/google-auth-library/build/src/auth/baseexternalclient.js", "../node_modules/google-auth-library/build/src/auth/filesubjecttokensupplier.js", "../node_modules/google-auth-library/build/src/auth/urlsubjecttokensupplier.js", "../node_modules/google-auth-library/build/src/auth/identitypoolclient.js", "../node_modules/google-auth-library/build/src/auth/awsrequestsigner.js", "../node_modules/google-auth-library/build/src/auth/defaultawssecuritycredentialssupplier.js", "../node_modules/google-auth-library/build/src/auth/awsclient.js", "../node_modules/google-auth-library/build/src/auth/executable-response.js", "../node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js", "../node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js", "../node_modules/google-auth-library/build/src/auth/externalclient.js", "../node_modules/google-auth-library/build/src/auth/externalAccountAuthorizedUserClient.js", "../node_modules/google-auth-library/build/src/auth/googleauth.js", "../node_modules/google-auth-library/build/src/auth/iam.js", "../node_modules/google-auth-library/build/src/auth/downscopedclient.js", "../node_modules/google-auth-library/build/src/auth/passthrough.js", "../node_modules/google-auth-library/build/src/index.js", "../src/services/api/client.ts", "../src/utils/model/modelCapabilities.ts", "../src/utils/context.ts", "../src/utils/model/modelSupportOverrides.ts", "../src/utils/betas.ts", "../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/retry/lib/retry_operation.js", "../node_modules/retry/lib/retry.js", "../node_modules/proper-lockfile/node_modules/signal-exit/signals.js", "../node_modules/proper-lockfile/node_modules/signal-exit/index.js", "../node_modules/proper-lockfile/lib/mtime-precision.js", "../node_modules/proper-lockfile/lib/lockfile.js", "../node_modules/proper-lockfile/lib/adapter.js", "../node_modules/proper-lockfile/index.js", "../src/utils/lockfile.ts", "../src/utils/secureStorage/fallbackStorage.ts", "../src/utils/secureStorage/macOsKeychainStorage.ts", "../src/utils/secureStorage/plainTextStorage.ts", "../src/utils/secureStorage/index.ts", "../src/utils/secureStorage/keychainPrefetch.ts", "../src/utils/sleep.ts", "../src/utils/toolSchemaCache.ts", "../src/utils/auth.ts", "../src/utils/userAgent.ts", "../src/utils/workloadContext.ts", "../src/utils/http.ts", "../src/utils/user.ts", "../node_modules/@opentelemetry/api/build/src/version.js", "../node_modules/@opentelemetry/api/build/src/internal/semver.js", "../node_modules/@opentelemetry/api/build/src/internal/global-utils.js", "../node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js", "../node_modules/@opentelemetry/api/build/src/diag/types.js", "../node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js", "../node_modules/@opentelemetry/api/build/src/api/diag.js", "../node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js", "../node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js", "../node_modules/@opentelemetry/api/build/src/baggage/utils.js", "../node_modules/@opentelemetry/api/build/src/context/context.js", "../node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js", "../node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js", "../node_modules/@opentelemetry/api/build/src/metrics/Metric.js", "../node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js", "../node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js", "../node_modules/@opentelemetry/api/build/src/api/context.js", "../node_modules/@opentelemetry/api/build/src/trace/trace_flags.js", "../node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js", "../node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js", "../node_modules/@opentelemetry/api/build/src/trace/context-utils.js", "../node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js", "../node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js", "../node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js", "../node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js", "../node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js", "../node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js", "../node_modules/@opentelemetry/api/build/src/trace/span_kind.js", "../node_modules/@opentelemetry/api/build/src/trace/status.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/utils.js", "../node_modules/@opentelemetry/api/build/src/context-api.js", "../node_modules/@opentelemetry/api/build/src/diag-api.js", "../node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js", "../node_modules/@opentelemetry/api/build/src/api/metrics.js", "../node_modules/@opentelemetry/api/build/src/metrics-api.js", "../node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js", "../node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js", "../node_modules/@opentelemetry/api/build/src/api/propagation.js", "../node_modules/@opentelemetry/api/build/src/propagation-api.js", "../node_modules/@opentelemetry/api/build/src/api/trace.js", "../node_modules/@opentelemetry/api/build/src/trace-api.js", "../node_modules/@opentelemetry/api/build/src/index.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/index.js", "../node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js", "../node_modules/@opentelemetry/core/build/src/baggage/constants.js", "../node_modules/@opentelemetry/core/build/src/baggage/utils.js", "../node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js", "../node_modules/@opentelemetry/core/build/src/common/anchored-clock.js", "../node_modules/@opentelemetry/core/build/src/common/attributes.js", "../node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js", "../node_modules/@opentelemetry/core/build/src/common/global-error-handler.js", "../node_modules/@opentelemetry/core/build/src/utils/sampling.js", "../node_modules/@opentelemetry/core/build/src/utils/environment.js", "../node_modules/@opentelemetry/core/build/src/platform/node/environment.js", "../node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js", "../node_modules/@opentelemetry/core/build/src/common/hex-to-binary.js", "../node_modules/@opentelemetry/core/build/src/platform/node/hex-to-base64.js", "../node_modules/@opentelemetry/core/build/src/platform/node/RandomIdGenerator.js", "../node_modules/@opentelemetry/core/build/src/platform/node/performance.js", "../node_modules/@opentelemetry/core/build/src/version.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/index.js", "../node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js", "../node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js", "../node_modules/@opentelemetry/core/build/src/platform/node/index.js", "../node_modules/@opentelemetry/core/build/src/platform/index.js", "../node_modules/@opentelemetry/core/build/src/common/time.js", "../node_modules/@opentelemetry/core/build/src/ExportResult.js", "../node_modules/@opentelemetry/core/build/src/propagation/composite.js", "../node_modules/@opentelemetry/core/build/src/internal/validators.js", "../node_modules/@opentelemetry/core/build/src/trace/TraceState.js", "../node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js", "../node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js", "../node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOffSampler.js", "../node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOnSampler.js", "../node_modules/@opentelemetry/core/build/src/trace/sampler/ParentBasedSampler.js", "../node_modules/@opentelemetry/core/build/src/trace/sampler/TraceIdRatioBasedSampler.js", "../node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js", "../node_modules/@opentelemetry/core/build/src/utils/merge.js", "../node_modules/@opentelemetry/core/build/src/utils/timeout.js", "../node_modules/@opentelemetry/core/build/src/utils/url.js", "../node_modules/@opentelemetry/core/build/src/utils/wrap.js", "../node_modules/@opentelemetry/core/build/src/utils/promise.js", "../node_modules/@opentelemetry/core/build/src/utils/callback.js", "../node_modules/@opentelemetry/core/build/src/internal/exporter.js", "../node_modules/@opentelemetry/core/build/src/index.js", "../node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js", "../node_modules/@opentelemetry/resources/build/src/platform/node/index.js", "../node_modules/@opentelemetry/resources/build/src/platform/index.js", "../node_modules/@opentelemetry/resources/build/src/Resource.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js", "../node_modules/@opentelemetry/resources/build/src/detectors/BrowserDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/BrowserDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/EnvDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/index.js", "../node_modules/@opentelemetry/resources/build/src/utils.js", "../node_modules/@opentelemetry/resources/build/src/detect-resources.js", "../node_modules/@opentelemetry/resources/build/src/index.js", "../node_modules/@opentelemetry/api-logs/build/src/types/LogRecord.js", "../node_modules/@opentelemetry/api-logs/build/src/NoopLogger.js", "../node_modules/@opentelemetry/api-logs/build/src/NoopLoggerProvider.js", "../node_modules/@opentelemetry/api-logs/build/src/ProxyLogger.js", "../node_modules/@opentelemetry/api-logs/build/src/ProxyLoggerProvider.js", "../node_modules/@opentelemetry/api-logs/build/src/platform/node/globalThis.js", "../node_modules/@opentelemetry/api-logs/build/src/platform/node/index.js", "../node_modules/@opentelemetry/api-logs/build/src/platform/index.js", "../node_modules/@opentelemetry/api-logs/build/src/internal/global-utils.js", "../node_modules/@opentelemetry/api-logs/build/src/api/logs.js", "../node_modules/@opentelemetry/api-logs/build/src/index.js", "../node_modules/@opentelemetry/sdk-logs/build/src/LogRecord.js", "../node_modules/@opentelemetry/sdk-logs/build/src/Logger.js", "../node_modules/@opentelemetry/sdk-logs/build/src/config.js", "../node_modules/@opentelemetry/sdk-logs/build/src/MultiLogRecordProcessor.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/NoopLogRecordProcessor.js", "../node_modules/@opentelemetry/sdk-logs/build/src/internal/LoggerProviderSharedState.js", "../node_modules/@opentelemetry/sdk-logs/build/src/LoggerProvider.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/ConsoleLogRecordExporter.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/SimpleLogRecordProcessor.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/InMemoryLogRecordExporter.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/BatchLogRecordProcessorBase.js", "../node_modules/@opentelemetry/sdk-logs/build/src/platform/node/export/BatchLogRecordProcessor.js", "../node_modules/@opentelemetry/sdk-logs/build/src/platform/node/index.js", "../node_modules/@opentelemetry/sdk-logs/build/src/platform/index.js", "../node_modules/@opentelemetry/sdk-logs/build/src/index.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/index.js", "../src/services/analytics/config.ts", "../src/types/generated/google/protobuf/timestamp.ts", "../src/types/generated/events_mono/common/v1/auth.ts", "../src/types/generated/events_mono/claude_code/v1/claude_code_internal_event.ts", "../src/types/generated/events_mono/growthbook/v1/growthbook_experiment_event.ts", "../src/utils/genericProcessUtils.ts", "../src/utils/envDynamic.ts", "../src/services/mcp/officialRegistry.ts", "../src/utils/agentSwarmsEnabled.ts", "../src/utils/agentContext.ts", "../src/utils/teammateContext.ts", "../src/utils/teammate.ts", "../src/utils/computerUse/common.ts", "../src/services/analytics/metadata.ts", "../src/services/analytics/firstPartyEventLoggingExporter.ts", "../src/services/analytics/sinkKillswitch.ts", "../src/services/analytics/firstPartyEventLogger.ts", "../src/services/analytics/growthbook.ts", "../src/memdir/paths.ts", "../src/utils/configConstants.ts", "../src/memdir/teamMemPaths.ts", "../node_modules/semver/internal/constants.js", "../node_modules/semver/internal/debug.js", "../node_modules/semver/internal/re.js", "../node_modules/semver/internal/parse-options.js", "../node_modules/semver/internal/identifiers.js", "../node_modules/semver/classes/semver.js", "../node_modules/semver/functions/parse.js", "../node_modules/semver/functions/valid.js", "../node_modules/semver/functions/clean.js", "../node_modules/semver/functions/inc.js", "../node_modules/semver/functions/diff.js", "../node_modules/semver/functions/major.js", "../node_modules/semver/functions/minor.js", "../node_modules/semver/functions/patch.js", "../node_modules/semver/functions/prerelease.js", "../node_modules/semver/functions/compare.js", "../node_modules/semver/functions/rcompare.js", "../node_modules/semver/functions/compare-loose.js", "../node_modules/semver/functions/compare-build.js", "../node_modules/semver/functions/sort.js", "../node_modules/semver/functions/rsort.js", "../node_modules/semver/functions/gt.js", "../node_modules/semver/functions/lt.js", "../node_modules/semver/functions/eq.js", "../node_modules/semver/functions/neq.js", "../node_modules/semver/functions/gte.js", "../node_modules/semver/functions/lte.js", "../node_modules/semver/functions/cmp.js", "../node_modules/semver/functions/coerce.js", "../node_modules/semver/internal/lrucache.js", "../node_modules/semver/classes/range.js", "../node_modules/semver/classes/comparator.js", "../node_modules/semver/functions/satisfies.js", "../node_modules/semver/ranges/to-comparators.js", "../node_modules/semver/ranges/max-satisfying.js", "../node_modules/semver/ranges/min-satisfying.js", "../node_modules/semver/ranges/min-version.js", "../node_modules/semver/ranges/valid.js", "../node_modules/semver/ranges/outside.js", "../node_modules/semver/ranges/gtr.js", "../node_modules/semver/ranges/ltr.js", "../node_modules/semver/ranges/intersects.js", "../node_modules/semver/ranges/simplify.js", "../node_modules/semver/ranges/subset.js", "../node_modules/semver/index.js", "../src/utils/semver.ts", "../src/bridge/bridgeEnabled.ts", "../src/utils/config.ts", "../node_modules/ignore/index.js", "../node_modules/tree-kill/index.js", "../src/tools/BashTool/toolName.ts", "../src/tools/GrepTool/prompt.ts", "../src/tools/FileEditTool/constants.ts", "../src/utils/pdfUtils.ts", "../src/tools/FileReadTool/prompt.ts", "../src/tools/FileWriteTool/prompt.ts", "../src/tools/GlobTool/prompt.ts", "../src/tools/NotebookEditTool/constants.ts", "../src/tools/REPLTool/constants.ts", "../src/utils/embeddedTools.ts", "../node_modules/react/cjs/react.development.js", "../node_modules/react/index.js", "../node_modules/react/cjs/react-compiler-runtime.development.js", "../node_modules/react/compiler-runtime.js", "../src/ink/events/event.ts", "../src/ink/events/emitter.ts", "../src/ink/components/StdinContext.ts", "../src/ink/hooks/use-stdin.ts", "../src/utils/systemTheme.ts", "../node_modules/react/cjs/react-jsx-dev-runtime.development.js", "../node_modules/react/jsx-dev-runtime.js", "../src/utils/systemThemeWatcher.ts", "../src/components/design-system/ThemeProvider.tsx", "../node_modules/auto-bind/index.js", "../node_modules/react-reconciler/cjs/react-reconciler-constants.development.js", "../node_modules/react-reconciler/constants.js", "../src/native-ts/yoga-layout/enums.ts", "../src/native-ts/yoga-layout/index.ts", "../src/ink/colorize.ts", "../src/utils/earlyInput.ts", "../src/utils/fullscreen.ts", "../src/ink/termio/ansi.ts", "../src/ink/termio/csi.ts", "../src/ink/termio/tokenize.ts", "../src/ink/parse-keypress.ts", "../src/ink/events/input-event.ts", "../src/ink/events/terminal-focus-event.ts", "../node_modules/scheduler/cjs/scheduler.development.js", "../node_modules/scheduler/index.js", "../node_modules/react-reconciler/cjs/react-reconciler.development.js", "../node_modules/react-reconciler/index.js", "../src/ink/layout/node.ts", "../src/ink/layout/yoga.ts", "../src/ink/layout/engine.ts", "../src/ink/line-width-cache.ts", "../src/ink/measure-text.ts", "../src/ink/node-cache.ts", "../src/ink/squash-text-nodes.ts", "../src/ink/tabstops.ts", "../node_modules/ansi-styles/index.js", "../node_modules/@alcalzone/ansi-tokenize/build/consts.js", "../node_modules/@alcalzone/ansi-tokenize/build/ansiCodes.js", "../node_modules/@alcalzone/ansi-tokenize/build/reduce.js", "../node_modules/@alcalzone/ansi-tokenize/build/undo.js", "../node_modules/@alcalzone/ansi-tokenize/build/diff.js", "../node_modules/@alcalzone/ansi-tokenize/build/styledChars.js", "../node_modules/is-fullwidth-code-point/index.js", "../node_modules/@alcalzone/ansi-tokenize/build/tokenize.js", "../node_modules/@alcalzone/ansi-tokenize/build/index.js", "../src/utils/sliceAnsi.ts", "../node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js", "../node_modules/string-width/node_modules/strip-ansi/index.js", "../node_modules/string-width/node_modules/is-fullwidth-code-point/index.js", "../node_modules/string-width/node_modules/emoji-regex/index.js", "../node_modules/string-width/index.js", "../node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js", "../node_modules/wrap-ansi/node_modules/strip-ansi/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/wrap-ansi/node_modules/ansi-styles/index.js", "../node_modules/wrap-ansi/index.js", "../src/ink/wrapAnsi.ts", "../src/ink/wrap-text.ts", "../src/ink/dom.ts", "../src/ink/events/event-handlers.ts", "../src/ink/events/dispatcher.ts", "../src/ink/events/terminal-event.ts", "../src/ink/events/focus-event.ts", "../src/ink/focus.ts", "../src/ink/styles.ts", "../src/ink/devtools.ts", "../src/ink/reconciler.ts", "../src/ink/layout/geometry.ts", "../src/ink/warn.ts", "../src/ink/screen.ts", "../src/ink/selection.ts", "../src/ink/clearTerminal.ts", "../src/ink/termio/dec.ts", "../src/ink/termio/osc.ts", "../src/ink/terminal.ts", "../src/ink/terminal-focus-state.ts", "../src/ink/terminal-querier.ts", "../src/ink/components/AppContext.ts", "../src/ink/constants.ts", "../src/ink/components/TerminalFocusContext.tsx", "../src/ink/hooks/use-terminal-focus.ts", "../src/ink/components/ClockContext.tsx", "../src/ink/components/CursorDeclarationContext.ts", "../node_modules/convert-to-spaces/dist/index.js", "../node_modules/code-excerpt/dist/index.js", "../node_modules/escape-string-regexp/index.js", "../node_modules/stack-utils/index.js", "../src/ink/components/Box.tsx", "../src/ink/components/Text.tsx", "../src/ink/components/ErrorOverview.tsx", "../src/ink/components/TerminalSizeContext.tsx", "../src/ink/components/App.tsx", "../src/ink/events/keyboard-event.ts", "../src/ink/frame.ts", "../src/ink/events/click-event.ts", "../src/ink/hit-test.ts", "../src/ink/instances.ts", "../src/ink/log-update.ts", "../src/ink/optimizer.ts", "../node_modules/bidi-js/dist/bidi.js", "../src/ink/bidi.ts", "../src/ink/widest-line.ts", "../src/ink/output.ts", "../node_modules/indent-string/index.js", "../src/ink/get-max-width.ts", "../node_modules/cli-boxes/index.js", "../src/ink/render-border.ts", "../src/ink/render-node-to-output.ts", "../src/ink/render-to-screen.ts", "../src/ink/renderer.ts", "../src/ink/searchHighlight.ts", "../src/ink/useTerminalNotification.ts", "../src/ink/ink.tsx", "../src/ink/root.ts", "../src/utils/theme.ts", "../src/components/design-system/color.ts", "../src/components/design-system/ThemedBox.tsx", "../src/components/design-system/ThemedText.tsx", "../node_modules/supports-hyperlinks/index.js", "../src/ink/supports-hyperlinks.ts", "../src/ink/components/Link.tsx", "../src/ink/termio/esc.ts", "../src/ink/termio/types.ts", "../src/ink/termio/sgr.ts", "../src/ink/termio/parser.ts", "../src/ink/termio.ts", "../src/ink/Ansi.tsx", "../src/ink/components/Button.tsx", "../src/ink/components/Newline.tsx", "../src/ink/components/NoSelect.tsx", "../src/ink/components/RawAnsi.tsx", "../src/ink/components/Spacer.tsx", "../src/ink/hooks/use-terminal-viewport.ts", "../src/ink/hooks/use-animation-frame.ts", "../src/ink/hooks/use-app.ts", "../node_modules/lodash.debounce/index.js", "../node_modules/usehooks-ts/dist/index.js", "../src/ink/hooks/use-input.ts", "../src/ink/hooks/use-interval.ts", "../src/ink/hooks/use-selection.ts", "../src/ink/hooks/use-tab-status.ts", "../src/ink/hooks/use-terminal-title.ts", "../src/ink/measure-element.ts", "../src/ink.ts", "../src/hooks/useTerminalSize.ts", "../src/components/design-system/Ratchet.tsx", "../src/components/MessageResponse.tsx", "../src/commands/add-dir/validation.ts", "../src/state/store.ts", "../src/context/voice.tsx", "../src/utils/mailbox.ts", "../src/context/mailbox.tsx", "../node_modules/readdirp/esm/index.js", "../node_modules/chokidar/esm/handler.js", "../node_modules/chokidar/esm/index.js", "../src/utils/settings/changeDetector.ts", "../src/hooks/useSettingsChange.ts", "../src/constants/system.ts", "../src/Tool.ts", "../src/types/connectorText.ts", "../src/constants/common.ts", "../node_modules/marked/lib/marked.esm.js", "../node_modules/picomatch/lib/constants.js", "../node_modules/picomatch/lib/utils.js", "../node_modules/picomatch/lib/scan.js", "../node_modules/picomatch/lib/parse.js", "../node_modules/picomatch/lib/picomatch.js", "../node_modules/picomatch/index.js", "../src/utils/fileStateCache.ts", "../node_modules/yaml/dist/nodes/identity.js", "../node_modules/yaml/dist/visit.js", "../node_modules/yaml/dist/doc/directives.js", "../node_modules/yaml/dist/doc/anchors.js", "../node_modules/yaml/dist/doc/applyReviver.js", "../node_modules/yaml/dist/nodes/toJS.js", "../node_modules/yaml/dist/nodes/Node.js", "../node_modules/yaml/dist/nodes/Alias.js", "../node_modules/yaml/dist/nodes/Scalar.js", "../node_modules/yaml/dist/doc/createNode.js", "../node_modules/yaml/dist/nodes/Collection.js", "../node_modules/yaml/dist/stringify/stringifyComment.js", "../node_modules/yaml/dist/stringify/foldFlowLines.js", "../node_modules/yaml/dist/stringify/stringifyString.js", "../node_modules/yaml/dist/stringify/stringify.js", "../node_modules/yaml/dist/stringify/stringifyPair.js", "../node_modules/yaml/dist/log.js", "../node_modules/yaml/dist/schema/yaml-1.1/merge.js", "../node_modules/yaml/dist/nodes/addPairToJSMap.js", "../node_modules/yaml/dist/nodes/Pair.js", "../node_modules/yaml/dist/stringify/stringifyCollection.js", "../node_modules/yaml/dist/nodes/YAMLMap.js", "../node_modules/yaml/dist/schema/common/map.js", "../node_modules/yaml/dist/nodes/YAMLSeq.js", "../node_modules/yaml/dist/schema/common/seq.js", "../node_modules/yaml/dist/schema/common/string.js", "../node_modules/yaml/dist/schema/common/null.js", "../node_modules/yaml/dist/schema/core/bool.js", "../node_modules/yaml/dist/stringify/stringifyNumber.js", "../node_modules/yaml/dist/schema/core/float.js", "../node_modules/yaml/dist/schema/core/int.js", "../node_modules/yaml/dist/schema/core/schema.js", "../node_modules/yaml/dist/schema/json/schema.js", "../node_modules/yaml/dist/schema/yaml-1.1/binary.js", "../node_modules/yaml/dist/schema/yaml-1.1/pairs.js", "../node_modules/yaml/dist/schema/yaml-1.1/omap.js", "../node_modules/yaml/dist/schema/yaml-1.1/bool.js", "../node_modules/yaml/dist/schema/yaml-1.1/float.js", "../node_modules/yaml/dist/schema/yaml-1.1/int.js", "../node_modules/yaml/dist/schema/yaml-1.1/set.js", "../node_modules/yaml/dist/schema/yaml-1.1/timestamp.js", "../node_modules/yaml/dist/schema/yaml-1.1/schema.js", "../node_modules/yaml/dist/schema/tags.js", "../node_modules/yaml/dist/schema/Schema.js", "../node_modules/yaml/dist/stringify/stringifyDocument.js", "../node_modules/yaml/dist/doc/Document.js", "../node_modules/yaml/dist/errors.js", "../node_modules/yaml/dist/compose/resolve-props.js", "../node_modules/yaml/dist/compose/util-contains-newline.js", "../node_modules/yaml/dist/compose/util-flow-indent-check.js", "../node_modules/yaml/dist/compose/util-map-includes.js", "../node_modules/yaml/dist/compose/resolve-block-map.js", "../node_modules/yaml/dist/compose/resolve-block-seq.js", "../node_modules/yaml/dist/compose/resolve-end.js", "../node_modules/yaml/dist/compose/resolve-flow-collection.js", "../node_modules/yaml/dist/compose/compose-collection.js", "../node_modules/yaml/dist/compose/resolve-block-scalar.js", "../node_modules/yaml/dist/compose/resolve-flow-scalar.js", "../node_modules/yaml/dist/compose/compose-scalar.js", "../node_modules/yaml/dist/compose/util-empty-scalar-position.js", "../node_modules/yaml/dist/compose/compose-node.js", "../node_modules/yaml/dist/compose/compose-doc.js", "../node_modules/yaml/dist/compose/composer.js", "../node_modules/yaml/dist/parse/cst-scalar.js", "../node_modules/yaml/dist/parse/cst-stringify.js", "../node_modules/yaml/dist/parse/cst-visit.js", "../node_modules/yaml/dist/parse/cst.js", "../node_modules/yaml/dist/parse/lexer.js", "../node_modules/yaml/dist/parse/line-counter.js", "../node_modules/yaml/dist/parse/parser.js", "../node_modules/yaml/dist/public-api.js", "../node_modules/yaml/dist/index.js", "../src/utils/yaml.ts", "../src/utils/frontmatterParser.ts", "../src/utils/claudemd.ts", "../src/utils/gitSettings.ts", "../src/context.ts", "../node_modules/zod/v3/helpers/util.js", "../node_modules/zod/v3/ZodError.js", "../node_modules/zod/v3/locales/en.js", "../node_modules/zod/v3/errors.js", "../node_modules/zod/v3/helpers/parseUtil.js", "../node_modules/zod/v3/helpers/errorUtil.js", "../node_modules/zod/v3/types.js", "../node_modules/zod/v3/external.js", "../node_modules/zod/v3/index.js", "../node_modules/zod/v4/mini/parse.js", "../node_modules/zod/v4/mini/schemas.js", "../node_modules/zod/v4/mini/checks.js", "../node_modules/zod/v4/mini/iso.js", "../node_modules/zod/v4/mini/coerce.js", "../node_modules/zod/v4/mini/external.js", "../node_modules/zod/v4/mini/index.js", "../node_modules/zod/v4-mini/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js", "../node_modules/zod-to-json-schema/dist/esm/Options.js", "../node_modules/zod-to-json-schema/dist/esm/Refs.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/array.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/branded.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/catch.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/default.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/string.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/record.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/map.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/never.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/union.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/object.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/set.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js", "../node_modules/zod-to-json-schema/dist/esm/selectParser.js", "../node_modules/zod-to-json-schema/dist/esm/parseDef.js", "../node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js", "../node_modules/zod-to-json-schema/dist/esm/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js", "../node_modules/ajv/dist/compile/codegen/code.js", "../node_modules/ajv/dist/compile/codegen/scope.js", "../node_modules/ajv/dist/compile/codegen/index.js", "../node_modules/ajv/dist/compile/util.js", "../node_modules/ajv/dist/compile/names.js", "../node_modules/ajv/dist/compile/errors.js", "../node_modules/ajv/dist/compile/validate/boolSchema.js", "../node_modules/ajv/dist/compile/rules.js", "../node_modules/ajv/dist/compile/validate/applicability.js", "../node_modules/ajv/dist/compile/validate/dataType.js", "../node_modules/ajv/dist/compile/validate/defaults.js", "../node_modules/ajv/dist/vocabularies/code.js", "../node_modules/ajv/dist/compile/validate/keyword.js", "../node_modules/ajv/dist/compile/validate/subschema.js", "../node_modules/fast-deep-equal/index.js", "../node_modules/json-schema-traverse/index.js", "../node_modules/ajv/dist/compile/resolve.js", "../node_modules/ajv/dist/compile/validate/index.js", "../node_modules/ajv/dist/runtime/validation_error.js", "../node_modules/ajv/dist/compile/ref_error.js", "../node_modules/ajv/dist/compile/index.js", "../node_modules/fast-uri/lib/utils.js", "../node_modules/fast-uri/lib/schemes.js", "../node_modules/fast-uri/index.js", "../node_modules/ajv/dist/runtime/uri.js", "../node_modules/ajv/dist/core.js", "../node_modules/ajv/dist/vocabularies/core/id.js", "../node_modules/ajv/dist/vocabularies/core/ref.js", "../node_modules/ajv/dist/vocabularies/core/index.js", "../node_modules/ajv/dist/vocabularies/validation/limitNumber.js", "../node_modules/ajv/dist/vocabularies/validation/multipleOf.js", "../node_modules/ajv/dist/runtime/ucs2length.js", "../node_modules/ajv/dist/vocabularies/validation/limitLength.js", "../node_modules/ajv/dist/vocabularies/validation/pattern.js", "../node_modules/ajv/dist/vocabularies/validation/limitProperties.js", "../node_modules/ajv/dist/vocabularies/validation/required.js", "../node_modules/ajv/dist/vocabularies/validation/limitItems.js", "../node_modules/ajv/dist/runtime/equal.js", "../node_modules/ajv/dist/vocabularies/validation/uniqueItems.js", "../node_modules/ajv/dist/vocabularies/validation/const.js", "../node_modules/ajv/dist/vocabularies/validation/enum.js", "../node_modules/ajv/dist/vocabularies/validation/index.js", "../node_modules/ajv/dist/vocabularies/applicator/additionalItems.js", "../node_modules/ajv/dist/vocabularies/applicator/items.js", "../node_modules/ajv/dist/vocabularies/applicator/prefixItems.js", "../node_modules/ajv/dist/vocabularies/applicator/items2020.js", "../node_modules/ajv/dist/vocabularies/applicator/contains.js", "../node_modules/ajv/dist/vocabularies/applicator/dependencies.js", "../node_modules/ajv/dist/vocabularies/applicator/propertyNames.js", "../node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js", "../node_modules/ajv/dist/vocabularies/applicator/properties.js", "../node_modules/ajv/dist/vocabularies/applicator/patternProperties.js", "../node_modules/ajv/dist/vocabularies/applicator/not.js", "../node_modules/ajv/dist/vocabularies/applicator/anyOf.js", "../node_modules/ajv/dist/vocabularies/applicator/oneOf.js", "../node_modules/ajv/dist/vocabularies/applicator/allOf.js", "../node_modules/ajv/dist/vocabularies/applicator/if.js", "../node_modules/ajv/dist/vocabularies/applicator/thenElse.js", "../node_modules/ajv/dist/vocabularies/applicator/index.js", "../node_modules/ajv/dist/vocabularies/format/format.js", "../node_modules/ajv/dist/vocabularies/format/index.js", "../node_modules/ajv/dist/vocabularies/metadata.js", "../node_modules/ajv/dist/vocabularies/draft7.js", "../node_modules/ajv/dist/vocabularies/discriminator/types.js", "../node_modules/ajv/dist/vocabularies/discriminator/index.js", "../node_modules/ajv/dist/ajv.js", "../node_modules/ajv-formats/dist/formats.js", "../node_modules/ajv-formats/dist/limit.js", "../node_modules/ajv-formats/dist/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js", "../node_modules/eventsource-parser/dist/index.js", "../node_modules/eventsource/dist/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js", "../node_modules/pkce-challenge/dist/index.node.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js", "../node_modules/eventsource-parser/dist/stream.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js", "../node_modules/p-map/index.js", "../src/bridge/sessionIdCompat.ts", "../src/constants/product.ts", "../src/keybindings/defaultBindings.ts", "../src/keybindings/parser.ts", "../src/keybindings/reservedShortcuts.ts", "../src/keybindings/validate.ts", "../src/keybindings/loadUserBindings.ts", "../src/keybindings/match.ts", "../src/keybindings/resolver.ts", "../src/keybindings/shortcutFormat.ts", "../src/keybindings/KeybindingContext.tsx", "../src/keybindings/useShortcutDisplay.ts", "../src/components/design-system/KeyboardShortcutHint.tsx", "../src/keybindings/useKeybinding.ts", "../src/buddy/types.ts", "../src/buddy/companion.ts", "../src/buddy/prompt.ts", "../src/constants/messages.ts", "../src/utils/ripgrep.ts", "../src/utils/settings/pluginOnlyPolicy.ts", "../src/utils/markdownConfigLoader.ts", "../src/types/plugin.ts", "../src/plugins/builtinPlugins.ts", "../src/utils/plugins/addDirPluginSettings.ts", "../src/utils/plugins/pluginIdentifier.ts", "../src/utils/plugins/dependencyResolver.ts", "../src/utils/plugins/officialMarketplace.ts", "../src/utils/plugins/fetchTelemetry.ts", "../src/utils/plugins/gitAvailability.ts", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js", "../../node_modules/@pondwader/socks5-server/dist/index.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.js", "../../node_modules/lodash-es/_freeGlobal.js", "../../node_modules/lodash-es/_root.js", "../../node_modules/lodash-es/_Symbol.js", "../../node_modules/lodash-es/_getRawTag.js", "../../node_modules/lodash-es/_objectToString.js", "../../node_modules/lodash-es/_baseGetTag.js", "../../node_modules/lodash-es/isObjectLike.js", "../../node_modules/lodash-es/isSymbol.js", "../../node_modules/lodash-es/_baseToNumber.js", "../../node_modules/lodash-es/_arrayMap.js", "../../node_modules/lodash-es/isArray.js", "../../node_modules/lodash-es/_baseToString.js", "../../node_modules/lodash-es/_createMathOperation.js", "../../node_modules/lodash-es/add.js", "../../node_modules/lodash-es/_trimmedEndIndex.js", "../../node_modules/lodash-es/_baseTrim.js", "../../node_modules/lodash-es/isObject.js", "../../node_modules/lodash-es/toNumber.js", "../../node_modules/lodash-es/toFinite.js", "../../node_modules/lodash-es/toInteger.js", "../../node_modules/lodash-es/after.js", "../../node_modules/lodash-es/identity.js", "../../node_modules/lodash-es/isFunction.js", "../../node_modules/lodash-es/_coreJsData.js", "../../node_modules/lodash-es/_isMasked.js", "../../node_modules/lodash-es/_toSource.js", "../../node_modules/lodash-es/_baseIsNative.js", "../../node_modules/lodash-es/_getValue.js", "../../node_modules/lodash-es/_getNative.js", "../../node_modules/lodash-es/_WeakMap.js", "../../node_modules/lodash-es/_metaMap.js", "../../node_modules/lodash-es/_baseSetData.js", "../../node_modules/lodash-es/_baseCreate.js", "../../node_modules/lodash-es/_createCtor.js", "../../node_modules/lodash-es/_createBind.js", "../../node_modules/lodash-es/_apply.js", "../../node_modules/lodash-es/_composeArgs.js", "../../node_modules/lodash-es/_composeArgsRight.js", "../../node_modules/lodash-es/_countHolders.js", "../../node_modules/lodash-es/_baseLodash.js", "../../node_modules/lodash-es/_LazyWrapper.js", "../../node_modules/lodash-es/noop.js", "../../node_modules/lodash-es/_getData.js", "../../node_modules/lodash-es/_realNames.js", "../../node_modules/lodash-es/_getFuncName.js", "../../node_modules/lodash-es/_LodashWrapper.js", "../../node_modules/lodash-es/_copyArray.js", "../../node_modules/lodash-es/_wrapperClone.js", "../../node_modules/lodash-es/wrapperLodash.js", "../../node_modules/lodash-es/_isLaziable.js", "../../node_modules/lodash-es/_shortOut.js", "../../node_modules/lodash-es/_setData.js", "../../node_modules/lodash-es/_getWrapDetails.js", "../../node_modules/lodash-es/_insertWrapDetails.js", "../../node_modules/lodash-es/constant.js", "../../node_modules/lodash-es/_defineProperty.js", "../../node_modules/lodash-es/_baseSetToString.js", "../../node_modules/lodash-es/_setToString.js", "../../node_modules/lodash-es/_arrayEach.js", "../../node_modules/lodash-es/_baseFindIndex.js", "../../node_modules/lodash-es/_baseIsNaN.js", "../../node_modules/lodash-es/_strictIndexOf.js", "../../node_modules/lodash-es/_baseIndexOf.js", "../../node_modules/lodash-es/_arrayIncludes.js", "../../node_modules/lodash-es/_updateWrapDetails.js", "../../node_modules/lodash-es/_setWrapToString.js", "../../node_modules/lodash-es/_createRecurry.js", "../../node_modules/lodash-es/_getHolder.js", "../../node_modules/lodash-es/_isIndex.js", "../../node_modules/lodash-es/_reorder.js", "../../node_modules/lodash-es/_replaceHolders.js", "../../node_modules/lodash-es/_createHybrid.js", "../../node_modules/lodash-es/_createCurry.js", "../../node_modules/lodash-es/_createPartial.js", "../../node_modules/lodash-es/_mergeData.js", "../../node_modules/lodash-es/_createWrap.js", "../../node_modules/lodash-es/ary.js", "../../node_modules/lodash-es/_baseAssignValue.js", "../../node_modules/lodash-es/eq.js", "../../node_modules/lodash-es/_assignValue.js", "../../node_modules/lodash-es/_copyObject.js", "../../node_modules/lodash-es/_overRest.js", "../../node_modules/lodash-es/_baseRest.js", "../../node_modules/lodash-es/isLength.js", "../../node_modules/lodash-es/isArrayLike.js", "../../node_modules/lodash-es/_isIterateeCall.js", "../../node_modules/lodash-es/_createAssigner.js", "../../node_modules/lodash-es/_isPrototype.js", "../../node_modules/lodash-es/_baseTimes.js", "../../node_modules/lodash-es/_baseIsArguments.js", "../../node_modules/lodash-es/isArguments.js", "../../node_modules/lodash-es/stubFalse.js", "../../node_modules/lodash-es/isBuffer.js", "../../node_modules/lodash-es/_baseIsTypedArray.js", "../../node_modules/lodash-es/_baseUnary.js", "../../node_modules/lodash-es/_nodeUtil.js", "../../node_modules/lodash-es/isTypedArray.js", "../../node_modules/lodash-es/_arrayLikeKeys.js", "../../node_modules/lodash-es/_overArg.js", "../../node_modules/lodash-es/_nativeKeys.js", "../../node_modules/lodash-es/_baseKeys.js", "../../node_modules/lodash-es/keys.js", "../../node_modules/lodash-es/assign.js", "../../node_modules/lodash-es/_nativeKeysIn.js", "../../node_modules/lodash-es/_baseKeysIn.js", "../../node_modules/lodash-es/keysIn.js", "../../node_modules/lodash-es/assignIn.js", "../../node_modules/lodash-es/assignInWith.js", "../../node_modules/lodash-es/assignWith.js", "../../node_modules/lodash-es/_isKey.js", "../../node_modules/lodash-es/_nativeCreate.js", "../../node_modules/lodash-es/_hashClear.js", "../../node_modules/lodash-es/_hashDelete.js", "../../node_modules/lodash-es/_hashGet.js", "../../node_modules/lodash-es/_hashHas.js", "../../node_modules/lodash-es/_hashSet.js", "../../node_modules/lodash-es/_Hash.js", "../../node_modules/lodash-es/_listCacheClear.js", "../../node_modules/lodash-es/_assocIndexOf.js", "../../node_modules/lodash-es/_listCacheDelete.js", "../../node_modules/lodash-es/_listCacheGet.js", "../../node_modules/lodash-es/_listCacheHas.js", "../../node_modules/lodash-es/_listCacheSet.js", "../../node_modules/lodash-es/_ListCache.js", "../../node_modules/lodash-es/_Map.js", "../../node_modules/lodash-es/_mapCacheClear.js", "../../node_modules/lodash-es/_isKeyable.js", "../../node_modules/lodash-es/_getMapData.js", "../../node_modules/lodash-es/_mapCacheDelete.js", "../../node_modules/lodash-es/_mapCacheGet.js", "../../node_modules/lodash-es/_mapCacheHas.js", "../../node_modules/lodash-es/_mapCacheSet.js", "../../node_modules/lodash-es/_MapCache.js", "../../node_modules/lodash-es/memoize.js", "../../node_modules/lodash-es/_memoizeCapped.js", "../../node_modules/lodash-es/_stringToPath.js", "../../node_modules/lodash-es/toString.js", "../../node_modules/lodash-es/_castPath.js", "../../node_modules/lodash-es/_toKey.js", "../../node_modules/lodash-es/_baseGet.js", "../../node_modules/lodash-es/get.js", "../../node_modules/lodash-es/_baseAt.js", "../../node_modules/lodash-es/_arrayPush.js", "../../node_modules/lodash-es/_isFlattenable.js", "../../node_modules/lodash-es/_baseFlatten.js", "../../node_modules/lodash-es/flatten.js", "../../node_modules/lodash-es/_flatRest.js", "../../node_modules/lodash-es/at.js", "../../node_modules/lodash-es/_getPrototype.js", "../../node_modules/lodash-es/isPlainObject.js", "../../node_modules/lodash-es/isError.js", "../../node_modules/lodash-es/attempt.js", "../../node_modules/lodash-es/before.js", "../../node_modules/lodash-es/bind.js", "../../node_modules/lodash-es/bindAll.js", "../../node_modules/lodash-es/bindKey.js", "../../node_modules/lodash-es/_baseSlice.js", "../../node_modules/lodash-es/_castSlice.js", "../../node_modules/lodash-es/_hasUnicode.js", "../../node_modules/lodash-es/_asciiToArray.js", "../../node_modules/lodash-es/_unicodeToArray.js", "../../node_modules/lodash-es/_stringToArray.js", "../../node_modules/lodash-es/_createCaseFirst.js", "../../node_modules/lodash-es/upperFirst.js", "../../node_modules/lodash-es/capitalize.js", "../../node_modules/lodash-es/_arrayReduce.js", "../../node_modules/lodash-es/_basePropertyOf.js", "../../node_modules/lodash-es/_deburrLetter.js", "../../node_modules/lodash-es/deburr.js", "../../node_modules/lodash-es/_asciiWords.js", "../../node_modules/lodash-es/_hasUnicodeWord.js", "../../node_modules/lodash-es/_unicodeWords.js", "../../node_modules/lodash-es/words.js", "../../node_modules/lodash-es/_createCompounder.js", "../../node_modules/lodash-es/camelCase.js", "../../node_modules/lodash-es/castArray.js", "../../node_modules/lodash-es/_createRound.js", "../../node_modules/lodash-es/ceil.js", "../../node_modules/lodash-es/chain.js", "../../node_modules/lodash-es/chunk.js", "../../node_modules/lodash-es/_baseClamp.js", "../../node_modules/lodash-es/clamp.js", "../../node_modules/lodash-es/_stackClear.js", "../../node_modules/lodash-es/_stackDelete.js", "../../node_modules/lodash-es/_stackGet.js", "../../node_modules/lodash-es/_stackHas.js", "../../node_modules/lodash-es/_stackSet.js", "../../node_modules/lodash-es/_Stack.js", "../../node_modules/lodash-es/_baseAssign.js", "../../node_modules/lodash-es/_baseAssignIn.js", "../../node_modules/lodash-es/_cloneBuffer.js", "../../node_modules/lodash-es/_arrayFilter.js", "../../node_modules/lodash-es/stubArray.js", "../../node_modules/lodash-es/_getSymbols.js", "../../node_modules/lodash-es/_copySymbols.js", "../../node_modules/lodash-es/_getSymbolsIn.js", "../../node_modules/lodash-es/_copySymbolsIn.js", "../../node_modules/lodash-es/_baseGetAllKeys.js", "../../node_modules/lodash-es/_getAllKeys.js", "../../node_modules/lodash-es/_getAllKeysIn.js", "../../node_modules/lodash-es/_DataView.js", "../../node_modules/lodash-es/_Promise.js", "../../node_modules/lodash-es/_Set.js", "../../node_modules/lodash-es/_getTag.js", "../../node_modules/lodash-es/_initCloneArray.js", "../../node_modules/lodash-es/_Uint8Array.js", "../../node_modules/lodash-es/_cloneArrayBuffer.js", "../../node_modules/lodash-es/_cloneDataView.js", "../../node_modules/lodash-es/_cloneRegExp.js", "../../node_modules/lodash-es/_cloneSymbol.js", "../../node_modules/lodash-es/_cloneTypedArray.js", "../../node_modules/lodash-es/_initCloneByTag.js", "../../node_modules/lodash-es/_initCloneObject.js", "../../node_modules/lodash-es/_baseIsMap.js", "../../node_modules/lodash-es/isMap.js", "../../node_modules/lodash-es/_baseIsSet.js", "../../node_modules/lodash-es/isSet.js", "../../node_modules/lodash-es/_baseClone.js", "../../node_modules/lodash-es/clone.js", "../../node_modules/lodash-es/cloneDeep.js", "../../node_modules/lodash-es/cloneDeepWith.js", "../../node_modules/lodash-es/cloneWith.js", "../../node_modules/lodash-es/commit.js", "../../node_modules/lodash-es/compact.js", "../../node_modules/lodash-es/concat.js", "../../node_modules/lodash-es/_setCacheAdd.js", "../../node_modules/lodash-es/_setCacheHas.js", "../../node_modules/lodash-es/_SetCache.js", "../../node_modules/lodash-es/_arraySome.js", "../../node_modules/lodash-es/_cacheHas.js", "../../node_modules/lodash-es/_equalArrays.js", "../../node_modules/lodash-es/_mapToArray.js", "../../node_modules/lodash-es/_setToArray.js", "../../node_modules/lodash-es/_equalByTag.js", "../../node_modules/lodash-es/_equalObjects.js", "../../node_modules/lodash-es/_baseIsEqualDeep.js", "../../node_modules/lodash-es/_baseIsEqual.js", "../../node_modules/lodash-es/_baseIsMatch.js", "../../node_modules/lodash-es/_isStrictComparable.js", "../../node_modules/lodash-es/_getMatchData.js", "../../node_modules/lodash-es/_matchesStrictComparable.js", "../../node_modules/lodash-es/_baseMatches.js", "../../node_modules/lodash-es/_baseHasIn.js", "../../node_modules/lodash-es/_hasPath.js", "../../node_modules/lodash-es/hasIn.js", "../../node_modules/lodash-es/_baseMatchesProperty.js", "../../node_modules/lodash-es/_baseProperty.js", "../../node_modules/lodash-es/_basePropertyDeep.js", "../../node_modules/lodash-es/property.js", "../../node_modules/lodash-es/_baseIteratee.js", "../../node_modules/lodash-es/cond.js", "../../node_modules/lodash-es/_baseConformsTo.js", "../../node_modules/lodash-es/_baseConforms.js", "../../node_modules/lodash-es/conforms.js", "../../node_modules/lodash-es/conformsTo.js", "../../node_modules/lodash-es/_arrayAggregator.js", "../../node_modules/lodash-es/_createBaseFor.js", "../../node_modules/lodash-es/_baseFor.js", "../../node_modules/lodash-es/_baseForOwn.js", "../../node_modules/lodash-es/_createBaseEach.js", "../../node_modules/lodash-es/_baseEach.js", "../../node_modules/lodash-es/_baseAggregator.js", "../../node_modules/lodash-es/_createAggregator.js", "../../node_modules/lodash-es/countBy.js", "../../node_modules/lodash-es/create.js", "../../node_modules/lodash-es/curry.js", "../../node_modules/lodash-es/curryRight.js", "../../node_modules/lodash-es/now.js", "../../node_modules/lodash-es/debounce.js", "../../node_modules/lodash-es/defaultTo.js", "../../node_modules/lodash-es/defaults.js", "../../node_modules/lodash-es/_assignMergeValue.js", "../../node_modules/lodash-es/isArrayLikeObject.js", "../../node_modules/lodash-es/_safeGet.js", "../../node_modules/lodash-es/toPlainObject.js", "../../node_modules/lodash-es/_baseMergeDeep.js", "../../node_modules/lodash-es/_baseMerge.js", "../../node_modules/lodash-es/_customDefaultsMerge.js", "../../node_modules/lodash-es/mergeWith.js", "../../node_modules/lodash-es/defaultsDeep.js", "../../node_modules/lodash-es/_baseDelay.js", "../../node_modules/lodash-es/defer.js", "../../node_modules/lodash-es/delay.js", "../../node_modules/lodash-es/_arrayIncludesWith.js", "../../node_modules/lodash-es/_baseDifference.js", "../../node_modules/lodash-es/difference.js", "../../node_modules/lodash-es/last.js", "../../node_modules/lodash-es/differenceBy.js", "../../node_modules/lodash-es/differenceWith.js", "../../node_modules/lodash-es/divide.js", "../../node_modules/lodash-es/drop.js", "../../node_modules/lodash-es/dropRight.js", "../../node_modules/lodash-es/_baseWhile.js", "../../node_modules/lodash-es/dropRightWhile.js", "../../node_modules/lodash-es/dropWhile.js", "../../node_modules/lodash-es/_castFunction.js", "../../node_modules/lodash-es/forEach.js", "../../node_modules/lodash-es/each.js", "../../node_modules/lodash-es/_arrayEachRight.js", "../../node_modules/lodash-es/_baseForRight.js", "../../node_modules/lodash-es/_baseForOwnRight.js", "../../node_modules/lodash-es/_baseEachRight.js", "../../node_modules/lodash-es/forEachRight.js", "../../node_modules/lodash-es/eachRight.js", "../../node_modules/lodash-es/endsWith.js", "../../node_modules/lodash-es/_baseToPairs.js", "../../node_modules/lodash-es/_setToPairs.js", "../../node_modules/lodash-es/_createToPairs.js", "../../node_modules/lodash-es/toPairs.js", "../../node_modules/lodash-es/entries.js", "../../node_modules/lodash-es/toPairsIn.js", "../../node_modules/lodash-es/entriesIn.js", "../../node_modules/lodash-es/_escapeHtmlChar.js", "../../node_modules/lodash-es/escape.js", "../../node_modules/lodash-es/escapeRegExp.js", "../../node_modules/lodash-es/_arrayEvery.js", "../../node_modules/lodash-es/_baseEvery.js", "../../node_modules/lodash-es/every.js", "../../node_modules/lodash-es/extend.js", "../../node_modules/lodash-es/extendWith.js", "../../node_modules/lodash-es/toLength.js", "../../node_modules/lodash-es/_baseFill.js", "../../node_modules/lodash-es/fill.js", "../../node_modules/lodash-es/_baseFilter.js", "../../node_modules/lodash-es/filter.js", "../../node_modules/lodash-es/_createFind.js", "../../node_modules/lodash-es/findIndex.js", "../../node_modules/lodash-es/find.js", "../../node_modules/lodash-es/_baseFindKey.js", "../../node_modules/lodash-es/findKey.js", "../../node_modules/lodash-es/findLastIndex.js", "../../node_modules/lodash-es/findLast.js", "../../node_modules/lodash-es/findLastKey.js", "../../node_modules/lodash-es/head.js", "../../node_modules/lodash-es/first.js", "../../node_modules/lodash-es/_baseMap.js", "../../node_modules/lodash-es/map.js", "../../node_modules/lodash-es/flatMap.js", "../../node_modules/lodash-es/flatMapDeep.js", "../../node_modules/lodash-es/flatMapDepth.js", "../../node_modules/lodash-es/flattenDeep.js", "../../node_modules/lodash-es/flattenDepth.js", "../../node_modules/lodash-es/flip.js", "../../node_modules/lodash-es/floor.js", "../../node_modules/lodash-es/_createFlow.js", "../../node_modules/lodash-es/flow.js", "../../node_modules/lodash-es/flowRight.js", "../../node_modules/lodash-es/forIn.js", "../../node_modules/lodash-es/forInRight.js", "../../node_modules/lodash-es/forOwn.js", "../../node_modules/lodash-es/forOwnRight.js", "../../node_modules/lodash-es/fromPairs.js", "../../node_modules/lodash-es/_baseFunctions.js", "../../node_modules/lodash-es/functions.js", "../../node_modules/lodash-es/functionsIn.js", "../../node_modules/lodash-es/groupBy.js", "../../node_modules/lodash-es/_baseGt.js", "../../node_modules/lodash-es/_createRelationalOperation.js", "../../node_modules/lodash-es/gt.js", "../../node_modules/lodash-es/gte.js", "../../node_modules/lodash-es/_baseHas.js", "../../node_modules/lodash-es/has.js", "../../node_modules/lodash-es/_baseInRange.js", "../../node_modules/lodash-es/inRange.js", "../../node_modules/lodash-es/isString.js", "../../node_modules/lodash-es/_baseValues.js", "../../node_modules/lodash-es/values.js", "../../node_modules/lodash-es/includes.js", "../../node_modules/lodash-es/indexOf.js", "../../node_modules/lodash-es/initial.js", "../../node_modules/lodash-es/_baseIntersection.js", "../../node_modules/lodash-es/_castArrayLikeObject.js", "../../node_modules/lodash-es/intersection.js", "../../node_modules/lodash-es/intersectionBy.js", "../../node_modules/lodash-es/intersectionWith.js", "../../node_modules/lodash-es/_baseInverter.js", "../../node_modules/lodash-es/_createInverter.js", "../../node_modules/lodash-es/invert.js", "../../node_modules/lodash-es/invertBy.js", "../../node_modules/lodash-es/_parent.js", "../../node_modules/lodash-es/_baseInvoke.js", "../../node_modules/lodash-es/invoke.js", "../../node_modules/lodash-es/invokeMap.js", "../../node_modules/lodash-es/_baseIsArrayBuffer.js", "../../node_modules/lodash-es/isArrayBuffer.js", "../../node_modules/lodash-es/isBoolean.js", "../../node_modules/lodash-es/_baseIsDate.js", "../../node_modules/lodash-es/isDate.js", "../../node_modules/lodash-es/isElement.js", "../../node_modules/lodash-es/isEmpty.js", "../../node_modules/lodash-es/isEqual.js", "../../node_modules/lodash-es/isEqualWith.js", "../../node_modules/lodash-es/isFinite.js", "../../node_modules/lodash-es/isInteger.js", "../../node_modules/lodash-es/isMatch.js", "../../node_modules/lodash-es/isMatchWith.js", "../../node_modules/lodash-es/isNumber.js", "../../node_modules/lodash-es/isNaN.js", "../../node_modules/lodash-es/_isMaskable.js", "../../node_modules/lodash-es/isNative.js", "../../node_modules/lodash-es/isNil.js", "../../node_modules/lodash-es/isNull.js", "../../node_modules/lodash-es/_baseIsRegExp.js", "../../node_modules/lodash-es/isRegExp.js", "../../node_modules/lodash-es/isSafeInteger.js", "../../node_modules/lodash-es/isUndefined.js", "../../node_modules/lodash-es/isWeakMap.js", "../../node_modules/lodash-es/isWeakSet.js", "../../node_modules/lodash-es/iteratee.js", "../../node_modules/lodash-es/join.js", "../../node_modules/lodash-es/kebabCase.js", "../../node_modules/lodash-es/keyBy.js", "../../node_modules/lodash-es/_strictLastIndexOf.js", "../../node_modules/lodash-es/lastIndexOf.js", "../../node_modules/lodash-es/lowerCase.js", "../../node_modules/lodash-es/lowerFirst.js", "../../node_modules/lodash-es/_baseLt.js", "../../node_modules/lodash-es/lt.js", "../../node_modules/lodash-es/lte.js", "../../node_modules/lodash-es/mapKeys.js", "../../node_modules/lodash-es/mapValues.js", "../../node_modules/lodash-es/matches.js", "../../node_modules/lodash-es/matchesProperty.js", "../../node_modules/lodash-es/_baseExtremum.js", "../../node_modules/lodash-es/max.js", "../../node_modules/lodash-es/maxBy.js", "../../node_modules/lodash-es/_baseSum.js", "../../node_modules/lodash-es/_baseMean.js", "../../node_modules/lodash-es/mean.js", "../../node_modules/lodash-es/meanBy.js", "../../node_modules/lodash-es/merge.js", "../../node_modules/lodash-es/method.js", "../../node_modules/lodash-es/methodOf.js", "../../node_modules/lodash-es/min.js", "../../node_modules/lodash-es/minBy.js", "../../node_modules/lodash-es/mixin.js", "../../node_modules/lodash-es/multiply.js", "../../node_modules/lodash-es/negate.js", "../../node_modules/lodash-es/_iteratorToArray.js", "../../node_modules/lodash-es/toArray.js", "../../node_modules/lodash-es/next.js", "../../node_modules/lodash-es/_baseNth.js", "../../node_modules/lodash-es/nth.js", "../../node_modules/lodash-es/nthArg.js", "../../node_modules/lodash-es/_baseUnset.js", "../../node_modules/lodash-es/_customOmitClone.js", "../../node_modules/lodash-es/omit.js", "../../node_modules/lodash-es/_baseSet.js", "../../node_modules/lodash-es/_basePickBy.js", "../../node_modules/lodash-es/pickBy.js", "../../node_modules/lodash-es/omitBy.js", "../../node_modules/lodash-es/once.js", "../../node_modules/lodash-es/_baseSortBy.js", "../../node_modules/lodash-es/_compareAscending.js", "../../node_modules/lodash-es/_compareMultiple.js", "../../node_modules/lodash-es/_baseOrderBy.js", "../../node_modules/lodash-es/orderBy.js", "../../node_modules/lodash-es/_createOver.js", "../../node_modules/lodash-es/over.js", "../../node_modules/lodash-es/_castRest.js", "../../node_modules/lodash-es/overArgs.js", "../../node_modules/lodash-es/overEvery.js", "../../node_modules/lodash-es/overSome.js", "../../node_modules/lodash-es/_baseRepeat.js", "../../node_modules/lodash-es/_asciiSize.js", "../../node_modules/lodash-es/_unicodeSize.js", "../../node_modules/lodash-es/_stringSize.js", "../../node_modules/lodash-es/_createPadding.js", "../../node_modules/lodash-es/pad.js", "../../node_modules/lodash-es/padEnd.js", "../../node_modules/lodash-es/padStart.js", "../../node_modules/lodash-es/parseInt.js", "../../node_modules/lodash-es/partial.js", "../../node_modules/lodash-es/partialRight.js", "../../node_modules/lodash-es/partition.js", "../../node_modules/lodash-es/_basePick.js", "../../node_modules/lodash-es/pick.js", "../../node_modules/lodash-es/plant.js", "../../node_modules/lodash-es/propertyOf.js", "../../node_modules/lodash-es/_baseIndexOfWith.js", "../../node_modules/lodash-es/_basePullAll.js", "../../node_modules/lodash-es/pullAll.js", "../../node_modules/lodash-es/pull.js", "../../node_modules/lodash-es/pullAllBy.js", "../../node_modules/lodash-es/pullAllWith.js", "../../node_modules/lodash-es/_basePullAt.js", "../../node_modules/lodash-es/pullAt.js", "../../node_modules/lodash-es/_baseRandom.js", "../../node_modules/lodash-es/random.js", "../../node_modules/lodash-es/_baseRange.js", "../../node_modules/lodash-es/_createRange.js", "../../node_modules/lodash-es/range.js", "../../node_modules/lodash-es/rangeRight.js", "../../node_modules/lodash-es/rearg.js", "../../node_modules/lodash-es/_baseReduce.js", "../../node_modules/lodash-es/reduce.js", "../../node_modules/lodash-es/_arrayReduceRight.js", "../../node_modules/lodash-es/reduceRight.js", "../../node_modules/lodash-es/reject.js", "../../node_modules/lodash-es/remove.js", "../../node_modules/lodash-es/repeat.js", "../../node_modules/lodash-es/replace.js", "../../node_modules/lodash-es/rest.js", "../../node_modules/lodash-es/result.js", "../../node_modules/lodash-es/reverse.js", "../../node_modules/lodash-es/round.js", "../../node_modules/lodash-es/_arraySample.js", "../../node_modules/lodash-es/_baseSample.js", "../../node_modules/lodash-es/sample.js", "../../node_modules/lodash-es/_shuffleSelf.js", "../../node_modules/lodash-es/_arraySampleSize.js", "../../node_modules/lodash-es/_baseSampleSize.js", "../../node_modules/lodash-es/sampleSize.js", "../../node_modules/lodash-es/set.js", "../../node_modules/lodash-es/setWith.js", "../../node_modules/lodash-es/_arrayShuffle.js", "../../node_modules/lodash-es/_baseShuffle.js", "../../node_modules/lodash-es/shuffle.js", "../../node_modules/lodash-es/size.js", "../../node_modules/lodash-es/slice.js", "../../node_modules/lodash-es/snakeCase.js", "../../node_modules/lodash-es/_baseSome.js", "../../node_modules/lodash-es/some.js", "../../node_modules/lodash-es/sortBy.js", "../../node_modules/lodash-es/_baseSortedIndexBy.js", "../../node_modules/lodash-es/_baseSortedIndex.js", "../../node_modules/lodash-es/sortedIndex.js", "../../node_modules/lodash-es/sortedIndexBy.js", "../../node_modules/lodash-es/sortedIndexOf.js", "../../node_modules/lodash-es/sortedLastIndex.js", "../../node_modules/lodash-es/sortedLastIndexBy.js", "../../node_modules/lodash-es/sortedLastIndexOf.js", "../../node_modules/lodash-es/_baseSortedUniq.js", "../../node_modules/lodash-es/sortedUniq.js", "../../node_modules/lodash-es/sortedUniqBy.js", "../../node_modules/lodash-es/split.js", "../../node_modules/lodash-es/spread.js", "../../node_modules/lodash-es/startCase.js", "../../node_modules/lodash-es/startsWith.js", "../../node_modules/lodash-es/stubObject.js", "../../node_modules/lodash-es/stubString.js", "../../node_modules/lodash-es/stubTrue.js", "../../node_modules/lodash-es/subtract.js", "../../node_modules/lodash-es/sum.js", "../../node_modules/lodash-es/sumBy.js", "../../node_modules/lodash-es/tail.js", "../../node_modules/lodash-es/take.js", "../../node_modules/lodash-es/takeRight.js", "../../node_modules/lodash-es/takeRightWhile.js", "../../node_modules/lodash-es/takeWhile.js", "../../node_modules/lodash-es/tap.js", "../../node_modules/lodash-es/_customDefaultsAssignIn.js", "../../node_modules/lodash-es/_escapeStringChar.js", "../../node_modules/lodash-es/_reInterpolate.js", "../../node_modules/lodash-es/_reEscape.js", "../../node_modules/lodash-es/_reEvaluate.js", "../../node_modules/lodash-es/templateSettings.js", "../../node_modules/lodash-es/template.js", "../../node_modules/lodash-es/throttle.js", "../../node_modules/lodash-es/thru.js", "../../node_modules/lodash-es/times.js", "../../node_modules/lodash-es/toIterator.js", "../../node_modules/lodash-es/_baseWrapperValue.js", "../../node_modules/lodash-es/wrapperValue.js", "../../node_modules/lodash-es/toJSON.js", "../../node_modules/lodash-es/toLower.js", "../../node_modules/lodash-es/toPath.js", "../../node_modules/lodash-es/toSafeInteger.js", "../../node_modules/lodash-es/toUpper.js", "../../node_modules/lodash-es/transform.js", "../../node_modules/lodash-es/_charsEndIndex.js", "../../node_modules/lodash-es/_charsStartIndex.js", "../../node_modules/lodash-es/trim.js", "../../node_modules/lodash-es/trimEnd.js", "../../node_modules/lodash-es/trimStart.js", "../../node_modules/lodash-es/truncate.js", "../../node_modules/lodash-es/unary.js", "../../node_modules/lodash-es/_unescapeHtmlChar.js", "../../node_modules/lodash-es/unescape.js", "../../node_modules/lodash-es/_createSet.js", "../../node_modules/lodash-es/_baseUniq.js", "../../node_modules/lodash-es/union.js", "../../node_modules/lodash-es/unionBy.js", "../../node_modules/lodash-es/unionWith.js", "../../node_modules/lodash-es/uniq.js", "../../node_modules/lodash-es/uniqBy.js", "../../node_modules/lodash-es/uniqWith.js", "../../node_modules/lodash-es/uniqueId.js", "../../node_modules/lodash-es/unset.js", "../../node_modules/lodash-es/unzip.js", "../../node_modules/lodash-es/unzipWith.js", "../../node_modules/lodash-es/_baseUpdate.js", "../../node_modules/lodash-es/update.js", "../../node_modules/lodash-es/updateWith.js", "../../node_modules/lodash-es/upperCase.js", "../../node_modules/lodash-es/value.js", "../../node_modules/lodash-es/valueOf.js", "../../node_modules/lodash-es/valuesIn.js", "../../node_modules/lodash-es/without.js", "../../node_modules/lodash-es/wrap.js", "../../node_modules/lodash-es/wrapperAt.js", "../../node_modules/lodash-es/wrapperChain.js", "../../node_modules/lodash-es/wrapperReverse.js", "../../node_modules/lodash-es/_baseXor.js", "../../node_modules/lodash-es/xor.js", "../../node_modules/lodash-es/xorBy.js", "../../node_modules/lodash-es/xorWith.js", "../../node_modules/lodash-es/zip.js", "../../node_modules/lodash-es/_baseZipObject.js", "../../node_modules/lodash-es/zipObject.js", "../../node_modules/lodash-es/zipObjectDeep.js", "../../node_modules/lodash-es/zipWith.js", "../../node_modules/lodash-es/array.default.js", "../../node_modules/lodash-es/array.js", "../../node_modules/lodash-es/collection.default.js", "../../node_modules/lodash-es/collection.js", "../../node_modules/lodash-es/date.default.js", "../../node_modules/lodash-es/date.js", "../../node_modules/lodash-es/function.default.js", "../../node_modules/lodash-es/function.js", "../../node_modules/lodash-es/lang.default.js", "../../node_modules/lodash-es/lang.js", "../../node_modules/lodash-es/math.default.js", "../../node_modules/lodash-es/math.js", "../../node_modules/lodash-es/number.default.js", "../../node_modules/lodash-es/number.js", "../../node_modules/lodash-es/object.default.js", "../../node_modules/lodash-es/object.js", "../../node_modules/lodash-es/seq.default.js", "../../node_modules/lodash-es/seq.js", "../../node_modules/lodash-es/string.default.js", "../../node_modules/lodash-es/string.js", "../../node_modules/lodash-es/util.default.js", "../../node_modules/lodash-es/util.js", "../../node_modules/lodash-es/_lazyClone.js", "../../node_modules/lodash-es/_lazyReverse.js", "../../node_modules/lodash-es/_getView.js", "../../node_modules/lodash-es/_lazyValue.js", "../../node_modules/lodash-es/lodash.default.js", "../../node_modules/lodash-es/lodash.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.js", "../../node_modules/shell-quote/quote.js", "../../node_modules/shell-quote/parse.js", "../../node_modules/shell-quote/index.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.js", "../../node_modules/zod/v3/helpers/util.js", "../../node_modules/zod/v3/ZodError.js", "../../node_modules/zod/v3/locales/en.js", "../../node_modules/zod/v3/errors.js", "../../node_modules/zod/v3/helpers/parseUtil.js", "../../node_modules/zod/v3/helpers/errorUtil.js", "../../node_modules/zod/v3/types.js", "../../node_modules/zod/v3/external.js", "../../node_modules/zod/index.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.js", "../../node_modules/@anthropic-ai/sandbox-runtime/dist/index.js", "../src/tools/WebFetchTool/prompt.ts", "../src/utils/sandbox/sandbox-adapter.ts", "../src/utils/shell/readOnlyCommandValidation.ts", "../src/utils/permissions/pathValidation.ts", "../src/utils/plugins/pluginDirectories.ts", "../src/utils/thinking.ts", "../src/utils/effort.ts", "stub-npm:@inquirer/prompts", "../../node_modules/@anthropic-ai/mcpb/dist/schemas.js", "../../node_modules/@anthropic-ai/mcpb/dist/cli/init.js", "../../node_modules/fflate/esm/index.mjs", "../../node_modules/ignore/index.js", "../../node_modules/@anthropic-ai/mcpb/dist/node/files.js", "stub-npm:galactus", "stub-npm:pretty-bytes", "stub-npm:node-forge", "../../node_modules/@anthropic-ai/mcpb/dist/node/sign.js", "../../node_modules/@anthropic-ai/mcpb/dist/shared/log.js", "../../node_modules/@anthropic-ai/mcpb/dist/cli/unpack.js", "../../node_modules/@anthropic-ai/mcpb/dist/schemas-loose.js", "../../node_modules/@anthropic-ai/mcpb/dist/node/validate.js", "../../node_modules/@anthropic-ai/mcpb/dist/cli/pack.js", "../../node_modules/@anthropic-ai/mcpb/dist/shared/config.js", "stub-missing:/Users/chenqg/Downloads/node_modules/@anthropic-ai/mcpb/dist/types.js", "../../node_modules/@anthropic-ai/mcpb/dist/index.js", "../src/utils/dxt/helpers.ts", "../node_modules/fflate/esm/index.mjs", "../src/utils/dxt/zip.ts", "../src/utils/systemDirectories.ts", "../src/utils/plugins/mcpbHandler.ts", "../src/utils/plugins/pluginOptionsStorage.ts", "../src/utils/plugins/walkPluginMarkdown.ts", "../src/utils/plugins/loadPluginAgents.ts", "../src/tools/AgentTool/agentColorManager.ts", "../src/tools/AgentTool/agentMemorySnapshot.ts", "../src/tools/SendMessageTool/constants.ts", "../src/tools/WebSearchTool/prompt.ts", "../src/tools/AgentTool/built-in/claudeCodeGuideAgent.ts", "../src/tools/ExitPlanModeTool/constants.ts", "../src/tools/AgentTool/built-in/exploreAgent.ts", "../src/tools/AgentTool/built-in/generalPurposeAgent.ts", "../src/tools/AgentTool/built-in/planAgent.ts", "../src/tools/AgentTool/built-in/statuslineSetup.ts", "../src/tools/AgentTool/built-in/verificationAgent.ts", "../src/coordinator/workerAgent.ts", "../src/tools/AgentTool/builtInAgents.ts", "../src/tools/AgentTool/loadAgentsDir.ts", "../src/tools/SkillTool/prompt.ts", "../src/constants/apiLimits.ts", "../src/memdir/memoryAge.ts", "../src/tools/ToolSearchTool/constants.ts", "../src/tools/SendUserFileTool/prompt.ts", "../src/tools/EnterPlanModeTool/constants.ts", "../src/tools/AskUserQuestionTool/prompt.ts", "../src/tools/TodoWriteTool/constants.ts", "../src/tools/PowerShellTool/toolName.ts", "../src/utils/shell/shellToolUtils.ts", "../src/tools/SkillTool/constants.ts", "../src/tools/TaskCreateTool/constants.ts", "../src/tools/TaskGetTool/constants.ts", "../src/tools/TaskListTool/constants.ts", "../src/tools/TaskUpdateTool/constants.ts", "../src/tools/SyntheticOutputTool/SyntheticOutputTool.ts", "../src/tools/EnterWorktreeTool/constants.ts", "../src/tools/ExitWorktreeTool/constants.ts", "../src/tools/WorkflowTool/constants.ts", "../src/utils/cron.ts", "../src/utils/cronTasks.ts", "../src/tools/ScheduleCronTool/prompt.ts", "../src/constants/tools.ts", "../src/tools/TeamCreateTool/constants.ts", "../src/tools/TeamDeleteTool/constants.ts", "../src/coordinator/coordinatorMode.ts", "../src/tools/AgentTool/forkSubagent.ts", "../src/tools/ToolSearchTool/prompt.ts", "../node_modules/diff/lib/index.mjs", "../src/services/api/promptCacheBreakDetection.ts", "../src/services/compact/compactWarningState.ts", "../src/services/compact/timeBasedMCConfig.ts", "../src/services/compact/cachedMicrocompact.ts", "../src/services/compact/microCompact.ts", "../src/utils/tokens.ts", "../src/services/SessionMemory/sessionMemoryUtils.ts", "../src/tools/ToolSearchTool/ToolSearchTool.ts", "../src/utils/contextAnalysis.ts", "../src/services/rateLimitMocking.ts", "../src/tools/FileReadTool/imageProcessor.ts", "../src/utils/imageResizer.ts", "../src/utils/imageValidation.ts", "../src/services/rateLimitMessages.ts", "../src/services/claudeAiLimits.ts", "../src/services/api/errorUtils.ts", "../src/services/api/errors.ts", "../src/services/api/withRetry.ts", "../src/utils/systemPromptType.ts", "../src/constants/errorIds.ts", "../src/services/toolUseSummary/toolUseSummaryGenerator.ts", "../src/utils/objectGroupBy.ts", "../src/utils/messageQueueManager.ts", "../src/utils/commandLifecycle.ts", "../src/utils/headlessProfiler.ts", "../src/tools/SleepTool/prompt.ts", "../src/utils/hooks/postSamplingHooks.ts", "../src/services/api/dumpPrompts.ts", "../src/utils/abortController.ts", "../node_modules/cli-highlight/node_modules/highlight.js/lib/core.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/1c.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/abnf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/accesslog.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/actionscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ada.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/angelscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/apache.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/applescript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/arcade.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/arduino.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/armasm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/xml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/asciidoc.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/aspectj.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/autohotkey.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/autoit.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/avrasm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/awk.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/axapta.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/bash.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/basic.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/bnf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/brainfuck.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/c-like.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/c.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/cal.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/capnproto.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ceylon.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/clean.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/clojure.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/clojure-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/cmake.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/coffeescript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/coq.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/cos.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/cpp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/crmsh.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/crystal.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/csharp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/csp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/css.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/d.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/markdown.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dart.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/delphi.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/diff.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/django.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dns.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dockerfile.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dos.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dsconfig.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dts.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dust.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ebnf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/elixir.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/elm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ruby.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/erb.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/erlang-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/erlang.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/excel.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/fix.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/flix.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/fortran.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/fsharp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gams.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gauss.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gcode.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gherkin.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/glsl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/go.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/golo.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gradle.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/groovy.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/haml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/handlebars.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/haskell.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/haxe.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/hsp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/htmlbars.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/http.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/hy.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/inform7.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ini.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/irpf90.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/isbl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/java.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/javascript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/jboss-cli.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/json.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/julia.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/julia-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/kotlin.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/lasso.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/latex.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ldif.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/leaf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/less.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/lisp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/livecodeserver.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/livescript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/llvm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/lsl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/lua.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/makefile.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mathematica.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/matlab.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/maxima.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mel.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mercury.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mipsasm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mizar.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/perl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mojolicious.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/monkey.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/moonscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/n1ql.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/nginx.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/nim.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/nix.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/node-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/nsis.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/objectivec.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ocaml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/openscad.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/oxygene.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/parser3.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/pf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/pgsql.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/php.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/php-template.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/plaintext.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/pony.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/powershell.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/processing.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/profile.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/prolog.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/properties.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/protobuf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/puppet.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/purebasic.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/python.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/python-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/q.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/qml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/r.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/reasonml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/rib.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/roboconf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/routeros.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/rsl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ruleslanguage.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/rust.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sas.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/scala.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/scheme.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/scilab.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/scss.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/shell.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/smali.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/smalltalk.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sqf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sql_more.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sql.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/stan.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/stata.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/step21.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/stylus.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/subunit.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/swift.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/taggerscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/yaml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/tap.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/tcl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/thrift.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/tp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/twig.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/typescript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vala.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vbnet.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vbscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vbscript-html.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/verilog.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vhdl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vim.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/x86asm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/xl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/xquery.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/zephir.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/index.js", "../node_modules/parse5/lib/common/unicode.js", "../node_modules/parse5/lib/common/error-codes.js", "../node_modules/parse5/lib/tokenizer/preprocessor.js", "../node_modules/parse5/lib/tokenizer/named-entity-data.js", "../node_modules/parse5/lib/tokenizer/index.js", "../node_modules/parse5/lib/common/html.js", "../node_modules/parse5/lib/parser/open-element-stack.js", "../node_modules/parse5/lib/parser/formatting-element-list.js", "../node_modules/parse5/lib/utils/mixin.js", "../node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js", "../node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js", "../node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js", "../node_modules/parse5/lib/extensions/location-info/parser-mixin.js", "../node_modules/parse5/lib/extensions/error-reporting/mixin-base.js", "../node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js", "../node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js", "../node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js", "../node_modules/parse5/lib/tree-adapters/default.js", "../node_modules/parse5/lib/utils/merge-options.js", "../node_modules/parse5/lib/common/doctype.js", "../node_modules/parse5/lib/common/foreign-content.js", "../node_modules/parse5/lib/parser/index.js", "../node_modules/parse5/lib/serializer/index.js", "../node_modules/parse5/lib/index.js", "../node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/html.js", "../node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/doctype.js", "../node_modules/parse5-htmlparser2-tree-adapter/lib/index.js", "../node_modules/cli-highlight/node_modules/chalk/node_modules/ansi-styles/index.js", "../node_modules/cli-highlight/node_modules/chalk/source/util.js", "../node_modules/cli-highlight/node_modules/chalk/source/templates.js", "../node_modules/cli-highlight/node_modules/chalk/source/index.js", "../node_modules/cli-highlight/dist/theme.js", "../node_modules/cli-highlight/dist/index.js", "../node_modules/highlight.js/lib/core.js", "../node_modules/highlight.js/lib/languages/1c.js", "../node_modules/highlight.js/lib/languages/abnf.js", "../node_modules/highlight.js/lib/languages/accesslog.js", "../node_modules/highlight.js/lib/languages/actionscript.js", "../node_modules/highlight.js/lib/languages/ada.js", "../node_modules/highlight.js/lib/languages/angelscript.js", "../node_modules/highlight.js/lib/languages/apache.js", "../node_modules/highlight.js/lib/languages/applescript.js", "../node_modules/highlight.js/lib/languages/arcade.js", "../node_modules/highlight.js/lib/languages/arduino.js", "../node_modules/highlight.js/lib/languages/armasm.js", "../node_modules/highlight.js/lib/languages/xml.js", "../node_modules/highlight.js/lib/languages/asciidoc.js", "../node_modules/highlight.js/lib/languages/aspectj.js", "../node_modules/highlight.js/lib/languages/autohotkey.js", "../node_modules/highlight.js/lib/languages/autoit.js", "../node_modules/highlight.js/lib/languages/avrasm.js", "../node_modules/highlight.js/lib/languages/awk.js", "../node_modules/highlight.js/lib/languages/axapta.js", "../node_modules/highlight.js/lib/languages/bash.js", "../node_modules/highlight.js/lib/languages/basic.js", "../node_modules/highlight.js/lib/languages/bnf.js", "../node_modules/highlight.js/lib/languages/brainfuck.js", "../node_modules/highlight.js/lib/languages/c.js", "../node_modules/highlight.js/lib/languages/cal.js", "../node_modules/highlight.js/lib/languages/capnproto.js", "../node_modules/highlight.js/lib/languages/ceylon.js", "../node_modules/highlight.js/lib/languages/clean.js", "../node_modules/highlight.js/lib/languages/clojure.js", "../node_modules/highlight.js/lib/languages/clojure-repl.js", "../node_modules/highlight.js/lib/languages/cmake.js", "../node_modules/highlight.js/lib/languages/coffeescript.js", "../node_modules/highlight.js/lib/languages/coq.js", "../node_modules/highlight.js/lib/languages/cos.js", "../node_modules/highlight.js/lib/languages/cpp.js", "../node_modules/highlight.js/lib/languages/crmsh.js", "../node_modules/highlight.js/lib/languages/crystal.js", "../node_modules/highlight.js/lib/languages/csharp.js", "../node_modules/highlight.js/lib/languages/csp.js", "../node_modules/highlight.js/lib/languages/css.js", "../node_modules/highlight.js/lib/languages/d.js", "../node_modules/highlight.js/lib/languages/markdown.js", "../node_modules/highlight.js/lib/languages/dart.js", "../node_modules/highlight.js/lib/languages/delphi.js", "../node_modules/highlight.js/lib/languages/diff.js", "../node_modules/highlight.js/lib/languages/django.js", "../node_modules/highlight.js/lib/languages/dns.js", "../node_modules/highlight.js/lib/languages/dockerfile.js", "../node_modules/highlight.js/lib/languages/dos.js", "../node_modules/highlight.js/lib/languages/dsconfig.js", "../node_modules/highlight.js/lib/languages/dts.js", "../node_modules/highlight.js/lib/languages/dust.js", "../node_modules/highlight.js/lib/languages/ebnf.js", "../node_modules/highlight.js/lib/languages/elixir.js", "../node_modules/highlight.js/lib/languages/elm.js", "../node_modules/highlight.js/lib/languages/ruby.js", "../node_modules/highlight.js/lib/languages/erb.js", "../node_modules/highlight.js/lib/languages/erlang-repl.js", "../node_modules/highlight.js/lib/languages/erlang.js", "../node_modules/highlight.js/lib/languages/excel.js", "../node_modules/highlight.js/lib/languages/fix.js", "../node_modules/highlight.js/lib/languages/flix.js", "../node_modules/highlight.js/lib/languages/fortran.js", "../node_modules/highlight.js/lib/languages/fsharp.js", "../node_modules/highlight.js/lib/languages/gams.js", "../node_modules/highlight.js/lib/languages/gauss.js", "../node_modules/highlight.js/lib/languages/gcode.js", "../node_modules/highlight.js/lib/languages/gherkin.js", "../node_modules/highlight.js/lib/languages/glsl.js", "../node_modules/highlight.js/lib/languages/gml.js", "../node_modules/highlight.js/lib/languages/go.js", "../node_modules/highlight.js/lib/languages/golo.js", "../node_modules/highlight.js/lib/languages/gradle.js", "../node_modules/highlight.js/lib/languages/graphql.js", "../node_modules/highlight.js/lib/languages/groovy.js", "../node_modules/highlight.js/lib/languages/haml.js", "../node_modules/highlight.js/lib/languages/handlebars.js", "../node_modules/highlight.js/lib/languages/haskell.js", "../node_modules/highlight.js/lib/languages/haxe.js", "../node_modules/highlight.js/lib/languages/hsp.js", "../node_modules/highlight.js/lib/languages/http.js", "../node_modules/highlight.js/lib/languages/hy.js", "../node_modules/highlight.js/lib/languages/inform7.js", "../node_modules/highlight.js/lib/languages/ini.js", "../node_modules/highlight.js/lib/languages/irpf90.js", "../node_modules/highlight.js/lib/languages/isbl.js", "../node_modules/highlight.js/lib/languages/java.js", "../node_modules/highlight.js/lib/languages/javascript.js", "../node_modules/highlight.js/lib/languages/jboss-cli.js", "../node_modules/highlight.js/lib/languages/json.js", "../node_modules/highlight.js/lib/languages/julia.js", "../node_modules/highlight.js/lib/languages/julia-repl.js", "../node_modules/highlight.js/lib/languages/kotlin.js", "../node_modules/highlight.js/lib/languages/lasso.js", "../node_modules/highlight.js/lib/languages/latex.js", "../node_modules/highlight.js/lib/languages/ldif.js", "../node_modules/highlight.js/lib/languages/leaf.js", "../node_modules/highlight.js/lib/languages/less.js", "../node_modules/highlight.js/lib/languages/lisp.js", "../node_modules/highlight.js/lib/languages/livecodeserver.js", "../node_modules/highlight.js/lib/languages/livescript.js", "../node_modules/highlight.js/lib/languages/llvm.js", "../node_modules/highlight.js/lib/languages/lsl.js", "../node_modules/highlight.js/lib/languages/lua.js", "../node_modules/highlight.js/lib/languages/makefile.js", "../node_modules/highlight.js/lib/languages/mathematica.js", "../node_modules/highlight.js/lib/languages/matlab.js", "../node_modules/highlight.js/lib/languages/maxima.js", "../node_modules/highlight.js/lib/languages/mel.js", "../node_modules/highlight.js/lib/languages/mercury.js", "../node_modules/highlight.js/lib/languages/mipsasm.js", "../node_modules/highlight.js/lib/languages/mizar.js", "../node_modules/highlight.js/lib/languages/perl.js", "../node_modules/highlight.js/lib/languages/mojolicious.js", "../node_modules/highlight.js/lib/languages/monkey.js", "../node_modules/highlight.js/lib/languages/moonscript.js", "../node_modules/highlight.js/lib/languages/n1ql.js", "../node_modules/highlight.js/lib/languages/nestedtext.js", "../node_modules/highlight.js/lib/languages/nginx.js", "../node_modules/highlight.js/lib/languages/nim.js", "../node_modules/highlight.js/lib/languages/nix.js", "../node_modules/highlight.js/lib/languages/node-repl.js", "../node_modules/highlight.js/lib/languages/nsis.js", "../node_modules/highlight.js/lib/languages/objectivec.js", "../node_modules/highlight.js/lib/languages/ocaml.js", "../node_modules/highlight.js/lib/languages/openscad.js", "../node_modules/highlight.js/lib/languages/oxygene.js", "../node_modules/highlight.js/lib/languages/parser3.js", "../node_modules/highlight.js/lib/languages/pf.js", "../node_modules/highlight.js/lib/languages/pgsql.js", "../node_modules/highlight.js/lib/languages/php.js", "../node_modules/highlight.js/lib/languages/php-template.js", "../node_modules/highlight.js/lib/languages/plaintext.js", "../node_modules/highlight.js/lib/languages/pony.js", "../node_modules/highlight.js/lib/languages/powershell.js", "../node_modules/highlight.js/lib/languages/processing.js", "../node_modules/highlight.js/lib/languages/profile.js", "../node_modules/highlight.js/lib/languages/prolog.js", "../node_modules/highlight.js/lib/languages/properties.js", "../node_modules/highlight.js/lib/languages/protobuf.js", "../node_modules/highlight.js/lib/languages/puppet.js", "../node_modules/highlight.js/lib/languages/purebasic.js", "../node_modules/highlight.js/lib/languages/python.js", "../node_modules/highlight.js/lib/languages/python-repl.js", "../node_modules/highlight.js/lib/languages/q.js", "../node_modules/highlight.js/lib/languages/qml.js", "../node_modules/highlight.js/lib/languages/r.js", "../node_modules/highlight.js/lib/languages/reasonml.js", "../node_modules/highlight.js/lib/languages/rib.js", "../node_modules/highlight.js/lib/languages/roboconf.js", "../node_modules/highlight.js/lib/languages/routeros.js", "../node_modules/highlight.js/lib/languages/rsl.js", "../node_modules/highlight.js/lib/languages/ruleslanguage.js", "../node_modules/highlight.js/lib/languages/rust.js", "../node_modules/highlight.js/lib/languages/sas.js", "../node_modules/highlight.js/lib/languages/scala.js", "../node_modules/highlight.js/lib/languages/scheme.js", "../node_modules/highlight.js/lib/languages/scilab.js", "../node_modules/highlight.js/lib/languages/scss.js", "../node_modules/highlight.js/lib/languages/shell.js", "../node_modules/highlight.js/lib/languages/smali.js", "../node_modules/highlight.js/lib/languages/smalltalk.js", "../node_modules/highlight.js/lib/languages/sml.js", "../node_modules/highlight.js/lib/languages/sqf.js", "../node_modules/highlight.js/lib/languages/sql.js", "../node_modules/highlight.js/lib/languages/stan.js", "../node_modules/highlight.js/lib/languages/stata.js", "../node_modules/highlight.js/lib/languages/step21.js", "../node_modules/highlight.js/lib/languages/stylus.js", "../node_modules/highlight.js/lib/languages/subunit.js", "../node_modules/highlight.js/lib/languages/swift.js", "../node_modules/highlight.js/lib/languages/taggerscript.js", "../node_modules/highlight.js/lib/languages/yaml.js", "../node_modules/highlight.js/lib/languages/tap.js", "../node_modules/highlight.js/lib/languages/tcl.js", "../node_modules/highlight.js/lib/languages/thrift.js", "../node_modules/highlight.js/lib/languages/tp.js", "../node_modules/highlight.js/lib/languages/twig.js", "../node_modules/highlight.js/lib/languages/typescript.js", "../node_modules/highlight.js/lib/languages/vala.js", "../node_modules/highlight.js/lib/languages/vbnet.js", "../node_modules/highlight.js/lib/languages/vbscript.js", "../node_modules/highlight.js/lib/languages/vbscript-html.js", "../node_modules/highlight.js/lib/languages/verilog.js", "../node_modules/highlight.js/lib/languages/vhdl.js", "../node_modules/highlight.js/lib/languages/vim.js", "../node_modules/highlight.js/lib/languages/wasm.js", "../node_modules/highlight.js/lib/languages/wren.js", "../node_modules/highlight.js/lib/languages/x86asm.js", "../node_modules/highlight.js/lib/languages/xl.js", "../node_modules/highlight.js/lib/languages/xquery.js", "../node_modules/highlight.js/lib/languages/zephir.js", "../node_modules/highlight.js/lib/index.js", "../node_modules/highlight.js/es/index.js", "../src/utils/cliHighlight.ts", "../src/utils/taggedId.ts", "../src/utils/telemetryAttributes.ts", "../src/utils/telemetry/events.ts", "../src/hooks/toolPermission/permissionLogging.ts", "../src/utils/bash/bashParser.ts", "../src/utils/bash/parser.ts", "../src/utils/bash/ast.ts", "../node_modules/shell-quote/quote.js", "../node_modules/shell-quote/parse.js", "../node_modules/shell-quote/index.js", "../src/utils/bash/shellQuote.ts", "../src/utils/permissions/bashClassifier.ts", "../src/utils/permissions/permissionsLoader.ts", "../src/utils/permissions/PermissionUpdate.ts", "../src/utils/permissions/shellRuleMatching.ts", "../src/constants/toolLimits.ts", "../src/services/mcp/vscodeSdkMcp.ts", "../src/services/PromptSuggestion/promptSuggestion.ts", "../src/utils/generatedFiles.ts", "../src/utils/commitAttribution.ts", "../src/state/AppStateStore.ts", "../src/utils/bash/heredoc.ts", "../src/utils/bash/treeSitterAnalysis.ts", "../src/utils/bash/ParsedCommand.ts", "../src/tools/BashTool/bashSecurity.ts", "../src/tools/BashTool/sedValidation.ts", "../src/tools/BashTool/pathValidation.ts", "../src/tools/BashTool/readOnlyValidation.ts", "../src/utils/generators.ts", "../src/services/tools/toolOrchestration.ts", "../src/utils/queryHelpers.ts", "../src/services/PromptSuggestion/speculation.ts", "../src/utils/sdkEventQueue.ts", "../src/utils/task/framework.ts", "../src/utils/xml.ts", "../src/types/ids.ts", "../src/tools/BashTool/commentLabel.ts", "../src/utils/promptCategory.ts", "../src/utils/claudeInChrome/common.ts", "../src/services/mcp/envExpansion.ts", "../src/utils/plugins/mcpPluginIntegration.ts", "../src/services/mcp/claudeai.ts", "../src/services/mcp/utils.ts", "../src/services/mcp/config.ts", "../src/tasks/LocalShellTask/guards.ts", "../src/tasks/LocalShellTask/killShellTasks.ts", "../src/utils/hooks/hooksSettings.ts", "../src/utils/hooks/sessionHooks.ts", "../src/utils/hooks/registerFrontmatterHooks.ts", "../src/utils/model/agent.ts", "../src/utils/telemetry/perfettoTracing.ts", "../src/utils/uuid.ts", "../src/utils/model/antModels.ts", "../src/utils/fingerprint.ts", "../src/utils/sideQuery.ts", "../src/utils/permissions/classifierShared.ts", "stub-txt:./yolo-classifier-prompts/auto_mode_system_prompt.txt", "stub-txt:./yolo-classifier-prompts/permissions_external.txt", "stub-txt:./yolo-classifier-prompts/permissions_anthropic.txt", "../src/utils/permissions/yoloClassifier.ts", "../src/utils/task/sdkProgress.ts", "../src/tools/AgentTool/agentToolUtils.ts", "../src/components/ConfigurableShortcutHint.tsx", "../src/components/design-system/Byline.tsx", "../src/components/AgentProgressLine.tsx", "../src/utils/hyperlink.ts", "../src/components/shell/ExpandShellOutputContext.tsx", "../src/components/shell/OutputLine.tsx", "../src/utils/sandbox/sandbox-ui-utils.ts", "../src/components/FallbackToolUseErrorMessage.tsx", "../src/components/InterruptedByUser.tsx", "../src/components/FallbackToolUseRejectedMessage.tsx", "../src/hooks/useSettings.ts", "../src/utils/markdown.ts", "../src/components/MarkdownTable.tsx", "../src/components/Markdown.tsx", "../src/utils/advisor.ts", "../src/components/CompactSummary.tsx", "../src/hooks/useBlink.ts", "../src/components/ToolUseLoader.tsx", "../src/components/messages/AdvisorMessage.tsx", "../src/components/messages/AssistantRedactedThinkingMessage.tsx", "../src/utils/model/check1mAccess.ts", "../src/utils/model/contextWindowUpgradeCheck.ts", "../src/bridge/trustedDevice.ts", "../src/services/analytics/datadog.ts", "../src/utils/gracefulShutdown.ts", "../src/services/api/grove.ts", "../src/services/policyLimits/types.ts", "../src/services/policyLimits/index.ts", "../src/hooks/useDoublePress.ts", "../src/hooks/useExitOnCtrlCD.ts", "../src/hooks/useExitOnCtrlCDWithKeybindings.ts", "../src/utils/imagePaste.ts", "../src/utils/imageStore.ts", "../src/components/ClickableImageRef.tsx", "../src/ink/hooks/use-declared-cursor.ts", "../src/components/design-system/ListItem.tsx", "../src/components/CustomSelect/select-option.tsx", "../src/components/CustomSelect/select-input-option.tsx", "../src/context/overlayContext.tsx", "../src/components/CustomSelect/option-map.ts", "../src/components/CustomSelect/use-select-navigation.ts", "../src/components/CustomSelect/use-multi-select-state.ts", "../src/components/CustomSelect/SelectMulti.tsx", "../src/components/CustomSelect/use-select-input.ts", "../src/components/CustomSelect/use-select-state.ts", "../src/components/CustomSelect/select.tsx", "../src/components/CustomSelect/index.ts", "../src/components/permissions/PermissionRequestTitle.tsx", "../src/components/permissions/PermissionDialog.tsx", "../src/utils/managedEnvConstants.ts", "../src/components/ManagedSettingsSecurityDialog/utils.ts", "../src/components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.tsx", "../src/keybindings/KeybindingProviderSetup.tsx", "../src/utils/renderOptions.ts", "../src/services/remoteManagedSettings/securityCheck.tsx", "../src/services/remoteManagedSettings/syncCache.ts", "../src/services/remoteManagedSettings/types.ts", "../src/services/remoteManagedSettings/index.ts", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationTemporality.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricData.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/utils.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/types.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Drop.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/InstrumentDescriptor.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Histogram.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/Buckets.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ieee754.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/util.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/types.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ExponentMapping.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/LogarithmMapping.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/getMapping.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/ExponentialHistogram.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/LastValue.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Sum.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/index.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/Aggregation.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationSelector.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricReader.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/PeriodicExportingMetricReader.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/InMemoryMetricExporter.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/ConsoleMetricExporter.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/ViewRegistry.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/Instruments.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/Meter.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorage.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/HashMap.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/DeltaMetricProcessor.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/TemporalMetricProcessor.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/AsyncMetricStorage.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/RegistrationConflicts.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorageRegistry.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MultiWritableMetricStorage.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/ObservableResult.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/ObservableRegistry.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/SyncMetricStorage.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/AttributesProcessor.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterSharedState.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterProviderSharedState.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricCollector.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/Predicate.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/InstrumentSelector.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/MeterSelector.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/View.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/index.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/index.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/enums.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/Span.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/Sampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOffSampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOnSampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/ParentBasedSampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/TraceIdRatioBasedSampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/config.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/utility.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/BatchSpanProcessorBase.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/export/BatchSpanProcessor.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/RandomIdGenerator.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/index.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/platform/index.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/Tracer.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/MultiSpanProcessor.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/NoopSpanProcessor.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/ConsoleSpanExporter.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/InMemorySpanExporter.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/SimpleSpanProcessor.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/index.js", "../src/utils/telemetry/betaSessionTracing.ts", "../src/services/api/metricsOptOut.ts", "../src/utils/telemetry/bigqueryExporter.ts", "../src/utils/telemetry/logger.ts", "../src/utils/telemetry/sessionTracing.ts", "stub-npm:@opentelemetry/exporter-metrics-otlp-grpc", "stub-npm:@opentelemetry/exporter-metrics-otlp-http", "stub-npm:@opentelemetry/exporter-metrics-otlp-proto", "stub-npm:@opentelemetry/exporter-prometheus", "stub-npm:@opentelemetry/exporter-logs-otlp-grpc", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/OTLPExporterBase.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/types.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/shared-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/legacy-node-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/bounded-queue-export-promise-handler.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/logging-response-handler.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-export-delegate.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-network-export-delegate.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/index.js", "../node_modules/@protobufjs/aspromise/index.js", "../node_modules/@protobufjs/base64/index.js", "../node_modules/@protobufjs/eventemitter/index.js", "../node_modules/@protobufjs/float/index.js", "../node_modules/@protobufjs/inquire/index.js", "../node_modules/@protobufjs/utf8/index.js", "../node_modules/@protobufjs/pool/index.js", "../node_modules/protobufjs/src/util/longbits.js", "../node_modules/protobufjs/src/util/minimal.js", "../node_modules/protobufjs/src/writer.js", "../node_modules/protobufjs/src/writer_buffer.js", "../node_modules/protobufjs/src/reader.js", "../node_modules/protobufjs/src/reader_buffer.js", "../node_modules/protobufjs/src/rpc/service.js", "../node_modules/protobufjs/src/rpc.js", "../node_modules/protobufjs/src/roots.js", "../node_modules/protobufjs/src/index-minimal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/common/utils.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/common/internal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/internal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/metrics.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/trace.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/logs.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/metrics.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/trace.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/index.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/version.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/is-export-retryable.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/transport/http-transport-utils.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/transport/http-exporter-transport.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/retrying-transport.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-http-export-delegate.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/shared-env-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/util.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/otlp-http-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/otlp-http-env-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/convert-legacy-node-http-options.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/index-node-http.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/platform/node/OTLPLogExporter.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/platform/node/index.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/platform/index.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/index.js", "stub-npm:@opentelemetry/exporter-logs-otlp-proto", "stub-npm:@opentelemetry/exporter-trace-otlp-grpc", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/version.js", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPTraceExporter.js", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/index.js", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js", "stub-npm:@opentelemetry/exporter-trace-otlp-proto", "../src/utils/telemetry/instrumentation.ts", "../src/commands/logout/logout.tsx", "../src/services/api/firstTokenDate.ts", "../src/utils/browser.ts", "../src/services/oauth/auth-code-listener.ts", "../src/services/oauth/crypto.ts", "../src/services/oauth/index.ts", "../src/utils/localInstaller.ts", "../src/utils/shellConfig.ts", "../src/utils/autoUpdater.ts", "../src/utils/nativeInstaller/packageManagers.ts", "../src/utils/doctorDiagnostic.ts", "../src/utils/jetbrains.ts", "../src/utils/idePathConversion.ts", "../src/context/modalContext.tsx", "../src/components/design-system/Divider.tsx", "../src/components/design-system/Pane.tsx", "../src/components/design-system/Dialog.tsx", "../src/components/IdeOnboardingDialog.tsx", "../src/utils/ide.ts", "../src/utils/xdg.ts", "../src/utils/nativeInstaller/download.ts", "../src/utils/nativeInstaller/pidLock.ts", "../src/utils/nativeInstaller/installer.ts", "../src/utils/nativeInstaller/index.ts", "../src/utils/settings/allErrors.ts", "../src/utils/status.tsx", "../src/cli/handlers/auth.ts", "../node_modules/@xmldom/xmldom/lib/conventions.js", "../node_modules/@xmldom/xmldom/lib/dom.js", "../node_modules/@xmldom/xmldom/lib/entities.js", "../node_modules/@xmldom/xmldom/lib/sax.js", "../node_modules/@xmldom/xmldom/lib/dom-parser.js", "../node_modules/@xmldom/xmldom/lib/index.js", "../node_modules/plist/lib/parse.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/plist/lib/build.js", "../node_modules/plist/index.js", "../src/services/notifier.ts", "../src/bridge/bridgeStatusUtil.ts", "../src/utils/activityManager.ts", "../src/constants/spinnerVerbs.ts", "../src/tasks/InProcessTeammateTask/types.ts", "../src/utils/tasks.ts", "../src/components/TaskListV2.tsx", "../src/hooks/useTasksV2.ts", "../src/components/Spinner/utils.ts", "../src/components/Spinner/FlashingChar.tsx", "../src/components/Spinner/GlimmerMessage.tsx", "../src/components/Spinner/ShimmerChar.tsx", "../src/components/Spinner/SpinnerGlyph.tsx", "../src/components/Spinner/useShimmerAnimation.ts", "../src/components/Spinner/useStalledAnimation.ts", "../src/components/Spinner/index.ts", "../src/utils/ink.ts", "../src/components/Spinner/SpinnerAnimationRow.tsx", "../src/tasks/types.ts", "../src/constants/turnCompletionVerbs.ts", "../src/utils/agentId.ts", "../src/utils/swarm/backends/types.ts", "../src/utils/swarm/constants.ts", "../src/utils/swarm/backends/detection.ts", "../src/entrypoints/sdk/coreSchemas.ts", "../src/utils/teammateMailbox.ts", "../src/utils/permissions/PermissionRule.ts", "../src/utils/permissions/PermissionUpdateSchema.ts", "../src/utils/swarm/permissionSync.ts", "../src/hooks/useSwarmPermissionPoller.ts", "../src/utils/toolResultStorage.ts", "../src/utils/swarm/leaderPermissionBridge.ts", "../src/utils/swarm/teammatePromptAddendum.ts", "../src/utils/swarm/inProcessRunner.ts", "../src/utils/swarm/backends/InProcessBackend.ts", "../src/utils/swarm/backends/it2Setup.ts", "../src/utils/swarm/backends/teammateModeSnapshot.ts", "../src/utils/swarm/spawnUtils.ts", "../src/utils/swarm/teammateLayoutManager.ts", "../src/utils/swarm/backends/PaneBackendExecutor.ts", "../src/utils/swarm/backends/TmuxBackend.ts", "../src/utils/swarm/backends/ITermBackend.ts", "../src/utils/swarm/backends/registry.ts", "../src/utils/swarm/teamHelpers.ts", "../src/utils/swarm/spawnInProcess.ts", "../src/tasks/InProcessTeammateTask/InProcessTeammateTask.tsx", "../src/state/selectors.ts", "../src/hooks/useElapsedTime.ts", "../src/components/Spinner/teammateSelectHint.ts", "../src/components/Spinner/TeammateSpinnerLine.tsx", "../src/components/Spinner/TeammateSpinnerTree.tsx", "../src/components/Spinner.tsx", "../src/components/ConsoleOAuthFlow.tsx", "../src/hooks/useMainLoopModel.ts", "../src/utils/permissions/bypassPermissionsKillswitch.ts", "../src/commands/login/login.tsx", "../src/utils/teleport/api.ts", "../src/services/api/adminRequests.ts", "../src/services/api/overageCreditGrant.ts", "../src/services/api/usage.ts", "../src/commands/extra-usage/extra-usage-core.ts", "../src/commands/extra-usage/extra-usage.tsx", "../src/commands/extra-usage/extra-usage-noninteractive.ts", "../src/commands/extra-usage/index.ts", "../src/services/claudeAiLimitsHook.ts", "../src/components/messages/RateLimitMessage.tsx", "../src/components/messages/AssistantTextMessage.tsx", "../src/components/messages/AssistantThinkingMessage.tsx", "../src/utils/classifierApprovals.ts", "../src/utils/classifierApprovalsHook.ts", "../src/components/SentryErrorBoundary.ts", "../src/components/messages/HookProgressMessage.tsx", "../src/components/messages/AssistantToolUseMessage.tsx", "../src/components/messages/UserAgentNotificationMessage.tsx", "../src/components/messages/UserBashInputMessage.tsx", "../src/components/shell/ShellTimeDisplay.tsx", "../src/tools/BashTool/BashToolResultMessage.tsx", "../src/components/messages/UserBashOutputMessage.tsx", "../src/components/messages/UserCommandMessage.tsx", "../src/components/messages/UserLocalCommandOutputMessage.tsx", "../src/components/messages/UserMemoryInputMessage.tsx", "../src/components/messages/UserPlanMessage.tsx", "../src/context/QueuedMessageContext.tsx", "../src/utils/formatBriefTimestamp.ts", "../src/components/messages/HighlightedThinkingText.tsx", "../src/components/messages/UserPromptMessage.tsx", "../src/components/messages/UserResourceUpdateMessage.tsx", "../src/components/messages/ShutdownMessage.tsx", "../src/components/messages/TaskAssignmentMessage.tsx", "../src/components/messages/PlanApprovalMessage.tsx", "../src/components/messages/UserTeammateMessage.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/messages/UserGitHubWebhookMessage.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/messages/UserForkBoilerplateMessage.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/messages/UserCrossSessionMessage.js", "../src/components/messages/UserChannelMessage.tsx", "../src/components/messages/UserTextMessage.tsx", "../src/services/diagnosticTracking.ts", "../src/components/DiagnosticsDisplay.tsx", "../src/components/messages/UserImageMessage.tsx", "../src/components/FilePathLink.tsx", "../src/components/messages/AttachmentMessage.tsx", "../src/hooks/useMinDisplayTime.ts", "../src/components/PrBadge.tsx", "../src/components/messages/teamMemCollapsed.tsx", "../src/components/messages/CollapsedReadSearchContent.tsx", "../src/components/messages/CompactBoundaryMessage.tsx", "../src/components/messages/GroupedToolUseContent.tsx", "../src/components/messages/SystemAPIErrorMessage.tsx", "../src/tasks/pillLabel.ts", "../src/components/messages/teamMemSaved.ts", "../src/components/messages/SystemTextMessage.tsx", "../src/components/messages/UserToolResultMessage/UserToolCanceledMessage.tsx", "../src/components/messages/UserToolResultMessage/RejectedPlanMessage.tsx", "../src/components/messages/UserToolResultMessage/RejectedToolUseMessage.tsx", "../src/components/messages/UserToolResultMessage/UserToolErrorMessage.tsx", "../src/components/messages/UserToolResultMessage/UserToolRejectMessage.tsx", "../src/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx", "../src/components/messages/UserToolResultMessage/utils.tsx", "../src/components/messages/UserToolResultMessage/UserToolResultMessage.tsx", "../src/components/OffscreenFreeze.tsx", "../src/services/compact/snipProjection.ts", "../src/services/compact/snipCompact.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/messages/SnipBoundaryMessage.js", "../src/components/Message.tsx", "../src/tools/AgentTool/UI.tsx", "../src/utils/hooks/registerSkillHooks.ts", "../src/utils/slashCommandParsing.ts", "../src/utils/suggestions/skillUsageTracking.ts", "../src/utils/telemetry/pluginTelemetry.ts", "../src/utils/processUserInput/processSlashCommand.tsx", "../src/tasks/MonitorMcpTask/MonitorMcpTask.ts", "../src/tools/AgentTool/runAgent.ts", "../src/services/AgentSummary/agentSummary.ts", "../src/utils/todo/types.ts", "../src/tools/TodoWriteTool/prompt.ts", "../src/tools/TodoWriteTool/TodoWriteTool.ts", "../src/utils/teleport/environments.ts", "../src/utils/background/remote/preconditions.ts", "../src/utils/background/remote/remoteSession.ts", "../src/components/TeleportStash.tsx", "../src/components/TeleportError.tsx", "../src/utils/sessionIngressAuth.ts", "../src/services/api/sessionIngress.ts", "../src/utils/fileHistory.ts", "../src/utils/filePersistence/outputsScanner.ts", "../src/utils/words.ts", "../src/utils/plans.ts", "../src/utils/sessionEnvironment.ts", "../src/utils/hooks/hooksConfigSnapshot.ts", "../src/utils/hooks/fileChangedWatcher.ts", "../src/utils/plugins/loadPluginHooks.ts", "../src/utils/sessionStart.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/utils/udsClient.js", "../src/utils/conversationRecovery.ts", "../src/services/api/filesApi.ts", "../src/utils/tempfile.ts", "../src/utils/teleport/gitBundle.ts", "../src/utils/teleport.tsx", "../src/tasks/RemoteAgentTask/RemoteAgentTask.tsx", "../src/tools/utils.ts", "../src/tools/SkillTool/UI.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/remoteSkillState.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/remoteSkillLoader.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/telemetry.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/featureCheck.js", "../src/tools/SkillTool/SkillTool.ts", "../src/services/lsp/LSPDiagnosticRegistry.ts", "../src/utils/plugins/lspPluginIntegration.ts", "../src/services/lsp/config.ts", "../node_modules/vscode-jsonrpc/lib/common/is.js", "../node_modules/vscode-jsonrpc/lib/common/messages.js", "../node_modules/vscode-jsonrpc/lib/common/linkedMap.js", "../node_modules/vscode-jsonrpc/lib/common/disposable.js", "../node_modules/vscode-jsonrpc/lib/common/ral.js", "../node_modules/vscode-jsonrpc/lib/common/events.js", "../node_modules/vscode-jsonrpc/lib/common/cancellation.js", "../node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js", "../node_modules/vscode-jsonrpc/lib/common/semaphore.js", "../node_modules/vscode-jsonrpc/lib/common/messageReader.js", "../node_modules/vscode-jsonrpc/lib/common/messageWriter.js", "../node_modules/vscode-jsonrpc/lib/common/messageBuffer.js", "../node_modules/vscode-jsonrpc/lib/common/connection.js", "../node_modules/vscode-jsonrpc/lib/common/api.js", "../node_modules/vscode-jsonrpc/lib/node/ril.js", "../node_modules/vscode-jsonrpc/lib/node/main.js", "../src/utils/subprocessEnv.ts", "../src/services/lsp/LSPClient.ts", "../src/services/lsp/LSPServerInstance.ts", "../src/services/lsp/LSPServerManager.ts", "../src/services/lsp/passiveFeedback.ts", "../src/services/lsp/manager.ts", "../src/services/teamMemorySync/secretScanner.ts", "../src/services/teamMemorySync/teamMemSecretGuard.ts", "../src/utils/argumentSubstitution.ts", "../src/utils/claudeCodeHints.ts", "../src/utils/plugins/pluginPolicy.ts", "../src/utils/plugins/hintRecommendation.ts", "../src/utils/CircularBuffer.ts", "../src/utils/envValidation.ts", "../src/utils/shell/outputLimits.ts", "../src/utils/task/TaskOutput.ts", "../src/utils/bash/bashPipeCommand.ts", "../src/utils/bash/ShellSnapshot.ts", "../src/utils/bash/shellPrefix.ts", "../src/utils/bash/shellQuoting.ts", "../src/utils/sessionEnvVars.ts", "../src/utils/tmuxSocket.ts", "../src/utils/shell/bashProvider.ts", "../src/utils/shell/powershellDetection.ts", "../src/utils/shell/powershellProvider.ts", "../src/utils/Shell.ts", "../src/utils/semanticBoolean.ts", "../src/utils/semanticNumber.ts", "../src/components/shell/ShellProgressMessage.tsx", "../src/tools/BashTool/sedEditParser.ts", "../src/tools/BashTool/UI.tsx", "../src/tools/BashTool/utils.ts", "../src/tools/shared/gitOperationTracking.ts", "../src/tools/PowerShellTool/commandSemantics.ts", "../src/utils/powershell/parser.ts", "../src/tools/PowerShellTool/gitSafety.ts", "../src/tools/PowerShellTool/commonParameters.ts", "../src/tools/PowerShellTool/readOnlyValidation.ts", "../src/tools/PowerShellTool/modeValidation.ts", "../src/tools/PowerShellTool/pathValidation.ts", "../src/utils/permissions/dangerousPatterns.ts", "../src/utils/powershell/dangerousCmdlets.ts", "../src/tools/PowerShellTool/clmTypes.ts", "../src/tools/PowerShellTool/powershellSecurity.ts", "../src/tools/PowerShellTool/powershellPermissions.ts", "../src/utils/timeouts.ts", "../src/tools/PowerShellTool/prompt.ts", "../src/tools/PowerShellTool/UI.tsx", "../src/tools/PowerShellTool/PowerShellTool.tsx", "../src/utils/promptShellExecution.ts", "../src/skills/mcpSkillBuilders.ts", "../src/skills/loadSkillsDir.ts", "../src/cost-tracker.ts", "../src/utils/diff.ts", "../src/utils/fileOperationAnalytics.ts", "../src/utils/gitDiff.ts", "../src/utils/settings/validateEditTool.ts", "../src/tools/FileEditTool/prompt.ts", "../src/tools/FileEditTool/types.ts", "../src/components/HighlightedCode/Fallback.tsx", "../src/native-ts/color-diff/index.ts", "../src/components/StructuredDiff/colorDiff.ts", "../src/components/HighlightedCode.tsx", "../src/components/StructuredDiff/Fallback.tsx", "../src/components/StructuredDiff.tsx", "../src/components/StructuredDiffList.tsx", "../src/components/FileEditToolUseRejectedMessage.tsx", "../src/components/FileEditToolUpdatedMessage.tsx", "../src/utils/readEditContext.ts", "../src/tools/FileEditTool/utils.ts", "../src/tools/FileEditTool/UI.tsx", "../src/tools/FileEditTool/FileEditTool.ts", "../src/tools/FileWriteTool/UI.tsx", "../src/tools/FileWriteTool/FileWriteTool.ts", "../src/utils/plugins/orphanedPluginFilter.ts", "../src/utils/glob.ts", "../src/tools/GrepTool/UI.tsx", "../src/tools/GrepTool/GrepTool.ts", "../src/tools/GlobTool/UI.tsx", "../src/tools/GlobTool/GlobTool.ts", "../src/utils/notebook.ts", "../src/tools/NotebookEditTool/prompt.ts", "../src/components/NotebookEditToolUseRejectedMessage.tsx", "../src/tools/NotebookEditTool/UI.tsx", "../src/tools/NotebookEditTool/NotebookEditTool.ts", "../src/tools/WebFetchTool/preapproved.ts", "../src/tools/WebFetchTool/UI.tsx", "../src/utils/mcpOutputStorage.ts", "../node_modules/@mixmark-io/domino/lib/Event.js", "../node_modules/@mixmark-io/domino/lib/UIEvent.js", "../node_modules/@mixmark-io/domino/lib/MouseEvent.js", "../node_modules/@mixmark-io/domino/lib/DOMException.js", "../node_modules/@mixmark-io/domino/lib/config.js", "../node_modules/@mixmark-io/domino/lib/utils.js", "../node_modules/@mixmark-io/domino/lib/EventTarget.js", "../node_modules/@mixmark-io/domino/lib/LinkedList.js", "../node_modules/@mixmark-io/domino/lib/NodeUtils.js", "../node_modules/@mixmark-io/domino/lib/Node.js", "../node_modules/@mixmark-io/domino/lib/NodeList.es6.js", "../node_modules/@mixmark-io/domino/lib/NodeList.es5.js", "../node_modules/@mixmark-io/domino/lib/NodeList.js", "../node_modules/@mixmark-io/domino/lib/ContainerNode.js", "../node_modules/@mixmark-io/domino/lib/xmlnames.js", "../node_modules/@mixmark-io/domino/lib/attributes.js", "../node_modules/@mixmark-io/domino/lib/FilteredElementList.js", "../node_modules/@mixmark-io/domino/lib/DOMTokenList.js", "../node_modules/@mixmark-io/domino/lib/select.js", "../node_modules/@mixmark-io/domino/lib/ChildNode.js", "../node_modules/@mixmark-io/domino/lib/NonDocumentTypeChildNode.js", "../node_modules/@mixmark-io/domino/lib/NamedNodeMap.js", "../node_modules/@mixmark-io/domino/lib/Element.js", "../node_modules/@mixmark-io/domino/lib/Leaf.js", "../node_modules/@mixmark-io/domino/lib/CharacterData.js", "../node_modules/@mixmark-io/domino/lib/Text.js", "../node_modules/@mixmark-io/domino/lib/Comment.js", "../node_modules/@mixmark-io/domino/lib/DocumentFragment.js", "../node_modules/@mixmark-io/domino/lib/ProcessingInstruction.js", "../node_modules/@mixmark-io/domino/lib/NodeFilter.js", "../node_modules/@mixmark-io/domino/lib/NodeTraversal.js", "../node_modules/@mixmark-io/domino/lib/TreeWalker.js", "../node_modules/@mixmark-io/domino/lib/NodeIterator.js", "../node_modules/@mixmark-io/domino/lib/URL.js", "../node_modules/@mixmark-io/domino/lib/CustomEvent.js", "../node_modules/@mixmark-io/domino/lib/events.js", "../node_modules/@mixmark-io/domino/lib/style_parser.js", "../node_modules/@mixmark-io/domino/lib/CSSStyleDeclaration.js", "../node_modules/@mixmark-io/domino/lib/URLUtils.js", "../node_modules/@mixmark-io/domino/lib/defineElement.js", "../node_modules/@mixmark-io/domino/lib/htmlelts.js", "../node_modules/@mixmark-io/domino/lib/svg.js", "../node_modules/@mixmark-io/domino/lib/MutationConstants.js", "../node_modules/@mixmark-io/domino/lib/Document.js", "../node_modules/@mixmark-io/domino/lib/DocumentType.js", "../node_modules/@mixmark-io/domino/lib/HTMLParser.js", "../node_modules/@mixmark-io/domino/lib/DOMImplementation.js", "../node_modules/@mixmark-io/domino/lib/Location.js", "../node_modules/@mixmark-io/domino/lib/NavigatorID.js", "../node_modules/@mixmark-io/domino/lib/WindowTimers.js", "../node_modules/@mixmark-io/domino/lib/impl.js", "../node_modules/@mixmark-io/domino/lib/Window.js", "../node_modules/@mixmark-io/domino/lib/index.js", "../node_modules/turndown/lib/turndown.cjs.js", "../src/tools/WebFetchTool/utils.ts", "../src/tools/WebFetchTool/WebFetchTool.ts", "../src/utils/listSessionsImpl.ts", "../src/services/autoDream/consolidationLock.ts", "../src/tasks/DreamTask/DreamTask.ts", "../src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts", "../src/tasks.ts", "../src/tasks/stopTask.ts", "../src/tools/TaskStopTool/UI.tsx", "../src/tools/TaskStopTool/TaskStopTool.ts", "../src/bridge/bridgeConfig.ts", "../src/tools/BriefTool/upload.ts", "../src/tools/BriefTool/attachments.ts", "../src/tools/BriefTool/UI.tsx", "../src/tools/BriefTool/BriefTool.ts", "../src/utils/task/outputFormatting.ts", "../src/tools/TaskOutputTool/TaskOutputTool.tsx", "../src/tools/WebSearchTool/UI.tsx", "../src/tools/WebSearchTool/WebSearchTool.ts", "../src/utils/inProcessTeammateHelpers.ts", "../src/tools/ExitPlanModeTool/prompt.ts", "../src/tools/ExitPlanModeTool/UI.tsx", "../src/utils/permissions/autoModeState.ts", "../src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts", "../src/tools/testing/TestingPermissionTool.tsx", "../src/tools/TungstenTool/TungstenTool.ts", "../src/tools/AskUserQuestionTool/AskUserQuestionTool.tsx", "../src/tools/LSPTool/formatters.ts", "../src/tools/LSPTool/prompt.ts", "../src/tools/LSPTool/schemas.ts", "../src/tools/LSPTool/symbolContext.ts", "../src/tools/LSPTool/UI.tsx", "../src/tools/LSPTool/LSPTool.ts", "../src/tools/ReadMcpResourceTool/prompt.ts", "../src/tools/ReadMcpResourceTool/UI.tsx", "../src/tools/ReadMcpResourceTool/ReadMcpResourceTool.ts", "../src/utils/planModeV2.ts", "../src/tools/EnterPlanModeTool/prompt.ts", "../src/tools/EnterPlanModeTool/UI.tsx", "../src/tools/EnterPlanModeTool/EnterPlanModeTool.ts", "../src/constants/systemPromptSections.ts", "../src/tools/EnterWorktreeTool/prompt.ts", "../src/tools/EnterWorktreeTool/UI.tsx", "../src/tools/EnterWorktreeTool/EnterWorktreeTool.ts", "../src/tools/ExitWorktreeTool/prompt.ts", "../src/tools/ExitWorktreeTool/UI.tsx", "../src/tools/ExitWorktreeTool/ExitWorktreeTool.ts", "../src/tools/ConfigTool/constants.ts", "../src/utils/model/modelOptions.ts", "../src/voice/voiceModeEnabled.ts", "../src/utils/model/validateModel.ts", "../src/tools/ConfigTool/supportedSettings.ts", "../src/tools/ConfigTool/prompt.ts", "../src/tools/ConfigTool/UI.tsx", "../node_modules/ws/lib/constants.js", "../node_modules/ws/lib/buffer-util.js", "../node_modules/ws/lib/limiter.js", "../node_modules/ws/lib/permessage-deflate.js", "../node_modules/ws/lib/validation.js", "../node_modules/ws/lib/receiver.js", "../node_modules/ws/lib/sender.js", "../node_modules/ws/lib/event-target.js", "../node_modules/ws/lib/extension.js", "../node_modules/ws/lib/websocket.js", "../node_modules/ws/lib/stream.js", "../node_modules/ws/lib/subprotocol.js", "../node_modules/ws/lib/websocket-server.js", "../node_modules/ws/wrapper.mjs", "../src/services/voiceStreamSTT.ts", "../src/services/voice.ts", "../src/tools/ConfigTool/ConfigTool.ts", "../src/tools/TaskCreateTool/prompt.ts", "../src/tools/TaskCreateTool/TaskCreateTool.ts", "../src/tools/TaskGetTool/prompt.ts", "../src/tools/TaskGetTool/TaskGetTool.ts", "../src/tools/TaskUpdateTool/prompt.ts", "../src/tools/TaskUpdateTool/TaskUpdateTool.ts", "../src/tools/TaskListTool/prompt.ts", "../src/tools/TaskListTool/TaskListTool.ts", "../src/utils/worktreeModeEnabled.ts", "../src/tools/REPLTool/REPLTool.ts", "../src/tools/SuggestBackgroundPRTool/SuggestBackgroundPRTool.ts", "../src/tools/SleepTool/SleepTool.ts", "../src/tools/ScheduleCronTool/UI.tsx", "../src/tools/ScheduleCronTool/CronCreateTool.ts", "../src/tools/ScheduleCronTool/CronDeleteTool.ts", "../src/tools/ScheduleCronTool/CronListTool.ts", "../src/tools/RemoteTriggerTool/prompt.ts", "../src/tools/RemoteTriggerTool/UI.tsx", "../src/tools/RemoteTriggerTool/RemoteTriggerTool.ts", "../src/tools/MonitorTool/MonitorTool.ts", "../src/tools/SendUserFileTool/SendUserFileTool.ts", "../src/tools/PushNotificationTool/PushNotificationTool.ts", "../src/tools/SubscribePRTool/SubscribePRTool.ts", "../src/tools/TeamCreateTool/prompt.ts", "../src/tools/TeamCreateTool/UI.tsx", "../src/tools/TeamCreateTool/TeamCreateTool.ts", "../src/tools/TeamDeleteTool/prompt.ts", "../src/tools/TeamDeleteTool/UI.tsx", "../src/tools/TeamDeleteTool/TeamDeleteTool.ts", "../src/utils/concurrentSessions.ts", "../src/bridge/replBridgeHandle.ts", "../src/tasks/LocalMainSessionTask.ts", "../src/utils/peerAddress.ts", "../src/proactive/index.ts", "../src/utils/systemPrompt.ts", "../src/tools/AgentTool/resumeAgent.ts", "../src/tools/SendMessageTool/prompt.ts", "../src/tools/SendMessageTool/UI.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/bridge/peerSessions.js", "../src/tools/SendMessageTool/SendMessageTool.ts", "../src/tools/VerifyPlanExecutionTool/VerifyPlanExecutionTool.ts", "../src/tools/OverflowTestTool/OverflowTestTool.ts", "../src/tools/CtxInspectTool/CtxInspectTool.ts", "../src/tools/TerminalCaptureTool/TerminalCaptureTool.ts", "../src/tools/WebBrowserTool/WebBrowserTool.ts", "../src/tools/SnipTool/SnipTool.ts", "../src/tools/ListPeersTool/ListPeersTool.ts", "../src/tools/WorkflowTool/bundled/index.ts", "../src/tools/WorkflowTool/WorkflowTool.ts", "../src/tools.ts", "../src/utils/swarm/It2SetupPrompt.tsx", "../src/utils/swarm/teammateModel.ts", "../src/tools/shared/spawnMultiAgent.ts", "../src/tools/AgentTool/prompt.ts", "../src/tools/AgentTool/AgentTool.tsx", "../src/tools/REPLTool/primitiveTools.ts", "../src/utils/memoryFileDetection.ts", "../src/utils/teamMemoryOps.ts", "../src/tools/SnipTool/prompt.ts", "../src/utils/collapseReadSearch.ts", "../src/tasks/LocalAgentTask/LocalAgentTask.tsx", "../src/tasks/LocalShellTask/LocalShellTask.tsx", "../src/utils/codeIndexing.ts", "../src/tools/BashTool/commandSemantics.ts", "../src/services/teamMemorySync/types.ts", "../src/services/teamMemorySync/index.ts", "../src/services/teamMemorySync/watcher.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/memdir/memoryShapeTelemetry.js", "../src/utils/sessionFileAccessHooks.ts", "../src/utils/undercover.ts", "../src/utils/attributionTrailer.ts", "../src/utils/attribution.ts", "../src/tools/BashTool/prompt.ts", "../src/tools/BashTool/BashTool.tsx", "../src/tools/BashTool/bashCommandHelpers.ts", "../src/tools/BashTool/modeValidation.ts", "../src/tools/BashTool/bashPermissions.ts", "../src/utils/sessionActivity.ts", "../src/utils/stream.ts", "../src/utils/toolErrors.ts", "../src/utils/permissions/PermissionResult.ts", "../src/services/tools/toolHooks.ts", "../src/services/tools/toolExecution.ts", "../src/services/tools/StreamingToolExecutor.ts", "../src/utils/queryProfiler.ts", "../src/services/autoDream/config.ts", "../src/utils/readFileInRange.ts", "../src/memdir/memoryTypes.ts", "../src/memdir/memoryScan.ts", "../src/services/extractMemories/prompts.ts", "../src/services/extractMemories/extractMemories.ts", "../src/services/autoDream/consolidationPrompt.ts", "../src/services/autoDream/autoDream.ts", "../src/jobs/classifier.ts", "../src/utils/withResolvers.ts", "../src/utils/computerUse/computerUseLock.ts", "../../node_modules/@ant/computer-use-swift/js/index.js", "../src/utils/computerUse/swiftLoader.ts", "../src/utils/computerUse/drainRunLoop.ts", "../src/utils/computerUse/escHotkey.ts", "../../node_modules/@ant/computer-use-mcp/src/types.ts", "../../node_modules/@ant/computer-use-mcp/src/sentinelApps.ts", "../../node_modules/@ant/computer-use-mcp/src/deniedApps.ts", "../../node_modules/@ant/computer-use-mcp/src/keyBlocklist.ts", "../../node_modules/@ant/computer-use-mcp/src/imageResize.ts", "../../node_modules/@ant/computer-use-mcp/src/pixelCompare.ts", "../../node_modules/@ant/computer-use-mcp/src/toolCalls.ts", "../../node_modules/zod/v3/index.js", "../../node_modules/zod/v4/core/core.js", "../../node_modules/zod/v4/core/util.js", "../../node_modules/zod/v4/core/errors.js", "../../node_modules/zod/v4/core/parse.js", "../../node_modules/zod/v4/core/regexes.js", "../../node_modules/zod/v4/core/checks.js", "../../node_modules/zod/v4/core/doc.js", "../../node_modules/zod/v4/core/versions.js", "../../node_modules/zod/v4/core/schemas.js", "../../node_modules/zod/v4/locales/ar.js", "../../node_modules/zod/v4/locales/az.js", "../../node_modules/zod/v4/locales/be.js", "../../node_modules/zod/v4/locales/ca.js", "../../node_modules/zod/v4/locales/cs.js", "../../node_modules/zod/v4/locales/de.js", "../../node_modules/zod/v4/locales/en.js", "../../node_modules/zod/v4/locales/eo.js", "../../node_modules/zod/v4/locales/es.js", "../../node_modules/zod/v4/locales/fa.js", "../../node_modules/zod/v4/locales/fi.js", "../../node_modules/zod/v4/locales/fr.js", "../../node_modules/zod/v4/locales/fr-CA.js", "../../node_modules/zod/v4/locales/he.js", "../../node_modules/zod/v4/locales/hu.js", "../../node_modules/zod/v4/locales/id.js", "../../node_modules/zod/v4/locales/it.js", "../../node_modules/zod/v4/locales/ja.js", "../../node_modules/zod/v4/locales/kh.js", "../../node_modules/zod/v4/locales/ko.js", "../../node_modules/zod/v4/locales/mk.js", "../../node_modules/zod/v4/locales/ms.js", "../../node_modules/zod/v4/locales/nl.js", "../../node_modules/zod/v4/locales/no.js", "../../node_modules/zod/v4/locales/ota.js", "../../node_modules/zod/v4/locales/ps.js", "../../node_modules/zod/v4/locales/pl.js", "../../node_modules/zod/v4/locales/pt.js", "../../node_modules/zod/v4/locales/ru.js", "../../node_modules/zod/v4/locales/sl.js", "../../node_modules/zod/v4/locales/sv.js", "../../node_modules/zod/v4/locales/ta.js", "../../node_modules/zod/v4/locales/th.js", "../../node_modules/zod/v4/locales/tr.js", "../../node_modules/zod/v4/locales/ua.js", "../../node_modules/zod/v4/locales/ur.js", "../../node_modules/zod/v4/locales/vi.js", "../../node_modules/zod/v4/locales/zh-CN.js", "../../node_modules/zod/v4/locales/zh-TW.js", "../../node_modules/zod/v4/locales/index.js", "../../node_modules/zod/v4/core/registries.js", "../../node_modules/zod/v4/core/api.js", "../../node_modules/zod/v4/core/function.js", "../../node_modules/zod/v4/core/to-json-schema.js", "../../node_modules/zod/v4/core/index.js", "../../node_modules/zod/v4/mini/parse.js", "../../node_modules/zod/v4/mini/schemas.js", "../../node_modules/zod/v4/mini/checks.js", "../../node_modules/zod/v4/mini/iso.js", "../../node_modules/zod/v4/mini/coerce.js", "../../node_modules/zod/v4/mini/external.js", "../../node_modules/zod/v4/mini/index.js", "../../node_modules/zod/v4-mini/index.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js", "../../node_modules/zod/v4/classic/checks.js", "../../node_modules/zod/v4/classic/iso.js", "../../node_modules/zod/v4/classic/errors.js", "../../node_modules/zod/v4/classic/parse.js", "../../node_modules/zod/v4/classic/schemas.js", "../../node_modules/zod/v4/classic/compat.js", "../../node_modules/zod/v4/classic/coerce.js", "../../node_modules/zod/v4/classic/external.js", "../../node_modules/zod/v4/classic/index.js", "../../node_modules/zod/v4/index.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js", "../../node_modules/zod-to-json-schema/dist/esm/Options.js", "../../node_modules/zod-to-json-schema/dist/esm/Refs.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/array.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/branded.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/catch.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/default.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/string.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/map.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/never.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/union.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/object.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/set.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js", "../../node_modules/zod-to-json-schema/dist/esm/selectParser.js", "../../node_modules/zod-to-json-schema/dist/esm/parseDef.js", "../../node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js", "../../node_modules/zod-to-json-schema/dist/esm/index.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js", "../../node_modules/ajv/dist/compile/codegen/code.js", "../../node_modules/ajv/dist/compile/codegen/scope.js", "../../node_modules/ajv/dist/compile/codegen/index.js", "../../node_modules/ajv/dist/compile/util.js", "../../node_modules/ajv/dist/compile/names.js", "../../node_modules/ajv/dist/compile/errors.js", "../../node_modules/ajv/dist/compile/validate/boolSchema.js", "../../node_modules/ajv/dist/compile/rules.js", "../../node_modules/ajv/dist/compile/validate/applicability.js", "../../node_modules/ajv/dist/compile/validate/dataType.js", "../../node_modules/ajv/dist/compile/validate/defaults.js", "../../node_modules/ajv/dist/vocabularies/code.js", "../../node_modules/ajv/dist/compile/validate/keyword.js", "../../node_modules/ajv/dist/compile/validate/subschema.js", "../../node_modules/fast-deep-equal/index.js", "../../node_modules/json-schema-traverse/index.js", "../../node_modules/ajv/dist/compile/resolve.js", "../../node_modules/ajv/dist/compile/validate/index.js", "../../node_modules/ajv/dist/runtime/validation_error.js", "../../node_modules/ajv/dist/compile/ref_error.js", "../../node_modules/ajv/dist/compile/index.js", "../../node_modules/fast-uri/lib/utils.js", "../../node_modules/fast-uri/lib/schemes.js", "../../node_modules/fast-uri/index.js", "../../node_modules/ajv/dist/runtime/uri.js", "../../node_modules/ajv/dist/core.js", "../../node_modules/ajv/dist/vocabularies/core/id.js", "../../node_modules/ajv/dist/vocabularies/core/ref.js", "../../node_modules/ajv/dist/vocabularies/core/index.js", "../../node_modules/ajv/dist/vocabularies/validation/limitNumber.js", "../../node_modules/ajv/dist/vocabularies/validation/multipleOf.js", "../../node_modules/ajv/dist/runtime/ucs2length.js", "../../node_modules/ajv/dist/vocabularies/validation/limitLength.js", "../../node_modules/ajv/dist/vocabularies/validation/pattern.js", "../../node_modules/ajv/dist/vocabularies/validation/limitProperties.js", "../../node_modules/ajv/dist/vocabularies/validation/required.js", "../../node_modules/ajv/dist/vocabularies/validation/limitItems.js", "../../node_modules/ajv/dist/runtime/equal.js", "../../node_modules/ajv/dist/vocabularies/validation/uniqueItems.js", "../../node_modules/ajv/dist/vocabularies/validation/const.js", "../../node_modules/ajv/dist/vocabularies/validation/enum.js", "../../node_modules/ajv/dist/vocabularies/validation/index.js", "../../node_modules/ajv/dist/vocabularies/applicator/additionalItems.js", "../../node_modules/ajv/dist/vocabularies/applicator/items.js", "../../node_modules/ajv/dist/vocabularies/applicator/prefixItems.js", "../../node_modules/ajv/dist/vocabularies/applicator/items2020.js", "../../node_modules/ajv/dist/vocabularies/applicator/contains.js", "../../node_modules/ajv/dist/vocabularies/applicator/dependencies.js", "../../node_modules/ajv/dist/vocabularies/applicator/propertyNames.js", "../../node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js", "../../node_modules/ajv/dist/vocabularies/applicator/properties.js", "../../node_modules/ajv/dist/vocabularies/applicator/patternProperties.js", "../../node_modules/ajv/dist/vocabularies/applicator/not.js", "../../node_modules/ajv/dist/vocabularies/applicator/anyOf.js", "../../node_modules/ajv/dist/vocabularies/applicator/oneOf.js", "../../node_modules/ajv/dist/vocabularies/applicator/allOf.js", "../../node_modules/ajv/dist/vocabularies/applicator/if.js", "../../node_modules/ajv/dist/vocabularies/applicator/thenElse.js", "../../node_modules/ajv/dist/vocabularies/applicator/index.js", "../../node_modules/ajv/dist/vocabularies/format/format.js", "../../node_modules/ajv/dist/vocabularies/format/index.js", "../../node_modules/ajv/dist/vocabularies/metadata.js", "../../node_modules/ajv/dist/vocabularies/draft7.js", "../../node_modules/ajv/dist/vocabularies/discriminator/types.js", "../../node_modules/ajv/dist/vocabularies/discriminator/index.js", "../../node_modules/ajv/dist/ajv.js", "../../node_modules/ajv-formats/dist/formats.js", "../../node_modules/ajv-formats/dist/limit.js", "../../node_modules/ajv-formats/dist/index.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js", "../../node_modules/@ant/computer-use-mcp/src/tools.ts", "../../node_modules/@ant/computer-use-mcp/src/mcpServer.ts", "../../node_modules/@ant/computer-use-mcp/src/index.ts", "../../node_modules/@ant/computer-use-input/js/index.js", "../src/utils/computerUse/inputLoader.ts", "../src/utils/computerUse/executor.ts", "../src/utils/computerUse/cleanup.ts", "../src/query/stopHooks.ts", "../src/query/config.ts", "../src/query/deps.ts", "../src/utils/tokenBudget.ts", "../src/query/tokenBudget.ts", "../src/services/compact/reactiveCompact.ts", "../src/services/contextCollapse/index.ts", "../src/services/skillSearch/prefetch.ts", "../src/utils/taskSummary.ts", "../src/query.ts", "../src/services/api/emptyUsage.ts", "../src/services/api/logging.ts", "../src/utils/permissions/denialTracking.ts", "../src/utils/forkedAgent.ts", "../src/utils/memory/types.ts", "../src/services/internalLogging.ts", "../src/services/compact/grouping.ts", "../src/services/compact/prompt.ts", "../src/services/sessionTranscript/sessionTranscript.ts", "../src/services/compact/compact.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/utils/attributionHooks.js", "../src/services/compact/postCompactCleanup.ts", "../src/services/SessionMemory/prompts.ts", "../src/services/compact/sessionMemoryCompact.ts", "../src/services/compact/autoCompact.ts", "../src/utils/analyzeContext.ts", "../src/utils/zodToJsonSchema.ts", "../src/utils/toolSearch.ts", "../src/services/vcr.ts", "../src/services/tokenEstimation.ts", "../src/utils/pdf.ts", "../src/tools/FileReadTool/limits.ts", "../src/tools/FileReadTool/UI.tsx", "../src/tools/FileReadTool/FileReadTool.ts", "../src/types/textInputTypes.ts", "../src/utils/mcpInstructionsDelta.ts", "../src/utils/claudeInChrome/prompt.ts", "../src/utils/hooks/hookEvents.ts", "../src/utils/hooks/AsyncHookRegistry.ts", "../src/utils/messagePredicates.ts", "../src/memdir/findRelevantMemories.ts", "../src/utils/attachments.ts", "../src/utils/plugins/loadPluginCommands.ts", "../src/utils/plugins/zipCache.ts", "../src/utils/plugins/cacheUtils.ts", "../src/utils/plugins/marketplaceHelpers.ts", "../src/utils/plugins/officialMarketplaceGcs.ts", "../src/utils/plugins/marketplaceManager.ts", "../src/utils/plugins/installedPluginsManager.ts", "../src/utils/plugins/managedPlugins.ts", "../src/utils/plugins/pluginVersioning.ts", "../src/utils/plugins/pluginInstallationHelpers.ts", "../src/utils/plugins/pluginLoader.ts", "../src/utils/plugins/loadPluginOutputStyles.ts", "../src/outputStyles/loadOutputStylesDir.ts", "../src/constants/outputStyles.ts", "../src/utils/messages.ts", "../src/components/messageActions.tsx", "../src/components/CtrlOToExpand.tsx", "../src/utils/terminal.ts", "../src/tools/ListMcpResourcesTool/prompt.ts", "../src/tools/ListMcpResourcesTool/UI.tsx", "../src/tools/ListMcpResourcesTool/ListMcpResourcesTool.ts", "../src/tools/MCPTool/prompt.ts", "../src/components/design-system/ProgressBar.tsx", "../src/utils/mcpValidation.ts", "../src/tools/MCPTool/UI.tsx", "../src/tools/MCPTool/MCPTool.ts", "../node_modules/cssfilter/lib/default.js", "../node_modules/cssfilter/lib/util.js", "../node_modules/cssfilter/lib/parser.js", "../node_modules/cssfilter/lib/css.js", "../node_modules/cssfilter/lib/index.js", "../node_modules/xss/lib/util.js", "../node_modules/xss/lib/default.js", "../node_modules/xss/lib/parser.js", "../node_modules/xss/lib/xss.js", "../node_modules/xss/lib/index.js", "../src/services/mcp/oauthPort.ts", "../src/services/mcp/xaa.ts", "../src/services/mcp/xaaIdpLogin.ts", "../src/services/mcp/auth.ts", "../src/tools/McpAuthTool/McpAuthTool.ts", "../src/utils/mcpWebSocketTransport.ts", "../src/utils/sanitization.ts", "../src/services/mcp/elicitationHandler.ts", "../src/tools/MCPTool/classifyForCollapse.ts", "../src/services/mcp/headersHelper.ts", "../src/services/mcp/SdkControlTransport.ts", "../src/skills/mcpSkills.ts", "../src/utils/claudeInChrome/toolRendering.tsx", "../src/components/permissions/ComputerUseApproval/ComputerUseApproval.tsx", "../src/utils/computerUse/gates.ts", "../src/utils/computerUse/hostAdapter.ts", "../src/utils/computerUse/toolRendering.tsx", "../src/utils/computerUse/wrapper.tsx", "../../node_modules/ws/lib/constants.js", "../../node_modules/ws/lib/buffer-util.js", "../../node_modules/ws/lib/limiter.js", "../../node_modules/ws/lib/permessage-deflate.js", "../../node_modules/ws/lib/validation.js", "../../node_modules/ws/lib/receiver.js", "../../node_modules/ws/lib/sender.js", "../../node_modules/ws/lib/event-target.js", "../../node_modules/ws/lib/extension.js", "../../node_modules/ws/lib/websocket.js", "../../node_modules/ws/lib/stream.js", "../../node_modules/ws/lib/subprotocol.js", "../../node_modules/ws/lib/websocket-server.js", "../../node_modules/ws/wrapper.mjs", "../../node_modules/@ant/claude-for-chrome-mcp/src/mcpSocketClient.ts", "../../node_modules/@ant/claude-for-chrome-mcp/src/types.ts", "../../node_modules/@ant/claude-for-chrome-mcp/src/bridgeClient.ts", "../../node_modules/@ant/claude-for-chrome-mcp/src/browserTools.ts", "../../node_modules/@ant/claude-for-chrome-mcp/src/mcpSocketPool.ts", "../../node_modules/@ant/claude-for-chrome-mcp/src/toolCalls.ts", "../../node_modules/@ant/claude-for-chrome-mcp/src/mcpServer.ts", "../../node_modules/@ant/claude-for-chrome-mcp/src/index.ts", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js", "../src/services/analytics/sink.ts", "../src/utils/claudeInChrome/mcpServer.ts", "../src/services/mcp/InProcessTransport.ts", "../src/utils/computerUse/appNames.ts", "../src/utils/computerUse/mcpServer.ts", "../src/services/mcp/client.ts", "../src/utils/api.ts", "../src/services/compact/apiMicrocompact.ts", "../src/utils/contentArray.ts", "../src/services/api/claude.ts", "../src/utils/shell/prefix.ts", "../src/utils/bash/commands.ts", "../src/tools/BashTool/shouldUseSandbox.ts", "../src/tools/TerminalCaptureTool/prompt.ts", "../src/tools/VerifyPlanExecutionTool/constants.ts", "../src/utils/permissions/classifierDecision.ts", "../src/utils/permissions/permissions.ts", "../src/utils/permissions/permissionSetup.ts", "../src/utils/settings/applySettingsChange.ts", "../src/state/AppState.tsx", "../src/context/notifications.tsx", "../src/hooks/useClipboardImageHint.ts", "../src/components/PromptInput/inputModes.ts", "../src/projectOnboardingState.ts", "../src/utils/appleTerminalBackup.ts", "../src/utils/completionCache.ts", "../src/commands/terminalSetup/terminalSetup.tsx", "../src/utils/pasteStore.ts", "../src/history.ts", "../src/utils/Cursor.ts", "../src/utils/modifiers.ts", "../src/hooks/useTextInput.ts", "../src/hooks/renderPlaceholder.ts", "../src/hooks/usePasteHandler.ts", "../src/utils/textHighlighting.ts", "../src/components/PromptInput/ShimmeredInput.tsx", "../src/components/BaseTextInput.tsx", "../src/components/TextInput.tsx", "../src/utils/suggestions/directoryCompletion.ts", "../src/components/PromptInput/PromptInputFooterSuggestions.tsx", "../src/components/permissions/rules/AddWorkspaceDirectory.tsx", "../src/commands/add-dir/add-dir.tsx", "../src/commands/add-dir/index.ts", "../src/commands/autofix-pr/index.js", "../src/commands/backfill-sessions/index.js", "../src/ink/components/ScrollBox.tsx", "../src/utils/sideQuestion.ts", "../src/commands/btw/btw.tsx", "../src/commands/btw/index.ts", "../src/commands/good-claude/index.js", "../src/commands/issue/index.js", "../src/components/Feedback.tsx", "../src/commands/feedback/feedback.tsx", "../src/commands/feedback/index.ts", "../src/native-ts/file-index/index.ts", "../src/hooks/fileSuggestions.ts", "../src/services/MagicDocs/prompts.ts", "../src/services/MagicDocs/magicDocs.ts", "../src/commands/clear/caches.ts", "../src/commands/clear/conversation.ts", "../src/commands/clear/clear.ts", "../src/commands/clear/index.ts", "../src/commands/color/color.ts", "../src/commands/color/index.ts", "../src/commands/commit.ts", "../src/commands/copy/copy.tsx", "../src/commands/copy/index.ts", "../src/utils/desktopDeepLink.ts", "../src/components/design-system/LoadingState.tsx", "../src/components/DesktopHandoff.tsx", "../src/commands/desktop/desktop.tsx", "../src/commands/desktop/index.ts", "../src/commands/commit-push-pr.ts", "../src/commands/compact/compact.ts", "../src/commands/compact/index.ts", "../src/components/design-system/Tabs.tsx", "../src/components/Settings/Status.tsx", "../src/components/ThemePicker.tsx", "../src/components/EffortIndicator.ts", "../src/components/ModelPicker.tsx", "../src/utils/extraUsage.ts", "../src/components/ClaudeMdExternalIncludesDialog.tsx", "../src/components/ChannelDowngradeDialog.tsx", "../src/components/OutputStylePicker.tsx", "../src/components/LanguagePicker.tsx", "../src/components/SearchBox.tsx", "../src/hooks/useSearchInput.ts", "../src/components/Settings/Config.tsx", "../src/components/LogoV2/OverageCreditUpsell.tsx", "../src/components/Settings/Usage.tsx", "../src/components/Settings/Settings.tsx", "../src/commands/config/config.tsx", "../src/commands/config/index.ts", "../src/utils/contextSuggestions.ts", "../src/components/design-system/StatusIcon.tsx", "../src/components/ContextSuggestions.tsx", "../src/components/ContextVisualization.tsx", "../src/utils/staticRender.tsx", "../src/services/contextCollapse/operations.ts", "../src/commands/context/context.tsx", "../src/commands/context/context-noninteractive.ts", "../src/commands/context/index.ts", "../src/commands/cost/cost.ts", "../src/commands/cost/index.ts", "../src/hooks/useDiffData.ts", "../src/hooks/useTurnDiffs.ts", "../src/components/diff/DiffDetailView.tsx", "../src/components/diff/DiffFileList.tsx", "../src/components/diff/DiffDialog.tsx", "../src/commands/diff/diff.tsx", "../src/commands/diff/index.ts", "../src/commands/ctx_viz/index.js", "../src/components/KeybindingWarnings.tsx", "../src/components/mcp/McpParsingWarnings.tsx", "../src/components/PressEnterToContinue.tsx", "../src/components/sandbox/SandboxDoctorSection.tsx", "../src/utils/treeify.ts", "../src/components/ValidationErrorsList.tsx", "../src/hooks/notifs/useSettingsErrors.tsx", "../src/utils/permissions/shadowedRuleDetection.ts", "../src/utils/statusNoticeHelpers.ts", "../src/utils/doctorContextWarnings.ts", "../src/screens/Doctor.tsx", "../src/commands/doctor/doctor.tsx", "../src/commands/doctor/index.ts", "../src/utils/memory/versions.ts", "../src/components/memory/MemoryFileSelector.tsx", "../src/components/memory/MemoryUpdateNotification.tsx", "../src/utils/editor.ts", "../src/utils/promptEditor.ts", "../src/commands/memory/memory.tsx", "../src/commands/memory/index.ts", "../src/components/HelpV2/Commands.tsx", "../src/components/PromptInput/utils.ts", "../src/components/PromptInput/PromptInputHelpMenu.tsx", "../src/components/HelpV2/General.tsx", "../src/components/HelpV2/HelpV2.tsx", "../src/commands/help/help.tsx", "../src/commands/help/index.ts", "../src/components/IdeAutoConnectDialog.tsx", "../src/commands/ide/ide.tsx", "../src/commands/ide/index.ts", "../src/commands/init.ts", "../src/commands/init-verifiers.ts", "../src/keybindings/template.ts", "../src/commands/keybindings/keybindings.ts", "../src/commands/keybindings/index.ts", "../src/commands/login/index.ts", "../src/commands/logout/index.ts", "../src/components/WorkflowMultiselectDialog.tsx", "../src/constants/github-app.ts", "../src/commands/install-github-app/ApiKeyStep.tsx", "../src/commands/install-github-app/CheckExistingSecretStep.tsx", "../src/commands/install-github-app/CheckGitHubStep.tsx", "../src/commands/install-github-app/ChooseRepoStep.tsx", "../src/commands/install-github-app/CreatingStep.tsx", "../src/commands/install-github-app/ErrorStep.tsx", "../src/commands/install-github-app/ExistingWorkflowStep.tsx", "../src/commands/install-github-app/InstallAppStep.tsx", "../src/commands/install-github-app/OAuthFlowStep.tsx", "../src/commands/install-github-app/SuccessStep.tsx", "../src/commands/install-github-app/setupGitHubActions.ts", "../src/commands/install-github-app/WarningsStep.tsx", "../src/commands/install-github-app/install-github-app.tsx", "../src/commands/install-github-app/index.ts", "../src/commands/install-slack-app/install-slack-app.ts", "../src/commands/install-slack-app/index.ts", "../src/commands/break-cache/index.js", "../src/components/mcp/MCPAgentServerMenu.tsx", "../src/components/mcp/MCPListPanel.tsx", "../src/services/mcp/channelAllowlist.ts", "../src/services/mcp/channelNotification.ts", "../src/services/mcp/channelPermissions.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/localSearch.js", "../src/services/mcp/useManageMCPConnections.ts", "../src/services/mcp/MCPConnectionManager.tsx", "../src/components/mcp/MCPReconnect.tsx", "../src/components/mcp/CapabilitiesSection.tsx", "../src/components/mcp/utils/reconnectHelpers.tsx", "../src/components/mcp/MCPRemoteServerMenu.tsx", "../src/components/mcp/MCPStdioServerMenu.tsx", "../src/components/mcp/MCPToolDetailView.tsx", "../src/components/mcp/MCPToolListView.tsx", "../src/components/mcp/MCPSettings.tsx", "../src/components/mcp/index.ts", "../src/utils/plugins/pluginStartupCheck.ts", "../src/utils/plugins/parseMarketplaceInput.ts", "../src/commands/plugin/AddMarketplace.tsx", "../src/utils/plugins/installCounts.ts", "../src/commands/plugin/PluginOptionsDialog.tsx", "../src/commands/plugin/PluginOptionsFlow.tsx", "../src/commands/plugin/PluginTrustWarning.tsx", "../src/commands/plugin/pluginDetailsHelpers.tsx", "../src/commands/plugin/usePagination.ts", "../src/commands/plugin/BrowseMarketplace.tsx", "../src/commands/plugin/DiscoverPlugins.tsx", "../src/services/plugins/pluginOperations.ts", "../src/utils/plugins/pluginAutoupdate.ts", "../src/commands/plugin/ManageMarketplaces.tsx", "../src/utils/plugins/pluginFlagging.ts", "../src/commands/plugin/PluginErrors.tsx", "../src/commands/plugin/UnifiedInstalledCell.tsx", "../src/commands/plugin/ManagePlugins.tsx", "../src/commands/plugin/parseArgs.ts", "../src/utils/plugins/validatePlugin.ts", "../src/commands/plugin/ValidatePlugin.tsx", "../src/commands/plugin/PluginSettings.tsx", "../src/commands/mcp/mcp.tsx", "../src/commands/mcp/index.ts", "../node_modules/qrcode/lib/can-promise.js", "../node_modules/qrcode/lib/core/utils.js", "../node_modules/qrcode/lib/core/error-correction-level.js", "../node_modules/qrcode/lib/core/bit-buffer.js", "../node_modules/qrcode/lib/core/bit-matrix.js", "../node_modules/qrcode/lib/core/alignment-pattern.js", "../node_modules/qrcode/lib/core/finder-pattern.js", "../node_modules/qrcode/lib/core/mask-pattern.js", "../node_modules/qrcode/lib/core/error-correction-code.js", "../node_modules/qrcode/lib/core/galois-field.js", "../node_modules/qrcode/lib/core/polynomial.js", "../node_modules/qrcode/lib/core/reed-solomon-encoder.js", "../node_modules/qrcode/lib/core/version-check.js", "../node_modules/qrcode/lib/core/regex.js", "../node_modules/qrcode/lib/core/mode.js", "../node_modules/qrcode/lib/core/version.js", "../node_modules/qrcode/lib/core/format-info.js", "../node_modules/qrcode/lib/core/numeric-data.js", "../node_modules/qrcode/lib/core/alphanumeric-data.js", "../node_modules/qrcode/lib/core/byte-data.js", "../node_modules/qrcode/lib/core/kanji-data.js", "../node_modules/dijkstrajs/dijkstra.js", "../node_modules/qrcode/lib/core/segments.js", "../node_modules/qrcode/lib/core/qrcode.js", "../node_modules/pngjs/lib/chunkstream.js", "../node_modules/pngjs/lib/interlace.js", "../node_modules/pngjs/lib/paeth-predictor.js", "../node_modules/pngjs/lib/filter-parse.js", "../node_modules/pngjs/lib/filter-parse-async.js", "../node_modules/pngjs/lib/constants.js", "../node_modules/pngjs/lib/crc.js", "../node_modules/pngjs/lib/parser.js", "../node_modules/pngjs/lib/bitmapper.js", "../node_modules/pngjs/lib/format-normaliser.js", "../node_modules/pngjs/lib/parser-async.js", "../node_modules/pngjs/lib/bitpacker.js", "../node_modules/pngjs/lib/filter-pack.js", "../node_modules/pngjs/lib/packer.js", "../node_modules/pngjs/lib/packer-async.js", "../node_modules/pngjs/lib/sync-inflate.js", "../node_modules/pngjs/lib/sync-reader.js", "../node_modules/pngjs/lib/filter-parse-sync.js", "../node_modules/pngjs/lib/parser-sync.js", "../node_modules/pngjs/lib/packer-sync.js", "../node_modules/pngjs/lib/png-sync.js", "../node_modules/pngjs/lib/png.js", "../node_modules/qrcode/lib/renderer/utils.js", "../node_modules/qrcode/lib/renderer/png.js", "../node_modules/qrcode/lib/renderer/utf8.js", "../node_modules/qrcode/lib/renderer/terminal/terminal.js", "../node_modules/qrcode/lib/renderer/terminal/terminal-small.js", "../node_modules/qrcode/lib/renderer/terminal.js", "../node_modules/qrcode/lib/renderer/svg-tag.js", "../node_modules/qrcode/lib/renderer/svg.js", "../node_modules/qrcode/lib/renderer/canvas.js", "../node_modules/qrcode/lib/browser.js", "../node_modules/qrcode/lib/server.js", "../src/commands/mobile/mobile.tsx", "../src/commands/mobile/index.ts", "../src/commands/onboarding/index.js", "../src/commands/createMovedToPluginCommand.ts", "../src/commands/pr_comments/index.ts", "../src/utils/releaseNotes.ts", "../src/commands/release-notes/release-notes.ts", "../src/commands/release-notes/index.ts", "../src/utils/sessionTitle.ts", "../src/commands/rename/generateSessionName.ts", "../src/bridge/debugUtils.ts", "../src/bridge/createSession.ts", "../src/commands/rename/rename.ts", "../src/commands/rename/index.ts", "../src/utils/getWorktreePaths.ts", "../src/utils/set.ts", "../src/utils/collapseBackgroundBashNotifications.ts", "../src/utils/collapseHookSummaries.ts", "../src/utils/collapseTeammateShutdowns.ts", "../src/utils/groupToolUses.ts", "../src/utils/transcriptSearch.ts", "../src/utils/logoV2Utils.ts", "../src/components/LogoV2/Clawd.tsx", "../src/components/LogoV2/Feed.tsx", "../src/components/LogoV2/FeedColumn.tsx", "../src/services/api/referral.ts", "../src/components/LogoV2/feedConfigs.tsx", "../src/components/LogoV2/AnimatedClawd.tsx", "../src/components/LogoV2/GuestPassesUpsell.tsx", "../src/components/LogoV2/CondensedLogo.tsx", "../src/components/LogoV2/EmergencyTip.tsx", "../src/components/LogoV2/AnimatedAsterisk.tsx", "../src/components/LogoV2/Opus1mMergeNotice.tsx", "../src/components/LogoV2/VoiceModeNotice.tsx", "../src/components/LogoV2/ChannelsNotice.tsx", "../src/components/LogoV2/LogoV2.tsx", "../src/components/MessageModel.tsx", "../src/components/MessageTimestamp.tsx", "../src/components/MessageRow.tsx", "../src/components/messages/nullRenderingAttachments.ts", "../src/utils/statusNoticeDefinitions.tsx", "../src/components/StatusNotices.tsx", "../src/hooks/useVirtualScroll.ts", "../src/context/promptOverlayContext.tsx", "../src/components/FullscreenLayout.tsx", "../src/components/VirtualMessageList.tsx", "../src/components/Messages.tsx", "../src/components/SessionPreview.tsx", "../src/components/TagTabs.tsx", "../src/components/ui/TreeSelect.tsx", "../src/components/LogSelector.tsx", "../src/utils/agenticSessionSearch.ts", "../src/utils/crossProjectResume.ts", "../src/commands/resume/resume.tsx", "../src/commands/resume/index.ts", "../src/commands/review/ultrareviewEnabled.ts", "../src/services/api/ultrareviewQuota.ts", "../src/commands/review/reviewRemote.ts", "../src/commands/review/UltrareviewOverageDialog.tsx", "../src/commands/review/ultrareviewCommand.tsx", "../src/commands/review.ts", "../src/commands/session/session.tsx", "../src/commands/session/index.ts", "../src/commands/share/index.js", "../src/components/skills/SkillsMenu.tsx", "../src/commands/skills/skills.tsx", "../src/commands/skills/index.ts", "../src/commands/status/status.tsx", "../src/commands/status/index.ts", "../src/state/teammateViewHelpers.ts", "../src/bridge/types.ts", "../src/utils/ultraplan/ccrSession.ts", "stub-txt:../utils/ultraplan/prompt.txt", "../src/commands/ultraplan.tsx", "../src/components/tasks/renderToolActivity.tsx", "../src/components/tasks/taskStatusUtils.tsx", "../src/components/tasks/AsyncAgentDetailDialog.tsx", "../src/components/tasks/RemoteSessionProgress.tsx", "../src/components/tasks/ShellProgress.tsx", "../src/components/tasks/BackgroundTask.tsx", "../src/components/tasks/DreamDetailDialog.tsx", "../src/components/tasks/InProcessTeammateDetailDialog.tsx", "../src/utils/messages/mappers.ts", "../src/components/tasks/RemoteSessionDetailDialog.tsx", "../src/components/tasks/ShellDetailDialog.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/tasks/WorkflowDetailDialog.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/tasks/MonitorMcpDetailDialog.js", "../src/components/tasks/BackgroundTasksDialog.tsx", "../src/commands/tasks/tasks.tsx", "../src/commands/tasks/index.ts", "../src/commands/teleport/index.js", "../src/commands/security-review.ts", "../src/commands/bughunter/index.js", "../src/commands/terminalSetup/index.ts", "../src/commands/usage/usage.tsx", "../src/commands/usage/index.ts", "../src/commands/theme/theme.tsx", "../src/commands/theme/index.ts", "../src/commands/vim/vim.ts", "../src/commands/vim/index.ts", "../src/commands/thinkback/thinkback.tsx", "../src/commands/thinkback/index.ts", "../src/commands/thinkback-play/thinkback-play.ts", "../src/commands/thinkback-play/index.ts", "../src/utils/autoModeDenials.ts", "../src/components/permissions/rules/PermissionRuleDescription.tsx", "../src/components/permissions/rules/AddPermissionRules.tsx", "../src/components/permissions/rules/PermissionRuleInput.tsx", "../src/components/permissions/rules/RecentDenialsTab.tsx", "../src/components/permissions/rules/RemoveWorkspaceDirectory.tsx", "../src/components/permissions/rules/WorkspaceTab.tsx", "../src/components/permissions/rules/PermissionRuleList.tsx", "../src/commands/permissions/permissions.tsx", "../src/commands/permissions/index.ts", "../src/commands/plan/plan.tsx", "../src/commands/plan/index.ts", "../src/utils/immediateCommand.ts", "../src/components/FastIcon.tsx", "../src/commands/fast/fast.tsx", "../src/commands/fast/index.ts", "../src/components/Passes/Passes.tsx", "../src/commands/passes/passes.tsx", "../src/commands/passes/index.ts", "../src/components/grove/Grove.tsx", "../src/commands/privacy-settings/privacy-settings.tsx", "../src/commands/privacy-settings/index.ts", "../src/utils/hooks/hooksConfigManager.ts", "../src/components/hooks/SelectEventMode.tsx", "../src/components/hooks/SelectHookMode.tsx", "../src/components/hooks/SelectMatcherMode.tsx", "../src/components/hooks/ViewHookMode.tsx", "../src/components/hooks/HooksConfigMenu.tsx", "../src/commands/hooks/hooks.tsx", "../src/commands/hooks/index.ts", "../src/commands/files/files.ts", "../src/commands/files/index.ts", "../src/commands/branch/branch.ts", "../src/commands/branch/index.ts", "../src/utils/toolPool.ts", "../src/hooks/useMergedTools.ts", "../src/tools/AgentTool/agentDisplay.ts", "../src/components/agents/types.ts", "../src/components/agents/agentFileUtils.ts", "../src/components/agents/AgentDetail.tsx", "../src/components/agents/ColorPicker.tsx", "../src/components/agents/ModelSelector.tsx", "../src/components/agents/ToolSelector.tsx", "../src/components/agents/utils.ts", "../src/components/agents/AgentEditor.tsx", "../src/components/agents/AgentNavigationFooter.tsx", "../src/components/agents/AgentsList.tsx", "../src/components/wizard/WizardProvider.tsx", "../src/components/wizard/useWizard.ts", "../src/components/wizard/WizardNavigationFooter.tsx", "../src/components/wizard/WizardDialogLayout.tsx", "../src/components/wizard/index.ts", "../src/components/agents/new-agent-creation/wizard-steps/ColorStep.tsx", "../src/components/agents/validateAgent.ts", "../src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.tsx", "../src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsx", "../src/components/agents/generateAgent.ts", "../src/components/agents/new-agent-creation/wizard-steps/GenerateStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/LocationStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/MethodStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/ModelStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/PromptStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/TypeStep.tsx", "../src/components/agents/new-agent-creation/CreateAgentWizard.tsx", "../src/components/agents/AgentsMenu.tsx", "../src/commands/agents/agents.tsx", "../src/commands/agents/index.ts", "../src/commands/plugin/plugin.tsx", "../src/commands/plugin/index.tsx", "../src/services/settingsSync/types.ts", "../src/services/settingsSync/index.ts", "../src/utils/plugins/refresh.ts", "../src/commands/reload-plugins/reload-plugins.ts", "../src/commands/reload-plugins/index.ts", "../src/commands/rewind/rewind.ts", "../src/commands/rewind/index.ts", "../src/utils/heapDumpService.ts", "../src/commands/heapdump/heapdump.ts", "../src/commands/heapdump/index.ts", "../src/commands/mock-limits/index.js", "../src/bridge/bridgeApi.ts", "../src/bridge/bridgeDebug.ts", "../src/commands/bridge-kick.ts", "../src/commands/version.ts", "../src/commands/summary/index.js", "../src/commands/reset-limits/index.js", "../src/commands/ant-trace/index.js", "../src/commands/perf-issue/index.js", "../src/components/sandbox/SandboxConfigTab.tsx", "../src/components/sandbox/SandboxDependenciesTab.tsx", "../src/components/sandbox/SandboxOverridesTab.tsx", "../src/components/sandbox/SandboxSettings.tsx", "../src/commands/sandbox-toggle/sandbox-toggle.tsx", "../src/commands/sandbox-toggle/index.ts", "../src/utils/claudeInChrome/setupPortable.ts", "../src/utils/claudeInChrome/setup.ts", "../src/commands/chrome/chrome.tsx", "../src/commands/chrome/index.ts", "../src/commands/stickers/stickers.ts", "../src/commands/stickers/index.ts", "../src/commands/advisor.ts", "../src/skills/bundledSkills.ts", "../src/commands/env/index.js", "../src/components/WorktreeExitDialog.tsx", "../src/components/ExitFlow.tsx", "../src/commands/exit/exit.tsx", "../src/commands/exit/index.ts", "../src/components/ExportDialog.tsx", "../src/utils/exportRenderer.tsx", "../src/commands/export/export.tsx", "../src/commands/export/index.ts", "../src/commands/model/model.tsx", "../src/commands/model/index.ts", "../src/commands/tag/tag.tsx", "../src/commands/tag/index.ts", "../src/commands/output-style/output-style.tsx", "../src/commands/output-style/index.ts", "../src/utils/teleport/environmentSelection.ts", "../src/components/RemoteEnvironmentDialog.tsx", "../src/commands/remote-env/remote-env.tsx", "../src/commands/remote-env/index.ts", "../src/commands/upgrade/upgrade.tsx", "../src/commands/upgrade/index.ts", "../src/commands/rate-limit-options/rate-limit-options.tsx", "../src/commands/rate-limit-options/index.ts", "../src/commands/statusline.tsx", "../src/commands/effort/effort.tsx", "../src/commands/effort/index.ts", "../node_modules/asciichart/asciichart.js", "../src/utils/statsCache.ts", "../src/utils/heatmap.ts", "../src/utils/ansiToSvg.ts", "../src/utils/ansiToPng.ts", "../src/utils/screenshotClipboard.ts", "../src/utils/stats.ts", "../src/components/Stats.tsx", "../src/commands/stats/stats.tsx", "../src/commands/stats/index.ts", "../src/commands/oauth-refresh/index.js", "../src/commands/debug-tool-call/index.js", "../src/types/command.ts", "../src/commands/agents-platform/index.ts", "../src/commands/proactive.ts", "../src/commands/brief.ts", "../src/commands/assistant/index.ts", "../src/bridge/envLessBridgeConfig.ts", "../src/components/RemoteCallout.tsx", "../src/assistant/index.ts", "../src/commands/bridge/bridge.tsx", "../src/commands/bridge/index.ts", "../src/commands/remoteControlServer/index.ts", "../src/services/voiceKeyterms.ts", "../src/hooks/useVoice.ts", "../src/commands/voice/voice.ts", "../src/commands/voice/index.ts", "../src/commands/force-snip.ts", "../src/commands/workflows/index.ts", "../src/utils/github/ghAuthStatus.ts", "../src/commands/remote-setup/api.ts", "../src/commands/remote-setup/remote-setup.tsx", "../src/commands/remote-setup/index.ts", "../src/commands/subscribe-pr.ts", "../src/commands/torch.ts", "../src/commands/peers/index.ts", "../src/commands/fork/index.ts", "../src/commands/buddy/index.ts", "../src/commands/insights.ts", "../src/tools/WorkflowTool/createWorkflowCommand.ts", "../src/commands.ts", "../src/utils/sessionStorage.ts", "../src/memdir/teamMemPrompts.ts", "../src/memdir/memdir.ts", "../src/tools/AgentTool/agentMemory.ts", "../src/utils/permissions/filesystem.ts", "../src/utils/task/diskOutput.ts", "../src/Task.ts", "../src/utils/ShellCommand.ts", "../src/types/hooks.ts", "../src/utils/combinedAbortSignal.ts", "../src/utils/hooks/hookHelpers.ts", "../src/utils/hooks/execPromptHook.ts", "../src/utils/hooks/execAgentHook.ts", "../src/utils/hooks/ssrfGuard.ts", "../src/utils/hooks/execHttpHook.ts", "../src/utils/hooks.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/utils/postCommitAttribution.js", "../src/utils/worktree.ts", "../src/constants/cyberRiskInstruction.ts", "../src/services/compact/cachedMCConfig.ts", "../src/tools/DiscoverSkillsTool/prompt.ts", "../src/constants/prompts.ts", "../node_modules/zod/index.js", "../src/utils/claudeInChrome/chromeNativeHost.ts", "../src/daemon/workerRegistry.ts", "../src/bridge/bridgeUI.ts", "../src/bridge/capacityWake.ts", "../src/bridge/jwtUtils.ts", "../src/bridge/pollConfigDefaults.ts", "../src/bridge/pollConfig.ts", "../src/bridge/sessionRunner.ts", "../src/bridge/workSecret.ts", "../src/bridge/bridgePointer.ts", "../src/utils/errorLogSink.ts", "../src/utils/sinks.ts", "../src/bridge/bridgeMain.ts", "../src/daemon/main.ts", "../src/cli/bg.ts", "../src/cli/handlers/templateJobs.ts", "../src/environment-runner/main.ts", "../src/self-hosted-runner/main.ts", "../node_modules/commander/lib/error.js", "../node_modules/commander/lib/argument.js", "../node_modules/commander/lib/help.js", "../node_modules/commander/lib/option.js", "../node_modules/commander/lib/suggestSimilar.js", "../node_modules/commander/lib/command.js", "../node_modules/commander/index.js", "../node_modules/@commander-js/extra-typings/index.js", "../node_modules/@commander-js/extra-typings/esm.mjs", "../src/utils/apiPreconnect.ts", "../src/utils/caCertsConfig.ts", "../src/utils/managedEnv.ts", "../src/upstreamproxy/relay.ts", "../src/upstreamproxy/upstreamproxy.ts", "../src/components/InvalidConfigDialog.tsx", "../src/entrypoints/init.ts", "../src/context/fpsMetrics.tsx", "../src/context/stats.tsx", "../src/utils/sessionState.ts", "../src/state/onChangeAppState.ts", "../src/components/App.tsx", "../src/ink/hooks/use-search-highlight.ts", "../src/components/CostThresholdDialog.tsx", "../src/components/IdleReturnDialog.tsx", "../src/services/preventSleep.ts", "../src/utils/QueryGuard.ts", "../src/components/permissions/WorkerBadge.tsx", "../src/components/permissions/WorkerPendingPermission.tsx", "../src/hooks/useLogMessages.ts", "../src/bridge/bridgePermissionCallbacks.ts", "../src/bridge/inboundMessages.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/utils/udsMessaging.js", "../src/utils/messages/systemInit.ts", "../src/utils/controlMessageCompat.ts", "../src/bridge/bridgeMessaging.ts", "../src/cli/transports/SerialBatchEventUploader.ts", "../src/cli/transports/WebSocketTransport.ts", "../src/cli/transports/HybridTransport.ts", "../src/cli/transports/WorkerStateUploader.ts", "../src/cli/transports/ccrClient.ts", "../src/cli/transports/SSETransport.ts", "../src/bridge/replBridgeTransport.ts", "../src/bridge/flushGate.ts", "../src/bridge/replBridge.ts", "../src/bridge/codeSessionApi.ts", "../src/bridge/remoteBridgeCore.ts", "../src/bridge/initReplBridge.ts", "../src/bridge/inboundAttachments.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/bridge/webhookSanitizer.js", "../src/hooks/useReplBridge.tsx", "../src/components/MessageSelector.tsx", "../src/hooks/useIdeLogging.ts", "../src/hooks/useNotifyAfterTimeout.ts", "../src/components/permissions/AskUserQuestionPermissionRequest/PreviewBox.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/QuestionNavigationBar.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/PreviewQuestionView.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/QuestionView.tsx", "../src/components/permissions/PermissionRuleExplanation.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/SubmitQuestionsView.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/use-multiple-choice-state.ts", "../src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx", "../src/tools/BashTool/destructiveCommandWarning.ts", "../src/utils/shell/specPrefix.ts", "../src/utils/bash/specs/alias.ts", "../src/utils/bash/specs/nohup.ts", "../src/utils/bash/specs/pyright.ts", "../src/utils/bash/specs/sleep.ts", "../src/utils/bash/specs/srun.ts", "../src/utils/bash/specs/time.ts", "../src/utils/bash/specs/timeout.ts", "../src/utils/bash/specs/index.ts", "../src/utils/bash/registry.ts", "../src/utils/bash/prefix.ts", "../src/utils/unaryLogging.ts", "../src/components/permissions/hooks.ts", "../src/components/permissions/PermissionDecisionDebugInfo.tsx", "../src/utils/permissions/permissionExplainer.ts", "../src/components/permissions/PermissionExplanation.tsx", "../src/components/FileEditToolDiff.tsx", "../src/hooks/useDiffInIDE.ts", "../src/components/ShowInIDEPrompt.tsx", "../src/components/permissions/FilePermissionDialog/permissionOptions.tsx", "../src/components/permissions/FilePermissionDialog/usePermissionHandler.ts", "../src/components/permissions/FilePermissionDialog/useFilePermissionDialog.ts", "../src/components/permissions/FilePermissionDialog/FilePermissionDialog.tsx", "../src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx", "../src/components/permissions/utils.ts", "../src/components/permissions/useShellPermissionFeedback.ts", "../src/components/permissions/shellPermissionHelpers.tsx", "../src/components/permissions/BashPermissionRequest/bashToolUseOptions.tsx", "../src/components/permissions/BashPermissionRequest/BashPermissionRequest.tsx", "../src/components/permissions/EnterPlanModePermissionRequest/EnterPlanModePermissionRequest.tsx", "../src/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.tsx", "../src/components/permissions/PermissionPrompt.tsx", "../src/components/permissions/FallbackPermissionRequest.tsx", "../src/components/permissions/FilePermissionDialog/ideDiffConfig.ts", "../src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx", "../src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.tsx", "../src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx", "../src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx", "../src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx", "../src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.tsx", "../src/tools/PowerShellTool/destructiveCommandWarning.ts", "../src/utils/powershell/staticPrefix.ts", "../src/components/permissions/PowerShellPermissionRequest/powershellToolUseOptions.tsx", "../src/components/permissions/PowerShellPermissionRequest/PowerShellPermissionRequest.tsx", "../src/components/permissions/SkillPermissionRequest/SkillPermissionRequest.tsx", "../src/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/tools/ReviewArtifactTool/ReviewArtifactTool.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/permissions/ReviewArtifactPermissionRequest/ReviewArtifactPermissionRequest.js", "../src/tools/WorkflowTool/WorkflowPermissionRequest.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/permissions/MonitorPermissionRequest/MonitorPermissionRequest.js", "../src/components/permissions/PermissionRequest.tsx", "../src/utils/mcp/dateTimeParser.ts", "../src/utils/mcp/elicitationValidation.ts", "../src/components/mcp/ElicitationDialog.tsx", "../src/components/hooks/PromptDialog.tsx", "../src/hooks/useCommandQueue.ts", "../src/hooks/useIdeAtMentioned.ts", "../src/buddy/sprites.ts", "../src/buddy/CompanionSprite.tsx", "../src/buddy/useBuddyNotification.tsx", "../src/hooks/useIdeConnectionStatus.ts", "../src/hooks/useVoiceEnabled.ts", "../src/hooks/useUpdateNotification.ts", "../src/components/AutoUpdater.tsx", "../src/components/NativeAutoUpdater.tsx", "../src/components/PackageManagerAutoUpdater.tsx", "../src/components/AutoUpdaterWrapper.tsx", "../src/components/IdeStatusIndicator.tsx", "../src/hooks/useMemoryUsage.ts", "../src/components/MemoryUsageIndicator.tsx", "../src/services/compact/compactWarningHook.ts", "../src/components/TokenWarning.tsx", "../src/components/PromptInput/SandboxPromptFooterHint.tsx", "../src/components/PromptInput/VoiceIndicator.tsx", "../src/components/PromptInput/Notifications.tsx", "../src/hooks/useArrowKeyHistory.tsx", "../src/hooks/useHistorySearch.ts", "../src/hooks/useInputBuffer.ts", "../src/hooks/usePromptSuggestion.ts", "../src/utils/bash/shellCompletion.ts", "../node_modules/fuse.js/dist/fuse.mjs", "../src/utils/suggestions/commandSuggestions.ts", "../src/utils/suggestions/shellHistoryCompletion.ts", "../src/utils/suggestions/slackChannelSuggestions.ts", "../src/hooks/unifiedSuggestions.ts", "../src/hooks/useTypeahead.tsx", "../src/utils/directMemberMessage.ts", "../src/utils/keyboardShortcuts.ts", "../src/utils/permissions/getNextPermissionMode.ts", "../src/utils/ultraplan/keyword.ts", "../src/components/AutoModeOptInDialog.tsx", "../src/components/BridgeDialog.tsx", "../src/components/CoordinatorAgentStatus.tsx", "../src/utils/highlightMatch.tsx", "../src/components/design-system/FuzzyPicker.tsx", "../src/components/GlobalSearchDialog.tsx", "../src/components/HistorySearchDialog.tsx", "../src/components/QuickOpenDialog.tsx", "../src/components/ThinkingToggle.tsx", "../src/utils/teamDiscovery.ts", "../src/components/teams/TeamsDialog.tsx", "../src/vim/motions.ts", "../src/vim/textObjects.ts", "../src/vim/operators.ts", "../src/vim/types.ts", "../src/vim/transitions.ts", "../src/hooks/useVimInput.ts", "../src/components/VimTextInput.tsx", "../src/components/StatusLine.tsx", "../src/utils/horizontalScroll.ts", "../src/components/tasks/BackgroundTaskStatus.tsx", "../src/components/teams/TeamStatus.tsx", "../src/components/PromptInput/HistorySearchInput.tsx", "../src/utils/ghPrStatus.ts", "../src/hooks/usePrStatus.ts", "../src/components/PromptInput/PromptInputFooterLeftSide.tsx", "../src/components/PromptInput/PromptInputFooter.tsx", "../src/components/PromptInput/PromptInputModeIndicator.tsx", "../src/components/PromptInput/PromptInputQueuedCommands.tsx", "../src/components/PromptInput/PromptInputStashNotice.tsx", "../src/components/PromptInput/inputPaste.ts", "../src/components/PromptInput/useMaybeTruncateInput.ts", "../src/utils/exampleCommands.ts", "../src/components/PromptInput/usePromptInputPlaceholder.ts", "../src/components/PromptInput/useShowFastIconHint.ts", "../src/utils/standaloneAgent.ts", "../src/components/PromptInput/useSwarmBanner.ts", "../src/components/PromptInput/PromptInput.tsx", "../src/remote/SessionsWebSocket.ts", "../src/remote/RemoteSessionManager.ts", "../src/remote/remotePermissionBridge.ts", "../src/remote/sdkMessageAdapter.ts", "../src/hooks/useRemoteSession.ts", "../src/server/directConnectManager.ts", "../src/hooks/useDirectConnect.ts", "../src/hooks/useSSHSession.ts", "../src/assistant/sessionHistory.ts", "../src/hooks/useAssistantHistory.ts", "../src/components/FeedbackSurvey/useDebouncedDigitInput.ts", "../src/components/FeedbackSurvey/FeedbackSurveyView.tsx", "../src/components/SkillImprovementSurvey.tsx", "../src/utils/hooks/apiQueryHookHelper.ts", "../src/utils/hooks/skillImprovement.ts", "../src/hooks/useSkillImprovementSurvey.ts", "../src/moreright/useMoreRight.tsx", "../node_modules/minipass/dist/commonjs/index.js", "../node_modules/minipass-collect/index.js", "../node_modules/minipass-pipeline/node_modules/minipass/index.js", "../node_modules/minipass-pipeline/index.js", "../node_modules/ssri/lib/index.js", "../node_modules/imurmurhash/imurmurhash.js", "../node_modules/unique-slug/lib/index.js", "../node_modules/unique-filename/lib/index.js", "../node_modules/cacache/lib/util/hash-to-segments.js", "../node_modules/cacache/lib/content/path.js", "../node_modules/@npmcli/fs/lib/common/get-options.js", "../node_modules/@npmcli/fs/lib/common/node.js", "../node_modules/@npmcli/fs/lib/cp/errors.js", "../node_modules/@npmcli/fs/lib/cp/polyfill.js", "../node_modules/@npmcli/fs/lib/cp/index.js", "../node_modules/@npmcli/fs/lib/with-temp-dir.js", "../node_modules/@npmcli/fs/lib/readdir-scoped.js", "../node_modules/@npmcli/fs/lib/move-file.js", "../node_modules/@npmcli/fs/lib/index.js", "../node_modules/cacache/lib/entry-index.js", "../node_modules/cacache/node_modules/lru-cache/dist/commonjs/index.js", "../node_modules/cacache/lib/memoization.js", "../node_modules/fs-minipass/lib/index.js", "../node_modules/cacache/lib/content/read.js", "../node_modules/cacache/lib/get.js", "../node_modules/minipass-flush/node_modules/minipass/index.js", "../node_modules/minipass-flush/index.js", "../node_modules/cacache/lib/content/write.js", "../node_modules/cacache/lib/put.js", "../node_modules/balanced-match/index.js", "../node_modules/brace-expansion/index.js", "../node_modules/minimatch/dist/commonjs/assert-valid-pattern.js", "../node_modules/minimatch/dist/commonjs/brace-expressions.js", "../node_modules/minimatch/dist/commonjs/unescape.js", "../node_modules/minimatch/dist/commonjs/ast.js", "../node_modules/minimatch/dist/commonjs/escape.js", "../node_modules/minimatch/dist/commonjs/index.js", "../node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js", "../node_modules/path-scurry/dist/commonjs/index.js", "../node_modules/glob/dist/commonjs/pattern.js", "../node_modules/glob/dist/commonjs/ignore.js", "../node_modules/glob/dist/commonjs/processor.js", "../node_modules/glob/dist/commonjs/walker.js", "../node_modules/glob/dist/commonjs/glob.js", "../node_modules/glob/dist/commonjs/has-magic.js", "../node_modules/glob/dist/commonjs/index.js", "../node_modules/cacache/lib/util/glob.js", "../node_modules/cacache/lib/content/rm.js", "../node_modules/cacache/lib/rm.js", "../node_modules/cacache/lib/verify.js", "../node_modules/cacache/lib/util/tmp.js", "../node_modules/cacache/lib/index.js", "../src/utils/cleanup.ts", "../src/utils/deepLink/parseDeepLink.ts", "../src/utils/deepLink/registerProtocol.ts", "../src/utils/backgroundHousekeeping.ts", "../src/costHook.ts", "../src/hooks/useAfterFirstRender.ts", "../src/hooks/useDeferredHookMessages.ts", "../src/hooks/useApiKeyVerification.ts", "../src/utils/terminalPanel.ts", "../src/hooks/useGlobalKeybindings.tsx", "../src/hooks/useCommandKeybindings.tsx", "../src/hooks/useCancelRequest.ts", "../src/hooks/useBackgroundTaskNavigation.ts", "../src/utils/swarm/reconnection.ts", "../src/utils/swarm/teammateInit.ts", "../src/hooks/useSwarmInitialization.ts", "../src/hooks/useTeammateViewAutoExit.ts", "../src/hooks/toolPermission/handlers/coordinatorHandler.ts", "../src/hooks/toolPermission/PermissionContext.ts", "../src/hooks/toolPermission/handlers/interactiveHandler.ts", "../src/hooks/toolPermission/handlers/swarmWorkerHandler.ts", "../src/hooks/useCanUseTool.tsx", "../src/utils/userPromptKeywords.ts", "../src/utils/processUserInput/processTextPrompt.ts", "../src/components/BashModeProgress.tsx", "../src/utils/shell/resolveDefaultShell.ts", "../src/utils/processUserInput/processBashCommand.tsx", "../src/utils/processUserInput/processUserInput.ts", "../src/utils/handlePromptSubmit.ts", "../src/utils/queueProcessor.ts", "../src/hooks/useQueueProcessor.ts", "../src/hooks/useMailboxBridge.ts", "../src/hooks/useMergedClients.ts", "../src/hooks/useMergedCommands.ts", "../src/utils/skills/skillChangeDetector.ts", "../src/hooks/useSkillsChange.ts", "../src/utils/plugins/pluginBlocklist.ts", "../src/hooks/useManagePlugins.ts", "../src/components/TeammateViewHeader.tsx", "../src/hooks/useIdeSelection.ts", "../src/utils/asciicast.ts", "../src/services/contextCollapse/persist.ts", "../src/utils/sessionRestore.ts", "../src/hooks/useInboxPoller.ts", "../src/hooks/useTaskListWatcher.ts", "../src/hooks/useIDEIntegration.tsx", "../src/components/SessionBackgroundHint.tsx", "../src/hooks/useSessionBackgrounding.ts", "../src/components/EffortCallout.tsx", "../src/hooks/useDynamicConfig.ts", "../src/components/FeedbackSurvey/submitTranscriptShare.ts", "../src/components/FeedbackSurvey/useSurveyState.tsx", "../src/components/FeedbackSurvey/useFeedbackSurvey.tsx", "../src/components/FeedbackSurvey/useMemorySurvey.tsx", "../src/components/FeedbackSurvey/usePostCompactSurvey.tsx", "../src/components/FeedbackSurvey/TranscriptSharePrompt.tsx", "../src/components/FeedbackSurvey/FeedbackSurvey.tsx", "../src/hooks/notifs/useStartupNotification.ts", "../src/hooks/notifs/useInstallMessages.tsx", "../src/services/awaySummary.ts", "../src/hooks/useAwaySummary.ts", "../src/hooks/useChromeExtensionNotification.tsx", "../src/utils/plugins/officialMarketplaceStartupCheck.ts", "../src/hooks/useOfficialMarketplaceNotification.tsx", "../src/hooks/usePromptsFromClaudeInChrome.tsx", "../src/services/tips/tipHistory.ts", "../src/components/DesktopUpsell/DesktopUpsellStartup.tsx", "../src/services/tips/tipRegistry.ts", "../src/services/tips/tipScheduler.ts", "../src/entrypoints/sdk/controlSchemas.ts", "../src/utils/permissions/PermissionPromptToolResultSchema.ts", "../src/cli/ndjsonSafeStringify.ts", "../src/cli/structuredIO.ts", "../src/hooks/useFileHistorySnapshotInit.ts", "../src/components/permissions/SandboxPermissionRequest.tsx", "../src/components/SandboxViolationExpandedView.tsx", "../src/hooks/notifs/useMcpConnectivityStatus.tsx", "../src/hooks/notifs/useAutoModeUnavailableNotification.ts", "../src/hooks/notifs/useLspInitializationNotification.tsx", "../src/utils/binaryCheck.ts", "../src/utils/plugins/lspRecommendation.ts", "../src/hooks/usePluginRecommendationBase.tsx", "../src/hooks/useLspPluginRecommendation.tsx", "../src/components/LspRecommendation/LspRecommendationMenu.tsx", "../src/hooks/useClaudeCodeHintRecommendation.tsx", "../src/components/ClaudeCodeHint/PluginHintMenu.tsx", "../src/hooks/notifs/usePluginInstallationStatus.tsx", "../src/hooks/notifs/usePluginAutoupdateNotification.tsx", "../src/utils/plugins/reconciler.ts", "../src/services/plugins/PluginInstallationManager.ts", "../src/utils/plugins/performStartupChecks.tsx", "../src/components/AwsAuthStatusBox.tsx", "../src/hooks/notifs/useRateLimitWarningNotification.tsx", "../src/utils/model/deprecation.ts", "../src/hooks/notifs/useDeprecationWarningNotification.tsx", "../src/hooks/notifs/useNpmDeprecationNotification.tsx", "../src/hooks/notifs/useIDEStatusIndicator.tsx", "../src/hooks/notifs/useModelMigrationNotifications.tsx", "../src/hooks/notifs/useCanSwitchToExistingSubscription.tsx", "../src/hooks/notifs/useTeammateShutdownNotification.ts", "../src/hooks/notifs/useFastModeNotification.tsx", "../src/utils/autoRunIssue.tsx", "../src/components/PromptInput/IssueFlagBanner.tsx", "../src/hooks/useIssueFlagBanner.ts", "../src/components/DevBar.tsx", "../src/ink/components/AlternateScreen.tsx", "../src/hooks/useCopyOnSelect.ts", "../src/components/ScrollKeybindingHandler.tsx", "../src/hooks/useVoiceIntegration.tsx", "../src/proactive/useProactive.ts", "../src/utils/cronJitterConfig.ts", "../src/utils/cronTasksLock.ts", "../src/utils/cronScheduler.ts", "../src/hooks/useScheduledTasks.ts", "../src/tools/WebBrowserTool/WebBrowserPanel.ts", "../src/screens/REPL.tsx", "../src/replLauncher.tsx", "../src/services/api/bootstrap.ts", "../src/utils/warningHandler.ts", "../src/components/MCPServerDialogCopy.tsx", "../src/components/MCPServerApprovalDialog.tsx", "../src/components/MCPServerMultiselectDialog.tsx", "../src/services/mcpServerApproval.tsx", "../src/utils/deepLink/terminalPreference.ts", "../src/utils/fpsTracker.ts", "../src/utils/githubRepoPathMapping.ts", "../src/hooks/useTimeout.ts", "../src/utils/preflightChecks.tsx", "../src/components/ApproveApiKey.tsx", "../src/components/LogoV2/WelcomeV2.tsx", "../src/components/ui/OrderedListItem.tsx", "../src/components/ui/OrderedList.tsx", "../src/components/Onboarding.tsx", "../src/components/TrustDialog/utils.ts", "../src/components/TrustDialog/TrustDialog.tsx", "../src/components/BypassPermissionsModeDialog.tsx", "../src/components/DevChannelsDialog.tsx", "../src/components/ClaudeInChromeOnboarding.tsx", "../src/interactiveHelpers.tsx", "../src/components/agents/SnapshotUpdateDialog.ts", "../src/components/InvalidSettingsDialog.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/assistant/AssistantSessionChooser.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/commands/assistant/assistant.js", "../src/hooks/useTeleportResume.tsx", "../src/components/ResumeTask.tsx", "../src/components/TeleportResumeWrapper.tsx", "../src/components/TeleportRepoMismatchDialog.tsx", "../src/screens/ResumeConversation.tsx", "../src/dialogLaunchers.tsx", "../src/plugins/bundled/index.ts", "../src/services/plugins/pluginCliCommands.ts", "../src/skills/bundled/batch.ts", "../src/skills/bundled/claudeInChrome.ts", "../src/skills/bundled/debug.ts", "../src/keybindings/schema.ts", "../src/skills/bundled/keybindings.ts", "../src/skills/bundled/loremIpsum.ts", "../src/skills/bundled/remember.ts", "../src/skills/bundled/simplify.ts", "../src/skills/bundled/skillify.ts", "../src/skills/bundled/stuck.ts", "../src/skills/bundled/updateConfig.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/verify/examples/cli.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/verify/examples/server.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/verify/SKILL.md", "../src/skills/bundled/verifyContent.ts", "../src/skills/bundled/verify.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/dream.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/hunter.js", "../src/skills/bundled/loop.ts", "../src/skills/bundled/scheduleRemoteAgents.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/csharp/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/curl/examples.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/go/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/java/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/php/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/agent-sdk/patterns.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/agent-sdk/README.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/batches.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/files-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/README.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/streaming.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/tool-use.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/ruby/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/SKILL.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/error-codes.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/live-sources.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/models.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/prompt-caching.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/tool-use-concepts.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/agent-sdk/patterns.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/agent-sdk/README.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/batches.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/files-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/README.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/streaming.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/tool-use.md", "../src/skills/bundled/claudeApiContent.ts", "../src/skills/bundled/claudeApi.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/runSkillGenerator.js", "../src/skills/bundled/index.ts", "../src/utils/deepLink/banner.ts", "../src/utils/telemetry/skillLoadedEvent.ts", "../src/cli/exit.ts", "../src/commands/mcp/addCommand.ts", "../src/commands/mcp/xaaIdpCommand.ts", "../src/utils/cliArgs.ts", "../src/migrations/migrateAutoUpdatesToSettings.ts", "../src/migrations/migrateBypassPermissionsAcceptedToSettings.ts", "../src/migrations/migrateEnableAllProjectMcpServersToSettings.ts", "../src/migrations/migrateFennecToOpus.ts", "../src/migrations/migrateLegacyOpusToCurrent.ts", "../src/migrations/migrateOpusToOpus1m.ts", "../src/migrations/migrateReplBridgeEnabledToRemoteControlAtStartup.ts", "../src/migrations/migrateSonnet1mToSonnet45.ts", "../src/migrations/migrateSonnet45ToSonnet46.ts", "../src/migrations/resetAutoModeOptInForDefaultOffer.ts", "../src/migrations/resetProToOpusDefault.ts", "../src/server/types.ts", "../src/server/createDirectConnectSession.ts", "../src/assistant/gate.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/server/parseConnectUrl.js", "../src/utils/deepLink/terminalLauncher.ts", "../src/utils/deepLink/protocolHandler.ts", "../src/utils/computerUse/setup.ts", "../src/services/SessionMemory/sessionMemory.ts", "../src/utils/iTermBackup.ts", "../src/setup.ts", "../src/cli/transports/transportUtils.ts", "../src/cli/remoteIO.ts", "../src/utils/streamlinedTransform.ts", "../src/utils/streamJsonStdoutGuard.ts", "../src/utils/queryContext.ts", "../src/QueryEngine.ts", "../src/utils/filePersistence/types.ts", "../src/utils/filePersistence/filePersistence.ts", "../src/utils/idleTimeout.ts", "../src/utils/sessionUrl.ts", "../src/utils/plugins/zipCacheAdapters.ts", "../src/utils/plugins/headlessPluginInstall.ts", "../src/cli/print.ts", "../src/ssh/createSSHSession.ts", "../src/assistant/sessionDiscovery.ts", "../src/components/TeleportProgress.tsx", "../src/components/MCPServerDesktopImportDialog.tsx", "../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js", "../src/entrypoints/mcp.ts", "../src/utils/claudeDesktop.ts", "../src/cli/handlers/mcp.tsx", "../src/server/server.ts", "../src/server/sessionManager.ts", "../src/server/backends/dangerousBackend.ts", "../src/server/serverBanner.ts", "../src/server/serverLog.ts", "../src/server/lockfile.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/server/connectHeadless.js", "../src/cli/handlers/plugins.ts", "../src/commands/install.tsx", "../src/cli/handlers/util.tsx", "../src/cli/handlers/agents.ts", "../src/cli/handlers/autoMode.ts", "../src/cli/update.ts", "../src/main.tsx", "../src/entrypoints/cli.tsx"], + "sources": ["../shim/bun-bundle.ts", "../node_modules/lodash-es/_listCacheClear.js", "../node_modules/lodash-es/eq.js", "../node_modules/lodash-es/_assocIndexOf.js", "../node_modules/lodash-es/_listCacheDelete.js", "../node_modules/lodash-es/_listCacheGet.js", "../node_modules/lodash-es/_listCacheHas.js", "../node_modules/lodash-es/_listCacheSet.js", "../node_modules/lodash-es/_ListCache.js", "../node_modules/lodash-es/_stackClear.js", "../node_modules/lodash-es/_stackDelete.js", "../node_modules/lodash-es/_stackGet.js", "../node_modules/lodash-es/_stackHas.js", "../node_modules/lodash-es/_freeGlobal.js", "../node_modules/lodash-es/_root.js", "../node_modules/lodash-es/_Symbol.js", "../node_modules/lodash-es/_getRawTag.js", "../node_modules/lodash-es/_objectToString.js", "../node_modules/lodash-es/_baseGetTag.js", "../node_modules/lodash-es/isObject.js", "../node_modules/lodash-es/isFunction.js", "../node_modules/lodash-es/_coreJsData.js", "../node_modules/lodash-es/_isMasked.js", "../node_modules/lodash-es/_toSource.js", "../node_modules/lodash-es/_baseIsNative.js", "../node_modules/lodash-es/_getValue.js", "../node_modules/lodash-es/_getNative.js", "../node_modules/lodash-es/_Map.js", "../node_modules/lodash-es/_nativeCreate.js", "../node_modules/lodash-es/_hashClear.js", "../node_modules/lodash-es/_hashDelete.js", "../node_modules/lodash-es/_hashGet.js", "../node_modules/lodash-es/_hashHas.js", "../node_modules/lodash-es/_hashSet.js", "../node_modules/lodash-es/_Hash.js", "../node_modules/lodash-es/_mapCacheClear.js", "../node_modules/lodash-es/_isKeyable.js", "../node_modules/lodash-es/_getMapData.js", "../node_modules/lodash-es/_mapCacheDelete.js", "../node_modules/lodash-es/_mapCacheGet.js", "../node_modules/lodash-es/_mapCacheHas.js", "../node_modules/lodash-es/_mapCacheSet.js", "../node_modules/lodash-es/_MapCache.js", "../node_modules/lodash-es/_stackSet.js", "../node_modules/lodash-es/_Stack.js", "../node_modules/lodash-es/_setCacheAdd.js", "../node_modules/lodash-es/_setCacheHas.js", "../node_modules/lodash-es/_SetCache.js", "../node_modules/lodash-es/_arraySome.js", "../node_modules/lodash-es/_cacheHas.js", "../node_modules/lodash-es/_equalArrays.js", "../node_modules/lodash-es/_Uint8Array.js", "../node_modules/lodash-es/_mapToArray.js", "../node_modules/lodash-es/_setToArray.js", "../node_modules/lodash-es/_equalByTag.js", "../node_modules/lodash-es/_arrayPush.js", "../node_modules/lodash-es/isArray.js", "../node_modules/lodash-es/_baseGetAllKeys.js", "../node_modules/lodash-es/_arrayFilter.js", "../node_modules/lodash-es/stubArray.js", "../node_modules/lodash-es/_getSymbols.js", "../node_modules/lodash-es/_baseTimes.js", "../node_modules/lodash-es/isObjectLike.js", "../node_modules/lodash-es/_baseIsArguments.js", "../node_modules/lodash-es/isArguments.js", "../node_modules/lodash-es/stubFalse.js", "../node_modules/lodash-es/isBuffer.js", "../node_modules/lodash-es/_isIndex.js", "../node_modules/lodash-es/isLength.js", "../node_modules/lodash-es/_baseIsTypedArray.js", "../node_modules/lodash-es/_baseUnary.js", "../node_modules/lodash-es/_nodeUtil.js", "../node_modules/lodash-es/isTypedArray.js", "../node_modules/lodash-es/_arrayLikeKeys.js", "../node_modules/lodash-es/_isPrototype.js", "../node_modules/lodash-es/_overArg.js", "../node_modules/lodash-es/_nativeKeys.js", "../node_modules/lodash-es/_baseKeys.js", "../node_modules/lodash-es/isArrayLike.js", "../node_modules/lodash-es/keys.js", "../node_modules/lodash-es/_getAllKeys.js", "../node_modules/lodash-es/_equalObjects.js", "../node_modules/lodash-es/_DataView.js", "../node_modules/lodash-es/_Promise.js", "../node_modules/lodash-es/_Set.js", "../node_modules/lodash-es/_WeakMap.js", "../node_modules/lodash-es/_getTag.js", "../node_modules/lodash-es/_baseIsEqualDeep.js", "../node_modules/lodash-es/_baseIsEqual.js", "../node_modules/lodash-es/_baseIsMatch.js", "../node_modules/lodash-es/_isStrictComparable.js", "../node_modules/lodash-es/_getMatchData.js", "../node_modules/lodash-es/_matchesStrictComparable.js", "../node_modules/lodash-es/_baseMatches.js", "../node_modules/lodash-es/isSymbol.js", "../node_modules/lodash-es/_isKey.js", "../node_modules/lodash-es/memoize.js", "../node_modules/lodash-es/_memoizeCapped.js", "../node_modules/lodash-es/_stringToPath.js", "../node_modules/lodash-es/_arrayMap.js", "../node_modules/lodash-es/_baseToString.js", "../node_modules/lodash-es/toString.js", "../node_modules/lodash-es/_castPath.js", "../node_modules/lodash-es/_toKey.js", "../node_modules/lodash-es/_baseGet.js", "../node_modules/lodash-es/get.js", "../node_modules/lodash-es/_baseHasIn.js", "../node_modules/lodash-es/_hasPath.js", "../node_modules/lodash-es/hasIn.js", "../node_modules/lodash-es/_baseMatchesProperty.js", "../node_modules/lodash-es/identity.js", "../node_modules/lodash-es/_baseProperty.js", "../node_modules/lodash-es/_basePropertyDeep.js", "../node_modules/lodash-es/property.js", "../node_modules/lodash-es/_baseIteratee.js", "../node_modules/lodash-es/_baseSum.js", "../node_modules/lodash-es/sumBy.js", "../src/utils/crypto.ts", "../src/utils/settings/settingsCache.ts", "../src/utils/signal.ts", "../src/bootstrap/state.ts", "../src/services/analytics/index.ts", "../src/utils/bufferedWriter.ts", "../src/utils/cleanupRegistry.ts", "../src/utils/debugFilter.ts", "../src/utils/protectedNamespace.ts", "../src/utils/envUtils.ts", "../node_modules/@anthropic-ai/sdk/internal/tslib.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs", "../node_modules/@anthropic-ai/sdk/internal/errors.mjs", "../node_modules/@anthropic-ai/sdk/core/error.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/values.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/log.mjs", "../node_modules/@anthropic-ai/sdk/version.mjs", "../node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs", "../node_modules/@anthropic-ai/sdk/internal/shims.mjs", "../node_modules/@anthropic-ai/sdk/internal/request-options.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs", "../node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs", "../node_modules/@anthropic-ai/sdk/core/streaming.mjs", "../node_modules/@anthropic-ai/sdk/internal/parse.mjs", "../node_modules/@anthropic-ai/sdk/core/api-promise.mjs", "../node_modules/@anthropic-ai/sdk/core/pagination.mjs", "../node_modules/@anthropic-ai/sdk/internal/uploads.mjs", "../node_modules/@anthropic-ai/sdk/internal/to-file.mjs", "../node_modules/@anthropic-ai/sdk/core/uploads.mjs", "../node_modules/@anthropic-ai/sdk/core/resource.mjs", "../node_modules/@anthropic-ai/sdk/internal/headers.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/path.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/files.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/models.mjs", "../node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs", "../node_modules/@anthropic-ai/sdk/error.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs", "../node_modules/@anthropic-ai/sdk/streaming.mjs", "../node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs", "../node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs", "../node_modules/@anthropic-ai/sdk/internal/constants.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs", "../node_modules/@anthropic-ai/sdk/resources/completions.mjs", "../node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs", "../node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs", "../node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs", "../node_modules/@anthropic-ai/sdk/resources/models.mjs", "../node_modules/@anthropic-ai/sdk/resources/index.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/env.mjs", "../node_modules/@anthropic-ai/sdk/client.mjs", "../node_modules/@anthropic-ai/sdk/index.mjs", "../src/utils/errors.ts", "../node_modules/lodash-es/_arrayEach.js", "../node_modules/lodash-es/_defineProperty.js", "../node_modules/lodash-es/_baseAssignValue.js", "../node_modules/lodash-es/_assignValue.js", "../node_modules/lodash-es/_copyObject.js", "../node_modules/lodash-es/_baseAssign.js", "../node_modules/lodash-es/_nativeKeysIn.js", "../node_modules/lodash-es/_baseKeysIn.js", "../node_modules/lodash-es/keysIn.js", "../node_modules/lodash-es/_baseAssignIn.js", "../node_modules/lodash-es/_cloneBuffer.js", "../node_modules/lodash-es/_copyArray.js", "../node_modules/lodash-es/_copySymbols.js", "../node_modules/lodash-es/_getPrototype.js", "../node_modules/lodash-es/_getSymbolsIn.js", "../node_modules/lodash-es/_copySymbolsIn.js", "../node_modules/lodash-es/_getAllKeysIn.js", "../node_modules/lodash-es/_initCloneArray.js", "../node_modules/lodash-es/_cloneArrayBuffer.js", "../node_modules/lodash-es/_cloneDataView.js", "../node_modules/lodash-es/_cloneRegExp.js", "../node_modules/lodash-es/_cloneSymbol.js", "../node_modules/lodash-es/_cloneTypedArray.js", "../node_modules/lodash-es/_initCloneByTag.js", "../node_modules/lodash-es/_baseCreate.js", "../node_modules/lodash-es/_initCloneObject.js", "../node_modules/lodash-es/_baseIsMap.js", "../node_modules/lodash-es/isMap.js", "../node_modules/lodash-es/_baseIsSet.js", "../node_modules/lodash-es/isSet.js", "../node_modules/lodash-es/_baseClone.js", "../node_modules/lodash-es/cloneDeep.js", "../src/utils/slowOperations.ts", "../src/utils/fsOperations.ts", "../src/utils/process.ts", "../src/utils/debug.ts", "../src/utils/intl.ts", "../node_modules/emoji-regex/index.js", "../node_modules/get-east-asian-width/lookup-data.js", "../node_modules/get-east-asian-width/utilities.js", "../node_modules/get-east-asian-width/lookup.js", "../node_modules/get-east-asian-width/index.js", "../node_modules/ansi-regex/index.js", "../node_modules/strip-ansi/index.js", "../src/ink/stringWidth.ts", "../src/utils/truncate.ts", "../src/utils/format.ts", "../src/utils/profilerBase.ts", "../src/utils/startupProfiler.ts", "../node_modules/lodash-es/_baseSet.js", "../node_modules/lodash-es/_basePickBy.js", "../node_modules/lodash-es/pickBy.js", "../node_modules/@growthbook/growthbook/dist/esm/util.mjs", "../node_modules/@growthbook/growthbook/dist/esm/feature-repository.mjs", "../node_modules/dom-mutator/dist/dom-mutator.cjs.development.js", "../node_modules/dom-mutator/dist/index.js", "../node_modules/@growthbook/growthbook/dist/esm/mongrule.mjs", "../node_modules/@growthbook/growthbook/dist/esm/core.mjs", "../node_modules/@growthbook/growthbook/dist/esm/GrowthBook.mjs", "../node_modules/@growthbook/growthbook/dist/esm/GrowthBookClient.mjs", "../node_modules/@growthbook/growthbook/dist/esm/sticky-bucket-service.mjs", "../node_modules/@growthbook/growthbook/dist/esm/index.mjs", "../node_modules/lodash-es/_baseToNumber.js", "../node_modules/lodash-es/_createMathOperation.js", "../node_modules/lodash-es/add.js", "../node_modules/lodash-es/_trimmedEndIndex.js", "../node_modules/lodash-es/_baseTrim.js", "../node_modules/lodash-es/toNumber.js", "../node_modules/lodash-es/toFinite.js", "../node_modules/lodash-es/toInteger.js", "../node_modules/lodash-es/after.js", "../node_modules/lodash-es/_metaMap.js", "../node_modules/lodash-es/_baseSetData.js", "../node_modules/lodash-es/_createCtor.js", "../node_modules/lodash-es/_createBind.js", "../node_modules/lodash-es/_apply.js", "../node_modules/lodash-es/_composeArgs.js", "../node_modules/lodash-es/_composeArgsRight.js", "../node_modules/lodash-es/_countHolders.js", "../node_modules/lodash-es/_baseLodash.js", "../node_modules/lodash-es/_LazyWrapper.js", "../node_modules/lodash-es/noop.js", "../node_modules/lodash-es/_getData.js", "../node_modules/lodash-es/_realNames.js", "../node_modules/lodash-es/_getFuncName.js", "../node_modules/lodash-es/_LodashWrapper.js", "../node_modules/lodash-es/_wrapperClone.js", "../node_modules/lodash-es/wrapperLodash.js", "../node_modules/lodash-es/_isLaziable.js", "../node_modules/lodash-es/_shortOut.js", "../node_modules/lodash-es/_setData.js", "../node_modules/lodash-es/_getWrapDetails.js", "../node_modules/lodash-es/_insertWrapDetails.js", "../node_modules/lodash-es/constant.js", "../node_modules/lodash-es/_baseSetToString.js", "../node_modules/lodash-es/_setToString.js", "../node_modules/lodash-es/_baseFindIndex.js", "../node_modules/lodash-es/_baseIsNaN.js", "../node_modules/lodash-es/_strictIndexOf.js", "../node_modules/lodash-es/_baseIndexOf.js", "../node_modules/lodash-es/_arrayIncludes.js", "../node_modules/lodash-es/_updateWrapDetails.js", "../node_modules/lodash-es/_setWrapToString.js", "../node_modules/lodash-es/_createRecurry.js", "../node_modules/lodash-es/_getHolder.js", "../node_modules/lodash-es/_reorder.js", "../node_modules/lodash-es/_replaceHolders.js", "../node_modules/lodash-es/_createHybrid.js", "../node_modules/lodash-es/_createCurry.js", "../node_modules/lodash-es/_createPartial.js", "../node_modules/lodash-es/_mergeData.js", "../node_modules/lodash-es/_createWrap.js", "../node_modules/lodash-es/ary.js", "../node_modules/lodash-es/_overRest.js", "../node_modules/lodash-es/_baseRest.js", "../node_modules/lodash-es/_isIterateeCall.js", "../node_modules/lodash-es/_createAssigner.js", "../node_modules/lodash-es/assign.js", "../node_modules/lodash-es/assignIn.js", "../node_modules/lodash-es/assignInWith.js", "../node_modules/lodash-es/assignWith.js", "../node_modules/lodash-es/_baseAt.js", "../node_modules/lodash-es/_isFlattenable.js", "../node_modules/lodash-es/_baseFlatten.js", "../node_modules/lodash-es/flatten.js", "../node_modules/lodash-es/_flatRest.js", "../node_modules/lodash-es/at.js", "../node_modules/lodash-es/isPlainObject.js", "../node_modules/lodash-es/isError.js", "../node_modules/lodash-es/attempt.js", "../node_modules/lodash-es/before.js", "../node_modules/lodash-es/bind.js", "../node_modules/lodash-es/bindAll.js", "../node_modules/lodash-es/bindKey.js", "../node_modules/lodash-es/_baseSlice.js", "../node_modules/lodash-es/_castSlice.js", "../node_modules/lodash-es/_hasUnicode.js", "../node_modules/lodash-es/_asciiToArray.js", "../node_modules/lodash-es/_unicodeToArray.js", "../node_modules/lodash-es/_stringToArray.js", "../node_modules/lodash-es/_createCaseFirst.js", "../node_modules/lodash-es/upperFirst.js", "../node_modules/lodash-es/capitalize.js", "../node_modules/lodash-es/_arrayReduce.js", "../node_modules/lodash-es/_basePropertyOf.js", "../node_modules/lodash-es/_deburrLetter.js", "../node_modules/lodash-es/deburr.js", "../node_modules/lodash-es/_asciiWords.js", "../node_modules/lodash-es/_hasUnicodeWord.js", "../node_modules/lodash-es/_unicodeWords.js", "../node_modules/lodash-es/words.js", "../node_modules/lodash-es/_createCompounder.js", "../node_modules/lodash-es/camelCase.js", "../node_modules/lodash-es/castArray.js", "../node_modules/lodash-es/_createRound.js", "../node_modules/lodash-es/ceil.js", "../node_modules/lodash-es/chain.js", "../node_modules/lodash-es/chunk.js", "../node_modules/lodash-es/_baseClamp.js", "../node_modules/lodash-es/clamp.js", "../node_modules/lodash-es/clone.js", "../node_modules/lodash-es/cloneDeepWith.js", "../node_modules/lodash-es/cloneWith.js", "../node_modules/lodash-es/commit.js", "../node_modules/lodash-es/compact.js", "../node_modules/lodash-es/concat.js", "../node_modules/lodash-es/cond.js", "../node_modules/lodash-es/_baseConformsTo.js", "../node_modules/lodash-es/_baseConforms.js", "../node_modules/lodash-es/conforms.js", "../node_modules/lodash-es/conformsTo.js", "../node_modules/lodash-es/_arrayAggregator.js", "../node_modules/lodash-es/_createBaseFor.js", "../node_modules/lodash-es/_baseFor.js", "../node_modules/lodash-es/_baseForOwn.js", "../node_modules/lodash-es/_createBaseEach.js", "../node_modules/lodash-es/_baseEach.js", "../node_modules/lodash-es/_baseAggregator.js", "../node_modules/lodash-es/_createAggregator.js", "../node_modules/lodash-es/countBy.js", "../node_modules/lodash-es/create.js", "../node_modules/lodash-es/curry.js", "../node_modules/lodash-es/curryRight.js", "../node_modules/lodash-es/now.js", "../node_modules/lodash-es/debounce.js", "../node_modules/lodash-es/defaultTo.js", "../node_modules/lodash-es/defaults.js", "../node_modules/lodash-es/_assignMergeValue.js", "../node_modules/lodash-es/isArrayLikeObject.js", "../node_modules/lodash-es/_safeGet.js", "../node_modules/lodash-es/toPlainObject.js", "../node_modules/lodash-es/_baseMergeDeep.js", "../node_modules/lodash-es/_baseMerge.js", "../node_modules/lodash-es/_customDefaultsMerge.js", "../node_modules/lodash-es/mergeWith.js", "../node_modules/lodash-es/defaultsDeep.js", "../node_modules/lodash-es/_baseDelay.js", "../node_modules/lodash-es/defer.js", "../node_modules/lodash-es/delay.js", "../node_modules/lodash-es/_arrayIncludesWith.js", "../node_modules/lodash-es/_baseDifference.js", "../node_modules/lodash-es/difference.js", "../node_modules/lodash-es/last.js", "../node_modules/lodash-es/differenceBy.js", "../node_modules/lodash-es/differenceWith.js", "../node_modules/lodash-es/divide.js", "../node_modules/lodash-es/drop.js", "../node_modules/lodash-es/dropRight.js", "../node_modules/lodash-es/_baseWhile.js", "../node_modules/lodash-es/dropRightWhile.js", "../node_modules/lodash-es/dropWhile.js", "../node_modules/lodash-es/_castFunction.js", "../node_modules/lodash-es/forEach.js", "../node_modules/lodash-es/each.js", "../node_modules/lodash-es/_arrayEachRight.js", "../node_modules/lodash-es/_baseForRight.js", "../node_modules/lodash-es/_baseForOwnRight.js", "../node_modules/lodash-es/_baseEachRight.js", "../node_modules/lodash-es/forEachRight.js", "../node_modules/lodash-es/eachRight.js", "../node_modules/lodash-es/endsWith.js", "../node_modules/lodash-es/_baseToPairs.js", "../node_modules/lodash-es/_setToPairs.js", "../node_modules/lodash-es/_createToPairs.js", "../node_modules/lodash-es/toPairs.js", "../node_modules/lodash-es/entries.js", "../node_modules/lodash-es/toPairsIn.js", "../node_modules/lodash-es/entriesIn.js", "../node_modules/lodash-es/_escapeHtmlChar.js", "../node_modules/lodash-es/escape.js", "../node_modules/lodash-es/escapeRegExp.js", "../node_modules/lodash-es/_arrayEvery.js", "../node_modules/lodash-es/_baseEvery.js", "../node_modules/lodash-es/every.js", "../node_modules/lodash-es/extend.js", "../node_modules/lodash-es/extendWith.js", "../node_modules/lodash-es/toLength.js", "../node_modules/lodash-es/_baseFill.js", "../node_modules/lodash-es/fill.js", "../node_modules/lodash-es/_baseFilter.js", "../node_modules/lodash-es/filter.js", "../node_modules/lodash-es/_createFind.js", "../node_modules/lodash-es/findIndex.js", "../node_modules/lodash-es/find.js", "../node_modules/lodash-es/_baseFindKey.js", "../node_modules/lodash-es/findKey.js", "../node_modules/lodash-es/findLastIndex.js", "../node_modules/lodash-es/findLast.js", "../node_modules/lodash-es/findLastKey.js", "../node_modules/lodash-es/head.js", "../node_modules/lodash-es/first.js", "../node_modules/lodash-es/_baseMap.js", "../node_modules/lodash-es/map.js", "../node_modules/lodash-es/flatMap.js", "../node_modules/lodash-es/flatMapDeep.js", "../node_modules/lodash-es/flatMapDepth.js", "../node_modules/lodash-es/flattenDeep.js", "../node_modules/lodash-es/flattenDepth.js", "../node_modules/lodash-es/flip.js", "../node_modules/lodash-es/floor.js", "../node_modules/lodash-es/_createFlow.js", "../node_modules/lodash-es/flow.js", "../node_modules/lodash-es/flowRight.js", "../node_modules/lodash-es/forIn.js", "../node_modules/lodash-es/forInRight.js", "../node_modules/lodash-es/forOwn.js", "../node_modules/lodash-es/forOwnRight.js", "../node_modules/lodash-es/fromPairs.js", "../node_modules/lodash-es/_baseFunctions.js", "../node_modules/lodash-es/functions.js", "../node_modules/lodash-es/functionsIn.js", "../node_modules/lodash-es/groupBy.js", "../node_modules/lodash-es/_baseGt.js", "../node_modules/lodash-es/_createRelationalOperation.js", "../node_modules/lodash-es/gt.js", "../node_modules/lodash-es/gte.js", "../node_modules/lodash-es/_baseHas.js", "../node_modules/lodash-es/has.js", "../node_modules/lodash-es/_baseInRange.js", "../node_modules/lodash-es/inRange.js", "../node_modules/lodash-es/isString.js", "../node_modules/lodash-es/_baseValues.js", "../node_modules/lodash-es/values.js", "../node_modules/lodash-es/includes.js", "../node_modules/lodash-es/indexOf.js", "../node_modules/lodash-es/initial.js", "../node_modules/lodash-es/_baseIntersection.js", "../node_modules/lodash-es/_castArrayLikeObject.js", "../node_modules/lodash-es/intersection.js", "../node_modules/lodash-es/intersectionBy.js", "../node_modules/lodash-es/intersectionWith.js", "../node_modules/lodash-es/_baseInverter.js", "../node_modules/lodash-es/_createInverter.js", "../node_modules/lodash-es/invert.js", "../node_modules/lodash-es/invertBy.js", "../node_modules/lodash-es/_parent.js", "../node_modules/lodash-es/_baseInvoke.js", "../node_modules/lodash-es/invoke.js", "../node_modules/lodash-es/invokeMap.js", "../node_modules/lodash-es/_baseIsArrayBuffer.js", "../node_modules/lodash-es/isArrayBuffer.js", "../node_modules/lodash-es/isBoolean.js", "../node_modules/lodash-es/_baseIsDate.js", "../node_modules/lodash-es/isDate.js", "../node_modules/lodash-es/isElement.js", "../node_modules/lodash-es/isEmpty.js", "../node_modules/lodash-es/isEqual.js", "../node_modules/lodash-es/isEqualWith.js", "../node_modules/lodash-es/isFinite.js", "../node_modules/lodash-es/isInteger.js", "../node_modules/lodash-es/isMatch.js", "../node_modules/lodash-es/isMatchWith.js", "../node_modules/lodash-es/isNumber.js", "../node_modules/lodash-es/isNaN.js", "../node_modules/lodash-es/_isMaskable.js", "../node_modules/lodash-es/isNative.js", "../node_modules/lodash-es/isNil.js", "../node_modules/lodash-es/isNull.js", "../node_modules/lodash-es/_baseIsRegExp.js", "../node_modules/lodash-es/isRegExp.js", "../node_modules/lodash-es/isSafeInteger.js", "../node_modules/lodash-es/isUndefined.js", "../node_modules/lodash-es/isWeakMap.js", "../node_modules/lodash-es/isWeakSet.js", "../node_modules/lodash-es/iteratee.js", "../node_modules/lodash-es/join.js", "../node_modules/lodash-es/kebabCase.js", "../node_modules/lodash-es/keyBy.js", "../node_modules/lodash-es/_strictLastIndexOf.js", "../node_modules/lodash-es/lastIndexOf.js", "../node_modules/lodash-es/lowerCase.js", "../node_modules/lodash-es/lowerFirst.js", "../node_modules/lodash-es/_baseLt.js", "../node_modules/lodash-es/lt.js", "../node_modules/lodash-es/lte.js", "../node_modules/lodash-es/mapKeys.js", "../node_modules/lodash-es/mapValues.js", "../node_modules/lodash-es/matches.js", "../node_modules/lodash-es/matchesProperty.js", "../node_modules/lodash-es/_baseExtremum.js", "../node_modules/lodash-es/max.js", "../node_modules/lodash-es/maxBy.js", "../node_modules/lodash-es/_baseMean.js", "../node_modules/lodash-es/mean.js", "../node_modules/lodash-es/meanBy.js", "../node_modules/lodash-es/merge.js", "../node_modules/lodash-es/method.js", "../node_modules/lodash-es/methodOf.js", "../node_modules/lodash-es/min.js", "../node_modules/lodash-es/minBy.js", "../node_modules/lodash-es/mixin.js", "../node_modules/lodash-es/multiply.js", "../node_modules/lodash-es/negate.js", "../node_modules/lodash-es/_iteratorToArray.js", "../node_modules/lodash-es/toArray.js", "../node_modules/lodash-es/next.js", "../node_modules/lodash-es/_baseNth.js", "../node_modules/lodash-es/nth.js", "../node_modules/lodash-es/nthArg.js", "../node_modules/lodash-es/_baseUnset.js", "../node_modules/lodash-es/_customOmitClone.js", "../node_modules/lodash-es/omit.js", "../node_modules/lodash-es/omitBy.js", "../node_modules/lodash-es/once.js", "../node_modules/lodash-es/_baseSortBy.js", "../node_modules/lodash-es/_compareAscending.js", "../node_modules/lodash-es/_compareMultiple.js", "../node_modules/lodash-es/_baseOrderBy.js", "../node_modules/lodash-es/orderBy.js", "../node_modules/lodash-es/_createOver.js", "../node_modules/lodash-es/over.js", "../node_modules/lodash-es/_castRest.js", "../node_modules/lodash-es/overArgs.js", "../node_modules/lodash-es/overEvery.js", "../node_modules/lodash-es/overSome.js", "../node_modules/lodash-es/_baseRepeat.js", "../node_modules/lodash-es/_asciiSize.js", "../node_modules/lodash-es/_unicodeSize.js", "../node_modules/lodash-es/_stringSize.js", "../node_modules/lodash-es/_createPadding.js", "../node_modules/lodash-es/pad.js", "../node_modules/lodash-es/padEnd.js", "../node_modules/lodash-es/padStart.js", "../node_modules/lodash-es/parseInt.js", "../node_modules/lodash-es/partial.js", "../node_modules/lodash-es/partialRight.js", "../node_modules/lodash-es/partition.js", "../node_modules/lodash-es/_basePick.js", "../node_modules/lodash-es/pick.js", "../node_modules/lodash-es/plant.js", "../node_modules/lodash-es/propertyOf.js", "../node_modules/lodash-es/_baseIndexOfWith.js", "../node_modules/lodash-es/_basePullAll.js", "../node_modules/lodash-es/pullAll.js", "../node_modules/lodash-es/pull.js", "../node_modules/lodash-es/pullAllBy.js", "../node_modules/lodash-es/pullAllWith.js", "../node_modules/lodash-es/_basePullAt.js", "../node_modules/lodash-es/pullAt.js", "../node_modules/lodash-es/_baseRandom.js", "../node_modules/lodash-es/random.js", "../node_modules/lodash-es/_baseRange.js", "../node_modules/lodash-es/_createRange.js", "../node_modules/lodash-es/range.js", "../node_modules/lodash-es/rangeRight.js", "../node_modules/lodash-es/rearg.js", "../node_modules/lodash-es/_baseReduce.js", "../node_modules/lodash-es/reduce.js", "../node_modules/lodash-es/_arrayReduceRight.js", "../node_modules/lodash-es/reduceRight.js", "../node_modules/lodash-es/reject.js", "../node_modules/lodash-es/remove.js", "../node_modules/lodash-es/repeat.js", "../node_modules/lodash-es/replace.js", "../node_modules/lodash-es/rest.js", "../node_modules/lodash-es/result.js", "../node_modules/lodash-es/reverse.js", "../node_modules/lodash-es/round.js", "../node_modules/lodash-es/_arraySample.js", "../node_modules/lodash-es/_baseSample.js", "../node_modules/lodash-es/sample.js", "../node_modules/lodash-es/_shuffleSelf.js", "../node_modules/lodash-es/_arraySampleSize.js", "../node_modules/lodash-es/_baseSampleSize.js", "../node_modules/lodash-es/sampleSize.js", "../node_modules/lodash-es/set.js", "../node_modules/lodash-es/setWith.js", "../node_modules/lodash-es/_arrayShuffle.js", "../node_modules/lodash-es/_baseShuffle.js", "../node_modules/lodash-es/shuffle.js", "../node_modules/lodash-es/size.js", "../node_modules/lodash-es/slice.js", "../node_modules/lodash-es/snakeCase.js", "../node_modules/lodash-es/_baseSome.js", "../node_modules/lodash-es/some.js", "../node_modules/lodash-es/sortBy.js", "../node_modules/lodash-es/_baseSortedIndexBy.js", "../node_modules/lodash-es/_baseSortedIndex.js", "../node_modules/lodash-es/sortedIndex.js", "../node_modules/lodash-es/sortedIndexBy.js", "../node_modules/lodash-es/sortedIndexOf.js", "../node_modules/lodash-es/sortedLastIndex.js", "../node_modules/lodash-es/sortedLastIndexBy.js", "../node_modules/lodash-es/sortedLastIndexOf.js", "../node_modules/lodash-es/_baseSortedUniq.js", "../node_modules/lodash-es/sortedUniq.js", "../node_modules/lodash-es/sortedUniqBy.js", "../node_modules/lodash-es/split.js", "../node_modules/lodash-es/spread.js", "../node_modules/lodash-es/startCase.js", "../node_modules/lodash-es/startsWith.js", "../node_modules/lodash-es/stubObject.js", "../node_modules/lodash-es/stubString.js", "../node_modules/lodash-es/stubTrue.js", "../node_modules/lodash-es/subtract.js", "../node_modules/lodash-es/sum.js", "../node_modules/lodash-es/tail.js", "../node_modules/lodash-es/take.js", "../node_modules/lodash-es/takeRight.js", "../node_modules/lodash-es/takeRightWhile.js", "../node_modules/lodash-es/takeWhile.js", "../node_modules/lodash-es/tap.js", "../node_modules/lodash-es/_customDefaultsAssignIn.js", "../node_modules/lodash-es/_escapeStringChar.js", "../node_modules/lodash-es/_reInterpolate.js", "../node_modules/lodash-es/_reEscape.js", "../node_modules/lodash-es/_reEvaluate.js", "../node_modules/lodash-es/templateSettings.js", "../node_modules/lodash-es/template.js", "../node_modules/lodash-es/throttle.js", "../node_modules/lodash-es/thru.js", "../node_modules/lodash-es/times.js", "../node_modules/lodash-es/toIterator.js", "../node_modules/lodash-es/_baseWrapperValue.js", "../node_modules/lodash-es/wrapperValue.js", "../node_modules/lodash-es/toJSON.js", "../node_modules/lodash-es/toLower.js", "../node_modules/lodash-es/toPath.js", "../node_modules/lodash-es/toSafeInteger.js", "../node_modules/lodash-es/toUpper.js", "../node_modules/lodash-es/transform.js", "../node_modules/lodash-es/_charsEndIndex.js", "../node_modules/lodash-es/_charsStartIndex.js", "../node_modules/lodash-es/trim.js", "../node_modules/lodash-es/trimEnd.js", "../node_modules/lodash-es/trimStart.js", "../node_modules/lodash-es/truncate.js", "../node_modules/lodash-es/unary.js", "../node_modules/lodash-es/_unescapeHtmlChar.js", "../node_modules/lodash-es/unescape.js", "../node_modules/lodash-es/_createSet.js", "../node_modules/lodash-es/_baseUniq.js", "../node_modules/lodash-es/union.js", "../node_modules/lodash-es/unionBy.js", "../node_modules/lodash-es/unionWith.js", "../node_modules/lodash-es/uniq.js", "../node_modules/lodash-es/uniqBy.js", "../node_modules/lodash-es/uniqWith.js", "../node_modules/lodash-es/uniqueId.js", "../node_modules/lodash-es/unset.js", "../node_modules/lodash-es/unzip.js", "../node_modules/lodash-es/unzipWith.js", "../node_modules/lodash-es/_baseUpdate.js", "../node_modules/lodash-es/update.js", "../node_modules/lodash-es/updateWith.js", "../node_modules/lodash-es/upperCase.js", "../node_modules/lodash-es/value.js", "../node_modules/lodash-es/valueOf.js", "../node_modules/lodash-es/valuesIn.js", "../node_modules/lodash-es/without.js", "../node_modules/lodash-es/wrap.js", "../node_modules/lodash-es/wrapperAt.js", "../node_modules/lodash-es/wrapperChain.js", "../node_modules/lodash-es/wrapperReverse.js", "../node_modules/lodash-es/_baseXor.js", "../node_modules/lodash-es/xor.js", "../node_modules/lodash-es/xorBy.js", "../node_modules/lodash-es/xorWith.js", "../node_modules/lodash-es/zip.js", "../node_modules/lodash-es/_baseZipObject.js", "../node_modules/lodash-es/zipObject.js", "../node_modules/lodash-es/zipObjectDeep.js", "../node_modules/lodash-es/zipWith.js", "../node_modules/lodash-es/array.default.js", "../node_modules/lodash-es/array.js", "../node_modules/lodash-es/collection.default.js", "../node_modules/lodash-es/collection.js", "../node_modules/lodash-es/date.default.js", "../node_modules/lodash-es/date.js", "../node_modules/lodash-es/function.default.js", "../node_modules/lodash-es/function.js", "../node_modules/lodash-es/lang.default.js", "../node_modules/lodash-es/lang.js", "../node_modules/lodash-es/math.default.js", "../node_modules/lodash-es/math.js", "../node_modules/lodash-es/number.default.js", "../node_modules/lodash-es/number.js", "../node_modules/lodash-es/object.default.js", "../node_modules/lodash-es/object.js", "../node_modules/lodash-es/seq.default.js", "../node_modules/lodash-es/seq.js", "../node_modules/lodash-es/string.default.js", "../node_modules/lodash-es/string.js", "../node_modules/lodash-es/util.default.js", "../node_modules/lodash-es/util.js", "../node_modules/lodash-es/_lazyClone.js", "../node_modules/lodash-es/_lazyReverse.js", "../node_modules/lodash-es/_getView.js", "../node_modules/lodash-es/_lazyValue.js", "../node_modules/lodash-es/lodash.default.js", "../node_modules/lodash-es/lodash.js", "../src/constants/keys.ts", "../node_modules/axios/lib/helpers/bind.js", "../node_modules/axios/lib/utils.js", "../node_modules/axios/lib/core/AxiosError.js", "../node_modules/delayed-stream/lib/delayed_stream.js", "../node_modules/combined-stream/lib/combined_stream.js", "../node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js", "../node_modules/form-data/node_modules/mime-types/index.js", "../node_modules/asynckit/lib/defer.js", "../node_modules/asynckit/lib/async.js", "../node_modules/asynckit/lib/abort.js", "../node_modules/asynckit/lib/iterate.js", "../node_modules/asynckit/lib/state.js", "../node_modules/asynckit/lib/terminator.js", "../node_modules/asynckit/parallel.js", "../node_modules/asynckit/serialOrdered.js", "../node_modules/asynckit/serial.js", "../node_modules/asynckit/index.js", "../node_modules/es-object-atoms/index.js", "../node_modules/es-errors/index.js", "../node_modules/es-errors/eval.js", "../node_modules/es-errors/range.js", "../node_modules/es-errors/ref.js", "../node_modules/es-errors/syntax.js", "../node_modules/es-errors/type.js", "../node_modules/es-errors/uri.js", "../node_modules/math-intrinsics/abs.js", "../node_modules/math-intrinsics/floor.js", "../node_modules/math-intrinsics/max.js", "../node_modules/math-intrinsics/min.js", "../node_modules/math-intrinsics/pow.js", "../node_modules/math-intrinsics/round.js", "../node_modules/math-intrinsics/isNaN.js", "../node_modules/math-intrinsics/sign.js", "../node_modules/gopd/gOPD.js", "../node_modules/gopd/index.js", "../node_modules/es-define-property/index.js", "../node_modules/has-symbols/shams.js", "../node_modules/has-symbols/index.js", "../node_modules/get-proto/Reflect.getPrototypeOf.js", "../node_modules/get-proto/Object.getPrototypeOf.js", "../node_modules/function-bind/implementation.js", "../node_modules/function-bind/index.js", "../node_modules/call-bind-apply-helpers/functionCall.js", "../node_modules/call-bind-apply-helpers/functionApply.js", "../node_modules/call-bind-apply-helpers/reflectApply.js", "../node_modules/call-bind-apply-helpers/actualApply.js", "../node_modules/call-bind-apply-helpers/index.js", "../node_modules/dunder-proto/get.js", "../node_modules/get-proto/index.js", "../node_modules/hasown/index.js", "../node_modules/get-intrinsic/index.js", "../node_modules/has-tostringtag/shams.js", "../node_modules/es-set-tostringtag/index.js", "../node_modules/form-data/lib/populate.js", "../node_modules/form-data/lib/form_data.js", "../node_modules/axios/lib/platform/node/classes/FormData.js", "../node_modules/axios/lib/helpers/toFormData.js", "../node_modules/axios/lib/helpers/AxiosURLSearchParams.js", "../node_modules/axios/lib/helpers/buildURL.js", "../node_modules/axios/lib/core/InterceptorManager.js", "../node_modules/axios/lib/defaults/transitional.js", "../node_modules/axios/lib/platform/node/classes/URLSearchParams.js", "../node_modules/axios/lib/platform/node/index.js", "../node_modules/axios/lib/platform/common/utils.js", "../node_modules/axios/lib/platform/index.js", "../node_modules/axios/lib/helpers/toURLEncodedForm.js", "../node_modules/axios/lib/helpers/formDataToJSON.js", "../node_modules/axios/lib/defaults/index.js", "../node_modules/axios/lib/helpers/parseHeaders.js", "../node_modules/axios/lib/core/AxiosHeaders.js", "../node_modules/axios/lib/core/transformData.js", "../node_modules/axios/lib/cancel/isCancel.js", "../node_modules/axios/lib/cancel/CanceledError.js", "../node_modules/axios/lib/core/settle.js", "../node_modules/axios/lib/helpers/isAbsoluteURL.js", "../node_modules/axios/lib/helpers/combineURLs.js", "../node_modules/axios/lib/core/buildFullPath.js", "../node_modules/proxy-from-env/index.js", "../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/follow-redirects/debug.js", "../node_modules/follow-redirects/index.js", "../node_modules/axios/lib/env/data.js", "../node_modules/axios/lib/helpers/parseProtocol.js", "../node_modules/axios/lib/helpers/fromDataURI.js", "../node_modules/axios/lib/helpers/AxiosTransformStream.js", "../node_modules/axios/lib/helpers/readBlob.js", "../node_modules/axios/lib/helpers/formDataToStream.js", "../node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js", "../node_modules/axios/lib/helpers/callbackify.js", "../node_modules/axios/lib/helpers/speedometer.js", "../node_modules/axios/lib/helpers/throttle.js", "../node_modules/axios/lib/helpers/progressEventReducer.js", "../node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js", "../node_modules/axios/lib/adapters/http.js", "../node_modules/axios/lib/helpers/isURLSameOrigin.js", "../node_modules/axios/lib/helpers/cookies.js", "../node_modules/axios/lib/core/mergeConfig.js", "../node_modules/axios/lib/helpers/resolveConfig.js", "../node_modules/axios/lib/adapters/xhr.js", "../node_modules/axios/lib/helpers/composeSignals.js", "../node_modules/axios/lib/helpers/trackStream.js", "../node_modules/axios/lib/adapters/fetch.js", "../node_modules/axios/lib/adapters/adapters.js", "../node_modules/axios/lib/core/dispatchRequest.js", "../node_modules/axios/lib/helpers/validator.js", "../node_modules/axios/lib/core/Axios.js", "../node_modules/axios/lib/cancel/CancelToken.js", "../node_modules/axios/lib/helpers/spread.js", "../node_modules/axios/lib/helpers/isAxiosError.js", "../node_modules/axios/lib/helpers/HttpStatusCode.js", "../node_modules/axios/lib/axios.js", "../node_modules/axios/index.js", "../src/constants/oauth.ts", "../node_modules/chalk/source/vendor/ansi-styles/index.js", "../node_modules/chalk/source/vendor/supports-color/index.js", "../node_modules/chalk/source/utilities.js", "../node_modules/chalk/source/index.js", "../node_modules/is-plain-obj/index.js", "../node_modules/execa/lib/arguments/file-url.js", "../node_modules/execa/lib/methods/parameters.js", "../node_modules/execa/lib/utils/uint-array.js", "../node_modules/execa/lib/methods/template.js", "../node_modules/execa/lib/utils/standard-stream.js", "../node_modules/execa/lib/arguments/specific.js", "../node_modules/execa/lib/verbose/values.js", "../node_modules/execa/lib/arguments/escape.js", "../node_modules/is-unicode-supported/index.js", "../node_modules/figures/index.js", "../node_modules/yoctocolors/base.js", "../node_modules/yoctocolors/index.js", "../node_modules/execa/lib/verbose/default.js", "../node_modules/execa/lib/verbose/custom.js", "../node_modules/execa/lib/verbose/log.js", "../node_modules/execa/lib/verbose/start.js", "../node_modules/execa/lib/verbose/info.js", "../node_modules/execa/lib/return/duration.js", "../node_modules/execa/lib/arguments/command.js", "../node_modules/isexe/windows.js", "../node_modules/isexe/mode.js", "../node_modules/isexe/index.js", "../node_modules/which/which.js", "../node_modules/path-key/index.js", "../node_modules/cross-spawn/lib/util/resolveCommand.js", "../node_modules/cross-spawn/lib/util/escape.js", "../node_modules/shebang-regex/index.js", "../node_modules/shebang-command/index.js", "../node_modules/cross-spawn/lib/util/readShebang.js", "../node_modules/cross-spawn/lib/parse.js", "../node_modules/cross-spawn/lib/enoent.js", "../node_modules/cross-spawn/index.js", "../node_modules/npm-run-path/node_modules/path-key/index.js", "../node_modules/unicorn-magic/node.js", "../node_modules/npm-run-path/index.js", "../node_modules/execa/lib/return/final-error.js", "../node_modules/human-signals/build/src/realtime.js", "../node_modules/human-signals/build/src/core.js", "../node_modules/human-signals/build/src/signals.js", "../node_modules/human-signals/build/src/main.js", "../node_modules/execa/lib/terminate/signal.js", "../node_modules/execa/lib/terminate/kill.js", "../node_modules/execa/lib/utils/abort-signal.js", "../node_modules/execa/lib/terminate/cancel.js", "../node_modules/execa/lib/ipc/validation.js", "../node_modules/execa/lib/utils/deferred.js", "../node_modules/execa/lib/arguments/fd-options.js", "../node_modules/execa/lib/utils/max-listeners.js", "../node_modules/execa/lib/ipc/reference.js", "../node_modules/execa/lib/ipc/incoming.js", "../node_modules/execa/lib/ipc/forward.js", "../node_modules/execa/lib/ipc/strict.js", "../node_modules/execa/lib/ipc/outgoing.js", "../node_modules/execa/lib/ipc/send.js", "../node_modules/execa/lib/ipc/graceful.js", "../node_modules/execa/lib/terminate/graceful.js", "../node_modules/execa/lib/terminate/timeout.js", "../node_modules/execa/lib/methods/node.js", "../node_modules/execa/lib/ipc/ipc-input.js", "../node_modules/execa/lib/arguments/encoding-option.js", "../node_modules/execa/lib/arguments/cwd.js", "../node_modules/execa/lib/arguments/options.js", "../node_modules/execa/lib/arguments/shell.js", "../node_modules/strip-final-newline/index.js", "../node_modules/is-stream/index.js", "../node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js", "../node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js", "../node_modules/get-stream/source/stream.js", "../node_modules/get-stream/source/contents.js", "../node_modules/get-stream/source/utils.js", "../node_modules/get-stream/source/array.js", "../node_modules/get-stream/source/array-buffer.js", "../node_modules/get-stream/source/buffer.js", "../node_modules/get-stream/source/string.js", "../node_modules/get-stream/source/exports.js", "../node_modules/get-stream/source/index.js", "../node_modules/execa/lib/io/max-buffer.js", "../node_modules/execa/lib/return/message.js", "../node_modules/execa/lib/return/result.js", "../node_modules/parse-ms/index.js", "../node_modules/pretty-ms/index.js", "../node_modules/execa/lib/verbose/error.js", "../node_modules/execa/lib/verbose/complete.js", "../node_modules/execa/lib/return/reject.js", "../node_modules/execa/lib/stdio/type.js", "../node_modules/execa/lib/transform/object-mode.js", "../node_modules/execa/lib/transform/normalize.js", "../node_modules/execa/lib/stdio/direction.js", "../node_modules/execa/lib/ipc/array.js", "../node_modules/execa/lib/stdio/stdio-option.js", "../node_modules/execa/lib/stdio/native.js", "../node_modules/execa/lib/stdio/input-option.js", "../node_modules/execa/lib/stdio/duplicate.js", "../node_modules/execa/lib/stdio/handle.js", "../node_modules/execa/lib/stdio/handle-sync.js", "../node_modules/execa/lib/io/strip-newline.js", "../node_modules/execa/lib/transform/split.js", "../node_modules/execa/lib/transform/validate.js", "../node_modules/execa/lib/transform/encoding-transform.js", "../node_modules/execa/lib/transform/run-async.js", "../node_modules/execa/lib/transform/run-sync.js", "../node_modules/execa/lib/transform/generator.js", "../node_modules/execa/lib/io/input-sync.js", "../node_modules/execa/lib/verbose/output.js", "../node_modules/execa/lib/io/output-sync.js", "../node_modules/execa/lib/resolve/all-sync.js", "../node_modules/execa/lib/resolve/exit-async.js", "../node_modules/execa/lib/resolve/exit-sync.js", "../node_modules/execa/lib/methods/main-sync.js", "../node_modules/execa/lib/ipc/get-one.js", "../node_modules/execa/lib/ipc/get-each.js", "../node_modules/execa/lib/ipc/methods.js", "../node_modules/execa/lib/return/early-error.js", "../node_modules/execa/lib/stdio/handle-async.js", "../node_modules/@sindresorhus/merge-streams/index.js", "../node_modules/execa/lib/io/pipeline.js", "../node_modules/execa/lib/io/output-async.js", "../node_modules/signal-exit/dist/mjs/signals.js", "../node_modules/signal-exit/dist/mjs/index.js", "../node_modules/execa/lib/terminate/cleanup.js", "../node_modules/execa/lib/pipe/pipe-arguments.js", "../node_modules/execa/lib/pipe/throw.js", "../node_modules/execa/lib/pipe/sequence.js", "../node_modules/execa/lib/pipe/streaming.js", "../node_modules/execa/lib/pipe/abort.js", "../node_modules/execa/lib/pipe/setup.js", "../node_modules/execa/lib/io/iterate.js", "../node_modules/execa/lib/io/contents.js", "../node_modules/execa/lib/resolve/wait-stream.js", "../node_modules/execa/lib/resolve/stdio.js", "../node_modules/execa/lib/resolve/all-async.js", "../node_modules/execa/lib/verbose/ipc.js", "../node_modules/execa/lib/ipc/buffer-messages.js", "../node_modules/execa/lib/resolve/wait-subprocess.js", "../node_modules/execa/lib/convert/concurrent.js", "../node_modules/execa/lib/convert/shared.js", "../node_modules/execa/lib/convert/readable.js", "../node_modules/execa/lib/convert/writable.js", "../node_modules/execa/lib/convert/duplex.js", "../node_modules/execa/lib/convert/iterable.js", "../node_modules/execa/lib/convert/add.js", "../node_modules/execa/lib/methods/promise.js", "../node_modules/execa/lib/methods/main-async.js", "../node_modules/execa/lib/methods/bind.js", "../node_modules/execa/lib/methods/create.js", "../node_modules/execa/lib/methods/command.js", "../node_modules/execa/lib/methods/script.js", "../node_modules/execa/index.js", "../src/constants/xml.ts", "../src/types/logs.ts", "../node_modules/is-safe-filename/index.js", "../node_modules/env-paths/index.js", "../src/utils/hash.ts", "../src/utils/cachePaths.ts", "../src/utils/displayTags.ts", "../src/utils/privacyLevel.ts", "../src/utils/log.ts", "../src/utils/sequential.ts", "../node_modules/zod/v4/core/core.js", "../node_modules/zod/v4/core/util.js", "../node_modules/zod/v4/core/errors.js", "../node_modules/zod/v4/core/parse.js", "../node_modules/zod/v4/core/regexes.js", "../node_modules/zod/v4/core/checks.js", "../node_modules/zod/v4/core/doc.js", "../node_modules/zod/v4/core/versions.js", "../node_modules/zod/v4/core/schemas.js", "../node_modules/zod/v4/locales/ar.js", "../node_modules/zod/v4/locales/az.js", "../node_modules/zod/v4/locales/be.js", "../node_modules/zod/v4/locales/ca.js", "../node_modules/zod/v4/locales/cs.js", "../node_modules/zod/v4/locales/de.js", "../node_modules/zod/v4/locales/en.js", "../node_modules/zod/v4/locales/eo.js", "../node_modules/zod/v4/locales/es.js", "../node_modules/zod/v4/locales/fa.js", "../node_modules/zod/v4/locales/fi.js", "../node_modules/zod/v4/locales/fr.js", "../node_modules/zod/v4/locales/fr-CA.js", "../node_modules/zod/v4/locales/he.js", "../node_modules/zod/v4/locales/hu.js", "../node_modules/zod/v4/locales/id.js", "../node_modules/zod/v4/locales/it.js", "../node_modules/zod/v4/locales/ja.js", "../node_modules/zod/v4/locales/kh.js", "../node_modules/zod/v4/locales/ko.js", "../node_modules/zod/v4/locales/mk.js", "../node_modules/zod/v4/locales/ms.js", "../node_modules/zod/v4/locales/nl.js", "../node_modules/zod/v4/locales/no.js", "../node_modules/zod/v4/locales/ota.js", "../node_modules/zod/v4/locales/ps.js", "../node_modules/zod/v4/locales/pl.js", "../node_modules/zod/v4/locales/pt.js", "../node_modules/zod/v4/locales/ru.js", "../node_modules/zod/v4/locales/sl.js", "../node_modules/zod/v4/locales/sv.js", "../node_modules/zod/v4/locales/ta.js", "../node_modules/zod/v4/locales/th.js", "../node_modules/zod/v4/locales/tr.js", "../node_modules/zod/v4/locales/ua.js", "../node_modules/zod/v4/locales/ur.js", "../node_modules/zod/v4/locales/vi.js", "../node_modules/zod/v4/locales/zh-CN.js", "../node_modules/zod/v4/locales/zh-TW.js", "../node_modules/zod/v4/locales/index.js", "../node_modules/zod/v4/core/registries.js", "../node_modules/zod/v4/core/api.js", "../node_modules/zod/v4/core/function.js", "../node_modules/zod/v4/core/to-json-schema.js", "../node_modules/zod/v4/core/index.js", "../node_modules/zod/v4/classic/checks.js", "../node_modules/zod/v4/classic/iso.js", "../node_modules/zod/v4/classic/errors.js", "../node_modules/zod/v4/classic/parse.js", "../node_modules/zod/v4/classic/schemas.js", "../node_modules/zod/v4/classic/compat.js", "../node_modules/zod/v4/classic/coerce.js", "../node_modules/zod/v4/classic/external.js", "../node_modules/zod/v4/classic/index.js", "../node_modules/zod/v4/index.js", "../src/utils/fileRead.ts", "../src/utils/jsonRead.ts", "../src/services/remoteManagedSettings/syncCacheState.ts", "../src/utils/array.ts", "../src/utils/diagLogs.ts", "../src/utils/cwd.ts", "../src/utils/fileReadCache.ts", "../src/utils/platform.ts", "../src/utils/execSyncWrapper.ts", "../node_modules/lru-cache/dist/esm/index.min.js", "../src/utils/memoize.ts", "../src/utils/windowsPaths.ts", "../src/utils/getWorktreePathsPortable.ts", "../src/utils/sessionStoragePortable.ts", "../src/utils/path.ts", "../src/utils/file.ts", "../src/utils/execFileNoThrowPortable.ts", "../src/utils/execFileNoThrow.ts", "../src/constants/files.ts", "../src/utils/git/gitConfigParser.ts", "../src/utils/git/gitFilesystem.ts", "../src/utils/which.ts", "../src/utils/detectRepository.ts", "../src/utils/git.ts", "../src/utils/git/gitignore.ts", "../node_modules/jsonc-parser/lib/esm/impl/scanner.js", "../node_modules/jsonc-parser/lib/esm/impl/string-intern.js", "../node_modules/jsonc-parser/lib/esm/impl/format.js", "../node_modules/jsonc-parser/lib/esm/impl/parser.js", "../node_modules/jsonc-parser/lib/esm/impl/edit.js", "../node_modules/jsonc-parser/lib/esm/main.js", "../src/utils/json.ts", "../src/utils/settings/constants.ts", "../src/utils/settings/internalWrites.ts", "../src/utils/settings/managedPath.ts", "../src/utils/lazySchema.ts", "../src/entrypoints/sandboxTypes.ts", "../src/utils/bundledMode.ts", "../src/utils/findExecutable.ts", "../src/utils/env.ts", "../src/constants/figures.ts", "../src/types/permissions.ts", "../src/utils/permissions/PermissionMode.ts", "../src/entrypoints/sdk/coreTypes.ts", "../src/entrypoints/agentSdkTypes.ts", "../src/utils/shell/shellProvider.ts", "../src/schemas/hooks.ts", "../src/services/mcp/types.ts", "../src/utils/plugins/schemas.ts", "../src/services/mcp/normalization.ts", "../src/services/mcp/mcpStringUtils.ts", "../src/tools/AgentTool/constants.ts", "../src/tools/TaskOutputTool/constants.ts", "../src/tools/TaskStopTool/prompt.ts", "../src/tools/BriefTool/prompt.ts", "../src/utils/permissions/permissionRuleParser.ts", "../src/utils/stringUtils.ts", "../src/utils/settings/toolValidationConfig.ts", "../src/utils/settings/permissionValidation.ts", "../src/utils/settings/types.ts", "../src/utils/settings/schemaOutput.ts", "../src/utils/settings/validationTips.ts", "../src/utils/settings/validation.ts", "../src/utils/settings/mdm/constants.ts", "../src/utils/settings/mdm/rawRead.ts", "../src/utils/settings/mdm/settings.ts", "../src/utils/settings/settings.ts", "../node_modules/agent-base/dist/helpers.js", "../node_modules/agent-base/dist/index.js", "../node_modules/https-proxy-agent/dist/parse-proxy-response.js", "../node_modules/https-proxy-agent/dist/index.js", "../src/utils/caCerts.ts", "../node_modules/undici/lib/core/symbols.js", "../node_modules/undici/lib/util/timers.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/util/stats.js", "../node_modules/undici/lib/core/diagnostics.js", "../node_modules/undici/lib/core/request.js", "../node_modules/undici/lib/handler/wrap-handler.js", "../node_modules/undici/lib/dispatcher/dispatcher.js", "../node_modules/undici/lib/handler/unwrap-handler.js", "../node_modules/undici/lib/dispatcher/dispatcher-base.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/encoding/index.js", "../node_modules/undici/lib/web/infra/index.js", "../node_modules/undici/lib/web/fetch/data-url.js", "../node_modules/undici/lib/util/runtime-features.js", "../node_modules/undici/lib/web/webidl/index.js", "../node_modules/undici/lib/web/fetch/util.js", "../node_modules/undici/lib/web/fetch/formdata.js", "../node_modules/undici/lib/web/fetch/formdata-parser.js", "../node_modules/undici/lib/util/promise.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/dispatcher/client.js", "../node_modules/undici/lib/dispatcher/fixed-queue.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/round-robin-pool.js", "../node_modules/undici/lib/dispatcher/agent.js", "../node_modules/undici/lib/core/socks5-utils.js", "../node_modules/undici/lib/core/socks5-client.js", "../node_modules/undici/lib/dispatcher/socks5-proxy-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/dispatcher/h2c-client.js", "../node_modules/undici/lib/api/readable.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-call-history.js", "../node_modules/undici/lib/mock/mock-pool.js", "../node_modules/undici/lib/mock/pending-interceptors-formatter.js", "../node_modules/undici/lib/mock/mock-agent.js", "../node_modules/undici/lib/mock/snapshot-utils.js", "../node_modules/undici/lib/mock/snapshot-recorder.js", "../node_modules/undici/lib/mock/snapshot-agent.js", "../node_modules/undici/lib/global.js", "../node_modules/undici/lib/handler/decorator-handler.js", "../node_modules/undici/lib/handler/redirect-handler.js", "../node_modules/undici/lib/interceptor/redirect.js", "../node_modules/undici/lib/interceptor/response-error.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/util/cache.js", "../node_modules/undici/lib/util/date.js", "../node_modules/undici/lib/handler/cache-handler.js", "../node_modules/undici/lib/cache/memory-cache-store.js", "../node_modules/undici/lib/handler/cache-revalidation-handler.js", "../node_modules/undici/lib/interceptor/cache.js", "../node_modules/undici/lib/interceptor/decompress.js", "../node_modules/undici/lib/handler/deduplication-handler.js", "../node_modules/undici/lib/interceptor/deduplicate.js", "../node_modules/undici/lib/cache/sqlite-cache-store.js", "../node_modules/undici/lib/web/fetch/headers.js", "../node_modules/undici/lib/web/fetch/response.js", "../node_modules/undici/lib/web/fetch/request.js", "../node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js", "../node_modules/undici/lib/web/fetch/index.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/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/websocket/stream/websocketerror.js", "../node_modules/undici/lib/web/websocket/stream/websocketstream.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", "../src/utils/mtls.ts", "../node_modules/@smithy/types/dist-cjs/index.js", "../node_modules/@smithy/protocol-http/dist-cjs/index.js", "../node_modules/@smithy/util-uri-escape/dist-cjs/index.js", "../node_modules/@smithy/querystring-builder/dist-cjs/index.js", "../node_modules/@smithy/node-http-handler/dist-cjs/index.js", "../node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js", "../node_modules/@smithy/property-provider/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js", "../node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js", "../node_modules/@smithy/node-config-provider/dist-cjs/index.js", "../node_modules/@smithy/querystring-parser/dist-cjs/index.js", "../node_modules/@smithy/url-parser/dist-cjs/index.js", "../node_modules/@smithy/credential-provider-imds/dist-cjs/index.js", "../node_modules/tslib/tslib.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js", "../node_modules/@smithy/middleware-stack/dist-cjs/index.js", "../node_modules/@smithy/is-array-buffer/dist-cjs/index.js", "../node_modules/@smithy/util-buffer-from/dist-cjs/index.js", "../node_modules/@smithy/util-base64/dist-cjs/fromBase64.js", "../node_modules/@smithy/util-utf8/dist-cjs/index.js", "../node_modules/@smithy/util-base64/dist-cjs/toBase64.js", "../node_modules/@smithy/util-base64/dist-cjs/index.js", "../node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js", "../node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js", "../node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js", "../node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js", "../node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js", "../node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js", "../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js", "../node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/headStream.js", "../node_modules/@smithy/fetch-http-handler/dist-cjs/index.js", "../node_modules/@smithy/util-hex-encoding/dist-cjs/index.js", "../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js", "../node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js", "../node_modules/@smithy/util-stream/dist-cjs/splitStream.js", "../node_modules/@smithy/util-stream/dist-cjs/index.js", "../node_modules/@smithy/util-middleware/dist-cjs/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/schema/index.js", "../node_modules/@smithy/uuid/dist-cjs/randomUUID.js", "../node_modules/@smithy/uuid/dist-cjs/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/serde/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js", "../node_modules/@smithy/smithy-client/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js", "../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js", "../node_modules/@smithy/core/dist-cjs/index.js", "../node_modules/@smithy/signature-v4/dist-cjs/index.js", "../node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js", "../node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js", "../node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js", "../node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js", "../node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js", "../node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js", "../node_modules/@smithy/util-endpoints/dist-cjs/index.js", "../node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js", "../node_modules/@smithy/service-error-classification/dist-cjs/index.js", "../node_modules/@smithy/util-retry/dist-cjs/index.js", "../node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js", "../node_modules/@smithy/util-config-provider/dist-cjs/index.js", "../node_modules/@smithy/config-resolver/dist-cjs/index.js", "../node_modules/@smithy/middleware-content-length/dist-cjs/index.js", "../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js", "../node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js", "../node_modules/@smithy/middleware-serde/dist-cjs/index.js", "../node_modules/@smithy/middleware-endpoint/dist-cjs/index.js", "../node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js", "../node_modules/@smithy/middleware-retry/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js", "../node_modules/@smithy/hash-node/dist-cjs/index.js", "../node_modules/@smithy/util-body-length-node/dist-cjs/index.js", "../node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js", "../node_modules/@smithy/util-body-length-browser/dist-cjs/index.js", "../node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js", "../node_modules/fast-xml-parser/lib/fxp.cjs", "../node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js", "../node_modules/@aws-sdk/xml-builder/dist-cjs/index.js", "../node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/models/SSOOIDCServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.js", "../node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js", "../node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js", "../node_modules/@aws-sdk/token-providers/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/SSOServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/runtimeConfig.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js", "../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js", "../node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/models/SigninServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js", "../node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/EndpointParameters.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/models/STSServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/auth/httpAuthExtensionConfiguration.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeExtensions.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/STSClient.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js", "../node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js", "../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js", "../node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js", "../src/utils/proxy.ts", "stub-npm:@aws-sdk/client-bedrock", "stub-npm:@aws-sdk/client-bedrock-runtime", "../src/utils/model/bedrock.ts", "../src/utils/model/configs.ts", "../src/utils/model/providers.ts", "../src/utils/model/modelStrings.ts", "../src/utils/billing.ts", "../src/services/mockRateLimits.ts", "../src/services/oauth/getOauthProfile.ts", "../src/services/oauth/client.ts", "../src/utils/authFileDescriptor.ts", "../src/utils/secureStorage/macOsKeychainHelpers.ts", "../src/utils/authPortable.ts", "stub-npm:@aws-sdk/client-sts", "../node_modules/@aws-sdk/credential-providers/dist-cjs/createCredentialChain.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/auth/httpAuthSchemeProvider.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/endpoint/ruleset.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/endpoint/endpointResolver.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/models/CognitoIdentityServiceException.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/models/errors.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/schemas/schemas_0.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.shared.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/runtimeConfig.js", "../node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js", "../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/loadCognitoIdentity-C-kPrLZ4.js", "../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromLoginCredentials.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/loadSts.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.base.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js", "../node_modules/@aws-sdk/credential-providers/dist-cjs/index.js", "../src/utils/aws.ts", "../src/utils/awsAuthStatusManager.ts", "../src/constants/betas.ts", "../src/utils/fastMode.ts", "../src/utils/modelCost.ts", "../src/utils/model/aliases.ts", "../src/utils/model/modelAllowlist.ts", "../src/utils/model/model.ts", "stub-npm:@anthropic-ai/bedrock-sdk", "stub-npm:@anthropic-ai/foundry-sdk", "stub-npm:@azure/identity", "stub-npm:@anthropic-ai/vertex-sdk", "../node_modules/extend/index.js", "../node_modules/webidl-conversions/lib/index.js", "../node_modules/whatwg-url/lib/utils.js", "../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.js", "../node_modules/gaxios/node_modules/is-stream/index.js", "../node_modules/gaxios/build/src/util.js", "../node_modules/gaxios/build/src/common.js", "../node_modules/gaxios/build/src/retry.js", "../node_modules/gaxios/node_modules/uuid/dist/rng.js", "../node_modules/gaxios/node_modules/uuid/dist/regex.js", "../node_modules/gaxios/node_modules/uuid/dist/validate.js", "../node_modules/gaxios/node_modules/uuid/dist/stringify.js", "../node_modules/gaxios/node_modules/uuid/dist/v1.js", "../node_modules/gaxios/node_modules/uuid/dist/parse.js", "../node_modules/gaxios/node_modules/uuid/dist/v35.js", "../node_modules/gaxios/node_modules/uuid/dist/md5.js", "../node_modules/gaxios/node_modules/uuid/dist/v3.js", "../node_modules/gaxios/node_modules/uuid/dist/native.js", "../node_modules/gaxios/node_modules/uuid/dist/v4.js", "../node_modules/gaxios/node_modules/uuid/dist/sha1.js", "../node_modules/gaxios/node_modules/uuid/dist/v5.js", "../node_modules/gaxios/node_modules/uuid/dist/nil.js", "../node_modules/gaxios/node_modules/uuid/dist/version.js", "../node_modules/gaxios/node_modules/uuid/dist/index.js", "../node_modules/gaxios/build/src/interceptor.js", "../node_modules/gaxios/build/src/gaxios.js", "../node_modules/gaxios/build/src/index.js", "../node_modules/bignumber.js/bignumber.js", "../node_modules/json-bigint/lib/stringify.js", "../node_modules/json-bigint/lib/parse.js", "../node_modules/json-bigint/index.js", "../node_modules/gcp-metadata/build/src/gcp-residency.js", "../node_modules/google-logging-utils/build/src/colours.js", "../node_modules/google-logging-utils/build/src/logging-utils.js", "../node_modules/google-logging-utils/build/src/index.js", "../node_modules/gcp-metadata/build/src/index.js", "../node_modules/base64-js/index.js", "../node_modules/google-auth-library/build/src/crypto/browser/crypto.js", "../node_modules/google-auth-library/build/src/crypto/node/crypto.js", "../node_modules/google-auth-library/build/src/crypto/crypto.js", "../node_modules/google-auth-library/build/src/options.js", "../node_modules/google-auth-library/build/src/transporters.js", "../node_modules/safe-buffer/index.js", "../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js", "../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js", "../node_modules/google-auth-library/build/src/util.js", "../node_modules/google-auth-library/build/src/auth/authclient.js", "../node_modules/google-auth-library/build/src/auth/loginticket.js", "../node_modules/google-auth-library/build/src/auth/oauth2client.js", "../node_modules/google-auth-library/build/src/auth/computeclient.js", "../node_modules/google-auth-library/build/src/auth/idtokenclient.js", "../node_modules/google-auth-library/build/src/auth/envDetect.js", "../node_modules/jws/lib/data-stream.js", "../node_modules/buffer-equal-constant-time/index.js", "../node_modules/jwa/index.js", "../node_modules/jws/lib/tostring.js", "../node_modules/jws/lib/sign-stream.js", "../node_modules/jws/lib/verify-stream.js", "../node_modules/jws/index.js", "../node_modules/gtoken/build/src/index.js", "../node_modules/google-auth-library/build/src/auth/jwtaccess.js", "../node_modules/google-auth-library/build/src/auth/jwtclient.js", "../node_modules/google-auth-library/build/src/auth/refreshclient.js", "../node_modules/google-auth-library/build/src/auth/impersonated.js", "../node_modules/google-auth-library/build/src/auth/oauth2common.js", "../node_modules/google-auth-library/build/src/auth/stscredentials.js", "../node_modules/google-auth-library/build/src/auth/baseexternalclient.js", "../node_modules/google-auth-library/build/src/auth/filesubjecttokensupplier.js", "../node_modules/google-auth-library/build/src/auth/urlsubjecttokensupplier.js", "../node_modules/google-auth-library/build/src/auth/identitypoolclient.js", "../node_modules/google-auth-library/build/src/auth/awsrequestsigner.js", "../node_modules/google-auth-library/build/src/auth/defaultawssecuritycredentialssupplier.js", "../node_modules/google-auth-library/build/src/auth/awsclient.js", "../node_modules/google-auth-library/build/src/auth/executable-response.js", "../node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js", "../node_modules/google-auth-library/build/src/auth/pluggable-auth-client.js", "../node_modules/google-auth-library/build/src/auth/externalclient.js", "../node_modules/google-auth-library/build/src/auth/externalAccountAuthorizedUserClient.js", "../node_modules/google-auth-library/build/src/auth/googleauth.js", "../node_modules/google-auth-library/build/src/auth/iam.js", "../node_modules/google-auth-library/build/src/auth/downscopedclient.js", "../node_modules/google-auth-library/build/src/auth/passthrough.js", "../node_modules/google-auth-library/build/src/index.js", "../src/services/api/client.ts", "../src/utils/model/modelCapabilities.ts", "../src/utils/context.ts", "../src/utils/model/modelSupportOverrides.ts", "../src/utils/betas.ts", "../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/retry/lib/retry_operation.js", "../node_modules/retry/lib/retry.js", "../node_modules/proper-lockfile/node_modules/signal-exit/signals.js", "../node_modules/proper-lockfile/node_modules/signal-exit/index.js", "../node_modules/proper-lockfile/lib/mtime-precision.js", "../node_modules/proper-lockfile/lib/lockfile.js", "../node_modules/proper-lockfile/lib/adapter.js", "../node_modules/proper-lockfile/index.js", "../src/utils/lockfile.ts", "../src/utils/secureStorage/fallbackStorage.ts", "../src/utils/secureStorage/macOsKeychainStorage.ts", "../src/utils/secureStorage/plainTextStorage.ts", "../src/utils/secureStorage/index.ts", "../src/utils/secureStorage/keychainPrefetch.ts", "../src/utils/sleep.ts", "../src/utils/toolSchemaCache.ts", "../src/utils/auth.ts", "../src/utils/userAgent.ts", "../src/utils/workloadContext.ts", "../src/utils/http.ts", "../src/utils/user.ts", "../node_modules/@opentelemetry/api/build/src/version.js", "../node_modules/@opentelemetry/api/build/src/internal/semver.js", "../node_modules/@opentelemetry/api/build/src/internal/global-utils.js", "../node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js", "../node_modules/@opentelemetry/api/build/src/diag/types.js", "../node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js", "../node_modules/@opentelemetry/api/build/src/api/diag.js", "../node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js", "../node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js", "../node_modules/@opentelemetry/api/build/src/baggage/utils.js", "../node_modules/@opentelemetry/api/build/src/context/context.js", "../node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js", "../node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js", "../node_modules/@opentelemetry/api/build/src/metrics/Metric.js", "../node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js", "../node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js", "../node_modules/@opentelemetry/api/build/src/api/context.js", "../node_modules/@opentelemetry/api/build/src/trace/trace_flags.js", "../node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js", "../node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js", "../node_modules/@opentelemetry/api/build/src/trace/context-utils.js", "../node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js", "../node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js", "../node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js", "../node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js", "../node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js", "../node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js", "../node_modules/@opentelemetry/api/build/src/trace/span_kind.js", "../node_modules/@opentelemetry/api/build/src/trace/status.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js", "../node_modules/@opentelemetry/api/build/src/trace/internal/utils.js", "../node_modules/@opentelemetry/api/build/src/context-api.js", "../node_modules/@opentelemetry/api/build/src/diag-api.js", "../node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js", "../node_modules/@opentelemetry/api/build/src/api/metrics.js", "../node_modules/@opentelemetry/api/build/src/metrics-api.js", "../node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js", "../node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js", "../node_modules/@opentelemetry/api/build/src/api/propagation.js", "../node_modules/@opentelemetry/api/build/src/propagation-api.js", "../node_modules/@opentelemetry/api/build/src/api/trace.js", "../node_modules/@opentelemetry/api/build/src/trace-api.js", "../node_modules/@opentelemetry/api/build/src/index.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js", "../node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions/build/src/index.js", "../node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js", "../node_modules/@opentelemetry/core/build/src/baggage/constants.js", "../node_modules/@opentelemetry/core/build/src/baggage/utils.js", "../node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js", "../node_modules/@opentelemetry/core/build/src/common/anchored-clock.js", "../node_modules/@opentelemetry/core/build/src/common/attributes.js", "../node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js", "../node_modules/@opentelemetry/core/build/src/common/global-error-handler.js", "../node_modules/@opentelemetry/core/build/src/utils/sampling.js", "../node_modules/@opentelemetry/core/build/src/utils/environment.js", "../node_modules/@opentelemetry/core/build/src/platform/node/environment.js", "../node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js", "../node_modules/@opentelemetry/core/build/src/common/hex-to-binary.js", "../node_modules/@opentelemetry/core/build/src/platform/node/hex-to-base64.js", "../node_modules/@opentelemetry/core/build/src/platform/node/RandomIdGenerator.js", "../node_modules/@opentelemetry/core/build/src/platform/node/performance.js", "../node_modules/@opentelemetry/core/build/src/version.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js", "../node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions/build/src/index.js", "../node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js", "../node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js", "../node_modules/@opentelemetry/core/build/src/platform/node/index.js", "../node_modules/@opentelemetry/core/build/src/platform/index.js", "../node_modules/@opentelemetry/core/build/src/common/time.js", "../node_modules/@opentelemetry/core/build/src/ExportResult.js", "../node_modules/@opentelemetry/core/build/src/propagation/composite.js", "../node_modules/@opentelemetry/core/build/src/internal/validators.js", "../node_modules/@opentelemetry/core/build/src/trace/TraceState.js", "../node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js", "../node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js", "../node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOffSampler.js", "../node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOnSampler.js", "../node_modules/@opentelemetry/core/build/src/trace/sampler/ParentBasedSampler.js", "../node_modules/@opentelemetry/core/build/src/trace/sampler/TraceIdRatioBasedSampler.js", "../node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js", "../node_modules/@opentelemetry/core/build/src/utils/merge.js", "../node_modules/@opentelemetry/core/build/src/utils/timeout.js", "../node_modules/@opentelemetry/core/build/src/utils/url.js", "../node_modules/@opentelemetry/core/build/src/utils/wrap.js", "../node_modules/@opentelemetry/core/build/src/utils/promise.js", "../node_modules/@opentelemetry/core/build/src/utils/callback.js", "../node_modules/@opentelemetry/core/build/src/internal/exporter.js", "../node_modules/@opentelemetry/core/build/src/index.js", "../node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js", "../node_modules/@opentelemetry/resources/build/src/platform/node/index.js", "../node_modules/@opentelemetry/resources/build/src/platform/index.js", "../node_modules/@opentelemetry/resources/build/src/Resource.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js", "../node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js", "../node_modules/@opentelemetry/resources/build/src/detectors/BrowserDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/BrowserDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/EnvDetectorSync.js", "../node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js", "../node_modules/@opentelemetry/resources/build/src/detectors/index.js", "../node_modules/@opentelemetry/resources/build/src/utils.js", "../node_modules/@opentelemetry/resources/build/src/detect-resources.js", "../node_modules/@opentelemetry/resources/build/src/index.js", "../node_modules/@opentelemetry/api-logs/build/src/types/LogRecord.js", "../node_modules/@opentelemetry/api-logs/build/src/NoopLogger.js", "../node_modules/@opentelemetry/api-logs/build/src/NoopLoggerProvider.js", "../node_modules/@opentelemetry/api-logs/build/src/ProxyLogger.js", "../node_modules/@opentelemetry/api-logs/build/src/ProxyLoggerProvider.js", "../node_modules/@opentelemetry/api-logs/build/src/platform/node/globalThis.js", "../node_modules/@opentelemetry/api-logs/build/src/platform/node/index.js", "../node_modules/@opentelemetry/api-logs/build/src/platform/index.js", "../node_modules/@opentelemetry/api-logs/build/src/internal/global-utils.js", "../node_modules/@opentelemetry/api-logs/build/src/api/logs.js", "../node_modules/@opentelemetry/api-logs/build/src/index.js", "../node_modules/@opentelemetry/sdk-logs/build/src/LogRecord.js", "../node_modules/@opentelemetry/sdk-logs/build/src/Logger.js", "../node_modules/@opentelemetry/sdk-logs/build/src/config.js", "../node_modules/@opentelemetry/sdk-logs/build/src/MultiLogRecordProcessor.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/NoopLogRecordProcessor.js", "../node_modules/@opentelemetry/sdk-logs/build/src/internal/LoggerProviderSharedState.js", "../node_modules/@opentelemetry/sdk-logs/build/src/LoggerProvider.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/ConsoleLogRecordExporter.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/SimpleLogRecordProcessor.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/InMemoryLogRecordExporter.js", "../node_modules/@opentelemetry/sdk-logs/build/src/export/BatchLogRecordProcessorBase.js", "../node_modules/@opentelemetry/sdk-logs/build/src/platform/node/export/BatchLogRecordProcessor.js", "../node_modules/@opentelemetry/sdk-logs/build/src/platform/node/index.js", "../node_modules/@opentelemetry/sdk-logs/build/src/platform/index.js", "../node_modules/@opentelemetry/sdk-logs/build/src/index.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js", "../node_modules/@opentelemetry/semantic-conventions/build/src/index.js", "../src/services/analytics/config.ts", "../src/types/generated/google/protobuf/timestamp.ts", "../src/types/generated/events_mono/common/v1/auth.ts", "../src/types/generated/events_mono/claude_code/v1/claude_code_internal_event.ts", "../src/types/generated/events_mono/growthbook/v1/growthbook_experiment_event.ts", "../src/utils/genericProcessUtils.ts", "../src/utils/envDynamic.ts", "../src/services/mcp/officialRegistry.ts", "../src/utils/agentSwarmsEnabled.ts", "../src/utils/agentContext.ts", "../src/utils/teammateContext.ts", "../src/utils/teammate.ts", "../src/utils/computerUse/common.ts", "../src/services/analytics/metadata.ts", "../src/services/analytics/firstPartyEventLoggingExporter.ts", "../src/services/analytics/sinkKillswitch.ts", "../src/services/analytics/firstPartyEventLogger.ts", "../src/services/analytics/growthbook.ts", "../src/memdir/paths.ts", "../src/utils/configConstants.ts", "../src/memdir/teamMemPaths.ts", "../node_modules/semver/internal/constants.js", "../node_modules/semver/internal/debug.js", "../node_modules/semver/internal/re.js", "../node_modules/semver/internal/parse-options.js", "../node_modules/semver/internal/identifiers.js", "../node_modules/semver/classes/semver.js", "../node_modules/semver/functions/parse.js", "../node_modules/semver/functions/valid.js", "../node_modules/semver/functions/clean.js", "../node_modules/semver/functions/inc.js", "../node_modules/semver/functions/diff.js", "../node_modules/semver/functions/major.js", "../node_modules/semver/functions/minor.js", "../node_modules/semver/functions/patch.js", "../node_modules/semver/functions/prerelease.js", "../node_modules/semver/functions/compare.js", "../node_modules/semver/functions/rcompare.js", "../node_modules/semver/functions/compare-loose.js", "../node_modules/semver/functions/compare-build.js", "../node_modules/semver/functions/sort.js", "../node_modules/semver/functions/rsort.js", "../node_modules/semver/functions/gt.js", "../node_modules/semver/functions/lt.js", "../node_modules/semver/functions/eq.js", "../node_modules/semver/functions/neq.js", "../node_modules/semver/functions/gte.js", "../node_modules/semver/functions/lte.js", "../node_modules/semver/functions/cmp.js", "../node_modules/semver/functions/coerce.js", "../node_modules/semver/internal/lrucache.js", "../node_modules/semver/classes/range.js", "../node_modules/semver/classes/comparator.js", "../node_modules/semver/functions/satisfies.js", "../node_modules/semver/ranges/to-comparators.js", "../node_modules/semver/ranges/max-satisfying.js", "../node_modules/semver/ranges/min-satisfying.js", "../node_modules/semver/ranges/min-version.js", "../node_modules/semver/ranges/valid.js", "../node_modules/semver/ranges/outside.js", "../node_modules/semver/ranges/gtr.js", "../node_modules/semver/ranges/ltr.js", "../node_modules/semver/ranges/intersects.js", "../node_modules/semver/ranges/simplify.js", "../node_modules/semver/ranges/subset.js", "../node_modules/semver/index.js", "../src/utils/semver.ts", "../src/bridge/bridgeEnabled.ts", "../src/utils/config.ts", "../node_modules/ignore/index.js", "../node_modules/tree-kill/index.js", "../src/tools/BashTool/toolName.ts", "../src/tools/GrepTool/prompt.ts", "../src/tools/FileEditTool/constants.ts", "../src/utils/pdfUtils.ts", "../src/tools/FileReadTool/prompt.ts", "../src/tools/FileWriteTool/prompt.ts", "../src/tools/GlobTool/prompt.ts", "../src/tools/NotebookEditTool/constants.ts", "../src/tools/REPLTool/constants.ts", "../src/utils/embeddedTools.ts", "../node_modules/react/cjs/react.development.js", "../node_modules/react/index.js", "../node_modules/react/cjs/react-compiler-runtime.development.js", "../node_modules/react/compiler-runtime.js", "../src/ink/events/event.ts", "../src/ink/events/emitter.ts", "../src/ink/components/StdinContext.ts", "../src/ink/hooks/use-stdin.ts", "../src/utils/systemTheme.ts", "../node_modules/react/cjs/react-jsx-dev-runtime.development.js", "../node_modules/react/jsx-dev-runtime.js", "../src/utils/systemThemeWatcher.ts", "../src/components/design-system/ThemeProvider.tsx", "../node_modules/auto-bind/index.js", "../node_modules/react-reconciler/cjs/react-reconciler-constants.development.js", "../node_modules/react-reconciler/constants.js", "../src/native-ts/yoga-layout/enums.ts", "../src/native-ts/yoga-layout/index.ts", "../src/ink/colorize.ts", "../src/utils/earlyInput.ts", "../src/utils/fullscreen.ts", "../src/ink/termio/ansi.ts", "../src/ink/termio/csi.ts", "../src/ink/termio/tokenize.ts", "../src/ink/parse-keypress.ts", "../src/ink/events/input-event.ts", "../src/ink/events/terminal-focus-event.ts", "../node_modules/scheduler/cjs/scheduler.development.js", "../node_modules/scheduler/index.js", "../node_modules/react-reconciler/cjs/react-reconciler.development.js", "../node_modules/react-reconciler/index.js", "../src/ink/layout/node.ts", "../src/ink/layout/yoga.ts", "../src/ink/layout/engine.ts", "../src/ink/line-width-cache.ts", "../src/ink/measure-text.ts", "../src/ink/node-cache.ts", "../src/ink/squash-text-nodes.ts", "../src/ink/tabstops.ts", "../node_modules/ansi-styles/index.js", "../node_modules/@alcalzone/ansi-tokenize/build/consts.js", "../node_modules/@alcalzone/ansi-tokenize/build/ansiCodes.js", "../node_modules/@alcalzone/ansi-tokenize/build/reduce.js", "../node_modules/@alcalzone/ansi-tokenize/build/undo.js", "../node_modules/@alcalzone/ansi-tokenize/build/diff.js", "../node_modules/@alcalzone/ansi-tokenize/build/styledChars.js", "../node_modules/is-fullwidth-code-point/index.js", "../node_modules/@alcalzone/ansi-tokenize/build/tokenize.js", "../node_modules/@alcalzone/ansi-tokenize/build/index.js", "../src/utils/sliceAnsi.ts", "../node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js", "../node_modules/string-width/node_modules/strip-ansi/index.js", "../node_modules/string-width/node_modules/is-fullwidth-code-point/index.js", "../node_modules/string-width/node_modules/emoji-regex/index.js", "../node_modules/string-width/index.js", "../node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js", "../node_modules/wrap-ansi/node_modules/strip-ansi/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/wrap-ansi/node_modules/ansi-styles/index.js", "../node_modules/wrap-ansi/index.js", "../src/ink/wrapAnsi.ts", "../src/ink/wrap-text.ts", "../src/ink/dom.ts", "../src/ink/events/event-handlers.ts", "../src/ink/events/dispatcher.ts", "../src/ink/events/terminal-event.ts", "../src/ink/events/focus-event.ts", "../src/ink/focus.ts", "../src/ink/styles.ts", "../src/ink/devtools.ts", "../src/ink/reconciler.ts", "../src/ink/layout/geometry.ts", "../src/ink/warn.ts", "../src/ink/screen.ts", "../src/ink/selection.ts", "../src/ink/clearTerminal.ts", "../src/ink/termio/dec.ts", "../src/ink/termio/osc.ts", "../src/ink/terminal.ts", "../src/ink/terminal-focus-state.ts", "../src/ink/terminal-querier.ts", "../src/ink/components/AppContext.ts", "../src/ink/constants.ts", "../src/ink/components/TerminalFocusContext.tsx", "../src/ink/hooks/use-terminal-focus.ts", "../src/ink/components/ClockContext.tsx", "../src/ink/components/CursorDeclarationContext.ts", "../node_modules/convert-to-spaces/dist/index.js", "../node_modules/code-excerpt/dist/index.js", "../node_modules/escape-string-regexp/index.js", "../node_modules/stack-utils/index.js", "../src/ink/components/Box.tsx", "../src/ink/components/Text.tsx", "../src/ink/components/ErrorOverview.tsx", "../src/ink/components/TerminalSizeContext.tsx", "../src/ink/components/App.tsx", "../src/ink/events/keyboard-event.ts", "../src/ink/frame.ts", "../src/ink/events/click-event.ts", "../src/ink/hit-test.ts", "../src/ink/instances.ts", "../src/ink/log-update.ts", "../src/ink/optimizer.ts", "../node_modules/bidi-js/dist/bidi.js", "../src/ink/bidi.ts", "../src/ink/widest-line.ts", "../src/ink/output.ts", "../node_modules/indent-string/index.js", "../src/ink/get-max-width.ts", "../node_modules/cli-boxes/index.js", "../src/ink/render-border.ts", "../src/ink/render-node-to-output.ts", "../src/ink/render-to-screen.ts", "../src/ink/renderer.ts", "../src/ink/searchHighlight.ts", "../src/ink/useTerminalNotification.ts", "../src/ink/ink.tsx", "../src/ink/root.ts", "../src/utils/theme.ts", "../src/components/design-system/color.ts", "../src/components/design-system/ThemedBox.tsx", "../src/components/design-system/ThemedText.tsx", "../node_modules/supports-hyperlinks/index.js", "../src/ink/supports-hyperlinks.ts", "../src/ink/components/Link.tsx", "../src/ink/termio/esc.ts", "../src/ink/termio/types.ts", "../src/ink/termio/sgr.ts", "../src/ink/termio/parser.ts", "../src/ink/termio.ts", "../src/ink/Ansi.tsx", "../src/ink/components/Button.tsx", "../src/ink/components/Newline.tsx", "../src/ink/components/NoSelect.tsx", "../src/ink/components/RawAnsi.tsx", "../src/ink/components/Spacer.tsx", "../src/ink/hooks/use-terminal-viewport.ts", "../src/ink/hooks/use-animation-frame.ts", "../src/ink/hooks/use-app.ts", "../node_modules/lodash.debounce/index.js", "../node_modules/usehooks-ts/dist/index.js", "../src/ink/hooks/use-input.ts", "../src/ink/hooks/use-interval.ts", "../src/ink/hooks/use-selection.ts", "../src/ink/hooks/use-tab-status.ts", "../src/ink/hooks/use-terminal-title.ts", "../src/ink/measure-element.ts", "../src/ink.ts", "../src/hooks/useTerminalSize.ts", "../src/components/design-system/Ratchet.tsx", "../src/components/MessageResponse.tsx", "../src/commands/add-dir/validation.ts", "../src/state/store.ts", "../src/context/voice.tsx", "../src/utils/mailbox.ts", "../src/context/mailbox.tsx", "../node_modules/readdirp/esm/index.js", "../node_modules/chokidar/esm/handler.js", "../node_modules/chokidar/esm/index.js", "../src/utils/settings/changeDetector.ts", "../src/hooks/useSettingsChange.ts", "../src/constants/system.ts", "../src/Tool.ts", "../src/types/connectorText.ts", "../src/constants/common.ts", "../node_modules/marked/lib/marked.esm.js", "../node_modules/picomatch/lib/constants.js", "../node_modules/picomatch/lib/utils.js", "../node_modules/picomatch/lib/scan.js", "../node_modules/picomatch/lib/parse.js", "../node_modules/picomatch/lib/picomatch.js", "../node_modules/picomatch/index.js", "../src/utils/fileStateCache.ts", "../node_modules/yaml/dist/nodes/identity.js", "../node_modules/yaml/dist/visit.js", "../node_modules/yaml/dist/doc/directives.js", "../node_modules/yaml/dist/doc/anchors.js", "../node_modules/yaml/dist/doc/applyReviver.js", "../node_modules/yaml/dist/nodes/toJS.js", "../node_modules/yaml/dist/nodes/Node.js", "../node_modules/yaml/dist/nodes/Alias.js", "../node_modules/yaml/dist/nodes/Scalar.js", "../node_modules/yaml/dist/doc/createNode.js", "../node_modules/yaml/dist/nodes/Collection.js", "../node_modules/yaml/dist/stringify/stringifyComment.js", "../node_modules/yaml/dist/stringify/foldFlowLines.js", "../node_modules/yaml/dist/stringify/stringifyString.js", "../node_modules/yaml/dist/stringify/stringify.js", "../node_modules/yaml/dist/stringify/stringifyPair.js", "../node_modules/yaml/dist/log.js", "../node_modules/yaml/dist/schema/yaml-1.1/merge.js", "../node_modules/yaml/dist/nodes/addPairToJSMap.js", "../node_modules/yaml/dist/nodes/Pair.js", "../node_modules/yaml/dist/stringify/stringifyCollection.js", "../node_modules/yaml/dist/nodes/YAMLMap.js", "../node_modules/yaml/dist/schema/common/map.js", "../node_modules/yaml/dist/nodes/YAMLSeq.js", "../node_modules/yaml/dist/schema/common/seq.js", "../node_modules/yaml/dist/schema/common/string.js", "../node_modules/yaml/dist/schema/common/null.js", "../node_modules/yaml/dist/schema/core/bool.js", "../node_modules/yaml/dist/stringify/stringifyNumber.js", "../node_modules/yaml/dist/schema/core/float.js", "../node_modules/yaml/dist/schema/core/int.js", "../node_modules/yaml/dist/schema/core/schema.js", "../node_modules/yaml/dist/schema/json/schema.js", "../node_modules/yaml/dist/schema/yaml-1.1/binary.js", "../node_modules/yaml/dist/schema/yaml-1.1/pairs.js", "../node_modules/yaml/dist/schema/yaml-1.1/omap.js", "../node_modules/yaml/dist/schema/yaml-1.1/bool.js", "../node_modules/yaml/dist/schema/yaml-1.1/float.js", "../node_modules/yaml/dist/schema/yaml-1.1/int.js", "../node_modules/yaml/dist/schema/yaml-1.1/set.js", "../node_modules/yaml/dist/schema/yaml-1.1/timestamp.js", "../node_modules/yaml/dist/schema/yaml-1.1/schema.js", "../node_modules/yaml/dist/schema/tags.js", "../node_modules/yaml/dist/schema/Schema.js", "../node_modules/yaml/dist/stringify/stringifyDocument.js", "../node_modules/yaml/dist/doc/Document.js", "../node_modules/yaml/dist/errors.js", "../node_modules/yaml/dist/compose/resolve-props.js", "../node_modules/yaml/dist/compose/util-contains-newline.js", "../node_modules/yaml/dist/compose/util-flow-indent-check.js", "../node_modules/yaml/dist/compose/util-map-includes.js", "../node_modules/yaml/dist/compose/resolve-block-map.js", "../node_modules/yaml/dist/compose/resolve-block-seq.js", "../node_modules/yaml/dist/compose/resolve-end.js", "../node_modules/yaml/dist/compose/resolve-flow-collection.js", "../node_modules/yaml/dist/compose/compose-collection.js", "../node_modules/yaml/dist/compose/resolve-block-scalar.js", "../node_modules/yaml/dist/compose/resolve-flow-scalar.js", "../node_modules/yaml/dist/compose/compose-scalar.js", "../node_modules/yaml/dist/compose/util-empty-scalar-position.js", "../node_modules/yaml/dist/compose/compose-node.js", "../node_modules/yaml/dist/compose/compose-doc.js", "../node_modules/yaml/dist/compose/composer.js", "../node_modules/yaml/dist/parse/cst-scalar.js", "../node_modules/yaml/dist/parse/cst-stringify.js", "../node_modules/yaml/dist/parse/cst-visit.js", "../node_modules/yaml/dist/parse/cst.js", "../node_modules/yaml/dist/parse/lexer.js", "../node_modules/yaml/dist/parse/line-counter.js", "../node_modules/yaml/dist/parse/parser.js", "../node_modules/yaml/dist/public-api.js", "../node_modules/yaml/dist/index.js", "../src/utils/yaml.ts", "../src/utils/frontmatterParser.ts", "../src/utils/claudemd.ts", "../src/utils/gitSettings.ts", "../src/context.ts", "../node_modules/zod/v3/helpers/util.js", "../node_modules/zod/v3/ZodError.js", "../node_modules/zod/v3/locales/en.js", "../node_modules/zod/v3/errors.js", "../node_modules/zod/v3/helpers/parseUtil.js", "../node_modules/zod/v3/helpers/errorUtil.js", "../node_modules/zod/v3/types.js", "../node_modules/zod/v3/external.js", "../node_modules/zod/v3/index.js", "../node_modules/zod/v4/mini/parse.js", "../node_modules/zod/v4/mini/schemas.js", "../node_modules/zod/v4/mini/checks.js", "../node_modules/zod/v4/mini/iso.js", "../node_modules/zod/v4/mini/coerce.js", "../node_modules/zod/v4/mini/external.js", "../node_modules/zod/v4/mini/index.js", "../node_modules/zod/v4-mini/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js", "../node_modules/zod-to-json-schema/dist/esm/Options.js", "../node_modules/zod-to-json-schema/dist/esm/Refs.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/array.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/branded.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/catch.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/default.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/string.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/record.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/map.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/never.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/union.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/object.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/set.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js", "../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js", "../node_modules/zod-to-json-schema/dist/esm/selectParser.js", "../node_modules/zod-to-json-schema/dist/esm/parseDef.js", "../node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js", "../node_modules/zod-to-json-schema/dist/esm/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js", "../node_modules/ajv/dist/compile/codegen/code.js", "../node_modules/ajv/dist/compile/codegen/scope.js", "../node_modules/ajv/dist/compile/codegen/index.js", "../node_modules/ajv/dist/compile/util.js", "../node_modules/ajv/dist/compile/names.js", "../node_modules/ajv/dist/compile/errors.js", "../node_modules/ajv/dist/compile/validate/boolSchema.js", "../node_modules/ajv/dist/compile/rules.js", "../node_modules/ajv/dist/compile/validate/applicability.js", "../node_modules/ajv/dist/compile/validate/dataType.js", "../node_modules/ajv/dist/compile/validate/defaults.js", "../node_modules/ajv/dist/vocabularies/code.js", "../node_modules/ajv/dist/compile/validate/keyword.js", "../node_modules/ajv/dist/compile/validate/subschema.js", "../node_modules/fast-deep-equal/index.js", "../node_modules/json-schema-traverse/index.js", "../node_modules/ajv/dist/compile/resolve.js", "../node_modules/ajv/dist/compile/validate/index.js", "../node_modules/ajv/dist/runtime/validation_error.js", "../node_modules/ajv/dist/compile/ref_error.js", "../node_modules/ajv/dist/compile/index.js", "../node_modules/fast-uri/lib/utils.js", "../node_modules/fast-uri/lib/schemes.js", "../node_modules/fast-uri/index.js", "../node_modules/ajv/dist/runtime/uri.js", "../node_modules/ajv/dist/core.js", "../node_modules/ajv/dist/vocabularies/core/id.js", "../node_modules/ajv/dist/vocabularies/core/ref.js", "../node_modules/ajv/dist/vocabularies/core/index.js", "../node_modules/ajv/dist/vocabularies/validation/limitNumber.js", "../node_modules/ajv/dist/vocabularies/validation/multipleOf.js", "../node_modules/ajv/dist/runtime/ucs2length.js", "../node_modules/ajv/dist/vocabularies/validation/limitLength.js", "../node_modules/ajv/dist/vocabularies/validation/pattern.js", "../node_modules/ajv/dist/vocabularies/validation/limitProperties.js", "../node_modules/ajv/dist/vocabularies/validation/required.js", "../node_modules/ajv/dist/vocabularies/validation/limitItems.js", "../node_modules/ajv/dist/runtime/equal.js", "../node_modules/ajv/dist/vocabularies/validation/uniqueItems.js", "../node_modules/ajv/dist/vocabularies/validation/const.js", "../node_modules/ajv/dist/vocabularies/validation/enum.js", "../node_modules/ajv/dist/vocabularies/validation/index.js", "../node_modules/ajv/dist/vocabularies/applicator/additionalItems.js", "../node_modules/ajv/dist/vocabularies/applicator/items.js", "../node_modules/ajv/dist/vocabularies/applicator/prefixItems.js", "../node_modules/ajv/dist/vocabularies/applicator/items2020.js", "../node_modules/ajv/dist/vocabularies/applicator/contains.js", "../node_modules/ajv/dist/vocabularies/applicator/dependencies.js", "../node_modules/ajv/dist/vocabularies/applicator/propertyNames.js", "../node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js", "../node_modules/ajv/dist/vocabularies/applicator/properties.js", "../node_modules/ajv/dist/vocabularies/applicator/patternProperties.js", "../node_modules/ajv/dist/vocabularies/applicator/not.js", "../node_modules/ajv/dist/vocabularies/applicator/anyOf.js", "../node_modules/ajv/dist/vocabularies/applicator/oneOf.js", "../node_modules/ajv/dist/vocabularies/applicator/allOf.js", "../node_modules/ajv/dist/vocabularies/applicator/if.js", "../node_modules/ajv/dist/vocabularies/applicator/thenElse.js", "../node_modules/ajv/dist/vocabularies/applicator/index.js", "../node_modules/ajv/dist/vocabularies/format/format.js", "../node_modules/ajv/dist/vocabularies/format/index.js", "../node_modules/ajv/dist/vocabularies/metadata.js", "../node_modules/ajv/dist/vocabularies/draft7.js", "../node_modules/ajv/dist/vocabularies/discriminator/types.js", "../node_modules/ajv/dist/vocabularies/discriminator/index.js", "../node_modules/ajv/dist/ajv.js", "../node_modules/ajv-formats/dist/formats.js", "../node_modules/ajv-formats/dist/limit.js", "../node_modules/ajv-formats/dist/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js", "../node_modules/eventsource-parser/dist/index.js", "../node_modules/eventsource/dist/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js", "../node_modules/pkce-challenge/dist/index.node.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js", "../node_modules/eventsource-parser/dist/stream.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js", "../node_modules/p-map/index.js", "../src/bridge/sessionIdCompat.ts", "../src/constants/product.ts", "../src/keybindings/defaultBindings.ts", "../src/keybindings/parser.ts", "../src/keybindings/reservedShortcuts.ts", "../src/keybindings/validate.ts", "../src/keybindings/loadUserBindings.ts", "../src/keybindings/match.ts", "../src/keybindings/resolver.ts", "../src/keybindings/shortcutFormat.ts", "../src/keybindings/KeybindingContext.tsx", "../src/keybindings/useShortcutDisplay.ts", "../src/components/design-system/KeyboardShortcutHint.tsx", "../src/keybindings/useKeybinding.ts", "../src/buddy/types.ts", "../src/buddy/companion.ts", "../src/buddy/prompt.ts", "../src/constants/messages.ts", "../src/utils/ripgrep.ts", "../src/utils/settings/pluginOnlyPolicy.ts", "../src/utils/markdownConfigLoader.ts", "../src/types/plugin.ts", "../src/plugins/builtinPlugins.ts", "../src/utils/plugins/addDirPluginSettings.ts", "../src/utils/plugins/pluginIdentifier.ts", "../src/utils/plugins/dependencyResolver.ts", "../src/utils/plugins/officialMarketplace.ts", "../src/utils/plugins/fetchTelemetry.ts", "../src/utils/plugins/gitAvailability.ts", "stub-npm:@anthropic-ai/sandbox-runtime", "../src/tools/WebFetchTool/prompt.ts", "../src/utils/sandbox/sandbox-adapter.ts", "../src/utils/shell/readOnlyCommandValidation.ts", "../src/utils/permissions/pathValidation.ts", "../src/utils/plugins/pluginDirectories.ts", "../src/utils/thinking.ts", "../src/utils/effort.ts", "stub-npm:@anthropic-ai/mcpb", "../src/utils/dxt/helpers.ts", "../node_modules/fflate/esm/index.mjs", "../src/utils/dxt/zip.ts", "../src/utils/systemDirectories.ts", "../src/utils/plugins/mcpbHandler.ts", "../src/utils/plugins/pluginOptionsStorage.ts", "../src/utils/plugins/walkPluginMarkdown.ts", "../src/utils/plugins/loadPluginAgents.ts", "../src/tools/AgentTool/agentColorManager.ts", "../src/tools/AgentTool/agentMemorySnapshot.ts", "../src/tools/SendMessageTool/constants.ts", "../src/tools/WebSearchTool/prompt.ts", "../src/tools/AgentTool/built-in/claudeCodeGuideAgent.ts", "../src/tools/ExitPlanModeTool/constants.ts", "../src/tools/AgentTool/built-in/exploreAgent.ts", "../src/tools/AgentTool/built-in/generalPurposeAgent.ts", "../src/tools/AgentTool/built-in/planAgent.ts", "../src/tools/AgentTool/built-in/statuslineSetup.ts", "../src/tools/AgentTool/built-in/verificationAgent.ts", "../src/coordinator/workerAgent.ts", "../src/tools/AgentTool/builtInAgents.ts", "../src/tools/AgentTool/loadAgentsDir.ts", "../src/tools/SkillTool/prompt.ts", "../src/constants/apiLimits.ts", "../src/memdir/memoryAge.ts", "../src/tools/ToolSearchTool/constants.ts", "../src/tools/SendUserFileTool/prompt.ts", "../src/tools/EnterPlanModeTool/constants.ts", "../src/tools/AskUserQuestionTool/prompt.ts", "../src/tools/TodoWriteTool/constants.ts", "../src/tools/PowerShellTool/toolName.ts", "../src/utils/shell/shellToolUtils.ts", "../src/tools/SkillTool/constants.ts", "../src/tools/TaskCreateTool/constants.ts", "../src/tools/TaskGetTool/constants.ts", "../src/tools/TaskListTool/constants.ts", "../src/tools/TaskUpdateTool/constants.ts", "../src/tools/SyntheticOutputTool/SyntheticOutputTool.ts", "../src/tools/EnterWorktreeTool/constants.ts", "../src/tools/ExitWorktreeTool/constants.ts", "../src/tools/WorkflowTool/constants.ts", "../src/utils/cron.ts", "../src/utils/cronTasks.ts", "../src/tools/ScheduleCronTool/prompt.ts", "../src/constants/tools.ts", "../src/tools/TeamCreateTool/constants.ts", "../src/tools/TeamDeleteTool/constants.ts", "../src/coordinator/coordinatorMode.ts", "../src/tools/AgentTool/forkSubagent.ts", "../src/tools/ToolSearchTool/prompt.ts", "../node_modules/diff/lib/index.mjs", "../src/services/api/promptCacheBreakDetection.ts", "../src/services/compact/compactWarningState.ts", "../src/services/compact/timeBasedMCConfig.ts", "../src/services/compact/cachedMicrocompact.ts", "../src/services/compact/microCompact.ts", "../src/utils/tokens.ts", "../src/services/SessionMemory/sessionMemoryUtils.ts", "../src/tools/ToolSearchTool/ToolSearchTool.ts", "../src/utils/contextAnalysis.ts", "../src/services/rateLimitMocking.ts", "../src/tools/FileReadTool/imageProcessor.ts", "../src/utils/imageResizer.ts", "../src/utils/imageValidation.ts", "../src/services/rateLimitMessages.ts", "../src/services/claudeAiLimits.ts", "../src/services/api/errorUtils.ts", "../src/services/api/errors.ts", "../src/services/api/withRetry.ts", "../src/utils/systemPromptType.ts", "../src/constants/errorIds.ts", "../src/services/toolUseSummary/toolUseSummaryGenerator.ts", "../src/utils/objectGroupBy.ts", "../src/utils/messageQueueManager.ts", "../src/utils/commandLifecycle.ts", "../src/utils/headlessProfiler.ts", "../src/tools/SleepTool/prompt.ts", "../src/utils/hooks/postSamplingHooks.ts", "../src/services/api/dumpPrompts.ts", "../src/utils/abortController.ts", "../node_modules/cli-highlight/node_modules/highlight.js/lib/core.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/1c.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/abnf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/accesslog.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/actionscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ada.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/angelscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/apache.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/applescript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/arcade.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/arduino.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/armasm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/xml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/asciidoc.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/aspectj.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/autohotkey.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/autoit.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/avrasm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/awk.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/axapta.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/bash.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/basic.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/bnf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/brainfuck.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/c-like.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/c.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/cal.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/capnproto.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ceylon.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/clean.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/clojure.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/clojure-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/cmake.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/coffeescript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/coq.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/cos.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/cpp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/crmsh.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/crystal.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/csharp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/csp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/css.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/d.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/markdown.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dart.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/delphi.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/diff.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/django.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dns.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dockerfile.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dos.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dsconfig.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dts.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/dust.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ebnf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/elixir.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/elm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ruby.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/erb.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/erlang-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/erlang.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/excel.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/fix.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/flix.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/fortran.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/fsharp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gams.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gauss.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gcode.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gherkin.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/glsl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/go.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/golo.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/gradle.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/groovy.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/haml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/handlebars.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/haskell.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/haxe.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/hsp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/htmlbars.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/http.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/hy.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/inform7.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ini.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/irpf90.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/isbl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/java.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/javascript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/jboss-cli.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/json.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/julia.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/julia-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/kotlin.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/lasso.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/latex.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ldif.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/leaf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/less.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/lisp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/livecodeserver.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/livescript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/llvm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/lsl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/lua.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/makefile.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mathematica.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/matlab.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/maxima.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mel.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mercury.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mipsasm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mizar.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/perl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/mojolicious.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/monkey.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/moonscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/n1ql.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/nginx.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/nim.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/nix.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/node-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/nsis.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/objectivec.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ocaml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/openscad.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/oxygene.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/parser3.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/pf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/pgsql.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/php.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/php-template.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/plaintext.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/pony.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/powershell.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/processing.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/profile.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/prolog.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/properties.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/protobuf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/puppet.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/purebasic.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/python.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/python-repl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/q.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/qml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/r.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/reasonml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/rib.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/roboconf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/routeros.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/rsl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/ruleslanguage.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/rust.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sas.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/scala.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/scheme.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/scilab.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/scss.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/shell.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/smali.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/smalltalk.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sqf.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sql_more.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/sql.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/stan.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/stata.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/step21.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/stylus.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/subunit.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/swift.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/taggerscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/yaml.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/tap.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/tcl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/thrift.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/tp.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/twig.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/typescript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vala.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vbnet.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vbscript.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vbscript-html.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/verilog.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vhdl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/vim.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/x86asm.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/xl.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/xquery.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/languages/zephir.js", "../node_modules/cli-highlight/node_modules/highlight.js/lib/index.js", "../node_modules/parse5/lib/common/unicode.js", "../node_modules/parse5/lib/common/error-codes.js", "../node_modules/parse5/lib/tokenizer/preprocessor.js", "../node_modules/parse5/lib/tokenizer/named-entity-data.js", "../node_modules/parse5/lib/tokenizer/index.js", "../node_modules/parse5/lib/common/html.js", "../node_modules/parse5/lib/parser/open-element-stack.js", "../node_modules/parse5/lib/parser/formatting-element-list.js", "../node_modules/parse5/lib/utils/mixin.js", "../node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js", "../node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js", "../node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js", "../node_modules/parse5/lib/extensions/location-info/parser-mixin.js", "../node_modules/parse5/lib/extensions/error-reporting/mixin-base.js", "../node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js", "../node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js", "../node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js", "../node_modules/parse5/lib/tree-adapters/default.js", "../node_modules/parse5/lib/utils/merge-options.js", "../node_modules/parse5/lib/common/doctype.js", "../node_modules/parse5/lib/common/foreign-content.js", "../node_modules/parse5/lib/parser/index.js", "../node_modules/parse5/lib/serializer/index.js", "../node_modules/parse5/lib/index.js", "../node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/html.js", "../node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/doctype.js", "../node_modules/parse5-htmlparser2-tree-adapter/lib/index.js", "../node_modules/cli-highlight/node_modules/chalk/node_modules/ansi-styles/index.js", "../node_modules/cli-highlight/node_modules/chalk/source/util.js", "../node_modules/cli-highlight/node_modules/chalk/source/templates.js", "../node_modules/cli-highlight/node_modules/chalk/source/index.js", "../node_modules/cli-highlight/dist/theme.js", "../node_modules/cli-highlight/dist/index.js", "../node_modules/highlight.js/lib/core.js", "../node_modules/highlight.js/lib/languages/1c.js", "../node_modules/highlight.js/lib/languages/abnf.js", "../node_modules/highlight.js/lib/languages/accesslog.js", "../node_modules/highlight.js/lib/languages/actionscript.js", "../node_modules/highlight.js/lib/languages/ada.js", "../node_modules/highlight.js/lib/languages/angelscript.js", "../node_modules/highlight.js/lib/languages/apache.js", "../node_modules/highlight.js/lib/languages/applescript.js", "../node_modules/highlight.js/lib/languages/arcade.js", "../node_modules/highlight.js/lib/languages/arduino.js", "../node_modules/highlight.js/lib/languages/armasm.js", "../node_modules/highlight.js/lib/languages/xml.js", "../node_modules/highlight.js/lib/languages/asciidoc.js", "../node_modules/highlight.js/lib/languages/aspectj.js", "../node_modules/highlight.js/lib/languages/autohotkey.js", "../node_modules/highlight.js/lib/languages/autoit.js", "../node_modules/highlight.js/lib/languages/avrasm.js", "../node_modules/highlight.js/lib/languages/awk.js", "../node_modules/highlight.js/lib/languages/axapta.js", "../node_modules/highlight.js/lib/languages/bash.js", "../node_modules/highlight.js/lib/languages/basic.js", "../node_modules/highlight.js/lib/languages/bnf.js", "../node_modules/highlight.js/lib/languages/brainfuck.js", "../node_modules/highlight.js/lib/languages/c.js", "../node_modules/highlight.js/lib/languages/cal.js", "../node_modules/highlight.js/lib/languages/capnproto.js", "../node_modules/highlight.js/lib/languages/ceylon.js", "../node_modules/highlight.js/lib/languages/clean.js", "../node_modules/highlight.js/lib/languages/clojure.js", "../node_modules/highlight.js/lib/languages/clojure-repl.js", "../node_modules/highlight.js/lib/languages/cmake.js", "../node_modules/highlight.js/lib/languages/coffeescript.js", "../node_modules/highlight.js/lib/languages/coq.js", "../node_modules/highlight.js/lib/languages/cos.js", "../node_modules/highlight.js/lib/languages/cpp.js", "../node_modules/highlight.js/lib/languages/crmsh.js", "../node_modules/highlight.js/lib/languages/crystal.js", "../node_modules/highlight.js/lib/languages/csharp.js", "../node_modules/highlight.js/lib/languages/csp.js", "../node_modules/highlight.js/lib/languages/css.js", "../node_modules/highlight.js/lib/languages/d.js", "../node_modules/highlight.js/lib/languages/markdown.js", "../node_modules/highlight.js/lib/languages/dart.js", "../node_modules/highlight.js/lib/languages/delphi.js", "../node_modules/highlight.js/lib/languages/diff.js", "../node_modules/highlight.js/lib/languages/django.js", "../node_modules/highlight.js/lib/languages/dns.js", "../node_modules/highlight.js/lib/languages/dockerfile.js", "../node_modules/highlight.js/lib/languages/dos.js", "../node_modules/highlight.js/lib/languages/dsconfig.js", "../node_modules/highlight.js/lib/languages/dts.js", "../node_modules/highlight.js/lib/languages/dust.js", "../node_modules/highlight.js/lib/languages/ebnf.js", "../node_modules/highlight.js/lib/languages/elixir.js", "../node_modules/highlight.js/lib/languages/elm.js", "../node_modules/highlight.js/lib/languages/ruby.js", "../node_modules/highlight.js/lib/languages/erb.js", "../node_modules/highlight.js/lib/languages/erlang-repl.js", "../node_modules/highlight.js/lib/languages/erlang.js", "../node_modules/highlight.js/lib/languages/excel.js", "../node_modules/highlight.js/lib/languages/fix.js", "../node_modules/highlight.js/lib/languages/flix.js", "../node_modules/highlight.js/lib/languages/fortran.js", "../node_modules/highlight.js/lib/languages/fsharp.js", "../node_modules/highlight.js/lib/languages/gams.js", "../node_modules/highlight.js/lib/languages/gauss.js", "../node_modules/highlight.js/lib/languages/gcode.js", "../node_modules/highlight.js/lib/languages/gherkin.js", "../node_modules/highlight.js/lib/languages/glsl.js", "../node_modules/highlight.js/lib/languages/gml.js", "../node_modules/highlight.js/lib/languages/go.js", "../node_modules/highlight.js/lib/languages/golo.js", "../node_modules/highlight.js/lib/languages/gradle.js", "../node_modules/highlight.js/lib/languages/graphql.js", "../node_modules/highlight.js/lib/languages/groovy.js", "../node_modules/highlight.js/lib/languages/haml.js", "../node_modules/highlight.js/lib/languages/handlebars.js", "../node_modules/highlight.js/lib/languages/haskell.js", "../node_modules/highlight.js/lib/languages/haxe.js", "../node_modules/highlight.js/lib/languages/hsp.js", "../node_modules/highlight.js/lib/languages/http.js", "../node_modules/highlight.js/lib/languages/hy.js", "../node_modules/highlight.js/lib/languages/inform7.js", "../node_modules/highlight.js/lib/languages/ini.js", "../node_modules/highlight.js/lib/languages/irpf90.js", "../node_modules/highlight.js/lib/languages/isbl.js", "../node_modules/highlight.js/lib/languages/java.js", "../node_modules/highlight.js/lib/languages/javascript.js", "../node_modules/highlight.js/lib/languages/jboss-cli.js", "../node_modules/highlight.js/lib/languages/json.js", "../node_modules/highlight.js/lib/languages/julia.js", "../node_modules/highlight.js/lib/languages/julia-repl.js", "../node_modules/highlight.js/lib/languages/kotlin.js", "../node_modules/highlight.js/lib/languages/lasso.js", "../node_modules/highlight.js/lib/languages/latex.js", "../node_modules/highlight.js/lib/languages/ldif.js", "../node_modules/highlight.js/lib/languages/leaf.js", "../node_modules/highlight.js/lib/languages/less.js", "../node_modules/highlight.js/lib/languages/lisp.js", "../node_modules/highlight.js/lib/languages/livecodeserver.js", "../node_modules/highlight.js/lib/languages/livescript.js", "../node_modules/highlight.js/lib/languages/llvm.js", "../node_modules/highlight.js/lib/languages/lsl.js", "../node_modules/highlight.js/lib/languages/lua.js", "../node_modules/highlight.js/lib/languages/makefile.js", "../node_modules/highlight.js/lib/languages/mathematica.js", "../node_modules/highlight.js/lib/languages/matlab.js", "../node_modules/highlight.js/lib/languages/maxima.js", "../node_modules/highlight.js/lib/languages/mel.js", "../node_modules/highlight.js/lib/languages/mercury.js", "../node_modules/highlight.js/lib/languages/mipsasm.js", "../node_modules/highlight.js/lib/languages/mizar.js", "../node_modules/highlight.js/lib/languages/perl.js", "../node_modules/highlight.js/lib/languages/mojolicious.js", "../node_modules/highlight.js/lib/languages/monkey.js", "../node_modules/highlight.js/lib/languages/moonscript.js", "../node_modules/highlight.js/lib/languages/n1ql.js", "../node_modules/highlight.js/lib/languages/nestedtext.js", "../node_modules/highlight.js/lib/languages/nginx.js", "../node_modules/highlight.js/lib/languages/nim.js", "../node_modules/highlight.js/lib/languages/nix.js", "../node_modules/highlight.js/lib/languages/node-repl.js", "../node_modules/highlight.js/lib/languages/nsis.js", "../node_modules/highlight.js/lib/languages/objectivec.js", "../node_modules/highlight.js/lib/languages/ocaml.js", "../node_modules/highlight.js/lib/languages/openscad.js", "../node_modules/highlight.js/lib/languages/oxygene.js", "../node_modules/highlight.js/lib/languages/parser3.js", "../node_modules/highlight.js/lib/languages/pf.js", "../node_modules/highlight.js/lib/languages/pgsql.js", "../node_modules/highlight.js/lib/languages/php.js", "../node_modules/highlight.js/lib/languages/php-template.js", "../node_modules/highlight.js/lib/languages/plaintext.js", "../node_modules/highlight.js/lib/languages/pony.js", "../node_modules/highlight.js/lib/languages/powershell.js", "../node_modules/highlight.js/lib/languages/processing.js", "../node_modules/highlight.js/lib/languages/profile.js", "../node_modules/highlight.js/lib/languages/prolog.js", "../node_modules/highlight.js/lib/languages/properties.js", "../node_modules/highlight.js/lib/languages/protobuf.js", "../node_modules/highlight.js/lib/languages/puppet.js", "../node_modules/highlight.js/lib/languages/purebasic.js", "../node_modules/highlight.js/lib/languages/python.js", "../node_modules/highlight.js/lib/languages/python-repl.js", "../node_modules/highlight.js/lib/languages/q.js", "../node_modules/highlight.js/lib/languages/qml.js", "../node_modules/highlight.js/lib/languages/r.js", "../node_modules/highlight.js/lib/languages/reasonml.js", "../node_modules/highlight.js/lib/languages/rib.js", "../node_modules/highlight.js/lib/languages/roboconf.js", "../node_modules/highlight.js/lib/languages/routeros.js", "../node_modules/highlight.js/lib/languages/rsl.js", "../node_modules/highlight.js/lib/languages/ruleslanguage.js", "../node_modules/highlight.js/lib/languages/rust.js", "../node_modules/highlight.js/lib/languages/sas.js", "../node_modules/highlight.js/lib/languages/scala.js", "../node_modules/highlight.js/lib/languages/scheme.js", "../node_modules/highlight.js/lib/languages/scilab.js", "../node_modules/highlight.js/lib/languages/scss.js", "../node_modules/highlight.js/lib/languages/shell.js", "../node_modules/highlight.js/lib/languages/smali.js", "../node_modules/highlight.js/lib/languages/smalltalk.js", "../node_modules/highlight.js/lib/languages/sml.js", "../node_modules/highlight.js/lib/languages/sqf.js", "../node_modules/highlight.js/lib/languages/sql.js", "../node_modules/highlight.js/lib/languages/stan.js", "../node_modules/highlight.js/lib/languages/stata.js", "../node_modules/highlight.js/lib/languages/step21.js", "../node_modules/highlight.js/lib/languages/stylus.js", "../node_modules/highlight.js/lib/languages/subunit.js", "../node_modules/highlight.js/lib/languages/swift.js", "../node_modules/highlight.js/lib/languages/taggerscript.js", "../node_modules/highlight.js/lib/languages/yaml.js", "../node_modules/highlight.js/lib/languages/tap.js", "../node_modules/highlight.js/lib/languages/tcl.js", "../node_modules/highlight.js/lib/languages/thrift.js", "../node_modules/highlight.js/lib/languages/tp.js", "../node_modules/highlight.js/lib/languages/twig.js", "../node_modules/highlight.js/lib/languages/typescript.js", "../node_modules/highlight.js/lib/languages/vala.js", "../node_modules/highlight.js/lib/languages/vbnet.js", "../node_modules/highlight.js/lib/languages/vbscript.js", "../node_modules/highlight.js/lib/languages/vbscript-html.js", "../node_modules/highlight.js/lib/languages/verilog.js", "../node_modules/highlight.js/lib/languages/vhdl.js", "../node_modules/highlight.js/lib/languages/vim.js", "../node_modules/highlight.js/lib/languages/wasm.js", "../node_modules/highlight.js/lib/languages/wren.js", "../node_modules/highlight.js/lib/languages/x86asm.js", "../node_modules/highlight.js/lib/languages/xl.js", "../node_modules/highlight.js/lib/languages/xquery.js", "../node_modules/highlight.js/lib/languages/zephir.js", "../node_modules/highlight.js/lib/index.js", "../node_modules/highlight.js/es/index.js", "../src/utils/cliHighlight.ts", "../src/utils/taggedId.ts", "../src/utils/telemetryAttributes.ts", "../src/utils/telemetry/events.ts", "../src/hooks/toolPermission/permissionLogging.ts", "../src/utils/bash/bashParser.ts", "../src/utils/bash/parser.ts", "../src/utils/bash/ast.ts", "../node_modules/shell-quote/quote.js", "../node_modules/shell-quote/parse.js", "../node_modules/shell-quote/index.js", "../src/utils/bash/shellQuote.ts", "../src/utils/permissions/bashClassifier.ts", "../src/utils/permissions/permissionsLoader.ts", "../src/utils/permissions/PermissionUpdate.ts", "../src/utils/permissions/shellRuleMatching.ts", "../src/constants/toolLimits.ts", "../src/services/mcp/vscodeSdkMcp.ts", "../src/services/PromptSuggestion/promptSuggestion.ts", "../src/utils/generatedFiles.ts", "../src/utils/commitAttribution.ts", "../src/state/AppStateStore.ts", "../src/utils/bash/heredoc.ts", "../src/utils/bash/treeSitterAnalysis.ts", "../src/utils/bash/ParsedCommand.ts", "../src/tools/BashTool/bashSecurity.ts", "../src/tools/BashTool/sedValidation.ts", "../src/tools/BashTool/pathValidation.ts", "../src/tools/BashTool/readOnlyValidation.ts", "../src/utils/generators.ts", "../src/services/tools/toolOrchestration.ts", "../src/utils/queryHelpers.ts", "../src/services/PromptSuggestion/speculation.ts", "../src/utils/sdkEventQueue.ts", "../src/utils/task/framework.ts", "../src/utils/xml.ts", "../src/types/ids.ts", "../src/tools/BashTool/commentLabel.ts", "../src/utils/promptCategory.ts", "../src/utils/claudeInChrome/common.ts", "../src/services/mcp/envExpansion.ts", "../src/utils/plugins/mcpPluginIntegration.ts", "../src/services/mcp/claudeai.ts", "../src/services/mcp/utils.ts", "../src/services/mcp/config.ts", "../src/tasks/LocalShellTask/guards.ts", "../src/tasks/LocalShellTask/killShellTasks.ts", "../src/utils/hooks/hooksSettings.ts", "../src/utils/hooks/sessionHooks.ts", "../src/utils/hooks/registerFrontmatterHooks.ts", "../src/utils/model/agent.ts", "../src/utils/telemetry/perfettoTracing.ts", "../src/utils/uuid.ts", "../src/utils/model/antModels.ts", "../src/utils/fingerprint.ts", "../src/utils/sideQuery.ts", "../src/utils/permissions/classifierShared.ts", "stub-txt:./yolo-classifier-prompts/auto_mode_system_prompt.txt", "stub-txt:./yolo-classifier-prompts/permissions_external.txt", "stub-txt:./yolo-classifier-prompts/permissions_anthropic.txt", "../src/utils/permissions/yoloClassifier.ts", "../src/utils/task/sdkProgress.ts", "../src/tools/AgentTool/agentToolUtils.ts", "../src/components/ConfigurableShortcutHint.tsx", "../src/components/design-system/Byline.tsx", "../src/components/AgentProgressLine.tsx", "../src/utils/hyperlink.ts", "../src/components/shell/ExpandShellOutputContext.tsx", "../src/components/shell/OutputLine.tsx", "../src/utils/sandbox/sandbox-ui-utils.ts", "../src/components/FallbackToolUseErrorMessage.tsx", "../src/components/InterruptedByUser.tsx", "../src/components/FallbackToolUseRejectedMessage.tsx", "../src/hooks/useSettings.ts", "../src/utils/markdown.ts", "../src/components/MarkdownTable.tsx", "../src/components/Markdown.tsx", "../src/utils/advisor.ts", "../src/components/CompactSummary.tsx", "../src/hooks/useBlink.ts", "../src/components/ToolUseLoader.tsx", "../src/components/messages/AdvisorMessage.tsx", "../src/components/messages/AssistantRedactedThinkingMessage.tsx", "../src/utils/model/check1mAccess.ts", "../src/utils/model/contextWindowUpgradeCheck.ts", "../src/bridge/trustedDevice.ts", "../src/services/analytics/datadog.ts", "../src/utils/gracefulShutdown.ts", "../src/services/api/grove.ts", "../src/services/policyLimits/types.ts", "../src/services/policyLimits/index.ts", "../src/hooks/useDoublePress.ts", "../src/hooks/useExitOnCtrlCD.ts", "../src/hooks/useExitOnCtrlCDWithKeybindings.ts", "../src/utils/imagePaste.ts", "../src/utils/imageStore.ts", "../src/components/ClickableImageRef.tsx", "../src/ink/hooks/use-declared-cursor.ts", "../src/components/design-system/ListItem.tsx", "../src/components/CustomSelect/select-option.tsx", "../src/components/CustomSelect/select-input-option.tsx", "../src/context/overlayContext.tsx", "../src/components/CustomSelect/option-map.ts", "../src/components/CustomSelect/use-select-navigation.ts", "../src/components/CustomSelect/use-multi-select-state.ts", "../src/components/CustomSelect/SelectMulti.tsx", "../src/components/CustomSelect/use-select-input.ts", "../src/components/CustomSelect/use-select-state.ts", "../src/components/CustomSelect/select.tsx", "../src/components/CustomSelect/index.ts", "../src/components/permissions/PermissionRequestTitle.tsx", "../src/components/permissions/PermissionDialog.tsx", "../src/utils/managedEnvConstants.ts", "../src/components/ManagedSettingsSecurityDialog/utils.ts", "../src/components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.tsx", "../src/keybindings/KeybindingProviderSetup.tsx", "../src/utils/renderOptions.ts", "../src/services/remoteManagedSettings/securityCheck.tsx", "../src/services/remoteManagedSettings/syncCache.ts", "../src/services/remoteManagedSettings/types.ts", "../src/services/remoteManagedSettings/index.ts", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationTemporality.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricData.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/utils.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/types.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Drop.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/InstrumentDescriptor.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Histogram.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/Buckets.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ieee754.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/util.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/types.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ExponentMapping.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/LogarithmMapping.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/getMapping.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/ExponentialHistogram.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/LastValue.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Sum.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/index.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/Aggregation.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationSelector.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricReader.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/PeriodicExportingMetricReader.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/InMemoryMetricExporter.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/export/ConsoleMetricExporter.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/ViewRegistry.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/Instruments.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/Meter.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorage.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/HashMap.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/DeltaMetricProcessor.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/TemporalMetricProcessor.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/AsyncMetricStorage.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/RegistrationConflicts.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorageRegistry.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MultiWritableMetricStorage.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/ObservableResult.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/ObservableRegistry.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/SyncMetricStorage.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/AttributesProcessor.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterSharedState.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterProviderSharedState.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricCollector.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/Predicate.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/InstrumentSelector.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/MeterSelector.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/view/View.js", "../node_modules/@opentelemetry/sdk-metrics/build/src/index.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js", "../node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions/build/src/index.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/enums.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/Span.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/Sampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOffSampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOnSampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/ParentBasedSampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/TraceIdRatioBasedSampler.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/config.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/utility.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/BatchSpanProcessorBase.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/export/BatchSpanProcessor.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/RandomIdGenerator.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/index.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/platform/index.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/Tracer.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/MultiSpanProcessor.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/NoopSpanProcessor.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/ConsoleSpanExporter.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/InMemorySpanExporter.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/export/SimpleSpanProcessor.js", "../node_modules/@opentelemetry/sdk-trace-base/build/src/index.js", "../src/utils/telemetry/betaSessionTracing.ts", "../src/services/api/metricsOptOut.ts", "../src/utils/telemetry/bigqueryExporter.ts", "../src/utils/telemetry/logger.ts", "../src/utils/telemetry/sessionTracing.ts", "stub-npm:@opentelemetry/exporter-metrics-otlp-grpc", "stub-npm:@opentelemetry/exporter-metrics-otlp-http", "stub-npm:@opentelemetry/exporter-metrics-otlp-proto", "stub-npm:@opentelemetry/exporter-prometheus", "stub-npm:@opentelemetry/exporter-logs-otlp-grpc", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/OTLPExporterBase.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/types.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/shared-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/legacy-node-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/bounded-queue-export-promise-handler.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/logging-response-handler.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-export-delegate.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-network-export-delegate.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/index.js", "../node_modules/@protobufjs/aspromise/index.js", "../node_modules/@protobufjs/base64/index.js", "../node_modules/@protobufjs/eventemitter/index.js", "../node_modules/@protobufjs/float/index.js", "../node_modules/@protobufjs/inquire/index.js", "../node_modules/@protobufjs/utf8/index.js", "../node_modules/@protobufjs/pool/index.js", "../node_modules/protobufjs/src/util/longbits.js", "../node_modules/protobufjs/src/util/minimal.js", "../node_modules/protobufjs/src/writer.js", "../node_modules/protobufjs/src/writer_buffer.js", "../node_modules/protobufjs/src/reader.js", "../node_modules/protobufjs/src/reader_buffer.js", "../node_modules/protobufjs/src/rpc/service.js", "../node_modules/protobufjs/src/rpc.js", "../node_modules/protobufjs/src/roots.js", "../node_modules/protobufjs/src/index-minimal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/common/utils.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/common/internal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/internal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/metrics.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/trace.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/logs.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/metrics.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/trace.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/index.js", "../node_modules/@opentelemetry/otlp-transformer/build/src/index.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/version.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/is-export-retryable.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/transport/http-transport-utils.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/transport/http-exporter-transport.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/retrying-transport.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-http-export-delegate.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/shared-env-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/util.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/otlp-http-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/otlp-http-env-configuration.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/convert-legacy-node-http-options.js", "../node_modules/@opentelemetry/otlp-exporter-base/build/src/index-node-http.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/platform/node/OTLPLogExporter.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/platform/node/index.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/platform/index.js", "../node_modules/@opentelemetry/exporter-logs-otlp-http/build/src/index.js", "stub-npm:@opentelemetry/exporter-logs-otlp-proto", "stub-npm:@opentelemetry/exporter-trace-otlp-grpc", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/version.js", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPTraceExporter.js", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/index.js", "../node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js", "stub-npm:@opentelemetry/exporter-trace-otlp-proto", "../src/utils/telemetry/instrumentation.ts", "../src/commands/logout/logout.tsx", "../src/services/api/firstTokenDate.ts", "../src/utils/browser.ts", "../src/services/oauth/auth-code-listener.ts", "../src/services/oauth/crypto.ts", "../src/services/oauth/index.ts", "../src/utils/localInstaller.ts", "../src/utils/shellConfig.ts", "../src/utils/autoUpdater.ts", "../src/utils/nativeInstaller/packageManagers.ts", "../src/utils/doctorDiagnostic.ts", "../src/utils/jetbrains.ts", "../src/utils/idePathConversion.ts", "../src/context/modalContext.tsx", "../src/components/design-system/Divider.tsx", "../src/components/design-system/Pane.tsx", "../src/components/design-system/Dialog.tsx", "../src/components/IdeOnboardingDialog.tsx", "../src/utils/ide.ts", "../src/utils/xdg.ts", "../src/utils/nativeInstaller/download.ts", "../src/utils/nativeInstaller/pidLock.ts", "../src/utils/nativeInstaller/installer.ts", "../src/utils/nativeInstaller/index.ts", "../src/utils/settings/allErrors.ts", "../src/utils/status.tsx", "../src/cli/handlers/auth.ts", "../node_modules/@xmldom/xmldom/lib/conventions.js", "../node_modules/@xmldom/xmldom/lib/dom.js", "../node_modules/@xmldom/xmldom/lib/entities.js", "../node_modules/@xmldom/xmldom/lib/sax.js", "../node_modules/@xmldom/xmldom/lib/dom-parser.js", "../node_modules/@xmldom/xmldom/lib/index.js", "../node_modules/plist/lib/parse.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/plist/lib/build.js", "../node_modules/plist/index.js", "../src/services/notifier.ts", "../src/bridge/bridgeStatusUtil.ts", "../src/utils/activityManager.ts", "../src/constants/spinnerVerbs.ts", "../src/tasks/InProcessTeammateTask/types.ts", "../src/utils/tasks.ts", "../src/components/TaskListV2.tsx", "../src/hooks/useTasksV2.ts", "../src/components/Spinner/utils.ts", "../src/components/Spinner/FlashingChar.tsx", "../src/components/Spinner/GlimmerMessage.tsx", "../src/components/Spinner/ShimmerChar.tsx", "../src/components/Spinner/SpinnerGlyph.tsx", "../src/components/Spinner/useShimmerAnimation.ts", "../src/components/Spinner/useStalledAnimation.ts", "../src/components/Spinner/index.ts", "../src/utils/ink.ts", "../src/components/Spinner/SpinnerAnimationRow.tsx", "../src/tasks/types.ts", "../src/constants/turnCompletionVerbs.ts", "../src/utils/agentId.ts", "../src/utils/swarm/backends/types.ts", "../src/utils/swarm/constants.ts", "../src/utils/swarm/backends/detection.ts", "../src/entrypoints/sdk/coreSchemas.ts", "../src/utils/teammateMailbox.ts", "../src/utils/permissions/PermissionRule.ts", "../src/utils/permissions/PermissionUpdateSchema.ts", "../src/utils/swarm/permissionSync.ts", "../src/hooks/useSwarmPermissionPoller.ts", "../src/utils/toolResultStorage.ts", "../src/utils/swarm/leaderPermissionBridge.ts", "../src/utils/swarm/teammatePromptAddendum.ts", "../src/utils/swarm/inProcessRunner.ts", "../src/utils/swarm/backends/InProcessBackend.ts", "../src/utils/swarm/backends/it2Setup.ts", "../src/utils/swarm/backends/teammateModeSnapshot.ts", "../src/utils/swarm/spawnUtils.ts", "../src/utils/swarm/teammateLayoutManager.ts", "../src/utils/swarm/backends/PaneBackendExecutor.ts", "../src/utils/swarm/backends/TmuxBackend.ts", "../src/utils/swarm/backends/ITermBackend.ts", "../src/utils/swarm/backends/registry.ts", "../src/utils/swarm/teamHelpers.ts", "../src/utils/swarm/spawnInProcess.ts", "../src/tasks/InProcessTeammateTask/InProcessTeammateTask.tsx", "../src/state/selectors.ts", "../src/hooks/useElapsedTime.ts", "../src/components/Spinner/teammateSelectHint.ts", "../src/components/Spinner/TeammateSpinnerLine.tsx", "../src/components/Spinner/TeammateSpinnerTree.tsx", "../src/components/Spinner.tsx", "../src/components/ConsoleOAuthFlow.tsx", "../src/hooks/useMainLoopModel.ts", "../src/utils/permissions/bypassPermissionsKillswitch.ts", "../src/commands/login/login.tsx", "../src/utils/teleport/api.ts", "../src/services/api/adminRequests.ts", "../src/services/api/overageCreditGrant.ts", "../src/services/api/usage.ts", "../src/commands/extra-usage/extra-usage-core.ts", "../src/commands/extra-usage/extra-usage.tsx", "../src/commands/extra-usage/extra-usage-noninteractive.ts", "../src/commands/extra-usage/index.ts", "../src/services/claudeAiLimitsHook.ts", "../src/components/messages/RateLimitMessage.tsx", "../src/components/messages/AssistantTextMessage.tsx", "../src/components/messages/AssistantThinkingMessage.tsx", "../src/utils/classifierApprovals.ts", "../src/utils/classifierApprovalsHook.ts", "../src/components/SentryErrorBoundary.ts", "../src/components/messages/HookProgressMessage.tsx", "../src/components/messages/AssistantToolUseMessage.tsx", "../src/components/messages/UserAgentNotificationMessage.tsx", "../src/components/messages/UserBashInputMessage.tsx", "../src/components/shell/ShellTimeDisplay.tsx", "../src/tools/BashTool/BashToolResultMessage.tsx", "../src/components/messages/UserBashOutputMessage.tsx", "../src/components/messages/UserCommandMessage.tsx", "../src/components/messages/UserLocalCommandOutputMessage.tsx", "../src/components/messages/UserMemoryInputMessage.tsx", "../src/components/messages/UserPlanMessage.tsx", "../src/context/QueuedMessageContext.tsx", "../src/utils/formatBriefTimestamp.ts", "../src/components/messages/HighlightedThinkingText.tsx", "../src/components/messages/UserPromptMessage.tsx", "../src/components/messages/UserResourceUpdateMessage.tsx", "../src/components/messages/ShutdownMessage.tsx", "../src/components/messages/TaskAssignmentMessage.tsx", "../src/components/messages/PlanApprovalMessage.tsx", "../src/components/messages/UserTeammateMessage.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/messages/UserGitHubWebhookMessage.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/messages/UserForkBoilerplateMessage.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/messages/UserCrossSessionMessage.js", "../src/components/messages/UserChannelMessage.tsx", "../src/components/messages/UserTextMessage.tsx", "../src/services/diagnosticTracking.ts", "../src/components/DiagnosticsDisplay.tsx", "../src/components/messages/UserImageMessage.tsx", "../src/components/FilePathLink.tsx", "../src/components/messages/AttachmentMessage.tsx", "../src/hooks/useMinDisplayTime.ts", "../src/components/PrBadge.tsx", "../src/components/messages/teamMemCollapsed.tsx", "../src/components/messages/CollapsedReadSearchContent.tsx", "../src/components/messages/CompactBoundaryMessage.tsx", "../src/components/messages/GroupedToolUseContent.tsx", "../src/components/messages/SystemAPIErrorMessage.tsx", "../src/tasks/pillLabel.ts", "../src/components/messages/teamMemSaved.ts", "../src/components/messages/SystemTextMessage.tsx", "../src/components/messages/UserToolResultMessage/UserToolCanceledMessage.tsx", "../src/components/messages/UserToolResultMessage/RejectedPlanMessage.tsx", "../src/components/messages/UserToolResultMessage/RejectedToolUseMessage.tsx", "../src/components/messages/UserToolResultMessage/UserToolErrorMessage.tsx", "../src/components/messages/UserToolResultMessage/UserToolRejectMessage.tsx", "../src/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx", "../src/components/messages/UserToolResultMessage/utils.tsx", "../src/components/messages/UserToolResultMessage/UserToolResultMessage.tsx", "../src/components/OffscreenFreeze.tsx", "../src/services/compact/snipProjection.ts", "../src/services/compact/snipCompact.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/messages/SnipBoundaryMessage.js", "../src/components/Message.tsx", "../src/tools/AgentTool/UI.tsx", "../src/utils/hooks/registerSkillHooks.ts", "../src/utils/slashCommandParsing.ts", "../src/utils/suggestions/skillUsageTracking.ts", "../src/utils/telemetry/pluginTelemetry.ts", "../src/utils/processUserInput/processSlashCommand.tsx", "../src/tasks/MonitorMcpTask/MonitorMcpTask.ts", "../src/tools/AgentTool/runAgent.ts", "../src/services/AgentSummary/agentSummary.ts", "../src/utils/todo/types.ts", "../src/tools/TodoWriteTool/prompt.ts", "../src/tools/TodoWriteTool/TodoWriteTool.ts", "../src/utils/teleport/environments.ts", "../src/utils/background/remote/preconditions.ts", "../src/utils/background/remote/remoteSession.ts", "../src/components/TeleportStash.tsx", "../src/components/TeleportError.tsx", "../src/utils/sessionIngressAuth.ts", "../src/services/api/sessionIngress.ts", "../src/utils/fileHistory.ts", "../src/utils/filePersistence/outputsScanner.ts", "../src/utils/words.ts", "../src/utils/plans.ts", "../src/utils/sessionEnvironment.ts", "../src/utils/hooks/hooksConfigSnapshot.ts", "../src/utils/hooks/fileChangedWatcher.ts", "../src/utils/plugins/loadPluginHooks.ts", "../src/utils/sessionStart.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/utils/udsClient.js", "../src/utils/conversationRecovery.ts", "../src/services/api/filesApi.ts", "../src/utils/tempfile.ts", "../src/utils/teleport/gitBundle.ts", "../src/utils/teleport.tsx", "../src/tasks/RemoteAgentTask/RemoteAgentTask.tsx", "../src/tools/utils.ts", "../src/tools/SkillTool/UI.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/remoteSkillState.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/remoteSkillLoader.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/telemetry.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/featureCheck.js", "../src/tools/SkillTool/SkillTool.ts", "../src/services/lsp/LSPDiagnosticRegistry.ts", "../src/utils/plugins/lspPluginIntegration.ts", "../src/services/lsp/config.ts", "../node_modules/vscode-jsonrpc/lib/common/is.js", "../node_modules/vscode-jsonrpc/lib/common/messages.js", "../node_modules/vscode-jsonrpc/lib/common/linkedMap.js", "../node_modules/vscode-jsonrpc/lib/common/disposable.js", "../node_modules/vscode-jsonrpc/lib/common/ral.js", "../node_modules/vscode-jsonrpc/lib/common/events.js", "../node_modules/vscode-jsonrpc/lib/common/cancellation.js", "../node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js", "../node_modules/vscode-jsonrpc/lib/common/semaphore.js", "../node_modules/vscode-jsonrpc/lib/common/messageReader.js", "../node_modules/vscode-jsonrpc/lib/common/messageWriter.js", "../node_modules/vscode-jsonrpc/lib/common/messageBuffer.js", "../node_modules/vscode-jsonrpc/lib/common/connection.js", "../node_modules/vscode-jsonrpc/lib/common/api.js", "../node_modules/vscode-jsonrpc/lib/node/ril.js", "../node_modules/vscode-jsonrpc/lib/node/main.js", "../src/utils/subprocessEnv.ts", "../src/services/lsp/LSPClient.ts", "../src/services/lsp/LSPServerInstance.ts", "../src/services/lsp/LSPServerManager.ts", "../src/services/lsp/passiveFeedback.ts", "../src/services/lsp/manager.ts", "../src/services/teamMemorySync/secretScanner.ts", "../src/services/teamMemorySync/teamMemSecretGuard.ts", "../src/utils/argumentSubstitution.ts", "../src/utils/claudeCodeHints.ts", "../src/utils/plugins/pluginPolicy.ts", "../src/utils/plugins/hintRecommendation.ts", "../src/utils/CircularBuffer.ts", "../src/utils/envValidation.ts", "../src/utils/shell/outputLimits.ts", "../src/utils/task/TaskOutput.ts", "../src/utils/bash/bashPipeCommand.ts", "../src/utils/bash/ShellSnapshot.ts", "../src/utils/bash/shellPrefix.ts", "../src/utils/bash/shellQuoting.ts", "../src/utils/sessionEnvVars.ts", "../src/utils/tmuxSocket.ts", "../src/utils/shell/bashProvider.ts", "../src/utils/shell/powershellDetection.ts", "../src/utils/shell/powershellProvider.ts", "../src/utils/Shell.ts", "../src/utils/semanticBoolean.ts", "../src/utils/semanticNumber.ts", "../src/components/shell/ShellProgressMessage.tsx", "../src/tools/BashTool/sedEditParser.ts", "../src/tools/BashTool/UI.tsx", "../src/tools/BashTool/utils.ts", "../src/tools/shared/gitOperationTracking.ts", "../src/tools/PowerShellTool/commandSemantics.ts", "../src/utils/powershell/parser.ts", "../src/tools/PowerShellTool/gitSafety.ts", "../src/tools/PowerShellTool/commonParameters.ts", "../src/tools/PowerShellTool/readOnlyValidation.ts", "../src/tools/PowerShellTool/modeValidation.ts", "../src/tools/PowerShellTool/pathValidation.ts", "../src/utils/permissions/dangerousPatterns.ts", "../src/utils/powershell/dangerousCmdlets.ts", "../src/tools/PowerShellTool/clmTypes.ts", "../src/tools/PowerShellTool/powershellSecurity.ts", "../src/tools/PowerShellTool/powershellPermissions.ts", "../src/utils/timeouts.ts", "../src/tools/PowerShellTool/prompt.ts", "../src/tools/PowerShellTool/UI.tsx", "../src/tools/PowerShellTool/PowerShellTool.tsx", "../src/utils/promptShellExecution.ts", "../src/skills/mcpSkillBuilders.ts", "../src/skills/loadSkillsDir.ts", "../src/cost-tracker.ts", "../src/utils/diff.ts", "../src/utils/fileOperationAnalytics.ts", "../src/utils/gitDiff.ts", "../src/utils/settings/validateEditTool.ts", "../src/tools/FileEditTool/prompt.ts", "../src/tools/FileEditTool/types.ts", "../src/components/HighlightedCode/Fallback.tsx", "../src/native-ts/color-diff/index.ts", "../src/components/StructuredDiff/colorDiff.ts", "../src/components/HighlightedCode.tsx", "../src/components/StructuredDiff/Fallback.tsx", "../src/components/StructuredDiff.tsx", "../src/components/StructuredDiffList.tsx", "../src/components/FileEditToolUseRejectedMessage.tsx", "../src/components/FileEditToolUpdatedMessage.tsx", "../src/utils/readEditContext.ts", "../src/tools/FileEditTool/utils.ts", "../src/tools/FileEditTool/UI.tsx", "../src/tools/FileEditTool/FileEditTool.ts", "../src/tools/FileWriteTool/UI.tsx", "../src/tools/FileWriteTool/FileWriteTool.ts", "../src/utils/plugins/orphanedPluginFilter.ts", "../src/utils/glob.ts", "../src/tools/GrepTool/UI.tsx", "../src/tools/GrepTool/GrepTool.ts", "../src/tools/GlobTool/UI.tsx", "../src/tools/GlobTool/GlobTool.ts", "../src/utils/notebook.ts", "../src/tools/NotebookEditTool/prompt.ts", "../src/components/NotebookEditToolUseRejectedMessage.tsx", "../src/tools/NotebookEditTool/UI.tsx", "../src/tools/NotebookEditTool/NotebookEditTool.ts", "../src/tools/WebFetchTool/preapproved.ts", "../src/tools/WebFetchTool/UI.tsx", "../src/utils/mcpOutputStorage.ts", "../node_modules/@mixmark-io/domino/lib/Event.js", "../node_modules/@mixmark-io/domino/lib/UIEvent.js", "../node_modules/@mixmark-io/domino/lib/MouseEvent.js", "../node_modules/@mixmark-io/domino/lib/DOMException.js", "../node_modules/@mixmark-io/domino/lib/config.js", "../node_modules/@mixmark-io/domino/lib/utils.js", "../node_modules/@mixmark-io/domino/lib/EventTarget.js", "../node_modules/@mixmark-io/domino/lib/LinkedList.js", "../node_modules/@mixmark-io/domino/lib/NodeUtils.js", "../node_modules/@mixmark-io/domino/lib/Node.js", "../node_modules/@mixmark-io/domino/lib/NodeList.es6.js", "../node_modules/@mixmark-io/domino/lib/NodeList.es5.js", "../node_modules/@mixmark-io/domino/lib/NodeList.js", "../node_modules/@mixmark-io/domino/lib/ContainerNode.js", "../node_modules/@mixmark-io/domino/lib/xmlnames.js", "../node_modules/@mixmark-io/domino/lib/attributes.js", "../node_modules/@mixmark-io/domino/lib/FilteredElementList.js", "../node_modules/@mixmark-io/domino/lib/DOMTokenList.js", "../node_modules/@mixmark-io/domino/lib/select.js", "../node_modules/@mixmark-io/domino/lib/ChildNode.js", "../node_modules/@mixmark-io/domino/lib/NonDocumentTypeChildNode.js", "../node_modules/@mixmark-io/domino/lib/NamedNodeMap.js", "../node_modules/@mixmark-io/domino/lib/Element.js", "../node_modules/@mixmark-io/domino/lib/Leaf.js", "../node_modules/@mixmark-io/domino/lib/CharacterData.js", "../node_modules/@mixmark-io/domino/lib/Text.js", "../node_modules/@mixmark-io/domino/lib/Comment.js", "../node_modules/@mixmark-io/domino/lib/DocumentFragment.js", "../node_modules/@mixmark-io/domino/lib/ProcessingInstruction.js", "../node_modules/@mixmark-io/domino/lib/NodeFilter.js", "../node_modules/@mixmark-io/domino/lib/NodeTraversal.js", "../node_modules/@mixmark-io/domino/lib/TreeWalker.js", "../node_modules/@mixmark-io/domino/lib/NodeIterator.js", "../node_modules/@mixmark-io/domino/lib/URL.js", "../node_modules/@mixmark-io/domino/lib/CustomEvent.js", "../node_modules/@mixmark-io/domino/lib/events.js", "../node_modules/@mixmark-io/domino/lib/style_parser.js", "../node_modules/@mixmark-io/domino/lib/CSSStyleDeclaration.js", "../node_modules/@mixmark-io/domino/lib/URLUtils.js", "../node_modules/@mixmark-io/domino/lib/defineElement.js", "../node_modules/@mixmark-io/domino/lib/htmlelts.js", "../node_modules/@mixmark-io/domino/lib/svg.js", "../node_modules/@mixmark-io/domino/lib/MutationConstants.js", "../node_modules/@mixmark-io/domino/lib/Document.js", "../node_modules/@mixmark-io/domino/lib/DocumentType.js", "../node_modules/@mixmark-io/domino/lib/HTMLParser.js", "../node_modules/@mixmark-io/domino/lib/DOMImplementation.js", "../node_modules/@mixmark-io/domino/lib/Location.js", "../node_modules/@mixmark-io/domino/lib/NavigatorID.js", "../node_modules/@mixmark-io/domino/lib/WindowTimers.js", "../node_modules/@mixmark-io/domino/lib/impl.js", "../node_modules/@mixmark-io/domino/lib/Window.js", "../node_modules/@mixmark-io/domino/lib/index.js", "../node_modules/turndown/lib/turndown.cjs.js", "../src/tools/WebFetchTool/utils.ts", "../src/tools/WebFetchTool/WebFetchTool.ts", "../src/utils/listSessionsImpl.ts", "../src/services/autoDream/consolidationLock.ts", "../src/tasks/DreamTask/DreamTask.ts", "../src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts", "../src/tasks.ts", "../src/tasks/stopTask.ts", "../src/tools/TaskStopTool/UI.tsx", "../src/tools/TaskStopTool/TaskStopTool.ts", "../src/bridge/bridgeConfig.ts", "../src/tools/BriefTool/upload.ts", "../src/tools/BriefTool/attachments.ts", "../src/tools/BriefTool/UI.tsx", "../src/tools/BriefTool/BriefTool.ts", "../src/utils/task/outputFormatting.ts", "../src/tools/TaskOutputTool/TaskOutputTool.tsx", "../src/tools/WebSearchTool/UI.tsx", "../src/tools/WebSearchTool/WebSearchTool.ts", "../src/utils/inProcessTeammateHelpers.ts", "../src/tools/ExitPlanModeTool/prompt.ts", "../src/tools/ExitPlanModeTool/UI.tsx", "../src/utils/permissions/autoModeState.ts", "../src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts", "../src/tools/testing/TestingPermissionTool.tsx", "../src/tools/TungstenTool/TungstenTool.ts", "../src/tools/AskUserQuestionTool/AskUserQuestionTool.tsx", "../src/tools/LSPTool/formatters.ts", "../src/tools/LSPTool/prompt.ts", "../src/tools/LSPTool/schemas.ts", "../src/tools/LSPTool/symbolContext.ts", "../src/tools/LSPTool/UI.tsx", "../src/tools/LSPTool/LSPTool.ts", "../src/tools/ReadMcpResourceTool/prompt.ts", "../src/tools/ReadMcpResourceTool/UI.tsx", "../src/tools/ReadMcpResourceTool/ReadMcpResourceTool.ts", "../src/utils/planModeV2.ts", "../src/tools/EnterPlanModeTool/prompt.ts", "../src/tools/EnterPlanModeTool/UI.tsx", "../src/tools/EnterPlanModeTool/EnterPlanModeTool.ts", "../src/constants/systemPromptSections.ts", "../src/tools/EnterWorktreeTool/prompt.ts", "../src/tools/EnterWorktreeTool/UI.tsx", "../src/tools/EnterWorktreeTool/EnterWorktreeTool.ts", "../src/tools/ExitWorktreeTool/prompt.ts", "../src/tools/ExitWorktreeTool/UI.tsx", "../src/tools/ExitWorktreeTool/ExitWorktreeTool.ts", "../src/tools/ConfigTool/constants.ts", "../src/utils/model/modelOptions.ts", "../src/voice/voiceModeEnabled.ts", "../src/utils/model/validateModel.ts", "../src/tools/ConfigTool/supportedSettings.ts", "../src/tools/ConfigTool/prompt.ts", "../src/tools/ConfigTool/UI.tsx", "../node_modules/ws/lib/constants.js", "../node_modules/ws/lib/buffer-util.js", "../node_modules/ws/lib/limiter.js", "../node_modules/ws/lib/permessage-deflate.js", "../node_modules/ws/lib/validation.js", "../node_modules/ws/lib/receiver.js", "../node_modules/ws/lib/sender.js", "../node_modules/ws/lib/event-target.js", "../node_modules/ws/lib/extension.js", "../node_modules/ws/lib/websocket.js", "../node_modules/ws/lib/stream.js", "../node_modules/ws/lib/subprotocol.js", "../node_modules/ws/lib/websocket-server.js", "../node_modules/ws/wrapper.mjs", "../src/services/voiceStreamSTT.ts", "../src/services/voice.ts", "../src/tools/ConfigTool/ConfigTool.ts", "../src/tools/TaskCreateTool/prompt.ts", "../src/tools/TaskCreateTool/TaskCreateTool.ts", "../src/tools/TaskGetTool/prompt.ts", "../src/tools/TaskGetTool/TaskGetTool.ts", "../src/tools/TaskUpdateTool/prompt.ts", "../src/tools/TaskUpdateTool/TaskUpdateTool.ts", "../src/tools/TaskListTool/prompt.ts", "../src/tools/TaskListTool/TaskListTool.ts", "../src/utils/worktreeModeEnabled.ts", "../src/tools/REPLTool/REPLTool.ts", "../src/tools/SuggestBackgroundPRTool/SuggestBackgroundPRTool.ts", "../src/tools/SleepTool/SleepTool.ts", "../src/tools/ScheduleCronTool/UI.tsx", "../src/tools/ScheduleCronTool/CronCreateTool.ts", "../src/tools/ScheduleCronTool/CronDeleteTool.ts", "../src/tools/ScheduleCronTool/CronListTool.ts", "../src/tools/RemoteTriggerTool/prompt.ts", "../src/tools/RemoteTriggerTool/UI.tsx", "../src/tools/RemoteTriggerTool/RemoteTriggerTool.ts", "../src/tools/MonitorTool/MonitorTool.ts", "../src/tools/SendUserFileTool/SendUserFileTool.ts", "../src/tools/PushNotificationTool/PushNotificationTool.ts", "../src/tools/SubscribePRTool/SubscribePRTool.ts", "../src/tools/TeamCreateTool/prompt.ts", "../src/tools/TeamCreateTool/UI.tsx", "../src/tools/TeamCreateTool/TeamCreateTool.ts", "../src/tools/TeamDeleteTool/prompt.ts", "../src/tools/TeamDeleteTool/UI.tsx", "../src/tools/TeamDeleteTool/TeamDeleteTool.ts", "../src/utils/concurrentSessions.ts", "../src/bridge/replBridgeHandle.ts", "../src/tasks/LocalMainSessionTask.ts", "../src/utils/peerAddress.ts", "../src/proactive/index.ts", "../src/utils/systemPrompt.ts", "../src/tools/AgentTool/resumeAgent.ts", "../src/tools/SendMessageTool/prompt.ts", "../src/tools/SendMessageTool/UI.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/bridge/peerSessions.js", "../src/tools/SendMessageTool/SendMessageTool.ts", "../src/tools/VerifyPlanExecutionTool/VerifyPlanExecutionTool.ts", "../src/tools/OverflowTestTool/OverflowTestTool.ts", "../src/tools/CtxInspectTool/CtxInspectTool.ts", "../src/tools/TerminalCaptureTool/TerminalCaptureTool.ts", "../src/tools/WebBrowserTool/WebBrowserTool.ts", "../src/tools/SnipTool/SnipTool.ts", "../src/tools/ListPeersTool/ListPeersTool.ts", "../src/tools/WorkflowTool/bundled/index.ts", "../src/tools/WorkflowTool/WorkflowTool.ts", "../src/tools.ts", "../src/utils/swarm/It2SetupPrompt.tsx", "../src/utils/swarm/teammateModel.ts", "../src/tools/shared/spawnMultiAgent.ts", "../src/tools/AgentTool/prompt.ts", "../src/tools/AgentTool/AgentTool.tsx", "../src/tools/REPLTool/primitiveTools.ts", "../src/utils/memoryFileDetection.ts", "../src/utils/teamMemoryOps.ts", "../src/tools/SnipTool/prompt.ts", "../src/utils/collapseReadSearch.ts", "../src/tasks/LocalAgentTask/LocalAgentTask.tsx", "../src/tasks/LocalShellTask/LocalShellTask.tsx", "../src/utils/codeIndexing.ts", "../src/tools/BashTool/commandSemantics.ts", "../src/services/teamMemorySync/types.ts", "../src/services/teamMemorySync/index.ts", "../src/services/teamMemorySync/watcher.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/memdir/memoryShapeTelemetry.js", "../src/utils/sessionFileAccessHooks.ts", "../src/utils/undercover.ts", "../src/utils/attributionTrailer.ts", "../src/utils/attribution.ts", "../src/tools/BashTool/prompt.ts", "../src/tools/BashTool/BashTool.tsx", "../src/tools/BashTool/bashCommandHelpers.ts", "../src/tools/BashTool/modeValidation.ts", "../src/tools/BashTool/bashPermissions.ts", "../src/utils/sessionActivity.ts", "../src/utils/stream.ts", "../src/utils/toolErrors.ts", "../src/utils/permissions/PermissionResult.ts", "../src/services/tools/toolHooks.ts", "../src/services/tools/toolExecution.ts", "../src/services/tools/StreamingToolExecutor.ts", "../src/utils/queryProfiler.ts", "../src/services/autoDream/config.ts", "../src/utils/readFileInRange.ts", "../src/memdir/memoryTypes.ts", "../src/memdir/memoryScan.ts", "../src/services/extractMemories/prompts.ts", "../src/services/extractMemories/extractMemories.ts", "../src/services/autoDream/consolidationPrompt.ts", "../src/services/autoDream/autoDream.ts", "../src/jobs/classifier.ts", "../src/utils/withResolvers.ts", "../src/utils/computerUse/computerUseLock.ts", "../../node_modules/@ant/computer-use-swift/js/index.js", "../src/utils/computerUse/swiftLoader.ts", "../src/utils/computerUse/drainRunLoop.ts", "../src/utils/computerUse/escHotkey.ts", "../../node_modules/@ant/computer-use-mcp/src/types.ts", "../../node_modules/@ant/computer-use-mcp/src/sentinelApps.ts", "../../node_modules/@ant/computer-use-mcp/src/deniedApps.ts", "../../node_modules/@ant/computer-use-mcp/src/keyBlocklist.ts", "../../node_modules/@ant/computer-use-mcp/src/imageResize.ts", "../../node_modules/@ant/computer-use-mcp/src/pixelCompare.ts", "../../node_modules/@ant/computer-use-mcp/src/toolCalls.ts", "../../node_modules/zod/v3/helpers/util.js", "../../node_modules/zod/v3/ZodError.js", "../../node_modules/zod/v3/locales/en.js", "../../node_modules/zod/v3/errors.js", "../../node_modules/zod/v3/helpers/parseUtil.js", "../../node_modules/zod/v3/helpers/errorUtil.js", "../../node_modules/zod/v3/types.js", "../../node_modules/zod/v3/external.js", "../../node_modules/zod/v3/index.js", "../../node_modules/zod/v4/core/core.js", "../../node_modules/zod/v4/core/util.js", "../../node_modules/zod/v4/core/errors.js", "../../node_modules/zod/v4/core/parse.js", "../../node_modules/zod/v4/core/regexes.js", "../../node_modules/zod/v4/core/checks.js", "../../node_modules/zod/v4/core/doc.js", "../../node_modules/zod/v4/core/versions.js", "../../node_modules/zod/v4/core/schemas.js", "../../node_modules/zod/v4/locales/ar.js", "../../node_modules/zod/v4/locales/az.js", "../../node_modules/zod/v4/locales/be.js", "../../node_modules/zod/v4/locales/ca.js", "../../node_modules/zod/v4/locales/cs.js", "../../node_modules/zod/v4/locales/de.js", "../../node_modules/zod/v4/locales/en.js", "../../node_modules/zod/v4/locales/eo.js", "../../node_modules/zod/v4/locales/es.js", "../../node_modules/zod/v4/locales/fa.js", "../../node_modules/zod/v4/locales/fi.js", "../../node_modules/zod/v4/locales/fr.js", "../../node_modules/zod/v4/locales/fr-CA.js", "../../node_modules/zod/v4/locales/he.js", "../../node_modules/zod/v4/locales/hu.js", "../../node_modules/zod/v4/locales/id.js", "../../node_modules/zod/v4/locales/it.js", "../../node_modules/zod/v4/locales/ja.js", "../../node_modules/zod/v4/locales/kh.js", "../../node_modules/zod/v4/locales/ko.js", "../../node_modules/zod/v4/locales/mk.js", "../../node_modules/zod/v4/locales/ms.js", "../../node_modules/zod/v4/locales/nl.js", "../../node_modules/zod/v4/locales/no.js", "../../node_modules/zod/v4/locales/ota.js", "../../node_modules/zod/v4/locales/ps.js", "../../node_modules/zod/v4/locales/pl.js", "../../node_modules/zod/v4/locales/pt.js", "../../node_modules/zod/v4/locales/ru.js", "../../node_modules/zod/v4/locales/sl.js", "../../node_modules/zod/v4/locales/sv.js", "../../node_modules/zod/v4/locales/ta.js", "../../node_modules/zod/v4/locales/th.js", "../../node_modules/zod/v4/locales/tr.js", "../../node_modules/zod/v4/locales/ua.js", "../../node_modules/zod/v4/locales/ur.js", "../../node_modules/zod/v4/locales/vi.js", "../../node_modules/zod/v4/locales/zh-CN.js", "../../node_modules/zod/v4/locales/zh-TW.js", "../../node_modules/zod/v4/locales/index.js", "../../node_modules/zod/v4/core/registries.js", "../../node_modules/zod/v4/core/api.js", "../../node_modules/zod/v4/core/function.js", "../../node_modules/zod/v4/core/to-json-schema.js", "../../node_modules/zod/v4/core/index.js", "../../node_modules/zod/v4/mini/parse.js", "../../node_modules/zod/v4/mini/schemas.js", "../../node_modules/zod/v4/mini/checks.js", "../../node_modules/zod/v4/mini/iso.js", "../../node_modules/zod/v4/mini/coerce.js", "../../node_modules/zod/v4/mini/external.js", "../../node_modules/zod/v4/mini/index.js", "../../node_modules/zod/v4-mini/index.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js", "../../node_modules/zod/v4/classic/checks.js", "../../node_modules/zod/v4/classic/iso.js", "../../node_modules/zod/v4/classic/errors.js", "../../node_modules/zod/v4/classic/parse.js", "../../node_modules/zod/v4/classic/schemas.js", "../../node_modules/zod/v4/classic/compat.js", "../../node_modules/zod/v4/classic/coerce.js", "../../node_modules/zod/v4/classic/external.js", "../../node_modules/zod/v4/classic/index.js", "../../node_modules/zod/v4/index.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js", "../../node_modules/zod-to-json-schema/dist/esm/Options.js", "../../node_modules/zod-to-json-schema/dist/esm/Refs.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/array.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/branded.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/catch.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/default.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/string.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/map.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/never.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/union.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/object.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/set.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js", "../../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js", "../../node_modules/zod-to-json-schema/dist/esm/selectParser.js", "../../node_modules/zod-to-json-schema/dist/esm/parseDef.js", "../../node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js", "../../node_modules/zod-to-json-schema/dist/esm/index.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js", "../../node_modules/ajv/dist/compile/codegen/code.js", "../../node_modules/ajv/dist/compile/codegen/scope.js", "../../node_modules/ajv/dist/compile/codegen/index.js", "../../node_modules/ajv/dist/compile/util.js", "../../node_modules/ajv/dist/compile/names.js", "../../node_modules/ajv/dist/compile/errors.js", "../../node_modules/ajv/dist/compile/validate/boolSchema.js", "../../node_modules/ajv/dist/compile/rules.js", "../../node_modules/ajv/dist/compile/validate/applicability.js", "../../node_modules/ajv/dist/compile/validate/dataType.js", "../../node_modules/ajv/dist/compile/validate/defaults.js", "../../node_modules/ajv/dist/vocabularies/code.js", "../../node_modules/ajv/dist/compile/validate/keyword.js", "../../node_modules/ajv/dist/compile/validate/subschema.js", "../../node_modules/fast-deep-equal/index.js", "../../node_modules/json-schema-traverse/index.js", "../../node_modules/ajv/dist/compile/resolve.js", "../../node_modules/ajv/dist/compile/validate/index.js", "../../node_modules/ajv/dist/runtime/validation_error.js", "../../node_modules/ajv/dist/compile/ref_error.js", "../../node_modules/ajv/dist/compile/index.js", "../../node_modules/fast-uri/lib/utils.js", "../../node_modules/fast-uri/lib/schemes.js", "../../node_modules/fast-uri/index.js", "../../node_modules/ajv/dist/runtime/uri.js", "../../node_modules/ajv/dist/core.js", "../../node_modules/ajv/dist/vocabularies/core/id.js", "../../node_modules/ajv/dist/vocabularies/core/ref.js", "../../node_modules/ajv/dist/vocabularies/core/index.js", "../../node_modules/ajv/dist/vocabularies/validation/limitNumber.js", "../../node_modules/ajv/dist/vocabularies/validation/multipleOf.js", "../../node_modules/ajv/dist/runtime/ucs2length.js", "../../node_modules/ajv/dist/vocabularies/validation/limitLength.js", "../../node_modules/ajv/dist/vocabularies/validation/pattern.js", "../../node_modules/ajv/dist/vocabularies/validation/limitProperties.js", "../../node_modules/ajv/dist/vocabularies/validation/required.js", "../../node_modules/ajv/dist/vocabularies/validation/limitItems.js", "../../node_modules/ajv/dist/runtime/equal.js", "../../node_modules/ajv/dist/vocabularies/validation/uniqueItems.js", "../../node_modules/ajv/dist/vocabularies/validation/const.js", "../../node_modules/ajv/dist/vocabularies/validation/enum.js", "../../node_modules/ajv/dist/vocabularies/validation/index.js", "../../node_modules/ajv/dist/vocabularies/applicator/additionalItems.js", "../../node_modules/ajv/dist/vocabularies/applicator/items.js", "../../node_modules/ajv/dist/vocabularies/applicator/prefixItems.js", "../../node_modules/ajv/dist/vocabularies/applicator/items2020.js", "../../node_modules/ajv/dist/vocabularies/applicator/contains.js", "../../node_modules/ajv/dist/vocabularies/applicator/dependencies.js", "../../node_modules/ajv/dist/vocabularies/applicator/propertyNames.js", "../../node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js", "../../node_modules/ajv/dist/vocabularies/applicator/properties.js", "../../node_modules/ajv/dist/vocabularies/applicator/patternProperties.js", "../../node_modules/ajv/dist/vocabularies/applicator/not.js", "../../node_modules/ajv/dist/vocabularies/applicator/anyOf.js", "../../node_modules/ajv/dist/vocabularies/applicator/oneOf.js", "../../node_modules/ajv/dist/vocabularies/applicator/allOf.js", "../../node_modules/ajv/dist/vocabularies/applicator/if.js", "../../node_modules/ajv/dist/vocabularies/applicator/thenElse.js", "../../node_modules/ajv/dist/vocabularies/applicator/index.js", "../../node_modules/ajv/dist/vocabularies/format/format.js", "../../node_modules/ajv/dist/vocabularies/format/index.js", "../../node_modules/ajv/dist/vocabularies/metadata.js", "../../node_modules/ajv/dist/vocabularies/draft7.js", "../../node_modules/ajv/dist/vocabularies/discriminator/types.js", "../../node_modules/ajv/dist/vocabularies/discriminator/index.js", "../../node_modules/ajv/dist/ajv.js", "../../node_modules/ajv-formats/dist/formats.js", "../../node_modules/ajv-formats/dist/limit.js", "../../node_modules/ajv-formats/dist/index.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js", "../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js", "../../node_modules/@ant/computer-use-mcp/src/tools.ts", "../../node_modules/@ant/computer-use-mcp/src/mcpServer.ts", "../../node_modules/@ant/computer-use-mcp/src/index.ts", "../../node_modules/@ant/computer-use-input/js/index.js", "../src/utils/computerUse/inputLoader.ts", "../src/utils/computerUse/executor.ts", "../src/utils/computerUse/cleanup.ts", "../src/query/stopHooks.ts", "../src/query/config.ts", "../src/query/deps.ts", "../src/utils/tokenBudget.ts", "../src/query/tokenBudget.ts", "../src/services/compact/reactiveCompact.ts", "../src/services/contextCollapse/index.ts", "../src/services/skillSearch/prefetch.ts", "../src/utils/taskSummary.ts", "../src/query.ts", "../src/services/api/emptyUsage.ts", "../src/services/api/logging.ts", "../src/utils/permissions/denialTracking.ts", "../src/utils/forkedAgent.ts", "../src/utils/memory/types.ts", "../src/services/internalLogging.ts", "../src/services/compact/grouping.ts", "../src/services/compact/prompt.ts", "../src/services/sessionTranscript/sessionTranscript.ts", "../src/services/compact/compact.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/utils/attributionHooks.js", "../src/services/compact/postCompactCleanup.ts", "../src/services/SessionMemory/prompts.ts", "../src/services/compact/sessionMemoryCompact.ts", "../src/services/compact/autoCompact.ts", "../src/utils/analyzeContext.ts", "../src/utils/zodToJsonSchema.ts", "../src/utils/toolSearch.ts", "../src/services/vcr.ts", "../src/services/tokenEstimation.ts", "../src/utils/pdf.ts", "../src/tools/FileReadTool/limits.ts", "../src/tools/FileReadTool/UI.tsx", "../src/tools/FileReadTool/FileReadTool.ts", "../src/types/textInputTypes.ts", "../src/utils/mcpInstructionsDelta.ts", "../src/utils/claudeInChrome/prompt.ts", "../src/utils/hooks/hookEvents.ts", "../src/utils/hooks/AsyncHookRegistry.ts", "../src/utils/messagePredicates.ts", "../src/memdir/findRelevantMemories.ts", "../src/utils/attachments.ts", "../src/utils/plugins/loadPluginCommands.ts", "../src/utils/plugins/zipCache.ts", "../src/utils/plugins/cacheUtils.ts", "../src/utils/plugins/marketplaceHelpers.ts", "../src/utils/plugins/officialMarketplaceGcs.ts", "../src/utils/plugins/marketplaceManager.ts", "../src/utils/plugins/installedPluginsManager.ts", "../src/utils/plugins/managedPlugins.ts", "../src/utils/plugins/pluginVersioning.ts", "../src/utils/plugins/pluginInstallationHelpers.ts", "../src/utils/plugins/pluginLoader.ts", "../src/utils/plugins/loadPluginOutputStyles.ts", "../src/outputStyles/loadOutputStylesDir.ts", "../src/constants/outputStyles.ts", "../src/utils/messages.ts", "../src/components/messageActions.tsx", "../src/components/CtrlOToExpand.tsx", "../src/utils/terminal.ts", "../src/tools/ListMcpResourcesTool/prompt.ts", "../src/tools/ListMcpResourcesTool/UI.tsx", "../src/tools/ListMcpResourcesTool/ListMcpResourcesTool.ts", "../src/tools/MCPTool/prompt.ts", "../src/components/design-system/ProgressBar.tsx", "../src/utils/mcpValidation.ts", "../src/tools/MCPTool/UI.tsx", "../src/tools/MCPTool/MCPTool.ts", "../node_modules/cssfilter/lib/default.js", "../node_modules/cssfilter/lib/util.js", "../node_modules/cssfilter/lib/parser.js", "../node_modules/cssfilter/lib/css.js", "../node_modules/cssfilter/lib/index.js", "../node_modules/xss/lib/util.js", "../node_modules/xss/lib/default.js", "../node_modules/xss/lib/parser.js", "../node_modules/xss/lib/xss.js", "../node_modules/xss/lib/index.js", "../src/services/mcp/oauthPort.ts", "../src/services/mcp/xaa.ts", "../src/services/mcp/xaaIdpLogin.ts", "../src/services/mcp/auth.ts", "../src/tools/McpAuthTool/McpAuthTool.ts", "../src/utils/mcpWebSocketTransport.ts", "../src/utils/sanitization.ts", "../src/services/mcp/elicitationHandler.ts", "../src/tools/MCPTool/classifyForCollapse.ts", "../src/services/mcp/headersHelper.ts", "../src/services/mcp/SdkControlTransport.ts", "../src/skills/mcpSkills.ts", "../src/utils/claudeInChrome/toolRendering.tsx", "../src/components/permissions/ComputerUseApproval/ComputerUseApproval.tsx", "../src/utils/computerUse/gates.ts", "../src/utils/computerUse/hostAdapter.ts", "../src/utils/computerUse/toolRendering.tsx", "../src/utils/computerUse/wrapper.tsx", "stub-npm:@ant/claude-for-chrome-mcp", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js", "../src/services/analytics/sink.ts", "../src/utils/claudeInChrome/mcpServer.ts", "../src/services/mcp/InProcessTransport.ts", "../src/utils/computerUse/appNames.ts", "../src/utils/computerUse/mcpServer.ts", "../src/services/mcp/client.ts", "../src/utils/api.ts", "../src/services/compact/apiMicrocompact.ts", "../src/utils/contentArray.ts", "../src/services/api/claude.ts", "../src/utils/shell/prefix.ts", "../src/utils/bash/commands.ts", "../src/tools/BashTool/shouldUseSandbox.ts", "../src/tools/TerminalCaptureTool/prompt.ts", "../src/tools/VerifyPlanExecutionTool/constants.ts", "../src/utils/permissions/classifierDecision.ts", "../src/utils/permissions/permissions.ts", "../src/utils/permissions/permissionSetup.ts", "../src/utils/settings/applySettingsChange.ts", "../src/state/AppState.tsx", "../src/context/notifications.tsx", "../src/hooks/useClipboardImageHint.ts", "../src/components/PromptInput/inputModes.ts", "../src/projectOnboardingState.ts", "../src/utils/appleTerminalBackup.ts", "../src/utils/completionCache.ts", "../src/commands/terminalSetup/terminalSetup.tsx", "../src/utils/pasteStore.ts", "../src/history.ts", "../src/utils/Cursor.ts", "../src/utils/modifiers.ts", "../src/hooks/useTextInput.ts", "../src/hooks/renderPlaceholder.ts", "../src/hooks/usePasteHandler.ts", "../src/utils/textHighlighting.ts", "../src/components/PromptInput/ShimmeredInput.tsx", "../src/components/BaseTextInput.tsx", "../src/components/TextInput.tsx", "../src/utils/suggestions/directoryCompletion.ts", "../src/components/PromptInput/PromptInputFooterSuggestions.tsx", "../src/components/permissions/rules/AddWorkspaceDirectory.tsx", "../src/commands/add-dir/add-dir.tsx", "../src/commands/add-dir/index.ts", "../src/commands/autofix-pr/index.js", "../src/commands/backfill-sessions/index.js", "../src/ink/components/ScrollBox.tsx", "../src/utils/sideQuestion.ts", "../src/commands/btw/btw.tsx", "../src/commands/btw/index.ts", "../src/commands/good-claude/index.js", "../src/commands/issue/index.js", "../src/components/Feedback.tsx", "../src/commands/feedback/feedback.tsx", "../src/commands/feedback/index.ts", "../src/native-ts/file-index/index.ts", "../src/hooks/fileSuggestions.ts", "../src/services/MagicDocs/prompts.ts", "../src/services/MagicDocs/magicDocs.ts", "../src/commands/clear/caches.ts", "../src/commands/clear/conversation.ts", "../src/commands/clear/clear.ts", "../src/commands/clear/index.ts", "../src/commands/color/color.ts", "../src/commands/color/index.ts", "../src/commands/commit.ts", "../src/commands/copy/copy.tsx", "../src/commands/copy/index.ts", "../src/utils/desktopDeepLink.ts", "../src/components/design-system/LoadingState.tsx", "../src/components/DesktopHandoff.tsx", "../src/commands/desktop/desktop.tsx", "../src/commands/desktop/index.ts", "../src/commands/commit-push-pr.ts", "../src/commands/compact/compact.ts", "../src/commands/compact/index.ts", "../src/components/design-system/Tabs.tsx", "../src/components/Settings/Status.tsx", "../src/components/ThemePicker.tsx", "../src/components/EffortIndicator.ts", "../src/components/ModelPicker.tsx", "../src/utils/extraUsage.ts", "../src/components/ClaudeMdExternalIncludesDialog.tsx", "../src/components/ChannelDowngradeDialog.tsx", "../src/components/OutputStylePicker.tsx", "../src/components/LanguagePicker.tsx", "../src/components/SearchBox.tsx", "../src/hooks/useSearchInput.ts", "../src/components/Settings/Config.tsx", "../src/components/LogoV2/OverageCreditUpsell.tsx", "../src/components/Settings/Usage.tsx", "../src/components/Settings/Settings.tsx", "../src/commands/config/config.tsx", "../src/commands/config/index.ts", "../src/utils/contextSuggestions.ts", "../src/components/design-system/StatusIcon.tsx", "../src/components/ContextSuggestions.tsx", "../src/components/ContextVisualization.tsx", "../src/utils/staticRender.tsx", "../src/services/contextCollapse/operations.ts", "../src/commands/context/context.tsx", "../src/commands/context/context-noninteractive.ts", "../src/commands/context/index.ts", "../src/commands/cost/cost.ts", "../src/commands/cost/index.ts", "../src/hooks/useDiffData.ts", "../src/hooks/useTurnDiffs.ts", "../src/components/diff/DiffDetailView.tsx", "../src/components/diff/DiffFileList.tsx", "../src/components/diff/DiffDialog.tsx", "../src/commands/diff/diff.tsx", "../src/commands/diff/index.ts", "../src/commands/ctx_viz/index.js", "../src/components/KeybindingWarnings.tsx", "../src/components/mcp/McpParsingWarnings.tsx", "../src/components/PressEnterToContinue.tsx", "../src/components/sandbox/SandboxDoctorSection.tsx", "../src/utils/treeify.ts", "../src/components/ValidationErrorsList.tsx", "../src/hooks/notifs/useSettingsErrors.tsx", "../src/utils/permissions/shadowedRuleDetection.ts", "../src/utils/statusNoticeHelpers.ts", "../src/utils/doctorContextWarnings.ts", "../src/screens/Doctor.tsx", "../src/commands/doctor/doctor.tsx", "../src/commands/doctor/index.ts", "../src/utils/memory/versions.ts", "../src/components/memory/MemoryFileSelector.tsx", "../src/components/memory/MemoryUpdateNotification.tsx", "../src/utils/editor.ts", "../src/utils/promptEditor.ts", "../src/commands/memory/memory.tsx", "../src/commands/memory/index.ts", "../src/components/HelpV2/Commands.tsx", "../src/components/PromptInput/utils.ts", "../src/components/PromptInput/PromptInputHelpMenu.tsx", "../src/components/HelpV2/General.tsx", "../src/components/HelpV2/HelpV2.tsx", "../src/commands/help/help.tsx", "../src/commands/help/index.ts", "../src/components/IdeAutoConnectDialog.tsx", "../src/commands/ide/ide.tsx", "../src/commands/ide/index.ts", "../src/commands/init.ts", "../src/commands/init-verifiers.ts", "../src/keybindings/template.ts", "../src/commands/keybindings/keybindings.ts", "../src/commands/keybindings/index.ts", "../src/commands/login/index.ts", "../src/commands/logout/index.ts", "../src/components/WorkflowMultiselectDialog.tsx", "../src/constants/github-app.ts", "../src/commands/install-github-app/ApiKeyStep.tsx", "../src/commands/install-github-app/CheckExistingSecretStep.tsx", "../src/commands/install-github-app/CheckGitHubStep.tsx", "../src/commands/install-github-app/ChooseRepoStep.tsx", "../src/commands/install-github-app/CreatingStep.tsx", "../src/commands/install-github-app/ErrorStep.tsx", "../src/commands/install-github-app/ExistingWorkflowStep.tsx", "../src/commands/install-github-app/InstallAppStep.tsx", "../src/commands/install-github-app/OAuthFlowStep.tsx", "../src/commands/install-github-app/SuccessStep.tsx", "../src/commands/install-github-app/setupGitHubActions.ts", "../src/commands/install-github-app/WarningsStep.tsx", "../src/commands/install-github-app/install-github-app.tsx", "../src/commands/install-github-app/index.ts", "../src/commands/install-slack-app/install-slack-app.ts", "../src/commands/install-slack-app/index.ts", "../src/commands/break-cache/index.js", "../src/components/mcp/MCPAgentServerMenu.tsx", "../src/components/mcp/MCPListPanel.tsx", "../src/services/mcp/channelAllowlist.ts", "../src/services/mcp/channelNotification.ts", "../src/services/mcp/channelPermissions.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/services/skillSearch/localSearch.js", "../src/services/mcp/useManageMCPConnections.ts", "../src/services/mcp/MCPConnectionManager.tsx", "../src/components/mcp/MCPReconnect.tsx", "../src/components/mcp/CapabilitiesSection.tsx", "../src/components/mcp/utils/reconnectHelpers.tsx", "../src/components/mcp/MCPRemoteServerMenu.tsx", "../src/components/mcp/MCPStdioServerMenu.tsx", "../src/components/mcp/MCPToolDetailView.tsx", "../src/components/mcp/MCPToolListView.tsx", "../src/components/mcp/MCPSettings.tsx", "../src/components/mcp/index.ts", "../src/utils/plugins/pluginStartupCheck.ts", "../src/utils/plugins/parseMarketplaceInput.ts", "../src/commands/plugin/AddMarketplace.tsx", "../src/utils/plugins/installCounts.ts", "../src/commands/plugin/PluginOptionsDialog.tsx", "../src/commands/plugin/PluginOptionsFlow.tsx", "../src/commands/plugin/PluginTrustWarning.tsx", "../src/commands/plugin/pluginDetailsHelpers.tsx", "../src/commands/plugin/usePagination.ts", "../src/commands/plugin/BrowseMarketplace.tsx", "../src/commands/plugin/DiscoverPlugins.tsx", "../src/services/plugins/pluginOperations.ts", "../src/utils/plugins/pluginAutoupdate.ts", "../src/commands/plugin/ManageMarketplaces.tsx", "../src/utils/plugins/pluginFlagging.ts", "../src/commands/plugin/PluginErrors.tsx", "../src/commands/plugin/UnifiedInstalledCell.tsx", "../src/commands/plugin/ManagePlugins.tsx", "../src/commands/plugin/parseArgs.ts", "../src/utils/plugins/validatePlugin.ts", "../src/commands/plugin/ValidatePlugin.tsx", "../src/commands/plugin/PluginSettings.tsx", "../src/commands/mcp/mcp.tsx", "../src/commands/mcp/index.ts", "../node_modules/qrcode/lib/can-promise.js", "../node_modules/qrcode/lib/core/utils.js", "../node_modules/qrcode/lib/core/error-correction-level.js", "../node_modules/qrcode/lib/core/bit-buffer.js", "../node_modules/qrcode/lib/core/bit-matrix.js", "../node_modules/qrcode/lib/core/alignment-pattern.js", "../node_modules/qrcode/lib/core/finder-pattern.js", "../node_modules/qrcode/lib/core/mask-pattern.js", "../node_modules/qrcode/lib/core/error-correction-code.js", "../node_modules/qrcode/lib/core/galois-field.js", "../node_modules/qrcode/lib/core/polynomial.js", "../node_modules/qrcode/lib/core/reed-solomon-encoder.js", "../node_modules/qrcode/lib/core/version-check.js", "../node_modules/qrcode/lib/core/regex.js", "../node_modules/qrcode/lib/core/mode.js", "../node_modules/qrcode/lib/core/version.js", "../node_modules/qrcode/lib/core/format-info.js", "../node_modules/qrcode/lib/core/numeric-data.js", "../node_modules/qrcode/lib/core/alphanumeric-data.js", "../node_modules/qrcode/lib/core/byte-data.js", "../node_modules/qrcode/lib/core/kanji-data.js", "../node_modules/dijkstrajs/dijkstra.js", "../node_modules/qrcode/lib/core/segments.js", "../node_modules/qrcode/lib/core/qrcode.js", "../node_modules/pngjs/lib/chunkstream.js", "../node_modules/pngjs/lib/interlace.js", "../node_modules/pngjs/lib/paeth-predictor.js", "../node_modules/pngjs/lib/filter-parse.js", "../node_modules/pngjs/lib/filter-parse-async.js", "../node_modules/pngjs/lib/constants.js", "../node_modules/pngjs/lib/crc.js", "../node_modules/pngjs/lib/parser.js", "../node_modules/pngjs/lib/bitmapper.js", "../node_modules/pngjs/lib/format-normaliser.js", "../node_modules/pngjs/lib/parser-async.js", "../node_modules/pngjs/lib/bitpacker.js", "../node_modules/pngjs/lib/filter-pack.js", "../node_modules/pngjs/lib/packer.js", "../node_modules/pngjs/lib/packer-async.js", "../node_modules/pngjs/lib/sync-inflate.js", "../node_modules/pngjs/lib/sync-reader.js", "../node_modules/pngjs/lib/filter-parse-sync.js", "../node_modules/pngjs/lib/parser-sync.js", "../node_modules/pngjs/lib/packer-sync.js", "../node_modules/pngjs/lib/png-sync.js", "../node_modules/pngjs/lib/png.js", "../node_modules/qrcode/lib/renderer/utils.js", "../node_modules/qrcode/lib/renderer/png.js", "../node_modules/qrcode/lib/renderer/utf8.js", "../node_modules/qrcode/lib/renderer/terminal/terminal.js", "../node_modules/qrcode/lib/renderer/terminal/terminal-small.js", "../node_modules/qrcode/lib/renderer/terminal.js", "../node_modules/qrcode/lib/renderer/svg-tag.js", "../node_modules/qrcode/lib/renderer/svg.js", "../node_modules/qrcode/lib/renderer/canvas.js", "../node_modules/qrcode/lib/browser.js", "../node_modules/qrcode/lib/server.js", "../src/commands/mobile/mobile.tsx", "../src/commands/mobile/index.ts", "../src/commands/onboarding/index.js", "../src/commands/createMovedToPluginCommand.ts", "../src/commands/pr_comments/index.ts", "../src/utils/releaseNotes.ts", "../src/commands/release-notes/release-notes.ts", "../src/commands/release-notes/index.ts", "../src/utils/sessionTitle.ts", "../src/commands/rename/generateSessionName.ts", "../src/bridge/debugUtils.ts", "../src/bridge/createSession.ts", "../src/commands/rename/rename.ts", "../src/commands/rename/index.ts", "../src/utils/getWorktreePaths.ts", "../src/utils/set.ts", "../src/utils/collapseBackgroundBashNotifications.ts", "../src/utils/collapseHookSummaries.ts", "../src/utils/collapseTeammateShutdowns.ts", "../src/utils/groupToolUses.ts", "../src/utils/transcriptSearch.ts", "../src/utils/logoV2Utils.ts", "../src/components/LogoV2/Clawd.tsx", "../src/components/LogoV2/Feed.tsx", "../src/components/LogoV2/FeedColumn.tsx", "../src/services/api/referral.ts", "../src/components/LogoV2/feedConfigs.tsx", "../src/components/LogoV2/AnimatedClawd.tsx", "../src/components/LogoV2/GuestPassesUpsell.tsx", "../src/components/LogoV2/CondensedLogo.tsx", "../src/components/LogoV2/EmergencyTip.tsx", "../src/components/LogoV2/AnimatedAsterisk.tsx", "../src/components/LogoV2/Opus1mMergeNotice.tsx", "../src/components/LogoV2/VoiceModeNotice.tsx", "../src/components/LogoV2/ChannelsNotice.tsx", "../src/components/LogoV2/LogoV2.tsx", "../src/components/MessageModel.tsx", "../src/components/MessageTimestamp.tsx", "../src/components/MessageRow.tsx", "../src/components/messages/nullRenderingAttachments.ts", "../src/utils/statusNoticeDefinitions.tsx", "../src/components/StatusNotices.tsx", "../src/hooks/useVirtualScroll.ts", "../src/context/promptOverlayContext.tsx", "../src/components/FullscreenLayout.tsx", "../src/components/VirtualMessageList.tsx", "../src/components/Messages.tsx", "../src/components/SessionPreview.tsx", "../src/components/TagTabs.tsx", "../src/components/ui/TreeSelect.tsx", "../src/components/LogSelector.tsx", "../src/utils/agenticSessionSearch.ts", "../src/utils/crossProjectResume.ts", "../src/commands/resume/resume.tsx", "../src/commands/resume/index.ts", "../src/commands/review/ultrareviewEnabled.ts", "../src/services/api/ultrareviewQuota.ts", "../src/commands/review/reviewRemote.ts", "../src/commands/review/UltrareviewOverageDialog.tsx", "../src/commands/review/ultrareviewCommand.tsx", "../src/commands/review.ts", "../src/commands/session/session.tsx", "../src/commands/session/index.ts", "../src/commands/share/index.js", "../src/components/skills/SkillsMenu.tsx", "../src/commands/skills/skills.tsx", "../src/commands/skills/index.ts", "../src/commands/status/status.tsx", "../src/commands/status/index.ts", "../src/state/teammateViewHelpers.ts", "../src/bridge/types.ts", "../src/utils/ultraplan/ccrSession.ts", "stub-txt:../utils/ultraplan/prompt.txt", "../src/commands/ultraplan.tsx", "../src/components/tasks/renderToolActivity.tsx", "../src/components/tasks/taskStatusUtils.tsx", "../src/components/tasks/AsyncAgentDetailDialog.tsx", "../src/components/tasks/RemoteSessionProgress.tsx", "../src/components/tasks/ShellProgress.tsx", "../src/components/tasks/BackgroundTask.tsx", "../src/components/tasks/DreamDetailDialog.tsx", "../src/components/tasks/InProcessTeammateDetailDialog.tsx", "../src/utils/messages/mappers.ts", "../src/components/tasks/RemoteSessionDetailDialog.tsx", "../src/components/tasks/ShellDetailDialog.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/tasks/WorkflowDetailDialog.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/tasks/MonitorMcpDetailDialog.js", "../src/components/tasks/BackgroundTasksDialog.tsx", "../src/commands/tasks/tasks.tsx", "../src/commands/tasks/index.ts", "../src/commands/teleport/index.js", "../src/commands/security-review.ts", "../src/commands/bughunter/index.js", "../src/commands/terminalSetup/index.ts", "../src/commands/usage/usage.tsx", "../src/commands/usage/index.ts", "../src/commands/theme/theme.tsx", "../src/commands/theme/index.ts", "../src/commands/vim/vim.ts", "../src/commands/vim/index.ts", "../src/commands/thinkback/thinkback.tsx", "../src/commands/thinkback/index.ts", "../src/commands/thinkback-play/thinkback-play.ts", "../src/commands/thinkback-play/index.ts", "../src/utils/autoModeDenials.ts", "../src/components/permissions/rules/PermissionRuleDescription.tsx", "../src/components/permissions/rules/AddPermissionRules.tsx", "../src/components/permissions/rules/PermissionRuleInput.tsx", "../src/components/permissions/rules/RecentDenialsTab.tsx", "../src/components/permissions/rules/RemoveWorkspaceDirectory.tsx", "../src/components/permissions/rules/WorkspaceTab.tsx", "../src/components/permissions/rules/PermissionRuleList.tsx", "../src/commands/permissions/permissions.tsx", "../src/commands/permissions/index.ts", "../src/commands/plan/plan.tsx", "../src/commands/plan/index.ts", "../src/utils/immediateCommand.ts", "../src/components/FastIcon.tsx", "../src/commands/fast/fast.tsx", "../src/commands/fast/index.ts", "../src/components/Passes/Passes.tsx", "../src/commands/passes/passes.tsx", "../src/commands/passes/index.ts", "../src/components/grove/Grove.tsx", "../src/commands/privacy-settings/privacy-settings.tsx", "../src/commands/privacy-settings/index.ts", "../src/utils/hooks/hooksConfigManager.ts", "../src/components/hooks/SelectEventMode.tsx", "../src/components/hooks/SelectHookMode.tsx", "../src/components/hooks/SelectMatcherMode.tsx", "../src/components/hooks/ViewHookMode.tsx", "../src/components/hooks/HooksConfigMenu.tsx", "../src/commands/hooks/hooks.tsx", "../src/commands/hooks/index.ts", "../src/commands/files/files.ts", "../src/commands/files/index.ts", "../src/commands/branch/branch.ts", "../src/commands/branch/index.ts", "../src/utils/toolPool.ts", "../src/hooks/useMergedTools.ts", "../src/tools/AgentTool/agentDisplay.ts", "../src/components/agents/types.ts", "../src/components/agents/agentFileUtils.ts", "../src/components/agents/AgentDetail.tsx", "../src/components/agents/ColorPicker.tsx", "../src/components/agents/ModelSelector.tsx", "../src/components/agents/ToolSelector.tsx", "../src/components/agents/utils.ts", "../src/components/agents/AgentEditor.tsx", "../src/components/agents/AgentNavigationFooter.tsx", "../src/components/agents/AgentsList.tsx", "../src/components/wizard/WizardProvider.tsx", "../src/components/wizard/useWizard.ts", "../src/components/wizard/WizardNavigationFooter.tsx", "../src/components/wizard/WizardDialogLayout.tsx", "../src/components/wizard/index.ts", "../src/components/agents/new-agent-creation/wizard-steps/ColorStep.tsx", "../src/components/agents/validateAgent.ts", "../src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.tsx", "../src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsx", "../src/components/agents/generateAgent.ts", "../src/components/agents/new-agent-creation/wizard-steps/GenerateStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/LocationStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/MethodStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/ModelStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/PromptStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsx", "../src/components/agents/new-agent-creation/wizard-steps/TypeStep.tsx", "../src/components/agents/new-agent-creation/CreateAgentWizard.tsx", "../src/components/agents/AgentsMenu.tsx", "../src/commands/agents/agents.tsx", "../src/commands/agents/index.ts", "../src/commands/plugin/plugin.tsx", "../src/commands/plugin/index.tsx", "../src/services/settingsSync/types.ts", "../src/services/settingsSync/index.ts", "../src/utils/plugins/refresh.ts", "../src/commands/reload-plugins/reload-plugins.ts", "../src/commands/reload-plugins/index.ts", "../src/commands/rewind/rewind.ts", "../src/commands/rewind/index.ts", "../src/utils/heapDumpService.ts", "../src/commands/heapdump/heapdump.ts", "../src/commands/heapdump/index.ts", "../src/commands/mock-limits/index.js", "../src/bridge/bridgeApi.ts", "../src/bridge/bridgeDebug.ts", "../src/commands/bridge-kick.ts", "../src/commands/version.ts", "../src/commands/summary/index.js", "../src/commands/reset-limits/index.js", "../src/commands/ant-trace/index.js", "../src/commands/perf-issue/index.js", "../src/components/sandbox/SandboxConfigTab.tsx", "../src/components/sandbox/SandboxDependenciesTab.tsx", "../src/components/sandbox/SandboxOverridesTab.tsx", "../src/components/sandbox/SandboxSettings.tsx", "../src/commands/sandbox-toggle/sandbox-toggle.tsx", "../src/commands/sandbox-toggle/index.ts", "../src/utils/claudeInChrome/setupPortable.ts", "../src/utils/claudeInChrome/setup.ts", "../src/commands/chrome/chrome.tsx", "../src/commands/chrome/index.ts", "../src/commands/stickers/stickers.ts", "../src/commands/stickers/index.ts", "../src/commands/advisor.ts", "../src/skills/bundledSkills.ts", "../src/commands/env/index.js", "../src/components/WorktreeExitDialog.tsx", "../src/components/ExitFlow.tsx", "../src/commands/exit/exit.tsx", "../src/commands/exit/index.ts", "../src/components/ExportDialog.tsx", "../src/utils/exportRenderer.tsx", "../src/commands/export/export.tsx", "../src/commands/export/index.ts", "../src/commands/model/model.tsx", "../src/commands/model/index.ts", "../src/commands/tag/tag.tsx", "../src/commands/tag/index.ts", "../src/commands/output-style/output-style.tsx", "../src/commands/output-style/index.ts", "../src/utils/teleport/environmentSelection.ts", "../src/components/RemoteEnvironmentDialog.tsx", "../src/commands/remote-env/remote-env.tsx", "../src/commands/remote-env/index.ts", "../src/commands/upgrade/upgrade.tsx", "../src/commands/upgrade/index.ts", "../src/commands/rate-limit-options/rate-limit-options.tsx", "../src/commands/rate-limit-options/index.ts", "../src/commands/statusline.tsx", "../src/commands/effort/effort.tsx", "../src/commands/effort/index.ts", "../node_modules/asciichart/asciichart.js", "../src/utils/statsCache.ts", "../src/utils/heatmap.ts", "../src/utils/ansiToSvg.ts", "../src/utils/ansiToPng.ts", "../src/utils/screenshotClipboard.ts", "../src/utils/stats.ts", "../src/components/Stats.tsx", "../src/commands/stats/stats.tsx", "../src/commands/stats/index.ts", "../src/commands/oauth-refresh/index.js", "../src/commands/debug-tool-call/index.js", "../src/types/command.ts", "../src/commands/agents-platform/index.ts", "../src/commands/proactive.ts", "../src/commands/brief.ts", "../src/commands/assistant/index.ts", "../src/bridge/envLessBridgeConfig.ts", "../src/components/RemoteCallout.tsx", "../src/assistant/index.ts", "../src/commands/bridge/bridge.tsx", "../src/commands/bridge/index.ts", "../src/commands/remoteControlServer/index.ts", "../src/services/voiceKeyterms.ts", "../src/hooks/useVoice.ts", "../src/commands/voice/voice.ts", "../src/commands/voice/index.ts", "../src/commands/force-snip.ts", "../src/commands/workflows/index.ts", "../src/utils/github/ghAuthStatus.ts", "../src/commands/remote-setup/api.ts", "../src/commands/remote-setup/remote-setup.tsx", "../src/commands/remote-setup/index.ts", "../src/commands/subscribe-pr.ts", "../src/commands/torch.ts", "../src/commands/peers/index.ts", "../src/commands/fork/index.ts", "../src/commands/buddy/index.ts", "../src/commands/insights.ts", "../src/tools/WorkflowTool/createWorkflowCommand.ts", "../src/commands.ts", "../src/utils/sessionStorage.ts", "../src/memdir/teamMemPrompts.ts", "../src/memdir/memdir.ts", "../src/tools/AgentTool/agentMemory.ts", "../src/utils/permissions/filesystem.ts", "../src/utils/task/diskOutput.ts", "../src/Task.ts", "../src/utils/ShellCommand.ts", "../src/types/hooks.ts", "../src/utils/combinedAbortSignal.ts", "../src/utils/hooks/hookHelpers.ts", "../src/utils/hooks/execPromptHook.ts", "../src/utils/hooks/execAgentHook.ts", "../src/utils/hooks/ssrfGuard.ts", "../src/utils/hooks/execHttpHook.ts", "../src/utils/hooks.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/utils/postCommitAttribution.js", "../src/utils/worktree.ts", "../src/constants/cyberRiskInstruction.ts", "../src/services/compact/cachedMCConfig.ts", "../src/tools/DiscoverSkillsTool/prompt.ts", "../src/constants/prompts.ts", "../node_modules/zod/index.js", "../src/utils/claudeInChrome/chromeNativeHost.ts", "../src/daemon/workerRegistry.ts", "../src/bridge/bridgeUI.ts", "../src/bridge/capacityWake.ts", "../src/bridge/jwtUtils.ts", "../src/bridge/pollConfigDefaults.ts", "../src/bridge/pollConfig.ts", "../src/bridge/sessionRunner.ts", "../src/bridge/workSecret.ts", "../src/bridge/bridgePointer.ts", "../src/utils/errorLogSink.ts", "../src/utils/sinks.ts", "../src/bridge/bridgeMain.ts", "../src/daemon/main.ts", "../src/cli/bg.ts", "../src/cli/handlers/templateJobs.ts", "../src/environment-runner/main.ts", "../src/self-hosted-runner/main.ts", "../node_modules/commander/lib/error.js", "../node_modules/commander/lib/argument.js", "../node_modules/commander/lib/help.js", "../node_modules/commander/lib/option.js", "../node_modules/commander/lib/suggestSimilar.js", "../node_modules/commander/lib/command.js", "../node_modules/commander/index.js", "../node_modules/@commander-js/extra-typings/index.js", "../node_modules/@commander-js/extra-typings/esm.mjs", "../src/utils/apiPreconnect.ts", "../src/utils/caCertsConfig.ts", "../src/utils/managedEnv.ts", "../src/upstreamproxy/relay.ts", "../src/upstreamproxy/upstreamproxy.ts", "../src/components/InvalidConfigDialog.tsx", "../src/entrypoints/init.ts", "../src/context/fpsMetrics.tsx", "../src/context/stats.tsx", "../src/utils/sessionState.ts", "../src/state/onChangeAppState.ts", "../src/components/App.tsx", "../src/ink/hooks/use-search-highlight.ts", "../src/components/CostThresholdDialog.tsx", "../src/components/IdleReturnDialog.tsx", "../src/services/preventSleep.ts", "../src/utils/QueryGuard.ts", "../src/components/permissions/WorkerBadge.tsx", "../src/components/permissions/WorkerPendingPermission.tsx", "../src/hooks/useLogMessages.ts", "../src/bridge/bridgePermissionCallbacks.ts", "../src/bridge/inboundMessages.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/utils/udsMessaging.js", "../src/utils/messages/systemInit.ts", "../src/utils/controlMessageCompat.ts", "../src/bridge/bridgeMessaging.ts", "../src/cli/transports/SerialBatchEventUploader.ts", "../src/cli/transports/WebSocketTransport.ts", "../src/cli/transports/HybridTransport.ts", "../src/cli/transports/WorkerStateUploader.ts", "../src/cli/transports/ccrClient.ts", "../src/cli/transports/SSETransport.ts", "../src/bridge/replBridgeTransport.ts", "../src/bridge/flushGate.ts", "../src/bridge/replBridge.ts", "../src/bridge/codeSessionApi.ts", "../src/bridge/remoteBridgeCore.ts", "../src/bridge/initReplBridge.ts", "../src/bridge/inboundAttachments.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/bridge/webhookSanitizer.js", "../src/hooks/useReplBridge.tsx", "../src/components/MessageSelector.tsx", "../src/hooks/useIdeLogging.ts", "../src/hooks/useNotifyAfterTimeout.ts", "../src/components/permissions/AskUserQuestionPermissionRequest/PreviewBox.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/QuestionNavigationBar.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/PreviewQuestionView.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/QuestionView.tsx", "../src/components/permissions/PermissionRuleExplanation.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/SubmitQuestionsView.tsx", "../src/components/permissions/AskUserQuestionPermissionRequest/use-multiple-choice-state.ts", "../src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx", "../src/tools/BashTool/destructiveCommandWarning.ts", "../src/utils/shell/specPrefix.ts", "../src/utils/bash/specs/alias.ts", "../src/utils/bash/specs/nohup.ts", "../src/utils/bash/specs/pyright.ts", "../src/utils/bash/specs/sleep.ts", "../src/utils/bash/specs/srun.ts", "../src/utils/bash/specs/time.ts", "../src/utils/bash/specs/timeout.ts", "../src/utils/bash/specs/index.ts", "../src/utils/bash/registry.ts", "../src/utils/bash/prefix.ts", "../src/utils/unaryLogging.ts", "../src/components/permissions/hooks.ts", "../src/components/permissions/PermissionDecisionDebugInfo.tsx", "../src/utils/permissions/permissionExplainer.ts", "../src/components/permissions/PermissionExplanation.tsx", "../src/components/FileEditToolDiff.tsx", "../src/hooks/useDiffInIDE.ts", "../src/components/ShowInIDEPrompt.tsx", "../src/components/permissions/FilePermissionDialog/permissionOptions.tsx", "../src/components/permissions/FilePermissionDialog/usePermissionHandler.ts", "../src/components/permissions/FilePermissionDialog/useFilePermissionDialog.ts", "../src/components/permissions/FilePermissionDialog/FilePermissionDialog.tsx", "../src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx", "../src/components/permissions/utils.ts", "../src/components/permissions/useShellPermissionFeedback.ts", "../src/components/permissions/shellPermissionHelpers.tsx", "../src/components/permissions/BashPermissionRequest/bashToolUseOptions.tsx", "../src/components/permissions/BashPermissionRequest/BashPermissionRequest.tsx", "../src/components/permissions/EnterPlanModePermissionRequest/EnterPlanModePermissionRequest.tsx", "../src/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.tsx", "../src/components/permissions/PermissionPrompt.tsx", "../src/components/permissions/FallbackPermissionRequest.tsx", "../src/components/permissions/FilePermissionDialog/ideDiffConfig.ts", "../src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx", "../src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.tsx", "../src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx", "../src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx", "../src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx", "../src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.tsx", "../src/tools/PowerShellTool/destructiveCommandWarning.ts", "../src/utils/powershell/staticPrefix.ts", "../src/components/permissions/PowerShellPermissionRequest/powershellToolUseOptions.tsx", "../src/components/permissions/PowerShellPermissionRequest/PowerShellPermissionRequest.tsx", "../src/components/permissions/SkillPermissionRequest/SkillPermissionRequest.tsx", "../src/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/tools/ReviewArtifactTool/ReviewArtifactTool.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/permissions/ReviewArtifactPermissionRequest/ReviewArtifactPermissionRequest.js", "../src/tools/WorkflowTool/WorkflowPermissionRequest.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/components/permissions/MonitorPermissionRequest/MonitorPermissionRequest.js", "../src/components/permissions/PermissionRequest.tsx", "../src/utils/mcp/dateTimeParser.ts", "../src/utils/mcp/elicitationValidation.ts", "../src/components/mcp/ElicitationDialog.tsx", "../src/components/hooks/PromptDialog.tsx", "../src/hooks/useCommandQueue.ts", "../src/hooks/useIdeAtMentioned.ts", "../src/buddy/sprites.ts", "../src/buddy/CompanionSprite.tsx", "../src/buddy/useBuddyNotification.tsx", "../src/hooks/useIdeConnectionStatus.ts", "../src/hooks/useVoiceEnabled.ts", "../src/hooks/useUpdateNotification.ts", "../src/components/AutoUpdater.tsx", "../src/components/NativeAutoUpdater.tsx", "../src/components/PackageManagerAutoUpdater.tsx", "../src/components/AutoUpdaterWrapper.tsx", "../src/components/IdeStatusIndicator.tsx", "../src/hooks/useMemoryUsage.ts", "../src/components/MemoryUsageIndicator.tsx", "../src/services/compact/compactWarningHook.ts", "../src/components/TokenWarning.tsx", "../src/components/PromptInput/SandboxPromptFooterHint.tsx", "../src/components/PromptInput/VoiceIndicator.tsx", "../src/components/PromptInput/Notifications.tsx", "../src/hooks/useArrowKeyHistory.tsx", "../src/hooks/useHistorySearch.ts", "../src/hooks/useInputBuffer.ts", "../src/hooks/usePromptSuggestion.ts", "../src/utils/bash/shellCompletion.ts", "../node_modules/fuse.js/dist/fuse.mjs", "../src/utils/suggestions/commandSuggestions.ts", "../src/utils/suggestions/shellHistoryCompletion.ts", "../src/utils/suggestions/slackChannelSuggestions.ts", "../src/hooks/unifiedSuggestions.ts", "../src/hooks/useTypeahead.tsx", "../src/utils/directMemberMessage.ts", "../src/utils/keyboardShortcuts.ts", "../src/utils/permissions/getNextPermissionMode.ts", "../src/utils/ultraplan/keyword.ts", "../src/components/AutoModeOptInDialog.tsx", "../src/components/BridgeDialog.tsx", "../src/components/CoordinatorAgentStatus.tsx", "../src/utils/highlightMatch.tsx", "../src/components/design-system/FuzzyPicker.tsx", "../src/components/GlobalSearchDialog.tsx", "../src/components/HistorySearchDialog.tsx", "../src/components/QuickOpenDialog.tsx", "../src/components/ThinkingToggle.tsx", "../src/utils/teamDiscovery.ts", "../src/components/teams/TeamsDialog.tsx", "../src/vim/motions.ts", "../src/vim/textObjects.ts", "../src/vim/operators.ts", "../src/vim/types.ts", "../src/vim/transitions.ts", "../src/hooks/useVimInput.ts", "../src/components/VimTextInput.tsx", "../src/components/StatusLine.tsx", "../src/utils/horizontalScroll.ts", "../src/components/tasks/BackgroundTaskStatus.tsx", "../src/components/teams/TeamStatus.tsx", "../src/components/PromptInput/HistorySearchInput.tsx", "../src/utils/ghPrStatus.ts", "../src/hooks/usePrStatus.ts", "../src/components/PromptInput/PromptInputFooterLeftSide.tsx", "../src/components/PromptInput/PromptInputFooter.tsx", "../src/components/PromptInput/PromptInputModeIndicator.tsx", "../src/components/PromptInput/PromptInputQueuedCommands.tsx", "../src/components/PromptInput/PromptInputStashNotice.tsx", "../src/components/PromptInput/inputPaste.ts", "../src/components/PromptInput/useMaybeTruncateInput.ts", "../src/utils/exampleCommands.ts", "../src/components/PromptInput/usePromptInputPlaceholder.ts", "../src/components/PromptInput/useShowFastIconHint.ts", "../src/utils/standaloneAgent.ts", "../src/components/PromptInput/useSwarmBanner.ts", "../src/components/PromptInput/PromptInput.tsx", "../src/remote/SessionsWebSocket.ts", "../src/remote/RemoteSessionManager.ts", "../src/remote/remotePermissionBridge.ts", "../src/remote/sdkMessageAdapter.ts", "../src/hooks/useRemoteSession.ts", "../src/server/directConnectManager.ts", "../src/hooks/useDirectConnect.ts", "../src/hooks/useSSHSession.ts", "../src/assistant/sessionHistory.ts", "../src/hooks/useAssistantHistory.ts", "../src/components/FeedbackSurvey/useDebouncedDigitInput.ts", "../src/components/FeedbackSurvey/FeedbackSurveyView.tsx", "../src/components/SkillImprovementSurvey.tsx", "../src/utils/hooks/apiQueryHookHelper.ts", "../src/utils/hooks/skillImprovement.ts", "../src/hooks/useSkillImprovementSurvey.ts", "../src/moreright/useMoreRight.tsx", "../node_modules/minipass/dist/commonjs/index.js", "../node_modules/minipass-collect/index.js", "../node_modules/minipass-pipeline/node_modules/minipass/index.js", "../node_modules/minipass-pipeline/index.js", "../node_modules/ssri/lib/index.js", "../node_modules/imurmurhash/imurmurhash.js", "../node_modules/unique-slug/lib/index.js", "../node_modules/unique-filename/lib/index.js", "../node_modules/cacache/lib/util/hash-to-segments.js", "../node_modules/cacache/lib/content/path.js", "../node_modules/@npmcli/fs/lib/common/get-options.js", "../node_modules/@npmcli/fs/lib/common/node.js", "../node_modules/@npmcli/fs/lib/cp/errors.js", "../node_modules/@npmcli/fs/lib/cp/polyfill.js", "../node_modules/@npmcli/fs/lib/cp/index.js", "../node_modules/@npmcli/fs/lib/with-temp-dir.js", "../node_modules/@npmcli/fs/lib/readdir-scoped.js", "../node_modules/@npmcli/fs/lib/move-file.js", "../node_modules/@npmcli/fs/lib/index.js", "../node_modules/cacache/lib/entry-index.js", "../node_modules/cacache/node_modules/lru-cache/dist/commonjs/index.js", "../node_modules/cacache/lib/memoization.js", "../node_modules/fs-minipass/lib/index.js", "../node_modules/cacache/lib/content/read.js", "../node_modules/cacache/lib/get.js", "../node_modules/minipass-flush/node_modules/minipass/index.js", "../node_modules/minipass-flush/index.js", "../node_modules/cacache/lib/content/write.js", "../node_modules/cacache/lib/put.js", "../node_modules/balanced-match/index.js", "../node_modules/brace-expansion/index.js", "../node_modules/minimatch/dist/commonjs/assert-valid-pattern.js", "../node_modules/minimatch/dist/commonjs/brace-expressions.js", "../node_modules/minimatch/dist/commonjs/unescape.js", "../node_modules/minimatch/dist/commonjs/ast.js", "../node_modules/minimatch/dist/commonjs/escape.js", "../node_modules/minimatch/dist/commonjs/index.js", "../node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js", "../node_modules/path-scurry/dist/commonjs/index.js", "../node_modules/glob/dist/commonjs/pattern.js", "../node_modules/glob/dist/commonjs/ignore.js", "../node_modules/glob/dist/commonjs/processor.js", "../node_modules/glob/dist/commonjs/walker.js", "../node_modules/glob/dist/commonjs/glob.js", "../node_modules/glob/dist/commonjs/has-magic.js", "../node_modules/glob/dist/commonjs/index.js", "../node_modules/cacache/lib/util/glob.js", "../node_modules/cacache/lib/content/rm.js", "../node_modules/cacache/lib/rm.js", "../node_modules/cacache/lib/verify.js", "../node_modules/cacache/lib/util/tmp.js", "../node_modules/cacache/lib/index.js", "../src/utils/cleanup.ts", "../src/utils/deepLink/parseDeepLink.ts", "../src/utils/deepLink/registerProtocol.ts", "../src/utils/backgroundHousekeeping.ts", "../src/costHook.ts", "../src/hooks/useAfterFirstRender.ts", "../src/hooks/useDeferredHookMessages.ts", "../src/hooks/useApiKeyVerification.ts", "../src/utils/terminalPanel.ts", "../src/hooks/useGlobalKeybindings.tsx", "../src/hooks/useCommandKeybindings.tsx", "../src/hooks/useCancelRequest.ts", "../src/hooks/useBackgroundTaskNavigation.ts", "../src/utils/swarm/reconnection.ts", "../src/utils/swarm/teammateInit.ts", "../src/hooks/useSwarmInitialization.ts", "../src/hooks/useTeammateViewAutoExit.ts", "../src/hooks/toolPermission/handlers/coordinatorHandler.ts", "../src/hooks/toolPermission/PermissionContext.ts", "../src/hooks/toolPermission/handlers/interactiveHandler.ts", "../src/hooks/toolPermission/handlers/swarmWorkerHandler.ts", "../src/hooks/useCanUseTool.tsx", "../src/utils/userPromptKeywords.ts", "../src/utils/processUserInput/processTextPrompt.ts", "../src/components/BashModeProgress.tsx", "../src/utils/shell/resolveDefaultShell.ts", "../src/utils/processUserInput/processBashCommand.tsx", "../src/utils/processUserInput/processUserInput.ts", "../src/utils/handlePromptSubmit.ts", "../src/utils/queueProcessor.ts", "../src/hooks/useQueueProcessor.ts", "../src/hooks/useMailboxBridge.ts", "../src/hooks/useMergedClients.ts", "../src/hooks/useMergedCommands.ts", "../src/utils/skills/skillChangeDetector.ts", "../src/hooks/useSkillsChange.ts", "../src/utils/plugins/pluginBlocklist.ts", "../src/hooks/useManagePlugins.ts", "../src/components/TeammateViewHeader.tsx", "../src/hooks/useIdeSelection.ts", "../src/utils/asciicast.ts", "../src/services/contextCollapse/persist.ts", "../src/utils/sessionRestore.ts", "../src/hooks/useInboxPoller.ts", "../src/hooks/useTaskListWatcher.ts", "../src/hooks/useIDEIntegration.tsx", "../src/components/SessionBackgroundHint.tsx", "../src/hooks/useSessionBackgrounding.ts", "../src/components/EffortCallout.tsx", "../src/hooks/useDynamicConfig.ts", "../src/components/FeedbackSurvey/submitTranscriptShare.ts", "../src/components/FeedbackSurvey/useSurveyState.tsx", "../src/components/FeedbackSurvey/useFeedbackSurvey.tsx", "../src/components/FeedbackSurvey/useMemorySurvey.tsx", "../src/components/FeedbackSurvey/usePostCompactSurvey.tsx", "../src/components/FeedbackSurvey/TranscriptSharePrompt.tsx", "../src/components/FeedbackSurvey/FeedbackSurvey.tsx", "../src/hooks/notifs/useStartupNotification.ts", "../src/hooks/notifs/useInstallMessages.tsx", "../src/services/awaySummary.ts", "../src/hooks/useAwaySummary.ts", "../src/hooks/useChromeExtensionNotification.tsx", "../src/utils/plugins/officialMarketplaceStartupCheck.ts", "../src/hooks/useOfficialMarketplaceNotification.tsx", "../src/hooks/usePromptsFromClaudeInChrome.tsx", "../src/services/tips/tipHistory.ts", "../src/components/DesktopUpsell/DesktopUpsellStartup.tsx", "../src/services/tips/tipRegistry.ts", "../src/services/tips/tipScheduler.ts", "../src/entrypoints/sdk/controlSchemas.ts", "../src/utils/permissions/PermissionPromptToolResultSchema.ts", "../src/cli/ndjsonSafeStringify.ts", "../src/cli/structuredIO.ts", "../src/hooks/useFileHistorySnapshotInit.ts", "../src/components/permissions/SandboxPermissionRequest.tsx", "../src/components/SandboxViolationExpandedView.tsx", "../src/hooks/notifs/useMcpConnectivityStatus.tsx", "../src/hooks/notifs/useAutoModeUnavailableNotification.ts", "../src/hooks/notifs/useLspInitializationNotification.tsx", "../src/utils/binaryCheck.ts", "../src/utils/plugins/lspRecommendation.ts", "../src/hooks/usePluginRecommendationBase.tsx", "../src/hooks/useLspPluginRecommendation.tsx", "../src/components/LspRecommendation/LspRecommendationMenu.tsx", "../src/hooks/useClaudeCodeHintRecommendation.tsx", "../src/components/ClaudeCodeHint/PluginHintMenu.tsx", "../src/hooks/notifs/usePluginInstallationStatus.tsx", "../src/hooks/notifs/usePluginAutoupdateNotification.tsx", "../src/utils/plugins/reconciler.ts", "../src/services/plugins/PluginInstallationManager.ts", "../src/utils/plugins/performStartupChecks.tsx", "../src/components/AwsAuthStatusBox.tsx", "../src/hooks/notifs/useRateLimitWarningNotification.tsx", "../src/utils/model/deprecation.ts", "../src/hooks/notifs/useDeprecationWarningNotification.tsx", "../src/hooks/notifs/useNpmDeprecationNotification.tsx", "../src/hooks/notifs/useIDEStatusIndicator.tsx", "../src/hooks/notifs/useModelMigrationNotifications.tsx", "../src/hooks/notifs/useCanSwitchToExistingSubscription.tsx", "../src/hooks/notifs/useTeammateShutdownNotification.ts", "../src/hooks/notifs/useFastModeNotification.tsx", "../src/utils/autoRunIssue.tsx", "../src/components/PromptInput/IssueFlagBanner.tsx", "../src/hooks/useIssueFlagBanner.ts", "../src/components/DevBar.tsx", "../src/ink/components/AlternateScreen.tsx", "../src/hooks/useCopyOnSelect.ts", "../src/components/ScrollKeybindingHandler.tsx", "../src/hooks/useVoiceIntegration.tsx", "../src/proactive/useProactive.ts", "../src/utils/cronJitterConfig.ts", "../src/utils/cronTasksLock.ts", "../src/utils/cronScheduler.ts", "../src/hooks/useScheduledTasks.ts", "../src/tools/WebBrowserTool/WebBrowserPanel.ts", "../src/screens/REPL.tsx", "../src/replLauncher.tsx", "../src/services/api/bootstrap.ts", "../src/utils/warningHandler.ts", "../src/components/MCPServerDialogCopy.tsx", "../src/components/MCPServerApprovalDialog.tsx", "../src/components/MCPServerMultiselectDialog.tsx", "../src/services/mcpServerApproval.tsx", "../src/utils/deepLink/terminalPreference.ts", "../src/utils/fpsTracker.ts", "../src/utils/githubRepoPathMapping.ts", "../src/hooks/useTimeout.ts", "../src/utils/preflightChecks.tsx", "../src/components/ApproveApiKey.tsx", "../src/components/LogoV2/WelcomeV2.tsx", "../src/components/ui/OrderedListItem.tsx", "../src/components/ui/OrderedList.tsx", "../src/components/Onboarding.tsx", "../src/components/TrustDialog/utils.ts", "../src/components/TrustDialog/TrustDialog.tsx", "../src/components/BypassPermissionsModeDialog.tsx", "../src/components/DevChannelsDialog.tsx", "../src/components/ClaudeInChromeOnboarding.tsx", "../src/interactiveHelpers.tsx", "../src/components/agents/SnapshotUpdateDialog.ts", "../src/components/InvalidSettingsDialog.tsx", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/assistant/AssistantSessionChooser.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/commands/assistant/assistant.js", "../src/hooks/useTeleportResume.tsx", "../src/components/ResumeTask.tsx", "../src/components/TeleportResumeWrapper.tsx", "../src/components/TeleportRepoMismatchDialog.tsx", "../src/screens/ResumeConversation.tsx", "../src/dialogLaunchers.tsx", "../src/plugins/bundled/index.ts", "../src/services/plugins/pluginCliCommands.ts", "../src/skills/bundled/batch.ts", "../src/skills/bundled/claudeInChrome.ts", "../src/skills/bundled/debug.ts", "../src/keybindings/schema.ts", "../src/skills/bundled/keybindings.ts", "../src/skills/bundled/loremIpsum.ts", "../src/skills/bundled/remember.ts", "../src/skills/bundled/simplify.ts", "../src/skills/bundled/skillify.ts", "../src/skills/bundled/stuck.ts", "../src/skills/bundled/updateConfig.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/verify/examples/cli.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/verify/examples/server.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/verify/SKILL.md", "../src/skills/bundled/verifyContent.ts", "../src/skills/bundled/verify.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/dream.js", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/hunter.js", "../src/skills/bundled/loop.ts", "../src/skills/bundled/scheduleRemoteAgents.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/csharp/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/curl/examples.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/go/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/java/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/php/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/agent-sdk/patterns.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/agent-sdk/README.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/batches.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/files-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/README.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/streaming.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/python/claude-api/tool-use.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/ruby/claude-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/SKILL.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/error-codes.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/live-sources.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/models.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/prompt-caching.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/shared/tool-use-concepts.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/agent-sdk/patterns.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/agent-sdk/README.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/batches.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/files-api.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/README.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/streaming.md", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/claude-api/typescript/claude-api/tool-use.md", "../src/skills/bundled/claudeApiContent.ts", "../src/skills/bundled/claudeApi.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/skills/bundled/runSkillGenerator.js", "../src/skills/bundled/index.ts", "../src/utils/deepLink/banner.ts", "../src/utils/telemetry/skillLoadedEvent.ts", "../src/cli/exit.ts", "../src/commands/mcp/addCommand.ts", "../src/commands/mcp/xaaIdpCommand.ts", "../src/utils/cliArgs.ts", "../src/migrations/migrateAutoUpdatesToSettings.ts", "../src/migrations/migrateBypassPermissionsAcceptedToSettings.ts", "../src/migrations/migrateEnableAllProjectMcpServersToSettings.ts", "../src/migrations/migrateFennecToOpus.ts", "../src/migrations/migrateLegacyOpusToCurrent.ts", "../src/migrations/migrateOpusToOpus1m.ts", "../src/migrations/migrateReplBridgeEnabledToRemoteControlAtStartup.ts", "../src/migrations/migrateSonnet1mToSonnet45.ts", "../src/migrations/migrateSonnet45ToSonnet46.ts", "../src/migrations/resetAutoModeOptInForDefaultOffer.ts", "../src/migrations/resetProToOpusDefault.ts", "../src/server/types.ts", "../src/server/createDirectConnectSession.ts", "../src/assistant/gate.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/server/parseConnectUrl.js", "../src/utils/deepLink/terminalLauncher.ts", "../src/utils/deepLink/protocolHandler.ts", "../src/utils/computerUse/setup.ts", "../src/services/SessionMemory/sessionMemory.ts", "../src/utils/iTermBackup.ts", "../src/setup.ts", "../src/cli/transports/transportUtils.ts", "../src/cli/remoteIO.ts", "../src/utils/streamlinedTransform.ts", "../src/utils/streamJsonStdoutGuard.ts", "../src/utils/queryContext.ts", "../src/QueryEngine.ts", "../src/utils/filePersistence/types.ts", "../src/utils/filePersistence/filePersistence.ts", "../src/utils/idleTimeout.ts", "../src/utils/sessionUrl.ts", "../src/utils/plugins/zipCacheAdapters.ts", "../src/utils/plugins/headlessPluginInstall.ts", "../src/cli/print.ts", "../src/ssh/createSSHSession.ts", "../src/assistant/sessionDiscovery.ts", "../src/components/TeleportProgress.tsx", "../src/components/MCPServerDesktopImportDialog.tsx", "../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js", "../src/entrypoints/mcp.ts", "../src/utils/claudeDesktop.ts", "../src/cli/handlers/mcp.tsx", "../src/server/server.ts", "../src/server/sessionManager.ts", "../src/server/backends/dangerousBackend.ts", "../src/server/serverBanner.ts", "../src/server/serverLog.ts", "../src/server/lockfile.ts", "stub-missing:/Users/chenqg/Downloads/claude-code-build/src/server/connectHeadless.js", "../src/cli/handlers/plugins.ts", "../src/commands/install.tsx", "../src/cli/handlers/util.tsx", "../src/cli/handlers/agents.ts", "../src/cli/handlers/autoMode.ts", "../src/cli/update.ts", "../src/main.tsx", "../src/entrypoints/cli.tsx"], "sourcesContent": [ "/**\n * Shim for bun:bundle's feature() function.\n * Selectively enables features that have complete source code available.\n */\nconst ENABLED_FLAGS = new Set([\n 'AGENT_TRIGGERS', // Cron tools\n 'AGENT_TRIGGERS_REMOTE', // Remote triggers\n 'EXTRACT_MEMORIES', // Memory auto-extraction\n 'TOKEN_BUDGET', // Token budget tracking\n 'CHICAGO_MCP', // Computer Use MCP\n 'COMMIT_ATTRIBUTION', // Commit attribution\n 'MCP_RICH_OUTPUT', // MCP rich output\n]);\n\nexport function feature(name: string): boolean {\n return ENABLED_FLAGS.has(name);\n}\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\nexport default listCacheClear;\n", @@ -1399,153 +1399,8 @@ "'use strict';\n\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar propertyProvider = require('@smithy/property-provider');\nvar client = require('@aws-sdk/core/client');\nvar credentialProviderLogin = require('@aws-sdk/credential-provider-login');\n\nconst resolveCredentialSource = (credentialSource, profileName, logger) => {\n const sourceProvidersMap = {\n EcsContainer: async (options) => {\n const { fromHttp } = await import('@aws-sdk/credential-provider-http');\n const { fromContainerMetadata } = await import('@smithy/credential-provider-imds');\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is EcsContainer\");\n return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);\n },\n Ec2InstanceMetadata: async (options) => {\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata\");\n const { fromInstanceMetadata } = await import('@smithy/credential-provider-imds');\n return async () => fromInstanceMetadata(options)().then(setNamedProvider);\n },\n Environment: async (options) => {\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is Environment\");\n const { fromEnv } = await import('@aws-sdk/credential-provider-env');\n return async () => fromEnv(options)().then(setNamedProvider);\n },\n };\n if (credentialSource in sourceProvidersMap) {\n return sourceProvidersMap[credentialSource];\n }\n else {\n throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` +\n `expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });\n }\n};\nconst setNamedProvider = (creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_NAMED_PROVIDER\", \"p\");\n\nconst isAssumeRoleProfile = (arg, { profile = \"default\", logger } = {}) => {\n return (Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.role_arn === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.role_session_name) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.external_id) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.mfa_serial) > -1 &&\n (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger })));\n};\nconst isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {\n const withSourceProfile = typeof arg.source_profile === \"string\" && typeof arg.credential_source === \"undefined\";\n if (withSourceProfile) {\n logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);\n }\n return withSourceProfile;\n};\nconst isCredentialSourceProfile = (arg, { profile, logger }) => {\n const withProviderProfile = typeof arg.credential_source === \"string\" && typeof arg.source_profile === \"undefined\";\n if (withProviderProfile) {\n logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);\n }\n return withProviderProfile;\n};\nconst resolveAssumeRoleCredentials = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, resolveProfileData) => {\n options.logger?.debug(\"@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)\");\n const profileData = profiles[profileName];\n const { source_profile, region } = profileData;\n if (!options.roleAssumer) {\n const { getDefaultRoleAssumer } = await import('@aws-sdk/nested-clients/sts');\n options.roleAssumer = getDefaultRoleAssumer({\n ...options.clientConfig,\n credentialProviderLogger: options.logger,\n parentClientConfig: {\n ...callerClientConfig,\n ...options?.parentClientConfig,\n region: region ?? options?.parentClientConfig?.region ?? callerClientConfig?.region,\n },\n }, options.clientPlugins);\n }\n if (source_profile && source_profile in visitedProfiles) {\n throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` +\n ` ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` +\n Object.keys(visitedProfiles).join(\", \"), { logger: options.logger });\n }\n options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);\n const sourceCredsProvider = source_profile\n ? resolveProfileData(source_profile, profiles, options, callerClientConfig, {\n ...visitedProfiles,\n [source_profile]: true,\n }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {}))\n : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();\n if (isCredentialSourceWithoutRoleArn(profileData)) {\n return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SOURCE_PROFILE\", \"o\"));\n }\n else {\n const params = {\n RoleArn: profileData.role_arn,\n RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,\n ExternalId: profileData.external_id,\n DurationSeconds: parseInt(profileData.duration_seconds || \"3600\", 10),\n };\n const { mfa_serial } = profileData;\n if (mfa_serial) {\n if (!options.mfaCodeProvider) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });\n }\n params.SerialNumber = mfa_serial;\n params.TokenCode = await options.mfaCodeProvider(mfa_serial);\n }\n const sourceCreds = await sourceCredsProvider;\n return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SOURCE_PROFILE\", \"o\"));\n }\n};\nconst isCredentialSourceWithoutRoleArn = (section) => {\n return !section.role_arn && !!section.credential_source;\n};\n\nconst isLoginProfile = (data) => {\n return Boolean(data && data.login_session);\n};\nconst resolveLoginCredentials = async (profileName, options, callerClientConfig) => {\n const credentials = await credentialProviderLogin.fromLoginCredentials({\n ...options,\n profile: profileName,\n })({ callerClientConfig });\n return client.setCredentialFeature(credentials, \"CREDENTIALS_PROFILE_LOGIN\", \"AC\");\n};\n\nconst isProcessProfile = (arg) => Boolean(arg) && typeof arg === \"object\" && typeof arg.credential_process === \"string\";\nconst resolveProcessCredentials = async (options, profile) => import('@aws-sdk/credential-provider-process').then(({ fromProcess }) => fromProcess({\n ...options,\n profile,\n})().then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_PROCESS\", \"v\")));\n\nconst resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => {\n const { fromSSO } = await import('@aws-sdk/credential-provider-sso');\n return fromSSO({\n profile,\n logger: options.logger,\n parentClientConfig: options.parentClientConfig,\n clientConfig: options.clientConfig,\n })({\n callerClientConfig,\n }).then((creds) => {\n if (profileData.sso_session) {\n return client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SSO\", \"r\");\n }\n else {\n return client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SSO_LEGACY\", \"t\");\n }\n });\n};\nconst isSsoProfile = (arg) => arg &&\n (typeof arg.sso_start_url === \"string\" ||\n typeof arg.sso_account_id === \"string\" ||\n typeof arg.sso_session === \"string\" ||\n typeof arg.sso_region === \"string\" ||\n typeof arg.sso_role_name === \"string\");\n\nconst isStaticCredsProfile = (arg) => Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.aws_access_key_id === \"string\" &&\n typeof arg.aws_secret_access_key === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.aws_session_token) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.aws_account_id) > -1;\nconst resolveStaticCredentials = async (profile, options) => {\n options?.logger?.debug(\"@aws-sdk/credential-provider-ini - resolveStaticCredentials\");\n const credentials = {\n accessKeyId: profile.aws_access_key_id,\n secretAccessKey: profile.aws_secret_access_key,\n sessionToken: profile.aws_session_token,\n ...(profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope }),\n ...(profile.aws_account_id && { accountId: profile.aws_account_id }),\n };\n return client.setCredentialFeature(credentials, \"CREDENTIALS_PROFILE\", \"n\");\n};\n\nconst isWebIdentityProfile = (arg) => Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.web_identity_token_file === \"string\" &&\n typeof arg.role_arn === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.role_session_name) > -1;\nconst resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => import('@aws-sdk/credential-provider-web-identity').then(({ fromTokenFile }) => fromTokenFile({\n webIdentityTokenFile: profile.web_identity_token_file,\n roleArn: profile.role_arn,\n roleSessionName: profile.role_session_name,\n roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,\n logger: options.logger,\n parentClientConfig: options.parentClientConfig,\n})({\n callerClientConfig,\n}).then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN\", \"q\")));\n\nconst resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {\n const data = profiles[profileName];\n if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {\n return resolveStaticCredentials(data, options);\n }\n if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {\n return resolveAssumeRoleCredentials(profileName, profiles, options, callerClientConfig, visitedProfiles, resolveProfileData);\n }\n if (isStaticCredsProfile(data)) {\n return resolveStaticCredentials(data, options);\n }\n if (isWebIdentityProfile(data)) {\n return resolveWebIdentityCredentials(data, options, callerClientConfig);\n }\n if (isProcessProfile(data)) {\n return resolveProcessCredentials(options, profileName);\n }\n if (isSsoProfile(data)) {\n return await resolveSsoCredentials(profileName, data, options, callerClientConfig);\n }\n if (isLoginProfile(data)) {\n return resolveLoginCredentials(profileName, options, callerClientConfig);\n }\n throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });\n};\n\nconst fromIni = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-ini - fromIni\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n return resolveProfileData(sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n }), profiles, init, callerClientConfig);\n};\n\nexports.fromIni = fromIni;\n", "'use strict';\n\nvar credentialProviderEnv = require('@aws-sdk/credential-provider-env');\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\n\nconst ENV_IMDS_DISABLED = \"AWS_EC2_METADATA_DISABLED\";\nconst remoteProvider = async (init) => {\n const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await import('@smithy/credential-provider-imds');\n if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata\");\n const { fromHttp } = await import('@aws-sdk/credential-provider-http');\n return propertyProvider.chain(fromHttp(init), fromContainerMetadata(init));\n }\n if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== \"false\") {\n return async () => {\n throw new propertyProvider.CredentialsProviderError(\"EC2 Instance Metadata Service access disabled\", { logger: init.logger });\n };\n }\n init.logger?.debug(\"@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata\");\n return fromInstanceMetadata(init);\n};\n\nfunction memoizeChain(providers, treatAsExpired) {\n const chain = internalCreateChain(providers);\n let activeLock;\n let passiveLock;\n let credentials;\n const provider = async (options) => {\n if (options?.forceRefresh) {\n return await chain(options);\n }\n if (credentials?.expiration) {\n if (credentials?.expiration?.getTime() < Date.now()) {\n credentials = undefined;\n }\n }\n if (activeLock) {\n await activeLock;\n }\n else if (!credentials || treatAsExpired?.(credentials)) {\n if (credentials) {\n if (!passiveLock) {\n passiveLock = chain(options)\n .then((c) => {\n credentials = c;\n })\n .finally(() => {\n passiveLock = undefined;\n });\n }\n }\n else {\n activeLock = chain(options)\n .then((c) => {\n credentials = c;\n })\n .finally(() => {\n activeLock = undefined;\n });\n return provider(options);\n }\n }\n return credentials;\n };\n return provider;\n}\nconst internalCreateChain = (providers) => async (awsIdentityProperties) => {\n let lastProviderError;\n for (const provider of providers) {\n try {\n return await provider(awsIdentityProperties);\n }\n catch (err) {\n lastProviderError = err;\n if (err?.tryNextLink) {\n continue;\n }\n throw err;\n }\n }\n throw lastProviderError;\n};\n\nlet multipleCredentialSourceWarningEmitted = false;\nconst defaultProvider = (init = {}) => memoizeChain([\n async () => {\n const profile = init.profile ?? process.env[sharedIniFileLoader.ENV_PROFILE];\n if (profile) {\n const envStaticCredentialsAreSet = process.env[credentialProviderEnv.ENV_KEY] && process.env[credentialProviderEnv.ENV_SECRET];\n if (envStaticCredentialsAreSet) {\n if (!multipleCredentialSourceWarningEmitted) {\n const warnFn = init.logger?.warn && init.logger?.constructor?.name !== \"NoOpLogger\"\n ? init.logger.warn.bind(init.logger)\n : console.warn;\n warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:\n Multiple credential sources detected: \n Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.\n This SDK will proceed with the AWS_PROFILE value.\n \n However, a future version may change this behavior to prefer the ENV static credentials.\n Please ensure that your environment only sets either the AWS_PROFILE or the\n AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.\n`);\n multipleCredentialSourceWarningEmitted = true;\n }\n }\n throw new propertyProvider.CredentialsProviderError(\"AWS_PROFILE is set, skipping fromEnv provider.\", {\n logger: init.logger,\n tryNextLink: true,\n });\n }\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromEnv\");\n return credentialProviderEnv.fromEnv(init)();\n },\n async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromSSO\");\n const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;\n if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {\n throw new propertyProvider.CredentialsProviderError(\"Skipping SSO provider in default chain (inputs do not include SSO fields).\", { logger: init.logger });\n }\n const { fromSSO } = await import('@aws-sdk/credential-provider-sso');\n return fromSSO(init)(awsIdentityProperties);\n },\n async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromIni\");\n const { fromIni } = await import('@aws-sdk/credential-provider-ini');\n return fromIni(init)(awsIdentityProperties);\n },\n async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromProcess\");\n const { fromProcess } = await import('@aws-sdk/credential-provider-process');\n return fromProcess(init)(awsIdentityProperties);\n },\n async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile\");\n const { fromTokenFile } = await import('@aws-sdk/credential-provider-web-identity');\n return fromTokenFile(init)(awsIdentityProperties);\n },\n async () => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::remoteProvider\");\n return (await remoteProvider(init))();\n },\n async () => {\n throw new propertyProvider.CredentialsProviderError(\"Could not load credentials from any providers\", {\n tryNextLink: false,\n logger: init.logger,\n });\n },\n], credentialsTreatedAsExpired);\nconst credentialsWillNeedRefresh = (credentials) => credentials?.expiration !== undefined;\nconst credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000;\n\nexports.credentialsTreatedAsExpired = credentialsTreatedAsExpired;\nexports.credentialsWillNeedRefresh = credentialsWillNeedRefresh;\nexports.defaultProvider = defaultProvider;\n", "// @aws-sdk/credential-provider-node and @smithy/node-http-handler are imported\n// dynamically in getAWSClientProxyConfig() to defer ~929KB of AWS SDK.\n// undici is lazy-required inside getProxyAgent/configureGlobalAgents to defer\n// ~1.5MB when no HTTPS_PROXY/mTLS env vars are set (the common case).\nimport axios, { type AxiosInstance } from 'axios'\nimport type { LookupOptions } from 'dns'\nimport type { Agent } from 'http'\nimport { HttpsProxyAgent, type HttpsProxyAgentOptions } from 'https-proxy-agent'\nimport memoize from 'lodash-es/memoize.js'\nimport type * as undici from 'undici'\nimport { getCACertificates } from './caCerts.js'\nimport { logForDebugging } from './debug.js'\nimport { isEnvTruthy } from './envUtils.js'\nimport {\n getMTLSAgent,\n getMTLSConfig,\n getTLSFetchOptions,\n type TLSConfig,\n} from './mtls.js'\n\n// Disable fetch keep-alive after a stale-pool ECONNRESET so retries open a\n// fresh TCP connection instead of reusing the dead pooled socket. Sticky for\n// the process lifetime — once the pool is known-bad, don't trust it again.\n// Works under Bun (native fetch respects keepalive:false for pooling).\n// Under Node/undici, keepalive is a no-op for pooling, but undici\n// naturally evicts dead sockets from the pool on ECONNRESET.\nlet keepAliveDisabled = false\n\nexport function disableKeepAlive(): void {\n keepAliveDisabled = true\n}\n\nexport function _resetKeepAliveForTesting(): void {\n keepAliveDisabled = false\n}\n\n/**\n * Convert dns.LookupOptions.family to a numeric address family value\n * Handles: 0 | 4 | 6 | 'IPv4' | 'IPv6' | undefined\n */\nexport function getAddressFamily(options: LookupOptions): 0 | 4 | 6 {\n switch (options.family) {\n case 0:\n case 4:\n case 6:\n return options.family\n case 'IPv6':\n return 6\n case 'IPv4':\n case undefined:\n return 4\n default:\n throw new Error(`Unsupported address family: ${options.family}`)\n }\n}\n\ntype EnvLike = Record\n\n/**\n * Get the active proxy URL if one is configured\n * Prefers lowercase variants over uppercase (https_proxy > HTTPS_PROXY > http_proxy > HTTP_PROXY)\n * @param env Environment variables to check (defaults to process.env for production use)\n */\nexport function getProxyUrl(env: EnvLike = process.env): string | undefined {\n return env.https_proxy || env.HTTPS_PROXY || env.http_proxy || env.HTTP_PROXY\n}\n\n/**\n * Get the NO_PROXY environment variable value\n * Prefers lowercase over uppercase (no_proxy > NO_PROXY)\n * @param env Environment variables to check (defaults to process.env for production use)\n */\nexport function getNoProxy(env: EnvLike = process.env): string | undefined {\n return env.no_proxy || env.NO_PROXY\n}\n\n/**\n * Check if a URL should bypass the proxy based on NO_PROXY environment variable\n * Supports:\n * - Exact hostname matches (e.g., \"localhost\")\n * - Domain suffix matches with leading dot (e.g., \".example.com\")\n * - Wildcard \"*\" to bypass all\n * - Port-specific matches (e.g., \"example.com:8080\")\n * - IP addresses (e.g., \"127.0.0.1\")\n * @param urlString URL to check\n * @param noProxy NO_PROXY value (defaults to getNoProxy() for production use)\n */\nexport function shouldBypassProxy(\n urlString: string,\n noProxy: string | undefined = getNoProxy(),\n): boolean {\n if (!noProxy) return false\n\n // Handle wildcard\n if (noProxy === '*') return true\n\n try {\n const url = new URL(urlString)\n const hostname = url.hostname.toLowerCase()\n const port = url.port || (url.protocol === 'https:' ? '443' : '80')\n const hostWithPort = `${hostname}:${port}`\n\n // Split by comma or space and trim each entry\n const noProxyList = noProxy.split(/[,\\s]+/).filter(Boolean)\n\n return noProxyList.some(pattern => {\n pattern = pattern.toLowerCase().trim()\n\n // Check for port-specific match\n if (pattern.includes(':')) {\n return hostWithPort === pattern\n }\n\n // Check for domain suffix match (with or without leading dot)\n if (pattern.startsWith('.')) {\n // Pattern \".example.com\" should match \"sub.example.com\" and \"example.com\"\n // but NOT \"notexample.com\"\n const suffix = pattern\n return hostname === pattern.substring(1) || hostname.endsWith(suffix)\n }\n\n // Check for exact hostname match or IP address\n return hostname === pattern\n })\n } catch {\n // If URL parsing fails, don't bypass proxy\n return false\n }\n}\n\n/**\n * Create an HttpsProxyAgent with optional mTLS configuration\n * Skips local DNS resolution to let the proxy handle it\n */\nfunction createHttpsProxyAgent(\n proxyUrl: string,\n extra: HttpsProxyAgentOptions = {},\n): HttpsProxyAgent {\n const mtlsConfig = getMTLSConfig()\n const caCerts = getCACertificates()\n\n const agentOptions: HttpsProxyAgentOptions = {\n ...(mtlsConfig && {\n cert: mtlsConfig.cert,\n key: mtlsConfig.key,\n passphrase: mtlsConfig.passphrase,\n }),\n ...(caCerts && { ca: caCerts }),\n }\n\n if (isEnvTruthy(process.env.CLAUDE_CODE_PROXY_RESOLVES_HOSTS)) {\n // Skip local DNS resolution - let the proxy resolve hostnames\n // This is needed for environments where DNS is not configured locally\n // and instead handled by the proxy (as in sandboxes)\n agentOptions.lookup = (hostname, options, callback) => {\n callback(null, hostname, getAddressFamily(options))\n }\n }\n\n return new HttpsProxyAgent(proxyUrl, { ...agentOptions, ...extra })\n}\n\n/**\n * Axios instance with its own proxy agent. Same NO_PROXY/mTLS/CA\n * resolution as the global interceptor, but agent options stay\n * scoped to this instance.\n */\nexport function createAxiosInstance(\n extra: HttpsProxyAgentOptions = {},\n): AxiosInstance {\n const proxyUrl = getProxyUrl()\n const mtlsAgent = getMTLSAgent()\n const instance = axios.create({ proxy: false })\n\n if (!proxyUrl) {\n if (mtlsAgent) instance.defaults.httpsAgent = mtlsAgent\n return instance\n }\n\n const proxyAgent = createHttpsProxyAgent(proxyUrl, extra)\n instance.interceptors.request.use(config => {\n if (config.url && shouldBypassProxy(config.url)) {\n config.httpsAgent = mtlsAgent\n config.httpAgent = mtlsAgent\n } else {\n config.httpsAgent = proxyAgent\n config.httpAgent = proxyAgent\n }\n return config\n })\n return instance\n}\n\n/**\n * Get or create a memoized proxy agent for the given URI\n * Now respects NO_PROXY environment variable\n */\nexport const getProxyAgent = memoize((uri: string): undici.Dispatcher => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const undiciMod = require('undici') as typeof undici\n const mtlsConfig = getMTLSConfig()\n const caCerts = getCACertificates()\n\n // Use EnvHttpProxyAgent to respect NO_PROXY\n // This agent automatically checks NO_PROXY for each request\n const proxyOptions: undici.EnvHttpProxyAgent.Options & {\n requestTls?: {\n cert?: string | Buffer\n key?: string | Buffer\n passphrase?: string\n ca?: string | string[] | Buffer\n }\n } = {\n // Override both HTTP and HTTPS proxy with the provided URI\n httpProxy: uri,\n httpsProxy: uri,\n noProxy: process.env.NO_PROXY || process.env.no_proxy,\n }\n\n // Set both connect and requestTls so TLS options apply to both paths:\n // - requestTls: used by ProxyAgent for the TLS connection through CONNECT tunnels\n // - connect: used by Agent for direct (no-proxy) connections\n if (mtlsConfig || caCerts) {\n const tlsOpts = {\n ...(mtlsConfig && {\n cert: mtlsConfig.cert,\n key: mtlsConfig.key,\n passphrase: mtlsConfig.passphrase,\n }),\n ...(caCerts && { ca: caCerts }),\n }\n proxyOptions.connect = tlsOpts\n proxyOptions.requestTls = tlsOpts\n }\n\n return new undiciMod.EnvHttpProxyAgent(proxyOptions)\n})\n\n/**\n * Get an HTTP agent configured for WebSocket proxy support\n * Returns undefined if no proxy is configured or URL should bypass proxy\n */\nexport function getWebSocketProxyAgent(url: string): Agent | undefined {\n const proxyUrl = getProxyUrl()\n\n if (!proxyUrl) {\n return undefined\n }\n\n // Check if URL should bypass proxy\n if (shouldBypassProxy(url)) {\n return undefined\n }\n\n return createHttpsProxyAgent(proxyUrl)\n}\n\n/**\n * Get the proxy URL for WebSocket connections under Bun.\n * Bun's native WebSocket supports a `proxy` string option instead of Node's `agent`.\n * Returns undefined if no proxy is configured or URL should bypass proxy.\n */\nexport function getWebSocketProxyUrl(url: string): string | undefined {\n const proxyUrl = getProxyUrl()\n\n if (!proxyUrl) {\n return undefined\n }\n\n if (shouldBypassProxy(url)) {\n return undefined\n }\n\n return proxyUrl\n}\n\n/**\n * Get fetch options for the Anthropic SDK with proxy and mTLS configuration\n * Returns fetch options with appropriate dispatcher for proxy and/or mTLS\n *\n * @param opts.forAnthropicAPI - Enables ANTHROPIC_UNIX_SOCKET tunneling. This\n * env var is set by `claude ssh` on the remote CLI to route API calls through\n * an ssh -R forwarded unix socket to a local auth proxy. It MUST NOT leak\n * into non-Anthropic-API fetch paths (MCP HTTP/SSE transports, etc.) or those\n * requests get misrouted to api.anthropic.com. Only the Anthropic SDK client\n * should pass `true` here.\n */\nexport function getProxyFetchOptions(opts?: { forAnthropicAPI?: boolean }): {\n tls?: TLSConfig\n dispatcher?: undici.Dispatcher\n proxy?: string\n unix?: string\n keepalive?: false\n} {\n const base = keepAliveDisabled ? ({ keepalive: false } as const) : {}\n\n // ANTHROPIC_UNIX_SOCKET tunnels through the `claude ssh` auth proxy, which\n // hardcodes the upstream to the Anthropic API. Scope to the Anthropic API\n // client so MCP/SSE/other callers don't get their requests misrouted.\n if (opts?.forAnthropicAPI) {\n const unixSocket = process.env.ANTHROPIC_UNIX_SOCKET\n if (unixSocket && typeof Bun !== 'undefined') {\n return { ...base, unix: unixSocket }\n }\n }\n\n const proxyUrl = getProxyUrl()\n\n // If we have a proxy, use the proxy agent (which includes mTLS config)\n if (proxyUrl) {\n if (typeof Bun !== 'undefined') {\n return { ...base, proxy: proxyUrl, ...getTLSFetchOptions() }\n }\n return { ...base, dispatcher: getProxyAgent(proxyUrl) }\n }\n\n // Otherwise, use TLS options directly if available\n return { ...base, ...getTLSFetchOptions() }\n}\n\n/**\n * Configure global HTTP agents for both axios and undici\n * This ensures all HTTP requests use the proxy and/or mTLS if configured\n */\nlet proxyInterceptorId: number | undefined\n\nexport function configureGlobalAgents(): void {\n const proxyUrl = getProxyUrl()\n const mtlsAgent = getMTLSAgent()\n\n // Eject previous interceptor to avoid stacking on repeated calls\n if (proxyInterceptorId !== undefined) {\n axios.interceptors.request.eject(proxyInterceptorId)\n proxyInterceptorId = undefined\n }\n\n // Reset proxy-related defaults so reconfiguration is clean\n axios.defaults.proxy = undefined\n axios.defaults.httpAgent = undefined\n axios.defaults.httpsAgent = undefined\n\n if (proxyUrl) {\n // workaround for https://github.com/axios/axios/issues/4531\n axios.defaults.proxy = false\n\n // Create proxy agent with mTLS options if available\n const proxyAgent = createHttpsProxyAgent(proxyUrl)\n\n // Add axios request interceptor to handle NO_PROXY\n proxyInterceptorId = axios.interceptors.request.use(config => {\n // Check if URL should bypass proxy based on NO_PROXY\n if (config.url && shouldBypassProxy(config.url)) {\n // Bypass proxy - use mTLS agent if configured, otherwise undefined\n if (mtlsAgent) {\n config.httpsAgent = mtlsAgent\n config.httpAgent = mtlsAgent\n } else {\n // Remove any proxy agents to use direct connection\n delete config.httpsAgent\n delete config.httpAgent\n }\n } else {\n // Use proxy agent\n config.httpsAgent = proxyAgent\n config.httpAgent = proxyAgent\n }\n return config\n })\n\n // Set global dispatcher that now respects NO_PROXY via EnvHttpProxyAgent\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n ;(require('undici') as typeof undici).setGlobalDispatcher(\n getProxyAgent(proxyUrl),\n )\n } else if (mtlsAgent) {\n // No proxy but mTLS is configured\n axios.defaults.httpsAgent = mtlsAgent\n\n // Set undici global dispatcher with mTLS\n const mtlsOptions = getTLSFetchOptions()\n if (mtlsOptions.dispatcher) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n ;(require('undici') as typeof undici).setGlobalDispatcher(\n mtlsOptions.dispatcher,\n )\n }\n }\n}\n\n/**\n * Get AWS SDK client configuration with proxy support\n * Returns configuration object that can be spread into AWS service client constructors\n */\nexport async function getAWSClientProxyConfig(): Promise {\n const proxyUrl = getProxyUrl()\n\n if (!proxyUrl) {\n return {}\n }\n\n const [{ NodeHttpHandler }, { defaultProvider }] = await Promise.all([\n import('@smithy/node-http-handler'),\n import('@aws-sdk/credential-provider-node'),\n ])\n\n const agent = createHttpsProxyAgent(proxyUrl)\n const requestHandler = new NodeHttpHandler({\n httpAgent: agent,\n httpsAgent: agent,\n })\n\n return {\n requestHandler,\n credentials: defaultProvider({\n clientConfig: { requestHandler },\n }),\n }\n}\n\n/**\n * Clear proxy agent cache.\n */\nexport function clearProxyCache(): void {\n getProxyAgent.cache.clear?.()\n logForDebugging('Cleared proxy agent cache')\n}\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n AlgorithmId: () => AlgorithmId,\n EndpointURLScheme: () => EndpointURLScheme,\n FieldPosition: () => FieldPosition,\n HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation,\n HttpAuthLocation: () => HttpAuthLocation,\n IniSectionType: () => IniSectionType,\n RequestHandlerProtocol: () => RequestHandlerProtocol,\n SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY,\n getDefaultClientConfiguration: () => getDefaultClientConfiguration,\n resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/auth/auth.ts\nvar HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => {\n HttpAuthLocation2[\"HEADER\"] = \"header\";\n HttpAuthLocation2[\"QUERY\"] = \"query\";\n return HttpAuthLocation2;\n})(HttpAuthLocation || {});\n\n// src/auth/HttpApiKeyAuth.ts\nvar HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => {\n HttpApiKeyAuthLocation2[\"HEADER\"] = \"header\";\n HttpApiKeyAuthLocation2[\"QUERY\"] = \"query\";\n return HttpApiKeyAuthLocation2;\n})(HttpApiKeyAuthLocation || {});\n\n// src/endpoint.ts\nvar EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => {\n EndpointURLScheme2[\"HTTP\"] = \"http\";\n EndpointURLScheme2[\"HTTPS\"] = \"https\";\n return EndpointURLScheme2;\n})(EndpointURLScheme || {});\n\n// src/extensions/checksum.ts\nvar AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => {\n AlgorithmId2[\"MD5\"] = \"md5\";\n AlgorithmId2[\"CRC32\"] = \"crc32\";\n AlgorithmId2[\"CRC32C\"] = \"crc32c\";\n AlgorithmId2[\"SHA1\"] = \"sha1\";\n AlgorithmId2[\"SHA256\"] = \"sha256\";\n return AlgorithmId2;\n})(AlgorithmId || {});\nvar getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {\n const checksumAlgorithms = [];\n if (runtimeConfig.sha256 !== void 0) {\n checksumAlgorithms.push({\n algorithmId: () => \"sha256\" /* SHA256 */,\n checksumConstructor: () => runtimeConfig.sha256\n });\n }\n if (runtimeConfig.md5 != void 0) {\n checksumAlgorithms.push({\n algorithmId: () => \"md5\" /* MD5 */,\n checksumConstructor: () => runtimeConfig.md5\n });\n }\n return {\n _checksumAlgorithms: checksumAlgorithms,\n addChecksumAlgorithm(algo) {\n this._checksumAlgorithms.push(algo);\n },\n checksumAlgorithms() {\n return this._checksumAlgorithms;\n }\n };\n}, \"getChecksumConfiguration\");\nvar resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => {\n const runtimeConfig = {};\n clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {\n runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();\n });\n return runtimeConfig;\n}, \"resolveChecksumRuntimeConfig\");\n\n// src/extensions/defaultClientConfiguration.ts\nvar getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {\n return {\n ...getChecksumConfiguration(runtimeConfig)\n };\n}, \"getDefaultClientConfiguration\");\nvar resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {\n return {\n ...resolveChecksumRuntimeConfig(config)\n };\n}, \"resolveDefaultRuntimeConfig\");\n\n// src/http.ts\nvar FieldPosition = /* @__PURE__ */ ((FieldPosition2) => {\n FieldPosition2[FieldPosition2[\"HEADER\"] = 0] = \"HEADER\";\n FieldPosition2[FieldPosition2[\"TRAILER\"] = 1] = \"TRAILER\";\n return FieldPosition2;\n})(FieldPosition || {});\n\n// src/middleware.ts\nvar SMITHY_CONTEXT_KEY = \"__smithy_context\";\n\n// src/profile.ts\nvar IniSectionType = /* @__PURE__ */ ((IniSectionType2) => {\n IniSectionType2[\"PROFILE\"] = \"profile\";\n IniSectionType2[\"SSO_SESSION\"] = \"sso-session\";\n IniSectionType2[\"SERVICES\"] = \"services\";\n return IniSectionType2;\n})(IniSectionType || {});\n\n// src/transfer.ts\nvar RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => {\n RequestHandlerProtocol2[\"HTTP_0_9\"] = \"http/0.9\";\n RequestHandlerProtocol2[\"HTTP_1_0\"] = \"http/1.0\";\n RequestHandlerProtocol2[\"TDS_8_0\"] = \"tds/8.0\";\n return RequestHandlerProtocol2;\n})(RequestHandlerProtocol || {});\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n HttpAuthLocation,\n HttpApiKeyAuthLocation,\n EndpointURLScheme,\n AlgorithmId,\n getDefaultClientConfiguration,\n resolveDefaultRuntimeConfig,\n FieldPosition,\n SMITHY_CONTEXT_KEY,\n IniSectionType,\n RequestHandlerProtocol\n});\n\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n Field: () => Field,\n Fields: () => Fields,\n HttpRequest: () => HttpRequest,\n HttpResponse: () => HttpResponse,\n getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration,\n isValidHostname: () => isValidHostname,\n resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/extensions/httpExtensionConfiguration.ts\nvar getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {\n let httpHandler = runtimeConfig.httpHandler;\n return {\n setHttpHandler(handler) {\n httpHandler = handler;\n },\n httpHandler() {\n return httpHandler;\n },\n updateHttpClientConfig(key, value) {\n httpHandler.updateHttpClientConfig(key, value);\n },\n httpHandlerConfigs() {\n return httpHandler.httpHandlerConfigs();\n }\n };\n}, \"getHttpHandlerExtensionConfiguration\");\nvar resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => {\n return {\n httpHandler: httpHandlerExtensionConfiguration.httpHandler()\n };\n}, \"resolveHttpHandlerRuntimeConfig\");\n\n// src/Field.ts\nvar import_types = require(\"@smithy/types\");\nvar _Field = class _Field {\n constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) {\n this.name = name;\n this.kind = kind;\n this.values = values;\n }\n /**\n * Appends a value to the field.\n *\n * @param value The value to append.\n */\n add(value) {\n this.values.push(value);\n }\n /**\n * Overwrite existing field values.\n *\n * @param values The new field values.\n */\n set(values) {\n this.values = values;\n }\n /**\n * Remove all matching entries from list.\n *\n * @param value Value to remove.\n */\n remove(value) {\n this.values = this.values.filter((v) => v !== value);\n }\n /**\n * Get comma-delimited string.\n *\n * @returns String representation of {@link Field}.\n */\n toString() {\n return this.values.map((v) => v.includes(\",\") || v.includes(\" \") ? `\"${v}\"` : v).join(\", \");\n }\n /**\n * Get string values as a list\n *\n * @returns Values in {@link Field} as a list.\n */\n get() {\n return this.values;\n }\n};\n__name(_Field, \"Field\");\nvar Field = _Field;\n\n// src/Fields.ts\nvar _Fields = class _Fields {\n constructor({ fields = [], encoding = \"utf-8\" }) {\n this.entries = {};\n fields.forEach(this.setField.bind(this));\n this.encoding = encoding;\n }\n /**\n * Set entry for a {@link Field} name. The `name`\n * attribute will be used to key the collection.\n *\n * @param field The {@link Field} to set.\n */\n setField(field) {\n this.entries[field.name.toLowerCase()] = field;\n }\n /**\n * Retrieve {@link Field} entry by name.\n *\n * @param name The name of the {@link Field} entry\n * to retrieve\n * @returns The {@link Field} if it exists.\n */\n getField(name) {\n return this.entries[name.toLowerCase()];\n }\n /**\n * Delete entry from collection.\n *\n * @param name Name of the entry to delete.\n */\n removeField(name) {\n delete this.entries[name.toLowerCase()];\n }\n /**\n * Helper function for retrieving specific types of fields.\n * Used to grab all headers or all trailers.\n *\n * @param kind {@link FieldPosition} of entries to retrieve.\n * @returns The {@link Field} entries with the specified\n * {@link FieldPosition}.\n */\n getByType(kind) {\n return Object.values(this.entries).filter((field) => field.kind === kind);\n }\n};\n__name(_Fields, \"Fields\");\nvar Fields = _Fields;\n\n// src/httpRequest.ts\nvar _HttpRequest = class _HttpRequest {\n constructor(options) {\n this.method = options.method || \"GET\";\n this.hostname = options.hostname || \"localhost\";\n this.port = options.port;\n this.query = options.query || {};\n this.headers = options.headers || {};\n this.body = options.body;\n this.protocol = options.protocol ? options.protocol.slice(-1) !== \":\" ? `${options.protocol}:` : options.protocol : \"https:\";\n this.path = options.path ? options.path.charAt(0) !== \"/\" ? `/${options.path}` : options.path : \"/\";\n this.username = options.username;\n this.password = options.password;\n this.fragment = options.fragment;\n }\n static isInstance(request) {\n if (!request)\n return false;\n const req = request;\n return \"method\" in req && \"protocol\" in req && \"hostname\" in req && \"path\" in req && typeof req[\"query\"] === \"object\" && typeof req[\"headers\"] === \"object\";\n }\n clone() {\n const cloned = new _HttpRequest({\n ...this,\n headers: { ...this.headers }\n });\n if (cloned.query)\n cloned.query = cloneQuery(cloned.query);\n return cloned;\n }\n};\n__name(_HttpRequest, \"HttpRequest\");\nvar HttpRequest = _HttpRequest;\nfunction cloneQuery(query) {\n return Object.keys(query).reduce((carry, paramName) => {\n const param = query[paramName];\n return {\n ...carry,\n [paramName]: Array.isArray(param) ? [...param] : param\n };\n }, {});\n}\n__name(cloneQuery, \"cloneQuery\");\n\n// src/httpResponse.ts\nvar _HttpResponse = class _HttpResponse {\n constructor(options) {\n this.statusCode = options.statusCode;\n this.reason = options.reason;\n this.headers = options.headers || {};\n this.body = options.body;\n }\n static isInstance(response) {\n if (!response)\n return false;\n const resp = response;\n return typeof resp.statusCode === \"number\" && typeof resp.headers === \"object\";\n }\n};\n__name(_HttpResponse, \"HttpResponse\");\nvar HttpResponse = _HttpResponse;\n\n// src/isValidHostname.ts\nfunction isValidHostname(hostname) {\n const hostPattern = /^[a-z0-9][a-z0-9\\.\\-]*[a-z0-9]$/;\n return hostPattern.test(hostname);\n}\n__name(isValidHostname, \"isValidHostname\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n getHttpHandlerExtensionConfiguration,\n resolveHttpHandlerRuntimeConfig,\n Field,\n Fields,\n HttpRequest,\n HttpResponse,\n isValidHostname\n});\n\n", - "'use strict';\n\nvar protocolHttp = require('@smithy/protocol-http');\n\nfunction resolveHostHeaderConfig(input) {\n return input;\n}\nconst hostHeaderMiddleware = (options) => (next) => async (args) => {\n if (!protocolHttp.HttpRequest.isInstance(args.request))\n return next(args);\n const { request } = args;\n const { handlerProtocol = \"\" } = options.requestHandler.metadata || {};\n if (handlerProtocol.indexOf(\"h2\") >= 0 && !request.headers[\":authority\"]) {\n delete request.headers[\"host\"];\n request.headers[\":authority\"] = request.hostname + (request.port ? \":\" + request.port : \"\");\n }\n else if (!request.headers[\"host\"]) {\n let host = request.hostname;\n if (request.port != null)\n host += `:${request.port}`;\n request.headers[\"host\"] = host;\n }\n return next(args);\n};\nconst hostHeaderMiddlewareOptions = {\n name: \"hostHeaderMiddleware\",\n step: \"build\",\n priority: \"low\",\n tags: [\"HOST\"],\n override: true,\n};\nconst getHostHeaderPlugin = (options) => ({\n applyToStack: (clientStack) => {\n clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);\n },\n});\n\nexports.getHostHeaderPlugin = getHostHeaderPlugin;\nexports.hostHeaderMiddleware = hostHeaderMiddleware;\nexports.hostHeaderMiddlewareOptions = hostHeaderMiddlewareOptions;\nexports.resolveHostHeaderConfig = resolveHostHeaderConfig;\n", - "'use strict';\n\nconst loggerMiddleware = () => (next, context) => async (args) => {\n try {\n const response = await next(args);\n const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;\n const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;\n const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;\n const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;\n const { $metadata, ...outputWithoutMetadata } = response.output;\n logger?.info?.({\n clientName,\n commandName,\n input: inputFilterSensitiveLog(args.input),\n output: outputFilterSensitiveLog(outputWithoutMetadata),\n metadata: $metadata,\n });\n return response;\n }\n catch (error) {\n const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;\n const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;\n const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;\n logger?.error?.({\n clientName,\n commandName,\n input: inputFilterSensitiveLog(args.input),\n error,\n metadata: error.$metadata,\n });\n throw error;\n }\n};\nconst loggerMiddlewareOptions = {\n name: \"loggerMiddleware\",\n tags: [\"LOGGER\"],\n step: \"initialize\",\n override: true,\n};\nconst getLoggerPlugin = (options) => ({\n applyToStack: (clientStack) => {\n clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);\n },\n});\n\nexports.getLoggerPlugin = getLoggerPlugin;\nexports.loggerMiddleware = loggerMiddleware;\nexports.loggerMiddlewareOptions = loggerMiddlewareOptions;\n", - "'use strict';\n\nconst PROTECTED_KEYS = {\n REQUEST_ID: Symbol.for(\"_AWS_LAMBDA_REQUEST_ID\"),\n X_RAY_TRACE_ID: Symbol.for(\"_AWS_LAMBDA_X_RAY_TRACE_ID\"),\n TENANT_ID: Symbol.for(\"_AWS_LAMBDA_TENANT_ID\"),\n};\nconst NO_GLOBAL_AWS_LAMBDA = [\"true\", \"1\"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? \"\");\nif (!NO_GLOBAL_AWS_LAMBDA) {\n globalThis.awslambda = globalThis.awslambda || {};\n}\nclass InvokeStoreBase {\n static PROTECTED_KEYS = PROTECTED_KEYS;\n isProtectedKey(key) {\n return Object.values(PROTECTED_KEYS).includes(key);\n }\n getRequestId() {\n return this.get(PROTECTED_KEYS.REQUEST_ID) ?? \"-\";\n }\n getXRayTraceId() {\n return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID);\n }\n getTenantId() {\n return this.get(PROTECTED_KEYS.TENANT_ID);\n }\n}\nclass InvokeStoreSingle extends InvokeStoreBase {\n currentContext;\n getContext() {\n return this.currentContext;\n }\n hasContext() {\n return this.currentContext !== undefined;\n }\n get(key) {\n return this.currentContext?.[key];\n }\n set(key, value) {\n if (this.isProtectedKey(key)) {\n throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);\n }\n this.currentContext = this.currentContext || {};\n this.currentContext[key] = value;\n }\n run(context, fn) {\n this.currentContext = context;\n return fn();\n }\n}\nclass InvokeStoreMulti extends InvokeStoreBase {\n als;\n static async create() {\n const instance = new InvokeStoreMulti();\n const asyncHooks = await import('node:async_hooks');\n instance.als = new asyncHooks.AsyncLocalStorage();\n return instance;\n }\n getContext() {\n return this.als.getStore();\n }\n hasContext() {\n return this.als.getStore() !== undefined;\n }\n get(key) {\n return this.als.getStore()?.[key];\n }\n set(key, value) {\n if (this.isProtectedKey(key)) {\n throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`);\n }\n const store = this.als.getStore();\n if (!store) {\n throw new Error(\"No context available\");\n }\n store[key] = value;\n }\n run(context, fn) {\n return this.als.run(context, fn);\n }\n}\nexports.InvokeStore = void 0;\n(function (InvokeStore) {\n let instance = null;\n async function getInstanceAsync(forceInvokeStoreMulti) {\n if (!instance) {\n instance = (async () => {\n const isMulti = forceInvokeStoreMulti === true || \"AWS_LAMBDA_MAX_CONCURRENCY\" in process.env;\n const newInstance = isMulti\n ? await InvokeStoreMulti.create()\n : new InvokeStoreSingle();\n if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) {\n return globalThis.awslambda.InvokeStore;\n }\n else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) {\n globalThis.awslambda.InvokeStore = newInstance;\n return newInstance;\n }\n else {\n return newInstance;\n }\n })();\n }\n return instance;\n }\n InvokeStore.getInstanceAsync = getInstanceAsync;\n InvokeStore._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === \"1\"\n ? {\n reset: () => {\n instance = null;\n if (globalThis.awslambda?.InvokeStore) {\n delete globalThis.awslambda.InvokeStore;\n }\n globalThis.awslambda = { InvokeStore: undefined };\n },\n }\n : undefined;\n})(exports.InvokeStore || (exports.InvokeStore = {}));\n\nexports.InvokeStoreBase = InvokeStoreBase;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.recursionDetectionMiddleware = void 0;\nconst lambda_invoke_store_1 = require(\"@aws/lambda-invoke-store\");\nconst protocol_http_1 = require(\"@smithy/protocol-http\");\nconst TRACE_ID_HEADER_NAME = \"X-Amzn-Trace-Id\";\nconst ENV_LAMBDA_FUNCTION_NAME = \"AWS_LAMBDA_FUNCTION_NAME\";\nconst ENV_TRACE_ID = \"_X_AMZN_TRACE_ID\";\nconst recursionDetectionMiddleware = () => (next) => async (args) => {\n const { request } = args;\n if (!protocol_http_1.HttpRequest.isInstance(request)) {\n return next(args);\n }\n const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ??\n TRACE_ID_HEADER_NAME;\n if (request.headers.hasOwnProperty(traceIdHeader)) {\n return next(args);\n }\n const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];\n const traceIdFromEnv = process.env[ENV_TRACE_ID];\n const invokeStore = await lambda_invoke_store_1.InvokeStore.getInstanceAsync();\n const traceIdFromInvokeStore = invokeStore?.getXRayTraceId();\n const traceId = traceIdFromInvokeStore ?? traceIdFromEnv;\n const nonEmptyString = (str) => typeof str === \"string\" && str.length > 0;\n if (nonEmptyString(functionName) && nonEmptyString(traceId)) {\n request.headers[TRACE_ID_HEADER_NAME] = traceId;\n }\n return next({\n ...args,\n request,\n });\n};\nexports.recursionDetectionMiddleware = recursionDetectionMiddleware;\n", - "'use strict';\n\nvar recursionDetectionMiddleware = require('./recursionDetectionMiddleware');\n\nconst recursionDetectionMiddlewareOptions = {\n step: \"build\",\n tags: [\"RECURSION_DETECTION\"],\n name: \"recursionDetectionMiddleware\",\n override: true,\n priority: \"low\",\n};\n\nconst getRecursionDetectionPlugin = (options) => ({\n applyToStack: (clientStack) => {\n clientStack.add(recursionDetectionMiddleware.recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions);\n },\n});\n\nexports.getRecursionDetectionPlugin = getRecursionDetectionPlugin;\nObject.keys(recursionDetectionMiddleware).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () { return recursionDetectionMiddleware[k]; }\n });\n});\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n getSmithyContext: () => getSmithyContext,\n normalizeProvider: () => normalizeProvider\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/getSmithyContext.ts\nvar import_types = require(\"@smithy/types\");\nvar getSmithyContext = /* @__PURE__ */ __name((context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {}), \"getSmithyContext\");\n\n// src/normalizeProvider.ts\nvar normalizeProvider = /* @__PURE__ */ __name((input) => {\n if (typeof input === \"function\")\n return input;\n const promisified = Promise.resolve(input);\n return () => promisified;\n}, \"normalizeProvider\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n getSmithyContext,\n normalizeProvider\n});\n\n", - "'use strict';\n\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {\n const { response } = await next(args);\n try {\n const parsed = await deserializer(response, options);\n return {\n response,\n output: parsed,\n };\n }\n catch (error) {\n Object.defineProperty(error, \"$response\", {\n value: response,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n if (!(\"$metadata\" in error)) {\n const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;\n try {\n error.message += \"\\n \" + hint;\n }\n catch (e) {\n if (!context.logger || context.logger?.constructor?.name === \"NoOpLogger\") {\n console.warn(hint);\n }\n else {\n context.logger?.warn?.(hint);\n }\n }\n if (typeof error.$responseBodyText !== \"undefined\") {\n if (error.$response) {\n error.$response.body = error.$responseBodyText;\n }\n }\n try {\n if (protocolHttp.HttpResponse.isInstance(response)) {\n const { headers = {} } = response;\n const headerEntries = Object.entries(headers);\n error.$metadata = {\n httpStatusCode: response.statusCode,\n requestId: findHeader(/^x-[\\w-]+-request-?id$/, headerEntries),\n extendedRequestId: findHeader(/^x-[\\w-]+-id-2$/, headerEntries),\n cfId: findHeader(/^x-[\\w-]+-cf-id$/, headerEntries),\n };\n }\n }\n catch (e) {\n }\n }\n throw error;\n }\n};\nconst findHeader = (pattern, headers) => {\n return (headers.find(([k]) => {\n return k.match(pattern);\n }) || [void 0, void 0])[1];\n};\n\nconst serializerMiddleware = (options, serializer) => (next, context) => async (args) => {\n const endpointConfig = options;\n const endpoint = context.endpointV2?.url && endpointConfig.urlParser\n ? async () => endpointConfig.urlParser(context.endpointV2.url)\n : endpointConfig.endpoint;\n if (!endpoint) {\n throw new Error(\"No valid endpoint provider available.\");\n }\n const request = await serializer(args.input, { ...options, endpoint });\n return next({\n ...args,\n request,\n });\n};\n\nconst deserializerMiddlewareOption = {\n name: \"deserializerMiddleware\",\n step: \"deserialize\",\n tags: [\"DESERIALIZER\"],\n override: true,\n};\nconst serializerMiddlewareOption = {\n name: \"serializerMiddleware\",\n step: \"serialize\",\n tags: [\"SERIALIZER\"],\n override: true,\n};\nfunction getSerdePlugin(config, serializer, deserializer) {\n return {\n applyToStack: (commandStack) => {\n commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);\n commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);\n },\n };\n}\n\nexports.deserializerMiddleware = deserializerMiddleware;\nexports.deserializerMiddlewareOption = deserializerMiddlewareOption;\nexports.getSerdePlugin = getSerdePlugin;\nexports.serializerMiddleware = serializerMiddleware;\nexports.serializerMiddlewareOption = serializerMiddlewareOption;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n isArrayBuffer: () => isArrayBuffer\n});\nmodule.exports = __toCommonJS(src_exports);\nvar isArrayBuffer = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === \"function\" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === \"[object ArrayBuffer]\", \"isArrayBuffer\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n isArrayBuffer\n});\n\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n fromArrayBuffer: () => fromArrayBuffer,\n fromString: () => fromString\n});\nmodule.exports = __toCommonJS(src_exports);\nvar import_is_array_buffer = require(\"@smithy/is-array-buffer\");\nvar import_buffer = require(\"buffer\");\nvar fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => {\n if (!(0, import_is_array_buffer.isArrayBuffer)(input)) {\n throw new TypeError(`The \"input\" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);\n }\n return import_buffer.Buffer.from(input, offset, length);\n}, \"fromArrayBuffer\");\nvar fromString = /* @__PURE__ */ __name((input, encoding) => {\n if (typeof input !== \"string\") {\n throw new TypeError(`The \"input\" argument must be of type string. Received type ${typeof input} (${input})`);\n }\n return encoding ? import_buffer.Buffer.from(input, encoding) : import_buffer.Buffer.from(input);\n}, \"fromString\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n fromArrayBuffer,\n fromString\n});\n\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromBase64 = void 0;\nconst util_buffer_from_1 = require(\"@smithy/util-buffer-from\");\nconst BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;\nconst fromBase64 = (input) => {\n if ((input.length * 3) % 4 !== 0) {\n throw new TypeError(`Incorrect padding on base64 string.`);\n }\n if (!BASE64_REGEX.exec(input)) {\n throw new TypeError(`Invalid base64 string.`);\n }\n const buffer = (0, util_buffer_from_1.fromString)(input, \"base64\");\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n};\nexports.fromBase64 = fromBase64;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n fromUtf8: () => fromUtf8,\n toUint8Array: () => toUint8Array,\n toUtf8: () => toUtf8\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/fromUtf8.ts\nvar import_util_buffer_from = require(\"@smithy/util-buffer-from\");\nvar fromUtf8 = /* @__PURE__ */ __name((input) => {\n const buf = (0, import_util_buffer_from.fromString)(input, \"utf8\");\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n}, \"fromUtf8\");\n\n// src/toUint8Array.ts\nvar toUint8Array = /* @__PURE__ */ __name((data) => {\n if (typeof data === \"string\") {\n return fromUtf8(data);\n }\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n }\n return new Uint8Array(data);\n}, \"toUint8Array\");\n\n// src/toUtf8.ts\n\nvar toUtf8 = /* @__PURE__ */ __name((input) => {\n if (typeof input === \"string\") {\n return input;\n }\n if (typeof input !== \"object\" || typeof input.byteOffset !== \"number\" || typeof input.byteLength !== \"number\") {\n throw new Error(\"@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.\");\n }\n return (0, import_util_buffer_from.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString(\"utf8\");\n}, \"toUtf8\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n fromUtf8,\n toUint8Array,\n toUtf8\n});\n\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBase64 = void 0;\nconst util_buffer_from_1 = require(\"@smithy/util-buffer-from\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst toBase64 = (_input) => {\n let input;\n if (typeof _input === \"string\") {\n input = (0, util_utf8_1.fromUtf8)(_input);\n }\n else {\n input = _input;\n }\n if (typeof input !== \"object\" || typeof input.byteOffset !== \"number\" || typeof input.byteLength !== \"number\") {\n throw new Error(\"@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.\");\n }\n return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString(\"base64\");\n};\nexports.toBase64 = toBase64;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\nmodule.exports = __toCommonJS(src_exports);\n__reExport(src_exports, require(\"././fromBase64\"), module.exports);\n__reExport(src_exports, require(\"././toBase64\"), module.exports);\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n fromBase64,\n toBase64\n});\n\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAwsChunkedEncodingStream = void 0;\nconst stream_1 = require(\"stream\");\nconst getAwsChunkedEncodingStream = (readableStream, options) => {\n const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;\n const checksumRequired = base64Encoder !== undefined &&\n checksumAlgorithmFn !== undefined &&\n checksumLocationName !== undefined &&\n streamHasher !== undefined;\n const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined;\n const awsChunkedEncodingStream = new stream_1.Readable({ read: () => { } });\n readableStream.on(\"data\", (data) => {\n const length = bodyLengthChecker(data) || 0;\n awsChunkedEncodingStream.push(`${length.toString(16)}\\r\\n`);\n awsChunkedEncodingStream.push(data);\n awsChunkedEncodingStream.push(\"\\r\\n\");\n });\n readableStream.on(\"end\", async () => {\n awsChunkedEncodingStream.push(`0\\r\\n`);\n if (checksumRequired) {\n const checksum = base64Encoder(await digest);\n awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\\r\\n`);\n awsChunkedEncodingStream.push(`\\r\\n`);\n }\n awsChunkedEncodingStream.push(null);\n });\n return awsChunkedEncodingStream;\n};\nexports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n escapeUri: () => escapeUri,\n escapeUriPath: () => escapeUriPath\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/escape-uri.ts\nvar escapeUri = /* @__PURE__ */ __name((uri) => (\n // AWS percent-encodes some extra non-standard characters in a URI\n encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode)\n), \"escapeUri\");\nvar hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, \"hexEncode\");\n\n// src/escape-uri-path.ts\nvar escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split(\"/\").map(escapeUri).join(\"/\"), \"escapeUriPath\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n escapeUri,\n escapeUriPath\n});\n\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n buildQueryString: () => buildQueryString\n});\nmodule.exports = __toCommonJS(src_exports);\nvar import_util_uri_escape = require(\"@smithy/util-uri-escape\");\nfunction buildQueryString(query) {\n const parts = [];\n for (let key of Object.keys(query).sort()) {\n const value = query[key];\n key = (0, import_util_uri_escape.escapeUri)(key);\n if (Array.isArray(value)) {\n for (let i = 0, iLen = value.length; i < iLen; i++) {\n parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`);\n }\n } else {\n let qsEntry = key;\n if (value || typeof value === \"string\") {\n qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`;\n }\n parts.push(qsEntry);\n }\n }\n return parts.join(\"&\");\n}\n__name(buildQueryString, \"buildQueryString\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n buildQueryString\n});\n\n", - "var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT,\n NodeHttp2Handler: () => NodeHttp2Handler,\n NodeHttpHandler: () => NodeHttpHandler,\n streamCollector: () => streamCollector\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/node-http-handler.ts\nvar import_protocol_http = require(\"@smithy/protocol-http\");\nvar import_querystring_builder = require(\"@smithy/querystring-builder\");\nvar import_http = require(\"http\");\nvar import_https = require(\"https\");\n\n// src/constants.ts\nvar NODEJS_TIMEOUT_ERROR_CODES = [\"ECONNRESET\", \"EPIPE\", \"ETIMEDOUT\"];\n\n// src/get-transformed-headers.ts\nvar getTransformedHeaders = /* @__PURE__ */ __name((headers) => {\n const transformedHeaders = {};\n for (const name of Object.keys(headers)) {\n const headerValues = headers[name];\n transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(\",\") : headerValues;\n }\n return transformedHeaders;\n}, \"getTransformedHeaders\");\n\n// src/set-connection-timeout.ts\nvar setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => {\n if (!timeoutInMs) {\n return;\n }\n const timeoutId = setTimeout(() => {\n request.destroy();\n reject(\n Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), {\n name: \"TimeoutError\"\n })\n );\n }, timeoutInMs);\n request.on(\"socket\", (socket) => {\n if (socket.connecting) {\n socket.on(\"connect\", () => {\n clearTimeout(timeoutId);\n });\n } else {\n clearTimeout(timeoutId);\n }\n });\n}, \"setConnectionTimeout\");\n\n// src/set-socket-keep-alive.ts\nvar setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => {\n if (keepAlive !== true) {\n return;\n }\n request.on(\"socket\", (socket) => {\n socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);\n });\n}, \"setSocketKeepAlive\");\n\n// src/set-socket-timeout.ts\nvar setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => {\n request.setTimeout(timeoutInMs, () => {\n request.destroy();\n reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: \"TimeoutError\" }));\n });\n}, \"setSocketTimeout\");\n\n// src/write-request-body.ts\nvar import_stream = require(\"stream\");\nvar MIN_WAIT_TIME = 1e3;\nasync function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) {\n const headers = request.headers ?? {};\n const expect = headers[\"Expect\"] || headers[\"expect\"];\n let timeoutId = -1;\n let hasError = false;\n if (expect === \"100-continue\") {\n await Promise.race([\n new Promise((resolve) => {\n timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));\n }),\n new Promise((resolve) => {\n httpRequest.on(\"continue\", () => {\n clearTimeout(timeoutId);\n resolve();\n });\n httpRequest.on(\"error\", () => {\n hasError = true;\n clearTimeout(timeoutId);\n resolve();\n });\n })\n ]);\n }\n if (!hasError) {\n writeBody(httpRequest, request.body);\n }\n}\n__name(writeRequestBody, \"writeRequestBody\");\nfunction writeBody(httpRequest, body) {\n if (body instanceof import_stream.Readable) {\n body.pipe(httpRequest);\n return;\n }\n if (body) {\n if (Buffer.isBuffer(body) || typeof body === \"string\") {\n httpRequest.end(body);\n return;\n }\n const uint8 = body;\n if (typeof uint8 === \"object\" && uint8.buffer && typeof uint8.byteOffset === \"number\" && typeof uint8.byteLength === \"number\") {\n httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));\n return;\n }\n httpRequest.end(Buffer.from(body));\n return;\n }\n httpRequest.end();\n}\n__name(writeBody, \"writeBody\");\n\n// src/node-http-handler.ts\nvar DEFAULT_REQUEST_TIMEOUT = 0;\nvar _NodeHttpHandler = class _NodeHttpHandler {\n constructor(options) {\n this.socketWarningTimestamp = 0;\n // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286\n this.metadata = { handlerProtocol: \"http/1.1\" };\n this.configProvider = new Promise((resolve, reject) => {\n if (typeof options === \"function\") {\n options().then((_options) => {\n resolve(this.resolveDefaultConfig(_options));\n }).catch(reject);\n } else {\n resolve(this.resolveDefaultConfig(options));\n }\n });\n }\n /**\n * @returns the input if it is an HttpHandler of any class,\n * or instantiates a new instance of this handler.\n */\n static create(instanceOrOptions) {\n if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === \"function\") {\n return instanceOrOptions;\n }\n return new _NodeHttpHandler(instanceOrOptions);\n }\n /**\n * @internal\n *\n * @param agent - http(s) agent in use by the NodeHttpHandler instance.\n * @returns timestamp of last emitted warning.\n */\n static checkSocketUsage(agent, socketWarningTimestamp) {\n var _a, _b;\n const { sockets, requests, maxSockets } = agent;\n if (typeof maxSockets !== \"number\" || maxSockets === Infinity) {\n return socketWarningTimestamp;\n }\n const interval = 15e3;\n if (Date.now() - interval < socketWarningTimestamp) {\n return socketWarningTimestamp;\n }\n if (sockets && requests) {\n for (const origin in sockets) {\n const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0;\n const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0;\n if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {\n console.warn(\n \"@smithy/node-http-handler:WARN\",\n `socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.`,\n \"See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html\",\n \"or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.\"\n );\n return Date.now();\n }\n }\n }\n return socketWarningTimestamp;\n }\n resolveDefaultConfig(options) {\n const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {};\n const keepAlive = true;\n const maxSockets = 50;\n return {\n connectionTimeout,\n requestTimeout: requestTimeout ?? socketTimeout,\n httpAgent: (() => {\n if (httpAgent instanceof import_http.Agent || typeof (httpAgent == null ? void 0 : httpAgent.destroy) === \"function\") {\n return httpAgent;\n }\n return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent });\n })(),\n httpsAgent: (() => {\n if (httpsAgent instanceof import_https.Agent || typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === \"function\") {\n return httpsAgent;\n }\n return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent });\n })()\n };\n }\n destroy() {\n var _a, _b, _c, _d;\n (_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy();\n (_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy();\n }\n async handle(request, { abortSignal } = {}) {\n if (!this.config) {\n this.config = await this.configProvider;\n }\n let socketCheckTimeoutId;\n return new Promise((_resolve, _reject) => {\n let writeRequestBodyPromise = void 0;\n const resolve = /* @__PURE__ */ __name(async (arg) => {\n await writeRequestBodyPromise;\n clearTimeout(socketCheckTimeoutId);\n _resolve(arg);\n }, \"resolve\");\n const reject = /* @__PURE__ */ __name(async (arg) => {\n await writeRequestBodyPromise;\n _reject(arg);\n }, \"reject\");\n if (!this.config) {\n throw new Error(\"Node HTTP request handler config is not resolved\");\n }\n if (abortSignal == null ? void 0 : abortSignal.aborted) {\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n reject(abortError);\n return;\n }\n const isSSL = request.protocol === \"https:\";\n const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;\n socketCheckTimeoutId = setTimeout(() => {\n this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp);\n }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3));\n const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {});\n let auth = void 0;\n if (request.username != null || request.password != null) {\n const username = request.username ?? \"\";\n const password = request.password ?? \"\";\n auth = `${username}:${password}`;\n }\n let path = request.path;\n if (queryString) {\n path += `?${queryString}`;\n }\n if (request.fragment) {\n path += `#${request.fragment}`;\n }\n const nodeHttpsOptions = {\n headers: request.headers,\n host: request.hostname,\n method: request.method,\n path,\n port: request.port,\n agent,\n auth\n };\n const requestFunc = isSSL ? import_https.request : import_http.request;\n const req = requestFunc(nodeHttpsOptions, (res) => {\n const httpResponse = new import_protocol_http.HttpResponse({\n statusCode: res.statusCode || -1,\n reason: res.statusMessage,\n headers: getTransformedHeaders(res.headers),\n body: res\n });\n resolve({ response: httpResponse });\n });\n req.on(\"error\", (err) => {\n if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {\n reject(Object.assign(err, { name: \"TimeoutError\" }));\n } else {\n reject(err);\n }\n });\n setConnectionTimeout(req, reject, this.config.connectionTimeout);\n setSocketTimeout(req, reject, this.config.requestTimeout);\n if (abortSignal) {\n abortSignal.onabort = () => {\n req.abort();\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n reject(abortError);\n };\n }\n const httpAgent = nodeHttpsOptions.agent;\n if (typeof httpAgent === \"object\" && \"keepAlive\" in httpAgent) {\n setSocketKeepAlive(req, {\n // @ts-expect-error keepAlive is not public on httpAgent.\n keepAlive: httpAgent.keepAlive,\n // @ts-expect-error keepAliveMsecs is not public on httpAgent.\n keepAliveMsecs: httpAgent.keepAliveMsecs\n });\n }\n writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch(_reject);\n });\n }\n updateHttpClientConfig(key, value) {\n this.config = void 0;\n this.configProvider = this.configProvider.then((config) => {\n return {\n ...config,\n [key]: value\n };\n });\n }\n httpHandlerConfigs() {\n return this.config ?? {};\n }\n};\n__name(_NodeHttpHandler, \"NodeHttpHandler\");\nvar NodeHttpHandler = _NodeHttpHandler;\n\n// src/node-http2-handler.ts\n\n\nvar import_http22 = require(\"http2\");\n\n// src/node-http2-connection-manager.ts\nvar import_http2 = __toESM(require(\"http2\"));\n\n// src/node-http2-connection-pool.ts\nvar _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool {\n constructor(sessions) {\n this.sessions = [];\n this.sessions = sessions ?? [];\n }\n poll() {\n if (this.sessions.length > 0) {\n return this.sessions.shift();\n }\n }\n offerLast(session) {\n this.sessions.push(session);\n }\n contains(session) {\n return this.sessions.includes(session);\n }\n remove(session) {\n this.sessions = this.sessions.filter((s) => s !== session);\n }\n [Symbol.iterator]() {\n return this.sessions[Symbol.iterator]();\n }\n destroy(connection) {\n for (const session of this.sessions) {\n if (session === connection) {\n if (!session.destroyed) {\n session.destroy();\n }\n }\n }\n }\n};\n__name(_NodeHttp2ConnectionPool, \"NodeHttp2ConnectionPool\");\nvar NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool;\n\n// src/node-http2-connection-manager.ts\nvar _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager {\n constructor(config) {\n this.sessionCache = /* @__PURE__ */ new Map();\n this.config = config;\n if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) {\n throw new RangeError(\"maxConcurrency must be greater than zero.\");\n }\n }\n lease(requestContext, connectionConfiguration) {\n const url = this.getUrlString(requestContext);\n const existingPool = this.sessionCache.get(url);\n if (existingPool) {\n const existingSession = existingPool.poll();\n if (existingSession && !this.config.disableConcurrency) {\n return existingSession;\n }\n }\n const session = import_http2.default.connect(url);\n if (this.config.maxConcurrency) {\n session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => {\n if (err) {\n throw new Error(\n \"Fail to set maxConcurrentStreams to \" + this.config.maxConcurrency + \"when creating new session for \" + requestContext.destination.toString()\n );\n }\n });\n }\n session.unref();\n const destroySessionCb = /* @__PURE__ */ __name(() => {\n session.destroy();\n this.deleteSession(url, session);\n }, \"destroySessionCb\");\n session.on(\"goaway\", destroySessionCb);\n session.on(\"error\", destroySessionCb);\n session.on(\"frameError\", destroySessionCb);\n session.on(\"close\", () => this.deleteSession(url, session));\n if (connectionConfiguration.requestTimeout) {\n session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb);\n }\n const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool();\n connectionPool.offerLast(session);\n this.sessionCache.set(url, connectionPool);\n return session;\n }\n /**\n * Delete a session from the connection pool.\n * @param authority The authority of the session to delete.\n * @param session The session to delete.\n */\n deleteSession(authority, session) {\n const existingConnectionPool = this.sessionCache.get(authority);\n if (!existingConnectionPool) {\n return;\n }\n if (!existingConnectionPool.contains(session)) {\n return;\n }\n existingConnectionPool.remove(session);\n this.sessionCache.set(authority, existingConnectionPool);\n }\n release(requestContext, session) {\n var _a;\n const cacheKey = this.getUrlString(requestContext);\n (_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session);\n }\n destroy() {\n for (const [key, connectionPool] of this.sessionCache) {\n for (const session of connectionPool) {\n if (!session.destroyed) {\n session.destroy();\n }\n connectionPool.remove(session);\n }\n this.sessionCache.delete(key);\n }\n }\n setMaxConcurrentStreams(maxConcurrentStreams) {\n if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) {\n throw new RangeError(\"maxConcurrentStreams must be greater than zero.\");\n }\n this.config.maxConcurrency = maxConcurrentStreams;\n }\n setDisableConcurrentStreams(disableConcurrentStreams) {\n this.config.disableConcurrency = disableConcurrentStreams;\n }\n getUrlString(request) {\n return request.destination.toString();\n }\n};\n__name(_NodeHttp2ConnectionManager, \"NodeHttp2ConnectionManager\");\nvar NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager;\n\n// src/node-http2-handler.ts\nvar _NodeHttp2Handler = class _NodeHttp2Handler {\n constructor(options) {\n this.metadata = { handlerProtocol: \"h2\" };\n this.connectionManager = new NodeHttp2ConnectionManager({});\n this.configProvider = new Promise((resolve, reject) => {\n if (typeof options === \"function\") {\n options().then((opts) => {\n resolve(opts || {});\n }).catch(reject);\n } else {\n resolve(options || {});\n }\n });\n }\n /**\n * @returns the input if it is an HttpHandler of any class,\n * or instantiates a new instance of this handler.\n */\n static create(instanceOrOptions) {\n if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === \"function\") {\n return instanceOrOptions;\n }\n return new _NodeHttp2Handler(instanceOrOptions);\n }\n destroy() {\n this.connectionManager.destroy();\n }\n async handle(request, { abortSignal } = {}) {\n if (!this.config) {\n this.config = await this.configProvider;\n this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false);\n if (this.config.maxConcurrentStreams) {\n this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams);\n }\n }\n const { requestTimeout, disableConcurrentStreams } = this.config;\n return new Promise((_resolve, _reject) => {\n var _a;\n let fulfilled = false;\n let writeRequestBodyPromise = void 0;\n const resolve = /* @__PURE__ */ __name(async (arg) => {\n await writeRequestBodyPromise;\n _resolve(arg);\n }, \"resolve\");\n const reject = /* @__PURE__ */ __name(async (arg) => {\n await writeRequestBodyPromise;\n _reject(arg);\n }, \"reject\");\n if (abortSignal == null ? void 0 : abortSignal.aborted) {\n fulfilled = true;\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n reject(abortError);\n return;\n }\n const { hostname, method, port, protocol, query } = request;\n let auth = \"\";\n if (request.username != null || request.password != null) {\n const username = request.username ?? \"\";\n const password = request.password ?? \"\";\n auth = `${username}:${password}@`;\n }\n const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : \"\"}`;\n const requestContext = { destination: new URL(authority) };\n const session = this.connectionManager.lease(requestContext, {\n requestTimeout: (_a = this.config) == null ? void 0 : _a.sessionTimeout,\n disableConcurrentStreams: disableConcurrentStreams || false\n });\n const rejectWithDestroy = /* @__PURE__ */ __name((err) => {\n if (disableConcurrentStreams) {\n this.destroySession(session);\n }\n fulfilled = true;\n reject(err);\n }, \"rejectWithDestroy\");\n const queryString = (0, import_querystring_builder.buildQueryString)(query || {});\n let path = request.path;\n if (queryString) {\n path += `?${queryString}`;\n }\n if (request.fragment) {\n path += `#${request.fragment}`;\n }\n const req = session.request({\n ...request.headers,\n [import_http22.constants.HTTP2_HEADER_PATH]: path,\n [import_http22.constants.HTTP2_HEADER_METHOD]: method\n });\n session.ref();\n req.on(\"response\", (headers) => {\n const httpResponse = new import_protocol_http.HttpResponse({\n statusCode: headers[\":status\"] || -1,\n headers: getTransformedHeaders(headers),\n body: req\n });\n fulfilled = true;\n resolve({ response: httpResponse });\n if (disableConcurrentStreams) {\n session.close();\n this.connectionManager.deleteSession(authority, session);\n }\n });\n if (requestTimeout) {\n req.setTimeout(requestTimeout, () => {\n req.close();\n const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`);\n timeoutError.name = \"TimeoutError\";\n rejectWithDestroy(timeoutError);\n });\n }\n if (abortSignal) {\n abortSignal.onabort = () => {\n req.close();\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n rejectWithDestroy(abortError);\n };\n }\n req.on(\"frameError\", (type, code, id) => {\n rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`));\n });\n req.on(\"error\", rejectWithDestroy);\n req.on(\"aborted\", () => {\n rejectWithDestroy(\n new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)\n );\n });\n req.on(\"close\", () => {\n session.unref();\n if (disableConcurrentStreams) {\n session.destroy();\n }\n if (!fulfilled) {\n rejectWithDestroy(new Error(\"Unexpected error: http2 request did not get a response\"));\n }\n });\n writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout);\n });\n }\n updateHttpClientConfig(key, value) {\n this.config = void 0;\n this.configProvider = this.configProvider.then((config) => {\n return {\n ...config,\n [key]: value\n };\n });\n }\n httpHandlerConfigs() {\n return this.config ?? {};\n }\n /**\n * Destroys a session.\n * @param session The session to destroy.\n */\n destroySession(session) {\n if (!session.destroyed) {\n session.destroy();\n }\n }\n};\n__name(_NodeHttp2Handler, \"NodeHttp2Handler\");\nvar NodeHttp2Handler = _NodeHttp2Handler;\n\n// src/stream-collector/collector.ts\n\nvar _Collector = class _Collector extends import_stream.Writable {\n constructor() {\n super(...arguments);\n this.bufferedBytes = [];\n }\n _write(chunk, encoding, callback) {\n this.bufferedBytes.push(chunk);\n callback();\n }\n};\n__name(_Collector, \"Collector\");\nvar Collector = _Collector;\n\n// src/stream-collector/index.ts\nvar streamCollector = /* @__PURE__ */ __name((stream) => new Promise((resolve, reject) => {\n const collector = new Collector();\n stream.pipe(collector);\n stream.on(\"error\", (err) => {\n collector.end();\n reject(err);\n });\n collector.on(\"error\", reject);\n collector.on(\"finish\", function() {\n const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));\n resolve(bytes);\n });\n}), \"streamCollector\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n DEFAULT_REQUEST_TIMEOUT,\n NodeHttpHandler,\n NodeHttp2Handler,\n streamCollector\n});\n\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sdkStreamMixin = void 0;\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_buffer_from_1 = require(\"@smithy/util-buffer-from\");\nconst stream_1 = require(\"stream\");\nconst util_1 = require(\"util\");\nconst ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = \"The stream has already been transformed.\";\nconst sdkStreamMixin = (stream) => {\n var _a, _b;\n if (!(stream instanceof stream_1.Readable)) {\n const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream;\n throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);\n }\n let transformed = false;\n const transformToByteArray = async () => {\n if (transformed) {\n throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);\n }\n transformed = true;\n return await (0, node_http_handler_1.streamCollector)(stream);\n };\n return Object.assign(stream, {\n transformToByteArray,\n transformToString: async (encoding) => {\n const buf = await transformToByteArray();\n if (encoding === undefined || Buffer.isEncoding(encoding)) {\n return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);\n }\n else {\n const decoder = new util_1.TextDecoder(encoding);\n return decoder.decode(buf);\n }\n },\n transformToWebStream: () => {\n if (transformed) {\n throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);\n }\n if (stream.readableFlowing !== null) {\n throw new Error(\"The stream has been consumed by other callbacks.\");\n }\n if (typeof stream_1.Readable.toWeb !== \"function\") {\n throw new Error(\"Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.\");\n }\n transformed = true;\n return stream_1.Readable.toWeb(stream);\n },\n });\n};\nexports.sdkStreamMixin = sdkStreamMixin;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n Uint8ArrayBlobAdapter: () => Uint8ArrayBlobAdapter\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/blob/transforms.ts\nvar import_util_base64 = require(\"@smithy/util-base64\");\nvar import_util_utf8 = require(\"@smithy/util-utf8\");\nfunction transformToString(payload, encoding = \"utf-8\") {\n if (encoding === \"base64\") {\n return (0, import_util_base64.toBase64)(payload);\n }\n return (0, import_util_utf8.toUtf8)(payload);\n}\n__name(transformToString, \"transformToString\");\nfunction transformFromString(str, encoding) {\n if (encoding === \"base64\") {\n return Uint8ArrayBlobAdapter.mutate((0, import_util_base64.fromBase64)(str));\n }\n return Uint8ArrayBlobAdapter.mutate((0, import_util_utf8.fromUtf8)(str));\n}\n__name(transformFromString, \"transformFromString\");\n\n// src/blob/Uint8ArrayBlobAdapter.ts\nvar _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {\n /**\n * @param source - such as a string or Stream.\n * @returns a new Uint8ArrayBlobAdapter extending Uint8Array.\n */\n static fromString(source, encoding = \"utf-8\") {\n switch (typeof source) {\n case \"string\":\n return transformFromString(source, encoding);\n default:\n throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);\n }\n }\n /**\n * @param source - Uint8Array to be mutated.\n * @returns the same Uint8Array but with prototype switched to Uint8ArrayBlobAdapter.\n */\n static mutate(source) {\n Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype);\n return source;\n }\n /**\n * @param encoding - default 'utf-8'.\n * @returns the blob as string.\n */\n transformToString(encoding = \"utf-8\") {\n return transformToString(this, encoding);\n }\n};\n__name(_Uint8ArrayBlobAdapter, \"Uint8ArrayBlobAdapter\");\nvar Uint8ArrayBlobAdapter = _Uint8ArrayBlobAdapter;\n\n// src/index.ts\n__reExport(src_exports, require(\"././getAwsChunkedEncodingStream\"), module.exports);\n__reExport(src_exports, require(\"././sdk-stream-mixin\"), module.exports);\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n Uint8ArrayBlobAdapter,\n getAwsChunkedEncodingStream,\n sdkStreamMixin\n});\n\n", - "'use strict';\n\nvar protocolHttp = require('@smithy/protocol-http');\nvar utilMiddleware = require('@smithy/util-middleware');\n\nconst deref = (schemaRef) => {\n if (typeof schemaRef === \"function\") {\n return schemaRef();\n }\n return schemaRef;\n};\n\nconst operation = (namespace, name, traits, input, output) => ({\n name,\n namespace,\n traits,\n input,\n output,\n});\n\nconst schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {\n const { response } = await next(args);\n const { operationSchema } = utilMiddleware.getSmithyContext(context);\n const [, ns, n, t, i, o] = operationSchema ?? [];\n try {\n const parsed = await config.protocol.deserializeResponse(operation(ns, n, t, i, o), {\n ...config,\n ...context,\n }, response);\n return {\n response,\n output: parsed,\n };\n }\n catch (error) {\n Object.defineProperty(error, \"$response\", {\n value: response,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n if (!(\"$metadata\" in error)) {\n const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;\n try {\n error.message += \"\\n \" + hint;\n }\n catch (e) {\n if (!context.logger || context.logger?.constructor?.name === \"NoOpLogger\") {\n console.warn(hint);\n }\n else {\n context.logger?.warn?.(hint);\n }\n }\n if (typeof error.$responseBodyText !== \"undefined\") {\n if (error.$response) {\n error.$response.body = error.$responseBodyText;\n }\n }\n try {\n if (protocolHttp.HttpResponse.isInstance(response)) {\n const { headers = {} } = response;\n const headerEntries = Object.entries(headers);\n error.$metadata = {\n httpStatusCode: response.statusCode,\n requestId: findHeader(/^x-[\\w-]+-request-?id$/, headerEntries),\n extendedRequestId: findHeader(/^x-[\\w-]+-id-2$/, headerEntries),\n cfId: findHeader(/^x-[\\w-]+-cf-id$/, headerEntries),\n };\n }\n }\n catch (e) {\n }\n }\n throw error;\n }\n};\nconst findHeader = (pattern, headers) => {\n return (headers.find(([k]) => {\n return k.match(pattern);\n }) || [void 0, void 0])[1];\n};\n\nconst schemaSerializationMiddleware = (config) => (next, context) => async (args) => {\n const { operationSchema } = utilMiddleware.getSmithyContext(context);\n const [, ns, n, t, i, o] = operationSchema ?? [];\n const endpoint = context.endpointV2?.url && config.urlParser\n ? async () => config.urlParser(context.endpointV2.url)\n : config.endpoint;\n const request = await config.protocol.serializeRequest(operation(ns, n, t, i, o), args.input, {\n ...config,\n ...context,\n endpoint,\n });\n return next({\n ...args,\n request,\n });\n};\n\nconst deserializerMiddlewareOption = {\n name: \"deserializerMiddleware\",\n step: \"deserialize\",\n tags: [\"DESERIALIZER\"],\n override: true,\n};\nconst serializerMiddlewareOption = {\n name: \"serializerMiddleware\",\n step: \"serialize\",\n tags: [\"SERIALIZER\"],\n override: true,\n};\nfunction getSchemaSerdePlugin(config) {\n return {\n applyToStack: (commandStack) => {\n commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption);\n commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption);\n config.protocol.setSerdeContext(config);\n },\n };\n}\n\nclass Schema {\n name;\n namespace;\n traits;\n static assign(instance, values) {\n const schema = Object.assign(instance, values);\n return schema;\n }\n static [Symbol.hasInstance](lhs) {\n const isPrototype = this.prototype.isPrototypeOf(lhs);\n if (!isPrototype && typeof lhs === \"object\" && lhs !== null) {\n const list = lhs;\n return list.symbol === this.symbol;\n }\n return isPrototype;\n }\n getName() {\n return this.namespace + \"#\" + this.name;\n }\n}\n\nclass ListSchema extends Schema {\n static symbol = Symbol.for(\"@smithy/lis\");\n name;\n traits;\n valueSchema;\n symbol = ListSchema.symbol;\n}\nconst list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), {\n name,\n namespace,\n traits,\n valueSchema,\n});\n\nclass MapSchema extends Schema {\n static symbol = Symbol.for(\"@smithy/map\");\n name;\n traits;\n keySchema;\n valueSchema;\n symbol = MapSchema.symbol;\n}\nconst map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), {\n name,\n namespace,\n traits,\n keySchema,\n valueSchema,\n});\n\nclass OperationSchema extends Schema {\n static symbol = Symbol.for(\"@smithy/ope\");\n name;\n traits;\n input;\n output;\n symbol = OperationSchema.symbol;\n}\nconst op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), {\n name,\n namespace,\n traits,\n input,\n output,\n});\n\nclass StructureSchema extends Schema {\n static symbol = Symbol.for(\"@smithy/str\");\n name;\n traits;\n memberNames;\n memberList;\n symbol = StructureSchema.symbol;\n}\nconst struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), {\n name,\n namespace,\n traits,\n memberNames,\n memberList,\n});\n\nclass ErrorSchema extends StructureSchema {\n static symbol = Symbol.for(\"@smithy/err\");\n ctor;\n symbol = ErrorSchema.symbol;\n}\nconst error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), {\n name,\n namespace,\n traits,\n memberNames,\n memberList,\n ctor: null,\n});\n\nfunction translateTraits(indicator) {\n if (typeof indicator === \"object\") {\n return indicator;\n }\n indicator = indicator | 0;\n const traits = {};\n let i = 0;\n for (const trait of [\n \"httpLabel\",\n \"idempotent\",\n \"idempotencyToken\",\n \"sensitive\",\n \"httpPayload\",\n \"httpResponseCode\",\n \"httpQueryParams\",\n ]) {\n if (((indicator >> i++) & 1) === 1) {\n traits[trait] = 1;\n }\n }\n return traits;\n}\n\nclass NormalizedSchema {\n ref;\n memberName;\n static symbol = Symbol.for(\"@smithy/nor\");\n symbol = NormalizedSchema.symbol;\n name;\n schema;\n _isMemberSchema;\n traits;\n memberTraits;\n normalizedTraits;\n constructor(ref, memberName) {\n this.ref = ref;\n this.memberName = memberName;\n const traitStack = [];\n let _ref = ref;\n let schema = ref;\n this._isMemberSchema = false;\n while (isMemberSchema(_ref)) {\n traitStack.push(_ref[1]);\n _ref = _ref[0];\n schema = deref(_ref);\n this._isMemberSchema = true;\n }\n if (traitStack.length > 0) {\n this.memberTraits = {};\n for (let i = traitStack.length - 1; i >= 0; --i) {\n const traitSet = traitStack[i];\n Object.assign(this.memberTraits, translateTraits(traitSet));\n }\n }\n else {\n this.memberTraits = 0;\n }\n if (schema instanceof NormalizedSchema) {\n const computedMemberTraits = this.memberTraits;\n Object.assign(this, schema);\n this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());\n this.normalizedTraits = void 0;\n this.memberName = memberName ?? schema.memberName;\n return;\n }\n this.schema = deref(schema);\n if (isStaticSchema(this.schema)) {\n this.name = `${this.schema[1]}#${this.schema[2]}`;\n this.traits = this.schema[3];\n }\n else {\n this.name = this.memberName ?? String(schema);\n this.traits = 0;\n }\n if (this._isMemberSchema && !memberName) {\n throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);\n }\n }\n static [Symbol.hasInstance](lhs) {\n const isPrototype = this.prototype.isPrototypeOf(lhs);\n if (!isPrototype && typeof lhs === \"object\" && lhs !== null) {\n const ns = lhs;\n return ns.symbol === this.symbol;\n }\n return isPrototype;\n }\n static of(ref) {\n const sc = deref(ref);\n if (sc instanceof NormalizedSchema) {\n return sc;\n }\n if (isMemberSchema(sc)) {\n const [ns, traits] = sc;\n if (ns instanceof NormalizedSchema) {\n Object.assign(ns.getMergedTraits(), translateTraits(traits));\n return ns;\n }\n throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);\n }\n return new NormalizedSchema(sc);\n }\n getSchema() {\n const sc = this.schema;\n if (sc[0] === 0) {\n return sc[4];\n }\n return sc;\n }\n getName(withNamespace = false) {\n const { name } = this;\n const short = !withNamespace && name && name.includes(\"#\");\n return short ? name.split(\"#\")[1] : name || undefined;\n }\n getMemberName() {\n return this.memberName;\n }\n isMemberSchema() {\n return this._isMemberSchema;\n }\n isListSchema() {\n const sc = this.getSchema();\n return typeof sc === \"number\"\n ? sc >= 64 && sc < 128\n : sc[0] === 1;\n }\n isMapSchema() {\n const sc = this.getSchema();\n return typeof sc === \"number\"\n ? sc >= 128 && sc <= 0b1111_1111\n : sc[0] === 2;\n }\n isStructSchema() {\n const sc = this.getSchema();\n return (sc[0] === 3 ||\n sc[0] === -3);\n }\n isBlobSchema() {\n const sc = this.getSchema();\n return sc === 21 || sc === 42;\n }\n isTimestampSchema() {\n const sc = this.getSchema();\n return (typeof sc === \"number\" &&\n sc >= 4 &&\n sc <= 7);\n }\n isUnitSchema() {\n return this.getSchema() === \"unit\";\n }\n isDocumentSchema() {\n return this.getSchema() === 15;\n }\n isStringSchema() {\n return this.getSchema() === 0;\n }\n isBooleanSchema() {\n return this.getSchema() === 2;\n }\n isNumericSchema() {\n return this.getSchema() === 1;\n }\n isBigIntegerSchema() {\n return this.getSchema() === 17;\n }\n isBigDecimalSchema() {\n return this.getSchema() === 19;\n }\n isStreaming() {\n const { streaming } = this.getMergedTraits();\n return !!streaming || this.getSchema() === 42;\n }\n isIdempotencyToken() {\n const match = (traits) => (traits & 0b0100) === 0b0100 ||\n !!traits?.idempotencyToken;\n const { normalizedTraits, traits, memberTraits } = this;\n return match(normalizedTraits) || match(traits) || match(memberTraits);\n }\n getMergedTraits() {\n return (this.normalizedTraits ??\n (this.normalizedTraits = {\n ...this.getOwnTraits(),\n ...this.getMemberTraits(),\n }));\n }\n getMemberTraits() {\n return translateTraits(this.memberTraits);\n }\n getOwnTraits() {\n return translateTraits(this.traits);\n }\n getKeySchema() {\n const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()];\n if (!isDoc && !isMap) {\n throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);\n }\n const schema = this.getSchema();\n const memberSchema = isDoc\n ? 15\n : schema[4] ?? 0;\n return member([memberSchema, 0], \"key\");\n }\n getValueSchema() {\n const sc = this.getSchema();\n const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()];\n const memberSchema = typeof sc === \"number\"\n ? 0b0011_1111 & sc\n : sc && typeof sc === \"object\" && (isMap || isList)\n ? sc[3 + sc[0]]\n : isDoc\n ? 15\n : void 0;\n if (memberSchema != null) {\n return member([memberSchema, 0], isMap ? \"value\" : \"member\");\n }\n throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);\n }\n getMemberSchema(memberName) {\n const struct = this.getSchema();\n if (this.isStructSchema() && struct[4].includes(memberName)) {\n const i = struct[4].indexOf(memberName);\n const memberSchema = struct[5][i];\n return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName);\n }\n if (this.isDocumentSchema()) {\n return member([15, 0], memberName);\n }\n throw new Error(`@smithy/core/schema - ${this.getName(true)} has no no member=${memberName}.`);\n }\n getMemberSchemas() {\n const buffer = {};\n try {\n for (const [k, v] of this.structIterator()) {\n buffer[k] = v;\n }\n }\n catch (ignored) { }\n return buffer;\n }\n getEventStreamMember() {\n if (this.isStructSchema()) {\n for (const [memberName, memberSchema] of this.structIterator()) {\n if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {\n return memberName;\n }\n }\n }\n return \"\";\n }\n *structIterator() {\n if (this.isUnitSchema()) {\n return;\n }\n if (!this.isStructSchema()) {\n throw new Error(\"@smithy/core/schema - cannot iterate non-struct schema.\");\n }\n const struct = this.getSchema();\n for (let i = 0; i < struct[4].length; ++i) {\n yield [struct[4][i], member([struct[5][i], 0], struct[4][i])];\n }\n }\n}\nfunction member(memberSchema, memberName) {\n if (memberSchema instanceof NormalizedSchema) {\n return Object.assign(memberSchema, {\n memberName,\n _isMemberSchema: true,\n });\n }\n const internalCtorAccess = NormalizedSchema;\n return new internalCtorAccess(memberSchema, memberName);\n}\nconst isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2;\nconst isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5;\n\nclass SimpleSchema extends Schema {\n static symbol = Symbol.for(\"@smithy/sim\");\n name;\n schemaRef;\n traits;\n symbol = SimpleSchema.symbol;\n}\nconst sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), {\n name,\n namespace,\n traits,\n schemaRef,\n});\nconst simAdapter = (namespace, name, traits, schemaRef) => Schema.assign(new SimpleSchema(), {\n name,\n namespace,\n traits,\n schemaRef,\n});\n\nconst SCHEMA = {\n BLOB: 0b0001_0101,\n STREAMING_BLOB: 0b0010_1010,\n BOOLEAN: 0b0000_0010,\n STRING: 0b0000_0000,\n NUMERIC: 0b0000_0001,\n BIG_INTEGER: 0b0001_0001,\n BIG_DECIMAL: 0b0001_0011,\n DOCUMENT: 0b0000_1111,\n TIMESTAMP_DEFAULT: 0b0000_0100,\n TIMESTAMP_DATE_TIME: 0b0000_0101,\n TIMESTAMP_HTTP_DATE: 0b0000_0110,\n TIMESTAMP_EPOCH_SECONDS: 0b0000_0111,\n LIST_MODIFIER: 0b0100_0000,\n MAP_MODIFIER: 0b1000_0000,\n};\n\nclass TypeRegistry {\n namespace;\n schemas;\n exceptions;\n static registries = new Map();\n constructor(namespace, schemas = new Map(), exceptions = new Map()) {\n this.namespace = namespace;\n this.schemas = schemas;\n this.exceptions = exceptions;\n }\n static for(namespace) {\n if (!TypeRegistry.registries.has(namespace)) {\n TypeRegistry.registries.set(namespace, new TypeRegistry(namespace));\n }\n return TypeRegistry.registries.get(namespace);\n }\n register(shapeId, schema) {\n const qualifiedName = this.normalizeShapeId(shapeId);\n const registry = TypeRegistry.for(qualifiedName.split(\"#\")[0]);\n registry.schemas.set(qualifiedName, schema);\n }\n getSchema(shapeId) {\n const id = this.normalizeShapeId(shapeId);\n if (!this.schemas.has(id)) {\n throw new Error(`@smithy/core/schema - schema not found for ${id}`);\n }\n return this.schemas.get(id);\n }\n registerError(es, ctor) {\n const $error = es;\n const registry = TypeRegistry.for($error[1]);\n registry.schemas.set($error[1] + \"#\" + $error[2], $error);\n registry.exceptions.set($error, ctor);\n }\n getErrorCtor(es) {\n const $error = es;\n const registry = TypeRegistry.for($error[1]);\n return registry.exceptions.get($error);\n }\n getBaseException() {\n for (const exceptionKey of this.exceptions.keys()) {\n if (Array.isArray(exceptionKey)) {\n const [, ns, name] = exceptionKey;\n const id = ns + \"#\" + name;\n if (id.startsWith(\"smithy.ts.sdk.synthetic.\") && id.endsWith(\"ServiceException\")) {\n return exceptionKey;\n }\n }\n }\n return undefined;\n }\n find(predicate) {\n return [...this.schemas.values()].find(predicate);\n }\n clear() {\n this.schemas.clear();\n this.exceptions.clear();\n }\n normalizeShapeId(shapeId) {\n if (shapeId.includes(\"#\")) {\n return shapeId;\n }\n return this.namespace + \"#\" + shapeId;\n }\n}\n\nexports.ErrorSchema = ErrorSchema;\nexports.ListSchema = ListSchema;\nexports.MapSchema = MapSchema;\nexports.NormalizedSchema = NormalizedSchema;\nexports.OperationSchema = OperationSchema;\nexports.SCHEMA = SCHEMA;\nexports.Schema = Schema;\nexports.SimpleSchema = SimpleSchema;\nexports.StructureSchema = StructureSchema;\nexports.TypeRegistry = TypeRegistry;\nexports.deref = deref;\nexports.deserializerMiddlewareOption = deserializerMiddlewareOption;\nexports.error = error;\nexports.getSchemaSerdePlugin = getSchemaSerdePlugin;\nexports.isStaticSchema = isStaticSchema;\nexports.list = list;\nexports.map = map;\nexports.op = op;\nexports.operation = operation;\nexports.serializerMiddlewareOption = serializerMiddlewareOption;\nexports.sim = sim;\nexports.simAdapter = simAdapter;\nexports.struct = struct;\nexports.translateTraits = translateTraits;\n", - "/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __esDecorate;\r\nvar __runInitializers;\r\nvar __propKey;\r\nvar __setFunctionName;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __classPrivateFieldIn;\r\nvar __createBinding;\r\nvar __addDisposableResource;\r\nvar __disposeResources;\r\nvar __rewriteRelativeImportExtension;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n };\r\n\r\n __runInitializers = function (thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n };\r\n\r\n __propKey = function (x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n };\r\n\r\n __setFunctionName = function (f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n var ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n __classPrivateFieldIn = function (state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n };\r\n\r\n __addDisposableResource = function (env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n };\r\n\r\n var _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n };\r\n\r\n __disposeResources = function (env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n };\r\n\r\n __rewriteRelativeImportExtension = function (path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__esDecorate\", __esDecorate);\r\n exporter(\"__runInitializers\", __runInitializers);\r\n exporter(\"__propKey\", __propKey);\r\n exporter(\"__setFunctionName\", __setFunctionName);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n exporter(\"__classPrivateFieldIn\", __classPrivateFieldIn);\r\n exporter(\"__addDisposableResource\", __addDisposableResource);\r\n exporter(\"__disposeResources\", __disposeResources);\r\n exporter(\"__rewriteRelativeImportExtension\", __rewriteRelativeImportExtension);\r\n});\r\n\r\n0 && (module.exports = {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __exportStar: __exportStar,\r\n __createBinding: __createBinding,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n});\r\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.randomUUID = void 0;\nconst tslib_1 = require(\"tslib\");\nconst crypto_1 = tslib_1.__importDefault(require(\"crypto\"));\nexports.randomUUID = crypto_1.default.randomUUID.bind(crypto_1.default);\n", - "'use strict';\n\nvar randomUUID = require('./randomUUID');\n\nconst decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, \"0\"));\nconst v4 = () => {\n if (randomUUID.randomUUID) {\n return randomUUID.randomUUID();\n }\n const rnds = new Uint8Array(16);\n crypto.getRandomValues(rnds);\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n return (decimalToHex[rnds[0]] +\n decimalToHex[rnds[1]] +\n decimalToHex[rnds[2]] +\n decimalToHex[rnds[3]] +\n \"-\" +\n decimalToHex[rnds[4]] +\n decimalToHex[rnds[5]] +\n \"-\" +\n decimalToHex[rnds[6]] +\n decimalToHex[rnds[7]] +\n \"-\" +\n decimalToHex[rnds[8]] +\n decimalToHex[rnds[9]] +\n \"-\" +\n decimalToHex[rnds[10]] +\n decimalToHex[rnds[11]] +\n decimalToHex[rnds[12]] +\n decimalToHex[rnds[13]] +\n decimalToHex[rnds[14]] +\n decimalToHex[rnds[15]]);\n};\n\nexports.v4 = v4;\n", - "'use strict';\n\nvar uuid = require('@smithy/uuid');\n\nconst copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source;\n\nconst parseBoolean = (value) => {\n switch (value) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n default:\n throw new Error(`Unable to parse boolean value \"${value}\"`);\n }\n};\nconst expectBoolean = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n if (typeof value === \"number\") {\n if (value === 0 || value === 1) {\n logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));\n }\n if (value === 0) {\n return false;\n }\n if (value === 1) {\n return true;\n }\n }\n if (typeof value === \"string\") {\n const lower = value.toLowerCase();\n if (lower === \"false\" || lower === \"true\") {\n logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));\n }\n if (lower === \"false\") {\n return false;\n }\n if (lower === \"true\") {\n return true;\n }\n }\n if (typeof value === \"boolean\") {\n return value;\n }\n throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);\n};\nconst expectNumber = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n if (typeof value === \"string\") {\n const parsed = parseFloat(value);\n if (!Number.isNaN(parsed)) {\n if (String(parsed) !== String(value)) {\n logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));\n }\n return parsed;\n }\n }\n if (typeof value === \"number\") {\n return value;\n }\n throw new TypeError(`Expected number, got ${typeof value}: ${value}`);\n};\nconst MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));\nconst expectFloat32 = (value) => {\n const expected = expectNumber(value);\n if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {\n if (Math.abs(expected) > MAX_FLOAT) {\n throw new TypeError(`Expected 32-bit float, got ${value}`);\n }\n }\n return expected;\n};\nconst expectLong = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n if (Number.isInteger(value) && !Number.isNaN(value)) {\n return value;\n }\n throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);\n};\nconst expectInt = expectLong;\nconst expectInt32 = (value) => expectSizedInt(value, 32);\nconst expectShort = (value) => expectSizedInt(value, 16);\nconst expectByte = (value) => expectSizedInt(value, 8);\nconst expectSizedInt = (value, size) => {\n const expected = expectLong(value);\n if (expected !== undefined && castInt(expected, size) !== expected) {\n throw new TypeError(`Expected ${size}-bit integer, got ${value}`);\n }\n return expected;\n};\nconst castInt = (value, size) => {\n switch (size) {\n case 32:\n return Int32Array.of(value)[0];\n case 16:\n return Int16Array.of(value)[0];\n case 8:\n return Int8Array.of(value)[0];\n }\n};\nconst expectNonNull = (value, location) => {\n if (value === null || value === undefined) {\n if (location) {\n throw new TypeError(`Expected a non-null value for ${location}`);\n }\n throw new TypeError(\"Expected a non-null value\");\n }\n return value;\n};\nconst expectObject = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n if (typeof value === \"object\" && !Array.isArray(value)) {\n return value;\n }\n const receivedType = Array.isArray(value) ? \"array\" : typeof value;\n throw new TypeError(`Expected object, got ${receivedType}: ${value}`);\n};\nconst expectString = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n if (typeof value === \"string\") {\n return value;\n }\n if ([\"boolean\", \"number\", \"bigint\"].includes(typeof value)) {\n logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));\n return String(value);\n }\n throw new TypeError(`Expected string, got ${typeof value}: ${value}`);\n};\nconst expectUnion = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n const asObject = expectObject(value);\n const setKeys = Object.entries(asObject)\n .filter(([, v]) => v != null)\n .map(([k]) => k);\n if (setKeys.length === 0) {\n throw new TypeError(`Unions must have exactly one non-null member. None were found.`);\n }\n if (setKeys.length > 1) {\n throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);\n }\n return asObject;\n};\nconst strictParseDouble = (value) => {\n if (typeof value == \"string\") {\n return expectNumber(parseNumber(value));\n }\n return expectNumber(value);\n};\nconst strictParseFloat = strictParseDouble;\nconst strictParseFloat32 = (value) => {\n if (typeof value == \"string\") {\n return expectFloat32(parseNumber(value));\n }\n return expectFloat32(value);\n};\nconst NUMBER_REGEX = /(-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|(-?Infinity)|(NaN)/g;\nconst parseNumber = (value) => {\n const matches = value.match(NUMBER_REGEX);\n if (matches === null || matches[0].length !== value.length) {\n throw new TypeError(`Expected real number, got implicit NaN`);\n }\n return parseFloat(value);\n};\nconst limitedParseDouble = (value) => {\n if (typeof value == \"string\") {\n return parseFloatString(value);\n }\n return expectNumber(value);\n};\nconst handleFloat = limitedParseDouble;\nconst limitedParseFloat = limitedParseDouble;\nconst limitedParseFloat32 = (value) => {\n if (typeof value == \"string\") {\n return parseFloatString(value);\n }\n return expectFloat32(value);\n};\nconst parseFloatString = (value) => {\n switch (value) {\n case \"NaN\":\n return NaN;\n case \"Infinity\":\n return Infinity;\n case \"-Infinity\":\n return -Infinity;\n default:\n throw new Error(`Unable to parse float value: ${value}`);\n }\n};\nconst strictParseLong = (value) => {\n if (typeof value === \"string\") {\n return expectLong(parseNumber(value));\n }\n return expectLong(value);\n};\nconst strictParseInt = strictParseLong;\nconst strictParseInt32 = (value) => {\n if (typeof value === \"string\") {\n return expectInt32(parseNumber(value));\n }\n return expectInt32(value);\n};\nconst strictParseShort = (value) => {\n if (typeof value === \"string\") {\n return expectShort(parseNumber(value));\n }\n return expectShort(value);\n};\nconst strictParseByte = (value) => {\n if (typeof value === \"string\") {\n return expectByte(parseNumber(value));\n }\n return expectByte(value);\n};\nconst stackTraceWarning = (message) => {\n return String(new TypeError(message).stack || message)\n .split(\"\\n\")\n .slice(0, 5)\n .filter((s) => !s.includes(\"stackTraceWarning\"))\n .join(\"\\n\");\n};\nconst logger = {\n warn: console.warn,\n};\n\nconst DAYS = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\nfunction dateToUtcString(date) {\n const year = date.getUTCFullYear();\n const month = date.getUTCMonth();\n const dayOfWeek = date.getUTCDay();\n const dayOfMonthInt = date.getUTCDate();\n const hoursInt = date.getUTCHours();\n const minutesInt = date.getUTCMinutes();\n const secondsInt = date.getUTCSeconds();\n const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;\n const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;\n const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;\n const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;\n return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;\n}\nconst RFC3339 = new RegExp(/^(\\d{4})-(\\d{2})-(\\d{2})[tT](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?[zZ]$/);\nconst parseRfc3339DateTime = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n if (typeof value !== \"string\") {\n throw new TypeError(\"RFC-3339 date-times must be expressed as strings\");\n }\n const match = RFC3339.exec(value);\n if (!match) {\n throw new TypeError(\"Invalid RFC-3339 date-time value\");\n }\n const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n const year = strictParseShort(stripLeadingZeroes(yearStr));\n const month = parseDateValue(monthStr, \"month\", 1, 12);\n const day = parseDateValue(dayStr, \"day\", 1, 31);\n return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });\n};\nconst RFC3339_WITH_OFFSET$1 = new RegExp(/^(\\d{4})-(\\d{2})-(\\d{2})[tT](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?(([-+]\\d{2}\\:\\d{2})|[zZ])$/);\nconst parseRfc3339DateTimeWithOffset = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n if (typeof value !== \"string\") {\n throw new TypeError(\"RFC-3339 date-times must be expressed as strings\");\n }\n const match = RFC3339_WITH_OFFSET$1.exec(value);\n if (!match) {\n throw new TypeError(\"Invalid RFC-3339 date-time value\");\n }\n const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;\n const year = strictParseShort(stripLeadingZeroes(yearStr));\n const month = parseDateValue(monthStr, \"month\", 1, 12);\n const day = parseDateValue(dayStr, \"day\", 1, 31);\n const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });\n if (offsetStr.toUpperCase() != \"Z\") {\n date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));\n }\n return date;\n};\nconst IMF_FIXDATE$1 = 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$/);\nconst RFC_850_DATE$1 = 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$/);\nconst ASC_TIME$1 = 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})$/);\nconst parseRfc7231DateTime = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n if (typeof value !== \"string\") {\n throw new TypeError(\"RFC-7231 date-times must be expressed as strings\");\n }\n let match = IMF_FIXDATE$1.exec(value);\n if (match) {\n const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, \"day\", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });\n }\n match = RFC_850_DATE$1.exec(value);\n if (match) {\n const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, \"day\", 1, 31), {\n hours,\n minutes,\n seconds,\n fractionalMilliseconds,\n }));\n }\n match = ASC_TIME$1.exec(value);\n if (match) {\n const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;\n return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), \"day\", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });\n }\n throw new TypeError(\"Invalid RFC-7231 date-time value\");\n};\nconst parseEpochTimestamp = (value) => {\n if (value === null || value === undefined) {\n return undefined;\n }\n let valueAsDouble;\n if (typeof value === \"number\") {\n valueAsDouble = value;\n }\n else if (typeof value === \"string\") {\n valueAsDouble = strictParseDouble(value);\n }\n else if (typeof value === \"object\" && value.tag === 1) {\n valueAsDouble = value.value;\n }\n else {\n throw new TypeError(\"Epoch timestamps must be expressed as floating point numbers or their string representation\");\n }\n if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) {\n throw new TypeError(\"Epoch timestamps must be valid, non-Infinite, non-NaN numerics\");\n }\n return new Date(Math.round(valueAsDouble * 1000));\n};\nconst buildDate = (year, month, day, time) => {\n const adjustedMonth = month - 1;\n validateDayOfMonth(year, adjustedMonth, day);\n return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, \"hour\", 0, 23), parseDateValue(time.minutes, \"minute\", 0, 59), parseDateValue(time.seconds, \"seconds\", 0, 60), parseMilliseconds(time.fractionalMilliseconds)));\n};\nconst parseTwoDigitYear = (value) => {\n const thisYear = new Date().getUTCFullYear();\n const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));\n if (valueInThisCentury < thisYear) {\n return valueInThisCentury + 100;\n }\n return valueInThisCentury;\n};\nconst FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000;\nconst adjustRfc850Year = (input) => {\n if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) {\n return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds()));\n }\n return input;\n};\nconst parseMonthByShortName = (value) => {\n const monthIdx = MONTHS.indexOf(value);\n if (monthIdx < 0) {\n throw new TypeError(`Invalid month: ${value}`);\n }\n return monthIdx + 1;\n};\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst validateDayOfMonth = (year, month, day) => {\n let maxDays = DAYS_IN_MONTH[month];\n if (month === 1 && isLeapYear(year)) {\n maxDays = 29;\n }\n if (day > maxDays) {\n throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);\n }\n};\nconst isLeapYear = (year) => {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n};\nconst parseDateValue = (value, type, lower, upper) => {\n const dateVal = strictParseByte(stripLeadingZeroes(value));\n if (dateVal < lower || dateVal > upper) {\n throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);\n }\n return dateVal;\n};\nconst parseMilliseconds = (value) => {\n if (value === null || value === undefined) {\n return 0;\n }\n return strictParseFloat32(\"0.\" + value) * 1000;\n};\nconst parseOffsetToMilliseconds = (value) => {\n const directionStr = value[0];\n let direction = 1;\n if (directionStr == \"+\") {\n direction = 1;\n }\n else if (directionStr == \"-\") {\n direction = -1;\n }\n else {\n throw new TypeError(`Offset direction, ${directionStr}, must be \"+\" or \"-\"`);\n }\n const hour = Number(value.substring(1, 3));\n const minute = Number(value.substring(4, 6));\n return direction * (hour * 60 + minute) * 60 * 1000;\n};\nconst stripLeadingZeroes = (value) => {\n let idx = 0;\n while (idx < value.length - 1 && value.charAt(idx) === \"0\") {\n idx++;\n }\n if (idx === 0) {\n return value;\n }\n return value.slice(idx);\n};\n\nconst LazyJsonString = function LazyJsonString(val) {\n const str = Object.assign(new String(val), {\n deserializeJSON() {\n return JSON.parse(String(val));\n },\n toString() {\n return String(val);\n },\n toJSON() {\n return String(val);\n },\n });\n return str;\n};\nLazyJsonString.from = (object) => {\n if (object && typeof object === \"object\" && (object instanceof LazyJsonString || \"deserializeJSON\" in object)) {\n return object;\n }\n else if (typeof object === \"string\" || Object.getPrototypeOf(object) === String.prototype) {\n return LazyJsonString(String(object));\n }\n return LazyJsonString(JSON.stringify(object));\n};\nLazyJsonString.fromObject = LazyJsonString.from;\n\nfunction quoteHeader(part) {\n if (part.includes(\",\") || part.includes('\"')) {\n part = `\"${part.replace(/\"/g, '\\\\\"')}\"`;\n }\n return part;\n}\n\nconst ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`;\nconst mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`;\nconst time = `(\\\\d?\\\\d):(\\\\d{2}):(\\\\d{2})(?:\\\\.(\\\\d+))?`;\nconst date = `(\\\\d?\\\\d)`;\nconst year = `(\\\\d{4})`;\nconst RFC3339_WITH_OFFSET = new RegExp(/^(\\d{4})-(\\d\\d)-(\\d\\d)[tT](\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d+))?(([-+]\\d\\d:\\d\\d)|[zZ])$/);\nconst IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`);\nconst RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\\\d\\\\d) ${time} GMT$`);\nconst ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\\\d\\\\d) ${time} ${year}$`);\nconst months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\nconst _parseEpochTimestamp = (value) => {\n if (value == null) {\n return void 0;\n }\n let num = NaN;\n if (typeof value === \"number\") {\n num = value;\n }\n else if (typeof value === \"string\") {\n if (!/^-?\\d*\\.?\\d+$/.test(value)) {\n throw new TypeError(`parseEpochTimestamp - numeric string invalid.`);\n }\n num = Number.parseFloat(value);\n }\n else if (typeof value === \"object\" && value.tag === 1) {\n num = value.value;\n }\n if (isNaN(num) || Math.abs(num) === Infinity) {\n throw new TypeError(\"Epoch timestamps must be valid finite numbers.\");\n }\n return new Date(Math.round(num * 1000));\n};\nconst _parseRfc3339DateTimeWithOffset = (value) => {\n if (value == null) {\n return void 0;\n }\n if (typeof value !== \"string\") {\n throw new TypeError(\"RFC3339 timestamps must be strings\");\n }\n const matches = RFC3339_WITH_OFFSET.exec(value);\n if (!matches) {\n throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);\n }\n const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;\n range(monthStr, 1, 12);\n range(dayStr, 1, 31);\n range(hours, 0, 23);\n range(minutes, 0, 59);\n range(seconds, 0, 60);\n const date = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1000) : 0));\n date.setUTCFullYear(Number(yearStr));\n if (offsetStr.toUpperCase() != \"Z\") {\n const [, sign, offsetH, offsetM] = /([+-])(\\d\\d):(\\d\\d)/.exec(offsetStr) || [void 0, \"+\", 0, 0];\n const scalar = sign === \"-\" ? 1 : -1;\n date.setTime(date.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1000 + Number(offsetM) * 60 * 1000));\n }\n return date;\n};\nconst _parseRfc7231DateTime = (value) => {\n if (value == null) {\n return void 0;\n }\n if (typeof value !== \"string\") {\n throw new TypeError(\"RFC7231 timestamps must be strings.\");\n }\n let day;\n let month;\n let year;\n let hour;\n let minute;\n let second;\n let fraction;\n let matches;\n if ((matches = IMF_FIXDATE.exec(value))) {\n [, day, month, year, hour, minute, second, fraction] = matches;\n }\n else if ((matches = RFC_850_DATE.exec(value))) {\n [, day, month, year, hour, minute, second, fraction] = matches;\n year = (Number(year) + 1900).toString();\n }\n else if ((matches = ASC_TIME.exec(value))) {\n [, month, day, hour, minute, second, fraction, year] = matches;\n }\n if (year && second) {\n const timestamp = Date.UTC(Number(year), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1000) : 0);\n range(day, 1, 31);\n range(hour, 0, 23);\n range(minute, 0, 59);\n range(second, 0, 60);\n const date = new Date(timestamp);\n date.setUTCFullYear(Number(year));\n return date;\n }\n throw new TypeError(`Invalid RFC7231 date-time value ${value}.`);\n};\nfunction range(v, min, max) {\n const _v = Number(v);\n if (_v < min || _v > max) {\n throw new Error(`Value ${_v} out of range [${min}, ${max}]`);\n }\n}\n\nfunction splitEvery(value, delimiter, numDelimiters) {\n if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n }\n const segments = value.split(delimiter);\n if (numDelimiters === 1) {\n return segments;\n }\n const compoundSegments = [];\n let currentSegment = \"\";\n for (let i = 0; i < segments.length; i++) {\n if (currentSegment === \"\") {\n currentSegment = segments[i];\n }\n else {\n currentSegment += delimiter + segments[i];\n }\n if ((i + 1) % numDelimiters === 0) {\n compoundSegments.push(currentSegment);\n currentSegment = \"\";\n }\n }\n if (currentSegment !== \"\") {\n compoundSegments.push(currentSegment);\n }\n return compoundSegments;\n}\n\nconst splitHeader = (value) => {\n const z = value.length;\n const values = [];\n let withinQuotes = false;\n let prevChar = undefined;\n let anchor = 0;\n for (let i = 0; i < z; ++i) {\n const char = value[i];\n switch (char) {\n case `\"`:\n if (prevChar !== \"\\\\\") {\n withinQuotes = !withinQuotes;\n }\n break;\n case \",\":\n if (!withinQuotes) {\n values.push(value.slice(anchor, i));\n anchor = i + 1;\n }\n break;\n }\n prevChar = char;\n }\n values.push(value.slice(anchor));\n return values.map((v) => {\n v = v.trim();\n const z = v.length;\n if (z < 2) {\n return v;\n }\n if (v[0] === `\"` && v[z - 1] === `\"`) {\n v = v.slice(1, z - 1);\n }\n return v.replace(/\\\\\"/g, '\"');\n });\n};\n\nconst format = /^-?\\d*(\\.\\d+)?$/;\nclass NumericValue {\n string;\n type;\n constructor(string, type) {\n this.string = string;\n this.type = type;\n if (!format.test(string)) {\n throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point \".\", and an optional negation prefix \"-\".`);\n }\n }\n toString() {\n return this.string;\n }\n static [Symbol.hasInstance](object) {\n if (!object || typeof object !== \"object\") {\n return false;\n }\n const _nv = object;\n return NumericValue.prototype.isPrototypeOf(object) || (_nv.type === \"bigDecimal\" && format.test(_nv.string));\n }\n}\nfunction nv(input) {\n return new NumericValue(String(input), \"bigDecimal\");\n}\n\nObject.defineProperty(exports, \"generateIdempotencyToken\", {\n enumerable: true,\n get: function () { return uuid.v4; }\n});\nexports.LazyJsonString = LazyJsonString;\nexports.NumericValue = NumericValue;\nexports._parseEpochTimestamp = _parseEpochTimestamp;\nexports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset;\nexports._parseRfc7231DateTime = _parseRfc7231DateTime;\nexports.copyDocumentWithTransform = copyDocumentWithTransform;\nexports.dateToUtcString = dateToUtcString;\nexports.expectBoolean = expectBoolean;\nexports.expectByte = expectByte;\nexports.expectFloat32 = expectFloat32;\nexports.expectInt = expectInt;\nexports.expectInt32 = expectInt32;\nexports.expectLong = expectLong;\nexports.expectNonNull = expectNonNull;\nexports.expectNumber = expectNumber;\nexports.expectObject = expectObject;\nexports.expectShort = expectShort;\nexports.expectString = expectString;\nexports.expectUnion = expectUnion;\nexports.handleFloat = handleFloat;\nexports.limitedParseDouble = limitedParseDouble;\nexports.limitedParseFloat = limitedParseFloat;\nexports.limitedParseFloat32 = limitedParseFloat32;\nexports.logger = logger;\nexports.nv = nv;\nexports.parseBoolean = parseBoolean;\nexports.parseEpochTimestamp = parseEpochTimestamp;\nexports.parseRfc3339DateTime = parseRfc3339DateTime;\nexports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset;\nexports.parseRfc7231DateTime = parseRfc7231DateTime;\nexports.quoteHeader = quoteHeader;\nexports.splitEvery = splitEvery;\nexports.splitHeader = splitHeader;\nexports.strictParseByte = strictParseByte;\nexports.strictParseDouble = strictParseDouble;\nexports.strictParseFloat = strictParseFloat;\nexports.strictParseFloat32 = strictParseFloat32;\nexports.strictParseInt = strictParseInt;\nexports.strictParseInt32 = strictParseInt32;\nexports.strictParseLong = strictParseLong;\nexports.strictParseShort = strictParseShort;\n", - "'use strict';\n\nvar utilUtf8 = require('@smithy/util-utf8');\n\nclass EventStreamSerde {\n marshaller;\n serializer;\n deserializer;\n serdeContext;\n defaultContentType;\n constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, }) {\n this.marshaller = marshaller;\n this.serializer = serializer;\n this.deserializer = deserializer;\n this.serdeContext = serdeContext;\n this.defaultContentType = defaultContentType;\n }\n async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {\n const marshaller = this.marshaller;\n const eventStreamMember = requestSchema.getEventStreamMember();\n const unionSchema = requestSchema.getMemberSchema(eventStreamMember);\n const serializer = this.serializer;\n const defaultContentType = this.defaultContentType;\n const initialRequestMarker = Symbol(\"initialRequestMarker\");\n const eventStreamIterable = {\n async *[Symbol.asyncIterator]() {\n if (initialRequest) {\n const headers = {\n \":event-type\": { type: \"string\", value: \"initial-request\" },\n \":message-type\": { type: \"string\", value: \"event\" },\n \":content-type\": { type: \"string\", value: defaultContentType },\n };\n serializer.write(requestSchema, initialRequest);\n const body = serializer.flush();\n yield {\n [initialRequestMarker]: true,\n headers,\n body,\n };\n }\n for await (const page of eventStream) {\n yield page;\n }\n },\n };\n return marshaller.serialize(eventStreamIterable, (event) => {\n if (event[initialRequestMarker]) {\n return {\n headers: event.headers,\n body: event.body,\n };\n }\n const unionMember = Object.keys(event).find((key) => {\n return key !== \"__type\";\n }) ?? \"\";\n const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);\n const headers = {\n \":event-type\": { type: \"string\", value: eventType },\n \":message-type\": { type: \"string\", value: \"event\" },\n \":content-type\": { type: \"string\", value: explicitPayloadContentType ?? defaultContentType },\n ...additionalHeaders,\n };\n return {\n headers,\n body,\n };\n });\n }\n async deserializeEventStream({ response, responseSchema, initialResponseContainer, }) {\n const marshaller = this.marshaller;\n const eventStreamMember = responseSchema.getEventStreamMember();\n const unionSchema = responseSchema.getMemberSchema(eventStreamMember);\n const memberSchemas = unionSchema.getMemberSchemas();\n const initialResponseMarker = Symbol(\"initialResponseMarker\");\n const asyncIterable = marshaller.deserialize(response.body, async (event) => {\n const unionMember = Object.keys(event).find((key) => {\n return key !== \"__type\";\n }) ?? \"\";\n const body = event[unionMember].body;\n if (unionMember === \"initial-response\") {\n const dataObject = await this.deserializer.read(responseSchema, body);\n delete dataObject[eventStreamMember];\n return {\n [initialResponseMarker]: true,\n ...dataObject,\n };\n }\n else if (unionMember in memberSchemas) {\n const eventStreamSchema = memberSchemas[unionMember];\n if (eventStreamSchema.isStructSchema()) {\n const out = {};\n let hasBindings = false;\n for (const [name, member] of eventStreamSchema.structIterator()) {\n const { eventHeader, eventPayload } = member.getMergedTraits();\n hasBindings = hasBindings || Boolean(eventHeader || eventPayload);\n if (eventPayload) {\n if (member.isBlobSchema()) {\n out[name] = body;\n }\n else if (member.isStringSchema()) {\n out[name] = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(body);\n }\n else if (member.isStructSchema()) {\n out[name] = await this.deserializer.read(member, body);\n }\n }\n else if (eventHeader) {\n const value = event[unionMember].headers[name]?.value;\n if (value != null) {\n if (member.isNumericSchema()) {\n if (value && typeof value === \"object\" && \"bytes\" in value) {\n out[name] = BigInt(value.toString());\n }\n else {\n out[name] = Number(value);\n }\n }\n else {\n out[name] = value;\n }\n }\n }\n }\n if (hasBindings) {\n return {\n [unionMember]: out,\n };\n }\n }\n return {\n [unionMember]: await this.deserializer.read(eventStreamSchema, body),\n };\n }\n else {\n return {\n $unknown: event,\n };\n }\n });\n const asyncIterator = asyncIterable[Symbol.asyncIterator]();\n const firstEvent = await asyncIterator.next();\n if (firstEvent.done) {\n return asyncIterable;\n }\n if (firstEvent.value?.[initialResponseMarker]) {\n if (!responseSchema) {\n throw new Error(\"@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.\");\n }\n for (const [key, value] of Object.entries(firstEvent.value)) {\n initialResponseContainer[key] = value;\n }\n }\n return {\n async *[Symbol.asyncIterator]() {\n if (!firstEvent?.value?.[initialResponseMarker]) {\n yield firstEvent.value;\n }\n while (true) {\n const { done, value } = await asyncIterator.next();\n if (done) {\n break;\n }\n yield value;\n }\n },\n };\n }\n writeEventBody(unionMember, unionSchema, event) {\n const serializer = this.serializer;\n let eventType = unionMember;\n let explicitPayloadMember = null;\n let explicitPayloadContentType;\n const isKnownSchema = (() => {\n const struct = unionSchema.getSchema();\n return struct[4].includes(unionMember);\n })();\n const additionalHeaders = {};\n if (!isKnownSchema) {\n const [type, value] = event[unionMember];\n eventType = type;\n serializer.write(15, value);\n }\n else {\n const eventSchema = unionSchema.getMemberSchema(unionMember);\n if (eventSchema.isStructSchema()) {\n for (const [memberName, memberSchema] of eventSchema.structIterator()) {\n const { eventHeader, eventPayload } = memberSchema.getMergedTraits();\n if (eventPayload) {\n explicitPayloadMember = memberName;\n break;\n }\n else if (eventHeader) {\n const value = event[unionMember][memberName];\n let type = \"binary\";\n if (memberSchema.isNumericSchema()) {\n if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {\n type = \"integer\";\n }\n else {\n type = \"long\";\n }\n }\n else if (memberSchema.isTimestampSchema()) {\n type = \"timestamp\";\n }\n else if (memberSchema.isStringSchema()) {\n type = \"string\";\n }\n else if (memberSchema.isBooleanSchema()) {\n type = \"boolean\";\n }\n if (value != null) {\n additionalHeaders[memberName] = {\n type,\n value,\n };\n delete event[unionMember][memberName];\n }\n }\n }\n if (explicitPayloadMember !== null) {\n const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);\n if (payloadSchema.isBlobSchema()) {\n explicitPayloadContentType = \"application/octet-stream\";\n }\n else if (payloadSchema.isStringSchema()) {\n explicitPayloadContentType = \"text/plain\";\n }\n serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);\n }\n else {\n serializer.write(eventSchema, event[unionMember]);\n }\n }\n else {\n throw new Error(\"@smithy/core/event-streams - non-struct member not supported in event stream union.\");\n }\n }\n const messageSerialization = serializer.flush();\n const body = typeof messageSerialization === \"string\"\n ? (this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8)(messageSerialization)\n : messageSerialization;\n return {\n body,\n eventType,\n explicitPayloadContentType,\n additionalHeaders,\n };\n }\n}\n\nexports.EventStreamSerde = EventStreamSerde;\n", - "'use strict';\n\nvar utilStream = require('@smithy/util-stream');\nvar schema = require('@smithy/core/schema');\nvar serde = require('@smithy/core/serde');\nvar protocolHttp = require('@smithy/protocol-http');\nvar utilBase64 = require('@smithy/util-base64');\nvar utilUtf8 = require('@smithy/util-utf8');\n\nconst collectBody = async (streamBody = new Uint8Array(), context) => {\n if (streamBody instanceof Uint8Array) {\n return utilStream.Uint8ArrayBlobAdapter.mutate(streamBody);\n }\n if (!streamBody) {\n return utilStream.Uint8ArrayBlobAdapter.mutate(new Uint8Array());\n }\n const fromContext = context.streamCollector(streamBody);\n return utilStream.Uint8ArrayBlobAdapter.mutate(await fromContext);\n};\n\nfunction extendedEncodeURIComponent(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nclass SerdeContext {\n serdeContext;\n setSerdeContext(serdeContext) {\n this.serdeContext = serdeContext;\n }\n}\n\nclass HttpProtocol extends SerdeContext {\n options;\n constructor(options) {\n super();\n this.options = options;\n }\n getRequestType() {\n return protocolHttp.HttpRequest;\n }\n getResponseType() {\n return protocolHttp.HttpResponse;\n }\n setSerdeContext(serdeContext) {\n this.serdeContext = serdeContext;\n this.serializer.setSerdeContext(serdeContext);\n this.deserializer.setSerdeContext(serdeContext);\n if (this.getPayloadCodec()) {\n this.getPayloadCodec().setSerdeContext(serdeContext);\n }\n }\n updateServiceEndpoint(request, endpoint) {\n if (\"url\" in endpoint) {\n request.protocol = endpoint.url.protocol;\n request.hostname = endpoint.url.hostname;\n request.port = endpoint.url.port ? Number(endpoint.url.port) : undefined;\n request.path = endpoint.url.pathname;\n request.fragment = endpoint.url.hash || void 0;\n request.username = endpoint.url.username || void 0;\n request.password = endpoint.url.password || void 0;\n if (!request.query) {\n request.query = {};\n }\n for (const [k, v] of endpoint.url.searchParams.entries()) {\n request.query[k] = v;\n }\n return request;\n }\n else {\n request.protocol = endpoint.protocol;\n request.hostname = endpoint.hostname;\n request.port = endpoint.port ? Number(endpoint.port) : undefined;\n request.path = endpoint.path;\n request.query = {\n ...endpoint.query,\n };\n return request;\n }\n }\n setHostPrefix(request, operationSchema, input) {\n const inputNs = schema.NormalizedSchema.of(operationSchema.input);\n const opTraits = schema.translateTraits(operationSchema.traits ?? {});\n if (opTraits.endpoint) {\n let hostPrefix = opTraits.endpoint?.[0];\n if (typeof hostPrefix === \"string\") {\n const hostLabelInputs = [...inputNs.structIterator()].filter(([, member]) => member.getMergedTraits().hostLabel);\n for (const [name] of hostLabelInputs) {\n const replacement = input[name];\n if (typeof replacement !== \"string\") {\n throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);\n }\n hostPrefix = hostPrefix.replace(`{${name}}`, replacement);\n }\n request.hostname = hostPrefix + request.hostname;\n }\n }\n }\n deserializeMetadata(output) {\n return {\n httpStatusCode: output.statusCode,\n requestId: output.headers[\"x-amzn-requestid\"] ?? output.headers[\"x-amzn-request-id\"] ?? output.headers[\"x-amz-request-id\"],\n extendedRequestId: output.headers[\"x-amz-id-2\"],\n cfId: output.headers[\"x-amz-cf-id\"],\n };\n }\n async serializeEventStream({ eventStream, requestSchema, initialRequest, }) {\n const eventStreamSerde = await this.loadEventStreamCapability();\n return eventStreamSerde.serializeEventStream({\n eventStream,\n requestSchema,\n initialRequest,\n });\n }\n async deserializeEventStream({ response, responseSchema, initialResponseContainer, }) {\n const eventStreamSerde = await this.loadEventStreamCapability();\n return eventStreamSerde.deserializeEventStream({\n response,\n responseSchema,\n initialResponseContainer,\n });\n }\n async loadEventStreamCapability() {\n const { EventStreamSerde } = await import('@smithy/core/event-streams');\n return new EventStreamSerde({\n marshaller: this.getEventStreamMarshaller(),\n serializer: this.serializer,\n deserializer: this.deserializer,\n serdeContext: this.serdeContext,\n defaultContentType: this.getDefaultContentType(),\n });\n }\n getDefaultContentType() {\n throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);\n }\n async deserializeHttpMessage(schema, context, response, arg4, arg5) {\n return [];\n }\n getEventStreamMarshaller() {\n const context = this.serdeContext;\n if (!context.eventStreamMarshaller) {\n throw new Error(\"@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.\");\n }\n return context.eventStreamMarshaller;\n }\n}\n\nclass HttpBindingProtocol extends HttpProtocol {\n async serializeRequest(operationSchema, _input, context) {\n const input = {\n ...(_input ?? {}),\n };\n const serializer = this.serializer;\n const query = {};\n const headers = {};\n const endpoint = await context.endpoint();\n const ns = schema.NormalizedSchema.of(operationSchema?.input);\n const schema$1 = ns.getSchema();\n let hasNonHttpBindingMember = false;\n let payload;\n const request = new protocolHttp.HttpRequest({\n protocol: \"\",\n hostname: \"\",\n port: undefined,\n path: \"\",\n fragment: undefined,\n query: query,\n headers: headers,\n body: undefined,\n });\n if (endpoint) {\n this.updateServiceEndpoint(request, endpoint);\n this.setHostPrefix(request, operationSchema, input);\n const opTraits = schema.translateTraits(operationSchema.traits);\n if (opTraits.http) {\n request.method = opTraits.http[0];\n const [path, search] = opTraits.http[1].split(\"?\");\n if (request.path == \"/\") {\n request.path = path;\n }\n else {\n request.path += path;\n }\n const traitSearchParams = new URLSearchParams(search ?? \"\");\n Object.assign(query, Object.fromEntries(traitSearchParams));\n }\n }\n for (const [memberName, memberNs] of ns.structIterator()) {\n const memberTraits = memberNs.getMergedTraits() ?? {};\n const inputMemberValue = input[memberName];\n if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {\n continue;\n }\n if (memberTraits.httpPayload) {\n const isStreaming = memberNs.isStreaming();\n if (isStreaming) {\n const isEventStream = memberNs.isStructSchema();\n if (isEventStream) {\n if (input[memberName]) {\n payload = await this.serializeEventStream({\n eventStream: input[memberName],\n requestSchema: ns,\n });\n }\n }\n else {\n payload = inputMemberValue;\n }\n }\n else {\n serializer.write(memberNs, inputMemberValue);\n payload = serializer.flush();\n }\n delete input[memberName];\n }\n else if (memberTraits.httpLabel) {\n serializer.write(memberNs, inputMemberValue);\n const replacement = serializer.flush();\n if (request.path.includes(`{${memberName}+}`)) {\n request.path = request.path.replace(`{${memberName}+}`, replacement.split(\"/\").map(extendedEncodeURIComponent).join(\"/\"));\n }\n else if (request.path.includes(`{${memberName}}`)) {\n request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));\n }\n delete input[memberName];\n }\n else if (memberTraits.httpHeader) {\n serializer.write(memberNs, inputMemberValue);\n headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());\n delete input[memberName];\n }\n else if (typeof memberTraits.httpPrefixHeaders === \"string\") {\n for (const [key, val] of Object.entries(inputMemberValue)) {\n const amalgam = memberTraits.httpPrefixHeaders + key;\n serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);\n headers[amalgam.toLowerCase()] = serializer.flush();\n }\n delete input[memberName];\n }\n else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {\n this.serializeQuery(memberNs, inputMemberValue, query);\n delete input[memberName];\n }\n else {\n hasNonHttpBindingMember = true;\n }\n }\n if (hasNonHttpBindingMember && input) {\n serializer.write(schema$1, input);\n payload = serializer.flush();\n }\n request.headers = headers;\n request.query = query;\n request.body = payload;\n return request;\n }\n serializeQuery(ns, data, query) {\n const serializer = this.serializer;\n const traits = ns.getMergedTraits();\n if (traits.httpQueryParams) {\n for (const [key, val] of Object.entries(data)) {\n if (!(key in query)) {\n const valueSchema = ns.getValueSchema();\n Object.assign(valueSchema.getMergedTraits(), {\n ...traits,\n httpQuery: key,\n httpQueryParams: undefined,\n });\n this.serializeQuery(valueSchema, val, query);\n }\n }\n return;\n }\n if (ns.isListSchema()) {\n const sparse = !!ns.getMergedTraits().sparse;\n const buffer = [];\n for (const item of data) {\n serializer.write([ns.getValueSchema(), traits], item);\n const serializable = serializer.flush();\n if (sparse || serializable !== undefined) {\n buffer.push(serializable);\n }\n }\n query[traits.httpQuery] = buffer;\n }\n else {\n serializer.write([ns, traits], data);\n query[traits.httpQuery] = serializer.flush();\n }\n }\n async deserializeResponse(operationSchema, context, response) {\n const deserializer = this.deserializer;\n const ns = schema.NormalizedSchema.of(operationSchema.output);\n const dataObject = {};\n if (response.statusCode >= 300) {\n const bytes = await collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n Object.assign(dataObject, await deserializer.read(15, bytes));\n }\n await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));\n throw new Error(\"@smithy/core/protocols - HTTP Protocol error handler failed to throw.\");\n }\n for (const header in response.headers) {\n const value = response.headers[header];\n delete response.headers[header];\n response.headers[header.toLowerCase()] = value;\n }\n const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);\n if (nonHttpBindingMembers.length) {\n const bytes = await collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n const dataFromBody = await deserializer.read(ns, bytes);\n for (const member of nonHttpBindingMembers) {\n dataObject[member] = dataFromBody[member];\n }\n }\n }\n else if (nonHttpBindingMembers.discardResponseBody) {\n await collectBody(response.body, context);\n }\n dataObject.$metadata = this.deserializeMetadata(response);\n return dataObject;\n }\n async deserializeHttpMessage(schema$1, context, response, arg4, arg5) {\n let dataObject;\n if (arg4 instanceof Set) {\n dataObject = arg5;\n }\n else {\n dataObject = arg4;\n }\n let discardResponseBody = true;\n const deserializer = this.deserializer;\n const ns = schema.NormalizedSchema.of(schema$1);\n const nonHttpBindingMembers = [];\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const memberTraits = memberSchema.getMemberTraits();\n if (memberTraits.httpPayload) {\n discardResponseBody = false;\n const isStreaming = memberSchema.isStreaming();\n if (isStreaming) {\n const isEventStream = memberSchema.isStructSchema();\n if (isEventStream) {\n dataObject[memberName] = await this.deserializeEventStream({\n response,\n responseSchema: ns,\n });\n }\n else {\n dataObject[memberName] = utilStream.sdkStreamMixin(response.body);\n }\n }\n else if (response.body) {\n const bytes = await collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n dataObject[memberName] = await deserializer.read(memberSchema, bytes);\n }\n }\n }\n else if (memberTraits.httpHeader) {\n const key = String(memberTraits.httpHeader).toLowerCase();\n const value = response.headers[key];\n if (null != value) {\n if (memberSchema.isListSchema()) {\n const headerListValueSchema = memberSchema.getValueSchema();\n headerListValueSchema.getMergedTraits().httpHeader = key;\n let sections;\n if (headerListValueSchema.isTimestampSchema() &&\n headerListValueSchema.getSchema() === 4) {\n sections = serde.splitEvery(value, \",\", 2);\n }\n else {\n sections = serde.splitHeader(value);\n }\n const list = [];\n for (const section of sections) {\n list.push(await deserializer.read(headerListValueSchema, section.trim()));\n }\n dataObject[memberName] = list;\n }\n else {\n dataObject[memberName] = await deserializer.read(memberSchema, value);\n }\n }\n }\n else if (memberTraits.httpPrefixHeaders !== undefined) {\n dataObject[memberName] = {};\n for (const [header, value] of Object.entries(response.headers)) {\n if (header.startsWith(memberTraits.httpPrefixHeaders)) {\n const valueSchema = memberSchema.getValueSchema();\n valueSchema.getMergedTraits().httpHeader = header;\n dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);\n }\n }\n }\n else if (memberTraits.httpResponseCode) {\n dataObject[memberName] = response.statusCode;\n }\n else {\n nonHttpBindingMembers.push(memberName);\n }\n }\n nonHttpBindingMembers.discardResponseBody = discardResponseBody;\n return nonHttpBindingMembers;\n }\n}\n\nclass RpcProtocol extends HttpProtocol {\n async serializeRequest(operationSchema, input, context) {\n const serializer = this.serializer;\n const query = {};\n const headers = {};\n const endpoint = await context.endpoint();\n const ns = schema.NormalizedSchema.of(operationSchema?.input);\n const schema$1 = ns.getSchema();\n let payload;\n const request = new protocolHttp.HttpRequest({\n protocol: \"\",\n hostname: \"\",\n port: undefined,\n path: \"/\",\n fragment: undefined,\n query: query,\n headers: headers,\n body: undefined,\n });\n if (endpoint) {\n this.updateServiceEndpoint(request, endpoint);\n this.setHostPrefix(request, operationSchema, input);\n }\n const _input = {\n ...input,\n };\n if (input) {\n const eventStreamMember = ns.getEventStreamMember();\n if (eventStreamMember) {\n if (_input[eventStreamMember]) {\n const initialRequest = {};\n for (const [memberName, memberSchema] of ns.structIterator()) {\n if (memberName !== eventStreamMember && _input[memberName]) {\n serializer.write(memberSchema, _input[memberName]);\n initialRequest[memberName] = serializer.flush();\n }\n }\n payload = await this.serializeEventStream({\n eventStream: _input[eventStreamMember],\n requestSchema: ns,\n initialRequest,\n });\n }\n }\n else {\n serializer.write(schema$1, _input);\n payload = serializer.flush();\n }\n }\n request.headers = headers;\n request.query = query;\n request.body = payload;\n request.method = \"POST\";\n return request;\n }\n async deserializeResponse(operationSchema, context, response) {\n const deserializer = this.deserializer;\n const ns = schema.NormalizedSchema.of(operationSchema.output);\n const dataObject = {};\n if (response.statusCode >= 300) {\n const bytes = await collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n Object.assign(dataObject, await deserializer.read(15, bytes));\n }\n await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));\n throw new Error(\"@smithy/core/protocols - RPC Protocol error handler failed to throw.\");\n }\n for (const header in response.headers) {\n const value = response.headers[header];\n delete response.headers[header];\n response.headers[header.toLowerCase()] = value;\n }\n const eventStreamMember = ns.getEventStreamMember();\n if (eventStreamMember) {\n dataObject[eventStreamMember] = await this.deserializeEventStream({\n response,\n responseSchema: ns,\n initialResponseContainer: dataObject,\n });\n }\n else {\n const bytes = await collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n Object.assign(dataObject, await deserializer.read(ns, bytes));\n }\n }\n dataObject.$metadata = this.deserializeMetadata(response);\n return dataObject;\n }\n}\n\nconst resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {\n if (input != null && input[memberName] !== undefined) {\n const labelValue = labelValueProvider();\n if (labelValue.length <= 0) {\n throw new Error(\"Empty value provided for input HTTP label: \" + memberName + \".\");\n }\n resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel\n ? labelValue\n .split(\"/\")\n .map((segment) => extendedEncodeURIComponent(segment))\n .join(\"/\")\n : extendedEncodeURIComponent(labelValue));\n }\n else {\n throw new Error(\"No value provided for input HTTP label: \" + memberName + \".\");\n }\n return resolvedPath;\n};\n\nfunction requestBuilder(input, context) {\n return new RequestBuilder(input, context);\n}\nclass RequestBuilder {\n input;\n context;\n query = {};\n method = \"\";\n headers = {};\n path = \"\";\n body = null;\n hostname = \"\";\n resolvePathStack = [];\n constructor(input, context) {\n this.input = input;\n this.context = context;\n }\n async build() {\n const { hostname, protocol = \"https\", port, path: basePath } = await this.context.endpoint();\n this.path = basePath;\n for (const resolvePath of this.resolvePathStack) {\n resolvePath(this.path);\n }\n return new protocolHttp.HttpRequest({\n protocol,\n hostname: this.hostname || hostname,\n port,\n method: this.method,\n path: this.path,\n query: this.query,\n body: this.body,\n headers: this.headers,\n });\n }\n hn(hostname) {\n this.hostname = hostname;\n return this;\n }\n bp(uriLabel) {\n this.resolvePathStack.push((basePath) => {\n this.path = `${basePath?.endsWith(\"/\") ? basePath.slice(0, -1) : basePath || \"\"}` + uriLabel;\n });\n return this;\n }\n p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {\n this.resolvePathStack.push((path) => {\n this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);\n });\n return this;\n }\n h(headers) {\n this.headers = headers;\n return this;\n }\n q(query) {\n this.query = query;\n return this;\n }\n b(body) {\n this.body = body;\n return this;\n }\n m(method) {\n this.method = method;\n return this;\n }\n}\n\nfunction determineTimestampFormat(ns, settings) {\n if (settings.timestampFormat.useTrait) {\n if (ns.isTimestampSchema() &&\n (ns.getSchema() === 5 ||\n ns.getSchema() === 6 ||\n ns.getSchema() === 7)) {\n return ns.getSchema();\n }\n }\n const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();\n const bindingFormat = settings.httpBindings\n ? typeof httpPrefixHeaders === \"string\" || Boolean(httpHeader)\n ? 6\n : Boolean(httpQuery) || Boolean(httpLabel)\n ? 5\n : undefined\n : undefined;\n return bindingFormat ?? settings.timestampFormat.default;\n}\n\nclass FromStringShapeDeserializer extends SerdeContext {\n settings;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n read(_schema, data) {\n const ns = schema.NormalizedSchema.of(_schema);\n if (ns.isListSchema()) {\n return serde.splitHeader(data).map((item) => this.read(ns.getValueSchema(), item));\n }\n if (ns.isBlobSchema()) {\n return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(data);\n }\n if (ns.isTimestampSchema()) {\n const format = determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n return serde._parseRfc3339DateTimeWithOffset(data);\n case 6:\n return serde._parseRfc7231DateTime(data);\n case 7:\n return serde._parseEpochTimestamp(data);\n default:\n console.warn(\"Missing timestamp format, parsing value with Date constructor:\", data);\n return new Date(data);\n }\n }\n if (ns.isStringSchema()) {\n const mediaType = ns.getMergedTraits().mediaType;\n let intermediateValue = data;\n if (mediaType) {\n if (ns.getMergedTraits().httpHeader) {\n intermediateValue = this.base64ToUtf8(intermediateValue);\n }\n const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n if (isJson) {\n intermediateValue = serde.LazyJsonString.from(intermediateValue);\n }\n return intermediateValue;\n }\n }\n if (ns.isNumericSchema()) {\n return Number(data);\n }\n if (ns.isBigIntegerSchema()) {\n return BigInt(data);\n }\n if (ns.isBigDecimalSchema()) {\n return new serde.NumericValue(data, \"bigDecimal\");\n }\n if (ns.isBooleanSchema()) {\n return String(data).toLowerCase() === \"true\";\n }\n return data;\n }\n base64ToUtf8(base64String) {\n return (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)((this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(base64String));\n }\n}\n\nclass HttpInterceptingShapeDeserializer extends SerdeContext {\n codecDeserializer;\n stringDeserializer;\n constructor(codecDeserializer, codecSettings) {\n super();\n this.codecDeserializer = codecDeserializer;\n this.stringDeserializer = new FromStringShapeDeserializer(codecSettings);\n }\n setSerdeContext(serdeContext) {\n this.stringDeserializer.setSerdeContext(serdeContext);\n this.codecDeserializer.setSerdeContext(serdeContext);\n this.serdeContext = serdeContext;\n }\n read(schema$1, data) {\n const ns = schema.NormalizedSchema.of(schema$1);\n const traits = ns.getMergedTraits();\n const toString = this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8;\n if (traits.httpHeader || traits.httpResponseCode) {\n return this.stringDeserializer.read(ns, toString(data));\n }\n if (traits.httpPayload) {\n if (ns.isBlobSchema()) {\n const toBytes = this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8;\n if (typeof data === \"string\") {\n return toBytes(data);\n }\n return data;\n }\n else if (ns.isStringSchema()) {\n if (\"byteLength\" in data) {\n return toString(data);\n }\n return data;\n }\n }\n return this.codecDeserializer.read(ns, data);\n }\n}\n\nclass ToStringShapeSerializer extends SerdeContext {\n settings;\n stringBuffer = \"\";\n constructor(settings) {\n super();\n this.settings = settings;\n }\n write(schema$1, value) {\n const ns = schema.NormalizedSchema.of(schema$1);\n switch (typeof value) {\n case \"object\":\n if (value === null) {\n this.stringBuffer = \"null\";\n return;\n }\n if (ns.isTimestampSchema()) {\n if (!(value instanceof Date)) {\n throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);\n }\n const format = determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n this.stringBuffer = value.toISOString().replace(\".000Z\", \"Z\");\n break;\n case 6:\n this.stringBuffer = serde.dateToUtcString(value);\n break;\n case 7:\n this.stringBuffer = String(value.getTime() / 1000);\n break;\n default:\n console.warn(\"Missing timestamp format, using epoch seconds\", value);\n this.stringBuffer = String(value.getTime() / 1000);\n }\n return;\n }\n if (ns.isBlobSchema() && \"byteLength\" in value) {\n this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);\n return;\n }\n if (ns.isListSchema() && Array.isArray(value)) {\n let buffer = \"\";\n for (const item of value) {\n this.write([ns.getValueSchema(), ns.getMergedTraits()], item);\n const headerItem = this.flush();\n const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : serde.quoteHeader(headerItem);\n if (buffer !== \"\") {\n buffer += \", \";\n }\n buffer += serialized;\n }\n this.stringBuffer = buffer;\n return;\n }\n this.stringBuffer = JSON.stringify(value, null, 2);\n break;\n case \"string\":\n const mediaType = ns.getMergedTraits().mediaType;\n let intermediateValue = value;\n if (mediaType) {\n const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n if (isJson) {\n intermediateValue = serde.LazyJsonString.from(intermediateValue);\n }\n if (ns.getMergedTraits().httpHeader) {\n this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(intermediateValue.toString());\n return;\n }\n }\n this.stringBuffer = value;\n break;\n default:\n if (ns.isIdempotencyToken()) {\n this.stringBuffer = serde.generateIdempotencyToken();\n }\n else {\n this.stringBuffer = String(value);\n }\n }\n }\n flush() {\n const buffer = this.stringBuffer;\n this.stringBuffer = \"\";\n return buffer;\n }\n}\n\nclass HttpInterceptingShapeSerializer {\n codecSerializer;\n stringSerializer;\n buffer;\n constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) {\n this.codecSerializer = codecSerializer;\n this.stringSerializer = stringSerializer;\n }\n setSerdeContext(serdeContext) {\n this.codecSerializer.setSerdeContext(serdeContext);\n this.stringSerializer.setSerdeContext(serdeContext);\n }\n write(schema$1, value) {\n const ns = schema.NormalizedSchema.of(schema$1);\n const traits = ns.getMergedTraits();\n if (traits.httpHeader || traits.httpLabel || traits.httpQuery) {\n this.stringSerializer.write(ns, value);\n this.buffer = this.stringSerializer.flush();\n return;\n }\n return this.codecSerializer.write(ns, value);\n }\n flush() {\n if (this.buffer !== undefined) {\n const buffer = this.buffer;\n this.buffer = undefined;\n return buffer;\n }\n return this.codecSerializer.flush();\n }\n}\n\nexports.FromStringShapeDeserializer = FromStringShapeDeserializer;\nexports.HttpBindingProtocol = HttpBindingProtocol;\nexports.HttpInterceptingShapeDeserializer = HttpInterceptingShapeDeserializer;\nexports.HttpInterceptingShapeSerializer = HttpInterceptingShapeSerializer;\nexports.HttpProtocol = HttpProtocol;\nexports.RequestBuilder = RequestBuilder;\nexports.RpcProtocol = RpcProtocol;\nexports.SerdeContext = SerdeContext;\nexports.ToStringShapeSerializer = ToStringShapeSerializer;\nexports.collectBody = collectBody;\nexports.determineTimestampFormat = determineTimestampFormat;\nexports.extendedEncodeURIComponent = extendedEncodeURIComponent;\nexports.requestBuilder = requestBuilder;\nexports.resolvedPath = resolvedPath;\n", - "'use strict';\n\nvar types = require('@smithy/types');\nvar utilMiddleware = require('@smithy/util-middleware');\nvar middlewareSerde = require('@smithy/middleware-serde');\nvar protocolHttp = require('@smithy/protocol-http');\nvar protocols = require('@smithy/core/protocols');\n\nconst getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {});\n\nconst resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {\n if (!authSchemePreference || authSchemePreference.length === 0) {\n return candidateAuthOptions;\n }\n const preferredAuthOptions = [];\n for (const preferredSchemeName of authSchemePreference) {\n for (const candidateAuthOption of candidateAuthOptions) {\n const candidateAuthSchemeName = candidateAuthOption.schemeId.split(\"#\")[1];\n if (candidateAuthSchemeName === preferredSchemeName) {\n preferredAuthOptions.push(candidateAuthOption);\n }\n }\n }\n for (const candidateAuthOption of candidateAuthOptions) {\n if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {\n preferredAuthOptions.push(candidateAuthOption);\n }\n }\n return preferredAuthOptions;\n};\n\nfunction convertHttpAuthSchemesToMap(httpAuthSchemes) {\n const map = new Map();\n for (const scheme of httpAuthSchemes) {\n map.set(scheme.schemeId, scheme);\n }\n return map;\n}\nconst httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {\n const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));\n const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];\n const resolvedOptions = resolveAuthOptions(options, authSchemePreference);\n const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);\n const smithyContext = utilMiddleware.getSmithyContext(context);\n const failureReasons = [];\n for (const option of resolvedOptions) {\n const scheme = authSchemes.get(option.schemeId);\n if (!scheme) {\n failureReasons.push(`HttpAuthScheme \\`${option.schemeId}\\` was not enabled for this service.`);\n continue;\n }\n const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));\n if (!identityProvider) {\n failureReasons.push(`HttpAuthScheme \\`${option.schemeId}\\` did not have an IdentityProvider configured.`);\n continue;\n }\n const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};\n option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);\n option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);\n smithyContext.selectedHttpAuthScheme = {\n httpAuthOption: option,\n identity: await identityProvider(option.identityProperties),\n signer: scheme.signer,\n };\n break;\n }\n if (!smithyContext.selectedHttpAuthScheme) {\n throw new Error(failureReasons.join(\"\\n\"));\n }\n return next(args);\n};\n\nconst httpAuthSchemeEndpointRuleSetMiddlewareOptions = {\n step: \"serialize\",\n tags: [\"HTTP_AUTH_SCHEME\"],\n name: \"httpAuthSchemeMiddleware\",\n override: true,\n relation: \"before\",\n toMiddleware: \"endpointV2Middleware\",\n};\nconst getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({\n applyToStack: (clientStack) => {\n clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {\n httpAuthSchemeParametersProvider,\n identityProviderConfigProvider,\n }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);\n },\n});\n\nconst httpAuthSchemeMiddlewareOptions = {\n step: \"serialize\",\n tags: [\"HTTP_AUTH_SCHEME\"],\n name: \"httpAuthSchemeMiddleware\",\n override: true,\n relation: \"before\",\n toMiddleware: middlewareSerde.serializerMiddlewareOption.name,\n};\nconst getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({\n applyToStack: (clientStack) => {\n clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {\n httpAuthSchemeParametersProvider,\n identityProviderConfigProvider,\n }), httpAuthSchemeMiddlewareOptions);\n },\n});\n\nconst defaultErrorHandler = (signingProperties) => (error) => {\n throw error;\n};\nconst defaultSuccessHandler = (httpResponse, signingProperties) => { };\nconst httpSigningMiddleware = (config) => (next, context) => async (args) => {\n if (!protocolHttp.HttpRequest.isInstance(args.request)) {\n return next(args);\n }\n const smithyContext = utilMiddleware.getSmithyContext(context);\n const scheme = smithyContext.selectedHttpAuthScheme;\n if (!scheme) {\n throw new Error(`No HttpAuthScheme was selected: unable to sign request`);\n }\n const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;\n const output = await next({\n ...args,\n request: await signer.sign(args.request, identity, signingProperties),\n }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));\n (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);\n return output;\n};\n\nconst httpSigningMiddlewareOptions = {\n step: \"finalizeRequest\",\n tags: [\"HTTP_SIGNING\"],\n name: \"httpSigningMiddleware\",\n aliases: [\"apiKeyMiddleware\", \"tokenMiddleware\", \"awsAuthMiddleware\"],\n override: true,\n relation: \"after\",\n toMiddleware: \"retryMiddleware\",\n};\nconst getHttpSigningPlugin = (config) => ({\n applyToStack: (clientStack) => {\n clientStack.addRelativeTo(httpSigningMiddleware(), httpSigningMiddlewareOptions);\n },\n});\n\nconst normalizeProvider = (input) => {\n if (typeof input === \"function\")\n return input;\n const promisified = Promise.resolve(input);\n return () => promisified;\n};\n\nconst makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => {\n let command = new CommandCtor(input);\n command = withCommand(command) ?? command;\n return await client.send(command, ...args);\n};\nfunction createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {\n return async function* paginateOperation(config, input, ...additionalArguments) {\n const _input = input;\n let token = config.startingToken ?? _input[inputTokenName];\n let hasNext = true;\n let page;\n while (hasNext) {\n _input[inputTokenName] = token;\n if (pageSizeTokenName) {\n _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;\n }\n if (config.client instanceof ClientCtor) {\n page = await makePagedClientRequest(CommandCtor, config.client, input, config.withCommand, ...additionalArguments);\n }\n else {\n throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);\n }\n yield page;\n const prevToken = token;\n token = get(page, outputTokenName);\n hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));\n }\n return undefined;\n };\n}\nconst get = (fromObject, path) => {\n let cursor = fromObject;\n const pathComponents = path.split(\".\");\n for (const step of pathComponents) {\n if (!cursor || typeof cursor !== \"object\") {\n return undefined;\n }\n cursor = cursor[step];\n }\n return cursor;\n};\n\nfunction setFeature(context, feature, value) {\n if (!context.__smithy_context) {\n context.__smithy_context = {\n features: {},\n };\n }\n else if (!context.__smithy_context.features) {\n context.__smithy_context.features = {};\n }\n context.__smithy_context.features[feature] = value;\n}\n\nclass DefaultIdentityProviderConfig {\n authSchemes = new Map();\n constructor(config) {\n for (const [key, value] of Object.entries(config)) {\n if (value !== undefined) {\n this.authSchemes.set(key, value);\n }\n }\n }\n getIdentityProvider(schemeId) {\n return this.authSchemes.get(schemeId);\n }\n}\n\nclass HttpApiKeyAuthSigner {\n async sign(httpRequest, identity, signingProperties) {\n if (!signingProperties) {\n throw new Error(\"request could not be signed with `apiKey` since the `name` and `in` signer properties are missing\");\n }\n if (!signingProperties.name) {\n throw new Error(\"request could not be signed with `apiKey` since the `name` signer property is missing\");\n }\n if (!signingProperties.in) {\n throw new Error(\"request could not be signed with `apiKey` since the `in` signer property is missing\");\n }\n if (!identity.apiKey) {\n throw new Error(\"request could not be signed with `apiKey` since the `apiKey` is not defined\");\n }\n const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest);\n if (signingProperties.in === types.HttpApiKeyAuthLocation.QUERY) {\n clonedRequest.query[signingProperties.name] = identity.apiKey;\n }\n else if (signingProperties.in === types.HttpApiKeyAuthLocation.HEADER) {\n clonedRequest.headers[signingProperties.name] = signingProperties.scheme\n ? `${signingProperties.scheme} ${identity.apiKey}`\n : identity.apiKey;\n }\n else {\n throw new Error(\"request can only be signed with `apiKey` locations `query` or `header`, \" +\n \"but found: `\" +\n signingProperties.in +\n \"`\");\n }\n return clonedRequest;\n }\n}\n\nclass HttpBearerAuthSigner {\n async sign(httpRequest, identity, signingProperties) {\n const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest);\n if (!identity.token) {\n throw new Error(\"request could not be signed with `token` since the `token` is not defined\");\n }\n clonedRequest.headers[\"Authorization\"] = `Bearer ${identity.token}`;\n return clonedRequest;\n }\n}\n\nclass NoAuthSigner {\n async sign(httpRequest, identity, signingProperties) {\n return httpRequest;\n }\n}\n\nconst createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired(identity) {\n return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;\n};\nconst EXPIRATION_MS = 300_000;\nconst isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);\nconst doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined;\nconst memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {\n if (provider === undefined) {\n return undefined;\n }\n const normalizedProvider = typeof provider !== \"function\" ? async () => Promise.resolve(provider) : provider;\n let resolved;\n let pending;\n let hasResult;\n let isConstant = false;\n const coalesceProvider = async (options) => {\n if (!pending) {\n pending = normalizedProvider(options);\n }\n try {\n resolved = await pending;\n hasResult = true;\n isConstant = false;\n }\n finally {\n pending = undefined;\n }\n return resolved;\n };\n if (isExpired === undefined) {\n return async (options) => {\n if (!hasResult || options?.forceRefresh) {\n resolved = await coalesceProvider(options);\n }\n return resolved;\n };\n }\n return async (options) => {\n if (!hasResult || options?.forceRefresh) {\n resolved = await coalesceProvider(options);\n }\n if (isConstant) {\n return resolved;\n }\n if (!requiresRefresh(resolved)) {\n isConstant = true;\n return resolved;\n }\n if (isExpired(resolved)) {\n await coalesceProvider(options);\n return resolved;\n }\n return resolved;\n };\n};\n\nObject.defineProperty(exports, \"requestBuilder\", {\n enumerable: true,\n get: function () { return protocols.requestBuilder; }\n});\nexports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig;\nexports.EXPIRATION_MS = EXPIRATION_MS;\nexports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner;\nexports.HttpBearerAuthSigner = HttpBearerAuthSigner;\nexports.NoAuthSigner = NoAuthSigner;\nexports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction;\nexports.createPaginator = createPaginator;\nexports.doesIdentityRequireRefresh = doesIdentityRequireRefresh;\nexports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin;\nexports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin;\nexports.getHttpSigningPlugin = getHttpSigningPlugin;\nexports.getSmithyContext = getSmithyContext;\nexports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = httpAuthSchemeEndpointRuleSetMiddlewareOptions;\nexports.httpAuthSchemeMiddleware = httpAuthSchemeMiddleware;\nexports.httpAuthSchemeMiddlewareOptions = httpAuthSchemeMiddlewareOptions;\nexports.httpSigningMiddleware = httpSigningMiddleware;\nexports.httpSigningMiddlewareOptions = httpSigningMiddlewareOptions;\nexports.isIdentityExpired = isIdentityExpired;\nexports.memoizeIdentityProvider = memoizeIdentityProvider;\nexports.normalizeProvider = normalizeProvider;\nexports.setFeature = setFeature;\n", - "'use strict';\n\nvar types = require('@smithy/types');\n\nclass EndpointCache {\n capacity;\n data = new Map();\n parameters = [];\n constructor({ size, params }) {\n this.capacity = size ?? 50;\n if (params) {\n this.parameters = params;\n }\n }\n get(endpointParams, resolver) {\n const key = this.hash(endpointParams);\n if (key === false) {\n return resolver();\n }\n if (!this.data.has(key)) {\n if (this.data.size > this.capacity + 10) {\n const keys = this.data.keys();\n let i = 0;\n while (true) {\n const { value, done } = keys.next();\n this.data.delete(value);\n if (done || ++i > 10) {\n break;\n }\n }\n }\n this.data.set(key, resolver());\n }\n return this.data.get(key);\n }\n size() {\n return this.data.size;\n }\n hash(endpointParams) {\n let buffer = \"\";\n const { parameters } = this;\n if (parameters.length === 0) {\n return false;\n }\n for (const param of parameters) {\n const val = String(endpointParams[param] ?? \"\");\n if (val.includes(\"|;\")) {\n return false;\n }\n buffer += val + \"|;\";\n }\n return buffer;\n }\n}\n\nconst 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}$`);\nconst isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith(\"[\") && value.endsWith(\"]\"));\n\nconst VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);\nconst isValidHostLabel = (value, allowSubDomains = false) => {\n if (!allowSubDomains) {\n return VALID_HOST_LABEL_REGEX.test(value);\n }\n const labels = value.split(\".\");\n for (const label of labels) {\n if (!isValidHostLabel(label)) {\n return false;\n }\n }\n return true;\n};\n\nconst customEndpointFunctions = {};\n\nconst debugId = \"endpoints\";\n\nfunction toDebugString(input) {\n if (typeof input !== \"object\" || input == null) {\n return input;\n }\n if (\"ref\" in input) {\n return `$${toDebugString(input.ref)}`;\n }\n if (\"fn\" in input) {\n return `${input.fn}(${(input.argv || []).map(toDebugString).join(\", \")})`;\n }\n return JSON.stringify(input, null, 2);\n}\n\nclass EndpointError extends Error {\n constructor(message) {\n super(message);\n this.name = \"EndpointError\";\n }\n}\n\nconst booleanEquals = (value1, value2) => value1 === value2;\n\nconst getAttrPathList = (path) => {\n const parts = path.split(\".\");\n const pathList = [];\n for (const part of parts) {\n const squareBracketIndex = part.indexOf(\"[\");\n if (squareBracketIndex !== -1) {\n if (part.indexOf(\"]\") !== part.length - 1) {\n throw new EndpointError(`Path: '${path}' does not end with ']'`);\n }\n const arrayIndex = part.slice(squareBracketIndex + 1, -1);\n if (Number.isNaN(parseInt(arrayIndex))) {\n throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);\n }\n if (squareBracketIndex !== 0) {\n pathList.push(part.slice(0, squareBracketIndex));\n }\n pathList.push(arrayIndex);\n }\n else {\n pathList.push(part);\n }\n }\n return pathList;\n};\n\nconst getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {\n if (typeof acc !== \"object\") {\n throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);\n }\n else if (Array.isArray(acc)) {\n return acc[parseInt(index)];\n }\n return acc[index];\n}, value);\n\nconst isSet = (value) => value != null;\n\nconst not = (value) => !value;\n\nconst DEFAULT_PORTS = {\n [types.EndpointURLScheme.HTTP]: 80,\n [types.EndpointURLScheme.HTTPS]: 443,\n};\nconst parseURL = (value) => {\n const whatwgURL = (() => {\n try {\n if (value instanceof URL) {\n return value;\n }\n if (typeof value === \"object\" && \"hostname\" in value) {\n const { hostname, port, protocol = \"\", path = \"\", query = {} } = value;\n const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : \"\"}${path}`);\n url.search = Object.entries(query)\n .map(([k, v]) => `${k}=${v}`)\n .join(\"&\");\n return url;\n }\n return new URL(value);\n }\n catch (error) {\n return null;\n }\n })();\n if (!whatwgURL) {\n console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);\n return null;\n }\n const urlString = whatwgURL.href;\n const { host, hostname, pathname, protocol, search } = whatwgURL;\n if (search) {\n return null;\n }\n const scheme = protocol.slice(0, -1);\n if (!Object.values(types.EndpointURLScheme).includes(scheme)) {\n return null;\n }\n const isIp = isIpAddress(hostname);\n const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) ||\n (typeof value === \"string\" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`));\n const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;\n return {\n scheme,\n authority,\n path: pathname,\n normalizedPath: pathname.endsWith(\"/\") ? pathname : `${pathname}/`,\n isIp,\n };\n};\n\nconst stringEquals = (value1, value2) => value1 === value2;\n\nconst substring = (input, start, stop, reverse) => {\n if (start >= stop || input.length < stop) {\n return null;\n }\n if (!reverse) {\n return input.substring(start, stop);\n }\n return input.substring(input.length - stop, input.length - start);\n};\n\nconst uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);\n\nconst endpointFunctions = {\n booleanEquals,\n getAttr,\n isSet,\n isValidHostLabel,\n not,\n parseURL,\n stringEquals,\n substring,\n uriEncode,\n};\n\nconst evaluateTemplate = (template, options) => {\n const evaluatedTemplateArr = [];\n const templateContext = {\n ...options.endpointParams,\n ...options.referenceRecord,\n };\n let currentIndex = 0;\n while (currentIndex < template.length) {\n const openingBraceIndex = template.indexOf(\"{\", currentIndex);\n if (openingBraceIndex === -1) {\n evaluatedTemplateArr.push(template.slice(currentIndex));\n break;\n }\n evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));\n const closingBraceIndex = template.indexOf(\"}\", openingBraceIndex);\n if (closingBraceIndex === -1) {\n evaluatedTemplateArr.push(template.slice(openingBraceIndex));\n break;\n }\n if (template[openingBraceIndex + 1] === \"{\" && template[closingBraceIndex + 1] === \"}\") {\n evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));\n currentIndex = closingBraceIndex + 2;\n }\n const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);\n if (parameterName.includes(\"#\")) {\n const [refName, attrName] = parameterName.split(\"#\");\n evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));\n }\n else {\n evaluatedTemplateArr.push(templateContext[parameterName]);\n }\n currentIndex = closingBraceIndex + 1;\n }\n return evaluatedTemplateArr.join(\"\");\n};\n\nconst getReferenceValue = ({ ref }, options) => {\n const referenceRecord = {\n ...options.endpointParams,\n ...options.referenceRecord,\n };\n return referenceRecord[ref];\n};\n\nconst evaluateExpression = (obj, keyName, options) => {\n if (typeof obj === \"string\") {\n return evaluateTemplate(obj, options);\n }\n else if (obj[\"fn\"]) {\n return group$2.callFunction(obj, options);\n }\n else if (obj[\"ref\"]) {\n return getReferenceValue(obj, options);\n }\n throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);\n};\nconst callFunction = ({ fn, argv }, options) => {\n const evaluatedArgs = argv.map((arg) => [\"boolean\", \"number\"].includes(typeof arg) ? arg : group$2.evaluateExpression(arg, \"arg\", options));\n const fnSegments = fn.split(\".\");\n if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {\n return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);\n }\n return endpointFunctions[fn](...evaluatedArgs);\n};\nconst group$2 = {\n evaluateExpression,\n callFunction,\n};\n\nconst evaluateCondition = ({ assign, ...fnArgs }, options) => {\n if (assign && assign in options.referenceRecord) {\n throw new EndpointError(`'${assign}' is already defined in Reference Record.`);\n }\n const value = callFunction(fnArgs, options);\n options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);\n return {\n result: value === \"\" ? true : !!value,\n ...(assign != null && { toAssign: { name: assign, value } }),\n };\n};\n\nconst evaluateConditions = (conditions = [], options) => {\n const conditionsReferenceRecord = {};\n for (const condition of conditions) {\n const { result, toAssign } = evaluateCondition(condition, {\n ...options,\n referenceRecord: {\n ...options.referenceRecord,\n ...conditionsReferenceRecord,\n },\n });\n if (!result) {\n return { result };\n }\n if (toAssign) {\n conditionsReferenceRecord[toAssign.name] = toAssign.value;\n options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);\n }\n }\n return { result: true, referenceRecord: conditionsReferenceRecord };\n};\n\nconst getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({\n ...acc,\n [headerKey]: headerVal.map((headerValEntry) => {\n const processedExpr = evaluateExpression(headerValEntry, \"Header value entry\", options);\n if (typeof processedExpr !== \"string\") {\n throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);\n }\n return processedExpr;\n }),\n}), {});\n\nconst getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({\n ...acc,\n [propertyKey]: group$1.getEndpointProperty(propertyVal, options),\n}), {});\nconst getEndpointProperty = (property, options) => {\n if (Array.isArray(property)) {\n return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));\n }\n switch (typeof property) {\n case \"string\":\n return evaluateTemplate(property, options);\n case \"object\":\n if (property === null) {\n throw new EndpointError(`Unexpected endpoint property: ${property}`);\n }\n return group$1.getEndpointProperties(property, options);\n case \"boolean\":\n return property;\n default:\n throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);\n }\n};\nconst group$1 = {\n getEndpointProperty,\n getEndpointProperties,\n};\n\nconst getEndpointUrl = (endpointUrl, options) => {\n const expression = evaluateExpression(endpointUrl, \"Endpoint URL\", options);\n if (typeof expression === \"string\") {\n try {\n return new URL(expression);\n }\n catch (error) {\n console.error(`Failed to construct URL with ${expression}`, error);\n throw error;\n }\n }\n throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);\n};\n\nconst evaluateEndpointRule = (endpointRule, options) => {\n const { conditions, endpoint } = endpointRule;\n const { result, referenceRecord } = evaluateConditions(conditions, options);\n if (!result) {\n return;\n }\n const endpointRuleOptions = {\n ...options,\n referenceRecord: { ...options.referenceRecord, ...referenceRecord },\n };\n const { url, properties, headers } = endpoint;\n options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);\n return {\n ...(headers != undefined && {\n headers: getEndpointHeaders(headers, endpointRuleOptions),\n }),\n ...(properties != undefined && {\n properties: getEndpointProperties(properties, endpointRuleOptions),\n }),\n url: getEndpointUrl(url, endpointRuleOptions),\n };\n};\n\nconst evaluateErrorRule = (errorRule, options) => {\n const { conditions, error } = errorRule;\n const { result, referenceRecord } = evaluateConditions(conditions, options);\n if (!result) {\n return;\n }\n throw new EndpointError(evaluateExpression(error, \"Error\", {\n ...options,\n referenceRecord: { ...options.referenceRecord, ...referenceRecord },\n }));\n};\n\nconst evaluateRules = (rules, options) => {\n for (const rule of rules) {\n if (rule.type === \"endpoint\") {\n const endpointOrUndefined = evaluateEndpointRule(rule, options);\n if (endpointOrUndefined) {\n return endpointOrUndefined;\n }\n }\n else if (rule.type === \"error\") {\n evaluateErrorRule(rule, options);\n }\n else if (rule.type === \"tree\") {\n const endpointOrUndefined = group.evaluateTreeRule(rule, options);\n if (endpointOrUndefined) {\n return endpointOrUndefined;\n }\n }\n else {\n throw new EndpointError(`Unknown endpoint rule: ${rule}`);\n }\n }\n throw new EndpointError(`Rules evaluation failed`);\n};\nconst evaluateTreeRule = (treeRule, options) => {\n const { conditions, rules } = treeRule;\n const { result, referenceRecord } = evaluateConditions(conditions, options);\n if (!result) {\n return;\n }\n return group.evaluateRules(rules, {\n ...options,\n referenceRecord: { ...options.referenceRecord, ...referenceRecord },\n });\n};\nconst group = {\n evaluateRules,\n evaluateTreeRule,\n};\n\nconst resolveEndpoint = (ruleSetObject, options) => {\n const { endpointParams, logger } = options;\n const { parameters, rules } = ruleSetObject;\n options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);\n const paramsWithDefault = Object.entries(parameters)\n .filter(([, v]) => v.default != null)\n .map(([k, v]) => [k, v.default]);\n if (paramsWithDefault.length > 0) {\n for (const [paramKey, paramDefaultValue] of paramsWithDefault) {\n endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;\n }\n }\n const requiredParams = Object.entries(parameters)\n .filter(([, v]) => v.required)\n .map(([k]) => k);\n for (const requiredParam of requiredParams) {\n if (endpointParams[requiredParam] == null) {\n throw new EndpointError(`Missing required parameter: '${requiredParam}'`);\n }\n }\n const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });\n options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);\n return endpoint;\n};\n\nexports.EndpointCache = EndpointCache;\nexports.EndpointError = EndpointError;\nexports.customEndpointFunctions = customEndpointFunctions;\nexports.isIpAddress = isIpAddress;\nexports.isValidHostLabel = isValidHostLabel;\nexports.resolveEndpoint = resolveEndpoint;\n", - "'use strict';\n\nfunction parseQueryString(querystring) {\n const query = {};\n querystring = querystring.replace(/^\\?/, \"\");\n if (querystring) {\n for (const pair of querystring.split(\"&\")) {\n let [key, value = null] = pair.split(\"=\");\n key = decodeURIComponent(key);\n if (value) {\n value = decodeURIComponent(value);\n }\n if (!(key in query)) {\n query[key] = value;\n }\n else if (Array.isArray(query[key])) {\n query[key].push(value);\n }\n else {\n query[key] = [query[key], value];\n }\n }\n }\n return query;\n}\n\nexports.parseQueryString = parseQueryString;\n", - "'use strict';\n\nvar querystringParser = require('@smithy/querystring-parser');\n\nconst parseUrl = (url) => {\n if (typeof url === \"string\") {\n return parseUrl(new URL(url));\n }\n const { hostname, pathname, port, protocol, search } = url;\n let query;\n if (search) {\n query = querystringParser.parseQueryString(search);\n }\n return {\n hostname,\n port: port ? parseInt(port) : undefined,\n protocol,\n path: pathname,\n query,\n };\n};\n\nexports.parseUrl = parseUrl;\n", - "'use strict';\n\nvar utilEndpoints = require('@smithy/util-endpoints');\nvar urlParser = require('@smithy/url-parser');\n\nconst isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {\n if (allowSubDomains) {\n for (const label of value.split(\".\")) {\n if (!isVirtualHostableS3Bucket(label)) {\n return false;\n }\n }\n return true;\n }\n if (!utilEndpoints.isValidHostLabel(value)) {\n return false;\n }\n if (value.length < 3 || value.length > 63) {\n return false;\n }\n if (value !== value.toLowerCase()) {\n return false;\n }\n if (utilEndpoints.isIpAddress(value)) {\n return false;\n }\n return true;\n};\n\nconst ARN_DELIMITER = \":\";\nconst RESOURCE_DELIMITER = \"/\";\nconst parseArn = (value) => {\n const segments = value.split(ARN_DELIMITER);\n if (segments.length < 6)\n return null;\n const [arn, partition, service, region, accountId, ...resourcePath] = segments;\n if (arn !== \"arn\" || partition === \"\" || service === \"\" || resourcePath.join(ARN_DELIMITER) === \"\")\n return null;\n const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();\n return {\n partition,\n service,\n region,\n accountId,\n resourceId,\n };\n};\n\nvar partitions = [\n\t{\n\t\tid: \"aws\",\n\t\toutputs: {\n\t\t\tdnsSuffix: \"amazonaws.com\",\n\t\t\tdualStackDnsSuffix: \"api.aws\",\n\t\t\timplicitGlobalRegion: \"us-east-1\",\n\t\t\tname: \"aws\",\n\t\t\tsupportsDualStack: true,\n\t\t\tsupportsFIPS: true\n\t\t},\n\t\tregionRegex: \"^(us|eu|ap|sa|ca|me|af|il|mx)\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tregions: {\n\t\t\t\"af-south-1\": {\n\t\t\t\tdescription: \"Africa (Cape Town)\"\n\t\t\t},\n\t\t\t\"ap-east-1\": {\n\t\t\t\tdescription: \"Asia Pacific (Hong Kong)\"\n\t\t\t},\n\t\t\t\"ap-east-2\": {\n\t\t\t\tdescription: \"Asia Pacific (Taipei)\"\n\t\t\t},\n\t\t\t\"ap-northeast-1\": {\n\t\t\t\tdescription: \"Asia Pacific (Tokyo)\"\n\t\t\t},\n\t\t\t\"ap-northeast-2\": {\n\t\t\t\tdescription: \"Asia Pacific (Seoul)\"\n\t\t\t},\n\t\t\t\"ap-northeast-3\": {\n\t\t\t\tdescription: \"Asia Pacific (Osaka)\"\n\t\t\t},\n\t\t\t\"ap-south-1\": {\n\t\t\t\tdescription: \"Asia Pacific (Mumbai)\"\n\t\t\t},\n\t\t\t\"ap-south-2\": {\n\t\t\t\tdescription: \"Asia Pacific (Hyderabad)\"\n\t\t\t},\n\t\t\t\"ap-southeast-1\": {\n\t\t\t\tdescription: \"Asia Pacific (Singapore)\"\n\t\t\t},\n\t\t\t\"ap-southeast-2\": {\n\t\t\t\tdescription: \"Asia Pacific (Sydney)\"\n\t\t\t},\n\t\t\t\"ap-southeast-3\": {\n\t\t\t\tdescription: \"Asia Pacific (Jakarta)\"\n\t\t\t},\n\t\t\t\"ap-southeast-4\": {\n\t\t\t\tdescription: \"Asia Pacific (Melbourne)\"\n\t\t\t},\n\t\t\t\"ap-southeast-5\": {\n\t\t\t\tdescription: \"Asia Pacific (Malaysia)\"\n\t\t\t},\n\t\t\t\"ap-southeast-6\": {\n\t\t\t\tdescription: \"Asia Pacific (New Zealand)\"\n\t\t\t},\n\t\t\t\"ap-southeast-7\": {\n\t\t\t\tdescription: \"Asia Pacific (Thailand)\"\n\t\t\t},\n\t\t\t\"aws-global\": {\n\t\t\t\tdescription: \"aws global region\"\n\t\t\t},\n\t\t\t\"ca-central-1\": {\n\t\t\t\tdescription: \"Canada (Central)\"\n\t\t\t},\n\t\t\t\"ca-west-1\": {\n\t\t\t\tdescription: \"Canada West (Calgary)\"\n\t\t\t},\n\t\t\t\"eu-central-1\": {\n\t\t\t\tdescription: \"Europe (Frankfurt)\"\n\t\t\t},\n\t\t\t\"eu-central-2\": {\n\t\t\t\tdescription: \"Europe (Zurich)\"\n\t\t\t},\n\t\t\t\"eu-north-1\": {\n\t\t\t\tdescription: \"Europe (Stockholm)\"\n\t\t\t},\n\t\t\t\"eu-south-1\": {\n\t\t\t\tdescription: \"Europe (Milan)\"\n\t\t\t},\n\t\t\t\"eu-south-2\": {\n\t\t\t\tdescription: \"Europe (Spain)\"\n\t\t\t},\n\t\t\t\"eu-west-1\": {\n\t\t\t\tdescription: \"Europe (Ireland)\"\n\t\t\t},\n\t\t\t\"eu-west-2\": {\n\t\t\t\tdescription: \"Europe (London)\"\n\t\t\t},\n\t\t\t\"eu-west-3\": {\n\t\t\t\tdescription: \"Europe (Paris)\"\n\t\t\t},\n\t\t\t\"il-central-1\": {\n\t\t\t\tdescription: \"Israel (Tel Aviv)\"\n\t\t\t},\n\t\t\t\"me-central-1\": {\n\t\t\t\tdescription: \"Middle East (UAE)\"\n\t\t\t},\n\t\t\t\"me-south-1\": {\n\t\t\t\tdescription: \"Middle East (Bahrain)\"\n\t\t\t},\n\t\t\t\"mx-central-1\": {\n\t\t\t\tdescription: \"Mexico (Central)\"\n\t\t\t},\n\t\t\t\"sa-east-1\": {\n\t\t\t\tdescription: \"South America (Sao Paulo)\"\n\t\t\t},\n\t\t\t\"us-east-1\": {\n\t\t\t\tdescription: \"US East (N. Virginia)\"\n\t\t\t},\n\t\t\t\"us-east-2\": {\n\t\t\t\tdescription: \"US East (Ohio)\"\n\t\t\t},\n\t\t\t\"us-west-1\": {\n\t\t\t\tdescription: \"US West (N. California)\"\n\t\t\t},\n\t\t\t\"us-west-2\": {\n\t\t\t\tdescription: \"US West (Oregon)\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tid: \"aws-cn\",\n\t\toutputs: {\n\t\t\tdnsSuffix: \"amazonaws.com.cn\",\n\t\t\tdualStackDnsSuffix: \"api.amazonwebservices.com.cn\",\n\t\t\timplicitGlobalRegion: \"cn-northwest-1\",\n\t\t\tname: \"aws-cn\",\n\t\t\tsupportsDualStack: true,\n\t\t\tsupportsFIPS: true\n\t\t},\n\t\tregionRegex: \"^cn\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tregions: {\n\t\t\t\"aws-cn-global\": {\n\t\t\t\tdescription: \"aws-cn global region\"\n\t\t\t},\n\t\t\t\"cn-north-1\": {\n\t\t\t\tdescription: \"China (Beijing)\"\n\t\t\t},\n\t\t\t\"cn-northwest-1\": {\n\t\t\t\tdescription: \"China (Ningxia)\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tid: \"aws-eusc\",\n\t\toutputs: {\n\t\t\tdnsSuffix: \"amazonaws.eu\",\n\t\t\tdualStackDnsSuffix: \"api.amazonwebservices.eu\",\n\t\t\timplicitGlobalRegion: \"eusc-de-east-1\",\n\t\t\tname: \"aws-eusc\",\n\t\t\tsupportsDualStack: true,\n\t\t\tsupportsFIPS: true\n\t\t},\n\t\tregionRegex: \"^eusc\\\\-(de)\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tregions: {\n\t\t\t\"eusc-de-east-1\": {\n\t\t\t\tdescription: \"EU (Germany)\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tid: \"aws-iso\",\n\t\toutputs: {\n\t\t\tdnsSuffix: \"c2s.ic.gov\",\n\t\t\tdualStackDnsSuffix: \"api.aws.ic.gov\",\n\t\t\timplicitGlobalRegion: \"us-iso-east-1\",\n\t\t\tname: \"aws-iso\",\n\t\t\tsupportsDualStack: true,\n\t\t\tsupportsFIPS: true\n\t\t},\n\t\tregionRegex: \"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tregions: {\n\t\t\t\"aws-iso-global\": {\n\t\t\t\tdescription: \"aws-iso global region\"\n\t\t\t},\n\t\t\t\"us-iso-east-1\": {\n\t\t\t\tdescription: \"US ISO East\"\n\t\t\t},\n\t\t\t\"us-iso-west-1\": {\n\t\t\t\tdescription: \"US ISO WEST\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tid: \"aws-iso-b\",\n\t\toutputs: {\n\t\t\tdnsSuffix: \"sc2s.sgov.gov\",\n\t\t\tdualStackDnsSuffix: \"api.aws.scloud\",\n\t\t\timplicitGlobalRegion: \"us-isob-east-1\",\n\t\t\tname: \"aws-iso-b\",\n\t\t\tsupportsDualStack: true,\n\t\t\tsupportsFIPS: true\n\t\t},\n\t\tregionRegex: \"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tregions: {\n\t\t\t\"aws-iso-b-global\": {\n\t\t\t\tdescription: \"aws-iso-b global region\"\n\t\t\t},\n\t\t\t\"us-isob-east-1\": {\n\t\t\t\tdescription: \"US ISOB East (Ohio)\"\n\t\t\t},\n\t\t\t\"us-isob-west-1\": {\n\t\t\t\tdescription: \"US ISOB West\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tid: \"aws-iso-e\",\n\t\toutputs: {\n\t\t\tdnsSuffix: \"cloud.adc-e.uk\",\n\t\t\tdualStackDnsSuffix: \"api.cloud-aws.adc-e.uk\",\n\t\t\timplicitGlobalRegion: \"eu-isoe-west-1\",\n\t\t\tname: \"aws-iso-e\",\n\t\t\tsupportsDualStack: true,\n\t\t\tsupportsFIPS: true\n\t\t},\n\t\tregionRegex: \"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tregions: {\n\t\t\t\"aws-iso-e-global\": {\n\t\t\t\tdescription: \"aws-iso-e global region\"\n\t\t\t},\n\t\t\t\"eu-isoe-west-1\": {\n\t\t\t\tdescription: \"EU ISOE West\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tid: \"aws-iso-f\",\n\t\toutputs: {\n\t\t\tdnsSuffix: \"csp.hci.ic.gov\",\n\t\t\tdualStackDnsSuffix: \"api.aws.hci.ic.gov\",\n\t\t\timplicitGlobalRegion: \"us-isof-south-1\",\n\t\t\tname: \"aws-iso-f\",\n\t\t\tsupportsDualStack: true,\n\t\t\tsupportsFIPS: true\n\t\t},\n\t\tregionRegex: \"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tregions: {\n\t\t\t\"aws-iso-f-global\": {\n\t\t\t\tdescription: \"aws-iso-f global region\"\n\t\t\t},\n\t\t\t\"us-isof-east-1\": {\n\t\t\t\tdescription: \"US ISOF EAST\"\n\t\t\t},\n\t\t\t\"us-isof-south-1\": {\n\t\t\t\tdescription: \"US ISOF SOUTH\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tid: \"aws-us-gov\",\n\t\toutputs: {\n\t\t\tdnsSuffix: \"amazonaws.com\",\n\t\t\tdualStackDnsSuffix: \"api.aws\",\n\t\t\timplicitGlobalRegion: \"us-gov-west-1\",\n\t\t\tname: \"aws-us-gov\",\n\t\t\tsupportsDualStack: true,\n\t\t\tsupportsFIPS: true\n\t\t},\n\t\tregionRegex: \"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\",\n\t\tregions: {\n\t\t\t\"aws-us-gov-global\": {\n\t\t\t\tdescription: \"aws-us-gov global region\"\n\t\t\t},\n\t\t\t\"us-gov-east-1\": {\n\t\t\t\tdescription: \"AWS GovCloud (US-East)\"\n\t\t\t},\n\t\t\t\"us-gov-west-1\": {\n\t\t\t\tdescription: \"AWS GovCloud (US-West)\"\n\t\t\t}\n\t\t}\n\t}\n];\nvar version = \"1.1\";\nvar partitionsInfo = {\n\tpartitions: partitions,\n\tversion: version\n};\n\nlet selectedPartitionsInfo = partitionsInfo;\nlet selectedUserAgentPrefix = \"\";\nconst partition = (value) => {\n const { partitions } = selectedPartitionsInfo;\n for (const partition of partitions) {\n const { regions, outputs } = partition;\n for (const [region, regionData] of Object.entries(regions)) {\n if (region === value) {\n return {\n ...outputs,\n ...regionData,\n };\n }\n }\n }\n for (const partition of partitions) {\n const { regionRegex, outputs } = partition;\n if (new RegExp(regionRegex).test(value)) {\n return {\n ...outputs,\n };\n }\n }\n const DEFAULT_PARTITION = partitions.find((partition) => partition.id === \"aws\");\n if (!DEFAULT_PARTITION) {\n throw new Error(\"Provided region was not found in the partition array or regex,\" +\n \" and default partition with id 'aws' doesn't exist.\");\n }\n return {\n ...DEFAULT_PARTITION.outputs,\n };\n};\nconst setPartitionInfo = (partitionsInfo, userAgentPrefix = \"\") => {\n selectedPartitionsInfo = partitionsInfo;\n selectedUserAgentPrefix = userAgentPrefix;\n};\nconst useDefaultPartitionInfo = () => {\n setPartitionInfo(partitionsInfo, \"\");\n};\nconst getUserAgentPrefix = () => selectedUserAgentPrefix;\n\nconst awsEndpointFunctions = {\n isVirtualHostableS3Bucket: isVirtualHostableS3Bucket,\n parseArn: parseArn,\n partition: partition,\n};\nutilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions;\n\nconst resolveDefaultAwsRegionalEndpointsConfig = (input) => {\n if (typeof input.endpointProvider !== \"function\") {\n throw new Error(\"@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.\");\n }\n const { endpoint } = input;\n if (endpoint === undefined) {\n input.endpoint = async () => {\n return toEndpointV1(input.endpointProvider({\n Region: typeof input.region === \"function\" ? await input.region() : input.region,\n UseDualStack: typeof input.useDualstackEndpoint === \"function\"\n ? await input.useDualstackEndpoint()\n : input.useDualstackEndpoint,\n UseFIPS: typeof input.useFipsEndpoint === \"function\" ? await input.useFipsEndpoint() : input.useFipsEndpoint,\n Endpoint: undefined,\n }, { logger: input.logger }));\n };\n }\n return input;\n};\nconst toEndpointV1 = (endpoint) => urlParser.parseUrl(endpoint.url);\n\nObject.defineProperty(exports, \"EndpointError\", {\n enumerable: true,\n get: function () { return utilEndpoints.EndpointError; }\n});\nObject.defineProperty(exports, \"isIpAddress\", {\n enumerable: true,\n get: function () { return utilEndpoints.isIpAddress; }\n});\nObject.defineProperty(exports, \"resolveEndpoint\", {\n enumerable: true,\n get: function () { return utilEndpoints.resolveEndpoint; }\n});\nexports.awsEndpointFunctions = awsEndpointFunctions;\nexports.getUserAgentPrefix = getUserAgentPrefix;\nexports.partition = partition;\nexports.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig;\nexports.setPartitionInfo = setPartitionInfo;\nexports.toEndpointV1 = toEndpointV1;\nexports.useDefaultPartitionInfo = useDefaultPartitionInfo;\n", - "'use strict';\n\nclass ProviderError extends Error {\n name = \"ProviderError\";\n tryNextLink;\n constructor(message, options = true) {\n let logger;\n let tryNextLink = true;\n if (typeof options === \"boolean\") {\n logger = undefined;\n tryNextLink = options;\n }\n else if (options != null && typeof options === \"object\") {\n logger = options.logger;\n tryNextLink = options.tryNextLink ?? true;\n }\n super(message);\n this.tryNextLink = tryNextLink;\n Object.setPrototypeOf(this, ProviderError.prototype);\n logger?.debug?.(`@smithy/property-provider ${tryNextLink ? \"->\" : \"(!)\"} ${message}`);\n }\n static from(error, options = true) {\n return Object.assign(new this(error.message, options), error);\n }\n}\n\nclass CredentialsProviderError extends ProviderError {\n name = \"CredentialsProviderError\";\n constructor(message, options = true) {\n super(message, options);\n Object.setPrototypeOf(this, CredentialsProviderError.prototype);\n }\n}\n\nclass TokenProviderError extends ProviderError {\n name = \"TokenProviderError\";\n constructor(message, options = true) {\n super(message, options);\n Object.setPrototypeOf(this, TokenProviderError.prototype);\n }\n}\n\nconst chain = (...providers) => async () => {\n if (providers.length === 0) {\n throw new ProviderError(\"No providers in chain\");\n }\n let lastProviderError;\n for (const provider of providers) {\n try {\n const credentials = await provider();\n return credentials;\n }\n catch (err) {\n lastProviderError = err;\n if (err?.tryNextLink) {\n continue;\n }\n throw err;\n }\n }\n throw lastProviderError;\n};\n\nconst fromStatic = (staticValue) => () => Promise.resolve(staticValue);\n\nconst memoize = (provider, isExpired, requiresRefresh) => {\n let resolved;\n let pending;\n let hasResult;\n let isConstant = false;\n const coalesceProvider = async () => {\n if (!pending) {\n pending = provider();\n }\n try {\n resolved = await pending;\n hasResult = true;\n isConstant = false;\n }\n finally {\n pending = undefined;\n }\n return resolved;\n };\n if (isExpired === undefined) {\n return async (options) => {\n if (!hasResult || options?.forceRefresh) {\n resolved = await coalesceProvider();\n }\n return resolved;\n };\n }\n return async (options) => {\n if (!hasResult || options?.forceRefresh) {\n resolved = await coalesceProvider();\n }\n if (isConstant) {\n return resolved;\n }\n if (requiresRefresh && !requiresRefresh(resolved)) {\n isConstant = true;\n return resolved;\n }\n if (isExpired(resolved)) {\n await coalesceProvider();\n return resolved;\n }\n return resolved;\n };\n};\n\nexports.CredentialsProviderError = CredentialsProviderError;\nexports.ProviderError = ProviderError;\nexports.TokenProviderError = TokenProviderError;\nexports.chain = chain;\nexports.fromStatic = fromStatic;\nexports.memoize = memoize;\n", - "'use strict';\n\nconst state = {\n warningEmitted: false,\n};\nconst emitWarningIfUnsupportedVersion = (version) => {\n if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf(\".\"))) < 18) {\n state.warningEmitted = true;\n process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will\nno longer support Node.js 16.x on January 6, 2025.\n\nTo continue receiving updates to AWS services, bug fixes, and security\nupdates please upgrade to a supported Node.js LTS version.\n\nMore information can be found at: https://a.co/74kJMmI`);\n }\n};\n\nfunction setCredentialFeature(credentials, feature, value) {\n if (!credentials.$source) {\n credentials.$source = {};\n }\n credentials.$source[feature] = value;\n return credentials;\n}\n\nfunction setFeature(context, feature, value) {\n if (!context.__aws_sdk_context) {\n context.__aws_sdk_context = {\n features: {},\n };\n }\n else if (!context.__aws_sdk_context.features) {\n context.__aws_sdk_context.features = {};\n }\n context.__aws_sdk_context.features[feature] = value;\n}\n\nfunction setTokenFeature(token, feature, value) {\n if (!token.$source) {\n token.$source = {};\n }\n token.$source[feature] = value;\n return token;\n}\n\nexports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion;\nexports.setCredentialFeature = setCredentialFeature;\nexports.setFeature = setFeature;\nexports.setTokenFeature = setTokenFeature;\nexports.state = state;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n fromHex: () => fromHex,\n toHex: () => toHex\n});\nmodule.exports = __toCommonJS(src_exports);\nvar SHORT_TO_HEX = {};\nvar HEX_TO_SHORT = {};\nfor (let i = 0; i < 256; i++) {\n let encodedByte = i.toString(16).toLowerCase();\n if (encodedByte.length === 1) {\n encodedByte = `0${encodedByte}`;\n }\n SHORT_TO_HEX[i] = encodedByte;\n HEX_TO_SHORT[encodedByte] = i;\n}\nfunction fromHex(encoded) {\n if (encoded.length % 2 !== 0) {\n throw new Error(\"Hex encoded strings must have an even number length\");\n }\n const out = new Uint8Array(encoded.length / 2);\n for (let i = 0; i < encoded.length; i += 2) {\n const encodedByte = encoded.slice(i, i + 2).toLowerCase();\n if (encodedByte in HEX_TO_SHORT) {\n out[i / 2] = HEX_TO_SHORT[encodedByte];\n } else {\n throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);\n }\n }\n return out;\n}\n__name(fromHex, \"fromHex\");\nfunction toHex(bytes) {\n let out = \"\";\n for (let i = 0; i < bytes.byteLength; i++) {\n out += SHORT_TO_HEX[bytes[i]];\n }\n return out;\n}\n__name(toHex, \"toHex\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n fromHex,\n toHex\n});\n\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n SignatureV4: () => SignatureV4,\n clearCredentialCache: () => clearCredentialCache,\n createScope: () => createScope,\n getCanonicalHeaders: () => getCanonicalHeaders,\n getCanonicalQuery: () => getCanonicalQuery,\n getPayloadHash: () => getPayloadHash,\n getSigningKey: () => getSigningKey,\n moveHeadersToQuery: () => moveHeadersToQuery,\n prepareRequest: () => prepareRequest\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/SignatureV4.ts\n\nvar import_util_middleware = require(\"@smithy/util-middleware\");\n\nvar import_util_utf84 = require(\"@smithy/util-utf8\");\n\n// src/constants.ts\nvar ALGORITHM_QUERY_PARAM = \"X-Amz-Algorithm\";\nvar CREDENTIAL_QUERY_PARAM = \"X-Amz-Credential\";\nvar AMZ_DATE_QUERY_PARAM = \"X-Amz-Date\";\nvar SIGNED_HEADERS_QUERY_PARAM = \"X-Amz-SignedHeaders\";\nvar EXPIRES_QUERY_PARAM = \"X-Amz-Expires\";\nvar SIGNATURE_QUERY_PARAM = \"X-Amz-Signature\";\nvar TOKEN_QUERY_PARAM = \"X-Amz-Security-Token\";\nvar AUTH_HEADER = \"authorization\";\nvar AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();\nvar DATE_HEADER = \"date\";\nvar GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];\nvar SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();\nvar SHA256_HEADER = \"x-amz-content-sha256\";\nvar TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();\nvar ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n \"cache-control\": true,\n connection: true,\n expect: true,\n from: true,\n \"keep-alive\": true,\n \"max-forwards\": true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n \"transfer-encoding\": true,\n upgrade: true,\n \"user-agent\": true,\n \"x-amzn-trace-id\": true\n};\nvar PROXY_HEADER_PATTERN = /^proxy-/;\nvar SEC_HEADER_PATTERN = /^sec-/;\nvar ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256\";\nvar EVENT_ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256-PAYLOAD\";\nvar UNSIGNED_PAYLOAD = \"UNSIGNED-PAYLOAD\";\nvar MAX_CACHE_SIZE = 50;\nvar KEY_TYPE_IDENTIFIER = \"aws4_request\";\nvar MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;\n\n// src/credentialDerivation.ts\nvar import_util_hex_encoding = require(\"@smithy/util-hex-encoding\");\nvar import_util_utf8 = require(\"@smithy/util-utf8\");\nvar signingKeyCache = {};\nvar cacheQueue = [];\nvar createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, \"createScope\");\nvar getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => {\n const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);\n const cacheKey = `${shortDate}:${region}:${service}:${(0, import_util_hex_encoding.toHex)(credsHash)}:${credentials.sessionToken}`;\n if (cacheKey in signingKeyCache) {\n return signingKeyCache[cacheKey];\n }\n cacheQueue.push(cacheKey);\n while (cacheQueue.length > MAX_CACHE_SIZE) {\n delete signingKeyCache[cacheQueue.shift()];\n }\n let key = `AWS4${credentials.secretAccessKey}`;\n for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {\n key = await hmac(sha256Constructor, key, signable);\n }\n return signingKeyCache[cacheKey] = key;\n}, \"getSigningKey\");\nvar clearCredentialCache = /* @__PURE__ */ __name(() => {\n cacheQueue.length = 0;\n Object.keys(signingKeyCache).forEach((cacheKey) => {\n delete signingKeyCache[cacheKey];\n });\n}, \"clearCredentialCache\");\nvar hmac = /* @__PURE__ */ __name((ctor, secret, data) => {\n const hash = new ctor(secret);\n hash.update((0, import_util_utf8.toUint8Array)(data));\n return hash.digest();\n}, \"hmac\");\n\n// src/getCanonicalHeaders.ts\nvar getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => {\n const canonical = {};\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == void 0) {\n continue;\n }\n const canonicalHeaderName = headerName.toLowerCase();\n if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || (unsignableHeaders == null ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) {\n if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) {\n continue;\n }\n }\n canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, \" \");\n }\n return canonical;\n}, \"getCanonicalHeaders\");\n\n// src/getCanonicalQuery.ts\nvar import_util_uri_escape = require(\"@smithy/util-uri-escape\");\nvar getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => {\n const keys = [];\n const serialized = {};\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === SIGNATURE_HEADER) {\n continue;\n }\n keys.push(key);\n const value = query[key];\n if (typeof value === \"string\") {\n serialized[key] = `${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value)}`;\n } else if (Array.isArray(value)) {\n serialized[key] = value.slice(0).reduce(\n (encoded, value2) => encoded.concat([`${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value2)}`]),\n []\n ).sort().join(\"&\");\n }\n }\n return keys.map((key) => serialized[key]).filter((serialized2) => serialized2).join(\"&\");\n}, \"getCanonicalQuery\");\n\n// src/getPayloadHash.ts\nvar import_is_array_buffer = require(\"@smithy/is-array-buffer\");\n\nvar import_util_utf82 = require(\"@smithy/util-utf8\");\nvar getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => {\n for (const headerName of Object.keys(headers)) {\n if (headerName.toLowerCase() === SHA256_HEADER) {\n return headers[headerName];\n }\n }\n if (body == void 0) {\n return \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\";\n } else if (typeof body === \"string\" || ArrayBuffer.isView(body) || (0, import_is_array_buffer.isArrayBuffer)(body)) {\n const hashCtor = new hashConstructor();\n hashCtor.update((0, import_util_utf82.toUint8Array)(body));\n return (0, import_util_hex_encoding.toHex)(await hashCtor.digest());\n }\n return UNSIGNED_PAYLOAD;\n}, \"getPayloadHash\");\n\n// src/HeaderFormatter.ts\n\nvar import_util_utf83 = require(\"@smithy/util-utf8\");\nvar _HeaderFormatter = class _HeaderFormatter {\n format(headers) {\n const chunks = [];\n for (const headerName of Object.keys(headers)) {\n const bytes = (0, import_util_utf83.fromUtf8)(headerName);\n chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));\n }\n const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));\n let position = 0;\n for (const chunk of chunks) {\n out.set(chunk, position);\n position += chunk.byteLength;\n }\n return out;\n }\n formatHeaderValue(header) {\n switch (header.type) {\n case \"boolean\":\n return Uint8Array.from([header.value ? 0 /* boolTrue */ : 1 /* boolFalse */]);\n case \"byte\":\n return Uint8Array.from([2 /* byte */, header.value]);\n case \"short\":\n const shortView = new DataView(new ArrayBuffer(3));\n shortView.setUint8(0, 3 /* short */);\n shortView.setInt16(1, header.value, false);\n return new Uint8Array(shortView.buffer);\n case \"integer\":\n const intView = new DataView(new ArrayBuffer(5));\n intView.setUint8(0, 4 /* integer */);\n intView.setInt32(1, header.value, false);\n return new Uint8Array(intView.buffer);\n case \"long\":\n const longBytes = new Uint8Array(9);\n longBytes[0] = 5 /* long */;\n longBytes.set(header.value.bytes, 1);\n return longBytes;\n case \"binary\":\n const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));\n binView.setUint8(0, 6 /* byteArray */);\n binView.setUint16(1, header.value.byteLength, false);\n const binBytes = new Uint8Array(binView.buffer);\n binBytes.set(header.value, 3);\n return binBytes;\n case \"string\":\n const utf8Bytes = (0, import_util_utf83.fromUtf8)(header.value);\n const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));\n strView.setUint8(0, 7 /* string */);\n strView.setUint16(1, utf8Bytes.byteLength, false);\n const strBytes = new Uint8Array(strView.buffer);\n strBytes.set(utf8Bytes, 3);\n return strBytes;\n case \"timestamp\":\n const tsBytes = new Uint8Array(9);\n tsBytes[0] = 8 /* timestamp */;\n tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);\n return tsBytes;\n case \"uuid\":\n if (!UUID_PATTERN.test(header.value)) {\n throw new Error(`Invalid UUID received: ${header.value}`);\n }\n const uuidBytes = new Uint8Array(17);\n uuidBytes[0] = 9 /* uuid */;\n uuidBytes.set((0, import_util_hex_encoding.fromHex)(header.value.replace(/\\-/g, \"\")), 1);\n return uuidBytes;\n }\n }\n};\n__name(_HeaderFormatter, \"HeaderFormatter\");\nvar HeaderFormatter = _HeaderFormatter;\nvar UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;\nvar _Int64 = class _Int64 {\n constructor(bytes) {\n this.bytes = bytes;\n if (bytes.byteLength !== 8) {\n throw new Error(\"Int64 buffers must be exactly 8 bytes\");\n }\n }\n static fromNumber(number) {\n if (number > 9223372036854776e3 || number < -9223372036854776e3) {\n throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);\n }\n const bytes = new Uint8Array(8);\n for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {\n bytes[i] = remaining;\n }\n if (number < 0) {\n negate(bytes);\n }\n return new _Int64(bytes);\n }\n /**\n * Called implicitly by infix arithmetic operators.\n */\n valueOf() {\n const bytes = this.bytes.slice(0);\n const negative = bytes[0] & 128;\n if (negative) {\n negate(bytes);\n }\n return parseInt((0, import_util_hex_encoding.toHex)(bytes), 16) * (negative ? -1 : 1);\n }\n toString() {\n return String(this.valueOf());\n }\n};\n__name(_Int64, \"Int64\");\nvar Int64 = _Int64;\nfunction negate(bytes) {\n for (let i = 0; i < 8; i++) {\n bytes[i] ^= 255;\n }\n for (let i = 7; i > -1; i--) {\n bytes[i]++;\n if (bytes[i] !== 0)\n break;\n }\n}\n__name(negate, \"negate\");\n\n// src/headerUtil.ts\nvar hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => {\n soughtHeader = soughtHeader.toLowerCase();\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true;\n }\n }\n return false;\n}, \"hasHeader\");\n\n// src/cloneRequest.ts\nvar cloneRequest = /* @__PURE__ */ __name(({ headers, query, ...rest }) => ({\n ...rest,\n headers: { ...headers },\n query: query ? cloneQuery(query) : void 0\n}), \"cloneRequest\");\nvar cloneQuery = /* @__PURE__ */ __name((query) => Object.keys(query).reduce((carry, paramName) => {\n const param = query[paramName];\n return {\n ...carry,\n [paramName]: Array.isArray(param) ? [...param] : param\n };\n}, {}), \"cloneQuery\");\n\n// src/moveHeadersToQuery.ts\nvar moveHeadersToQuery = /* @__PURE__ */ __name((request, options = {}) => {\n var _a;\n const { headers, query = {} } = typeof request.clone === \"function\" ? request.clone() : cloneRequest(request);\n for (const name of Object.keys(headers)) {\n const lname = name.toLowerCase();\n if (lname.slice(0, 6) === \"x-amz-\" && !((_a = options.unhoistableHeaders) == null ? void 0 : _a.has(lname))) {\n query[name] = headers[name];\n delete headers[name];\n }\n }\n return {\n ...request,\n headers,\n query\n };\n}, \"moveHeadersToQuery\");\n\n// src/prepareRequest.ts\nvar prepareRequest = /* @__PURE__ */ __name((request) => {\n request = typeof request.clone === \"function\" ? request.clone() : cloneRequest(request);\n for (const headerName of Object.keys(request.headers)) {\n if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName];\n }\n }\n return request;\n}, \"prepareRequest\");\n\n// src/utilDate.ts\nvar iso8601 = /* @__PURE__ */ __name((time) => toDate(time).toISOString().replace(/\\.\\d{3}Z$/, \"Z\"), \"iso8601\");\nvar toDate = /* @__PURE__ */ __name((time) => {\n if (typeof time === \"number\") {\n return new Date(time * 1e3);\n }\n if (typeof time === \"string\") {\n if (Number(time)) {\n return new Date(Number(time) * 1e3);\n }\n return new Date(time);\n }\n return time;\n}, \"toDate\");\n\n// src/SignatureV4.ts\nvar _SignatureV4 = class _SignatureV4 {\n constructor({\n applyChecksum,\n credentials,\n region,\n service,\n sha256,\n uriEscapePath = true\n }) {\n this.headerFormatter = new HeaderFormatter();\n this.service = service;\n this.sha256 = sha256;\n this.uriEscapePath = uriEscapePath;\n this.applyChecksum = typeof applyChecksum === \"boolean\" ? applyChecksum : true;\n this.regionProvider = (0, import_util_middleware.normalizeProvider)(region);\n this.credentialProvider = (0, import_util_middleware.normalizeProvider)(credentials);\n }\n async presign(originalRequest, options = {}) {\n const {\n signingDate = /* @__PURE__ */ new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService\n } = options;\n const credentials = await this.credentialProvider();\n this.validateResolvedCredentials(credentials);\n const region = signingRegion ?? await this.regionProvider();\n const { longDate, shortDate } = formatDate(signingDate);\n if (expiresIn > MAX_PRESIGNED_TTL) {\n return Promise.reject(\n \"Signature version 4 presigned URLs must have an expiration date less than one week in the future\"\n );\n }\n const scope = createScope(shortDate, region, signingService ?? this.service);\n const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders });\n if (credentials.sessionToken) {\n request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;\n }\n request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;\n request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;\n request.query[AMZ_DATE_QUERY_PARAM] = longDate;\n request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);\n const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n request.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders);\n request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(\n longDate,\n scope,\n this.getSigningKey(credentials, region, shortDate, signingService),\n this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))\n );\n return request;\n }\n async sign(toSign, options) {\n if (typeof toSign === \"string\") {\n return this.signString(toSign, options);\n } else if (toSign.headers && toSign.payload) {\n return this.signEvent(toSign, options);\n } else if (toSign.message) {\n return this.signMessage(toSign, options);\n } else {\n return this.signRequest(toSign, options);\n }\n }\n async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) {\n const region = signingRegion ?? await this.regionProvider();\n const { shortDate, longDate } = formatDate(signingDate);\n const scope = createScope(shortDate, region, signingService ?? this.service);\n const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256);\n const hash = new this.sha256();\n hash.update(headers);\n const hashedHeaders = (0, import_util_hex_encoding.toHex)(await hash.digest());\n const stringToSign = [\n EVENT_ALGORITHM_IDENTIFIER,\n longDate,\n scope,\n priorSignature,\n hashedHeaders,\n hashedPayload\n ].join(\"\\n\");\n return this.signString(stringToSign, { signingDate, signingRegion: region, signingService });\n }\n async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) {\n const promise = this.signEvent(\n {\n headers: this.headerFormatter.format(signableMessage.message.headers),\n payload: signableMessage.message.body\n },\n {\n signingDate,\n signingRegion,\n signingService,\n priorSignature: signableMessage.priorSignature\n }\n );\n return promise.then((signature) => {\n return { message: signableMessage.message, signature };\n });\n }\n async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) {\n const credentials = await this.credentialProvider();\n this.validateResolvedCredentials(credentials);\n const region = signingRegion ?? await this.regionProvider();\n const { shortDate } = formatDate(signingDate);\n const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));\n hash.update((0, import_util_utf84.toUint8Array)(stringToSign));\n return (0, import_util_hex_encoding.toHex)(await hash.digest());\n }\n async signRequest(requestToSign, {\n signingDate = /* @__PURE__ */ new Date(),\n signableHeaders,\n unsignableHeaders,\n signingRegion,\n signingService\n } = {}) {\n const credentials = await this.credentialProvider();\n this.validateResolvedCredentials(credentials);\n const region = signingRegion ?? await this.regionProvider();\n const request = prepareRequest(requestToSign);\n const { longDate, shortDate } = formatDate(signingDate);\n const scope = createScope(shortDate, region, signingService ?? this.service);\n request.headers[AMZ_DATE_HEADER] = longDate;\n if (credentials.sessionToken) {\n request.headers[TOKEN_HEADER] = credentials.sessionToken;\n }\n const payloadHash = await getPayloadHash(request, this.sha256);\n if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {\n request.headers[SHA256_HEADER] = payloadHash;\n }\n const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n const signature = await this.getSignature(\n longDate,\n scope,\n this.getSigningKey(credentials, region, shortDate, signingService),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n );\n request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`;\n return request;\n }\n createCanonicalRequest(request, canonicalHeaders, payloadHash) {\n const sortedHeaders = Object.keys(canonicalHeaders).sort();\n return `${request.method}\n${this.getCanonicalPath(request)}\n${getCanonicalQuery(request)}\n${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join(\"\\n\")}\n\n${sortedHeaders.join(\";\")}\n${payloadHash}`;\n }\n async createStringToSign(longDate, credentialScope, canonicalRequest) {\n const hash = new this.sha256();\n hash.update((0, import_util_utf84.toUint8Array)(canonicalRequest));\n const hashedRequest = await hash.digest();\n return `${ALGORITHM_IDENTIFIER}\n${longDate}\n${credentialScope}\n${(0, import_util_hex_encoding.toHex)(hashedRequest)}`;\n }\n getCanonicalPath({ path }) {\n if (this.uriEscapePath) {\n const normalizedPathSegments = [];\n for (const pathSegment of path.split(\"/\")) {\n if ((pathSegment == null ? void 0 : pathSegment.length) === 0)\n continue;\n if (pathSegment === \".\")\n continue;\n if (pathSegment === \"..\") {\n normalizedPathSegments.pop();\n } else {\n normalizedPathSegments.push(pathSegment);\n }\n }\n const normalizedPath = `${(path == null ? void 0 : path.startsWith(\"/\")) ? \"/\" : \"\"}${normalizedPathSegments.join(\"/\")}${normalizedPathSegments.length > 0 && (path == null ? void 0 : path.endsWith(\"/\")) ? \"/\" : \"\"}`;\n const doubleEncoded = (0, import_util_uri_escape.escapeUri)(normalizedPath);\n return doubleEncoded.replace(/%2F/g, \"/\");\n }\n return path;\n }\n async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {\n const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest);\n const hash = new this.sha256(await keyPromise);\n hash.update((0, import_util_utf84.toUint8Array)(stringToSign));\n return (0, import_util_hex_encoding.toHex)(await hash.digest());\n }\n getSigningKey(credentials, region, shortDate, service) {\n return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);\n }\n validateResolvedCredentials(credentials) {\n if (typeof credentials !== \"object\" || // @ts-expect-error: Property 'accessKeyId' does not exist on type 'object'.ts(2339)\n typeof credentials.accessKeyId !== \"string\" || // @ts-expect-error: Property 'secretAccessKey' does not exist on type 'object'.ts(2339)\n typeof credentials.secretAccessKey !== \"string\") {\n throw new Error(\"Resolved credential object is not valid\");\n }\n }\n};\n__name(_SignatureV4, \"SignatureV4\");\nvar SignatureV4 = _SignatureV4;\nvar formatDate = /* @__PURE__ */ __name((now) => {\n const longDate = iso8601(now).replace(/[\\-:]/g, \"\");\n return {\n longDate,\n shortDate: longDate.slice(0, 8)\n };\n}, \"formatDate\");\nvar getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(headers).sort().join(\";\"), \"getCanonicalHeaderList\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n getCanonicalHeaders,\n getCanonicalQuery,\n getPayloadHash,\n moveHeadersToQuery,\n prepareRequest,\n SignatureV4,\n createScope,\n getSigningKey,\n clearCredentialCache\n});\n\n", - "'use strict';\n\nconst TEXT_ENCODER = typeof TextEncoder == \"function\" ? new TextEncoder() : null;\nconst calculateBodyLength = (body) => {\n if (typeof body === \"string\") {\n if (TEXT_ENCODER) {\n return TEXT_ENCODER.encode(body).byteLength;\n }\n let len = body.length;\n for (let i = len - 1; i >= 0; i--) {\n const code = body.charCodeAt(i);\n if (code > 0x7f && code <= 0x7ff)\n len++;\n else if (code > 0x7ff && code <= 0xffff)\n len += 2;\n if (code >= 0xdc00 && code <= 0xdfff)\n i--;\n }\n return len;\n }\n else if (typeof body.byteLength === \"number\") {\n return body.byteLength;\n }\n else if (typeof body.size === \"number\") {\n return body.size;\n }\n throw new Error(`Body Length computation failed for ${body}`);\n};\n\nexports.calculateBodyLength = calculateBodyLength;\n", - "'use strict';\n\nvar serde = require('@smithy/core/serde');\nvar utilUtf8 = require('@smithy/util-utf8');\nvar protocols = require('@smithy/core/protocols');\nvar protocolHttp = require('@smithy/protocol-http');\nvar utilBodyLengthBrowser = require('@smithy/util-body-length-browser');\nvar schema = require('@smithy/core/schema');\nvar utilMiddleware = require('@smithy/util-middleware');\nvar utilBase64 = require('@smithy/util-base64');\n\nconst majorUint64 = 0;\nconst majorNegativeInt64 = 1;\nconst majorUnstructuredByteString = 2;\nconst majorUtf8String = 3;\nconst majorList = 4;\nconst majorMap = 5;\nconst majorTag = 6;\nconst majorSpecial = 7;\nconst specialFalse = 20;\nconst specialTrue = 21;\nconst specialNull = 22;\nconst specialUndefined = 23;\nconst extendedOneByte = 24;\nconst extendedFloat16 = 25;\nconst extendedFloat32 = 26;\nconst extendedFloat64 = 27;\nconst minorIndefinite = 31;\nfunction alloc(size) {\n return typeof Buffer !== \"undefined\" ? Buffer.alloc(size) : new Uint8Array(size);\n}\nconst tagSymbol = Symbol(\"@smithy/core/cbor::tagSymbol\");\nfunction tag(data) {\n data[tagSymbol] = true;\n return data;\n}\n\nconst USE_TEXT_DECODER = typeof TextDecoder !== \"undefined\";\nconst USE_BUFFER$1 = typeof Buffer !== \"undefined\";\nlet payload = alloc(0);\nlet dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);\nconst textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null;\nlet _offset = 0;\nfunction setPayload(bytes) {\n payload = bytes;\n dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);\n}\nfunction decode(at, to) {\n if (at >= to) {\n throw new Error(\"unexpected end of (decode) payload.\");\n }\n const major = (payload[at] & 0b1110_0000) >> 5;\n const minor = payload[at] & 0b0001_1111;\n switch (major) {\n case majorUint64:\n case majorNegativeInt64:\n case majorTag:\n let unsignedInt;\n let offset;\n if (minor < 24) {\n unsignedInt = minor;\n offset = 1;\n }\n else {\n switch (minor) {\n case extendedOneByte:\n case extendedFloat16:\n case extendedFloat32:\n case extendedFloat64:\n const countLength = minorValueToArgumentLength[minor];\n const countOffset = (countLength + 1);\n offset = countOffset;\n if (to - at < countOffset) {\n throw new Error(`countLength ${countLength} greater than remaining buf len.`);\n }\n const countIndex = at + 1;\n if (countLength === 1) {\n unsignedInt = payload[countIndex];\n }\n else if (countLength === 2) {\n unsignedInt = dataView$1.getUint16(countIndex);\n }\n else if (countLength === 4) {\n unsignedInt = dataView$1.getUint32(countIndex);\n }\n else {\n unsignedInt = dataView$1.getBigUint64(countIndex);\n }\n break;\n default:\n throw new Error(`unexpected minor value ${minor}.`);\n }\n }\n if (major === majorUint64) {\n _offset = offset;\n return castBigInt(unsignedInt);\n }\n else if (major === majorNegativeInt64) {\n let negativeInt;\n if (typeof unsignedInt === \"bigint\") {\n negativeInt = BigInt(-1) - unsignedInt;\n }\n else {\n negativeInt = -1 - unsignedInt;\n }\n _offset = offset;\n return castBigInt(negativeInt);\n }\n else {\n if (minor === 2 || minor === 3) {\n const length = decodeCount(at + offset, to);\n let b = BigInt(0);\n const start = at + offset + _offset;\n for (let i = start; i < start + length; ++i) {\n b = (b << BigInt(8)) | BigInt(payload[i]);\n }\n _offset = offset + _offset + length;\n return minor === 3 ? -b - BigInt(1) : b;\n }\n else if (minor === 4) {\n const decimalFraction = decode(at + offset, to);\n const [exponent, mantissa] = decimalFraction;\n const normalizer = mantissa < 0 ? -1 : 1;\n const mantissaStr = \"0\".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));\n let numericString;\n const sign = mantissa < 0 ? \"-\" : \"\";\n numericString =\n exponent === 0\n ? mantissaStr\n : mantissaStr.slice(0, mantissaStr.length + exponent) + \".\" + mantissaStr.slice(exponent);\n numericString = numericString.replace(/^0+/g, \"\");\n if (numericString === \"\") {\n numericString = \"0\";\n }\n if (numericString[0] === \".\") {\n numericString = \"0\" + numericString;\n }\n numericString = sign + numericString;\n _offset = offset + _offset;\n return serde.nv(numericString);\n }\n else {\n const value = decode(at + offset, to);\n const valueOffset = _offset;\n _offset = offset + valueOffset;\n return tag({ tag: castBigInt(unsignedInt), value });\n }\n }\n case majorUtf8String:\n case majorMap:\n case majorList:\n case majorUnstructuredByteString:\n if (minor === minorIndefinite) {\n switch (major) {\n case majorUtf8String:\n return decodeUtf8StringIndefinite(at, to);\n case majorMap:\n return decodeMapIndefinite(at, to);\n case majorList:\n return decodeListIndefinite(at, to);\n case majorUnstructuredByteString:\n return decodeUnstructuredByteStringIndefinite(at, to);\n }\n }\n else {\n switch (major) {\n case majorUtf8String:\n return decodeUtf8String(at, to);\n case majorMap:\n return decodeMap(at, to);\n case majorList:\n return decodeList(at, to);\n case majorUnstructuredByteString:\n return decodeUnstructuredByteString(at, to);\n }\n }\n default:\n return decodeSpecial(at, to);\n }\n}\nfunction bytesToUtf8(bytes, at, to) {\n if (USE_BUFFER$1 && bytes.constructor?.name === \"Buffer\") {\n return bytes.toString(\"utf-8\", at, to);\n }\n if (textDecoder) {\n return textDecoder.decode(bytes.subarray(at, to));\n }\n return utilUtf8.toUtf8(bytes.subarray(at, to));\n}\nfunction demote(bigInteger) {\n const num = Number(bigInteger);\n if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) {\n console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`));\n }\n return num;\n}\nconst minorValueToArgumentLength = {\n [extendedOneByte]: 1,\n [extendedFloat16]: 2,\n [extendedFloat32]: 4,\n [extendedFloat64]: 8,\n};\nfunction bytesToFloat16(a, b) {\n const sign = a >> 7;\n const exponent = (a & 0b0111_1100) >> 2;\n const fraction = ((a & 0b0000_0011) << 8) | b;\n const scalar = sign === 0 ? 1 : -1;\n let exponentComponent;\n let summation;\n if (exponent === 0b00000) {\n if (fraction === 0b00000_00000) {\n return 0;\n }\n else {\n exponentComponent = Math.pow(2, 1 - 15);\n summation = 0;\n }\n }\n else if (exponent === 0b11111) {\n if (fraction === 0b00000_00000) {\n return scalar * Infinity;\n }\n else {\n return NaN;\n }\n }\n else {\n exponentComponent = Math.pow(2, exponent - 15);\n summation = 1;\n }\n summation += fraction / 1024;\n return scalar * (exponentComponent * summation);\n}\nfunction decodeCount(at, to) {\n const minor = payload[at] & 0b0001_1111;\n if (minor < 24) {\n _offset = 1;\n return minor;\n }\n if (minor === extendedOneByte ||\n minor === extendedFloat16 ||\n minor === extendedFloat32 ||\n minor === extendedFloat64) {\n const countLength = minorValueToArgumentLength[minor];\n _offset = (countLength + 1);\n if (to - at < _offset) {\n throw new Error(`countLength ${countLength} greater than remaining buf len.`);\n }\n const countIndex = at + 1;\n if (countLength === 1) {\n return payload[countIndex];\n }\n else if (countLength === 2) {\n return dataView$1.getUint16(countIndex);\n }\n else if (countLength === 4) {\n return dataView$1.getUint32(countIndex);\n }\n return demote(dataView$1.getBigUint64(countIndex));\n }\n throw new Error(`unexpected minor value ${minor}.`);\n}\nfunction decodeUtf8String(at, to) {\n const length = decodeCount(at, to);\n const offset = _offset;\n at += offset;\n if (to - at < length) {\n throw new Error(`string len ${length} greater than remaining buf len.`);\n }\n const value = bytesToUtf8(payload, at, at + length);\n _offset = offset + length;\n return value;\n}\nfunction decodeUtf8StringIndefinite(at, to) {\n at += 1;\n const vector = [];\n for (const base = at; at < to;) {\n if (payload[at] === 0b1111_1111) {\n const data = alloc(vector.length);\n data.set(vector, 0);\n _offset = at - base + 2;\n return bytesToUtf8(data, 0, data.length);\n }\n const major = (payload[at] & 0b1110_0000) >> 5;\n const minor = payload[at] & 0b0001_1111;\n if (major !== majorUtf8String) {\n throw new Error(`unexpected major type ${major} in indefinite string.`);\n }\n if (minor === minorIndefinite) {\n throw new Error(\"nested indefinite string.\");\n }\n const bytes = decodeUnstructuredByteString(at, to);\n const length = _offset;\n at += length;\n for (let i = 0; i < bytes.length; ++i) {\n vector.push(bytes[i]);\n }\n }\n throw new Error(\"expected break marker.\");\n}\nfunction decodeUnstructuredByteString(at, to) {\n const length = decodeCount(at, to);\n const offset = _offset;\n at += offset;\n if (to - at < length) {\n throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`);\n }\n const value = payload.subarray(at, at + length);\n _offset = offset + length;\n return value;\n}\nfunction decodeUnstructuredByteStringIndefinite(at, to) {\n at += 1;\n const vector = [];\n for (const base = at; at < to;) {\n if (payload[at] === 0b1111_1111) {\n const data = alloc(vector.length);\n data.set(vector, 0);\n _offset = at - base + 2;\n return data;\n }\n const major = (payload[at] & 0b1110_0000) >> 5;\n const minor = payload[at] & 0b0001_1111;\n if (major !== majorUnstructuredByteString) {\n throw new Error(`unexpected major type ${major} in indefinite string.`);\n }\n if (minor === minorIndefinite) {\n throw new Error(\"nested indefinite string.\");\n }\n const bytes = decodeUnstructuredByteString(at, to);\n const length = _offset;\n at += length;\n for (let i = 0; i < bytes.length; ++i) {\n vector.push(bytes[i]);\n }\n }\n throw new Error(\"expected break marker.\");\n}\nfunction decodeList(at, to) {\n const listDataLength = decodeCount(at, to);\n const offset = _offset;\n at += offset;\n const base = at;\n const list = Array(listDataLength);\n for (let i = 0; i < listDataLength; ++i) {\n const item = decode(at, to);\n const itemOffset = _offset;\n list[i] = item;\n at += itemOffset;\n }\n _offset = offset + (at - base);\n return list;\n}\nfunction decodeListIndefinite(at, to) {\n at += 1;\n const list = [];\n for (const base = at; at < to;) {\n if (payload[at] === 0b1111_1111) {\n _offset = at - base + 2;\n return list;\n }\n const item = decode(at, to);\n const n = _offset;\n at += n;\n list.push(item);\n }\n throw new Error(\"expected break marker.\");\n}\nfunction decodeMap(at, to) {\n const mapDataLength = decodeCount(at, to);\n const offset = _offset;\n at += offset;\n const base = at;\n const map = {};\n for (let i = 0; i < mapDataLength; ++i) {\n if (at >= to) {\n throw new Error(\"unexpected end of map payload.\");\n }\n const major = (payload[at] & 0b1110_0000) >> 5;\n if (major !== majorUtf8String) {\n throw new Error(`unexpected major type ${major} for map key at index ${at}.`);\n }\n const key = decode(at, to);\n at += _offset;\n const value = decode(at, to);\n at += _offset;\n map[key] = value;\n }\n _offset = offset + (at - base);\n return map;\n}\nfunction decodeMapIndefinite(at, to) {\n at += 1;\n const base = at;\n const map = {};\n for (; at < to;) {\n if (at >= to) {\n throw new Error(\"unexpected end of map payload.\");\n }\n if (payload[at] === 0b1111_1111) {\n _offset = at - base + 2;\n return map;\n }\n const major = (payload[at] & 0b1110_0000) >> 5;\n if (major !== majorUtf8String) {\n throw new Error(`unexpected major type ${major} for map key.`);\n }\n const key = decode(at, to);\n at += _offset;\n const value = decode(at, to);\n at += _offset;\n map[key] = value;\n }\n throw new Error(\"expected break marker.\");\n}\nfunction decodeSpecial(at, to) {\n const minor = payload[at] & 0b0001_1111;\n switch (minor) {\n case specialTrue:\n case specialFalse:\n _offset = 1;\n return minor === specialTrue;\n case specialNull:\n _offset = 1;\n return null;\n case specialUndefined:\n _offset = 1;\n return null;\n case extendedFloat16:\n if (to - at < 3) {\n throw new Error(\"incomplete float16 at end of buf.\");\n }\n _offset = 3;\n return bytesToFloat16(payload[at + 1], payload[at + 2]);\n case extendedFloat32:\n if (to - at < 5) {\n throw new Error(\"incomplete float32 at end of buf.\");\n }\n _offset = 5;\n return dataView$1.getFloat32(at + 1);\n case extendedFloat64:\n if (to - at < 9) {\n throw new Error(\"incomplete float64 at end of buf.\");\n }\n _offset = 9;\n return dataView$1.getFloat64(at + 1);\n default:\n throw new Error(`unexpected minor value ${minor}.`);\n }\n}\nfunction castBigInt(bigInt) {\n if (typeof bigInt === \"number\") {\n return bigInt;\n }\n const num = Number(bigInt);\n if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) {\n return num;\n }\n return bigInt;\n}\n\nconst USE_BUFFER = typeof Buffer !== \"undefined\";\nconst initialSize = 2048;\nlet data = alloc(initialSize);\nlet dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);\nlet cursor = 0;\nfunction ensureSpace(bytes) {\n const remaining = data.byteLength - cursor;\n if (remaining < bytes) {\n if (cursor < 16_000_000) {\n resize(Math.max(data.byteLength * 4, data.byteLength + bytes));\n }\n else {\n resize(data.byteLength + bytes + 16_000_000);\n }\n }\n}\nfunction toUint8Array() {\n const out = alloc(cursor);\n out.set(data.subarray(0, cursor), 0);\n cursor = 0;\n return out;\n}\nfunction resize(size) {\n const old = data;\n data = alloc(size);\n if (old) {\n if (old.copy) {\n old.copy(data, 0, 0, old.byteLength);\n }\n else {\n data.set(old, 0);\n }\n }\n dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);\n}\nfunction encodeHeader(major, value) {\n if (value < 24) {\n data[cursor++] = (major << 5) | value;\n }\n else if (value < 1 << 8) {\n data[cursor++] = (major << 5) | 24;\n data[cursor++] = value;\n }\n else if (value < 1 << 16) {\n data[cursor++] = (major << 5) | extendedFloat16;\n dataView.setUint16(cursor, value);\n cursor += 2;\n }\n else if (value < 2 ** 32) {\n data[cursor++] = (major << 5) | extendedFloat32;\n dataView.setUint32(cursor, value);\n cursor += 4;\n }\n else {\n data[cursor++] = (major << 5) | extendedFloat64;\n dataView.setBigUint64(cursor, typeof value === \"bigint\" ? value : BigInt(value));\n cursor += 8;\n }\n}\nfunction encode(_input) {\n const encodeStack = [_input];\n while (encodeStack.length) {\n const input = encodeStack.pop();\n ensureSpace(typeof input === \"string\" ? input.length * 4 : 64);\n if (typeof input === \"string\") {\n if (USE_BUFFER) {\n encodeHeader(majorUtf8String, Buffer.byteLength(input));\n cursor += data.write(input, cursor);\n }\n else {\n const bytes = utilUtf8.fromUtf8(input);\n encodeHeader(majorUtf8String, bytes.byteLength);\n data.set(bytes, cursor);\n cursor += bytes.byteLength;\n }\n continue;\n }\n else if (typeof input === \"number\") {\n if (Number.isInteger(input)) {\n const nonNegative = input >= 0;\n const major = nonNegative ? majorUint64 : majorNegativeInt64;\n const value = nonNegative ? input : -input - 1;\n if (value < 24) {\n data[cursor++] = (major << 5) | value;\n }\n else if (value < 256) {\n data[cursor++] = (major << 5) | 24;\n data[cursor++] = value;\n }\n else if (value < 65536) {\n data[cursor++] = (major << 5) | extendedFloat16;\n data[cursor++] = value >> 8;\n data[cursor++] = value;\n }\n else if (value < 4294967296) {\n data[cursor++] = (major << 5) | extendedFloat32;\n dataView.setUint32(cursor, value);\n cursor += 4;\n }\n else {\n data[cursor++] = (major << 5) | extendedFloat64;\n dataView.setBigUint64(cursor, BigInt(value));\n cursor += 8;\n }\n continue;\n }\n data[cursor++] = (majorSpecial << 5) | extendedFloat64;\n dataView.setFloat64(cursor, input);\n cursor += 8;\n continue;\n }\n else if (typeof input === \"bigint\") {\n const nonNegative = input >= 0;\n const major = nonNegative ? majorUint64 : majorNegativeInt64;\n const value = nonNegative ? input : -input - BigInt(1);\n const n = Number(value);\n if (n < 24) {\n data[cursor++] = (major << 5) | n;\n }\n else if (n < 256) {\n data[cursor++] = (major << 5) | 24;\n data[cursor++] = n;\n }\n else if (n < 65536) {\n data[cursor++] = (major << 5) | extendedFloat16;\n data[cursor++] = n >> 8;\n data[cursor++] = n & 0b1111_1111;\n }\n else if (n < 4294967296) {\n data[cursor++] = (major << 5) | extendedFloat32;\n dataView.setUint32(cursor, n);\n cursor += 4;\n }\n else if (value < BigInt(\"18446744073709551616\")) {\n data[cursor++] = (major << 5) | extendedFloat64;\n dataView.setBigUint64(cursor, value);\n cursor += 8;\n }\n else {\n const binaryBigInt = value.toString(2);\n const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8));\n let b = value;\n let i = 0;\n while (bigIntBytes.byteLength - ++i >= 0) {\n bigIntBytes[bigIntBytes.byteLength - i] = Number(b & BigInt(255));\n b >>= BigInt(8);\n }\n ensureSpace(bigIntBytes.byteLength * 2);\n data[cursor++] = nonNegative ? 0b110_00010 : 0b110_00011;\n if (USE_BUFFER) {\n encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes));\n }\n else {\n encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength);\n }\n data.set(bigIntBytes, cursor);\n cursor += bigIntBytes.byteLength;\n }\n continue;\n }\n else if (input === null) {\n data[cursor++] = (majorSpecial << 5) | specialNull;\n continue;\n }\n else if (typeof input === \"boolean\") {\n data[cursor++] = (majorSpecial << 5) | (input ? specialTrue : specialFalse);\n continue;\n }\n else if (typeof input === \"undefined\") {\n throw new Error(\"@smithy/core/cbor: client may not serialize undefined value.\");\n }\n else if (Array.isArray(input)) {\n for (let i = input.length - 1; i >= 0; --i) {\n encodeStack.push(input[i]);\n }\n encodeHeader(majorList, input.length);\n continue;\n }\n else if (typeof input.byteLength === \"number\") {\n ensureSpace(input.length * 2);\n encodeHeader(majorUnstructuredByteString, input.length);\n data.set(input, cursor);\n cursor += input.byteLength;\n continue;\n }\n else if (typeof input === \"object\") {\n if (input instanceof serde.NumericValue) {\n const decimalIndex = input.string.indexOf(\".\");\n const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1;\n const mantissa = BigInt(input.string.replace(\".\", \"\"));\n data[cursor++] = 0b110_00100;\n encodeStack.push(mantissa);\n encodeStack.push(exponent);\n encodeHeader(majorList, 2);\n continue;\n }\n if (input[tagSymbol]) {\n if (\"tag\" in input && \"value\" in input) {\n encodeStack.push(input.value);\n encodeHeader(majorTag, input.tag);\n continue;\n }\n else {\n throw new Error(\"tag encountered with missing fields, need 'tag' and 'value', found: \" + JSON.stringify(input));\n }\n }\n const keys = Object.keys(input);\n for (let i = keys.length - 1; i >= 0; --i) {\n const key = keys[i];\n encodeStack.push(input[key]);\n encodeStack.push(key);\n }\n encodeHeader(majorMap, keys.length);\n continue;\n }\n throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`);\n }\n}\n\nconst cbor = {\n deserialize(payload) {\n setPayload(payload);\n return decode(0, payload.length);\n },\n serialize(input) {\n try {\n encode(input);\n return toUint8Array();\n }\n catch (e) {\n toUint8Array();\n throw e;\n }\n },\n resizeEncodingBuffer(size) {\n resize(size);\n },\n};\n\nconst parseCborBody = (streamBody, context) => {\n return protocols.collectBody(streamBody, context).then(async (bytes) => {\n if (bytes.length) {\n try {\n return cbor.deserialize(bytes);\n }\n catch (e) {\n Object.defineProperty(e, \"$responseBodyText\", {\n value: context.utf8Encoder(bytes),\n });\n throw e;\n }\n }\n return {};\n });\n};\nconst dateToTag = (date) => {\n return tag({\n tag: 1,\n value: date.getTime() / 1000,\n });\n};\nconst parseCborErrorBody = async (errorBody, context) => {\n const value = await parseCborBody(errorBody, context);\n value.message = value.message ?? value.Message;\n return value;\n};\nconst loadSmithyRpcV2CborErrorCode = (output, data) => {\n const sanitizeErrorCode = (rawValue) => {\n let cleanValue = rawValue;\n if (typeof cleanValue === \"number\") {\n cleanValue = cleanValue.toString();\n }\n if (cleanValue.indexOf(\",\") >= 0) {\n cleanValue = cleanValue.split(\",\")[0];\n }\n if (cleanValue.indexOf(\":\") >= 0) {\n cleanValue = cleanValue.split(\":\")[0];\n }\n if (cleanValue.indexOf(\"#\") >= 0) {\n cleanValue = cleanValue.split(\"#\")[1];\n }\n return cleanValue;\n };\n if (data[\"__type\"] !== undefined) {\n return sanitizeErrorCode(data[\"__type\"]);\n }\n const codeKey = Object.keys(data).find((key) => key.toLowerCase() === \"code\");\n if (codeKey && data[codeKey] !== undefined) {\n return sanitizeErrorCode(data[codeKey]);\n }\n};\nconst checkCborResponse = (response) => {\n if (String(response.headers[\"smithy-protocol\"]).toLowerCase() !== \"rpc-v2-cbor\") {\n throw new Error(\"Malformed RPCv2 CBOR response, status: \" + response.statusCode);\n }\n};\nconst buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {\n const { hostname, protocol = \"https\", port, path: basePath } = await context.endpoint();\n const contents = {\n protocol,\n hostname,\n port,\n method: \"POST\",\n path: basePath.endsWith(\"/\") ? basePath.slice(0, -1) + path : basePath + path,\n headers: {\n ...headers,\n },\n };\n if (resolvedHostname !== undefined) {\n contents.hostname = resolvedHostname;\n }\n if (body !== undefined) {\n contents.body = body;\n try {\n contents.headers[\"content-length\"] = String(utilBodyLengthBrowser.calculateBodyLength(body));\n }\n catch (e) { }\n }\n return new protocolHttp.HttpRequest(contents);\n};\n\nclass CborCodec extends protocols.SerdeContext {\n createSerializer() {\n const serializer = new CborShapeSerializer();\n serializer.setSerdeContext(this.serdeContext);\n return serializer;\n }\n createDeserializer() {\n const deserializer = new CborShapeDeserializer();\n deserializer.setSerdeContext(this.serdeContext);\n return deserializer;\n }\n}\nclass CborShapeSerializer extends protocols.SerdeContext {\n value;\n write(schema, value) {\n this.value = this.serialize(schema, value);\n }\n serialize(schema$1, source) {\n const ns = schema.NormalizedSchema.of(schema$1);\n if (source == null) {\n if (ns.isIdempotencyToken()) {\n return serde.generateIdempotencyToken();\n }\n return source;\n }\n if (ns.isBlobSchema()) {\n if (typeof source === \"string\") {\n return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(source);\n }\n return source;\n }\n if (ns.isTimestampSchema()) {\n if (typeof source === \"number\" || typeof source === \"bigint\") {\n return dateToTag(new Date((Number(source) / 1000) | 0));\n }\n return dateToTag(source);\n }\n if (typeof source === \"function\" || typeof source === \"object\") {\n const sourceObject = source;\n if (ns.isListSchema() && Array.isArray(sourceObject)) {\n const sparse = !!ns.getMergedTraits().sparse;\n const newArray = [];\n let i = 0;\n for (const item of sourceObject) {\n const value = this.serialize(ns.getValueSchema(), item);\n if (value != null || sparse) {\n newArray[i++] = value;\n }\n }\n return newArray;\n }\n if (sourceObject instanceof Date) {\n return dateToTag(sourceObject);\n }\n const newObject = {};\n if (ns.isMapSchema()) {\n const sparse = !!ns.getMergedTraits().sparse;\n for (const key of Object.keys(sourceObject)) {\n const value = this.serialize(ns.getValueSchema(), sourceObject[key]);\n if (value != null || sparse) {\n newObject[key] = value;\n }\n }\n }\n else if (ns.isStructSchema()) {\n for (const [key, memberSchema] of ns.structIterator()) {\n const value = this.serialize(memberSchema, sourceObject[key]);\n if (value != null) {\n newObject[key] = value;\n }\n }\n }\n else if (ns.isDocumentSchema()) {\n for (const key of Object.keys(sourceObject)) {\n newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);\n }\n }\n return newObject;\n }\n return source;\n }\n flush() {\n const buffer = cbor.serialize(this.value);\n this.value = undefined;\n return buffer;\n }\n}\nclass CborShapeDeserializer extends protocols.SerdeContext {\n read(schema, bytes) {\n const data = cbor.deserialize(bytes);\n return this.readValue(schema, data);\n }\n readValue(_schema, value) {\n const ns = schema.NormalizedSchema.of(_schema);\n if (ns.isTimestampSchema() && typeof value === \"number\") {\n return serde._parseEpochTimestamp(value);\n }\n if (ns.isBlobSchema()) {\n if (typeof value === \"string\") {\n return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value);\n }\n return value;\n }\n if (typeof value === \"undefined\" ||\n typeof value === \"boolean\" ||\n typeof value === \"number\" ||\n typeof value === \"string\" ||\n typeof value === \"bigint\" ||\n typeof value === \"symbol\") {\n return value;\n }\n else if (typeof value === \"function\" || typeof value === \"object\") {\n if (value === null) {\n return null;\n }\n if (\"byteLength\" in value) {\n return value;\n }\n if (value instanceof Date) {\n return value;\n }\n if (ns.isDocumentSchema()) {\n return value;\n }\n if (ns.isListSchema()) {\n const newArray = [];\n const memberSchema = ns.getValueSchema();\n const sparse = !!ns.getMergedTraits().sparse;\n for (const item of value) {\n const itemValue = this.readValue(memberSchema, item);\n if (itemValue != null || sparse) {\n newArray.push(itemValue);\n }\n }\n return newArray;\n }\n const newObject = {};\n if (ns.isMapSchema()) {\n const sparse = !!ns.getMergedTraits().sparse;\n const targetSchema = ns.getValueSchema();\n for (const key of Object.keys(value)) {\n const itemValue = this.readValue(targetSchema, value[key]);\n if (itemValue != null || sparse) {\n newObject[key] = itemValue;\n }\n }\n }\n else if (ns.isStructSchema()) {\n for (const [key, memberSchema] of ns.structIterator()) {\n const v = this.readValue(memberSchema, value[key]);\n if (v != null) {\n newObject[key] = v;\n }\n }\n }\n return newObject;\n }\n else {\n return value;\n }\n }\n}\n\nclass SmithyRpcV2CborProtocol extends protocols.RpcProtocol {\n codec = new CborCodec();\n serializer = this.codec.createSerializer();\n deserializer = this.codec.createDeserializer();\n constructor({ defaultNamespace }) {\n super({ defaultNamespace });\n }\n getShapeId() {\n return \"smithy.protocols#rpcv2Cbor\";\n }\n getPayloadCodec() {\n return this.codec;\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n Object.assign(request.headers, {\n \"content-type\": this.getDefaultContentType(),\n \"smithy-protocol\": \"rpc-v2-cbor\",\n accept: this.getDefaultContentType(),\n });\n if (schema.deref(operationSchema.input) === \"unit\") {\n delete request.body;\n delete request.headers[\"content-type\"];\n }\n else {\n if (!request.body) {\n this.serializer.write(15, {});\n request.body = this.serializer.flush();\n }\n try {\n request.headers[\"content-length\"] = String(request.body.byteLength);\n }\n catch (e) { }\n }\n const { service, operation } = utilMiddleware.getSmithyContext(context);\n const path = `/service/${service}/operation/${operation}`;\n if (request.path.endsWith(\"/\")) {\n request.path += path.slice(1);\n }\n else {\n request.path += path;\n }\n return request;\n }\n async deserializeResponse(operationSchema, context, response) {\n return super.deserializeResponse(operationSchema, context, response);\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? \"Unknown\";\n let namespace = this.options.defaultNamespace;\n if (errorName.includes(\"#\")) {\n [namespace] = errorName.split(\"#\");\n }\n const errorMetadata = {\n $metadata: metadata,\n $fault: response.statusCode <= 500 ? \"client\" : \"server\",\n };\n const registry = schema.TypeRegistry.for(namespace);\n let errorSchema;\n try {\n errorSchema = registry.getSchema(errorName);\n }\n catch (e) {\n if (dataObject.Message) {\n dataObject.message = dataObject.Message;\n }\n const synthetic = schema.TypeRegistry.for(\"smithy.ts.sdk.synthetic.\" + namespace);\n const baseExceptionSchema = synthetic.getBaseException();\n if (baseExceptionSchema) {\n const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema);\n throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);\n }\n throw Object.assign(new Error(errorName), errorMetadata, dataObject);\n }\n const ns = schema.NormalizedSchema.of(errorSchema);\n const ErrorCtor = registry.getErrorCtor(errorSchema);\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const exception = new ErrorCtor(message);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n output[name] = this.deserializer.readValue(member, dataObject[name]);\n }\n throw Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output);\n }\n getDefaultContentType() {\n return \"application/cbor\";\n }\n}\n\nexports.CborCodec = CborCodec;\nexports.CborShapeDeserializer = CborShapeDeserializer;\nexports.CborShapeSerializer = CborShapeSerializer;\nexports.SmithyRpcV2CborProtocol = SmithyRpcV2CborProtocol;\nexports.buildHttpRpcRequest = buildHttpRpcRequest;\nexports.cbor = cbor;\nexports.checkCborResponse = checkCborResponse;\nexports.dateToTag = dateToTag;\nexports.loadSmithyRpcV2CborErrorCode = loadSmithyRpcV2CborErrorCode;\nexports.parseCborBody = parseCborBody;\nexports.parseCborErrorBody = parseCborErrorBody;\nexports.tag = tag;\nexports.tagSymbol = tagSymbol;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n constructStack: () => constructStack\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/MiddlewareStack.ts\nvar getAllAliases = /* @__PURE__ */ __name((name, aliases) => {\n const _aliases = [];\n if (name) {\n _aliases.push(name);\n }\n if (aliases) {\n for (const alias of aliases) {\n _aliases.push(alias);\n }\n }\n return _aliases;\n}, \"getAllAliases\");\nvar getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name, aliases) => {\n return `${name || \"anonymous\"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(\",\")})` : \"\"}`;\n}, \"getMiddlewareNameWithAliases\");\nvar constructStack = /* @__PURE__ */ __name(() => {\n let absoluteEntries = [];\n let relativeEntries = [];\n let identifyOnResolve = false;\n const entriesNameSet = /* @__PURE__ */ new Set();\n const sort = /* @__PURE__ */ __name((entries) => entries.sort(\n (a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || \"normal\"] - priorityWeights[a.priority || \"normal\"]\n ), \"sort\");\n const removeByName = /* @__PURE__ */ __name((toRemove) => {\n let isRemoved = false;\n const filterCb = /* @__PURE__ */ __name((entry) => {\n const aliases = getAllAliases(entry.name, entry.aliases);\n if (aliases.includes(toRemove)) {\n isRemoved = true;\n for (const alias of aliases) {\n entriesNameSet.delete(alias);\n }\n return false;\n }\n return true;\n }, \"filterCb\");\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n }, \"removeByName\");\n const removeByReference = /* @__PURE__ */ __name((toRemove) => {\n let isRemoved = false;\n const filterCb = /* @__PURE__ */ __name((entry) => {\n if (entry.middleware === toRemove) {\n isRemoved = true;\n for (const alias of getAllAliases(entry.name, entry.aliases)) {\n entriesNameSet.delete(alias);\n }\n return false;\n }\n return true;\n }, \"filterCb\");\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n }, \"removeByReference\");\n const cloneTo = /* @__PURE__ */ __name((toStack) => {\n var _a;\n absoluteEntries.forEach((entry) => {\n toStack.add(entry.middleware, { ...entry });\n });\n relativeEntries.forEach((entry) => {\n toStack.addRelativeTo(entry.middleware, { ...entry });\n });\n (_a = toStack.identifyOnResolve) == null ? void 0 : _a.call(toStack, stack.identifyOnResolve());\n return toStack;\n }, \"cloneTo\");\n const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => {\n const expandedMiddlewareList = [];\n from.before.forEach((entry) => {\n if (entry.before.length === 0 && entry.after.length === 0) {\n expandedMiddlewareList.push(entry);\n } else {\n expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));\n }\n });\n expandedMiddlewareList.push(from);\n from.after.reverse().forEach((entry) => {\n if (entry.before.length === 0 && entry.after.length === 0) {\n expandedMiddlewareList.push(entry);\n } else {\n expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));\n }\n });\n return expandedMiddlewareList;\n }, \"expandRelativeMiddlewareList\");\n const getMiddlewareList = /* @__PURE__ */ __name((debug = false) => {\n const normalizedAbsoluteEntries = [];\n const normalizedRelativeEntries = [];\n const normalizedEntriesNameMap = {};\n absoluteEntries.forEach((entry) => {\n const normalizedEntry = {\n ...entry,\n before: [],\n after: []\n };\n for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {\n normalizedEntriesNameMap[alias] = normalizedEntry;\n }\n normalizedAbsoluteEntries.push(normalizedEntry);\n });\n relativeEntries.forEach((entry) => {\n const normalizedEntry = {\n ...entry,\n before: [],\n after: []\n };\n for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {\n normalizedEntriesNameMap[alias] = normalizedEntry;\n }\n normalizedRelativeEntries.push(normalizedEntry);\n });\n normalizedRelativeEntries.forEach((entry) => {\n if (entry.toMiddleware) {\n const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];\n if (toMiddleware === void 0) {\n if (debug) {\n return;\n }\n throw new Error(\n `${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`\n );\n }\n if (entry.relation === \"after\") {\n toMiddleware.after.push(entry);\n }\n if (entry.relation === \"before\") {\n toMiddleware.before.push(entry);\n }\n }\n });\n const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => {\n wholeList.push(...expandedMiddlewareList);\n return wholeList;\n }, []);\n return mainChain;\n }, \"getMiddlewareList\");\n const stack = {\n add: (middleware, options = {}) => {\n const { name, override, aliases: _aliases } = options;\n const entry = {\n step: \"initialize\",\n priority: \"normal\",\n middleware,\n ...options\n };\n const aliases = getAllAliases(name, _aliases);\n if (aliases.length > 0) {\n if (aliases.some((alias) => entriesNameSet.has(alias))) {\n if (!override)\n throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);\n for (const alias of aliases) {\n const toOverrideIndex = absoluteEntries.findIndex(\n (entry2) => {\n var _a;\n return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias));\n }\n );\n if (toOverrideIndex === -1) {\n continue;\n }\n const toOverride = absoluteEntries[toOverrideIndex];\n if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {\n throw new Error(\n `\"${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.`\n );\n }\n absoluteEntries.splice(toOverrideIndex, 1);\n }\n }\n for (const alias of aliases) {\n entriesNameSet.add(alias);\n }\n }\n absoluteEntries.push(entry);\n },\n addRelativeTo: (middleware, options) => {\n const { name, override, aliases: _aliases } = options;\n const entry = {\n middleware,\n ...options\n };\n const aliases = getAllAliases(name, _aliases);\n if (aliases.length > 0) {\n if (aliases.some((alias) => entriesNameSet.has(alias))) {\n if (!override)\n throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);\n for (const alias of aliases) {\n const toOverrideIndex = relativeEntries.findIndex(\n (entry2) => {\n var _a;\n return entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias));\n }\n );\n if (toOverrideIndex === -1) {\n continue;\n }\n const toOverride = relativeEntries[toOverrideIndex];\n if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {\n throw new Error(\n `\"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}\" middleware ${toOverride.relation} \"${toOverride.toMiddleware}\" middleware cannot be overridden by \"${getMiddlewareNameWithAliases(name, _aliases)}\" middleware ${entry.relation} \"${entry.toMiddleware}\" middleware.`\n );\n }\n relativeEntries.splice(toOverrideIndex, 1);\n }\n }\n for (const alias of aliases) {\n entriesNameSet.add(alias);\n }\n }\n relativeEntries.push(entry);\n },\n clone: () => cloneTo(constructStack()),\n use: (plugin) => {\n plugin.applyToStack(stack);\n },\n remove: (toRemove) => {\n if (typeof toRemove === \"string\")\n return removeByName(toRemove);\n else\n return removeByReference(toRemove);\n },\n removeByTag: (toRemove) => {\n let isRemoved = false;\n const filterCb = /* @__PURE__ */ __name((entry) => {\n const { tags, name, aliases: _aliases } = entry;\n if (tags && tags.includes(toRemove)) {\n const aliases = getAllAliases(name, _aliases);\n for (const alias of aliases) {\n entriesNameSet.delete(alias);\n }\n isRemoved = true;\n return false;\n }\n return true;\n }, \"filterCb\");\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n },\n concat: (from) => {\n var _a;\n const cloned = cloneTo(constructStack());\n cloned.use(from);\n cloned.identifyOnResolve(\n identifyOnResolve || cloned.identifyOnResolve() || (((_a = from.identifyOnResolve) == null ? void 0 : _a.call(from)) ?? false)\n );\n return cloned;\n },\n applyToStack: cloneTo,\n identify: () => {\n return getMiddlewareList(true).map((mw) => {\n const step = mw.step ?? mw.relation + \" \" + mw.toMiddleware;\n return getMiddlewareNameWithAliases(mw.name, mw.aliases) + \" - \" + step;\n });\n },\n identifyOnResolve(toggle) {\n if (typeof toggle === \"boolean\")\n identifyOnResolve = toggle;\n return identifyOnResolve;\n },\n resolve: (handler, context) => {\n for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {\n handler = middleware(handler, context);\n }\n if (identifyOnResolve) {\n console.log(stack.identify());\n }\n return handler;\n }\n };\n return stack;\n}, \"constructStack\");\nvar stepWeights = {\n initialize: 5,\n serialize: 4,\n build: 3,\n finalizeRequest: 2,\n deserialize: 1\n};\nvar priorityWeights = {\n high: 3,\n normal: 2,\n low: 1\n};\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n constructStack\n});\n\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n Client: () => Client,\n Command: () => Command,\n LazyJsonString: () => LazyJsonString,\n NoOpLogger: () => NoOpLogger,\n SENSITIVE_STRING: () => SENSITIVE_STRING,\n ServiceException: () => ServiceException,\n StringWrapper: () => StringWrapper,\n _json: () => _json,\n collectBody: () => collectBody,\n convertMap: () => convertMap,\n createAggregatedClient: () => createAggregatedClient,\n dateToUtcString: () => dateToUtcString,\n decorateServiceException: () => decorateServiceException,\n emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion,\n expectBoolean: () => expectBoolean,\n expectByte: () => expectByte,\n expectFloat32: () => expectFloat32,\n expectInt: () => expectInt,\n expectInt32: () => expectInt32,\n expectLong: () => expectLong,\n expectNonNull: () => expectNonNull,\n expectNumber: () => expectNumber,\n expectObject: () => expectObject,\n expectShort: () => expectShort,\n expectString: () => expectString,\n expectUnion: () => expectUnion,\n extendedEncodeURIComponent: () => extendedEncodeURIComponent,\n getArrayIfSingleItem: () => getArrayIfSingleItem,\n getDefaultClientConfiguration: () => getDefaultClientConfiguration,\n getDefaultExtensionConfiguration: () => getDefaultExtensionConfiguration,\n getValueFromTextNode: () => getValueFromTextNode,\n handleFloat: () => handleFloat,\n limitedParseDouble: () => limitedParseDouble,\n limitedParseFloat: () => limitedParseFloat,\n limitedParseFloat32: () => limitedParseFloat32,\n loadConfigsForDefaultMode: () => loadConfigsForDefaultMode,\n logger: () => logger,\n map: () => map,\n parseBoolean: () => parseBoolean,\n parseEpochTimestamp: () => parseEpochTimestamp,\n parseRfc3339DateTime: () => parseRfc3339DateTime,\n parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset,\n parseRfc7231DateTime: () => parseRfc7231DateTime,\n resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig,\n resolvedPath: () => resolvedPath,\n serializeFloat: () => serializeFloat,\n splitEvery: () => splitEvery,\n strictParseByte: () => strictParseByte,\n strictParseDouble: () => strictParseDouble,\n strictParseFloat: () => strictParseFloat,\n strictParseFloat32: () => strictParseFloat32,\n strictParseInt: () => strictParseInt,\n strictParseInt32: () => strictParseInt32,\n strictParseLong: () => strictParseLong,\n strictParseShort: () => strictParseShort,\n take: () => take,\n throwDefaultError: () => throwDefaultError,\n withBaseException: () => withBaseException\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/NoOpLogger.ts\nvar _NoOpLogger = class _NoOpLogger {\n trace() {\n }\n debug() {\n }\n info() {\n }\n warn() {\n }\n error() {\n }\n};\n__name(_NoOpLogger, \"NoOpLogger\");\nvar NoOpLogger = _NoOpLogger;\n\n// src/client.ts\nvar import_middleware_stack = require(\"@smithy/middleware-stack\");\nvar _Client = class _Client {\n constructor(config) {\n this.middlewareStack = (0, import_middleware_stack.constructStack)();\n this.config = config;\n }\n send(command, optionsOrCb, cb) {\n const options = typeof optionsOrCb !== \"function\" ? optionsOrCb : void 0;\n const callback = typeof optionsOrCb === \"function\" ? optionsOrCb : cb;\n const handler = command.resolveMiddleware(this.middlewareStack, this.config, options);\n if (callback) {\n handler(command).then(\n (result) => callback(null, result.output),\n (err) => callback(err)\n ).catch(\n // prevent any errors thrown in the callback from triggering an\n // unhandled promise rejection\n () => {\n }\n );\n } else {\n return handler(command).then((result) => result.output);\n }\n }\n destroy() {\n if (this.config.requestHandler.destroy)\n this.config.requestHandler.destroy();\n }\n};\n__name(_Client, \"Client\");\nvar Client = _Client;\n\n// src/collect-stream-body.ts\nvar import_util_stream = require(\"@smithy/util-stream\");\nvar collectBody = /* @__PURE__ */ __name(async (streamBody = new Uint8Array(), context) => {\n if (streamBody instanceof Uint8Array) {\n return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody);\n }\n if (!streamBody) {\n return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array());\n }\n const fromContext = context.streamCollector(streamBody);\n return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext);\n}, \"collectBody\");\n\n// src/command.ts\n\nvar import_types = require(\"@smithy/types\");\nvar _Command = class _Command {\n constructor() {\n this.middlewareStack = (0, import_middleware_stack.constructStack)();\n }\n /**\n * Factory for Command ClassBuilder.\n * @internal\n */\n static classBuilder() {\n return new ClassBuilder();\n }\n /**\n * @internal\n */\n resolveMiddlewareWithContext(clientStack, configuration, options, {\n middlewareFn,\n clientName,\n commandName,\n inputFilterSensitiveLog,\n outputFilterSensitiveLog,\n smithyContext,\n additionalContext,\n CommandCtor\n }) {\n for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {\n this.middlewareStack.use(mw);\n }\n const stack = clientStack.concat(this.middlewareStack);\n const { logger: logger2 } = configuration;\n const handlerExecutionContext = {\n logger: logger2,\n clientName,\n commandName,\n inputFilterSensitiveLog,\n outputFilterSensitiveLog,\n [import_types.SMITHY_CONTEXT_KEY]: {\n ...smithyContext\n },\n ...additionalContext\n };\n const { requestHandler } = configuration;\n return stack.resolve(\n (request) => requestHandler.handle(request.request, options || {}),\n handlerExecutionContext\n );\n }\n};\n__name(_Command, \"Command\");\nvar Command = _Command;\nvar _ClassBuilder = class _ClassBuilder {\n constructor() {\n this._init = () => {\n };\n this._ep = {};\n this._middlewareFn = () => [];\n this._commandName = \"\";\n this._clientName = \"\";\n this._additionalContext = {};\n this._smithyContext = {};\n this._inputFilterSensitiveLog = (_) => _;\n this._outputFilterSensitiveLog = (_) => _;\n this._serializer = null;\n this._deserializer = null;\n }\n /**\n * Optional init callback.\n */\n init(cb) {\n this._init = cb;\n }\n /**\n * Set the endpoint parameter instructions.\n */\n ep(endpointParameterInstructions) {\n this._ep = endpointParameterInstructions;\n return this;\n }\n /**\n * Add any number of middleware.\n */\n m(middlewareSupplier) {\n this._middlewareFn = middlewareSupplier;\n return this;\n }\n /**\n * Set the initial handler execution context Smithy field.\n */\n s(service, operation, smithyContext = {}) {\n this._smithyContext = {\n service,\n operation,\n ...smithyContext\n };\n return this;\n }\n /**\n * Set the initial handler execution context.\n */\n c(additionalContext = {}) {\n this._additionalContext = additionalContext;\n return this;\n }\n /**\n * Set constant string identifiers for the operation.\n */\n n(clientName, commandName) {\n this._clientName = clientName;\n this._commandName = commandName;\n return this;\n }\n /**\n * Set the input and output sensistive log filters.\n */\n f(inputFilter = (_) => _, outputFilter = (_) => _) {\n this._inputFilterSensitiveLog = inputFilter;\n this._outputFilterSensitiveLog = outputFilter;\n return this;\n }\n /**\n * Sets the serializer.\n */\n ser(serializer) {\n this._serializer = serializer;\n return this;\n }\n /**\n * Sets the deserializer.\n */\n de(deserializer) {\n this._deserializer = deserializer;\n return this;\n }\n /**\n * @returns a Command class with the classBuilder properties.\n */\n build() {\n var _a;\n const closure = this;\n let CommandRef;\n return CommandRef = (_a = class extends Command {\n /**\n * @public\n */\n constructor(...[input]) {\n super();\n /**\n * @internal\n */\n // @ts-ignore used in middlewareFn closure.\n this.serialize = closure._serializer;\n /**\n * @internal\n */\n // @ts-ignore used in middlewareFn closure.\n this.deserialize = closure._deserializer;\n this.input = input ?? {};\n closure._init(this);\n }\n /**\n * @public\n */\n static getEndpointParameterInstructions() {\n return closure._ep;\n }\n /**\n * @internal\n */\n resolveMiddleware(stack, configuration, options) {\n return this.resolveMiddlewareWithContext(stack, configuration, options, {\n CommandCtor: CommandRef,\n middlewareFn: closure._middlewareFn,\n clientName: closure._clientName,\n commandName: closure._commandName,\n inputFilterSensitiveLog: closure._inputFilterSensitiveLog,\n outputFilterSensitiveLog: closure._outputFilterSensitiveLog,\n smithyContext: closure._smithyContext,\n additionalContext: closure._additionalContext\n });\n }\n }, __name(_a, \"CommandRef\"), _a);\n }\n};\n__name(_ClassBuilder, \"ClassBuilder\");\nvar ClassBuilder = _ClassBuilder;\n\n// src/constants.ts\nvar SENSITIVE_STRING = \"***SensitiveInformation***\";\n\n// src/create-aggregated-client.ts\nvar createAggregatedClient = /* @__PURE__ */ __name((commands, Client2) => {\n for (const command of Object.keys(commands)) {\n const CommandCtor = commands[command];\n const methodImpl = /* @__PURE__ */ __name(async function(args, optionsOrCb, cb) {\n const command2 = new CommandCtor(args);\n if (typeof optionsOrCb === \"function\") {\n this.send(command2, optionsOrCb);\n } else if (typeof cb === \"function\") {\n if (typeof optionsOrCb !== \"object\")\n throw new Error(`Expected http options but got ${typeof optionsOrCb}`);\n this.send(command2, optionsOrCb || {}, cb);\n } else {\n return this.send(command2, optionsOrCb);\n }\n }, \"methodImpl\");\n const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, \"\");\n Client2.prototype[methodName] = methodImpl;\n }\n}, \"createAggregatedClient\");\n\n// src/parse-utils.ts\nvar parseBoolean = /* @__PURE__ */ __name((value) => {\n switch (value) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n default:\n throw new Error(`Unable to parse boolean value \"${value}\"`);\n }\n}, \"parseBoolean\");\nvar expectBoolean = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n if (typeof value === \"number\") {\n if (value === 0 || value === 1) {\n logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));\n }\n if (value === 0) {\n return false;\n }\n if (value === 1) {\n return true;\n }\n }\n if (typeof value === \"string\") {\n const lower = value.toLowerCase();\n if (lower === \"false\" || lower === \"true\") {\n logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));\n }\n if (lower === \"false\") {\n return false;\n }\n if (lower === \"true\") {\n return true;\n }\n }\n if (typeof value === \"boolean\") {\n return value;\n }\n throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);\n}, \"expectBoolean\");\nvar expectNumber = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n if (typeof value === \"string\") {\n const parsed = parseFloat(value);\n if (!Number.isNaN(parsed)) {\n if (String(parsed) !== String(value)) {\n logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));\n }\n return parsed;\n }\n }\n if (typeof value === \"number\") {\n return value;\n }\n throw new TypeError(`Expected number, got ${typeof value}: ${value}`);\n}, \"expectNumber\");\nvar MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));\nvar expectFloat32 = /* @__PURE__ */ __name((value) => {\n const expected = expectNumber(value);\n if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {\n if (Math.abs(expected) > MAX_FLOAT) {\n throw new TypeError(`Expected 32-bit float, got ${value}`);\n }\n }\n return expected;\n}, \"expectFloat32\");\nvar expectLong = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n if (Number.isInteger(value) && !Number.isNaN(value)) {\n return value;\n }\n throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);\n}, \"expectLong\");\nvar expectInt = expectLong;\nvar expectInt32 = /* @__PURE__ */ __name((value) => expectSizedInt(value, 32), \"expectInt32\");\nvar expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), \"expectShort\");\nvar expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), \"expectByte\");\nvar expectSizedInt = /* @__PURE__ */ __name((value, size) => {\n const expected = expectLong(value);\n if (expected !== void 0 && castInt(expected, size) !== expected) {\n throw new TypeError(`Expected ${size}-bit integer, got ${value}`);\n }\n return expected;\n}, \"expectSizedInt\");\nvar castInt = /* @__PURE__ */ __name((value, size) => {\n switch (size) {\n case 32:\n return Int32Array.of(value)[0];\n case 16:\n return Int16Array.of(value)[0];\n case 8:\n return Int8Array.of(value)[0];\n }\n}, \"castInt\");\nvar expectNonNull = /* @__PURE__ */ __name((value, location) => {\n if (value === null || value === void 0) {\n if (location) {\n throw new TypeError(`Expected a non-null value for ${location}`);\n }\n throw new TypeError(\"Expected a non-null value\");\n }\n return value;\n}, \"expectNonNull\");\nvar expectObject = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n if (typeof value === \"object\" && !Array.isArray(value)) {\n return value;\n }\n const receivedType = Array.isArray(value) ? \"array\" : typeof value;\n throw new TypeError(`Expected object, got ${receivedType}: ${value}`);\n}, \"expectObject\");\nvar expectString = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n if (typeof value === \"string\") {\n return value;\n }\n if ([\"boolean\", \"number\", \"bigint\"].includes(typeof value)) {\n logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));\n return String(value);\n }\n throw new TypeError(`Expected string, got ${typeof value}: ${value}`);\n}, \"expectString\");\nvar expectUnion = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n const asObject = expectObject(value);\n const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k);\n if (setKeys.length === 0) {\n throw new TypeError(`Unions must have exactly one non-null member. None were found.`);\n }\n if (setKeys.length > 1) {\n throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);\n }\n return asObject;\n}, \"expectUnion\");\nvar strictParseDouble = /* @__PURE__ */ __name((value) => {\n if (typeof value == \"string\") {\n return expectNumber(parseNumber(value));\n }\n return expectNumber(value);\n}, \"strictParseDouble\");\nvar strictParseFloat = strictParseDouble;\nvar strictParseFloat32 = /* @__PURE__ */ __name((value) => {\n if (typeof value == \"string\") {\n return expectFloat32(parseNumber(value));\n }\n return expectFloat32(value);\n}, \"strictParseFloat32\");\nvar NUMBER_REGEX = /(-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|(-?Infinity)|(NaN)/g;\nvar parseNumber = /* @__PURE__ */ __name((value) => {\n const matches = value.match(NUMBER_REGEX);\n if (matches === null || matches[0].length !== value.length) {\n throw new TypeError(`Expected real number, got implicit NaN`);\n }\n return parseFloat(value);\n}, \"parseNumber\");\nvar limitedParseDouble = /* @__PURE__ */ __name((value) => {\n if (typeof value == \"string\") {\n return parseFloatString(value);\n }\n return expectNumber(value);\n}, \"limitedParseDouble\");\nvar handleFloat = limitedParseDouble;\nvar limitedParseFloat = limitedParseDouble;\nvar limitedParseFloat32 = /* @__PURE__ */ __name((value) => {\n if (typeof value == \"string\") {\n return parseFloatString(value);\n }\n return expectFloat32(value);\n}, \"limitedParseFloat32\");\nvar parseFloatString = /* @__PURE__ */ __name((value) => {\n switch (value) {\n case \"NaN\":\n return NaN;\n case \"Infinity\":\n return Infinity;\n case \"-Infinity\":\n return -Infinity;\n default:\n throw new Error(`Unable to parse float value: ${value}`);\n }\n}, \"parseFloatString\");\nvar strictParseLong = /* @__PURE__ */ __name((value) => {\n if (typeof value === \"string\") {\n return expectLong(parseNumber(value));\n }\n return expectLong(value);\n}, \"strictParseLong\");\nvar strictParseInt = strictParseLong;\nvar strictParseInt32 = /* @__PURE__ */ __name((value) => {\n if (typeof value === \"string\") {\n return expectInt32(parseNumber(value));\n }\n return expectInt32(value);\n}, \"strictParseInt32\");\nvar strictParseShort = /* @__PURE__ */ __name((value) => {\n if (typeof value === \"string\") {\n return expectShort(parseNumber(value));\n }\n return expectShort(value);\n}, \"strictParseShort\");\nvar strictParseByte = /* @__PURE__ */ __name((value) => {\n if (typeof value === \"string\") {\n return expectByte(parseNumber(value));\n }\n return expectByte(value);\n}, \"strictParseByte\");\nvar stackTraceWarning = /* @__PURE__ */ __name((message) => {\n return String(new TypeError(message).stack || message).split(\"\\n\").slice(0, 5).filter((s) => !s.includes(\"stackTraceWarning\")).join(\"\\n\");\n}, \"stackTraceWarning\");\nvar logger = {\n warn: console.warn\n};\n\n// src/date-utils.ts\nvar DAYS = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\nvar MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\nfunction dateToUtcString(date) {\n const year = date.getUTCFullYear();\n const month = date.getUTCMonth();\n const dayOfWeek = date.getUTCDay();\n const dayOfMonthInt = date.getUTCDate();\n const hoursInt = date.getUTCHours();\n const minutesInt = date.getUTCMinutes();\n const secondsInt = date.getUTCSeconds();\n const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;\n const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;\n const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;\n const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;\n return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;\n}\n__name(dateToUtcString, \"dateToUtcString\");\nvar RFC3339 = new RegExp(/^(\\d{4})-(\\d{2})-(\\d{2})[tT](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?[zZ]$/);\nvar parseRfc3339DateTime = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n if (typeof value !== \"string\") {\n throw new TypeError(\"RFC-3339 date-times must be expressed as strings\");\n }\n const match = RFC3339.exec(value);\n if (!match) {\n throw new TypeError(\"Invalid RFC-3339 date-time value\");\n }\n const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n const year = strictParseShort(stripLeadingZeroes(yearStr));\n const month = parseDateValue(monthStr, \"month\", 1, 12);\n const day = parseDateValue(dayStr, \"day\", 1, 31);\n return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });\n}, \"parseRfc3339DateTime\");\nvar RFC3339_WITH_OFFSET = new RegExp(\n /^(\\d{4})-(\\d{2})-(\\d{2})[tT](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?(([-+]\\d{2}\\:\\d{2})|[zZ])$/\n);\nvar parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n if (typeof value !== \"string\") {\n throw new TypeError(\"RFC-3339 date-times must be expressed as strings\");\n }\n const match = RFC3339_WITH_OFFSET.exec(value);\n if (!match) {\n throw new TypeError(\"Invalid RFC-3339 date-time value\");\n }\n const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;\n const year = strictParseShort(stripLeadingZeroes(yearStr));\n const month = parseDateValue(monthStr, \"month\", 1, 12);\n const day = parseDateValue(dayStr, \"day\", 1, 31);\n const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });\n if (offsetStr.toUpperCase() != \"Z\") {\n date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));\n }\n return date;\n}, \"parseRfc3339DateTimeWithOffset\");\nvar IMF_FIXDATE = new RegExp(\n /^(?: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$/\n);\nvar RFC_850_DATE = new RegExp(\n /^(?: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$/\n);\nvar ASC_TIME = new RegExp(\n /^(?: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})$/\n);\nvar parseRfc7231DateTime = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n if (typeof value !== \"string\") {\n throw new TypeError(\"RFC-7231 date-times must be expressed as strings\");\n }\n let match = IMF_FIXDATE.exec(value);\n if (match) {\n const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n return buildDate(\n strictParseShort(stripLeadingZeroes(yearStr)),\n parseMonthByShortName(monthStr),\n parseDateValue(dayStr, \"day\", 1, 31),\n { hours, minutes, seconds, fractionalMilliseconds }\n );\n }\n match = RFC_850_DATE.exec(value);\n if (match) {\n const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n return adjustRfc850Year(\n buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, \"day\", 1, 31), {\n hours,\n minutes,\n seconds,\n fractionalMilliseconds\n })\n );\n }\n match = ASC_TIME.exec(value);\n if (match) {\n const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;\n return buildDate(\n strictParseShort(stripLeadingZeroes(yearStr)),\n parseMonthByShortName(monthStr),\n parseDateValue(dayStr.trimLeft(), \"day\", 1, 31),\n { hours, minutes, seconds, fractionalMilliseconds }\n );\n }\n throw new TypeError(\"Invalid RFC-7231 date-time value\");\n}, \"parseRfc7231DateTime\");\nvar parseEpochTimestamp = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return void 0;\n }\n let valueAsDouble;\n if (typeof value === \"number\") {\n valueAsDouble = value;\n } else if (typeof value === \"string\") {\n valueAsDouble = strictParseDouble(value);\n } else {\n throw new TypeError(\"Epoch timestamps must be expressed as floating point numbers or their string representation\");\n }\n if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) {\n throw new TypeError(\"Epoch timestamps must be valid, non-Infinite, non-NaN numerics\");\n }\n return new Date(Math.round(valueAsDouble * 1e3));\n}, \"parseEpochTimestamp\");\nvar buildDate = /* @__PURE__ */ __name((year, month, day, time) => {\n const adjustedMonth = month - 1;\n validateDayOfMonth(year, adjustedMonth, day);\n return new Date(\n Date.UTC(\n year,\n adjustedMonth,\n day,\n parseDateValue(time.hours, \"hour\", 0, 23),\n parseDateValue(time.minutes, \"minute\", 0, 59),\n // seconds can go up to 60 for leap seconds\n parseDateValue(time.seconds, \"seconds\", 0, 60),\n parseMilliseconds(time.fractionalMilliseconds)\n )\n );\n}, \"buildDate\");\nvar parseTwoDigitYear = /* @__PURE__ */ __name((value) => {\n const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear();\n const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));\n if (valueInThisCentury < thisYear) {\n return valueInThisCentury + 100;\n }\n return valueInThisCentury;\n}, \"parseTwoDigitYear\");\nvar FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3;\nvar adjustRfc850Year = /* @__PURE__ */ __name((input) => {\n if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) {\n return new Date(\n Date.UTC(\n input.getUTCFullYear() - 100,\n input.getUTCMonth(),\n input.getUTCDate(),\n input.getUTCHours(),\n input.getUTCMinutes(),\n input.getUTCSeconds(),\n input.getUTCMilliseconds()\n )\n );\n }\n return input;\n}, \"adjustRfc850Year\");\nvar parseMonthByShortName = /* @__PURE__ */ __name((value) => {\n const monthIdx = MONTHS.indexOf(value);\n if (monthIdx < 0) {\n throw new TypeError(`Invalid month: ${value}`);\n }\n return monthIdx + 1;\n}, \"parseMonthByShortName\");\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar validateDayOfMonth = /* @__PURE__ */ __name((year, month, day) => {\n let maxDays = DAYS_IN_MONTH[month];\n if (month === 1 && isLeapYear(year)) {\n maxDays = 29;\n }\n if (day > maxDays) {\n throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);\n }\n}, \"validateDayOfMonth\");\nvar isLeapYear = /* @__PURE__ */ __name((year) => {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}, \"isLeapYear\");\nvar parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => {\n const dateVal = strictParseByte(stripLeadingZeroes(value));\n if (dateVal < lower || dateVal > upper) {\n throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);\n }\n return dateVal;\n}, \"parseDateValue\");\nvar parseMilliseconds = /* @__PURE__ */ __name((value) => {\n if (value === null || value === void 0) {\n return 0;\n }\n return strictParseFloat32(\"0.\" + value) * 1e3;\n}, \"parseMilliseconds\");\nvar parseOffsetToMilliseconds = /* @__PURE__ */ __name((value) => {\n const directionStr = value[0];\n let direction = 1;\n if (directionStr == \"+\") {\n direction = 1;\n } else if (directionStr == \"-\") {\n direction = -1;\n } else {\n throw new TypeError(`Offset direction, ${directionStr}, must be \"+\" or \"-\"`);\n }\n const hour = Number(value.substring(1, 3));\n const minute = Number(value.substring(4, 6));\n return direction * (hour * 60 + minute) * 60 * 1e3;\n}, \"parseOffsetToMilliseconds\");\nvar stripLeadingZeroes = /* @__PURE__ */ __name((value) => {\n let idx = 0;\n while (idx < value.length - 1 && value.charAt(idx) === \"0\") {\n idx++;\n }\n if (idx === 0) {\n return value;\n }\n return value.slice(idx);\n}, \"stripLeadingZeroes\");\n\n// src/exceptions.ts\nvar _ServiceException = class _ServiceException extends Error {\n constructor(options) {\n super(options.message);\n Object.setPrototypeOf(this, _ServiceException.prototype);\n this.name = options.name;\n this.$fault = options.$fault;\n this.$metadata = options.$metadata;\n }\n};\n__name(_ServiceException, \"ServiceException\");\nvar ServiceException = _ServiceException;\nvar decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => {\n Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => {\n if (exception[k] == void 0 || exception[k] === \"\") {\n exception[k] = v;\n }\n });\n const message = exception.message || exception.Message || \"UnknownError\";\n exception.message = message;\n delete exception.Message;\n return exception;\n}, \"decorateServiceException\");\n\n// src/default-error-handler.ts\nvar throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => {\n const $metadata = deserializeMetadata(output);\n const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + \"\" : void 0;\n const response = new exceptionCtor({\n name: (parsedBody == null ? void 0 : parsedBody.code) || (parsedBody == null ? void 0 : parsedBody.Code) || errorCode || statusCode || \"UnknownError\",\n $fault: \"client\",\n $metadata\n });\n throw decorateServiceException(response, parsedBody);\n}, \"throwDefaultError\");\nvar withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => {\n return ({ output, parsedBody, errorCode }) => {\n throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode });\n };\n}, \"withBaseException\");\nvar deserializeMetadata = /* @__PURE__ */ __name((output) => ({\n httpStatusCode: output.statusCode,\n requestId: output.headers[\"x-amzn-requestid\"] ?? output.headers[\"x-amzn-request-id\"] ?? output.headers[\"x-amz-request-id\"],\n extendedRequestId: output.headers[\"x-amz-id-2\"],\n cfId: output.headers[\"x-amz-cf-id\"]\n}), \"deserializeMetadata\");\n\n// src/defaults-mode.ts\nvar loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => {\n switch (mode) {\n case \"standard\":\n return {\n retryMode: \"standard\",\n connectionTimeout: 3100\n };\n case \"in-region\":\n return {\n retryMode: \"standard\",\n connectionTimeout: 1100\n };\n case \"cross-region\":\n return {\n retryMode: \"standard\",\n connectionTimeout: 3100\n };\n case \"mobile\":\n return {\n retryMode: \"standard\",\n connectionTimeout: 3e4\n };\n default:\n return {};\n }\n}, \"loadConfigsForDefaultMode\");\n\n// src/emitWarningIfUnsupportedVersion.ts\nvar warningEmitted = false;\nvar emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => {\n if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf(\".\"))) < 14) {\n warningEmitted = true;\n }\n}, \"emitWarningIfUnsupportedVersion\");\n\n// src/extensions/checksum.ts\n\nvar getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {\n const checksumAlgorithms = [];\n for (const id in import_types.AlgorithmId) {\n const algorithmId = import_types.AlgorithmId[id];\n if (runtimeConfig[algorithmId] === void 0) {\n continue;\n }\n checksumAlgorithms.push({\n algorithmId: () => algorithmId,\n checksumConstructor: () => runtimeConfig[algorithmId]\n });\n }\n return {\n _checksumAlgorithms: checksumAlgorithms,\n addChecksumAlgorithm(algo) {\n this._checksumAlgorithms.push(algo);\n },\n checksumAlgorithms() {\n return this._checksumAlgorithms;\n }\n };\n}, \"getChecksumConfiguration\");\nvar resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => {\n const runtimeConfig = {};\n clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {\n runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();\n });\n return runtimeConfig;\n}, \"resolveChecksumRuntimeConfig\");\n\n// src/extensions/retry.ts\nvar getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {\n let _retryStrategy = runtimeConfig.retryStrategy;\n return {\n setRetryStrategy(retryStrategy) {\n _retryStrategy = retryStrategy;\n },\n retryStrategy() {\n return _retryStrategy;\n }\n };\n}, \"getRetryConfiguration\");\nvar resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => {\n const runtimeConfig = {};\n runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();\n return runtimeConfig;\n}, \"resolveRetryRuntimeConfig\");\n\n// src/extensions/defaultExtensionConfiguration.ts\nvar getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {\n return {\n ...getChecksumConfiguration(runtimeConfig),\n ...getRetryConfiguration(runtimeConfig)\n };\n}, \"getDefaultExtensionConfiguration\");\nvar getDefaultClientConfiguration = getDefaultExtensionConfiguration;\nvar resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {\n return {\n ...resolveChecksumRuntimeConfig(config),\n ...resolveRetryRuntimeConfig(config)\n };\n}, \"resolveDefaultRuntimeConfig\");\n\n// src/extended-encode-uri-component.ts\nfunction extendedEncodeURIComponent(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n__name(extendedEncodeURIComponent, \"extendedEncodeURIComponent\");\n\n// src/get-array-if-single-item.ts\nvar getArrayIfSingleItem = /* @__PURE__ */ __name((mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray], \"getArrayIfSingleItem\");\n\n// src/get-value-from-text-node.ts\nvar getValueFromTextNode = /* @__PURE__ */ __name((obj) => {\n const textNodeName = \"#text\";\n for (const key in obj) {\n if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) {\n obj[key] = obj[key][textNodeName];\n } else if (typeof obj[key] === \"object\" && obj[key] !== null) {\n obj[key] = getValueFromTextNode(obj[key]);\n }\n }\n return obj;\n}, \"getValueFromTextNode\");\n\n// src/lazy-json.ts\nvar StringWrapper = /* @__PURE__ */ __name(function() {\n const Class = Object.getPrototypeOf(this).constructor;\n const Constructor = Function.bind.apply(String, [null, ...arguments]);\n const instance = new Constructor();\n Object.setPrototypeOf(instance, Class.prototype);\n return instance;\n}, \"StringWrapper\");\nStringWrapper.prototype = Object.create(String.prototype, {\n constructor: {\n value: StringWrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n});\nObject.setPrototypeOf(StringWrapper, String);\nvar _LazyJsonString = class _LazyJsonString extends StringWrapper {\n deserializeJSON() {\n return JSON.parse(super.toString());\n }\n toJSON() {\n return super.toString();\n }\n static fromObject(object) {\n if (object instanceof _LazyJsonString) {\n return object;\n } else if (object instanceof String || typeof object === \"string\") {\n return new _LazyJsonString(object);\n }\n return new _LazyJsonString(JSON.stringify(object));\n }\n};\n__name(_LazyJsonString, \"LazyJsonString\");\nvar LazyJsonString = _LazyJsonString;\n\n// src/object-mapping.ts\nfunction map(arg0, arg1, arg2) {\n let target;\n let filter;\n let instructions;\n if (typeof arg1 === \"undefined\" && typeof arg2 === \"undefined\") {\n target = {};\n instructions = arg0;\n } else {\n target = arg0;\n if (typeof arg1 === \"function\") {\n filter = arg1;\n instructions = arg2;\n return mapWithFilter(target, filter, instructions);\n } else {\n instructions = arg1;\n }\n }\n for (const key of Object.keys(instructions)) {\n if (!Array.isArray(instructions[key])) {\n target[key] = instructions[key];\n continue;\n }\n applyInstruction(target, null, instructions, key);\n }\n return target;\n}\n__name(map, \"map\");\nvar convertMap = /* @__PURE__ */ __name((target) => {\n const output = {};\n for (const [k, v] of Object.entries(target || {})) {\n output[k] = [, v];\n }\n return output;\n}, \"convertMap\");\nvar take = /* @__PURE__ */ __name((source, instructions) => {\n const out = {};\n for (const key in instructions) {\n applyInstruction(out, source, instructions, key);\n }\n return out;\n}, \"take\");\nvar mapWithFilter = /* @__PURE__ */ __name((target, filter, instructions) => {\n return map(\n target,\n Object.entries(instructions).reduce(\n (_instructions, [key, value]) => {\n if (Array.isArray(value)) {\n _instructions[key] = value;\n } else {\n if (typeof value === \"function\") {\n _instructions[key] = [filter, value()];\n } else {\n _instructions[key] = [filter, value];\n }\n }\n return _instructions;\n },\n {}\n )\n );\n}, \"mapWithFilter\");\nvar applyInstruction = /* @__PURE__ */ __name((target, source, instructions, targetKey) => {\n if (source !== null) {\n let instruction = instructions[targetKey];\n if (typeof instruction === \"function\") {\n instruction = [, instruction];\n }\n const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction;\n if (typeof filter2 === \"function\" && filter2(source[sourceKey]) || typeof filter2 !== \"function\" && !!filter2) {\n target[targetKey] = valueFn(source[sourceKey]);\n }\n return;\n }\n let [filter, value] = instructions[targetKey];\n if (typeof value === \"function\") {\n let _value;\n const defaultFilterPassed = filter === void 0 && (_value = value()) != null;\n const customFilterPassed = typeof filter === \"function\" && !!filter(void 0) || typeof filter !== \"function\" && !!filter;\n if (defaultFilterPassed) {\n target[targetKey] = _value;\n } else if (customFilterPassed) {\n target[targetKey] = value();\n }\n } else {\n const defaultFilterPassed = filter === void 0 && value != null;\n const customFilterPassed = typeof filter === \"function\" && !!filter(value) || typeof filter !== \"function\" && !!filter;\n if (defaultFilterPassed || customFilterPassed) {\n target[targetKey] = value;\n }\n }\n}, \"applyInstruction\");\nvar nonNullish = /* @__PURE__ */ __name((_) => _ != null, \"nonNullish\");\nvar pass = /* @__PURE__ */ __name((_) => _, \"pass\");\n\n// src/resolve-path.ts\nvar resolvedPath = /* @__PURE__ */ __name((resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {\n if (input != null && input[memberName] !== void 0) {\n const labelValue = labelValueProvider();\n if (labelValue.length <= 0) {\n throw new Error(\"Empty value provided for input HTTP label: \" + memberName + \".\");\n }\n resolvedPath2 = resolvedPath2.replace(\n uriLabel,\n isGreedyLabel ? labelValue.split(\"/\").map((segment) => extendedEncodeURIComponent(segment)).join(\"/\") : extendedEncodeURIComponent(labelValue)\n );\n } else {\n throw new Error(\"No value provided for input HTTP label: \" + memberName + \".\");\n }\n return resolvedPath2;\n}, \"resolvedPath\");\n\n// src/ser-utils.ts\nvar serializeFloat = /* @__PURE__ */ __name((value) => {\n if (value !== value) {\n return \"NaN\";\n }\n switch (value) {\n case Infinity:\n return \"Infinity\";\n case -Infinity:\n return \"-Infinity\";\n default:\n return value;\n }\n}, \"serializeFloat\");\n\n// src/serde-json.ts\nvar _json = /* @__PURE__ */ __name((obj) => {\n if (obj == null) {\n return {};\n }\n if (Array.isArray(obj)) {\n return obj.filter((_) => _ != null).map(_json);\n }\n if (typeof obj === \"object\") {\n const target = {};\n for (const key of Object.keys(obj)) {\n if (obj[key] == null) {\n continue;\n }\n target[key] = _json(obj[key]);\n }\n return target;\n }\n return obj;\n}, \"_json\");\n\n// src/split-every.ts\nfunction splitEvery(value, delimiter, numDelimiters) {\n if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n }\n const segments = value.split(delimiter);\n if (numDelimiters === 1) {\n return segments;\n }\n const compoundSegments = [];\n let currentSegment = \"\";\n for (let i = 0; i < segments.length; i++) {\n if (currentSegment === \"\") {\n currentSegment = segments[i];\n } else {\n currentSegment += delimiter + segments[i];\n }\n if ((i + 1) % numDelimiters === 0) {\n compoundSegments.push(currentSegment);\n currentSegment = \"\";\n }\n }\n if (currentSegment !== \"\") {\n compoundSegments.push(currentSegment);\n }\n return compoundSegments;\n}\n__name(splitEvery, \"splitEvery\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n NoOpLogger,\n Client,\n collectBody,\n Command,\n SENSITIVE_STRING,\n createAggregatedClient,\n dateToUtcString,\n parseRfc3339DateTime,\n parseRfc3339DateTimeWithOffset,\n parseRfc7231DateTime,\n parseEpochTimestamp,\n throwDefaultError,\n withBaseException,\n loadConfigsForDefaultMode,\n emitWarningIfUnsupportedVersion,\n getDefaultExtensionConfiguration,\n getDefaultClientConfiguration,\n resolveDefaultRuntimeConfig,\n ServiceException,\n decorateServiceException,\n extendedEncodeURIComponent,\n getArrayIfSingleItem,\n getValueFromTextNode,\n StringWrapper,\n LazyJsonString,\n map,\n convertMap,\n take,\n parseBoolean,\n expectBoolean,\n expectNumber,\n expectFloat32,\n expectLong,\n expectInt,\n expectInt32,\n expectShort,\n expectByte,\n expectNonNull,\n expectObject,\n expectString,\n expectUnion,\n strictParseDouble,\n strictParseFloat,\n strictParseFloat32,\n limitedParseDouble,\n handleFloat,\n limitedParseFloat,\n limitedParseFloat32,\n strictParseLong,\n strictParseInt,\n strictParseInt32,\n strictParseShort,\n strictParseByte,\n logger,\n resolvedPath,\n serializeFloat,\n _json,\n splitEvery\n});\n\n", - "(()=>{\"use strict\";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>$t,XMLParser:()=>gt,XMLValidator:()=>It});const i=\":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=new RegExp(\"^[\"+i+\"][\"+i+\"\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\");function s(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t\"!==t[r]&&\" \"!==t[r]&&\"\\t\"!==t[r]&&\"\\n\"!==t[r]&&\"\\r\"!==t[r];r++)h+=t[r];if(h=h.trim(),\"/\"===h[h.length-1]&&(h=h.substring(0,h.length-1),r--),!y(h)){let e;return e=0===h.trim().length?\"Invalid space after '<'.\":\"Tag '\"+h+\"' is an invalid name.\",b(\"InvalidTag\",e,w(t,r))}const l=g(t,r);if(!1===l)return b(\"InvalidAttr\",\"Attributes for '\"+h+\"' have open quote.\",w(t,r));let d=l.value;if(r=l.index,\"/\"===d[d.length-1]){const i=r-d.length;d=d.substring(0,d.length-1);const s=x(d,e);if(!0!==s)return b(s.err.code,s.err.msg,w(t,i+s.err.line));n=!0}else if(a){if(!l.tagClosed)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' doesn't have proper closing.\",w(t,r));if(d.trim().length>0)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' can't have attributes or invalid starting.\",w(t,o));if(0===i.length)return b(\"InvalidTag\",\"Closing tag '\"+h+\"' has not been opened.\",w(t,o));{const e=i.pop();if(h!==e.tagName){let i=w(t,e.tagStartPos);return b(\"InvalidTag\",\"Expected closing tag '\"+e.tagName+\"' (opened in line \"+i.line+\", col \"+i.col+\") instead of closing tag '\"+h+\"'.\",w(t,o))}0==i.length&&(s=!0)}}else{const a=x(d,e);if(!0!==a)return b(a.err.code,a.err.msg,w(t,r-d.length+a.err.line));if(!0===s)return b(\"InvalidXml\",\"Multiple possible root nodes found.\",w(t,r));-1!==e.unpairedTags.indexOf(h)||i.push({tagName:h,tagStartPos:o}),n=!0}for(r++;r0)||b(\"InvalidXml\",\"Invalid '\"+JSON.stringify(i.map(t=>t.tagName),null,4).replace(/\\r?\\n/g,\"\")+\"' found.\",{line:1,col:1}):b(\"InvalidXml\",\"Start tag expected.\",1)}function p(t){return\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t}function u(t,e){const i=e;for(;e5&&\"xml\"===n)return b(\"InvalidXml\",\"XML declaration allowed only at the start of the document.\",w(t,e));if(\"?\"==t[e]&&\">\"==t[e+1]){e++;break}continue}return e}function c(t,e){if(t.length>e+5&&\"-\"===t[e+1]&&\"-\"===t[e+2]){for(e+=3;e\"===t[e+2]){e+=2;break}}else if(t.length>e+8&&\"D\"===t[e+1]&&\"O\"===t[e+2]&&\"C\"===t[e+3]&&\"T\"===t[e+4]&&\"Y\"===t[e+5]&&\"P\"===t[e+6]&&\"E\"===t[e+7]){let i=1;for(e+=8;e\"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&\"[\"===t[e+1]&&\"C\"===t[e+2]&&\"D\"===t[e+3]&&\"A\"===t[e+4]&&\"T\"===t[e+5]&&\"A\"===t[e+6]&&\"[\"===t[e+7])for(e+=8;e\"===t[e+2]){e+=2;break}return e}const d='\"',f=\"'\";function g(t,e){let i=\"\",n=\"\",s=!1;for(;e\"===t[e]&&\"\"===n){s=!0;break}i+=t[e]}return\"\"===n&&{value:i,index:e,tagClosed:s}}const m=new RegExp(\"(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*(['\\\"])(([\\\\s\\\\S])*?)\\\\5)?\",\"g\");function x(t,e){const i=s(t,m),n={};for(let t=0;to.includes(t)?\"__\"+t:t,P={preserveOrder:!1,attributeNamePrefix:\"@_\",attributesGroupName:!1,textNodeName:\"#text\",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,i){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:T};function S(t,e){if(\"string\"!=typeof t)return;const i=t.toLowerCase();if(o.some(t=>i===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`);if(a.some(t=>i===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`)}function A(t){return\"boolean\"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:\"object\"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??100),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:A(!0)}const O=function(t){const e=Object.assign({},P,t),i=[{value:e.attributeNamePrefix,name:\"attributeNamePrefix\"},{value:e.attributesGroupName,name:\"attributesGroupName\"},{value:e.textNodeName,name:\"textNodeName\"},{value:e.cdataPropName,name:\"cdataPropName\"},{value:e.commentPropName,name:\"commentPropName\"}];for(const{value:t,name:e}of i)t&&S(t,e);return null===e.onDangerousProperty&&(e.onDangerousProperty=T),e.processEntities=A(e.processEntities),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(t=>\"string\"==typeof t&&t.startsWith(\"*.\")?\"..\"+t.substring(2):t)),e};let C;C=\"function\"!=typeof Symbol?\"@@xmlMetadata\":Symbol(\"XML Node Metadata\");class ${constructor(t){this.tagname=t,this.child=[],this[\":@\"]=Object.create(null)}add(t,e){\"__proto__\"===t&&(t=\"#__proto__\"),this.child.push({[t]:e})}addChild(t,e){\"__proto__\"===t.tagname&&(t.tagname=\"#__proto__\"),t[\":@\"]&&Object.keys(t[\":@\"]).length>0?this.child.push({[t.tagname]:t.child,\":@\":t[\":@\"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][C]={startIndex:e})}static getMetaDataSymbol(){return C}}class I{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){const i=Object.create(null);let n=0;if(\"O\"!==t[e+3]||\"C\"!==t[e+4]||\"T\"!==t[e+5]||\"Y\"!==t[e+6]||\"P\"!==t[e+7]||\"E\"!==t[e+8])throw new Error(\"Invalid Tag instead of DOCTYPE\");{e+=9;let s=1,r=!1,o=!1,a=\"\";for(;e\"===t[e]){if(o?\"-\"===t[e-1]&&\"-\"===t[e-2]&&(o=!1,s--):s--,0===s)break}else\"[\"===t[e]?r=!0:a+=t[e];else{if(r&&M(t,\"!ENTITY\",e)){let s,r;if(e+=7,[s,r,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===r.indexOf(\"&\")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&n>=this.options.maxEntityCount)throw new Error(`Entity count (${n+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);const t=s.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\");i[s]={regx:RegExp(`&${t};`,\"g\"),val:r},n++}}else if(r&&M(t,\"!ELEMENT\",e)){e+=8;const{index:i}=this.readElementExp(t,e+1);e=i}else if(r&&M(t,\"!ATTLIST\",e))e+=8;else if(r&&M(t,\"!NOTATION\",e)){e+=9;const{index:i}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=i}else{if(!M(t,\"!--\",e))throw new Error(\"Invalid DOCTYPE\");o=!0}s++,a=\"\"}if(0!==s)throw new Error(\"Unclosed DOCTYPE\")}return{entities:i,i:e}}readEntityExp(t,e){const i=e=j(t,e);for(;ethis.options.maxEntitySize)throw new Error(`Entity \"${n}\" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[n,s,--e]}readNotationExp(t,e){const i=e=j(t,e);for(;e{for(;e0&&(this.path[this.path.length-1].values=void 0);const n=this.path.length;this.siblingStacks[n]||(this.siblingStacks[n]=new Map);const s=this.siblingStacks[n],r=i?`${i}:${t}`:t,o=s.get(r)||0;let a=0;for(const t of s.values())a+=t;s.set(r,o+1);const h={tag:t,position:a,counter:o};null!=i&&(h.namespace=i),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0===this.path.length)return;const e=this.path[this.path.length-1];return e.values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const i=t||this.separator;return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(i)}toArray(){return this.path.map(t=>t.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e=0&&e>=0;){const n=t[i];if(\"deep-wildcard\"===n.type){if(i--,i<0)return!0;const n=t[i];let s=!1;for(let t=e;t>=0;t--){const r=t===this.path.length-1;if(this._matchSegment(n,this.path[t],r)){e=t-1,i--,s=!0;break}}if(!s)return!1}else{const t=e===this.path.length-1;if(!this._matchSegment(n,this.path[e],t))return!1;e--,i--}}return i<0}_matchSegment(t,e,i){if(\"*\"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&\"*\"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!i)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue){const i=e.values[t.attrName];if(String(i)!==String(t.attrValue))return!1}}if(void 0!==t.position){if(!i)return!1;const n=e.counter??0;if(\"first\"===t.position&&0!==n)return!1;if(\"odd\"===t.position&&n%2!=1)return!1;if(\"even\"===t.position&&n%2!=0)return!1;if(\"nth\"===t.position&&n!==t.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return new Proxy(this,{get(t,e,i){if(L.has(e))return()=>{throw new TypeError(`Cannot call '${e}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};const n=Reflect.get(t,e,i);return\"path\"===e||\"siblingStacks\"===e?Object.freeze(Array.isArray(n)?n.map(t=>t instanceof Map?Object.freeze(new Map(t)):Object.freeze({...t})):n):\"function\"==typeof n?n.bind(t):n},set(t,e){throw new TypeError(`Cannot set property '${String(e)}' on a read-only Matcher.`)},deleteProperty(t,e){throw new TypeError(`Cannot delete property '${String(e)}' from a read-only Matcher.`)}})}}class R{constructor(t,e={}){this.pattern=t,this.separator=e.separator||\".\",this.segments=this._parse(t),this._hasDeepWildcard=this.segments.some(t=>\"deep-wildcard\"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let i=0,n=\"\";for(;i0){const i=t.substring(0,e);if(\"xmlns\"!==i)return i}}class W{constructor(t){var e;if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:\"'\"},gt:{regex:/&(gt|#62|#x3E);/g,val:\">\"},lt:{regex:/&(lt|#60|#x3C);/g,val:\"<\"},quot:{regex:/&(quot|#34|#x22);/g,val:'\"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:\"&\"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:\" \"},cent:{regex:/&(cent|#162);/g,val:\"¢\"},pound:{regex:/&(pound|#163);/g,val:\"£\"},yen:{regex:/&(yen|#165);/g,val:\"¥\"},euro:{regex:/&(euro|#8364);/g,val:\"€\"},copyright:{regex:/&(copy|#169);/g,val:\"©\"},reg:{regex:/&(reg|#174);/g,val:\"®\"},inr:{regex:/&(inr|#8377);/g,val:\"₹\"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>rt(e,10,\"&#\")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>rt(e,16,\"&#x\")}},this.addExternalEntities=Y,this.parseXml=J,this.parseTextData=z,this.resolveNameSpace=X,this.buildAttributesMap=Z,this.isItStopNode=tt,this.replaceEntitiesValue=Q,this.readStopNodeData=nt,this.saveTextToParentTag=H,this.addChild=K,this.ignoreAttributesFn=\"function\"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const i of e){if(\"string\"==typeof i&&t===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new G,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let t=0;t0)){o||(t=this.replaceEntitiesValue(t,e,i));const n=this.options.jPath?i.toString():i,a=this.options.tagValueProcessor(e,t,n,s,r);return null==a?t:typeof a!=typeof t||a!==t?a:this.options.trimValues||t.trim()===t?st(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function X(t){if(this.options.removeNSPrefix){const e=t.split(\":\"),i=\"/\"===t.charAt(0)?\"/\":\"\";if(\"xmlns\"===e[0])return\"\";2===e.length&&(t=i+e[1])}return t}const q=new RegExp(\"([^\\\\s=]+)\\\\s*(=\\\\s*(['\\\"])([\\\\s\\\\S]*?)\\\\3)?\",\"gm\");function Z(t,e,i){if(!0!==this.options.ignoreAttributes&&\"string\"==typeof t){const n=s(t,q),r=n.length,o={},a={};for(let t=0;t0&&\"object\"==typeof e&&e.updateCurrent&&e.updateCurrent(a);for(let t=0;t\",r,\"Closing Tag is not closed.\");let s=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=s.indexOf(\":\");-1!==t&&(s=s.substr(t+1))}s=ot(this.options.transformTagName,s,\"\",this.options).tagName,i&&(n=this.saveTextToParentTag(n,i,this.readonlyMatcher));const o=this.matcher.getCurrentTag();if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: `);o&&-1!==this.options.unpairedTags.indexOf(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,i=this.tagsNodeStack.pop(),n=\"\",r=e}else if(\"?\"===t[r+1]){let e=it(t,r,!1,\"?>\");if(!e)throw new Error(\"Pi Tag is not closed.\");if(n=this.saveTextToParentTag(n,i,this.readonlyMatcher),this.options.ignoreDeclaration&&\"?xml\"===e.tagName||this.options.ignorePiTags);else{const t=new $(e.tagName);t.add(this.options.textNodeName,\"\"),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[\":@\"]=this.buildAttributesMap(e.tagExp,this.matcher,e.tagName)),this.addChild(i,t,this.readonlyMatcher,r)}r=e.closeIndex+1}else if(\"!--\"===t.substr(r+1,3)){const e=et(t,\"--\\x3e\",r+4,\"Comment is not closed.\");if(this.options.commentPropName){const s=t.substring(r+4,e-2);n=this.saveTextToParentTag(n,i,this.readonlyMatcher),i.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}r=e}else if(\"!D\"===t.substr(r+1,2)){const e=s.readDocType(t,r);this.docTypeEntities=e.entities,r=e.i}else if(\"![\"===t.substr(r+1,2)){const e=et(t,\"]]>\",r,\"CDATA is not closed.\")-2,s=t.substring(r+9,e);n=this.saveTextToParentTag(n,i,this.readonlyMatcher);let o=this.parseTextData(s,i.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==o&&(o=\"\"),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]):i.add(this.options.textNodeName,o),r=e+2}else{let s=it(t,r,this.options.removeNSPrefix);if(!s){const e=t.substring(Math.max(0,r-50),Math.min(t.length,r+50));throw new Error(`readTagExp returned undefined at position ${r}. Context: \"${e}\"`)}let o=s.tagName;const a=s.rawTagName;let h=s.tagExp,l=s.attrExpPresent,p=s.closeIndex;if(({tagName:o,tagExp:h}=ot(this.options.transformTagName,o,h,this.options)),this.options.strictReservedNames&&(o===this.options.commentPropName||o===this.options.cdataPropName||o===this.options.textNodeName||o===this.options.attributesGroupName))throw new Error(`Invalid tag name: ${o}`);i&&n&&\"!xml\"!==i.tagname&&(n=this.saveTextToParentTag(n,i,this.readonlyMatcher,!1));const u=i;u&&-1!==this.options.unpairedTags.indexOf(u.tagname)&&(i=this.tagsNodeStack.pop(),this.matcher.pop());let c=!1;h.length>0&&h.lastIndexOf(\"/\")===h.length-1&&(c=!0,\"/\"===o[o.length-1]?(o=o.substr(0,o.length-1),h=o):h=h.substr(0,h.length-1),l=o!==h);let d,f=null,g={};d=B(a),o!==e.tagname&&this.matcher.push(o,{},d),o!==h&&l&&(f=this.buildAttributesMap(h,this.matcher,o),f&&(g=U(f,this.options))),o!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));const m=r;if(this.isCurrentNodeStopNode){let e=\"\";if(c)r=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(o))r=s.closeIndex;else{const i=this.readStopNodeData(t,a,p+1);if(!i)throw new Error(`Unexpected end of ${a}`);r=i.i,e=i.tagContent}const n=new $(o);f&&(n[\":@\"]=f),n.add(this.options.textNodeName,e),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(i,n,this.readonlyMatcher,m)}else{if(c){({tagName:o,tagExp:h}=ot(this.options.transformTagName,o,h,this.options));const t=new $(o);f&&(t[\":@\"]=f),this.addChild(i,t,this.readonlyMatcher,m),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(-1!==this.options.unpairedTags.indexOf(o)){const t=new $(o);f&&(t[\":@\"]=f),this.addChild(i,t,this.readonlyMatcher,m),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=s.closeIndex;continue}{const t=new $(o);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");this.tagsNodeStack.push(i),f&&(t[\":@\"]=f),this.addChild(i,t,this.readonlyMatcher,m),i=t}}n=\"\",r=p}}else n+=t[r];return e.child};function K(t,e,i,n){this.options.captureMetaData||(n=void 0);const s=this.options.jPath?i.toString():i,r=this.options.updateTag(e.tagname,s,e[\":@\"]);!1===r||(\"string\"==typeof r?(e.tagname=r,t.addChild(e,n)):t.addChild(e,n))}function Q(t,e,i){const n=this.options.processEntities;if(!n||!n.enabled)return t;if(n.allowedTags){const s=this.options.jPath?i.toString():i;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(e):n.allowedTags(e,s)))return t}if(n.tagFilter){const s=this.options.jPath?i.toString():i;if(!n.tagFilter(e,s))return t}for(const e of Object.keys(this.docTypeEntities)){const i=this.docTypeEntities[e],s=t.match(i.regx);if(s){if(this.entityExpansionCount+=s.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);const e=t.length;if(t=t.replace(i.regx,i.val),n.maxExpandedLength&&(this.currentExpandedLength+=t.length-e,this.currentExpandedLength>n.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${n.maxExpandedLength}`)}}for(const e of Object.keys(this.lastEntities)){const i=this.lastEntities[e],s=t.match(i.regex);if(s&&(this.entityExpansionCount+=s.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);t=t.replace(i.regex,i.val)}if(-1===t.indexOf(\"&\"))return t;if(this.options.htmlEntities)for(const e of Object.keys(this.htmlEntities)){const i=this.htmlEntities[e],s=t.match(i.regex);if(s&&(this.entityExpansionCount+=s.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);t=t.replace(i.regex,i.val)}return t.replace(this.ampEntity.regex,this.ampEntity.val)}function H(t,e,i,n){return t&&(void 0===n&&(n=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,i,!1,!!e[\":@\"]&&0!==Object.keys(e[\":@\"]).length,n))&&\"\"!==t&&e.add(this.options.textNodeName,t),t=\"\"),t}function tt(t,e){if(!t||0===t.length)return!1;for(let i=0;i\"){const s=function(t,e,i=\">\"){let n,s=\"\";for(let r=e;r\",i,`${e} is not closed`);if(t.substring(i+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(n,i),i:r};i=r}else if(\"?\"===t[i+1])i=et(t,\"?>\",i+1,\"StopNode is not closed.\");else if(\"!--\"===t.substr(i+1,3))i=et(t,\"--\\x3e\",i+3,\"StopNode is not closed.\");else if(\"![\"===t.substr(i+1,2))i=et(t,\"]]>\",i,\"StopNode is not closed.\")-2;else{const n=it(t,i,\">\");n&&((n&&n.tagName)===e&&\"/\"!==n.tagExp[n.tagExp.length-1]&&s++,i=n.closeIndex)}}function st(t,e,i){if(e&&\"string\"==typeof t){const e=t.trim();return\"true\"===e||\"false\"!==e&&function(t,e={}){if(e=Object.assign({},k,e),!t||\"string\"!=typeof t)return t;let i=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(i))return t;if(\"0\"===t)return 0;if(e.hex&&D.test(i))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error(\"parseInt, Number.parseInt, window.parseInt are not supported\")}(i);if(isFinite(i)){if(i.includes(\"e\")||i.includes(\"E\"))return function(t,e,i){if(!i.eNotation)return t;const n=e.match(F);if(n){let s=n[1]||\"\";const r=-1===n[3].indexOf(\"e\")?\"E\":\"e\",o=n[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:(1!==o.length||!n[3].startsWith(`.${r}`)&&n[3][0]!==r)&&o.length>0?i.leadingZeros&&!a?(e=(n[1]||\"\")+n[3],Number(e)):t:Number(e)}return t}(t,i,e);{const s=V.exec(i);if(s){const r=s[1]||\"\",o=s[2];let a=(n=s[3])&&-1!==n.indexOf(\".\")?(\".\"===(n=n.replace(/0+$/,\"\"))?n=\"0\":\".\"===n[0]?n=\"0\"+n:\".\"===n[n.length-1]&&(n=n.substring(0,n.length-1)),n):n;const h=r?\".\"===t[o.length+1]:\".\"===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!h))return t;{const n=Number(i),s=String(n);if(0===n)return n;if(-1!==s.search(/[eE]/))return e.eNotation?n:t;if(-1!==i.indexOf(\".\"))return\"0\"===s||s===a||s===`${r}${a}`?n:t;let h=o?a:i;return o?h===s||r+h===s?n:t:h===s||h===r+s?n:t}}return t}}var n;return function(t,e,i){const n=e===1/0;switch(i.infinity.toLowerCase()){case\"null\":return null;case\"infinity\":return e;case\"string\":return n?\"Infinity\":\"-Infinity\";default:return t}}(t,Number(i),e)}(t,i)}return void 0!==t?t:\"\"}function rt(t,e,i){const n=Number.parseInt(t,e);return n>=0&&n<=1114111?String.fromCodePoint(n):i+t+\";\"}function ot(t,e,i,n){if(t){const n=t(e);i===e&&(i=n),e=n}return{tagName:e=at(e,n),tagExp:i}}function at(t,e){if(a.includes(t))throw new Error(`[SECURITY] Invalid name: \"${t}\" is a reserved JavaScript keyword that could cause prototype pollution`);return o.includes(t)?e.onDangerousProperty(t):t}const ht=$.getMetaDataSymbol();function lt(t,e){if(!t||\"object\"!=typeof t)return{};if(!e)return t;const i={};for(const n in t)n.startsWith(e)?i[n.substring(e.length)]=t[n]:i[n]=t[n];return i}function pt(t,e,i,n){return ut(t,e,i,n)}function ut(t,e,i,n){let s;const r={};for(let o=0;o0&&(r[e.textNodeName]=s):void 0!==s&&(r[e.textNodeName]=s),r}function ct(t){const e=Object.keys(t);for(let t=0;t0&&(i=\"\\n\");const n=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(let t=0;te.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");if(!Array.isArray(t)){if(null!=t){let i=t.toString();return i=Tt(i,e),i}return\"\"}for(let a=0;a`,o=!1,n.pop();continue}if(l===e.commentPropName){r+=i+`\\x3c!--${h[l][0][e.textNodeName]}--\\x3e`,o=!0,n.pop();continue}if(\"?\"===l[0]){const t=wt(h[\":@\"],e,u),s=\"?xml\"===l?\"\":i;let a=h[l][0][e.textNodeName];a=0!==a.length?\" \"+a:\"\",r+=s+`<${l}${a}${t}?>`,o=!0,n.pop();continue}let c=i;\"\"!==c&&(c+=e.indentBy);const d=i+`<${l}${wt(h[\":@\"],e,u)}`;let f;f=u?bt(h[l],e):xt(h[l],e,c,n,s),-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=d+\">\":r+=d+\"/>\":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(\">\")?r+=d+`>${f}${i}`:(r+=d+\">\",f&&\"\"!==i&&(f.includes(\"/>\")||f.includes(\"`):r+=d+\"/>\",o=!0,n.pop()}return r}function Nt(t,e){if(!t||e.ignoreAttributes)return null;const i={};let n=!1;for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s.startsWith(e.attributeNamePrefix)?s.substr(e.attributeNamePrefix.length):s]=t[s],n=!0);return n?i:null}function bt(t,e){if(!Array.isArray(t))return null!=t?t.toString():\"\";let i=\"\";for(let n=0;n${n}`:i+=`<${r}${t}/>`}}}return i}function Et(t,e){let i=\"\";if(t&&!e.ignoreAttributes)for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=t[n];!0===s&&e.suppressBooleanAttributes?i+=` ${n.substr(e.attributeNamePrefix.length)}`:i+=` ${n.substr(e.attributeNamePrefix.length)}=\"${s}\"`}return i}function yt(t){const e=Object.keys(t);for(let i=0;i0&&e.processEntities)for(let i=0;i\",\"g\"),val:\">\"},{regex:new RegExp(\"<\",\"g\"),val:\"<\"},{regex:new RegExp(\"'\",\"g\"),val:\"'\"},{regex:new RegExp('\"',\"g\"),val:\""\"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function St(t){if(this.options=Object.assign({},Pt,t),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(t=>\"string\"==typeof t&&t.startsWith(\"*.\")?\"..\"+t.substring(2):t)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let t=0;t{for(const i of e){if(\"string\"==typeof i&&t===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Ct),this.processTextOrObjNode=At,this.options.format?(this.indentate=Ot,this.tagEndChar=\">\\n\",this.newLine=\"\\n\"):(this.indentate=function(){return\"\"},this.tagEndChar=\">\",this.newLine=\"\")}function At(t,e,i,n){const s=this.extractAttributes(t);if(n.push(e,s),this.checkStopNode(n)){const s=this.buildRawContent(t),r=this.buildAttributesForStopNode(t);return n.pop(),this.buildObjectNode(s,e,r,i)}const r=this.j2x(t,i+1,n);return n.pop(),void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,r.attrStr,i,n):this.buildObjectNode(r.val,e,r.attrStr,i)}function Ot(t){return this.options.indentBy.repeat(t)}function Ct(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}St.prototype.build=function(t){if(this.options.preserveOrder)return mt(t,this.options);{Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t});const e=new G;return this.j2x(t,0,e).val}},St.prototype.j2x=function(t,e,i){let n=\"\",s=\"\";if(this.options.maxNestedTags&&i.getDepth()>=this.options.maxNestedTags)throw new Error(\"Maximum nested tags exceeded\");const r=this.options.jPath?i.toString():i,o=this.checkStopNode(i);for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a))if(void 0===t[a])this.isAttribute(a)&&(s+=\"\");else if(null===t[a])this.isAttribute(a)||a===this.options.cdataPropName?s+=\"\":\"?\"===a[0]?s+=this.indentate(e)+\"<\"+a+\"?\"+this.tagEndChar:s+=this.indentate(e)+\"<\"+a+\"/\"+this.tagEndChar;else if(t[a]instanceof Date)s+=this.buildTextValNode(t[a],a,\"\",e,i);else if(\"object\"!=typeof t[a]){const h=this.isAttribute(a);if(h&&!this.ignoreAttributesFn(h,r))n+=this.buildAttrPairStr(h,\"\"+t[a],o);else if(!h)if(a===this.options.textNodeName){let e=this.options.tagValueProcessor(a,\"\"+t[a]);s+=this.replaceEntitiesValue(e)}else{i.push(a);const n=this.checkStopNode(i);if(i.pop(),n){const i=\"\"+t[a];s+=\"\"===i?this.indentate(e)+\"<\"+a+this.closeTag(a)+this.tagEndChar:this.indentate(e)+\"<\"+a+\">\"+i+\"\"+t+\"${t}`;else if(\"object\"==typeof t&&null!==t){const n=this.buildRawContent(t),s=this.buildAttributesForStopNode(t);e+=\"\"===n?`<${i}${s}/>`:`<${i}${s}>${n}`}}else if(\"object\"==typeof n&&null!==n){const t=this.buildRawContent(n),s=this.buildAttributesForStopNode(n);e+=\"\"===t?`<${i}${s}/>`:`<${i}${s}>${t}`}else e+=`<${i}>${n}`}return e},St.prototype.buildAttributesForStopNode=function(t){if(!t||\"object\"!=typeof t)return\"\";let e=\"\";if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){const i=t[this.options.attributesGroupName];for(let t in i){if(!Object.prototype.hasOwnProperty.call(i,t))continue;const n=t.startsWith(this.options.attributeNamePrefix)?t.substring(this.options.attributeNamePrefix.length):t,s=i[t];!0===s&&this.options.suppressBooleanAttributes?e+=\" \"+n:e+=\" \"+n+'=\"'+s+'\"'}}else for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;const n=this.isAttribute(i);if(n){const s=t[i];!0===s&&this.options.suppressBooleanAttributes?e+=\" \"+n:e+=\" \"+n+'=\"'+s+'\"'}}return e},St.prototype.buildObjectNode=function(t,e,i,n){if(\"\"===t)return\"?\"===e[0]?this.indentate(n)+\"<\"+e+i+\"?\"+this.tagEndChar:this.indentate(n)+\"<\"+e+i+this.closeTag(e)+this.tagEndChar;{let s=\"\"+t+s}},St.prototype.closeTag=function(t){let e=\"\";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e=\"/\"):e=this.options.suppressEmptyNode?\"/\":`>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+`\\x3c!--${t}--\\x3e`+this.newLine;if(\"?\"===e[0])return this.indentate(n)+\"<\"+e+i+\"?\"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),\"\"===s?this.indentate(n)+\"<\"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+\"<\"+e+i+\">\"+s+\"0&&this.options.processEntities)for(let e=0;e (val.trim() === \"\" && val.includes(\"\\n\") ? \"\" : undefined),\n});\nparser.addEntity(\"#xD\", \"\\r\");\nparser.addEntity(\"#10\", \"\\n\");\nfunction parseXML(xmlString) {\n return parser.parse(xmlString, true);\n}\n", - "'use strict';\n\nvar xmlParser = require('./xml-parser');\n\nfunction escapeAttribute(value) {\n return value.replace(/&/g, \"&\").replace(//g, \">\").replace(/\"/g, \""\");\n}\n\nfunction escapeElement(value) {\n return value\n .replace(/&/g, \"&\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\")\n .replace(//g, \">\")\n .replace(/\\r/g, \" \")\n .replace(/\\n/g, \" \")\n .replace(/\\u0085/g, \"…\")\n .replace(/\\u2028/, \"
\");\n}\n\nclass XmlText {\n value;\n constructor(value) {\n this.value = value;\n }\n toString() {\n return escapeElement(\"\" + this.value);\n }\n}\n\nclass XmlNode {\n name;\n children;\n attributes = {};\n static of(name, childText, withName) {\n const node = new XmlNode(name);\n if (childText !== undefined) {\n node.addChildNode(new XmlText(childText));\n }\n if (withName !== undefined) {\n node.withName(withName);\n }\n return node;\n }\n constructor(name, children = []) {\n this.name = name;\n this.children = children;\n }\n withName(name) {\n this.name = name;\n return this;\n }\n addAttribute(name, value) {\n this.attributes[name] = value;\n return this;\n }\n addChildNode(child) {\n this.children.push(child);\n return this;\n }\n removeAttribute(name) {\n delete this.attributes[name];\n return this;\n }\n n(name) {\n this.name = name;\n return this;\n }\n c(child) {\n this.children.push(child);\n return this;\n }\n a(name, value) {\n if (value != null) {\n this.attributes[name] = value;\n }\n return this;\n }\n cc(input, field, withName = field) {\n if (input[field] != null) {\n const node = XmlNode.of(field, input[field]).withName(withName);\n this.c(node);\n }\n }\n l(input, listName, memberName, valueProvider) {\n if (input[listName] != null) {\n const nodes = valueProvider();\n nodes.map((node) => {\n node.withName(memberName);\n this.c(node);\n });\n }\n }\n lc(input, listName, memberName, valueProvider) {\n if (input[listName] != null) {\n const nodes = valueProvider();\n const containerNode = new XmlNode(memberName);\n nodes.map((node) => {\n containerNode.c(node);\n });\n this.c(containerNode);\n }\n }\n toString() {\n const hasChildren = Boolean(this.children.length);\n let xmlText = `<${this.name}`;\n const attributes = this.attributes;\n for (const attributeName of Object.keys(attributes)) {\n const attribute = attributes[attributeName];\n if (attribute != null) {\n xmlText += ` ${attributeName}=\"${escapeAttribute(\"\" + attribute)}\"`;\n }\n }\n return (xmlText += !hasChildren ? \"/>\" : `>${this.children.map((c) => c.toString()).join(\"\")}`);\n }\n}\n\nObject.defineProperty(exports, \"parseXML\", {\n enumerable: true,\n get: function () { return xmlParser.parseXML; }\n});\nexports.XmlNode = XmlNode;\nexports.XmlText = XmlText;\n", - "'use strict';\n\nvar protocolHttp = require('@smithy/protocol-http');\nvar core = require('@smithy/core');\nvar propertyProvider = require('@smithy/property-provider');\nvar client = require('@aws-sdk/core/client');\nvar signatureV4 = require('@smithy/signature-v4');\nvar cbor = require('@smithy/core/cbor');\nvar schema = require('@smithy/core/schema');\nvar smithyClient = require('@smithy/smithy-client');\nvar protocols = require('@smithy/core/protocols');\nvar serde = require('@smithy/core/serde');\nvar utilBase64 = require('@smithy/util-base64');\nvar utilUtf8 = require('@smithy/util-utf8');\nvar xmlBuilder = require('@aws-sdk/xml-builder');\n\nconst state = {\n warningEmitted: false,\n};\nconst emitWarningIfUnsupportedVersion = (version) => {\n if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf(\".\"))) < 18) {\n state.warningEmitted = true;\n process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will\nno longer support Node.js 16.x on January 6, 2025.\n\nTo continue receiving updates to AWS services, bug fixes, and security\nupdates please upgrade to a supported Node.js LTS version.\n\nMore information can be found at: https://a.co/74kJMmI`);\n }\n};\n\nfunction setCredentialFeature(credentials, feature, value) {\n if (!credentials.$source) {\n credentials.$source = {};\n }\n credentials.$source[feature] = value;\n return credentials;\n}\n\nfunction setFeature(context, feature, value) {\n if (!context.__aws_sdk_context) {\n context.__aws_sdk_context = {\n features: {},\n };\n }\n else if (!context.__aws_sdk_context.features) {\n context.__aws_sdk_context.features = {};\n }\n context.__aws_sdk_context.features[feature] = value;\n}\n\nfunction setTokenFeature(token, feature, value) {\n if (!token.$source) {\n token.$source = {};\n }\n token.$source[feature] = value;\n return token;\n}\n\nconst getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;\n\nconst getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);\n\nconst isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000;\n\nconst getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => {\n const clockTimeInMs = Date.parse(clockTime);\n if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {\n return clockTimeInMs - Date.now();\n }\n return currentSystemClockOffset;\n};\n\nconst throwSigningPropertyError = (name, property) => {\n if (!property) {\n throw new Error(`Property \\`${name}\\` is not resolved for AWS SDK SigV4Auth`);\n }\n return property;\n};\nconst validateSigningProperties = async (signingProperties) => {\n const context = throwSigningPropertyError(\"context\", signingProperties.context);\n const config = throwSigningPropertyError(\"config\", signingProperties.config);\n const authScheme = context.endpointV2?.properties?.authSchemes?.[0];\n const signerFunction = throwSigningPropertyError(\"signer\", config.signer);\n const signer = await signerFunction(authScheme);\n const signingRegion = signingProperties?.signingRegion;\n const signingRegionSet = signingProperties?.signingRegionSet;\n const signingName = signingProperties?.signingName;\n return {\n config,\n signer,\n signingRegion,\n signingRegionSet,\n signingName,\n };\n};\nclass AwsSdkSigV4Signer {\n async sign(httpRequest, identity, signingProperties) {\n if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {\n throw new Error(\"The request is not an instance of `HttpRequest` and cannot be signed\");\n }\n const validatedProps = await validateSigningProperties(signingProperties);\n const { config, signer } = validatedProps;\n let { signingRegion, signingName } = validatedProps;\n const handlerExecutionContext = signingProperties.context;\n if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {\n const [first, second] = handlerExecutionContext.authSchemes;\n if (first?.name === \"sigv4a\" && second?.name === \"sigv4\") {\n signingRegion = second?.signingRegion ?? signingRegion;\n signingName = second?.signingName ?? signingName;\n }\n }\n const signedRequest = await signer.sign(httpRequest, {\n signingDate: getSkewCorrectedDate(config.systemClockOffset),\n signingRegion: signingRegion,\n signingService: signingName,\n });\n return signedRequest;\n }\n errorHandler(signingProperties) {\n return (error) => {\n const serverTime = error.ServerTime ?? getDateHeader(error.$response);\n if (serverTime) {\n const config = throwSigningPropertyError(\"config\", signingProperties.config);\n const initialSystemClockOffset = config.systemClockOffset;\n config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);\n const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;\n if (clockSkewCorrected && error.$metadata) {\n error.$metadata.clockSkewCorrected = true;\n }\n }\n throw error;\n };\n }\n successHandler(httpResponse, signingProperties) {\n const dateHeader = getDateHeader(httpResponse);\n if (dateHeader) {\n const config = throwSigningPropertyError(\"config\", signingProperties.config);\n config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);\n }\n }\n}\nconst AWSSDKSigV4Signer = AwsSdkSigV4Signer;\n\nclass AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {\n async sign(httpRequest, identity, signingProperties) {\n if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {\n throw new Error(\"The request is not an instance of `HttpRequest` and cannot be signed\");\n }\n const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);\n const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();\n const multiRegionOverride = (configResolvedSigningRegionSet ??\n signingRegionSet ?? [signingRegion]).join(\",\");\n const signedRequest = await signer.sign(httpRequest, {\n signingDate: getSkewCorrectedDate(config.systemClockOffset),\n signingRegion: multiRegionOverride,\n signingService: signingName,\n });\n return signedRequest;\n }\n}\n\nconst getArrayForCommaSeparatedString = (str) => typeof str === \"string\" && str.length > 0 ? str.split(\",\").map((item) => item.trim()) : [];\n\nconst getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\\s-]/g, \"_\").toUpperCase()}`;\n\nconst NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = \"AWS_AUTH_SCHEME_PREFERENCE\";\nconst NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = \"auth_scheme_preference\";\nconst NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {\n environmentVariableSelector: (env, options) => {\n if (options?.signingName) {\n const bearerTokenKey = getBearerTokenEnvKey(options.signingName);\n if (bearerTokenKey in env)\n return [\"httpBearerAuth\"];\n }\n if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env))\n return undefined;\n return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);\n },\n configFileSelector: (profile) => {\n if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile))\n return undefined;\n return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);\n },\n default: [],\n};\n\nconst resolveAwsSdkSigV4AConfig = (config) => {\n config.sigv4aSigningRegionSet = core.normalizeProvider(config.sigv4aSigningRegionSet);\n return config;\n};\nconst NODE_SIGV4A_CONFIG_OPTIONS = {\n environmentVariableSelector(env) {\n if (env.AWS_SIGV4A_SIGNING_REGION_SET) {\n return env.AWS_SIGV4A_SIGNING_REGION_SET.split(\",\").map((_) => _.trim());\n }\n throw new propertyProvider.ProviderError(\"AWS_SIGV4A_SIGNING_REGION_SET not set in env.\", {\n tryNextLink: true,\n });\n },\n configFileSelector(profile) {\n if (profile.sigv4a_signing_region_set) {\n return (profile.sigv4a_signing_region_set ?? \"\").split(\",\").map((_) => _.trim());\n }\n throw new propertyProvider.ProviderError(\"sigv4a_signing_region_set not set in profile.\", {\n tryNextLink: true,\n });\n },\n default: undefined,\n};\n\nconst resolveAwsSdkSigV4Config = (config) => {\n let inputCredentials = config.credentials;\n let isUserSupplied = !!config.credentials;\n let resolvedCredentials = undefined;\n Object.defineProperty(config, \"credentials\", {\n set(credentials) {\n if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) {\n isUserSupplied = true;\n }\n inputCredentials = credentials;\n const memoizedProvider = normalizeCredentialProvider(config, {\n credentials: inputCredentials,\n credentialDefaultProvider: config.credentialDefaultProvider,\n });\n const boundProvider = bindCallerConfig(config, memoizedProvider);\n if (isUserSupplied && !boundProvider.attributed) {\n resolvedCredentials = async (options) => boundProvider(options).then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_CODE\", \"e\"));\n resolvedCredentials.memoized = boundProvider.memoized;\n resolvedCredentials.configBound = boundProvider.configBound;\n resolvedCredentials.attributed = true;\n }\n else {\n resolvedCredentials = boundProvider;\n }\n },\n get() {\n return resolvedCredentials;\n },\n enumerable: true,\n configurable: true,\n });\n config.credentials = inputCredentials;\n const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config;\n let signer;\n if (config.signer) {\n signer = core.normalizeProvider(config.signer);\n }\n else if (config.regionInfoProvider) {\n signer = () => core.normalizeProvider(config.region)()\n .then(async (region) => [\n (await config.regionInfoProvider(region, {\n useFipsEndpoint: await config.useFipsEndpoint(),\n useDualstackEndpoint: await config.useDualstackEndpoint(),\n })) || {},\n region,\n ])\n .then(([regionInfo, region]) => {\n const { signingRegion, signingService } = regionInfo;\n config.signingRegion = config.signingRegion || signingRegion || region;\n config.signingName = config.signingName || signingService || config.serviceId;\n const params = {\n ...config,\n credentials: config.credentials,\n region: config.signingRegion,\n service: config.signingName,\n sha256,\n uriEscapePath: signingEscapePath,\n };\n const SignerCtor = config.signerConstructor || signatureV4.SignatureV4;\n return new SignerCtor(params);\n });\n }\n else {\n signer = async (authScheme) => {\n authScheme = Object.assign({}, {\n name: \"sigv4\",\n signingName: config.signingName || config.defaultSigningName,\n signingRegion: await core.normalizeProvider(config.region)(),\n properties: {},\n }, authScheme);\n const signingRegion = authScheme.signingRegion;\n const signingService = authScheme.signingName;\n config.signingRegion = config.signingRegion || signingRegion;\n config.signingName = config.signingName || signingService || config.serviceId;\n const params = {\n ...config,\n credentials: config.credentials,\n region: config.signingRegion,\n service: config.signingName,\n sha256,\n uriEscapePath: signingEscapePath,\n };\n const SignerCtor = config.signerConstructor || signatureV4.SignatureV4;\n return new SignerCtor(params);\n };\n }\n const resolvedConfig = Object.assign(config, {\n systemClockOffset,\n signingEscapePath,\n signer,\n });\n return resolvedConfig;\n};\nconst resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;\nfunction normalizeCredentialProvider(config, { credentials, credentialDefaultProvider, }) {\n let credentialsProvider;\n if (credentials) {\n if (!credentials?.memoized) {\n credentialsProvider = core.memoizeIdentityProvider(credentials, core.isIdentityExpired, core.doesIdentityRequireRefresh);\n }\n else {\n credentialsProvider = credentials;\n }\n }\n else {\n if (credentialDefaultProvider) {\n credentialsProvider = core.normalizeProvider(credentialDefaultProvider(Object.assign({}, config, {\n parentClientConfig: config,\n })));\n }\n else {\n credentialsProvider = async () => {\n throw new Error(\"@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.\");\n };\n }\n }\n credentialsProvider.memoized = true;\n return credentialsProvider;\n}\nfunction bindCallerConfig(config, credentialsProvider) {\n if (credentialsProvider.configBound) {\n return credentialsProvider;\n }\n const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config });\n fn.memoized = credentialsProvider.memoized;\n fn.configBound = true;\n return fn;\n}\n\nclass ProtocolLib {\n queryCompat;\n constructor(queryCompat = false) {\n this.queryCompat = queryCompat;\n }\n resolveRestContentType(defaultContentType, inputSchema) {\n const members = inputSchema.getMemberSchemas();\n const httpPayloadMember = Object.values(members).find((m) => {\n return !!m.getMergedTraits().httpPayload;\n });\n if (httpPayloadMember) {\n const mediaType = httpPayloadMember.getMergedTraits().mediaType;\n if (mediaType) {\n return mediaType;\n }\n else if (httpPayloadMember.isStringSchema()) {\n return \"text/plain\";\n }\n else if (httpPayloadMember.isBlobSchema()) {\n return \"application/octet-stream\";\n }\n else {\n return defaultContentType;\n }\n }\n else if (!inputSchema.isUnitSchema()) {\n const hasBody = Object.values(members).find((m) => {\n const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m.getMergedTraits();\n const noPrefixHeaders = httpPrefixHeaders === void 0;\n return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders;\n });\n if (hasBody) {\n return defaultContentType;\n }\n }\n }\n async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) {\n let namespace = defaultNamespace;\n let errorName = errorIdentifier;\n if (errorIdentifier.includes(\"#\")) {\n [namespace, errorName] = errorIdentifier.split(\"#\");\n }\n const errorMetadata = {\n $metadata: metadata,\n $fault: response.statusCode < 500 ? \"client\" : \"server\",\n };\n const registry = schema.TypeRegistry.for(namespace);\n try {\n const errorSchema = getErrorSchema?.(registry, errorName) ?? registry.getSchema(errorIdentifier);\n return { errorSchema, errorMetadata };\n }\n catch (e) {\n dataObject.message = dataObject.message ?? dataObject.Message ?? \"UnknownError\";\n const synthetic = schema.TypeRegistry.for(\"smithy.ts.sdk.synthetic.\" + namespace);\n const baseExceptionSchema = synthetic.getBaseException();\n if (baseExceptionSchema) {\n const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;\n throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject);\n }\n throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject);\n }\n }\n decorateServiceException(exception, additions = {}) {\n if (this.queryCompat) {\n const msg = exception.Message ?? additions.Message;\n const error = smithyClient.decorateServiceException(exception, additions);\n if (msg) {\n error.Message = msg;\n error.message = msg;\n }\n return error;\n }\n return smithyClient.decorateServiceException(exception, additions);\n }\n setQueryCompatError(output, response) {\n const queryErrorHeader = response.headers?.[\"x-amzn-query-error\"];\n if (output !== undefined && queryErrorHeader != null) {\n const [Code, Type] = queryErrorHeader.split(\";\");\n const entries = Object.entries(output);\n const Error = {\n Code,\n Type,\n };\n Object.assign(output, Error);\n for (const [k, v] of entries) {\n Error[k] = v;\n }\n delete Error.__type;\n output.Error = Error;\n }\n }\n queryCompatOutput(queryCompatErrorData, errorData) {\n if (queryCompatErrorData.Error) {\n errorData.Error = queryCompatErrorData.Error;\n }\n if (queryCompatErrorData.Type) {\n errorData.Type = queryCompatErrorData.Type;\n }\n if (queryCompatErrorData.Code) {\n errorData.Code = queryCompatErrorData.Code;\n }\n }\n}\n\nclass AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol {\n awsQueryCompatible;\n mixin;\n constructor({ defaultNamespace, awsQueryCompatible, }) {\n super({ defaultNamespace });\n this.awsQueryCompatible = !!awsQueryCompatible;\n this.mixin = new ProtocolLib(this.awsQueryCompatible);\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n if (this.awsQueryCompatible) {\n request.headers[\"x-amzn-query-mode\"] = \"true\";\n }\n return request;\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n if (this.awsQueryCompatible) {\n this.mixin.setQueryCompatError(dataObject, response);\n }\n const errorName = cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? \"Unknown\";\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata);\n const ns = schema.NormalizedSchema.of(errorSchema);\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n output[name] = this.deserializer.readValue(member, dataObject[name]);\n }\n if (this.awsQueryCompatible) {\n this.mixin.queryCompatOutput(dataObject, output);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n}\n\nconst _toStr = (val) => {\n if (val == null) {\n return val;\n }\n if (typeof val === \"number\" || typeof val === \"bigint\") {\n const warning = new Error(`Received number ${val} where a string was expected.`);\n warning.name = \"Warning\";\n console.warn(warning);\n return String(val);\n }\n if (typeof val === \"boolean\") {\n const warning = new Error(`Received boolean ${val} where a string was expected.`);\n warning.name = \"Warning\";\n console.warn(warning);\n return String(val);\n }\n return val;\n};\nconst _toBool = (val) => {\n if (val == null) {\n return val;\n }\n if (typeof val === \"string\") {\n const lowercase = val.toLowerCase();\n if (val !== \"\" && lowercase !== \"false\" && lowercase !== \"true\") {\n const warning = new Error(`Received string \"${val}\" where a boolean was expected.`);\n warning.name = \"Warning\";\n console.warn(warning);\n }\n return val !== \"\" && lowercase !== \"false\";\n }\n return val;\n};\nconst _toNum = (val) => {\n if (val == null) {\n return val;\n }\n if (typeof val === \"string\") {\n const num = Number(val);\n if (num.toString() !== val) {\n const warning = new Error(`Received string \"${val}\" where a number was expected.`);\n warning.name = \"Warning\";\n console.warn(warning);\n return val;\n }\n return num;\n }\n return val;\n};\n\nclass SerdeContextConfig {\n serdeContext;\n setSerdeContext(serdeContext) {\n this.serdeContext = serdeContext;\n }\n}\n\nfunction jsonReviver(key, value, context) {\n if (context?.source) {\n const numericString = context.source;\n if (typeof value === \"number\") {\n if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) {\n const isFractional = numericString.includes(\".\");\n if (isFractional) {\n return new serde.NumericValue(numericString, \"bigDecimal\");\n }\n else {\n return BigInt(numericString);\n }\n }\n }\n }\n return value;\n}\n\nconst collectBodyString = (streamBody, context) => smithyClient.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? utilUtf8.toUtf8)(body));\n\nconst parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {\n if (encoded.length) {\n try {\n return JSON.parse(encoded);\n }\n catch (e) {\n if (e?.name === \"SyntaxError\") {\n Object.defineProperty(e, \"$responseBodyText\", {\n value: encoded,\n });\n }\n throw e;\n }\n }\n return {};\n});\nconst parseJsonErrorBody = async (errorBody, context) => {\n const value = await parseJsonBody(errorBody, context);\n value.message = value.message ?? value.Message;\n return value;\n};\nconst loadRestJsonErrorCode = (output, data) => {\n const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());\n const sanitizeErrorCode = (rawValue) => {\n let cleanValue = rawValue;\n if (typeof cleanValue === \"number\") {\n cleanValue = cleanValue.toString();\n }\n if (cleanValue.indexOf(\",\") >= 0) {\n cleanValue = cleanValue.split(\",\")[0];\n }\n if (cleanValue.indexOf(\":\") >= 0) {\n cleanValue = cleanValue.split(\":\")[0];\n }\n if (cleanValue.indexOf(\"#\") >= 0) {\n cleanValue = cleanValue.split(\"#\")[1];\n }\n return cleanValue;\n };\n const headerKey = findKey(output.headers, \"x-amzn-errortype\");\n if (headerKey !== undefined) {\n return sanitizeErrorCode(output.headers[headerKey]);\n }\n if (data && typeof data === \"object\") {\n const codeKey = findKey(data, \"code\");\n if (codeKey && data[codeKey] !== undefined) {\n return sanitizeErrorCode(data[codeKey]);\n }\n if (data[\"__type\"] !== undefined) {\n return sanitizeErrorCode(data[\"__type\"]);\n }\n }\n};\n\nclass JsonShapeDeserializer extends SerdeContextConfig {\n settings;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n async read(schema, data) {\n return this._read(schema, typeof data === \"string\" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext));\n }\n readObject(schema, data) {\n return this._read(schema, data);\n }\n _read(schema$1, value) {\n const isObject = value !== null && typeof value === \"object\";\n const ns = schema.NormalizedSchema.of(schema$1);\n if (ns.isListSchema() && Array.isArray(value)) {\n const listMember = ns.getValueSchema();\n const out = [];\n const sparse = !!ns.getMergedTraits().sparse;\n for (const item of value) {\n if (sparse || item != null) {\n out.push(this._read(listMember, item));\n }\n }\n return out;\n }\n else if (ns.isMapSchema() && isObject) {\n const mapMember = ns.getValueSchema();\n const out = {};\n const sparse = !!ns.getMergedTraits().sparse;\n for (const [_k, _v] of Object.entries(value)) {\n if (sparse || _v != null) {\n out[_k] = this._read(mapMember, _v);\n }\n }\n return out;\n }\n else if (ns.isStructSchema() && isObject) {\n const out = {};\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const fromKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;\n const deserializedValue = this._read(memberSchema, value[fromKey]);\n if (deserializedValue != null) {\n out[memberName] = deserializedValue;\n }\n }\n return out;\n }\n if (ns.isBlobSchema() && typeof value === \"string\") {\n return utilBase64.fromBase64(value);\n }\n const mediaType = ns.getMergedTraits().mediaType;\n if (ns.isStringSchema() && typeof value === \"string\" && mediaType) {\n const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n if (isJson) {\n return serde.LazyJsonString.from(value);\n }\n }\n if (ns.isTimestampSchema() && value != null) {\n const format = protocols.determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n return serde.parseRfc3339DateTimeWithOffset(value);\n case 6:\n return serde.parseRfc7231DateTime(value);\n case 7:\n return serde.parseEpochTimestamp(value);\n default:\n console.warn(\"Missing timestamp format, parsing value with Date constructor:\", value);\n return new Date(value);\n }\n }\n if (ns.isBigIntegerSchema() && (typeof value === \"number\" || typeof value === \"string\")) {\n return BigInt(value);\n }\n if (ns.isBigDecimalSchema() && value != undefined) {\n if (value instanceof serde.NumericValue) {\n return value;\n }\n const untyped = value;\n if (untyped.type === \"bigDecimal\" && \"string\" in untyped) {\n return new serde.NumericValue(untyped.string, untyped.type);\n }\n return new serde.NumericValue(String(value), \"bigDecimal\");\n }\n if (ns.isNumericSchema() && typeof value === \"string\") {\n switch (value) {\n case \"Infinity\":\n return Infinity;\n case \"-Infinity\":\n return -Infinity;\n case \"NaN\":\n return NaN;\n }\n }\n if (ns.isDocumentSchema()) {\n if (isObject) {\n const out = Array.isArray(value) ? [] : {};\n for (const [k, v] of Object.entries(value)) {\n if (v instanceof serde.NumericValue) {\n out[k] = v;\n }\n else {\n out[k] = this._read(ns, v);\n }\n }\n return out;\n }\n else {\n return structuredClone(value);\n }\n }\n return value;\n }\n}\n\nconst NUMERIC_CONTROL_CHAR = String.fromCharCode(925);\nclass JsonReplacer {\n values = new Map();\n counter = 0;\n stage = 0;\n createReplacer() {\n if (this.stage === 1) {\n throw new Error(\"@aws-sdk/core/protocols - JsonReplacer already created.\");\n }\n if (this.stage === 2) {\n throw new Error(\"@aws-sdk/core/protocols - JsonReplacer exhausted.\");\n }\n this.stage = 1;\n return (key, value) => {\n if (value instanceof serde.NumericValue) {\n const v = `${NUMERIC_CONTROL_CHAR + \"nv\" + this.counter++}_` + value.string;\n this.values.set(`\"${v}\"`, value.string);\n return v;\n }\n if (typeof value === \"bigint\") {\n const s = value.toString();\n const v = `${NUMERIC_CONTROL_CHAR + \"b\" + this.counter++}_` + s;\n this.values.set(`\"${v}\"`, s);\n return v;\n }\n return value;\n };\n }\n replaceInJson(json) {\n if (this.stage === 0) {\n throw new Error(\"@aws-sdk/core/protocols - JsonReplacer not created yet.\");\n }\n if (this.stage === 2) {\n throw new Error(\"@aws-sdk/core/protocols - JsonReplacer exhausted.\");\n }\n this.stage = 2;\n if (this.counter === 0) {\n return json;\n }\n for (const [key, value] of this.values) {\n json = json.replace(key, value);\n }\n return json;\n }\n}\n\nclass JsonShapeSerializer extends SerdeContextConfig {\n settings;\n buffer;\n rootSchema;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n write(schema$1, value) {\n this.rootSchema = schema.NormalizedSchema.of(schema$1);\n this.buffer = this._write(this.rootSchema, value);\n }\n writeDiscriminatedDocument(schema$1, value) {\n this.write(schema$1, value);\n if (typeof this.buffer === \"object\") {\n this.buffer.__type = schema.NormalizedSchema.of(schema$1).getName(true);\n }\n }\n flush() {\n const { rootSchema } = this;\n this.rootSchema = undefined;\n if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {\n const replacer = new JsonReplacer();\n return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));\n }\n return this.buffer;\n }\n _write(schema$1, value, container) {\n const isObject = value !== null && typeof value === \"object\";\n const ns = schema.NormalizedSchema.of(schema$1);\n if (ns.isListSchema() && Array.isArray(value)) {\n const listMember = ns.getValueSchema();\n const out = [];\n const sparse = !!ns.getMergedTraits().sparse;\n for (const item of value) {\n if (sparse || item != null) {\n out.push(this._write(listMember, item));\n }\n }\n return out;\n }\n else if (ns.isMapSchema() && isObject) {\n const mapMember = ns.getValueSchema();\n const out = {};\n const sparse = !!ns.getMergedTraits().sparse;\n for (const [_k, _v] of Object.entries(value)) {\n if (sparse || _v != null) {\n out[_k] = this._write(mapMember, _v);\n }\n }\n return out;\n }\n else if (ns.isStructSchema() && isObject) {\n const out = {};\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;\n const serializableValue = this._write(memberSchema, value[memberName], ns);\n if (serializableValue !== undefined) {\n out[targetKey] = serializableValue;\n }\n }\n return out;\n }\n if (value === null && container?.isStructSchema()) {\n return void 0;\n }\n if ((ns.isBlobSchema() && (value instanceof Uint8Array || typeof value === \"string\")) ||\n (ns.isDocumentSchema() && value instanceof Uint8Array)) {\n if (ns === this.rootSchema) {\n return value;\n }\n return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);\n }\n if ((ns.isTimestampSchema() || ns.isDocumentSchema()) && value instanceof Date) {\n const format = protocols.determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n return value.toISOString().replace(\".000Z\", \"Z\");\n case 6:\n return serde.dateToUtcString(value);\n case 7:\n return value.getTime() / 1000;\n default:\n console.warn(\"Missing timestamp format, using epoch seconds\", value);\n return value.getTime() / 1000;\n }\n }\n if (ns.isNumericSchema() && typeof value === \"number\") {\n if (Math.abs(value) === Infinity || isNaN(value)) {\n return String(value);\n }\n }\n if (ns.isStringSchema()) {\n if (typeof value === \"undefined\" && ns.isIdempotencyToken()) {\n return serde.generateIdempotencyToken();\n }\n const mediaType = ns.getMergedTraits().mediaType;\n if (value != null && mediaType) {\n const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n if (isJson) {\n return serde.LazyJsonString.from(value);\n }\n }\n }\n if (ns.isDocumentSchema()) {\n if (isObject) {\n const out = Array.isArray(value) ? [] : {};\n for (const [k, v] of Object.entries(value)) {\n if (v instanceof serde.NumericValue) {\n out[k] = v;\n }\n else {\n out[k] = this._write(ns, v);\n }\n }\n return out;\n }\n else {\n return structuredClone(value);\n }\n }\n return value;\n }\n}\n\nclass JsonCodec extends SerdeContextConfig {\n settings;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n createSerializer() {\n const serializer = new JsonShapeSerializer(this.settings);\n serializer.setSerdeContext(this.serdeContext);\n return serializer;\n }\n createDeserializer() {\n const deserializer = new JsonShapeDeserializer(this.settings);\n deserializer.setSerdeContext(this.serdeContext);\n return deserializer;\n }\n}\n\nclass AwsJsonRpcProtocol extends protocols.RpcProtocol {\n serializer;\n deserializer;\n serviceTarget;\n codec;\n mixin;\n awsQueryCompatible;\n constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) {\n super({\n defaultNamespace,\n });\n this.serviceTarget = serviceTarget;\n this.codec = new JsonCodec({\n timestampFormat: {\n useTrait: true,\n default: 7,\n },\n jsonName: false,\n });\n this.serializer = this.codec.createSerializer();\n this.deserializer = this.codec.createDeserializer();\n this.awsQueryCompatible = !!awsQueryCompatible;\n this.mixin = new ProtocolLib(this.awsQueryCompatible);\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n if (!request.path.endsWith(\"/\")) {\n request.path += \"/\";\n }\n Object.assign(request.headers, {\n \"content-type\": `application/x-amz-json-${this.getJsonRpcVersion()}`,\n \"x-amz-target\": `${this.serviceTarget}.${operationSchema.name}`,\n });\n if (this.awsQueryCompatible) {\n request.headers[\"x-amzn-query-mode\"] = \"true\";\n }\n if (schema.deref(operationSchema.input) === \"unit\" || !request.body) {\n request.body = \"{}\";\n }\n return request;\n }\n getPayloadCodec() {\n return this.codec;\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n if (this.awsQueryCompatible) {\n this.mixin.setQueryCompatError(dataObject, response);\n }\n const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? \"Unknown\";\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);\n const ns = schema.NormalizedSchema.of(errorSchema);\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n const target = member.getMergedTraits().jsonName ?? name;\n output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]);\n }\n if (this.awsQueryCompatible) {\n this.mixin.queryCompatOutput(dataObject, output);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n}\n\nclass AwsJson1_0Protocol extends AwsJsonRpcProtocol {\n constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) {\n super({\n defaultNamespace,\n serviceTarget,\n awsQueryCompatible,\n });\n }\n getShapeId() {\n return \"aws.protocols#awsJson1_0\";\n }\n getJsonRpcVersion() {\n return \"1.0\";\n }\n getDefaultContentType() {\n return \"application/x-amz-json-1.0\";\n }\n}\n\nclass AwsJson1_1Protocol extends AwsJsonRpcProtocol {\n constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) {\n super({\n defaultNamespace,\n serviceTarget,\n awsQueryCompatible,\n });\n }\n getShapeId() {\n return \"aws.protocols#awsJson1_1\";\n }\n getJsonRpcVersion() {\n return \"1.1\";\n }\n getDefaultContentType() {\n return \"application/x-amz-json-1.1\";\n }\n}\n\nclass AwsRestJsonProtocol extends protocols.HttpBindingProtocol {\n serializer;\n deserializer;\n codec;\n mixin = new ProtocolLib();\n constructor({ defaultNamespace }) {\n super({\n defaultNamespace,\n });\n const settings = {\n timestampFormat: {\n useTrait: true,\n default: 7,\n },\n httpBindings: true,\n jsonName: true,\n };\n this.codec = new JsonCodec(settings);\n this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);\n this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);\n }\n getShapeId() {\n return \"aws.protocols#restJson1\";\n }\n getPayloadCodec() {\n return this.codec;\n }\n setSerdeContext(serdeContext) {\n this.codec.setSerdeContext(serdeContext);\n super.setSerdeContext(serdeContext);\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n const inputSchema = schema.NormalizedSchema.of(operationSchema.input);\n if (!request.headers[\"content-type\"]) {\n const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);\n if (contentType) {\n request.headers[\"content-type\"] = contentType;\n }\n }\n if (request.body == null && request.headers[\"content-type\"] === this.getDefaultContentType()) {\n request.body = \"{}\";\n }\n return request;\n }\n async deserializeResponse(operationSchema, context, response) {\n const output = await super.deserializeResponse(operationSchema, context, response);\n const outputSchema = schema.NormalizedSchema.of(operationSchema.output);\n for (const [name, member] of outputSchema.structIterator()) {\n if (member.getMemberTraits().httpPayload && !(name in output)) {\n output[name] = null;\n }\n }\n return output;\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? \"Unknown\";\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);\n const ns = schema.NormalizedSchema.of(errorSchema);\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n await this.deserializeHttpMessage(errorSchema, context, response, dataObject);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n const target = member.getMergedTraits().jsonName ?? name;\n output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n getDefaultContentType() {\n return \"application/json\";\n }\n}\n\nconst awsExpectUnion = (value) => {\n if (value == null) {\n return undefined;\n }\n if (typeof value === \"object\" && \"__type\" in value) {\n delete value.__type;\n }\n return smithyClient.expectUnion(value);\n};\n\nclass XmlShapeDeserializer extends SerdeContextConfig {\n settings;\n stringDeserializer;\n constructor(settings) {\n super();\n this.settings = settings;\n this.stringDeserializer = new protocols.FromStringShapeDeserializer(settings);\n }\n setSerdeContext(serdeContext) {\n this.serdeContext = serdeContext;\n this.stringDeserializer.setSerdeContext(serdeContext);\n }\n read(schema$1, bytes, key) {\n const ns = schema.NormalizedSchema.of(schema$1);\n const memberSchemas = ns.getMemberSchemas();\n const isEventPayload = ns.isStructSchema() &&\n ns.isMemberSchema() &&\n !!Object.values(memberSchemas).find((memberNs) => {\n return !!memberNs.getMemberTraits().eventPayload;\n });\n if (isEventPayload) {\n const output = {};\n const memberName = Object.keys(memberSchemas)[0];\n const eventMemberSchema = memberSchemas[memberName];\n if (eventMemberSchema.isBlobSchema()) {\n output[memberName] = bytes;\n }\n else {\n output[memberName] = this.read(memberSchemas[memberName], bytes);\n }\n return output;\n }\n const xmlString = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(bytes);\n const parsedObject = this.parseXml(xmlString);\n return this.readSchema(schema$1, key ? parsedObject[key] : parsedObject);\n }\n readSchema(_schema, value) {\n const ns = schema.NormalizedSchema.of(_schema);\n if (ns.isUnitSchema()) {\n return;\n }\n const traits = ns.getMergedTraits();\n if (ns.isListSchema() && !Array.isArray(value)) {\n return this.readSchema(ns, [value]);\n }\n if (value == null) {\n return value;\n }\n if (typeof value === \"object\") {\n const sparse = !!traits.sparse;\n const flat = !!traits.xmlFlattened;\n if (ns.isListSchema()) {\n const listValue = ns.getValueSchema();\n const buffer = [];\n const sourceKey = listValue.getMergedTraits().xmlName ?? \"member\";\n const source = flat ? value : (value[0] ?? value)[sourceKey];\n const sourceArray = Array.isArray(source) ? source : [source];\n for (const v of sourceArray) {\n if (v != null || sparse) {\n buffer.push(this.readSchema(listValue, v));\n }\n }\n return buffer;\n }\n const buffer = {};\n if (ns.isMapSchema()) {\n const keyNs = ns.getKeySchema();\n const memberNs = ns.getValueSchema();\n let entries;\n if (flat) {\n entries = Array.isArray(value) ? value : [value];\n }\n else {\n entries = Array.isArray(value.entry) ? value.entry : [value.entry];\n }\n const keyProperty = keyNs.getMergedTraits().xmlName ?? \"key\";\n const valueProperty = memberNs.getMergedTraits().xmlName ?? \"value\";\n for (const entry of entries) {\n const key = entry[keyProperty];\n const value = entry[valueProperty];\n if (value != null || sparse) {\n buffer[key] = this.readSchema(memberNs, value);\n }\n }\n return buffer;\n }\n if (ns.isStructSchema()) {\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const memberTraits = memberSchema.getMergedTraits();\n const xmlObjectKey = !memberTraits.httpPayload\n ? memberSchema.getMemberTraits().xmlName ?? memberName\n : memberTraits.xmlName ?? memberSchema.getName();\n if (value[xmlObjectKey] != null) {\n buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]);\n }\n }\n return buffer;\n }\n if (ns.isDocumentSchema()) {\n return value;\n }\n throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`);\n }\n if (ns.isListSchema()) {\n return [];\n }\n if (ns.isMapSchema() || ns.isStructSchema()) {\n return {};\n }\n return this.stringDeserializer.read(ns, value);\n }\n parseXml(xml) {\n if (xml.length) {\n let parsedObj;\n try {\n parsedObj = xmlBuilder.parseXML(xml);\n }\n catch (e) {\n if (e && typeof e === \"object\") {\n Object.defineProperty(e, \"$responseBodyText\", {\n value: xml,\n });\n }\n throw e;\n }\n const textNodeName = \"#text\";\n const key = Object.keys(parsedObj)[0];\n const parsedObjToReturn = parsedObj[key];\n if (parsedObjToReturn[textNodeName]) {\n parsedObjToReturn[key] = parsedObjToReturn[textNodeName];\n delete parsedObjToReturn[textNodeName];\n }\n return smithyClient.getValueFromTextNode(parsedObjToReturn);\n }\n return {};\n }\n}\n\nclass QueryShapeSerializer extends SerdeContextConfig {\n settings;\n buffer;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n write(schema$1, value, prefix = \"\") {\n if (this.buffer === undefined) {\n this.buffer = \"\";\n }\n const ns = schema.NormalizedSchema.of(schema$1);\n if (prefix && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (ns.isBlobSchema()) {\n if (typeof value === \"string\" || value instanceof Uint8Array) {\n this.writeKey(prefix);\n this.writeValue((this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value));\n }\n }\n else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) {\n if (value != null) {\n this.writeKey(prefix);\n this.writeValue(String(value));\n }\n else if (ns.isIdempotencyToken()) {\n this.writeKey(prefix);\n this.writeValue(serde.generateIdempotencyToken());\n }\n }\n else if (ns.isBigIntegerSchema()) {\n if (value != null) {\n this.writeKey(prefix);\n this.writeValue(String(value));\n }\n }\n else if (ns.isBigDecimalSchema()) {\n if (value != null) {\n this.writeKey(prefix);\n this.writeValue(value instanceof serde.NumericValue ? value.string : String(value));\n }\n }\n else if (ns.isTimestampSchema()) {\n if (value instanceof Date) {\n this.writeKey(prefix);\n const format = protocols.determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n this.writeValue(value.toISOString().replace(\".000Z\", \"Z\"));\n break;\n case 6:\n this.writeValue(smithyClient.dateToUtcString(value));\n break;\n case 7:\n this.writeValue(String(value.getTime() / 1000));\n break;\n }\n }\n }\n else if (ns.isDocumentSchema()) {\n throw new Error(`@aws-sdk/core/protocols - QuerySerializer unsupported document type ${ns.getName(true)}`);\n }\n else if (ns.isListSchema()) {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n if (this.settings.serializeEmptyLists) {\n this.writeKey(prefix);\n this.writeValue(\"\");\n }\n }\n else {\n const member = ns.getValueSchema();\n const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened;\n let i = 1;\n for (const item of value) {\n if (item == null) {\n continue;\n }\n const suffix = this.getKey(\"member\", member.getMergedTraits().xmlName);\n const key = flat ? `${prefix}${i}` : `${prefix}${suffix}.${i}`;\n this.write(member, item, key);\n ++i;\n }\n }\n }\n }\n else if (ns.isMapSchema()) {\n if (value && typeof value === \"object\") {\n const keySchema = ns.getKeySchema();\n const memberSchema = ns.getValueSchema();\n const flat = ns.getMergedTraits().xmlFlattened;\n let i = 1;\n for (const [k, v] of Object.entries(value)) {\n if (v == null) {\n continue;\n }\n const keySuffix = this.getKey(\"key\", keySchema.getMergedTraits().xmlName);\n const key = flat ? `${prefix}${i}.${keySuffix}` : `${prefix}entry.${i}.${keySuffix}`;\n const valueSuffix = this.getKey(\"value\", memberSchema.getMergedTraits().xmlName);\n const valueKey = flat ? `${prefix}${i}.${valueSuffix}` : `${prefix}entry.${i}.${valueSuffix}`;\n this.write(keySchema, k, key);\n this.write(memberSchema, v, valueKey);\n ++i;\n }\n }\n }\n else if (ns.isStructSchema()) {\n if (value && typeof value === \"object\") {\n for (const [memberName, member] of ns.structIterator()) {\n if (value[memberName] == null && !member.isIdempotencyToken()) {\n continue;\n }\n const suffix = this.getKey(memberName, member.getMergedTraits().xmlName);\n const key = `${prefix}${suffix}`;\n this.write(member, value[memberName], key);\n }\n }\n }\n else if (ns.isUnitSchema()) ;\n else {\n throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`);\n }\n }\n flush() {\n if (this.buffer === undefined) {\n throw new Error(\"@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.\");\n }\n const str = this.buffer;\n delete this.buffer;\n return str;\n }\n getKey(memberName, xmlName) {\n const key = xmlName ?? memberName;\n if (this.settings.capitalizeKeys) {\n return key[0].toUpperCase() + key.slice(1);\n }\n return key;\n }\n writeKey(key) {\n if (key.endsWith(\".\")) {\n key = key.slice(0, key.length - 1);\n }\n this.buffer += `&${protocols.extendedEncodeURIComponent(key)}=`;\n }\n writeValue(value) {\n this.buffer += protocols.extendedEncodeURIComponent(value);\n }\n}\n\nclass AwsQueryProtocol extends protocols.RpcProtocol {\n options;\n serializer;\n deserializer;\n mixin = new ProtocolLib();\n constructor(options) {\n super({\n defaultNamespace: options.defaultNamespace,\n });\n this.options = options;\n const settings = {\n timestampFormat: {\n useTrait: true,\n default: 5,\n },\n httpBindings: false,\n xmlNamespace: options.xmlNamespace,\n serviceNamespace: options.defaultNamespace,\n serializeEmptyLists: true,\n };\n this.serializer = new QueryShapeSerializer(settings);\n this.deserializer = new XmlShapeDeserializer(settings);\n }\n getShapeId() {\n return \"aws.protocols#awsQuery\";\n }\n setSerdeContext(serdeContext) {\n this.serializer.setSerdeContext(serdeContext);\n this.deserializer.setSerdeContext(serdeContext);\n }\n getPayloadCodec() {\n throw new Error(\"AWSQuery protocol has no payload codec.\");\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n if (!request.path.endsWith(\"/\")) {\n request.path += \"/\";\n }\n Object.assign(request.headers, {\n \"content-type\": `application/x-www-form-urlencoded`,\n });\n if (schema.deref(operationSchema.input) === \"unit\" || !request.body) {\n request.body = \"\";\n }\n const action = operationSchema.name.split(\"#\")[1] ?? operationSchema.name;\n request.body = `Action=${action}&Version=${this.options.version}` + request.body;\n if (request.body.endsWith(\"&\")) {\n request.body = request.body.slice(-1);\n }\n return request;\n }\n async deserializeResponse(operationSchema, context, response) {\n const deserializer = this.deserializer;\n const ns = schema.NormalizedSchema.of(operationSchema.output);\n const dataObject = {};\n if (response.statusCode >= 300) {\n const bytes = await protocols.collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n Object.assign(dataObject, await deserializer.read(15, bytes));\n }\n await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));\n }\n for (const header in response.headers) {\n const value = response.headers[header];\n delete response.headers[header];\n response.headers[header.toLowerCase()] = value;\n }\n const shortName = operationSchema.name.split(\"#\")[1] ?? operationSchema.name;\n const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + \"Result\" : undefined;\n const bytes = await protocols.collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));\n }\n const output = {\n $metadata: this.deserializeMetadata(response),\n ...dataObject,\n };\n return output;\n }\n useNestedResult() {\n return true;\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? \"Unknown\";\n const errorData = this.loadQueryError(dataObject);\n const message = this.loadQueryErrorMessage(dataObject);\n errorData.message = message;\n errorData.Error = {\n Type: errorData.Type,\n Code: errorData.Code,\n Message: message,\n };\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, (registry, errorName) => {\n try {\n return registry.getSchema(errorName);\n }\n catch (e) {\n return registry.find((schema$1) => schema.NormalizedSchema.of(schema$1).getMergedTraits().awsQueryError?.[0] === errorName);\n }\n });\n const ns = schema.NormalizedSchema.of(errorSchema);\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n const output = {\n Error: errorData.Error,\n };\n for (const [name, member] of ns.structIterator()) {\n const target = member.getMergedTraits().xmlName ?? name;\n const value = errorData[target] ?? dataObject[target];\n output[name] = this.deserializer.readSchema(member, value);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n loadQueryErrorCode(output, data) {\n const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code;\n if (code !== undefined) {\n return code;\n }\n if (output.statusCode == 404) {\n return \"NotFound\";\n }\n }\n loadQueryError(data) {\n return data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error;\n }\n loadQueryErrorMessage(data) {\n const errorData = this.loadQueryError(data);\n return errorData?.message ?? errorData?.Message ?? data.message ?? data.Message ?? \"Unknown\";\n }\n getDefaultContentType() {\n return \"application/x-www-form-urlencoded\";\n }\n}\n\nclass AwsEc2QueryProtocol extends AwsQueryProtocol {\n options;\n constructor(options) {\n super(options);\n this.options = options;\n const ec2Settings = {\n capitalizeKeys: true,\n flattenLists: true,\n serializeEmptyLists: false,\n };\n Object.assign(this.serializer.settings, ec2Settings);\n }\n useNestedResult() {\n return false;\n }\n}\n\nconst parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {\n if (encoded.length) {\n let parsedObj;\n try {\n parsedObj = xmlBuilder.parseXML(encoded);\n }\n catch (e) {\n if (e && typeof e === \"object\") {\n Object.defineProperty(e, \"$responseBodyText\", {\n value: encoded,\n });\n }\n throw e;\n }\n const textNodeName = \"#text\";\n const key = Object.keys(parsedObj)[0];\n const parsedObjToReturn = parsedObj[key];\n if (parsedObjToReturn[textNodeName]) {\n parsedObjToReturn[key] = parsedObjToReturn[textNodeName];\n delete parsedObjToReturn[textNodeName];\n }\n return smithyClient.getValueFromTextNode(parsedObjToReturn);\n }\n return {};\n});\nconst parseXmlErrorBody = async (errorBody, context) => {\n const value = await parseXmlBody(errorBody, context);\n if (value.Error) {\n value.Error.message = value.Error.message ?? value.Error.Message;\n }\n return value;\n};\nconst loadRestXmlErrorCode = (output, data) => {\n if (data?.Error?.Code !== undefined) {\n return data.Error.Code;\n }\n if (data?.Code !== undefined) {\n return data.Code;\n }\n if (output.statusCode == 404) {\n return \"NotFound\";\n }\n};\n\nclass XmlShapeSerializer extends SerdeContextConfig {\n settings;\n stringBuffer;\n byteBuffer;\n buffer;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n write(schema$1, value) {\n const ns = schema.NormalizedSchema.of(schema$1);\n if (ns.isStringSchema() && typeof value === \"string\") {\n this.stringBuffer = value;\n }\n else if (ns.isBlobSchema()) {\n this.byteBuffer =\n \"byteLength\" in value\n ? value\n : (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value);\n }\n else {\n this.buffer = this.writeStruct(ns, value, undefined);\n const traits = ns.getMergedTraits();\n if (traits.httpPayload && !traits.xmlName) {\n this.buffer.withName(ns.getName());\n }\n }\n }\n flush() {\n if (this.byteBuffer !== undefined) {\n const bytes = this.byteBuffer;\n delete this.byteBuffer;\n return bytes;\n }\n if (this.stringBuffer !== undefined) {\n const str = this.stringBuffer;\n delete this.stringBuffer;\n return str;\n }\n const buffer = this.buffer;\n if (this.settings.xmlNamespace) {\n if (!buffer?.attributes?.[\"xmlns\"]) {\n buffer.addAttribute(\"xmlns\", this.settings.xmlNamespace);\n }\n }\n delete this.buffer;\n return buffer.toString();\n }\n writeStruct(ns, value, parentXmlns) {\n const traits = ns.getMergedTraits();\n const name = ns.isMemberSchema() && !traits.httpPayload\n ? ns.getMemberTraits().xmlName ?? ns.getMemberName()\n : traits.xmlName ?? ns.getName();\n if (!name || !ns.isStructSchema()) {\n throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`);\n }\n const structXmlNode = xmlBuilder.XmlNode.of(name);\n const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const val = value[memberName];\n if (val != null || memberSchema.isIdempotencyToken()) {\n if (memberSchema.getMergedTraits().xmlAttribute) {\n structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val));\n continue;\n }\n if (memberSchema.isListSchema()) {\n this.writeList(memberSchema, val, structXmlNode, xmlns);\n }\n else if (memberSchema.isMapSchema()) {\n this.writeMap(memberSchema, val, structXmlNode, xmlns);\n }\n else if (memberSchema.isStructSchema()) {\n structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns));\n }\n else {\n const memberNode = xmlBuilder.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName());\n this.writeSimpleInto(memberSchema, val, memberNode, xmlns);\n structXmlNode.addChildNode(memberNode);\n }\n }\n }\n if (xmlns) {\n structXmlNode.addAttribute(xmlnsAttr, xmlns);\n }\n return structXmlNode;\n }\n writeList(listMember, array, container, parentXmlns) {\n if (!listMember.isMemberSchema()) {\n throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`);\n }\n const listTraits = listMember.getMergedTraits();\n const listValueSchema = listMember.getValueSchema();\n const listValueTraits = listValueSchema.getMergedTraits();\n const sparse = !!listValueTraits.sparse;\n const flat = !!listTraits.xmlFlattened;\n const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns);\n const writeItem = (container, value) => {\n if (listValueSchema.isListSchema()) {\n this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container, xmlns);\n }\n else if (listValueSchema.isMapSchema()) {\n this.writeMap(listValueSchema, value, container, xmlns);\n }\n else if (listValueSchema.isStructSchema()) {\n const struct = this.writeStruct(listValueSchema, value, xmlns);\n container.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? \"member\"));\n }\n else {\n const listItemNode = xmlBuilder.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? \"member\");\n this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns);\n container.addChildNode(listItemNode);\n }\n };\n if (flat) {\n for (const value of array) {\n if (sparse || value != null) {\n writeItem(container, value);\n }\n }\n }\n else {\n const listNode = xmlBuilder.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName());\n if (xmlns) {\n listNode.addAttribute(xmlnsAttr, xmlns);\n }\n for (const value of array) {\n if (sparse || value != null) {\n writeItem(listNode, value);\n }\n }\n container.addChildNode(listNode);\n }\n }\n writeMap(mapMember, map, container, parentXmlns, containerIsMap = false) {\n if (!mapMember.isMemberSchema()) {\n throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`);\n }\n const mapTraits = mapMember.getMergedTraits();\n const mapKeySchema = mapMember.getKeySchema();\n const mapKeyTraits = mapKeySchema.getMergedTraits();\n const keyTag = mapKeyTraits.xmlName ?? \"key\";\n const mapValueSchema = mapMember.getValueSchema();\n const mapValueTraits = mapValueSchema.getMergedTraits();\n const valueTag = mapValueTraits.xmlName ?? \"value\";\n const sparse = !!mapValueTraits.sparse;\n const flat = !!mapTraits.xmlFlattened;\n const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns);\n const addKeyValue = (entry, key, val) => {\n const keyNode = xmlBuilder.XmlNode.of(keyTag, key);\n const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns);\n if (keyXmlns) {\n keyNode.addAttribute(keyXmlnsAttr, keyXmlns);\n }\n entry.addChildNode(keyNode);\n let valueNode = xmlBuilder.XmlNode.of(valueTag);\n if (mapValueSchema.isListSchema()) {\n this.writeList(mapValueSchema, val, valueNode, xmlns);\n }\n else if (mapValueSchema.isMapSchema()) {\n this.writeMap(mapValueSchema, val, valueNode, xmlns, true);\n }\n else if (mapValueSchema.isStructSchema()) {\n valueNode = this.writeStruct(mapValueSchema, val, xmlns);\n }\n else {\n this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns);\n }\n entry.addChildNode(valueNode);\n };\n if (flat) {\n for (const [key, val] of Object.entries(map)) {\n if (sparse || val != null) {\n const entry = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());\n addKeyValue(entry, key, val);\n container.addChildNode(entry);\n }\n }\n }\n else {\n let mapNode;\n if (!containerIsMap) {\n mapNode = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());\n if (xmlns) {\n mapNode.addAttribute(xmlnsAttr, xmlns);\n }\n container.addChildNode(mapNode);\n }\n for (const [key, val] of Object.entries(map)) {\n if (sparse || val != null) {\n const entry = xmlBuilder.XmlNode.of(\"entry\");\n addKeyValue(entry, key, val);\n (containerIsMap ? container : mapNode).addChildNode(entry);\n }\n }\n }\n }\n writeSimple(_schema, value) {\n if (null === value) {\n throw new Error(\"@aws-sdk/core/protocols - (XML serializer) cannot write null value.\");\n }\n const ns = schema.NormalizedSchema.of(_schema);\n let nodeContents = null;\n if (value && typeof value === \"object\") {\n if (ns.isBlobSchema()) {\n nodeContents = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);\n }\n else if (ns.isTimestampSchema() && value instanceof Date) {\n const format = protocols.determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n nodeContents = value.toISOString().replace(\".000Z\", \"Z\");\n break;\n case 6:\n nodeContents = smithyClient.dateToUtcString(value);\n break;\n case 7:\n nodeContents = String(value.getTime() / 1000);\n break;\n default:\n console.warn(\"Missing timestamp format, using http date\", value);\n nodeContents = smithyClient.dateToUtcString(value);\n break;\n }\n }\n else if (ns.isBigDecimalSchema() && value) {\n if (value instanceof serde.NumericValue) {\n return value.string;\n }\n return String(value);\n }\n else if (ns.isMapSchema() || ns.isListSchema()) {\n throw new Error(\"@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.\");\n }\n else {\n throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`);\n }\n }\n if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {\n nodeContents = String(value);\n }\n if (ns.isStringSchema()) {\n if (value === undefined && ns.isIdempotencyToken()) {\n nodeContents = serde.generateIdempotencyToken();\n }\n else {\n nodeContents = String(value);\n }\n }\n if (nodeContents === null) {\n throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`);\n }\n return nodeContents;\n }\n writeSimpleInto(_schema, value, into, parentXmlns) {\n const nodeContents = this.writeSimple(_schema, value);\n const ns = schema.NormalizedSchema.of(_schema);\n const content = new xmlBuilder.XmlText(nodeContents);\n const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);\n if (xmlns) {\n into.addAttribute(xmlnsAttr, xmlns);\n }\n into.addChildNode(content);\n }\n getXmlnsAttribute(ns, parentXmlns) {\n const traits = ns.getMergedTraits();\n const [prefix, xmlns] = traits.xmlNamespace ?? [];\n if (xmlns && xmlns !== parentXmlns) {\n return [prefix ? `xmlns:${prefix}` : \"xmlns\", xmlns];\n }\n return [void 0, void 0];\n }\n}\n\nclass XmlCodec extends SerdeContextConfig {\n settings;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n createSerializer() {\n const serializer = new XmlShapeSerializer(this.settings);\n serializer.setSerdeContext(this.serdeContext);\n return serializer;\n }\n createDeserializer() {\n const deserializer = new XmlShapeDeserializer(this.settings);\n deserializer.setSerdeContext(this.serdeContext);\n return deserializer;\n }\n}\n\nclass AwsRestXmlProtocol extends protocols.HttpBindingProtocol {\n codec;\n serializer;\n deserializer;\n mixin = new ProtocolLib();\n constructor(options) {\n super(options);\n const settings = {\n timestampFormat: {\n useTrait: true,\n default: 5,\n },\n httpBindings: true,\n xmlNamespace: options.xmlNamespace,\n serviceNamespace: options.defaultNamespace,\n };\n this.codec = new XmlCodec(settings);\n this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);\n this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);\n }\n getPayloadCodec() {\n return this.codec;\n }\n getShapeId() {\n return \"aws.protocols#restXml\";\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n const inputSchema = schema.NormalizedSchema.of(operationSchema.input);\n if (!request.headers[\"content-type\"]) {\n const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);\n if (contentType) {\n request.headers[\"content-type\"] = contentType;\n }\n }\n if (request.headers[\"content-type\"] === this.getDefaultContentType()) {\n if (typeof request.body === \"string\") {\n request.body = '' + request.body;\n }\n }\n return request;\n }\n async deserializeResponse(operationSchema, context, response) {\n return super.deserializeResponse(operationSchema, context, response);\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? \"Unknown\";\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);\n const ns = schema.NormalizedSchema.of(errorSchema);\n const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n await this.deserializeHttpMessage(errorSchema, context, response, dataObject);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n const target = member.getMergedTraits().xmlName ?? name;\n const value = dataObject.Error?.[target] ?? dataObject[target];\n output[name] = this.codec.createDeserializer().readSchema(member, value);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n getDefaultContentType() {\n return \"application/xml\";\n }\n}\n\nexports.AWSSDKSigV4Signer = AWSSDKSigV4Signer;\nexports.AwsEc2QueryProtocol = AwsEc2QueryProtocol;\nexports.AwsJson1_0Protocol = AwsJson1_0Protocol;\nexports.AwsJson1_1Protocol = AwsJson1_1Protocol;\nexports.AwsJsonRpcProtocol = AwsJsonRpcProtocol;\nexports.AwsQueryProtocol = AwsQueryProtocol;\nexports.AwsRestJsonProtocol = AwsRestJsonProtocol;\nexports.AwsRestXmlProtocol = AwsRestXmlProtocol;\nexports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner;\nexports.AwsSdkSigV4Signer = AwsSdkSigV4Signer;\nexports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol;\nexports.JsonCodec = JsonCodec;\nexports.JsonShapeDeserializer = JsonShapeDeserializer;\nexports.JsonShapeSerializer = JsonShapeSerializer;\nexports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS;\nexports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS;\nexports.XmlCodec = XmlCodec;\nexports.XmlShapeDeserializer = XmlShapeDeserializer;\nexports.XmlShapeSerializer = XmlShapeSerializer;\nexports._toBool = _toBool;\nexports._toNum = _toNum;\nexports._toStr = _toStr;\nexports.awsExpectUnion = awsExpectUnion;\nexports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion;\nexports.getBearerTokenEnvKey = getBearerTokenEnvKey;\nexports.loadRestJsonErrorCode = loadRestJsonErrorCode;\nexports.loadRestXmlErrorCode = loadRestXmlErrorCode;\nexports.parseJsonBody = parseJsonBody;\nexports.parseJsonErrorBody = parseJsonErrorBody;\nexports.parseXmlBody = parseXmlBody;\nexports.parseXmlErrorBody = parseXmlErrorBody;\nexports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config;\nexports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig;\nexports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config;\nexports.setCredentialFeature = setCredentialFeature;\nexports.setFeature = setFeature;\nexports.setTokenFeature = setTokenFeature;\nexports.state = state;\nexports.validateSigningProperties = validateSigningProperties;\n", - "'use strict';\n\nvar core = require('@smithy/core');\nvar utilEndpoints = require('@aws-sdk/util-endpoints');\nvar protocolHttp = require('@smithy/protocol-http');\nvar core$1 = require('@aws-sdk/core');\n\nconst DEFAULT_UA_APP_ID = undefined;\nfunction isValidUserAgentAppId(appId) {\n if (appId === undefined) {\n return true;\n }\n return typeof appId === \"string\" && appId.length <= 50;\n}\nfunction resolveUserAgentConfig(input) {\n const normalizedAppIdProvider = core.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID);\n const { customUserAgent } = input;\n return Object.assign(input, {\n customUserAgent: typeof customUserAgent === \"string\" ? [[customUserAgent]] : customUserAgent,\n userAgentAppId: async () => {\n const appId = await normalizedAppIdProvider();\n if (!isValidUserAgentAppId(appId)) {\n const logger = input.logger?.constructor?.name === \"NoOpLogger\" || !input.logger ? console : input.logger;\n if (typeof appId !== \"string\") {\n logger?.warn(\"userAgentAppId must be a string or undefined.\");\n }\n else if (appId.length > 50) {\n logger?.warn(\"The provided userAgentAppId exceeds the maximum length of 50 characters.\");\n }\n }\n return appId;\n },\n });\n}\n\nconst ACCOUNT_ID_ENDPOINT_REGEX = /\\d{12}\\.ddb/;\nasync function checkFeatures(context, config, args) {\n const request = args.request;\n if (request?.headers?.[\"smithy-protocol\"] === \"rpc-v2-cbor\") {\n core$1.setFeature(context, \"PROTOCOL_RPC_V2_CBOR\", \"M\");\n }\n if (typeof config.retryStrategy === \"function\") {\n const retryStrategy = await config.retryStrategy();\n if (typeof retryStrategy.acquireInitialRetryToken === \"function\") {\n if (retryStrategy.constructor?.name?.includes(\"Adaptive\")) {\n core$1.setFeature(context, \"RETRY_MODE_ADAPTIVE\", \"F\");\n }\n else {\n core$1.setFeature(context, \"RETRY_MODE_STANDARD\", \"E\");\n }\n }\n else {\n core$1.setFeature(context, \"RETRY_MODE_LEGACY\", \"D\");\n }\n }\n if (typeof config.accountIdEndpointMode === \"function\") {\n const endpointV2 = context.endpointV2;\n if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {\n core$1.setFeature(context, \"ACCOUNT_ID_ENDPOINT\", \"O\");\n }\n switch (await config.accountIdEndpointMode?.()) {\n case \"disabled\":\n core$1.setFeature(context, \"ACCOUNT_ID_MODE_DISABLED\", \"Q\");\n break;\n case \"preferred\":\n core$1.setFeature(context, \"ACCOUNT_ID_MODE_PREFERRED\", \"P\");\n break;\n case \"required\":\n core$1.setFeature(context, \"ACCOUNT_ID_MODE_REQUIRED\", \"R\");\n break;\n }\n }\n const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity;\n if (identity?.$source) {\n const credentials = identity;\n if (credentials.accountId) {\n core$1.setFeature(context, \"RESOLVED_ACCOUNT_ID\", \"T\");\n }\n for (const [key, value] of Object.entries(credentials.$source ?? {})) {\n core$1.setFeature(context, key, value);\n }\n }\n}\n\nconst USER_AGENT = \"user-agent\";\nconst X_AMZ_USER_AGENT = \"x-amz-user-agent\";\nconst SPACE = \" \";\nconst UA_NAME_SEPARATOR = \"/\";\nconst UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\\-.^_`|~\\w]/g;\nconst UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\\-.^_`|~\\w#]/g;\nconst UA_ESCAPE_CHAR = \"-\";\n\nconst BYTE_LIMIT = 1024;\nfunction encodeFeatures(features) {\n let buffer = \"\";\n for (const key in features) {\n const val = features[key];\n if (buffer.length + val.length + 1 <= BYTE_LIMIT) {\n if (buffer.length) {\n buffer += \",\" + val;\n }\n else {\n buffer += val;\n }\n continue;\n }\n break;\n }\n return buffer;\n}\n\nconst userAgentMiddleware = (options) => (next, context) => async (args) => {\n const { request } = args;\n if (!protocolHttp.HttpRequest.isInstance(request)) {\n return next(args);\n }\n const { headers } = request;\n const userAgent = context?.userAgent?.map(escapeUserAgent) || [];\n const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);\n await checkFeatures(context, options, args);\n const awsContext = context;\n defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);\n const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];\n const appId = await options.userAgentAppId();\n if (appId) {\n defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`]));\n }\n const prefix = utilEndpoints.getUserAgentPrefix();\n const sdkUserAgentValue = (prefix ? [prefix] : [])\n .concat([...defaultUserAgent, ...userAgent, ...customUserAgent])\n .join(SPACE);\n const normalUAValue = [\n ...defaultUserAgent.filter((section) => section.startsWith(\"aws-sdk-\")),\n ...customUserAgent,\n ].join(SPACE);\n if (options.runtime !== \"browser\") {\n if (normalUAValue) {\n headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT]\n ? `${headers[USER_AGENT]} ${normalUAValue}`\n : normalUAValue;\n }\n headers[USER_AGENT] = sdkUserAgentValue;\n }\n else {\n headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;\n }\n return next({\n ...args,\n request,\n });\n};\nconst escapeUserAgent = (userAgentPair) => {\n const name = userAgentPair[0]\n .split(UA_NAME_SEPARATOR)\n .map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR))\n .join(UA_NAME_SEPARATOR);\n const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);\n const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);\n const prefix = name.substring(0, prefixSeparatorIndex);\n let uaName = name.substring(prefixSeparatorIndex + 1);\n if (prefix === \"api\") {\n uaName = uaName.toLowerCase();\n }\n return [prefix, uaName, version]\n .filter((item) => item && item.length > 0)\n .reduce((acc, item, index) => {\n switch (index) {\n case 0:\n return item;\n case 1:\n return `${acc}/${item}`;\n default:\n return `${acc}#${item}`;\n }\n }, \"\");\n};\nconst getUserAgentMiddlewareOptions = {\n name: \"getUserAgentMiddleware\",\n step: \"build\",\n priority: \"low\",\n tags: [\"SET_USER_AGENT\", \"USER_AGENT\"],\n override: true,\n};\nconst getUserAgentPlugin = (config) => ({\n applyToStack: (clientStack) => {\n clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);\n },\n});\n\nexports.DEFAULT_UA_APP_ID = DEFAULT_UA_APP_ID;\nexports.getUserAgentMiddlewareOptions = getUserAgentMiddlewareOptions;\nexports.getUserAgentPlugin = getUserAgentPlugin;\nexports.resolveUserAgentConfig = resolveUserAgentConfig;\nexports.userAgentMiddleware = userAgentMiddleware;\n", - "'use strict';\n\nconst booleanSelector = (obj, key, type) => {\n if (!(key in obj))\n return undefined;\n if (obj[key] === \"true\")\n return true;\n if (obj[key] === \"false\")\n return false;\n throw new Error(`Cannot load ${type} \"${key}\". Expected \"true\" or \"false\", got ${obj[key]}.`);\n};\n\nconst numberSelector = (obj, key, type) => {\n if (!(key in obj))\n return undefined;\n const numberValue = parseInt(obj[key], 10);\n if (Number.isNaN(numberValue)) {\n throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`);\n }\n return numberValue;\n};\n\nexports.SelectorType = void 0;\n(function (SelectorType) {\n SelectorType[\"ENV\"] = \"env\";\n SelectorType[\"CONFIG\"] = \"shared config entry\";\n})(exports.SelectorType || (exports.SelectorType = {}));\n\nexports.booleanSelector = booleanSelector;\nexports.numberSelector = numberSelector;\n", - "'use strict';\n\nvar utilConfigProvider = require('@smithy/util-config-provider');\nvar utilMiddleware = require('@smithy/util-middleware');\nvar utilEndpoints = require('@smithy/util-endpoints');\n\nconst ENV_USE_DUALSTACK_ENDPOINT = \"AWS_USE_DUALSTACK_ENDPOINT\";\nconst CONFIG_USE_DUALSTACK_ENDPOINT = \"use_dualstack_endpoint\";\nconst DEFAULT_USE_DUALSTACK_ENDPOINT = false;\nconst NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.ENV),\n configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.CONFIG),\n default: false,\n};\n\nconst ENV_USE_FIPS_ENDPOINT = \"AWS_USE_FIPS_ENDPOINT\";\nconst CONFIG_USE_FIPS_ENDPOINT = \"use_fips_endpoint\";\nconst DEFAULT_USE_FIPS_ENDPOINT = false;\nconst NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.ENV),\n configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.CONFIG),\n default: false,\n};\n\nconst resolveCustomEndpointsConfig = (input) => {\n const { tls, endpoint, urlParser, useDualstackEndpoint } = input;\n return Object.assign(input, {\n tls: tls ?? true,\n endpoint: utilMiddleware.normalizeProvider(typeof endpoint === \"string\" ? urlParser(endpoint) : endpoint),\n isCustomEndpoint: true,\n useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false),\n });\n};\n\nconst getEndpointFromRegion = async (input) => {\n const { tls = true } = input;\n const region = await input.region();\n const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);\n if (!dnsHostRegex.test(region)) {\n throw new Error(\"Invalid region in client config\");\n }\n const useDualstackEndpoint = await input.useDualstackEndpoint();\n const useFipsEndpoint = await input.useFipsEndpoint();\n const { hostname } = (await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint })) ?? {};\n if (!hostname) {\n throw new Error(\"Cannot resolve hostname from client config\");\n }\n return input.urlParser(`${tls ? \"https:\" : \"http:\"}//${hostname}`);\n};\n\nconst resolveEndpointsConfig = (input) => {\n const useDualstackEndpoint = utilMiddleware.normalizeProvider(input.useDualstackEndpoint ?? false);\n const { endpoint, useFipsEndpoint, urlParser, tls } = input;\n return Object.assign(input, {\n tls: tls ?? true,\n endpoint: endpoint\n ? utilMiddleware.normalizeProvider(typeof endpoint === \"string\" ? urlParser(endpoint) : endpoint)\n : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }),\n isCustomEndpoint: !!endpoint,\n useDualstackEndpoint,\n });\n};\n\nconst REGION_ENV_NAME = \"AWS_REGION\";\nconst REGION_INI_NAME = \"region\";\nconst NODE_REGION_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => env[REGION_ENV_NAME],\n configFileSelector: (profile) => profile[REGION_INI_NAME],\n default: () => {\n throw new Error(\"Region is missing\");\n },\n};\nconst NODE_REGION_CONFIG_FILE_OPTIONS = {\n preferredFile: \"credentials\",\n};\n\nconst validRegions = new Set();\nconst checkRegion = (region, check = utilEndpoints.isValidHostLabel) => {\n if (!validRegions.has(region) && !check(region)) {\n if (region === \"*\") {\n 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.`);\n }\n else {\n throw new Error(`Region not accepted: region=\"${region}\" is not a valid hostname component.`);\n }\n }\n else {\n validRegions.add(region);\n }\n};\n\nconst isFipsRegion = (region) => typeof region === \"string\" && (region.startsWith(\"fips-\") || region.endsWith(\"-fips\"));\n\nconst getRealRegion = (region) => isFipsRegion(region)\n ? [\"fips-aws-global\", \"aws-fips\"].includes(region)\n ? \"us-east-1\"\n : region.replace(/fips-(dkr-|prod-)?|-fips/, \"\")\n : region;\n\nconst resolveRegionConfig = (input) => {\n const { region, useFipsEndpoint } = input;\n if (!region) {\n throw new Error(\"Region is missing\");\n }\n return Object.assign(input, {\n region: async () => {\n const providedRegion = typeof region === \"function\" ? await region() : region;\n const realRegion = getRealRegion(providedRegion);\n checkRegion(realRegion);\n return realRegion;\n },\n useFipsEndpoint: async () => {\n const providedRegion = typeof region === \"string\" ? region : await region();\n if (isFipsRegion(providedRegion)) {\n return true;\n }\n return typeof useFipsEndpoint !== \"function\" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();\n },\n });\n};\n\nconst getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => variants.find(({ tags }) => useFipsEndpoint === tags.includes(\"fips\") && useDualstackEndpoint === tags.includes(\"dualstack\"))?.hostname;\n\nconst getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname\n ? regionHostname\n : partitionHostname\n ? partitionHostname.replace(\"{region}\", resolvedRegion)\n : undefined;\n\nconst getResolvedPartition = (region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? \"aws\";\n\nconst getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => {\n if (signingRegion) {\n return signingRegion;\n }\n else if (useFipsEndpoint) {\n const regionRegexJs = regionRegex.replace(\"\\\\\\\\\", \"\\\\\").replace(/^\\^/g, \"\\\\.\").replace(/\\$$/g, \"\\\\.\");\n const regionRegexmatchArray = hostname.match(regionRegexJs);\n if (regionRegexmatchArray) {\n return regionRegexmatchArray[0].slice(1, -1);\n }\n }\n};\n\nconst getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => {\n const partition = getResolvedPartition(region, { partitionHash });\n const resolvedRegion = region in regionHash ? region : partitionHash[partition]?.endpoint ?? region;\n const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint };\n const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions);\n const partitionHostname = getHostnameFromVariants(partitionHash[partition]?.variants, hostnameOptions);\n const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname });\n if (hostname === undefined) {\n throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`);\n }\n const signingRegion = getResolvedSigningRegion(hostname, {\n signingRegion: regionHash[resolvedRegion]?.signingRegion,\n regionRegex: partitionHash[partition].regionRegex,\n useFipsEndpoint,\n });\n return {\n partition,\n signingService,\n hostname,\n ...(signingRegion && { signingRegion }),\n ...(regionHash[resolvedRegion]?.signingService && {\n signingService: regionHash[resolvedRegion].signingService,\n }),\n };\n};\n\nexports.CONFIG_USE_DUALSTACK_ENDPOINT = CONFIG_USE_DUALSTACK_ENDPOINT;\nexports.CONFIG_USE_FIPS_ENDPOINT = CONFIG_USE_FIPS_ENDPOINT;\nexports.DEFAULT_USE_DUALSTACK_ENDPOINT = DEFAULT_USE_DUALSTACK_ENDPOINT;\nexports.DEFAULT_USE_FIPS_ENDPOINT = DEFAULT_USE_FIPS_ENDPOINT;\nexports.ENV_USE_DUALSTACK_ENDPOINT = ENV_USE_DUALSTACK_ENDPOINT;\nexports.ENV_USE_FIPS_ENDPOINT = ENV_USE_FIPS_ENDPOINT;\nexports.NODE_REGION_CONFIG_FILE_OPTIONS = NODE_REGION_CONFIG_FILE_OPTIONS;\nexports.NODE_REGION_CONFIG_OPTIONS = NODE_REGION_CONFIG_OPTIONS;\nexports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS;\nexports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS;\nexports.REGION_ENV_NAME = REGION_ENV_NAME;\nexports.REGION_INI_NAME = REGION_INI_NAME;\nexports.getRegionInfo = getRegionInfo;\nexports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig;\nexports.resolveEndpointsConfig = resolveEndpointsConfig;\nexports.resolveRegionConfig = resolveRegionConfig;\n", - "'use strict';\n\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst CONTENT_LENGTH_HEADER = \"content-length\";\nfunction contentLengthMiddleware(bodyLengthChecker) {\n return (next) => async (args) => {\n const request = args.request;\n if (protocolHttp.HttpRequest.isInstance(request)) {\n const { body, headers } = request;\n if (body &&\n Object.keys(headers)\n .map((str) => str.toLowerCase())\n .indexOf(CONTENT_LENGTH_HEADER) === -1) {\n try {\n const length = bodyLengthChecker(body);\n request.headers = {\n ...request.headers,\n [CONTENT_LENGTH_HEADER]: String(length),\n };\n }\n catch (error) {\n }\n }\n }\n return next({\n ...args,\n request,\n });\n };\n}\nconst contentLengthMiddlewareOptions = {\n step: \"build\",\n tags: [\"SET_CONTENT_LENGTH\", \"CONTENT_LENGTH\"],\n name: \"contentLengthMiddleware\",\n override: true,\n};\nconst getContentLengthPlugin = (options) => ({\n applyToStack: (clientStack) => {\n clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);\n },\n});\n\nexports.contentLengthMiddleware = contentLengthMiddleware;\nexports.contentLengthMiddlewareOptions = contentLengthMiddlewareOptions;\nexports.getContentLengthPlugin = getContentLengthPlugin;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getHomeDir = void 0;\nconst os_1 = require(\"os\");\nconst path_1 = require(\"path\");\nconst homeDirCache = {};\nconst getHomeDirCacheKey = () => {\n if (process && process.geteuid) {\n return `${process.geteuid()}`;\n }\n return \"DEFAULT\";\n};\nconst getHomeDir = () => {\n const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env;\n if (HOME)\n return HOME;\n if (USERPROFILE)\n return USERPROFILE;\n if (HOMEPATH)\n return `${HOMEDRIVE}${HOMEPATH}`;\n const homeDirCacheKey = getHomeDirCacheKey();\n if (!homeDirCache[homeDirCacheKey])\n homeDirCache[homeDirCacheKey] = (0, os_1.homedir)();\n return homeDirCache[homeDirCacheKey];\n};\nexports.getHomeDir = getHomeDir;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSSOTokenFilepath = void 0;\nconst crypto_1 = require(\"crypto\");\nconst path_1 = require(\"path\");\nconst getHomeDir_1 = require(\"./getHomeDir\");\nconst getSSOTokenFilepath = (id) => {\n const hasher = (0, crypto_1.createHash)(\"sha1\");\n const cacheName = hasher.update(id).digest(\"hex\");\n return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), \".aws\", \"sso\", \"cache\", `${cacheName}.json`);\n};\nexports.getSSOTokenFilepath = getSSOTokenFilepath;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSSOTokenFromFile = exports.tokenIntercept = void 0;\nconst promises_1 = require(\"fs/promises\");\nconst getSSOTokenFilepath_1 = require(\"./getSSOTokenFilepath\");\nexports.tokenIntercept = {};\nconst getSSOTokenFromFile = async (id) => {\n if (exports.tokenIntercept[id]) {\n return exports.tokenIntercept[id];\n }\n const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id);\n const ssoTokenText = await (0, promises_1.readFile)(ssoTokenFilepath, \"utf8\");\n return JSON.parse(ssoTokenText);\n};\nexports.getSSOTokenFromFile = getSSOTokenFromFile;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.readFile = exports.fileIntercept = exports.filePromises = void 0;\nconst promises_1 = require(\"node:fs/promises\");\nexports.filePromises = {};\nexports.fileIntercept = {};\nconst readFile = (path, options) => {\n if (exports.fileIntercept[path] !== undefined) {\n return exports.fileIntercept[path];\n }\n if (!exports.filePromises[path] || options?.ignoreCache) {\n exports.filePromises[path] = (0, promises_1.readFile)(path, \"utf8\");\n }\n return exports.filePromises[path];\n};\nexports.readFile = readFile;\n", - "'use strict';\n\nvar getHomeDir = require('./getHomeDir');\nvar getSSOTokenFilepath = require('./getSSOTokenFilepath');\nvar getSSOTokenFromFile = require('./getSSOTokenFromFile');\nvar path = require('path');\nvar types = require('@smithy/types');\nvar readFile = require('./readFile');\n\nconst ENV_PROFILE = \"AWS_PROFILE\";\nconst DEFAULT_PROFILE = \"default\";\nconst getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;\n\nconst CONFIG_PREFIX_SEPARATOR = \".\";\n\nconst getConfigData = (data) => Object.entries(data)\n .filter(([key]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n if (indexOfSeparator === -1) {\n return false;\n }\n return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator));\n})\n .reduce((acc, [key, value]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;\n acc[updatedKey] = value;\n return acc;\n}, {\n ...(data.default && { default: data.default }),\n});\n\nconst ENV_CONFIG_PATH = \"AWS_CONFIG_FILE\";\nconst getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path.join(getHomeDir.getHomeDir(), \".aws\", \"config\");\n\nconst ENV_CREDENTIALS_PATH = \"AWS_SHARED_CREDENTIALS_FILE\";\nconst getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path.join(getHomeDir.getHomeDir(), \".aws\", \"credentials\");\n\nconst prefixKeyRegex = /^([\\w-]+)\\s([\"'])?([\\w-@\\+\\.%:/]+)\\2$/;\nconst profileNameBlockList = [\"__proto__\", \"profile __proto__\"];\nconst parseIni = (iniData) => {\n const map = {};\n let currentSection;\n let currentSubSection;\n for (const iniLine of iniData.split(/\\r?\\n/)) {\n const trimmedLine = iniLine.split(/(^|\\s)[;#]/)[0].trim();\n const isSection = trimmedLine[0] === \"[\" && trimmedLine[trimmedLine.length - 1] === \"]\";\n if (isSection) {\n currentSection = undefined;\n currentSubSection = undefined;\n const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);\n const matches = prefixKeyRegex.exec(sectionName);\n if (matches) {\n const [, prefix, , name] = matches;\n if (Object.values(types.IniSectionType).includes(prefix)) {\n currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);\n }\n }\n else {\n currentSection = sectionName;\n }\n if (profileNameBlockList.includes(sectionName)) {\n throw new Error(`Found invalid profile name \"${sectionName}\"`);\n }\n }\n else if (currentSection) {\n const indexOfEqualsSign = trimmedLine.indexOf(\"=\");\n if (![0, -1].includes(indexOfEqualsSign)) {\n const [name, value] = [\n trimmedLine.substring(0, indexOfEqualsSign).trim(),\n trimmedLine.substring(indexOfEqualsSign + 1).trim(),\n ];\n if (value === \"\") {\n currentSubSection = name;\n }\n else {\n if (currentSubSection && iniLine.trimStart() === iniLine) {\n currentSubSection = undefined;\n }\n map[currentSection] = map[currentSection] || {};\n const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;\n map[currentSection][key] = value;\n }\n }\n }\n }\n return map;\n};\n\nconst swallowError$1 = () => ({});\nconst loadSharedConfigFiles = async (init = {}) => {\n const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;\n const homeDir = getHomeDir.getHomeDir();\n const relativeHomeDirPrefix = \"~/\";\n let resolvedFilepath = filepath;\n if (filepath.startsWith(relativeHomeDirPrefix)) {\n resolvedFilepath = path.join(homeDir, filepath.slice(2));\n }\n let resolvedConfigFilepath = configFilepath;\n if (configFilepath.startsWith(relativeHomeDirPrefix)) {\n resolvedConfigFilepath = path.join(homeDir, configFilepath.slice(2));\n }\n const parsedFiles = await Promise.all([\n readFile.readFile(resolvedConfigFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .then(getConfigData)\n .catch(swallowError$1),\n readFile.readFile(resolvedFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .catch(swallowError$1),\n ]);\n return {\n configFile: parsedFiles[0],\n credentialsFile: parsedFiles[1],\n };\n};\n\nconst getSsoSessionData = (data) => Object.entries(data)\n .filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR))\n .reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});\n\nconst swallowError = () => ({});\nconst loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath())\n .then(parseIni)\n .then(getSsoSessionData)\n .catch(swallowError);\n\nconst mergeConfigFiles = (...files) => {\n const merged = {};\n for (const file of files) {\n for (const [key, values] of Object.entries(file)) {\n if (merged[key] !== undefined) {\n Object.assign(merged[key], values);\n }\n else {\n merged[key] = values;\n }\n }\n }\n return merged;\n};\n\nconst parseKnownFiles = async (init) => {\n const parsedFiles = await loadSharedConfigFiles(init);\n return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);\n};\n\nconst externalDataInterceptor = {\n getFileRecord() {\n return readFile.fileIntercept;\n },\n interceptFile(path, contents) {\n readFile.fileIntercept[path] = Promise.resolve(contents);\n },\n getTokenRecord() {\n return getSSOTokenFromFile.tokenIntercept;\n },\n interceptToken(id, contents) {\n getSSOTokenFromFile.tokenIntercept[id] = contents;\n },\n};\n\nObject.defineProperty(exports, \"getSSOTokenFromFile\", {\n enumerable: true,\n get: function () { return getSSOTokenFromFile.getSSOTokenFromFile; }\n});\nObject.defineProperty(exports, \"readFile\", {\n enumerable: true,\n get: function () { return readFile.readFile; }\n});\nexports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR;\nexports.DEFAULT_PROFILE = DEFAULT_PROFILE;\nexports.ENV_PROFILE = ENV_PROFILE;\nexports.externalDataInterceptor = externalDataInterceptor;\nexports.getProfileName = getProfileName;\nexports.loadSharedConfigFiles = loadSharedConfigFiles;\nexports.loadSsoSessionData = loadSsoSessionData;\nexports.parseKnownFiles = parseKnownFiles;\nObject.keys(getHomeDir).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () { return getHomeDir[k]; }\n });\n});\nObject.keys(getSSOTokenFilepath).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () { return getSSOTokenFilepath[k]; }\n });\n});\n", - "'use strict';\n\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\n\nfunction getSelectorName(functionString) {\n try {\n const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));\n constants.delete(\"CONFIG\");\n constants.delete(\"CONFIG_PREFIX_SEPARATOR\");\n constants.delete(\"ENV\");\n return [...constants].join(\", \");\n }\n catch (e) {\n return functionString;\n }\n}\n\nconst fromEnv = (envVarSelector, options) => async () => {\n try {\n const config = envVarSelector(process.env, options);\n if (config === undefined) {\n throw new Error();\n }\n return config;\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger });\n }\n};\n\nconst fromSharedConfigFiles = (configSelector, { preferredFile = \"config\", ...init } = {}) => async () => {\n const profile = sharedIniFileLoader.getProfileName(init);\n const { configFile, credentialsFile } = await sharedIniFileLoader.loadSharedConfigFiles(init);\n const profileFromCredentials = credentialsFile[profile] || {};\n const profileFromConfig = configFile[profile] || {};\n const mergedProfile = preferredFile === \"config\"\n ? { ...profileFromCredentials, ...profileFromConfig }\n : { ...profileFromConfig, ...profileFromCredentials };\n try {\n const cfgFile = preferredFile === \"config\" ? configFile : credentialsFile;\n const configValue = configSelector(mergedProfile, cfgFile);\n if (configValue === undefined) {\n throw new Error();\n }\n return configValue;\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger });\n }\n};\n\nconst isFunction = (func) => typeof func === \"function\";\nconst fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue);\n\nconst loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {\n const { signingName, logger } = configuration;\n const envOptions = { signingName, logger };\n return propertyProvider.memoize(propertyProvider.chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue)));\n};\n\nexports.loadConfig = loadConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEndpointUrlConfig = void 0;\nconst shared_ini_file_loader_1 = require(\"@smithy/shared-ini-file-loader\");\nconst ENV_ENDPOINT_URL = \"AWS_ENDPOINT_URL\";\nconst CONFIG_ENDPOINT_URL = \"endpoint_url\";\nconst getEndpointUrlConfig = (serviceId) => ({\n environmentVariableSelector: (env) => {\n const serviceSuffixParts = serviceId.split(\" \").map((w) => w.toUpperCase());\n const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join(\"_\")];\n if (serviceEndpointUrl)\n return serviceEndpointUrl;\n const endpointUrl = env[ENV_ENDPOINT_URL];\n if (endpointUrl)\n return endpointUrl;\n return undefined;\n },\n configFileSelector: (profile, config) => {\n if (config && profile.services) {\n const servicesSection = config[[\"services\", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)];\n if (servicesSection) {\n const servicePrefixParts = serviceId.split(\" \").map((w) => w.toLowerCase());\n const endpointUrl = servicesSection[[servicePrefixParts.join(\"_\"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)];\n if (endpointUrl)\n return endpointUrl;\n }\n }\n const endpointUrl = profile[CONFIG_ENDPOINT_URL];\n if (endpointUrl)\n return endpointUrl;\n return undefined;\n },\n default: undefined,\n});\nexports.getEndpointUrlConfig = getEndpointUrlConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEndpointFromConfig = void 0;\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst getEndpointUrlConfig_1 = require(\"./getEndpointUrlConfig\");\nconst getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId ?? \"\"))();\nexports.getEndpointFromConfig = getEndpointFromConfig;\n", - "'use strict';\n\nvar getEndpointFromConfig = require('./adaptors/getEndpointFromConfig');\nvar urlParser = require('@smithy/url-parser');\nvar core = require('@smithy/core');\nvar utilMiddleware = require('@smithy/util-middleware');\nvar middlewareSerde = require('@smithy/middleware-serde');\n\nconst resolveParamsForS3 = async (endpointParams) => {\n const bucket = endpointParams?.Bucket || \"\";\n if (typeof endpointParams.Bucket === \"string\") {\n endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent(\"#\")).replace(/\\?/g, encodeURIComponent(\"?\"));\n }\n if (isArnBucketName(bucket)) {\n if (endpointParams.ForcePathStyle === true) {\n throw new Error(\"Path-style addressing cannot be used with ARN buckets\");\n }\n }\n else if (!isDnsCompatibleBucketName(bucket) ||\n (bucket.indexOf(\".\") !== -1 && !String(endpointParams.Endpoint).startsWith(\"http:\")) ||\n bucket.toLowerCase() !== bucket ||\n bucket.length < 3) {\n endpointParams.ForcePathStyle = true;\n }\n if (endpointParams.DisableMultiRegionAccessPoints) {\n endpointParams.disableMultiRegionAccessPoints = true;\n endpointParams.DisableMRAP = true;\n }\n return endpointParams;\n};\nconst DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\\.\\-]{1,61}[a-z0-9]$/;\nconst IP_ADDRESS_PATTERN = /(\\d+\\.){3}\\d+/;\nconst DOTS_PATTERN = /\\.\\./;\nconst isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);\nconst isArnBucketName = (bucketName) => {\n const [arn, partition, service, , , bucket] = bucketName.split(\":\");\n const isArn = arn === \"arn\" && bucketName.split(\":\").length >= 6;\n const isValidArn = Boolean(isArn && partition && service && bucket);\n if (isArn && !isValidArn) {\n throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);\n }\n return isValidArn;\n};\n\nconst createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => {\n const configProvider = async () => {\n const configValue = config[configKey] ?? config[canonicalEndpointParamKey];\n if (typeof configValue === \"function\") {\n return configValue();\n }\n return configValue;\n };\n if (configKey === \"credentialScope\" || canonicalEndpointParamKey === \"CredentialScope\") {\n return async () => {\n const credentials = typeof config.credentials === \"function\" ? await config.credentials() : config.credentials;\n const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;\n return configValue;\n };\n }\n if (configKey === \"accountId\" || canonicalEndpointParamKey === \"AccountId\") {\n return async () => {\n const credentials = typeof config.credentials === \"function\" ? await config.credentials() : config.credentials;\n const configValue = credentials?.accountId ?? credentials?.AccountId;\n return configValue;\n };\n }\n if (configKey === \"endpoint\" || canonicalEndpointParamKey === \"endpoint\") {\n return async () => {\n if (config.isCustomEndpoint === false) {\n return undefined;\n }\n const endpoint = await configProvider();\n if (endpoint && typeof endpoint === \"object\") {\n if (\"url\" in endpoint) {\n return endpoint.url.href;\n }\n if (\"hostname\" in endpoint) {\n const { protocol, hostname, port, path } = endpoint;\n return `${protocol}//${hostname}${port ? \":\" + port : \"\"}${path}`;\n }\n }\n return endpoint;\n };\n }\n return configProvider;\n};\n\nconst toEndpointV1 = (endpoint) => {\n if (typeof endpoint === \"object\") {\n if (\"url\" in endpoint) {\n return urlParser.parseUrl(endpoint.url);\n }\n return endpoint;\n }\n return urlParser.parseUrl(endpoint);\n};\n\nconst getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => {\n if (!clientConfig.isCustomEndpoint) {\n let endpointFromConfig;\n if (clientConfig.serviceConfiguredEndpoint) {\n endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();\n }\n else {\n endpointFromConfig = await getEndpointFromConfig.getEndpointFromConfig(clientConfig.serviceId);\n }\n if (endpointFromConfig) {\n clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));\n clientConfig.isCustomEndpoint = true;\n }\n }\n const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);\n if (typeof clientConfig.endpointProvider !== \"function\") {\n throw new Error(\"config.endpointProvider is not set.\");\n }\n const endpoint = clientConfig.endpointProvider(endpointParams, context);\n return endpoint;\n};\nconst resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {\n const endpointParams = {};\n const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};\n for (const [name, instruction] of Object.entries(instructions)) {\n switch (instruction.type) {\n case \"staticContextParams\":\n endpointParams[name] = instruction.value;\n break;\n case \"contextParams\":\n endpointParams[name] = commandInput[instruction.name];\n break;\n case \"clientContextParams\":\n case \"builtInParams\":\n endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)();\n break;\n case \"operationContextParams\":\n endpointParams[name] = instruction.get(commandInput);\n break;\n default:\n throw new Error(\"Unrecognized endpoint parameter instruction: \" + JSON.stringify(instruction));\n }\n }\n if (Object.keys(instructions).length === 0) {\n Object.assign(endpointParams, clientConfig);\n }\n if (String(clientConfig.serviceId).toLowerCase() === \"s3\") {\n await resolveParamsForS3(endpointParams);\n }\n return endpointParams;\n};\n\nconst endpointMiddleware = ({ config, instructions, }) => {\n return (next, context) => async (args) => {\n if (config.isCustomEndpoint) {\n core.setFeature(context, \"ENDPOINT_OVERRIDE\", \"N\");\n }\n const endpoint = await getEndpointFromInstructions(args.input, {\n getEndpointParameterInstructions() {\n return instructions;\n },\n }, { ...config }, context);\n context.endpointV2 = endpoint;\n context.authSchemes = endpoint.properties?.authSchemes;\n const authScheme = context.authSchemes?.[0];\n if (authScheme) {\n context[\"signing_region\"] = authScheme.signingRegion;\n context[\"signing_service\"] = authScheme.signingName;\n const smithyContext = utilMiddleware.getSmithyContext(context);\n const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;\n if (httpAuthOption) {\n httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {\n signing_region: authScheme.signingRegion,\n signingRegion: authScheme.signingRegion,\n signing_service: authScheme.signingName,\n signingName: authScheme.signingName,\n signingRegionSet: authScheme.signingRegionSet,\n }, authScheme.properties);\n }\n }\n return next({\n ...args,\n });\n };\n};\n\nconst endpointMiddlewareOptions = {\n step: \"serialize\",\n tags: [\"ENDPOINT_PARAMETERS\", \"ENDPOINT_V2\", \"ENDPOINT\"],\n name: \"endpointV2Middleware\",\n override: true,\n relation: \"before\",\n toMiddleware: middlewareSerde.serializerMiddlewareOption.name,\n};\nconst getEndpointPlugin = (config, instructions) => ({\n applyToStack: (clientStack) => {\n clientStack.addRelativeTo(endpointMiddleware({\n config,\n instructions,\n }), endpointMiddlewareOptions);\n },\n});\n\nconst resolveEndpointConfig = (input) => {\n const tls = input.tls ?? true;\n const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;\n const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await utilMiddleware.normalizeProvider(endpoint)()) : undefined;\n const isCustomEndpoint = !!endpoint;\n const resolvedConfig = Object.assign(input, {\n endpoint: customEndpointProvider,\n tls,\n isCustomEndpoint,\n useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false),\n useFipsEndpoint: utilMiddleware.normalizeProvider(useFipsEndpoint ?? false),\n });\n let configuredEndpointPromise = undefined;\n resolvedConfig.serviceConfiguredEndpoint = async () => {\n if (input.serviceId && !configuredEndpointPromise) {\n configuredEndpointPromise = getEndpointFromConfig.getEndpointFromConfig(input.serviceId);\n }\n return configuredEndpointPromise;\n };\n return resolvedConfig;\n};\n\nconst resolveEndpointRequiredConfig = (input) => {\n const { endpoint } = input;\n if (endpoint === undefined) {\n input.endpoint = async () => {\n throw new Error(\"@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.\");\n };\n }\n return input;\n};\n\nexports.endpointMiddleware = endpointMiddleware;\nexports.endpointMiddlewareOptions = endpointMiddlewareOptions;\nexports.getEndpointFromInstructions = getEndpointFromInstructions;\nexports.getEndpointPlugin = getEndpointPlugin;\nexports.resolveEndpointConfig = resolveEndpointConfig;\nexports.resolveEndpointRequiredConfig = resolveEndpointRequiredConfig;\nexports.resolveParams = resolveParams;\nexports.toEndpointV1 = toEndpointV1;\n", - "'use strict';\n\nconst CLOCK_SKEW_ERROR_CODES = [\n \"AuthFailure\",\n \"InvalidSignatureException\",\n \"RequestExpired\",\n \"RequestInTheFuture\",\n \"RequestTimeTooSkewed\",\n \"SignatureDoesNotMatch\",\n];\nconst THROTTLING_ERROR_CODES = [\n \"BandwidthLimitExceeded\",\n \"EC2ThrottledException\",\n \"LimitExceededException\",\n \"PriorRequestNotComplete\",\n \"ProvisionedThroughputExceededException\",\n \"RequestLimitExceeded\",\n \"RequestThrottled\",\n \"RequestThrottledException\",\n \"SlowDown\",\n \"ThrottledException\",\n \"Throttling\",\n \"ThrottlingException\",\n \"TooManyRequestsException\",\n \"TransactionInProgressException\",\n];\nconst TRANSIENT_ERROR_CODES = [\"TimeoutError\", \"RequestTimeout\", \"RequestTimeoutException\"];\nconst TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];\nconst NODEJS_TIMEOUT_ERROR_CODES = [\"ECONNRESET\", \"ECONNREFUSED\", \"EPIPE\", \"ETIMEDOUT\"];\nconst NODEJS_NETWORK_ERROR_CODES = [\"EHOSTUNREACH\", \"ENETUNREACH\", \"ENOTFOUND\"];\n\nconst isRetryableByTrait = (error) => error?.$retryable !== undefined;\nconst isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name);\nconst isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCorrected;\nconst isBrowserNetworkError = (error) => {\n const errorMessages = new Set([\n \"Failed to fetch\",\n \"NetworkError when attempting to fetch resource\",\n \"The Internet connection appears to be offline\",\n \"Load failed\",\n \"Network request failed\",\n ]);\n const isValid = error && error instanceof TypeError;\n if (!isValid) {\n return false;\n }\n return errorMessages.has(error.message);\n};\nconst isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 ||\n THROTTLING_ERROR_CODES.includes(error.name) ||\n error.$retryable?.throttling == true;\nconst isTransientError = (error, depth = 0) => isRetryableByTrait(error) ||\n isClockSkewCorrectedError(error) ||\n TRANSIENT_ERROR_CODES.includes(error.name) ||\n NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || \"\") ||\n NODEJS_NETWORK_ERROR_CODES.includes(error?.code || \"\") ||\n TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) ||\n isBrowserNetworkError(error) ||\n (error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1));\nconst isServerError = (error) => {\n if (error.$metadata?.httpStatusCode !== undefined) {\n const statusCode = error.$metadata.httpStatusCode;\n if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {\n return true;\n }\n return false;\n }\n return false;\n};\n\nexports.isBrowserNetworkError = isBrowserNetworkError;\nexports.isClockSkewCorrectedError = isClockSkewCorrectedError;\nexports.isClockSkewError = isClockSkewError;\nexports.isRetryableByTrait = isRetryableByTrait;\nexports.isServerError = isServerError;\nexports.isThrottlingError = isThrottlingError;\nexports.isTransientError = isTransientError;\n", - "'use strict';\n\nvar serviceErrorClassification = require('@smithy/service-error-classification');\n\nexports.RETRY_MODES = void 0;\n(function (RETRY_MODES) {\n RETRY_MODES[\"STANDARD\"] = \"standard\";\n RETRY_MODES[\"ADAPTIVE\"] = \"adaptive\";\n})(exports.RETRY_MODES || (exports.RETRY_MODES = {}));\nconst DEFAULT_MAX_ATTEMPTS = 3;\nconst DEFAULT_RETRY_MODE = exports.RETRY_MODES.STANDARD;\n\nclass DefaultRateLimiter {\n static setTimeoutFn = setTimeout;\n beta;\n minCapacity;\n minFillRate;\n scaleConstant;\n smooth;\n currentCapacity = 0;\n enabled = false;\n lastMaxRate = 0;\n measuredTxRate = 0;\n requestCount = 0;\n fillRate;\n lastThrottleTime;\n lastTimestamp = 0;\n lastTxRateBucket;\n maxCapacity;\n timeWindow = 0;\n constructor(options) {\n this.beta = options?.beta ?? 0.7;\n this.minCapacity = options?.minCapacity ?? 1;\n this.minFillRate = options?.minFillRate ?? 0.5;\n this.scaleConstant = options?.scaleConstant ?? 0.4;\n this.smooth = options?.smooth ?? 0.8;\n const currentTimeInSeconds = this.getCurrentTimeInSeconds();\n this.lastThrottleTime = currentTimeInSeconds;\n this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());\n this.fillRate = this.minFillRate;\n this.maxCapacity = this.minCapacity;\n }\n getCurrentTimeInSeconds() {\n return Date.now() / 1000;\n }\n async getSendToken() {\n return this.acquireTokenBucket(1);\n }\n async acquireTokenBucket(amount) {\n if (!this.enabled) {\n return;\n }\n this.refillTokenBucket();\n if (amount > this.currentCapacity) {\n const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000;\n await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay));\n }\n this.currentCapacity = this.currentCapacity - amount;\n }\n refillTokenBucket() {\n const timestamp = this.getCurrentTimeInSeconds();\n if (!this.lastTimestamp) {\n this.lastTimestamp = timestamp;\n return;\n }\n const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;\n this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount);\n this.lastTimestamp = timestamp;\n }\n updateClientSendingRate(response) {\n let calculatedRate;\n this.updateMeasuredRate();\n if (serviceErrorClassification.isThrottlingError(response)) {\n const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);\n this.lastMaxRate = rateToUse;\n this.calculateTimeWindow();\n this.lastThrottleTime = this.getCurrentTimeInSeconds();\n calculatedRate = this.cubicThrottle(rateToUse);\n this.enableTokenBucket();\n }\n else {\n this.calculateTimeWindow();\n calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());\n }\n const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);\n this.updateTokenBucketRate(newRate);\n }\n calculateTimeWindow() {\n this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3));\n }\n cubicThrottle(rateToUse) {\n return this.getPrecise(rateToUse * this.beta);\n }\n cubicSuccess(timestamp) {\n return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);\n }\n enableTokenBucket() {\n this.enabled = true;\n }\n updateTokenBucketRate(newRate) {\n this.refillTokenBucket();\n this.fillRate = Math.max(newRate, this.minFillRate);\n this.maxCapacity = Math.max(newRate, this.minCapacity);\n this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);\n }\n updateMeasuredRate() {\n const t = this.getCurrentTimeInSeconds();\n const timeBucket = Math.floor(t * 2) / 2;\n this.requestCount++;\n if (timeBucket > this.lastTxRateBucket) {\n const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);\n this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));\n this.requestCount = 0;\n this.lastTxRateBucket = timeBucket;\n }\n }\n getPrecise(num) {\n return parseFloat(num.toFixed(8));\n }\n}\n\nconst DEFAULT_RETRY_DELAY_BASE = 100;\nconst MAXIMUM_RETRY_DELAY = 20 * 1000;\nconst THROTTLING_RETRY_DELAY_BASE = 500;\nconst INITIAL_RETRY_TOKENS = 500;\nconst RETRY_COST = 5;\nconst TIMEOUT_RETRY_COST = 10;\nconst NO_RETRY_INCREMENT = 1;\nconst INVOCATION_ID_HEADER = \"amz-sdk-invocation-id\";\nconst REQUEST_HEADER = \"amz-sdk-request\";\n\nconst getDefaultRetryBackoffStrategy = () => {\n let delayBase = DEFAULT_RETRY_DELAY_BASE;\n const computeNextBackoffDelay = (attempts) => {\n return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));\n };\n const setDelayBase = (delay) => {\n delayBase = delay;\n };\n return {\n computeNextBackoffDelay,\n setDelayBase,\n };\n};\n\nconst createDefaultRetryToken = ({ retryDelay, retryCount, retryCost, }) => {\n const getRetryCount = () => retryCount;\n const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay);\n const getRetryCost = () => retryCost;\n return {\n getRetryCount,\n getRetryDelay,\n getRetryCost,\n };\n};\n\nclass StandardRetryStrategy {\n maxAttempts;\n mode = exports.RETRY_MODES.STANDARD;\n capacity = INITIAL_RETRY_TOKENS;\n retryBackoffStrategy = getDefaultRetryBackoffStrategy();\n maxAttemptsProvider;\n constructor(maxAttempts) {\n this.maxAttempts = maxAttempts;\n this.maxAttemptsProvider = typeof maxAttempts === \"function\" ? maxAttempts : async () => maxAttempts;\n }\n async acquireInitialRetryToken(retryTokenScope) {\n return createDefaultRetryToken({\n retryDelay: DEFAULT_RETRY_DELAY_BASE,\n retryCount: 0,\n });\n }\n async refreshRetryTokenForRetry(token, errorInfo) {\n const maxAttempts = await this.getMaxAttempts();\n if (this.shouldRetry(token, errorInfo, maxAttempts)) {\n const errorType = errorInfo.errorType;\n this.retryBackoffStrategy.setDelayBase(errorType === \"THROTTLING\" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE);\n const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());\n const retryDelay = errorInfo.retryAfterHint\n ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType)\n : delayFromErrorType;\n const capacityCost = this.getCapacityCost(errorType);\n this.capacity -= capacityCost;\n return createDefaultRetryToken({\n retryDelay,\n retryCount: token.getRetryCount() + 1,\n retryCost: capacityCost,\n });\n }\n throw new Error(\"No retry token available\");\n }\n recordSuccess(token) {\n this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));\n }\n getCapacity() {\n return this.capacity;\n }\n async getMaxAttempts() {\n try {\n return await this.maxAttemptsProvider();\n }\n catch (error) {\n console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);\n return DEFAULT_MAX_ATTEMPTS;\n }\n }\n shouldRetry(tokenToRenew, errorInfo, maxAttempts) {\n const attempts = tokenToRenew.getRetryCount() + 1;\n return (attempts < maxAttempts &&\n this.capacity >= this.getCapacityCost(errorInfo.errorType) &&\n this.isRetryableError(errorInfo.errorType));\n }\n getCapacityCost(errorType) {\n return errorType === \"TRANSIENT\" ? TIMEOUT_RETRY_COST : RETRY_COST;\n }\n isRetryableError(errorType) {\n return errorType === \"THROTTLING\" || errorType === \"TRANSIENT\";\n }\n}\n\nclass AdaptiveRetryStrategy {\n maxAttemptsProvider;\n rateLimiter;\n standardRetryStrategy;\n mode = exports.RETRY_MODES.ADAPTIVE;\n constructor(maxAttemptsProvider, options) {\n this.maxAttemptsProvider = maxAttemptsProvider;\n const { rateLimiter } = options ?? {};\n this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();\n this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);\n }\n async acquireInitialRetryToken(retryTokenScope) {\n await this.rateLimiter.getSendToken();\n return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);\n }\n async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {\n this.rateLimiter.updateClientSendingRate(errorInfo);\n return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);\n }\n recordSuccess(token) {\n this.rateLimiter.updateClientSendingRate({});\n this.standardRetryStrategy.recordSuccess(token);\n }\n}\n\nclass ConfiguredRetryStrategy extends StandardRetryStrategy {\n computeNextBackoffDelay;\n constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) {\n super(typeof maxAttempts === \"function\" ? maxAttempts : async () => maxAttempts);\n if (typeof computeNextBackoffDelay === \"number\") {\n this.computeNextBackoffDelay = () => computeNextBackoffDelay;\n }\n else {\n this.computeNextBackoffDelay = computeNextBackoffDelay;\n }\n }\n async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {\n const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo);\n token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount());\n return token;\n }\n}\n\nexports.AdaptiveRetryStrategy = AdaptiveRetryStrategy;\nexports.ConfiguredRetryStrategy = ConfiguredRetryStrategy;\nexports.DEFAULT_MAX_ATTEMPTS = DEFAULT_MAX_ATTEMPTS;\nexports.DEFAULT_RETRY_DELAY_BASE = DEFAULT_RETRY_DELAY_BASE;\nexports.DEFAULT_RETRY_MODE = DEFAULT_RETRY_MODE;\nexports.DefaultRateLimiter = DefaultRateLimiter;\nexports.INITIAL_RETRY_TOKENS = INITIAL_RETRY_TOKENS;\nexports.INVOCATION_ID_HEADER = INVOCATION_ID_HEADER;\nexports.MAXIMUM_RETRY_DELAY = MAXIMUM_RETRY_DELAY;\nexports.NO_RETRY_INCREMENT = NO_RETRY_INCREMENT;\nexports.REQUEST_HEADER = REQUEST_HEADER;\nexports.RETRY_COST = RETRY_COST;\nexports.StandardRetryStrategy = StandardRetryStrategy;\nexports.THROTTLING_RETRY_DELAY_BASE = THROTTLING_RETRY_DELAY_BASE;\nexports.TIMEOUT_RETRY_COST = TIMEOUT_RETRY_COST;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isStreamingPayload = void 0;\nconst stream_1 = require(\"stream\");\nconst isStreamingPayload = (request) => request?.body instanceof stream_1.Readable ||\n (typeof ReadableStream !== \"undefined\" && request?.body instanceof ReadableStream);\nexports.isStreamingPayload = isStreamingPayload;\n", - "'use strict';\n\nvar utilRetry = require('@smithy/util-retry');\nvar protocolHttp = require('@smithy/protocol-http');\nvar serviceErrorClassification = require('@smithy/service-error-classification');\nvar uuid = require('@smithy/uuid');\nvar utilMiddleware = require('@smithy/util-middleware');\nvar smithyClient = require('@smithy/smithy-client');\nvar isStreamingPayload = require('./isStreamingPayload/isStreamingPayload');\n\nconst getDefaultRetryQuota = (initialRetryTokens, options) => {\n const MAX_CAPACITY = initialRetryTokens;\n const noRetryIncrement = utilRetry.NO_RETRY_INCREMENT;\n const retryCost = utilRetry.RETRY_COST;\n const timeoutRetryCost = utilRetry.TIMEOUT_RETRY_COST;\n let availableCapacity = initialRetryTokens;\n const getCapacityAmount = (error) => (error.name === \"TimeoutError\" ? timeoutRetryCost : retryCost);\n const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity;\n const retrieveRetryTokens = (error) => {\n if (!hasRetryTokens(error)) {\n throw new Error(\"No retry token available\");\n }\n const capacityAmount = getCapacityAmount(error);\n availableCapacity -= capacityAmount;\n return capacityAmount;\n };\n const releaseRetryTokens = (capacityReleaseAmount) => {\n availableCapacity += capacityReleaseAmount ?? noRetryIncrement;\n availableCapacity = Math.min(availableCapacity, MAX_CAPACITY);\n };\n return Object.freeze({\n hasRetryTokens,\n retrieveRetryTokens,\n releaseRetryTokens,\n });\n};\n\nconst defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(utilRetry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));\n\nconst defaultRetryDecider = (error) => {\n if (!error) {\n return false;\n }\n return serviceErrorClassification.isRetryableByTrait(error) || serviceErrorClassification.isClockSkewError(error) || serviceErrorClassification.isThrottlingError(error) || serviceErrorClassification.isTransientError(error);\n};\n\nconst asSdkError = (error) => {\n if (error instanceof Error)\n return error;\n if (error instanceof Object)\n return Object.assign(new Error(), error);\n if (typeof error === \"string\")\n return new Error(error);\n return new Error(`AWS SDK error wrapper for ${error}`);\n};\n\nclass StandardRetryStrategy {\n maxAttemptsProvider;\n retryDecider;\n delayDecider;\n retryQuota;\n mode = utilRetry.RETRY_MODES.STANDARD;\n constructor(maxAttemptsProvider, options) {\n this.maxAttemptsProvider = maxAttemptsProvider;\n this.retryDecider = options?.retryDecider ?? defaultRetryDecider;\n this.delayDecider = options?.delayDecider ?? defaultDelayDecider;\n this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(utilRetry.INITIAL_RETRY_TOKENS);\n }\n shouldRetry(error, attempts, maxAttempts) {\n return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error);\n }\n async getMaxAttempts() {\n let maxAttempts;\n try {\n maxAttempts = await this.maxAttemptsProvider();\n }\n catch (error) {\n maxAttempts = utilRetry.DEFAULT_MAX_ATTEMPTS;\n }\n return maxAttempts;\n }\n async retry(next, args, options) {\n let retryTokenAmount;\n let attempts = 0;\n let totalDelay = 0;\n const maxAttempts = await this.getMaxAttempts();\n const { request } = args;\n if (protocolHttp.HttpRequest.isInstance(request)) {\n request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4();\n }\n while (true) {\n try {\n if (protocolHttp.HttpRequest.isInstance(request)) {\n request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;\n }\n if (options?.beforeRequest) {\n await options.beforeRequest();\n }\n const { response, output } = await next(args);\n if (options?.afterRequest) {\n options.afterRequest(response);\n }\n this.retryQuota.releaseRetryTokens(retryTokenAmount);\n output.$metadata.attempts = attempts + 1;\n output.$metadata.totalRetryDelay = totalDelay;\n return { response, output };\n }\n catch (e) {\n const err = asSdkError(e);\n attempts++;\n if (this.shouldRetry(err, attempts, maxAttempts)) {\n retryTokenAmount = this.retryQuota.retrieveRetryTokens(err);\n const delayFromDecider = this.delayDecider(serviceErrorClassification.isThrottlingError(err) ? utilRetry.THROTTLING_RETRY_DELAY_BASE : utilRetry.DEFAULT_RETRY_DELAY_BASE, attempts);\n const delayFromResponse = getDelayFromRetryAfterHeader(err.$response);\n const delay = Math.max(delayFromResponse || 0, delayFromDecider);\n totalDelay += delay;\n await new Promise((resolve) => setTimeout(resolve, delay));\n continue;\n }\n if (!err.$metadata) {\n err.$metadata = {};\n }\n err.$metadata.attempts = attempts;\n err.$metadata.totalRetryDelay = totalDelay;\n throw err;\n }\n }\n }\n}\nconst getDelayFromRetryAfterHeader = (response) => {\n if (!protocolHttp.HttpResponse.isInstance(response))\n return;\n const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === \"retry-after\");\n if (!retryAfterHeaderName)\n return;\n const retryAfter = response.headers[retryAfterHeaderName];\n const retryAfterSeconds = Number(retryAfter);\n if (!Number.isNaN(retryAfterSeconds))\n return retryAfterSeconds * 1000;\n const retryAfterDate = new Date(retryAfter);\n return retryAfterDate.getTime() - Date.now();\n};\n\nclass AdaptiveRetryStrategy extends StandardRetryStrategy {\n rateLimiter;\n constructor(maxAttemptsProvider, options) {\n const { rateLimiter, ...superOptions } = options ?? {};\n super(maxAttemptsProvider, superOptions);\n this.rateLimiter = rateLimiter ?? new utilRetry.DefaultRateLimiter();\n this.mode = utilRetry.RETRY_MODES.ADAPTIVE;\n }\n async retry(next, args) {\n return super.retry(next, args, {\n beforeRequest: async () => {\n return this.rateLimiter.getSendToken();\n },\n afterRequest: (response) => {\n this.rateLimiter.updateClientSendingRate(response);\n },\n });\n }\n}\n\nconst ENV_MAX_ATTEMPTS = \"AWS_MAX_ATTEMPTS\";\nconst CONFIG_MAX_ATTEMPTS = \"max_attempts\";\nconst NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => {\n const value = env[ENV_MAX_ATTEMPTS];\n if (!value)\n return undefined;\n const maxAttempt = parseInt(value);\n if (Number.isNaN(maxAttempt)) {\n throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got \"${value}\"`);\n }\n return maxAttempt;\n },\n configFileSelector: (profile) => {\n const value = profile[CONFIG_MAX_ATTEMPTS];\n if (!value)\n return undefined;\n const maxAttempt = parseInt(value);\n if (Number.isNaN(maxAttempt)) {\n throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got \"${value}\"`);\n }\n return maxAttempt;\n },\n default: utilRetry.DEFAULT_MAX_ATTEMPTS,\n};\nconst resolveRetryConfig = (input) => {\n const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input;\n const maxAttempts = utilMiddleware.normalizeProvider(_maxAttempts ?? utilRetry.DEFAULT_MAX_ATTEMPTS);\n return Object.assign(input, {\n maxAttempts,\n retryStrategy: async () => {\n if (retryStrategy) {\n return retryStrategy;\n }\n const retryMode = await utilMiddleware.normalizeProvider(_retryMode)();\n if (retryMode === utilRetry.RETRY_MODES.ADAPTIVE) {\n return new utilRetry.AdaptiveRetryStrategy(maxAttempts);\n }\n return new utilRetry.StandardRetryStrategy(maxAttempts);\n },\n });\n};\nconst ENV_RETRY_MODE = \"AWS_RETRY_MODE\";\nconst CONFIG_RETRY_MODE = \"retry_mode\";\nconst NODE_RETRY_MODE_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => env[ENV_RETRY_MODE],\n configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],\n default: utilRetry.DEFAULT_RETRY_MODE,\n};\n\nconst omitRetryHeadersMiddleware = () => (next) => async (args) => {\n const { request } = args;\n if (protocolHttp.HttpRequest.isInstance(request)) {\n delete request.headers[utilRetry.INVOCATION_ID_HEADER];\n delete request.headers[utilRetry.REQUEST_HEADER];\n }\n return next(args);\n};\nconst omitRetryHeadersMiddlewareOptions = {\n name: \"omitRetryHeadersMiddleware\",\n tags: [\"RETRY\", \"HEADERS\", \"OMIT_RETRY_HEADERS\"],\n relation: \"before\",\n toMiddleware: \"awsAuthMiddleware\",\n override: true,\n};\nconst getOmitRetryHeadersPlugin = (options) => ({\n applyToStack: (clientStack) => {\n clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions);\n },\n});\n\nconst retryMiddleware = (options) => (next, context) => async (args) => {\n let retryStrategy = await options.retryStrategy();\n const maxAttempts = await options.maxAttempts();\n if (isRetryStrategyV2(retryStrategy)) {\n retryStrategy = retryStrategy;\n let retryToken = await retryStrategy.acquireInitialRetryToken(context[\"partition_id\"]);\n let lastError = new Error();\n let attempts = 0;\n let totalRetryDelay = 0;\n const { request } = args;\n const isRequest = protocolHttp.HttpRequest.isInstance(request);\n if (isRequest) {\n request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4();\n }\n while (true) {\n try {\n if (isRequest) {\n request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;\n }\n const { response, output } = await next(args);\n retryStrategy.recordSuccess(retryToken);\n output.$metadata.attempts = attempts + 1;\n output.$metadata.totalRetryDelay = totalRetryDelay;\n return { response, output };\n }\n catch (e) {\n const retryErrorInfo = getRetryErrorInfo(e);\n lastError = asSdkError(e);\n if (isRequest && isStreamingPayload.isStreamingPayload(request)) {\n (context.logger instanceof smithyClient.NoOpLogger ? console : context.logger)?.warn(\"An error was encountered in a non-retryable streaming request.\");\n throw lastError;\n }\n try {\n retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);\n }\n catch (refreshError) {\n if (!lastError.$metadata) {\n lastError.$metadata = {};\n }\n lastError.$metadata.attempts = attempts + 1;\n lastError.$metadata.totalRetryDelay = totalRetryDelay;\n throw lastError;\n }\n attempts = retryToken.getRetryCount();\n const delay = retryToken.getRetryDelay();\n totalRetryDelay += delay;\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n else {\n retryStrategy = retryStrategy;\n if (retryStrategy?.mode)\n context.userAgent = [...(context.userAgent || []), [\"cfg/retry-mode\", retryStrategy.mode]];\n return retryStrategy.retry(next, args);\n }\n};\nconst isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== \"undefined\" &&\n typeof retryStrategy.refreshRetryTokenForRetry !== \"undefined\" &&\n typeof retryStrategy.recordSuccess !== \"undefined\";\nconst getRetryErrorInfo = (error) => {\n const errorInfo = {\n error,\n errorType: getRetryErrorType(error),\n };\n const retryAfterHint = getRetryAfterHint(error.$response);\n if (retryAfterHint) {\n errorInfo.retryAfterHint = retryAfterHint;\n }\n return errorInfo;\n};\nconst getRetryErrorType = (error) => {\n if (serviceErrorClassification.isThrottlingError(error))\n return \"THROTTLING\";\n if (serviceErrorClassification.isTransientError(error))\n return \"TRANSIENT\";\n if (serviceErrorClassification.isServerError(error))\n return \"SERVER_ERROR\";\n return \"CLIENT_ERROR\";\n};\nconst retryMiddlewareOptions = {\n name: \"retryMiddleware\",\n tags: [\"RETRY\"],\n step: \"finalizeRequest\",\n priority: \"high\",\n override: true,\n};\nconst getRetryPlugin = (options) => ({\n applyToStack: (clientStack) => {\n clientStack.add(retryMiddleware(options), retryMiddlewareOptions);\n },\n});\nconst getRetryAfterHint = (response) => {\n if (!protocolHttp.HttpResponse.isInstance(response))\n return;\n const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === \"retry-after\");\n if (!retryAfterHeaderName)\n return;\n const retryAfter = response.headers[retryAfterHeaderName];\n const retryAfterSeconds = Number(retryAfter);\n if (!Number.isNaN(retryAfterSeconds))\n return new Date(retryAfterSeconds * 1000);\n const retryAfterDate = new Date(retryAfter);\n return retryAfterDate;\n};\n\nexports.AdaptiveRetryStrategy = AdaptiveRetryStrategy;\nexports.CONFIG_MAX_ATTEMPTS = CONFIG_MAX_ATTEMPTS;\nexports.CONFIG_RETRY_MODE = CONFIG_RETRY_MODE;\nexports.ENV_MAX_ATTEMPTS = ENV_MAX_ATTEMPTS;\nexports.ENV_RETRY_MODE = ENV_RETRY_MODE;\nexports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = NODE_MAX_ATTEMPT_CONFIG_OPTIONS;\nexports.NODE_RETRY_MODE_CONFIG_OPTIONS = NODE_RETRY_MODE_CONFIG_OPTIONS;\nexports.StandardRetryStrategy = StandardRetryStrategy;\nexports.defaultDelayDecider = defaultDelayDecider;\nexports.defaultRetryDecider = defaultRetryDecider;\nexports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin;\nexports.getRetryAfterHint = getRetryAfterHint;\nexports.getRetryPlugin = getRetryPlugin;\nexports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware;\nexports.omitRetryHeadersMiddlewareOptions = omitRetryHeadersMiddlewareOptions;\nexports.resolveRetryConfig = resolveRetryConfig;\nexports.retryMiddleware = retryMiddleware;\nexports.retryMiddlewareOptions = retryMiddlewareOptions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultBedrockHttpAuthSchemeProvider = exports.defaultBedrockHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst core_2 = require(\"@smithy/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultBedrockHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultBedrockHttpAuthSchemeParametersProvider = defaultBedrockHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"bedrock\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiHttpBearerAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#httpBearerAuth\",\n propertiesExtractor: ({ profile, filepath, configFilepath, ignoreCache }, context) => ({\n identityProperties: {\n profile,\n filepath,\n configFilepath,\n ignoreCache,\n },\n }),\n };\n}\nconst defaultBedrockHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n options.push(createSmithyApiHttpBearerAuthHttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultBedrockHttpAuthSchemeProvider = defaultBedrockHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const token = (0, core_2.memoizeIdentityProvider)(config.token, core_2.isIdentityExpired, core_2.doesIdentityRequireRefresh);\n const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n token,\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", - "'use strict';\n\nvar client = require('@aws-sdk/core/client');\nvar propertyProvider = require('@smithy/property-provider');\n\nconst ENV_KEY = \"AWS_ACCESS_KEY_ID\";\nconst ENV_SECRET = \"AWS_SECRET_ACCESS_KEY\";\nconst ENV_SESSION = \"AWS_SESSION_TOKEN\";\nconst ENV_EXPIRATION = \"AWS_CREDENTIAL_EXPIRATION\";\nconst ENV_CREDENTIAL_SCOPE = \"AWS_CREDENTIAL_SCOPE\";\nconst ENV_ACCOUNT_ID = \"AWS_ACCOUNT_ID\";\nconst fromEnv = (init) => async () => {\n init?.logger?.debug(\"@aws-sdk/credential-provider-env - fromEnv\");\n const accessKeyId = process.env[ENV_KEY];\n const secretAccessKey = process.env[ENV_SECRET];\n const sessionToken = process.env[ENV_SESSION];\n const expiry = process.env[ENV_EXPIRATION];\n const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];\n const accountId = process.env[ENV_ACCOUNT_ID];\n if (accessKeyId && secretAccessKey) {\n const credentials = {\n accessKeyId,\n secretAccessKey,\n ...(sessionToken && { sessionToken }),\n ...(expiry && { expiration: new Date(expiry) }),\n ...(credentialScope && { credentialScope }),\n ...(accountId && { accountId }),\n };\n client.setCredentialFeature(credentials, \"CREDENTIALS_ENV_VARS\", \"g\");\n return credentials;\n }\n throw new propertyProvider.CredentialsProviderError(\"Unable to find environment variable credentials.\", { logger: init?.logger });\n};\n\nexports.ENV_ACCOUNT_ID = ENV_ACCOUNT_ID;\nexports.ENV_CREDENTIAL_SCOPE = ENV_CREDENTIAL_SCOPE;\nexports.ENV_EXPIRATION = ENV_EXPIRATION;\nexports.ENV_KEY = ENV_KEY;\nexports.ENV_SECRET = ENV_SECRET;\nexports.ENV_SESSION = ENV_SESSION;\nexports.fromEnv = fromEnv;\n", - "'use strict';\n\nvar propertyProvider = require('@smithy/property-provider');\nvar url = require('url');\nvar buffer = require('buffer');\nvar http = require('http');\nvar nodeConfigProvider = require('@smithy/node-config-provider');\nvar urlParser = require('@smithy/url-parser');\n\nfunction httpRequest(options) {\n return new Promise((resolve, reject) => {\n const req = http.request({\n method: \"GET\",\n ...options,\n hostname: options.hostname?.replace(/^\\[(.+)\\]$/, \"$1\"),\n });\n req.on(\"error\", (err) => {\n reject(Object.assign(new propertyProvider.ProviderError(\"Unable to connect to instance metadata service\"), err));\n req.destroy();\n });\n req.on(\"timeout\", () => {\n reject(new propertyProvider.ProviderError(\"TimeoutError from instance metadata service\"));\n req.destroy();\n });\n req.on(\"response\", (res) => {\n const { statusCode = 400 } = res;\n if (statusCode < 200 || 300 <= statusCode) {\n reject(Object.assign(new propertyProvider.ProviderError(\"Error response received from instance metadata service\"), { statusCode }));\n req.destroy();\n }\n const chunks = [];\n res.on(\"data\", (chunk) => {\n chunks.push(chunk);\n });\n res.on(\"end\", () => {\n resolve(buffer.Buffer.concat(chunks));\n req.destroy();\n });\n });\n req.end();\n });\n}\n\nconst isImdsCredentials = (arg) => Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.AccessKeyId === \"string\" &&\n typeof arg.SecretAccessKey === \"string\" &&\n typeof arg.Token === \"string\" &&\n typeof arg.Expiration === \"string\";\nconst fromImdsCredentials = (creds) => ({\n accessKeyId: creds.AccessKeyId,\n secretAccessKey: creds.SecretAccessKey,\n sessionToken: creds.Token,\n expiration: new Date(creds.Expiration),\n ...(creds.AccountId && { accountId: creds.AccountId }),\n});\n\nconst DEFAULT_TIMEOUT = 1000;\nconst DEFAULT_MAX_RETRIES = 0;\nconst providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT, }) => ({ maxRetries, timeout });\n\nconst retry = (toRetry, maxRetries) => {\n let promise = toRetry();\n for (let i = 0; i < maxRetries; i++) {\n promise = promise.catch(toRetry);\n }\n return promise;\n};\n\nconst ENV_CMDS_FULL_URI = \"AWS_CONTAINER_CREDENTIALS_FULL_URI\";\nconst ENV_CMDS_RELATIVE_URI = \"AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\";\nconst ENV_CMDS_AUTH_TOKEN = \"AWS_CONTAINER_AUTHORIZATION_TOKEN\";\nconst fromContainerMetadata = (init = {}) => {\n const { timeout, maxRetries } = providerConfigFromInit(init);\n return () => retry(async () => {\n const requestOptions = await getCmdsUri({ logger: init.logger });\n const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));\n if (!isImdsCredentials(credsResponse)) {\n throw new propertyProvider.CredentialsProviderError(\"Invalid response received from instance metadata service.\", {\n logger: init.logger,\n });\n }\n return fromImdsCredentials(credsResponse);\n }, maxRetries);\n};\nconst requestFromEcsImds = async (timeout, options) => {\n if (process.env[ENV_CMDS_AUTH_TOKEN]) {\n options.headers = {\n ...options.headers,\n Authorization: process.env[ENV_CMDS_AUTH_TOKEN],\n };\n }\n const buffer = await httpRequest({\n ...options,\n timeout,\n });\n return buffer.toString();\n};\nconst CMDS_IP = \"169.254.170.2\";\nconst GREENGRASS_HOSTS = {\n localhost: true,\n \"127.0.0.1\": true,\n};\nconst GREENGRASS_PROTOCOLS = {\n \"http:\": true,\n \"https:\": true,\n};\nconst getCmdsUri = async ({ logger }) => {\n if (process.env[ENV_CMDS_RELATIVE_URI]) {\n return {\n hostname: CMDS_IP,\n path: process.env[ENV_CMDS_RELATIVE_URI],\n };\n }\n if (process.env[ENV_CMDS_FULL_URI]) {\n const parsed = url.parse(process.env[ENV_CMDS_FULL_URI]);\n if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {\n throw new propertyProvider.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {\n tryNextLink: false,\n logger,\n });\n }\n if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {\n throw new propertyProvider.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {\n tryNextLink: false,\n logger,\n });\n }\n return {\n ...parsed,\n port: parsed.port ? parseInt(parsed.port, 10) : undefined,\n };\n }\n throw new propertyProvider.CredentialsProviderError(\"The container metadata credential provider cannot be used unless\" +\n ` the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment` +\n \" variable is set\", {\n tryNextLink: false,\n logger,\n });\n};\n\nclass InstanceMetadataV1FallbackError extends propertyProvider.CredentialsProviderError {\n tryNextLink;\n name = \"InstanceMetadataV1FallbackError\";\n constructor(message, tryNextLink = true) {\n super(message, tryNextLink);\n this.tryNextLink = tryNextLink;\n Object.setPrototypeOf(this, InstanceMetadataV1FallbackError.prototype);\n }\n}\n\nexports.Endpoint = void 0;\n(function (Endpoint) {\n Endpoint[\"IPv4\"] = \"http://169.254.169.254\";\n Endpoint[\"IPv6\"] = \"http://[fd00:ec2::254]\";\n})(exports.Endpoint || (exports.Endpoint = {}));\n\nconst ENV_ENDPOINT_NAME = \"AWS_EC2_METADATA_SERVICE_ENDPOINT\";\nconst CONFIG_ENDPOINT_NAME = \"ec2_metadata_service_endpoint\";\nconst ENDPOINT_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME],\n configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME],\n default: undefined,\n};\n\nvar EndpointMode;\n(function (EndpointMode) {\n EndpointMode[\"IPv4\"] = \"IPv4\";\n EndpointMode[\"IPv6\"] = \"IPv6\";\n})(EndpointMode || (EndpointMode = {}));\n\nconst ENV_ENDPOINT_MODE_NAME = \"AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE\";\nconst CONFIG_ENDPOINT_MODE_NAME = \"ec2_metadata_service_endpoint_mode\";\nconst ENDPOINT_MODE_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME],\n configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME],\n default: EndpointMode.IPv4,\n};\n\nconst getInstanceMetadataEndpoint = async () => urlParser.parseUrl((await getFromEndpointConfig()) || (await getFromEndpointModeConfig()));\nconst getFromEndpointConfig = async () => nodeConfigProvider.loadConfig(ENDPOINT_CONFIG_OPTIONS)();\nconst getFromEndpointModeConfig = async () => {\n const endpointMode = await nodeConfigProvider.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();\n switch (endpointMode) {\n case EndpointMode.IPv4:\n return exports.Endpoint.IPv4;\n case EndpointMode.IPv6:\n return exports.Endpoint.IPv6;\n default:\n throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode)}`);\n }\n};\n\nconst STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;\nconst STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;\nconst STATIC_STABILITY_DOC_URL = \"https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html\";\nconst getExtendedInstanceMetadataCredentials = (credentials, logger) => {\n const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS +\n Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);\n const newExpiration = new Date(Date.now() + refreshInterval * 1000);\n logger.warn(\"Attempting credential expiration extension due to a credential service availability issue. A refresh of these \" +\n `credentials will be attempted after ${new Date(newExpiration)}.\\nFor more information, please visit: ` +\n STATIC_STABILITY_DOC_URL);\n const originalExpiration = credentials.originalExpiration ?? credentials.expiration;\n return {\n ...credentials,\n ...(originalExpiration ? { originalExpiration } : {}),\n expiration: newExpiration,\n };\n};\n\nconst staticStabilityProvider = (provider, options = {}) => {\n const logger = options?.logger || console;\n let pastCredentials;\n return async () => {\n let credentials;\n try {\n credentials = await provider();\n if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {\n credentials = getExtendedInstanceMetadataCredentials(credentials, logger);\n }\n }\n catch (e) {\n if (pastCredentials) {\n logger.warn(\"Credential renew failed: \", e);\n credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger);\n }\n else {\n throw e;\n }\n }\n pastCredentials = credentials;\n return credentials;\n };\n};\n\nconst IMDS_PATH = \"/latest/meta-data/iam/security-credentials/\";\nconst IMDS_TOKEN_PATH = \"/latest/api/token\";\nconst AWS_EC2_METADATA_V1_DISABLED = \"AWS_EC2_METADATA_V1_DISABLED\";\nconst PROFILE_AWS_EC2_METADATA_V1_DISABLED = \"ec2_metadata_v1_disabled\";\nconst X_AWS_EC2_METADATA_TOKEN = \"x-aws-ec2-metadata-token\";\nconst fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger });\nconst getInstanceMetadataProvider = (init = {}) => {\n let disableFetchToken = false;\n const { logger, profile } = init;\n const { timeout, maxRetries } = providerConfigFromInit(init);\n const getCredentials = async (maxRetries, options) => {\n const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;\n if (isImdsV1Fallback) {\n let fallbackBlockedFromProfile = false;\n let fallbackBlockedFromProcessEnv = false;\n const configValue = await nodeConfigProvider.loadConfig({\n environmentVariableSelector: (env) => {\n const envValue = env[AWS_EC2_METADATA_V1_DISABLED];\n fallbackBlockedFromProcessEnv = !!envValue && envValue !== \"false\";\n if (envValue === undefined) {\n throw new propertyProvider.CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger });\n }\n return fallbackBlockedFromProcessEnv;\n },\n configFileSelector: (profile) => {\n const profileValue = profile[PROFILE_AWS_EC2_METADATA_V1_DISABLED];\n fallbackBlockedFromProfile = !!profileValue && profileValue !== \"false\";\n return fallbackBlockedFromProfile;\n },\n default: false,\n }, {\n profile,\n })();\n if (init.ec2MetadataV1Disabled || configValue) {\n const causes = [];\n if (init.ec2MetadataV1Disabled)\n causes.push(\"credential provider initialization (runtime option ec2MetadataV1Disabled)\");\n if (fallbackBlockedFromProfile)\n causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);\n if (fallbackBlockedFromProcessEnv)\n causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);\n throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(\", \")}].`);\n }\n }\n const imdsProfile = (await retry(async () => {\n let profile;\n try {\n profile = await getProfile(options);\n }\n catch (err) {\n if (err.statusCode === 401) {\n disableFetchToken = false;\n }\n throw err;\n }\n return profile;\n }, maxRetries)).trim();\n return retry(async () => {\n let creds;\n try {\n creds = await getCredentialsFromProfile(imdsProfile, options, init);\n }\n catch (err) {\n if (err.statusCode === 401) {\n disableFetchToken = false;\n }\n throw err;\n }\n return creds;\n }, maxRetries);\n };\n return async () => {\n const endpoint = await getInstanceMetadataEndpoint();\n if (disableFetchToken) {\n logger?.debug(\"AWS SDK Instance Metadata\", \"using v1 fallback (no token fetch)\");\n return getCredentials(maxRetries, { ...endpoint, timeout });\n }\n else {\n let token;\n try {\n token = (await getMetadataToken({ ...endpoint, timeout })).toString();\n }\n catch (error) {\n if (error?.statusCode === 400) {\n throw Object.assign(error, {\n message: \"EC2 Metadata token request returned error\",\n });\n }\n else if (error.message === \"TimeoutError\" || [403, 404, 405].includes(error.statusCode)) {\n disableFetchToken = true;\n }\n logger?.debug(\"AWS SDK Instance Metadata\", \"using v1 fallback (initial)\");\n return getCredentials(maxRetries, { ...endpoint, timeout });\n }\n return getCredentials(maxRetries, {\n ...endpoint,\n headers: {\n [X_AWS_EC2_METADATA_TOKEN]: token,\n },\n timeout,\n });\n }\n };\n};\nconst getMetadataToken = async (options) => httpRequest({\n ...options,\n path: IMDS_TOKEN_PATH,\n method: \"PUT\",\n headers: {\n \"x-aws-ec2-metadata-token-ttl-seconds\": \"21600\",\n },\n});\nconst getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString();\nconst getCredentialsFromProfile = async (profile, options, init) => {\n const credentialsResponse = JSON.parse((await httpRequest({\n ...options,\n path: IMDS_PATH + profile,\n })).toString());\n if (!isImdsCredentials(credentialsResponse)) {\n throw new propertyProvider.CredentialsProviderError(\"Invalid response received from instance metadata service.\", {\n logger: init.logger,\n });\n }\n return fromImdsCredentials(credentialsResponse);\n};\n\nexports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES;\nexports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;\nexports.ENV_CMDS_AUTH_TOKEN = ENV_CMDS_AUTH_TOKEN;\nexports.ENV_CMDS_FULL_URI = ENV_CMDS_FULL_URI;\nexports.ENV_CMDS_RELATIVE_URI = ENV_CMDS_RELATIVE_URI;\nexports.fromContainerMetadata = fromContainerMetadata;\nexports.fromInstanceMetadata = fromInstanceMetadata;\nexports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint;\nexports.httpRequest = httpRequest;\nexports.providerConfigFromInit = providerConfigFromInit;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkUrl = void 0;\nconst property_provider_1 = require(\"@smithy/property-provider\");\nconst LOOPBACK_CIDR_IPv4 = \"127.0.0.0/8\";\nconst LOOPBACK_CIDR_IPv6 = \"::1/128\";\nconst ECS_CONTAINER_HOST = \"169.254.170.2\";\nconst EKS_CONTAINER_HOST_IPv4 = \"169.254.170.23\";\nconst EKS_CONTAINER_HOST_IPv6 = \"[fd00:ec2::23]\";\nconst checkUrl = (url, logger) => {\n if (url.protocol === \"https:\") {\n return;\n }\n if (url.hostname === ECS_CONTAINER_HOST ||\n url.hostname === EKS_CONTAINER_HOST_IPv4 ||\n url.hostname === EKS_CONTAINER_HOST_IPv6) {\n return;\n }\n if (url.hostname.includes(\"[\")) {\n if (url.hostname === \"[::1]\" || url.hostname === \"[0000:0000:0000:0000:0000:0000:0000:0001]\") {\n return;\n }\n }\n else {\n if (url.hostname === \"localhost\") {\n return;\n }\n const ipComponents = url.hostname.split(\".\");\n const inRange = (component) => {\n const num = parseInt(component, 10);\n return 0 <= num && num <= 255;\n };\n if (ipComponents[0] === \"127\" &&\n inRange(ipComponents[1]) &&\n inRange(ipComponents[2]) &&\n inRange(ipComponents[3]) &&\n ipComponents.length === 4) {\n return;\n }\n }\n throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:\n - loopback CIDR 127.0.0.0/8 or [::1/128]\n - ECS container host 169.254.170.2\n - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger });\n};\nexports.checkUrl = checkUrl;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createGetRequest = createGetRequest;\nexports.getCredentials = getCredentials;\nconst property_provider_1 = require(\"@smithy/property-provider\");\nconst protocol_http_1 = require(\"@smithy/protocol-http\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_stream_1 = require(\"@smithy/util-stream\");\nfunction createGetRequest(url) {\n return new protocol_http_1.HttpRequest({\n protocol: url.protocol,\n hostname: url.hostname,\n port: Number(url.port),\n path: url.pathname,\n query: Array.from(url.searchParams.entries()).reduce((acc, [k, v]) => {\n acc[k] = v;\n return acc;\n }, {}),\n fragment: url.hash,\n });\n}\nasync function getCredentials(response, logger) {\n const stream = (0, util_stream_1.sdkStreamMixin)(response.body);\n const str = await stream.transformToString();\n if (response.statusCode === 200) {\n const parsed = JSON.parse(str);\n if (typeof parsed.AccessKeyId !== \"string\" ||\n typeof parsed.SecretAccessKey !== \"string\" ||\n typeof parsed.Token !== \"string\" ||\n typeof parsed.Expiration !== \"string\") {\n throw new property_provider_1.CredentialsProviderError(\"HTTP credential provider response not of the required format, an object matching: \" +\n \"{ AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }\", { logger });\n }\n return {\n accessKeyId: parsed.AccessKeyId,\n secretAccessKey: parsed.SecretAccessKey,\n sessionToken: parsed.Token,\n expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration),\n };\n }\n if (response.statusCode >= 400 && response.statusCode < 500) {\n let parsedBody = {};\n try {\n parsedBody = JSON.parse(str);\n }\n catch (e) { }\n throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }), {\n Code: parsedBody.Code,\n Message: parsedBody.Message,\n });\n }\n throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger });\n}\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.retryWrapper = void 0;\nconst retryWrapper = (toRetry, maxRetries, delayMs) => {\n return async () => {\n for (let i = 0; i < maxRetries; ++i) {\n try {\n return await toRetry();\n }\n catch (e) {\n await new Promise((resolve) => setTimeout(resolve, delayMs));\n }\n }\n return await toRetry();\n };\n};\nexports.retryWrapper = retryWrapper;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromHttp = void 0;\nconst tslib_1 = require(\"tslib\");\nconst client_1 = require(\"@aws-sdk/core/client\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst property_provider_1 = require(\"@smithy/property-provider\");\nconst promises_1 = tslib_1.__importDefault(require(\"fs/promises\"));\nconst checkUrl_1 = require(\"./checkUrl\");\nconst requestHelpers_1 = require(\"./requestHelpers\");\nconst retry_wrapper_1 = require(\"./retry-wrapper\");\nconst AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = \"AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\";\nconst DEFAULT_LINK_LOCAL_HOST = \"http://169.254.170.2\";\nconst AWS_CONTAINER_CREDENTIALS_FULL_URI = \"AWS_CONTAINER_CREDENTIALS_FULL_URI\";\nconst AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = \"AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE\";\nconst AWS_CONTAINER_AUTHORIZATION_TOKEN = \"AWS_CONTAINER_AUTHORIZATION_TOKEN\";\nconst fromHttp = (options = {}) => {\n options.logger?.debug(\"@aws-sdk/credential-provider-http - fromHttp\");\n let host;\n const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];\n const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];\n const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];\n const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];\n const warn = options.logger?.constructor?.name === \"NoOpLogger\" || !options.logger?.warn\n ? console.warn\n : options.logger.warn.bind(options.logger);\n if (relative && full) {\n warn(\"@aws-sdk/credential-provider-http: \" +\n \"you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.\");\n warn(\"awsContainerCredentialsFullUri will take precedence.\");\n }\n if (token && tokenFile) {\n warn(\"@aws-sdk/credential-provider-http: \" +\n \"you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.\");\n warn(\"awsContainerAuthorizationToken will take precedence.\");\n }\n if (full) {\n host = full;\n }\n else if (relative) {\n host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`;\n }\n else {\n throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided.\nSet AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });\n }\n const url = new URL(host);\n (0, checkUrl_1.checkUrl)(url, options.logger);\n const requestHandler = node_http_handler_1.NodeHttpHandler.create({\n requestTimeout: options.timeout ?? 1000,\n connectionTimeout: options.timeout ?? 1000,\n });\n return (0, retry_wrapper_1.retryWrapper)(async () => {\n const request = (0, requestHelpers_1.createGetRequest)(url);\n if (token) {\n request.headers.Authorization = token;\n }\n else if (tokenFile) {\n request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString();\n }\n try {\n const result = await requestHandler.handle(request);\n return (0, requestHelpers_1.getCredentials)(result.response).then((creds) => (0, client_1.setCredentialFeature)(creds, \"CREDENTIALS_HTTP\", \"z\"));\n }\n catch (e) {\n throw new property_provider_1.CredentialsProviderError(String(e), { logger: options.logger });\n }\n }, options.maxRetries ?? 3, options.timeout ?? 1000);\n};\nexports.fromHttp = fromHttp;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromHttp = void 0;\nvar fromHttp_1 = require(\"./fromHttp/fromHttp\");\nObject.defineProperty(exports, \"fromHttp\", { enumerable: true, get: function () { return fromHttp_1.fromHttp; } });\n", - "'use strict';\n\nvar protocolHttp = require('@smithy/protocol-http');\nvar core = require('@smithy/core');\nvar propertyProvider = require('@smithy/property-provider');\nvar client = require('@aws-sdk/core/client');\nvar signatureV4 = require('@smithy/signature-v4');\n\nconst getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;\n\nconst getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);\n\nconst isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000;\n\nconst getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => {\n const clockTimeInMs = Date.parse(clockTime);\n if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {\n return clockTimeInMs - Date.now();\n }\n return currentSystemClockOffset;\n};\n\nconst throwSigningPropertyError = (name, property) => {\n if (!property) {\n throw new Error(`Property \\`${name}\\` is not resolved for AWS SDK SigV4Auth`);\n }\n return property;\n};\nconst validateSigningProperties = async (signingProperties) => {\n const context = throwSigningPropertyError(\"context\", signingProperties.context);\n const config = throwSigningPropertyError(\"config\", signingProperties.config);\n const authScheme = context.endpointV2?.properties?.authSchemes?.[0];\n const signerFunction = throwSigningPropertyError(\"signer\", config.signer);\n const signer = await signerFunction(authScheme);\n const signingRegion = signingProperties?.signingRegion;\n const signingRegionSet = signingProperties?.signingRegionSet;\n const signingName = signingProperties?.signingName;\n return {\n config,\n signer,\n signingRegion,\n signingRegionSet,\n signingName,\n };\n};\nclass AwsSdkSigV4Signer {\n async sign(httpRequest, identity, signingProperties) {\n if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {\n throw new Error(\"The request is not an instance of `HttpRequest` and cannot be signed\");\n }\n const validatedProps = await validateSigningProperties(signingProperties);\n const { config, signer } = validatedProps;\n let { signingRegion, signingName } = validatedProps;\n const handlerExecutionContext = signingProperties.context;\n if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {\n const [first, second] = handlerExecutionContext.authSchemes;\n if (first?.name === \"sigv4a\" && second?.name === \"sigv4\") {\n signingRegion = second?.signingRegion ?? signingRegion;\n signingName = second?.signingName ?? signingName;\n }\n }\n const signedRequest = await signer.sign(httpRequest, {\n signingDate: getSkewCorrectedDate(config.systemClockOffset),\n signingRegion: signingRegion,\n signingService: signingName,\n });\n return signedRequest;\n }\n errorHandler(signingProperties) {\n return (error) => {\n const serverTime = error.ServerTime ?? getDateHeader(error.$response);\n if (serverTime) {\n const config = throwSigningPropertyError(\"config\", signingProperties.config);\n const initialSystemClockOffset = config.systemClockOffset;\n config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);\n const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;\n if (clockSkewCorrected && error.$metadata) {\n error.$metadata.clockSkewCorrected = true;\n }\n }\n throw error;\n };\n }\n successHandler(httpResponse, signingProperties) {\n const dateHeader = getDateHeader(httpResponse);\n if (dateHeader) {\n const config = throwSigningPropertyError(\"config\", signingProperties.config);\n config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);\n }\n }\n}\nconst AWSSDKSigV4Signer = AwsSdkSigV4Signer;\n\nclass AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {\n async sign(httpRequest, identity, signingProperties) {\n if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {\n throw new Error(\"The request is not an instance of `HttpRequest` and cannot be signed\");\n }\n const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);\n const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();\n const multiRegionOverride = (configResolvedSigningRegionSet ??\n signingRegionSet ?? [signingRegion]).join(\",\");\n const signedRequest = await signer.sign(httpRequest, {\n signingDate: getSkewCorrectedDate(config.systemClockOffset),\n signingRegion: multiRegionOverride,\n signingService: signingName,\n });\n return signedRequest;\n }\n}\n\nconst getArrayForCommaSeparatedString = (str) => typeof str === \"string\" && str.length > 0 ? str.split(\",\").map((item) => item.trim()) : [];\n\nconst getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\\s-]/g, \"_\").toUpperCase()}`;\n\nconst NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = \"AWS_AUTH_SCHEME_PREFERENCE\";\nconst NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = \"auth_scheme_preference\";\nconst NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {\n environmentVariableSelector: (env, options) => {\n if (options?.signingName) {\n const bearerTokenKey = getBearerTokenEnvKey(options.signingName);\n if (bearerTokenKey in env)\n return [\"httpBearerAuth\"];\n }\n if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env))\n return undefined;\n return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);\n },\n configFileSelector: (profile) => {\n if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile))\n return undefined;\n return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);\n },\n default: [],\n};\n\nconst resolveAwsSdkSigV4AConfig = (config) => {\n config.sigv4aSigningRegionSet = core.normalizeProvider(config.sigv4aSigningRegionSet);\n return config;\n};\nconst NODE_SIGV4A_CONFIG_OPTIONS = {\n environmentVariableSelector(env) {\n if (env.AWS_SIGV4A_SIGNING_REGION_SET) {\n return env.AWS_SIGV4A_SIGNING_REGION_SET.split(\",\").map((_) => _.trim());\n }\n throw new propertyProvider.ProviderError(\"AWS_SIGV4A_SIGNING_REGION_SET not set in env.\", {\n tryNextLink: true,\n });\n },\n configFileSelector(profile) {\n if (profile.sigv4a_signing_region_set) {\n return (profile.sigv4a_signing_region_set ?? \"\").split(\",\").map((_) => _.trim());\n }\n throw new propertyProvider.ProviderError(\"sigv4a_signing_region_set not set in profile.\", {\n tryNextLink: true,\n });\n },\n default: undefined,\n};\n\nconst resolveAwsSdkSigV4Config = (config) => {\n let inputCredentials = config.credentials;\n let isUserSupplied = !!config.credentials;\n let resolvedCredentials = undefined;\n Object.defineProperty(config, \"credentials\", {\n set(credentials) {\n if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) {\n isUserSupplied = true;\n }\n inputCredentials = credentials;\n const memoizedProvider = normalizeCredentialProvider(config, {\n credentials: inputCredentials,\n credentialDefaultProvider: config.credentialDefaultProvider,\n });\n const boundProvider = bindCallerConfig(config, memoizedProvider);\n if (isUserSupplied && !boundProvider.attributed) {\n resolvedCredentials = async (options) => boundProvider(options).then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_CODE\", \"e\"));\n resolvedCredentials.memoized = boundProvider.memoized;\n resolvedCredentials.configBound = boundProvider.configBound;\n resolvedCredentials.attributed = true;\n }\n else {\n resolvedCredentials = boundProvider;\n }\n },\n get() {\n return resolvedCredentials;\n },\n enumerable: true,\n configurable: true,\n });\n config.credentials = inputCredentials;\n const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config;\n let signer;\n if (config.signer) {\n signer = core.normalizeProvider(config.signer);\n }\n else if (config.regionInfoProvider) {\n signer = () => core.normalizeProvider(config.region)()\n .then(async (region) => [\n (await config.regionInfoProvider(region, {\n useFipsEndpoint: await config.useFipsEndpoint(),\n useDualstackEndpoint: await config.useDualstackEndpoint(),\n })) || {},\n region,\n ])\n .then(([regionInfo, region]) => {\n const { signingRegion, signingService } = regionInfo;\n config.signingRegion = config.signingRegion || signingRegion || region;\n config.signingName = config.signingName || signingService || config.serviceId;\n const params = {\n ...config,\n credentials: config.credentials,\n region: config.signingRegion,\n service: config.signingName,\n sha256,\n uriEscapePath: signingEscapePath,\n };\n const SignerCtor = config.signerConstructor || signatureV4.SignatureV4;\n return new SignerCtor(params);\n });\n }\n else {\n signer = async (authScheme) => {\n authScheme = Object.assign({}, {\n name: \"sigv4\",\n signingName: config.signingName || config.defaultSigningName,\n signingRegion: await core.normalizeProvider(config.region)(),\n properties: {},\n }, authScheme);\n const signingRegion = authScheme.signingRegion;\n const signingService = authScheme.signingName;\n config.signingRegion = config.signingRegion || signingRegion;\n config.signingName = config.signingName || signingService || config.serviceId;\n const params = {\n ...config,\n credentials: config.credentials,\n region: config.signingRegion,\n service: config.signingName,\n sha256,\n uriEscapePath: signingEscapePath,\n };\n const SignerCtor = config.signerConstructor || signatureV4.SignatureV4;\n return new SignerCtor(params);\n };\n }\n const resolvedConfig = Object.assign(config, {\n systemClockOffset,\n signingEscapePath,\n signer,\n });\n return resolvedConfig;\n};\nconst resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;\nfunction normalizeCredentialProvider(config, { credentials, credentialDefaultProvider, }) {\n let credentialsProvider;\n if (credentials) {\n if (!credentials?.memoized) {\n credentialsProvider = core.memoizeIdentityProvider(credentials, core.isIdentityExpired, core.doesIdentityRequireRefresh);\n }\n else {\n credentialsProvider = credentials;\n }\n }\n else {\n if (credentialDefaultProvider) {\n credentialsProvider = core.normalizeProvider(credentialDefaultProvider(Object.assign({}, config, {\n parentClientConfig: config,\n })));\n }\n else {\n credentialsProvider = async () => {\n throw new Error(\"@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.\");\n };\n }\n }\n credentialsProvider.memoized = true;\n return credentialsProvider;\n}\nfunction bindCallerConfig(config, credentialsProvider) {\n if (credentialsProvider.configBound) {\n return credentialsProvider;\n }\n const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config });\n fn.memoized = credentialsProvider.memoized;\n fn.configBound = true;\n return fn;\n}\n\nexports.AWSSDKSigV4Signer = AWSSDKSigV4Signer;\nexports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner;\nexports.AwsSdkSigV4Signer = AwsSdkSigV4Signer;\nexports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS;\nexports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS;\nexports.getBearerTokenEnvKey = getBearerTokenEnvKey;\nexports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config;\nexports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig;\nexports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config;\nexports.validateSigningProperties = validateSigningProperties;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultSSOOIDCHttpAuthSchemeProvider = exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultSSOOIDCHttpAuthSchemeParametersProvider = defaultSSOOIDCHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"sso-oauth\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"CreateToken\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultSSOOIDCHttpAuthSchemeProvider = defaultSSOOIDCHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", - "'use strict';\n\nvar os = require('os');\nvar process = require('process');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\n\nconst crtAvailability = {\n isCrtAvailable: false,\n};\n\nconst isCrtAvailable = () => {\n if (crtAvailability.isCrtAvailable) {\n return [\"md/crt-avail\"];\n }\n return null;\n};\n\nconst createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {\n return async (config) => {\n const sections = [\n [\"aws-sdk-js\", clientVersion],\n [\"ua\", \"2.1\"],\n [`os/${os.platform()}`, os.release()],\n [\"lang/js\"],\n [\"md/nodejs\", `${process.versions.node}`],\n ];\n const crtAvailable = isCrtAvailable();\n if (crtAvailable) {\n sections.push(crtAvailable);\n }\n if (serviceId) {\n sections.push([`api/${serviceId}`, clientVersion]);\n }\n if (process.env.AWS_EXECUTION_ENV) {\n sections.push([`exec-env/${process.env.AWS_EXECUTION_ENV}`]);\n }\n const appId = await config?.userAgentAppId?.();\n const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];\n return resolvedUserAgent;\n };\n};\nconst defaultUserAgent = createDefaultUserAgentProvider;\n\nconst UA_APP_ID_ENV_NAME = \"AWS_SDK_UA_APP_ID\";\nconst UA_APP_ID_INI_NAME = \"sdk_ua_app_id\";\nconst UA_APP_ID_INI_NAME_DEPRECATED = \"sdk-ua-app-id\";\nconst NODE_APP_ID_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME],\n configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED],\n default: middlewareUserAgent.DEFAULT_UA_APP_ID,\n};\n\nexports.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS;\nexports.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME;\nexports.UA_APP_ID_INI_NAME = UA_APP_ID_INI_NAME;\nexports.createDefaultUserAgentProvider = createDefaultUserAgentProvider;\nexports.crtAvailability = crtAvailability;\nexports.defaultUserAgent = defaultUserAgent;\n", - "'use strict';\n\nvar utilBufferFrom = require('@smithy/util-buffer-from');\nvar utilUtf8 = require('@smithy/util-utf8');\nvar buffer = require('buffer');\nvar crypto = require('crypto');\n\nclass Hash {\n algorithmIdentifier;\n secret;\n hash;\n constructor(algorithmIdentifier, secret) {\n this.algorithmIdentifier = algorithmIdentifier;\n this.secret = secret;\n this.reset();\n }\n update(toHash, encoding) {\n this.hash.update(utilUtf8.toUint8Array(castSourceData(toHash, encoding)));\n }\n digest() {\n return Promise.resolve(this.hash.digest());\n }\n reset() {\n this.hash = this.secret\n ? crypto.createHmac(this.algorithmIdentifier, castSourceData(this.secret))\n : crypto.createHash(this.algorithmIdentifier);\n }\n}\nfunction castSourceData(toCast, encoding) {\n if (buffer.Buffer.isBuffer(toCast)) {\n return toCast;\n }\n if (typeof toCast === \"string\") {\n return utilBufferFrom.fromString(toCast, encoding);\n }\n if (ArrayBuffer.isView(toCast)) {\n return utilBufferFrom.fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);\n }\n return utilBufferFrom.fromArrayBuffer(toCast);\n}\n\nexports.Hash = Hash;\n", - "'use strict';\n\nvar node_fs = require('node:fs');\n\nconst calculateBodyLength = (body) => {\n if (!body) {\n return 0;\n }\n if (typeof body === \"string\") {\n return Buffer.byteLength(body);\n }\n else if (typeof body.byteLength === \"number\") {\n return body.byteLength;\n }\n else if (typeof body.size === \"number\") {\n return body.size;\n }\n else if (typeof body.start === \"number\" && typeof body.end === \"number\") {\n return body.end + 1 - body.start;\n }\n else if (body instanceof node_fs.ReadStream) {\n if (body.path != null) {\n return node_fs.lstatSync(body.path).size;\n }\n else if (typeof body.fd === \"number\") {\n return node_fs.fstatSync(body.fd).size;\n }\n }\n throw new Error(`Body Length computation failed for ${body}`);\n};\n\nexports.calculateBodyLength = calculateBodyLength;\n", - "'use strict';\n\nvar cbor = require('@smithy/core/cbor');\nvar schema = require('@smithy/core/schema');\nvar smithyClient = require('@smithy/smithy-client');\nvar protocols = require('@smithy/core/protocols');\nvar serde = require('@smithy/core/serde');\nvar utilBase64 = require('@smithy/util-base64');\nvar utilUtf8 = require('@smithy/util-utf8');\nvar xmlBuilder = require('@aws-sdk/xml-builder');\n\nclass ProtocolLib {\n queryCompat;\n constructor(queryCompat = false) {\n this.queryCompat = queryCompat;\n }\n resolveRestContentType(defaultContentType, inputSchema) {\n const members = inputSchema.getMemberSchemas();\n const httpPayloadMember = Object.values(members).find((m) => {\n return !!m.getMergedTraits().httpPayload;\n });\n if (httpPayloadMember) {\n const mediaType = httpPayloadMember.getMergedTraits().mediaType;\n if (mediaType) {\n return mediaType;\n }\n else if (httpPayloadMember.isStringSchema()) {\n return \"text/plain\";\n }\n else if (httpPayloadMember.isBlobSchema()) {\n return \"application/octet-stream\";\n }\n else {\n return defaultContentType;\n }\n }\n else if (!inputSchema.isUnitSchema()) {\n const hasBody = Object.values(members).find((m) => {\n const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m.getMergedTraits();\n const noPrefixHeaders = httpPrefixHeaders === void 0;\n return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders;\n });\n if (hasBody) {\n return defaultContentType;\n }\n }\n }\n async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) {\n let namespace = defaultNamespace;\n let errorName = errorIdentifier;\n if (errorIdentifier.includes(\"#\")) {\n [namespace, errorName] = errorIdentifier.split(\"#\");\n }\n const errorMetadata = {\n $metadata: metadata,\n $fault: response.statusCode < 500 ? \"client\" : \"server\",\n };\n const registry = schema.TypeRegistry.for(namespace);\n try {\n const errorSchema = getErrorSchema?.(registry, errorName) ?? registry.getSchema(errorIdentifier);\n return { errorSchema, errorMetadata };\n }\n catch (e) {\n dataObject.message = dataObject.message ?? dataObject.Message ?? \"UnknownError\";\n const synthetic = schema.TypeRegistry.for(\"smithy.ts.sdk.synthetic.\" + namespace);\n const baseExceptionSchema = synthetic.getBaseException();\n if (baseExceptionSchema) {\n const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;\n throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject);\n }\n throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject);\n }\n }\n decorateServiceException(exception, additions = {}) {\n if (this.queryCompat) {\n const msg = exception.Message ?? additions.Message;\n const error = smithyClient.decorateServiceException(exception, additions);\n if (msg) {\n error.Message = msg;\n error.message = msg;\n }\n return error;\n }\n return smithyClient.decorateServiceException(exception, additions);\n }\n setQueryCompatError(output, response) {\n const queryErrorHeader = response.headers?.[\"x-amzn-query-error\"];\n if (output !== undefined && queryErrorHeader != null) {\n const [Code, Type] = queryErrorHeader.split(\";\");\n const entries = Object.entries(output);\n const Error = {\n Code,\n Type,\n };\n Object.assign(output, Error);\n for (const [k, v] of entries) {\n Error[k] = v;\n }\n delete Error.__type;\n output.Error = Error;\n }\n }\n queryCompatOutput(queryCompatErrorData, errorData) {\n if (queryCompatErrorData.Error) {\n errorData.Error = queryCompatErrorData.Error;\n }\n if (queryCompatErrorData.Type) {\n errorData.Type = queryCompatErrorData.Type;\n }\n if (queryCompatErrorData.Code) {\n errorData.Code = queryCompatErrorData.Code;\n }\n }\n}\n\nclass AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol {\n awsQueryCompatible;\n mixin;\n constructor({ defaultNamespace, awsQueryCompatible, }) {\n super({ defaultNamespace });\n this.awsQueryCompatible = !!awsQueryCompatible;\n this.mixin = new ProtocolLib(this.awsQueryCompatible);\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n if (this.awsQueryCompatible) {\n request.headers[\"x-amzn-query-mode\"] = \"true\";\n }\n return request;\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n if (this.awsQueryCompatible) {\n this.mixin.setQueryCompatError(dataObject, response);\n }\n const errorName = cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? \"Unknown\";\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata);\n const ns = schema.NormalizedSchema.of(errorSchema);\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n output[name] = this.deserializer.readValue(member, dataObject[name]);\n }\n if (this.awsQueryCompatible) {\n this.mixin.queryCompatOutput(dataObject, output);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n}\n\nconst _toStr = (val) => {\n if (val == null) {\n return val;\n }\n if (typeof val === \"number\" || typeof val === \"bigint\") {\n const warning = new Error(`Received number ${val} where a string was expected.`);\n warning.name = \"Warning\";\n console.warn(warning);\n return String(val);\n }\n if (typeof val === \"boolean\") {\n const warning = new Error(`Received boolean ${val} where a string was expected.`);\n warning.name = \"Warning\";\n console.warn(warning);\n return String(val);\n }\n return val;\n};\nconst _toBool = (val) => {\n if (val == null) {\n return val;\n }\n if (typeof val === \"string\") {\n const lowercase = val.toLowerCase();\n if (val !== \"\" && lowercase !== \"false\" && lowercase !== \"true\") {\n const warning = new Error(`Received string \"${val}\" where a boolean was expected.`);\n warning.name = \"Warning\";\n console.warn(warning);\n }\n return val !== \"\" && lowercase !== \"false\";\n }\n return val;\n};\nconst _toNum = (val) => {\n if (val == null) {\n return val;\n }\n if (typeof val === \"string\") {\n const num = Number(val);\n if (num.toString() !== val) {\n const warning = new Error(`Received string \"${val}\" where a number was expected.`);\n warning.name = \"Warning\";\n console.warn(warning);\n return val;\n }\n return num;\n }\n return val;\n};\n\nclass SerdeContextConfig {\n serdeContext;\n setSerdeContext(serdeContext) {\n this.serdeContext = serdeContext;\n }\n}\n\nfunction jsonReviver(key, value, context) {\n if (context?.source) {\n const numericString = context.source;\n if (typeof value === \"number\") {\n if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) {\n const isFractional = numericString.includes(\".\");\n if (isFractional) {\n return new serde.NumericValue(numericString, \"bigDecimal\");\n }\n else {\n return BigInt(numericString);\n }\n }\n }\n }\n return value;\n}\n\nconst collectBodyString = (streamBody, context) => smithyClient.collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? utilUtf8.toUtf8)(body));\n\nconst parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {\n if (encoded.length) {\n try {\n return JSON.parse(encoded);\n }\n catch (e) {\n if (e?.name === \"SyntaxError\") {\n Object.defineProperty(e, \"$responseBodyText\", {\n value: encoded,\n });\n }\n throw e;\n }\n }\n return {};\n});\nconst parseJsonErrorBody = async (errorBody, context) => {\n const value = await parseJsonBody(errorBody, context);\n value.message = value.message ?? value.Message;\n return value;\n};\nconst loadRestJsonErrorCode = (output, data) => {\n const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());\n const sanitizeErrorCode = (rawValue) => {\n let cleanValue = rawValue;\n if (typeof cleanValue === \"number\") {\n cleanValue = cleanValue.toString();\n }\n if (cleanValue.indexOf(\",\") >= 0) {\n cleanValue = cleanValue.split(\",\")[0];\n }\n if (cleanValue.indexOf(\":\") >= 0) {\n cleanValue = cleanValue.split(\":\")[0];\n }\n if (cleanValue.indexOf(\"#\") >= 0) {\n cleanValue = cleanValue.split(\"#\")[1];\n }\n return cleanValue;\n };\n const headerKey = findKey(output.headers, \"x-amzn-errortype\");\n if (headerKey !== undefined) {\n return sanitizeErrorCode(output.headers[headerKey]);\n }\n if (data && typeof data === \"object\") {\n const codeKey = findKey(data, \"code\");\n if (codeKey && data[codeKey] !== undefined) {\n return sanitizeErrorCode(data[codeKey]);\n }\n if (data[\"__type\"] !== undefined) {\n return sanitizeErrorCode(data[\"__type\"]);\n }\n }\n};\n\nclass JsonShapeDeserializer extends SerdeContextConfig {\n settings;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n async read(schema, data) {\n return this._read(schema, typeof data === \"string\" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext));\n }\n readObject(schema, data) {\n return this._read(schema, data);\n }\n _read(schema$1, value) {\n const isObject = value !== null && typeof value === \"object\";\n const ns = schema.NormalizedSchema.of(schema$1);\n if (ns.isListSchema() && Array.isArray(value)) {\n const listMember = ns.getValueSchema();\n const out = [];\n const sparse = !!ns.getMergedTraits().sparse;\n for (const item of value) {\n if (sparse || item != null) {\n out.push(this._read(listMember, item));\n }\n }\n return out;\n }\n else if (ns.isMapSchema() && isObject) {\n const mapMember = ns.getValueSchema();\n const out = {};\n const sparse = !!ns.getMergedTraits().sparse;\n for (const [_k, _v] of Object.entries(value)) {\n if (sparse || _v != null) {\n out[_k] = this._read(mapMember, _v);\n }\n }\n return out;\n }\n else if (ns.isStructSchema() && isObject) {\n const out = {};\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const fromKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;\n const deserializedValue = this._read(memberSchema, value[fromKey]);\n if (deserializedValue != null) {\n out[memberName] = deserializedValue;\n }\n }\n return out;\n }\n if (ns.isBlobSchema() && typeof value === \"string\") {\n return utilBase64.fromBase64(value);\n }\n const mediaType = ns.getMergedTraits().mediaType;\n if (ns.isStringSchema() && typeof value === \"string\" && mediaType) {\n const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n if (isJson) {\n return serde.LazyJsonString.from(value);\n }\n }\n if (ns.isTimestampSchema() && value != null) {\n const format = protocols.determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n return serde.parseRfc3339DateTimeWithOffset(value);\n case 6:\n return serde.parseRfc7231DateTime(value);\n case 7:\n return serde.parseEpochTimestamp(value);\n default:\n console.warn(\"Missing timestamp format, parsing value with Date constructor:\", value);\n return new Date(value);\n }\n }\n if (ns.isBigIntegerSchema() && (typeof value === \"number\" || typeof value === \"string\")) {\n return BigInt(value);\n }\n if (ns.isBigDecimalSchema() && value != undefined) {\n if (value instanceof serde.NumericValue) {\n return value;\n }\n const untyped = value;\n if (untyped.type === \"bigDecimal\" && \"string\" in untyped) {\n return new serde.NumericValue(untyped.string, untyped.type);\n }\n return new serde.NumericValue(String(value), \"bigDecimal\");\n }\n if (ns.isNumericSchema() && typeof value === \"string\") {\n switch (value) {\n case \"Infinity\":\n return Infinity;\n case \"-Infinity\":\n return -Infinity;\n case \"NaN\":\n return NaN;\n }\n }\n if (ns.isDocumentSchema()) {\n if (isObject) {\n const out = Array.isArray(value) ? [] : {};\n for (const [k, v] of Object.entries(value)) {\n if (v instanceof serde.NumericValue) {\n out[k] = v;\n }\n else {\n out[k] = this._read(ns, v);\n }\n }\n return out;\n }\n else {\n return structuredClone(value);\n }\n }\n return value;\n }\n}\n\nconst NUMERIC_CONTROL_CHAR = String.fromCharCode(925);\nclass JsonReplacer {\n values = new Map();\n counter = 0;\n stage = 0;\n createReplacer() {\n if (this.stage === 1) {\n throw new Error(\"@aws-sdk/core/protocols - JsonReplacer already created.\");\n }\n if (this.stage === 2) {\n throw new Error(\"@aws-sdk/core/protocols - JsonReplacer exhausted.\");\n }\n this.stage = 1;\n return (key, value) => {\n if (value instanceof serde.NumericValue) {\n const v = `${NUMERIC_CONTROL_CHAR + \"nv\" + this.counter++}_` + value.string;\n this.values.set(`\"${v}\"`, value.string);\n return v;\n }\n if (typeof value === \"bigint\") {\n const s = value.toString();\n const v = `${NUMERIC_CONTROL_CHAR + \"b\" + this.counter++}_` + s;\n this.values.set(`\"${v}\"`, s);\n return v;\n }\n return value;\n };\n }\n replaceInJson(json) {\n if (this.stage === 0) {\n throw new Error(\"@aws-sdk/core/protocols - JsonReplacer not created yet.\");\n }\n if (this.stage === 2) {\n throw new Error(\"@aws-sdk/core/protocols - JsonReplacer exhausted.\");\n }\n this.stage = 2;\n if (this.counter === 0) {\n return json;\n }\n for (const [key, value] of this.values) {\n json = json.replace(key, value);\n }\n return json;\n }\n}\n\nclass JsonShapeSerializer extends SerdeContextConfig {\n settings;\n buffer;\n rootSchema;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n write(schema$1, value) {\n this.rootSchema = schema.NormalizedSchema.of(schema$1);\n this.buffer = this._write(this.rootSchema, value);\n }\n writeDiscriminatedDocument(schema$1, value) {\n this.write(schema$1, value);\n if (typeof this.buffer === \"object\") {\n this.buffer.__type = schema.NormalizedSchema.of(schema$1).getName(true);\n }\n }\n flush() {\n const { rootSchema } = this;\n this.rootSchema = undefined;\n if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {\n const replacer = new JsonReplacer();\n return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));\n }\n return this.buffer;\n }\n _write(schema$1, value, container) {\n const isObject = value !== null && typeof value === \"object\";\n const ns = schema.NormalizedSchema.of(schema$1);\n if (ns.isListSchema() && Array.isArray(value)) {\n const listMember = ns.getValueSchema();\n const out = [];\n const sparse = !!ns.getMergedTraits().sparse;\n for (const item of value) {\n if (sparse || item != null) {\n out.push(this._write(listMember, item));\n }\n }\n return out;\n }\n else if (ns.isMapSchema() && isObject) {\n const mapMember = ns.getValueSchema();\n const out = {};\n const sparse = !!ns.getMergedTraits().sparse;\n for (const [_k, _v] of Object.entries(value)) {\n if (sparse || _v != null) {\n out[_k] = this._write(mapMember, _v);\n }\n }\n return out;\n }\n else if (ns.isStructSchema() && isObject) {\n const out = {};\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;\n const serializableValue = this._write(memberSchema, value[memberName], ns);\n if (serializableValue !== undefined) {\n out[targetKey] = serializableValue;\n }\n }\n return out;\n }\n if (value === null && container?.isStructSchema()) {\n return void 0;\n }\n if ((ns.isBlobSchema() && (value instanceof Uint8Array || typeof value === \"string\")) ||\n (ns.isDocumentSchema() && value instanceof Uint8Array)) {\n if (ns === this.rootSchema) {\n return value;\n }\n return (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);\n }\n if ((ns.isTimestampSchema() || ns.isDocumentSchema()) && value instanceof Date) {\n const format = protocols.determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n return value.toISOString().replace(\".000Z\", \"Z\");\n case 6:\n return serde.dateToUtcString(value);\n case 7:\n return value.getTime() / 1000;\n default:\n console.warn(\"Missing timestamp format, using epoch seconds\", value);\n return value.getTime() / 1000;\n }\n }\n if (ns.isNumericSchema() && typeof value === \"number\") {\n if (Math.abs(value) === Infinity || isNaN(value)) {\n return String(value);\n }\n }\n if (ns.isStringSchema()) {\n if (typeof value === \"undefined\" && ns.isIdempotencyToken()) {\n return serde.generateIdempotencyToken();\n }\n const mediaType = ns.getMergedTraits().mediaType;\n if (value != null && mediaType) {\n const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n if (isJson) {\n return serde.LazyJsonString.from(value);\n }\n }\n }\n if (ns.isDocumentSchema()) {\n if (isObject) {\n const out = Array.isArray(value) ? [] : {};\n for (const [k, v] of Object.entries(value)) {\n if (v instanceof serde.NumericValue) {\n out[k] = v;\n }\n else {\n out[k] = this._write(ns, v);\n }\n }\n return out;\n }\n else {\n return structuredClone(value);\n }\n }\n return value;\n }\n}\n\nclass JsonCodec extends SerdeContextConfig {\n settings;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n createSerializer() {\n const serializer = new JsonShapeSerializer(this.settings);\n serializer.setSerdeContext(this.serdeContext);\n return serializer;\n }\n createDeserializer() {\n const deserializer = new JsonShapeDeserializer(this.settings);\n deserializer.setSerdeContext(this.serdeContext);\n return deserializer;\n }\n}\n\nclass AwsJsonRpcProtocol extends protocols.RpcProtocol {\n serializer;\n deserializer;\n serviceTarget;\n codec;\n mixin;\n awsQueryCompatible;\n constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) {\n super({\n defaultNamespace,\n });\n this.serviceTarget = serviceTarget;\n this.codec = new JsonCodec({\n timestampFormat: {\n useTrait: true,\n default: 7,\n },\n jsonName: false,\n });\n this.serializer = this.codec.createSerializer();\n this.deserializer = this.codec.createDeserializer();\n this.awsQueryCompatible = !!awsQueryCompatible;\n this.mixin = new ProtocolLib(this.awsQueryCompatible);\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n if (!request.path.endsWith(\"/\")) {\n request.path += \"/\";\n }\n Object.assign(request.headers, {\n \"content-type\": `application/x-amz-json-${this.getJsonRpcVersion()}`,\n \"x-amz-target\": `${this.serviceTarget}.${operationSchema.name}`,\n });\n if (this.awsQueryCompatible) {\n request.headers[\"x-amzn-query-mode\"] = \"true\";\n }\n if (schema.deref(operationSchema.input) === \"unit\" || !request.body) {\n request.body = \"{}\";\n }\n return request;\n }\n getPayloadCodec() {\n return this.codec;\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n if (this.awsQueryCompatible) {\n this.mixin.setQueryCompatError(dataObject, response);\n }\n const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? \"Unknown\";\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);\n const ns = schema.NormalizedSchema.of(errorSchema);\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n const target = member.getMergedTraits().jsonName ?? name;\n output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]);\n }\n if (this.awsQueryCompatible) {\n this.mixin.queryCompatOutput(dataObject, output);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n}\n\nclass AwsJson1_0Protocol extends AwsJsonRpcProtocol {\n constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) {\n super({\n defaultNamespace,\n serviceTarget,\n awsQueryCompatible,\n });\n }\n getShapeId() {\n return \"aws.protocols#awsJson1_0\";\n }\n getJsonRpcVersion() {\n return \"1.0\";\n }\n getDefaultContentType() {\n return \"application/x-amz-json-1.0\";\n }\n}\n\nclass AwsJson1_1Protocol extends AwsJsonRpcProtocol {\n constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, }) {\n super({\n defaultNamespace,\n serviceTarget,\n awsQueryCompatible,\n });\n }\n getShapeId() {\n return \"aws.protocols#awsJson1_1\";\n }\n getJsonRpcVersion() {\n return \"1.1\";\n }\n getDefaultContentType() {\n return \"application/x-amz-json-1.1\";\n }\n}\n\nclass AwsRestJsonProtocol extends protocols.HttpBindingProtocol {\n serializer;\n deserializer;\n codec;\n mixin = new ProtocolLib();\n constructor({ defaultNamespace }) {\n super({\n defaultNamespace,\n });\n const settings = {\n timestampFormat: {\n useTrait: true,\n default: 7,\n },\n httpBindings: true,\n jsonName: true,\n };\n this.codec = new JsonCodec(settings);\n this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);\n this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);\n }\n getShapeId() {\n return \"aws.protocols#restJson1\";\n }\n getPayloadCodec() {\n return this.codec;\n }\n setSerdeContext(serdeContext) {\n this.codec.setSerdeContext(serdeContext);\n super.setSerdeContext(serdeContext);\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n const inputSchema = schema.NormalizedSchema.of(operationSchema.input);\n if (!request.headers[\"content-type\"]) {\n const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);\n if (contentType) {\n request.headers[\"content-type\"] = contentType;\n }\n }\n if (request.body == null && request.headers[\"content-type\"] === this.getDefaultContentType()) {\n request.body = \"{}\";\n }\n return request;\n }\n async deserializeResponse(operationSchema, context, response) {\n const output = await super.deserializeResponse(operationSchema, context, response);\n const outputSchema = schema.NormalizedSchema.of(operationSchema.output);\n for (const [name, member] of outputSchema.structIterator()) {\n if (member.getMemberTraits().httpPayload && !(name in output)) {\n output[name] = null;\n }\n }\n return output;\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? \"Unknown\";\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);\n const ns = schema.NormalizedSchema.of(errorSchema);\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n await this.deserializeHttpMessage(errorSchema, context, response, dataObject);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n const target = member.getMergedTraits().jsonName ?? name;\n output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n getDefaultContentType() {\n return \"application/json\";\n }\n}\n\nconst awsExpectUnion = (value) => {\n if (value == null) {\n return undefined;\n }\n if (typeof value === \"object\" && \"__type\" in value) {\n delete value.__type;\n }\n return smithyClient.expectUnion(value);\n};\n\nclass XmlShapeDeserializer extends SerdeContextConfig {\n settings;\n stringDeserializer;\n constructor(settings) {\n super();\n this.settings = settings;\n this.stringDeserializer = new protocols.FromStringShapeDeserializer(settings);\n }\n setSerdeContext(serdeContext) {\n this.serdeContext = serdeContext;\n this.stringDeserializer.setSerdeContext(serdeContext);\n }\n read(schema$1, bytes, key) {\n const ns = schema.NormalizedSchema.of(schema$1);\n const memberSchemas = ns.getMemberSchemas();\n const isEventPayload = ns.isStructSchema() &&\n ns.isMemberSchema() &&\n !!Object.values(memberSchemas).find((memberNs) => {\n return !!memberNs.getMemberTraits().eventPayload;\n });\n if (isEventPayload) {\n const output = {};\n const memberName = Object.keys(memberSchemas)[0];\n const eventMemberSchema = memberSchemas[memberName];\n if (eventMemberSchema.isBlobSchema()) {\n output[memberName] = bytes;\n }\n else {\n output[memberName] = this.read(memberSchemas[memberName], bytes);\n }\n return output;\n }\n const xmlString = (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)(bytes);\n const parsedObject = this.parseXml(xmlString);\n return this.readSchema(schema$1, key ? parsedObject[key] : parsedObject);\n }\n readSchema(_schema, value) {\n const ns = schema.NormalizedSchema.of(_schema);\n if (ns.isUnitSchema()) {\n return;\n }\n const traits = ns.getMergedTraits();\n if (ns.isListSchema() && !Array.isArray(value)) {\n return this.readSchema(ns, [value]);\n }\n if (value == null) {\n return value;\n }\n if (typeof value === \"object\") {\n const sparse = !!traits.sparse;\n const flat = !!traits.xmlFlattened;\n if (ns.isListSchema()) {\n const listValue = ns.getValueSchema();\n const buffer = [];\n const sourceKey = listValue.getMergedTraits().xmlName ?? \"member\";\n const source = flat ? value : (value[0] ?? value)[sourceKey];\n const sourceArray = Array.isArray(source) ? source : [source];\n for (const v of sourceArray) {\n if (v != null || sparse) {\n buffer.push(this.readSchema(listValue, v));\n }\n }\n return buffer;\n }\n const buffer = {};\n if (ns.isMapSchema()) {\n const keyNs = ns.getKeySchema();\n const memberNs = ns.getValueSchema();\n let entries;\n if (flat) {\n entries = Array.isArray(value) ? value : [value];\n }\n else {\n entries = Array.isArray(value.entry) ? value.entry : [value.entry];\n }\n const keyProperty = keyNs.getMergedTraits().xmlName ?? \"key\";\n const valueProperty = memberNs.getMergedTraits().xmlName ?? \"value\";\n for (const entry of entries) {\n const key = entry[keyProperty];\n const value = entry[valueProperty];\n if (value != null || sparse) {\n buffer[key] = this.readSchema(memberNs, value);\n }\n }\n return buffer;\n }\n if (ns.isStructSchema()) {\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const memberTraits = memberSchema.getMergedTraits();\n const xmlObjectKey = !memberTraits.httpPayload\n ? memberSchema.getMemberTraits().xmlName ?? memberName\n : memberTraits.xmlName ?? memberSchema.getName();\n if (value[xmlObjectKey] != null) {\n buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]);\n }\n }\n return buffer;\n }\n if (ns.isDocumentSchema()) {\n return value;\n }\n throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`);\n }\n if (ns.isListSchema()) {\n return [];\n }\n if (ns.isMapSchema() || ns.isStructSchema()) {\n return {};\n }\n return this.stringDeserializer.read(ns, value);\n }\n parseXml(xml) {\n if (xml.length) {\n let parsedObj;\n try {\n parsedObj = xmlBuilder.parseXML(xml);\n }\n catch (e) {\n if (e && typeof e === \"object\") {\n Object.defineProperty(e, \"$responseBodyText\", {\n value: xml,\n });\n }\n throw e;\n }\n const textNodeName = \"#text\";\n const key = Object.keys(parsedObj)[0];\n const parsedObjToReturn = parsedObj[key];\n if (parsedObjToReturn[textNodeName]) {\n parsedObjToReturn[key] = parsedObjToReturn[textNodeName];\n delete parsedObjToReturn[textNodeName];\n }\n return smithyClient.getValueFromTextNode(parsedObjToReturn);\n }\n return {};\n }\n}\n\nclass QueryShapeSerializer extends SerdeContextConfig {\n settings;\n buffer;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n write(schema$1, value, prefix = \"\") {\n if (this.buffer === undefined) {\n this.buffer = \"\";\n }\n const ns = schema.NormalizedSchema.of(schema$1);\n if (prefix && !prefix.endsWith(\".\")) {\n prefix += \".\";\n }\n if (ns.isBlobSchema()) {\n if (typeof value === \"string\" || value instanceof Uint8Array) {\n this.writeKey(prefix);\n this.writeValue((this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value));\n }\n }\n else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) {\n if (value != null) {\n this.writeKey(prefix);\n this.writeValue(String(value));\n }\n else if (ns.isIdempotencyToken()) {\n this.writeKey(prefix);\n this.writeValue(serde.generateIdempotencyToken());\n }\n }\n else if (ns.isBigIntegerSchema()) {\n if (value != null) {\n this.writeKey(prefix);\n this.writeValue(String(value));\n }\n }\n else if (ns.isBigDecimalSchema()) {\n if (value != null) {\n this.writeKey(prefix);\n this.writeValue(value instanceof serde.NumericValue ? value.string : String(value));\n }\n }\n else if (ns.isTimestampSchema()) {\n if (value instanceof Date) {\n this.writeKey(prefix);\n const format = protocols.determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n this.writeValue(value.toISOString().replace(\".000Z\", \"Z\"));\n break;\n case 6:\n this.writeValue(smithyClient.dateToUtcString(value));\n break;\n case 7:\n this.writeValue(String(value.getTime() / 1000));\n break;\n }\n }\n }\n else if (ns.isDocumentSchema()) {\n throw new Error(`@aws-sdk/core/protocols - QuerySerializer unsupported document type ${ns.getName(true)}`);\n }\n else if (ns.isListSchema()) {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n if (this.settings.serializeEmptyLists) {\n this.writeKey(prefix);\n this.writeValue(\"\");\n }\n }\n else {\n const member = ns.getValueSchema();\n const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened;\n let i = 1;\n for (const item of value) {\n if (item == null) {\n continue;\n }\n const suffix = this.getKey(\"member\", member.getMergedTraits().xmlName);\n const key = flat ? `${prefix}${i}` : `${prefix}${suffix}.${i}`;\n this.write(member, item, key);\n ++i;\n }\n }\n }\n }\n else if (ns.isMapSchema()) {\n if (value && typeof value === \"object\") {\n const keySchema = ns.getKeySchema();\n const memberSchema = ns.getValueSchema();\n const flat = ns.getMergedTraits().xmlFlattened;\n let i = 1;\n for (const [k, v] of Object.entries(value)) {\n if (v == null) {\n continue;\n }\n const keySuffix = this.getKey(\"key\", keySchema.getMergedTraits().xmlName);\n const key = flat ? `${prefix}${i}.${keySuffix}` : `${prefix}entry.${i}.${keySuffix}`;\n const valueSuffix = this.getKey(\"value\", memberSchema.getMergedTraits().xmlName);\n const valueKey = flat ? `${prefix}${i}.${valueSuffix}` : `${prefix}entry.${i}.${valueSuffix}`;\n this.write(keySchema, k, key);\n this.write(memberSchema, v, valueKey);\n ++i;\n }\n }\n }\n else if (ns.isStructSchema()) {\n if (value && typeof value === \"object\") {\n for (const [memberName, member] of ns.structIterator()) {\n if (value[memberName] == null && !member.isIdempotencyToken()) {\n continue;\n }\n const suffix = this.getKey(memberName, member.getMergedTraits().xmlName);\n const key = `${prefix}${suffix}`;\n this.write(member, value[memberName], key);\n }\n }\n }\n else if (ns.isUnitSchema()) ;\n else {\n throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`);\n }\n }\n flush() {\n if (this.buffer === undefined) {\n throw new Error(\"@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.\");\n }\n const str = this.buffer;\n delete this.buffer;\n return str;\n }\n getKey(memberName, xmlName) {\n const key = xmlName ?? memberName;\n if (this.settings.capitalizeKeys) {\n return key[0].toUpperCase() + key.slice(1);\n }\n return key;\n }\n writeKey(key) {\n if (key.endsWith(\".\")) {\n key = key.slice(0, key.length - 1);\n }\n this.buffer += `&${protocols.extendedEncodeURIComponent(key)}=`;\n }\n writeValue(value) {\n this.buffer += protocols.extendedEncodeURIComponent(value);\n }\n}\n\nclass AwsQueryProtocol extends protocols.RpcProtocol {\n options;\n serializer;\n deserializer;\n mixin = new ProtocolLib();\n constructor(options) {\n super({\n defaultNamespace: options.defaultNamespace,\n });\n this.options = options;\n const settings = {\n timestampFormat: {\n useTrait: true,\n default: 5,\n },\n httpBindings: false,\n xmlNamespace: options.xmlNamespace,\n serviceNamespace: options.defaultNamespace,\n serializeEmptyLists: true,\n };\n this.serializer = new QueryShapeSerializer(settings);\n this.deserializer = new XmlShapeDeserializer(settings);\n }\n getShapeId() {\n return \"aws.protocols#awsQuery\";\n }\n setSerdeContext(serdeContext) {\n this.serializer.setSerdeContext(serdeContext);\n this.deserializer.setSerdeContext(serdeContext);\n }\n getPayloadCodec() {\n throw new Error(\"AWSQuery protocol has no payload codec.\");\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n if (!request.path.endsWith(\"/\")) {\n request.path += \"/\";\n }\n Object.assign(request.headers, {\n \"content-type\": `application/x-www-form-urlencoded`,\n });\n if (schema.deref(operationSchema.input) === \"unit\" || !request.body) {\n request.body = \"\";\n }\n const action = operationSchema.name.split(\"#\")[1] ?? operationSchema.name;\n request.body = `Action=${action}&Version=${this.options.version}` + request.body;\n if (request.body.endsWith(\"&\")) {\n request.body = request.body.slice(-1);\n }\n return request;\n }\n async deserializeResponse(operationSchema, context, response) {\n const deserializer = this.deserializer;\n const ns = schema.NormalizedSchema.of(operationSchema.output);\n const dataObject = {};\n if (response.statusCode >= 300) {\n const bytes = await protocols.collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n Object.assign(dataObject, await deserializer.read(15, bytes));\n }\n await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));\n }\n for (const header in response.headers) {\n const value = response.headers[header];\n delete response.headers[header];\n response.headers[header.toLowerCase()] = value;\n }\n const shortName = operationSchema.name.split(\"#\")[1] ?? operationSchema.name;\n const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + \"Result\" : undefined;\n const bytes = await protocols.collectBody(response.body, context);\n if (bytes.byteLength > 0) {\n Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));\n }\n const output = {\n $metadata: this.deserializeMetadata(response),\n ...dataObject,\n };\n return output;\n }\n useNestedResult() {\n return true;\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? \"Unknown\";\n const errorData = this.loadQueryError(dataObject);\n const message = this.loadQueryErrorMessage(dataObject);\n errorData.message = message;\n errorData.Error = {\n Type: errorData.Type,\n Code: errorData.Code,\n Message: message,\n };\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, (registry, errorName) => {\n try {\n return registry.getSchema(errorName);\n }\n catch (e) {\n return registry.find((schema$1) => schema.NormalizedSchema.of(schema$1).getMergedTraits().awsQueryError?.[0] === errorName);\n }\n });\n const ns = schema.NormalizedSchema.of(errorSchema);\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n const output = {\n Error: errorData.Error,\n };\n for (const [name, member] of ns.structIterator()) {\n const target = member.getMergedTraits().xmlName ?? name;\n const value = errorData[target] ?? dataObject[target];\n output[name] = this.deserializer.readSchema(member, value);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n loadQueryErrorCode(output, data) {\n const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code;\n if (code !== undefined) {\n return code;\n }\n if (output.statusCode == 404) {\n return \"NotFound\";\n }\n }\n loadQueryError(data) {\n return data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error;\n }\n loadQueryErrorMessage(data) {\n const errorData = this.loadQueryError(data);\n return errorData?.message ?? errorData?.Message ?? data.message ?? data.Message ?? \"Unknown\";\n }\n getDefaultContentType() {\n return \"application/x-www-form-urlencoded\";\n }\n}\n\nclass AwsEc2QueryProtocol extends AwsQueryProtocol {\n options;\n constructor(options) {\n super(options);\n this.options = options;\n const ec2Settings = {\n capitalizeKeys: true,\n flattenLists: true,\n serializeEmptyLists: false,\n };\n Object.assign(this.serializer.settings, ec2Settings);\n }\n useNestedResult() {\n return false;\n }\n}\n\nconst parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {\n if (encoded.length) {\n let parsedObj;\n try {\n parsedObj = xmlBuilder.parseXML(encoded);\n }\n catch (e) {\n if (e && typeof e === \"object\") {\n Object.defineProperty(e, \"$responseBodyText\", {\n value: encoded,\n });\n }\n throw e;\n }\n const textNodeName = \"#text\";\n const key = Object.keys(parsedObj)[0];\n const parsedObjToReturn = parsedObj[key];\n if (parsedObjToReturn[textNodeName]) {\n parsedObjToReturn[key] = parsedObjToReturn[textNodeName];\n delete parsedObjToReturn[textNodeName];\n }\n return smithyClient.getValueFromTextNode(parsedObjToReturn);\n }\n return {};\n});\nconst parseXmlErrorBody = async (errorBody, context) => {\n const value = await parseXmlBody(errorBody, context);\n if (value.Error) {\n value.Error.message = value.Error.message ?? value.Error.Message;\n }\n return value;\n};\nconst loadRestXmlErrorCode = (output, data) => {\n if (data?.Error?.Code !== undefined) {\n return data.Error.Code;\n }\n if (data?.Code !== undefined) {\n return data.Code;\n }\n if (output.statusCode == 404) {\n return \"NotFound\";\n }\n};\n\nclass XmlShapeSerializer extends SerdeContextConfig {\n settings;\n stringBuffer;\n byteBuffer;\n buffer;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n write(schema$1, value) {\n const ns = schema.NormalizedSchema.of(schema$1);\n if (ns.isStringSchema() && typeof value === \"string\") {\n this.stringBuffer = value;\n }\n else if (ns.isBlobSchema()) {\n this.byteBuffer =\n \"byteLength\" in value\n ? value\n : (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(value);\n }\n else {\n this.buffer = this.writeStruct(ns, value, undefined);\n const traits = ns.getMergedTraits();\n if (traits.httpPayload && !traits.xmlName) {\n this.buffer.withName(ns.getName());\n }\n }\n }\n flush() {\n if (this.byteBuffer !== undefined) {\n const bytes = this.byteBuffer;\n delete this.byteBuffer;\n return bytes;\n }\n if (this.stringBuffer !== undefined) {\n const str = this.stringBuffer;\n delete this.stringBuffer;\n return str;\n }\n const buffer = this.buffer;\n if (this.settings.xmlNamespace) {\n if (!buffer?.attributes?.[\"xmlns\"]) {\n buffer.addAttribute(\"xmlns\", this.settings.xmlNamespace);\n }\n }\n delete this.buffer;\n return buffer.toString();\n }\n writeStruct(ns, value, parentXmlns) {\n const traits = ns.getMergedTraits();\n const name = ns.isMemberSchema() && !traits.httpPayload\n ? ns.getMemberTraits().xmlName ?? ns.getMemberName()\n : traits.xmlName ?? ns.getName();\n if (!name || !ns.isStructSchema()) {\n throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`);\n }\n const structXmlNode = xmlBuilder.XmlNode.of(name);\n const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);\n for (const [memberName, memberSchema] of ns.structIterator()) {\n const val = value[memberName];\n if (val != null || memberSchema.isIdempotencyToken()) {\n if (memberSchema.getMergedTraits().xmlAttribute) {\n structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val));\n continue;\n }\n if (memberSchema.isListSchema()) {\n this.writeList(memberSchema, val, structXmlNode, xmlns);\n }\n else if (memberSchema.isMapSchema()) {\n this.writeMap(memberSchema, val, structXmlNode, xmlns);\n }\n else if (memberSchema.isStructSchema()) {\n structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns));\n }\n else {\n const memberNode = xmlBuilder.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName());\n this.writeSimpleInto(memberSchema, val, memberNode, xmlns);\n structXmlNode.addChildNode(memberNode);\n }\n }\n }\n if (xmlns) {\n structXmlNode.addAttribute(xmlnsAttr, xmlns);\n }\n return structXmlNode;\n }\n writeList(listMember, array, container, parentXmlns) {\n if (!listMember.isMemberSchema()) {\n throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`);\n }\n const listTraits = listMember.getMergedTraits();\n const listValueSchema = listMember.getValueSchema();\n const listValueTraits = listValueSchema.getMergedTraits();\n const sparse = !!listValueTraits.sparse;\n const flat = !!listTraits.xmlFlattened;\n const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns);\n const writeItem = (container, value) => {\n if (listValueSchema.isListSchema()) {\n this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container, xmlns);\n }\n else if (listValueSchema.isMapSchema()) {\n this.writeMap(listValueSchema, value, container, xmlns);\n }\n else if (listValueSchema.isStructSchema()) {\n const struct = this.writeStruct(listValueSchema, value, xmlns);\n container.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? \"member\"));\n }\n else {\n const listItemNode = xmlBuilder.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? \"member\");\n this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns);\n container.addChildNode(listItemNode);\n }\n };\n if (flat) {\n for (const value of array) {\n if (sparse || value != null) {\n writeItem(container, value);\n }\n }\n }\n else {\n const listNode = xmlBuilder.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName());\n if (xmlns) {\n listNode.addAttribute(xmlnsAttr, xmlns);\n }\n for (const value of array) {\n if (sparse || value != null) {\n writeItem(listNode, value);\n }\n }\n container.addChildNode(listNode);\n }\n }\n writeMap(mapMember, map, container, parentXmlns, containerIsMap = false) {\n if (!mapMember.isMemberSchema()) {\n throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`);\n }\n const mapTraits = mapMember.getMergedTraits();\n const mapKeySchema = mapMember.getKeySchema();\n const mapKeyTraits = mapKeySchema.getMergedTraits();\n const keyTag = mapKeyTraits.xmlName ?? \"key\";\n const mapValueSchema = mapMember.getValueSchema();\n const mapValueTraits = mapValueSchema.getMergedTraits();\n const valueTag = mapValueTraits.xmlName ?? \"value\";\n const sparse = !!mapValueTraits.sparse;\n const flat = !!mapTraits.xmlFlattened;\n const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns);\n const addKeyValue = (entry, key, val) => {\n const keyNode = xmlBuilder.XmlNode.of(keyTag, key);\n const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns);\n if (keyXmlns) {\n keyNode.addAttribute(keyXmlnsAttr, keyXmlns);\n }\n entry.addChildNode(keyNode);\n let valueNode = xmlBuilder.XmlNode.of(valueTag);\n if (mapValueSchema.isListSchema()) {\n this.writeList(mapValueSchema, val, valueNode, xmlns);\n }\n else if (mapValueSchema.isMapSchema()) {\n this.writeMap(mapValueSchema, val, valueNode, xmlns, true);\n }\n else if (mapValueSchema.isStructSchema()) {\n valueNode = this.writeStruct(mapValueSchema, val, xmlns);\n }\n else {\n this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns);\n }\n entry.addChildNode(valueNode);\n };\n if (flat) {\n for (const [key, val] of Object.entries(map)) {\n if (sparse || val != null) {\n const entry = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());\n addKeyValue(entry, key, val);\n container.addChildNode(entry);\n }\n }\n }\n else {\n let mapNode;\n if (!containerIsMap) {\n mapNode = xmlBuilder.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());\n if (xmlns) {\n mapNode.addAttribute(xmlnsAttr, xmlns);\n }\n container.addChildNode(mapNode);\n }\n for (const [key, val] of Object.entries(map)) {\n if (sparse || val != null) {\n const entry = xmlBuilder.XmlNode.of(\"entry\");\n addKeyValue(entry, key, val);\n (containerIsMap ? container : mapNode).addChildNode(entry);\n }\n }\n }\n }\n writeSimple(_schema, value) {\n if (null === value) {\n throw new Error(\"@aws-sdk/core/protocols - (XML serializer) cannot write null value.\");\n }\n const ns = schema.NormalizedSchema.of(_schema);\n let nodeContents = null;\n if (value && typeof value === \"object\") {\n if (ns.isBlobSchema()) {\n nodeContents = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);\n }\n else if (ns.isTimestampSchema() && value instanceof Date) {\n const format = protocols.determineTimestampFormat(ns, this.settings);\n switch (format) {\n case 5:\n nodeContents = value.toISOString().replace(\".000Z\", \"Z\");\n break;\n case 6:\n nodeContents = smithyClient.dateToUtcString(value);\n break;\n case 7:\n nodeContents = String(value.getTime() / 1000);\n break;\n default:\n console.warn(\"Missing timestamp format, using http date\", value);\n nodeContents = smithyClient.dateToUtcString(value);\n break;\n }\n }\n else if (ns.isBigDecimalSchema() && value) {\n if (value instanceof serde.NumericValue) {\n return value.string;\n }\n return String(value);\n }\n else if (ns.isMapSchema() || ns.isListSchema()) {\n throw new Error(\"@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.\");\n }\n else {\n throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`);\n }\n }\n if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {\n nodeContents = String(value);\n }\n if (ns.isStringSchema()) {\n if (value === undefined && ns.isIdempotencyToken()) {\n nodeContents = serde.generateIdempotencyToken();\n }\n else {\n nodeContents = String(value);\n }\n }\n if (nodeContents === null) {\n throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`);\n }\n return nodeContents;\n }\n writeSimpleInto(_schema, value, into, parentXmlns) {\n const nodeContents = this.writeSimple(_schema, value);\n const ns = schema.NormalizedSchema.of(_schema);\n const content = new xmlBuilder.XmlText(nodeContents);\n const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);\n if (xmlns) {\n into.addAttribute(xmlnsAttr, xmlns);\n }\n into.addChildNode(content);\n }\n getXmlnsAttribute(ns, parentXmlns) {\n const traits = ns.getMergedTraits();\n const [prefix, xmlns] = traits.xmlNamespace ?? [];\n if (xmlns && xmlns !== parentXmlns) {\n return [prefix ? `xmlns:${prefix}` : \"xmlns\", xmlns];\n }\n return [void 0, void 0];\n }\n}\n\nclass XmlCodec extends SerdeContextConfig {\n settings;\n constructor(settings) {\n super();\n this.settings = settings;\n }\n createSerializer() {\n const serializer = new XmlShapeSerializer(this.settings);\n serializer.setSerdeContext(this.serdeContext);\n return serializer;\n }\n createDeserializer() {\n const deserializer = new XmlShapeDeserializer(this.settings);\n deserializer.setSerdeContext(this.serdeContext);\n return deserializer;\n }\n}\n\nclass AwsRestXmlProtocol extends protocols.HttpBindingProtocol {\n codec;\n serializer;\n deserializer;\n mixin = new ProtocolLib();\n constructor(options) {\n super(options);\n const settings = {\n timestampFormat: {\n useTrait: true,\n default: 5,\n },\n httpBindings: true,\n xmlNamespace: options.xmlNamespace,\n serviceNamespace: options.defaultNamespace,\n };\n this.codec = new XmlCodec(settings);\n this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);\n this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);\n }\n getPayloadCodec() {\n return this.codec;\n }\n getShapeId() {\n return \"aws.protocols#restXml\";\n }\n async serializeRequest(operationSchema, input, context) {\n const request = await super.serializeRequest(operationSchema, input, context);\n const inputSchema = schema.NormalizedSchema.of(operationSchema.input);\n if (!request.headers[\"content-type\"]) {\n const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);\n if (contentType) {\n request.headers[\"content-type\"] = contentType;\n }\n }\n if (request.headers[\"content-type\"] === this.getDefaultContentType()) {\n if (typeof request.body === \"string\") {\n request.body = '' + request.body;\n }\n }\n return request;\n }\n async deserializeResponse(operationSchema, context, response) {\n return super.deserializeResponse(operationSchema, context, response);\n }\n async handleError(operationSchema, context, response, dataObject, metadata) {\n const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? \"Unknown\";\n const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);\n const ns = schema.NormalizedSchema.of(errorSchema);\n const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;\n const exception = new ErrorCtor(message);\n await this.deserializeHttpMessage(errorSchema, context, response, dataObject);\n const output = {};\n for (const [name, member] of ns.structIterator()) {\n const target = member.getMergedTraits().xmlName ?? name;\n const value = dataObject.Error?.[target] ?? dataObject[target];\n output[name] = this.codec.createDeserializer().readSchema(member, value);\n }\n throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {\n $fault: ns.getMergedTraits().error,\n message,\n }, output), dataObject);\n }\n getDefaultContentType() {\n return \"application/xml\";\n }\n}\n\nexports.AwsEc2QueryProtocol = AwsEc2QueryProtocol;\nexports.AwsJson1_0Protocol = AwsJson1_0Protocol;\nexports.AwsJson1_1Protocol = AwsJson1_1Protocol;\nexports.AwsJsonRpcProtocol = AwsJsonRpcProtocol;\nexports.AwsQueryProtocol = AwsQueryProtocol;\nexports.AwsRestJsonProtocol = AwsRestJsonProtocol;\nexports.AwsRestXmlProtocol = AwsRestXmlProtocol;\nexports.AwsSmithyRpcV2CborProtocol = AwsSmithyRpcV2CborProtocol;\nexports.JsonCodec = JsonCodec;\nexports.JsonShapeDeserializer = JsonShapeDeserializer;\nexports.JsonShapeSerializer = JsonShapeSerializer;\nexports.XmlCodec = XmlCodec;\nexports.XmlShapeDeserializer = XmlShapeDeserializer;\nexports.XmlShapeSerializer = XmlShapeSerializer;\nexports._toBool = _toBool;\nexports._toNum = _toNum;\nexports._toStr = _toStr;\nexports.awsExpectUnion = awsExpectUnion;\nexports.loadRestJsonErrorCode = loadRestJsonErrorCode;\nexports.loadRestXmlErrorCode = loadRestXmlErrorCode;\nexports.parseJsonBody = parseJsonBody;\nexports.parseJsonErrorBody = parseJsonErrorBody;\nexports.parseXmlBody = parseXmlBody;\nexports.parseXmlErrorBody = parseXmlErrorBody;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst u = \"required\", v = \"fn\", w = \"argv\", x = \"ref\";\nconst a = true, b = \"isSet\", c = \"booleanEquals\", d = \"error\", e = \"endpoint\", f = \"tree\", g = \"PartitionResult\", h = \"getAttr\", i = { [u]: false, \"type\": \"string\" }, j = { [u]: true, \"default\": false, \"type\": \"boolean\" }, k = { [x]: \"Endpoint\" }, l = { [v]: c, [w]: [{ [x]: \"UseFIPS\" }, true] }, m = { [v]: c, [w]: [{ [x]: \"UseDualStack\" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, \"supportsFIPS\"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, \"supportsDualStack\"] }] }, r = [l], s = [m], t = [{ [x]: \"Region\" }];\nconst _data = { version: \"1.0\", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], 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: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: \"aws.partition\", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: \"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: n, headers: n }, 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: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: \"stringEquals\", [w]: [{ [v]: h, [w]: [p, \"name\"] }, \"aws-us-gov\"] }], endpoint: { url: \"https://oidc.{Region}.amazonaws.com\", properties: n, headers: n }, type: e }, { endpoint: { url: \"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"FIPS is enabled but this partition does not support FIPS\", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: \"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: n, headers: n }, 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: n, headers: n }, type: e }], type: f }], type: f }, { error: \"Invalid Configuration: Missing Region\", type: d }] };\nexports.ruleSet = _data;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2019-06-10\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOOIDCHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: \"com.amazonaws.ssooidc\" }),\n serviceId: config?.serviceId ?? \"SSO OIDC\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "'use strict';\n\nvar configResolver = require('@smithy/config-resolver');\nvar nodeConfigProvider = require('@smithy/node-config-provider');\nvar propertyProvider = require('@smithy/property-provider');\n\nconst AWS_EXECUTION_ENV = \"AWS_EXECUTION_ENV\";\nconst AWS_REGION_ENV = \"AWS_REGION\";\nconst AWS_DEFAULT_REGION_ENV = \"AWS_DEFAULT_REGION\";\nconst ENV_IMDS_DISABLED = \"AWS_EC2_METADATA_DISABLED\";\nconst DEFAULTS_MODE_OPTIONS = [\"in-region\", \"cross-region\", \"mobile\", \"standard\", \"legacy\"];\nconst IMDS_REGION_PATH = \"/latest/meta-data/placement/region\";\n\nconst AWS_DEFAULTS_MODE_ENV = \"AWS_DEFAULTS_MODE\";\nconst AWS_DEFAULTS_MODE_CONFIG = \"defaults_mode\";\nconst NODE_DEFAULTS_MODE_CONFIG_OPTIONS = {\n environmentVariableSelector: (env) => {\n return env[AWS_DEFAULTS_MODE_ENV];\n },\n configFileSelector: (profile) => {\n return profile[AWS_DEFAULTS_MODE_CONFIG];\n },\n default: \"legacy\",\n};\n\nconst resolveDefaultsModeConfig = ({ region = nodeConfigProvider.loadConfig(configResolver.NODE_REGION_CONFIG_OPTIONS), defaultsMode = nodeConfigProvider.loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => propertyProvider.memoize(async () => {\n const mode = typeof defaultsMode === \"function\" ? await defaultsMode() : defaultsMode;\n switch (mode?.toLowerCase()) {\n case \"auto\":\n return resolveNodeDefaultsModeAuto(region);\n case \"in-region\":\n case \"cross-region\":\n case \"mobile\":\n case \"standard\":\n case \"legacy\":\n return Promise.resolve(mode?.toLocaleLowerCase());\n case undefined:\n return Promise.resolve(\"legacy\");\n default:\n throw new Error(`Invalid parameter for \"defaultsMode\", expect ${DEFAULTS_MODE_OPTIONS.join(\", \")}, got ${mode}`);\n }\n});\nconst resolveNodeDefaultsModeAuto = async (clientRegion) => {\n if (clientRegion) {\n const resolvedRegion = typeof clientRegion === \"function\" ? await clientRegion() : clientRegion;\n const inferredRegion = await inferPhysicalRegion();\n if (!inferredRegion) {\n return \"standard\";\n }\n if (resolvedRegion === inferredRegion) {\n return \"in-region\";\n }\n else {\n return \"cross-region\";\n }\n }\n return \"standard\";\n};\nconst inferPhysicalRegion = async () => {\n if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {\n return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];\n }\n if (!process.env[ENV_IMDS_DISABLED]) {\n try {\n const { getInstanceMetadataEndpoint, httpRequest } = await import('@smithy/credential-provider-imds');\n const endpoint = await getInstanceMetadataEndpoint();\n return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString();\n }\n catch (e) {\n }\n }\n};\n\nexports.resolveDefaultsModeConfig = resolveDefaultsModeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../../../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.warning = void 0;\nexports.stsRegionDefaultResolver = stsRegionDefaultResolver;\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nfunction stsRegionDefaultResolver(loaderConfig = {}) {\n return (0, node_config_provider_1.loadConfig)({\n ...config_resolver_1.NODE_REGION_CONFIG_OPTIONS,\n async default() {\n if (!exports.warning.silence) {\n console.warn(\"@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.\");\n }\n return \"us-east-1\";\n },\n }, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig });\n}\nexports.warning = {\n silence: false,\n};\n", - "'use strict';\n\nvar configResolver = require('@smithy/config-resolver');\nvar stsRegionDefaultResolver = require('./regionConfig/stsRegionDefaultResolver');\n\nconst getAwsRegionExtensionConfiguration = (runtimeConfig) => {\n return {\n setRegion(region) {\n runtimeConfig.region = region;\n },\n region() {\n return runtimeConfig.region;\n },\n };\n};\nconst resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => {\n return {\n region: awsRegionExtensionConfiguration.region(),\n };\n};\n\nObject.defineProperty(exports, \"NODE_REGION_CONFIG_FILE_OPTIONS\", {\n enumerable: true,\n get: function () { return configResolver.NODE_REGION_CONFIG_FILE_OPTIONS; }\n});\nObject.defineProperty(exports, \"NODE_REGION_CONFIG_OPTIONS\", {\n enumerable: true,\n get: function () { return configResolver.NODE_REGION_CONFIG_OPTIONS; }\n});\nObject.defineProperty(exports, \"REGION_ENV_NAME\", {\n enumerable: true,\n get: function () { return configResolver.REGION_ENV_NAME; }\n});\nObject.defineProperty(exports, \"REGION_INI_NAME\", {\n enumerable: true,\n get: function () { return configResolver.REGION_INI_NAME; }\n});\nObject.defineProperty(exports, \"resolveRegionConfig\", {\n enumerable: true,\n get: function () { return configResolver.resolveRegionConfig; }\n});\nexports.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration;\nexports.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration;\nObject.keys(stsRegionDefaultResolver).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () { return stsRegionDefaultResolver[k]; }\n });\n});\n", - "'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"sso-oauth\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass SSOOIDCClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOOIDCHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nlet SSOOIDCServiceException$1 = class SSOOIDCServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, SSOOIDCServiceException.prototype);\n }\n};\n\nlet AccessDeniedException$1 = class AccessDeniedException extends SSOOIDCServiceException$1 {\n name = \"AccessDeniedException\";\n $fault = \"client\";\n error;\n reason;\n error_description;\n constructor(opts) {\n super({\n name: \"AccessDeniedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, AccessDeniedException.prototype);\n this.error = opts.error;\n this.reason = opts.reason;\n this.error_description = opts.error_description;\n }\n};\nlet AuthorizationPendingException$1 = class AuthorizationPendingException extends SSOOIDCServiceException$1 {\n name = \"AuthorizationPendingException\";\n $fault = \"client\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"AuthorizationPendingException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, AuthorizationPendingException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\nlet ExpiredTokenException$1 = class ExpiredTokenException extends SSOOIDCServiceException$1 {\n name = \"ExpiredTokenException\";\n $fault = \"client\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"ExpiredTokenException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ExpiredTokenException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\nlet InternalServerException$1 = class InternalServerException extends SSOOIDCServiceException$1 {\n name = \"InternalServerException\";\n $fault = \"server\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"InternalServerException\",\n $fault: \"server\",\n ...opts,\n });\n Object.setPrototypeOf(this, InternalServerException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\nlet InvalidClientException$1 = class InvalidClientException extends SSOOIDCServiceException$1 {\n name = \"InvalidClientException\";\n $fault = \"client\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"InvalidClientException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidClientException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\nlet InvalidGrantException$1 = class InvalidGrantException extends SSOOIDCServiceException$1 {\n name = \"InvalidGrantException\";\n $fault = \"client\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"InvalidGrantException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidGrantException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\nlet InvalidRequestException$1 = class InvalidRequestException extends SSOOIDCServiceException$1 {\n name = \"InvalidRequestException\";\n $fault = \"client\";\n error;\n reason;\n error_description;\n constructor(opts) {\n super({\n name: \"InvalidRequestException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidRequestException.prototype);\n this.error = opts.error;\n this.reason = opts.reason;\n this.error_description = opts.error_description;\n }\n};\nlet InvalidScopeException$1 = class InvalidScopeException extends SSOOIDCServiceException$1 {\n name = \"InvalidScopeException\";\n $fault = \"client\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"InvalidScopeException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidScopeException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\nlet SlowDownException$1 = class SlowDownException extends SSOOIDCServiceException$1 {\n name = \"SlowDownException\";\n $fault = \"client\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"SlowDownException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, SlowDownException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\nlet UnauthorizedClientException$1 = class UnauthorizedClientException extends SSOOIDCServiceException$1 {\n name = \"UnauthorizedClientException\";\n $fault = \"client\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"UnauthorizedClientException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, UnauthorizedClientException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\nlet UnsupportedGrantTypeException$1 = class UnsupportedGrantTypeException extends SSOOIDCServiceException$1 {\n name = \"UnsupportedGrantTypeException\";\n $fault = \"client\";\n error;\n error_description;\n constructor(opts) {\n super({\n name: \"UnsupportedGrantTypeException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype);\n this.error = opts.error;\n this.error_description = opts.error_description;\n }\n};\n\nconst _ADE = \"AccessDeniedException\";\nconst _APE = \"AuthorizationPendingException\";\nconst _AT = \"AccessToken\";\nconst _CS = \"ClientSecret\";\nconst _CT = \"CreateToken\";\nconst _CTR = \"CreateTokenRequest\";\nconst _CTRr = \"CreateTokenResponse\";\nconst _CV = \"CodeVerifier\";\nconst _ETE = \"ExpiredTokenException\";\nconst _ICE = \"InvalidClientException\";\nconst _IGE = \"InvalidGrantException\";\nconst _IRE = \"InvalidRequestException\";\nconst _ISE = \"InternalServerException\";\nconst _ISEn = \"InvalidScopeException\";\nconst _IT = \"IdToken\";\nconst _RT = \"RefreshToken\";\nconst _SDE = \"SlowDownException\";\nconst _UCE = \"UnauthorizedClientException\";\nconst _UGTE = \"UnsupportedGrantTypeException\";\nconst _aT = \"accessToken\";\nconst _c = \"client\";\nconst _cI = \"clientId\";\nconst _cS = \"clientSecret\";\nconst _cV = \"codeVerifier\";\nconst _co = \"code\";\nconst _dC = \"deviceCode\";\nconst _e = \"error\";\nconst _eI = \"expiresIn\";\nconst _ed = \"error_description\";\nconst _gT = \"grantType\";\nconst _h = \"http\";\nconst _hE = \"httpError\";\nconst _iT = \"idToken\";\nconst _r = \"reason\";\nconst _rT = \"refreshToken\";\nconst _rU = \"redirectUri\";\nconst _s = \"scope\";\nconst _se = \"server\";\nconst _sm = \"smithy.ts.sdk.synthetic.com.amazonaws.ssooidc\";\nconst _tT = \"tokenType\";\nconst n0 = \"com.amazonaws.ssooidc\";\nvar AccessToken = [0, n0, _AT, 8, 0];\nvar ClientSecret = [0, n0, _CS, 8, 0];\nvar CodeVerifier = [0, n0, _CV, 8, 0];\nvar IdToken = [0, n0, _IT, 8, 0];\nvar RefreshToken = [0, n0, _RT, 8, 0];\nvar AccessDeniedException = [\n -3,\n n0,\n _ADE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _r, _ed],\n [0, 0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1);\nvar AuthorizationPendingException = [\n -3,\n n0,\n _APE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(AuthorizationPendingException, AuthorizationPendingException$1);\nvar CreateTokenRequest = [\n 3,\n n0,\n _CTR,\n 0,\n [_cI, _cS, _gT, _dC, _co, _rT, _s, _rU, _cV],\n [0, [() => ClientSecret, 0], 0, 0, 0, [() => RefreshToken, 0], 64 | 0, 0, [() => CodeVerifier, 0]],\n];\nvar CreateTokenResponse = [\n 3,\n n0,\n _CTRr,\n 0,\n [_aT, _tT, _eI, _rT, _iT],\n [[() => AccessToken, 0], 0, 1, [() => RefreshToken, 0], [() => IdToken, 0]],\n];\nvar ExpiredTokenException = [\n -3,\n n0,\n _ETE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1);\nvar InternalServerException = [\n -3,\n n0,\n _ISE,\n {\n [_e]: _se,\n [_hE]: 500,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1);\nvar InvalidClientException = [\n -3,\n n0,\n _ICE,\n {\n [_e]: _c,\n [_hE]: 401,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidClientException, InvalidClientException$1);\nvar InvalidGrantException = [\n -3,\n n0,\n _IGE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidGrantException, InvalidGrantException$1);\nvar InvalidRequestException = [\n -3,\n n0,\n _IRE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _r, _ed],\n [0, 0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidRequestException, InvalidRequestException$1);\nvar InvalidScopeException = [\n -3,\n n0,\n _ISEn,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidScopeException, InvalidScopeException$1);\nvar SlowDownException = [\n -3,\n n0,\n _SDE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(SlowDownException, SlowDownException$1);\nvar UnauthorizedClientException = [\n -3,\n n0,\n _UCE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(UnauthorizedClientException, UnauthorizedClientException$1);\nvar UnsupportedGrantTypeException = [\n -3,\n n0,\n _UGTE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _ed],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(UnsupportedGrantTypeException, UnsupportedGrantTypeException$1);\nvar SSOOIDCServiceException = [-3, _sm, \"SSOOIDCServiceException\", 0, [], []];\nschema.TypeRegistry.for(_sm).registerError(SSOOIDCServiceException, SSOOIDCServiceException$1);\nvar CreateToken = [\n 9,\n n0,\n _CT,\n {\n [_h]: [\"POST\", \"/token\", 200],\n },\n () => CreateTokenRequest,\n () => CreateTokenResponse,\n];\n\nclass CreateTokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSSOOIDCService\", \"CreateToken\", {})\n .n(\"SSOOIDCClient\", \"CreateTokenCommand\")\n .sc(CreateToken)\n .build() {\n}\n\nconst commands = {\n CreateTokenCommand,\n};\nclass SSOOIDC extends SSOOIDCClient {\n}\nsmithyClient.createAggregatedClient(commands, SSOOIDC);\n\nconst AccessDeniedExceptionReason = {\n KMS_ACCESS_DENIED: \"KMS_AccessDeniedException\",\n};\nconst InvalidRequestExceptionReason = {\n KMS_DISABLED_KEY: \"KMS_DisabledException\",\n KMS_INVALID_KEY_USAGE: \"KMS_InvalidKeyUsageException\",\n KMS_INVALID_STATE: \"KMS_InvalidStateException\",\n KMS_KEY_NOT_FOUND: \"KMS_NotFoundException\",\n};\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nObject.defineProperty(exports, \"__Client\", {\n enumerable: true,\n get: function () { return smithyClient.Client; }\n});\nexports.AccessDeniedException = AccessDeniedException$1;\nexports.AccessDeniedExceptionReason = AccessDeniedExceptionReason;\nexports.AuthorizationPendingException = AuthorizationPendingException$1;\nexports.CreateTokenCommand = CreateTokenCommand;\nexports.ExpiredTokenException = ExpiredTokenException$1;\nexports.InternalServerException = InternalServerException$1;\nexports.InvalidClientException = InvalidClientException$1;\nexports.InvalidGrantException = InvalidGrantException$1;\nexports.InvalidRequestException = InvalidRequestException$1;\nexports.InvalidRequestExceptionReason = InvalidRequestExceptionReason;\nexports.InvalidScopeException = InvalidScopeException$1;\nexports.SSOOIDC = SSOOIDC;\nexports.SSOOIDCClient = SSOOIDCClient;\nexports.SSOOIDCServiceException = SSOOIDCServiceException$1;\nexports.SlowDownException = SlowDownException$1;\nexports.UnauthorizedClientException = UnauthorizedClientException$1;\nexports.UnsupportedGrantTypeException = UnsupportedGrantTypeException$1;\n", - "'use strict';\n\nvar client = require('@aws-sdk/core/client');\nvar httpAuthSchemes = require('@aws-sdk/core/httpAuthSchemes');\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar fs = require('fs');\n\nconst fromEnvSigningName = ({ logger, signingName } = {}) => async () => {\n logger?.debug?.(\"@aws-sdk/token-providers - fromEnvSigningName\");\n if (!signingName) {\n throw new propertyProvider.TokenProviderError(\"Please pass 'signingName' to compute environment variable key\", { logger });\n }\n const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName);\n if (!(bearerTokenKey in process.env)) {\n throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger });\n }\n const token = { token: process.env[bearerTokenKey] };\n client.setTokenFeature(token, \"BEARER_SERVICE_ENV_VARS\", \"3\");\n return token;\n};\n\nconst EXPIRE_WINDOW_MS = 5 * 60 * 1000;\nconst REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;\n\nconst getSsoOidcClient = async (ssoRegion, init = {}) => {\n const { SSOOIDCClient } = await import('@aws-sdk/nested-clients/sso-oidc');\n const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop];\n const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {\n region: ssoRegion ?? init.clientConfig?.region,\n logger: coalesce(\"logger\"),\n userAgentAppId: coalesce(\"userAgentAppId\"),\n }));\n return ssoOidcClient;\n};\n\nconst getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}) => {\n const { CreateTokenCommand } = await import('@aws-sdk/nested-clients/sso-oidc');\n const ssoOidcClient = await getSsoOidcClient(ssoRegion, init);\n return ssoOidcClient.send(new CreateTokenCommand({\n clientId: ssoToken.clientId,\n clientSecret: ssoToken.clientSecret,\n refreshToken: ssoToken.refreshToken,\n grantType: \"refresh_token\",\n }));\n};\n\nconst validateTokenExpiry = (token) => {\n if (token.expiration && token.expiration.getTime() < Date.now()) {\n throw new propertyProvider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);\n }\n};\n\nconst validateTokenKey = (key, value, forRefresh = false) => {\n if (typeof value === \"undefined\") {\n throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? \". Cannot refresh\" : \"\"}. ${REFRESH_MESSAGE}`, false);\n }\n};\n\nconst { writeFile } = fs.promises;\nconst writeSSOTokenToFile = (id, ssoToken) => {\n const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id);\n const tokenString = JSON.stringify(ssoToken, null, 2);\n return writeFile(tokenFilepath, tokenString);\n};\n\nconst lastRefreshAttemptTime = new Date(0);\nconst fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => {\n const init = {\n ..._init,\n parentClientConfig: {\n ...callerClientConfig,\n ..._init.parentClientConfig,\n },\n };\n init.logger?.debug(\"@aws-sdk/token-providers - fromSso\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n const profileName = sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n });\n const profile = profiles[profileName];\n if (!profile) {\n throw new propertyProvider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);\n }\n else if (!profile[\"sso_session\"]) {\n throw new propertyProvider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);\n }\n const ssoSessionName = profile[\"sso_session\"];\n const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init);\n const ssoSession = ssoSessions[ssoSessionName];\n if (!ssoSession) {\n throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);\n }\n for (const ssoSessionRequiredKey of [\"sso_start_url\", \"sso_region\"]) {\n if (!ssoSession[ssoSessionRequiredKey]) {\n throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);\n }\n }\n ssoSession[\"sso_start_url\"];\n const ssoRegion = ssoSession[\"sso_region\"];\n let ssoToken;\n try {\n ssoToken = await sharedIniFileLoader.getSSOTokenFromFile(ssoSessionName);\n }\n catch (e) {\n throw new propertyProvider.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);\n }\n validateTokenKey(\"accessToken\", ssoToken.accessToken);\n validateTokenKey(\"expiresAt\", ssoToken.expiresAt);\n const { accessToken, expiresAt } = ssoToken;\n const existingToken = { token: accessToken, expiration: new Date(expiresAt) };\n if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {\n return existingToken;\n }\n if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {\n validateTokenExpiry(existingToken);\n return existingToken;\n }\n validateTokenKey(\"clientId\", ssoToken.clientId, true);\n validateTokenKey(\"clientSecret\", ssoToken.clientSecret, true);\n validateTokenKey(\"refreshToken\", ssoToken.refreshToken, true);\n try {\n lastRefreshAttemptTime.setTime(Date.now());\n const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init);\n validateTokenKey(\"accessToken\", newSsoOidcToken.accessToken);\n validateTokenKey(\"expiresIn\", newSsoOidcToken.expiresIn);\n const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);\n try {\n await writeSSOTokenToFile(ssoSessionName, {\n ...ssoToken,\n accessToken: newSsoOidcToken.accessToken,\n expiresAt: newTokenExpiration.toISOString(),\n refreshToken: newSsoOidcToken.refreshToken,\n });\n }\n catch (error) {\n }\n return {\n token: newSsoOidcToken.accessToken,\n expiration: newTokenExpiration,\n };\n }\n catch (error) {\n validateTokenExpiry(existingToken);\n return existingToken;\n }\n};\n\nconst fromStatic = ({ token, logger }) => async () => {\n logger?.debug(\"@aws-sdk/token-providers - fromStatic\");\n if (!token || !token.token) {\n throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false);\n }\n return token;\n};\n\nconst nodeProvider = (init = {}) => propertyProvider.memoize(propertyProvider.chain(fromSso(init), async () => {\n throw new propertyProvider.TokenProviderError(\"Could not load token from any providers\", false);\n}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined);\n\nexports.fromEnvSigningName = fromEnvSigningName;\nexports.fromSso = fromSso;\nexports.fromStatic = fromStatic;\nexports.nodeProvider = nodeProvider;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"awsssoportal\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultSSOHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"GetRoleCredentials\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n case \"ListAccountRoles\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n case \"ListAccounts\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n case \"Logout\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst u = \"required\", v = \"fn\", w = \"argv\", x = \"ref\";\nconst a = true, b = \"isSet\", c = \"booleanEquals\", d = \"error\", e = \"endpoint\", f = \"tree\", g = \"PartitionResult\", h = \"getAttr\", i = { [u]: false, \"type\": \"string\" }, j = { [u]: true, \"default\": false, \"type\": \"boolean\" }, k = { [x]: \"Endpoint\" }, l = { [v]: c, [w]: [{ [x]: \"UseFIPS\" }, true] }, m = { [v]: c, [w]: [{ [x]: \"UseDualStack\" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, \"supportsFIPS\"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, \"supportsDualStack\"] }] }, r = [l], s = [m], t = [{ [x]: \"Region\" }];\nconst _data = { version: \"1.0\", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], 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: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: \"aws.partition\", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: \"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: n, headers: n }, 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: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: \"stringEquals\", [w]: [{ [v]: h, [w]: [p, \"name\"] }, \"aws-us-gov\"] }], endpoint: { url: \"https://portal.sso.{Region}.amazonaws.com\", properties: n, headers: n }, type: e }, { endpoint: { url: \"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"FIPS is enabled but this partition does not support FIPS\", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: \"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"DualStack is enabled but this partition does not support DualStack\", type: d }], type: f }, { endpoint: { url: \"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}\", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: \"Invalid Configuration: Missing Region\", type: d }] };\nexports.ruleSet = _data;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2019-06-10\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: \"com.amazonaws.sso\" }),\n serviceId: config?.serviceId ?? \"SSO\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"awsssoportal\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass SSOClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nlet SSOServiceException$1 = class SSOServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, SSOServiceException.prototype);\n }\n};\n\nlet InvalidRequestException$1 = class InvalidRequestException extends SSOServiceException$1 {\n name = \"InvalidRequestException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"InvalidRequestException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidRequestException.prototype);\n }\n};\nlet ResourceNotFoundException$1 = class ResourceNotFoundException extends SSOServiceException$1 {\n name = \"ResourceNotFoundException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ResourceNotFoundException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ResourceNotFoundException.prototype);\n }\n};\nlet TooManyRequestsException$1 = class TooManyRequestsException extends SSOServiceException$1 {\n name = \"TooManyRequestsException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"TooManyRequestsException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, TooManyRequestsException.prototype);\n }\n};\nlet UnauthorizedException$1 = class UnauthorizedException extends SSOServiceException$1 {\n name = \"UnauthorizedException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"UnauthorizedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, UnauthorizedException.prototype);\n }\n};\n\nconst _AI = \"AccountInfo\";\nconst _ALT = \"AccountListType\";\nconst _ATT = \"AccessTokenType\";\nconst _GRC = \"GetRoleCredentials\";\nconst _GRCR = \"GetRoleCredentialsRequest\";\nconst _GRCRe = \"GetRoleCredentialsResponse\";\nconst _IRE = \"InvalidRequestException\";\nconst _L = \"Logout\";\nconst _LA = \"ListAccounts\";\nconst _LAR = \"ListAccountsRequest\";\nconst _LARR = \"ListAccountRolesRequest\";\nconst _LARRi = \"ListAccountRolesResponse\";\nconst _LARi = \"ListAccountsResponse\";\nconst _LARis = \"ListAccountRoles\";\nconst _LR = \"LogoutRequest\";\nconst _RC = \"RoleCredentials\";\nconst _RI = \"RoleInfo\";\nconst _RLT = \"RoleListType\";\nconst _RNFE = \"ResourceNotFoundException\";\nconst _SAKT = \"SecretAccessKeyType\";\nconst _STT = \"SessionTokenType\";\nconst _TMRE = \"TooManyRequestsException\";\nconst _UE = \"UnauthorizedException\";\nconst _aI = \"accountId\";\nconst _aKI = \"accessKeyId\";\nconst _aL = \"accountList\";\nconst _aN = \"accountName\";\nconst _aT = \"accessToken\";\nconst _ai = \"account_id\";\nconst _c = \"client\";\nconst _e = \"error\";\nconst _eA = \"emailAddress\";\nconst _ex = \"expiration\";\nconst _h = \"http\";\nconst _hE = \"httpError\";\nconst _hH = \"httpHeader\";\nconst _hQ = \"httpQuery\";\nconst _m = \"message\";\nconst _mR = \"maxResults\";\nconst _mr = \"max_result\";\nconst _nT = \"nextToken\";\nconst _nt = \"next_token\";\nconst _rC = \"roleCredentials\";\nconst _rL = \"roleList\";\nconst _rN = \"roleName\";\nconst _rn = \"role_name\";\nconst _s = \"smithy.ts.sdk.synthetic.com.amazonaws.sso\";\nconst _sAK = \"secretAccessKey\";\nconst _sT = \"sessionToken\";\nconst _xasbt = \"x-amz-sso_bearer_token\";\nconst n0 = \"com.amazonaws.sso\";\nvar AccessTokenType = [0, n0, _ATT, 8, 0];\nvar SecretAccessKeyType = [0, n0, _SAKT, 8, 0];\nvar SessionTokenType = [0, n0, _STT, 8, 0];\nvar AccountInfo = [3, n0, _AI, 0, [_aI, _aN, _eA], [0, 0, 0]];\nvar GetRoleCredentialsRequest = [\n 3,\n n0,\n _GRCR,\n 0,\n [_rN, _aI, _aT],\n [\n [\n 0,\n {\n [_hQ]: _rn,\n },\n ],\n [\n 0,\n {\n [_hQ]: _ai,\n },\n ],\n [\n () => AccessTokenType,\n {\n [_hH]: _xasbt,\n },\n ],\n ],\n];\nvar GetRoleCredentialsResponse = [3, n0, _GRCRe, 0, [_rC], [[() => RoleCredentials, 0]]];\nvar InvalidRequestException = [\n -3,\n n0,\n _IRE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidRequestException, InvalidRequestException$1);\nvar ListAccountRolesRequest = [\n 3,\n n0,\n _LARR,\n 0,\n [_nT, _mR, _aT, _aI],\n [\n [\n 0,\n {\n [_hQ]: _nt,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mr,\n },\n ],\n [\n () => AccessTokenType,\n {\n [_hH]: _xasbt,\n },\n ],\n [\n 0,\n {\n [_hQ]: _ai,\n },\n ],\n ],\n];\nvar ListAccountRolesResponse = [3, n0, _LARRi, 0, [_nT, _rL], [0, () => RoleListType]];\nvar ListAccountsRequest = [\n 3,\n n0,\n _LAR,\n 0,\n [_nT, _mR, _aT],\n [\n [\n 0,\n {\n [_hQ]: _nt,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mr,\n },\n ],\n [\n () => AccessTokenType,\n {\n [_hH]: _xasbt,\n },\n ],\n ],\n];\nvar ListAccountsResponse = [3, n0, _LARi, 0, [_nT, _aL], [0, () => AccountListType]];\nvar LogoutRequest = [\n 3,\n n0,\n _LR,\n 0,\n [_aT],\n [\n [\n () => AccessTokenType,\n {\n [_hH]: _xasbt,\n },\n ],\n ],\n];\nvar ResourceNotFoundException = [\n -3,\n n0,\n _RNFE,\n {\n [_e]: _c,\n [_hE]: 404,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1);\nvar RoleCredentials = [\n 3,\n n0,\n _RC,\n 0,\n [_aKI, _sAK, _sT, _ex],\n [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1],\n];\nvar RoleInfo = [3, n0, _RI, 0, [_rN, _aI], [0, 0]];\nvar TooManyRequestsException = [\n -3,\n n0,\n _TMRE,\n {\n [_e]: _c,\n [_hE]: 429,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(TooManyRequestsException, TooManyRequestsException$1);\nvar UnauthorizedException = [\n -3,\n n0,\n _UE,\n {\n [_e]: _c,\n [_hE]: 401,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(UnauthorizedException, UnauthorizedException$1);\nvar __Unit = \"unit\";\nvar SSOServiceException = [-3, _s, \"SSOServiceException\", 0, [], []];\nschema.TypeRegistry.for(_s).registerError(SSOServiceException, SSOServiceException$1);\nvar AccountListType = [1, n0, _ALT, 0, () => AccountInfo];\nvar RoleListType = [1, n0, _RLT, 0, () => RoleInfo];\nvar GetRoleCredentials = [\n 9,\n n0,\n _GRC,\n {\n [_h]: [\"GET\", \"/federation/credentials\", 200],\n },\n () => GetRoleCredentialsRequest,\n () => GetRoleCredentialsResponse,\n];\nvar ListAccountRoles = [\n 9,\n n0,\n _LARis,\n {\n [_h]: [\"GET\", \"/assignment/roles\", 200],\n },\n () => ListAccountRolesRequest,\n () => ListAccountRolesResponse,\n];\nvar ListAccounts = [\n 9,\n n0,\n _LA,\n {\n [_h]: [\"GET\", \"/assignment/accounts\", 200],\n },\n () => ListAccountsRequest,\n () => ListAccountsResponse,\n];\nvar Logout = [\n 9,\n n0,\n _L,\n {\n [_h]: [\"POST\", \"/logout\", 200],\n },\n () => LogoutRequest,\n () => __Unit,\n];\n\nclass GetRoleCredentialsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"SWBPortalService\", \"GetRoleCredentials\", {})\n .n(\"SSOClient\", \"GetRoleCredentialsCommand\")\n .sc(GetRoleCredentials)\n .build() {\n}\n\nclass ListAccountRolesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"SWBPortalService\", \"ListAccountRoles\", {})\n .n(\"SSOClient\", \"ListAccountRolesCommand\")\n .sc(ListAccountRoles)\n .build() {\n}\n\nclass ListAccountsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"SWBPortalService\", \"ListAccounts\", {})\n .n(\"SSOClient\", \"ListAccountsCommand\")\n .sc(ListAccounts)\n .build() {\n}\n\nclass LogoutCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"SWBPortalService\", \"Logout\", {})\n .n(\"SSOClient\", \"LogoutCommand\")\n .sc(Logout)\n .build() {\n}\n\nconst commands = {\n GetRoleCredentialsCommand,\n ListAccountRolesCommand,\n ListAccountsCommand,\n LogoutCommand,\n};\nclass SSO extends SSOClient {\n}\nsmithyClient.createAggregatedClient(commands, SSO);\n\nconst paginateListAccountRoles = core.createPaginator(SSOClient, ListAccountRolesCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListAccounts = core.createPaginator(SSOClient, ListAccountsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nObject.defineProperty(exports, \"__Client\", {\n enumerable: true,\n get: function () { return smithyClient.Client; }\n});\nexports.GetRoleCredentialsCommand = GetRoleCredentialsCommand;\nexports.InvalidRequestException = InvalidRequestException$1;\nexports.ListAccountRolesCommand = ListAccountRolesCommand;\nexports.ListAccountsCommand = ListAccountsCommand;\nexports.LogoutCommand = LogoutCommand;\nexports.ResourceNotFoundException = ResourceNotFoundException$1;\nexports.SSO = SSO;\nexports.SSOClient = SSOClient;\nexports.SSOServiceException = SSOServiceException$1;\nexports.TooManyRequestsException = TooManyRequestsException$1;\nexports.UnauthorizedException = UnauthorizedException$1;\nexports.paginateListAccountRoles = paginateListAccountRoles;\nexports.paginateListAccounts = paginateListAccounts;\n", - "'use strict';\n\nvar clientSso = require('@aws-sdk/client-sso');\n\n\n\nObject.defineProperty(exports, \"GetRoleCredentialsCommand\", {\n\tenumerable: true,\n\tget: function () { return clientSso.GetRoleCredentialsCommand; }\n});\nObject.defineProperty(exports, \"SSOClient\", {\n\tenumerable: true,\n\tget: function () { return clientSso.SSOClient; }\n});\n", - "'use strict';\n\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar client = require('@aws-sdk/core/client');\nvar tokenProviders = require('@aws-sdk/token-providers');\n\nconst isSsoProfile = (arg) => arg &&\n (typeof arg.sso_start_url === \"string\" ||\n typeof arg.sso_account_id === \"string\" ||\n typeof arg.sso_session === \"string\" ||\n typeof arg.sso_region === \"string\" ||\n typeof arg.sso_role_name === \"string\");\n\nconst SHOULD_FAIL_CREDENTIAL_CHAIN = false;\nconst resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger, }) => {\n let token;\n const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;\n if (ssoSession) {\n try {\n const _token = await tokenProviders.fromSso({\n profile,\n filepath,\n configFilepath,\n ignoreCache,\n })();\n token = {\n accessToken: _token.token,\n expiresAt: new Date(_token.expiration).toISOString(),\n };\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(e.message, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n }\n else {\n try {\n token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl);\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n }\n if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {\n throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const { accessToken } = token;\n const { SSOClient, GetRoleCredentialsCommand } = await Promise.resolve().then(function () { return require('./loadSso-CVy8iqsZ.js'); });\n const sso = ssoClient ||\n new SSOClient(Object.assign({}, clientConfig ?? {}, {\n logger: clientConfig?.logger ?? parentClientConfig?.logger,\n region: clientConfig?.region ?? ssoRegion,\n userAgentAppId: clientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId,\n }));\n let ssoResp;\n try {\n ssoResp = await sso.send(new GetRoleCredentialsCommand({\n accountId: ssoAccountId,\n roleName: ssoRoleName,\n accessToken,\n }));\n }\n catch (e) {\n throw new propertyProvider.CredentialsProviderError(e, {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}, } = ssoResp;\n if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {\n throw new propertyProvider.CredentialsProviderError(\"SSO returns an invalid temporary credential.\", {\n tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,\n logger,\n });\n }\n const credentials = {\n accessKeyId,\n secretAccessKey,\n sessionToken,\n expiration: new Date(expiration),\n ...(credentialScope && { credentialScope }),\n ...(accountId && { accountId }),\n };\n if (ssoSession) {\n client.setCredentialFeature(credentials, \"CREDENTIALS_SSO\", \"s\");\n }\n else {\n client.setCredentialFeature(credentials, \"CREDENTIALS_SSO_LEGACY\", \"u\");\n }\n return credentials;\n};\n\nconst validateSsoProfile = (profile, logger) => {\n const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;\n if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {\n throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", ` +\n `\"sso_region\", \"sso_role_name\", \"sso_start_url\". Got ${Object.keys(profile).join(\", \")}\\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });\n }\n return profile;\n};\n\nconst fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-sso - fromSSO\");\n const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;\n const { ssoClient } = init;\n const profileName = sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n });\n if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n const profile = profiles[profileName];\n if (!profile) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });\n }\n if (!isSsoProfile(profile)) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {\n logger: init.logger,\n });\n }\n if (profile?.sso_session) {\n const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init);\n const session = ssoSessions[profile.sso_session];\n const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;\n if (ssoRegion && ssoRegion !== session.sso_region) {\n throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {\n tryNextLink: false,\n logger: init.logger,\n });\n }\n if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {\n throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {\n tryNextLink: false,\n logger: init.logger,\n });\n }\n profile.sso_region = session.sso_region;\n profile.sso_start_url = session.sso_start_url;\n }\n const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);\n return resolveSSOCredentials({\n ssoStartUrl: sso_start_url,\n ssoSession: sso_session,\n ssoAccountId: sso_account_id,\n ssoRegion: sso_region,\n ssoRoleName: sso_role_name,\n ssoClient: ssoClient,\n clientConfig: init.clientConfig,\n parentClientConfig: init.parentClientConfig,\n profile: profileName,\n filepath: init.filepath,\n configFilepath: init.configFilepath,\n ignoreCache: init.ignoreCache,\n logger: init.logger,\n });\n }\n else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {\n throw new propertyProvider.CredentialsProviderError(\"Incomplete configuration. The fromSSO() argument hash must include \" +\n '\"ssoStartUrl\", \"ssoAccountId\", \"ssoRegion\", \"ssoRoleName\"', { tryNextLink: false, logger: init.logger });\n }\n else {\n return resolveSSOCredentials({\n ssoStartUrl,\n ssoSession,\n ssoAccountId,\n ssoRegion,\n ssoRoleName,\n ssoClient,\n clientConfig: init.clientConfig,\n parentClientConfig: init.parentClientConfig,\n profile: profileName,\n filepath: init.filepath,\n configFilepath: init.configFilepath,\n ignoreCache: init.ignoreCache,\n logger: init.logger,\n });\n }\n};\n\nexports.fromSSO = fromSSO;\nexports.isSsoProfile = isSsoProfile;\nexports.validateSsoProfile = validateSsoProfile;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultSigninHttpAuthSchemeProvider = exports.defaultSigninHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultSigninHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultSigninHttpAuthSchemeParametersProvider = defaultSigninHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"signin\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultSigninHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"CreateOAuth2Token\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultSigninHttpAuthSchemeProvider = defaultSigninHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst u = \"required\", v = \"fn\", w = \"argv\", x = \"ref\";\nconst a = true, b = \"isSet\", c = \"booleanEquals\", d = \"error\", e = \"endpoint\", f = \"tree\", g = \"PartitionResult\", h = \"stringEquals\", i = { [u]: true, \"default\": false, \"type\": \"boolean\" }, j = { [u]: false, \"type\": \"string\" }, k = { [x]: \"Endpoint\" }, l = { [v]: c, [w]: [{ [x]: \"UseFIPS\" }, true] }, m = { [v]: c, [w]: [{ [x]: \"UseDualStack\" }, true] }, n = {}, o = { [v]: \"getAttr\", [w]: [{ [x]: g }, \"name\"] }, p = { [v]: c, [w]: [{ [x]: \"UseFIPS\" }, false] }, q = { [v]: c, [w]: [{ [x]: \"UseDualStack\" }, false] }, r = { [v]: \"getAttr\", [w]: [{ [x]: g }, \"supportsFIPS\"] }, s = { [v]: c, [w]: [true, { [v]: \"getAttr\", [w]: [{ [x]: g }, \"supportsDualStack\"] }] }, t = [{ [x]: \"Region\" }];\nconst _data = { version: \"1.0\", parameters: { UseDualStack: i, UseFIPS: i, Endpoint: j, Region: j }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: [l], error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", type: d }, { rules: [{ conditions: [m], error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: \"aws.partition\", [w]: t, assign: g }], rules: [{ conditions: [{ [v]: h, [w]: [o, \"aws\"] }, p, q], endpoint: { url: \"https://{Region}.signin.aws.amazon.com\", properties: n, headers: n }, type: e }, { conditions: [{ [v]: h, [w]: [o, \"aws-cn\"] }, p, q], endpoint: { url: \"https://{Region}.signin.amazonaws.cn\", properties: n, headers: n }, type: e }, { conditions: [{ [v]: h, [w]: [o, \"aws-us-gov\"] }, p, q], endpoint: { url: \"https://{Region}.signin.amazonaws-us-gov.com\", properties: n, headers: n }, type: e }, { conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, r] }, s], rules: [{ endpoint: { url: \"https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", type: d }], type: f }, { conditions: [l, q], rules: [{ conditions: [{ [v]: c, [w]: [r, a] }], rules: [{ endpoint: { url: \"https://signin-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"FIPS is enabled but this partition does not support FIPS\", type: d }], type: f }, { conditions: [p, m], rules: [{ conditions: [s], rules: [{ endpoint: { url: \"https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"DualStack is enabled but this partition does not support DualStack\", type: d }], type: f }, { endpoint: { url: \"https://signin.{Region}.{PartitionResult#dnsSuffix}\", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: \"Invalid Configuration: Missing Region\", type: d }], type: f }] };\nexports.ruleSet = _data;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2023-01-01\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSigninHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: \"com.amazonaws.signin\" }),\n serviceId: config?.serviceId ?? \"Signin\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../../../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"signin\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass SigninClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSigninHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nlet SigninServiceException$1 = class SigninServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, SigninServiceException.prototype);\n }\n};\n\nlet AccessDeniedException$1 = class AccessDeniedException extends SigninServiceException$1 {\n name = \"AccessDeniedException\";\n $fault = \"client\";\n error;\n constructor(opts) {\n super({\n name: \"AccessDeniedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, AccessDeniedException.prototype);\n this.error = opts.error;\n }\n};\nlet InternalServerException$1 = class InternalServerException extends SigninServiceException$1 {\n name = \"InternalServerException\";\n $fault = \"server\";\n error;\n constructor(opts) {\n super({\n name: \"InternalServerException\",\n $fault: \"server\",\n ...opts,\n });\n Object.setPrototypeOf(this, InternalServerException.prototype);\n this.error = opts.error;\n }\n};\nlet TooManyRequestsError$1 = class TooManyRequestsError extends SigninServiceException$1 {\n name = \"TooManyRequestsError\";\n $fault = \"client\";\n error;\n constructor(opts) {\n super({\n name: \"TooManyRequestsError\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, TooManyRequestsError.prototype);\n this.error = opts.error;\n }\n};\nlet ValidationException$1 = class ValidationException extends SigninServiceException$1 {\n name = \"ValidationException\";\n $fault = \"client\";\n error;\n constructor(opts) {\n super({\n name: \"ValidationException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ValidationException.prototype);\n this.error = opts.error;\n }\n};\n\nconst _ADE = \"AccessDeniedException\";\nconst _AT = \"AccessToken\";\nconst _COAT = \"CreateOAuth2Token\";\nconst _COATR = \"CreateOAuth2TokenRequest\";\nconst _COATRB = \"CreateOAuth2TokenRequestBody\";\nconst _COATRBr = \"CreateOAuth2TokenResponseBody\";\nconst _COATRr = \"CreateOAuth2TokenResponse\";\nconst _ISE = \"InternalServerException\";\nconst _RT = \"RefreshToken\";\nconst _TMRE = \"TooManyRequestsError\";\nconst _VE = \"ValidationException\";\nconst _aKI = \"accessKeyId\";\nconst _aT = \"accessToken\";\nconst _c = \"client\";\nconst _cI = \"clientId\";\nconst _cV = \"codeVerifier\";\nconst _co = \"code\";\nconst _e = \"error\";\nconst _eI = \"expiresIn\";\nconst _gT = \"grantType\";\nconst _h = \"http\";\nconst _hE = \"httpError\";\nconst _iT = \"idToken\";\nconst _jN = \"jsonName\";\nconst _m = \"message\";\nconst _rT = \"refreshToken\";\nconst _rU = \"redirectUri\";\nconst _s = \"server\";\nconst _sAK = \"secretAccessKey\";\nconst _sT = \"sessionToken\";\nconst _sm = \"smithy.ts.sdk.synthetic.com.amazonaws.signin\";\nconst _tI = \"tokenInput\";\nconst _tO = \"tokenOutput\";\nconst _tT = \"tokenType\";\nconst n0 = \"com.amazonaws.signin\";\nvar RefreshToken = [0, n0, _RT, 8, 0];\nvar AccessDeniedException = [\n -3,\n n0,\n _ADE,\n {\n [_e]: _c,\n },\n [_e, _m],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1);\nvar AccessToken = [\n 3,\n n0,\n _AT,\n 8,\n [_aKI, _sAK, _sT],\n [\n [\n 0,\n {\n [_jN]: _aKI,\n },\n ],\n [\n 0,\n {\n [_jN]: _sAK,\n },\n ],\n [\n 0,\n {\n [_jN]: _sT,\n },\n ],\n ],\n];\nvar CreateOAuth2TokenRequest = [\n 3,\n n0,\n _COATR,\n 0,\n [_tI],\n [[() => CreateOAuth2TokenRequestBody, 16]],\n];\nvar CreateOAuth2TokenRequestBody = [\n 3,\n n0,\n _COATRB,\n 0,\n [_cI, _gT, _co, _rU, _cV, _rT],\n [\n [\n 0,\n {\n [_jN]: _cI,\n },\n ],\n [\n 0,\n {\n [_jN]: _gT,\n },\n ],\n 0,\n [\n 0,\n {\n [_jN]: _rU,\n },\n ],\n [\n 0,\n {\n [_jN]: _cV,\n },\n ],\n [\n () => RefreshToken,\n {\n [_jN]: _rT,\n },\n ],\n ],\n];\nvar CreateOAuth2TokenResponse = [\n 3,\n n0,\n _COATRr,\n 0,\n [_tO],\n [[() => CreateOAuth2TokenResponseBody, 16]],\n];\nvar CreateOAuth2TokenResponseBody = [\n 3,\n n0,\n _COATRBr,\n 0,\n [_aT, _tT, _eI, _rT, _iT],\n [\n [\n () => AccessToken,\n {\n [_jN]: _aT,\n },\n ],\n [\n 0,\n {\n [_jN]: _tT,\n },\n ],\n [\n 1,\n {\n [_jN]: _eI,\n },\n ],\n [\n () => RefreshToken,\n {\n [_jN]: _rT,\n },\n ],\n [\n 0,\n {\n [_jN]: _iT,\n },\n ],\n ],\n];\nvar InternalServerException = [\n -3,\n n0,\n _ISE,\n {\n [_e]: _s,\n [_hE]: 500,\n },\n [_e, _m],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1);\nvar TooManyRequestsError = [\n -3,\n n0,\n _TMRE,\n {\n [_e]: _c,\n [_hE]: 429,\n },\n [_e, _m],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(TooManyRequestsError, TooManyRequestsError$1);\nvar ValidationException = [\n -3,\n n0,\n _VE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _m],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1);\nvar SigninServiceException = [-3, _sm, \"SigninServiceException\", 0, [], []];\nschema.TypeRegistry.for(_sm).registerError(SigninServiceException, SigninServiceException$1);\nvar CreateOAuth2Token = [\n 9,\n n0,\n _COAT,\n {\n [_h]: [\"POST\", \"/v1/token\", 200],\n },\n () => CreateOAuth2TokenRequest,\n () => CreateOAuth2TokenResponse,\n];\n\nclass CreateOAuth2TokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"Signin\", \"CreateOAuth2Token\", {})\n .n(\"SigninClient\", \"CreateOAuth2TokenCommand\")\n .sc(CreateOAuth2Token)\n .build() {\n}\n\nconst commands = {\n CreateOAuth2TokenCommand,\n};\nclass Signin extends SigninClient {\n}\nsmithyClient.createAggregatedClient(commands, Signin);\n\nconst OAuth2ErrorCode = {\n AUTHCODE_EXPIRED: \"AUTHCODE_EXPIRED\",\n INSUFFICIENT_PERMISSIONS: \"INSUFFICIENT_PERMISSIONS\",\n INVALID_REQUEST: \"INVALID_REQUEST\",\n SERVER_ERROR: \"server_error\",\n TOKEN_EXPIRED: \"TOKEN_EXPIRED\",\n USER_CREDENTIALS_CHANGED: \"USER_CREDENTIALS_CHANGED\",\n};\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nObject.defineProperty(exports, \"__Client\", {\n enumerable: true,\n get: function () { return smithyClient.Client; }\n});\nexports.AccessDeniedException = AccessDeniedException$1;\nexports.CreateOAuth2TokenCommand = CreateOAuth2TokenCommand;\nexports.InternalServerException = InternalServerException$1;\nexports.OAuth2ErrorCode = OAuth2ErrorCode;\nexports.Signin = Signin;\nexports.SigninClient = SigninClient;\nexports.SigninServiceException = SigninServiceException$1;\nexports.TooManyRequestsError = TooManyRequestsError$1;\nexports.ValidationException = ValidationException$1;\n", - "'use strict';\n\nvar client = require('@aws-sdk/core/client');\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar protocolHttp = require('@smithy/protocol-http');\nvar node_crypto = require('node:crypto');\nvar node_fs = require('node:fs');\nvar node_os = require('node:os');\nvar node_path = require('node:path');\n\nclass LoginCredentialsFetcher {\n profileData;\n init;\n callerClientConfig;\n static REFRESH_THRESHOLD = 5 * 60 * 1000;\n constructor(profileData, init, callerClientConfig) {\n this.profileData = profileData;\n this.init = init;\n this.callerClientConfig = callerClientConfig;\n }\n async loadCredentials() {\n const token = await this.loadToken();\n if (!token) {\n throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger });\n }\n const accessToken = token.accessToken;\n const now = Date.now();\n const expiryTime = new Date(accessToken.expiresAt).getTime();\n const timeUntilExpiry = expiryTime - now;\n if (timeUntilExpiry <= LoginCredentialsFetcher.REFRESH_THRESHOLD) {\n return this.refresh(token);\n }\n return {\n accessKeyId: accessToken.accessKeyId,\n secretAccessKey: accessToken.secretAccessKey,\n sessionToken: accessToken.sessionToken,\n accountId: accessToken.accountId,\n expiration: new Date(accessToken.expiresAt),\n };\n }\n get logger() {\n return this.init?.logger;\n }\n get loginSession() {\n return this.profileData.login_session;\n }\n async refresh(token) {\n const { SigninClient, CreateOAuth2TokenCommand } = await import('@aws-sdk/nested-clients/signin');\n const { logger, userAgentAppId } = this.callerClientConfig ?? {};\n const isH2 = (requestHandler) => {\n return requestHandler?.metadata?.handlerProtocol === \"h2\";\n };\n const requestHandler = isH2(this.callerClientConfig?.requestHandler)\n ? undefined\n : this.callerClientConfig?.requestHandler;\n const region = this.profileData.region ?? (await this.callerClientConfig?.region?.()) ?? process.env.AWS_REGION;\n const client = new SigninClient({\n credentials: {\n accessKeyId: \"\",\n secretAccessKey: \"\",\n },\n region,\n requestHandler,\n logger,\n userAgentAppId,\n ...this.init?.clientConfig,\n });\n this.createDPoPInterceptor(client.middlewareStack);\n const commandInput = {\n tokenInput: {\n clientId: token.clientId,\n refreshToken: token.refreshToken,\n grantType: \"refresh_token\",\n },\n };\n try {\n const response = await client.send(new CreateOAuth2TokenCommand(commandInput));\n const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {};\n const { refreshToken, expiresIn } = response.tokenOutput ?? {};\n if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) {\n throw new propertyProvider.CredentialsProviderError(\"Token refresh response missing required fields\", {\n logger: this.logger,\n tryNextLink: false,\n });\n }\n const expiresInMs = (expiresIn ?? 900) * 1000;\n const expiration = new Date(Date.now() + expiresInMs);\n const updatedToken = {\n ...token,\n accessToken: {\n ...token.accessToken,\n accessKeyId: accessKeyId,\n secretAccessKey: secretAccessKey,\n sessionToken: sessionToken,\n expiresAt: expiration.toISOString(),\n },\n refreshToken: refreshToken,\n };\n await this.saveToken(updatedToken);\n const newAccessToken = updatedToken.accessToken;\n return {\n accessKeyId: newAccessToken.accessKeyId,\n secretAccessKey: newAccessToken.secretAccessKey,\n sessionToken: newAccessToken.sessionToken,\n accountId: newAccessToken.accountId,\n expiration,\n };\n }\n catch (error) {\n if (error.name === \"AccessDeniedException\") {\n const errorType = error.error;\n let message;\n switch (errorType) {\n case \"TOKEN_EXPIRED\":\n message = \"Your session has expired. Please reauthenticate.\";\n break;\n case \"USER_CREDENTIALS_CHANGED\":\n message =\n \"Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.\";\n break;\n case \"INSUFFICIENT_PERMISSIONS\":\n message =\n \"Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.\";\n break;\n default:\n message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \\`aws login\\``;\n }\n throw new propertyProvider.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false });\n }\n throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger });\n }\n }\n async loadToken() {\n const tokenFilePath = this.getTokenFilePath();\n try {\n let tokenData;\n try {\n tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache });\n }\n catch {\n tokenData = await node_fs.promises.readFile(tokenFilePath, \"utf8\");\n }\n const token = JSON.parse(tokenData);\n const missingFields = [\"accessToken\", \"clientId\", \"refreshToken\", \"dpopKey\"].filter((k) => !token[k]);\n if (!token.accessToken?.accountId) {\n missingFields.push(\"accountId\");\n }\n if (missingFields.length > 0) {\n throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(\", \")}`, {\n logger: this.logger,\n tryNextLink: false,\n });\n }\n return token;\n }\n catch (error) {\n throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, {\n logger: this.logger,\n tryNextLink: false,\n });\n }\n }\n async saveToken(token) {\n const tokenFilePath = this.getTokenFilePath();\n const directory = node_path.dirname(tokenFilePath);\n try {\n await node_fs.promises.mkdir(directory, { recursive: true });\n }\n catch (error) {\n }\n await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), \"utf8\");\n }\n getTokenFilePath() {\n const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), \".aws\", \"login\", \"cache\");\n const loginSessionBytes = Buffer.from(this.loginSession, \"utf8\");\n const loginSessionSha256 = node_crypto.createHash(\"sha256\").update(loginSessionBytes).digest(\"hex\");\n return node_path.join(directory, `${loginSessionSha256}.json`);\n }\n derToRawSignature(derSignature) {\n let offset = 2;\n if (derSignature[offset] !== 0x02) {\n throw new Error(\"Invalid DER signature\");\n }\n offset++;\n const rLength = derSignature[offset++];\n let r = derSignature.subarray(offset, offset + rLength);\n offset += rLength;\n if (derSignature[offset] !== 0x02) {\n throw new Error(\"Invalid DER signature\");\n }\n offset++;\n const sLength = derSignature[offset++];\n let s = derSignature.subarray(offset, offset + sLength);\n r = r[0] === 0x00 ? r.subarray(1) : r;\n s = s[0] === 0x00 ? s.subarray(1) : s;\n const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]);\n const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]);\n return Buffer.concat([rPadded, sPadded]);\n }\n createDPoPInterceptor(middlewareStack) {\n middlewareStack.add((next) => async (args) => {\n if (protocolHttp.HttpRequest.isInstance(args.request)) {\n const request = args.request;\n const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : \"\"}${request.path}`;\n const dpop = await this.generateDpop(request.method, actualEndpoint);\n request.headers = {\n ...request.headers,\n DPoP: dpop,\n };\n }\n return next(args);\n }, {\n step: \"finalizeRequest\",\n name: \"dpopInterceptor\",\n override: true,\n });\n }\n async generateDpop(method = \"POST\", endpoint) {\n const token = await this.loadToken();\n try {\n const privateKey = node_crypto.createPrivateKey({\n key: token.dpopKey,\n format: \"pem\",\n type: \"sec1\",\n });\n const publicKey = node_crypto.createPublicKey(privateKey);\n const publicDer = publicKey.export({ format: \"der\", type: \"spki\" });\n let pointStart = -1;\n for (let i = 0; i < publicDer.length; i++) {\n if (publicDer[i] === 0x04) {\n pointStart = i;\n break;\n }\n }\n const x = publicDer.slice(pointStart + 1, pointStart + 33);\n const y = publicDer.slice(pointStart + 33, pointStart + 65);\n const header = {\n alg: \"ES256\",\n typ: \"dpop+jwt\",\n jwk: {\n kty: \"EC\",\n crv: \"P-256\",\n x: x.toString(\"base64url\"),\n y: y.toString(\"base64url\"),\n },\n };\n const payload = {\n jti: crypto.randomUUID(),\n htm: method,\n htu: endpoint,\n iat: Math.floor(Date.now() / 1000),\n };\n const headerB64 = Buffer.from(JSON.stringify(header)).toString(\"base64url\");\n const payloadB64 = Buffer.from(JSON.stringify(payload)).toString(\"base64url\");\n const message = `${headerB64}.${payloadB64}`;\n const asn1Signature = node_crypto.sign(\"sha256\", Buffer.from(message), privateKey);\n const rawSignature = this.derToRawSignature(asn1Signature);\n const signatureB64 = rawSignature.toString(\"base64url\");\n return `${message}.${signatureB64}`;\n }\n catch (error) {\n throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, { logger: this.logger, tryNextLink: false });\n }\n }\n}\n\nconst fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {\n init?.logger?.debug?.(\"@aws-sdk/credential-providers - fromLoginCredentials\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init || {});\n const profileName = sharedIniFileLoader.getProfileName({\n profile: init?.profile ?? callerClientConfig?.profile,\n });\n const profile = profiles[profileName];\n if (!profile?.login_session) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {\n tryNextLink: true,\n logger: init?.logger,\n });\n }\n const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig);\n const credentials = await fetcher.loadCredentials();\n return client.setCredentialFeature(credentials, \"CREDENTIALS_LOGIN\", \"AD\");\n};\n\nexports.fromLoginCredentials = fromLoginCredentials;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst STSClient_1 = require(\"../STSClient\");\nconst defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"sts\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultSTSHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"AssumeRoleWithWebIdentity\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider;\nconst resolveStsAuthConfig = (input) => Object.assign(input, {\n stsClientCtor: STSClient_1.STSClient,\n});\nexports.resolveStsAuthConfig = resolveStsAuthConfig;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, exports.resolveStsAuthConfig)(config);\n const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0);\n return Object.assign(config_1, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.commonParams = exports.resolveClientEndpointParameters = void 0;\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n useGlobalEndpoint: options.useGlobalEndpoint ?? false,\n defaultSigningName: \"sts\",\n });\n};\nexports.resolveClientEndpointParameters = resolveClientEndpointParameters;\nexports.commonParams = {\n UseGlobalEndpoint: { type: \"builtInParams\", name: \"useGlobalEndpoint\" },\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst F = \"required\", G = \"type\", H = \"fn\", I = \"argv\", J = \"ref\";\nconst a = false, b = true, c = \"booleanEquals\", d = \"stringEquals\", e = \"sigv4\", f = \"sts\", g = \"us-east-1\", h = \"endpoint\", i = \"https://sts.{Region}.{PartitionResult#dnsSuffix}\", j = \"tree\", k = \"error\", l = \"getAttr\", m = { [F]: false, [G]: \"string\" }, n = { [F]: true, \"default\": false, [G]: \"boolean\" }, o = { [J]: \"Endpoint\" }, p = { [H]: \"isSet\", [I]: [{ [J]: \"Region\" }] }, q = { [J]: \"Region\" }, r = { [H]: \"aws.partition\", [I]: [q], \"assign\": \"PartitionResult\" }, s = { [J]: \"UseFIPS\" }, t = { [J]: \"UseDualStack\" }, u = { \"url\": \"https://sts.amazonaws.com\", \"properties\": { \"authSchemes\": [{ \"name\": e, \"signingName\": f, \"signingRegion\": g }] }, \"headers\": {} }, v = {}, w = { \"conditions\": [{ [H]: d, [I]: [q, \"aws-global\"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: \"PartitionResult\" }, \"supportsFIPS\"] }, A = { [J]: \"PartitionResult\" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, \"supportsDualStack\"] }] }, C = [{ [H]: \"isSet\", [I]: [o] }], D = [x], E = [y];\nconst _data = { version: \"1.0\", parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: \"UseGlobalEndpoint\" }, b] }, { [H]: \"not\", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, \"ap-northeast-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"ap-south-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"ap-southeast-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"ap-southeast-2\"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, \"ca-central-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-central-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-north-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-west-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-west-2\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-west-3\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"sa-east-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"us-east-2\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"us-west-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"us-west-2\"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: \"{Region}\" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", [G]: k }, { conditions: E, error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: \"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: v, headers: v }, [G]: h }], [G]: j }, { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, \"name\"] }, \"aws-us-gov\"] }], endpoint: { url: \"https://sts.{Region}.amazonaws.com\", properties: v, headers: v }, [G]: h }, { endpoint: { url: \"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: v, headers: v }, [G]: h }], [G]: j }, { error: \"FIPS is enabled but this partition does not support FIPS\", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: \"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: v, headers: v }, [G]: h }], [G]: j }, { error: \"DualStack is enabled but this partition does not support DualStack\", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: \"Invalid Configuration: Missing Region\", [G]: k }] };\nexports.ruleSet = _data;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\", \"UseGlobalEndpoint\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2011-06-15\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ??\n new protocols_1.AwsQueryProtocol({\n defaultNamespace: \"com.amazonaws.sts\",\n xmlNamespace: \"https://sts.amazonaws.com/doc/2011-06-15/\",\n version: \"2011-06-15\",\n }),\n serviceId: config?.serviceId ?? \"STS\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../../../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst core_2 = require(\"@smithy/core\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\") ||\n (async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0;\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nexports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration;\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\nexports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveRuntimeExtensions = void 0;\nconst region_config_resolver_1 = require(\"@aws-sdk/region-config-resolver\");\nconst protocol_http_1 = require(\"@smithy/protocol-http\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst httpAuthExtensionConfiguration_1 = require(\"./auth/httpAuthExtensionConfiguration\");\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration));\n};\nexports.resolveRuntimeExtensions = resolveRuntimeExtensions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.STSClient = exports.__Client = void 0;\nconst middleware_host_header_1 = require(\"@aws-sdk/middleware-host-header\");\nconst middleware_logger_1 = require(\"@aws-sdk/middleware-logger\");\nconst middleware_recursion_detection_1 = require(\"@aws-sdk/middleware-recursion-detection\");\nconst middleware_user_agent_1 = require(\"@aws-sdk/middleware-user-agent\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst core_1 = require(\"@smithy/core\");\nconst schema_1 = require(\"@smithy/core/schema\");\nconst middleware_content_length_1 = require(\"@smithy/middleware-content-length\");\nconst middleware_endpoint_1 = require(\"@smithy/middleware-endpoint\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nObject.defineProperty(exports, \"__Client\", { enumerable: true, get: function () { return smithy_client_1.Client; } });\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst EndpointParameters_1 = require(\"./endpoint/EndpointParameters\");\nconst runtimeConfig_1 = require(\"./runtimeConfig\");\nconst runtimeExtensions_1 = require(\"./runtimeExtensions\");\nclass STSClient extends smithy_client_1.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);\n const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1);\n const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2);\n const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3);\n const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);\n const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5);\n const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6);\n const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use((0, schema_1.getSchemaSerdePlugin)(this.config));\n this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));\n this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));\n this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));\n this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));\n this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));\n this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));\n this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core_1.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\nexports.STSClient = STSClient;\n", - "'use strict';\n\nvar STSClient = require('./STSClient');\nvar smithyClient = require('@smithy/smithy-client');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar EndpointParameters = require('./endpoint/EndpointParameters');\nvar schema = require('@smithy/core/schema');\nvar client = require('@aws-sdk/core/client');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\n\nlet STSServiceException$1 = class STSServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, STSServiceException.prototype);\n }\n};\n\nlet ExpiredTokenException$1 = class ExpiredTokenException extends STSServiceException$1 {\n name = \"ExpiredTokenException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ExpiredTokenException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ExpiredTokenException.prototype);\n }\n};\nlet MalformedPolicyDocumentException$1 = class MalformedPolicyDocumentException extends STSServiceException$1 {\n name = \"MalformedPolicyDocumentException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"MalformedPolicyDocumentException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);\n }\n};\nlet PackedPolicyTooLargeException$1 = class PackedPolicyTooLargeException extends STSServiceException$1 {\n name = \"PackedPolicyTooLargeException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"PackedPolicyTooLargeException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);\n }\n};\nlet RegionDisabledException$1 = class RegionDisabledException extends STSServiceException$1 {\n name = \"RegionDisabledException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"RegionDisabledException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, RegionDisabledException.prototype);\n }\n};\nlet IDPRejectedClaimException$1 = class IDPRejectedClaimException extends STSServiceException$1 {\n name = \"IDPRejectedClaimException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"IDPRejectedClaimException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);\n }\n};\nlet InvalidIdentityTokenException$1 = class InvalidIdentityTokenException extends STSServiceException$1 {\n name = \"InvalidIdentityTokenException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"InvalidIdentityTokenException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);\n }\n};\nlet IDPCommunicationErrorException$1 = class IDPCommunicationErrorException extends STSServiceException$1 {\n name = \"IDPCommunicationErrorException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"IDPCommunicationErrorException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);\n }\n};\n\nconst _A = \"Arn\";\nconst _AKI = \"AccessKeyId\";\nconst _AR = \"AssumeRole\";\nconst _ARI = \"AssumedRoleId\";\nconst _ARR = \"AssumeRoleRequest\";\nconst _ARRs = \"AssumeRoleResponse\";\nconst _ARU = \"AssumedRoleUser\";\nconst _ARWWI = \"AssumeRoleWithWebIdentity\";\nconst _ARWWIR = \"AssumeRoleWithWebIdentityRequest\";\nconst _ARWWIRs = \"AssumeRoleWithWebIdentityResponse\";\nconst _Au = \"Audience\";\nconst _C = \"Credentials\";\nconst _CA = \"ContextAssertion\";\nconst _DS = \"DurationSeconds\";\nconst _E = \"Expiration\";\nconst _EI = \"ExternalId\";\nconst _ETE = \"ExpiredTokenException\";\nconst _IDPCEE = \"IDPCommunicationErrorException\";\nconst _IDPRCE = \"IDPRejectedClaimException\";\nconst _IITE = \"InvalidIdentityTokenException\";\nconst _K = \"Key\";\nconst _MPDE = \"MalformedPolicyDocumentException\";\nconst _P = \"Policy\";\nconst _PA = \"PolicyArns\";\nconst _PAr = \"ProviderArn\";\nconst _PC = \"ProvidedContexts\";\nconst _PCLT = \"ProvidedContextsListType\";\nconst _PCr = \"ProvidedContext\";\nconst _PDT = \"PolicyDescriptorType\";\nconst _PI = \"ProviderId\";\nconst _PPS = \"PackedPolicySize\";\nconst _PPTLE = \"PackedPolicyTooLargeException\";\nconst _Pr = \"Provider\";\nconst _RA = \"RoleArn\";\nconst _RDE = \"RegionDisabledException\";\nconst _RSN = \"RoleSessionName\";\nconst _SAK = \"SecretAccessKey\";\nconst _SFWIT = \"SubjectFromWebIdentityToken\";\nconst _SI = \"SourceIdentity\";\nconst _SN = \"SerialNumber\";\nconst _ST = \"SessionToken\";\nconst _T = \"Tags\";\nconst _TC = \"TokenCode\";\nconst _TTK = \"TransitiveTagKeys\";\nconst _Ta = \"Tag\";\nconst _V = \"Value\";\nconst _WIT = \"WebIdentityToken\";\nconst _a = \"arn\";\nconst _aKST = \"accessKeySecretType\";\nconst _aQE = \"awsQueryError\";\nconst _c = \"client\";\nconst _cTT = \"clientTokenType\";\nconst _e = \"error\";\nconst _hE = \"httpError\";\nconst _m = \"message\";\nconst _pDLT = \"policyDescriptorListType\";\nconst _s = \"smithy.ts.sdk.synthetic.com.amazonaws.sts\";\nconst _tLT = \"tagListType\";\nconst n0 = \"com.amazonaws.sts\";\nvar accessKeySecretType = [0, n0, _aKST, 8, 0];\nvar clientTokenType = [0, n0, _cTT, 8, 0];\nvar AssumedRoleUser = [3, n0, _ARU, 0, [_ARI, _A], [0, 0]];\nvar AssumeRoleRequest = [\n 3,\n n0,\n _ARR,\n 0,\n [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC],\n [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType],\n];\nvar AssumeRoleResponse = [\n 3,\n n0,\n _ARRs,\n 0,\n [_C, _ARU, _PPS, _SI],\n [[() => Credentials, 0], () => AssumedRoleUser, 1, 0],\n];\nvar AssumeRoleWithWebIdentityRequest = [\n 3,\n n0,\n _ARWWIR,\n 0,\n [_RA, _RSN, _WIT, _PI, _PA, _P, _DS],\n [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1],\n];\nvar AssumeRoleWithWebIdentityResponse = [\n 3,\n n0,\n _ARWWIRs,\n 0,\n [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI],\n [[() => Credentials, 0], 0, () => AssumedRoleUser, 1, 0, 0, 0],\n];\nvar Credentials = [\n 3,\n n0,\n _C,\n 0,\n [_AKI, _SAK, _ST, _E],\n [0, [() => accessKeySecretType, 0], 0, 4],\n];\nvar ExpiredTokenException = [\n -3,\n n0,\n _ETE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`ExpiredTokenException`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1);\nvar IDPCommunicationErrorException = [\n -3,\n n0,\n _IDPCEE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`IDPCommunicationError`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(IDPCommunicationErrorException, IDPCommunicationErrorException$1);\nvar IDPRejectedClaimException = [\n -3,\n n0,\n _IDPRCE,\n {\n [_e]: _c,\n [_hE]: 403,\n [_aQE]: [`IDPRejectedClaim`, 403],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(IDPRejectedClaimException, IDPRejectedClaimException$1);\nvar InvalidIdentityTokenException = [\n -3,\n n0,\n _IITE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`InvalidIdentityToken`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidIdentityTokenException, InvalidIdentityTokenException$1);\nvar MalformedPolicyDocumentException = [\n -3,\n n0,\n _MPDE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`MalformedPolicyDocument`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(MalformedPolicyDocumentException, MalformedPolicyDocumentException$1);\nvar PackedPolicyTooLargeException = [\n -3,\n n0,\n _PPTLE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`PackedPolicyTooLarge`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(PackedPolicyTooLargeException, PackedPolicyTooLargeException$1);\nvar PolicyDescriptorType = [3, n0, _PDT, 0, [_a], [0]];\nvar ProvidedContext = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]];\nvar RegionDisabledException = [\n -3,\n n0,\n _RDE,\n {\n [_e]: _c,\n [_hE]: 403,\n [_aQE]: [`RegionDisabledException`, 403],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(RegionDisabledException, RegionDisabledException$1);\nvar Tag = [3, n0, _Ta, 0, [_K, _V], [0, 0]];\nvar STSServiceException = [-3, _s, \"STSServiceException\", 0, [], []];\nschema.TypeRegistry.for(_s).registerError(STSServiceException, STSServiceException$1);\nvar policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType];\nvar ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext];\nvar tagListType = [1, n0, _tLT, 0, () => Tag];\nvar AssumeRole = [9, n0, _AR, 0, () => AssumeRoleRequest, () => AssumeRoleResponse];\nvar AssumeRoleWithWebIdentity = [\n 9,\n n0,\n _ARWWI,\n 0,\n () => AssumeRoleWithWebIdentityRequest,\n () => AssumeRoleWithWebIdentityResponse,\n];\n\nclass AssumeRoleCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"AssumeRole\", {})\n .n(\"STSClient\", \"AssumeRoleCommand\")\n .sc(AssumeRole)\n .build() {\n}\n\nclass AssumeRoleWithWebIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"AssumeRoleWithWebIdentity\", {})\n .n(\"STSClient\", \"AssumeRoleWithWebIdentityCommand\")\n .sc(AssumeRoleWithWebIdentity)\n .build() {\n}\n\nconst commands = {\n AssumeRoleCommand,\n AssumeRoleWithWebIdentityCommand,\n};\nclass STS extends STSClient.STSClient {\n}\nsmithyClient.createAggregatedClient(commands, STS);\n\nconst getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {\n if (typeof assumedRoleUser?.Arn === \"string\") {\n const arnComponents = assumedRoleUser.Arn.split(\":\");\n if (arnComponents.length > 4 && arnComponents[4] !== \"\") {\n return arnComponents[4];\n }\n }\n return undefined;\n};\nconst resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => {\n const region = typeof _region === \"function\" ? await _region() : _region;\n const parentRegion = typeof _parentRegion === \"function\" ? await _parentRegion() : _parentRegion;\n const stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)();\n credentialProviderLogger?.debug?.(\"@aws-sdk/client-sts::resolveRegion\", \"accepting first of:\", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`);\n return region ?? parentRegion ?? stsDefaultRegion;\n};\nconst getDefaultRoleAssumer$1 = (stsOptions, STSClient) => {\n let stsClient;\n let closureSourceCreds;\n return async (sourceCreds, params) => {\n closureSourceCreds = sourceCreds;\n if (!stsClient) {\n const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId, } = stsOptions;\n const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {\n logger,\n profile,\n });\n const isCompatibleRequestHandler = !isH2(requestHandler);\n stsClient = new STSClient({\n ...stsOptions,\n userAgentAppId,\n profile,\n credentialDefaultProvider: () => async () => closureSourceCreds,\n region: resolvedRegion,\n requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,\n logger: logger,\n });\n }\n const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params));\n if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {\n throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);\n }\n const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);\n const credentials = {\n accessKeyId: Credentials.AccessKeyId,\n secretAccessKey: Credentials.SecretAccessKey,\n sessionToken: Credentials.SessionToken,\n expiration: Credentials.Expiration,\n ...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),\n ...(accountId && { accountId }),\n };\n client.setCredentialFeature(credentials, \"CREDENTIALS_STS_ASSUME_ROLE\", \"i\");\n return credentials;\n };\n};\nconst getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient) => {\n let stsClient;\n return async (params) => {\n if (!stsClient) {\n const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId, } = stsOptions;\n const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {\n logger,\n profile,\n });\n const isCompatibleRequestHandler = !isH2(requestHandler);\n stsClient = new STSClient({\n ...stsOptions,\n userAgentAppId,\n profile,\n region: resolvedRegion,\n requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,\n logger: logger,\n });\n }\n const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));\n if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {\n throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);\n }\n const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);\n const credentials = {\n accessKeyId: Credentials.AccessKeyId,\n secretAccessKey: Credentials.SecretAccessKey,\n sessionToken: Credentials.SessionToken,\n expiration: Credentials.Expiration,\n ...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),\n ...(accountId && { accountId }),\n };\n if (accountId) {\n client.setCredentialFeature(credentials, \"RESOLVED_ACCOUNT_ID\", \"T\");\n }\n client.setCredentialFeature(credentials, \"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID\", \"k\");\n return credentials;\n };\n};\nconst isH2 = (requestHandler) => {\n return requestHandler?.metadata?.handlerProtocol === \"h2\";\n};\n\nconst getCustomizableStsClientCtor = (baseCtor, customizations) => {\n if (!customizations)\n return baseCtor;\n else\n return class CustomizableSTSClient extends baseCtor {\n constructor(config) {\n super(config);\n for (const customization of customizations) {\n this.middlewareStack.use(customization);\n }\n }\n };\n};\nconst getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));\nconst getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));\nconst decorateDefaultCredentialProvider = (provider) => (input) => provider({\n roleAssumer: getDefaultRoleAssumer(input),\n roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input),\n ...input,\n});\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nexports.AssumeRoleCommand = AssumeRoleCommand;\nexports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand;\nexports.ExpiredTokenException = ExpiredTokenException$1;\nexports.IDPCommunicationErrorException = IDPCommunicationErrorException$1;\nexports.IDPRejectedClaimException = IDPRejectedClaimException$1;\nexports.InvalidIdentityTokenException = InvalidIdentityTokenException$1;\nexports.MalformedPolicyDocumentException = MalformedPolicyDocumentException$1;\nexports.PackedPolicyTooLargeException = PackedPolicyTooLargeException$1;\nexports.RegionDisabledException = RegionDisabledException$1;\nexports.STS = STS;\nexports.STSServiceException = STSServiceException$1;\nexports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider;\nexports.getDefaultRoleAssumer = getDefaultRoleAssumer;\nexports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity;\nObject.keys(STSClient).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () { return STSClient[k]; }\n });\n});\n", - "'use strict';\n\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar propertyProvider = require('@smithy/property-provider');\nvar child_process = require('child_process');\nvar util = require('util');\nvar client = require('@aws-sdk/core/client');\n\nconst getValidatedProcessCredentials = (profileName, data, profiles) => {\n if (data.Version !== 1) {\n throw Error(`Profile ${profileName} credential_process did not return Version 1.`);\n }\n if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) {\n throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);\n }\n if (data.Expiration) {\n const currentTime = new Date();\n const expireTime = new Date(data.Expiration);\n if (expireTime < currentTime) {\n throw Error(`Profile ${profileName} credential_process returned expired credentials.`);\n }\n }\n let accountId = data.AccountId;\n if (!accountId && profiles?.[profileName]?.aws_account_id) {\n accountId = profiles[profileName].aws_account_id;\n }\n const credentials = {\n accessKeyId: data.AccessKeyId,\n secretAccessKey: data.SecretAccessKey,\n ...(data.SessionToken && { sessionToken: data.SessionToken }),\n ...(data.Expiration && { expiration: new Date(data.Expiration) }),\n ...(data.CredentialScope && { credentialScope: data.CredentialScope }),\n ...(accountId && { accountId }),\n };\n client.setCredentialFeature(credentials, \"CREDENTIALS_PROCESS\", \"w\");\n return credentials;\n};\n\nconst resolveProcessCredentials = async (profileName, profiles, logger) => {\n const profile = profiles[profileName];\n if (profiles[profileName]) {\n const credentialProcess = profile[\"credential_process\"];\n if (credentialProcess !== undefined) {\n const execPromise = util.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? child_process.exec);\n try {\n const { stdout } = await execPromise(credentialProcess);\n let data;\n try {\n data = JSON.parse(stdout.trim());\n }\n catch {\n throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);\n }\n return getValidatedProcessCredentials(profileName, data, profiles);\n }\n catch (error) {\n throw new propertyProvider.CredentialsProviderError(error.message, { logger });\n }\n }\n else {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });\n }\n }\n else {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {\n logger,\n });\n }\n};\n\nconst fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-process - fromProcess\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n return resolveProcessCredentials(sharedIniFileLoader.getProfileName({\n profile: init.profile ?? callerClientConfig?.profile,\n }), profiles, init.logger);\n};\n\nexports.fromProcess = fromProcess;\n", - "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromWebToken = void 0;\nconst fromWebToken = (init) => async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-web-identity - fromWebToken\");\n const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;\n let { roleAssumerWithWebIdentity } = init;\n if (!roleAssumerWithWebIdentity) {\n const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() => __importStar(require(\"@aws-sdk/nested-clients/sts\")));\n roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({\n ...init.clientConfig,\n credentialProviderLogger: init.logger,\n parentClientConfig: {\n ...awsIdentityProperties?.callerClientConfig,\n ...init.parentClientConfig,\n },\n }, init.clientPlugins);\n }\n return roleAssumerWithWebIdentity({\n RoleArn: roleArn,\n RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,\n WebIdentityToken: webIdentityToken,\n ProviderId: providerId,\n PolicyArns: policyArns,\n Policy: policy,\n DurationSeconds: durationSeconds,\n });\n};\nexports.fromWebToken = fromWebToken;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromTokenFile = void 0;\nconst client_1 = require(\"@aws-sdk/core/client\");\nconst property_provider_1 = require(\"@smithy/property-provider\");\nconst shared_ini_file_loader_1 = require(\"@smithy/shared-ini-file-loader\");\nconst fs_1 = require(\"fs\");\nconst fromWebToken_1 = require(\"./fromWebToken\");\nconst ENV_TOKEN_FILE = \"AWS_WEB_IDENTITY_TOKEN_FILE\";\nconst ENV_ROLE_ARN = \"AWS_ROLE_ARN\";\nconst ENV_ROLE_SESSION_NAME = \"AWS_ROLE_SESSION_NAME\";\nconst fromTokenFile = (init = {}) => async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-web-identity - fromTokenFile\");\n const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];\n const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];\n const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];\n if (!webIdentityTokenFile || !roleArn) {\n throw new property_provider_1.CredentialsProviderError(\"Web identity configuration not specified\", {\n logger: init.logger,\n });\n }\n const credentials = await (0, fromWebToken_1.fromWebToken)({\n ...init,\n webIdentityToken: shared_ini_file_loader_1.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ??\n (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: \"ascii\" }),\n roleArn,\n roleSessionName,\n })(awsIdentityProperties);\n if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {\n (0, client_1.setCredentialFeature)(credentials, \"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN\", \"h\");\n }\n return credentials;\n};\nexports.fromTokenFile = fromTokenFile;\n", - "'use strict';\n\nvar fromTokenFile = require('./fromTokenFile');\nvar fromWebToken = require('./fromWebToken');\n\n\n\nObject.keys(fromTokenFile).forEach(function (k) {\n\tif (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () { return fromTokenFile[k]; }\n\t});\n});\nObject.keys(fromWebToken).forEach(function (k) {\n\tif (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n\t\tenumerable: true,\n\t\tget: function () { return fromWebToken[k]; }\n\t});\n});\n", - "'use strict';\n\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar propertyProvider = require('@smithy/property-provider');\nvar client = require('@aws-sdk/core/client');\nvar credentialProviderLogin = require('@aws-sdk/credential-provider-login');\n\nconst resolveCredentialSource = (credentialSource, profileName, logger) => {\n const sourceProvidersMap = {\n EcsContainer: async (options) => {\n const { fromHttp } = await import('@aws-sdk/credential-provider-http');\n const { fromContainerMetadata } = await import('@smithy/credential-provider-imds');\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is EcsContainer\");\n return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);\n },\n Ec2InstanceMetadata: async (options) => {\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata\");\n const { fromInstanceMetadata } = await import('@smithy/credential-provider-imds');\n return async () => fromInstanceMetadata(options)().then(setNamedProvider);\n },\n Environment: async (options) => {\n logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is Environment\");\n const { fromEnv } = await import('@aws-sdk/credential-provider-env');\n return async () => fromEnv(options)().then(setNamedProvider);\n },\n };\n if (credentialSource in sourceProvidersMap) {\n return sourceProvidersMap[credentialSource];\n }\n else {\n throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` +\n `expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });\n }\n};\nconst setNamedProvider = (creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_NAMED_PROVIDER\", \"p\");\n\nconst isAssumeRoleProfile = (arg, { profile = \"default\", logger } = {}) => {\n return (Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.role_arn === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.role_session_name) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.external_id) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.mfa_serial) > -1 &&\n (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger })));\n};\nconst isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {\n const withSourceProfile = typeof arg.source_profile === \"string\" && typeof arg.credential_source === \"undefined\";\n if (withSourceProfile) {\n logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);\n }\n return withSourceProfile;\n};\nconst isCredentialSourceProfile = (arg, { profile, logger }) => {\n const withProviderProfile = typeof arg.credential_source === \"string\" && typeof arg.source_profile === \"undefined\";\n if (withProviderProfile) {\n logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);\n }\n return withProviderProfile;\n};\nconst resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}, resolveProfileData) => {\n options.logger?.debug(\"@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)\");\n const profileData = profiles[profileName];\n const { source_profile, region } = profileData;\n if (!options.roleAssumer) {\n const { getDefaultRoleAssumer } = await import('@aws-sdk/nested-clients/sts');\n options.roleAssumer = getDefaultRoleAssumer({\n ...options.clientConfig,\n credentialProviderLogger: options.logger,\n parentClientConfig: {\n ...options?.parentClientConfig,\n region: region ?? options?.parentClientConfig?.region,\n },\n }, options.clientPlugins);\n }\n if (source_profile && source_profile in visitedProfiles) {\n throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` +\n ` ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` +\n Object.keys(visitedProfiles).join(\", \"), { logger: options.logger });\n }\n options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);\n const sourceCredsProvider = source_profile\n ? resolveProfileData(source_profile, profiles, options, {\n ...visitedProfiles,\n [source_profile]: true,\n }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {}))\n : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();\n if (isCredentialSourceWithoutRoleArn(profileData)) {\n return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SOURCE_PROFILE\", \"o\"));\n }\n else {\n const params = {\n RoleArn: profileData.role_arn,\n RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,\n ExternalId: profileData.external_id,\n DurationSeconds: parseInt(profileData.duration_seconds || \"3600\", 10),\n };\n const { mfa_serial } = profileData;\n if (mfa_serial) {\n if (!options.mfaCodeProvider) {\n throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });\n }\n params.SerialNumber = mfa_serial;\n params.TokenCode = await options.mfaCodeProvider(mfa_serial);\n }\n const sourceCreds = await sourceCredsProvider;\n return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SOURCE_PROFILE\", \"o\"));\n }\n};\nconst isCredentialSourceWithoutRoleArn = (section) => {\n return !section.role_arn && !!section.credential_source;\n};\n\nconst isLoginProfile = (data) => {\n return Boolean(data && data.login_session);\n};\nconst resolveLoginCredentials = async (profileName, options) => {\n const credentials = await credentialProviderLogin.fromLoginCredentials({\n ...options,\n profile: profileName,\n })();\n return client.setCredentialFeature(credentials, \"CREDENTIALS_PROFILE_LOGIN\", \"AC\");\n};\n\nconst isProcessProfile = (arg) => Boolean(arg) && typeof arg === \"object\" && typeof arg.credential_process === \"string\";\nconst resolveProcessCredentials = async (options, profile) => import('@aws-sdk/credential-provider-process').then(({ fromProcess }) => fromProcess({\n ...options,\n profile,\n})().then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_PROCESS\", \"v\")));\n\nconst resolveSsoCredentials = async (profile, profileData, options = {}) => {\n const { fromSSO } = await import('@aws-sdk/credential-provider-sso');\n return fromSSO({\n profile,\n logger: options.logger,\n parentClientConfig: options.parentClientConfig,\n clientConfig: options.clientConfig,\n })().then((creds) => {\n if (profileData.sso_session) {\n return client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SSO\", \"r\");\n }\n else {\n return client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SSO_LEGACY\", \"t\");\n }\n });\n};\nconst isSsoProfile = (arg) => arg &&\n (typeof arg.sso_start_url === \"string\" ||\n typeof arg.sso_account_id === \"string\" ||\n typeof arg.sso_session === \"string\" ||\n typeof arg.sso_region === \"string\" ||\n typeof arg.sso_role_name === \"string\");\n\nconst isStaticCredsProfile = (arg) => Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.aws_access_key_id === \"string\" &&\n typeof arg.aws_secret_access_key === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.aws_session_token) > -1 &&\n [\"undefined\", \"string\"].indexOf(typeof arg.aws_account_id) > -1;\nconst resolveStaticCredentials = async (profile, options) => {\n options?.logger?.debug(\"@aws-sdk/credential-provider-ini - resolveStaticCredentials\");\n const credentials = {\n accessKeyId: profile.aws_access_key_id,\n secretAccessKey: profile.aws_secret_access_key,\n sessionToken: profile.aws_session_token,\n ...(profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope }),\n ...(profile.aws_account_id && { accountId: profile.aws_account_id }),\n };\n return client.setCredentialFeature(credentials, \"CREDENTIALS_PROFILE\", \"n\");\n};\n\nconst isWebIdentityProfile = (arg) => Boolean(arg) &&\n typeof arg === \"object\" &&\n typeof arg.web_identity_token_file === \"string\" &&\n typeof arg.role_arn === \"string\" &&\n [\"undefined\", \"string\"].indexOf(typeof arg.role_session_name) > -1;\nconst resolveWebIdentityCredentials = async (profile, options) => import('@aws-sdk/credential-provider-web-identity').then(({ fromTokenFile }) => fromTokenFile({\n webIdentityTokenFile: profile.web_identity_token_file,\n roleArn: profile.role_arn,\n roleSessionName: profile.role_session_name,\n roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,\n logger: options.logger,\n parentClientConfig: options.parentClientConfig,\n})().then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN\", \"q\")));\n\nconst resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {\n const data = profiles[profileName];\n if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {\n return resolveStaticCredentials(data, options);\n }\n if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {\n return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles, resolveProfileData);\n }\n if (isStaticCredsProfile(data)) {\n return resolveStaticCredentials(data, options);\n }\n if (isWebIdentityProfile(data)) {\n return resolveWebIdentityCredentials(data, options);\n }\n if (isProcessProfile(data)) {\n return resolveProcessCredentials(options, profileName);\n }\n if (isSsoProfile(data)) {\n return await resolveSsoCredentials(profileName, data, options);\n }\n if (isLoginProfile(data)) {\n return resolveLoginCredentials(profileName, options);\n }\n throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });\n};\n\nconst fromIni = (_init = {}) => async ({ callerClientConfig } = {}) => {\n const init = {\n ..._init,\n parentClientConfig: {\n ...callerClientConfig,\n ..._init.parentClientConfig,\n },\n };\n init.logger?.debug(\"@aws-sdk/credential-provider-ini - fromIni\");\n const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n return resolveProfileData(sharedIniFileLoader.getProfileName({\n profile: _init.profile ?? callerClientConfig?.profile,\n }), profiles, init);\n};\n\nexports.fromIni = fromIni;\n", - "'use strict';\n\nvar credentialProviderEnv = require('@aws-sdk/credential-provider-env');\nvar propertyProvider = require('@smithy/property-provider');\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\n\nconst ENV_IMDS_DISABLED = \"AWS_EC2_METADATA_DISABLED\";\nconst remoteProvider = async (init) => {\n const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await import('@smithy/credential-provider-imds');\n if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata\");\n const { fromHttp } = await import('@aws-sdk/credential-provider-http');\n return propertyProvider.chain(fromHttp(init), fromContainerMetadata(init));\n }\n if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== \"false\") {\n return async () => {\n throw new propertyProvider.CredentialsProviderError(\"EC2 Instance Metadata Service access disabled\", { logger: init.logger });\n };\n }\n init.logger?.debug(\"@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata\");\n return fromInstanceMetadata(init);\n};\n\nfunction memoizeChain(providers, treatAsExpired) {\n const chain = internalCreateChain(providers);\n let activeLock;\n let passiveLock;\n let credentials;\n const provider = async (options) => {\n if (options?.forceRefresh) {\n return await chain(options);\n }\n if (credentials?.expiration) {\n if (credentials?.expiration?.getTime() < Date.now()) {\n credentials = undefined;\n }\n }\n if (activeLock) {\n await activeLock;\n }\n else if (!credentials || treatAsExpired?.(credentials)) {\n if (credentials) {\n if (!passiveLock) {\n passiveLock = chain(options).then((c) => {\n credentials = c;\n passiveLock = undefined;\n });\n }\n }\n else {\n activeLock = chain(options).then((c) => {\n credentials = c;\n activeLock = undefined;\n });\n return provider(options);\n }\n }\n return credentials;\n };\n return provider;\n}\nconst internalCreateChain = (providers) => async (awsIdentityProperties) => {\n let lastProviderError;\n for (const provider of providers) {\n try {\n return await provider(awsIdentityProperties);\n }\n catch (err) {\n lastProviderError = err;\n if (err?.tryNextLink) {\n continue;\n }\n throw err;\n }\n }\n throw lastProviderError;\n};\n\nlet multipleCredentialSourceWarningEmitted = false;\nconst defaultProvider = (init = {}) => memoizeChain([\n async () => {\n const profile = init.profile ?? process.env[sharedIniFileLoader.ENV_PROFILE];\n if (profile) {\n const envStaticCredentialsAreSet = process.env[credentialProviderEnv.ENV_KEY] && process.env[credentialProviderEnv.ENV_SECRET];\n if (envStaticCredentialsAreSet) {\n if (!multipleCredentialSourceWarningEmitted) {\n const warnFn = init.logger?.warn && init.logger?.constructor?.name !== \"NoOpLogger\"\n ? init.logger.warn.bind(init.logger)\n : console.warn;\n warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:\n Multiple credential sources detected: \n Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.\n This SDK will proceed with the AWS_PROFILE value.\n \n However, a future version may change this behavior to prefer the ENV static credentials.\n Please ensure that your environment only sets either the AWS_PROFILE or the\n AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.\n`);\n multipleCredentialSourceWarningEmitted = true;\n }\n }\n throw new propertyProvider.CredentialsProviderError(\"AWS_PROFILE is set, skipping fromEnv provider.\", {\n logger: init.logger,\n tryNextLink: true,\n });\n }\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromEnv\");\n return credentialProviderEnv.fromEnv(init)();\n },\n async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromSSO\");\n const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;\n if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {\n throw new propertyProvider.CredentialsProviderError(\"Skipping SSO provider in default chain (inputs do not include SSO fields).\", { logger: init.logger });\n }\n const { fromSSO } = await import('@aws-sdk/credential-provider-sso');\n return fromSSO(init)(awsIdentityProperties);\n },\n async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromIni\");\n const { fromIni } = await import('@aws-sdk/credential-provider-ini');\n return fromIni(init)(awsIdentityProperties);\n },\n async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromProcess\");\n const { fromProcess } = await import('@aws-sdk/credential-provider-process');\n return fromProcess(init)(awsIdentityProperties);\n },\n async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile\");\n const { fromTokenFile } = await import('@aws-sdk/credential-provider-web-identity');\n return fromTokenFile(init)(awsIdentityProperties);\n },\n async () => {\n init.logger?.debug(\"@aws-sdk/credential-provider-node - defaultProvider::remoteProvider\");\n return (await remoteProvider(init))();\n },\n async () => {\n throw new propertyProvider.CredentialsProviderError(\"Could not load credentials from any providers\", {\n tryNextLink: false,\n logger: init.logger,\n });\n },\n], credentialsTreatedAsExpired);\nconst credentialsWillNeedRefresh = (credentials) => credentials?.expiration !== undefined;\nconst credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000;\n\nexports.credentialsTreatedAsExpired = credentialsTreatedAsExpired;\nexports.credentialsWillNeedRefresh = credentialsWillNeedRefresh;\nexports.defaultProvider = defaultProvider;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst s = \"required\", t = \"fn\", u = \"argv\", v = \"ref\";\nconst a = true, b = \"isSet\", c = \"booleanEquals\", d = \"error\", e = \"endpoint\", f = \"tree\", g = \"PartitionResult\", h = { [s]: false, \"type\": \"string\" }, i = { [s]: true, \"default\": false, \"type\": \"boolean\" }, j = { [v]: \"Endpoint\" }, k = { [t]: c, [u]: [{ [v]: \"UseFIPS\" }, true] }, l = { [t]: c, [u]: [{ [v]: \"UseDualStack\" }, true] }, m = {}, n = { [t]: \"getAttr\", [u]: [{ [v]: g }, \"supportsFIPS\"] }, o = { [t]: c, [u]: [true, { [t]: \"getAttr\", [u]: [{ [v]: g }, \"supportsDualStack\"] }] }, p = [k], q = [l], r = [{ [v]: \"Region\" }];\nconst _data = { version: \"1.0\", parameters: { Region: h, UseDualStack: i, UseFIPS: i, Endpoint: h }, rules: [{ conditions: [{ [t]: b, [u]: [j] }], rules: [{ conditions: p, error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", type: d }, { rules: [{ conditions: q, error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", type: d }, { endpoint: { url: j, properties: m, headers: m }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [t]: b, [u]: r }], rules: [{ conditions: [{ [t]: \"aws.partition\", [u]: r, assign: g }], rules: [{ conditions: [k, l], rules: [{ conditions: [{ [t]: c, [u]: [a, n] }, o], rules: [{ rules: [{ endpoint: { url: \"https://bedrock-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", type: d }], type: f }, { conditions: p, rules: [{ conditions: [{ [t]: c, [u]: [n, a] }], rules: [{ rules: [{ endpoint: { url: \"https://bedrock-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: \"FIPS is enabled but this partition does not support FIPS\", type: d }], type: f }, { conditions: q, rules: [{ conditions: [o], rules: [{ rules: [{ endpoint: { url: \"https://bedrock.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: \"DualStack is enabled but this partition does not support DualStack\", type: d }], type: f }, { rules: [{ endpoint: { url: \"https://bedrock.{Region}.{PartitionResult#dnsSuffix}\", properties: m, headers: m }, type: e }], type: f }], type: f }], type: f }, { error: \"Invalid Configuration: Missing Region\", type: d }], type: f }] };\nexports.ruleSet = _data;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2023-04-20\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultBedrockHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#httpBearerAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#httpBearerAuth\"),\n signer: new core_2.HttpBearerAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: \"com.amazonaws.bedrock\" }),\n serviceId: config?.serviceId ?? \"Bedrock\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst credential_provider_node_1 = require(\"@aws-sdk/credential-provider-node\");\nconst token_providers_1 = require(\"@aws-sdk/token-providers\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst core_2 = require(\"@smithy/core\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n signingName: \"bedrock\",\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#httpBearerAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#httpBearerAuth\") ||\n (async (idProps) => {\n try {\n return await (0, token_providers_1.fromEnvSigningName)({ signingName: \"bedrock\" })();\n }\n catch (error) {\n return await (0, token_providers_1.nodeProvider)(idProps)(idProps);\n }\n }),\n signer: new core_2.HttpBearerAuthSigner(),\n },\n ],\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"bedrock\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n let _token = runtimeConfig.token;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n setToken(token) {\n _token = token;\n },\n token() {\n return _token;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n token: config.token(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass BedrockClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultBedrockHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n \"smithy.api#httpBearerAuth\": config.token,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nlet BedrockServiceException$1 = class BedrockServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, BedrockServiceException.prototype);\n }\n};\n\nlet AccessDeniedException$1 = class AccessDeniedException extends BedrockServiceException$1 {\n name = \"AccessDeniedException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"AccessDeniedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, AccessDeniedException.prototype);\n }\n};\nlet InternalServerException$1 = class InternalServerException extends BedrockServiceException$1 {\n name = \"InternalServerException\";\n $fault = \"server\";\n constructor(opts) {\n super({\n name: \"InternalServerException\",\n $fault: \"server\",\n ...opts,\n });\n Object.setPrototypeOf(this, InternalServerException.prototype);\n }\n};\nlet ResourceNotFoundException$1 = class ResourceNotFoundException extends BedrockServiceException$1 {\n name = \"ResourceNotFoundException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ResourceNotFoundException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ResourceNotFoundException.prototype);\n }\n};\nlet ThrottlingException$1 = class ThrottlingException extends BedrockServiceException$1 {\n name = \"ThrottlingException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ThrottlingException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ThrottlingException.prototype);\n }\n};\nlet ValidationException$1 = class ValidationException extends BedrockServiceException$1 {\n name = \"ValidationException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ValidationException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ValidationException.prototype);\n }\n};\nlet ConflictException$1 = class ConflictException extends BedrockServiceException$1 {\n name = \"ConflictException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ConflictException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ConflictException.prototype);\n }\n};\nlet ServiceQuotaExceededException$1 = class ServiceQuotaExceededException extends BedrockServiceException$1 {\n name = \"ServiceQuotaExceededException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ServiceQuotaExceededException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);\n }\n};\nlet TooManyTagsException$1 = class TooManyTagsException extends BedrockServiceException$1 {\n name = \"TooManyTagsException\";\n $fault = \"client\";\n resourceName;\n constructor(opts) {\n super({\n name: \"TooManyTagsException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, TooManyTagsException.prototype);\n this.resourceName = opts.resourceName;\n }\n};\nlet ResourceInUseException$1 = class ResourceInUseException extends BedrockServiceException$1 {\n name = \"ResourceInUseException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ResourceInUseException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ResourceInUseException.prototype);\n }\n};\nlet ServiceUnavailableException$1 = class ServiceUnavailableException extends BedrockServiceException$1 {\n name = \"ServiceUnavailableException\";\n $fault = \"server\";\n constructor(opts) {\n super({\n name: \"ServiceUnavailableException\",\n $fault: \"server\",\n ...opts,\n });\n Object.setPrototypeOf(this, ServiceUnavailableException.prototype);\n }\n};\n\nconst _AA = \"AgreementAvailability\";\nconst _ADE = \"AccessDeniedException\";\nconst _AEC = \"AutomatedEvaluationConfig\";\nconst _AECM = \"AutomatedEvaluationCustomMetrics\";\nconst _AECMC = \"AutomatedEvaluationCustomMetricConfig\";\nconst _AECMS = \"AutomatedEvaluationCustomMetricSource\";\nconst _ARCDSL = \"AutomatedReasoningCheckDifferenceScenarioList\";\nconst _ARCF = \"AutomatedReasoningCheckFinding\";\nconst _ARCFL = \"AutomatedReasoningCheckFindingList\";\nconst _ARCIF = \"AutomatedReasoningCheckImpossibleFinding\";\nconst _ARCIFu = \"AutomatedReasoningCheckInvalidFinding\";\nconst _ARCITR = \"AutomatedReasoningCheckInputTextReference\";\nconst _ARCITRL = \"AutomatedReasoningCheckInputTextReferenceList\";\nconst _ARCLW = \"AutomatedReasoningCheckLogicWarning\";\nconst _ARCNTF = \"AutomatedReasoningCheckNoTranslationsFinding\";\nconst _ARCR = \"AutomatedReasoningCheckRule\";\nconst _ARCRL = \"AutomatedReasoningCheckRuleList\";\nconst _ARCS = \"AutomatedReasoningCheckScenario\";\nconst _ARCSF = \"AutomatedReasoningCheckSatisfiableFinding\";\nconst _ARCT = \"AutomatedReasoningCheckTranslation\";\nconst _ARCTAF = \"AutomatedReasoningCheckTranslationAmbiguousFinding\";\nconst _ARCTCF = \"AutomatedReasoningCheckTooComplexFinding\";\nconst _ARCTL = \"AutomatedReasoningCheckTranslationList\";\nconst _ARCTO = \"AutomatedReasoningCheckTranslationOption\";\nconst _ARCTOL = \"AutomatedReasoningCheckTranslationOptionList\";\nconst _ARCVF = \"AutomatedReasoningCheckValidFinding\";\nconst _ARLS = \"AutomatedReasoningLogicStatement\";\nconst _ARLSC = \"AutomatedReasoningLogicStatementContent\";\nconst _ARLSL = \"AutomatedReasoningLogicStatementList\";\nconst _ARNLSC = \"AutomatedReasoningNaturalLanguageStatementContent\";\nconst _ARPA = \"AutomatedReasoningPolicyAnnotation\";\nconst _ARPAFNL = \"AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage\";\nconst _ARPAIC = \"AutomatedReasoningPolicyAnnotationIngestContent\";\nconst _ARPAL = \"AutomatedReasoningPolicyAnnotationList\";\nconst _ARPARA = \"AutomatedReasoningPolicyAddRuleAnnotation\";\nconst _ARPARFNLA = \"AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation\";\nconst _ARPARM = \"AutomatedReasoningPolicyAddRuleMutation\";\nconst _ARPARNL = \"AutomatedReasoningPolicyAnnotationRuleNaturalLanguage\";\nconst _ARPATA = \"AutomatedReasoningPolicyAddTypeAnnotation\";\nconst _ARPATM = \"AutomatedReasoningPolicyAddTypeMutation\";\nconst _ARPATV = \"AutomatedReasoningPolicyAddTypeValue\";\nconst _ARPAVA = \"AutomatedReasoningPolicyAddVariableAnnotation\";\nconst _ARPAVM = \"AutomatedReasoningPolicyAddVariableMutation\";\nconst _ARPBDB = \"AutomatedReasoningPolicyBuildDocumentBlob\";\nconst _ARPBDD = \"AutomatedReasoningPolicyBuildDocumentDescription\";\nconst _ARPBDN = \"AutomatedReasoningPolicyBuildDocumentName\";\nconst _ARPBL = \"AutomatedReasoningPolicyBuildLog\";\nconst _ARPBLE = \"AutomatedReasoningPolicyBuildLogEntry\";\nconst _ARPBLEL = \"AutomatedReasoningPolicyBuildLogEntryList\";\nconst _ARPBRA = \"AutomatedReasoningPolicyBuildResultAssets\";\nconst _ARPBS = \"AutomatedReasoningPolicyBuildStep\";\nconst _ARPBSC = \"AutomatedReasoningPolicyBuildStepContext\";\nconst _ARPBSL = \"AutomatedReasoningPolicyBuildStepList\";\nconst _ARPBSM = \"AutomatedReasoningPolicyBuildStepMessage\";\nconst _ARPBSML = \"AutomatedReasoningPolicyBuildStepMessageList\";\nconst _ARPBWD = \"AutomatedReasoningPolicyBuildWorkflowDocument\";\nconst _ARPBWDL = \"AutomatedReasoningPolicyBuildWorkflowDocumentList\";\nconst _ARPBWRC = \"AutomatedReasoningPolicyBuildWorkflowRepairContent\";\nconst _ARPBWS = \"AutomatedReasoningPolicyBuildWorkflowSource\";\nconst _ARPBWSu = \"AutomatedReasoningPolicyBuildWorkflowSummary\";\nconst _ARPBWSut = \"AutomatedReasoningPolicyBuildWorkflowSummaries\";\nconst _ARPD = \"AutomatedReasoningPolicyDescription\";\nconst _ARPDE = \"AutomatedReasoningPolicyDefinitionElement\";\nconst _ARPDQR = \"AutomatedReasoningPolicyDefinitionQualityReport\";\nconst _ARPDR = \"AutomatedReasoningPolicyDefinitionRule\";\nconst _ARPDRA = \"AutomatedReasoningPolicyDeleteRuleAnnotation\";\nconst _ARPDRAE = \"AutomatedReasoningPolicyDefinitionRuleAlternateExpression\";\nconst _ARPDRE = \"AutomatedReasoningPolicyDefinitionRuleExpression\";\nconst _ARPDRL = \"AutomatedReasoningPolicyDefinitionRuleList\";\nconst _ARPDRM = \"AutomatedReasoningPolicyDeleteRuleMutation\";\nconst _ARPDRS = \"AutomatedReasoningPolicyDisjointRuleSet\";\nconst _ARPDRSL = \"AutomatedReasoningPolicyDisjointRuleSetList\";\nconst _ARPDT = \"AutomatedReasoningPolicyDefinitionType\";\nconst _ARPDTA = \"AutomatedReasoningPolicyDeleteTypeAnnotation\";\nconst _ARPDTD = \"AutomatedReasoningPolicyDefinitionTypeDescription\";\nconst _ARPDTL = \"AutomatedReasoningPolicyDefinitionTypeList\";\nconst _ARPDTM = \"AutomatedReasoningPolicyDeleteTypeMutation\";\nconst _ARPDTN = \"AutomatedReasoningPolicyDefinitionTypeName\";\nconst _ARPDTNL = \"AutomatedReasoningPolicyDefinitionTypeNameList\";\nconst _ARPDTV = \"AutomatedReasoningPolicyDefinitionTypeValue\";\nconst _ARPDTVD = \"AutomatedReasoningPolicyDefinitionTypeValueDescription\";\nconst _ARPDTVL = \"AutomatedReasoningPolicyDefinitionTypeValueList\";\nconst _ARPDTVP = \"AutomatedReasoningPolicyDefinitionTypeValuePair\";\nconst _ARPDTVPL = \"AutomatedReasoningPolicyDefinitionTypeValuePairList\";\nconst _ARPDTVu = \"AutomatedReasoningPolicyDeleteTypeValue\";\nconst _ARPDV = \"AutomatedReasoningPolicyDefinitionVariable\";\nconst _ARPDVA = \"AutomatedReasoningPolicyDeleteVariableAnnotation\";\nconst _ARPDVD = \"AutomatedReasoningPolicyDefinitionVariableDescription\";\nconst _ARPDVL = \"AutomatedReasoningPolicyDefinitionVariableList\";\nconst _ARPDVM = \"AutomatedReasoningPolicyDeleteVariableMutation\";\nconst _ARPDVN = \"AutomatedReasoningPolicyDefinitionVariableName\";\nconst _ARPDVNL = \"AutomatedReasoningPolicyDefinitionVariableNameList\";\nconst _ARPDu = \"AutomatedReasoningPolicyDefinition\";\nconst _ARPGTC = \"AutomatedReasoningPolicyGeneratedTestCase\";\nconst _ARPGTCL = \"AutomatedReasoningPolicyGeneratedTestCaseList\";\nconst _ARPGTCu = \"AutomatedReasoningPolicyGeneratedTestCases\";\nconst _ARPICA = \"AutomatedReasoningPolicyIngestContentAnnotation\";\nconst _ARPM = \"AutomatedReasoningPolicyMutation\";\nconst _ARPN = \"AutomatedReasoningPolicyName\";\nconst _ARPP = \"AutomatedReasoningPolicyPlanning\";\nconst _ARPS = \"AutomatedReasoningPolicyScenario\";\nconst _ARPSAE = \"AutomatedReasoningPolicyScenarioAlternateExpression\";\nconst _ARPSE = \"AutomatedReasoningPolicyScenarioExpression\";\nconst _ARPSu = \"AutomatedReasoningPolicySummary\";\nconst _ARPSut = \"AutomatedReasoningPolicySummaries\";\nconst _ARPTC = \"AutomatedReasoningPolicyTestCase\";\nconst _ARPTCL = \"AutomatedReasoningPolicyTestCaseList\";\nconst _ARPTGC = \"AutomatedReasoningPolicyTestGuardContent\";\nconst _ARPTL = \"AutomatedReasoningPolicyTestList\";\nconst _ARPTQC = \"AutomatedReasoningPolicyTestQueryContent\";\nconst _ARPTR = \"AutomatedReasoningPolicyTestResult\";\nconst _ARPTVA = \"AutomatedReasoningPolicyTypeValueAnnotation\";\nconst _ARPTVAL = \"AutomatedReasoningPolicyTypeValueAnnotationList\";\nconst _ARPUFRFA = \"AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation\";\nconst _ARPUFSFA = \"AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation\";\nconst _ARPURA = \"AutomatedReasoningPolicyUpdateRuleAnnotation\";\nconst _ARPURM = \"AutomatedReasoningPolicyUpdateRuleMutation\";\nconst _ARPUTA = \"AutomatedReasoningPolicyUpdateTypeAnnotation\";\nconst _ARPUTM = \"AutomatedReasoningPolicyUpdateTypeMutation\";\nconst _ARPUTV = \"AutomatedReasoningPolicyUpdateTypeValue\";\nconst _ARPUVA = \"AutomatedReasoningPolicyUpdateVariableAnnotation\";\nconst _ARPUVM = \"AutomatedReasoningPolicyUpdateVariableMutation\";\nconst _ARPWTC = \"AutomatedReasoningPolicyWorkflowTypeContent\";\nconst _BCB = \"ByteContentBlob\";\nconst _BCD = \"ByteContentDoc\";\nconst _BDEJ = \"BatchDeleteEvaluationJob\";\nconst _BDEJE = \"BatchDeleteEvaluationJobError\";\nconst _BDEJEa = \"BatchDeleteEvaluationJobErrors\";\nconst _BDEJI = \"BatchDeleteEvaluationJobItem\";\nconst _BDEJIa = \"BatchDeleteEvaluationJobItems\";\nconst _BDEJR = \"BatchDeleteEvaluationJobRequest\";\nconst _BDEJRa = \"BatchDeleteEvaluationJobResponse\";\nconst _BEM = \"BedrockEvaluatorModel\";\nconst _BEMe = \"BedrockEvaluatorModels\";\nconst _CARP = \"CreateAutomatedReasoningPolicy\";\nconst _CARPBW = \"CancelAutomatedReasoningPolicyBuildWorkflow\";\nconst _CARPBWR = \"CancelAutomatedReasoningPolicyBuildWorkflowRequest\";\nconst _CARPBWRa = \"CancelAutomatedReasoningPolicyBuildWorkflowResponse\";\nconst _CARPR = \"CreateAutomatedReasoningPolicyRequest\";\nconst _CARPRr = \"CreateAutomatedReasoningPolicyResponse\";\nconst _CARPTC = \"CreateAutomatedReasoningPolicyTestCase\";\nconst _CARPTCR = \"CreateAutomatedReasoningPolicyTestCaseRequest\";\nconst _CARPTCRr = \"CreateAutomatedReasoningPolicyTestCaseResponse\";\nconst _CARPV = \"CreateAutomatedReasoningPolicyVersion\";\nconst _CARPVR = \"CreateAutomatedReasoningPolicyVersionRequest\";\nconst _CARPVRr = \"CreateAutomatedReasoningPolicyVersionResponse\";\nconst _CC = \"CustomizationConfig\";\nconst _CCM = \"CreateCustomModel\";\nconst _CCMD = \"CreateCustomModelDeployment\";\nconst _CCMDR = \"CreateCustomModelDeploymentRequest\";\nconst _CCMDRr = \"CreateCustomModelDeploymentResponse\";\nconst _CCMR = \"CreateCustomModelRequest\";\nconst _CCMRr = \"CreateCustomModelResponse\";\nconst _CE = \"ConflictException\";\nconst _CEJ = \"CreateEvaluationJob\";\nconst _CEJR = \"CreateEvaluationJobRequest\";\nconst _CEJRr = \"CreateEvaluationJobResponse\";\nconst _CFMA = \"CreateFoundationModelAgreement\";\nconst _CFMAR = \"CreateFoundationModelAgreementRequest\";\nconst _CFMARr = \"CreateFoundationModelAgreementResponse\";\nconst _CG = \"CreateGuardrail\";\nconst _CGR = \"CreateGuardrailRequest\";\nconst _CGRr = \"CreateGuardrailResponse\";\nconst _CGV = \"CreateGuardrailVersion\";\nconst _CGVR = \"CreateGuardrailVersionRequest\";\nconst _CGVRr = \"CreateGuardrailVersionResponse\";\nconst _CIP = \"CreateInferenceProfile\";\nconst _CIPR = \"CreateInferenceProfileRequest\";\nconst _CIPRr = \"CreateInferenceProfileResponse\";\nconst _CMBEM = \"CustomMetricBedrockEvaluatorModel\";\nconst _CMBEMu = \"CustomMetricBedrockEvaluatorModels\";\nconst _CMCJ = \"CreateModelCopyJob\";\nconst _CMCJR = \"CreateModelCopyJobRequest\";\nconst _CMCJRr = \"CreateModelCopyJobResponse\";\nconst _CMCJRre = \"CreateModelCustomizationJobRequest\";\nconst _CMCJRrea = \"CreateModelCustomizationJobResponse\";\nconst _CMCJr = \"CreateModelCustomizationJob\";\nconst _CMD = \"CustomMetricDefinition\";\nconst _CMDS = \"CustomModelDeploymentSummary\";\nconst _CMDSL = \"CustomModelDeploymentSummaryList\";\nconst _CMEMC = \"CustomMetricEvaluatorModelConfig\";\nconst _CMIJ = \"CreateModelImportJob\";\nconst _CMIJR = \"CreateModelImportJobRequest\";\nconst _CMIJRr = \"CreateModelImportJobResponse\";\nconst _CMIJRre = \"CreateModelInvocationJobRequest\";\nconst _CMIJRrea = \"CreateModelInvocationJobResponse\";\nconst _CMIJr = \"CreateModelInvocationJob\";\nconst _CMME = \"CreateMarketplaceModelEndpoint\";\nconst _CMMER = \"CreateMarketplaceModelEndpointRequest\";\nconst _CMMERr = \"CreateMarketplaceModelEndpointResponse\";\nconst _CMS = \"CustomModelSummary\";\nconst _CMSL = \"CustomModelSummaryList\";\nconst _CMU = \"CustomModelUnits\";\nconst _CPMT = \"CreateProvisionedModelThroughput\";\nconst _CPMTR = \"CreateProvisionedModelThroughputRequest\";\nconst _CPMTRr = \"CreateProvisionedModelThroughputResponse\";\nconst _CPR = \"CreatePromptRouter\";\nconst _CPRR = \"CreatePromptRouterRequest\";\nconst _CPRRr = \"CreatePromptRouterResponse\";\nconst _CWC = \"CloudWatchConfig\";\nconst _DARP = \"DeleteAutomatedReasoningPolicy\";\nconst _DARPBW = \"DeleteAutomatedReasoningPolicyBuildWorkflow\";\nconst _DARPBWR = \"DeleteAutomatedReasoningPolicyBuildWorkflowRequest\";\nconst _DARPBWRe = \"DeleteAutomatedReasoningPolicyBuildWorkflowResponse\";\nconst _DARPR = \"DeleteAutomatedReasoningPolicyRequest\";\nconst _DARPRe = \"DeleteAutomatedReasoningPolicyResponse\";\nconst _DARPTC = \"DeleteAutomatedReasoningPolicyTestCase\";\nconst _DARPTCR = \"DeleteAutomatedReasoningPolicyTestCaseRequest\";\nconst _DARPTCRe = \"DeleteAutomatedReasoningPolicyTestCaseResponse\";\nconst _DC = \"DistillationConfig\";\nconst _DCM = \"DeleteCustomModel\";\nconst _DCMD = \"DeleteCustomModelDeployment\";\nconst _DCMDR = \"DeleteCustomModelDeploymentRequest\";\nconst _DCMDRe = \"DeleteCustomModelDeploymentResponse\";\nconst _DCMR = \"DeleteCustomModelRequest\";\nconst _DCMRe = \"DeleteCustomModelResponse\";\nconst _DFMA = \"DeleteFoundationModelAgreement\";\nconst _DFMAR = \"DeleteFoundationModelAgreementRequest\";\nconst _DFMARe = \"DeleteFoundationModelAgreementResponse\";\nconst _DG = \"DeleteGuardrail\";\nconst _DGR = \"DeleteGuardrailRequest\";\nconst _DGRe = \"DeleteGuardrailResponse\";\nconst _DIM = \"DeleteImportedModel\";\nconst _DIMR = \"DeleteImportedModelRequest\";\nconst _DIMRe = \"DeleteImportedModelResponse\";\nconst _DIP = \"DeleteInferenceProfile\";\nconst _DIPR = \"DeleteInferenceProfileRequest\";\nconst _DIPRe = \"DeleteInferenceProfileResponse\";\nconst _DMILC = \"DeleteModelInvocationLoggingConfiguration\";\nconst _DMILCR = \"DeleteModelInvocationLoggingConfigurationRequest\";\nconst _DMILCRe = \"DeleteModelInvocationLoggingConfigurationResponse\";\nconst _DMME = \"DeleteMarketplaceModelEndpoint\";\nconst _DMMER = \"DeleteMarketplaceModelEndpointRequest\";\nconst _DMMERe = \"DeleteMarketplaceModelEndpointResponse\";\nconst _DMMERer = \"DeregisterMarketplaceModelEndpointRequest\";\nconst _DMMERere = \"DeregisterMarketplaceModelEndpointResponse\";\nconst _DMMEe = \"DeregisterMarketplaceModelEndpoint\";\nconst _DPD = \"DataProcessingDetails\";\nconst _DPMT = \"DeleteProvisionedModelThroughput\";\nconst _DPMTR = \"DeleteProvisionedModelThroughputRequest\";\nconst _DPMTRe = \"DeleteProvisionedModelThroughputResponse\";\nconst _DPR = \"DimensionalPriceRate\";\nconst _DPRR = \"DeletePromptRouterRequest\";\nconst _DPRRe = \"DeletePromptRouterResponse\";\nconst _DPRe = \"DeletePromptRouter\";\nconst _EARPV = \"ExportAutomatedReasoningPolicyVersion\";\nconst _EARPVR = \"ExportAutomatedReasoningPolicyVersionRequest\";\nconst _EARPVRx = \"ExportAutomatedReasoningPolicyVersionResponse\";\nconst _EBM = \"EvaluationBedrockModel\";\nconst _EC = \"EndpointConfig\";\nconst _ECv = \"EvaluationConfig\";\nconst _ED = \"EvaluationDataset\";\nconst _EDL = \"EvaluationDatasetLocation\";\nconst _EDMC = \"EvaluationDatasetMetricConfig\";\nconst _EDMCv = \"EvaluationDatasetMetricConfigs\";\nconst _EDN = \"EvaluationDatasetName\";\nconst _EIC = \"EvaluationInferenceConfig\";\nconst _EICS = \"EvaluationInferenceConfigSummary\";\nconst _EJD = \"EvaluationJobDescription\";\nconst _EJI = \"EvaluationJobIdentifier\";\nconst _EJIv = \"EvaluationJobIdentifiers\";\nconst _EMC = \"EvaluationModelConfigs\";\nconst _EMCS = \"EvaluationModelConfigSummary\";\nconst _EMCv = \"EvaluationModelConfig\";\nconst _EMCva = \"EvaluatorModelConfig\";\nconst _EMD = \"EvaluationMetricDescription\";\nconst _EMIP = \"EvaluationModelInferenceParams\";\nconst _EMN = \"EvaluationMetricName\";\nconst _EMNv = \"EvaluationMetricNames\";\nconst _EODC = \"EvaluationOutputDataConfig\";\nconst _EPIS = \"EvaluationPrecomputedInferenceSource\";\nconst _EPRAGSC = \"EvaluationPrecomputedRetrieveAndGenerateSourceConfig\";\nconst _EPRSC = \"EvaluationPrecomputedRetrieveSourceConfig\";\nconst _EPRSCv = \"EvaluationPrecomputedRagSourceConfig\";\nconst _ERCS = \"EvaluationRagConfigSummary\";\nconst _ES = \"EvaluationSummary\";\nconst _ESGC = \"ExternalSourcesGenerationConfiguration\";\nconst _ESRAGC = \"ExternalSourcesRetrieveAndGenerateConfiguration\";\nconst _ESv = \"EvaluationSummaries\";\nconst _ESx = \"ExternalSource\";\nconst _ESxt = \"ExternalSources\";\nconst _FA = \"FilterAttribute\";\nconst _FFR = \"FieldForReranking\";\nconst _FFRi = \"FieldsForReranking\";\nconst _FMD = \"FoundationModelDetails\";\nconst _FML = \"FoundationModelLifecycle\";\nconst _FMS = \"FoundationModelSummary\";\nconst _FMSL = \"FoundationModelSummaryList\";\nconst _GARP = \"GuardrailAutomatedReasoningPolicy\";\nconst _GARPA = \"GetAutomatedReasoningPolicyAnnotations\";\nconst _GARPAR = \"GetAutomatedReasoningPolicyAnnotationsRequest\";\nconst _GARPARe = \"GetAutomatedReasoningPolicyAnnotationsResponse\";\nconst _GARPBW = \"GetAutomatedReasoningPolicyBuildWorkflow\";\nconst _GARPBWR = \"GetAutomatedReasoningPolicyBuildWorkflowRequest\";\nconst _GARPBWRA = \"GetAutomatedReasoningPolicyBuildWorkflowResultAssets\";\nconst _GARPBWRAR = \"GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest\";\nconst _GARPBWRARe = \"GetAutomatedReasoningPolicyBuildWorkflowResultAssetsResponse\";\nconst _GARPBWRe = \"GetAutomatedReasoningPolicyBuildWorkflowResponse\";\nconst _GARPC = \"GuardrailAutomatedReasoningPolicyConfig\";\nconst _GARPNS = \"GetAutomatedReasoningPolicyNextScenario\";\nconst _GARPNSR = \"GetAutomatedReasoningPolicyNextScenarioRequest\";\nconst _GARPNSRe = \"GetAutomatedReasoningPolicyNextScenarioResponse\";\nconst _GARPR = \"GetAutomatedReasoningPolicyRequest\";\nconst _GARPRe = \"GetAutomatedReasoningPolicyResponse\";\nconst _GARPTC = \"GetAutomatedReasoningPolicyTestCase\";\nconst _GARPTCR = \"GetAutomatedReasoningPolicyTestCaseRequest\";\nconst _GARPTCRe = \"GetAutomatedReasoningPolicyTestCaseResponse\";\nconst _GARPTR = \"GetAutomatedReasoningPolicyTestResult\";\nconst _GARPTRR = \"GetAutomatedReasoningPolicyTestResultRequest\";\nconst _GARPTRRe = \"GetAutomatedReasoningPolicyTestResultResponse\";\nconst _GARPe = \"GetAutomatedReasoningPolicy\";\nconst _GBM = \"GuardrailBlockedMessaging\";\nconst _GC = \"GenerationConfiguration\";\nconst _GCF = \"GuardrailContentFilter\";\nconst _GCFA = \"GuardrailContentFilterAction\";\nconst _GCFC = \"GuardrailContentFilterConfig\";\nconst _GCFCu = \"GuardrailContentFiltersConfig\";\nconst _GCFT = \"GuardrailContentFiltersTier\";\nconst _GCFTC = \"GuardrailContentFiltersTierConfig\";\nconst _GCFTN = \"GuardrailContentFiltersTierName\";\nconst _GCFu = \"GuardrailContentFilters\";\nconst _GCGA = \"GuardrailContextualGroundingAction\";\nconst _GCGF = \"GuardrailContextualGroundingFilter\";\nconst _GCGFC = \"GuardrailContextualGroundingFilterConfig\";\nconst _GCGFCu = \"GuardrailContextualGroundingFiltersConfig\";\nconst _GCGFu = \"GuardrailContextualGroundingFilters\";\nconst _GCGP = \"GuardrailContextualGroundingPolicy\";\nconst _GCGPC = \"GuardrailContextualGroundingPolicyConfig\";\nconst _GCM = \"GetCustomModel\";\nconst _GCMD = \"GetCustomModelDeployment\";\nconst _GCMDR = \"GetCustomModelDeploymentRequest\";\nconst _GCMDRe = \"GetCustomModelDeploymentResponse\";\nconst _GCMR = \"GetCustomModelRequest\";\nconst _GCMRe = \"GetCustomModelResponse\";\nconst _GCP = \"GuardrailContentPolicy\";\nconst _GCPC = \"GuardrailContentPolicyConfig\";\nconst _GCRC = \"GuardrailCrossRegionConfig\";\nconst _GCRD = \"GuardrailCrossRegionDetails\";\nconst _GCu = \"GuardrailConfiguration\";\nconst _GD = \"GuardrailDescription\";\nconst _GEJ = \"GetEvaluationJob\";\nconst _GEJR = \"GetEvaluationJobRequest\";\nconst _GEJRe = \"GetEvaluationJobResponse\";\nconst _GFM = \"GetFoundationModel\";\nconst _GFMA = \"GetFoundationModelAvailability\";\nconst _GFMAR = \"GetFoundationModelAvailabilityRequest\";\nconst _GFMARe = \"GetFoundationModelAvailabilityResponse\";\nconst _GFMR = \"GetFoundationModelRequest\";\nconst _GFMRe = \"GetFoundationModelResponse\";\nconst _GFR = \"GuardrailFailureRecommendation\";\nconst _GFRu = \"GuardrailFailureRecommendations\";\nconst _GG = \"GetGuardrail\";\nconst _GGR = \"GetGuardrailRequest\";\nconst _GGRe = \"GetGuardrailResponse\";\nconst _GIM = \"GetImportedModel\";\nconst _GIMR = \"GetImportedModelRequest\";\nconst _GIMRe = \"GetImportedModelResponse\";\nconst _GIP = \"GetInferenceProfile\";\nconst _GIPR = \"GetInferenceProfileRequest\";\nconst _GIPRe = \"GetInferenceProfileResponse\";\nconst _GM = \"GuardrailModality\";\nconst _GMCJ = \"GetModelCopyJob\";\nconst _GMCJR = \"GetModelCopyJobRequest\";\nconst _GMCJRe = \"GetModelCopyJobResponse\";\nconst _GMCJRet = \"GetModelCustomizationJobRequest\";\nconst _GMCJReto = \"GetModelCustomizationJobResponse\";\nconst _GMCJe = \"GetModelCustomizationJob\";\nconst _GMIJ = \"GetModelImportJob\";\nconst _GMIJR = \"GetModelImportJobRequest\";\nconst _GMIJRe = \"GetModelImportJobResponse\";\nconst _GMIJRet = \"GetModelInvocationJobRequest\";\nconst _GMIJReto = \"GetModelInvocationJobResponse\";\nconst _GMIJe = \"GetModelInvocationJob\";\nconst _GMILC = \"GetModelInvocationLoggingConfiguration\";\nconst _GMILCR = \"GetModelInvocationLoggingConfigurationRequest\";\nconst _GMILCRe = \"GetModelInvocationLoggingConfigurationResponse\";\nconst _GMME = \"GetMarketplaceModelEndpoint\";\nconst _GMMER = \"GetMarketplaceModelEndpointRequest\";\nconst _GMMERe = \"GetMarketplaceModelEndpointResponse\";\nconst _GMW = \"GuardrailManagedWords\";\nconst _GMWC = \"GuardrailManagedWordsConfig\";\nconst _GMWL = \"GuardrailManagedWordLists\";\nconst _GMWLC = \"GuardrailManagedWordListsConfig\";\nconst _GMu = \"GuardrailModalities\";\nconst _GN = \"GuardrailName\";\nconst _GPE = \"GuardrailPiiEntity\";\nconst _GPEC = \"GuardrailPiiEntityConfig\";\nconst _GPECu = \"GuardrailPiiEntitiesConfig\";\nconst _GPEu = \"GuardrailPiiEntities\";\nconst _GPMT = \"GetProvisionedModelThroughput\";\nconst _GPMTR = \"GetProvisionedModelThroughputRequest\";\nconst _GPMTRe = \"GetProvisionedModelThroughputResponse\";\nconst _GPR = \"GetPromptRouter\";\nconst _GPRR = \"GetPromptRouterRequest\";\nconst _GPRRe = \"GetPromptRouterResponse\";\nconst _GR = \"GuardrailRegex\";\nconst _GRC = \"GuardrailRegexConfig\";\nconst _GRCu = \"GuardrailRegexesConfig\";\nconst _GRu = \"GuardrailRegexes\";\nconst _GS = \"GuardrailSummary\";\nconst _GSIP = \"GuardrailSensitiveInformationPolicy\";\nconst _GSIPC = \"GuardrailSensitiveInformationPolicyConfig\";\nconst _GSR = \"GuardrailStatusReason\";\nconst _GSRu = \"GuardrailStatusReasons\";\nconst _GSu = \"GuardrailSummaries\";\nconst _GT = \"GuardrailTopic\";\nconst _GTA = \"GuardrailTopicAction\";\nconst _GTC = \"GuardrailTopicConfig\";\nconst _GTCu = \"GuardrailTopicsConfig\";\nconst _GTD = \"GuardrailTopicDefinition\";\nconst _GTE = \"GuardrailTopicExample\";\nconst _GTEu = \"GuardrailTopicExamples\";\nconst _GTN = \"GuardrailTopicName\";\nconst _GTP = \"GuardrailTopicPolicy\";\nconst _GTPC = \"GuardrailTopicPolicyConfig\";\nconst _GTT = \"GuardrailTopicsTier\";\nconst _GTTC = \"GuardrailTopicsTierConfig\";\nconst _GTTN = \"GuardrailTopicsTierName\";\nconst _GTu = \"GuardrailTopics\";\nconst _GUCFMA = \"GetUseCaseForModelAccess\";\nconst _GUCFMAR = \"GetUseCaseForModelAccessRequest\";\nconst _GUCFMARe = \"GetUseCaseForModelAccessResponse\";\nconst _GW = \"GuardrailWord\";\nconst _GWA = \"GuardrailWordAction\";\nconst _GWC = \"GuardrailWordConfig\";\nconst _GWCu = \"GuardrailWordsConfig\";\nconst _GWP = \"GuardrailWordPolicy\";\nconst _GWPC = \"GuardrailWordPolicyConfig\";\nconst _GWu = \"GuardrailWords\";\nconst _HEC = \"HumanEvaluationConfig\";\nconst _HECM = \"HumanEvaluationCustomMetric\";\nconst _HECMu = \"HumanEvaluationCustomMetrics\";\nconst _HTI = \"HumanTaskInstructions\";\nconst _HWC = \"HumanWorkflowConfig\";\nconst _I = \"Identifier\";\nconst _IFC = \"ImplicitFilterConfiguration\";\nconst _ILC = \"InvocationLogsConfig\";\nconst _ILS = \"InvocationLogSource\";\nconst _IMS = \"ImportedModelSummary\";\nconst _IMSL = \"ImportedModelSummaryList\";\nconst _IPD = \"InferenceProfileDescription\";\nconst _IPM = \"InferenceProfileModel\";\nconst _IPMS = \"InferenceProfileModelSource\";\nconst _IPMn = \"InferenceProfileModels\";\nconst _IPS = \"InferenceProfileSummary\";\nconst _IPSn = \"InferenceProfileSummaries\";\nconst _ISE = \"InternalServerException\";\nconst _KBC = \"KnowledgeBaseConfig\";\nconst _KBRAGC = \"KnowledgeBaseRetrieveAndGenerateConfiguration\";\nconst _KBRC = \"KnowledgeBaseRetrievalConfiguration\";\nconst _KBVSC = \"KnowledgeBaseVectorSearchConfiguration\";\nconst _KIC = \"KbInferenceConfig\";\nconst _LARP = \"ListAutomatedReasoningPolicies\";\nconst _LARPBW = \"ListAutomatedReasoningPolicyBuildWorkflows\";\nconst _LARPBWR = \"ListAutomatedReasoningPolicyBuildWorkflowsRequest\";\nconst _LARPBWRi = \"ListAutomatedReasoningPolicyBuildWorkflowsResponse\";\nconst _LARPR = \"ListAutomatedReasoningPoliciesRequest\";\nconst _LARPRi = \"ListAutomatedReasoningPoliciesResponse\";\nconst _LARPTC = \"ListAutomatedReasoningPolicyTestCases\";\nconst _LARPTCR = \"ListAutomatedReasoningPolicyTestCasesRequest\";\nconst _LARPTCRi = \"ListAutomatedReasoningPolicyTestCasesResponse\";\nconst _LARPTR = \"ListAutomatedReasoningPolicyTestResults\";\nconst _LARPTRR = \"ListAutomatedReasoningPolicyTestResultsRequest\";\nconst _LARPTRRi = \"ListAutomatedReasoningPolicyTestResultsResponse\";\nconst _LC = \"LoggingConfig\";\nconst _LCM = \"ListCustomModels\";\nconst _LCMD = \"ListCustomModelDeployments\";\nconst _LCMDR = \"ListCustomModelDeploymentsRequest\";\nconst _LCMDRi = \"ListCustomModelDeploymentsResponse\";\nconst _LCMR = \"ListCustomModelsRequest\";\nconst _LCMRi = \"ListCustomModelsResponse\";\nconst _LEJ = \"ListEvaluationJobs\";\nconst _LEJR = \"ListEvaluationJobsRequest\";\nconst _LEJRi = \"ListEvaluationJobsResponse\";\nconst _LFM = \"ListFoundationModels\";\nconst _LFMAO = \"ListFoundationModelAgreementOffers\";\nconst _LFMAOR = \"ListFoundationModelAgreementOffersRequest\";\nconst _LFMAORi = \"ListFoundationModelAgreementOffersResponse\";\nconst _LFMR = \"ListFoundationModelsRequest\";\nconst _LFMRi = \"ListFoundationModelsResponse\";\nconst _LG = \"ListGuardrails\";\nconst _LGR = \"ListGuardrailsRequest\";\nconst _LGRi = \"ListGuardrailsResponse\";\nconst _LIM = \"ListImportedModels\";\nconst _LIMR = \"ListImportedModelsRequest\";\nconst _LIMRi = \"ListImportedModelsResponse\";\nconst _LIP = \"ListInferenceProfiles\";\nconst _LIPR = \"ListInferenceProfilesRequest\";\nconst _LIPRi = \"ListInferenceProfilesResponse\";\nconst _LMCJ = \"ListModelCopyJobs\";\nconst _LMCJR = \"ListModelCopyJobsRequest\";\nconst _LMCJRi = \"ListModelCopyJobsResponse\";\nconst _LMCJRis = \"ListModelCustomizationJobsRequest\";\nconst _LMCJRist = \"ListModelCustomizationJobsResponse\";\nconst _LMCJi = \"ListModelCustomizationJobs\";\nconst _LMIJ = \"ListModelImportJobs\";\nconst _LMIJR = \"ListModelImportJobsRequest\";\nconst _LMIJRi = \"ListModelImportJobsResponse\";\nconst _LMIJRis = \"ListModelInvocationJobsRequest\";\nconst _LMIJRist = \"ListModelInvocationJobsResponse\";\nconst _LMIJi = \"ListModelInvocationJobs\";\nconst _LMME = \"ListMarketplaceModelEndpoints\";\nconst _LMMER = \"ListMarketplaceModelEndpointsRequest\";\nconst _LMMERi = \"ListMarketplaceModelEndpointsResponse\";\nconst _LPMT = \"ListProvisionedModelThroughputs\";\nconst _LPMTR = \"ListProvisionedModelThroughputsRequest\";\nconst _LPMTRi = \"ListProvisionedModelThroughputsResponse\";\nconst _LPR = \"ListPromptRouters\";\nconst _LPRR = \"ListPromptRoutersRequest\";\nconst _LPRRi = \"ListPromptRoutersResponse\";\nconst _LT = \"LegalTerm\";\nconst _LTFR = \"ListTagsForResource\";\nconst _LTFRR = \"ListTagsForResourceRequest\";\nconst _LTFRRi = \"ListTagsForResourceResponse\";\nconst _M = \"Message\";\nconst _MAS = \"MetadataAttributeSchema\";\nconst _MASL = \"MetadataAttributeSchemaList\";\nconst _MCFR = \"MetadataConfigurationForReranking\";\nconst _MCJS = \"ModelCopyJobSummary\";\nconst _MCJSo = \"ModelCustomizationJobSummary\";\nconst _MCJSod = \"ModelCopyJobSummaries\";\nconst _MCJSode = \"ModelCustomizationJobSummaries\";\nconst _MDS = \"ModelDataSource\";\nconst _MIJIDC = \"ModelInvocationJobInputDataConfig\";\nconst _MIJODC = \"ModelInvocationJobOutputDataConfig\";\nconst _MIJS = \"ModelImportJobSummary\";\nconst _MIJSIDC = \"ModelInvocationJobS3InputDataConfig\";\nconst _MIJSODC = \"ModelInvocationJobS3OutputDataConfig\";\nconst _MIJSo = \"ModelInvocationJobSummary\";\nconst _MIJSod = \"ModelImportJobSummaries\";\nconst _MIJSode = \"ModelInvocationJobSummaries\";\nconst _MME = \"MarketplaceModelEndpoint\";\nconst _MMES = \"MarketplaceModelEndpointSummary\";\nconst _MMESa = \"MarketplaceModelEndpointSummaries\";\nconst _MN = \"MetricName\";\nconst _O = \"Offer\";\nconst _OC = \"OrchestrationConfiguration\";\nconst _ODC = \"OutputDataConfig\";\nconst _Of = \"Offers\";\nconst _PC = \"PerformanceConfiguration\";\nconst _PMILC = \"PutModelInvocationLoggingConfiguration\";\nconst _PMILCR = \"PutModelInvocationLoggingConfigurationRequest\";\nconst _PMILCRu = \"PutModelInvocationLoggingConfigurationResponse\";\nconst _PMS = \"ProvisionedModelSummary\";\nconst _PMSr = \"ProvisionedModelSummaries\";\nconst _PRD = \"PromptRouterDescription\";\nconst _PRS = \"PromptRouterSummary\";\nconst _PRSr = \"PromptRouterSummaries\";\nconst _PRTM = \"PromptRouterTargetModel\";\nconst _PRTMr = \"PromptRouterTargetModels\";\nconst _PT = \"PricingTerm\";\nconst _PTr = \"PromptTemplate\";\nconst _PUCFMA = \"PutUseCaseForModelAccess\";\nconst _PUCFMAR = \"PutUseCaseForModelAccessRequest\";\nconst _PUCFMARu = \"PutUseCaseForModelAccessResponse\";\nconst _QTC = \"QueryTransformationConfiguration\";\nconst _RAGC = \"RetrieveAndGenerateConfiguration\";\nconst _RAGCo = \"RAGConfig\";\nconst _RC = \"RetrieveConfig\";\nconst _RCa = \"RagConfigs\";\nconst _RCat = \"RateCard\";\nconst _RCo = \"RoutingCriteria\";\nconst _RF = \"RetrievalFilter\";\nconst _RFL = \"RetrievalFilterList\";\nconst _RIUE = \"ResourceInUseException\";\nconst _RMBF = \"RequestMetadataBaseFilters\";\nconst _RMF = \"RequestMetadataFilters\";\nconst _RMFL = \"RequestMetadataFiltersList\";\nconst _RMM = \"RequestMetadataMap\";\nconst _RMME = \"RegisterMarketplaceModelEndpoint\";\nconst _RMMER = \"RegisterMarketplaceModelEndpointRequest\";\nconst _RMMERe = \"RegisterMarketplaceModelEndpointResponse\";\nconst _RMSMC = \"RerankingMetadataSelectiveModeConfiguration\";\nconst _RNFE = \"ResourceNotFoundException\";\nconst _RS = \"RatingScale\";\nconst _RSI = \"RatingScaleItem\";\nconst _RSIV = \"RatingScaleItemValue\";\nconst _SARPBW = \"StartAutomatedReasoningPolicyBuildWorkflow\";\nconst _SARPBWR = \"StartAutomatedReasoningPolicyBuildWorkflowRequest\";\nconst _SARPBWRt = \"StartAutomatedReasoningPolicyBuildWorkflowResponse\";\nconst _SARPTW = \"StartAutomatedReasoningPolicyTestWorkflow\";\nconst _SARPTWR = \"StartAutomatedReasoningPolicyTestWorkflowRequest\";\nconst _SARPTWRt = \"StartAutomatedReasoningPolicyTestWorkflowResponse\";\nconst _SC = \"S3Config\";\nconst _SD = \"StatusDetails\";\nconst _SDS = \"S3DataSource\";\nconst _SEJ = \"StopEvaluationJob\";\nconst _SEJR = \"StopEvaluationJobRequest\";\nconst _SEJRt = \"StopEvaluationJobResponse\";\nconst _SMCJ = \"StopModelCustomizationJob\";\nconst _SMCJR = \"StopModelCustomizationJobRequest\";\nconst _SMCJRt = \"StopModelCustomizationJobResponse\";\nconst _SME = \"SageMakerEndpoint\";\nconst _SMIJ = \"StopModelInvocationJob\";\nconst _SMIJR = \"StopModelInvocationJobRequest\";\nconst _SMIJRt = \"StopModelInvocationJobResponse\";\nconst _SOD = \"S3ObjectDoc\";\nconst _SQEE = \"ServiceQuotaExceededException\";\nconst _ST = \"SupportTerm\";\nconst _SUE = \"ServiceUnavailableException\";\nconst _T = \"Tag\";\nconst _TD = \"TermDetails\";\nconst _TDC = \"TrainingDataConfig\";\nconst _TDr = \"TrainingDetails\";\nconst _TE = \"ThrottlingException\";\nconst _TIC = \"TextInferenceConfig\";\nconst _TL = \"TagList\";\nconst _TM = \"TrainingMetrics\";\nconst _TMC = \"TeacherModelConfig\";\nconst _TMTE = \"TooManyTagsException\";\nconst _TPT = \"TextPromptTemplate\";\nconst _TR = \"TagResource\";\nconst _TRR = \"TagResourceRequest\";\nconst _TRRa = \"TagResourceResponse\";\nconst _UARP = \"UpdateAutomatedReasoningPolicy\";\nconst _UARPA = \"UpdateAutomatedReasoningPolicyAnnotations\";\nconst _UARPAR = \"UpdateAutomatedReasoningPolicyAnnotationsRequest\";\nconst _UARPARp = \"UpdateAutomatedReasoningPolicyAnnotationsResponse\";\nconst _UARPR = \"UpdateAutomatedReasoningPolicyRequest\";\nconst _UARPRp = \"UpdateAutomatedReasoningPolicyResponse\";\nconst _UARPTC = \"UpdateAutomatedReasoningPolicyTestCase\";\nconst _UARPTCR = \"UpdateAutomatedReasoningPolicyTestCaseRequest\";\nconst _UARPTCRp = \"UpdateAutomatedReasoningPolicyTestCaseResponse\";\nconst _UG = \"UpdateGuardrail\";\nconst _UGR = \"UpdateGuardrailRequest\";\nconst _UGRp = \"UpdateGuardrailResponse\";\nconst _UMME = \"UpdateMarketplaceModelEndpoint\";\nconst _UMMER = \"UpdateMarketplaceModelEndpointRequest\";\nconst _UMMERp = \"UpdateMarketplaceModelEndpointResponse\";\nconst _UPMT = \"UpdateProvisionedModelThroughput\";\nconst _UPMTR = \"UpdateProvisionedModelThroughputRequest\";\nconst _UPMTRp = \"UpdateProvisionedModelThroughputResponse\";\nconst _UR = \"UntagResource\";\nconst _URR = \"UntagResourceRequest\";\nconst _URRn = \"UntagResourceResponse\";\nconst _V = \"Validator\";\nconst _VC = \"VpcConfig\";\nconst _VD = \"ValidationDetails\";\nconst _VDC = \"ValidationDataConfig\";\nconst _VE = \"ValidationException\";\nconst _VM = \"ValidatorMetric\";\nconst _VMa = \"ValidationMetrics\";\nconst _VSBRC = \"VectorSearchBedrockRerankingConfiguration\";\nconst _VSBRMC = \"VectorSearchBedrockRerankingModelConfiguration\";\nconst _VSRC = \"VectorSearchRerankingConfiguration\";\nconst _VT = \"ValidityTerm\";\nconst _Va = \"Validators\";\nconst _a = \"annotation\";\nconst _aA = \"agreementAvailability\";\nconst _aAn = \"andAll\";\nconst _aD = \"agreementDuration\";\nconst _aE = \"alternateExpression\";\nconst _aEc = \"acceptEula\";\nconst _aMRF = \"additionalModelRequestFields\";\nconst _aR = \"addRule\";\nconst _aRFNL = \"addRuleFromNaturalLanguage\";\nconst _aRP = \"automatedReasoningPolicy\";\nconst _aRPBWS = \"automatedReasoningPolicyBuildWorkflowSummaries\";\nconst _aRPC = \"automatedReasoningPolicyConfig\";\nconst _aRPS = \"automatedReasoningPolicySummaries\";\nconst _aS = \"authorizationStatus\";\nconst _aSH = \"annotationSetHash\";\nconst _aT = \"applicationType\";\nconst _aTE = \"applicationTypeEquals\";\nconst _aTFR = \"aggregatedTestFindingsResult\";\nconst _aTV = \"addTypeValue\";\nconst _aTd = \"addType\";\nconst _aTs = \"assetType\";\nconst _aV = \"addVariable\";\nconst _ac = \"action\";\nconst _an = \"annotations\";\nconst _ar = \"arn\";\nconst _au = \"automated\";\nconst _bC = \"byteContent\";\nconst _bCT = \"byCustomizationType\";\nconst _bEM = \"bedrockEvaluatorModels\";\nconst _bIM = \"blockedInputMessaging\";\nconst _bIT = \"byInferenceType\";\nconst _bKBI = \"bedrockKnowledgeBaseIdentifiers\";\nconst _bL = \"buildLog\";\nconst _bM = \"bedrockModel\";\nconst _bMA = \"baseModelArn\";\nconst _bMAE = \"baseModelArnEquals\";\nconst _bMI = \"baseModelIdentifier\";\nconst _bMIe = \"bedrockModelIdentifiers\";\nconst _bMN = \"baseModelName\";\nconst _bN = \"bucketName\";\nconst _bOM = \"blockedOutputsMessaging\";\nconst _bOMy = \"byOutputModality\";\nconst _bP = \"byProvider\";\nconst _bRC = \"bedrockRerankingConfiguration\";\nconst _bS = \"buildSteps\";\nconst _bWA = \"buildWorkflowAssets\";\nconst _bWI = \"buildWorkflowId\";\nconst _bWT = \"buildWorkflowType\";\nconst _c = \"client\";\nconst _cA = \"createdAt\";\nconst _cAr = \"createdAfter\";\nconst _cB = \"createdBefore\";\nconst _cC = \"customizationConfig\";\nconst _cD = \"commitmentDuration\";\nconst _cEKI = \"customerEncryptionKeyId\";\nconst _cET = \"commitmentExpirationTime\";\nconst _cF = \"copyFrom\";\nconst _cFS = \"claimsFalseScenario\";\nconst _cGP = \"contextualGroundingPolicy\";\nconst _cGPC = \"contextualGroundingPolicyConfig\";\nconst _cM = \"customMetrics\";\nconst _cMA = \"customModelArn\";\nconst _cMC = \"customMetricConfig\";\nconst _cMD = \"customMetricDefinition\";\nconst _cMDA = \"customModelDeploymentArn\";\nconst _cMDI = \"customModelDeploymentIdentifier\";\nconst _cMDN = \"customModelDeploymentName\";\nconst _cMEMI = \"customMetricsEvaluatorModelIdentifiers\";\nconst _cMKKI = \"customModelKmsKeyId\";\nconst _cMN = \"customModelName\";\nconst _cMT = \"customModelTags\";\nconst _cMU = \"customModelUnits\";\nconst _cMUPMC = \"customModelUnitsPerModelCopy\";\nconst _cMUV = \"customModelUnitsVersion\";\nconst _cP = \"contentPolicy\";\nconst _cPC = \"contentPolicyConfig\";\nconst _cR = \"contradictingRules\";\nconst _cRC = \"crossRegionConfig\";\nconst _cRD = \"crossRegionDetails\";\nconst _cRT = \"clientRequestToken\";\nconst _cRo = \"conflictingRules\";\nconst _cS = \"customizationsSupported\";\nconst _cT = \"confidenceThreshold\";\nconst _cTA = \"creationTimeAfter\";\nconst _cTB = \"creationTimeBefore\";\nconst _cTS = \"claimsTrueScenario\";\nconst _cTo = \"contentType\";\nconst _cTr = \"creationTime\";\nconst _cTu = \"customizationType\";\nconst _cWC = \"cloudWatchConfig\";\nconst _cl = \"claims\";\nconst _co = \"confidence\";\nconst _cod = \"code\";\nconst _con = \"context\";\nconst _cont = \"content\";\nconst _d = \"description\";\nconst _dC = \"distillationConfig\";\nconst _dCT = \"documentContentType\";\nconst _dD = \"documentDescription\";\nconst _dH = \"definitionHash\";\nconst _dL = \"datasetLocation\";\nconst _dMA = \"desiredModelArn\";\nconst _dMC = \"datasetMetricConfigs\";\nconst _dMI = \"desiredModelId\";\nconst _dMU = \"desiredModelUnits\";\nconst _dN = \"documentName\";\nconst _dPD = \"dataProcessingDetails\";\nconst _dPMN = \"desiredProvisionedModelName\";\nconst _dR = \"deleteRule\";\nconst _dRS = \"disjointRuleSets\";\nconst _dS = \"differenceScenarios\";\nconst _dT = \"deleteType\";\nconst _dTV = \"deleteTypeValue\";\nconst _dV = \"deleteVariable\";\nconst _da = \"data\";\nconst _dat = \"dataset\";\nconst _de = \"definition\";\nconst _di = \"dimension\";\nconst _do = \"document\";\nconst _doc = \"documents\";\nconst _e = \"error\";\nconst _eA = \"endpointArn\";\nconst _eAFR = \"expectedAggregatedFindingsResult\";\nconst _eAn = \"entitlementAvailability\";\nconst _eC = \"evaluationConfig\";\nconst _eCn = \"endpointConfig\";\nconst _eDDE = \"embeddingDataDeliveryEnabled\";\nconst _eI = \"endpointIdentifier\";\nconst _eJ = \"evaluationJobs\";\nconst _eM = \"errorMessage\";\nconst _eMC = \"evaluatorModelConfig\";\nconst _eMI = \"evaluatorModelIdentifiers\";\nconst _eN = \"endpointName\";\nconst _eR = \"expectedResult\";\nconst _eRx = \"executionRole\";\nconst _eS = \"endpointStatus\";\nconst _eSC = \"externalSourcesConfiguration\";\nconst _eSM = \"endpointStatusMessage\";\nconst _eT = \"endTime\";\nconst _eTT = \"evaluationTaskTypes\";\nconst _en = \"entries\";\nconst _ena = \"enabled\";\nconst _eq = \"equals\";\nconst _er = \"errors\";\nconst _ex = \"expression\";\nconst _exa = \"examples\";\nconst _f = \"feedback\";\nconst _fC = \"filtersConfig\";\nconst _fD = \"formData\";\nconst _fDA = \"flowDefinitionArn\";\nconst _fM = \"fallbackModel\";\nconst _fMA = \"foundationModelArn\";\nconst _fMAE = \"foundationModelArnEquals\";\nconst _fMa = \"failureMessage\";\nconst _fMai = \"failureMessages\";\nconst _fN = \"fieldName\";\nconst _fR = \"failureRecommendations\";\nconst _fTE = \"fieldsToExclude\";\nconst _fTI = \"fieldsToInclude\";\nconst _fV = \"floatValue\";\nconst _fi = \"filters\";\nconst _fil = \"filter\";\nconst _fo = \"force\";\nconst _g = \"guardrails\";\nconst _gA = \"guardrailArn\";\nconst _gC = \"guardContent\";\nconst _gCe = \"generationConfiguration\";\nconst _gCu = \"guardrailConfiguration\";\nconst _gI = \"guardrailId\";\nconst _gIu = \"guardrailIdentifier\";\nconst _gPA = \"guardrailProfileArn\";\nconst _gPI = \"guardrailProfileIdentifier\";\nconst _gPIu = \"guardrailProfileId\";\nconst _gT = \"greaterThan\";\nconst _gTC = \"generatedTestCases\";\nconst _gTOE = \"greaterThanOrEquals\";\nconst _gV = \"guardrailVersion\";\nconst _h = \"human\";\nconst _hE = \"httpError\";\nconst _hH = \"httpHeader\";\nconst _hP = \"hyperParameters\";\nconst _hQ = \"httpQuery\";\nconst _hWC = \"humanWorkflowConfig\";\nconst _ht = \"http\";\nconst _i = \"id\";\nconst _iA = \"inputAction\";\nconst _iC = \"inferenceConfig\";\nconst _iCS = \"inferenceConfigSummary\";\nconst _iCn = \"ingestContent\";\nconst _iDC = \"inputDataConfig\";\nconst _iDDE = \"imageDataDeliveryEnabled\";\nconst _iE = \"inputEnabled\";\nconst _iFC = \"implicitFilterConfiguration\";\nconst _iIC = \"initialInstanceCount\";\nconst _iJS = \"invocationJobSummaries\";\nconst _iLC = \"invocationLogsConfig\";\nconst _iLS = \"invocationLogSource\";\nconst _iM = \"inputModalities\";\nconst _iMA = \"importedModelArn\";\nconst _iMKKA = \"importedModelKmsKeyArn\";\nconst _iMKKI = \"importedModelKmsKeyId\";\nconst _iMN = \"importedModelName\";\nconst _iMT = \"importedModelTags\";\nconst _iO = \"isOwned\";\nconst _iP = \"inferenceParams\";\nconst _iPA = \"inferenceProfileArn\";\nconst _iPI = \"inferenceProfileIdentifier\";\nconst _iPIn = \"inferenceProfileId\";\nconst _iPN = \"inferenceProfileName\";\nconst _iPS = \"inferenceProfileSummaries\";\nconst _iS = \"instructSupported\";\nconst _iSI = \"inferenceSourceIdentifier\";\nconst _iSn = \"inputStrength\";\nconst _iT = \"instanceType\";\nconst _iTS = \"inferenceTypesSupported\";\nconst _iTd = \"idempotencyToken\";\nconst _id = \"identifier\";\nconst _im = \"impossible\";\nconst _in = \"instructions\";\nconst _in_ = \"in\";\nconst _inv = \"invalid\";\nconst _jA = \"jobArn\";\nconst _jD = \"jobDescription\";\nconst _jET = \"jobExpirationTime\";\nconst _jI = \"jobIdentifier\";\nconst _jIo = \"jobIdentifiers\";\nconst _jN = \"jobName\";\nconst _jS = \"jobStatus\";\nconst _jSo = \"jobSummaries\";\nconst _jT = \"jobTags\";\nconst _jTo = \"jobType\";\nconst _k = \"key\";\nconst _kBC = \"knowledgeBaseConfiguration\";\nconst _kBCn = \"knowledgeBaseConfig\";\nconst _kBI = \"knowledgeBaseId\";\nconst _kBRC = \"knowledgeBaseRetrievalConfiguration\";\nconst _kEK = \"kmsEncryptionKey\";\nconst _kIC = \"kbInferenceConfig\";\nconst _kKA = \"kmsKeyArn\";\nconst _kKI = \"kmsKeyId\";\nconst _kP = \"keyPrefix\";\nconst _l = \"logic\";\nconst _lC = \"loggingConfig\";\nconst _lCi = \"listContains\";\nconst _lDDSC = \"largeDataDeliveryS3Config\";\nconst _lGN = \"logGroupName\";\nconst _lMT = \"lastModifiedTime\";\nconst _lT = \"legalTerm\";\nconst _lTOE = \"lessThanOrEquals\";\nconst _lTe = \"lessThan\";\nconst _lUA = \"lastUpdatedAt\";\nconst _lUASH = \"lastUpdatedAnnotationSetHash\";\nconst _lUDH = \"lastUpdatedDefinitionHash\";\nconst _lW = \"logicWarning\";\nconst _la = \"latency\";\nconst _m = \"message\";\nconst _mA = \"modelArn\";\nconst _mAE = \"modelArnEquals\";\nconst _mAe = \"metadataAttributes\";\nconst _mAo = \"modelArchitecture\";\nconst _mC = \"modelConfiguration\";\nconst _mCJS = \"modelCopyJobSummaries\";\nconst _mCJSo = \"modelCustomizationJobSummaries\";\nconst _mCS = \"modelConfigSummary\";\nconst _mCe = \"metadataConfiguration\";\nconst _mD = \"modelDetails\";\nconst _mDN = \"modelDeploymentName\";\nconst _mDS = \"modelDataSource\";\nconst _mDSo = \"modelDeploymentSummaries\";\nconst _mI = \"modelIdentifier\";\nconst _mIJS = \"modelImportJobSummaries\";\nconst _mIo = \"modelId\";\nconst _mIod = \"modelIdentifiers\";\nconst _mKKA = \"modelKmsKeyArn\";\nconst _mKKI = \"modelKmsKeyId\";\nconst _mL = \"modelLifecycle\";\nconst _mME = \"marketplaceModelEndpoint\";\nconst _mMEa = \"marketplaceModelEndpoints\";\nconst _mN = \"modelName\";\nconst _mNe = \"metricNames\";\nconst _mR = \"maxResults\";\nconst _mRLFI = \"maxResponseLengthForInference\";\nconst _mS = \"modelSource\";\nconst _mSC = \"modelSourceConfig\";\nconst _mSE = \"modelSourceEquals\";\nconst _mSI = \"modelSourceIdentifier\";\nconst _mSo = \"modelStatus\";\nconst _mSod = \"modelSummaries\";\nconst _mT = \"messageType\";\nconst _mTa = \"maxTokens\";\nconst _mTo = \"modelTags\";\nconst _mU = \"modelUnits\";\nconst _mWL = \"managedWordLists\";\nconst _mWLC = \"managedWordListsConfig\";\nconst _me = \"messages\";\nconst _mo = \"models\";\nconst _mu = \"mutation\";\nconst _n = \"name\";\nconst _nC = \"nameContains\";\nconst _nE = \"notEquals\";\nconst _nI = \"notIn\";\nconst _nL = \"naturalLanguage\";\nconst _nN = \"newName\";\nconst _nOR = \"numberOfResults\";\nconst _nORR = \"numberOfRerankedResults\";\nconst _nT = \"nextToken\";\nconst _nTo = \"noTranslations\";\nconst _nV = \"newValue\";\nconst _o = \"options\";\nconst _oA = \"outputAction\";\nconst _oAI = \"ownerAccountId\";\nconst _oAr = \"orAll\";\nconst _oC = \"orchestrationConfiguration\";\nconst _oDC = \"outputDataConfig\";\nconst _oE = \"outputEnabled\";\nconst _oI = \"offerId\";\nconst _oM = \"outputModalities\";\nconst _oMA = \"outputModelArn\";\nconst _oMKKA = \"outputModelKmsKeyArn\";\nconst _oMN = \"outputModelName\";\nconst _oMNC = \"outputModelNameContains\";\nconst _oS = \"outputStrength\";\nconst _oST = \"overrideSearchType\";\nconst _oT = \"offerToken\";\nconst _oTf = \"offerType\";\nconst _of = \"offers\";\nconst _p = \"premises\";\nconst _pA = \"policyArn\";\nconst _pC = \"performanceConfig\";\nconst _pD = \"policyDefinition\";\nconst _pDR = \"policyDefinitionRule\";\nconst _pDT = \"policyDefinitionType\";\nconst _pDV = \"policyDefinitionVariable\";\nconst _pE = \"priorElement\";\nconst _pEC = \"piiEntitiesConfig\";\nconst _pEi = \"piiEntities\";\nconst _pI = \"policyId\";\nconst _pIS = \"precomputedInferenceSource\";\nconst _pISI = \"precomputedInferenceSourceIdentifiers\";\nconst _pMA = \"provisionedModelArn\";\nconst _pMI = \"provisionedModelId\";\nconst _pMN = \"provisionedModelName\";\nconst _pMS = \"provisionedModelSummaries\";\nconst _pN = \"providerName\";\nconst _pRA = \"promptRouterArn\";\nconst _pRAo = \"policyRepairAssets\";\nconst _pRN = \"promptRouterName\";\nconst _pRS = \"promptRouterSummaries\";\nconst _pRSC = \"precomputedRagSourceConfig\";\nconst _pRSI = \"precomputedRagSourceIdentifiers\";\nconst _pT = \"promptTemplate\";\nconst _pVA = \"policyVersionArn\";\nconst _pa = \"pattern\";\nconst _pl = \"planning\";\nconst _po = \"policies\";\nconst _pr = \"price\";\nconst _qC = \"queryContent\";\nconst _qR = \"qualityReport\";\nconst _qTC = \"queryTransformationConfiguration\";\nconst _r = \"rule\";\nconst _rA = \"roleArn\";\nconst _rAGC = \"retrieveAndGenerateConfig\";\nconst _rAGSC = \"retrieveAndGenerateSourceConfig\";\nconst _rARN = \"resourceARN\";\nconst _rAe = \"regionAvailability\";\nconst _rC = \"ruleCount\";\nconst _rCS = \"ragConfigSummary\";\nconst _rCa = \"rateCard\";\nconst _rCag = \"ragConfigs\";\nconst _rCe = \"regexesConfig\";\nconst _rCer = \"rerankingConfiguration\";\nconst _rCet = \"retrievalConfiguration\";\nconst _rCetr = \"retrieveConfig\";\nconst _rCo = \"routingCriteria\";\nconst _rI = \"ruleId\";\nconst _rIa = \"ragIdentifiers\";\nconst _rIu = \"ruleIds\";\nconst _rM = \"ratingMethod\";\nconst _rMF = \"requestMetadataFilters\";\nconst _rN = \"resourceName\";\nconst _rPD = \"refundPolicyDescription\";\nconst _rQD = \"responseQualityDifference\";\nconst _rS = \"ratingScale\";\nconst _rSC = \"retrieveSourceConfig\";\nconst _rSI = \"ragSourceIdentifier\";\nconst _rSS = \"responseStreamingSupported\";\nconst _re = \"regexes\";\nconst _ru = \"rules\";\nconst _s = \"status\";\nconst _sAE = \"sourceAccountEquals\";\nconst _sAI = \"sourceAccountId\";\nconst _sB = \"sortBy\";\nconst _sBO = \"s3BucketOwner\";\nconst _sC = \"s3Config\";\nconst _sCo = \"sourceContent\";\nconst _sCt = \"stringContains\";\nconst _sD = \"statusDetails\";\nconst _sDS = \"s3DataSource\";\nconst _sE = \"scenarioExpression\";\nconst _sEKI = \"s3EncryptionKeyId\";\nconst _sEt = \"statusEquals\";\nconst _sGI = \"securityGroupIds\";\nconst _sI = \"subnetIds\";\nconst _sIDC = \"s3InputDataConfig\";\nconst _sIF = \"s3InputFormat\";\nconst _sIP = \"sensitiveInformationPolicy\";\nconst _sIPC = \"sensitiveInformationPolicyConfig\";\nconst _sL = \"s3Location\";\nconst _sM = \"statusMessage\";\nconst _sMA = \"sourceModelArn\";\nconst _sMAE = \"sourceModelArnEquals\";\nconst _sMC = \"selectiveModeConfiguration\";\nconst _sMN = \"sourceModelName\";\nconst _sMa = \"sageMaker\";\nconst _sMe = \"selectionMode\";\nconst _sO = \"sortOrder\";\nconst _sODC = \"s3OutputDataConfig\";\nconst _sR = \"supportingRules\";\nconst _sRt = \"statusReasons\";\nconst _sS = \"stopSequences\";\nconst _sT = \"sourceType\";\nconst _sTA = \"submitTimeAfter\";\nconst _sTB = \"submitTimeBefore\";\nconst _sTu = \"submitTime\";\nconst _sTup = \"supportTerm\";\nconst _sU = \"s3Uri\";\nconst _sV = \"stringValue\";\nconst _sW = \"startsWith\";\nconst _sa = \"satisfiable\";\nconst _sc = \"scenario\";\nconst _se = \"server\";\nconst _sm = \"smithy.ts.sdk.synthetic.com.amazonaws.bedrock\";\nconst _so = \"sources\";\nconst _st = \"statements\";\nconst _t = \"translation\";\nconst _tA = \"translationAmbiguous\";\nconst _tC = \"typeCount\";\nconst _tCI = \"testCaseId\";\nconst _tCIe = \"testCaseIds\";\nconst _tCe = \"testCase\";\nconst _tCes = \"testCases\";\nconst _tCi = \"tierConfig\";\nconst _tCo = \"topicsConfig\";\nconst _tCoo = \"tooComplex\";\nconst _tD = \"termDetails\";\nconst _tDC = \"trainingDataConfig\";\nconst _tDDE = \"textDataDeliveryEnabled\";\nconst _tDIH = \"timeoutDurationInHours\";\nconst _tDr = \"trainingDetails\";\nconst _tE = \"typeEquals\";\nconst _tF = \"testFindings\";\nconst _tIC = \"textInferenceConfig\";\nconst _tK = \"tagKeys\";\nconst _tL = \"trainingLoss\";\nconst _tM = \"trainingMetrics\";\nconst _tMA = \"targetModelArn\";\nconst _tMC = \"teacherModelConfig\";\nconst _tMI = \"teacherModelIdentifier\";\nconst _tMKKA = \"targetModelKmsKeyArn\";\nconst _tMN = \"targetModelName\";\nconst _tMNC = \"targetModelNameContains\";\nconst _tMT = \"targetModelTags\";\nconst _tN = \"typeName\";\nconst _tNi = \"tierName\";\nconst _tP = \"topicPolicy\";\nconst _tPC = \"topicPolicyConfig\";\nconst _tPT = \"textPromptTemplate\";\nconst _tPo = \"topP\";\nconst _tR = \"testResult\";\nconst _tRR = \"testRunResult\";\nconst _tRS = \"testRunStatus\";\nconst _tRe = \"testResults\";\nconst _tT = \"taskType\";\nconst _ta = \"tags\";\nconst _te = \"text\";\nconst _tem = \"temperature\";\nconst _th = \"threshold\";\nconst _ti = \"tier\";\nconst _to = \"topics\";\nconst _tr = \"translations\";\nconst _ty = \"type\";\nconst _typ = \"types\";\nconst _u = \"unit\";\nconst _uA = \"updatedAt\";\nconst _uBPT = \"usageBasedPricingTerm\";\nconst _uC = \"untranslatedClaims\";\nconst _uFRF = \"updateFromRulesFeedback\";\nconst _uFSF = \"updateFromScenarioFeedback\";\nconst _uP = \"untranslatedPremises\";\nconst _uPR = \"usePromptResponse\";\nconst _uR = \"updateRule\";\nconst _uT = \"unusedTypes\";\nconst _uTV = \"unusedTypeValues\";\nconst _uTVp = \"updateTypeValue\";\nconst _uTp = \"updateType\";\nconst _uV = \"unusedVariables\";\nconst _uVp = \"updateVariable\";\nconst _ur = \"url\";\nconst _uri = \"uri\";\nconst _v = \"values\";\nconst _vC = \"variableCount\";\nconst _vCp = \"vpcConfig\";\nconst _vD = \"validationDetails\";\nconst _vDC = \"validationDataConfig\";\nconst _vDDE = \"videoDataDeliveryEnabled\";\nconst _vL = \"validationLoss\";\nconst _vM = \"validationMetrics\";\nconst _vN = \"valueName\";\nconst _vSC = \"vectorSearchConfiguration\";\nconst _vT = \"validityTerm\";\nconst _va = \"value\";\nconst _val = \"validators\";\nconst _vali = \"valid\";\nconst _var = \"variable\";\nconst _vari = \"variables\";\nconst _ve = \"version\";\nconst _vp = \"vpc\";\nconst _w = \"words\";\nconst _wC = \"workflowContent\";\nconst _wCo = \"wordsConfig\";\nconst _wP = \"wordPolicy\";\nconst _wPC = \"wordPolicyConfig\";\nconst _xact = \"x-amz-client-token\";\nconst n0 = \"com.amazonaws.bedrock\";\nvar AutomatedReasoningLogicStatementContent = [0, n0, _ARLSC, 8, 0];\nvar AutomatedReasoningNaturalLanguageStatementContent = [0, n0, _ARNLSC, 8, 0];\nvar AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage = [0, n0, _ARPAFNL, 8, 0];\nvar AutomatedReasoningPolicyAnnotationIngestContent = [0, n0, _ARPAIC, 8, 0];\nvar AutomatedReasoningPolicyAnnotationRuleNaturalLanguage = [0, n0, _ARPARNL, 8, 0];\nvar AutomatedReasoningPolicyBuildDocumentBlob = [0, n0, _ARPBDB, 8, 21];\nvar AutomatedReasoningPolicyBuildDocumentDescription = [0, n0, _ARPBDD, 8, 0];\nvar AutomatedReasoningPolicyBuildDocumentName = [0, n0, _ARPBDN, 8, 0];\nvar AutomatedReasoningPolicyDefinitionRuleAlternateExpression = [0, n0, _ARPDRAE, 8, 0];\nvar AutomatedReasoningPolicyDefinitionRuleExpression = [0, n0, _ARPDRE, 8, 0];\nvar AutomatedReasoningPolicyDefinitionTypeDescription = [0, n0, _ARPDTD, 8, 0];\nvar AutomatedReasoningPolicyDefinitionTypeName = [0, n0, _ARPDTN, 8, 0];\nvar AutomatedReasoningPolicyDefinitionTypeValueDescription = [0, n0, _ARPDTVD, 8, 0];\nvar AutomatedReasoningPolicyDefinitionVariableDescription = [0, n0, _ARPDVD, 8, 0];\nvar AutomatedReasoningPolicyDefinitionVariableName = [0, n0, _ARPDVN, 8, 0];\nvar AutomatedReasoningPolicyDescription = [0, n0, _ARPD, 8, 0];\nvar AutomatedReasoningPolicyName = [0, n0, _ARPN, 8, 0];\nvar AutomatedReasoningPolicyScenarioAlternateExpression = [0, n0, _ARPSAE, 8, 0];\nvar AutomatedReasoningPolicyScenarioExpression = [0, n0, _ARPSE, 8, 0];\nvar AutomatedReasoningPolicyTestGuardContent = [0, n0, _ARPTGC, 8, 0];\nvar AutomatedReasoningPolicyTestQueryContent = [0, n0, _ARPTQC, 8, 0];\nvar ByteContentBlob = [0, n0, _BCB, 8, 21];\nvar EvaluationDatasetName = [0, n0, _EDN, 8, 0];\nvar EvaluationJobDescription = [0, n0, _EJD, 8, 0];\nvar EvaluationJobIdentifier = [0, n0, _EJI, 8, 0];\nvar EvaluationMetricDescription = [0, n0, _EMD, 8, 0];\nvar EvaluationMetricName = [0, n0, _EMN, 8, 0];\nvar EvaluationModelInferenceParams = [0, n0, _EMIP, 8, 0];\nvar GuardrailBlockedMessaging = [0, n0, _GBM, 8, 0];\nvar GuardrailContentFilterAction$1 = [0, n0, _GCFA, 8, 0];\nvar GuardrailContentFiltersTierName$1 = [0, n0, _GCFTN, 8, 0];\nvar GuardrailContextualGroundingAction$1 = [0, n0, _GCGA, 8, 0];\nvar GuardrailDescription = [0, n0, _GD, 8, 0];\nvar GuardrailFailureRecommendation = [0, n0, _GFR, 8, 0];\nvar GuardrailModality$1 = [0, n0, _GM, 8, 0];\nvar GuardrailName = [0, n0, _GN, 8, 0];\nvar GuardrailStatusReason = [0, n0, _GSR, 8, 0];\nvar GuardrailTopicAction$1 = [0, n0, _GTA, 8, 0];\nvar GuardrailTopicDefinition = [0, n0, _GTD, 8, 0];\nvar GuardrailTopicExample = [0, n0, _GTE, 8, 0];\nvar GuardrailTopicName = [0, n0, _GTN, 8, 0];\nvar GuardrailTopicsTierName$1 = [0, n0, _GTTN, 8, 0];\nvar GuardrailWordAction$1 = [0, n0, _GWA, 8, 0];\nvar HumanTaskInstructions = [0, n0, _HTI, 8, 0];\nvar Identifier = [0, n0, _I, 8, 0];\nvar InferenceProfileDescription = [0, n0, _IPD, 8, 0];\nvar Message = [0, n0, _M, 8, 0];\nvar MetricName = [0, n0, _MN, 8, 0];\nvar PromptRouterDescription = [0, n0, _PRD, 8, 0];\nvar TextPromptTemplate = [0, n0, _TPT, 8, 0];\nvar AccessDeniedException = [\n -3,\n n0,\n _ADE,\n {\n [_e]: _c,\n [_hE]: 403,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1);\nvar AgreementAvailability = [3, n0, _AA, 0, [_s, _eM], [0, 0]];\nvar AutomatedEvaluationConfig = [\n 3,\n n0,\n _AEC,\n 0,\n [_dMC, _eMC, _cMC],\n [\n [() => EvaluationDatasetMetricConfigs, 0],\n () => EvaluatorModelConfig,\n [() => AutomatedEvaluationCustomMetricConfig, 0],\n ],\n];\nvar AutomatedEvaluationCustomMetricConfig = [\n 3,\n n0,\n _AECMC,\n 0,\n [_cM, _eMC],\n [[() => AutomatedEvaluationCustomMetrics, 0], () => CustomMetricEvaluatorModelConfig],\n];\nvar AutomatedReasoningCheckImpossibleFinding = [\n 3,\n n0,\n _ARCIF,\n 0,\n [_t, _cR, _lW],\n [\n [() => AutomatedReasoningCheckTranslation, 0],\n () => AutomatedReasoningCheckRuleList,\n [() => AutomatedReasoningCheckLogicWarning, 0],\n ],\n];\nvar AutomatedReasoningCheckInputTextReference = [\n 3,\n n0,\n _ARCITR,\n 0,\n [_te],\n [[() => AutomatedReasoningNaturalLanguageStatementContent, 0]],\n];\nvar AutomatedReasoningCheckInvalidFinding = [\n 3,\n n0,\n _ARCIFu,\n 0,\n [_t, _cR, _lW],\n [\n [() => AutomatedReasoningCheckTranslation, 0],\n () => AutomatedReasoningCheckRuleList,\n [() => AutomatedReasoningCheckLogicWarning, 0],\n ],\n];\nvar AutomatedReasoningCheckLogicWarning = [\n 3,\n n0,\n _ARCLW,\n 0,\n [_ty, _p, _cl],\n [0, [() => AutomatedReasoningLogicStatementList, 0], [() => AutomatedReasoningLogicStatementList, 0]],\n];\nvar AutomatedReasoningCheckNoTranslationsFinding = [3, n0, _ARCNTF, 0, [], []];\nvar AutomatedReasoningCheckRule = [3, n0, _ARCR, 0, [_i, _pVA], [0, 0]];\nvar AutomatedReasoningCheckSatisfiableFinding = [\n 3,\n n0,\n _ARCSF,\n 0,\n [_t, _cTS, _cFS, _lW],\n [\n [() => AutomatedReasoningCheckTranslation, 0],\n [() => AutomatedReasoningCheckScenario, 0],\n [() => AutomatedReasoningCheckScenario, 0],\n [() => AutomatedReasoningCheckLogicWarning, 0],\n ],\n];\nvar AutomatedReasoningCheckScenario = [\n 3,\n n0,\n _ARCS,\n 0,\n [_st],\n [[() => AutomatedReasoningLogicStatementList, 0]],\n];\nvar AutomatedReasoningCheckTooComplexFinding = [3, n0, _ARCTCF, 0, [], []];\nvar AutomatedReasoningCheckTranslation = [\n 3,\n n0,\n _ARCT,\n 0,\n [_p, _cl, _uP, _uC, _co],\n [\n [() => AutomatedReasoningLogicStatementList, 0],\n [() => AutomatedReasoningLogicStatementList, 0],\n [() => AutomatedReasoningCheckInputTextReferenceList, 0],\n [() => AutomatedReasoningCheckInputTextReferenceList, 0],\n 1,\n ],\n];\nvar AutomatedReasoningCheckTranslationAmbiguousFinding = [\n 3,\n n0,\n _ARCTAF,\n 0,\n [_o, _dS],\n [\n [() => AutomatedReasoningCheckTranslationOptionList, 0],\n [() => AutomatedReasoningCheckDifferenceScenarioList, 0],\n ],\n];\nvar AutomatedReasoningCheckTranslationOption = [\n 3,\n n0,\n _ARCTO,\n 0,\n [_tr],\n [[() => AutomatedReasoningCheckTranslationList, 0]],\n];\nvar AutomatedReasoningCheckValidFinding = [\n 3,\n n0,\n _ARCVF,\n 0,\n [_t, _cTS, _sR, _lW],\n [\n [() => AutomatedReasoningCheckTranslation, 0],\n [() => AutomatedReasoningCheckScenario, 0],\n () => AutomatedReasoningCheckRuleList,\n [() => AutomatedReasoningCheckLogicWarning, 0],\n ],\n];\nvar AutomatedReasoningLogicStatement = [\n 3,\n n0,\n _ARLS,\n 0,\n [_l, _nL],\n [\n [() => AutomatedReasoningLogicStatementContent, 0],\n [() => AutomatedReasoningNaturalLanguageStatementContent, 0],\n ],\n];\nvar AutomatedReasoningPolicyAddRuleAnnotation = [\n 3,\n n0,\n _ARPARA,\n 0,\n [_ex],\n [[() => AutomatedReasoningPolicyDefinitionRuleExpression, 0]],\n];\nvar AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation = [\n 3,\n n0,\n _ARPARFNLA,\n 0,\n [_nL],\n [[() => AutomatedReasoningPolicyAnnotationRuleNaturalLanguage, 0]],\n];\nvar AutomatedReasoningPolicyAddRuleMutation = [\n 3,\n n0,\n _ARPARM,\n 0,\n [_r],\n [[() => AutomatedReasoningPolicyDefinitionRule, 0]],\n];\nvar AutomatedReasoningPolicyAddTypeAnnotation = [\n 3,\n n0,\n _ARPATA,\n 0,\n [_n, _d, _v],\n [\n [() => AutomatedReasoningPolicyDefinitionTypeName, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeDescription, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeValueList, 0],\n ],\n];\nvar AutomatedReasoningPolicyAddTypeMutation = [\n 3,\n n0,\n _ARPATM,\n 0,\n [_ty],\n [[() => AutomatedReasoningPolicyDefinitionType, 0]],\n];\nvar AutomatedReasoningPolicyAddTypeValue = [\n 3,\n n0,\n _ARPATV,\n 0,\n [_va, _d],\n [0, [() => AutomatedReasoningPolicyDefinitionTypeValueDescription, 0]],\n];\nvar AutomatedReasoningPolicyAddVariableAnnotation = [\n 3,\n n0,\n _ARPAVA,\n 0,\n [_n, _ty, _d],\n [\n [() => AutomatedReasoningPolicyDefinitionVariableName, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeName, 0],\n [() => AutomatedReasoningPolicyDefinitionVariableDescription, 0],\n ],\n];\nvar AutomatedReasoningPolicyAddVariableMutation = [\n 3,\n n0,\n _ARPAVM,\n 0,\n [_var],\n [[() => AutomatedReasoningPolicyDefinitionVariable, 0]],\n];\nvar AutomatedReasoningPolicyBuildLog = [\n 3,\n n0,\n _ARPBL,\n 0,\n [_en],\n [[() => AutomatedReasoningPolicyBuildLogEntryList, 0]],\n];\nvar AutomatedReasoningPolicyBuildLogEntry = [\n 3,\n n0,\n _ARPBLE,\n 0,\n [_a, _s, _bS],\n [[() => AutomatedReasoningPolicyAnnotation, 0], 0, [() => AutomatedReasoningPolicyBuildStepList, 0]],\n];\nvar AutomatedReasoningPolicyBuildStep = [\n 3,\n n0,\n _ARPBS,\n 0,\n [_con, _pE, _me],\n [\n [() => AutomatedReasoningPolicyBuildStepContext, 0],\n [() => AutomatedReasoningPolicyDefinitionElement, 0],\n () => AutomatedReasoningPolicyBuildStepMessageList,\n ],\n];\nvar AutomatedReasoningPolicyBuildStepMessage = [3, n0, _ARPBSM, 0, [_m, _mT], [0, 0]];\nvar AutomatedReasoningPolicyBuildWorkflowDocument = [\n 3,\n n0,\n _ARPBWD,\n 0,\n [_do, _dCT, _dN, _dD],\n [\n [() => AutomatedReasoningPolicyBuildDocumentBlob, 0],\n 0,\n [() => AutomatedReasoningPolicyBuildDocumentName, 0],\n [() => AutomatedReasoningPolicyBuildDocumentDescription, 0],\n ],\n];\nvar AutomatedReasoningPolicyBuildWorkflowRepairContent = [\n 3,\n n0,\n _ARPBWRC,\n 0,\n [_an],\n [[() => AutomatedReasoningPolicyAnnotationList, 0]],\n];\nvar AutomatedReasoningPolicyBuildWorkflowSource = [\n 3,\n n0,\n _ARPBWS,\n 0,\n [_pD, _wC],\n [\n [() => AutomatedReasoningPolicyDefinition, 0],\n [() => AutomatedReasoningPolicyWorkflowTypeContent, 0],\n ],\n];\nvar AutomatedReasoningPolicyBuildWorkflowSummary = [\n 3,\n n0,\n _ARPBWSu,\n 0,\n [_pA, _bWI, _s, _bWT, _cA, _uA],\n [0, 0, 0, 0, 5, 5],\n];\nvar AutomatedReasoningPolicyDefinition = [\n 3,\n n0,\n _ARPDu,\n 0,\n [_ve, _typ, _ru, _vari],\n [\n 0,\n [() => AutomatedReasoningPolicyDefinitionTypeList, 0],\n [() => AutomatedReasoningPolicyDefinitionRuleList, 0],\n [() => AutomatedReasoningPolicyDefinitionVariableList, 0],\n ],\n];\nvar AutomatedReasoningPolicyDefinitionQualityReport = [\n 3,\n n0,\n _ARPDQR,\n 0,\n [_tC, _vC, _rC, _uT, _uTV, _uV, _cRo, _dRS],\n [\n 1,\n 1,\n 1,\n [() => AutomatedReasoningPolicyDefinitionTypeNameList, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeValuePairList, 0],\n [() => AutomatedReasoningPolicyDefinitionVariableNameList, 0],\n 64 | 0,\n [() => AutomatedReasoningPolicyDisjointRuleSetList, 0],\n ],\n];\nvar AutomatedReasoningPolicyDefinitionRule = [\n 3,\n n0,\n _ARPDR,\n 0,\n [_i, _ex, _aE],\n [\n 0,\n [() => AutomatedReasoningPolicyDefinitionRuleExpression, 0],\n [() => AutomatedReasoningPolicyDefinitionRuleAlternateExpression, 0],\n ],\n];\nvar AutomatedReasoningPolicyDefinitionType = [\n 3,\n n0,\n _ARPDT,\n 0,\n [_n, _d, _v],\n [\n [() => AutomatedReasoningPolicyDefinitionTypeName, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeDescription, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeValueList, 0],\n ],\n];\nvar AutomatedReasoningPolicyDefinitionTypeValue = [\n 3,\n n0,\n _ARPDTV,\n 0,\n [_va, _d],\n [0, [() => AutomatedReasoningPolicyDefinitionTypeValueDescription, 0]],\n];\nvar AutomatedReasoningPolicyDefinitionTypeValuePair = [\n 3,\n n0,\n _ARPDTVP,\n 0,\n [_tN, _vN],\n [[() => AutomatedReasoningPolicyDefinitionTypeName, 0], 0],\n];\nvar AutomatedReasoningPolicyDefinitionVariable = [\n 3,\n n0,\n _ARPDV,\n 0,\n [_n, _ty, _d],\n [\n [() => AutomatedReasoningPolicyDefinitionVariableName, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeName, 0],\n [() => AutomatedReasoningPolicyDefinitionVariableDescription, 0],\n ],\n];\nvar AutomatedReasoningPolicyDeleteRuleAnnotation = [3, n0, _ARPDRA, 0, [_rI], [0]];\nvar AutomatedReasoningPolicyDeleteRuleMutation = [3, n0, _ARPDRM, 0, [_i], [0]];\nvar AutomatedReasoningPolicyDeleteTypeAnnotation = [\n 3,\n n0,\n _ARPDTA,\n 0,\n [_n],\n [[() => AutomatedReasoningPolicyDefinitionTypeName, 0]],\n];\nvar AutomatedReasoningPolicyDeleteTypeMutation = [\n 3,\n n0,\n _ARPDTM,\n 0,\n [_n],\n [[() => AutomatedReasoningPolicyDefinitionTypeName, 0]],\n];\nvar AutomatedReasoningPolicyDeleteTypeValue = [3, n0, _ARPDTVu, 0, [_va], [0]];\nvar AutomatedReasoningPolicyDeleteVariableAnnotation = [\n 3,\n n0,\n _ARPDVA,\n 0,\n [_n],\n [[() => AutomatedReasoningPolicyDefinitionVariableName, 0]],\n];\nvar AutomatedReasoningPolicyDeleteVariableMutation = [\n 3,\n n0,\n _ARPDVM,\n 0,\n [_n],\n [[() => AutomatedReasoningPolicyDefinitionVariableName, 0]],\n];\nvar AutomatedReasoningPolicyDisjointRuleSet = [\n 3,\n n0,\n _ARPDRS,\n 0,\n [_vari, _ru],\n [[() => AutomatedReasoningPolicyDefinitionVariableNameList, 0], 64 | 0],\n];\nvar AutomatedReasoningPolicyGeneratedTestCase = [\n 3,\n n0,\n _ARPGTC,\n 0,\n [_qC, _gC, _eAFR],\n [[() => AutomatedReasoningPolicyTestQueryContent, 0], [() => AutomatedReasoningPolicyTestGuardContent, 0], 0],\n];\nvar AutomatedReasoningPolicyGeneratedTestCases = [\n 3,\n n0,\n _ARPGTCu,\n 0,\n [_gTC],\n [[() => AutomatedReasoningPolicyGeneratedTestCaseList, 0]],\n];\nvar AutomatedReasoningPolicyIngestContentAnnotation = [\n 3,\n n0,\n _ARPICA,\n 0,\n [_cont],\n [[() => AutomatedReasoningPolicyAnnotationIngestContent, 0]],\n];\nvar AutomatedReasoningPolicyPlanning = [3, n0, _ARPP, 0, [], []];\nvar AutomatedReasoningPolicyScenario = [\n 3,\n n0,\n _ARPS,\n 0,\n [_ex, _aE, _rIu, _eR],\n [\n [() => AutomatedReasoningPolicyScenarioExpression, 0],\n [() => AutomatedReasoningPolicyScenarioAlternateExpression, 0],\n 64 | 0,\n 0,\n ],\n];\nvar AutomatedReasoningPolicySummary = [\n 3,\n n0,\n _ARPSu,\n 0,\n [_pA, _n, _d, _ve, _pI, _cA, _uA],\n [0, [() => AutomatedReasoningPolicyName, 0], [() => AutomatedReasoningPolicyDescription, 0], 0, 0, 5, 5],\n];\nvar AutomatedReasoningPolicyTestCase = [\n 3,\n n0,\n _ARPTC,\n 0,\n [_tCI, _gC, _qC, _eAFR, _cA, _uA, _cT],\n [\n 0,\n [() => AutomatedReasoningPolicyTestGuardContent, 0],\n [() => AutomatedReasoningPolicyTestQueryContent, 0],\n 0,\n 5,\n 5,\n 1,\n ],\n];\nvar AutomatedReasoningPolicyTestResult = [\n 3,\n n0,\n _ARPTR,\n 0,\n [_tCe, _pA, _tRS, _tF, _tRR, _aTFR, _uA],\n [[() => AutomatedReasoningPolicyTestCase, 0], 0, 0, [() => AutomatedReasoningCheckFindingList, 0], 0, 0, 5],\n];\nvar AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation = [\n 3,\n n0,\n _ARPUFRFA,\n 0,\n [_rIu, _f],\n [64 | 0, [() => AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage, 0]],\n];\nvar AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation = [\n 3,\n n0,\n _ARPUFSFA,\n 0,\n [_rIu, _sE, _f],\n [\n 64 | 0,\n [() => AutomatedReasoningPolicyScenarioExpression, 0],\n [() => AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage, 0],\n ],\n];\nvar AutomatedReasoningPolicyUpdateRuleAnnotation = [\n 3,\n n0,\n _ARPURA,\n 0,\n [_rI, _ex],\n [0, [() => AutomatedReasoningPolicyDefinitionRuleExpression, 0]],\n];\nvar AutomatedReasoningPolicyUpdateRuleMutation = [\n 3,\n n0,\n _ARPURM,\n 0,\n [_r],\n [[() => AutomatedReasoningPolicyDefinitionRule, 0]],\n];\nvar AutomatedReasoningPolicyUpdateTypeAnnotation = [\n 3,\n n0,\n _ARPUTA,\n 0,\n [_n, _nN, _d, _v],\n [\n [() => AutomatedReasoningPolicyDefinitionTypeName, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeName, 0],\n [() => AutomatedReasoningPolicyDefinitionTypeDescription, 0],\n [() => AutomatedReasoningPolicyTypeValueAnnotationList, 0],\n ],\n];\nvar AutomatedReasoningPolicyUpdateTypeMutation = [\n 3,\n n0,\n _ARPUTM,\n 0,\n [_ty],\n [[() => AutomatedReasoningPolicyDefinitionType, 0]],\n];\nvar AutomatedReasoningPolicyUpdateTypeValue = [\n 3,\n n0,\n _ARPUTV,\n 0,\n [_va, _nV, _d],\n [0, 0, [() => AutomatedReasoningPolicyDefinitionTypeValueDescription, 0]],\n];\nvar AutomatedReasoningPolicyUpdateVariableAnnotation = [\n 3,\n n0,\n _ARPUVA,\n 0,\n [_n, _nN, _d],\n [\n [() => AutomatedReasoningPolicyDefinitionVariableName, 0],\n [() => AutomatedReasoningPolicyDefinitionVariableName, 0],\n [() => AutomatedReasoningPolicyDefinitionVariableDescription, 0],\n ],\n];\nvar AutomatedReasoningPolicyUpdateVariableMutation = [\n 3,\n n0,\n _ARPUVM,\n 0,\n [_var],\n [[() => AutomatedReasoningPolicyDefinitionVariable, 0]],\n];\nvar BatchDeleteEvaluationJobError = [\n 3,\n n0,\n _BDEJE,\n 0,\n [_jI, _cod, _m],\n [[() => EvaluationJobIdentifier, 0], 0, 0],\n];\nvar BatchDeleteEvaluationJobItem = [\n 3,\n n0,\n _BDEJI,\n 0,\n [_jI, _jS],\n [[() => EvaluationJobIdentifier, 0], 0],\n];\nvar BatchDeleteEvaluationJobRequest = [\n 3,\n n0,\n _BDEJR,\n 0,\n [_jIo],\n [[() => EvaluationJobIdentifiers, 0]],\n];\nvar BatchDeleteEvaluationJobResponse = [\n 3,\n n0,\n _BDEJRa,\n 0,\n [_er, _eJ],\n [\n [() => BatchDeleteEvaluationJobErrors, 0],\n [() => BatchDeleteEvaluationJobItems, 0],\n ],\n];\nvar BedrockEvaluatorModel = [3, n0, _BEM, 0, [_mI], [0]];\nvar ByteContentDoc = [\n 3,\n n0,\n _BCD,\n 0,\n [_id, _cTo, _da],\n [[() => Identifier, 0], 0, [() => ByteContentBlob, 0]],\n];\nvar CancelAutomatedReasoningPolicyBuildWorkflowRequest = [\n 3,\n n0,\n _CARPBWR,\n 0,\n [_pA, _bWI],\n [\n [0, 1],\n [0, 1],\n ],\n];\nvar CancelAutomatedReasoningPolicyBuildWorkflowResponse = [3, n0, _CARPBWRa, 0, [], []];\nvar CloudWatchConfig = [3, n0, _CWC, 0, [_lGN, _rA, _lDDSC], [0, 0, () => S3Config]];\nvar ConflictException = [\n -3,\n n0,\n _CE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ConflictException, ConflictException$1);\nvar CreateAutomatedReasoningPolicyRequest = [\n 3,\n n0,\n _CARPR,\n 0,\n [_n, _d, _cRT, _pD, _kKI, _ta],\n [\n [() => AutomatedReasoningPolicyName, 0],\n [() => AutomatedReasoningPolicyDescription, 0],\n [0, 4],\n [() => AutomatedReasoningPolicyDefinition, 0],\n 0,\n () => TagList,\n ],\n];\nvar CreateAutomatedReasoningPolicyResponse = [\n 3,\n n0,\n _CARPRr,\n 0,\n [_pA, _ve, _n, _d, _dH, _cA, _uA],\n [0, 0, [() => AutomatedReasoningPolicyName, 0], [() => AutomatedReasoningPolicyDescription, 0], 0, 5, 5],\n];\nvar CreateAutomatedReasoningPolicyTestCaseRequest = [\n 3,\n n0,\n _CARPTCR,\n 0,\n [_pA, _gC, _qC, _eAFR, _cRT, _cT],\n [\n [0, 1],\n [() => AutomatedReasoningPolicyTestGuardContent, 0],\n [() => AutomatedReasoningPolicyTestQueryContent, 0],\n 0,\n [0, 4],\n 1,\n ],\n];\nvar CreateAutomatedReasoningPolicyTestCaseResponse = [\n 3,\n n0,\n _CARPTCRr,\n 0,\n [_pA, _tCI],\n [0, 0],\n];\nvar CreateAutomatedReasoningPolicyVersionRequest = [\n 3,\n n0,\n _CARPVR,\n 0,\n [_pA, _cRT, _lUDH, _ta],\n [[0, 1], [0, 4], 0, () => TagList],\n];\nvar CreateAutomatedReasoningPolicyVersionResponse = [\n 3,\n n0,\n _CARPVRr,\n 0,\n [_pA, _ve, _n, _d, _dH, _cA],\n [0, 0, [() => AutomatedReasoningPolicyName, 0], [() => AutomatedReasoningPolicyDescription, 0], 0, 5],\n];\nvar CreateCustomModelDeploymentRequest = [\n 3,\n n0,\n _CCMDR,\n 0,\n [_mDN, _mA, _d, _ta, _cRT],\n [0, 0, 0, () => TagList, [0, 4]],\n];\nvar CreateCustomModelDeploymentResponse = [3, n0, _CCMDRr, 0, [_cMDA], [0]];\nvar CreateCustomModelRequest = [\n 3,\n n0,\n _CCMR,\n 0,\n [_mN, _mSC, _mKKA, _rA, _mTo, _cRT],\n [0, () => ModelDataSource, 0, 0, () => TagList, [0, 4]],\n];\nvar CreateCustomModelResponse = [3, n0, _CCMRr, 0, [_mA], [0]];\nvar CreateEvaluationJobRequest = [\n 3,\n n0,\n _CEJR,\n 0,\n [_jN, _jD, _cRT, _rA, _cEKI, _jT, _aT, _eC, _iC, _oDC],\n [\n 0,\n [() => EvaluationJobDescription, 0],\n [0, 4],\n 0,\n 0,\n () => TagList,\n 0,\n [() => EvaluationConfig, 0],\n [() => EvaluationInferenceConfig, 0],\n () => EvaluationOutputDataConfig,\n ],\n];\nvar CreateEvaluationJobResponse = [3, n0, _CEJRr, 0, [_jA], [0]];\nvar CreateFoundationModelAgreementRequest = [3, n0, _CFMAR, 0, [_oT, _mIo], [0, 0]];\nvar CreateFoundationModelAgreementResponse = [3, n0, _CFMARr, 0, [_mIo], [0]];\nvar CreateGuardrailRequest = [\n 3,\n n0,\n _CGR,\n 0,\n [_n, _d, _tPC, _cPC, _wPC, _sIPC, _cGPC, _aRPC, _cRC, _bIM, _bOM, _kKI, _ta, _cRT],\n [\n [() => GuardrailName, 0],\n [() => GuardrailDescription, 0],\n [() => GuardrailTopicPolicyConfig, 0],\n [() => GuardrailContentPolicyConfig, 0],\n [() => GuardrailWordPolicyConfig, 0],\n () => GuardrailSensitiveInformationPolicyConfig,\n [() => GuardrailContextualGroundingPolicyConfig, 0],\n () => GuardrailAutomatedReasoningPolicyConfig,\n () => GuardrailCrossRegionConfig,\n [() => GuardrailBlockedMessaging, 0],\n [() => GuardrailBlockedMessaging, 0],\n 0,\n () => TagList,\n [0, 4],\n ],\n];\nvar CreateGuardrailResponse = [3, n0, _CGRr, 0, [_gI, _gA, _ve, _cA], [0, 0, 0, 5]];\nvar CreateGuardrailVersionRequest = [\n 3,\n n0,\n _CGVR,\n 0,\n [_gIu, _d, _cRT],\n [\n [0, 1],\n [() => GuardrailDescription, 0],\n [0, 4],\n ],\n];\nvar CreateGuardrailVersionResponse = [3, n0, _CGVRr, 0, [_gI, _ve], [0, 0]];\nvar CreateInferenceProfileRequest = [\n 3,\n n0,\n _CIPR,\n 0,\n [_iPN, _d, _cRT, _mS, _ta],\n [0, [() => InferenceProfileDescription, 0], [0, 4], () => InferenceProfileModelSource, () => TagList],\n];\nvar CreateInferenceProfileResponse = [3, n0, _CIPRr, 0, [_iPA, _s], [0, 0]];\nvar CreateMarketplaceModelEndpointRequest = [\n 3,\n n0,\n _CMMER,\n 0,\n [_mSI, _eCn, _aEc, _eN, _cRT, _ta],\n [0, () => EndpointConfig, 2, 0, [0, 4], () => TagList],\n];\nvar CreateMarketplaceModelEndpointResponse = [\n 3,\n n0,\n _CMMERr,\n 0,\n [_mME],\n [() => MarketplaceModelEndpoint],\n];\nvar CreateModelCopyJobRequest = [\n 3,\n n0,\n _CMCJR,\n 0,\n [_sMA, _tMN, _mKKI, _tMT, _cRT],\n [0, 0, 0, () => TagList, [0, 4]],\n];\nvar CreateModelCopyJobResponse = [3, n0, _CMCJRr, 0, [_jA], [0]];\nvar CreateModelCustomizationJobRequest = [\n 3,\n n0,\n _CMCJRre,\n 0,\n [_jN, _cMN, _rA, _cRT, _bMI, _cTu, _cMKKI, _jT, _cMT, _tDC, _vDC, _oDC, _hP, _vCp, _cC],\n [\n 0,\n 0,\n 0,\n [0, 4],\n 0,\n 0,\n 0,\n () => TagList,\n () => TagList,\n [() => TrainingDataConfig, 0],\n () => ValidationDataConfig,\n () => OutputDataConfig,\n 128 | 0,\n () => VpcConfig,\n () => CustomizationConfig,\n ],\n];\nvar CreateModelCustomizationJobResponse = [3, n0, _CMCJRrea, 0, [_jA], [0]];\nvar CreateModelImportJobRequest = [\n 3,\n n0,\n _CMIJR,\n 0,\n [_jN, _iMN, _rA, _mDS, _jT, _iMT, _cRT, _vCp, _iMKKI],\n [0, 0, 0, () => ModelDataSource, () => TagList, () => TagList, 0, () => VpcConfig, 0],\n];\nvar CreateModelImportJobResponse = [3, n0, _CMIJRr, 0, [_jA], [0]];\nvar CreateModelInvocationJobRequest = [\n 3,\n n0,\n _CMIJRre,\n 0,\n [_jN, _rA, _cRT, _mIo, _iDC, _oDC, _vCp, _tDIH, _ta],\n [\n 0,\n 0,\n [0, 4],\n 0,\n () => ModelInvocationJobInputDataConfig,\n () => ModelInvocationJobOutputDataConfig,\n () => VpcConfig,\n 1,\n () => TagList,\n ],\n];\nvar CreateModelInvocationJobResponse = [3, n0, _CMIJRrea, 0, [_jA], [0]];\nvar CreatePromptRouterRequest = [\n 3,\n n0,\n _CPRR,\n 0,\n [_cRT, _pRN, _mo, _d, _rCo, _fM, _ta],\n [\n [0, 4],\n 0,\n () => PromptRouterTargetModels,\n [() => PromptRouterDescription, 0],\n () => RoutingCriteria,\n () => PromptRouterTargetModel,\n () => TagList,\n ],\n];\nvar CreatePromptRouterResponse = [3, n0, _CPRRr, 0, [_pRA], [0]];\nvar CreateProvisionedModelThroughputRequest = [\n 3,\n n0,\n _CPMTR,\n 0,\n [_cRT, _mU, _pMN, _mIo, _cD, _ta],\n [[0, 4], 1, 0, 0, 0, () => TagList],\n];\nvar CreateProvisionedModelThroughputResponse = [3, n0, _CPMTRr, 0, [_pMA], [0]];\nvar CustomMetricBedrockEvaluatorModel = [3, n0, _CMBEM, 0, [_mI], [0]];\nvar CustomMetricDefinition = [\n 3,\n n0,\n _CMD,\n 8,\n [_n, _in, _rS],\n [[() => MetricName, 0], 0, () => RatingScale],\n];\nvar CustomMetricEvaluatorModelConfig = [\n 3,\n n0,\n _CMEMC,\n 0,\n [_bEM],\n [() => CustomMetricBedrockEvaluatorModels],\n];\nvar CustomModelDeploymentSummary = [\n 3,\n n0,\n _CMDS,\n 0,\n [_cMDA, _cMDN, _mA, _cA, _s, _lUA, _fMa],\n [0, 0, 0, 5, 0, 5, 0],\n];\nvar CustomModelSummary = [\n 3,\n n0,\n _CMS,\n 0,\n [_mA, _mN, _cTr, _bMA, _bMN, _cTu, _oAI, _mSo],\n [0, 0, 5, 0, 0, 0, 0, 0],\n];\nvar CustomModelUnits = [3, n0, _CMU, 0, [_cMUPMC, _cMUV], [1, 0]];\nvar DataProcessingDetails = [3, n0, _DPD, 0, [_s, _cTr, _lMT], [0, 5, 5]];\nvar DeleteAutomatedReasoningPolicyBuildWorkflowRequest = [\n 3,\n n0,\n _DARPBWR,\n 0,\n [_pA, _bWI, _lUA],\n [\n [0, 1],\n [0, 1],\n [\n 5,\n {\n [_hQ]: _uA,\n },\n ],\n ],\n];\nvar DeleteAutomatedReasoningPolicyBuildWorkflowResponse = [3, n0, _DARPBWRe, 0, [], []];\nvar DeleteAutomatedReasoningPolicyRequest = [\n 3,\n n0,\n _DARPR,\n 0,\n [_pA, _fo],\n [\n [0, 1],\n [\n 2,\n {\n [_hQ]: _fo,\n },\n ],\n ],\n];\nvar DeleteAutomatedReasoningPolicyResponse = [3, n0, _DARPRe, 0, [], []];\nvar DeleteAutomatedReasoningPolicyTestCaseRequest = [\n 3,\n n0,\n _DARPTCR,\n 0,\n [_pA, _tCI, _lUA],\n [\n [0, 1],\n [0, 1],\n [\n 5,\n {\n [_hQ]: _uA,\n },\n ],\n ],\n];\nvar DeleteAutomatedReasoningPolicyTestCaseResponse = [3, n0, _DARPTCRe, 0, [], []];\nvar DeleteCustomModelDeploymentRequest = [3, n0, _DCMDR, 0, [_cMDI], [[0, 1]]];\nvar DeleteCustomModelDeploymentResponse = [3, n0, _DCMDRe, 0, [], []];\nvar DeleteCustomModelRequest = [3, n0, _DCMR, 0, [_mI], [[0, 1]]];\nvar DeleteCustomModelResponse = [3, n0, _DCMRe, 0, [], []];\nvar DeleteFoundationModelAgreementRequest = [3, n0, _DFMAR, 0, [_mIo], [0]];\nvar DeleteFoundationModelAgreementResponse = [3, n0, _DFMARe, 0, [], []];\nvar DeleteGuardrailRequest = [\n 3,\n n0,\n _DGR,\n 0,\n [_gIu, _gV],\n [\n [0, 1],\n [\n 0,\n {\n [_hQ]: _gV,\n },\n ],\n ],\n];\nvar DeleteGuardrailResponse = [3, n0, _DGRe, 0, [], []];\nvar DeleteImportedModelRequest = [3, n0, _DIMR, 0, [_mI], [[0, 1]]];\nvar DeleteImportedModelResponse = [3, n0, _DIMRe, 0, [], []];\nvar DeleteInferenceProfileRequest = [3, n0, _DIPR, 0, [_iPI], [[0, 1]]];\nvar DeleteInferenceProfileResponse = [3, n0, _DIPRe, 0, [], []];\nvar DeleteMarketplaceModelEndpointRequest = [3, n0, _DMMER, 0, [_eA], [[0, 1]]];\nvar DeleteMarketplaceModelEndpointResponse = [3, n0, _DMMERe, 0, [], []];\nvar DeleteModelInvocationLoggingConfigurationRequest = [3, n0, _DMILCR, 0, [], []];\nvar DeleteModelInvocationLoggingConfigurationResponse = [3, n0, _DMILCRe, 0, [], []];\nvar DeletePromptRouterRequest = [3, n0, _DPRR, 0, [_pRA], [[0, 1]]];\nvar DeletePromptRouterResponse = [3, n0, _DPRRe, 0, [], []];\nvar DeleteProvisionedModelThroughputRequest = [3, n0, _DPMTR, 0, [_pMI], [[0, 1]]];\nvar DeleteProvisionedModelThroughputResponse = [3, n0, _DPMTRe, 0, [], []];\nvar DeregisterMarketplaceModelEndpointRequest = [3, n0, _DMMERer, 0, [_eA], [[0, 1]]];\nvar DeregisterMarketplaceModelEndpointResponse = [3, n0, _DMMERere, 0, [], []];\nvar DimensionalPriceRate = [3, n0, _DPR, 0, [_di, _pr, _d, _u], [0, 0, 0, 0]];\nvar DistillationConfig = [3, n0, _DC, 0, [_tMC], [() => TeacherModelConfig]];\nvar EvaluationBedrockModel = [\n 3,\n n0,\n _EBM,\n 0,\n [_mI, _iP, _pC],\n [0, [() => EvaluationModelInferenceParams, 0], () => PerformanceConfiguration],\n];\nvar EvaluationDataset = [\n 3,\n n0,\n _ED,\n 0,\n [_n, _dL],\n [[() => EvaluationDatasetName, 0], () => EvaluationDatasetLocation],\n];\nvar EvaluationDatasetMetricConfig = [\n 3,\n n0,\n _EDMC,\n 0,\n [_tT, _dat, _mNe],\n [0, [() => EvaluationDataset, 0], [() => EvaluationMetricNames, 0]],\n];\nvar EvaluationInferenceConfigSummary = [\n 3,\n n0,\n _EICS,\n 0,\n [_mCS, _rCS],\n [() => EvaluationModelConfigSummary, () => EvaluationRagConfigSummary],\n];\nvar EvaluationModelConfigSummary = [3, n0, _EMCS, 0, [_bMIe, _pISI], [64 | 0, 64 | 0]];\nvar EvaluationOutputDataConfig = [3, n0, _EODC, 0, [_sU], [0]];\nvar EvaluationPrecomputedInferenceSource = [3, n0, _EPIS, 0, [_iSI], [0]];\nvar EvaluationPrecomputedRetrieveAndGenerateSourceConfig = [\n 3,\n n0,\n _EPRAGSC,\n 0,\n [_rSI],\n [0],\n];\nvar EvaluationPrecomputedRetrieveSourceConfig = [3, n0, _EPRSC, 0, [_rSI], [0]];\nvar EvaluationRagConfigSummary = [3, n0, _ERCS, 0, [_bKBI, _pRSI], [64 | 0, 64 | 0]];\nvar EvaluationSummary = [\n 3,\n n0,\n _ES,\n 0,\n [_jA, _jN, _s, _cTr, _jTo, _eTT, _mIod, _rIa, _eMI, _cMEMI, _iCS, _aT],\n [0, 0, 0, 5, 0, 64 | 0, 64 | 0, 64 | 0, 64 | 0, 64 | 0, () => EvaluationInferenceConfigSummary, 0],\n];\nvar ExportAutomatedReasoningPolicyVersionRequest = [3, n0, _EARPVR, 0, [_pA], [[0, 1]]];\nvar ExportAutomatedReasoningPolicyVersionResponse = [\n 3,\n n0,\n _EARPVRx,\n 0,\n [_pD],\n [[() => AutomatedReasoningPolicyDefinition, 16]],\n];\nvar ExternalSource = [\n 3,\n n0,\n _ESx,\n 0,\n [_sT, _sL, _bC],\n [0, () => S3ObjectDoc, [() => ByteContentDoc, 0]],\n];\nvar ExternalSourcesGenerationConfiguration = [\n 3,\n n0,\n _ESGC,\n 0,\n [_pT, _gCu, _kIC, _aMRF],\n [[() => PromptTemplate, 0], () => GuardrailConfiguration, () => KbInferenceConfig, 128 | 15],\n];\nvar ExternalSourcesRetrieveAndGenerateConfiguration = [\n 3,\n n0,\n _ESRAGC,\n 0,\n [_mA, _so, _gCe],\n [0, [() => ExternalSources, 0], [() => ExternalSourcesGenerationConfiguration, 0]],\n];\nvar FieldForReranking = [3, n0, _FFR, 0, [_fN], [0]];\nvar FilterAttribute = [3, n0, _FA, 0, [_k, _va], [0, 15]];\nvar FoundationModelDetails = [\n 3,\n n0,\n _FMD,\n 0,\n [_mA, _mIo, _mN, _pN, _iM, _oM, _rSS, _cS, _iTS, _mL],\n [0, 0, 0, 0, 64 | 0, 64 | 0, 2, 64 | 0, 64 | 0, () => FoundationModelLifecycle],\n];\nvar FoundationModelLifecycle = [3, n0, _FML, 0, [_s], [0]];\nvar FoundationModelSummary = [\n 3,\n n0,\n _FMS,\n 0,\n [_mA, _mIo, _mN, _pN, _iM, _oM, _rSS, _cS, _iTS, _mL],\n [0, 0, 0, 0, 64 | 0, 64 | 0, 2, 64 | 0, 64 | 0, () => FoundationModelLifecycle],\n];\nvar GenerationConfiguration = [\n 3,\n n0,\n _GC,\n 0,\n [_pT, _gCu, _kIC, _aMRF],\n [[() => PromptTemplate, 0], () => GuardrailConfiguration, () => KbInferenceConfig, 128 | 15],\n];\nvar GetAutomatedReasoningPolicyAnnotationsRequest = [\n 3,\n n0,\n _GARPAR,\n 0,\n [_pA, _bWI],\n [\n [0, 1],\n [0, 1],\n ],\n];\nvar GetAutomatedReasoningPolicyAnnotationsResponse = [\n 3,\n n0,\n _GARPARe,\n 0,\n [_pA, _n, _bWI, _an, _aSH, _uA],\n [0, [() => AutomatedReasoningPolicyName, 0], 0, [() => AutomatedReasoningPolicyAnnotationList, 0], 0, 5],\n];\nvar GetAutomatedReasoningPolicyBuildWorkflowRequest = [\n 3,\n n0,\n _GARPBWR,\n 0,\n [_pA, _bWI],\n [\n [0, 1],\n [0, 1],\n ],\n];\nvar GetAutomatedReasoningPolicyBuildWorkflowResponse = [\n 3,\n n0,\n _GARPBWRe,\n 0,\n [_pA, _bWI, _s, _bWT, _dN, _dCT, _dD, _cA, _uA],\n [\n 0,\n 0,\n 0,\n 0,\n [() => AutomatedReasoningPolicyBuildDocumentName, 0],\n 0,\n [() => AutomatedReasoningPolicyBuildDocumentDescription, 0],\n 5,\n 5,\n ],\n];\nvar GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest = [\n 3,\n n0,\n _GARPBWRAR,\n 0,\n [_pA, _bWI, _aTs],\n [\n [0, 1],\n [0, 1],\n [\n 0,\n {\n [_hQ]: _aTs,\n },\n ],\n ],\n];\nvar GetAutomatedReasoningPolicyBuildWorkflowResultAssetsResponse = [\n 3,\n n0,\n _GARPBWRARe,\n 0,\n [_pA, _bWI, _bWA],\n [0, 0, [() => AutomatedReasoningPolicyBuildResultAssets, 0]],\n];\nvar GetAutomatedReasoningPolicyNextScenarioRequest = [\n 3,\n n0,\n _GARPNSR,\n 0,\n [_pA, _bWI],\n [\n [0, 1],\n [0, 1],\n ],\n];\nvar GetAutomatedReasoningPolicyNextScenarioResponse = [\n 3,\n n0,\n _GARPNSRe,\n 0,\n [_pA, _sc],\n [0, [() => AutomatedReasoningPolicyScenario, 0]],\n];\nvar GetAutomatedReasoningPolicyRequest = [3, n0, _GARPR, 0, [_pA], [[0, 1]]];\nvar GetAutomatedReasoningPolicyResponse = [\n 3,\n n0,\n _GARPRe,\n 0,\n [_pA, _n, _ve, _pI, _d, _dH, _kKA, _cA, _uA],\n [0, [() => AutomatedReasoningPolicyName, 0], 0, 0, [() => AutomatedReasoningPolicyDescription, 0], 0, 0, 5, 5],\n];\nvar GetAutomatedReasoningPolicyTestCaseRequest = [\n 3,\n n0,\n _GARPTCR,\n 0,\n [_pA, _tCI],\n [\n [0, 1],\n [0, 1],\n ],\n];\nvar GetAutomatedReasoningPolicyTestCaseResponse = [\n 3,\n n0,\n _GARPTCRe,\n 0,\n [_pA, _tCe],\n [0, [() => AutomatedReasoningPolicyTestCase, 0]],\n];\nvar GetAutomatedReasoningPolicyTestResultRequest = [\n 3,\n n0,\n _GARPTRR,\n 0,\n [_pA, _bWI, _tCI],\n [\n [0, 1],\n [0, 1],\n [0, 1],\n ],\n];\nvar GetAutomatedReasoningPolicyTestResultResponse = [\n 3,\n n0,\n _GARPTRRe,\n 0,\n [_tR],\n [[() => AutomatedReasoningPolicyTestResult, 0]],\n];\nvar GetCustomModelDeploymentRequest = [3, n0, _GCMDR, 0, [_cMDI], [[0, 1]]];\nvar GetCustomModelDeploymentResponse = [\n 3,\n n0,\n _GCMDRe,\n 0,\n [_cMDA, _mDN, _mA, _cA, _s, _d, _fMa, _lUA],\n [0, 0, 0, 5, 0, 0, 0, 5],\n];\nvar GetCustomModelRequest = [3, n0, _GCMR, 0, [_mI], [[0, 1]]];\nvar GetCustomModelResponse = [\n 3,\n n0,\n _GCMRe,\n 0,\n [_mA, _mN, _jN, _jA, _bMA, _cTu, _mKKA, _hP, _tDC, _vDC, _oDC, _tM, _vM, _cTr, _cC, _mSo, _fMa],\n [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 128 | 0,\n [() => TrainingDataConfig, 0],\n () => ValidationDataConfig,\n () => OutputDataConfig,\n () => TrainingMetrics,\n () => ValidationMetrics,\n 5,\n () => CustomizationConfig,\n 0,\n 0,\n ],\n];\nvar GetEvaluationJobRequest = [\n 3,\n n0,\n _GEJR,\n 0,\n [_jI],\n [[() => EvaluationJobIdentifier, 1]],\n];\nvar GetEvaluationJobResponse = [\n 3,\n n0,\n _GEJRe,\n 0,\n [_jN, _s, _jA, _jD, _rA, _cEKI, _jTo, _aT, _eC, _iC, _oDC, _cTr, _lMT, _fMai],\n [\n 0,\n 0,\n 0,\n [() => EvaluationJobDescription, 0],\n 0,\n 0,\n 0,\n 0,\n [() => EvaluationConfig, 0],\n [() => EvaluationInferenceConfig, 0],\n () => EvaluationOutputDataConfig,\n 5,\n 5,\n 64 | 0,\n ],\n];\nvar GetFoundationModelAvailabilityRequest = [3, n0, _GFMAR, 0, [_mIo], [[0, 1]]];\nvar GetFoundationModelAvailabilityResponse = [\n 3,\n n0,\n _GFMARe,\n 0,\n [_mIo, _aA, _aS, _eAn, _rAe],\n [0, () => AgreementAvailability, 0, 0, 0],\n];\nvar GetFoundationModelRequest = [3, n0, _GFMR, 0, [_mI], [[0, 1]]];\nvar GetFoundationModelResponse = [\n 3,\n n0,\n _GFMRe,\n 0,\n [_mD],\n [() => FoundationModelDetails],\n];\nvar GetGuardrailRequest = [\n 3,\n n0,\n _GGR,\n 0,\n [_gIu, _gV],\n [\n [0, 1],\n [\n 0,\n {\n [_hQ]: _gV,\n },\n ],\n ],\n];\nvar GetGuardrailResponse = [\n 3,\n n0,\n _GGRe,\n 0,\n [_n, _d, _gI, _gA, _ve, _s, _tP, _cP, _wP, _sIP, _cGP, _aRP, _cRD, _cA, _uA, _sRt, _fR, _bIM, _bOM, _kKA],\n [\n [() => GuardrailName, 0],\n [() => GuardrailDescription, 0],\n 0,\n 0,\n 0,\n 0,\n [() => GuardrailTopicPolicy, 0],\n [() => GuardrailContentPolicy, 0],\n [() => GuardrailWordPolicy, 0],\n () => GuardrailSensitiveInformationPolicy,\n [() => GuardrailContextualGroundingPolicy, 0],\n () => GuardrailAutomatedReasoningPolicy,\n () => GuardrailCrossRegionDetails,\n 5,\n 5,\n [() => GuardrailStatusReasons, 0],\n [() => GuardrailFailureRecommendations, 0],\n [() => GuardrailBlockedMessaging, 0],\n [() => GuardrailBlockedMessaging, 0],\n 0,\n ],\n];\nvar GetImportedModelRequest = [3, n0, _GIMR, 0, [_mI], [[0, 1]]];\nvar GetImportedModelResponse = [\n 3,\n n0,\n _GIMRe,\n 0,\n [_mA, _mN, _jN, _jA, _mDS, _cTr, _mAo, _mKKA, _iS, _cMU],\n [0, 0, 0, 0, () => ModelDataSource, 5, 0, 0, 2, () => CustomModelUnits],\n];\nvar GetInferenceProfileRequest = [3, n0, _GIPR, 0, [_iPI], [[0, 1]]];\nvar GetInferenceProfileResponse = [\n 3,\n n0,\n _GIPRe,\n 0,\n [_iPN, _d, _cA, _uA, _iPA, _mo, _iPIn, _s, _ty],\n [0, [() => InferenceProfileDescription, 0], 5, 5, 0, () => InferenceProfileModels, 0, 0, 0],\n];\nvar GetMarketplaceModelEndpointRequest = [3, n0, _GMMER, 0, [_eA], [[0, 1]]];\nvar GetMarketplaceModelEndpointResponse = [\n 3,\n n0,\n _GMMERe,\n 0,\n [_mME],\n [() => MarketplaceModelEndpoint],\n];\nvar GetModelCopyJobRequest = [3, n0, _GMCJR, 0, [_jA], [[0, 1]]];\nvar GetModelCopyJobResponse = [\n 3,\n n0,\n _GMCJRe,\n 0,\n [_jA, _s, _cTr, _tMA, _tMN, _sAI, _sMA, _tMKKA, _tMT, _fMa, _sMN],\n [0, 0, 5, 0, 0, 0, 0, 0, () => TagList, 0, 0],\n];\nvar GetModelCustomizationJobRequest = [3, n0, _GMCJRet, 0, [_jI], [[0, 1]]];\nvar GetModelCustomizationJobResponse = [\n 3,\n n0,\n _GMCJReto,\n 0,\n [\n _jA,\n _jN,\n _oMN,\n _oMA,\n _cRT,\n _rA,\n _s,\n _sD,\n _fMa,\n _cTr,\n _lMT,\n _eT,\n _bMA,\n _hP,\n _tDC,\n _vDC,\n _oDC,\n _cTu,\n _oMKKA,\n _tM,\n _vM,\n _vCp,\n _cC,\n ],\n [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n () => StatusDetails,\n 0,\n 5,\n 5,\n 5,\n 0,\n 128 | 0,\n [() => TrainingDataConfig, 0],\n () => ValidationDataConfig,\n () => OutputDataConfig,\n 0,\n 0,\n () => TrainingMetrics,\n () => ValidationMetrics,\n () => VpcConfig,\n () => CustomizationConfig,\n ],\n];\nvar GetModelImportJobRequest = [3, n0, _GMIJR, 0, [_jI], [[0, 1]]];\nvar GetModelImportJobResponse = [\n 3,\n n0,\n _GMIJRe,\n 0,\n [_jA, _jN, _iMN, _iMA, _rA, _mDS, _s, _fMa, _cTr, _lMT, _eT, _vCp, _iMKKA],\n [0, 0, 0, 0, 0, () => ModelDataSource, 0, 0, 5, 5, 5, () => VpcConfig, 0],\n];\nvar GetModelInvocationJobRequest = [3, n0, _GMIJRet, 0, [_jI], [[0, 1]]];\nvar GetModelInvocationJobResponse = [\n 3,\n n0,\n _GMIJReto,\n 0,\n [_jA, _jN, _mIo, _cRT, _rA, _s, _m, _sTu, _lMT, _eT, _iDC, _oDC, _vCp, _tDIH, _jET],\n [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n [() => Message, 0],\n 5,\n 5,\n 5,\n () => ModelInvocationJobInputDataConfig,\n () => ModelInvocationJobOutputDataConfig,\n () => VpcConfig,\n 1,\n 5,\n ],\n];\nvar GetModelInvocationLoggingConfigurationRequest = [3, n0, _GMILCR, 0, [], []];\nvar GetModelInvocationLoggingConfigurationResponse = [\n 3,\n n0,\n _GMILCRe,\n 0,\n [_lC],\n [() => LoggingConfig],\n];\nvar GetPromptRouterRequest = [3, n0, _GPRR, 0, [_pRA], [[0, 1]]];\nvar GetPromptRouterResponse = [\n 3,\n n0,\n _GPRRe,\n 0,\n [_pRN, _rCo, _d, _cA, _uA, _pRA, _mo, _fM, _s, _ty],\n [\n 0,\n () => RoutingCriteria,\n [() => PromptRouterDescription, 0],\n 5,\n 5,\n 0,\n () => PromptRouterTargetModels,\n () => PromptRouterTargetModel,\n 0,\n 0,\n ],\n];\nvar GetProvisionedModelThroughputRequest = [3, n0, _GPMTR, 0, [_pMI], [[0, 1]]];\nvar GetProvisionedModelThroughputResponse = [\n 3,\n n0,\n _GPMTRe,\n 0,\n [_mU, _dMU, _pMN, _pMA, _mA, _dMA, _fMA, _s, _cTr, _lMT, _fMa, _cD, _cET],\n [1, 1, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 5],\n];\nvar GetUseCaseForModelAccessRequest = [3, n0, _GUCFMAR, 0, [], []];\nvar GetUseCaseForModelAccessResponse = [3, n0, _GUCFMARe, 0, [_fD], [21]];\nvar GuardrailAutomatedReasoningPolicy = [3, n0, _GARP, 0, [_po, _cT], [64 | 0, 1]];\nvar GuardrailAutomatedReasoningPolicyConfig = [3, n0, _GARPC, 0, [_po, _cT], [64 | 0, 1]];\nvar GuardrailConfiguration = [3, n0, _GCu, 0, [_gI, _gV], [0, 0]];\nvar GuardrailContentFilter = [\n 3,\n n0,\n _GCF,\n 0,\n [_ty, _iSn, _oS, _iM, _oM, _iA, _oA, _iE, _oE],\n [\n 0,\n 0,\n 0,\n [() => GuardrailModalities, 0],\n [() => GuardrailModalities, 0],\n [() => GuardrailContentFilterAction$1, 0],\n [() => GuardrailContentFilterAction$1, 0],\n 2,\n 2,\n ],\n];\nvar GuardrailContentFilterConfig = [\n 3,\n n0,\n _GCFC,\n 0,\n [_ty, _iSn, _oS, _iM, _oM, _iA, _oA, _iE, _oE],\n [\n 0,\n 0,\n 0,\n [() => GuardrailModalities, 0],\n [() => GuardrailModalities, 0],\n [() => GuardrailContentFilterAction$1, 0],\n [() => GuardrailContentFilterAction$1, 0],\n 2,\n 2,\n ],\n];\nvar GuardrailContentFiltersTier = [\n 3,\n n0,\n _GCFT,\n 0,\n [_tNi],\n [[() => GuardrailContentFiltersTierName$1, 0]],\n];\nvar GuardrailContentFiltersTierConfig = [\n 3,\n n0,\n _GCFTC,\n 0,\n [_tNi],\n [[() => GuardrailContentFiltersTierName$1, 0]],\n];\nvar GuardrailContentPolicy = [\n 3,\n n0,\n _GCP,\n 0,\n [_fi, _ti],\n [\n [() => GuardrailContentFilters, 0],\n [() => GuardrailContentFiltersTier, 0],\n ],\n];\nvar GuardrailContentPolicyConfig = [\n 3,\n n0,\n _GCPC,\n 0,\n [_fC, _tCi],\n [\n [() => GuardrailContentFiltersConfig, 0],\n [() => GuardrailContentFiltersTierConfig, 0],\n ],\n];\nvar GuardrailContextualGroundingFilter = [\n 3,\n n0,\n _GCGF,\n 0,\n [_ty, _th, _ac, _ena],\n [0, 1, [() => GuardrailContextualGroundingAction$1, 0], 2],\n];\nvar GuardrailContextualGroundingFilterConfig = [\n 3,\n n0,\n _GCGFC,\n 0,\n [_ty, _th, _ac, _ena],\n [0, 1, [() => GuardrailContextualGroundingAction$1, 0], 2],\n];\nvar GuardrailContextualGroundingPolicy = [\n 3,\n n0,\n _GCGP,\n 0,\n [_fi],\n [[() => GuardrailContextualGroundingFilters, 0]],\n];\nvar GuardrailContextualGroundingPolicyConfig = [\n 3,\n n0,\n _GCGPC,\n 0,\n [_fC],\n [[() => GuardrailContextualGroundingFiltersConfig, 0]],\n];\nvar GuardrailCrossRegionConfig = [3, n0, _GCRC, 0, [_gPI], [0]];\nvar GuardrailCrossRegionDetails = [3, n0, _GCRD, 0, [_gPIu, _gPA], [0, 0]];\nvar GuardrailManagedWords = [\n 3,\n n0,\n _GMW,\n 0,\n [_ty, _iA, _oA, _iE, _oE],\n [0, [() => GuardrailWordAction$1, 0], [() => GuardrailWordAction$1, 0], 2, 2],\n];\nvar GuardrailManagedWordsConfig = [\n 3,\n n0,\n _GMWC,\n 0,\n [_ty, _iA, _oA, _iE, _oE],\n [0, [() => GuardrailWordAction$1, 0], [() => GuardrailWordAction$1, 0], 2, 2],\n];\nvar GuardrailPiiEntity = [\n 3,\n n0,\n _GPE,\n 0,\n [_ty, _ac, _iA, _oA, _iE, _oE],\n [0, 0, 0, 0, 2, 2],\n];\nvar GuardrailPiiEntityConfig = [\n 3,\n n0,\n _GPEC,\n 0,\n [_ty, _ac, _iA, _oA, _iE, _oE],\n [0, 0, 0, 0, 2, 2],\n];\nvar GuardrailRegex = [\n 3,\n n0,\n _GR,\n 0,\n [_n, _d, _pa, _ac, _iA, _oA, _iE, _oE],\n [0, 0, 0, 0, 0, 0, 2, 2],\n];\nvar GuardrailRegexConfig = [\n 3,\n n0,\n _GRC,\n 0,\n [_n, _d, _pa, _ac, _iA, _oA, _iE, _oE],\n [0, 0, 0, 0, 0, 0, 2, 2],\n];\nvar GuardrailSensitiveInformationPolicy = [\n 3,\n n0,\n _GSIP,\n 0,\n [_pEi, _re],\n [() => GuardrailPiiEntities, () => GuardrailRegexes],\n];\nvar GuardrailSensitiveInformationPolicyConfig = [\n 3,\n n0,\n _GSIPC,\n 0,\n [_pEC, _rCe],\n [() => GuardrailPiiEntitiesConfig, () => GuardrailRegexesConfig],\n];\nvar GuardrailSummary = [\n 3,\n n0,\n _GS,\n 0,\n [_i, _ar, _s, _n, _d, _ve, _cA, _uA, _cRD],\n [0, 0, 0, [() => GuardrailName, 0], [() => GuardrailDescription, 0], 0, 5, 5, () => GuardrailCrossRegionDetails],\n];\nvar GuardrailTopic = [\n 3,\n n0,\n _GT,\n 0,\n [_n, _de, _exa, _ty, _iA, _oA, _iE, _oE],\n [\n [() => GuardrailTopicName, 0],\n [() => GuardrailTopicDefinition, 0],\n [() => GuardrailTopicExamples, 0],\n 0,\n [() => GuardrailTopicAction$1, 0],\n [() => GuardrailTopicAction$1, 0],\n 2,\n 2,\n ],\n];\nvar GuardrailTopicConfig = [\n 3,\n n0,\n _GTC,\n 0,\n [_n, _de, _exa, _ty, _iA, _oA, _iE, _oE],\n [\n [() => GuardrailTopicName, 0],\n [() => GuardrailTopicDefinition, 0],\n [() => GuardrailTopicExamples, 0],\n 0,\n [() => GuardrailTopicAction$1, 0],\n [() => GuardrailTopicAction$1, 0],\n 2,\n 2,\n ],\n];\nvar GuardrailTopicPolicy = [\n 3,\n n0,\n _GTP,\n 0,\n [_to, _ti],\n [\n [() => GuardrailTopics, 0],\n [() => GuardrailTopicsTier, 0],\n ],\n];\nvar GuardrailTopicPolicyConfig = [\n 3,\n n0,\n _GTPC,\n 0,\n [_tCo, _tCi],\n [\n [() => GuardrailTopicsConfig, 0],\n [() => GuardrailTopicsTierConfig, 0],\n ],\n];\nvar GuardrailTopicsTier = [3, n0, _GTT, 0, [_tNi], [[() => GuardrailTopicsTierName$1, 0]]];\nvar GuardrailTopicsTierConfig = [\n 3,\n n0,\n _GTTC,\n 0,\n [_tNi],\n [[() => GuardrailTopicsTierName$1, 0]],\n];\nvar GuardrailWord = [\n 3,\n n0,\n _GW,\n 0,\n [_te, _iA, _oA, _iE, _oE],\n [0, [() => GuardrailWordAction$1, 0], [() => GuardrailWordAction$1, 0], 2, 2],\n];\nvar GuardrailWordConfig = [\n 3,\n n0,\n _GWC,\n 0,\n [_te, _iA, _oA, _iE, _oE],\n [0, [() => GuardrailWordAction$1, 0], [() => GuardrailWordAction$1, 0], 2, 2],\n];\nvar GuardrailWordPolicy = [\n 3,\n n0,\n _GWP,\n 0,\n [_w, _mWL],\n [\n [() => GuardrailWords, 0],\n [() => GuardrailManagedWordLists, 0],\n ],\n];\nvar GuardrailWordPolicyConfig = [\n 3,\n n0,\n _GWPC,\n 0,\n [_wCo, _mWLC],\n [\n [() => GuardrailWordsConfig, 0],\n [() => GuardrailManagedWordListsConfig, 0],\n ],\n];\nvar HumanEvaluationConfig = [\n 3,\n n0,\n _HEC,\n 0,\n [_hWC, _cM, _dMC],\n [\n [() => HumanWorkflowConfig, 0],\n [() => HumanEvaluationCustomMetrics, 0],\n [() => EvaluationDatasetMetricConfigs, 0],\n ],\n];\nvar HumanEvaluationCustomMetric = [\n 3,\n n0,\n _HECM,\n 0,\n [_n, _d, _rM],\n [[() => EvaluationMetricName, 0], [() => EvaluationMetricDescription, 0], 0],\n];\nvar HumanWorkflowConfig = [\n 3,\n n0,\n _HWC,\n 0,\n [_fDA, _in],\n [0, [() => HumanTaskInstructions, 0]],\n];\nvar ImplicitFilterConfiguration = [\n 3,\n n0,\n _IFC,\n 0,\n [_mAe, _mA],\n [[() => MetadataAttributeSchemaList, 0], 0],\n];\nvar ImportedModelSummary = [3, n0, _IMS, 0, [_mA, _mN, _cTr, _iS, _mAo], [0, 0, 5, 2, 0]];\nvar InferenceProfileModel = [3, n0, _IPM, 0, [_mA], [0]];\nvar InferenceProfileSummary = [\n 3,\n n0,\n _IPS,\n 0,\n [_iPN, _d, _cA, _uA, _iPA, _mo, _iPIn, _s, _ty],\n [0, [() => InferenceProfileDescription, 0], 5, 5, 0, () => InferenceProfileModels, 0, 0, 0],\n];\nvar InternalServerException = [\n -3,\n n0,\n _ISE,\n {\n [_e]: _se,\n [_hE]: 500,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1);\nvar InvocationLogsConfig = [\n 3,\n n0,\n _ILC,\n 0,\n [_uPR, _iLS, _rMF],\n [2, () => InvocationLogSource, [() => RequestMetadataFilters, 0]],\n];\nvar KbInferenceConfig = [3, n0, _KIC, 0, [_tIC], [() => TextInferenceConfig]];\nvar KnowledgeBaseRetrievalConfiguration = [\n 3,\n n0,\n _KBRC,\n 0,\n [_vSC],\n [[() => KnowledgeBaseVectorSearchConfiguration, 0]],\n];\nvar KnowledgeBaseRetrieveAndGenerateConfiguration = [\n 3,\n n0,\n _KBRAGC,\n 0,\n [_kBI, _mA, _rCet, _gCe, _oC],\n [\n 0,\n 0,\n [() => KnowledgeBaseRetrievalConfiguration, 0],\n [() => GenerationConfiguration, 0],\n () => OrchestrationConfiguration,\n ],\n];\nvar KnowledgeBaseVectorSearchConfiguration = [\n 3,\n n0,\n _KBVSC,\n 0,\n [_nOR, _oST, _fil, _iFC, _rCer],\n [\n 1,\n 0,\n [() => RetrievalFilter, 0],\n [() => ImplicitFilterConfiguration, 0],\n [() => VectorSearchRerankingConfiguration, 0],\n ],\n];\nvar LegalTerm = [3, n0, _LT, 0, [_ur], [0]];\nvar ListAutomatedReasoningPoliciesRequest = [\n 3,\n n0,\n _LARPR,\n 0,\n [_pA, _nT, _mR],\n [\n [\n 0,\n {\n [_hQ]: _pA,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n ],\n];\nvar ListAutomatedReasoningPoliciesResponse = [\n 3,\n n0,\n _LARPRi,\n 0,\n [_aRPS, _nT],\n [[() => AutomatedReasoningPolicySummaries, 0], 0],\n];\nvar ListAutomatedReasoningPolicyBuildWorkflowsRequest = [\n 3,\n n0,\n _LARPBWR,\n 0,\n [_pA, _nT, _mR],\n [\n [0, 1],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n ],\n];\nvar ListAutomatedReasoningPolicyBuildWorkflowsResponse = [\n 3,\n n0,\n _LARPBWRi,\n 0,\n [_aRPBWS, _nT],\n [() => AutomatedReasoningPolicyBuildWorkflowSummaries, 0],\n];\nvar ListAutomatedReasoningPolicyTestCasesRequest = [\n 3,\n n0,\n _LARPTCR,\n 0,\n [_pA, _nT, _mR],\n [\n [0, 1],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n ],\n];\nvar ListAutomatedReasoningPolicyTestCasesResponse = [\n 3,\n n0,\n _LARPTCRi,\n 0,\n [_tCes, _nT],\n [[() => AutomatedReasoningPolicyTestCaseList, 0], 0],\n];\nvar ListAutomatedReasoningPolicyTestResultsRequest = [\n 3,\n n0,\n _LARPTRR,\n 0,\n [_pA, _bWI, _nT, _mR],\n [\n [0, 1],\n [0, 1],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n ],\n];\nvar ListAutomatedReasoningPolicyTestResultsResponse = [\n 3,\n n0,\n _LARPTRRi,\n 0,\n [_tRe, _nT],\n [[() => AutomatedReasoningPolicyTestList, 0], 0],\n];\nvar ListCustomModelDeploymentsRequest = [\n 3,\n n0,\n _LCMDR,\n 0,\n [_cB, _cAr, _nC, _mR, _nT, _sB, _sO, _sEt, _mAE],\n [\n [\n 5,\n {\n [_hQ]: _cB,\n },\n ],\n [\n 5,\n {\n [_hQ]: _cAr,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nC,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sEt,\n },\n ],\n [\n 0,\n {\n [_hQ]: _mAE,\n },\n ],\n ],\n];\nvar ListCustomModelDeploymentsResponse = [\n 3,\n n0,\n _LCMDRi,\n 0,\n [_nT, _mDSo],\n [0, () => CustomModelDeploymentSummaryList],\n];\nvar ListCustomModelsRequest = [\n 3,\n n0,\n _LCMR,\n 0,\n [_cTB, _cTA, _nC, _bMAE, _fMAE, _mR, _nT, _sB, _sO, _iO, _mSo],\n [\n [\n 5,\n {\n [_hQ]: _cTB,\n },\n ],\n [\n 5,\n {\n [_hQ]: _cTA,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nC,\n },\n ],\n [\n 0,\n {\n [_hQ]: _bMAE,\n },\n ],\n [\n 0,\n {\n [_hQ]: _fMAE,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n [\n 2,\n {\n [_hQ]: _iO,\n },\n ],\n [\n 0,\n {\n [_hQ]: _mSo,\n },\n ],\n ],\n];\nvar ListCustomModelsResponse = [\n 3,\n n0,\n _LCMRi,\n 0,\n [_nT, _mSod],\n [0, () => CustomModelSummaryList],\n];\nvar ListEvaluationJobsRequest = [\n 3,\n n0,\n _LEJR,\n 0,\n [_cTA, _cTB, _sEt, _aTE, _nC, _mR, _nT, _sB, _sO],\n [\n [\n 5,\n {\n [_hQ]: _cTA,\n },\n ],\n [\n 5,\n {\n [_hQ]: _cTB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sEt,\n },\n ],\n [\n 0,\n {\n [_hQ]: _aTE,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nC,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n ],\n];\nvar ListEvaluationJobsResponse = [\n 3,\n n0,\n _LEJRi,\n 0,\n [_nT, _jSo],\n [0, () => EvaluationSummaries],\n];\nvar ListFoundationModelAgreementOffersRequest = [\n 3,\n n0,\n _LFMAOR,\n 0,\n [_mIo, _oTf],\n [\n [0, 1],\n [\n 0,\n {\n [_hQ]: _oTf,\n },\n ],\n ],\n];\nvar ListFoundationModelAgreementOffersResponse = [\n 3,\n n0,\n _LFMAORi,\n 0,\n [_mIo, _of],\n [0, () => Offers],\n];\nvar ListFoundationModelsRequest = [\n 3,\n n0,\n _LFMR,\n 0,\n [_bP, _bCT, _bOMy, _bIT],\n [\n [\n 0,\n {\n [_hQ]: _bP,\n },\n ],\n [\n 0,\n {\n [_hQ]: _bCT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _bOMy,\n },\n ],\n [\n 0,\n {\n [_hQ]: _bIT,\n },\n ],\n ],\n];\nvar ListFoundationModelsResponse = [\n 3,\n n0,\n _LFMRi,\n 0,\n [_mSod],\n [() => FoundationModelSummaryList],\n];\nvar ListGuardrailsRequest = [\n 3,\n n0,\n _LGR,\n 0,\n [_gIu, _mR, _nT],\n [\n [\n 0,\n {\n [_hQ]: _gIu,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n ],\n];\nvar ListGuardrailsResponse = [\n 3,\n n0,\n _LGRi,\n 0,\n [_g, _nT],\n [[() => GuardrailSummaries, 0], 0],\n];\nvar ListImportedModelsRequest = [\n 3,\n n0,\n _LIMR,\n 0,\n [_cTB, _cTA, _nC, _mR, _nT, _sB, _sO],\n [\n [\n 5,\n {\n [_hQ]: _cTB,\n },\n ],\n [\n 5,\n {\n [_hQ]: _cTA,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nC,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n ],\n];\nvar ListImportedModelsResponse = [\n 3,\n n0,\n _LIMRi,\n 0,\n [_nT, _mSod],\n [0, () => ImportedModelSummaryList],\n];\nvar ListInferenceProfilesRequest = [\n 3,\n n0,\n _LIPR,\n 0,\n [_mR, _nT, _tE],\n [\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _ty,\n },\n ],\n ],\n];\nvar ListInferenceProfilesResponse = [\n 3,\n n0,\n _LIPRi,\n 0,\n [_iPS, _nT],\n [[() => InferenceProfileSummaries, 0], 0],\n];\nvar ListMarketplaceModelEndpointsRequest = [\n 3,\n n0,\n _LMMER,\n 0,\n [_mR, _nT, _mSE],\n [\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _mSI,\n },\n ],\n ],\n];\nvar ListMarketplaceModelEndpointsResponse = [\n 3,\n n0,\n _LMMERi,\n 0,\n [_mMEa, _nT],\n [() => MarketplaceModelEndpointSummaries, 0],\n];\nvar ListModelCopyJobsRequest = [\n 3,\n n0,\n _LMCJR,\n 0,\n [_cTA, _cTB, _sEt, _sAE, _sMAE, _tMNC, _mR, _nT, _sB, _sO],\n [\n [\n 5,\n {\n [_hQ]: _cTA,\n },\n ],\n [\n 5,\n {\n [_hQ]: _cTB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sEt,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sAE,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sMAE,\n },\n ],\n [\n 0,\n {\n [_hQ]: _oMNC,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n ],\n];\nvar ListModelCopyJobsResponse = [\n 3,\n n0,\n _LMCJRi,\n 0,\n [_nT, _mCJS],\n [0, () => ModelCopyJobSummaries],\n];\nvar ListModelCustomizationJobsRequest = [\n 3,\n n0,\n _LMCJRis,\n 0,\n [_cTA, _cTB, _sEt, _nC, _mR, _nT, _sB, _sO],\n [\n [\n 5,\n {\n [_hQ]: _cTA,\n },\n ],\n [\n 5,\n {\n [_hQ]: _cTB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sEt,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nC,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n ],\n];\nvar ListModelCustomizationJobsResponse = [\n 3,\n n0,\n _LMCJRist,\n 0,\n [_nT, _mCJSo],\n [0, () => ModelCustomizationJobSummaries],\n];\nvar ListModelImportJobsRequest = [\n 3,\n n0,\n _LMIJR,\n 0,\n [_cTA, _cTB, _sEt, _nC, _mR, _nT, _sB, _sO],\n [\n [\n 5,\n {\n [_hQ]: _cTA,\n },\n ],\n [\n 5,\n {\n [_hQ]: _cTB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sEt,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nC,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n ],\n];\nvar ListModelImportJobsResponse = [\n 3,\n n0,\n _LMIJRi,\n 0,\n [_nT, _mIJS],\n [0, () => ModelImportJobSummaries],\n];\nvar ListModelInvocationJobsRequest = [\n 3,\n n0,\n _LMIJRis,\n 0,\n [_sTA, _sTB, _sEt, _nC, _mR, _nT, _sB, _sO],\n [\n [\n 5,\n {\n [_hQ]: _sTA,\n },\n ],\n [\n 5,\n {\n [_hQ]: _sTB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sEt,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nC,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n ],\n];\nvar ListModelInvocationJobsResponse = [\n 3,\n n0,\n _LMIJRist,\n 0,\n [_nT, _iJS],\n [0, [() => ModelInvocationJobSummaries, 0]],\n];\nvar ListPromptRoutersRequest = [\n 3,\n n0,\n _LPRR,\n 0,\n [_mR, _nT, _ty],\n [\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _ty,\n },\n ],\n ],\n];\nvar ListPromptRoutersResponse = [\n 3,\n n0,\n _LPRRi,\n 0,\n [_pRS, _nT],\n [[() => PromptRouterSummaries, 0], 0],\n];\nvar ListProvisionedModelThroughputsRequest = [\n 3,\n n0,\n _LPMTR,\n 0,\n [_cTA, _cTB, _sEt, _mAE, _nC, _mR, _nT, _sB, _sO],\n [\n [\n 5,\n {\n [_hQ]: _cTA,\n },\n ],\n [\n 5,\n {\n [_hQ]: _cTB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sEt,\n },\n ],\n [\n 0,\n {\n [_hQ]: _mAE,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nC,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n ],\n];\nvar ListProvisionedModelThroughputsResponse = [\n 3,\n n0,\n _LPMTRi,\n 0,\n [_nT, _pMS],\n [0, () => ProvisionedModelSummaries],\n];\nvar ListTagsForResourceRequest = [3, n0, _LTFRR, 0, [_rARN], [0]];\nvar ListTagsForResourceResponse = [3, n0, _LTFRRi, 0, [_ta], [() => TagList]];\nvar LoggingConfig = [\n 3,\n n0,\n _LC,\n 0,\n [_cWC, _sC, _tDDE, _iDDE, _eDDE, _vDDE],\n [() => CloudWatchConfig, () => S3Config, 2, 2, 2, 2],\n];\nvar MarketplaceModelEndpoint = [\n 3,\n n0,\n _MME,\n 0,\n [_eA, _mSI, _s, _sM, _cA, _uA, _eCn, _eS, _eSM],\n [0, 0, 0, 0, 5, 5, () => EndpointConfig, 0, 0],\n];\nvar MarketplaceModelEndpointSummary = [\n 3,\n n0,\n _MMES,\n 0,\n [_eA, _mSI, _s, _sM, _cA, _uA],\n [0, 0, 0, 0, 5, 5],\n];\nvar MetadataAttributeSchema = [3, n0, _MAS, 8, [_k, _ty, _d], [0, 0, 0]];\nvar MetadataConfigurationForReranking = [\n 3,\n n0,\n _MCFR,\n 0,\n [_sMe, _sMC],\n [0, [() => RerankingMetadataSelectiveModeConfiguration, 0]],\n];\nvar ModelCopyJobSummary = [\n 3,\n n0,\n _MCJS,\n 0,\n [_jA, _s, _cTr, _tMA, _tMN, _sAI, _sMA, _tMKKA, _tMT, _fMa, _sMN],\n [0, 0, 5, 0, 0, 0, 0, 0, () => TagList, 0, 0],\n];\nvar ModelCustomizationJobSummary = [\n 3,\n n0,\n _MCJSo,\n 0,\n [_jA, _bMA, _jN, _s, _sD, _lMT, _cTr, _eT, _cMA, _cMN, _cTu],\n [0, 0, 0, 0, () => StatusDetails, 5, 5, 5, 0, 0, 0],\n];\nvar ModelImportJobSummary = [\n 3,\n n0,\n _MIJS,\n 0,\n [_jA, _jN, _s, _lMT, _cTr, _eT, _iMA, _iMN],\n [0, 0, 0, 5, 5, 5, 0, 0],\n];\nvar ModelInvocationJobS3InputDataConfig = [\n 3,\n n0,\n _MIJSIDC,\n 0,\n [_sIF, _sU, _sBO],\n [0, 0, 0],\n];\nvar ModelInvocationJobS3OutputDataConfig = [\n 3,\n n0,\n _MIJSODC,\n 0,\n [_sU, _sEKI, _sBO],\n [0, 0, 0],\n];\nvar ModelInvocationJobSummary = [\n 3,\n n0,\n _MIJSo,\n 0,\n [_jA, _jN, _mIo, _cRT, _rA, _s, _m, _sTu, _lMT, _eT, _iDC, _oDC, _vCp, _tDIH, _jET],\n [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n [() => Message, 0],\n 5,\n 5,\n 5,\n () => ModelInvocationJobInputDataConfig,\n () => ModelInvocationJobOutputDataConfig,\n () => VpcConfig,\n 1,\n 5,\n ],\n];\nvar Offer = [3, n0, _O, 0, [_oI, _oT, _tD], [0, 0, () => TermDetails]];\nvar OrchestrationConfiguration = [\n 3,\n n0,\n _OC,\n 0,\n [_qTC],\n [() => QueryTransformationConfiguration],\n];\nvar OutputDataConfig = [3, n0, _ODC, 0, [_sU], [0]];\nvar PerformanceConfiguration = [3, n0, _PC, 0, [_la], [0]];\nvar PricingTerm = [3, n0, _PT, 0, [_rCa], [() => RateCard]];\nvar PromptRouterSummary = [\n 3,\n n0,\n _PRS,\n 0,\n [_pRN, _rCo, _d, _cA, _uA, _pRA, _mo, _fM, _s, _ty],\n [\n 0,\n () => RoutingCriteria,\n [() => PromptRouterDescription, 0],\n 5,\n 5,\n 0,\n () => PromptRouterTargetModels,\n () => PromptRouterTargetModel,\n 0,\n 0,\n ],\n];\nvar PromptRouterTargetModel = [3, n0, _PRTM, 0, [_mA], [0]];\nvar PromptTemplate = [3, n0, _PTr, 0, [_tPT], [[() => TextPromptTemplate, 0]]];\nvar ProvisionedModelSummary = [\n 3,\n n0,\n _PMS,\n 0,\n [_pMN, _pMA, _mA, _dMA, _fMA, _mU, _dMU, _s, _cD, _cET, _cTr, _lMT],\n [0, 0, 0, 0, 0, 1, 1, 0, 0, 5, 5, 5],\n];\nvar PutModelInvocationLoggingConfigurationRequest = [\n 3,\n n0,\n _PMILCR,\n 0,\n [_lC],\n [() => LoggingConfig],\n];\nvar PutModelInvocationLoggingConfigurationResponse = [3, n0, _PMILCRu, 0, [], []];\nvar PutUseCaseForModelAccessRequest = [3, n0, _PUCFMAR, 0, [_fD], [21]];\nvar PutUseCaseForModelAccessResponse = [3, n0, _PUCFMARu, 0, [], []];\nvar QueryTransformationConfiguration = [3, n0, _QTC, 0, [_ty], [0]];\nvar RatingScaleItem = [3, n0, _RSI, 0, [_de, _va], [0, () => RatingScaleItemValue]];\nvar RegisterMarketplaceModelEndpointRequest = [\n 3,\n n0,\n _RMMER,\n 0,\n [_eI, _mSI],\n [[0, 1], 0],\n];\nvar RegisterMarketplaceModelEndpointResponse = [\n 3,\n n0,\n _RMMERe,\n 0,\n [_mME],\n [() => MarketplaceModelEndpoint],\n];\nvar RequestMetadataBaseFilters = [\n 3,\n n0,\n _RMBF,\n 0,\n [_eq, _nE],\n [\n [() => RequestMetadataMap, 0],\n [() => RequestMetadataMap, 0],\n ],\n];\nvar ResourceInUseException = [\n -3,\n n0,\n _RIUE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ResourceInUseException, ResourceInUseException$1);\nvar ResourceNotFoundException = [\n -3,\n n0,\n _RNFE,\n {\n [_e]: _c,\n [_hE]: 404,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1);\nvar RetrieveAndGenerateConfiguration = [\n 3,\n n0,\n _RAGC,\n 0,\n [_ty, _kBC, _eSC],\n [\n 0,\n [() => KnowledgeBaseRetrieveAndGenerateConfiguration, 0],\n [() => ExternalSourcesRetrieveAndGenerateConfiguration, 0],\n ],\n];\nvar RetrieveConfig = [\n 3,\n n0,\n _RC,\n 0,\n [_kBI, _kBRC],\n [0, [() => KnowledgeBaseRetrievalConfiguration, 0]],\n];\nvar RoutingCriteria = [3, n0, _RCo, 0, [_rQD], [1]];\nvar S3Config = [3, n0, _SC, 0, [_bN, _kP], [0, 0]];\nvar S3DataSource = [3, n0, _SDS, 0, [_sU], [0]];\nvar S3ObjectDoc = [3, n0, _SOD, 0, [_uri], [0]];\nvar SageMakerEndpoint = [\n 3,\n n0,\n _SME,\n 0,\n [_iIC, _iT, _eRx, _kEK, _vp],\n [1, 0, 0, 0, () => VpcConfig],\n];\nvar ServiceQuotaExceededException = [\n -3,\n n0,\n _SQEE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ServiceQuotaExceededException, ServiceQuotaExceededException$1);\nvar ServiceUnavailableException = [\n -3,\n n0,\n _SUE,\n {\n [_e]: _se,\n [_hE]: 503,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ServiceUnavailableException, ServiceUnavailableException$1);\nvar StartAutomatedReasoningPolicyBuildWorkflowRequest = [\n 3,\n n0,\n _SARPBWR,\n 0,\n [_pA, _bWT, _cRT, _sCo],\n [\n [0, 1],\n [0, 1],\n [\n 0,\n {\n [_hH]: _xact,\n [_iTd]: 1,\n },\n ],\n [() => AutomatedReasoningPolicyBuildWorkflowSource, 16],\n ],\n];\nvar StartAutomatedReasoningPolicyBuildWorkflowResponse = [\n 3,\n n0,\n _SARPBWRt,\n 0,\n [_pA, _bWI],\n [0, 0],\n];\nvar StartAutomatedReasoningPolicyTestWorkflowRequest = [\n 3,\n n0,\n _SARPTWR,\n 0,\n [_pA, _bWI, _tCIe, _cRT],\n [[0, 1], [0, 1], 64 | 0, [0, 4]],\n];\nvar StartAutomatedReasoningPolicyTestWorkflowResponse = [3, n0, _SARPTWRt, 0, [_pA], [0]];\nvar StatusDetails = [\n 3,\n n0,\n _SD,\n 0,\n [_vD, _dPD, _tDr],\n [() => ValidationDetails, () => DataProcessingDetails, () => TrainingDetails],\n];\nvar StopEvaluationJobRequest = [\n 3,\n n0,\n _SEJR,\n 0,\n [_jI],\n [[() => EvaluationJobIdentifier, 1]],\n];\nvar StopEvaluationJobResponse = [3, n0, _SEJRt, 0, [], []];\nvar StopModelCustomizationJobRequest = [3, n0, _SMCJR, 0, [_jI], [[0, 1]]];\nvar StopModelCustomizationJobResponse = [3, n0, _SMCJRt, 0, [], []];\nvar StopModelInvocationJobRequest = [3, n0, _SMIJR, 0, [_jI], [[0, 1]]];\nvar StopModelInvocationJobResponse = [3, n0, _SMIJRt, 0, [], []];\nvar SupportTerm = [3, n0, _ST, 0, [_rPD], [0]];\nvar Tag = [3, n0, _T, 0, [_k, _va], [0, 0]];\nvar TagResourceRequest = [3, n0, _TRR, 0, [_rARN, _ta], [0, () => TagList]];\nvar TagResourceResponse = [3, n0, _TRRa, 0, [], []];\nvar TeacherModelConfig = [3, n0, _TMC, 0, [_tMI, _mRLFI], [0, 1]];\nvar TermDetails = [\n 3,\n n0,\n _TD,\n 0,\n [_uBPT, _lT, _sTup, _vT],\n [() => PricingTerm, () => LegalTerm, () => SupportTerm, () => ValidityTerm],\n];\nvar TextInferenceConfig = [3, n0, _TIC, 0, [_tem, _tPo, _mTa, _sS], [1, 1, 1, 64 | 0]];\nvar ThrottlingException = [\n -3,\n n0,\n _TE,\n {\n [_e]: _c,\n [_hE]: 429,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ThrottlingException, ThrottlingException$1);\nvar TooManyTagsException = [\n -3,\n n0,\n _TMTE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m, _rN],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(TooManyTagsException, TooManyTagsException$1);\nvar TrainingDataConfig = [\n 3,\n n0,\n _TDC,\n 0,\n [_sU, _iLC],\n [0, [() => InvocationLogsConfig, 0]],\n];\nvar TrainingDetails = [3, n0, _TDr, 0, [_s, _cTr, _lMT], [0, 5, 5]];\nvar TrainingMetrics = [3, n0, _TM, 0, [_tL], [1]];\nvar UntagResourceRequest = [3, n0, _URR, 0, [_rARN, _tK], [0, 64 | 0]];\nvar UntagResourceResponse = [3, n0, _URRn, 0, [], []];\nvar UpdateAutomatedReasoningPolicyAnnotationsRequest = [\n 3,\n n0,\n _UARPAR,\n 0,\n [_pA, _bWI, _an, _lUASH],\n [[0, 1], [0, 1], [() => AutomatedReasoningPolicyAnnotationList, 0], 0],\n];\nvar UpdateAutomatedReasoningPolicyAnnotationsResponse = [\n 3,\n n0,\n _UARPARp,\n 0,\n [_pA, _bWI, _aSH, _uA],\n [0, 0, 0, 5],\n];\nvar UpdateAutomatedReasoningPolicyRequest = [\n 3,\n n0,\n _UARPR,\n 0,\n [_pA, _pD, _n, _d],\n [\n [0, 1],\n [() => AutomatedReasoningPolicyDefinition, 0],\n [() => AutomatedReasoningPolicyName, 0],\n [() => AutomatedReasoningPolicyDescription, 0],\n ],\n];\nvar UpdateAutomatedReasoningPolicyResponse = [\n 3,\n n0,\n _UARPRp,\n 0,\n [_pA, _n, _dH, _uA],\n [0, [() => AutomatedReasoningPolicyName, 0], 0, 5],\n];\nvar UpdateAutomatedReasoningPolicyTestCaseRequest = [\n 3,\n n0,\n _UARPTCR,\n 0,\n [_pA, _tCI, _gC, _qC, _lUA, _eAFR, _cT, _cRT],\n [\n [0, 1],\n [0, 1],\n [() => AutomatedReasoningPolicyTestGuardContent, 0],\n [() => AutomatedReasoningPolicyTestQueryContent, 0],\n 5,\n 0,\n 1,\n [0, 4],\n ],\n];\nvar UpdateAutomatedReasoningPolicyTestCaseResponse = [\n 3,\n n0,\n _UARPTCRp,\n 0,\n [_pA, _tCI],\n [0, 0],\n];\nvar UpdateGuardrailRequest = [\n 3,\n n0,\n _UGR,\n 0,\n [_gIu, _n, _d, _tPC, _cPC, _wPC, _sIPC, _cGPC, _aRPC, _cRC, _bIM, _bOM, _kKI],\n [\n [0, 1],\n [() => GuardrailName, 0],\n [() => GuardrailDescription, 0],\n [() => GuardrailTopicPolicyConfig, 0],\n [() => GuardrailContentPolicyConfig, 0],\n [() => GuardrailWordPolicyConfig, 0],\n () => GuardrailSensitiveInformationPolicyConfig,\n [() => GuardrailContextualGroundingPolicyConfig, 0],\n () => GuardrailAutomatedReasoningPolicyConfig,\n () => GuardrailCrossRegionConfig,\n [() => GuardrailBlockedMessaging, 0],\n [() => GuardrailBlockedMessaging, 0],\n 0,\n ],\n];\nvar UpdateGuardrailResponse = [3, n0, _UGRp, 0, [_gI, _gA, _ve, _uA], [0, 0, 0, 5]];\nvar UpdateMarketplaceModelEndpointRequest = [\n 3,\n n0,\n _UMMER,\n 0,\n [_eA, _eCn, _cRT],\n [[0, 1], () => EndpointConfig, [0, 4]],\n];\nvar UpdateMarketplaceModelEndpointResponse = [\n 3,\n n0,\n _UMMERp,\n 0,\n [_mME],\n [() => MarketplaceModelEndpoint],\n];\nvar UpdateProvisionedModelThroughputRequest = [\n 3,\n n0,\n _UPMTR,\n 0,\n [_pMI, _dPMN, _dMI],\n [[0, 1], 0, 0],\n];\nvar UpdateProvisionedModelThroughputResponse = [3, n0, _UPMTRp, 0, [], []];\nvar ValidationDataConfig = [3, n0, _VDC, 0, [_val], [() => Validators]];\nvar ValidationDetails = [3, n0, _VD, 0, [_s, _cTr, _lMT], [0, 5, 5]];\nvar ValidationException = [\n -3,\n n0,\n _VE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1);\nvar Validator = [3, n0, _V, 0, [_sU], [0]];\nvar ValidatorMetric = [3, n0, _VM, 0, [_vL], [1]];\nvar ValidityTerm = [3, n0, _VT, 0, [_aD], [0]];\nvar VectorSearchBedrockRerankingConfiguration = [\n 3,\n n0,\n _VSBRC,\n 0,\n [_mC, _nORR, _mCe],\n [() => VectorSearchBedrockRerankingModelConfiguration, 1, [() => MetadataConfigurationForReranking, 0]],\n];\nvar VectorSearchBedrockRerankingModelConfiguration = [\n 3,\n n0,\n _VSBRMC,\n 0,\n [_mA, _aMRF],\n [0, 128 | 15],\n];\nvar VectorSearchRerankingConfiguration = [\n 3,\n n0,\n _VSRC,\n 0,\n [_ty, _bRC],\n [0, [() => VectorSearchBedrockRerankingConfiguration, 0]],\n];\nvar VpcConfig = [3, n0, _VC, 0, [_sI, _sGI], [64 | 0, 64 | 0]];\nvar BedrockServiceException = [-3, _sm, \"BedrockServiceException\", 0, [], []];\nschema.TypeRegistry.for(_sm).registerError(BedrockServiceException, BedrockServiceException$1);\nvar AutomatedEvaluationCustomMetrics = [\n 1,\n n0,\n _AECM,\n 0,\n [() => AutomatedEvaluationCustomMetricSource, 0],\n];\nvar AutomatedReasoningCheckDifferenceScenarioList = [\n 1,\n n0,\n _ARCDSL,\n 0,\n [() => AutomatedReasoningCheckScenario, 0],\n];\nvar AutomatedReasoningCheckFindingList = [\n 1,\n n0,\n _ARCFL,\n 0,\n [() => AutomatedReasoningCheckFinding, 0],\n];\nvar AutomatedReasoningCheckInputTextReferenceList = [\n 1,\n n0,\n _ARCITRL,\n 0,\n [() => AutomatedReasoningCheckInputTextReference, 0],\n];\nvar AutomatedReasoningCheckRuleList = [1, n0, _ARCRL, 0, () => AutomatedReasoningCheckRule];\nvar AutomatedReasoningCheckTranslationList = [\n 1,\n n0,\n _ARCTL,\n 0,\n [() => AutomatedReasoningCheckTranslation, 0],\n];\nvar AutomatedReasoningCheckTranslationOptionList = [\n 1,\n n0,\n _ARCTOL,\n 0,\n [() => AutomatedReasoningCheckTranslationOption, 0],\n];\nvar AutomatedReasoningLogicStatementList = [\n 1,\n n0,\n _ARLSL,\n 0,\n [() => AutomatedReasoningLogicStatement, 0],\n];\nvar AutomatedReasoningPolicyAnnotationList = [\n 1,\n n0,\n _ARPAL,\n 0,\n [() => AutomatedReasoningPolicyAnnotation, 0],\n];\nvar AutomatedReasoningPolicyBuildLogEntryList = [\n 1,\n n0,\n _ARPBLEL,\n 0,\n [() => AutomatedReasoningPolicyBuildLogEntry, 0],\n];\nvar AutomatedReasoningPolicyBuildStepList = [\n 1,\n n0,\n _ARPBSL,\n 0,\n [() => AutomatedReasoningPolicyBuildStep, 0],\n];\nvar AutomatedReasoningPolicyBuildStepMessageList = [\n 1,\n n0,\n _ARPBSML,\n 0,\n () => AutomatedReasoningPolicyBuildStepMessage,\n];\nvar AutomatedReasoningPolicyBuildWorkflowDocumentList = [\n 1,\n n0,\n _ARPBWDL,\n 0,\n [() => AutomatedReasoningPolicyBuildWorkflowDocument, 0],\n];\nvar AutomatedReasoningPolicyBuildWorkflowSummaries = [\n 1,\n n0,\n _ARPBWSut,\n 0,\n () => AutomatedReasoningPolicyBuildWorkflowSummary,\n];\nvar AutomatedReasoningPolicyDefinitionRuleList = [\n 1,\n n0,\n _ARPDRL,\n 0,\n [() => AutomatedReasoningPolicyDefinitionRule, 0],\n];\nvar AutomatedReasoningPolicyDefinitionTypeList = [\n 1,\n n0,\n _ARPDTL,\n 0,\n [() => AutomatedReasoningPolicyDefinitionType, 0],\n];\nvar AutomatedReasoningPolicyDefinitionTypeNameList = [\n 1,\n n0,\n _ARPDTNL,\n 0,\n [() => AutomatedReasoningPolicyDefinitionTypeName, 0],\n];\nvar AutomatedReasoningPolicyDefinitionTypeValueList = [\n 1,\n n0,\n _ARPDTVL,\n 0,\n [() => AutomatedReasoningPolicyDefinitionTypeValue, 0],\n];\nvar AutomatedReasoningPolicyDefinitionTypeValuePairList = [\n 1,\n n0,\n _ARPDTVPL,\n 0,\n [() => AutomatedReasoningPolicyDefinitionTypeValuePair, 0],\n];\nvar AutomatedReasoningPolicyDefinitionVariableList = [\n 1,\n n0,\n _ARPDVL,\n 0,\n [() => AutomatedReasoningPolicyDefinitionVariable, 0],\n];\nvar AutomatedReasoningPolicyDefinitionVariableNameList = [\n 1,\n n0,\n _ARPDVNL,\n 0,\n [() => AutomatedReasoningPolicyDefinitionVariableName, 0],\n];\nvar AutomatedReasoningPolicyDisjointRuleSetList = [\n 1,\n n0,\n _ARPDRSL,\n 0,\n [() => AutomatedReasoningPolicyDisjointRuleSet, 0],\n];\nvar AutomatedReasoningPolicyGeneratedTestCaseList = [\n 1,\n n0,\n _ARPGTCL,\n 0,\n [() => AutomatedReasoningPolicyGeneratedTestCase, 0],\n];\nvar AutomatedReasoningPolicySummaries = [\n 1,\n n0,\n _ARPSut,\n 0,\n [() => AutomatedReasoningPolicySummary, 0],\n];\nvar AutomatedReasoningPolicyTestCaseList = [\n 1,\n n0,\n _ARPTCL,\n 0,\n [() => AutomatedReasoningPolicyTestCase, 0],\n];\nvar AutomatedReasoningPolicyTestList = [\n 1,\n n0,\n _ARPTL,\n 0,\n [() => AutomatedReasoningPolicyTestResult, 0],\n];\nvar AutomatedReasoningPolicyTypeValueAnnotationList = [\n 1,\n n0,\n _ARPTVAL,\n 0,\n [() => AutomatedReasoningPolicyTypeValueAnnotation, 0],\n];\nvar BatchDeleteEvaluationJobErrors = [\n 1,\n n0,\n _BDEJEa,\n 0,\n [() => BatchDeleteEvaluationJobError, 0],\n];\nvar BatchDeleteEvaluationJobItems = [\n 1,\n n0,\n _BDEJIa,\n 0,\n [() => BatchDeleteEvaluationJobItem, 0],\n];\nvar BedrockEvaluatorModels = [1, n0, _BEMe, 0, () => BedrockEvaluatorModel];\nvar CustomMetricBedrockEvaluatorModels = [\n 1,\n n0,\n _CMBEMu,\n 0,\n () => CustomMetricBedrockEvaluatorModel,\n];\nvar CustomModelDeploymentSummaryList = [1, n0, _CMDSL, 0, () => CustomModelDeploymentSummary];\nvar CustomModelSummaryList = [1, n0, _CMSL, 0, () => CustomModelSummary];\nvar EvaluationDatasetMetricConfigs = [\n 1,\n n0,\n _EDMCv,\n 0,\n [() => EvaluationDatasetMetricConfig, 0],\n];\nvar EvaluationJobIdentifiers = [1, n0, _EJIv, 0, [() => EvaluationJobIdentifier, 0]];\nvar EvaluationMetricNames = [1, n0, _EMNv, 0, [() => EvaluationMetricName, 0]];\nvar EvaluationModelConfigs = [1, n0, _EMC, 0, [() => EvaluationModelConfig, 0]];\nvar EvaluationSummaries = [1, n0, _ESv, 0, () => EvaluationSummary];\nvar ExternalSources = [1, n0, _ESxt, 0, [() => ExternalSource, 0]];\nvar FieldsForReranking = [1, n0, _FFRi, 8, () => FieldForReranking];\nvar FoundationModelSummaryList = [1, n0, _FMSL, 0, () => FoundationModelSummary];\nvar GuardrailContentFilters = [1, n0, _GCFu, 0, [() => GuardrailContentFilter, 0]];\nvar GuardrailContentFiltersConfig = [\n 1,\n n0,\n _GCFCu,\n 0,\n [() => GuardrailContentFilterConfig, 0],\n];\nvar GuardrailContextualGroundingFilters = [\n 1,\n n0,\n _GCGFu,\n 0,\n [() => GuardrailContextualGroundingFilter, 0],\n];\nvar GuardrailContextualGroundingFiltersConfig = [\n 1,\n n0,\n _GCGFCu,\n 0,\n [() => GuardrailContextualGroundingFilterConfig, 0],\n];\nvar GuardrailFailureRecommendations = [\n 1,\n n0,\n _GFRu,\n 0,\n [() => GuardrailFailureRecommendation, 0],\n];\nvar GuardrailManagedWordLists = [1, n0, _GMWL, 0, [() => GuardrailManagedWords, 0]];\nvar GuardrailManagedWordListsConfig = [\n 1,\n n0,\n _GMWLC,\n 0,\n [() => GuardrailManagedWordsConfig, 0],\n];\nvar GuardrailModalities = [1, n0, _GMu, 0, [() => GuardrailModality$1, 0]];\nvar GuardrailPiiEntities = [1, n0, _GPEu, 0, () => GuardrailPiiEntity];\nvar GuardrailPiiEntitiesConfig = [1, n0, _GPECu, 0, () => GuardrailPiiEntityConfig];\nvar GuardrailRegexes = [1, n0, _GRu, 0, () => GuardrailRegex];\nvar GuardrailRegexesConfig = [1, n0, _GRCu, 0, () => GuardrailRegexConfig];\nvar GuardrailStatusReasons = [1, n0, _GSRu, 0, [() => GuardrailStatusReason, 0]];\nvar GuardrailSummaries = [1, n0, _GSu, 0, [() => GuardrailSummary, 0]];\nvar GuardrailTopicExamples = [1, n0, _GTEu, 0, [() => GuardrailTopicExample, 0]];\nvar GuardrailTopics = [1, n0, _GTu, 0, [() => GuardrailTopic, 0]];\nvar GuardrailTopicsConfig = [1, n0, _GTCu, 0, [() => GuardrailTopicConfig, 0]];\nvar GuardrailWords = [1, n0, _GWu, 0, [() => GuardrailWord, 0]];\nvar GuardrailWordsConfig = [1, n0, _GWCu, 0, [() => GuardrailWordConfig, 0]];\nvar HumanEvaluationCustomMetrics = [1, n0, _HECMu, 0, [() => HumanEvaluationCustomMetric, 0]];\nvar ImportedModelSummaryList = [1, n0, _IMSL, 0, () => ImportedModelSummary];\nvar InferenceProfileModels = [1, n0, _IPMn, 0, () => InferenceProfileModel];\nvar InferenceProfileSummaries = [1, n0, _IPSn, 0, [() => InferenceProfileSummary, 0]];\nvar MarketplaceModelEndpointSummaries = [\n 1,\n n0,\n _MMESa,\n 0,\n () => MarketplaceModelEndpointSummary,\n];\nvar MetadataAttributeSchemaList = [1, n0, _MASL, 0, [() => MetadataAttributeSchema, 0]];\nvar ModelCopyJobSummaries = [1, n0, _MCJSod, 0, () => ModelCopyJobSummary];\nvar ModelCustomizationJobSummaries = [1, n0, _MCJSode, 0, () => ModelCustomizationJobSummary];\nvar ModelImportJobSummaries = [1, n0, _MIJSod, 0, () => ModelImportJobSummary];\nvar ModelInvocationJobSummaries = [1, n0, _MIJSode, 0, [() => ModelInvocationJobSummary, 0]];\nvar Offers = [1, n0, _Of, 0, () => Offer];\nvar PromptRouterSummaries = [1, n0, _PRSr, 0, [() => PromptRouterSummary, 0]];\nvar PromptRouterTargetModels = [1, n0, _PRTMr, 0, () => PromptRouterTargetModel];\nvar ProvisionedModelSummaries = [1, n0, _PMSr, 0, () => ProvisionedModelSummary];\nvar RagConfigs = [1, n0, _RCa, 0, [() => RAGConfig, 0]];\nvar RateCard = [1, n0, _RCat, 0, () => DimensionalPriceRate];\nvar RatingScale = [1, n0, _RS, 0, () => RatingScaleItem];\nvar RequestMetadataFiltersList = [1, n0, _RMFL, 0, [() => RequestMetadataBaseFilters, 0]];\nvar RetrievalFilterList = [1, n0, _RFL, 0, [() => RetrievalFilter, 0]];\nvar TagList = [1, n0, _TL, 0, () => Tag];\nvar ValidationMetrics = [1, n0, _VMa, 0, () => ValidatorMetric];\nvar Validators = [1, n0, _Va, 0, () => Validator];\nvar RequestMetadataMap = [2, n0, _RMM, 8, 0, 0];\nvar AutomatedEvaluationCustomMetricSource = [\n 3,\n n0,\n _AECMS,\n 0,\n [_cMD],\n [[() => CustomMetricDefinition, 0]],\n];\nvar AutomatedReasoningCheckFinding = [\n 3,\n n0,\n _ARCF,\n 0,\n [_vali, _inv, _sa, _im, _tA, _tCoo, _nTo],\n [\n [() => AutomatedReasoningCheckValidFinding, 0],\n [() => AutomatedReasoningCheckInvalidFinding, 0],\n [() => AutomatedReasoningCheckSatisfiableFinding, 0],\n [() => AutomatedReasoningCheckImpossibleFinding, 0],\n [() => AutomatedReasoningCheckTranslationAmbiguousFinding, 0],\n () => AutomatedReasoningCheckTooComplexFinding,\n () => AutomatedReasoningCheckNoTranslationsFinding,\n ],\n];\nvar AutomatedReasoningPolicyAnnotation = [\n 3,\n n0,\n _ARPA,\n 0,\n [_aTd, _uTp, _dT, _aV, _uVp, _dV, _aR, _uR, _dR, _aRFNL, _uFRF, _uFSF, _iCn],\n [\n [() => AutomatedReasoningPolicyAddTypeAnnotation, 0],\n [() => AutomatedReasoningPolicyUpdateTypeAnnotation, 0],\n [() => AutomatedReasoningPolicyDeleteTypeAnnotation, 0],\n [() => AutomatedReasoningPolicyAddVariableAnnotation, 0],\n [() => AutomatedReasoningPolicyUpdateVariableAnnotation, 0],\n [() => AutomatedReasoningPolicyDeleteVariableAnnotation, 0],\n [() => AutomatedReasoningPolicyAddRuleAnnotation, 0],\n [() => AutomatedReasoningPolicyUpdateRuleAnnotation, 0],\n () => AutomatedReasoningPolicyDeleteRuleAnnotation,\n [() => AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation, 0],\n [() => AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation, 0],\n [() => AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation, 0],\n [() => AutomatedReasoningPolicyIngestContentAnnotation, 0],\n ],\n];\nvar AutomatedReasoningPolicyBuildResultAssets = [\n 3,\n n0,\n _ARPBRA,\n 0,\n [_pD, _qR, _bL, _gTC],\n [\n [() => AutomatedReasoningPolicyDefinition, 0],\n [() => AutomatedReasoningPolicyDefinitionQualityReport, 0],\n [() => AutomatedReasoningPolicyBuildLog, 0],\n [() => AutomatedReasoningPolicyGeneratedTestCases, 0],\n ],\n];\nvar AutomatedReasoningPolicyBuildStepContext = [\n 3,\n n0,\n _ARPBSC,\n 0,\n [_pl, _mu],\n [() => AutomatedReasoningPolicyPlanning, [() => AutomatedReasoningPolicyMutation, 0]],\n];\nvar AutomatedReasoningPolicyDefinitionElement = [\n 3,\n n0,\n _ARPDE,\n 0,\n [_pDV, _pDT, _pDR],\n [\n [() => AutomatedReasoningPolicyDefinitionVariable, 0],\n [() => AutomatedReasoningPolicyDefinitionType, 0],\n [() => AutomatedReasoningPolicyDefinitionRule, 0],\n ],\n];\nvar AutomatedReasoningPolicyMutation = [\n 3,\n n0,\n _ARPM,\n 0,\n [_aTd, _uTp, _dT, _aV, _uVp, _dV, _aR, _uR, _dR],\n [\n [() => AutomatedReasoningPolicyAddTypeMutation, 0],\n [() => AutomatedReasoningPolicyUpdateTypeMutation, 0],\n [() => AutomatedReasoningPolicyDeleteTypeMutation, 0],\n [() => AutomatedReasoningPolicyAddVariableMutation, 0],\n [() => AutomatedReasoningPolicyUpdateVariableMutation, 0],\n [() => AutomatedReasoningPolicyDeleteVariableMutation, 0],\n [() => AutomatedReasoningPolicyAddRuleMutation, 0],\n [() => AutomatedReasoningPolicyUpdateRuleMutation, 0],\n () => AutomatedReasoningPolicyDeleteRuleMutation,\n ],\n];\nvar AutomatedReasoningPolicyTypeValueAnnotation = [\n 3,\n n0,\n _ARPTVA,\n 0,\n [_aTV, _uTVp, _dTV],\n [\n [() => AutomatedReasoningPolicyAddTypeValue, 0],\n [() => AutomatedReasoningPolicyUpdateTypeValue, 0],\n () => AutomatedReasoningPolicyDeleteTypeValue,\n ],\n];\nvar AutomatedReasoningPolicyWorkflowTypeContent = [\n 3,\n n0,\n _ARPWTC,\n 0,\n [_doc, _pRAo],\n [\n [() => AutomatedReasoningPolicyBuildWorkflowDocumentList, 0],\n [() => AutomatedReasoningPolicyBuildWorkflowRepairContent, 0],\n ],\n];\nvar CustomizationConfig = [3, n0, _CC, 0, [_dC], [() => DistillationConfig]];\nvar EndpointConfig = [3, n0, _EC, 0, [_sMa], [() => SageMakerEndpoint]];\nvar EvaluationConfig = [\n 3,\n n0,\n _ECv,\n 0,\n [_au, _h],\n [\n [() => AutomatedEvaluationConfig, 0],\n [() => HumanEvaluationConfig, 0],\n ],\n];\nvar EvaluationDatasetLocation = [3, n0, _EDL, 0, [_sU], [0]];\nvar EvaluationInferenceConfig = [\n 3,\n n0,\n _EIC,\n 0,\n [_mo, _rCag],\n [\n [() => EvaluationModelConfigs, 0],\n [() => RagConfigs, 0],\n ],\n];\nvar EvaluationModelConfig = [\n 3,\n n0,\n _EMCv,\n 0,\n [_bM, _pIS],\n [[() => EvaluationBedrockModel, 0], () => EvaluationPrecomputedInferenceSource],\n];\nvar EvaluationPrecomputedRagSourceConfig = [\n 3,\n n0,\n _EPRSCv,\n 0,\n [_rSC, _rAGSC],\n [() => EvaluationPrecomputedRetrieveSourceConfig, () => EvaluationPrecomputedRetrieveAndGenerateSourceConfig],\n];\nvar EvaluatorModelConfig = [3, n0, _EMCva, 0, [_bEM], [() => BedrockEvaluatorModels]];\nvar InferenceProfileModelSource = [3, n0, _IPMS, 0, [_cF], [0]];\nvar InvocationLogSource = [3, n0, _ILS, 0, [_sU], [0]];\nvar KnowledgeBaseConfig = [\n 3,\n n0,\n _KBC,\n 0,\n [_rCetr, _rAGC],\n [\n [() => RetrieveConfig, 0],\n [() => RetrieveAndGenerateConfiguration, 0],\n ],\n];\nvar ModelDataSource = [3, n0, _MDS, 0, [_sDS], [() => S3DataSource]];\nvar ModelInvocationJobInputDataConfig = [\n 3,\n n0,\n _MIJIDC,\n 0,\n [_sIDC],\n [() => ModelInvocationJobS3InputDataConfig],\n];\nvar ModelInvocationJobOutputDataConfig = [\n 3,\n n0,\n _MIJODC,\n 0,\n [_sODC],\n [() => ModelInvocationJobS3OutputDataConfig],\n];\nvar RAGConfig = [\n 3,\n n0,\n _RAGCo,\n 0,\n [_kBCn, _pRSC],\n [[() => KnowledgeBaseConfig, 0], () => EvaluationPrecomputedRagSourceConfig],\n];\nvar RatingScaleItemValue = [3, n0, _RSIV, 0, [_sV, _fV], [0, 1]];\nvar RequestMetadataFilters = [\n 3,\n n0,\n _RMF,\n 0,\n [_eq, _nE, _aAn, _oAr],\n [\n [() => RequestMetadataMap, 0],\n [() => RequestMetadataMap, 0],\n [() => RequestMetadataFiltersList, 0],\n [() => RequestMetadataFiltersList, 0],\n ],\n];\nvar RerankingMetadataSelectiveModeConfiguration = [\n 3,\n n0,\n _RMSMC,\n 0,\n [_fTI, _fTE],\n [\n [() => FieldsForReranking, 0],\n [() => FieldsForReranking, 0],\n ],\n];\nvar RetrievalFilter = [\n 3,\n n0,\n _RF,\n 8,\n [_eq, _nE, _gT, _gTOE, _lTe, _lTOE, _in_, _nI, _sW, _lCi, _sCt, _aAn, _oAr],\n [\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n () => FilterAttribute,\n [() => RetrievalFilterList, 0],\n [() => RetrievalFilterList, 0],\n ],\n];\nvar BatchDeleteEvaluationJob = [\n 9,\n n0,\n _BDEJ,\n {\n [_ht]: [\"POST\", \"/evaluation-jobs/batch-delete\", 202],\n },\n () => BatchDeleteEvaluationJobRequest,\n () => BatchDeleteEvaluationJobResponse,\n];\nvar CancelAutomatedReasoningPolicyBuildWorkflow = [\n 9,\n n0,\n _CARPBW,\n {\n [_ht]: [\"POST\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/cancel\", 202],\n },\n () => CancelAutomatedReasoningPolicyBuildWorkflowRequest,\n () => CancelAutomatedReasoningPolicyBuildWorkflowResponse,\n];\nvar CreateAutomatedReasoningPolicy = [\n 9,\n n0,\n _CARP,\n {\n [_ht]: [\"POST\", \"/automated-reasoning-policies\", 200],\n },\n () => CreateAutomatedReasoningPolicyRequest,\n () => CreateAutomatedReasoningPolicyResponse,\n];\nvar CreateAutomatedReasoningPolicyTestCase = [\n 9,\n n0,\n _CARPTC,\n {\n [_ht]: [\"POST\", \"/automated-reasoning-policies/{policyArn}/test-cases\", 200],\n },\n () => CreateAutomatedReasoningPolicyTestCaseRequest,\n () => CreateAutomatedReasoningPolicyTestCaseResponse,\n];\nvar CreateAutomatedReasoningPolicyVersion = [\n 9,\n n0,\n _CARPV,\n {\n [_ht]: [\"POST\", \"/automated-reasoning-policies/{policyArn}/versions\", 200],\n },\n () => CreateAutomatedReasoningPolicyVersionRequest,\n () => CreateAutomatedReasoningPolicyVersionResponse,\n];\nvar CreateCustomModel = [\n 9,\n n0,\n _CCM,\n {\n [_ht]: [\"POST\", \"/custom-models/create-custom-model\", 202],\n },\n () => CreateCustomModelRequest,\n () => CreateCustomModelResponse,\n];\nvar CreateCustomModelDeployment = [\n 9,\n n0,\n _CCMD,\n {\n [_ht]: [\"POST\", \"/model-customization/custom-model-deployments\", 202],\n },\n () => CreateCustomModelDeploymentRequest,\n () => CreateCustomModelDeploymentResponse,\n];\nvar CreateEvaluationJob = [\n 9,\n n0,\n _CEJ,\n {\n [_ht]: [\"POST\", \"/evaluation-jobs\", 202],\n },\n () => CreateEvaluationJobRequest,\n () => CreateEvaluationJobResponse,\n];\nvar CreateFoundationModelAgreement = [\n 9,\n n0,\n _CFMA,\n {\n [_ht]: [\"POST\", \"/create-foundation-model-agreement\", 202],\n },\n () => CreateFoundationModelAgreementRequest,\n () => CreateFoundationModelAgreementResponse,\n];\nvar CreateGuardrail = [\n 9,\n n0,\n _CG,\n {\n [_ht]: [\"POST\", \"/guardrails\", 202],\n },\n () => CreateGuardrailRequest,\n () => CreateGuardrailResponse,\n];\nvar CreateGuardrailVersion = [\n 9,\n n0,\n _CGV,\n {\n [_ht]: [\"POST\", \"/guardrails/{guardrailIdentifier}\", 202],\n },\n () => CreateGuardrailVersionRequest,\n () => CreateGuardrailVersionResponse,\n];\nvar CreateInferenceProfile = [\n 9,\n n0,\n _CIP,\n {\n [_ht]: [\"POST\", \"/inference-profiles\", 201],\n },\n () => CreateInferenceProfileRequest,\n () => CreateInferenceProfileResponse,\n];\nvar CreateMarketplaceModelEndpoint = [\n 9,\n n0,\n _CMME,\n {\n [_ht]: [\"POST\", \"/marketplace-model/endpoints\", 200],\n },\n () => CreateMarketplaceModelEndpointRequest,\n () => CreateMarketplaceModelEndpointResponse,\n];\nvar CreateModelCopyJob = [\n 9,\n n0,\n _CMCJ,\n {\n [_ht]: [\"POST\", \"/model-copy-jobs\", 201],\n },\n () => CreateModelCopyJobRequest,\n () => CreateModelCopyJobResponse,\n];\nvar CreateModelCustomizationJob = [\n 9,\n n0,\n _CMCJr,\n {\n [_ht]: [\"POST\", \"/model-customization-jobs\", 201],\n },\n () => CreateModelCustomizationJobRequest,\n () => CreateModelCustomizationJobResponse,\n];\nvar CreateModelImportJob = [\n 9,\n n0,\n _CMIJ,\n {\n [_ht]: [\"POST\", \"/model-import-jobs\", 201],\n },\n () => CreateModelImportJobRequest,\n () => CreateModelImportJobResponse,\n];\nvar CreateModelInvocationJob = [\n 9,\n n0,\n _CMIJr,\n {\n [_ht]: [\"POST\", \"/model-invocation-job\", 200],\n },\n () => CreateModelInvocationJobRequest,\n () => CreateModelInvocationJobResponse,\n];\nvar CreatePromptRouter = [\n 9,\n n0,\n _CPR,\n {\n [_ht]: [\"POST\", \"/prompt-routers\", 200],\n },\n () => CreatePromptRouterRequest,\n () => CreatePromptRouterResponse,\n];\nvar CreateProvisionedModelThroughput = [\n 9,\n n0,\n _CPMT,\n {\n [_ht]: [\"POST\", \"/provisioned-model-throughput\", 201],\n },\n () => CreateProvisionedModelThroughputRequest,\n () => CreateProvisionedModelThroughputResponse,\n];\nvar DeleteAutomatedReasoningPolicy = [\n 9,\n n0,\n _DARP,\n {\n [_ht]: [\"DELETE\", \"/automated-reasoning-policies/{policyArn}\", 202],\n },\n () => DeleteAutomatedReasoningPolicyRequest,\n () => DeleteAutomatedReasoningPolicyResponse,\n];\nvar DeleteAutomatedReasoningPolicyBuildWorkflow = [\n 9,\n n0,\n _DARPBW,\n {\n [_ht]: [\"DELETE\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}\", 202],\n },\n () => DeleteAutomatedReasoningPolicyBuildWorkflowRequest,\n () => DeleteAutomatedReasoningPolicyBuildWorkflowResponse,\n];\nvar DeleteAutomatedReasoningPolicyTestCase = [\n 9,\n n0,\n _DARPTC,\n {\n [_ht]: [\"DELETE\", \"/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}\", 202],\n },\n () => DeleteAutomatedReasoningPolicyTestCaseRequest,\n () => DeleteAutomatedReasoningPolicyTestCaseResponse,\n];\nvar DeleteCustomModel = [\n 9,\n n0,\n _DCM,\n {\n [_ht]: [\"DELETE\", \"/custom-models/{modelIdentifier}\", 200],\n },\n () => DeleteCustomModelRequest,\n () => DeleteCustomModelResponse,\n];\nvar DeleteCustomModelDeployment = [\n 9,\n n0,\n _DCMD,\n {\n [_ht]: [\"DELETE\", \"/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}\", 200],\n },\n () => DeleteCustomModelDeploymentRequest,\n () => DeleteCustomModelDeploymentResponse,\n];\nvar DeleteFoundationModelAgreement = [\n 9,\n n0,\n _DFMA,\n {\n [_ht]: [\"POST\", \"/delete-foundation-model-agreement\", 202],\n },\n () => DeleteFoundationModelAgreementRequest,\n () => DeleteFoundationModelAgreementResponse,\n];\nvar DeleteGuardrail = [\n 9,\n n0,\n _DG,\n {\n [_ht]: [\"DELETE\", \"/guardrails/{guardrailIdentifier}\", 202],\n },\n () => DeleteGuardrailRequest,\n () => DeleteGuardrailResponse,\n];\nvar DeleteImportedModel = [\n 9,\n n0,\n _DIM,\n {\n [_ht]: [\"DELETE\", \"/imported-models/{modelIdentifier}\", 200],\n },\n () => DeleteImportedModelRequest,\n () => DeleteImportedModelResponse,\n];\nvar DeleteInferenceProfile = [\n 9,\n n0,\n _DIP,\n {\n [_ht]: [\"DELETE\", \"/inference-profiles/{inferenceProfileIdentifier}\", 200],\n },\n () => DeleteInferenceProfileRequest,\n () => DeleteInferenceProfileResponse,\n];\nvar DeleteMarketplaceModelEndpoint = [\n 9,\n n0,\n _DMME,\n {\n [_ht]: [\"DELETE\", \"/marketplace-model/endpoints/{endpointArn}\", 200],\n },\n () => DeleteMarketplaceModelEndpointRequest,\n () => DeleteMarketplaceModelEndpointResponse,\n];\nvar DeleteModelInvocationLoggingConfiguration = [\n 9,\n n0,\n _DMILC,\n {\n [_ht]: [\"DELETE\", \"/logging/modelinvocations\", 200],\n },\n () => DeleteModelInvocationLoggingConfigurationRequest,\n () => DeleteModelInvocationLoggingConfigurationResponse,\n];\nvar DeletePromptRouter = [\n 9,\n n0,\n _DPRe,\n {\n [_ht]: [\"DELETE\", \"/prompt-routers/{promptRouterArn}\", 200],\n },\n () => DeletePromptRouterRequest,\n () => DeletePromptRouterResponse,\n];\nvar DeleteProvisionedModelThroughput = [\n 9,\n n0,\n _DPMT,\n {\n [_ht]: [\"DELETE\", \"/provisioned-model-throughput/{provisionedModelId}\", 200],\n },\n () => DeleteProvisionedModelThroughputRequest,\n () => DeleteProvisionedModelThroughputResponse,\n];\nvar DeregisterMarketplaceModelEndpoint = [\n 9,\n n0,\n _DMMEe,\n {\n [_ht]: [\"DELETE\", \"/marketplace-model/endpoints/{endpointArn}/registration\", 200],\n },\n () => DeregisterMarketplaceModelEndpointRequest,\n () => DeregisterMarketplaceModelEndpointResponse,\n];\nvar ExportAutomatedReasoningPolicyVersion = [\n 9,\n n0,\n _EARPV,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/export\", 200],\n },\n () => ExportAutomatedReasoningPolicyVersionRequest,\n () => ExportAutomatedReasoningPolicyVersionResponse,\n];\nvar GetAutomatedReasoningPolicy = [\n 9,\n n0,\n _GARPe,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}\", 200],\n },\n () => GetAutomatedReasoningPolicyRequest,\n () => GetAutomatedReasoningPolicyResponse,\n];\nvar GetAutomatedReasoningPolicyAnnotations = [\n 9,\n n0,\n _GARPA,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations\", 200],\n },\n () => GetAutomatedReasoningPolicyAnnotationsRequest,\n () => GetAutomatedReasoningPolicyAnnotationsResponse,\n];\nvar GetAutomatedReasoningPolicyBuildWorkflow = [\n 9,\n n0,\n _GARPBW,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}\", 200],\n },\n () => GetAutomatedReasoningPolicyBuildWorkflowRequest,\n () => GetAutomatedReasoningPolicyBuildWorkflowResponse,\n];\nvar GetAutomatedReasoningPolicyBuildWorkflowResultAssets = [\n 9,\n n0,\n _GARPBWRA,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/result-assets\", 200],\n },\n () => GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest,\n () => GetAutomatedReasoningPolicyBuildWorkflowResultAssetsResponse,\n];\nvar GetAutomatedReasoningPolicyNextScenario = [\n 9,\n n0,\n _GARPNS,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/scenarios\", 200],\n },\n () => GetAutomatedReasoningPolicyNextScenarioRequest,\n () => GetAutomatedReasoningPolicyNextScenarioResponse,\n];\nvar GetAutomatedReasoningPolicyTestCase = [\n 9,\n n0,\n _GARPTC,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}\", 200],\n },\n () => GetAutomatedReasoningPolicyTestCaseRequest,\n () => GetAutomatedReasoningPolicyTestCaseResponse,\n];\nvar GetAutomatedReasoningPolicyTestResult = [\n 9,\n n0,\n _GARPTR,\n {\n [_ht]: [\n \"GET\",\n \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-cases/{testCaseId}/test-results\",\n 200,\n ],\n },\n () => GetAutomatedReasoningPolicyTestResultRequest,\n () => GetAutomatedReasoningPolicyTestResultResponse,\n];\nvar GetCustomModel = [\n 9,\n n0,\n _GCM,\n {\n [_ht]: [\"GET\", \"/custom-models/{modelIdentifier}\", 200],\n },\n () => GetCustomModelRequest,\n () => GetCustomModelResponse,\n];\nvar GetCustomModelDeployment = [\n 9,\n n0,\n _GCMD,\n {\n [_ht]: [\"GET\", \"/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}\", 200],\n },\n () => GetCustomModelDeploymentRequest,\n () => GetCustomModelDeploymentResponse,\n];\nvar GetEvaluationJob = [\n 9,\n n0,\n _GEJ,\n {\n [_ht]: [\"GET\", \"/evaluation-jobs/{jobIdentifier}\", 200],\n },\n () => GetEvaluationJobRequest,\n () => GetEvaluationJobResponse,\n];\nvar GetFoundationModel = [\n 9,\n n0,\n _GFM,\n {\n [_ht]: [\"GET\", \"/foundation-models/{modelIdentifier}\", 200],\n },\n () => GetFoundationModelRequest,\n () => GetFoundationModelResponse,\n];\nvar GetFoundationModelAvailability = [\n 9,\n n0,\n _GFMA,\n {\n [_ht]: [\"GET\", \"/foundation-model-availability/{modelId}\", 200],\n },\n () => GetFoundationModelAvailabilityRequest,\n () => GetFoundationModelAvailabilityResponse,\n];\nvar GetGuardrail = [\n 9,\n n0,\n _GG,\n {\n [_ht]: [\"GET\", \"/guardrails/{guardrailIdentifier}\", 200],\n },\n () => GetGuardrailRequest,\n () => GetGuardrailResponse,\n];\nvar GetImportedModel = [\n 9,\n n0,\n _GIM,\n {\n [_ht]: [\"GET\", \"/imported-models/{modelIdentifier}\", 200],\n },\n () => GetImportedModelRequest,\n () => GetImportedModelResponse,\n];\nvar GetInferenceProfile = [\n 9,\n n0,\n _GIP,\n {\n [_ht]: [\"GET\", \"/inference-profiles/{inferenceProfileIdentifier}\", 200],\n },\n () => GetInferenceProfileRequest,\n () => GetInferenceProfileResponse,\n];\nvar GetMarketplaceModelEndpoint = [\n 9,\n n0,\n _GMME,\n {\n [_ht]: [\"GET\", \"/marketplace-model/endpoints/{endpointArn}\", 200],\n },\n () => GetMarketplaceModelEndpointRequest,\n () => GetMarketplaceModelEndpointResponse,\n];\nvar GetModelCopyJob = [\n 9,\n n0,\n _GMCJ,\n {\n [_ht]: [\"GET\", \"/model-copy-jobs/{jobArn}\", 200],\n },\n () => GetModelCopyJobRequest,\n () => GetModelCopyJobResponse,\n];\nvar GetModelCustomizationJob = [\n 9,\n n0,\n _GMCJe,\n {\n [_ht]: [\"GET\", \"/model-customization-jobs/{jobIdentifier}\", 200],\n },\n () => GetModelCustomizationJobRequest,\n () => GetModelCustomizationJobResponse,\n];\nvar GetModelImportJob = [\n 9,\n n0,\n _GMIJ,\n {\n [_ht]: [\"GET\", \"/model-import-jobs/{jobIdentifier}\", 200],\n },\n () => GetModelImportJobRequest,\n () => GetModelImportJobResponse,\n];\nvar GetModelInvocationJob = [\n 9,\n n0,\n _GMIJe,\n {\n [_ht]: [\"GET\", \"/model-invocation-job/{jobIdentifier}\", 200],\n },\n () => GetModelInvocationJobRequest,\n () => GetModelInvocationJobResponse,\n];\nvar GetModelInvocationLoggingConfiguration = [\n 9,\n n0,\n _GMILC,\n {\n [_ht]: [\"GET\", \"/logging/modelinvocations\", 200],\n },\n () => GetModelInvocationLoggingConfigurationRequest,\n () => GetModelInvocationLoggingConfigurationResponse,\n];\nvar GetPromptRouter = [\n 9,\n n0,\n _GPR,\n {\n [_ht]: [\"GET\", \"/prompt-routers/{promptRouterArn}\", 200],\n },\n () => GetPromptRouterRequest,\n () => GetPromptRouterResponse,\n];\nvar GetProvisionedModelThroughput = [\n 9,\n n0,\n _GPMT,\n {\n [_ht]: [\"GET\", \"/provisioned-model-throughput/{provisionedModelId}\", 200],\n },\n () => GetProvisionedModelThroughputRequest,\n () => GetProvisionedModelThroughputResponse,\n];\nvar GetUseCaseForModelAccess = [\n 9,\n n0,\n _GUCFMA,\n {\n [_ht]: [\"GET\", \"/use-case-for-model-access\", 200],\n },\n () => GetUseCaseForModelAccessRequest,\n () => GetUseCaseForModelAccessResponse,\n];\nvar ListAutomatedReasoningPolicies = [\n 9,\n n0,\n _LARP,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies\", 200],\n },\n () => ListAutomatedReasoningPoliciesRequest,\n () => ListAutomatedReasoningPoliciesResponse,\n];\nvar ListAutomatedReasoningPolicyBuildWorkflows = [\n 9,\n n0,\n _LARPBW,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/build-workflows\", 200],\n },\n () => ListAutomatedReasoningPolicyBuildWorkflowsRequest,\n () => ListAutomatedReasoningPolicyBuildWorkflowsResponse,\n];\nvar ListAutomatedReasoningPolicyTestCases = [\n 9,\n n0,\n _LARPTC,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/test-cases\", 200],\n },\n () => ListAutomatedReasoningPolicyTestCasesRequest,\n () => ListAutomatedReasoningPolicyTestCasesResponse,\n];\nvar ListAutomatedReasoningPolicyTestResults = [\n 9,\n n0,\n _LARPTR,\n {\n [_ht]: [\"GET\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-results\", 200],\n },\n () => ListAutomatedReasoningPolicyTestResultsRequest,\n () => ListAutomatedReasoningPolicyTestResultsResponse,\n];\nvar ListCustomModelDeployments = [\n 9,\n n0,\n _LCMD,\n {\n [_ht]: [\"GET\", \"/model-customization/custom-model-deployments\", 200],\n },\n () => ListCustomModelDeploymentsRequest,\n () => ListCustomModelDeploymentsResponse,\n];\nvar ListCustomModels = [\n 9,\n n0,\n _LCM,\n {\n [_ht]: [\"GET\", \"/custom-models\", 200],\n },\n () => ListCustomModelsRequest,\n () => ListCustomModelsResponse,\n];\nvar ListEvaluationJobs = [\n 9,\n n0,\n _LEJ,\n {\n [_ht]: [\"GET\", \"/evaluation-jobs\", 200],\n },\n () => ListEvaluationJobsRequest,\n () => ListEvaluationJobsResponse,\n];\nvar ListFoundationModelAgreementOffers = [\n 9,\n n0,\n _LFMAO,\n {\n [_ht]: [\"GET\", \"/list-foundation-model-agreement-offers/{modelId}\", 200],\n },\n () => ListFoundationModelAgreementOffersRequest,\n () => ListFoundationModelAgreementOffersResponse,\n];\nvar ListFoundationModels = [\n 9,\n n0,\n _LFM,\n {\n [_ht]: [\"GET\", \"/foundation-models\", 200],\n },\n () => ListFoundationModelsRequest,\n () => ListFoundationModelsResponse,\n];\nvar ListGuardrails = [\n 9,\n n0,\n _LG,\n {\n [_ht]: [\"GET\", \"/guardrails\", 200],\n },\n () => ListGuardrailsRequest,\n () => ListGuardrailsResponse,\n];\nvar ListImportedModels = [\n 9,\n n0,\n _LIM,\n {\n [_ht]: [\"GET\", \"/imported-models\", 200],\n },\n () => ListImportedModelsRequest,\n () => ListImportedModelsResponse,\n];\nvar ListInferenceProfiles = [\n 9,\n n0,\n _LIP,\n {\n [_ht]: [\"GET\", \"/inference-profiles\", 200],\n },\n () => ListInferenceProfilesRequest,\n () => ListInferenceProfilesResponse,\n];\nvar ListMarketplaceModelEndpoints = [\n 9,\n n0,\n _LMME,\n {\n [_ht]: [\"GET\", \"/marketplace-model/endpoints\", 200],\n },\n () => ListMarketplaceModelEndpointsRequest,\n () => ListMarketplaceModelEndpointsResponse,\n];\nvar ListModelCopyJobs = [\n 9,\n n0,\n _LMCJ,\n {\n [_ht]: [\"GET\", \"/model-copy-jobs\", 200],\n },\n () => ListModelCopyJobsRequest,\n () => ListModelCopyJobsResponse,\n];\nvar ListModelCustomizationJobs = [\n 9,\n n0,\n _LMCJi,\n {\n [_ht]: [\"GET\", \"/model-customization-jobs\", 200],\n },\n () => ListModelCustomizationJobsRequest,\n () => ListModelCustomizationJobsResponse,\n];\nvar ListModelImportJobs = [\n 9,\n n0,\n _LMIJ,\n {\n [_ht]: [\"GET\", \"/model-import-jobs\", 200],\n },\n () => ListModelImportJobsRequest,\n () => ListModelImportJobsResponse,\n];\nvar ListModelInvocationJobs = [\n 9,\n n0,\n _LMIJi,\n {\n [_ht]: [\"GET\", \"/model-invocation-jobs\", 200],\n },\n () => ListModelInvocationJobsRequest,\n () => ListModelInvocationJobsResponse,\n];\nvar ListPromptRouters = [\n 9,\n n0,\n _LPR,\n {\n [_ht]: [\"GET\", \"/prompt-routers\", 200],\n },\n () => ListPromptRoutersRequest,\n () => ListPromptRoutersResponse,\n];\nvar ListProvisionedModelThroughputs = [\n 9,\n n0,\n _LPMT,\n {\n [_ht]: [\"GET\", \"/provisioned-model-throughputs\", 200],\n },\n () => ListProvisionedModelThroughputsRequest,\n () => ListProvisionedModelThroughputsResponse,\n];\nvar ListTagsForResource = [\n 9,\n n0,\n _LTFR,\n {\n [_ht]: [\"POST\", \"/listTagsForResource\", 200],\n },\n () => ListTagsForResourceRequest,\n () => ListTagsForResourceResponse,\n];\nvar PutModelInvocationLoggingConfiguration = [\n 9,\n n0,\n _PMILC,\n {\n [_ht]: [\"PUT\", \"/logging/modelinvocations\", 200],\n },\n () => PutModelInvocationLoggingConfigurationRequest,\n () => PutModelInvocationLoggingConfigurationResponse,\n];\nvar PutUseCaseForModelAccess = [\n 9,\n n0,\n _PUCFMA,\n {\n [_ht]: [\"POST\", \"/use-case-for-model-access\", 201],\n },\n () => PutUseCaseForModelAccessRequest,\n () => PutUseCaseForModelAccessResponse,\n];\nvar RegisterMarketplaceModelEndpoint = [\n 9,\n n0,\n _RMME,\n {\n [_ht]: [\"POST\", \"/marketplace-model/endpoints/{endpointIdentifier}/registration\", 200],\n },\n () => RegisterMarketplaceModelEndpointRequest,\n () => RegisterMarketplaceModelEndpointResponse,\n];\nvar StartAutomatedReasoningPolicyBuildWorkflow = [\n 9,\n n0,\n _SARPBW,\n {\n [_ht]: [\"POST\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowType}/start\", 200],\n },\n () => StartAutomatedReasoningPolicyBuildWorkflowRequest,\n () => StartAutomatedReasoningPolicyBuildWorkflowResponse,\n];\nvar StartAutomatedReasoningPolicyTestWorkflow = [\n 9,\n n0,\n _SARPTW,\n {\n [_ht]: [\"POST\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-workflows\", 200],\n },\n () => StartAutomatedReasoningPolicyTestWorkflowRequest,\n () => StartAutomatedReasoningPolicyTestWorkflowResponse,\n];\nvar StopEvaluationJob = [\n 9,\n n0,\n _SEJ,\n {\n [_ht]: [\"POST\", \"/evaluation-job/{jobIdentifier}/stop\", 200],\n },\n () => StopEvaluationJobRequest,\n () => StopEvaluationJobResponse,\n];\nvar StopModelCustomizationJob = [\n 9,\n n0,\n _SMCJ,\n {\n [_ht]: [\"POST\", \"/model-customization-jobs/{jobIdentifier}/stop\", 200],\n },\n () => StopModelCustomizationJobRequest,\n () => StopModelCustomizationJobResponse,\n];\nvar StopModelInvocationJob = [\n 9,\n n0,\n _SMIJ,\n {\n [_ht]: [\"POST\", \"/model-invocation-job/{jobIdentifier}/stop\", 200],\n },\n () => StopModelInvocationJobRequest,\n () => StopModelInvocationJobResponse,\n];\nvar TagResource = [\n 9,\n n0,\n _TR,\n {\n [_ht]: [\"POST\", \"/tagResource\", 200],\n },\n () => TagResourceRequest,\n () => TagResourceResponse,\n];\nvar UntagResource = [\n 9,\n n0,\n _UR,\n {\n [_ht]: [\"POST\", \"/untagResource\", 200],\n },\n () => UntagResourceRequest,\n () => UntagResourceResponse,\n];\nvar UpdateAutomatedReasoningPolicy = [\n 9,\n n0,\n _UARP,\n {\n [_ht]: [\"PATCH\", \"/automated-reasoning-policies/{policyArn}\", 200],\n },\n () => UpdateAutomatedReasoningPolicyRequest,\n () => UpdateAutomatedReasoningPolicyResponse,\n];\nvar UpdateAutomatedReasoningPolicyAnnotations = [\n 9,\n n0,\n _UARPA,\n {\n [_ht]: [\"PATCH\", \"/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations\", 200],\n },\n () => UpdateAutomatedReasoningPolicyAnnotationsRequest,\n () => UpdateAutomatedReasoningPolicyAnnotationsResponse,\n];\nvar UpdateAutomatedReasoningPolicyTestCase = [\n 9,\n n0,\n _UARPTC,\n {\n [_ht]: [\"PATCH\", \"/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}\", 200],\n },\n () => UpdateAutomatedReasoningPolicyTestCaseRequest,\n () => UpdateAutomatedReasoningPolicyTestCaseResponse,\n];\nvar UpdateGuardrail = [\n 9,\n n0,\n _UG,\n {\n [_ht]: [\"PUT\", \"/guardrails/{guardrailIdentifier}\", 202],\n },\n () => UpdateGuardrailRequest,\n () => UpdateGuardrailResponse,\n];\nvar UpdateMarketplaceModelEndpoint = [\n 9,\n n0,\n _UMME,\n {\n [_ht]: [\"PATCH\", \"/marketplace-model/endpoints/{endpointArn}\", 200],\n },\n () => UpdateMarketplaceModelEndpointRequest,\n () => UpdateMarketplaceModelEndpointResponse,\n];\nvar UpdateProvisionedModelThroughput = [\n 9,\n n0,\n _UPMT,\n {\n [_ht]: [\"PATCH\", \"/provisioned-model-throughput/{provisionedModelId}\", 200],\n },\n () => UpdateProvisionedModelThroughputRequest,\n () => UpdateProvisionedModelThroughputResponse,\n];\n\nclass BatchDeleteEvaluationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"BatchDeleteEvaluationJob\", {})\n .n(\"BedrockClient\", \"BatchDeleteEvaluationJobCommand\")\n .sc(BatchDeleteEvaluationJob)\n .build() {\n}\n\nclass CancelAutomatedReasoningPolicyBuildWorkflowCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CancelAutomatedReasoningPolicyBuildWorkflow\", {})\n .n(\"BedrockClient\", \"CancelAutomatedReasoningPolicyBuildWorkflowCommand\")\n .sc(CancelAutomatedReasoningPolicyBuildWorkflow)\n .build() {\n}\n\nclass CreateAutomatedReasoningPolicyCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateAutomatedReasoningPolicy\", {})\n .n(\"BedrockClient\", \"CreateAutomatedReasoningPolicyCommand\")\n .sc(CreateAutomatedReasoningPolicy)\n .build() {\n}\n\nclass CreateAutomatedReasoningPolicyTestCaseCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateAutomatedReasoningPolicyTestCase\", {})\n .n(\"BedrockClient\", \"CreateAutomatedReasoningPolicyTestCaseCommand\")\n .sc(CreateAutomatedReasoningPolicyTestCase)\n .build() {\n}\n\nclass CreateAutomatedReasoningPolicyVersionCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateAutomatedReasoningPolicyVersion\", {})\n .n(\"BedrockClient\", \"CreateAutomatedReasoningPolicyVersionCommand\")\n .sc(CreateAutomatedReasoningPolicyVersion)\n .build() {\n}\n\nclass CreateCustomModelCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateCustomModel\", {})\n .n(\"BedrockClient\", \"CreateCustomModelCommand\")\n .sc(CreateCustomModel)\n .build() {\n}\n\nclass CreateCustomModelDeploymentCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateCustomModelDeployment\", {})\n .n(\"BedrockClient\", \"CreateCustomModelDeploymentCommand\")\n .sc(CreateCustomModelDeployment)\n .build() {\n}\n\nclass CreateEvaluationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateEvaluationJob\", {})\n .n(\"BedrockClient\", \"CreateEvaluationJobCommand\")\n .sc(CreateEvaluationJob)\n .build() {\n}\n\nclass CreateFoundationModelAgreementCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateFoundationModelAgreement\", {})\n .n(\"BedrockClient\", \"CreateFoundationModelAgreementCommand\")\n .sc(CreateFoundationModelAgreement)\n .build() {\n}\n\nclass CreateGuardrailCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateGuardrail\", {})\n .n(\"BedrockClient\", \"CreateGuardrailCommand\")\n .sc(CreateGuardrail)\n .build() {\n}\n\nclass CreateGuardrailVersionCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateGuardrailVersion\", {})\n .n(\"BedrockClient\", \"CreateGuardrailVersionCommand\")\n .sc(CreateGuardrailVersion)\n .build() {\n}\n\nclass CreateInferenceProfileCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateInferenceProfile\", {})\n .n(\"BedrockClient\", \"CreateInferenceProfileCommand\")\n .sc(CreateInferenceProfile)\n .build() {\n}\n\nclass CreateMarketplaceModelEndpointCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateMarketplaceModelEndpoint\", {})\n .n(\"BedrockClient\", \"CreateMarketplaceModelEndpointCommand\")\n .sc(CreateMarketplaceModelEndpoint)\n .build() {\n}\n\nclass CreateModelCopyJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateModelCopyJob\", {})\n .n(\"BedrockClient\", \"CreateModelCopyJobCommand\")\n .sc(CreateModelCopyJob)\n .build() {\n}\n\nclass CreateModelCustomizationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateModelCustomizationJob\", {})\n .n(\"BedrockClient\", \"CreateModelCustomizationJobCommand\")\n .sc(CreateModelCustomizationJob)\n .build() {\n}\n\nclass CreateModelImportJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateModelImportJob\", {})\n .n(\"BedrockClient\", \"CreateModelImportJobCommand\")\n .sc(CreateModelImportJob)\n .build() {\n}\n\nclass CreateModelInvocationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateModelInvocationJob\", {})\n .n(\"BedrockClient\", \"CreateModelInvocationJobCommand\")\n .sc(CreateModelInvocationJob)\n .build() {\n}\n\nclass CreatePromptRouterCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreatePromptRouter\", {})\n .n(\"BedrockClient\", \"CreatePromptRouterCommand\")\n .sc(CreatePromptRouter)\n .build() {\n}\n\nclass CreateProvisionedModelThroughputCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"CreateProvisionedModelThroughput\", {})\n .n(\"BedrockClient\", \"CreateProvisionedModelThroughputCommand\")\n .sc(CreateProvisionedModelThroughput)\n .build() {\n}\n\nclass DeleteAutomatedReasoningPolicyBuildWorkflowCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteAutomatedReasoningPolicyBuildWorkflow\", {})\n .n(\"BedrockClient\", \"DeleteAutomatedReasoningPolicyBuildWorkflowCommand\")\n .sc(DeleteAutomatedReasoningPolicyBuildWorkflow)\n .build() {\n}\n\nclass DeleteAutomatedReasoningPolicyCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteAutomatedReasoningPolicy\", {})\n .n(\"BedrockClient\", \"DeleteAutomatedReasoningPolicyCommand\")\n .sc(DeleteAutomatedReasoningPolicy)\n .build() {\n}\n\nclass DeleteAutomatedReasoningPolicyTestCaseCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteAutomatedReasoningPolicyTestCase\", {})\n .n(\"BedrockClient\", \"DeleteAutomatedReasoningPolicyTestCaseCommand\")\n .sc(DeleteAutomatedReasoningPolicyTestCase)\n .build() {\n}\n\nclass DeleteCustomModelCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteCustomModel\", {})\n .n(\"BedrockClient\", \"DeleteCustomModelCommand\")\n .sc(DeleteCustomModel)\n .build() {\n}\n\nclass DeleteCustomModelDeploymentCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteCustomModelDeployment\", {})\n .n(\"BedrockClient\", \"DeleteCustomModelDeploymentCommand\")\n .sc(DeleteCustomModelDeployment)\n .build() {\n}\n\nclass DeleteFoundationModelAgreementCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteFoundationModelAgreement\", {})\n .n(\"BedrockClient\", \"DeleteFoundationModelAgreementCommand\")\n .sc(DeleteFoundationModelAgreement)\n .build() {\n}\n\nclass DeleteGuardrailCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteGuardrail\", {})\n .n(\"BedrockClient\", \"DeleteGuardrailCommand\")\n .sc(DeleteGuardrail)\n .build() {\n}\n\nclass DeleteImportedModelCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteImportedModel\", {})\n .n(\"BedrockClient\", \"DeleteImportedModelCommand\")\n .sc(DeleteImportedModel)\n .build() {\n}\n\nclass DeleteInferenceProfileCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteInferenceProfile\", {})\n .n(\"BedrockClient\", \"DeleteInferenceProfileCommand\")\n .sc(DeleteInferenceProfile)\n .build() {\n}\n\nclass DeleteMarketplaceModelEndpointCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteMarketplaceModelEndpoint\", {})\n .n(\"BedrockClient\", \"DeleteMarketplaceModelEndpointCommand\")\n .sc(DeleteMarketplaceModelEndpoint)\n .build() {\n}\n\nclass DeleteModelInvocationLoggingConfigurationCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteModelInvocationLoggingConfiguration\", {})\n .n(\"BedrockClient\", \"DeleteModelInvocationLoggingConfigurationCommand\")\n .sc(DeleteModelInvocationLoggingConfiguration)\n .build() {\n}\n\nclass DeletePromptRouterCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeletePromptRouter\", {})\n .n(\"BedrockClient\", \"DeletePromptRouterCommand\")\n .sc(DeletePromptRouter)\n .build() {\n}\n\nclass DeleteProvisionedModelThroughputCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeleteProvisionedModelThroughput\", {})\n .n(\"BedrockClient\", \"DeleteProvisionedModelThroughputCommand\")\n .sc(DeleteProvisionedModelThroughput)\n .build() {\n}\n\nclass DeregisterMarketplaceModelEndpointCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"DeregisterMarketplaceModelEndpoint\", {})\n .n(\"BedrockClient\", \"DeregisterMarketplaceModelEndpointCommand\")\n .sc(DeregisterMarketplaceModelEndpoint)\n .build() {\n}\n\nclass ExportAutomatedReasoningPolicyVersionCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ExportAutomatedReasoningPolicyVersion\", {})\n .n(\"BedrockClient\", \"ExportAutomatedReasoningPolicyVersionCommand\")\n .sc(ExportAutomatedReasoningPolicyVersion)\n .build() {\n}\n\nclass GetAutomatedReasoningPolicyAnnotationsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetAutomatedReasoningPolicyAnnotations\", {})\n .n(\"BedrockClient\", \"GetAutomatedReasoningPolicyAnnotationsCommand\")\n .sc(GetAutomatedReasoningPolicyAnnotations)\n .build() {\n}\n\nclass GetAutomatedReasoningPolicyBuildWorkflowCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetAutomatedReasoningPolicyBuildWorkflow\", {})\n .n(\"BedrockClient\", \"GetAutomatedReasoningPolicyBuildWorkflowCommand\")\n .sc(GetAutomatedReasoningPolicyBuildWorkflow)\n .build() {\n}\n\nclass GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetAutomatedReasoningPolicyBuildWorkflowResultAssets\", {})\n .n(\"BedrockClient\", \"GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand\")\n .sc(GetAutomatedReasoningPolicyBuildWorkflowResultAssets)\n .build() {\n}\n\nclass GetAutomatedReasoningPolicyCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetAutomatedReasoningPolicy\", {})\n .n(\"BedrockClient\", \"GetAutomatedReasoningPolicyCommand\")\n .sc(GetAutomatedReasoningPolicy)\n .build() {\n}\n\nclass GetAutomatedReasoningPolicyNextScenarioCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetAutomatedReasoningPolicyNextScenario\", {})\n .n(\"BedrockClient\", \"GetAutomatedReasoningPolicyNextScenarioCommand\")\n .sc(GetAutomatedReasoningPolicyNextScenario)\n .build() {\n}\n\nclass GetAutomatedReasoningPolicyTestCaseCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetAutomatedReasoningPolicyTestCase\", {})\n .n(\"BedrockClient\", \"GetAutomatedReasoningPolicyTestCaseCommand\")\n .sc(GetAutomatedReasoningPolicyTestCase)\n .build() {\n}\n\nclass GetAutomatedReasoningPolicyTestResultCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetAutomatedReasoningPolicyTestResult\", {})\n .n(\"BedrockClient\", \"GetAutomatedReasoningPolicyTestResultCommand\")\n .sc(GetAutomatedReasoningPolicyTestResult)\n .build() {\n}\n\nclass GetCustomModelCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetCustomModel\", {})\n .n(\"BedrockClient\", \"GetCustomModelCommand\")\n .sc(GetCustomModel)\n .build() {\n}\n\nclass GetCustomModelDeploymentCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetCustomModelDeployment\", {})\n .n(\"BedrockClient\", \"GetCustomModelDeploymentCommand\")\n .sc(GetCustomModelDeployment)\n .build() {\n}\n\nclass GetEvaluationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetEvaluationJob\", {})\n .n(\"BedrockClient\", \"GetEvaluationJobCommand\")\n .sc(GetEvaluationJob)\n .build() {\n}\n\nclass GetFoundationModelAvailabilityCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetFoundationModelAvailability\", {})\n .n(\"BedrockClient\", \"GetFoundationModelAvailabilityCommand\")\n .sc(GetFoundationModelAvailability)\n .build() {\n}\n\nclass GetFoundationModelCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetFoundationModel\", {})\n .n(\"BedrockClient\", \"GetFoundationModelCommand\")\n .sc(GetFoundationModel)\n .build() {\n}\n\nclass GetGuardrailCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetGuardrail\", {})\n .n(\"BedrockClient\", \"GetGuardrailCommand\")\n .sc(GetGuardrail)\n .build() {\n}\n\nclass GetImportedModelCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetImportedModel\", {})\n .n(\"BedrockClient\", \"GetImportedModelCommand\")\n .sc(GetImportedModel)\n .build() {\n}\n\nclass GetInferenceProfileCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetInferenceProfile\", {})\n .n(\"BedrockClient\", \"GetInferenceProfileCommand\")\n .sc(GetInferenceProfile)\n .build() {\n}\n\nclass GetMarketplaceModelEndpointCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetMarketplaceModelEndpoint\", {})\n .n(\"BedrockClient\", \"GetMarketplaceModelEndpointCommand\")\n .sc(GetMarketplaceModelEndpoint)\n .build() {\n}\n\nclass GetModelCopyJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetModelCopyJob\", {})\n .n(\"BedrockClient\", \"GetModelCopyJobCommand\")\n .sc(GetModelCopyJob)\n .build() {\n}\n\nclass GetModelCustomizationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetModelCustomizationJob\", {})\n .n(\"BedrockClient\", \"GetModelCustomizationJobCommand\")\n .sc(GetModelCustomizationJob)\n .build() {\n}\n\nclass GetModelImportJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetModelImportJob\", {})\n .n(\"BedrockClient\", \"GetModelImportJobCommand\")\n .sc(GetModelImportJob)\n .build() {\n}\n\nclass GetModelInvocationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetModelInvocationJob\", {})\n .n(\"BedrockClient\", \"GetModelInvocationJobCommand\")\n .sc(GetModelInvocationJob)\n .build() {\n}\n\nclass GetModelInvocationLoggingConfigurationCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetModelInvocationLoggingConfiguration\", {})\n .n(\"BedrockClient\", \"GetModelInvocationLoggingConfigurationCommand\")\n .sc(GetModelInvocationLoggingConfiguration)\n .build() {\n}\n\nclass GetPromptRouterCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetPromptRouter\", {})\n .n(\"BedrockClient\", \"GetPromptRouterCommand\")\n .sc(GetPromptRouter)\n .build() {\n}\n\nclass GetProvisionedModelThroughputCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetProvisionedModelThroughput\", {})\n .n(\"BedrockClient\", \"GetProvisionedModelThroughputCommand\")\n .sc(GetProvisionedModelThroughput)\n .build() {\n}\n\nclass GetUseCaseForModelAccessCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"GetUseCaseForModelAccess\", {})\n .n(\"BedrockClient\", \"GetUseCaseForModelAccessCommand\")\n .sc(GetUseCaseForModelAccess)\n .build() {\n}\n\nclass ListAutomatedReasoningPoliciesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListAutomatedReasoningPolicies\", {})\n .n(\"BedrockClient\", \"ListAutomatedReasoningPoliciesCommand\")\n .sc(ListAutomatedReasoningPolicies)\n .build() {\n}\n\nclass ListAutomatedReasoningPolicyBuildWorkflowsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListAutomatedReasoningPolicyBuildWorkflows\", {})\n .n(\"BedrockClient\", \"ListAutomatedReasoningPolicyBuildWorkflowsCommand\")\n .sc(ListAutomatedReasoningPolicyBuildWorkflows)\n .build() {\n}\n\nclass ListAutomatedReasoningPolicyTestCasesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListAutomatedReasoningPolicyTestCases\", {})\n .n(\"BedrockClient\", \"ListAutomatedReasoningPolicyTestCasesCommand\")\n .sc(ListAutomatedReasoningPolicyTestCases)\n .build() {\n}\n\nclass ListAutomatedReasoningPolicyTestResultsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListAutomatedReasoningPolicyTestResults\", {})\n .n(\"BedrockClient\", \"ListAutomatedReasoningPolicyTestResultsCommand\")\n .sc(ListAutomatedReasoningPolicyTestResults)\n .build() {\n}\n\nclass ListCustomModelDeploymentsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListCustomModelDeployments\", {})\n .n(\"BedrockClient\", \"ListCustomModelDeploymentsCommand\")\n .sc(ListCustomModelDeployments)\n .build() {\n}\n\nclass ListCustomModelsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListCustomModels\", {})\n .n(\"BedrockClient\", \"ListCustomModelsCommand\")\n .sc(ListCustomModels)\n .build() {\n}\n\nclass ListEvaluationJobsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListEvaluationJobs\", {})\n .n(\"BedrockClient\", \"ListEvaluationJobsCommand\")\n .sc(ListEvaluationJobs)\n .build() {\n}\n\nclass ListFoundationModelAgreementOffersCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListFoundationModelAgreementOffers\", {})\n .n(\"BedrockClient\", \"ListFoundationModelAgreementOffersCommand\")\n .sc(ListFoundationModelAgreementOffers)\n .build() {\n}\n\nclass ListFoundationModelsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListFoundationModels\", {})\n .n(\"BedrockClient\", \"ListFoundationModelsCommand\")\n .sc(ListFoundationModels)\n .build() {\n}\n\nclass ListGuardrailsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListGuardrails\", {})\n .n(\"BedrockClient\", \"ListGuardrailsCommand\")\n .sc(ListGuardrails)\n .build() {\n}\n\nclass ListImportedModelsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListImportedModels\", {})\n .n(\"BedrockClient\", \"ListImportedModelsCommand\")\n .sc(ListImportedModels)\n .build() {\n}\n\nclass ListInferenceProfilesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListInferenceProfiles\", {})\n .n(\"BedrockClient\", \"ListInferenceProfilesCommand\")\n .sc(ListInferenceProfiles)\n .build() {\n}\n\nclass ListMarketplaceModelEndpointsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListMarketplaceModelEndpoints\", {})\n .n(\"BedrockClient\", \"ListMarketplaceModelEndpointsCommand\")\n .sc(ListMarketplaceModelEndpoints)\n .build() {\n}\n\nclass ListModelCopyJobsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListModelCopyJobs\", {})\n .n(\"BedrockClient\", \"ListModelCopyJobsCommand\")\n .sc(ListModelCopyJobs)\n .build() {\n}\n\nclass ListModelCustomizationJobsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListModelCustomizationJobs\", {})\n .n(\"BedrockClient\", \"ListModelCustomizationJobsCommand\")\n .sc(ListModelCustomizationJobs)\n .build() {\n}\n\nclass ListModelImportJobsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListModelImportJobs\", {})\n .n(\"BedrockClient\", \"ListModelImportJobsCommand\")\n .sc(ListModelImportJobs)\n .build() {\n}\n\nclass ListModelInvocationJobsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListModelInvocationJobs\", {})\n .n(\"BedrockClient\", \"ListModelInvocationJobsCommand\")\n .sc(ListModelInvocationJobs)\n .build() {\n}\n\nclass ListPromptRoutersCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListPromptRouters\", {})\n .n(\"BedrockClient\", \"ListPromptRoutersCommand\")\n .sc(ListPromptRouters)\n .build() {\n}\n\nclass ListProvisionedModelThroughputsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListProvisionedModelThroughputs\", {})\n .n(\"BedrockClient\", \"ListProvisionedModelThroughputsCommand\")\n .sc(ListProvisionedModelThroughputs)\n .build() {\n}\n\nclass ListTagsForResourceCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"ListTagsForResource\", {})\n .n(\"BedrockClient\", \"ListTagsForResourceCommand\")\n .sc(ListTagsForResource)\n .build() {\n}\n\nclass PutModelInvocationLoggingConfigurationCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"PutModelInvocationLoggingConfiguration\", {})\n .n(\"BedrockClient\", \"PutModelInvocationLoggingConfigurationCommand\")\n .sc(PutModelInvocationLoggingConfiguration)\n .build() {\n}\n\nclass PutUseCaseForModelAccessCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"PutUseCaseForModelAccess\", {})\n .n(\"BedrockClient\", \"PutUseCaseForModelAccessCommand\")\n .sc(PutUseCaseForModelAccess)\n .build() {\n}\n\nclass RegisterMarketplaceModelEndpointCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"RegisterMarketplaceModelEndpoint\", {})\n .n(\"BedrockClient\", \"RegisterMarketplaceModelEndpointCommand\")\n .sc(RegisterMarketplaceModelEndpoint)\n .build() {\n}\n\nclass StartAutomatedReasoningPolicyBuildWorkflowCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"StartAutomatedReasoningPolicyBuildWorkflow\", {})\n .n(\"BedrockClient\", \"StartAutomatedReasoningPolicyBuildWorkflowCommand\")\n .sc(StartAutomatedReasoningPolicyBuildWorkflow)\n .build() {\n}\n\nclass StartAutomatedReasoningPolicyTestWorkflowCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"StartAutomatedReasoningPolicyTestWorkflow\", {})\n .n(\"BedrockClient\", \"StartAutomatedReasoningPolicyTestWorkflowCommand\")\n .sc(StartAutomatedReasoningPolicyTestWorkflow)\n .build() {\n}\n\nclass StopEvaluationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"StopEvaluationJob\", {})\n .n(\"BedrockClient\", \"StopEvaluationJobCommand\")\n .sc(StopEvaluationJob)\n .build() {\n}\n\nclass StopModelCustomizationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"StopModelCustomizationJob\", {})\n .n(\"BedrockClient\", \"StopModelCustomizationJobCommand\")\n .sc(StopModelCustomizationJob)\n .build() {\n}\n\nclass StopModelInvocationJobCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"StopModelInvocationJob\", {})\n .n(\"BedrockClient\", \"StopModelInvocationJobCommand\")\n .sc(StopModelInvocationJob)\n .build() {\n}\n\nclass TagResourceCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"TagResource\", {})\n .n(\"BedrockClient\", \"TagResourceCommand\")\n .sc(TagResource)\n .build() {\n}\n\nclass UntagResourceCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"UntagResource\", {})\n .n(\"BedrockClient\", \"UntagResourceCommand\")\n .sc(UntagResource)\n .build() {\n}\n\nclass UpdateAutomatedReasoningPolicyAnnotationsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"UpdateAutomatedReasoningPolicyAnnotations\", {})\n .n(\"BedrockClient\", \"UpdateAutomatedReasoningPolicyAnnotationsCommand\")\n .sc(UpdateAutomatedReasoningPolicyAnnotations)\n .build() {\n}\n\nclass UpdateAutomatedReasoningPolicyCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"UpdateAutomatedReasoningPolicy\", {})\n .n(\"BedrockClient\", \"UpdateAutomatedReasoningPolicyCommand\")\n .sc(UpdateAutomatedReasoningPolicy)\n .build() {\n}\n\nclass UpdateAutomatedReasoningPolicyTestCaseCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"UpdateAutomatedReasoningPolicyTestCase\", {})\n .n(\"BedrockClient\", \"UpdateAutomatedReasoningPolicyTestCaseCommand\")\n .sc(UpdateAutomatedReasoningPolicyTestCase)\n .build() {\n}\n\nclass UpdateGuardrailCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"UpdateGuardrail\", {})\n .n(\"BedrockClient\", \"UpdateGuardrailCommand\")\n .sc(UpdateGuardrail)\n .build() {\n}\n\nclass UpdateMarketplaceModelEndpointCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"UpdateMarketplaceModelEndpoint\", {})\n .n(\"BedrockClient\", \"UpdateMarketplaceModelEndpointCommand\")\n .sc(UpdateMarketplaceModelEndpoint)\n .build() {\n}\n\nclass UpdateProvisionedModelThroughputCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockControlPlaneService\", \"UpdateProvisionedModelThroughput\", {})\n .n(\"BedrockClient\", \"UpdateProvisionedModelThroughputCommand\")\n .sc(UpdateProvisionedModelThroughput)\n .build() {\n}\n\nconst commands = {\n BatchDeleteEvaluationJobCommand,\n CancelAutomatedReasoningPolicyBuildWorkflowCommand,\n CreateAutomatedReasoningPolicyCommand,\n CreateAutomatedReasoningPolicyTestCaseCommand,\n CreateAutomatedReasoningPolicyVersionCommand,\n CreateCustomModelCommand,\n CreateCustomModelDeploymentCommand,\n CreateEvaluationJobCommand,\n CreateFoundationModelAgreementCommand,\n CreateGuardrailCommand,\n CreateGuardrailVersionCommand,\n CreateInferenceProfileCommand,\n CreateMarketplaceModelEndpointCommand,\n CreateModelCopyJobCommand,\n CreateModelCustomizationJobCommand,\n CreateModelImportJobCommand,\n CreateModelInvocationJobCommand,\n CreatePromptRouterCommand,\n CreateProvisionedModelThroughputCommand,\n DeleteAutomatedReasoningPolicyCommand,\n DeleteAutomatedReasoningPolicyBuildWorkflowCommand,\n DeleteAutomatedReasoningPolicyTestCaseCommand,\n DeleteCustomModelCommand,\n DeleteCustomModelDeploymentCommand,\n DeleteFoundationModelAgreementCommand,\n DeleteGuardrailCommand,\n DeleteImportedModelCommand,\n DeleteInferenceProfileCommand,\n DeleteMarketplaceModelEndpointCommand,\n DeleteModelInvocationLoggingConfigurationCommand,\n DeletePromptRouterCommand,\n DeleteProvisionedModelThroughputCommand,\n DeregisterMarketplaceModelEndpointCommand,\n ExportAutomatedReasoningPolicyVersionCommand,\n GetAutomatedReasoningPolicyCommand,\n GetAutomatedReasoningPolicyAnnotationsCommand,\n GetAutomatedReasoningPolicyBuildWorkflowCommand,\n GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand,\n GetAutomatedReasoningPolicyNextScenarioCommand,\n GetAutomatedReasoningPolicyTestCaseCommand,\n GetAutomatedReasoningPolicyTestResultCommand,\n GetCustomModelCommand,\n GetCustomModelDeploymentCommand,\n GetEvaluationJobCommand,\n GetFoundationModelCommand,\n GetFoundationModelAvailabilityCommand,\n GetGuardrailCommand,\n GetImportedModelCommand,\n GetInferenceProfileCommand,\n GetMarketplaceModelEndpointCommand,\n GetModelCopyJobCommand,\n GetModelCustomizationJobCommand,\n GetModelImportJobCommand,\n GetModelInvocationJobCommand,\n GetModelInvocationLoggingConfigurationCommand,\n GetPromptRouterCommand,\n GetProvisionedModelThroughputCommand,\n GetUseCaseForModelAccessCommand,\n ListAutomatedReasoningPoliciesCommand,\n ListAutomatedReasoningPolicyBuildWorkflowsCommand,\n ListAutomatedReasoningPolicyTestCasesCommand,\n ListAutomatedReasoningPolicyTestResultsCommand,\n ListCustomModelDeploymentsCommand,\n ListCustomModelsCommand,\n ListEvaluationJobsCommand,\n ListFoundationModelAgreementOffersCommand,\n ListFoundationModelsCommand,\n ListGuardrailsCommand,\n ListImportedModelsCommand,\n ListInferenceProfilesCommand,\n ListMarketplaceModelEndpointsCommand,\n ListModelCopyJobsCommand,\n ListModelCustomizationJobsCommand,\n ListModelImportJobsCommand,\n ListModelInvocationJobsCommand,\n ListPromptRoutersCommand,\n ListProvisionedModelThroughputsCommand,\n ListTagsForResourceCommand,\n PutModelInvocationLoggingConfigurationCommand,\n PutUseCaseForModelAccessCommand,\n RegisterMarketplaceModelEndpointCommand,\n StartAutomatedReasoningPolicyBuildWorkflowCommand,\n StartAutomatedReasoningPolicyTestWorkflowCommand,\n StopEvaluationJobCommand,\n StopModelCustomizationJobCommand,\n StopModelInvocationJobCommand,\n TagResourceCommand,\n UntagResourceCommand,\n UpdateAutomatedReasoningPolicyCommand,\n UpdateAutomatedReasoningPolicyAnnotationsCommand,\n UpdateAutomatedReasoningPolicyTestCaseCommand,\n UpdateGuardrailCommand,\n UpdateMarketplaceModelEndpointCommand,\n UpdateProvisionedModelThroughputCommand,\n};\nclass Bedrock extends BedrockClient {\n}\nsmithyClient.createAggregatedClient(commands, Bedrock);\n\nconst paginateListAutomatedReasoningPolicies = core.createPaginator(BedrockClient, ListAutomatedReasoningPoliciesCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListAutomatedReasoningPolicyBuildWorkflows = core.createPaginator(BedrockClient, ListAutomatedReasoningPolicyBuildWorkflowsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListAutomatedReasoningPolicyTestCases = core.createPaginator(BedrockClient, ListAutomatedReasoningPolicyTestCasesCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListAutomatedReasoningPolicyTestResults = core.createPaginator(BedrockClient, ListAutomatedReasoningPolicyTestResultsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListCustomModelDeployments = core.createPaginator(BedrockClient, ListCustomModelDeploymentsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListCustomModels = core.createPaginator(BedrockClient, ListCustomModelsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListEvaluationJobs = core.createPaginator(BedrockClient, ListEvaluationJobsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListGuardrails = core.createPaginator(BedrockClient, ListGuardrailsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListImportedModels = core.createPaginator(BedrockClient, ListImportedModelsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListInferenceProfiles = core.createPaginator(BedrockClient, ListInferenceProfilesCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListMarketplaceModelEndpoints = core.createPaginator(BedrockClient, ListMarketplaceModelEndpointsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListModelCopyJobs = core.createPaginator(BedrockClient, ListModelCopyJobsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListModelCustomizationJobs = core.createPaginator(BedrockClient, ListModelCustomizationJobsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListModelImportJobs = core.createPaginator(BedrockClient, ListModelImportJobsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListModelInvocationJobs = core.createPaginator(BedrockClient, ListModelInvocationJobsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListPromptRouters = core.createPaginator(BedrockClient, ListPromptRoutersCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst paginateListProvisionedModelThroughputs = core.createPaginator(BedrockClient, ListProvisionedModelThroughputsCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst AgreementStatus = {\n AVAILABLE: \"AVAILABLE\",\n ERROR: \"ERROR\",\n NOT_AVAILABLE: \"NOT_AVAILABLE\",\n PENDING: \"PENDING\",\n};\nconst AutomatedReasoningCheckResult = {\n IMPOSSIBLE: \"IMPOSSIBLE\",\n INVALID: \"INVALID\",\n NO_TRANSLATION: \"NO_TRANSLATION\",\n SATISFIABLE: \"SATISFIABLE\",\n TOO_COMPLEX: \"TOO_COMPLEX\",\n TRANSLATION_AMBIGUOUS: \"TRANSLATION_AMBIGUOUS\",\n VALID: \"VALID\",\n};\nconst AutomatedReasoningPolicyBuildWorkflowType = {\n IMPORT_POLICY: \"IMPORT_POLICY\",\n INGEST_CONTENT: \"INGEST_CONTENT\",\n REFINE_POLICY: \"REFINE_POLICY\",\n};\nconst AutomatedReasoningPolicyBuildDocumentContentType = {\n PDF: \"pdf\",\n TEXT: \"txt\",\n};\nconst AutomatedReasoningPolicyBuildWorkflowStatus = {\n BUILDING: \"BUILDING\",\n CANCELLED: \"CANCELLED\",\n CANCEL_REQUESTED: \"CANCEL_REQUESTED\",\n COMPLETED: \"COMPLETED\",\n FAILED: \"FAILED\",\n PREPROCESSING: \"PREPROCESSING\",\n SCHEDULED: \"SCHEDULED\",\n TESTING: \"TESTING\",\n};\nconst AutomatedReasoningPolicyBuildResultAssetType = {\n BUILD_LOG: \"BUILD_LOG\",\n GENERATED_TEST_CASES: \"GENERATED_TEST_CASES\",\n POLICY_DEFINITION: \"POLICY_DEFINITION\",\n QUALITY_REPORT: \"QUALITY_REPORT\",\n};\nconst AutomatedReasoningPolicyBuildMessageType = {\n ERROR: \"ERROR\",\n INFO: \"INFO\",\n WARNING: \"WARNING\",\n};\nconst AutomatedReasoningPolicyAnnotationStatus = {\n APPLIED: \"APPLIED\",\n FAILED: \"FAILED\",\n};\nconst AutomatedReasoningCheckLogicWarningType = {\n ALWAYS_FALSE: \"ALWAYS_FALSE\",\n ALWAYS_TRUE: \"ALWAYS_TRUE\",\n};\nconst AutomatedReasoningPolicyTestRunResult = {\n FAILED: \"FAILED\",\n PASSED: \"PASSED\",\n};\nconst AutomatedReasoningPolicyTestRunStatus = {\n COMPLETED: \"COMPLETED\",\n FAILED: \"FAILED\",\n IN_PROGRESS: \"IN_PROGRESS\",\n NOT_STARTED: \"NOT_STARTED\",\n SCHEDULED: \"SCHEDULED\",\n};\nconst Status = {\n INCOMPATIBLE_ENDPOINT: \"INCOMPATIBLE_ENDPOINT\",\n REGISTERED: \"REGISTERED\",\n};\nconst CustomModelDeploymentStatus = {\n ACTIVE: \"Active\",\n CREATING: \"Creating\",\n FAILED: \"Failed\",\n};\nconst SortModelsBy = {\n CREATION_TIME: \"CreationTime\",\n};\nconst SortOrder = {\n ASCENDING: \"Ascending\",\n DESCENDING: \"Descending\",\n};\nconst CustomizationType = {\n CONTINUED_PRE_TRAINING: \"CONTINUED_PRE_TRAINING\",\n DISTILLATION: \"DISTILLATION\",\n FINE_TUNING: \"FINE_TUNING\",\n IMPORTED: \"IMPORTED\",\n};\nconst ModelStatus = {\n ACTIVE: \"Active\",\n CREATING: \"Creating\",\n FAILED: \"Failed\",\n};\nconst EvaluationJobStatus = {\n COMPLETED: \"Completed\",\n DELETING: \"Deleting\",\n FAILED: \"Failed\",\n IN_PROGRESS: \"InProgress\",\n STOPPED: \"Stopped\",\n STOPPING: \"Stopping\",\n};\nconst ApplicationType = {\n MODEL_EVALUATION: \"ModelEvaluation\",\n RAG_EVALUATION: \"RagEvaluation\",\n};\nconst EvaluationTaskType = {\n CLASSIFICATION: \"Classification\",\n CUSTOM: \"Custom\",\n GENERATION: \"Generation\",\n QUESTION_AND_ANSWER: \"QuestionAndAnswer\",\n SUMMARIZATION: \"Summarization\",\n};\nconst PerformanceConfigLatency = {\n OPTIMIZED: \"optimized\",\n STANDARD: \"standard\",\n};\nconst ExternalSourceType = {\n BYTE_CONTENT: \"BYTE_CONTENT\",\n S3: \"S3\",\n};\nconst QueryTransformationType = {\n QUERY_DECOMPOSITION: \"QUERY_DECOMPOSITION\",\n};\nconst AttributeType = {\n BOOLEAN: \"BOOLEAN\",\n NUMBER: \"NUMBER\",\n STRING: \"STRING\",\n STRING_LIST: \"STRING_LIST\",\n};\nconst SearchType = {\n HYBRID: \"HYBRID\",\n SEMANTIC: \"SEMANTIC\",\n};\nconst RerankingMetadataSelectionMode = {\n ALL: \"ALL\",\n SELECTIVE: \"SELECTIVE\",\n};\nconst VectorSearchRerankingConfigurationType = {\n BEDROCK_RERANKING_MODEL: \"BEDROCK_RERANKING_MODEL\",\n};\nconst RetrieveAndGenerateType = {\n EXTERNAL_SOURCES: \"EXTERNAL_SOURCES\",\n KNOWLEDGE_BASE: \"KNOWLEDGE_BASE\",\n};\nconst EvaluationJobType = {\n AUTOMATED: \"Automated\",\n HUMAN: \"Human\",\n};\nconst SortJobsBy = {\n CREATION_TIME: \"CreationTime\",\n};\nconst GuardrailContentFilterAction = {\n BLOCK: \"BLOCK\",\n NONE: \"NONE\",\n};\nconst GuardrailModality = {\n IMAGE: \"IMAGE\",\n TEXT: \"TEXT\",\n};\nconst GuardrailFilterStrength = {\n HIGH: \"HIGH\",\n LOW: \"LOW\",\n MEDIUM: \"MEDIUM\",\n NONE: \"NONE\",\n};\nconst GuardrailContentFilterType = {\n HATE: \"HATE\",\n INSULTS: \"INSULTS\",\n MISCONDUCT: \"MISCONDUCT\",\n PROMPT_ATTACK: \"PROMPT_ATTACK\",\n SEXUAL: \"SEXUAL\",\n VIOLENCE: \"VIOLENCE\",\n};\nconst GuardrailContentFiltersTierName = {\n CLASSIC: \"CLASSIC\",\n STANDARD: \"STANDARD\",\n};\nconst GuardrailContextualGroundingAction = {\n BLOCK: \"BLOCK\",\n NONE: \"NONE\",\n};\nconst GuardrailContextualGroundingFilterType = {\n GROUNDING: \"GROUNDING\",\n RELEVANCE: \"RELEVANCE\",\n};\nconst GuardrailSensitiveInformationAction = {\n ANONYMIZE: \"ANONYMIZE\",\n BLOCK: \"BLOCK\",\n NONE: \"NONE\",\n};\nconst GuardrailPiiEntityType = {\n ADDRESS: \"ADDRESS\",\n AGE: \"AGE\",\n AWS_ACCESS_KEY: \"AWS_ACCESS_KEY\",\n AWS_SECRET_KEY: \"AWS_SECRET_KEY\",\n CA_HEALTH_NUMBER: \"CA_HEALTH_NUMBER\",\n CA_SOCIAL_INSURANCE_NUMBER: \"CA_SOCIAL_INSURANCE_NUMBER\",\n CREDIT_DEBIT_CARD_CVV: \"CREDIT_DEBIT_CARD_CVV\",\n CREDIT_DEBIT_CARD_EXPIRY: \"CREDIT_DEBIT_CARD_EXPIRY\",\n CREDIT_DEBIT_CARD_NUMBER: \"CREDIT_DEBIT_CARD_NUMBER\",\n DRIVER_ID: \"DRIVER_ID\",\n EMAIL: \"EMAIL\",\n INTERNATIONAL_BANK_ACCOUNT_NUMBER: \"INTERNATIONAL_BANK_ACCOUNT_NUMBER\",\n IP_ADDRESS: \"IP_ADDRESS\",\n LICENSE_PLATE: \"LICENSE_PLATE\",\n MAC_ADDRESS: \"MAC_ADDRESS\",\n NAME: \"NAME\",\n PASSWORD: \"PASSWORD\",\n PHONE: \"PHONE\",\n PIN: \"PIN\",\n SWIFT_CODE: \"SWIFT_CODE\",\n UK_NATIONAL_HEALTH_SERVICE_NUMBER: \"UK_NATIONAL_HEALTH_SERVICE_NUMBER\",\n UK_NATIONAL_INSURANCE_NUMBER: \"UK_NATIONAL_INSURANCE_NUMBER\",\n UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER: \"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER\",\n URL: \"URL\",\n USERNAME: \"USERNAME\",\n US_BANK_ACCOUNT_NUMBER: \"US_BANK_ACCOUNT_NUMBER\",\n US_BANK_ROUTING_NUMBER: \"US_BANK_ROUTING_NUMBER\",\n US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: \"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER\",\n US_PASSPORT_NUMBER: \"US_PASSPORT_NUMBER\",\n US_SOCIAL_SECURITY_NUMBER: \"US_SOCIAL_SECURITY_NUMBER\",\n VEHICLE_IDENTIFICATION_NUMBER: \"VEHICLE_IDENTIFICATION_NUMBER\",\n};\nconst GuardrailTopicsTierName = {\n CLASSIC: \"CLASSIC\",\n STANDARD: \"STANDARD\",\n};\nconst GuardrailTopicAction = {\n BLOCK: \"BLOCK\",\n NONE: \"NONE\",\n};\nconst GuardrailTopicType = {\n DENY: \"DENY\",\n};\nconst GuardrailWordAction = {\n BLOCK: \"BLOCK\",\n NONE: \"NONE\",\n};\nconst GuardrailManagedWordsType = {\n PROFANITY: \"PROFANITY\",\n};\nconst GuardrailStatus = {\n CREATING: \"CREATING\",\n DELETING: \"DELETING\",\n FAILED: \"FAILED\",\n READY: \"READY\",\n UPDATING: \"UPDATING\",\n VERSIONING: \"VERSIONING\",\n};\nconst InferenceProfileStatus = {\n ACTIVE: \"ACTIVE\",\n};\nconst InferenceProfileType = {\n APPLICATION: \"APPLICATION\",\n SYSTEM_DEFINED: \"SYSTEM_DEFINED\",\n};\nconst ModelCopyJobStatus = {\n COMPLETED: \"Completed\",\n FAILED: \"Failed\",\n IN_PROGRESS: \"InProgress\",\n};\nconst ModelImportJobStatus = {\n COMPLETED: \"Completed\",\n FAILED: \"Failed\",\n IN_PROGRESS: \"InProgress\",\n};\nconst S3InputFormat = {\n JSONL: \"JSONL\",\n};\nconst ModelInvocationJobStatus = {\n COMPLETED: \"Completed\",\n EXPIRED: \"Expired\",\n FAILED: \"Failed\",\n IN_PROGRESS: \"InProgress\",\n PARTIALLY_COMPLETED: \"PartiallyCompleted\",\n SCHEDULED: \"Scheduled\",\n STOPPED: \"Stopped\",\n STOPPING: \"Stopping\",\n SUBMITTED: \"Submitted\",\n VALIDATING: \"Validating\",\n};\nconst ModelCustomization = {\n CONTINUED_PRE_TRAINING: \"CONTINUED_PRE_TRAINING\",\n DISTILLATION: \"DISTILLATION\",\n FINE_TUNING: \"FINE_TUNING\",\n};\nconst InferenceType = {\n ON_DEMAND: \"ON_DEMAND\",\n PROVISIONED: \"PROVISIONED\",\n};\nconst ModelModality = {\n EMBEDDING: \"EMBEDDING\",\n IMAGE: \"IMAGE\",\n TEXT: \"TEXT\",\n};\nconst FoundationModelLifecycleStatus = {\n ACTIVE: \"ACTIVE\",\n LEGACY: \"LEGACY\",\n};\nconst PromptRouterStatus = {\n AVAILABLE: \"AVAILABLE\",\n};\nconst PromptRouterType = {\n CUSTOM: \"custom\",\n DEFAULT: \"default\",\n};\nconst CommitmentDuration = {\n ONE_MONTH: \"OneMonth\",\n SIX_MONTHS: \"SixMonths\",\n};\nconst ProvisionedModelStatus = {\n CREATING: \"Creating\",\n FAILED: \"Failed\",\n IN_SERVICE: \"InService\",\n UPDATING: \"Updating\",\n};\nconst SortByProvisionedModels = {\n CREATION_TIME: \"CreationTime\",\n};\nconst AuthorizationStatus = {\n AUTHORIZED: \"AUTHORIZED\",\n NOT_AUTHORIZED: \"NOT_AUTHORIZED\",\n};\nconst EntitlementAvailability = {\n AVAILABLE: \"AVAILABLE\",\n NOT_AVAILABLE: \"NOT_AVAILABLE\",\n};\nconst RegionAvailability = {\n AVAILABLE: \"AVAILABLE\",\n NOT_AVAILABLE: \"NOT_AVAILABLE\",\n};\nconst OfferType = {\n ALL: \"ALL\",\n PUBLIC: \"PUBLIC\",\n};\nconst ModelCustomizationJobStatus = {\n COMPLETED: \"Completed\",\n FAILED: \"Failed\",\n IN_PROGRESS: \"InProgress\",\n STOPPED: \"Stopped\",\n STOPPING: \"Stopping\",\n};\nconst JobStatusDetails = {\n COMPLETED: \"Completed\",\n FAILED: \"Failed\",\n IN_PROGRESS: \"InProgress\",\n NOT_STARTED: \"NotStarted\",\n STOPPED: \"Stopped\",\n STOPPING: \"Stopping\",\n};\nconst FineTuningJobStatus = {\n COMPLETED: \"Completed\",\n FAILED: \"Failed\",\n IN_PROGRESS: \"InProgress\",\n STOPPED: \"Stopped\",\n STOPPING: \"Stopping\",\n};\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nObject.defineProperty(exports, \"__Client\", {\n enumerable: true,\n get: function () { return smithyClient.Client; }\n});\nexports.AccessDeniedException = AccessDeniedException$1;\nexports.AgreementStatus = AgreementStatus;\nexports.ApplicationType = ApplicationType;\nexports.AttributeType = AttributeType;\nexports.AuthorizationStatus = AuthorizationStatus;\nexports.AutomatedReasoningCheckLogicWarningType = AutomatedReasoningCheckLogicWarningType;\nexports.AutomatedReasoningCheckResult = AutomatedReasoningCheckResult;\nexports.AutomatedReasoningPolicyAnnotationStatus = AutomatedReasoningPolicyAnnotationStatus;\nexports.AutomatedReasoningPolicyBuildDocumentContentType = AutomatedReasoningPolicyBuildDocumentContentType;\nexports.AutomatedReasoningPolicyBuildMessageType = AutomatedReasoningPolicyBuildMessageType;\nexports.AutomatedReasoningPolicyBuildResultAssetType = AutomatedReasoningPolicyBuildResultAssetType;\nexports.AutomatedReasoningPolicyBuildWorkflowStatus = AutomatedReasoningPolicyBuildWorkflowStatus;\nexports.AutomatedReasoningPolicyBuildWorkflowType = AutomatedReasoningPolicyBuildWorkflowType;\nexports.AutomatedReasoningPolicyTestRunResult = AutomatedReasoningPolicyTestRunResult;\nexports.AutomatedReasoningPolicyTestRunStatus = AutomatedReasoningPolicyTestRunStatus;\nexports.BatchDeleteEvaluationJobCommand = BatchDeleteEvaluationJobCommand;\nexports.Bedrock = Bedrock;\nexports.BedrockClient = BedrockClient;\nexports.BedrockServiceException = BedrockServiceException$1;\nexports.CancelAutomatedReasoningPolicyBuildWorkflowCommand = CancelAutomatedReasoningPolicyBuildWorkflowCommand;\nexports.CommitmentDuration = CommitmentDuration;\nexports.ConflictException = ConflictException$1;\nexports.CreateAutomatedReasoningPolicyCommand = CreateAutomatedReasoningPolicyCommand;\nexports.CreateAutomatedReasoningPolicyTestCaseCommand = CreateAutomatedReasoningPolicyTestCaseCommand;\nexports.CreateAutomatedReasoningPolicyVersionCommand = CreateAutomatedReasoningPolicyVersionCommand;\nexports.CreateCustomModelCommand = CreateCustomModelCommand;\nexports.CreateCustomModelDeploymentCommand = CreateCustomModelDeploymentCommand;\nexports.CreateEvaluationJobCommand = CreateEvaluationJobCommand;\nexports.CreateFoundationModelAgreementCommand = CreateFoundationModelAgreementCommand;\nexports.CreateGuardrailCommand = CreateGuardrailCommand;\nexports.CreateGuardrailVersionCommand = CreateGuardrailVersionCommand;\nexports.CreateInferenceProfileCommand = CreateInferenceProfileCommand;\nexports.CreateMarketplaceModelEndpointCommand = CreateMarketplaceModelEndpointCommand;\nexports.CreateModelCopyJobCommand = CreateModelCopyJobCommand;\nexports.CreateModelCustomizationJobCommand = CreateModelCustomizationJobCommand;\nexports.CreateModelImportJobCommand = CreateModelImportJobCommand;\nexports.CreateModelInvocationJobCommand = CreateModelInvocationJobCommand;\nexports.CreatePromptRouterCommand = CreatePromptRouterCommand;\nexports.CreateProvisionedModelThroughputCommand = CreateProvisionedModelThroughputCommand;\nexports.CustomModelDeploymentStatus = CustomModelDeploymentStatus;\nexports.CustomizationType = CustomizationType;\nexports.DeleteAutomatedReasoningPolicyBuildWorkflowCommand = DeleteAutomatedReasoningPolicyBuildWorkflowCommand;\nexports.DeleteAutomatedReasoningPolicyCommand = DeleteAutomatedReasoningPolicyCommand;\nexports.DeleteAutomatedReasoningPolicyTestCaseCommand = DeleteAutomatedReasoningPolicyTestCaseCommand;\nexports.DeleteCustomModelCommand = DeleteCustomModelCommand;\nexports.DeleteCustomModelDeploymentCommand = DeleteCustomModelDeploymentCommand;\nexports.DeleteFoundationModelAgreementCommand = DeleteFoundationModelAgreementCommand;\nexports.DeleteGuardrailCommand = DeleteGuardrailCommand;\nexports.DeleteImportedModelCommand = DeleteImportedModelCommand;\nexports.DeleteInferenceProfileCommand = DeleteInferenceProfileCommand;\nexports.DeleteMarketplaceModelEndpointCommand = DeleteMarketplaceModelEndpointCommand;\nexports.DeleteModelInvocationLoggingConfigurationCommand = DeleteModelInvocationLoggingConfigurationCommand;\nexports.DeletePromptRouterCommand = DeletePromptRouterCommand;\nexports.DeleteProvisionedModelThroughputCommand = DeleteProvisionedModelThroughputCommand;\nexports.DeregisterMarketplaceModelEndpointCommand = DeregisterMarketplaceModelEndpointCommand;\nexports.EntitlementAvailability = EntitlementAvailability;\nexports.EvaluationJobStatus = EvaluationJobStatus;\nexports.EvaluationJobType = EvaluationJobType;\nexports.EvaluationTaskType = EvaluationTaskType;\nexports.ExportAutomatedReasoningPolicyVersionCommand = ExportAutomatedReasoningPolicyVersionCommand;\nexports.ExternalSourceType = ExternalSourceType;\nexports.FineTuningJobStatus = FineTuningJobStatus;\nexports.FoundationModelLifecycleStatus = FoundationModelLifecycleStatus;\nexports.GetAutomatedReasoningPolicyAnnotationsCommand = GetAutomatedReasoningPolicyAnnotationsCommand;\nexports.GetAutomatedReasoningPolicyBuildWorkflowCommand = GetAutomatedReasoningPolicyBuildWorkflowCommand;\nexports.GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand = GetAutomatedReasoningPolicyBuildWorkflowResultAssetsCommand;\nexports.GetAutomatedReasoningPolicyCommand = GetAutomatedReasoningPolicyCommand;\nexports.GetAutomatedReasoningPolicyNextScenarioCommand = GetAutomatedReasoningPolicyNextScenarioCommand;\nexports.GetAutomatedReasoningPolicyTestCaseCommand = GetAutomatedReasoningPolicyTestCaseCommand;\nexports.GetAutomatedReasoningPolicyTestResultCommand = GetAutomatedReasoningPolicyTestResultCommand;\nexports.GetCustomModelCommand = GetCustomModelCommand;\nexports.GetCustomModelDeploymentCommand = GetCustomModelDeploymentCommand;\nexports.GetEvaluationJobCommand = GetEvaluationJobCommand;\nexports.GetFoundationModelAvailabilityCommand = GetFoundationModelAvailabilityCommand;\nexports.GetFoundationModelCommand = GetFoundationModelCommand;\nexports.GetGuardrailCommand = GetGuardrailCommand;\nexports.GetImportedModelCommand = GetImportedModelCommand;\nexports.GetInferenceProfileCommand = GetInferenceProfileCommand;\nexports.GetMarketplaceModelEndpointCommand = GetMarketplaceModelEndpointCommand;\nexports.GetModelCopyJobCommand = GetModelCopyJobCommand;\nexports.GetModelCustomizationJobCommand = GetModelCustomizationJobCommand;\nexports.GetModelImportJobCommand = GetModelImportJobCommand;\nexports.GetModelInvocationJobCommand = GetModelInvocationJobCommand;\nexports.GetModelInvocationLoggingConfigurationCommand = GetModelInvocationLoggingConfigurationCommand;\nexports.GetPromptRouterCommand = GetPromptRouterCommand;\nexports.GetProvisionedModelThroughputCommand = GetProvisionedModelThroughputCommand;\nexports.GetUseCaseForModelAccessCommand = GetUseCaseForModelAccessCommand;\nexports.GuardrailContentFilterAction = GuardrailContentFilterAction;\nexports.GuardrailContentFilterType = GuardrailContentFilterType;\nexports.GuardrailContentFiltersTierName = GuardrailContentFiltersTierName;\nexports.GuardrailContextualGroundingAction = GuardrailContextualGroundingAction;\nexports.GuardrailContextualGroundingFilterType = GuardrailContextualGroundingFilterType;\nexports.GuardrailFilterStrength = GuardrailFilterStrength;\nexports.GuardrailManagedWordsType = GuardrailManagedWordsType;\nexports.GuardrailModality = GuardrailModality;\nexports.GuardrailPiiEntityType = GuardrailPiiEntityType;\nexports.GuardrailSensitiveInformationAction = GuardrailSensitiveInformationAction;\nexports.GuardrailStatus = GuardrailStatus;\nexports.GuardrailTopicAction = GuardrailTopicAction;\nexports.GuardrailTopicType = GuardrailTopicType;\nexports.GuardrailTopicsTierName = GuardrailTopicsTierName;\nexports.GuardrailWordAction = GuardrailWordAction;\nexports.InferenceProfileStatus = InferenceProfileStatus;\nexports.InferenceProfileType = InferenceProfileType;\nexports.InferenceType = InferenceType;\nexports.InternalServerException = InternalServerException$1;\nexports.JobStatusDetails = JobStatusDetails;\nexports.ListAutomatedReasoningPoliciesCommand = ListAutomatedReasoningPoliciesCommand;\nexports.ListAutomatedReasoningPolicyBuildWorkflowsCommand = ListAutomatedReasoningPolicyBuildWorkflowsCommand;\nexports.ListAutomatedReasoningPolicyTestCasesCommand = ListAutomatedReasoningPolicyTestCasesCommand;\nexports.ListAutomatedReasoningPolicyTestResultsCommand = ListAutomatedReasoningPolicyTestResultsCommand;\nexports.ListCustomModelDeploymentsCommand = ListCustomModelDeploymentsCommand;\nexports.ListCustomModelsCommand = ListCustomModelsCommand;\nexports.ListEvaluationJobsCommand = ListEvaluationJobsCommand;\nexports.ListFoundationModelAgreementOffersCommand = ListFoundationModelAgreementOffersCommand;\nexports.ListFoundationModelsCommand = ListFoundationModelsCommand;\nexports.ListGuardrailsCommand = ListGuardrailsCommand;\nexports.ListImportedModelsCommand = ListImportedModelsCommand;\nexports.ListInferenceProfilesCommand = ListInferenceProfilesCommand;\nexports.ListMarketplaceModelEndpointsCommand = ListMarketplaceModelEndpointsCommand;\nexports.ListModelCopyJobsCommand = ListModelCopyJobsCommand;\nexports.ListModelCustomizationJobsCommand = ListModelCustomizationJobsCommand;\nexports.ListModelImportJobsCommand = ListModelImportJobsCommand;\nexports.ListModelInvocationJobsCommand = ListModelInvocationJobsCommand;\nexports.ListPromptRoutersCommand = ListPromptRoutersCommand;\nexports.ListProvisionedModelThroughputsCommand = ListProvisionedModelThroughputsCommand;\nexports.ListTagsForResourceCommand = ListTagsForResourceCommand;\nexports.ModelCopyJobStatus = ModelCopyJobStatus;\nexports.ModelCustomization = ModelCustomization;\nexports.ModelCustomizationJobStatus = ModelCustomizationJobStatus;\nexports.ModelImportJobStatus = ModelImportJobStatus;\nexports.ModelInvocationJobStatus = ModelInvocationJobStatus;\nexports.ModelModality = ModelModality;\nexports.ModelStatus = ModelStatus;\nexports.OfferType = OfferType;\nexports.PerformanceConfigLatency = PerformanceConfigLatency;\nexports.PromptRouterStatus = PromptRouterStatus;\nexports.PromptRouterType = PromptRouterType;\nexports.ProvisionedModelStatus = ProvisionedModelStatus;\nexports.PutModelInvocationLoggingConfigurationCommand = PutModelInvocationLoggingConfigurationCommand;\nexports.PutUseCaseForModelAccessCommand = PutUseCaseForModelAccessCommand;\nexports.QueryTransformationType = QueryTransformationType;\nexports.RegionAvailability = RegionAvailability;\nexports.RegisterMarketplaceModelEndpointCommand = RegisterMarketplaceModelEndpointCommand;\nexports.RerankingMetadataSelectionMode = RerankingMetadataSelectionMode;\nexports.ResourceInUseException = ResourceInUseException$1;\nexports.ResourceNotFoundException = ResourceNotFoundException$1;\nexports.RetrieveAndGenerateType = RetrieveAndGenerateType;\nexports.S3InputFormat = S3InputFormat;\nexports.SearchType = SearchType;\nexports.ServiceQuotaExceededException = ServiceQuotaExceededException$1;\nexports.ServiceUnavailableException = ServiceUnavailableException$1;\nexports.SortByProvisionedModels = SortByProvisionedModels;\nexports.SortJobsBy = SortJobsBy;\nexports.SortModelsBy = SortModelsBy;\nexports.SortOrder = SortOrder;\nexports.StartAutomatedReasoningPolicyBuildWorkflowCommand = StartAutomatedReasoningPolicyBuildWorkflowCommand;\nexports.StartAutomatedReasoningPolicyTestWorkflowCommand = StartAutomatedReasoningPolicyTestWorkflowCommand;\nexports.Status = Status;\nexports.StopEvaluationJobCommand = StopEvaluationJobCommand;\nexports.StopModelCustomizationJobCommand = StopModelCustomizationJobCommand;\nexports.StopModelInvocationJobCommand = StopModelInvocationJobCommand;\nexports.TagResourceCommand = TagResourceCommand;\nexports.ThrottlingException = ThrottlingException$1;\nexports.TooManyTagsException = TooManyTagsException$1;\nexports.UntagResourceCommand = UntagResourceCommand;\nexports.UpdateAutomatedReasoningPolicyAnnotationsCommand = UpdateAutomatedReasoningPolicyAnnotationsCommand;\nexports.UpdateAutomatedReasoningPolicyCommand = UpdateAutomatedReasoningPolicyCommand;\nexports.UpdateAutomatedReasoningPolicyTestCaseCommand = UpdateAutomatedReasoningPolicyTestCaseCommand;\nexports.UpdateGuardrailCommand = UpdateGuardrailCommand;\nexports.UpdateMarketplaceModelEndpointCommand = UpdateMarketplaceModelEndpointCommand;\nexports.UpdateProvisionedModelThroughputCommand = UpdateProvisionedModelThroughputCommand;\nexports.ValidationException = ValidationException$1;\nexports.VectorSearchRerankingConfigurationType = VectorSearchRerankingConfigurationType;\nexports.paginateListAutomatedReasoningPolicies = paginateListAutomatedReasoningPolicies;\nexports.paginateListAutomatedReasoningPolicyBuildWorkflows = paginateListAutomatedReasoningPolicyBuildWorkflows;\nexports.paginateListAutomatedReasoningPolicyTestCases = paginateListAutomatedReasoningPolicyTestCases;\nexports.paginateListAutomatedReasoningPolicyTestResults = paginateListAutomatedReasoningPolicyTestResults;\nexports.paginateListCustomModelDeployments = paginateListCustomModelDeployments;\nexports.paginateListCustomModels = paginateListCustomModels;\nexports.paginateListEvaluationJobs = paginateListEvaluationJobs;\nexports.paginateListGuardrails = paginateListGuardrails;\nexports.paginateListImportedModels = paginateListImportedModels;\nexports.paginateListInferenceProfiles = paginateListInferenceProfiles;\nexports.paginateListMarketplaceModelEndpoints = paginateListMarketplaceModelEndpoints;\nexports.paginateListModelCopyJobs = paginateListModelCopyJobs;\nexports.paginateListModelCustomizationJobs = paginateListModelCustomizationJobs;\nexports.paginateListModelImportJobs = paginateListModelImportJobs;\nexports.paginateListModelInvocationJobs = paginateListModelInvocationJobs;\nexports.paginateListPromptRouters = paginateListPromptRouters;\nexports.paginateListProvisionedModelThroughputs = paginateListProvisionedModelThroughputs;\n", - "'use strict';\n\nvar protocolHttp = require('@smithy/protocol-http');\n\nfunction resolveEventStreamConfig(input) {\n const eventSigner = input.signer;\n const messageSigner = input.signer;\n const newInput = Object.assign(input, {\n eventSigner,\n messageSigner,\n });\n const eventStreamPayloadHandler = newInput.eventStreamPayloadHandlerProvider(newInput);\n return Object.assign(newInput, {\n eventStreamPayloadHandler,\n });\n}\n\nconst eventStreamHandlingMiddleware = (options) => (next, context) => async (args) => {\n const { request } = args;\n if (!protocolHttp.HttpRequest.isInstance(request))\n return next(args);\n return options.eventStreamPayloadHandler.handle(next, args, context);\n};\nconst eventStreamHandlingMiddlewareOptions = {\n tags: [\"EVENT_STREAM\", \"SIGNATURE\", \"HANDLE\"],\n name: \"eventStreamHandlingMiddleware\",\n relation: \"after\",\n toMiddleware: \"awsAuthMiddleware\",\n override: true,\n};\n\nconst eventStreamHeaderMiddleware = (next) => async (args) => {\n const { request } = args;\n if (!protocolHttp.HttpRequest.isInstance(request))\n return next(args);\n request.headers = {\n ...request.headers,\n \"content-type\": \"application/vnd.amazon.eventstream\",\n \"x-amz-content-sha256\": \"STREAMING-AWS4-HMAC-SHA256-EVENTS\",\n };\n return next({\n ...args,\n request,\n });\n};\nconst eventStreamHeaderMiddlewareOptions = {\n step: \"build\",\n tags: [\"EVENT_STREAM\", \"HEADER\", \"CONTENT_TYPE\", \"CONTENT_SHA256\"],\n name: \"eventStreamHeaderMiddleware\",\n override: true,\n};\n\nconst getEventStreamPlugin = (options) => ({\n applyToStack: (clientStack) => {\n clientStack.addRelativeTo(eventStreamHandlingMiddleware(options), eventStreamHandlingMiddlewareOptions);\n clientStack.add(eventStreamHeaderMiddleware, eventStreamHeaderMiddlewareOptions);\n },\n});\n\nexports.eventStreamHandlingMiddleware = eventStreamHandlingMiddleware;\nexports.eventStreamHandlingMiddlewareOptions = eventStreamHandlingMiddlewareOptions;\nexports.eventStreamHeaderMiddleware = eventStreamHeaderMiddleware;\nexports.eventStreamHeaderMiddlewareOptions = eventStreamHeaderMiddlewareOptions;\nexports.getEventStreamPlugin = getEventStreamPlugin;\nexports.resolveEventStreamConfig = resolveEventStreamConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toUtf8 = exports.fromUtf8 = void 0;\nconst fromUtf8 = (input) => {\n const bytes = [];\n for (let i = 0, len = input.length; i < len; i++) {\n const value = input.charCodeAt(i);\n if (value < 0x80) {\n bytes.push(value);\n }\n else if (value < 0x800) {\n bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);\n }\n else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);\n bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);\n }\n else {\n bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);\n }\n }\n return Uint8Array.from(bytes);\n};\nexports.fromUtf8 = fromUtf8;\nconst toUtf8 = (input) => {\n let decoded = \"\";\n for (let i = 0, len = input.length; i < len; i++) {\n const byte = input[i];\n if (byte < 0x80) {\n decoded += String.fromCharCode(byte);\n }\n else if (0b11000000 <= byte && byte < 0b11100000) {\n const nextByte = input[++i];\n decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));\n }\n else if (0b11110000 <= byte && byte < 0b101101101) {\n const surrogatePair = [byte, input[++i], input[++i], input[++i]];\n const encoded = \"%\" + surrogatePair.map((byteValue) => byteValue.toString(16)).join(\"%\");\n decoded += decodeURIComponent(encoded);\n }\n else {\n decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));\n }\n }\n return decoded;\n};\nexports.toUtf8 = toUtf8;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toUtf8 = exports.fromUtf8 = void 0;\nfunction fromUtf8(input) {\n return new TextEncoder().encode(input);\n}\nexports.fromUtf8 = fromUtf8;\nfunction toUtf8(input) {\n return new TextDecoder(\"utf-8\").decode(input);\n}\nexports.toUtf8 = toUtf8;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toUtf8 = exports.fromUtf8 = void 0;\nconst pureJs_1 = require(\"./pureJs\");\nconst whatwgEncodingApi_1 = require(\"./whatwgEncodingApi\");\nconst fromUtf8 = (input) => typeof TextEncoder === \"function\" ? (0, whatwgEncodingApi_1.fromUtf8)(input) : (0, pureJs_1.fromUtf8)(input);\nexports.fromUtf8 = fromUtf8;\nconst toUtf8 = (input) => typeof TextDecoder === \"function\" ? (0, whatwgEncodingApi_1.toUtf8)(input) : (0, pureJs_1.toUtf8)(input);\nexports.toUtf8 = toUtf8;\n", - "\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertToBuffer = void 0;\nvar util_utf8_browser_1 = require(\"@aws-sdk/util-utf8-browser\");\n// Quick polyfill\nvar fromUtf8 = typeof Buffer !== \"undefined\" && Buffer.from\n ? function (input) { return Buffer.from(input, \"utf8\"); }\n : util_utf8_browser_1.fromUtf8;\nfunction convertToBuffer(data) {\n // Already a Uint8, do nothing\n if (data instanceof Uint8Array)\n return data;\n if (typeof data === \"string\") {\n return fromUtf8(data);\n }\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n }\n return new Uint8Array(data);\n}\nexports.convertToBuffer = convertToBuffer;\n//# sourceMappingURL=convertToBuffer.js.map", - "\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isEmptyData = void 0;\nfunction isEmptyData(data) {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n return data.byteLength === 0;\n}\nexports.isEmptyData = isEmptyData;\n//# sourceMappingURL=isEmptyData.js.map", - "\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.numToUint8 = void 0;\nfunction numToUint8(num) {\n return new Uint8Array([\n (num & 0xff000000) >> 24,\n (num & 0x00ff0000) >> 16,\n (num & 0x0000ff00) >> 8,\n num & 0x000000ff,\n ]);\n}\nexports.numToUint8 = numToUint8;\n//# sourceMappingURL=numToUint8.js.map", - "\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uint32ArrayFrom = void 0;\n// IE 11 does not support Array.from, so we do it manually\nfunction uint32ArrayFrom(a_lookUpTable) {\n if (!Uint32Array.from) {\n var return_array = new Uint32Array(a_lookUpTable.length);\n var a_index = 0;\n while (a_index < a_lookUpTable.length) {\n return_array[a_index] = a_lookUpTable[a_index];\n a_index += 1;\n }\n return return_array;\n }\n return Uint32Array.from(a_lookUpTable);\n}\nexports.uint32ArrayFrom = uint32ArrayFrom;\n//# sourceMappingURL=uint32ArrayFrom.js.map", - "\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uint32ArrayFrom = exports.numToUint8 = exports.isEmptyData = exports.convertToBuffer = void 0;\nvar convertToBuffer_1 = require(\"./convertToBuffer\");\nObject.defineProperty(exports, \"convertToBuffer\", { enumerable: true, get: function () { return convertToBuffer_1.convertToBuffer; } });\nvar isEmptyData_1 = require(\"./isEmptyData\");\nObject.defineProperty(exports, \"isEmptyData\", { enumerable: true, get: function () { return isEmptyData_1.isEmptyData; } });\nvar numToUint8_1 = require(\"./numToUint8\");\nObject.defineProperty(exports, \"numToUint8\", { enumerable: true, get: function () { return numToUint8_1.numToUint8; } });\nvar uint32ArrayFrom_1 = require(\"./uint32ArrayFrom\");\nObject.defineProperty(exports, \"uint32ArrayFrom\", { enumerable: true, get: function () { return uint32ArrayFrom_1.uint32ArrayFrom; } });\n//# sourceMappingURL=index.js.map", - "\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AwsCrc32 = void 0;\nvar tslib_1 = require(\"tslib\");\nvar util_1 = require(\"@aws-crypto/util\");\nvar index_1 = require(\"./index\");\nvar AwsCrc32 = /** @class */ (function () {\n function AwsCrc32() {\n this.crc32 = new index_1.Crc32();\n }\n AwsCrc32.prototype.update = function (toHash) {\n if ((0, util_1.isEmptyData)(toHash))\n return;\n this.crc32.update((0, util_1.convertToBuffer)(toHash));\n };\n AwsCrc32.prototype.digest = function () {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n return [2 /*return*/, (0, util_1.numToUint8)(this.crc32.digest())];\n });\n });\n };\n AwsCrc32.prototype.reset = function () {\n this.crc32 = new index_1.Crc32();\n };\n return AwsCrc32;\n}());\nexports.AwsCrc32 = AwsCrc32;\n//# sourceMappingURL=aws_crc32.js.map", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AwsCrc32 = exports.Crc32 = exports.crc32 = void 0;\nvar tslib_1 = require(\"tslib\");\nvar util_1 = require(\"@aws-crypto/util\");\nfunction crc32(data) {\n return new Crc32().update(data).digest();\n}\nexports.crc32 = crc32;\nvar Crc32 = /** @class */ (function () {\n function Crc32() {\n this.checksum = 0xffffffff;\n }\n Crc32.prototype.update = function (data) {\n var e_1, _a;\n try {\n for (var data_1 = tslib_1.__values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {\n var byte = data_1_1.value;\n this.checksum =\n (this.checksum >>> 8) ^ lookupTable[(this.checksum ^ byte) & 0xff];\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (data_1_1 && !data_1_1.done && (_a = data_1.return)) _a.call(data_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return this;\n };\n Crc32.prototype.digest = function () {\n return (this.checksum ^ 0xffffffff) >>> 0;\n };\n return Crc32;\n}());\nexports.Crc32 = Crc32;\n// prettier-ignore\nvar a_lookUpTable = [\n 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,\n 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,\n 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,\n 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,\n 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,\n 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,\n 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,\n 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,\n 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,\n 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,\n 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,\n 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,\n 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,\n 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,\n 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,\n 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,\n 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,\n 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,\n 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,\n 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,\n 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,\n 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,\n 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,\n 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,\n 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,\n 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,\n 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,\n 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,\n 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,\n 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,\n 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,\n 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,\n 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,\n 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,\n 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,\n 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,\n 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,\n 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,\n 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,\n 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,\n 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,\n 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,\n 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,\n 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,\n 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,\n 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,\n 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,\n 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,\n 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,\n 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,\n 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,\n 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,\n 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,\n 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,\n 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,\n 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,\n 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,\n 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,\n 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,\n 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,\n 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,\n 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,\n 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,\n 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D,\n];\nvar lookupTable = (0, util_1.uint32ArrayFrom)(a_lookUpTable);\nvar aws_crc32_1 = require(\"./aws_crc32\");\nObject.defineProperty(exports, \"AwsCrc32\", { enumerable: true, get: function () { return aws_crc32_1.AwsCrc32; } });\n//# sourceMappingURL=index.js.map", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n EventStreamCodec: () => EventStreamCodec,\n HeaderMarshaller: () => HeaderMarshaller,\n Int64: () => Int64,\n MessageDecoderStream: () => MessageDecoderStream,\n MessageEncoderStream: () => MessageEncoderStream,\n SmithyMessageDecoderStream: () => SmithyMessageDecoderStream,\n SmithyMessageEncoderStream: () => SmithyMessageEncoderStream\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/EventStreamCodec.ts\nvar import_crc322 = require(\"@aws-crypto/crc32\");\n\n// src/HeaderMarshaller.ts\n\n\n// src/Int64.ts\nvar import_util_hex_encoding = require(\"@smithy/util-hex-encoding\");\nvar _Int64 = class _Int64 {\n constructor(bytes) {\n this.bytes = bytes;\n if (bytes.byteLength !== 8) {\n throw new Error(\"Int64 buffers must be exactly 8 bytes\");\n }\n }\n static fromNumber(number) {\n if (number > 9223372036854776e3 || number < -9223372036854776e3) {\n throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);\n }\n const bytes = new Uint8Array(8);\n for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {\n bytes[i] = remaining;\n }\n if (number < 0) {\n negate(bytes);\n }\n return new _Int64(bytes);\n }\n /**\n * Called implicitly by infix arithmetic operators.\n */\n valueOf() {\n const bytes = this.bytes.slice(0);\n const negative = bytes[0] & 128;\n if (negative) {\n negate(bytes);\n }\n return parseInt((0, import_util_hex_encoding.toHex)(bytes), 16) * (negative ? -1 : 1);\n }\n toString() {\n return String(this.valueOf());\n }\n};\n__name(_Int64, \"Int64\");\nvar Int64 = _Int64;\nfunction negate(bytes) {\n for (let i = 0; i < 8; i++) {\n bytes[i] ^= 255;\n }\n for (let i = 7; i > -1; i--) {\n bytes[i]++;\n if (bytes[i] !== 0)\n break;\n }\n}\n__name(negate, \"negate\");\n\n// src/HeaderMarshaller.ts\nvar _HeaderMarshaller = class _HeaderMarshaller {\n constructor(toUtf8, fromUtf8) {\n this.toUtf8 = toUtf8;\n this.fromUtf8 = fromUtf8;\n }\n format(headers) {\n const chunks = [];\n for (const headerName of Object.keys(headers)) {\n const bytes = this.fromUtf8(headerName);\n chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));\n }\n const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));\n let position = 0;\n for (const chunk of chunks) {\n out.set(chunk, position);\n position += chunk.byteLength;\n }\n return out;\n }\n formatHeaderValue(header) {\n switch (header.type) {\n case \"boolean\":\n return Uint8Array.from([header.value ? 0 /* boolTrue */ : 1 /* boolFalse */]);\n case \"byte\":\n return Uint8Array.from([2 /* byte */, header.value]);\n case \"short\":\n const shortView = new DataView(new ArrayBuffer(3));\n shortView.setUint8(0, 3 /* short */);\n shortView.setInt16(1, header.value, false);\n return new Uint8Array(shortView.buffer);\n case \"integer\":\n const intView = new DataView(new ArrayBuffer(5));\n intView.setUint8(0, 4 /* integer */);\n intView.setInt32(1, header.value, false);\n return new Uint8Array(intView.buffer);\n case \"long\":\n const longBytes = new Uint8Array(9);\n longBytes[0] = 5 /* long */;\n longBytes.set(header.value.bytes, 1);\n return longBytes;\n case \"binary\":\n const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));\n binView.setUint8(0, 6 /* byteArray */);\n binView.setUint16(1, header.value.byteLength, false);\n const binBytes = new Uint8Array(binView.buffer);\n binBytes.set(header.value, 3);\n return binBytes;\n case \"string\":\n const utf8Bytes = this.fromUtf8(header.value);\n const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));\n strView.setUint8(0, 7 /* string */);\n strView.setUint16(1, utf8Bytes.byteLength, false);\n const strBytes = new Uint8Array(strView.buffer);\n strBytes.set(utf8Bytes, 3);\n return strBytes;\n case \"timestamp\":\n const tsBytes = new Uint8Array(9);\n tsBytes[0] = 8 /* timestamp */;\n tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);\n return tsBytes;\n case \"uuid\":\n if (!UUID_PATTERN.test(header.value)) {\n throw new Error(`Invalid UUID received: ${header.value}`);\n }\n const uuidBytes = new Uint8Array(17);\n uuidBytes[0] = 9 /* uuid */;\n uuidBytes.set((0, import_util_hex_encoding.fromHex)(header.value.replace(/\\-/g, \"\")), 1);\n return uuidBytes;\n }\n }\n parse(headers) {\n const out = {};\n let position = 0;\n while (position < headers.byteLength) {\n const nameLength = headers.getUint8(position++);\n const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));\n position += nameLength;\n switch (headers.getUint8(position++)) {\n case 0 /* boolTrue */:\n out[name] = {\n type: BOOLEAN_TAG,\n value: true\n };\n break;\n case 1 /* boolFalse */:\n out[name] = {\n type: BOOLEAN_TAG,\n value: false\n };\n break;\n case 2 /* byte */:\n out[name] = {\n type: BYTE_TAG,\n value: headers.getInt8(position++)\n };\n break;\n case 3 /* short */:\n out[name] = {\n type: SHORT_TAG,\n value: headers.getInt16(position, false)\n };\n position += 2;\n break;\n case 4 /* integer */:\n out[name] = {\n type: INT_TAG,\n value: headers.getInt32(position, false)\n };\n position += 4;\n break;\n case 5 /* long */:\n out[name] = {\n type: LONG_TAG,\n value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8))\n };\n position += 8;\n break;\n case 6 /* byteArray */:\n const binaryLength = headers.getUint16(position, false);\n position += 2;\n out[name] = {\n type: BINARY_TAG,\n value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength)\n };\n position += binaryLength;\n break;\n case 7 /* string */:\n const stringLength = headers.getUint16(position, false);\n position += 2;\n out[name] = {\n type: STRING_TAG,\n value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength))\n };\n position += stringLength;\n break;\n case 8 /* timestamp */:\n out[name] = {\n type: TIMESTAMP_TAG,\n value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf())\n };\n position += 8;\n break;\n case 9 /* uuid */:\n const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);\n position += 16;\n out[name] = {\n type: UUID_TAG,\n value: `${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(0, 4))}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(4, 6))}-${(0, import_util_hex_encoding.toHex)(\n uuidBytes.subarray(6, 8)\n )}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(8, 10))}-${(0, import_util_hex_encoding.toHex)(uuidBytes.subarray(10))}`\n };\n break;\n default:\n throw new Error(`Unrecognized header type tag`);\n }\n }\n return out;\n }\n};\n__name(_HeaderMarshaller, \"HeaderMarshaller\");\nvar HeaderMarshaller = _HeaderMarshaller;\nvar BOOLEAN_TAG = \"boolean\";\nvar BYTE_TAG = \"byte\";\nvar SHORT_TAG = \"short\";\nvar INT_TAG = \"integer\";\nvar LONG_TAG = \"long\";\nvar BINARY_TAG = \"binary\";\nvar STRING_TAG = \"string\";\nvar TIMESTAMP_TAG = \"timestamp\";\nvar UUID_TAG = \"uuid\";\nvar UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;\n\n// src/splitMessage.ts\nvar import_crc32 = require(\"@aws-crypto/crc32\");\nvar PRELUDE_MEMBER_LENGTH = 4;\nvar PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;\nvar CHECKSUM_LENGTH = 4;\nvar MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;\nfunction splitMessage({ byteLength, byteOffset, buffer }) {\n if (byteLength < MINIMUM_MESSAGE_LENGTH) {\n throw new Error(\"Provided message too short to accommodate event stream message overhead\");\n }\n const view = new DataView(buffer, byteOffset, byteLength);\n const messageLength = view.getUint32(0, false);\n if (byteLength !== messageLength) {\n throw new Error(\"Reported message length does not match received message length\");\n }\n const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);\n const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);\n const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);\n const checksummer = new import_crc32.Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));\n if (expectedPreludeChecksum !== checksummer.digest()) {\n throw new Error(\n `The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`\n );\n }\n checksummer.update(\n new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))\n );\n if (expectedMessageChecksum !== checksummer.digest()) {\n throw new Error(\n `The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`\n );\n }\n return {\n headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),\n body: new Uint8Array(\n buffer,\n byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength,\n messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)\n )\n };\n}\n__name(splitMessage, \"splitMessage\");\n\n// src/EventStreamCodec.ts\nvar _EventStreamCodec = class _EventStreamCodec {\n constructor(toUtf8, fromUtf8) {\n this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8);\n this.messageBuffer = [];\n this.isEndOfStream = false;\n }\n feed(message) {\n this.messageBuffer.push(this.decode(message));\n }\n endOfStream() {\n this.isEndOfStream = true;\n }\n getMessage() {\n const message = this.messageBuffer.pop();\n const isEndOfStream = this.isEndOfStream;\n return {\n getMessage() {\n return message;\n },\n isEndOfStream() {\n return isEndOfStream;\n }\n };\n }\n getAvailableMessages() {\n const messages = this.messageBuffer;\n this.messageBuffer = [];\n const isEndOfStream = this.isEndOfStream;\n return {\n getMessages() {\n return messages;\n },\n isEndOfStream() {\n return isEndOfStream;\n }\n };\n }\n /**\n * Convert a structured JavaScript object with tagged headers into a binary\n * event stream message.\n */\n encode({ headers: rawHeaders, body }) {\n const headers = this.headerMarshaller.format(rawHeaders);\n const length = headers.byteLength + body.byteLength + 16;\n const out = new Uint8Array(length);\n const view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n const checksum = new import_crc322.Crc32();\n view.setUint32(0, length, false);\n view.setUint32(4, headers.byteLength, false);\n view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);\n out.set(headers, 12);\n out.set(body, headers.byteLength + 12);\n view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false);\n return out;\n }\n /**\n * Convert a binary event stream message into a JavaScript object with an\n * opaque, binary body and tagged, parsed headers.\n */\n decode(message) {\n const { headers, body } = splitMessage(message);\n return { headers: this.headerMarshaller.parse(headers), body };\n }\n /**\n * Convert a structured JavaScript object with tagged headers into a binary\n * event stream message header.\n */\n formatHeaders(rawHeaders) {\n return this.headerMarshaller.format(rawHeaders);\n }\n};\n__name(_EventStreamCodec, \"EventStreamCodec\");\nvar EventStreamCodec = _EventStreamCodec;\n\n// src/MessageDecoderStream.ts\nvar _MessageDecoderStream = class _MessageDecoderStream {\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const bytes of this.options.inputStream) {\n const decoded = this.options.decoder.decode(bytes);\n yield decoded;\n }\n }\n};\n__name(_MessageDecoderStream, \"MessageDecoderStream\");\nvar MessageDecoderStream = _MessageDecoderStream;\n\n// src/MessageEncoderStream.ts\nvar _MessageEncoderStream = class _MessageEncoderStream {\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const msg of this.options.messageStream) {\n const encoded = this.options.encoder.encode(msg);\n yield encoded;\n }\n if (this.options.includeEndFrame) {\n yield new Uint8Array(0);\n }\n }\n};\n__name(_MessageEncoderStream, \"MessageEncoderStream\");\nvar MessageEncoderStream = _MessageEncoderStream;\n\n// src/SmithyMessageDecoderStream.ts\nvar _SmithyMessageDecoderStream = class _SmithyMessageDecoderStream {\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const message of this.options.messageStream) {\n const deserialized = await this.options.deserializer(message);\n if (deserialized === void 0)\n continue;\n yield deserialized;\n }\n }\n};\n__name(_SmithyMessageDecoderStream, \"SmithyMessageDecoderStream\");\nvar SmithyMessageDecoderStream = _SmithyMessageDecoderStream;\n\n// src/SmithyMessageEncoderStream.ts\nvar _SmithyMessageEncoderStream = class _SmithyMessageEncoderStream {\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const chunk of this.options.inputStream) {\n const payloadBuf = this.options.serializer(chunk);\n yield payloadBuf;\n }\n }\n};\n__name(_SmithyMessageEncoderStream, \"SmithyMessageEncoderStream\");\nvar SmithyMessageEncoderStream = _SmithyMessageEncoderStream;\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n EventStreamCodec,\n HeaderMarshaller,\n Int64,\n MessageDecoderStream,\n MessageEncoderStream,\n SmithyMessageDecoderStream,\n SmithyMessageEncoderStream\n});\n\n", - "'use strict';\n\nvar querystringBuilder = require('@smithy/querystring-builder');\n\nfunction formatUrl(request) {\n const { port, query } = request;\n let { protocol, path, hostname } = request;\n if (protocol && protocol.slice(-1) !== \":\") {\n protocol += \":\";\n }\n if (port) {\n hostname += `:${port}`;\n }\n if (path && path.charAt(0) !== \"/\") {\n path = `/${path}`;\n }\n let queryString = query ? querystringBuilder.buildQueryString(query) : \"\";\n if (queryString && queryString[0] !== \"?\") {\n queryString = `?${queryString}`;\n }\n let auth = \"\";\n if (request.username != null || request.password != null) {\n const username = request.username ?? \"\";\n const password = request.password ?? \"\";\n auth = `${username}:${password}@`;\n }\n let fragment = \"\";\n if (request.fragment) {\n fragment = `#${request.fragment}`;\n }\n return `${protocol}//${auth}${hostname}${path}${queryString}${fragment}`;\n}\n\nexports.formatUrl = formatUrl;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n EventStreamMarshaller: () => EventStreamMarshaller,\n eventStreamSerdeProvider: () => eventStreamSerdeProvider\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/EventStreamMarshaller.ts\nvar import_eventstream_codec = require(\"@smithy/eventstream-codec\");\n\n// src/getChunkedStream.ts\nfunction getChunkedStream(source) {\n let currentMessageTotalLength = 0;\n let currentMessagePendingLength = 0;\n let currentMessage = null;\n let messageLengthBuffer = null;\n const allocateMessage = /* @__PURE__ */ __name((size) => {\n if (typeof size !== \"number\") {\n throw new Error(\"Attempted to allocate an event message where size was not a number: \" + size);\n }\n currentMessageTotalLength = size;\n currentMessagePendingLength = 4;\n currentMessage = new Uint8Array(size);\n const currentMessageView = new DataView(currentMessage.buffer);\n currentMessageView.setUint32(0, size, false);\n }, \"allocateMessage\");\n const iterator = /* @__PURE__ */ __name(async function* () {\n const sourceIterator = source[Symbol.asyncIterator]();\n while (true) {\n const { value, done } = await sourceIterator.next();\n if (done) {\n if (!currentMessageTotalLength) {\n return;\n } else if (currentMessageTotalLength === currentMessagePendingLength) {\n yield currentMessage;\n } else {\n throw new Error(\"Truncated event message received.\");\n }\n return;\n }\n const chunkLength = value.length;\n let currentOffset = 0;\n while (currentOffset < chunkLength) {\n if (!currentMessage) {\n const bytesRemaining = chunkLength - currentOffset;\n if (!messageLengthBuffer) {\n messageLengthBuffer = new Uint8Array(4);\n }\n const numBytesForTotal = Math.min(\n 4 - currentMessagePendingLength,\n // remaining bytes to fill the messageLengthBuffer\n bytesRemaining\n // bytes left in chunk\n );\n messageLengthBuffer.set(\n // @ts-ignore error TS2532: Object is possibly 'undefined' for value\n value.slice(currentOffset, currentOffset + numBytesForTotal),\n currentMessagePendingLength\n );\n currentMessagePendingLength += numBytesForTotal;\n currentOffset += numBytesForTotal;\n if (currentMessagePendingLength < 4) {\n break;\n }\n allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false));\n messageLengthBuffer = null;\n }\n const numBytesToWrite = Math.min(\n currentMessageTotalLength - currentMessagePendingLength,\n // number of bytes left to complete message\n chunkLength - currentOffset\n // number of bytes left in the original chunk\n );\n currentMessage.set(\n // @ts-ignore error TS2532: Object is possibly 'undefined' for value\n value.slice(currentOffset, currentOffset + numBytesToWrite),\n currentMessagePendingLength\n );\n currentMessagePendingLength += numBytesToWrite;\n currentOffset += numBytesToWrite;\n if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) {\n yield currentMessage;\n currentMessage = null;\n currentMessageTotalLength = 0;\n currentMessagePendingLength = 0;\n }\n }\n }\n }, \"iterator\");\n return {\n [Symbol.asyncIterator]: iterator\n };\n}\n__name(getChunkedStream, \"getChunkedStream\");\n\n// src/getUnmarshalledStream.ts\nfunction getMessageUnmarshaller(deserializer, toUtf8) {\n return async function(message) {\n const { value: messageType } = message.headers[\":message-type\"];\n if (messageType === \"error\") {\n const unmodeledError = new Error(message.headers[\":error-message\"].value || \"UnknownError\");\n unmodeledError.name = message.headers[\":error-code\"].value;\n throw unmodeledError;\n } else if (messageType === \"exception\") {\n const code = message.headers[\":exception-type\"].value;\n const exception = { [code]: message };\n const deserializedException = await deserializer(exception);\n if (deserializedException.$unknown) {\n const error = new Error(toUtf8(message.body));\n error.name = code;\n throw error;\n }\n throw deserializedException[code];\n } else if (messageType === \"event\") {\n const event = {\n [message.headers[\":event-type\"].value]: message\n };\n const deserialized = await deserializer(event);\n if (deserialized.$unknown)\n return;\n return deserialized;\n } else {\n throw Error(`Unrecognizable event type: ${message.headers[\":event-type\"].value}`);\n }\n };\n}\n__name(getMessageUnmarshaller, \"getMessageUnmarshaller\");\n\n// src/EventStreamMarshaller.ts\nvar _EventStreamMarshaller = class _EventStreamMarshaller {\n constructor({ utf8Encoder, utf8Decoder }) {\n this.eventStreamCodec = new import_eventstream_codec.EventStreamCodec(utf8Encoder, utf8Decoder);\n this.utfEncoder = utf8Encoder;\n }\n deserialize(body, deserializer) {\n const inputStream = getChunkedStream(body);\n return new import_eventstream_codec.SmithyMessageDecoderStream({\n messageStream: new import_eventstream_codec.MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }),\n // @ts-expect-error Type 'T' is not assignable to type 'Record'\n deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder)\n });\n }\n serialize(inputStream, serializer) {\n return new import_eventstream_codec.MessageEncoderStream({\n messageStream: new import_eventstream_codec.SmithyMessageEncoderStream({ inputStream, serializer }),\n encoder: this.eventStreamCodec,\n includeEndFrame: true\n });\n }\n};\n__name(_EventStreamMarshaller, \"EventStreamMarshaller\");\nvar EventStreamMarshaller = _EventStreamMarshaller;\n\n// src/provider.ts\nvar eventStreamSerdeProvider = /* @__PURE__ */ __name((options) => new EventStreamMarshaller(options), \"eventStreamSerdeProvider\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n EventStreamMarshaller,\n eventStreamSerdeProvider\n});\n\n", - "'use strict';\n\nvar eventstreamSerdeUniversal = require('@smithy/eventstream-serde-universal');\n\nconst readableStreamtoIterable = (readableStream) => ({\n [Symbol.asyncIterator]: async function* () {\n const reader = readableStream.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done)\n return;\n yield value;\n }\n }\n finally {\n reader.releaseLock();\n }\n },\n});\nconst iterableToReadableStream = (asyncIterable) => {\n const iterator = asyncIterable[Symbol.asyncIterator]();\n return new ReadableStream({\n async pull(controller) {\n const { done, value } = await iterator.next();\n if (done) {\n return controller.close();\n }\n controller.enqueue(value);\n },\n });\n};\n\nclass EventStreamMarshaller {\n universalMarshaller;\n constructor({ utf8Encoder, utf8Decoder }) {\n this.universalMarshaller = new eventstreamSerdeUniversal.EventStreamMarshaller({\n utf8Decoder,\n utf8Encoder,\n });\n }\n deserialize(body, deserializer) {\n const bodyIterable = isReadableStream(body) ? readableStreamtoIterable(body) : body;\n return this.universalMarshaller.deserialize(bodyIterable, deserializer);\n }\n serialize(input, serializer) {\n const serialziedIterable = this.universalMarshaller.serialize(input, serializer);\n return typeof ReadableStream === \"function\" ? iterableToReadableStream(serialziedIterable) : serialziedIterable;\n }\n}\nconst isReadableStream = (body) => typeof ReadableStream === \"function\" && body instanceof ReadableStream;\n\nconst eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options);\n\nexports.EventStreamMarshaller = EventStreamMarshaller;\nexports.eventStreamSerdeProvider = eventStreamSerdeProvider;\nexports.iterableToReadableStream = iterableToReadableStream;\nexports.readableStreamtoIterable = readableStreamtoIterable;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n FetchHttpHandler: () => FetchHttpHandler,\n keepAliveSupport: () => keepAliveSupport,\n streamCollector: () => streamCollector\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/fetch-http-handler.ts\nvar import_protocol_http = require(\"@smithy/protocol-http\");\nvar import_querystring_builder = require(\"@smithy/querystring-builder\");\n\n// src/create-request.ts\nfunction createRequest(url, requestOptions) {\n return new Request(url, requestOptions);\n}\n__name(createRequest, \"createRequest\");\n\n// src/request-timeout.ts\nfunction requestTimeout(timeoutInMs = 0) {\n return new Promise((resolve, reject) => {\n if (timeoutInMs) {\n setTimeout(() => {\n const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);\n timeoutError.name = \"TimeoutError\";\n reject(timeoutError);\n }, timeoutInMs);\n }\n });\n}\n__name(requestTimeout, \"requestTimeout\");\n\n// src/fetch-http-handler.ts\nvar keepAliveSupport = {\n supported: void 0\n};\nvar FetchHttpHandler = class _FetchHttpHandler {\n static {\n __name(this, \"FetchHttpHandler\");\n }\n /**\n * @returns the input if it is an HttpHandler of any class,\n * or instantiates a new instance of this handler.\n */\n static create(instanceOrOptions) {\n if (typeof instanceOrOptions?.handle === \"function\") {\n return instanceOrOptions;\n }\n return new _FetchHttpHandler(instanceOrOptions);\n }\n constructor(options) {\n if (typeof options === \"function\") {\n this.configProvider = options().then((opts) => opts || {});\n } else {\n this.config = options ?? {};\n this.configProvider = Promise.resolve(this.config);\n }\n if (keepAliveSupport.supported === void 0) {\n keepAliveSupport.supported = Boolean(\n typeof Request !== \"undefined\" && \"keepalive\" in createRequest(\"https://[::1]\")\n );\n }\n }\n destroy() {\n }\n async handle(request, { abortSignal } = {}) {\n if (!this.config) {\n this.config = await this.configProvider;\n }\n const requestTimeoutInMs = this.config.requestTimeout;\n const keepAlive = this.config.keepAlive === true;\n const credentials = this.config.credentials;\n if (abortSignal?.aborted) {\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n return Promise.reject(abortError);\n }\n let path = request.path;\n const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {});\n if (queryString) {\n path += `?${queryString}`;\n }\n if (request.fragment) {\n path += `#${request.fragment}`;\n }\n let auth = \"\";\n if (request.username != null || request.password != null) {\n const username = request.username ?? \"\";\n const password = request.password ?? \"\";\n auth = `${username}:${password}@`;\n }\n const { port, method } = request;\n const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : \"\"}${path}`;\n const body = method === \"GET\" || method === \"HEAD\" ? void 0 : request.body;\n const requestOptions = {\n body,\n headers: new Headers(request.headers),\n method,\n credentials\n };\n if (this.config?.cache) {\n requestOptions.cache = this.config.cache;\n }\n if (body) {\n requestOptions.duplex = \"half\";\n }\n if (typeof AbortController !== \"undefined\") {\n requestOptions.signal = abortSignal;\n }\n if (keepAliveSupport.supported) {\n requestOptions.keepalive = keepAlive;\n }\n if (typeof this.config.requestInit === \"function\") {\n Object.assign(requestOptions, this.config.requestInit(request));\n }\n let removeSignalEventListener = /* @__PURE__ */ __name(() => {\n }, \"removeSignalEventListener\");\n const fetchRequest = createRequest(url, requestOptions);\n const raceOfPromises = [\n fetch(fetchRequest).then((response) => {\n const fetchHeaders = response.headers;\n const transformedHeaders = {};\n for (const pair of fetchHeaders.entries()) {\n transformedHeaders[pair[0]] = pair[1];\n }\n const hasReadableStream = response.body != void 0;\n if (!hasReadableStream) {\n return response.blob().then((body2) => ({\n response: new import_protocol_http.HttpResponse({\n headers: transformedHeaders,\n reason: response.statusText,\n statusCode: response.status,\n body: body2\n })\n }));\n }\n return {\n response: new import_protocol_http.HttpResponse({\n headers: transformedHeaders,\n reason: response.statusText,\n statusCode: response.status,\n body: response.body\n })\n };\n }),\n requestTimeout(requestTimeoutInMs)\n ];\n if (abortSignal) {\n raceOfPromises.push(\n new Promise((resolve, reject) => {\n const onAbort = /* @__PURE__ */ __name(() => {\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n reject(abortError);\n }, \"onAbort\");\n if (typeof abortSignal.addEventListener === \"function\") {\n const signal = abortSignal;\n signal.addEventListener(\"abort\", onAbort, { once: true });\n removeSignalEventListener = /* @__PURE__ */ __name(() => signal.removeEventListener(\"abort\", onAbort), \"removeSignalEventListener\");\n } else {\n abortSignal.onabort = onAbort;\n }\n })\n );\n }\n return Promise.race(raceOfPromises).finally(removeSignalEventListener);\n }\n updateHttpClientConfig(key, value) {\n this.config = void 0;\n this.configProvider = this.configProvider.then((config) => {\n config[key] = value;\n return config;\n });\n }\n httpHandlerConfigs() {\n return this.config ?? {};\n }\n};\n\n// src/stream-collector.ts\nvar import_util_base64 = require(\"@smithy/util-base64\");\nvar streamCollector = /* @__PURE__ */ __name(async (stream) => {\n if (typeof Blob === \"function\" && stream instanceof Blob || stream.constructor?.name === \"Blob\") {\n if (Blob.prototype.arrayBuffer !== void 0) {\n return new Uint8Array(await stream.arrayBuffer());\n }\n return collectBlob(stream);\n }\n return collectStream(stream);\n}, \"streamCollector\");\nasync function collectBlob(blob) {\n const base64 = await readToBase64(blob);\n const arrayBuffer = (0, import_util_base64.fromBase64)(base64);\n return new Uint8Array(arrayBuffer);\n}\n__name(collectBlob, \"collectBlob\");\nasync function collectStream(stream) {\n const chunks = [];\n const reader = stream.getReader();\n let isDone = false;\n let length = 0;\n while (!isDone) {\n const { done, value } = await reader.read();\n if (value) {\n chunks.push(value);\n length += value.length;\n }\n isDone = done;\n }\n const collected = new Uint8Array(length);\n let offset = 0;\n for (const chunk of chunks) {\n collected.set(chunk, offset);\n offset += chunk.length;\n }\n return collected;\n}\n__name(collectStream, \"collectStream\");\nfunction readToBase64(blob) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n if (reader.readyState !== 2) {\n return reject(new Error(\"Reader aborted too early\"));\n }\n const result = reader.result ?? \"\";\n const commaIndex = result.indexOf(\",\");\n const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;\n resolve(result.substring(dataOffset));\n };\n reader.onabort = () => reject(new Error(\"Read aborted\"));\n reader.onerror = () => reject(reader.error);\n reader.readAsDataURL(blob);\n });\n}\n__name(readToBase64, \"readToBase64\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n keepAliveSupport,\n FetchHttpHandler,\n streamCollector\n});\n\n", - "'use strict';\n\nvar eventstreamCodec = require('@smithy/eventstream-codec');\nvar utilHexEncoding = require('@smithy/util-hex-encoding');\nvar protocolHttp = require('@smithy/protocol-http');\nvar utilFormatUrl = require('@aws-sdk/util-format-url');\nvar eventstreamSerdeBrowser = require('@smithy/eventstream-serde-browser');\nvar fetchHttpHandler = require('@smithy/fetch-http-handler');\n\nconst getEventSigningTransformStream = (initialSignature, messageSigner, eventStreamCodec, systemClockOffsetProvider) => {\n let priorSignature = initialSignature;\n const transformer = {\n start() { },\n async transform(chunk, controller) {\n try {\n const now = new Date(Date.now() + (await systemClockOffsetProvider()));\n const dateHeader = {\n \":date\": { type: \"timestamp\", value: now },\n };\n const signedMessage = await messageSigner.sign({\n message: {\n body: chunk,\n headers: dateHeader,\n },\n priorSignature: priorSignature,\n }, {\n signingDate: now,\n });\n priorSignature = signedMessage.signature;\n const serializedSigned = eventStreamCodec.encode({\n headers: {\n ...dateHeader,\n \":chunk-signature\": {\n type: \"binary\",\n value: utilHexEncoding.fromHex(signedMessage.signature),\n },\n },\n body: chunk,\n });\n controller.enqueue(serializedSigned);\n }\n catch (error) {\n controller.error(error);\n }\n },\n };\n return new TransformStream({ ...transformer });\n};\n\nclass EventStreamPayloadHandler {\n messageSigner;\n eventStreamCodec;\n systemClockOffsetProvider;\n constructor(options) {\n this.messageSigner = options.messageSigner;\n this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder);\n this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;\n }\n async handle(next, args, context = {}) {\n const request = args.request;\n const { body: payload, headers, query } = request;\n if (!(payload instanceof ReadableStream)) {\n throw new Error(\"Eventstream payload must be a ReadableStream.\");\n }\n const placeHolderStream = new TransformStream();\n request.body = placeHolderStream.readable;\n let result;\n try {\n result = await next(args);\n }\n catch (e) {\n request.body.cancel();\n throw e;\n }\n const match = (headers[\"authorization\"] || \"\").match(/Signature=([\\w]+)$/);\n const priorSignature = (match || [])[1] || (query && query[\"X-Amz-Signature\"]) || \"\";\n const signingStream = getEventSigningTransformStream(priorSignature, await this.messageSigner(), this.eventStreamCodec, this.systemClockOffsetProvider);\n const signedPayload = payload.pipeThrough(signingStream);\n signedPayload.pipeThrough(placeHolderStream);\n return result;\n }\n}\n\nconst eventStreamPayloadHandlerProvider = (options) => new EventStreamPayloadHandler(options);\n\nconst injectSessionIdMiddleware = () => (next) => async (args) => {\n const requestParams = {\n ...args.input,\n };\n const response = await next(args);\n const output = response.output;\n if (requestParams.SessionId && output.SessionId == null) {\n output.SessionId = requestParams.SessionId;\n }\n return response;\n};\nconst injectSessionIdMiddlewareOptions = {\n step: \"initialize\",\n name: \"injectSessionIdMiddleware\",\n tags: [\"WEBSOCKET\", \"EVENT_STREAM\"],\n override: true,\n};\n\nconst websocketEndpointMiddleware = (config, options) => (next) => (args) => {\n const { request } = args;\n if (protocolHttp.HttpRequest.isInstance(request) &&\n config.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes(\"websocket\")) {\n request.protocol = \"wss:\";\n request.method = \"GET\";\n request.path = `${request.path}-websocket`;\n const { headers } = request;\n delete headers[\"content-type\"];\n delete headers[\"x-amz-content-sha256\"];\n for (const name of Object.keys(headers)) {\n if (name.indexOf(options.headerPrefix) === 0) {\n const chunkedName = name.replace(options.headerPrefix, \"\");\n request.query[chunkedName] = headers[name];\n }\n }\n if (headers[\"x-amz-user-agent\"]) {\n request.query[\"user-agent\"] = headers[\"x-amz-user-agent\"];\n }\n request.headers = { host: headers.host ?? request.hostname };\n }\n return next(args);\n};\nconst websocketEndpointMiddlewareOptions = {\n name: \"websocketEndpointMiddleware\",\n tags: [\"WEBSOCKET\", \"EVENT_STREAM\"],\n relation: \"after\",\n toMiddleware: \"eventStreamHeaderMiddleware\",\n override: true,\n};\n\nconst getWebSocketPlugin = (config, options) => ({\n applyToStack: (clientStack) => {\n clientStack.addRelativeTo(websocketEndpointMiddleware(config, options), websocketEndpointMiddlewareOptions);\n clientStack.add(injectSessionIdMiddleware(), injectSessionIdMiddlewareOptions);\n },\n});\n\nconst isWebSocketRequest = (request) => request.protocol === \"ws:\" || request.protocol === \"wss:\";\n\nclass WebsocketSignatureV4 {\n signer;\n constructor(options) {\n this.signer = options.signer;\n }\n presign(originalRequest, options = {}) {\n return this.signer.presign(originalRequest, options);\n }\n async sign(toSign, options) {\n if (protocolHttp.HttpRequest.isInstance(toSign) && isWebSocketRequest(toSign)) {\n const signedRequest = await this.signer.presign({ ...toSign, body: \"\" }, {\n ...options,\n expiresIn: 60,\n unsignableHeaders: new Set(Object.keys(toSign.headers).filter((header) => header !== \"host\")),\n });\n return {\n ...signedRequest,\n body: toSign.body,\n };\n }\n else {\n return this.signer.sign(toSign, options);\n }\n }\n}\n\nconst resolveWebSocketConfig = (input) => {\n const { signer } = input;\n return Object.assign(input, {\n signer: async (authScheme) => {\n const signerObj = await signer(authScheme);\n if (validateSigner(signerObj)) {\n return new WebsocketSignatureV4({ signer: signerObj });\n }\n throw new Error(\"Expected WebsocketSignatureV4 signer, please check the client constructor.\");\n },\n });\n};\nconst validateSigner = (signer) => !!signer;\n\nconst DEFAULT_WS_CONNECTION_TIMEOUT_MS = 2000;\nclass WebSocketFetchHandler {\n metadata = {\n handlerProtocol: \"websocket/h1.1\",\n };\n config;\n configPromise;\n httpHandler;\n sockets = {};\n static create(instanceOrOptions, httpHandler = new fetchHttpHandler.FetchHttpHandler()) {\n if (typeof instanceOrOptions?.handle === \"function\") {\n return instanceOrOptions;\n }\n return new WebSocketFetchHandler(instanceOrOptions, httpHandler);\n }\n constructor(options, httpHandler = new fetchHttpHandler.FetchHttpHandler()) {\n this.httpHandler = httpHandler;\n if (typeof options === \"function\") {\n this.config = {};\n this.configPromise = options().then((opts) => (this.config = opts ?? {}));\n }\n else {\n this.config = options ?? {};\n this.configPromise = Promise.resolve(this.config);\n }\n }\n destroy() {\n for (const [key, sockets] of Object.entries(this.sockets)) {\n for (const socket of sockets) {\n socket.close(1000, `Socket closed through destroy() call`);\n }\n delete this.sockets[key];\n }\n }\n async handle(request) {\n if (!isWebSocketRequest(request)) {\n return this.httpHandler.handle(request);\n }\n const url = utilFormatUrl.formatUrl(request);\n const socket = new WebSocket(url);\n if (!this.sockets[url]) {\n this.sockets[url] = [];\n }\n this.sockets[url].push(socket);\n socket.binaryType = \"arraybuffer\";\n this.config = await this.configPromise;\n const { connectionTimeout = DEFAULT_WS_CONNECTION_TIMEOUT_MS } = this.config;\n await this.waitForReady(socket, connectionTimeout);\n const { body } = request;\n const bodyStream = getIterator(body);\n const asyncIterable = this.connect(socket, bodyStream);\n const outputPayload = toReadableStream(asyncIterable);\n return {\n response: new protocolHttp.HttpResponse({\n statusCode: 200,\n body: outputPayload,\n }),\n };\n }\n updateHttpClientConfig(key, value) {\n this.configPromise = this.configPromise.then((config) => {\n config[key] = value;\n return config;\n });\n }\n httpHandlerConfigs() {\n return this.config ?? {};\n }\n removeNotUsableSockets(url) {\n this.sockets[url] = (this.sockets[url] ?? []).filter((socket) => ![WebSocket.CLOSING, WebSocket.CLOSED].includes(socket.readyState));\n }\n waitForReady(socket, connectionTimeout) {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n this.removeNotUsableSockets(socket.url);\n reject({\n $metadata: {\n httpStatusCode: 500,\n },\n });\n }, connectionTimeout);\n socket.onopen = () => {\n clearTimeout(timeout);\n resolve();\n };\n });\n }\n connect(socket, data) {\n let streamError = undefined;\n let socketErrorOccurred = false;\n let reject = () => { };\n let resolve = () => { };\n socket.onmessage = (event) => {\n resolve({\n done: false,\n value: new Uint8Array(event.data),\n });\n };\n socket.onerror = (error) => {\n socketErrorOccurred = true;\n socket.close();\n reject(error);\n };\n socket.onclose = () => {\n this.removeNotUsableSockets(socket.url);\n if (socketErrorOccurred)\n return;\n if (streamError) {\n reject(streamError);\n }\n else {\n resolve({\n done: true,\n value: undefined,\n });\n }\n };\n const outputStream = {\n [Symbol.asyncIterator]: () => ({\n next: () => {\n return new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n },\n }),\n };\n const send = async () => {\n try {\n for await (const inputChunk of data) {\n socket.send(inputChunk);\n }\n }\n catch (err) {\n streamError = err;\n }\n finally {\n socket.close(1000);\n }\n };\n send();\n return outputStream;\n }\n}\nconst getIterator = (stream) => {\n if (stream[Symbol.asyncIterator]) {\n return stream;\n }\n if (isReadableStream(stream)) {\n return eventstreamSerdeBrowser.readableStreamtoIterable(stream);\n }\n return {\n [Symbol.asyncIterator]: async function* () {\n yield stream;\n },\n };\n};\nconst toReadableStream = (asyncIterable) => typeof ReadableStream === \"function\" ? eventstreamSerdeBrowser.iterableToReadableStream(asyncIterable) : asyncIterable;\nconst isReadableStream = (payload) => typeof ReadableStream === \"function\" && payload instanceof ReadableStream;\n\nexports.WebSocketFetchHandler = WebSocketFetchHandler;\nexports.eventStreamPayloadHandlerProvider = eventStreamPayloadHandlerProvider;\nexports.getWebSocketPlugin = getWebSocketPlugin;\nexports.resolveWebSocketConfig = resolveWebSocketConfig;\n", - "'use strict';\n\nconst resolveEventStreamSerdeConfig = (input) => Object.assign(input, {\n eventStreamMarshaller: input.eventStreamSerdeProvider(input),\n});\n\nexports.resolveEventStreamSerdeConfig = resolveEventStreamSerdeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultBedrockRuntimeHttpAuthSchemeProvider = exports.defaultBedrockRuntimeHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst core_2 = require(\"@smithy/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultBedrockRuntimeHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultBedrockRuntimeHttpAuthSchemeParametersProvider = defaultBedrockRuntimeHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"bedrock\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiHttpBearerAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#httpBearerAuth\",\n propertiesExtractor: ({ profile, filepath, configFilepath, ignoreCache }, context) => ({\n identityProperties: {\n profile,\n filepath,\n configFilepath,\n ignoreCache,\n },\n }),\n };\n}\nconst defaultBedrockRuntimeHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n options.push(createSmithyApiHttpBearerAuthHttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultBedrockRuntimeHttpAuthSchemeProvider = defaultBedrockRuntimeHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const token = (0, core_2.memoizeIdentityProvider)(config.token, core_2.isIdentityExpired, core_2.doesIdentityRequireRefresh);\n const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n token,\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", - "'use strict';\n\nvar eventstreamCodec = require('@smithy/eventstream-codec');\nvar stream = require('stream');\n\nclass EventSigningStream extends stream.Transform {\n priorSignature;\n messageSigner;\n eventStreamCodec;\n systemClockOffsetProvider;\n constructor(options) {\n super({\n autoDestroy: true,\n readableObjectMode: true,\n writableObjectMode: true,\n ...options,\n });\n this.priorSignature = options.priorSignature;\n this.eventStreamCodec = options.eventStreamCodec;\n this.messageSigner = options.messageSigner;\n this.systemClockOffsetProvider = options.systemClockOffsetProvider;\n }\n async _transform(chunk, encoding, callback) {\n try {\n const now = new Date(Date.now() + (await this.systemClockOffsetProvider()));\n const dateHeader = {\n \":date\": { type: \"timestamp\", value: now },\n };\n const signedMessage = await this.messageSigner.sign({\n message: {\n body: chunk,\n headers: dateHeader,\n },\n priorSignature: this.priorSignature,\n }, {\n signingDate: now,\n });\n this.priorSignature = signedMessage.signature;\n const serializedSigned = this.eventStreamCodec.encode({\n headers: {\n ...dateHeader,\n \":chunk-signature\": {\n type: \"binary\",\n value: getSignatureBinary(signedMessage.signature),\n },\n },\n body: chunk,\n });\n this.push(serializedSigned);\n return callback();\n }\n catch (err) {\n callback(err);\n }\n }\n}\nfunction getSignatureBinary(signature) {\n const buf = Buffer.from(signature, \"hex\");\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n}\n\nclass EventStreamPayloadHandler {\n messageSigner;\n eventStreamCodec;\n systemClockOffsetProvider;\n constructor(options) {\n this.messageSigner = options.messageSigner;\n this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder);\n this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;\n }\n async handle(next, args, context = {}) {\n const request = args.request;\n const { body: payload, query } = request;\n if (!(payload instanceof stream.Readable)) {\n throw new Error(\"Eventstream payload must be a Readable stream.\");\n }\n const payloadStream = payload;\n request.body = new stream.PassThrough({\n objectMode: true,\n });\n const match = request.headers?.authorization?.match(/Signature=([\\w]+)$/);\n const priorSignature = match?.[1] ?? query?.[\"X-Amz-Signature\"] ?? \"\";\n const signingStream = new EventSigningStream({\n priorSignature,\n eventStreamCodec: this.eventStreamCodec,\n messageSigner: await this.messageSigner(),\n systemClockOffsetProvider: this.systemClockOffsetProvider,\n });\n stream.pipeline(payloadStream, signingStream, request.body, (err) => {\n if (err) {\n throw err;\n }\n });\n let result;\n try {\n result = await next(args);\n }\n catch (e) {\n request.body.end();\n throw e;\n }\n return result;\n }\n}\n\nconst eventStreamPayloadHandlerProvider = (options) => new EventStreamPayloadHandler(options);\n\nexports.eventStreamPayloadHandlerProvider = eventStreamPayloadHandlerProvider;\n", - "var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n EventStreamMarshaller: () => EventStreamMarshaller,\n eventStreamSerdeProvider: () => eventStreamSerdeProvider\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/EventStreamMarshaller.ts\nvar import_eventstream_serde_universal = require(\"@smithy/eventstream-serde-universal\");\nvar import_stream = require(\"stream\");\n\n// src/utils.ts\nasync function* readabletoIterable(readStream) {\n let streamEnded = false;\n let generationEnded = false;\n const records = new Array();\n readStream.on(\"error\", (err) => {\n if (!streamEnded) {\n streamEnded = true;\n }\n if (err) {\n throw err;\n }\n });\n readStream.on(\"data\", (data) => {\n records.push(data);\n });\n readStream.on(\"end\", () => {\n streamEnded = true;\n });\n while (!generationEnded) {\n const value = await new Promise((resolve) => setTimeout(() => resolve(records.shift()), 0));\n if (value) {\n yield value;\n }\n generationEnded = streamEnded && records.length === 0;\n }\n}\n__name(readabletoIterable, \"readabletoIterable\");\n\n// src/EventStreamMarshaller.ts\nvar _EventStreamMarshaller = class _EventStreamMarshaller {\n constructor({ utf8Encoder, utf8Decoder }) {\n this.universalMarshaller = new import_eventstream_serde_universal.EventStreamMarshaller({\n utf8Decoder,\n utf8Encoder\n });\n }\n deserialize(body, deserializer) {\n const bodyIterable = typeof body[Symbol.asyncIterator] === \"function\" ? body : readabletoIterable(body);\n return this.universalMarshaller.deserialize(bodyIterable, deserializer);\n }\n serialize(input, serializer) {\n return import_stream.Readable.from(this.universalMarshaller.serialize(input, serializer));\n }\n};\n__name(_EventStreamMarshaller, \"EventStreamMarshaller\");\nvar EventStreamMarshaller = _EventStreamMarshaller;\n\n// src/provider.ts\nvar eventStreamSerdeProvider = /* @__PURE__ */ __name((options) => new EventStreamMarshaller(options), \"eventStreamSerdeProvider\");\n// Annotate the CommonJS export names for ESM import in node:\n\n0 && (module.exports = {\n EventStreamMarshaller,\n eventStreamSerdeProvider\n});\n\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst s = \"required\", t = \"fn\", u = \"argv\", v = \"ref\";\nconst a = true, b = \"isSet\", c = \"booleanEquals\", d = \"error\", e = \"endpoint\", f = \"tree\", g = \"PartitionResult\", h = { [s]: false, \"type\": \"string\" }, i = { [s]: true, \"default\": false, \"type\": \"boolean\" }, j = { [v]: \"Endpoint\" }, k = { [t]: c, [u]: [{ [v]: \"UseFIPS\" }, true] }, l = { [t]: c, [u]: [{ [v]: \"UseDualStack\" }, true] }, m = {}, n = { [t]: \"getAttr\", [u]: [{ [v]: g }, \"supportsFIPS\"] }, o = { [t]: c, [u]: [true, { [t]: \"getAttr\", [u]: [{ [v]: g }, \"supportsDualStack\"] }] }, p = [k], q = [l], r = [{ [v]: \"Region\" }];\nconst _data = { version: \"1.0\", parameters: { Region: h, UseDualStack: i, UseFIPS: i, Endpoint: h }, rules: [{ conditions: [{ [t]: b, [u]: [j] }], rules: [{ conditions: p, error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", type: d }, { rules: [{ conditions: q, error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", type: d }, { endpoint: { url: j, properties: m, headers: m }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [t]: b, [u]: r }], rules: [{ conditions: [{ [t]: \"aws.partition\", [u]: r, assign: g }], rules: [{ conditions: [k, l], rules: [{ conditions: [{ [t]: c, [u]: [a, n] }, o], rules: [{ rules: [{ endpoint: { url: \"https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", type: d }], type: f }, { conditions: p, rules: [{ conditions: [{ [t]: c, [u]: [n, a] }], rules: [{ rules: [{ endpoint: { url: \"https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: \"FIPS is enabled but this partition does not support FIPS\", type: d }], type: f }, { conditions: q, rules: [{ conditions: [o], rules: [{ rules: [{ endpoint: { url: \"https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: \"DualStack is enabled but this partition does not support DualStack\", type: d }], type: f }, { rules: [{ endpoint: { url: \"https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}\", properties: m, headers: m }, type: e }], type: f }], type: f }], type: f }, { error: \"Invalid Configuration: Missing Region\", type: d }], type: f }] };\nexports.ruleSet = _data;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2023-09-30\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultBedrockRuntimeHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#httpBearerAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#httpBearerAuth\"),\n signer: new core_2.HttpBearerAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: \"com.amazonaws.bedrockruntime\" }),\n serviceId: config?.serviceId ?? \"Bedrock Runtime\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst credential_provider_node_1 = require(\"@aws-sdk/credential-provider-node\");\nconst eventstream_handler_node_1 = require(\"@aws-sdk/eventstream-handler-node\");\nconst token_providers_1 = require(\"@aws-sdk/token-providers\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst core_2 = require(\"@smithy/core\");\nconst eventstream_serde_node_1 = require(\"@smithy/eventstream-serde-node\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n signingName: \"bedrock\",\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventstream_handler_node_1.eventStreamPayloadHandlerProvider,\n eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventstream_serde_node_1.eventStreamSerdeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#httpBearerAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#httpBearerAuth\") ||\n (async (idProps) => {\n try {\n return await (0, token_providers_1.fromEnvSigningName)({ signingName: \"bedrock\" })();\n }\n catch (error) {\n return await (0, token_providers_1.nodeProvider)(idProps)(idProps);\n }\n }),\n signer: new core_2.HttpBearerAuthSigner(),\n },\n ],\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttp2Handler.create(config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true }))),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "'use strict';\n\nvar middlewareEventstream = require('@aws-sdk/middleware-eventstream');\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar middlewareWebsocket = require('@aws-sdk/middleware-websocket');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar eventstreamSerdeConfigResolver = require('@smithy/eventstream-serde-config-resolver');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"bedrock\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n let _token = runtimeConfig.token;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n setToken(token) {\n _token = token;\n },\n token() {\n return _token;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n token: config.token(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass BedrockRuntimeClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = eventstreamSerdeConfigResolver.resolveEventStreamSerdeConfig(_config_6);\n const _config_8 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_7);\n const _config_9 = middlewareEventstream.resolveEventStreamConfig(_config_8);\n const _config_10 = middlewareWebsocket.resolveWebSocketConfig(_config_9);\n const _config_11 = resolveRuntimeExtensions(_config_10, configuration?.extensions || []);\n this.config = _config_11;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultBedrockRuntimeHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n \"smithy.api#httpBearerAuth\": config.token,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nlet BedrockRuntimeServiceException$1 = class BedrockRuntimeServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, BedrockRuntimeServiceException.prototype);\n }\n};\n\nlet AccessDeniedException$1 = class AccessDeniedException extends BedrockRuntimeServiceException$1 {\n name = \"AccessDeniedException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"AccessDeniedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, AccessDeniedException.prototype);\n }\n};\nlet InternalServerException$1 = class InternalServerException extends BedrockRuntimeServiceException$1 {\n name = \"InternalServerException\";\n $fault = \"server\";\n constructor(opts) {\n super({\n name: \"InternalServerException\",\n $fault: \"server\",\n ...opts,\n });\n Object.setPrototypeOf(this, InternalServerException.prototype);\n }\n};\nlet ThrottlingException$1 = class ThrottlingException extends BedrockRuntimeServiceException$1 {\n name = \"ThrottlingException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ThrottlingException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ThrottlingException.prototype);\n }\n};\nlet ValidationException$1 = class ValidationException extends BedrockRuntimeServiceException$1 {\n name = \"ValidationException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ValidationException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ValidationException.prototype);\n }\n};\nlet ConflictException$1 = class ConflictException extends BedrockRuntimeServiceException$1 {\n name = \"ConflictException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ConflictException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ConflictException.prototype);\n }\n};\nlet ResourceNotFoundException$1 = class ResourceNotFoundException extends BedrockRuntimeServiceException$1 {\n name = \"ResourceNotFoundException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ResourceNotFoundException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ResourceNotFoundException.prototype);\n }\n};\nlet ServiceQuotaExceededException$1 = class ServiceQuotaExceededException extends BedrockRuntimeServiceException$1 {\n name = \"ServiceQuotaExceededException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ServiceQuotaExceededException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);\n }\n};\nlet ServiceUnavailableException$1 = class ServiceUnavailableException extends BedrockRuntimeServiceException$1 {\n name = \"ServiceUnavailableException\";\n $fault = \"server\";\n constructor(opts) {\n super({\n name: \"ServiceUnavailableException\",\n $fault: \"server\",\n ...opts,\n });\n Object.setPrototypeOf(this, ServiceUnavailableException.prototype);\n }\n};\nlet ModelErrorException$1 = class ModelErrorException extends BedrockRuntimeServiceException$1 {\n name = \"ModelErrorException\";\n $fault = \"client\";\n originalStatusCode;\n resourceName;\n constructor(opts) {\n super({\n name: \"ModelErrorException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ModelErrorException.prototype);\n this.originalStatusCode = opts.originalStatusCode;\n this.resourceName = opts.resourceName;\n }\n};\nlet ModelNotReadyException$1 = class ModelNotReadyException extends BedrockRuntimeServiceException$1 {\n name = \"ModelNotReadyException\";\n $fault = \"client\";\n $retryable = {};\n constructor(opts) {\n super({\n name: \"ModelNotReadyException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ModelNotReadyException.prototype);\n }\n};\nlet ModelTimeoutException$1 = class ModelTimeoutException extends BedrockRuntimeServiceException$1 {\n name = \"ModelTimeoutException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ModelTimeoutException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ModelTimeoutException.prototype);\n }\n};\nlet ModelStreamErrorException$1 = class ModelStreamErrorException extends BedrockRuntimeServiceException$1 {\n name = \"ModelStreamErrorException\";\n $fault = \"client\";\n originalStatusCode;\n originalMessage;\n constructor(opts) {\n super({\n name: \"ModelStreamErrorException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ModelStreamErrorException.prototype);\n this.originalStatusCode = opts.originalStatusCode;\n this.originalMessage = opts.originalMessage;\n }\n};\n\nconst _A = \"Accept\";\nconst _ADE = \"AccessDeniedException\";\nconst _AG = \"ApplyGuardrail\";\nconst _AGR = \"ApplyGuardrailRequest\";\nconst _AGRp = \"ApplyGuardrailResponse\";\nconst _AIM = \"AsyncInvokeMessage\";\nconst _AIODC = \"AsyncInvokeOutputDataConfig\";\nconst _AIS = \"AsyncInvokeSummary\";\nconst _AISODC = \"AsyncInvokeS3OutputDataConfig\";\nconst _AISs = \"AsyncInvokeSummaries\";\nconst _ATC = \"AnyToolChoice\";\nconst _ATCu = \"AutoToolChoice\";\nconst _B = \"Body\";\nconst _BIPP = \"BidirectionalInputPayloadPart\";\nconst _BOPP = \"BidirectionalOutputPayloadPart\";\nconst _C = \"Citation\";\nconst _CB = \"ContentBlocks\";\nconst _CBD = \"ContentBlockDelta\";\nconst _CBDE = \"ContentBlockDeltaEvent\";\nconst _CBS = \"ContentBlockStart\";\nconst _CBSE = \"ContentBlockStartEvent\";\nconst _CBSEo = \"ContentBlockStopEvent\";\nconst _CBo = \"ContentBlock\";\nconst _CC = \"CitationsConfig\";\nconst _CCB = \"CitationsContentBlock\";\nconst _CD = \"CitationsDelta\";\nconst _CE = \"ConflictException\";\nconst _CGC = \"CitationGeneratedContent\";\nconst _CGCL = \"CitationGeneratedContentList\";\nconst _CL = \"CitationLocation\";\nconst _CM = \"ConverseMetrics\";\nconst _CO = \"ConverseOutput\";\nconst _CPB = \"CachePointBlock\";\nconst _CR = \"ConverseRequest\";\nconst _CRo = \"ConverseResponse\";\nconst _CS = \"ConverseStream\";\nconst _CSC = \"CitationSourceContent\";\nconst _CSCD = \"CitationSourceContentDelta\";\nconst _CSCL = \"CitationSourceContentList\";\nconst _CSCLD = \"CitationSourceContentListDelta\";\nconst _CSM = \"ConverseStreamMetrics\";\nconst _CSME = \"ConverseStreamMetadataEvent\";\nconst _CSO = \"ConverseStreamOutput\";\nconst _CSR = \"ConverseStreamRequest\";\nconst _CSRo = \"ConverseStreamResponse\";\nconst _CST = \"ConverseStreamTrace\";\nconst _CT = \"ConverseTrace\";\nconst _CTI = \"CountTokensInput\";\nconst _CTR = \"ConverseTokensRequest\";\nconst _CTRo = \"CountTokensRequest\";\nconst _CTRou = \"CountTokensResponse\";\nconst _CT_ = \"Content-Type\";\nconst _CTo = \"CountTokens\";\nconst _Ci = \"Citations\";\nconst _Co = \"Converse\";\nconst _DB = \"DocumentBlock\";\nconst _DCB = \"DocumentContentBlocks\";\nconst _DCBo = \"DocumentContentBlock\";\nconst _DCL = \"DocumentCharLocation\";\nconst _DCLo = \"DocumentChunkLocation\";\nconst _DPL = \"DocumentPageLocation\";\nconst _DS = \"DocumentSource\";\nconst _GA = \"GuardrailAssessment\";\nconst _GAI = \"GetAsyncInvoke\";\nconst _GAIR = \"GetAsyncInvokeRequest\";\nconst _GAIRe = \"GetAsyncInvokeResponse\";\nconst _GAL = \"GuardrailAssessmentList\";\nconst _GALM = \"GuardrailAssessmentListMap\";\nconst _GAM = \"GuardrailAssessmentMap\";\nconst _GARDSL = \"GuardrailAutomatedReasoningDifferenceScenarioList\";\nconst _GARF = \"GuardrailAutomatedReasoningFinding\";\nconst _GARFL = \"GuardrailAutomatedReasoningFindingList\";\nconst _GARIF = \"GuardrailAutomatedReasoningImpossibleFinding\";\nconst _GARIFu = \"GuardrailAutomatedReasoningInvalidFinding\";\nconst _GARITR = \"GuardrailAutomatedReasoningInputTextReference\";\nconst _GARITRL = \"GuardrailAutomatedReasoningInputTextReferenceList\";\nconst _GARLW = \"GuardrailAutomatedReasoningLogicWarning\";\nconst _GARNTF = \"GuardrailAutomatedReasoningNoTranslationsFinding\";\nconst _GARPA = \"GuardrailAutomatedReasoningPolicyAssessment\";\nconst _GARR = \"GuardrailAutomatedReasoningRule\";\nconst _GARRL = \"GuardrailAutomatedReasoningRuleList\";\nconst _GARS = \"GuardrailAutomatedReasoningScenario\";\nconst _GARSF = \"GuardrailAutomatedReasoningSatisfiableFinding\";\nconst _GARSL = \"GuardrailAutomatedReasoningStatementList\";\nconst _GARSLC = \"GuardrailAutomatedReasoningStatementLogicContent\";\nconst _GARSNLC = \"GuardrailAutomatedReasoningStatementNaturalLanguageContent\";\nconst _GARSu = \"GuardrailAutomatedReasoningStatement\";\nconst _GART = \"GuardrailAutomatedReasoningTranslation\";\nconst _GARTAF = \"GuardrailAutomatedReasoningTranslationAmbiguousFinding\";\nconst _GARTCF = \"GuardrailAutomatedReasoningTooComplexFinding\";\nconst _GARTL = \"GuardrailAutomatedReasoningTranslationList\";\nconst _GARTO = \"GuardrailAutomatedReasoningTranslationOption\";\nconst _GARTOL = \"GuardrailAutomatedReasoningTranslationOptionList\";\nconst _GARVF = \"GuardrailAutomatedReasoningValidFinding\";\nconst _GC = \"GuardrailConfiguration\";\nconst _GCB = \"GuardrailContentBlock\";\nconst _GCBL = \"GuardrailContentBlockList\";\nconst _GCCB = \"GuardrailConverseContentBlock\";\nconst _GCF = \"GuardrailContentFilter\";\nconst _GCFL = \"GuardrailContentFilterList\";\nconst _GCGF = \"GuardrailContextualGroundingFilter\";\nconst _GCGFu = \"GuardrailContextualGroundingFilters\";\nconst _GCGPA = \"GuardrailContextualGroundingPolicyAssessment\";\nconst _GCIB = \"GuardrailConverseImageBlock\";\nconst _GCIS = \"GuardrailConverseImageSource\";\nconst _GCPA = \"GuardrailContentPolicyAssessment\";\nconst _GCTB = \"GuardrailConverseTextBlock\";\nconst _GCW = \"GuardrailCustomWord\";\nconst _GCWL = \"GuardrailCustomWordList\";\nconst _GCu = \"GuardrailCoverage\";\nconst _GIB = \"GuardrailImageBlock\";\nconst _GIC = \"GuardrailImageCoverage\";\nconst _GIM = \"GuardrailInvocationMetrics\";\nconst _GIS = \"GuardrailImageSource\";\nconst _GMW = \"GuardrailManagedWord\";\nconst _GMWL = \"GuardrailManagedWordList\";\nconst _GOC = \"GuardrailOutputContent\";\nconst _GOCL = \"GuardrailOutputContentList\";\nconst _GPEF = \"GuardrailPiiEntityFilter\";\nconst _GPEFL = \"GuardrailPiiEntityFilterList\";\nconst _GRF = \"GuardrailRegexFilter\";\nconst _GRFL = \"GuardrailRegexFilterList\";\nconst _GSC = \"GuardrailStreamConfiguration\";\nconst _GSIPA = \"GuardrailSensitiveInformationPolicyAssessment\";\nconst _GT = \"GuardrailTopic\";\nconst _GTA = \"GuardrailTraceAssessment\";\nconst _GTB = \"GuardrailTextBlock\";\nconst _GTCC = \"GuardrailTextCharactersCoverage\";\nconst _GTL = \"GuardrailTopicList\";\nconst _GTPA = \"GuardrailTopicPolicyAssessment\";\nconst _GU = \"GuardrailUsage\";\nconst _GWPA = \"GuardrailWordPolicyAssessment\";\nconst _IB = \"ImageBlock\";\nconst _IC = \"InferenceConfiguration\";\nconst _IM = \"InvokeModel\";\nconst _IMR = \"InvokeModelRequest\";\nconst _IMRn = \"InvokeModelResponse\";\nconst _IMTR = \"InvokeModelTokensRequest\";\nconst _IMWBS = \"InvokeModelWithBidirectionalStream\";\nconst _IMWBSI = \"InvokeModelWithBidirectionalStreamInput\";\nconst _IMWBSO = \"InvokeModelWithBidirectionalStreamOutput\";\nconst _IMWBSR = \"InvokeModelWithBidirectionalStreamRequest\";\nconst _IMWBSRn = \"InvokeModelWithBidirectionalStreamResponse\";\nconst _IMWRS = \"InvokeModelWithResponseStream\";\nconst _IMWRSR = \"InvokeModelWithResponseStreamRequest\";\nconst _IMWRSRn = \"InvokeModelWithResponseStreamResponse\";\nconst _IS = \"ImageSource\";\nconst _ISE = \"InternalServerException\";\nconst _LAI = \"ListAsyncInvokes\";\nconst _LAIR = \"ListAsyncInvokesRequest\";\nconst _LAIRi = \"ListAsyncInvokesResponse\";\nconst _M = \"Message\";\nconst _MEE = \"ModelErrorException\";\nconst _MIP = \"ModelInputPayload\";\nconst _MNRE = \"ModelNotReadyException\";\nconst _MSE = \"MessageStartEvent\";\nconst _MSEE = \"ModelStreamErrorException\";\nconst _MSEe = \"MessageStopEvent\";\nconst _MTE = \"ModelTimeoutException\";\nconst _Me = \"Messages\";\nconst _PB = \"PartBody\";\nconst _PC = \"PerformanceConfiguration\";\nconst _PP = \"PayloadPart\";\nconst _PRT = \"PromptRouterTrace\";\nconst _PVM = \"PromptVariableMap\";\nconst _PVV = \"PromptVariableValues\";\nconst _RCB = \"ReasoningContentBlock\";\nconst _RCBD = \"ReasoningContentBlockDelta\";\nconst _RM = \"RequestMetadata\";\nconst _RNFE = \"ResourceNotFoundException\";\nconst _RS = \"ResponseStream\";\nconst _RTB = \"ReasoningTextBlock\";\nconst _SAI = \"StartAsyncInvoke\";\nconst _SAIR = \"StartAsyncInvokeRequest\";\nconst _SAIRt = \"StartAsyncInvokeResponse\";\nconst _SCB = \"SystemContentBlocks\";\nconst _SCBy = \"SystemContentBlock\";\nconst _SL = \"S3Location\";\nconst _SQEE = \"ServiceQuotaExceededException\";\nconst _SRB = \"SearchResultBlock\";\nconst _SRCB = \"SearchResultContentBlock\";\nconst _SRCBe = \"SearchResultContentBlocks\";\nconst _SRL = \"SearchResultLocation\";\nconst _ST = \"ServiceTier\";\nconst _STC = \"SpecificToolChoice\";\nconst _STy = \"SystemTool\";\nconst _SUE = \"ServiceUnavailableException\";\nconst _T = \"Tag\";\nconst _TC = \"ToolConfiguration\";\nconst _TCo = \"ToolChoice\";\nconst _TE = \"ThrottlingException\";\nconst _TIS = \"ToolInputSchema\";\nconst _TL = \"TagList\";\nconst _TRB = \"ToolResultBlock\";\nconst _TRBD = \"ToolResultBlocksDelta\";\nconst _TRBDo = \"ToolResultBlockDelta\";\nconst _TRBS = \"ToolResultBlockStart\";\nconst _TRCB = \"ToolResultContentBlocks\";\nconst _TRCBo = \"ToolResultContentBlock\";\nconst _TS = \"ToolSpecification\";\nconst _TU = \"TokenUsage\";\nconst _TUB = \"ToolUseBlock\";\nconst _TUBD = \"ToolUseBlockDelta\";\nconst _TUBS = \"ToolUseBlockStart\";\nconst _To = \"Tools\";\nconst _Too = \"Tool\";\nconst _VB = \"VideoBlock\";\nconst _VE = \"ValidationException\";\nconst _VS = \"VideoSource\";\nconst _WL = \"WebLocation\";\nconst _XABA = \"X-Amzn-Bedrock-Accept\";\nconst _XABCT = \"X-Amzn-Bedrock-Content-Type\";\nconst _XABG = \"X-Amzn-Bedrock-GuardrailIdentifier\";\nconst _XABG_ = \"X-Amzn-Bedrock-GuardrailVersion\";\nconst _XABPL = \"X-Amzn-Bedrock-PerformanceConfig-Latency\";\nconst _XABST = \"X-Amzn-Bedrock-Service-Tier\";\nconst _XABT = \"X-Amzn-Bedrock-Trace\";\nconst _a = \"action\";\nconst _aIS = \"asyncInvokeSummaries\";\nconst _aMRF = \"additionalModelRequestFields\";\nconst _aMRFP = \"additionalModelResponseFieldPaths\";\nconst _aMRFd = \"additionalModelResponseFields\";\nconst _aR = \"actionReason\";\nconst _aRP = \"automatedReasoningPolicy\";\nconst _aRPU = \"automatedReasoningPolicyUnits\";\nconst _aRPu = \"automatedReasoningPolicies\";\nconst _ac = \"accept\";\nconst _an = \"any\";\nconst _as = \"assessments\";\nconst _au = \"auto\";\nconst _b = \"bytes\";\nconst _bO = \"bucketOwner\";\nconst _bo = \"body\";\nconst _c = \"client\";\nconst _cBD = \"contentBlockDelta\";\nconst _cBI = \"contentBlockIndex\";\nconst _cBS = \"contentBlockStart\";\nconst _cBSo = \"contentBlockStop\";\nconst _cC = \"citationsContent\";\nconst _cFS = \"claimsFalseScenario\";\nconst _cGP = \"contextualGroundingPolicy\";\nconst _cGPU = \"contextualGroundingPolicyUnits\";\nconst _cP = \"contentPolicy\";\nconst _cPIU = \"contentPolicyImageUnits\";\nconst _cPU = \"contentPolicyUnits\";\nconst _cPa = \"cachePoint\";\nconst _cR = \"contradictingRules\";\nconst _cRIT = \"cacheReadInputTokens\";\nconst _cRT = \"clientRequestToken\";\nconst _cT = \"contentType\";\nconst _cTS = \"claimsTrueScenario\";\nconst _cW = \"customWords\";\nconst _cWIT = \"cacheWriteInputTokens\";\nconst _ch = \"chunk\";\nconst _ci = \"citations\";\nconst _cit = \"citation\";\nconst _cl = \"claims\";\nconst _co = \"content\";\nconst _con = \"context\";\nconst _conf = \"confidence\";\nconst _conv = \"converse\";\nconst _d = \"delta\";\nconst _dC = \"documentChar\";\nconst _dCo = \"documentChunk\";\nconst _dI = \"documentIndex\";\nconst _dP = \"documentPage\";\nconst _dS = \"differenceScenarios\";\nconst _de = \"detected\";\nconst _des = \"description\";\nconst _do = \"domain\";\nconst _doc = \"document\";\nconst _e = \"error\";\nconst _eT = \"endTime\";\nconst _en = \"enabled\";\nconst _end = \"end\";\nconst _f = \"format\";\nconst _fM = \"failureMessage\";\nconst _fS = \"filterStrength\";\nconst _fi = \"findings\";\nconst _fil = \"filters\";\nconst _g = \"guardrail\";\nconst _gC = \"guardrailCoverage\";\nconst _gCu = \"guardrailConfig\";\nconst _gCua = \"guardContent\";\nconst _gI = \"guardrailIdentifier\";\nconst _gPL = \"guardrailProcessingLatency\";\nconst _gV = \"guardrailVersion\";\nconst _gu = \"guarded\";\nconst _h = \"http\";\nconst _hE = \"httpError\";\nconst _hH = \"httpHeader\";\nconst _hQ = \"httpQuery\";\nconst _i = \"input\";\nconst _iA = \"invocationArn\";\nconst _iAn = \"inputAssessment\";\nconst _iC = \"inferenceConfig\";\nconst _iM = \"invocationMetrics\";\nconst _iMI = \"invokedModelId\";\nconst _iMn = \"invokeModel\";\nconst _iS = \"inputSchema\";\nconst _iSE = \"internalServerException\";\nconst _iT = \"inputTokens\";\nconst _id = \"identifier\";\nconst _im = \"images\";\nconst _ima = \"image\";\nconst _imp = \"impossible\";\nconst _in = \"invalid\";\nconst _j = \"json\";\nconst _k = \"key\";\nconst _kKI = \"kmsKeyId\";\nconst _l = \"location\";\nconst _lM = \"latencyMs\";\nconst _lMT = \"lastModifiedTime\";\nconst _lW = \"logicWarning\";\nconst _la = \"latency\";\nconst _lo = \"logic\";\nconst _m = \"message\";\nconst _mA = \"modelArn\";\nconst _mI = \"modelId\";\nconst _mIo = \"modelInput\";\nconst _mO = \"modelOutput\";\nconst _mR = \"maxResults\";\nconst _mS = \"messageStart\";\nconst _mSEE = \"modelStreamErrorException\";\nconst _mSe = \"messageStop\";\nconst _mT = \"maxTokens\";\nconst _mTE = \"modelTimeoutException\";\nconst _mWL = \"managedWordLists\";\nconst _ma = \"match\";\nconst _me = \"messages\";\nconst _met = \"metrics\";\nconst _meta = \"metadata\";\nconst _n = \"name\";\nconst _nL = \"naturalLanguage\";\nconst _nT = \"nextToken\";\nconst _nTo = \"noTranslations\";\nconst _o = \"outputs\";\nconst _oA = \"outputAssessments\";\nconst _oDC = \"outputDataConfig\";\nconst _oM = \"originalMessage\";\nconst _oS = \"outputScope\";\nconst _oSC = \"originalStatusCode\";\nconst _oT = \"outputTokens\";\nconst _op = \"options\";\nconst _ou = \"output\";\nconst _p = \"premises\";\nconst _pC = \"performanceConfig\";\nconst _pCL = \"performanceConfigLatency\";\nconst _pE = \"piiEntities\";\nconst _pR = \"promptRouter\";\nconst _pV = \"promptVariables\";\nconst _pVA = \"policyVersionArn\";\nconst _q = \"qualifiers\";\nconst _r = \"regex\";\nconst _rC = \"reasoningContent\";\nconst _rCe = \"redactedContent\";\nconst _rM = \"requestMetadata\";\nconst _rN = \"resourceName\";\nconst _rT = \"reasoningText\";\nconst _re = \"regexes\";\nconst _ro = \"role\";\nconst _s = \"source\";\nconst _sB = \"sortBy\";\nconst _sC = \"sourceContent\";\nconst _sE = \"statusEquals\";\nconst _sIP = \"sensitiveInformationPolicy\";\nconst _sIPFU = \"sensitiveInformationPolicyFreeUnits\";\nconst _sIPU = \"sensitiveInformationPolicyUnits\";\nconst _sL = \"s3Location\";\nconst _sO = \"sortOrder\";\nconst _sODC = \"s3OutputDataConfig\";\nconst _sPM = \"streamProcessingMode\";\nconst _sR = \"stopReason\";\nconst _sRI = \"searchResultIndex\";\nconst _sRL = \"searchResultLocation\";\nconst _sRe = \"searchResult\";\nconst _sRu = \"supportingRules\";\nconst _sS = \"stopSequences\";\nconst _sT = \"submitTime\";\nconst _sTA = \"submitTimeAfter\";\nconst _sTB = \"submitTimeBefore\";\nconst _sTe = \"serviceTier\";\nconst _sTy = \"systemTool\";\nconst _sU = \"s3Uri\";\nconst _sUE = \"serviceUnavailableException\";\nconst _sa = \"satisfiable\";\nconst _sc = \"score\";\nconst _se = \"server\";\nconst _si = \"signature\";\nconst _sm = \"smithy.ts.sdk.synthetic.com.amazonaws.bedrockruntime\";\nconst _st = \"status\";\nconst _sta = \"start\";\nconst _stat = \"statements\";\nconst _str = \"stream\";\nconst _stre = \"streaming\";\nconst _sy = \"system\";\nconst _t = \"type\";\nconst _tA = \"translationAmbiguous\";\nconst _tC = \"toolConfig\";\nconst _tCe = \"textCharacters\";\nconst _tCo = \"toolChoice\";\nconst _tCoo = \"tooComplex\";\nconst _tE = \"throttlingException\";\nconst _tP = \"topicPolicy\";\nconst _tPU = \"topicPolicyUnits\";\nconst _tPo = \"topP\";\nconst _tR = \"toolResult\";\nconst _tS = \"toolSpec\";\nconst _tT = \"totalTokens\";\nconst _tU = \"toolUse\";\nconst _tUI = \"toolUseId\";\nconst _ta = \"tags\";\nconst _te = \"text\";\nconst _tem = \"temperature\";\nconst _th = \"threshold\";\nconst _ti = \"title\";\nconst _to = \"total\";\nconst _too = \"tools\";\nconst _tool = \"tool\";\nconst _top = \"topics\";\nconst _tr = \"trace\";\nconst _tra = \"translation\";\nconst _tran = \"translations\";\nconst _u = \"usage\";\nconst _uC = \"untranslatedClaims\";\nconst _uP = \"untranslatedPremises\";\nconst _ur = \"uri\";\nconst _url = \"url\";\nconst _v = \"value\";\nconst _vE = \"validationException\";\nconst _va = \"valid\";\nconst _vi = \"video\";\nconst _w = \"web\";\nconst _wP = \"wordPolicy\";\nconst _wPU = \"wordPolicyUnits\";\nconst n0 = \"com.amazonaws.bedrockruntime\";\nvar AsyncInvokeMessage = [0, n0, _AIM, 8, 0];\nvar Body = [0, n0, _B, 8, 21];\nvar GuardrailAutomatedReasoningStatementLogicContent = [0, n0, _GARSLC, 8, 0];\nvar GuardrailAutomatedReasoningStatementNaturalLanguageContent = [0, n0, _GARSNLC, 8, 0];\nvar ModelInputPayload = [0, n0, _MIP, 8, 15];\nvar PartBody = [0, n0, _PB, 8, 21];\nvar AccessDeniedException = [\n -3,\n n0,\n _ADE,\n {\n [_e]: _c,\n [_hE]: 403,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1);\nvar AnyToolChoice = [3, n0, _ATC, 0, [], []];\nvar ApplyGuardrailRequest = [\n 3,\n n0,\n _AGR,\n 0,\n [_gI, _gV, _s, _co, _oS],\n [[0, 1], [0, 1], 0, [() => GuardrailContentBlockList, 0], 0],\n];\nvar ApplyGuardrailResponse = [\n 3,\n n0,\n _AGRp,\n 0,\n [_u, _a, _aR, _o, _as, _gC],\n [\n () => GuardrailUsage,\n 0,\n 0,\n () => GuardrailOutputContentList,\n [() => GuardrailAssessmentList, 0],\n () => GuardrailCoverage,\n ],\n];\nvar AsyncInvokeS3OutputDataConfig = [3, n0, _AISODC, 0, [_sU, _kKI, _bO], [0, 0, 0]];\nvar AsyncInvokeSummary = [\n 3,\n n0,\n _AIS,\n 0,\n [_iA, _mA, _cRT, _st, _fM, _sT, _lMT, _eT, _oDC],\n [0, 0, 0, 0, [() => AsyncInvokeMessage, 0], 5, 5, 5, () => AsyncInvokeOutputDataConfig],\n];\nvar AutoToolChoice = [3, n0, _ATCu, 0, [], []];\nvar BidirectionalInputPayloadPart = [3, n0, _BIPP, 8, [_b], [[() => PartBody, 0]]];\nvar BidirectionalOutputPayloadPart = [3, n0, _BOPP, 8, [_b], [[() => PartBody, 0]]];\nvar CachePointBlock = [3, n0, _CPB, 0, [_t], [0]];\nvar Citation = [\n 3,\n n0,\n _C,\n 0,\n [_ti, _s, _sC, _l],\n [0, 0, () => CitationSourceContentList, () => CitationLocation],\n];\nvar CitationsConfig = [3, n0, _CC, 0, [_en], [2]];\nvar CitationsContentBlock = [\n 3,\n n0,\n _CCB,\n 0,\n [_co, _ci],\n [() => CitationGeneratedContentList, () => Citations],\n];\nvar CitationsDelta = [\n 3,\n n0,\n _CD,\n 0,\n [_ti, _s, _sC, _l],\n [0, 0, () => CitationSourceContentListDelta, () => CitationLocation],\n];\nvar CitationSourceContentDelta = [3, n0, _CSCD, 0, [_te], [0]];\nvar ConflictException = [\n -3,\n n0,\n _CE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ConflictException, ConflictException$1);\nvar ContentBlockDeltaEvent = [\n 3,\n n0,\n _CBDE,\n 0,\n [_d, _cBI],\n [[() => ContentBlockDelta, 0], 1],\n];\nvar ContentBlockStartEvent = [\n 3,\n n0,\n _CBSE,\n 0,\n [_sta, _cBI],\n [() => ContentBlockStart, 1],\n];\nvar ContentBlockStopEvent = [3, n0, _CBSEo, 0, [_cBI], [1]];\nvar ConverseMetrics = [3, n0, _CM, 0, [_lM], [1]];\nvar ConverseRequest = [\n 3,\n n0,\n _CR,\n 0,\n [_mI, _me, _sy, _iC, _tC, _gCu, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe],\n [\n [0, 1],\n [() => Messages, 0],\n [() => SystemContentBlocks, 0],\n () => InferenceConfiguration,\n () => ToolConfiguration,\n () => GuardrailConfiguration,\n 15,\n [() => PromptVariableMap, 0],\n 64 | 0,\n [() => RequestMetadata, 0],\n () => PerformanceConfiguration,\n () => ServiceTier,\n ],\n];\nvar ConverseResponse = [\n 3,\n n0,\n _CRo,\n 0,\n [_ou, _sR, _u, _met, _aMRFd, _tr, _pC, _sTe],\n [\n [() => ConverseOutput, 0],\n 0,\n () => TokenUsage,\n () => ConverseMetrics,\n 15,\n [() => ConverseTrace, 0],\n () => PerformanceConfiguration,\n () => ServiceTier,\n ],\n];\nvar ConverseStreamMetadataEvent = [\n 3,\n n0,\n _CSME,\n 0,\n [_u, _met, _tr, _pC, _sTe],\n [\n () => TokenUsage,\n () => ConverseStreamMetrics,\n [() => ConverseStreamTrace, 0],\n () => PerformanceConfiguration,\n () => ServiceTier,\n ],\n];\nvar ConverseStreamMetrics = [3, n0, _CSM, 0, [_lM], [1]];\nvar ConverseStreamRequest = [\n 3,\n n0,\n _CSR,\n 0,\n [_mI, _me, _sy, _iC, _tC, _gCu, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe],\n [\n [0, 1],\n [() => Messages, 0],\n [() => SystemContentBlocks, 0],\n () => InferenceConfiguration,\n () => ToolConfiguration,\n () => GuardrailStreamConfiguration,\n 15,\n [() => PromptVariableMap, 0],\n 64 | 0,\n [() => RequestMetadata, 0],\n () => PerformanceConfiguration,\n () => ServiceTier,\n ],\n];\nvar ConverseStreamResponse = [\n 3,\n n0,\n _CSRo,\n 0,\n [_str],\n [[() => ConverseStreamOutput, 16]],\n];\nvar ConverseStreamTrace = [\n 3,\n n0,\n _CST,\n 0,\n [_g, _pR],\n [[() => GuardrailTraceAssessment, 0], () => PromptRouterTrace],\n];\nvar ConverseTokensRequest = [\n 3,\n n0,\n _CTR,\n 0,\n [_me, _sy, _tC, _aMRF],\n [[() => Messages, 0], [() => SystemContentBlocks, 0], () => ToolConfiguration, 15],\n];\nvar ConverseTrace = [\n 3,\n n0,\n _CT,\n 0,\n [_g, _pR],\n [[() => GuardrailTraceAssessment, 0], () => PromptRouterTrace],\n];\nvar CountTokensRequest = [\n 3,\n n0,\n _CTRo,\n 0,\n [_mI, _i],\n [\n [0, 1],\n [() => CountTokensInput, 0],\n ],\n];\nvar CountTokensResponse = [3, n0, _CTRou, 0, [_iT], [1]];\nvar DocumentBlock = [\n 3,\n n0,\n _DB,\n 0,\n [_f, _n, _s, _con, _ci],\n [0, 0, () => DocumentSource, 0, () => CitationsConfig],\n];\nvar DocumentCharLocation = [3, n0, _DCL, 0, [_dI, _sta, _end], [1, 1, 1]];\nvar DocumentChunkLocation = [3, n0, _DCLo, 0, [_dI, _sta, _end], [1, 1, 1]];\nvar DocumentPageLocation = [3, n0, _DPL, 0, [_dI, _sta, _end], [1, 1, 1]];\nvar GetAsyncInvokeRequest = [3, n0, _GAIR, 0, [_iA], [[0, 1]]];\nvar GetAsyncInvokeResponse = [\n 3,\n n0,\n _GAIRe,\n 0,\n [_iA, _mA, _cRT, _st, _fM, _sT, _lMT, _eT, _oDC],\n [0, 0, 0, 0, [() => AsyncInvokeMessage, 0], 5, 5, 5, () => AsyncInvokeOutputDataConfig],\n];\nvar GuardrailAssessment = [\n 3,\n n0,\n _GA,\n 0,\n [_tP, _cP, _wP, _sIP, _cGP, _aRP, _iM],\n [\n () => GuardrailTopicPolicyAssessment,\n () => GuardrailContentPolicyAssessment,\n () => GuardrailWordPolicyAssessment,\n () => GuardrailSensitiveInformationPolicyAssessment,\n () => GuardrailContextualGroundingPolicyAssessment,\n [() => GuardrailAutomatedReasoningPolicyAssessment, 0],\n () => GuardrailInvocationMetrics,\n ],\n];\nvar GuardrailAutomatedReasoningImpossibleFinding = [\n 3,\n n0,\n _GARIF,\n 0,\n [_tra, _cR, _lW],\n [\n [() => GuardrailAutomatedReasoningTranslation, 0],\n () => GuardrailAutomatedReasoningRuleList,\n [() => GuardrailAutomatedReasoningLogicWarning, 0],\n ],\n];\nvar GuardrailAutomatedReasoningInputTextReference = [\n 3,\n n0,\n _GARITR,\n 0,\n [_te],\n [[() => GuardrailAutomatedReasoningStatementNaturalLanguageContent, 0]],\n];\nvar GuardrailAutomatedReasoningInvalidFinding = [\n 3,\n n0,\n _GARIFu,\n 0,\n [_tra, _cR, _lW],\n [\n [() => GuardrailAutomatedReasoningTranslation, 0],\n () => GuardrailAutomatedReasoningRuleList,\n [() => GuardrailAutomatedReasoningLogicWarning, 0],\n ],\n];\nvar GuardrailAutomatedReasoningLogicWarning = [\n 3,\n n0,\n _GARLW,\n 0,\n [_t, _p, _cl],\n [0, [() => GuardrailAutomatedReasoningStatementList, 0], [() => GuardrailAutomatedReasoningStatementList, 0]],\n];\nvar GuardrailAutomatedReasoningNoTranslationsFinding = [3, n0, _GARNTF, 0, [], []];\nvar GuardrailAutomatedReasoningPolicyAssessment = [\n 3,\n n0,\n _GARPA,\n 0,\n [_fi],\n [[() => GuardrailAutomatedReasoningFindingList, 0]],\n];\nvar GuardrailAutomatedReasoningRule = [3, n0, _GARR, 0, [_id, _pVA], [0, 0]];\nvar GuardrailAutomatedReasoningSatisfiableFinding = [\n 3,\n n0,\n _GARSF,\n 0,\n [_tra, _cTS, _cFS, _lW],\n [\n [() => GuardrailAutomatedReasoningTranslation, 0],\n [() => GuardrailAutomatedReasoningScenario, 0],\n [() => GuardrailAutomatedReasoningScenario, 0],\n [() => GuardrailAutomatedReasoningLogicWarning, 0],\n ],\n];\nvar GuardrailAutomatedReasoningScenario = [\n 3,\n n0,\n _GARS,\n 0,\n [_stat],\n [[() => GuardrailAutomatedReasoningStatementList, 0]],\n];\nvar GuardrailAutomatedReasoningStatement = [\n 3,\n n0,\n _GARSu,\n 0,\n [_lo, _nL],\n [\n [() => GuardrailAutomatedReasoningStatementLogicContent, 0],\n [() => GuardrailAutomatedReasoningStatementNaturalLanguageContent, 0],\n ],\n];\nvar GuardrailAutomatedReasoningTooComplexFinding = [3, n0, _GARTCF, 0, [], []];\nvar GuardrailAutomatedReasoningTranslation = [\n 3,\n n0,\n _GART,\n 0,\n [_p, _cl, _uP, _uC, _conf],\n [\n [() => GuardrailAutomatedReasoningStatementList, 0],\n [() => GuardrailAutomatedReasoningStatementList, 0],\n [() => GuardrailAutomatedReasoningInputTextReferenceList, 0],\n [() => GuardrailAutomatedReasoningInputTextReferenceList, 0],\n 1,\n ],\n];\nvar GuardrailAutomatedReasoningTranslationAmbiguousFinding = [\n 3,\n n0,\n _GARTAF,\n 0,\n [_op, _dS],\n [\n [() => GuardrailAutomatedReasoningTranslationOptionList, 0],\n [() => GuardrailAutomatedReasoningDifferenceScenarioList, 0],\n ],\n];\nvar GuardrailAutomatedReasoningTranslationOption = [\n 3,\n n0,\n _GARTO,\n 0,\n [_tran],\n [[() => GuardrailAutomatedReasoningTranslationList, 0]],\n];\nvar GuardrailAutomatedReasoningValidFinding = [\n 3,\n n0,\n _GARVF,\n 0,\n [_tra, _cTS, _sRu, _lW],\n [\n [() => GuardrailAutomatedReasoningTranslation, 0],\n [() => GuardrailAutomatedReasoningScenario, 0],\n () => GuardrailAutomatedReasoningRuleList,\n [() => GuardrailAutomatedReasoningLogicWarning, 0],\n ],\n];\nvar GuardrailConfiguration = [3, n0, _GC, 0, [_gI, _gV, _tr], [0, 0, 0]];\nvar GuardrailContentFilter = [3, n0, _GCF, 0, [_t, _conf, _fS, _a, _de], [0, 0, 0, 0, 2]];\nvar GuardrailContentPolicyAssessment = [\n 3,\n n0,\n _GCPA,\n 0,\n [_fil],\n [() => GuardrailContentFilterList],\n];\nvar GuardrailContextualGroundingFilter = [\n 3,\n n0,\n _GCGF,\n 0,\n [_t, _th, _sc, _a, _de],\n [0, 1, 1, 0, 2],\n];\nvar GuardrailContextualGroundingPolicyAssessment = [\n 3,\n n0,\n _GCGPA,\n 0,\n [_fil],\n [() => GuardrailContextualGroundingFilters],\n];\nvar GuardrailConverseImageBlock = [\n 3,\n n0,\n _GCIB,\n 8,\n [_f, _s],\n [0, [() => GuardrailConverseImageSource, 0]],\n];\nvar GuardrailConverseTextBlock = [3, n0, _GCTB, 0, [_te, _q], [0, 64 | 0]];\nvar GuardrailCoverage = [\n 3,\n n0,\n _GCu,\n 0,\n [_tCe, _im],\n [() => GuardrailTextCharactersCoverage, () => GuardrailImageCoverage],\n];\nvar GuardrailCustomWord = [3, n0, _GCW, 0, [_ma, _a, _de], [0, 0, 2]];\nvar GuardrailImageBlock = [\n 3,\n n0,\n _GIB,\n 8,\n [_f, _s],\n [0, [() => GuardrailImageSource, 0]],\n];\nvar GuardrailImageCoverage = [3, n0, _GIC, 0, [_gu, _to], [1, 1]];\nvar GuardrailInvocationMetrics = [\n 3,\n n0,\n _GIM,\n 0,\n [_gPL, _u, _gC],\n [1, () => GuardrailUsage, () => GuardrailCoverage],\n];\nvar GuardrailManagedWord = [3, n0, _GMW, 0, [_ma, _t, _a, _de], [0, 0, 0, 2]];\nvar GuardrailOutputContent = [3, n0, _GOC, 0, [_te], [0]];\nvar GuardrailPiiEntityFilter = [3, n0, _GPEF, 0, [_ma, _t, _a, _de], [0, 0, 0, 2]];\nvar GuardrailRegexFilter = [3, n0, _GRF, 0, [_n, _ma, _r, _a, _de], [0, 0, 0, 0, 2]];\nvar GuardrailSensitiveInformationPolicyAssessment = [\n 3,\n n0,\n _GSIPA,\n 0,\n [_pE, _re],\n [() => GuardrailPiiEntityFilterList, () => GuardrailRegexFilterList],\n];\nvar GuardrailStreamConfiguration = [3, n0, _GSC, 0, [_gI, _gV, _tr, _sPM], [0, 0, 0, 0]];\nvar GuardrailTextBlock = [3, n0, _GTB, 0, [_te, _q], [0, 64 | 0]];\nvar GuardrailTextCharactersCoverage = [3, n0, _GTCC, 0, [_gu, _to], [1, 1]];\nvar GuardrailTopic = [3, n0, _GT, 0, [_n, _t, _a, _de], [0, 0, 0, 2]];\nvar GuardrailTopicPolicyAssessment = [\n 3,\n n0,\n _GTPA,\n 0,\n [_top],\n [() => GuardrailTopicList],\n];\nvar GuardrailTraceAssessment = [\n 3,\n n0,\n _GTA,\n 0,\n [_mO, _iAn, _oA, _aR],\n [64 | 0, [() => GuardrailAssessmentMap, 0], [() => GuardrailAssessmentListMap, 0], 0],\n];\nvar GuardrailUsage = [\n 3,\n n0,\n _GU,\n 0,\n [_tPU, _cPU, _wPU, _sIPU, _sIPFU, _cGPU, _cPIU, _aRPU, _aRPu],\n [1, 1, 1, 1, 1, 1, 1, 1, 1],\n];\nvar GuardrailWordPolicyAssessment = [\n 3,\n n0,\n _GWPA,\n 0,\n [_cW, _mWL],\n [() => GuardrailCustomWordList, () => GuardrailManagedWordList],\n];\nvar ImageBlock = [3, n0, _IB, 0, [_f, _s], [0, () => ImageSource]];\nvar InferenceConfiguration = [3, n0, _IC, 0, [_mT, _tem, _tPo, _sS], [1, 1, 1, 64 | 0]];\nvar InternalServerException = [\n -3,\n n0,\n _ISE,\n {\n [_e]: _se,\n [_hE]: 500,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1);\nvar InvokeModelRequest = [\n 3,\n n0,\n _IMR,\n 0,\n [_bo, _cT, _ac, _mI, _tr, _gI, _gV, _pCL, _sTe],\n [\n [() => Body, 16],\n [\n 0,\n {\n [_hH]: _CT_,\n },\n ],\n [\n 0,\n {\n [_hH]: _A,\n },\n ],\n [0, 1],\n [\n 0,\n {\n [_hH]: _XABT,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABG,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABG_,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABPL,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABST,\n },\n ],\n ],\n];\nvar InvokeModelResponse = [\n 3,\n n0,\n _IMRn,\n 0,\n [_bo, _cT, _pCL, _sTe],\n [\n [() => Body, 16],\n [\n 0,\n {\n [_hH]: _CT_,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABPL,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABST,\n },\n ],\n ],\n];\nvar InvokeModelTokensRequest = [3, n0, _IMTR, 0, [_bo], [[() => Body, 0]]];\nvar InvokeModelWithBidirectionalStreamRequest = [\n 3,\n n0,\n _IMWBSR,\n 0,\n [_mI, _bo],\n [\n [0, 1],\n [() => InvokeModelWithBidirectionalStreamInput, 16],\n ],\n];\nvar InvokeModelWithBidirectionalStreamResponse = [\n 3,\n n0,\n _IMWBSRn,\n 0,\n [_bo],\n [[() => InvokeModelWithBidirectionalStreamOutput, 16]],\n];\nvar InvokeModelWithResponseStreamRequest = [\n 3,\n n0,\n _IMWRSR,\n 0,\n [_bo, _cT, _ac, _mI, _tr, _gI, _gV, _pCL, _sTe],\n [\n [() => Body, 16],\n [\n 0,\n {\n [_hH]: _CT_,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABA,\n },\n ],\n [0, 1],\n [\n 0,\n {\n [_hH]: _XABT,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABG,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABG_,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABPL,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABST,\n },\n ],\n ],\n];\nvar InvokeModelWithResponseStreamResponse = [\n 3,\n n0,\n _IMWRSRn,\n 0,\n [_bo, _cT, _pCL, _sTe],\n [\n [() => ResponseStream, 16],\n [\n 0,\n {\n [_hH]: _XABCT,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABPL,\n },\n ],\n [\n 0,\n {\n [_hH]: _XABST,\n },\n ],\n ],\n];\nvar ListAsyncInvokesRequest = [\n 3,\n n0,\n _LAIR,\n 0,\n [_sTA, _sTB, _sE, _mR, _nT, _sB, _sO],\n [\n [\n 5,\n {\n [_hQ]: _sTA,\n },\n ],\n [\n 5,\n {\n [_hQ]: _sTB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sE,\n },\n ],\n [\n 1,\n {\n [_hQ]: _mR,\n },\n ],\n [\n 0,\n {\n [_hQ]: _nT,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sB,\n },\n ],\n [\n 0,\n {\n [_hQ]: _sO,\n },\n ],\n ],\n];\nvar ListAsyncInvokesResponse = [\n 3,\n n0,\n _LAIRi,\n 0,\n [_nT, _aIS],\n [0, [() => AsyncInvokeSummaries, 0]],\n];\nvar Message = [3, n0, _M, 0, [_ro, _co], [0, [() => ContentBlocks, 0]]];\nvar MessageStartEvent = [3, n0, _MSE, 0, [_ro], [0]];\nvar MessageStopEvent = [3, n0, _MSEe, 0, [_sR, _aMRFd], [0, 15]];\nvar ModelErrorException = [\n -3,\n n0,\n _MEE,\n {\n [_e]: _c,\n [_hE]: 424,\n },\n [_m, _oSC, _rN],\n [0, 1, 0],\n];\nschema.TypeRegistry.for(n0).registerError(ModelErrorException, ModelErrorException$1);\nvar ModelNotReadyException = [\n -3,\n n0,\n _MNRE,\n {\n [_e]: _c,\n [_hE]: 429,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ModelNotReadyException, ModelNotReadyException$1);\nvar ModelStreamErrorException = [\n -3,\n n0,\n _MSEE,\n {\n [_e]: _c,\n [_hE]: 424,\n },\n [_m, _oSC, _oM],\n [0, 1, 0],\n];\nschema.TypeRegistry.for(n0).registerError(ModelStreamErrorException, ModelStreamErrorException$1);\nvar ModelTimeoutException = [\n -3,\n n0,\n _MTE,\n {\n [_e]: _c,\n [_hE]: 408,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ModelTimeoutException, ModelTimeoutException$1);\nvar PayloadPart = [3, n0, _PP, 8, [_b], [[() => PartBody, 0]]];\nvar PerformanceConfiguration = [3, n0, _PC, 0, [_la], [0]];\nvar PromptRouterTrace = [3, n0, _PRT, 0, [_iMI], [0]];\nvar ReasoningTextBlock = [3, n0, _RTB, 8, [_te, _si], [0, 0]];\nvar ResourceNotFoundException = [\n -3,\n n0,\n _RNFE,\n {\n [_e]: _c,\n [_hE]: 404,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1);\nvar S3Location = [3, n0, _SL, 0, [_ur, _bO], [0, 0]];\nvar SearchResultBlock = [\n 3,\n n0,\n _SRB,\n 0,\n [_s, _ti, _co, _ci],\n [0, 0, () => SearchResultContentBlocks, () => CitationsConfig],\n];\nvar SearchResultContentBlock = [3, n0, _SRCB, 0, [_te], [0]];\nvar SearchResultLocation = [3, n0, _SRL, 0, [_sRI, _sta, _end], [1, 1, 1]];\nvar ServiceQuotaExceededException = [\n -3,\n n0,\n _SQEE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ServiceQuotaExceededException, ServiceQuotaExceededException$1);\nvar ServiceTier = [3, n0, _ST, 0, [_t], [0]];\nvar ServiceUnavailableException = [\n -3,\n n0,\n _SUE,\n {\n [_e]: _se,\n [_hE]: 503,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ServiceUnavailableException, ServiceUnavailableException$1);\nvar SpecificToolChoice = [3, n0, _STC, 0, [_n], [0]];\nvar StartAsyncInvokeRequest = [\n 3,\n n0,\n _SAIR,\n 0,\n [_cRT, _mI, _mIo, _oDC, _ta],\n [[0, 4], 0, [() => ModelInputPayload, 0], () => AsyncInvokeOutputDataConfig, () => TagList],\n];\nvar StartAsyncInvokeResponse = [3, n0, _SAIRt, 0, [_iA], [0]];\nvar SystemTool = [3, n0, _STy, 0, [_n], [0]];\nvar Tag = [3, n0, _T, 0, [_k, _v], [0, 0]];\nvar ThrottlingException = [\n -3,\n n0,\n _TE,\n {\n [_e]: _c,\n [_hE]: 429,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ThrottlingException, ThrottlingException$1);\nvar TokenUsage = [3, n0, _TU, 0, [_iT, _oT, _tT, _cRIT, _cWIT], [1, 1, 1, 1, 1]];\nvar ToolConfiguration = [3, n0, _TC, 0, [_too, _tCo], [() => Tools, () => ToolChoice]];\nvar ToolResultBlock = [\n 3,\n n0,\n _TRB,\n 0,\n [_tUI, _co, _st, _t],\n [0, () => ToolResultContentBlocks, 0, 0],\n];\nvar ToolResultBlockStart = [3, n0, _TRBS, 0, [_tUI, _t, _st], [0, 0, 0]];\nvar ToolSpecification = [3, n0, _TS, 0, [_n, _des, _iS], [0, 0, () => ToolInputSchema]];\nvar ToolUseBlock = [3, n0, _TUB, 0, [_tUI, _n, _i, _t], [0, 0, 15, 0]];\nvar ToolUseBlockDelta = [3, n0, _TUBD, 0, [_i], [0]];\nvar ToolUseBlockStart = [3, n0, _TUBS, 0, [_tUI, _n, _t], [0, 0, 0]];\nvar ValidationException = [\n -3,\n n0,\n _VE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1);\nvar VideoBlock = [3, n0, _VB, 0, [_f, _s], [0, () => VideoSource]];\nvar WebLocation = [3, n0, _WL, 0, [_url, _do], [0, 0]];\nvar BedrockRuntimeServiceException = [-3, _sm, \"BedrockRuntimeServiceException\", 0, [], []];\nschema.TypeRegistry.for(_sm).registerError(BedrockRuntimeServiceException, BedrockRuntimeServiceException$1);\nvar AsyncInvokeSummaries = [1, n0, _AISs, 0, [() => AsyncInvokeSummary, 0]];\nvar CitationGeneratedContentList = [1, n0, _CGCL, 0, () => CitationGeneratedContent];\nvar Citations = [1, n0, _Ci, 0, () => Citation];\nvar CitationSourceContentList = [1, n0, _CSCL, 0, () => CitationSourceContent];\nvar CitationSourceContentListDelta = [1, n0, _CSCLD, 0, () => CitationSourceContentDelta];\nvar ContentBlocks = [1, n0, _CB, 0, [() => ContentBlock, 0]];\nvar DocumentContentBlocks = [1, n0, _DCB, 0, () => DocumentContentBlock];\nvar GuardrailAssessmentList = [1, n0, _GAL, 0, [() => GuardrailAssessment, 0]];\nvar GuardrailAutomatedReasoningDifferenceScenarioList = [\n 1,\n n0,\n _GARDSL,\n 0,\n [() => GuardrailAutomatedReasoningScenario, 0],\n];\nvar GuardrailAutomatedReasoningFindingList = [\n 1,\n n0,\n _GARFL,\n 0,\n [() => GuardrailAutomatedReasoningFinding, 0],\n];\nvar GuardrailAutomatedReasoningInputTextReferenceList = [\n 1,\n n0,\n _GARITRL,\n 0,\n [() => GuardrailAutomatedReasoningInputTextReference, 0],\n];\nvar GuardrailAutomatedReasoningRuleList = [\n 1,\n n0,\n _GARRL,\n 0,\n () => GuardrailAutomatedReasoningRule,\n];\nvar GuardrailAutomatedReasoningStatementList = [\n 1,\n n0,\n _GARSL,\n 0,\n [() => GuardrailAutomatedReasoningStatement, 0],\n];\nvar GuardrailAutomatedReasoningTranslationList = [\n 1,\n n0,\n _GARTL,\n 0,\n [() => GuardrailAutomatedReasoningTranslation, 0],\n];\nvar GuardrailAutomatedReasoningTranslationOptionList = [\n 1,\n n0,\n _GARTOL,\n 0,\n [() => GuardrailAutomatedReasoningTranslationOption, 0],\n];\nvar GuardrailContentBlockList = [1, n0, _GCBL, 0, [() => GuardrailContentBlock, 0]];\nvar GuardrailContentFilterList = [1, n0, _GCFL, 0, () => GuardrailContentFilter];\nvar GuardrailContextualGroundingFilters = [\n 1,\n n0,\n _GCGFu,\n 0,\n () => GuardrailContextualGroundingFilter,\n];\nvar GuardrailCustomWordList = [1, n0, _GCWL, 0, () => GuardrailCustomWord];\nvar GuardrailManagedWordList = [1, n0, _GMWL, 0, () => GuardrailManagedWord];\nvar GuardrailOutputContentList = [1, n0, _GOCL, 0, () => GuardrailOutputContent];\nvar GuardrailPiiEntityFilterList = [1, n0, _GPEFL, 0, () => GuardrailPiiEntityFilter];\nvar GuardrailRegexFilterList = [1, n0, _GRFL, 0, () => GuardrailRegexFilter];\nvar GuardrailTopicList = [1, n0, _GTL, 0, () => GuardrailTopic];\nvar Messages = [1, n0, _Me, 0, [() => Message, 0]];\nvar SearchResultContentBlocks = [1, n0, _SRCBe, 0, () => SearchResultContentBlock];\nvar SystemContentBlocks = [1, n0, _SCB, 0, [() => SystemContentBlock, 0]];\nvar TagList = [1, n0, _TL, 0, () => Tag];\nvar ToolResultBlocksDelta = [1, n0, _TRBD, 0, () => ToolResultBlockDelta];\nvar ToolResultContentBlocks = [1, n0, _TRCB, 0, () => ToolResultContentBlock];\nvar Tools = [1, n0, _To, 0, () => Tool];\nvar GuardrailAssessmentListMap = [2, n0, _GALM, 0, [0, 0], [() => GuardrailAssessmentList, 0]];\nvar GuardrailAssessmentMap = [2, n0, _GAM, 0, [0, 0], [() => GuardrailAssessment, 0]];\nvar PromptVariableMap = [2, n0, _PVM, 8, 0, () => PromptVariableValues];\nvar RequestMetadata = [2, n0, _RM, 8, 0, 0];\nvar AsyncInvokeOutputDataConfig = [\n 3,\n n0,\n _AIODC,\n 0,\n [_sODC],\n [() => AsyncInvokeS3OutputDataConfig],\n];\nvar CitationGeneratedContent = [3, n0, _CGC, 0, [_te], [0]];\nvar CitationLocation = [\n 3,\n n0,\n _CL,\n 0,\n [_w, _dC, _dP, _dCo, _sRL],\n [\n () => WebLocation,\n () => DocumentCharLocation,\n () => DocumentPageLocation,\n () => DocumentChunkLocation,\n () => SearchResultLocation,\n ],\n];\nvar CitationSourceContent = [3, n0, _CSC, 0, [_te], [0]];\nvar ContentBlock = [\n 3,\n n0,\n _CBo,\n 0,\n [_te, _ima, _doc, _vi, _tU, _tR, _gCua, _cPa, _rC, _cC, _sRe],\n [\n 0,\n () => ImageBlock,\n () => DocumentBlock,\n () => VideoBlock,\n () => ToolUseBlock,\n () => ToolResultBlock,\n [() => GuardrailConverseContentBlock, 0],\n () => CachePointBlock,\n [() => ReasoningContentBlock, 0],\n () => CitationsContentBlock,\n () => SearchResultBlock,\n ],\n];\nvar ContentBlockDelta = [\n 3,\n n0,\n _CBD,\n 0,\n [_te, _tU, _tR, _rC, _cit],\n [\n 0,\n () => ToolUseBlockDelta,\n () => ToolResultBlocksDelta,\n [() => ReasoningContentBlockDelta, 0],\n () => CitationsDelta,\n ],\n];\nvar ContentBlockStart = [\n 3,\n n0,\n _CBS,\n 0,\n [_tU, _tR],\n [() => ToolUseBlockStart, () => ToolResultBlockStart],\n];\nvar ConverseOutput = [3, n0, _CO, 0, [_m], [[() => Message, 0]]];\nvar ConverseStreamOutput = [\n 3,\n n0,\n _CSO,\n {\n [_stre]: 1,\n },\n [_mS, _cBS, _cBD, _cBSo, _mSe, _meta, _iSE, _mSEE, _vE, _tE, _sUE],\n [\n () => MessageStartEvent,\n () => ContentBlockStartEvent,\n [() => ContentBlockDeltaEvent, 0],\n () => ContentBlockStopEvent,\n () => MessageStopEvent,\n [() => ConverseStreamMetadataEvent, 0],\n [() => InternalServerException, 0],\n [() => ModelStreamErrorException, 0],\n [() => ValidationException, 0],\n [() => ThrottlingException, 0],\n [() => ServiceUnavailableException, 0],\n ],\n];\nvar CountTokensInput = [\n 3,\n n0,\n _CTI,\n 0,\n [_iMn, _conv],\n [\n [() => InvokeModelTokensRequest, 0],\n [() => ConverseTokensRequest, 0],\n ],\n];\nvar DocumentContentBlock = [3, n0, _DCBo, 0, [_te], [0]];\nvar DocumentSource = [\n 3,\n n0,\n _DS,\n 0,\n [_b, _sL, _te, _co],\n [21, () => S3Location, 0, () => DocumentContentBlocks],\n];\nvar GuardrailAutomatedReasoningFinding = [\n 3,\n n0,\n _GARF,\n 0,\n [_va, _in, _sa, _imp, _tA, _tCoo, _nTo],\n [\n [() => GuardrailAutomatedReasoningValidFinding, 0],\n [() => GuardrailAutomatedReasoningInvalidFinding, 0],\n [() => GuardrailAutomatedReasoningSatisfiableFinding, 0],\n [() => GuardrailAutomatedReasoningImpossibleFinding, 0],\n [() => GuardrailAutomatedReasoningTranslationAmbiguousFinding, 0],\n () => GuardrailAutomatedReasoningTooComplexFinding,\n () => GuardrailAutomatedReasoningNoTranslationsFinding,\n ],\n];\nvar GuardrailContentBlock = [\n 3,\n n0,\n _GCB,\n 0,\n [_te, _ima],\n [() => GuardrailTextBlock, [() => GuardrailImageBlock, 0]],\n];\nvar GuardrailConverseContentBlock = [\n 3,\n n0,\n _GCCB,\n 0,\n [_te, _ima],\n [() => GuardrailConverseTextBlock, [() => GuardrailConverseImageBlock, 0]],\n];\nvar GuardrailConverseImageSource = [3, n0, _GCIS, 8, [_b], [21]];\nvar GuardrailImageSource = [3, n0, _GIS, 8, [_b], [21]];\nvar ImageSource = [3, n0, _IS, 0, [_b, _sL], [21, () => S3Location]];\nvar InvokeModelWithBidirectionalStreamInput = [\n 3,\n n0,\n _IMWBSI,\n {\n [_stre]: 1,\n },\n [_ch],\n [[() => BidirectionalInputPayloadPart, 0]],\n];\nvar InvokeModelWithBidirectionalStreamOutput = [\n 3,\n n0,\n _IMWBSO,\n {\n [_stre]: 1,\n },\n [_ch, _iSE, _mSEE, _vE, _tE, _mTE, _sUE],\n [\n [() => BidirectionalOutputPayloadPart, 0],\n [() => InternalServerException, 0],\n [() => ModelStreamErrorException, 0],\n [() => ValidationException, 0],\n [() => ThrottlingException, 0],\n [() => ModelTimeoutException, 0],\n [() => ServiceUnavailableException, 0],\n ],\n];\nvar PromptVariableValues = [3, n0, _PVV, 0, [_te], [0]];\nvar ReasoningContentBlock = [\n 3,\n n0,\n _RCB,\n 8,\n [_rT, _rCe],\n [[() => ReasoningTextBlock, 0], 21],\n];\nvar ReasoningContentBlockDelta = [3, n0, _RCBD, 8, [_te, _rCe, _si], [0, 21, 0]];\nvar ResponseStream = [\n 3,\n n0,\n _RS,\n {\n [_stre]: 1,\n },\n [_ch, _iSE, _mSEE, _vE, _tE, _mTE, _sUE],\n [\n [() => PayloadPart, 0],\n [() => InternalServerException, 0],\n [() => ModelStreamErrorException, 0],\n [() => ValidationException, 0],\n [() => ThrottlingException, 0],\n [() => ModelTimeoutException, 0],\n [() => ServiceUnavailableException, 0],\n ],\n];\nvar SystemContentBlock = [\n 3,\n n0,\n _SCBy,\n 0,\n [_te, _gCua, _cPa],\n [0, [() => GuardrailConverseContentBlock, 0], () => CachePointBlock],\n];\nvar Tool = [\n 3,\n n0,\n _Too,\n 0,\n [_tS, _sTy, _cPa],\n [() => ToolSpecification, () => SystemTool, () => CachePointBlock],\n];\nvar ToolChoice = [\n 3,\n n0,\n _TCo,\n 0,\n [_au, _an, _tool],\n [() => AutoToolChoice, () => AnyToolChoice, () => SpecificToolChoice],\n];\nvar ToolInputSchema = [3, n0, _TIS, 0, [_j], [15]];\nvar ToolResultBlockDelta = [3, n0, _TRBDo, 0, [_te], [0]];\nvar ToolResultContentBlock = [\n 3,\n n0,\n _TRCBo,\n 0,\n [_j, _te, _ima, _doc, _vi, _sRe],\n [15, 0, () => ImageBlock, () => DocumentBlock, () => VideoBlock, () => SearchResultBlock],\n];\nvar VideoSource = [3, n0, _VS, 0, [_b, _sL], [21, () => S3Location]];\nvar ApplyGuardrail = [\n 9,\n n0,\n _AG,\n {\n [_h]: [\"POST\", \"/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply\", 200],\n },\n () => ApplyGuardrailRequest,\n () => ApplyGuardrailResponse,\n];\nvar Converse = [\n 9,\n n0,\n _Co,\n {\n [_h]: [\"POST\", \"/model/{modelId}/converse\", 200],\n },\n () => ConverseRequest,\n () => ConverseResponse,\n];\nvar ConverseStream = [\n 9,\n n0,\n _CS,\n {\n [_h]: [\"POST\", \"/model/{modelId}/converse-stream\", 200],\n },\n () => ConverseStreamRequest,\n () => ConverseStreamResponse,\n];\nvar CountTokens = [\n 9,\n n0,\n _CTo,\n {\n [_h]: [\"POST\", \"/model/{modelId}/count-tokens\", 200],\n },\n () => CountTokensRequest,\n () => CountTokensResponse,\n];\nvar GetAsyncInvoke = [\n 9,\n n0,\n _GAI,\n {\n [_h]: [\"GET\", \"/async-invoke/{invocationArn}\", 200],\n },\n () => GetAsyncInvokeRequest,\n () => GetAsyncInvokeResponse,\n];\nvar InvokeModel = [\n 9,\n n0,\n _IM,\n {\n [_h]: [\"POST\", \"/model/{modelId}/invoke\", 200],\n },\n () => InvokeModelRequest,\n () => InvokeModelResponse,\n];\nvar InvokeModelWithBidirectionalStream = [\n 9,\n n0,\n _IMWBS,\n {\n [_h]: [\"POST\", \"/model/{modelId}/invoke-with-bidirectional-stream\", 200],\n },\n () => InvokeModelWithBidirectionalStreamRequest,\n () => InvokeModelWithBidirectionalStreamResponse,\n];\nvar InvokeModelWithResponseStream = [\n 9,\n n0,\n _IMWRS,\n {\n [_h]: [\"POST\", \"/model/{modelId}/invoke-with-response-stream\", 200],\n },\n () => InvokeModelWithResponseStreamRequest,\n () => InvokeModelWithResponseStreamResponse,\n];\nvar ListAsyncInvokes = [\n 9,\n n0,\n _LAI,\n {\n [_h]: [\"GET\", \"/async-invoke\", 200],\n },\n () => ListAsyncInvokesRequest,\n () => ListAsyncInvokesResponse,\n];\nvar StartAsyncInvoke = [\n 9,\n n0,\n _SAI,\n {\n [_h]: [\"POST\", \"/async-invoke\", 200],\n },\n () => StartAsyncInvokeRequest,\n () => StartAsyncInvokeResponse,\n];\n\nclass ApplyGuardrailCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"ApplyGuardrail\", {})\n .n(\"BedrockRuntimeClient\", \"ApplyGuardrailCommand\")\n .sc(ApplyGuardrail)\n .build() {\n}\n\nclass ConverseCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"Converse\", {})\n .n(\"BedrockRuntimeClient\", \"ConverseCommand\")\n .sc(Converse)\n .build() {\n}\n\nclass ConverseStreamCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"ConverseStream\", {\n eventStream: {\n output: true,\n },\n})\n .n(\"BedrockRuntimeClient\", \"ConverseStreamCommand\")\n .sc(ConverseStream)\n .build() {\n}\n\nclass CountTokensCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"CountTokens\", {})\n .n(\"BedrockRuntimeClient\", \"CountTokensCommand\")\n .sc(CountTokens)\n .build() {\n}\n\nclass GetAsyncInvokeCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"GetAsyncInvoke\", {})\n .n(\"BedrockRuntimeClient\", \"GetAsyncInvokeCommand\")\n .sc(GetAsyncInvoke)\n .build() {\n}\n\nclass InvokeModelCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"InvokeModel\", {})\n .n(\"BedrockRuntimeClient\", \"InvokeModelCommand\")\n .sc(InvokeModel)\n .build() {\n}\n\nclass InvokeModelWithBidirectionalStreamCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [\n middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n middlewareEventstream.getEventStreamPlugin(config),\n middlewareWebsocket.getWebSocketPlugin(config, {\n headerPrefix: \"x-amz-bedrock-\",\n }),\n ];\n})\n .s(\"AmazonBedrockFrontendService\", \"InvokeModelWithBidirectionalStream\", {\n eventStream: {\n input: true,\n output: true,\n },\n})\n .n(\"BedrockRuntimeClient\", \"InvokeModelWithBidirectionalStreamCommand\")\n .sc(InvokeModelWithBidirectionalStream)\n .build() {\n}\n\nclass InvokeModelWithResponseStreamCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"InvokeModelWithResponseStream\", {\n eventStream: {\n output: true,\n },\n})\n .n(\"BedrockRuntimeClient\", \"InvokeModelWithResponseStreamCommand\")\n .sc(InvokeModelWithResponseStream)\n .build() {\n}\n\nclass ListAsyncInvokesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"ListAsyncInvokes\", {})\n .n(\"BedrockRuntimeClient\", \"ListAsyncInvokesCommand\")\n .sc(ListAsyncInvokes)\n .build() {\n}\n\nclass StartAsyncInvokeCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AmazonBedrockFrontendService\", \"StartAsyncInvoke\", {})\n .n(\"BedrockRuntimeClient\", \"StartAsyncInvokeCommand\")\n .sc(StartAsyncInvoke)\n .build() {\n}\n\nconst commands = {\n ApplyGuardrailCommand,\n ConverseCommand,\n ConverseStreamCommand,\n CountTokensCommand,\n GetAsyncInvokeCommand,\n InvokeModelCommand,\n InvokeModelWithBidirectionalStreamCommand,\n InvokeModelWithResponseStreamCommand,\n ListAsyncInvokesCommand,\n StartAsyncInvokeCommand,\n};\nclass BedrockRuntime extends BedrockRuntimeClient {\n}\nsmithyClient.createAggregatedClient(commands, BedrockRuntime);\n\nconst paginateListAsyncInvokes = core.createPaginator(BedrockRuntimeClient, ListAsyncInvokesCommand, \"nextToken\", \"nextToken\", \"maxResults\");\n\nconst AsyncInvokeStatus = {\n COMPLETED: \"Completed\",\n FAILED: \"Failed\",\n IN_PROGRESS: \"InProgress\",\n};\nconst SortAsyncInvocationBy = {\n SUBMISSION_TIME: \"SubmissionTime\",\n};\nconst SortOrder = {\n ASCENDING: \"Ascending\",\n DESCENDING: \"Descending\",\n};\nconst GuardrailImageFormat = {\n JPEG: \"jpeg\",\n PNG: \"png\",\n};\nconst GuardrailContentQualifier = {\n GROUNDING_SOURCE: \"grounding_source\",\n GUARD_CONTENT: \"guard_content\",\n QUERY: \"query\",\n};\nconst GuardrailOutputScope = {\n FULL: \"FULL\",\n INTERVENTIONS: \"INTERVENTIONS\",\n};\nconst GuardrailContentSource = {\n INPUT: \"INPUT\",\n OUTPUT: \"OUTPUT\",\n};\nconst GuardrailAction = {\n GUARDRAIL_INTERVENED: \"GUARDRAIL_INTERVENED\",\n NONE: \"NONE\",\n};\nconst GuardrailAutomatedReasoningLogicWarningType = {\n ALWAYS_FALSE: \"ALWAYS_FALSE\",\n ALWAYS_TRUE: \"ALWAYS_TRUE\",\n};\nconst GuardrailContentPolicyAction = {\n BLOCKED: \"BLOCKED\",\n NONE: \"NONE\",\n};\nconst GuardrailContentFilterConfidence = {\n HIGH: \"HIGH\",\n LOW: \"LOW\",\n MEDIUM: \"MEDIUM\",\n NONE: \"NONE\",\n};\nconst GuardrailContentFilterStrength = {\n HIGH: \"HIGH\",\n LOW: \"LOW\",\n MEDIUM: \"MEDIUM\",\n NONE: \"NONE\",\n};\nconst GuardrailContentFilterType = {\n HATE: \"HATE\",\n INSULTS: \"INSULTS\",\n MISCONDUCT: \"MISCONDUCT\",\n PROMPT_ATTACK: \"PROMPT_ATTACK\",\n SEXUAL: \"SEXUAL\",\n VIOLENCE: \"VIOLENCE\",\n};\nconst GuardrailContextualGroundingPolicyAction = {\n BLOCKED: \"BLOCKED\",\n NONE: \"NONE\",\n};\nconst GuardrailContextualGroundingFilterType = {\n GROUNDING: \"GROUNDING\",\n RELEVANCE: \"RELEVANCE\",\n};\nconst GuardrailSensitiveInformationPolicyAction = {\n ANONYMIZED: \"ANONYMIZED\",\n BLOCKED: \"BLOCKED\",\n NONE: \"NONE\",\n};\nconst GuardrailPiiEntityType = {\n ADDRESS: \"ADDRESS\",\n AGE: \"AGE\",\n AWS_ACCESS_KEY: \"AWS_ACCESS_KEY\",\n AWS_SECRET_KEY: \"AWS_SECRET_KEY\",\n CA_HEALTH_NUMBER: \"CA_HEALTH_NUMBER\",\n CA_SOCIAL_INSURANCE_NUMBER: \"CA_SOCIAL_INSURANCE_NUMBER\",\n CREDIT_DEBIT_CARD_CVV: \"CREDIT_DEBIT_CARD_CVV\",\n CREDIT_DEBIT_CARD_EXPIRY: \"CREDIT_DEBIT_CARD_EXPIRY\",\n CREDIT_DEBIT_CARD_NUMBER: \"CREDIT_DEBIT_CARD_NUMBER\",\n DRIVER_ID: \"DRIVER_ID\",\n EMAIL: \"EMAIL\",\n INTERNATIONAL_BANK_ACCOUNT_NUMBER: \"INTERNATIONAL_BANK_ACCOUNT_NUMBER\",\n IP_ADDRESS: \"IP_ADDRESS\",\n LICENSE_PLATE: \"LICENSE_PLATE\",\n MAC_ADDRESS: \"MAC_ADDRESS\",\n NAME: \"NAME\",\n PASSWORD: \"PASSWORD\",\n PHONE: \"PHONE\",\n PIN: \"PIN\",\n SWIFT_CODE: \"SWIFT_CODE\",\n UK_NATIONAL_HEALTH_SERVICE_NUMBER: \"UK_NATIONAL_HEALTH_SERVICE_NUMBER\",\n UK_NATIONAL_INSURANCE_NUMBER: \"UK_NATIONAL_INSURANCE_NUMBER\",\n UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER: \"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER\",\n URL: \"URL\",\n USERNAME: \"USERNAME\",\n US_BANK_ACCOUNT_NUMBER: \"US_BANK_ACCOUNT_NUMBER\",\n US_BANK_ROUTING_NUMBER: \"US_BANK_ROUTING_NUMBER\",\n US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: \"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER\",\n US_PASSPORT_NUMBER: \"US_PASSPORT_NUMBER\",\n US_SOCIAL_SECURITY_NUMBER: \"US_SOCIAL_SECURITY_NUMBER\",\n VEHICLE_IDENTIFICATION_NUMBER: \"VEHICLE_IDENTIFICATION_NUMBER\",\n};\nconst GuardrailTopicPolicyAction = {\n BLOCKED: \"BLOCKED\",\n NONE: \"NONE\",\n};\nconst GuardrailTopicType = {\n DENY: \"DENY\",\n};\nconst GuardrailWordPolicyAction = {\n BLOCKED: \"BLOCKED\",\n NONE: \"NONE\",\n};\nconst GuardrailManagedWordType = {\n PROFANITY: \"PROFANITY\",\n};\nconst GuardrailTrace = {\n DISABLED: \"disabled\",\n ENABLED: \"enabled\",\n ENABLED_FULL: \"enabled_full\",\n};\nconst CachePointType = {\n DEFAULT: \"default\",\n};\nconst DocumentFormat = {\n CSV: \"csv\",\n DOC: \"doc\",\n DOCX: \"docx\",\n HTML: \"html\",\n MD: \"md\",\n PDF: \"pdf\",\n TXT: \"txt\",\n XLS: \"xls\",\n XLSX: \"xlsx\",\n};\nconst GuardrailConverseImageFormat = {\n JPEG: \"jpeg\",\n PNG: \"png\",\n};\nconst GuardrailConverseContentQualifier = {\n GROUNDING_SOURCE: \"grounding_source\",\n GUARD_CONTENT: \"guard_content\",\n QUERY: \"query\",\n};\nconst ImageFormat = {\n GIF: \"gif\",\n JPEG: \"jpeg\",\n PNG: \"png\",\n WEBP: \"webp\",\n};\nconst VideoFormat = {\n FLV: \"flv\",\n MKV: \"mkv\",\n MOV: \"mov\",\n MP4: \"mp4\",\n MPEG: \"mpeg\",\n MPG: \"mpg\",\n THREE_GP: \"three_gp\",\n WEBM: \"webm\",\n WMV: \"wmv\",\n};\nconst ToolResultStatus = {\n ERROR: \"error\",\n SUCCESS: \"success\",\n};\nconst ToolUseType = {\n SERVER_TOOL_USE: \"server_tool_use\",\n};\nconst ConversationRole = {\n ASSISTANT: \"assistant\",\n USER: \"user\",\n};\nconst PerformanceConfigLatency = {\n OPTIMIZED: \"optimized\",\n STANDARD: \"standard\",\n};\nconst ServiceTierType = {\n DEFAULT: \"default\",\n FLEX: \"flex\",\n PRIORITY: \"priority\",\n};\nconst StopReason = {\n CONTENT_FILTERED: \"content_filtered\",\n END_TURN: \"end_turn\",\n GUARDRAIL_INTERVENED: \"guardrail_intervened\",\n MAX_TOKENS: \"max_tokens\",\n MODEL_CONTEXT_WINDOW_EXCEEDED: \"model_context_window_exceeded\",\n STOP_SEQUENCE: \"stop_sequence\",\n TOOL_USE: \"tool_use\",\n};\nconst GuardrailStreamProcessingMode = {\n ASYNC: \"async\",\n SYNC: \"sync\",\n};\nconst Trace = {\n DISABLED: \"DISABLED\",\n ENABLED: \"ENABLED\",\n ENABLED_FULL: \"ENABLED_FULL\",\n};\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nObject.defineProperty(exports, \"__Client\", {\n enumerable: true,\n get: function () { return smithyClient.Client; }\n});\nexports.AccessDeniedException = AccessDeniedException$1;\nexports.ApplyGuardrailCommand = ApplyGuardrailCommand;\nexports.AsyncInvokeStatus = AsyncInvokeStatus;\nexports.BedrockRuntime = BedrockRuntime;\nexports.BedrockRuntimeClient = BedrockRuntimeClient;\nexports.BedrockRuntimeServiceException = BedrockRuntimeServiceException$1;\nexports.CachePointType = CachePointType;\nexports.ConflictException = ConflictException$1;\nexports.ConversationRole = ConversationRole;\nexports.ConverseCommand = ConverseCommand;\nexports.ConverseStreamCommand = ConverseStreamCommand;\nexports.CountTokensCommand = CountTokensCommand;\nexports.DocumentFormat = DocumentFormat;\nexports.GetAsyncInvokeCommand = GetAsyncInvokeCommand;\nexports.GuardrailAction = GuardrailAction;\nexports.GuardrailAutomatedReasoningLogicWarningType = GuardrailAutomatedReasoningLogicWarningType;\nexports.GuardrailContentFilterConfidence = GuardrailContentFilterConfidence;\nexports.GuardrailContentFilterStrength = GuardrailContentFilterStrength;\nexports.GuardrailContentFilterType = GuardrailContentFilterType;\nexports.GuardrailContentPolicyAction = GuardrailContentPolicyAction;\nexports.GuardrailContentQualifier = GuardrailContentQualifier;\nexports.GuardrailContentSource = GuardrailContentSource;\nexports.GuardrailContextualGroundingFilterType = GuardrailContextualGroundingFilterType;\nexports.GuardrailContextualGroundingPolicyAction = GuardrailContextualGroundingPolicyAction;\nexports.GuardrailConverseContentQualifier = GuardrailConverseContentQualifier;\nexports.GuardrailConverseImageFormat = GuardrailConverseImageFormat;\nexports.GuardrailImageFormat = GuardrailImageFormat;\nexports.GuardrailManagedWordType = GuardrailManagedWordType;\nexports.GuardrailOutputScope = GuardrailOutputScope;\nexports.GuardrailPiiEntityType = GuardrailPiiEntityType;\nexports.GuardrailSensitiveInformationPolicyAction = GuardrailSensitiveInformationPolicyAction;\nexports.GuardrailStreamProcessingMode = GuardrailStreamProcessingMode;\nexports.GuardrailTopicPolicyAction = GuardrailTopicPolicyAction;\nexports.GuardrailTopicType = GuardrailTopicType;\nexports.GuardrailTrace = GuardrailTrace;\nexports.GuardrailWordPolicyAction = GuardrailWordPolicyAction;\nexports.ImageFormat = ImageFormat;\nexports.InternalServerException = InternalServerException$1;\nexports.InvokeModelCommand = InvokeModelCommand;\nexports.InvokeModelWithBidirectionalStreamCommand = InvokeModelWithBidirectionalStreamCommand;\nexports.InvokeModelWithResponseStreamCommand = InvokeModelWithResponseStreamCommand;\nexports.ListAsyncInvokesCommand = ListAsyncInvokesCommand;\nexports.ModelErrorException = ModelErrorException$1;\nexports.ModelNotReadyException = ModelNotReadyException$1;\nexports.ModelStreamErrorException = ModelStreamErrorException$1;\nexports.ModelTimeoutException = ModelTimeoutException$1;\nexports.PerformanceConfigLatency = PerformanceConfigLatency;\nexports.ResourceNotFoundException = ResourceNotFoundException$1;\nexports.ServiceQuotaExceededException = ServiceQuotaExceededException$1;\nexports.ServiceTierType = ServiceTierType;\nexports.ServiceUnavailableException = ServiceUnavailableException$1;\nexports.SortAsyncInvocationBy = SortAsyncInvocationBy;\nexports.SortOrder = SortOrder;\nexports.StartAsyncInvokeCommand = StartAsyncInvokeCommand;\nexports.StopReason = StopReason;\nexports.ThrottlingException = ThrottlingException$1;\nexports.ToolResultStatus = ToolResultStatus;\nexports.ToolUseType = ToolUseType;\nexports.Trace = Trace;\nexports.ValidationException = ValidationException$1;\nexports.VideoFormat = VideoFormat;\nexports.paginateListAsyncInvokes = paginateListAsyncInvokes;\n", + "\n const handler = { get: (t, p) => p === '__esModule' ? true : () => {} };\n const stub = new Proxy({}, handler);\n export default stub;\n export const __stub__ = true;\n \n ", + "\n const handler = { get: (t, p) => p === '__esModule' ? true : () => {} };\n const stub = new Proxy({}, handler);\n export default stub;\n export const __stub__ = true;\n \n ", "import memoize from 'lodash-es/memoize.js'\nimport { refreshAndGetAwsCredentials } from '../auth.js'\nimport { getAWSRegion, isEnvTruthy } from '../envUtils.js'\nimport { logError } from '../log.js'\nimport { getAWSClientProxyConfig } from '../proxy.js'\n\nexport const getBedrockInferenceProfiles = memoize(async function (): Promise<\n string[]\n> {\n const [client, { ListInferenceProfilesCommand }] = await Promise.all([\n createBedrockClient(),\n import('@aws-sdk/client-bedrock'),\n ])\n const allProfiles = []\n let nextToken: string | undefined\n\n try {\n do {\n const command = new ListInferenceProfilesCommand({\n ...(nextToken && { nextToken }),\n typeEquals: 'SYSTEM_DEFINED',\n })\n const response = await client.send(command)\n\n if (response.inferenceProfileSummaries) {\n allProfiles.push(...response.inferenceProfileSummaries)\n }\n\n nextToken = response.nextToken\n } while (nextToken)\n\n // Filter for Anthropic models (SYSTEM_DEFINED filtering handled in query)\n return allProfiles\n .filter(profile => profile.inferenceProfileId?.includes('anthropic'))\n .map(profile => profile.inferenceProfileId)\n .filter(Boolean) as string[]\n } catch (error) {\n logError(error as Error)\n throw error\n }\n})\n\nexport function findFirstMatch(\n profiles: string[],\n substring: string,\n): string | null {\n return profiles.find(p => p.includes(substring)) ?? null\n}\n\nasync function createBedrockClient() {\n const { BedrockClient } = await import('@aws-sdk/client-bedrock')\n // Match the Anthropic Bedrock SDK's region behavior exactly:\n // - Reads AWS_REGION or AWS_DEFAULT_REGION env vars (not AWS config files)\n // - Falls back to 'us-east-1' if neither is set\n // This ensures we query profiles from the same region the client will use\n const region = getAWSRegion()\n\n const skipAuth = isEnvTruthy(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)\n\n const clientConfig: ConstructorParameters[0] = {\n region,\n ...(process.env.ANTHROPIC_BEDROCK_BASE_URL && {\n endpoint: process.env.ANTHROPIC_BEDROCK_BASE_URL,\n }),\n ...(await getAWSClientProxyConfig()),\n ...(skipAuth && {\n requestHandler: new (\n await import('@smithy/node-http-handler')\n ).NodeHttpHandler(),\n httpAuthSchemes: [\n {\n schemeId: 'smithy.api#noAuth',\n identityProvider: () => async () => ({}),\n signer: new (await import('@smithy/core')).NoAuthSigner(),\n },\n ],\n httpAuthSchemeProvider: () => [{ schemeId: 'smithy.api#noAuth' }],\n }),\n }\n\n if (!skipAuth && !process.env.AWS_BEARER_TOKEN_BEDROCK) {\n // Only refresh credentials if not using API key authentication\n const cachedCredentials = await refreshAndGetAwsCredentials()\n if (cachedCredentials) {\n clientConfig.credentials = {\n accessKeyId: cachedCredentials.accessKeyId,\n secretAccessKey: cachedCredentials.secretAccessKey,\n sessionToken: cachedCredentials.sessionToken,\n }\n }\n }\n\n return new BedrockClient(clientConfig)\n}\n\nexport async function createBedrockRuntimeClient() {\n const { BedrockRuntimeClient } = await import(\n '@aws-sdk/client-bedrock-runtime'\n )\n const region = getAWSRegion()\n const skipAuth = isEnvTruthy(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)\n\n const clientConfig: ConstructorParameters[0] = {\n region,\n ...(process.env.ANTHROPIC_BEDROCK_BASE_URL && {\n endpoint: process.env.ANTHROPIC_BEDROCK_BASE_URL,\n }),\n ...(await getAWSClientProxyConfig()),\n ...(skipAuth && {\n // BedrockRuntimeClient defaults to HTTP/2 without fallback\n // proxy servers may not support this, so we explicitly force HTTP/1.1\n requestHandler: new (\n await import('@smithy/node-http-handler')\n ).NodeHttpHandler(),\n httpAuthSchemes: [\n {\n schemeId: 'smithy.api#noAuth',\n identityProvider: () => async () => ({}),\n signer: new (await import('@smithy/core')).NoAuthSigner(),\n },\n ],\n httpAuthSchemeProvider: () => [{ schemeId: 'smithy.api#noAuth' }],\n }),\n }\n\n if (!skipAuth && !process.env.AWS_BEARER_TOKEN_BEDROCK) {\n // Only refresh credentials if not using API key authentication\n const cachedCredentials = await refreshAndGetAwsCredentials()\n if (cachedCredentials) {\n clientConfig.credentials = {\n accessKeyId: cachedCredentials.accessKeyId,\n secretAccessKey: cachedCredentials.secretAccessKey,\n sessionToken: cachedCredentials.sessionToken,\n }\n }\n }\n\n return new BedrockRuntimeClient(clientConfig)\n}\n\nexport const getInferenceProfileBackingModel = memoize(async function (\n profileId: string,\n): Promise {\n try {\n const [client, { GetInferenceProfileCommand }] = await Promise.all([\n createBedrockClient(),\n import('@aws-sdk/client-bedrock'),\n ])\n const command = new GetInferenceProfileCommand({\n inferenceProfileIdentifier: profileId,\n })\n const response = await client.send(command)\n\n if (!response.models || response.models.length === 0) {\n return null\n }\n\n // Use the first model as the primary backing model for cost calculation\n // In practice, application inference profiles typically load balance between\n // similar models with the same cost structure\n const primaryModel = response.models[0]\n if (!primaryModel?.modelArn) {\n return null\n }\n\n // Extract model name from ARN\n // ARN format: arn:aws:bedrock:region:account:foundation-model/model-name\n const lastSlashIndex = primaryModel.modelArn.lastIndexOf('/')\n return lastSlashIndex >= 0\n ? primaryModel.modelArn.substring(lastSlashIndex + 1)\n : primaryModel.modelArn\n } catch (error) {\n logError(error as Error)\n return null\n }\n})\n\n/**\n * Check if a model ID is a foundation model (e.g., \"anthropic.claude-sonnet-4-5-20250929-v1:0\")\n */\nexport function isFoundationModel(modelId: string): boolean {\n return modelId.startsWith('anthropic.')\n}\n\n/**\n * Cross-region inference profile prefixes for Bedrock.\n * These prefixes allow routing requests to models in specific regions.\n */\nconst BEDROCK_REGION_PREFIXES = ['us', 'eu', 'apac', 'global'] as const\n\n/**\n * Extract the model/inference profile ID from a Bedrock ARN.\n * If the input is not an ARN, returns it unchanged.\n *\n * ARN format: arn:aws:bedrock:::inference-profile/\n * Also handles: arn:aws:bedrock:::application-inference-profile/\n * And foundation model ARNs: arn:aws:bedrock:::foundation-model/\n */\nexport function extractModelIdFromArn(modelId: string): string {\n if (!modelId.startsWith('arn:')) {\n return modelId\n }\n const lastSlashIndex = modelId.lastIndexOf('/')\n if (lastSlashIndex === -1) {\n return modelId\n }\n return modelId.substring(lastSlashIndex + 1)\n}\n\nexport type BedrockRegionPrefix = (typeof BEDROCK_REGION_PREFIXES)[number]\n\n/**\n * Extract the region prefix from a Bedrock cross-region inference model ID.\n * Handles both plain model IDs and full ARN format.\n * For example:\n * - \"eu.anthropic.claude-sonnet-4-5-20250929-v1:0\" → \"eu\"\n * - \"us.anthropic.claude-3-7-sonnet-20250219-v1:0\" → \"us\"\n * - \"arn:aws:bedrock:ap-northeast-2:123:inference-profile/global.anthropic.claude-opus-4-6-v1\" → \"global\"\n * - \"anthropic.claude-3-5-sonnet-20241022-v2:0\" → undefined (foundation model)\n * - \"claude-sonnet-4-5-20250929\" → undefined (first-party format)\n */\nexport function getBedrockRegionPrefix(\n modelId: string,\n): BedrockRegionPrefix | undefined {\n // Extract the inference profile ID from ARN format if present\n // ARN format: arn:aws:bedrock:::inference-profile/\n const effectiveModelId = extractModelIdFromArn(modelId)\n\n for (const prefix of BEDROCK_REGION_PREFIXES) {\n if (effectiveModelId.startsWith(`${prefix}.anthropic.`)) {\n return prefix\n }\n }\n return undefined\n}\n\n/**\n * Apply a region prefix to a Bedrock model ID.\n * If the model already has a different region prefix, it will be replaced.\n * If the model is a foundation model (anthropic.*), the prefix will be added.\n * If the model is not a Bedrock model, it will be returned as-is.\n *\n * For example:\n * - applyBedrockRegionPrefix(\"us.anthropic.claude-sonnet-4-5-v1:0\", \"eu\") → \"eu.anthropic.claude-sonnet-4-5-v1:0\"\n * - applyBedrockRegionPrefix(\"anthropic.claude-sonnet-4-5-v1:0\", \"eu\") → \"eu.anthropic.claude-sonnet-4-5-v1:0\"\n * - applyBedrockRegionPrefix(\"claude-sonnet-4-5-20250929\", \"eu\") → \"claude-sonnet-4-5-20250929\" (not a Bedrock model)\n */\nexport function applyBedrockRegionPrefix(\n modelId: string,\n prefix: BedrockRegionPrefix,\n): string {\n // Check if it already has a region prefix and replace it\n const existingPrefix = getBedrockRegionPrefix(modelId)\n if (existingPrefix) {\n return modelId.replace(`${existingPrefix}.`, `${prefix}.`)\n }\n\n // Check if it's a foundation model (anthropic.*) and add the prefix\n if (isFoundationModel(modelId)) {\n return `${prefix}.${modelId}`\n }\n\n // Not a Bedrock model format, return as-is\n return modelId\n}\n", "import type { ModelName } from './model.js'\nimport type { APIProvider } from './providers.js'\n\nexport type ModelConfig = Record\n\n// @[MODEL LAUNCH]: Add a new CLAUDE_*_CONFIG constant here. Double check the correct model strings\n// here since the pattern may change.\n\nexport const CLAUDE_3_7_SONNET_CONFIG = {\n firstParty: 'claude-3-7-sonnet-20250219',\n bedrock: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',\n vertex: 'claude-3-7-sonnet@20250219',\n foundry: 'claude-3-7-sonnet',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_3_5_V2_SONNET_CONFIG = {\n firstParty: 'claude-3-5-sonnet-20241022',\n bedrock: 'anthropic.claude-3-5-sonnet-20241022-v2:0',\n vertex: 'claude-3-5-sonnet-v2@20241022',\n foundry: 'claude-3-5-sonnet',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_3_5_HAIKU_CONFIG = {\n firstParty: 'claude-3-5-haiku-20241022',\n bedrock: 'us.anthropic.claude-3-5-haiku-20241022-v1:0',\n vertex: 'claude-3-5-haiku@20241022',\n foundry: 'claude-3-5-haiku',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_HAIKU_4_5_CONFIG = {\n firstParty: 'claude-haiku-4-5-20251001',\n bedrock: 'us.anthropic.claude-haiku-4-5-20251001-v1:0',\n vertex: 'claude-haiku-4-5@20251001',\n foundry: 'claude-haiku-4-5',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_SONNET_4_CONFIG = {\n firstParty: 'claude-sonnet-4-20250514',\n bedrock: 'us.anthropic.claude-sonnet-4-20250514-v1:0',\n vertex: 'claude-sonnet-4@20250514',\n foundry: 'claude-sonnet-4',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_SONNET_4_5_CONFIG = {\n firstParty: 'claude-sonnet-4-5-20250929',\n bedrock: 'us.anthropic.claude-sonnet-4-5-20250929-v1:0',\n vertex: 'claude-sonnet-4-5@20250929',\n foundry: 'claude-sonnet-4-5',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_OPUS_4_CONFIG = {\n firstParty: 'claude-opus-4-20250514',\n bedrock: 'us.anthropic.claude-opus-4-20250514-v1:0',\n vertex: 'claude-opus-4@20250514',\n foundry: 'claude-opus-4',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_OPUS_4_1_CONFIG = {\n firstParty: 'claude-opus-4-1-20250805',\n bedrock: 'us.anthropic.claude-opus-4-1-20250805-v1:0',\n vertex: 'claude-opus-4-1@20250805',\n foundry: 'claude-opus-4-1',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_OPUS_4_5_CONFIG = {\n firstParty: 'claude-opus-4-5-20251101',\n bedrock: 'us.anthropic.claude-opus-4-5-20251101-v1:0',\n vertex: 'claude-opus-4-5@20251101',\n foundry: 'claude-opus-4-5',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_OPUS_4_6_CONFIG = {\n firstParty: 'claude-opus-4-6',\n bedrock: 'us.anthropic.claude-opus-4-6-v1',\n vertex: 'claude-opus-4-6',\n foundry: 'claude-opus-4-6',\n} as const satisfies ModelConfig\n\nexport const CLAUDE_SONNET_4_6_CONFIG = {\n firstParty: 'claude-sonnet-4-6',\n bedrock: 'us.anthropic.claude-sonnet-4-6',\n vertex: 'claude-sonnet-4-6',\n foundry: 'claude-sonnet-4-6',\n} as const satisfies ModelConfig\n\n// @[MODEL LAUNCH]: Register the new config here.\nexport const ALL_MODEL_CONFIGS = {\n haiku35: CLAUDE_3_5_HAIKU_CONFIG,\n haiku45: CLAUDE_HAIKU_4_5_CONFIG,\n sonnet35: CLAUDE_3_5_V2_SONNET_CONFIG,\n sonnet37: CLAUDE_3_7_SONNET_CONFIG,\n sonnet40: CLAUDE_SONNET_4_CONFIG,\n sonnet45: CLAUDE_SONNET_4_5_CONFIG,\n sonnet46: CLAUDE_SONNET_4_6_CONFIG,\n opus40: CLAUDE_OPUS_4_CONFIG,\n opus41: CLAUDE_OPUS_4_1_CONFIG,\n opus45: CLAUDE_OPUS_4_5_CONFIG,\n opus46: CLAUDE_OPUS_4_6_CONFIG,\n} as const satisfies Record\n\nexport type ModelKey = keyof typeof ALL_MODEL_CONFIGS\n\n/** Union of all canonical first-party model IDs, e.g. 'claude-opus-4-6' | 'claude-sonnet-4-5-20250929' | … */\nexport type CanonicalModelId =\n (typeof ALL_MODEL_CONFIGS)[ModelKey]['firstParty']\n\n/** Runtime list of canonical model IDs — used by comprehensiveness tests. */\nexport const CANONICAL_MODEL_IDS = Object.values(ALL_MODEL_CONFIGS).map(\n c => c.firstParty,\n) as [CanonicalModelId, ...CanonicalModelId[]]\n\n/** Map canonical ID → internal short key. Used to apply settings-based modelOverrides. */\nexport const CANONICAL_ID_TO_KEY: Record =\n Object.fromEntries(\n (Object.entries(ALL_MODEL_CONFIGS) as [ModelKey, ModelConfig][]).map(\n ([key, cfg]) => [cfg.firstParty, key],\n ),\n ) as Record\n", "import type { AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS } from '../../services/analytics/index.js'\nimport { isEnvTruthy } from '../envUtils.js'\n\nexport type APIProvider = 'firstParty' | 'bedrock' | 'vertex' | 'foundry'\n\nexport function getAPIProvider(): APIProvider {\n return isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK)\n ? 'bedrock'\n : isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX)\n ? 'vertex'\n : isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY)\n ? 'foundry'\n : 'firstParty'\n}\n\nexport function getAPIProviderForStatsig(): AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS {\n return getAPIProvider() as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS\n}\n\n/**\n * Check if ANTHROPIC_BASE_URL is a first-party Anthropic API URL.\n * Returns true if not set (default API) or points to api.anthropic.com\n * (or api-staging.anthropic.com for ant users).\n */\nexport function isFirstPartyAnthropicBaseUrl(): boolean {\n const baseUrl = process.env.ANTHROPIC_BASE_URL\n if (!baseUrl) {\n return true\n }\n try {\n const host = new URL(baseUrl).host\n const allowedHosts = ['api.anthropic.com']\n if (process.env.USER_TYPE === 'ant') {\n allowedHosts.push('api-staging.anthropic.com')\n }\n return allowedHosts.includes(host)\n } catch {\n return false\n }\n}\n", @@ -1557,16 +1412,7 @@ "import { mkdirSync, writeFileSync } from 'fs'\nimport {\n getApiKeyFromFd,\n getOauthTokenFromFd,\n setApiKeyFromFd,\n setOauthTokenFromFd,\n} from '../bootstrap/state.js'\nimport { logForDebugging } from './debug.js'\nimport { isEnvTruthy } from './envUtils.js'\nimport { errorMessage, isENOENT } from './errors.js'\nimport { getFsImplementation } from './fsOperations.js'\n\n/**\n * Well-known token file locations in CCR. The Go environment-manager creates\n * /home/claude/.claude/remote/ and will (eventually) write these files too.\n * Until then, this module writes them on successful FD read so subprocesses\n * spawned inside the CCR container can find the token without inheriting\n * the FD — which they can't: pipe FDs don't cross tmux/shell boundaries.\n */\nconst CCR_TOKEN_DIR = '/home/claude/.claude/remote'\nexport const CCR_OAUTH_TOKEN_PATH = `${CCR_TOKEN_DIR}/.oauth_token`\nexport const CCR_API_KEY_PATH = `${CCR_TOKEN_DIR}/.api_key`\nexport const CCR_SESSION_INGRESS_TOKEN_PATH = `${CCR_TOKEN_DIR}/.session_ingress_token`\n\n/**\n * Best-effort write of the token to a well-known location for subprocess\n * access. CCR-gated: outside CCR there's no /home/claude/ and no reason to\n * put a token on disk that the FD was meant to keep off disk.\n */\nexport function maybePersistTokenForSubprocesses(\n path: string,\n token: string,\n tokenName: string,\n): void {\n if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) {\n return\n }\n try {\n // eslint-disable-next-line custom-rules/no-sync-fs -- one-shot startup write in CCR, caller is sync\n mkdirSync(CCR_TOKEN_DIR, { recursive: true, mode: 0o700 })\n // eslint-disable-next-line custom-rules/no-sync-fs -- one-shot startup write in CCR, caller is sync\n writeFileSync(path, token, { encoding: 'utf8', mode: 0o600 })\n logForDebugging(`Persisted ${tokenName} to ${path} for subprocess access`)\n } catch (error) {\n logForDebugging(\n `Failed to persist ${tokenName} to disk (non-fatal): ${errorMessage(error)}`,\n { level: 'error' },\n )\n }\n}\n\n/**\n * Fallback read from a well-known file. The path only exists in CCR (env-manager\n * creates the directory), so file-not-found is the expected outcome everywhere\n * else — treated as \"no fallback\", not an error.\n */\nexport function readTokenFromWellKnownFile(\n path: string,\n tokenName: string,\n): string | null {\n try {\n const fsOps = getFsImplementation()\n // eslint-disable-next-line custom-rules/no-sync-fs -- fallback read for CCR subprocess path, one-shot at startup, caller is sync\n const token = fsOps.readFileSync(path, { encoding: 'utf8' }).trim()\n if (!token) {\n return null\n }\n logForDebugging(`Read ${tokenName} from well-known file ${path}`)\n return token\n } catch (error) {\n // ENOENT is the expected outcome outside CCR — stay silent. Anything\n // else (EACCES from perm misconfig, etc.) is worth surfacing in the\n // debug log so subprocess auth failures aren't mysterious.\n if (!isENOENT(error)) {\n logForDebugging(\n `Failed to read ${tokenName} from ${path}: ${errorMessage(error)}`,\n { level: 'debug' },\n )\n }\n return null\n }\n}\n\n/**\n * Shared FD-or-well-known-file credential reader.\n *\n * Priority order:\n * 1. File descriptor (legacy path) — env var points at a pipe FD passed by\n * the Go env-manager via cmd.ExtraFiles. Pipe is drained on first read\n * and doesn't cross exec/tmux boundaries.\n * 2. Well-known file — written by this function on successful FD read (and\n * eventually by the env-manager directly). Covers subprocesses that can't\n * inherit the FD.\n *\n * Returns null if neither source has a credential. Cached in global state.\n */\nfunction getCredentialFromFd({\n envVar,\n wellKnownPath,\n label,\n getCached,\n setCached,\n}: {\n envVar: string\n wellKnownPath: string\n label: string\n getCached: () => string | null | undefined\n setCached: (value: string | null) => void\n}): string | null {\n const cached = getCached()\n if (cached !== undefined) {\n return cached\n }\n\n const fdEnv = process.env[envVar]\n if (!fdEnv) {\n // No FD env var — either we're not in CCR, or we're a subprocess whose\n // parent stripped the (useless) FD env var. Try the well-known file.\n const fromFile = readTokenFromWellKnownFile(wellKnownPath, label)\n setCached(fromFile)\n return fromFile\n }\n\n const fd = parseInt(fdEnv, 10)\n if (Number.isNaN(fd)) {\n logForDebugging(\n `${envVar} must be a valid file descriptor number, got: ${fdEnv}`,\n { level: 'error' },\n )\n setCached(null)\n return null\n }\n\n try {\n // Use /dev/fd on macOS/BSD, /proc/self/fd on Linux\n const fsOps = getFsImplementation()\n const fdPath =\n process.platform === 'darwin' || process.platform === 'freebsd'\n ? `/dev/fd/${fd}`\n : `/proc/self/fd/${fd}`\n\n // eslint-disable-next-line custom-rules/no-sync-fs -- legacy FD path, read once at startup, caller is sync\n const token = fsOps.readFileSync(fdPath, { encoding: 'utf8' }).trim()\n if (!token) {\n logForDebugging(`File descriptor contained empty ${label}`, {\n level: 'error',\n })\n setCached(null)\n return null\n }\n logForDebugging(`Successfully read ${label} from file descriptor ${fd}`)\n setCached(token)\n maybePersistTokenForSubprocesses(wellKnownPath, token, label)\n return token\n } catch (error) {\n logForDebugging(\n `Failed to read ${label} from file descriptor ${fd}: ${errorMessage(error)}`,\n { level: 'error' },\n )\n // FD env var was set but read failed — typically a subprocess that\n // inherited the env var but not the FD (ENXIO). Try the well-known file.\n const fromFile = readTokenFromWellKnownFile(wellKnownPath, label)\n setCached(fromFile)\n return fromFile\n }\n}\n\n/**\n * Get the CCR-injected OAuth token. See getCredentialFromFd for FD-vs-disk\n * rationale. Env var: CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR.\n * Well-known file: /home/claude/.claude/remote/.oauth_token.\n */\nexport function getOAuthTokenFromFileDescriptor(): string | null {\n return getCredentialFromFd({\n envVar: 'CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR',\n wellKnownPath: CCR_OAUTH_TOKEN_PATH,\n label: 'OAuth token',\n getCached: getOauthTokenFromFd,\n setCached: setOauthTokenFromFd,\n })\n}\n\n/**\n * Get the CCR-injected API key. See getCredentialFromFd for FD-vs-disk\n * rationale. Env var: CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR.\n * Well-known file: /home/claude/.claude/remote/.api_key.\n */\nexport function getApiKeyFromFileDescriptor(): string | null {\n return getCredentialFromFd({\n envVar: 'CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR',\n wellKnownPath: CCR_API_KEY_PATH,\n label: 'API key',\n getCached: getApiKeyFromFd,\n setCached: setApiKeyFromFd,\n })\n}\n", "/**\n * Lightweight helpers shared between keychainPrefetch.ts and\n * macOsKeychainStorage.ts.\n *\n * This module MUST NOT import execa, execFileNoThrow, or\n * execFileNoThrowPortable. keychainPrefetch.ts fires at the very top of\n * main.tsx (before the ~65ms of module evaluation it parallelizes), and Bun's\n * __esm wrapper evaluates the ENTIRE module when any symbol is accessed —\n * so a heavy transitive import here defeats the prefetch. The execa →\n * human-signals → cross-spawn chain alone is ~58ms of synchronous init.\n *\n * The imports below (envUtils, oauth constants, crypto, os) are already\n * evaluated by startupProfiler.ts at main.tsx:5, so they add no module-init\n * cost when keychainPrefetch.ts pulls this file in.\n */\n\nimport { createHash } from 'crypto'\nimport { userInfo } from 'os'\nimport { getOauthConfig } from 'src/constants/oauth.js'\nimport { getClaudeConfigHomeDir } from '../envUtils.js'\nimport type { SecureStorageData } from './types.js'\n\n// Suffix distinguishing the OAuth credentials keychain entry from the legacy\n// API key entry (which uses no suffix). Both share the service name base.\n// DO NOT change this value — it's part of the keychain lookup key and would\n// orphan existing stored credentials.\nexport const CREDENTIALS_SERVICE_SUFFIX = '-credentials'\n\nexport function getMacOsKeychainStorageServiceName(\n serviceSuffix: string = '',\n): string {\n const configDir = getClaudeConfigHomeDir()\n const isDefaultDir = !process.env.CLAUDE_CONFIG_DIR\n\n // Use a hash of the config dir path to create a unique but stable suffix\n // Only add suffix for non-default directories to maintain backwards compatibility\n const dirHash = isDefaultDir\n ? ''\n : `-${createHash('sha256').update(configDir).digest('hex').substring(0, 8)}`\n return `Claude Code${getOauthConfig().OAUTH_FILE_SUFFIX}${serviceSuffix}${dirHash}`\n}\n\nexport function getUsername(): string {\n try {\n return process.env.USER || userInfo().username\n } catch {\n return 'claude-code-user'\n }\n}\n\n// --\n\n// Cache for keychain reads to avoid repeated expensive security CLI calls.\n// TTL bounds staleness for cross-process scenarios (another CC instance\n// refreshing/invalidating tokens) without forcing a blocking spawnSync on\n// every read. In-process writes invalidate via clearKeychainCache() directly.\n//\n// The sync read() path takes ~500ms per `security` spawn. With 50+ claude.ai\n// MCP connectors authenticating at startup, a short TTL expires mid-storm and\n// triggers repeat sync reads — observed as a 5.5s event-loop stall\n// (go/ccshare/adamj-20260326-212235). 30s of cross-process staleness is fine:\n// OAuth tokens expire in hours, and the only cross-process writer is another\n// CC instance's /login or refresh.\n//\n// Lives here (not in macOsKeychainStorage.ts) so keychainPrefetch.ts can\n// prime it without pulling in execa. Wrapped in an object because ES module\n// `let` bindings aren't writable across module boundaries — both this file\n// and macOsKeychainStorage.ts need to mutate all three fields.\nexport const KEYCHAIN_CACHE_TTL_MS = 30_000\n\nexport const keychainCacheState: {\n cache: { data: SecureStorageData | null; cachedAt: number } // cachedAt 0 = invalid\n // Incremented on every cache invalidation. readAsync() captures this before\n // spawning and skips its cache write if a newer generation exists, preventing\n // a stale subprocess result from overwriting fresh data written by update().\n generation: number\n // Deduplicates concurrent readAsync() calls so TTL expiry under load spawns\n // one subprocess, not N. Cleared on invalidation so fresh reads don't join\n // a stale in-flight promise.\n readInFlight: Promise | null\n} = {\n cache: { data: null, cachedAt: 0 },\n generation: 0,\n readInFlight: null,\n}\n\nexport function clearKeychainCache(): void {\n keychainCacheState.cache = { data: null, cachedAt: 0 }\n keychainCacheState.generation++\n keychainCacheState.readInFlight = null\n}\n\n/**\n * Prime the keychain cache from a prefetch result (keychainPrefetch.ts).\n * Only writes if the cache hasn't been touched yet — if sync read() or\n * update() already ran, their result is authoritative and we discard this.\n */\nexport function primeKeychainCacheFromPrefetch(stdout: string | null): void {\n if (keychainCacheState.cache.cachedAt !== 0) return\n let data: SecureStorageData | null = null\n if (stdout) {\n try {\n // eslint-disable-next-line custom-rules/no-direct-json-operations -- jsonParse() pulls slowOperations (lodash-es/cloneDeep) into the early-startup import chain; see file header\n data = JSON.parse(stdout)\n } catch {\n // malformed prefetch result — let sync read() re-fetch\n return\n }\n }\n keychainCacheState.cache = { data, cachedAt: Date.now() }\n}\n", "import { execa } from 'execa'\nimport { getMacOsKeychainStorageServiceName } from 'src/utils/secureStorage/macOsKeychainHelpers.js'\n\nexport async function maybeRemoveApiKeyFromMacOSKeychainThrows(): Promise {\n if (process.platform === 'darwin') {\n const storageServiceName = getMacOsKeychainStorageServiceName()\n const result = await execa(\n `security delete-generic-password -a $USER -s \"${storageServiceName}\"`,\n { shell: true, reject: false },\n )\n if (result.exitCode !== 0) {\n throw new Error('Failed to delete keychain entry')\n }\n }\n}\n\nexport function normalizeApiKeyForConfig(apiKey: string): string {\n return apiKey.slice(-20)\n}\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst STSClient_1 = require(\"../STSClient\");\nconst defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"sts\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultSTSHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"AssumeRoleWithSAML\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n case \"AssumeRoleWithWebIdentity\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider;\nconst resolveStsAuthConfig = (input) => Object.assign(input, {\n stsClientCtor: STSClient_1.STSClient,\n});\nexports.resolveStsAuthConfig = resolveStsAuthConfig;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, exports.resolveStsAuthConfig)(config);\n const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0);\n return Object.assign(config_1, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.commonParams = exports.resolveClientEndpointParameters = void 0;\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n useGlobalEndpoint: options.useGlobalEndpoint ?? false,\n defaultSigningName: \"sts\",\n });\n};\nexports.resolveClientEndpointParameters = resolveClientEndpointParameters;\nexports.commonParams = {\n UseGlobalEndpoint: { type: \"builtInParams\", name: \"useGlobalEndpoint\" },\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst F = \"required\", G = \"type\", H = \"fn\", I = \"argv\", J = \"ref\";\nconst a = false, b = true, c = \"booleanEquals\", d = \"stringEquals\", e = \"sigv4\", f = \"sts\", g = \"us-east-1\", h = \"endpoint\", i = \"https://sts.{Region}.{PartitionResult#dnsSuffix}\", j = \"tree\", k = \"error\", l = \"getAttr\", m = { [F]: false, [G]: \"string\" }, n = { [F]: true, \"default\": false, [G]: \"boolean\" }, o = { [J]: \"Endpoint\" }, p = { [H]: \"isSet\", [I]: [{ [J]: \"Region\" }] }, q = { [J]: \"Region\" }, r = { [H]: \"aws.partition\", [I]: [q], \"assign\": \"PartitionResult\" }, s = { [J]: \"UseFIPS\" }, t = { [J]: \"UseDualStack\" }, u = { \"url\": \"https://sts.amazonaws.com\", \"properties\": { \"authSchemes\": [{ \"name\": e, \"signingName\": f, \"signingRegion\": g }] }, \"headers\": {} }, v = {}, w = { \"conditions\": [{ [H]: d, [I]: [q, \"aws-global\"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: \"PartitionResult\" }, \"supportsFIPS\"] }, A = { [J]: \"PartitionResult\" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, \"supportsDualStack\"] }] }, C = [{ [H]: \"isSet\", [I]: [o] }], D = [x], E = [y];\nconst _data = { version: \"1.0\", parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: \"UseGlobalEndpoint\" }, b] }, { [H]: \"not\", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, \"ap-northeast-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"ap-south-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"ap-southeast-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"ap-southeast-2\"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, \"ca-central-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-central-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-north-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-west-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-west-2\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"eu-west-3\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"sa-east-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"us-east-2\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"us-west-1\"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, \"us-west-2\"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: \"{Region}\" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", [G]: k }, { conditions: E, error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: \"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: v, headers: v }, [G]: h }], [G]: j }, { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, \"name\"] }, \"aws-us-gov\"] }], endpoint: { url: \"https://sts.{Region}.amazonaws.com\", properties: v, headers: v }, [G]: h }, { endpoint: { url: \"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: v, headers: v }, [G]: h }], [G]: j }, { error: \"FIPS is enabled but this partition does not support FIPS\", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: \"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: v, headers: v }, [G]: h }], [G]: j }, { error: \"DualStack is enabled but this partition does not support DualStack\", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: \"Invalid Configuration: Missing Region\", [G]: k }] };\nexports.ruleSet = _data;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\", \"UseGlobalEndpoint\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2011-06-15\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ??\n new protocols_1.AwsQueryProtocol({\n defaultNamespace: \"com.amazonaws.sts\",\n xmlNamespace: \"https://sts.amazonaws.com/doc/2011-06-15/\",\n version: \"2011-06-15\",\n }),\n serviceId: config?.serviceId ?? \"STS\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst credential_provider_node_1 = require(\"@aws-sdk/credential-provider-node\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst core_2 = require(\"@smithy/core\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\") ||\n (async (idProps) => await (0, credential_provider_node_1.defaultProvider)(idProps?.__config || {})()),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0;\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nexports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration;\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\nexports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveRuntimeExtensions = void 0;\nconst region_config_resolver_1 = require(\"@aws-sdk/region-config-resolver\");\nconst protocol_http_1 = require(\"@smithy/protocol-http\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst httpAuthExtensionConfiguration_1 = require(\"./auth/httpAuthExtensionConfiguration\");\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration));\n};\nexports.resolveRuntimeExtensions = resolveRuntimeExtensions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.STSClient = exports.__Client = void 0;\nconst middleware_host_header_1 = require(\"@aws-sdk/middleware-host-header\");\nconst middleware_logger_1 = require(\"@aws-sdk/middleware-logger\");\nconst middleware_recursion_detection_1 = require(\"@aws-sdk/middleware-recursion-detection\");\nconst middleware_user_agent_1 = require(\"@aws-sdk/middleware-user-agent\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst core_1 = require(\"@smithy/core\");\nconst schema_1 = require(\"@smithy/core/schema\");\nconst middleware_content_length_1 = require(\"@smithy/middleware-content-length\");\nconst middleware_endpoint_1 = require(\"@smithy/middleware-endpoint\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nObject.defineProperty(exports, \"__Client\", { enumerable: true, get: function () { return smithy_client_1.Client; } });\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst EndpointParameters_1 = require(\"./endpoint/EndpointParameters\");\nconst runtimeConfig_1 = require(\"./runtimeConfig\");\nconst runtimeExtensions_1 = require(\"./runtimeExtensions\");\nclass STSClient extends smithy_client_1.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);\n const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1);\n const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2);\n const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3);\n const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);\n const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5);\n const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6);\n const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use((0, schema_1.getSchemaSerdePlugin)(this.config));\n this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));\n this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));\n this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));\n this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));\n this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));\n this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));\n this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core_1.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\nexports.STSClient = STSClient;\n", - "'use strict';\n\nvar STSClient = require('./STSClient');\nvar smithyClient = require('@smithy/smithy-client');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar EndpointParameters = require('./endpoint/EndpointParameters');\nvar schema = require('@smithy/core/schema');\nvar client = require('@aws-sdk/core/client');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\n\nlet STSServiceException$1 = class STSServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, STSServiceException.prototype);\n }\n};\n\nlet ExpiredTokenException$1 = class ExpiredTokenException extends STSServiceException$1 {\n name = \"ExpiredTokenException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ExpiredTokenException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ExpiredTokenException.prototype);\n }\n};\nlet MalformedPolicyDocumentException$1 = class MalformedPolicyDocumentException extends STSServiceException$1 {\n name = \"MalformedPolicyDocumentException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"MalformedPolicyDocumentException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);\n }\n};\nlet PackedPolicyTooLargeException$1 = class PackedPolicyTooLargeException extends STSServiceException$1 {\n name = \"PackedPolicyTooLargeException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"PackedPolicyTooLargeException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);\n }\n};\nlet RegionDisabledException$1 = class RegionDisabledException extends STSServiceException$1 {\n name = \"RegionDisabledException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"RegionDisabledException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, RegionDisabledException.prototype);\n }\n};\nlet IDPRejectedClaimException$1 = class IDPRejectedClaimException extends STSServiceException$1 {\n name = \"IDPRejectedClaimException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"IDPRejectedClaimException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);\n }\n};\nlet InvalidIdentityTokenException$1 = class InvalidIdentityTokenException extends STSServiceException$1 {\n name = \"InvalidIdentityTokenException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"InvalidIdentityTokenException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);\n }\n};\nlet IDPCommunicationErrorException$1 = class IDPCommunicationErrorException extends STSServiceException$1 {\n name = \"IDPCommunicationErrorException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"IDPCommunicationErrorException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);\n }\n};\nlet InvalidAuthorizationMessageException$1 = class InvalidAuthorizationMessageException extends STSServiceException$1 {\n name = \"InvalidAuthorizationMessageException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"InvalidAuthorizationMessageException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype);\n }\n};\nlet ExpiredTradeInTokenException$1 = class ExpiredTradeInTokenException extends STSServiceException$1 {\n name = \"ExpiredTradeInTokenException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ExpiredTradeInTokenException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ExpiredTradeInTokenException.prototype);\n }\n};\nlet JWTPayloadSizeExceededException$1 = class JWTPayloadSizeExceededException extends STSServiceException$1 {\n name = \"JWTPayloadSizeExceededException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"JWTPayloadSizeExceededException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, JWTPayloadSizeExceededException.prototype);\n }\n};\nlet OutboundWebIdentityFederationDisabledException$1 = class OutboundWebIdentityFederationDisabledException extends STSServiceException$1 {\n name = \"OutboundWebIdentityFederationDisabledException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"OutboundWebIdentityFederationDisabledException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, OutboundWebIdentityFederationDisabledException.prototype);\n }\n};\nlet SessionDurationEscalationException$1 = class SessionDurationEscalationException extends STSServiceException$1 {\n name = \"SessionDurationEscalationException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"SessionDurationEscalationException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, SessionDurationEscalationException.prototype);\n }\n};\n\nconst _A = \"Arn\";\nconst _AKI = \"AccessKeyId\";\nconst _AP = \"AssumedPrincipal\";\nconst _AR = \"AssumeRole\";\nconst _ARI = \"AssumedRoleId\";\nconst _ARR = \"AssumeRoleRequest\";\nconst _ARRs = \"AssumeRoleResponse\";\nconst _ARRss = \"AssumeRootRequest\";\nconst _ARRssu = \"AssumeRootResponse\";\nconst _ARU = \"AssumedRoleUser\";\nconst _ARWSAML = \"AssumeRoleWithSAML\";\nconst _ARWSAMLR = \"AssumeRoleWithSAMLRequest\";\nconst _ARWSAMLRs = \"AssumeRoleWithSAMLResponse\";\nconst _ARWWI = \"AssumeRoleWithWebIdentity\";\nconst _ARWWIR = \"AssumeRoleWithWebIdentityRequest\";\nconst _ARWWIRs = \"AssumeRoleWithWebIdentityResponse\";\nconst _ARs = \"AssumeRoot\";\nconst _Ac = \"Account\";\nconst _Au = \"Audience\";\nconst _C = \"Credentials\";\nconst _CA = \"ContextAssertion\";\nconst _DAM = \"DecodeAuthorizationMessage\";\nconst _DAMR = \"DecodeAuthorizationMessageRequest\";\nconst _DAMRe = \"DecodeAuthorizationMessageResponse\";\nconst _DM = \"DecodedMessage\";\nconst _DS = \"DurationSeconds\";\nconst _E = \"Expiration\";\nconst _EI = \"ExternalId\";\nconst _EM = \"EncodedMessage\";\nconst _ETE = \"ExpiredTokenException\";\nconst _ETITE = \"ExpiredTradeInTokenException\";\nconst _FU = \"FederatedUser\";\nconst _FUI = \"FederatedUserId\";\nconst _GAKI = \"GetAccessKeyInfo\";\nconst _GAKIR = \"GetAccessKeyInfoRequest\";\nconst _GAKIRe = \"GetAccessKeyInfoResponse\";\nconst _GCI = \"GetCallerIdentity\";\nconst _GCIR = \"GetCallerIdentityRequest\";\nconst _GCIRe = \"GetCallerIdentityResponse\";\nconst _GDAT = \"GetDelegatedAccessToken\";\nconst _GDATR = \"GetDelegatedAccessTokenRequest\";\nconst _GDATRe = \"GetDelegatedAccessTokenResponse\";\nconst _GFT = \"GetFederationToken\";\nconst _GFTR = \"GetFederationTokenRequest\";\nconst _GFTRe = \"GetFederationTokenResponse\";\nconst _GST = \"GetSessionToken\";\nconst _GSTR = \"GetSessionTokenRequest\";\nconst _GSTRe = \"GetSessionTokenResponse\";\nconst _GWIT = \"GetWebIdentityToken\";\nconst _GWITR = \"GetWebIdentityTokenRequest\";\nconst _GWITRe = \"GetWebIdentityTokenResponse\";\nconst _I = \"Issuer\";\nconst _IAME = \"InvalidAuthorizationMessageException\";\nconst _IDPCEE = \"IDPCommunicationErrorException\";\nconst _IDPRCE = \"IDPRejectedClaimException\";\nconst _IITE = \"InvalidIdentityTokenException\";\nconst _JWTPSEE = \"JWTPayloadSizeExceededException\";\nconst _K = \"Key\";\nconst _MPDE = \"MalformedPolicyDocumentException\";\nconst _N = \"Name\";\nconst _NQ = \"NameQualifier\";\nconst _OWIFDE = \"OutboundWebIdentityFederationDisabledException\";\nconst _P = \"Policy\";\nconst _PA = \"PolicyArns\";\nconst _PAr = \"PrincipalArn\";\nconst _PAro = \"ProviderArn\";\nconst _PC = \"ProvidedContexts\";\nconst _PCLT = \"ProvidedContextsListType\";\nconst _PCr = \"ProvidedContext\";\nconst _PDT = \"PolicyDescriptorType\";\nconst _PI = \"ProviderId\";\nconst _PPS = \"PackedPolicySize\";\nconst _PPTLE = \"PackedPolicyTooLargeException\";\nconst _Pr = \"Provider\";\nconst _RA = \"RoleArn\";\nconst _RDE = \"RegionDisabledException\";\nconst _RSN = \"RoleSessionName\";\nconst _S = \"Subject\";\nconst _SA = \"SigningAlgorithm\";\nconst _SAK = \"SecretAccessKey\";\nconst _SAMLA = \"SAMLAssertion\";\nconst _SAMLAT = \"SAMLAssertionType\";\nconst _SDEE = \"SessionDurationEscalationException\";\nconst _SFWIT = \"SubjectFromWebIdentityToken\";\nconst _SI = \"SourceIdentity\";\nconst _SN = \"SerialNumber\";\nconst _ST = \"SubjectType\";\nconst _STe = \"SessionToken\";\nconst _T = \"Tags\";\nconst _TC = \"TokenCode\";\nconst _TIT = \"TradeInToken\";\nconst _TP = \"TargetPrincipal\";\nconst _TPA = \"TaskPolicyArn\";\nconst _TTK = \"TransitiveTagKeys\";\nconst _Ta = \"Tag\";\nconst _UI = \"UserId\";\nconst _V = \"Value\";\nconst _WIT = \"WebIdentityToken\";\nconst _a = \"arn\";\nconst _aKST = \"accessKeySecretType\";\nconst _aQE = \"awsQueryError\";\nconst _c = \"client\";\nconst _cTT = \"clientTokenType\";\nconst _e = \"error\";\nconst _hE = \"httpError\";\nconst _m = \"message\";\nconst _pDLT = \"policyDescriptorListType\";\nconst _s = \"smithy.ts.sdk.synthetic.com.amazonaws.sts\";\nconst _tITT = \"tradeInTokenType\";\nconst _tLT = \"tagListType\";\nconst _wITT = \"webIdentityTokenType\";\nconst n0 = \"com.amazonaws.sts\";\nvar accessKeySecretType = [0, n0, _aKST, 8, 0];\nvar clientTokenType = [0, n0, _cTT, 8, 0];\nvar SAMLAssertionType = [0, n0, _SAMLAT, 8, 0];\nvar tradeInTokenType = [0, n0, _tITT, 8, 0];\nvar webIdentityTokenType = [0, n0, _wITT, 8, 0];\nvar AssumedRoleUser = [3, n0, _ARU, 0, [_ARI, _A], [0, 0]];\nvar AssumeRoleRequest = [\n 3,\n n0,\n _ARR,\n 0,\n [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC],\n [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType],\n];\nvar AssumeRoleResponse = [\n 3,\n n0,\n _ARRs,\n 0,\n [_C, _ARU, _PPS, _SI],\n [[() => Credentials, 0], () => AssumedRoleUser, 1, 0],\n];\nvar AssumeRoleWithSAMLRequest = [\n 3,\n n0,\n _ARWSAMLR,\n 0,\n [_RA, _PAr, _SAMLA, _PA, _P, _DS],\n [0, 0, [() => SAMLAssertionType, 0], () => policyDescriptorListType, 0, 1],\n];\nvar AssumeRoleWithSAMLResponse = [\n 3,\n n0,\n _ARWSAMLRs,\n 0,\n [_C, _ARU, _PPS, _S, _ST, _I, _Au, _NQ, _SI],\n [[() => Credentials, 0], () => AssumedRoleUser, 1, 0, 0, 0, 0, 0, 0],\n];\nvar AssumeRoleWithWebIdentityRequest = [\n 3,\n n0,\n _ARWWIR,\n 0,\n [_RA, _RSN, _WIT, _PI, _PA, _P, _DS],\n [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1],\n];\nvar AssumeRoleWithWebIdentityResponse = [\n 3,\n n0,\n _ARWWIRs,\n 0,\n [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI],\n [[() => Credentials, 0], 0, () => AssumedRoleUser, 1, 0, 0, 0],\n];\nvar AssumeRootRequest = [\n 3,\n n0,\n _ARRss,\n 0,\n [_TP, _TPA, _DS],\n [0, () => PolicyDescriptorType, 1],\n];\nvar AssumeRootResponse = [3, n0, _ARRssu, 0, [_C, _SI], [[() => Credentials, 0], 0]];\nvar Credentials = [\n 3,\n n0,\n _C,\n 0,\n [_AKI, _SAK, _STe, _E],\n [0, [() => accessKeySecretType, 0], 0, 4],\n];\nvar DecodeAuthorizationMessageRequest = [3, n0, _DAMR, 0, [_EM], [0]];\nvar DecodeAuthorizationMessageResponse = [3, n0, _DAMRe, 0, [_DM], [0]];\nvar ExpiredTokenException = [\n -3,\n n0,\n _ETE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`ExpiredTokenException`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ExpiredTokenException, ExpiredTokenException$1);\nvar ExpiredTradeInTokenException = [\n -3,\n n0,\n _ETITE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`ExpiredTradeInTokenException`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ExpiredTradeInTokenException, ExpiredTradeInTokenException$1);\nvar FederatedUser = [3, n0, _FU, 0, [_FUI, _A], [0, 0]];\nvar GetAccessKeyInfoRequest = [3, n0, _GAKIR, 0, [_AKI], [0]];\nvar GetAccessKeyInfoResponse = [3, n0, _GAKIRe, 0, [_Ac], [0]];\nvar GetCallerIdentityRequest = [3, n0, _GCIR, 0, [], []];\nvar GetCallerIdentityResponse = [3, n0, _GCIRe, 0, [_UI, _Ac, _A], [0, 0, 0]];\nvar GetDelegatedAccessTokenRequest = [\n 3,\n n0,\n _GDATR,\n 0,\n [_TIT],\n [[() => tradeInTokenType, 0]],\n];\nvar GetDelegatedAccessTokenResponse = [\n 3,\n n0,\n _GDATRe,\n 0,\n [_C, _PPS, _AP],\n [[() => Credentials, 0], 1, 0],\n];\nvar GetFederationTokenRequest = [\n 3,\n n0,\n _GFTR,\n 0,\n [_N, _P, _PA, _DS, _T],\n [0, 0, () => policyDescriptorListType, 1, () => tagListType],\n];\nvar GetFederationTokenResponse = [\n 3,\n n0,\n _GFTRe,\n 0,\n [_C, _FU, _PPS],\n [[() => Credentials, 0], () => FederatedUser, 1],\n];\nvar GetSessionTokenRequest = [3, n0, _GSTR, 0, [_DS, _SN, _TC], [1, 0, 0]];\nvar GetSessionTokenResponse = [3, n0, _GSTRe, 0, [_C], [[() => Credentials, 0]]];\nvar GetWebIdentityTokenRequest = [\n 3,\n n0,\n _GWITR,\n 0,\n [_Au, _DS, _SA, _T],\n [64 | 0, 1, 0, () => tagListType],\n];\nvar GetWebIdentityTokenResponse = [\n 3,\n n0,\n _GWITRe,\n 0,\n [_WIT, _E],\n [[() => webIdentityTokenType, 0], 4],\n];\nvar IDPCommunicationErrorException = [\n -3,\n n0,\n _IDPCEE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`IDPCommunicationError`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(IDPCommunicationErrorException, IDPCommunicationErrorException$1);\nvar IDPRejectedClaimException = [\n -3,\n n0,\n _IDPRCE,\n {\n [_e]: _c,\n [_hE]: 403,\n [_aQE]: [`IDPRejectedClaim`, 403],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(IDPRejectedClaimException, IDPRejectedClaimException$1);\nvar InvalidAuthorizationMessageException = [\n -3,\n n0,\n _IAME,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`InvalidAuthorizationMessageException`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidAuthorizationMessageException, InvalidAuthorizationMessageException$1);\nvar InvalidIdentityTokenException = [\n -3,\n n0,\n _IITE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`InvalidIdentityToken`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidIdentityTokenException, InvalidIdentityTokenException$1);\nvar JWTPayloadSizeExceededException = [\n -3,\n n0,\n _JWTPSEE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`JWTPayloadSizeExceededException`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(JWTPayloadSizeExceededException, JWTPayloadSizeExceededException$1);\nvar MalformedPolicyDocumentException = [\n -3,\n n0,\n _MPDE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`MalformedPolicyDocument`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(MalformedPolicyDocumentException, MalformedPolicyDocumentException$1);\nvar OutboundWebIdentityFederationDisabledException = [\n -3,\n n0,\n _OWIFDE,\n {\n [_e]: _c,\n [_hE]: 403,\n [_aQE]: [`OutboundWebIdentityFederationDisabledException`, 403],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(OutboundWebIdentityFederationDisabledException, OutboundWebIdentityFederationDisabledException$1);\nvar PackedPolicyTooLargeException = [\n -3,\n n0,\n _PPTLE,\n {\n [_e]: _c,\n [_hE]: 400,\n [_aQE]: [`PackedPolicyTooLarge`, 400],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(PackedPolicyTooLargeException, PackedPolicyTooLargeException$1);\nvar PolicyDescriptorType = [3, n0, _PDT, 0, [_a], [0]];\nvar ProvidedContext = [3, n0, _PCr, 0, [_PAro, _CA], [0, 0]];\nvar RegionDisabledException = [\n -3,\n n0,\n _RDE,\n {\n [_e]: _c,\n [_hE]: 403,\n [_aQE]: [`RegionDisabledException`, 403],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(RegionDisabledException, RegionDisabledException$1);\nvar SessionDurationEscalationException = [\n -3,\n n0,\n _SDEE,\n {\n [_e]: _c,\n [_hE]: 403,\n [_aQE]: [`SessionDurationEscalationException`, 403],\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(SessionDurationEscalationException, SessionDurationEscalationException$1);\nvar Tag = [3, n0, _Ta, 0, [_K, _V], [0, 0]];\nvar STSServiceException = [-3, _s, \"STSServiceException\", 0, [], []];\nschema.TypeRegistry.for(_s).registerError(STSServiceException, STSServiceException$1);\nvar policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType];\nvar ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext];\nvar tagListType = [1, n0, _tLT, 0, () => Tag];\nvar AssumeRole = [9, n0, _AR, 0, () => AssumeRoleRequest, () => AssumeRoleResponse];\nvar AssumeRoleWithSAML = [\n 9,\n n0,\n _ARWSAML,\n 0,\n () => AssumeRoleWithSAMLRequest,\n () => AssumeRoleWithSAMLResponse,\n];\nvar AssumeRoleWithWebIdentity = [\n 9,\n n0,\n _ARWWI,\n 0,\n () => AssumeRoleWithWebIdentityRequest,\n () => AssumeRoleWithWebIdentityResponse,\n];\nvar AssumeRoot = [9, n0, _ARs, 0, () => AssumeRootRequest, () => AssumeRootResponse];\nvar DecodeAuthorizationMessage = [\n 9,\n n0,\n _DAM,\n 0,\n () => DecodeAuthorizationMessageRequest,\n () => DecodeAuthorizationMessageResponse,\n];\nvar GetAccessKeyInfo = [\n 9,\n n0,\n _GAKI,\n 0,\n () => GetAccessKeyInfoRequest,\n () => GetAccessKeyInfoResponse,\n];\nvar GetCallerIdentity = [\n 9,\n n0,\n _GCI,\n 0,\n () => GetCallerIdentityRequest,\n () => GetCallerIdentityResponse,\n];\nvar GetDelegatedAccessToken = [\n 9,\n n0,\n _GDAT,\n 0,\n () => GetDelegatedAccessTokenRequest,\n () => GetDelegatedAccessTokenResponse,\n];\nvar GetFederationToken = [\n 9,\n n0,\n _GFT,\n 0,\n () => GetFederationTokenRequest,\n () => GetFederationTokenResponse,\n];\nvar GetSessionToken = [\n 9,\n n0,\n _GST,\n 0,\n () => GetSessionTokenRequest,\n () => GetSessionTokenResponse,\n];\nvar GetWebIdentityToken = [\n 9,\n n0,\n _GWIT,\n 0,\n () => GetWebIdentityTokenRequest,\n () => GetWebIdentityTokenResponse,\n];\n\nclass AssumeRoleCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"AssumeRole\", {})\n .n(\"STSClient\", \"AssumeRoleCommand\")\n .sc(AssumeRole)\n .build() {\n}\n\nclass AssumeRoleWithSAMLCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"AssumeRoleWithSAML\", {})\n .n(\"STSClient\", \"AssumeRoleWithSAMLCommand\")\n .sc(AssumeRoleWithSAML)\n .build() {\n}\n\nclass AssumeRoleWithWebIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"AssumeRoleWithWebIdentity\", {})\n .n(\"STSClient\", \"AssumeRoleWithWebIdentityCommand\")\n .sc(AssumeRoleWithWebIdentity)\n .build() {\n}\n\nclass AssumeRootCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"AssumeRoot\", {})\n .n(\"STSClient\", \"AssumeRootCommand\")\n .sc(AssumeRoot)\n .build() {\n}\n\nclass DecodeAuthorizationMessageCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"DecodeAuthorizationMessage\", {})\n .n(\"STSClient\", \"DecodeAuthorizationMessageCommand\")\n .sc(DecodeAuthorizationMessage)\n .build() {\n}\n\nclass GetAccessKeyInfoCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"GetAccessKeyInfo\", {})\n .n(\"STSClient\", \"GetAccessKeyInfoCommand\")\n .sc(GetAccessKeyInfo)\n .build() {\n}\n\nclass GetCallerIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"GetCallerIdentity\", {})\n .n(\"STSClient\", \"GetCallerIdentityCommand\")\n .sc(GetCallerIdentity)\n .build() {\n}\n\nclass GetDelegatedAccessTokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"GetDelegatedAccessToken\", {})\n .n(\"STSClient\", \"GetDelegatedAccessTokenCommand\")\n .sc(GetDelegatedAccessToken)\n .build() {\n}\n\nclass GetFederationTokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"GetFederationToken\", {})\n .n(\"STSClient\", \"GetFederationTokenCommand\")\n .sc(GetFederationToken)\n .build() {\n}\n\nclass GetSessionTokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"GetSessionToken\", {})\n .n(\"STSClient\", \"GetSessionTokenCommand\")\n .sc(GetSessionToken)\n .build() {\n}\n\nclass GetWebIdentityTokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(EndpointParameters.commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSecurityTokenServiceV20110615\", \"GetWebIdentityToken\", {})\n .n(\"STSClient\", \"GetWebIdentityTokenCommand\")\n .sc(GetWebIdentityToken)\n .build() {\n}\n\nconst commands = {\n AssumeRoleCommand,\n AssumeRoleWithSAMLCommand,\n AssumeRoleWithWebIdentityCommand,\n AssumeRootCommand,\n DecodeAuthorizationMessageCommand,\n GetAccessKeyInfoCommand,\n GetCallerIdentityCommand,\n GetDelegatedAccessTokenCommand,\n GetFederationTokenCommand,\n GetSessionTokenCommand,\n GetWebIdentityTokenCommand,\n};\nclass STS extends STSClient.STSClient {\n}\nsmithyClient.createAggregatedClient(commands, STS);\n\nconst getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {\n if (typeof assumedRoleUser?.Arn === \"string\") {\n const arnComponents = assumedRoleUser.Arn.split(\":\");\n if (arnComponents.length > 4 && arnComponents[4] !== \"\") {\n return arnComponents[4];\n }\n }\n return undefined;\n};\nconst resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => {\n const region = typeof _region === \"function\" ? await _region() : _region;\n const parentRegion = typeof _parentRegion === \"function\" ? await _parentRegion() : _parentRegion;\n const stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)();\n credentialProviderLogger?.debug?.(\"@aws-sdk/client-sts::resolveRegion\", \"accepting first of:\", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`);\n return region ?? parentRegion ?? stsDefaultRegion;\n};\nconst getDefaultRoleAssumer$1 = (stsOptions, STSClient) => {\n let stsClient;\n let closureSourceCreds;\n return async (sourceCreds, params) => {\n closureSourceCreds = sourceCreds;\n if (!stsClient) {\n const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId, } = stsOptions;\n const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {\n logger,\n profile,\n });\n const isCompatibleRequestHandler = !isH2(requestHandler);\n stsClient = new STSClient({\n ...stsOptions,\n userAgentAppId,\n profile,\n credentialDefaultProvider: () => async () => closureSourceCreds,\n region: resolvedRegion,\n requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,\n logger: logger,\n });\n }\n const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params));\n if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {\n throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);\n }\n const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);\n const credentials = {\n accessKeyId: Credentials.AccessKeyId,\n secretAccessKey: Credentials.SecretAccessKey,\n sessionToken: Credentials.SessionToken,\n expiration: Credentials.Expiration,\n ...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),\n ...(accountId && { accountId }),\n };\n client.setCredentialFeature(credentials, \"CREDENTIALS_STS_ASSUME_ROLE\", \"i\");\n return credentials;\n };\n};\nconst getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient) => {\n let stsClient;\n return async (params) => {\n if (!stsClient) {\n const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId, } = stsOptions;\n const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {\n logger,\n profile,\n });\n const isCompatibleRequestHandler = !isH2(requestHandler);\n stsClient = new STSClient({\n ...stsOptions,\n userAgentAppId,\n profile,\n region: resolvedRegion,\n requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,\n logger: logger,\n });\n }\n const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));\n if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {\n throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);\n }\n const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);\n const credentials = {\n accessKeyId: Credentials.AccessKeyId,\n secretAccessKey: Credentials.SecretAccessKey,\n sessionToken: Credentials.SessionToken,\n expiration: Credentials.Expiration,\n ...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),\n ...(accountId && { accountId }),\n };\n if (accountId) {\n client.setCredentialFeature(credentials, \"RESOLVED_ACCOUNT_ID\", \"T\");\n }\n client.setCredentialFeature(credentials, \"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID\", \"k\");\n return credentials;\n };\n};\nconst isH2 = (requestHandler) => {\n return requestHandler?.metadata?.handlerProtocol === \"h2\";\n};\n\nconst getCustomizableStsClientCtor = (baseCtor, customizations) => {\n if (!customizations)\n return baseCtor;\n else\n return class CustomizableSTSClient extends baseCtor {\n constructor(config) {\n super(config);\n for (const customization of customizations) {\n this.middlewareStack.use(customization);\n }\n }\n };\n};\nconst getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));\nconst getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));\nconst decorateDefaultCredentialProvider = (provider) => (input) => provider({\n roleAssumer: getDefaultRoleAssumer(input),\n roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input),\n ...input,\n});\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nexports.AssumeRoleCommand = AssumeRoleCommand;\nexports.AssumeRoleWithSAMLCommand = AssumeRoleWithSAMLCommand;\nexports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand;\nexports.AssumeRootCommand = AssumeRootCommand;\nexports.DecodeAuthorizationMessageCommand = DecodeAuthorizationMessageCommand;\nexports.ExpiredTokenException = ExpiredTokenException$1;\nexports.ExpiredTradeInTokenException = ExpiredTradeInTokenException$1;\nexports.GetAccessKeyInfoCommand = GetAccessKeyInfoCommand;\nexports.GetCallerIdentityCommand = GetCallerIdentityCommand;\nexports.GetDelegatedAccessTokenCommand = GetDelegatedAccessTokenCommand;\nexports.GetFederationTokenCommand = GetFederationTokenCommand;\nexports.GetSessionTokenCommand = GetSessionTokenCommand;\nexports.GetWebIdentityTokenCommand = GetWebIdentityTokenCommand;\nexports.IDPCommunicationErrorException = IDPCommunicationErrorException$1;\nexports.IDPRejectedClaimException = IDPRejectedClaimException$1;\nexports.InvalidAuthorizationMessageException = InvalidAuthorizationMessageException$1;\nexports.InvalidIdentityTokenException = InvalidIdentityTokenException$1;\nexports.JWTPayloadSizeExceededException = JWTPayloadSizeExceededException$1;\nexports.MalformedPolicyDocumentException = MalformedPolicyDocumentException$1;\nexports.OutboundWebIdentityFederationDisabledException = OutboundWebIdentityFederationDisabledException$1;\nexports.PackedPolicyTooLargeException = PackedPolicyTooLargeException$1;\nexports.RegionDisabledException = RegionDisabledException$1;\nexports.STS = STS;\nexports.STSServiceException = STSServiceException$1;\nexports.SessionDurationEscalationException = SessionDurationEscalationException$1;\nexports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider;\nexports.getDefaultRoleAssumer = getDefaultRoleAssumer;\nexports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity;\nObject.keys(STSClient).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () { return STSClient[k]; }\n });\n});\n", + "\n const handler = { get: (t, p) => p === '__esModule' ? true : () => {} };\n const stub = new Proxy({}, handler);\n export default stub;\n export const __stub__ = true;\n \n ", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.propertyProviderChain = exports.createCredentialChain = void 0;\nconst property_provider_1 = require(\"@smithy/property-provider\");\nconst createCredentialChain = (...credentialProviders) => {\n let expireAfter = -1;\n const baseFunction = async (awsIdentityProperties) => {\n const credentials = await (0, exports.propertyProviderChain)(...credentialProviders)(awsIdentityProperties);\n if (!credentials.expiration && expireAfter !== -1) {\n credentials.expiration = new Date(Date.now() + expireAfter);\n }\n return credentials;\n };\n const withOptions = Object.assign(baseFunction, {\n expireAfter(milliseconds) {\n if (milliseconds < 5 * 60_000) {\n throw new Error(\"@aws-sdk/credential-providers - createCredentialChain(...).expireAfter(ms) may not be called with a duration lower than five minutes.\");\n }\n expireAfter = milliseconds;\n return withOptions;\n },\n });\n return withOptions;\n};\nexports.createCredentialChain = createCredentialChain;\nconst propertyProviderChain = (...providers) => async (awsIdentityProperties) => {\n if (providers.length === 0) {\n throw new property_provider_1.ProviderError(\"No providers in chain\", { tryNextLink: false });\n }\n let lastProviderError;\n for (const provider of providers) {\n try {\n return await provider(awsIdentityProperties);\n }\n catch (err) {\n lastProviderError = err;\n if (err?.tryNextLink) {\n continue;\n }\n throw err;\n }\n }\n throw lastProviderError;\n};\nexports.propertyProviderChain = propertyProviderChain;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultCognitoIdentityHttpAuthSchemeProvider = exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = void 0;\nconst httpAuthSchemes_1 = require(\"@aws-sdk/core/httpAuthSchemes\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultCognitoIdentityHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = defaultCognitoIdentityHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"cognito-identity\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultCognitoIdentityHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"GetCredentialsForIdentity\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n case \"GetId\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultCognitoIdentityHttpAuthSchemeProvider = defaultCognitoIdentityHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, httpAuthSchemes_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst w = \"required\", x = \"fn\", y = \"argv\", z = \"ref\";\nconst a = true, b = \"isSet\", c = \"booleanEquals\", d = \"error\", e = \"endpoint\", f = \"tree\", g = \"PartitionResult\", h = \"getAttr\", i = \"stringEquals\", j = { [w]: false, type: \"string\" }, k = { [w]: true, default: false, type: \"boolean\" }, l = { [z]: \"Endpoint\" }, m = { [x]: c, [y]: [{ [z]: \"UseFIPS\" }, true] }, n = { [x]: c, [y]: [{ [z]: \"UseDualStack\" }, true] }, o = {}, p = { [z]: \"Region\" }, q = { [x]: h, [y]: [{ [z]: g }, \"supportsFIPS\"] }, r = { [z]: g }, s = { [x]: c, [y]: [true, { [x]: h, [y]: [r, \"supportsDualStack\"] }] }, t = [m], u = [n], v = [p];\nconst _data = {\n version: \"1.0\",\n parameters: { Region: j, UseDualStack: k, UseFIPS: k, Endpoint: j },\n rules: [\n {\n conditions: [{ [x]: b, [y]: [l] }],\n rules: [\n { conditions: t, error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", type: d },\n { conditions: u, error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", type: d },\n { endpoint: { url: l, properties: o, headers: o }, type: e },\n ],\n type: f,\n },\n {\n conditions: [{ [x]: b, [y]: v }],\n rules: [\n {\n conditions: [{ [x]: \"aws.partition\", [y]: v, assign: g }],\n rules: [\n {\n conditions: [m, n],\n rules: [\n {\n conditions: [{ [x]: c, [y]: [a, q] }, s],\n rules: [\n {\n conditions: [{ [x]: i, [y]: [p, \"us-east-1\"] }],\n endpoint: {\n url: \"https://cognito-identity-fips.us-east-1.amazonaws.com\",\n properties: o,\n headers: o,\n },\n type: e,\n },\n {\n conditions: [{ [x]: i, [y]: [p, \"us-east-2\"] }],\n endpoint: {\n url: \"https://cognito-identity-fips.us-east-2.amazonaws.com\",\n properties: o,\n headers: o,\n },\n type: e,\n },\n {\n conditions: [{ [x]: i, [y]: [p, \"us-west-1\"] }],\n endpoint: {\n url: \"https://cognito-identity-fips.us-west-1.amazonaws.com\",\n properties: o,\n headers: o,\n },\n type: e,\n },\n {\n conditions: [{ [x]: i, [y]: [p, \"us-west-2\"] }],\n endpoint: {\n url: \"https://cognito-identity-fips.us-west-2.amazonaws.com\",\n properties: o,\n headers: o,\n },\n type: e,\n },\n {\n endpoint: {\n url: \"https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\",\n properties: o,\n headers: o,\n },\n type: e,\n },\n ],\n type: f,\n },\n { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", type: d },\n ],\n type: f,\n },\n {\n conditions: t,\n rules: [\n {\n conditions: [{ [x]: c, [y]: [q, a] }],\n rules: [\n {\n endpoint: {\n url: \"https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}\",\n properties: o,\n headers: o,\n },\n type: e,\n },\n ],\n type: f,\n },\n { error: \"FIPS is enabled but this partition does not support FIPS\", type: d },\n ],\n type: f,\n },\n {\n conditions: u,\n rules: [\n {\n conditions: [s],\n rules: [\n {\n conditions: [{ [x]: i, [y]: [\"aws\", { [x]: h, [y]: [r, \"name\"] }] }],\n endpoint: { url: \"https://cognito-identity.{Region}.amazonaws.com\", properties: o, headers: o },\n type: e,\n },\n {\n endpoint: {\n url: \"https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}\",\n properties: o,\n headers: o,\n },\n type: e,\n },\n ],\n type: f,\n },\n { error: \"DualStack is enabled but this partition does not support DualStack\", type: d },\n ],\n type: f,\n },\n {\n endpoint: {\n url: \"https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}\",\n properties: o,\n headers: o,\n },\n type: e,\n },\n ],\n type: f,\n },\n ],\n type: f,\n },\n { error: \"Invalid Configuration: Missing Region\", type: d },\n ],\n};\nexports.ruleSet = _data;\n", @@ -1603,205 +1449,10 @@ "export const MODEL_ALIASES = [\n 'sonnet',\n 'opus',\n 'haiku',\n 'best',\n 'sonnet[1m]',\n 'opus[1m]',\n 'opusplan',\n] as const\nexport type ModelAlias = (typeof MODEL_ALIASES)[number]\n\nexport function isModelAlias(modelInput: string): modelInput is ModelAlias {\n return MODEL_ALIASES.includes(modelInput as ModelAlias)\n}\n\n/**\n * Bare model family aliases that act as wildcards in the availableModels allowlist.\n * When \"opus\" is in the allowlist, ANY opus model is allowed (opus 4.5, 4.6, etc.).\n * When a specific model ID is in the allowlist, only that exact version is allowed.\n */\nexport const MODEL_FAMILY_ALIASES = ['sonnet', 'opus', 'haiku'] as const\n\nexport function isModelFamilyAlias(model: string): boolean {\n return (MODEL_FAMILY_ALIASES as readonly string[]).includes(model)\n}\n", "import { getSettings_DEPRECATED } from '../settings/settings.js'\nimport { isModelAlias, isModelFamilyAlias } from './aliases.js'\nimport { parseUserSpecifiedModel } from './model.js'\nimport { resolveOverriddenModel } from './modelStrings.js'\n\n/**\n * Check if a model belongs to a given family by checking if its name\n * (or resolved name) contains the family identifier.\n */\nfunction modelBelongsToFamily(model: string, family: string): boolean {\n if (model.includes(family)) {\n return true\n }\n // Resolve aliases like \"best\" → \"claude-opus-4-6\" to check family membership\n if (isModelAlias(model)) {\n const resolved = parseUserSpecifiedModel(model).toLowerCase()\n return resolved.includes(family)\n }\n return false\n}\n\n/**\n * Check if a model name starts with a prefix at a segment boundary.\n * The prefix must match up to the end of the name or a \"-\" separator.\n * e.g. \"claude-opus-4-5\" matches \"claude-opus-4-5-20251101\" but not \"claude-opus-4-50\".\n */\nfunction prefixMatchesModel(modelName: string, prefix: string): boolean {\n if (!modelName.startsWith(prefix)) {\n return false\n }\n return modelName.length === prefix.length || modelName[prefix.length] === '-'\n}\n\n/**\n * Check if a model matches a version-prefix entry in the allowlist.\n * Supports shorthand like \"opus-4-5\" (mapped to \"claude-opus-4-5\") and\n * full prefixes like \"claude-opus-4-5\". Resolves input aliases before matching.\n */\nfunction modelMatchesVersionPrefix(model: string, entry: string): boolean {\n // Resolve the input model to a full name if it's an alias\n const resolvedModel = isModelAlias(model)\n ? parseUserSpecifiedModel(model).toLowerCase()\n : model\n\n // Try the entry as-is (e.g. \"claude-opus-4-5\")\n if (prefixMatchesModel(resolvedModel, entry)) {\n return true\n }\n // Try with \"claude-\" prefix (e.g. \"opus-4-5\" → \"claude-opus-4-5\")\n if (\n !entry.startsWith('claude-') &&\n prefixMatchesModel(resolvedModel, `claude-${entry}`)\n ) {\n return true\n }\n return false\n}\n\n/**\n * Check if a family alias is narrowed by more specific entries in the allowlist.\n * When the allowlist contains both \"opus\" and \"opus-4-5\", the specific entry\n * takes precedence — \"opus\" alone would be a wildcard, but \"opus-4-5\" narrows\n * it to only that version.\n */\nfunction familyHasSpecificEntries(\n family: string,\n allowlist: string[],\n): boolean {\n for (const entry of allowlist) {\n if (isModelFamilyAlias(entry)) {\n continue\n }\n // Check if entry is a version-qualified variant of this family\n // e.g., \"opus-4-5\" or \"claude-opus-4-5-20251101\" for the \"opus\" family\n // Must match at a segment boundary (followed by '-' or end) to avoid\n // false positives like \"opusplan\" matching \"opus\"\n const idx = entry.indexOf(family)\n if (idx === -1) {\n continue\n }\n const afterFamily = idx + family.length\n if (afterFamily === entry.length || entry[afterFamily] === '-') {\n return true\n }\n }\n return false\n}\n\n/**\n * Check if a model is allowed by the availableModels allowlist in settings.\n * If availableModels is not set, all models are allowed.\n *\n * Matching tiers:\n * 1. Family aliases (\"opus\", \"sonnet\", \"haiku\") — wildcard for the entire family,\n * UNLESS more specific entries for that family also exist (e.g., \"opus-4-5\").\n * In that case, the family wildcard is ignored and only the specific entries apply.\n * 2. Version prefixes (\"opus-4-5\", \"claude-opus-4-5\") — any build of that version\n * 3. Full model IDs (\"claude-opus-4-5-20251101\") — exact match only\n */\nexport function isModelAllowed(model: string): boolean {\n const settings = getSettings_DEPRECATED() || {}\n const { availableModels } = settings\n if (!availableModels) {\n return true // No restrictions\n }\n if (availableModels.length === 0) {\n return false // Empty allowlist blocks all user-specified models\n }\n\n const resolvedModel = resolveOverriddenModel(model)\n const normalizedModel = resolvedModel.trim().toLowerCase()\n const normalizedAllowlist = availableModels.map(m => m.trim().toLowerCase())\n\n // Direct match (alias-to-alias or full-name-to-full-name)\n // Skip family aliases that have been narrowed by specific entries —\n // e.g., \"opus\" in [\"opus\", \"opus-4-5\"] should NOT directly match,\n // because the admin intends to restrict to opus 4.5 only.\n if (normalizedAllowlist.includes(normalizedModel)) {\n if (\n !isModelFamilyAlias(normalizedModel) ||\n !familyHasSpecificEntries(normalizedModel, normalizedAllowlist)\n ) {\n return true\n }\n }\n\n // Family-level aliases in the allowlist match any model in that family,\n // but only if no more specific entries exist for that family.\n // e.g., [\"opus\"] allows all opus, but [\"opus\", \"opus-4-5\"] only allows opus 4.5.\n for (const entry of normalizedAllowlist) {\n if (\n isModelFamilyAlias(entry) &&\n !familyHasSpecificEntries(entry, normalizedAllowlist) &&\n modelBelongsToFamily(normalizedModel, entry)\n ) {\n return true\n }\n }\n\n // For non-family entries, do bidirectional alias resolution\n // If model is an alias, resolve it and check if the resolved name is in the list\n if (isModelAlias(normalizedModel)) {\n const resolved = parseUserSpecifiedModel(normalizedModel).toLowerCase()\n if (normalizedAllowlist.includes(resolved)) {\n return true\n }\n }\n\n // If any non-family alias in the allowlist resolves to the input model\n for (const entry of normalizedAllowlist) {\n if (!isModelFamilyAlias(entry) && isModelAlias(entry)) {\n const resolved = parseUserSpecifiedModel(entry).toLowerCase()\n if (resolved === normalizedModel) {\n return true\n }\n }\n }\n\n // Version-prefix matching: \"opus-4-5\" or \"claude-opus-4-5\" matches\n // \"claude-opus-4-5-20251101\" at a segment boundary\n for (const entry of normalizedAllowlist) {\n if (!isModelFamilyAlias(entry) && !isModelAlias(entry)) {\n if (modelMatchesVersionPrefix(normalizedModel, entry)) {\n return true\n }\n }\n }\n\n return false\n}\n", "// biome-ignore-all assist/source/organizeImports: ANT-ONLY import markers must not be reordered\n/**\n * Ensure that any model codenames introduced here are also added to\n * scripts/excluded-strings.txt to avoid leaking them. Wrap any codename string\n * literals with process.env.USER_TYPE === 'ant' for Bun to remove the codenames\n * during dead code elimination\n */\nimport { getMainLoopModelOverride } from '../../bootstrap/state.js'\nimport {\n getSubscriptionType,\n isClaudeAISubscriber,\n isMaxSubscriber,\n isProSubscriber,\n isTeamPremiumSubscriber,\n} from '../auth.js'\nimport {\n has1mContext,\n is1mContextDisabled,\n modelSupports1M,\n} from '../context.js'\nimport { isEnvTruthy } from '../envUtils.js'\nimport { getModelStrings, resolveOverriddenModel } from './modelStrings.js'\nimport { formatModelPricing, getOpus46CostTier } from '../modelCost.js'\nimport { getSettings_DEPRECATED } from '../settings/settings.js'\nimport type { PermissionMode } from '../permissions/PermissionMode.js'\nimport { getAPIProvider } from './providers.js'\nimport { LIGHTNING_BOLT } from '../../constants/figures.js'\nimport { isModelAllowed } from './modelAllowlist.js'\nimport { type ModelAlias, isModelAlias } from './aliases.js'\nimport { capitalize } from '../stringUtils.js'\n\nexport type ModelShortName = string\nexport type ModelName = string\nexport type ModelSetting = ModelName | ModelAlias | null\n\nexport function getSmallFastModel(): ModelName {\n return process.env.ANTHROPIC_SMALL_FAST_MODEL || getDefaultHaikuModel()\n}\n\nexport function isNonCustomOpusModel(model: ModelName): boolean {\n return (\n model === getModelStrings().opus40 ||\n model === getModelStrings().opus41 ||\n model === getModelStrings().opus45 ||\n model === getModelStrings().opus46\n )\n}\n\n/**\n * Helper to get the model from /model (including via /config), the --model flag, environment variable,\n * or the saved settings. The returned value can be a model alias if that's what the user specified.\n * Undefined if the user didn't configure anything, in which case we fall back to\n * the default (null).\n *\n * Priority order within this function:\n * 1. Model override during session (from /model command) - highest priority\n * 2. Model override at startup (from --model flag)\n * 3. ANTHROPIC_MODEL environment variable\n * 4. Settings (from user's saved settings)\n */\nexport function getUserSpecifiedModelSetting(): ModelSetting | undefined {\n let specifiedModel: ModelSetting | undefined\n\n const modelOverride = getMainLoopModelOverride()\n if (modelOverride !== undefined) {\n specifiedModel = modelOverride\n } else {\n const settings = getSettings_DEPRECATED() || {}\n specifiedModel = process.env.ANTHROPIC_MODEL || settings.model || undefined\n }\n\n // Ignore the user-specified model if it's not in the availableModels allowlist.\n if (specifiedModel && !isModelAllowed(specifiedModel)) {\n return undefined\n }\n\n return specifiedModel\n}\n\n/**\n * Get the main loop model to use for the current session.\n *\n * Model Selection Priority Order:\n * 1. Model override during session (from /model command) - highest priority\n * 2. Model override at startup (from --model flag)\n * 3. ANTHROPIC_MODEL environment variable\n * 4. Settings (from user's saved settings)\n * 5. Built-in default\n *\n * @returns The resolved model name to use\n */\nexport function getMainLoopModel(): ModelName {\n const model = getUserSpecifiedModelSetting()\n if (model !== undefined && model !== null) {\n return parseUserSpecifiedModel(model)\n }\n return getDefaultMainLoopModel()\n}\n\nexport function getBestModel(): ModelName {\n return getDefaultOpusModel()\n}\n\n// @[MODEL LAUNCH]: Update the default Opus model (3P providers may lag so keep defaults unchanged).\nexport function getDefaultOpusModel(): ModelName {\n if (process.env.ANTHROPIC_DEFAULT_OPUS_MODEL) {\n return process.env.ANTHROPIC_DEFAULT_OPUS_MODEL\n }\n // 3P providers (Bedrock, Vertex, Foundry) — kept as a separate branch\n // even when values match, since 3P availability lags firstParty and\n // these will diverge again at the next model launch.\n if (getAPIProvider() !== 'firstParty') {\n return getModelStrings().opus46\n }\n return getModelStrings().opus46\n}\n\n// @[MODEL LAUNCH]: Update the default Sonnet model (3P providers may lag so keep defaults unchanged).\nexport function getDefaultSonnetModel(): ModelName {\n if (process.env.ANTHROPIC_DEFAULT_SONNET_MODEL) {\n return process.env.ANTHROPIC_DEFAULT_SONNET_MODEL\n }\n // Default to Sonnet 4.5 for 3P since they may not have 4.6 yet\n if (getAPIProvider() !== 'firstParty') {\n return getModelStrings().sonnet45\n }\n return getModelStrings().sonnet46\n}\n\n// @[MODEL LAUNCH]: Update the default Haiku model (3P providers may lag so keep defaults unchanged).\nexport function getDefaultHaikuModel(): ModelName {\n if (process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL) {\n return process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL\n }\n\n // Haiku 4.5 is available on all platforms (first-party, Foundry, Bedrock, Vertex)\n return getModelStrings().haiku45\n}\n\n/**\n * Get the model to use for runtime, depending on the runtime context.\n * @param params Subset of the runtime context to determine the model to use.\n * @returns The model to use\n */\nexport function getRuntimeMainLoopModel(params: {\n permissionMode: PermissionMode\n mainLoopModel: string\n exceeds200kTokens?: boolean\n}): ModelName {\n const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params\n\n // opusplan uses Opus in plan mode without [1m] suffix.\n if (\n getUserSpecifiedModelSetting() === 'opusplan' &&\n permissionMode === 'plan' &&\n !exceeds200kTokens\n ) {\n return getDefaultOpusModel()\n }\n\n // sonnetplan by default\n if (getUserSpecifiedModelSetting() === 'haiku' && permissionMode === 'plan') {\n return getDefaultSonnetModel()\n }\n\n return mainLoopModel\n}\n\n/**\n * Get the default main loop model setting.\n *\n * This handles the built-in default:\n * - Opus for Max and Team Premium users\n * - Sonnet 4.6 for all other users (including Team Standard, Pro, Enterprise)\n *\n * @returns The default model setting to use\n */\nexport function getDefaultMainLoopModelSetting(): ModelName | ModelAlias {\n // Ants default to defaultModel from flag config, or Opus 1M if not configured\n if (process.env.USER_TYPE === 'ant') {\n return (\n getAntModelOverrideConfig()?.defaultModel ??\n getDefaultOpusModel() + '[1m]'\n )\n }\n\n // Max users get Opus as default\n if (isMaxSubscriber()) {\n return getDefaultOpusModel() + (isOpus1mMergeEnabled() ? '[1m]' : '')\n }\n\n // Team Premium gets Opus (same as Max)\n if (isTeamPremiumSubscriber()) {\n return getDefaultOpusModel() + (isOpus1mMergeEnabled() ? '[1m]' : '')\n }\n\n // PAYG (1P and 3P), Enterprise, Team Standard, and Pro get Sonnet as default\n // Note that PAYG (3P) may default to an older Sonnet model\n return getDefaultSonnetModel()\n}\n\n/**\n * Synchronous operation to get the default main loop model to use\n * (bypassing any user-specified values).\n */\nexport function getDefaultMainLoopModel(): ModelName {\n return parseUserSpecifiedModel(getDefaultMainLoopModelSetting())\n}\n\n// @[MODEL LAUNCH]: Add a canonical name mapping for the new model below.\n/**\n * Pure string-match that strips date/provider suffixes from a first-party model\n * name. Input must already be a 1P-format ID (e.g. 'claude-3-7-sonnet-20250219',\n * 'us.anthropic.claude-opus-4-6-v1:0'). Does not touch settings, so safe at\n * module top-level (see MODEL_COSTS in modelCost.ts).\n */\nexport function firstPartyNameToCanonical(name: ModelName): ModelShortName {\n name = name.toLowerCase()\n // Special cases for Claude 4+ models to differentiate versions\n // Order matters: check more specific versions first (4-5 before 4)\n if (name.includes('claude-opus-4-6')) {\n return 'claude-opus-4-6'\n }\n if (name.includes('claude-opus-4-5')) {\n return 'claude-opus-4-5'\n }\n if (name.includes('claude-opus-4-1')) {\n return 'claude-opus-4-1'\n }\n if (name.includes('claude-opus-4')) {\n return 'claude-opus-4'\n }\n if (name.includes('claude-sonnet-4-6')) {\n return 'claude-sonnet-4-6'\n }\n if (name.includes('claude-sonnet-4-5')) {\n return 'claude-sonnet-4-5'\n }\n if (name.includes('claude-sonnet-4')) {\n return 'claude-sonnet-4'\n }\n if (name.includes('claude-haiku-4-5')) {\n return 'claude-haiku-4-5'\n }\n // Claude 3.x models use a different naming scheme (claude-3-{family})\n if (name.includes('claude-3-7-sonnet')) {\n return 'claude-3-7-sonnet'\n }\n if (name.includes('claude-3-5-sonnet')) {\n return 'claude-3-5-sonnet'\n }\n if (name.includes('claude-3-5-haiku')) {\n return 'claude-3-5-haiku'\n }\n if (name.includes('claude-3-opus')) {\n return 'claude-3-opus'\n }\n if (name.includes('claude-3-sonnet')) {\n return 'claude-3-sonnet'\n }\n if (name.includes('claude-3-haiku')) {\n return 'claude-3-haiku'\n }\n const match = name.match(/(claude-(\\d+-\\d+-)?\\w+)/)\n if (match && match[1]) {\n return match[1]\n }\n // Fall back to the original name if no pattern matches\n return name\n}\n\n/**\n * Maps a full model string to a shorter canonical version that's unified across 1P and 3P providers.\n * For example, 'claude-3-5-haiku-20241022' and 'us.anthropic.claude-3-5-haiku-20241022-v1:0'\n * would both be mapped to 'claude-3-5-haiku'.\n * @param fullModelName The full model name (e.g., 'claude-3-5-haiku-20241022')\n * @returns The short name (e.g., 'claude-3-5-haiku') if found, or the original name if no mapping exists\n */\nexport function getCanonicalName(fullModelName: ModelName): ModelShortName {\n // Resolve overridden model IDs (e.g. Bedrock ARNs) back to canonical names.\n // resolved is always a 1P-format ID, so firstPartyNameToCanonical can handle it.\n return firstPartyNameToCanonical(resolveOverriddenModel(fullModelName))\n}\n\n// @[MODEL LAUNCH]: Update the default model description strings shown to users.\nexport function getClaudeAiUserDefaultModelDescription(\n fastMode = false,\n): string {\n if (isMaxSubscriber() || isTeamPremiumSubscriber()) {\n if (isOpus1mMergeEnabled()) {\n return `Opus 4.6 with 1M context · Most capable for complex work${fastMode ? getOpus46PricingSuffix(true) : ''}`\n }\n return `Opus 4.6 · Most capable for complex work${fastMode ? getOpus46PricingSuffix(true) : ''}`\n }\n return 'Sonnet 4.6 · Best for everyday tasks'\n}\n\nexport function renderDefaultModelSetting(\n setting: ModelName | ModelAlias,\n): string {\n if (setting === 'opusplan') {\n return 'Opus 4.6 in plan mode, else Sonnet 4.6'\n }\n return renderModelName(parseUserSpecifiedModel(setting))\n}\n\nexport function getOpus46PricingSuffix(fastMode: boolean): string {\n if (getAPIProvider() !== 'firstParty') return ''\n const pricing = formatModelPricing(getOpus46CostTier(fastMode))\n const fastModeIndicator = fastMode ? ` (${LIGHTNING_BOLT})` : ''\n return ` ·${fastModeIndicator} ${pricing}`\n}\n\nexport function isOpus1mMergeEnabled(): boolean {\n if (\n is1mContextDisabled() ||\n isProSubscriber() ||\n getAPIProvider() !== 'firstParty'\n ) {\n return false\n }\n // Fail closed when a subscriber's subscription type is unknown. The VS Code\n // config-loading subprocess can have OAuth tokens with valid scopes but no\n // subscriptionType field (stale or partial refresh). Without this guard,\n // isProSubscriber() returns false for such users and the merge leaks\n // opus[1m] into the model dropdown — the API then rejects it with a\n // misleading \"rate limit reached\" error.\n if (isClaudeAISubscriber() && getSubscriptionType() === null) {\n return false\n }\n return true\n}\n\nexport function renderModelSetting(setting: ModelName | ModelAlias): string {\n if (setting === 'opusplan') {\n return 'Opus Plan'\n }\n if (isModelAlias(setting)) {\n return capitalize(setting)\n }\n return renderModelName(setting)\n}\n\n// @[MODEL LAUNCH]: Add display name cases for the new model (base + [1m] variant if applicable).\n/**\n * Returns a human-readable display name for known public models, or null\n * if the model is not recognized as a public model.\n */\nexport function getPublicModelDisplayName(model: ModelName): string | null {\n switch (model) {\n case getModelStrings().opus46:\n return 'Opus 4.6'\n case getModelStrings().opus46 + '[1m]':\n return 'Opus 4.6 (1M context)'\n case getModelStrings().opus45:\n return 'Opus 4.5'\n case getModelStrings().opus41:\n return 'Opus 4.1'\n case getModelStrings().opus40:\n return 'Opus 4'\n case getModelStrings().sonnet46 + '[1m]':\n return 'Sonnet 4.6 (1M context)'\n case getModelStrings().sonnet46:\n return 'Sonnet 4.6'\n case getModelStrings().sonnet45 + '[1m]':\n return 'Sonnet 4.5 (1M context)'\n case getModelStrings().sonnet45:\n return 'Sonnet 4.5'\n case getModelStrings().sonnet40:\n return 'Sonnet 4'\n case getModelStrings().sonnet40 + '[1m]':\n return 'Sonnet 4 (1M context)'\n case getModelStrings().sonnet37:\n return 'Sonnet 3.7'\n case getModelStrings().sonnet35:\n return 'Sonnet 3.5'\n case getModelStrings().haiku45:\n return 'Haiku 4.5'\n case getModelStrings().haiku35:\n return 'Haiku 3.5'\n default:\n return null\n }\n}\n\nfunction maskModelCodename(baseName: string): string {\n // Mask only the first dash-separated segment (the codename), preserve the rest\n // e.g. capybara-v2-fast → cap*****-v2-fast\n const [codename = '', ...rest] = baseName.split('-')\n const masked =\n codename.slice(0, 3) + '*'.repeat(Math.max(0, codename.length - 3))\n return [masked, ...rest].join('-')\n}\n\nexport function renderModelName(model: ModelName): string {\n const publicName = getPublicModelDisplayName(model)\n if (publicName) {\n return publicName\n }\n if (process.env.USER_TYPE === 'ant') {\n const resolved = parseUserSpecifiedModel(model)\n const antModel = resolveAntModel(model)\n if (antModel) {\n const baseName = antModel.model.replace(/\\[1m\\]$/i, '')\n const masked = maskModelCodename(baseName)\n const suffix = has1mContext(resolved) ? '[1m]' : ''\n return masked + suffix\n }\n if (resolved !== model) {\n return `${model} (${resolved})`\n }\n return resolved\n }\n return model\n}\n\n/**\n * Returns a safe author name for public display (e.g., in git commit trailers).\n * Returns \"Claude {ModelName}\" for publicly known models, or \"Claude ({model})\"\n * for unknown/internal models so the exact model name is preserved.\n *\n * @param model The full model name\n * @returns \"Claude {ModelName}\" for public models, or \"Claude ({model})\" for non-public models\n */\nexport function getPublicModelName(model: ModelName): string {\n const publicName = getPublicModelDisplayName(model)\n if (publicName) {\n return `Claude ${publicName}`\n }\n return `Claude (${model})`\n}\n\n/**\n * Returns a full model name for use in this session, possibly after resolving\n * a model alias.\n *\n * This function intentionally does not support version numbers to align with\n * the model switcher.\n *\n * Supports [1m] suffix on any model alias (e.g., haiku[1m], sonnet[1m]) to enable\n * 1M context window without requiring each variant to be in MODEL_ALIASES.\n *\n * @param modelInput The model alias or name provided by the user.\n */\nexport function parseUserSpecifiedModel(\n modelInput: ModelName | ModelAlias,\n): ModelName {\n const modelInputTrimmed = modelInput.trim()\n const normalizedModel = modelInputTrimmed.toLowerCase()\n\n const has1mTag = has1mContext(normalizedModel)\n const modelString = has1mTag\n ? normalizedModel.replace(/\\[1m]$/i, '').trim()\n : normalizedModel\n\n if (isModelAlias(modelString)) {\n switch (modelString) {\n case 'opusplan':\n return getDefaultSonnetModel() + (has1mTag ? '[1m]' : '') // Sonnet is default, Opus in plan mode\n case 'sonnet':\n return getDefaultSonnetModel() + (has1mTag ? '[1m]' : '')\n case 'haiku':\n return getDefaultHaikuModel() + (has1mTag ? '[1m]' : '')\n case 'opus':\n return getDefaultOpusModel() + (has1mTag ? '[1m]' : '')\n case 'best':\n return getBestModel()\n default:\n }\n }\n\n // Opus 4/4.1 are no longer available on the first-party API (same as\n // Claude.ai) — silently remap to the current Opus default. The 'opus'\n // alias already resolves to 4.6, so the only users on these explicit\n // strings pinned them in settings/env/--model/SDK before 4.5 launched.\n // 3P providers may not yet have 4.6 capacity, so pass through unchanged.\n if (\n getAPIProvider() === 'firstParty' &&\n isLegacyOpusFirstParty(modelString) &&\n isLegacyModelRemapEnabled()\n ) {\n return getDefaultOpusModel() + (has1mTag ? '[1m]' : '')\n }\n\n if (process.env.USER_TYPE === 'ant') {\n const has1mAntTag = has1mContext(normalizedModel)\n const baseAntModel = normalizedModel.replace(/\\[1m]$/i, '').trim()\n\n const antModel = resolveAntModel(baseAntModel)\n if (antModel) {\n const suffix = has1mAntTag ? '[1m]' : ''\n return antModel.model + suffix\n }\n\n // Fall through to the alias string if we cannot load the config. The API calls\n // will fail with this string, but we should hear about it through feedback and\n // can tell the user to restart/wait for flag cache refresh to get the latest values.\n }\n\n // Preserve original case for custom model names (e.g., Azure Foundry deployment IDs)\n // Only strip [1m] suffix if present, maintaining case of the base model\n if (has1mTag) {\n return modelInputTrimmed.replace(/\\[1m\\]$/i, '').trim() + '[1m]'\n }\n return modelInputTrimmed\n}\n\n/**\n * Resolves a skill's `model:` frontmatter against the current model, carrying\n * the `[1m]` suffix over when the target family supports it.\n *\n * A skill author writing `model: opus` means \"use opus-class reasoning\" — not\n * \"downgrade to 200K\". If the user is on opus[1m] at 230K tokens and invokes a\n * skill with `model: opus`, passing the bare alias through drops the effective\n * context window from 1M to 200K, which trips autocompact at 23% apparent usage\n * and surfaces \"Context limit reached\" even though nothing overflowed.\n *\n * We only carry [1m] when the target actually supports it (sonnet/opus). A skill\n * with `model: haiku` on a 1M session still downgrades — haiku has no 1M variant,\n * so the autocompact that follows is correct. Skills that already specify [1m]\n * are left untouched.\n */\nexport function resolveSkillModelOverride(\n skillModel: string,\n currentModel: string,\n): string {\n if (has1mContext(skillModel) || !has1mContext(currentModel)) {\n return skillModel\n }\n // modelSupports1M matches on canonical IDs ('claude-opus-4-6', 'claude-sonnet-4');\n // a bare 'opus' alias falls through getCanonicalName unmatched. Resolve first.\n if (modelSupports1M(parseUserSpecifiedModel(skillModel))) {\n return skillModel + '[1m]'\n }\n return skillModel\n}\n\nconst LEGACY_OPUS_FIRSTPARTY = [\n 'claude-opus-4-20250514',\n 'claude-opus-4-1-20250805',\n 'claude-opus-4-0',\n 'claude-opus-4-1',\n]\n\nfunction isLegacyOpusFirstParty(model: string): boolean {\n return LEGACY_OPUS_FIRSTPARTY.includes(model)\n}\n\n/**\n * Opt-out for the legacy Opus 4.0/4.1 → current Opus remap.\n */\nexport function isLegacyModelRemapEnabled(): boolean {\n return !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP)\n}\n\nexport function modelDisplayString(model: ModelSetting): string {\n if (model === null) {\n if (process.env.USER_TYPE === 'ant') {\n return `Default for Ants (${renderDefaultModelSetting(getDefaultMainLoopModelSetting())})`\n } else if (isClaudeAISubscriber()) {\n return `Default (${getClaudeAiUserDefaultModelDescription()})`\n }\n return `Default (${getDefaultMainLoopModel()})`\n }\n const resolvedModel = parseUserSpecifiedModel(model)\n return model === resolvedModel ? resolvedModel : `${model} (${resolvedModel})`\n}\n\n// @[MODEL LAUNCH]: Add a marketing name mapping for the new model below.\nexport function getMarketingNameForModel(modelId: string): string | undefined {\n if (getAPIProvider() === 'foundry') {\n // deployment ID is user-defined in Foundry, so it may have no relation to the actual model\n return undefined\n }\n\n const has1m = modelId.toLowerCase().includes('[1m]')\n const canonical = getCanonicalName(modelId)\n\n if (canonical.includes('claude-opus-4-6')) {\n return has1m ? 'Opus 4.6 (with 1M context)' : 'Opus 4.6'\n }\n if (canonical.includes('claude-opus-4-5')) {\n return 'Opus 4.5'\n }\n if (canonical.includes('claude-opus-4-1')) {\n return 'Opus 4.1'\n }\n if (canonical.includes('claude-opus-4')) {\n return 'Opus 4'\n }\n if (canonical.includes('claude-sonnet-4-6')) {\n return has1m ? 'Sonnet 4.6 (with 1M context)' : 'Sonnet 4.6'\n }\n if (canonical.includes('claude-sonnet-4-5')) {\n return has1m ? 'Sonnet 4.5 (with 1M context)' : 'Sonnet 4.5'\n }\n if (canonical.includes('claude-sonnet-4')) {\n return has1m ? 'Sonnet 4 (with 1M context)' : 'Sonnet 4'\n }\n if (canonical.includes('claude-3-7-sonnet')) {\n return 'Claude 3.7 Sonnet'\n }\n if (canonical.includes('claude-3-5-sonnet')) {\n return 'Claude 3.5 Sonnet'\n }\n if (canonical.includes('claude-haiku-4-5')) {\n return 'Haiku 4.5'\n }\n if (canonical.includes('claude-3-5-haiku')) {\n return 'Claude 3.5 Haiku'\n }\n\n return undefined\n}\n\nexport function normalizeModelStringForAPI(model: string): string {\n return model.replace(/\\[(1|2)m\\]/gi, '')\n}\n", - "function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\")\n throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f)\n throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return kind === \"a\" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;\n}\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f)\n throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\nexport { __classPrivateFieldSet, __classPrivateFieldGet };\n", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\n/**\n * https://stackoverflow.com/a/2117523\n */\nexport let uuid4 = function () {\n const { crypto } = globalThis;\n if (crypto?.randomUUID) {\n uuid4 = crypto.randomUUID.bind(crypto);\n return crypto.randomUUID();\n }\n const u8 = new Uint8Array(1);\n const randomByte = crypto ? () => crypto.getRandomValues(u8)[0] : () => (Math.random() * 0xff) & 0xff;\n return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => (+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16));\n};\n//# sourceMappingURL=uuid.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport function isAbortError(err) {\n return (typeof err === 'object' &&\n err !== null &&\n // Spec-compliant fetch implementations\n (('name' in err && err.name === 'AbortError') ||\n // Expo fetch\n ('message' in err && String(err.message).includes('FetchRequestCanceledException'))));\n}\nexport const castToError = (err) => {\n if (err instanceof Error)\n return err;\n if (typeof err === 'object' && err !== null) {\n try {\n if (Object.prototype.toString.call(err) === '[object Error]') {\n // @ts-ignore - not all envs have native support for cause yet\n const error = new Error(err.message, err.cause ? { cause: err.cause } : {});\n if (err.stack)\n error.stack = err.stack;\n // @ts-ignore - not all envs have native support for cause yet\n if (err.cause && !error.cause)\n error.cause = err.cause;\n if (err.name)\n error.name = err.name;\n return error;\n }\n }\n catch { }\n try {\n return new Error(JSON.stringify(err));\n }\n catch { }\n }\n return new Error(err);\n};\n//# sourceMappingURL=errors.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { castToError } from \"../internal/errors.mjs\";\nexport class AnthropicError extends Error {\n}\nexport class APIError extends AnthropicError {\n constructor(status, error, message, headers) {\n super(`${APIError.makeMessage(status, error, message)}`);\n this.status = status;\n this.headers = headers;\n this.requestID = headers?.get('request-id');\n this.error = error;\n }\n static makeMessage(status, error, message) {\n const msg = error?.message ?\n typeof error.message === 'string' ?\n error.message\n : JSON.stringify(error.message)\n : error ? JSON.stringify(error)\n : message;\n if (status && msg) {\n return `${status} ${msg}`;\n }\n if (status) {\n return `${status} status code (no body)`;\n }\n if (msg) {\n return msg;\n }\n return '(no status code or body)';\n }\n static generate(status, errorResponse, message, headers) {\n if (!status || !headers) {\n return new APIConnectionError({ message, cause: castToError(errorResponse) });\n }\n const error = errorResponse;\n if (status === 400) {\n return new BadRequestError(status, error, message, headers);\n }\n if (status === 401) {\n return new AuthenticationError(status, error, message, headers);\n }\n if (status === 403) {\n return new PermissionDeniedError(status, error, message, headers);\n }\n if (status === 404) {\n return new NotFoundError(status, error, message, headers);\n }\n if (status === 409) {\n return new ConflictError(status, error, message, headers);\n }\n if (status === 422) {\n return new UnprocessableEntityError(status, error, message, headers);\n }\n if (status === 429) {\n return new RateLimitError(status, error, message, headers);\n }\n if (status >= 500) {\n return new InternalServerError(status, error, message, headers);\n }\n return new APIError(status, error, message, headers);\n }\n}\nexport class APIUserAbortError extends APIError {\n constructor({ message } = {}) {\n super(undefined, undefined, message || 'Request was aborted.', undefined);\n }\n}\nexport class APIConnectionError extends APIError {\n constructor({ message, cause }) {\n super(undefined, undefined, message || 'Connection error.', undefined);\n // in some environments the 'cause' property is already declared\n // @ts-ignore\n if (cause)\n this.cause = cause;\n }\n}\nexport class APIConnectionTimeoutError extends APIConnectionError {\n constructor({ message } = {}) {\n super({ message: message ?? 'Request timed out.' });\n }\n}\nexport class BadRequestError extends APIError {\n}\nexport class AuthenticationError extends APIError {\n}\nexport class PermissionDeniedError extends APIError {\n}\nexport class NotFoundError extends APIError {\n}\nexport class ConflictError extends APIError {\n}\nexport class UnprocessableEntityError extends APIError {\n}\nexport class RateLimitError extends APIError {\n}\nexport class InternalServerError extends APIError {\n}\n//# sourceMappingURL=error.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { AnthropicError } from \"../../core/error.mjs\";\n// https://url.spec.whatwg.org/#url-scheme-string\nconst startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;\nexport const isAbsoluteURL = (url) => {\n return startsWithSchemeRegexp.test(url);\n};\n/** Returns an object if the given value isn't an object, otherwise returns as-is */\nexport function maybeObj(x) {\n if (typeof x !== 'object') {\n return {};\n }\n return x ?? {};\n}\n// https://stackoverflow.com/a/34491287\nexport function isEmptyObj(obj) {\n if (!obj)\n return true;\n for (const _k in obj)\n return false;\n return true;\n}\n// https://eslint.org/docs/latest/rules/no-prototype-builtins\nexport function hasOwn(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\nexport function isObj(obj) {\n return obj != null && typeof obj === 'object' && !Array.isArray(obj);\n}\nexport const ensurePresent = (value) => {\n if (value == null) {\n throw new AnthropicError(`Expected a value to be given but received ${value} instead.`);\n }\n return value;\n};\nexport const validatePositiveInteger = (name, n) => {\n if (typeof n !== 'number' || !Number.isInteger(n)) {\n throw new AnthropicError(`${name} must be an integer`);\n }\n if (n < 0) {\n throw new AnthropicError(`${name} must be a positive integer`);\n }\n return n;\n};\nexport const coerceInteger = (value) => {\n if (typeof value === 'number')\n return Math.round(value);\n if (typeof value === 'string')\n return parseInt(value, 10);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceFloat = (value) => {\n if (typeof value === 'number')\n return value;\n if (typeof value === 'string')\n return parseFloat(value);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceBoolean = (value) => {\n if (typeof value === 'boolean')\n return value;\n if (typeof value === 'string')\n return value === 'true';\n return Boolean(value);\n};\nexport const maybeCoerceInteger = (value) => {\n if (value === undefined) {\n return undefined;\n }\n return coerceInteger(value);\n};\nexport const maybeCoerceFloat = (value) => {\n if (value === undefined) {\n return undefined;\n }\n return coerceFloat(value);\n};\nexport const maybeCoerceBoolean = (value) => {\n if (value === undefined) {\n return undefined;\n }\n return coerceBoolean(value);\n};\nexport const safeJSON = (text) => {\n try {\n return JSON.parse(text);\n }\n catch (err) {\n return undefined;\n }\n};\n//# sourceMappingURL=values.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n//# sourceMappingURL=sleep.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { hasOwn } from \"./values.mjs\";\nconst levelNumbers = {\n off: 0,\n error: 200,\n warn: 300,\n info: 400,\n debug: 500,\n};\nexport const parseLogLevel = (maybeLevel, sourceName, client) => {\n if (!maybeLevel) {\n return undefined;\n }\n if (hasOwn(levelNumbers, maybeLevel)) {\n return maybeLevel;\n }\n loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`);\n return undefined;\n};\nfunction noop() { }\nfunction makeLogFn(fnLevel, logger, logLevel) {\n if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {\n return noop;\n }\n else {\n // Don't wrap logger functions, we want the stacktrace intact!\n return logger[fnLevel].bind(logger);\n }\n}\nconst noopLogger = {\n error: noop,\n warn: noop,\n info: noop,\n debug: noop,\n};\nlet cachedLoggers = new WeakMap();\nexport function loggerFor(client) {\n const logger = client.logger;\n const logLevel = client.logLevel ?? 'off';\n if (!logger) {\n return noopLogger;\n }\n const cachedLogger = cachedLoggers.get(logger);\n if (cachedLogger && cachedLogger[0] === logLevel) {\n return cachedLogger[1];\n }\n const levelLogger = {\n error: makeLogFn('error', logger, logLevel),\n warn: makeLogFn('warn', logger, logLevel),\n info: makeLogFn('info', logger, logLevel),\n debug: makeLogFn('debug', logger, logLevel),\n };\n cachedLoggers.set(logger, [logLevel, levelLogger]);\n return levelLogger;\n}\nexport const formatRequestDetails = (details) => {\n if (details.options) {\n details.options = { ...details.options };\n delete details.options['headers']; // redundant + leaks internals\n }\n if (details.headers) {\n details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [\n name,\n (name.toLowerCase() === 'x-api-key' ||\n name.toLowerCase() === 'authorization' ||\n name.toLowerCase() === 'cookie' ||\n name.toLowerCase() === 'set-cookie') ?\n '***'\n : value,\n ]));\n }\n if ('retryOfRequestLogID' in details) {\n if (details.retryOfRequestLogID) {\n details.retryOf = details.retryOfRequestLogID;\n }\n delete details.retryOfRequestLogID;\n }\n return details;\n};\n//# sourceMappingURL=log.mjs.map", - "export const VERSION = '0.52.0'; // x-release-please-version\n//# sourceMappingURL=version.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { VERSION } from \"../version.mjs\";\nexport const isRunningInBrowser = () => {\n return (\n // @ts-ignore\n typeof window !== 'undefined' &&\n // @ts-ignore\n typeof window.document !== 'undefined' &&\n // @ts-ignore\n typeof navigator !== 'undefined');\n};\n/**\n * Note this does not detect 'browser'; for that, use getBrowserInfo().\n */\nfunction getDetectedPlatform() {\n if (typeof Deno !== 'undefined' && Deno.build != null) {\n return 'deno';\n }\n if (typeof EdgeRuntime !== 'undefined') {\n return 'edge';\n }\n if (Object.prototype.toString.call(typeof globalThis.process !== 'undefined' ? globalThis.process : 0) === '[object process]') {\n return 'node';\n }\n return 'unknown';\n}\nconst getPlatformProperties = () => {\n const detectedPlatform = getDetectedPlatform();\n if (detectedPlatform === 'deno') {\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': normalizePlatform(Deno.build.os),\n 'X-Stainless-Arch': normalizeArch(Deno.build.arch),\n 'X-Stainless-Runtime': 'deno',\n 'X-Stainless-Runtime-Version': typeof Deno.version === 'string' ? Deno.version : Deno.version?.deno ?? 'unknown',\n };\n }\n if (typeof EdgeRuntime !== 'undefined') {\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': 'Unknown',\n 'X-Stainless-Arch': `other:${EdgeRuntime}`,\n 'X-Stainless-Runtime': 'edge',\n 'X-Stainless-Runtime-Version': globalThis.process.version,\n };\n }\n // Check if Node.js\n if (detectedPlatform === 'node') {\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': normalizePlatform(globalThis.process.platform),\n 'X-Stainless-Arch': normalizeArch(globalThis.process.arch),\n 'X-Stainless-Runtime': 'node',\n 'X-Stainless-Runtime-Version': globalThis.process.version,\n };\n }\n const browserInfo = getBrowserInfo();\n if (browserInfo) {\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': 'Unknown',\n 'X-Stainless-Arch': 'unknown',\n 'X-Stainless-Runtime': `browser:${browserInfo.browser}`,\n 'X-Stainless-Runtime-Version': browserInfo.version,\n };\n }\n // TODO add support for Cloudflare workers, etc.\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': 'Unknown',\n 'X-Stainless-Arch': 'unknown',\n 'X-Stainless-Runtime': 'unknown',\n 'X-Stainless-Runtime-Version': 'unknown',\n };\n};\n// Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts\nfunction getBrowserInfo() {\n if (typeof navigator === 'undefined' || !navigator) {\n return null;\n }\n // NOTE: The order matters here!\n const browserPatterns = [\n { key: 'edge', pattern: /Edge(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'ie', pattern: /MSIE(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'ie', pattern: /Trident(?:.*rv\\:(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'chrome', pattern: /Chrome(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'firefox', pattern: /Firefox(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'safari', pattern: /(?:Version\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?(?:\\W+Mobile\\S*)?\\W+Safari/ },\n ];\n // Find the FIRST matching browser\n for (const { key, pattern } of browserPatterns) {\n const match = pattern.exec(navigator.userAgent);\n if (match) {\n const major = match[1] || 0;\n const minor = match[2] || 0;\n const patch = match[3] || 0;\n return { browser: key, version: `${major}.${minor}.${patch}` };\n }\n }\n return null;\n}\nconst normalizeArch = (arch) => {\n // Node docs:\n // - https://nodejs.org/api/process.html#processarch\n // Deno docs:\n // - https://doc.deno.land/deno/stable/~/Deno.build\n if (arch === 'x32')\n return 'x32';\n if (arch === 'x86_64' || arch === 'x64')\n return 'x64';\n if (arch === 'arm')\n return 'arm';\n if (arch === 'aarch64' || arch === 'arm64')\n return 'arm64';\n if (arch)\n return `other:${arch}`;\n return 'unknown';\n};\nconst normalizePlatform = (platform) => {\n // Node platforms:\n // - https://nodejs.org/api/process.html#processplatform\n // Deno platforms:\n // - https://doc.deno.land/deno/stable/~/Deno.build\n // - https://github.com/denoland/deno/issues/14799\n platform = platform.toLowerCase();\n // NOTE: this iOS check is untested and may not work\n // Node does not work natively on IOS, there is a fork at\n // https://github.com/nodejs-mobile/nodejs-mobile\n // however it is unknown at the time of writing how to detect if it is running\n if (platform.includes('ios'))\n return 'iOS';\n if (platform === 'android')\n return 'Android';\n if (platform === 'darwin')\n return 'MacOS';\n if (platform === 'win32')\n return 'Windows';\n if (platform === 'freebsd')\n return 'FreeBSD';\n if (platform === 'openbsd')\n return 'OpenBSD';\n if (platform === 'linux')\n return 'Linux';\n if (platform)\n return `Other:${platform}`;\n return 'Unknown';\n};\nlet _platformHeaders;\nexport const getPlatformHeaders = () => {\n return (_platformHeaders ?? (_platformHeaders = getPlatformProperties()));\n};\n//# sourceMappingURL=detect-platform.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport function getDefaultFetch() {\n if (typeof fetch !== 'undefined') {\n return fetch;\n }\n throw new Error('`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`');\n}\nexport function makeReadableStream(...args) {\n const ReadableStream = globalThis.ReadableStream;\n if (typeof ReadableStream === 'undefined') {\n // Note: All of the platforms / runtimes we officially support already define\n // `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.\n throw new Error('`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`');\n }\n return new ReadableStream(...args);\n}\nexport function ReadableStreamFrom(iterable) {\n let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n return makeReadableStream({\n start() { },\n async pull(controller) {\n const { done, value } = await iter.next();\n if (done) {\n controller.close();\n }\n else {\n controller.enqueue(value);\n }\n },\n async cancel() {\n await iter.return?.();\n },\n });\n}\n/**\n * Most browsers don't yet have async iterable support for ReadableStream,\n * and Node has a very different way of reading bytes from its \"ReadableStream\".\n *\n * This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490\n */\nexport function ReadableStreamToAsyncIterable(stream) {\n if (stream[Symbol.asyncIterator])\n return stream;\n const reader = stream.getReader();\n return {\n async next() {\n try {\n const result = await reader.read();\n if (result?.done)\n reader.releaseLock(); // release lock when stream becomes closed\n return result;\n }\n catch (e) {\n reader.releaseLock(); // release lock when stream becomes errored\n throw e;\n }\n },\n async return() {\n const cancelPromise = reader.cancel();\n reader.releaseLock();\n await cancelPromise;\n return { done: true, value: undefined };\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\n/**\n * Cancels a ReadableStream we don't need to consume.\n * See https://undici.nodejs.org/#/?id=garbage-collection\n */\nexport async function CancelReadableStream(stream) {\n if (stream === null || typeof stream !== 'object')\n return;\n if (stream[Symbol.asyncIterator]) {\n await stream[Symbol.asyncIterator]().return?.();\n return;\n }\n const reader = stream.getReader();\n const cancelPromise = reader.cancel();\n reader.releaseLock();\n await cancelPromise;\n}\n//# sourceMappingURL=shims.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport const FallbackEncoder = ({ headers, body }) => {\n return {\n bodyHeaders: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify(body),\n };\n};\n//# sourceMappingURL=request-options.mjs.map", - "export function concatBytes(buffers) {\n let length = 0;\n for (const buffer of buffers) {\n length += buffer.length;\n }\n const output = new Uint8Array(length);\n let index = 0;\n for (const buffer of buffers) {\n output.set(buffer, index);\n index += buffer.length;\n }\n return output;\n}\nlet encodeUTF8_;\nexport function encodeUTF8(str) {\n let encoder;\n return (encodeUTF8_ ??\n ((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);\n}\nlet decodeUTF8_;\nexport function decodeUTF8(bytes) {\n let decoder;\n return (decodeUTF8_ ??\n ((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);\n}\n//# sourceMappingURL=bytes.mjs.map", - "var _LineDecoder_buffer, _LineDecoder_carriageReturnIndex;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../tslib.mjs\";\nimport { concatBytes, decodeUTF8, encodeUTF8 } from \"../utils/bytes.mjs\";\n/**\n * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally\n * reading lines from text.\n *\n * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258\n */\nexport class LineDecoder {\n constructor() {\n _LineDecoder_buffer.set(this, void 0);\n _LineDecoder_carriageReturnIndex.set(this, void 0);\n __classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), \"f\");\n __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, \"f\");\n }\n decode(chunk) {\n if (chunk == null) {\n return [];\n }\n const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)\n : typeof chunk === 'string' ? encodeUTF8(chunk)\n : chunk;\n __classPrivateFieldSet(this, _LineDecoder_buffer, concatBytes([__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\"), binaryChunk]), \"f\");\n const lines = [];\n let patternIndex;\n while ((patternIndex = findNewlineIndex(__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\"), __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\"))) != null) {\n if (patternIndex.carriage && __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") == null) {\n // skip until we either get a corresponding `\\n`, a new `\\r` or nothing\n __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, patternIndex.index, \"f\");\n continue;\n }\n // we got double \\r or \\rtext\\n\n if (__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") != null &&\n (patternIndex.index !== __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") + 1 || patternIndex.carriage)) {\n lines.push(decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").subarray(0, __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") - 1)));\n __classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").subarray(__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\")), \"f\");\n __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, \"f\");\n continue;\n }\n const endIndex = __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") !== null ? patternIndex.preceding - 1 : patternIndex.preceding;\n const line = decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").subarray(0, endIndex));\n lines.push(line);\n __classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").subarray(patternIndex.index), \"f\");\n __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, \"f\");\n }\n return lines;\n }\n flush() {\n if (!__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").length) {\n return [];\n }\n return this.decode('\\n');\n }\n}\n_LineDecoder_buffer = new WeakMap(), _LineDecoder_carriageReturnIndex = new WeakMap();\n// prettier-ignore\nLineDecoder.NEWLINE_CHARS = new Set(['\\n', '\\r']);\nLineDecoder.NEWLINE_REGEXP = /\\r\\n|[\\n\\r]/g;\n/**\n * This function searches the buffer for the end patterns, (\\r or \\n)\n * and returns an object with the index preceding the matched newline and the\n * index after the newline char. `null` is returned if no new line is found.\n *\n * ```ts\n * findNewLineIndex('abc\\ndef') -> { preceding: 2, index: 3 }\n * ```\n */\nfunction findNewlineIndex(buffer, startIndex) {\n const newline = 0x0a; // \\n\n const carriage = 0x0d; // \\r\n for (let i = startIndex ?? 0; i < buffer.length; i++) {\n if (buffer[i] === newline) {\n return { preceding: i, index: i + 1, carriage: false };\n }\n if (buffer[i] === carriage) {\n return { preceding: i, index: i + 1, carriage: true };\n }\n }\n return null;\n}\nexport function findDoubleNewlineIndex(buffer) {\n // This function searches the buffer for the end patterns (\\r\\r, \\n\\n, \\r\\n\\r\\n)\n // and returns the index right after the first occurrence of any pattern,\n // or -1 if none of the patterns are found.\n const newline = 0x0a; // \\n\n const carriage = 0x0d; // \\r\n for (let i = 0; i < buffer.length - 1; i++) {\n if (buffer[i] === newline && buffer[i + 1] === newline) {\n // \\n\\n\n return i + 2;\n }\n if (buffer[i] === carriage && buffer[i + 1] === carriage) {\n // \\r\\r\n return i + 2;\n }\n if (buffer[i] === carriage &&\n buffer[i + 1] === newline &&\n i + 3 < buffer.length &&\n buffer[i + 2] === carriage &&\n buffer[i + 3] === newline) {\n // \\r\\n\\r\\n\n return i + 4;\n }\n }\n return -1;\n}\n//# sourceMappingURL=line.mjs.map", - "import { AnthropicError } from \"./error.mjs\";\nimport { makeReadableStream } from \"../internal/shims.mjs\";\nimport { findDoubleNewlineIndex, LineDecoder } from \"../internal/decoders/line.mjs\";\nimport { ReadableStreamToAsyncIterable } from \"../internal/shims.mjs\";\nimport { isAbortError } from \"../internal/errors.mjs\";\nimport { safeJSON } from \"../internal/utils/values.mjs\";\nimport { encodeUTF8 } from \"../internal/utils/bytes.mjs\";\nimport { APIError } from \"./error.mjs\";\nexport class Stream {\n constructor(iterator, controller) {\n this.iterator = iterator;\n this.controller = controller;\n }\n static fromSSEResponse(response, controller) {\n let consumed = false;\n async function* iterator() {\n if (consumed) {\n throw new AnthropicError('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');\n }\n consumed = true;\n let done = false;\n try {\n for await (const sse of _iterSSEMessages(response, controller)) {\n if (sse.event === 'completion') {\n try {\n yield JSON.parse(sse.data);\n }\n catch (e) {\n console.error(`Could not parse message into JSON:`, sse.data);\n console.error(`From chunk:`, sse.raw);\n throw e;\n }\n }\n if (sse.event === 'message_start' ||\n sse.event === 'message_delta' ||\n sse.event === 'message_stop' ||\n sse.event === 'content_block_start' ||\n sse.event === 'content_block_delta' ||\n sse.event === 'content_block_stop') {\n try {\n yield JSON.parse(sse.data);\n }\n catch (e) {\n console.error(`Could not parse message into JSON:`, sse.data);\n console.error(`From chunk:`, sse.raw);\n throw e;\n }\n }\n if (sse.event === 'ping') {\n continue;\n }\n if (sse.event === 'error') {\n throw new APIError(undefined, safeJSON(sse.data) ?? sse.data, undefined, response.headers);\n }\n }\n done = true;\n }\n catch (e) {\n // If the user calls `stream.controller.abort()`, we should exit without throwing.\n if (isAbortError(e))\n return;\n throw e;\n }\n finally {\n // If the user `break`s, abort the ongoing request.\n if (!done)\n controller.abort();\n }\n }\n return new Stream(iterator, controller);\n }\n /**\n * Generates a Stream from a newline-separated ReadableStream\n * where each item is a JSON value.\n */\n static fromReadableStream(readableStream, controller) {\n let consumed = false;\n async function* iterLines() {\n const lineDecoder = new LineDecoder();\n const iter = ReadableStreamToAsyncIterable(readableStream);\n for await (const chunk of iter) {\n for (const line of lineDecoder.decode(chunk)) {\n yield line;\n }\n }\n for (const line of lineDecoder.flush()) {\n yield line;\n }\n }\n async function* iterator() {\n if (consumed) {\n throw new AnthropicError('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');\n }\n consumed = true;\n let done = false;\n try {\n for await (const line of iterLines()) {\n if (done)\n continue;\n if (line)\n yield JSON.parse(line);\n }\n done = true;\n }\n catch (e) {\n // If the user calls `stream.controller.abort()`, we should exit without throwing.\n if (isAbortError(e))\n return;\n throw e;\n }\n finally {\n // If the user `break`s, abort the ongoing request.\n if (!done)\n controller.abort();\n }\n }\n return new Stream(iterator, controller);\n }\n [Symbol.asyncIterator]() {\n return this.iterator();\n }\n /**\n * Splits the stream into two streams which can be\n * independently read from at different speeds.\n */\n tee() {\n const left = [];\n const right = [];\n const iterator = this.iterator();\n const teeIterator = (queue) => {\n return {\n next: () => {\n if (queue.length === 0) {\n const result = iterator.next();\n left.push(result);\n right.push(result);\n }\n return queue.shift();\n },\n };\n };\n return [\n new Stream(() => teeIterator(left), this.controller),\n new Stream(() => teeIterator(right), this.controller),\n ];\n }\n /**\n * Converts this stream to a newline-separated ReadableStream of\n * JSON stringified values in the stream\n * which can be turned back into a Stream with `Stream.fromReadableStream()`.\n */\n toReadableStream() {\n const self = this;\n let iter;\n return makeReadableStream({\n async start() {\n iter = self[Symbol.asyncIterator]();\n },\n async pull(ctrl) {\n try {\n const { value, done } = await iter.next();\n if (done)\n return ctrl.close();\n const bytes = encodeUTF8(JSON.stringify(value) + '\\n');\n ctrl.enqueue(bytes);\n }\n catch (err) {\n ctrl.error(err);\n }\n },\n async cancel() {\n await iter.return?.();\n },\n });\n }\n}\nexport async function* _iterSSEMessages(response, controller) {\n if (!response.body) {\n controller.abort();\n if (typeof globalThis.navigator !== 'undefined' &&\n globalThis.navigator.product === 'ReactNative') {\n throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`);\n }\n throw new AnthropicError(`Attempted to iterate over a response with no body`);\n }\n const sseDecoder = new SSEDecoder();\n const lineDecoder = new LineDecoder();\n const iter = ReadableStreamToAsyncIterable(response.body);\n for await (const sseChunk of iterSSEChunks(iter)) {\n for (const line of lineDecoder.decode(sseChunk)) {\n const sse = sseDecoder.decode(line);\n if (sse)\n yield sse;\n }\n }\n for (const line of lineDecoder.flush()) {\n const sse = sseDecoder.decode(line);\n if (sse)\n yield sse;\n }\n}\n/**\n * Given an async iterable iterator, iterates over it and yields full\n * SSE chunks, i.e. yields when a double new-line is encountered.\n */\nasync function* iterSSEChunks(iterator) {\n let data = new Uint8Array();\n for await (const chunk of iterator) {\n if (chunk == null) {\n continue;\n }\n const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)\n : typeof chunk === 'string' ? encodeUTF8(chunk)\n : chunk;\n let newData = new Uint8Array(data.length + binaryChunk.length);\n newData.set(data);\n newData.set(binaryChunk, data.length);\n data = newData;\n let patternIndex;\n while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {\n yield data.slice(0, patternIndex);\n data = data.slice(patternIndex);\n }\n }\n if (data.length > 0) {\n yield data;\n }\n}\nclass SSEDecoder {\n constructor() {\n this.event = null;\n this.data = [];\n this.chunks = [];\n }\n decode(line) {\n if (line.endsWith('\\r')) {\n line = line.substring(0, line.length - 1);\n }\n if (!line) {\n // empty line and we didn't previously encounter any messages\n if (!this.event && !this.data.length)\n return null;\n const sse = {\n event: this.event,\n data: this.data.join('\\n'),\n raw: this.chunks,\n };\n this.event = null;\n this.data = [];\n this.chunks = [];\n return sse;\n }\n this.chunks.push(line);\n if (line.startsWith(':')) {\n return null;\n }\n let [fieldname, _, value] = partition(line, ':');\n if (value.startsWith(' ')) {\n value = value.substring(1);\n }\n if (fieldname === 'event') {\n this.event = value;\n }\n else if (fieldname === 'data') {\n this.data.push(value);\n }\n return null;\n }\n}\nfunction partition(str, delimiter) {\n const index = str.indexOf(delimiter);\n if (index !== -1) {\n return [str.substring(0, index), delimiter, str.substring(index + delimiter.length)];\n }\n return [str, '', ''];\n}\n//# sourceMappingURL=streaming.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { Stream } from \"../core/streaming.mjs\";\nimport { formatRequestDetails, loggerFor } from \"./utils/log.mjs\";\nexport async function defaultParseResponse(client, props) {\n const { response, requestLogID, retryOfRequestLogID, startTime } = props;\n const body = await (async () => {\n if (props.options.stream) {\n loggerFor(client).debug('response', response.status, response.url, response.headers, response.body);\n // Note: there is an invariant here that isn't represented in the type system\n // that if you set `stream: true` the response type must also be `Stream`\n if (props.options.__streamClass) {\n return props.options.__streamClass.fromSSEResponse(response, props.controller);\n }\n return Stream.fromSSEResponse(response, props.controller);\n }\n // fetch refuses to read the body when the status code is 204.\n if (response.status === 204) {\n return null;\n }\n if (props.options.__binaryResponse) {\n return response;\n }\n const contentType = response.headers.get('content-type');\n const mediaType = contentType?.split(';')[0]?.trim();\n const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');\n if (isJSON) {\n const json = await response.json();\n return addRequestID(json, response);\n }\n const text = await response.text();\n return text;\n })();\n loggerFor(client).debug(`[${requestLogID}] response parsed`, formatRequestDetails({\n retryOfRequestLogID,\n url: response.url,\n status: response.status,\n body,\n durationMs: Date.now() - startTime,\n }));\n return body;\n}\nexport function addRequestID(value, response) {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n return value;\n }\n return Object.defineProperty(value, '_request_id', {\n value: response.headers.get('request-id'),\n enumerable: false,\n });\n}\n//# sourceMappingURL=parse.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nvar _APIPromise_client;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { defaultParseResponse, addRequestID, } from \"../internal/parse.mjs\";\n/**\n * A subclass of `Promise` providing additional helper methods\n * for interacting with the SDK.\n */\nexport class APIPromise extends Promise {\n constructor(client, responsePromise, parseResponse = defaultParseResponse) {\n super((resolve) => {\n // this is maybe a bit weird but this has to be a no-op to not implicitly\n // parse the response body; instead .then, .catch, .finally are overridden\n // to parse the response\n resolve(null);\n });\n this.responsePromise = responsePromise;\n this.parseResponse = parseResponse;\n _APIPromise_client.set(this, void 0);\n __classPrivateFieldSet(this, _APIPromise_client, client, \"f\");\n }\n _thenUnwrap(transform) {\n return new APIPromise(__classPrivateFieldGet(this, _APIPromise_client, \"f\"), this.responsePromise, async (client, props) => addRequestID(transform(await this.parseResponse(client, props), props), props.response));\n }\n /**\n * Gets the raw `Response` instance instead of parsing the response\n * data.\n *\n * If you want to parse the response body but still get the `Response`\n * instance, you can use {@link withResponse()}.\n *\n * 👋 Getting the wrong TypeScript type for `Response`?\n * Try setting `\"moduleResolution\": \"NodeNext\"` or add `\"lib\": [\"DOM\"]`\n * to your `tsconfig.json`.\n */\n asResponse() {\n return this.responsePromise.then((p) => p.response);\n }\n /**\n * Gets the parsed response data, the raw `Response` instance and the ID of the request,\n * returned via the `request-id` header which is useful for debugging requests and resporting\n * issues to Anthropic.\n *\n * If you just want to get the raw `Response` instance without parsing it,\n * you can use {@link asResponse()}.\n *\n * 👋 Getting the wrong TypeScript type for `Response`?\n * Try setting `\"moduleResolution\": \"NodeNext\"` or add `\"lib\": [\"DOM\"]`\n * to your `tsconfig.json`.\n */\n async withResponse() {\n const [data, response] = await Promise.all([this.parse(), this.asResponse()]);\n return { data, response, request_id: response.headers.get('request-id') };\n }\n parse() {\n if (!this.parsedPromise) {\n this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, \"f\"), data));\n }\n return this.parsedPromise;\n }\n then(onfulfilled, onrejected) {\n return this.parse().then(onfulfilled, onrejected);\n }\n catch(onrejected) {\n return this.parse().catch(onrejected);\n }\n finally(onfinally) {\n return this.parse().finally(onfinally);\n }\n}\n_APIPromise_client = new WeakMap();\n//# sourceMappingURL=api-promise.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nvar _AbstractPage_client;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { AnthropicError } from \"./error.mjs\";\nimport { defaultParseResponse } from \"../internal/parse.mjs\";\nimport { APIPromise } from \"./api-promise.mjs\";\nimport { maybeObj } from \"../internal/utils/values.mjs\";\nexport class AbstractPage {\n constructor(client, response, body, options) {\n _AbstractPage_client.set(this, void 0);\n __classPrivateFieldSet(this, _AbstractPage_client, client, \"f\");\n this.options = options;\n this.response = response;\n this.body = body;\n }\n hasNextPage() {\n const items = this.getPaginatedItems();\n if (!items.length)\n return false;\n return this.nextPageRequestOptions() != null;\n }\n async getNextPage() {\n const nextOptions = this.nextPageRequestOptions();\n if (!nextOptions) {\n throw new AnthropicError('No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.');\n }\n return await __classPrivateFieldGet(this, _AbstractPage_client, \"f\").requestAPIList(this.constructor, nextOptions);\n }\n async *iterPages() {\n let page = this;\n yield page;\n while (page.hasNextPage()) {\n page = await page.getNextPage();\n yield page;\n }\n }\n async *[(_AbstractPage_client = new WeakMap(), Symbol.asyncIterator)]() {\n for await (const page of this.iterPages()) {\n for (const item of page.getPaginatedItems()) {\n yield item;\n }\n }\n }\n}\n/**\n * This subclass of Promise will resolve to an instantiated Page once the request completes.\n *\n * It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:\n *\n * for await (const item of client.items.list()) {\n * console.log(item)\n * }\n */\nexport class PagePromise extends APIPromise {\n constructor(client, request, Page) {\n super(client, request, async (client, props) => new Page(client, props.response, await defaultParseResponse(client, props), props.options));\n }\n /**\n * Allow auto-paginating iteration on an unawaited list call, eg:\n *\n * for await (const item of client.items.list()) {\n * console.log(item)\n * }\n */\n async *[Symbol.asyncIterator]() {\n const page = await this;\n for await (const item of page) {\n yield item;\n }\n }\n}\nexport class Page extends AbstractPage {\n constructor(client, response, body, options) {\n super(client, response, body, options);\n this.data = body.data || [];\n this.has_more = body.has_more || false;\n this.first_id = body.first_id || null;\n this.last_id = body.last_id || null;\n }\n getPaginatedItems() {\n return this.data ?? [];\n }\n hasNextPage() {\n if (this.has_more === false) {\n return false;\n }\n return super.hasNextPage();\n }\n nextPageRequestOptions() {\n if (this.options.query?.['before_id']) {\n // in reverse\n const first_id = this.first_id;\n if (!first_id) {\n return null;\n }\n return {\n ...this.options,\n query: {\n ...maybeObj(this.options.query),\n before_id: first_id,\n },\n };\n }\n const cursor = this.last_id;\n if (!cursor) {\n return null;\n }\n return {\n ...this.options,\n query: {\n ...maybeObj(this.options.query),\n after_id: cursor,\n },\n };\n }\n}\n//# sourceMappingURL=pagination.mjs.map", - "import { ReadableStreamFrom } from \"./shims.mjs\";\nexport const checkFileSupport = () => {\n if (typeof File === 'undefined') {\n const { process } = globalThis;\n const isOldNode = typeof process?.versions?.node === 'string' && parseInt(process.versions.node.split('.')) < 20;\n throw new Error('`File` is not defined as a global, which is required for file uploads.' +\n (isOldNode ?\n \" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.\"\n : ''));\n }\n};\n/**\n * Construct a `File` instance. This is used to ensure a helpful error is thrown\n * for environments that don't define a global `File` yet.\n */\nexport function makeFile(fileBits, fileName, options) {\n checkFileSupport();\n return new File(fileBits, fileName ?? 'unknown_file', options);\n}\nexport function getName(value) {\n return (((typeof value === 'object' &&\n value !== null &&\n (('name' in value && value.name && String(value.name)) ||\n ('url' in value && value.url && String(value.url)) ||\n ('filename' in value && value.filename && String(value.filename)) ||\n ('path' in value && value.path && String(value.path)))) ||\n '')\n .split(/[\\\\/]/)\n .pop() || undefined);\n}\nexport const isAsyncIterable = (value) => value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';\n/**\n * Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.\n * Otherwise returns the request as is.\n */\nexport const maybeMultipartFormRequestOptions = async (opts, fetch) => {\n if (!hasUploadableValue(opts.body))\n return opts;\n return { ...opts, body: await createForm(opts.body, fetch) };\n};\nexport const multipartFormRequestOptions = async (opts, fetch) => {\n return { ...opts, body: await createForm(opts.body, fetch) };\n};\nconst supportsFormDataMap = new WeakMap();\n/**\n * node-fetch doesn't support the global FormData object in recent node versions. Instead of sending\n * properly-encoded form data, it just stringifies the object, resulting in a request body of \"[object FormData]\".\n * This function detects if the fetch function provided supports the global FormData object to avoid\n * confusing error messages later on.\n */\nfunction supportsFormData(fetchObject) {\n const fetch = typeof fetchObject === 'function' ? fetchObject : fetchObject.fetch;\n const cached = supportsFormDataMap.get(fetch);\n if (cached)\n return cached;\n const promise = (async () => {\n try {\n const FetchResponse = ('Response' in fetch ?\n fetch.Response\n : (await fetch('data:,')).constructor);\n const data = new FormData();\n if (data.toString() === (await new FetchResponse(data).text())) {\n return false;\n }\n return true;\n }\n catch {\n // avoid false negatives\n return true;\n }\n })();\n supportsFormDataMap.set(fetch, promise);\n return promise;\n}\nexport const createForm = async (body, fetch) => {\n if (!(await supportsFormData(fetch))) {\n throw new TypeError('The provided fetch function does not support file uploads with the current global FormData class.');\n }\n const form = new FormData();\n await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value)));\n return form;\n};\n// We check for Blob not File because Bun.File doesn't inherit from File,\n// but they both inherit from Blob and have a `name` property at runtime.\nconst isNamedBlob = (value) => value instanceof Blob && 'name' in value;\nconst isUploadable = (value) => typeof value === 'object' &&\n value !== null &&\n (value instanceof Response || isAsyncIterable(value) || isNamedBlob(value));\nconst hasUploadableValue = (value) => {\n if (isUploadable(value))\n return true;\n if (Array.isArray(value))\n return value.some(hasUploadableValue);\n if (value && typeof value === 'object') {\n for (const k in value) {\n if (hasUploadableValue(value[k]))\n return true;\n }\n }\n return false;\n};\nconst addFormValue = async (form, key, value) => {\n if (value === undefined)\n return;\n if (value == null) {\n throw new TypeError(`Received null for \"${key}\"; to pass null in FormData, you must use the string 'null'`);\n }\n // TODO: make nested formats configurable\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n form.append(key, String(value));\n }\n else if (value instanceof Response) {\n let options = {};\n const contentType = value.headers.get('Content-Type');\n if (contentType) {\n options = { type: contentType };\n }\n form.append(key, makeFile([await value.blob()], getName(value), options));\n }\n else if (isAsyncIterable(value)) {\n form.append(key, makeFile([await new Response(ReadableStreamFrom(value)).blob()], getName(value)));\n }\n else if (isNamedBlob(value)) {\n form.append(key, makeFile([value], getName(value), { type: value.type }));\n }\n else if (Array.isArray(value)) {\n await Promise.all(value.map((entry) => addFormValue(form, key + '[]', entry)));\n }\n else if (typeof value === 'object') {\n await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop)));\n }\n else {\n throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`);\n }\n};\n//# sourceMappingURL=uploads.mjs.map", - "import { getName, makeFile, isAsyncIterable } from \"./uploads.mjs\";\nimport { checkFileSupport } from \"./uploads.mjs\";\n/**\n * This check adds the arrayBuffer() method type because it is available and used at runtime\n */\nconst isBlobLike = (value) => value != null &&\n typeof value === 'object' &&\n typeof value.size === 'number' &&\n typeof value.type === 'string' &&\n typeof value.text === 'function' &&\n typeof value.slice === 'function' &&\n typeof value.arrayBuffer === 'function';\n/**\n * This check adds the arrayBuffer() method type because it is available and used at runtime\n */\nconst isFileLike = (value) => value != null &&\n typeof value === 'object' &&\n typeof value.name === 'string' &&\n typeof value.lastModified === 'number' &&\n isBlobLike(value);\nconst isResponseLike = (value) => value != null &&\n typeof value === 'object' &&\n typeof value.url === 'string' &&\n typeof value.blob === 'function';\n/**\n * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats\n * @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s\n * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible\n * @param {Object=} options additional properties\n * @param {string=} options.type the MIME type of the content\n * @param {number=} options.lastModified the last modified timestamp\n * @returns a {@link File} with the given properties\n */\nexport async function toFile(value, name, options) {\n checkFileSupport();\n // If it's a promise, resolve it.\n value = await value;\n name || (name = getName(value));\n // If we've been given a `File` we don't need to do anything if the name / options\n // have not been customised.\n if (isFileLike(value)) {\n if (value instanceof File && name == null && options == null) {\n return value;\n }\n return makeFile([await value.arrayBuffer()], name ?? value.name, {\n type: value.type,\n lastModified: value.lastModified,\n ...options,\n });\n }\n if (isResponseLike(value)) {\n const blob = await value.blob();\n name || (name = new URL(value.url).pathname.split(/[\\\\/]/).pop());\n return makeFile(await getBytes(blob), name, options);\n }\n const parts = await getBytes(value);\n if (!options?.type) {\n const type = parts.find((part) => typeof part === 'object' && 'type' in part && part.type);\n if (typeof type === 'string') {\n options = { ...options, type };\n }\n }\n return makeFile(parts, name, options);\n}\nasync function getBytes(value) {\n let parts = [];\n if (typeof value === 'string' ||\n ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.\n value instanceof ArrayBuffer) {\n parts.push(value);\n }\n else if (isBlobLike(value)) {\n parts.push(value instanceof Blob ? value : await value.arrayBuffer());\n }\n else if (isAsyncIterable(value) // includes Readable, ReadableStream, etc.\n ) {\n for await (const chunk of value) {\n parts.push(...(await getBytes(chunk))); // TODO, consider validating?\n }\n }\n else {\n const constructor = value?.constructor?.name;\n throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ''}${propsForError(value)}`);\n }\n return parts;\n}\nfunction propsForError(value) {\n if (typeof value !== 'object' || value === null)\n return '';\n const props = Object.getOwnPropertyNames(value);\n return `; props: [${props.map((p) => `\"${p}\"`).join(', ')}]`;\n}\n//# sourceMappingURL=to-file.mjs.map", - "export { toFile } from \"../internal/to-file.mjs\";\n//# sourceMappingURL=uploads.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport class APIResource {\n constructor(client) {\n this._client = client;\n }\n}\n//# sourceMappingURL=resource.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nconst brand_privateNullableHeaders = Symbol.for('brand.privateNullableHeaders');\nconst isArray = Array.isArray;\nfunction* iterateHeaders(headers) {\n if (!headers)\n return;\n if (brand_privateNullableHeaders in headers) {\n const { values, nulls } = headers;\n yield* values.entries();\n for (const name of nulls) {\n yield [name, null];\n }\n return;\n }\n let shouldClear = false;\n let iter;\n if (headers instanceof Headers) {\n iter = headers.entries();\n }\n else if (isArray(headers)) {\n iter = headers;\n }\n else {\n shouldClear = true;\n iter = Object.entries(headers ?? {});\n }\n for (let row of iter) {\n const name = row[0];\n if (typeof name !== 'string')\n throw new TypeError('expected header name to be a string');\n const values = isArray(row[1]) ? row[1] : [row[1]];\n let didClear = false;\n for (const value of values) {\n if (value === undefined)\n continue;\n // Objects keys always overwrite older headers, they never append.\n // Yield a null to clear the header before adding the new values.\n if (shouldClear && !didClear) {\n didClear = true;\n yield [name, null];\n }\n yield [name, value];\n }\n }\n}\nexport const buildHeaders = (newHeaders) => {\n const targetHeaders = new Headers();\n const nullHeaders = new Set();\n for (const headers of newHeaders) {\n const seenHeaders = new Set();\n for (const [name, value] of iterateHeaders(headers)) {\n const lowerName = name.toLowerCase();\n if (!seenHeaders.has(lowerName)) {\n targetHeaders.delete(name);\n seenHeaders.add(lowerName);\n }\n if (value === null) {\n targetHeaders.delete(name);\n nullHeaders.add(lowerName);\n }\n else {\n targetHeaders.append(name, value);\n nullHeaders.delete(lowerName);\n }\n }\n }\n return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };\n};\nexport const isEmptyHeaders = (headers) => {\n for (const _ of iterateHeaders(headers))\n return false;\n return true;\n};\n//# sourceMappingURL=headers.mjs.map", - "import { AnthropicError } from \"../../core/error.mjs\";\n/**\n * Percent-encode everything that isn't safe to have in a path without encoding safe chars.\n *\n * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:\n * > unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * > sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\" / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n * > pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n */\nexport function encodeURIPath(str) {\n return str.replace(/[^A-Za-z0-9\\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);\n}\nexport const createPathTagFunction = (pathEncoder = encodeURIPath) => function path(statics, ...params) {\n // If there are no params, no processing is needed.\n if (statics.length === 1)\n return statics[0];\n let postPath = false;\n const path = statics.reduce((previousValue, currentValue, index) => {\n if (/[?#]/.test(currentValue)) {\n postPath = true;\n }\n return (previousValue +\n currentValue +\n (index === params.length ? '' : (postPath ? encodeURIComponent : pathEncoder)(String(params[index]))));\n }, '');\n const pathOnly = path.split(/[?#]/, 1)[0];\n const invalidSegments = [];\n const invalidSegmentPattern = /(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)/gi;\n let match;\n // Find all invalid segments\n while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {\n invalidSegments.push({\n start: match.index,\n length: match[0].length,\n });\n }\n if (invalidSegments.length > 0) {\n let lastEnd = 0;\n const underline = invalidSegments.reduce((acc, segment) => {\n const spaces = ' '.repeat(segment.start - lastEnd);\n const arrows = '^'.repeat(segment.length);\n lastEnd = segment.start + segment.length;\n return acc + spaces + arrows;\n }, '');\n throw new AnthropicError(`Path parameters result in path with invalid segments:\\n${path}\\n${underline}`);\n }\n return path;\n};\n/**\n * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.\n */\nexport const path = createPathTagFunction(encodeURIPath);\n//# sourceMappingURL=path.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { Page } from \"../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { multipartFormRequestOptions } from \"../../internal/uploads.mjs\";\nimport { path } from \"../../internal/utils/path.mjs\";\nexport class Files extends APIResource {\n /**\n * List Files\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const fileMetadata of client.beta.files.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/files', (Page), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete File\n *\n * @example\n * ```ts\n * const deletedFile = await client.beta.files.delete(\n * 'file_id',\n * );\n * ```\n */\n delete(fileID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/files/${fileID}`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Download File\n *\n * @example\n * ```ts\n * const response = await client.beta.files.download(\n * 'file_id',\n * );\n *\n * const content = await response.blob();\n * console.log(content);\n * ```\n */\n download(fileID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/files/${fileID}/content`, {\n ...options,\n headers: buildHeaders([\n {\n 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString(),\n Accept: 'application/binary',\n },\n options?.headers,\n ]),\n __binaryResponse: true,\n });\n }\n /**\n * Get File Metadata\n *\n * @example\n * ```ts\n * const fileMetadata =\n * await client.beta.files.retrieveMetadata('file_id');\n * ```\n */\n retrieveMetadata(fileID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/files/${fileID}`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Upload File\n *\n * @example\n * ```ts\n * const fileMetadata = await client.beta.files.upload({\n * file: fs.createReadStream('path/to/file'),\n * });\n * ```\n */\n upload(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/files', multipartFormRequestOptions({\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },\n options?.headers,\n ]),\n }, this._client));\n }\n}\n//# sourceMappingURL=files.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { Page } from \"../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { path } from \"../../internal/utils/path.mjs\";\nexport class Models extends APIResource {\n /**\n * Get a specific model.\n *\n * The Models API response can be used to determine information about a specific\n * model or resolve a model alias to a model ID.\n *\n * @example\n * ```ts\n * const betaModelInfo = await client.beta.models.retrieve(\n * 'model_id',\n * );\n * ```\n */\n retrieve(modelID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/models/${modelID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n });\n }\n /**\n * List available models.\n *\n * The Models API response can be used to determine which models are available for\n * use in the API. More recently released models are listed first.\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaModelInfo of client.beta.models.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/models?beta=true', (Page), {\n query,\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=models.mjs.map", - "import { AnthropicError } from \"../../core/error.mjs\";\nimport { ReadableStreamToAsyncIterable } from \"../shims.mjs\";\nimport { LineDecoder } from \"./line.mjs\";\nexport class JSONLDecoder {\n constructor(iterator, controller) {\n this.iterator = iterator;\n this.controller = controller;\n }\n async *decoder() {\n const lineDecoder = new LineDecoder();\n for await (const chunk of this.iterator) {\n for (const line of lineDecoder.decode(chunk)) {\n yield JSON.parse(line);\n }\n }\n for (const line of lineDecoder.flush()) {\n yield JSON.parse(line);\n }\n }\n [Symbol.asyncIterator]() {\n return this.decoder();\n }\n static fromResponse(response, controller) {\n if (!response.body) {\n controller.abort();\n if (typeof globalThis.navigator !== 'undefined' &&\n globalThis.navigator.product === 'ReactNative') {\n throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`);\n }\n throw new AnthropicError(`Attempted to iterate over a response with no body`);\n }\n return new JSONLDecoder(ReadableStreamToAsyncIterable(response.body), controller);\n }\n}\n//# sourceMappingURL=jsonl.mjs.map", - "export * from \"./core/error.mjs\";\n//# sourceMappingURL=error.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { Page } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { JSONLDecoder } from \"../../../internal/decoders/jsonl.mjs\";\nimport { AnthropicError } from \"../../../error.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Batches extends APIResource {\n /**\n * Send a batch of Message creation requests.\n *\n * The Message Batches API can be used to process multiple Messages API requests at\n * once. Once a Message Batch is created, it begins processing immediately. Batches\n * can take up to 24 hours to complete.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaMessageBatch =\n * await client.beta.messages.batches.create({\n * requests: [\n * {\n * custom_id: 'my-custom-id-1',\n * params: {\n * max_tokens: 1024,\n * messages: [\n * { content: 'Hello, world', role: 'user' },\n * ],\n * model: 'claude-3-7-sonnet-20250219',\n * },\n * },\n * ],\n * });\n * ```\n */\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/messages/batches?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * This endpoint is idempotent and can be used to poll for Message Batch\n * completion. To access the results of a Message Batch, make a request to the\n * `results_url` field in the response.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaMessageBatch =\n * await client.beta.messages.batches.retrieve(\n * 'message_batch_id',\n * );\n * ```\n */\n retrieve(messageBatchID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/messages/batches/${messageBatchID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List all Message Batches within a Workspace. Most recently created batches are\n * returned first.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaMessageBatch of client.beta.messages.batches.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/messages/batches?beta=true', (Page), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete a Message Batch.\n *\n * Message Batches can only be deleted once they've finished processing. If you'd\n * like to delete an in-progress batch, you must first cancel it.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaDeletedMessageBatch =\n * await client.beta.messages.batches.delete(\n * 'message_batch_id',\n * );\n * ```\n */\n delete(messageBatchID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/messages/batches/${messageBatchID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Batches may be canceled any time before processing ends. Once cancellation is\n * initiated, the batch enters a `canceling` state, at which time the system may\n * complete any in-progress, non-interruptible requests before finalizing\n * cancellation.\n *\n * The number of canceled requests is specified in `request_counts`. To determine\n * which requests were canceled, check the individual results within the batch.\n * Note that cancellation may not result in any canceled requests if they were\n * non-interruptible.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaMessageBatch =\n * await client.beta.messages.batches.cancel(\n * 'message_batch_id',\n * );\n * ```\n */\n cancel(messageBatchID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.post(path `/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Streams the results of a Message Batch as a `.jsonl` file.\n *\n * Each line in the file is a JSON object containing the result of a single request\n * in the Message Batch. Results are not guaranteed to be in the same order as\n * requests. Use the `custom_id` field to match results to requests.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaMessageBatchIndividualResponse =\n * await client.beta.messages.batches.results(\n * 'message_batch_id',\n * );\n * ```\n */\n async results(messageBatchID, params = {}, options) {\n const batch = await this.retrieve(messageBatchID);\n if (!batch.results_url) {\n throw new AnthropicError(`No batch \\`results_url\\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);\n }\n const { betas } = params ?? {};\n return this._client\n .get(batch.results_url, {\n ...options,\n headers: buildHeaders([\n {\n 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),\n Accept: 'application/binary',\n },\n options?.headers,\n ]),\n stream: true,\n __binaryResponse: true,\n })\n ._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));\n }\n}\n//# sourceMappingURL=batches.mjs.map", - "export * from \"./core/streaming.mjs\";\n//# sourceMappingURL=streaming.mjs.map", - "const tokenize = (input) => {\n let current = 0;\n let tokens = [];\n while (current < input.length) {\n let char = input[current];\n if (char === '\\\\') {\n current++;\n continue;\n }\n if (char === '{') {\n tokens.push({\n type: 'brace',\n value: '{',\n });\n current++;\n continue;\n }\n if (char === '}') {\n tokens.push({\n type: 'brace',\n value: '}',\n });\n current++;\n continue;\n }\n if (char === '[') {\n tokens.push({\n type: 'paren',\n value: '[',\n });\n current++;\n continue;\n }\n if (char === ']') {\n tokens.push({\n type: 'paren',\n value: ']',\n });\n current++;\n continue;\n }\n if (char === ':') {\n tokens.push({\n type: 'separator',\n value: ':',\n });\n current++;\n continue;\n }\n if (char === ',') {\n tokens.push({\n type: 'delimiter',\n value: ',',\n });\n current++;\n continue;\n }\n if (char === '\"') {\n let value = '';\n let danglingQuote = false;\n char = input[++current];\n while (char !== '\"') {\n if (current === input.length) {\n danglingQuote = true;\n break;\n }\n if (char === '\\\\') {\n current++;\n if (current === input.length) {\n danglingQuote = true;\n break;\n }\n value += char + input[current];\n char = input[++current];\n }\n else {\n value += char;\n char = input[++current];\n }\n }\n char = input[++current];\n if (!danglingQuote) {\n tokens.push({\n type: 'string',\n value,\n });\n }\n continue;\n }\n let WHITESPACE = /\\s/;\n if (char && WHITESPACE.test(char)) {\n current++;\n continue;\n }\n let NUMBERS = /[0-9]/;\n if ((char && NUMBERS.test(char)) || char === '-' || char === '.') {\n let value = '';\n if (char === '-') {\n value += char;\n char = input[++current];\n }\n while ((char && NUMBERS.test(char)) || char === '.') {\n value += char;\n char = input[++current];\n }\n tokens.push({\n type: 'number',\n value,\n });\n continue;\n }\n let LETTERS = /[a-z]/i;\n if (char && LETTERS.test(char)) {\n let value = '';\n while (char && LETTERS.test(char)) {\n if (current === input.length) {\n break;\n }\n value += char;\n char = input[++current];\n }\n if (value == 'true' || value == 'false' || value === 'null') {\n tokens.push({\n type: 'name',\n value,\n });\n }\n else {\n // unknown token, e.g. `nul` which isn't quite `null`\n current++;\n continue;\n }\n continue;\n }\n current++;\n }\n return tokens;\n}, strip = (tokens) => {\n if (tokens.length === 0) {\n return tokens;\n }\n let lastToken = tokens[tokens.length - 1];\n switch (lastToken.type) {\n case 'separator':\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n break;\n case 'number':\n let lastCharacterOfLastToken = lastToken.value[lastToken.value.length - 1];\n if (lastCharacterOfLastToken === '.' || lastCharacterOfLastToken === '-') {\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n }\n case 'string':\n let tokenBeforeTheLastToken = tokens[tokens.length - 2];\n if (tokenBeforeTheLastToken?.type === 'delimiter') {\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n }\n else if (tokenBeforeTheLastToken?.type === 'brace' && tokenBeforeTheLastToken.value === '{') {\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n }\n break;\n case 'delimiter':\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n break;\n }\n return tokens;\n}, unstrip = (tokens) => {\n let tail = [];\n tokens.map((token) => {\n if (token.type === 'brace') {\n if (token.value === '{') {\n tail.push('}');\n }\n else {\n tail.splice(tail.lastIndexOf('}'), 1);\n }\n }\n if (token.type === 'paren') {\n if (token.value === '[') {\n tail.push(']');\n }\n else {\n tail.splice(tail.lastIndexOf(']'), 1);\n }\n }\n });\n if (tail.length > 0) {\n tail.reverse().map((item) => {\n if (item === '}') {\n tokens.push({\n type: 'brace',\n value: '}',\n });\n }\n else if (item === ']') {\n tokens.push({\n type: 'paren',\n value: ']',\n });\n }\n });\n }\n return tokens;\n}, generate = (tokens) => {\n let output = '';\n tokens.map((token) => {\n switch (token.type) {\n case 'string':\n output += '\"' + token.value + '\"';\n break;\n default:\n output += token.value;\n break;\n }\n });\n return output;\n}, partialParse = (input) => JSON.parse(generate(unstrip(strip(tokenize(input)))));\nexport { partialParse };\n//# sourceMappingURL=parser.mjs.map", - "var _BetaMessageStream_instances, _BetaMessageStream_currentMessageSnapshot, _BetaMessageStream_connectedPromise, _BetaMessageStream_resolveConnectedPromise, _BetaMessageStream_rejectConnectedPromise, _BetaMessageStream_endPromise, _BetaMessageStream_resolveEndPromise, _BetaMessageStream_rejectEndPromise, _BetaMessageStream_listeners, _BetaMessageStream_ended, _BetaMessageStream_errored, _BetaMessageStream_aborted, _BetaMessageStream_catchingPromiseCreated, _BetaMessageStream_response, _BetaMessageStream_request_id, _BetaMessageStream_getFinalMessage, _BetaMessageStream_getFinalText, _BetaMessageStream_handleError, _BetaMessageStream_beginRequest, _BetaMessageStream_addStreamEvent, _BetaMessageStream_endRequest, _BetaMessageStream_accumulateMessage;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { isAbortError } from \"../internal/errors.mjs\";\nimport { AnthropicError, APIUserAbortError } from \"../error.mjs\";\nimport { Stream } from \"../streaming.mjs\";\nimport { partialParse } from \"../_vendor/partial-json-parser/parser.mjs\";\nconst JSON_BUF_PROPERTY = '__json_buf';\nexport class BetaMessageStream {\n constructor() {\n _BetaMessageStream_instances.add(this);\n this.messages = [];\n this.receivedMessages = [];\n _BetaMessageStream_currentMessageSnapshot.set(this, void 0);\n this.controller = new AbortController();\n _BetaMessageStream_connectedPromise.set(this, void 0);\n _BetaMessageStream_resolveConnectedPromise.set(this, () => { });\n _BetaMessageStream_rejectConnectedPromise.set(this, () => { });\n _BetaMessageStream_endPromise.set(this, void 0);\n _BetaMessageStream_resolveEndPromise.set(this, () => { });\n _BetaMessageStream_rejectEndPromise.set(this, () => { });\n _BetaMessageStream_listeners.set(this, {});\n _BetaMessageStream_ended.set(this, false);\n _BetaMessageStream_errored.set(this, false);\n _BetaMessageStream_aborted.set(this, false);\n _BetaMessageStream_catchingPromiseCreated.set(this, false);\n _BetaMessageStream_response.set(this, void 0);\n _BetaMessageStream_request_id.set(this, void 0);\n _BetaMessageStream_handleError.set(this, (error) => {\n __classPrivateFieldSet(this, _BetaMessageStream_errored, true, \"f\");\n if (isAbortError(error)) {\n error = new APIUserAbortError();\n }\n if (error instanceof APIUserAbortError) {\n __classPrivateFieldSet(this, _BetaMessageStream_aborted, true, \"f\");\n return this._emit('abort', error);\n }\n if (error instanceof AnthropicError) {\n return this._emit('error', error);\n }\n if (error instanceof Error) {\n const anthropicError = new AnthropicError(error.message);\n // @ts-ignore\n anthropicError.cause = error;\n return this._emit('error', anthropicError);\n }\n return this._emit('error', new AnthropicError(String(error)));\n });\n __classPrivateFieldSet(this, _BetaMessageStream_connectedPromise, new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _BetaMessageStream_resolveConnectedPromise, resolve, \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_rejectConnectedPromise, reject, \"f\");\n }), \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_endPromise, new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _BetaMessageStream_resolveEndPromise, resolve, \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_rejectEndPromise, reject, \"f\");\n }), \"f\");\n // Don't let these promises cause unhandled rejection errors.\n // we will manually cause an unhandled rejection error later\n // if the user hasn't registered any error listener or called\n // any promise-returning method.\n __classPrivateFieldGet(this, _BetaMessageStream_connectedPromise, \"f\").catch(() => { });\n __classPrivateFieldGet(this, _BetaMessageStream_endPromise, \"f\").catch(() => { });\n }\n get response() {\n return __classPrivateFieldGet(this, _BetaMessageStream_response, \"f\");\n }\n get request_id() {\n return __classPrivateFieldGet(this, _BetaMessageStream_request_id, \"f\");\n }\n /**\n * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request,\n * returned vie the `request-id` header which is useful for debugging requests and resporting\n * issues to Anthropic.\n *\n * This is the same as the `APIPromise.withResponse()` method.\n *\n * This method will raise an error if you created the stream using `MessageStream.fromReadableStream`\n * as no `Response` is available.\n */\n async withResponse() {\n const response = await __classPrivateFieldGet(this, _BetaMessageStream_connectedPromise, \"f\");\n if (!response) {\n throw new Error('Could not resolve a `Response` object');\n }\n return {\n data: this,\n response,\n request_id: response.headers.get('request-id'),\n };\n }\n /**\n * Intended for use on the frontend, consuming a stream produced with\n * `.toReadableStream()` on the backend.\n *\n * Note that messages sent to the model do not appear in `.on('message')`\n * in this context.\n */\n static fromReadableStream(stream) {\n const runner = new BetaMessageStream();\n runner._run(() => runner._fromReadableStream(stream));\n return runner;\n }\n static createMessage(messages, params, options) {\n const runner = new BetaMessageStream();\n for (const message of params.messages) {\n runner._addMessageParam(message);\n }\n runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'stream' } }));\n return runner;\n }\n _run(executor) {\n executor().then(() => {\n this._emitFinal();\n this._emit('end');\n }, __classPrivateFieldGet(this, _BetaMessageStream_handleError, \"f\"));\n }\n _addMessageParam(message) {\n this.messages.push(message);\n }\n _addMessage(message, emit = true) {\n this.receivedMessages.push(message);\n if (emit) {\n this._emit('message', message);\n }\n }\n async _createMessage(messages, params, options) {\n const signal = options?.signal;\n if (signal) {\n if (signal.aborted)\n this.controller.abort();\n signal.addEventListener('abort', () => this.controller.abort());\n }\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_beginRequest).call(this);\n const { response, data: stream } = await messages\n .create({ ...params, stream: true }, { ...options, signal: this.controller.signal })\n .withResponse();\n this._connected(response);\n for await (const event of stream) {\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_addStreamEvent).call(this, event);\n }\n if (stream.controller.signal?.aborted) {\n throw new APIUserAbortError();\n }\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_endRequest).call(this);\n }\n _connected(response) {\n if (this.ended)\n return;\n __classPrivateFieldSet(this, _BetaMessageStream_response, response, \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_request_id, response?.headers.get('request-id'), \"f\");\n __classPrivateFieldGet(this, _BetaMessageStream_resolveConnectedPromise, \"f\").call(this, response);\n this._emit('connect');\n }\n get ended() {\n return __classPrivateFieldGet(this, _BetaMessageStream_ended, \"f\");\n }\n get errored() {\n return __classPrivateFieldGet(this, _BetaMessageStream_errored, \"f\");\n }\n get aborted() {\n return __classPrivateFieldGet(this, _BetaMessageStream_aborted, \"f\");\n }\n abort() {\n this.controller.abort();\n }\n /**\n * Adds the listener function to the end of the listeners array for the event.\n * No checks are made to see if the listener has already been added. Multiple calls passing\n * the same combination of event and listener will result in the listener being added, and\n * called, multiple times.\n * @returns this MessageStream, so that calls can be chained\n */\n on(event, listener) {\n const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] || (__classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] = []);\n listeners.push({ listener });\n return this;\n }\n /**\n * Removes the specified listener from the listener array for the event.\n * off() will remove, at most, one instance of a listener from the listener array. If any single\n * listener has been added multiple times to the listener array for the specified event, then\n * off() must be called multiple times to remove each instance.\n * @returns this MessageStream, so that calls can be chained\n */\n off(event, listener) {\n const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event];\n if (!listeners)\n return this;\n const index = listeners.findIndex((l) => l.listener === listener);\n if (index >= 0)\n listeners.splice(index, 1);\n return this;\n }\n /**\n * Adds a one-time listener function for the event. The next time the event is triggered,\n * this listener is removed and then invoked.\n * @returns this MessageStream, so that calls can be chained\n */\n once(event, listener) {\n const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] || (__classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] = []);\n listeners.push({ listener, once: true });\n return this;\n }\n /**\n * This is similar to `.once()`, but returns a Promise that resolves the next time\n * the event is triggered, instead of calling a listener callback.\n * @returns a Promise that resolves the next time given event is triggered,\n * or rejects if an error is emitted. (If you request the 'error' event,\n * returns a promise that resolves with the error).\n *\n * Example:\n *\n * const message = await stream.emitted('message') // rejects if the stream errors\n */\n emitted(event) {\n return new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, \"f\");\n if (event !== 'error')\n this.once('error', reject);\n this.once(event, resolve);\n });\n }\n async done() {\n __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, \"f\");\n await __classPrivateFieldGet(this, _BetaMessageStream_endPromise, \"f\");\n }\n get currentMessage() {\n return __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, \"f\");\n }\n /**\n * @returns a promise that resolves with the the final assistant Message response,\n * or rejects if an error occurred or the stream ended prematurely without producing a Message.\n */\n async finalMessage() {\n await this.done();\n return __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_getFinalMessage).call(this);\n }\n /**\n * @returns a promise that resolves with the the final assistant Message's text response, concatenated\n * together if there are more than one text blocks.\n * Rejects if an error occurred or the stream ended prematurely without producing a Message.\n */\n async finalText() {\n await this.done();\n return __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_getFinalText).call(this);\n }\n _emit(event, ...args) {\n // make sure we don't emit any MessageStreamEvents after end\n if (__classPrivateFieldGet(this, _BetaMessageStream_ended, \"f\"))\n return;\n if (event === 'end') {\n __classPrivateFieldSet(this, _BetaMessageStream_ended, true, \"f\");\n __classPrivateFieldGet(this, _BetaMessageStream_resolveEndPromise, \"f\").call(this);\n }\n const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event];\n if (listeners) {\n __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] = listeners.filter((l) => !l.once);\n listeners.forEach(({ listener }) => listener(...args));\n }\n if (event === 'abort') {\n const error = args[0];\n if (!__classPrivateFieldGet(this, _BetaMessageStream_catchingPromiseCreated, \"f\") && !listeners?.length) {\n Promise.reject(error);\n }\n __classPrivateFieldGet(this, _BetaMessageStream_rejectConnectedPromise, \"f\").call(this, error);\n __classPrivateFieldGet(this, _BetaMessageStream_rejectEndPromise, \"f\").call(this, error);\n this._emit('end');\n return;\n }\n if (event === 'error') {\n // NOTE: _emit('error', error) should only be called from #handleError().\n const error = args[0];\n if (!__classPrivateFieldGet(this, _BetaMessageStream_catchingPromiseCreated, \"f\") && !listeners?.length) {\n // Trigger an unhandled rejection if the user hasn't registered any error handlers.\n // If you are seeing stack traces here, make sure to handle errors via either:\n // - runner.on('error', () => ...)\n // - await runner.done()\n // - await runner.final...()\n // - etc.\n Promise.reject(error);\n }\n __classPrivateFieldGet(this, _BetaMessageStream_rejectConnectedPromise, \"f\").call(this, error);\n __classPrivateFieldGet(this, _BetaMessageStream_rejectEndPromise, \"f\").call(this, error);\n this._emit('end');\n }\n }\n _emitFinal() {\n const finalMessage = this.receivedMessages.at(-1);\n if (finalMessage) {\n this._emit('finalMessage', __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_getFinalMessage).call(this));\n }\n }\n async _fromReadableStream(readableStream, options) {\n const signal = options?.signal;\n if (signal) {\n if (signal.aborted)\n this.controller.abort();\n signal.addEventListener('abort', () => this.controller.abort());\n }\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_beginRequest).call(this);\n this._connected(null);\n const stream = Stream.fromReadableStream(readableStream, this.controller);\n for await (const event of stream) {\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_addStreamEvent).call(this, event);\n }\n if (stream.controller.signal?.aborted) {\n throw new APIUserAbortError();\n }\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_endRequest).call(this);\n }\n [(_BetaMessageStream_currentMessageSnapshot = new WeakMap(), _BetaMessageStream_connectedPromise = new WeakMap(), _BetaMessageStream_resolveConnectedPromise = new WeakMap(), _BetaMessageStream_rejectConnectedPromise = new WeakMap(), _BetaMessageStream_endPromise = new WeakMap(), _BetaMessageStream_resolveEndPromise = new WeakMap(), _BetaMessageStream_rejectEndPromise = new WeakMap(), _BetaMessageStream_listeners = new WeakMap(), _BetaMessageStream_ended = new WeakMap(), _BetaMessageStream_errored = new WeakMap(), _BetaMessageStream_aborted = new WeakMap(), _BetaMessageStream_catchingPromiseCreated = new WeakMap(), _BetaMessageStream_response = new WeakMap(), _BetaMessageStream_request_id = new WeakMap(), _BetaMessageStream_handleError = new WeakMap(), _BetaMessageStream_instances = new WeakSet(), _BetaMessageStream_getFinalMessage = function _BetaMessageStream_getFinalMessage() {\n if (this.receivedMessages.length === 0) {\n throw new AnthropicError('stream ended without producing a Message with role=assistant');\n }\n return this.receivedMessages.at(-1);\n }, _BetaMessageStream_getFinalText = function _BetaMessageStream_getFinalText() {\n if (this.receivedMessages.length === 0) {\n throw new AnthropicError('stream ended without producing a Message with role=assistant');\n }\n const textBlocks = this.receivedMessages\n .at(-1)\n .content.filter((block) => block.type === 'text')\n .map((block) => block.text);\n if (textBlocks.length === 0) {\n throw new AnthropicError('stream ended without producing a content block with type=text');\n }\n return textBlocks.join(' ');\n }, _BetaMessageStream_beginRequest = function _BetaMessageStream_beginRequest() {\n if (this.ended)\n return;\n __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, undefined, \"f\");\n }, _BetaMessageStream_addStreamEvent = function _BetaMessageStream_addStreamEvent(event) {\n if (this.ended)\n return;\n const messageSnapshot = __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_accumulateMessage).call(this, event);\n this._emit('streamEvent', event, messageSnapshot);\n switch (event.type) {\n case 'content_block_delta': {\n const content = messageSnapshot.content.at(-1);\n switch (event.delta.type) {\n case 'text_delta': {\n if (content.type === 'text') {\n this._emit('text', event.delta.text, content.text || '');\n }\n break;\n }\n case 'citations_delta': {\n if (content.type === 'text') {\n this._emit('citation', event.delta.citation, content.citations ?? []);\n }\n break;\n }\n case 'input_json_delta': {\n if ((content.type === 'tool_use' || content.type === 'mcp_tool_use') && content.input) {\n this._emit('inputJson', event.delta.partial_json, content.input);\n }\n break;\n }\n case 'thinking_delta': {\n if (content.type === 'thinking') {\n this._emit('thinking', event.delta.thinking, content.thinking);\n }\n break;\n }\n case 'signature_delta': {\n if (content.type === 'thinking') {\n this._emit('signature', content.signature);\n }\n break;\n }\n default:\n checkNever(event.delta);\n }\n break;\n }\n case 'message_stop': {\n this._addMessageParam(messageSnapshot);\n this._addMessage(messageSnapshot, true);\n break;\n }\n case 'content_block_stop': {\n this._emit('contentBlock', messageSnapshot.content.at(-1));\n break;\n }\n case 'message_start': {\n __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, messageSnapshot, \"f\");\n break;\n }\n case 'content_block_start':\n case 'message_delta':\n break;\n }\n }, _BetaMessageStream_endRequest = function _BetaMessageStream_endRequest() {\n if (this.ended) {\n throw new AnthropicError(`stream has ended, this shouldn't happen`);\n }\n const snapshot = __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, \"f\");\n if (!snapshot) {\n throw new AnthropicError(`request ended without sending any chunks`);\n }\n __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, undefined, \"f\");\n return snapshot;\n }, _BetaMessageStream_accumulateMessage = function _BetaMessageStream_accumulateMessage(event) {\n let snapshot = __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, \"f\");\n if (event.type === 'message_start') {\n if (snapshot) {\n throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving \"message_stop\"`);\n }\n return event.message;\n }\n if (!snapshot) {\n throw new AnthropicError(`Unexpected event order, got ${event.type} before \"message_start\"`);\n }\n switch (event.type) {\n case 'message_stop':\n return snapshot;\n case 'message_delta':\n snapshot.container = event.delta.container;\n snapshot.stop_reason = event.delta.stop_reason;\n snapshot.stop_sequence = event.delta.stop_sequence;\n snapshot.usage.output_tokens = event.usage.output_tokens;\n if (event.usage.input_tokens != null) {\n snapshot.usage.input_tokens = event.usage.input_tokens;\n }\n if (event.usage.cache_creation_input_tokens != null) {\n snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens;\n }\n if (event.usage.cache_read_input_tokens != null) {\n snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens;\n }\n if (event.usage.server_tool_use != null) {\n snapshot.usage.server_tool_use = event.usage.server_tool_use;\n }\n return snapshot;\n case 'content_block_start':\n snapshot.content.push(event.content_block);\n return snapshot;\n case 'content_block_delta': {\n const snapshotContent = snapshot.content.at(event.index);\n switch (event.delta.type) {\n case 'text_delta': {\n if (snapshotContent?.type === 'text') {\n snapshotContent.text += event.delta.text;\n }\n break;\n }\n case 'citations_delta': {\n if (snapshotContent?.type === 'text') {\n snapshotContent.citations ?? (snapshotContent.citations = []);\n snapshotContent.citations.push(event.delta.citation);\n }\n break;\n }\n case 'input_json_delta': {\n if (snapshotContent?.type === 'tool_use' || snapshotContent?.type === 'mcp_tool_use') {\n // we need to keep track of the raw JSON string as well so that we can\n // re-parse it for each delta, for now we just store it as an untyped\n // non-enumerable property on the snapshot\n let jsonBuf = snapshotContent[JSON_BUF_PROPERTY] || '';\n jsonBuf += event.delta.partial_json;\n Object.defineProperty(snapshotContent, JSON_BUF_PROPERTY, {\n value: jsonBuf,\n enumerable: false,\n writable: true,\n });\n if (jsonBuf) {\n snapshotContent.input = partialParse(jsonBuf);\n }\n }\n break;\n }\n case 'thinking_delta': {\n if (snapshotContent?.type === 'thinking') {\n snapshotContent.thinking += event.delta.thinking;\n }\n break;\n }\n case 'signature_delta': {\n if (snapshotContent?.type === 'thinking') {\n snapshotContent.signature = event.delta.signature;\n }\n break;\n }\n default:\n checkNever(event.delta);\n }\n return snapshot;\n }\n case 'content_block_stop':\n return snapshot;\n }\n }, Symbol.asyncIterator)]() {\n const pushQueue = [];\n const readQueue = [];\n let done = false;\n this.on('streamEvent', (event) => {\n const reader = readQueue.shift();\n if (reader) {\n reader.resolve(event);\n }\n else {\n pushQueue.push(event);\n }\n });\n this.on('end', () => {\n done = true;\n for (const reader of readQueue) {\n reader.resolve(undefined);\n }\n readQueue.length = 0;\n });\n this.on('abort', (err) => {\n done = true;\n for (const reader of readQueue) {\n reader.reject(err);\n }\n readQueue.length = 0;\n });\n this.on('error', (err) => {\n done = true;\n for (const reader of readQueue) {\n reader.reject(err);\n }\n readQueue.length = 0;\n });\n return {\n next: async () => {\n if (!pushQueue.length) {\n if (done) {\n return { value: undefined, done: true };\n }\n return new Promise((resolve, reject) => readQueue.push({ resolve, reject })).then((chunk) => (chunk ? { value: chunk, done: false } : { value: undefined, done: true }));\n }\n const chunk = pushQueue.shift();\n return { value: chunk, done: false };\n },\n return: async () => {\n this.abort();\n return { value: undefined, done: true };\n },\n };\n }\n toReadableStream() {\n const stream = new Stream(this[Symbol.asyncIterator].bind(this), this.controller);\n return stream.toReadableStream();\n }\n}\n// used to ensure exhaustive case matching without throwing a runtime error\nfunction checkNever(x) { }\n//# sourceMappingURL=BetaMessageStream.mjs.map", - "// File containing shared constants\n/**\n * Model-specific timeout constraints for non-streaming requests\n */\nexport const MODEL_NONSTREAMING_TOKENS = {\n 'claude-opus-4-20250514': 8192,\n 'claude-opus-4-0': 8192,\n 'claude-4-opus-20250514': 8192,\n 'anthropic.claude-opus-4-20250514-v1:0': 8192,\n 'claude-opus-4@20250514': 8192,\n};\n//# sourceMappingURL=constants.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport * as BatchesAPI from \"./batches.mjs\";\nimport { Batches, } from \"./batches.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { BetaMessageStream } from \"../../../lib/BetaMessageStream.mjs\";\nconst DEPRECATED_MODELS = {\n 'claude-1.3': 'November 6th, 2024',\n 'claude-1.3-100k': 'November 6th, 2024',\n 'claude-instant-1.1': 'November 6th, 2024',\n 'claude-instant-1.1-100k': 'November 6th, 2024',\n 'claude-instant-1.2': 'November 6th, 2024',\n 'claude-3-sonnet-20240229': 'July 21st, 2025',\n 'claude-2.1': 'July 21st, 2025',\n 'claude-2.0': 'July 21st, 2025',\n};\nimport { MODEL_NONSTREAMING_TOKENS } from \"../../../internal/constants.mjs\";\nexport class Messages extends APIResource {\n constructor() {\n super(...arguments);\n this.batches = new BatchesAPI.Batches(this._client);\n }\n create(params, options) {\n const { betas, ...body } = params;\n if (body.model in DEPRECATED_MODELS) {\n console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]}\\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);\n }\n let timeout = this._client._options.timeout;\n if (!body.stream && timeout == null) {\n const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;\n timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);\n }\n return this._client.post('/v1/messages?beta=true', {\n body,\n timeout: timeout ?? 600000,\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n stream: params.stream ?? false,\n });\n }\n /**\n * Create a Message stream\n */\n stream(body, options) {\n return BetaMessageStream.createMessage(this, body, options);\n }\n /**\n * Count the number of tokens in a Message.\n *\n * The Token Count API can be used to count the number of tokens in a Message,\n * including tools, images, and documents, without creating it.\n *\n * Learn more about token counting in our\n * [user guide](/en/docs/build-with-claude/token-counting)\n *\n * @example\n * ```ts\n * const betaMessageTokensCount =\n * await client.beta.messages.countTokens({\n * messages: [{ content: 'string', role: 'user' }],\n * model: 'claude-3-7-sonnet-latest',\n * });\n * ```\n */\n countTokens(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/messages/count_tokens?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\nMessages.Batches = Batches;\n//# sourceMappingURL=messages.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport * as FilesAPI from \"./files.mjs\";\nimport { Files, } from \"./files.mjs\";\nimport * as ModelsAPI from \"./models.mjs\";\nimport { Models } from \"./models.mjs\";\nimport * as MessagesAPI from \"./messages/messages.mjs\";\nimport { Messages, } from \"./messages/messages.mjs\";\nexport class Beta extends APIResource {\n constructor() {\n super(...arguments);\n this.models = new ModelsAPI.Models(this._client);\n this.messages = new MessagesAPI.Messages(this._client);\n this.files = new FilesAPI.Files(this._client);\n }\n}\nBeta.Models = Models;\nBeta.Messages = Messages;\nBeta.Files = Files;\n//# sourceMappingURL=beta.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../core/resource.mjs\";\nimport { buildHeaders } from \"../internal/headers.mjs\";\nexport class Completions extends APIResource {\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/complete', {\n body,\n timeout: this._client._options.timeout ?? 600000,\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n stream: params.stream ?? false,\n });\n }\n}\n//# sourceMappingURL=completions.mjs.map", - "var _MessageStream_instances, _MessageStream_currentMessageSnapshot, _MessageStream_connectedPromise, _MessageStream_resolveConnectedPromise, _MessageStream_rejectConnectedPromise, _MessageStream_endPromise, _MessageStream_resolveEndPromise, _MessageStream_rejectEndPromise, _MessageStream_listeners, _MessageStream_ended, _MessageStream_errored, _MessageStream_aborted, _MessageStream_catchingPromiseCreated, _MessageStream_response, _MessageStream_request_id, _MessageStream_getFinalMessage, _MessageStream_getFinalText, _MessageStream_handleError, _MessageStream_beginRequest, _MessageStream_addStreamEvent, _MessageStream_endRequest, _MessageStream_accumulateMessage;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { isAbortError } from \"../internal/errors.mjs\";\nimport { AnthropicError, APIUserAbortError } from \"../error.mjs\";\nimport { Stream } from \"../streaming.mjs\";\nimport { partialParse } from \"../_vendor/partial-json-parser/parser.mjs\";\nconst JSON_BUF_PROPERTY = '__json_buf';\nexport class MessageStream {\n constructor() {\n _MessageStream_instances.add(this);\n this.messages = [];\n this.receivedMessages = [];\n _MessageStream_currentMessageSnapshot.set(this, void 0);\n this.controller = new AbortController();\n _MessageStream_connectedPromise.set(this, void 0);\n _MessageStream_resolveConnectedPromise.set(this, () => { });\n _MessageStream_rejectConnectedPromise.set(this, () => { });\n _MessageStream_endPromise.set(this, void 0);\n _MessageStream_resolveEndPromise.set(this, () => { });\n _MessageStream_rejectEndPromise.set(this, () => { });\n _MessageStream_listeners.set(this, {});\n _MessageStream_ended.set(this, false);\n _MessageStream_errored.set(this, false);\n _MessageStream_aborted.set(this, false);\n _MessageStream_catchingPromiseCreated.set(this, false);\n _MessageStream_response.set(this, void 0);\n _MessageStream_request_id.set(this, void 0);\n _MessageStream_handleError.set(this, (error) => {\n __classPrivateFieldSet(this, _MessageStream_errored, true, \"f\");\n if (isAbortError(error)) {\n error = new APIUserAbortError();\n }\n if (error instanceof APIUserAbortError) {\n __classPrivateFieldSet(this, _MessageStream_aborted, true, \"f\");\n return this._emit('abort', error);\n }\n if (error instanceof AnthropicError) {\n return this._emit('error', error);\n }\n if (error instanceof Error) {\n const anthropicError = new AnthropicError(error.message);\n // @ts-ignore\n anthropicError.cause = error;\n return this._emit('error', anthropicError);\n }\n return this._emit('error', new AnthropicError(String(error)));\n });\n __classPrivateFieldSet(this, _MessageStream_connectedPromise, new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _MessageStream_resolveConnectedPromise, resolve, \"f\");\n __classPrivateFieldSet(this, _MessageStream_rejectConnectedPromise, reject, \"f\");\n }), \"f\");\n __classPrivateFieldSet(this, _MessageStream_endPromise, new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _MessageStream_resolveEndPromise, resolve, \"f\");\n __classPrivateFieldSet(this, _MessageStream_rejectEndPromise, reject, \"f\");\n }), \"f\");\n // Don't let these promises cause unhandled rejection errors.\n // we will manually cause an unhandled rejection error later\n // if the user hasn't registered any error listener or called\n // any promise-returning method.\n __classPrivateFieldGet(this, _MessageStream_connectedPromise, \"f\").catch(() => { });\n __classPrivateFieldGet(this, _MessageStream_endPromise, \"f\").catch(() => { });\n }\n get response() {\n return __classPrivateFieldGet(this, _MessageStream_response, \"f\");\n }\n get request_id() {\n return __classPrivateFieldGet(this, _MessageStream_request_id, \"f\");\n }\n /**\n * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request,\n * returned vie the `request-id` header which is useful for debugging requests and resporting\n * issues to Anthropic.\n *\n * This is the same as the `APIPromise.withResponse()` method.\n *\n * This method will raise an error if you created the stream using `MessageStream.fromReadableStream`\n * as no `Response` is available.\n */\n async withResponse() {\n const response = await __classPrivateFieldGet(this, _MessageStream_connectedPromise, \"f\");\n if (!response) {\n throw new Error('Could not resolve a `Response` object');\n }\n return {\n data: this,\n response,\n request_id: response.headers.get('request-id'),\n };\n }\n /**\n * Intended for use on the frontend, consuming a stream produced with\n * `.toReadableStream()` on the backend.\n *\n * Note that messages sent to the model do not appear in `.on('message')`\n * in this context.\n */\n static fromReadableStream(stream) {\n const runner = new MessageStream();\n runner._run(() => runner._fromReadableStream(stream));\n return runner;\n }\n static createMessage(messages, params, options) {\n const runner = new MessageStream();\n for (const message of params.messages) {\n runner._addMessageParam(message);\n }\n runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'stream' } }));\n return runner;\n }\n _run(executor) {\n executor().then(() => {\n this._emitFinal();\n this._emit('end');\n }, __classPrivateFieldGet(this, _MessageStream_handleError, \"f\"));\n }\n _addMessageParam(message) {\n this.messages.push(message);\n }\n _addMessage(message, emit = true) {\n this.receivedMessages.push(message);\n if (emit) {\n this._emit('message', message);\n }\n }\n async _createMessage(messages, params, options) {\n const signal = options?.signal;\n if (signal) {\n if (signal.aborted)\n this.controller.abort();\n signal.addEventListener('abort', () => this.controller.abort());\n }\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_beginRequest).call(this);\n const { response, data: stream } = await messages\n .create({ ...params, stream: true }, { ...options, signal: this.controller.signal })\n .withResponse();\n this._connected(response);\n for await (const event of stream) {\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_addStreamEvent).call(this, event);\n }\n if (stream.controller.signal?.aborted) {\n throw new APIUserAbortError();\n }\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_endRequest).call(this);\n }\n _connected(response) {\n if (this.ended)\n return;\n __classPrivateFieldSet(this, _MessageStream_response, response, \"f\");\n __classPrivateFieldSet(this, _MessageStream_request_id, response?.headers.get('request-id'), \"f\");\n __classPrivateFieldGet(this, _MessageStream_resolveConnectedPromise, \"f\").call(this, response);\n this._emit('connect');\n }\n get ended() {\n return __classPrivateFieldGet(this, _MessageStream_ended, \"f\");\n }\n get errored() {\n return __classPrivateFieldGet(this, _MessageStream_errored, \"f\");\n }\n get aborted() {\n return __classPrivateFieldGet(this, _MessageStream_aborted, \"f\");\n }\n abort() {\n this.controller.abort();\n }\n /**\n * Adds the listener function to the end of the listeners array for the event.\n * No checks are made to see if the listener has already been added. Multiple calls passing\n * the same combination of event and listener will result in the listener being added, and\n * called, multiple times.\n * @returns this MessageStream, so that calls can be chained\n */\n on(event, listener) {\n const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] = []);\n listeners.push({ listener });\n return this;\n }\n /**\n * Removes the specified listener from the listener array for the event.\n * off() will remove, at most, one instance of a listener from the listener array. If any single\n * listener has been added multiple times to the listener array for the specified event, then\n * off() must be called multiple times to remove each instance.\n * @returns this MessageStream, so that calls can be chained\n */\n off(event, listener) {\n const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event];\n if (!listeners)\n return this;\n const index = listeners.findIndex((l) => l.listener === listener);\n if (index >= 0)\n listeners.splice(index, 1);\n return this;\n }\n /**\n * Adds a one-time listener function for the event. The next time the event is triggered,\n * this listener is removed and then invoked.\n * @returns this MessageStream, so that calls can be chained\n */\n once(event, listener) {\n const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] = []);\n listeners.push({ listener, once: true });\n return this;\n }\n /**\n * This is similar to `.once()`, but returns a Promise that resolves the next time\n * the event is triggered, instead of calling a listener callback.\n * @returns a Promise that resolves the next time given event is triggered,\n * or rejects if an error is emitted. (If you request the 'error' event,\n * returns a promise that resolves with the error).\n *\n * Example:\n *\n * const message = await stream.emitted('message') // rejects if the stream errors\n */\n emitted(event) {\n return new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, \"f\");\n if (event !== 'error')\n this.once('error', reject);\n this.once(event, resolve);\n });\n }\n async done() {\n __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, \"f\");\n await __classPrivateFieldGet(this, _MessageStream_endPromise, \"f\");\n }\n get currentMessage() {\n return __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, \"f\");\n }\n /**\n * @returns a promise that resolves with the the final assistant Message response,\n * or rejects if an error occurred or the stream ended prematurely without producing a Message.\n */\n async finalMessage() {\n await this.done();\n return __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_getFinalMessage).call(this);\n }\n /**\n * @returns a promise that resolves with the the final assistant Message's text response, concatenated\n * together if there are more than one text blocks.\n * Rejects if an error occurred or the stream ended prematurely without producing a Message.\n */\n async finalText() {\n await this.done();\n return __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_getFinalText).call(this);\n }\n _emit(event, ...args) {\n // make sure we don't emit any MessageStreamEvents after end\n if (__classPrivateFieldGet(this, _MessageStream_ended, \"f\"))\n return;\n if (event === 'end') {\n __classPrivateFieldSet(this, _MessageStream_ended, true, \"f\");\n __classPrivateFieldGet(this, _MessageStream_resolveEndPromise, \"f\").call(this);\n }\n const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event];\n if (listeners) {\n __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] = listeners.filter((l) => !l.once);\n listeners.forEach(({ listener }) => listener(...args));\n }\n if (event === 'abort') {\n const error = args[0];\n if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, \"f\") && !listeners?.length) {\n Promise.reject(error);\n }\n __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, \"f\").call(this, error);\n __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, \"f\").call(this, error);\n this._emit('end');\n return;\n }\n if (event === 'error') {\n // NOTE: _emit('error', error) should only be called from #handleError().\n const error = args[0];\n if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, \"f\") && !listeners?.length) {\n // Trigger an unhandled rejection if the user hasn't registered any error handlers.\n // If you are seeing stack traces here, make sure to handle errors via either:\n // - runner.on('error', () => ...)\n // - await runner.done()\n // - await runner.final...()\n // - etc.\n Promise.reject(error);\n }\n __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, \"f\").call(this, error);\n __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, \"f\").call(this, error);\n this._emit('end');\n }\n }\n _emitFinal() {\n const finalMessage = this.receivedMessages.at(-1);\n if (finalMessage) {\n this._emit('finalMessage', __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_getFinalMessage).call(this));\n }\n }\n async _fromReadableStream(readableStream, options) {\n const signal = options?.signal;\n if (signal) {\n if (signal.aborted)\n this.controller.abort();\n signal.addEventListener('abort', () => this.controller.abort());\n }\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_beginRequest).call(this);\n this._connected(null);\n const stream = Stream.fromReadableStream(readableStream, this.controller);\n for await (const event of stream) {\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_addStreamEvent).call(this, event);\n }\n if (stream.controller.signal?.aborted) {\n throw new APIUserAbortError();\n }\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_endRequest).call(this);\n }\n [(_MessageStream_currentMessageSnapshot = new WeakMap(), _MessageStream_connectedPromise = new WeakMap(), _MessageStream_resolveConnectedPromise = new WeakMap(), _MessageStream_rejectConnectedPromise = new WeakMap(), _MessageStream_endPromise = new WeakMap(), _MessageStream_resolveEndPromise = new WeakMap(), _MessageStream_rejectEndPromise = new WeakMap(), _MessageStream_listeners = new WeakMap(), _MessageStream_ended = new WeakMap(), _MessageStream_errored = new WeakMap(), _MessageStream_aborted = new WeakMap(), _MessageStream_catchingPromiseCreated = new WeakMap(), _MessageStream_response = new WeakMap(), _MessageStream_request_id = new WeakMap(), _MessageStream_handleError = new WeakMap(), _MessageStream_instances = new WeakSet(), _MessageStream_getFinalMessage = function _MessageStream_getFinalMessage() {\n if (this.receivedMessages.length === 0) {\n throw new AnthropicError('stream ended without producing a Message with role=assistant');\n }\n return this.receivedMessages.at(-1);\n }, _MessageStream_getFinalText = function _MessageStream_getFinalText() {\n if (this.receivedMessages.length === 0) {\n throw new AnthropicError('stream ended without producing a Message with role=assistant');\n }\n const textBlocks = this.receivedMessages\n .at(-1)\n .content.filter((block) => block.type === 'text')\n .map((block) => block.text);\n if (textBlocks.length === 0) {\n throw new AnthropicError('stream ended without producing a content block with type=text');\n }\n return textBlocks.join(' ');\n }, _MessageStream_beginRequest = function _MessageStream_beginRequest() {\n if (this.ended)\n return;\n __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, undefined, \"f\");\n }, _MessageStream_addStreamEvent = function _MessageStream_addStreamEvent(event) {\n if (this.ended)\n return;\n const messageSnapshot = __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_accumulateMessage).call(this, event);\n this._emit('streamEvent', event, messageSnapshot);\n switch (event.type) {\n case 'content_block_delta': {\n const content = messageSnapshot.content.at(-1);\n switch (event.delta.type) {\n case 'text_delta': {\n if (content.type === 'text') {\n this._emit('text', event.delta.text, content.text || '');\n }\n break;\n }\n case 'citations_delta': {\n if (content.type === 'text') {\n this._emit('citation', event.delta.citation, content.citations ?? []);\n }\n break;\n }\n case 'input_json_delta': {\n if (content.type === 'tool_use' && content.input) {\n this._emit('inputJson', event.delta.partial_json, content.input);\n }\n break;\n }\n case 'thinking_delta': {\n if (content.type === 'thinking') {\n this._emit('thinking', event.delta.thinking, content.thinking);\n }\n break;\n }\n case 'signature_delta': {\n if (content.type === 'thinking') {\n this._emit('signature', content.signature);\n }\n break;\n }\n default:\n checkNever(event.delta);\n }\n break;\n }\n case 'message_stop': {\n this._addMessageParam(messageSnapshot);\n this._addMessage(messageSnapshot, true);\n break;\n }\n case 'content_block_stop': {\n this._emit('contentBlock', messageSnapshot.content.at(-1));\n break;\n }\n case 'message_start': {\n __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, messageSnapshot, \"f\");\n break;\n }\n case 'content_block_start':\n case 'message_delta':\n break;\n }\n }, _MessageStream_endRequest = function _MessageStream_endRequest() {\n if (this.ended) {\n throw new AnthropicError(`stream has ended, this shouldn't happen`);\n }\n const snapshot = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, \"f\");\n if (!snapshot) {\n throw new AnthropicError(`request ended without sending any chunks`);\n }\n __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, undefined, \"f\");\n return snapshot;\n }, _MessageStream_accumulateMessage = function _MessageStream_accumulateMessage(event) {\n let snapshot = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, \"f\");\n if (event.type === 'message_start') {\n if (snapshot) {\n throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving \"message_stop\"`);\n }\n return event.message;\n }\n if (!snapshot) {\n throw new AnthropicError(`Unexpected event order, got ${event.type} before \"message_start\"`);\n }\n switch (event.type) {\n case 'message_stop':\n return snapshot;\n case 'message_delta':\n snapshot.stop_reason = event.delta.stop_reason;\n snapshot.stop_sequence = event.delta.stop_sequence;\n snapshot.usage.output_tokens = event.usage.output_tokens;\n // Update other usage fields if they exist in the event\n if (event.usage.input_tokens != null) {\n snapshot.usage.input_tokens = event.usage.input_tokens;\n }\n if (event.usage.cache_creation_input_tokens != null) {\n snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens;\n }\n if (event.usage.cache_read_input_tokens != null) {\n snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens;\n }\n if (event.usage.server_tool_use != null) {\n snapshot.usage.server_tool_use = event.usage.server_tool_use;\n }\n return snapshot;\n case 'content_block_start':\n snapshot.content.push(event.content_block);\n return snapshot;\n case 'content_block_delta': {\n const snapshotContent = snapshot.content.at(event.index);\n switch (event.delta.type) {\n case 'text_delta': {\n if (snapshotContent?.type === 'text') {\n snapshotContent.text += event.delta.text;\n }\n break;\n }\n case 'citations_delta': {\n if (snapshotContent?.type === 'text') {\n snapshotContent.citations ?? (snapshotContent.citations = []);\n snapshotContent.citations.push(event.delta.citation);\n }\n break;\n }\n case 'input_json_delta': {\n if (snapshotContent?.type === 'tool_use') {\n // we need to keep track of the raw JSON string as well so that we can\n // re-parse it for each delta, for now we just store it as an untyped\n // non-enumerable property on the snapshot\n let jsonBuf = snapshotContent[JSON_BUF_PROPERTY] || '';\n jsonBuf += event.delta.partial_json;\n Object.defineProperty(snapshotContent, JSON_BUF_PROPERTY, {\n value: jsonBuf,\n enumerable: false,\n writable: true,\n });\n if (jsonBuf) {\n snapshotContent.input = partialParse(jsonBuf);\n }\n }\n break;\n }\n case 'thinking_delta': {\n if (snapshotContent?.type === 'thinking') {\n snapshotContent.thinking += event.delta.thinking;\n }\n break;\n }\n case 'signature_delta': {\n if (snapshotContent?.type === 'thinking') {\n snapshotContent.signature = event.delta.signature;\n }\n break;\n }\n default:\n checkNever(event.delta);\n }\n return snapshot;\n }\n case 'content_block_stop':\n return snapshot;\n }\n }, Symbol.asyncIterator)]() {\n const pushQueue = [];\n const readQueue = [];\n let done = false;\n this.on('streamEvent', (event) => {\n const reader = readQueue.shift();\n if (reader) {\n reader.resolve(event);\n }\n else {\n pushQueue.push(event);\n }\n });\n this.on('end', () => {\n done = true;\n for (const reader of readQueue) {\n reader.resolve(undefined);\n }\n readQueue.length = 0;\n });\n this.on('abort', (err) => {\n done = true;\n for (const reader of readQueue) {\n reader.reject(err);\n }\n readQueue.length = 0;\n });\n this.on('error', (err) => {\n done = true;\n for (const reader of readQueue) {\n reader.reject(err);\n }\n readQueue.length = 0;\n });\n return {\n next: async () => {\n if (!pushQueue.length) {\n if (done) {\n return { value: undefined, done: true };\n }\n return new Promise((resolve, reject) => readQueue.push({ resolve, reject })).then((chunk) => (chunk ? { value: chunk, done: false } : { value: undefined, done: true }));\n }\n const chunk = pushQueue.shift();\n return { value: chunk, done: false };\n },\n return: async () => {\n this.abort();\n return { value: undefined, done: true };\n },\n };\n }\n toReadableStream() {\n const stream = new Stream(this[Symbol.asyncIterator].bind(this), this.controller);\n return stream.toReadableStream();\n }\n}\n// used to ensure exhaustive case matching without throwing a runtime error\nfunction checkNever(x) { }\n//# sourceMappingURL=MessageStream.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { Page } from \"../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { JSONLDecoder } from \"../../internal/decoders/jsonl.mjs\";\nimport { AnthropicError } from \"../../error.mjs\";\nimport { path } from \"../../internal/utils/path.mjs\";\nexport class Batches extends APIResource {\n /**\n * Send a batch of Message creation requests.\n *\n * The Message Batches API can be used to process multiple Messages API requests at\n * once. Once a Message Batch is created, it begins processing immediately. Batches\n * can take up to 24 hours to complete.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const messageBatch = await client.messages.batches.create({\n * requests: [\n * {\n * custom_id: 'my-custom-id-1',\n * params: {\n * max_tokens: 1024,\n * messages: [\n * { content: 'Hello, world', role: 'user' },\n * ],\n * model: 'claude-3-7-sonnet-20250219',\n * },\n * },\n * ],\n * });\n * ```\n */\n create(body, options) {\n return this._client.post('/v1/messages/batches', { body, ...options });\n }\n /**\n * This endpoint is idempotent and can be used to poll for Message Batch\n * completion. To access the results of a Message Batch, make a request to the\n * `results_url` field in the response.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const messageBatch = await client.messages.batches.retrieve(\n * 'message_batch_id',\n * );\n * ```\n */\n retrieve(messageBatchID, options) {\n return this._client.get(path `/v1/messages/batches/${messageBatchID}`, options);\n }\n /**\n * List all Message Batches within a Workspace. Most recently created batches are\n * returned first.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const messageBatch of client.messages.batches.list()) {\n * // ...\n * }\n * ```\n */\n list(query = {}, options) {\n return this._client.getAPIList('/v1/messages/batches', (Page), { query, ...options });\n }\n /**\n * Delete a Message Batch.\n *\n * Message Batches can only be deleted once they've finished processing. If you'd\n * like to delete an in-progress batch, you must first cancel it.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const deletedMessageBatch =\n * await client.messages.batches.delete('message_batch_id');\n * ```\n */\n delete(messageBatchID, options) {\n return this._client.delete(path `/v1/messages/batches/${messageBatchID}`, options);\n }\n /**\n * Batches may be canceled any time before processing ends. Once cancellation is\n * initiated, the batch enters a `canceling` state, at which time the system may\n * complete any in-progress, non-interruptible requests before finalizing\n * cancellation.\n *\n * The number of canceled requests is specified in `request_counts`. To determine\n * which requests were canceled, check the individual results within the batch.\n * Note that cancellation may not result in any canceled requests if they were\n * non-interruptible.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const messageBatch = await client.messages.batches.cancel(\n * 'message_batch_id',\n * );\n * ```\n */\n cancel(messageBatchID, options) {\n return this._client.post(path `/v1/messages/batches/${messageBatchID}/cancel`, options);\n }\n /**\n * Streams the results of a Message Batch as a `.jsonl` file.\n *\n * Each line in the file is a JSON object containing the result of a single request\n * in the Message Batch. Results are not guaranteed to be in the same order as\n * requests. Use the `custom_id` field to match results to requests.\n *\n * Learn more about the Message Batches API in our\n * [user guide](/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const messageBatchIndividualResponse =\n * await client.messages.batches.results('message_batch_id');\n * ```\n */\n async results(messageBatchID, options) {\n const batch = await this.retrieve(messageBatchID);\n if (!batch.results_url) {\n throw new AnthropicError(`No batch \\`results_url\\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);\n }\n return this._client\n .get(batch.results_url, {\n ...options,\n headers: buildHeaders([{ Accept: 'application/binary' }, options?.headers]),\n stream: true,\n __binaryResponse: true,\n })\n ._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));\n }\n}\n//# sourceMappingURL=batches.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { MessageStream } from \"../../lib/MessageStream.mjs\";\nimport * as BatchesAPI from \"./batches.mjs\";\nimport { Batches, } from \"./batches.mjs\";\nimport { MODEL_NONSTREAMING_TOKENS } from \"../../internal/constants.mjs\";\nexport class Messages extends APIResource {\n constructor() {\n super(...arguments);\n this.batches = new BatchesAPI.Batches(this._client);\n }\n create(body, options) {\n if (body.model in DEPRECATED_MODELS) {\n console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]}\\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);\n }\n let timeout = this._client._options.timeout;\n if (!body.stream && timeout == null) {\n const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;\n timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);\n }\n return this._client.post('/v1/messages', {\n body,\n timeout: timeout ?? 600000,\n ...options,\n stream: body.stream ?? false,\n });\n }\n /**\n * Create a Message stream\n */\n stream(body, options) {\n return MessageStream.createMessage(this, body, options);\n }\n /**\n * Count the number of tokens in a Message.\n *\n * The Token Count API can be used to count the number of tokens in a Message,\n * including tools, images, and documents, without creating it.\n *\n * Learn more about token counting in our\n * [user guide](/en/docs/build-with-claude/token-counting)\n *\n * @example\n * ```ts\n * const messageTokensCount =\n * await client.messages.countTokens({\n * messages: [{ content: 'string', role: 'user' }],\n * model: 'claude-3-7-sonnet-latest',\n * });\n * ```\n */\n countTokens(body, options) {\n return this._client.post('/v1/messages/count_tokens', { body, ...options });\n }\n}\nconst DEPRECATED_MODELS = {\n 'claude-1.3': 'November 6th, 2024',\n 'claude-1.3-100k': 'November 6th, 2024',\n 'claude-instant-1.1': 'November 6th, 2024',\n 'claude-instant-1.1-100k': 'November 6th, 2024',\n 'claude-instant-1.2': 'November 6th, 2024',\n 'claude-3-sonnet-20240229': 'July 21st, 2025',\n 'claude-2.1': 'July 21st, 2025',\n 'claude-2.0': 'July 21st, 2025',\n};\nMessages.Batches = Batches;\n//# sourceMappingURL=messages.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../core/resource.mjs\";\nimport { Page } from \"../core/pagination.mjs\";\nimport { buildHeaders } from \"../internal/headers.mjs\";\nimport { path } from \"../internal/utils/path.mjs\";\nexport class Models extends APIResource {\n /**\n * Get a specific model.\n *\n * The Models API response can be used to determine information about a specific\n * model or resolve a model alias to a model ID.\n */\n retrieve(modelID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/models/${modelID}`, {\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n });\n }\n /**\n * List available models.\n *\n * The Models API response can be used to determine which models are available for\n * use in the API. More recently released models are listed first.\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/models', (Page), {\n query,\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=models.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport * from \"./shared.mjs\";\nexport { Beta, } from \"./beta/beta.mjs\";\nexport { Completions, } from \"./completions.mjs\";\nexport { Messages, } from \"./messages/messages.mjs\";\nexport { Models, } from \"./models.mjs\";\n//# sourceMappingURL=index.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\n/**\n * Read an environment variable.\n *\n * Trims beginning and trailing whitespace.\n *\n * Will return undefined if the environment variable doesn't exist or cannot be accessed.\n */\nexport const readEnv = (env) => {\n if (typeof globalThis.process !== 'undefined') {\n return globalThis.process.env?.[env]?.trim() ?? undefined;\n }\n if (typeof globalThis.Deno !== 'undefined') {\n return globalThis.Deno.env?.get?.(env)?.trim();\n }\n return undefined;\n};\n//# sourceMappingURL=env.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nvar _a, _BaseAnthropic_encoder;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"./internal/tslib.mjs\";\nimport { uuid4 } from \"./internal/utils/uuid.mjs\";\nimport { validatePositiveInteger, isAbsoluteURL, safeJSON } from \"./internal/utils/values.mjs\";\nimport { sleep } from \"./internal/utils/sleep.mjs\";\nimport { parseLogLevel } from \"./internal/utils/log.mjs\";\nimport { castToError, isAbortError } from \"./internal/errors.mjs\";\nimport { getPlatformHeaders } from \"./internal/detect-platform.mjs\";\nimport * as Shims from \"./internal/shims.mjs\";\nimport * as Opts from \"./internal/request-options.mjs\";\nimport { VERSION } from \"./version.mjs\";\nimport * as Errors from \"./core/error.mjs\";\nimport * as Pagination from \"./core/pagination.mjs\";\nimport * as Uploads from \"./core/uploads.mjs\";\nimport * as API from \"./resources/index.mjs\";\nimport { APIPromise } from \"./core/api-promise.mjs\";\nimport { isRunningInBrowser } from \"./internal/detect-platform.mjs\";\nimport { buildHeaders } from \"./internal/headers.mjs\";\nimport { Completions, } from \"./resources/completions.mjs\";\nimport { Models } from \"./resources/models.mjs\";\nimport { readEnv } from \"./internal/utils/env.mjs\";\nimport { formatRequestDetails, loggerFor } from \"./internal/utils/log.mjs\";\nimport { isEmptyObj } from \"./internal/utils/values.mjs\";\nimport { Beta, } from \"./resources/beta/beta.mjs\";\nimport { Messages, } from \"./resources/messages/messages.mjs\";\nexport class BaseAnthropic {\n /**\n * API Client for interfacing with the Anthropic API.\n *\n * @param {string | null | undefined} [opts.apiKey=process.env['ANTHROPIC_API_KEY'] ?? null]\n * @param {string | null | undefined} [opts.authToken=process.env['ANTHROPIC_AUTH_TOKEN'] ?? null]\n * @param {string} [opts.baseURL=process.env['ANTHROPIC_BASE_URL'] ?? https://api.anthropic.com] - Override the default base URL for the API.\n * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.\n * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.\n * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.\n * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.\n * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.\n * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API.\n * @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.\n */\n constructor({ baseURL = readEnv('ANTHROPIC_BASE_URL'), apiKey = readEnv('ANTHROPIC_API_KEY') ?? null, authToken = readEnv('ANTHROPIC_AUTH_TOKEN') ?? null, ...opts } = {}) {\n _BaseAnthropic_encoder.set(this, void 0);\n const options = {\n apiKey,\n authToken,\n ...opts,\n baseURL: baseURL || `https://api.anthropic.com`,\n };\n if (!options.dangerouslyAllowBrowser && isRunningInBrowser()) {\n throw new Errors.AnthropicError(\"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 Anthropic({ apiKey, dangerouslyAllowBrowser: true });\\n\");\n }\n this.baseURL = options.baseURL;\n this.timeout = options.timeout ?? Anthropic.DEFAULT_TIMEOUT /* 10 minutes */;\n this.logger = options.logger ?? console;\n const defaultLogLevel = 'warn';\n // Set default logLevel early so that we can log a warning in parseLogLevel.\n this.logLevel = defaultLogLevel;\n this.logLevel =\n parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??\n parseLogLevel(readEnv('ANTHROPIC_LOG'), \"process.env['ANTHROPIC_LOG']\", this) ??\n defaultLogLevel;\n this.fetchOptions = options.fetchOptions;\n this.maxRetries = options.maxRetries ?? 2;\n this.fetch = options.fetch ?? Shims.getDefaultFetch();\n __classPrivateFieldSet(this, _BaseAnthropic_encoder, Opts.FallbackEncoder, \"f\");\n this._options = options;\n this.apiKey = apiKey;\n this.authToken = authToken;\n }\n /**\n * Create a new client instance re-using the same options given to the current client with optional overriding.\n */\n withOptions(options) {\n return new this.constructor({\n ...this._options,\n baseURL: this.baseURL,\n maxRetries: this.maxRetries,\n timeout: this.timeout,\n logger: this.logger,\n logLevel: this.logLevel,\n fetchOptions: this.fetchOptions,\n apiKey: this.apiKey,\n authToken: this.authToken,\n ...options,\n });\n }\n defaultQuery() {\n return this._options.defaultQuery;\n }\n validateHeaders({ values, nulls }) {\n if (this.apiKey && values.get('x-api-key')) {\n return;\n }\n if (nulls.has('x-api-key')) {\n return;\n }\n if (this.authToken && values.get('authorization')) {\n return;\n }\n if (nulls.has('authorization')) {\n return;\n }\n 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');\n }\n authHeaders(opts) {\n return buildHeaders([this.apiKeyAuth(opts), this.bearerAuth(opts)]);\n }\n apiKeyAuth(opts) {\n if (this.apiKey == null) {\n return undefined;\n }\n return buildHeaders([{ 'X-Api-Key': this.apiKey }]);\n }\n bearerAuth(opts) {\n if (this.authToken == null) {\n return undefined;\n }\n return buildHeaders([{ Authorization: `Bearer ${this.authToken}` }]);\n }\n /**\n * Basic re-implementation of `qs.stringify` for primitive types.\n */\n stringifyQuery(query) {\n return Object.entries(query)\n .filter(([_, value]) => typeof value !== 'undefined')\n .map(([key, value]) => {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;\n }\n if (value === null) {\n return `${encodeURIComponent(key)}=`;\n }\n throw new Errors.AnthropicError(`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.`);\n })\n .join('&');\n }\n getUserAgent() {\n return `${this.constructor.name}/JS ${VERSION}`;\n }\n defaultIdempotencyKey() {\n return `stainless-node-retry-${uuid4()}`;\n }\n makeStatusError(status, error, message, headers) {\n return Errors.APIError.generate(status, error, message, headers);\n }\n buildURL(path, query) {\n const url = isAbsoluteURL(path) ?\n new URL(path)\n : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));\n const defaultQuery = this.defaultQuery();\n if (!isEmptyObj(defaultQuery)) {\n query = { ...defaultQuery, ...query };\n }\n if (typeof query === 'object' && query && !Array.isArray(query)) {\n url.search = this.stringifyQuery(query);\n }\n return url.toString();\n }\n _calculateNonstreamingTimeout(maxTokens) {\n const defaultTimeout = 10 * 60;\n const expectedTimeout = (60 * 60 * maxTokens) / 128000;\n if (expectedTimeout > defaultTimeout) {\n throw new Errors.AnthropicError('Streaming is strongly recommended for operations that may take longer than 10 minutes. ' +\n 'See https://github.com/anthropics/anthropic-sdk-python#streaming-responses for more details');\n }\n return defaultTimeout * 1000;\n }\n /**\n * Used as a callback for mutating the given `FinalRequestOptions` object.\n */\n async prepareOptions(options) { }\n /**\n * Used as a callback for mutating the given `RequestInit` object.\n *\n * This is useful for cases where you want to add certain headers based off of\n * the request properties, e.g. `method` or `url`.\n */\n async prepareRequest(request, { url, options }) { }\n get(path, opts) {\n return this.methodRequest('get', path, opts);\n }\n post(path, opts) {\n return this.methodRequest('post', path, opts);\n }\n patch(path, opts) {\n return this.methodRequest('patch', path, opts);\n }\n put(path, opts) {\n return this.methodRequest('put', path, opts);\n }\n delete(path, opts) {\n return this.methodRequest('delete', path, opts);\n }\n methodRequest(method, path, opts) {\n return this.request(Promise.resolve(opts).then((opts) => {\n return { method, path, ...opts };\n }));\n }\n request(options, remainingRetries = null) {\n return new APIPromise(this, this.makeRequest(options, remainingRetries, undefined));\n }\n async makeRequest(optionsInput, retriesRemaining, retryOfRequestLogID) {\n const options = await optionsInput;\n const maxRetries = options.maxRetries ?? this.maxRetries;\n if (retriesRemaining == null) {\n retriesRemaining = maxRetries;\n }\n await this.prepareOptions(options);\n const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });\n await this.prepareRequest(req, { url, options });\n /** Not an API request ID, just for correlating local log entries. */\n const requestLogID = 'log_' + ((Math.random() * (1 << 24)) | 0).toString(16).padStart(6, '0');\n const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`;\n const startTime = Date.now();\n loggerFor(this).debug(`[${requestLogID}] sending request`, formatRequestDetails({\n retryOfRequestLogID,\n method: options.method,\n url,\n options,\n headers: req.headers,\n }));\n if (options.signal?.aborted) {\n throw new Errors.APIUserAbortError();\n }\n const controller = new AbortController();\n const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);\n const headersTime = Date.now();\n if (response instanceof Error) {\n const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;\n if (options.signal?.aborted) {\n throw new Errors.APIUserAbortError();\n }\n // detect native connection timeout errors\n // deno throws \"TypeError: error sending request for url (https://example/): client error (Connect): tcp connect error: Operation timed out (os error 60): Operation timed out (os error 60)\"\n // undici throws \"TypeError: fetch failed\" with cause \"ConnectTimeoutError: Connect Timeout Error (attempted address: example:443, timeout: 1ms)\"\n // others do not provide enough information to distinguish timeouts from other connection errors\n const isTimeout = isAbortError(response) ||\n /timed? ?out/i.test(String(response) + ('cause' in response ? String(response.cause) : ''));\n if (retriesRemaining) {\n loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - ${retryMessage}`);\n loggerFor(this).debug(`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (${retryMessage})`, formatRequestDetails({\n retryOfRequestLogID,\n url,\n durationMs: headersTime - startTime,\n message: response.message,\n }));\n return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID);\n }\n loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - error; no more retries left`);\n loggerFor(this).debug(`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (error; no more retries left)`, formatRequestDetails({\n retryOfRequestLogID,\n url,\n durationMs: headersTime - startTime,\n message: response.message,\n }));\n if (isTimeout) {\n throw new Errors.APIConnectionTimeoutError();\n }\n throw new Errors.APIConnectionError({ cause: response });\n }\n const specialHeaders = [...response.headers.entries()]\n .filter(([name]) => name === 'request-id')\n .map(([name, value]) => ', ' + name + ': ' + JSON.stringify(value))\n .join('');\n const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url} ${response.ok ? 'succeeded' : 'failed'} with status ${response.status} in ${headersTime - startTime}ms`;\n if (!response.ok) {\n const shouldRetry = this.shouldRetry(response);\n if (retriesRemaining && shouldRetry) {\n const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;\n // We don't need the body of this response.\n await Shims.CancelReadableStream(response.body);\n loggerFor(this).info(`${responseInfo} - ${retryMessage}`);\n loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails({\n retryOfRequestLogID,\n url: response.url,\n status: response.status,\n headers: response.headers,\n durationMs: headersTime - startTime,\n }));\n return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers);\n }\n const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`;\n loggerFor(this).info(`${responseInfo} - ${retryMessage}`);\n const errText = await response.text().catch((err) => castToError(err).message);\n const errJSON = safeJSON(errText);\n const errMessage = errJSON ? undefined : errText;\n loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails({\n retryOfRequestLogID,\n url: response.url,\n status: response.status,\n headers: response.headers,\n message: errMessage,\n durationMs: Date.now() - startTime,\n }));\n const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers);\n throw err;\n }\n loggerFor(this).info(responseInfo);\n loggerFor(this).debug(`[${requestLogID}] response start`, formatRequestDetails({\n retryOfRequestLogID,\n url: response.url,\n status: response.status,\n headers: response.headers,\n durationMs: headersTime - startTime,\n }));\n return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };\n }\n getAPIList(path, Page, opts) {\n return this.requestAPIList(Page, { method: 'get', path, ...opts });\n }\n requestAPIList(Page, options) {\n const request = this.makeRequest(options, null, undefined);\n return new Pagination.PagePromise(this, request, Page);\n }\n async fetchWithTimeout(url, init, ms, controller) {\n const { signal, method, ...options } = init || {};\n if (signal)\n signal.addEventListener('abort', () => controller.abort());\n const timeout = setTimeout(() => controller.abort(), ms);\n const isReadableBody = (globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream) ||\n (typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);\n const fetchOptions = {\n signal: controller.signal,\n ...(isReadableBody ? { duplex: 'half' } : {}),\n method: 'GET',\n ...options,\n };\n if (method) {\n // Custom methods like 'patch' need to be uppercased\n // See https://github.com/nodejs/undici/issues/2294\n fetchOptions.method = method.toUpperCase();\n }\n try {\n // use undefined this binding; fetch errors if bound to something else in browser/cloudflare\n return await this.fetch.call(undefined, url, fetchOptions);\n }\n finally {\n clearTimeout(timeout);\n }\n }\n shouldRetry(response) {\n // Note this is not a standard header.\n const shouldRetryHeader = response.headers.get('x-should-retry');\n // If the server explicitly says whether or not to retry, obey.\n if (shouldRetryHeader === 'true')\n return true;\n if (shouldRetryHeader === 'false')\n return false;\n // Retry on request timeouts.\n if (response.status === 408)\n return true;\n // Retry on lock timeouts.\n if (response.status === 409)\n return true;\n // Retry on rate limits.\n if (response.status === 429)\n return true;\n // Retry internal errors.\n if (response.status >= 500)\n return true;\n return false;\n }\n async retryRequest(options, retriesRemaining, requestLogID, responseHeaders) {\n let timeoutMillis;\n // Note the `retry-after-ms` header may not be standard, but is a good idea and we'd like proactive support for it.\n const retryAfterMillisHeader = responseHeaders?.get('retry-after-ms');\n if (retryAfterMillisHeader) {\n const timeoutMs = parseFloat(retryAfterMillisHeader);\n if (!Number.isNaN(timeoutMs)) {\n timeoutMillis = timeoutMs;\n }\n }\n // About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After\n const retryAfterHeader = responseHeaders?.get('retry-after');\n if (retryAfterHeader && !timeoutMillis) {\n const timeoutSeconds = parseFloat(retryAfterHeader);\n if (!Number.isNaN(timeoutSeconds)) {\n timeoutMillis = timeoutSeconds * 1000;\n }\n else {\n timeoutMillis = Date.parse(retryAfterHeader) - Date.now();\n }\n }\n // If the API asks us to wait a certain amount of time (and it's a reasonable amount),\n // just do what it says, but otherwise calculate a default\n if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {\n const maxRetries = options.maxRetries ?? this.maxRetries;\n timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);\n }\n await sleep(timeoutMillis);\n return this.makeRequest(options, retriesRemaining - 1, requestLogID);\n }\n calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) {\n const initialRetryDelay = 0.5;\n const maxRetryDelay = 8.0;\n const numRetries = maxRetries - retriesRemaining;\n // Apply exponential backoff, but not more than the max.\n const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay);\n // Apply some jitter, take up to at most 25 percent of the retry time.\n const jitter = 1 - Math.random() * 0.25;\n return sleepSeconds * jitter * 1000;\n }\n calculateNonstreamingTimeout(maxTokens, maxNonstreamingTokens) {\n const maxTime = 60 * 60 * 1000; // 10 minutes\n const defaultTime = 60 * 10 * 1000; // 10 minutes\n const expectedTime = (maxTime * maxTokens) / 128000;\n if (expectedTime > defaultTime || (maxNonstreamingTokens != null && maxTokens > maxNonstreamingTokens)) {\n throw new Errors.AnthropicError('Streaming is strongly recommended for operations that may token longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details');\n }\n return defaultTime;\n }\n buildRequest(inputOptions, { retryCount = 0 } = {}) {\n const options = { ...inputOptions };\n const { method, path, query } = options;\n const url = this.buildURL(path, query);\n if ('timeout' in options)\n validatePositiveInteger('timeout', options.timeout);\n options.timeout = options.timeout ?? this.timeout;\n const { bodyHeaders, body } = this.buildBody({ options });\n const reqHeaders = this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount });\n const req = {\n method,\n headers: reqHeaders,\n ...(options.signal && { signal: options.signal }),\n ...(globalThis.ReadableStream &&\n body instanceof globalThis.ReadableStream && { duplex: 'half' }),\n ...(body && { body }),\n ...(this.fetchOptions ?? {}),\n ...(options.fetchOptions ?? {}),\n };\n return { req, url, timeout: options.timeout };\n }\n buildHeaders({ options, method, bodyHeaders, retryCount, }) {\n let idempotencyHeaders = {};\n if (this.idempotencyHeader && method !== 'get') {\n if (!options.idempotencyKey)\n options.idempotencyKey = this.defaultIdempotencyKey();\n idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;\n }\n const headers = buildHeaders([\n idempotencyHeaders,\n {\n Accept: 'application/json',\n 'User-Agent': this.getUserAgent(),\n 'X-Stainless-Retry-Count': String(retryCount),\n ...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),\n ...getPlatformHeaders(),\n ...(this._options.dangerouslyAllowBrowser ?\n { 'anthropic-dangerous-direct-browser-access': 'true' }\n : undefined),\n 'anthropic-version': '2023-06-01',\n },\n this.authHeaders(options),\n this._options.defaultHeaders,\n bodyHeaders,\n options.headers,\n ]);\n this.validateHeaders(headers);\n return headers.values;\n }\n buildBody({ options: { body, headers: rawHeaders } }) {\n if (!body) {\n return { bodyHeaders: undefined, body: undefined };\n }\n const headers = buildHeaders([rawHeaders]);\n if (\n // Pass raw type verbatim\n ArrayBuffer.isView(body) ||\n body instanceof ArrayBuffer ||\n body instanceof DataView ||\n (typeof body === 'string' &&\n // Preserve legacy string encoding behavior for now\n headers.values.has('content-type')) ||\n // `Blob` is superset of `File`\n body instanceof Blob ||\n // `FormData` -> `multipart/form-data`\n body instanceof FormData ||\n // `URLSearchParams` -> `application/x-www-form-urlencoded`\n body instanceof URLSearchParams ||\n // Send chunked stream (each chunk has own `length`)\n (globalThis.ReadableStream && body instanceof globalThis.ReadableStream)) {\n return { bodyHeaders: undefined, body: body };\n }\n else if (typeof body === 'object' &&\n (Symbol.asyncIterator in body ||\n (Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))) {\n return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body) };\n }\n else {\n return __classPrivateFieldGet(this, _BaseAnthropic_encoder, \"f\").call(this, { body, headers });\n }\n }\n}\n_a = BaseAnthropic, _BaseAnthropic_encoder = new WeakMap();\nBaseAnthropic.Anthropic = _a;\nBaseAnthropic.HUMAN_PROMPT = '\\n\\nHuman:';\nBaseAnthropic.AI_PROMPT = '\\n\\nAssistant:';\nBaseAnthropic.DEFAULT_TIMEOUT = 600000; // 10 minutes\nBaseAnthropic.AnthropicError = Errors.AnthropicError;\nBaseAnthropic.APIError = Errors.APIError;\nBaseAnthropic.APIConnectionError = Errors.APIConnectionError;\nBaseAnthropic.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;\nBaseAnthropic.APIUserAbortError = Errors.APIUserAbortError;\nBaseAnthropic.NotFoundError = Errors.NotFoundError;\nBaseAnthropic.ConflictError = Errors.ConflictError;\nBaseAnthropic.RateLimitError = Errors.RateLimitError;\nBaseAnthropic.BadRequestError = Errors.BadRequestError;\nBaseAnthropic.AuthenticationError = Errors.AuthenticationError;\nBaseAnthropic.InternalServerError = Errors.InternalServerError;\nBaseAnthropic.PermissionDeniedError = Errors.PermissionDeniedError;\nBaseAnthropic.UnprocessableEntityError = Errors.UnprocessableEntityError;\nBaseAnthropic.toFile = Uploads.toFile;\n/**\n * API Client for interfacing with the Anthropic API.\n */\nexport class Anthropic extends BaseAnthropic {\n constructor() {\n super(...arguments);\n this.completions = new API.Completions(this);\n this.messages = new API.Messages(this);\n this.models = new API.Models(this);\n this.beta = new API.Beta(this);\n }\n}\nAnthropic.Completions = Completions;\nAnthropic.Messages = Messages;\nAnthropic.Models = Models;\nAnthropic.Beta = Beta;\nexport const { HUMAN_PROMPT, AI_PROMPT } = Anthropic;\n//# sourceMappingURL=client.mjs.map", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MAX_HASHABLE_LENGTH = exports.INIT = exports.KEY = exports.DIGEST_LENGTH = exports.BLOCK_SIZE = void 0;\n/**\n * @internal\n */\nexports.BLOCK_SIZE = 64;\n/**\n * @internal\n */\nexports.DIGEST_LENGTH = 32;\n/**\n * @internal\n */\nexports.KEY = new Uint32Array([\n 0x428a2f98,\n 0x71374491,\n 0xb5c0fbcf,\n 0xe9b5dba5,\n 0x3956c25b,\n 0x59f111f1,\n 0x923f82a4,\n 0xab1c5ed5,\n 0xd807aa98,\n 0x12835b01,\n 0x243185be,\n 0x550c7dc3,\n 0x72be5d74,\n 0x80deb1fe,\n 0x9bdc06a7,\n 0xc19bf174,\n 0xe49b69c1,\n 0xefbe4786,\n 0x0fc19dc6,\n 0x240ca1cc,\n 0x2de92c6f,\n 0x4a7484aa,\n 0x5cb0a9dc,\n 0x76f988da,\n 0x983e5152,\n 0xa831c66d,\n 0xb00327c8,\n 0xbf597fc7,\n 0xc6e00bf3,\n 0xd5a79147,\n 0x06ca6351,\n 0x14292967,\n 0x27b70a85,\n 0x2e1b2138,\n 0x4d2c6dfc,\n 0x53380d13,\n 0x650a7354,\n 0x766a0abb,\n 0x81c2c92e,\n 0x92722c85,\n 0xa2bfe8a1,\n 0xa81a664b,\n 0xc24b8b70,\n 0xc76c51a3,\n 0xd192e819,\n 0xd6990624,\n 0xf40e3585,\n 0x106aa070,\n 0x19a4c116,\n 0x1e376c08,\n 0x2748774c,\n 0x34b0bcb5,\n 0x391c0cb3,\n 0x4ed8aa4a,\n 0x5b9cca4f,\n 0x682e6ff3,\n 0x748f82ee,\n 0x78a5636f,\n 0x84c87814,\n 0x8cc70208,\n 0x90befffa,\n 0xa4506ceb,\n 0xbef9a3f7,\n 0xc67178f2\n]);\n/**\n * @internal\n */\nexports.INIT = [\n 0x6a09e667,\n 0xbb67ae85,\n 0x3c6ef372,\n 0xa54ff53a,\n 0x510e527f,\n 0x9b05688c,\n 0x1f83d9ab,\n 0x5be0cd19\n];\n/**\n * @internal\n */\nexports.MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1;\n//# sourceMappingURL=constants.js.map", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RawSha256 = void 0;\nvar constants_1 = require(\"./constants\");\n/**\n * @internal\n */\nvar RawSha256 = /** @class */ (function () {\n function RawSha256() {\n this.state = Int32Array.from(constants_1.INIT);\n this.temp = new Int32Array(64);\n this.buffer = new Uint8Array(64);\n this.bufferLength = 0;\n this.bytesHashed = 0;\n /**\n * @internal\n */\n this.finished = false;\n }\n RawSha256.prototype.update = function (data) {\n if (this.finished) {\n throw new Error(\"Attempted to update an already finished hash.\");\n }\n var position = 0;\n var byteLength = data.byteLength;\n this.bytesHashed += byteLength;\n if (this.bytesHashed * 8 > constants_1.MAX_HASHABLE_LENGTH) {\n throw new Error(\"Cannot hash more than 2^53 - 1 bits\");\n }\n while (byteLength > 0) {\n this.buffer[this.bufferLength++] = data[position++];\n byteLength--;\n if (this.bufferLength === constants_1.BLOCK_SIZE) {\n this.hashBuffer();\n this.bufferLength = 0;\n }\n }\n };\n RawSha256.prototype.digest = function () {\n if (!this.finished) {\n var bitsHashed = this.bytesHashed * 8;\n var bufferView = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength);\n var undecoratedLength = this.bufferLength;\n bufferView.setUint8(this.bufferLength++, 0x80);\n // Ensure the final block has enough room for the hashed length\n if (undecoratedLength % constants_1.BLOCK_SIZE >= constants_1.BLOCK_SIZE - 8) {\n for (var i = this.bufferLength; i < constants_1.BLOCK_SIZE; i++) {\n bufferView.setUint8(i, 0);\n }\n this.hashBuffer();\n this.bufferLength = 0;\n }\n for (var i = this.bufferLength; i < constants_1.BLOCK_SIZE - 8; i++) {\n bufferView.setUint8(i, 0);\n }\n bufferView.setUint32(constants_1.BLOCK_SIZE - 8, Math.floor(bitsHashed / 0x100000000), true);\n bufferView.setUint32(constants_1.BLOCK_SIZE - 4, bitsHashed);\n this.hashBuffer();\n this.finished = true;\n }\n // The value in state is little-endian rather than big-endian, so flip\n // each word into a new Uint8Array\n var out = new Uint8Array(constants_1.DIGEST_LENGTH);\n for (var i = 0; i < 8; i++) {\n out[i * 4] = (this.state[i] >>> 24) & 0xff;\n out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff;\n out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff;\n out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff;\n }\n return out;\n };\n RawSha256.prototype.hashBuffer = function () {\n var _a = this, buffer = _a.buffer, state = _a.state;\n var state0 = state[0], state1 = state[1], state2 = state[2], state3 = state[3], state4 = state[4], state5 = state[5], state6 = state[6], state7 = state[7];\n for (var i = 0; i < constants_1.BLOCK_SIZE; i++) {\n if (i < 16) {\n this.temp[i] =\n ((buffer[i * 4] & 0xff) << 24) |\n ((buffer[i * 4 + 1] & 0xff) << 16) |\n ((buffer[i * 4 + 2] & 0xff) << 8) |\n (buffer[i * 4 + 3] & 0xff);\n }\n else {\n var u = this.temp[i - 2];\n var t1_1 = ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10);\n u = this.temp[i - 15];\n var t2_1 = ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3);\n this.temp[i] =\n ((t1_1 + this.temp[i - 7]) | 0) + ((t2_1 + this.temp[i - 16]) | 0);\n }\n var t1 = ((((((state4 >>> 6) | (state4 << 26)) ^\n ((state4 >>> 11) | (state4 << 21)) ^\n ((state4 >>> 25) | (state4 << 7))) +\n ((state4 & state5) ^ (~state4 & state6))) |\n 0) +\n ((state7 + ((constants_1.KEY[i] + this.temp[i]) | 0)) | 0)) |\n 0;\n var t2 = ((((state0 >>> 2) | (state0 << 30)) ^\n ((state0 >>> 13) | (state0 << 19)) ^\n ((state0 >>> 22) | (state0 << 10))) +\n ((state0 & state1) ^ (state0 & state2) ^ (state1 & state2))) |\n 0;\n state7 = state6;\n state6 = state5;\n state5 = state4;\n state4 = (state3 + t1) | 0;\n state3 = state2;\n state2 = state1;\n state1 = state0;\n state0 = (t1 + t2) | 0;\n }\n state[0] += state0;\n state[1] += state1;\n state[2] += state2;\n state[3] += state3;\n state[4] += state4;\n state[5] += state5;\n state[6] += state6;\n state[7] += state7;\n };\n return RawSha256;\n}());\nexports.RawSha256 = RawSha256;\n//# sourceMappingURL=RawSha256.js.map", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sha256 = void 0;\nvar tslib_1 = require(\"tslib\");\nvar constants_1 = require(\"./constants\");\nvar RawSha256_1 = require(\"./RawSha256\");\nvar util_1 = require(\"@aws-crypto/util\");\nvar Sha256 = /** @class */ (function () {\n function Sha256(secret) {\n this.secret = secret;\n this.hash = new RawSha256_1.RawSha256();\n this.reset();\n }\n Sha256.prototype.update = function (toHash) {\n if ((0, util_1.isEmptyData)(toHash) || this.error) {\n return;\n }\n try {\n this.hash.update((0, util_1.convertToBuffer)(toHash));\n }\n catch (e) {\n this.error = e;\n }\n };\n /* This synchronous method keeps compatibility\n * with the v2 aws-sdk.\n */\n Sha256.prototype.digestSync = function () {\n if (this.error) {\n throw this.error;\n }\n if (this.outer) {\n if (!this.outer.finished) {\n this.outer.update(this.hash.digest());\n }\n return this.outer.digest();\n }\n return this.hash.digest();\n };\n /* The underlying digest method here is synchronous.\n * To keep the same interface with the other hash functions\n * the default is to expose this as an async method.\n * However, it can sometimes be useful to have a sync method.\n */\n Sha256.prototype.digest = function () {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n return tslib_1.__generator(this, function (_a) {\n return [2 /*return*/, this.digestSync()];\n });\n });\n };\n Sha256.prototype.reset = function () {\n this.hash = new RawSha256_1.RawSha256();\n if (this.secret) {\n this.outer = new RawSha256_1.RawSha256();\n var inner = bufferFromSecret(this.secret);\n var outer = new Uint8Array(constants_1.BLOCK_SIZE);\n outer.set(inner);\n for (var i = 0; i < constants_1.BLOCK_SIZE; i++) {\n inner[i] ^= 0x36;\n outer[i] ^= 0x5c;\n }\n this.hash.update(inner);\n this.outer.update(outer);\n // overwrite the copied key in memory\n for (var i = 0; i < inner.byteLength; i++) {\n inner[i] = 0;\n }\n }\n };\n return Sha256;\n}());\nexports.Sha256 = Sha256;\nfunction bufferFromSecret(secret) {\n var input = (0, util_1.convertToBuffer)(secret);\n if (input.byteLength > constants_1.BLOCK_SIZE) {\n var bufferHash = new RawSha256_1.RawSha256();\n bufferHash.update(input);\n input = bufferHash.digest();\n }\n var buffer = new Uint8Array(constants_1.BLOCK_SIZE);\n buffer.set(input);\n return buffer;\n}\n//# sourceMappingURL=jsSha256.js.map", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./jsSha256\"), exports);\n//# sourceMappingURL=index.js.map", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.propertyProviderChain = exports.createCredentialChain = void 0;\nconst property_provider_1 = require(\"@smithy/property-provider\");\nconst createCredentialChain = (...credentialProviders) => {\n let expireAfter = -1;\n const baseFunction = async (awsIdentityProperties) => {\n const credentials = await (0, exports.propertyProviderChain)(...credentialProviders)(awsIdentityProperties);\n if (!credentials.expiration && expireAfter !== -1) {\n credentials.expiration = new Date(Date.now() + expireAfter);\n }\n return credentials;\n };\n const withOptions = Object.assign(baseFunction, {\n expireAfter(milliseconds) {\n if (milliseconds < 5 * 60_000) {\n throw new Error(\"@aws-sdk/credential-providers - createCredentialChain(...).expireAfter(ms) may not be called with a duration lower than five minutes.\");\n }\n expireAfter = milliseconds;\n return withOptions;\n },\n });\n return withOptions;\n};\nexports.createCredentialChain = createCredentialChain;\nconst propertyProviderChain = (...providers) => async (awsIdentityProperties) => {\n if (providers.length === 0) {\n throw new property_provider_1.ProviderError(\"No providers in chain\", { tryNextLink: false });\n }\n let lastProviderError;\n for (const provider of providers) {\n try {\n return await provider(awsIdentityProperties);\n }\n catch (err) {\n lastProviderError = err;\n if (err?.tryNextLink) {\n continue;\n }\n throw err;\n }\n }\n throw lastProviderError;\n};\nexports.propertyProviderChain = propertyProviderChain;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultCognitoIdentityHttpAuthSchemeProvider = exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultCognitoIdentityHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = defaultCognitoIdentityHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"cognito-identity\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultCognitoIdentityHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"GetCredentialsForIdentity\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n case \"GetId\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n case \"GetOpenIdToken\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n case \"UnlinkIdentity\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultCognitoIdentityHttpAuthSchemeProvider = defaultCognitoIdentityHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst w = \"required\", x = \"fn\", y = \"argv\", z = \"ref\";\nconst a = true, b = \"isSet\", c = \"booleanEquals\", d = \"error\", e = \"endpoint\", f = \"tree\", g = \"PartitionResult\", h = \"getAttr\", i = \"stringEquals\", j = { [w]: false, \"type\": \"string\" }, k = { [w]: true, \"default\": false, \"type\": \"boolean\" }, l = { [z]: \"Endpoint\" }, m = { [x]: c, [y]: [{ [z]: \"UseFIPS\" }, true] }, n = { [x]: c, [y]: [{ [z]: \"UseDualStack\" }, true] }, o = {}, p = { [z]: \"Region\" }, q = { [x]: h, [y]: [{ [z]: g }, \"supportsFIPS\"] }, r = { [z]: g }, s = { [x]: c, [y]: [true, { [x]: h, [y]: [r, \"supportsDualStack\"] }] }, t = [m], u = [n], v = [p];\nconst _data = { version: \"1.0\", parameters: { Region: j, UseDualStack: k, UseFIPS: k, Endpoint: j }, rules: [{ conditions: [{ [x]: b, [y]: [l] }], rules: [{ conditions: t, error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", type: d }, { conditions: u, error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", type: d }, { endpoint: { url: l, properties: o, headers: o }, type: e }], type: f }, { conditions: [{ [x]: b, [y]: v }], rules: [{ conditions: [{ [x]: \"aws.partition\", [y]: v, assign: g }], rules: [{ conditions: [m, n], rules: [{ conditions: [{ [x]: c, [y]: [a, q] }, s], rules: [{ conditions: [{ [x]: i, [y]: [p, \"us-east-1\"] }], endpoint: { url: \"https://cognito-identity-fips.us-east-1.amazonaws.com\", properties: o, headers: o }, type: e }, { conditions: [{ [x]: i, [y]: [p, \"us-east-2\"] }], endpoint: { url: \"https://cognito-identity-fips.us-east-2.amazonaws.com\", properties: o, headers: o }, type: e }, { conditions: [{ [x]: i, [y]: [p, \"us-west-1\"] }], endpoint: { url: \"https://cognito-identity-fips.us-west-1.amazonaws.com\", properties: o, headers: o }, type: e }, { conditions: [{ [x]: i, [y]: [p, \"us-west-2\"] }], endpoint: { url: \"https://cognito-identity-fips.us-west-2.amazonaws.com\", properties: o, headers: o }, type: e }, { endpoint: { url: \"https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: o, headers: o }, type: e }], type: f }, { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", type: d }], type: f }, { conditions: t, rules: [{ conditions: [{ [x]: c, [y]: [q, a] }], rules: [{ endpoint: { url: \"https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: o, headers: o }, type: e }], type: f }, { error: \"FIPS is enabled but this partition does not support FIPS\", type: d }], type: f }, { conditions: u, rules: [{ conditions: [s], rules: [{ conditions: [{ [x]: i, [y]: [\"aws\", { [x]: h, [y]: [r, \"name\"] }] }], endpoint: { url: \"https://cognito-identity.{Region}.amazonaws.com\", properties: o, headers: o }, type: e }, { endpoint: { url: \"https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: o, headers: o }, type: e }], type: f }, { error: \"DualStack is enabled but this partition does not support DualStack\", type: d }], type: f }, { endpoint: { url: \"https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}\", properties: o, headers: o }, type: e }], type: f }], type: f }, { error: \"Invalid Configuration: Missing Region\", type: d }] };\nexports.ruleSet = _data;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2014-06-30\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultCognitoIdentityHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ??\n new protocols_1.AwsJson1_1Protocol({\n defaultNamespace: \"com.amazonaws.cognitoidentity\",\n serviceTarget: \"AWSCognitoIdentityService\",\n awsQueryCompatible: false,\n }),\n serviceId: config?.serviceId ?? \"Cognito Identity\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst credential_provider_node_1 = require(\"@aws-sdk/credential-provider-node\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n", - "'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"cognito-identity\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass CognitoIdentityClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultCognitoIdentityHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nlet CognitoIdentityServiceException$1 = class CognitoIdentityServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, CognitoIdentityServiceException.prototype);\n }\n};\n\nlet InternalErrorException$1 = class InternalErrorException extends CognitoIdentityServiceException$1 {\n name = \"InternalErrorException\";\n $fault = \"server\";\n constructor(opts) {\n super({\n name: \"InternalErrorException\",\n $fault: \"server\",\n ...opts,\n });\n Object.setPrototypeOf(this, InternalErrorException.prototype);\n }\n};\nlet InvalidParameterException$1 = class InvalidParameterException extends CognitoIdentityServiceException$1 {\n name = \"InvalidParameterException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"InvalidParameterException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidParameterException.prototype);\n }\n};\nlet LimitExceededException$1 = class LimitExceededException extends CognitoIdentityServiceException$1 {\n name = \"LimitExceededException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"LimitExceededException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, LimitExceededException.prototype);\n }\n};\nlet NotAuthorizedException$1 = class NotAuthorizedException extends CognitoIdentityServiceException$1 {\n name = \"NotAuthorizedException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"NotAuthorizedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, NotAuthorizedException.prototype);\n }\n};\nlet ResourceConflictException$1 = class ResourceConflictException extends CognitoIdentityServiceException$1 {\n name = \"ResourceConflictException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ResourceConflictException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ResourceConflictException.prototype);\n }\n};\nlet TooManyRequestsException$1 = class TooManyRequestsException extends CognitoIdentityServiceException$1 {\n name = \"TooManyRequestsException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"TooManyRequestsException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, TooManyRequestsException.prototype);\n }\n};\nlet ResourceNotFoundException$1 = class ResourceNotFoundException extends CognitoIdentityServiceException$1 {\n name = \"ResourceNotFoundException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ResourceNotFoundException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ResourceNotFoundException.prototype);\n }\n};\nlet ExternalServiceException$1 = class ExternalServiceException extends CognitoIdentityServiceException$1 {\n name = \"ExternalServiceException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ExternalServiceException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ExternalServiceException.prototype);\n }\n};\nlet InvalidIdentityPoolConfigurationException$1 = class InvalidIdentityPoolConfigurationException extends CognitoIdentityServiceException$1 {\n name = \"InvalidIdentityPoolConfigurationException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"InvalidIdentityPoolConfigurationException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, InvalidIdentityPoolConfigurationException.prototype);\n }\n};\nlet DeveloperUserAlreadyRegisteredException$1 = class DeveloperUserAlreadyRegisteredException extends CognitoIdentityServiceException$1 {\n name = \"DeveloperUserAlreadyRegisteredException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"DeveloperUserAlreadyRegisteredException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, DeveloperUserAlreadyRegisteredException.prototype);\n }\n};\nlet ConcurrentModificationException$1 = class ConcurrentModificationException extends CognitoIdentityServiceException$1 {\n name = \"ConcurrentModificationException\";\n $fault = \"client\";\n constructor(opts) {\n super({\n name: \"ConcurrentModificationException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ConcurrentModificationException.prototype);\n }\n};\n\nconst _ACF = \"AllowClassicFlow\";\nconst _AI = \"AccountId\";\nconst _AKI = \"AccessKeyId\";\nconst _ARR = \"AmbiguousRoleResolution\";\nconst _AUI = \"AllowUnauthenticatedIdentities\";\nconst _C = \"Credentials\";\nconst _CD = \"CreationDate\";\nconst _CI = \"ClientId\";\nconst _CIP = \"CognitoIdentityProvider\";\nconst _CIPI = \"CreateIdentityPoolInput\";\nconst _CIPL = \"CognitoIdentityProviderList\";\nconst _CIPo = \"CognitoIdentityProviders\";\nconst _CIPr = \"CreateIdentityPool\";\nconst _CME = \"ConcurrentModificationException\";\nconst _CRA = \"CustomRoleArn\";\nconst _Cl = \"Claim\";\nconst _DI = \"DeleteIdentities\";\nconst _DII = \"DeleteIdentitiesInput\";\nconst _DIIe = \"DescribeIdentityInput\";\nconst _DIP = \"DeleteIdentityPool\";\nconst _DIPI = \"DeleteIdentityPoolInput\";\nconst _DIPIe = \"DescribeIdentityPoolInput\";\nconst _DIPe = \"DescribeIdentityPool\";\nconst _DIR = \"DeleteIdentitiesResponse\";\nconst _DIe = \"DescribeIdentity\";\nconst _DPN = \"DeveloperProviderName\";\nconst _DUARE = \"DeveloperUserAlreadyRegisteredException\";\nconst _DUI = \"DeveloperUserIdentifier\";\nconst _DUIL = \"DeveloperUserIdentifierList\";\nconst _DUIe = \"DestinationUserIdentifier\";\nconst _E = \"Expiration\";\nconst _EC = \"ErrorCode\";\nconst _ESE = \"ExternalServiceException\";\nconst _GCFI = \"GetCredentialsForIdentity\";\nconst _GCFII = \"GetCredentialsForIdentityInput\";\nconst _GCFIR = \"GetCredentialsForIdentityResponse\";\nconst _GI = \"GetId\";\nconst _GII = \"GetIdInput\";\nconst _GIPR = \"GetIdentityPoolRoles\";\nconst _GIPRI = \"GetIdentityPoolRolesInput\";\nconst _GIPRR = \"GetIdentityPoolRolesResponse\";\nconst _GIR = \"GetIdResponse\";\nconst _GOIT = \"GetOpenIdToken\";\nconst _GOITFDI = \"GetOpenIdTokenForDeveloperIdentity\";\nconst _GOITFDII = \"GetOpenIdTokenForDeveloperIdentityInput\";\nconst _GOITFDIR = \"GetOpenIdTokenForDeveloperIdentityResponse\";\nconst _GOITI = \"GetOpenIdTokenInput\";\nconst _GOITR = \"GetOpenIdTokenResponse\";\nconst _GPTAM = \"GetPrincipalTagAttributeMap\";\nconst _GPTAMI = \"GetPrincipalTagAttributeMapInput\";\nconst _GPTAMR = \"GetPrincipalTagAttributeMapResponse\";\nconst _HD = \"HideDisabled\";\nconst _I = \"Identities\";\nconst _ID = \"IdentityDescription\";\nconst _IEE = \"InternalErrorException\";\nconst _II = \"IdentityId\";\nconst _IIPCE = \"InvalidIdentityPoolConfigurationException\";\nconst _IITD = \"IdentityIdsToDelete\";\nconst _IL = \"IdentitiesList\";\nconst _IP = \"IdentityPool\";\nconst _IPE = \"InvalidParameterException\";\nconst _IPI = \"IdentityPoolId\";\nconst _IPL = \"IdentityPoolsList\";\nconst _IPN = \"IdentityPoolName\";\nconst _IPNd = \"IdentityProviderName\";\nconst _IPSD = \"IdentityPoolShortDescription\";\nconst _IPT = \"IdentityProviderToken\";\nconst _IPTd = \"IdentityPoolTags\";\nconst _IPd = \"IdentityPools\";\nconst _L = \"Logins\";\nconst _LDI = \"LookupDeveloperIdentity\";\nconst _LDII = \"LookupDeveloperIdentityInput\";\nconst _LDIR = \"LookupDeveloperIdentityResponse\";\nconst _LEE = \"LimitExceededException\";\nconst _LI = \"ListIdentities\";\nconst _LII = \"ListIdentitiesInput\";\nconst _LIP = \"ListIdentityPools\";\nconst _LIPI = \"ListIdentityPoolsInput\";\nconst _LIPR = \"ListIdentityPoolsResponse\";\nconst _LIR = \"ListIdentitiesResponse\";\nconst _LM = \"LoginsMap\";\nconst _LMD = \"LastModifiedDate\";\nconst _LTFR = \"ListTagsForResource\";\nconst _LTFRI = \"ListTagsForResourceInput\";\nconst _LTFRR = \"ListTagsForResourceResponse\";\nconst _LTR = \"LoginsToRemove\";\nconst _MDI = \"MergeDeveloperIdentities\";\nconst _MDII = \"MergeDeveloperIdentitiesInput\";\nconst _MDIR = \"MergeDeveloperIdentitiesResponse\";\nconst _MR = \"MaxResults\";\nconst _MRL = \"MappingRulesList\";\nconst _MRa = \"MappingRule\";\nconst _MT = \"MatchType\";\nconst _NAE = \"NotAuthorizedException\";\nconst _NT = \"NextToken\";\nconst _OICPARN = \"OpenIdConnectProviderARNs\";\nconst _OIDCT = \"OIDCToken\";\nconst _PN = \"ProviderName\";\nconst _PT = \"PrincipalTags\";\nconst _R = \"Roles\";\nconst _RA = \"ResourceArn\";\nconst _RARN = \"RoleARN\";\nconst _RC = \"RulesConfiguration\";\nconst _RCE = \"ResourceConflictException\";\nconst _RCT = \"RulesConfigurationType\";\nconst _RM = \"RoleMappings\";\nconst _RMM = \"RoleMappingMap\";\nconst _RMo = \"RoleMapping\";\nconst _RNFE = \"ResourceNotFoundException\";\nconst _Ru = \"Rules\";\nconst _SIPR = \"SetIdentityPoolRoles\";\nconst _SIPRI = \"SetIdentityPoolRolesInput\";\nconst _SK = \"SecretKey\";\nconst _SKS = \"SecretKeyString\";\nconst _SLP = \"SupportedLoginProviders\";\nconst _SPARN = \"SamlProviderARNs\";\nconst _SPTAM = \"SetPrincipalTagAttributeMap\";\nconst _SPTAMI = \"SetPrincipalTagAttributeMapInput\";\nconst _SPTAMR = \"SetPrincipalTagAttributeMapResponse\";\nconst _SSTC = \"ServerSideTokenCheck\";\nconst _ST = \"SessionToken\";\nconst _SUI = \"SourceUserIdentifier\";\nconst _T = \"Token\";\nconst _TD = \"TokenDuration\";\nconst _TK = \"TagKeys\";\nconst _TMRE = \"TooManyRequestsException\";\nconst _TR = \"TagResource\";\nconst _TRI = \"TagResourceInput\";\nconst _TRR = \"TagResourceResponse\";\nconst _Ta = \"Tags\";\nconst _Ty = \"Type\";\nconst _UD = \"UseDefaults\";\nconst _UDI = \"UnlinkDeveloperIdentity\";\nconst _UDII = \"UnlinkDeveloperIdentityInput\";\nconst _UI = \"UnlinkIdentity\";\nconst _UII = \"UnprocessedIdentityIds\";\nconst _UIIL = \"UnprocessedIdentityIdList\";\nconst _UIIn = \"UnlinkIdentityInput\";\nconst _UIInp = \"UnprocessedIdentityId\";\nconst _UIP = \"UpdateIdentityPool\";\nconst _UR = \"UntagResource\";\nconst _URI = \"UntagResourceInput\";\nconst _URR = \"UntagResourceResponse\";\nconst _V = \"Value\";\nconst _c = \"client\";\nconst _e = \"error\";\nconst _hE = \"httpError\";\nconst _m = \"message\";\nconst _s = \"server\";\nconst _sm = \"smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity\";\nconst n0 = \"com.amazonaws.cognitoidentity\";\nvar IdentityProviderToken = [0, n0, _IPT, 8, 0];\nvar OIDCToken = [0, n0, _OIDCT, 8, 0];\nvar SecretKeyString = [0, n0, _SKS, 8, 0];\nvar CognitoIdentityProvider = [3, n0, _CIP, 0, [_PN, _CI, _SSTC], [0, 0, 2]];\nvar ConcurrentModificationException = [\n -3,\n n0,\n _CME,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ConcurrentModificationException, ConcurrentModificationException$1);\nvar CreateIdentityPoolInput = [\n 3,\n n0,\n _CIPI,\n 0,\n [_IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPTd],\n [0, 2, 2, 128 | 0, 0, 64 | 0, () => CognitoIdentityProviderList, 64 | 0, 128 | 0],\n];\nvar Credentials = [\n 3,\n n0,\n _C,\n 0,\n [_AKI, _SK, _ST, _E],\n [0, [() => SecretKeyString, 0], 0, 4],\n];\nvar DeleteIdentitiesInput = [3, n0, _DII, 0, [_IITD], [64 | 0]];\nvar DeleteIdentitiesResponse = [\n 3,\n n0,\n _DIR,\n 0,\n [_UII],\n [() => UnprocessedIdentityIdList],\n];\nvar DeleteIdentityPoolInput = [3, n0, _DIPI, 0, [_IPI], [0]];\nvar DescribeIdentityInput = [3, n0, _DIIe, 0, [_II], [0]];\nvar DescribeIdentityPoolInput = [3, n0, _DIPIe, 0, [_IPI], [0]];\nvar DeveloperUserAlreadyRegisteredException = [\n -3,\n n0,\n _DUARE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(DeveloperUserAlreadyRegisteredException, DeveloperUserAlreadyRegisteredException$1);\nvar ExternalServiceException = [\n -3,\n n0,\n _ESE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ExternalServiceException, ExternalServiceException$1);\nvar GetCredentialsForIdentityInput = [\n 3,\n n0,\n _GCFII,\n 0,\n [_II, _L, _CRA],\n [0, [() => LoginsMap, 0], 0],\n];\nvar GetCredentialsForIdentityResponse = [\n 3,\n n0,\n _GCFIR,\n 0,\n [_II, _C],\n [0, [() => Credentials, 0]],\n];\nvar GetIdentityPoolRolesInput = [3, n0, _GIPRI, 0, [_IPI], [0]];\nvar GetIdentityPoolRolesResponse = [\n 3,\n n0,\n _GIPRR,\n 0,\n [_IPI, _R, _RM],\n [0, 128 | 0, () => RoleMappingMap],\n];\nvar GetIdInput = [3, n0, _GII, 0, [_AI, _IPI, _L], [0, 0, [() => LoginsMap, 0]]];\nvar GetIdResponse = [3, n0, _GIR, 0, [_II], [0]];\nvar GetOpenIdTokenForDeveloperIdentityInput = [\n 3,\n n0,\n _GOITFDII,\n 0,\n [_IPI, _II, _L, _PT, _TD],\n [0, 0, [() => LoginsMap, 0], 128 | 0, 1],\n];\nvar GetOpenIdTokenForDeveloperIdentityResponse = [\n 3,\n n0,\n _GOITFDIR,\n 0,\n [_II, _T],\n [0, [() => OIDCToken, 0]],\n];\nvar GetOpenIdTokenInput = [3, n0, _GOITI, 0, [_II, _L], [0, [() => LoginsMap, 0]]];\nvar GetOpenIdTokenResponse = [3, n0, _GOITR, 0, [_II, _T], [0, [() => OIDCToken, 0]]];\nvar GetPrincipalTagAttributeMapInput = [3, n0, _GPTAMI, 0, [_IPI, _IPNd], [0, 0]];\nvar GetPrincipalTagAttributeMapResponse = [\n 3,\n n0,\n _GPTAMR,\n 0,\n [_IPI, _IPNd, _UD, _PT],\n [0, 0, 2, 128 | 0],\n];\nvar IdentityDescription = [3, n0, _ID, 0, [_II, _L, _CD, _LMD], [0, 64 | 0, 4, 4]];\nvar IdentityPool = [\n 3,\n n0,\n _IP,\n 0,\n [_IPI, _IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPTd],\n [0, 0, 2, 2, 128 | 0, 0, 64 | 0, () => CognitoIdentityProviderList, 64 | 0, 128 | 0],\n];\nvar IdentityPoolShortDescription = [3, n0, _IPSD, 0, [_IPI, _IPN], [0, 0]];\nvar InternalErrorException = [\n -3,\n n0,\n _IEE,\n {\n [_e]: _s,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InternalErrorException, InternalErrorException$1);\nvar InvalidIdentityPoolConfigurationException = [\n -3,\n n0,\n _IIPCE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidIdentityPoolConfigurationException, InvalidIdentityPoolConfigurationException$1);\nvar InvalidParameterException = [\n -3,\n n0,\n _IPE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(InvalidParameterException, InvalidParameterException$1);\nvar LimitExceededException = [\n -3,\n n0,\n _LEE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(LimitExceededException, LimitExceededException$1);\nvar ListIdentitiesInput = [3, n0, _LII, 0, [_IPI, _MR, _NT, _HD], [0, 1, 0, 2]];\nvar ListIdentitiesResponse = [\n 3,\n n0,\n _LIR,\n 0,\n [_IPI, _I, _NT],\n [0, () => IdentitiesList, 0],\n];\nvar ListIdentityPoolsInput = [3, n0, _LIPI, 0, [_MR, _NT], [1, 0]];\nvar ListIdentityPoolsResponse = [\n 3,\n n0,\n _LIPR,\n 0,\n [_IPd, _NT],\n [() => IdentityPoolsList, 0],\n];\nvar ListTagsForResourceInput = [3, n0, _LTFRI, 0, [_RA], [0]];\nvar ListTagsForResourceResponse = [3, n0, _LTFRR, 0, [_Ta], [128 | 0]];\nvar LookupDeveloperIdentityInput = [\n 3,\n n0,\n _LDII,\n 0,\n [_IPI, _II, _DUI, _MR, _NT],\n [0, 0, 0, 1, 0],\n];\nvar LookupDeveloperIdentityResponse = [\n 3,\n n0,\n _LDIR,\n 0,\n [_II, _DUIL, _NT],\n [0, 64 | 0, 0],\n];\nvar MappingRule = [3, n0, _MRa, 0, [_Cl, _MT, _V, _RARN], [0, 0, 0, 0]];\nvar MergeDeveloperIdentitiesInput = [\n 3,\n n0,\n _MDII,\n 0,\n [_SUI, _DUIe, _DPN, _IPI],\n [0, 0, 0, 0],\n];\nvar MergeDeveloperIdentitiesResponse = [3, n0, _MDIR, 0, [_II], [0]];\nvar NotAuthorizedException = [\n -3,\n n0,\n _NAE,\n {\n [_e]: _c,\n [_hE]: 403,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(NotAuthorizedException, NotAuthorizedException$1);\nvar ResourceConflictException = [\n -3,\n n0,\n _RCE,\n {\n [_e]: _c,\n [_hE]: 409,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ResourceConflictException, ResourceConflictException$1);\nvar ResourceNotFoundException = [\n -3,\n n0,\n _RNFE,\n {\n [_e]: _c,\n [_hE]: 404,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1);\nvar RoleMapping = [\n 3,\n n0,\n _RMo,\n 0,\n [_Ty, _ARR, _RC],\n [0, 0, () => RulesConfigurationType],\n];\nvar RulesConfigurationType = [3, n0, _RCT, 0, [_Ru], [() => MappingRulesList]];\nvar SetIdentityPoolRolesInput = [\n 3,\n n0,\n _SIPRI,\n 0,\n [_IPI, _R, _RM],\n [0, 128 | 0, () => RoleMappingMap],\n];\nvar SetPrincipalTagAttributeMapInput = [\n 3,\n n0,\n _SPTAMI,\n 0,\n [_IPI, _IPNd, _UD, _PT],\n [0, 0, 2, 128 | 0],\n];\nvar SetPrincipalTagAttributeMapResponse = [\n 3,\n n0,\n _SPTAMR,\n 0,\n [_IPI, _IPNd, _UD, _PT],\n [0, 0, 2, 128 | 0],\n];\nvar TagResourceInput = [3, n0, _TRI, 0, [_RA, _Ta], [0, 128 | 0]];\nvar TagResourceResponse = [3, n0, _TRR, 0, [], []];\nvar TooManyRequestsException = [\n -3,\n n0,\n _TMRE,\n {\n [_e]: _c,\n [_hE]: 429,\n },\n [_m],\n [0],\n];\nschema.TypeRegistry.for(n0).registerError(TooManyRequestsException, TooManyRequestsException$1);\nvar UnlinkDeveloperIdentityInput = [\n 3,\n n0,\n _UDII,\n 0,\n [_II, _IPI, _DPN, _DUI],\n [0, 0, 0, 0],\n];\nvar UnlinkIdentityInput = [\n 3,\n n0,\n _UIIn,\n 0,\n [_II, _L, _LTR],\n [0, [() => LoginsMap, 0], 64 | 0],\n];\nvar UnprocessedIdentityId = [3, n0, _UIInp, 0, [_II, _EC], [0, 0]];\nvar UntagResourceInput = [3, n0, _URI, 0, [_RA, _TK], [0, 64 | 0]];\nvar UntagResourceResponse = [3, n0, _URR, 0, [], []];\nvar __Unit = \"unit\";\nvar CognitoIdentityServiceException = [-3, _sm, \"CognitoIdentityServiceException\", 0, [], []];\nschema.TypeRegistry.for(_sm).registerError(CognitoIdentityServiceException, CognitoIdentityServiceException$1);\nvar CognitoIdentityProviderList = [1, n0, _CIPL, 0, () => CognitoIdentityProvider];\nvar IdentitiesList = [1, n0, _IL, 0, () => IdentityDescription];\nvar IdentityPoolsList = [1, n0, _IPL, 0, () => IdentityPoolShortDescription];\nvar MappingRulesList = [1, n0, _MRL, 0, () => MappingRule];\nvar UnprocessedIdentityIdList = [1, n0, _UIIL, 0, () => UnprocessedIdentityId];\nvar LoginsMap = [2, n0, _LM, 0, [0, 0], [() => IdentityProviderToken, 0]];\nvar RoleMappingMap = [2, n0, _RMM, 0, 0, () => RoleMapping];\nvar CreateIdentityPool = [\n 9,\n n0,\n _CIPr,\n 0,\n () => CreateIdentityPoolInput,\n () => IdentityPool,\n];\nvar DeleteIdentities = [\n 9,\n n0,\n _DI,\n 0,\n () => DeleteIdentitiesInput,\n () => DeleteIdentitiesResponse,\n];\nvar DeleteIdentityPool = [9, n0, _DIP, 0, () => DeleteIdentityPoolInput, () => __Unit];\nvar DescribeIdentity = [\n 9,\n n0,\n _DIe,\n 0,\n () => DescribeIdentityInput,\n () => IdentityDescription,\n];\nvar DescribeIdentityPool = [\n 9,\n n0,\n _DIPe,\n 0,\n () => DescribeIdentityPoolInput,\n () => IdentityPool,\n];\nvar GetCredentialsForIdentity = [\n 9,\n n0,\n _GCFI,\n 0,\n () => GetCredentialsForIdentityInput,\n () => GetCredentialsForIdentityResponse,\n];\nvar GetId = [9, n0, _GI, 0, () => GetIdInput, () => GetIdResponse];\nvar GetIdentityPoolRoles = [\n 9,\n n0,\n _GIPR,\n 0,\n () => GetIdentityPoolRolesInput,\n () => GetIdentityPoolRolesResponse,\n];\nvar GetOpenIdToken = [\n 9,\n n0,\n _GOIT,\n 0,\n () => GetOpenIdTokenInput,\n () => GetOpenIdTokenResponse,\n];\nvar GetOpenIdTokenForDeveloperIdentity = [\n 9,\n n0,\n _GOITFDI,\n 0,\n () => GetOpenIdTokenForDeveloperIdentityInput,\n () => GetOpenIdTokenForDeveloperIdentityResponse,\n];\nvar GetPrincipalTagAttributeMap = [\n 9,\n n0,\n _GPTAM,\n 0,\n () => GetPrincipalTagAttributeMapInput,\n () => GetPrincipalTagAttributeMapResponse,\n];\nvar ListIdentities = [\n 9,\n n0,\n _LI,\n 0,\n () => ListIdentitiesInput,\n () => ListIdentitiesResponse,\n];\nvar ListIdentityPools = [\n 9,\n n0,\n _LIP,\n 0,\n () => ListIdentityPoolsInput,\n () => ListIdentityPoolsResponse,\n];\nvar ListTagsForResource = [\n 9,\n n0,\n _LTFR,\n 0,\n () => ListTagsForResourceInput,\n () => ListTagsForResourceResponse,\n];\nvar LookupDeveloperIdentity = [\n 9,\n n0,\n _LDI,\n 0,\n () => LookupDeveloperIdentityInput,\n () => LookupDeveloperIdentityResponse,\n];\nvar MergeDeveloperIdentities = [\n 9,\n n0,\n _MDI,\n 0,\n () => MergeDeveloperIdentitiesInput,\n () => MergeDeveloperIdentitiesResponse,\n];\nvar SetIdentityPoolRoles = [\n 9,\n n0,\n _SIPR,\n 0,\n () => SetIdentityPoolRolesInput,\n () => __Unit,\n];\nvar SetPrincipalTagAttributeMap = [\n 9,\n n0,\n _SPTAM,\n 0,\n () => SetPrincipalTagAttributeMapInput,\n () => SetPrincipalTagAttributeMapResponse,\n];\nvar TagResource = [9, n0, _TR, 0, () => TagResourceInput, () => TagResourceResponse];\nvar UnlinkDeveloperIdentity = [\n 9,\n n0,\n _UDI,\n 0,\n () => UnlinkDeveloperIdentityInput,\n () => __Unit,\n];\nvar UnlinkIdentity = [9, n0, _UI, 0, () => UnlinkIdentityInput, () => __Unit];\nvar UntagResource = [\n 9,\n n0,\n _UR,\n 0,\n () => UntagResourceInput,\n () => UntagResourceResponse,\n];\nvar UpdateIdentityPool = [9, n0, _UIP, 0, () => IdentityPool, () => IdentityPool];\n\nclass CreateIdentityPoolCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"CreateIdentityPool\", {})\n .n(\"CognitoIdentityClient\", \"CreateIdentityPoolCommand\")\n .sc(CreateIdentityPool)\n .build() {\n}\n\nclass DeleteIdentitiesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"DeleteIdentities\", {})\n .n(\"CognitoIdentityClient\", \"DeleteIdentitiesCommand\")\n .sc(DeleteIdentities)\n .build() {\n}\n\nclass DeleteIdentityPoolCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"DeleteIdentityPool\", {})\n .n(\"CognitoIdentityClient\", \"DeleteIdentityPoolCommand\")\n .sc(DeleteIdentityPool)\n .build() {\n}\n\nclass DescribeIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"DescribeIdentity\", {})\n .n(\"CognitoIdentityClient\", \"DescribeIdentityCommand\")\n .sc(DescribeIdentity)\n .build() {\n}\n\nclass DescribeIdentityPoolCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"DescribeIdentityPool\", {})\n .n(\"CognitoIdentityClient\", \"DescribeIdentityPoolCommand\")\n .sc(DescribeIdentityPool)\n .build() {\n}\n\nclass GetCredentialsForIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"GetCredentialsForIdentity\", {})\n .n(\"CognitoIdentityClient\", \"GetCredentialsForIdentityCommand\")\n .sc(GetCredentialsForIdentity)\n .build() {\n}\n\nclass GetIdCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"GetId\", {})\n .n(\"CognitoIdentityClient\", \"GetIdCommand\")\n .sc(GetId)\n .build() {\n}\n\nclass GetIdentityPoolRolesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"GetIdentityPoolRoles\", {})\n .n(\"CognitoIdentityClient\", \"GetIdentityPoolRolesCommand\")\n .sc(GetIdentityPoolRoles)\n .build() {\n}\n\nclass GetOpenIdTokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"GetOpenIdToken\", {})\n .n(\"CognitoIdentityClient\", \"GetOpenIdTokenCommand\")\n .sc(GetOpenIdToken)\n .build() {\n}\n\nclass GetOpenIdTokenForDeveloperIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"GetOpenIdTokenForDeveloperIdentity\", {})\n .n(\"CognitoIdentityClient\", \"GetOpenIdTokenForDeveloperIdentityCommand\")\n .sc(GetOpenIdTokenForDeveloperIdentity)\n .build() {\n}\n\nclass GetPrincipalTagAttributeMapCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"GetPrincipalTagAttributeMap\", {})\n .n(\"CognitoIdentityClient\", \"GetPrincipalTagAttributeMapCommand\")\n .sc(GetPrincipalTagAttributeMap)\n .build() {\n}\n\nclass ListIdentitiesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"ListIdentities\", {})\n .n(\"CognitoIdentityClient\", \"ListIdentitiesCommand\")\n .sc(ListIdentities)\n .build() {\n}\n\nclass ListIdentityPoolsCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"ListIdentityPools\", {})\n .n(\"CognitoIdentityClient\", \"ListIdentityPoolsCommand\")\n .sc(ListIdentityPools)\n .build() {\n}\n\nclass ListTagsForResourceCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"ListTagsForResource\", {})\n .n(\"CognitoIdentityClient\", \"ListTagsForResourceCommand\")\n .sc(ListTagsForResource)\n .build() {\n}\n\nclass LookupDeveloperIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"LookupDeveloperIdentity\", {})\n .n(\"CognitoIdentityClient\", \"LookupDeveloperIdentityCommand\")\n .sc(LookupDeveloperIdentity)\n .build() {\n}\n\nclass MergeDeveloperIdentitiesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"MergeDeveloperIdentities\", {})\n .n(\"CognitoIdentityClient\", \"MergeDeveloperIdentitiesCommand\")\n .sc(MergeDeveloperIdentities)\n .build() {\n}\n\nclass SetIdentityPoolRolesCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"SetIdentityPoolRoles\", {})\n .n(\"CognitoIdentityClient\", \"SetIdentityPoolRolesCommand\")\n .sc(SetIdentityPoolRoles)\n .build() {\n}\n\nclass SetPrincipalTagAttributeMapCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"SetPrincipalTagAttributeMap\", {})\n .n(\"CognitoIdentityClient\", \"SetPrincipalTagAttributeMapCommand\")\n .sc(SetPrincipalTagAttributeMap)\n .build() {\n}\n\nclass TagResourceCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"TagResource\", {})\n .n(\"CognitoIdentityClient\", \"TagResourceCommand\")\n .sc(TagResource)\n .build() {\n}\n\nclass UnlinkDeveloperIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"UnlinkDeveloperIdentity\", {})\n .n(\"CognitoIdentityClient\", \"UnlinkDeveloperIdentityCommand\")\n .sc(UnlinkDeveloperIdentity)\n .build() {\n}\n\nclass UnlinkIdentityCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"UnlinkIdentity\", {})\n .n(\"CognitoIdentityClient\", \"UnlinkIdentityCommand\")\n .sc(UnlinkIdentity)\n .build() {\n}\n\nclass UntagResourceCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"UntagResource\", {})\n .n(\"CognitoIdentityClient\", \"UntagResourceCommand\")\n .sc(UntagResource)\n .build() {\n}\n\nclass UpdateIdentityPoolCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSCognitoIdentityService\", \"UpdateIdentityPool\", {})\n .n(\"CognitoIdentityClient\", \"UpdateIdentityPoolCommand\")\n .sc(UpdateIdentityPool)\n .build() {\n}\n\nconst commands = {\n CreateIdentityPoolCommand,\n DeleteIdentitiesCommand,\n DeleteIdentityPoolCommand,\n DescribeIdentityCommand,\n DescribeIdentityPoolCommand,\n GetCredentialsForIdentityCommand,\n GetIdCommand,\n GetIdentityPoolRolesCommand,\n GetOpenIdTokenCommand,\n GetOpenIdTokenForDeveloperIdentityCommand,\n GetPrincipalTagAttributeMapCommand,\n ListIdentitiesCommand,\n ListIdentityPoolsCommand,\n ListTagsForResourceCommand,\n LookupDeveloperIdentityCommand,\n MergeDeveloperIdentitiesCommand,\n SetIdentityPoolRolesCommand,\n SetPrincipalTagAttributeMapCommand,\n TagResourceCommand,\n UnlinkDeveloperIdentityCommand,\n UnlinkIdentityCommand,\n UntagResourceCommand,\n UpdateIdentityPoolCommand,\n};\nclass CognitoIdentity extends CognitoIdentityClient {\n}\nsmithyClient.createAggregatedClient(commands, CognitoIdentity);\n\nconst paginateListIdentityPools = core.createPaginator(CognitoIdentityClient, ListIdentityPoolsCommand, \"NextToken\", \"NextToken\", \"MaxResults\");\n\nconst AmbiguousRoleResolutionType = {\n AUTHENTICATED_ROLE: \"AuthenticatedRole\",\n DENY: \"Deny\",\n};\nconst ErrorCode = {\n ACCESS_DENIED: \"AccessDenied\",\n INTERNAL_SERVER_ERROR: \"InternalServerError\",\n};\nconst MappingRuleMatchType = {\n CONTAINS: \"Contains\",\n EQUALS: \"Equals\",\n NOT_EQUAL: \"NotEqual\",\n STARTS_WITH: \"StartsWith\",\n};\nconst RoleMappingType = {\n RULES: \"Rules\",\n TOKEN: \"Token\",\n};\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nObject.defineProperty(exports, \"__Client\", {\n enumerable: true,\n get: function () { return smithyClient.Client; }\n});\nexports.AmbiguousRoleResolutionType = AmbiguousRoleResolutionType;\nexports.CognitoIdentity = CognitoIdentity;\nexports.CognitoIdentityClient = CognitoIdentityClient;\nexports.CognitoIdentityServiceException = CognitoIdentityServiceException$1;\nexports.ConcurrentModificationException = ConcurrentModificationException$1;\nexports.CreateIdentityPoolCommand = CreateIdentityPoolCommand;\nexports.DeleteIdentitiesCommand = DeleteIdentitiesCommand;\nexports.DeleteIdentityPoolCommand = DeleteIdentityPoolCommand;\nexports.DescribeIdentityCommand = DescribeIdentityCommand;\nexports.DescribeIdentityPoolCommand = DescribeIdentityPoolCommand;\nexports.DeveloperUserAlreadyRegisteredException = DeveloperUserAlreadyRegisteredException$1;\nexports.ErrorCode = ErrorCode;\nexports.ExternalServiceException = ExternalServiceException$1;\nexports.GetCredentialsForIdentityCommand = GetCredentialsForIdentityCommand;\nexports.GetIdCommand = GetIdCommand;\nexports.GetIdentityPoolRolesCommand = GetIdentityPoolRolesCommand;\nexports.GetOpenIdTokenCommand = GetOpenIdTokenCommand;\nexports.GetOpenIdTokenForDeveloperIdentityCommand = GetOpenIdTokenForDeveloperIdentityCommand;\nexports.GetPrincipalTagAttributeMapCommand = GetPrincipalTagAttributeMapCommand;\nexports.InternalErrorException = InternalErrorException$1;\nexports.InvalidIdentityPoolConfigurationException = InvalidIdentityPoolConfigurationException$1;\nexports.InvalidParameterException = InvalidParameterException$1;\nexports.LimitExceededException = LimitExceededException$1;\nexports.ListIdentitiesCommand = ListIdentitiesCommand;\nexports.ListIdentityPoolsCommand = ListIdentityPoolsCommand;\nexports.ListTagsForResourceCommand = ListTagsForResourceCommand;\nexports.LookupDeveloperIdentityCommand = LookupDeveloperIdentityCommand;\nexports.MappingRuleMatchType = MappingRuleMatchType;\nexports.MergeDeveloperIdentitiesCommand = MergeDeveloperIdentitiesCommand;\nexports.NotAuthorizedException = NotAuthorizedException$1;\nexports.ResourceConflictException = ResourceConflictException$1;\nexports.ResourceNotFoundException = ResourceNotFoundException$1;\nexports.RoleMappingType = RoleMappingType;\nexports.SetIdentityPoolRolesCommand = SetIdentityPoolRolesCommand;\nexports.SetPrincipalTagAttributeMapCommand = SetPrincipalTagAttributeMapCommand;\nexports.TagResourceCommand = TagResourceCommand;\nexports.TooManyRequestsException = TooManyRequestsException$1;\nexports.UnlinkDeveloperIdentityCommand = UnlinkDeveloperIdentityCommand;\nexports.UnlinkIdentityCommand = UnlinkIdentityCommand;\nexports.UntagResourceCommand = UntagResourceCommand;\nexports.UpdateIdentityPoolCommand = UpdateIdentityPoolCommand;\nexports.paginateListIdentityPools = paginateListIdentityPools;\n", - "'use strict';\n\nvar clientCognitoIdentity = require('@aws-sdk/client-cognito-identity');\n\n\n\nObject.defineProperty(exports, \"CognitoIdentityClient\", {\n\tenumerable: true,\n\tget: function () { return clientCognitoIdentity.CognitoIdentityClient; }\n});\nObject.defineProperty(exports, \"GetCredentialsForIdentityCommand\", {\n\tenumerable: true,\n\tget: function () { return clientCognitoIdentity.GetCredentialsForIdentityCommand; }\n});\nObject.defineProperty(exports, \"GetIdCommand\", {\n\tenumerable: true,\n\tget: function () { return clientCognitoIdentity.GetIdCommand; }\n});\n", - "'use strict';\n\nvar propertyProvider = require('@smithy/property-provider');\n\nfunction resolveLogins(logins) {\n return Promise.all(Object.keys(logins).reduce((arr, name) => {\n const tokenOrProvider = logins[name];\n if (typeof tokenOrProvider === \"string\") {\n arr.push([name, tokenOrProvider]);\n }\n else {\n arr.push(tokenOrProvider().then((token) => [name, token]));\n }\n return arr;\n }, [])).then((resolvedPairs) => resolvedPairs.reduce((logins, [key, value]) => {\n logins[key] = value;\n return logins;\n }, {}));\n}\n\nfunction fromCognitoIdentity(parameters) {\n return async (awsIdentityProperties) => {\n parameters.logger?.debug(\"@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity\");\n const { GetCredentialsForIdentityCommand, CognitoIdentityClient } = await Promise.resolve().then(function () { return require('./loadCognitoIdentity-BPNvueUJ.js'); });\n const fromConfigs = (property) => parameters.clientConfig?.[property] ??\n parameters.parentClientConfig?.[property] ??\n awsIdentityProperties?.callerClientConfig?.[property];\n const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters.logger), SessionToken, } = throwOnMissingCredentials(parameters.logger), } = await (parameters.client ??\n new CognitoIdentityClient(Object.assign({}, parameters.clientConfig ?? {}, {\n region: fromConfigs(\"region\"),\n profile: fromConfigs(\"profile\"),\n userAgentAppId: fromConfigs(\"userAgentAppId\"),\n }))).send(new GetCredentialsForIdentityCommand({\n CustomRoleArn: parameters.customRoleArn,\n IdentityId: parameters.identityId,\n Logins: parameters.logins ? await resolveLogins(parameters.logins) : undefined,\n }));\n return {\n identityId: parameters.identityId,\n accessKeyId: AccessKeyId,\n secretAccessKey: SecretKey,\n sessionToken: SessionToken,\n expiration: Expiration,\n };\n };\n}\nfunction throwOnMissingAccessKeyId(logger) {\n throw new propertyProvider.CredentialsProviderError(\"Response from Amazon Cognito contained no access key ID\", { logger });\n}\nfunction throwOnMissingCredentials(logger) {\n throw new propertyProvider.CredentialsProviderError(\"Response from Amazon Cognito contained no credentials\", { logger });\n}\nfunction throwOnMissingSecretKey(logger) {\n throw new propertyProvider.CredentialsProviderError(\"Response from Amazon Cognito contained no secret key\", { logger });\n}\n\nconst STORE_NAME = \"IdentityIds\";\nclass IndexedDbStorage {\n dbName;\n constructor(dbName = \"aws:cognito-identity-ids\") {\n this.dbName = dbName;\n }\n getItem(key) {\n return this.withObjectStore(\"readonly\", (store) => {\n const req = store.get(key);\n return new Promise((resolve) => {\n req.onerror = () => resolve(null);\n req.onsuccess = () => resolve(req.result ? req.result.value : null);\n });\n }).catch(() => null);\n }\n removeItem(key) {\n return this.withObjectStore(\"readwrite\", (store) => {\n const req = store.delete(key);\n return new Promise((resolve, reject) => {\n req.onerror = () => reject(req.error);\n req.onsuccess = () => resolve();\n });\n });\n }\n setItem(id, value) {\n return this.withObjectStore(\"readwrite\", (store) => {\n const req = store.put({ id, value });\n return new Promise((resolve, reject) => {\n req.onerror = () => reject(req.error);\n req.onsuccess = () => resolve();\n });\n });\n }\n getDb() {\n const openDbRequest = self.indexedDB.open(this.dbName, 1);\n return new Promise((resolve, reject) => {\n openDbRequest.onsuccess = () => {\n resolve(openDbRequest.result);\n };\n openDbRequest.onerror = () => {\n reject(openDbRequest.error);\n };\n openDbRequest.onblocked = () => {\n reject(new Error(\"Unable to access DB\"));\n };\n openDbRequest.onupgradeneeded = () => {\n const db = openDbRequest.result;\n db.onerror = () => {\n reject(new Error(\"Failed to create object store\"));\n };\n db.createObjectStore(STORE_NAME, { keyPath: \"id\" });\n };\n });\n }\n withObjectStore(mode, action) {\n return this.getDb().then((db) => {\n const tx = db.transaction(STORE_NAME, mode);\n tx.oncomplete = () => db.close();\n return new Promise((resolve, reject) => {\n tx.onerror = () => reject(tx.error);\n resolve(action(tx.objectStore(STORE_NAME)));\n }).catch((err) => {\n db.close();\n throw err;\n });\n });\n }\n}\n\nclass InMemoryStorage {\n store;\n constructor(store = {}) {\n this.store = store;\n }\n getItem(key) {\n if (key in this.store) {\n return this.store[key];\n }\n return null;\n }\n removeItem(key) {\n delete this.store[key];\n }\n setItem(key, value) {\n this.store[key] = value;\n }\n}\n\nconst inMemoryStorage = new InMemoryStorage();\nfunction localStorage() {\n if (typeof self === \"object\" && self.indexedDB) {\n return new IndexedDbStorage();\n }\n if (typeof window === \"object\" && window.localStorage) {\n return window.localStorage;\n }\n return inMemoryStorage;\n}\n\nfunction fromCognitoIdentityPool({ accountId, cache = localStorage(), client, clientConfig, customRoleArn, identityPoolId, logins, userIdentifier = !logins || Object.keys(logins).length === 0 ? \"ANONYMOUS\" : undefined, logger, parentClientConfig, }) {\n logger?.debug(\"@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity\");\n const cacheKey = userIdentifier\n ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}`\n : undefined;\n let provider = async (awsIdentityProperties) => {\n const { GetIdCommand, CognitoIdentityClient } = await Promise.resolve().then(function () { return require('./loadCognitoIdentity-BPNvueUJ.js'); });\n const fromConfigs = (property) => clientConfig?.[property] ??\n parentClientConfig?.[property] ??\n awsIdentityProperties?.callerClientConfig?.[property];\n const _client = client ??\n new CognitoIdentityClient(Object.assign({}, clientConfig ?? {}, {\n region: fromConfigs(\"region\"),\n profile: fromConfigs(\"profile\"),\n userAgentAppId: fromConfigs(\"userAgentAppId\"),\n }));\n let identityId = (cacheKey && (await cache.getItem(cacheKey)));\n if (!identityId) {\n const { IdentityId = throwOnMissingId(logger) } = await _client.send(new GetIdCommand({\n AccountId: accountId,\n IdentityPoolId: identityPoolId,\n Logins: logins ? await resolveLogins(logins) : undefined,\n }));\n identityId = IdentityId;\n if (cacheKey) {\n Promise.resolve(cache.setItem(cacheKey, identityId)).catch(() => { });\n }\n }\n provider = fromCognitoIdentity({\n client: _client,\n customRoleArn,\n logins,\n identityId,\n });\n return provider(awsIdentityProperties);\n };\n return (awsIdentityProperties) => provider(awsIdentityProperties).catch(async (err) => {\n if (cacheKey) {\n Promise.resolve(cache.removeItem(cacheKey)).catch(() => { });\n }\n throw err;\n });\n}\nfunction throwOnMissingId(logger) {\n throw new propertyProvider.CredentialsProviderError(\"Response from Amazon Cognito contained no identity ID\", { logger });\n}\n\nexports.fromCognitoIdentity = fromCognitoIdentity;\nexports.fromCognitoIdentityPool = fromCognitoIdentityPool;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromCognitoIdentity = void 0;\nconst credential_provider_cognito_identity_1 = require(\"@aws-sdk/credential-provider-cognito-identity\");\nconst fromCognitoIdentity = (options) => (0, credential_provider_cognito_identity_1.fromCognitoIdentity)({\n ...options,\n});\nexports.fromCognitoIdentity = fromCognitoIdentity;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromCognitoIdentityPool = void 0;\nconst credential_provider_cognito_identity_1 = require(\"@aws-sdk/credential-provider-cognito-identity\");\nconst fromCognitoIdentityPool = (options) => (0, credential_provider_cognito_identity_1.fromCognitoIdentityPool)({\n ...options,\n});\nexports.fromCognitoIdentityPool = fromCognitoIdentityPool;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromContainerMetadata = void 0;\nconst credential_provider_imds_1 = require(\"@smithy/credential-provider-imds\");\nconst fromContainerMetadata = (init) => {\n init?.logger?.debug(\"@smithy/credential-provider-imds\", \"fromContainerMetadata\");\n return (0, credential_provider_imds_1.fromContainerMetadata)(init);\n};\nexports.fromContainerMetadata = fromContainerMetadata;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromEnv = void 0;\nconst credential_provider_env_1 = require(\"@aws-sdk/credential-provider-env\");\nconst fromEnv = (init) => (0, credential_provider_env_1.fromEnv)(init);\nexports.fromEnv = fromEnv;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromIni = void 0;\nconst credential_provider_ini_1 = require(\"@aws-sdk/credential-provider-ini\");\nconst fromIni = (init = {}) => (0, credential_provider_ini_1.fromIni)({\n ...init,\n});\nexports.fromIni = fromIni;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromInstanceMetadata = void 0;\nconst client_1 = require(\"@aws-sdk/core/client\");\nconst credential_provider_imds_1 = require(\"@smithy/credential-provider-imds\");\nconst fromInstanceMetadata = (init) => {\n init?.logger?.debug(\"@smithy/credential-provider-imds\", \"fromInstanceMetadata\");\n return async () => (0, credential_provider_imds_1.fromInstanceMetadata)(init)().then((creds) => (0, client_1.setCredentialFeature)(creds, \"CREDENTIALS_IMDS\", \"0\"));\n};\nexports.fromInstanceMetadata = fromInstanceMetadata;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromLoginCredentials = void 0;\nconst credential_provider_login_1 = require(\"@aws-sdk/credential-provider-login\");\nconst fromLoginCredentials = (init) => (0, credential_provider_login_1.fromLoginCredentials)({\n ...init,\n});\nexports.fromLoginCredentials = fromLoginCredentials;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromNodeProviderChain = void 0;\nconst credential_provider_node_1 = require(\"@aws-sdk/credential-provider-node\");\nconst fromNodeProviderChain = (init = {}) => (0, credential_provider_node_1.defaultProvider)({\n ...init,\n});\nexports.fromNodeProviderChain = fromNodeProviderChain;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromProcess = void 0;\nconst credential_provider_process_1 = require(\"@aws-sdk/credential-provider-process\");\nconst fromProcess = (init) => (0, credential_provider_process_1.fromProcess)(init);\nexports.fromProcess = fromProcess;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromSSO = void 0;\nconst credential_provider_sso_1 = require(\"@aws-sdk/credential-provider-sso\");\nconst fromSSO = (init = {}) => {\n return (0, credential_provider_sso_1.fromSSO)({ ...init });\n};\nexports.fromSSO = fromSSO;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.STSClient = exports.AssumeRoleCommand = void 0;\nconst sts_1 = require(\"@aws-sdk/nested-clients/sts\");\nObject.defineProperty(exports, \"AssumeRoleCommand\", { enumerable: true, get: function () { return sts_1.AssumeRoleCommand; } });\nObject.defineProperty(exports, \"STSClient\", { enumerable: true, get: function () { return sts_1.STSClient; } });\n", - "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromTemporaryCredentials = void 0;\nconst core_1 = require(\"@smithy/core\");\nconst property_provider_1 = require(\"@smithy/property-provider\");\nconst ASSUME_ROLE_DEFAULT_REGION = \"us-east-1\";\nconst fromTemporaryCredentials = (options, credentialDefaultProvider, regionProvider) => {\n let stsClient;\n return async (awsIdentityProperties = {}) => {\n const { callerClientConfig } = awsIdentityProperties;\n const profile = options.clientConfig?.profile ?? callerClientConfig?.profile;\n const logger = options.logger ?? callerClientConfig?.logger;\n logger?.debug(\"@aws-sdk/credential-providers - fromTemporaryCredentials (STS)\");\n const params = { ...options.params, RoleSessionName: options.params.RoleSessionName ?? \"aws-sdk-js-\" + Date.now() };\n if (params?.SerialNumber) {\n if (!options.mfaCodeProvider) {\n throw new property_provider_1.CredentialsProviderError(`Temporary credential requires multi-factor authentication, but no MFA code callback was provided.`, {\n tryNextLink: false,\n logger,\n });\n }\n params.TokenCode = await options.mfaCodeProvider(params?.SerialNumber);\n }\n const { AssumeRoleCommand, STSClient } = await Promise.resolve().then(() => __importStar(require(\"./loadSts\")));\n if (!stsClient) {\n const defaultCredentialsOrError = typeof credentialDefaultProvider === \"function\" ? credentialDefaultProvider() : undefined;\n const credentialSources = [\n options.masterCredentials,\n options.clientConfig?.credentials,\n void callerClientConfig?.credentials,\n callerClientConfig?.credentialDefaultProvider?.(),\n defaultCredentialsOrError,\n ];\n let credentialSource = \"STS client default credentials\";\n if (credentialSources[0]) {\n credentialSource = \"options.masterCredentials\";\n }\n else if (credentialSources[1]) {\n credentialSource = \"options.clientConfig.credentials\";\n }\n else if (credentialSources[2]) {\n credentialSource = \"caller client's credentials\";\n throw new Error(\"fromTemporaryCredentials recursion in callerClientConfig.credentials\");\n }\n else if (credentialSources[3]) {\n credentialSource = \"caller client's credentialDefaultProvider\";\n }\n else if (credentialSources[4]) {\n credentialSource = \"AWS SDK default credentials\";\n }\n const regionSources = [\n options.clientConfig?.region,\n callerClientConfig?.region,\n await regionProvider?.({\n profile,\n }),\n ASSUME_ROLE_DEFAULT_REGION,\n ];\n let regionSource = \"default partition's default region\";\n if (regionSources[0]) {\n regionSource = \"options.clientConfig.region\";\n }\n else if (regionSources[1]) {\n regionSource = \"caller client's region\";\n }\n else if (regionSources[2]) {\n regionSource = \"file or env region\";\n }\n const requestHandlerSources = [\n filterRequestHandler(options.clientConfig?.requestHandler),\n filterRequestHandler(callerClientConfig?.requestHandler),\n ];\n let requestHandlerSource = \"STS default requestHandler\";\n if (requestHandlerSources[0]) {\n requestHandlerSource = \"options.clientConfig.requestHandler\";\n }\n else if (requestHandlerSources[1]) {\n requestHandlerSource = \"caller client's requestHandler\";\n }\n logger?.debug?.(`@aws-sdk/credential-providers - fromTemporaryCredentials STS client init with ` +\n `${regionSource}=${await (0, core_1.normalizeProvider)(coalesce(regionSources))()}, ${credentialSource}, ${requestHandlerSource}.`);\n stsClient = new STSClient({\n userAgentAppId: callerClientConfig?.userAgentAppId,\n ...options.clientConfig,\n credentials: coalesce(credentialSources),\n logger,\n profile,\n region: coalesce(regionSources),\n requestHandler: coalesce(requestHandlerSources),\n });\n }\n if (options.clientPlugins) {\n for (const plugin of options.clientPlugins) {\n stsClient.middlewareStack.use(plugin);\n }\n }\n const { Credentials } = await stsClient.send(new AssumeRoleCommand(params));\n if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {\n throw new property_provider_1.CredentialsProviderError(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`, {\n logger,\n });\n }\n return {\n accessKeyId: Credentials.AccessKeyId,\n secretAccessKey: Credentials.SecretAccessKey,\n sessionToken: Credentials.SessionToken,\n expiration: Credentials.Expiration,\n credentialScope: Credentials.CredentialScope,\n };\n };\n};\nexports.fromTemporaryCredentials = fromTemporaryCredentials;\nconst filterRequestHandler = (requestHandler) => {\n return requestHandler?.metadata?.handlerProtocol === \"h2\" ? undefined : requestHandler;\n};\nconst coalesce = (args) => {\n for (const item of args) {\n if (item !== undefined) {\n return item;\n }\n }\n};\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromTemporaryCredentials = void 0;\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst fromNodeProviderChain_1 = require(\"./fromNodeProviderChain\");\nconst fromTemporaryCredentials_base_1 = require(\"./fromTemporaryCredentials.base\");\nconst fromTemporaryCredentials = (options) => {\n return (0, fromTemporaryCredentials_base_1.fromTemporaryCredentials)(options, fromNodeProviderChain_1.fromNodeProviderChain, async ({ profile = process.env.AWS_PROFILE }) => (0, node_config_provider_1.loadConfig)({\n environmentVariableSelector: (env) => env.AWS_REGION,\n configFileSelector: (profileData) => {\n return profileData.region;\n },\n default: () => undefined,\n }, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, profile })());\n};\nexports.fromTemporaryCredentials = fromTemporaryCredentials;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromTokenFile = void 0;\nconst credential_provider_web_identity_1 = require(\"@aws-sdk/credential-provider-web-identity\");\nconst fromTokenFile = (init = {}) => (0, credential_provider_web_identity_1.fromTokenFile)({\n ...init,\n});\nexports.fromTokenFile = fromTokenFile;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromWebToken = void 0;\nconst credential_provider_web_identity_1 = require(\"@aws-sdk/credential-provider-web-identity\");\nconst fromWebToken = (init) => (0, credential_provider_web_identity_1.fromWebToken)({\n ...init,\n});\nexports.fromWebToken = fromWebToken;\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fromHttp = void 0;\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./createCredentialChain\"), exports);\ntslib_1.__exportStar(require(\"./fromCognitoIdentity\"), exports);\ntslib_1.__exportStar(require(\"./fromCognitoIdentityPool\"), exports);\ntslib_1.__exportStar(require(\"./fromContainerMetadata\"), exports);\ntslib_1.__exportStar(require(\"./fromEnv\"), exports);\nvar credential_provider_http_1 = require(\"@aws-sdk/credential-provider-http\");\nObject.defineProperty(exports, \"fromHttp\", { enumerable: true, get: function () { return credential_provider_http_1.fromHttp; } });\ntslib_1.__exportStar(require(\"./fromIni\"), exports);\ntslib_1.__exportStar(require(\"./fromInstanceMetadata\"), exports);\ntslib_1.__exportStar(require(\"./fromLoginCredentials\"), exports);\ntslib_1.__exportStar(require(\"./fromNodeProviderChain\"), exports);\ntslib_1.__exportStar(require(\"./fromProcess\"), exports);\ntslib_1.__exportStar(require(\"./fromSSO\"), exports);\ntslib_1.__exportStar(require(\"./fromTemporaryCredentials\"), exports);\ntslib_1.__exportStar(require(\"./fromTokenFile\"), exports);\ntslib_1.__exportStar(require(\"./fromWebToken\"), exports);\n", - "import { Sha256 } from '@aws-crypto/sha256-js';\nimport { FetchHttpHandler } from '@smithy/fetch-http-handler';\nimport { HttpRequest } from '@smithy/protocol-http';\nimport { SignatureV4 } from '@smithy/signature-v4';\nimport assert from 'assert';\nconst DEFAULT_PROVIDER_CHAIN_RESOLVER = () => import('@aws-sdk/credential-providers').then(({ fromNodeProviderChain }) => fromNodeProviderChain({\n clientConfig: {\n requestHandler: new FetchHttpHandler({\n requestInit: (httpRequest) => {\n return {\n ...httpRequest,\n };\n },\n }),\n },\n}))\n .catch((error) => {\n throw new Error(`Failed to import '@aws-sdk/credential-providers'.` +\n `You can provide a custom \\`providerChainResolver\\` in the client options if your runtime does not have access to '@aws-sdk/credential-providers': ` +\n `\\`new AnthropicBedrock({ providerChainResolver })\\` ` +\n `Original error: ${error.message}`);\n});\nexport const getAuthHeaders = async (req, props) => {\n assert(req.method, 'Expected request method property to be set');\n const providerChain = await (props.providerChainResolver ?\n props.providerChainResolver()\n : DEFAULT_PROVIDER_CHAIN_RESOLVER());\n const credentials = await withTempEnv(() => {\n // Temporarily set the appropriate environment variables if we've been\n // explicitly given credentials so that the credentials provider can\n // resolve them.\n //\n // Note: the environment provider is only not run first if the `AWS_PROFILE`\n // environment variable is set.\n // https://github.com/aws/aws-sdk-js-v3/blob/44a18a34b2c93feccdfcd162928d13e6dbdcaf30/packages/credential-provider-node/src/defaultProvider.ts#L49\n if (props.awsAccessKey) {\n process.env['AWS_ACCESS_KEY_ID'] = props.awsAccessKey;\n }\n if (props.awsSecretKey) {\n process.env['AWS_SECRET_ACCESS_KEY'] = props.awsSecretKey;\n }\n if (props.awsSessionToken) {\n process.env['AWS_SESSION_TOKEN'] = props.awsSessionToken;\n }\n }, () => providerChain());\n const signer = new SignatureV4({\n service: 'bedrock',\n region: props.regionName,\n credentials,\n sha256: Sha256,\n });\n const url = new URL(props.url);\n const headers = !req.headers ? {}\n : Symbol.iterator in req.headers ?\n Object.fromEntries(Array.from(req.headers).map((header) => [...header]))\n : { ...req.headers };\n // The connection header may be stripped by a proxy somewhere, so the receiver\n // of this message may not see this header, so we remove it from the set of headers\n // that are signed.\n delete headers['connection'];\n headers['host'] = url.hostname;\n const request = new HttpRequest({\n method: req.method.toUpperCase(),\n protocol: url.protocol,\n path: url.pathname,\n headers,\n body: req.body,\n });\n const signed = await signer.sign(request);\n return signed.headers;\n};\nconst withTempEnv = async (updateEnv, fn) => {\n const previousEnv = { ...process.env };\n try {\n updateEnv();\n return await fn();\n }\n finally {\n process.env = previousEnv;\n }\n};\n//# sourceMappingURL=auth.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport { Anthropic as default } from \"./client.mjs\";\nexport { toFile } from \"./core/uploads.mjs\";\nexport { APIPromise } from \"./core/api-promise.mjs\";\nexport { BaseAnthropic, Anthropic, HUMAN_PROMPT, AI_PROMPT } from \"./client.mjs\";\nexport { PagePromise } from \"./core/pagination.mjs\";\nexport { AnthropicError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from \"./core/error.mjs\";\n//# sourceMappingURL=index.mjs.map", - "// Copied from https://github.com/aws/aws-sdk-js-v3/blob/bee66fbd2a519a16b57c787b2689af857af720af/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts\n// Modified to remove unnecessary code (we only need to call `de_ResponseStream`) and to adjust imports.\nimport { collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectString as __expectString, map, take, } from '@smithy/smithy-client';\nimport { InternalServerException, ModelStreamErrorException, ThrottlingException, ValidationException, } from '@aws-sdk/client-bedrock-runtime';\n/**\n * deserializeAws_restJson1InternalServerExceptionRes\n */\nconst de_InternalServerExceptionRes = async (parsedOutput, context) => {\n const contents = map({});\n const data = parsedOutput.body;\n const doc = take(data, {\n message: __expectString,\n });\n Object.assign(contents, doc);\n const exception = new InternalServerException({\n $metadata: deserializeMetadata(parsedOutput),\n ...contents,\n });\n return __decorateServiceException(exception, parsedOutput.body);\n};\n/**\n * deserializeAws_restJson1ModelStreamErrorExceptionRes\n */\nconst de_ModelStreamErrorExceptionRes = async (parsedOutput, context) => {\n const contents = map({});\n const data = parsedOutput.body;\n const doc = take(data, {\n message: __expectString,\n originalMessage: __expectString,\n originalStatusCode: __expectInt32,\n });\n Object.assign(contents, doc);\n const exception = new ModelStreamErrorException({\n $metadata: deserializeMetadata(parsedOutput),\n ...contents,\n });\n return __decorateServiceException(exception, parsedOutput.body);\n};\n/**\n * deserializeAws_restJson1ThrottlingExceptionRes\n */\nconst de_ThrottlingExceptionRes = async (parsedOutput, context) => {\n const contents = map({});\n const data = parsedOutput.body;\n const doc = take(data, {\n message: __expectString,\n });\n Object.assign(contents, doc);\n const exception = new ThrottlingException({\n $metadata: deserializeMetadata(parsedOutput),\n ...contents,\n });\n return __decorateServiceException(exception, parsedOutput.body);\n};\n/**\n * deserializeAws_restJson1ValidationExceptionRes\n */\nconst de_ValidationExceptionRes = async (parsedOutput, context) => {\n const contents = map({});\n const data = parsedOutput.body;\n const doc = take(data, {\n message: __expectString,\n });\n Object.assign(contents, doc);\n const exception = new ValidationException({\n $metadata: deserializeMetadata(parsedOutput),\n ...contents,\n });\n return __decorateServiceException(exception, parsedOutput.body);\n};\n/**\n * deserializeAws_restJson1ResponseStream\n */\nexport const de_ResponseStream = (output, context) => {\n return context.eventStreamMarshaller.deserialize(output, async (event) => {\n if (event['chunk'] != null) {\n return {\n chunk: await de_PayloadPart_event(event['chunk'], context),\n };\n }\n if (event['internalServerException'] != null) {\n return {\n internalServerException: await de_InternalServerException_event(event['internalServerException'], context),\n };\n }\n if (event['modelStreamErrorException'] != null) {\n return {\n modelStreamErrorException: await de_ModelStreamErrorException_event(event['modelStreamErrorException'], context),\n };\n }\n if (event['validationException'] != null) {\n return {\n validationException: await de_ValidationException_event(event['validationException'], context),\n };\n }\n if (event['throttlingException'] != null) {\n return {\n throttlingException: await de_ThrottlingException_event(event['throttlingException'], context),\n };\n }\n return { $unknown: output };\n });\n};\nconst de_InternalServerException_event = async (output, context) => {\n const parsedOutput = {\n ...output,\n body: await parseBody(output.body, context),\n };\n return de_InternalServerExceptionRes(parsedOutput, context);\n};\nconst de_ModelStreamErrorException_event = async (output, context) => {\n const parsedOutput = {\n ...output,\n body: await parseBody(output.body, context),\n };\n return de_ModelStreamErrorExceptionRes(parsedOutput, context);\n};\nconst de_PayloadPart_event = async (output, context) => {\n const contents = {};\n const data = await parseBody(output.body, context);\n Object.assign(contents, de_PayloadPart(data, context));\n return contents;\n};\nconst de_ThrottlingException_event = async (output, context) => {\n const parsedOutput = {\n ...output,\n body: await parseBody(output.body, context),\n };\n return de_ThrottlingExceptionRes(parsedOutput, context);\n};\nconst de_ValidationException_event = async (output, context) => {\n const parsedOutput = {\n ...output,\n body: await parseBody(output.body, context),\n };\n return de_ValidationExceptionRes(parsedOutput, context);\n};\n/**\n * deserializeAws_restJson1PayloadPart\n */\nconst de_PayloadPart = (output, context) => {\n return take(output, {\n bytes: context.base64Decoder,\n });\n};\nconst deserializeMetadata = (output) => ({\n httpStatusCode: output.statusCode,\n requestId: output.headers['x-amzn-requestid'] ??\n output.headers['x-amzn-request-id'] ??\n output.headers['x-amz-request-id'] ??\n '',\n extendedRequestId: output.headers['x-amz-id-2'] ?? '',\n cfId: output.headers['x-amz-cf-id'] ?? '',\n});\n// Encode Uint8Array data into string with utf-8.\nconst collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));\nconst parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {\n if (encoded.length) {\n return JSON.parse(encoded);\n }\n return {};\n});\n//# sourceMappingURL=AWS_restJson1.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport function getDefaultFetch() {\n if (typeof fetch !== 'undefined') {\n return fetch;\n }\n throw new Error('`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`');\n}\nexport function makeReadableStream(...args) {\n const ReadableStream = globalThis.ReadableStream;\n if (typeof ReadableStream === 'undefined') {\n // Note: All of the platforms / runtimes we officially support already define\n // `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.\n throw new Error('`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`');\n }\n return new ReadableStream(...args);\n}\nexport function ReadableStreamFrom(iterable) {\n let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n return makeReadableStream({\n start() { },\n async pull(controller) {\n const { done, value } = await iter.next();\n if (done) {\n controller.close();\n }\n else {\n controller.enqueue(value);\n }\n },\n async cancel() {\n await iter.return?.();\n },\n });\n}\n/**\n * Most browsers don't yet have async iterable support for ReadableStream,\n * and Node has a very different way of reading bytes from its \"ReadableStream\".\n *\n * This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490\n */\nexport function ReadableStreamToAsyncIterable(stream) {\n if (stream[Symbol.asyncIterator])\n return stream;\n const reader = stream.getReader();\n return {\n async next() {\n try {\n const result = await reader.read();\n if (result?.done)\n reader.releaseLock(); // release lock when stream becomes closed\n return result;\n }\n catch (e) {\n reader.releaseLock(); // release lock when stream becomes errored\n throw e;\n }\n },\n async return() {\n const cancelPromise = reader.cancel();\n reader.releaseLock();\n await cancelPromise;\n return { done: true, value: undefined };\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\n/**\n * Cancels a ReadableStream we don't need to consume.\n * See https://undici.nodejs.org/#/?id=garbage-collection\n */\nexport async function CancelReadableStream(stream) {\n if (stream === null || typeof stream !== 'object')\n return;\n if (stream[Symbol.asyncIterator]) {\n await stream[Symbol.asyncIterator]().return?.();\n return;\n }\n const reader = stream.getReader();\n const cancelPromise = reader.cancel();\n reader.releaseLock();\n await cancelPromise;\n}\n//# sourceMappingURL=shims.mjs.map", - "export * from '@anthropic-ai/sdk/core/error';\n//# sourceMappingURL=error.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { AnthropicError } from \"../../core/error.mjs\";\n// https://url.spec.whatwg.org/#url-scheme-string\nconst startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;\nexport const isAbsoluteURL = (url) => {\n return startsWithSchemeRegexp.test(url);\n};\nexport let isArray = (val) => ((isArray = Array.isArray), isArray(val));\nexport let isReadonlyArray = isArray;\n/** Returns an object if the given value isn't an object, otherwise returns as-is */\nexport function maybeObj(x) {\n if (typeof x !== 'object') {\n return {};\n }\n return x ?? {};\n}\n// https://stackoverflow.com/a/34491287\nexport function isEmptyObj(obj) {\n if (!obj)\n return true;\n for (const _k in obj)\n return false;\n return true;\n}\n// https://eslint.org/docs/latest/rules/no-prototype-builtins\nexport function hasOwn(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\nexport function isObj(obj) {\n return obj != null && typeof obj === 'object' && !Array.isArray(obj);\n}\nexport const ensurePresent = (value) => {\n if (value == null) {\n throw new AnthropicError(`Expected a value to be given but received ${value} instead.`);\n }\n return value;\n};\nexport const validatePositiveInteger = (name, n) => {\n if (typeof n !== 'number' || !Number.isInteger(n)) {\n throw new AnthropicError(`${name} must be an integer`);\n }\n if (n < 0) {\n throw new AnthropicError(`${name} must be a positive integer`);\n }\n return n;\n};\nexport const coerceInteger = (value) => {\n if (typeof value === 'number')\n return Math.round(value);\n if (typeof value === 'string')\n return parseInt(value, 10);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceFloat = (value) => {\n if (typeof value === 'number')\n return value;\n if (typeof value === 'string')\n return parseFloat(value);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceBoolean = (value) => {\n if (typeof value === 'boolean')\n return value;\n if (typeof value === 'string')\n return value === 'true';\n return Boolean(value);\n};\nexport const maybeCoerceInteger = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceInteger(value);\n};\nexport const maybeCoerceFloat = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceFloat(value);\n};\nexport const maybeCoerceBoolean = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceBoolean(value);\n};\nexport const safeJSON = (text) => {\n try {\n return JSON.parse(text);\n }\n catch (err) {\n return undefined;\n }\n};\n//# sourceMappingURL=values.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { hasOwn } from \"./values.mjs\";\nconst levelNumbers = {\n off: 0,\n error: 200,\n warn: 300,\n info: 400,\n debug: 500,\n};\nexport const parseLogLevel = (maybeLevel, sourceName, client) => {\n if (!maybeLevel) {\n return undefined;\n }\n if (hasOwn(levelNumbers, maybeLevel)) {\n return maybeLevel;\n }\n loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`);\n return undefined;\n};\nfunction noop() { }\nfunction makeLogFn(fnLevel, logger, logLevel) {\n if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {\n return noop;\n }\n else {\n // Don't wrap logger functions, we want the stacktrace intact!\n return logger[fnLevel].bind(logger);\n }\n}\nconst noopLogger = {\n error: noop,\n warn: noop,\n info: noop,\n debug: noop,\n};\nlet cachedLoggers = /* @__PURE__ */ new WeakMap();\nexport function loggerFor(client) {\n const logger = client.logger;\n const logLevel = client.logLevel ?? 'off';\n if (!logger) {\n return noopLogger;\n }\n const cachedLogger = cachedLoggers.get(logger);\n if (cachedLogger && cachedLogger[0] === logLevel) {\n return cachedLogger[1];\n }\n const levelLogger = {\n error: makeLogFn('error', logger, logLevel),\n warn: makeLogFn('warn', logger, logLevel),\n info: makeLogFn('info', logger, logLevel),\n debug: makeLogFn('debug', logger, logLevel),\n };\n cachedLoggers.set(logger, [logLevel, levelLogger]);\n return levelLogger;\n}\nexport const formatRequestDetails = (details) => {\n if (details.options) {\n details.options = { ...details.options };\n delete details.options['headers']; // redundant + leaks internals\n }\n if (details.headers) {\n details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [\n name,\n (name.toLowerCase() === 'x-api-key' ||\n name.toLowerCase() === 'authorization' ||\n name.toLowerCase() === 'cookie' ||\n name.toLowerCase() === 'set-cookie') ?\n '***'\n : value,\n ]));\n }\n if ('retryOfRequestLogID' in details) {\n if (details.retryOfRequestLogID) {\n details.retryOf = details.retryOfRequestLogID;\n }\n delete details.retryOfRequestLogID;\n }\n return details;\n};\n//# sourceMappingURL=log.mjs.map", - "import { EventStreamMarshaller } from '@smithy/eventstream-serde-node';\nimport { fromBase64, toBase64 } from '@smithy/util-base64';\nimport { streamCollector } from '@smithy/fetch-http-handler';\nimport { Stream as CoreStream } from '@anthropic-ai/sdk/streaming';\nimport { AnthropicError } from '@anthropic-ai/sdk/error';\nimport { APIError } from '@anthropic-ai/sdk';\nimport { de_ResponseStream } from \"../AWS_restJson1.mjs\";\nimport { ReadableStreamToAsyncIterable } from \"../internal/shims.mjs\";\nimport { safeJSON } from \"../internal/utils/values.mjs\";\nimport { loggerFor } from \"../internal/utils/log.mjs\";\nexport const toUtf8 = (input) => new TextDecoder('utf-8').decode(input);\nexport const fromUtf8 = (input) => new TextEncoder().encode(input);\n// `de_ResponseStream` parses a Bedrock response stream and emits events as they are found.\n// It requires a \"context\" argument which has many fields, but for what we're using it for\n// it only needs this.\nexport const getMinimalSerdeContext = () => {\n const marshaller = new EventStreamMarshaller({ utf8Encoder: toUtf8, utf8Decoder: fromUtf8 });\n return {\n base64Decoder: fromBase64,\n base64Encoder: toBase64,\n utf8Decoder: fromUtf8,\n utf8Encoder: toUtf8,\n eventStreamMarshaller: marshaller,\n streamCollector: streamCollector,\n };\n};\nexport class Stream extends CoreStream {\n static fromSSEResponse(response, controller, client) {\n let consumed = false;\n const logger = client ? loggerFor(client) : console;\n async function* iterMessages() {\n if (!response.body) {\n controller.abort();\n throw new AnthropicError(`Attempted to iterate over a response with no body`);\n }\n const responseBodyIter = ReadableStreamToAsyncIterable(response.body);\n const eventStream = de_ResponseStream(responseBodyIter, getMinimalSerdeContext());\n for await (const event of eventStream) {\n if (event.chunk && event.chunk.bytes) {\n const s = toUtf8(event.chunk.bytes);\n yield { event: 'chunk', data: s, raw: [] };\n }\n else if (event.internalServerException) {\n yield { event: 'error', data: 'InternalServerException', raw: [] };\n }\n else if (event.modelStreamErrorException) {\n yield { event: 'error', data: 'ModelStreamErrorException', raw: [] };\n }\n else if (event.validationException) {\n yield { event: 'error', data: 'ValidationException', raw: [] };\n }\n else if (event.throttlingException) {\n yield { event: 'error', data: 'ThrottlingException', raw: [] };\n }\n }\n }\n // Note: this function is copied entirely from the core SDK\n async function* iterator() {\n if (consumed) {\n throw new Error('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');\n }\n consumed = true;\n let done = false;\n try {\n for await (const sse of iterMessages()) {\n if (sse.event === 'chunk') {\n try {\n yield JSON.parse(sse.data);\n }\n catch (e) {\n logger.error(`Could not parse message into JSON:`, sse.data);\n logger.error(`From chunk:`, sse.raw);\n throw e;\n }\n }\n if (sse.event === 'error') {\n const errText = sse.data;\n const errJSON = safeJSON(errText);\n const errMessage = errJSON ? undefined : errText;\n throw APIError.generate(undefined, errJSON, errMessage, response.headers);\n }\n }\n done = true;\n }\n catch (e) {\n // If the user calls `stream.controller.abort()`, we should exit without throwing.\n if (isAbortError(e))\n return;\n throw e;\n }\n finally {\n // If the user `break`s, abort the ongoing request.\n if (!done)\n controller.abort();\n }\n }\n return new Stream(iterator, controller);\n }\n}\nfunction isAbortError(err) {\n return (typeof err === 'object' &&\n err !== null &&\n // Spec-compliant fetch implementations\n (('name' in err && err.name === 'AbortError') ||\n // Expo fetch\n ('message' in err && String(err.message).includes('FetchRequestCanceledException'))));\n}\n//# sourceMappingURL=streaming.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\n/**\n * Read an environment variable.\n *\n * Trims beginning and trailing whitespace.\n *\n * Will return undefined if the environment variable doesn't exist or cannot be accessed.\n */\nexport const readEnv = (env) => {\n if (typeof globalThis.process !== 'undefined') {\n return globalThis.process.env?.[env]?.trim() ?? undefined;\n }\n if (typeof globalThis.Deno !== 'undefined') {\n return globalThis.Deno.env?.get?.(env)?.trim();\n }\n return undefined;\n};\n//# sourceMappingURL=env.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { isReadonlyArray } from \"./utils/values.mjs\";\nconst brand_privateNullableHeaders = Symbol.for('brand.privateNullableHeaders');\nfunction* iterateHeaders(headers) {\n if (!headers)\n return;\n if (brand_privateNullableHeaders in headers) {\n const { values, nulls } = headers;\n yield* values.entries();\n for (const name of nulls) {\n yield [name, null];\n }\n return;\n }\n let shouldClear = false;\n let iter;\n if (headers instanceof Headers) {\n iter = headers.entries();\n }\n else if (isReadonlyArray(headers)) {\n iter = headers;\n }\n else {\n shouldClear = true;\n iter = Object.entries(headers ?? {});\n }\n for (let row of iter) {\n const name = row[0];\n if (typeof name !== 'string')\n throw new TypeError('expected header name to be a string');\n const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];\n let didClear = false;\n for (const value of values) {\n if (value === undefined)\n continue;\n // Objects keys always overwrite older headers, they never append.\n // Yield a null to clear the header before adding the new values.\n if (shouldClear && !didClear) {\n didClear = true;\n yield [name, null];\n }\n yield [name, value];\n }\n }\n}\nexport const buildHeaders = (newHeaders) => {\n const targetHeaders = new Headers();\n const nullHeaders = new Set();\n for (const headers of newHeaders) {\n const seenHeaders = new Set();\n for (const [name, value] of iterateHeaders(headers)) {\n const lowerName = name.toLowerCase();\n if (!seenHeaders.has(lowerName)) {\n targetHeaders.delete(name);\n seenHeaders.add(lowerName);\n }\n if (value === null) {\n targetHeaders.delete(name);\n nullHeaders.add(lowerName);\n }\n else {\n targetHeaders.append(name, value);\n nullHeaders.delete(lowerName);\n }\n }\n }\n return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };\n};\nexport const isEmptyHeaders = (headers) => {\n for (const _ of iterateHeaders(headers))\n return false;\n return true;\n};\n//# sourceMappingURL=headers.mjs.map", - "import { AnthropicError } from \"../../core/error.mjs\";\n/**\n * Percent-encode everything that isn't safe to have in a path without encoding safe chars.\n *\n * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:\n * > unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * > sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\" / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n * > pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n */\nexport function encodeURIPath(str) {\n return str.replace(/[^A-Za-z0-9\\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);\n}\nconst EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));\nexport const createPathTagFunction = (pathEncoder = encodeURIPath) => function path(statics, ...params) {\n // If there are no params, no processing is needed.\n if (statics.length === 1)\n return statics[0];\n let postPath = false;\n const invalidSegments = [];\n const path = statics.reduce((previousValue, currentValue, index) => {\n if (/[?#]/.test(currentValue)) {\n postPath = true;\n }\n const value = params[index];\n let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);\n if (index !== params.length &&\n (value == null ||\n (typeof value === 'object' &&\n // handle values from other realms\n value.toString ===\n Object.getPrototypeOf(Object.getPrototypeOf(value.hasOwnProperty ?? EMPTY) ?? EMPTY)\n ?.toString))) {\n encoded = value + '';\n invalidSegments.push({\n start: previousValue.length + currentValue.length,\n length: encoded.length,\n error: `Value of type ${Object.prototype.toString\n .call(value)\n .slice(8, -1)} is not a valid path parameter`,\n });\n }\n return previousValue + currentValue + (index === params.length ? '' : encoded);\n }, '');\n const pathOnly = path.split(/[?#]/, 1)[0];\n const invalidSegmentPattern = /(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)/gi;\n let match;\n // Find all invalid segments\n while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {\n invalidSegments.push({\n start: match.index,\n length: match[0].length,\n error: `Value \"${match[0]}\" can\\'t be safely passed as a path parameter`,\n });\n }\n invalidSegments.sort((a, b) => a.start - b.start);\n if (invalidSegments.length > 0) {\n let lastEnd = 0;\n const underline = invalidSegments.reduce((acc, segment) => {\n const spaces = ' '.repeat(segment.start - lastEnd);\n const arrows = '^'.repeat(segment.length);\n lastEnd = segment.start + segment.length;\n return acc + spaces + arrows;\n }, '');\n throw new AnthropicError(`Path parameters result in path with invalid segments:\\n${invalidSegments\n .map((e) => e.error)\n .join('\\n')}\\n${path}\\n${underline}`);\n }\n return path;\n};\n/**\n * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.\n */\nexport const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);\n//# sourceMappingURL=path.mjs.map", - "import { BaseAnthropic } from '@anthropic-ai/sdk/client';\nimport * as Resources from '@anthropic-ai/sdk/resources/index';\nimport { getAuthHeaders } from \"./core/auth.mjs\";\nimport { Stream } from \"./core/streaming.mjs\";\nimport { readEnv } from \"./internal/utils/env.mjs\";\nimport { isObj } from \"./internal/utils/values.mjs\";\nimport { buildHeaders } from \"./internal/headers.mjs\";\nimport { path } from \"./internal/utils/path.mjs\";\nexport { BaseAnthropic } from '@anthropic-ai/sdk/client';\nconst DEFAULT_VERSION = 'bedrock-2023-05-31';\nconst MODEL_ENDPOINTS = new Set(['/v1/complete', '/v1/messages', '/v1/messages?beta=true']);\n/** API Client for interfacing with the Anthropic Bedrock API. */\nexport class AnthropicBedrock extends BaseAnthropic {\n /**\n * API Client for interfacing with the Anthropic Bedrock API.\n *\n * @param {string | null | undefined} [opts.awsSecretKey]\n * @param {string | null | undefined} [opts.awsAccessKey]\n * @param {string | undefined} [opts.awsRegion=process.env['AWS_REGION'] ?? us-east-1]\n * @param {string | null | undefined} [opts.awsSessionToken]\n * @param {(() => Promise) | null} [opts.providerChainResolver] - Custom provider chain resolver for AWS credentials. Useful for non-Node environments.\n * @param {string} [opts.baseURL=process.env['ANTHROPIC_BEDROCK_BASE_URL'] ?? https://bedrock-runtime.${this.awsRegion}.amazonaws.com] - Override the default base URL for the API.\n * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.\n * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.\n * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.\n * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.\n * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.\n * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API.\n * @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.\n * @param {boolean} [opts.skipAuth=false] - Skip authentication for this request. This is useful if you have an internal proxy that handles authentication for you.\n */\n constructor({ awsRegion = readEnv('AWS_REGION') ?? 'us-east-1', baseURL = readEnv('ANTHROPIC_BEDROCK_BASE_URL') ?? `https://bedrock-runtime.${awsRegion}.amazonaws.com`, awsSecretKey = null, awsAccessKey = null, awsSessionToken = null, providerChainResolver = null, ...opts } = {}) {\n super({\n baseURL,\n ...opts,\n });\n this.skipAuth = false;\n this.messages = makeMessagesResource(this);\n this.completions = new Resources.Completions(this);\n this.beta = makeBetaResource(this);\n this.awsSecretKey = awsSecretKey;\n this.awsAccessKey = awsAccessKey;\n this.awsRegion = awsRegion;\n this.awsSessionToken = awsSessionToken;\n this.skipAuth = opts.skipAuth ?? false;\n this.providerChainResolver = providerChainResolver;\n }\n validateHeaders() {\n // auth validation is handled in prepareRequest since it needs to be async\n }\n async prepareRequest(request, { url, options }) {\n if (this.skipAuth) {\n return;\n }\n const regionName = this.awsRegion;\n if (!regionName) {\n throw new Error('Expected `awsRegion` option to be passed to the client or the `AWS_REGION` environment variable to be present');\n }\n const headers = await getAuthHeaders(request, {\n url,\n regionName,\n awsAccessKey: this.awsAccessKey,\n awsSecretKey: this.awsSecretKey,\n awsSessionToken: this.awsSessionToken,\n fetchOptions: this.fetchOptions,\n providerChainResolver: this.providerChainResolver,\n });\n request.headers = buildHeaders([headers, request.headers]).values;\n }\n async buildRequest(options) {\n options.__streamClass = Stream;\n if (isObj(options.body)) {\n // create a shallow copy of the request body so that code that mutates it later\n // doesn't mutate the original user-provided object\n options.body = { ...options.body };\n }\n if (isObj(options.body)) {\n if (!options.body['anthropic_version']) {\n options.body['anthropic_version'] = DEFAULT_VERSION;\n }\n if (options.headers && !options.body['anthropic_beta']) {\n const betas = buildHeaders([options.headers]).values.get('anthropic-beta');\n if (betas != null) {\n options.body['anthropic_beta'] = betas.split(',');\n }\n }\n }\n if (MODEL_ENDPOINTS.has(options.path) && options.method === 'post') {\n if (!isObj(options.body)) {\n throw new Error('Expected request body to be an object for post /v1/messages');\n }\n const model = options.body['model'];\n options.body['model'] = undefined;\n const stream = options.body['stream'];\n options.body['stream'] = undefined;\n if (stream) {\n options.path = path `/model/${model}/invoke-with-response-stream`;\n }\n else {\n options.path = path `/model/${model}/invoke`;\n }\n }\n return super.buildRequest(options);\n }\n}\nfunction makeMessagesResource(client) {\n const resource = new Resources.Messages(client);\n // @ts-expect-error we're deleting non-optional properties\n delete resource.batches;\n // @ts-expect-error we're deleting non-optional properties\n delete resource.countTokens;\n return resource;\n}\nfunction makeBetaResource(client) {\n const resource = new Resources.Beta(client);\n // @ts-expect-error we're deleting non-optional properties\n delete resource.promptCaching;\n // @ts-expect-error we're deleting non-optional properties\n delete resource.messages.batches;\n // @ts-expect-error we're deleting non-optional properties\n delete resource.messages.countTokens;\n return resource;\n}\n//# sourceMappingURL=client.mjs.map", - "export * from \"./client.mjs\";\nexport { AnthropicBedrock as default } from \"./client.mjs\";\n//# sourceMappingURL=index.mjs.map", - "export * from '@anthropic-ai/sdk/core/error';\n//# sourceMappingURL=error.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { AnthropicError } from \"../../core/error.mjs\";\n// https://url.spec.whatwg.org/#url-scheme-string\nconst startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;\nexport const isAbsoluteURL = (url) => {\n return startsWithSchemeRegexp.test(url);\n};\nexport let isArray = (val) => ((isArray = Array.isArray), isArray(val));\nexport let isReadonlyArray = isArray;\n/** Returns an object if the given value isn't an object, otherwise returns as-is */\nexport function maybeObj(x) {\n if (typeof x !== 'object') {\n return {};\n }\n return x ?? {};\n}\n// https://stackoverflow.com/a/34491287\nexport function isEmptyObj(obj) {\n if (!obj)\n return true;\n for (const _k in obj)\n return false;\n return true;\n}\n// https://eslint.org/docs/latest/rules/no-prototype-builtins\nexport function hasOwn(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\nexport function isObj(obj) {\n return obj != null && typeof obj === 'object' && !Array.isArray(obj);\n}\nexport const ensurePresent = (value) => {\n if (value == null) {\n throw new AnthropicError(`Expected a value to be given but received ${value} instead.`);\n }\n return value;\n};\nexport const validatePositiveInteger = (name, n) => {\n if (typeof n !== 'number' || !Number.isInteger(n)) {\n throw new AnthropicError(`${name} must be an integer`);\n }\n if (n < 0) {\n throw new AnthropicError(`${name} must be a positive integer`);\n }\n return n;\n};\nexport const coerceInteger = (value) => {\n if (typeof value === 'number')\n return Math.round(value);\n if (typeof value === 'string')\n return parseInt(value, 10);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceFloat = (value) => {\n if (typeof value === 'number')\n return value;\n if (typeof value === 'string')\n return parseFloat(value);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceBoolean = (value) => {\n if (typeof value === 'boolean')\n return value;\n if (typeof value === 'string')\n return value === 'true';\n return Boolean(value);\n};\nexport const maybeCoerceInteger = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceInteger(value);\n};\nexport const maybeCoerceFloat = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceFloat(value);\n};\nexport const maybeCoerceBoolean = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceBoolean(value);\n};\nexport const safeJSON = (text) => {\n try {\n return JSON.parse(text);\n }\n catch (err) {\n return undefined;\n }\n};\n// Gets a value from an object, deletes the key, and returns the value (or undefined if not found)\nexport const pop = (obj, key) => {\n const value = obj[key];\n delete obj[key];\n return value;\n};\n//# sourceMappingURL=values.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { isReadonlyArray } from \"./utils/values.mjs\";\nconst brand_privateNullableHeaders = Symbol.for('brand.privateNullableHeaders');\nfunction* iterateHeaders(headers) {\n if (!headers)\n return;\n if (brand_privateNullableHeaders in headers) {\n const { values, nulls } = headers;\n yield* values.entries();\n for (const name of nulls) {\n yield [name, null];\n }\n return;\n }\n let shouldClear = false;\n let iter;\n if (headers instanceof Headers) {\n iter = headers.entries();\n }\n else if (isReadonlyArray(headers)) {\n iter = headers;\n }\n else {\n shouldClear = true;\n iter = Object.entries(headers ?? {});\n }\n for (let row of iter) {\n const name = row[0];\n if (typeof name !== 'string')\n throw new TypeError('expected header name to be a string');\n const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];\n let didClear = false;\n for (const value of values) {\n if (value === undefined)\n continue;\n // Objects keys always overwrite older headers, they never append.\n // Yield a null to clear the header before adding the new values.\n if (shouldClear && !didClear) {\n didClear = true;\n yield [name, null];\n }\n yield [name, value];\n }\n }\n}\nexport const buildHeaders = (newHeaders) => {\n const targetHeaders = new Headers();\n const nullHeaders = new Set();\n for (const headers of newHeaders) {\n const seenHeaders = new Set();\n for (const [name, value] of iterateHeaders(headers)) {\n const lowerName = name.toLowerCase();\n if (!seenHeaders.has(lowerName)) {\n targetHeaders.delete(name);\n seenHeaders.add(lowerName);\n }\n if (value === null) {\n targetHeaders.delete(name);\n nullHeaders.add(lowerName);\n }\n else {\n targetHeaders.append(name, value);\n nullHeaders.delete(lowerName);\n }\n }\n }\n return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };\n};\nexport const isEmptyHeaders = (headers) => {\n for (const _ of iterateHeaders(headers))\n return false;\n return true;\n};\n//# sourceMappingURL=headers.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { AnthropicError } from \"../../core/error.mjs\";\nimport { encodeUTF8 } from \"./bytes.mjs\";\nexport const toBase64 = (data) => {\n if (!data)\n return '';\n if (typeof globalThis.Buffer !== 'undefined') {\n return globalThis.Buffer.from(data).toString('base64');\n }\n if (typeof data === 'string') {\n data = encodeUTF8(data);\n }\n if (typeof btoa !== 'undefined') {\n return btoa(String.fromCharCode.apply(null, data));\n }\n throw new AnthropicError('Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined');\n};\nexport const fromBase64 = (str) => {\n if (typeof globalThis.Buffer !== 'undefined') {\n const buf = globalThis.Buffer.from(str, 'base64');\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n if (typeof atob !== 'undefined') {\n const bstr = atob(str);\n const buf = new Uint8Array(bstr.length);\n for (let i = 0; i < bstr.length; i++) {\n buf[i] = bstr.charCodeAt(i);\n }\n return buf;\n }\n throw new AnthropicError('Cannot decode base64 string; Expected `Buffer` or `atob` to be defined');\n};\n//# sourceMappingURL=base64.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\n/**\n * Read an environment variable.\n *\n * Trims beginning and trailing whitespace.\n *\n * Will return undefined if the environment variable doesn't exist or cannot be accessed.\n */\nexport const readEnv = (env) => {\n if (typeof globalThis.process !== 'undefined') {\n return globalThis.process.env?.[env]?.trim() ?? undefined;\n }\n if (typeof globalThis.Deno !== 'undefined') {\n return globalThis.Deno.env?.get?.(env)?.trim();\n }\n return undefined;\n};\n//# sourceMappingURL=env.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { hasOwn } from \"./values.mjs\";\nconst levelNumbers = {\n off: 0,\n error: 200,\n warn: 300,\n info: 400,\n debug: 500,\n};\nexport const parseLogLevel = (maybeLevel, sourceName, client) => {\n if (!maybeLevel) {\n return undefined;\n }\n if (hasOwn(levelNumbers, maybeLevel)) {\n return maybeLevel;\n }\n loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`);\n return undefined;\n};\nfunction noop() { }\nfunction makeLogFn(fnLevel, logger, logLevel) {\n if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {\n return noop;\n }\n else {\n // Don't wrap logger functions, we want the stacktrace intact!\n return logger[fnLevel].bind(logger);\n }\n}\nconst noopLogger = {\n error: noop,\n warn: noop,\n info: noop,\n debug: noop,\n};\nlet cachedLoggers = /* @__PURE__ */ new WeakMap();\nexport function loggerFor(client) {\n const logger = client.logger;\n const logLevel = client.logLevel ?? 'off';\n if (!logger) {\n return noopLogger;\n }\n const cachedLogger = cachedLoggers.get(logger);\n if (cachedLogger && cachedLogger[0] === logLevel) {\n return cachedLogger[1];\n }\n const levelLogger = {\n error: makeLogFn('error', logger, logLevel),\n warn: makeLogFn('warn', logger, logLevel),\n info: makeLogFn('info', logger, logLevel),\n debug: makeLogFn('debug', logger, logLevel),\n };\n cachedLoggers.set(logger, [logLevel, levelLogger]);\n return levelLogger;\n}\nexport const formatRequestDetails = (details) => {\n if (details.options) {\n details.options = { ...details.options };\n delete details.options['headers']; // redundant + leaks internals\n }\n if (details.headers) {\n details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [\n name,\n (name.toLowerCase() === 'x-api-key' ||\n name.toLowerCase() === 'authorization' ||\n name.toLowerCase() === 'cookie' ||\n name.toLowerCase() === 'set-cookie') ?\n '***'\n : value,\n ]));\n }\n if ('retryOfRequestLogID' in details) {\n if (details.retryOfRequestLogID) {\n details.retryOf = details.retryOfRequestLogID;\n }\n delete details.retryOfRequestLogID;\n }\n return details;\n};\n//# sourceMappingURL=log.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport * from \"./utils/values.mjs\";\nexport * from \"./utils/base64.mjs\";\nexport * from \"./utils/env.mjs\";\nexport * from \"./utils/log.mjs\";\nexport * from \"./utils/uuid.mjs\";\nexport * from \"./utils/sleep.mjs\";\n//# sourceMappingURL=utils.mjs.map", - "import { buildHeaders } from \"./internal/headers.mjs\";\nimport * as Errors from \"./core/error.mjs\";\nimport { readEnv } from \"./internal/utils.mjs\";\nimport { Anthropic } from '@anthropic-ai/sdk/client';\nexport { BaseAnthropic } from '@anthropic-ai/sdk/client';\nimport * as Resources from '@anthropic-ai/sdk/resources/index';\n/** API Client for interfacing with the Anthropic Foundry API. */\nexport class AnthropicFoundry extends Anthropic {\n /**\n * API Client for interfacing with the Anthropic Foundry API.\n *\n * @param {string | undefined} [opts.resource=process.env['ANTHROPIC_FOUNDRY_RESOURCE'] ?? undefined] - Your Foundry resource name\n * @param {string | undefined} [opts.apiKey=process.env['ANTHROPIC_FOUNDRY_API_KEY'] ?? undefined]\n * @param {string | null | undefined} [opts.organization=process.env['ANTHROPIC_ORG_ID'] ?? null]\n * @param {string} [opts.baseURL=process.env['ANTHROPIC_FOUNDRY_BASE_URL']] - Sets the base URL for the API, e.g. `https://example-resource.azure.anthropic.com/anthropic/`.\n * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.\n * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.\n * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.\n * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.\n * @param {Headers} opts.defaultHeaders - Default headers to include with every request to the API.\n * @param {DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.\n * @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.\n */\n constructor({ baseURL = readEnv('ANTHROPIC_FOUNDRY_BASE_URL'), apiKey = readEnv('ANTHROPIC_FOUNDRY_API_KEY'), resource = readEnv('ANTHROPIC_FOUNDRY_RESOURCE'), azureADTokenProvider, dangerouslyAllowBrowser, ...opts } = {}) {\n if (typeof azureADTokenProvider === 'function') {\n dangerouslyAllowBrowser = true;\n }\n if (!azureADTokenProvider && !apiKey) {\n throw new Errors.AnthropicError('Missing credentials. Please pass one of `apiKey` and `azureTokenProvider`, or set the `ANTHROPIC_FOUNDRY_API_KEY` environment variable.');\n }\n if (azureADTokenProvider && apiKey) {\n throw new Errors.AnthropicError('The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time.');\n }\n if (!baseURL) {\n if (!resource) {\n throw new Errors.AnthropicError('Must provide one of the `baseURL` or `resource` arguments, or the `ANTHROPIC_FOUNDRY_RESOURCE` environment variable');\n }\n baseURL = `https://${resource}.services.ai.azure.com/anthropic/`;\n }\n else {\n if (resource) {\n throw new Errors.AnthropicError('baseURL and resource are mutually exclusive');\n }\n }\n super({\n apiKey: azureADTokenProvider ?? apiKey,\n baseURL,\n ...opts,\n ...(dangerouslyAllowBrowser !== undefined ? { dangerouslyAllowBrowser } : {}),\n });\n this.resource = null;\n // @ts-expect-error are using a different Messages type that omits batches\n this.messages = makeMessagesResource(this);\n // @ts-expect-error are using a different Beta type that omits batches\n this.beta = makeBetaResource(this);\n // @ts-expect-error Anthropic Foundry does not support models endpoint\n this.models = undefined;\n }\n async authHeaders() {\n if (typeof this._options.apiKey === 'function') {\n let token;\n try {\n token = await this._options.apiKey();\n }\n catch (err) {\n if (err instanceof Errors.AnthropicError)\n throw err;\n throw new Errors.AnthropicError(`Failed to get token from azureADTokenProvider: ${err.message}`, \n // @ts-ignore\n { cause: err });\n }\n if (typeof token !== 'string' || !token) {\n throw new Errors.AnthropicError(`Expected azureADTokenProvider function argument to return a string but it returned ${token}`);\n }\n return buildHeaders([{ Authorization: `Bearer ${token}` }]);\n }\n if (typeof this._options.apiKey === 'string') {\n return buildHeaders([{ 'x-api-key': this.apiKey }]);\n }\n return undefined;\n }\n validateHeaders() {\n return;\n }\n}\nfunction makeMessagesResource(client) {\n const resource = new Resources.Messages(client);\n // @ts-expect-error we're deleting non-optional properties\n delete resource.batches;\n return resource;\n}\nfunction makeBetaResource(client) {\n const resource = new Resources.Beta(client);\n // @ts-expect-error we're deleting non-optional properties\n delete resource.messages.batches;\n return resource;\n}\n//# sourceMappingURL=client.mjs.map", - "export * from \"./client.mjs\";\nexport { AnthropicFoundry as default } from \"./client.mjs\";\n//# sourceMappingURL=index.mjs.map", - "\n const handler = { get: (t, p) => p === '__esModule' ? true : () => {} };\n const stub = new Proxy({}, handler);\n export default stub;\n export const __stub__ = true;\n export const confirm = () => {};\n export const input = () => {};\n export const select = () => {};\n export const DestroyerOfModules = class {};\n ", - "'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n", - "\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n", - "\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n", - "\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar 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]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n", - "\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n", - "\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n", - "\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n", - "\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n", - "'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * isSameProtocol reports whether the two provided URLs use the same protocol.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nconst isSameProtocol = function isSameProtocol(destination, original) {\n\tconst orig = new URL$1(original).protocol;\n\tconst dest = new URL$1(destination).protocol;\n\n\treturn orig === dest;\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\tdestroyStream(request.body, error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\n\t\t\tif (response && response.body) {\n\t\t\t\tdestroyStream(response.body, err);\n\t\t\t}\n\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(req, function (err) {\n\t\t\tif (signal && signal.aborted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (response && response.body) {\n\t\t\t\tdestroyStream(response.body, err);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (parseInt(process.version.substring(1)) < 14) {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\treq.on('socket', function (s) {\n\t\t\t\ts.addListener('close', function (hadError) {\n\t\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\t\tconst hasDataListener = s.listenerCount('data') > 0;\n\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && hasDataListener && !hadError && !(signal && signal.aborted)) {\n\t\t\t\t\t\tconst err = new Error('Premature close');\n\t\t\t\t\t\terr.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\t\tresponse.body.emit('error', err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.on('end', function () {\n\t\t\t\t\t// some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tlet socket;\n\n\trequest.on('socket', function (s) {\n\t\tsocket = s;\n\t});\n\n\trequest.on('response', function (response) {\n\t\tconst headers = response.headers;\n\n\t\tif (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {\n\t\t\tresponse.once('close', function (hadError) {\n\t\t\t\t// tests for socket presence, as in some situations the\n\t\t\t\t// the 'socket' event is not triggered for the request\n\t\t\t\t// (happens in deno), avoids `TypeError`\n\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\tconst hasDataListener = socket && socket.listenerCount('data') > 0;\n\n\t\t\t\tif (hasDataListener && !hadError) {\n\t\t\t\t\tconst err = new Error('Premature close');\n\t\t\t\t\terr.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\terrorCallback(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}\n\nfunction destroyStream(stream, err) {\n\tif (stream.destroy) {\n\t\tstream.destroy(err);\n\t} else {\n\t\t// node < 8\n\t\tstream.emit('error', err);\n\t\tstream.end();\n\t}\n}\n\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\nexports.AbortError = AbortError;\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// Copyright 2023 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pkg = void 0;\nexports.pkg = require('../../package.json');\n//# sourceMappingURL=util.js.map", - "\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GaxiosError = exports.GAXIOS_ERROR_SYMBOL = void 0;\nexports.defaultErrorRedactor = defaultErrorRedactor;\nconst url_1 = require(\"url\");\nconst util_1 = require(\"./util\");\nconst extend_1 = __importDefault(require(\"extend\"));\n/**\n * Support `instanceof` operator for `GaxiosError`s in different versions of this library.\n *\n * @see {@link GaxiosError[Symbol.hasInstance]}\n */\nexports.GAXIOS_ERROR_SYMBOL = Symbol.for(`${util_1.pkg.name}-gaxios-error`);\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nclass GaxiosError extends Error {\n /**\n * Support `instanceof` operator for `GaxiosError` across builds/duplicated files.\n *\n * @see {@link GAXIOS_ERROR_SYMBOL}\n * @see {@link GaxiosError[GAXIOS_ERROR_SYMBOL]}\n */\n static [(_a = exports.GAXIOS_ERROR_SYMBOL, Symbol.hasInstance)](instance) {\n if (instance &&\n typeof instance === 'object' &&\n exports.GAXIOS_ERROR_SYMBOL in instance &&\n instance[exports.GAXIOS_ERROR_SYMBOL] === util_1.pkg.version) {\n return true;\n }\n // fallback to native\n return Function.prototype[Symbol.hasInstance].call(GaxiosError, instance);\n }\n constructor(message, config, response, error) {\n var _b;\n super(message);\n this.config = config;\n this.response = response;\n this.error = error;\n /**\n * Support `instanceof` operator for `GaxiosError` across builds/duplicated files.\n *\n * @see {@link GAXIOS_ERROR_SYMBOL}\n * @see {@link GaxiosError[Symbol.hasInstance]}\n * @see {@link https://github.com/microsoft/TypeScript/issues/13965#issuecomment-278570200}\n * @see {@link https://stackoverflow.com/questions/46618852/require-and-instanceof}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/@@hasInstance#reverting_to_default_instanceof_behavior}\n */\n this[_a] = util_1.pkg.version;\n // deep-copy config as we do not want to mutate\n // the existing config for future retries/use\n this.config = (0, extend_1.default)(true, {}, config);\n if (this.response) {\n this.response.config = (0, extend_1.default)(true, {}, this.response.config);\n }\n if (this.response) {\n try {\n this.response.data = translateData(this.config.responseType, (_b = this.response) === null || _b === void 0 ? void 0 : _b.data);\n }\n catch (_c) {\n // best effort - don't throw an error within an error\n // we could set `this.response.config.responseType = 'unknown'`, but\n // that would mutate future calls with this config object.\n }\n this.status = this.response.status;\n }\n if (error && 'code' in error && error.code) {\n this.code = error.code;\n }\n if (config.errorRedactor) {\n config.errorRedactor({\n config: this.config,\n response: this.response,\n });\n }\n }\n}\nexports.GaxiosError = GaxiosError;\nfunction translateData(responseType, data) {\n switch (responseType) {\n case 'stream':\n return data;\n case 'json':\n return JSON.parse(JSON.stringify(data));\n case 'arraybuffer':\n return JSON.parse(Buffer.from(data).toString('utf8'));\n case 'blob':\n return JSON.parse(data.text());\n default:\n return data;\n }\n}\n/**\n * An experimental error redactor.\n *\n * @param config Config to potentially redact properties of\n * @param response Config to potentially redact properties of\n *\n * @experimental\n */\nfunction defaultErrorRedactor(data) {\n const REDACT = '< - See `errorRedactor` option in `gaxios` for configuration>.';\n function redactHeaders(headers) {\n if (!headers)\n return;\n for (const key of Object.keys(headers)) {\n // any casing of `Authentication`\n if (/^authentication$/i.test(key)) {\n headers[key] = REDACT;\n }\n // any casing of `Authorization`\n if (/^authorization$/i.test(key)) {\n headers[key] = REDACT;\n }\n // anything containing secret, such as 'client secret'\n if (/secret/i.test(key)) {\n headers[key] = REDACT;\n }\n }\n }\n function redactString(obj, key) {\n if (typeof obj === 'object' &&\n obj !== null &&\n typeof obj[key] === 'string') {\n const text = obj[key];\n if (/grant_type=/i.test(text) ||\n /assertion=/i.test(text) ||\n /secret/i.test(text)) {\n obj[key] = REDACT;\n }\n }\n }\n function redactObject(obj) {\n if (typeof obj === 'object' && obj !== null) {\n if ('grant_type' in obj) {\n obj['grant_type'] = REDACT;\n }\n if ('assertion' in obj) {\n obj['assertion'] = REDACT;\n }\n if ('client_secret' in obj) {\n obj['client_secret'] = REDACT;\n }\n }\n }\n if (data.config) {\n redactHeaders(data.config.headers);\n redactString(data.config, 'data');\n redactObject(data.config.data);\n redactString(data.config, 'body');\n redactObject(data.config.body);\n try {\n const url = new url_1.URL('', data.config.url);\n if (url.searchParams.has('token')) {\n url.searchParams.set('token', REDACT);\n }\n if (url.searchParams.has('client_secret')) {\n url.searchParams.set('client_secret', REDACT);\n }\n data.config.url = url.toString();\n }\n catch (_b) {\n // ignore error - no need to parse an invalid URL\n }\n }\n if (data.response) {\n defaultErrorRedactor({ config: data.response.config });\n redactHeaders(data.response.headers);\n redactString(data.response, 'data');\n redactObject(data.response.data);\n }\n return data;\n}\n//# sourceMappingURL=common.js.map", - "\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRetryConfig = getRetryConfig;\nasync function getRetryConfig(err) {\n let config = getConfig(err);\n if (!err || !err.config || (!config && !err.config.retry)) {\n return { shouldRetry: false };\n }\n config = config || {};\n config.currentRetryAttempt = config.currentRetryAttempt || 0;\n config.retry =\n config.retry === undefined || config.retry === null ? 3 : config.retry;\n config.httpMethodsToRetry = config.httpMethodsToRetry || [\n 'GET',\n 'HEAD',\n 'PUT',\n 'OPTIONS',\n 'DELETE',\n ];\n config.noResponseRetries =\n config.noResponseRetries === undefined || config.noResponseRetries === null\n ? 2\n : config.noResponseRetries;\n config.retryDelayMultiplier = config.retryDelayMultiplier\n ? config.retryDelayMultiplier\n : 2;\n config.timeOfFirstRequest = config.timeOfFirstRequest\n ? config.timeOfFirstRequest\n : Date.now();\n config.totalTimeout = config.totalTimeout\n ? config.totalTimeout\n : Number.MAX_SAFE_INTEGER;\n config.maxRetryDelay = config.maxRetryDelay\n ? config.maxRetryDelay\n : Number.MAX_SAFE_INTEGER;\n // If this wasn't in the list of status codes where we want\n // to automatically retry, return.\n const retryRanges = [\n // https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n // 1xx - Retry (Informational, request still processing)\n // 2xx - Do not retry (Success)\n // 3xx - Do not retry (Redirect)\n // 4xx - Do not retry (Client errors)\n // 408 - Retry (\"Request Timeout\")\n // 429 - Retry (\"Too Many Requests\")\n // 5xx - Retry (Server errors)\n [100, 199],\n [408, 408],\n [429, 429],\n [500, 599],\n ];\n config.statusCodesToRetry = config.statusCodesToRetry || retryRanges;\n // Put the config back into the err\n err.config.retryConfig = config;\n // Determine if we should retry the request\n const shouldRetryFn = config.shouldRetry || shouldRetryRequest;\n if (!(await shouldRetryFn(err))) {\n return { shouldRetry: false, config: err.config };\n }\n const delay = getNextRetryDelay(config);\n // We're going to retry! Incremenent the counter.\n err.config.retryConfig.currentRetryAttempt += 1;\n // Create a promise that invokes the retry after the backOffDelay\n const backoff = config.retryBackoff\n ? config.retryBackoff(err, delay)\n : new Promise(resolve => {\n setTimeout(resolve, delay);\n });\n // Notify the user if they added an `onRetryAttempt` handler\n if (config.onRetryAttempt) {\n config.onRetryAttempt(err);\n }\n // Return the promise in which recalls Gaxios to retry the request\n await backoff;\n return { shouldRetry: true, config: err.config };\n}\n/**\n * Determine based on config if we should retry the request.\n * @param err The GaxiosError passed to the interceptor.\n */\nfunction shouldRetryRequest(err) {\n var _a;\n const config = getConfig(err);\n // node-fetch raises an AbortError if signaled:\n // https://github.com/bitinn/node-fetch#request-cancellation-with-abortsignal\n if (err.name === 'AbortError' || ((_a = err.error) === null || _a === void 0 ? void 0 : _a.name) === 'AbortError') {\n return false;\n }\n // If there's no config, or retries are disabled, return.\n if (!config || config.retry === 0) {\n return false;\n }\n // Check if this error has no response (ETIMEDOUT, ENOTFOUND, etc)\n if (!err.response &&\n (config.currentRetryAttempt || 0) >= config.noResponseRetries) {\n return false;\n }\n // Only retry with configured HttpMethods.\n if (!err.config.method ||\n config.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) {\n return false;\n }\n // If this wasn't in the list of status codes where we want\n // to automatically retry, return.\n if (err.response && err.response.status) {\n let isInRange = false;\n for (const [min, max] of config.statusCodesToRetry) {\n const status = err.response.status;\n if (status >= min && status <= max) {\n isInRange = true;\n break;\n }\n }\n if (!isInRange) {\n return false;\n }\n }\n // If we are out of retry attempts, return\n config.currentRetryAttempt = config.currentRetryAttempt || 0;\n if (config.currentRetryAttempt >= config.retry) {\n return false;\n }\n return true;\n}\n/**\n * Acquire the raxConfig object from an GaxiosError if available.\n * @param err The Gaxios error with a config object.\n */\nfunction getConfig(err) {\n if (err && err.config && err.config.retryConfig) {\n return err.config.retryConfig;\n }\n return;\n}\n/**\n * Gets the delay to wait before the next retry.\n *\n * @param {RetryConfig} config The current set of retry options\n * @returns {number} the amount of ms to wait before the next retry attempt.\n */\nfunction getNextRetryDelay(config) {\n var _a;\n // Calculate time to wait with exponential backoff.\n // If this is the first retry, look for a configured retryDelay.\n const retryDelay = config.currentRetryAttempt ? 0 : (_a = config.retryDelay) !== null && _a !== void 0 ? _a : 100;\n // Formula: retryDelay + ((retryDelayMultiplier^currentRetryAttempt - 1 / 2) * 1000)\n const calculatedDelay = retryDelay +\n ((Math.pow(config.retryDelayMultiplier, config.currentRetryAttempt) - 1) /\n 2) *\n 1000;\n const maxAllowableDelay = config.totalTimeout - (Date.now() - config.timeOfFirstRequest);\n return Math.min(calculatedDelay, maxAllowableDelay, config.maxRetryDelay);\n}\n//# sourceMappingURL=retry.js.map", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.unsafeStringify = unsafeStringify;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nfunction unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = require(\"./stringify.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.unsafeStringify)(b);\n}\n\nvar _default = v1;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.URL = exports.DNS = void 0;\nexports.default = v35;\n\nvar _stringify = require(\"./stringify.js\");\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction v35(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n var _namespace;\n\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.unsafeStringify)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _default = {\n randomUUID: _crypto.default.randomUUID\n};\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _native = _interopRequireDefault(require(\"./native.js\"));\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = require(\"./stringify.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n if (_native.default.randomUUID && !buf && !options) {\n return _native.default.randomUUID();\n }\n\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.unsafeStringify)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.slice(14, 15), 16);\n}\n\nvar _default = version;\nexports.default = _default;", - "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }", - "\"use strict\";\n// Copyright 2024 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GaxiosInterceptorManager = void 0;\n/**\n * Class to manage collections of GaxiosInterceptors for both requests and responses.\n */\nclass GaxiosInterceptorManager extends Set {\n}\nexports.GaxiosInterceptorManager = GaxiosInterceptorManager;\n//# sourceMappingURL=interceptor.js.map", - "/**\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", - "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.req = exports.json = exports.toBuffer = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nasync function toBuffer(stream) {\n let length = 0;\n const chunks = [];\n for await (const chunk of stream) {\n length += chunk.length;\n chunks.push(chunk);\n }\n return Buffer.concat(chunks, length);\n}\nexports.toBuffer = toBuffer;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nasync function json(stream) {\n const buf = await toBuffer(stream);\n const str = buf.toString('utf8');\n try {\n return JSON.parse(str);\n }\n catch (_err) {\n const err = _err;\n err.message += ` (input: ${str})`;\n throw err;\n }\n}\nexports.json = json;\nfunction req(url, opts = {}) {\n const href = typeof url === 'string' ? url : url.href;\n const req = (href.startsWith('https:') ? https : http).request(url, opts);\n const promise = new Promise((resolve, reject) => {\n req\n .once('response', resolve)\n .once('error', reject)\n .end();\n });\n req.then = promise.then.bind(promise);\n return req;\n}\nexports.req = req;\n//# sourceMappingURL=helpers.js.map", - "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Agent = void 0;\nconst net = __importStar(require(\"net\"));\nconst http = __importStar(require(\"http\"));\nconst https_1 = require(\"https\");\n__exportStar(require(\"./helpers\"), exports);\nconst INTERNAL = Symbol('AgentBaseInternalState');\nclass Agent extends http.Agent {\n constructor(opts) {\n super(opts);\n this[INTERNAL] = {};\n }\n /**\n * Determine whether this is an `http` or `https` request.\n */\n isSecureEndpoint(options) {\n if (options) {\n // First check the `secureEndpoint` property explicitly, since this\n // means that a parent `Agent` is \"passing through\" to this instance.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof options.secureEndpoint === 'boolean') {\n return options.secureEndpoint;\n }\n // If no explicit `secure` endpoint, check if `protocol` property is\n // set. This will usually be the case since using a full string URL\n // or `URL` instance should be the most common usage.\n if (typeof options.protocol === 'string') {\n return options.protocol === 'https:';\n }\n }\n // Finally, if no `protocol` property was set, then fall back to\n // checking the stack trace of the current call stack, and try to\n // detect the \"https\" module.\n const { stack } = new Error();\n if (typeof stack !== 'string')\n return false;\n return stack\n .split('\\n')\n .some((l) => l.indexOf('(https.js:') !== -1 ||\n l.indexOf('node:https:') !== -1);\n }\n // In order to support async signatures in `connect()` and Node's native\n // connection pooling in `http.Agent`, the array of sockets for each origin\n // has to be updated synchronously. This is so the length of the array is\n // accurate when `addRequest()` is next called. We achieve this by creating a\n // fake socket and adding it to `sockets[origin]` and incrementing\n // `totalSocketCount`.\n incrementSockets(name) {\n // If `maxSockets` and `maxTotalSockets` are both Infinity then there is no\n // need to create a fake socket because Node.js native connection pooling\n // will never be invoked.\n if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {\n return null;\n }\n // All instances of `sockets` are expected TypeScript errors. The\n // alternative is to add it as a private property of this class but that\n // will break TypeScript subclassing.\n if (!this.sockets[name]) {\n // @ts-expect-error `sockets` is readonly in `@types/node`\n this.sockets[name] = [];\n }\n const fakeSocket = new net.Socket({ writable: false });\n this.sockets[name].push(fakeSocket);\n // @ts-expect-error `totalSocketCount` isn't defined in `@types/node`\n this.totalSocketCount++;\n return fakeSocket;\n }\n decrementSockets(name, socket) {\n if (!this.sockets[name] || socket === null) {\n return;\n }\n const sockets = this.sockets[name];\n const index = sockets.indexOf(socket);\n if (index !== -1) {\n sockets.splice(index, 1);\n // @ts-expect-error `totalSocketCount` isn't defined in `@types/node`\n this.totalSocketCount--;\n if (sockets.length === 0) {\n // @ts-expect-error `sockets` is readonly in `@types/node`\n delete this.sockets[name];\n }\n }\n }\n // In order to properly update the socket pool, we need to call `getName()` on\n // the core `https.Agent` if it is a secureEndpoint.\n getName(options) {\n const secureEndpoint = this.isSecureEndpoint(options);\n if (secureEndpoint) {\n // @ts-expect-error `getName()` isn't defined in `@types/node`\n return https_1.Agent.prototype.getName.call(this, options);\n }\n // @ts-expect-error `getName()` isn't defined in `@types/node`\n return super.getName(options);\n }\n createSocket(req, options, cb) {\n const connectOpts = {\n ...options,\n secureEndpoint: this.isSecureEndpoint(options),\n };\n const name = this.getName(connectOpts);\n const fakeSocket = this.incrementSockets(name);\n Promise.resolve()\n .then(() => this.connect(req, connectOpts))\n .then((socket) => {\n this.decrementSockets(name, fakeSocket);\n if (socket instanceof http.Agent) {\n try {\n // @ts-expect-error `addRequest()` isn't defined in `@types/node`\n return socket.addRequest(req, connectOpts);\n }\n catch (err) {\n return cb(err);\n }\n }\n this[INTERNAL].currentSocket = socket;\n // @ts-expect-error `createSocket()` isn't defined in `@types/node`\n super.createSocket(req, options, cb);\n }, (err) => {\n this.decrementSockets(name, fakeSocket);\n cb(err);\n });\n }\n createConnection() {\n const socket = this[INTERNAL].currentSocket;\n this[INTERNAL].currentSocket = undefined;\n if (!socket) {\n throw new Error('No socket was returned in the `connect()` function');\n }\n return socket;\n }\n get defaultPort() {\n return (this[INTERNAL].defaultPort ??\n (this.protocol === 'https:' ? 443 : 80));\n }\n set defaultPort(v) {\n if (this[INTERNAL]) {\n this[INTERNAL].defaultPort = v;\n }\n }\n get protocol() {\n return (this[INTERNAL].protocol ??\n (this.isSecureEndpoint() ? 'https:' : 'http:'));\n }\n set protocol(v) {\n if (this[INTERNAL]) {\n this[INTERNAL].protocol = v;\n }\n }\n}\nexports.Agent = Agent;\n//# sourceMappingURL=index.js.map", - "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseProxyResponse = void 0;\nconst debug_1 = __importDefault(require(\"debug\"));\nconst debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response');\nfunction parseProxyResponse(socket) {\n return new Promise((resolve, reject) => {\n // we need to buffer any HTTP traffic that happens with the proxy before we get\n // the CONNECT response, so that if the response is anything other than an \"200\"\n // response code, then we can re-play the \"data\" events on the socket once the\n // HTTP parser is hooked up...\n let buffersLength = 0;\n const buffers = [];\n function read() {\n const b = socket.read();\n if (b)\n ondata(b);\n else\n socket.once('readable', read);\n }\n function cleanup() {\n socket.removeListener('end', onend);\n socket.removeListener('error', onerror);\n socket.removeListener('readable', read);\n }\n function onend() {\n cleanup();\n debug('onend');\n reject(new Error('Proxy connection ended before receiving CONNECT response'));\n }\n function onerror(err) {\n cleanup();\n debug('onerror %o', err);\n reject(err);\n }\n function ondata(b) {\n buffers.push(b);\n buffersLength += b.length;\n const buffered = Buffer.concat(buffers, buffersLength);\n const endOfHeaders = buffered.indexOf('\\r\\n\\r\\n');\n if (endOfHeaders === -1) {\n // keep buffering\n debug('have not received end of HTTP headers yet...');\n read();\n return;\n }\n const headerParts = buffered\n .slice(0, endOfHeaders)\n .toString('ascii')\n .split('\\r\\n');\n const firstLine = headerParts.shift();\n if (!firstLine) {\n socket.destroy();\n return reject(new Error('No header received from proxy CONNECT response'));\n }\n const firstLineParts = firstLine.split(' ');\n const statusCode = +firstLineParts[1];\n const statusText = firstLineParts.slice(2).join(' ');\n const headers = {};\n for (const header of headerParts) {\n if (!header)\n continue;\n const firstColon = header.indexOf(':');\n if (firstColon === -1) {\n socket.destroy();\n return reject(new Error(`Invalid header from proxy CONNECT response: \"${header}\"`));\n }\n const key = header.slice(0, firstColon).toLowerCase();\n const value = header.slice(firstColon + 1).trimStart();\n const current = headers[key];\n if (typeof current === 'string') {\n headers[key] = [current, value];\n }\n else if (Array.isArray(current)) {\n current.push(value);\n }\n else {\n headers[key] = value;\n }\n }\n debug('got proxy server response: %o %o', firstLine, headers);\n cleanup();\n resolve({\n connect: {\n statusCode,\n statusText,\n headers,\n },\n buffered,\n });\n }\n socket.on('error', onerror);\n socket.on('end', onend);\n read();\n });\n}\nexports.parseProxyResponse = parseProxyResponse;\n//# sourceMappingURL=parse-proxy-response.js.map", - "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpsProxyAgent = void 0;\nconst net = __importStar(require(\"net\"));\nconst tls = __importStar(require(\"tls\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst debug_1 = __importDefault(require(\"debug\"));\nconst agent_base_1 = require(\"agent-base\");\nconst url_1 = require(\"url\");\nconst parse_proxy_response_1 = require(\"./parse-proxy-response\");\nconst debug = (0, debug_1.default)('https-proxy-agent');\nconst setServernameFromNonIpHost = (options) => {\n if (options.servername === undefined &&\n options.host &&\n !net.isIP(options.host)) {\n return {\n ...options,\n servername: options.host,\n };\n }\n return options;\n};\n/**\n * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to\n * the specified \"HTTP(s) proxy server\" in order to proxy HTTPS requests.\n *\n * Outgoing HTTP requests are first tunneled through the proxy server using the\n * `CONNECT` HTTP request method to establish a connection to the proxy server,\n * and then the proxy server connects to the destination target and issues the\n * HTTP request from the proxy server.\n *\n * `https:` requests have their socket connection upgraded to TLS once\n * the connection to the proxy server has been established.\n */\nclass HttpsProxyAgent extends agent_base_1.Agent {\n constructor(proxy, opts) {\n super(opts);\n this.options = { path: undefined };\n this.proxy = typeof proxy === 'string' ? new url_1.URL(proxy) : proxy;\n this.proxyHeaders = opts?.headers ?? {};\n debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);\n // Trim off the brackets from IPv6 addresses\n const host = (this.proxy.hostname || this.proxy.host).replace(/^\\[|\\]$/g, '');\n const port = this.proxy.port\n ? parseInt(this.proxy.port, 10)\n : this.proxy.protocol === 'https:'\n ? 443\n : 80;\n this.connectOpts = {\n // Attempt to negotiate http/1.1 for proxy servers that support http/2\n ALPNProtocols: ['http/1.1'],\n ...(opts ? omit(opts, 'headers') : null),\n host,\n port,\n };\n }\n /**\n * Called when the node-core HTTP client library is creating a\n * new HTTP request.\n */\n async connect(req, opts) {\n const { proxy } = this;\n if (!opts.host) {\n throw new TypeError('No \"host\" provided');\n }\n // Create a socket connection to the proxy server.\n let socket;\n if (proxy.protocol === 'https:') {\n debug('Creating `tls.Socket`: %o', this.connectOpts);\n socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));\n }\n else {\n debug('Creating `net.Socket`: %o', this.connectOpts);\n socket = net.connect(this.connectOpts);\n }\n const headers = typeof this.proxyHeaders === 'function'\n ? this.proxyHeaders()\n : { ...this.proxyHeaders };\n const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;\n let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\\r\\n`;\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.username || proxy.password) {\n const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;\n }\n headers.Host = `${host}:${opts.port}`;\n if (!headers['Proxy-Connection']) {\n headers['Proxy-Connection'] = this.keepAlive\n ? 'Keep-Alive'\n : 'close';\n }\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);\n socket.write(`${payload}\\r\\n`);\n const { connect, buffered } = await proxyResponsePromise;\n req.emit('proxyConnect', connect);\n this.emit('proxyConnect', connect, req);\n if (connect.statusCode === 200) {\n req.once('socket', resume);\n if (opts.secureEndpoint) {\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n return tls.connect({\n ...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),\n socket,\n });\n }\n return socket;\n }\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n const fakeSocket = new net.Socket({ writable: false });\n fakeSocket.readable = true;\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s) => {\n debug('Replaying proxy buffer for failed request');\n (0, assert_1.default)(s.listenerCount('data') > 0);\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n return fakeSocket;\n }\n}\nHttpsProxyAgent.protocols = ['http', 'https'];\nexports.HttpsProxyAgent = HttpsProxyAgent;\nfunction resume(socket) {\n socket.resume();\n}\nfunction omit(obj, ...keys) {\n const ret = {};\n let key;\n for (key in obj) {\n if (!keys.includes(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n}\n//# sourceMappingURL=index.js.map", - "\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _Gaxios_instances, _a, _Gaxios_urlMayUseProxy, _Gaxios_applyRequestInterceptors, _Gaxios_applyResponseInterceptors, _Gaxios_prepareRequest, _Gaxios_proxyAgent, _Gaxios_getProxyAgent;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Gaxios = void 0;\nconst extend_1 = __importDefault(require(\"extend\"));\nconst https_1 = require(\"https\");\nconst node_fetch_1 = __importDefault(require(\"node-fetch\"));\nconst querystring_1 = __importDefault(require(\"querystring\"));\nconst is_stream_1 = __importDefault(require(\"is-stream\"));\nconst url_1 = require(\"url\");\nconst common_1 = require(\"./common\");\nconst retry_1 = require(\"./retry\");\nconst stream_1 = require(\"stream\");\nconst uuid_1 = require(\"uuid\");\nconst interceptor_1 = require(\"./interceptor\");\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fetch = hasFetch() ? window.fetch : node_fetch_1.default;\nfunction hasWindow() {\n return typeof window !== 'undefined' && !!window;\n}\nfunction hasFetch() {\n return hasWindow() && !!window.fetch;\n}\nfunction hasBuffer() {\n return typeof Buffer !== 'undefined';\n}\nfunction hasHeader(options, header) {\n return !!getHeader(options, header);\n}\nfunction getHeader(options, header) {\n header = header.toLowerCase();\n for (const key of Object.keys((options === null || options === void 0 ? void 0 : options.headers) || {})) {\n if (header === key.toLowerCase()) {\n return options.headers[key];\n }\n }\n return undefined;\n}\nclass Gaxios {\n /**\n * The Gaxios class is responsible for making HTTP requests.\n * @param defaults The default set of options to be used for this instance.\n */\n constructor(defaults) {\n _Gaxios_instances.add(this);\n this.agentCache = new Map();\n this.defaults = defaults || {};\n this.interceptors = {\n request: new interceptor_1.GaxiosInterceptorManager(),\n response: new interceptor_1.GaxiosInterceptorManager(),\n };\n }\n /**\n * Perform an HTTP request with the given options.\n * @param opts Set of HTTP options that will be used for this HTTP request.\n */\n async request(opts = {}) {\n opts = await __classPrivateFieldGet(this, _Gaxios_instances, \"m\", _Gaxios_prepareRequest).call(this, opts);\n opts = await __classPrivateFieldGet(this, _Gaxios_instances, \"m\", _Gaxios_applyRequestInterceptors).call(this, opts);\n return __classPrivateFieldGet(this, _Gaxios_instances, \"m\", _Gaxios_applyResponseInterceptors).call(this, this._request(opts));\n }\n async _defaultAdapter(opts) {\n const fetchImpl = opts.fetchImplementation || fetch;\n const res = (await fetchImpl(opts.url, opts));\n const data = await this.getResponseData(opts, res);\n return this.translateResponse(opts, res, data);\n }\n /**\n * Internal, retryable version of the `request` method.\n * @param opts Set of HTTP options that will be used for this HTTP request.\n */\n async _request(opts = {}) {\n var _b;\n try {\n let translatedResponse;\n if (opts.adapter) {\n translatedResponse = await opts.adapter(opts, this._defaultAdapter.bind(this));\n }\n else {\n translatedResponse = await this._defaultAdapter(opts);\n }\n if (!opts.validateStatus(translatedResponse.status)) {\n if (opts.responseType === 'stream') {\n let response = '';\n await new Promise(resolve => {\n (translatedResponse === null || translatedResponse === void 0 ? void 0 : translatedResponse.data).on('data', chunk => {\n response += chunk;\n });\n (translatedResponse === null || translatedResponse === void 0 ? void 0 : translatedResponse.data).on('end', resolve);\n });\n translatedResponse.data = response;\n }\n throw new common_1.GaxiosError(`Request failed with status code ${translatedResponse.status}`, opts, translatedResponse);\n }\n return translatedResponse;\n }\n catch (e) {\n const err = e instanceof common_1.GaxiosError\n ? e\n : new common_1.GaxiosError(e.message, opts, undefined, e);\n const { shouldRetry, config } = await (0, retry_1.getRetryConfig)(err);\n if (shouldRetry && config) {\n err.config.retryConfig.currentRetryAttempt =\n config.retryConfig.currentRetryAttempt;\n // The error's config could be redacted - therefore we only want to\n // copy the retry state over to the existing config\n opts.retryConfig = (_b = err.config) === null || _b === void 0 ? void 0 : _b.retryConfig;\n return this._request(opts);\n }\n throw err;\n }\n }\n async getResponseData(opts, res) {\n switch (opts.responseType) {\n case 'stream':\n return res.body;\n case 'json': {\n let data = await res.text();\n try {\n data = JSON.parse(data);\n }\n catch (_b) {\n // continue\n }\n return data;\n }\n case 'arraybuffer':\n return res.arrayBuffer();\n case 'blob':\n return res.blob();\n case 'text':\n return res.text();\n default:\n return this.getResponseDataFromContentType(res);\n }\n }\n /**\n * By default, throw for any non-2xx status code\n * @param status status code from the HTTP response\n */\n validateStatus(status) {\n return status >= 200 && status < 300;\n }\n /**\n * Encode a set of key/value pars into a querystring format (?foo=bar&baz=boo)\n * @param params key value pars to encode\n */\n paramsSerializer(params) {\n return querystring_1.default.stringify(params);\n }\n translateResponse(opts, res, data) {\n // headers need to be converted from a map to an obj\n const headers = {};\n res.headers.forEach((value, key) => {\n headers[key] = value;\n });\n return {\n config: opts,\n data: data,\n headers,\n status: res.status,\n statusText: res.statusText,\n // XMLHttpRequestLike\n request: {\n responseURL: res.url,\n },\n };\n }\n /**\n * Attempts to parse a response by looking at the Content-Type header.\n * @param {FetchResponse} response the HTTP response.\n * @returns {Promise} a promise that resolves to the response data.\n */\n async getResponseDataFromContentType(response) {\n let contentType = response.headers.get('Content-Type');\n if (contentType === null) {\n // Maintain existing functionality by calling text()\n return response.text();\n }\n contentType = contentType.toLowerCase();\n if (contentType.includes('application/json')) {\n let data = await response.text();\n try {\n data = JSON.parse(data);\n }\n catch (_b) {\n // continue\n }\n return data;\n }\n else if (contentType.match(/^text\\//)) {\n return response.text();\n }\n else {\n // If the content type is something not easily handled, just return the raw data (blob)\n return response.blob();\n }\n }\n /**\n * Creates an async generator that yields the pieces of a multipart/related request body.\n * This implementation follows the spec: https://www.ietf.org/rfc/rfc2387.txt. However, recursive\n * multipart/related requests are not currently supported.\n *\n * @param {GaxioMultipartOptions[]} multipartOptions the pieces to turn into a multipart/related body.\n * @param {string} boundary the boundary string to be placed between each part.\n */\n async *getMultipartRequest(multipartOptions, boundary) {\n const finale = `--${boundary}--`;\n for (const currentPart of multipartOptions) {\n const partContentType = currentPart.headers['Content-Type'] || 'application/octet-stream';\n const preamble = `--${boundary}\\r\\nContent-Type: ${partContentType}\\r\\n\\r\\n`;\n yield preamble;\n if (typeof currentPart.content === 'string') {\n yield currentPart.content;\n }\n else {\n yield* currentPart.content;\n }\n yield '\\r\\n';\n }\n yield finale;\n }\n}\nexports.Gaxios = Gaxios;\n_a = Gaxios, _Gaxios_instances = new WeakSet(), _Gaxios_urlMayUseProxy = function _Gaxios_urlMayUseProxy(url, noProxy = []) {\n var _b, _c;\n const candidate = new url_1.URL(url);\n const noProxyList = [...noProxy];\n const noProxyEnvList = ((_c = ((_b = process.env.NO_PROXY) !== null && _b !== void 0 ? _b : process.env.no_proxy)) === null || _c === void 0 ? void 0 : _c.split(',')) || [];\n for (const rule of noProxyEnvList) {\n noProxyList.push(rule.trim());\n }\n for (const rule of noProxyList) {\n // Match regex\n if (rule instanceof RegExp) {\n if (rule.test(candidate.toString())) {\n return false;\n }\n }\n // Match URL\n else if (rule instanceof url_1.URL) {\n if (rule.origin === candidate.origin) {\n return false;\n }\n }\n // Match string regex\n else if (rule.startsWith('*.') || rule.startsWith('.')) {\n const cleanedRule = rule.replace(/^\\*\\./, '.');\n if (candidate.hostname.endsWith(cleanedRule)) {\n return false;\n }\n }\n // Basic string match\n else if (rule === candidate.origin ||\n rule === candidate.hostname ||\n rule === candidate.href) {\n return false;\n }\n }\n return true;\n}, _Gaxios_applyRequestInterceptors = \n/**\n * Applies the request interceptors. The request interceptors are applied after the\n * call to prepareRequest is completed.\n *\n * @param {GaxiosOptions} options The current set of options.\n *\n * @returns {Promise} Promise that resolves to the set of options or response after interceptors are applied.\n */\nasync function _Gaxios_applyRequestInterceptors(options) {\n let promiseChain = Promise.resolve(options);\n for (const interceptor of this.interceptors.request.values()) {\n if (interceptor) {\n promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected);\n }\n }\n return promiseChain;\n}, _Gaxios_applyResponseInterceptors = \n/**\n * Applies the response interceptors. The response interceptors are applied after the\n * call to request is made.\n *\n * @param {GaxiosOptions} options The current set of options.\n *\n * @returns {Promise} Promise that resolves to the set of options or response after interceptors are applied.\n */\nasync function _Gaxios_applyResponseInterceptors(response) {\n let promiseChain = Promise.resolve(response);\n for (const interceptor of this.interceptors.response.values()) {\n if (interceptor) {\n promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected);\n }\n }\n return promiseChain;\n}, _Gaxios_prepareRequest = \n/**\n * Validates the options, merges them with defaults, and prepare request.\n *\n * @param options The original options passed from the client.\n * @returns Prepared options, ready to make a request\n */\nasync function _Gaxios_prepareRequest(options) {\n var _b, _c, _d, _e;\n const opts = (0, extend_1.default)(true, {}, this.defaults, options);\n if (!opts.url) {\n throw new Error('URL is required.');\n }\n // baseUrl has been deprecated, remove in 2.0\n const baseUrl = opts.baseUrl || opts.baseURL;\n if (baseUrl) {\n opts.url = baseUrl.toString() + opts.url;\n }\n opts.paramsSerializer = opts.paramsSerializer || this.paramsSerializer;\n if (opts.params && Object.keys(opts.params).length > 0) {\n let additionalQueryParams = opts.paramsSerializer(opts.params);\n if (additionalQueryParams.startsWith('?')) {\n additionalQueryParams = additionalQueryParams.slice(1);\n }\n const prefix = opts.url.toString().includes('?') ? '&' : '?';\n opts.url = opts.url + prefix + additionalQueryParams;\n }\n if (typeof options.maxContentLength === 'number') {\n opts.size = options.maxContentLength;\n }\n if (typeof options.maxRedirects === 'number') {\n opts.follow = options.maxRedirects;\n }\n opts.headers = opts.headers || {};\n if (opts.multipart === undefined && opts.data) {\n const isFormData = typeof FormData === 'undefined'\n ? false\n : (opts === null || opts === void 0 ? void 0 : opts.data) instanceof FormData;\n if (is_stream_1.default.readable(opts.data)) {\n opts.body = opts.data;\n }\n else if (hasBuffer() && Buffer.isBuffer(opts.data)) {\n // Do not attempt to JSON.stringify() a Buffer:\n opts.body = opts.data;\n if (!hasHeader(opts, 'Content-Type')) {\n opts.headers['Content-Type'] = 'application/json';\n }\n }\n else if (typeof opts.data === 'object') {\n // If www-form-urlencoded content type has been set, but data is\n // provided as an object, serialize the content using querystring:\n if (!isFormData) {\n if (getHeader(opts, 'content-type') ===\n 'application/x-www-form-urlencoded') {\n opts.body = opts.paramsSerializer(opts.data);\n }\n else {\n // } else if (!(opts.data instanceof FormData)) {\n if (!hasHeader(opts, 'Content-Type')) {\n opts.headers['Content-Type'] = 'application/json';\n }\n opts.body = JSON.stringify(opts.data);\n }\n }\n }\n else {\n opts.body = opts.data;\n }\n }\n else if (opts.multipart && opts.multipart.length > 0) {\n // note: once the minimum version reaches Node 16,\n // this can be replaced with randomUUID() function from crypto\n // and the dependency on UUID removed\n const boundary = (0, uuid_1.v4)();\n opts.headers['Content-Type'] = `multipart/related; boundary=${boundary}`;\n const bodyStream = new stream_1.PassThrough();\n opts.body = bodyStream;\n (0, stream_1.pipeline)(this.getMultipartRequest(opts.multipart, boundary), bodyStream, () => { });\n }\n opts.validateStatus = opts.validateStatus || this.validateStatus;\n opts.responseType = opts.responseType || 'unknown';\n if (!opts.headers['Accept'] && opts.responseType === 'json') {\n opts.headers['Accept'] = 'application/json';\n }\n opts.method = opts.method || 'GET';\n const proxy = opts.proxy ||\n ((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.HTTPS_PROXY) ||\n ((_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c.https_proxy) ||\n ((_d = process === null || process === void 0 ? void 0 : process.env) === null || _d === void 0 ? void 0 : _d.HTTP_PROXY) ||\n ((_e = process === null || process === void 0 ? void 0 : process.env) === null || _e === void 0 ? void 0 : _e.http_proxy);\n const urlMayUseProxy = __classPrivateFieldGet(this, _Gaxios_instances, \"m\", _Gaxios_urlMayUseProxy).call(this, opts.url, opts.noProxy);\n if (opts.agent) {\n // don't do any of the following options - use the user-provided agent.\n }\n else if (proxy && urlMayUseProxy) {\n const HttpsProxyAgent = await __classPrivateFieldGet(_a, _a, \"m\", _Gaxios_getProxyAgent).call(_a);\n if (this.agentCache.has(proxy)) {\n opts.agent = this.agentCache.get(proxy);\n }\n else {\n opts.agent = new HttpsProxyAgent(proxy, {\n cert: opts.cert,\n key: opts.key,\n });\n this.agentCache.set(proxy, opts.agent);\n }\n }\n else if (opts.cert && opts.key) {\n // Configure client for mTLS\n if (this.agentCache.has(opts.key)) {\n opts.agent = this.agentCache.get(opts.key);\n }\n else {\n opts.agent = new https_1.Agent({\n cert: opts.cert,\n key: opts.key,\n });\n this.agentCache.set(opts.key, opts.agent);\n }\n }\n if (typeof opts.errorRedactor !== 'function' &&\n opts.errorRedactor !== false) {\n opts.errorRedactor = common_1.defaultErrorRedactor;\n }\n return opts;\n}, _Gaxios_getProxyAgent = async function _Gaxios_getProxyAgent() {\n __classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, \"f\", _Gaxios_proxyAgent) || (await Promise.resolve().then(() => __importStar(require('https-proxy-agent')))).HttpsProxyAgent, \"f\", _Gaxios_proxyAgent);\n return __classPrivateFieldGet(this, _a, \"f\", _Gaxios_proxyAgent);\n};\n/**\n * A cache for the lazily-loaded proxy agent.\n *\n * Should use {@link Gaxios[#getProxyAgent]} to retrieve.\n */\n// using `import` to dynamically import the types here\n_Gaxios_proxyAgent = { value: void 0 };\n//# sourceMappingURL=gaxios.js.map", - "\"use strict\";\n// Copyright 2018 Google LLC\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.instance = exports.Gaxios = exports.GaxiosError = void 0;\nexports.request = request;\nconst gaxios_1 = require(\"./gaxios\");\nObject.defineProperty(exports, \"Gaxios\", { enumerable: true, get: function () { return gaxios_1.Gaxios; } });\nvar common_1 = require(\"./common\");\nObject.defineProperty(exports, \"GaxiosError\", { enumerable: true, get: function () { return common_1.GaxiosError; } });\n__exportStar(require(\"./interceptor\"), exports);\n/**\n * The default instance used when the `request` method is directly\n * invoked.\n */\nexports.instance = new gaxios_1.Gaxios();\n/**\n * Make an HTTP request using the given options.\n * @param opts Options for the request\n */\nasync function request(opts) {\n return exports.instance.request(opts);\n}\n//# sourceMappingURL=index.js.map", - ";(function (globalObject) {\r\n 'use strict';\r\n\r\n/*\r\n * bignumber.js v9.3.1\r\n * A JavaScript library for arbitrary-precision arithmetic.\r\n * https://github.com/MikeMcl/bignumber.js\r\n * Copyright (c) 2025 Michael Mclaughlin \r\n * MIT Licensed.\r\n *\r\n * BigNumber.prototype methods | BigNumber methods\r\n * |\r\n * absoluteValue abs | clone\r\n * comparedTo | config set\r\n * decimalPlaces dp | DECIMAL_PLACES\r\n * dividedBy div | ROUNDING_MODE\r\n * dividedToIntegerBy idiv | EXPONENTIAL_AT\r\n * exponentiatedBy pow | RANGE\r\n * integerValue | CRYPTO\r\n * isEqualTo eq | MODULO_MODE\r\n * isFinite | POW_PRECISION\r\n * isGreaterThan gt | FORMAT\r\n * isGreaterThanOrEqualTo gte | ALPHABET\r\n * isInteger | isBigNumber\r\n * isLessThan lt | maximum max\r\n * isLessThanOrEqualTo lte | minimum min\r\n * isNaN | random\r\n * isNegative | sum\r\n * isPositive |\r\n * isZero |\r\n * minus |\r\n * modulo mod |\r\n * multipliedBy times |\r\n * negated |\r\n * plus |\r\n * precision sd |\r\n * shiftedBy |\r\n * squareRoot sqrt |\r\n * toExponential |\r\n * toFixed |\r\n * toFormat |\r\n * toFraction |\r\n * toJSON |\r\n * toNumber |\r\n * toPrecision |\r\n * toString |\r\n * valueOf |\r\n *\r\n */\r\n\r\n\r\n var BigNumber,\r\n isNumeric = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,\r\n mathceil = Math.ceil,\r\n mathfloor = Math.floor,\r\n\r\n bignumberError = '[BigNumber Error] ',\r\n tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',\r\n\r\n BASE = 1e14,\r\n LOG_BASE = 14,\r\n MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1\r\n // MAX_INT32 = 0x7fffffff, // 2^31 - 1\r\n POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\r\n SQRT_BASE = 1e7,\r\n\r\n // EDITABLE\r\n // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\r\n // the arguments to toExponential, toFixed, toFormat, and toPrecision.\r\n MAX = 1E9; // 0 to MAX_INT32\r\n\r\n\r\n /*\r\n * Create and return a BigNumber constructor.\r\n */\r\n function clone(configObject) {\r\n var div, convertBase, parseNumeric,\r\n P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },\r\n ONE = new BigNumber(1),\r\n\r\n\r\n //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------\r\n\r\n\r\n // The default values below must be integers within the inclusive ranges stated.\r\n // The values can also be changed at run-time using BigNumber.set.\r\n\r\n // The maximum number of decimal places for operations involving division.\r\n DECIMAL_PLACES = 20, // 0 to MAX\r\n\r\n // The rounding mode used when rounding to the above decimal places, and when using\r\n // toExponential, toFixed, toFormat and toPrecision, and round (default value).\r\n // UP 0 Away from zero.\r\n // DOWN 1 Towards zero.\r\n // CEIL 2 Towards +Infinity.\r\n // FLOOR 3 Towards -Infinity.\r\n // HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n ROUNDING_MODE = 4, // 0 to 8\r\n\r\n // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\r\n\r\n // The exponent value at and beneath which toString returns exponential notation.\r\n // Number type: -7\r\n TO_EXP_NEG = -7, // 0 to -MAX\r\n\r\n // The exponent value at and above which toString returns exponential notation.\r\n // Number type: 21\r\n TO_EXP_POS = 21, // 0 to MAX\r\n\r\n // RANGE : [MIN_EXP, MAX_EXP]\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // Number type: -324 (5e-324)\r\n MIN_EXP = -1e7, // -1 to -MAX\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // Number type: 308 (1.7976931348623157e+308)\r\n // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\r\n MAX_EXP = 1e7, // 1 to MAX\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n CRYPTO = false, // true or false\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend.\r\n // This modulo mode is commonly known as 'truncated division' and is\r\n // equivalent to (a % n) in JavaScript.\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).\r\n // The remainder is always positive.\r\n //\r\n // The truncated division, floored division, Euclidian division and IEEE 754 remainder\r\n // modes are commonly used for the modulus operation.\r\n // Although the other rounding modes can also be used, they may not give useful results.\r\n MODULO_MODE = 1, // 0 to 9\r\n\r\n // The maximum number of significant digits of the result of the exponentiatedBy operation.\r\n // If POW_PRECISION is 0, there will be unlimited significant digits.\r\n POW_PRECISION = 0, // 0 to MAX\r\n\r\n // The format specification used by the BigNumber.prototype.toFormat method.\r\n FORMAT = {\r\n prefix: '',\r\n groupSize: 3,\r\n secondaryGroupSize: 0,\r\n groupSeparator: ',',\r\n decimalSeparator: '.',\r\n fractionGroupSize: 0,\r\n fractionGroupSeparator: '\\xA0', // non-breaking space\r\n suffix: ''\r\n },\r\n\r\n // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',\r\n // '-', '.', whitespace, or repeated character.\r\n // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'\r\n ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz',\r\n alphabetHasNormalDecimalDigits = true;\r\n\r\n\r\n //------------------------------------------------------------------------------------------\r\n\r\n\r\n // CONSTRUCTOR\r\n\r\n\r\n /*\r\n * The BigNumber constructor and exported function.\r\n * Create and return a new instance of a BigNumber object.\r\n *\r\n * v {number|string|BigNumber} A numeric value.\r\n * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.\r\n */\r\n function BigNumber(v, b) {\r\n var alphabet, c, caseChanged, e, i, isNum, len, str,\r\n x = this;\r\n\r\n // Enable constructor call without `new`.\r\n if (!(x instanceof BigNumber)) return new BigNumber(v, b);\r\n\r\n if (b == null) {\r\n\r\n if (v && v._isBigNumber === true) {\r\n x.s = v.s;\r\n\r\n if (!v.c || v.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else if (v.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = v.e;\r\n x.c = v.c.slice();\r\n }\r\n\r\n return;\r\n }\r\n\r\n if ((isNum = typeof v == 'number') && v * 0 == 0) {\r\n\r\n // Use `1 / n` to handle minus zero also.\r\n x.s = 1 / v < 0 ? (v = -v, -1) : 1;\r\n\r\n // Fast path for integers, where n < 2147483648 (2**31).\r\n if (v === ~~v) {\r\n for (e = 0, i = v; i >= 10; i /= 10, e++);\r\n\r\n if (e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else {\r\n x.e = e;\r\n x.c = [v];\r\n }\r\n\r\n return;\r\n }\r\n\r\n str = String(v);\r\n } else {\r\n\r\n if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);\r\n\r\n x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n\r\n // Allow exponential notation to be used with base 10 argument, while\r\n // also rounding to DECIMAL_PLACES as with other bases.\r\n if (b == 10 && alphabetHasNormalDecimalDigits) {\r\n x = new BigNumber(v);\r\n return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);\r\n }\r\n\r\n str = String(v);\r\n\r\n if (isNum = typeof v == 'number') {\r\n\r\n // Avoid potential interpretation of Infinity and NaN as base 44+ values.\r\n if (v * 0 != 0) return parseNumeric(x, str, isNum, b);\r\n\r\n x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (BigNumber.DEBUG && str.replace(/^0\\.0*|\\./, '').length > 15) {\r\n throw Error\r\n (tooManyDigits + v);\r\n }\r\n } else {\r\n x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n alphabet = ALPHABET.slice(0, b);\r\n e = i = 0;\r\n\r\n // Check that str is a valid base b number.\r\n // Don't use RegExp, so alphabet can contain special characters.\r\n for (len = str.length; i < len; i++) {\r\n if (alphabet.indexOf(c = str.charAt(i)) < 0) {\r\n if (c == '.') {\r\n\r\n // If '.' is not the first character and it has not be found before.\r\n if (i > e) {\r\n e = len;\r\n continue;\r\n }\r\n } else if (!caseChanged) {\r\n\r\n // Allow e.g. hexadecimal 'FF' as well as 'ff'.\r\n if (str == str.toUpperCase() && (str = str.toLowerCase()) ||\r\n str == str.toLowerCase() && (str = str.toUpperCase())) {\r\n caseChanged = true;\r\n i = -1;\r\n e = 0;\r\n continue;\r\n }\r\n }\r\n\r\n return parseNumeric(x, String(v), isNum, b);\r\n }\r\n }\r\n\r\n // Prevent later check for length on converted number.\r\n isNum = false;\r\n str = convertBase(str, b, 10, x.s);\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n else e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(--len) === 48;);\r\n\r\n if (str = str.slice(i, ++len)) {\r\n len -= i;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (isNum && BigNumber.DEBUG &&\r\n len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {\r\n throw Error\r\n (tooManyDigits + (x.s * v));\r\n }\r\n\r\n // Overflow?\r\n if ((e = e - i - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n x.c = x.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = e;\r\n x.c = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first element of the coefficient array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE; // i < 1\r\n\r\n if (i < len) {\r\n if (i) x.c.push(+str.slice(0, i));\r\n\r\n for (len -= LOG_BASE; i < len;) {\r\n x.c.push(+str.slice(i, i += LOG_BASE));\r\n }\r\n\r\n i = LOG_BASE - (str = str.slice(i)).length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--; str += '0');\r\n x.c.push(+str);\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n\r\n // CONSTRUCTOR PROPERTIES\r\n\r\n\r\n BigNumber.clone = clone;\r\n\r\n BigNumber.ROUND_UP = 0;\r\n BigNumber.ROUND_DOWN = 1;\r\n BigNumber.ROUND_CEIL = 2;\r\n BigNumber.ROUND_FLOOR = 3;\r\n BigNumber.ROUND_HALF_UP = 4;\r\n BigNumber.ROUND_HALF_DOWN = 5;\r\n BigNumber.ROUND_HALF_EVEN = 6;\r\n BigNumber.ROUND_HALF_CEIL = 7;\r\n BigNumber.ROUND_HALF_FLOOR = 8;\r\n BigNumber.EUCLID = 9;\r\n\r\n\r\n /*\r\n * Configure infrequently-changing library-wide settings.\r\n *\r\n * Accept an object with the following optional properties (if the value of a property is\r\n * a number, it must be an integer within the inclusive range stated):\r\n *\r\n * DECIMAL_PLACES {number} 0 to MAX\r\n * ROUNDING_MODE {number} 0 to 8\r\n * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX]\r\n * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX]\r\n * CRYPTO {boolean} true or false\r\n * MODULO_MODE {number} 0 to 9\r\n * POW_PRECISION {number} 0 to MAX\r\n * ALPHABET {string} A string of two or more unique characters which does\r\n * not contain '.'.\r\n * FORMAT {object} An object with some of the following properties:\r\n * prefix {string}\r\n * groupSize {number}\r\n * secondaryGroupSize {number}\r\n * groupSeparator {string}\r\n * decimalSeparator {string}\r\n * fractionGroupSize {number}\r\n * fractionGroupSeparator {string}\r\n * suffix {string}\r\n *\r\n * (The values assigned to the above FORMAT object properties are not checked for validity.)\r\n *\r\n * E.g.\r\n * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\r\n *\r\n * Ignore properties/parameters set to null or undefined, except for ALPHABET.\r\n *\r\n * Return an object with the properties current values.\r\n */\r\n BigNumber.config = BigNumber.set = function (obj) {\r\n var p, v;\r\n\r\n if (obj != null) {\r\n\r\n if (typeof obj == 'object') {\r\n\r\n // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n DECIMAL_PLACES = v;\r\n }\r\n\r\n // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\r\n // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 8, p);\r\n ROUNDING_MODE = v;\r\n }\r\n\r\n // EXPONENTIAL_AT {number|number[]}\r\n // Integer, -MAX to MAX inclusive or\r\n // [integer -MAX to 0 inclusive, 0 to MAX inclusive].\r\n // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, 0, p);\r\n intCheck(v[1], 0, MAX, p);\r\n TO_EXP_NEG = v[0];\r\n TO_EXP_POS = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);\r\n }\r\n }\r\n\r\n // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\r\n // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\r\n // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'\r\n if (obj.hasOwnProperty(p = 'RANGE')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, -1, p);\r\n intCheck(v[1], 1, MAX, p);\r\n MIN_EXP = v[0];\r\n MAX_EXP = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n if (v) {\r\n MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' cannot be zero: ' + v);\r\n }\r\n }\r\n }\r\n\r\n // CRYPTO {boolean} true or false.\r\n // '[BigNumber Error] CRYPTO not true or false: {v}'\r\n // '[BigNumber Error] crypto unavailable'\r\n if (obj.hasOwnProperty(p = 'CRYPTO')) {\r\n v = obj[p];\r\n if (v === !!v) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n CRYPTO = v;\r\n } else {\r\n CRYPTO = !v;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n } else {\r\n CRYPTO = v;\r\n }\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' not true or false: ' + v);\r\n }\r\n }\r\n\r\n // MODULO_MODE {number} Integer, 0 to 9 inclusive.\r\n // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'MODULO_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 9, p);\r\n MODULO_MODE = v;\r\n }\r\n\r\n // POW_PRECISION {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'POW_PRECISION')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n POW_PRECISION = v;\r\n }\r\n\r\n // FORMAT {object}\r\n // '[BigNumber Error] FORMAT not an object: {v}'\r\n if (obj.hasOwnProperty(p = 'FORMAT')) {\r\n v = obj[p];\r\n if (typeof v == 'object') FORMAT = v;\r\n else throw Error\r\n (bignumberError + p + ' not an object: ' + v);\r\n }\r\n\r\n // ALPHABET {string}\r\n // '[BigNumber Error] ALPHABET invalid: {v}'\r\n if (obj.hasOwnProperty(p = 'ALPHABET')) {\r\n v = obj[p];\r\n\r\n // Disallow if less than two characters,\r\n // or if it contains '+', '-', '.', whitespace, or a repeated character.\r\n if (typeof v == 'string' && !/^.?$|[+\\-.\\s]|(.).*\\1/.test(v)) {\r\n alphabetHasNormalDecimalDigits = v.slice(0, 10) == '0123456789';\r\n ALPHABET = v;\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' invalid: ' + v);\r\n }\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Object expected: {v}'\r\n throw Error\r\n (bignumberError + 'Object expected: ' + obj);\r\n }\r\n }\r\n\r\n return {\r\n DECIMAL_PLACES: DECIMAL_PLACES,\r\n ROUNDING_MODE: ROUNDING_MODE,\r\n EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],\r\n RANGE: [MIN_EXP, MAX_EXP],\r\n CRYPTO: CRYPTO,\r\n MODULO_MODE: MODULO_MODE,\r\n POW_PRECISION: POW_PRECISION,\r\n FORMAT: FORMAT,\r\n ALPHABET: ALPHABET\r\n };\r\n };\r\n\r\n\r\n /*\r\n * Return true if v is a BigNumber instance, otherwise return false.\r\n *\r\n * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.\r\n *\r\n * v {any}\r\n *\r\n * '[BigNumber Error] Invalid BigNumber: {v}'\r\n */\r\n BigNumber.isBigNumber = function (v) {\r\n if (!v || v._isBigNumber !== true) return false;\r\n if (!BigNumber.DEBUG) return true;\r\n\r\n var i, n,\r\n c = v.c,\r\n e = v.e,\r\n s = v.s;\r\n\r\n out: if ({}.toString.call(c) == '[object Array]') {\r\n\r\n if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {\r\n\r\n // If the first element is zero, the BigNumber value must be zero.\r\n if (c[0] === 0) {\r\n if (e === 0 && c.length === 1) return true;\r\n break out;\r\n }\r\n\r\n // Calculate number of digits that c[0] should have, based on the exponent.\r\n i = (e + 1) % LOG_BASE;\r\n if (i < 1) i += LOG_BASE;\r\n\r\n // Calculate number of digits of c[0].\r\n //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {\r\n if (String(c[0]).length == i) {\r\n\r\n for (i = 0; i < c.length; i++) {\r\n n = c[i];\r\n if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;\r\n }\r\n\r\n // Last element cannot be zero, unless it is the only element.\r\n if (n !== 0) return true;\r\n }\r\n }\r\n\r\n // Infinity/NaN\r\n } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {\r\n return true;\r\n }\r\n\r\n throw Error\r\n (bignumberError + 'Invalid BigNumber: ' + v);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.maximum = BigNumber.max = function () {\r\n return maxOrMin(arguments, -1);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.minimum = BigNumber.min = function () {\r\n return maxOrMin(arguments, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\r\n * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\r\n * zeros are produced).\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'\r\n * '[BigNumber Error] crypto unavailable'\r\n */\r\n BigNumber.random = (function () {\r\n var pow2_53 = 0x20000000000000;\r\n\r\n // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\r\n // Check if Math.random() produces more than 32 bits of randomness.\r\n // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\r\n // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\r\n var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\r\n ? function () { return mathfloor(Math.random() * pow2_53); }\r\n : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\r\n (Math.random() * 0x800000 | 0); };\r\n\r\n return function (dp) {\r\n var a, b, e, k, v,\r\n i = 0,\r\n c = [],\r\n rand = new BigNumber(ONE);\r\n\r\n if (dp == null) dp = DECIMAL_PLACES;\r\n else intCheck(dp, 0, MAX);\r\n\r\n k = mathceil(dp / LOG_BASE);\r\n\r\n if (CRYPTO) {\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n if (crypto.getRandomValues) {\r\n\r\n a = crypto.getRandomValues(new Uint32Array(k *= 2));\r\n\r\n for (; i < k;) {\r\n\r\n // 53 bits:\r\n // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\r\n // 11111 11111111 11111111 11111111 11100000 00000000 00000000\r\n // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\r\n // 11111 11111111 11111111\r\n // 0x20000 is 2^21.\r\n v = a[i] * 0x20000 + (a[i + 1] >>> 11);\r\n\r\n // Rejection sampling:\r\n // 0 <= v < 9007199254740992\r\n // Probability that v >= 9e15, is\r\n // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\r\n if (v >= 9e15) {\r\n b = crypto.getRandomValues(new Uint32Array(2));\r\n a[i] = b[0];\r\n a[i + 1] = b[1];\r\n } else {\r\n\r\n // 0 <= v <= 8999999999999999\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 2;\r\n }\r\n }\r\n i = k / 2;\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n a = crypto.randomBytes(k *= 7);\r\n\r\n for (; i < k;) {\r\n\r\n // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\r\n // 0x100000000 is 2^32, 0x1000000 is 2^24\r\n // 11111 11111111 11111111 11111111 11111111 11111111 11111111\r\n // 0 <= v < 9007199254740992\r\n v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +\r\n (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +\r\n (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];\r\n\r\n if (v >= 9e15) {\r\n crypto.randomBytes(7).copy(a, i);\r\n } else {\r\n\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 7;\r\n }\r\n }\r\n i = k / 7;\r\n } else {\r\n CRYPTO = false;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n }\r\n\r\n // Use Math.random.\r\n if (!CRYPTO) {\r\n\r\n for (; i < k;) {\r\n v = random53bitInt();\r\n if (v < 9e15) c[i++] = v % 1e14;\r\n }\r\n }\r\n\r\n k = c[--i];\r\n dp %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to dp.\r\n if (k && dp) {\r\n v = POWS_TEN[LOG_BASE - dp];\r\n c[i] = mathfloor(k / v) * v;\r\n }\r\n\r\n // Remove trailing elements which are zero.\r\n for (; c[i] === 0; c.pop(), i--);\r\n\r\n // Zero?\r\n if (i < 0) {\r\n c = [e = 0];\r\n } else {\r\n\r\n // Remove leading elements which are zero and adjust exponent accordingly.\r\n for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);\r\n\r\n // Count the digits of the first element of c to determine leading zeros, and...\r\n for (i = 1, v = c[0]; v >= 10; v /= 10, i++);\r\n\r\n // adjust the exponent accordingly.\r\n if (i < LOG_BASE) e -= LOG_BASE - i;\r\n }\r\n\r\n rand.e = e;\r\n rand.c = c;\r\n return rand;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the sum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.sum = function () {\r\n var i = 1,\r\n args = arguments,\r\n sum = new BigNumber(args[0]);\r\n for (; i < args.length;) sum = sum.plus(args[i++]);\r\n return sum;\r\n };\r\n\r\n\r\n // PRIVATE FUNCTIONS\r\n\r\n\r\n // Called by BigNumber and BigNumber.prototype.toString.\r\n convertBase = (function () {\r\n var decimal = '0123456789';\r\n\r\n /*\r\n * Convert string of baseIn to an array of numbers of baseOut.\r\n * Eg. toBaseOut('255', 10, 16) returns [15, 15].\r\n * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].\r\n */\r\n function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }\r\n\r\n // Convert a numeric string of baseIn to a numeric string of baseOut.\r\n // If the caller is toString, we are converting from base 10 to baseOut.\r\n // If the caller is BigNumber, we are converting from baseIn to base 10.\r\n return function (str, baseIn, baseOut, sign, callerIsToString) {\r\n var alphabet, d, e, k, r, x, xc, y,\r\n i = str.indexOf('.'),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace('.', '');\r\n y = new BigNumber(baseIn);\r\n x = y.pow(str.length - i);\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n\r\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),\r\n 10, baseOut, decimal);\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n\r\n xc = toBaseOut(str, baseIn, baseOut, callerIsToString\r\n ? (alphabet = ALPHABET, decimal)\r\n : (alphabet = decimal, ALPHABET));\r\n\r\n // xc now represents str as an integer and converted to baseOut. e is the exponent.\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xc[--k] == 0; xc.pop());\r\n\r\n // Zero?\r\n if (!xc[0]) return alphabet.charAt(0);\r\n\r\n // Does str represent an integer? If so, no need for the division.\r\n if (i < 0) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // The sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div(x, y, dp, rm, baseOut);\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n // xc now represents str converted to baseOut.\r\n\r\n // The index of the rounding digit.\r\n d = e + dp + 1;\r\n\r\n // The rounding digit: the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n\r\n // Look at the rounding digits and mode to determine whether to round up.\r\n\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n // If the index of the rounding digit is not greater than zero, or xc represents\r\n // zero, then the result of the base conversion is zero or, if rounding up, a value\r\n // such as 0.00001.\r\n if (d < 1 || !xc[0]) {\r\n\r\n // 1^-dp or 0\r\n str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);\r\n } else {\r\n\r\n // Truncate xc to the required number of decimal places.\r\n xc.length = d;\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (--baseOut; ++xc[--d] > baseOut;) {\r\n xc[d] = 0;\r\n\r\n if (!d) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (k = xc.length; !xc[--k];);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));\r\n\r\n // Add leading zeros, decimal point and trailing zeros as required.\r\n str = toFixedPoint(str, e, alphabet.charAt(0));\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n };\r\n })();\r\n\r\n\r\n // Perform division in the specified base. Called by div and convertBase.\r\n div = (function () {\r\n\r\n // Assume non-zero x and k.\r\n function multiply(x, k, base) {\r\n var m, temp, xlo, xhi,\r\n carry = 0,\r\n i = x.length,\r\n klo = k % SQRT_BASE,\r\n khi = k / SQRT_BASE | 0;\r\n\r\n for (x = x.slice(); i--;) {\r\n xlo = x[i] % SQRT_BASE;\r\n xhi = x[i] / SQRT_BASE | 0;\r\n m = khi * xlo + xhi * klo;\r\n temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;\r\n carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;\r\n x[i] = temp % base;\r\n }\r\n\r\n if (carry) x = [carry].concat(x);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, cmp;\r\n\r\n if (aL != bL) {\r\n cmp = aL > bL ? 1 : -1;\r\n } else {\r\n\r\n for (i = cmp = 0; i < aL; i++) {\r\n\r\n if (a[i] != b[i]) {\r\n cmp = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1; a.splice(0, 1));\r\n }\r\n\r\n // x: dividend, y: divisor.\r\n return function (x, y, dp, rm, base) {\r\n var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\r\n yL, yz,\r\n s = x.s == y.s ? 1 : -1,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xc || !xc[0] || !yc || !yc[0]) {\r\n\r\n return new BigNumber(\r\n\r\n // Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :\r\n\r\n // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\r\n xc && xc[0] == 0 || !yc ? s * 0 : s / 0\r\n );\r\n }\r\n\r\n q = new BigNumber(s);\r\n qc = q.c = [];\r\n e = x.e - y.e;\r\n s = dp + e + 1;\r\n\r\n if (!base) {\r\n base = BASE;\r\n e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);\r\n s = s / LOG_BASE | 0;\r\n }\r\n\r\n // Result exponent may be one less then the current value of e.\r\n // The coefficients of the BigNumbers from convertBase may have trailing zeros.\r\n for (i = 0; yc[i] == (xc[i] || 0); i++);\r\n\r\n if (yc[i] > (xc[i] || 0)) e--;\r\n\r\n if (s < 0) {\r\n qc.push(1);\r\n more = true;\r\n } else {\r\n xL = xc.length;\r\n yL = yc.length;\r\n i = 0;\r\n s += 2;\r\n\r\n // Normalise xc and yc so highest order digit of yc is >= base / 2.\r\n\r\n n = mathfloor(base / (yc[0] + 1));\r\n\r\n // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.\r\n // if (n > 1 || n++ == 1 && yc[0] < base / 2) {\r\n if (n > 1) {\r\n yc = multiply(yc, n, base);\r\n xc = multiply(xc, n, base);\r\n yL = yc.length;\r\n xL = xc.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xc.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL; rem[remL++] = 0);\r\n yz = yc.slice();\r\n yz = [0].concat(yz);\r\n yc0 = yc[0];\r\n if (yc[1] >= base / 2) yc0++;\r\n // Not necessary, but to prevent trial digit n > base, when using base 3.\r\n // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;\r\n\r\n do {\r\n n = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yc, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, n.\r\n\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // n is how many times the divisor goes into the current remainder.\r\n n = mathfloor(rem0 / yc0);\r\n\r\n // Algorithm:\r\n // product = divisor multiplied by trial digit (n).\r\n // Compare product and remainder.\r\n // If product is greater than remainder:\r\n // Subtract divisor from product, decrement trial digit.\r\n // Subtract product from remainder.\r\n // If product was less than remainder at the last compare:\r\n // Compare new remainder and divisor.\r\n // If remainder is greater than divisor:\r\n // Subtract divisor from remainder, increment trial digit.\r\n\r\n if (n > 1) {\r\n\r\n // n may be > base only when base is 3.\r\n if (n >= base) n = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiply(yc, n, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n // If product > remainder then trial digit n too high.\r\n // n is 1 too high about 5% of the time, and is not known to have\r\n // ever been more than 1 too high.\r\n while (compare(prod, rem, prodL, remL) == 1) {\r\n n--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yc, prodL, base);\r\n prodL = prod.length;\r\n cmp = 1;\r\n }\r\n } else {\r\n\r\n // n is 0 or 1, cmp is -1.\r\n // If n is 0, there is no need to compare yc and rem again below,\r\n // so change cmp to 1 to avoid it.\r\n // If n is 1, leave cmp as -1, so yc and rem are compared again.\r\n if (n == 0) {\r\n\r\n // divisor < remainder, so n must be at least 1.\r\n cmp = n = 1;\r\n }\r\n\r\n // product = divisor\r\n prod = yc.slice();\r\n prodL = prod.length;\r\n }\r\n\r\n if (prodL < remL) prod = [0].concat(prod);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n remL = rem.length;\r\n\r\n // If product was < remainder.\r\n if (cmp == -1) {\r\n\r\n // Compare divisor and new remainder.\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n // Trial digit n too low.\r\n // n is 1 too low about 5% of the time, and very rarely 2 too low.\r\n while (compare(yc, rem, yL, remL) < 1) {\r\n n++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yc, remL, base);\r\n remL = rem.length;\r\n }\r\n }\r\n } else if (cmp === 0) {\r\n n++;\r\n rem = [0];\r\n } // else cmp === 1 and n will be 0\r\n\r\n // Add the next digit, n, to the result array.\r\n qc[i++] = n;\r\n\r\n // Update the remainder.\r\n if (rem[0]) {\r\n rem[remL++] = xc[xi] || 0;\r\n } else {\r\n rem = [xc[xi]];\r\n remL = 1;\r\n }\r\n } while ((xi++ < xL || rem[0] != null) && s--);\r\n\r\n more = rem[0] != null;\r\n\r\n // Leading zero?\r\n if (!qc[0]) qc.splice(0, 1);\r\n }\r\n\r\n if (base == BASE) {\r\n\r\n // To calculate q.e, first get the number of digits of qc[0].\r\n for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);\r\n\r\n round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);\r\n\r\n // Caller is convertBase.\r\n } else {\r\n q.e = e;\r\n q.r = +more;\r\n }\r\n\r\n return q;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a string representing the value of BigNumber n in fixed-point or exponential\r\n * notation rounded to the specified decimal places or significant digits.\r\n *\r\n * n: a BigNumber.\r\n * i: the index of the last digit required (i.e. the digit that may be rounded up).\r\n * rm: the rounding mode.\r\n * id: 1 (toExponential) or 2 (toPrecision).\r\n */\r\n function format(n, i, rm, id) {\r\n var c0, e, ne, len, str;\r\n\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n if (!n.c) return n.toString();\r\n\r\n c0 = n.c[0];\r\n ne = n.e;\r\n\r\n if (i == null) {\r\n str = coeffToString(n.c);\r\n str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)\r\n ? toExponential(str, ne)\r\n : toFixedPoint(str, ne, '0');\r\n } else {\r\n n = round(new BigNumber(n), i, rm);\r\n\r\n // n.e may have changed if the value was rounded up.\r\n e = n.e;\r\n\r\n str = coeffToString(n.c);\r\n len = str.length;\r\n\r\n // toPrecision returns exponential notation if the number of significant digits\r\n // specified is less than the number of digits necessary to represent the integer\r\n // part of the value in fixed-point notation.\r\n\r\n // Exponential notation.\r\n if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {\r\n\r\n // Append zeros?\r\n for (; len < i; str += '0', len++);\r\n str = toExponential(str, e);\r\n\r\n // Fixed-point notation.\r\n } else {\r\n i -= ne + (id === 2 && e > ne);\r\n str = toFixedPoint(str, e, '0');\r\n\r\n // Append zeros?\r\n if (e + 1 > len) {\r\n if (--i > 0) for (str += '.'; i--; str += '0');\r\n } else {\r\n i += e - len;\r\n if (i > 0) {\r\n if (e + 1 == len) str += '.';\r\n for (; i--; str += '0');\r\n }\r\n }\r\n }\r\n }\r\n\r\n return n.s < 0 && c0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Handle BigNumber.max and BigNumber.min.\r\n // If any number is NaN, return NaN.\r\n function maxOrMin(args, n) {\r\n var k, y,\r\n i = 1,\r\n x = new BigNumber(args[0]);\r\n\r\n for (; i < args.length; i++) {\r\n y = new BigNumber(args[i]);\r\n if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n /*\r\n * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\r\n * Called by minus, plus and times.\r\n */\r\n function normalise(n, c, e) {\r\n var i = 1,\r\n j = c.length;\r\n\r\n // Remove trailing zeros.\r\n for (; !c[--j]; c.pop());\r\n\r\n // Calculate the base 10 exponent. First get the number of digits of c[0].\r\n for (j = c[0]; j >= 10; j /= 10, i++);\r\n\r\n // Overflow?\r\n if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n n.c = n.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n n.c = [n.e = 0];\r\n } else {\r\n n.e = e;\r\n n.c = c;\r\n }\r\n\r\n return n;\r\n }\r\n\r\n\r\n // Handle values that fail the validity test in BigNumber.\r\n parseNumeric = (function () {\r\n var basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i,\r\n dotAfter = /^([^.]+)\\.$/,\r\n dotBefore = /^\\.([^.]+)$/,\r\n isInfinityOrNaN = /^-?(Infinity|NaN)$/,\r\n whitespaceOrPlus = /^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g;\r\n\r\n return function (x, str, isNum, b) {\r\n var base,\r\n s = isNum ? str : str.replace(whitespaceOrPlus, '');\r\n\r\n // No exception on ±Infinity or NaN.\r\n if (isInfinityOrNaN.test(s)) {\r\n x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\r\n } else {\r\n if (!isNum) {\r\n\r\n // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\r\n s = s.replace(basePrefix, function (m, p1, p2) {\r\n base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\r\n return !b || b == base ? p1 : m;\r\n });\r\n\r\n if (b) {\r\n base = b;\r\n\r\n // E.g. '1.' to '1', '.1' to '0.1'\r\n s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');\r\n }\r\n\r\n if (str != s) return new BigNumber(s, base);\r\n }\r\n\r\n // '[BigNumber Error] Not a number: {n}'\r\n // '[BigNumber Error] Not a base {b} number: {n}'\r\n if (BigNumber.DEBUG) {\r\n throw Error\r\n (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);\r\n }\r\n\r\n // NaN\r\n x.s = null;\r\n }\r\n\r\n x.c = x.e = null;\r\n }\r\n })();\r\n\r\n\r\n /*\r\n * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\r\n * If r is truthy, it is known that there are more digits after the rounding digit.\r\n */\r\n function round(x, sd, rm, r) {\r\n var d, i, j, k, n, ni, rd,\r\n xc = x.c,\r\n pows10 = POWS_TEN;\r\n\r\n // if x is not Infinity or NaN...\r\n if (xc) {\r\n\r\n // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // n is a base 1e14 number, the value of the element of array x.c containing rd.\r\n // ni is the index of n within x.c.\r\n // d is the number of digits of n.\r\n // i is the index of rd within n including leading zeros.\r\n // j is the actual index of rd within n (if < 0, rd is a leading zero).\r\n out: {\r\n\r\n // Get the number of digits of the first element of xc.\r\n for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);\r\n i = sd - d;\r\n\r\n // If the rounding digit is in the first element of xc...\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n n = xc[ni = 0];\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = mathfloor(n / pows10[d - j - 1] % 10);\r\n } else {\r\n ni = mathceil((i + 1) / LOG_BASE);\r\n\r\n if (ni >= xc.length) {\r\n\r\n if (r) {\r\n\r\n // Needed by sqrt.\r\n for (; xc.length <= ni; xc.push(0));\r\n n = rd = 0;\r\n d = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n n = k = xc[ni];\r\n\r\n // Get the number of digits of n.\r\n for (d = 1; k >= 10; k /= 10, d++);\r\n\r\n // Get the index of rd within n.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within n, adjusted for leading zeros.\r\n // The number of leading zeros of n is given by LOG_BASE - d.\r\n j = i - LOG_BASE + d;\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);\r\n }\r\n }\r\n\r\n r = r || sd < 0 ||\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n // The expression n % pows10[d - j - 1] returns all digits of n to the right\r\n // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\r\n xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);\r\n\r\n r = rm < 4\r\n ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xc[0]) {\r\n xc.length = 0;\r\n\r\n if (r) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xc[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xc.length = ni;\r\n k = 1;\r\n ni--;\r\n } else {\r\n xc.length = ni + 1;\r\n k = pows10[LOG_BASE - i];\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of n.\r\n xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;\r\n }\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n for (; ;) {\r\n\r\n // If the digit to be rounded up is in the first element of xc...\r\n if (ni == 0) {\r\n\r\n // i will be the length of xc[0] before k is added.\r\n for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);\r\n j = xc[0] += k;\r\n for (k = 1; j >= 10; j /= 10, k++);\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xc[0] == BASE) xc[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xc[ni] += k;\r\n if (xc[ni] != BASE) break;\r\n xc[ni--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xc.length; xc[--i] === 0; xc.pop());\r\n }\r\n\r\n // Overflow? Infinity.\r\n if (x.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n\r\n // Underflow? Zero.\r\n } else if (x.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function valueOf(n) {\r\n var str,\r\n e = n.e;\r\n\r\n if (e === null) return n.toString();\r\n\r\n str = coeffToString(n.c);\r\n\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(str, e)\r\n : toFixedPoint(str, e, '0');\r\n\r\n return n.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // PROTOTYPE/INSTANCE METHODS\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the absolute value of this BigNumber.\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new BigNumber(this);\r\n if (x.s < 0) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * 0 if they have the same value,\r\n * or null if the value of either is NaN.\r\n */\r\n P.comparedTo = function (y, b) {\r\n return compare(this, new BigNumber(y, b));\r\n };\r\n\r\n\r\n /*\r\n * If dp is undefined or null or true or false, return the number of decimal places of the\r\n * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n *\r\n * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * [dp] {number} Decimal places: integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.decimalPlaces = P.dp = function (dp, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), dp + x.e + 1, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last number.\r\n if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);\r\n if (n < 0) n = 0;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\r\n * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.dividedBy = P.div = function (y, b) {\r\n return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the integer part of dividing the value of this\r\n * BigNumber by the value of BigNumber(y, b).\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y, b) {\r\n return div(this, new BigNumber(y, b), 0, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.\r\n *\r\n * If m is present, return the result modulo m.\r\n * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\r\n * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.\r\n *\r\n * The modular power operation works efficiently when x, n, and m are integers, otherwise it\r\n * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.\r\n *\r\n * n {number|string|BigNumber} The exponent. An integer.\r\n * [m] {number|string|BigNumber} The modulus.\r\n *\r\n * '[BigNumber Error] Exponent not an integer: {n}'\r\n */\r\n P.exponentiatedBy = P.pow = function (n, m) {\r\n var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,\r\n x = this;\r\n\r\n n = new BigNumber(n);\r\n\r\n // Allow NaN and ±Infinity, but not other non-integers.\r\n if (n.c && !n.isInteger()) {\r\n throw Error\r\n (bignumberError + 'Exponent not an integer: ' + valueOf(n));\r\n }\r\n\r\n if (m != null) m = new BigNumber(m);\r\n\r\n // Exponent of MAX_SAFE_INTEGER is 15.\r\n nIsBig = n.e > 14;\r\n\r\n // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.\r\n if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {\r\n\r\n // The sign of the result of pow when x is negative depends on the evenness of n.\r\n // If +n overflows to ±Infinity, the evenness of n would be not be known.\r\n y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));\r\n return m ? y.mod(m) : y;\r\n }\r\n\r\n nIsNeg = n.s < 0;\r\n\r\n if (m) {\r\n\r\n // x % m returns NaN if abs(m) is zero, or m is NaN.\r\n if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);\r\n\r\n isModExp = !nIsNeg && x.isInteger() && m.isInteger();\r\n\r\n if (isModExp) x = x.mod(m);\r\n\r\n // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.\r\n // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.\r\n } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0\r\n // [1, 240000000]\r\n ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7\r\n // [80000000000000] [99999750000000]\r\n : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {\r\n\r\n // If x is negative and n is odd, k = -0, else k = 0.\r\n k = x.s < 0 && isOdd(n) ? -0 : 0;\r\n\r\n // If x >= 1, k = ±Infinity.\r\n if (x.e > -1) k = 1 / k;\r\n\r\n // If n is negative return ±0, else return ±Infinity.\r\n return new BigNumber(nIsNeg ? 1 / k : k);\r\n\r\n } else if (POW_PRECISION) {\r\n\r\n // Truncating each coefficient array to a length of k after each multiplication\r\n // equates to truncating significant digits to POW_PRECISION + [28, 41],\r\n // i.e. there will be a minimum of 28 guard digits retained.\r\n k = mathceil(POW_PRECISION / LOG_BASE + 2);\r\n }\r\n\r\n if (nIsBig) {\r\n half = new BigNumber(0.5);\r\n if (nIsNeg) n.s = 1;\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = Math.abs(+valueOf(n));\r\n nIsOdd = i % 2;\r\n }\r\n\r\n y = new BigNumber(ONE);\r\n\r\n // Performs 54 loop iterations for n of 9007199254740991.\r\n for (; ;) {\r\n\r\n if (nIsOdd) {\r\n y = y.times(x);\r\n if (!y.c) break;\r\n\r\n if (k) {\r\n if (y.c.length > k) y.c.length = k;\r\n } else if (isModExp) {\r\n y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (i) {\r\n i = mathfloor(i / 2);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n } else {\r\n n = n.times(half);\r\n round(n, n.e + 1, 1);\r\n\r\n if (n.e > 14) {\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = +valueOf(n);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n }\r\n }\r\n\r\n x = x.times(x);\r\n\r\n if (k) {\r\n if (x.c && x.c.length > k) x.c.length = k;\r\n } else if (isModExp) {\r\n x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (isModExp) return y;\r\n if (nIsNeg) y = ONE.div(y);\r\n\r\n return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer\r\n * using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'\r\n */\r\n P.integerValue = function (rm) {\r\n var n = new BigNumber(this);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n return round(n, n.e + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isEqualTo = P.eq = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is a finite number, otherwise return false.\r\n */\r\n P.isFinite = function () {\r\n return !!this.c;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isGreaterThan = P.gt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isGreaterThanOrEqualTo = P.gte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;\r\n\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is an integer, otherwise return false.\r\n */\r\n P.isInteger = function () {\r\n return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isLessThan = P.lt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isLessThanOrEqualTo = P.lte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is NaN, otherwise return false.\r\n */\r\n P.isNaN = function () {\r\n return !this.s;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is negative, otherwise return false.\r\n */\r\n P.isNegative = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is positive, otherwise return false.\r\n */\r\n P.isPositive = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is 0 or -0, otherwise return false.\r\n */\r\n P.isZero = function () {\r\n return !!this.c && this.c[0] == 0;\r\n };\r\n\r\n\r\n /*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber minus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.minus = function (y, b) {\r\n var i, j, t, xLTy,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.plus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :\r\n\r\n // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\r\n ROUNDING_MODE == 3 ? -0 : 0);\r\n }\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Determine which is the bigger number.\r\n if (a = xe - ye) {\r\n\r\n if (xLTy = a < 0) {\r\n a = -a;\r\n t = xc;\r\n } else {\r\n ye = xe;\r\n t = yc;\r\n }\r\n\r\n t.reverse();\r\n\r\n // Prepend zeros to equalise exponents.\r\n for (b = a; b--; t.push(0));\r\n t.reverse();\r\n } else {\r\n\r\n // Exponents equal. Check digit by digit.\r\n j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;\r\n\r\n for (a = b = 0; b < j; b++) {\r\n\r\n if (xc[b] != yc[b]) {\r\n xLTy = xc[b] < yc[b];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // x < y? Point xc to the array of the bigger number.\r\n if (xLTy) {\r\n t = xc;\r\n xc = yc;\r\n yc = t;\r\n y.s = -y.s;\r\n }\r\n\r\n b = (j = yc.length) - (i = xc.length);\r\n\r\n // Append zeros to xc if shorter.\r\n // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\r\n if (b > 0) for (; b--; xc[i++] = 0);\r\n b = BASE - 1;\r\n\r\n // Subtract yc from xc.\r\n for (; j > a;) {\r\n\r\n if (xc[--j] < yc[j]) {\r\n for (i = j; i && !xc[--i]; xc[i] = b);\r\n --xc[i];\r\n xc[j] += BASE;\r\n }\r\n\r\n xc[j] -= yc[j];\r\n }\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xc[0] == 0; xc.splice(0, 1), --ye);\r\n\r\n // Zero?\r\n if (!xc[0]) {\r\n\r\n // Following IEEE 754 (2008) 6.3,\r\n // n - n = +0 but n - n = -0 when rounding towards -Infinity.\r\n y.s = ROUNDING_MODE == 3 ? -1 : 1;\r\n y.c = [y.e = 0];\r\n return y;\r\n }\r\n\r\n // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\r\n // for finite x and y.\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\r\n * BigNumber(y, b). The result depends on the value of MODULO_MODE.\r\n */\r\n P.modulo = P.mod = function (y, b) {\r\n var q, s,\r\n x = this;\r\n\r\n y = new BigNumber(y, b);\r\n\r\n // Return NaN if x is Infinity or NaN, or y is NaN or zero.\r\n if (!x.c || !y.s || y.c && !y.c[0]) {\r\n return new BigNumber(NaN);\r\n\r\n // Return x if y is Infinity or x is zero.\r\n } else if (!y.c || x.c && !x.c[0]) {\r\n return new BigNumber(x);\r\n }\r\n\r\n if (MODULO_MODE == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // r = x - qy where 0 <= r < abs(y)\r\n s = y.s;\r\n y.s = 1;\r\n q = div(x, y, 0, 3);\r\n y.s = s;\r\n q.s *= s;\r\n } else {\r\n q = div(x, y, 0, MODULO_MODE);\r\n }\r\n\r\n y = x.minus(q.times(y));\r\n\r\n // To match JavaScript %, ensure sign of zero is sign of dividend.\r\n if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value\r\n * of BigNumber(y, b).\r\n */\r\n P.multipliedBy = P.times = function (y, b) {\r\n var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\r\n base, sqrtBase,\r\n x = this,\r\n xc = x.c,\r\n yc = (y = new BigNumber(y, b)).c;\r\n\r\n // Either NaN, ±Infinity or ±0?\r\n if (!xc || !yc || !xc[0] || !yc[0]) {\r\n\r\n // Return NaN if either is NaN, or one is 0 and the other is Infinity.\r\n if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {\r\n y.c = y.e = y.s = null;\r\n } else {\r\n y.s *= x.s;\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n if (!xc || !yc) {\r\n y.c = y.e = null;\r\n\r\n // Return ±0 if either is ±0.\r\n } else {\r\n y.c = [0];\r\n y.e = 0;\r\n }\r\n }\r\n\r\n return y;\r\n }\r\n\r\n e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);\r\n y.s *= x.s;\r\n xcL = xc.length;\r\n ycL = yc.length;\r\n\r\n // Ensure xc points to longer array and xcL to its length.\r\n if (xcL < ycL) {\r\n zc = xc;\r\n xc = yc;\r\n yc = zc;\r\n i = xcL;\r\n xcL = ycL;\r\n ycL = i;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n for (i = xcL + ycL, zc = []; i--; zc.push(0));\r\n\r\n base = BASE;\r\n sqrtBase = SQRT_BASE;\r\n\r\n for (i = ycL; --i >= 0;) {\r\n c = 0;\r\n ylo = yc[i] % sqrtBase;\r\n yhi = yc[i] / sqrtBase | 0;\r\n\r\n for (k = xcL, j = i + k; j > i;) {\r\n xlo = xc[--k] % sqrtBase;\r\n xhi = xc[k] / sqrtBase | 0;\r\n m = yhi * xlo + xhi * ylo;\r\n xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;\r\n c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;\r\n zc[j--] = xlo % base;\r\n }\r\n\r\n zc[j] = c;\r\n }\r\n\r\n if (c) {\r\n ++e;\r\n } else {\r\n zc.splice(0, 1);\r\n }\r\n\r\n return normalise(y, zc, e);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber negated,\r\n * i.e. multiplied by -1.\r\n */\r\n P.negated = function () {\r\n var x = new BigNumber(this);\r\n x.s = -x.s || null;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber plus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.plus = function (y, b) {\r\n var t,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.minus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Return ±Infinity if either ±Infinity.\r\n if (!xc || !yc) return new BigNumber(a / 0);\r\n\r\n // Either zero?\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\r\n if (a = xe - ye) {\r\n if (a > 0) {\r\n ye = xe;\r\n t = yc;\r\n } else {\r\n a = -a;\r\n t = xc;\r\n }\r\n\r\n t.reverse();\r\n for (; a--; t.push(0));\r\n t.reverse();\r\n }\r\n\r\n a = xc.length;\r\n b = yc.length;\r\n\r\n // Point xc to the longer array, and b to the shorter length.\r\n if (a - b < 0) {\r\n t = yc;\r\n yc = xc;\r\n xc = t;\r\n b = a;\r\n }\r\n\r\n // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\r\n for (a = 0; b;) {\r\n a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;\r\n xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;\r\n }\r\n\r\n if (a) {\r\n xc = [a].concat(xc);\r\n ++ye;\r\n }\r\n\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n // ye = MAX_EXP + 1 possible\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * If sd is undefined or null or true or false, return the number of significant digits of\r\n * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n * If sd is true include integer-part trailing zeros in the count.\r\n *\r\n * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.\r\n * boolean: whether to count integer-part trailing zeros: true or false.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.precision = P.sd = function (sd, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (sd != null && sd !== !!sd) {\r\n intCheck(sd, 1, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), sd, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n v = c.length - 1;\r\n n = v * LOG_BASE + 1;\r\n\r\n if (v = c[v]) {\r\n\r\n // Subtract the number of trailing zeros of the last element.\r\n for (; v % 10 == 0; v /= 10, n--);\r\n\r\n // Add the number of digits of the first element.\r\n for (v = c[0]; v >= 10; v /= 10, n++);\r\n }\r\n\r\n if (sd && x.e + 1 > n) n = x.e + 1;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\r\n * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\r\n *\r\n * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'\r\n */\r\n P.shiftedBy = function (k) {\r\n intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);\r\n return this.times('1e' + k);\r\n };\r\n\r\n\r\n /*\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n * Return a new BigNumber whose value is the square root of the value of this BigNumber,\r\n * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var m, n, r, rep, t,\r\n x = this,\r\n c = x.c,\r\n s = x.s,\r\n e = x.e,\r\n dp = DECIMAL_PLACES + 4,\r\n half = new BigNumber('0.5');\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !c || !c[0]) {\r\n return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);\r\n }\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+valueOf(x));\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = coeffToString(c);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(+n);\r\n e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new BigNumber(n);\r\n } else {\r\n r = new BigNumber(s + '');\r\n }\r\n\r\n // Check for zero.\r\n // r could be zero if MIN_EXP is changed after the this value was created.\r\n // This would cause a division by zero (x/t) and hence Infinity below, which would cause\r\n // coeffToString to throw.\r\n if (r.c[0]) {\r\n e = r.e;\r\n s = e + dp;\r\n if (s < 3) s = 0;\r\n\r\n // Newton-Raphson iteration.\r\n for (; ;) {\r\n t = r;\r\n r = half.times(t.plus(div(x, t, dp, 1)));\r\n\r\n if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {\r\n\r\n // The exponent of r may here be one less than the final result exponent,\r\n // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\r\n // are indexed correctly.\r\n if (r.e < e) --s;\r\n n = n.slice(s - 3, s + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\r\n // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\r\n // iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the\r\n // exact result as the nines may infinitely repeat.\r\n if (!rep) {\r\n round(t, t.e + DECIMAL_PLACES + 2, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n dp += 4;\r\n s += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\r\n // result. If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n round(r, r.e + DECIMAL_PLACES + 2, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in exponential notation and\r\n * rounded using ROUNDING_MODE to dp fixed decimal places.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toExponential = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp++;\r\n }\r\n return format(this, dp, rm, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounding\r\n * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\r\n * but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toFixed = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp = dp + this.e + 1;\r\n }\r\n return format(this, dp, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounded\r\n * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\r\n * of the format or FORMAT object (see BigNumber.set).\r\n *\r\n * The formatting object may contain some or all of the properties shown below.\r\n *\r\n * FORMAT = {\r\n * prefix: '',\r\n * groupSize: 3,\r\n * secondaryGroupSize: 0,\r\n * groupSeparator: ',',\r\n * decimalSeparator: '.',\r\n * fractionGroupSize: 0,\r\n * fractionGroupSeparator: '\\xA0', // non-breaking space\r\n * suffix: ''\r\n * };\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n * [format] {object} Formatting options. See FORMAT pbject above.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n * '[BigNumber Error] Argument not an object: {format}'\r\n */\r\n P.toFormat = function (dp, rm, format) {\r\n var str,\r\n x = this;\r\n\r\n if (format == null) {\r\n if (dp != null && rm && typeof rm == 'object') {\r\n format = rm;\r\n rm = null;\r\n } else if (dp && typeof dp == 'object') {\r\n format = dp;\r\n dp = rm = null;\r\n } else {\r\n format = FORMAT;\r\n }\r\n } else if (typeof format != 'object') {\r\n throw Error\r\n (bignumberError + 'Argument not an object: ' + format);\r\n }\r\n\r\n str = x.toFixed(dp, rm);\r\n\r\n if (x.c) {\r\n var i,\r\n arr = str.split('.'),\r\n g1 = +format.groupSize,\r\n g2 = +format.secondaryGroupSize,\r\n groupSeparator = format.groupSeparator || '',\r\n intPart = arr[0],\r\n fractionPart = arr[1],\r\n isNeg = x.s < 0,\r\n intDigits = isNeg ? intPart.slice(1) : intPart,\r\n len = intDigits.length;\r\n\r\n if (g2) {\r\n i = g1;\r\n g1 = g2;\r\n g2 = i;\r\n len -= i;\r\n }\r\n\r\n if (g1 > 0 && len > 0) {\r\n i = len % g1 || g1;\r\n intPart = intDigits.substr(0, i);\r\n for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);\r\n if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);\r\n if (isNeg) intPart = '-' + intPart;\r\n }\r\n\r\n str = fractionPart\r\n ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)\r\n ? fractionPart.replace(new RegExp('\\\\d{' + g2 + '}\\\\B', 'g'),\r\n '$&' + (format.fractionGroupSeparator || ''))\r\n : fractionPart)\r\n : intPart;\r\n }\r\n\r\n return (format.prefix || '') + str + (format.suffix || '');\r\n };\r\n\r\n\r\n /*\r\n * Return an array of two BigNumbers representing the value of this BigNumber as a simple\r\n * fraction with an integer numerator and an integer denominator.\r\n * The denominator will be a positive non-zero value less than or equal to the specified\r\n * maximum denominator. If a maximum denominator is not specified, the denominator will be\r\n * the lowest value necessary to represent the number exactly.\r\n *\r\n * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.\r\n *\r\n * '[BigNumber Error] Argument {not an integer|out of range} : {md}'\r\n */\r\n P.toFraction = function (md) {\r\n var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,\r\n x = this,\r\n xc = x.c;\r\n\r\n if (md != null) {\r\n n = new BigNumber(md);\r\n\r\n // Throw if md is less than one or is not an integer, unless it is Infinity.\r\n if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {\r\n throw Error\r\n (bignumberError + 'Argument ' +\r\n (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));\r\n }\r\n }\r\n\r\n if (!xc) return new BigNumber(x);\r\n\r\n d = new BigNumber(ONE);\r\n n1 = d0 = new BigNumber(ONE);\r\n d1 = n0 = new BigNumber(ONE);\r\n s = coeffToString(xc);\r\n\r\n // Determine initial denominator.\r\n // d is a power of 10 and the minimum max denominator that specifies the value exactly.\r\n e = d.e = s.length - x.e - 1;\r\n d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];\r\n md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;\r\n\r\n exp = MAX_EXP;\r\n MAX_EXP = 1 / 0;\r\n n = new BigNumber(s);\r\n\r\n // n0 = d1 = 0\r\n n0.c[0] = 0;\r\n\r\n for (; ;) {\r\n q = div(n, d, 0, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.comparedTo(md) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n n1 = n0.plus(q.times(d2 = n1));\r\n n0 = d2;\r\n d = n.minus(q.times(d2 = d));\r\n n = d2;\r\n }\r\n\r\n d2 = div(md.minus(d0), d1, 0, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n e = e * 2;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1\r\n r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(\r\n div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];\r\n\r\n MAX_EXP = exp;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this BigNumber converted to a number primitive.\r\n */\r\n P.toNumber = function () {\r\n return +valueOf(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber rounded to sd significant digits\r\n * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\r\n * necessary to represent the integer part of the value in fixed-point notation, then use\r\n * exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n if (sd != null) intCheck(sd, 1, MAX);\r\n return format(this, sd, rm, 2);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in base b, or base 10 if b is\r\n * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\r\n * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\r\n * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\r\n * TO_EXP_NEG, return exponential notation.\r\n *\r\n * [b] {number} Integer, 2 to ALPHABET.length inclusive.\r\n *\r\n * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n */\r\n P.toString = function (b) {\r\n var str,\r\n n = this,\r\n s = n.s,\r\n e = n.e;\r\n\r\n // Infinity or NaN?\r\n if (e === null) {\r\n if (s) {\r\n str = 'Infinity';\r\n if (s < 0) str = '-' + str;\r\n } else {\r\n str = 'NaN';\r\n }\r\n } else {\r\n if (b == null) {\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(coeffToString(n.c), e)\r\n : toFixedPoint(coeffToString(n.c), e, '0');\r\n } else if (b === 10 && alphabetHasNormalDecimalDigits) {\r\n n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);\r\n str = toFixedPoint(coeffToString(n.c), n.e, '0');\r\n } else {\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);\r\n }\r\n\r\n if (s < 0 && n.c[0]) str = '-' + str;\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return as toString, but do not accept a base argument, and include the minus sign for\r\n * negative zero.\r\n */\r\n P.valueOf = P.toJSON = function () {\r\n return valueOf(this);\r\n };\r\n\r\n\r\n P._isBigNumber = true;\r\n\r\n if (configObject != null) BigNumber.set(configObject);\r\n\r\n return BigNumber;\r\n }\r\n\r\n\r\n // PRIVATE HELPER FUNCTIONS\r\n\r\n // These functions don't need access to variables,\r\n // e.g. DECIMAL_PLACES, in the scope of the `clone` function above.\r\n\r\n\r\n function bitFloor(n) {\r\n var i = n | 0;\r\n return n > 0 || n === i ? i : i - 1;\r\n }\r\n\r\n\r\n // Return a coefficient array as a string of base 10 digits.\r\n function coeffToString(a) {\r\n var s, z,\r\n i = 1,\r\n j = a.length,\r\n r = a[0] + '';\r\n\r\n for (; i < j;) {\r\n s = a[i++] + '';\r\n z = LOG_BASE - s.length;\r\n for (; z--; s = '0' + s);\r\n r += s;\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (j = r.length; r.charCodeAt(--j) === 48;);\r\n\r\n return r.slice(0, j + 1 || 1);\r\n }\r\n\r\n\r\n // Compare the value of BigNumbers x and y.\r\n function compare(x, y) {\r\n var a, b,\r\n xc = x.c,\r\n yc = y.c,\r\n i = x.s,\r\n j = y.s,\r\n k = x.e,\r\n l = y.e;\r\n\r\n // Either NaN?\r\n if (!i || !j) return null;\r\n\r\n a = xc && !xc[0];\r\n b = yc && !yc[0];\r\n\r\n // Either zero?\r\n if (a || b) return a ? b ? 0 : -j : i;\r\n\r\n // Signs differ?\r\n if (i != j) return i;\r\n\r\n a = i < 0;\r\n b = k == l;\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;\r\n\r\n // Compare exponents.\r\n if (!b) return k > l ^ a ? 1 : -1;\r\n\r\n j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n // Compare digit by digit.\r\n for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;\r\n\r\n // Compare lengths.\r\n return k == l ? 0 : k > l ^ a ? 1 : -1;\r\n }\r\n\r\n\r\n /*\r\n * Check that n is a primitive number, an integer, and in range, otherwise throw.\r\n */\r\n function intCheck(n, min, max, name) {\r\n if (n < min || n > max || n !== mathfloor(n)) {\r\n throw Error\r\n (bignumberError + (name || 'Argument') + (typeof n == 'number'\r\n ? n < min || n > max ? ' out of range: ' : ' not an integer: '\r\n : ' not a primitive number: ') + String(n));\r\n }\r\n }\r\n\r\n\r\n // Assumes finite n.\r\n function isOdd(n) {\r\n var k = n.c.length - 1;\r\n return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;\r\n }\r\n\r\n\r\n function toExponential(str, e) {\r\n return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +\r\n (e < 0 ? 'e' : 'e+') + e;\r\n }\r\n\r\n\r\n function toFixedPoint(str, e, z) {\r\n var len, zs;\r\n\r\n // Negative exponent?\r\n if (e < 0) {\r\n\r\n // Prepend zeros.\r\n for (zs = z + '.'; ++e; zs += z);\r\n str = zs + str;\r\n\r\n // Positive exponent\r\n } else {\r\n len = str.length;\r\n\r\n // Append zeros.\r\n if (++e > len) {\r\n for (zs = z, e -= len; --e; zs += z);\r\n str += zs;\r\n } else if (e < len) {\r\n str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n return str;\r\n }\r\n\r\n\r\n // EXPORT\r\n\r\n\r\n BigNumber = clone();\r\n BigNumber['default'] = BigNumber.BigNumber = BigNumber;\r\n\r\n // AMD.\r\n if (typeof define == 'function' && define.amd) {\r\n define(function () { return BigNumber; });\r\n\r\n // Node.js and other environments that support module.exports.\r\n } else if (typeof module != 'undefined' && module.exports) {\r\n module.exports = BigNumber;\r\n\r\n // Browser.\r\n } else {\r\n if (!globalObject) {\r\n globalObject = typeof self != 'undefined' && self ? self : window;\r\n }\r\n\r\n globalObject.BigNumber = BigNumber;\r\n }\r\n})(this);\r\n", - "var BigNumber = require('bignumber.js');\n\n/*\n json2.js\n 2013-05-26\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n See http://www.JSON.org/js.html\n\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n\n\n This file creates a global JSON object containing two methods: stringify\n and parse.\n\n JSON.stringify(value, replacer, space)\n value any JavaScript value, usually an object or array.\n\n replacer an optional parameter that determines how object\n values are stringified for objects. It can be a\n function or an array of strings.\n\n space an optional parameter that specifies the indentation\n of nested structures. If it is omitted, the text will\n be packed without extra whitespace. If it is a number,\n it will specify the number of spaces to indent at each\n level. If it is a string (such as '\\t' or ' '),\n it contains the characters used to indent at each level.\n\n This method produces a JSON text from a JavaScript value.\n\n When an object value is found, if the object contains a toJSON\n method, its toJSON method will be called and the result will be\n stringified. A toJSON method does not serialize: it returns the\n value represented by the name/value pair that should be serialized,\n or undefined if nothing should be serialized. The toJSON method\n will be passed the key associated with the value, and this will be\n bound to the value\n\n For example, this would serialize Dates as ISO strings.\n\n Date.prototype.toJSON = function (key) {\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n }\n\n return this.getUTCFullYear() + '-' +\n f(this.getUTCMonth() + 1) + '-' +\n f(this.getUTCDate()) + 'T' +\n f(this.getUTCHours()) + ':' +\n f(this.getUTCMinutes()) + ':' +\n f(this.getUTCSeconds()) + 'Z';\n };\n\n You can provide an optional replacer method. It will be passed the\n key and value of each member, with this bound to the containing\n object. The value that is returned from your method will be\n serialized. If your method returns undefined, then the member will\n be excluded from the serialization.\n\n If the replacer parameter is an array of strings, then it will be\n used to select the members to be serialized. It filters the results\n such that only members with keys listed in the replacer array are\n stringified.\n\n Values that do not have JSON representations, such as undefined or\n functions, will not be serialized. Such values in objects will be\n dropped; in arrays they will be replaced with null. You can use\n a replacer function to replace those with JSON values.\n JSON.stringify(undefined) returns undefined.\n\n The optional space parameter produces a stringification of the\n value that is filled with line breaks and indentation to make it\n easier to read.\n\n If the space parameter is a non-empty string, then that string will\n be used for indentation. If the space parameter is a number, then\n the indentation will be that many spaces.\n\n Example:\n\n text = JSON.stringify(['e', {pluribus: 'unum'}]);\n // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n\n text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\\t');\n // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n text = JSON.stringify([new Date()], function (key, value) {\n return this[key] instanceof Date ?\n 'Date(' + this[key] + ')' : value;\n });\n // text is '[\"Date(---current time---)\"]'\n\n\n JSON.parse(text, reviver)\n This method parses a JSON text to produce an object or array.\n It can throw a SyntaxError exception.\n\n The optional reviver parameter is a function that can filter and\n transform the results. It receives each of the keys and values,\n and its return value is used instead of the original value.\n If it returns what it received, then the structure is not modified.\n If it returns undefined then the member is deleted.\n\n Example:\n\n // Parse the text. Values that look like ISO date strings will\n // be converted to Date objects.\n\n myData = JSON.parse(text, function (key, value) {\n var a;\n if (typeof value === 'string') {\n a =\n/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n if (a) {\n return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n +a[5], +a[6]));\n }\n }\n return value;\n });\n\n myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n var d;\n if (typeof value === 'string' &&\n value.slice(0, 5) === 'Date(' &&\n value.slice(-1) === ')') {\n d = new Date(value.slice(5, -1));\n if (d) {\n return d;\n }\n }\n return value;\n });\n\n\n This is a reference implementation. You are free to copy, modify, or\n redistribute.\n*/\n\n/*jslint evil: true, regexp: true */\n\n/*members \"\", \"\\b\", \"\\t\", \"\\n\", \"\\f\", \"\\r\", \"\\\"\", JSON, \"\\\\\", apply,\n call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n*/\n\n\n// Create a JSON object only if one does not already exist. We create the\n// methods in a closure to avoid creating global variables.\n\nvar JSON = module.exports;\n\n(function () {\n 'use strict';\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10 ? '0' + n : n;\n }\n\n var cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n gap,\n indent,\n meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"' : '\\\\\"',\n '\\\\': '\\\\\\\\'\n },\n rep;\n\n\n function quote(string) {\n\n// If the string contains no control characters, no quote characters, and no\n// backslash characters, then we can safely slap some quotes around it.\n// Otherwise we must also replace the offending characters with safe escape\n// sequences.\n\n escapable.lastIndex = 0;\n return escapable.test(string) ? '\"' + string.replace(escapable, function (a) {\n var c = meta[a];\n return typeof c === 'string'\n ? c\n : '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + string + '\"';\n }\n\n\n function str(key, holder) {\n\n// Produce a string from holder[key].\n\n var i, // The loop counter.\n k, // The member key.\n v, // The member value.\n length,\n mind = gap,\n partial,\n value = holder[key],\n isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));\n\n// If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n// If we were called with a replacer function, then call the replacer to\n// obtain a replacement value.\n\n if (typeof rep === 'function') {\n value = rep.call(holder, key, value);\n }\n\n// What happens next depends on the value's type.\n\n switch (typeof value) {\n case 'string':\n if (isBigNumber) {\n return value;\n } else {\n return quote(value);\n }\n\n case 'number':\n\n// JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n case 'bigint':\n\n// If the value is a boolean or null, convert it to a string. Note:\n// typeof null does not produce 'null'. The case is included here in\n// the remote chance that this gets fixed someday.\n\n return String(value);\n\n// If the type is 'object', we might be dealing with an object or an array or\n// null.\n\n case 'object':\n\n// Due to a specification blunder in ECMAScript, typeof null is 'object',\n// so watch out for that case.\n\n if (!value) {\n return 'null';\n }\n\n// Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n// Is the value an array?\n\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n\n// The value is an array. Stringify every element. Use null as a placeholder\n// for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n// Join all of the elements together, separated with commas, and wrap them in\n// brackets.\n\n v = partial.length === 0\n ? '[]'\n : gap\n ? '[\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + ']'\n : '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n// If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === 'object') {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === 'string') {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n } else {\n\n// Otherwise, iterate through all of the keys in the object.\n\n Object.keys(value).forEach(function(k) {\n var v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n });\n }\n\n// Join all of the member texts together, separated with commas,\n// and wrap them in braces.\n\n v = partial.length === 0\n ? '{}'\n : gap\n ? '{\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + '}'\n : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n }\n\n// If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== 'function') {\n JSON.stringify = function (value, replacer, space) {\n\n// The stringify method takes a value and an optional replacer, and an optional\n// space parameter, and returns a JSON text. The replacer can be a function\n// that can replace values, or an array of strings that will select the keys.\n// A default replacer method can be provided. Use of the space parameter can\n// produce text that is more easily readable.\n\n var i;\n gap = '';\n indent = '';\n\n// If the space parameter is a number, make an indent string containing that\n// many spaces.\n\n if (typeof space === 'number') {\n for (i = 0; i < space; i += 1) {\n indent += ' ';\n }\n\n// If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === 'string') {\n indent = space;\n }\n\n// If there is a replacer, it must be a function or an array.\n// Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== 'function' &&\n (typeof replacer !== 'object' ||\n typeof replacer.length !== 'number')) {\n throw new Error('JSON.stringify');\n }\n\n// Make a fake root object containing our value under the key of ''.\n// Return the result of stringifying the value.\n\n return str('', {'': value});\n };\n }\n}());\n", - "var BigNumber = null;\n\n// regexpxs extracted from\n// (c) BSD-3-Clause\n// https://github.com/fastify/secure-json-parse/graphs/contributors and https://github.com/hapijs/bourne/graphs/contributors\n\nconst suspectProtoRx = /(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])(?:p|\\\\u0070)(?:r|\\\\u0072)(?:o|\\\\u006[Ff])(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])/;\nconst suspectConstructorRx = /(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)/;\n\n/*\n json_parse.js\n 2012-06-20\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n This file creates a json_parse function.\n During create you can (optionally) specify some behavioural switches\n\n require('json-bigint')(options)\n\n The optional options parameter holds switches that drive certain\n aspects of the parsing process:\n * options.strict = true will warn about duplicate-key usage in the json.\n The default (strict = false) will silently ignore those and overwrite\n values for keys that are in duplicate use.\n\n The resulting function follows this signature:\n json_parse(text, reviver)\n This method parses a JSON text to produce an object or array.\n It can throw a SyntaxError exception.\n\n The optional reviver parameter is a function that can filter and\n transform the results. It receives each of the keys and values,\n and its return value is used instead of the original value.\n If it returns what it received, then the structure is not modified.\n If it returns undefined then the member is deleted.\n\n Example:\n\n // Parse the text. Values that look like ISO date strings will\n // be converted to Date objects.\n\n myData = json_parse(text, function (key, value) {\n var a;\n if (typeof value === 'string') {\n a =\n/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n if (a) {\n return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n +a[5], +a[6]));\n }\n }\n return value;\n });\n\n This is a reference implementation. You are free to copy, modify, or\n redistribute.\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n*/\n\n/*members \"\", \"\\\"\", \"\\/\", \"\\\\\", at, b, call, charAt, f, fromCharCode,\n hasOwnProperty, message, n, name, prototype, push, r, t, text\n*/\n\nvar json_parse = function (options) {\n 'use strict';\n\n // This is a function that can parse a JSON text, producing a JavaScript\n // data structure. It is a simple, recursive descent parser. It does not use\n // eval or regular expressions, so it can be used as a model for implementing\n // a JSON parser in other languages.\n\n // We are defining the function inside of another function to avoid creating\n // global variables.\n\n // Default options one can override by passing options to the parse()\n var _options = {\n strict: false, // not being strict means do not generate syntax errors for \"duplicate key\"\n storeAsString: false, // toggles whether the values should be stored as BigNumber (default) or a string\n alwaysParseAsBig: false, // toggles whether all numbers should be Big\n useNativeBigInt: false, // toggles whether to use native BigInt instead of bignumber.js\n protoAction: 'error',\n constructorAction: 'error',\n };\n\n // If there are options, then use them to override the default _options\n if (options !== undefined && options !== null) {\n if (options.strict === true) {\n _options.strict = true;\n }\n if (options.storeAsString === true) {\n _options.storeAsString = true;\n }\n _options.alwaysParseAsBig =\n options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;\n _options.useNativeBigInt =\n options.useNativeBigInt === true ? options.useNativeBigInt : false;\n\n if (typeof options.constructorAction !== 'undefined') {\n if (\n options.constructorAction === 'error' ||\n options.constructorAction === 'ignore' ||\n options.constructorAction === 'preserve'\n ) {\n _options.constructorAction = options.constructorAction;\n } else {\n throw new Error(\n `Incorrect value for constructorAction option, must be \"error\", \"ignore\" or undefined but passed ${options.constructorAction}`\n );\n }\n }\n\n if (typeof options.protoAction !== 'undefined') {\n if (\n options.protoAction === 'error' ||\n options.protoAction === 'ignore' ||\n options.protoAction === 'preserve'\n ) {\n _options.protoAction = options.protoAction;\n } else {\n throw new Error(\n `Incorrect value for protoAction option, must be \"error\", \"ignore\" or undefined but passed ${options.protoAction}`\n );\n }\n }\n }\n\n var at, // The index of the current character\n ch, // The current character\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t',\n },\n text,\n error = function (m) {\n // Call error when something is wrong.\n\n throw {\n name: 'SyntaxError',\n message: m,\n at: at,\n text: text,\n };\n },\n next = function (c) {\n // If a c parameter is provided, verify that it matches the current character.\n\n if (c && c !== ch) {\n error(\"Expected '\" + c + \"' instead of '\" + ch + \"'\");\n }\n\n // Get the next character. When there are no more characters,\n // return the empty string.\n\n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n number = function () {\n // Parse a number value.\n\n var number,\n string = '';\n\n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (!isFinite(number)) {\n error('Bad number');\n } else {\n if (BigNumber == null) BigNumber = require('bignumber.js');\n //if (number > 9007199254740992 || number < -9007199254740992)\n // Bignumber has stricter check: everything with length > 15 digits disallowed\n if (string.length > 15)\n return _options.storeAsString\n ? string\n : _options.useNativeBigInt\n ? BigInt(string)\n : new BigNumber(string);\n else\n return !_options.alwaysParseAsBig\n ? number\n : _options.useNativeBigInt\n ? BigInt(number)\n : new BigNumber(number);\n }\n },\n string = function () {\n // Parse a string value.\n\n var hex,\n i,\n string = '',\n uffff;\n\n // When parsing for string values, we must look for \" and \\ characters.\n\n if (ch === '\"') {\n var startAt = at;\n while (next()) {\n if (ch === '\"') {\n if (at - 1 > startAt) string += text.substring(startAt, at - 1);\n next();\n return string;\n }\n if (ch === '\\\\') {\n if (at - 1 > startAt) string += text.substring(startAt, at - 1);\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n startAt = at;\n }\n }\n }\n error('Bad string');\n },\n white = function () {\n // Skip whitespace.\n\n while (ch && ch <= ' ') {\n next();\n }\n },\n word = function () {\n // true, false, or null.\n\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error(\"Unexpected '\" + ch + \"'\");\n },\n value, // Place holder for the value function.\n array = function () {\n // Parse an array value.\n\n var array = [];\n\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error('Bad array');\n },\n object = function () {\n // Parse an object value.\n\n var key,\n object = Object.create(null);\n\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n while (ch) {\n key = string();\n white();\n next(':');\n if (\n _options.strict === true &&\n Object.hasOwnProperty.call(object, key)\n ) {\n error('Duplicate key \"' + key + '\"');\n }\n\n if (suspectProtoRx.test(key) === true) {\n if (_options.protoAction === 'error') {\n error('Object contains forbidden prototype property');\n } else if (_options.protoAction === 'ignore') {\n value();\n } else {\n object[key] = value();\n }\n } else if (suspectConstructorRx.test(key) === true) {\n if (_options.constructorAction === 'error') {\n error('Object contains forbidden constructor property');\n } else if (_options.constructorAction === 'ignore') {\n value();\n } else {\n object[key] = value();\n }\n } else {\n object[key] = value();\n }\n\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error('Bad object');\n };\n\n value = function () {\n // Parse a JSON value. It could be an object, an array, a string, a number,\n // or a word.\n\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n };\n\n // Return the json_parse function. It will have access to all of the above\n // functions and variables.\n\n return function (source, reviver) {\n var result;\n\n text = source + '';\n at = 0;\n ch = ' ';\n result = value();\n white();\n if (ch) {\n error('Syntax error');\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the result\n // in an empty key. If there is not a reviver function, we simply return the\n // result.\n\n return typeof reviver === 'function'\n ? (function walk(holder, key) {\n var k,\n v,\n value = holder[key];\n if (value && typeof value === 'object') {\n Object.keys(value).forEach(function (k) {\n v = walk(value, k);\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n });\n }\n return reviver.call(holder, key, value);\n })({ '': result }, '')\n : result;\n };\n};\n\nmodule.exports = json_parse;\n", - "var json_stringify = require('./lib/stringify.js').stringify;\nvar json_parse = require('./lib/parse.js');\n\nmodule.exports = function(options) {\n return {\n parse: json_parse(options),\n stringify: json_stringify\n }\n};\n//create the default method members with no options applied for backwards compatibility\nmodule.exports.parse = json_parse();\nmodule.exports.stringify = json_stringify;\n", - "\"use strict\";\n/**\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCE_LINUX_BIOS_PATHS = void 0;\nexports.isGoogleCloudServerless = isGoogleCloudServerless;\nexports.isGoogleComputeEngineLinux = isGoogleComputeEngineLinux;\nexports.isGoogleComputeEngineMACAddress = isGoogleComputeEngineMACAddress;\nexports.isGoogleComputeEngine = isGoogleComputeEngine;\nexports.detectGCPResidency = detectGCPResidency;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\n/**\n * Known paths unique to Google Compute Engine Linux instances\n */\nexports.GCE_LINUX_BIOS_PATHS = {\n BIOS_DATE: '/sys/class/dmi/id/bios_date',\n BIOS_VENDOR: '/sys/class/dmi/id/bios_vendor',\n};\nconst GCE_MAC_ADDRESS_REGEX = /^42:01/;\n/**\n * Determines if the process is running on a Google Cloud Serverless environment (Cloud Run or Cloud Functions instance).\n *\n * Uses the:\n * - {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n * - {@link https://cloud.google.com/functions/docs/env-var Cloud Functions environment variables}.\n *\n * @returns {boolean} `true` if the process is running on GCP serverless, `false` otherwise.\n */\nfunction isGoogleCloudServerless() {\n /**\n * `CLOUD_RUN_JOB` is used for Cloud Run Jobs\n * - See {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n *\n * `FUNCTION_NAME` is used in older Cloud Functions environments:\n * - See {@link https://cloud.google.com/functions/docs/env-var Python 3.7 and Go 1.11}.\n *\n * `K_SERVICE` is used in Cloud Run and newer Cloud Functions environments:\n * - See {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.\n * - See {@link https://cloud.google.com/functions/docs/env-var Cloud Functions newer runtimes}.\n */\n const isGFEnvironment = process.env.CLOUD_RUN_JOB ||\n process.env.FUNCTION_NAME ||\n process.env.K_SERVICE;\n return !!isGFEnvironment;\n}\n/**\n * Determines if the process is running on a Linux Google Compute Engine instance.\n *\n * @returns {boolean} `true` if the process is running on Linux GCE, `false` otherwise.\n */\nfunction isGoogleComputeEngineLinux() {\n if ((0, os_1.platform)() !== 'linux')\n return false;\n try {\n // ensure this file exist\n (0, fs_1.statSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_DATE);\n // ensure this file exist and matches\n const biosVendor = (0, fs_1.readFileSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR, 'utf8');\n return /Google/.test(biosVendor);\n }\n catch (_a) {\n return false;\n }\n}\n/**\n * Determines if the process is running on a Google Compute Engine instance with a known\n * MAC address.\n *\n * @returns {boolean} `true` if the process is running on GCE (as determined by MAC address), `false` otherwise.\n */\nfunction isGoogleComputeEngineMACAddress() {\n const interfaces = (0, os_1.networkInterfaces)();\n for (const item of Object.values(interfaces)) {\n if (!item)\n continue;\n for (const { mac } of item) {\n if (GCE_MAC_ADDRESS_REGEX.test(mac)) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Determines if the process is running on a Google Compute Engine instance.\n *\n * @returns {boolean} `true` if the process is running on GCE, `false` otherwise.\n */\nfunction isGoogleComputeEngine() {\n return isGoogleComputeEngineLinux() || isGoogleComputeEngineMACAddress();\n}\n/**\n * Determines if the process is running on Google Cloud Platform.\n *\n * @returns {boolean} `true` if the process is running on GCP, `false` otherwise.\n */\nfunction detectGCPResidency() {\n return isGoogleCloudServerless() || isGoogleComputeEngine();\n}\n//# sourceMappingURL=gcp-residency.js.map", - "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Colours = void 0;\n/**\n * Handles figuring out if we can use ANSI colours and handing out the escape codes.\n *\n * This is for package-internal use only, and may change at any time.\n *\n * @private\n * @internal\n */\nclass Colours {\n /**\n * @param stream The stream (e.g. process.stderr)\n * @returns true if the stream should have colourization enabled\n */\n static isEnabled(stream) {\n return (stream.isTTY &&\n (typeof stream.getColorDepth === 'function'\n ? stream.getColorDepth() > 2\n : true));\n }\n static refresh() {\n Colours.enabled = Colours.isEnabled(process.stderr);\n if (!this.enabled) {\n Colours.reset = '';\n Colours.bright = '';\n Colours.dim = '';\n Colours.red = '';\n Colours.green = '';\n Colours.yellow = '';\n Colours.blue = '';\n Colours.magenta = '';\n Colours.cyan = '';\n Colours.white = '';\n Colours.grey = '';\n }\n else {\n Colours.reset = '\\u001b[0m';\n Colours.bright = '\\u001b[1m';\n Colours.dim = '\\u001b[2m';\n Colours.red = '\\u001b[31m';\n Colours.green = '\\u001b[32m';\n Colours.yellow = '\\u001b[33m';\n Colours.blue = '\\u001b[34m';\n Colours.magenta = '\\u001b[35m';\n Colours.cyan = '\\u001b[36m';\n Colours.white = '\\u001b[37m';\n Colours.grey = '\\u001b[90m';\n }\n }\n}\nexports.Colours = Colours;\nColours.enabled = false;\nColours.reset = '';\nColours.bright = '';\nColours.dim = '';\nColours.red = '';\nColours.green = '';\nColours.yellow = '';\nColours.blue = '';\nColours.magenta = '';\nColours.cyan = '';\nColours.white = '';\nColours.grey = '';\nColours.refresh();\n//# sourceMappingURL=colours.js.map", - "\"use strict\";\n// Copyright 2021-2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.env = exports.DebugLogBackendBase = exports.placeholder = exports.AdhocDebugLogger = exports.LogSeverity = void 0;\nexports.getNodeBackend = getNodeBackend;\nexports.getDebugBackend = getDebugBackend;\nexports.getStructuredBackend = getStructuredBackend;\nexports.setBackend = setBackend;\nexports.log = log;\nconst node_events_1 = require(\"node:events\");\nconst process = __importStar(require(\"node:process\"));\nconst util = __importStar(require(\"node:util\"));\nconst colours_1 = require(\"./colours\");\n// Some functions (as noted) are based on the Node standard library, from\n// the following file:\n//\n// https://github.com/nodejs/node/blob/main/lib/internal/util/debuglog.js\n/**\n * This module defines an ad-hoc debug logger for Google Cloud Platform\n * client libraries in Node. An ad-hoc debug logger is a tool which lets\n * users use an external, unified interface (in this case, environment\n * variables) to determine what logging they want to see at runtime. This\n * isn't necessarily fed into the console, but is meant to be under the\n * control of the user. The kind of logging that will be produced by this\n * is more like \"call retry happened\", not \"event you'd want to record\n * in Cloud Logger\".\n *\n * More for Googlers implementing libraries with it:\n * go/cloud-client-logging-design\n */\n/**\n * Possible log levels. These are a subset of Cloud Observability levels.\n * https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity\n */\nvar LogSeverity;\n(function (LogSeverity) {\n LogSeverity[\"DEFAULT\"] = \"DEFAULT\";\n LogSeverity[\"DEBUG\"] = \"DEBUG\";\n LogSeverity[\"INFO\"] = \"INFO\";\n LogSeverity[\"WARNING\"] = \"WARNING\";\n LogSeverity[\"ERROR\"] = \"ERROR\";\n})(LogSeverity || (exports.LogSeverity = LogSeverity = {}));\n/**\n * Our logger instance. This actually contains the meat of dealing\n * with log lines, including EventEmitter. This contains the function\n * that will be passed back to users of the package.\n */\nclass AdhocDebugLogger extends node_events_1.EventEmitter {\n /**\n * @param upstream The backend will pass a function that will be\n * called whenever our logger function is invoked.\n */\n constructor(namespace, upstream) {\n super();\n this.namespace = namespace;\n this.upstream = upstream;\n this.func = Object.assign(this.invoke.bind(this), {\n // Also add an instance pointer back to us.\n instance: this,\n // And pull over the EventEmitter functionality.\n on: (event, listener) => this.on(event, listener),\n });\n // Convenience methods for log levels.\n this.func.debug = (...args) => this.invokeSeverity(LogSeverity.DEBUG, ...args);\n this.func.info = (...args) => this.invokeSeverity(LogSeverity.INFO, ...args);\n this.func.warn = (...args) => this.invokeSeverity(LogSeverity.WARNING, ...args);\n this.func.error = (...args) => this.invokeSeverity(LogSeverity.ERROR, ...args);\n this.func.sublog = (namespace) => log(namespace, this.func);\n }\n invoke(fields, ...args) {\n // Push out any upstream logger first.\n if (this.upstream) {\n this.upstream(fields, ...args);\n }\n // Emit sink events.\n this.emit('log', fields, args);\n }\n invokeSeverity(severity, ...args) {\n this.invoke({ severity }, ...args);\n }\n}\nexports.AdhocDebugLogger = AdhocDebugLogger;\n/**\n * This can be used in place of a real logger while waiting for Promises or disabling logging.\n */\nexports.placeholder = new AdhocDebugLogger('', () => { }).func;\n/**\n * The base class for debug logging backends. It's possible to use this, but the\n * same non-guarantees above still apply (unstable interface, etc).\n *\n * @private\n * @internal\n */\nclass DebugLogBackendBase {\n constructor() {\n var _a;\n this.cached = new Map();\n this.filters = [];\n this.filtersSet = false;\n // Look for the Node config variable for what systems to enable. We'll store\n // these for the log method below, which will call setFilters() once.\n let nodeFlag = (_a = process.env[exports.env.nodeEnables]) !== null && _a !== void 0 ? _a : '*';\n if (nodeFlag === 'all') {\n nodeFlag = '*';\n }\n this.filters = nodeFlag.split(',');\n }\n log(namespace, fields, ...args) {\n try {\n if (!this.filtersSet) {\n this.setFilters();\n this.filtersSet = true;\n }\n let logger = this.cached.get(namespace);\n if (!logger) {\n logger = this.makeLogger(namespace);\n this.cached.set(namespace, logger);\n }\n logger(fields, ...args);\n }\n catch (e) {\n // Silently ignore all errors; we don't want them to interfere with\n // the user's running app.\n // e;\n console.error(e);\n }\n }\n}\nexports.DebugLogBackendBase = DebugLogBackendBase;\n// The basic backend. This one definitely works, but it's less feature-filled.\n//\n// Rather than using util.debuglog, this implements the same basic logic directly.\n// The reason for this decision is that debuglog checks the value of the\n// NODE_DEBUG environment variable before any user code runs; we therefore\n// can't pipe our own enables into it (and util.debuglog will never print unless\n// the user duplicates it into NODE_DEBUG, which isn't reasonable).\n//\nclass NodeBackend extends DebugLogBackendBase {\n constructor() {\n super(...arguments);\n // Default to allowing all systems, since we gate earlier based on whether the\n // variable is empty.\n this.enabledRegexp = /.*/g;\n }\n isEnabled(namespace) {\n return this.enabledRegexp.test(namespace);\n }\n makeLogger(namespace) {\n if (!this.enabledRegexp.test(namespace)) {\n return () => { };\n }\n return (fields, ...args) => {\n var _a;\n // TODO: `fields` needs to be turned into a string here, one way or another.\n const nscolour = `${colours_1.Colours.green}${namespace}${colours_1.Colours.reset}`;\n const pid = `${colours_1.Colours.yellow}${process.pid}${colours_1.Colours.reset}`;\n let level;\n switch (fields.severity) {\n case LogSeverity.ERROR:\n level = `${colours_1.Colours.red}${fields.severity}${colours_1.Colours.reset}`;\n break;\n case LogSeverity.INFO:\n level = `${colours_1.Colours.magenta}${fields.severity}${colours_1.Colours.reset}`;\n break;\n case LogSeverity.WARNING:\n level = `${colours_1.Colours.yellow}${fields.severity}${colours_1.Colours.reset}`;\n break;\n default:\n level = (_a = fields.severity) !== null && _a !== void 0 ? _a : LogSeverity.DEFAULT;\n break;\n }\n const msg = util.formatWithOptions({ colors: colours_1.Colours.enabled }, ...args);\n const filteredFields = Object.assign({}, fields);\n delete filteredFields.severity;\n const fieldsJson = Object.getOwnPropertyNames(filteredFields).length\n ? JSON.stringify(filteredFields)\n : '';\n const fieldsColour = fieldsJson\n ? `${colours_1.Colours.grey}${fieldsJson}${colours_1.Colours.reset}`\n : '';\n console.error('%s [%s|%s] %s%s', pid, nscolour, level, msg, fieldsJson ? ` ${fieldsColour}` : '');\n };\n }\n // Regexp patterns below are from here:\n // https://github.com/nodejs/node/blob/c0aebed4b3395bd65d54b18d1fd00f071002ac20/lib/internal/util/debuglog.js#L36\n setFilters() {\n const totalFilters = this.filters.join(',');\n const regexp = totalFilters\n .replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^');\n this.enabledRegexp = new RegExp(`^${regexp}$`, 'i');\n }\n}\n/**\n * @returns A backend based on Node util.debuglog; this is the default.\n */\nfunction getNodeBackend() {\n return new NodeBackend();\n}\nclass DebugBackend extends DebugLogBackendBase {\n constructor(pkg) {\n super();\n this.debugPkg = pkg;\n }\n makeLogger(namespace) {\n const debugLogger = this.debugPkg(namespace);\n return (fields, ...args) => {\n // TODO: `fields` needs to be turned into a string here.\n debugLogger(args[0], ...args.slice(1));\n };\n }\n setFilters() {\n var _a;\n const existingFilters = (_a = process.env['NODE_DEBUG']) !== null && _a !== void 0 ? _a : '';\n process.env['NODE_DEBUG'] = `${existingFilters}${existingFilters ? ',' : ''}${this.filters.join(',')}`;\n }\n}\n/**\n * Creates a \"debug\" package backend. The user must call require('debug') and pass\n * the resulting object to this function.\n *\n * ```\n * setBackend(getDebugBackend(require('debug')))\n * ```\n *\n * https://www.npmjs.com/package/debug\n *\n * Note: Google does not explicitly endorse or recommend this package; it's just\n * being provided as an option.\n *\n * @returns A backend based on the npm \"debug\" package.\n */\nfunction getDebugBackend(debugPkg) {\n return new DebugBackend(debugPkg);\n}\n/**\n * This pretty much works like the Node logger, but it outputs structured\n * logging JSON matching Google Cloud's ingestion specs. Rather than handling\n * its own output, it wraps another backend. The passed backend must be a subclass\n * of `DebugLogBackendBase` (any of the backends exposed by this package will work).\n */\nclass StructuredBackend extends DebugLogBackendBase {\n constructor(upstream) {\n var _a;\n super();\n this.upstream = (_a = upstream) !== null && _a !== void 0 ? _a : new NodeBackend();\n }\n makeLogger(namespace) {\n const debugLogger = this.upstream.makeLogger(namespace);\n return (fields, ...args) => {\n var _a;\n const severity = (_a = fields.severity) !== null && _a !== void 0 ? _a : LogSeverity.INFO;\n const json = Object.assign({\n severity,\n message: util.format(...args),\n }, fields);\n const jsonString = JSON.stringify(json);\n debugLogger(fields, jsonString);\n };\n }\n setFilters() {\n this.upstream.setFilters();\n }\n}\n/**\n * Creates a \"structured logging\" backend. This pretty much works like the\n * Node logger, but it outputs structured logging JSON matching Google\n * Cloud's ingestion specs instead of plain text.\n *\n * ```\n * setBackend(getStructuredBackend())\n * ```\n *\n * @param upstream If you want to use something besides the Node backend to\n * write the actual log lines into, pass that here.\n * @returns A backend based on Google Cloud structured logging.\n */\nfunction getStructuredBackend(upstream) {\n return new StructuredBackend(upstream);\n}\n/**\n * The environment variables that we standardized on, for all ad-hoc logging.\n */\nexports.env = {\n /**\n * Filter wildcards specific to the Node syntax, and similar to the built-in\n * utils.debuglog() environment variable. If missing, disables logging.\n */\n nodeEnables: 'GOOGLE_SDK_NODE_LOGGING',\n};\n// Keep a copy of all namespaced loggers so users can reliably .on() them.\n// Note that these cached functions will need to deal with changes in the backend.\nconst loggerCache = new Map();\n// Our current global backend. This might be:\nlet cachedBackend = undefined;\n/**\n * Set the backend to use for our log output.\n * - A backend object\n * - null to disable logging\n * - undefined for \"nothing yet\", defaults to the Node backend\n *\n * @param backend Results from one of the get*Backend() functions.\n */\nfunction setBackend(backend) {\n cachedBackend = backend;\n loggerCache.clear();\n}\n/**\n * Creates a logging function. Multiple calls to this with the same namespace\n * will produce the same logger, with the same event emitter hooks.\n *\n * Namespaces can be a simple string (\"system\" name), or a qualified string\n * (system:subsystem), which can be used for filtering, or for \"system:*\".\n *\n * @param namespace The namespace, a descriptive text string.\n * @returns A function you can call that works similar to console.log().\n */\nfunction log(namespace, parent) {\n // If the enable flag isn't set, do nothing.\n const enablesFlag = process.env[exports.env.nodeEnables];\n if (!enablesFlag) {\n return exports.placeholder;\n }\n // This might happen mostly if the typings are dropped in a user's code,\n // or if they're calling from JavaScript.\n if (!namespace) {\n return exports.placeholder;\n }\n // Handle sub-loggers.\n if (parent) {\n namespace = `${parent.instance.namespace}:${namespace}`;\n }\n // Reuse loggers so things like event sinks are persistent.\n const existing = loggerCache.get(namespace);\n if (existing) {\n return existing.func;\n }\n // Do we have a backend yet?\n if (cachedBackend === null) {\n // Explicitly disabled.\n return exports.placeholder;\n }\n else if (cachedBackend === undefined) {\n // One hasn't been made yet, so default to Node.\n cachedBackend = getNodeBackend();\n }\n // The logger is further wrapped so we can handle the backend changing out.\n const logger = (() => {\n let previousBackend = undefined;\n const newLogger = new AdhocDebugLogger(namespace, (fields, ...args) => {\n if (previousBackend !== cachedBackend) {\n // Did the user pass a custom backend?\n if (cachedBackend === null) {\n // Explicitly disabled.\n return;\n }\n else if (cachedBackend === undefined) {\n // One hasn't been made yet, so default to Node.\n cachedBackend = getNodeBackend();\n }\n previousBackend = cachedBackend;\n }\n cachedBackend === null || cachedBackend === void 0 ? void 0 : cachedBackend.log(namespace, fields, ...args);\n });\n return newLogger;\n })();\n loggerCache.set(namespace, logger);\n return logger.func;\n}\n//# sourceMappingURL=logging-utils.js.map", - "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./logging-utils\"), exports);\n//# sourceMappingURL=index.js.map", - "\"use strict\";\n/**\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.gcpResidencyCache = exports.METADATA_SERVER_DETECTION = exports.HEADERS = exports.HEADER_VALUE = exports.HEADER_NAME = exports.SECONDARY_HOST_ADDRESS = exports.HOST_ADDRESS = exports.BASE_PATH = void 0;\nexports.instance = instance;\nexports.project = project;\nexports.universe = universe;\nexports.bulk = bulk;\nexports.isAvailable = isAvailable;\nexports.resetIsAvailableCache = resetIsAvailableCache;\nexports.getGCPResidency = getGCPResidency;\nexports.setGCPResidency = setGCPResidency;\nexports.requestTimeout = requestTimeout;\nconst gaxios_1 = require(\"gaxios\");\nconst jsonBigint = require(\"json-bigint\");\nconst gcp_residency_1 = require(\"./gcp-residency\");\nconst logger = require(\"google-logging-utils\");\nexports.BASE_PATH = '/computeMetadata/v1';\nexports.HOST_ADDRESS = 'http://169.254.169.254';\nexports.SECONDARY_HOST_ADDRESS = 'http://metadata.google.internal.';\nexports.HEADER_NAME = 'Metadata-Flavor';\nexports.HEADER_VALUE = 'Google';\nexports.HEADERS = Object.freeze({ [exports.HEADER_NAME]: exports.HEADER_VALUE });\nconst log = logger.log('gcp metadata');\n/**\n * Metadata server detection override options.\n *\n * Available via `process.env.METADATA_SERVER_DETECTION`.\n */\nexports.METADATA_SERVER_DETECTION = Object.freeze({\n 'assume-present': \"don't try to ping the metadata server, but assume it's present\",\n none: \"don't try to ping the metadata server, but don't try to use it either\",\n 'bios-only': \"treat the result of a BIOS probe as canonical (don't fall back to pinging)\",\n 'ping-only': 'skip the BIOS probe, and go straight to pinging',\n});\n/**\n * Returns the base URL while taking into account the GCE_METADATA_HOST\n * environment variable if it exists.\n *\n * @returns The base URL, e.g., http://169.254.169.254/computeMetadata/v1.\n */\nfunction getBaseUrl(baseUrl) {\n if (!baseUrl) {\n baseUrl =\n process.env.GCE_METADATA_IP ||\n process.env.GCE_METADATA_HOST ||\n exports.HOST_ADDRESS;\n }\n // If no scheme is provided default to HTTP:\n if (!/^https?:\\/\\//.test(baseUrl)) {\n baseUrl = `http://${baseUrl}`;\n }\n return new URL(exports.BASE_PATH, baseUrl).href;\n}\n// Accepts an options object passed from the user to the API. In previous\n// versions of the API, it referred to a `Request` or an `Axios` request\n// options object. Now it refers to an object with very limited property\n// names. This is here to help ensure users don't pass invalid options when\n// they upgrade from 0.4 to 0.5 to 0.8.\nfunction validate(options) {\n Object.keys(options).forEach(key => {\n switch (key) {\n case 'params':\n case 'property':\n case 'headers':\n break;\n case 'qs':\n throw new Error(\"'qs' is not a valid configuration option. Please use 'params' instead.\");\n default:\n throw new Error(`'${key}' is not a valid configuration option.`);\n }\n });\n}\nasync function metadataAccessor(type, options = {}, noResponseRetries = 3, fastFail = false) {\n let metadataKey = '';\n let params = {};\n let headers = {};\n if (typeof type === 'object') {\n const metadataAccessor = type;\n metadataKey = metadataAccessor.metadataKey;\n params = metadataAccessor.params || params;\n headers = metadataAccessor.headers || headers;\n noResponseRetries = metadataAccessor.noResponseRetries || noResponseRetries;\n fastFail = metadataAccessor.fastFail || fastFail;\n }\n else {\n metadataKey = type;\n }\n if (typeof options === 'string') {\n metadataKey += `/${options}`;\n }\n else {\n validate(options);\n if (options.property) {\n metadataKey += `/${options.property}`;\n }\n headers = options.headers || headers;\n params = options.params || params;\n }\n const requestMethod = fastFail ? fastFailMetadataRequest : gaxios_1.request;\n const req = {\n url: `${getBaseUrl()}/${metadataKey}`,\n headers: { ...exports.HEADERS, ...headers },\n retryConfig: { noResponseRetries },\n params,\n responseType: 'text',\n timeout: requestTimeout(),\n };\n log.info('instance request %j', req);\n const res = await requestMethod(req);\n log.info('instance metadata is %s', res.data);\n // NOTE: node.js converts all incoming headers to lower case.\n if (res.headers[exports.HEADER_NAME.toLowerCase()] !== exports.HEADER_VALUE) {\n throw new Error(`Invalid response from metadata service: incorrect ${exports.HEADER_NAME} header. Expected '${exports.HEADER_VALUE}', got ${res.headers[exports.HEADER_NAME.toLowerCase()] ? `'${res.headers[exports.HEADER_NAME.toLowerCase()]}'` : 'no header'}`);\n }\n if (typeof res.data === 'string') {\n try {\n return jsonBigint.parse(res.data);\n }\n catch (_a) {\n /* ignore */\n }\n }\n return res.data;\n}\nasync function fastFailMetadataRequest(options) {\n var _a;\n const secondaryOptions = {\n ...options,\n url: (_a = options.url) === null || _a === void 0 ? void 0 : _a.toString().replace(getBaseUrl(), getBaseUrl(exports.SECONDARY_HOST_ADDRESS)),\n };\n // We race a connection between DNS/IP to metadata server. There are a couple\n // reasons for this:\n //\n // 1. the DNS is slow in some GCP environments; by checking both, we might\n // detect the runtime environment signficantly faster.\n // 2. we can't just check the IP, which is tarpitted and slow to respond\n // on a user's local machine.\n //\n // Additional logic has been added to make sure that we don't create an\n // unhandled rejection in scenarios where a failure happens sometime\n // after a success.\n //\n // Note, however, if a failure happens prior to a success, a rejection should\n // occur, this is for folks running locally.\n //\n let responded = false;\n const r1 = (0, gaxios_1.request)(options)\n .then(res => {\n responded = true;\n return res;\n })\n .catch(err => {\n if (responded) {\n return r2;\n }\n else {\n responded = true;\n throw err;\n }\n });\n const r2 = (0, gaxios_1.request)(secondaryOptions)\n .then(res => {\n responded = true;\n return res;\n })\n .catch(err => {\n if (responded) {\n return r1;\n }\n else {\n responded = true;\n throw err;\n }\n });\n return Promise.race([r1, r2]);\n}\n/**\n * Obtain metadata for the current GCE instance.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const serviceAccount: {} = await instance('service-accounts/');\n * const serviceAccountEmail: string = await instance('service-accounts/default/email');\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction instance(options) {\n return metadataAccessor('instance', options);\n}\n/**\n * Obtain metadata for the current GCP project.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const projectId: string = await project('project-id');\n * const numericProjectId: number = await project('numeric-project-id');\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction project(options) {\n return metadataAccessor('project', options);\n}\n/**\n * Obtain metadata for the current universe.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const universeDomain: string = await universe('universe-domain');\n * ```\n */\nfunction universe(options) {\n return metadataAccessor('universe', options);\n}\n/**\n * Retrieve metadata items in parallel.\n *\n * @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}\n *\n * @example\n * ```\n * const data = await bulk([\n * {\n * metadataKey: 'instance',\n * },\n * {\n * metadataKey: 'project/project-id',\n * },\n * ] as const);\n *\n * // data.instance;\n * // data['project/project-id'];\n * ```\n *\n * @param properties The metadata properties to retrieve\n * @returns The metadata in `metadatakey:value` format\n */\nasync function bulk(properties) {\n const r = {};\n await Promise.all(properties.map(item => {\n return (async () => {\n const res = await metadataAccessor(item);\n const key = item.metadataKey;\n r[key] = res;\n })();\n }));\n return r;\n}\n/*\n * How many times should we retry detecting GCP environment.\n */\nfunction detectGCPAvailableRetries() {\n return process.env.DETECT_GCP_RETRIES\n ? Number(process.env.DETECT_GCP_RETRIES)\n : 0;\n}\nlet cachedIsAvailableResponse;\n/**\n * Determine if the metadata server is currently available.\n */\nasync function isAvailable() {\n if (process.env.METADATA_SERVER_DETECTION) {\n const value = process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();\n if (!(value in exports.METADATA_SERVER_DETECTION)) {\n throw new RangeError(`Unknown \\`METADATA_SERVER_DETECTION\\` env variable. Got \\`${value}\\`, but it should be \\`${Object.keys(exports.METADATA_SERVER_DETECTION).join('`, `')}\\`, or unset`);\n }\n switch (value) {\n case 'assume-present':\n return true;\n case 'none':\n return false;\n case 'bios-only':\n return getGCPResidency();\n case 'ping-only':\n // continue, we want to ping the server\n }\n }\n try {\n // If a user is instantiating several GCP libraries at the same time,\n // this may result in multiple calls to isAvailable(), to detect the\n // runtime environment. We use the same promise for each of these calls\n // to reduce the network load.\n if (cachedIsAvailableResponse === undefined) {\n cachedIsAvailableResponse = metadataAccessor('instance', undefined, detectGCPAvailableRetries(), \n // If the default HOST_ADDRESS has been overridden, we should not\n // make an effort to try SECONDARY_HOST_ADDRESS (as we are likely in\n // a non-GCP environment):\n !(process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST));\n }\n await cachedIsAvailableResponse;\n return true;\n }\n catch (e) {\n const err = e;\n if (process.env.DEBUG_AUTH) {\n console.info(err);\n }\n if (err.type === 'request-timeout') {\n // If running in a GCP environment, metadata endpoint should return\n // within ms.\n return false;\n }\n if (err.response && err.response.status === 404) {\n return false;\n }\n else {\n if (!(err.response && err.response.status === 404) &&\n // A warning is emitted if we see an unexpected err.code, or err.code\n // is not populated:\n (!err.code ||\n ![\n 'EHOSTDOWN',\n 'EHOSTUNREACH',\n 'ENETUNREACH',\n 'ENOENT',\n 'ENOTFOUND',\n 'ECONNREFUSED',\n ].includes(err.code))) {\n let code = 'UNKNOWN';\n if (err.code)\n code = err.code;\n process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, 'MetadataLookupWarning');\n }\n // Failure to resolve the metadata service means that it is not available.\n return false;\n }\n }\n}\n/**\n * reset the memoized isAvailable() lookup.\n */\nfunction resetIsAvailableCache() {\n cachedIsAvailableResponse = undefined;\n}\n/**\n * A cache for the detected GCP Residency.\n */\nexports.gcpResidencyCache = null;\n/**\n * Detects GCP Residency.\n * Caches results to reduce costs for subsequent calls.\n *\n * @see setGCPResidency for setting\n */\nfunction getGCPResidency() {\n if (exports.gcpResidencyCache === null) {\n setGCPResidency();\n }\n return exports.gcpResidencyCache;\n}\n/**\n * Sets the detected GCP Residency.\n * Useful for forcing metadata server detection behavior.\n *\n * Set `null` to autodetect the environment (default behavior).\n * @see getGCPResidency for getting\n */\nfunction setGCPResidency(value = null) {\n exports.gcpResidencyCache = value !== null ? value : (0, gcp_residency_1.detectGCPResidency)();\n}\n/**\n * Obtain the timeout for requests to the metadata server.\n *\n * In certain environments and conditions requests can take longer than\n * the default timeout to complete. This function will determine the\n * appropriate timeout based on the environment.\n *\n * @returns {number} a request timeout duration in milliseconds.\n */\nfunction requestTimeout() {\n return getGCPResidency() ? 0 : 3000;\n}\n__exportStar(require(\"./gcp-residency\"), exports);\n//# sourceMappingURL=index.js.map", - "'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n", - "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/* global window */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BrowserCrypto = void 0;\n// This file implements crypto functions we need using in-browser\n// SubtleCrypto interface `window.crypto.subtle`.\nconst base64js = require(\"base64-js\");\nconst crypto_1 = require(\"../crypto\");\nclass BrowserCrypto {\n constructor() {\n if (typeof window === 'undefined' ||\n window.crypto === undefined ||\n window.crypto.subtle === undefined) {\n throw new Error(\"SubtleCrypto not found. Make sure it's an https:// website.\");\n }\n }\n async sha256DigestBase64(str) {\n // SubtleCrypto digest() method is async, so we must make\n // this method async as well.\n // To calculate SHA256 digest using SubtleCrypto, we first\n // need to convert an input string to an ArrayBuffer:\n const inputBuffer = new TextEncoder().encode(str);\n // Result is ArrayBuffer as well.\n const outputBuffer = await window.crypto.subtle.digest('SHA-256', inputBuffer);\n return base64js.fromByteArray(new Uint8Array(outputBuffer));\n }\n randomBytesBase64(count) {\n const array = new Uint8Array(count);\n window.crypto.getRandomValues(array);\n return base64js.fromByteArray(array);\n }\n static padBase64(base64) {\n // base64js requires padding, so let's add some '='\n while (base64.length % 4 !== 0) {\n base64 += '=';\n }\n return base64;\n }\n async verify(pubkey, data, signature) {\n const algo = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' },\n };\n const dataArray = new TextEncoder().encode(data);\n const signatureArray = base64js.toByteArray(BrowserCrypto.padBase64(signature));\n const cryptoKey = await window.crypto.subtle.importKey('jwk', pubkey, algo, true, ['verify']);\n // SubtleCrypto's verify method is async so we must make\n // this method async as well.\n const result = await window.crypto.subtle.verify(algo, cryptoKey, signatureArray, dataArray);\n return result;\n }\n async sign(privateKey, data) {\n const algo = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' },\n };\n const dataArray = new TextEncoder().encode(data);\n const cryptoKey = await window.crypto.subtle.importKey('jwk', privateKey, algo, true, ['sign']);\n // SubtleCrypto's sign method is async so we must make\n // this method async as well.\n const result = await window.crypto.subtle.sign(algo, cryptoKey, dataArray);\n return base64js.fromByteArray(new Uint8Array(result));\n }\n decodeBase64StringUtf8(base64) {\n const uint8array = base64js.toByteArray(BrowserCrypto.padBase64(base64));\n const result = new TextDecoder().decode(uint8array);\n return result;\n }\n encodeBase64StringUtf8(text) {\n const uint8array = new TextEncoder().encode(text);\n const result = base64js.fromByteArray(uint8array);\n return result;\n }\n /**\n * Computes the SHA-256 hash of the provided string.\n * @param str The plain text string to hash.\n * @return A promise that resolves with the SHA-256 hash of the provided\n * string in hexadecimal encoding.\n */\n async sha256DigestHex(str) {\n // SubtleCrypto digest() method is async, so we must make\n // this method async as well.\n // To calculate SHA256 digest using SubtleCrypto, we first\n // need to convert an input string to an ArrayBuffer:\n const inputBuffer = new TextEncoder().encode(str);\n // Result is ArrayBuffer as well.\n const outputBuffer = await window.crypto.subtle.digest('SHA-256', inputBuffer);\n return (0, crypto_1.fromArrayBufferToHex)(outputBuffer);\n }\n /**\n * Computes the HMAC hash of a message using the provided crypto key and the\n * SHA-256 algorithm.\n * @param key The secret crypto key in utf-8 or ArrayBuffer format.\n * @param msg The plain text message.\n * @return A promise that resolves with the HMAC-SHA256 hash in ArrayBuffer\n * format.\n */\n async signWithHmacSha256(key, msg) {\n // Convert key, if provided in ArrayBuffer format, to string.\n const rawKey = typeof key === 'string'\n ? key\n : String.fromCharCode(...new Uint16Array(key));\n const enc = new TextEncoder();\n const cryptoKey = await window.crypto.subtle.importKey('raw', enc.encode(rawKey), {\n name: 'HMAC',\n hash: {\n name: 'SHA-256',\n },\n }, false, ['sign']);\n return window.crypto.subtle.sign('HMAC', cryptoKey, enc.encode(msg));\n }\n}\nexports.BrowserCrypto = BrowserCrypto;\n", - "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeCrypto = void 0;\nconst crypto = require(\"crypto\");\nclass NodeCrypto {\n async sha256DigestBase64(str) {\n return crypto.createHash('sha256').update(str).digest('base64');\n }\n randomBytesBase64(count) {\n return crypto.randomBytes(count).toString('base64');\n }\n async verify(pubkey, data, signature) {\n const verifier = crypto.createVerify('RSA-SHA256');\n verifier.update(data);\n verifier.end();\n return verifier.verify(pubkey, signature, 'base64');\n }\n async sign(privateKey, data) {\n const signer = crypto.createSign('RSA-SHA256');\n signer.update(data);\n signer.end();\n return signer.sign(privateKey, 'base64');\n }\n decodeBase64StringUtf8(base64) {\n return Buffer.from(base64, 'base64').toString('utf-8');\n }\n encodeBase64StringUtf8(text) {\n return Buffer.from(text, 'utf-8').toString('base64');\n }\n /**\n * Computes the SHA-256 hash of the provided string.\n * @param str The plain text string to hash.\n * @return A promise that resolves with the SHA-256 hash of the provided\n * string in hexadecimal encoding.\n */\n async sha256DigestHex(str) {\n return crypto.createHash('sha256').update(str).digest('hex');\n }\n /**\n * Computes the HMAC hash of a message using the provided crypto key and the\n * SHA-256 algorithm.\n * @param key The secret crypto key in utf-8 or ArrayBuffer format.\n * @param msg The plain text message.\n * @return A promise that resolves with the HMAC-SHA256 hash in ArrayBuffer\n * format.\n */\n async signWithHmacSha256(key, msg) {\n const cryptoKey = typeof key === 'string' ? key : toBuffer(key);\n return toArrayBuffer(crypto.createHmac('sha256', cryptoKey).update(msg).digest());\n }\n}\nexports.NodeCrypto = NodeCrypto;\n/**\n * Converts a Node.js Buffer to an ArrayBuffer.\n * https://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer\n * @param buffer The Buffer input to covert.\n * @return The ArrayBuffer representation of the input.\n */\nfunction toArrayBuffer(buffer) {\n return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);\n}\n/**\n * Converts an ArrayBuffer to a Node.js Buffer.\n * @param arrayBuffer The ArrayBuffer input to covert.\n * @return The Buffer representation of the input.\n */\nfunction toBuffer(arrayBuffer) {\n return Buffer.from(arrayBuffer);\n}\n", - "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/* global window */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createCrypto = createCrypto;\nexports.hasBrowserCrypto = hasBrowserCrypto;\nexports.fromArrayBufferToHex = fromArrayBufferToHex;\nconst crypto_1 = require(\"./browser/crypto\");\nconst crypto_2 = require(\"./node/crypto\");\nfunction createCrypto() {\n if (hasBrowserCrypto()) {\n return new crypto_1.BrowserCrypto();\n }\n return new crypto_2.NodeCrypto();\n}\nfunction hasBrowserCrypto() {\n return (typeof window !== 'undefined' &&\n typeof window.crypto !== 'undefined' &&\n typeof window.crypto.subtle !== 'undefined');\n}\n/**\n * Converts an ArrayBuffer to a hexadecimal string.\n * @param arrayBuffer The ArrayBuffer to convert to hexadecimal string.\n * @return The hexadecimal encoding of the ArrayBuffer.\n */\nfunction fromArrayBufferToHex(arrayBuffer) {\n // Convert buffer to byte array.\n const byteArray = Array.from(new Uint8Array(arrayBuffer));\n // Convert bytes to hex string.\n return byteArray\n .map(byte => {\n return byte.toString(16).padStart(2, '0');\n })\n .join('');\n}\n", - "\"use strict\";\n// Copyright 2017 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validate = validate;\n// Accepts an options object passed from the user to the API. In the\n// previous version of the API, it referred to a `Request` options object.\n// Now it refers to an Axiox Request Config object. This is here to help\n// ensure users don't pass invalid options when they upgrade from 0.x to 1.x.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction validate(options) {\n const vpairs = [\n { invalid: 'uri', expected: 'url' },\n { invalid: 'json', expected: 'data' },\n { invalid: 'qs', expected: 'params' },\n ];\n for (const pair of vpairs) {\n if (options[pair.invalid]) {\n const e = `'${pair.invalid}' is not a valid configuration option. Please use '${pair.expected}' instead. This library is using Axios for requests. Please see https://github.com/axios/axios to learn more about the valid request options.`;\n throw new Error(e);\n }\n }\n}\n", - "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultTransporter = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst options_1 = require(\"./options\");\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst pkg = require('../../package.json');\nconst PRODUCT_NAME = 'google-api-nodejs-client';\nclass DefaultTransporter {\n constructor() {\n /**\n * A configurable, replacable `Gaxios` instance.\n */\n this.instance = new gaxios_1.Gaxios();\n }\n /**\n * Configures request options before making a request.\n * @param opts GaxiosOptions options.\n * @return Configured options.\n */\n configure(opts = {}) {\n opts.headers = opts.headers || {};\n if (typeof window === 'undefined') {\n // set transporter user agent if not in browser\n const uaValue = opts.headers['User-Agent'];\n if (!uaValue) {\n opts.headers['User-Agent'] = DefaultTransporter.USER_AGENT;\n }\n else if (!uaValue.includes(`${PRODUCT_NAME}/`)) {\n opts.headers['User-Agent'] =\n `${uaValue} ${DefaultTransporter.USER_AGENT}`;\n }\n // track google-auth-library-nodejs version:\n if (!opts.headers['x-goog-api-client']) {\n const nodeVersion = process.version.replace(/^v/, '');\n opts.headers['x-goog-api-client'] = `gl-node/${nodeVersion}`;\n }\n }\n return opts;\n }\n /**\n * Makes a request using Gaxios with given options.\n * @param opts GaxiosOptions options.\n * @param callback optional callback that contains GaxiosResponse object.\n * @return GaxiosPromise, assuming no callback is passed.\n */\n request(opts) {\n // ensure the user isn't passing in request-style options\n opts = this.configure(opts);\n (0, options_1.validate)(opts);\n return this.instance.request(opts).catch(e => {\n throw this.processError(e);\n });\n }\n get defaults() {\n return this.instance.defaults;\n }\n set defaults(opts) {\n this.instance.defaults = opts;\n }\n /**\n * Changes the error to include details from the body.\n */\n processError(e) {\n const res = e.response;\n const err = e;\n const body = res ? res.data : null;\n if (res && body && body.error && res.status !== 200) {\n if (typeof body.error === 'string') {\n err.message = body.error;\n err.status = res.status;\n }\n else if (Array.isArray(body.error.errors)) {\n err.message = body.error.errors\n .map((err2) => err2.message)\n .join('\\n');\n err.code = body.error.code;\n err.errors = body.error.errors;\n }\n else {\n err.message = body.error.message;\n err.code = body.error.code;\n }\n }\n else if (res && res.status >= 400) {\n // Consider all 4xx and 5xx responses errors.\n err.message = body;\n err.status = res.status;\n }\n return err;\n }\n}\nexports.DefaultTransporter = DefaultTransporter;\n/**\n * Default user agent.\n */\nDefaultTransporter.USER_AGENT = `${PRODUCT_NAME}/${pkg.version}`;\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", - "'use strict';\n\nfunction getParamSize(keySize) {\n\tvar result = ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1);\n\treturn result;\n}\n\nvar paramBytesForAlg = {\n\tES256: getParamSize(256),\n\tES384: getParamSize(384),\n\tES512: getParamSize(521)\n};\n\nfunction getParamBytesForAlg(alg) {\n\tvar paramBytes = paramBytesForAlg[alg];\n\tif (paramBytes) {\n\t\treturn paramBytes;\n\t}\n\n\tthrow new Error('Unknown algorithm \"' + alg + '\"');\n}\n\nmodule.exports = getParamBytesForAlg;\n", - "'use strict';\n\nvar Buffer = require('safe-buffer').Buffer;\n\nvar getParamBytesForAlg = require('./param-bytes-for-alg');\n\nvar MAX_OCTET = 0x80,\n\tCLASS_UNIVERSAL = 0,\n\tPRIMITIVE_BIT = 0x20,\n\tTAG_SEQ = 0x10,\n\tTAG_INT = 0x02,\n\tENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6),\n\tENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6);\n\nfunction base64Url(base64) {\n\treturn base64\n\t\t.replace(/=/g, '')\n\t\t.replace(/\\+/g, '-')\n\t\t.replace(/\\//g, '_');\n}\n\nfunction signatureAsBuffer(signature) {\n\tif (Buffer.isBuffer(signature)) {\n\t\treturn signature;\n\t} else if ('string' === typeof signature) {\n\t\treturn Buffer.from(signature, 'base64');\n\t}\n\n\tthrow new TypeError('ECDSA signature must be a Base64 string or a Buffer');\n}\n\nfunction derToJose(signature, alg) {\n\tsignature = signatureAsBuffer(signature);\n\tvar paramBytes = getParamBytesForAlg(alg);\n\n\t// the DER encoded param should at most be the param size, plus a padding\n\t// zero, since due to being a signed integer\n\tvar maxEncodedParamLength = paramBytes + 1;\n\n\tvar inputLength = signature.length;\n\n\tvar offset = 0;\n\tif (signature[offset++] !== ENCODED_TAG_SEQ) {\n\t\tthrow new Error('Could not find expected \"seq\"');\n\t}\n\n\tvar seqLength = signature[offset++];\n\tif (seqLength === (MAX_OCTET | 1)) {\n\t\tseqLength = signature[offset++];\n\t}\n\n\tif (inputLength - offset < seqLength) {\n\t\tthrow new Error('\"seq\" specified length of \"' + seqLength + '\", only \"' + (inputLength - offset) + '\" remaining');\n\t}\n\n\tif (signature[offset++] !== ENCODED_TAG_INT) {\n\t\tthrow new Error('Could not find expected \"int\" for \"r\"');\n\t}\n\n\tvar rLength = signature[offset++];\n\n\tif (inputLength - offset - 2 < rLength) {\n\t\tthrow new Error('\"r\" specified length of \"' + rLength + '\", only \"' + (inputLength - offset - 2) + '\" available');\n\t}\n\n\tif (maxEncodedParamLength < rLength) {\n\t\tthrow new Error('\"r\" specified length of \"' + rLength + '\", max of \"' + maxEncodedParamLength + '\" is acceptable');\n\t}\n\n\tvar rOffset = offset;\n\toffset += rLength;\n\n\tif (signature[offset++] !== ENCODED_TAG_INT) {\n\t\tthrow new Error('Could not find expected \"int\" for \"s\"');\n\t}\n\n\tvar sLength = signature[offset++];\n\n\tif (inputLength - offset !== sLength) {\n\t\tthrow new Error('\"s\" specified length of \"' + sLength + '\", expected \"' + (inputLength - offset) + '\"');\n\t}\n\n\tif (maxEncodedParamLength < sLength) {\n\t\tthrow new Error('\"s\" specified length of \"' + sLength + '\", max of \"' + maxEncodedParamLength + '\" is acceptable');\n\t}\n\n\tvar sOffset = offset;\n\toffset += sLength;\n\n\tif (offset !== inputLength) {\n\t\tthrow new Error('Expected to consume entire buffer, but \"' + (inputLength - offset) + '\" bytes remain');\n\t}\n\n\tvar rPadding = paramBytes - rLength,\n\t\tsPadding = paramBytes - sLength;\n\n\tvar dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength);\n\n\tfor (offset = 0; offset < rPadding; ++offset) {\n\t\tdst[offset] = 0;\n\t}\n\tsignature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength);\n\n\toffset = paramBytes;\n\n\tfor (var o = offset; offset < o + sPadding; ++offset) {\n\t\tdst[offset] = 0;\n\t}\n\tsignature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength);\n\n\tdst = dst.toString('base64');\n\tdst = base64Url(dst);\n\n\treturn dst;\n}\n\nfunction countPadding(buf, start, stop) {\n\tvar padding = 0;\n\twhile (start + padding < stop && buf[start + padding] === 0) {\n\t\t++padding;\n\t}\n\n\tvar needsSign = buf[start + padding] >= MAX_OCTET;\n\tif (needsSign) {\n\t\t--padding;\n\t}\n\n\treturn padding;\n}\n\nfunction joseToDer(signature, alg) {\n\tsignature = signatureAsBuffer(signature);\n\tvar paramBytes = getParamBytesForAlg(alg);\n\n\tvar signatureBytes = signature.length;\n\tif (signatureBytes !== paramBytes * 2) {\n\t\tthrow new TypeError('\"' + alg + '\" signatures must be \"' + paramBytes * 2 + '\" bytes, saw \"' + signatureBytes + '\"');\n\t}\n\n\tvar rPadding = countPadding(signature, 0, paramBytes);\n\tvar sPadding = countPadding(signature, paramBytes, signature.length);\n\tvar rLength = paramBytes - rPadding;\n\tvar sLength = paramBytes - sPadding;\n\n\tvar rsBytes = 1 + 1 + rLength + 1 + 1 + sLength;\n\n\tvar shortLength = rsBytes < MAX_OCTET;\n\n\tvar dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes);\n\n\tvar offset = 0;\n\tdst[offset++] = ENCODED_TAG_SEQ;\n\tif (shortLength) {\n\t\t// Bit 8 has value \"0\"\n\t\t// bits 7-1 give the length.\n\t\tdst[offset++] = rsBytes;\n\t} else {\n\t\t// Bit 8 of first octet has value \"1\"\n\t\t// bits 7-1 give the number of additional length octets.\n\t\tdst[offset++] = MAX_OCTET\t| 1;\n\t\t// length, base 256\n\t\tdst[offset++] = rsBytes & 0xff;\n\t}\n\tdst[offset++] = ENCODED_TAG_INT;\n\tdst[offset++] = rLength;\n\tif (rPadding < 0) {\n\t\tdst[offset++] = 0;\n\t\toffset += signature.copy(dst, offset, 0, paramBytes);\n\t} else {\n\t\toffset += signature.copy(dst, offset, rPadding, paramBytes);\n\t}\n\tdst[offset++] = ENCODED_TAG_INT;\n\tdst[offset++] = sLength;\n\tif (sPadding < 0) {\n\t\tdst[offset++] = 0;\n\t\tsignature.copy(dst, offset, paramBytes);\n\t} else {\n\t\tsignature.copy(dst, offset, paramBytes + sPadding);\n\t}\n\n\treturn dst;\n}\n\nmodule.exports = {\n\tderToJose: derToJose,\n\tjoseToDer: joseToDer\n};\n", - "\"use strict\";\n// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _LRUCache_instances, _LRUCache_cache, _LRUCache_moveToEnd, _LRUCache_evict;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LRUCache = void 0;\nexports.snakeToCamel = snakeToCamel;\nexports.originalOrCamelOptions = originalOrCamelOptions;\n/**\n * Returns the camel case of a provided string.\n *\n * @remarks\n *\n * Match any `_` and not `_` pair, then return the uppercase of the not `_`\n * character.\n *\n * @internal\n *\n * @param str the string to convert\n * @returns the camelCase'd string\n */\nfunction snakeToCamel(str) {\n return str.replace(/([_][^_])/g, match => match.slice(1).toUpperCase());\n}\n/**\n * Get the value of `obj[key]` or `obj[camelCaseKey]`, with a preference\n * for original, non-camelCase key.\n *\n * @param obj object to lookup a value in\n * @returns a `get` function for getting `obj[key || snakeKey]`, if available\n */\nfunction originalOrCamelOptions(obj) {\n /**\n *\n * @param key an index of object, preferably snake_case\n * @returns the value `obj[key || snakeKey]`, if available\n */\n function get(key) {\n var _a;\n const o = (obj || {});\n return (_a = o[key]) !== null && _a !== void 0 ? _a : o[snakeToCamel(key)];\n }\n return { get };\n}\n/**\n * A simple LRU cache utility.\n * Not meant for external usage.\n *\n * @experimental\n * @internal\n */\nclass LRUCache {\n constructor(options) {\n _LRUCache_instances.add(this);\n /**\n * Maps are in order. Thus, the older item is the first item.\n *\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map}\n */\n _LRUCache_cache.set(this, new Map());\n this.capacity = options.capacity;\n this.maxAge = options.maxAge;\n }\n /**\n * Add an item to the cache.\n *\n * @param key the key to upsert\n * @param value the value of the key\n */\n set(key, value) {\n __classPrivateFieldGet(this, _LRUCache_instances, \"m\", _LRUCache_moveToEnd).call(this, key, value);\n __classPrivateFieldGet(this, _LRUCache_instances, \"m\", _LRUCache_evict).call(this);\n }\n /**\n * Get an item from the cache.\n *\n * @param key the key to retrieve\n */\n get(key) {\n const item = __classPrivateFieldGet(this, _LRUCache_cache, \"f\").get(key);\n if (!item)\n return;\n __classPrivateFieldGet(this, _LRUCache_instances, \"m\", _LRUCache_moveToEnd).call(this, key, item.value);\n __classPrivateFieldGet(this, _LRUCache_instances, \"m\", _LRUCache_evict).call(this);\n return item.value;\n }\n}\nexports.LRUCache = LRUCache;\n_LRUCache_cache = new WeakMap(), _LRUCache_instances = new WeakSet(), _LRUCache_moveToEnd = function _LRUCache_moveToEnd(key, value) {\n __classPrivateFieldGet(this, _LRUCache_cache, \"f\").delete(key);\n __classPrivateFieldGet(this, _LRUCache_cache, \"f\").set(key, {\n value,\n lastAccessed: Date.now(),\n });\n}, _LRUCache_evict = function _LRUCache_evict() {\n const cutoffDate = this.maxAge ? Date.now() - this.maxAge : 0;\n /**\n * Because we know Maps are in order, this item is both the\n * last item in the list (capacity) and oldest (maxAge).\n */\n let oldestItem = __classPrivateFieldGet(this, _LRUCache_cache, \"f\").entries().next();\n while (!oldestItem.done &&\n (__classPrivateFieldGet(this, _LRUCache_cache, \"f\").size > this.capacity || // too many\n oldestItem.value[1].lastAccessed < cutoffDate) // too old\n ) {\n __classPrivateFieldGet(this, _LRUCache_cache, \"f\").delete(oldestItem.value[0]);\n oldestItem = __classPrivateFieldGet(this, _LRUCache_cache, \"f\").entries().next();\n }\n};\n", - "\"use strict\";\n// Copyright 2012 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthClient = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = exports.DEFAULT_UNIVERSE = void 0;\nconst events_1 = require(\"events\");\nconst gaxios_1 = require(\"gaxios\");\nconst transporters_1 = require(\"../transporters\");\nconst util_1 = require(\"../util\");\n/**\n * The default cloud universe\n *\n * @see {@link AuthJSONOptions.universe_domain}\n */\nexports.DEFAULT_UNIVERSE = 'googleapis.com';\n/**\n * The default {@link AuthClientOptions.eagerRefreshThresholdMillis}\n */\nexports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS = 5 * 60 * 1000;\nclass AuthClient extends events_1.EventEmitter {\n constructor(opts = {}) {\n var _a, _b, _c, _d, _e;\n super();\n this.credentials = {};\n this.eagerRefreshThresholdMillis = exports.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;\n this.forceRefreshOnFailure = false;\n this.universeDomain = exports.DEFAULT_UNIVERSE;\n const options = (0, util_1.originalOrCamelOptions)(opts);\n // Shared auth options\n this.apiKey = opts.apiKey;\n this.projectId = (_a = options.get('project_id')) !== null && _a !== void 0 ? _a : null;\n this.quotaProjectId = options.get('quota_project_id');\n this.credentials = (_b = options.get('credentials')) !== null && _b !== void 0 ? _b : {};\n this.universeDomain = (_c = options.get('universe_domain')) !== null && _c !== void 0 ? _c : exports.DEFAULT_UNIVERSE;\n // Shared client options\n this.transporter = (_d = opts.transporter) !== null && _d !== void 0 ? _d : new transporters_1.DefaultTransporter();\n if (opts.transporterOptions) {\n this.transporter.defaults = opts.transporterOptions;\n }\n if (opts.eagerRefreshThresholdMillis) {\n this.eagerRefreshThresholdMillis = opts.eagerRefreshThresholdMillis;\n }\n this.forceRefreshOnFailure = (_e = opts.forceRefreshOnFailure) !== null && _e !== void 0 ? _e : false;\n }\n /**\n * Return the {@link Gaxios `Gaxios`} instance from the {@link AuthClient.transporter}.\n *\n * @expiremental\n */\n get gaxios() {\n if (this.transporter instanceof gaxios_1.Gaxios) {\n return this.transporter;\n }\n else if (this.transporter instanceof transporters_1.DefaultTransporter) {\n return this.transporter.instance;\n }\n else if ('instance' in this.transporter &&\n this.transporter.instance instanceof gaxios_1.Gaxios) {\n return this.transporter.instance;\n }\n return null;\n }\n /**\n * Sets the auth credentials.\n */\n setCredentials(credentials) {\n this.credentials = credentials;\n }\n /**\n * Append additional headers, e.g., x-goog-user-project, shared across the\n * classes inheriting AuthClient. This method should be used by any method\n * that overrides getRequestMetadataAsync(), which is a shared helper for\n * setting request information in both gRPC and HTTP API calls.\n *\n * @param headers object to append additional headers to.\n */\n addSharedMetadataHeaders(headers) {\n // quota_project_id, stored in application_default_credentials.json, is set in\n // the x-goog-user-project header, to indicate an alternate account for\n // billing and quota:\n if (!headers['x-goog-user-project'] && // don't override a value the user sets.\n this.quotaProjectId) {\n headers['x-goog-user-project'] = this.quotaProjectId;\n }\n return headers;\n }\n /**\n * Retry config for Auth-related requests.\n *\n * @remarks\n *\n * This is not a part of the default {@link AuthClient.transporter transporter/gaxios}\n * config as some downstream APIs would prefer if customers explicitly enable retries,\n * such as GCS.\n */\n static get RETRY_CONFIG() {\n return {\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['GET', 'PUT', 'POST', 'HEAD', 'OPTIONS', 'DELETE'],\n },\n };\n }\n}\nexports.AuthClient = AuthClient;\n", - "\"use strict\";\n// Copyright 2014 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LoginTicket = void 0;\nclass LoginTicket {\n /**\n * Create a simple class to extract user ID from an ID Token\n *\n * @param {string} env Envelope of the jwt\n * @param {TokenPayload} pay Payload of the jwt\n * @constructor\n */\n constructor(env, pay) {\n this.envelope = env;\n this.payload = pay;\n }\n getEnvelope() {\n return this.envelope;\n }\n getPayload() {\n return this.payload;\n }\n /**\n * Create a simple class to extract user ID from an ID Token\n *\n * @return The user ID\n */\n getUserId() {\n const payload = this.getPayload();\n if (payload && payload.sub) {\n return payload.sub;\n }\n return null;\n }\n /**\n * Returns attributes from the login ticket. This can contain\n * various information about the user session.\n *\n * @return The envelope and payload\n */\n getAttributes() {\n return { envelope: this.getEnvelope(), payload: this.getPayload() };\n }\n}\nexports.LoginTicket = LoginTicket;\n", - "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuth2Client = exports.ClientAuthentication = exports.CertificateFormat = exports.CodeChallengeMethod = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst querystring = require(\"querystring\");\nconst stream = require(\"stream\");\nconst formatEcdsa = require(\"ecdsa-sig-formatter\");\nconst crypto_1 = require(\"../crypto/crypto\");\nconst authclient_1 = require(\"./authclient\");\nconst loginticket_1 = require(\"./loginticket\");\nvar CodeChallengeMethod;\n(function (CodeChallengeMethod) {\n CodeChallengeMethod[\"Plain\"] = \"plain\";\n CodeChallengeMethod[\"S256\"] = \"S256\";\n})(CodeChallengeMethod || (exports.CodeChallengeMethod = CodeChallengeMethod = {}));\nvar CertificateFormat;\n(function (CertificateFormat) {\n CertificateFormat[\"PEM\"] = \"PEM\";\n CertificateFormat[\"JWK\"] = \"JWK\";\n})(CertificateFormat || (exports.CertificateFormat = CertificateFormat = {}));\n/**\n * The client authentication type. Supported values are basic, post, and none.\n * https://datatracker.ietf.org/doc/html/rfc7591#section-2\n */\nvar ClientAuthentication;\n(function (ClientAuthentication) {\n ClientAuthentication[\"ClientSecretPost\"] = \"ClientSecretPost\";\n ClientAuthentication[\"ClientSecretBasic\"] = \"ClientSecretBasic\";\n ClientAuthentication[\"None\"] = \"None\";\n})(ClientAuthentication || (exports.ClientAuthentication = ClientAuthentication = {}));\nclass OAuth2Client extends authclient_1.AuthClient {\n constructor(optionsOrClientId, clientSecret, redirectUri) {\n const opts = optionsOrClientId && typeof optionsOrClientId === 'object'\n ? optionsOrClientId\n : { clientId: optionsOrClientId, clientSecret, redirectUri };\n super(opts);\n this.certificateCache = {};\n this.certificateExpiry = null;\n this.certificateCacheFormat = CertificateFormat.PEM;\n this.refreshTokenPromises = new Map();\n this._clientId = opts.clientId;\n this._clientSecret = opts.clientSecret;\n this.redirectUri = opts.redirectUri;\n this.endpoints = {\n tokenInfoUrl: 'https://oauth2.googleapis.com/tokeninfo',\n oauth2AuthBaseUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n oauth2TokenUrl: 'https://oauth2.googleapis.com/token',\n oauth2RevokeUrl: 'https://oauth2.googleapis.com/revoke',\n oauth2FederatedSignonPemCertsUrl: 'https://www.googleapis.com/oauth2/v1/certs',\n oauth2FederatedSignonJwkCertsUrl: 'https://www.googleapis.com/oauth2/v3/certs',\n oauth2IapPublicKeyUrl: 'https://www.gstatic.com/iap/verify/public_key',\n ...opts.endpoints,\n };\n this.clientAuthentication =\n opts.clientAuthentication || ClientAuthentication.ClientSecretPost;\n this.issuers = opts.issuers || [\n 'accounts.google.com',\n 'https://accounts.google.com',\n this.universeDomain,\n ];\n }\n /**\n * Generates URL for consent page landing.\n * @param opts Options.\n * @return URL to consent page.\n */\n generateAuthUrl(opts = {}) {\n if (opts.code_challenge_method && !opts.code_challenge) {\n throw new Error('If a code_challenge_method is provided, code_challenge must be included.');\n }\n opts.response_type = opts.response_type || 'code';\n opts.client_id = opts.client_id || this._clientId;\n opts.redirect_uri = opts.redirect_uri || this.redirectUri;\n // Allow scopes to be passed either as array or a string\n if (Array.isArray(opts.scope)) {\n opts.scope = opts.scope.join(' ');\n }\n const rootUrl = this.endpoints.oauth2AuthBaseUrl.toString();\n return (rootUrl +\n '?' +\n querystring.stringify(opts));\n }\n generateCodeVerifier() {\n // To make the code compatible with browser SubtleCrypto we need to make\n // this method async.\n throw new Error('generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.');\n }\n /**\n * Convenience method to automatically generate a code_verifier, and its\n * resulting SHA256. If used, this must be paired with a S256\n * code_challenge_method.\n *\n * For a full example see:\n * https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2-codeVerifier.js\n */\n async generateCodeVerifierAsync() {\n // base64 encoding uses 6 bits per character, and we want to generate128\n // characters. 6*128/8 = 96.\n const crypto = (0, crypto_1.createCrypto)();\n const randomString = crypto.randomBytesBase64(96);\n // The valid characters in the code_verifier are [A-Z]/[a-z]/[0-9]/\n // \"-\"/\".\"/\"_\"/\"~\". Base64 encoded strings are pretty close, so we're just\n // swapping out a few chars.\n const codeVerifier = randomString\n .replace(/\\+/g, '~')\n .replace(/=/g, '_')\n .replace(/\\//g, '-');\n // Generate the base64 encoded SHA256\n const unencodedCodeChallenge = await crypto.sha256DigestBase64(codeVerifier);\n // We need to use base64UrlEncoding instead of standard base64\n const codeChallenge = unencodedCodeChallenge\n .split('=')[0]\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n return { codeVerifier, codeChallenge };\n }\n getToken(codeOrOptions, callback) {\n const options = typeof codeOrOptions === 'string' ? { code: codeOrOptions } : codeOrOptions;\n if (callback) {\n this.getTokenAsync(options).then(r => callback(null, r.tokens, r.res), e => callback(e, null, e.response));\n }\n else {\n return this.getTokenAsync(options);\n }\n }\n async getTokenAsync(options) {\n const url = this.endpoints.oauth2TokenUrl.toString();\n const headers = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n };\n const values = {\n client_id: options.client_id || this._clientId,\n code_verifier: options.codeVerifier,\n code: options.code,\n grant_type: 'authorization_code',\n redirect_uri: options.redirect_uri || this.redirectUri,\n };\n if (this.clientAuthentication === ClientAuthentication.ClientSecretBasic) {\n const basic = Buffer.from(`${this._clientId}:${this._clientSecret}`);\n headers['Authorization'] = `Basic ${basic.toString('base64')}`;\n }\n if (this.clientAuthentication === ClientAuthentication.ClientSecretPost) {\n values.client_secret = this._clientSecret;\n }\n const res = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n url,\n data: querystring.stringify(values),\n headers,\n });\n const tokens = res.data;\n if (res.data && res.data.expires_in) {\n tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res };\n }\n /**\n * Refreshes the access token.\n * @param refresh_token Existing refresh token.\n * @private\n */\n async refreshToken(refreshToken) {\n if (!refreshToken) {\n return this.refreshTokenNoCache(refreshToken);\n }\n // If a request to refresh using the same token has started,\n // return the same promise.\n if (this.refreshTokenPromises.has(refreshToken)) {\n return this.refreshTokenPromises.get(refreshToken);\n }\n const p = this.refreshTokenNoCache(refreshToken).then(r => {\n this.refreshTokenPromises.delete(refreshToken);\n return r;\n }, e => {\n this.refreshTokenPromises.delete(refreshToken);\n throw e;\n });\n this.refreshTokenPromises.set(refreshToken, p);\n return p;\n }\n async refreshTokenNoCache(refreshToken) {\n var _a;\n if (!refreshToken) {\n throw new Error('No refresh token is set.');\n }\n const url = this.endpoints.oauth2TokenUrl.toString();\n const data = {\n refresh_token: refreshToken,\n client_id: this._clientId,\n client_secret: this._clientSecret,\n grant_type: 'refresh_token',\n };\n let res;\n try {\n // request for new token\n res = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n url,\n data: querystring.stringify(data),\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n });\n }\n catch (e) {\n if (e instanceof gaxios_1.GaxiosError &&\n e.message === 'invalid_grant' &&\n ((_a = e.response) === null || _a === void 0 ? void 0 : _a.data) &&\n /ReAuth/i.test(e.response.data.error_description)) {\n e.message = JSON.stringify(e.response.data);\n }\n throw e;\n }\n const tokens = res.data;\n // TODO: de-duplicate this code from a few spots\n if (res.data && res.data.expires_in) {\n tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res };\n }\n refreshAccessToken(callback) {\n if (callback) {\n this.refreshAccessTokenAsync().then(r => callback(null, r.credentials, r.res), callback);\n }\n else {\n return this.refreshAccessTokenAsync();\n }\n }\n async refreshAccessTokenAsync() {\n const r = await this.refreshToken(this.credentials.refresh_token);\n const tokens = r.tokens;\n tokens.refresh_token = this.credentials.refresh_token;\n this.credentials = tokens;\n return { credentials: this.credentials, res: r.res };\n }\n getAccessToken(callback) {\n if (callback) {\n this.getAccessTokenAsync().then(r => callback(null, r.token, r.res), callback);\n }\n else {\n return this.getAccessTokenAsync();\n }\n }\n async getAccessTokenAsync() {\n const shouldRefresh = !this.credentials.access_token || this.isTokenExpiring();\n if (shouldRefresh) {\n if (!this.credentials.refresh_token) {\n if (this.refreshHandler) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken === null || refreshedAccessToken === void 0 ? void 0 : refreshedAccessToken.access_token) {\n this.setCredentials(refreshedAccessToken);\n return { token: this.credentials.access_token };\n }\n }\n else {\n throw new Error('No refresh token or refresh handler callback is set.');\n }\n }\n const r = await this.refreshAccessTokenAsync();\n if (!r.credentials || (r.credentials && !r.credentials.access_token)) {\n throw new Error('Could not refresh access token.');\n }\n return { token: r.credentials.access_token, res: r.res };\n }\n else {\n return { token: this.credentials.access_token };\n }\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * In OAuth2Client, the result has the form:\n * { Authorization: 'Bearer ' }\n * @param url The optional url being authorized\n */\n async getRequestHeaders(url) {\n const headers = (await this.getRequestMetadataAsync(url)).headers;\n return headers;\n }\n async getRequestMetadataAsync(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n url) {\n const thisCreds = this.credentials;\n if (!thisCreds.access_token &&\n !thisCreds.refresh_token &&\n !this.apiKey &&\n !this.refreshHandler) {\n throw new Error('No access, refresh token, API key or refresh handler callback is set.');\n }\n if (thisCreds.access_token && !this.isTokenExpiring()) {\n thisCreds.token_type = thisCreds.token_type || 'Bearer';\n const headers = {\n Authorization: thisCreds.token_type + ' ' + thisCreds.access_token,\n };\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n // If refreshHandler exists, call processAndValidateRefreshHandler().\n if (this.refreshHandler) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken === null || refreshedAccessToken === void 0 ? void 0 : refreshedAccessToken.access_token) {\n this.setCredentials(refreshedAccessToken);\n const headers = {\n Authorization: 'Bearer ' + this.credentials.access_token,\n };\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n }\n if (this.apiKey) {\n return { headers: { 'X-Goog-Api-Key': this.apiKey } };\n }\n let r = null;\n let tokens = null;\n try {\n r = await this.refreshToken(thisCreds.refresh_token);\n tokens = r.tokens;\n }\n catch (err) {\n const e = err;\n if (e.response &&\n (e.response.status === 403 || e.response.status === 404)) {\n e.message = `Could not refresh access token: ${e.message}`;\n }\n throw e;\n }\n const credentials = this.credentials;\n credentials.token_type = credentials.token_type || 'Bearer';\n tokens.refresh_token = credentials.refresh_token;\n this.credentials = tokens;\n const headers = {\n Authorization: credentials.token_type + ' ' + tokens.access_token,\n };\n return { headers: this.addSharedMetadataHeaders(headers), res: r.res };\n }\n /**\n * Generates an URL to revoke the given token.\n * @param token The existing token to be revoked.\n *\n * @deprecated use instance method {@link OAuth2Client.getRevokeTokenURL}\n */\n static getRevokeTokenUrl(token) {\n return new OAuth2Client().getRevokeTokenURL(token).toString();\n }\n /**\n * Generates a URL to revoke the given token.\n *\n * @param token The existing token to be revoked.\n */\n getRevokeTokenURL(token) {\n const url = new URL(this.endpoints.oauth2RevokeUrl);\n url.searchParams.append('token', token);\n return url;\n }\n revokeToken(token, callback) {\n const opts = {\n ...OAuth2Client.RETRY_CONFIG,\n url: this.getRevokeTokenURL(token).toString(),\n method: 'POST',\n };\n if (callback) {\n this.transporter\n .request(opts)\n .then(r => callback(null, r), callback);\n }\n else {\n return this.transporter.request(opts);\n }\n }\n revokeCredentials(callback) {\n if (callback) {\n this.revokeCredentialsAsync().then(res => callback(null, res), callback);\n }\n else {\n return this.revokeCredentialsAsync();\n }\n }\n async revokeCredentialsAsync() {\n const token = this.credentials.access_token;\n this.credentials = {};\n if (token) {\n return this.revokeToken(token);\n }\n else {\n throw new Error('No access token to revoke.');\n }\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n async requestAsync(opts, reAuthRetried = false) {\n let r2;\n try {\n const r = await this.getRequestMetadataAsync(opts.url);\n opts.headers = opts.headers || {};\n if (r.headers && r.headers['x-goog-user-project']) {\n opts.headers['x-goog-user-project'] = r.headers['x-goog-user-project'];\n }\n if (r.headers && r.headers.Authorization) {\n opts.headers.Authorization = r.headers.Authorization;\n }\n if (this.apiKey) {\n opts.headers['X-Goog-Api-Key'] = this.apiKey;\n }\n r2 = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - An access_token and refresh_token were available, but either no\n // expiry_date was available or the forceRefreshOnFailure flag is set.\n // The absent expiry_date case can happen when developers stash the\n // access_token and refresh_token for later use, but the access_token\n // fails on the first try because it's expired. Some developers may\n // choose to enable forceRefreshOnFailure to mitigate time-related\n // errors.\n // Or the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - No refresh_token was available\n // - An access_token and a refreshHandler callback were available, but\n // either no expiry_date was available or the forceRefreshOnFailure\n // flag is set. The access_token fails on the first try because it's\n // expired. Some developers may choose to enable forceRefreshOnFailure\n // to mitigate time-related errors.\n const mayRequireRefresh = this.credentials &&\n this.credentials.access_token &&\n this.credentials.refresh_token &&\n (!this.credentials.expiry_date || this.forceRefreshOnFailure);\n const mayRequireRefreshWithNoRefreshToken = this.credentials &&\n this.credentials.access_token &&\n !this.credentials.refresh_token &&\n (!this.credentials.expiry_date || this.forceRefreshOnFailure) &&\n this.refreshHandler;\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n mayRequireRefresh) {\n await this.refreshAccessTokenAsync();\n return this.requestAsync(opts, true);\n }\n else if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n mayRequireRefreshWithNoRefreshToken) {\n const refreshedAccessToken = await this.processAndValidateRefreshHandler();\n if (refreshedAccessToken === null || refreshedAccessToken === void 0 ? void 0 : refreshedAccessToken.access_token) {\n this.setCredentials(refreshedAccessToken);\n }\n return this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return r2;\n }\n verifyIdToken(options, callback) {\n // This function used to accept two arguments instead of an options object.\n // Check the types to help users upgrade with less pain.\n // This check can be removed after a 2.0 release.\n if (callback && typeof callback !== 'function') {\n throw new Error('This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.');\n }\n if (callback) {\n this.verifyIdTokenAsync(options).then(r => callback(null, r), callback);\n }\n else {\n return this.verifyIdTokenAsync(options);\n }\n }\n async verifyIdTokenAsync(options) {\n if (!options.idToken) {\n throw new Error('The verifyIdToken method requires an ID Token');\n }\n const response = await this.getFederatedSignonCertsAsync();\n const login = await this.verifySignedJwtWithCertsAsync(options.idToken, response.certs, options.audience, this.issuers, options.maxExpiry);\n return login;\n }\n /**\n * Obtains information about the provisioned access token. Especially useful\n * if you want to check the scopes that were provisioned to a given token.\n *\n * @param accessToken Required. The Access Token for which you want to get\n * user info.\n */\n async getTokenInfo(accessToken) {\n const { data } = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Authorization: `Bearer ${accessToken}`,\n },\n url: this.endpoints.tokenInfoUrl.toString(),\n });\n const info = Object.assign({\n expiry_date: new Date().getTime() + data.expires_in * 1000,\n scopes: data.scope.split(' '),\n }, data);\n delete info.expires_in;\n delete info.scope;\n return info;\n }\n getFederatedSignonCerts(callback) {\n if (callback) {\n this.getFederatedSignonCertsAsync().then(r => callback(null, r.certs, r.res), callback);\n }\n else {\n return this.getFederatedSignonCertsAsync();\n }\n }\n async getFederatedSignonCertsAsync() {\n const nowTime = new Date().getTime();\n const format = (0, crypto_1.hasBrowserCrypto)()\n ? CertificateFormat.JWK\n : CertificateFormat.PEM;\n if (this.certificateExpiry &&\n nowTime < this.certificateExpiry.getTime() &&\n this.certificateCacheFormat === format) {\n return { certs: this.certificateCache, format };\n }\n let res;\n let url;\n switch (format) {\n case CertificateFormat.PEM:\n url = this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();\n break;\n case CertificateFormat.JWK:\n url = this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();\n break;\n default:\n throw new Error(`Unsupported certificate format ${format}`);\n }\n try {\n res = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n url,\n });\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Failed to retrieve verification certificates: ${e.message}`;\n }\n throw e;\n }\n const cacheControl = res ? res.headers['cache-control'] : undefined;\n let cacheAge = -1;\n if (cacheControl) {\n const pattern = new RegExp('max-age=([0-9]*)');\n const regexResult = pattern.exec(cacheControl);\n if (regexResult && regexResult.length === 2) {\n // Cache results with max-age (in seconds)\n cacheAge = Number(regexResult[1]) * 1000; // milliseconds\n }\n }\n let certificates = {};\n switch (format) {\n case CertificateFormat.PEM:\n certificates = res.data;\n break;\n case CertificateFormat.JWK:\n for (const key of res.data.keys) {\n certificates[key.kid] = key;\n }\n break;\n default:\n throw new Error(`Unsupported certificate format ${format}`);\n }\n const now = new Date();\n this.certificateExpiry =\n cacheAge === -1 ? null : new Date(now.getTime() + cacheAge);\n this.certificateCache = certificates;\n this.certificateCacheFormat = format;\n return { certs: certificates, format, res };\n }\n getIapPublicKeys(callback) {\n if (callback) {\n this.getIapPublicKeysAsync().then(r => callback(null, r.pubkeys, r.res), callback);\n }\n else {\n return this.getIapPublicKeysAsync();\n }\n }\n async getIapPublicKeysAsync() {\n let res;\n const url = this.endpoints.oauth2IapPublicKeyUrl.toString();\n try {\n res = await this.transporter.request({\n ...OAuth2Client.RETRY_CONFIG,\n url,\n });\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Failed to retrieve verification certificates: ${e.message}`;\n }\n throw e;\n }\n return { pubkeys: res.data, res };\n }\n verifySignedJwtWithCerts() {\n // To make the code compatible with browser SubtleCrypto we need to make\n // this method async.\n throw new Error('verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.');\n }\n /**\n * Verify the id token is signed with the correct certificate\n * and is from the correct audience.\n * @param jwt The jwt to verify (The ID Token in this case).\n * @param certs The array of certs to test the jwt against.\n * @param requiredAudience The audience to test the jwt against.\n * @param issuers The allowed issuers of the jwt (Optional).\n * @param maxExpiry The max expiry the certificate can be (Optional).\n * @return Returns a promise resolving to LoginTicket on verification.\n */\n async verifySignedJwtWithCertsAsync(jwt, certs, requiredAudience, issuers, maxExpiry) {\n const crypto = (0, crypto_1.createCrypto)();\n if (!maxExpiry) {\n maxExpiry = OAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;\n }\n const segments = jwt.split('.');\n if (segments.length !== 3) {\n throw new Error('Wrong number of segments in token: ' + jwt);\n }\n const signed = segments[0] + '.' + segments[1];\n let signature = segments[2];\n let envelope;\n let payload;\n try {\n envelope = JSON.parse(crypto.decodeBase64StringUtf8(segments[0]));\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `Can't parse token envelope: ${segments[0]}': ${err.message}`;\n }\n throw err;\n }\n if (!envelope) {\n throw new Error(\"Can't parse token envelope: \" + segments[0]);\n }\n try {\n payload = JSON.parse(crypto.decodeBase64StringUtf8(segments[1]));\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `Can't parse token payload '${segments[0]}`;\n }\n throw err;\n }\n if (!payload) {\n throw new Error(\"Can't parse token payload: \" + segments[1]);\n }\n if (!Object.prototype.hasOwnProperty.call(certs, envelope.kid)) {\n // If this is not present, then there's no reason to attempt verification\n throw new Error('No pem found for envelope: ' + JSON.stringify(envelope));\n }\n const cert = certs[envelope.kid];\n if (envelope.alg === 'ES256') {\n signature = formatEcdsa.joseToDer(signature, 'ES256').toString('base64');\n }\n const verified = await crypto.verify(cert, signed, signature);\n if (!verified) {\n throw new Error('Invalid token signature: ' + jwt);\n }\n if (!payload.iat) {\n throw new Error('No issue time in token: ' + JSON.stringify(payload));\n }\n if (!payload.exp) {\n throw new Error('No expiration time in token: ' + JSON.stringify(payload));\n }\n const iat = Number(payload.iat);\n if (isNaN(iat))\n throw new Error('iat field using invalid format');\n const exp = Number(payload.exp);\n if (isNaN(exp))\n throw new Error('exp field using invalid format');\n const now = new Date().getTime() / 1000;\n if (exp >= now + maxExpiry) {\n throw new Error('Expiration time too far in future: ' + JSON.stringify(payload));\n }\n const earliest = iat - OAuth2Client.CLOCK_SKEW_SECS_;\n const latest = exp + OAuth2Client.CLOCK_SKEW_SECS_;\n if (now < earliest) {\n throw new Error('Token used too early, ' +\n now +\n ' < ' +\n earliest +\n ': ' +\n JSON.stringify(payload));\n }\n if (now > latest) {\n throw new Error('Token used too late, ' +\n now +\n ' > ' +\n latest +\n ': ' +\n JSON.stringify(payload));\n }\n if (issuers && issuers.indexOf(payload.iss) < 0) {\n throw new Error('Invalid issuer, expected one of [' +\n issuers +\n '], but got ' +\n payload.iss);\n }\n // Check the audience matches if we have one\n if (typeof requiredAudience !== 'undefined' && requiredAudience !== null) {\n const aud = payload.aud;\n let audVerified = false;\n // If the requiredAudience is an array, check if it contains token\n // audience\n if (requiredAudience.constructor === Array) {\n audVerified = requiredAudience.indexOf(aud) > -1;\n }\n else {\n audVerified = aud === requiredAudience;\n }\n if (!audVerified) {\n throw new Error('Wrong recipient, payload audience != requiredAudience');\n }\n }\n return new loginticket_1.LoginTicket(envelope, payload);\n }\n /**\n * Returns a promise that resolves with AccessTokenResponse type if\n * refreshHandler is defined.\n * If not, nothing is returned.\n */\n async processAndValidateRefreshHandler() {\n if (this.refreshHandler) {\n const accessTokenResponse = await this.refreshHandler();\n if (!accessTokenResponse.access_token) {\n throw new Error('No access token is returned by the refreshHandler callback.');\n }\n return accessTokenResponse;\n }\n return;\n }\n /**\n * Returns true if a token is expired or will expire within\n * eagerRefreshThresholdMillismilliseconds.\n * If there is no expiry time, assumes the token is not expired or expiring.\n */\n isTokenExpiring() {\n const expiryDate = this.credentials.expiry_date;\n return expiryDate\n ? expiryDate <= new Date().getTime() + this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.OAuth2Client = OAuth2Client;\n/**\n * @deprecated use instance's {@link OAuth2Client.endpoints}\n */\nOAuth2Client.GOOGLE_TOKEN_INFO_URL = 'https://oauth2.googleapis.com/tokeninfo';\n/**\n * Clock skew - five minutes in seconds\n */\nOAuth2Client.CLOCK_SKEW_SECS_ = 300;\n/**\n * The default max Token Lifetime is one day in seconds\n */\nOAuth2Client.DEFAULT_MAX_TOKEN_LIFETIME_SECS_ = 86400;\n", - "\"use strict\";\n// Copyright 2013 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Compute = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst gcpMetadata = require(\"gcp-metadata\");\nconst oauth2client_1 = require(\"./oauth2client\");\nclass Compute extends oauth2client_1.OAuth2Client {\n /**\n * Google Compute Engine service account credentials.\n *\n * Retrieve access token from the metadata server.\n * See: https://cloud.google.com/compute/docs/access/authenticate-workloads#applications\n */\n constructor(options = {}) {\n super(options);\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = { expiry_date: 1, refresh_token: 'compute-placeholder' };\n this.serviceAccountEmail = options.serviceAccountEmail || 'default';\n this.scopes = Array.isArray(options.scopes)\n ? options.scopes\n : options.scopes\n ? [options.scopes]\n : [];\n }\n /**\n * Refreshes the access token.\n * @param refreshToken Unused parameter\n */\n async refreshTokenNoCache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n refreshToken) {\n const tokenPath = `service-accounts/${this.serviceAccountEmail}/token`;\n let data;\n try {\n const instanceOptions = {\n property: tokenPath,\n };\n if (this.scopes.length > 0) {\n instanceOptions.params = {\n scopes: this.scopes.join(','),\n };\n }\n data = await gcpMetadata.instance(instanceOptions);\n }\n catch (e) {\n if (e instanceof gaxios_1.GaxiosError) {\n e.message = `Could not refresh access token: ${e.message}`;\n this.wrapError(e);\n }\n throw e;\n }\n const tokens = data;\n if (data && data.expires_in) {\n tokens.expiry_date = new Date().getTime() + data.expires_in * 1000;\n delete tokens.expires_in;\n }\n this.emit('tokens', tokens);\n return { tokens, res: null };\n }\n /**\n * Fetches an ID token.\n * @param targetAudience the audience for the fetched ID token.\n */\n async fetchIdToken(targetAudience) {\n const idTokenPath = `service-accounts/${this.serviceAccountEmail}/identity` +\n `?format=full&audience=${targetAudience}`;\n let idToken;\n try {\n const instanceOptions = {\n property: idTokenPath,\n };\n idToken = await gcpMetadata.instance(instanceOptions);\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Could not fetch ID token: ${e.message}`;\n }\n throw e;\n }\n return idToken;\n }\n wrapError(e) {\n const res = e.response;\n if (res && res.status) {\n e.status = res.status;\n if (res.status === 403) {\n e.message =\n 'A Forbidden error was returned while attempting to retrieve an access ' +\n 'token for the Compute Engine built-in service account. This may be because the Compute ' +\n 'Engine instance does not have the correct permission scopes specified: ' +\n e.message;\n }\n else if (res.status === 404) {\n e.message =\n 'A Not Found error was returned while attempting to retrieve an access' +\n 'token for the Compute Engine built-in service account. This may be because the Compute ' +\n 'Engine instance does not have any permission scopes specified: ' +\n e.message;\n }\n }\n }\n}\nexports.Compute = Compute;\n", - "\"use strict\";\n// Copyright 2020 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IdTokenClient = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nclass IdTokenClient extends oauth2client_1.OAuth2Client {\n /**\n * Google ID Token client\n *\n * Retrieve ID token from the metadata server.\n * See: https://cloud.google.com/docs/authentication/get-id-token#metadata-server\n */\n constructor(options) {\n super(options);\n this.targetAudience = options.targetAudience;\n this.idTokenProvider = options.idTokenProvider;\n }\n async getRequestMetadataAsync(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n url) {\n if (!this.credentials.id_token ||\n !this.credentials.expiry_date ||\n this.isTokenExpiring()) {\n const idToken = await this.idTokenProvider.fetchIdToken(this.targetAudience);\n this.credentials = {\n id_token: idToken,\n expiry_date: this.getIdTokenExpiryDate(idToken),\n };\n }\n const headers = {\n Authorization: 'Bearer ' + this.credentials.id_token,\n };\n return { headers };\n }\n getIdTokenExpiryDate(idToken) {\n const payloadB64 = idToken.split('.')[1];\n if (payloadB64) {\n const payload = JSON.parse(Buffer.from(payloadB64, 'base64').toString('ascii'));\n return payload.exp * 1000;\n }\n }\n}\nexports.IdTokenClient = IdTokenClient;\n", - "\"use strict\";\n// Copyright 2018 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GCPEnv = void 0;\nexports.clear = clear;\nexports.getEnv = getEnv;\nconst gcpMetadata = require(\"gcp-metadata\");\nvar GCPEnv;\n(function (GCPEnv) {\n GCPEnv[\"APP_ENGINE\"] = \"APP_ENGINE\";\n GCPEnv[\"KUBERNETES_ENGINE\"] = \"KUBERNETES_ENGINE\";\n GCPEnv[\"CLOUD_FUNCTIONS\"] = \"CLOUD_FUNCTIONS\";\n GCPEnv[\"COMPUTE_ENGINE\"] = \"COMPUTE_ENGINE\";\n GCPEnv[\"CLOUD_RUN\"] = \"CLOUD_RUN\";\n GCPEnv[\"NONE\"] = \"NONE\";\n})(GCPEnv || (exports.GCPEnv = GCPEnv = {}));\nlet envPromise;\nfunction clear() {\n envPromise = undefined;\n}\nasync function getEnv() {\n if (envPromise) {\n return envPromise;\n }\n envPromise = getEnvMemoized();\n return envPromise;\n}\nasync function getEnvMemoized() {\n let env = GCPEnv.NONE;\n if (isAppEngine()) {\n env = GCPEnv.APP_ENGINE;\n }\n else if (isCloudFunction()) {\n env = GCPEnv.CLOUD_FUNCTIONS;\n }\n else if (await isComputeEngine()) {\n if (await isKubernetesEngine()) {\n env = GCPEnv.KUBERNETES_ENGINE;\n }\n else if (isCloudRun()) {\n env = GCPEnv.CLOUD_RUN;\n }\n else {\n env = GCPEnv.COMPUTE_ENGINE;\n }\n }\n else {\n env = GCPEnv.NONE;\n }\n return env;\n}\nfunction isAppEngine() {\n return !!(process.env.GAE_SERVICE || process.env.GAE_MODULE_NAME);\n}\nfunction isCloudFunction() {\n return !!(process.env.FUNCTION_NAME || process.env.FUNCTION_TARGET);\n}\n/**\n * This check only verifies that the environment is running knative.\n * This must be run *after* checking for Kubernetes, otherwise it will\n * return a false positive.\n */\nfunction isCloudRun() {\n return !!process.env.K_CONFIGURATION;\n}\nasync function isKubernetesEngine() {\n try {\n await gcpMetadata.instance('attributes/cluster-name');\n return true;\n }\n catch (e) {\n return false;\n }\n}\nasync function isComputeEngine() {\n return gcpMetadata.isAvailable();\n}\n", - "/*global module, process*/\nvar Buffer = require('safe-buffer').Buffer;\nvar Stream = require('stream');\nvar util = require('util');\n\nfunction DataStream(data) {\n this.buffer = null;\n this.writable = true;\n this.readable = true;\n\n // No input\n if (!data) {\n this.buffer = Buffer.alloc(0);\n return this;\n }\n\n // Stream\n if (typeof data.pipe === 'function') {\n this.buffer = Buffer.alloc(0);\n data.pipe(this);\n return this;\n }\n\n // Buffer or String\n // or Object (assumedly a passworded key)\n if (data.length || typeof data === 'object') {\n this.buffer = data;\n this.writable = false;\n process.nextTick(function () {\n this.emit('end', data);\n this.readable = false;\n this.emit('close');\n }.bind(this));\n return this;\n }\n\n throw new TypeError('Unexpected data type ('+ typeof data + ')');\n}\nutil.inherits(DataStream, Stream);\n\nDataStream.prototype.write = function write(data) {\n this.buffer = Buffer.concat([this.buffer, Buffer.from(data)]);\n this.emit('data', data);\n};\n\nDataStream.prototype.end = function end(data) {\n if (data)\n this.write(data);\n this.emit('end', data);\n this.emit('close');\n this.writable = false;\n this.readable = false;\n};\n\nmodule.exports = DataStream;\n", - "/*jshint node:true */\n'use strict';\nvar Buffer = require('buffer').Buffer; // browserify\nvar SlowBuffer = require('buffer').SlowBuffer;\n\nmodule.exports = bufferEq;\n\nfunction bufferEq(a, b) {\n\n // shortcutting on type is necessary for correctness\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n return false;\n }\n\n // buffer sizes should be well-known information, so despite this\n // shortcutting, it doesn't leak any information about the *contents* of the\n // buffers.\n if (a.length !== b.length) {\n return false;\n }\n\n var c = 0;\n for (var i = 0; i < a.length; i++) {\n /*jshint bitwise:false */\n c |= a[i] ^ b[i]; // XOR\n }\n return c === 0;\n}\n\nbufferEq.install = function() {\n Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) {\n return bufferEq(this, that);\n };\n};\n\nvar origBufEqual = Buffer.prototype.equal;\nvar origSlowBufEqual = SlowBuffer.prototype.equal;\nbufferEq.restore = function() {\n Buffer.prototype.equal = origBufEqual;\n SlowBuffer.prototype.equal = origSlowBufEqual;\n};\n", - "var Buffer = require('safe-buffer').Buffer;\nvar crypto = require('crypto');\nvar formatEcdsa = require('ecdsa-sig-formatter');\nvar util = require('util');\n\nvar MSG_INVALID_ALGORITHM = '\"%s\" is not a valid algorithm.\\n Supported algorithms are:\\n \"HS256\", \"HS384\", \"HS512\", \"RS256\", \"RS384\", \"RS512\", \"PS256\", \"PS384\", \"PS512\", \"ES256\", \"ES384\", \"ES512\" and \"none\".'\nvar MSG_INVALID_SECRET = 'secret must be a string or buffer';\nvar MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer';\nvar MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object';\n\nvar supportsKeyObjects = typeof crypto.createPublicKey === 'function';\nif (supportsKeyObjects) {\n MSG_INVALID_VERIFIER_KEY += ' or a KeyObject';\n MSG_INVALID_SECRET += 'or a KeyObject';\n}\n\nfunction checkIsPublicKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return;\n }\n\n if (!supportsKeyObjects) {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key !== 'object') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.type !== 'string') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.asymmetricKeyType !== 'string') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n\n if (typeof key.export !== 'function') {\n throw typeError(MSG_INVALID_VERIFIER_KEY);\n }\n};\n\nfunction checkIsPrivateKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return;\n }\n\n if (typeof key === 'object') {\n return;\n }\n\n throw typeError(MSG_INVALID_SIGNER_KEY);\n};\n\nfunction checkIsSecretKey(key) {\n if (Buffer.isBuffer(key)) {\n return;\n }\n\n if (typeof key === 'string') {\n return key;\n }\n\n if (!supportsKeyObjects) {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (typeof key !== 'object') {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (key.type !== 'secret') {\n throw typeError(MSG_INVALID_SECRET);\n }\n\n if (typeof key.export !== 'function') {\n throw typeError(MSG_INVALID_SECRET);\n }\n}\n\nfunction fromBase64(base64) {\n return base64\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n}\n\nfunction toBase64(base64url) {\n base64url = base64url.toString();\n\n var padding = 4 - base64url.length % 4;\n if (padding !== 4) {\n for (var i = 0; i < padding; ++i) {\n base64url += '=';\n }\n }\n\n return base64url\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n}\n\nfunction typeError(template) {\n var args = [].slice.call(arguments, 1);\n var errMsg = util.format.bind(util, template).apply(null, args);\n return new TypeError(errMsg);\n}\n\nfunction bufferOrString(obj) {\n return Buffer.isBuffer(obj) || typeof obj === 'string';\n}\n\nfunction normalizeInput(thing) {\n if (!bufferOrString(thing))\n thing = JSON.stringify(thing);\n return thing;\n}\n\nfunction createHmacSigner(bits) {\n return function sign(thing, secret) {\n checkIsSecretKey(secret);\n thing = normalizeInput(thing);\n var hmac = crypto.createHmac('sha' + bits, secret);\n var sig = (hmac.update(thing), hmac.digest('base64'))\n return fromBase64(sig);\n }\n}\n\nvar bufferEqual;\nvar timingSafeEqual = 'timingSafeEqual' in crypto ? function timingSafeEqual(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n return crypto.timingSafeEqual(a, b)\n} : function timingSafeEqual(a, b) {\n if (!bufferEqual) {\n bufferEqual = require('buffer-equal-constant-time');\n }\n\n return bufferEqual(a, b)\n}\n\nfunction createHmacVerifier(bits) {\n return function verify(thing, signature, secret) {\n var computedSig = createHmacSigner(bits)(thing, secret);\n return timingSafeEqual(Buffer.from(signature), Buffer.from(computedSig));\n }\n}\n\nfunction createKeySigner(bits) {\n return function sign(thing, privateKey) {\n checkIsPrivateKey(privateKey);\n thing = normalizeInput(thing);\n // Even though we are specifying \"RSA\" here, this works with ECDSA\n // keys as well.\n var signer = crypto.createSign('RSA-SHA' + bits);\n var sig = (signer.update(thing), signer.sign(privateKey, 'base64'));\n return fromBase64(sig);\n }\n}\n\nfunction createKeyVerifier(bits) {\n return function verify(thing, signature, publicKey) {\n checkIsPublicKey(publicKey);\n thing = normalizeInput(thing);\n signature = toBase64(signature);\n var verifier = crypto.createVerify('RSA-SHA' + bits);\n verifier.update(thing);\n return verifier.verify(publicKey, signature, 'base64');\n }\n}\n\nfunction createPSSKeySigner(bits) {\n return function sign(thing, privateKey) {\n checkIsPrivateKey(privateKey);\n thing = normalizeInput(thing);\n var signer = crypto.createSign('RSA-SHA' + bits);\n var sig = (signer.update(thing), signer.sign({\n key: privateKey,\n padding: crypto.constants.RSA_PKCS1_PSS_PADDING,\n saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST\n }, 'base64'));\n return fromBase64(sig);\n }\n}\n\nfunction createPSSKeyVerifier(bits) {\n return function verify(thing, signature, publicKey) {\n checkIsPublicKey(publicKey);\n thing = normalizeInput(thing);\n signature = toBase64(signature);\n var verifier = crypto.createVerify('RSA-SHA' + bits);\n verifier.update(thing);\n return verifier.verify({\n key: publicKey,\n padding: crypto.constants.RSA_PKCS1_PSS_PADDING,\n saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST\n }, signature, 'base64');\n }\n}\n\nfunction createECDSASigner(bits) {\n var inner = createKeySigner(bits);\n return function sign() {\n var signature = inner.apply(null, arguments);\n signature = formatEcdsa.derToJose(signature, 'ES' + bits);\n return signature;\n };\n}\n\nfunction createECDSAVerifer(bits) {\n var inner = createKeyVerifier(bits);\n return function verify(thing, signature, publicKey) {\n signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64');\n var result = inner(thing, signature, publicKey);\n return result;\n };\n}\n\nfunction createNoneSigner() {\n return function sign() {\n return '';\n }\n}\n\nfunction createNoneVerifier() {\n return function verify(thing, signature) {\n return signature === '';\n }\n}\n\nmodule.exports = function jwa(algorithm) {\n var signerFactories = {\n hs: createHmacSigner,\n rs: createKeySigner,\n ps: createPSSKeySigner,\n es: createECDSASigner,\n none: createNoneSigner,\n }\n var verifierFactories = {\n hs: createHmacVerifier,\n rs: createKeyVerifier,\n ps: createPSSKeyVerifier,\n es: createECDSAVerifer,\n none: createNoneVerifier,\n }\n var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);\n if (!match)\n throw typeError(MSG_INVALID_ALGORITHM, algorithm);\n var algo = (match[1] || match[3]).toLowerCase();\n var bits = match[2];\n\n return {\n sign: signerFactories[algo](bits),\n verify: verifierFactories[algo](bits),\n }\n};\n", - "/*global module*/\nvar Buffer = require('buffer').Buffer;\n\nmodule.exports = function toString(obj) {\n if (typeof obj === 'string')\n return obj;\n if (typeof obj === 'number' || Buffer.isBuffer(obj))\n return obj.toString();\n return JSON.stringify(obj);\n};\n", - "/*global module*/\nvar Buffer = require('safe-buffer').Buffer;\nvar DataStream = require('./data-stream');\nvar jwa = require('jwa');\nvar Stream = require('stream');\nvar toString = require('./tostring');\nvar util = require('util');\n\nfunction base64url(string, encoding) {\n return Buffer\n .from(string, encoding)\n .toString('base64')\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n}\n\nfunction jwsSecuredInput(header, payload, encoding) {\n encoding = encoding || 'utf8';\n var encodedHeader = base64url(toString(header), 'binary');\n var encodedPayload = base64url(toString(payload), encoding);\n return util.format('%s.%s', encodedHeader, encodedPayload);\n}\n\nfunction jwsSign(opts) {\n var header = opts.header;\n var payload = opts.payload;\n var secretOrKey = opts.secret || opts.privateKey;\n var encoding = opts.encoding;\n var algo = jwa(header.alg);\n var securedInput = jwsSecuredInput(header, payload, encoding);\n var signature = algo.sign(securedInput, secretOrKey);\n return util.format('%s.%s', securedInput, signature);\n}\n\nfunction SignStream(opts) {\n var secret = opts.secret;\n secret = secret == null ? opts.privateKey : secret;\n secret = secret == null ? opts.key : secret;\n if (/^hs/i.test(opts.header.alg) === true && secret == null) {\n throw new TypeError('secret must be a string or buffer or a KeyObject')\n }\n var secretStream = new DataStream(secret);\n this.readable = true;\n this.header = opts.header;\n this.encoding = opts.encoding;\n this.secret = this.privateKey = this.key = secretStream;\n this.payload = new DataStream(opts.payload);\n this.secret.once('close', function () {\n if (!this.payload.writable && this.readable)\n this.sign();\n }.bind(this));\n\n this.payload.once('close', function () {\n if (!this.secret.writable && this.readable)\n this.sign();\n }.bind(this));\n}\nutil.inherits(SignStream, Stream);\n\nSignStream.prototype.sign = function sign() {\n try {\n var signature = jwsSign({\n header: this.header,\n payload: this.payload.buffer,\n secret: this.secret.buffer,\n encoding: this.encoding\n });\n this.emit('done', signature);\n this.emit('data', signature);\n this.emit('end');\n this.readable = false;\n return signature;\n } catch (e) {\n this.readable = false;\n this.emit('error', e);\n this.emit('close');\n }\n};\n\nSignStream.sign = jwsSign;\n\nmodule.exports = SignStream;\n", - "/*global module*/\nvar Buffer = require('safe-buffer').Buffer;\nvar DataStream = require('./data-stream');\nvar jwa = require('jwa');\nvar Stream = require('stream');\nvar toString = require('./tostring');\nvar util = require('util');\nvar JWS_REGEX = /^[a-zA-Z0-9\\-_]+?\\.[a-zA-Z0-9\\-_]+?\\.([a-zA-Z0-9\\-_]+)?$/;\n\nfunction isObject(thing) {\n return Object.prototype.toString.call(thing) === '[object Object]';\n}\n\nfunction safeJsonParse(thing) {\n if (isObject(thing))\n return thing;\n try { return JSON.parse(thing); }\n catch (e) { return undefined; }\n}\n\nfunction headerFromJWS(jwsSig) {\n var encodedHeader = jwsSig.split('.', 1)[0];\n return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary'));\n}\n\nfunction securedInputFromJWS(jwsSig) {\n return jwsSig.split('.', 2).join('.');\n}\n\nfunction signatureFromJWS(jwsSig) {\n return jwsSig.split('.')[2];\n}\n\nfunction payloadFromJWS(jwsSig, encoding) {\n encoding = encoding || 'utf8';\n var payload = jwsSig.split('.')[1];\n return Buffer.from(payload, 'base64').toString(encoding);\n}\n\nfunction isValidJws(string) {\n return JWS_REGEX.test(string) && !!headerFromJWS(string);\n}\n\nfunction jwsVerify(jwsSig, algorithm, secretOrKey) {\n if (!algorithm) {\n var err = new Error(\"Missing algorithm parameter for jws.verify\");\n err.code = \"MISSING_ALGORITHM\";\n throw err;\n }\n jwsSig = toString(jwsSig);\n var signature = signatureFromJWS(jwsSig);\n var securedInput = securedInputFromJWS(jwsSig);\n var algo = jwa(algorithm);\n return algo.verify(securedInput, signature, secretOrKey);\n}\n\nfunction jwsDecode(jwsSig, opts) {\n opts = opts || {};\n jwsSig = toString(jwsSig);\n\n if (!isValidJws(jwsSig))\n return null;\n\n var header = headerFromJWS(jwsSig);\n\n if (!header)\n return null;\n\n var payload = payloadFromJWS(jwsSig);\n if (header.typ === 'JWT' || opts.json)\n payload = JSON.parse(payload, opts.encoding);\n\n return {\n header: header,\n payload: payload,\n signature: signatureFromJWS(jwsSig)\n };\n}\n\nfunction VerifyStream(opts) {\n opts = opts || {};\n var secretOrKey = opts.secret;\n secretOrKey = secretOrKey == null ? opts.publicKey : secretOrKey;\n secretOrKey = secretOrKey == null ? opts.key : secretOrKey;\n if (/^hs/i.test(opts.algorithm) === true && secretOrKey == null) {\n throw new TypeError('secret must be a string or buffer or a KeyObject')\n }\n var secretStream = new DataStream(secretOrKey);\n this.readable = true;\n this.algorithm = opts.algorithm;\n this.encoding = opts.encoding;\n this.secret = this.publicKey = this.key = secretStream;\n this.signature = new DataStream(opts.signature);\n this.secret.once('close', function () {\n if (!this.signature.writable && this.readable)\n this.verify();\n }.bind(this));\n\n this.signature.once('close', function () {\n if (!this.secret.writable && this.readable)\n this.verify();\n }.bind(this));\n}\nutil.inherits(VerifyStream, Stream);\nVerifyStream.prototype.verify = function verify() {\n try {\n var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer);\n var obj = jwsDecode(this.signature.buffer, this.encoding);\n this.emit('done', valid, obj);\n this.emit('data', valid);\n this.emit('end');\n this.readable = false;\n return valid;\n } catch (e) {\n this.readable = false;\n this.emit('error', e);\n this.emit('close');\n }\n};\n\nVerifyStream.decode = jwsDecode;\nVerifyStream.isValid = isValidJws;\nVerifyStream.verify = jwsVerify;\n\nmodule.exports = VerifyStream;\n", - "/*global exports*/\nvar SignStream = require('./lib/sign-stream');\nvar VerifyStream = require('./lib/verify-stream');\n\nvar ALGORITHMS = [\n 'HS256', 'HS384', 'HS512',\n 'RS256', 'RS384', 'RS512',\n 'PS256', 'PS384', 'PS512',\n 'ES256', 'ES384', 'ES512'\n];\n\nexports.ALGORITHMS = ALGORITHMS;\nexports.sign = SignStream.sign;\nexports.verify = VerifyStream.verify;\nexports.decode = VerifyStream.decode;\nexports.isValid = VerifyStream.isValid;\nexports.createSign = function createSign(opts) {\n return new SignStream(opts);\n};\nexports.createVerify = function createVerify(opts) {\n return new VerifyStream(opts);\n};\n", - "\"use strict\";\n/**\n * Copyright 2018 Google LLC\n *\n * Distributed under MIT license.\n * See file LICENSE for detail or copy at https://opensource.org/licenses/MIT\n */\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _GoogleToken_instances, _GoogleToken_inFlightRequest, _GoogleToken_getTokenAsync, _GoogleToken_getTokenAsyncInner, _GoogleToken_ensureEmail, _GoogleToken_revokeTokenAsync, _GoogleToken_configure, _GoogleToken_requestToken;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleToken = void 0;\nconst fs = require(\"fs\");\nconst gaxios_1 = require(\"gaxios\");\nconst jws = require(\"jws\");\nconst path = require(\"path\");\nconst util_1 = require(\"util\");\nconst readFile = fs.readFile\n ? (0, util_1.promisify)(fs.readFile)\n : async () => {\n // if running in the web-browser, fs.readFile may not have been shimmed.\n throw new ErrorWithCode('use key rather than keyFile.', 'MISSING_CREDENTIALS');\n };\nconst GOOGLE_TOKEN_URL = 'https://www.googleapis.com/oauth2/v4/token';\nconst GOOGLE_REVOKE_TOKEN_URL = 'https://accounts.google.com/o/oauth2/revoke?token=';\nclass ErrorWithCode extends Error {\n constructor(message, code) {\n super(message);\n this.code = code;\n }\n}\nclass GoogleToken {\n get accessToken() {\n return this.rawToken ? this.rawToken.access_token : undefined;\n }\n get idToken() {\n return this.rawToken ? this.rawToken.id_token : undefined;\n }\n get tokenType() {\n return this.rawToken ? this.rawToken.token_type : undefined;\n }\n get refreshToken() {\n return this.rawToken ? this.rawToken.refresh_token : undefined;\n }\n /**\n * Create a GoogleToken.\n *\n * @param options Configuration object.\n */\n constructor(options) {\n _GoogleToken_instances.add(this);\n this.transporter = {\n request: opts => (0, gaxios_1.request)(opts),\n };\n _GoogleToken_inFlightRequest.set(this, void 0);\n __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_configure).call(this, options);\n }\n /**\n * Returns whether the token has expired.\n *\n * @return true if the token has expired, false otherwise.\n */\n hasExpired() {\n const now = new Date().getTime();\n if (this.rawToken && this.expiresAt) {\n return now >= this.expiresAt;\n }\n else {\n return true;\n }\n }\n /**\n * Returns whether the token will expire within eagerRefreshThresholdMillis\n *\n * @return true if the token will be expired within eagerRefreshThresholdMillis, false otherwise.\n */\n isTokenExpiring() {\n var _a;\n const now = new Date().getTime();\n const eagerRefreshThresholdMillis = (_a = this.eagerRefreshThresholdMillis) !== null && _a !== void 0 ? _a : 0;\n if (this.rawToken && this.expiresAt) {\n return this.expiresAt <= now + eagerRefreshThresholdMillis;\n }\n else {\n return true;\n }\n }\n getToken(callback, opts = {}) {\n if (typeof callback === 'object') {\n opts = callback;\n callback = undefined;\n }\n opts = Object.assign({\n forceRefresh: false,\n }, opts);\n if (callback) {\n const cb = callback;\n __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_getTokenAsync).call(this, opts).then(t => cb(null, t), callback);\n return;\n }\n return __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_getTokenAsync).call(this, opts);\n }\n /**\n * Given a keyFile, extract the key and client email if available\n * @param keyFile Path to a json, pem, or p12 file that contains the key.\n * @returns an object with privateKey and clientEmail properties\n */\n async getCredentials(keyFile) {\n const ext = path.extname(keyFile);\n switch (ext) {\n case '.json': {\n const key = await readFile(keyFile, 'utf8');\n const body = JSON.parse(key);\n const privateKey = body.private_key;\n const clientEmail = body.client_email;\n if (!privateKey || !clientEmail) {\n throw new ErrorWithCode('private_key and client_email are required.', 'MISSING_CREDENTIALS');\n }\n return { privateKey, clientEmail };\n }\n case '.der':\n case '.crt':\n case '.pem': {\n const privateKey = await readFile(keyFile, 'utf8');\n return { privateKey };\n }\n case '.p12':\n case '.pfx': {\n throw new ErrorWithCode('*.p12 certificates are not supported after v6.1.2. ' +\n 'Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.', 'UNKNOWN_CERTIFICATE_TYPE');\n }\n default:\n throw new ErrorWithCode('Unknown certificate type. Type is determined based on file extension. ' +\n 'Current supported extensions are *.json, and *.pem.', 'UNKNOWN_CERTIFICATE_TYPE');\n }\n }\n revokeToken(callback) {\n if (callback) {\n __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_revokeTokenAsync).call(this).then(() => callback(), callback);\n return;\n }\n return __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_revokeTokenAsync).call(this);\n }\n}\nexports.GoogleToken = GoogleToken;\n_GoogleToken_inFlightRequest = new WeakMap(), _GoogleToken_instances = new WeakSet(), _GoogleToken_getTokenAsync = async function _GoogleToken_getTokenAsync(opts) {\n if (__classPrivateFieldGet(this, _GoogleToken_inFlightRequest, \"f\") && !opts.forceRefresh) {\n return __classPrivateFieldGet(this, _GoogleToken_inFlightRequest, \"f\");\n }\n try {\n return await (__classPrivateFieldSet(this, _GoogleToken_inFlightRequest, __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_getTokenAsyncInner).call(this, opts), \"f\"));\n }\n finally {\n __classPrivateFieldSet(this, _GoogleToken_inFlightRequest, undefined, \"f\");\n }\n}, _GoogleToken_getTokenAsyncInner = async function _GoogleToken_getTokenAsyncInner(opts) {\n if (this.isTokenExpiring() === false && opts.forceRefresh === false) {\n return Promise.resolve(this.rawToken);\n }\n if (!this.key && !this.keyFile) {\n throw new Error('No key or keyFile set.');\n }\n if (!this.key && this.keyFile) {\n const creds = await this.getCredentials(this.keyFile);\n this.key = creds.privateKey;\n this.iss = creds.clientEmail || this.iss;\n if (!creds.clientEmail) {\n __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_ensureEmail).call(this);\n }\n }\n return __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_requestToken).call(this);\n}, _GoogleToken_ensureEmail = function _GoogleToken_ensureEmail() {\n if (!this.iss) {\n throw new ErrorWithCode('email is required.', 'MISSING_CREDENTIALS');\n }\n}, _GoogleToken_revokeTokenAsync = async function _GoogleToken_revokeTokenAsync() {\n if (!this.accessToken) {\n throw new Error('No token to revoke.');\n }\n const url = GOOGLE_REVOKE_TOKEN_URL + this.accessToken;\n await this.transporter.request({\n url,\n retry: true,\n });\n __classPrivateFieldGet(this, _GoogleToken_instances, \"m\", _GoogleToken_configure).call(this, {\n email: this.iss,\n sub: this.sub,\n key: this.key,\n keyFile: this.keyFile,\n scope: this.scope,\n additionalClaims: this.additionalClaims,\n });\n}, _GoogleToken_configure = function _GoogleToken_configure(options = {}) {\n this.keyFile = options.keyFile;\n this.key = options.key;\n this.rawToken = undefined;\n this.iss = options.email || options.iss;\n this.sub = options.sub;\n this.additionalClaims = options.additionalClaims;\n if (typeof options.scope === 'object') {\n this.scope = options.scope.join(' ');\n }\n else {\n this.scope = options.scope;\n }\n this.eagerRefreshThresholdMillis = options.eagerRefreshThresholdMillis;\n if (options.transporter) {\n this.transporter = options.transporter;\n }\n}, _GoogleToken_requestToken = \n/**\n * Request the token from Google.\n */\nasync function _GoogleToken_requestToken() {\n var _a, _b;\n const iat = Math.floor(new Date().getTime() / 1000);\n const additionalClaims = this.additionalClaims || {};\n const payload = Object.assign({\n iss: this.iss,\n scope: this.scope,\n aud: GOOGLE_TOKEN_URL,\n exp: iat + 3600,\n iat,\n sub: this.sub,\n }, additionalClaims);\n const signedJWT = jws.sign({\n header: { alg: 'RS256' },\n payload,\n secret: this.key,\n });\n try {\n const r = await this.transporter.request({\n method: 'POST',\n url: GOOGLE_TOKEN_URL,\n data: {\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: signedJWT,\n },\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n responseType: 'json',\n retryConfig: {\n httpMethodsToRetry: ['POST'],\n },\n });\n this.rawToken = r.data;\n this.expiresAt =\n r.data.expires_in === null || r.data.expires_in === undefined\n ? undefined\n : (iat + r.data.expires_in) * 1000;\n return this.rawToken;\n }\n catch (e) {\n this.rawToken = undefined;\n this.tokenExpires = undefined;\n const body = e.response && ((_a = e.response) === null || _a === void 0 ? void 0 : _a.data)\n ? (_b = e.response) === null || _b === void 0 ? void 0 : _b.data\n : {};\n if (body.error) {\n const desc = body.error_description\n ? `: ${body.error_description}`\n : '';\n e.message = `${body.error}${desc}`;\n }\n throw e;\n }\n};\n//# sourceMappingURL=index.js.map", - "\"use strict\";\n// Copyright 2015 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JWTAccess = void 0;\nconst jws = require(\"jws\");\nconst util_1 = require(\"../util\");\nconst DEFAULT_HEADER = {\n alg: 'RS256',\n typ: 'JWT',\n};\nclass JWTAccess {\n /**\n * JWTAccess service account credentials.\n *\n * Create a new access token by using the credential to create a new JWT token\n * that's recognized as the access token.\n *\n * @param email the service account email address.\n * @param key the private key that will be used to sign the token.\n * @param keyId the ID of the private key used to sign the token.\n */\n constructor(email, key, keyId, eagerRefreshThresholdMillis) {\n this.cache = new util_1.LRUCache({\n capacity: 500,\n maxAge: 60 * 60 * 1000,\n });\n this.email = email;\n this.key = key;\n this.keyId = keyId;\n this.eagerRefreshThresholdMillis =\n eagerRefreshThresholdMillis !== null && eagerRefreshThresholdMillis !== void 0 ? eagerRefreshThresholdMillis : 5 * 60 * 1000;\n }\n /**\n * Ensures that we're caching a key appropriately, giving precedence to scopes vs. url\n *\n * @param url The URI being authorized.\n * @param scopes The scope or scopes being authorized\n * @returns A string that returns the cached key.\n */\n getCachedKey(url, scopes) {\n let cacheKey = url;\n if (scopes && Array.isArray(scopes) && scopes.length) {\n cacheKey = url ? `${url}_${scopes.join('_')}` : `${scopes.join('_')}`;\n }\n else if (typeof scopes === 'string') {\n cacheKey = url ? `${url}_${scopes}` : scopes;\n }\n if (!cacheKey) {\n throw Error('Scopes or url must be provided');\n }\n return cacheKey;\n }\n /**\n * Get a non-expired access token, after refreshing if necessary.\n *\n * @param url The URI being authorized.\n * @param additionalClaims An object with a set of additional claims to\n * include in the payload.\n * @returns An object that includes the authorization header.\n */\n getRequestHeaders(url, additionalClaims, scopes) {\n // Return cached authorization headers, unless we are within\n // eagerRefreshThresholdMillis ms of them expiring:\n const key = this.getCachedKey(url, scopes);\n const cachedToken = this.cache.get(key);\n const now = Date.now();\n if (cachedToken &&\n cachedToken.expiration - now > this.eagerRefreshThresholdMillis) {\n return cachedToken.headers;\n }\n const iat = Math.floor(Date.now() / 1000);\n const exp = JWTAccess.getExpirationTime(iat);\n let defaultClaims;\n // Turn scopes into space-separated string\n if (Array.isArray(scopes)) {\n scopes = scopes.join(' ');\n }\n // If scopes are specified, sign with scopes\n if (scopes) {\n defaultClaims = {\n iss: this.email,\n sub: this.email,\n scope: scopes,\n exp,\n iat,\n };\n }\n else {\n defaultClaims = {\n iss: this.email,\n sub: this.email,\n aud: url,\n exp,\n iat,\n };\n }\n // if additionalClaims are provided, ensure they do not collide with\n // other required claims.\n if (additionalClaims) {\n for (const claim in defaultClaims) {\n if (additionalClaims[claim]) {\n throw new Error(`The '${claim}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`);\n }\n }\n }\n const header = this.keyId\n ? { ...DEFAULT_HEADER, kid: this.keyId }\n : DEFAULT_HEADER;\n const payload = Object.assign(defaultClaims, additionalClaims);\n // Sign the jwt and add it to the cache\n const signedJWT = jws.sign({ header, payload, secret: this.key });\n const headers = { Authorization: `Bearer ${signedJWT}` };\n this.cache.set(key, {\n expiration: exp * 1000,\n headers,\n });\n return headers;\n }\n /**\n * Returns an expiration time for the JWT token.\n *\n * @param iat The issued at time for the JWT.\n * @returns An expiration time for the JWT.\n */\n static getExpirationTime(iat) {\n const exp = iat + 3600; // 3600 seconds = 1 hour\n return exp;\n }\n /**\n * Create a JWTAccess credentials instance using the given input options.\n * @param json The input object.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the service account auth settings.');\n }\n if (!json.client_email) {\n throw new Error('The incoming JSON object does not contain a client_email field');\n }\n if (!json.private_key) {\n throw new Error('The incoming JSON object does not contain a private_key field');\n }\n // Extract the relevant information from the json key file.\n this.email = json.client_email;\n this.key = json.private_key;\n this.keyId = json.private_key_id;\n this.projectId = json.project_id;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n reject(new Error('Must pass in a stream containing the service account auth settings.'));\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('data', chunk => (s += chunk))\n .on('error', reject)\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n resolve();\n }\n catch (err) {\n reject(err);\n }\n });\n });\n }\n}\nexports.JWTAccess = JWTAccess;\n", - "\"use strict\";\n// Copyright 2013 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JWT = void 0;\nconst gtoken_1 = require(\"gtoken\");\nconst jwtaccess_1 = require(\"./jwtaccess\");\nconst oauth2client_1 = require(\"./oauth2client\");\nconst authclient_1 = require(\"./authclient\");\nclass JWT extends oauth2client_1.OAuth2Client {\n constructor(optionsOrEmail, keyFile, key, scopes, subject, keyId) {\n const opts = optionsOrEmail && typeof optionsOrEmail === 'object'\n ? optionsOrEmail\n : { email: optionsOrEmail, keyFile, key, keyId, scopes, subject };\n super(opts);\n this.email = opts.email;\n this.keyFile = opts.keyFile;\n this.key = opts.key;\n this.keyId = opts.keyId;\n this.scopes = opts.scopes;\n this.subject = opts.subject;\n this.additionalClaims = opts.additionalClaims;\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = { refresh_token: 'jwt-placeholder', expiry_date: 1 };\n }\n /**\n * Creates a copy of the credential with the specified scopes.\n * @param scopes List of requested scopes or a single scope.\n * @return The cloned instance.\n */\n createScoped(scopes) {\n const jwt = new JWT(this);\n jwt.scopes = scopes;\n return jwt;\n }\n /**\n * Obtains the metadata to be sent with the request.\n *\n * @param url the URI being authorized.\n */\n async getRequestMetadataAsync(url) {\n url = this.defaultServicePath ? `https://${this.defaultServicePath}/` : url;\n const useSelfSignedJWT = (!this.hasUserScopes() && url) ||\n (this.useJWTAccessWithScope && this.hasAnyScopes()) ||\n this.universeDomain !== authclient_1.DEFAULT_UNIVERSE;\n if (this.subject && this.universeDomain !== authclient_1.DEFAULT_UNIVERSE) {\n throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${authclient_1.DEFAULT_UNIVERSE}`);\n }\n if (!this.apiKey && useSelfSignedJWT) {\n if (this.additionalClaims &&\n this.additionalClaims.target_audience) {\n const { tokens } = await this.refreshToken();\n return {\n headers: this.addSharedMetadataHeaders({\n Authorization: `Bearer ${tokens.id_token}`,\n }),\n };\n }\n else {\n // no scopes have been set, but a uri has been provided. Use JWTAccess\n // credentials.\n if (!this.access) {\n this.access = new jwtaccess_1.JWTAccess(this.email, this.key, this.keyId, this.eagerRefreshThresholdMillis);\n }\n let scopes;\n if (this.hasUserScopes()) {\n scopes = this.scopes;\n }\n else if (!url) {\n scopes = this.defaultScopes;\n }\n const useScopes = this.useJWTAccessWithScope ||\n this.universeDomain !== authclient_1.DEFAULT_UNIVERSE;\n const headers = await this.access.getRequestHeaders(url !== null && url !== void 0 ? url : undefined, this.additionalClaims, \n // Scopes take precedent over audience for signing,\n // so we only provide them if `useJWTAccessWithScope` is on or\n // if we are in a non-default universe\n useScopes ? scopes : undefined);\n return { headers: this.addSharedMetadataHeaders(headers) };\n }\n }\n else if (this.hasAnyScopes() || this.apiKey) {\n return super.getRequestMetadataAsync(url);\n }\n else {\n // If no audience, apiKey, or scopes are provided, we should not attempt\n // to populate any headers:\n return { headers: {} };\n }\n }\n /**\n * Fetches an ID token.\n * @param targetAudience the audience for the fetched ID token.\n */\n async fetchIdToken(targetAudience) {\n // Create a new gToken for fetching an ID token\n const gtoken = new gtoken_1.GoogleToken({\n iss: this.email,\n sub: this.subject,\n scope: this.scopes || this.defaultScopes,\n keyFile: this.keyFile,\n key: this.key,\n additionalClaims: { target_audience: targetAudience },\n transporter: this.transporter,\n });\n await gtoken.getToken({\n forceRefresh: true,\n });\n if (!gtoken.idToken) {\n throw new Error('Unknown error: Failed to fetch ID token');\n }\n return gtoken.idToken;\n }\n /**\n * Determine if there are currently scopes available.\n */\n hasUserScopes() {\n if (!this.scopes) {\n return false;\n }\n return this.scopes.length > 0;\n }\n /**\n * Are there any default or user scopes defined.\n */\n hasAnyScopes() {\n if (this.scopes && this.scopes.length > 0)\n return true;\n if (this.defaultScopes && this.defaultScopes.length > 0)\n return true;\n return false;\n }\n authorize(callback) {\n if (callback) {\n this.authorizeAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.authorizeAsync();\n }\n }\n async authorizeAsync() {\n const result = await this.refreshToken();\n if (!result) {\n throw new Error('No result returned');\n }\n this.credentials = result.tokens;\n this.credentials.refresh_token = 'jwt-placeholder';\n this.key = this.gtoken.key;\n this.email = this.gtoken.iss;\n return result.tokens;\n }\n /**\n * Refreshes the access token.\n * @param refreshToken ignored\n * @private\n */\n async refreshTokenNoCache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n refreshToken) {\n const gtoken = this.createGToken();\n const token = await gtoken.getToken({\n forceRefresh: this.isTokenExpiring(),\n });\n const tokens = {\n access_token: token.access_token,\n token_type: 'Bearer',\n expiry_date: gtoken.expiresAt,\n id_token: gtoken.idToken,\n };\n this.emit('tokens', tokens);\n return { res: null, tokens };\n }\n /**\n * Create a gToken if it doesn't already exist.\n */\n createGToken() {\n if (!this.gtoken) {\n this.gtoken = new gtoken_1.GoogleToken({\n iss: this.email,\n sub: this.subject,\n scope: this.scopes || this.defaultScopes,\n keyFile: this.keyFile,\n key: this.key,\n additionalClaims: this.additionalClaims,\n transporter: this.transporter,\n });\n }\n return this.gtoken;\n }\n /**\n * Create a JWT credentials instance using the given input options.\n * @param json The input object.\n *\n * @remarks\n *\n * **Important**: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to {@link https://cloud.google.com/docs/authentication/external/externally-sourced-credentials Validate credential configurations from external sources}.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the service account auth settings.');\n }\n if (!json.client_email) {\n throw new Error('The incoming JSON object does not contain a client_email field');\n }\n if (!json.private_key) {\n throw new Error('The incoming JSON object does not contain a private_key field');\n }\n // Extract the relevant information from the json key file.\n this.email = json.client_email;\n this.key = json.private_key;\n this.keyId = json.private_key_id;\n this.projectId = json.project_id;\n this.quotaProjectId = json.quota_project_id;\n this.universeDomain = json.universe_domain || this.universeDomain;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n throw new Error('Must pass in a stream containing the service account auth settings.');\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => (s += chunk))\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n });\n }\n /**\n * Creates a JWT credentials instance using an API Key for authentication.\n * @param apiKey The API Key in string form.\n */\n fromAPIKey(apiKey) {\n if (typeof apiKey !== 'string') {\n throw new Error('Must provide an API Key string.');\n }\n this.apiKey = apiKey;\n }\n /**\n * Using the key or keyFile on the JWT client, obtain an object that contains\n * the key and the client email.\n */\n async getCredentials() {\n if (this.key) {\n return { private_key: this.key, client_email: this.email };\n }\n else if (this.keyFile) {\n const gtoken = this.createGToken();\n const creds = await gtoken.getCredentials(this.keyFile);\n return { private_key: creds.privateKey, client_email: creds.clientEmail };\n }\n throw new Error('A key or a keyFile must be provided to getCredentials.');\n }\n}\nexports.JWT = JWT;\n", - "\"use strict\";\n// Copyright 2015 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UserRefreshClient = exports.USER_REFRESH_ACCOUNT_TYPE = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nconst querystring_1 = require(\"querystring\");\nexports.USER_REFRESH_ACCOUNT_TYPE = 'authorized_user';\nclass UserRefreshClient extends oauth2client_1.OAuth2Client {\n constructor(optionsOrClientId, clientSecret, refreshToken, eagerRefreshThresholdMillis, forceRefreshOnFailure) {\n const opts = optionsOrClientId && typeof optionsOrClientId === 'object'\n ? optionsOrClientId\n : {\n clientId: optionsOrClientId,\n clientSecret,\n refreshToken,\n eagerRefreshThresholdMillis,\n forceRefreshOnFailure,\n };\n super(opts);\n this._refreshToken = opts.refreshToken;\n this.credentials.refresh_token = opts.refreshToken;\n }\n /**\n * Refreshes the access token.\n * @param refreshToken An ignored refreshToken..\n * @param callback Optional callback.\n */\n async refreshTokenNoCache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n refreshToken) {\n return super.refreshTokenNoCache(this._refreshToken);\n }\n async fetchIdToken(targetAudience) {\n const res = await this.transporter.request({\n ...UserRefreshClient.RETRY_CONFIG,\n url: this.endpoints.oauth2TokenUrl,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n method: 'POST',\n data: (0, querystring_1.stringify)({\n client_id: this._clientId,\n client_secret: this._clientSecret,\n grant_type: 'refresh_token',\n refresh_token: this._refreshToken,\n target_audience: targetAudience,\n }),\n });\n return res.data.id_token;\n }\n /**\n * Create a UserRefreshClient credentials instance using the given input\n * options.\n * @param json The input object.\n */\n fromJSON(json) {\n if (!json) {\n throw new Error('Must pass in a JSON object containing the user refresh token');\n }\n if (json.type !== 'authorized_user') {\n throw new Error('The incoming JSON object does not have the \"authorized_user\" type');\n }\n if (!json.client_id) {\n throw new Error('The incoming JSON object does not contain a client_id field');\n }\n if (!json.client_secret) {\n throw new Error('The incoming JSON object does not contain a client_secret field');\n }\n if (!json.refresh_token) {\n throw new Error('The incoming JSON object does not contain a refresh_token field');\n }\n this._clientId = json.client_id;\n this._clientSecret = json.client_secret;\n this._refreshToken = json.refresh_token;\n this.credentials.refresh_token = json.refresh_token;\n this.quotaProjectId = json.quota_project_id;\n this.universeDomain = json.universe_domain || this.universeDomain;\n }\n fromStream(inputStream, callback) {\n if (callback) {\n this.fromStreamAsync(inputStream).then(() => callback(), callback);\n }\n else {\n return this.fromStreamAsync(inputStream);\n }\n }\n async fromStreamAsync(inputStream) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n return reject(new Error('Must pass in a stream containing the user refresh token.'));\n }\n let s = '';\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => (s += chunk))\n .on('end', () => {\n try {\n const data = JSON.parse(s);\n this.fromJSON(data);\n return resolve();\n }\n catch (err) {\n return reject(err);\n }\n });\n });\n }\n /**\n * Create a UserRefreshClient credentials instance using the given input\n * options.\n * @param json The input object.\n */\n static fromJSON(json) {\n const client = new UserRefreshClient();\n client.fromJSON(json);\n return client;\n }\n}\nexports.UserRefreshClient = UserRefreshClient;\n", - "\"use strict\";\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Impersonated = exports.IMPERSONATED_ACCOUNT_TYPE = void 0;\nconst oauth2client_1 = require(\"./oauth2client\");\nconst gaxios_1 = require(\"gaxios\");\nconst util_1 = require(\"../util\");\nexports.IMPERSONATED_ACCOUNT_TYPE = 'impersonated_service_account';\nclass Impersonated extends oauth2client_1.OAuth2Client {\n /**\n * Impersonated service account credentials.\n *\n * Create a new access token by impersonating another service account.\n *\n * Impersonated Credentials allowing credentials issued to a user or\n * service account to impersonate another. The source project using\n * Impersonated Credentials must enable the \"IAMCredentials\" API.\n * Also, the target service account must grant the orginating principal\n * the \"Service Account Token Creator\" IAM role.\n *\n * @param {object} options - The configuration object.\n * @param {object} [options.sourceClient] the source credential used as to\n * acquire the impersonated credentials.\n * @param {string} [options.targetPrincipal] the service account to\n * impersonate.\n * @param {string[]} [options.delegates] the chained list of delegates\n * required to grant the final access_token. If set, the sequence of\n * identities must have \"Service Account Token Creator\" capability granted to\n * the preceding identity. For example, if set to [serviceAccountB,\n * serviceAccountC], the sourceCredential must have the Token Creator role on\n * serviceAccountB. serviceAccountB must have the Token Creator on\n * serviceAccountC. Finally, C must have Token Creator on target_principal.\n * If left unset, sourceCredential must have that role on targetPrincipal.\n * @param {string[]} [options.targetScopes] scopes to request during the\n * authorization grant.\n * @param {number} [options.lifetime] number of seconds the delegated\n * credential should be valid for up to 3600 seconds by default, or 43,200\n * seconds by extending the token's lifetime, see:\n * https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials#sa-credentials-oauth\n * @param {string} [options.endpoint] api endpoint override.\n */\n constructor(options = {}) {\n var _a, _b, _c, _d, _e, _f;\n super(options);\n // Start with an expired refresh token, which will automatically be\n // refreshed before the first API call is made.\n this.credentials = {\n expiry_date: 1,\n refresh_token: 'impersonated-placeholder',\n };\n this.sourceClient = (_a = options.sourceClient) !== null && _a !== void 0 ? _a : new oauth2client_1.OAuth2Client();\n this.targetPrincipal = (_b = options.targetPrincipal) !== null && _b !== void 0 ? _b : '';\n this.delegates = (_c = options.delegates) !== null && _c !== void 0 ? _c : [];\n this.targetScopes = (_d = options.targetScopes) !== null && _d !== void 0 ? _d : [];\n this.lifetime = (_e = options.lifetime) !== null && _e !== void 0 ? _e : 3600;\n const usingExplicitUniverseDomain = !!(0, util_1.originalOrCamelOptions)(options).get('universe_domain');\n if (!usingExplicitUniverseDomain) {\n // override the default universe with the source's universe\n this.universeDomain = this.sourceClient.universeDomain;\n }\n else if (this.sourceClient.universeDomain !== this.universeDomain) {\n // non-default universe and is not matching the source - this could be a credential leak\n throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);\n }\n this.endpoint =\n (_f = options.endpoint) !== null && _f !== void 0 ? _f : `https://iamcredentials.${this.universeDomain}`;\n }\n /**\n * Signs some bytes.\n *\n * {@link https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/signBlob Reference Documentation}\n * @param blobToSign String to sign.\n *\n * @returns A {@link SignBlobResponse} denoting the keyID and signedBlob in base64 string\n */\n async sign(blobToSign) {\n await this.sourceClient.getAccessToken();\n const name = `projects/-/serviceAccounts/${this.targetPrincipal}`;\n const u = `${this.endpoint}/v1/${name}:signBlob`;\n const body = {\n delegates: this.delegates,\n payload: Buffer.from(blobToSign).toString('base64'),\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n return res.data;\n }\n /** The service account email to be impersonated. */\n getTargetPrincipal() {\n return this.targetPrincipal;\n }\n /**\n * Refreshes the access token.\n */\n async refreshToken() {\n var _a, _b, _c, _d, _e, _f;\n try {\n await this.sourceClient.getAccessToken();\n const name = 'projects/-/serviceAccounts/' + this.targetPrincipal;\n const u = `${this.endpoint}/v1/${name}:generateAccessToken`;\n const body = {\n delegates: this.delegates,\n scope: this.targetScopes,\n lifetime: this.lifetime + 's',\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n const tokenResponse = res.data;\n this.credentials.access_token = tokenResponse.accessToken;\n this.credentials.expiry_date = Date.parse(tokenResponse.expireTime);\n return {\n tokens: this.credentials,\n res,\n };\n }\n catch (error) {\n if (!(error instanceof Error))\n throw error;\n let status = 0;\n let message = '';\n if (error instanceof gaxios_1.GaxiosError) {\n status = (_c = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c.status;\n message = (_f = (_e = (_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) === null || _f === void 0 ? void 0 : _f.message;\n }\n if (status && message) {\n error.message = `${status}: unable to impersonate: ${message}`;\n throw error;\n }\n else {\n error.message = `unable to impersonate: ${error}`;\n throw error;\n }\n }\n }\n /**\n * Generates an OpenID Connect ID token for a service account.\n *\n * {@link https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/generateIdToken Reference Documentation}\n *\n * @param targetAudience the audience for the fetched ID token.\n * @param options the for the request\n * @return an OpenID Connect ID token\n */\n async fetchIdToken(targetAudience, options) {\n var _a, _b;\n await this.sourceClient.getAccessToken();\n const name = `projects/-/serviceAccounts/${this.targetPrincipal}`;\n const u = `${this.endpoint}/v1/${name}:generateIdToken`;\n const body = {\n delegates: this.delegates,\n audience: targetAudience,\n includeEmail: (_a = options === null || options === void 0 ? void 0 : options.includeEmail) !== null && _a !== void 0 ? _a : true,\n useEmailAzp: (_b = options === null || options === void 0 ? void 0 : options.includeEmail) !== null && _b !== void 0 ? _b : true,\n };\n const res = await this.sourceClient.request({\n ...Impersonated.RETRY_CONFIG,\n url: u,\n data: body,\n method: 'POST',\n });\n return res.data.token;\n }\n}\nexports.Impersonated = Impersonated;\n", - "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OAuthClientAuthHandler = void 0;\nexports.getErrorFromOAuthErrorResponse = getErrorFromOAuthErrorResponse;\nconst querystring = require(\"querystring\");\nconst crypto_1 = require(\"../crypto/crypto\");\n/** List of HTTP methods that accept request bodies. */\nconst METHODS_SUPPORTING_REQUEST_BODY = ['PUT', 'POST', 'PATCH'];\n/**\n * Abstract class for handling client authentication in OAuth-based\n * operations.\n * When request-body client authentication is used, only application/json and\n * application/x-www-form-urlencoded content types for HTTP methods that support\n * request bodies are supported.\n */\nclass OAuthClientAuthHandler {\n /**\n * Instantiates an OAuth client authentication handler.\n * @param clientAuthentication The client auth credentials.\n */\n constructor(clientAuthentication) {\n this.clientAuthentication = clientAuthentication;\n this.crypto = (0, crypto_1.createCrypto)();\n }\n /**\n * Applies client authentication on the OAuth request's headers or POST\n * body but does not process the request.\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n * @param bearerToken The optional bearer token to use for authentication.\n * When this is used, no client authentication credentials are needed.\n */\n applyClientAuthenticationOptions(opts, bearerToken) {\n // Inject authenticated header.\n this.injectAuthenticatedHeaders(opts, bearerToken);\n // Inject authenticated request body.\n if (!bearerToken) {\n this.injectAuthenticatedRequestBody(opts);\n }\n }\n /**\n * Applies client authentication on the request's header if either\n * basic authentication or bearer token authentication is selected.\n *\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n * @param bearerToken The optional bearer token to use for authentication.\n * When this is used, no client authentication credentials are needed.\n */\n injectAuthenticatedHeaders(opts, bearerToken) {\n var _a;\n // Bearer token prioritized higher than basic Auth.\n if (bearerToken) {\n opts.headers = opts.headers || {};\n Object.assign(opts.headers, {\n Authorization: `Bearer ${bearerToken}}`,\n });\n }\n else if (((_a = this.clientAuthentication) === null || _a === void 0 ? void 0 : _a.confidentialClientType) === 'basic') {\n opts.headers = opts.headers || {};\n const clientId = this.clientAuthentication.clientId;\n const clientSecret = this.clientAuthentication.clientSecret || '';\n const base64EncodedCreds = this.crypto.encodeBase64StringUtf8(`${clientId}:${clientSecret}`);\n Object.assign(opts.headers, {\n Authorization: `Basic ${base64EncodedCreds}`,\n });\n }\n }\n /**\n * Applies client authentication on the request's body if request-body\n * client authentication is selected.\n *\n * @param opts The GaxiosOptions whose headers or data are to be modified\n * depending on the client authentication mechanism to be used.\n */\n injectAuthenticatedRequestBody(opts) {\n var _a;\n if (((_a = this.clientAuthentication) === null || _a === void 0 ? void 0 : _a.confidentialClientType) === 'request-body') {\n const method = (opts.method || 'GET').toUpperCase();\n // Inject authenticated request body.\n if (METHODS_SUPPORTING_REQUEST_BODY.indexOf(method) !== -1) {\n // Get content-type.\n let contentType;\n const headers = opts.headers || {};\n for (const key in headers) {\n if (key.toLowerCase() === 'content-type' && headers[key]) {\n contentType = headers[key].toLowerCase();\n break;\n }\n }\n if (contentType === 'application/x-www-form-urlencoded') {\n opts.data = opts.data || '';\n const data = querystring.parse(opts.data);\n Object.assign(data, {\n client_id: this.clientAuthentication.clientId,\n client_secret: this.clientAuthentication.clientSecret || '',\n });\n opts.data = querystring.stringify(data);\n }\n else if (contentType === 'application/json') {\n opts.data = opts.data || {};\n Object.assign(opts.data, {\n client_id: this.clientAuthentication.clientId,\n client_secret: this.clientAuthentication.clientSecret || '',\n });\n }\n else {\n throw new Error(`${contentType} content-types are not supported with ` +\n `${this.clientAuthentication.confidentialClientType} ` +\n 'client authentication');\n }\n }\n else {\n throw new Error(`${method} HTTP method does not support ` +\n `${this.clientAuthentication.confidentialClientType} ` +\n 'client authentication');\n }\n }\n }\n /**\n * Retry config for Auth-related requests.\n *\n * @remarks\n *\n * This is not a part of the default {@link AuthClient.transporter transporter/gaxios}\n * config as some downstream APIs would prefer if customers explicitly enable retries,\n * such as GCS.\n */\n static get RETRY_CONFIG() {\n return {\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['GET', 'PUT', 'POST', 'HEAD', 'OPTIONS', 'DELETE'],\n },\n };\n }\n}\nexports.OAuthClientAuthHandler = OAuthClientAuthHandler;\n/**\n * Converts an OAuth error response to a native JavaScript Error.\n * @param resp The OAuth error response to convert to a native Error object.\n * @param err The optional original error. If provided, the error properties\n * will be copied to the new error.\n * @return The converted native Error object.\n */\nfunction getErrorFromOAuthErrorResponse(resp, err) {\n // Error response.\n const errorCode = resp.error;\n const errorDescription = resp.error_description;\n const errorUri = resp.error_uri;\n let message = `Error code ${errorCode}`;\n if (typeof errorDescription !== 'undefined') {\n message += `: ${errorDescription}`;\n }\n if (typeof errorUri !== 'undefined') {\n message += ` - ${errorUri}`;\n }\n const newError = new Error(message);\n // Copy properties from original error to newly generated error.\n if (err) {\n const keys = Object.keys(err);\n if (err.stack) {\n // Copy error.stack if available.\n keys.push('stack');\n }\n keys.forEach(key => {\n // Do not overwrite the message field.\n if (key !== 'message') {\n Object.defineProperty(newError, key, {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: err[key],\n writable: false,\n enumerable: true,\n });\n }\n });\n }\n return newError;\n}\n", - "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StsCredentials = void 0;\nconst gaxios_1 = require(\"gaxios\");\nconst querystring = require(\"querystring\");\nconst transporters_1 = require(\"../transporters\");\nconst oauth2common_1 = require(\"./oauth2common\");\n/**\n * Implements the OAuth 2.0 token exchange based on\n * https://tools.ietf.org/html/rfc8693\n */\nclass StsCredentials extends oauth2common_1.OAuthClientAuthHandler {\n /**\n * Initializes an STS credentials instance.\n * @param tokenExchangeEndpoint The token exchange endpoint.\n * @param clientAuthentication The client authentication credentials if\n * available.\n */\n constructor(tokenExchangeEndpoint, clientAuthentication) {\n super(clientAuthentication);\n this.tokenExchangeEndpoint = tokenExchangeEndpoint;\n this.transporter = new transporters_1.DefaultTransporter();\n }\n /**\n * Exchanges the provided token for another type of token based on the\n * rfc8693 spec.\n * @param stsCredentialsOptions The token exchange options used to populate\n * the token exchange request.\n * @param additionalHeaders Optional additional headers to pass along the\n * request.\n * @param options Optional additional GCP-specific non-spec defined options\n * to send with the request.\n * Example: `&options=${encodeUriComponent(JSON.stringified(options))}`\n * @return A promise that resolves with the token exchange response containing\n * the requested token and its expiration time.\n */\n async exchangeToken(stsCredentialsOptions, additionalHeaders, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n options) {\n var _a, _b, _c;\n const values = {\n grant_type: stsCredentialsOptions.grantType,\n resource: stsCredentialsOptions.resource,\n audience: stsCredentialsOptions.audience,\n scope: (_a = stsCredentialsOptions.scope) === null || _a === void 0 ? void 0 : _a.join(' '),\n requested_token_type: stsCredentialsOptions.requestedTokenType,\n subject_token: stsCredentialsOptions.subjectToken,\n subject_token_type: stsCredentialsOptions.subjectTokenType,\n actor_token: (_b = stsCredentialsOptions.actingParty) === null || _b === void 0 ? void 0 : _b.actorToken,\n actor_token_type: (_c = stsCredentialsOptions.actingParty) === null || _c === void 0 ? void 0 : _c.actorTokenType,\n // Non-standard GCP-specific options.\n options: options && JSON.stringify(options),\n };\n // Remove undefined fields.\n Object.keys(values).forEach(key => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof values[key] === 'undefined') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delete values[key];\n }\n });\n const headers = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n };\n // Inject additional STS headers if available.\n Object.assign(headers, additionalHeaders || {});\n const opts = {\n ...StsCredentials.RETRY_CONFIG,\n url: this.tokenExchangeEndpoint.toString(),\n method: 'POST',\n headers,\n data: querystring.stringify(values),\n responseType: 'json',\n };\n // Apply OAuth client authentication.\n this.applyClientAuthenticationOptions(opts);\n try {\n const response = await this.transporter.request(opts);\n // Successful response.\n const stsSuccessfulResponse = response.data;\n stsSuccessfulResponse.res = response;\n return stsSuccessfulResponse;\n }\n catch (error) {\n // Translate error to OAuthError.\n if (error instanceof gaxios_1.GaxiosError && error.response) {\n throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error.response.data, \n // Preserve other fields from the original error.\n error);\n }\n // Request could fail before the server responds.\n throw error;\n }\n }\n}\nexports.StsCredentials = StsCredentials;\n", - "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _BaseExternalAccountClient_instances, _BaseExternalAccountClient_pendingAccessToken, _BaseExternalAccountClient_internalRefreshAccessTokenAsync;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseExternalAccountClient = exports.DEFAULT_UNIVERSE = exports.CLOUD_RESOURCE_MANAGER = exports.EXTERNAL_ACCOUNT_TYPE = exports.EXPIRATION_TIME_OFFSET = void 0;\nconst stream = require(\"stream\");\nconst authclient_1 = require(\"./authclient\");\nconst sts = require(\"./stscredentials\");\nconst util_1 = require(\"../util\");\n/**\n * The required token exchange grant_type: rfc8693#section-2.1\n */\nconst STS_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:token-exchange';\n/**\n * The requested token exchange requested_token_type: rfc8693#section-2.1\n */\nconst STS_REQUEST_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/** The default OAuth scope to request when none is provided. */\nconst DEFAULT_OAUTH_SCOPE = 'https://www.googleapis.com/auth/cloud-platform';\n/** Default impersonated token lifespan in seconds.*/\nconst DEFAULT_TOKEN_LIFESPAN = 3600;\n/**\n * Offset to take into account network delays and server clock skews.\n */\nexports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000;\n/**\n * The credentials JSON file type for external account clients.\n * There are 3 types of JSON configs:\n * 1. authorized_user => Google end user credential\n * 2. service_account => Google service account credential\n * 3. external_Account => non-GCP service (eg. AWS, Azure, K8s)\n */\nexports.EXTERNAL_ACCOUNT_TYPE = 'external_account';\n/**\n * Cloud resource manager URL used to retrieve project information.\n *\n * @deprecated use {@link BaseExternalAccountClient.cloudResourceManagerURL} instead\n **/\nexports.CLOUD_RESOURCE_MANAGER = 'https://cloudresourcemanager.googleapis.com/v1/projects/';\n/** The workforce audience pattern. */\nconst WORKFORCE_AUDIENCE_PATTERN = '//iam\\\\.googleapis\\\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+';\nconst DEFAULT_TOKEN_URL = 'https://sts.{universeDomain}/v1/token';\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst pkg = require('../../../package.json');\n/**\n * For backwards compatibility.\n */\nvar authclient_2 = require(\"./authclient\");\nObject.defineProperty(exports, \"DEFAULT_UNIVERSE\", { enumerable: true, get: function () { return authclient_2.DEFAULT_UNIVERSE; } });\n/**\n * Base external account client. This is used to instantiate AuthClients for\n * exchanging external account credentials for GCP access token and authorizing\n * requests to GCP APIs.\n * The base class implements common logic for exchanging various type of\n * external credentials for GCP access token. The logic of determining and\n * retrieving the external credential based on the environment and\n * credential_source will be left for the subclasses.\n */\nclass BaseExternalAccountClient extends authclient_1.AuthClient {\n /**\n * Instantiate a BaseExternalAccountClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file. The camelCased options\n * are aliases for the snake_cased options.\n * @param additionalOptions **DEPRECATED, all options are available in the\n * `options` parameter.** Optional additional behavior customization options.\n * These currently customize expiration threshold time and whether to retry\n * on 401/403 API request errors.\n */\n constructor(options, additionalOptions) {\n var _a;\n super({ ...options, ...additionalOptions });\n _BaseExternalAccountClient_instances.add(this);\n /**\n * A pending access token request. Used for concurrent calls.\n */\n _BaseExternalAccountClient_pendingAccessToken.set(this, null);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const type = opts.get('type');\n if (type && type !== exports.EXTERNAL_ACCOUNT_TYPE) {\n throw new Error(`Expected \"${exports.EXTERNAL_ACCOUNT_TYPE}\" type but ` +\n `received \"${options.type}\"`);\n }\n const clientId = opts.get('client_id');\n const clientSecret = opts.get('client_secret');\n const tokenUrl = (_a = opts.get('token_url')) !== null && _a !== void 0 ? _a : DEFAULT_TOKEN_URL.replace('{universeDomain}', this.universeDomain);\n const subjectTokenType = opts.get('subject_token_type');\n const workforcePoolUserProject = opts.get('workforce_pool_user_project');\n const serviceAccountImpersonationUrl = opts.get('service_account_impersonation_url');\n const serviceAccountImpersonation = opts.get('service_account_impersonation');\n const serviceAccountImpersonationLifetime = (0, util_1.originalOrCamelOptions)(serviceAccountImpersonation).get('token_lifetime_seconds');\n this.cloudResourceManagerURL = new URL(opts.get('cloud_resource_manager_url') ||\n `https://cloudresourcemanager.${this.universeDomain}/v1/projects/`);\n if (clientId) {\n this.clientAuth = {\n confidentialClientType: 'basic',\n clientId,\n clientSecret,\n };\n }\n this.stsCredential = new sts.StsCredentials(tokenUrl, this.clientAuth);\n this.scopes = opts.get('scopes') || [DEFAULT_OAUTH_SCOPE];\n this.cachedAccessToken = null;\n this.audience = opts.get('audience');\n this.subjectTokenType = subjectTokenType;\n this.workforcePoolUserProject = workforcePoolUserProject;\n const workforceAudiencePattern = new RegExp(WORKFORCE_AUDIENCE_PATTERN);\n if (this.workforcePoolUserProject &&\n !this.audience.match(workforceAudiencePattern)) {\n throw new Error('workforcePoolUserProject should not be set for non-workforce pool ' +\n 'credentials.');\n }\n this.serviceAccountImpersonationUrl = serviceAccountImpersonationUrl;\n this.serviceAccountImpersonationLifetime =\n serviceAccountImpersonationLifetime;\n if (this.serviceAccountImpersonationLifetime) {\n this.configLifetimeRequested = true;\n }\n else {\n this.configLifetimeRequested = false;\n this.serviceAccountImpersonationLifetime = DEFAULT_TOKEN_LIFESPAN;\n }\n this.projectNumber = this.getProjectNumber(this.audience);\n this.supplierContext = {\n audience: this.audience,\n subjectTokenType: this.subjectTokenType,\n transporter: this.transporter,\n };\n }\n /** The service account email to be impersonated, if available. */\n getServiceAccountEmail() {\n var _a;\n if (this.serviceAccountImpersonationUrl) {\n if (this.serviceAccountImpersonationUrl.length > 256) {\n /**\n * Prevents DOS attacks.\n * @see {@link https://github.com/googleapis/google-auth-library-nodejs/security/code-scanning/84}\n **/\n throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);\n }\n // Parse email from URL. The formal looks as follows:\n // https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/name@project-id.iam.gserviceaccount.com:generateAccessToken\n const re = /serviceAccounts\\/(?[^:]+):generateAccessToken$/;\n const result = re.exec(this.serviceAccountImpersonationUrl);\n return ((_a = result === null || result === void 0 ? void 0 : result.groups) === null || _a === void 0 ? void 0 : _a.email) || null;\n }\n return null;\n }\n /**\n * Provides a mechanism to inject GCP access tokens directly.\n * When the provided credential expires, a new credential, using the\n * external account options, is retrieved.\n * @param credentials The Credentials object to set on the current client.\n */\n setCredentials(credentials) {\n super.setCredentials(credentials);\n this.cachedAccessToken = credentials;\n }\n /**\n * @return A promise that resolves with the current GCP access token\n * response. If the current credential is expired, a new one is retrieved.\n */\n async getAccessToken() {\n // If cached access token is unavailable or expired, force refresh.\n if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return GCP access token in GetAccessTokenResponse format.\n return {\n token: this.cachedAccessToken.access_token,\n res: this.cachedAccessToken.res,\n };\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * The result has the form:\n * { Authorization: 'Bearer ' }\n */\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = {\n Authorization: `Bearer ${accessTokenResponse.token}`,\n };\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * @return A promise that resolves with the project ID corresponding to the\n * current workload identity pool or current workforce pool if\n * determinable. For workforce pool credential, it returns the project ID\n * corresponding to the workforcePoolUserProject.\n * This is introduced to match the current pattern of using the Auth\n * library:\n * const projectId = await auth.getProjectId();\n * const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`;\n * const res = await client.request({ url });\n * The resource may not have permission\n * (resourcemanager.projects.get) to call this API or the required\n * scopes may not be selected:\n * https://cloud.google.com/resource-manager/reference/rest/v1/projects/get#authorization-scopes\n */\n async getProjectId() {\n const projectNumber = this.projectNumber || this.workforcePoolUserProject;\n if (this.projectId) {\n // Return previously determined project ID.\n return this.projectId;\n }\n else if (projectNumber) {\n // Preferable not to use request() to avoid retrial policies.\n const headers = await this.getRequestHeaders();\n const response = await this.transporter.request({\n ...BaseExternalAccountClient.RETRY_CONFIG,\n headers,\n url: `${this.cloudResourceManagerURL.toString()}${projectNumber}`,\n responseType: 'json',\n });\n this.projectId = response.data.projectId;\n return this.projectId;\n }\n return null;\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure.\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = opts.headers || {};\n if (requestHeaders && requestHeaders['x-goog-user-project']) {\n opts.headers['x-goog-user-project'] =\n requestHeaders['x-goog-user-project'];\n }\n if (requestHeaders && requestHeaders.Authorization) {\n opts.headers.Authorization = requestHeaders.Authorization;\n }\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * External credentials are exchanged for GCP access tokens via the token\n * exchange endpoint and other settings provided in the client options\n * object.\n * If the service_account_impersonation_url is provided, an additional\n * step to exchange the external account GCP access token for a service\n * account impersonated token is performed.\n * @return A promise that resolves with the fresh GCP access tokens.\n */\n async refreshAccessTokenAsync() {\n // Use an existing access token request, or cache a new one\n __classPrivateFieldSet(this, _BaseExternalAccountClient_pendingAccessToken, __classPrivateFieldGet(this, _BaseExternalAccountClient_pendingAccessToken, \"f\") || __classPrivateFieldGet(this, _BaseExternalAccountClient_instances, \"m\", _BaseExternalAccountClient_internalRefreshAccessTokenAsync).call(this), \"f\");\n try {\n return await __classPrivateFieldGet(this, _BaseExternalAccountClient_pendingAccessToken, \"f\");\n }\n finally {\n // clear pending access token for future requests\n __classPrivateFieldSet(this, _BaseExternalAccountClient_pendingAccessToken, null, \"f\");\n }\n }\n /**\n * Returns the workload identity pool project number if it is determinable\n * from the audience resource name.\n * @param audience The STS audience used to determine the project number.\n * @return The project number associated with the workload identity pool, if\n * this can be determined from the STS audience field. Otherwise, null is\n * returned.\n */\n getProjectNumber(audience) {\n // STS audience pattern:\n // //iam.googleapis.com/projects/$PROJECT_NUMBER/locations/...\n const match = audience.match(/\\/projects\\/([^/]+)/);\n if (!match) {\n return null;\n }\n return match[1];\n }\n /**\n * Exchanges an external account GCP access token for a service\n * account impersonated access token using iamcredentials\n * GenerateAccessToken API.\n * @param token The access token to exchange for a service account access\n * token.\n * @return A promise that resolves with the service account impersonated\n * credentials response.\n */\n async getImpersonatedAccessToken(token) {\n const opts = {\n ...BaseExternalAccountClient.RETRY_CONFIG,\n url: this.serviceAccountImpersonationUrl,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${token}`,\n },\n data: {\n scope: this.getScopesArray(),\n lifetime: this.serviceAccountImpersonationLifetime + 's',\n },\n responseType: 'json',\n };\n const response = await this.transporter.request(opts);\n const successResponse = response.data;\n return {\n access_token: successResponse.accessToken,\n // Convert from ISO format to timestamp.\n expiry_date: new Date(successResponse.expireTime).getTime(),\n res: response,\n };\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param accessToken The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(accessToken) {\n const now = new Date().getTime();\n return accessToken.expiry_date\n ? now >= accessToken.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n /**\n * @return The list of scopes for the requested GCP access token.\n */\n getScopesArray() {\n // Since scopes can be provided as string or array, the type should\n // be normalized.\n if (typeof this.scopes === 'string') {\n return [this.scopes];\n }\n return this.scopes || [DEFAULT_OAUTH_SCOPE];\n }\n getMetricsHeaderValue() {\n const nodeVersion = process.version.replace(/^v/, '');\n const saImpersonation = this.serviceAccountImpersonationUrl !== undefined;\n const credentialSourceType = this.credentialSourceType\n ? this.credentialSourceType\n : 'unknown';\n return `gl-node/${nodeVersion} auth/${pkg.version} google-byoid-sdk source/${credentialSourceType} sa-impersonation/${saImpersonation} config-lifetime/${this.configLifetimeRequested}`;\n }\n}\nexports.BaseExternalAccountClient = BaseExternalAccountClient;\n_BaseExternalAccountClient_pendingAccessToken = new WeakMap(), _BaseExternalAccountClient_instances = new WeakSet(), _BaseExternalAccountClient_internalRefreshAccessTokenAsync = async function _BaseExternalAccountClient_internalRefreshAccessTokenAsync() {\n // Retrieve the external credential.\n const subjectToken = await this.retrieveSubjectToken();\n // Construct the STS credentials options.\n const stsCredentialsOptions = {\n grantType: STS_GRANT_TYPE,\n audience: this.audience,\n requestedTokenType: STS_REQUEST_TOKEN_TYPE,\n subjectToken,\n subjectTokenType: this.subjectTokenType,\n // generateAccessToken requires the provided access token to have\n // scopes:\n // https://www.googleapis.com/auth/iam or\n // https://www.googleapis.com/auth/cloud-platform\n // The new service account access token scopes will match the user\n // provided ones.\n scope: this.serviceAccountImpersonationUrl\n ? [DEFAULT_OAUTH_SCOPE]\n : this.getScopesArray(),\n };\n // Exchange the external credentials for a GCP access token.\n // Client auth is prioritized over passing the workforcePoolUserProject\n // parameter for STS token exchange.\n const additionalOptions = !this.clientAuth && this.workforcePoolUserProject\n ? { userProject: this.workforcePoolUserProject }\n : undefined;\n const additionalHeaders = {\n 'x-goog-api-client': this.getMetricsHeaderValue(),\n };\n const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, additionalHeaders, additionalOptions);\n if (this.serviceAccountImpersonationUrl) {\n this.cachedAccessToken = await this.getImpersonatedAccessToken(stsResponse.access_token);\n }\n else if (stsResponse.expires_in) {\n // Save response in cached access token.\n this.cachedAccessToken = {\n access_token: stsResponse.access_token,\n expiry_date: new Date().getTime() + stsResponse.expires_in * 1000,\n res: stsResponse.res,\n };\n }\n else {\n // Save response in cached access token.\n this.cachedAccessToken = {\n access_token: stsResponse.access_token,\n res: stsResponse.res,\n };\n }\n // Save credentials.\n this.credentials = {};\n Object.assign(this.credentials, this.cachedAccessToken);\n delete this.credentials.res;\n // Trigger tokens event to notify external listeners.\n this.emit('tokens', {\n refresh_token: null,\n expiry_date: this.cachedAccessToken.expiry_date,\n access_token: this.cachedAccessToken.access_token,\n token_type: 'Bearer',\n id_token: null,\n });\n // Return the cached access token.\n return this.cachedAccessToken;\n};\n", - "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar _a, _b, _c;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileSubjectTokenSupplier = void 0;\nconst util_1 = require(\"util\");\nconst fs = require(\"fs\");\n// fs.readfile is undefined in browser karma tests causing\n// `npm run browser-test` to fail as test.oauth2.ts imports this file via\n// src/index.ts.\n// Fallback to void function to avoid promisify throwing a TypeError.\nconst readFile = (0, util_1.promisify)((_a = fs.readFile) !== null && _a !== void 0 ? _a : (() => { }));\nconst realpath = (0, util_1.promisify)((_b = fs.realpath) !== null && _b !== void 0 ? _b : (() => { }));\nconst lstat = (0, util_1.promisify)((_c = fs.lstat) !== null && _c !== void 0 ? _c : (() => { }));\n/**\n * Internal subject token supplier implementation used when a file location\n * is configured in the credential configuration used to build an {@link IdentityPoolClient}\n */\nclass FileSubjectTokenSupplier {\n /**\n * Instantiates a new file based subject token supplier.\n * @param opts The file subject token supplier options to build the supplier\n * with.\n */\n constructor(opts) {\n this.filePath = opts.filePath;\n this.formatType = opts.formatType;\n this.subjectTokenFieldName = opts.subjectTokenFieldName;\n }\n /**\n * Returns the subject token stored at the file specified in the constructor.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link IdentityPoolClient}, contains the requested audience and subject\n * token type for the external account identity. Not used.\n */\n async getSubjectToken(context) {\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n let parsedFilePath = this.filePath;\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n parsedFilePath = await realpath(parsedFilePath);\n if (!(await lstat(parsedFilePath)).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `The file at ${parsedFilePath} does not exist, or it is not a file. ${err.message}`;\n }\n throw err;\n }\n let subjectToken;\n const rawText = await readFile(parsedFilePath, { encoding: 'utf8' });\n if (this.formatType === 'text') {\n subjectToken = rawText;\n }\n else if (this.formatType === 'json' && this.subjectTokenFieldName) {\n const json = JSON.parse(rawText);\n subjectToken = json[this.subjectTokenFieldName];\n }\n if (!subjectToken) {\n throw new Error('Unable to parse the subject_token from the credential_source file');\n }\n return subjectToken;\n }\n}\nexports.FileSubjectTokenSupplier = FileSubjectTokenSupplier;\n", - "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UrlSubjectTokenSupplier = void 0;\n/**\n * Internal subject token supplier implementation used when a URL\n * is configured in the credential configuration used to build an {@link IdentityPoolClient}\n */\nclass UrlSubjectTokenSupplier {\n /**\n * Instantiates a URL subject token supplier.\n * @param opts The URL subject token supplier options to build the supplier with.\n */\n constructor(opts) {\n this.url = opts.url;\n this.formatType = opts.formatType;\n this.subjectTokenFieldName = opts.subjectTokenFieldName;\n this.headers = opts.headers;\n this.additionalGaxiosOptions = opts.additionalGaxiosOptions;\n }\n /**\n * Sends a GET request to the URL provided in the constructor and resolves\n * with the returned external subject token.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link IdentityPoolClient}, contains the requested audience and subject\n * token type for the external account identity. Not used.\n */\n async getSubjectToken(context) {\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.url,\n method: 'GET',\n headers: this.headers,\n responseType: this.formatType,\n };\n let subjectToken;\n if (this.formatType === 'text') {\n const response = await context.transporter.request(opts);\n subjectToken = response.data;\n }\n else if (this.formatType === 'json' && this.subjectTokenFieldName) {\n const response = await context.transporter.request(opts);\n subjectToken = response.data[this.subjectTokenFieldName];\n }\n if (!subjectToken) {\n throw new Error('Unable to parse the subject_token from the credential_source URL');\n }\n return subjectToken;\n }\n}\nexports.UrlSubjectTokenSupplier = UrlSubjectTokenSupplier;\n", - "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IdentityPoolClient = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst util_1 = require(\"../util\");\nconst filesubjecttokensupplier_1 = require(\"./filesubjecttokensupplier\");\nconst urlsubjecttokensupplier_1 = require(\"./urlsubjecttokensupplier\");\n/**\n * Defines the Url-sourced and file-sourced external account clients mainly\n * used for K8s and Azure workloads.\n */\nclass IdentityPoolClient extends baseexternalclient_1.BaseExternalAccountClient {\n /**\n * Instantiate an IdentityPoolClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid file-sourced or\n * url-sourced credential or a workforce pool user project is provided\n * with a non workforce audience.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file. The camelCased options\n * are aliases for the snake_cased options.\n * @param additionalOptions **DEPRECATED, all options are available in the\n * `options` parameter.** Optional additional behavior customization options.\n * These currently customize expiration threshold time and whether to retry\n * on 401/403 API request errors.\n */\n constructor(options, additionalOptions) {\n super(options, additionalOptions);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const credentialSource = opts.get('credential_source');\n const subjectTokenSupplier = opts.get('subject_token_supplier');\n // Validate credential sourcing configuration.\n if (!credentialSource && !subjectTokenSupplier) {\n throw new Error('A credential source or subject token supplier must be specified.');\n }\n if (credentialSource && subjectTokenSupplier) {\n throw new Error('Only one of credential source or subject token supplier can be specified.');\n }\n if (subjectTokenSupplier) {\n this.subjectTokenSupplier = subjectTokenSupplier;\n this.credentialSourceType = 'programmatic';\n }\n else {\n const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource);\n const formatOpts = (0, util_1.originalOrCamelOptions)(credentialSourceOpts.get('format'));\n // Text is the default format type.\n const formatType = formatOpts.get('type') || 'text';\n const formatSubjectTokenFieldName = formatOpts.get('subject_token_field_name');\n if (formatType !== 'json' && formatType !== 'text') {\n throw new Error(`Invalid credential_source format \"${formatType}\"`);\n }\n if (formatType === 'json' && !formatSubjectTokenFieldName) {\n throw new Error('Missing subject_token_field_name for JSON credential_source format');\n }\n const file = credentialSourceOpts.get('file');\n const url = credentialSourceOpts.get('url');\n const headers = credentialSourceOpts.get('headers');\n if (file && url) {\n throw new Error('No valid Identity Pool \"credential_source\" provided, must be either file or url.');\n }\n else if (file && !url) {\n this.credentialSourceType = 'file';\n this.subjectTokenSupplier = new filesubjecttokensupplier_1.FileSubjectTokenSupplier({\n filePath: file,\n formatType: formatType,\n subjectTokenFieldName: formatSubjectTokenFieldName,\n });\n }\n else if (!file && url) {\n this.credentialSourceType = 'url';\n this.subjectTokenSupplier = new urlsubjecttokensupplier_1.UrlSubjectTokenSupplier({\n url: url,\n formatType: formatType,\n subjectTokenFieldName: formatSubjectTokenFieldName,\n headers: headers,\n additionalGaxiosOptions: IdentityPoolClient.RETRY_CONFIG,\n });\n }\n else {\n throw new Error('No valid Identity Pool \"credential_source\" provided, must be either file or url.');\n }\n }\n }\n /**\n * Triggered when a external subject token is needed to be exchanged for a GCP\n * access token via GCP STS endpoint. Gets a subject token by calling\n * the configured {@link SubjectTokenSupplier}\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n return this.subjectTokenSupplier.getSubjectToken(this.supplierContext);\n }\n}\nexports.IdentityPoolClient = IdentityPoolClient;\n", - "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AwsRequestSigner = void 0;\nconst crypto_1 = require(\"../crypto/crypto\");\n/** AWS Signature Version 4 signing algorithm identifier. */\nconst AWS_ALGORITHM = 'AWS4-HMAC-SHA256';\n/**\n * The termination string for the AWS credential scope value as defined in\n * https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n */\nconst AWS_REQUEST_TYPE = 'aws4_request';\n/**\n * Implements an AWS API request signer based on the AWS Signature Version 4\n * signing process.\n * https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nclass AwsRequestSigner {\n /**\n * Instantiates an AWS API request signer used to send authenticated signed\n * requests to AWS APIs based on the AWS Signature Version 4 signing process.\n * This also provides a mechanism to generate the signed request without\n * sending it.\n * @param getCredentials A mechanism to retrieve AWS security credentials\n * when needed.\n * @param region The AWS region to use.\n */\n constructor(getCredentials, region) {\n this.getCredentials = getCredentials;\n this.region = region;\n this.crypto = (0, crypto_1.createCrypto)();\n }\n /**\n * Generates the signed request for the provided HTTP request for calling\n * an AWS API. This follows the steps described at:\n * https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html\n * @param amzOptions The AWS request options that need to be signed.\n * @return A promise that resolves with the GaxiosOptions containing the\n * signed HTTP request parameters.\n */\n async getRequestOptions(amzOptions) {\n if (!amzOptions.url) {\n throw new Error('\"url\" is required in \"amzOptions\"');\n }\n // Stringify JSON requests. This will be set in the request body of the\n // generated signed request.\n const requestPayloadData = typeof amzOptions.data === 'object'\n ? JSON.stringify(amzOptions.data)\n : amzOptions.data;\n const url = amzOptions.url;\n const method = amzOptions.method || 'GET';\n const requestPayload = amzOptions.body || requestPayloadData;\n const additionalAmzHeaders = amzOptions.headers;\n const awsSecurityCredentials = await this.getCredentials();\n const uri = new URL(url);\n const headerMap = await generateAuthenticationHeaderMap({\n crypto: this.crypto,\n host: uri.host,\n canonicalUri: uri.pathname,\n canonicalQuerystring: uri.search.substr(1),\n method,\n region: this.region,\n securityCredentials: awsSecurityCredentials,\n requestPayload,\n additionalAmzHeaders,\n });\n // Append additional optional headers, eg. X-Amz-Target, Content-Type, etc.\n const headers = Object.assign(\n // Add x-amz-date if available.\n headerMap.amzDate ? { 'x-amz-date': headerMap.amzDate } : {}, {\n Authorization: headerMap.authorizationHeader,\n host: uri.host,\n }, additionalAmzHeaders || {});\n if (awsSecurityCredentials.token) {\n Object.assign(headers, {\n 'x-amz-security-token': awsSecurityCredentials.token,\n });\n }\n const awsSignedReq = {\n url,\n method: method,\n headers,\n };\n if (typeof requestPayload !== 'undefined') {\n awsSignedReq.body = requestPayload;\n }\n return awsSignedReq;\n }\n}\nexports.AwsRequestSigner = AwsRequestSigner;\n/**\n * Creates the HMAC-SHA256 hash of the provided message using the\n * provided key.\n *\n * @param crypto The crypto instance used to facilitate cryptographic\n * operations.\n * @param key The HMAC-SHA256 key to use.\n * @param msg The message to hash.\n * @return The computed hash bytes.\n */\nasync function sign(crypto, key, msg) {\n return await crypto.signWithHmacSha256(key, msg);\n}\n/**\n * Calculates the signing key used to calculate the signature for\n * AWS Signature Version 4 based on:\n * https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param crypto The crypto instance used to facilitate cryptographic\n * operations.\n * @param key The AWS secret access key.\n * @param dateStamp The '%Y%m%d' date format.\n * @param region The AWS region.\n * @param serviceName The AWS service name, eg. sts.\n * @return The signing key bytes.\n */\nasync function getSigningKey(crypto, key, dateStamp, region, serviceName) {\n const kDate = await sign(crypto, `AWS4${key}`, dateStamp);\n const kRegion = await sign(crypto, kDate, region);\n const kService = await sign(crypto, kRegion, serviceName);\n const kSigning = await sign(crypto, kService, 'aws4_request');\n return kSigning;\n}\n/**\n * Generates the authentication header map needed for generating the AWS\n * Signature Version 4 signed request.\n *\n * @param option The options needed to compute the authentication header map.\n * @return The AWS authentication header map which constitutes of the following\n * components: amz-date, authorization header and canonical query string.\n */\nasync function generateAuthenticationHeaderMap(options) {\n const additionalAmzHeaders = options.additionalAmzHeaders || {};\n const requestPayload = options.requestPayload || '';\n // iam.amazonaws.com host => iam service.\n // sts.us-east-2.amazonaws.com => sts service.\n const serviceName = options.host.split('.')[0];\n const now = new Date();\n // Format: '%Y%m%dT%H%M%SZ'.\n const amzDate = now\n .toISOString()\n .replace(/[-:]/g, '')\n .replace(/\\.[0-9]+/, '');\n // Format: '%Y%m%d'.\n const dateStamp = now.toISOString().replace(/[-]/g, '').replace(/T.*/, '');\n // Change all additional headers to be lower case.\n const reformattedAdditionalAmzHeaders = {};\n Object.keys(additionalAmzHeaders).forEach(key => {\n reformattedAdditionalAmzHeaders[key.toLowerCase()] =\n additionalAmzHeaders[key];\n });\n // Add AWS token if available.\n if (options.securityCredentials.token) {\n reformattedAdditionalAmzHeaders['x-amz-security-token'] =\n options.securityCredentials.token;\n }\n // Header keys need to be sorted alphabetically.\n const amzHeaders = Object.assign({\n host: options.host,\n }, \n // Previously the date was not fixed with x-amz- and could be provided manually.\n // https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-header-value-trim.req\n reformattedAdditionalAmzHeaders.date ? {} : { 'x-amz-date': amzDate }, reformattedAdditionalAmzHeaders);\n let canonicalHeaders = '';\n const signedHeadersList = Object.keys(amzHeaders).sort();\n signedHeadersList.forEach(key => {\n canonicalHeaders += `${key}:${amzHeaders[key]}\\n`;\n });\n const signedHeaders = signedHeadersList.join(';');\n const payloadHash = await options.crypto.sha256DigestHex(requestPayload);\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n const canonicalRequest = `${options.method}\\n` +\n `${options.canonicalUri}\\n` +\n `${options.canonicalQuerystring}\\n` +\n `${canonicalHeaders}\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`;\n const credentialScope = `${dateStamp}/${options.region}/${serviceName}/${AWS_REQUEST_TYPE}`;\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n const stringToSign = `${AWS_ALGORITHM}\\n` +\n `${amzDate}\\n` +\n `${credentialScope}\\n` +\n (await options.crypto.sha256DigestHex(canonicalRequest));\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n const signingKey = await getSigningKey(options.crypto, options.securityCredentials.secretAccessKey, dateStamp, options.region, serviceName);\n const signature = await sign(options.crypto, signingKey, stringToSign);\n // https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n const authorizationHeader = `${AWS_ALGORITHM} Credential=${options.securityCredentials.accessKeyId}/` +\n `${credentialScope}, SignedHeaders=${signedHeaders}, ` +\n `Signature=${(0, crypto_1.fromArrayBufferToHex)(signature)}`;\n return {\n // Do not return x-amz-date if date is available.\n amzDate: reformattedAdditionalAmzHeaders.date ? undefined : amzDate,\n authorizationHeader,\n canonicalQuerystring: options.canonicalQuerystring,\n };\n}\n", - "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _DefaultAwsSecurityCredentialsSupplier_instances, _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken, _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName, _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials, _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get, _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultAwsSecurityCredentialsSupplier = void 0;\n/**\n * Internal AWS security credentials supplier implementation used by {@link AwsClient}\n * when a credential source is provided instead of a user defined supplier.\n * The logic is summarized as:\n * 1. If imdsv2_session_token_url is provided in the credential source, then\n * fetch the aws session token and include it in the headers of the\n * metadata requests. This is a requirement for IDMSv2 but optional\n * for IDMSv1.\n * 2. Retrieve AWS region from availability-zone.\n * 3a. Check AWS credentials in environment variables. If not found, get\n * from security-credentials endpoint.\n * 3b. Get AWS credentials from security-credentials endpoint. In order\n * to retrieve this, the AWS role needs to be determined by calling\n * security-credentials endpoint without any argument. Then the\n * credentials can be retrieved via: security-credentials/role_name\n * 4. Generate the signed request to AWS STS GetCallerIdentity action.\n * 5. Inject x-goog-cloud-target-resource into header and serialize the\n * signed request. This will be the subject-token to pass to GCP STS.\n */\nclass DefaultAwsSecurityCredentialsSupplier {\n /**\n * Instantiates a new DefaultAwsSecurityCredentialsSupplier using information\n * from the credential_source stored in the ADC file.\n * @param opts The default aws security credentials supplier options object to\n * build the supplier with.\n */\n constructor(opts) {\n _DefaultAwsSecurityCredentialsSupplier_instances.add(this);\n this.regionUrl = opts.regionUrl;\n this.securityCredentialsUrl = opts.securityCredentialsUrl;\n this.imdsV2SessionTokenUrl = opts.imdsV2SessionTokenUrl;\n this.additionalGaxiosOptions = opts.additionalGaxiosOptions;\n }\n /**\n * Returns the active AWS region. This first checks to see if the region\n * is available as an environment variable. If it is not, then the supplier\n * will call the region URL.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link AwsClient}, contains the requested audience and subject token type\n * for the external account identity.\n * @return A promise that resolves with the AWS region string.\n */\n async getAwsRegion(context) {\n // Priority order for region determination:\n // AWS_REGION > AWS_DEFAULT_REGION > metadata server.\n if (__classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"a\", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get)) {\n return __classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"a\", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get);\n }\n const metadataHeaders = {};\n if (!__classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"a\", _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get) && this.imdsV2SessionTokenUrl) {\n metadataHeaders['x-aws-ec2-metadata-token'] =\n await __classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"m\", _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken).call(this, context.transporter);\n }\n if (!this.regionUrl) {\n throw new Error('Unable to determine AWS region due to missing ' +\n '\"options.credential_source.region_url\"');\n }\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.regionUrl,\n method: 'GET',\n responseType: 'text',\n headers: metadataHeaders,\n };\n const response = await context.transporter.request(opts);\n // Remove last character. For example, if us-east-2b is returned,\n // the region would be us-east-2.\n return response.data.substr(0, response.data.length - 1);\n }\n /**\n * Returns AWS security credentials. This first checks to see if the credentials\n * is available as environment variables. If it is not, then the supplier\n * will call the security credentials URL.\n * @param context {@link ExternalAccountSupplierContext} from the calling\n * {@link AwsClient}, contains the requested audience and subject token type\n * for the external account identity.\n * @return A promise that resolves with the AWS security credentials.\n */\n async getAwsSecurityCredentials(context) {\n // Check environment variables for permanent credentials first.\n // https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html\n if (__classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"a\", _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get)) {\n return __classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"a\", _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get);\n }\n const metadataHeaders = {};\n if (this.imdsV2SessionTokenUrl) {\n metadataHeaders['x-aws-ec2-metadata-token'] =\n await __classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"m\", _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken).call(this, context.transporter);\n }\n // Since the role on a VM can change, we don't need to cache it.\n const roleName = await __classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"m\", _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName).call(this, metadataHeaders, context.transporter);\n // Temporary credentials typically last for several hours.\n // Expiration is returned in response.\n // Consider future optimization of this logic to cache AWS tokens\n // until their natural expiration.\n const awsCreds = await __classPrivateFieldGet(this, _DefaultAwsSecurityCredentialsSupplier_instances, \"m\", _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials).call(this, roleName, metadataHeaders, context.transporter);\n return {\n accessKeyId: awsCreds.AccessKeyId,\n secretAccessKey: awsCreds.SecretAccessKey,\n token: awsCreds.Token,\n };\n }\n}\nexports.DefaultAwsSecurityCredentialsSupplier = DefaultAwsSecurityCredentialsSupplier;\n_DefaultAwsSecurityCredentialsSupplier_instances = new WeakSet(), _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken = \n/**\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the IMDSv2 Session Token.\n */\nasync function _DefaultAwsSecurityCredentialsSupplier_getImdsV2SessionToken(transporter) {\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.imdsV2SessionTokenUrl,\n method: 'PUT',\n responseType: 'text',\n headers: { 'x-aws-ec2-metadata-token-ttl-seconds': '300' },\n };\n const response = await transporter.request(opts);\n return response.data;\n}, _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName = \n/**\n * @param headers The headers to be used in the metadata request.\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the assigned role to the current\n * AWS VM. This is needed for calling the security-credentials endpoint.\n */\nasync function _DefaultAwsSecurityCredentialsSupplier_getAwsRoleName(headers, transporter) {\n if (!this.securityCredentialsUrl) {\n throw new Error('Unable to determine AWS role name due to missing ' +\n '\"options.credential_source.url\"');\n }\n const opts = {\n ...this.additionalGaxiosOptions,\n url: this.securityCredentialsUrl,\n method: 'GET',\n responseType: 'text',\n headers: headers,\n };\n const response = await transporter.request(opts);\n return response.data;\n}, _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials = \n/**\n * Retrieves the temporary AWS credentials by calling the security-credentials\n * endpoint as specified in the `credential_source` object.\n * @param roleName The role attached to the current VM.\n * @param headers The headers to be used in the metadata request.\n * @param transporter The transporter to use for requests.\n * @return A promise that resolves with the temporary AWS credentials\n * needed for creating the GetCallerIdentity signed request.\n */\nasync function _DefaultAwsSecurityCredentialsSupplier_retrieveAwsSecurityCredentials(roleName, headers, transporter) {\n const response = await transporter.request({\n ...this.additionalGaxiosOptions,\n url: `${this.securityCredentialsUrl}/${roleName}`,\n responseType: 'json',\n headers: headers,\n });\n return response.data;\n}, _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get = function _DefaultAwsSecurityCredentialsSupplier_regionFromEnv_get() {\n // The AWS region can be provided through AWS_REGION or AWS_DEFAULT_REGION.\n // Only one is required.\n return (process.env['AWS_REGION'] || process.env['AWS_DEFAULT_REGION'] || null);\n}, _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get = function _DefaultAwsSecurityCredentialsSupplier_securityCredentialsFromEnv_get() {\n // Both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are required.\n if (process.env['AWS_ACCESS_KEY_ID'] &&\n process.env['AWS_SECRET_ACCESS_KEY']) {\n return {\n accessKeyId: process.env['AWS_ACCESS_KEY_ID'],\n secretAccessKey: process.env['AWS_SECRET_ACCESS_KEY'],\n token: process.env['AWS_SESSION_TOKEN'],\n };\n }\n return null;\n};\n", - "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _a, _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AwsClient = void 0;\nconst awsrequestsigner_1 = require(\"./awsrequestsigner\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst defaultawssecuritycredentialssupplier_1 = require(\"./defaultawssecuritycredentialssupplier\");\nconst util_1 = require(\"../util\");\n/**\n * AWS external account client. This is used for AWS workloads, where\n * AWS STS GetCallerIdentity serialized signed requests are exchanged for\n * GCP access token.\n */\nclass AwsClient extends baseexternalclient_1.BaseExternalAccountClient {\n /**\n * Instantiates an AwsClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid AWS credential.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file.\n * @param additionalOptions **DEPRECATED, all options are available in the\n * `options` parameter.** Optional additional behavior customization options.\n * These currently customize expiration threshold time and whether to retry\n * on 401/403 API request errors.\n */\n constructor(options, additionalOptions) {\n super(options, additionalOptions);\n const opts = (0, util_1.originalOrCamelOptions)(options);\n const credentialSource = opts.get('credential_source');\n const awsSecurityCredentialsSupplier = opts.get('aws_security_credentials_supplier');\n // Validate credential sourcing configuration.\n if (!credentialSource && !awsSecurityCredentialsSupplier) {\n throw new Error('A credential source or AWS security credentials supplier must be specified.');\n }\n if (credentialSource && awsSecurityCredentialsSupplier) {\n throw new Error('Only one of credential source or AWS security credentials supplier can be specified.');\n }\n if (awsSecurityCredentialsSupplier) {\n this.awsSecurityCredentialsSupplier = awsSecurityCredentialsSupplier;\n this.regionalCredVerificationUrl =\n __classPrivateFieldGet(_a, _a, \"f\", _AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL);\n this.credentialSourceType = 'programmatic';\n }\n else {\n const credentialSourceOpts = (0, util_1.originalOrCamelOptions)(credentialSource);\n this.environmentId = credentialSourceOpts.get('environment_id');\n // This is only required if the AWS region is not available in the\n // AWS_REGION or AWS_DEFAULT_REGION environment variables.\n const regionUrl = credentialSourceOpts.get('region_url');\n // This is only required if AWS security credentials are not available in\n // environment variables.\n const securityCredentialsUrl = credentialSourceOpts.get('url');\n const imdsV2SessionTokenUrl = credentialSourceOpts.get('imdsv2_session_token_url');\n this.awsSecurityCredentialsSupplier =\n new defaultawssecuritycredentialssupplier_1.DefaultAwsSecurityCredentialsSupplier({\n regionUrl: regionUrl,\n securityCredentialsUrl: securityCredentialsUrl,\n imdsV2SessionTokenUrl: imdsV2SessionTokenUrl,\n });\n this.regionalCredVerificationUrl = credentialSourceOpts.get('regional_cred_verification_url');\n this.credentialSourceType = 'aws';\n // Data validators.\n this.validateEnvironmentId();\n }\n this.awsRequestSigner = null;\n this.region = '';\n }\n validateEnvironmentId() {\n var _b;\n const match = (_b = this.environmentId) === null || _b === void 0 ? void 0 : _b.match(/^(aws)(\\d+)$/);\n if (!match || !this.regionalCredVerificationUrl) {\n throw new Error('No valid AWS \"credential_source\" provided');\n }\n else if (parseInt(match[2], 10) !== 1) {\n throw new Error(`aws version \"${match[2]}\" is not supported in the current build.`);\n }\n }\n /**\n * Triggered when an external subject token is needed to be exchanged for a\n * GCP access token via GCP STS endpoint. This will call the\n * {@link AwsSecurityCredentialsSupplier} to retrieve an AWS region and AWS\n * Security Credentials, then use them to create a signed AWS STS request that\n * can be exchanged for a GCP access token.\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n // Initialize AWS request signer if not already initialized.\n if (!this.awsRequestSigner) {\n this.region = await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext);\n this.awsRequestSigner = new awsrequestsigner_1.AwsRequestSigner(async () => {\n return this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext);\n }, this.region);\n }\n // Generate signed request to AWS STS GetCallerIdentity API.\n // Use the required regional endpoint. Otherwise, the request will fail.\n const options = await this.awsRequestSigner.getRequestOptions({\n ..._a.RETRY_CONFIG,\n url: this.regionalCredVerificationUrl.replace('{region}', this.region),\n method: 'POST',\n });\n // The GCP STS endpoint expects the headers to be formatted as:\n // [\n // {key: 'x-amz-date', value: '...'},\n // {key: 'Authorization', value: '...'},\n // ...\n // ]\n // And then serialized as:\n // encodeURIComponent(JSON.stringify({\n // url: '...',\n // method: 'POST',\n // headers: [{key: 'x-amz-date', value: '...'}, ...]\n // }))\n const reformattedHeader = [];\n const extendedHeaders = Object.assign({\n // The full, canonical resource name of the workload identity pool\n // provider, with or without the HTTPS prefix.\n // Including this header as part of the signature is recommended to\n // ensure data integrity.\n 'x-goog-cloud-target-resource': this.audience,\n }, options.headers);\n // Reformat header to GCP STS expected format.\n for (const key in extendedHeaders) {\n reformattedHeader.push({\n key,\n value: extendedHeaders[key],\n });\n }\n // Serialize the reformatted signed request.\n return encodeURIComponent(JSON.stringify({\n url: options.url,\n method: options.method,\n headers: reformattedHeader,\n }));\n }\n}\nexports.AwsClient = AwsClient;\n_a = AwsClient;\n_AwsClient_DEFAULT_AWS_REGIONAL_CREDENTIAL_VERIFICATION_URL = { value: 'https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15' };\n/**\n * @deprecated AWS client no validates the EC2 metadata address.\n **/\nAwsClient.AWS_EC2_METADATA_IPV4_ADDRESS = '169.254.169.254';\n/**\n * @deprecated AWS client no validates the EC2 metadata address.\n **/\nAwsClient.AWS_EC2_METADATA_IPV6_ADDRESS = 'fd00:ec2::254';\n", - "\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InvalidSubjectTokenError = exports.InvalidMessageFieldError = exports.InvalidCodeFieldError = exports.InvalidTokenTypeFieldError = exports.InvalidExpirationTimeFieldError = exports.InvalidSuccessFieldError = exports.InvalidVersionFieldError = exports.ExecutableResponseError = exports.ExecutableResponse = void 0;\nconst SAML_SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:saml2';\nconst OIDC_SUBJECT_TOKEN_TYPE1 = 'urn:ietf:params:oauth:token-type:id_token';\nconst OIDC_SUBJECT_TOKEN_TYPE2 = 'urn:ietf:params:oauth:token-type:jwt';\n/**\n * Defines the response of a 3rd party executable run by the pluggable auth client.\n */\nclass ExecutableResponse {\n /**\n * Instantiates an ExecutableResponse instance using the provided JSON object\n * from the output of the executable.\n * @param responseJson Response from a 3rd party executable, loaded from a\n * run of the executable or a cached output file.\n */\n constructor(responseJson) {\n // Check that the required fields exist in the json response.\n if (!responseJson.version) {\n throw new InvalidVersionFieldError(\"Executable response must contain a 'version' field.\");\n }\n if (responseJson.success === undefined) {\n throw new InvalidSuccessFieldError(\"Executable response must contain a 'success' field.\");\n }\n this.version = responseJson.version;\n this.success = responseJson.success;\n // Validate required fields for a successful response.\n if (this.success) {\n this.expirationTime = responseJson.expiration_time;\n this.tokenType = responseJson.token_type;\n // Validate token type field.\n if (this.tokenType !== SAML_SUBJECT_TOKEN_TYPE &&\n this.tokenType !== OIDC_SUBJECT_TOKEN_TYPE1 &&\n this.tokenType !== OIDC_SUBJECT_TOKEN_TYPE2) {\n throw new InvalidTokenTypeFieldError(\"Executable response must contain a 'token_type' field when successful \" +\n `and it must be one of ${OIDC_SUBJECT_TOKEN_TYPE1}, ${OIDC_SUBJECT_TOKEN_TYPE2}, or ${SAML_SUBJECT_TOKEN_TYPE}.`);\n }\n // Validate subject token.\n if (this.tokenType === SAML_SUBJECT_TOKEN_TYPE) {\n if (!responseJson.saml_response) {\n throw new InvalidSubjectTokenError(`Executable response must contain a 'saml_response' field when token_type=${SAML_SUBJECT_TOKEN_TYPE}.`);\n }\n this.subjectToken = responseJson.saml_response;\n }\n else {\n if (!responseJson.id_token) {\n throw new InvalidSubjectTokenError(\"Executable response must contain a 'id_token' field when \" +\n `token_type=${OIDC_SUBJECT_TOKEN_TYPE1} or ${OIDC_SUBJECT_TOKEN_TYPE2}.`);\n }\n this.subjectToken = responseJson.id_token;\n }\n }\n else {\n // Both code and message must be provided for unsuccessful responses.\n if (!responseJson.code) {\n throw new InvalidCodeFieldError(\"Executable response must contain a 'code' field when unsuccessful.\");\n }\n if (!responseJson.message) {\n throw new InvalidMessageFieldError(\"Executable response must contain a 'message' field when unsuccessful.\");\n }\n this.errorCode = responseJson.code;\n this.errorMessage = responseJson.message;\n }\n }\n /**\n * @return A boolean representing if the response has a valid token. Returns\n * true when the response was successful and the token is not expired.\n */\n isValid() {\n return !this.isExpired() && this.success;\n }\n /**\n * @return A boolean representing if the response is expired. Returns true if the\n * provided timeout has passed.\n */\n isExpired() {\n return (this.expirationTime !== undefined &&\n this.expirationTime < Math.round(Date.now() / 1000));\n }\n}\nexports.ExecutableResponse = ExecutableResponse;\n/**\n * An error thrown by the ExecutableResponse class.\n */\nclass ExecutableResponseError extends Error {\n constructor(message) {\n super(message);\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\nexports.ExecutableResponseError = ExecutableResponseError;\n/**\n * An error thrown when the 'version' field in an executable response is missing or invalid.\n */\nclass InvalidVersionFieldError extends ExecutableResponseError {\n}\nexports.InvalidVersionFieldError = InvalidVersionFieldError;\n/**\n * An error thrown when the 'success' field in an executable response is missing or invalid.\n */\nclass InvalidSuccessFieldError extends ExecutableResponseError {\n}\nexports.InvalidSuccessFieldError = InvalidSuccessFieldError;\n/**\n * An error thrown when the 'expiration_time' field in an executable response is missing or invalid.\n */\nclass InvalidExpirationTimeFieldError extends ExecutableResponseError {\n}\nexports.InvalidExpirationTimeFieldError = InvalidExpirationTimeFieldError;\n/**\n * An error thrown when the 'token_type' field in an executable response is missing or invalid.\n */\nclass InvalidTokenTypeFieldError extends ExecutableResponseError {\n}\nexports.InvalidTokenTypeFieldError = InvalidTokenTypeFieldError;\n/**\n * An error thrown when the 'code' field in an executable response is missing or invalid.\n */\nclass InvalidCodeFieldError extends ExecutableResponseError {\n}\nexports.InvalidCodeFieldError = InvalidCodeFieldError;\n/**\n * An error thrown when the 'message' field in an executable response is missing or invalid.\n */\nclass InvalidMessageFieldError extends ExecutableResponseError {\n}\nexports.InvalidMessageFieldError = InvalidMessageFieldError;\n/**\n * An error thrown when the subject token in an executable response is missing or invalid.\n */\nclass InvalidSubjectTokenError extends ExecutableResponseError {\n}\nexports.InvalidSubjectTokenError = InvalidSubjectTokenError;\n", - "\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PluggableAuthHandler = void 0;\nconst pluggable_auth_client_1 = require(\"./pluggable-auth-client\");\nconst executable_response_1 = require(\"./executable-response\");\nconst childProcess = require(\"child_process\");\nconst fs = require(\"fs\");\n/**\n * A handler used to retrieve 3rd party token responses from user defined\n * executables and cached file output for the PluggableAuthClient class.\n */\nclass PluggableAuthHandler {\n /**\n * Instantiates a PluggableAuthHandler instance using the provided\n * PluggableAuthHandlerOptions object.\n */\n constructor(options) {\n if (!options.command) {\n throw new Error('No command provided.');\n }\n this.commandComponents = PluggableAuthHandler.parseCommand(options.command);\n this.timeoutMillis = options.timeoutMillis;\n if (!this.timeoutMillis) {\n throw new Error('No timeoutMillis provided.');\n }\n this.outputFile = options.outputFile;\n }\n /**\n * Calls user provided executable to get a 3rd party subject token and\n * returns the response.\n * @param envMap a Map of additional Environment Variables required for\n * the executable.\n * @return A promise that resolves with the executable response.\n */\n retrieveResponseFromExecutable(envMap) {\n return new Promise((resolve, reject) => {\n // Spawn process to run executable using added environment variables.\n const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {\n env: { ...process.env, ...Object.fromEntries(envMap) },\n });\n let output = '';\n // Append stdout to output as executable runs.\n child.stdout.on('data', (data) => {\n output += data;\n });\n // Append stderr as executable runs.\n child.stderr.on('data', (err) => {\n output += err;\n });\n // Set up a timeout to end the child process and throw an error.\n const timeout = setTimeout(() => {\n // Kill child process and remove listeners so 'close' event doesn't get\n // read after child process is killed.\n child.removeAllListeners();\n child.kill();\n return reject(new Error('The executable failed to finish within the timeout specified.'));\n }, this.timeoutMillis);\n child.on('close', (code) => {\n // Cancel timeout if executable closes before timeout is reached.\n clearTimeout(timeout);\n if (code === 0) {\n // If the executable completed successfully, try to return the parsed response.\n try {\n const responseJson = JSON.parse(output);\n const response = new executable_response_1.ExecutableResponse(responseJson);\n return resolve(response);\n }\n catch (error) {\n if (error instanceof executable_response_1.ExecutableResponseError) {\n return reject(error);\n }\n return reject(new executable_response_1.ExecutableResponseError(`The executable returned an invalid response: ${output}`));\n }\n }\n else {\n return reject(new pluggable_auth_client_1.ExecutableError(output, code.toString()));\n }\n });\n });\n }\n /**\n * Checks user provided output file for response from previous run of\n * executable and return the response if it exists, is formatted correctly, and is not expired.\n */\n async retrieveCachedResponse() {\n if (!this.outputFile || this.outputFile.length === 0) {\n return undefined;\n }\n let filePath;\n try {\n filePath = await fs.promises.realpath(this.outputFile);\n }\n catch (_a) {\n // If file path cannot be resolved, return undefined.\n return undefined;\n }\n if (!(await fs.promises.lstat(filePath)).isFile()) {\n // If path does not lead to file, return undefined.\n return undefined;\n }\n const responseString = await fs.promises.readFile(filePath, {\n encoding: 'utf8',\n });\n if (responseString === '') {\n return undefined;\n }\n try {\n const responseJson = JSON.parse(responseString);\n const response = new executable_response_1.ExecutableResponse(responseJson);\n // Check if response is successful and unexpired.\n if (response.isValid()) {\n return new executable_response_1.ExecutableResponse(responseJson);\n }\n return undefined;\n }\n catch (error) {\n if (error instanceof executable_response_1.ExecutableResponseError) {\n throw error;\n }\n throw new executable_response_1.ExecutableResponseError(`The output file contained an invalid response: ${responseString}`);\n }\n }\n /**\n * Parses given command string into component array, splitting on spaces unless\n * spaces are between quotation marks.\n */\n static parseCommand(command) {\n // Split the command into components by splitting on spaces,\n // unless spaces are contained in quotation marks.\n const components = command.match(/(?:[^\\s\"]+|\"[^\"]*\")+/g);\n if (!components) {\n throw new Error(`Provided command: \"${command}\" could not be parsed.`);\n }\n // Remove quotation marks from the beginning and end of each component if they are present.\n for (let i = 0; i < components.length; i++) {\n if (components[i][0] === '\"' && components[i].slice(-1) === '\"') {\n components[i] = components[i].slice(1, -1);\n }\n }\n return components;\n }\n}\nexports.PluggableAuthHandler = PluggableAuthHandler;\n", - "\"use strict\";\n// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PluggableAuthClient = exports.ExecutableError = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst executable_response_1 = require(\"./executable-response\");\nconst pluggable_auth_handler_1 = require(\"./pluggable-auth-handler\");\n/**\n * Error thrown from the executable run by PluggableAuthClient.\n */\nclass ExecutableError extends Error {\n constructor(message, code) {\n super(`The executable failed with exit code: ${code} and error message: ${message}.`);\n this.code = code;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\nexports.ExecutableError = ExecutableError;\n/**\n * The default executable timeout when none is provided, in milliseconds.\n */\nconst DEFAULT_EXECUTABLE_TIMEOUT_MILLIS = 30 * 1000;\n/**\n * The minimum allowed executable timeout in milliseconds.\n */\nconst MINIMUM_EXECUTABLE_TIMEOUT_MILLIS = 5 * 1000;\n/**\n * The maximum allowed executable timeout in milliseconds.\n */\nconst MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS = 120 * 1000;\n/**\n * The environment variable to check to see if executable can be run.\n * Value must be set to '1' for the executable to run.\n */\nconst GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES = 'GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES';\n/**\n * The maximum currently supported executable version.\n */\nconst MAXIMUM_EXECUTABLE_VERSION = 1;\n/**\n * PluggableAuthClient enables the exchange of workload identity pool external credentials for\n * Google access tokens by retrieving 3rd party tokens through a user supplied executable. These\n * scripts/executables are completely independent of the Google Cloud Auth libraries. These\n * credentials plug into ADC and will call the specified executable to retrieve the 3rd party token\n * to be exchanged for a Google access token.\n *\n *

To use these credentials, the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment variable\n * must be set to '1'. This is for security reasons.\n *\n *

Both OIDC and SAML are supported. The executable must adhere to a specific response format\n * defined below.\n *\n *

The executable must print out the 3rd party token to STDOUT in JSON format. When an\n * output_file is specified in the credential configuration, the executable must also handle writing the\n * JSON response to this file.\n *\n *

\n * OIDC response sample:\n * {\n *   \"version\": 1,\n *   \"success\": true,\n *   \"token_type\": \"urn:ietf:params:oauth:token-type:id_token\",\n *   \"id_token\": \"HEADER.PAYLOAD.SIGNATURE\",\n *   \"expiration_time\": 1620433341\n * }\n *\n * SAML2 response sample:\n * {\n *   \"version\": 1,\n *   \"success\": true,\n *   \"token_type\": \"urn:ietf:params:oauth:token-type:saml2\",\n *   \"saml_response\": \"...\",\n *   \"expiration_time\": 1620433341\n * }\n *\n * Error response sample:\n * {\n *   \"version\": 1,\n *   \"success\": false,\n *   \"code\": \"401\",\n *   \"message\": \"Error message.\"\n * }\n * 
\n *\n *

The \"expiration_time\" field in the JSON response is only required for successful\n * responses when an output file was specified in the credential configuration\n *\n *

The auth libraries will populate certain environment variables that will be accessible by the\n * executable, such as: GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE, GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE,\n * GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE, GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL, and\n * GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE.\n *\n *

Please see this repositories README for a complete executable request/response specification.\n */\nclass PluggableAuthClient extends baseexternalclient_1.BaseExternalAccountClient {\n /**\n * Instantiates a PluggableAuthClient instance using the provided JSON\n * object loaded from an external account credentials file.\n * An error is thrown if the credential is not a valid pluggable auth credential.\n * @param options The external account options object typically loaded from\n * the external account JSON credential file.\n * @param additionalOptions **DEPRECATED, all options are available in the\n * `options` parameter.** Optional additional behavior customization options.\n * These currently customize expiration threshold time and whether to retry\n * on 401/403 API request errors.\n */\n constructor(options, additionalOptions) {\n super(options, additionalOptions);\n if (!options.credential_source.executable) {\n throw new Error('No valid Pluggable Auth \"credential_source\" provided.');\n }\n this.command = options.credential_source.executable.command;\n if (!this.command) {\n throw new Error('No valid Pluggable Auth \"credential_source\" provided.');\n }\n // Check if the provided timeout exists and if it is valid.\n if (options.credential_source.executable.timeout_millis === undefined) {\n this.timeoutMillis = DEFAULT_EXECUTABLE_TIMEOUT_MILLIS;\n }\n else {\n this.timeoutMillis = options.credential_source.executable.timeout_millis;\n if (this.timeoutMillis < MINIMUM_EXECUTABLE_TIMEOUT_MILLIS ||\n this.timeoutMillis > MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS) {\n throw new Error(`Timeout must be between ${MINIMUM_EXECUTABLE_TIMEOUT_MILLIS} and ` +\n `${MAXIMUM_EXECUTABLE_TIMEOUT_MILLIS} milliseconds.`);\n }\n }\n this.outputFile = options.credential_source.executable.output_file;\n this.handler = new pluggable_auth_handler_1.PluggableAuthHandler({\n command: this.command,\n timeoutMillis: this.timeoutMillis,\n outputFile: this.outputFile,\n });\n this.credentialSourceType = 'executable';\n }\n /**\n * Triggered when an external subject token is needed to be exchanged for a\n * GCP access token via GCP STS endpoint.\n * This uses the `options.credential_source` object to figure out how\n * to retrieve the token using the current environment. In this case,\n * this calls a user provided executable which returns the subject token.\n * The logic is summarized as:\n * 1. Validated that the executable is allowed to run. The\n * GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment must be set to\n * 1 for security reasons.\n * 2. If an output file is specified by the user, check the file location\n * for a response. If the file exists and contains a valid response,\n * return the subject token from the file.\n * 3. Call the provided executable and return response.\n * @return A promise that resolves with the external subject token.\n */\n async retrieveSubjectToken() {\n // Check if the executable is allowed to run.\n if (process.env[GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES] !== '1') {\n throw new Error('Pluggable Auth executables need to be explicitly allowed to run by ' +\n 'setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment ' +\n 'Variable to 1.');\n }\n let executableResponse = undefined;\n // Try to get cached executable response from output file.\n if (this.outputFile) {\n executableResponse = await this.handler.retrieveCachedResponse();\n }\n // If no response from output file, call the executable.\n if (!executableResponse) {\n // Set up environment map with required values for the executable.\n const envMap = new Map();\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE', this.audience);\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE', this.subjectTokenType);\n // Always set to 0 because interactive mode is not supported.\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE', '0');\n if (this.outputFile) {\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE', this.outputFile);\n }\n const serviceAccountEmail = this.getServiceAccountEmail();\n if (serviceAccountEmail) {\n envMap.set('GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL', serviceAccountEmail);\n }\n executableResponse =\n await this.handler.retrieveResponseFromExecutable(envMap);\n }\n if (executableResponse.version > MAXIMUM_EXECUTABLE_VERSION) {\n throw new Error(`Version of executable is not currently supported, maximum supported version is ${MAXIMUM_EXECUTABLE_VERSION}.`);\n }\n // Check that response was successful.\n if (!executableResponse.success) {\n throw new ExecutableError(executableResponse.errorMessage, executableResponse.errorCode);\n }\n // Check that response contains expiration time if output file was specified.\n if (this.outputFile) {\n if (!executableResponse.expirationTime) {\n throw new executable_response_1.InvalidExpirationTimeFieldError('The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.');\n }\n }\n // Check that response is not expired.\n if (executableResponse.isExpired()) {\n throw new Error('Executable response is expired.');\n }\n // Return subject token from response.\n return executableResponse.subjectToken;\n }\n}\nexports.PluggableAuthClient = PluggableAuthClient;\n", - "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExternalAccountClient = void 0;\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst identitypoolclient_1 = require(\"./identitypoolclient\");\nconst awsclient_1 = require(\"./awsclient\");\nconst pluggable_auth_client_1 = require(\"./pluggable-auth-client\");\n/**\n * Dummy class with no constructor. Developers are expected to use fromJSON.\n */\nclass ExternalAccountClient {\n constructor() {\n throw new Error('ExternalAccountClients should be initialized via: ' +\n 'ExternalAccountClient.fromJSON(), ' +\n 'directly via explicit constructors, eg. ' +\n 'new AwsClient(options), new IdentityPoolClient(options), new' +\n 'PluggableAuthClientOptions, or via ' +\n 'new GoogleAuth(options).getClient()');\n }\n /**\n * This static method will instantiate the\n * corresponding type of external account credential depending on the\n * underlying credential source.\n * @param options The external account options object typically loaded\n * from the external account JSON credential file.\n * @param additionalOptions **DEPRECATED, all options are available in the\n * `options` parameter.** Optional additional behavior customization options.\n * These currently customize expiration threshold time and whether to retry\n * on 401/403 API request errors.\n * @return A BaseExternalAccountClient instance or null if the options\n * provided do not correspond to an external account credential.\n */\n static fromJSON(options, additionalOptions) {\n var _a, _b;\n if (options && options.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n if ((_a = options.credential_source) === null || _a === void 0 ? void 0 : _a.environment_id) {\n return new awsclient_1.AwsClient(options, additionalOptions);\n }\n else if ((_b = options.credential_source) === null || _b === void 0 ? void 0 : _b.executable) {\n return new pluggable_auth_client_1.PluggableAuthClient(options, additionalOptions);\n }\n else {\n return new identitypoolclient_1.IdentityPoolClient(options, additionalOptions);\n }\n }\n else {\n return null;\n }\n }\n}\nexports.ExternalAccountClient = ExternalAccountClient;\n", - "\"use strict\";\n// Copyright 2023 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExternalAccountAuthorizedUserClient = exports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = void 0;\nconst authclient_1 = require(\"./authclient\");\nconst oauth2common_1 = require(\"./oauth2common\");\nconst gaxios_1 = require(\"gaxios\");\nconst stream = require(\"stream\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\n/**\n * The credentials JSON file type for external account authorized user clients.\n */\nexports.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE = 'external_account_authorized_user';\nconst DEFAULT_TOKEN_URL = 'https://sts.{universeDomain}/v1/oauthtoken';\n/**\n * Handler for token refresh requests sent to the token_url endpoint for external\n * authorized user credentials.\n */\nclass ExternalAccountAuthorizedUserHandler extends oauth2common_1.OAuthClientAuthHandler {\n /**\n * Initializes an ExternalAccountAuthorizedUserHandler instance.\n * @param url The URL of the token refresh endpoint.\n * @param transporter The transporter to use for the refresh request.\n * @param clientAuthentication The client authentication credentials to use\n * for the refresh request.\n */\n constructor(url, transporter, clientAuthentication) {\n super(clientAuthentication);\n this.url = url;\n this.transporter = transporter;\n }\n /**\n * Requests a new access token from the token_url endpoint using the provided\n * refresh token.\n * @param refreshToken The refresh token to use to generate a new access token.\n * @param additionalHeaders Optional additional headers to pass along the\n * request.\n * @return A promise that resolves with the token refresh response containing\n * the requested access token and its expiration time.\n */\n async refreshToken(refreshToken, additionalHeaders) {\n const values = new URLSearchParams({\n grant_type: 'refresh_token',\n refresh_token: refreshToken,\n });\n const headers = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n ...additionalHeaders,\n };\n const opts = {\n ...ExternalAccountAuthorizedUserHandler.RETRY_CONFIG,\n url: this.url,\n method: 'POST',\n headers,\n data: values.toString(),\n responseType: 'json',\n };\n // Apply OAuth client authentication.\n this.applyClientAuthenticationOptions(opts);\n try {\n const response = await this.transporter.request(opts);\n // Successful response.\n const tokenRefreshResponse = response.data;\n tokenRefreshResponse.res = response;\n return tokenRefreshResponse;\n }\n catch (error) {\n // Translate error to OAuthError.\n if (error instanceof gaxios_1.GaxiosError && error.response) {\n throw (0, oauth2common_1.getErrorFromOAuthErrorResponse)(error.response.data, \n // Preserve other fields from the original error.\n error);\n }\n // Request could fail before the server responds.\n throw error;\n }\n }\n}\n/**\n * External Account Authorized User Client. This is used for OAuth2 credentials\n * sourced using external identities through Workforce Identity Federation.\n * Obtaining the initial access and refresh token can be done through the\n * Google Cloud CLI.\n */\nclass ExternalAccountAuthorizedUserClient extends authclient_1.AuthClient {\n /**\n * Instantiates an ExternalAccountAuthorizedUserClient instances using the\n * provided JSON object loaded from a credentials files.\n * An error is throws if the credential is not valid.\n * @param options The external account authorized user option object typically\n * from the external accoutn authorized user JSON credential file.\n * @param additionalOptions **DEPRECATED, all options are available in the\n * `options` parameter.** Optional additional behavior customization options.\n * These currently customize expiration threshold time and whether to retry\n * on 401/403 API request errors.\n */\n constructor(options, additionalOptions) {\n var _a;\n super({ ...options, ...additionalOptions });\n if (options.universe_domain) {\n this.universeDomain = options.universe_domain;\n }\n this.refreshToken = options.refresh_token;\n const clientAuth = {\n confidentialClientType: 'basic',\n clientId: options.client_id,\n clientSecret: options.client_secret,\n };\n this.externalAccountAuthorizedUserHandler =\n new ExternalAccountAuthorizedUserHandler((_a = options.token_url) !== null && _a !== void 0 ? _a : DEFAULT_TOKEN_URL.replace('{universeDomain}', this.universeDomain), this.transporter, clientAuth);\n this.cachedAccessToken = null;\n this.quotaProjectId = options.quota_project_id;\n // As threshold could be zero,\n // eagerRefreshThresholdMillis || EXPIRATION_TIME_OFFSET will override the\n // zero value.\n if (typeof (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.eagerRefreshThresholdMillis) !== 'number') {\n this.eagerRefreshThresholdMillis = baseexternalclient_1.EXPIRATION_TIME_OFFSET;\n }\n else {\n this.eagerRefreshThresholdMillis = additionalOptions\n .eagerRefreshThresholdMillis;\n }\n this.forceRefreshOnFailure = !!(additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.forceRefreshOnFailure);\n }\n async getAccessToken() {\n // If cached access token is unavailable or expired, force refresh.\n if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return GCP access token in GetAccessTokenResponse format.\n return {\n token: this.cachedAccessToken.access_token,\n res: this.cachedAccessToken.res,\n };\n }\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = {\n Authorization: `Bearer ${accessTokenResponse.token}`,\n };\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure.\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = opts.headers || {};\n if (requestHeaders && requestHeaders['x-goog-user-project']) {\n opts.headers['x-goog-user-project'] =\n requestHeaders['x-goog-user-project'];\n }\n if (requestHeaders && requestHeaders.Authorization) {\n opts.headers.Authorization = requestHeaders.Authorization;\n }\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * @return A promise that resolves with the refreshed credential.\n */\n async refreshAccessTokenAsync() {\n // Refresh the access token using the refresh token.\n const refreshResponse = await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);\n this.cachedAccessToken = {\n access_token: refreshResponse.access_token,\n expiry_date: new Date().getTime() + refreshResponse.expires_in * 1000,\n res: refreshResponse.res,\n };\n if (refreshResponse.refresh_token !== undefined) {\n this.refreshToken = refreshResponse.refresh_token;\n }\n return this.cachedAccessToken;\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param credentials The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(credentials) {\n const now = new Date().getTime();\n return credentials.expiry_date\n ? now >= credentials.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.ExternalAccountAuthorizedUserClient = ExternalAccountAuthorizedUserClient;\n", - "\"use strict\";\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _GoogleAuth_instances, _GoogleAuth_pendingAuthClient, _GoogleAuth_prepareAndCacheClient, _GoogleAuth_determineClient;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleAuth = exports.GoogleAuthExceptionMessages = exports.CLOUD_SDK_CLIENT_ID = void 0;\nconst child_process_1 = require(\"child_process\");\nconst fs = require(\"fs\");\nconst gcpMetadata = require(\"gcp-metadata\");\nconst os = require(\"os\");\nconst path = require(\"path\");\nconst crypto_1 = require(\"../crypto/crypto\");\nconst transporters_1 = require(\"../transporters\");\nconst computeclient_1 = require(\"./computeclient\");\nconst idtokenclient_1 = require(\"./idtokenclient\");\nconst envDetect_1 = require(\"./envDetect\");\nconst jwtclient_1 = require(\"./jwtclient\");\nconst refreshclient_1 = require(\"./refreshclient\");\nconst impersonated_1 = require(\"./impersonated\");\nconst externalclient_1 = require(\"./externalclient\");\nconst baseexternalclient_1 = require(\"./baseexternalclient\");\nconst authclient_1 = require(\"./authclient\");\nconst externalAccountAuthorizedUserClient_1 = require(\"./externalAccountAuthorizedUserClient\");\nconst util_1 = require(\"../util\");\nexports.CLOUD_SDK_CLIENT_ID = '764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com';\nexports.GoogleAuthExceptionMessages = {\n API_KEY_WITH_CREDENTIALS: 'API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.',\n NO_PROJECT_ID_FOUND: 'Unable to detect a Project Id in the current environment. \\n' +\n 'To learn more about authentication and Google APIs, visit: \\n' +\n 'https://cloud.google.com/docs/authentication/getting-started',\n NO_CREDENTIALS_FOUND: 'Unable to find credentials in current environment. \\n' +\n 'To learn more about authentication and Google APIs, visit: \\n' +\n 'https://cloud.google.com/docs/authentication/getting-started',\n NO_ADC_FOUND: 'Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.',\n NO_UNIVERSE_DOMAIN_FOUND: 'Unable to detect a Universe Domain in the current environment.\\n' +\n 'To learn more about Universe Domain retrieval, visit: \\n' +\n 'https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys',\n};\nclass GoogleAuth {\n // Note: this properly is only public to satisfy unit tests.\n // https://github.com/Microsoft/TypeScript/issues/5228\n get isGCE() {\n return this.checkIsGCE;\n }\n /**\n * Configuration is resolved in the following order of precedence:\n * - {@link GoogleAuthOptions.credentials `credentials`}\n * - {@link GoogleAuthOptions.keyFilename `keyFilename`}\n * - {@link GoogleAuthOptions.keyFile `keyFile`}\n *\n * {@link GoogleAuthOptions.clientOptions `clientOptions`} are passed to the\n * {@link AuthClient `AuthClient`s}.\n *\n * @param opts\n */\n constructor(opts = {}) {\n _GoogleAuth_instances.add(this);\n /**\n * Caches a value indicating whether the auth layer is running on Google\n * Compute Engine.\n * @private\n */\n this.checkIsGCE = undefined;\n // To save the contents of the JSON credential file\n this.jsonContent = null;\n this.cachedCredential = null;\n /**\n * A pending {@link AuthClient}. Used for concurrent {@link GoogleAuth.getClient} calls.\n */\n _GoogleAuth_pendingAuthClient.set(this, null);\n this.clientOptions = {};\n this._cachedProjectId = opts.projectId || null;\n this.cachedCredential = opts.authClient || null;\n this.keyFilename = opts.keyFilename || opts.keyFile;\n this.scopes = opts.scopes;\n this.clientOptions = opts.clientOptions || {};\n this.jsonContent = opts.credentials || null;\n this.apiKey = opts.apiKey || this.clientOptions.apiKey || null;\n // Cannot use both API Key + Credentials\n if (this.apiKey && (this.jsonContent || this.clientOptions.credentials)) {\n throw new RangeError(exports.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);\n }\n if (opts.universeDomain) {\n this.clientOptions.universeDomain = opts.universeDomain;\n }\n }\n // GAPIC client libraries should always use self-signed JWTs. The following\n // variables are set on the JWT client in order to indicate the type of library,\n // and sign the JWT with the correct audience and scopes (if not supplied).\n setGapicJWTValues(client) {\n client.defaultServicePath = this.defaultServicePath;\n client.useJWTAccessWithScope = this.useJWTAccessWithScope;\n client.defaultScopes = this.defaultScopes;\n }\n getProjectId(callback) {\n if (callback) {\n this.getProjectIdAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.getProjectIdAsync();\n }\n }\n /**\n * A temporary method for internal `getProjectId` usages where `null` is\n * acceptable. In a future major release, `getProjectId` should return `null`\n * (as the `Promise` base signature describes) and this private\n * method should be removed.\n *\n * @returns Promise that resolves with project id (or `null`)\n */\n async getProjectIdOptional() {\n try {\n return await this.getProjectId();\n }\n catch (e) {\n if (e instanceof Error &&\n e.message === exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND) {\n return null;\n }\n else {\n throw e;\n }\n }\n }\n /**\n * A private method for finding and caching a projectId.\n *\n * Supports environments in order of precedence:\n * - GCLOUD_PROJECT or GOOGLE_CLOUD_PROJECT environment variable\n * - GOOGLE_APPLICATION_CREDENTIALS JSON file\n * - Cloud SDK: `gcloud config config-helper --format json`\n * - GCE project ID from metadata server\n *\n * @returns projectId\n */\n async findAndCacheProjectId() {\n let projectId = null;\n projectId || (projectId = await this.getProductionProjectId());\n projectId || (projectId = await this.getFileProjectId());\n projectId || (projectId = await this.getDefaultServiceProjectId());\n projectId || (projectId = await this.getGCEProjectId());\n projectId || (projectId = await this.getExternalAccountClientProjectId());\n if (projectId) {\n this._cachedProjectId = projectId;\n return projectId;\n }\n else {\n throw new Error(exports.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND);\n }\n }\n async getProjectIdAsync() {\n if (this._cachedProjectId) {\n return this._cachedProjectId;\n }\n if (!this._findProjectIdPromise) {\n this._findProjectIdPromise = this.findAndCacheProjectId();\n }\n return this._findProjectIdPromise;\n }\n /**\n * Retrieves a universe domain from the metadata server via\n * {@link gcpMetadata.universe}.\n *\n * @returns a universe domain\n */\n async getUniverseDomainFromMetadataServer() {\n var _a;\n let universeDomain;\n try {\n universeDomain = await gcpMetadata.universe('universe-domain');\n universeDomain || (universeDomain = authclient_1.DEFAULT_UNIVERSE);\n }\n catch (e) {\n if (e && ((_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {\n universeDomain = authclient_1.DEFAULT_UNIVERSE;\n }\n else {\n throw e;\n }\n }\n return universeDomain;\n }\n /**\n * Retrieves, caches, and returns the universe domain in the following order\n * of precedence:\n * - The universe domain in {@link GoogleAuth.clientOptions}\n * - An existing or ADC {@link AuthClient}'s universe domain\n * - {@link gcpMetadata.universe}, if {@link Compute} client\n *\n * @returns The universe domain\n */\n async getUniverseDomain() {\n let universeDomain = (0, util_1.originalOrCamelOptions)(this.clientOptions).get('universe_domain');\n try {\n universeDomain !== null && universeDomain !== void 0 ? universeDomain : (universeDomain = (await this.getClient()).universeDomain);\n }\n catch (_a) {\n // client or ADC is not available\n universeDomain !== null && universeDomain !== void 0 ? universeDomain : (universeDomain = authclient_1.DEFAULT_UNIVERSE);\n }\n return universeDomain;\n }\n /**\n * @returns Any scopes (user-specified or default scopes specified by the\n * client library) that need to be set on the current Auth client.\n */\n getAnyScopes() {\n return this.scopes || this.defaultScopes;\n }\n getApplicationDefault(optionsOrCallback = {}, callback) {\n let options;\n if (typeof optionsOrCallback === 'function') {\n callback = optionsOrCallback;\n }\n else {\n options = optionsOrCallback;\n }\n if (callback) {\n this.getApplicationDefaultAsync(options).then(r => callback(null, r.credential, r.projectId), callback);\n }\n else {\n return this.getApplicationDefaultAsync(options);\n }\n }\n async getApplicationDefaultAsync(options = {}) {\n // If we've already got a cached credential, return it.\n // This will also preserve one's configured quota project, in case they\n // set one directly on the credential previously.\n if (this.cachedCredential) {\n // cache, while preserving existing quota project preferences\n return await __classPrivateFieldGet(this, _GoogleAuth_instances, \"m\", _GoogleAuth_prepareAndCacheClient).call(this, this.cachedCredential, null);\n }\n let credential;\n // Check for the existence of a local environment variable pointing to the\n // location of the credential file. This is typically used in local\n // developer scenarios.\n credential =\n await this._tryGetApplicationCredentialsFromEnvironmentVariable(options);\n if (credential) {\n if (credential instanceof jwtclient_1.JWT) {\n credential.scopes = this.scopes;\n }\n else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) {\n credential.scopes = this.getAnyScopes();\n }\n return await __classPrivateFieldGet(this, _GoogleAuth_instances, \"m\", _GoogleAuth_prepareAndCacheClient).call(this, credential);\n }\n // Look in the well-known credential file location.\n credential =\n await this._tryGetApplicationCredentialsFromWellKnownFile(options);\n if (credential) {\n if (credential instanceof jwtclient_1.JWT) {\n credential.scopes = this.scopes;\n }\n else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) {\n credential.scopes = this.getAnyScopes();\n }\n return await __classPrivateFieldGet(this, _GoogleAuth_instances, \"m\", _GoogleAuth_prepareAndCacheClient).call(this, credential);\n }\n // Determine if we're running on GCE.\n if (await this._checkIsGCE()) {\n options.scopes = this.getAnyScopes();\n return await __classPrivateFieldGet(this, _GoogleAuth_instances, \"m\", _GoogleAuth_prepareAndCacheClient).call(this, new computeclient_1.Compute(options));\n }\n throw new Error(exports.GoogleAuthExceptionMessages.NO_ADC_FOUND);\n }\n /**\n * Determines whether the auth layer is running on Google Compute Engine.\n * Checks for GCP Residency, then fallback to checking if metadata server\n * is available.\n *\n * @returns A promise that resolves with the boolean.\n * @api private\n */\n async _checkIsGCE() {\n if (this.checkIsGCE === undefined) {\n this.checkIsGCE =\n gcpMetadata.getGCPResidency() || (await gcpMetadata.isAvailable());\n }\n return this.checkIsGCE;\n }\n /**\n * Attempts to load default credentials from the environment variable path..\n * @returns Promise that resolves with the OAuth2Client or null.\n * @api private\n */\n async _tryGetApplicationCredentialsFromEnvironmentVariable(options) {\n const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'] ||\n process.env['google_application_credentials'];\n if (!credentialsPath || credentialsPath.length === 0) {\n return null;\n }\n try {\n return this._getApplicationCredentialsFromFilePath(credentialsPath, options);\n }\n catch (e) {\n if (e instanceof Error) {\n e.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`;\n }\n throw e;\n }\n }\n /**\n * Attempts to load default credentials from a well-known file location\n * @return Promise that resolves with the OAuth2Client or null.\n * @api private\n */\n async _tryGetApplicationCredentialsFromWellKnownFile(options) {\n // First, figure out the location of the file, depending upon the OS type.\n let location = null;\n if (this._isWindows()) {\n // Windows\n location = process.env['APPDATA'];\n }\n else {\n // Linux or Mac\n const home = process.env['HOME'];\n if (home) {\n location = path.join(home, '.config');\n }\n }\n // If we found the root path, expand it.\n if (location) {\n location = path.join(location, 'gcloud', 'application_default_credentials.json');\n if (!fs.existsSync(location)) {\n location = null;\n }\n }\n // The file does not exist.\n if (!location) {\n return null;\n }\n // The file seems to exist. Try to use it.\n const client = await this._getApplicationCredentialsFromFilePath(location, options);\n return client;\n }\n /**\n * Attempts to load default credentials from a file at the given path..\n * @param filePath The path to the file to read.\n * @returns Promise that resolves with the OAuth2Client\n * @api private\n */\n async _getApplicationCredentialsFromFilePath(filePath, options = {}) {\n // Make sure the path looks like a string.\n if (!filePath || filePath.length === 0) {\n throw new Error('The file path is invalid.');\n }\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n filePath = fs.realpathSync(filePath);\n if (!fs.lstatSync(filePath).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n if (err instanceof Error) {\n err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`;\n }\n throw err;\n }\n // Now open a read stream on the file, and parse it.\n const readStream = fs.createReadStream(filePath);\n return this.fromStream(readStream, options);\n }\n /**\n * Create a credentials instance using a given impersonated input options.\n * @param json The impersonated input object.\n * @returns JWT or UserRefresh Client with data\n */\n fromImpersonatedJSON(json) {\n var _a, _b, _c, _d;\n if (!json) {\n throw new Error('Must pass in a JSON object containing an impersonated refresh token');\n }\n if (json.type !== impersonated_1.IMPERSONATED_ACCOUNT_TYPE) {\n throw new Error(`The incoming JSON object does not have the \"${impersonated_1.IMPERSONATED_ACCOUNT_TYPE}\" type`);\n }\n if (!json.source_credentials) {\n throw new Error('The incoming JSON object does not contain a source_credentials field');\n }\n if (!json.service_account_impersonation_url) {\n throw new Error('The incoming JSON object does not contain a service_account_impersonation_url field');\n }\n const sourceClient = this.fromJSON(json.source_credentials);\n if (((_a = json.service_account_impersonation_url) === null || _a === void 0 ? void 0 : _a.length) > 256) {\n /**\n * Prevents DOS attacks.\n * @see {@link https://github.com/googleapis/google-auth-library-nodejs/security/code-scanning/85}\n **/\n throw new RangeError(`Target principal is too long: ${json.service_account_impersonation_url}`);\n }\n // Extract service account from service_account_impersonation_url\n const targetPrincipal = (_c = (_b = /(?[^/]+):(generateAccessToken|generateIdToken)$/.exec(json.service_account_impersonation_url)) === null || _b === void 0 ? void 0 : _b.groups) === null || _c === void 0 ? void 0 : _c.target;\n if (!targetPrincipal) {\n throw new RangeError(`Cannot extract target principal from ${json.service_account_impersonation_url}`);\n }\n const targetScopes = (_d = this.getAnyScopes()) !== null && _d !== void 0 ? _d : [];\n return new impersonated_1.Impersonated({\n ...json,\n sourceClient,\n targetPrincipal,\n targetScopes: Array.isArray(targetScopes) ? targetScopes : [targetScopes],\n });\n }\n /**\n * Create a credentials instance using the given input options.\n * This client is not cached.\n *\n * **Important**: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to {@link https://cloud.google.com/docs/authentication/external/externally-sourced-credentials Validate credential configurations from external sources}.\n *\n * @param json The input object.\n * @param options The JWT or UserRefresh options for the client\n * @returns JWT or UserRefresh Client with data\n */\n fromJSON(json, options = {}) {\n let client;\n // user's preferred universe domain\n const preferredUniverseDomain = (0, util_1.originalOrCamelOptions)(options).get('universe_domain');\n if (json.type === refreshclient_1.USER_REFRESH_ACCOUNT_TYPE) {\n client = new refreshclient_1.UserRefreshClient(options);\n client.fromJSON(json);\n }\n else if (json.type === impersonated_1.IMPERSONATED_ACCOUNT_TYPE) {\n client = this.fromImpersonatedJSON(json);\n }\n else if (json.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n client = externalclient_1.ExternalAccountClient.fromJSON(json, options);\n client.scopes = this.getAnyScopes();\n }\n else if (json.type === externalAccountAuthorizedUserClient_1.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE) {\n client = new externalAccountAuthorizedUserClient_1.ExternalAccountAuthorizedUserClient(json, options);\n }\n else {\n options.scopes = this.scopes;\n client = new jwtclient_1.JWT(options);\n this.setGapicJWTValues(client);\n client.fromJSON(json);\n }\n if (preferredUniverseDomain) {\n client.universeDomain = preferredUniverseDomain;\n }\n return client;\n }\n /**\n * Return a JWT or UserRefreshClient from JavaScript object, caching both the\n * object used to instantiate and the client.\n * @param json The input object.\n * @param options The JWT or UserRefresh options for the client\n * @returns JWT or UserRefresh Client with data\n */\n _cacheClientFromJSON(json, options) {\n const client = this.fromJSON(json, options);\n // cache both raw data used to instantiate client and client itself.\n this.jsonContent = json;\n this.cachedCredential = client;\n return client;\n }\n fromStream(inputStream, optionsOrCallback = {}, callback) {\n let options = {};\n if (typeof optionsOrCallback === 'function') {\n callback = optionsOrCallback;\n }\n else {\n options = optionsOrCallback;\n }\n if (callback) {\n this.fromStreamAsync(inputStream, options).then(r => callback(null, r), callback);\n }\n else {\n return this.fromStreamAsync(inputStream, options);\n }\n }\n fromStreamAsync(inputStream, options) {\n return new Promise((resolve, reject) => {\n if (!inputStream) {\n throw new Error('Must pass in a stream containing the Google auth settings.');\n }\n const chunks = [];\n inputStream\n .setEncoding('utf8')\n .on('error', reject)\n .on('data', chunk => chunks.push(chunk))\n .on('end', () => {\n try {\n try {\n const data = JSON.parse(chunks.join(''));\n const r = this._cacheClientFromJSON(data, options);\n return resolve(r);\n }\n catch (err) {\n // If we failed parsing this.keyFileName, assume that it\n // is a PEM or p12 certificate:\n if (!this.keyFilename)\n throw err;\n const client = new jwtclient_1.JWT({\n ...this.clientOptions,\n keyFile: this.keyFilename,\n });\n this.cachedCredential = client;\n this.setGapicJWTValues(client);\n return resolve(client);\n }\n }\n catch (err) {\n return reject(err);\n }\n });\n });\n }\n /**\n * Create a credentials instance using the given API key string.\n * The created client is not cached. In order to create and cache it use the {@link GoogleAuth.getClient `getClient`} method after first providing an {@link GoogleAuth.apiKey `apiKey`}.\n *\n * @param apiKey The API key string\n * @param options An optional options object.\n * @returns A JWT loaded from the key\n */\n fromAPIKey(apiKey, options = {}) {\n return new jwtclient_1.JWT({ ...options, apiKey });\n }\n /**\n * Determines whether the current operating system is Windows.\n * @api private\n */\n _isWindows() {\n const sys = os.platform();\n if (sys && sys.length >= 3) {\n if (sys.substring(0, 3).toLowerCase() === 'win') {\n return true;\n }\n }\n return false;\n }\n /**\n * Run the Google Cloud SDK command that prints the default project ID\n */\n async getDefaultServiceProjectId() {\n return new Promise(resolve => {\n (0, child_process_1.exec)('gcloud config config-helper --format json', (err, stdout) => {\n if (!err && stdout) {\n try {\n const projectId = JSON.parse(stdout).configuration.properties.core.project;\n resolve(projectId);\n return;\n }\n catch (e) {\n // ignore errors\n }\n }\n resolve(null);\n });\n });\n }\n /**\n * Loads the project id from environment variables.\n * @api private\n */\n getProductionProjectId() {\n return (process.env['GCLOUD_PROJECT'] ||\n process.env['GOOGLE_CLOUD_PROJECT'] ||\n process.env['gcloud_project'] ||\n process.env['google_cloud_project']);\n }\n /**\n * Loads the project id from the GOOGLE_APPLICATION_CREDENTIALS json file.\n * @api private\n */\n async getFileProjectId() {\n if (this.cachedCredential) {\n // Try to read the project ID from the cached credentials file\n return this.cachedCredential.projectId;\n }\n // Ensure the projectId is loaded from the keyFile if available.\n if (this.keyFilename) {\n const creds = await this.getClient();\n if (creds && creds.projectId) {\n return creds.projectId;\n }\n }\n // Try to load a credentials file and read its project ID\n const r = await this._tryGetApplicationCredentialsFromEnvironmentVariable();\n if (r) {\n return r.projectId;\n }\n else {\n return null;\n }\n }\n /**\n * Gets the project ID from external account client if available.\n */\n async getExternalAccountClientProjectId() {\n if (!this.jsonContent || this.jsonContent.type !== baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) {\n return null;\n }\n const creds = await this.getClient();\n // Do not suppress the underlying error, as the error could contain helpful\n // information for debugging and fixing. This is especially true for\n // external account creds as in order to get the project ID, the following\n // operations have to succeed:\n // 1. Valid credentials file should be supplied.\n // 2. Ability to retrieve access tokens from STS token exchange API.\n // 3. Ability to exchange for service account impersonated credentials (if\n // enabled).\n // 4. Ability to get project info using the access token from step 2 or 3.\n // Without surfacing the error, it is harder for developers to determine\n // which step went wrong.\n return await creds.getProjectId();\n }\n /**\n * Gets the Compute Engine project ID if it can be inferred.\n */\n async getGCEProjectId() {\n try {\n const r = await gcpMetadata.project('project-id');\n return r;\n }\n catch (e) {\n // Ignore any errors\n return null;\n }\n }\n getCredentials(callback) {\n if (callback) {\n this.getCredentialsAsync().then(r => callback(null, r), callback);\n }\n else {\n return this.getCredentialsAsync();\n }\n }\n async getCredentialsAsync() {\n const client = await this.getClient();\n if (client instanceof impersonated_1.Impersonated) {\n return { client_email: client.getTargetPrincipal() };\n }\n if (client instanceof baseexternalclient_1.BaseExternalAccountClient) {\n const serviceAccountEmail = client.getServiceAccountEmail();\n if (serviceAccountEmail) {\n return {\n client_email: serviceAccountEmail,\n universe_domain: client.universeDomain,\n };\n }\n }\n if (this.jsonContent) {\n return {\n client_email: this.jsonContent.client_email,\n private_key: this.jsonContent.private_key,\n universe_domain: this.jsonContent.universe_domain,\n };\n }\n if (await this._checkIsGCE()) {\n const [client_email, universe_domain] = await Promise.all([\n gcpMetadata.instance('service-accounts/default/email'),\n this.getUniverseDomain(),\n ]);\n return { client_email, universe_domain };\n }\n throw new Error(exports.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND);\n }\n /**\n * Automatically obtain an {@link AuthClient `AuthClient`} based on the\n * provided configuration. If no options were passed, use Application\n * Default Credentials.\n */\n async getClient() {\n if (this.cachedCredential) {\n return this.cachedCredential;\n }\n // Use an existing auth client request, or cache a new one\n __classPrivateFieldSet(this, _GoogleAuth_pendingAuthClient, __classPrivateFieldGet(this, _GoogleAuth_pendingAuthClient, \"f\") || __classPrivateFieldGet(this, _GoogleAuth_instances, \"m\", _GoogleAuth_determineClient).call(this), \"f\");\n try {\n return await __classPrivateFieldGet(this, _GoogleAuth_pendingAuthClient, \"f\");\n }\n finally {\n // reset the pending auth client in case it is changed later\n __classPrivateFieldSet(this, _GoogleAuth_pendingAuthClient, null, \"f\");\n }\n }\n /**\n * Creates a client which will fetch an ID token for authorization.\n * @param targetAudience the audience for the fetched ID token.\n * @returns IdTokenClient for making HTTP calls authenticated with ID tokens.\n */\n async getIdTokenClient(targetAudience) {\n const client = await this.getClient();\n if (!('fetchIdToken' in client)) {\n throw new Error('Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.');\n }\n return new idtokenclient_1.IdTokenClient({ targetAudience, idTokenProvider: client });\n }\n /**\n * Automatically obtain application default credentials, and return\n * an access token for making requests.\n */\n async getAccessToken() {\n const client = await this.getClient();\n return (await client.getAccessToken()).token;\n }\n /**\n * Obtain the HTTP headers that will provide authorization for a given\n * request.\n */\n async getRequestHeaders(url) {\n const client = await this.getClient();\n return client.getRequestHeaders(url);\n }\n /**\n * Obtain credentials for a request, then attach the appropriate headers to\n * the request options.\n * @param opts Axios or Request options on which to attach the headers\n */\n async authorizeRequest(opts) {\n opts = opts || {};\n const url = opts.url || opts.uri;\n const client = await this.getClient();\n const headers = await client.getRequestHeaders(url);\n opts.headers = Object.assign(opts.headers || {}, headers);\n return opts;\n }\n /**\n * Automatically obtain application default credentials, and make an\n * HTTP request using the given options.\n * @param opts Axios request options for the HTTP request.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n async request(opts) {\n const client = await this.getClient();\n return client.request(opts);\n }\n /**\n * Determine the compute environment in which the code is running.\n */\n getEnv() {\n return (0, envDetect_1.getEnv)();\n }\n /**\n * Sign the given data with the current private key, or go out\n * to the IAM API to sign it.\n * @param data The data to be signed.\n * @param endpoint A custom endpoint to use.\n *\n * @example\n * ```\n * sign('data', 'https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/');\n * ```\n */\n async sign(data, endpoint) {\n const client = await this.getClient();\n const universe = await this.getUniverseDomain();\n endpoint =\n endpoint ||\n `https://iamcredentials.${universe}/v1/projects/-/serviceAccounts/`;\n if (client instanceof impersonated_1.Impersonated) {\n const signed = await client.sign(data);\n return signed.signedBlob;\n }\n const crypto = (0, crypto_1.createCrypto)();\n if (client instanceof jwtclient_1.JWT && client.key) {\n const sign = await crypto.sign(client.key, data);\n return sign;\n }\n const creds = await this.getCredentials();\n if (!creds.client_email) {\n throw new Error('Cannot sign data without `client_email`.');\n }\n return this.signBlob(crypto, creds.client_email, data, endpoint);\n }\n async signBlob(crypto, emailOrUniqueId, data, endpoint) {\n const url = new URL(endpoint + `${emailOrUniqueId}:signBlob`);\n const res = await this.request({\n method: 'POST',\n url: url.href,\n data: {\n payload: crypto.encodeBase64StringUtf8(data),\n },\n retry: true,\n retryConfig: {\n httpMethodsToRetry: ['POST'],\n },\n });\n return res.data.signedBlob;\n }\n}\nexports.GoogleAuth = GoogleAuth;\n_GoogleAuth_pendingAuthClient = new WeakMap(), _GoogleAuth_instances = new WeakSet(), _GoogleAuth_prepareAndCacheClient = async function _GoogleAuth_prepareAndCacheClient(credential, quotaProjectIdOverride = process.env['GOOGLE_CLOUD_QUOTA_PROJECT'] || null) {\n const projectId = await this.getProjectIdOptional();\n if (quotaProjectIdOverride) {\n credential.quotaProjectId = quotaProjectIdOverride;\n }\n this.cachedCredential = credential;\n return { credential, projectId };\n}, _GoogleAuth_determineClient = async function _GoogleAuth_determineClient() {\n if (this.jsonContent) {\n return this._cacheClientFromJSON(this.jsonContent, this.clientOptions);\n }\n else if (this.keyFilename) {\n const filePath = path.resolve(this.keyFilename);\n const stream = fs.createReadStream(filePath);\n return await this.fromStreamAsync(stream, this.clientOptions);\n }\n else if (this.apiKey) {\n const client = await this.fromAPIKey(this.apiKey, this.clientOptions);\n client.scopes = this.scopes;\n const { credential } = await __classPrivateFieldGet(this, _GoogleAuth_instances, \"m\", _GoogleAuth_prepareAndCacheClient).call(this, client);\n return credential;\n }\n else {\n const { credential } = await this.getApplicationDefaultAsync(this.clientOptions);\n return credential;\n }\n};\n/**\n * Export DefaultTransporter as a static property of the class.\n */\nGoogleAuth.DefaultTransporter = transporters_1.DefaultTransporter;\n", - "\"use strict\";\n// Copyright 2014 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IAMAuth = void 0;\nclass IAMAuth {\n /**\n * IAM credentials.\n *\n * @param selector the iam authority selector\n * @param token the token\n * @constructor\n */\n constructor(selector, token) {\n this.selector = selector;\n this.token = token;\n this.selector = selector;\n this.token = token;\n }\n /**\n * Acquire the HTTP headers required to make an authenticated request.\n */\n getRequestHeaders() {\n return {\n 'x-goog-iam-authority-selector': this.selector,\n 'x-goog-iam-authorization-token': this.token,\n };\n }\n}\nexports.IAMAuth = IAMAuth;\n", - "\"use strict\";\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DownscopedClient = exports.EXPIRATION_TIME_OFFSET = exports.MAX_ACCESS_BOUNDARY_RULES_COUNT = void 0;\nconst stream = require(\"stream\");\nconst authclient_1 = require(\"./authclient\");\nconst sts = require(\"./stscredentials\");\n/**\n * The required token exchange grant_type: rfc8693#section-2.1\n */\nconst STS_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:token-exchange';\n/**\n * The requested token exchange requested_token_type: rfc8693#section-2.1\n */\nconst STS_REQUEST_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/**\n * The requested token exchange subject_token_type: rfc8693#section-2.1\n */\nconst STS_SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token';\n/**\n * The maximum number of access boundary rules a Credential Access Boundary\n * can contain.\n */\nexports.MAX_ACCESS_BOUNDARY_RULES_COUNT = 10;\n/**\n * Offset to take into account network delays and server clock skews.\n */\nexports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000;\n/**\n * Defines a set of Google credentials that are downscoped from an existing set\n * of Google OAuth2 credentials. This is useful to restrict the Identity and\n * Access Management (IAM) permissions that a short-lived credential can use.\n * The common pattern of usage is to have a token broker with elevated access\n * generate these downscoped credentials from higher access source credentials\n * and pass the downscoped short-lived access tokens to a token consumer via\n * some secure authenticated channel for limited access to Google Cloud Storage\n * resources.\n */\nclass DownscopedClient extends authclient_1.AuthClient {\n /**\n * Instantiates a downscoped client object using the provided source\n * AuthClient and credential access boundary rules.\n * To downscope permissions of a source AuthClient, a Credential Access\n * Boundary that specifies which resources the new credential can access, as\n * well as an upper bound on the permissions that are available on each\n * resource, has to be defined. A downscoped client can then be instantiated\n * using the source AuthClient and the Credential Access Boundary.\n * @param authClient The source AuthClient to be downscoped based on the\n * provided Credential Access Boundary rules.\n * @param credentialAccessBoundary The Credential Access Boundary which\n * contains a list of access boundary rules. Each rule contains information\n * on the resource that the rule applies to, the upper bound of the\n * permissions that are available on that resource and an optional\n * condition to further restrict permissions.\n * @param additionalOptions **DEPRECATED, set this in the provided `authClient`.**\n * Optional additional behavior customization options.\n * @param quotaProjectId **DEPRECATED, set this in the provided `authClient`.**\n * Optional quota project id for setting up in the x-goog-user-project header.\n */\n constructor(authClient, credentialAccessBoundary, additionalOptions, quotaProjectId) {\n super({ ...additionalOptions, quotaProjectId });\n this.authClient = authClient;\n this.credentialAccessBoundary = credentialAccessBoundary;\n // Check 1-10 Access Boundary Rules are defined within Credential Access\n // Boundary.\n if (credentialAccessBoundary.accessBoundary.accessBoundaryRules.length === 0) {\n throw new Error('At least one access boundary rule needs to be defined.');\n }\n else if (credentialAccessBoundary.accessBoundary.accessBoundaryRules.length >\n exports.MAX_ACCESS_BOUNDARY_RULES_COUNT) {\n throw new Error('The provided access boundary has more than ' +\n `${exports.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);\n }\n // Check at least one permission should be defined in each Access Boundary\n // Rule.\n for (const rule of credentialAccessBoundary.accessBoundary\n .accessBoundaryRules) {\n if (rule.availablePermissions.length === 0) {\n throw new Error('At least one permission should be defined in access boundary rules.');\n }\n }\n this.stsCredential = new sts.StsCredentials(`https://sts.${this.universeDomain}/v1/token`);\n this.cachedDownscopedAccessToken = null;\n }\n /**\n * Provides a mechanism to inject Downscoped access tokens directly.\n * The expiry_date field is required to facilitate determination of the token\n * expiration which would make it easier for the token consumer to handle.\n * @param credentials The Credentials object to set on the current client.\n */\n setCredentials(credentials) {\n if (!credentials.expiry_date) {\n throw new Error('The access token expiry_date field is missing in the provided ' +\n 'credentials.');\n }\n super.setCredentials(credentials);\n this.cachedDownscopedAccessToken = credentials;\n }\n async getAccessToken() {\n // If the cached access token is unavailable or expired, force refresh.\n // The Downscoped access token will be returned in\n // DownscopedAccessTokenResponse format.\n if (!this.cachedDownscopedAccessToken ||\n this.isExpired(this.cachedDownscopedAccessToken)) {\n await this.refreshAccessTokenAsync();\n }\n // Return Downscoped access token in DownscopedAccessTokenResponse format.\n return {\n token: this.cachedDownscopedAccessToken.access_token,\n expirationTime: this.cachedDownscopedAccessToken.expiry_date,\n res: this.cachedDownscopedAccessToken.res,\n };\n }\n /**\n * The main authentication interface. It takes an optional url which when\n * present is the endpoint being accessed, and returns a Promise which\n * resolves with authorization header fields.\n *\n * The result has the form:\n * { Authorization: 'Bearer ' }\n */\n async getRequestHeaders() {\n const accessTokenResponse = await this.getAccessToken();\n const headers = {\n Authorization: `Bearer ${accessTokenResponse.token}`,\n };\n return this.addSharedMetadataHeaders(headers);\n }\n request(opts, callback) {\n if (callback) {\n this.requestAsync(opts).then(r => callback(null, r), e => {\n return callback(e, e.response);\n });\n }\n else {\n return this.requestAsync(opts);\n }\n }\n /**\n * Authenticates the provided HTTP request, processes it and resolves with the\n * returned response.\n * @param opts The HTTP request options.\n * @param reAuthRetried Whether the current attempt is a retry after a failed attempt due to an auth failure\n * @return A promise that resolves with the successful response.\n */\n async requestAsync(opts, reAuthRetried = false) {\n let response;\n try {\n const requestHeaders = await this.getRequestHeaders();\n opts.headers = opts.headers || {};\n if (requestHeaders && requestHeaders['x-goog-user-project']) {\n opts.headers['x-goog-user-project'] =\n requestHeaders['x-goog-user-project'];\n }\n if (requestHeaders && requestHeaders.Authorization) {\n opts.headers.Authorization = requestHeaders.Authorization;\n }\n response = await this.transporter.request(opts);\n }\n catch (e) {\n const res = e.response;\n if (res) {\n const statusCode = res.status;\n // Retry the request for metadata if the following criteria are true:\n // - We haven't already retried. It only makes sense to retry once.\n // - The response was a 401 or a 403\n // - The request didn't send a readableStream\n // - forceRefreshOnFailure is true\n const isReadableStream = res.config.data instanceof stream.Readable;\n const isAuthErr = statusCode === 401 || statusCode === 403;\n if (!reAuthRetried &&\n isAuthErr &&\n !isReadableStream &&\n this.forceRefreshOnFailure) {\n await this.refreshAccessTokenAsync();\n return await this.requestAsync(opts, true);\n }\n }\n throw e;\n }\n return response;\n }\n /**\n * Forces token refresh, even if unexpired tokens are currently cached.\n * GCP access tokens are retrieved from authclient object/source credential.\n * Then GCP access tokens are exchanged for downscoped access tokens via the\n * token exchange endpoint.\n * @return A promise that resolves with the fresh downscoped access token.\n */\n async refreshAccessTokenAsync() {\n var _a;\n // Retrieve GCP access token from source credential.\n const subjectToken = (await this.authClient.getAccessToken()).token;\n // Construct the STS credentials options.\n const stsCredentialsOptions = {\n grantType: STS_GRANT_TYPE,\n requestedTokenType: STS_REQUEST_TOKEN_TYPE,\n subjectToken: subjectToken,\n subjectTokenType: STS_SUBJECT_TOKEN_TYPE,\n };\n // Exchange the source AuthClient access token for a Downscoped access\n // token.\n const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, undefined, this.credentialAccessBoundary);\n /**\n * The STS endpoint will only return the expiration time for the downscoped\n * access token if the original access token represents a service account.\n * The downscoped token's expiration time will always match the source\n * credential expiration. When no expires_in is returned, we can copy the\n * source credential's expiration time.\n */\n const sourceCredExpireDate = ((_a = this.authClient.credentials) === null || _a === void 0 ? void 0 : _a.expiry_date) || null;\n const expiryDate = stsResponse.expires_in\n ? new Date().getTime() + stsResponse.expires_in * 1000\n : sourceCredExpireDate;\n // Save response in cached access token.\n this.cachedDownscopedAccessToken = {\n access_token: stsResponse.access_token,\n expiry_date: expiryDate,\n res: stsResponse.res,\n };\n // Save credentials.\n this.credentials = {};\n Object.assign(this.credentials, this.cachedDownscopedAccessToken);\n delete this.credentials.res;\n // Trigger tokens event to notify external listeners.\n this.emit('tokens', {\n refresh_token: null,\n expiry_date: this.cachedDownscopedAccessToken.expiry_date,\n access_token: this.cachedDownscopedAccessToken.access_token,\n token_type: 'Bearer',\n id_token: null,\n });\n // Return the cached access token.\n return this.cachedDownscopedAccessToken;\n }\n /**\n * Returns whether the provided credentials are expired or not.\n * If there is no expiry time, assumes the token is not expired or expiring.\n * @param downscopedAccessToken The credentials to check for expiration.\n * @return Whether the credentials are expired or not.\n */\n isExpired(downscopedAccessToken) {\n const now = new Date().getTime();\n return downscopedAccessToken.expiry_date\n ? now >=\n downscopedAccessToken.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }\n}\nexports.DownscopedClient = DownscopedClient;\n", - "\"use strict\";\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PassThroughClient = void 0;\nconst authclient_1 = require(\"./authclient\");\n/**\n * An AuthClient without any Authentication information. Useful for:\n * - Anonymous access\n * - Local Emulators\n * - Testing Environments\n *\n */\nclass PassThroughClient extends authclient_1.AuthClient {\n /**\n * Creates a request without any authentication headers or checks.\n *\n * @remarks\n *\n * In testing environments it may be useful to change the provided\n * {@link AuthClient.transporter} for any desired request overrides/handling.\n *\n * @param opts\n * @returns The response of the request.\n */\n async request(opts) {\n return this.transporter.request(opts);\n }\n /**\n * A required method of the base class.\n * Always will return an empty object.\n *\n * @returns {}\n */\n async getAccessToken() {\n return {};\n }\n /**\n * A required method of the base class.\n * Always will return an empty object.\n *\n * @returns {}\n */\n async getRequestHeaders() {\n return {};\n }\n}\nexports.PassThroughClient = PassThroughClient;\nconst a = new PassThroughClient();\na.getAccessToken();\n", - "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleAuth = exports.auth = exports.DefaultTransporter = exports.PassThroughClient = exports.ExecutableError = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsRequestSigner = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.ClientAuthentication = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gaxios = exports.gcpMetadata = void 0;\n// Copyright 2017 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nconst googleauth_1 = require(\"./auth/googleauth\");\nObject.defineProperty(exports, \"GoogleAuth\", { enumerable: true, get: function () { return googleauth_1.GoogleAuth; } });\n// Export common deps to ensure types/instances are the exact match. Useful\n// for consistently configuring the library across versions.\nexports.gcpMetadata = require(\"gcp-metadata\");\nexports.gaxios = require(\"gaxios\");\nvar authclient_1 = require(\"./auth/authclient\");\nObject.defineProperty(exports, \"AuthClient\", { enumerable: true, get: function () { return authclient_1.AuthClient; } });\nObject.defineProperty(exports, \"DEFAULT_UNIVERSE\", { enumerable: true, get: function () { return authclient_1.DEFAULT_UNIVERSE; } });\nvar computeclient_1 = require(\"./auth/computeclient\");\nObject.defineProperty(exports, \"Compute\", { enumerable: true, get: function () { return computeclient_1.Compute; } });\nvar envDetect_1 = require(\"./auth/envDetect\");\nObject.defineProperty(exports, \"GCPEnv\", { enumerable: true, get: function () { return envDetect_1.GCPEnv; } });\nvar iam_1 = require(\"./auth/iam\");\nObject.defineProperty(exports, \"IAMAuth\", { enumerable: true, get: function () { return iam_1.IAMAuth; } });\nvar idtokenclient_1 = require(\"./auth/idtokenclient\");\nObject.defineProperty(exports, \"IdTokenClient\", { enumerable: true, get: function () { return idtokenclient_1.IdTokenClient; } });\nvar jwtaccess_1 = require(\"./auth/jwtaccess\");\nObject.defineProperty(exports, \"JWTAccess\", { enumerable: true, get: function () { return jwtaccess_1.JWTAccess; } });\nvar jwtclient_1 = require(\"./auth/jwtclient\");\nObject.defineProperty(exports, \"JWT\", { enumerable: true, get: function () { return jwtclient_1.JWT; } });\nvar impersonated_1 = require(\"./auth/impersonated\");\nObject.defineProperty(exports, \"Impersonated\", { enumerable: true, get: function () { return impersonated_1.Impersonated; } });\nvar oauth2client_1 = require(\"./auth/oauth2client\");\nObject.defineProperty(exports, \"CodeChallengeMethod\", { enumerable: true, get: function () { return oauth2client_1.CodeChallengeMethod; } });\nObject.defineProperty(exports, \"OAuth2Client\", { enumerable: true, get: function () { return oauth2client_1.OAuth2Client; } });\nObject.defineProperty(exports, \"ClientAuthentication\", { enumerable: true, get: function () { return oauth2client_1.ClientAuthentication; } });\nvar loginticket_1 = require(\"./auth/loginticket\");\nObject.defineProperty(exports, \"LoginTicket\", { enumerable: true, get: function () { return loginticket_1.LoginTicket; } });\nvar refreshclient_1 = require(\"./auth/refreshclient\");\nObject.defineProperty(exports, \"UserRefreshClient\", { enumerable: true, get: function () { return refreshclient_1.UserRefreshClient; } });\nvar awsclient_1 = require(\"./auth/awsclient\");\nObject.defineProperty(exports, \"AwsClient\", { enumerable: true, get: function () { return awsclient_1.AwsClient; } });\nvar awsrequestsigner_1 = require(\"./auth/awsrequestsigner\");\nObject.defineProperty(exports, \"AwsRequestSigner\", { enumerable: true, get: function () { return awsrequestsigner_1.AwsRequestSigner; } });\nvar identitypoolclient_1 = require(\"./auth/identitypoolclient\");\nObject.defineProperty(exports, \"IdentityPoolClient\", { enumerable: true, get: function () { return identitypoolclient_1.IdentityPoolClient; } });\nvar externalclient_1 = require(\"./auth/externalclient\");\nObject.defineProperty(exports, \"ExternalAccountClient\", { enumerable: true, get: function () { return externalclient_1.ExternalAccountClient; } });\nvar baseexternalclient_1 = require(\"./auth/baseexternalclient\");\nObject.defineProperty(exports, \"BaseExternalAccountClient\", { enumerable: true, get: function () { return baseexternalclient_1.BaseExternalAccountClient; } });\nvar downscopedclient_1 = require(\"./auth/downscopedclient\");\nObject.defineProperty(exports, \"DownscopedClient\", { enumerable: true, get: function () { return downscopedclient_1.DownscopedClient; } });\nvar pluggable_auth_client_1 = require(\"./auth/pluggable-auth-client\");\nObject.defineProperty(exports, \"PluggableAuthClient\", { enumerable: true, get: function () { return pluggable_auth_client_1.PluggableAuthClient; } });\nObject.defineProperty(exports, \"ExecutableError\", { enumerable: true, get: function () { return pluggable_auth_client_1.ExecutableError; } });\nvar passthrough_1 = require(\"./auth/passthrough\");\nObject.defineProperty(exports, \"PassThroughClient\", { enumerable: true, get: function () { return passthrough_1.PassThroughClient; } });\nvar transporters_1 = require(\"./transporters\");\nObject.defineProperty(exports, \"DefaultTransporter\", { enumerable: true, get: function () { return transporters_1.DefaultTransporter; } });\nconst auth = new googleauth_1.GoogleAuth();\nexports.auth = auth;\n", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\n/**\n * Read an environment variable.\n *\n * Trims beginning and trailing whitespace.\n *\n * Will return undefined if the environment variable doesn't exist or cannot be accessed.\n */\nexport const readEnv = (env) => {\n if (typeof globalThis.process !== 'undefined') {\n return globalThis.process.env?.[env]?.trim() ?? undefined;\n }\n if (typeof globalThis.Deno !== 'undefined') {\n return globalThis.Deno.env?.get?.(env)?.trim();\n }\n return undefined;\n};\n//# sourceMappingURL=env.mjs.map", - "export * from '@anthropic-ai/sdk/core/error';\n//# sourceMappingURL=error.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { AnthropicError } from \"../../core/error.mjs\";\n// https://url.spec.whatwg.org/#url-scheme-string\nconst startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;\nexport const isAbsoluteURL = (url) => {\n return startsWithSchemeRegexp.test(url);\n};\nexport let isArray = (val) => ((isArray = Array.isArray), isArray(val));\nexport let isReadonlyArray = isArray;\n/** Returns an object if the given value isn't an object, otherwise returns as-is */\nexport function maybeObj(x) {\n if (typeof x !== 'object') {\n return {};\n }\n return x ?? {};\n}\n// https://stackoverflow.com/a/34491287\nexport function isEmptyObj(obj) {\n if (!obj)\n return true;\n for (const _k in obj)\n return false;\n return true;\n}\n// https://eslint.org/docs/latest/rules/no-prototype-builtins\nexport function hasOwn(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\nexport function isObj(obj) {\n return obj != null && typeof obj === 'object' && !Array.isArray(obj);\n}\nexport const ensurePresent = (value) => {\n if (value == null) {\n throw new AnthropicError(`Expected a value to be given but received ${value} instead.`);\n }\n return value;\n};\nexport const validatePositiveInteger = (name, n) => {\n if (typeof n !== 'number' || !Number.isInteger(n)) {\n throw new AnthropicError(`${name} must be an integer`);\n }\n if (n < 0) {\n throw new AnthropicError(`${name} must be a positive integer`);\n }\n return n;\n};\nexport const coerceInteger = (value) => {\n if (typeof value === 'number')\n return Math.round(value);\n if (typeof value === 'string')\n return parseInt(value, 10);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceFloat = (value) => {\n if (typeof value === 'number')\n return value;\n if (typeof value === 'string')\n return parseFloat(value);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceBoolean = (value) => {\n if (typeof value === 'boolean')\n return value;\n if (typeof value === 'string')\n return value === 'true';\n return Boolean(value);\n};\nexport const maybeCoerceInteger = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceInteger(value);\n};\nexport const maybeCoerceFloat = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceFloat(value);\n};\nexport const maybeCoerceBoolean = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceBoolean(value);\n};\nexport const safeJSON = (text) => {\n try {\n return JSON.parse(text);\n }\n catch (err) {\n return undefined;\n }\n};\n//# sourceMappingURL=values.mjs.map", - "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { isReadonlyArray } from \"./utils/values.mjs\";\nconst brand_privateNullableHeaders = Symbol.for('brand.privateNullableHeaders');\nfunction* iterateHeaders(headers) {\n if (!headers)\n return;\n if (brand_privateNullableHeaders in headers) {\n const { values, nulls } = headers;\n yield* values.entries();\n for (const name of nulls) {\n yield [name, null];\n }\n return;\n }\n let shouldClear = false;\n let iter;\n if (headers instanceof Headers) {\n iter = headers.entries();\n }\n else if (isReadonlyArray(headers)) {\n iter = headers;\n }\n else {\n shouldClear = true;\n iter = Object.entries(headers ?? {});\n }\n for (let row of iter) {\n const name = row[0];\n if (typeof name !== 'string')\n throw new TypeError('expected header name to be a string');\n const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];\n let didClear = false;\n for (const value of values) {\n if (value === undefined)\n continue;\n // Objects keys always overwrite older headers, they never append.\n // Yield a null to clear the header before adding the new values.\n if (shouldClear && !didClear) {\n didClear = true;\n yield [name, null];\n }\n yield [name, value];\n }\n }\n}\nexport const buildHeaders = (newHeaders) => {\n const targetHeaders = new Headers();\n const nullHeaders = new Set();\n for (const headers of newHeaders) {\n const seenHeaders = new Set();\n for (const [name, value] of iterateHeaders(headers)) {\n const lowerName = name.toLowerCase();\n if (!seenHeaders.has(lowerName)) {\n targetHeaders.delete(name);\n seenHeaders.add(lowerName);\n }\n if (value === null) {\n targetHeaders.delete(name);\n nullHeaders.add(lowerName);\n }\n else {\n targetHeaders.append(name, value);\n nullHeaders.delete(lowerName);\n }\n }\n }\n return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };\n};\nexport const isEmptyHeaders = (headers) => {\n for (const _ of iterateHeaders(headers))\n return false;\n return true;\n};\n//# sourceMappingURL=headers.mjs.map", - "import { BaseAnthropic } from '@anthropic-ai/sdk/client';\nimport * as Resources from '@anthropic-ai/sdk/resources/index';\nimport { GoogleAuth } from 'google-auth-library';\nimport { readEnv } from \"./internal/utils/env.mjs\";\nimport { isObj } from \"./internal/utils/values.mjs\";\nimport { buildHeaders } from \"./internal/headers.mjs\";\nexport { BaseAnthropic } from '@anthropic-ai/sdk/client';\nconst DEFAULT_VERSION = 'vertex-2023-10-16';\nconst MODEL_ENDPOINTS = new Set(['/v1/messages', '/v1/messages?beta=true']);\nexport class AnthropicVertex extends BaseAnthropic {\n /**\n * API Client for interfacing with the Anthropic Vertex API.\n *\n * @param {string | null} opts.accessToken\n * @param {string | null} opts.projectId\n * @param {GoogleAuth} opts.googleAuth - Override the default google auth config\n * @param {AuthClient} opts.authClient - Provide a pre-configured AuthClient instance (alternative to googleAuth)\n * @param {string | null} [opts.region=process.env['CLOUD_ML_REGION']] - The region to use for the API. Use 'global' for global endpoint. [More details here](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations).\n * @param {string} [opts.baseURL=process.env['ANTHROPIC_VERTEX__BASE_URL'] ?? https://${region}-aiplatform.googleapis.com/v1] - Override the default base URL for the API.\n * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.\n * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.\n * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.\n * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.\n * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.\n * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API.\n * @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.\n */\n constructor({ baseURL = readEnv('ANTHROPIC_VERTEX_BASE_URL'), region = readEnv('CLOUD_ML_REGION') ?? null, projectId = readEnv('ANTHROPIC_VERTEX_PROJECT_ID') ?? null, ...opts } = {}) {\n if (!region) {\n throw new Error('No region was given. The client should be instantiated with the `region` option or the `CLOUD_ML_REGION` environment variable should be set.');\n }\n super({\n baseURL: baseURL ||\n (region === 'global' ?\n 'https://aiplatform.googleapis.com/v1'\n : `https://${region}-aiplatform.googleapis.com/v1`),\n ...opts,\n });\n this.messages = makeMessagesResource(this);\n this.beta = makeBetaResource(this);\n this.region = region;\n this.projectId = projectId;\n this.accessToken = opts.accessToken ?? null;\n if (opts.authClient && opts.googleAuth) {\n throw new Error('You cannot provide both `authClient` and `googleAuth`. Please provide only one of them.');\n }\n else if (opts.authClient) {\n this._authClientPromise = Promise.resolve(opts.authClient);\n }\n else {\n this._auth =\n opts.googleAuth ?? new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/cloud-platform' });\n this._authClientPromise = this._auth.getClient();\n }\n }\n validateHeaders() {\n // auth validation is handled in prepareOptions since it needs to be async\n }\n async prepareOptions(options) {\n const authClient = await this._authClientPromise;\n const authHeaders = await authClient.getRequestHeaders();\n const projectId = authClient.projectId ?? authHeaders['x-goog-user-project'];\n if (!this.projectId && projectId) {\n this.projectId = projectId;\n }\n options.headers = buildHeaders([authHeaders, options.headers]);\n }\n async buildRequest(options) {\n if (isObj(options.body)) {\n // create a shallow copy of the request body so that code that mutates it later\n // doesn't mutate the original user-provided object\n options.body = { ...options.body };\n }\n if (isObj(options.body)) {\n if (!options.body['anthropic_version']) {\n options.body['anthropic_version'] = DEFAULT_VERSION;\n }\n }\n if (MODEL_ENDPOINTS.has(options.path) && options.method === 'post') {\n if (!this.projectId) {\n throw new Error('No projectId was given and it could not be resolved from credentials. The client should be instantiated with the `projectId` option or the `ANTHROPIC_VERTEX_PROJECT_ID` environment variable should be set.');\n }\n if (!isObj(options.body)) {\n throw new Error('Expected request body to be an object for post /v1/messages');\n }\n const model = options.body['model'];\n options.body['model'] = undefined;\n const stream = options.body['stream'] ?? false;\n const specifier = stream ? 'streamRawPredict' : 'rawPredict';\n options.path = `/projects/${this.projectId}/locations/${this.region}/publishers/anthropic/models/${model}:${specifier}`;\n }\n if (options.path === '/v1/messages/count_tokens' ||\n (options.path == '/v1/messages/count_tokens?beta=true' && options.method === 'post')) {\n if (!this.projectId) {\n throw new Error('No projectId was given and it could not be resolved from credentials. The client should be instantiated with the `projectId` option or the `ANTHROPIC_VERTEX_PROJECT_ID` environment variable should be set.');\n }\n options.path = `/projects/${this.projectId}/locations/${this.region}/publishers/anthropic/models/count-tokens:rawPredict`;\n }\n return super.buildRequest(options);\n }\n}\nfunction makeMessagesResource(client) {\n const resource = new Resources.Messages(client);\n // @ts-expect-error we're deleting non-optional properties\n delete resource.batches;\n return resource;\n}\nfunction makeBetaResource(client) {\n const resource = new Resources.Beta(client);\n // @ts-expect-error we're deleting non-optional properties\n delete resource.messages.batches;\n return resource;\n}\n//# sourceMappingURL=client.mjs.map", - "export * from \"./client.mjs\";\nexport { AnthropicVertex as default } from \"./client.mjs\";\n//# sourceMappingURL=index.mjs.map", + "\n const handler = { get: (t, p) => p === '__esModule' ? true : () => {} };\n const stub = new Proxy({}, handler);\n export default stub;\n export const __stub__ = true;\n \n ", + "\n const handler = { get: (t, p) => p === '__esModule' ? true : () => {} };\n const stub = new Proxy({}, handler);\n export default stub;\n export const __stub__ = true;\n \n ", + "\n const handler = { get: (t, p) => p === '__esModule' ? true : () => {} };\n const stub = new Proxy({}, handler);\n export default stub;\n export const __stub__ = true;\n \n ", + "\n const handler = { get: (t, p) => p === '__esModule' ? true : () => {} };\n const stub = new Proxy({}, handler);\n export default stub;\n export const __stub__ = true;\n \n ", "'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n", "\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n", "\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n", @@ -2584,673 +2235,7 @@ "/**\n * Constants for the official Anthropic plugins marketplace.\n *\n * The official marketplace is hosted on GitHub and provides first-party\n * plugins developed by Anthropic. This file defines the constants needed\n * to install and identify this marketplace.\n */\n\nimport type { MarketplaceSource } from './schemas.js'\n\n/**\n * Source configuration for the official Anthropic plugins marketplace.\n * Used when auto-installing the marketplace on startup.\n */\nexport const OFFICIAL_MARKETPLACE_SOURCE = {\n source: 'github',\n repo: 'anthropics/claude-plugins-official',\n} as const satisfies MarketplaceSource\n\n/**\n * Display name for the official marketplace.\n * This is the name under which the marketplace will be registered\n * in the known_marketplaces.json file.\n */\nexport const OFFICIAL_MARKETPLACE_NAME = 'claude-plugins-official'\n", "/**\n * Telemetry for plugin/marketplace fetches that hit the network.\n *\n * Added for inc-5046 (GitHub complained about claude-plugins-official load).\n * Before this, fetch operations only had logForDebugging — no way to measure\n * actual network volume. This surfaces what's hitting GitHub vs GCS vs\n * user-hosted so we can see the GCS migration take effect and catch future\n * hot-path regressions before GitHub emails us again.\n *\n * Volume: these fire at startup (install-counts 24h-TTL)\n * and on explicit user action (install/update). NOT per-interaction. Similar\n * envelope to tengu_binary_download_*.\n */\n\nimport {\n logEvent,\n type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS as SafeString,\n} from '../../services/analytics/index.js'\nimport { OFFICIAL_MARKETPLACE_NAME } from './officialMarketplace.js'\n\nexport type PluginFetchSource =\n | 'install_counts'\n | 'marketplace_clone'\n | 'marketplace_pull'\n | 'marketplace_url'\n | 'plugin_clone'\n | 'mcpb'\n\nexport type PluginFetchOutcome = 'success' | 'failure' | 'cache_hit'\n\n// Allowlist of public hosts we report by name. Anything else (enterprise\n// git, self-hosted, internal) is bucketed as 'other' — we don't want\n// internal hostnames (git.mycorp.internal) landing in telemetry. Bounded\n// cardinality also keeps the dashboard host-breakdown tractable.\nconst KNOWN_PUBLIC_HOSTS = new Set([\n 'github.com',\n 'raw.githubusercontent.com',\n 'objects.githubusercontent.com',\n 'gist.githubusercontent.com',\n 'gitlab.com',\n 'bitbucket.org',\n 'codeberg.org',\n 'dev.azure.com',\n 'ssh.dev.azure.com',\n 'storage.googleapis.com', // GCS — where Dickson's migration points\n])\n\n/**\n * Extract hostname from a URL or git spec and bucket to the allowlist.\n * Handles `https://host/...`, `git@host:path`, `ssh://host/...`.\n * Returns a known public host, 'other' (parseable but not allowlisted —\n * don't leak private hostnames), or 'unknown' (unparseable / local path).\n */\nfunction extractHost(urlOrSpec: string): string {\n let host: string\n const scpMatch = /^[^@/]+@([^:/]+):/.exec(urlOrSpec)\n if (scpMatch) {\n host = scpMatch[1]!\n } else {\n try {\n host = new URL(urlOrSpec).hostname\n } catch {\n return 'unknown'\n }\n }\n const normalized = host.toLowerCase()\n return KNOWN_PUBLIC_HOSTS.has(normalized) ? normalized : 'other'\n}\n\n/**\n * True if the URL/spec points at anthropics/claude-plugins-official — the\n * repo GitHub complained about. Lets the dashboard separate \"our problem\"\n * traffic from user-configured marketplaces.\n */\nfunction isOfficialRepo(urlOrSpec: string): boolean {\n return urlOrSpec.includes(`anthropics/${OFFICIAL_MARKETPLACE_NAME}`)\n}\n\nexport function logPluginFetch(\n source: PluginFetchSource,\n urlOrSpec: string | undefined,\n outcome: PluginFetchOutcome,\n durationMs: number,\n errorKind?: string,\n): void {\n // String values are bounded enums / hostname-only — no code, no paths,\n // no raw error messages. Same privacy envelope as tengu_web_fetch_host.\n logEvent('tengu_plugin_remote_fetch', {\n source: source as SafeString,\n host: (urlOrSpec ? extractHost(urlOrSpec) : 'unknown') as SafeString,\n is_official: urlOrSpec ? isOfficialRepo(urlOrSpec) : false,\n outcome: outcome as SafeString,\n duration_ms: Math.round(durationMs),\n ...(errorKind && { error_kind: errorKind as SafeString }),\n })\n}\n\n/**\n * Classify an error into a stable bucket for the error_kind field. Keeps\n * cardinality bounded — raw error messages would explode dashboard grouping.\n *\n * Handles both axios Error objects (Node.js error codes like ENOTFOUND) and\n * git stderr strings (human phrases like \"Could not resolve host\"). DNS\n * checked BEFORE timeout because gitClone's error enhancement at\n * marketplaceManager.ts:~950 rewrites DNS failures to include the word\n * \"timeout\" — ordering the other way would misclassify git DNS as timeout.\n */\nexport function classifyFetchError(error: unknown): string {\n const msg = String((error as { message?: unknown })?.message ?? error)\n if (\n /ENOTFOUND|ECONNREFUSED|EAI_AGAIN|Could not resolve host|Connection refused/i.test(\n msg,\n )\n ) {\n return 'dns_or_refused'\n }\n if (/ETIMEDOUT|timed out|timeout/i.test(msg)) return 'timeout'\n if (\n /ECONNRESET|socket hang up|Connection reset by peer|remote end hung up/i.test(\n msg,\n )\n ) {\n return 'conn_reset'\n }\n if (/403|401|authentication|permission denied/i.test(msg)) return 'auth'\n if (/404|not found|repository not found/i.test(msg)) return 'not_found'\n if (/certificate|SSL|TLS|unable to get local issuer/i.test(msg)) return 'tls'\n // Schema validation throws \"Invalid response format\" (install_counts) —\n // distinguish from true unknowns so the dashboard can\n // see \"server sent garbage\" separately.\n if (/Invalid response format|Invalid marketplace schema/i.test(msg)) {\n return 'invalid_schema'\n }\n return 'other'\n}\n", "/**\n * Utility for checking git availability.\n *\n * Git is required for installing GitHub-based marketplaces. This module\n * provides a memoized check to determine if git is available on the system.\n */\n\nimport memoize from 'lodash-es/memoize.js'\nimport { which } from '../which.js'\n\n/**\n * Check if a command is available in PATH.\n *\n * Uses which to find the actual executable without executing it.\n * This is a security best practice to avoid executing arbitrary code\n * in untrusted directories.\n *\n * @param command - The command to check for\n * @returns True if the command exists and is executable\n */\nasync function isCommandAvailable(command: string): Promise {\n try {\n return !!(await which(command))\n } catch {\n return false\n }\n}\n\n/**\n * Check if git is available on the system.\n *\n * This is memoized so repeated calls within a session return the cached result.\n * Git availability is unlikely to change during a single CLI session.\n *\n * Only checks PATH — does not exec git. On macOS this means the /usr/bin/git\n * xcrun shim passes even without Xcode CLT installed; callers that hit\n * `xcrun: error:` at exec time should call markGitUnavailable() so the rest\n * of the session behaves as though git is absent.\n *\n * @returns True if git is installed and executable\n */\nexport const checkGitAvailable = memoize(async (): Promise => {\n return isCommandAvailable('git')\n})\n\n/**\n * Force the memoized git-availability check to return false for the rest of\n * the session.\n *\n * Call this when a git invocation fails in a way that indicates the binary\n * exists on PATH but cannot actually run — the macOS xcrun shim being the\n * main case (`xcrun: error: invalid active developer path`). Subsequent\n * checkGitAvailable() calls then short-circuit to false, so downstream code\n * that guards on git availability skips cleanly instead of failing repeatedly\n * with the same exec error.\n *\n * lodash memoize uses a no-arg cache key of undefined.\n */\nexport function markGitUnavailable(): void {\n checkGitAvailable.cache?.set?.(undefined, Promise.resolve(false))\n}\n\n/**\n * Clear the git availability cache.\n * Used for testing purposes.\n */\nexport function clearGitAvailabilityCache(): void {\n checkGitAvailable.cache?.clear?.()\n}\n", - "/**\n * Simple debug logging for standalone sandbox\n */\nexport function logForDebugging(message, options) {\n // Only log if SRT_DEBUG environment variable is set\n // Using SRT_DEBUG instead of DEBUG to avoid conflicts with other tools\n // (DEBUG is commonly used by Node.js debug libraries and VS Code)\n if (!process.env.SRT_DEBUG) {\n return;\n }\n const level = options?.level || 'info';\n const prefix = '[SandboxDebug]';\n // Always use stderr to avoid corrupting stdout JSON streams\n switch (level) {\n case 'error':\n console.error(`${prefix} ${message}`);\n break;\n case 'warn':\n console.warn(`${prefix} ${message}`);\n break;\n default:\n console.error(`${prefix} ${message}`);\n }\n}\n//# sourceMappingURL=debug.js.map", - "import { Agent, createServer } from 'node:http';\nimport { request as httpRequest } from 'node:http';\nimport { request as httpsRequest } from 'node:https';\nimport { connect } from 'node:net';\nimport { URL } from 'node:url';\nimport { logForDebugging } from '../utils/debug.js';\nexport function createHttpProxyServer(options) {\n const server = createServer();\n // Handle CONNECT requests for HTTPS traffic\n server.on('connect', async (req, socket) => {\n // Attach error handler immediately to prevent unhandled errors\n socket.on('error', err => {\n logForDebugging(`Client socket error: ${err.message}`, { level: 'error' });\n });\n try {\n const [hostname, portStr] = req.url.split(':');\n const port = portStr === undefined ? undefined : parseInt(portStr, 10);\n if (!hostname || !port) {\n logForDebugging(`Invalid CONNECT request: ${req.url}`, {\n level: 'error',\n });\n socket.end('HTTP/1.1 400 Bad Request\\r\\n\\r\\n');\n return;\n }\n const allowed = await options.filter(port, hostname, socket);\n if (!allowed) {\n logForDebugging(`Connection blocked to ${hostname}:${port}`, {\n level: 'error',\n });\n socket.end('HTTP/1.1 403 Forbidden\\r\\n' +\n 'Content-Type: text/plain\\r\\n' +\n 'X-Proxy-Error: blocked-by-allowlist\\r\\n' +\n '\\r\\n' +\n 'Connection blocked by network allowlist');\n return;\n }\n // Check if this host should be routed through a MITM proxy\n const mitmSocketPath = options.getMitmSocketPath?.(hostname);\n if (mitmSocketPath) {\n // Route through MITM proxy via Unix socket\n logForDebugging(`Routing CONNECT ${hostname}:${port} through MITM proxy at ${mitmSocketPath}`);\n const mitmSocket = connect({ path: mitmSocketPath }, () => {\n // Send CONNECT request to the MITM proxy\n mitmSocket.write(`CONNECT ${hostname}:${port} HTTP/1.1\\r\\n` +\n `Host: ${hostname}:${port}\\r\\n` +\n '\\r\\n');\n });\n // Buffer to accumulate the MITM proxy's response\n let responseBuffer = '';\n const onMitmData = (chunk) => {\n responseBuffer += chunk.toString();\n // Check if we've received the full HTTP response headers\n const headerEndIndex = responseBuffer.indexOf('\\r\\n\\r\\n');\n if (headerEndIndex !== -1) {\n // Remove data listener, we're done parsing the response\n mitmSocket.removeListener('data', onMitmData);\n // Check if MITM proxy accepted the connection\n const statusLine = responseBuffer.substring(0, responseBuffer.indexOf('\\r\\n'));\n if (statusLine.includes(' 200 ')) {\n // Connection established, now pipe data between client and MITM\n socket.write('HTTP/1.1 200 Connection Established\\r\\n\\r\\n');\n // If there's any data after the headers, write it to the client\n const remainingData = responseBuffer.substring(headerEndIndex + 4);\n if (remainingData.length > 0) {\n socket.write(remainingData);\n }\n mitmSocket.pipe(socket);\n socket.pipe(mitmSocket);\n }\n else {\n logForDebugging(`MITM proxy rejected CONNECT: ${statusLine}`, {\n level: 'error',\n });\n socket.end('HTTP/1.1 502 Bad Gateway\\r\\n\\r\\n');\n mitmSocket.destroy();\n }\n }\n };\n mitmSocket.on('data', onMitmData);\n mitmSocket.on('error', err => {\n logForDebugging(`MITM proxy connection failed: ${err.message}`, {\n level: 'error',\n });\n socket.end('HTTP/1.1 502 Bad Gateway\\r\\n\\r\\n');\n });\n socket.on('error', err => {\n logForDebugging(`Client socket error: ${err.message}`, {\n level: 'error',\n });\n mitmSocket.destroy();\n });\n socket.on('end', () => mitmSocket.end());\n mitmSocket.on('end', () => socket.end());\n }\n else {\n // Direct connection (original behavior)\n const serverSocket = connect(port, hostname, () => {\n socket.write('HTTP/1.1 200 Connection Established\\r\\n\\r\\n');\n serverSocket.pipe(socket);\n socket.pipe(serverSocket);\n });\n serverSocket.on('error', err => {\n logForDebugging(`CONNECT tunnel failed: ${err.message}`, {\n level: 'error',\n });\n socket.end('HTTP/1.1 502 Bad Gateway\\r\\n\\r\\n');\n });\n socket.on('error', err => {\n logForDebugging(`Client socket error: ${err.message}`, {\n level: 'error',\n });\n serverSocket.destroy();\n });\n socket.on('end', () => serverSocket.end());\n serverSocket.on('end', () => socket.end());\n }\n }\n catch (err) {\n logForDebugging(`Error handling CONNECT: ${err}`, { level: 'error' });\n socket.end('HTTP/1.1 500 Internal Server Error\\r\\n\\r\\n');\n }\n });\n // Handle regular HTTP requests\n server.on('request', async (req, res) => {\n try {\n const url = new URL(req.url);\n const hostname = url.hostname;\n const port = url.port\n ? parseInt(url.port, 10)\n : url.protocol === 'https:'\n ? 443\n : 80;\n const allowed = await options.filter(port, hostname, req.socket);\n if (!allowed) {\n logForDebugging(`HTTP request blocked to ${hostname}:${port}`, {\n level: 'error',\n });\n res.writeHead(403, {\n 'Content-Type': 'text/plain',\n 'X-Proxy-Error': 'blocked-by-allowlist',\n });\n res.end('Connection blocked by network allowlist');\n return;\n }\n // Check if this host should be routed through a MITM proxy\n const mitmSocketPath = options.getMitmSocketPath?.(hostname);\n if (mitmSocketPath) {\n // Route through MITM proxy via Unix socket\n // Use an agent that connects via the Unix socket\n logForDebugging(`Routing HTTP ${req.method} ${hostname}:${port} through MITM proxy at ${mitmSocketPath}`);\n const mitmAgent = new Agent({\n // @ts-expect-error - socketPath is valid but not in types\n socketPath: mitmSocketPath,\n });\n // Send request to MITM proxy with full URL (proxy-style request)\n const proxyReq = httpRequest({\n agent: mitmAgent,\n // For proxy requests, path should be the full URL\n path: req.url,\n method: req.method,\n headers: {\n ...req.headers,\n host: url.host,\n },\n }, proxyRes => {\n res.writeHead(proxyRes.statusCode, proxyRes.headers);\n proxyRes.pipe(res);\n });\n proxyReq.on('error', err => {\n logForDebugging(`MITM proxy request failed: ${err.message}`, {\n level: 'error',\n });\n if (!res.headersSent) {\n res.writeHead(502, { 'Content-Type': 'text/plain' });\n res.end('Bad Gateway');\n }\n });\n req.pipe(proxyReq);\n }\n else {\n // Direct request (original behavior)\n // Choose http or https module\n const requestFn = url.protocol === 'https:' ? httpsRequest : httpRequest;\n const proxyReq = requestFn({\n hostname,\n port,\n path: url.pathname + url.search,\n method: req.method,\n headers: {\n ...req.headers,\n host: url.host,\n },\n }, proxyRes => {\n res.writeHead(proxyRes.statusCode, proxyRes.headers);\n proxyRes.pipe(res);\n });\n proxyReq.on('error', err => {\n logForDebugging(`Proxy request failed: ${err.message}`, {\n level: 'error',\n });\n if (!res.headersSent) {\n res.writeHead(502, { 'Content-Type': 'text/plain' });\n res.end('Bad Gateway');\n }\n });\n req.pipe(proxyReq);\n }\n }\n catch (err) {\n logForDebugging(`Error handling HTTP request: ${err}`, { level: 'error' });\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.end('Internal Server Error');\n }\n });\n return server;\n}\n//# sourceMappingURL=http-proxy.js.map", - "\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n Socks5Server: () => Socks5Server,\n createServer: () => createServer,\n defaultConnectionHandler: () => connectionHandler_default\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/Server.ts\nvar import_net2 = __toESM(require(\"net\"));\n\n// src/types.ts\nvar Socks5ConnectionCommand = /* @__PURE__ */ ((Socks5ConnectionCommand2) => {\n Socks5ConnectionCommand2[Socks5ConnectionCommand2[\"connect\"] = 1] = \"connect\";\n Socks5ConnectionCommand2[Socks5ConnectionCommand2[\"bind\"] = 2] = \"bind\";\n Socks5ConnectionCommand2[Socks5ConnectionCommand2[\"udp\"] = 3] = \"udp\";\n return Socks5ConnectionCommand2;\n})(Socks5ConnectionCommand || {});\nvar Socks5ConnectionStatus = /* @__PURE__ */ ((Socks5ConnectionStatus2) => {\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"REQUEST_GRANTED\"] = 0] = \"REQUEST_GRANTED\";\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"GENERAL_FAILURE\"] = 1] = \"GENERAL_FAILURE\";\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"CONNECTION_NOT_ALLOWED\"] = 2] = \"CONNECTION_NOT_ALLOWED\";\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"NETWORK_UNREACHABLE\"] = 3] = \"NETWORK_UNREACHABLE\";\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"HOST_UNREACHABLE\"] = 4] = \"HOST_UNREACHABLE\";\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"CONNECTION_REFUSED\"] = 5] = \"CONNECTION_REFUSED\";\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"TTL_EXPIRED\"] = 6] = \"TTL_EXPIRED\";\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"COMMAND_NOT_SUPPORTED\"] = 7] = \"COMMAND_NOT_SUPPORTED\";\n Socks5ConnectionStatus2[Socks5ConnectionStatus2[\"ADDRESS_TYPE_NOT_SUPPORTED\"] = 8] = \"ADDRESS_TYPE_NOT_SUPPORTED\";\n return Socks5ConnectionStatus2;\n})(Socks5ConnectionStatus || {});\n\n// src/Connection.ts\nvar Socks5Connection = class {\n constructor(server, socket) {\n this.errorHandler = () => {\n };\n this.metadata = {};\n this.socket = socket;\n this.server = server;\n socket.on(\"error\", this.errorHandler);\n socket.pause();\n this.handleGreeting();\n }\n readBytes(len) {\n return new Promise((resolve) => {\n let buf = Buffer.allocUnsafe(len);\n let offset = 0;\n const dataListener = (chunk) => {\n const readAmount = Math.min(chunk.length, len - offset);\n chunk.copy(buf, offset, 0, readAmount);\n offset += readAmount;\n if (offset < len) return;\n this.socket.removeListener(\"data\", dataListener);\n this.socket.push(chunk.subarray(readAmount));\n resolve(buf);\n this.socket.pause();\n };\n this.socket.on(\"data\", dataListener);\n this.socket.resume();\n });\n }\n async handleGreeting() {\n const ver = (await this.readBytes(1)).readUInt8();\n if (ver !== 5) return this.socket.destroy();\n const authMethodsAmount = (await this.readBytes(1)).readUInt8();\n if (authMethodsAmount > 128 || authMethodsAmount === 0) return this.socket.destroy();\n const authMethods = await this.readBytes(authMethodsAmount);\n const authMethodByteCode = this.server.authHandler ? 2 : 0;\n if (!authMethods.includes(authMethodByteCode)) {\n this.socket.write(Buffer.from([\n 5,\n // Version 5 - Socks5\n 255\n // no acceptable auth modes were offered \n ]));\n return this.socket.destroy();\n }\n this.socket.write(Buffer.from([\n 5,\n // Version 5 - Socks5\n authMethodByteCode\n // The chosen auth method, 0x00 for no auth, 0x02 for user-pass\n ]));\n if (this.server.authHandler) this.handleUserPassword();\n else this.handleConnectionRequest();\n }\n async handleUserPassword() {\n await this.readBytes(1);\n const usernameLength = (await this.readBytes(1)).readUint8();\n const username = (await this.readBytes(usernameLength)).toString();\n const passwordLength = (await this.readBytes(1)).readUint8();\n const password = (await this.readBytes(passwordLength)).toString();\n this.username = username;\n this.password = password;\n let calledBack = false;\n const acceptCallback = () => {\n if (calledBack) return;\n calledBack = true;\n this.socket.write(Buffer.from([\n 1,\n // User pass auth version\n 0\n // Success\n ]));\n this.handleConnectionRequest();\n };\n const denyCallback = () => {\n if (calledBack) return;\n calledBack = true;\n this.socket.write(Buffer.from([\n 1,\n // User pass auth version\n 1\n // Failure\n ]));\n this.socket.destroy();\n };\n const resp = await this.server.authHandler(this, acceptCallback, denyCallback);\n if (resp === true) acceptCallback();\n else if (resp === false) denyCallback();\n }\n async handleConnectionRequest() {\n await this.readBytes(1);\n const commandByte = (await this.readBytes(1))[0];\n const command = Socks5ConnectionCommand[commandByte];\n if (!command) return this.socket.destroy();\n this.command = command;\n await this.readBytes(1);\n const addrType = (await this.readBytes(1)).readUInt8();\n let address = \"\";\n switch (addrType) {\n case 1:\n address = (await this.readBytes(4)).join(\".\");\n break;\n case 3:\n const hostLength = (await this.readBytes(1)).readUInt8();\n address = (await this.readBytes(hostLength)).toString();\n break;\n case 4:\n const bytes = await this.readBytes(16);\n for (let i = 0; i < 16; i++) {\n if (i % 2 === 0 && i > 0) address += \":\";\n address += `${bytes[i] < 16 ? \"0\" : \"\"}${bytes[i].toString(16)}`;\n }\n break;\n default:\n this.socket.destroy();\n return;\n }\n const port = (await this.readBytes(2)).readUInt16BE();\n if (!this.server.supportedCommands.has(command)) {\n this.socket.write(Buffer.from([5, 7 /* COMMAND_NOT_SUPPORTED */]));\n return this.socket.destroy();\n }\n this.destAddress = address;\n this.destPort = port;\n let calledBack = false;\n const acceptCallback = () => {\n if (calledBack) return;\n calledBack = true;\n this.connect();\n };\n if (!this.server.rulesetValidator) return acceptCallback();\n const denyCallback = () => {\n if (calledBack) return;\n calledBack = true;\n this.socket.write(Buffer.from([\n 5,\n 2,\n // connection not allowed by ruleset\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0\n ]));\n this.socket.destroy();\n };\n const resp = await this.server.rulesetValidator(this, acceptCallback, denyCallback);\n if (resp === true) acceptCallback();\n else if (resp === false) denyCallback();\n }\n connect() {\n this.socket.removeListener(\"error\", this.errorHandler);\n this.server.connectionHandler(this, (status) => {\n if (Socks5ConnectionStatus[status] === void 0) throw new Error(`\"${status}\" is not a valid status.`);\n this.socket.write(Buffer.from([\n 5,\n Socks5ConnectionStatus[status],\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0\n ]));\n if (status !== \"REQUEST_GRANTED\") {\n this.socket.destroy();\n }\n });\n this.socket.resume();\n }\n};\n\n// src/connectionHandler.ts\nvar import_net = __toESM(require(\"net\"));\nfunction connectionHandler_default(connection, sendStatus) {\n if (connection.command !== \"connect\") return sendStatus(\"COMMAND_NOT_SUPPORTED\");\n connection.socket.on(\"error\", () => {\n });\n const stream = import_net.default.createConnection({\n host: connection.destAddress,\n port: connection.destPort\n });\n stream.setNoDelay();\n let streamOpened = false;\n stream.on(\"error\", (err) => {\n if (!streamOpened) {\n switch (err.code) {\n case \"EINVAL\":\n case \"ENOENT\":\n case \"ENOTFOUND\":\n case \"ETIMEDOUT\":\n case \"EADDRNOTAVAIL\":\n case \"EHOSTUNREACH\":\n sendStatus(\"HOST_UNREACHABLE\");\n break;\n case \"ENETUNREACH\":\n sendStatus(\"NETWORK_UNREACHABLE\");\n break;\n case \"ECONNREFUSED\":\n sendStatus(\"CONNECTION_REFUSED\");\n break;\n default:\n sendStatus(\"GENERAL_FAILURE\");\n }\n }\n });\n stream.on(\"ready\", () => {\n streamOpened = true;\n sendStatus(\"REQUEST_GRANTED\");\n connection.socket.pipe(stream).pipe(connection.socket);\n });\n connection.socket.on(\"close\", () => stream.destroy());\n return stream;\n}\n\n// src/Server.ts\nvar Socks5Server = class {\n constructor() {\n this.supportedCommands = /* @__PURE__ */ new Set([\"connect\"]);\n this.connectionHandler = connectionHandler_default;\n this.server = import_net2.default.createServer((socket) => {\n socket.setNoDelay();\n this._handleConnection(socket);\n });\n }\n listen(...args) {\n this.server.listen(...args);\n return this;\n }\n close(callback) {\n this.server.close(callback);\n return this;\n }\n setAuthHandler(handler) {\n this.authHandler = handler;\n return this;\n }\n disableAuthHandler() {\n this.authHandler = void 0;\n return this;\n }\n setRulesetValidator(handler) {\n this.rulesetValidator = handler;\n return this;\n }\n disableRulesetValidator() {\n this.rulesetValidator = void 0;\n return this;\n }\n setConnectionHandler(handler) {\n this.connectionHandler = handler;\n return this;\n }\n useDefaultConnectionHandler() {\n this.connectionHandler = connectionHandler_default;\n return this;\n }\n // Not private because someone may want to inject a duplex stream to be handled as a connection\n _handleConnection(socket) {\n new Socks5Connection(this, socket);\n return this;\n }\n};\n\n// src/index.ts\nfunction createServer(opts) {\n const server = new Socks5Server();\n if (opts?.auth) server.setAuthHandler((conn) => {\n return conn.username === opts.auth.username && conn.password === opts.auth.password;\n });\n if (opts?.port) server.listen(opts.port, opts.hostname);\n return server;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n Socks5Server,\n createServer,\n defaultConnectionHandler\n});\n", - "import { createServer } from '@pondwader/socks5-server';\nimport { logForDebugging } from '../utils/debug.js';\nexport function createSocksProxyServer(options) {\n const socksServer = createServer();\n socksServer.setRulesetValidator(async (conn) => {\n try {\n const hostname = conn.destAddress;\n const port = conn.destPort;\n logForDebugging(`Connection request to ${hostname}:${port}`);\n const allowed = await options.filter(port, hostname);\n if (!allowed) {\n logForDebugging(`Connection blocked to ${hostname}:${port}`, {\n level: 'error',\n });\n return false;\n }\n logForDebugging(`Connection allowed to ${hostname}:${port}`);\n return true;\n }\n catch (error) {\n logForDebugging(`Error validating connection: ${error}`, {\n level: 'error',\n });\n return false;\n }\n });\n return {\n server: socksServer,\n getPort() {\n // Access the internal server to get the port\n // We need to use type assertion here as the server property is private\n try {\n const serverInternal = socksServer?.server;\n if (serverInternal && typeof serverInternal?.address === 'function') {\n const address = serverInternal.address();\n if (address && typeof address === 'object' && 'port' in address) {\n return address.port;\n }\n }\n }\n catch (error) {\n // Server might not be listening yet or property access failed\n logForDebugging(`Error getting port: ${error}`, { level: 'error' });\n }\n return undefined;\n },\n listen(port, hostname) {\n return new Promise((resolve, reject) => {\n const listeningCallback = () => {\n const actualPort = this.getPort();\n if (actualPort) {\n logForDebugging(`SOCKS proxy listening on ${hostname}:${actualPort}`);\n resolve(actualPort);\n }\n else {\n reject(new Error('Failed to get SOCKS proxy server port'));\n }\n };\n socksServer.listen(port, hostname, listeningCallback);\n });\n },\n async close() {\n return new Promise((resolve, reject) => {\n socksServer.close(error => {\n if (error) {\n // Only reject for actual errors, not for \"already closed\" states\n // Check for common \"already closed\" error patterns\n const errorMessage = error.message?.toLowerCase() || '';\n const isAlreadyClosed = errorMessage.includes('not running') ||\n errorMessage.includes('already closed') ||\n errorMessage.includes('not listening');\n if (!isAlreadyClosed) {\n reject(error);\n return;\n }\n }\n resolve();\n });\n });\n },\n unref() {\n // Access the internal server to call unref\n try {\n const serverInternal = socksServer?.server;\n if (serverInternal && typeof serverInternal?.unref === 'function') {\n serverInternal.unref();\n }\n }\n catch (error) {\n logForDebugging(`Error calling unref: ${error}`, { level: 'error' });\n }\n },\n };\n}\n//# sourceMappingURL=socks-proxy.js.map", - "import { spawnSync } from 'node:child_process';\n/**\n * Find the path to an executable, similar to the `which` command.\n * Uses Bun.which when running in Bun, falls back to spawnSync for Node.js.\n *\n * @param bin - The name of the executable to find\n * @returns The full path to the executable, or null if not found\n */\nexport function whichSync(bin) {\n // Check if we're running in Bun\n if (typeof globalThis.Bun !== 'undefined') {\n return globalThis.Bun.which(bin);\n }\n // Fallback to Node.js implementation\n const result = spawnSync('which', [bin], {\n encoding: 'utf8',\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: 1000,\n });\n if (result.status === 0 && result.stdout) {\n return result.stdout.trim();\n }\n return null;\n}\n//# sourceMappingURL=which.js.map", - "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n", - "import freeGlobal from './_freeGlobal.js';\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\nexport default root;\n", - "import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n", - "import Symbol from './_Symbol.js';\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\nexport default 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\nexport default objectToString;\n", - "import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\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\nexport default baseGetTag;\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\nexport default isObjectLike;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or 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 a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n", - "import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\nfunction baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n}\n\nexport default baseToNumber;\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\nexport default arrayMap;\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\nexport default isArray;\n", - "import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n", - "import baseToNumber from './_baseToNumber.js';\nimport baseToString from './_baseToString.js';\n\n/**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\nfunction createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n}\n\nexport default createMathOperation;\n", - "import createMathOperation from './_createMathOperation.js';\n\n/**\n * Adds two numbers.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {number} augend The first number in an addition.\n * @param {number} addend The second number in an addition.\n * @returns {number} Returns the total.\n * @example\n *\n * _.add(6, 4);\n * // => 10\n */\nvar add = createMathOperation(function(augend, addend) {\n return augend + addend;\n}, 0);\n\nexport default add;\n", - "/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n", - "import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\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\nexport default isObject;\n", - "import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n", - "import toNumber from './toNumber.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nexport default toFinite;\n", - "import toFinite from './toFinite.js';\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nexport default toInteger;\n", - "import toInteger from './toInteger.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\nfunction after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n\nexport default after;\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\nexport default identity;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\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\nexport default isFunction;\n", - "import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n", - "import coreJsData from './_coreJsData.js';\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\nexport default 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\nexport default toSource;\n", - "import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\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\nexport default 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\nexport default getValue;\n", - "import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\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\nexport default getNative;\n", - "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n", - "import WeakMap from './_WeakMap.js';\n\n/** Used to store function metadata. */\nvar metaMap = WeakMap && new WeakMap;\n\nexport default metaMap;\n", - "import identity from './identity.js';\nimport metaMap from './_metaMap.js';\n\n/**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n};\n\nexport default baseSetData;\n", - "import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n", - "import baseCreate from './_baseCreate.js';\nimport isObject from './isObject.js';\n\n/**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n}\n\nexport default createCtor;\n", - "import createCtor from './_createCtor.js';\nimport root from './_root.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n}\n\nexport default createBind;\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\nexport default apply;\n", - "/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n}\n\nexport default composeArgs;\n", - "/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n}\n\nexport default composeArgsRight;\n", - "/**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\nfunction countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n}\n\nexport default countHolders;\n", - "/**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\nfunction baseLodash() {\n // No operation performed.\n}\n\nexport default baseLodash;\n", - "import baseCreate from './_baseCreate.js';\nimport baseLodash from './_baseLodash.js';\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\nfunction LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n}\n\n// Ensure `LazyWrapper` is an instance of `baseLodash`.\nLazyWrapper.prototype = baseCreate(baseLodash.prototype);\nLazyWrapper.prototype.constructor = LazyWrapper;\n\nexport default LazyWrapper;\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\nexport default noop;\n", - "import metaMap from './_metaMap.js';\nimport noop from './noop.js';\n\n/**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\nvar getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n};\n\nexport default getData;\n", - "/** Used to lookup unminified function names. */\nvar realNames = {};\n\nexport default realNames;\n", - "import realNames from './_realNames.js';\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 name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\nfunction getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n}\n\nexport default getFuncName;\n", - "import baseCreate from './_baseCreate.js';\nimport baseLodash from './_baseLodash.js';\n\n/**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\nfunction LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n}\n\nLodashWrapper.prototype = baseCreate(baseLodash.prototype);\nLodashWrapper.prototype.constructor = LodashWrapper;\n\nexport default LodashWrapper;\n", - "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n", - "import LazyWrapper from './_LazyWrapper.js';\nimport LodashWrapper from './_LodashWrapper.js';\nimport copyArray from './_copyArray.js';\n\n/**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\nfunction wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n}\n\nexport default wrapperClone;\n", - "import LazyWrapper from './_LazyWrapper.js';\nimport LodashWrapper from './_LodashWrapper.js';\nimport baseLodash from './_baseLodash.js';\nimport isArray from './isArray.js';\nimport isObjectLike from './isObjectLike.js';\nimport wrapperClone from './_wrapperClone.js';\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 a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\nfunction lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n}\n\n// Ensure wrappers are instances of `baseLodash`.\nlodash.prototype = baseLodash.prototype;\nlodash.prototype.constructor = lodash;\n\nexport default lodash;\n", - "import LazyWrapper from './_LazyWrapper.js';\nimport getData from './_getData.js';\nimport getFuncName from './_getFuncName.js';\nimport lodash from './wrapperLodash.js';\n\n/**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\nfunction isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n}\n\nexport default isLaziable;\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\nexport default shortOut;\n", - "import baseSetData from './_baseSetData.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar setData = shortOut(baseSetData);\n\nexport default setData;\n", - "/** Used to match wrap detail comments. */\nvar reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n/**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\nfunction getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n}\n\nexport default getWrapDetails;\n", - "/** Used to match wrap detail comments. */\nvar reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;\n\n/**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\nfunction insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n}\n\nexport default insertWrapDetails;\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\nexport default constant;\n", - "import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n", - "import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\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\nexport default baseSetToString;\n", - "import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\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\nexport default setToString;\n", - "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee 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 `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\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\nexport default 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\nexport default 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\nexport default strictIndexOf;\n", - "import baseFindIndex from './_baseFindIndex.js';\nimport baseIsNaN from './_baseIsNaN.js';\nimport strictIndexOf from './_strictIndexOf.js';\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\nexport default baseIndexOf;\n", - "import baseIndexOf from './_baseIndexOf.js';\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\nexport default arrayIncludes;\n", - "import arrayEach from './_arrayEach.js';\nimport arrayIncludes from './_arrayIncludes.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n/** Used to associate wrap methods with their bit flags. */\nvar wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n];\n\n/**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\nfunction updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n}\n\nexport default updateWrapDetails;\n", - "import getWrapDetails from './_getWrapDetails.js';\nimport insertWrapDetails from './_insertWrapDetails.js';\nimport setToString from './_setToString.js';\nimport updateWrapDetails from './_updateWrapDetails.js';\n\n/**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\nfunction setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n}\n\nexport default setWrapToString;\n", - "import isLaziable from './_isLaziable.js';\nimport setData from './_setData.js';\nimport setWrapToString from './_setWrapToString.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n}\n\nexport default createRecurry;\n", - "/**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\nfunction getHolder(func) {\n var object = func;\n return object.placeholder;\n}\n\nexport default getHolder;\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\nexport default isIndex;\n", - "import copyArray from './_copyArray.js';\nimport isIndex from './_isIndex.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\nfunction reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n}\n\nexport default reorder;\n", - "/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\nfunction replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n}\n\nexport default replaceHolders;\n", - "import composeArgs from './_composeArgs.js';\nimport composeArgsRight from './_composeArgsRight.js';\nimport countHolders from './_countHolders.js';\nimport createCtor from './_createCtor.js';\nimport createRecurry from './_createRecurry.js';\nimport getHolder from './_getHolder.js';\nimport reorder from './_reorder.js';\nimport replaceHolders from './_replaceHolders.js';\nimport root from './_root.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_ARY_FLAG = 128,\n WRAP_FLIP_FLAG = 512;\n\n/**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n}\n\nexport default createHybrid;\n", - "import apply from './_apply.js';\nimport createCtor from './_createCtor.js';\nimport createHybrid from './_createHybrid.js';\nimport createRecurry from './_createRecurry.js';\nimport getHolder from './_getHolder.js';\nimport replaceHolders from './_replaceHolders.js';\nimport root from './_root.js';\n\n/**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n}\n\nexport default createCurry;\n", - "import apply from './_apply.js';\nimport createCtor from './_createCtor.js';\nimport root from './_root.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n}\n\nexport default createPartial;\n", - "import composeArgs from './_composeArgs.js';\nimport composeArgsRight from './_composeArgsRight.js';\nimport replaceHolders from './_replaceHolders.js';\n\n/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\nfunction mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n}\n\nexport default mergeData;\n", - "import baseSetData from './_baseSetData.js';\nimport createBind from './_createBind.js';\nimport createCurry from './_createCurry.js';\nimport createHybrid from './_createHybrid.js';\nimport createPartial from './_createPartial.js';\nimport getData from './_getData.js';\nimport mergeData from './_mergeData.js';\nimport setData from './_setData.js';\nimport setWrapToString from './_setWrapToString.js';\nimport toInteger from './toInteger.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n}\n\nexport default createWrap;\n", - "import createWrap from './_createWrap.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_ARY_FLAG = 128;\n\n/**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\nfunction ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n}\n\nexport default ary;\n", - "import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\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\nexport default eq;\n", - "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\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 `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n", - "import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n", - "import apply from './_apply.js';\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\nexport default overRest;\n", - "import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\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\nexport default baseRest;\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\nexport default isLength;\n", - "import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\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\nexport default isArrayLike;\n", - "import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\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\nexport default isIterateeCall;\n", - "import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\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\nexport default isPrototype;\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\nexport default baseTimes;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\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\nexport default baseIsArguments;\n", - "import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\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\nexport default isArguments;\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\nexport default stubFalse;\n", - "import root from './_root.js';\nimport stubFalse from './stubFalse.js';\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\nexport default isBuffer;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\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\nexport default 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\nexport default baseUnary;\n", - "import freeGlobal from './_freeGlobal.js';\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\nexport default nodeUtil;\n", - "import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\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\nexport default isTypedArray;\n", - "import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\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\nexport default arrayLikeKeys;\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\nexport default overArg;\n", - "import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n", - "import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\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 `_.keys` 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 baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n", - "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\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 * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n", - "import assignValue from './_assignValue.js';\nimport copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport isArrayLike from './isArrayLike.js';\nimport isPrototype from './_isPrototype.js';\nimport keys from './keys.js';\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 enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nexport default assign;\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\nexport default nativeKeysIn;\n", - "import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\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\nexport default baseKeysIn;\n", - "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\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\nexport default keysIn;\n", - "import copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport keysIn from './keysIn.js';\n\n/**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\nvar assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n});\n\nexport default assignIn;\n", - "import copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport keysIn from './keysIn.js';\n\n/**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n});\n\nexport default assignInWith;\n", - "import copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport keys from './keys.js';\n\n/**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n});\n\nexport default assignWith;\n", - "import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n", - "import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n", - "import nativeCreate from './_nativeCreate.js';\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\nexport default 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\nexport default hashDelete;\n", - "import nativeCreate from './_nativeCreate.js';\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\nexport default hashGet;\n", - "import nativeCreate from './_nativeCreate.js';\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\nexport default hashHas;\n", - "import nativeCreate from './_nativeCreate.js';\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\nexport default hashSet;\n", - "import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\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\nexport default 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\nexport default listCacheClear;\n", - "import eq from './eq.js';\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\nexport default assocIndexOf;\n", - "import assocIndexOf from './_assocIndexOf.js';\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\nexport default listCacheDelete;\n", - "import assocIndexOf from './_assocIndexOf.js';\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\nexport default listCacheGet;\n", - "import assocIndexOf from './_assocIndexOf.js';\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\nexport default listCacheHas;\n", - "import assocIndexOf from './_assocIndexOf.js';\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\nexport default listCacheSet;\n", - "import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\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\nexport default ListCache;\n", - "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n", - "import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\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\nexport default 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\nexport default isKeyable;\n", - "import isKeyable from './_isKeyable.js';\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\nexport default getMapData;\n", - "import getMapData from './_getMapData.js';\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\nexport default mapCacheDelete;\n", - "import getMapData from './_getMapData.js';\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\nexport default mapCacheGet;\n", - "import getMapData from './_getMapData.js';\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\nexport default mapCacheHas;\n", - "import getMapData from './_getMapData.js';\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\nexport default mapCacheSet;\n", - "import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\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\nexport default MapCache;\n", - "import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n", - "import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n", - "import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n", - "import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n", - "import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n", - "import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n", - "import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n", - "import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n", - "import get from './get.js';\n\n/**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\nfunction baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n}\n\nexport default baseAt;\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\nexport default arrayPush;\n", - "import Symbol from './_Symbol.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\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\nexport default isFlattenable;\n", - "import arrayPush from './_arrayPush.js';\nimport isFlattenable from './_isFlattenable.js';\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\nexport default baseFlatten;\n", - "import baseFlatten from './_baseFlatten.js';\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\nexport default flatten;\n", - "import flatten from './flatten.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nexport default flatRest;\n", - "import baseAt from './_baseAt.js';\nimport flatRest from './_flatRest.js';\n\n/**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\nvar at = flatRest(baseAt);\n\nexport default at;\n", - "import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n", - "import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\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\nexport default isPlainObject;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\nimport isPlainObject from './isPlainObject.js';\n\n/** `Object#toString` result references. */\nvar domExcTag = '[object DOMException]',\n errorTag = '[object Error]';\n\n/**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\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 an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\nfunction isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n}\n\nexport default isError;\n", - "import apply from './_apply.js';\nimport baseRest from './_baseRest.js';\nimport isError from './isError.js';\n\n/**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\nvar attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n});\n\nexport default attempt;\n", - "import toInteger from './toInteger.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\nfunction before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n}\n\nexport default before;\n", - "import baseRest from './_baseRest.js';\nimport createWrap from './_createWrap.js';\nimport getHolder from './_getHolder.js';\nimport replaceHolders from './_replaceHolders.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\nvar bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n});\n\n// Assign default placeholders.\nbind.placeholder = {};\n\nexport default bind;\n", - "import arrayEach from './_arrayEach.js';\nimport baseAssignValue from './_baseAssignValue.js';\nimport bind from './bind.js';\nimport flatRest from './_flatRest.js';\nimport toKey from './_toKey.js';\n\n/**\n * Binds methods of an object to the object itself, overwriting the existing\n * method.\n *\n * **Note:** This method doesn't set the \"length\" property of bound functions.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Object} object The object to bind and assign the bound methods to.\n * @param {...(string|string[])} methodNames The object method names to bind.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var view = {\n * 'label': 'docs',\n * 'click': function() {\n * console.log('clicked ' + this.label);\n * }\n * };\n *\n * _.bindAll(view, ['click']);\n * jQuery(element).on('click', view.click);\n * // => Logs 'clicked docs' when clicked.\n */\nvar bindAll = flatRest(function(object, methodNames) {\n arrayEach(methodNames, function(key) {\n key = toKey(key);\n baseAssignValue(object, key, bind(object[key], object));\n });\n return object;\n});\n\nexport default bindAll;\n", - "import baseRest from './_baseRest.js';\nimport createWrap from './_createWrap.js';\nimport getHolder from './_getHolder.js';\nimport replaceHolders from './_replaceHolders.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\nvar bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n});\n\n// Assign default placeholders.\nbindKey.placeholder = {};\n\nexport default bindKey;\n", - "/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nexport default baseSlice;\n", - "import baseSlice from './_baseSlice.js';\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nexport default castSlice;\n", - "/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nexport default hasUnicode;\n", - "/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nexport default asciiToArray;\n", - "/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nexport default unicodeToArray;\n", - "import asciiToArray from './_asciiToArray.js';\nimport hasUnicode from './_hasUnicode.js';\nimport unicodeToArray from './_unicodeToArray.js';\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nexport default stringToArray;\n", - "import castSlice from './_castSlice.js';\nimport hasUnicode from './_hasUnicode.js';\nimport stringToArray from './_stringToArray.js';\nimport toString from './toString.js';\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\nexport default createCaseFirst;\n", - "import createCaseFirst from './_createCaseFirst.js';\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nexport default upperFirst;\n", - "import toString from './toString.js';\nimport upperFirst from './upperFirst.js';\n\n/**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\nfunction capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n}\n\nexport default capitalize;\n", - "/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nexport default arrayReduce;\n", - "/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default basePropertyOf;\n", - "import basePropertyOf from './_basePropertyOf.js';\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n};\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\nexport default deburrLetter;\n", - "import deburrLetter from './_deburrLetter.js';\nimport toString from './toString.js';\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\nexport default deburr;\n", - "/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\nexport default asciiWords;\n", - "/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\nexport default hasUnicodeWord;\n", - "/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\nexport default unicodeWords;\n", - "import asciiWords from './_asciiWords.js';\nimport hasUnicodeWord from './_hasUnicodeWord.js';\nimport toString from './toString.js';\nimport unicodeWords from './_unicodeWords.js';\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nexport default words;\n", - "import arrayReduce from './_arrayReduce.js';\nimport deburr from './deburr.js';\nimport words from './words.js';\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\";\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\nexport default createCompounder;\n", - "import capitalize from './capitalize.js';\nimport createCompounder from './_createCompounder.js';\n\n/**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\nvar camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n});\n\nexport default camelCase;\n", - "import isArray from './isArray.js';\n\n/**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\nfunction castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n}\n\nexport default castArray;\n", - "import root from './_root.js';\nimport toInteger from './toInteger.js';\nimport toNumber from './toNumber.js';\nimport toString from './toString.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsFinite = root.isFinite,\n nativeMin = Math.min;\n\n/**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\nfunction createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n}\n\nexport default createRound;\n", - "import createRound from './_createRound.js';\n\n/**\n * Computes `number` rounded up to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round up.\n * @param {number} [precision=0] The precision to round up to.\n * @returns {number} Returns the rounded up number.\n * @example\n *\n * _.ceil(4.006);\n * // => 5\n *\n * _.ceil(6.004, 2);\n * // => 6.01\n *\n * _.ceil(6040, -2);\n * // => 6100\n */\nvar ceil = createRound('ceil');\n\nexport default ceil;\n", - "import lodash from './wrapperLodash.js';\n\n/**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\nfunction chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n}\n\nexport default chain;\n", - "import baseSlice from './_baseSlice.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toInteger from './toInteger.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\nfunction chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n}\n\nexport default chunk;\n", - "/**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\nfunction baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n}\n\nexport default baseClamp;\n", - "import baseClamp from './_baseClamp.js';\nimport toNumber from './toNumber.js';\n\n/**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\nfunction clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n}\n\nexport default clamp;\n", - "import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n", - "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\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 stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n", - "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n", - "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\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 stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n", - "import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n", - "import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n", - "import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n", - "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n", - "import root from './_root.js';\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 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n", - "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n", - "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n", - "import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n", - "import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n", - "import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n", - "import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n", - "import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n", - "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n", - "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n", - "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n", - "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n", - "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n", - "import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\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 * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n", - "import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n", - "import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n", - "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n", - "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n", - "import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n", - "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n", - "import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\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/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n", - "import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n", - "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n", - "import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\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 map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n", - "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n", - "import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\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 set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n", - "import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\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 genTag = '[object GeneratorFunction]',\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 symbolTag = '[object Symbol]',\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 supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n", - "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n", - "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n", - "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\nfunction cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n}\n\nexport default cloneDeepWith;\n", - "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\nfunction cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n}\n\nexport default cloneWith;\n", - "import LodashWrapper from './_LodashWrapper.js';\n\n/**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\nfunction wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n}\n\nexport default wrapperCommit;\n", - "/**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\nfunction compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default compact;\n", - "import arrayPush from './_arrayPush.js';\nimport baseFlatten from './_baseFlatten.js';\nimport copyArray from './_copyArray.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\nfunction concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n}\n\nexport default concat;\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\nexport default 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 {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n", - "import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\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\nexport default SetCache;\n", - "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\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\nexport default cacheHas;\n", - "import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n", - "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\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\nexport default setToArray;\n", - "import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n", - "import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\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 * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n", - "import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\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 * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n", - "import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n", - "import Stack from './_Stack.js';\nimport baseIsEqual from './_baseIsEqual.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nexport default baseIsMatch;\n", - "import isObject from './isObject.js';\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nexport default isStrictComparable;\n", - "import isStrictComparable from './_isStrictComparable.js';\nimport keys from './keys.js';\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nexport default getMatchData;\n", - "/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nexport default matchesStrictComparable;\n", - "import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nexport default baseMatches;\n", - "/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nexport default baseHasIn;\n", - "import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n", - "import baseHasIn from './_baseHasIn.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nexport default hasIn;\n", - "import baseIsEqual from './_baseIsEqual.js';\nimport get from './get.js';\nimport hasIn from './hasIn.js';\nimport isKey from './_isKey.js';\nimport isStrictComparable from './_isStrictComparable.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\nimport toKey from './_toKey.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nexport default baseMatchesProperty;\n", - "/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default baseProperty;\n", - "import baseGet from './_baseGet.js';\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nexport default basePropertyDeep;\n", - "import baseProperty from './_baseProperty.js';\nimport basePropertyDeep from './_basePropertyDeep.js';\nimport isKey from './_isKey.js';\nimport toKey from './_toKey.js';\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nexport default property;\n", - "import baseMatches from './_baseMatches.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\nimport property from './property.js';\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nexport default baseIteratee;\n", - "import apply from './_apply.js';\nimport arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseRest from './_baseRest.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that iterates over `pairs` and invokes the corresponding\n * function of the first predicate to return truthy. The predicate-function\n * pairs are invoked with the `this` binding and arguments of the created\n * function.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Array} pairs The predicate-function pairs.\n * @returns {Function} Returns the new composite function.\n * @example\n *\n * var func = _.cond([\n * [_.matches({ 'a': 1 }), _.constant('matches A')],\n * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],\n * [_.stubTrue, _.constant('no match')]\n * ]);\n *\n * func({ 'a': 1, 'b': 2 });\n * // => 'matches A'\n *\n * func({ 'a': 0, 'b': 1 });\n * // => 'matches B'\n *\n * func({ 'a': '1', 'b': '2' });\n * // => 'no match'\n */\nfunction cond(pairs) {\n var length = pairs == null ? 0 : pairs.length,\n toIteratee = baseIteratee;\n\n pairs = !length ? [] : arrayMap(pairs, function(pair) {\n if (typeof pair[1] != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return [toIteratee(pair[0]), pair[1]];\n });\n\n return baseRest(function(args) {\n var index = -1;\n while (++index < length) {\n var pair = pairs[index];\n if (apply(pair[0], this, args)) {\n return apply(pair[1], this, args);\n }\n }\n });\n}\n\nexport default cond;\n", - "/**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\nfunction baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n}\n\nexport default baseConformsTo;\n", - "import baseConformsTo from './_baseConformsTo.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n}\n\nexport default baseConforms;\n", - "import baseClone from './_baseClone.js';\nimport baseConforms from './_baseConforms.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that invokes the predicate properties of `source` with\n * the corresponding property values of a given object, returning `true` if\n * all predicates return truthy, else `false`.\n *\n * **Note:** The created function is equivalent to `_.conformsTo` with\n * `source` partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 2, 'b': 1 },\n * { 'a': 1, 'b': 2 }\n * ];\n *\n * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));\n * // => [{ 'a': 1, 'b': 2 }]\n */\nfunction conforms(source) {\n return baseConforms(baseClone(source, CLONE_DEEP_FLAG));\n}\n\nexport default conforms;\n", - "import baseConformsTo from './_baseConformsTo.js';\nimport keys from './keys.js';\n\n/**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\nfunction conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n}\n\nexport default conformsTo;\n", - "/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nexport default arrayAggregator;\n", - "/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n", - "import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n", - "import baseFor from './_baseFor.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nexport default baseForOwn;\n", - "import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n", - "import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n", - "import baseEach from './_baseEach.js';\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nexport default baseAggregator;\n", - "import arrayAggregator from './_arrayAggregator.js';\nimport baseAggregator from './_baseAggregator.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nexport default createAggregator;\n", - "import baseAssignValue from './_baseAssignValue.js';\nimport createAggregator from './_createAggregator.js';\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 object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\nvar countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n});\n\nexport default countBy;\n", - "import baseAssign from './_baseAssign.js';\nimport baseCreate from './_baseCreate.js';\n\n/**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\nfunction create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n}\n\nexport default create;\n", - "import createWrap from './_createWrap.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8;\n\n/**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\nfunction curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n}\n\n// Assign default placeholders.\ncurry.placeholder = {};\n\nexport default curry;\n", - "import createWrap from './_createWrap.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_RIGHT_FLAG = 16;\n\n/**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\nfunction curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n}\n\n// Assign default placeholders.\ncurryRight.placeholder = {};\n\nexport default curryRight;\n", - "import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n", - "import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n", - "/**\n * Checks `value` to determine whether a default value should be returned in\n * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,\n * or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Util\n * @param {*} value The value to check.\n * @param {*} defaultValue The default value.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * _.defaultTo(1, 10);\n * // => 1\n *\n * _.defaultTo(undefined, 10);\n * // => 10\n */\nfunction defaultTo(value, defaultValue) {\n return (value == null || value !== value) ? defaultValue : value;\n}\n\nexport default defaultTo;\n", - "import baseRest from './_baseRest.js';\nimport eq from './eq.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport keysIn from './keysIn.js';\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\nexport default defaults;\n", - "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n", - "import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\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\nexport default isArrayLikeObject;\n", - "/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\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 safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n", - "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n", - "import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n", - "import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n", - "import baseMerge from './_baseMerge.js';\nimport isObject from './isObject.js';\n\n/**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n}\n\nexport default customDefaultsMerge;\n", - "import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nexport default mergeWith;\n", - "import apply from './_apply.js';\nimport baseRest from './_baseRest.js';\nimport customDefaultsMerge from './_customDefaultsMerge.js';\nimport mergeWith from './mergeWith.js';\n\n/**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\nvar defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n});\n\nexport default defaultsDeep;\n", - "/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nexport default baseDelay;\n", - "import baseDelay from './_baseDelay.js';\nimport baseRest from './_baseRest.js';\n\n/**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\nvar defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n});\n\nexport default defer;\n", - "import baseDelay from './_baseDelay.js';\nimport baseRest from './_baseRest.js';\nimport toNumber from './toNumber.js';\n\n/**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\nvar delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n});\n\nexport default delay;\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\nexport default arrayIncludesWith;\n", - "import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport arrayMap from './_arrayMap.js';\nimport baseUnary from './_baseUnary.js';\nimport cacheHas from './_cacheHas.js';\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\nexport default baseDifference;\n", - "import baseDifference from './_baseDifference.js';\nimport baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\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\nexport default difference;\n", - "/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nexport default last;\n", - "import baseDifference from './_baseDifference.js';\nimport baseFlatten from './_baseFlatten.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseRest from './_baseRest.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport last from './last.js';\n\n/**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\nvar differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2))\n : [];\n});\n\nexport default differenceBy;\n", - "import baseDifference from './_baseDifference.js';\nimport baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport last from './last.js';\n\n/**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\nvar differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n});\n\nexport default differenceWith;\n", - "import createMathOperation from './_createMathOperation.js';\n\n/**\n * Divide two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} dividend The first number in a division.\n * @param {number} divisor The second number in a division.\n * @returns {number} Returns the quotient.\n * @example\n *\n * _.divide(6, 4);\n * // => 1.5\n */\nvar divide = createMathOperation(function(dividend, divisor) {\n return dividend / divisor;\n}, 1);\n\nexport default divide;\n", - "import baseSlice from './_baseSlice.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n}\n\nexport default drop;\n", - "import baseSlice from './_baseSlice.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n}\n\nexport default dropRight;\n", - "import baseSlice from './_baseSlice.js';\n\n/**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n}\n\nexport default baseWhile;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseWhile from './_baseWhile.js';\n\n/**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\nfunction dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, baseIteratee(predicate, 3), true, true)\n : [];\n}\n\nexport default dropRightWhile;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseWhile from './_baseWhile.js';\n\n/**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\nfunction dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, baseIteratee(predicate, 3), true)\n : [];\n}\n\nexport default dropWhile;\n", - "import identity from './identity.js';\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nexport default castFunction;\n", - "import arrayEach from './_arrayEach.js';\nimport baseEach from './_baseEach.js';\nimport castFunction from './_castFunction.js';\nimport isArray from './isArray.js';\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nexport default forEach;\n", - "export { default } from './forEach.js'\n", - "/**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee 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 `array`.\n */\nfunction arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEachRight;\n", - "import createBaseFor from './_createBaseFor.js';\n\n/**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseForRight = createBaseFor(true);\n\nexport default baseForRight;\n", - "import baseForRight from './_baseForRight.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n}\n\nexport default baseForOwnRight;\n", - "import baseForOwnRight from './_baseForOwnRight.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEachRight = createBaseEach(baseForOwnRight, true);\n\nexport default baseEachRight;\n", - "import arrayEachRight from './_arrayEachRight.js';\nimport baseEachRight from './_baseEachRight.js';\nimport castFunction from './_castFunction.js';\nimport isArray from './isArray.js';\n\n/**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\nfunction forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, castFunction(iteratee));\n}\n\nexport default forEachRight;\n", - "export { default } from './forEachRight.js'\n", - "import baseClamp from './_baseClamp.js';\nimport baseToString from './_baseToString.js';\nimport toInteger from './toInteger.js';\nimport toString from './toString.js';\n\n/**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\nfunction endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n}\n\nexport default endsWith;\n", - "import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\nfunction baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n}\n\nexport default baseToPairs;\n", - "/**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\nfunction setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n}\n\nexport default setToPairs;\n", - "import baseToPairs from './_baseToPairs.js';\nimport getTag from './_getTag.js';\nimport mapToArray from './_mapToArray.js';\nimport setToPairs from './_setToPairs.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\nfunction createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n}\n\nexport default createToPairs;\n", - "import createToPairs from './_createToPairs.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\nvar toPairs = createToPairs(keys);\n\nexport default toPairs;\n", - "export { default } from './toPairs.js'\n", - "import createToPairs from './_createToPairs.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\nvar toPairsIn = createToPairs(keysIn);\n\nexport default toPairsIn;\n", - "export { default } from './toPairsIn.js'\n", - "import basePropertyOf from './_basePropertyOf.js';\n\n/** Used to map characters to HTML entities. */\nvar htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n\n/**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nvar escapeHtmlChar = basePropertyOf(htmlEscapes);\n\nexport default escapeHtmlChar;\n", - "import escapeHtmlChar from './_escapeHtmlChar.js';\nimport toString from './toString.js';\n\n/** Used to match HTML entities and HTML characters. */\nvar reUnescapedHtml = /[&<>\"']/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\nfunction escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n}\n\nexport default escape;\n", - "import toString from './toString.js';\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 reHasRegExpChar = RegExp(reRegExpChar.source);\n\n/**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\nfunction escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n}\n\nexport default escapeRegExp;\n", - "/**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nexport default arrayEvery;\n", - "import baseEach from './_baseEach.js';\n\n/**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nexport default baseEvery;\n", - "import arrayEvery from './_arrayEvery.js';\nimport baseEvery from './_baseEvery.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nexport default every;\n", - "export { default } from './assignIn.js'\n", - "export { default } from './assignInWith.js'\n", - "import baseClamp from './_baseClamp.js';\nimport toInteger from './toInteger.js';\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is 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 convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\nfunction toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n}\n\nexport default toLength;\n", - "import toInteger from './toInteger.js';\nimport toLength from './toLength.js';\n\n/**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\nfunction baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n}\n\nexport default baseFill;\n", - "import baseFill from './_baseFill.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\nfunction fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n}\n\nexport default fill;\n", - "import baseEach from './_baseEach.js';\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nexport default baseFilter;\n", - "import arrayFilter from './_arrayFilter.js';\nimport baseFilter from './_baseFilter.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\nfunction filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n}\n\nexport default filter;\n", - "import baseIteratee from './_baseIteratee.js';\nimport isArrayLike from './isArrayLike.js';\nimport keys from './keys.js';\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n}\n\nexport default createFind;\n", - "import baseFindIndex from './_baseFindIndex.js';\nimport baseIteratee from './_baseIteratee.js';\nimport toInteger from './toInteger.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nexport default findIndex;\n", - "import createFind from './_createFind.js';\nimport findIndex from './findIndex.js';\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\nexport default find;\n", - "/**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n}\n\nexport default baseFindKey;\n", - "import baseFindKey from './_baseFindKey.js';\nimport baseForOwn from './_baseForOwn.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\nfunction findKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);\n}\n\nexport default findKey;\n", - "import baseFindIndex from './_baseFindIndex.js';\nimport baseIteratee from './_baseIteratee.js';\nimport toInteger from './toInteger.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\nfunction findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index, true);\n}\n\nexport default findLastIndex;\n", - "import createFind from './_createFind.js';\nimport findLastIndex from './findLastIndex.js';\n\n/**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\nvar findLast = createFind(findLastIndex);\n\nexport default findLast;\n", - "import baseFindKey from './_baseFindKey.js';\nimport baseForOwnRight from './_baseForOwnRight.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\nfunction findLastKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight);\n}\n\nexport default findLastKey;\n", - "/**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\nfunction head(array) {\n return (array && array.length) ? array[0] : undefined;\n}\n\nexport default head;\n", - "export { default } from './head.js'\n", - "import baseEach from './_baseEach.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nexport default baseMap;\n", - "import arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseMap from './_baseMap.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n}\n\nexport default map;\n", - "import baseFlatten from './_baseFlatten.js';\nimport map from './map.js';\n\n/**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n}\n\nexport default flatMap;\n", - "import baseFlatten from './_baseFlatten.js';\nimport map from './map.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n}\n\nexport default flatMapDeep;\n", - "import baseFlatten from './_baseFlatten.js';\nimport map from './map.js';\nimport toInteger from './toInteger.js';\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\nfunction flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n}\n\nexport default flatMapDepth;\n", - "import baseFlatten from './_baseFlatten.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nexport default flattenDeep;\n", - "import baseFlatten from './_baseFlatten.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\nfunction flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n}\n\nexport default flattenDepth;\n", - "import createWrap from './_createWrap.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_FLIP_FLAG = 512;\n\n/**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\nfunction flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n}\n\nexport default flip;\n", - "import createRound from './_createRound.js';\n\n/**\n * Computes `number` rounded down to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round down.\n * @param {number} [precision=0] The precision to round down to.\n * @returns {number} Returns the rounded down number.\n * @example\n *\n * _.floor(4.006);\n * // => 4\n *\n * _.floor(0.046, 2);\n * // => 0.04\n *\n * _.floor(4060, -2);\n * // => 4000\n */\nvar floor = createRound('floor');\n\nexport default floor;\n", - "import LodashWrapper from './_LodashWrapper.js';\nimport flatRest from './_flatRest.js';\nimport getData from './_getData.js';\nimport getFuncName from './_getFuncName.js';\nimport isArray from './isArray.js';\nimport isLaziable from './_isLaziable.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\nfunction createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n}\n\nexport default createFlow;\n", - "import createFlow from './_createFlow.js';\n\n/**\n * Creates a function that returns the result of invoking the given functions\n * with the `this` binding of the created function, where each successive\n * invocation is supplied the return value of the previous.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flowRight\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flow([_.add, square]);\n * addSquare(1, 2);\n * // => 9\n */\nvar flow = createFlow();\n\nexport default flow;\n", - "import createFlow from './_createFlow.js';\n\n/**\n * This method is like `_.flow` except that it creates a function that\n * invokes the given functions from right to left.\n *\n * @static\n * @since 3.0.0\n * @memberOf _\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flow\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flowRight([square, _.add]);\n * addSquare(1, 2);\n * // => 9\n */\nvar flowRight = createFlow(true);\n\nexport default flowRight;\n", - "import baseFor from './_baseFor.js';\nimport castFunction from './_castFunction.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\nfunction forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, castFunction(iteratee), keysIn);\n}\n\nexport default forIn;\n", - "import baseForRight from './_baseForRight.js';\nimport castFunction from './_castFunction.js';\nimport keysIn from './keysIn.js';\n\n/**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\nfunction forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, castFunction(iteratee), keysIn);\n}\n\nexport default forInRight;\n", - "import baseForOwn from './_baseForOwn.js';\nimport castFunction from './_castFunction.js';\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n return object && baseForOwn(object, castFunction(iteratee));\n}\n\nexport default forOwn;\n", - "import baseForOwnRight from './_baseForOwnRight.js';\nimport castFunction from './_castFunction.js';\n\n/**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\nfunction forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, castFunction(iteratee));\n}\n\nexport default forOwnRight;\n", - "/**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\nfunction fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n}\n\nexport default fromPairs;\n", - "import arrayFilter from './_arrayFilter.js';\nimport isFunction from './isFunction.js';\n\n/**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\nfunction baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n}\n\nexport default baseFunctions;\n", - "import baseFunctions from './_baseFunctions.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\nfunction functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n}\n\nexport default functions;\n", - "import baseFunctions from './_baseFunctions.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\nfunction functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n}\n\nexport default functionsIn;\n", - "import baseAssignValue from './_baseAssignValue.js';\nimport createAggregator from './_createAggregator.js';\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 object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n});\n\nexport default groupBy;\n", - "/**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\nfunction baseGt(value, other) {\n return value > other;\n}\n\nexport default baseGt;\n", - "import toNumber from './toNumber.js';\n\n/**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\nfunction createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n}\n\nexport default createRelationalOperation;\n", - "import baseGt from './_baseGt.js';\nimport createRelationalOperation from './_createRelationalOperation.js';\n\n/**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\nvar gt = createRelationalOperation(baseGt);\n\nexport default gt;\n", - "import createRelationalOperation from './_createRelationalOperation.js';\n\n/**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\nvar gte = createRelationalOperation(function(value, other) {\n return value >= other;\n});\n\nexport default gte;\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 `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nexport default baseHas;\n", - "import baseHas from './_baseHas.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nexport default has;\n", - "/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\nfunction baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n}\n\nexport default baseInRange;\n", - "import baseInRange from './_baseInRange.js';\nimport toFinite from './toFinite.js';\nimport toNumber from './toNumber.js';\n\n/**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\nfunction inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n}\n\nexport default inRange;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isArray from './isArray.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nexport default isString;\n", - "import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nexport default baseValues;\n", - "import baseValues from './_baseValues.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nexport default values;\n", - "import baseIndexOf from './_baseIndexOf.js';\nimport isArrayLike from './isArrayLike.js';\nimport isString from './isString.js';\nimport toInteger from './toInteger.js';\nimport values from './values.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nexport default includes;\n", - "import baseIndexOf from './_baseIndexOf.js';\nimport toInteger from './toInteger.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\nfunction indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n}\n\nexport default indexOf;\n", - "import baseSlice from './_baseSlice.js';\n\n/**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\nfunction initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n}\n\nexport default initial;\n", - "import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport arrayMap from './_arrayMap.js';\nimport baseUnary from './_baseUnary.js';\nimport cacheHas from './_cacheHas.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays 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 array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseIntersection;\n", - "import isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nexport default castArrayLikeObject;\n", - "import arrayMap from './_arrayMap.js';\nimport baseIntersection from './_baseIntersection.js';\nimport baseRest from './_baseRest.js';\nimport castArrayLikeObject from './_castArrayLikeObject.js';\n\n/**\n * Creates an array of unique values that are included in all 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 * @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 intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nexport default intersection;\n", - "import arrayMap from './_arrayMap.js';\nimport baseIntersection from './_baseIntersection.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseRest from './_baseRest.js';\nimport castArrayLikeObject from './_castArrayLikeObject.js';\nimport last from './last.js';\n\n/**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\nvar intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, baseIteratee(iteratee, 2))\n : [];\n});\n\nexport default intersectionBy;\n", - "import arrayMap from './_arrayMap.js';\nimport baseIntersection from './_baseIntersection.js';\nimport baseRest from './_baseRest.js';\nimport castArrayLikeObject from './_castArrayLikeObject.js';\nimport last from './last.js';\n\n/**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\nvar intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n});\n\nexport default intersectionWith;\n", - "import baseForOwn from './_baseForOwn.js';\n\n/**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n}\n\nexport default baseInverter;\n", - "import baseInverter from './_baseInverter.js';\n\n/**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\nfunction createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n}\n\nexport default createInverter;\n", - "import constant from './constant.js';\nimport createInverter from './_createInverter.js';\nimport identity from './identity.js';\n\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 * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\nvar invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n}, constant(identity));\n\nexport default invert;\n", - "import baseIteratee from './_baseIteratee.js';\nimport createInverter from './_createInverter.js';\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/**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\nvar invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n}, baseIteratee);\n\nexport default invertBy;\n", - "import baseGet from './_baseGet.js';\nimport baseSlice from './_baseSlice.js';\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nexport default parent;\n", - "import apply from './_apply.js';\nimport castPath from './_castPath.js';\nimport last from './last.js';\nimport parent from './_parent.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\nfunction baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n}\n\nexport default baseInvoke;\n", - "import baseInvoke from './_baseInvoke.js';\nimport baseRest from './_baseRest.js';\n\n/**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\nvar invoke = baseRest(baseInvoke);\n\nexport default invoke;\n", - "import apply from './_apply.js';\nimport baseEach from './_baseEach.js';\nimport baseInvoke from './_baseInvoke.js';\nimport baseRest from './_baseRest.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\nvar invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n});\n\nexport default invokeMap;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\nvar arrayBufferTag = '[object ArrayBuffer]';\n\n/**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\nfunction baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n}\n\nexport default baseIsArrayBuffer;\n", - "import baseIsArrayBuffer from './_baseIsArrayBuffer.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer;\n\n/**\n * Checks if `value` is classified as an `ArrayBuffer` object.\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 an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\nvar isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\nexport default isArrayBuffer;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]';\n\n/**\n * Checks if `value` is classified as a boolean primitive or 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 boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\nfunction isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n}\n\nexport default isBoolean;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar dateTag = '[object Date]';\n\n/**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\nfunction baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n}\n\nexport default baseIsDate;\n", - "import baseIsDate from './_baseIsDate.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsDate = nodeUtil && nodeUtil.isDate;\n\n/**\n * Checks if `value` is classified as a `Date` 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 date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\nvar isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\nexport default isDate;\n", - "import isObjectLike from './isObjectLike.js';\nimport isPlainObject from './isPlainObject.js';\n\n/**\n * Checks if `value` is likely a DOM element.\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 DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\nfunction isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n}\n\nexport default isElement;\n", - "import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLike from './isArrayLike.js';\nimport isBuffer from './isBuffer.js';\nimport isPrototype from './_isPrototype.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\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 `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\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 empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default isEmpty;\n", - "import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.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 * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n", - "import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\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 * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\nfunction isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n}\n\nexport default isEqualWith;\n", - "import root from './_root.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsFinite = root.isFinite;\n\n/**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\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 finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\nfunction isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n}\n\nexport default isFinite;\n", - "import toInteger from './toInteger.js';\n\n/**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\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 integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\nfunction isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n}\n\nexport default isInteger;\n", - "import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\n\n/**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\nfunction isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n}\n\nexport default isMatch;\n", - "import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\n\n/**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\nfunction isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n}\n\nexport default isMatchWith;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\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 number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nexport default isNumber;\n", - "import isNumber from './isNumber.js';\n\n/**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\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 `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\nfunction isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n}\n\nexport default isNaN;\n", - "import coreJsData from './_coreJsData.js';\nimport isFunction from './isFunction.js';\nimport stubFalse from './stubFalse.js';\n\n/**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\nvar isMaskable = coreJsData ? isFunction : stubFalse;\n\nexport default isMaskable;\n", - "import baseIsNative from './_baseIsNative.js';\nimport isMaskable from './_isMaskable.js';\n\n/** Error message constants. */\nvar CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.';\n\n/**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\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 native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n}\n\nexport default isNative;\n", - "/**\n * Checks if `value` is `null` or `undefined`.\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 nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nexport default isNil;\n", - "/**\n * Checks if `value` is `null`.\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 `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\nfunction isNull(value) {\n return value === null;\n}\n\nexport default isNull;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar regexpTag = '[object RegExp]';\n\n/**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\nfunction baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n}\n\nexport default baseIsRegExp;\n", - "import baseIsRegExp from './_baseIsRegExp.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;\n\n/**\n * Checks if `value` is classified as a `RegExp` 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 regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\nvar isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\nexport default isRegExp;\n", - "import isInteger from './isInteger.js';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\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 safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\nfunction isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isSafeInteger;\n", - "/**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nexport default isUndefined;\n", - "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar weakMapTag = '[object WeakMap]';\n\n/**\n * Checks if `value` is classified as a `WeakMap` object.\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 weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\nfunction isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n}\n\nexport default isWeakMap;\n", - "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar weakSetTag = '[object WeakSet]';\n\n/**\n * Checks if `value` is classified as a `WeakSet` object.\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 weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\nfunction isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n}\n\nexport default isWeakSet;\n", - "import baseClone from './_baseClone.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\nfunction iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n}\n\nexport default iteratee;\n", - "/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeJoin = arrayProto.join;\n\n/**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\nfunction join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n}\n\nexport default join;\n", - "import createCompounder from './_createCompounder.js';\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nexport default kebabCase;\n", - "import baseAssignValue from './_baseAssignValue.js';\nimport createAggregator from './_createAggregator.js';\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\nvar keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n});\n\nexport default keyBy;\n", - "/**\n * A specialized version of `_.lastIndexOf` 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 strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n}\n\nexport default strictLastIndexOf;\n", - "import baseFindIndex from './_baseFindIndex.js';\nimport baseIsNaN from './_baseIsNaN.js';\nimport strictLastIndexOf from './_strictLastIndexOf.js';\nimport toInteger from './toInteger.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\nfunction lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n}\n\nexport default lastIndexOf;\n", - "import createCompounder from './_createCompounder.js';\n\n/**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\nvar lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n});\n\nexport default lowerCase;\n", - "import createCaseFirst from './_createCaseFirst.js';\n\n/**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\nvar lowerFirst = createCaseFirst('toLowerCase');\n\nexport default lowerFirst;\n", - "/**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\nfunction baseLt(value, other) {\n return value < other;\n}\n\nexport default baseLt;\n", - "import baseLt from './_baseLt.js';\nimport createRelationalOperation from './_createRelationalOperation.js';\n\n/**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\nvar lt = createRelationalOperation(baseLt);\n\nexport default lt;\n", - "import createRelationalOperation from './_createRelationalOperation.js';\n\n/**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\nvar lte = createRelationalOperation(function(value, other) {\n return value <= other;\n});\n\nexport default lte;\n", - "import baseAssignValue from './_baseAssignValue.js';\nimport baseForOwn from './_baseForOwn.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\nfunction mapKeys(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n}\n\nexport default mapKeys;\n", - "import baseAssignValue from './_baseAssignValue.js';\nimport baseForOwn from './_baseForOwn.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\nfunction mapValues(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n}\n\nexport default mapValues;\n", - "import baseClone from './_baseClone.js';\nimport baseMatches from './_baseMatches.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that performs a partial deep comparison between a given\n * object and `source`, returning `true` if the given object has equivalent\n * property values, else `false`.\n *\n * **Note:** The created function is equivalent to `_.isMatch` with `source`\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * **Note:** Multiple values can be checked by combining several matchers\n * using `_.overSome`\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));\n * // => [{ 'a': 4, 'b': 5, 'c': 6 }]\n *\n * // Checking for several possible values\n * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));\n * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]\n */\nfunction matches(source) {\n return baseMatches(baseClone(source, CLONE_DEEP_FLAG));\n}\n\nexport default matches;\n", - "import baseClone from './_baseClone.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that performs a partial deep comparison between the\n * value at `path` of a given object to `srcValue`, returning `true` if the\n * object value is equivalent, else `false`.\n *\n * **Note:** Partial comparisons will match empty array and empty object\n * `srcValue` values against any array or object value, respectively. See\n * `_.isEqual` for a list of supported value comparisons.\n *\n * **Note:** Multiple values can be checked by combining several matchers\n * using `_.overSome`\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.find(objects, _.matchesProperty('a', 4));\n * // => { 'a': 4, 'b': 5, 'c': 6 }\n *\n * // Checking for several possible values\n * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));\n * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]\n */\nfunction matchesProperty(path, srcValue) {\n return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));\n}\n\nexport default matchesProperty;\n", - "import isSymbol from './isSymbol.js';\n\n/**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\nfunction baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n}\n\nexport default baseExtremum;\n", - "import baseExtremum from './_baseExtremum.js';\nimport baseGt from './_baseGt.js';\nimport identity from './identity.js';\n\n/**\n * Computes the maximum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => undefined\n */\nfunction max(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseGt)\n : undefined;\n}\n\nexport default max;\n", - "import baseExtremum from './_baseExtremum.js';\nimport baseGt from './_baseGt.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/**\n * This method is like `_.max` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\nfunction maxBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, baseIteratee(iteratee, 2), baseGt)\n : undefined;\n}\n\nexport default maxBy;\n", - "/**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\nfunction baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n}\n\nexport default baseSum;\n", - "import baseSum from './_baseSum.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\nfunction baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n}\n\nexport default baseMean;\n", - "import baseMean from './_baseMean.js';\nimport identity from './identity.js';\n\n/**\n * Computes the mean of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the mean.\n * @example\n *\n * _.mean([4, 2, 8, 6]);\n * // => 5\n */\nfunction mean(array) {\n return baseMean(array, identity);\n}\n\nexport default mean;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseMean from './_baseMean.js';\n\n/**\n * This method is like `_.mean` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be averaged.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the mean.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.meanBy(objects, function(o) { return o.n; });\n * // => 5\n *\n * // The `_.property` iteratee shorthand.\n * _.meanBy(objects, 'n');\n * // => 5\n */\nfunction meanBy(array, iteratee) {\n return baseMean(array, baseIteratee(iteratee, 2));\n}\n\nexport default meanBy;\n", - "import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n", - "import baseInvoke from './_baseInvoke.js';\nimport baseRest from './_baseRest.js';\n\n/**\n * Creates a function that invokes the method at `path` of a given object.\n * Any additional arguments are provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': _.constant(2) } },\n * { 'a': { 'b': _.constant(1) } }\n * ];\n *\n * _.map(objects, _.method('a.b'));\n * // => [2, 1]\n *\n * _.map(objects, _.method(['a', 'b']));\n * // => [2, 1]\n */\nvar method = baseRest(function(path, args) {\n return function(object) {\n return baseInvoke(object, path, args);\n };\n});\n\nexport default method;\n", - "import baseInvoke from './_baseInvoke.js';\nimport baseRest from './_baseRest.js';\n\n/**\n * The opposite of `_.method`; this method creates a function that invokes\n * the method at a given path of `object`. Any additional arguments are\n * provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Object} object The object to query.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var array = _.times(3, _.constant),\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.methodOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.methodOf(object));\n * // => [2, 0]\n */\nvar methodOf = baseRest(function(object, args) {\n return function(path) {\n return baseInvoke(object, path, args);\n };\n});\n\nexport default methodOf;\n", - "import baseExtremum from './_baseExtremum.js';\nimport baseLt from './_baseLt.js';\nimport identity from './identity.js';\n\n/**\n * Computes the minimum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => undefined\n */\nfunction min(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseLt)\n : undefined;\n}\n\nexport default min;\n", - "import baseExtremum from './_baseExtremum.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseLt from './_baseLt.js';\n\n/**\n * This method is like `_.min` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * // The `_.property` iteratee shorthand.\n * _.minBy(objects, 'n');\n * // => { 'n': 1 }\n */\nfunction minBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, baseIteratee(iteratee, 2), baseLt)\n : undefined;\n}\n\nexport default minBy;\n", - "import arrayEach from './_arrayEach.js';\nimport arrayPush from './_arrayPush.js';\nimport baseFunctions from './_baseFunctions.js';\nimport copyArray from './_copyArray.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport keys from './keys.js';\n\n/**\n * Adds all own enumerable string keyed function properties of a source\n * object to the destination object. If `object` is a function, then methods\n * are added to its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.chain=true] Specify whether mixins are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\nfunction mixin(object, source, options) {\n var props = keys(source),\n methodNames = baseFunctions(source, props);\n\n var chain = !(isObject(options) && 'chain' in options) || !!options.chain,\n isFunc = isFunction(object);\n\n arrayEach(methodNames, function(methodName) {\n var func = source[methodName];\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = copyArray(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }\n });\n\n return object;\n}\n\nexport default mixin;\n", - "import createMathOperation from './_createMathOperation.js';\n\n/**\n * Multiply two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} multiplier The first number in a multiplication.\n * @param {number} multiplicand The second number in a multiplication.\n * @returns {number} Returns the product.\n * @example\n *\n * _.multiply(6, 4);\n * // => 24\n */\nvar multiply = createMathOperation(function(multiplier, multiplicand) {\n return multiplier * multiplicand;\n}, 1);\n\nexport default multiply;\n", - "/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\nfunction negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n}\n\nexport default negate;\n", - "/**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n}\n\nexport default iteratorToArray;\n", - "import Symbol from './_Symbol.js';\nimport copyArray from './_copyArray.js';\nimport getTag from './_getTag.js';\nimport isArrayLike from './isArrayLike.js';\nimport isString from './isString.js';\nimport iteratorToArray from './_iteratorToArray.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\nimport stringToArray from './_stringToArray.js';\nimport values from './values.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Built-in value references. */\nvar symIterator = Symbol ? Symbol.iterator : undefined;\n\n/**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\nfunction toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n}\n\nexport default toArray;\n", - "import toArray from './toArray.js';\n\n/**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\nfunction wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n}\n\nexport default wrapperNext;\n", - "import isIndex from './_isIndex.js';\n\n/**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\nfunction baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n}\n\nexport default baseNth;\n", - "import baseNth from './_baseNth.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\nfunction nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n}\n\nexport default nth;\n", - "import baseNth from './_baseNth.js';\nimport baseRest from './_baseRest.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Creates a function that gets the argument at index `n`. If `n` is negative,\n * the nth argument from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [n=0] The index of the argument to return.\n * @returns {Function} Returns the new pass-thru function.\n * @example\n *\n * var func = _.nthArg(1);\n * func('a', 'b', 'c', 'd');\n * // => 'b'\n *\n * var func = _.nthArg(-2);\n * func('a', 'b', 'c', 'd');\n * // => 'c'\n */\nfunction nthArg(n) {\n n = toInteger(n);\n return baseRest(function(args) {\n return baseNth(args, n);\n });\n}\n\nexport default nthArg;\n", - "import castPath from './_castPath.js';\nimport last from './last.js';\nimport parent from './_parent.js';\nimport toKey from './_toKey.js';\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 `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n\n // Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg\n var index = -1,\n length = path.length;\n\n if (!length) {\n return true;\n }\n\n var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');\n\n while (++index < length) {\n var key = path[index];\n\n // skip non-string keys (e.g., Symbols, numbers)\n if (typeof key !== 'string') {\n continue;\n }\n\n // Always block \"__proto__\" anywhere in the path if it's not expected\n if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {\n return false;\n }\n\n // Block \"constructor.prototype\" chains\n if (key === 'constructor' &&\n (index + 1) < length &&\n typeof path[index + 1] === 'string' &&\n path[index + 1] === 'prototype') {\n\n // Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')\n if (isRootPrimitive && index === 0) {\n continue;\n }\n\n return false;\n }\n }\n\n var obj = parent(object, path);\n return obj == null || delete obj[toKey(last(path))];\n}\n\nexport default baseUnset;\n", - "import isPlainObject from './isPlainObject.js';\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nexport default customOmitClone;\n", - "import arrayMap from './_arrayMap.js';\nimport baseClone from './_baseClone.js';\nimport baseUnset from './_baseUnset.js';\nimport castPath from './_castPath.js';\nimport copyObject from './_copyObject.js';\nimport customOmitClone from './_customOmitClone.js';\nimport flatRest from './_flatRest.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n});\n\nexport default omit;\n", - "import assignValue from './_assignValue.js';\nimport castPath from './_castPath.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nexport default baseSet;\n", - "import baseGet from './_baseGet.js';\nimport baseSet from './_baseSet.js';\nimport castPath from './_castPath.js';\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nexport default basePickBy;\n", - "import arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport basePickBy from './_basePickBy.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n}\n\nexport default pickBy;\n", - "import baseIteratee from './_baseIteratee.js';\nimport negate from './negate.js';\nimport pickBy from './pickBy.js';\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\nfunction omitBy(object, predicate) {\n return pickBy(object, negate(baseIteratee(predicate)));\n}\n\nexport default omitBy;\n", - "import before from './before.js';\n\n/**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\nfunction once(func) {\n return before(2, func);\n}\n\nexport default once;\n", - "/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nexport default baseSortBy;\n", - "import isSymbol from './isSymbol.js';\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nexport default compareAscending;\n", - "import compareAscending from './_compareAscending.js';\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nexport default compareMultiple;\n", - "import arrayMap from './_arrayMap.js';\nimport baseGet from './_baseGet.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseMap from './_baseMap.js';\nimport baseSortBy from './_baseSortBy.js';\nimport baseUnary from './_baseUnary.js';\nimport compareMultiple from './_compareMultiple.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nexport default baseOrderBy;\n", - "import baseOrderBy from './_baseOrderBy.js';\nimport isArray from './isArray.js';\n\n/**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\nfunction orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n}\n\nexport default orderBy;\n", - "import apply from './_apply.js';\nimport arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseRest from './_baseRest.js';\nimport baseUnary from './_baseUnary.js';\nimport flatRest from './_flatRest.js';\n\n/**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\nfunction createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n}\n\nexport default createOver;\n", - "import arrayMap from './_arrayMap.js';\nimport createOver from './_createOver.js';\n\n/**\n * Creates a function that invokes `iteratees` with the arguments it receives\n * and returns their results.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to invoke.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.over([Math.max, Math.min]);\n *\n * func(1, 2, 3, 4);\n * // => [4, 1]\n */\nvar over = createOver(arrayMap);\n\nexport default over;\n", - "import baseRest from './_baseRest.js';\n\n/**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nvar castRest = baseRest;\n\nexport default castRest;\n", - "import apply from './_apply.js';\nimport arrayMap from './_arrayMap.js';\nimport baseFlatten from './_baseFlatten.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseRest from './_baseRest.js';\nimport baseUnary from './_baseUnary.js';\nimport castRest from './_castRest.js';\nimport isArray from './isArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\nvar overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(baseIteratee))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(baseIteratee));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n});\n\nexport default overArgs;\n", - "import arrayEvery from './_arrayEvery.js';\nimport createOver from './_createOver.js';\n\n/**\n * Creates a function that checks if **all** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * Following shorthands are possible for providing predicates.\n * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.\n * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overEvery([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => false\n *\n * func(NaN);\n * // => false\n */\nvar overEvery = createOver(arrayEvery);\n\nexport default overEvery;\n", - "import arraySome from './_arraySome.js';\nimport createOver from './_createOver.js';\n\n/**\n * Creates a function that checks if **any** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * Following shorthands are possible for providing predicates.\n * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.\n * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overSome([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => true\n *\n * func(NaN);\n * // => false\n *\n * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])\n * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])\n */\nvar overSome = createOver(arraySome);\n\nexport default overSome;\n", - "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor;\n\n/**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\nfunction baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n}\n\nexport default baseRepeat;\n", - "import baseProperty from './_baseProperty.js';\n\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nvar asciiSize = baseProperty('length');\n\nexport default asciiSize;\n", - "/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nfunction unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n}\n\nexport default unicodeSize;\n", - "import asciiSize from './_asciiSize.js';\nimport hasUnicode from './_hasUnicode.js';\nimport unicodeSize from './_unicodeSize.js';\n\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\nfunction stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n}\n\nexport default stringSize;\n", - "import baseRepeat from './_baseRepeat.js';\nimport baseToString from './_baseToString.js';\nimport castSlice from './_castSlice.js';\nimport hasUnicode from './_hasUnicode.js';\nimport stringSize from './_stringSize.js';\nimport stringToArray from './_stringToArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil;\n\n/**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\nfunction createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n}\n\nexport default createPadding;\n", - "import createPadding from './_createPadding.js';\nimport stringSize from './_stringSize.js';\nimport toInteger from './toInteger.js';\nimport toString from './toString.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeFloor = Math.floor;\n\n/**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\nfunction pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n}\n\nexport default pad;\n", - "import createPadding from './_createPadding.js';\nimport stringSize from './_stringSize.js';\nimport toInteger from './toInteger.js';\nimport toString from './toString.js';\n\n/**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\nfunction padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n}\n\nexport default padEnd;\n", - "import createPadding from './_createPadding.js';\nimport stringSize from './_stringSize.js';\nimport toInteger from './toInteger.js';\nimport toString from './toString.js';\n\n/**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\nfunction padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n}\n\nexport default padStart;\n", - "import root from './_root.js';\nimport toString from './toString.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeParseInt = root.parseInt;\n\n/**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\nfunction parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n}\n\nexport default parseInt;\n", - "import baseRest from './_baseRest.js';\nimport createWrap from './_createWrap.js';\nimport getHolder from './_getHolder.js';\nimport replaceHolders from './_replaceHolders.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\nvar partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n});\n\n// Assign default placeholders.\npartial.placeholder = {};\n\nexport default partial;\n", - "import baseRest from './_baseRest.js';\nimport createWrap from './_createWrap.js';\nimport getHolder from './_getHolder.js';\nimport replaceHolders from './_replaceHolders.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\nvar partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n});\n\n// Assign default placeholders.\npartialRight.placeholder = {};\n\nexport default partialRight;\n", - "import createAggregator from './_createAggregator.js';\n\n/**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\nvar partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n}, function() { return [[], []]; });\n\nexport default partition;\n", - "import basePickBy from './_basePickBy.js';\nimport hasIn from './hasIn.js';\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nexport default basePick;\n", - "import basePick from './_basePick.js';\nimport flatRest from './_flatRest.js';\n\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\nvar pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n});\n\nexport default pick;\n", - "import baseLodash from './_baseLodash.js';\nimport wrapperClone from './_wrapperClone.js';\n\n/**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\nfunction wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n}\n\nexport default wrapperPlant;\n", - "import baseGet from './_baseGet.js';\n\n/**\n * The opposite of `_.property`; this method creates a function that returns\n * the value at a given path of `object`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var array = [0, 1, 2],\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.propertyOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n * // => [2, 0]\n */\nfunction propertyOf(object) {\n return function(path) {\n return object == null ? undefined : baseGet(object, path);\n };\n}\n\nexport default propertyOf;\n", - "/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\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 * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseIndexOfWith;\n", - "import arrayMap from './_arrayMap.js';\nimport baseIndexOf from './_baseIndexOf.js';\nimport baseIndexOfWith from './_baseIndexOfWith.js';\nimport baseUnary from './_baseUnary.js';\nimport copyArray from './_copyArray.js';\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 * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n}\n\nexport default basePullAll;\n", - "import basePullAll from './_basePullAll.js';\n\n/**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\nfunction pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n}\n\nexport default pullAll;\n", - "import baseRest from './_baseRest.js';\nimport pullAll from './pullAll.js';\n\n/**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\nvar pull = baseRest(pullAll);\n\nexport default pull;\n", - "import baseIteratee from './_baseIteratee.js';\nimport basePullAll from './_basePullAll.js';\n\n/**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\nfunction pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, baseIteratee(iteratee, 2))\n : array;\n}\n\nexport default pullAllBy;\n", - "import basePullAll from './_basePullAll.js';\n\n/**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\nfunction pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n}\n\nexport default pullAllWith;\n", - "import baseUnset from './_baseUnset.js';\nimport isIndex from './_isIndex.js';\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 * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n}\n\nexport default basePullAt;\n", - "import arrayMap from './_arrayMap.js';\nimport baseAt from './_baseAt.js';\nimport basePullAt from './_basePullAt.js';\nimport compareAscending from './_compareAscending.js';\nimport flatRest from './_flatRest.js';\nimport isIndex from './_isIndex.js';\n\n/**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\nvar pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n});\n\nexport default pullAt;\n", - "/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor,\n nativeRandom = Math.random;\n\n/**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\nfunction baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n}\n\nexport default baseRandom;\n", - "import baseRandom from './_baseRandom.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toFinite from './toFinite.js';\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseFloat = parseFloat;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min,\n nativeRandom = Math.random;\n\n/**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\nfunction random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n}\n\nexport default random;\n", - "/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nexport default baseRange;\n", - "import baseRange from './_baseRange.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toFinite from './toFinite.js';\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nexport default createRange;\n", - "import createRange from './_createRange.js';\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nexport default range;\n", - "import createRange from './_createRange.js';\n\n/**\n * This method is like `_.range` except that it populates values in\n * descending order.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.range\n * @example\n *\n * _.rangeRight(4);\n * // => [3, 2, 1, 0]\n *\n * _.rangeRight(-4);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 5);\n * // => [4, 3, 2, 1]\n *\n * _.rangeRight(0, 20, 5);\n * // => [15, 10, 5, 0]\n *\n * _.rangeRight(0, -4, -1);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.rangeRight(0);\n * // => []\n */\nvar rangeRight = createRange(true);\n\nexport default rangeRight;\n", - "import createWrap from './_createWrap.js';\nimport flatRest from './_flatRest.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\nvar rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n});\n\nexport default rearg;\n", - "/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nexport default baseReduce;\n", - "import arrayReduce from './_arrayReduce.js';\nimport baseEach from './_baseEach.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseReduce from './_baseReduce.js';\nimport isArray from './isArray.js';\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nexport default reduce;\n", - "/**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n}\n\nexport default arrayReduceRight;\n", - "import arrayReduceRight from './_arrayReduceRight.js';\nimport baseEachRight from './_baseEachRight.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseReduce from './_baseReduce.js';\nimport isArray from './isArray.js';\n\n/**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\nfunction reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n}\n\nexport default reduceRight;\n", - "import arrayFilter from './_arrayFilter.js';\nimport baseFilter from './_baseFilter.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\nimport negate from './negate.js';\n\n/**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\nfunction reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(baseIteratee(predicate, 3)));\n}\n\nexport default reject;\n", - "import baseIteratee from './_baseIteratee.js';\nimport basePullAt from './_basePullAt.js';\n\n/**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\nfunction remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = baseIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n}\n\nexport default remove;\n", - "import baseRepeat from './_baseRepeat.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toInteger from './toInteger.js';\nimport toString from './toString.js';\n\n/**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\nfunction repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n}\n\nexport default repeat;\n", - "import toString from './toString.js';\n\n/**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\nfunction replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n}\n\nexport default replace;\n", - "import baseRest from './_baseRest.js';\nimport toInteger from './toInteger.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\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 * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n}\n\nexport default rest;\n", - "import castPath from './_castPath.js';\nimport isFunction from './isFunction.js';\nimport toKey from './_toKey.js';\n\n/**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\nfunction result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n}\n\nexport default result;\n", - "/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeReverse = arrayProto.reverse;\n\n/**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\nfunction reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n}\n\nexport default reverse;\n", - "import createRound from './_createRound.js';\n\n/**\n * Computes `number` rounded to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round.\n * @param {number} [precision=0] The precision to round to.\n * @returns {number} Returns the rounded number.\n * @example\n *\n * _.round(4.006);\n * // => 4\n *\n * _.round(4.006, 2);\n * // => 4.01\n *\n * _.round(4060, -2);\n * // => 4100\n */\nvar round = createRound('round');\n\nexport default round;\n", - "import baseRandom from './_baseRandom.js';\n\n/**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\nfunction arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n}\n\nexport default arraySample;\n", - "import arraySample from './_arraySample.js';\nimport values from './values.js';\n\n/**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\nfunction baseSample(collection) {\n return arraySample(values(collection));\n}\n\nexport default baseSample;\n", - "import arraySample from './_arraySample.js';\nimport baseSample from './_baseSample.js';\nimport isArray from './isArray.js';\n\n/**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\nfunction sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n}\n\nexport default sample;\n", - "import baseRandom from './_baseRandom.js';\n\n/**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\nfunction shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n}\n\nexport default shuffleSelf;\n", - "import baseClamp from './_baseClamp.js';\nimport copyArray from './_copyArray.js';\nimport shuffleSelf from './_shuffleSelf.js';\n\n/**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\nfunction arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n}\n\nexport default arraySampleSize;\n", - "import baseClamp from './_baseClamp.js';\nimport shuffleSelf from './_shuffleSelf.js';\nimport values from './values.js';\n\n/**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\nfunction baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n}\n\nexport default baseSampleSize;\n", - "import arraySampleSize from './_arraySampleSize.js';\nimport baseSampleSize from './_baseSampleSize.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\nfunction sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n}\n\nexport default sampleSize;\n", - "import baseSet from './_baseSet.js';\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nexport default set;\n", - "import baseSet from './_baseSet.js';\n\n/**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\nfunction setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n}\n\nexport default setWith;\n", - "import copyArray from './_copyArray.js';\nimport shuffleSelf from './_shuffleSelf.js';\n\n/**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\nfunction arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n}\n\nexport default arrayShuffle;\n", - "import shuffleSelf from './_shuffleSelf.js';\nimport values from './values.js';\n\n/**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\nfunction baseShuffle(collection) {\n return shuffleSelf(values(collection));\n}\n\nexport default baseShuffle;\n", - "import arrayShuffle from './_arrayShuffle.js';\nimport baseShuffle from './_baseShuffle.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\nfunction shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n}\n\nexport default shuffle;\n", - "import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArrayLike from './isArrayLike.js';\nimport isString from './isString.js';\nimport stringSize from './_stringSize.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\nfunction size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n}\n\nexport default size;\n", - "import baseSlice from './_baseSlice.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n}\n\nexport default slice;\n", - "import createCompounder from './_createCompounder.js';\n\n/**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\nvar snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n});\n\nexport default snakeCase;\n", - "import baseEach from './_baseEach.js';\n\n/**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nexport default baseSome;\n", - "import arraySome from './_arraySome.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseSome from './_baseSome.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nexport default some;\n", - "import baseFlatten from './_baseFlatten.js';\nimport baseOrderBy from './_baseOrderBy.js';\nimport baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nexport default sortBy;\n", - "import isSymbol from './isSymbol.js';\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor,\n nativeMin = Math.min;\n\n/**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\nfunction baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n}\n\nexport default baseSortedIndexBy;\n", - "import baseSortedIndexBy from './_baseSortedIndexBy.js';\nimport identity from './identity.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n/**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\nfunction baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n}\n\nexport default baseSortedIndex;\n", - "import baseSortedIndex from './_baseSortedIndex.js';\n\n/**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\nfunction sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n}\n\nexport default sortedIndex;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseSortedIndexBy from './_baseSortedIndexBy.js';\n\n/**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\nfunction sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2));\n}\n\nexport default sortedIndexBy;\n", - "import baseSortedIndex from './_baseSortedIndex.js';\nimport eq from './eq.js';\n\n/**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\nfunction sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default sortedIndexOf;\n", - "import baseSortedIndex from './_baseSortedIndex.js';\n\n/**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\nfunction sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n}\n\nexport default sortedLastIndex;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseSortedIndexBy from './_baseSortedIndexBy.js';\n\n/**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\nfunction sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2), true);\n}\n\nexport default sortedLastIndexBy;\n", - "import baseSortedIndex from './_baseSortedIndex.js';\nimport eq from './eq.js';\n\n/**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\nfunction sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default sortedLastIndexOf;\n", - "import eq from './eq.js';\n\n/**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * 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 * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n}\n\nexport default baseSortedUniq;\n", - "import baseSortedUniq from './_baseSortedUniq.js';\n\n/**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\nfunction sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n}\n\nexport default sortedUniq;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseSortedUniq from './_baseSortedUniq.js';\n\n/**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\nfunction sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, baseIteratee(iteratee, 2))\n : [];\n}\n\nexport default sortedUniqBy;\n", - "import baseToString from './_baseToString.js';\nimport castSlice from './_castSlice.js';\nimport hasUnicode from './_hasUnicode.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport isRegExp from './isRegExp.js';\nimport stringToArray from './_stringToArray.js';\nimport toString from './toString.js';\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\nfunction split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n}\n\nexport default split;\n", - "import apply from './_apply.js';\nimport arrayPush from './_arrayPush.js';\nimport baseRest from './_baseRest.js';\nimport castSlice from './_castSlice.js';\nimport toInteger from './toInteger.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\nfunction spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n}\n\nexport default spread;\n", - "import createCompounder from './_createCompounder.js';\nimport upperFirst from './upperFirst.js';\n\n/**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\nvar startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n});\n\nexport default startCase;\n", - "import baseClamp from './_baseClamp.js';\nimport baseToString from './_baseToString.js';\nimport toInteger from './toInteger.js';\nimport toString from './toString.js';\n\n/**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\nfunction startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n}\n\nexport default startsWith;\n", - "/**\n * This method returns a new empty object.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Object} Returns the new empty object.\n * @example\n *\n * var objects = _.times(2, _.stubObject);\n *\n * console.log(objects);\n * // => [{}, {}]\n *\n * console.log(objects[0] === objects[1]);\n * // => false\n */\nfunction stubObject() {\n return {};\n}\n\nexport default stubObject;\n", - "/**\n * This method returns an empty string.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {string} Returns the empty string.\n * @example\n *\n * _.times(2, _.stubString);\n * // => ['', '']\n */\nfunction stubString() {\n return '';\n}\n\nexport default stubString;\n", - "/**\n * This method returns `true`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `true`.\n * @example\n *\n * _.times(2, _.stubTrue);\n * // => [true, true]\n */\nfunction stubTrue() {\n return true;\n}\n\nexport default stubTrue;\n", - "import createMathOperation from './_createMathOperation.js';\n\n/**\n * Subtract two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {number} minuend The first number in a subtraction.\n * @param {number} subtrahend The second number in a subtraction.\n * @returns {number} Returns the difference.\n * @example\n *\n * _.subtract(6, 4);\n * // => 2\n */\nvar subtract = createMathOperation(function(minuend, subtrahend) {\n return minuend - subtrahend;\n}, 0);\n\nexport default subtract;\n", - "import baseSum from './_baseSum.js';\nimport identity from './identity.js';\n\n/**\n * Computes the sum of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.sum([4, 2, 8, 6]);\n * // => 20\n */\nfunction sum(array) {\n return (array && array.length)\n ? baseSum(array, identity)\n : 0;\n}\n\nexport default sum;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseSum from './_baseSum.js';\n\n/**\n * This method is like `_.sum` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be summed.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the sum.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.sumBy(objects, function(o) { return o.n; });\n * // => 20\n *\n * // The `_.property` iteratee shorthand.\n * _.sumBy(objects, 'n');\n * // => 20\n */\nfunction sumBy(array, iteratee) {\n return (array && array.length)\n ? baseSum(array, baseIteratee(iteratee, 2))\n : 0;\n}\n\nexport default sumBy;\n", - "import baseSlice from './_baseSlice.js';\n\n/**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\nfunction tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n}\n\nexport default tail;\n", - "import baseSlice from './_baseSlice.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\nfunction take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n}\n\nexport default take;\n", - "import baseSlice from './_baseSlice.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\nfunction takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n}\n\nexport default takeRight;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseWhile from './_baseWhile.js';\n\n/**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\nfunction takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, baseIteratee(predicate, 3), false, true)\n : [];\n}\n\nexport default takeRightWhile;\n", - "import baseIteratee from './_baseIteratee.js';\nimport baseWhile from './_baseWhile.js';\n\n/**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\nfunction takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, baseIteratee(predicate, 3))\n : [];\n}\n\nexport default takeWhile;\n", - "/**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\nfunction tap(value, interceptor) {\n interceptor(value);\n return value;\n}\n\nexport default tap;\n", - "import eq from './eq.js';\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 by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n}\n\nexport default customDefaultsAssignIn;\n", - "/** Used to escape characters for inclusion in compiled string literals. */\nvar stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n};\n\n/**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nfunction escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n}\n\nexport default escapeStringChar;\n", - "/** Used to match template delimiters. */\nvar reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\nexport default reInterpolate;\n", - "/** Used to match template delimiters. */\nvar reEscape = /<%-([\\s\\S]+?)%>/g;\n\nexport default reEscape;\n", - "/** Used to match template delimiters. */\nvar reEvaluate = /<%([\\s\\S]+?)%>/g;\n\nexport default reEvaluate;\n", - "import escape from './escape.js';\nimport reEscape from './_reEscape.js';\nimport reEvaluate from './_reEvaluate.js';\nimport reInterpolate from './_reInterpolate.js';\n\n/**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\nvar templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': { 'escape': escape }\n }\n};\n\nexport default templateSettings;\n", - "import assignInWith from './assignInWith.js';\nimport attempt from './attempt.js';\nimport baseValues from './_baseValues.js';\nimport customDefaultsAssignIn from './_customDefaultsAssignIn.js';\nimport escapeStringChar from './_escapeStringChar.js';\nimport isError from './isError.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport keys from './keys.js';\nimport reInterpolate from './_reInterpolate.js';\nimport templateSettings from './templateSettings.js';\nimport toString from './toString.js';\n\n/** Error message constants. */\nvar INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n/** Used to match empty string literals in compiled template source. */\nvar reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n/**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\nvar reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n/**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\nvar reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n/** Used to ensure capturing order of template delimiters. */\nvar reNoMatch = /($^)/;\n\n/** Used to match unescaped characters in compiled string literals. */\nvar reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\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 a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '